@editora/core 1.0.33 → 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.
@@ -98,7 +98,7 @@ class Yt {
98
98
  return new Yt(t, e || this.selection, this.schema);
99
99
  }
100
100
  }
101
- class dn {
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 dn {
109
109
  return { type: "text", text: t, marks: e };
110
110
  }
111
111
  }
112
- class un {
112
+ class fn {
113
113
  constructor() {
114
114
  this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
115
115
  }
@@ -146,7 +146,7 @@ class un {
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 dn(t, e);
149
+ }), new pn(t, e);
150
150
  }
151
151
  getCommands() {
152
152
  const t = {};
@@ -164,9 +164,9 @@ class un {
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 un {
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 un {
200
200
  await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
201
201
  }
202
202
  }
203
- class pn {
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 pn {
243
243
  this.commands.clear();
244
244
  }
245
245
  }
246
- class fn {
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 un(), 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 pn(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 fn {
329
329
  return this.isDestroyed;
330
330
  }
331
331
  }
332
- class hn {
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 hn {
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 v = a.get("setDirectionLTR"), T = a.get("setDirectionRTL");
428
- v && 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: v.label,
431
- command: v.command,
432
- icon: v.icon,
433
- type: v.type || "button",
434
- options: v.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 v = a.get("addComment"), T = a.get("toggleComments");
447
- v && 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: v.label,
450
- command: v.command,
451
- icon: v.icon,
452
- type: v.type || "button",
453
- options: v.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 hn {
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
  }
@@ -516,29 +515,29 @@ class hn {
516
515
  const c = this.overflowUnits;
517
516
  if (c.length === 0) return;
518
517
  c.forEach((B) => {
519
- var P;
520
- B.parentElement === r && ((P = this.overflowUnitHomes.get(B)) == null || P.appendChild(B));
518
+ var D;
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), v = Math.max(0, k - g - w), T = getComputedStyle(t).direction === "rtl", et = e.getBoundingClientRect(), G = (B) => {
523
- const P = B.getBoundingClientRect();
524
- return T ? et.right - P.left : P.right - et.left;
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) => {
522
+ const D = B.getBoundingClientRect();
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) <= v) 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
- o.style.display = st ? "" : "none", o.classList.toggle("active", st && this.expandedOpen), !st && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B, P) => {
536
- P >= z && r.appendChild(B);
534
+ o.style.display = st ? "" : "none", o.classList.toggle("active", st && this.expandedOpen), !st && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B, D) => {
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 hn {
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 = (v) => {
647
- m.preventDefault(), g[(v + 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 hn {
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 hn {
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 hn {
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 mn {
761
+ class bn {
763
762
  constructor(t) {
764
763
  this.visible = !1, this.config = t;
765
764
  }
@@ -801,7 +800,7 @@ class mn {
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 gn {
803
+ class yn {
805
804
  constructor(t = {}) {
806
805
  this.statusInfo = {}, this.config = t;
807
806
  }
@@ -838,19 +837,19 @@ class gn {
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 gn {
861
860
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
862
861
  }
863
862
  }
864
- function bn(n, t) {
865
- const e = n.textContent || "", o = yn(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 yn(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 yn(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 En(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 En(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 vn(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 wn(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 wn(n, t) {
915
914
  selectedWords: e.trim().split(/\s+/).filter(Boolean).length
916
915
  };
917
916
  }
918
- class kn {
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 kn {
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
  `;
@@ -1255,58 +1254,58 @@ function ao(n, t) {
1255
1254
  for (var e = 0, o = Array(t); e < t; e++) o[e] = n[e];
1256
1255
  return o;
1257
1256
  }
1258
- function Tn(n) {
1257
+ function An(n) {
1259
1258
  if (Array.isArray(n)) return n;
1260
1259
  }
1261
- function Cn(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 xn() {
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 An(n, t) {
1284
- return Tn(n) || Cn(n, t) || Sn(n, t) || xn();
1282
+ function Ln(n, t) {
1283
+ return An(n) || xn(n, t) || _n(n, t) || Sn();
1285
1284
  }
1286
- function Sn(n, t) {
1285
+ function _n(n, t) {
1287
1286
  if (n) {
1288
1287
  if (typeof n == "string") return ao(n, t);
1289
1288
  var e = {}.toString.call(n).slice(8, -1);
1290
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 Lo = Object.entries, so = Object.setPrototypeOf, _n = Object.isFrozen, Ln = Object.getPrototypeOf, Mn = Object.getOwnPropertyDescriptor;
1294
- let M = Object.freeze, D = Object.seal, Et = Object.create, Mo = typeof Reflect != "undefined" && Reflect, Ce = Mo.apply, xe = Mo.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
- D || (D = function(t) {
1297
+ P || (P = function(t) {
1299
1298
  return t;
1300
1299
  });
1301
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), Dn = L(Array.prototype.lastIndexOf), lo = L(Array.prototype.pop), At = L(Array.prototype.push), In = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), me = L(String.prototype.toString), co = L(String.prototype.match), St = L(String.prototype.replace), uo = L(String.prototype.indexOf), Pn = L(String.prototype.trim), On = L(Number.prototype.toString), Rn = L(Boolean.prototype.toString), po = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), fo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), N = L(Object.prototype.hasOwnProperty), _t = L(Object.prototype.toString), I = L(RegExp.prototype.test), Z = Nn(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);
@@ -1314,89 +1313,89 @@ function L(n) {
1314
1313
  return Ce(n, t, o);
1315
1314
  };
1316
1315
  }
1317
- function Nn(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
- function E(n, t) {
1324
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Mt;
1322
+ function v(n, t) {
1323
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Pt;
1325
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 && (_n(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 zn(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
1341
  const t = Et(null);
1343
- for (const o of Lo(n)) {
1344
- var e = An(o, 2);
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] = zn(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 Bn(n) {
1349
+ function Hn(n) {
1351
1350
  switch (typeof n) {
1352
1351
  case "string":
1353
1352
  return n;
1354
1353
  case "number":
1355
- return On(n);
1354
+ return Nn(n);
1356
1355
  case "boolean":
1357
- return Rn(n);
1356
+ return zn(n);
1358
1357
  case "bigint":
1359
1358
  return po ? po(n) : "0";
1360
1359
  case "symbol":
1361
1360
  return fo ? fo(n) : "Symbol()";
1362
1361
  case "undefined":
1363
- return _t(n);
1362
+ return Lt(n);
1364
1363
  case "function":
1365
1364
  case "object": {
1366
- if (n === null) return _t(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 : _t(o);
1369
+ return typeof o == "string" ? o : Lt(o);
1371
1370
  }
1372
- return _t(n);
1371
+ return Lt(n);
1373
1372
  }
1374
1373
  default:
1375
- return _t(n);
1374
+ return Lt(n);
1376
1375
  }
1377
1376
  }
1378
1377
  function W(n, t) {
1379
1378
  for (; n !== null; ) {
1380
- const o = Mn(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 = Ln(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 Fn(n) {
1391
+ function Un(n) {
1393
1392
  try {
1394
1393
  return I(n, ""), !0;
1395
1394
  } catch (t) {
1396
1395
  return !1;
1397
1396
  }
1398
1397
  }
1399
- const ho = M([
1398
+ const ho = _([
1400
1399
  "a",
1401
1400
  "abbr",
1402
1401
  "acronym",
@@ -1516,7 +1515,7 @@ const ho = 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 ho = 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 ho = M([
1590
1589
  "feSpotLight",
1591
1590
  "feTile",
1592
1591
  "feTurbulence"
1593
- ]), Hn = M([
1592
+ ]), jn = _([
1594
1593
  "animate",
1595
1594
  "color-profile",
1596
1595
  "cursor",
@@ -1613,7 +1612,7 @@ const ho = 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 ho = M([
1644
1643
  "munder",
1645
1644
  "munderover",
1646
1645
  "mprescripts"
1647
- ]), Un = M([
1646
+ ]), Wn = _([
1648
1647
  "maction",
1649
1648
  "maligngroup",
1650
1649
  "malignmark",
@@ -1660,7 +1659,7 @@ const ho = M([
1660
1659
  "annotation-xml",
1661
1660
  "mprescripts",
1662
1661
  "none"
1663
- ]), mo = M(["#text"]), go = M([
1662
+ ]), mo = _(["#text"]), go = _([
1664
1663
  "accept",
1665
1664
  "action",
1666
1665
  "align",
@@ -1779,7 +1778,7 @@ const ho = M([
1779
1778
  "width",
1780
1779
  "wrap",
1781
1780
  "xmlns"
1782
- ]), Ee = M([
1781
+ ]), Ee = _([
1783
1782
  "accent-height",
1784
1783
  "accumulate",
1785
1784
  "additive",
@@ -1972,7 +1971,7 @@ const ho = M([
1972
1971
  "y2",
1973
1972
  "z",
1974
1973
  "zoomandpan"
1975
- ]), bo = M([
1974
+ ]), bo = _([
1976
1975
  "accent",
1977
1976
  "accentunder",
1978
1977
  "align",
@@ -2027,13 +2026,13 @@ const ho = 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
- ]), jn = D(/{{[\w\W]*|^[\w\W]*}}/g), Wn = D(/<%[\w\W]*|^[\w\W]*%>/g), $n = D(/\${[\w\W]*/g), Gn = D(/^data-[\-\w.\u00B7-\uFFFF]+$/), Kn = D(/^aria-[\-\w]+$/), yo = D(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), qn = D(/^(?:\w+script|data):/i), Yn = D(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Vn = D(/^html$/i), Xn = D(/^[a-z][.\w]*(-[.\w]+)+$/i), Eo = D(/<[/\w!]/g), vo = D(/<[/\w]/g), Qn = D(/<\/no(script|embed|frames)/i), Zn = D(/\/>/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 ho = M([
2046
2045
  documentType: 10,
2047
2046
  documentFragment: 11,
2048
2047
  notation: 12
2049
- }, Do = [
2048
+ }, Mo = [
2050
2049
  "style",
2051
2050
  "script",
2052
2051
  "xmp",
@@ -2055,14 +2054,14 @@ const ho = M([
2055
2054
  "noframes",
2056
2055
  "plaintext",
2057
2056
  "noscript"
2058
- ], Jn = M(E({}, Do)), ti = (function() {
2057
+ ], ei = _(v({}, Mo)), oi = (function() {
2059
2058
  const n = {};
2060
- return at(Do, (t) => {
2061
- n[t] = D(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
2062
- }), M(n);
2063
- })(), ei = 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
- }, oi = 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 ho = 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
- }, wo = function() {
2082
+ }, ko = function() {
2084
2083
  return {
2085
2084
  afterSanitizeAttributes: [],
2086
2085
  afterSanitizeElements: [],
@@ -2093,23 +2092,23 @@ const ho = M([
2093
2092
  uponSanitizeShadowNode: []
2094
2093
  };
2095
2094
  }, J = function(t, e, o, r) {
2096
- return N(t, e) && vt(t[e]) ? E(r.base ? U(r.base) : {}, t[e], r.transform) : o;
2095
+ return N(t, e) && vt(t[e]) ? v(r.base ? U(r.base) : {}, t[e], r.transform) : o;
2097
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 Io() {
2102
- let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ei();
2103
- const t = (u) => Io(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"), v = 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"), P = l && l.prototype ? W(l.prototype, "nodeType") : null, lt = l && l.prototype ? W(l.prototype, "nodeName") : null, Dt = l && l.prototype ? W(l.prototype, "ownerDocument") : null, wt = function(i) {
2112
- return P ? P(i) : i.nodeType;
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) {
2111
+ return D ? D(i) : i.nodeType;
2113
2112
  }, Qt = function(i) {
2114
2113
  return lt ? lt(i) : i.nodeName;
2115
2114
  };
@@ -2117,31 +2116,31 @@ function Io() {
2117
2116
  const u = e.createElement("template");
2118
2117
  u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
2119
2118
  }
2120
- let R, ot = "", Zt, _e = !1, kt = 0;
2121
- const Le = function() {
2122
- if (kt > 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.');
2119
+ let O, ot = "", Zt, Le = !1, wt = 0;
2120
+ const _e = function() {
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
- Le(), kt++;
2123
+ _e(), wt++;
2125
2124
  try {
2126
- return R.createHTML(i);
2125
+ return O.createHTML(i);
2127
2126
  } finally {
2128
- kt--;
2127
+ wt--;
2129
2128
  }
2130
- }, Ro = function(i) {
2131
- Le(), kt++;
2129
+ }, zo = function(i) {
2130
+ _e(), wt++;
2132
2131
  try {
2133
- return R.createScriptURL(i);
2132
+ return O.createScriptURL(i);
2134
2133
  } finally {
2135
- kt--;
2134
+ wt--;
2136
2135
  }
2137
- }, No = function() {
2138
- return _e || (Zt = oi(g, r), _e = !0), Zt;
2139
- }, It = e, Jt = It.implementation, Me = It.createNodeIterator, zo = It.createDocumentFragment, Bo = It.getElementsByTagName, Fo = o.importNode;
2140
- let C = wo();
2141
- t.isSupported = typeof Lo == "function" && typeof z == "function" && Jt && Jt.createHTMLDocument !== void 0;
2142
- const Ho = jn, Uo = Wn, jo = $n, Wo = Gn, $o = Kn, Go = qn, De = Yn, Ko = Xn;
2143
- let Ie = yo, x = null;
2144
- const te = E({}, [
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;
2143
+ const te = v({}, [
2145
2144
  ...ho,
2146
2145
  ...ge,
2147
2146
  ...be,
@@ -2149,13 +2148,13 @@ function Io() {
2149
2148
  ...mo
2150
2149
  ]);
2151
2150
  let A = null;
2152
- const ee = E({}, [
2151
+ const ee = v({}, [
2153
2152
  ...go,
2154
2153
  ...Ee,
2155
2154
  ...bo,
2156
2155
  ...Gt
2157
2156
  ]);
2158
- let K = Object.seal(Et(null, {
2157
+ let q = Object.seal(Et(null, {
2159
2158
  tagNameCheck: {
2160
2159
  writable: !0,
2161
2160
  configurable: !1,
@@ -2174,7 +2173,7 @@ function Io() {
2174
2173
  enumerable: !0,
2175
2174
  value: !1
2176
2175
  }
2177
- })), Tt = null, Pe = null;
2176
+ })), Tt = null, Me = null;
2178
2177
  const V = Object.seal(Et(null, {
2179
2178
  tagCheck: {
2180
2179
  writable: !0,
@@ -2189,10 +2188,10 @@ function Io() {
2189
2188
  value: null
2190
2189
  }
2191
2190
  }));
2192
- let Oe = !0, oe = !0, Re = !1, Ne = !0, X = !1, nt = !0, it = !1, ne = !1, Pt = null, Ot = null, ie = !1, dt = !1, Rt = !1, Nt = !1, ze = !0, Be = !1;
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;
2193
2192
  const Fe = "user-content-";
2194
2193
  let re = !0, ae = !1, ut = {}, pt = null;
2195
- const He = E({}, [
2194
+ const He = v({}, [
2196
2195
  "annotation-xml",
2197
2196
  "audio",
2198
2197
  "colgroup",
@@ -2221,7 +2220,7 @@ function Io() {
2221
2220
  "xmp"
2222
2221
  ]);
2223
2222
  let Ue = null;
2224
- const je = E({}, [
2223
+ const je = v({}, [
2225
2224
  "audio",
2226
2225
  "video",
2227
2226
  "img",
@@ -2230,7 +2229,7 @@ function Io() {
2230
2229
  "track"
2231
2230
  ]);
2232
2231
  let We = null;
2233
- const $e = E({}, [
2232
+ const $e = v({}, [
2234
2233
  "alt",
2235
2234
  "class",
2236
2235
  "for",
@@ -2245,23 +2244,23 @@ function Io() {
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 qo = E({}, [
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), Ge = 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 = E({}, Ge);
2262
- const Ke = M(["annotation-xml"]);
2263
- let de = E({}, Ke);
2264
- const Yo = E({}, [
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",
@@ -2269,270 +2268,270 @@ function Io() {
2269
2268
  "script"
2270
2269
  ]);
2271
2270
  let Ct = null;
2272
- const Vo = ["application/xhtml+xml", "text/html"], Xo = "text/html";
2273
- let _ = null, ht = null;
2274
- const Qo = e.createElement("form"), qe = function(i) {
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), Ct = Vo.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Xo : i.PARSER_MEDIA_TYPE, _ = Ct === "application/xhtml+xml" ? me : Mt, x = J(i, "ALLOWED_TAGS", te, { transform: _ }), A = J(i, "ALLOWED_ATTR", ee, { transform: _ }), le = J(i, "ALLOWED_NAMESPACES", qo, { transform: me }), We = J(i, "ADD_URI_SAFE_ATTR", $e, {
2280
- transform: _,
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,
2281
2280
  base: $e
2282
2281
  }), Ue = J(i, "ADD_DATA_URI_TAGS", je, {
2283
- transform: _,
2282
+ transform: S,
2284
2283
  base: je
2285
- }), pt = J(i, "FORBID_CONTENTS", He, { transform: _ }), Tt = J(i, "FORBID_TAGS", U({}), { transform: _ }), Pe = J(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, Oe = i.ALLOW_ARIA_ATTR !== !1, oe = i.ALLOW_DATA_ATTR !== !1, Re = 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, Rt = 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, Ie = Fn(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : yo, ft = typeof i.NAMESPACE == "string" ? i.NAMESPACE : q, ce = ve(i, "MATHML_TEXT_INTEGRATION_POINTS", () => E({}, Ge)), de = ve(i, "HTML_INTEGRATION_POINTS", () => E({}, Ke));
2286
- const s = ve(i, "CUSTOM_ELEMENT_HANDLING", () => Et(null));
2287
- if (K = Et(null), N(s, "tagNameCheck") && qe(s.tagNameCheck) && (K.tagNameCheck = s.tagNameCheck), N(s, "attributeNameCheck") && qe(s.attributeNameCheck) && (K.attributeNameCheck = s.attributeNameCheck), N(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (K.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), D(K), X && (oe = !1), Rt && (dt = !0), ut && (x = E({}, mo), A = Et(null), ut.html === !0 && (E(x, ho), E(A, go)), ut.svg === !0 && (E(x, ge), E(A, Ee), E(A, Gt)), ut.svgFilters === !0 && (E(x, be), E(A, Ee), E(A, Gt)), ut.mathMl === !0 && (E(x, ye), E(A, bo), E(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) && (x === te && (x = U(x)), E(x, 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)), E(A, i.ADD_ATTR, _))), N(i, "ADD_FORBID_CONTENTS") && vt(i.ADD_FORBID_CONTENTS) && (pt === He && (pt = U(pt)), E(pt, i.ADD_FORBID_CONTENTS, _)), re && (x["#text"] = !0), it && E(x, [
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
- ]), x.table && (E(x, ["tbody"]), delete Tt.tbody), i.TRUSTED_TYPES_POLICY) {
2290
+ ]), C.table && (v(C, ["tbody"]), delete Tt.tbody), i.TRUSTED_TYPES_POLICY) {
2292
2291
  if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2293
2292
  if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2294
- const d = R;
2295
- R = i.TRUSTED_TYPES_POLICY;
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 = No()), R && typeof ot == "string" && (ot = ct("")));
2302
- M && M(i), ht = i;
2303
- }, Ye = E({}, [
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
- ...Hn
2307
- ]), Ve = E({}, [...ye, ...Un]), Zo = function(i, s, d) {
2308
- return s.namespaceURI === q ? i === "svg" : s.namespaceURI === zt ? i === "svg" && (d === "annotation-xml" || ce[d]) : !!Ye[i];
2309
- }, Jo = function(i, s, d) {
2310
- return s.namespaceURI === q ? i === "math" : s.namespaceURI === Bt ? i === "math" && de[d] : !!Ve[i];
2311
- }, tn = function(i, s, d) {
2312
- return s.namespaceURI === Bt && !de[d] || s.namespaceURI === zt && !ce[d] ? !1 : !Ve[i] && (Yo[i] || !Ye[i]);
2313
- }, en = 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 ? Zo(d, s, f) : i.namespaceURI === zt ? Jo(d, s, f) : i.namespaceURI === q ? tn(d, s, f) : !!(Ct === "application/xhtml+xml" && le[i.namespaceURI]) : !1;
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;
2321
2320
  }, Q = function(i) {
2322
- At(t.removed, { element: i });
2321
+ xt(t.removed, { element: i });
2323
2322
  try {
2324
2323
  z(i).removeChild(i);
2325
- } catch (s) {
2326
- if (v(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");
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
- }, Xe = 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
- At(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
- v(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" && Xe(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
- At(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
- Q(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
- }, on = 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)] || Xe(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
- wt(d) === H.element && on(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
- }, Qe = function(i, s) {
2399
- return nt ? i === "patchsrc" ? !0 : i === "for" && s !== "label" && s !== "output" : !1;
2400
- }, nn = 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 = wt(d);
2405
- if (f === H.processingInstruction || f === H.comment && I(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
- v(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 = _(Qt(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") && Qe("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 = co(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
- Ct === "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, Ct);
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 = Jt.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 ? Bo.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 = Dt ? Dt(i) : i.ownerDocument;
2446
- return Me.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 = St(i, Ho, " "), i = St(i, Uo, " "), i = St(i, jo, " "), 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 = Dt ? Dt(i) : i.ownerDocument, f = Me.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 !== P(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
- if (!P || typeof i != "object" || i === null) return !1;
2463
+ if (!D || typeof i != "object" || i === null) return !1;
2465
2464
  try {
2466
- return P(i) === H.documentFragment;
2467
- } catch (s) {
2465
+ return D(i) === H.documentFragment;
2466
+ } catch (l) {
2468
2467
  return !1;
2469
2468
  }
2470
- }, xt = function(i) {
2471
- if (!P || typeof i != "object" || i === null) return !1;
2469
+ }, At = function(i) {
2470
+ if (!D || typeof i != "object" || i === null) return !1;
2472
2471
  try {
2473
- return typeof P(i) == "number";
2474
- } catch (s) {
2472
+ return typeof D(i) == "number";
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 rn = function(i, s) {
2484
- return !!(nt && i.hasChildNodes() && !xt(i.firstElementChild) && I(Eo, i.textContent) && I(Eo, i.innerHTML) || nt && i.namespaceURI === q && Jn[s] && (xt(i.firstElementChild) || typeof i.textContent == "string" && I(ti[s], i.textContent)) || i.nodeType === H.processingInstruction || nt && i.nodeType === H.comment && I(vo, i.data));
2485
- }, Wt = function(i, s) {
2486
- if (i instanceof RegExp) return I(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
- }, an = function(i, s, d) {
2493
- if (!Tt[s] && no(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
2503
  return Q(i), !0;
2505
- }, to = 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
- }, eo = function(i, s) {
2510
- if (Y(C.beforeSanitizeElements, i, null), gt(i, s)) return !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
2511
  return Q(i), !0;
2513
- const d = _(Qt(i));
2514
- if (x = to(C.uponSanitizeElement, x, te, Pt), Y(C.uponSanitizeElement, i, {
2512
+ const d = S(Qt(i));
2513
+ if (C = to(T.uponSanitizeElement, C, te, Mt), Y(T.uponSanitizeElement, i, {
2515
2514
  tagName: d,
2516
- allowedTags: x
2517
- }), gt(i, s)) return !0;
2518
- if (rn(i, d))
2515
+ allowedTags: C
2516
+ }), gt(i, l)) return !0;
2517
+ if (sn(i, d))
2519
2518
  return Q(i), !0;
2520
- if (Tt[d] || !(V.tagCheck instanceof Function && V.tagCheck(d)) && !x[d]) {
2521
- const f = an(i, d, s);
2522
- return f === !1 && (Y(C.afterSanitizeElements, i, null), gt(i, s)) ? !0 : f;
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 (wt(i) === H.element && !en(i) || (d === "noscript" || d === "noembed" || d === "noframes") && I(Qn, i.innerHTML))
2523
+ if (kt(i) === H.element && !nn(i) || (d === "noscript" || d === "noembed" || d === "noframes") && I(Jn, i.innerHTML))
2525
2524
  return Q(i), !0;
2526
2525
  if (X && i.nodeType === H.text) {
2527
- const f = Ut(i.textContent);
2528
- i.textContent !== f && (At(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(C.afterSanitizeElements, i, null), gt(i, s);
2531
- }, oo = function(i, s, d) {
2532
- if (Pe[s] || Qe(s, i) || ze && (s === "id" || s === "name") && (d in e || d in Qo)) return !1;
2533
- const f = A[s] || V.attributeCheck instanceof Function && V.attributeCheck(s, i);
2534
- return oe && I(Wo, s) || Oe && I($o, s) ? !0 : f ? We[s] || I(Ie, St(d, De, "")) || (s === "src" || s === "xlink:href" || s === "href") && i !== "script" && uo(d, "data:") === 0 && Ue[i] || Re && !I(Go, St(d, De, "")) ? !0 : !d : no(i) && Wt(K.tagNameCheck, i) && Wt(K.attributeNameCheck, s, i) || s === "is" && K.allowCustomizedBuiltInElements && Wt(K.tagNameCheck, d);
2535
- }, sn = E({}, [
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",
@@ -2542,123 +2541,123 @@ function Io() {
2542
2541
  "font-face-uri",
2543
2542
  "missing-glyph"
2544
2543
  ]), no = function(i) {
2545
- return !sn[Mt(i)] && I(Ko, i);
2546
- }, ln = function(i, s, d, f) {
2547
- if (R && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(i, s)) {
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 Ro(f);
2550
+ return zo(p);
2552
2551
  }
2553
- return f;
2554
- }, cn = 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) ? (Q(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
- }, io = function(i, s) {
2561
- if (Y(C.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 = to(C.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 : Pn(he), ro = !1;
2577
- if (f.attrName = bt, f.attrValue = O, f.keepAttr = !0, f.forceKeepAttr = void 0, Y(C.uponSanitizeAttribute, i, f), O = f.attrValue, Be && (bt === "id" || bt === "name") && uo(O, Fe) !== 0 && (rt(S, i, y), O = Fe + O, ro = !0), nt && I(/((--!?|])>)|<\/(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" && co(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 (!Ne && I(Zn, 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)), !oo(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 = ln(b, bt, j, O), O !== he && cn(i, S, j, O) && ro && lo(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(C.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(C.beforeSanitizeShadowDOM, i, null); s = d.nextNode(); )
2606
- if (Y(C.uponSanitizeShadowNode, s, null), eo(s, i), io(s, i), mt(s.content) && $t(s.content), wt(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(C.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 = wt(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 = Bn(u), typeof u != "string"))
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"))
2652
2651
  throw Z("dirty is not a string, aborting");
2653
2652
  if (!t.isSupported) return u;
2654
- ne ? (x = Pt, A = Ot) : ue(i), (C.uponSanitizeElement.length > 0 || C.uponSanitizeAttribute.length > 0) && (x = U(x)), C.uponSanitizeAttribute.length > 0 && (A = U(A)), t.removed = [];
2655
- const b = ae && typeof u != "string" && xt(u);
2656
- if (b) {
2657
- nn(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);
2658
2657
  const j = Qt(u);
2659
2658
  if (typeof j == "string") {
2660
- const F = _(j);
2661
- if (!x[F] || Tt[F])
2659
+ const F = S(j);
2660
+ if (!C[F] || Tt[F])
2662
2661
  throw Ft(u), Z("root node is forbidden and cannot be sanitized in-place");
2663
2662
  }
2664
2663
  if (jt(u))
@@ -2668,24 +2667,24 @@ function Io() {
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 && Q(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
- eo(f, y), io(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));
@@ -2693,41 +2692,41 @@ function Io() {
2693
2692
  return X && pe(u), u;
2694
2693
  }
2695
2694
  if (dt) {
2696
- if (X && pe(s), Rt)
2697
- for (h = zo.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
2698
- else h = s;
2699
- return (A.shadowroot || A.shadowrootmode) && (h = Fo.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 && x["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && I(Vn, 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, Pt = x, Ot = A;
2705
+ ue(u), ne = !0, Mt = C, Rt = A;
2707
2706
  }, t.clearConfig = function() {
2708
- ht = null, ne = !1, Pt = null, Ot = null, R = Zt, 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 oo(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(C, u) && At(C[u], i);
2713
+ typeof i == "function" && N(T, u) && xt(T[u], i);
2715
2714
  }, t.removeHook = function(u, i) {
2716
- if (N(C, u)) {
2715
+ if (N(T, u)) {
2717
2716
  if (i !== void 0) {
2718
- const s = Dn(C[u], i);
2719
- return s === -1 ? void 0 : In(C[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 lo(C[u]);
2720
+ return lo(T[u]);
2722
2721
  }
2723
2722
  }, t.removeHooks = function(u) {
2724
- N(C, u) && (C[u] = []);
2723
+ N(T, u) && (T[u] = []);
2725
2724
  }, t.removeAllHooks = function() {
2726
- C = wo();
2725
+ T = ko();
2727
2726
  }, t;
2728
2727
  }
2729
- var Kt = Io();
2730
- const ni = [
2728
+ var qt = Ro();
2729
+ const ri = [
2731
2730
  "p",
2732
2731
  "br",
2733
2732
  "strong",
@@ -2776,7 +2775,7 @@ const ni = [
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
- ], ii = {
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 ni = [
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
- }, ri = "data-editora-embed";
2797
- function ai(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 ai(n) {
2803
2802
  return !1;
2804
2803
  }
2805
2804
  }
2806
- function Po(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 : ni, 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 : ii, 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 v = w;
2825
- k.allowedTags.iframe = g || ((T = v.getAttribute) == null ? void 0 : T.call(v, ri)) === "true" && ai(v.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 si(n, t, e, o) {
2835
- return Po(n, t, o, !1);
2833
+ function ci(n, t, e, o) {
2834
+ return Oo(n, t, o, !1);
2836
2835
  }
2837
- function li(n, t, e) {
2838
- return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? n : si(n, t);
2836
+ function di(n, t, e) {
2837
+ return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? n : ci(n, t);
2839
2838
  }
2840
- function ko(n, t, e, o) {
2841
- return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? n : Po(n, t, o, !0);
2839
+ function wo(n, t, e, o) {
2840
+ return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? n : Oo(n, t, o, !0);
2842
2841
  }
2843
- const ci = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", di = /resize-handle|data-rte-media-pending|rte-media/;
2844
- function Oo(n) {
2845
- if (!n || !di.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(ci).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) => {
@@ -2860,7 +2859,7 @@ function Oo(n) {
2860
2859
  }), t.innerHTML;
2861
2860
  }
2862
2861
  function yt(n) {
2863
- return n ? Oo(n.innerHTML) : "";
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 = {
@@ -3123,58 +3122,228 @@ Xt.EDITOR_DEFAULTS = {
3123
3122
  "security-sanitize-on-paste",
3124
3123
  "security-sanitize-on-input"
3125
3124
  ]);
3126
- let Ae = Xt;
3125
+ let xe = Xt;
3127
3126
  const To = /* @__PURE__ */ new Set();
3128
- function ui(n, t) {
3127
+ function fi(n, t) {
3129
3128
  To.has(n) || (To.add(n), console.warn(
3130
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.`
3131
3130
  ));
3132
3131
  }
3133
- const pi = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor.editora-disabled{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
3134
- let qt;
3135
- const fi = "__editoraCommandEditorRoot", hi = "__editoraLastCommandButton", Co = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", xo = ".rte-content, .editora-content", mi = "Rich text editor", gi = /* @__PURE__ */ new Set(["collaboration"]), we = "data-editora-disabled-by-host", Se = /* @__PURE__ */ new Set();
3136
- let tt = null, Ao = !1, ke = null, Te = null;
3137
- function So(n) {
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) {
3138
3307
  if (!(n instanceof HTMLElement)) return !1;
3139
3308
  const t = n;
3140
3309
  return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
3141
3310
  }
3142
- function bi(n) {
3311
+ function Ti(n) {
3143
3312
  return n ? n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement : null;
3144
3313
  }
3145
- function Lt(n) {
3314
+ function _t(n) {
3146
3315
  if (!n) return null;
3147
- if (So(n))
3316
+ if (Lo(n))
3148
3317
  return n;
3149
- const t = n.matches(Co) ? n : n.closest(Co);
3150
- return !t || !So(t) ? null : t;
3318
+ const t = n.matches(Ao) ? n : n.closest(Ao);
3319
+ return !t || !Lo(t) ? null : t;
3151
3320
  }
3152
- function yi() {
3321
+ function Ci() {
3153
3322
  var r;
3154
3323
  if (typeof window == "undefined") return null;
3155
- const n = window[fi];
3324
+ const n = window[Ei];
3156
3325
  if (n instanceof HTMLElement) {
3157
- const a = Lt(n);
3326
+ const a = _t(n);
3158
3327
  if (a) return a;
3159
- const l = n.matches(xo) ? n : n.querySelector(xo);
3160
- if (l) {
3161
- const c = Lt(l);
3328
+ const s = n.matches(xo) ? n : n.querySelector(xo);
3329
+ if (s) {
3330
+ const c = _t(s);
3162
3331
  if (c) return c;
3163
3332
  }
3164
3333
  }
3165
- const t = window[hi];
3334
+ const t = window[vi];
3166
3335
  if (t instanceof HTMLElement) {
3167
- const a = Lt(t);
3336
+ const a = _t(t);
3168
3337
  if (a) return a;
3169
3338
  }
3170
3339
  const e = document.activeElement;
3171
3340
  if (e) {
3172
- const a = Lt(e);
3341
+ const a = _t(e);
3173
3342
  if (a) return a;
3174
3343
  }
3175
3344
  const o = (r = window.getSelection) == null ? void 0 : r.call(window);
3176
3345
  if (o && o.rangeCount > 0) {
3177
- const a = Lt(bi(o.getRangeAt(0).startContainer));
3346
+ const a = _t(Ti(o.getRangeAt(0).startContainer));
3178
3347
  if (a) return a;
3179
3348
  }
3180
3349
  if (tt && tt.isConnected)
@@ -3183,34 +3352,34 @@ function yi() {
3183
3352
  if (a.isConnected) return a;
3184
3353
  return null;
3185
3354
  }
3186
- function Ei() {
3187
- if (typeof window == "undefined" || Ao) return;
3188
- ke = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, Te = 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;
3189
3358
  const n = (t, ...e) => {
3190
- const o = yi();
3191
- return o ? o.execCommand(t, ...e) : ke ? ke(t, ...e) : Te ? Te(t, ...e) : !1;
3359
+ const o = Ci();
3360
+ return o ? o.execCommand(t, ...e) : we ? we(t, ...e) : Te ? Te(t, ...e) : !1;
3192
3361
  };
3193
- window.executeEditorCommand = n, window.execEditorCommand = n, Ao = !0;
3362
+ window.executeEditorCommand = n, window.execEditorCommand = n, So = !0;
3194
3363
  }
3195
- function vi() {
3364
+ function xi() {
3196
3365
  const n = "editora-webcomponent-styles";
3197
3366
  if (!document.getElementById(n)) {
3198
3367
  const t = document.createElement("style");
3199
- t.id = n, t.textContent = pi, document.head.appendChild(t);
3368
+ t.id = n, t.textContent = yi, document.head.appendChild(t);
3200
3369
  }
3201
3370
  }
3202
- function wi() {
3203
- if (!qt) {
3371
+ function Si() {
3372
+ if (!Kt) {
3204
3373
  const n = $.__globalPluginLoader;
3205
- n ? qt = n : qt = new _o();
3374
+ n ? Kt = n : Kt = new _o();
3206
3375
  }
3207
- return qt;
3376
+ return Kt;
3208
3377
  }
3209
- const ki = typeof HTMLElement == "undefined" ? class {
3378
+ const Li = typeof HTMLElement == "undefined" ? class {
3210
3379
  } : HTMLElement;
3211
- class $ extends ki {
3380
+ class $ extends Li {
3212
3381
  constructor() {
3213
- if (super(), this.pluginLoader = wi(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new kn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.pluginInstances = /* @__PURE__ */ new Map(), this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, this.hasConnected = !1, this.reinitializeQueued = !1, this.lastReportedContent = null, vi(), !this.hasAttribute("data-initial-content")) {
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")) {
3214
3383
  const t = this.innerHTML.trim();
3215
3384
  t && this.setAttribute("data-initial-content", t);
3216
3385
  }
@@ -3328,26 +3497,26 @@ class $ extends ki {
3328
3497
  var a;
3329
3498
  if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
3330
3499
  const t = ++this.buildGeneration;
3331
- this.setAttribute("data-editora-editor", "true"), Se.add(this), tt || (tt = this), Ei(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.classList.toggle("editora-disabled", this.isEditorDisabled()), this.applyThemeClass(this.config.theme), this.isMenubarRequested() && ui("menubar", "<editora-editor> does not render a menu bar."), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
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");
3332
3501
  const e = await this.loadPlugins();
3333
3502
  if (t !== this.buildGeneration || !this.isConnected) return;
3334
- if (this.loadedPlugins = e, e.forEach((l) => {
3335
- if (l.init && typeof l.init == "function")
3503
+ if (this.loadedPlugins = e, e.forEach((s) => {
3504
+ if (s.init && typeof s.init == "function")
3336
3505
  try {
3337
- l.init({ editorElement: this });
3506
+ s.init({ editorElement: this });
3338
3507
  } catch (c) {
3339
- console.error(`[RichTextEditor] Error initializing plugin ${l.name}:`, c);
3508
+ console.error(`[RichTextEditor] Error initializing plugin ${s.name}:`, c);
3340
3509
  }
3341
3510
  }), !this.hasAttribute("data-initial-content") && !this.contentElement) {
3342
- const l = this.innerHTML.trim();
3343
- l && this.setAttribute("data-initial-content", l);
3511
+ const s = this.innerHTML.trim();
3512
+ s && this.setAttribute("data-initial-content", s);
3344
3513
  }
3345
3514
  const o = this.preservedContent;
3346
3515
  this.preservedContent = null;
3347
3516
  const r = this.sanitizeLoadedContent(
3348
3517
  (a = o != null ? o : this.restoreAutosavedContent()) != null ? a : this.getAttribute("data-initial-content") || ""
3349
3518
  );
3350
- this.engine = new fn({
3519
+ this.engine = new mn({
3351
3520
  content: r,
3352
3521
  plugins: e,
3353
3522
  readonly: !!this.config.readonly || this.isEditorDisabled()
@@ -3366,41 +3535,76 @@ class $ extends ki {
3366
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() : "";
3367
3536
  }
3368
3537
  /**
3369
- * 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.
3370
3544
  */
3371
3545
  async loadPlugins() {
3372
3546
  this.pluginLoader || await this.waitForPluginLoader();
3373
- 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;
3374
- if (e) {
3375
- if (typeof this.config.plugins == "string") {
3376
- const a = this.config.plugins.split(/\s+/).filter(Boolean);
3377
- r && !a.includes("a11yChecker") && a.push("a11yChecker");
3378
- for (const l of a) {
3379
- const c = await this.loadPlugin(l, this.getPluginLoadConfig(l));
3380
- c && t.push(c);
3381
- }
3382
- } else if (Array.isArray(this.config.plugins)) {
3383
- for (const a of this.config.plugins)
3384
- if (typeof a == "string") {
3385
- const l = await this.loadPlugin(a, this.getPluginLoadConfig(a));
3386
- l && t.push(l);
3387
- } else
3388
- t.push(a);
3389
- if (r && !t.some((a) => (a == null ? void 0 : a.name) === "a11yChecker")) {
3390
- const a = await this.loadPlugin("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
3391
- a && t.push(a);
3392
- }
3393
- }
3394
- } else {
3395
- const a = this.pluginLoader.getRegisteredPluginNames();
3396
- for (const l of a) {
3397
- const c = this.getPluginLoadConfig(l);
3398
- if (gi.has(l) && !c) continue;
3399
- const p = await this.loadPlugin(l, c);
3400
- 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);
3401
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);
3402
3565
  }
3403
- 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));
3404
3608
  }
3405
3609
  /**
3406
3610
  * This editor's instance of a registered plugin: created on first use, then reused (with the
@@ -3498,7 +3702,7 @@ class $ extends ki {
3498
3702
  this.config.readonly || this.isEditorDisabled() ? "true" : "false"
3499
3703
  );
3500
3704
  const o = (e = this.getAttribute("aria-label")) == null ? void 0 : e.trim(), r = typeof this.config.placeholder == "string" ? this.config.placeholder.trim() : "";
3501
- this.contentElement.setAttribute("aria-label", o || r || mi);
3705
+ this.contentElement.setAttribute("aria-label", o || r || ki);
3502
3706
  } else
3503
3707
  this.contentElement.removeAttribute("role"), this.contentElement.removeAttribute("aria-multiline"), this.contentElement.removeAttribute("aria-disabled"), this.contentElement.removeAttribute("aria-label");
3504
3708
  this.contentElement.tabIndex = t.keyboardNavigation && !this.isEditorDisabled() ? 0 : -1;
@@ -3537,12 +3741,12 @@ class $ extends ki {
3537
3741
  editorElement: this,
3538
3742
  contentElement: this.contentElement,
3539
3743
  toolbarElement: this.toolbarElement
3540
- }, r = this.loadedPlugins.find((l) => l.commands && l.commands[t]);
3744
+ }, r = this.loadedPlugins.find((s) => s.commands && s.commands[t]);
3541
3745
  if (r && r.commands) {
3542
- const l = r.commands[t];
3543
- if (typeof l == "function")
3746
+ const s = r.commands[t];
3747
+ if (typeof s == "function")
3544
3748
  try {
3545
- return t === "toggleFullscreen" ? l(this, o) : l(...e, o), !0;
3749
+ return t === "toggleFullscreen" ? s(this, o) : s(...e, o), !0;
3546
3750
  } catch (c) {
3547
3751
  return console.error(`[RichTextEditor] Error executing native command ${t}:`, c), !1;
3548
3752
  }
@@ -3579,9 +3783,9 @@ class $ extends ki {
3579
3783
  ...o[t] || []
3580
3784
  ];
3581
3785
  for (const a of r) {
3582
- const l = this.config[a];
3583
- if (l && typeof l == "object" && !Array.isArray(l))
3584
- return l;
3786
+ const s = this.config[a];
3787
+ if (s && typeof s == "object" && !Array.isArray(s))
3788
+ return s;
3585
3789
  }
3586
3790
  }
3587
3791
  getContentSanitizeConfig() {
@@ -3598,7 +3802,7 @@ class $ extends ki {
3598
3802
  * editable DOM: sanitizing only after the first edit leaves the page exposed until then.
3599
3803
  */
3600
3804
  sanitizeLoadedContent(t) {
3601
- return ko(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3805
+ return wo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3602
3806
  }
3603
3807
  getAutosaveConfig() {
3604
3808
  var e, o;
@@ -3689,7 +3893,7 @@ class $ extends ki {
3689
3893
  */
3690
3894
  createUI(t, e) {
3691
3895
  const o = this.querySelector('[slot="toolbar"]'), r = this.querySelector('[slot="statusbar"]');
3692
- this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new hn(
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(
3693
3897
  {
3694
3898
  items: this.resolveToolbarItems(),
3695
3899
  sticky: this.isToolbarStickyEnabled(),
@@ -3698,18 +3902,18 @@ class $ extends ki {
3698
3902
  t,
3699
3903
  this.pluginLoader
3700
3904
  // Pass plugin loader to get all registered plugins
3701
- ), this.toolbar.setCommandHandler((a, l) => {
3905
+ ), this.toolbar.setCommandHandler((a, s) => {
3702
3906
  var c;
3703
3907
  if (this.isEditorDisabled()) return !1;
3704
3908
  if (this.contentElement) {
3705
3909
  this.contentElement.focus();
3706
- const p = window.getSelection();
3707
- if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.anchorNode)) {
3708
- const m = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
3709
- 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);
3710
3914
  }
3711
3915
  }
3712
- return this.executeCommand(a, l);
3916
+ return this.executeCommand(a, s);
3713
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);
3714
3918
  try {
3715
3919
  document.execCommand("defaultParagraphSeparator", !1, "p");
@@ -3720,14 +3924,14 @@ class $ extends ki {
3720
3924
  const a = document.createElement("div");
3721
3925
  a.innerHTML = e.trim(), !Array.from(a.childNodes).some((c) => {
3722
3926
  if (c.nodeType === Node.ELEMENT_NODE) {
3723
- const p = c.tagName;
3724
- 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);
3725
3929
  }
3726
3930
  return !1;
3727
3931
  }) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
3728
3932
  } else
3729
3933
  this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
3730
- this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new mn({ 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 gn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.setToolbarControlsDisabled(this.isEditorDisabled()), this.lastReportedContent = yt(this.contentElement), this.config.autofocus && !this.isEditorDisabled() && 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(() => {
3731
3935
  var a;
3732
3936
  return (a = this.contentElement) == null ? void 0 : a.focus();
3733
3937
  }, 0);
@@ -3776,7 +3980,7 @@ class $ extends ki {
3776
3980
  this.toolbarElement.querySelectorAll(
3777
3981
  "button, input, select, textarea"
3778
3982
  ).forEach((o) => {
3779
- t ? o.disabled || (o.disabled = !0, o.setAttribute(we, "")) : o.hasAttribute(we) && (o.disabled = !1, o.removeAttribute(we));
3983
+ t ? o.disabled || (o.disabled = !0, o.setAttribute(ke, "")) : o.hasAttribute(ke) && (o.disabled = !1, o.removeAttribute(ke));
3780
3984
  });
3781
3985
  }
3782
3986
  /**
@@ -3797,48 +4001,48 @@ class $ extends ki {
3797
4001
  var k;
3798
4002
  if (!this.contentElement) return;
3799
4003
  let r = this.contentElement.innerHTML;
3800
- 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;
3801
- if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
3802
- const v = ko(r, c, p, a);
3803
- if (v !== r) {
3804
- const T = window.getSelection(), et = T && T.rangeCount > 0 ? T.getRangeAt(0) : null;
3805
- if (this.contentElement.innerHTML = v, 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)
3806
4010
  try {
3807
- T.removeAllRanges(), T.addRange(et);
4011
+ R.removeAllRanges(), R.addRange(et);
3808
4012
  } catch (G) {
3809
4013
  }
3810
- r = v;
4014
+ r = w;
3811
4015
  }
3812
4016
  }
3813
4017
  this.recordInputHistory(r), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
3814
- const w = () => {
3815
- this.emitContentChange(Oo(r));
4018
+ const b = () => {
4019
+ this.emitContentChange(No(r));
3816
4020
  };
3817
- 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();
3818
4022
  }), this.contentElement.addEventListener("contextmenu", (o) => {
3819
4023
  const r = this.config.contextMenu;
3820
4024
  (r === !1 || typeof r == "object" && r !== null && r.enabled === !1) && o.preventDefault();
3821
4025
  }), this.contentElement.addEventListener("paste", (o) => {
3822
- var g, w;
4026
+ var g, b;
3823
4027
  if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
3824
4028
  return;
3825
4029
  o.preventDefault();
3826
4030
  const r = this.config.paste || {};
3827
4031
  let a = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
3828
- 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);
3829
- if ((r.clean || !r.keepFormatting) && l) {
3830
- 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);
3831
4035
  return;
3832
4036
  }
3833
- if (r.convertWord === !1 && m && l) {
3834
- document.execCommand("insertText", !1, l);
4037
+ if (r.convertWord === !1 && h && s) {
4038
+ document.execCommand("insertText", !1, s);
3835
4039
  return;
3836
4040
  }
3837
4041
  if (a) {
3838
- p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (a = li(a, c, p)), this.insertHTMLAtSelection(a);
4042
+ f.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (a = di(a, c, f)), this.insertHTMLAtSelection(a);
3839
4043
  return;
3840
4044
  }
3841
- l && document.execCommand("insertText", !1, l);
4045
+ s && document.execCommand("insertText", !1, s);
3842
4046
  }), this.contentElement.addEventListener("focus", () => {
3843
4047
  tt = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
3844
4048
  }), this.contentElement.addEventListener("blur", () => {
@@ -3848,8 +4052,8 @@ class $ extends ki {
3848
4052
  }
3849
4053
  this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
3850
4054
  }), this.contentElement.addEventListener("keydown", (o) => {
3851
- !this.getAccessibilityConfig().keyboardNavigation || this.isEditorDisabled() || t.handleKeyDown(o, (a, l) => {
3852
- this.executeCommand(a, l);
4055
+ !this.getAccessibilityConfig().keyboardNavigation || this.isEditorDisabled() || t.handleKeyDown(o, (a, s) => {
4056
+ this.executeCommand(a, s);
3853
4057
  });
3854
4058
  });
3855
4059
  const e = () => {
@@ -3913,12 +4117,12 @@ class $ extends ki {
3913
4117
  this.floatingToolbar.hide();
3914
4118
  return;
3915
4119
  }
3916
- const l = this.getSelectionAnchorRect(a, r);
3917
- if (!l) {
4120
+ const s = this.getSelectionAnchorRect(a, r);
4121
+ if (!s) {
3918
4122
  this.floatingToolbar.hide();
3919
4123
  return;
3920
4124
  }
3921
- this.floatingToolbar.show(l.left, l.top - 40);
4125
+ this.floatingToolbar.show(s.left, s.top - 40);
3922
4126
  }
3923
4127
  /**
3924
4128
  * Update status bar with selection and cursor information
@@ -3931,15 +4135,15 @@ class $ extends ki {
3931
4135
  const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
3932
4136
  if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
3933
4137
  return;
3934
- const o = this.contentElement.textContent || "", { words: r, chars: a } = vn(o), l = En(this.contentElement);
3935
- let c, p;
3936
- const m = this.getSelectionRangeInEditor();
3937
- m && (c = bn(this.contentElement, m), m.collapsed || (p = wn(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({
3938
4142
  wordCount: r,
3939
4143
  charCount: a,
3940
- lineCount: l,
4144
+ lineCount: s,
3941
4145
  cursorPosition: c,
3942
- selectionInfo: p
4146
+ selectionInfo: f
3943
4147
  });
3944
4148
  }
3945
4149
  /**
@@ -4034,7 +4238,7 @@ class $ extends ki {
4034
4238
  const o = this.attributes[e];
4035
4239
  t[o.name] = o.value;
4036
4240
  }
4037
- return Ae.resolve({
4241
+ return xe.resolve({
4038
4242
  jsConfig: this.jsConfig,
4039
4243
  attributes: t
4040
4244
  });
@@ -4093,10 +4297,7 @@ class $ extends ki {
4093
4297
  (t = this.contentElement) == null || t.blur();
4094
4298
  }
4095
4299
  }
4096
- const Vt = new _o();
4097
- $.__globalPluginLoader = Vt;
4098
- const Ti = {
4099
- // Core editing plugins (always loaded)
4300
+ const _i = {
4100
4301
  bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((n) => n.BoldPlugin()),
4101
4302
  italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((n) => n.ItalicPlugin()),
4102
4303
  underline: () => import("./UnderlinePlugin.native-DZzg23rv.mjs").then((n) => n.UnderlinePlugin()),
@@ -4121,7 +4322,6 @@ const Ti = {
4121
4322
  lineHeight: () => import("./LineHeightPlugin.native-CM7iXdQj.mjs").then((n) => n.LineHeightPlugin()),
4122
4323
  capitalization: () => import("./CapitalizationPlugin.native-Mh-kUy-x.mjs").then((n) => n.CapitalizationPlugin()),
4123
4324
  history: () => import("./HistoryPlugin.native-C8GyxsgC.mjs").then((n) => n.HistoryPlugin()),
4124
- // Advanced plugins (lazy loaded)
4125
4325
  link: () => import("./LinkPlugin.native-Dt_p6Ukb.mjs").then((n) => n.LinkPlugin()),
4126
4326
  table: () => import("./TablePlugin.native-1TvjRqv1.mjs").then((n) => n.TablePlugin()),
4127
4327
  trackChanges: () => import("./TrackChangesPlugin.native-Bghu2q4a.mjs").then((n) => n.TrackChangesPlugin()),
@@ -4179,35 +4379,36 @@ const Ti = {
4179
4379
  fullscreen: () => import("./FullscreenPlugin.native-ChXyxeNw.mjs").then((n) => n.FullscreenPlugin()),
4180
4380
  template: () => import("./TemplatePlugin.native-OD8Wc1R7.mjs").then((n) => n.TemplatePlugin()),
4181
4381
  footnote: () => import("./FootnotePlugin.native-D730OGRm.mjs").then((n) => n.FootnotePlugin())
4182
- };
4183
- async function Ci() {
4184
- return Object.entries(Ti).forEach(([n, t]) => {
4382
+ }, Vt = new _o();
4383
+ $.__globalPluginLoader = Vt;
4384
+ async function Pi() {
4385
+ return Object.entries(_i).forEach(([n, t]) => {
4185
4386
  Vt.register(n, t);
4186
4387
  }), Vt;
4187
4388
  }
4188
- typeof window != "undefined" && Ci().then((n) => {
4389
+ typeof window != "undefined" && Pi().then((n) => {
4189
4390
  $.__globalPluginLoader = n, customElements.get("editora-editor") || customElements.define("editora-editor", $);
4190
4391
  const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
4191
4392
  t.forEach((a) => {
4192
- const l = a.innerHTML.trim();
4193
- 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);
4194
4395
  });
4195
4396
  const o = document.querySelectorAll("editora-editor");
4196
4397
  Array.from(o).filter((a) => !a.hasAttribute("data-initial-content")).forEach((a) => {
4197
- const l = Array.from(o).indexOf(a);
4198
- 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]);
4199
4400
  }), window.Editora = {
4200
4401
  version: "1.0.0",
4201
4402
  plugins: Vt.getRegisteredPluginNames(),
4202
4403
  WebComponent: $,
4203
- init: async (a, l) => {
4404
+ init: async (a, s) => {
4204
4405
  const c = document.querySelector(a);
4205
- return c instanceof $ ? (l && await c.setConfig(l), c.getAPI()) : null;
4406
+ return c instanceof $ ? (s && await c.setConfig(s), c.getAPI()) : null;
4206
4407
  }
4207
4408
  };
4208
4409
  });
4209
4410
  export {
4210
4411
  $ as RichTextEditorElement,
4211
- Ci as initWebComponent
4412
+ Pi as initWebComponent
4212
4413
  };
4213
4414
  //# sourceMappingURL=webcomponent.js.map