@editora/core 1.0.32 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- class Ao {
1
+ class _o {
2
2
  constructor() {
3
3
  this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
4
4
  }
@@ -98,7 +98,7 @@ class Yt {
98
98
  return new Yt(t, e || this.selection, this.schema);
99
99
  }
100
100
  }
101
- class ln {
101
+ class pn {
102
102
  constructor(t, e) {
103
103
  this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
104
104
  }
@@ -109,7 +109,7 @@ class ln {
109
109
  return { type: "text", text: t, marks: e };
110
110
  }
111
111
  }
112
- class cn {
112
+ class fn {
113
113
  constructor() {
114
114
  this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
115
115
  }
@@ -146,7 +146,7 @@ class cn {
146
146
  const t = {}, e = {};
147
147
  return this.plugins.forEach((o) => {
148
148
  o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
149
- }), new ln(t, e);
149
+ }), new pn(t, e);
150
150
  }
151
151
  getCommands() {
152
152
  const t = {};
@@ -164,9 +164,9 @@ class cn {
164
164
  const r = this.getPlugin(t);
165
165
  if (!r)
166
166
  throw new Error(`Plugin not found: ${t}`);
167
- const a = this.getPluginConfig(t) || r.config || {}, l = a.mode || "local";
167
+ const a = this.getPluginConfig(t) || r.config || {}, s = a.mode || "local";
168
168
  try {
169
- switch (l) {
169
+ switch (s) {
170
170
  case "local":
171
171
  return r.executeLocal ? r.executeLocal(e, ...o) : null;
172
172
  case "api":
@@ -186,7 +186,7 @@ class cn {
186
186
  }
187
187
  break;
188
188
  default:
189
- throw new Error(`Unknown plugin mode: ${l}`);
189
+ throw new Error(`Unknown plugin mode: ${s}`);
190
190
  }
191
191
  } catch (c) {
192
192
  throw console.error(`Error executing command ${e} on plugin ${t}:`, c), c;
@@ -200,7 +200,7 @@ class cn {
200
200
  await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
201
201
  }
202
202
  }
203
- class dn {
203
+ class hn {
204
204
  constructor(t = {}) {
205
205
  this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
206
206
  this.register(e, o);
@@ -243,11 +243,11 @@ class dn {
243
243
  this.commands.clear();
244
244
  }
245
245
  }
246
- class un {
246
+ class mn {
247
247
  constructor(t = {}) {
248
- this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new cn(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
248
+ this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new fn(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
249
249
  const e = this.pluginManager.buildSchema();
250
- this.state = Yt.create(e), this.commandRegistry = new dn(this.pluginManager.getCommands());
250
+ this.state = Yt.create(e), this.commandRegistry = new hn(this.pluginManager.getCommands());
251
251
  }
252
252
  /**
253
253
  * Execute a command
@@ -329,13 +329,76 @@ class un {
329
329
  return this.isDestroyed;
330
330
  }
331
331
  }
332
- class pn {
332
+ const Po = {
333
+ bold: "toggleBold",
334
+ italic: "toggleItalic",
335
+ underline: "toggleUnderline",
336
+ strikethrough: "toggleStrikethrough",
337
+ bullist: "toggleBulletList",
338
+ numlist: "toggleOrderedList",
339
+ checklist: "toggleChecklist",
340
+ link: "openLinkDialog",
341
+ image: "insertImage",
342
+ table: "insertTable",
343
+ trackChanges: "toggleTrackChanges",
344
+ acceptTrackChanges: "acceptAllTrackChanges",
345
+ rejectTrackChanges: "rejectAllTrackChanges",
346
+ anchor: "insertAnchor",
347
+ code: "toggleSourceView",
348
+ blockquote: "toggleBlockquote",
349
+ undo: "undo",
350
+ redo: "redo",
351
+ textColor: "openTextColorPicker",
352
+ backgroundColor: "openBackgroundColorPicker",
353
+ fontSize: "fontSize",
354
+ fontFamily: "setFontFamily",
355
+ lineHeight: "setLineHeight",
356
+ heading: "setBlockType",
357
+ paragraph: "setParagraph",
358
+ textAlignment: "setTextAlignment",
359
+ direction: "setDirectionLTR",
360
+ indent: "increaseIndent",
361
+ outdent: "decreaseIndent",
362
+ capitalization: "setCapitalization",
363
+ math: "insertMath",
364
+ specialCharacters: "insertSpecialCharacter",
365
+ emojis: "openEmojiDialog",
366
+ embedIframe: "openEmbedIframeDialog",
367
+ fullscreen: "toggleFullscreen",
368
+ preview: "togglePreview",
369
+ print: "print",
370
+ a11yChecker: "toggleA11yChecker",
371
+ spellCheck: "toggleSpellCheck",
372
+ comments: "addComment",
373
+ showHideComments: "toggleComments",
374
+ toggleComments: "toggleComments",
375
+ footnote: "insertFootnote",
376
+ mergeTags: "insertMergeTag",
377
+ dataBinding: "openDataBindingDialog",
378
+ dataBindingPreview: "openDataBindingDialog",
379
+ contentRules: "toggleContentRulesPanel",
380
+ contentRulesAudit: "runContentRulesAudit",
381
+ contentRulesRealtime: "toggleContentRulesRealtime",
382
+ mention: "insertMention",
383
+ slash: "openSlashCommands",
384
+ slashCommands: "openSlashCommands",
385
+ pageBreak: "insertPageBreak",
386
+ template: "insertTemplate",
387
+ importWord: "importWord",
388
+ exportWord: "exportWord",
389
+ exportPdf: "exportPdf",
390
+ insertImage: "insertImage",
391
+ insertVideo: "insertVideo",
392
+ insertAudio: "insertAudio",
393
+ codeBlock: "insertCodeBlock"
394
+ };
395
+ class gn {
333
396
  constructor(t, e, o) {
334
397
  this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (r) => {
335
- var l, c;
398
+ var s, c;
336
399
  if (!this.expandedOpen) return;
337
400
  const a = r.target;
338
- a && ((l = this.moreButton) != null && l.contains(a) || (c = this.expandedRow) != null && c.contains(a)) || this.setExpandedOpen(!1);
401
+ a && ((s = this.moreButton) != null && s.contains(a) || (c = this.expandedRow) != null && c.contains(a)) || this.setExpandedOpen(!1);
339
402
  }, this.config = t, this.plugins = e, this.pluginLoader = o;
340
403
  }
341
404
  setLastCommandTrigger(t, e) {
@@ -353,126 +416,62 @@ class pn {
353
416
  * Parse toolbar string into button groups
354
417
  */
355
418
  parseToolbarString(t) {
356
- const e = [], o = t.split("|").map((c) => c.trim()), r = this.getAvailableToolbarItems(), a = /* @__PURE__ */ new Map();
357
- r.forEach((c) => {
358
- c.command && a.set(c.command, c), c.type === "group" && c.label && a.set(c.label, c);
359
- });
360
- const l = {
361
- bold: "toggleBold",
362
- italic: "toggleItalic",
363
- underline: "toggleUnderline",
364
- strikethrough: "toggleStrikethrough",
365
- bullist: "toggleBulletList",
366
- numlist: "toggleOrderedList",
367
- checklist: "toggleChecklist",
368
- link: "openLinkDialog",
369
- image: "openImageDialog",
370
- table: "insertTable",
371
- trackChanges: "toggleTrackChanges",
372
- acceptTrackChanges: "acceptAllTrackChanges",
373
- rejectTrackChanges: "rejectAllTrackChanges",
374
- anchor: "insertAnchor",
375
- code: "toggleSourceView",
376
- blockquote: "toggleBlockquote",
377
- undo: "undo",
378
- redo: "redo",
379
- textColor: "openTextColorPicker",
380
- backgroundColor: "openBackgroundColorPicker",
381
- fontSize: "fontSize",
382
- fontFamily: "setFontFamily",
383
- lineHeight: "setLineHeight",
384
- heading: "setBlockType",
385
- paragraph: "setParagraph",
386
- textAlignment: "setTextAlignment",
387
- direction: "setDirectionLTR",
388
- indent: "increaseIndent",
389
- outdent: "decreaseIndent",
390
- capitalization: "setCapitalization",
391
- math: "insertMath",
392
- specialCharacters: "insertSpecialCharacter",
393
- emojis: "openEmojiDialog",
394
- embedIframe: "openEmbedIframeDialog",
395
- fullscreen: "toggleFullscreen",
396
- preview: "togglePreview",
397
- print: "print",
398
- a11yChecker: "toggleA11yChecker",
399
- spellCheck: "toggleSpellCheck",
400
- comments: "addComment",
401
- showHideComments: "toggleComments",
402
- toggleComments: "toggleComments",
403
- footnote: "insertFootnote",
404
- mergeTags: "insertMergeTag",
405
- dataBinding: "openDataBindingDialog",
406
- dataBindingPreview: "openDataBindingDialog",
407
- contentRules: "toggleContentRulesPanel",
408
- contentRulesAudit: "runContentRulesAudit",
409
- contentRulesRealtime: "toggleContentRulesRealtime",
410
- mention: "insertMention",
411
- slash: "openSlashCommands",
412
- slashCommands: "openSlashCommands",
413
- pageBreak: "insertPageBreak",
414
- template: "insertTemplate",
415
- importWord: "importWord",
416
- exportWord: "exportWord",
417
- exportPdf: "exportPdf",
418
- insertImage: "insertImage",
419
- insertVideo: "insertVideo",
420
- insertAudio: "insertAudio",
421
- codeBlock: "insertCodeBlock"
422
- };
423
- return o.forEach((c) => {
424
- const p = [];
425
- c.split(/\s+/).filter(Boolean).forEach((g) => {
426
- if (g === "direction") {
427
- const E = a.get("setDirectionLTR"), T = a.get("setDirectionRTL");
428
- E && p.push({
419
+ const e = [], o = t.split("|").map((s) => s.trim()), r = this.getAvailableToolbarItems(), a = /* @__PURE__ */ new Map();
420
+ return r.forEach((s) => {
421
+ s.command && a.set(s.command, s), s.type === "group" && s.label && a.set(s.label, s);
422
+ }), o.forEach((s) => {
423
+ const c = [];
424
+ s.split(/\s+/).filter(Boolean).forEach((h) => {
425
+ if (h === "direction") {
426
+ const k = a.get("setDirectionLTR"), w = a.get("setDirectionRTL");
427
+ k && c.push({
429
428
  id: "directionLTR",
430
- label: E.label,
431
- command: E.command,
432
- icon: E.icon,
433
- type: E.type || "button",
434
- options: E.options
435
- }), T && p.push({
429
+ label: k.label,
430
+ command: k.command,
431
+ icon: k.icon,
432
+ type: k.type || "button",
433
+ options: k.options
434
+ }), w && c.push({
436
435
  id: "directionRTL",
437
- label: T.label,
438
- command: T.command,
439
- icon: T.icon,
440
- type: T.type || "button",
441
- options: T.options
436
+ label: w.label,
437
+ command: w.command,
438
+ icon: w.icon,
439
+ type: w.type || "button",
440
+ options: w.options
442
441
  });
443
442
  return;
444
443
  }
445
- if (g === "comments") {
446
- const E = a.get("addComment"), T = a.get("toggleComments");
447
- E && p.push({
444
+ if (h === "comments") {
445
+ const k = a.get("addComment"), w = a.get("toggleComments");
446
+ k && c.push({
448
447
  id: "addComment",
449
- label: E.label,
450
- command: E.command,
451
- icon: E.icon,
452
- type: E.type || "button",
453
- options: E.options
454
- }), T && p.push({
448
+ label: k.label,
449
+ command: k.command,
450
+ icon: k.icon,
451
+ type: k.type || "button",
452
+ options: k.options
453
+ }), w && c.push({
455
454
  id: "toggleComments",
456
- label: T.label,
457
- command: T.command,
458
- icon: T.icon,
459
- type: T.type || "button",
460
- options: T.options
455
+ label: w.label,
456
+ command: w.command,
457
+ icon: w.icon,
458
+ type: w.type || "button",
459
+ options: w.options
461
460
  });
462
461
  return;
463
462
  }
464
- const w = l[g] || g;
465
- let k = a.get(w);
466
- k || (k = a.get(g)), k && p.push({
467
- id: g,
468
- label: k.label,
469
- command: k.command,
470
- icon: k.icon,
471
- type: k.type === "separator" ? "separator" : k.type || "button",
472
- options: k.options,
473
- items: k.items
463
+ const g = Po[h] || h;
464
+ let b = a.get(g);
465
+ b || (b = a.get(h)), b && c.push({
466
+ id: h,
467
+ label: b.label,
468
+ command: b.command,
469
+ icon: b.icon,
470
+ type: b.type === "separator" ? "separator" : b.type || "button",
471
+ options: b.options,
472
+ items: b.items
474
473
  });
475
- }), p.length > 0 && e.push(p);
474
+ }), c.length > 0 && e.push(c);
476
475
  }), e;
477
476
  }
478
477
  /**
@@ -489,15 +488,15 @@ class pn {
489
488
  const e = document.createElement("div");
490
489
  e.className = "editora-toolbar-items-container", this.itemsContainer = e, this.overflowUnits = [];
491
490
  const o = this.config.items || this.getDefaultToolbarString(), r = this.parseToolbarString(o);
492
- r.forEach((a, l) => {
491
+ r.forEach((a, s) => {
493
492
  const c = document.createElement("div");
494
- if (c.className = "editora-toolbar-group", a.forEach((p) => {
495
- this.appendToolbarButton(c, p);
496
- const m = c.lastElementChild;
497
- m instanceof HTMLElement && (this.overflowUnits.push(m), this.overflowUnitHomes.set(m, c));
498
- }), e.appendChild(c), l < r.length - 1) {
499
- const p = document.createElement("div");
500
- p.className = "editora-toolbar-separator", e.appendChild(p);
493
+ if (c.className = "editora-toolbar-group", a.forEach((f) => {
494
+ this.appendToolbarButton(c, f);
495
+ const h = c.lastElementChild;
496
+ h instanceof HTMLElement && (this.overflowUnits.push(h), this.overflowUnitHomes.set(h, c));
497
+ }), e.appendChild(c), s < r.length - 1) {
498
+ const f = document.createElement("div");
499
+ f.className = "editora-toolbar-separator", e.appendChild(f);
501
500
  }
502
501
  }), t.appendChild(e), this.setupOverflow(t);
503
502
  }
@@ -519,26 +518,26 @@ class pn {
519
518
  var D;
520
519
  B.parentElement === r && ((D = this.overflowUnitHomes.get(B)) == null || D.appendChild(B));
521
520
  });
522
- const p = t.clientWidth, m = 16, g = 40, w = 4, k = Math.max(0, p - m), E = Math.max(0, k - g - w), T = getComputedStyle(t).direction === "rtl", et = e.getBoundingClientRect(), G = (B) => {
521
+ const f = t.clientWidth, h = 16, g = 40, b = 4, k = Math.max(0, f - h), w = Math.max(0, k - g - b), R = getComputedStyle(t).direction === "rtl", et = e.getBoundingClientRect(), G = (B) => {
523
522
  const D = B.getBoundingClientRect();
524
- return T ? et.right - D.left : D.right - et.left;
523
+ return R ? et.right - D.left : D.right - et.left;
525
524
  };
526
525
  let z = 0;
527
526
  if (G(c[c.length - 1]) <= k)
528
527
  z = c.length;
529
528
  else
530
529
  for (const B of c)
531
- if (G(B) <= E) z++;
530
+ if (G(B) <= w) z++;
532
531
  else break;
533
532
  z = Math.max(1, Math.min(z, c.length));
534
533
  const st = z < c.length;
535
534
  o.style.display = st ? "" : "none", o.classList.toggle("active", st && this.expandedOpen), !st && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B, D) => {
536
535
  D >= z && r.appendChild(B);
537
536
  });
538
- }, l = () => {
537
+ }, s = () => {
539
538
  this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(a);
540
539
  };
541
- this.resizeObserver = new ResizeObserver(() => l()), this.resizeObserver.observe(t), l();
540
+ this.resizeObserver = new ResizeObserver(() => s()), this.resizeObserver.observe(t), s();
542
541
  }
543
542
  setExpandedOpen(t) {
544
543
  var e, o;
@@ -621,42 +620,42 @@ class pn {
621
620
  * mouse click leaves the focus alone, so the editor keeps its selection.
622
621
  */
623
622
  makeMenuAccessible(t, e, o, r) {
624
- e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", "false"), o.setAttribute("role", "menu"), o.setAttribute("aria-label", r), o.querySelectorAll(".editora-toolbar-dropdown-item").forEach((m) => {
625
- m.setAttribute("role", "menuitem"), m.tabIndex = -1;
623
+ e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", "false"), o.setAttribute("role", "menu"), o.setAttribute("aria-label", r), o.querySelectorAll(".editora-toolbar-dropdown-item").forEach((h) => {
624
+ h.setAttribute("role", "menuitem"), h.tabIndex = -1;
626
625
  });
627
- const a = () => Array.from(o.querySelectorAll('[role="menuitem"]')), l = () => o.style.display === "block", c = new MutationObserver(() => {
628
- e.setAttribute("aria-expanded", l() ? "true" : "false");
626
+ const a = () => Array.from(o.querySelectorAll('[role="menuitem"]')), s = () => o.style.display === "block", c = new MutationObserver(() => {
627
+ e.setAttribute("aria-expanded", s() ? "true" : "false");
629
628
  });
630
629
  c.observe(o, { attributes: !0, attributeFilter: ["style"] });
631
- const p = t._cleanupDropdown;
630
+ const f = t._cleanupDropdown;
632
631
  t._cleanupDropdown = () => {
633
- c.disconnect(), p == null || p();
634
- }, e.addEventListener("click", (m) => {
632
+ c.disconnect(), f == null || f();
633
+ }, e.addEventListener("click", (h) => {
635
634
  var g;
636
- m.detail === 0 && l() && ((g = a()[0]) == null || g.focus());
637
- }), e.addEventListener("keydown", (m) => {
638
- var w;
639
- if (m.key !== "ArrowDown" && m.key !== "ArrowUp") return;
640
- m.preventDefault(), l() || e.click();
635
+ h.detail === 0 && s() && ((g = a()[0]) == null || g.focus());
636
+ }), e.addEventListener("keydown", (h) => {
637
+ var b;
638
+ if (h.key !== "ArrowDown" && h.key !== "ArrowUp") return;
639
+ h.preventDefault(), s() || e.click();
641
640
  const g = a();
642
- (w = m.key === "ArrowUp" ? g[g.length - 1] : g[0]) == null || w.focus();
643
- }), o.addEventListener("keydown", (m) => {
641
+ (b = h.key === "ArrowUp" ? g[g.length - 1] : g[0]) == null || b.focus();
642
+ }), o.addEventListener("keydown", (h) => {
644
643
  const g = a();
645
644
  if (g.length === 0) return;
646
- const w = g.indexOf(document.activeElement), k = (E) => {
647
- m.preventDefault(), g[(E + g.length) % g.length].focus();
645
+ const b = g.indexOf(document.activeElement), k = (w) => {
646
+ h.preventDefault(), g[(w + g.length) % g.length].focus();
648
647
  };
649
- switch (m.key) {
648
+ switch (h.key) {
650
649
  case "ArrowDown":
651
- return k(w + 1);
650
+ return k(b + 1);
652
651
  case "ArrowUp":
653
- return k(w < 0 ? g.length - 1 : w - 1);
652
+ return k(b < 0 ? g.length - 1 : b - 1);
654
653
  case "Home":
655
654
  return k(0);
656
655
  case "End":
657
656
  return k(g.length - 1);
658
657
  case "Escape":
659
- m.preventDefault(), m.stopPropagation(), o.style.display = "none", e.focus();
658
+ h.preventDefault(), h.stopPropagation(), o.style.display = "none", e.focus();
660
659
  return;
661
660
  case "Tab":
662
661
  o.style.display = "none";
@@ -674,22 +673,22 @@ class pn {
674
673
  o.className = "editora-toolbar-button editora-toolbar-dropdown-trigger", o.type = "button", o.textContent = t.label;
675
674
  const r = document.createElement("div");
676
675
  r.className = "editora-toolbar-dropdown-menu", r.style.display = "none", t.options && t.options.forEach((c) => {
677
- const p = document.createElement("button");
678
- p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (m) => {
679
- m.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), r.style.display = "none";
680
- }), r.appendChild(p);
676
+ const f = document.createElement("button");
677
+ f.className = "editora-toolbar-dropdown-item", f.type = "button", f.textContent = c.label, f.setAttribute("data-value", c.value), f.addEventListener("click", (h) => {
678
+ h.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), r.style.display = "none";
679
+ }), r.appendChild(f);
681
680
  }), o.addEventListener("click", (c) => {
682
681
  c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
683
- const p = r.style.display === "block";
684
- r.style.display = p ? "none" : "block";
682
+ const f = r.style.display === "block";
683
+ r.style.display = f ? "none" : "block";
685
684
  });
686
685
  const a = (c) => {
687
686
  e.contains(c.target) || (r.style.display = "none");
688
- }, l = (c) => {
687
+ }, s = (c) => {
689
688
  c.key === "Escape" && (r.style.display = "none");
690
689
  };
691
- return document.addEventListener("mousedown", a, !0), document.addEventListener("keydown", l), e._cleanupDropdown = () => {
692
- document.removeEventListener("mousedown", a, !0), document.removeEventListener("keydown", l);
690
+ return document.addEventListener("mousedown", a, !0), document.addEventListener("keydown", s), e._cleanupDropdown = () => {
691
+ document.removeEventListener("mousedown", a, !0), document.removeEventListener("keydown", s);
693
692
  }, e.appendChild(o), e.appendChild(r), this.makeMenuAccessible(e, o, r, t.label), e;
694
693
  }
695
694
  /**
@@ -709,27 +708,27 @@ class pn {
709
708
  o.textContent = t.label;
710
709
  const r = document.createElement("div");
711
710
  r.className = "editora-toolbar-dropdown-menu", r.style.display = "none", t.options && t.options.forEach((c) => {
712
- const p = document.createElement("button");
713
- p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (m) => {
714
- m.preventDefault(), m.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), r.style.display = "none";
715
- }), r.appendChild(p);
711
+ const f = document.createElement("button");
712
+ f.className = "editora-toolbar-dropdown-item", f.type = "button", f.textContent = c.label, f.setAttribute("data-value", c.value), f.addEventListener("click", (h) => {
713
+ h.preventDefault(), h.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), r.style.display = "none";
714
+ }), r.appendChild(f);
716
715
  }), o.addEventListener("click", (c) => {
717
- var m;
716
+ var h;
718
717
  c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
719
- const p = (m = this.container) == null ? void 0 : m.querySelectorAll(
718
+ const f = (h = this.container) == null ? void 0 : h.querySelectorAll(
720
719
  ".editora-toolbar-dropdown-menu"
721
720
  );
722
- p == null || p.forEach((g) => {
721
+ f == null || f.forEach((g) => {
723
722
  g !== r && (g.style.display = "none");
724
723
  }), r.style.display = r.style.display === "none" ? "block" : "none";
725
724
  });
726
725
  const a = (c) => {
727
726
  e.contains(c.target) || (r.style.display = "none");
728
- }, l = (c) => {
727
+ }, s = (c) => {
729
728
  c.key === "Escape" && (r.style.display = "none");
730
729
  };
731
- return document.addEventListener("mousedown", a, !0), document.addEventListener("keydown", l), e._cleanupDropdown = () => {
732
- document.removeEventListener("mousedown", a, !0), document.removeEventListener("keydown", l);
730
+ return document.addEventListener("mousedown", a, !0), document.addEventListener("keydown", s), e._cleanupDropdown = () => {
731
+ document.removeEventListener("mousedown", a, !0), document.removeEventListener("keydown", s);
733
732
  }, e.appendChild(o), e.appendChild(r), this.makeMenuAccessible(e, o, r, t.label), e;
734
733
  }
735
734
  /**
@@ -759,7 +758,7 @@ class pn {
759
758
  }), this.container.innerHTML = ""), (t = this.resizeObserver) == null || t.disconnect(), this.resizeObserver = void 0, this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), document.removeEventListener("mousedown", this.onDocumentPointerDownForOverflow, !0), this.itemsContainer = void 0, this.moreButton = void 0, this.expandedRow = void 0, this.commandHandler = void 0;
760
759
  }
761
760
  }
762
- class fn {
761
+ class bn {
763
762
  constructor(t) {
764
763
  this.visible = !1, this.config = t;
765
764
  }
@@ -801,7 +800,7 @@ class fn {
801
800
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
802
801
  }
803
802
  }
804
- class hn {
803
+ class yn {
805
804
  constructor(t = {}) {
806
805
  this.statusInfo = {}, this.config = t;
807
806
  }
@@ -838,19 +837,19 @@ class hn {
838
837
  }
839
838
  this.statusInfo.language && o.push(this.statusInfo.language);
840
839
  const r = [];
841
- this.statusInfo.wordCount !== void 0 && r.push(`${this.statusInfo.wordCount} words`), this.statusInfo.charCount !== void 0 && r.push(`${this.statusInfo.charCount} chars`), this.statusInfo.lineCount !== void 0 && r.push(`${this.statusInfo.lineCount} lines`), this.statusInfo.custom && Object.entries(this.statusInfo.custom).forEach(([a, l]) => {
842
- r.push(`${a}: ${l}`);
843
- }), o.forEach((a, l) => {
840
+ this.statusInfo.wordCount !== void 0 && r.push(`${this.statusInfo.wordCount} words`), this.statusInfo.charCount !== void 0 && r.push(`${this.statusInfo.charCount} chars`), this.statusInfo.lineCount !== void 0 && r.push(`${this.statusInfo.lineCount} lines`), this.statusInfo.custom && Object.entries(this.statusInfo.custom).forEach(([a, s]) => {
841
+ r.push(`${a}: ${s}`);
842
+ }), o.forEach((a, s) => {
844
843
  const c = document.createElement("span");
845
- if (c.className = "editora-statusbar-item", c.textContent = a, t.appendChild(c), l < o.length - 1) {
846
- const p = document.createElement("span");
847
- p.className = "editora-statusbar-separator", p.textContent = "|", t.appendChild(p);
844
+ if (c.className = "editora-statusbar-item", c.textContent = a, t.appendChild(c), s < o.length - 1) {
845
+ const f = document.createElement("span");
846
+ f.className = "editora-statusbar-separator", f.textContent = "|", t.appendChild(f);
848
847
  }
849
- }), r.forEach((a, l) => {
848
+ }), r.forEach((a, s) => {
850
849
  const c = document.createElement("span");
851
- if (c.className = "editora-statusbar-item", c.textContent = a, e.appendChild(c), l < r.length - 1) {
852
- const p = document.createElement("span");
853
- p.className = "editora-statusbar-separator", p.textContent = "|", e.appendChild(p);
850
+ if (c.className = "editora-statusbar-item", c.textContent = a, e.appendChild(c), s < r.length - 1) {
851
+ const f = document.createElement("span");
852
+ f.className = "editora-statusbar-separator", f.textContent = "|", e.appendChild(f);
854
853
  }
855
854
  }), this.container.appendChild(t), this.container.appendChild(e);
856
855
  }
@@ -861,13 +860,13 @@ class hn {
861
860
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
862
861
  }
863
862
  }
864
- function mn(n, t) {
865
- const e = n.textContent || "", o = gn(n, t.startContainer, t.startOffset), a = e.substring(0, o).split(`
866
- `), l = a.length, c = a[a.length - 1].length + 1;
867
- return { line: l, column: c };
863
+ function En(n, t) {
864
+ const e = n.textContent || "", o = vn(n, t.startContainer, t.startOffset), a = e.substring(0, o).split(`
865
+ `), s = a.length, c = a[a.length - 1].length + 1;
866
+ return { line: s, column: c };
868
867
  }
869
- function gn(n, t, e) {
870
- var l;
868
+ function vn(n, t, e) {
869
+ var s;
871
870
  let o = 0;
872
871
  const r = document.createTreeWalker(
873
872
  n,
@@ -879,12 +878,12 @@ function gn(n, t, e) {
879
878
  if (a === t) {
880
879
  o += e;
881
880
  break;
882
- } else a.nodeType === Node.TEXT_NODE && (o += ((l = a.textContent) == null ? void 0 : l.length) || 0);
881
+ } else a.nodeType === Node.TEXT_NODE && (o += ((s = a.textContent) == null ? void 0 : s.length) || 0);
883
882
  a = r.nextNode();
884
883
  }
885
884
  return o;
886
885
  }
887
- function bn(n) {
886
+ function kn(n) {
888
887
  var o, r;
889
888
  const t = n.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
890
889
  let e = 1;
@@ -893,17 +892,17 @@ function bn(n) {
893
892
  const a = t[t.length - 1];
894
893
  (a.tagName === "BR" || ((o = a.innerHTML) == null ? void 0 : o.trim()) === "" || ((r = a.textContent) == null ? void 0 : r.trim()) === "") && e++;
895
894
  } else {
896
- const l = (n.textContent || "").split(`
895
+ const s = (n.textContent || "").split(`
897
896
  `).length;
898
- e = Math.max(1, l);
897
+ e = Math.max(1, s);
899
898
  }
900
899
  return e;
901
900
  }
902
- function yn(n) {
901
+ function wn(n) {
903
902
  const t = n.trim() ? n.trim().split(/\s+/).length : 0, e = n.length;
904
903
  return { words: t, chars: e };
905
904
  }
906
- function vn(n, t) {
905
+ function Tn(n, t) {
907
906
  const e = n.toString();
908
907
  return {
909
908
  startLine: t.line,
@@ -915,7 +914,7 @@ function vn(n, t) {
915
914
  selectedWords: e.trim().split(/\s+/).filter(Boolean).length
916
915
  };
917
916
  }
918
- class En {
917
+ class Cn {
919
918
  constructor(t) {
920
919
  this.shortcuts = /* @__PURE__ */ new Map(), this.enabled = !0, this.isMac = typeof navigator != "undefined" && navigator.platform.toUpperCase().indexOf("MAC") >= 0, (t == null ? void 0 : t.enabled) === !1 && (this.enabled = !1), this.registerDefaultShortcuts(), t != null && t.shortcuts && t.shortcuts.forEach((e) => this.registerShortcut(e)), t != null && t.customShortcuts && Object.values(t.customShortcuts).forEach((e) => {
921
920
  this.registerShortcut(e);
@@ -1238,9 +1237,9 @@ class En {
1238
1237
  return e.forEach((r, a) => {
1239
1238
  o += `## ${a}
1240
1239
 
1241
- `, r.forEach((l) => {
1242
- const c = this.getShortcutDescription(l);
1243
- o += `- **${c}**: ${l.description || l.command}
1240
+ `, r.forEach((s) => {
1241
+ const c = this.getShortcutDescription(s);
1242
+ o += `- **${c}**: ${s.description || s.command}
1244
1243
  `;
1245
1244
  }), o += `
1246
1245
  `;
@@ -1250,153 +1249,153 @@ class En {
1250
1249
  return t.includes("toggle") && (t.includes("Bold") || t.includes("Italic") || t.includes("Underline") || t.includes("Strike") || t.includes("Code") || t.includes("Super") || t.includes("Sub")) ? "Text Formatting" : t.includes("Heading") || t.includes("Paragraph") ? "Block Formatting" : t.includes("List") || t.includes("Checklist") ? "Lists" : t.includes("Alignment") || t.includes("Indent") ? "Alignment & Indentation" : t.includes("undo") || t.includes("redo") ? "History" : t.includes("insert") ? "Insert" : t.includes("find") || t.includes("replace") ? "Find & Replace" : t.includes("Accessibility") || t.includes("spell") ? "Tools" : "Other";
1251
1250
  }
1252
1251
  }
1253
- function ro(n, t) {
1252
+ function ao(n, t) {
1254
1253
  (t == null || t > n.length) && (t = n.length);
1255
1254
  for (var e = 0, o = Array(t); e < t; e++) o[e] = n[e];
1256
1255
  return o;
1257
1256
  }
1258
- function wn(n) {
1257
+ function An(n) {
1259
1258
  if (Array.isArray(n)) return n;
1260
1259
  }
1261
- function kn(n, t) {
1260
+ function xn(n, t) {
1262
1261
  var e = n == null ? null : typeof Symbol != "undefined" && n[Symbol.iterator] || n["@@iterator"];
1263
1262
  if (e != null) {
1264
- var o, r, a, l, c = [], p = !0, m = !1;
1263
+ var o, r, a, s, c = [], f = !0, h = !1;
1265
1264
  try {
1266
- if (a = (e = e.call(n)).next, t !== 0) for (; !(p = (o = a.call(e)).done) && (c.push(o.value), c.length !== t); p = !0) ;
1265
+ if (a = (e = e.call(n)).next, t !== 0) for (; !(f = (o = a.call(e)).done) && (c.push(o.value), c.length !== t); f = !0) ;
1267
1266
  } catch (g) {
1268
- m = !0, r = g;
1267
+ h = !0, r = g;
1269
1268
  } finally {
1270
1269
  try {
1271
- if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
1270
+ if (!f && e.return != null && (s = e.return(), Object(s) !== s)) return;
1272
1271
  } finally {
1273
- if (m) throw r;
1272
+ if (h) throw r;
1274
1273
  }
1275
1274
  }
1276
1275
  return c;
1277
1276
  }
1278
1277
  }
1279
- function Tn() {
1278
+ function Sn() {
1280
1279
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1281
1280
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1282
1281
  }
1283
- function xn(n, t) {
1284
- return wn(n) || kn(n, t) || Cn(n, t) || Tn();
1282
+ function Ln(n, t) {
1283
+ return An(n) || xn(n, t) || _n(n, t) || Sn();
1285
1284
  }
1286
- function Cn(n, t) {
1285
+ function _n(n, t) {
1287
1286
  if (n) {
1288
- if (typeof n == "string") return ro(n, t);
1287
+ if (typeof n == "string") return ao(n, t);
1289
1288
  var e = {}.toString.call(n).slice(8, -1);
1290
- return e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set" ? Array.from(n) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ro(n, t) : void 0;
1289
+ return e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set" ? Array.from(n) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ao(n, t) : void 0;
1291
1290
  }
1292
1291
  }
1293
- const So = Object.entries, ao = Object.setPrototypeOf, An = Object.isFrozen, Sn = Object.getPrototypeOf, _n = Object.getOwnPropertyDescriptor;
1294
- let M = Object.freeze, I = Object.seal, yt = Object.create, _o = typeof Reflect != "undefined" && Reflect, Te = _o.apply, xe = _o.construct;
1295
- M || (M = function(t) {
1292
+ const Io = Object.entries, so = Object.setPrototypeOf, Pn = Object.isFrozen, In = Object.getPrototypeOf, Dn = Object.getOwnPropertyDescriptor;
1293
+ let _ = Object.freeze, P = Object.seal, Et = Object.create, Do = typeof Reflect != "undefined" && Reflect, Ce = Do.apply, Ae = Do.construct;
1294
+ _ || (_ = function(t) {
1296
1295
  return t;
1297
1296
  });
1298
- I || (I = function(t) {
1297
+ P || (P = function(t) {
1299
1298
  return t;
1300
1299
  });
1301
- Te || (Te = function(t, e) {
1300
+ Ce || (Ce = function(t, e) {
1302
1301
  for (var o = arguments.length, r = new Array(o > 2 ? o - 2 : 0), a = 2; a < o; a++) r[a - 2] = arguments[a];
1303
1302
  return t.apply(e, r);
1304
1303
  });
1305
- xe || (xe = function(t) {
1304
+ Ae || (Ae = function(t) {
1306
1305
  for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) o[r - 1] = arguments[r];
1307
1306
  return new t(...o);
1308
1307
  });
1309
- const at = L(Array.prototype.forEach), Ln = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), Ct = L(Array.prototype.push), Mn = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), me = L(String.prototype.toString), lo = L(String.prototype.match), At = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim), Pn = L(Number.prototype.toString), Dn = L(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), po = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), N = L(Object.prototype.hasOwnProperty), St = L(Object.prototype.toString), P = L(RegExp.prototype.test), J = On(TypeError);
1308
+ const at = L(Array.prototype.forEach), Mn = L(Array.prototype.lastIndexOf), lo = L(Array.prototype.pop), xt = L(Array.prototype.push), Rn = L(Array.prototype.splice), vt = Array.isArray, Pt = L(String.prototype.toLowerCase), me = L(String.prototype.toString), co = L(String.prototype.match), St = L(String.prototype.replace), uo = L(String.prototype.indexOf), On = L(String.prototype.trim), Nn = L(Number.prototype.toString), zn = L(Boolean.prototype.toString), po = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), fo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), N = L(Object.prototype.hasOwnProperty), Lt = L(Object.prototype.toString), I = L(RegExp.prototype.test), Z = Bn(TypeError);
1310
1309
  function L(n) {
1311
1310
  return function(t) {
1312
1311
  t instanceof RegExp && (t.lastIndex = 0);
1313
1312
  for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) o[r - 1] = arguments[r];
1314
- return Te(n, t, o);
1313
+ return Ce(n, t, o);
1315
1314
  };
1316
1315
  }
1317
- function On(n) {
1316
+ function Bn(n) {
1318
1317
  return function() {
1319
1318
  for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
1320
- return xe(n, e);
1319
+ return Ae(n, e);
1321
1320
  };
1322
1321
  }
1323
1322
  function v(n, t) {
1324
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Mt;
1325
- if (ao && ao(n, null), !vt(t)) return n;
1323
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Pt;
1324
+ if (so && so(n, null), !vt(t)) return n;
1326
1325
  let o = t.length;
1327
1326
  for (; o--; ) {
1328
1327
  let r = t[o];
1329
1328
  if (typeof r == "string") {
1330
1329
  const a = e(r);
1331
- a !== r && (An(t) || (t[o] = a), r = a);
1330
+ a !== r && (Pn(t) || (t[o] = a), r = a);
1332
1331
  }
1333
1332
  n[r] = !0;
1334
1333
  }
1335
1334
  return n;
1336
1335
  }
1337
- function Rn(n) {
1336
+ function Fn(n) {
1338
1337
  for (let t = 0; t < n.length; t++) N(n, t) || (n[t] = null);
1339
1338
  return n;
1340
1339
  }
1341
1340
  function U(n) {
1342
- const t = yt(null);
1343
- for (const o of So(n)) {
1344
- var e = xn(o, 2);
1341
+ const t = Et(null);
1342
+ for (const o of Io(n)) {
1343
+ var e = Ln(o, 2);
1345
1344
  const r = e[0], a = e[1];
1346
- N(n, r) && (vt(a) ? t[r] = Rn(a) : a && typeof a == "object" && a.constructor === Object ? t[r] = U(a) : t[r] = a);
1345
+ N(n, r) && (vt(a) ? t[r] = Fn(a) : a && typeof a == "object" && a.constructor === Object ? t[r] = U(a) : t[r] = a);
1347
1346
  }
1348
1347
  return t;
1349
1348
  }
1350
- function Nn(n) {
1349
+ function Hn(n) {
1351
1350
  switch (typeof n) {
1352
1351
  case "string":
1353
1352
  return n;
1354
1353
  case "number":
1355
- return Pn(n);
1354
+ return Nn(n);
1356
1355
  case "boolean":
1357
- return Dn(n);
1356
+ return zn(n);
1358
1357
  case "bigint":
1359
- return uo ? uo(n) : "0";
1358
+ return po ? po(n) : "0";
1360
1359
  case "symbol":
1361
- return po ? po(n) : "Symbol()";
1360
+ return fo ? fo(n) : "Symbol()";
1362
1361
  case "undefined":
1363
- return St(n);
1362
+ return Lt(n);
1364
1363
  case "function":
1365
1364
  case "object": {
1366
- if (n === null) return St(n);
1365
+ if (n === null) return Lt(n);
1367
1366
  const t = n, e = W(t, "toString");
1368
1367
  if (typeof e == "function") {
1369
1368
  const o = e(t);
1370
- return typeof o == "string" ? o : St(o);
1369
+ return typeof o == "string" ? o : Lt(o);
1371
1370
  }
1372
- return St(n);
1371
+ return Lt(n);
1373
1372
  }
1374
1373
  default:
1375
- return St(n);
1374
+ return Lt(n);
1376
1375
  }
1377
1376
  }
1378
1377
  function W(n, t) {
1379
1378
  for (; n !== null; ) {
1380
- const o = _n(n, t);
1379
+ const o = Dn(n, t);
1381
1380
  if (o) {
1382
1381
  if (o.get) return L(o.get);
1383
1382
  if (typeof o.value == "function") return L(o.value);
1384
1383
  }
1385
- n = Sn(n);
1384
+ n = In(n);
1386
1385
  }
1387
1386
  function e() {
1388
1387
  return null;
1389
1388
  }
1390
1389
  return e;
1391
1390
  }
1392
- function zn(n) {
1391
+ function Un(n) {
1393
1392
  try {
1394
- return P(n, ""), !0;
1393
+ return I(n, ""), !0;
1395
1394
  } catch (t) {
1396
1395
  return !1;
1397
1396
  }
1398
1397
  }
1399
- const fo = M([
1398
+ const ho = _([
1400
1399
  "a",
1401
1400
  "abbr",
1402
1401
  "acronym",
@@ -1516,7 +1515,7 @@ const fo = M([
1516
1515
  "var",
1517
1516
  "video",
1518
1517
  "wbr"
1519
- ]), ge = M([
1518
+ ]), ge = _([
1520
1519
  "svg",
1521
1520
  "a",
1522
1521
  "altglyph",
@@ -1564,7 +1563,7 @@ const fo = M([
1564
1563
  "tspan",
1565
1564
  "view",
1566
1565
  "vkern"
1567
- ]), be = M([
1566
+ ]), be = _([
1568
1567
  "feBlend",
1569
1568
  "feColorMatrix",
1570
1569
  "feComponentTransfer",
@@ -1590,7 +1589,7 @@ const fo = M([
1590
1589
  "feSpotLight",
1591
1590
  "feTile",
1592
1591
  "feTurbulence"
1593
- ]), Bn = M([
1592
+ ]), jn = _([
1594
1593
  "animate",
1595
1594
  "color-profile",
1596
1595
  "cursor",
@@ -1613,7 +1612,7 @@ const fo = M([
1613
1612
  "solidcolor",
1614
1613
  "unknown",
1615
1614
  "use"
1616
- ]), ye = M([
1615
+ ]), ye = _([
1617
1616
  "math",
1618
1617
  "menclose",
1619
1618
  "merror",
@@ -1644,7 +1643,7 @@ const fo = M([
1644
1643
  "munder",
1645
1644
  "munderover",
1646
1645
  "mprescripts"
1647
- ]), Fn = M([
1646
+ ]), Wn = _([
1648
1647
  "maction",
1649
1648
  "maligngroup",
1650
1649
  "malignmark",
@@ -1660,7 +1659,7 @@ const fo = M([
1660
1659
  "annotation-xml",
1661
1660
  "mprescripts",
1662
1661
  "none"
1663
- ]), ho = M(["#text"]), mo = M([
1662
+ ]), mo = _(["#text"]), go = _([
1664
1663
  "accept",
1665
1664
  "action",
1666
1665
  "align",
@@ -1779,7 +1778,7 @@ const fo = M([
1779
1778
  "width",
1780
1779
  "wrap",
1781
1780
  "xmlns"
1782
- ]), ve = M([
1781
+ ]), Ee = _([
1783
1782
  "accent-height",
1784
1783
  "accumulate",
1785
1784
  "additive",
@@ -1972,7 +1971,7 @@ const fo = M([
1972
1971
  "y2",
1973
1972
  "z",
1974
1973
  "zoomandpan"
1975
- ]), go = M([
1974
+ ]), bo = _([
1976
1975
  "accent",
1977
1976
  "accentunder",
1978
1977
  "align",
@@ -2027,13 +2026,13 @@ const fo = M([
2027
2026
  "voffset",
2028
2027
  "width",
2029
2028
  "xmlns"
2030
- ]), Gt = M([
2029
+ ]), Gt = _([
2031
2030
  "xlink:href",
2032
2031
  "xml:id",
2033
2032
  "xlink:title",
2034
2033
  "xml:space",
2035
2034
  "xmlns:xlink"
2036
- ]), Hn = I(/{{[\w\W]*|^[\w\W]*}}/g), Un = I(/<%[\w\W]*|^[\w\W]*%>/g), jn = I(/\${[\w\W]*/g), Wn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), $n = I(/^aria-[\-\w]+$/), bo = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Gn = I(/^(?:\w+script|data):/i), Kn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), qn = I(/^html$/i), Yn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), yo = I(/<[/\w!]/g), vo = I(/<[/\w]/g), Vn = I(/<\/no(script|embed|frames)/i), Xn = I(/\/>/i), H = {
2035
+ ]), $n = P(/{{[\w\W]*|^[\w\W]*}}/g), Gn = P(/<%[\w\W]*|^[\w\W]*%>/g), qn = P(/\${[\w\W]*/g), Kn = P(/^data-[\-\w.\u00B7-\uFFFF]+$/), Yn = P(/^aria-[\-\w]+$/), yo = P(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Vn = P(/^(?:\w+script|data):/i), Xn = P(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Qn = P(/^html$/i), Zn = P(/^[a-z][.\w]*(-[.\w]+)+$/i), Eo = P(/<[/\w!]/g), vo = P(/<[/\w]/g), Jn = P(/<\/no(script|embed|frames)/i), ti = P(/\/>/i), H = {
2037
2036
  element: 1,
2038
2037
  attribute: 2,
2039
2038
  text: 3,
@@ -2046,7 +2045,7 @@ const fo = M([
2046
2045
  documentType: 10,
2047
2046
  documentFragment: 11,
2048
2047
  notation: 12
2049
- }, Lo = [
2048
+ }, Mo = [
2050
2049
  "style",
2051
2050
  "script",
2052
2051
  "xmp",
@@ -2055,14 +2054,14 @@ const fo = M([
2055
2054
  "noframes",
2056
2055
  "plaintext",
2057
2056
  "noscript"
2058
- ], Zn = M(v({}, Lo)), Jn = (function() {
2057
+ ], ei = _(v({}, Mo)), oi = (function() {
2059
2058
  const n = {};
2060
- return at(Lo, (t) => {
2061
- n[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
2062
- }), M(n);
2063
- })(), Qn = function() {
2059
+ return at(Mo, (t) => {
2060
+ n[t] = P(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
2061
+ }), _(n);
2062
+ })(), ni = function() {
2064
2063
  return typeof window == "undefined" ? null : window;
2065
- }, ti = function(t, e) {
2064
+ }, ii = function(t, e) {
2066
2065
  if (typeof t != "object" || typeof t.createPolicy != "function") return null;
2067
2066
  let o = null;
2068
2067
  const r = "data-tt-policy-suffix";
@@ -2070,17 +2069,17 @@ const fo = M([
2070
2069
  const a = "dompurify" + (o ? "#" + o : "");
2071
2070
  try {
2072
2071
  return t.createPolicy(a, {
2073
- createHTML(l) {
2074
- return l;
2072
+ createHTML(s) {
2073
+ return s;
2075
2074
  },
2076
- createScriptURL(l) {
2077
- return l;
2075
+ createScriptURL(s) {
2076
+ return s;
2078
2077
  }
2079
2078
  });
2080
- } catch (l) {
2079
+ } catch (s) {
2081
2080
  return console.warn("TrustedTypes policy " + a + " could not be created."), null;
2082
2081
  }
2083
- }, Eo = function() {
2082
+ }, ko = function() {
2084
2083
  return {
2085
2084
  afterSanitizeAttributes: [],
2086
2085
  afterSanitizeElements: [],
@@ -2092,70 +2091,70 @@ const fo = M([
2092
2091
  uponSanitizeElement: [],
2093
2092
  uponSanitizeShadowNode: []
2094
2093
  };
2095
- }, Q = function(t, e, o, r) {
2094
+ }, J = function(t, e, o, r) {
2096
2095
  return N(t, e) && vt(t[e]) ? v(r.base ? U(r.base) : {}, t[e], r.transform) : o;
2097
- }, Ee = function(t, e, o) {
2096
+ }, ve = function(t, e, o) {
2098
2097
  const r = N(t, e) ? t[e] : void 0;
2099
2098
  return r && typeof r == "object" ? U(r) : o();
2100
2099
  };
2101
- function Mo() {
2102
- let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Qn();
2103
- const t = (u) => Mo(u);
2100
+ function Ro() {
2101
+ let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ni();
2102
+ const t = (u) => Ro(u);
2104
2103
  if (t.version = "3.4.16", t.removed = [], !n || !n.document || n.document.nodeType !== H.document || !n.Element)
2105
2104
  return t.isSupported = !1, t;
2106
2105
  let e = n.document;
2107
2106
  const o = e, r = o.currentScript;
2108
2107
  n.DocumentFragment;
2109
- const a = n.HTMLTemplateElement, l = n.Node, c = n.Element, p = n.NodeFilter;
2108
+ const a = n.HTMLTemplateElement, s = n.Node, c = n.Element, f = n.NodeFilter;
2110
2109
  n.NamedNodeMap === void 0 && (n.NamedNodeMap || n.MozNamedAttrMap), n.HTMLFormElement;
2111
- const m = n.DOMParser, g = n.trustedTypes, w = c.prototype, k = W(w, "cloneNode"), E = W(w, "remove"), T = W(w, "removeAttributeNode"), et = W(w, "nextSibling"), G = W(w, "childNodes"), z = W(w, "parentNode"), st = W(w, "shadowRoot"), B = W(w, "attributes"), D = l && l.prototype ? W(l.prototype, "nodeType") : null, lt = l && l.prototype ? W(l.prototype, "nodeName") : null, It = l && l.prototype ? W(l.prototype, "ownerDocument") : null, Et = function(i) {
2110
+ const h = n.DOMParser, g = n.trustedTypes, b = c.prototype, k = W(b, "cloneNode"), w = W(b, "remove"), R = W(b, "removeAttributeNode"), et = W(b, "nextSibling"), G = W(b, "childNodes"), z = W(b, "parentNode"), st = W(b, "shadowRoot"), B = W(b, "attributes"), D = s && s.prototype ? W(s.prototype, "nodeType") : null, lt = s && s.prototype ? W(s.prototype, "nodeName") : null, It = s && s.prototype ? W(s.prototype, "ownerDocument") : null, kt = function(i) {
2112
2111
  return D ? D(i) : i.nodeType;
2113
- }, Zt = function(i) {
2112
+ }, Qt = function(i) {
2114
2113
  return lt ? lt(i) : i.nodeName;
2115
2114
  };
2116
2115
  if (typeof a == "function") {
2117
2116
  const u = e.createElement("template");
2118
2117
  u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
2119
2118
  }
2120
- let R, ot = "", Jt, Se = !1, wt = 0;
2119
+ let O, ot = "", Zt, Le = !1, wt = 0;
2121
2120
  const _e = function() {
2122
- if (wt > 0) throw J('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
2121
+ 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.');
2123
2122
  }, ct = function(i) {
2124
2123
  _e(), wt++;
2125
2124
  try {
2126
- return R.createHTML(i);
2125
+ return O.createHTML(i);
2127
2126
  } finally {
2128
2127
  wt--;
2129
2128
  }
2130
- }, Do = function(i) {
2129
+ }, zo = function(i) {
2131
2130
  _e(), wt++;
2132
2131
  try {
2133
- return R.createScriptURL(i);
2132
+ return O.createScriptURL(i);
2134
2133
  } finally {
2135
2134
  wt--;
2136
2135
  }
2137
- }, Oo = function() {
2138
- return Se || (Jt = ti(g, r), Se = !0), Jt;
2139
- }, Pt = e, Qt = Pt.implementation, Le = Pt.createNodeIterator, Ro = Pt.createDocumentFragment, No = Pt.getElementsByTagName, zo = o.importNode;
2140
- let x = Eo();
2141
- t.isSupported = typeof So == "function" && typeof z == "function" && Qt && Qt.createHTMLDocument !== void 0;
2142
- const Bo = Hn, Fo = Un, Ho = jn, Uo = Wn, jo = $n, Wo = Gn, Me = Kn, $o = Yn;
2143
- let Ie = bo, C = null;
2136
+ }, Bo = function() {
2137
+ return Le || (Zt = ii(g, r), Le = !0), Zt;
2138
+ }, Dt = e, Jt = Dt.implementation, Pe = Dt.createNodeIterator, Fo = Dt.createDocumentFragment, Ho = Dt.getElementsByTagName, Uo = o.importNode;
2139
+ let T = ko();
2140
+ t.isSupported = typeof Io == "function" && typeof z == "function" && Jt && Jt.createHTMLDocument !== void 0;
2141
+ const jo = $n, Wo = Gn, $o = qn, Go = Kn, qo = Yn, Ko = Vn, Ie = Xn, Yo = Zn;
2142
+ let De = yo, C = null;
2144
2143
  const te = v({}, [
2145
- ...fo,
2144
+ ...ho,
2146
2145
  ...ge,
2147
2146
  ...be,
2148
2147
  ...ye,
2149
- ...ho
2148
+ ...mo
2150
2149
  ]);
2151
2150
  let A = null;
2152
2151
  const ee = v({}, [
2153
- ...mo,
2154
- ...ve,
2155
2152
  ...go,
2153
+ ...Ee,
2154
+ ...bo,
2156
2155
  ...Gt
2157
2156
  ]);
2158
- let K = Object.seal(yt(null, {
2157
+ let q = Object.seal(Et(null, {
2159
2158
  tagNameCheck: {
2160
2159
  writable: !0,
2161
2160
  configurable: !1,
@@ -2174,8 +2173,8 @@ function Mo() {
2174
2173
  enumerable: !0,
2175
2174
  value: !1
2176
2175
  }
2177
- })), kt = null, Pe = null;
2178
- const V = Object.seal(yt(null, {
2176
+ })), Tt = null, Me = null;
2177
+ const V = Object.seal(Et(null, {
2179
2178
  tagCheck: {
2180
2179
  writable: !0,
2181
2180
  configurable: !1,
@@ -2189,10 +2188,10 @@ function Mo() {
2189
2188
  value: null
2190
2189
  }
2191
2190
  }));
2192
- let De = !0, oe = !0, Oe = !1, Re = !0, X = !1, nt = !0, it = !1, ne = !1, Dt = null, Ot = null, ie = !1, dt = !1, Rt = !1, Nt = !1, Ne = !0, ze = !1;
2193
- const Be = "user-content-";
2191
+ let Re = !0, oe = !0, Oe = !1, Ne = !0, X = !1, nt = !0, it = !1, ne = !1, Mt = null, Rt = null, ie = !1, dt = !1, Ot = !1, Nt = !1, ze = !0, Be = !1;
2192
+ const Fe = "user-content-";
2194
2193
  let re = !0, ae = !1, ut = {}, pt = null;
2195
- const Fe = v({}, [
2194
+ const He = v({}, [
2196
2195
  "annotation-xml",
2197
2196
  "audio",
2198
2197
  "colgroup",
@@ -2220,8 +2219,8 @@ function Mo() {
2220
2219
  "video",
2221
2220
  "xmp"
2222
2221
  ]);
2223
- let He = null;
2224
- const Ue = v({}, [
2222
+ let Ue = null;
2223
+ const je = v({}, [
2225
2224
  "audio",
2226
2225
  "video",
2227
2226
  "img",
@@ -2229,8 +2228,8 @@ function Mo() {
2229
2228
  "image",
2230
2229
  "track"
2231
2230
  ]);
2232
- let je = null;
2233
- const We = v({}, [
2231
+ let We = null;
2232
+ const $e = v({}, [
2234
2233
  "alt",
2235
2234
  "class",
2236
2235
  "for",
@@ -2245,294 +2244,294 @@ function Mo() {
2245
2244
  "value",
2246
2245
  "style",
2247
2246
  "xmlns"
2248
- ]), zt = "http://www.w3.org/1998/Math/MathML", Bt = "http://www.w3.org/2000/svg", q = "http://www.w3.org/1999/xhtml";
2249
- let ft = q, se = !1, le = null;
2250
- const Go = v({}, [
2247
+ ]), zt = "http://www.w3.org/1998/Math/MathML", Bt = "http://www.w3.org/2000/svg", K = "http://www.w3.org/1999/xhtml";
2248
+ let ft = K, se = !1, le = null;
2249
+ const Vo = v({}, [
2251
2250
  zt,
2252
2251
  Bt,
2253
- q
2254
- ], me), $e = M([
2252
+ K
2253
+ ], me), Ge = _([
2255
2254
  "mi",
2256
2255
  "mo",
2257
2256
  "mn",
2258
2257
  "ms",
2259
2258
  "mtext"
2260
2259
  ]);
2261
- let ce = v({}, $e);
2262
- const Ge = M(["annotation-xml"]);
2263
- let de = v({}, Ge);
2264
- const Ko = v({}, [
2260
+ let ce = v({}, Ge);
2261
+ const qe = _(["annotation-xml"]);
2262
+ let de = v({}, qe);
2263
+ const Xo = v({}, [
2265
2264
  "title",
2266
2265
  "style",
2267
2266
  "font",
2268
2267
  "a",
2269
2268
  "script"
2270
2269
  ]);
2271
- let Tt = null;
2272
- const qo = ["application/xhtml+xml", "text/html"], Yo = "text/html";
2273
- let _ = null, ht = null;
2274
- const Vo = e.createElement("form"), Ke = function(i) {
2270
+ let Ct = null;
2271
+ const Qo = ["application/xhtml+xml", "text/html"], Zo = "text/html";
2272
+ let S = null, ht = null;
2273
+ const Jo = e.createElement("form"), Ke = function(i) {
2275
2274
  return i instanceof RegExp || i instanceof Function;
2276
2275
  }, ue = function() {
2277
2276
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2278
2277
  if (ht && ht === i) return;
2279
- (!i || typeof i != "object") && (i = {}), i = U(i), Tt = qo.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Yo : i.PARSER_MEDIA_TYPE, _ = Tt === "application/xhtml+xml" ? me : Mt, C = Q(i, "ALLOWED_TAGS", te, { transform: _ }), A = Q(i, "ALLOWED_ATTR", ee, { transform: _ }), le = Q(i, "ALLOWED_NAMESPACES", Go, { transform: me }), je = Q(i, "ADD_URI_SAFE_ATTR", We, {
2280
- transform: _,
2281
- base: We
2282
- }), He = Q(i, "ADD_DATA_URI_TAGS", Ue, {
2283
- transform: _,
2284
- base: Ue
2285
- }), pt = Q(i, "FORBID_CONTENTS", Fe, { transform: _ }), kt = Q(i, "FORBID_TAGS", U({}), { transform: _ }), Pe = Q(i, "FORBID_ATTR", U({}), { transform: _ }), ut = N(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? U(i.USE_PROFILES) : i.USE_PROFILES : !1, De = i.ALLOW_ARIA_ATTR !== !1, oe = i.ALLOW_DATA_ATTR !== !1, Oe = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, X = i.SAFE_FOR_TEMPLATES || !1, nt = i.SAFE_FOR_XML !== !1, it = i.WHOLE_DOCUMENT || !1, dt = i.RETURN_DOM || !1, Rt = i.RETURN_DOM_FRAGMENT || !1, Nt = i.RETURN_TRUSTED_TYPE || !1, ie = i.FORCE_BODY || !1, Ne = i.SANITIZE_DOM !== !1, ze = i.SANITIZE_NAMED_PROPS || !1, re = i.KEEP_CONTENT !== !1, ae = i.IN_PLACE || !1, Ie = zn(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : bo, ft = typeof i.NAMESPACE == "string" ? i.NAMESPACE : q, ce = Ee(i, "MATHML_TEXT_INTEGRATION_POINTS", () => v({}, $e)), de = Ee(i, "HTML_INTEGRATION_POINTS", () => v({}, Ge));
2286
- const s = Ee(i, "CUSTOM_ELEMENT_HANDLING", () => yt(null));
2287
- if (K = yt(null), N(s, "tagNameCheck") && Ke(s.tagNameCheck) && (K.tagNameCheck = s.tagNameCheck), N(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && (K.attributeNameCheck = s.attributeNameCheck), N(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (K.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I(K), X && (oe = !1), Rt && (dt = !0), ut && (C = v({}, ho), A = yt(null), ut.html === !0 && (v(C, fo), v(A, mo)), ut.svg === !0 && (v(C, ge), v(A, ve), v(A, Gt)), ut.svgFilters === !0 && (v(C, be), v(A, ve), v(A, Gt)), ut.mathMl === !0 && (v(C, ye), v(A, go), v(A, Gt))), V.tagCheck = null, V.attributeCheck = null, N(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? V.tagCheck = i.ADD_TAGS : vt(i.ADD_TAGS) && (C === te && (C = U(C)), v(C, i.ADD_TAGS, _))), N(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? V.attributeCheck = i.ADD_ATTR : vt(i.ADD_ATTR) && (A === ee && (A = U(A)), v(A, i.ADD_ATTR, _))), N(i, "ADD_FORBID_CONTENTS") && vt(i.ADD_FORBID_CONTENTS) && (pt === Fe && (pt = U(pt)), v(pt, i.ADD_FORBID_CONTENTS, _)), re && (C["#text"] = !0), it && v(C, [
2278
+ (!i || typeof i != "object") && (i = {}), i = U(i), Ct = Qo.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Zo : i.PARSER_MEDIA_TYPE, S = Ct === "application/xhtml+xml" ? me : Pt, C = J(i, "ALLOWED_TAGS", te, { transform: S }), A = J(i, "ALLOWED_ATTR", ee, { transform: S }), le = J(i, "ALLOWED_NAMESPACES", Vo, { transform: me }), We = J(i, "ADD_URI_SAFE_ATTR", $e, {
2279
+ transform: S,
2280
+ base: $e
2281
+ }), Ue = J(i, "ADD_DATA_URI_TAGS", je, {
2282
+ transform: S,
2283
+ base: je
2284
+ }), pt = J(i, "FORBID_CONTENTS", He, { transform: S }), Tt = J(i, "FORBID_TAGS", U({}), { transform: S }), Me = J(i, "FORBID_ATTR", U({}), { transform: S }), ut = N(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? U(i.USE_PROFILES) : i.USE_PROFILES : !1, Re = i.ALLOW_ARIA_ATTR !== !1, oe = i.ALLOW_DATA_ATTR !== !1, Oe = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, X = i.SAFE_FOR_TEMPLATES || !1, nt = i.SAFE_FOR_XML !== !1, it = i.WHOLE_DOCUMENT || !1, dt = i.RETURN_DOM || !1, Ot = i.RETURN_DOM_FRAGMENT || !1, Nt = i.RETURN_TRUSTED_TYPE || !1, ie = i.FORCE_BODY || !1, ze = i.SANITIZE_DOM !== !1, Be = i.SANITIZE_NAMED_PROPS || !1, re = i.KEEP_CONTENT !== !1, ae = i.IN_PLACE || !1, De = Un(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : yo, ft = typeof i.NAMESPACE == "string" ? i.NAMESPACE : K, ce = ve(i, "MATHML_TEXT_INTEGRATION_POINTS", () => v({}, Ge)), de = ve(i, "HTML_INTEGRATION_POINTS", () => v({}, qe));
2285
+ const l = ve(i, "CUSTOM_ELEMENT_HANDLING", () => Et(null));
2286
+ if (q = Et(null), N(l, "tagNameCheck") && Ke(l.tagNameCheck) && (q.tagNameCheck = l.tagNameCheck), N(l, "attributeNameCheck") && Ke(l.attributeNameCheck) && (q.attributeNameCheck = l.attributeNameCheck), N(l, "allowCustomizedBuiltInElements") && typeof l.allowCustomizedBuiltInElements == "boolean" && (q.allowCustomizedBuiltInElements = l.allowCustomizedBuiltInElements), P(q), X && (oe = !1), Ot && (dt = !0), ut && (C = v({}, mo), A = Et(null), ut.html === !0 && (v(C, ho), v(A, go)), ut.svg === !0 && (v(C, ge), v(A, Ee), v(A, Gt)), ut.svgFilters === !0 && (v(C, be), v(A, Ee), v(A, Gt)), ut.mathMl === !0 && (v(C, ye), v(A, bo), v(A, Gt))), V.tagCheck = null, V.attributeCheck = null, N(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? V.tagCheck = i.ADD_TAGS : vt(i.ADD_TAGS) && (C === te && (C = U(C)), v(C, i.ADD_TAGS, S))), N(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? V.attributeCheck = i.ADD_ATTR : vt(i.ADD_ATTR) && (A === ee && (A = U(A)), v(A, i.ADD_ATTR, S))), N(i, "ADD_FORBID_CONTENTS") && vt(i.ADD_FORBID_CONTENTS) && (pt === He && (pt = U(pt)), v(pt, i.ADD_FORBID_CONTENTS, S)), re && (C["#text"] = !0), it && v(C, [
2288
2287
  "html",
2289
2288
  "head",
2290
2289
  "body"
2291
- ]), C.table && (v(C, ["tbody"]), delete kt.tbody), i.TRUSTED_TYPES_POLICY) {
2292
- if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function") throw J('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2293
- if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw J('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2294
- const d = R;
2295
- R = i.TRUSTED_TYPES_POLICY;
2290
+ ]), C.table && (v(C, ["tbody"]), delete Tt.tbody), i.TRUSTED_TYPES_POLICY) {
2291
+ if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2292
+ if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2293
+ const d = O;
2294
+ O = i.TRUSTED_TYPES_POLICY;
2296
2295
  try {
2297
2296
  ot = ct("");
2298
- } catch (f) {
2299
- throw R = d, f;
2297
+ } catch (p) {
2298
+ throw O = d, p;
2300
2299
  }
2301
- } else i.TRUSTED_TYPES_POLICY === null ? (R = void 0, ot = "") : (R === void 0 && (R = Oo()), R && typeof ot == "string" && (ot = ct("")));
2302
- M && M(i), ht = i;
2303
- }, qe = v({}, [
2300
+ } else i.TRUSTED_TYPES_POLICY === null ? (O = void 0, ot = "") : (O === void 0 && (O = Bo()), O && typeof ot == "string" && (ot = ct("")));
2301
+ _ && _(i), ht = i;
2302
+ }, Ye = v({}, [
2304
2303
  ...ge,
2305
2304
  ...be,
2306
- ...Bn
2307
- ]), Ye = v({}, [...ye, ...Fn]), Xo = function(i, s, d) {
2308
- return s.namespaceURI === q ? i === "svg" : s.namespaceURI === zt ? i === "svg" && (d === "annotation-xml" || ce[d]) : !!qe[i];
2309
- }, Zo = function(i, s, d) {
2310
- return s.namespaceURI === q ? i === "math" : s.namespaceURI === Bt ? i === "math" && de[d] : !!Ye[i];
2311
- }, Jo = function(i, s, d) {
2312
- return s.namespaceURI === Bt && !de[d] || s.namespaceURI === zt && !ce[d] ? !1 : !Ye[i] && (Ko[i] || !qe[i]);
2313
- }, Qo = function(i) {
2314
- let s = z(i);
2315
- (!s || !s.tagName) && (s = {
2305
+ ...jn
2306
+ ]), Ve = v({}, [...ye, ...Wn]), tn = function(i, l, d) {
2307
+ return l.namespaceURI === K ? i === "svg" : l.namespaceURI === zt ? i === "svg" && (d === "annotation-xml" || ce[d]) : !!Ye[i];
2308
+ }, en = function(i, l, d) {
2309
+ return l.namespaceURI === K ? i === "math" : l.namespaceURI === Bt ? i === "math" && de[d] : !!Ve[i];
2310
+ }, on = function(i, l, d) {
2311
+ return l.namespaceURI === Bt && !de[d] || l.namespaceURI === zt && !ce[d] ? !1 : !Ve[i] && (Xo[i] || !Ye[i]);
2312
+ }, nn = function(i) {
2313
+ let l = z(i);
2314
+ (!l || !l.tagName) && (l = {
2316
2315
  namespaceURI: ft,
2317
2316
  tagName: "template"
2318
2317
  });
2319
- const d = Mt(i.tagName), f = Mt(s.tagName);
2320
- return le[i.namespaceURI] ? i.namespaceURI === Bt ? Xo(d, s, f) : i.namespaceURI === zt ? Zo(d, s, f) : i.namespaceURI === q ? Jo(d, s, f) : !!(Tt === "application/xhtml+xml" && le[i.namespaceURI]) : !1;
2321
- }, Z = function(i) {
2322
- Ct(t.removed, { element: i });
2318
+ const d = Pt(i.tagName), p = Pt(l.tagName);
2319
+ return le[i.namespaceURI] ? i.namespaceURI === Bt ? tn(d, l, p) : i.namespaceURI === zt ? en(d, l, p) : i.namespaceURI === K ? on(d, l, p) : !!(Ct === "application/xhtml+xml" && le[i.namespaceURI]) : !1;
2320
+ }, Q = function(i) {
2321
+ xt(t.removed, { element: i });
2323
2322
  try {
2324
2323
  z(i).removeChild(i);
2325
- } catch (s) {
2326
- if (E(i), !z(i)) throw J("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
2324
+ } catch (l) {
2325
+ if (w(i), !z(i)) throw Z("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
2327
2326
  }
2328
- }, Ve = function(i, s, d) {
2327
+ }, Xe = function(i, l, d) {
2329
2328
  try {
2330
- T(i, s);
2331
- } catch (f) {
2329
+ R(i, l);
2330
+ } catch (p) {
2332
2331
  try {
2333
2332
  i.removeAttribute(d);
2334
- } catch (h) {
2333
+ } catch (m) {
2335
2334
  }
2336
2335
  }
2337
2336
  }, Ft = function(i) {
2338
2337
  Ht(i);
2339
- const s = G(i);
2340
- if (s) {
2341
- const f = [];
2342
- at(s, (h) => {
2343
- Ct(f, h);
2344
- }), at(f, (h) => {
2338
+ const l = G(i);
2339
+ if (l) {
2340
+ const p = [];
2341
+ at(l, (m) => {
2342
+ xt(p, m);
2343
+ }), at(p, (m) => {
2345
2344
  try {
2346
- E(h);
2347
- } catch (b) {
2345
+ w(m);
2346
+ } catch (y) {
2348
2347
  }
2349
2348
  });
2350
2349
  }
2351
2350
  const d = B(i);
2352
- if (d) for (let f = d.length - 1; f >= 0; --f) {
2353
- const h = d[f], b = h && h.name;
2354
- typeof b == "string" && Ve(i, h, b);
2351
+ if (d) for (let p = d.length - 1; p >= 0; --p) {
2352
+ const m = d[p], y = m && m.name;
2353
+ typeof y == "string" && Xe(i, m, y);
2355
2354
  }
2356
- }, rt = function(i, s, d) {
2355
+ }, rt = function(i, l, d) {
2357
2356
  if (!d) try {
2358
- d = s.getAttributeNode(i);
2359
- } catch (f) {
2357
+ d = l.getAttributeNode(i);
2358
+ } catch (p) {
2360
2359
  d = null;
2361
2360
  }
2362
- Ct(t.removed, {
2361
+ xt(t.removed, {
2363
2362
  attribute: d || null,
2364
- from: s
2363
+ from: l
2365
2364
  });
2366
2365
  try {
2367
- d ? T(s, d) : s.removeAttribute(i);
2368
- } catch (f) {
2366
+ d ? R(l, d) : l.removeAttribute(i);
2367
+ } catch (p) {
2369
2368
  try {
2370
- s.removeAttribute(i);
2371
- } catch (h) {
2369
+ l.removeAttribute(i);
2370
+ } catch (m) {
2372
2371
  }
2373
2372
  }
2374
2373
  if (i === "is")
2375
- if (dt || Rt) try {
2376
- Z(s);
2377
- } catch (f) {
2374
+ if (dt || Ot) try {
2375
+ Q(l);
2376
+ } catch (p) {
2378
2377
  }
2379
2378
  else try {
2380
- s.setAttribute(i, "");
2381
- } catch (f) {
2379
+ l.setAttribute(i, "");
2380
+ } catch (p) {
2382
2381
  }
2383
- }, tn = function(i) {
2384
- const s = B(i);
2385
- if (s)
2386
- for (let d = s.length - 1; d >= 0; --d) {
2387
- const f = s[d], h = f && f.name;
2388
- typeof h != "string" || A[_(h)] || Ve(i, f, h);
2382
+ }, rn = function(i) {
2383
+ const l = B(i);
2384
+ if (l)
2385
+ for (let d = l.length - 1; d >= 0; --d) {
2386
+ const p = l[d], m = p && p.name;
2387
+ typeof m != "string" || A[S(m)] || Xe(i, p, m);
2389
2388
  }
2390
2389
  }, Ht = function(i) {
2391
- const s = [i];
2392
- for (; s.length > 0; ) {
2393
- const d = s.pop();
2394
- Et(d) === H.element && tn(d);
2395
- const f = G(d);
2396
- if (f) for (let h = f.length - 1; h >= 0; --h) s.push(f[h]);
2390
+ const l = [i];
2391
+ for (; l.length > 0; ) {
2392
+ const d = l.pop();
2393
+ kt(d) === H.element && rn(d);
2394
+ const p = G(d);
2395
+ if (p) for (let m = p.length - 1; m >= 0; --m) l.push(p[m]);
2397
2396
  }
2398
- }, Xe = function(i, s) {
2399
- return nt ? i === "patchsrc" ? !0 : i === "for" && s !== "label" && s !== "output" : !1;
2400
- }, en = function(i) {
2397
+ }, Qe = function(i, l) {
2398
+ return nt ? i === "patchsrc" ? !0 : i === "for" && l !== "label" && l !== "output" : !1;
2399
+ }, an = function(i) {
2401
2400
  if (!nt) return;
2402
- const s = [i];
2403
- for (; s.length > 0; ) {
2404
- const d = s.pop(), f = Et(d);
2405
- if (f === H.processingInstruction || f === H.comment && P(vo, d.data)) {
2401
+ const l = [i];
2402
+ for (; l.length > 0; ) {
2403
+ const d = l.pop(), p = kt(d);
2404
+ if (p === H.processingInstruction || p === H.comment && I(vo, d.data)) {
2406
2405
  try {
2407
- E(d);
2408
- } catch (b) {
2406
+ w(d);
2407
+ } catch (y) {
2409
2408
  }
2410
2409
  continue;
2411
2410
  }
2412
- if (f === H.element) {
2413
- const b = d, y = _(Zt(d));
2411
+ if (p === H.element) {
2412
+ const y = d, E = S(Qt(d));
2414
2413
  try {
2415
- b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Xe("for", y) && b.removeAttribute("for");
2416
- } catch (S) {
2414
+ y.hasAttribute && y.hasAttribute("patchsrc") && y.removeAttribute("patchsrc"), y.hasAttribute && y.hasAttribute("for") && Qe("for", E) && y.removeAttribute("for");
2415
+ } catch (x) {
2417
2416
  }
2418
2417
  }
2419
- const h = G(d);
2420
- if (h) for (let b = h.length - 1; b >= 0; --b) s.push(h[b]);
2418
+ const m = G(d);
2419
+ if (m) for (let y = m.length - 1; y >= 0; --y) l.push(m[y]);
2421
2420
  }
2422
2421
  }, Ze = function(i) {
2423
- let s = null, d = null;
2422
+ let l = null, d = null;
2424
2423
  if (ie) i = "<remove></remove>" + i;
2425
2424
  else {
2426
- const b = lo(i, /^[\r\n\t ]+/);
2427
- d = b && b[0];
2425
+ const y = co(i, /^[\r\n\t ]+/);
2426
+ d = y && y[0];
2428
2427
  }
2429
- Tt === "application/xhtml+xml" && ft === q && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
2430
- const f = R ? ct(i) : i;
2431
- if (ft === q) try {
2432
- s = new m().parseFromString(f, Tt);
2433
- } catch (b) {
2428
+ Ct === "application/xhtml+xml" && ft === K && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
2429
+ const p = O ? ct(i) : i;
2430
+ if (ft === K) try {
2431
+ l = new h().parseFromString(p, Ct);
2432
+ } catch (y) {
2434
2433
  }
2435
- if (!s || !s.documentElement) {
2436
- s = Qt.createDocument(ft, "template", null);
2434
+ if (!l || !l.documentElement) {
2435
+ l = Jt.createDocument(ft, "template", null);
2437
2436
  try {
2438
- s.documentElement.innerHTML = se ? ot : f;
2439
- } catch (b) {
2437
+ l.documentElement.innerHTML = se ? ot : p;
2438
+ } catch (y) {
2440
2439
  }
2441
2440
  }
2442
- const h = s.body || s.documentElement;
2443
- return i && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ft === q ? No.call(s, it ? "html" : "body")[0] : it ? s.documentElement : h;
2441
+ const m = l.body || l.documentElement;
2442
+ return i && d && m.insertBefore(e.createTextNode(d), m.childNodes[0] || null), ft === K ? Ho.call(l, it ? "html" : "body")[0] : it ? l.documentElement : m;
2444
2443
  }, Je = function(i) {
2445
- const s = It ? It(i) : i.ownerDocument;
2446
- return Le.call(s || i, i, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
2444
+ const l = It ? It(i) : i.ownerDocument;
2445
+ return Pe.call(l || i, i, f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION, null);
2447
2446
  }, Ut = function(i) {
2448
- return i = At(i, Bo, " "), i = At(i, Fo, " "), i = At(i, Ho, " "), i;
2447
+ return i = St(i, jo, " "), i = St(i, Wo, " "), i = St(i, $o, " "), i;
2449
2448
  }, pe = function(i) {
2450
- var s;
2449
+ var l;
2451
2450
  i.normalize();
2452
- const d = It ? It(i) : i.ownerDocument, f = Le.call(d || i, i, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
2453
- let h = f.nextNode();
2454
- for (; h; )
2455
- h.data = Ut(h.data), h = f.nextNode();
2456
- const b = (s = i.querySelectorAll) === null || s === void 0 ? void 0 : s.call(i, "template");
2457
- b && at(b, (y) => {
2458
- mt(y.content) && pe(y.content);
2451
+ const d = It ? It(i) : i.ownerDocument, p = Pe.call(d || i, i, f.SHOW_TEXT | f.SHOW_COMMENT | f.SHOW_CDATA_SECTION | f.SHOW_PROCESSING_INSTRUCTION, null);
2452
+ let m = p.nextNode();
2453
+ for (; m; )
2454
+ m.data = Ut(m.data), m = p.nextNode();
2455
+ const y = (l = i.querySelectorAll) === null || l === void 0 ? void 0 : l.call(i, "template");
2456
+ y && at(y, (E) => {
2457
+ mt(E.content) && pe(E.content);
2459
2458
  });
2460
2459
  }, jt = function(i) {
2461
- const s = lt ? lt(i) : null;
2462
- return typeof s != "string" || _(s) !== "form" ? !1 : typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || i.attributes !== B(i) || typeof i.removeAttribute != "function" || typeof i.removeAttributeNode != "function" || typeof i.getAttributeNode != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function" || i.nodeType !== D(i) || i.childNodes !== G(i);
2460
+ const l = lt ? lt(i) : null;
2461
+ return typeof l != "string" || S(l) !== "form" ? !1 : typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || i.attributes !== B(i) || typeof i.removeAttribute != "function" || typeof i.removeAttributeNode != "function" || typeof i.getAttributeNode != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function" || i.nodeType !== D(i) || i.childNodes !== G(i);
2463
2462
  }, mt = function(i) {
2464
2463
  if (!D || typeof i != "object" || i === null) return !1;
2465
2464
  try {
2466
2465
  return D(i) === H.documentFragment;
2467
- } catch (s) {
2466
+ } catch (l) {
2468
2467
  return !1;
2469
2468
  }
2470
- }, xt = function(i) {
2469
+ }, At = function(i) {
2471
2470
  if (!D || typeof i != "object" || i === null) return !1;
2472
2471
  try {
2473
2472
  return typeof D(i) == "number";
2474
- } catch (s) {
2473
+ } catch (l) {
2475
2474
  return !1;
2476
2475
  }
2477
2476
  };
2478
- function Y(u, i, s) {
2477
+ function Y(u, i, l) {
2479
2478
  u.length !== 0 && at(u, (d) => {
2480
- d.call(t, i, s, ht);
2479
+ d.call(t, i, l, ht);
2481
2480
  });
2482
2481
  }
2483
- const on = function(i, s) {
2484
- return !!(nt && i.hasChildNodes() && !xt(i.firstElementChild) && P(yo, i.textContent) && P(yo, i.innerHTML) || nt && i.namespaceURI === q && Zn[s] && (xt(i.firstElementChild) || typeof i.textContent == "string" && P(Jn[s], i.textContent)) || i.nodeType === H.processingInstruction || nt && i.nodeType === H.comment && P(vo, i.data));
2485
- }, Wt = function(i, s) {
2486
- if (i instanceof RegExp) return P(i, s);
2482
+ const sn = function(i, l) {
2483
+ return !!(nt && i.hasChildNodes() && !At(i.firstElementChild) && I(Eo, i.textContent) && I(Eo, i.innerHTML) || nt && i.namespaceURI === K && ei[l] && (At(i.firstElementChild) || typeof i.textContent == "string" && I(oi[l], i.textContent)) || i.nodeType === H.processingInstruction || nt && i.nodeType === H.comment && I(vo, i.data));
2484
+ }, Wt = function(i, l) {
2485
+ if (i instanceof RegExp) return I(i, l);
2487
2486
  if (i instanceof Function) {
2488
- for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) f[h - 2] = arguments[h];
2489
- return !!i(s, ...f);
2487
+ for (var d = arguments.length, p = new Array(d > 2 ? d - 2 : 0), m = 2; m < d; m++) p[m - 2] = arguments[m];
2488
+ return !!i(l, ...p);
2490
2489
  }
2491
2490
  return !1;
2492
- }, nn = function(i, s, d) {
2493
- if (!kt[s] && oo(s) && Wt(K.tagNameCheck, s)) return !1;
2494
- if (re && !pt[s]) {
2495
- const f = z(i), h = G(i);
2496
- if (h && f) {
2497
- const b = h.length;
2498
- for (let y = b - 1; y >= 0; --y) {
2499
- const S = i === d ? k(h[y], !0) : h[y];
2500
- f.insertBefore(S, et(i));
2491
+ }, ln = function(i, l, d) {
2492
+ if (!Tt[l] && no(l) && Wt(q.tagNameCheck, l)) return !1;
2493
+ if (re && !pt[l]) {
2494
+ const p = z(i), m = G(i);
2495
+ if (m && p) {
2496
+ const y = m.length;
2497
+ for (let E = y - 1; E >= 0; --E) {
2498
+ const x = i === d ? k(m[E], !0) : m[E];
2499
+ p.insertBefore(x, et(i));
2501
2500
  }
2502
2501
  }
2503
2502
  }
2504
- return Z(i), !0;
2505
- }, Qe = function(i, s, d, f) {
2506
- return i.length === 0 ? s : s === d || s === f ? U(s) : s;
2507
- }, gt = function(i, s) {
2508
- return i === s || z(i) !== null ? !1 : (ae && Ht(i), !0);
2509
- }, to = function(i, s) {
2510
- if (Y(x.beforeSanitizeElements, i, null), gt(i, s)) return !0;
2503
+ return Q(i), !0;
2504
+ }, to = function(i, l, d, p) {
2505
+ return i.length === 0 ? l : l === d || l === p ? U(l) : l;
2506
+ }, gt = function(i, l) {
2507
+ return i === l || z(i) !== null ? !1 : (ae && Ht(i), !0);
2508
+ }, eo = function(i, l) {
2509
+ if (Y(T.beforeSanitizeElements, i, null), gt(i, l)) return !0;
2511
2510
  if (jt(i))
2512
- return Z(i), !0;
2513
- const d = _(Zt(i));
2514
- if (C = Qe(x.uponSanitizeElement, C, te, Dt), Y(x.uponSanitizeElement, i, {
2511
+ return Q(i), !0;
2512
+ const d = S(Qt(i));
2513
+ if (C = to(T.uponSanitizeElement, C, te, Mt), Y(T.uponSanitizeElement, i, {
2515
2514
  tagName: d,
2516
2515
  allowedTags: C
2517
- }), gt(i, s)) return !0;
2518
- if (on(i, d))
2519
- return Z(i), !0;
2520
- if (kt[d] || !(V.tagCheck instanceof Function && V.tagCheck(d)) && !C[d]) {
2521
- const f = nn(i, d, s);
2522
- return f === !1 && (Y(x.afterSanitizeElements, i, null), gt(i, s)) ? !0 : f;
2516
+ }), gt(i, l)) return !0;
2517
+ if (sn(i, d))
2518
+ return Q(i), !0;
2519
+ if (Tt[d] || !(V.tagCheck instanceof Function && V.tagCheck(d)) && !C[d]) {
2520
+ const p = ln(i, d, l);
2521
+ return p === !1 && (Y(T.afterSanitizeElements, i, null), gt(i, l)) ? !0 : p;
2523
2522
  }
2524
- if (Et(i) === H.element && !Qo(i) || (d === "noscript" || d === "noembed" || d === "noframes") && P(Vn, i.innerHTML))
2525
- return Z(i), !0;
2523
+ if (kt(i) === H.element && !nn(i) || (d === "noscript" || d === "noembed" || d === "noframes") && I(Jn, i.innerHTML))
2524
+ return Q(i), !0;
2526
2525
  if (X && i.nodeType === H.text) {
2527
- const f = Ut(i.textContent);
2528
- i.textContent !== f && (Ct(t.removed, { element: i.cloneNode() }), i.textContent = f);
2526
+ const p = Ut(i.textContent);
2527
+ i.textContent !== p && (xt(t.removed, { element: i.cloneNode() }), i.textContent = p);
2529
2528
  }
2530
- return Y(x.afterSanitizeElements, i, null), gt(i, s);
2531
- }, eo = function(i, s, d) {
2532
- if (Pe[s] || Xe(s, i) || Ne && (s === "id" || s === "name") && (d in e || d in Vo)) return !1;
2533
- const f = A[s] || V.attributeCheck instanceof Function && V.attributeCheck(s, i);
2534
- return oe && P(Uo, s) || De && P(jo, s) ? !0 : f ? je[s] || P(Ie, At(d, Me, "")) || (s === "src" || s === "xlink:href" || s === "href") && i !== "script" && co(d, "data:") === 0 && He[i] || Oe && !P(Wo, At(d, Me, "")) ? !0 : !d : oo(i) && Wt(K.tagNameCheck, i) && Wt(K.attributeNameCheck, s, i) || s === "is" && K.allowCustomizedBuiltInElements && Wt(K.tagNameCheck, d);
2535
- }, rn = v({}, [
2529
+ return Y(T.afterSanitizeElements, i, null), gt(i, l);
2530
+ }, oo = function(i, l, d) {
2531
+ if (Me[l] || Qe(l, i) || ze && (l === "id" || l === "name") && (d in e || d in Jo)) return !1;
2532
+ const p = A[l] || V.attributeCheck instanceof Function && V.attributeCheck(l, i);
2533
+ return oe && I(Go, l) || Re && I(qo, l) ? !0 : p ? We[l] || I(De, St(d, Ie, "")) || (l === "src" || l === "xlink:href" || l === "href") && i !== "script" && uo(d, "data:") === 0 && Ue[i] || Oe && !I(Ko, St(d, Ie, "")) ? !0 : !d : no(i) && Wt(q.tagNameCheck, i) && Wt(q.attributeNameCheck, l, i) || l === "is" && q.allowCustomizedBuiltInElements && Wt(q.tagNameCheck, d);
2534
+ }, cn = v({}, [
2536
2535
  "annotation-xml",
2537
2536
  "color-profile",
2538
2537
  "font-face",
@@ -2541,193 +2540,193 @@ function Mo() {
2541
2540
  "font-face-src",
2542
2541
  "font-face-uri",
2543
2542
  "missing-glyph"
2544
- ]), oo = function(i) {
2545
- return !rn[Mt(i)] && P($o, i);
2546
- }, an = function(i, s, d, f) {
2547
- if (R && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(i, s)) {
2543
+ ]), no = function(i) {
2544
+ return !cn[Pt(i)] && I(Yo, i);
2545
+ }, dn = function(i, l, d, p) {
2546
+ if (O && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(i, l)) {
2548
2547
  case "TrustedHTML":
2549
- return ct(f);
2548
+ return ct(p);
2550
2549
  case "TrustedScriptURL":
2551
- return Do(f);
2550
+ return zo(p);
2552
2551
  }
2553
- return f;
2554
- }, sn = function(i, s, d, f) {
2552
+ return p;
2553
+ }, un = function(i, l, d, p) {
2555
2554
  try {
2556
- return d ? i.setAttributeNS(d, s, f) : i.setAttribute(s, f), jt(i) ? (Z(i), !1) : !0;
2557
- } catch (h) {
2558
- return rt(s, i), !1;
2555
+ return d ? i.setAttributeNS(d, l, p) : i.setAttribute(l, p), jt(i) ? (Q(i), !1) : !0;
2556
+ } catch (m) {
2557
+ return rt(l, i), !1;
2559
2558
  }
2560
- }, no = function(i, s) {
2561
- if (Y(x.beforeSanitizeAttributes, i, null), gt(i, s)) return;
2559
+ }, io = function(i, l) {
2560
+ if (Y(T.beforeSanitizeAttributes, i, null), gt(i, l)) return;
2562
2561
  const d = i.attributes;
2563
2562
  if (!d || jt(i)) return;
2564
- A = Qe(x.uponSanitizeAttribute, A, ee, Ot);
2565
- const f = {
2563
+ A = to(T.uponSanitizeAttribute, A, ee, Rt);
2564
+ const p = {
2566
2565
  attrName: "",
2567
2566
  attrValue: "",
2568
2567
  keepAttr: !0,
2569
2568
  allowedAttributes: A,
2570
2569
  forceKeepAttr: void 0
2571
2570
  };
2572
- let h = d.length;
2573
- const b = _(i.nodeName);
2574
- for (; h--; ) {
2575
- const y = d[h], S = y.name, j = y.namespaceURI, F = y.value, bt = _(S), he = F;
2576
- let O = S === "value" ? he : In(he), io = !1;
2577
- if (f.attrName = bt, f.attrValue = O, f.keepAttr = !0, f.forceKeepAttr = void 0, Y(x.uponSanitizeAttribute, i, f), O = f.attrValue, ze && (bt === "id" || bt === "name") && co(O, Be) !== 0 && (rt(S, i, y), O = Be + O, io = !0), nt && P(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
2578
- rt(S, i, y);
2571
+ let m = d.length;
2572
+ const y = S(i.nodeName);
2573
+ for (; m--; ) {
2574
+ const E = d[m], x = E.name, j = E.namespaceURI, F = E.value, bt = S(x), he = F;
2575
+ let M = x === "value" ? he : On(he), ro = !1;
2576
+ if (p.attrName = bt, p.attrValue = M, p.keepAttr = !0, p.forceKeepAttr = void 0, Y(T.uponSanitizeAttribute, i, p), M = p.attrValue, Be && (bt === "id" || bt === "name") && uo(M, Fe) !== 0 && (rt(x, i, E), M = Fe + M, ro = !0), nt && I(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, M)) {
2577
+ rt(x, i, E);
2579
2578
  continue;
2580
2579
  }
2581
- if (bt === "attributename" && lo(O, "href")) {
2582
- rt(S, i, y);
2580
+ if (bt === "attributename" && co(M, "href")) {
2581
+ rt(x, i, E);
2583
2582
  continue;
2584
2583
  }
2585
- if (!f.forceKeepAttr) {
2586
- if (!f.keepAttr) {
2587
- rt(S, i, y);
2584
+ if (!p.forceKeepAttr) {
2585
+ if (!p.keepAttr) {
2586
+ rt(x, i, E);
2588
2587
  continue;
2589
2588
  }
2590
- if (!Re && P(Xn, O)) {
2591
- rt(S, i, y);
2589
+ if (!Ne && I(ti, M)) {
2590
+ rt(x, i, E);
2592
2591
  continue;
2593
2592
  }
2594
- if (X && (O = Ut(O)), !eo(b, bt, O)) {
2595
- rt(S, i, y);
2593
+ if (X && (M = Ut(M)), !oo(y, bt, M)) {
2594
+ rt(x, i, E);
2596
2595
  continue;
2597
2596
  }
2598
- O = an(b, bt, j, O), O !== he && sn(i, S, j, O) && io && so(t.removed);
2597
+ M = dn(y, bt, j, M), M !== he && un(i, x, j, M) && ro && lo(t.removed);
2599
2598
  }
2600
2599
  }
2601
- Y(x.afterSanitizeAttributes, i, null), gt(i, s);
2600
+ Y(T.afterSanitizeAttributes, i, null), gt(i, l);
2602
2601
  }, $t = function(i) {
2603
- let s = null;
2602
+ let l = null;
2604
2603
  const d = Je(i);
2605
- for (Y(x.beforeSanitizeShadowDOM, i, null); s = d.nextNode(); )
2606
- if (Y(x.uponSanitizeShadowNode, s, null), to(s, i), no(s, i), mt(s.content) && $t(s.content), Et(s) === H.element) {
2607
- const f = st(s);
2608
- mt(f) && (fe(f), $t(f));
2604
+ for (Y(T.beforeSanitizeShadowDOM, i, null); l = d.nextNode(); )
2605
+ if (Y(T.uponSanitizeShadowNode, l, null), eo(l, i), io(l, i), mt(l.content) && $t(l.content), kt(l) === H.element) {
2606
+ const p = st(l);
2607
+ mt(p) && (fe(p), $t(p));
2609
2608
  }
2610
- Y(x.afterSanitizeShadowDOM, i, null);
2609
+ Y(T.afterSanitizeShadowDOM, i, null);
2611
2610
  }, fe = function(i) {
2612
- const s = [{
2611
+ const l = [{
2613
2612
  node: i,
2614
2613
  shadow: null
2615
2614
  }];
2616
- for (; s.length > 0; ) {
2617
- const d = s.pop();
2615
+ for (; l.length > 0; ) {
2616
+ const d = l.pop();
2618
2617
  if (d.shadow) {
2619
2618
  $t(d.shadow);
2620
2619
  continue;
2621
2620
  }
2622
- const f = d.node, h = Et(f) === H.element, b = G(f);
2623
- if (b) for (let y = b.length - 1; y >= 0; --y) s.push({
2624
- node: b[y],
2621
+ const p = d.node, m = kt(p) === H.element, y = G(p);
2622
+ if (y) for (let E = y.length - 1; E >= 0; --E) l.push({
2623
+ node: y[E],
2625
2624
  shadow: null
2626
2625
  });
2627
- if (h) {
2628
- const y = lt ? lt(f) : null;
2629
- if (typeof y == "string" && _(y) === "template") {
2630
- const S = f.content;
2631
- mt(S) && s.push({
2632
- node: S,
2626
+ if (m) {
2627
+ const E = lt ? lt(p) : null;
2628
+ if (typeof E == "string" && S(E) === "template") {
2629
+ const x = p.content;
2630
+ mt(x) && l.push({
2631
+ node: x,
2633
2632
  shadow: null
2634
2633
  });
2635
2634
  }
2636
2635
  }
2637
- if (h) {
2638
- const y = st(f);
2639
- mt(y) && s.push({
2636
+ if (m) {
2637
+ const E = st(p);
2638
+ mt(E) && l.push({
2640
2639
  node: null,
2641
- shadow: y
2640
+ shadow: E
2642
2641
  }, {
2643
- node: y,
2642
+ node: E,
2644
2643
  shadow: null
2645
2644
  });
2646
2645
  }
2647
2646
  }
2648
2647
  };
2649
2648
  return t.sanitize = function(u) {
2650
- let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, f = null, h = null;
2651
- if (se = !u, se && (u = "<!-->"), typeof u != "string" && !xt(u) && (u = Nn(u), typeof u != "string"))
2652
- throw J("dirty is not a string, aborting");
2649
+ let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = null, d = null, p = null, m = null;
2650
+ if (se = !u, se && (u = "<!-->"), typeof u != "string" && !At(u) && (u = Hn(u), typeof u != "string"))
2651
+ throw Z("dirty is not a string, aborting");
2653
2652
  if (!t.isSupported) return u;
2654
- ne ? (C = Dt, A = Ot) : ue(i), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (C = U(C)), x.uponSanitizeAttribute.length > 0 && (A = U(A)), t.removed = [];
2655
- const b = ae && typeof u != "string" && xt(u);
2656
- if (b) {
2657
- en(u);
2658
- const j = Zt(u);
2653
+ ne ? (C = Mt, A = Rt) : ue(i), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (C = U(C)), T.uponSanitizeAttribute.length > 0 && (A = U(A)), t.removed = [];
2654
+ const y = ae && typeof u != "string" && At(u);
2655
+ if (y) {
2656
+ an(u);
2657
+ const j = Qt(u);
2659
2658
  if (typeof j == "string") {
2660
- const F = _(j);
2661
- if (!C[F] || kt[F])
2662
- throw Ft(u), J("root node is forbidden and cannot be sanitized in-place");
2659
+ const F = S(j);
2660
+ if (!C[F] || Tt[F])
2661
+ throw Ft(u), Z("root node is forbidden and cannot be sanitized in-place");
2663
2662
  }
2664
2663
  if (jt(u))
2665
- throw Ft(u), J("root node is clobbered and cannot be sanitized in-place");
2664
+ throw Ft(u), Z("root node is clobbered and cannot be sanitized in-place");
2666
2665
  try {
2667
2666
  fe(u);
2668
2667
  } catch (F) {
2669
2668
  throw Ft(u), F;
2670
2669
  }
2671
- } else if (xt(u))
2672
- s = Ze("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType === H.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? s = d : s.appendChild(d), fe(s);
2670
+ } else if (At(u))
2671
+ l = Ze("<!---->"), d = l.ownerDocument.importNode(u, !0), d.nodeType === H.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? l = d : l.appendChild(d), fe(l);
2673
2672
  else {
2674
- if (!dt && !X && !it && u.indexOf("<") === -1) return R && Nt ? ct(u) : u;
2675
- if (s = Ze(u), !s) return dt ? null : Nt ? ot : "";
2673
+ if (!dt && !X && !it && u.indexOf("<") === -1) return O && Nt ? ct(u) : u;
2674
+ if (l = Ze(u), !l) return dt ? null : Nt ? ot : "";
2676
2675
  }
2677
- s && ie && Z(s.firstChild);
2678
- const y = b ? u : s;
2676
+ l && ie && Q(l.firstChild);
2677
+ const E = y ? u : l;
2679
2678
  try {
2680
- const j = Je(y);
2681
- for (; f = j.nextNode(); )
2682
- to(f, y), no(f, y), mt(f.content) && $t(f.content);
2679
+ const j = Je(E);
2680
+ for (; p = j.nextNode(); )
2681
+ eo(p, E), io(p, E), mt(p.content) && $t(p.content);
2683
2682
  } catch (j) {
2684
- throw b && (Ft(u), at(t.removed, (F) => {
2683
+ throw y && (Ft(u), at(t.removed, (F) => {
2685
2684
  F.element && Ht(F.element);
2686
2685
  })), j;
2687
2686
  }
2688
- if (b) {
2687
+ if (y) {
2689
2688
  let j = !1;
2690
2689
  if (at(t.removed, (F) => {
2691
2690
  F.element && (F.element === u && (j = !0), Ht(F.element));
2692
- }), j) throw J("a node selected for removal could not be safely returned; refusing to sanitize in place");
2691
+ }), j) throw Z("a node selected for removal could not be safely returned; refusing to sanitize in place");
2693
2692
  return X && pe(u), u;
2694
2693
  }
2695
2694
  if (dt) {
2696
- if (X && pe(s), Rt)
2697
- for (h = Ro.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
2698
- else h = s;
2699
- return (A.shadowroot || A.shadowrootmode) && (h = zo.call(o, h, !0)), h;
2695
+ if (X && pe(l), Ot)
2696
+ for (m = Fo.call(l.ownerDocument); l.firstChild; ) m.appendChild(l.firstChild);
2697
+ else m = l;
2698
+ return (A.shadowroot || A.shadowrootmode) && (m = Uo.call(o, m, !0)), m;
2700
2699
  }
2701
- let S = it ? s.outerHTML : s.innerHTML;
2702
- return it && C["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && P(qn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
2703
- ` + S), X && (S = Ut(S)), R && Nt ? ct(S) : S;
2700
+ let x = it ? l.outerHTML : l.innerHTML;
2701
+ return it && C["!doctype"] && l.ownerDocument && l.ownerDocument.doctype && l.ownerDocument.doctype.name && I(Qn, l.ownerDocument.doctype.name) && (x = "<!DOCTYPE " + l.ownerDocument.doctype.name + `>
2702
+ ` + x), X && (x = Ut(x)), O && Nt ? ct(x) : x;
2704
2703
  }, t.setConfig = function() {
2705
2704
  let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2706
- ue(u), ne = !0, Dt = C, Ot = A;
2705
+ ue(u), ne = !0, Mt = C, Rt = A;
2707
2706
  }, t.clearConfig = function() {
2708
- ht = null, ne = !1, Dt = null, Ot = null, R = Jt, ot = "";
2709
- }, t.isValidAttribute = function(u, i, s) {
2707
+ ht = null, ne = !1, Mt = null, Rt = null, O = Zt, ot = "";
2708
+ }, t.isValidAttribute = function(u, i, l) {
2710
2709
  ht || ue({});
2711
- const d = _(u), f = _(i);
2712
- return eo(d, f, s);
2710
+ const d = S(u), p = S(i);
2711
+ return oo(d, p, l);
2713
2712
  }, t.addHook = function(u, i) {
2714
- typeof i == "function" && N(x, u) && Ct(x[u], i);
2713
+ typeof i == "function" && N(T, u) && xt(T[u], i);
2715
2714
  }, t.removeHook = function(u, i) {
2716
- if (N(x, u)) {
2715
+ if (N(T, u)) {
2717
2716
  if (i !== void 0) {
2718
- const s = Ln(x[u], i);
2719
- return s === -1 ? void 0 : Mn(x[u], s, 1)[0];
2717
+ const l = Mn(T[u], i);
2718
+ return l === -1 ? void 0 : Rn(T[u], l, 1)[0];
2720
2719
  }
2721
- return so(x[u]);
2720
+ return lo(T[u]);
2722
2721
  }
2723
2722
  }, t.removeHooks = function(u) {
2724
- N(x, u) && (x[u] = []);
2723
+ N(T, u) && (T[u] = []);
2725
2724
  }, t.removeAllHooks = function() {
2726
- x = Eo();
2725
+ T = ko();
2727
2726
  }, t;
2728
2727
  }
2729
- var Kt = Mo();
2730
- const ei = [
2728
+ var qt = Ro();
2729
+ const ri = [
2731
2730
  "p",
2732
2731
  "br",
2733
2732
  "strong",
@@ -2776,7 +2775,7 @@ const ei = [
2776
2775
  // user-initiated dialog, a different trust boundary that never calls
2777
2776
  // through this sanitizer. A consumer that genuinely wants iframes in
2778
2777
  // pasted/typed content can still opt in via a custom allowedTags list.
2779
- ], oi = {
2778
+ ], ai = {
2780
2779
  "*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
2781
2780
  a: ["href", "target", "rel", "title"],
2782
2781
  img: ["src", "alt", "width", "height", "loading"],
@@ -2793,8 +2792,8 @@ const ei = [
2793
2792
  // additionalAllowedTags), restoring the attributes that make an inserted
2794
2793
  // iframe actually usable (src, sizing, fullscreen, scrolling/border).
2795
2794
  iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
2796
- }, ni = "data-editora-embed";
2797
- function ii(n) {
2795
+ }, si = "data-editora-embed";
2796
+ function li(n) {
2798
2797
  if (!n || /\s/.test(n.trim())) return !1;
2799
2798
  try {
2800
2799
  const t = new URL(n.trim());
@@ -2803,50 +2802,50 @@ function ii(n) {
2803
2802
  return !1;
2804
2803
  }
2805
2804
  }
2806
- function Io(n, t, e, o) {
2805
+ function Oo(n, t, e, o) {
2807
2806
  if ((t == null ? void 0 : t.sanitize) === !1)
2808
2807
  return n;
2809
- const r = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ei, a = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...r, ...e])) : r, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : oi, p = /* @__PURE__ */ new Set();
2810
- for (const w of Object.values(c))
2811
- for (const k of w) p.add(k);
2812
- const m = {
2808
+ const r = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ri, a = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...r, ...e])) : r, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : ai, f = /* @__PURE__ */ new Set();
2809
+ for (const b of Object.values(c))
2810
+ for (const k of b) f.add(k);
2811
+ const h = {
2813
2812
  ALLOWED_TAGS: a,
2814
- ALLOWED_ATTR: Array.from(p)
2813
+ ALLOWED_ATTR: Array.from(f)
2815
2814
  };
2816
2815
  if (!o)
2817
- return Kt.sanitize(n, m);
2816
+ return qt.sanitize(n, h);
2818
2817
  const g = a.includes("iframe");
2819
- Kt.addHook(
2818
+ qt.addHook(
2820
2819
  "uponSanitizeElement",
2821
- (w, k) => {
2822
- var T;
2820
+ (b, k) => {
2821
+ var R;
2823
2822
  if (k.tagName !== "iframe") return;
2824
- const E = w;
2825
- k.allowedTags.iframe = g || ((T = E.getAttribute) == null ? void 0 : T.call(E, ni)) === "true" && ii(E.getAttribute("src"));
2823
+ const w = b;
2824
+ k.allowedTags.iframe = g || ((R = w.getAttribute) == null ? void 0 : R.call(w, si)) === "true" && li(w.getAttribute("src"));
2826
2825
  }
2827
2826
  );
2828
2827
  try {
2829
- return Kt.sanitize(n, m);
2828
+ return qt.sanitize(n, h);
2830
2829
  } finally {
2831
- Kt.removeHook("uponSanitizeElement");
2830
+ qt.removeHook("uponSanitizeElement");
2832
2831
  }
2833
2832
  }
2834
- function ri(n, t, e, o) {
2835
- return Io(n, t, o, !1);
2833
+ function ci(n, t, e, o) {
2834
+ return Oo(n, t, o, !1);
2836
2835
  }
2837
- function ai(n, t, e) {
2838
- return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? n : ri(n, t);
2836
+ function di(n, t, e) {
2837
+ return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? n : ci(n, t);
2839
2838
  }
2840
2839
  function wo(n, t, e, o) {
2841
- return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? n : Io(n, t, o, !0);
2840
+ return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? n : Oo(n, t, o, !0);
2842
2841
  }
2843
- const si = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", li = /resize-handle|data-rte-media-pending|rte-media/;
2844
- function Po(n) {
2845
- if (!n || !li.test(n)) return n;
2842
+ const ui = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", pi = /resize-handle|data-rte-media-pending|rte-media/;
2843
+ function No(n) {
2844
+ if (!n || !pi.test(n)) return n;
2846
2845
  const t = document.createElement("template");
2847
2846
  t.innerHTML = n;
2848
2847
  const e = /* @__PURE__ */ new Set();
2849
- return t.content.querySelectorAll(si).forEach((o) => {
2848
+ return t.content.querySelectorAll(ui).forEach((o) => {
2850
2849
  const r = o.parentElement;
2851
2850
  r && (r.tagName === "TD" || r.tagName === "TH") && e.add(r), o.remove();
2852
2851
  }), e.forEach((o) => {
@@ -2859,8 +2858,8 @@ function Po(n) {
2859
2858
  r && (r.removeAttribute("contenteditable"), !((a = r.textContent) != null && a.trim()) && !r.querySelector("img, video, a") && r.remove());
2860
2859
  }), t.innerHTML;
2861
2860
  }
2862
- function _t(n) {
2863
- return n ? Po(n.innerHTML) : "";
2861
+ function yt(n) {
2862
+ return n ? No(n.innerHTML) : "";
2864
2863
  }
2865
2864
  const Xt = class Xt {
2866
2865
  /**
@@ -2880,12 +2879,12 @@ const Xt = class Xt {
2880
2879
  static normalizeConfig(t) {
2881
2880
  const e = { ...t };
2882
2881
  if (e.toolbarFloating !== void 0 || e.toolbarSticky !== void 0) {
2883
- const l = typeof e.toolbar == "object" && e.toolbar ? { ...e.toolbar } : typeof e.toolbar == "string" ? { items: e.toolbar } : {};
2884
- e.toolbarFloating !== void 0 && (l.floating = !!e.toolbarFloating), e.toolbarSticky !== void 0 && (l.sticky = !!e.toolbarSticky), e.toolbar = l;
2882
+ const s = typeof e.toolbar == "object" && e.toolbar ? { ...e.toolbar } : typeof e.toolbar == "string" ? { items: e.toolbar } : {};
2883
+ e.toolbarFloating !== void 0 && (s.floating = !!e.toolbarFloating), e.toolbarSticky !== void 0 && (s.sticky = !!e.toolbarSticky), e.toolbar = s;
2885
2884
  }
2886
2885
  if (e.toolbarItems !== void 0 && typeof e.toolbar == "object" && e.toolbar && (e.toolbar.items = e.toolbarItems), e.autosaveEnabled !== void 0 || e.autosaveIntervalMs !== void 0 || e.autosaveStorageKey !== void 0 || e.autosaveProvider !== void 0 || e.autosaveApiUrl !== void 0) {
2887
- const l = typeof e.autosave == "object" && e.autosave ? { ...e.autosave } : {};
2888
- e.autosaveEnabled !== void 0 && (l.enabled = !!e.autosaveEnabled), e.autosaveIntervalMs !== void 0 && (l.intervalMs = Number(e.autosaveIntervalMs)), e.autosaveStorageKey !== void 0 && (l.storageKey = e.autosaveStorageKey), e.autosaveProvider !== void 0 && (l.provider = e.autosaveProvider), e.autosaveApiUrl !== void 0 && (l.apiUrl = e.autosaveApiUrl), e.autosave = l;
2886
+ const s = typeof e.autosave == "object" && e.autosave ? { ...e.autosave } : {};
2887
+ e.autosaveEnabled !== void 0 && (s.enabled = !!e.autosaveEnabled), e.autosaveIntervalMs !== void 0 && (s.intervalMs = Number(e.autosaveIntervalMs)), e.autosaveStorageKey !== void 0 && (s.storageKey = e.autosaveStorageKey), e.autosaveProvider !== void 0 && (s.provider = e.autosaveProvider), e.autosaveApiUrl !== void 0 && (s.apiUrl = e.autosaveApiUrl), e.autosave = s;
2889
2888
  }
2890
2889
  const o = {
2891
2890
  enabled: !1,
@@ -2900,16 +2899,16 @@ const Xt = class Xt {
2900
2899
  enabled: e.autosave
2901
2900
  };
2902
2901
  else if (typeof e.autosave == "object" && e.autosave) {
2903
- const l = {
2902
+ const s = {
2904
2903
  ...o,
2905
2904
  ...e.autosave
2906
2905
  };
2907
- l.intervalMs === void 0 && l.interval !== void 0 && (l.intervalMs = Number(l.interval)), l.enabled === void 0 && (l.enabled = !0), (!Number.isFinite(l.intervalMs) || l.intervalMs <= 0) && (l.intervalMs = o.intervalMs), e.autosave = l;
2906
+ s.intervalMs === void 0 && s.interval !== void 0 && (s.intervalMs = Number(s.interval)), s.enabled === void 0 && (s.enabled = !0), (!Number.isFinite(s.intervalMs) || s.intervalMs <= 0) && (s.intervalMs = o.intervalMs), e.autosave = s;
2908
2907
  } else
2909
2908
  e.autosave = o;
2910
2909
  if (e.languageLocale !== void 0 || e.languageDirection !== void 0) {
2911
- const l = typeof e.language == "object" && e.language ? { ...e.language } : {};
2912
- e.languageLocale !== void 0 && (l.locale = e.languageLocale), e.languageDirection !== void 0 && (l.direction = e.languageDirection), e.language = l;
2910
+ const s = typeof e.language == "object" && e.language ? { ...e.language } : {};
2911
+ e.languageLocale !== void 0 && (s.locale = e.languageLocale), e.languageDirection !== void 0 && (s.direction = e.languageDirection), e.language = s;
2913
2912
  }
2914
2913
  const r = { locale: "en", direction: "ltr" };
2915
2914
  if (typeof e.language == "string" ? e.language = {
@@ -2919,8 +2918,8 @@ const Xt = class Xt {
2919
2918
  ...r,
2920
2919
  ...e.language
2921
2920
  } : e.language = r, e.spellcheckEnabled !== void 0 || e.spellcheckProvider !== void 0 || e.spellcheckApiUrl !== void 0) {
2922
- const l = typeof e.spellcheck == "object" && e.spellcheck ? { ...e.spellcheck } : {};
2923
- e.spellcheckEnabled !== void 0 && (l.enabled = !!e.spellcheckEnabled), e.spellcheckProvider !== void 0 && (l.provider = e.spellcheckProvider), e.spellcheckApiUrl !== void 0 && (l.apiUrl = e.spellcheckApiUrl), e.spellcheck = l;
2921
+ const s = typeof e.spellcheck == "object" && e.spellcheck ? { ...e.spellcheck } : {};
2922
+ e.spellcheckEnabled !== void 0 && (s.enabled = !!e.spellcheckEnabled), e.spellcheckProvider !== void 0 && (s.provider = e.spellcheckProvider), e.spellcheckApiUrl !== void 0 && (s.apiUrl = e.spellcheckApiUrl), e.spellcheck = s;
2924
2923
  }
2925
2924
  const a = {
2926
2925
  enabled: !1,
@@ -2933,11 +2932,11 @@ const Xt = class Xt {
2933
2932
  enabled: e.spellcheck
2934
2933
  };
2935
2934
  else if (typeof e.spellcheck == "object" && e.spellcheck) {
2936
- const l = {
2935
+ const s = {
2937
2936
  ...a,
2938
2937
  ...e.spellcheck
2939
2938
  };
2940
- !l.provider && l.mode && (l.provider = l.mode === "local" ? "browser" : "api"), l.enabled === void 0 && (l.enabled = !!(l.mode || l.provider || l.apiUrl)), e.spellcheck = l;
2939
+ !s.provider && s.mode && (s.provider = s.mode === "local" ? "browser" : "api"), s.enabled === void 0 && (s.enabled = !!(s.mode || s.provider || s.apiUrl)), e.spellcheck = s;
2941
2940
  } else
2942
2941
  e.spellcheck = a;
2943
2942
  return e.contextMenuEnabled !== void 0 && (e.contextMenu = {
@@ -3059,7 +3058,7 @@ Xt.EDITOR_DEFAULTS = {
3059
3058
  width: "100%",
3060
3059
  readonly: !1,
3061
3060
  disabled: !1,
3062
- menubar: !0,
3061
+ menubar: !1,
3063
3062
  toolbar: !0,
3064
3063
  plugins: [],
3065
3064
  theme: "light",
@@ -3123,88 +3122,264 @@ Xt.EDITOR_DEFAULTS = {
3123
3122
  "security-sanitize-on-paste",
3124
3123
  "security-sanitize-on-input"
3125
3124
  ]);
3126
- let Ce = Xt;
3127
- const ci = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
3128
- let qt;
3129
- const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", ko = "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();
3130
- let tt = null, xo = !1, we = null, ke = null;
3131
- function Co(n) {
3125
+ let xe = Xt;
3126
+ const To = /* @__PURE__ */ new Set();
3127
+ function fi(n, t) {
3128
+ To.has(n) || (To.add(n), console.warn(
3129
+ `[Editora] The "${n}" option has no effect: ${t} It is still accepted so existing code keeps working, and will be removed in a future major release.`
3130
+ ));
3131
+ }
3132
+ const hi = [
3133
+ "bold",
3134
+ "italic",
3135
+ "underline",
3136
+ "strikethrough",
3137
+ "clearFormatting",
3138
+ "heading",
3139
+ "blockquote",
3140
+ "list",
3141
+ "link",
3142
+ "table",
3143
+ "history"
3144
+ ], mi = /* @__PURE__ */ new Set([
3145
+ "bold",
3146
+ "italic",
3147
+ "underline",
3148
+ "strikethrough",
3149
+ "clearFormatting",
3150
+ "heading",
3151
+ "blockquote",
3152
+ "code",
3153
+ "codeSample",
3154
+ "list",
3155
+ "checklist",
3156
+ "textAlignment",
3157
+ "indent",
3158
+ "direction",
3159
+ "textColor",
3160
+ "backgroundColor",
3161
+ "fontSize",
3162
+ "fontFamily",
3163
+ "formatPainter",
3164
+ "format-painter",
3165
+ "formatpainter",
3166
+ "lineHeight",
3167
+ "capitalization",
3168
+ "history",
3169
+ "link",
3170
+ "table",
3171
+ "trackChanges",
3172
+ "versionDiff",
3173
+ "version-diff",
3174
+ "versiondiff",
3175
+ "conditionalContent",
3176
+ "conditional-content",
3177
+ "conditionalcontent",
3178
+ "dataBinding",
3179
+ "data-binding",
3180
+ "databinding",
3181
+ "docSchema",
3182
+ "doc-schema",
3183
+ "docschema",
3184
+ "translationWorkflow",
3185
+ "translation-workflow",
3186
+ "translationworkflow",
3187
+ "contentRules",
3188
+ "content-rules",
3189
+ "contentrules",
3190
+ "citations",
3191
+ "citation",
3192
+ "approvalWorkflow",
3193
+ "approval-workflow",
3194
+ "approvalworkflow",
3195
+ "piiRedaction",
3196
+ "pii-redaction",
3197
+ "piiredaction",
3198
+ "smartPaste",
3199
+ "smart-paste",
3200
+ "smartpaste",
3201
+ "blocksLibrary",
3202
+ "blocks-library",
3203
+ "blockslibrary",
3204
+ "mentions",
3205
+ "mention",
3206
+ "anchor",
3207
+ "embedIframe",
3208
+ "math",
3209
+ "image",
3210
+ "mergeTag",
3211
+ "pageBreak",
3212
+ "print",
3213
+ "preview",
3214
+ "specialCharacters",
3215
+ "slashCommands",
3216
+ "slash-commands",
3217
+ "spellCheck",
3218
+ "emojis",
3219
+ "a11yChecker",
3220
+ "comments",
3221
+ "collaboration",
3222
+ "document-manager",
3223
+ "fullscreen",
3224
+ "template",
3225
+ "footnote"
3226
+ ]), gi = "all", Co = {
3227
+ toggleBold: "bold",
3228
+ toggleItalic: "italic",
3229
+ toggleUnderline: "underline",
3230
+ toggleStrikethrough: "strikethrough",
3231
+ clearFormatting: "clearFormatting",
3232
+ setBlockType: "heading",
3233
+ toggleBlockquote: "blockquote",
3234
+ toggleSourceView: "code",
3235
+ insertCodeBlock: "codeSample",
3236
+ toggleBulletList: "list",
3237
+ toggleOrderedList: "list",
3238
+ toggleChecklist: "checklist",
3239
+ setTextAlignment: "textAlignment",
3240
+ increaseIndent: "indent",
3241
+ decreaseIndent: "indent",
3242
+ setDirectionLTR: "direction",
3243
+ setDirectionRTL: "direction",
3244
+ openTextColorPicker: "textColor",
3245
+ openBackgroundColorPicker: "backgroundColor",
3246
+ fontSize: "fontSize",
3247
+ setFontFamily: "fontFamily",
3248
+ toggleFormatPainter: "formatPainter",
3249
+ setLineHeight: "lineHeight",
3250
+ setCapitalization: "capitalization",
3251
+ undo: "history",
3252
+ redo: "history",
3253
+ openLinkDialog: "link",
3254
+ insertTable: "table",
3255
+ toggleTrackChanges: "trackChanges",
3256
+ openVersionDiff: "versionDiff",
3257
+ conditionalContent: "conditionalContent",
3258
+ openDataBindingDialog: "dataBinding",
3259
+ docSchema: "docSchema",
3260
+ translationWorkflow: "translationWorkflow",
3261
+ contentRules: "contentRules",
3262
+ citations: "citations",
3263
+ approvalWorkflow: "approvalWorkflow",
3264
+ piiRedaction: "piiRedaction",
3265
+ smartPaste: "smartPaste",
3266
+ blocksLibrary: "blocksLibrary",
3267
+ insertMention: "mentions",
3268
+ insertAnchor: "anchor",
3269
+ openEmbedIframeDialog: "embedIframe",
3270
+ insertMath: "math",
3271
+ insertImage: "image",
3272
+ insertVideo: "image",
3273
+ insertMergeTag: "mergeTag",
3274
+ insertPageBreak: "pageBreak",
3275
+ print: "print",
3276
+ togglePreview: "preview",
3277
+ insertSpecialCharacter: "specialCharacters",
3278
+ openSlashCommands: "slashCommands",
3279
+ toggleSpellCheck: "spellCheck",
3280
+ openEmojiDialog: "emojis",
3281
+ toggleA11yChecker: "a11yChecker",
3282
+ addComment: "comments",
3283
+ toggleComments: "comments",
3284
+ importWord: "document-manager",
3285
+ exportWord: "document-manager",
3286
+ exportPdf: "document-manager",
3287
+ toggleFullscreen: "fullscreen",
3288
+ insertTemplate: "template",
3289
+ insertFootnote: "footnote"
3290
+ };
3291
+ function bi(n, t) {
3292
+ var o, r;
3293
+ if (!n) return [];
3294
+ const e = [];
3295
+ for (const a of n.split(/[\s|]+/)) {
3296
+ if (!a) continue;
3297
+ const s = Po[a] || a, c = (r = (o = Co[s]) != null ? o : Co[a]) != null ? r : t(a) ? a : void 0;
3298
+ c && !e.includes(c) && e.push(c);
3299
+ }
3300
+ return e;
3301
+ }
3302
+ const yi = '.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}}';
3303
+ let Kt;
3304
+ const Ei = "__editoraCommandEditorRoot", vi = "__editoraLastCommandButton", Ao = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", xo = ".rte-content, .editora-content", ki = "Rich text editor", wi = /* @__PURE__ */ new Set(["collaboration"]), ke = "data-editora-disabled-by-host", Se = /* @__PURE__ */ new Set();
3305
+ let tt = null, So = !1, we = null, Te = null;
3306
+ function Lo(n) {
3132
3307
  if (!(n instanceof HTMLElement)) return !1;
3133
3308
  const t = n;
3134
3309
  return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
3135
3310
  }
3136
- function hi(n) {
3311
+ function Ti(n) {
3137
3312
  return n ? n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement : null;
3138
3313
  }
3139
- function Lt(n) {
3314
+ function _t(n) {
3140
3315
  if (!n) return null;
3141
- if (Co(n))
3316
+ if (Lo(n))
3142
3317
  return n;
3143
- const t = n.matches(ko) ? n : n.closest(ko);
3144
- return !t || !Co(t) ? null : t;
3318
+ const t = n.matches(Ao) ? n : n.closest(Ao);
3319
+ return !t || !Lo(t) ? null : t;
3145
3320
  }
3146
- function mi() {
3321
+ function Ci() {
3147
3322
  var r;
3148
3323
  if (typeof window == "undefined") return null;
3149
- const n = window[di];
3324
+ const n = window[Ei];
3150
3325
  if (n instanceof HTMLElement) {
3151
- const a = Lt(n);
3326
+ const a = _t(n);
3152
3327
  if (a) return a;
3153
- const l = n.matches(To) ? n : n.querySelector(To);
3154
- if (l) {
3155
- const c = Lt(l);
3328
+ const s = n.matches(xo) ? n : n.querySelector(xo);
3329
+ if (s) {
3330
+ const c = _t(s);
3156
3331
  if (c) return c;
3157
3332
  }
3158
3333
  }
3159
- const t = window[ui];
3334
+ const t = window[vi];
3160
3335
  if (t instanceof HTMLElement) {
3161
- const a = Lt(t);
3336
+ const a = _t(t);
3162
3337
  if (a) return a;
3163
3338
  }
3164
3339
  const e = document.activeElement;
3165
3340
  if (e) {
3166
- const a = Lt(e);
3341
+ const a = _t(e);
3167
3342
  if (a) return a;
3168
3343
  }
3169
3344
  const o = (r = window.getSelection) == null ? void 0 : r.call(window);
3170
3345
  if (o && o.rangeCount > 0) {
3171
- const a = Lt(hi(o.getRangeAt(0).startContainer));
3346
+ const a = _t(Ti(o.getRangeAt(0).startContainer));
3172
3347
  if (a) return a;
3173
3348
  }
3174
3349
  if (tt && tt.isConnected)
3175
3350
  return tt;
3176
- for (const a of Ae)
3351
+ for (const a of Se)
3177
3352
  if (a.isConnected) return a;
3178
3353
  return null;
3179
3354
  }
3180
- function gi() {
3181
- if (typeof window == "undefined" || xo) return;
3182
- we = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, ke = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3355
+ function Ai() {
3356
+ if (typeof window == "undefined" || So) return;
3357
+ we = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, Te = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3183
3358
  const n = (t, ...e) => {
3184
- const o = mi();
3185
- return o ? o.execCommand(t, ...e) : we ? we(t, ...e) : ke ? ke(t, ...e) : !1;
3359
+ const o = Ci();
3360
+ return o ? o.execCommand(t, ...e) : we ? we(t, ...e) : Te ? Te(t, ...e) : !1;
3186
3361
  };
3187
- window.executeEditorCommand = n, window.execEditorCommand = n, xo = !0;
3362
+ window.executeEditorCommand = n, window.execEditorCommand = n, So = !0;
3188
3363
  }
3189
- function bi() {
3364
+ function xi() {
3190
3365
  const n = "editora-webcomponent-styles";
3191
3366
  if (!document.getElementById(n)) {
3192
3367
  const t = document.createElement("style");
3193
- t.id = n, t.textContent = ci, document.head.appendChild(t);
3368
+ t.id = n, t.textContent = yi, document.head.appendChild(t);
3194
3369
  }
3195
3370
  }
3196
- function yi() {
3197
- if (!qt) {
3371
+ function Si() {
3372
+ if (!Kt) {
3198
3373
  const n = $.__globalPluginLoader;
3199
- n ? qt = n : qt = new Ao();
3374
+ n ? Kt = n : Kt = new _o();
3200
3375
  }
3201
- return qt;
3376
+ return Kt;
3202
3377
  }
3203
- const vi = typeof HTMLElement == "undefined" ? class {
3378
+ const Li = typeof HTMLElement == "undefined" ? class {
3204
3379
  } : HTMLElement;
3205
- class $ extends vi {
3380
+ class $ extends Li {
3206
3381
  constructor() {
3207
- if (super(), this.pluginLoader = yi(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new En(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.pluginInstances = /* @__PURE__ */ new Map(), this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, bi(), !this.hasAttribute("data-initial-content")) {
3382
+ if (super(), this.pluginLoader = Si(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new Cn(), 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, xi(), !this.hasAttribute("data-initial-content")) {
3208
3383
  const t = this.innerHTML.trim();
3209
3384
  t && this.setAttribute("data-initial-content", t);
3210
3385
  }
@@ -3261,7 +3436,7 @@ class $ extends vi {
3261
3436
  * Called when element is added to DOM
3262
3437
  */
3263
3438
  connectedCallback() {
3264
- this.config = this.resolveConfig(), this.waitForPluginLoader().then(() => {
3439
+ this.hasConnected = !0, this.config = this.resolveConfig(), this.waitForPluginLoader().then(() => {
3265
3440
  setTimeout(async () => {
3266
3441
  await this.initialize();
3267
3442
  }, 0);
@@ -3298,7 +3473,22 @@ class $ extends vi {
3298
3473
  * Set configuration via JavaScript API
3299
3474
  */
3300
3475
  async setConfig(t) {
3301
- this.jsConfig = t, this.config = this.resolveConfig(), this.isConnected && (this.destroy(), await this.waitForPluginLoader(), await this.initialize());
3476
+ this.jsConfig = t, this.config = this.resolveConfig(), this.isConnected ? (this.destroy(), this.adoptConfiguredContent(t), await this.waitForPluginLoader(), await this.initialize()) : this.adoptConfiguredContent(t);
3477
+ }
3478
+ /**
3479
+ * `content` in setConfig() is a one-off replacement, not a setting: it feeds the next initialize()
3480
+ * the same way the live content that destroy() keeps does, so a later rebuild (a `plugins`
3481
+ * attribute change, the element being moved) resumes from what the user typed, not from this value.
3482
+ * It outranks that kept content, autosave and the element's own markup.
3483
+ */
3484
+ adoptConfiguredContent(t) {
3485
+ typeof t.content == "string" && (this.preservedContent = t.content);
3486
+ }
3487
+ /** Replace the `editora-theme-*` class (there is only ever one) with the one for `theme`. */
3488
+ applyThemeClass(t) {
3489
+ Array.from(this.classList).forEach((e) => {
3490
+ e.startsWith("editora-theme-") && this.classList.remove(e);
3491
+ }), t && this.classList.add(`editora-theme-${t}`);
3302
3492
  }
3303
3493
  /**
3304
3494
  * Initialize the editor
@@ -3307,29 +3497,29 @@ class $ extends vi {
3307
3497
  var a;
3308
3498
  if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
3309
3499
  const t = ++this.buildGeneration;
3310
- this.setAttribute("data-editora-editor", "true"), Ae.add(this), tt || (tt = this), gi(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.config.theme && this.classList.add(`editora-theme-${this.config.theme}`), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
3500
+ this.setAttribute("data-editora-editor", "true"), Se.add(this), tt || (tt = this), Ai(), 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() && fi("menubar", "<editora-editor> does not render a menu bar."), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
3311
3501
  const e = await this.loadPlugins();
3312
3502
  if (t !== this.buildGeneration || !this.isConnected) return;
3313
- if (this.loadedPlugins = e, e.forEach((l) => {
3314
- if (l.init && typeof l.init == "function")
3503
+ if (this.loadedPlugins = e, e.forEach((s) => {
3504
+ if (s.init && typeof s.init == "function")
3315
3505
  try {
3316
- l.init({ editorElement: this });
3506
+ s.init({ editorElement: this });
3317
3507
  } catch (c) {
3318
- console.error(`[RichTextEditor] Error initializing plugin ${l.name}:`, c);
3508
+ console.error(`[RichTextEditor] Error initializing plugin ${s.name}:`, c);
3319
3509
  }
3320
3510
  }), !this.hasAttribute("data-initial-content") && !this.contentElement) {
3321
- const l = this.innerHTML.trim();
3322
- l && this.setAttribute("data-initial-content", l);
3511
+ const s = this.innerHTML.trim();
3512
+ s && this.setAttribute("data-initial-content", s);
3323
3513
  }
3324
3514
  const o = this.preservedContent;
3325
3515
  this.preservedContent = null;
3326
3516
  const r = this.sanitizeLoadedContent(
3327
3517
  (a = o != null ? o : this.restoreAutosavedContent()) != null ? a : this.getAttribute("data-initial-content") || ""
3328
3518
  );
3329
- this.engine = new un({
3519
+ this.engine = new mn({
3330
3520
  content: r,
3331
3521
  plugins: e,
3332
- readonly: this.config.readonly
3522
+ readonly: !!this.config.readonly || this.isEditorDisabled()
3333
3523
  }), this.createUI(e, r), this.setupEventListeners(), this.startAutosave(), this.isInitialized = !0, this.removeAttribute("data-loading"), this.removeAttribute("aria-busy"), this.dispatchEvent(new CustomEvent("editor-ready", {
3334
3524
  detail: { api: this.getAPI() },
3335
3525
  bubbles: !0
@@ -3345,41 +3535,76 @@ class $ extends vi {
3345
3535
  return t ? t.innerHTML : this.hasChildNodes() ? Array.from(this.childNodes).map((o) => o.nodeType === Node.TEXT_NODE ? o.textContent : o.nodeType === Node.ELEMENT_NODE ? o.outerHTML : "").join("").trim() : "";
3346
3536
  }
3347
3537
  /**
3348
- * Load plugins based on configuration
3538
+ * Load plugins based on configuration.
3539
+ *
3540
+ * With `plugins` listed, exactly those load (`all` stands for every registered plugin). Without it,
3541
+ * the editor loads DEFAULT_PLUGINS plus whatever the page asks for in other ways: a toolbar item, a
3542
+ * `pluginConfig` entry, `accessibility.checker`, a plugin it registered itself, or one it already
3543
+ * loaded through the plugin loader.
3349
3544
  */
3350
3545
  async loadPlugins() {
3351
3546
  this.pluginLoader || await this.waitForPluginLoader();
3352
- const t = [], e = this.config.plugins && (typeof this.config.plugins == "string" && this.config.plugins.length > 0 || Array.isArray(this.config.plugins) && this.config.plugins.length > 0), r = this.getAccessibilityConfig().checker === !0;
3353
- if (e) {
3354
- if (typeof this.config.plugins == "string") {
3355
- const a = this.config.plugins.split(/\s+/).filter(Boolean);
3356
- r && !a.includes("a11yChecker") && a.push("a11yChecker");
3357
- for (const l of a) {
3358
- const c = await this.loadPlugin(l, this.getPluginLoadConfig(l));
3359
- c && t.push(c);
3360
- }
3361
- } else if (Array.isArray(this.config.plugins)) {
3362
- for (const a of this.config.plugins)
3363
- if (typeof a == "string") {
3364
- const l = await this.loadPlugin(a, this.getPluginLoadConfig(a));
3365
- l && t.push(l);
3366
- } else
3367
- t.push(a);
3368
- if (r && !t.some((a) => (a == null ? void 0 : a.name) === "a11yChecker")) {
3369
- const a = await this.loadPlugin("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
3370
- a && t.push(a);
3371
- }
3372
- }
3373
- } else {
3374
- const a = this.pluginLoader.getRegisteredPluginNames();
3375
- for (const l of a) {
3376
- const c = this.getPluginLoadConfig(l);
3377
- if (fi.has(l) && !c) continue;
3378
- const p = await this.loadPlugin(l, c);
3379
- p && t.push(p);
3547
+ const t = this.config.plugins, e = typeof t == "string" ? t.split(/\s+/).filter(Boolean) : Array.isArray(t) ? t : [], o = this.getAccessibilityConfig().checker === !0;
3548
+ if (e.length === 0) {
3549
+ const a = this.resolveDefaultPluginNames();
3550
+ return o && a.push("a11yChecker"), this.loadPluginsByName(a);
3551
+ }
3552
+ const r = [];
3553
+ for (const a of e)
3554
+ if (typeof a != "string")
3555
+ r.push(a);
3556
+ else if (a === gi)
3557
+ r.push(...await this.loadPluginsByName(this.resolveAllPluginNames()));
3558
+ else {
3559
+ const s = await this.loadPlugin(a, this.getPluginLoadConfig(a));
3560
+ s && r.push(s);
3380
3561
  }
3562
+ if (o && !r.some((a) => (a == null ? void 0 : a.name) === "a11yChecker")) {
3563
+ const a = await this.loadPlugin("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
3564
+ a && r.push(a);
3381
3565
  }
3382
- return t;
3566
+ return this.withoutDuplicatePlugins(r);
3567
+ }
3568
+ /** The plugins a bare editor loads: see loadPlugins(). Only registered names, in a stable order. */
3569
+ resolveDefaultPluginNames() {
3570
+ const t = this.pluginLoader.getRegisteredPluginNames(), e = (r) => t.includes(r), o = /* @__PURE__ */ new Set([
3571
+ ...hi,
3572
+ ...bi(this.resolveToolbarItems(), e)
3573
+ ]);
3574
+ for (const r of t)
3575
+ (!mi.has(r) || this.pluginLoader.isLoaded(r) || this.isPluginRequestedByConfig(r)) && o.add(r);
3576
+ return t.filter((r) => o.has(r));
3577
+ }
3578
+ /** Every registered plugin, except the ones that act on their own and have not been configured. */
3579
+ resolveAllPluginNames() {
3580
+ return this.pluginLoader.getRegisteredPluginNames().filter((t) => !wi.has(t) || this.getPluginLoadConfig(t));
3581
+ }
3582
+ async loadPluginsByName(t) {
3583
+ const e = [];
3584
+ for (const o of t) {
3585
+ const r = await this.loadPlugin(o, this.getPluginLoadConfig(o));
3586
+ r && e.push(r);
3587
+ }
3588
+ return this.withoutDuplicatePlugins(e);
3589
+ }
3590
+ /**
3591
+ * One instance per plugin. Several registered names can create the same plugin (`formatPainter`,
3592
+ * `format-painter`, `formatpainter`), and loading each of them put its buttons on the toolbar again.
3593
+ */
3594
+ withoutDuplicatePlugins(t) {
3595
+ const e = /* @__PURE__ */ new Set();
3596
+ return t.filter((o) => o != null && o.name ? e.has(o.name) ? !1 : (e.add(o.name), !0) : !0);
3597
+ }
3598
+ /**
3599
+ * True when the page configured this plugin, under `pluginConfig` or as a top-level option of its own
3600
+ * name. `spellcheck` does not count: it is the editor's own setting (the browser's spell checking) and
3601
+ * always has a value.
3602
+ */
3603
+ isPluginRequestedByConfig(t) {
3604
+ if (!this.getPluginLoadConfig(t)) return !1;
3605
+ if (t !== "spellCheck") return !0;
3606
+ const o = this.config.pluginConfig;
3607
+ return !!(o && typeof o == "object" && (o.spellCheck || o.spellcheck));
3383
3608
  }
3384
3609
  /**
3385
3610
  * This editor's instance of a registered plugin: created on first use, then reused (with the
@@ -3472,12 +3697,15 @@ class $ extends vi {
3472
3697
  if (!this.contentElement) return;
3473
3698
  const t = this.getAccessibilityConfig();
3474
3699
  if (t.enableARIA) {
3475
- this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute("aria-disabled", this.config.readonly ? "true" : "false");
3700
+ this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute(
3701
+ "aria-disabled",
3702
+ this.config.readonly || this.isEditorDisabled() ? "true" : "false"
3703
+ );
3476
3704
  const o = (e = this.getAttribute("aria-label")) == null ? void 0 : e.trim(), r = typeof this.config.placeholder == "string" ? this.config.placeholder.trim() : "";
3477
- this.contentElement.setAttribute("aria-label", o || r || pi);
3705
+ this.contentElement.setAttribute("aria-label", o || r || ki);
3478
3706
  } else
3479
3707
  this.contentElement.removeAttribute("role"), this.contentElement.removeAttribute("aria-multiline"), this.contentElement.removeAttribute("aria-disabled"), this.contentElement.removeAttribute("aria-label");
3480
- this.contentElement.tabIndex = t.keyboardNavigation ? 0 : -1;
3708
+ this.contentElement.tabIndex = t.keyboardNavigation && !this.isEditorDisabled() ? 0 : -1;
3481
3709
  }
3482
3710
  applyLanguageSettings() {
3483
3711
  if (!this.contentElement) return;
@@ -3513,12 +3741,12 @@ class $ extends vi {
3513
3741
  editorElement: this,
3514
3742
  contentElement: this.contentElement,
3515
3743
  toolbarElement: this.toolbarElement
3516
- }, r = this.loadedPlugins.find((l) => l.commands && l.commands[t]);
3744
+ }, r = this.loadedPlugins.find((s) => s.commands && s.commands[t]);
3517
3745
  if (r && r.commands) {
3518
- const l = r.commands[t];
3519
- if (typeof l == "function")
3746
+ const s = r.commands[t];
3747
+ if (typeof s == "function")
3520
3748
  try {
3521
- return t === "toggleFullscreen" ? l(this, o) : l(...e, o), !0;
3749
+ return t === "toggleFullscreen" ? s(this, o) : s(...e, o), !0;
3522
3750
  } catch (c) {
3523
3751
  return console.error(`[RichTextEditor] Error executing native command ${t}:`, c), !1;
3524
3752
  }
@@ -3555,9 +3783,9 @@ class $ extends vi {
3555
3783
  ...o[t] || []
3556
3784
  ];
3557
3785
  for (const a of r) {
3558
- const l = this.config[a];
3559
- if (l && typeof l == "object" && !Array.isArray(l))
3560
- return l;
3786
+ const s = this.config[a];
3787
+ if (s && typeof s == "object" && !Array.isArray(s))
3788
+ return s;
3561
3789
  }
3562
3790
  }
3563
3791
  getContentSanitizeConfig() {
@@ -3642,7 +3870,7 @@ class $ extends vi {
3642
3870
  this.stopAutosave();
3643
3871
  const t = this.getAutosaveConfig();
3644
3872
  !t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
3645
- this.persistAutosave(_t(this.contentElement));
3873
+ this.persistAutosave(yt(this.contentElement));
3646
3874
  }, t.intervalMs));
3647
3875
  }
3648
3876
  insertHTMLAtSelection(t) {
@@ -3665,7 +3893,7 @@ class $ extends vi {
3665
3893
  */
3666
3894
  createUI(t, e) {
3667
3895
  const o = this.querySelector('[slot="toolbar"]'), r = this.querySelector('[slot="statusbar"]');
3668
- this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new pn(
3896
+ 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 gn(
3669
3897
  {
3670
3898
  items: this.resolveToolbarItems(),
3671
3899
  sticky: this.isToolbarStickyEnabled(),
@@ -3674,18 +3902,19 @@ class $ extends vi {
3674
3902
  t,
3675
3903
  this.pluginLoader
3676
3904
  // Pass plugin loader to get all registered plugins
3677
- ), this.toolbar.setCommandHandler((a, l) => {
3905
+ ), this.toolbar.setCommandHandler((a, s) => {
3678
3906
  var c;
3907
+ if (this.isEditorDisabled()) return !1;
3679
3908
  if (this.contentElement) {
3680
3909
  this.contentElement.focus();
3681
- const p = window.getSelection();
3682
- if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.anchorNode)) {
3683
- const m = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
3684
- 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);
3910
+ const f = window.getSelection();
3911
+ if (!f || f.rangeCount === 0 || !this.contentElement.contains(f.anchorNode)) {
3912
+ const h = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
3913
+ g.nodeType === Node.TEXT_NODE ? h.setStart(g, ((c = g.textContent) == null ? void 0 : c.length) || 0) : g.nodeType === Node.ELEMENT_NODE ? (h.selectNodeContents(g), h.collapse(!1)) : h.setStart(this.contentElement, 0), h.collapse(!0), f == null || f.removeAllRanges(), f == null || f.addRange(h);
3685
3914
  }
3686
3915
  }
3687
- return this.executeCommand(a, l);
3688
- }), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
3916
+ return this.executeCommand(a, s);
3917
+ }), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly || this.isEditorDisabled() ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
3689
3918
  try {
3690
3919
  document.execCommand("defaultParagraphSeparator", !1, "p");
3691
3920
  } catch (a) {
@@ -3695,18 +3924,27 @@ class $ extends vi {
3695
3924
  const a = document.createElement("div");
3696
3925
  a.innerHTML = e.trim(), !Array.from(a.childNodes).some((c) => {
3697
3926
  if (c.nodeType === Node.ELEMENT_NODE) {
3698
- const p = c.tagName;
3699
- return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(p);
3927
+ const f = c.tagName;
3928
+ return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(f);
3700
3929
  }
3701
3930
  return !1;
3702
3931
  }) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
3703
3932
  } else
3704
3933
  this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
3705
- this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new fn({ enabled: !0 }), this.floatingToolbar.create(this)), r ? this.appendChild(r) : 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(() => {
3934
+ this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new bn({ enabled: !0 }), this.floatingToolbar.create(this)), r ? this.appendChild(r) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new yn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.setToolbarControlsDisabled(this.isEditorDisabled()), this.lastReportedContent = yt(this.contentElement), this.config.autofocus && !this.isEditorDisabled() && setTimeout(() => {
3706
3935
  var a;
3707
3936
  return (a = this.contentElement) == null ? void 0 : a.focus();
3708
3937
  }, 0);
3709
3938
  }
3939
+ /** True only when the page asked for a menu bar (the default is not a request), through setConfig() or the attribute. */
3940
+ isMenubarRequested() {
3941
+ var o;
3942
+ const t = (o = this.jsConfig) == null ? void 0 : o.menubar;
3943
+ if (t !== void 0)
3944
+ return t === !0 || typeof t == "object" && t !== null && t.enabled !== !1;
3945
+ const e = this.getAttribute("menubar");
3946
+ return e !== null && e !== "false";
3947
+ }
3710
3948
  /**
3711
3949
  * Hands what a keystroke changed to the history plugin, so Undo takes back typing. Without this the
3712
3950
  * plugin only knew about changes that plugins reported themselves, and typed text could not be undone.
@@ -3721,6 +3959,30 @@ class $ extends vi {
3721
3959
  selectionCollapsed: e.selectionCollapsed
3722
3960
  });
3723
3961
  }
3962
+ /**
3963
+ * `disabled` is `readonly` plus a toolbar that cannot be pressed and a surface that leaves the tab
3964
+ * order, like a disabled form control.
3965
+ */
3966
+ isEditorDisabled() {
3967
+ return this.config.disabled === !0;
3968
+ }
3969
+ applyDisabledState() {
3970
+ var e, o;
3971
+ const t = this.isEditorDisabled();
3972
+ 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);
3973
+ }
3974
+ /**
3975
+ * Disable (or give back) every control the default toolbar rendered. Controls that were already
3976
+ * disabled for another reason are marked untouched, so enabling the editor does not wake them up.
3977
+ */
3978
+ setToolbarControlsDisabled(t) {
3979
+ if (!this.toolbarElement) return;
3980
+ this.toolbarElement.querySelectorAll(
3981
+ "button, input, select, textarea"
3982
+ ).forEach((o) => {
3983
+ t ? o.disabled || (o.disabled = !0, o.setAttribute(ke, "")) : o.hasAttribute(ke) && (o.disabled = !1, o.removeAttribute(ke));
3984
+ });
3985
+ }
3724
3986
  /**
3725
3987
  * Setup event listeners
3726
3988
  */
@@ -3739,61 +4001,59 @@ class $ extends vi {
3739
4001
  var k;
3740
4002
  if (!this.contentElement) return;
3741
4003
  let r = this.contentElement.innerHTML;
3742
- const a = (k = o == null ? void 0 : o.detail) == null ? void 0 : k.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = this.lastBeforeInputType;
3743
- if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
3744
- const E = wo(r, c, p, a);
3745
- if (E !== r) {
3746
- const T = window.getSelection(), et = T && T.rangeCount > 0 ? T.getRangeAt(0) : null;
3747
- if (this.contentElement.innerHTML = E, et && T)
4004
+ const a = (k = o == null ? void 0 : o.detail) == null ? void 0 : k.allowedTags, s = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), h = this.lastBeforeInputType;
4005
+ if (this.lastBeforeInputType = null, f.sanitizeOnInput !== !1 && c.sanitize !== !1 && !h) {
4006
+ const w = wo(r, c, f, a);
4007
+ if (w !== r) {
4008
+ const R = window.getSelection(), et = R && R.rangeCount > 0 ? R.getRangeAt(0) : null;
4009
+ if (this.contentElement.innerHTML = w, et && R)
3748
4010
  try {
3749
- T.removeAllRanges(), T.addRange(et);
4011
+ R.removeAllRanges(), R.addRange(et);
3750
4012
  } catch (G) {
3751
4013
  }
3752
- r = E;
4014
+ r = w;
3753
4015
  }
3754
4016
  }
3755
4017
  this.recordInputHistory(r), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
3756
- const w = () => {
3757
- this.dispatchEvent(new CustomEvent("content-change", {
3758
- detail: { html: Po(r) },
3759
- bubbles: !0
3760
- }));
4018
+ const b = () => {
4019
+ this.emitContentChange(No(r));
3761
4020
  };
3762
- l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(w, l.debounceInputMs) : w(), this.updateStatusBar();
4021
+ s.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(b, s.debounceInputMs) : b(), this.updateStatusBar();
3763
4022
  }), this.contentElement.addEventListener("contextmenu", (o) => {
3764
4023
  const r = this.config.contextMenu;
3765
4024
  (r === !1 || typeof r == "object" && r !== null && r.enabled === !1) && o.preventDefault();
3766
4025
  }), this.contentElement.addEventListener("paste", (o) => {
3767
- var g, w;
4026
+ var g, b;
3768
4027
  if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
3769
4028
  return;
3770
4029
  o.preventDefault();
3771
4030
  const r = this.config.paste || {};
3772
4031
  let a = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
3773
- const l = ((w = o.clipboardData) == null ? void 0 : w.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = !!a && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(a);
3774
- if ((r.clean || !r.keepFormatting) && l) {
3775
- document.execCommand("insertText", !1, l);
4032
+ const s = ((b = o.clipboardData) == null ? void 0 : b.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), h = !!a && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(a);
4033
+ if ((r.clean || !r.keepFormatting) && s) {
4034
+ document.execCommand("insertText", !1, s);
3776
4035
  return;
3777
4036
  }
3778
- if (r.convertWord === !1 && m && l) {
3779
- document.execCommand("insertText", !1, l);
4037
+ if (r.convertWord === !1 && h && s) {
4038
+ document.execCommand("insertText", !1, s);
3780
4039
  return;
3781
4040
  }
3782
4041
  if (a) {
3783
- p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (a = ai(a, c, p)), this.insertHTMLAtSelection(a);
4042
+ f.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (a = di(a, c, f)), this.insertHTMLAtSelection(a);
3784
4043
  return;
3785
4044
  }
3786
- l && document.execCommand("insertText", !1, l);
4045
+ s && document.execCommand("insertText", !1, s);
3787
4046
  }), this.contentElement.addEventListener("focus", () => {
3788
4047
  tt = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
3789
4048
  }), this.contentElement.addEventListener("blur", () => {
3790
- this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
3791
- detail: { html: _t(this.contentElement) },
3792
- bubbles: !0
3793
- })), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
4049
+ if (this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement) {
4050
+ const o = yt(this.contentElement);
4051
+ o !== this.lastReportedContent && this.emitContentChange(o);
4052
+ }
4053
+ this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
3794
4054
  }), this.contentElement.addEventListener("keydown", (o) => {
3795
- this.getAccessibilityConfig().keyboardNavigation && t.handleKeyDown(o, (a, l) => {
3796
- this.executeCommand(a, l);
4055
+ !this.getAccessibilityConfig().keyboardNavigation || this.isEditorDisabled() || t.handleKeyDown(o, (a, s) => {
4056
+ this.executeCommand(a, s);
3797
4057
  });
3798
4058
  });
3799
4059
  const e = () => {
@@ -3802,6 +4062,12 @@ class $ extends vi {
3802
4062
  };
3803
4063
  this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
3804
4064
  }
4065
+ emitContentChange(t) {
4066
+ this.lastReportedContent = t, this.dispatchEvent(new CustomEvent("content-change", {
4067
+ detail: { html: t },
4068
+ bubbles: !0
4069
+ }));
4070
+ }
3805
4071
  getSelectionRangeInEditor() {
3806
4072
  if (!this.contentElement) return null;
3807
4073
  const t = window.getSelection();
@@ -3851,12 +4117,12 @@ class $ extends vi {
3851
4117
  this.floatingToolbar.hide();
3852
4118
  return;
3853
4119
  }
3854
- const l = this.getSelectionAnchorRect(a, r);
3855
- if (!l) {
4120
+ const s = this.getSelectionAnchorRect(a, r);
4121
+ if (!s) {
3856
4122
  this.floatingToolbar.hide();
3857
4123
  return;
3858
4124
  }
3859
- this.floatingToolbar.show(l.left, l.top - 40);
4125
+ this.floatingToolbar.show(s.left, s.top - 40);
3860
4126
  }
3861
4127
  /**
3862
4128
  * Update status bar with selection and cursor information
@@ -3869,15 +4135,15 @@ class $ extends vi {
3869
4135
  const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
3870
4136
  if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
3871
4137
  return;
3872
- const o = this.contentElement.textContent || "", { words: r, chars: a } = yn(o), l = bn(this.contentElement);
3873
- let c, p;
3874
- const m = this.getSelectionRangeInEditor();
3875
- m && (c = mn(this.contentElement, m), m.collapsed || (p = vn(m, c), c = void 0)), this.statusBar.update({
4138
+ const o = this.contentElement.textContent || "", { words: r, chars: a } = wn(o), s = kn(this.contentElement);
4139
+ let c, f;
4140
+ const h = this.getSelectionRangeInEditor();
4141
+ h && (c = En(this.contentElement, h), h.collapsed || (f = Tn(h, c), c = void 0)), this.statusBar.update({
3876
4142
  wordCount: r,
3877
4143
  charCount: a,
3878
- lineCount: l,
4144
+ lineCount: s,
3879
4145
  cursorPosition: c,
3880
- selectionInfo: p
4146
+ selectionInfo: f
3881
4147
  });
3882
4148
  }
3883
4149
  /**
@@ -3893,12 +4159,13 @@ class $ extends vi {
3893
4159
  handleAttributeChange(t, e) {
3894
4160
  switch (t) {
3895
4161
  case "readonly":
3896
- this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e));
4162
+ this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) || this.isEditorDisabled() ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e) || this.isEditorDisabled());
4163
+ break;
4164
+ case "disabled":
4165
+ this.applyDisabledState();
3897
4166
  break;
3898
4167
  case "theme":
3899
- this.classList.forEach((o) => {
3900
- o.startsWith("editora-theme-") && this.classList.remove(o);
3901
- }), e && this.classList.add(`editora-theme-${e}`);
4168
+ this.applyThemeClass(e);
3902
4169
  break;
3903
4170
  case "placeholder":
3904
4171
  this.contentElement && (this.contentElement.setAttribute("data-placeholder", e), this.applyAccessibilitySettings());
@@ -3948,14 +4215,20 @@ class $ extends vi {
3948
4215
  case "toolbar-sticky":
3949
4216
  case "plugins":
3950
4217
  case "statusbar":
3951
- this.isConnected && (this.destroy(), this.waitForPluginLoader().then(() => {
3952
- this.initialize().catch((o) => {
3953
- console.error("[RichTextEditor] Error during attribute change re-initialization:", o);
3954
- });
3955
- }));
4218
+ this.isConnected && this.hasConnected && this.scheduleReinitialize();
3956
4219
  break;
3957
4220
  }
3958
4221
  }
4222
+ /** One rebuild for however many attributes are changed in the same task. */
4223
+ scheduleReinitialize() {
4224
+ this.reinitializeQueued || (this.reinitializeQueued = !0, queueMicrotask(() => {
4225
+ this.reinitializeQueued = !1, this.isConnected && (this.destroy(), this.waitForPluginLoader().then(() => {
4226
+ this.initialize().catch((t) => {
4227
+ console.error("[RichTextEditor] Error during attribute change re-initialization:", t);
4228
+ });
4229
+ }));
4230
+ }));
4231
+ }
3959
4232
  /**
3960
4233
  * Resolve configuration from all sources
3961
4234
  */
@@ -3965,7 +4238,7 @@ class $ extends vi {
3965
4238
  const o = this.attributes[e];
3966
4239
  t[o.name] = o.value;
3967
4240
  }
3968
- return Ce.resolve({
4241
+ return xe.resolve({
3969
4242
  jsConfig: this.jsConfig,
3970
4243
  attributes: t
3971
4244
  });
@@ -3975,7 +4248,7 @@ class $ extends vi {
3975
4248
  */
3976
4249
  getAPI() {
3977
4250
  return {
3978
- getContent: () => _t(this.contentElement),
4251
+ getContent: () => yt(this.contentElement),
3979
4252
  setContent: (t) => {
3980
4253
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
3981
4254
  },
@@ -4003,11 +4276,11 @@ class $ extends vi {
4003
4276
  */
4004
4277
  destroy() {
4005
4278
  var t, e, o, r;
4006
- this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = _t(this.contentElement), this.persistAutosave(this.preservedContent)), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (r = this.statusBar) == null || r.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, Ae.delete(this), tt === this && (tt = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
4279
+ this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = yt(this.contentElement), this.persistAutosave(this.preservedContent)), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (r = this.statusBar) == null || r.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.lastReportedContent = null, this.isInitialized = !1, Se.delete(this), tt === this && (tt = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
4007
4280
  }
4008
4281
  // Public API methods
4009
4282
  getContent() {
4010
- return _t(this.contentElement);
4283
+ return yt(this.contentElement);
4011
4284
  }
4012
4285
  setContent(t) {
4013
4286
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
@@ -4024,10 +4297,7 @@ class $ extends vi {
4024
4297
  (t = this.contentElement) == null || t.blur();
4025
4298
  }
4026
4299
  }
4027
- const Vt = new Ao();
4028
- $.__globalPluginLoader = Vt;
4029
- const Ei = {
4030
- // Core editing plugins (always loaded)
4300
+ const _i = {
4031
4301
  bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((n) => n.BoldPlugin()),
4032
4302
  italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((n) => n.ItalicPlugin()),
4033
4303
  underline: () => import("./UnderlinePlugin.native-DZzg23rv.mjs").then((n) => n.UnderlinePlugin()),
@@ -4052,13 +4322,12 @@ const Ei = {
4052
4322
  lineHeight: () => import("./LineHeightPlugin.native-CM7iXdQj.mjs").then((n) => n.LineHeightPlugin()),
4053
4323
  capitalization: () => import("./CapitalizationPlugin.native-Mh-kUy-x.mjs").then((n) => n.CapitalizationPlugin()),
4054
4324
  history: () => import("./HistoryPlugin.native-C8GyxsgC.mjs").then((n) => n.HistoryPlugin()),
4055
- // Advanced plugins (lazy loaded)
4056
4325
  link: () => import("./LinkPlugin.native-Dt_p6Ukb.mjs").then((n) => n.LinkPlugin()),
4057
4326
  table: () => import("./TablePlugin.native-1TvjRqv1.mjs").then((n) => n.TablePlugin()),
4058
4327
  trackChanges: () => import("./TrackChangesPlugin.native-Bghu2q4a.mjs").then((n) => n.TrackChangesPlugin()),
4059
- versionDiff: () => import("./VersionDiffPlugin.native-DJZIzFSK.mjs").then((n) => n.VersionDiffPlugin()),
4060
- "version-diff": () => import("./VersionDiffPlugin.native-DJZIzFSK.mjs").then((n) => n.VersionDiffPlugin()),
4061
- versiondiff: () => import("./VersionDiffPlugin.native-DJZIzFSK.mjs").then((n) => n.VersionDiffPlugin()),
4328
+ versionDiff: () => import("./VersionDiffPlugin.native-2v8ZaZWN.mjs").then((n) => n.VersionDiffPlugin()),
4329
+ "version-diff": () => import("./VersionDiffPlugin.native-2v8ZaZWN.mjs").then((n) => n.VersionDiffPlugin()),
4330
+ versiondiff: () => import("./VersionDiffPlugin.native-2v8ZaZWN.mjs").then((n) => n.VersionDiffPlugin()),
4062
4331
  conditionalContent: () => import("./ConditionalContentPlugin.native-B3R6xcqn.mjs").then((n) => n.ConditionalContentPlugin()),
4063
4332
  "conditional-content": () => import("./ConditionalContentPlugin.native-B3R6xcqn.mjs").then((n) => n.ConditionalContentPlugin()),
4064
4333
  conditionalcontent: () => import("./ConditionalContentPlugin.native-B3R6xcqn.mjs").then((n) => n.ConditionalContentPlugin()),
@@ -4110,35 +4379,36 @@ const Ei = {
4110
4379
  fullscreen: () => import("./FullscreenPlugin.native-ChXyxeNw.mjs").then((n) => n.FullscreenPlugin()),
4111
4380
  template: () => import("./TemplatePlugin.native-OD8Wc1R7.mjs").then((n) => n.TemplatePlugin()),
4112
4381
  footnote: () => import("./FootnotePlugin.native-D730OGRm.mjs").then((n) => n.FootnotePlugin())
4113
- };
4114
- async function wi() {
4115
- return Object.entries(Ei).forEach(([n, t]) => {
4382
+ }, Vt = new _o();
4383
+ $.__globalPluginLoader = Vt;
4384
+ async function Pi() {
4385
+ return Object.entries(_i).forEach(([n, t]) => {
4116
4386
  Vt.register(n, t);
4117
4387
  }), Vt;
4118
4388
  }
4119
- typeof window != "undefined" && wi().then((n) => {
4389
+ typeof window != "undefined" && Pi().then((n) => {
4120
4390
  $.__globalPluginLoader = n, customElements.get("editora-editor") || customElements.define("editora-editor", $);
4121
4391
  const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
4122
4392
  t.forEach((a) => {
4123
- const l = a.innerHTML.trim();
4124
- e.push(l), l && a.setAttribute("data-initial-content", l);
4393
+ const s = a.innerHTML.trim();
4394
+ e.push(s), s && a.setAttribute("data-initial-content", s);
4125
4395
  });
4126
4396
  const o = document.querySelectorAll("editora-editor");
4127
4397
  Array.from(o).filter((a) => !a.hasAttribute("data-initial-content")).forEach((a) => {
4128
- const l = Array.from(o).indexOf(a);
4129
- e[l] && a.setAttribute("data-initial-content", e[l]);
4398
+ const s = Array.from(o).indexOf(a);
4399
+ e[s] && a.setAttribute("data-initial-content", e[s]);
4130
4400
  }), window.Editora = {
4131
4401
  version: "1.0.0",
4132
4402
  plugins: Vt.getRegisteredPluginNames(),
4133
4403
  WebComponent: $,
4134
- init: async (a, l) => {
4404
+ init: async (a, s) => {
4135
4405
  const c = document.querySelector(a);
4136
- return c instanceof $ ? (l && await c.setConfig(l), c.getAPI()) : null;
4406
+ return c instanceof $ ? (s && await c.setConfig(s), c.getAPI()) : null;
4137
4407
  }
4138
4408
  };
4139
4409
  });
4140
4410
  export {
4141
4411
  $ as RichTextEditorElement,
4142
- wi as initWebComponent
4412
+ Pi as initWebComponent
4143
4413
  };
4144
4414
  //# sourceMappingURL=webcomponent.js.map