@editora/core 1.0.18 → 1.0.19
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/dist/{CodePlugin.native-BH-K4xmW.mjs → CodePlugin.native-BcVqm5MS.mjs} +64 -65
- package/dist/{CodePlugin.native-hNgfXlfS.mjs → CodePlugin.native-Rgxx2Igx.mjs} +2708 -1225
- package/dist/{DocumentManagerPlugin.native-iFip6s4Q.mjs → DocumentManagerPlugin.native-B8K-Oqom.mjs} +12 -11
- package/dist/{PreviewPlugin.native-CiR51jql.mjs → PreviewPlugin.native-Dyht8mGi.mjs} +48 -51
- package/dist/{TablePlugin.native-BjIxYZ2X.mjs → TablePlugin.native-C1YZ372P.mjs} +156 -147
- package/dist/TemplatePlugin.native-BDV2eik2.mjs +628 -0
- package/dist/{documentManager-BcBIv5P-.mjs → documentManager-BWK_-KJp.mjs} +524 -526
- package/dist/editora.min.js +17 -17
- package/dist/editora.umd.js +17 -17
- package/dist/index-CclXYzUB.js +12 -0
- package/dist/{index-XsYC_KdJ.mjs → index-DeUjxpKd.mjs} +406 -386
- package/dist/index.cjs.js +4 -4
- package/dist/index.esm.js +19 -16
- package/dist/plugin-loader.js +4 -4
- package/dist/purify.es-BHa5gZB7.mjs +1481 -0
- package/dist/sanitizeHtml-DA0ajC6k.mjs +17 -0
- package/dist/webcomponent-core.js +376 -362
- package/dist/webcomponent-core.min.js +91 -89
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +2 -2
- package/dist/webcomponent.js +382 -368
- package/dist/webcomponent.min.js +968 -967
- package/index.d.ts +9 -0
- package/package.json +1 -1
- package/dist/TemplatePlugin.native-D6n5RUnC.mjs +0 -1176
- package/dist/index-_eKRBZPq.js +0 -12
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
class
|
|
1
|
+
class Kt {
|
|
2
2
|
constructor(t, e, o) {
|
|
3
3
|
this.doc = t, this.selection = e, this.schema = o;
|
|
4
4
|
}
|
|
5
5
|
static create(t, e) {
|
|
6
6
|
const o = e || t.node("doc", {}, [t.node("paragraph")]);
|
|
7
|
-
return new
|
|
7
|
+
return new Kt(o, { anchor: 0, head: 0 }, t);
|
|
8
8
|
}
|
|
9
9
|
apply(t, e) {
|
|
10
|
-
return new
|
|
10
|
+
return new Kt(t, e || this.selection, this.schema);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
class
|
|
13
|
+
class ln {
|
|
14
14
|
constructor(t, e) {
|
|
15
15
|
this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
|
|
16
16
|
}
|
|
@@ -21,7 +21,7 @@ class rn {
|
|
|
21
21
|
return { type: "text", text: t, marks: e };
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
class
|
|
24
|
+
class Co {
|
|
25
25
|
constructor() {
|
|
26
26
|
this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
|
|
27
27
|
}
|
|
@@ -58,7 +58,7 @@ class an {
|
|
|
58
58
|
const t = {}, e = {};
|
|
59
59
|
return this.plugins.forEach((o) => {
|
|
60
60
|
o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
|
|
61
|
-
}), new
|
|
61
|
+
}), new ln(t, e);
|
|
62
62
|
}
|
|
63
63
|
getCommands() {
|
|
64
64
|
const t = {};
|
|
@@ -112,7 +112,10 @@ class an {
|
|
|
112
112
|
await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
function gi() {
|
|
116
|
+
return new Co();
|
|
117
|
+
}
|
|
118
|
+
class cn {
|
|
116
119
|
constructor(t) {
|
|
117
120
|
this.shortcuts = /* @__PURE__ */ new Map(), this.enabled = !0, this.isMac = typeof navigator != "undefined" && navigator.platform.toUpperCase().indexOf("MAC") >= 0, (t == null ? void 0 : t.enabled) === !1 && (this.enabled = !1), this.registerDefaultShortcuts(), t != null && t.shortcuts && t.shortcuts.forEach((e) => this.registerShortcut(e)), t != null && t.customShortcuts && Object.values(t.customShortcuts).forEach((e) => {
|
|
118
121
|
this.registerShortcut(e);
|
|
@@ -447,7 +450,7 @@ class sn {
|
|
|
447
450
|
return t.includes("toggle") && (t.includes("Bold") || t.includes("Italic") || t.includes("Underline") || t.includes("Strike") || t.includes("Code") || t.includes("Super") || t.includes("Sub")) ? "Text Formatting" : t.includes("Heading") || t.includes("Paragraph") ? "Block Formatting" : t.includes("List") || t.includes("Checklist") ? "Lists" : t.includes("Alignment") || t.includes("Indent") ? "Alignment & Indentation" : t.includes("undo") || t.includes("redo") ? "History" : t.includes("insert") ? "Insert" : t.includes("find") || t.includes("replace") ? "Find & Replace" : t.includes("Accessibility") || t.includes("spell") ? "Tools" : "Other";
|
|
448
451
|
}
|
|
449
452
|
}
|
|
450
|
-
class
|
|
453
|
+
class dn {
|
|
451
454
|
constructor(t = {}) {
|
|
452
455
|
this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
|
|
453
456
|
this.register(e, o);
|
|
@@ -490,11 +493,11 @@ class ln {
|
|
|
490
493
|
this.commands.clear();
|
|
491
494
|
}
|
|
492
495
|
}
|
|
493
|
-
class
|
|
496
|
+
class un {
|
|
494
497
|
constructor(t = {}) {
|
|
495
|
-
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new
|
|
498
|
+
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new Co(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
|
|
496
499
|
const e = this.pluginManager.buildSchema();
|
|
497
|
-
this.state =
|
|
500
|
+
this.state = Kt.create(e), this.commandRegistry = new dn(this.pluginManager.getCommands());
|
|
498
501
|
}
|
|
499
502
|
/**
|
|
500
503
|
* Execute a command
|
|
@@ -576,7 +579,7 @@ class cn {
|
|
|
576
579
|
return this.isDestroyed;
|
|
577
580
|
}
|
|
578
581
|
}
|
|
579
|
-
class
|
|
582
|
+
class fn {
|
|
580
583
|
constructor(t, e, o) {
|
|
581
584
|
this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (i) => {
|
|
582
585
|
var l, c;
|
|
@@ -707,16 +710,16 @@ class dn {
|
|
|
707
710
|
});
|
|
708
711
|
return;
|
|
709
712
|
}
|
|
710
|
-
const
|
|
711
|
-
let
|
|
712
|
-
|
|
713
|
+
const C = l[E] || E;
|
|
714
|
+
let A = r.get(C);
|
|
715
|
+
A || (A = r.get(E)), A && p.push({
|
|
713
716
|
id: E,
|
|
714
|
-
label:
|
|
715
|
-
command:
|
|
716
|
-
icon:
|
|
717
|
-
type:
|
|
718
|
-
options:
|
|
719
|
-
items:
|
|
717
|
+
label: A.label,
|
|
718
|
+
command: A.command,
|
|
719
|
+
icon: A.icon,
|
|
720
|
+
type: A.type === "separator" ? "separator" : A.type || "button",
|
|
721
|
+
options: A.options,
|
|
722
|
+
items: A.items
|
|
720
723
|
});
|
|
721
724
|
}), p.length > 0 && e.push(p);
|
|
722
725
|
}), e;
|
|
@@ -764,11 +767,11 @@ class dn {
|
|
|
764
767
|
var N;
|
|
765
768
|
D.parentElement === i && ((N = this.overflowUnitHomes.get(D)) == null || N.appendChild(D));
|
|
766
769
|
});
|
|
767
|
-
const p = t.clientWidth, m = 16, E = 40,
|
|
770
|
+
const p = t.clientWidth, m = 16, E = 40, C = 4, A = Math.max(0, p - m - E - C);
|
|
768
771
|
let w = 0, v = 0;
|
|
769
772
|
for (const D of c) {
|
|
770
|
-
const N = D.getBoundingClientRect().width +
|
|
771
|
-
if (w + N <=
|
|
773
|
+
const N = D.getBoundingClientRect().width + C;
|
|
774
|
+
if (w + N <= A)
|
|
772
775
|
w += N, v++;
|
|
773
776
|
else
|
|
774
777
|
break;
|
|
@@ -951,7 +954,7 @@ class dn {
|
|
|
951
954
|
}), 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;
|
|
952
955
|
}
|
|
953
956
|
}
|
|
954
|
-
class
|
|
957
|
+
class pn {
|
|
955
958
|
constructor(t) {
|
|
956
959
|
this.visible = !1, this.config = t;
|
|
957
960
|
}
|
|
@@ -993,7 +996,7 @@ class un {
|
|
|
993
996
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
|
|
994
997
|
}
|
|
995
998
|
}
|
|
996
|
-
class
|
|
999
|
+
class hn {
|
|
997
1000
|
constructor(t = {}) {
|
|
998
1001
|
this.statusInfo = {}, this.config = t;
|
|
999
1002
|
}
|
|
@@ -1053,12 +1056,12 @@ class fn {
|
|
|
1053
1056
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
|
|
1054
1057
|
}
|
|
1055
1058
|
}
|
|
1056
|
-
function
|
|
1057
|
-
const e = s.textContent || "", o =
|
|
1059
|
+
function mn(s, t) {
|
|
1060
|
+
const e = s.textContent || "", o = gn(s, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
|
|
1058
1061
|
`), l = r.length, c = r[r.length - 1].length + 1;
|
|
1059
1062
|
return { line: l, column: c };
|
|
1060
1063
|
}
|
|
1061
|
-
function
|
|
1064
|
+
function gn(s, t, e) {
|
|
1062
1065
|
var l;
|
|
1063
1066
|
let o = 0;
|
|
1064
1067
|
const i = document.createTreeWalker(
|
|
@@ -1076,7 +1079,7 @@ function hn(s, t, e) {
|
|
|
1076
1079
|
}
|
|
1077
1080
|
return o;
|
|
1078
1081
|
}
|
|
1079
|
-
function
|
|
1082
|
+
function bn(s) {
|
|
1080
1083
|
var o, i;
|
|
1081
1084
|
const t = s.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
|
|
1082
1085
|
let e = 1;
|
|
@@ -1091,11 +1094,11 @@ function mn(s) {
|
|
|
1091
1094
|
}
|
|
1092
1095
|
return e;
|
|
1093
1096
|
}
|
|
1094
|
-
function
|
|
1097
|
+
function yn(s) {
|
|
1095
1098
|
const t = s.trim() ? s.trim().split(/\s+/).length : 0, e = s.length;
|
|
1096
1099
|
return { words: t, chars: e };
|
|
1097
1100
|
}
|
|
1098
|
-
function
|
|
1101
|
+
function vn(s, t) {
|
|
1099
1102
|
const e = s.toString();
|
|
1100
1103
|
return {
|
|
1101
1104
|
startLine: t.line,
|
|
@@ -1107,15 +1110,15 @@ function bn(s, t) {
|
|
|
1107
1110
|
selectedWords: e.trim().split(/\s+/).filter(Boolean).length
|
|
1108
1111
|
};
|
|
1109
1112
|
}
|
|
1110
|
-
function
|
|
1113
|
+
function io(s, t) {
|
|
1111
1114
|
(t == null || t > s.length) && (t = s.length);
|
|
1112
1115
|
for (var e = 0, o = Array(t); e < t; e++) o[e] = s[e];
|
|
1113
1116
|
return o;
|
|
1114
1117
|
}
|
|
1115
|
-
function
|
|
1118
|
+
function En(s) {
|
|
1116
1119
|
if (Array.isArray(s)) return s;
|
|
1117
1120
|
}
|
|
1118
|
-
function
|
|
1121
|
+
function wn(s, t) {
|
|
1119
1122
|
var e = s == null ? null : typeof Symbol != "undefined" && s[Symbol.iterator] || s["@@iterator"];
|
|
1120
1123
|
if (e != null) {
|
|
1121
1124
|
var o, i, r, l, c = [], p = !0, m = !1;
|
|
@@ -1133,127 +1136,127 @@ function vn(s, t) {
|
|
|
1133
1136
|
return c;
|
|
1134
1137
|
}
|
|
1135
1138
|
}
|
|
1136
|
-
function
|
|
1139
|
+
function Tn() {
|
|
1137
1140
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1138
1141
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1139
1142
|
}
|
|
1140
|
-
function
|
|
1141
|
-
return
|
|
1143
|
+
function kn(s, t) {
|
|
1144
|
+
return En(s) || wn(s, t) || xn(s, t) || Tn();
|
|
1142
1145
|
}
|
|
1143
|
-
function
|
|
1146
|
+
function xn(s, t) {
|
|
1144
1147
|
if (s) {
|
|
1145
|
-
if (typeof s == "string") return
|
|
1148
|
+
if (typeof s == "string") return io(s, t);
|
|
1146
1149
|
var e = {}.toString.call(s).slice(8, -1);
|
|
1147
|
-
return e === "Object" && s.constructor && (e = s.constructor.name), e === "Map" || e === "Set" ? Array.from(s) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ?
|
|
1150
|
+
return e === "Object" && s.constructor && (e = s.constructor.name), e === "Map" || e === "Set" ? Array.from(s) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? io(s, t) : void 0;
|
|
1148
1151
|
}
|
|
1149
1152
|
}
|
|
1150
|
-
const
|
|
1151
|
-
let M = Object.freeze, I = Object.seal, mt = Object.create,
|
|
1153
|
+
const Ao = Object.entries, ro = Object.setPrototypeOf, Cn = Object.isFrozen, An = Object.getPrototypeOf, Sn = Object.getOwnPropertyDescriptor;
|
|
1154
|
+
let M = Object.freeze, I = Object.seal, mt = Object.create, So = typeof Reflect != "undefined" && Reflect, we = So.apply, Te = So.construct;
|
|
1152
1155
|
M || (M = function(t) {
|
|
1153
1156
|
return t;
|
|
1154
1157
|
});
|
|
1155
1158
|
I || (I = function(t) {
|
|
1156
1159
|
return t;
|
|
1157
1160
|
});
|
|
1158
|
-
|
|
1161
|
+
we || (we = function(t, e) {
|
|
1159
1162
|
for (var o = arguments.length, i = new Array(o > 2 ? o - 2 : 0), r = 2; r < o; r++) i[r - 2] = arguments[r];
|
|
1160
1163
|
return t.apply(e, i);
|
|
1161
1164
|
});
|
|
1162
|
-
|
|
1165
|
+
Te || (Te = function(t) {
|
|
1163
1166
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1164
1167
|
return new t(...o);
|
|
1165
1168
|
});
|
|
1166
|
-
const it = L(Array.prototype.forEach),
|
|
1169
|
+
const it = L(Array.prototype.forEach), _n = L(Array.prototype.lastIndexOf), ao = L(Array.prototype.pop), kt = L(Array.prototype.push), Ln = L(Array.prototype.splice), bt = Array.isArray, _t = L(String.prototype.toLowerCase), pe = L(String.prototype.toString), so = L(String.prototype.match), xt = L(String.prototype.replace), lo = L(String.prototype.indexOf), Mn = L(String.prototype.trim), In = L(Number.prototype.toString), On = L(Boolean.prototype.toString), co = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), uo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), z = L(Object.prototype.hasOwnProperty), Ct = L(Object.prototype.toString), O = L(RegExp.prototype.test), X = Dn(TypeError);
|
|
1167
1170
|
function L(s) {
|
|
1168
1171
|
return function(t) {
|
|
1169
1172
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
1170
1173
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1171
|
-
return
|
|
1174
|
+
return we(s, t, o);
|
|
1172
1175
|
};
|
|
1173
1176
|
}
|
|
1174
|
-
function
|
|
1177
|
+
function Dn(s) {
|
|
1175
1178
|
return function() {
|
|
1176
1179
|
for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
|
|
1177
|
-
return
|
|
1180
|
+
return Te(s, e);
|
|
1178
1181
|
};
|
|
1179
1182
|
}
|
|
1180
1183
|
function y(s, t) {
|
|
1181
|
-
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
1182
|
-
if (
|
|
1184
|
+
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _t;
|
|
1185
|
+
if (ro && ro(s, null), !bt(t)) return s;
|
|
1183
1186
|
let o = t.length;
|
|
1184
1187
|
for (; o--; ) {
|
|
1185
1188
|
let i = t[o];
|
|
1186
1189
|
if (typeof i == "string") {
|
|
1187
1190
|
const r = e(i);
|
|
1188
|
-
r !== i && (
|
|
1191
|
+
r !== i && (Cn(t) || (t[o] = r), i = r);
|
|
1189
1192
|
}
|
|
1190
1193
|
s[i] = !0;
|
|
1191
1194
|
}
|
|
1192
1195
|
return s;
|
|
1193
1196
|
}
|
|
1194
|
-
function
|
|
1197
|
+
function Rn(s) {
|
|
1195
1198
|
for (let t = 0; t < s.length; t++) z(s, t) || (s[t] = null);
|
|
1196
1199
|
return s;
|
|
1197
1200
|
}
|
|
1198
1201
|
function H(s) {
|
|
1199
1202
|
const t = mt(null);
|
|
1200
|
-
for (const o of
|
|
1201
|
-
var e =
|
|
1203
|
+
for (const o of Ao(s)) {
|
|
1204
|
+
var e = kn(o, 2);
|
|
1202
1205
|
const i = e[0], r = e[1];
|
|
1203
|
-
z(s, i) && (bt(r) ? t[i] =
|
|
1206
|
+
z(s, i) && (bt(r) ? t[i] = Rn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = H(r) : t[i] = r);
|
|
1204
1207
|
}
|
|
1205
1208
|
return t;
|
|
1206
1209
|
}
|
|
1207
|
-
function
|
|
1210
|
+
function Nn(s) {
|
|
1208
1211
|
switch (typeof s) {
|
|
1209
1212
|
case "string":
|
|
1210
1213
|
return s;
|
|
1211
1214
|
case "number":
|
|
1212
|
-
return
|
|
1215
|
+
return In(s);
|
|
1213
1216
|
case "boolean":
|
|
1214
|
-
return
|
|
1217
|
+
return On(s);
|
|
1215
1218
|
case "bigint":
|
|
1216
|
-
return
|
|
1219
|
+
return co ? co(s) : "0";
|
|
1217
1220
|
case "symbol":
|
|
1218
|
-
return
|
|
1221
|
+
return uo ? uo(s) : "Symbol()";
|
|
1219
1222
|
case "undefined":
|
|
1220
|
-
return
|
|
1223
|
+
return Ct(s);
|
|
1221
1224
|
case "function":
|
|
1222
1225
|
case "object": {
|
|
1223
|
-
if (s === null) return
|
|
1226
|
+
if (s === null) return Ct(s);
|
|
1224
1227
|
const t = s, e = j(t, "toString");
|
|
1225
1228
|
if (typeof e == "function") {
|
|
1226
1229
|
const o = e(t);
|
|
1227
|
-
return typeof o == "string" ? o :
|
|
1230
|
+
return typeof o == "string" ? o : Ct(o);
|
|
1228
1231
|
}
|
|
1229
|
-
return
|
|
1232
|
+
return Ct(s);
|
|
1230
1233
|
}
|
|
1231
1234
|
default:
|
|
1232
|
-
return
|
|
1235
|
+
return Ct(s);
|
|
1233
1236
|
}
|
|
1234
1237
|
}
|
|
1235
1238
|
function j(s, t) {
|
|
1236
1239
|
for (; s !== null; ) {
|
|
1237
|
-
const o =
|
|
1240
|
+
const o = Sn(s, t);
|
|
1238
1241
|
if (o) {
|
|
1239
1242
|
if (o.get) return L(o.get);
|
|
1240
1243
|
if (typeof o.value == "function") return L(o.value);
|
|
1241
1244
|
}
|
|
1242
|
-
s =
|
|
1245
|
+
s = An(s);
|
|
1243
1246
|
}
|
|
1244
1247
|
function e() {
|
|
1245
1248
|
return null;
|
|
1246
1249
|
}
|
|
1247
1250
|
return e;
|
|
1248
1251
|
}
|
|
1249
|
-
function
|
|
1252
|
+
function Pn(s) {
|
|
1250
1253
|
try {
|
|
1251
1254
|
return O(s, ""), !0;
|
|
1252
1255
|
} catch (t) {
|
|
1253
1256
|
return !1;
|
|
1254
1257
|
}
|
|
1255
1258
|
}
|
|
1256
|
-
const
|
|
1259
|
+
const fo = M([
|
|
1257
1260
|
"a",
|
|
1258
1261
|
"abbr",
|
|
1259
1262
|
"acronym",
|
|
@@ -1373,7 +1376,7 @@ const uo = M([
|
|
|
1373
1376
|
"var",
|
|
1374
1377
|
"video",
|
|
1375
1378
|
"wbr"
|
|
1376
|
-
]),
|
|
1379
|
+
]), he = M([
|
|
1377
1380
|
"svg",
|
|
1378
1381
|
"a",
|
|
1379
1382
|
"altglyph",
|
|
@@ -1421,7 +1424,7 @@ const uo = M([
|
|
|
1421
1424
|
"tspan",
|
|
1422
1425
|
"view",
|
|
1423
1426
|
"vkern"
|
|
1424
|
-
]),
|
|
1427
|
+
]), me = M([
|
|
1425
1428
|
"feBlend",
|
|
1426
1429
|
"feColorMatrix",
|
|
1427
1430
|
"feComponentTransfer",
|
|
@@ -1447,7 +1450,7 @@ const uo = M([
|
|
|
1447
1450
|
"feSpotLight",
|
|
1448
1451
|
"feTile",
|
|
1449
1452
|
"feTurbulence"
|
|
1450
|
-
]),
|
|
1453
|
+
]), zn = M([
|
|
1451
1454
|
"animate",
|
|
1452
1455
|
"color-profile",
|
|
1453
1456
|
"cursor",
|
|
@@ -1470,7 +1473,7 @@ const uo = M([
|
|
|
1470
1473
|
"solidcolor",
|
|
1471
1474
|
"unknown",
|
|
1472
1475
|
"use"
|
|
1473
|
-
]),
|
|
1476
|
+
]), ge = M([
|
|
1474
1477
|
"math",
|
|
1475
1478
|
"menclose",
|
|
1476
1479
|
"merror",
|
|
@@ -1501,7 +1504,7 @@ const uo = M([
|
|
|
1501
1504
|
"munder",
|
|
1502
1505
|
"munderover",
|
|
1503
1506
|
"mprescripts"
|
|
1504
|
-
]),
|
|
1507
|
+
]), Bn = M([
|
|
1505
1508
|
"maction",
|
|
1506
1509
|
"maligngroup",
|
|
1507
1510
|
"malignmark",
|
|
@@ -1517,7 +1520,7 @@ const uo = M([
|
|
|
1517
1520
|
"annotation-xml",
|
|
1518
1521
|
"mprescripts",
|
|
1519
1522
|
"none"
|
|
1520
|
-
]),
|
|
1523
|
+
]), po = M(["#text"]), ho = M([
|
|
1521
1524
|
"accept",
|
|
1522
1525
|
"action",
|
|
1523
1526
|
"align",
|
|
@@ -1636,7 +1639,7 @@ const uo = M([
|
|
|
1636
1639
|
"width",
|
|
1637
1640
|
"wrap",
|
|
1638
1641
|
"xmlns"
|
|
1639
|
-
]),
|
|
1642
|
+
]), be = M([
|
|
1640
1643
|
"accent-height",
|
|
1641
1644
|
"accumulate",
|
|
1642
1645
|
"additive",
|
|
@@ -1829,7 +1832,7 @@ const uo = M([
|
|
|
1829
1832
|
"y2",
|
|
1830
1833
|
"z",
|
|
1831
1834
|
"zoomandpan"
|
|
1832
|
-
]),
|
|
1835
|
+
]), mo = M([
|
|
1833
1836
|
"accent",
|
|
1834
1837
|
"accentunder",
|
|
1835
1838
|
"align",
|
|
@@ -1884,13 +1887,13 @@ const uo = M([
|
|
|
1884
1887
|
"voffset",
|
|
1885
1888
|
"width",
|
|
1886
1889
|
"xmlns"
|
|
1887
|
-
]),
|
|
1890
|
+
]), Wt = M([
|
|
1888
1891
|
"xlink:href",
|
|
1889
1892
|
"xml:id",
|
|
1890
1893
|
"xlink:title",
|
|
1891
1894
|
"xml:space",
|
|
1892
1895
|
"xmlns:xlink"
|
|
1893
|
-
]),
|
|
1896
|
+
]), Fn = I(/{{[\w\W]*|^[\w\W]*}}/g), Hn = I(/<%[\w\W]*|^[\w\W]*%>/g), Un = I(/\${[\w\W]*/g), jn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), Wn = I(/^aria-[\-\w]+$/), go = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), $n = I(/^(?:\w+script|data):/i), Gn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Kn = I(/^html$/i), Yn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), bo = I(/<[/\w!]/g), yo = I(/<[/\w]/g), qn = I(/<\/no(script|embed|frames)/i), Vn = I(/\/>/i), F = {
|
|
1894
1897
|
element: 1,
|
|
1895
1898
|
attribute: 2,
|
|
1896
1899
|
text: 3,
|
|
@@ -1903,7 +1906,7 @@ const uo = M([
|
|
|
1903
1906
|
documentType: 10,
|
|
1904
1907
|
documentFragment: 11,
|
|
1905
1908
|
notation: 12
|
|
1906
|
-
},
|
|
1909
|
+
}, _o = [
|
|
1907
1910
|
"style",
|
|
1908
1911
|
"script",
|
|
1909
1912
|
"xmp",
|
|
@@ -1912,14 +1915,14 @@ const uo = M([
|
|
|
1912
1915
|
"noframes",
|
|
1913
1916
|
"plaintext",
|
|
1914
1917
|
"noscript"
|
|
1915
|
-
],
|
|
1918
|
+
], Xn = M(y({}, _o)), Zn = (function() {
|
|
1916
1919
|
const s = {};
|
|
1917
|
-
return it(
|
|
1920
|
+
return it(_o, (t) => {
|
|
1918
1921
|
s[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
1919
1922
|
}), M(s);
|
|
1920
|
-
})(),
|
|
1923
|
+
})(), Jn = function() {
|
|
1921
1924
|
return typeof window == "undefined" ? null : window;
|
|
1922
|
-
},
|
|
1925
|
+
}, Qn = function(t, e) {
|
|
1923
1926
|
if (typeof t != "object" || typeof t.createPolicy != "function") return null;
|
|
1924
1927
|
let o = null;
|
|
1925
1928
|
const i = "data-tt-policy-suffix";
|
|
@@ -1937,7 +1940,7 @@ const uo = M([
|
|
|
1937
1940
|
} catch (l) {
|
|
1938
1941
|
return console.warn("TrustedTypes policy " + r + " could not be created."), null;
|
|
1939
1942
|
}
|
|
1940
|
-
},
|
|
1943
|
+
}, vo = function() {
|
|
1941
1944
|
return {
|
|
1942
1945
|
afterSanitizeAttributes: [],
|
|
1943
1946
|
afterSanitizeElements: [],
|
|
@@ -1951,13 +1954,13 @@ const uo = M([
|
|
|
1951
1954
|
};
|
|
1952
1955
|
}, Z = function(t, e, o, i) {
|
|
1953
1956
|
return z(t, e) && bt(t[e]) ? y(i.base ? H(i.base) : {}, t[e], i.transform) : o;
|
|
1954
|
-
},
|
|
1957
|
+
}, ye = function(t, e, o) {
|
|
1955
1958
|
const i = z(t, e) ? t[e] : void 0;
|
|
1956
1959
|
return i && typeof i == "object" ? H(i) : o();
|
|
1957
1960
|
};
|
|
1958
|
-
function
|
|
1959
|
-
let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
1960
|
-
const t = (u) =>
|
|
1961
|
+
function Lo() {
|
|
1962
|
+
let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Jn();
|
|
1963
|
+
const t = (u) => Lo(u);
|
|
1961
1964
|
if (t.version = "3.4.16", t.removed = [], !s || !s.document || s.document.nodeType !== F.document || !s.Element)
|
|
1962
1965
|
return t.isSupported = !1, t;
|
|
1963
1966
|
let e = s.document;
|
|
@@ -1965,52 +1968,52 @@ function So() {
|
|
|
1965
1968
|
s.DocumentFragment;
|
|
1966
1969
|
const r = s.HTMLTemplateElement, l = s.Node, c = s.Element, p = s.NodeFilter;
|
|
1967
1970
|
s.NamedNodeMap === void 0 && (s.NamedNodeMap || s.MozNamedAttrMap), s.HTMLFormElement;
|
|
1968
|
-
const m = s.DOMParser, E = s.trustedTypes,
|
|
1971
|
+
const m = s.DOMParser, E = s.trustedTypes, C = c.prototype, A = j(C, "cloneNode"), w = j(C, "remove"), v = j(C, "removeAttributeNode"), K = j(C, "nextSibling"), D = j(C, "childNodes"), N = j(C, "parentNode"), Ce = j(C, "shadowRoot"), qt = j(C, "attributes"), Q = l && l.prototype ? j(l.prototype, "nodeType") : null, rt = l && l.prototype ? j(l.prototype, "nodeName") : null, Lt = l && l.prototype ? j(l.prototype, "ownerDocument") : null, yt = function(n) {
|
|
1969
1972
|
return Q ? Q(n) : n.nodeType;
|
|
1970
|
-
},
|
|
1973
|
+
}, Vt = function(n) {
|
|
1971
1974
|
return rt ? rt(n) : n.nodeName;
|
|
1972
1975
|
};
|
|
1973
1976
|
if (typeof r == "function") {
|
|
1974
1977
|
const u = e.createElement("template");
|
|
1975
1978
|
u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
|
|
1976
1979
|
}
|
|
1977
|
-
let P, tt = "",
|
|
1978
|
-
const
|
|
1980
|
+
let P, tt = "", Xt, Ae = !1, vt = 0;
|
|
1981
|
+
const Se = function() {
|
|
1979
1982
|
if (vt > 0) throw X('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.');
|
|
1980
1983
|
}, at = function(n) {
|
|
1981
|
-
|
|
1984
|
+
Se(), vt++;
|
|
1982
1985
|
try {
|
|
1983
1986
|
return P.createHTML(n);
|
|
1984
1987
|
} finally {
|
|
1985
1988
|
vt--;
|
|
1986
1989
|
}
|
|
1987
|
-
},
|
|
1988
|
-
|
|
1990
|
+
}, Do = function(n) {
|
|
1991
|
+
Se(), vt++;
|
|
1989
1992
|
try {
|
|
1990
1993
|
return P.createScriptURL(n);
|
|
1991
1994
|
} finally {
|
|
1992
1995
|
vt--;
|
|
1993
1996
|
}
|
|
1994
|
-
},
|
|
1995
|
-
return Ae || (
|
|
1996
|
-
},
|
|
1997
|
-
let T =
|
|
1998
|
-
t.isSupported = typeof
|
|
1999
|
-
const
|
|
2000
|
-
let
|
|
2001
|
-
const
|
|
2002
|
-
...
|
|
2003
|
-
...pe,
|
|
1997
|
+
}, Ro = function() {
|
|
1998
|
+
return Ae || (Xt = Qn(E, i), Ae = !0), Xt;
|
|
1999
|
+
}, Mt = e, Zt = Mt.implementation, _e = Mt.createNodeIterator, No = Mt.createDocumentFragment, Po = Mt.getElementsByTagName, zo = o.importNode;
|
|
2000
|
+
let T = vo();
|
|
2001
|
+
t.isSupported = typeof Ao == "function" && typeof N == "function" && Zt && Zt.createHTMLDocument !== void 0;
|
|
2002
|
+
const Bo = Fn, Fo = Hn, Ho = Un, Uo = jn, jo = Wn, Wo = $n, Le = Gn, $o = Yn;
|
|
2003
|
+
let Me = go, k = null;
|
|
2004
|
+
const Jt = y({}, [
|
|
2005
|
+
...fo,
|
|
2004
2006
|
...he,
|
|
2005
2007
|
...me,
|
|
2006
|
-
...
|
|
2008
|
+
...ge,
|
|
2009
|
+
...po
|
|
2007
2010
|
]);
|
|
2008
2011
|
let x = null;
|
|
2009
|
-
const
|
|
2010
|
-
...po,
|
|
2011
|
-
...ge,
|
|
2012
|
+
const Qt = y({}, [
|
|
2012
2013
|
...ho,
|
|
2013
|
-
...
|
|
2014
|
+
...be,
|
|
2015
|
+
...mo,
|
|
2016
|
+
...Wt
|
|
2014
2017
|
]);
|
|
2015
2018
|
let W = Object.seal(mt(null, {
|
|
2016
2019
|
tagNameCheck: {
|
|
@@ -2031,7 +2034,7 @@ function So() {
|
|
|
2031
2034
|
enumerable: !0,
|
|
2032
2035
|
value: !1
|
|
2033
2036
|
}
|
|
2034
|
-
})), Et = null,
|
|
2037
|
+
})), Et = null, Ie = null;
|
|
2035
2038
|
const Y = Object.seal(mt(null, {
|
|
2036
2039
|
tagCheck: {
|
|
2037
2040
|
writable: !0,
|
|
@@ -2046,10 +2049,10 @@ function So() {
|
|
|
2046
2049
|
value: null
|
|
2047
2050
|
}
|
|
2048
2051
|
}));
|
|
2049
|
-
let
|
|
2050
|
-
const
|
|
2051
|
-
let
|
|
2052
|
-
const
|
|
2052
|
+
let Oe = !0, te = !0, De = !1, Re = !0, q = !1, et = !0, ot = !1, ee = !1, It = null, Ot = null, oe = !1, st = !1, Dt = !1, Rt = !1, Ne = !0, Pe = !1;
|
|
2053
|
+
const ze = "user-content-";
|
|
2054
|
+
let ne = !0, ie = !1, lt = {}, ct = null;
|
|
2055
|
+
const Be = y({}, [
|
|
2053
2056
|
"annotation-xml",
|
|
2054
2057
|
"audio",
|
|
2055
2058
|
"colgroup",
|
|
@@ -2077,8 +2080,8 @@ function So() {
|
|
|
2077
2080
|
"video",
|
|
2078
2081
|
"xmp"
|
|
2079
2082
|
]);
|
|
2080
|
-
let
|
|
2081
|
-
const
|
|
2083
|
+
let Fe = null;
|
|
2084
|
+
const He = y({}, [
|
|
2082
2085
|
"audio",
|
|
2083
2086
|
"video",
|
|
2084
2087
|
"img",
|
|
@@ -2086,8 +2089,8 @@ function So() {
|
|
|
2086
2089
|
"image",
|
|
2087
2090
|
"track"
|
|
2088
2091
|
]);
|
|
2089
|
-
let
|
|
2090
|
-
const
|
|
2092
|
+
let Ue = null;
|
|
2093
|
+
const je = y({}, [
|
|
2091
2094
|
"alt",
|
|
2092
2095
|
"class",
|
|
2093
2096
|
"for",
|
|
@@ -2102,23 +2105,23 @@ function So() {
|
|
|
2102
2105
|
"value",
|
|
2103
2106
|
"style",
|
|
2104
2107
|
"xmlns"
|
|
2105
|
-
]),
|
|
2106
|
-
let dt = $,
|
|
2107
|
-
const
|
|
2108
|
-
Rt,
|
|
2108
|
+
]), Nt = "http://www.w3.org/1998/Math/MathML", Pt = "http://www.w3.org/2000/svg", $ = "http://www.w3.org/1999/xhtml";
|
|
2109
|
+
let dt = $, re = !1, ae = null;
|
|
2110
|
+
const Go = y({}, [
|
|
2109
2111
|
Nt,
|
|
2112
|
+
Pt,
|
|
2110
2113
|
$
|
|
2111
|
-
],
|
|
2114
|
+
], pe), We = M([
|
|
2112
2115
|
"mi",
|
|
2113
2116
|
"mo",
|
|
2114
2117
|
"mn",
|
|
2115
2118
|
"ms",
|
|
2116
2119
|
"mtext"
|
|
2117
2120
|
]);
|
|
2118
|
-
let ae = y({}, je);
|
|
2119
|
-
const We = M(["annotation-xml"]);
|
|
2120
2121
|
let se = y({}, We);
|
|
2121
|
-
const
|
|
2122
|
+
const $e = M(["annotation-xml"]);
|
|
2123
|
+
let le = y({}, $e);
|
|
2124
|
+
const Ko = y({}, [
|
|
2122
2125
|
"title",
|
|
2123
2126
|
"style",
|
|
2124
2127
|
"font",
|
|
@@ -2126,22 +2129,22 @@ function So() {
|
|
|
2126
2129
|
"script"
|
|
2127
2130
|
]);
|
|
2128
2131
|
let wt = null;
|
|
2129
|
-
const
|
|
2132
|
+
const Yo = ["application/xhtml+xml", "text/html"], qo = "text/html";
|
|
2130
2133
|
let _ = null, ut = null;
|
|
2131
|
-
const
|
|
2134
|
+
const Vo = e.createElement("form"), Ge = function(n) {
|
|
2132
2135
|
return n instanceof RegExp || n instanceof Function;
|
|
2133
|
-
},
|
|
2136
|
+
}, ce = function() {
|
|
2134
2137
|
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2135
2138
|
if (ut && ut === n) return;
|
|
2136
|
-
(!n || typeof n != "object") && (n = {}), n = H(n), wt =
|
|
2139
|
+
(!n || typeof n != "object") && (n = {}), n = H(n), wt = Yo.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? qo : n.PARSER_MEDIA_TYPE, _ = wt === "application/xhtml+xml" ? pe : _t, k = Z(n, "ALLOWED_TAGS", Jt, { transform: _ }), x = Z(n, "ALLOWED_ATTR", Qt, { transform: _ }), ae = Z(n, "ALLOWED_NAMESPACES", Go, { transform: pe }), Ue = Z(n, "ADD_URI_SAFE_ATTR", je, {
|
|
2137
2140
|
transform: _,
|
|
2138
|
-
base:
|
|
2139
|
-
}),
|
|
2141
|
+
base: je
|
|
2142
|
+
}), Fe = Z(n, "ADD_DATA_URI_TAGS", He, {
|
|
2140
2143
|
transform: _,
|
|
2141
|
-
base:
|
|
2142
|
-
}), ct = Z(n, "FORBID_CONTENTS",
|
|
2143
|
-
const a =
|
|
2144
|
-
if (W = mt(null), z(a, "tagNameCheck") &&
|
|
2144
|
+
base: He
|
|
2145
|
+
}), ct = Z(n, "FORBID_CONTENTS", Be, { transform: _ }), Et = Z(n, "FORBID_TAGS", H({}), { transform: _ }), Ie = Z(n, "FORBID_ATTR", H({}), { transform: _ }), lt = z(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? H(n.USE_PROFILES) : n.USE_PROFILES : !1, Oe = n.ALLOW_ARIA_ATTR !== !1, te = n.ALLOW_DATA_ATTR !== !1, De = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, q = n.SAFE_FOR_TEMPLATES || !1, et = n.SAFE_FOR_XML !== !1, ot = n.WHOLE_DOCUMENT || !1, st = n.RETURN_DOM || !1, Dt = n.RETURN_DOM_FRAGMENT || !1, Rt = n.RETURN_TRUSTED_TYPE || !1, oe = n.FORCE_BODY || !1, Ne = n.SANITIZE_DOM !== !1, Pe = n.SANITIZE_NAMED_PROPS || !1, ne = n.KEEP_CONTENT !== !1, ie = n.IN_PLACE || !1, Me = Pn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : go, dt = typeof n.NAMESPACE == "string" ? n.NAMESPACE : $, se = ye(n, "MATHML_TEXT_INTEGRATION_POINTS", () => y({}, We)), le = ye(n, "HTML_INTEGRATION_POINTS", () => y({}, $e));
|
|
2146
|
+
const a = ye(n, "CUSTOM_ELEMENT_HANDLING", () => mt(null));
|
|
2147
|
+
if (W = mt(null), z(a, "tagNameCheck") && Ge(a.tagNameCheck) && (W.tagNameCheck = a.tagNameCheck), z(a, "attributeNameCheck") && Ge(a.attributeNameCheck) && (W.attributeNameCheck = a.attributeNameCheck), z(a, "allowCustomizedBuiltInElements") && typeof a.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = a.allowCustomizedBuiltInElements), I(W), q && (te = !1), Dt && (st = !0), lt && (k = y({}, po), x = mt(null), lt.html === !0 && (y(k, fo), y(x, ho)), lt.svg === !0 && (y(k, he), y(x, be), y(x, Wt)), lt.svgFilters === !0 && (y(k, me), y(x, be), y(x, Wt)), lt.mathMl === !0 && (y(k, ge), y(x, mo), y(x, Wt))), Y.tagCheck = null, Y.attributeCheck = null, z(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? Y.tagCheck = n.ADD_TAGS : bt(n.ADD_TAGS) && (k === Jt && (k = H(k)), y(k, n.ADD_TAGS, _))), z(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? Y.attributeCheck = n.ADD_ATTR : bt(n.ADD_ATTR) && (x === Qt && (x = H(x)), y(x, n.ADD_ATTR, _))), z(n, "ADD_FORBID_CONTENTS") && bt(n.ADD_FORBID_CONTENTS) && (ct === Be && (ct = H(ct)), y(ct, n.ADD_FORBID_CONTENTS, _)), ne && (k["#text"] = !0), ot && y(k, [
|
|
2145
2148
|
"html",
|
|
2146
2149
|
"head",
|
|
2147
2150
|
"body"
|
|
@@ -2155,26 +2158,26 @@ function So() {
|
|
|
2155
2158
|
} catch (f) {
|
|
2156
2159
|
throw P = d, f;
|
|
2157
2160
|
}
|
|
2158
|
-
} else n.TRUSTED_TYPES_POLICY === null ? (P = void 0, tt = "") : (P === void 0 && (P =
|
|
2161
|
+
} else n.TRUSTED_TYPES_POLICY === null ? (P = void 0, tt = "") : (P === void 0 && (P = Ro()), P && typeof tt == "string" && (tt = at("")));
|
|
2159
2162
|
M && M(n), ut = n;
|
|
2160
|
-
},
|
|
2161
|
-
...pe,
|
|
2163
|
+
}, Ke = y({}, [
|
|
2162
2164
|
...he,
|
|
2163
|
-
...
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2165
|
+
...me,
|
|
2166
|
+
...zn
|
|
2167
|
+
]), Ye = y({}, [...ge, ...Bn]), Xo = function(n, a, d) {
|
|
2168
|
+
return a.namespaceURI === $ ? n === "svg" : a.namespaceURI === Nt ? n === "svg" && (d === "annotation-xml" || se[d]) : !!Ke[n];
|
|
2169
|
+
}, Zo = function(n, a, d) {
|
|
2170
|
+
return a.namespaceURI === $ ? n === "math" : a.namespaceURI === Pt ? n === "math" && le[d] : !!Ye[n];
|
|
2171
|
+
}, Jo = function(n, a, d) {
|
|
2172
|
+
return a.namespaceURI === Pt && !le[d] || a.namespaceURI === Nt && !se[d] ? !1 : !Ye[n] && (Ko[n] || !Ke[n]);
|
|
2173
|
+
}, Qo = function(n) {
|
|
2171
2174
|
let a = N(n);
|
|
2172
2175
|
(!a || !a.tagName) && (a = {
|
|
2173
2176
|
namespaceURI: dt,
|
|
2174
2177
|
tagName: "template"
|
|
2175
2178
|
});
|
|
2176
|
-
const d =
|
|
2177
|
-
return
|
|
2179
|
+
const d = _t(n.tagName), f = _t(a.tagName);
|
|
2180
|
+
return ae[n.namespaceURI] ? n.namespaceURI === Pt ? Xo(d, a, f) : n.namespaceURI === Nt ? Zo(d, a, f) : n.namespaceURI === $ ? Jo(d, a, f) : !!(wt === "application/xhtml+xml" && ae[n.namespaceURI]) : !1;
|
|
2178
2181
|
}, V = function(n) {
|
|
2179
2182
|
kt(t.removed, { element: n });
|
|
2180
2183
|
try {
|
|
@@ -2182,7 +2185,7 @@ function So() {
|
|
|
2182
2185
|
} catch (a) {
|
|
2183
2186
|
if (w(n), !N(n)) throw X("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2184
2187
|
}
|
|
2185
|
-
},
|
|
2188
|
+
}, qe = function(n, a, d) {
|
|
2186
2189
|
try {
|
|
2187
2190
|
v(n, a);
|
|
2188
2191
|
} catch (f) {
|
|
@@ -2191,8 +2194,8 @@ function So() {
|
|
|
2191
2194
|
} catch (h) {
|
|
2192
2195
|
}
|
|
2193
2196
|
}
|
|
2194
|
-
},
|
|
2195
|
-
|
|
2197
|
+
}, zt = function(n) {
|
|
2198
|
+
Bt(n);
|
|
2196
2199
|
const a = D(n);
|
|
2197
2200
|
if (a) {
|
|
2198
2201
|
const f = [];
|
|
@@ -2205,10 +2208,10 @@ function So() {
|
|
|
2205
2208
|
}
|
|
2206
2209
|
});
|
|
2207
2210
|
}
|
|
2208
|
-
const d =
|
|
2211
|
+
const d = qt(n);
|
|
2209
2212
|
if (d) for (let f = d.length - 1; f >= 0; --f) {
|
|
2210
2213
|
const h = d[f], g = h && h.name;
|
|
2211
|
-
typeof g == "string" &&
|
|
2214
|
+
typeof g == "string" && qe(n, h, g);
|
|
2212
2215
|
}
|
|
2213
2216
|
}, nt = function(n, a, d) {
|
|
2214
2217
|
if (!d) try {
|
|
@@ -2229,7 +2232,7 @@ function So() {
|
|
|
2229
2232
|
}
|
|
2230
2233
|
}
|
|
2231
2234
|
if (n === "is")
|
|
2232
|
-
if (st ||
|
|
2235
|
+
if (st || Dt) try {
|
|
2233
2236
|
V(a);
|
|
2234
2237
|
} catch (f) {
|
|
2235
2238
|
}
|
|
@@ -2237,29 +2240,29 @@ function So() {
|
|
|
2237
2240
|
a.setAttribute(n, "");
|
|
2238
2241
|
} catch (f) {
|
|
2239
2242
|
}
|
|
2240
|
-
},
|
|
2241
|
-
const a =
|
|
2243
|
+
}, tn = function(n) {
|
|
2244
|
+
const a = qt(n);
|
|
2242
2245
|
if (a)
|
|
2243
2246
|
for (let d = a.length - 1; d >= 0; --d) {
|
|
2244
2247
|
const f = a[d], h = f && f.name;
|
|
2245
|
-
typeof h != "string" || x[_(h)] ||
|
|
2248
|
+
typeof h != "string" || x[_(h)] || qe(n, f, h);
|
|
2246
2249
|
}
|
|
2247
|
-
},
|
|
2250
|
+
}, Bt = function(n) {
|
|
2248
2251
|
const a = [n];
|
|
2249
2252
|
for (; a.length > 0; ) {
|
|
2250
2253
|
const d = a.pop();
|
|
2251
|
-
yt(d) === F.element &&
|
|
2254
|
+
yt(d) === F.element && tn(d);
|
|
2252
2255
|
const f = D(d);
|
|
2253
2256
|
if (f) for (let h = f.length - 1; h >= 0; --h) a.push(f[h]);
|
|
2254
2257
|
}
|
|
2255
|
-
},
|
|
2258
|
+
}, Ve = function(n, a) {
|
|
2256
2259
|
return et ? n === "patchsrc" ? !0 : n === "for" && a !== "label" && a !== "output" : !1;
|
|
2257
|
-
},
|
|
2260
|
+
}, en = function(n) {
|
|
2258
2261
|
if (!et) return;
|
|
2259
2262
|
const a = [n];
|
|
2260
2263
|
for (; a.length > 0; ) {
|
|
2261
2264
|
const d = a.pop(), f = yt(d);
|
|
2262
|
-
if (f === F.processingInstruction || f === F.comment && O(
|
|
2265
|
+
if (f === F.processingInstruction || f === F.comment && O(yo, d.data)) {
|
|
2263
2266
|
try {
|
|
2264
2267
|
w(d);
|
|
2265
2268
|
} catch (g) {
|
|
@@ -2267,20 +2270,20 @@ function So() {
|
|
|
2267
2270
|
continue;
|
|
2268
2271
|
}
|
|
2269
2272
|
if (f === F.element) {
|
|
2270
|
-
const g = d, b = _(
|
|
2273
|
+
const g = d, b = _(Vt(d));
|
|
2271
2274
|
try {
|
|
2272
|
-
g.hasAttribute && g.hasAttribute("patchsrc") && g.removeAttribute("patchsrc"), g.hasAttribute && g.hasAttribute("for") &&
|
|
2275
|
+
g.hasAttribute && g.hasAttribute("patchsrc") && g.removeAttribute("patchsrc"), g.hasAttribute && g.hasAttribute("for") && Ve("for", b) && g.removeAttribute("for");
|
|
2273
2276
|
} catch (S) {
|
|
2274
2277
|
}
|
|
2275
2278
|
}
|
|
2276
2279
|
const h = D(d);
|
|
2277
2280
|
if (h) for (let g = h.length - 1; g >= 0; --g) a.push(h[g]);
|
|
2278
2281
|
}
|
|
2279
|
-
},
|
|
2282
|
+
}, Xe = function(n) {
|
|
2280
2283
|
let a = null, d = null;
|
|
2281
|
-
if (
|
|
2284
|
+
if (oe) n = "<remove></remove>" + n;
|
|
2282
2285
|
else {
|
|
2283
|
-
const g =
|
|
2286
|
+
const g = so(n, /^[\r\n\t ]+/);
|
|
2284
2287
|
d = g && g[0];
|
|
2285
2288
|
}
|
|
2286
2289
|
wt === "application/xhtml+xml" && dt === $ && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
|
|
@@ -2290,33 +2293,33 @@ function So() {
|
|
|
2290
2293
|
} catch (g) {
|
|
2291
2294
|
}
|
|
2292
2295
|
if (!a || !a.documentElement) {
|
|
2293
|
-
a =
|
|
2296
|
+
a = Zt.createDocument(dt, "template", null);
|
|
2294
2297
|
try {
|
|
2295
|
-
a.documentElement.innerHTML =
|
|
2298
|
+
a.documentElement.innerHTML = re ? tt : f;
|
|
2296
2299
|
} catch (g) {
|
|
2297
2300
|
}
|
|
2298
2301
|
}
|
|
2299
2302
|
const h = a.body || a.documentElement;
|
|
2300
|
-
return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), dt === $ ?
|
|
2301
|
-
},
|
|
2302
|
-
const a =
|
|
2303
|
-
return
|
|
2304
|
-
},
|
|
2305
|
-
return n = xt(n,
|
|
2306
|
-
},
|
|
2303
|
+
return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), dt === $ ? Po.call(a, ot ? "html" : "body")[0] : ot ? a.documentElement : h;
|
|
2304
|
+
}, Ze = function(n) {
|
|
2305
|
+
const a = Lt ? Lt(n) : n.ownerDocument;
|
|
2306
|
+
return _e.call(a || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
|
|
2307
|
+
}, Ft = function(n) {
|
|
2308
|
+
return n = xt(n, Bo, " "), n = xt(n, Fo, " "), n = xt(n, Ho, " "), n;
|
|
2309
|
+
}, de = function(n) {
|
|
2307
2310
|
var a;
|
|
2308
2311
|
n.normalize();
|
|
2309
|
-
const d =
|
|
2312
|
+
const d = Lt ? Lt(n) : n.ownerDocument, f = _e.call(d || n, n, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
|
|
2310
2313
|
let h = f.nextNode();
|
|
2311
2314
|
for (; h; )
|
|
2312
|
-
h.data =
|
|
2315
|
+
h.data = Ft(h.data), h = f.nextNode();
|
|
2313
2316
|
const g = (a = n.querySelectorAll) === null || a === void 0 ? void 0 : a.call(n, "template");
|
|
2314
2317
|
g && it(g, (b) => {
|
|
2315
|
-
ft(b.content) &&
|
|
2318
|
+
ft(b.content) && de(b.content);
|
|
2316
2319
|
});
|
|
2317
|
-
},
|
|
2320
|
+
}, Ht = function(n) {
|
|
2318
2321
|
const a = rt ? rt(n) : null;
|
|
2319
|
-
return typeof a != "string" || _(a) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !==
|
|
2322
|
+
return typeof a != "string" || _(a) !== "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 !== Q(n) || n.childNodes !== D(n);
|
|
2320
2323
|
}, ft = function(n) {
|
|
2321
2324
|
if (!Q || typeof n != "object" || n === null) return !1;
|
|
2322
2325
|
try {
|
|
@@ -2337,59 +2340,59 @@ function So() {
|
|
|
2337
2340
|
d.call(t, n, a, ut);
|
|
2338
2341
|
});
|
|
2339
2342
|
}
|
|
2340
|
-
const
|
|
2341
|
-
return !!(et && n.hasChildNodes() && !Tt(n.firstElementChild) && O(
|
|
2342
|
-
},
|
|
2343
|
+
const on = function(n, a) {
|
|
2344
|
+
return !!(et && n.hasChildNodes() && !Tt(n.firstElementChild) && O(bo, n.textContent) && O(bo, n.innerHTML) || et && n.namespaceURI === $ && Xn[a] && (Tt(n.firstElementChild) || typeof n.textContent == "string" && O(Zn[a], n.textContent)) || n.nodeType === F.processingInstruction || et && n.nodeType === F.comment && O(yo, n.data));
|
|
2345
|
+
}, Ut = function(n, a) {
|
|
2343
2346
|
if (n instanceof RegExp) return O(n, a);
|
|
2344
2347
|
if (n instanceof Function) {
|
|
2345
2348
|
for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) f[h - 2] = arguments[h];
|
|
2346
2349
|
return !!n(a, ...f);
|
|
2347
2350
|
}
|
|
2348
2351
|
return !1;
|
|
2349
|
-
},
|
|
2350
|
-
if (!Et[a] &&
|
|
2351
|
-
if (
|
|
2352
|
+
}, nn = function(n, a, d) {
|
|
2353
|
+
if (!Et[a] && eo(a) && Ut(W.tagNameCheck, a)) return !1;
|
|
2354
|
+
if (ne && !ct[a]) {
|
|
2352
2355
|
const f = N(n), h = D(n);
|
|
2353
2356
|
if (h && f) {
|
|
2354
2357
|
const g = h.length;
|
|
2355
2358
|
for (let b = g - 1; b >= 0; --b) {
|
|
2356
|
-
const S = n === d ?
|
|
2359
|
+
const S = n === d ? A(h[b], !0) : h[b];
|
|
2357
2360
|
f.insertBefore(S, K(n));
|
|
2358
2361
|
}
|
|
2359
2362
|
}
|
|
2360
2363
|
}
|
|
2361
2364
|
return V(n), !0;
|
|
2362
|
-
},
|
|
2365
|
+
}, Je = function(n, a, d, f) {
|
|
2363
2366
|
return n.length === 0 ? a : a === d || a === f ? H(a) : a;
|
|
2364
2367
|
}, pt = function(n, a) {
|
|
2365
|
-
return n === a || N(n) !== null ? !1 : (
|
|
2366
|
-
},
|
|
2368
|
+
return n === a || N(n) !== null ? !1 : (ie && Bt(n), !0);
|
|
2369
|
+
}, Qe = function(n, a) {
|
|
2367
2370
|
if (G(T.beforeSanitizeElements, n, null), pt(n, a)) return !0;
|
|
2368
|
-
if (
|
|
2371
|
+
if (Ht(n))
|
|
2369
2372
|
return V(n), !0;
|
|
2370
|
-
const d = _(
|
|
2371
|
-
if (k =
|
|
2373
|
+
const d = _(Vt(n));
|
|
2374
|
+
if (k = Je(T.uponSanitizeElement, k, Jt, It), G(T.uponSanitizeElement, n, {
|
|
2372
2375
|
tagName: d,
|
|
2373
2376
|
allowedTags: k
|
|
2374
2377
|
}), pt(n, a)) return !0;
|
|
2375
|
-
if (
|
|
2378
|
+
if (on(n, d))
|
|
2376
2379
|
return V(n), !0;
|
|
2377
2380
|
if (Et[d] || !(Y.tagCheck instanceof Function && Y.tagCheck(d)) && !k[d]) {
|
|
2378
|
-
const f =
|
|
2381
|
+
const f = nn(n, d, a);
|
|
2379
2382
|
return f === !1 && (G(T.afterSanitizeElements, n, null), pt(n, a)) ? !0 : f;
|
|
2380
2383
|
}
|
|
2381
|
-
if (yt(n) === F.element && !
|
|
2384
|
+
if (yt(n) === F.element && !Qo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && O(qn, n.innerHTML))
|
|
2382
2385
|
return V(n), !0;
|
|
2383
2386
|
if (q && n.nodeType === F.text) {
|
|
2384
|
-
const f =
|
|
2387
|
+
const f = Ft(n.textContent);
|
|
2385
2388
|
n.textContent !== f && (kt(t.removed, { element: n.cloneNode() }), n.textContent = f);
|
|
2386
2389
|
}
|
|
2387
2390
|
return G(T.afterSanitizeElements, n, null), pt(n, a);
|
|
2388
|
-
},
|
|
2389
|
-
if (
|
|
2391
|
+
}, to = function(n, a, d) {
|
|
2392
|
+
if (Ie[a] || Ve(a, n) || Ne && (a === "id" || a === "name") && (d in e || d in Vo)) return !1;
|
|
2390
2393
|
const f = x[a] || Y.attributeCheck instanceof Function && Y.attributeCheck(a, n);
|
|
2391
|
-
return
|
|
2392
|
-
},
|
|
2394
|
+
return te && O(Uo, a) || Oe && O(jo, a) ? !0 : f ? Ue[a] || O(Me, xt(d, Le, "")) || (a === "src" || a === "xlink:href" || a === "href") && n !== "script" && lo(d, "data:") === 0 && Fe[n] || De && !O(Wo, xt(d, Le, "")) ? !0 : !d : eo(n) && Ut(W.tagNameCheck, n) && Ut(W.attributeNameCheck, a, n) || a === "is" && W.allowCustomizedBuiltInElements && Ut(W.tagNameCheck, d);
|
|
2395
|
+
}, rn = y({}, [
|
|
2393
2396
|
"annotation-xml",
|
|
2394
2397
|
"color-profile",
|
|
2395
2398
|
"font-face",
|
|
@@ -2398,27 +2401,27 @@ function So() {
|
|
|
2398
2401
|
"font-face-src",
|
|
2399
2402
|
"font-face-uri",
|
|
2400
2403
|
"missing-glyph"
|
|
2401
|
-
]),
|
|
2402
|
-
return !
|
|
2403
|
-
},
|
|
2404
|
+
]), eo = function(n) {
|
|
2405
|
+
return !rn[_t(n)] && O($o, n);
|
|
2406
|
+
}, an = function(n, a, d, f) {
|
|
2404
2407
|
if (P && typeof E == "object" && typeof E.getAttributeType == "function" && !d) switch (E.getAttributeType(n, a)) {
|
|
2405
2408
|
case "TrustedHTML":
|
|
2406
2409
|
return at(f);
|
|
2407
2410
|
case "TrustedScriptURL":
|
|
2408
|
-
return
|
|
2411
|
+
return Do(f);
|
|
2409
2412
|
}
|
|
2410
2413
|
return f;
|
|
2411
|
-
},
|
|
2414
|
+
}, sn = function(n, a, d, f) {
|
|
2412
2415
|
try {
|
|
2413
|
-
return d ? n.setAttributeNS(d, a, f) : n.setAttribute(a, f),
|
|
2416
|
+
return d ? n.setAttributeNS(d, a, f) : n.setAttribute(a, f), Ht(n) ? (V(n), !1) : !0;
|
|
2414
2417
|
} catch (h) {
|
|
2415
2418
|
return nt(a, n), !1;
|
|
2416
2419
|
}
|
|
2417
|
-
},
|
|
2420
|
+
}, oo = function(n, a) {
|
|
2418
2421
|
if (G(T.beforeSanitizeAttributes, n, null), pt(n, a)) return;
|
|
2419
2422
|
const d = n.attributes;
|
|
2420
|
-
if (!d ||
|
|
2421
|
-
x =
|
|
2423
|
+
if (!d || Ht(n)) return;
|
|
2424
|
+
x = Je(T.uponSanitizeAttribute, x, Qt, Ot);
|
|
2422
2425
|
const f = {
|
|
2423
2426
|
attrName: "",
|
|
2424
2427
|
attrValue: "",
|
|
@@ -2429,13 +2432,13 @@ function So() {
|
|
|
2429
2432
|
let h = d.length;
|
|
2430
2433
|
const g = _(n.nodeName);
|
|
2431
2434
|
for (; h--; ) {
|
|
2432
|
-
const b = d[h], S = b.name, U = b.namespaceURI, B = b.value, ht = _(S),
|
|
2433
|
-
let R = S === "value" ?
|
|
2434
|
-
if (f.attrName = ht, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, G(T.uponSanitizeAttribute, n, f), R = f.attrValue,
|
|
2435
|
+
const b = d[h], S = b.name, U = b.namespaceURI, B = b.value, ht = _(S), fe = B;
|
|
2436
|
+
let R = S === "value" ? fe : Mn(fe), no = !1;
|
|
2437
|
+
if (f.attrName = ht, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, G(T.uponSanitizeAttribute, n, f), R = f.attrValue, Pe && (ht === "id" || ht === "name") && lo(R, ze) !== 0 && (nt(S, n, b), R = ze + R, no = !0), et && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
|
|
2435
2438
|
nt(S, n, b);
|
|
2436
2439
|
continue;
|
|
2437
2440
|
}
|
|
2438
|
-
if (ht === "attributename" &&
|
|
2441
|
+
if (ht === "attributename" && so(R, "href")) {
|
|
2439
2442
|
nt(S, n, b);
|
|
2440
2443
|
continue;
|
|
2441
2444
|
}
|
|
@@ -2444,28 +2447,28 @@ function So() {
|
|
|
2444
2447
|
nt(S, n, b);
|
|
2445
2448
|
continue;
|
|
2446
2449
|
}
|
|
2447
|
-
if (!
|
|
2450
|
+
if (!Re && O(Vn, R)) {
|
|
2448
2451
|
nt(S, n, b);
|
|
2449
2452
|
continue;
|
|
2450
2453
|
}
|
|
2451
|
-
if (q && (R =
|
|
2454
|
+
if (q && (R = Ft(R)), !to(g, ht, R)) {
|
|
2452
2455
|
nt(S, n, b);
|
|
2453
2456
|
continue;
|
|
2454
2457
|
}
|
|
2455
|
-
R =
|
|
2458
|
+
R = an(g, ht, U, R), R !== fe && sn(n, S, U, R) && no && ao(t.removed);
|
|
2456
2459
|
}
|
|
2457
2460
|
}
|
|
2458
2461
|
G(T.afterSanitizeAttributes, n, null), pt(n, a);
|
|
2459
|
-
},
|
|
2462
|
+
}, jt = function(n) {
|
|
2460
2463
|
let a = null;
|
|
2461
|
-
const d =
|
|
2464
|
+
const d = Ze(n);
|
|
2462
2465
|
for (G(T.beforeSanitizeShadowDOM, n, null); a = d.nextNode(); )
|
|
2463
|
-
if (G(T.uponSanitizeShadowNode, a, null),
|
|
2464
|
-
const f =
|
|
2465
|
-
ft(f) && (
|
|
2466
|
+
if (G(T.uponSanitizeShadowNode, a, null), Qe(a, n), oo(a, n), ft(a.content) && jt(a.content), yt(a) === F.element) {
|
|
2467
|
+
const f = Ce(a);
|
|
2468
|
+
ft(f) && (ue(f), jt(f));
|
|
2466
2469
|
}
|
|
2467
2470
|
G(T.afterSanitizeShadowDOM, n, null);
|
|
2468
|
-
},
|
|
2471
|
+
}, ue = function(n) {
|
|
2469
2472
|
const a = [{
|
|
2470
2473
|
node: n,
|
|
2471
2474
|
shadow: null
|
|
@@ -2473,7 +2476,7 @@ function So() {
|
|
|
2473
2476
|
for (; a.length > 0; ) {
|
|
2474
2477
|
const d = a.pop();
|
|
2475
2478
|
if (d.shadow) {
|
|
2476
|
-
|
|
2479
|
+
jt(d.shadow);
|
|
2477
2480
|
continue;
|
|
2478
2481
|
}
|
|
2479
2482
|
const f = d.node, h = yt(f) === F.element, g = D(f);
|
|
@@ -2492,7 +2495,7 @@ function So() {
|
|
|
2492
2495
|
}
|
|
2493
2496
|
}
|
|
2494
2497
|
if (h) {
|
|
2495
|
-
const b =
|
|
2498
|
+
const b = Ce(f);
|
|
2496
2499
|
ft(b) && a.push({
|
|
2497
2500
|
node: null,
|
|
2498
2501
|
shadow: b
|
|
@@ -2505,86 +2508,86 @@ function So() {
|
|
|
2505
2508
|
};
|
|
2506
2509
|
return t.sanitize = function(u) {
|
|
2507
2510
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = null, d = null, f = null, h = null;
|
|
2508
|
-
if (
|
|
2511
|
+
if (re = !u, re && (u = "<!-->"), typeof u != "string" && !Tt(u) && (u = Nn(u), typeof u != "string"))
|
|
2509
2512
|
throw X("dirty is not a string, aborting");
|
|
2510
2513
|
if (!t.isSupported) return u;
|
|
2511
|
-
|
|
2512
|
-
const g =
|
|
2514
|
+
ee ? (k = It, x = Ot) : ce(n), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (k = H(k)), T.uponSanitizeAttribute.length > 0 && (x = H(x)), t.removed = [];
|
|
2515
|
+
const g = ie && typeof u != "string" && Tt(u);
|
|
2513
2516
|
if (g) {
|
|
2514
|
-
|
|
2515
|
-
const U =
|
|
2517
|
+
en(u);
|
|
2518
|
+
const U = Vt(u);
|
|
2516
2519
|
if (typeof U == "string") {
|
|
2517
2520
|
const B = _(U);
|
|
2518
2521
|
if (!k[B] || Et[B])
|
|
2519
|
-
throw
|
|
2522
|
+
throw zt(u), X("root node is forbidden and cannot be sanitized in-place");
|
|
2520
2523
|
}
|
|
2521
|
-
if (
|
|
2522
|
-
throw
|
|
2524
|
+
if (Ht(u))
|
|
2525
|
+
throw zt(u), X("root node is clobbered and cannot be sanitized in-place");
|
|
2523
2526
|
try {
|
|
2524
|
-
|
|
2527
|
+
ue(u);
|
|
2525
2528
|
} catch (B) {
|
|
2526
|
-
throw
|
|
2529
|
+
throw zt(u), B;
|
|
2527
2530
|
}
|
|
2528
2531
|
} else if (Tt(u))
|
|
2529
|
-
a =
|
|
2532
|
+
a = Xe("<!---->"), d = a.ownerDocument.importNode(u, !0), d.nodeType === F.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? a = d : a.appendChild(d), ue(a);
|
|
2530
2533
|
else {
|
|
2531
|
-
if (!st && !q && !ot && u.indexOf("<") === -1) return P &&
|
|
2532
|
-
if (a =
|
|
2534
|
+
if (!st && !q && !ot && u.indexOf("<") === -1) return P && Rt ? at(u) : u;
|
|
2535
|
+
if (a = Xe(u), !a) return st ? null : Rt ? tt : "";
|
|
2533
2536
|
}
|
|
2534
|
-
a &&
|
|
2537
|
+
a && oe && V(a.firstChild);
|
|
2535
2538
|
const b = g ? u : a;
|
|
2536
2539
|
try {
|
|
2537
|
-
const U =
|
|
2540
|
+
const U = Ze(b);
|
|
2538
2541
|
for (; f = U.nextNode(); )
|
|
2539
|
-
|
|
2542
|
+
Qe(f, b), oo(f, b), ft(f.content) && jt(f.content);
|
|
2540
2543
|
} catch (U) {
|
|
2541
|
-
throw g && (
|
|
2542
|
-
B.element &&
|
|
2544
|
+
throw g && (zt(u), it(t.removed, (B) => {
|
|
2545
|
+
B.element && Bt(B.element);
|
|
2543
2546
|
})), U;
|
|
2544
2547
|
}
|
|
2545
2548
|
if (g) {
|
|
2546
2549
|
let U = !1;
|
|
2547
2550
|
if (it(t.removed, (B) => {
|
|
2548
|
-
B.element && (B.element === u && (U = !0),
|
|
2551
|
+
B.element && (B.element === u && (U = !0), Bt(B.element));
|
|
2549
2552
|
}), U) throw X("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
2550
|
-
return q &&
|
|
2553
|
+
return q && de(u), u;
|
|
2551
2554
|
}
|
|
2552
2555
|
if (st) {
|
|
2553
|
-
if (q &&
|
|
2554
|
-
for (h =
|
|
2556
|
+
if (q && de(a), Dt)
|
|
2557
|
+
for (h = No.call(a.ownerDocument); a.firstChild; ) h.appendChild(a.firstChild);
|
|
2555
2558
|
else h = a;
|
|
2556
|
-
return (x.shadowroot || x.shadowrootmode) && (h =
|
|
2559
|
+
return (x.shadowroot || x.shadowrootmode) && (h = zo.call(o, h, !0)), h;
|
|
2557
2560
|
}
|
|
2558
2561
|
let S = ot ? a.outerHTML : a.innerHTML;
|
|
2559
|
-
return ot && k["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && O(
|
|
2560
|
-
` + S), q && (S =
|
|
2562
|
+
return ot && k["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && O(Kn, a.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
|
|
2563
|
+
` + S), q && (S = Ft(S)), P && Rt ? at(S) : S;
|
|
2561
2564
|
}, t.setConfig = function() {
|
|
2562
2565
|
let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2563
|
-
|
|
2566
|
+
ce(u), ee = !0, It = k, Ot = x;
|
|
2564
2567
|
}, t.clearConfig = function() {
|
|
2565
|
-
ut = null,
|
|
2568
|
+
ut = null, ee = !1, It = null, Ot = null, P = Xt, tt = "";
|
|
2566
2569
|
}, t.isValidAttribute = function(u, n, a) {
|
|
2567
|
-
ut ||
|
|
2570
|
+
ut || ce({});
|
|
2568
2571
|
const d = _(u), f = _(n);
|
|
2569
|
-
return
|
|
2572
|
+
return to(d, f, a);
|
|
2570
2573
|
}, t.addHook = function(u, n) {
|
|
2571
2574
|
typeof n == "function" && z(T, u) && kt(T[u], n);
|
|
2572
2575
|
}, t.removeHook = function(u, n) {
|
|
2573
2576
|
if (z(T, u)) {
|
|
2574
2577
|
if (n !== void 0) {
|
|
2575
|
-
const a =
|
|
2576
|
-
return a === -1 ? void 0 :
|
|
2578
|
+
const a = _n(T[u], n);
|
|
2579
|
+
return a === -1 ? void 0 : Ln(T[u], a, 1)[0];
|
|
2577
2580
|
}
|
|
2578
|
-
return
|
|
2581
|
+
return ao(T[u]);
|
|
2579
2582
|
}
|
|
2580
2583
|
}, t.removeHooks = function(u) {
|
|
2581
2584
|
z(T, u) && (T[u] = []);
|
|
2582
2585
|
}, t.removeAllHooks = function() {
|
|
2583
|
-
T =
|
|
2586
|
+
T = vo();
|
|
2584
2587
|
}, t;
|
|
2585
2588
|
}
|
|
2586
|
-
var
|
|
2587
|
-
const
|
|
2589
|
+
var $t = Lo();
|
|
2590
|
+
const ti = [
|
|
2588
2591
|
"p",
|
|
2589
2592
|
"br",
|
|
2590
2593
|
"strong",
|
|
@@ -2630,7 +2633,7 @@ const Jn = [
|
|
|
2630
2633
|
// user-initiated dialog, a different trust boundary that never calls
|
|
2631
2634
|
// through this sanitizer. A consumer that genuinely wants iframes in
|
|
2632
2635
|
// pasted/typed content can still opt in via a custom allowedTags list.
|
|
2633
|
-
],
|
|
2636
|
+
], ei = {
|
|
2634
2637
|
"*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
|
|
2635
2638
|
a: ["href", "target", "rel", "title"],
|
|
2636
2639
|
img: ["src", "alt", "width", "height", "loading"],
|
|
@@ -2645,8 +2648,8 @@ const Jn = [
|
|
|
2645
2648
|
// additionalAllowedTags), restoring the attributes that make an inserted
|
|
2646
2649
|
// iframe actually usable (src, sizing, fullscreen, scrolling/border).
|
|
2647
2650
|
iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
|
|
2648
|
-
},
|
|
2649
|
-
function
|
|
2651
|
+
}, oi = "data-editora-embed";
|
|
2652
|
+
function ni(s) {
|
|
2650
2653
|
if (!s || /\s/.test(s.trim())) return !1;
|
|
2651
2654
|
try {
|
|
2652
2655
|
const t = new URL(s.trim());
|
|
@@ -2655,44 +2658,61 @@ function ei(s) {
|
|
|
2655
2658
|
return !1;
|
|
2656
2659
|
}
|
|
2657
2660
|
}
|
|
2658
|
-
function
|
|
2661
|
+
function Mo(s, t, e, o) {
|
|
2659
2662
|
if ((t == null ? void 0 : t.sanitize) === !1)
|
|
2660
2663
|
return s;
|
|
2661
|
-
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags :
|
|
2662
|
-
for (const
|
|
2663
|
-
for (const
|
|
2664
|
+
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ti, r = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...i, ...e])) : i, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : ei, p = /* @__PURE__ */ new Set();
|
|
2665
|
+
for (const C of Object.values(c))
|
|
2666
|
+
for (const A of C) p.add(A);
|
|
2664
2667
|
const m = {
|
|
2665
2668
|
ALLOWED_TAGS: r,
|
|
2666
2669
|
ALLOWED_ATTR: Array.from(p)
|
|
2667
2670
|
};
|
|
2668
2671
|
if (!o)
|
|
2669
|
-
return
|
|
2672
|
+
return $t.sanitize(s, m);
|
|
2670
2673
|
const E = r.includes("iframe");
|
|
2671
|
-
|
|
2674
|
+
$t.addHook(
|
|
2672
2675
|
"uponSanitizeElement",
|
|
2673
|
-
(
|
|
2676
|
+
(C, A) => {
|
|
2674
2677
|
var v;
|
|
2675
|
-
if (
|
|
2676
|
-
const w =
|
|
2677
|
-
|
|
2678
|
+
if (A.tagName !== "iframe") return;
|
|
2679
|
+
const w = C;
|
|
2680
|
+
A.allowedTags.iframe = E || ((v = w.getAttribute) == null ? void 0 : v.call(w, oi)) === "true" && ni(w.getAttribute("src"));
|
|
2678
2681
|
}
|
|
2679
2682
|
);
|
|
2680
2683
|
try {
|
|
2681
|
-
return
|
|
2684
|
+
return $t.sanitize(s, m);
|
|
2682
2685
|
} finally {
|
|
2683
|
-
|
|
2686
|
+
$t.removeHook("uponSanitizeElement");
|
|
2684
2687
|
}
|
|
2685
2688
|
}
|
|
2686
|
-
function
|
|
2687
|
-
return
|
|
2689
|
+
function ii(s, t, e, o) {
|
|
2690
|
+
return Mo(s, t, o, !1);
|
|
2691
|
+
}
|
|
2692
|
+
function ri(s, t, e) {
|
|
2693
|
+
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? s : ii(s, t);
|
|
2694
|
+
}
|
|
2695
|
+
function Eo(s, t, e, o) {
|
|
2696
|
+
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? s : Mo(s, t, o, !0);
|
|
2688
2697
|
}
|
|
2689
|
-
|
|
2690
|
-
|
|
2698
|
+
const ai = ".resize-handle, .table-resize-handle", si = /resize-handle/;
|
|
2699
|
+
function Io(s) {
|
|
2700
|
+
if (!s || !si.test(s)) return s;
|
|
2701
|
+
const t = document.createElement("template");
|
|
2702
|
+
t.innerHTML = s;
|
|
2703
|
+
const e = /* @__PURE__ */ new Set();
|
|
2704
|
+
return t.content.querySelectorAll(ai).forEach((o) => {
|
|
2705
|
+
const i = o.parentElement;
|
|
2706
|
+
i && (i.tagName === "TD" || i.tagName === "TH") && e.add(i), o.remove();
|
|
2707
|
+
}), e.forEach((o) => {
|
|
2708
|
+
var i;
|
|
2709
|
+
o.style.position === "relative" && (o.style.removeProperty("position"), (i = o.getAttribute("style")) != null && i.trim() || o.removeAttribute("style"));
|
|
2710
|
+
}), t.innerHTML;
|
|
2691
2711
|
}
|
|
2692
|
-
function
|
|
2693
|
-
return
|
|
2712
|
+
function At(s) {
|
|
2713
|
+
return s ? Io(s.innerHTML) : "";
|
|
2694
2714
|
}
|
|
2695
|
-
const
|
|
2715
|
+
const Yt = class Yt {
|
|
2696
2716
|
/**
|
|
2697
2717
|
* Resolve configuration from multiple sources with priority
|
|
2698
2718
|
*/
|
|
@@ -2884,7 +2904,7 @@ const Kt = class Kt {
|
|
|
2884
2904
|
return e;
|
|
2885
2905
|
}
|
|
2886
2906
|
};
|
|
2887
|
-
|
|
2907
|
+
Yt.EDITOR_DEFAULTS = {
|
|
2888
2908
|
height: 400,
|
|
2889
2909
|
width: "100%",
|
|
2890
2910
|
readonly: !1,
|
|
@@ -2933,7 +2953,7 @@ Kt.EDITOR_DEFAULTS = {
|
|
|
2933
2953
|
sanitizeOnInput: !0
|
|
2934
2954
|
},
|
|
2935
2955
|
statusbar: !1
|
|
2936
|
-
},
|
|
2956
|
+
}, Yt.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
2937
2957
|
"readonly",
|
|
2938
2958
|
"disabled",
|
|
2939
2959
|
"autofocus",
|
|
@@ -2953,8 +2973,8 @@ Kt.EDITOR_DEFAULTS = {
|
|
|
2953
2973
|
"security-sanitize-on-paste",
|
|
2954
2974
|
"security-sanitize-on-input"
|
|
2955
2975
|
]);
|
|
2956
|
-
let
|
|
2957
|
-
class
|
|
2976
|
+
let ke = Yt;
|
|
2977
|
+
class li {
|
|
2958
2978
|
constructor() {
|
|
2959
2979
|
this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
|
|
2960
2980
|
}
|
|
@@ -3028,91 +3048,91 @@ class ii {
|
|
|
3028
3048
|
return this.loadedPlugins.has(t);
|
|
3029
3049
|
}
|
|
3030
3050
|
}
|
|
3031
|
-
const ri = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}';
|
|
3032
|
-
let
|
|
3033
|
-
const
|
|
3034
|
-
let J = null,
|
|
3035
|
-
function
|
|
3051
|
+
const ci = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}';
|
|
3052
|
+
let Gt;
|
|
3053
|
+
const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", wo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", To = ".rte-content, .editora-content", xe = /* @__PURE__ */ new Set();
|
|
3054
|
+
let J = null, ko = !1, ve = null, Ee = null;
|
|
3055
|
+
function xo(s) {
|
|
3036
3056
|
if (!(s instanceof HTMLElement)) return !1;
|
|
3037
3057
|
const t = s;
|
|
3038
3058
|
return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
|
|
3039
3059
|
}
|
|
3040
|
-
function
|
|
3060
|
+
function fi(s) {
|
|
3041
3061
|
return s ? s.nodeType === Node.ELEMENT_NODE ? s : s.parentElement : null;
|
|
3042
3062
|
}
|
|
3043
|
-
function
|
|
3063
|
+
function St(s) {
|
|
3044
3064
|
if (!s) return null;
|
|
3045
|
-
if (
|
|
3065
|
+
if (xo(s))
|
|
3046
3066
|
return s;
|
|
3047
|
-
const t = s.matches(
|
|
3048
|
-
return !t || !
|
|
3067
|
+
const t = s.matches(wo) ? s : s.closest(wo);
|
|
3068
|
+
return !t || !xo(t) ? null : t;
|
|
3049
3069
|
}
|
|
3050
|
-
function
|
|
3070
|
+
function pi() {
|
|
3051
3071
|
var i;
|
|
3052
3072
|
if (typeof window == "undefined") return null;
|
|
3053
|
-
const s = window[
|
|
3073
|
+
const s = window[di];
|
|
3054
3074
|
if (s instanceof HTMLElement) {
|
|
3055
|
-
const r =
|
|
3075
|
+
const r = St(s);
|
|
3056
3076
|
if (r) return r;
|
|
3057
|
-
const l = s.matches(
|
|
3077
|
+
const l = s.matches(To) ? s : s.querySelector(To);
|
|
3058
3078
|
if (l) {
|
|
3059
|
-
const c =
|
|
3079
|
+
const c = St(l);
|
|
3060
3080
|
if (c) return c;
|
|
3061
3081
|
}
|
|
3062
3082
|
}
|
|
3063
|
-
const t = window[
|
|
3083
|
+
const t = window[ui];
|
|
3064
3084
|
if (t instanceof HTMLElement) {
|
|
3065
|
-
const r =
|
|
3085
|
+
const r = St(t);
|
|
3066
3086
|
if (r) return r;
|
|
3067
3087
|
}
|
|
3068
3088
|
const e = document.activeElement;
|
|
3069
3089
|
if (e) {
|
|
3070
|
-
const r =
|
|
3090
|
+
const r = St(e);
|
|
3071
3091
|
if (r) return r;
|
|
3072
3092
|
}
|
|
3073
3093
|
const o = (i = window.getSelection) == null ? void 0 : i.call(window);
|
|
3074
3094
|
if (o && o.rangeCount > 0) {
|
|
3075
|
-
const r =
|
|
3095
|
+
const r = St(fi(o.getRangeAt(0).startContainer));
|
|
3076
3096
|
if (r) return r;
|
|
3077
3097
|
}
|
|
3078
3098
|
if (J && J.isConnected)
|
|
3079
3099
|
return J;
|
|
3080
|
-
for (const r of
|
|
3100
|
+
for (const r of xe)
|
|
3081
3101
|
if (r.isConnected) return r;
|
|
3082
3102
|
return null;
|
|
3083
3103
|
}
|
|
3084
|
-
function
|
|
3085
|
-
if (typeof window == "undefined" ||
|
|
3086
|
-
|
|
3104
|
+
function hi() {
|
|
3105
|
+
if (typeof window == "undefined" || ko) return;
|
|
3106
|
+
ve = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, Ee = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
|
|
3087
3107
|
const s = (t, ...e) => {
|
|
3088
|
-
const o =
|
|
3089
|
-
return o ? o.execCommand(t, ...e) :
|
|
3108
|
+
const o = pi();
|
|
3109
|
+
return o ? o.execCommand(t, ...e) : ve ? ve(t, ...e) : Ee ? Ee(t, ...e) : !1;
|
|
3090
3110
|
};
|
|
3091
|
-
window.executeEditorCommand = s, window.execEditorCommand = s,
|
|
3111
|
+
window.executeEditorCommand = s, window.execEditorCommand = s, ko = !0;
|
|
3092
3112
|
}
|
|
3093
|
-
function
|
|
3113
|
+
function mi() {
|
|
3094
3114
|
const s = "editora-webcomponent-styles";
|
|
3095
3115
|
if (!document.getElementById(s)) {
|
|
3096
3116
|
const t = document.createElement("style");
|
|
3097
|
-
t.id = s, t.textContent =
|
|
3117
|
+
t.id = s, t.textContent = ci, document.head.appendChild(t);
|
|
3098
3118
|
}
|
|
3099
3119
|
}
|
|
3100
|
-
function
|
|
3101
|
-
if (
|
|
3120
|
+
function Oo() {
|
|
3121
|
+
if (!Gt) {
|
|
3102
3122
|
const s = gt.__globalPluginLoader;
|
|
3103
|
-
s ?
|
|
3123
|
+
s ? Gt = s : Gt = new li();
|
|
3104
3124
|
}
|
|
3105
|
-
return
|
|
3125
|
+
return Gt;
|
|
3106
3126
|
}
|
|
3107
|
-
function
|
|
3108
|
-
const t =
|
|
3127
|
+
function bi(s) {
|
|
3128
|
+
const t = Oo();
|
|
3109
3129
|
Object.entries(s).forEach(([e, o]) => {
|
|
3110
3130
|
t.register(e, o);
|
|
3111
3131
|
});
|
|
3112
3132
|
}
|
|
3113
3133
|
class gt extends HTMLElement {
|
|
3114
3134
|
constructor() {
|
|
3115
|
-
if (super(), this.pluginLoader =
|
|
3135
|
+
if (super(), this.pluginLoader = Oo(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new cn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.lastBeforeInputType = null, mi(), !this.hasAttribute("data-initial-content")) {
|
|
3116
3136
|
const t = this.innerHTML.trim();
|
|
3117
3137
|
t && this.setAttribute("data-initial-content", t);
|
|
3118
3138
|
}
|
|
@@ -3211,29 +3231,31 @@ class gt extends HTMLElement {
|
|
|
3211
3231
|
* Initialize the editor
|
|
3212
3232
|
*/
|
|
3213
3233
|
async initialize() {
|
|
3214
|
-
var
|
|
3234
|
+
var i;
|
|
3215
3235
|
if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
|
|
3216
|
-
this.setAttribute("data-editora-editor", "true"),
|
|
3236
|
+
this.setAttribute("data-editora-editor", "true"), xe.add(this), J || (J = this), hi(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.config.theme && this.classList.add(`editora-theme-${this.config.theme}`);
|
|
3217
3237
|
const t = await this.loadPlugins();
|
|
3218
|
-
if (this.loadedPlugins = t, t.forEach((
|
|
3219
|
-
if (
|
|
3238
|
+
if (this.loadedPlugins = t, t.forEach((r) => {
|
|
3239
|
+
if (r.init && typeof r.init == "function")
|
|
3220
3240
|
try {
|
|
3221
|
-
|
|
3222
|
-
} catch (
|
|
3223
|
-
console.error(`[RichTextEditor] Error initializing plugin ${
|
|
3241
|
+
r.init({ editorElement: this });
|
|
3242
|
+
} catch (l) {
|
|
3243
|
+
console.error(`[RichTextEditor] Error initializing plugin ${r.name}:`, l);
|
|
3224
3244
|
}
|
|
3225
3245
|
}), !this.hasAttribute("data-initial-content") && !this.contentElement) {
|
|
3226
|
-
const
|
|
3227
|
-
|
|
3246
|
+
const r = this.innerHTML.trim();
|
|
3247
|
+
r && this.setAttribute("data-initial-content", r);
|
|
3228
3248
|
}
|
|
3229
|
-
const e = this.
|
|
3230
|
-
|
|
3249
|
+
const e = this.preservedContent;
|
|
3250
|
+
this.preservedContent = null;
|
|
3251
|
+
const o = this.sanitizeLoadedContent(
|
|
3252
|
+
(i = e != null ? e : this.restoreAutosavedContent()) != null ? i : this.getAttribute("data-initial-content") || ""
|
|
3231
3253
|
);
|
|
3232
|
-
this.engine = new
|
|
3233
|
-
content:
|
|
3254
|
+
this.engine = new un({
|
|
3255
|
+
content: o,
|
|
3234
3256
|
plugins: t,
|
|
3235
3257
|
readonly: this.config.readonly
|
|
3236
|
-
}), this.createUI(t,
|
|
3258
|
+
}), this.createUI(t, o), this.setupEventListeners(), this.startAutosave(), this.isInitialized = !0, this.dispatchEvent(new CustomEvent("editor-ready", {
|
|
3237
3259
|
detail: { api: this.getAPI() },
|
|
3238
3260
|
bubbles: !0
|
|
3239
3261
|
}));
|
|
@@ -3463,7 +3485,7 @@ class gt extends HTMLElement {
|
|
|
3463
3485
|
* editable DOM: sanitizing only after the first edit leaves the page exposed until then.
|
|
3464
3486
|
*/
|
|
3465
3487
|
sanitizeLoadedContent(t) {
|
|
3466
|
-
return
|
|
3488
|
+
return Eo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
|
|
3467
3489
|
}
|
|
3468
3490
|
getAutosaveConfig() {
|
|
3469
3491
|
var e, o;
|
|
@@ -3531,8 +3553,7 @@ class gt extends HTMLElement {
|
|
|
3531
3553
|
this.stopAutosave();
|
|
3532
3554
|
const t = this.getAutosaveConfig();
|
|
3533
3555
|
!t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
|
|
3534
|
-
|
|
3535
|
-
this.persistAutosave(((e = this.contentElement) == null ? void 0 : e.innerHTML) || "");
|
|
3556
|
+
this.persistAutosave(At(this.contentElement));
|
|
3536
3557
|
}, t.intervalMs));
|
|
3537
3558
|
}
|
|
3538
3559
|
insertHTMLAtSelection(t) {
|
|
@@ -3555,7 +3576,7 @@ class gt extends HTMLElement {
|
|
|
3555
3576
|
*/
|
|
3556
3577
|
createUI(t, e) {
|
|
3557
3578
|
const o = this.querySelector('[slot="toolbar"]'), i = this.querySelector('[slot="statusbar"]');
|
|
3558
|
-
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
|
|
3579
|
+
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 fn(
|
|
3559
3580
|
{
|
|
3560
3581
|
items: this.resolveToolbarItems(),
|
|
3561
3582
|
sticky: this.isToolbarStickyEnabled(),
|
|
@@ -3592,7 +3613,7 @@ class gt extends HTMLElement {
|
|
|
3592
3613
|
}) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
|
|
3593
3614
|
} else
|
|
3594
3615
|
this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
|
|
3595
|
-
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new
|
|
3616
|
+
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new pn({ enabled: !0 }), this.floatingToolbar.create(this)), i ? this.appendChild(i) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new hn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
|
|
3596
3617
|
var r;
|
|
3597
3618
|
return (r = this.contentElement) == null ? void 0 : r.focus();
|
|
3598
3619
|
}, 0);
|
|
@@ -3606,12 +3627,12 @@ class gt extends HTMLElement {
|
|
|
3606
3627
|
this.contentElement.addEventListener("beforeinput", (o) => {
|
|
3607
3628
|
this.lastBeforeInputType = o.inputType || null;
|
|
3608
3629
|
}), this.contentElement.addEventListener("input", (o) => {
|
|
3609
|
-
var
|
|
3630
|
+
var A;
|
|
3610
3631
|
if (!this.contentElement) return;
|
|
3611
3632
|
let i = this.contentElement.innerHTML;
|
|
3612
|
-
const r = (
|
|
3633
|
+
const r = (A = o == null ? void 0 : o.detail) == null ? void 0 : A.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = this.lastBeforeInputType;
|
|
3613
3634
|
if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
|
|
3614
|
-
const w =
|
|
3635
|
+
const w = Eo(i, c, p, r);
|
|
3615
3636
|
if (w !== i) {
|
|
3616
3637
|
const v = window.getSelection(), K = v && v.rangeCount > 0 ? v.getRangeAt(0) : null;
|
|
3617
3638
|
if (this.contentElement.innerHTML = w, K && v)
|
|
@@ -3623,24 +3644,24 @@ class gt extends HTMLElement {
|
|
|
3623
3644
|
}
|
|
3624
3645
|
}
|
|
3625
3646
|
this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
|
|
3626
|
-
const
|
|
3647
|
+
const C = () => {
|
|
3627
3648
|
this.dispatchEvent(new CustomEvent("content-change", {
|
|
3628
|
-
detail: { html: i },
|
|
3649
|
+
detail: { html: Io(i) },
|
|
3629
3650
|
bubbles: !0
|
|
3630
3651
|
}));
|
|
3631
3652
|
};
|
|
3632
|
-
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(
|
|
3653
|
+
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(C, l.debounceInputMs) : C(), this.updateStatusBar();
|
|
3633
3654
|
}), this.contentElement.addEventListener("contextmenu", (o) => {
|
|
3634
3655
|
const i = this.config.contextMenu;
|
|
3635
3656
|
(i === !1 || typeof i == "object" && i !== null && i.enabled === !1) && o.preventDefault();
|
|
3636
3657
|
}), this.contentElement.addEventListener("paste", (o) => {
|
|
3637
|
-
var E,
|
|
3658
|
+
var E, C;
|
|
3638
3659
|
if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
|
|
3639
3660
|
return;
|
|
3640
3661
|
o.preventDefault();
|
|
3641
3662
|
const i = this.config.paste || {};
|
|
3642
3663
|
let r = ((E = o.clipboardData) == null ? void 0 : E.getData("text/html")) || "";
|
|
3643
|
-
const l = ((
|
|
3664
|
+
const l = ((C = o.clipboardData) == null ? void 0 : C.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
|
|
3644
3665
|
if ((i.clean || !i.keepFormatting) && l) {
|
|
3645
3666
|
document.execCommand("insertText", !1, l);
|
|
3646
3667
|
return;
|
|
@@ -3650,7 +3671,7 @@ class gt extends HTMLElement {
|
|
|
3650
3671
|
return;
|
|
3651
3672
|
}
|
|
3652
3673
|
if (r) {
|
|
3653
|
-
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r =
|
|
3674
|
+
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ri(r, c, p)), this.insertHTMLAtSelection(r);
|
|
3654
3675
|
return;
|
|
3655
3676
|
}
|
|
3656
3677
|
l && document.execCommand("insertText", !1, l);
|
|
@@ -3658,7 +3679,7 @@ class gt extends HTMLElement {
|
|
|
3658
3679
|
J = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
|
|
3659
3680
|
}), this.contentElement.addEventListener("blur", () => {
|
|
3660
3681
|
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
|
|
3661
|
-
detail: { html: this.contentElement
|
|
3682
|
+
detail: { html: At(this.contentElement) },
|
|
3662
3683
|
bubbles: !0
|
|
3663
3684
|
})), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
|
|
3664
3685
|
}), this.contentElement.addEventListener("keydown", (o) => {
|
|
@@ -3739,10 +3760,10 @@ class gt extends HTMLElement {
|
|
|
3739
3760
|
const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
|
|
3740
3761
|
if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
|
|
3741
3762
|
return;
|
|
3742
|
-
const o = this.contentElement.textContent || "", { words: i, chars: r } =
|
|
3763
|
+
const o = this.contentElement.textContent || "", { words: i, chars: r } = yn(o), l = bn(this.contentElement);
|
|
3743
3764
|
let c, p;
|
|
3744
3765
|
const m = this.getSelectionRangeInEditor();
|
|
3745
|
-
m && (c =
|
|
3766
|
+
m && (c = mn(this.contentElement, m), m.collapsed || (p = vn(m, c), c = void 0)), this.statusBar.update({
|
|
3746
3767
|
wordCount: i,
|
|
3747
3768
|
charCount: r,
|
|
3748
3769
|
lineCount: l,
|
|
@@ -3834,7 +3855,7 @@ class gt extends HTMLElement {
|
|
|
3834
3855
|
const o = this.attributes[e];
|
|
3835
3856
|
t[o.name] = o.value;
|
|
3836
3857
|
}
|
|
3837
|
-
return
|
|
3858
|
+
return ke.resolve({
|
|
3838
3859
|
jsConfig: this.jsConfig,
|
|
3839
3860
|
attributes: t
|
|
3840
3861
|
});
|
|
@@ -3844,10 +3865,7 @@ class gt extends HTMLElement {
|
|
|
3844
3865
|
*/
|
|
3845
3866
|
getAPI() {
|
|
3846
3867
|
return {
|
|
3847
|
-
getContent: () =>
|
|
3848
|
-
var t;
|
|
3849
|
-
return ((t = this.contentElement) == null ? void 0 : t.innerHTML) || "";
|
|
3850
|
-
},
|
|
3868
|
+
getContent: () => At(this.contentElement),
|
|
3851
3869
|
setContent: (t) => {
|
|
3852
3870
|
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
3853
3871
|
},
|
|
@@ -3875,12 +3893,11 @@ class gt extends HTMLElement {
|
|
|
3875
3893
|
*/
|
|
3876
3894
|
destroy() {
|
|
3877
3895
|
var t, e, o, i;
|
|
3878
|
-
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.
|
|
3896
|
+
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = At(this.contentElement), this.persistAutosave(this.preservedContent)), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (i = this.statusBar) == null || i.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, xe.delete(this), J === this && (J = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
|
|
3879
3897
|
}
|
|
3880
3898
|
// Public API methods
|
|
3881
3899
|
getContent() {
|
|
3882
|
-
|
|
3883
|
-
return ((t = this.contentElement) == null ? void 0 : t.innerHTML) || "";
|
|
3900
|
+
return At(this.contentElement);
|
|
3884
3901
|
}
|
|
3885
3902
|
setContent(t) {
|
|
3886
3903
|
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
@@ -3898,26 +3915,29 @@ class gt extends HTMLElement {
|
|
|
3898
3915
|
}
|
|
3899
3916
|
}
|
|
3900
3917
|
export {
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3918
|
+
dn as C,
|
|
3919
|
+
Kt as E,
|
|
3920
|
+
pn as F,
|
|
3921
|
+
cn as K,
|
|
3922
|
+
Co as P,
|
|
3906
3923
|
gt as R,
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3924
|
+
ln as S,
|
|
3925
|
+
fn as T,
|
|
3926
|
+
un as a,
|
|
3927
|
+
ke as b,
|
|
3928
|
+
li as c,
|
|
3929
|
+
hn as d,
|
|
3930
|
+
yn as e,
|
|
3931
|
+
bn as f,
|
|
3932
|
+
gi as g,
|
|
3933
|
+
At as h,
|
|
3934
|
+
mn as i,
|
|
3935
|
+
vn as j,
|
|
3936
|
+
gn as k,
|
|
3937
|
+
Eo as l,
|
|
3938
|
+
ri as m,
|
|
3939
|
+
Io as n,
|
|
3940
|
+
bi as o,
|
|
3941
|
+
ii as s
|
|
3922
3942
|
};
|
|
3923
|
-
//# sourceMappingURL=index-
|
|
3943
|
+
//# sourceMappingURL=index-DeUjxpKd.mjs.map
|