@editora/core 1.0.22 → 1.0.24
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.
- package/README.md +247 -243
- package/dist/{A11yCheckerPlugin.native-qW_njhLY.mjs → A11yCheckerPlugin.native-BBCsR5Ur.mjs} +7 -5
- package/dist/{AnchorPlugin.native-Drmxhy98.mjs → AnchorPlugin.native-Dk9R26cF.mjs} +20 -19
- package/dist/{ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs → ApprovalWorkflowPlugin.native-AeJsehXM.mjs} +56 -55
- package/dist/{BackgroundColorPlugin.native-H3XyYD7_.mjs → BackgroundColorPlugin.native-DCAd94kp.mjs} +103 -98
- package/dist/{BlocksLibraryPlugin.native-CownM6Rk.mjs → BlocksLibraryPlugin.native-D9OPcnQV.mjs} +42 -43
- package/dist/{CitationsPlugin.native-C_7wWQ-k.mjs → CitationsPlugin.native-BFChgCSV.mjs} +51 -51
- package/dist/{CodePlugin.native-CAHk9ecG.mjs → CodePlugin.native-BRBEIqY7.mjs} +167 -113
- package/dist/{CodePlugin.native-DZgIez08.mjs → CodePlugin.native-CPfKDrkr.mjs} +1383 -1094
- package/dist/{CodeSamplePlugin.native-svbAFWh_.mjs → CodeSamplePlugin.native-Bai8bgl3.mjs} +5 -5
- package/dist/{CommentsPlugin.native-DncTHiEe.mjs → CommentsPlugin.native-DHCDUm9f.mjs} +161 -141
- package/dist/{ConditionalContentPlugin.native-Bf7XgRSW.mjs → ConditionalContentPlugin.native-B3R6xcqn.mjs} +3 -3
- package/dist/{ContentRulesPlugin.native-vPx5nC73.mjs → ContentRulesPlugin.native-BISqhQKJ.mjs} +52 -52
- package/dist/{DataBindingPlugin.native-B7lpI_0c.mjs → DataBindingPlugin.native-DbaDeXNp.mjs} +37 -37
- package/dist/{DocumentManagerPlugin.native-B8K-Oqom.mjs → DocumentManagerPlugin.native-tZqIa9o5.mjs} +21 -20
- package/dist/{EmbedIframePlugin.native-BfZ_HGlV.mjs → EmbedIframePlugin.native-qHMf1Jtg.mjs} +7 -7
- package/dist/{EmojisPlugin.native-D92aaOKi.mjs → EmojisPlugin.native-B64efKg5.mjs} +4 -4
- package/dist/{FormatPainterPlugin.native-BhjzsiVq.mjs → FormatPainterPlugin.native-CAc1N6xU.mjs} +183 -161
- package/dist/{HeadingPlugin.native-DZdvubrQ.mjs → HeadingPlugin.native-C3YiGERx.mjs} +85 -72
- package/dist/HistoryPlugin.native-C8GyxsgC.mjs +330 -0
- package/dist/{LinkPlugin.native-BsQXYsK6.mjs → LinkPlugin.native-Dt_p6Ukb.mjs} +4 -4
- package/dist/ListPlugin.native-UYaoRiub.mjs +239 -0
- package/dist/{MathPlugin.native-Byo3WL0f.mjs → MathPlugin.native-Cq9WQ7cq.mjs} +148 -130
- package/dist/MediaManagerPlugin.native-BjrEarV6.mjs +1161 -0
- package/dist/{MediaManagerPlugin.native-BT1NZIJS.mjs → MediaManagerPlugin.native-CRi24Mrb.mjs} +340 -281
- package/dist/{MentionPlugin.native-S_lwGZQO.mjs → MentionPlugin.native-Zb1dwdxU.mjs} +304 -300
- package/dist/{MergeTagPlugin.native-7-6F3S1Y.mjs → MergeTagPlugin.native-BXkVPvCo.mjs} +6 -4
- package/dist/{PIIRedactionPlugin.native-g7j4jOmm.mjs → PIIRedactionPlugin.native-Cm0bpzQb.mjs} +2 -2
- package/dist/{PreviewPlugin.native-Dv5OsffK.mjs → PreviewPlugin.native-CrfiwP2J.mjs} +2 -2
- package/dist/{SlashCommandsPlugin.native-BDIIwGNs.mjs → SlashCommandsPlugin.native-BzGTRmMB.mjs} +264 -240
- package/dist/{SmartPastePlugin.native-BATLCds5.mjs → SmartPastePlugin.native-DnOJhDsf.mjs} +2 -2
- package/dist/{SpecialCharactersPlugin.native-CdZoc1GB.mjs → SpecialCharactersPlugin.native-B0XaCfjZ.mjs} +4 -4
- package/dist/{SpellCheckPlugin.native-BGm2qPfn.mjs → SpellCheckPlugin.native-BE7os1Xj.mjs} +302 -265
- package/dist/{TablePlugin.native-C1YZ372P.mjs → TablePlugin.native-CWxEFpV8.mjs} +159 -136
- package/dist/{TemplatePlugin.native-Dwk8TgxI.mjs → TemplatePlugin.native-OD8Wc1R7.mjs} +6 -4
- package/dist/{TextColorPlugin.native-KMZ2uzlq.mjs → TextColorPlugin.native-C2IjioNM.mjs} +75 -71
- package/dist/{TranslationWorkflowPlugin.native-CZtG--06.mjs → TranslationWorkflowPlugin.native-BGXVJD9f.mjs} +101 -98
- package/dist/{VersionDiffPlugin.native-Ca1fMWUJ.mjs → VersionDiffPlugin.native-DJZIzFSK.mjs} +11 -11
- package/dist/anchoredPopover-QN4jNbW1.mjs +134 -0
- package/dist/confirmDialog-BP8hZPpX.mjs +112 -0
- package/dist/dialogHelpers-Dzn8DHoF.mjs +194 -0
- package/dist/{documentManager-BWK_-KJp.mjs → documentManager-8gnG-uG_.mjs} +1728 -1715
- package/dist/editora.min.js +21 -21
- package/dist/editora.umd.js +10 -10
- package/dist/{index-C1sO7DAC.js → index--wO0CZVN.js} +6 -6
- package/dist/{index-DGMYWPLx.mjs → index-BICrB5kg.mjs} +397 -326
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/katex-DLIObQUm.mjs +11683 -0
- package/dist/katex.min--Ws3c9be.mjs +6 -0
- package/dist/notify-DCQGpmq-.mjs +60 -0
- package/dist/plugin-loader.js +54 -54
- package/dist/webcomponent-core.js +305 -234
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +153 -80
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +631 -560
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1677 -1328
- package/package.json +1 -1
- package/dist/HistoryPlugin.native-DPvhks6h.mjs +0 -246
- package/dist/ListPlugin.native-Bt0LANbO.mjs +0 -139
- package/dist/anchoredPopover-DJFD2oAP.mjs +0 -116
- package/dist/dialogHelpers-DBf7WqYH.mjs +0 -40
|
@@ -407,9 +407,9 @@ class pn {
|
|
|
407
407
|
};
|
|
408
408
|
return o.forEach((c) => {
|
|
409
409
|
const f = [];
|
|
410
|
-
c.split(/\s+/).filter(Boolean).forEach((
|
|
411
|
-
if (
|
|
412
|
-
const w = r.get("setDirectionLTR"),
|
|
410
|
+
c.split(/\s+/).filter(Boolean).forEach((g) => {
|
|
411
|
+
if (g === "direction") {
|
|
412
|
+
const w = r.get("setDirectionLTR"), v = r.get("setDirectionRTL");
|
|
413
413
|
w && f.push({
|
|
414
414
|
id: "directionLTR",
|
|
415
415
|
label: w.label,
|
|
@@ -417,18 +417,18 @@ class pn {
|
|
|
417
417
|
icon: w.icon,
|
|
418
418
|
type: w.type || "button",
|
|
419
419
|
options: w.options
|
|
420
|
-
}),
|
|
420
|
+
}), v && f.push({
|
|
421
421
|
id: "directionRTL",
|
|
422
|
-
label:
|
|
423
|
-
command:
|
|
424
|
-
icon:
|
|
425
|
-
type:
|
|
426
|
-
options:
|
|
422
|
+
label: v.label,
|
|
423
|
+
command: v.command,
|
|
424
|
+
icon: v.icon,
|
|
425
|
+
type: v.type || "button",
|
|
426
|
+
options: v.options
|
|
427
427
|
});
|
|
428
428
|
return;
|
|
429
429
|
}
|
|
430
|
-
if (
|
|
431
|
-
const w = r.get("addComment"),
|
|
430
|
+
if (g === "comments") {
|
|
431
|
+
const w = r.get("addComment"), v = r.get("toggleComments");
|
|
432
432
|
w && f.push({
|
|
433
433
|
id: "addComment",
|
|
434
434
|
label: w.label,
|
|
@@ -436,26 +436,26 @@ class pn {
|
|
|
436
436
|
icon: w.icon,
|
|
437
437
|
type: w.type || "button",
|
|
438
438
|
options: w.options
|
|
439
|
-
}),
|
|
439
|
+
}), v && f.push({
|
|
440
440
|
id: "toggleComments",
|
|
441
|
-
label:
|
|
442
|
-
command:
|
|
443
|
-
icon:
|
|
444
|
-
type:
|
|
445
|
-
options:
|
|
441
|
+
label: v.label,
|
|
442
|
+
command: v.command,
|
|
443
|
+
icon: v.icon,
|
|
444
|
+
type: v.type || "button",
|
|
445
|
+
options: v.options
|
|
446
446
|
});
|
|
447
447
|
return;
|
|
448
448
|
}
|
|
449
|
-
const
|
|
450
|
-
let
|
|
451
|
-
|
|
452
|
-
id:
|
|
453
|
-
label:
|
|
454
|
-
command:
|
|
455
|
-
icon:
|
|
456
|
-
type:
|
|
457
|
-
options:
|
|
458
|
-
items:
|
|
449
|
+
const T = l[g] || g;
|
|
450
|
+
let k = r.get(T);
|
|
451
|
+
k || (k = r.get(g)), k && f.push({
|
|
452
|
+
id: g,
|
|
453
|
+
label: k.label,
|
|
454
|
+
command: k.command,
|
|
455
|
+
icon: k.icon,
|
|
456
|
+
type: k.type === "separator" ? "separator" : k.type || "button",
|
|
457
|
+
options: k.options,
|
|
458
|
+
items: k.items
|
|
459
459
|
});
|
|
460
460
|
}), f.length > 0 && e.push(f);
|
|
461
461
|
}), e;
|
|
@@ -499,23 +499,23 @@ class pn {
|
|
|
499
499
|
const r = () => {
|
|
500
500
|
const c = this.overflowUnits;
|
|
501
501
|
if (c.length === 0) return;
|
|
502
|
-
c.forEach((
|
|
502
|
+
c.forEach((O) => {
|
|
503
503
|
var N;
|
|
504
|
-
|
|
504
|
+
O.parentElement === i && ((N = this.overflowUnitHomes.get(O)) == null || N.appendChild(O));
|
|
505
505
|
});
|
|
506
|
-
const f = t.clientWidth, m = 16,
|
|
507
|
-
let w = 0,
|
|
508
|
-
for (const
|
|
509
|
-
const N =
|
|
510
|
-
if (w + N <=
|
|
511
|
-
w += N,
|
|
506
|
+
const f = t.clientWidth, m = 16, g = 40, T = 4, k = Math.max(0, f - m - g - T);
|
|
507
|
+
let w = 0, v = 0;
|
|
508
|
+
for (const O of c) {
|
|
509
|
+
const N = O.getBoundingClientRect().width + T;
|
|
510
|
+
if (w + N <= k)
|
|
511
|
+
w += N, v++;
|
|
512
512
|
else
|
|
513
513
|
break;
|
|
514
514
|
}
|
|
515
|
-
|
|
516
|
-
const Y =
|
|
517
|
-
o.style.display = Y ? "" : "none", o.classList.toggle("active", Y && this.expandedOpen), !Y && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((
|
|
518
|
-
N >=
|
|
515
|
+
v = Math.max(1, Math.min(v, c.length));
|
|
516
|
+
const Y = v < c.length;
|
|
517
|
+
o.style.display = Y ? "" : "none", o.classList.toggle("active", Y && this.expandedOpen), !Y && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((O, N) => {
|
|
518
|
+
N >= v && i.appendChild(O);
|
|
519
519
|
});
|
|
520
520
|
}, l = () => {
|
|
521
521
|
this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
|
|
@@ -595,6 +595,57 @@ class pn {
|
|
|
595
595
|
o.preventDefault(), this.commandHandler && t.command && this.commandHandler(t.command);
|
|
596
596
|
}), e;
|
|
597
597
|
}
|
|
598
|
+
/**
|
|
599
|
+
* What a toolbar menu needs besides its look, so it can be used without a mouse: the trigger says it opens a menu
|
|
600
|
+
* and whether it is open, the menu and its items have menu roles, and the keyboard works in it. Enter, Space or an
|
|
601
|
+
* arrow key on the trigger opens it and moves the focus to the first (or, with ArrowUp, the last) item; arrows,
|
|
602
|
+
* Home and End move between items; Escape closes it and gives the focus back to the trigger; Tab closes it. A
|
|
603
|
+
* mouse click leaves the focus alone, so the editor keeps its selection.
|
|
604
|
+
*/
|
|
605
|
+
makeMenuAccessible(t, e, o, i) {
|
|
606
|
+
e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", "false"), o.setAttribute("role", "menu"), o.setAttribute("aria-label", i), o.querySelectorAll(".editora-toolbar-dropdown-item").forEach((m) => {
|
|
607
|
+
m.setAttribute("role", "menuitem"), m.tabIndex = -1;
|
|
608
|
+
});
|
|
609
|
+
const r = () => Array.from(o.querySelectorAll('[role="menuitem"]')), l = () => o.style.display === "block", c = new MutationObserver(() => {
|
|
610
|
+
e.setAttribute("aria-expanded", l() ? "true" : "false");
|
|
611
|
+
});
|
|
612
|
+
c.observe(o, { attributes: !0, attributeFilter: ["style"] });
|
|
613
|
+
const f = t._cleanupDropdown;
|
|
614
|
+
t._cleanupDropdown = () => {
|
|
615
|
+
c.disconnect(), f == null || f();
|
|
616
|
+
}, e.addEventListener("click", (m) => {
|
|
617
|
+
var g;
|
|
618
|
+
m.detail === 0 && l() && ((g = r()[0]) == null || g.focus());
|
|
619
|
+
}), e.addEventListener("keydown", (m) => {
|
|
620
|
+
var T;
|
|
621
|
+
if (m.key !== "ArrowDown" && m.key !== "ArrowUp") return;
|
|
622
|
+
m.preventDefault(), l() || e.click();
|
|
623
|
+
const g = r();
|
|
624
|
+
(T = m.key === "ArrowUp" ? g[g.length - 1] : g[0]) == null || T.focus();
|
|
625
|
+
}), o.addEventListener("keydown", (m) => {
|
|
626
|
+
const g = r();
|
|
627
|
+
if (g.length === 0) return;
|
|
628
|
+
const T = g.indexOf(document.activeElement), k = (w) => {
|
|
629
|
+
m.preventDefault(), g[(w + g.length) % g.length].focus();
|
|
630
|
+
};
|
|
631
|
+
switch (m.key) {
|
|
632
|
+
case "ArrowDown":
|
|
633
|
+
return k(T + 1);
|
|
634
|
+
case "ArrowUp":
|
|
635
|
+
return k(T < 0 ? g.length - 1 : T - 1);
|
|
636
|
+
case "Home":
|
|
637
|
+
return k(0);
|
|
638
|
+
case "End":
|
|
639
|
+
return k(g.length - 1);
|
|
640
|
+
case "Escape":
|
|
641
|
+
m.preventDefault(), m.stopPropagation(), o.style.display = "none", e.focus();
|
|
642
|
+
return;
|
|
643
|
+
case "Tab":
|
|
644
|
+
o.style.display = "none";
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
}
|
|
598
649
|
/**
|
|
599
650
|
* Create a dropdown element
|
|
600
651
|
*/
|
|
@@ -621,7 +672,7 @@ class pn {
|
|
|
621
672
|
};
|
|
622
673
|
return document.addEventListener("mousedown", r, !0), document.addEventListener("keydown", l), e._cleanupDropdown = () => {
|
|
623
674
|
document.removeEventListener("mousedown", r, !0), document.removeEventListener("keydown", l);
|
|
624
|
-
}, e.appendChild(o), e.appendChild(i), e;
|
|
675
|
+
}, e.appendChild(o), e.appendChild(i), this.makeMenuAccessible(e, o, i, t.label), e;
|
|
625
676
|
}
|
|
626
677
|
/**
|
|
627
678
|
* Create an inline menu element (like dropdown but triggered by button click)
|
|
@@ -650,8 +701,8 @@ class pn {
|
|
|
650
701
|
const f = (m = this.container) == null ? void 0 : m.querySelectorAll(
|
|
651
702
|
".editora-toolbar-dropdown-menu"
|
|
652
703
|
);
|
|
653
|
-
f == null || f.forEach((
|
|
654
|
-
|
|
704
|
+
f == null || f.forEach((g) => {
|
|
705
|
+
g !== i && (g.style.display = "none");
|
|
655
706
|
}), i.style.display = i.style.display === "none" ? "block" : "none";
|
|
656
707
|
});
|
|
657
708
|
const r = (c) => {
|
|
@@ -661,7 +712,7 @@ class pn {
|
|
|
661
712
|
};
|
|
662
713
|
return document.addEventListener("mousedown", r, !0), document.addEventListener("keydown", l), e._cleanupDropdown = () => {
|
|
663
714
|
document.removeEventListener("mousedown", r, !0), document.removeEventListener("keydown", l);
|
|
664
|
-
}, e.appendChild(o), e.appendChild(i), e;
|
|
715
|
+
}, e.appendChild(o), e.appendChild(i), this.makeMenuAccessible(e, o, i, t.label), e;
|
|
665
716
|
}
|
|
666
717
|
/**
|
|
667
718
|
* Get default toolbar string if none provided
|
|
@@ -1195,8 +1246,8 @@ function Tn(a, t) {
|
|
|
1195
1246
|
var o, i, r, l, c = [], f = !0, m = !1;
|
|
1196
1247
|
try {
|
|
1197
1248
|
if (r = (e = e.call(a)).next, t !== 0) for (; !(f = (o = r.call(e)).done) && (c.push(o.value), c.length !== t); f = !0) ;
|
|
1198
|
-
} catch (
|
|
1199
|
-
m = !0, i =
|
|
1249
|
+
} catch (g) {
|
|
1250
|
+
m = !0, i = g;
|
|
1200
1251
|
} finally {
|
|
1201
1252
|
try {
|
|
1202
1253
|
if (!f && e.return != null && (l = e.return(), Object(l) !== l)) return;
|
|
@@ -1237,7 +1288,7 @@ Te || (Te = function(t) {
|
|
|
1237
1288
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1238
1289
|
return new t(...o);
|
|
1239
1290
|
});
|
|
1240
|
-
const rt = L(Array.prototype.forEach), Ln = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), kt = L(Array.prototype.push), Mn = L(Array.prototype.splice), bt = Array.isArray, _t = L(String.prototype.toLowerCase), fe = L(String.prototype.toString), lo = L(String.prototype.match), xt = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim),
|
|
1291
|
+
const rt = L(Array.prototype.forEach), Ln = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), kt = L(Array.prototype.push), Mn = L(Array.prototype.splice), bt = Array.isArray, _t = L(String.prototype.toLowerCase), fe = L(String.prototype.toString), lo = L(String.prototype.match), xt = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim), Dn = L(Number.prototype.toString), On = L(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), po = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), z = L(Object.prototype.hasOwnProperty), At = L(Object.prototype.toString), D = L(RegExp.prototype.test), Z = Rn(TypeError);
|
|
1241
1292
|
function L(a) {
|
|
1242
1293
|
return function(t) {
|
|
1243
1294
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -1251,7 +1302,7 @@ function Rn(a) {
|
|
|
1251
1302
|
return Te(a, e);
|
|
1252
1303
|
};
|
|
1253
1304
|
}
|
|
1254
|
-
function
|
|
1305
|
+
function E(a, t) {
|
|
1255
1306
|
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _t;
|
|
1256
1307
|
if (ao && ao(a, null), !bt(t)) return a;
|
|
1257
1308
|
let o = t.length;
|
|
@@ -1269,12 +1320,12 @@ function Nn(a) {
|
|
|
1269
1320
|
for (let t = 0; t < a.length; t++) z(a, t) || (a[t] = null);
|
|
1270
1321
|
return a;
|
|
1271
1322
|
}
|
|
1272
|
-
function
|
|
1323
|
+
function F(a) {
|
|
1273
1324
|
const t = gt(null);
|
|
1274
1325
|
for (const o of So(a)) {
|
|
1275
1326
|
var e = xn(o, 2);
|
|
1276
1327
|
const i = e[0], r = e[1];
|
|
1277
|
-
z(a, i) && (bt(r) ? t[i] = Nn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] =
|
|
1328
|
+
z(a, i) && (bt(r) ? t[i] = Nn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = F(r) : t[i] = r);
|
|
1278
1329
|
}
|
|
1279
1330
|
return t;
|
|
1280
1331
|
}
|
|
@@ -1283,9 +1334,9 @@ function Pn(a) {
|
|
|
1283
1334
|
case "string":
|
|
1284
1335
|
return a;
|
|
1285
1336
|
case "number":
|
|
1286
|
-
return On(a);
|
|
1287
|
-
case "boolean":
|
|
1288
1337
|
return Dn(a);
|
|
1338
|
+
case "boolean":
|
|
1339
|
+
return On(a);
|
|
1289
1340
|
case "bigint":
|
|
1290
1341
|
return uo ? uo(a) : "0";
|
|
1291
1342
|
case "symbol":
|
|
@@ -1322,7 +1373,7 @@ function j(a, t) {
|
|
|
1322
1373
|
}
|
|
1323
1374
|
function zn(a) {
|
|
1324
1375
|
try {
|
|
1325
|
-
return
|
|
1376
|
+
return D(a, ""), !0;
|
|
1326
1377
|
} catch (t) {
|
|
1327
1378
|
return !1;
|
|
1328
1379
|
}
|
|
@@ -1521,7 +1572,7 @@ const fo = M([
|
|
|
1521
1572
|
"feSpotLight",
|
|
1522
1573
|
"feTile",
|
|
1523
1574
|
"feTurbulence"
|
|
1524
|
-
]),
|
|
1575
|
+
]), Hn = M([
|
|
1525
1576
|
"animate",
|
|
1526
1577
|
"color-profile",
|
|
1527
1578
|
"cursor",
|
|
@@ -1575,7 +1626,7 @@ const fo = M([
|
|
|
1575
1626
|
"munder",
|
|
1576
1627
|
"munderover",
|
|
1577
1628
|
"mprescripts"
|
|
1578
|
-
]),
|
|
1629
|
+
]), Bn = M([
|
|
1579
1630
|
"maction",
|
|
1580
1631
|
"maligngroup",
|
|
1581
1632
|
"malignmark",
|
|
@@ -1964,7 +2015,7 @@ const fo = M([
|
|
|
1964
2015
|
"xlink:title",
|
|
1965
2016
|
"xml:space",
|
|
1966
2017
|
"xmlns:xlink"
|
|
1967
|
-
]),
|
|
2018
|
+
]), Fn = I(/{{[\w\W]*|^[\w\W]*}}/g), Un = I(/<%[\w\W]*|^[\w\W]*%>/g), jn = I(/\${[\w\W]*/g), Wn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), $n = I(/^aria-[\-\w]+$/), bo = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Gn = I(/^(?:\w+script|data):/i), Kn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Yn = I(/^html$/i), qn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), yo = I(/<[/\w!]/g), Eo = I(/<[/\w]/g), Vn = I(/<\/no(script|embed|frames)/i), Xn = I(/\/>/i), B = {
|
|
1968
2019
|
element: 1,
|
|
1969
2020
|
attribute: 2,
|
|
1970
2021
|
text: 3,
|
|
@@ -1986,7 +2037,7 @@ const fo = M([
|
|
|
1986
2037
|
"noframes",
|
|
1987
2038
|
"plaintext",
|
|
1988
2039
|
"noscript"
|
|
1989
|
-
], Zn = M(
|
|
2040
|
+
], Zn = M(E({}, Lo)), Jn = (function() {
|
|
1990
2041
|
const a = {};
|
|
1991
2042
|
return rt(Lo, (t) => {
|
|
1992
2043
|
a[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
@@ -2024,22 +2075,22 @@ const fo = M([
|
|
|
2024
2075
|
uponSanitizeShadowNode: []
|
|
2025
2076
|
};
|
|
2026
2077
|
}, J = function(t, e, o, i) {
|
|
2027
|
-
return z(t, e) && bt(t[e]) ?
|
|
2078
|
+
return z(t, e) && bt(t[e]) ? E(i.base ? F(i.base) : {}, t[e], i.transform) : o;
|
|
2028
2079
|
}, ye = function(t, e, o) {
|
|
2029
2080
|
const i = z(t, e) ? t[e] : void 0;
|
|
2030
|
-
return i && typeof i == "object" ?
|
|
2081
|
+
return i && typeof i == "object" ? F(i) : o();
|
|
2031
2082
|
};
|
|
2032
2083
|
function Mo() {
|
|
2033
2084
|
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Qn();
|
|
2034
2085
|
const t = (u) => Mo(u);
|
|
2035
|
-
if (t.version = "3.4.16", t.removed = [], !a || !a.document || a.document.nodeType !==
|
|
2086
|
+
if (t.version = "3.4.16", t.removed = [], !a || !a.document || a.document.nodeType !== B.document || !a.Element)
|
|
2036
2087
|
return t.isSupported = !1, t;
|
|
2037
2088
|
let e = a.document;
|
|
2038
2089
|
const o = e, i = o.currentScript;
|
|
2039
2090
|
a.DocumentFragment;
|
|
2040
2091
|
const r = a.HTMLTemplateElement, l = a.Node, c = a.Element, f = a.NodeFilter;
|
|
2041
2092
|
a.NamedNodeMap === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
|
|
2042
|
-
const m = a.DOMParser,
|
|
2093
|
+
const m = a.DOMParser, g = a.trustedTypes, T = c.prototype, k = j(T, "cloneNode"), w = j(T, "remove"), v = j(T, "removeAttributeNode"), Y = j(T, "nextSibling"), O = j(T, "childNodes"), N = j(T, "parentNode"), Ce = j(T, "shadowRoot"), qt = j(T, "attributes"), tt = l && l.prototype ? j(l.prototype, "nodeType") : null, at = l && l.prototype ? j(l.prototype, "nodeName") : null, Lt = l && l.prototype ? j(l.prototype, "ownerDocument") : null, yt = function(n) {
|
|
2043
2094
|
return tt ? tt(n) : n.nodeType;
|
|
2044
2095
|
}, Vt = function(n) {
|
|
2045
2096
|
return at ? at(n) : n.nodeName;
|
|
@@ -2058,7 +2109,7 @@ function Mo() {
|
|
|
2058
2109
|
} finally {
|
|
2059
2110
|
Et--;
|
|
2060
2111
|
}
|
|
2061
|
-
},
|
|
2112
|
+
}, Oo = function(n) {
|
|
2062
2113
|
_e(), Et++;
|
|
2063
2114
|
try {
|
|
2064
2115
|
return P.createScriptURL(n);
|
|
@@ -2066,21 +2117,21 @@ function Mo() {
|
|
|
2066
2117
|
Et--;
|
|
2067
2118
|
}
|
|
2068
2119
|
}, Ro = function() {
|
|
2069
|
-
return Se || (Xt = ti(
|
|
2120
|
+
return Se || (Xt = ti(g, i), Se = !0), Xt;
|
|
2070
2121
|
}, Mt = e, Zt = Mt.implementation, Le = Mt.createNodeIterator, No = Mt.createDocumentFragment, Po = Mt.getElementsByTagName, zo = o.importNode;
|
|
2071
|
-
let
|
|
2122
|
+
let x = vo();
|
|
2072
2123
|
t.isSupported = typeof So == "function" && typeof N == "function" && Zt && Zt.createHTMLDocument !== void 0;
|
|
2073
|
-
const
|
|
2074
|
-
let Ie = bo,
|
|
2075
|
-
const Jt =
|
|
2124
|
+
const Ho = Fn, Bo = Un, Fo = jn, Uo = Wn, jo = $n, Wo = Gn, Me = Kn, $o = qn;
|
|
2125
|
+
let Ie = bo, A = null;
|
|
2126
|
+
const Jt = E({}, [
|
|
2076
2127
|
...fo,
|
|
2077
2128
|
...he,
|
|
2078
2129
|
...me,
|
|
2079
2130
|
...ge,
|
|
2080
2131
|
...ho
|
|
2081
2132
|
]);
|
|
2082
|
-
let
|
|
2083
|
-
const Qt =
|
|
2133
|
+
let C = null;
|
|
2134
|
+
const Qt = E({}, [
|
|
2084
2135
|
...mo,
|
|
2085
2136
|
...be,
|
|
2086
2137
|
...go,
|
|
@@ -2105,7 +2156,7 @@ function Mo() {
|
|
|
2105
2156
|
enumerable: !0,
|
|
2106
2157
|
value: !1
|
|
2107
2158
|
}
|
|
2108
|
-
})), vt = null,
|
|
2159
|
+
})), vt = null, De = null;
|
|
2109
2160
|
const q = Object.seal(gt(null, {
|
|
2110
2161
|
tagCheck: {
|
|
2111
2162
|
writable: !0,
|
|
@@ -2120,10 +2171,10 @@ function Mo() {
|
|
|
2120
2171
|
value: null
|
|
2121
2172
|
}
|
|
2122
2173
|
}));
|
|
2123
|
-
let
|
|
2124
|
-
const
|
|
2174
|
+
let Oe = !0, te = !0, Re = !1, Ne = !0, V = !1, ot = !0, nt = !1, ee = !1, It = null, Dt = null, oe = !1, lt = !1, Ot = !1, Rt = !1, Pe = !0, ze = !1;
|
|
2175
|
+
const He = "user-content-";
|
|
2125
2176
|
let ne = !0, ie = !1, ct = {}, dt = null;
|
|
2126
|
-
const
|
|
2177
|
+
const Be = E({}, [
|
|
2127
2178
|
"annotation-xml",
|
|
2128
2179
|
"audio",
|
|
2129
2180
|
"colgroup",
|
|
@@ -2151,8 +2202,8 @@ function Mo() {
|
|
|
2151
2202
|
"video",
|
|
2152
2203
|
"xmp"
|
|
2153
2204
|
]);
|
|
2154
|
-
let
|
|
2155
|
-
const Ue =
|
|
2205
|
+
let Fe = null;
|
|
2206
|
+
const Ue = E({}, [
|
|
2156
2207
|
"audio",
|
|
2157
2208
|
"video",
|
|
2158
2209
|
"img",
|
|
@@ -2161,7 +2212,7 @@ function Mo() {
|
|
|
2161
2212
|
"track"
|
|
2162
2213
|
]);
|
|
2163
2214
|
let je = null;
|
|
2164
|
-
const We =
|
|
2215
|
+
const We = E({}, [
|
|
2165
2216
|
"alt",
|
|
2166
2217
|
"class",
|
|
2167
2218
|
"for",
|
|
@@ -2178,7 +2229,7 @@ function Mo() {
|
|
|
2178
2229
|
"xmlns"
|
|
2179
2230
|
]), Nt = "http://www.w3.org/1998/Math/MathML", Pt = "http://www.w3.org/2000/svg", $ = "http://www.w3.org/1999/xhtml";
|
|
2180
2231
|
let ut = $, re = !1, ae = null;
|
|
2181
|
-
const Go =
|
|
2232
|
+
const Go = E({}, [
|
|
2182
2233
|
Nt,
|
|
2183
2234
|
Pt,
|
|
2184
2235
|
$
|
|
@@ -2189,10 +2240,10 @@ function Mo() {
|
|
|
2189
2240
|
"ms",
|
|
2190
2241
|
"mtext"
|
|
2191
2242
|
]);
|
|
2192
|
-
let se =
|
|
2243
|
+
let se = E({}, $e);
|
|
2193
2244
|
const Ge = M(["annotation-xml"]);
|
|
2194
|
-
let le =
|
|
2195
|
-
const Ko =
|
|
2245
|
+
let le = E({}, Ge);
|
|
2246
|
+
const Ko = E({}, [
|
|
2196
2247
|
"title",
|
|
2197
2248
|
"style",
|
|
2198
2249
|
"font",
|
|
@@ -2207,19 +2258,19 @@ function Mo() {
|
|
|
2207
2258
|
}, ce = function() {
|
|
2208
2259
|
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2209
2260
|
if (pt && pt === n) return;
|
|
2210
|
-
(!n || typeof n != "object") && (n = {}), n =
|
|
2261
|
+
(!n || typeof n != "object") && (n = {}), n = F(n), wt = Yo.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? qo : n.PARSER_MEDIA_TYPE, _ = wt === "application/xhtml+xml" ? fe : _t, A = J(n, "ALLOWED_TAGS", Jt, { transform: _ }), C = J(n, "ALLOWED_ATTR", Qt, { transform: _ }), ae = J(n, "ALLOWED_NAMESPACES", Go, { transform: fe }), je = J(n, "ADD_URI_SAFE_ATTR", We, {
|
|
2211
2262
|
transform: _,
|
|
2212
2263
|
base: We
|
|
2213
|
-
}),
|
|
2264
|
+
}), Fe = J(n, "ADD_DATA_URI_TAGS", Ue, {
|
|
2214
2265
|
transform: _,
|
|
2215
2266
|
base: Ue
|
|
2216
|
-
}), dt = J(n, "FORBID_CONTENTS",
|
|
2267
|
+
}), dt = J(n, "FORBID_CONTENTS", Be, { transform: _ }), vt = J(n, "FORBID_TAGS", F({}), { transform: _ }), De = J(n, "FORBID_ATTR", F({}), { transform: _ }), ct = z(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? F(n.USE_PROFILES) : n.USE_PROFILES : !1, Oe = n.ALLOW_ARIA_ATTR !== !1, te = n.ALLOW_DATA_ATTR !== !1, Re = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = n.SAFE_FOR_TEMPLATES || !1, ot = n.SAFE_FOR_XML !== !1, nt = n.WHOLE_DOCUMENT || !1, lt = n.RETURN_DOM || !1, Ot = n.RETURN_DOM_FRAGMENT || !1, Rt = n.RETURN_TRUSTED_TYPE || !1, oe = n.FORCE_BODY || !1, Pe = n.SANITIZE_DOM !== !1, ze = n.SANITIZE_NAMED_PROPS || !1, ne = n.KEEP_CONTENT !== !1, ie = n.IN_PLACE || !1, Ie = zn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : bo, ut = typeof n.NAMESPACE == "string" ? n.NAMESPACE : $, se = ye(n, "MATHML_TEXT_INTEGRATION_POINTS", () => E({}, $e)), le = ye(n, "HTML_INTEGRATION_POINTS", () => E({}, Ge));
|
|
2217
2268
|
const s = ye(n, "CUSTOM_ELEMENT_HANDLING", () => gt(null));
|
|
2218
|
-
if (W = gt(null), z(s, "tagNameCheck") && Ke(s.tagNameCheck) && (W.tagNameCheck = s.tagNameCheck), z(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && (W.attributeNameCheck = s.attributeNameCheck), z(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I(W), V && (te = !1),
|
|
2269
|
+
if (W = gt(null), z(s, "tagNameCheck") && Ke(s.tagNameCheck) && (W.tagNameCheck = s.tagNameCheck), z(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && (W.attributeNameCheck = s.attributeNameCheck), z(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I(W), V && (te = !1), Ot && (lt = !0), ct && (A = E({}, ho), C = gt(null), ct.html === !0 && (E(A, fo), E(C, mo)), ct.svg === !0 && (E(A, he), E(C, be), E(C, Wt)), ct.svgFilters === !0 && (E(A, me), E(C, be), E(C, Wt)), ct.mathMl === !0 && (E(A, ge), E(C, go), E(C, Wt))), q.tagCheck = null, q.attributeCheck = null, z(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? q.tagCheck = n.ADD_TAGS : bt(n.ADD_TAGS) && (A === Jt && (A = F(A)), E(A, n.ADD_TAGS, _))), z(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? q.attributeCheck = n.ADD_ATTR : bt(n.ADD_ATTR) && (C === Qt && (C = F(C)), E(C, n.ADD_ATTR, _))), z(n, "ADD_FORBID_CONTENTS") && bt(n.ADD_FORBID_CONTENTS) && (dt === Be && (dt = F(dt)), E(dt, n.ADD_FORBID_CONTENTS, _)), ne && (A["#text"] = !0), nt && E(A, [
|
|
2219
2270
|
"html",
|
|
2220
2271
|
"head",
|
|
2221
2272
|
"body"
|
|
2222
|
-
]),
|
|
2273
|
+
]), A.table && (E(A, ["tbody"]), delete vt.tbody), n.TRUSTED_TYPES_POLICY) {
|
|
2223
2274
|
if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2224
2275
|
if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2225
2276
|
const d = P;
|
|
@@ -2231,11 +2282,11 @@ function Mo() {
|
|
|
2231
2282
|
}
|
|
2232
2283
|
} else n.TRUSTED_TYPES_POLICY === null ? (P = void 0, et = "") : (P === void 0 && (P = Ro()), P && typeof et == "string" && (et = st("")));
|
|
2233
2284
|
M && M(n), pt = n;
|
|
2234
|
-
}, Ye =
|
|
2285
|
+
}, Ye = E({}, [
|
|
2235
2286
|
...he,
|
|
2236
2287
|
...me,
|
|
2237
|
-
...
|
|
2238
|
-
]), qe =
|
|
2288
|
+
...Hn
|
|
2289
|
+
]), qe = E({}, [...ge, ...Bn]), Xo = function(n, s, d) {
|
|
2239
2290
|
return s.namespaceURI === $ ? n === "svg" : s.namespaceURI === Nt ? n === "svg" && (d === "annotation-xml" || se[d]) : !!Ye[n];
|
|
2240
2291
|
}, Zo = function(n, s, d) {
|
|
2241
2292
|
return s.namespaceURI === $ ? n === "math" : s.namespaceURI === Pt ? n === "math" && le[d] : !!qe[n];
|
|
@@ -2258,7 +2309,7 @@ function Mo() {
|
|
|
2258
2309
|
}
|
|
2259
2310
|
}, Ve = function(n, s, d) {
|
|
2260
2311
|
try {
|
|
2261
|
-
|
|
2312
|
+
v(n, s);
|
|
2262
2313
|
} catch (p) {
|
|
2263
2314
|
try {
|
|
2264
2315
|
n.removeAttribute(d);
|
|
@@ -2266,8 +2317,8 @@ function Mo() {
|
|
|
2266
2317
|
}
|
|
2267
2318
|
}
|
|
2268
2319
|
}, zt = function(n) {
|
|
2269
|
-
|
|
2270
|
-
const s =
|
|
2320
|
+
Ht(n);
|
|
2321
|
+
const s = O(n);
|
|
2271
2322
|
if (s) {
|
|
2272
2323
|
const p = [];
|
|
2273
2324
|
rt(s, (h) => {
|
|
@@ -2275,14 +2326,14 @@ function Mo() {
|
|
|
2275
2326
|
}), rt(p, (h) => {
|
|
2276
2327
|
try {
|
|
2277
2328
|
w(h);
|
|
2278
|
-
} catch (
|
|
2329
|
+
} catch (b) {
|
|
2279
2330
|
}
|
|
2280
2331
|
});
|
|
2281
2332
|
}
|
|
2282
2333
|
const d = qt(n);
|
|
2283
2334
|
if (d) for (let p = d.length - 1; p >= 0; --p) {
|
|
2284
|
-
const h = d[p],
|
|
2285
|
-
typeof
|
|
2335
|
+
const h = d[p], b = h && h.name;
|
|
2336
|
+
typeof b == "string" && Ve(n, h, b);
|
|
2286
2337
|
}
|
|
2287
2338
|
}, it = function(n, s, d) {
|
|
2288
2339
|
if (!d) try {
|
|
@@ -2295,7 +2346,7 @@ function Mo() {
|
|
|
2295
2346
|
from: s
|
|
2296
2347
|
});
|
|
2297
2348
|
try {
|
|
2298
|
-
d ?
|
|
2349
|
+
d ? v(s, d) : s.removeAttribute(n);
|
|
2299
2350
|
} catch (p) {
|
|
2300
2351
|
try {
|
|
2301
2352
|
s.removeAttribute(n);
|
|
@@ -2303,7 +2354,7 @@ function Mo() {
|
|
|
2303
2354
|
}
|
|
2304
2355
|
}
|
|
2305
2356
|
if (n === "is")
|
|
2306
|
-
if (lt ||
|
|
2357
|
+
if (lt || Ot) try {
|
|
2307
2358
|
X(s);
|
|
2308
2359
|
} catch (p) {
|
|
2309
2360
|
}
|
|
@@ -2316,14 +2367,14 @@ function Mo() {
|
|
|
2316
2367
|
if (s)
|
|
2317
2368
|
for (let d = s.length - 1; d >= 0; --d) {
|
|
2318
2369
|
const p = s[d], h = p && p.name;
|
|
2319
|
-
typeof h != "string" ||
|
|
2370
|
+
typeof h != "string" || C[_(h)] || Ve(n, p, h);
|
|
2320
2371
|
}
|
|
2321
|
-
},
|
|
2372
|
+
}, Ht = function(n) {
|
|
2322
2373
|
const s = [n];
|
|
2323
2374
|
for (; s.length > 0; ) {
|
|
2324
2375
|
const d = s.pop();
|
|
2325
|
-
yt(d) ===
|
|
2326
|
-
const p =
|
|
2376
|
+
yt(d) === B.element && tn(d);
|
|
2377
|
+
const p = O(d);
|
|
2327
2378
|
if (p) for (let h = p.length - 1; h >= 0; --h) s.push(p[h]);
|
|
2328
2379
|
}
|
|
2329
2380
|
}, Xe = function(n, s) {
|
|
@@ -2333,41 +2384,41 @@ function Mo() {
|
|
|
2333
2384
|
const s = [n];
|
|
2334
2385
|
for (; s.length > 0; ) {
|
|
2335
2386
|
const d = s.pop(), p = yt(d);
|
|
2336
|
-
if (p ===
|
|
2387
|
+
if (p === B.processingInstruction || p === B.comment && D(Eo, d.data)) {
|
|
2337
2388
|
try {
|
|
2338
2389
|
w(d);
|
|
2339
|
-
} catch (
|
|
2390
|
+
} catch (b) {
|
|
2340
2391
|
}
|
|
2341
2392
|
continue;
|
|
2342
2393
|
}
|
|
2343
|
-
if (p ===
|
|
2344
|
-
const
|
|
2394
|
+
if (p === B.element) {
|
|
2395
|
+
const b = d, y = _(Vt(d));
|
|
2345
2396
|
try {
|
|
2346
|
-
|
|
2397
|
+
b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Xe("for", y) && b.removeAttribute("for");
|
|
2347
2398
|
} catch (S) {
|
|
2348
2399
|
}
|
|
2349
2400
|
}
|
|
2350
|
-
const h =
|
|
2351
|
-
if (h) for (let
|
|
2401
|
+
const h = O(d);
|
|
2402
|
+
if (h) for (let b = h.length - 1; b >= 0; --b) s.push(h[b]);
|
|
2352
2403
|
}
|
|
2353
2404
|
}, Ze = function(n) {
|
|
2354
2405
|
let s = null, d = null;
|
|
2355
2406
|
if (oe) n = "<remove></remove>" + n;
|
|
2356
2407
|
else {
|
|
2357
|
-
const
|
|
2358
|
-
d =
|
|
2408
|
+
const b = lo(n, /^[\r\n\t ]+/);
|
|
2409
|
+
d = b && b[0];
|
|
2359
2410
|
}
|
|
2360
2411
|
wt === "application/xhtml+xml" && ut === $ && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
|
|
2361
2412
|
const p = P ? st(n) : n;
|
|
2362
2413
|
if (ut === $) try {
|
|
2363
2414
|
s = new m().parseFromString(p, wt);
|
|
2364
|
-
} catch (
|
|
2415
|
+
} catch (b) {
|
|
2365
2416
|
}
|
|
2366
2417
|
if (!s || !s.documentElement) {
|
|
2367
2418
|
s = Zt.createDocument(ut, "template", null);
|
|
2368
2419
|
try {
|
|
2369
2420
|
s.documentElement.innerHTML = re ? et : p;
|
|
2370
|
-
} catch (
|
|
2421
|
+
} catch (b) {
|
|
2371
2422
|
}
|
|
2372
2423
|
}
|
|
2373
2424
|
const h = s.body || s.documentElement;
|
|
@@ -2375,26 +2426,26 @@ function Mo() {
|
|
|
2375
2426
|
}, Je = function(n) {
|
|
2376
2427
|
const s = Lt ? Lt(n) : n.ownerDocument;
|
|
2377
2428
|
return Le.call(s || n, n, f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION, null);
|
|
2378
|
-
},
|
|
2379
|
-
return n = xt(n,
|
|
2429
|
+
}, Bt = function(n) {
|
|
2430
|
+
return n = xt(n, Ho, " "), n = xt(n, Bo, " "), n = xt(n, Fo, " "), n;
|
|
2380
2431
|
}, de = function(n) {
|
|
2381
2432
|
var s;
|
|
2382
2433
|
n.normalize();
|
|
2383
2434
|
const d = Lt ? Lt(n) : n.ownerDocument, p = Le.call(d || n, n, f.SHOW_TEXT | f.SHOW_COMMENT | f.SHOW_CDATA_SECTION | f.SHOW_PROCESSING_INSTRUCTION, null);
|
|
2384
2435
|
let h = p.nextNode();
|
|
2385
2436
|
for (; h; )
|
|
2386
|
-
h.data =
|
|
2387
|
-
const
|
|
2388
|
-
|
|
2389
|
-
ft(
|
|
2437
|
+
h.data = Bt(h.data), h = p.nextNode();
|
|
2438
|
+
const b = (s = n.querySelectorAll) === null || s === void 0 ? void 0 : s.call(n, "template");
|
|
2439
|
+
b && rt(b, (y) => {
|
|
2440
|
+
ft(y.content) && de(y.content);
|
|
2390
2441
|
});
|
|
2391
|
-
},
|
|
2442
|
+
}, Ft = function(n) {
|
|
2392
2443
|
const s = at ? at(n) : null;
|
|
2393
|
-
return typeof s != "string" || _(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== qt(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !== tt(n) || n.childNodes !==
|
|
2444
|
+
return typeof s != "string" || _(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== qt(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !== tt(n) || n.childNodes !== O(n);
|
|
2394
2445
|
}, ft = function(n) {
|
|
2395
2446
|
if (!tt || typeof n != "object" || n === null) return !1;
|
|
2396
2447
|
try {
|
|
2397
|
-
return tt(n) ===
|
|
2448
|
+
return tt(n) === B.documentFragment;
|
|
2398
2449
|
} catch (s) {
|
|
2399
2450
|
return !1;
|
|
2400
2451
|
}
|
|
@@ -2412,9 +2463,9 @@ function Mo() {
|
|
|
2412
2463
|
});
|
|
2413
2464
|
}
|
|
2414
2465
|
const on = function(n, s) {
|
|
2415
|
-
return !!(ot && n.hasChildNodes() && !Tt(n.firstElementChild) &&
|
|
2466
|
+
return !!(ot && n.hasChildNodes() && !Tt(n.firstElementChild) && D(yo, n.textContent) && D(yo, n.innerHTML) || ot && n.namespaceURI === $ && Zn[s] && (Tt(n.firstElementChild) || typeof n.textContent == "string" && D(Jn[s], n.textContent)) || n.nodeType === B.processingInstruction || ot && n.nodeType === B.comment && D(Eo, n.data));
|
|
2416
2467
|
}, Ut = function(n, s) {
|
|
2417
|
-
if (n instanceof RegExp) return
|
|
2468
|
+
if (n instanceof RegExp) return D(n, s);
|
|
2418
2469
|
if (n instanceof Function) {
|
|
2419
2470
|
for (var d = arguments.length, p = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) p[h - 2] = arguments[h];
|
|
2420
2471
|
return !!n(s, ...p);
|
|
@@ -2423,47 +2474,47 @@ function Mo() {
|
|
|
2423
2474
|
}, nn = function(n, s, d) {
|
|
2424
2475
|
if (!vt[s] && oo(s) && Ut(W.tagNameCheck, s)) return !1;
|
|
2425
2476
|
if (ne && !dt[s]) {
|
|
2426
|
-
const p = N(n), h =
|
|
2477
|
+
const p = N(n), h = O(n);
|
|
2427
2478
|
if (h && p) {
|
|
2428
|
-
const
|
|
2429
|
-
for (let
|
|
2430
|
-
const S = n === d ?
|
|
2479
|
+
const b = h.length;
|
|
2480
|
+
for (let y = b - 1; y >= 0; --y) {
|
|
2481
|
+
const S = n === d ? k(h[y], !0) : h[y];
|
|
2431
2482
|
p.insertBefore(S, Y(n));
|
|
2432
2483
|
}
|
|
2433
2484
|
}
|
|
2434
2485
|
}
|
|
2435
2486
|
return X(n), !0;
|
|
2436
2487
|
}, Qe = function(n, s, d, p) {
|
|
2437
|
-
return n.length === 0 ? s : s === d || s === p ?
|
|
2488
|
+
return n.length === 0 ? s : s === d || s === p ? F(s) : s;
|
|
2438
2489
|
}, ht = function(n, s) {
|
|
2439
|
-
return n === s || N(n) !== null ? !1 : (ie &&
|
|
2490
|
+
return n === s || N(n) !== null ? !1 : (ie && Ht(n), !0);
|
|
2440
2491
|
}, to = function(n, s) {
|
|
2441
|
-
if (G(
|
|
2442
|
-
if (
|
|
2492
|
+
if (G(x.beforeSanitizeElements, n, null), ht(n, s)) return !0;
|
|
2493
|
+
if (Ft(n))
|
|
2443
2494
|
return X(n), !0;
|
|
2444
2495
|
const d = _(Vt(n));
|
|
2445
|
-
if (
|
|
2496
|
+
if (A = Qe(x.uponSanitizeElement, A, Jt, It), G(x.uponSanitizeElement, n, {
|
|
2446
2497
|
tagName: d,
|
|
2447
|
-
allowedTags:
|
|
2498
|
+
allowedTags: A
|
|
2448
2499
|
}), ht(n, s)) return !0;
|
|
2449
2500
|
if (on(n, d))
|
|
2450
2501
|
return X(n), !0;
|
|
2451
|
-
if (vt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !
|
|
2502
|
+
if (vt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !A[d]) {
|
|
2452
2503
|
const p = nn(n, d, s);
|
|
2453
|
-
return p === !1 && (G(
|
|
2504
|
+
return p === !1 && (G(x.afterSanitizeElements, n, null), ht(n, s)) ? !0 : p;
|
|
2454
2505
|
}
|
|
2455
|
-
if (yt(n) ===
|
|
2506
|
+
if (yt(n) === B.element && !Qo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && D(Vn, n.innerHTML))
|
|
2456
2507
|
return X(n), !0;
|
|
2457
|
-
if (V && n.nodeType ===
|
|
2458
|
-
const p =
|
|
2508
|
+
if (V && n.nodeType === B.text) {
|
|
2509
|
+
const p = Bt(n.textContent);
|
|
2459
2510
|
n.textContent !== p && (kt(t.removed, { element: n.cloneNode() }), n.textContent = p);
|
|
2460
2511
|
}
|
|
2461
|
-
return G(
|
|
2512
|
+
return G(x.afterSanitizeElements, n, null), ht(n, s);
|
|
2462
2513
|
}, eo = function(n, s, d) {
|
|
2463
|
-
if (
|
|
2464
|
-
const p =
|
|
2465
|
-
return te &&
|
|
2466
|
-
}, rn =
|
|
2514
|
+
if (De[s] || Xe(s, n) || Pe && (s === "id" || s === "name") && (d in e || d in Vo)) return !1;
|
|
2515
|
+
const p = C[s] || q.attributeCheck instanceof Function && q.attributeCheck(s, n);
|
|
2516
|
+
return te && D(Uo, s) || Oe && D(jo, s) ? !0 : p ? je[s] || D(Ie, xt(d, Me, "")) || (s === "src" || s === "xlink:href" || s === "href") && n !== "script" && co(d, "data:") === 0 && Fe[n] || Re && !D(Wo, xt(d, Me, "")) ? !0 : !d : oo(n) && Ut(W.tagNameCheck, n) && Ut(W.attributeNameCheck, s, n) || s === "is" && W.allowCustomizedBuiltInElements && Ut(W.tagNameCheck, d);
|
|
2517
|
+
}, rn = E({}, [
|
|
2467
2518
|
"annotation-xml",
|
|
2468
2519
|
"color-profile",
|
|
2469
2520
|
"font-face",
|
|
@@ -2473,72 +2524,72 @@ function Mo() {
|
|
|
2473
2524
|
"font-face-uri",
|
|
2474
2525
|
"missing-glyph"
|
|
2475
2526
|
]), oo = function(n) {
|
|
2476
|
-
return !rn[_t(n)] &&
|
|
2527
|
+
return !rn[_t(n)] && D($o, n);
|
|
2477
2528
|
}, an = function(n, s, d, p) {
|
|
2478
|
-
if (P && typeof
|
|
2529
|
+
if (P && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n, s)) {
|
|
2479
2530
|
case "TrustedHTML":
|
|
2480
2531
|
return st(p);
|
|
2481
2532
|
case "TrustedScriptURL":
|
|
2482
|
-
return
|
|
2533
|
+
return Oo(p);
|
|
2483
2534
|
}
|
|
2484
2535
|
return p;
|
|
2485
2536
|
}, sn = function(n, s, d, p) {
|
|
2486
2537
|
try {
|
|
2487
|
-
return d ? n.setAttributeNS(d, s, p) : n.setAttribute(s, p),
|
|
2538
|
+
return d ? n.setAttributeNS(d, s, p) : n.setAttribute(s, p), Ft(n) ? (X(n), !1) : !0;
|
|
2488
2539
|
} catch (h) {
|
|
2489
2540
|
return it(s, n), !1;
|
|
2490
2541
|
}
|
|
2491
2542
|
}, no = function(n, s) {
|
|
2492
|
-
if (G(
|
|
2543
|
+
if (G(x.beforeSanitizeAttributes, n, null), ht(n, s)) return;
|
|
2493
2544
|
const d = n.attributes;
|
|
2494
|
-
if (!d ||
|
|
2495
|
-
|
|
2545
|
+
if (!d || Ft(n)) return;
|
|
2546
|
+
C = Qe(x.uponSanitizeAttribute, C, Qt, Dt);
|
|
2496
2547
|
const p = {
|
|
2497
2548
|
attrName: "",
|
|
2498
2549
|
attrValue: "",
|
|
2499
2550
|
keepAttr: !0,
|
|
2500
|
-
allowedAttributes:
|
|
2551
|
+
allowedAttributes: C,
|
|
2501
2552
|
forceKeepAttr: void 0
|
|
2502
2553
|
};
|
|
2503
2554
|
let h = d.length;
|
|
2504
|
-
const
|
|
2555
|
+
const b = _(n.nodeName);
|
|
2505
2556
|
for (; h--; ) {
|
|
2506
|
-
const
|
|
2557
|
+
const y = d[h], S = y.name, U = y.namespaceURI, H = y.value, mt = _(S), pe = H;
|
|
2507
2558
|
let R = S === "value" ? pe : In(pe), io = !1;
|
|
2508
|
-
if (p.attrName = mt, p.attrValue = R, p.keepAttr = !0, p.forceKeepAttr = void 0, G(
|
|
2509
|
-
it(S, n,
|
|
2559
|
+
if (p.attrName = mt, p.attrValue = R, p.keepAttr = !0, p.forceKeepAttr = void 0, G(x.uponSanitizeAttribute, n, p), R = p.attrValue, ze && (mt === "id" || mt === "name") && co(R, He) !== 0 && (it(S, n, y), R = He + R, io = !0), ot && D(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
|
|
2560
|
+
it(S, n, y);
|
|
2510
2561
|
continue;
|
|
2511
2562
|
}
|
|
2512
2563
|
if (mt === "attributename" && lo(R, "href")) {
|
|
2513
|
-
it(S, n,
|
|
2564
|
+
it(S, n, y);
|
|
2514
2565
|
continue;
|
|
2515
2566
|
}
|
|
2516
2567
|
if (!p.forceKeepAttr) {
|
|
2517
2568
|
if (!p.keepAttr) {
|
|
2518
|
-
it(S, n,
|
|
2569
|
+
it(S, n, y);
|
|
2519
2570
|
continue;
|
|
2520
2571
|
}
|
|
2521
|
-
if (!Ne &&
|
|
2522
|
-
it(S, n,
|
|
2572
|
+
if (!Ne && D(Xn, R)) {
|
|
2573
|
+
it(S, n, y);
|
|
2523
2574
|
continue;
|
|
2524
2575
|
}
|
|
2525
|
-
if (V && (R =
|
|
2526
|
-
it(S, n,
|
|
2576
|
+
if (V && (R = Bt(R)), !eo(b, mt, R)) {
|
|
2577
|
+
it(S, n, y);
|
|
2527
2578
|
continue;
|
|
2528
2579
|
}
|
|
2529
|
-
R = an(
|
|
2580
|
+
R = an(b, mt, U, R), R !== pe && sn(n, S, U, R) && io && so(t.removed);
|
|
2530
2581
|
}
|
|
2531
2582
|
}
|
|
2532
|
-
G(
|
|
2583
|
+
G(x.afterSanitizeAttributes, n, null), ht(n, s);
|
|
2533
2584
|
}, jt = function(n) {
|
|
2534
2585
|
let s = null;
|
|
2535
2586
|
const d = Je(n);
|
|
2536
|
-
for (G(
|
|
2537
|
-
if (G(
|
|
2587
|
+
for (G(x.beforeSanitizeShadowDOM, n, null); s = d.nextNode(); )
|
|
2588
|
+
if (G(x.uponSanitizeShadowNode, s, null), to(s, n), no(s, n), ft(s.content) && jt(s.content), yt(s) === B.element) {
|
|
2538
2589
|
const p = Ce(s);
|
|
2539
2590
|
ft(p) && (ue(p), jt(p));
|
|
2540
2591
|
}
|
|
2541
|
-
G(
|
|
2592
|
+
G(x.afterSanitizeShadowDOM, n, null);
|
|
2542
2593
|
}, ue = function(n) {
|
|
2543
2594
|
const s = [{
|
|
2544
2595
|
node: n,
|
|
@@ -2550,14 +2601,14 @@ function Mo() {
|
|
|
2550
2601
|
jt(d.shadow);
|
|
2551
2602
|
continue;
|
|
2552
2603
|
}
|
|
2553
|
-
const p = d.node, h = yt(p) ===
|
|
2554
|
-
if (
|
|
2555
|
-
node:
|
|
2604
|
+
const p = d.node, h = yt(p) === B.element, b = O(p);
|
|
2605
|
+
if (b) for (let y = b.length - 1; y >= 0; --y) s.push({
|
|
2606
|
+
node: b[y],
|
|
2556
2607
|
shadow: null
|
|
2557
2608
|
});
|
|
2558
2609
|
if (h) {
|
|
2559
|
-
const
|
|
2560
|
-
if (typeof
|
|
2610
|
+
const y = at ? at(p) : null;
|
|
2611
|
+
if (typeof y == "string" && _(y) === "template") {
|
|
2561
2612
|
const S = p.content;
|
|
2562
2613
|
ft(S) && s.push({
|
|
2563
2614
|
node: S,
|
|
@@ -2566,12 +2617,12 @@ function Mo() {
|
|
|
2566
2617
|
}
|
|
2567
2618
|
}
|
|
2568
2619
|
if (h) {
|
|
2569
|
-
const
|
|
2570
|
-
ft(
|
|
2620
|
+
const y = Ce(p);
|
|
2621
|
+
ft(y) && s.push({
|
|
2571
2622
|
node: null,
|
|
2572
|
-
shadow:
|
|
2623
|
+
shadow: y
|
|
2573
2624
|
}, {
|
|
2574
|
-
node:
|
|
2625
|
+
node: y,
|
|
2575
2626
|
shadow: null
|
|
2576
2627
|
});
|
|
2577
2628
|
}
|
|
@@ -2582,79 +2633,79 @@ function Mo() {
|
|
|
2582
2633
|
if (re = !u, re && (u = "<!-->"), typeof u != "string" && !Tt(u) && (u = Pn(u), typeof u != "string"))
|
|
2583
2634
|
throw Z("dirty is not a string, aborting");
|
|
2584
2635
|
if (!t.isSupported) return u;
|
|
2585
|
-
ee ? (
|
|
2586
|
-
const
|
|
2587
|
-
if (
|
|
2636
|
+
ee ? (A = It, C = Dt) : ce(n), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (A = F(A)), x.uponSanitizeAttribute.length > 0 && (C = F(C)), t.removed = [];
|
|
2637
|
+
const b = ie && typeof u != "string" && Tt(u);
|
|
2638
|
+
if (b) {
|
|
2588
2639
|
en(u);
|
|
2589
2640
|
const U = Vt(u);
|
|
2590
2641
|
if (typeof U == "string") {
|
|
2591
|
-
const
|
|
2592
|
-
if (!
|
|
2642
|
+
const H = _(U);
|
|
2643
|
+
if (!A[H] || vt[H])
|
|
2593
2644
|
throw zt(u), Z("root node is forbidden and cannot be sanitized in-place");
|
|
2594
2645
|
}
|
|
2595
|
-
if (
|
|
2646
|
+
if (Ft(u))
|
|
2596
2647
|
throw zt(u), Z("root node is clobbered and cannot be sanitized in-place");
|
|
2597
2648
|
try {
|
|
2598
2649
|
ue(u);
|
|
2599
|
-
} catch (
|
|
2600
|
-
throw zt(u),
|
|
2650
|
+
} catch (H) {
|
|
2651
|
+
throw zt(u), H;
|
|
2601
2652
|
}
|
|
2602
2653
|
} else if (Tt(u))
|
|
2603
|
-
s = Ze("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType ===
|
|
2654
|
+
s = Ze("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType === B.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? s = d : s.appendChild(d), ue(s);
|
|
2604
2655
|
else {
|
|
2605
2656
|
if (!lt && !V && !nt && u.indexOf("<") === -1) return P && Rt ? st(u) : u;
|
|
2606
2657
|
if (s = Ze(u), !s) return lt ? null : Rt ? et : "";
|
|
2607
2658
|
}
|
|
2608
2659
|
s && oe && X(s.firstChild);
|
|
2609
|
-
const
|
|
2660
|
+
const y = b ? u : s;
|
|
2610
2661
|
try {
|
|
2611
|
-
const U = Je(
|
|
2662
|
+
const U = Je(y);
|
|
2612
2663
|
for (; p = U.nextNode(); )
|
|
2613
|
-
to(p,
|
|
2664
|
+
to(p, y), no(p, y), ft(p.content) && jt(p.content);
|
|
2614
2665
|
} catch (U) {
|
|
2615
|
-
throw
|
|
2616
|
-
|
|
2666
|
+
throw b && (zt(u), rt(t.removed, (H) => {
|
|
2667
|
+
H.element && Ht(H.element);
|
|
2617
2668
|
})), U;
|
|
2618
2669
|
}
|
|
2619
|
-
if (
|
|
2670
|
+
if (b) {
|
|
2620
2671
|
let U = !1;
|
|
2621
|
-
if (rt(t.removed, (
|
|
2622
|
-
|
|
2672
|
+
if (rt(t.removed, (H) => {
|
|
2673
|
+
H.element && (H.element === u && (U = !0), Ht(H.element));
|
|
2623
2674
|
}), U) throw Z("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
2624
2675
|
return V && de(u), u;
|
|
2625
2676
|
}
|
|
2626
2677
|
if (lt) {
|
|
2627
|
-
if (V && de(s),
|
|
2678
|
+
if (V && de(s), Ot)
|
|
2628
2679
|
for (h = No.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
|
|
2629
2680
|
else h = s;
|
|
2630
|
-
return (
|
|
2681
|
+
return (C.shadowroot || C.shadowrootmode) && (h = zo.call(o, h, !0)), h;
|
|
2631
2682
|
}
|
|
2632
2683
|
let S = nt ? s.outerHTML : s.innerHTML;
|
|
2633
|
-
return nt &&
|
|
2634
|
-
` + S), V && (S =
|
|
2684
|
+
return nt && A["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && D(Yn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
|
|
2685
|
+
` + S), V && (S = Bt(S)), P && Rt ? st(S) : S;
|
|
2635
2686
|
}, t.setConfig = function() {
|
|
2636
2687
|
let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2637
|
-
ce(u), ee = !0, It =
|
|
2688
|
+
ce(u), ee = !0, It = A, Dt = C;
|
|
2638
2689
|
}, t.clearConfig = function() {
|
|
2639
|
-
pt = null, ee = !1, It = null,
|
|
2690
|
+
pt = null, ee = !1, It = null, Dt = null, P = Xt, et = "";
|
|
2640
2691
|
}, t.isValidAttribute = function(u, n, s) {
|
|
2641
2692
|
pt || ce({});
|
|
2642
2693
|
const d = _(u), p = _(n);
|
|
2643
2694
|
return eo(d, p, s);
|
|
2644
2695
|
}, t.addHook = function(u, n) {
|
|
2645
|
-
typeof n == "function" && z(
|
|
2696
|
+
typeof n == "function" && z(x, u) && kt(x[u], n);
|
|
2646
2697
|
}, t.removeHook = function(u, n) {
|
|
2647
|
-
if (z(
|
|
2698
|
+
if (z(x, u)) {
|
|
2648
2699
|
if (n !== void 0) {
|
|
2649
|
-
const s = Ln(
|
|
2650
|
-
return s === -1 ? void 0 : Mn(
|
|
2700
|
+
const s = Ln(x[u], n);
|
|
2701
|
+
return s === -1 ? void 0 : Mn(x[u], s, 1)[0];
|
|
2651
2702
|
}
|
|
2652
|
-
return so(
|
|
2703
|
+
return so(x[u]);
|
|
2653
2704
|
}
|
|
2654
2705
|
}, t.removeHooks = function(u) {
|
|
2655
|
-
z(
|
|
2706
|
+
z(x, u) && (x[u] = []);
|
|
2656
2707
|
}, t.removeAllHooks = function() {
|
|
2657
|
-
|
|
2708
|
+
x = vo();
|
|
2658
2709
|
}, t;
|
|
2659
2710
|
}
|
|
2660
2711
|
var $t = Mo();
|
|
@@ -2735,22 +2786,22 @@ function Io(a, t, e, o) {
|
|
|
2735
2786
|
if ((t == null ? void 0 : t.sanitize) === !1)
|
|
2736
2787
|
return a;
|
|
2737
2788
|
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ei, r = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...i, ...e])) : i, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : oi, f = /* @__PURE__ */ new Set();
|
|
2738
|
-
for (const
|
|
2739
|
-
for (const
|
|
2789
|
+
for (const T of Object.values(c))
|
|
2790
|
+
for (const k of T) f.add(k);
|
|
2740
2791
|
const m = {
|
|
2741
2792
|
ALLOWED_TAGS: r,
|
|
2742
2793
|
ALLOWED_ATTR: Array.from(f)
|
|
2743
2794
|
};
|
|
2744
2795
|
if (!o)
|
|
2745
2796
|
return $t.sanitize(a, m);
|
|
2746
|
-
const
|
|
2797
|
+
const g = r.includes("iframe");
|
|
2747
2798
|
$t.addHook(
|
|
2748
2799
|
"uponSanitizeElement",
|
|
2749
|
-
(
|
|
2750
|
-
var
|
|
2751
|
-
if (
|
|
2752
|
-
const w =
|
|
2753
|
-
|
|
2800
|
+
(T, k) => {
|
|
2801
|
+
var v;
|
|
2802
|
+
if (k.tagName !== "iframe") return;
|
|
2803
|
+
const w = T;
|
|
2804
|
+
k.allowedTags.iframe = g || ((v = w.getAttribute) == null ? void 0 : v.call(w, ni)) === "true" && ii(w.getAttribute("src"));
|
|
2754
2805
|
}
|
|
2755
2806
|
);
|
|
2756
2807
|
try {
|
|
@@ -2769,7 +2820,7 @@ function wo(a, t, e, o) {
|
|
|
2769
2820
|
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : Io(a, t, o, !0);
|
|
2770
2821
|
}
|
|
2771
2822
|
const si = ".resize-handle, .table-resize-handle", li = /resize-handle/;
|
|
2772
|
-
function
|
|
2823
|
+
function Do(a) {
|
|
2773
2824
|
if (!a || !li.test(a)) return a;
|
|
2774
2825
|
const t = document.createElement("template");
|
|
2775
2826
|
t.innerHTML = a;
|
|
@@ -2783,7 +2834,7 @@ function Oo(a) {
|
|
|
2783
2834
|
}), t.innerHTML;
|
|
2784
2835
|
}
|
|
2785
2836
|
function Ct(a) {
|
|
2786
|
-
return a ?
|
|
2837
|
+
return a ? Do(a.innerHTML) : "";
|
|
2787
2838
|
}
|
|
2788
2839
|
const Yt = class Yt {
|
|
2789
2840
|
/**
|
|
@@ -3125,7 +3176,7 @@ function bi() {
|
|
|
3125
3176
|
}
|
|
3126
3177
|
class K extends HTMLElement {
|
|
3127
3178
|
constructor() {
|
|
3128
|
-
if (super(), this.pluginLoader = bi(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new vn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.lastBeforeInputType = null, gi(), !this.hasAttribute("data-initial-content")) {
|
|
3179
|
+
if (super(), this.pluginLoader = bi(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new vn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, gi(), !this.hasAttribute("data-initial-content")) {
|
|
3129
3180
|
const t = this.innerHTML.trim();
|
|
3130
3181
|
t && this.setAttribute("data-initial-content", t);
|
|
3131
3182
|
}
|
|
@@ -3586,8 +3637,8 @@ class K extends HTMLElement {
|
|
|
3586
3637
|
this.contentElement.focus();
|
|
3587
3638
|
const f = window.getSelection();
|
|
3588
3639
|
if (!f || f.rangeCount === 0 || !this.contentElement.contains(f.anchorNode)) {
|
|
3589
|
-
const m = document.createRange(),
|
|
3590
|
-
|
|
3640
|
+
const m = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
|
|
3641
|
+
g.nodeType === Node.TEXT_NODE ? m.setStart(g, ((c = g.textContent) == null ? void 0 : c.length) || 0) : g.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(g), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0), f == null || f.removeAllRanges(), f == null || f.addRange(m);
|
|
3591
3642
|
}
|
|
3592
3643
|
}
|
|
3593
3644
|
return this.executeCommand(r, l);
|
|
@@ -3613,6 +3664,20 @@ class K extends HTMLElement {
|
|
|
3613
3664
|
return (r = this.contentElement) == null ? void 0 : r.focus();
|
|
3614
3665
|
}, 0);
|
|
3615
3666
|
}
|
|
3667
|
+
/**
|
|
3668
|
+
* Hands what a keystroke changed to the history plugin, so Undo takes back typing. Without this the
|
|
3669
|
+
* plugin only knew about changes that plugins reported themselves, and typed text could not be undone.
|
|
3670
|
+
*/
|
|
3671
|
+
recordInputHistory(t) {
|
|
3672
|
+
const e = this.pendingHistorySnapshot;
|
|
3673
|
+
if (this.pendingHistorySnapshot = null, !e || !this.contentElement || e.beforeHTML === t) return;
|
|
3674
|
+
const o = window.execEditorCommand;
|
|
3675
|
+
typeof o == "function" && o("recordDomTransaction", this.contentElement, e.beforeHTML, t, {
|
|
3676
|
+
inputType: e.inputType,
|
|
3677
|
+
data: e.data,
|
|
3678
|
+
selectionCollapsed: e.selectionCollapsed
|
|
3679
|
+
});
|
|
3680
|
+
}
|
|
3616
3681
|
/**
|
|
3617
3682
|
* Setup event listeners
|
|
3618
3683
|
*/
|
|
@@ -3620,43 +3685,49 @@ class K extends HTMLElement {
|
|
|
3620
3685
|
if (!this.contentElement || !this.engine) return;
|
|
3621
3686
|
const t = this.keyboardShortcutManager;
|
|
3622
3687
|
this.contentElement.addEventListener("beforeinput", (o) => {
|
|
3623
|
-
|
|
3688
|
+
var i, r;
|
|
3689
|
+
this.lastBeforeInputType = o.inputType || null, o.inputType === "historyUndo" || o.inputType === "historyRedo" ? this.pendingHistorySnapshot = null : this.contentElement && (this.pendingHistorySnapshot = {
|
|
3690
|
+
beforeHTML: this.contentElement.innerHTML,
|
|
3691
|
+
inputType: o.inputType || null,
|
|
3692
|
+
data: typeof o.data == "string" ? o.data : null,
|
|
3693
|
+
selectionCollapsed: (r = (i = window.getSelection()) == null ? void 0 : i.isCollapsed) != null ? r : !0
|
|
3694
|
+
});
|
|
3624
3695
|
}), this.contentElement.addEventListener("input", (o) => {
|
|
3625
|
-
var
|
|
3696
|
+
var k;
|
|
3626
3697
|
if (!this.contentElement) return;
|
|
3627
3698
|
let i = this.contentElement.innerHTML;
|
|
3628
|
-
const r = (
|
|
3699
|
+
const r = (k = o == null ? void 0 : o.detail) == null ? void 0 : k.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = this.lastBeforeInputType;
|
|
3629
3700
|
if (this.lastBeforeInputType = null, f.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
|
|
3630
3701
|
const w = wo(i, c, f, r);
|
|
3631
3702
|
if (w !== i) {
|
|
3632
|
-
const
|
|
3633
|
-
if (this.contentElement.innerHTML = w, Y &&
|
|
3703
|
+
const v = window.getSelection(), Y = v && v.rangeCount > 0 ? v.getRangeAt(0) : null;
|
|
3704
|
+
if (this.contentElement.innerHTML = w, Y && v)
|
|
3634
3705
|
try {
|
|
3635
|
-
|
|
3636
|
-
} catch (
|
|
3706
|
+
v.removeAllRanges(), v.addRange(Y);
|
|
3707
|
+
} catch (O) {
|
|
3637
3708
|
}
|
|
3638
3709
|
i = w;
|
|
3639
3710
|
}
|
|
3640
3711
|
}
|
|
3641
|
-
this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
|
|
3642
|
-
const
|
|
3712
|
+
this.recordInputHistory(i), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
|
|
3713
|
+
const T = () => {
|
|
3643
3714
|
this.dispatchEvent(new CustomEvent("content-change", {
|
|
3644
|
-
detail: { html:
|
|
3715
|
+
detail: { html: Do(i) },
|
|
3645
3716
|
bubbles: !0
|
|
3646
3717
|
}));
|
|
3647
3718
|
};
|
|
3648
|
-
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(
|
|
3719
|
+
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(T, l.debounceInputMs) : T(), this.updateStatusBar();
|
|
3649
3720
|
}), this.contentElement.addEventListener("contextmenu", (o) => {
|
|
3650
3721
|
const i = this.config.contextMenu;
|
|
3651
3722
|
(i === !1 || typeof i == "object" && i !== null && i.enabled === !1) && o.preventDefault();
|
|
3652
3723
|
}), this.contentElement.addEventListener("paste", (o) => {
|
|
3653
|
-
var
|
|
3724
|
+
var g, T;
|
|
3654
3725
|
if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
|
|
3655
3726
|
return;
|
|
3656
3727
|
o.preventDefault();
|
|
3657
3728
|
const i = this.config.paste || {};
|
|
3658
|
-
let r = ((
|
|
3659
|
-
const l = ((
|
|
3729
|
+
let r = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
|
|
3730
|
+
const l = ((T = o.clipboardData) == null ? void 0 : T.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
|
|
3660
3731
|
if ((i.clean || !i.keepFormatting) && l) {
|
|
3661
3732
|
document.execCommand("insertText", !1, l);
|
|
3662
3733
|
return;
|
|
@@ -3919,11 +3990,11 @@ const yi = {
|
|
|
3919
3990
|
underline: () => import("./UnderlinePlugin.native-DZzg23rv.mjs").then((a) => a.UnderlinePlugin()),
|
|
3920
3991
|
strikethrough: () => import("./StrikethroughPlugin.native-V0TL4F48.mjs").then((a) => a.StrikethroughPlugin()),
|
|
3921
3992
|
clearFormatting: () => import("./ClearFormattingPlugin.native-Pp0O-SBf.mjs").then((a) => a.ClearFormattingPlugin()),
|
|
3922
|
-
heading: () => import("./HeadingPlugin.native-
|
|
3993
|
+
heading: () => import("./HeadingPlugin.native-C3YiGERx.mjs").then((a) => a.HeadingPlugin()),
|
|
3923
3994
|
blockquote: () => import("./BlockquotePlugin.native-D8jjGd0c.mjs").then((a) => a.BlockquotePlugin()),
|
|
3924
|
-
code: () => import("./CodePlugin.native-
|
|
3925
|
-
list: () => import("./ListPlugin.native-
|
|
3926
|
-
history: () => import("./HistoryPlugin.native-
|
|
3995
|
+
code: () => import("./CodePlugin.native-CPfKDrkr.mjs").then((a) => a.CodePlugin()),
|
|
3996
|
+
list: () => import("./ListPlugin.native-UYaoRiub.mjs").then((a) => a.ListPlugin()),
|
|
3997
|
+
history: () => import("./HistoryPlugin.native-C8GyxsgC.mjs").then((a) => a.HistoryPlugin())
|
|
3927
3998
|
};
|
|
3928
3999
|
async function Ei() {
|
|
3929
4000
|
return Object.entries(yi).forEach(([a, t]) => {
|