@editora/core 1.0.32 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -3
- package/dist/{VersionDiffPlugin.native-DJZIzFSK.mjs → VersionDiffPlugin.native-2v8ZaZWN.mjs} +248 -247
- package/dist/editora.min.js +21 -21
- package/dist/editora.umd.js +15 -15
- package/dist/index-BahpGXyw.js +12 -0
- package/dist/{index-BV8-D8fY.mjs → index-BlsTuyTe.mjs} +646 -577
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/plugin-loader.js +3 -3
- package/dist/webcomponent-core.js +433 -364
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +29 -29
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +437 -368
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +253 -253
- package/package.json +1 -1
- package/dist/index--nPMqCvI.js +0 -12
package/dist/webcomponent.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class _o {
|
|
2
2
|
constructor() {
|
|
3
3
|
this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
|
|
4
4
|
}
|
|
@@ -98,7 +98,7 @@ class Yt {
|
|
|
98
98
|
return new Yt(t, e || this.selection, this.schema);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
class
|
|
101
|
+
class dn {
|
|
102
102
|
constructor(t, e) {
|
|
103
103
|
this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
|
|
104
104
|
}
|
|
@@ -109,7 +109,7 @@ class ln {
|
|
|
109
109
|
return { type: "text", text: t, marks: e };
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
class
|
|
112
|
+
class un {
|
|
113
113
|
constructor() {
|
|
114
114
|
this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
|
|
115
115
|
}
|
|
@@ -146,7 +146,7 @@ class cn {
|
|
|
146
146
|
const t = {}, e = {};
|
|
147
147
|
return this.plugins.forEach((o) => {
|
|
148
148
|
o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
|
|
149
|
-
}), new
|
|
149
|
+
}), new dn(t, e);
|
|
150
150
|
}
|
|
151
151
|
getCommands() {
|
|
152
152
|
const t = {};
|
|
@@ -200,7 +200,7 @@ class cn {
|
|
|
200
200
|
await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
class
|
|
203
|
+
class pn {
|
|
204
204
|
constructor(t = {}) {
|
|
205
205
|
this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
|
|
206
206
|
this.register(e, o);
|
|
@@ -243,11 +243,11 @@ class dn {
|
|
|
243
243
|
this.commands.clear();
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
class
|
|
246
|
+
class fn {
|
|
247
247
|
constructor(t = {}) {
|
|
248
|
-
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new
|
|
248
|
+
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new un(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
|
|
249
249
|
const e = this.pluginManager.buildSchema();
|
|
250
|
-
this.state = Yt.create(e), this.commandRegistry = new
|
|
250
|
+
this.state = Yt.create(e), this.commandRegistry = new pn(this.pluginManager.getCommands());
|
|
251
251
|
}
|
|
252
252
|
/**
|
|
253
253
|
* Execute a command
|
|
@@ -329,7 +329,7 @@ class un {
|
|
|
329
329
|
return this.isDestroyed;
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
class
|
|
332
|
+
class hn {
|
|
333
333
|
constructor(t, e, o) {
|
|
334
334
|
this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (r) => {
|
|
335
335
|
var l, c;
|
|
@@ -424,14 +424,14 @@ class pn {
|
|
|
424
424
|
const p = [];
|
|
425
425
|
c.split(/\s+/).filter(Boolean).forEach((g) => {
|
|
426
426
|
if (g === "direction") {
|
|
427
|
-
const
|
|
428
|
-
|
|
427
|
+
const v = a.get("setDirectionLTR"), T = a.get("setDirectionRTL");
|
|
428
|
+
v && p.push({
|
|
429
429
|
id: "directionLTR",
|
|
430
|
-
label:
|
|
431
|
-
command:
|
|
432
|
-
icon:
|
|
433
|
-
type:
|
|
434
|
-
options:
|
|
430
|
+
label: v.label,
|
|
431
|
+
command: v.command,
|
|
432
|
+
icon: v.icon,
|
|
433
|
+
type: v.type || "button",
|
|
434
|
+
options: v.options
|
|
435
435
|
}), T && p.push({
|
|
436
436
|
id: "directionRTL",
|
|
437
437
|
label: T.label,
|
|
@@ -443,14 +443,14 @@ class pn {
|
|
|
443
443
|
return;
|
|
444
444
|
}
|
|
445
445
|
if (g === "comments") {
|
|
446
|
-
const
|
|
447
|
-
|
|
446
|
+
const v = a.get("addComment"), T = a.get("toggleComments");
|
|
447
|
+
v && p.push({
|
|
448
448
|
id: "addComment",
|
|
449
|
-
label:
|
|
450
|
-
command:
|
|
451
|
-
icon:
|
|
452
|
-
type:
|
|
453
|
-
options:
|
|
449
|
+
label: v.label,
|
|
450
|
+
command: v.command,
|
|
451
|
+
icon: v.icon,
|
|
452
|
+
type: v.type || "button",
|
|
453
|
+
options: v.options
|
|
454
454
|
}), T && p.push({
|
|
455
455
|
id: "toggleComments",
|
|
456
456
|
label: T.label,
|
|
@@ -516,24 +516,24 @@ class pn {
|
|
|
516
516
|
const c = this.overflowUnits;
|
|
517
517
|
if (c.length === 0) return;
|
|
518
518
|
c.forEach((B) => {
|
|
519
|
-
var
|
|
520
|
-
B.parentElement === r && ((
|
|
519
|
+
var P;
|
|
520
|
+
B.parentElement === r && ((P = this.overflowUnitHomes.get(B)) == null || P.appendChild(B));
|
|
521
521
|
});
|
|
522
|
-
const p = t.clientWidth, m = 16, g = 40, w = 4, k = Math.max(0, p - m),
|
|
523
|
-
const
|
|
524
|
-
return T ? et.right -
|
|
522
|
+
const p = t.clientWidth, m = 16, g = 40, w = 4, k = Math.max(0, p - m), v = Math.max(0, k - g - w), T = getComputedStyle(t).direction === "rtl", et = e.getBoundingClientRect(), G = (B) => {
|
|
523
|
+
const P = B.getBoundingClientRect();
|
|
524
|
+
return T ? et.right - P.left : P.right - et.left;
|
|
525
525
|
};
|
|
526
526
|
let z = 0;
|
|
527
527
|
if (G(c[c.length - 1]) <= k)
|
|
528
528
|
z = c.length;
|
|
529
529
|
else
|
|
530
530
|
for (const B of c)
|
|
531
|
-
if (G(B) <=
|
|
531
|
+
if (G(B) <= v) z++;
|
|
532
532
|
else break;
|
|
533
533
|
z = Math.max(1, Math.min(z, c.length));
|
|
534
534
|
const st = z < c.length;
|
|
535
|
-
o.style.display = st ? "" : "none", o.classList.toggle("active", st && this.expandedOpen), !st && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B,
|
|
536
|
-
|
|
535
|
+
o.style.display = st ? "" : "none", o.classList.toggle("active", st && this.expandedOpen), !st && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B, P) => {
|
|
536
|
+
P >= z && r.appendChild(B);
|
|
537
537
|
});
|
|
538
538
|
}, l = () => {
|
|
539
539
|
this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(a);
|
|
@@ -643,8 +643,8 @@ class pn {
|
|
|
643
643
|
}), o.addEventListener("keydown", (m) => {
|
|
644
644
|
const g = a();
|
|
645
645
|
if (g.length === 0) return;
|
|
646
|
-
const w = g.indexOf(document.activeElement), k = (
|
|
647
|
-
m.preventDefault(), g[(
|
|
646
|
+
const w = g.indexOf(document.activeElement), k = (v) => {
|
|
647
|
+
m.preventDefault(), g[(v + g.length) % g.length].focus();
|
|
648
648
|
};
|
|
649
649
|
switch (m.key) {
|
|
650
650
|
case "ArrowDown":
|
|
@@ -759,7 +759,7 @@ class pn {
|
|
|
759
759
|
}), this.container.innerHTML = ""), (t = this.resizeObserver) == null || t.disconnect(), this.resizeObserver = void 0, this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), document.removeEventListener("mousedown", this.onDocumentPointerDownForOverflow, !0), this.itemsContainer = void 0, this.moreButton = void 0, this.expandedRow = void 0, this.commandHandler = void 0;
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
|
-
class
|
|
762
|
+
class mn {
|
|
763
763
|
constructor(t) {
|
|
764
764
|
this.visible = !1, this.config = t;
|
|
765
765
|
}
|
|
@@ -801,7 +801,7 @@ class fn {
|
|
|
801
801
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
|
-
class
|
|
804
|
+
class gn {
|
|
805
805
|
constructor(t = {}) {
|
|
806
806
|
this.statusInfo = {}, this.config = t;
|
|
807
807
|
}
|
|
@@ -861,12 +861,12 @@ class hn {
|
|
|
861
861
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
|
|
862
862
|
}
|
|
863
863
|
}
|
|
864
|
-
function
|
|
865
|
-
const e = n.textContent || "", o =
|
|
864
|
+
function bn(n, t) {
|
|
865
|
+
const e = n.textContent || "", o = yn(n, t.startContainer, t.startOffset), a = e.substring(0, o).split(`
|
|
866
866
|
`), l = a.length, c = a[a.length - 1].length + 1;
|
|
867
867
|
return { line: l, column: c };
|
|
868
868
|
}
|
|
869
|
-
function
|
|
869
|
+
function yn(n, t, e) {
|
|
870
870
|
var l;
|
|
871
871
|
let o = 0;
|
|
872
872
|
const r = document.createTreeWalker(
|
|
@@ -884,7 +884,7 @@ function gn(n, t, e) {
|
|
|
884
884
|
}
|
|
885
885
|
return o;
|
|
886
886
|
}
|
|
887
|
-
function
|
|
887
|
+
function En(n) {
|
|
888
888
|
var o, r;
|
|
889
889
|
const t = n.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
|
|
890
890
|
let e = 1;
|
|
@@ -899,11 +899,11 @@ function bn(n) {
|
|
|
899
899
|
}
|
|
900
900
|
return e;
|
|
901
901
|
}
|
|
902
|
-
function
|
|
902
|
+
function vn(n) {
|
|
903
903
|
const t = n.trim() ? n.trim().split(/\s+/).length : 0, e = n.length;
|
|
904
904
|
return { words: t, chars: e };
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function wn(n, t) {
|
|
907
907
|
const e = n.toString();
|
|
908
908
|
return {
|
|
909
909
|
startLine: t.line,
|
|
@@ -915,7 +915,7 @@ function vn(n, t) {
|
|
|
915
915
|
selectedWords: e.trim().split(/\s+/).filter(Boolean).length
|
|
916
916
|
};
|
|
917
917
|
}
|
|
918
|
-
class
|
|
918
|
+
class kn {
|
|
919
919
|
constructor(t) {
|
|
920
920
|
this.shortcuts = /* @__PURE__ */ new Map(), this.enabled = !0, this.isMac = typeof navigator != "undefined" && navigator.platform.toUpperCase().indexOf("MAC") >= 0, (t == null ? void 0 : t.enabled) === !1 && (this.enabled = !1), this.registerDefaultShortcuts(), t != null && t.shortcuts && t.shortcuts.forEach((e) => this.registerShortcut(e)), t != null && t.customShortcuts && Object.values(t.customShortcuts).forEach((e) => {
|
|
921
921
|
this.registerShortcut(e);
|
|
@@ -1250,15 +1250,15 @@ class En {
|
|
|
1250
1250
|
return t.includes("toggle") && (t.includes("Bold") || t.includes("Italic") || t.includes("Underline") || t.includes("Strike") || t.includes("Code") || t.includes("Super") || t.includes("Sub")) ? "Text Formatting" : t.includes("Heading") || t.includes("Paragraph") ? "Block Formatting" : t.includes("List") || t.includes("Checklist") ? "Lists" : t.includes("Alignment") || t.includes("Indent") ? "Alignment & Indentation" : t.includes("undo") || t.includes("redo") ? "History" : t.includes("insert") ? "Insert" : t.includes("find") || t.includes("replace") ? "Find & Replace" : t.includes("Accessibility") || t.includes("spell") ? "Tools" : "Other";
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
|
-
function
|
|
1253
|
+
function ao(n, t) {
|
|
1254
1254
|
(t == null || t > n.length) && (t = n.length);
|
|
1255
1255
|
for (var e = 0, o = Array(t); e < t; e++) o[e] = n[e];
|
|
1256
1256
|
return o;
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1258
|
+
function Tn(n) {
|
|
1259
1259
|
if (Array.isArray(n)) return n;
|
|
1260
1260
|
}
|
|
1261
|
-
function
|
|
1261
|
+
function Cn(n, t) {
|
|
1262
1262
|
var e = n == null ? null : typeof Symbol != "undefined" && n[Symbol.iterator] || n["@@iterator"];
|
|
1263
1263
|
if (e != null) {
|
|
1264
1264
|
var o, r, a, l, c = [], p = !0, m = !1;
|
|
@@ -1276,29 +1276,29 @@ function kn(n, t) {
|
|
|
1276
1276
|
return c;
|
|
1277
1277
|
}
|
|
1278
1278
|
}
|
|
1279
|
-
function
|
|
1279
|
+
function xn() {
|
|
1280
1280
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1281
1281
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1282
1282
|
}
|
|
1283
|
-
function
|
|
1284
|
-
return
|
|
1283
|
+
function An(n, t) {
|
|
1284
|
+
return Tn(n) || Cn(n, t) || Sn(n, t) || xn();
|
|
1285
1285
|
}
|
|
1286
|
-
function
|
|
1286
|
+
function Sn(n, t) {
|
|
1287
1287
|
if (n) {
|
|
1288
|
-
if (typeof n == "string") return
|
|
1288
|
+
if (typeof n == "string") return ao(n, t);
|
|
1289
1289
|
var e = {}.toString.call(n).slice(8, -1);
|
|
1290
|
-
return e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set" ? Array.from(n) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ?
|
|
1290
|
+
return e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set" ? Array.from(n) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ao(n, t) : void 0;
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
1293
|
-
const
|
|
1294
|
-
let M = Object.freeze,
|
|
1293
|
+
const Lo = Object.entries, so = Object.setPrototypeOf, _n = Object.isFrozen, Ln = Object.getPrototypeOf, Mn = Object.getOwnPropertyDescriptor;
|
|
1294
|
+
let M = Object.freeze, D = Object.seal, Et = Object.create, Mo = typeof Reflect != "undefined" && Reflect, Ce = Mo.apply, xe = Mo.construct;
|
|
1295
1295
|
M || (M = function(t) {
|
|
1296
1296
|
return t;
|
|
1297
1297
|
});
|
|
1298
|
-
|
|
1298
|
+
D || (D = function(t) {
|
|
1299
1299
|
return t;
|
|
1300
1300
|
});
|
|
1301
|
-
|
|
1301
|
+
Ce || (Ce = function(t, e) {
|
|
1302
1302
|
for (var o = arguments.length, r = new Array(o > 2 ? o - 2 : 0), a = 2; a < o; a++) r[a - 2] = arguments[a];
|
|
1303
1303
|
return t.apply(e, r);
|
|
1304
1304
|
});
|
|
@@ -1306,97 +1306,97 @@ xe || (xe = function(t) {
|
|
|
1306
1306
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) o[r - 1] = arguments[r];
|
|
1307
1307
|
return new t(...o);
|
|
1308
1308
|
});
|
|
1309
|
-
const at = L(Array.prototype.forEach),
|
|
1309
|
+
const at = L(Array.prototype.forEach), Dn = L(Array.prototype.lastIndexOf), lo = L(Array.prototype.pop), At = L(Array.prototype.push), In = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), me = L(String.prototype.toString), co = L(String.prototype.match), St = L(String.prototype.replace), uo = L(String.prototype.indexOf), Pn = L(String.prototype.trim), On = L(Number.prototype.toString), Rn = L(Boolean.prototype.toString), po = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), fo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), N = L(Object.prototype.hasOwnProperty), _t = L(Object.prototype.toString), I = L(RegExp.prototype.test), Z = Nn(TypeError);
|
|
1310
1310
|
function L(n) {
|
|
1311
1311
|
return function(t) {
|
|
1312
1312
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
1313
1313
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) o[r - 1] = arguments[r];
|
|
1314
|
-
return
|
|
1314
|
+
return Ce(n, t, o);
|
|
1315
1315
|
};
|
|
1316
1316
|
}
|
|
1317
|
-
function
|
|
1317
|
+
function Nn(n) {
|
|
1318
1318
|
return function() {
|
|
1319
1319
|
for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
|
|
1320
1320
|
return xe(n, e);
|
|
1321
1321
|
};
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1323
|
+
function E(n, t) {
|
|
1324
1324
|
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Mt;
|
|
1325
|
-
if (
|
|
1325
|
+
if (so && so(n, null), !vt(t)) return n;
|
|
1326
1326
|
let o = t.length;
|
|
1327
1327
|
for (; o--; ) {
|
|
1328
1328
|
let r = t[o];
|
|
1329
1329
|
if (typeof r == "string") {
|
|
1330
1330
|
const a = e(r);
|
|
1331
|
-
a !== r && (
|
|
1331
|
+
a !== r && (_n(t) || (t[o] = a), r = a);
|
|
1332
1332
|
}
|
|
1333
1333
|
n[r] = !0;
|
|
1334
1334
|
}
|
|
1335
1335
|
return n;
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function zn(n) {
|
|
1338
1338
|
for (let t = 0; t < n.length; t++) N(n, t) || (n[t] = null);
|
|
1339
1339
|
return n;
|
|
1340
1340
|
}
|
|
1341
1341
|
function U(n) {
|
|
1342
|
-
const t =
|
|
1343
|
-
for (const o of
|
|
1344
|
-
var e =
|
|
1342
|
+
const t = Et(null);
|
|
1343
|
+
for (const o of Lo(n)) {
|
|
1344
|
+
var e = An(o, 2);
|
|
1345
1345
|
const r = e[0], a = e[1];
|
|
1346
|
-
N(n, r) && (vt(a) ? t[r] =
|
|
1346
|
+
N(n, r) && (vt(a) ? t[r] = zn(a) : a && typeof a == "object" && a.constructor === Object ? t[r] = U(a) : t[r] = a);
|
|
1347
1347
|
}
|
|
1348
1348
|
return t;
|
|
1349
1349
|
}
|
|
1350
|
-
function
|
|
1350
|
+
function Bn(n) {
|
|
1351
1351
|
switch (typeof n) {
|
|
1352
1352
|
case "string":
|
|
1353
1353
|
return n;
|
|
1354
1354
|
case "number":
|
|
1355
|
-
return
|
|
1355
|
+
return On(n);
|
|
1356
1356
|
case "boolean":
|
|
1357
|
-
return
|
|
1357
|
+
return Rn(n);
|
|
1358
1358
|
case "bigint":
|
|
1359
|
-
return
|
|
1359
|
+
return po ? po(n) : "0";
|
|
1360
1360
|
case "symbol":
|
|
1361
|
-
return
|
|
1361
|
+
return fo ? fo(n) : "Symbol()";
|
|
1362
1362
|
case "undefined":
|
|
1363
|
-
return
|
|
1363
|
+
return _t(n);
|
|
1364
1364
|
case "function":
|
|
1365
1365
|
case "object": {
|
|
1366
|
-
if (n === null) return
|
|
1366
|
+
if (n === null) return _t(n);
|
|
1367
1367
|
const t = n, e = W(t, "toString");
|
|
1368
1368
|
if (typeof e == "function") {
|
|
1369
1369
|
const o = e(t);
|
|
1370
|
-
return typeof o == "string" ? o :
|
|
1370
|
+
return typeof o == "string" ? o : _t(o);
|
|
1371
1371
|
}
|
|
1372
|
-
return
|
|
1372
|
+
return _t(n);
|
|
1373
1373
|
}
|
|
1374
1374
|
default:
|
|
1375
|
-
return
|
|
1375
|
+
return _t(n);
|
|
1376
1376
|
}
|
|
1377
1377
|
}
|
|
1378
1378
|
function W(n, t) {
|
|
1379
1379
|
for (; n !== null; ) {
|
|
1380
|
-
const o =
|
|
1380
|
+
const o = Mn(n, t);
|
|
1381
1381
|
if (o) {
|
|
1382
1382
|
if (o.get) return L(o.get);
|
|
1383
1383
|
if (typeof o.value == "function") return L(o.value);
|
|
1384
1384
|
}
|
|
1385
|
-
n =
|
|
1385
|
+
n = Ln(n);
|
|
1386
1386
|
}
|
|
1387
1387
|
function e() {
|
|
1388
1388
|
return null;
|
|
1389
1389
|
}
|
|
1390
1390
|
return e;
|
|
1391
1391
|
}
|
|
1392
|
-
function
|
|
1392
|
+
function Fn(n) {
|
|
1393
1393
|
try {
|
|
1394
|
-
return
|
|
1394
|
+
return I(n, ""), !0;
|
|
1395
1395
|
} catch (t) {
|
|
1396
1396
|
return !1;
|
|
1397
1397
|
}
|
|
1398
1398
|
}
|
|
1399
|
-
const
|
|
1399
|
+
const ho = M([
|
|
1400
1400
|
"a",
|
|
1401
1401
|
"abbr",
|
|
1402
1402
|
"acronym",
|
|
@@ -1590,7 +1590,7 @@ const fo = M([
|
|
|
1590
1590
|
"feSpotLight",
|
|
1591
1591
|
"feTile",
|
|
1592
1592
|
"feTurbulence"
|
|
1593
|
-
]),
|
|
1593
|
+
]), Hn = M([
|
|
1594
1594
|
"animate",
|
|
1595
1595
|
"color-profile",
|
|
1596
1596
|
"cursor",
|
|
@@ -1644,7 +1644,7 @@ const fo = M([
|
|
|
1644
1644
|
"munder",
|
|
1645
1645
|
"munderover",
|
|
1646
1646
|
"mprescripts"
|
|
1647
|
-
]),
|
|
1647
|
+
]), Un = M([
|
|
1648
1648
|
"maction",
|
|
1649
1649
|
"maligngroup",
|
|
1650
1650
|
"malignmark",
|
|
@@ -1660,7 +1660,7 @@ const fo = M([
|
|
|
1660
1660
|
"annotation-xml",
|
|
1661
1661
|
"mprescripts",
|
|
1662
1662
|
"none"
|
|
1663
|
-
]),
|
|
1663
|
+
]), mo = M(["#text"]), go = M([
|
|
1664
1664
|
"accept",
|
|
1665
1665
|
"action",
|
|
1666
1666
|
"align",
|
|
@@ -1779,7 +1779,7 @@ const fo = M([
|
|
|
1779
1779
|
"width",
|
|
1780
1780
|
"wrap",
|
|
1781
1781
|
"xmlns"
|
|
1782
|
-
]),
|
|
1782
|
+
]), Ee = M([
|
|
1783
1783
|
"accent-height",
|
|
1784
1784
|
"accumulate",
|
|
1785
1785
|
"additive",
|
|
@@ -1972,7 +1972,7 @@ const fo = M([
|
|
|
1972
1972
|
"y2",
|
|
1973
1973
|
"z",
|
|
1974
1974
|
"zoomandpan"
|
|
1975
|
-
]),
|
|
1975
|
+
]), bo = M([
|
|
1976
1976
|
"accent",
|
|
1977
1977
|
"accentunder",
|
|
1978
1978
|
"align",
|
|
@@ -2033,7 +2033,7 @@ const fo = M([
|
|
|
2033
2033
|
"xlink:title",
|
|
2034
2034
|
"xml:space",
|
|
2035
2035
|
"xmlns:xlink"
|
|
2036
|
-
]),
|
|
2036
|
+
]), jn = D(/{{[\w\W]*|^[\w\W]*}}/g), Wn = D(/<%[\w\W]*|^[\w\W]*%>/g), $n = D(/\${[\w\W]*/g), Gn = D(/^data-[\-\w.\u00B7-\uFFFF]+$/), Kn = D(/^aria-[\-\w]+$/), yo = D(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), qn = D(/^(?:\w+script|data):/i), Yn = D(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Vn = D(/^html$/i), Xn = D(/^[a-z][.\w]*(-[.\w]+)+$/i), Eo = D(/<[/\w!]/g), vo = D(/<[/\w]/g), Qn = D(/<\/no(script|embed|frames)/i), Zn = D(/\/>/i), H = {
|
|
2037
2037
|
element: 1,
|
|
2038
2038
|
attribute: 2,
|
|
2039
2039
|
text: 3,
|
|
@@ -2046,7 +2046,7 @@ const fo = M([
|
|
|
2046
2046
|
documentType: 10,
|
|
2047
2047
|
documentFragment: 11,
|
|
2048
2048
|
notation: 12
|
|
2049
|
-
},
|
|
2049
|
+
}, Do = [
|
|
2050
2050
|
"style",
|
|
2051
2051
|
"script",
|
|
2052
2052
|
"xmp",
|
|
@@ -2055,14 +2055,14 @@ const fo = M([
|
|
|
2055
2055
|
"noframes",
|
|
2056
2056
|
"plaintext",
|
|
2057
2057
|
"noscript"
|
|
2058
|
-
],
|
|
2058
|
+
], Jn = M(E({}, Do)), ti = (function() {
|
|
2059
2059
|
const n = {};
|
|
2060
|
-
return at(
|
|
2061
|
-
n[t] =
|
|
2060
|
+
return at(Do, (t) => {
|
|
2061
|
+
n[t] = D(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
2062
2062
|
}), M(n);
|
|
2063
|
-
})(),
|
|
2063
|
+
})(), ei = function() {
|
|
2064
2064
|
return typeof window == "undefined" ? null : window;
|
|
2065
|
-
},
|
|
2065
|
+
}, oi = function(t, e) {
|
|
2066
2066
|
if (typeof t != "object" || typeof t.createPolicy != "function") return null;
|
|
2067
2067
|
let o = null;
|
|
2068
2068
|
const r = "data-tt-policy-suffix";
|
|
@@ -2080,7 +2080,7 @@ const fo = M([
|
|
|
2080
2080
|
} catch (l) {
|
|
2081
2081
|
return console.warn("TrustedTypes policy " + a + " could not be created."), null;
|
|
2082
2082
|
}
|
|
2083
|
-
},
|
|
2083
|
+
}, wo = function() {
|
|
2084
2084
|
return {
|
|
2085
2085
|
afterSanitizeAttributes: [],
|
|
2086
2086
|
afterSanitizeElements: [],
|
|
@@ -2092,15 +2092,15 @@ const fo = M([
|
|
|
2092
2092
|
uponSanitizeElement: [],
|
|
2093
2093
|
uponSanitizeShadowNode: []
|
|
2094
2094
|
};
|
|
2095
|
-
},
|
|
2096
|
-
return N(t, e) && vt(t[e]) ?
|
|
2097
|
-
},
|
|
2095
|
+
}, J = function(t, e, o, r) {
|
|
2096
|
+
return N(t, e) && vt(t[e]) ? E(r.base ? U(r.base) : {}, t[e], r.transform) : o;
|
|
2097
|
+
}, ve = function(t, e, o) {
|
|
2098
2098
|
const r = N(t, e) ? t[e] : void 0;
|
|
2099
2099
|
return r && typeof r == "object" ? U(r) : o();
|
|
2100
2100
|
};
|
|
2101
|
-
function
|
|
2102
|
-
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
2103
|
-
const t = (u) =>
|
|
2101
|
+
function Io() {
|
|
2102
|
+
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ei();
|
|
2103
|
+
const t = (u) => Io(u);
|
|
2104
2104
|
if (t.version = "3.4.16", t.removed = [], !n || !n.document || n.document.nodeType !== H.document || !n.Element)
|
|
2105
2105
|
return t.isSupported = !1, t;
|
|
2106
2106
|
let e = n.document;
|
|
@@ -2108,54 +2108,54 @@ function Mo() {
|
|
|
2108
2108
|
n.DocumentFragment;
|
|
2109
2109
|
const a = n.HTMLTemplateElement, l = n.Node, c = n.Element, p = n.NodeFilter;
|
|
2110
2110
|
n.NamedNodeMap === void 0 && (n.NamedNodeMap || n.MozNamedAttrMap), n.HTMLFormElement;
|
|
2111
|
-
const m = n.DOMParser, g = n.trustedTypes, w = c.prototype, k = W(w, "cloneNode"),
|
|
2112
|
-
return
|
|
2113
|
-
},
|
|
2111
|
+
const m = n.DOMParser, g = n.trustedTypes, w = c.prototype, k = W(w, "cloneNode"), v = W(w, "remove"), T = W(w, "removeAttributeNode"), et = W(w, "nextSibling"), G = W(w, "childNodes"), z = W(w, "parentNode"), st = W(w, "shadowRoot"), B = W(w, "attributes"), P = l && l.prototype ? W(l.prototype, "nodeType") : null, lt = l && l.prototype ? W(l.prototype, "nodeName") : null, Dt = l && l.prototype ? W(l.prototype, "ownerDocument") : null, wt = function(i) {
|
|
2112
|
+
return P ? P(i) : i.nodeType;
|
|
2113
|
+
}, Qt = function(i) {
|
|
2114
2114
|
return lt ? lt(i) : i.nodeName;
|
|
2115
2115
|
};
|
|
2116
2116
|
if (typeof a == "function") {
|
|
2117
2117
|
const u = e.createElement("template");
|
|
2118
2118
|
u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
|
|
2119
2119
|
}
|
|
2120
|
-
let R, ot = "",
|
|
2121
|
-
const
|
|
2122
|
-
if (
|
|
2120
|
+
let R, ot = "", Zt, _e = !1, kt = 0;
|
|
2121
|
+
const Le = function() {
|
|
2122
|
+
if (kt > 0) throw Z('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
|
|
2123
2123
|
}, ct = function(i) {
|
|
2124
|
-
|
|
2124
|
+
Le(), kt++;
|
|
2125
2125
|
try {
|
|
2126
2126
|
return R.createHTML(i);
|
|
2127
2127
|
} finally {
|
|
2128
|
-
|
|
2128
|
+
kt--;
|
|
2129
2129
|
}
|
|
2130
|
-
},
|
|
2131
|
-
|
|
2130
|
+
}, Ro = function(i) {
|
|
2131
|
+
Le(), kt++;
|
|
2132
2132
|
try {
|
|
2133
2133
|
return R.createScriptURL(i);
|
|
2134
2134
|
} finally {
|
|
2135
|
-
|
|
2135
|
+
kt--;
|
|
2136
2136
|
}
|
|
2137
|
-
},
|
|
2138
|
-
return
|
|
2139
|
-
},
|
|
2140
|
-
let
|
|
2141
|
-
t.isSupported = typeof
|
|
2142
|
-
const
|
|
2143
|
-
let Ie =
|
|
2144
|
-
const te =
|
|
2145
|
-
...
|
|
2137
|
+
}, No = function() {
|
|
2138
|
+
return _e || (Zt = oi(g, r), _e = !0), Zt;
|
|
2139
|
+
}, It = e, Jt = It.implementation, Me = It.createNodeIterator, zo = It.createDocumentFragment, Bo = It.getElementsByTagName, Fo = o.importNode;
|
|
2140
|
+
let C = wo();
|
|
2141
|
+
t.isSupported = typeof Lo == "function" && typeof z == "function" && Jt && Jt.createHTMLDocument !== void 0;
|
|
2142
|
+
const Ho = jn, Uo = Wn, jo = $n, Wo = Gn, $o = Kn, Go = qn, De = Yn, Ko = Xn;
|
|
2143
|
+
let Ie = yo, x = null;
|
|
2144
|
+
const te = E({}, [
|
|
2145
|
+
...ho,
|
|
2146
2146
|
...ge,
|
|
2147
2147
|
...be,
|
|
2148
2148
|
...ye,
|
|
2149
|
-
...
|
|
2149
|
+
...mo
|
|
2150
2150
|
]);
|
|
2151
2151
|
let A = null;
|
|
2152
|
-
const ee =
|
|
2153
|
-
...mo,
|
|
2154
|
-
...ve,
|
|
2152
|
+
const ee = E({}, [
|
|
2155
2153
|
...go,
|
|
2154
|
+
...Ee,
|
|
2155
|
+
...bo,
|
|
2156
2156
|
...Gt
|
|
2157
2157
|
]);
|
|
2158
|
-
let K = Object.seal(
|
|
2158
|
+
let K = Object.seal(Et(null, {
|
|
2159
2159
|
tagNameCheck: {
|
|
2160
2160
|
writable: !0,
|
|
2161
2161
|
configurable: !1,
|
|
@@ -2174,8 +2174,8 @@ function Mo() {
|
|
|
2174
2174
|
enumerable: !0,
|
|
2175
2175
|
value: !1
|
|
2176
2176
|
}
|
|
2177
|
-
})),
|
|
2178
|
-
const V = Object.seal(
|
|
2177
|
+
})), Tt = null, Pe = null;
|
|
2178
|
+
const V = Object.seal(Et(null, {
|
|
2179
2179
|
tagCheck: {
|
|
2180
2180
|
writable: !0,
|
|
2181
2181
|
configurable: !1,
|
|
@@ -2189,10 +2189,10 @@ function Mo() {
|
|
|
2189
2189
|
value: null
|
|
2190
2190
|
}
|
|
2191
2191
|
}));
|
|
2192
|
-
let
|
|
2193
|
-
const
|
|
2192
|
+
let Oe = !0, oe = !0, Re = !1, Ne = !0, X = !1, nt = !0, it = !1, ne = !1, Pt = null, Ot = null, ie = !1, dt = !1, Rt = !1, Nt = !1, ze = !0, Be = !1;
|
|
2193
|
+
const Fe = "user-content-";
|
|
2194
2194
|
let re = !0, ae = !1, ut = {}, pt = null;
|
|
2195
|
-
const
|
|
2195
|
+
const He = E({}, [
|
|
2196
2196
|
"annotation-xml",
|
|
2197
2197
|
"audio",
|
|
2198
2198
|
"colgroup",
|
|
@@ -2220,8 +2220,8 @@ function Mo() {
|
|
|
2220
2220
|
"video",
|
|
2221
2221
|
"xmp"
|
|
2222
2222
|
]);
|
|
2223
|
-
let
|
|
2224
|
-
const
|
|
2223
|
+
let Ue = null;
|
|
2224
|
+
const je = E({}, [
|
|
2225
2225
|
"audio",
|
|
2226
2226
|
"video",
|
|
2227
2227
|
"img",
|
|
@@ -2229,8 +2229,8 @@ function Mo() {
|
|
|
2229
2229
|
"image",
|
|
2230
2230
|
"track"
|
|
2231
2231
|
]);
|
|
2232
|
-
let
|
|
2233
|
-
const
|
|
2232
|
+
let We = null;
|
|
2233
|
+
const $e = E({}, [
|
|
2234
2234
|
"alt",
|
|
2235
2235
|
"class",
|
|
2236
2236
|
"for",
|
|
@@ -2247,50 +2247,50 @@ function Mo() {
|
|
|
2247
2247
|
"xmlns"
|
|
2248
2248
|
]), zt = "http://www.w3.org/1998/Math/MathML", Bt = "http://www.w3.org/2000/svg", q = "http://www.w3.org/1999/xhtml";
|
|
2249
2249
|
let ft = q, se = !1, le = null;
|
|
2250
|
-
const
|
|
2250
|
+
const qo = E({}, [
|
|
2251
2251
|
zt,
|
|
2252
2252
|
Bt,
|
|
2253
2253
|
q
|
|
2254
|
-
], me),
|
|
2254
|
+
], me), Ge = M([
|
|
2255
2255
|
"mi",
|
|
2256
2256
|
"mo",
|
|
2257
2257
|
"mn",
|
|
2258
2258
|
"ms",
|
|
2259
2259
|
"mtext"
|
|
2260
2260
|
]);
|
|
2261
|
-
let ce =
|
|
2262
|
-
const
|
|
2263
|
-
let de =
|
|
2264
|
-
const
|
|
2261
|
+
let ce = E({}, Ge);
|
|
2262
|
+
const Ke = M(["annotation-xml"]);
|
|
2263
|
+
let de = E({}, Ke);
|
|
2264
|
+
const Yo = E({}, [
|
|
2265
2265
|
"title",
|
|
2266
2266
|
"style",
|
|
2267
2267
|
"font",
|
|
2268
2268
|
"a",
|
|
2269
2269
|
"script"
|
|
2270
2270
|
]);
|
|
2271
|
-
let
|
|
2272
|
-
const
|
|
2271
|
+
let Ct = null;
|
|
2272
|
+
const Vo = ["application/xhtml+xml", "text/html"], Xo = "text/html";
|
|
2273
2273
|
let _ = null, ht = null;
|
|
2274
|
-
const
|
|
2274
|
+
const Qo = e.createElement("form"), qe = function(i) {
|
|
2275
2275
|
return i instanceof RegExp || i instanceof Function;
|
|
2276
2276
|
}, ue = function() {
|
|
2277
2277
|
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2278
2278
|
if (ht && ht === i) return;
|
|
2279
|
-
(!i || typeof i != "object") && (i = {}), i = U(i),
|
|
2279
|
+
(!i || typeof i != "object") && (i = {}), i = U(i), Ct = Vo.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Xo : i.PARSER_MEDIA_TYPE, _ = Ct === "application/xhtml+xml" ? me : Mt, x = J(i, "ALLOWED_TAGS", te, { transform: _ }), A = J(i, "ALLOWED_ATTR", ee, { transform: _ }), le = J(i, "ALLOWED_NAMESPACES", qo, { transform: me }), We = J(i, "ADD_URI_SAFE_ATTR", $e, {
|
|
2280
2280
|
transform: _,
|
|
2281
|
-
base:
|
|
2282
|
-
}),
|
|
2281
|
+
base: $e
|
|
2282
|
+
}), Ue = J(i, "ADD_DATA_URI_TAGS", je, {
|
|
2283
2283
|
transform: _,
|
|
2284
|
-
base:
|
|
2285
|
-
}), pt =
|
|
2286
|
-
const s =
|
|
2287
|
-
if (K =
|
|
2284
|
+
base: je
|
|
2285
|
+
}), pt = J(i, "FORBID_CONTENTS", He, { transform: _ }), Tt = J(i, "FORBID_TAGS", U({}), { transform: _ }), Pe = J(i, "FORBID_ATTR", U({}), { transform: _ }), ut = N(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? U(i.USE_PROFILES) : i.USE_PROFILES : !1, Oe = i.ALLOW_ARIA_ATTR !== !1, oe = i.ALLOW_DATA_ATTR !== !1, Re = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, X = i.SAFE_FOR_TEMPLATES || !1, nt = i.SAFE_FOR_XML !== !1, it = i.WHOLE_DOCUMENT || !1, dt = i.RETURN_DOM || !1, Rt = i.RETURN_DOM_FRAGMENT || !1, Nt = i.RETURN_TRUSTED_TYPE || !1, ie = i.FORCE_BODY || !1, ze = i.SANITIZE_DOM !== !1, Be = i.SANITIZE_NAMED_PROPS || !1, re = i.KEEP_CONTENT !== !1, ae = i.IN_PLACE || !1, Ie = Fn(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : yo, ft = typeof i.NAMESPACE == "string" ? i.NAMESPACE : q, ce = ve(i, "MATHML_TEXT_INTEGRATION_POINTS", () => E({}, Ge)), de = ve(i, "HTML_INTEGRATION_POINTS", () => E({}, Ke));
|
|
2286
|
+
const s = ve(i, "CUSTOM_ELEMENT_HANDLING", () => Et(null));
|
|
2287
|
+
if (K = Et(null), N(s, "tagNameCheck") && qe(s.tagNameCheck) && (K.tagNameCheck = s.tagNameCheck), N(s, "attributeNameCheck") && qe(s.attributeNameCheck) && (K.attributeNameCheck = s.attributeNameCheck), N(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (K.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), D(K), X && (oe = !1), Rt && (dt = !0), ut && (x = E({}, mo), A = Et(null), ut.html === !0 && (E(x, ho), E(A, go)), ut.svg === !0 && (E(x, ge), E(A, Ee), E(A, Gt)), ut.svgFilters === !0 && (E(x, be), E(A, Ee), E(A, Gt)), ut.mathMl === !0 && (E(x, ye), E(A, bo), E(A, Gt))), V.tagCheck = null, V.attributeCheck = null, N(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? V.tagCheck = i.ADD_TAGS : vt(i.ADD_TAGS) && (x === te && (x = U(x)), E(x, i.ADD_TAGS, _))), N(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? V.attributeCheck = i.ADD_ATTR : vt(i.ADD_ATTR) && (A === ee && (A = U(A)), E(A, i.ADD_ATTR, _))), N(i, "ADD_FORBID_CONTENTS") && vt(i.ADD_FORBID_CONTENTS) && (pt === He && (pt = U(pt)), E(pt, i.ADD_FORBID_CONTENTS, _)), re && (x["#text"] = !0), it && E(x, [
|
|
2288
2288
|
"html",
|
|
2289
2289
|
"head",
|
|
2290
2290
|
"body"
|
|
2291
|
-
]),
|
|
2292
|
-
if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
2293
|
-
if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
2291
|
+
]), x.table && (E(x, ["tbody"]), delete Tt.tbody), i.TRUSTED_TYPES_POLICY) {
|
|
2292
|
+
if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2293
|
+
if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2294
2294
|
const d = R;
|
|
2295
2295
|
R = i.TRUSTED_TYPES_POLICY;
|
|
2296
2296
|
try {
|
|
@@ -2298,34 +2298,34 @@ function Mo() {
|
|
|
2298
2298
|
} catch (f) {
|
|
2299
2299
|
throw R = d, f;
|
|
2300
2300
|
}
|
|
2301
|
-
} else i.TRUSTED_TYPES_POLICY === null ? (R = void 0, ot = "") : (R === void 0 && (R =
|
|
2301
|
+
} else i.TRUSTED_TYPES_POLICY === null ? (R = void 0, ot = "") : (R === void 0 && (R = No()), R && typeof ot == "string" && (ot = ct("")));
|
|
2302
2302
|
M && M(i), ht = i;
|
|
2303
|
-
},
|
|
2303
|
+
}, Ye = E({}, [
|
|
2304
2304
|
...ge,
|
|
2305
2305
|
...be,
|
|
2306
|
-
...
|
|
2307
|
-
]),
|
|
2308
|
-
return s.namespaceURI === q ? i === "svg" : s.namespaceURI === zt ? i === "svg" && (d === "annotation-xml" || ce[d]) : !!
|
|
2309
|
-
}, Zo = function(i, s, d) {
|
|
2310
|
-
return s.namespaceURI === q ? i === "math" : s.namespaceURI === Bt ? i === "math" && de[d] : !!Ye[i];
|
|
2306
|
+
...Hn
|
|
2307
|
+
]), Ve = E({}, [...ye, ...Un]), Zo = function(i, s, d) {
|
|
2308
|
+
return s.namespaceURI === q ? i === "svg" : s.namespaceURI === zt ? i === "svg" && (d === "annotation-xml" || ce[d]) : !!Ye[i];
|
|
2311
2309
|
}, Jo = function(i, s, d) {
|
|
2312
|
-
return s.namespaceURI ===
|
|
2313
|
-
},
|
|
2310
|
+
return s.namespaceURI === q ? i === "math" : s.namespaceURI === Bt ? i === "math" && de[d] : !!Ve[i];
|
|
2311
|
+
}, tn = function(i, s, d) {
|
|
2312
|
+
return s.namespaceURI === Bt && !de[d] || s.namespaceURI === zt && !ce[d] ? !1 : !Ve[i] && (Yo[i] || !Ye[i]);
|
|
2313
|
+
}, en = function(i) {
|
|
2314
2314
|
let s = z(i);
|
|
2315
2315
|
(!s || !s.tagName) && (s = {
|
|
2316
2316
|
namespaceURI: ft,
|
|
2317
2317
|
tagName: "template"
|
|
2318
2318
|
});
|
|
2319
2319
|
const d = Mt(i.tagName), f = Mt(s.tagName);
|
|
2320
|
-
return le[i.namespaceURI] ? i.namespaceURI === Bt ?
|
|
2321
|
-
},
|
|
2322
|
-
|
|
2320
|
+
return le[i.namespaceURI] ? i.namespaceURI === Bt ? Zo(d, s, f) : i.namespaceURI === zt ? Jo(d, s, f) : i.namespaceURI === q ? tn(d, s, f) : !!(Ct === "application/xhtml+xml" && le[i.namespaceURI]) : !1;
|
|
2321
|
+
}, Q = function(i) {
|
|
2322
|
+
At(t.removed, { element: i });
|
|
2323
2323
|
try {
|
|
2324
2324
|
z(i).removeChild(i);
|
|
2325
2325
|
} catch (s) {
|
|
2326
|
-
if (
|
|
2326
|
+
if (v(i), !z(i)) throw Z("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2327
2327
|
}
|
|
2328
|
-
},
|
|
2328
|
+
}, Xe = function(i, s, d) {
|
|
2329
2329
|
try {
|
|
2330
2330
|
T(i, s);
|
|
2331
2331
|
} catch (f) {
|
|
@@ -2340,10 +2340,10 @@ function Mo() {
|
|
|
2340
2340
|
if (s) {
|
|
2341
2341
|
const f = [];
|
|
2342
2342
|
at(s, (h) => {
|
|
2343
|
-
|
|
2343
|
+
At(f, h);
|
|
2344
2344
|
}), at(f, (h) => {
|
|
2345
2345
|
try {
|
|
2346
|
-
|
|
2346
|
+
v(h);
|
|
2347
2347
|
} catch (b) {
|
|
2348
2348
|
}
|
|
2349
2349
|
});
|
|
@@ -2351,7 +2351,7 @@ function Mo() {
|
|
|
2351
2351
|
const d = B(i);
|
|
2352
2352
|
if (d) for (let f = d.length - 1; f >= 0; --f) {
|
|
2353
2353
|
const h = d[f], b = h && h.name;
|
|
2354
|
-
typeof b == "string" &&
|
|
2354
|
+
typeof b == "string" && Xe(i, h, b);
|
|
2355
2355
|
}
|
|
2356
2356
|
}, rt = function(i, s, d) {
|
|
2357
2357
|
if (!d) try {
|
|
@@ -2359,7 +2359,7 @@ function Mo() {
|
|
|
2359
2359
|
} catch (f) {
|
|
2360
2360
|
d = null;
|
|
2361
2361
|
}
|
|
2362
|
-
|
|
2362
|
+
At(t.removed, {
|
|
2363
2363
|
attribute: d || null,
|
|
2364
2364
|
from: s
|
|
2365
2365
|
});
|
|
@@ -2373,46 +2373,46 @@ function Mo() {
|
|
|
2373
2373
|
}
|
|
2374
2374
|
if (i === "is")
|
|
2375
2375
|
if (dt || Rt) try {
|
|
2376
|
-
|
|
2376
|
+
Q(s);
|
|
2377
2377
|
} catch (f) {
|
|
2378
2378
|
}
|
|
2379
2379
|
else try {
|
|
2380
2380
|
s.setAttribute(i, "");
|
|
2381
2381
|
} catch (f) {
|
|
2382
2382
|
}
|
|
2383
|
-
},
|
|
2383
|
+
}, on = function(i) {
|
|
2384
2384
|
const s = B(i);
|
|
2385
2385
|
if (s)
|
|
2386
2386
|
for (let d = s.length - 1; d >= 0; --d) {
|
|
2387
2387
|
const f = s[d], h = f && f.name;
|
|
2388
|
-
typeof h != "string" || A[_(h)] ||
|
|
2388
|
+
typeof h != "string" || A[_(h)] || Xe(i, f, h);
|
|
2389
2389
|
}
|
|
2390
2390
|
}, Ht = function(i) {
|
|
2391
2391
|
const s = [i];
|
|
2392
2392
|
for (; s.length > 0; ) {
|
|
2393
2393
|
const d = s.pop();
|
|
2394
|
-
|
|
2394
|
+
wt(d) === H.element && on(d);
|
|
2395
2395
|
const f = G(d);
|
|
2396
2396
|
if (f) for (let h = f.length - 1; h >= 0; --h) s.push(f[h]);
|
|
2397
2397
|
}
|
|
2398
|
-
},
|
|
2398
|
+
}, Qe = function(i, s) {
|
|
2399
2399
|
return nt ? i === "patchsrc" ? !0 : i === "for" && s !== "label" && s !== "output" : !1;
|
|
2400
|
-
},
|
|
2400
|
+
}, nn = function(i) {
|
|
2401
2401
|
if (!nt) return;
|
|
2402
2402
|
const s = [i];
|
|
2403
2403
|
for (; s.length > 0; ) {
|
|
2404
|
-
const d = s.pop(), f =
|
|
2405
|
-
if (f === H.processingInstruction || f === H.comment &&
|
|
2404
|
+
const d = s.pop(), f = wt(d);
|
|
2405
|
+
if (f === H.processingInstruction || f === H.comment && I(vo, d.data)) {
|
|
2406
2406
|
try {
|
|
2407
|
-
|
|
2407
|
+
v(d);
|
|
2408
2408
|
} catch (b) {
|
|
2409
2409
|
}
|
|
2410
2410
|
continue;
|
|
2411
2411
|
}
|
|
2412
2412
|
if (f === H.element) {
|
|
2413
|
-
const b = d, y = _(
|
|
2413
|
+
const b = d, y = _(Qt(d));
|
|
2414
2414
|
try {
|
|
2415
|
-
b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") &&
|
|
2415
|
+
b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Qe("for", y) && b.removeAttribute("for");
|
|
2416
2416
|
} catch (S) {
|
|
2417
2417
|
}
|
|
2418
2418
|
}
|
|
@@ -2423,33 +2423,33 @@ function Mo() {
|
|
|
2423
2423
|
let s = null, d = null;
|
|
2424
2424
|
if (ie) i = "<remove></remove>" + i;
|
|
2425
2425
|
else {
|
|
2426
|
-
const b =
|
|
2426
|
+
const b = co(i, /^[\r\n\t ]+/);
|
|
2427
2427
|
d = b && b[0];
|
|
2428
2428
|
}
|
|
2429
|
-
|
|
2429
|
+
Ct === "application/xhtml+xml" && ft === q && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
|
|
2430
2430
|
const f = R ? ct(i) : i;
|
|
2431
2431
|
if (ft === q) try {
|
|
2432
|
-
s = new m().parseFromString(f,
|
|
2432
|
+
s = new m().parseFromString(f, Ct);
|
|
2433
2433
|
} catch (b) {
|
|
2434
2434
|
}
|
|
2435
2435
|
if (!s || !s.documentElement) {
|
|
2436
|
-
s =
|
|
2436
|
+
s = Jt.createDocument(ft, "template", null);
|
|
2437
2437
|
try {
|
|
2438
2438
|
s.documentElement.innerHTML = se ? ot : f;
|
|
2439
2439
|
} catch (b) {
|
|
2440
2440
|
}
|
|
2441
2441
|
}
|
|
2442
2442
|
const h = s.body || s.documentElement;
|
|
2443
|
-
return i && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ft === q ?
|
|
2443
|
+
return i && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ft === q ? Bo.call(s, it ? "html" : "body")[0] : it ? s.documentElement : h;
|
|
2444
2444
|
}, Je = function(i) {
|
|
2445
|
-
const s =
|
|
2446
|
-
return
|
|
2445
|
+
const s = Dt ? Dt(i) : i.ownerDocument;
|
|
2446
|
+
return Me.call(s || i, i, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
|
|
2447
2447
|
}, Ut = function(i) {
|
|
2448
|
-
return i =
|
|
2448
|
+
return i = St(i, Ho, " "), i = St(i, Uo, " "), i = St(i, jo, " "), i;
|
|
2449
2449
|
}, pe = function(i) {
|
|
2450
2450
|
var s;
|
|
2451
2451
|
i.normalize();
|
|
2452
|
-
const d =
|
|
2452
|
+
const d = Dt ? Dt(i) : i.ownerDocument, f = Me.call(d || i, i, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
|
|
2453
2453
|
let h = f.nextNode();
|
|
2454
2454
|
for (; h; )
|
|
2455
2455
|
h.data = Ut(h.data), h = f.nextNode();
|
|
@@ -2459,18 +2459,18 @@ function Mo() {
|
|
|
2459
2459
|
});
|
|
2460
2460
|
}, jt = function(i) {
|
|
2461
2461
|
const s = lt ? lt(i) : null;
|
|
2462
|
-
return typeof s != "string" || _(s) !== "form" ? !1 : typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || i.attributes !== B(i) || typeof i.removeAttribute != "function" || typeof i.removeAttributeNode != "function" || typeof i.getAttributeNode != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function" || i.nodeType !==
|
|
2462
|
+
return typeof s != "string" || _(s) !== "form" ? !1 : typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || i.attributes !== B(i) || typeof i.removeAttribute != "function" || typeof i.removeAttributeNode != "function" || typeof i.getAttributeNode != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function" || i.nodeType !== P(i) || i.childNodes !== G(i);
|
|
2463
2463
|
}, mt = function(i) {
|
|
2464
|
-
if (!
|
|
2464
|
+
if (!P || typeof i != "object" || i === null) return !1;
|
|
2465
2465
|
try {
|
|
2466
|
-
return
|
|
2466
|
+
return P(i) === H.documentFragment;
|
|
2467
2467
|
} catch (s) {
|
|
2468
2468
|
return !1;
|
|
2469
2469
|
}
|
|
2470
2470
|
}, xt = function(i) {
|
|
2471
|
-
if (!
|
|
2471
|
+
if (!P || typeof i != "object" || i === null) return !1;
|
|
2472
2472
|
try {
|
|
2473
|
-
return typeof
|
|
2473
|
+
return typeof P(i) == "number";
|
|
2474
2474
|
} catch (s) {
|
|
2475
2475
|
return !1;
|
|
2476
2476
|
}
|
|
@@ -2480,17 +2480,17 @@ function Mo() {
|
|
|
2480
2480
|
d.call(t, i, s, ht);
|
|
2481
2481
|
});
|
|
2482
2482
|
}
|
|
2483
|
-
const
|
|
2484
|
-
return !!(nt && i.hasChildNodes() && !xt(i.firstElementChild) &&
|
|
2483
|
+
const rn = function(i, s) {
|
|
2484
|
+
return !!(nt && i.hasChildNodes() && !xt(i.firstElementChild) && I(Eo, i.textContent) && I(Eo, i.innerHTML) || nt && i.namespaceURI === q && Jn[s] && (xt(i.firstElementChild) || typeof i.textContent == "string" && I(ti[s], i.textContent)) || i.nodeType === H.processingInstruction || nt && i.nodeType === H.comment && I(vo, i.data));
|
|
2485
2485
|
}, Wt = function(i, s) {
|
|
2486
|
-
if (i instanceof RegExp) return
|
|
2486
|
+
if (i instanceof RegExp) return I(i, s);
|
|
2487
2487
|
if (i instanceof Function) {
|
|
2488
2488
|
for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) f[h - 2] = arguments[h];
|
|
2489
2489
|
return !!i(s, ...f);
|
|
2490
2490
|
}
|
|
2491
2491
|
return !1;
|
|
2492
|
-
},
|
|
2493
|
-
if (!
|
|
2492
|
+
}, an = function(i, s, d) {
|
|
2493
|
+
if (!Tt[s] && no(s) && Wt(K.tagNameCheck, s)) return !1;
|
|
2494
2494
|
if (re && !pt[s]) {
|
|
2495
2495
|
const f = z(i), h = G(i);
|
|
2496
2496
|
if (h && f) {
|
|
@@ -2501,38 +2501,38 @@ function Mo() {
|
|
|
2501
2501
|
}
|
|
2502
2502
|
}
|
|
2503
2503
|
}
|
|
2504
|
-
return
|
|
2505
|
-
},
|
|
2504
|
+
return Q(i), !0;
|
|
2505
|
+
}, to = function(i, s, d, f) {
|
|
2506
2506
|
return i.length === 0 ? s : s === d || s === f ? U(s) : s;
|
|
2507
2507
|
}, gt = function(i, s) {
|
|
2508
2508
|
return i === s || z(i) !== null ? !1 : (ae && Ht(i), !0);
|
|
2509
|
-
},
|
|
2510
|
-
if (Y(
|
|
2509
|
+
}, eo = function(i, s) {
|
|
2510
|
+
if (Y(C.beforeSanitizeElements, i, null), gt(i, s)) return !0;
|
|
2511
2511
|
if (jt(i))
|
|
2512
|
-
return
|
|
2513
|
-
const d = _(
|
|
2514
|
-
if (
|
|
2512
|
+
return Q(i), !0;
|
|
2513
|
+
const d = _(Qt(i));
|
|
2514
|
+
if (x = to(C.uponSanitizeElement, x, te, Pt), Y(C.uponSanitizeElement, i, {
|
|
2515
2515
|
tagName: d,
|
|
2516
|
-
allowedTags:
|
|
2516
|
+
allowedTags: x
|
|
2517
2517
|
}), gt(i, s)) return !0;
|
|
2518
|
-
if (
|
|
2519
|
-
return
|
|
2520
|
-
if (
|
|
2521
|
-
const f =
|
|
2522
|
-
return f === !1 && (Y(
|
|
2518
|
+
if (rn(i, d))
|
|
2519
|
+
return Q(i), !0;
|
|
2520
|
+
if (Tt[d] || !(V.tagCheck instanceof Function && V.tagCheck(d)) && !x[d]) {
|
|
2521
|
+
const f = an(i, d, s);
|
|
2522
|
+
return f === !1 && (Y(C.afterSanitizeElements, i, null), gt(i, s)) ? !0 : f;
|
|
2523
2523
|
}
|
|
2524
|
-
if (
|
|
2525
|
-
return
|
|
2524
|
+
if (wt(i) === H.element && !en(i) || (d === "noscript" || d === "noembed" || d === "noframes") && I(Qn, i.innerHTML))
|
|
2525
|
+
return Q(i), !0;
|
|
2526
2526
|
if (X && i.nodeType === H.text) {
|
|
2527
2527
|
const f = Ut(i.textContent);
|
|
2528
|
-
i.textContent !== f && (
|
|
2528
|
+
i.textContent !== f && (At(t.removed, { element: i.cloneNode() }), i.textContent = f);
|
|
2529
2529
|
}
|
|
2530
|
-
return Y(
|
|
2531
|
-
},
|
|
2532
|
-
if (Pe[s] ||
|
|
2530
|
+
return Y(C.afterSanitizeElements, i, null), gt(i, s);
|
|
2531
|
+
}, oo = function(i, s, d) {
|
|
2532
|
+
if (Pe[s] || Qe(s, i) || ze && (s === "id" || s === "name") && (d in e || d in Qo)) return !1;
|
|
2533
2533
|
const f = A[s] || V.attributeCheck instanceof Function && V.attributeCheck(s, i);
|
|
2534
|
-
return oe &&
|
|
2535
|
-
},
|
|
2534
|
+
return oe && I(Wo, s) || Oe && I($o, s) ? !0 : f ? We[s] || I(Ie, St(d, De, "")) || (s === "src" || s === "xlink:href" || s === "href") && i !== "script" && uo(d, "data:") === 0 && Ue[i] || Re && !I(Go, St(d, De, "")) ? !0 : !d : no(i) && Wt(K.tagNameCheck, i) && Wt(K.attributeNameCheck, s, i) || s === "is" && K.allowCustomizedBuiltInElements && Wt(K.tagNameCheck, d);
|
|
2535
|
+
}, sn = E({}, [
|
|
2536
2536
|
"annotation-xml",
|
|
2537
2537
|
"color-profile",
|
|
2538
2538
|
"font-face",
|
|
@@ -2541,27 +2541,27 @@ function Mo() {
|
|
|
2541
2541
|
"font-face-src",
|
|
2542
2542
|
"font-face-uri",
|
|
2543
2543
|
"missing-glyph"
|
|
2544
|
-
]),
|
|
2545
|
-
return !
|
|
2546
|
-
},
|
|
2544
|
+
]), no = function(i) {
|
|
2545
|
+
return !sn[Mt(i)] && I(Ko, i);
|
|
2546
|
+
}, ln = function(i, s, d, f) {
|
|
2547
2547
|
if (R && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(i, s)) {
|
|
2548
2548
|
case "TrustedHTML":
|
|
2549
2549
|
return ct(f);
|
|
2550
2550
|
case "TrustedScriptURL":
|
|
2551
|
-
return
|
|
2551
|
+
return Ro(f);
|
|
2552
2552
|
}
|
|
2553
2553
|
return f;
|
|
2554
|
-
},
|
|
2554
|
+
}, cn = function(i, s, d, f) {
|
|
2555
2555
|
try {
|
|
2556
|
-
return d ? i.setAttributeNS(d, s, f) : i.setAttribute(s, f), jt(i) ? (
|
|
2556
|
+
return d ? i.setAttributeNS(d, s, f) : i.setAttribute(s, f), jt(i) ? (Q(i), !1) : !0;
|
|
2557
2557
|
} catch (h) {
|
|
2558
2558
|
return rt(s, i), !1;
|
|
2559
2559
|
}
|
|
2560
|
-
},
|
|
2561
|
-
if (Y(
|
|
2560
|
+
}, io = function(i, s) {
|
|
2561
|
+
if (Y(C.beforeSanitizeAttributes, i, null), gt(i, s)) return;
|
|
2562
2562
|
const d = i.attributes;
|
|
2563
2563
|
if (!d || jt(i)) return;
|
|
2564
|
-
A =
|
|
2564
|
+
A = to(C.uponSanitizeAttribute, A, ee, Ot);
|
|
2565
2565
|
const f = {
|
|
2566
2566
|
attrName: "",
|
|
2567
2567
|
attrValue: "",
|
|
@@ -2573,12 +2573,12 @@ function Mo() {
|
|
|
2573
2573
|
const b = _(i.nodeName);
|
|
2574
2574
|
for (; h--; ) {
|
|
2575
2575
|
const y = d[h], S = y.name, j = y.namespaceURI, F = y.value, bt = _(S), he = F;
|
|
2576
|
-
let O = S === "value" ? he :
|
|
2577
|
-
if (f.attrName = bt, f.attrValue = O, f.keepAttr = !0, f.forceKeepAttr = void 0, Y(
|
|
2576
|
+
let O = S === "value" ? he : Pn(he), ro = !1;
|
|
2577
|
+
if (f.attrName = bt, f.attrValue = O, f.keepAttr = !0, f.forceKeepAttr = void 0, Y(C.uponSanitizeAttribute, i, f), O = f.attrValue, Be && (bt === "id" || bt === "name") && uo(O, Fe) !== 0 && (rt(S, i, y), O = Fe + O, ro = !0), nt && I(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
|
|
2578
2578
|
rt(S, i, y);
|
|
2579
2579
|
continue;
|
|
2580
2580
|
}
|
|
2581
|
-
if (bt === "attributename" &&
|
|
2581
|
+
if (bt === "attributename" && co(O, "href")) {
|
|
2582
2582
|
rt(S, i, y);
|
|
2583
2583
|
continue;
|
|
2584
2584
|
}
|
|
@@ -2587,27 +2587,27 @@ function Mo() {
|
|
|
2587
2587
|
rt(S, i, y);
|
|
2588
2588
|
continue;
|
|
2589
2589
|
}
|
|
2590
|
-
if (!
|
|
2590
|
+
if (!Ne && I(Zn, O)) {
|
|
2591
2591
|
rt(S, i, y);
|
|
2592
2592
|
continue;
|
|
2593
2593
|
}
|
|
2594
|
-
if (X && (O = Ut(O)), !
|
|
2594
|
+
if (X && (O = Ut(O)), !oo(b, bt, O)) {
|
|
2595
2595
|
rt(S, i, y);
|
|
2596
2596
|
continue;
|
|
2597
2597
|
}
|
|
2598
|
-
O =
|
|
2598
|
+
O = ln(b, bt, j, O), O !== he && cn(i, S, j, O) && ro && lo(t.removed);
|
|
2599
2599
|
}
|
|
2600
2600
|
}
|
|
2601
|
-
Y(
|
|
2601
|
+
Y(C.afterSanitizeAttributes, i, null), gt(i, s);
|
|
2602
2602
|
}, $t = function(i) {
|
|
2603
2603
|
let s = null;
|
|
2604
2604
|
const d = Je(i);
|
|
2605
|
-
for (Y(
|
|
2606
|
-
if (Y(
|
|
2605
|
+
for (Y(C.beforeSanitizeShadowDOM, i, null); s = d.nextNode(); )
|
|
2606
|
+
if (Y(C.uponSanitizeShadowNode, s, null), eo(s, i), io(s, i), mt(s.content) && $t(s.content), wt(s) === H.element) {
|
|
2607
2607
|
const f = st(s);
|
|
2608
2608
|
mt(f) && (fe(f), $t(f));
|
|
2609
2609
|
}
|
|
2610
|
-
Y(
|
|
2610
|
+
Y(C.afterSanitizeShadowDOM, i, null);
|
|
2611
2611
|
}, fe = function(i) {
|
|
2612
2612
|
const s = [{
|
|
2613
2613
|
node: i,
|
|
@@ -2619,7 +2619,7 @@ function Mo() {
|
|
|
2619
2619
|
$t(d.shadow);
|
|
2620
2620
|
continue;
|
|
2621
2621
|
}
|
|
2622
|
-
const f = d.node, h =
|
|
2622
|
+
const f = d.node, h = wt(f) === H.element, b = G(f);
|
|
2623
2623
|
if (b) for (let y = b.length - 1; y >= 0; --y) s.push({
|
|
2624
2624
|
node: b[y],
|
|
2625
2625
|
shadow: null
|
|
@@ -2648,21 +2648,21 @@ function Mo() {
|
|
|
2648
2648
|
};
|
|
2649
2649
|
return t.sanitize = function(u) {
|
|
2650
2650
|
let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, f = null, h = null;
|
|
2651
|
-
if (se = !u, se && (u = "<!-->"), typeof u != "string" && !xt(u) && (u =
|
|
2652
|
-
throw
|
|
2651
|
+
if (se = !u, se && (u = "<!-->"), typeof u != "string" && !xt(u) && (u = Bn(u), typeof u != "string"))
|
|
2652
|
+
throw Z("dirty is not a string, aborting");
|
|
2653
2653
|
if (!t.isSupported) return u;
|
|
2654
|
-
ne ? (
|
|
2654
|
+
ne ? (x = Pt, A = Ot) : ue(i), (C.uponSanitizeElement.length > 0 || C.uponSanitizeAttribute.length > 0) && (x = U(x)), C.uponSanitizeAttribute.length > 0 && (A = U(A)), t.removed = [];
|
|
2655
2655
|
const b = ae && typeof u != "string" && xt(u);
|
|
2656
2656
|
if (b) {
|
|
2657
|
-
|
|
2658
|
-
const j =
|
|
2657
|
+
nn(u);
|
|
2658
|
+
const j = Qt(u);
|
|
2659
2659
|
if (typeof j == "string") {
|
|
2660
2660
|
const F = _(j);
|
|
2661
|
-
if (!
|
|
2662
|
-
throw Ft(u),
|
|
2661
|
+
if (!x[F] || Tt[F])
|
|
2662
|
+
throw Ft(u), Z("root node is forbidden and cannot be sanitized in-place");
|
|
2663
2663
|
}
|
|
2664
2664
|
if (jt(u))
|
|
2665
|
-
throw Ft(u),
|
|
2665
|
+
throw Ft(u), Z("root node is clobbered and cannot be sanitized in-place");
|
|
2666
2666
|
try {
|
|
2667
2667
|
fe(u);
|
|
2668
2668
|
} catch (F) {
|
|
@@ -2674,12 +2674,12 @@ function Mo() {
|
|
|
2674
2674
|
if (!dt && !X && !it && u.indexOf("<") === -1) return R && Nt ? ct(u) : u;
|
|
2675
2675
|
if (s = Ze(u), !s) return dt ? null : Nt ? ot : "";
|
|
2676
2676
|
}
|
|
2677
|
-
s && ie &&
|
|
2677
|
+
s && ie && Q(s.firstChild);
|
|
2678
2678
|
const y = b ? u : s;
|
|
2679
2679
|
try {
|
|
2680
2680
|
const j = Je(y);
|
|
2681
2681
|
for (; f = j.nextNode(); )
|
|
2682
|
-
|
|
2682
|
+
eo(f, y), io(f, y), mt(f.content) && $t(f.content);
|
|
2683
2683
|
} catch (j) {
|
|
2684
2684
|
throw b && (Ft(u), at(t.removed, (F) => {
|
|
2685
2685
|
F.element && Ht(F.element);
|
|
@@ -2689,45 +2689,45 @@ function Mo() {
|
|
|
2689
2689
|
let j = !1;
|
|
2690
2690
|
if (at(t.removed, (F) => {
|
|
2691
2691
|
F.element && (F.element === u && (j = !0), Ht(F.element));
|
|
2692
|
-
}), j) throw
|
|
2692
|
+
}), j) throw Z("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
2693
2693
|
return X && pe(u), u;
|
|
2694
2694
|
}
|
|
2695
2695
|
if (dt) {
|
|
2696
2696
|
if (X && pe(s), Rt)
|
|
2697
|
-
for (h =
|
|
2697
|
+
for (h = zo.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
|
|
2698
2698
|
else h = s;
|
|
2699
|
-
return (A.shadowroot || A.shadowrootmode) && (h =
|
|
2699
|
+
return (A.shadowroot || A.shadowrootmode) && (h = Fo.call(o, h, !0)), h;
|
|
2700
2700
|
}
|
|
2701
2701
|
let S = it ? s.outerHTML : s.innerHTML;
|
|
2702
|
-
return it &&
|
|
2702
|
+
return it && x["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && I(Vn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
|
|
2703
2703
|
` + S), X && (S = Ut(S)), R && Nt ? ct(S) : S;
|
|
2704
2704
|
}, t.setConfig = function() {
|
|
2705
2705
|
let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2706
|
-
ue(u), ne = !0,
|
|
2706
|
+
ue(u), ne = !0, Pt = x, Ot = A;
|
|
2707
2707
|
}, t.clearConfig = function() {
|
|
2708
|
-
ht = null, ne = !1,
|
|
2708
|
+
ht = null, ne = !1, Pt = null, Ot = null, R = Zt, ot = "";
|
|
2709
2709
|
}, t.isValidAttribute = function(u, i, s) {
|
|
2710
2710
|
ht || ue({});
|
|
2711
2711
|
const d = _(u), f = _(i);
|
|
2712
|
-
return
|
|
2712
|
+
return oo(d, f, s);
|
|
2713
2713
|
}, t.addHook = function(u, i) {
|
|
2714
|
-
typeof i == "function" && N(
|
|
2714
|
+
typeof i == "function" && N(C, u) && At(C[u], i);
|
|
2715
2715
|
}, t.removeHook = function(u, i) {
|
|
2716
|
-
if (N(
|
|
2716
|
+
if (N(C, u)) {
|
|
2717
2717
|
if (i !== void 0) {
|
|
2718
|
-
const s =
|
|
2719
|
-
return s === -1 ? void 0 :
|
|
2718
|
+
const s = Dn(C[u], i);
|
|
2719
|
+
return s === -1 ? void 0 : In(C[u], s, 1)[0];
|
|
2720
2720
|
}
|
|
2721
|
-
return
|
|
2721
|
+
return lo(C[u]);
|
|
2722
2722
|
}
|
|
2723
2723
|
}, t.removeHooks = function(u) {
|
|
2724
|
-
N(
|
|
2724
|
+
N(C, u) && (C[u] = []);
|
|
2725
2725
|
}, t.removeAllHooks = function() {
|
|
2726
|
-
|
|
2726
|
+
C = wo();
|
|
2727
2727
|
}, t;
|
|
2728
2728
|
}
|
|
2729
|
-
var Kt =
|
|
2730
|
-
const
|
|
2729
|
+
var Kt = Io();
|
|
2730
|
+
const ni = [
|
|
2731
2731
|
"p",
|
|
2732
2732
|
"br",
|
|
2733
2733
|
"strong",
|
|
@@ -2776,7 +2776,7 @@ const ei = [
|
|
|
2776
2776
|
// user-initiated dialog, a different trust boundary that never calls
|
|
2777
2777
|
// through this sanitizer. A consumer that genuinely wants iframes in
|
|
2778
2778
|
// pasted/typed content can still opt in via a custom allowedTags list.
|
|
2779
|
-
],
|
|
2779
|
+
], ii = {
|
|
2780
2780
|
"*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
|
|
2781
2781
|
a: ["href", "target", "rel", "title"],
|
|
2782
2782
|
img: ["src", "alt", "width", "height", "loading"],
|
|
@@ -2793,8 +2793,8 @@ const ei = [
|
|
|
2793
2793
|
// additionalAllowedTags), restoring the attributes that make an inserted
|
|
2794
2794
|
// iframe actually usable (src, sizing, fullscreen, scrolling/border).
|
|
2795
2795
|
iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
|
|
2796
|
-
},
|
|
2797
|
-
function
|
|
2796
|
+
}, ri = "data-editora-embed";
|
|
2797
|
+
function ai(n) {
|
|
2798
2798
|
if (!n || /\s/.test(n.trim())) return !1;
|
|
2799
2799
|
try {
|
|
2800
2800
|
const t = new URL(n.trim());
|
|
@@ -2803,10 +2803,10 @@ function ii(n) {
|
|
|
2803
2803
|
return !1;
|
|
2804
2804
|
}
|
|
2805
2805
|
}
|
|
2806
|
-
function
|
|
2806
|
+
function Po(n, t, e, o) {
|
|
2807
2807
|
if ((t == null ? void 0 : t.sanitize) === !1)
|
|
2808
2808
|
return n;
|
|
2809
|
-
const r = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags :
|
|
2809
|
+
const r = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ni, a = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...r, ...e])) : r, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : ii, p = /* @__PURE__ */ new Set();
|
|
2810
2810
|
for (const w of Object.values(c))
|
|
2811
2811
|
for (const k of w) p.add(k);
|
|
2812
2812
|
const m = {
|
|
@@ -2821,8 +2821,8 @@ function Io(n, t, e, o) {
|
|
|
2821
2821
|
(w, k) => {
|
|
2822
2822
|
var T;
|
|
2823
2823
|
if (k.tagName !== "iframe") return;
|
|
2824
|
-
const
|
|
2825
|
-
k.allowedTags.iframe = g || ((T =
|
|
2824
|
+
const v = w;
|
|
2825
|
+
k.allowedTags.iframe = g || ((T = v.getAttribute) == null ? void 0 : T.call(v, ri)) === "true" && ai(v.getAttribute("src"));
|
|
2826
2826
|
}
|
|
2827
2827
|
);
|
|
2828
2828
|
try {
|
|
@@ -2831,22 +2831,22 @@ function Io(n, t, e, o) {
|
|
|
2831
2831
|
Kt.removeHook("uponSanitizeElement");
|
|
2832
2832
|
}
|
|
2833
2833
|
}
|
|
2834
|
-
function
|
|
2835
|
-
return
|
|
2834
|
+
function si(n, t, e, o) {
|
|
2835
|
+
return Po(n, t, o, !1);
|
|
2836
2836
|
}
|
|
2837
|
-
function
|
|
2838
|
-
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? n :
|
|
2837
|
+
function li(n, t, e) {
|
|
2838
|
+
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? n : si(n, t);
|
|
2839
2839
|
}
|
|
2840
|
-
function
|
|
2841
|
-
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? n :
|
|
2840
|
+
function ko(n, t, e, o) {
|
|
2841
|
+
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? n : Po(n, t, o, !0);
|
|
2842
2842
|
}
|
|
2843
|
-
const
|
|
2844
|
-
function
|
|
2845
|
-
if (!n || !
|
|
2843
|
+
const ci = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", di = /resize-handle|data-rte-media-pending|rte-media/;
|
|
2844
|
+
function Oo(n) {
|
|
2845
|
+
if (!n || !di.test(n)) return n;
|
|
2846
2846
|
const t = document.createElement("template");
|
|
2847
2847
|
t.innerHTML = n;
|
|
2848
2848
|
const e = /* @__PURE__ */ new Set();
|
|
2849
|
-
return t.content.querySelectorAll(
|
|
2849
|
+
return t.content.querySelectorAll(ci).forEach((o) => {
|
|
2850
2850
|
const r = o.parentElement;
|
|
2851
2851
|
r && (r.tagName === "TD" || r.tagName === "TH") && e.add(r), o.remove();
|
|
2852
2852
|
}), e.forEach((o) => {
|
|
@@ -2859,8 +2859,8 @@ function Po(n) {
|
|
|
2859
2859
|
r && (r.removeAttribute("contenteditable"), !((a = r.textContent) != null && a.trim()) && !r.querySelector("img, video, a") && r.remove());
|
|
2860
2860
|
}), t.innerHTML;
|
|
2861
2861
|
}
|
|
2862
|
-
function
|
|
2863
|
-
return n ?
|
|
2862
|
+
function yt(n) {
|
|
2863
|
+
return n ? Oo(n.innerHTML) : "";
|
|
2864
2864
|
}
|
|
2865
2865
|
const Xt = class Xt {
|
|
2866
2866
|
/**
|
|
@@ -3059,7 +3059,7 @@ Xt.EDITOR_DEFAULTS = {
|
|
|
3059
3059
|
width: "100%",
|
|
3060
3060
|
readonly: !1,
|
|
3061
3061
|
disabled: !1,
|
|
3062
|
-
menubar: !
|
|
3062
|
+
menubar: !1,
|
|
3063
3063
|
toolbar: !0,
|
|
3064
3064
|
plugins: [],
|
|
3065
3065
|
theme: "light",
|
|
@@ -3123,40 +3123,46 @@ Xt.EDITOR_DEFAULTS = {
|
|
|
3123
3123
|
"security-sanitize-on-paste",
|
|
3124
3124
|
"security-sanitize-on-input"
|
|
3125
3125
|
]);
|
|
3126
|
-
let
|
|
3127
|
-
const ci = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
|
|
3126
|
+
let Ae = Xt;
|
|
3127
|
+
const To = /* @__PURE__ */ new Set();
|
|
3128
|
+
function ui(n, t) {
|
|
3129
|
+
To.has(n) || (To.add(n), console.warn(
|
|
3130
|
+
`[Editora] The "${n}" option has no effect: ${t} It is still accepted so existing code keeps working, and will be removed in a future major release.`
|
|
3131
|
+
));
|
|
3132
|
+
}
|
|
3133
|
+
const pi = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor.editora-disabled{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
|
|
3128
3134
|
let qt;
|
|
3129
|
-
const
|
|
3130
|
-
let tt = null,
|
|
3131
|
-
function
|
|
3135
|
+
const fi = "__editoraCommandEditorRoot", hi = "__editoraLastCommandButton", Co = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", xo = ".rte-content, .editora-content", mi = "Rich text editor", gi = /* @__PURE__ */ new Set(["collaboration"]), we = "data-editora-disabled-by-host", Se = /* @__PURE__ */ new Set();
|
|
3136
|
+
let tt = null, Ao = !1, ke = null, Te = null;
|
|
3137
|
+
function So(n) {
|
|
3132
3138
|
if (!(n instanceof HTMLElement)) return !1;
|
|
3133
3139
|
const t = n;
|
|
3134
3140
|
return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
|
|
3135
3141
|
}
|
|
3136
|
-
function
|
|
3142
|
+
function bi(n) {
|
|
3137
3143
|
return n ? n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement : null;
|
|
3138
3144
|
}
|
|
3139
3145
|
function Lt(n) {
|
|
3140
3146
|
if (!n) return null;
|
|
3141
|
-
if (
|
|
3147
|
+
if (So(n))
|
|
3142
3148
|
return n;
|
|
3143
|
-
const t = n.matches(
|
|
3144
|
-
return !t || !
|
|
3149
|
+
const t = n.matches(Co) ? n : n.closest(Co);
|
|
3150
|
+
return !t || !So(t) ? null : t;
|
|
3145
3151
|
}
|
|
3146
|
-
function
|
|
3152
|
+
function yi() {
|
|
3147
3153
|
var r;
|
|
3148
3154
|
if (typeof window == "undefined") return null;
|
|
3149
|
-
const n = window[
|
|
3155
|
+
const n = window[fi];
|
|
3150
3156
|
if (n instanceof HTMLElement) {
|
|
3151
3157
|
const a = Lt(n);
|
|
3152
3158
|
if (a) return a;
|
|
3153
|
-
const l = n.matches(
|
|
3159
|
+
const l = n.matches(xo) ? n : n.querySelector(xo);
|
|
3154
3160
|
if (l) {
|
|
3155
3161
|
const c = Lt(l);
|
|
3156
3162
|
if (c) return c;
|
|
3157
3163
|
}
|
|
3158
3164
|
}
|
|
3159
|
-
const t = window[
|
|
3165
|
+
const t = window[hi];
|
|
3160
3166
|
if (t instanceof HTMLElement) {
|
|
3161
3167
|
const a = Lt(t);
|
|
3162
3168
|
if (a) return a;
|
|
@@ -3168,43 +3174,43 @@ function mi() {
|
|
|
3168
3174
|
}
|
|
3169
3175
|
const o = (r = window.getSelection) == null ? void 0 : r.call(window);
|
|
3170
3176
|
if (o && o.rangeCount > 0) {
|
|
3171
|
-
const a = Lt(
|
|
3177
|
+
const a = Lt(bi(o.getRangeAt(0).startContainer));
|
|
3172
3178
|
if (a) return a;
|
|
3173
3179
|
}
|
|
3174
3180
|
if (tt && tt.isConnected)
|
|
3175
3181
|
return tt;
|
|
3176
|
-
for (const a of
|
|
3182
|
+
for (const a of Se)
|
|
3177
3183
|
if (a.isConnected) return a;
|
|
3178
3184
|
return null;
|
|
3179
3185
|
}
|
|
3180
|
-
function
|
|
3181
|
-
if (typeof window == "undefined" ||
|
|
3182
|
-
|
|
3186
|
+
function Ei() {
|
|
3187
|
+
if (typeof window == "undefined" || Ao) return;
|
|
3188
|
+
ke = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, Te = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
|
|
3183
3189
|
const n = (t, ...e) => {
|
|
3184
|
-
const o =
|
|
3185
|
-
return o ? o.execCommand(t, ...e) :
|
|
3190
|
+
const o = yi();
|
|
3191
|
+
return o ? o.execCommand(t, ...e) : ke ? ke(t, ...e) : Te ? Te(t, ...e) : !1;
|
|
3186
3192
|
};
|
|
3187
|
-
window.executeEditorCommand = n, window.execEditorCommand = n,
|
|
3193
|
+
window.executeEditorCommand = n, window.execEditorCommand = n, Ao = !0;
|
|
3188
3194
|
}
|
|
3189
|
-
function
|
|
3195
|
+
function vi() {
|
|
3190
3196
|
const n = "editora-webcomponent-styles";
|
|
3191
3197
|
if (!document.getElementById(n)) {
|
|
3192
3198
|
const t = document.createElement("style");
|
|
3193
|
-
t.id = n, t.textContent =
|
|
3199
|
+
t.id = n, t.textContent = pi, document.head.appendChild(t);
|
|
3194
3200
|
}
|
|
3195
3201
|
}
|
|
3196
|
-
function
|
|
3202
|
+
function wi() {
|
|
3197
3203
|
if (!qt) {
|
|
3198
3204
|
const n = $.__globalPluginLoader;
|
|
3199
|
-
n ? qt = n : qt = new
|
|
3205
|
+
n ? qt = n : qt = new _o();
|
|
3200
3206
|
}
|
|
3201
3207
|
return qt;
|
|
3202
3208
|
}
|
|
3203
|
-
const
|
|
3209
|
+
const ki = typeof HTMLElement == "undefined" ? class {
|
|
3204
3210
|
} : HTMLElement;
|
|
3205
|
-
class $ extends
|
|
3211
|
+
class $ extends ki {
|
|
3206
3212
|
constructor() {
|
|
3207
|
-
if (super(), this.pluginLoader =
|
|
3213
|
+
if (super(), this.pluginLoader = wi(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new kn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.pluginInstances = /* @__PURE__ */ new Map(), this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, this.hasConnected = !1, this.reinitializeQueued = !1, this.lastReportedContent = null, vi(), !this.hasAttribute("data-initial-content")) {
|
|
3208
3214
|
const t = this.innerHTML.trim();
|
|
3209
3215
|
t && this.setAttribute("data-initial-content", t);
|
|
3210
3216
|
}
|
|
@@ -3261,7 +3267,7 @@ class $ extends vi {
|
|
|
3261
3267
|
* Called when element is added to DOM
|
|
3262
3268
|
*/
|
|
3263
3269
|
connectedCallback() {
|
|
3264
|
-
this.config = this.resolveConfig(), this.waitForPluginLoader().then(() => {
|
|
3270
|
+
this.hasConnected = !0, this.config = this.resolveConfig(), this.waitForPluginLoader().then(() => {
|
|
3265
3271
|
setTimeout(async () => {
|
|
3266
3272
|
await this.initialize();
|
|
3267
3273
|
}, 0);
|
|
@@ -3298,7 +3304,22 @@ class $ extends vi {
|
|
|
3298
3304
|
* Set configuration via JavaScript API
|
|
3299
3305
|
*/
|
|
3300
3306
|
async setConfig(t) {
|
|
3301
|
-
this.jsConfig = t, this.config = this.resolveConfig(), this.isConnected
|
|
3307
|
+
this.jsConfig = t, this.config = this.resolveConfig(), this.isConnected ? (this.destroy(), this.adoptConfiguredContent(t), await this.waitForPluginLoader(), await this.initialize()) : this.adoptConfiguredContent(t);
|
|
3308
|
+
}
|
|
3309
|
+
/**
|
|
3310
|
+
* `content` in setConfig() is a one-off replacement, not a setting: it feeds the next initialize()
|
|
3311
|
+
* the same way the live content that destroy() keeps does, so a later rebuild (a `plugins`
|
|
3312
|
+
* attribute change, the element being moved) resumes from what the user typed, not from this value.
|
|
3313
|
+
* It outranks that kept content, autosave and the element's own markup.
|
|
3314
|
+
*/
|
|
3315
|
+
adoptConfiguredContent(t) {
|
|
3316
|
+
typeof t.content == "string" && (this.preservedContent = t.content);
|
|
3317
|
+
}
|
|
3318
|
+
/** Replace the `editora-theme-*` class (there is only ever one) with the one for `theme`. */
|
|
3319
|
+
applyThemeClass(t) {
|
|
3320
|
+
Array.from(this.classList).forEach((e) => {
|
|
3321
|
+
e.startsWith("editora-theme-") && this.classList.remove(e);
|
|
3322
|
+
}), t && this.classList.add(`editora-theme-${t}`);
|
|
3302
3323
|
}
|
|
3303
3324
|
/**
|
|
3304
3325
|
* Initialize the editor
|
|
@@ -3307,7 +3328,7 @@ class $ extends vi {
|
|
|
3307
3328
|
var a;
|
|
3308
3329
|
if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
|
|
3309
3330
|
const t = ++this.buildGeneration;
|
|
3310
|
-
this.setAttribute("data-editora-editor", "true"),
|
|
3331
|
+
this.setAttribute("data-editora-editor", "true"), Se.add(this), tt || (tt = this), Ei(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.classList.toggle("editora-disabled", this.isEditorDisabled()), this.applyThemeClass(this.config.theme), this.isMenubarRequested() && ui("menubar", "<editora-editor> does not render a menu bar."), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
|
|
3311
3332
|
const e = await this.loadPlugins();
|
|
3312
3333
|
if (t !== this.buildGeneration || !this.isConnected) return;
|
|
3313
3334
|
if (this.loadedPlugins = e, e.forEach((l) => {
|
|
@@ -3326,10 +3347,10 @@ class $ extends vi {
|
|
|
3326
3347
|
const r = this.sanitizeLoadedContent(
|
|
3327
3348
|
(a = o != null ? o : this.restoreAutosavedContent()) != null ? a : this.getAttribute("data-initial-content") || ""
|
|
3328
3349
|
);
|
|
3329
|
-
this.engine = new
|
|
3350
|
+
this.engine = new fn({
|
|
3330
3351
|
content: r,
|
|
3331
3352
|
plugins: e,
|
|
3332
|
-
readonly: this.config.readonly
|
|
3353
|
+
readonly: !!this.config.readonly || this.isEditorDisabled()
|
|
3333
3354
|
}), this.createUI(e, r), this.setupEventListeners(), this.startAutosave(), this.isInitialized = !0, this.removeAttribute("data-loading"), this.removeAttribute("aria-busy"), this.dispatchEvent(new CustomEvent("editor-ready", {
|
|
3334
3355
|
detail: { api: this.getAPI() },
|
|
3335
3356
|
bubbles: !0
|
|
@@ -3374,7 +3395,7 @@ class $ extends vi {
|
|
|
3374
3395
|
const a = this.pluginLoader.getRegisteredPluginNames();
|
|
3375
3396
|
for (const l of a) {
|
|
3376
3397
|
const c = this.getPluginLoadConfig(l);
|
|
3377
|
-
if (
|
|
3398
|
+
if (gi.has(l) && !c) continue;
|
|
3378
3399
|
const p = await this.loadPlugin(l, c);
|
|
3379
3400
|
p && t.push(p);
|
|
3380
3401
|
}
|
|
@@ -3472,12 +3493,15 @@ class $ extends vi {
|
|
|
3472
3493
|
if (!this.contentElement) return;
|
|
3473
3494
|
const t = this.getAccessibilityConfig();
|
|
3474
3495
|
if (t.enableARIA) {
|
|
3475
|
-
this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute(
|
|
3496
|
+
this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute(
|
|
3497
|
+
"aria-disabled",
|
|
3498
|
+
this.config.readonly || this.isEditorDisabled() ? "true" : "false"
|
|
3499
|
+
);
|
|
3476
3500
|
const o = (e = this.getAttribute("aria-label")) == null ? void 0 : e.trim(), r = typeof this.config.placeholder == "string" ? this.config.placeholder.trim() : "";
|
|
3477
|
-
this.contentElement.setAttribute("aria-label", o || r ||
|
|
3501
|
+
this.contentElement.setAttribute("aria-label", o || r || mi);
|
|
3478
3502
|
} else
|
|
3479
3503
|
this.contentElement.removeAttribute("role"), this.contentElement.removeAttribute("aria-multiline"), this.contentElement.removeAttribute("aria-disabled"), this.contentElement.removeAttribute("aria-label");
|
|
3480
|
-
this.contentElement.tabIndex = t.keyboardNavigation ? 0 : -1;
|
|
3504
|
+
this.contentElement.tabIndex = t.keyboardNavigation && !this.isEditorDisabled() ? 0 : -1;
|
|
3481
3505
|
}
|
|
3482
3506
|
applyLanguageSettings() {
|
|
3483
3507
|
if (!this.contentElement) return;
|
|
@@ -3574,7 +3598,7 @@ class $ extends vi {
|
|
|
3574
3598
|
* editable DOM: sanitizing only after the first edit leaves the page exposed until then.
|
|
3575
3599
|
*/
|
|
3576
3600
|
sanitizeLoadedContent(t) {
|
|
3577
|
-
return
|
|
3601
|
+
return ko(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
|
|
3578
3602
|
}
|
|
3579
3603
|
getAutosaveConfig() {
|
|
3580
3604
|
var e, o;
|
|
@@ -3642,7 +3666,7 @@ class $ extends vi {
|
|
|
3642
3666
|
this.stopAutosave();
|
|
3643
3667
|
const t = this.getAutosaveConfig();
|
|
3644
3668
|
!t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
|
|
3645
|
-
this.persistAutosave(
|
|
3669
|
+
this.persistAutosave(yt(this.contentElement));
|
|
3646
3670
|
}, t.intervalMs));
|
|
3647
3671
|
}
|
|
3648
3672
|
insertHTMLAtSelection(t) {
|
|
@@ -3665,7 +3689,7 @@ class $ extends vi {
|
|
|
3665
3689
|
*/
|
|
3666
3690
|
createUI(t, e) {
|
|
3667
3691
|
const o = this.querySelector('[slot="toolbar"]'), r = this.querySelector('[slot="statusbar"]');
|
|
3668
|
-
this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new
|
|
3692
|
+
this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new hn(
|
|
3669
3693
|
{
|
|
3670
3694
|
items: this.resolveToolbarItems(),
|
|
3671
3695
|
sticky: this.isToolbarStickyEnabled(),
|
|
@@ -3676,6 +3700,7 @@ class $ extends vi {
|
|
|
3676
3700
|
// Pass plugin loader to get all registered plugins
|
|
3677
3701
|
), this.toolbar.setCommandHandler((a, l) => {
|
|
3678
3702
|
var c;
|
|
3703
|
+
if (this.isEditorDisabled()) return !1;
|
|
3679
3704
|
if (this.contentElement) {
|
|
3680
3705
|
this.contentElement.focus();
|
|
3681
3706
|
const p = window.getSelection();
|
|
@@ -3685,7 +3710,7 @@ class $ extends vi {
|
|
|
3685
3710
|
}
|
|
3686
3711
|
}
|
|
3687
3712
|
return this.executeCommand(a, l);
|
|
3688
|
-
}), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
|
|
3713
|
+
}), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly || this.isEditorDisabled() ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
|
|
3689
3714
|
try {
|
|
3690
3715
|
document.execCommand("defaultParagraphSeparator", !1, "p");
|
|
3691
3716
|
} catch (a) {
|
|
@@ -3702,11 +3727,20 @@ class $ extends vi {
|
|
|
3702
3727
|
}) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
|
|
3703
3728
|
} else
|
|
3704
3729
|
this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
|
|
3705
|
-
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new
|
|
3730
|
+
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new mn({ enabled: !0 }), this.floatingToolbar.create(this)), r ? this.appendChild(r) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new gn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.setToolbarControlsDisabled(this.isEditorDisabled()), this.lastReportedContent = yt(this.contentElement), this.config.autofocus && !this.isEditorDisabled() && setTimeout(() => {
|
|
3706
3731
|
var a;
|
|
3707
3732
|
return (a = this.contentElement) == null ? void 0 : a.focus();
|
|
3708
3733
|
}, 0);
|
|
3709
3734
|
}
|
|
3735
|
+
/** True only when the page asked for a menu bar (the default is not a request), through setConfig() or the attribute. */
|
|
3736
|
+
isMenubarRequested() {
|
|
3737
|
+
var o;
|
|
3738
|
+
const t = (o = this.jsConfig) == null ? void 0 : o.menubar;
|
|
3739
|
+
if (t !== void 0)
|
|
3740
|
+
return t === !0 || typeof t == "object" && t !== null && t.enabled !== !1;
|
|
3741
|
+
const e = this.getAttribute("menubar");
|
|
3742
|
+
return e !== null && e !== "false";
|
|
3743
|
+
}
|
|
3710
3744
|
/**
|
|
3711
3745
|
* Hands what a keystroke changed to the history plugin, so Undo takes back typing. Without this the
|
|
3712
3746
|
* plugin only knew about changes that plugins reported themselves, and typed text could not be undone.
|
|
@@ -3721,6 +3755,30 @@ class $ extends vi {
|
|
|
3721
3755
|
selectionCollapsed: e.selectionCollapsed
|
|
3722
3756
|
});
|
|
3723
3757
|
}
|
|
3758
|
+
/**
|
|
3759
|
+
* `disabled` is `readonly` plus a toolbar that cannot be pressed and a surface that leaves the tab
|
|
3760
|
+
* order, like a disabled form control.
|
|
3761
|
+
*/
|
|
3762
|
+
isEditorDisabled() {
|
|
3763
|
+
return this.config.disabled === !0;
|
|
3764
|
+
}
|
|
3765
|
+
applyDisabledState() {
|
|
3766
|
+
var e, o;
|
|
3767
|
+
const t = this.isEditorDisabled();
|
|
3768
|
+
this.classList.toggle("editora-disabled", t), t && ((e = this.floatingToolbar) == null || e.hide()), this.contentElement && (this.contentElement.contentEditable = t || this.config.readonly ? "false" : "true", this.applyAccessibilitySettings()), (o = this.engine) == null || o.setReadonly(t || !!this.config.readonly), this.setToolbarControlsDisabled(t);
|
|
3769
|
+
}
|
|
3770
|
+
/**
|
|
3771
|
+
* Disable (or give back) every control the default toolbar rendered. Controls that were already
|
|
3772
|
+
* disabled for another reason are marked untouched, so enabling the editor does not wake them up.
|
|
3773
|
+
*/
|
|
3774
|
+
setToolbarControlsDisabled(t) {
|
|
3775
|
+
if (!this.toolbarElement) return;
|
|
3776
|
+
this.toolbarElement.querySelectorAll(
|
|
3777
|
+
"button, input, select, textarea"
|
|
3778
|
+
).forEach((o) => {
|
|
3779
|
+
t ? o.disabled || (o.disabled = !0, o.setAttribute(we, "")) : o.hasAttribute(we) && (o.disabled = !1, o.removeAttribute(we));
|
|
3780
|
+
});
|
|
3781
|
+
}
|
|
3724
3782
|
/**
|
|
3725
3783
|
* Setup event listeners
|
|
3726
3784
|
*/
|
|
@@ -3741,23 +3799,20 @@ class $ extends vi {
|
|
|
3741
3799
|
let r = this.contentElement.innerHTML;
|
|
3742
3800
|
const a = (k = o == null ? void 0 : o.detail) == null ? void 0 : k.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = this.lastBeforeInputType;
|
|
3743
3801
|
if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
|
|
3744
|
-
const
|
|
3745
|
-
if (
|
|
3802
|
+
const v = ko(r, c, p, a);
|
|
3803
|
+
if (v !== r) {
|
|
3746
3804
|
const T = window.getSelection(), et = T && T.rangeCount > 0 ? T.getRangeAt(0) : null;
|
|
3747
|
-
if (this.contentElement.innerHTML =
|
|
3805
|
+
if (this.contentElement.innerHTML = v, et && T)
|
|
3748
3806
|
try {
|
|
3749
3807
|
T.removeAllRanges(), T.addRange(et);
|
|
3750
3808
|
} catch (G) {
|
|
3751
3809
|
}
|
|
3752
|
-
r =
|
|
3810
|
+
r = v;
|
|
3753
3811
|
}
|
|
3754
3812
|
}
|
|
3755
3813
|
this.recordInputHistory(r), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
|
|
3756
3814
|
const w = () => {
|
|
3757
|
-
this.
|
|
3758
|
-
detail: { html: Po(r) },
|
|
3759
|
-
bubbles: !0
|
|
3760
|
-
}));
|
|
3815
|
+
this.emitContentChange(Oo(r));
|
|
3761
3816
|
};
|
|
3762
3817
|
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(w, l.debounceInputMs) : w(), this.updateStatusBar();
|
|
3763
3818
|
}), this.contentElement.addEventListener("contextmenu", (o) => {
|
|
@@ -3780,19 +3835,20 @@ class $ extends vi {
|
|
|
3780
3835
|
return;
|
|
3781
3836
|
}
|
|
3782
3837
|
if (a) {
|
|
3783
|
-
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (a =
|
|
3838
|
+
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (a = li(a, c, p)), this.insertHTMLAtSelection(a);
|
|
3784
3839
|
return;
|
|
3785
3840
|
}
|
|
3786
3841
|
l && document.execCommand("insertText", !1, l);
|
|
3787
3842
|
}), this.contentElement.addEventListener("focus", () => {
|
|
3788
3843
|
tt = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
|
|
3789
3844
|
}), this.contentElement.addEventListener("blur", () => {
|
|
3790
|
-
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
}
|
|
3845
|
+
if (this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement) {
|
|
3846
|
+
const o = yt(this.contentElement);
|
|
3847
|
+
o !== this.lastReportedContent && this.emitContentChange(o);
|
|
3848
|
+
}
|
|
3849
|
+
this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
|
|
3794
3850
|
}), this.contentElement.addEventListener("keydown", (o) => {
|
|
3795
|
-
this.getAccessibilityConfig().keyboardNavigation
|
|
3851
|
+
!this.getAccessibilityConfig().keyboardNavigation || this.isEditorDisabled() || t.handleKeyDown(o, (a, l) => {
|
|
3796
3852
|
this.executeCommand(a, l);
|
|
3797
3853
|
});
|
|
3798
3854
|
});
|
|
@@ -3802,6 +3858,12 @@ class $ extends vi {
|
|
|
3802
3858
|
};
|
|
3803
3859
|
this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
|
|
3804
3860
|
}
|
|
3861
|
+
emitContentChange(t) {
|
|
3862
|
+
this.lastReportedContent = t, this.dispatchEvent(new CustomEvent("content-change", {
|
|
3863
|
+
detail: { html: t },
|
|
3864
|
+
bubbles: !0
|
|
3865
|
+
}));
|
|
3866
|
+
}
|
|
3805
3867
|
getSelectionRangeInEditor() {
|
|
3806
3868
|
if (!this.contentElement) return null;
|
|
3807
3869
|
const t = window.getSelection();
|
|
@@ -3869,10 +3931,10 @@ class $ extends vi {
|
|
|
3869
3931
|
const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
|
|
3870
3932
|
if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
|
|
3871
3933
|
return;
|
|
3872
|
-
const o = this.contentElement.textContent || "", { words: r, chars: a } =
|
|
3934
|
+
const o = this.contentElement.textContent || "", { words: r, chars: a } = vn(o), l = En(this.contentElement);
|
|
3873
3935
|
let c, p;
|
|
3874
3936
|
const m = this.getSelectionRangeInEditor();
|
|
3875
|
-
m && (c =
|
|
3937
|
+
m && (c = bn(this.contentElement, m), m.collapsed || (p = wn(m, c), c = void 0)), this.statusBar.update({
|
|
3876
3938
|
wordCount: r,
|
|
3877
3939
|
charCount: a,
|
|
3878
3940
|
lineCount: l,
|
|
@@ -3893,12 +3955,13 @@ class $ extends vi {
|
|
|
3893
3955
|
handleAttributeChange(t, e) {
|
|
3894
3956
|
switch (t) {
|
|
3895
3957
|
case "readonly":
|
|
3896
|
-
this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e));
|
|
3958
|
+
this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) || this.isEditorDisabled() ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e) || this.isEditorDisabled());
|
|
3959
|
+
break;
|
|
3960
|
+
case "disabled":
|
|
3961
|
+
this.applyDisabledState();
|
|
3897
3962
|
break;
|
|
3898
3963
|
case "theme":
|
|
3899
|
-
this.
|
|
3900
|
-
o.startsWith("editora-theme-") && this.classList.remove(o);
|
|
3901
|
-
}), e && this.classList.add(`editora-theme-${e}`);
|
|
3964
|
+
this.applyThemeClass(e);
|
|
3902
3965
|
break;
|
|
3903
3966
|
case "placeholder":
|
|
3904
3967
|
this.contentElement && (this.contentElement.setAttribute("data-placeholder", e), this.applyAccessibilitySettings());
|
|
@@ -3948,14 +4011,20 @@ class $ extends vi {
|
|
|
3948
4011
|
case "toolbar-sticky":
|
|
3949
4012
|
case "plugins":
|
|
3950
4013
|
case "statusbar":
|
|
3951
|
-
this.isConnected &&
|
|
3952
|
-
this.initialize().catch((o) => {
|
|
3953
|
-
console.error("[RichTextEditor] Error during attribute change re-initialization:", o);
|
|
3954
|
-
});
|
|
3955
|
-
}));
|
|
4014
|
+
this.isConnected && this.hasConnected && this.scheduleReinitialize();
|
|
3956
4015
|
break;
|
|
3957
4016
|
}
|
|
3958
4017
|
}
|
|
4018
|
+
/** One rebuild for however many attributes are changed in the same task. */
|
|
4019
|
+
scheduleReinitialize() {
|
|
4020
|
+
this.reinitializeQueued || (this.reinitializeQueued = !0, queueMicrotask(() => {
|
|
4021
|
+
this.reinitializeQueued = !1, this.isConnected && (this.destroy(), this.waitForPluginLoader().then(() => {
|
|
4022
|
+
this.initialize().catch((t) => {
|
|
4023
|
+
console.error("[RichTextEditor] Error during attribute change re-initialization:", t);
|
|
4024
|
+
});
|
|
4025
|
+
}));
|
|
4026
|
+
}));
|
|
4027
|
+
}
|
|
3959
4028
|
/**
|
|
3960
4029
|
* Resolve configuration from all sources
|
|
3961
4030
|
*/
|
|
@@ -3965,7 +4034,7 @@ class $ extends vi {
|
|
|
3965
4034
|
const o = this.attributes[e];
|
|
3966
4035
|
t[o.name] = o.value;
|
|
3967
4036
|
}
|
|
3968
|
-
return
|
|
4037
|
+
return Ae.resolve({
|
|
3969
4038
|
jsConfig: this.jsConfig,
|
|
3970
4039
|
attributes: t
|
|
3971
4040
|
});
|
|
@@ -3975,7 +4044,7 @@ class $ extends vi {
|
|
|
3975
4044
|
*/
|
|
3976
4045
|
getAPI() {
|
|
3977
4046
|
return {
|
|
3978
|
-
getContent: () =>
|
|
4047
|
+
getContent: () => yt(this.contentElement),
|
|
3979
4048
|
setContent: (t) => {
|
|
3980
4049
|
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
3981
4050
|
},
|
|
@@ -4003,11 +4072,11 @@ class $ extends vi {
|
|
|
4003
4072
|
*/
|
|
4004
4073
|
destroy() {
|
|
4005
4074
|
var t, e, o, r;
|
|
4006
|
-
this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent =
|
|
4075
|
+
this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = yt(this.contentElement), this.persistAutosave(this.preservedContent)), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (r = this.statusBar) == null || r.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.lastReportedContent = null, this.isInitialized = !1, Se.delete(this), tt === this && (tt = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
|
|
4007
4076
|
}
|
|
4008
4077
|
// Public API methods
|
|
4009
4078
|
getContent() {
|
|
4010
|
-
return
|
|
4079
|
+
return yt(this.contentElement);
|
|
4011
4080
|
}
|
|
4012
4081
|
setContent(t) {
|
|
4013
4082
|
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
@@ -4024,9 +4093,9 @@ class $ extends vi {
|
|
|
4024
4093
|
(t = this.contentElement) == null || t.blur();
|
|
4025
4094
|
}
|
|
4026
4095
|
}
|
|
4027
|
-
const Vt = new
|
|
4096
|
+
const Vt = new _o();
|
|
4028
4097
|
$.__globalPluginLoader = Vt;
|
|
4029
|
-
const
|
|
4098
|
+
const Ti = {
|
|
4030
4099
|
// Core editing plugins (always loaded)
|
|
4031
4100
|
bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((n) => n.BoldPlugin()),
|
|
4032
4101
|
italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((n) => n.ItalicPlugin()),
|
|
@@ -4056,9 +4125,9 @@ const Ei = {
|
|
|
4056
4125
|
link: () => import("./LinkPlugin.native-Dt_p6Ukb.mjs").then((n) => n.LinkPlugin()),
|
|
4057
4126
|
table: () => import("./TablePlugin.native-1TvjRqv1.mjs").then((n) => n.TablePlugin()),
|
|
4058
4127
|
trackChanges: () => import("./TrackChangesPlugin.native-Bghu2q4a.mjs").then((n) => n.TrackChangesPlugin()),
|
|
4059
|
-
versionDiff: () => import("./VersionDiffPlugin.native-
|
|
4060
|
-
"version-diff": () => import("./VersionDiffPlugin.native-
|
|
4061
|
-
versiondiff: () => import("./VersionDiffPlugin.native-
|
|
4128
|
+
versionDiff: () => import("./VersionDiffPlugin.native-2v8ZaZWN.mjs").then((n) => n.VersionDiffPlugin()),
|
|
4129
|
+
"version-diff": () => import("./VersionDiffPlugin.native-2v8ZaZWN.mjs").then((n) => n.VersionDiffPlugin()),
|
|
4130
|
+
versiondiff: () => import("./VersionDiffPlugin.native-2v8ZaZWN.mjs").then((n) => n.VersionDiffPlugin()),
|
|
4062
4131
|
conditionalContent: () => import("./ConditionalContentPlugin.native-B3R6xcqn.mjs").then((n) => n.ConditionalContentPlugin()),
|
|
4063
4132
|
"conditional-content": () => import("./ConditionalContentPlugin.native-B3R6xcqn.mjs").then((n) => n.ConditionalContentPlugin()),
|
|
4064
4133
|
conditionalcontent: () => import("./ConditionalContentPlugin.native-B3R6xcqn.mjs").then((n) => n.ConditionalContentPlugin()),
|
|
@@ -4111,12 +4180,12 @@ const Ei = {
|
|
|
4111
4180
|
template: () => import("./TemplatePlugin.native-OD8Wc1R7.mjs").then((n) => n.TemplatePlugin()),
|
|
4112
4181
|
footnote: () => import("./FootnotePlugin.native-D730OGRm.mjs").then((n) => n.FootnotePlugin())
|
|
4113
4182
|
};
|
|
4114
|
-
async function
|
|
4115
|
-
return Object.entries(
|
|
4183
|
+
async function Ci() {
|
|
4184
|
+
return Object.entries(Ti).forEach(([n, t]) => {
|
|
4116
4185
|
Vt.register(n, t);
|
|
4117
4186
|
}), Vt;
|
|
4118
4187
|
}
|
|
4119
|
-
typeof window != "undefined" &&
|
|
4188
|
+
typeof window != "undefined" && Ci().then((n) => {
|
|
4120
4189
|
$.__globalPluginLoader = n, customElements.get("editora-editor") || customElements.define("editora-editor", $);
|
|
4121
4190
|
const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
|
|
4122
4191
|
t.forEach((a) => {
|
|
@@ -4139,6 +4208,6 @@ typeof window != "undefined" && wi().then((n) => {
|
|
|
4139
4208
|
});
|
|
4140
4209
|
export {
|
|
4141
4210
|
$ as RichTextEditorElement,
|
|
4142
|
-
|
|
4211
|
+
Ci as initWebComponent
|
|
4143
4212
|
};
|
|
4144
4213
|
//# sourceMappingURL=webcomponent.js.map
|