@editora/plugins 1.0.9 → 1.0.10
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 +5 -0
- package/dist/_commonjsHelpers-6763f629.js +1 -0
- package/dist/_commonjsHelpers-c5d32002.mjs +30 -0
- package/dist/a11y-checker.cjs.js +12 -12
- package/dist/a11y-checker.esm.js +98 -80
- package/dist/anchor.cjs.js +12 -12
- package/dist/anchor.esm.js +128 -115
- package/dist/anchoredPopover-33f1358d.mjs +109 -0
- package/dist/anchoredPopover-8151d535.js +1 -0
- package/dist/approval-workflow.cjs.js +40 -40
- package/dist/approval-workflow.esm.js +249 -208
- package/dist/background-color.cjs.js +2 -2
- package/dist/background-color.esm.js +68 -55
- package/dist/blockquote.esm.js +2 -1
- package/dist/blocks-library.cjs.js +45 -45
- package/dist/blocks-library.esm.js +245 -178
- package/dist/capitalization.esm.js +2 -1
- package/dist/checklist.cjs.js +1 -1
- package/dist/checklist.esm.js +82 -58
- package/dist/citations.cjs.js +37 -37
- package/dist/citations.esm.js +512 -439
- package/dist/clear-formatting.cjs.js +1 -1
- package/dist/clear-formatting.esm.js +33 -27
- package/dist/code-sample.cjs.js +14 -14
- package/dist/code-sample.esm.js +93 -82
- package/dist/code.cjs.js +32 -32
- package/dist/code.esm.js +653 -594
- package/dist/comments.cjs.js +6 -6
- package/dist/comments.esm.js +158 -116
- package/dist/conditional-content.cjs.js +90 -90
- package/dist/conditional-content.esm.js +432 -371
- package/dist/content-rules.cjs.js +7 -7
- package/dist/content-rules.esm.js +159 -105
- package/dist/data-binding.cjs.js +46 -46
- package/dist/data-binding.esm.js +368 -328
- package/dist/direction.esm.js +18 -9
- package/dist/doc-schema.cjs.js +29 -29
- package/dist/doc-schema.esm.js +308 -240
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +5 -4
- package/dist/documentManager-25b6203c.mjs +9122 -0
- package/dist/documentManager-b69e7054.js +17 -0
- package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +2 -1
- package/dist/embed-iframe.cjs.js +4 -4
- package/dist/embed-iframe.esm.js +81 -73
- package/dist/emojis.cjs.js +8 -8
- package/dist/emojis.esm.js +77 -65
- package/dist/enterprise.cjs.js +1 -1
- package/dist/enterprise.esm.js +56 -54
- package/dist/font-family.cjs.js +1 -1
- package/dist/font-family.esm.js +47 -39
- package/dist/font-size.cjs.js +1 -1
- package/dist/font-size.esm.js +53 -37
- package/dist/footnote.cjs.js +2 -2
- package/dist/footnote.esm.js +117 -76
- package/dist/history.cjs.js +1 -1
- package/dist/history.esm.js +92 -70
- package/dist/html2canvas.esm-09133e29.js +22 -0
- package/dist/{html2canvas.esm-BWVIUcAF.mjs → html2canvas.esm-1a1724a1.mjs} +225 -141
- package/dist/indent.cjs.js +1 -1
- package/dist/indent.esm.js +24 -12
- package/dist/index-656d224b.js +231 -0
- package/dist/index-6a8c48bb.js +1 -0
- package/dist/index-d027b7e2.mjs +16859 -0
- package/dist/{index-BFsKNTTj.mjs → index-f04538f2.mjs} +71 -70
- package/dist/index.cjs.js +1 -1
- package/dist/index.es-730f2d98.mjs +5775 -0
- package/dist/index.es-dd40173b.js +18 -0
- package/dist/index.esm.js +128 -125
- package/dist/italic.cjs.js +1 -1
- package/dist/italic.esm.js +9 -8
- package/dist/jspdf.es.min-90db2c97.js +243 -0
- package/dist/{jspdf.es.min-DQCoX5yh.mjs → jspdf.es.min-c36a4fd8.mjs} +4682 -3658
- package/dist/line-height.cjs.js +1 -1
- package/dist/line-height.esm.js +24 -11
- package/dist/link.cjs.js +5 -5
- package/dist/link.esm.js +30 -24
- package/dist/list.cjs.js +1 -1
- package/dist/list.esm.js +25 -20
- package/dist/lite.cjs.js +1 -1
- package/dist/lite.esm.js +61 -59
- package/dist/math.cjs.js +21 -21
- package/dist/math.esm.js +146 -139
- package/dist/media-manager.cjs.js +38 -38
- package/dist/media-manager.esm.js +325 -308
- package/dist/mentions.cjs.js +9 -9
- package/dist/mentions.esm.js +286 -238
- package/dist/merge-tag.cjs.js +2 -2
- package/dist/merge-tag.esm.js +216 -177
- package/dist/page-break.cjs.js +2 -2
- package/dist/page-break.esm.js +49 -33
- package/dist/pii-redaction.cjs.js +19 -19
- package/dist/pii-redaction.esm.js +463 -393
- package/dist/preview.esm.js +10 -5
- package/dist/print.cjs.js +4 -4
- package/dist/print.esm.js +20 -17
- package/dist/{purify.es-DHhaBdbu.mjs → purify.es-35a15df8.mjs} +19 -9
- package/dist/{purify.es-T2a3nLiC.js → purify.es-a8d731c6.js} +1 -1
- package/dist/slash-commands.cjs.js +3 -3
- package/dist/slash-commands.esm.js +212 -176
- package/dist/smart-paste.cjs.js +27 -27
- package/dist/smart-paste.esm.js +336 -280
- package/dist/special-characters.cjs.js +7 -7
- package/dist/special-characters.esm.js +69 -61
- package/dist/spell-check.cjs.js +5 -5
- package/dist/spell-check.esm.js +123 -97
- package/dist/strikethrough.cjs.js +1 -1
- package/dist/strikethrough.esm.js +19 -14
- package/dist/style.css +1 -0
- package/dist/table.cjs.js +4 -4
- package/dist/table.esm.js +225 -191
- package/dist/template.cjs.js +11 -11
- package/dist/template.esm.js +153 -124
- package/dist/text-alignment.cjs.js +1 -1
- package/dist/text-alignment.esm.js +27 -21
- package/dist/text-color.cjs.js +3 -3
- package/dist/text-color.esm.js +87 -70
- package/dist/track-changes.cjs.js +2 -2
- package/dist/track-changes.esm.js +162 -100
- package/dist/translation-workflow.cjs.js +74 -74
- package/dist/translation-workflow.esm.js +678 -602
- package/dist/version-diff.cjs.js +14 -14
- package/dist/version-diff.esm.js +157 -128
- package/package.json +13 -7
- package/LICENSE +0 -21
- package/dist/_commonjsHelpers-BH3jXuIh.js +0 -1
- package/dist/_commonjsHelpers-ByX85dGu.mjs +0 -33
- package/dist/anchoredPopover-BzqGPOAE.js +0 -1
- package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
- package/dist/documentManager-CTqRftU8.mjs +0 -8369
- package/dist/documentManager-Jf0RbSks.js +0 -17
- package/dist/html2canvas.esm-B5qzocYs.js +0 -5
- package/dist/index-CvJk4DKa.js +0 -221
- package/dist/index-D3CycEFU.mjs +0 -16543
- package/dist/index-tqLTHcO6.js +0 -1
- package/dist/index.es-CE_A4QSm.js +0 -5
- package/dist/index.es-DQ78mYYo.mjs +0 -6665
- package/dist/jspdf.es.min-BoS80556.js +0 -77
- package/dist/plugins.css +0 -1
- /package/dist/{editorContainerHelpers-CFbfiOJI.js → editorContainerHelpers-36b8ddf3.js} +0 -0
package/dist/preview.esm.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
let c = !1;
|
|
2
2
|
const g = () => {
|
|
3
|
-
if (typeof document > "u")
|
|
3
|
+
if (typeof document > "u")
|
|
4
|
+
return;
|
|
4
5
|
const i = "rte-preview-plugin-styles";
|
|
5
|
-
if (document.getElementById(i))
|
|
6
|
+
if (document.getElementById(i))
|
|
7
|
+
return;
|
|
6
8
|
const t = document.createElement("style");
|
|
7
9
|
t.id = i, t.textContent = `
|
|
8
10
|
/* Preview Editor Dialog Styles */
|
|
@@ -242,12 +244,14 @@ const g = () => {
|
|
|
242
244
|
if (t.getAttribute("contenteditable") === "true")
|
|
243
245
|
return t;
|
|
244
246
|
const e = t.closest('[contenteditable="true"]');
|
|
245
|
-
if (e)
|
|
247
|
+
if (e)
|
|
248
|
+
return e;
|
|
246
249
|
}
|
|
247
250
|
return document.querySelector('[contenteditable="true"]');
|
|
248
251
|
}, h = () => {
|
|
249
252
|
const i = v();
|
|
250
|
-
if (!i)
|
|
253
|
+
if (!i)
|
|
254
|
+
return "";
|
|
251
255
|
const t = i.cloneNode(!0);
|
|
252
256
|
return [
|
|
253
257
|
".rte-floating-toolbar",
|
|
@@ -268,7 +272,8 @@ const g = () => {
|
|
|
268
272
|
}), r.setAttribute("contenteditable", "false");
|
|
269
273
|
}), t.innerHTML;
|
|
270
274
|
}, u = () => {
|
|
271
|
-
if (typeof window > "u" || c)
|
|
275
|
+
if (typeof window > "u" || c)
|
|
276
|
+
return;
|
|
272
277
|
c = !0, g();
|
|
273
278
|
const i = h(), t = w(i), e = document.createElement("div");
|
|
274
279
|
e.className = "rte-preview-editor-overlay", e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.setAttribute("aria-labelledby", "preview-editor-title");
|
package/dist/print.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=()=>`
|
|
2
2
|
* {
|
|
3
3
|
margin: 0;
|
|
4
4
|
padding: 0;
|
|
@@ -238,17 +238,17 @@
|
|
|
238
238
|
page-break-inside: avoid;
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
`,
|
|
241
|
+
`,c=()=>{var d;if(typeof window>"u")return!1;const a=(()=>{const i=window.getSelection();if(i&&i.rangeCount>0){let t=i.getRangeAt(0).startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE){const l=t;if(l.getAttribute("contenteditable")==="true")return l}t=t.parentNode}}const n=document.activeElement;if(n){if(n.getAttribute("contenteditable")==="true")return n;const t=n.closest('[contenteditable="true"]');if(t)return t}return document.querySelector('[contenteditable="true"]')})();if(!a)return console.warn("Editor content not found"),!1;const p=a.cloneNode(!0),r=document.createElement("article");r.className="rte-document rte-print",r.appendChild(p);const s=`
|
|
242
242
|
<!DOCTYPE html>
|
|
243
243
|
<html>
|
|
244
244
|
<head>
|
|
245
245
|
<meta charset="UTF-8">
|
|
246
246
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
247
247
|
<title>Print Document</title>
|
|
248
|
-
<style>${
|
|
248
|
+
<style>${g()}</style>
|
|
249
249
|
</head>
|
|
250
250
|
<body>
|
|
251
251
|
${r.outerHTML}
|
|
252
252
|
</body>
|
|
253
253
|
</html>
|
|
254
|
-
`,e=document.createElement("iframe");e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0",e.style.height="0",document.body.appendChild(e);const o=e.contentDocument||e.contentWindow
|
|
254
|
+
`,e=document.createElement("iframe");e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0",e.style.height="0",document.body.appendChild(e);const o=e.contentDocument||((d=e.contentWindow)==null?void 0:d.document);return o?(o.open(),o.write(s),o.close(),setTimeout(()=>{e.contentWindow&&(e.contentWindow.print(),setTimeout(()=>{document.body.removeChild(e)},100))},250),!0):(console.error("Could not access print frame document"),document.body.removeChild(e),!1)},m=()=>({name:"print",toolbar:[{label:"Print",command:"print",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M7 9V4h10v5M6 18h12v-4H6v4Zm0 0v2h12v-2M6 9H5a2 2 0 0 0-2 2v3h3m12-5h1a2 2 0 0 1 2 2v3h-3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>',shortcut:"Mod-p"}],commands:{print:c},keymap:{"Mod-p":()=>(c(),!0)}});exports.PrintPlugin=m;
|
package/dist/print.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const g = () => `
|
|
2
2
|
* {
|
|
3
3
|
margin: 0;
|
|
4
4
|
padding: 0;
|
|
@@ -238,17 +238,19 @@ const s = () => `
|
|
|
238
238
|
page-break-inside: avoid;
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
`,
|
|
242
|
-
|
|
241
|
+
`, p = () => {
|
|
242
|
+
var d;
|
|
243
|
+
if (typeof window > "u")
|
|
244
|
+
return !1;
|
|
243
245
|
const a = (() => {
|
|
244
246
|
const i = window.getSelection();
|
|
245
247
|
if (i && i.rangeCount > 0) {
|
|
246
248
|
let t = i.getRangeAt(0).startContainer;
|
|
247
249
|
for (; t && t !== document.body; ) {
|
|
248
250
|
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
249
|
-
const
|
|
250
|
-
if (
|
|
251
|
-
return
|
|
251
|
+
const l = t;
|
|
252
|
+
if (l.getAttribute("contenteditable") === "true")
|
|
253
|
+
return l;
|
|
252
254
|
}
|
|
253
255
|
t = t.parentNode;
|
|
254
256
|
}
|
|
@@ -258,22 +260,23 @@ const s = () => `
|
|
|
258
260
|
if (n.getAttribute("contenteditable") === "true")
|
|
259
261
|
return n;
|
|
260
262
|
const t = n.closest('[contenteditable="true"]');
|
|
261
|
-
if (t)
|
|
263
|
+
if (t)
|
|
264
|
+
return t;
|
|
262
265
|
}
|
|
263
266
|
return document.querySelector('[contenteditable="true"]');
|
|
264
267
|
})();
|
|
265
268
|
if (!a)
|
|
266
269
|
return console.warn("Editor content not found"), !1;
|
|
267
|
-
const
|
|
268
|
-
r.className = "rte-document rte-print", r.appendChild(
|
|
269
|
-
const
|
|
270
|
+
const c = a.cloneNode(!0), r = document.createElement("article");
|
|
271
|
+
r.className = "rte-document rte-print", r.appendChild(c);
|
|
272
|
+
const s = `
|
|
270
273
|
<!DOCTYPE html>
|
|
271
274
|
<html>
|
|
272
275
|
<head>
|
|
273
276
|
<meta charset="UTF-8">
|
|
274
277
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
275
278
|
<title>Print Document</title>
|
|
276
|
-
<style>${
|
|
279
|
+
<style>${g()}</style>
|
|
277
280
|
</head>
|
|
278
281
|
<body>
|
|
279
282
|
${r.outerHTML}
|
|
@@ -281,13 +284,13 @@ const s = () => `
|
|
|
281
284
|
</html>
|
|
282
285
|
`, e = document.createElement("iframe");
|
|
283
286
|
e.style.position = "absolute", e.style.left = "-9999px", e.style.top = "-9999px", e.style.width = "0", e.style.height = "0", document.body.appendChild(e);
|
|
284
|
-
const o = e.contentDocument || e.contentWindow
|
|
285
|
-
return o ? (o.open(), o.write(
|
|
287
|
+
const o = e.contentDocument || ((d = e.contentWindow) == null ? void 0 : d.document);
|
|
288
|
+
return o ? (o.open(), o.write(s), o.close(), setTimeout(() => {
|
|
286
289
|
e.contentWindow && (e.contentWindow.print(), setTimeout(() => {
|
|
287
290
|
document.body.removeChild(e);
|
|
288
291
|
}, 100));
|
|
289
292
|
}, 250), !0) : (console.error("Could not access print frame document"), document.body.removeChild(e), !1);
|
|
290
|
-
},
|
|
293
|
+
}, b = () => ({
|
|
291
294
|
name: "print",
|
|
292
295
|
toolbar: [
|
|
293
296
|
{
|
|
@@ -298,12 +301,12 @@ const s = () => `
|
|
|
298
301
|
}
|
|
299
302
|
],
|
|
300
303
|
commands: {
|
|
301
|
-
print:
|
|
304
|
+
print: p
|
|
302
305
|
},
|
|
303
306
|
keymap: {
|
|
304
|
-
"Mod-p": () => (
|
|
307
|
+
"Mod-p": () => (p(), !0)
|
|
305
308
|
}
|
|
306
309
|
});
|
|
307
310
|
export {
|
|
308
|
-
|
|
311
|
+
b as PrintPlugin
|
|
309
312
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/*! @license DOMPurify 2.5.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.8/LICENSE */
|
|
1
2
|
function I(a) {
|
|
2
3
|
"@babel/helpers - typeof";
|
|
3
4
|
return I = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
@@ -12,8 +13,10 @@ function Fe(a, n) {
|
|
|
12
13
|
}, Fe(a, n);
|
|
13
14
|
}
|
|
14
15
|
function zt() {
|
|
15
|
-
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
16
|
-
|
|
16
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
17
|
+
return !1;
|
|
18
|
+
if (typeof Proxy == "function")
|
|
19
|
+
return !0;
|
|
17
20
|
try {
|
|
18
21
|
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
19
22
|
})), !0;
|
|
@@ -33,22 +36,28 @@ function M(a) {
|
|
|
33
36
|
return Gt(a) || Wt(a) || Bt(a) || $t();
|
|
34
37
|
}
|
|
35
38
|
function Gt(a) {
|
|
36
|
-
if (Array.isArray(a))
|
|
39
|
+
if (Array.isArray(a))
|
|
40
|
+
return Ue(a);
|
|
37
41
|
}
|
|
38
42
|
function Wt(a) {
|
|
39
|
-
if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null)
|
|
43
|
+
if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null)
|
|
44
|
+
return Array.from(a);
|
|
40
45
|
}
|
|
41
46
|
function Bt(a, n) {
|
|
42
47
|
if (a) {
|
|
43
|
-
if (typeof a == "string")
|
|
48
|
+
if (typeof a == "string")
|
|
49
|
+
return Ue(a, n);
|
|
44
50
|
var o = Object.prototype.toString.call(a).slice(8, -1);
|
|
45
|
-
if (o === "Object" && a.constructor && (o = a.constructor.name), o === "Map" || o === "Set")
|
|
46
|
-
|
|
51
|
+
if (o === "Object" && a.constructor && (o = a.constructor.name), o === "Map" || o === "Set")
|
|
52
|
+
return Array.from(a);
|
|
53
|
+
if (o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))
|
|
54
|
+
return Ue(a, n);
|
|
47
55
|
}
|
|
48
56
|
}
|
|
49
57
|
function Ue(a, n) {
|
|
50
58
|
(n == null || n > a.length) && (n = a.length);
|
|
51
|
-
for (var o = 0, s = new Array(n); o < n; o++)
|
|
59
|
+
for (var o = 0, s = new Array(n); o < n; o++)
|
|
60
|
+
s[o] = a[o];
|
|
52
61
|
return s;
|
|
53
62
|
}
|
|
54
63
|
function $t() {
|
|
@@ -329,7 +338,8 @@ function _t() {
|
|
|
329
338
|
!(ot(e) && (f.tagNameCheck instanceof RegExp && _(f.tagNameCheck, e) || f.tagNameCheck instanceof Function && f.tagNameCheck(e)) && (f.attributeNameCheck instanceof RegExp && _(f.attributeNameCheck, t) || f.attributeNameCheck instanceof Function && f.attributeNameCheck(t)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
330
339
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
331
340
|
t === "is" && f.allowCustomizedBuiltInElements && (f.tagNameCheck instanceof RegExp && _(f.tagNameCheck, r) || f.tagNameCheck instanceof Function && f.tagNameCheck(r)))
|
|
332
|
-
)
|
|
341
|
+
)
|
|
342
|
+
return !1;
|
|
333
343
|
} else if (!be[t]) {
|
|
334
344
|
if (!_(_e, L(r, Ge, ""))) {
|
|
335
345
|
if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Zt(r, "data:") === 0 && Ke[e])) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*! @license DOMPurify 2.5.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.8/LICENSE */function I(a){"@babel/helpers - typeof";return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},I(a)}function Fe(a,n){return Fe=Object.setPrototypeOf||function(s,c){return s.__proto__=c,s},Fe(a,n)}function zt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function le(a,n,o){return zt()?le=Reflect.construct:le=function(c,g,y){var D=[null];D.push.apply(D,g);var x=Function.bind.apply(c,D),j=new x;return y&&Fe(j,y.prototype),j},le.apply(null,arguments)}function M(a){return Gt(a)||Wt(a)||Bt(a)||$t()}function Gt(a){if(Array.isArray(a))return Ue(a)}function Wt(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function Bt(a,n){if(a){if(typeof a=="string")return Ue(a,n);var o=Object.prototype.toString.call(a).slice(8,-1);if(o==="Object"&&a.constructor&&(o=a.constructor.name),o==="Map"||o==="Set")return Array.from(a);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Ue(a,n)}}function Ue(a,n){(n==null||n>a.length)&&(n=a.length);for(var o=0,s=new Array(n);o<n;o++)s[o]=a[o];return s}function $t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var jt=Object.hasOwnProperty,ut=Object.setPrototypeOf,Yt=Object.isFrozen,Xt=Object.getPrototypeOf,Vt=Object.getOwnPropertyDescriptor,E=Object.freeze,b=Object.seal,qt=Object.create,vt=typeof Reflect<"u"&&Reflect,ue=vt.apply,He=vt.construct;ue||(ue=function(n,o,s){return n.apply(o,s)});E||(E=function(n){return n});b||(b=function(n){return n});He||(He=function(n,o){return le(n,M(o))});var Kt=O(Array.prototype.forEach),ft=O(Array.prototype.pop),q=O(Array.prototype.push),se=O(String.prototype.toLowerCase),we=O(String.prototype.toString),ct=O(String.prototype.match),L=O(String.prototype.replace),Zt=O(String.prototype.indexOf),Jt=O(String.prototype.trim),_=O(RegExp.prototype.test),Ce=Qt(TypeError);function O(a){return function(n){for(var o=arguments.length,s=new Array(o>1?o-1:0),c=1;c<o;c++)s[c-1]=arguments[c];return ue(a,n,s)}}function Qt(a){return function(){for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return He(a,o)}}function l(a,n,o){var s;o=(s=o)!==null&&s!==void 0?s:se,ut&&ut(a,null);for(var c=n.length;c--;){var g=n[c];if(typeof g=="string"){var y=o(g);y!==g&&(Yt(n)||(n[c]=y),g=y)}a[g]=!0}return a}function U(a){var n=qt(null),o;for(o in a)ue(jt,a,[o])===!0&&(n[o]=a[o]);return n}function ie(a,n){for(;a!==null;){var o=Vt(a,n);if(o){if(o.get)return O(o.get);if(typeof o.value=="function")return O(o.value)}a=Xt(a)}function s(c){return console.warn("fallback value for",c),null}return s}var mt=E(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ie=E(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),xe=E(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),er=E(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ke=E(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),tr=E(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pt=E(["#text"]),dt=E(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Pe=E(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Tt=E(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),oe=E(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rr=b(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ar=b(/<%[\w\W]*|[\w\W]*%>/gm),nr=b(/\${[\w\W]*}/gm),ir=b(/^data-[\-\w.\u00B7-\uFFFF]+$/),or=b(/^aria-[\-\w]+$/),lr=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),sr=b(/^(?:\w+script|data):/i),ur=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fr=b(/^html$/i),cr=b(/^[a-z][.\w]*(-[.\w]+)+$/i),mr=function(){return typeof window>"u"?null:window},pr=function(n,o){if(I(n)!=="object"||typeof n.createPolicy!="function")return null;var s=null,c="data-tt-policy-suffix";o.currentScript&&o.currentScript.hasAttribute(c)&&(s=o.currentScript.getAttribute(c));var g="dompurify"+(s?"#"+s:"");try{return n.createPolicy(g,{createHTML:function(D){return D},createScriptURL:function(D){return D}})}catch{return console.warn("TrustedTypes policy "+g+" could not be created."),null}};function _t(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mr(),n=function(e){return _t(e)};if(n.version="2.5.8",n.removed=[],!a||!a.document||a.document.nodeType!==9)return n.isSupported=!1,n;var o=a.document,s=a.document,c=a.DocumentFragment,g=a.HTMLTemplateElement,y=a.Node,D=a.Element,x=a.NodeFilter,j=a.NamedNodeMap,ht=j===void 0?a.NamedNodeMap||a.MozNamedAttrMap:j,Et=a.HTMLFormElement,At=a.DOMParser,K=a.trustedTypes,Z=D.prototype,yt=ie(Z,"cloneNode"),gt=ie(Z,"nextSibling"),St=ie(Z,"childNodes"),fe=ie(Z,"parentNode");if(typeof g=="function"){var ce=s.createElement("template");ce.content&&ce.content.ownerDocument&&(s=ce.content.ownerDocument)}var R=pr(K,o),me=R?R.createHTML(""):"",J=s,pe=J.implementation,bt=J.createNodeIterator,Ot=J.createDocumentFragment,Rt=J.getElementsByTagName,Lt=o.importNode,ze={};try{ze=U(s).documentMode?s.documentMode:{}}catch{}var N={};n.isSupported=typeof fe=="function"&&pe&&pe.createHTMLDocument!==void 0&&ze!==9;var de=rr,Te=ar,ve=nr,Mt=ir,Dt=or,Nt=sr,Ge=ur,wt=cr,_e=lr,p=null,We=l({},[].concat(M(mt),M(Ie),M(xe),M(ke),M(pt))),d=null,Be=l({},[].concat(M(dt),M(Pe),M(Tt),M(oe))),f=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Y=null,he=null,$e=!0,Ee=!0,je=!1,Ye=!0,H=!1,Ae=!0,k=!1,ye=!1,ge=!1,z=!1,Q=!1,ee=!1,Xe=!0,Ve=!1,Ct="user-content-",Se=!0,X=!1,G={},W=null,qe=l({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ke=null,Ze=l({},["audio","video","img","source","image","track"]),be=null,Je=l({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),te="http://www.w3.org/1998/Math/MathML",re="http://www.w3.org/2000/svg",w="http://www.w3.org/1999/xhtml",B=w,Oe=!1,Re=null,It=l({},[te,re,w],we),P,xt=["application/xhtml+xml","text/html"],kt="text/html",T,$=null,Pt=s.createElement("form"),Qe=function(e){return e instanceof RegExp||e instanceof Function},Le=function(e){$&&$===e||((!e||I(e)!=="object")&&(e={}),e=U(e),P=xt.indexOf(e.PARSER_MEDIA_TYPE)===-1?P=kt:P=e.PARSER_MEDIA_TYPE,T=P==="application/xhtml+xml"?we:se,p="ALLOWED_TAGS"in e?l({},e.ALLOWED_TAGS,T):We,d="ALLOWED_ATTR"in e?l({},e.ALLOWED_ATTR,T):Be,Re="ALLOWED_NAMESPACES"in e?l({},e.ALLOWED_NAMESPACES,we):It,be="ADD_URI_SAFE_ATTR"in e?l(U(Je),e.ADD_URI_SAFE_ATTR,T):Je,Ke="ADD_DATA_URI_TAGS"in e?l(U(Ze),e.ADD_DATA_URI_TAGS,T):Ze,W="FORBID_CONTENTS"in e?l({},e.FORBID_CONTENTS,T):qe,Y="FORBID_TAGS"in e?l({},e.FORBID_TAGS,T):{},he="FORBID_ATTR"in e?l({},e.FORBID_ATTR,T):{},G="USE_PROFILES"in e?e.USE_PROFILES:!1,$e=e.ALLOW_ARIA_ATTR!==!1,Ee=e.ALLOW_DATA_ATTR!==!1,je=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ye=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,H=e.SAFE_FOR_TEMPLATES||!1,Ae=e.SAFE_FOR_XML!==!1,k=e.WHOLE_DOCUMENT||!1,z=e.RETURN_DOM||!1,Q=e.RETURN_DOM_FRAGMENT||!1,ee=e.RETURN_TRUSTED_TYPE||!1,ge=e.FORCE_BODY||!1,Xe=e.SANITIZE_DOM!==!1,Ve=e.SANITIZE_NAMED_PROPS||!1,Se=e.KEEP_CONTENT!==!1,X=e.IN_PLACE||!1,_e=e.ALLOWED_URI_REGEXP||_e,B=e.NAMESPACE||w,f=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Qe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Qe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),H&&(Ee=!1),Q&&(z=!0),G&&(p=l({},M(pt)),d=[],G.html===!0&&(l(p,mt),l(d,dt)),G.svg===!0&&(l(p,Ie),l(d,Pe),l(d,oe)),G.svgFilters===!0&&(l(p,xe),l(d,Pe),l(d,oe)),G.mathMl===!0&&(l(p,ke),l(d,Tt),l(d,oe))),e.ADD_TAGS&&(p===We&&(p=U(p)),l(p,e.ADD_TAGS,T)),e.ADD_ATTR&&(d===Be&&(d=U(d)),l(d,e.ADD_ATTR,T)),e.ADD_URI_SAFE_ATTR&&l(be,e.ADD_URI_SAFE_ATTR,T),e.FORBID_CONTENTS&&(W===qe&&(W=U(W)),l(W,e.FORBID_CONTENTS,T)),Se&&(p["#text"]=!0),k&&l(p,["html","head","body"]),p.table&&(l(p,["tbody"]),delete Y.tbody),E&&E(e),$=e)},et=l({},["mi","mo","mn","ms","mtext"]),tt=l({},["annotation-xml"]),Ft=l({},["title","style","font","a","script"]),ae=l({},Ie);l(ae,xe),l(ae,er);var Me=l({},ke);l(Me,tr);var Ut=function(e){var t=fe(e);(!t||!t.tagName)&&(t={namespaceURI:B,tagName:"template"});var r=se(e.tagName),u=se(t.tagName);return Re[e.namespaceURI]?e.namespaceURI===re?t.namespaceURI===w?r==="svg":t.namespaceURI===te?r==="svg"&&(u==="annotation-xml"||et[u]):!!ae[r]:e.namespaceURI===te?t.namespaceURI===w?r==="math":t.namespaceURI===re?r==="math"&&tt[u]:!!Me[r]:e.namespaceURI===w?t.namespaceURI===re&&!tt[u]||t.namespaceURI===te&&!et[u]?!1:!Me[r]&&(Ft[r]||!ae[r]):!!(P==="application/xhtml+xml"&&Re[e.namespaceURI]):!1},S=function(e){q(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch{try{e.outerHTML=me}catch{e.remove()}}},ne=function(e,t){try{q(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{q(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is"&&!d[e])if(z||Q)try{S(t)}catch{}else try{t.setAttribute(e,"")}catch{}},rt=function(e){var t,r;if(ge)e="<remove></remove>"+e;else{var u=ct(e,/^[\r\n\t ]+/);r=u&&u[0]}P==="application/xhtml+xml"&&B===w&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var A=R?R.createHTML(e):e;if(B===w)try{t=new At().parseFromString(A,P)}catch{}if(!t||!t.documentElement){t=pe.createDocument(B,"template",null);try{t.documentElement.innerHTML=Oe?me:A}catch{}}var h=t.body||t.documentElement;return e&&r&&h.insertBefore(s.createTextNode(r),h.childNodes[0]||null),B===w?Rt.call(t,k?"html":"body")[0]:k?t.documentElement:h},at=function(e){return bt.call(e.ownerDocument||e,e,x.SHOW_ELEMENT|x.SHOW_COMMENT|x.SHOW_TEXT|x.SHOW_PROCESSING_INSTRUCTION|x.SHOW_CDATA_SECTION,null,!1)},De=function(e){return e instanceof Et&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof ht)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},V=function(e){return I(y)==="object"?e instanceof y:e&&I(e)==="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string"},C=function(e,t,r){N[e]&&Kt(N[e],function(u){u.call(n,t,r,$)})},nt=function(e){var t;if(C("beforeSanitizeElements",e,null),De(e)||_(/[\u0080-\uFFFF]/,e.nodeName))return S(e),!0;var r=T(e.nodeName);if(C("uponSanitizeElement",e,{tagName:r,allowedTags:p}),e.hasChildNodes()&&!V(e.firstElementChild)&&(!V(e.content)||!V(e.content.firstElementChild))&&_(/<[/\w]/g,e.innerHTML)&&_(/<[/\w]/g,e.textContent)||r==="select"&&_(/<template/i,e.innerHTML)||e.nodeType===7||Ae&&e.nodeType===8&&_(/<[/\w]/g,e.data))return S(e),!0;if(!p[r]||Y[r]){if(!Y[r]&&ot(r)&&(f.tagNameCheck instanceof RegExp&&_(f.tagNameCheck,r)||f.tagNameCheck instanceof Function&&f.tagNameCheck(r)))return!1;if(Se&&!W[r]){var u=fe(e)||e.parentNode,A=St(e)||e.childNodes;if(A&&u)for(var h=A.length,v=h-1;v>=0;--v){var F=yt(A[v],!0);F.__removalCount=(e.__removalCount||0)+1,u.insertBefore(F,gt(e))}}return S(e),!0}return e instanceof D&&!Ut(e)||(r==="noscript"||r==="noembed"||r==="noframes")&&_(/<\/no(script|embed|frames)/i,e.innerHTML)?(S(e),!0):(H&&e.nodeType===3&&(t=e.textContent,t=L(t,de," "),t=L(t,Te," "),t=L(t,ve," "),e.textContent!==t&&(q(n.removed,{element:e.cloneNode()}),e.textContent=t)),C("afterSanitizeElements",e,null),!1)},it=function(e,t,r){if(Xe&&(t==="id"||t==="name")&&(r in s||r in Pt))return!1;if(!(Ee&&!he[t]&&_(Mt,t))){if(!($e&&_(Dt,t))){if(!d[t]||he[t]){if(!(ot(e)&&(f.tagNameCheck instanceof RegExp&&_(f.tagNameCheck,e)||f.tagNameCheck instanceof Function&&f.tagNameCheck(e))&&(f.attributeNameCheck instanceof RegExp&&_(f.attributeNameCheck,t)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(t))||t==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&_(f.tagNameCheck,r)||f.tagNameCheck instanceof Function&&f.tagNameCheck(r))))return!1}else if(!be[t]){if(!_(_e,L(r,Ge,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&Zt(r,"data:")===0&&Ke[e])){if(!(je&&!_(Nt,L(r,Ge,"")))){if(r)return!1}}}}}}return!0},ot=function(e){return e!=="annotation-xml"&&ct(e,wt)},lt=function(e){var t,r,u,A;C("beforeSanitizeAttributes",e,null);var h=e.attributes;if(!(!h||De(e))){var v={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:d};for(A=h.length;A--;){t=h[A];var F=t,m=F.name,Ne=F.namespaceURI;if(r=m==="value"?t.value:Jt(t.value),u=T(m),v.attrName=u,v.attrValue=r,v.keepAttr=!0,v.forceKeepAttr=void 0,C("uponSanitizeAttribute",e,v),r=v.attrValue,!v.forceKeepAttr&&(ne(m,e),!!v.keepAttr)){if(!Ye&&_(/\/>/i,r)){ne(m,e);continue}H&&(r=L(r,de," "),r=L(r,Te," "),r=L(r,ve," "));var st=T(e.nodeName);if(it(st,u,r)){if(Ve&&(u==="id"||u==="name")&&(ne(m,e),r=Ct+r),Ae&&_(/((--!?|])>)|<\/(style|title)/i,r)){ne(m,e);continue}if(R&&I(K)==="object"&&typeof K.getAttributeType=="function"&&!Ne)switch(K.getAttributeType(st,u)){case"TrustedHTML":{r=R.createHTML(r);break}case"TrustedScriptURL":{r=R.createScriptURL(r);break}}try{Ne?e.setAttributeNS(Ne,m,r):e.setAttribute(m,r),De(e)?S(e):ft(n.removed)}catch{}}}}C("afterSanitizeAttributes",e,null)}},Ht=function i(e){var t,r=at(e);for(C("beforeSanitizeShadowDOM",e,null);t=r.nextNode();)C("uponSanitizeShadowNode",t,null),nt(t),lt(t),t.content instanceof c&&i(t.content);C("afterSanitizeShadowDOM",e,null)};return n.sanitize=function(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t,r,u,A,h;if(Oe=!i,Oe&&(i="<!-->"),typeof i!="string"&&!V(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw Ce("dirty is not a string, aborting")}else throw Ce("toString is not a function");if(!n.isSupported){if(I(a.toStaticHTML)==="object"||typeof a.toStaticHTML=="function"){if(typeof i=="string")return a.toStaticHTML(i);if(V(i))return a.toStaticHTML(i.outerHTML)}return i}if(ye||Le(e),n.removed=[],typeof i=="string"&&(X=!1),X){if(i.nodeName){var v=T(i.nodeName);if(!p[v]||Y[v])throw Ce("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof y)t=rt("<!---->"),r=t.ownerDocument.importNode(i,!0),r.nodeType===1&&r.nodeName==="BODY"||r.nodeName==="HTML"?t=r:t.appendChild(r);else{if(!z&&!H&&!k&&i.indexOf("<")===-1)return R&&ee?R.createHTML(i):i;if(t=rt(i),!t)return z?null:ee?me:""}t&&ge&&S(t.firstChild);for(var F=at(X?i:t);u=F.nextNode();)u.nodeType===3&&u===A||(nt(u),lt(u),u.content instanceof c&&Ht(u.content),A=u);if(A=null,X)return i;if(z){if(Q)for(h=Ot.call(t.ownerDocument);t.firstChild;)h.appendChild(t.firstChild);else h=t;return(d.shadowroot||d.shadowrootmod)&&(h=Lt.call(o,h,!0)),h}var m=k?t.outerHTML:t.innerHTML;return k&&p["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&_(fr,t.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
|
|
3
3
|
`+m),H&&(m=L(m,de," "),m=L(m,Te," "),m=L(m,ve," ")),R&&ee?R.createHTML(m):m},n.setConfig=function(i){Le(i),ye=!0},n.clearConfig=function(){$=null,ye=!1},n.isValidAttribute=function(i,e,t){$||Le({});var r=T(i),u=T(e);return it(r,u,t)},n.addHook=function(i,e){typeof e=="function"&&(N[i]=N[i]||[],q(N[i],e))},n.removeHook=function(i){if(N[i])return ft(N[i])},n.removeHooks=function(i){N[i]&&(N[i]=[])},n.removeAllHooks=function(){N={}},n}var dr=_t();exports.default=dr;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function H(e,t){const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function H(e,t){const o=Array.from({length:t}).map(()=>"<th><p><br></p></th>").join(""),n=Array.from({length:e}).map(()=>`<tr>${Array.from({length:t}).map(()=>"<td><p><br></p></td>").join("")}</tr>`).join("");return`<table class="rte-table"><thead><tr>${o}</tr></thead><tbody>${n}</tbody></table><p><br></p>`}function q(){return[{id:"paragraph",label:"Paragraph",description:"Switch to paragraph text",command:"paragraph",keywords:["text","normal","p"]},{id:"h1",label:"Heading 1",description:"Large section heading",command:"heading1",keywords:["title","header","h1"]},{id:"h2",label:"Heading 2",description:"Medium section heading",command:"heading2",keywords:["subtitle","header","h2"]},{id:"h3",label:"Heading 3",description:"Small section heading",command:"heading3",keywords:["header","h3"]},{id:"bulleted-list",label:"Bulleted List",description:"Create a bullet list",command:"toggleBulletList",keywords:["list","ul","bullet"]},{id:"numbered-list",label:"Numbered List",description:"Create a numbered list",command:"toggleOrderedList",keywords:["list","ol","numbered"]},{id:"blockquote",label:"Blockquote",description:"Insert a quote block",command:"toggleBlockquote",keywords:["quote","citation"]},{id:"table-3x3",label:"Table 3x3",description:"Insert a 3 x 3 table",action:({insertHTML:e})=>e(H(3,3)),keywords:["table","grid","rows","columns"]},{id:"horizontal-rule",label:"Divider",description:"Insert a horizontal rule",command:"insertHorizontalRule",keywords:["hr","separator","line"]},{id:"bold",label:"Bold",description:"Toggle bold formatting",command:"toggleBold",keywords:["strong","b"]},{id:"italic",label:"Italic",description:"Toggle italic formatting",command:"toggleItalic",keywords:["emphasis","i"]},{id:"underline",label:"Underline",description:"Toggle underline formatting",command:"toggleUnderline",keywords:["u"]},{id:"strikethrough",label:"Strikethrough",description:"Toggle strikethrough formatting",command:"toggleStrikethrough",keywords:["strike","s"]},{id:"clear-formatting",label:"Clear Formatting",description:"Remove text formatting",command:"clearFormatting",keywords:["reset","plain"]}]}function $(e){const t=[],o=new Set;return e.forEach(n=>{const r=String(n.id||"").trim(),i=String(n.label||"").trim();!r||!i||o.has(r)||(o.add(r),t.push({...n,id:r,label:i,description:n.description?String(n.description):void 0,keywords:Array.isArray(n.keywords)?n.keywords.map(a=>String(a)).filter(Boolean):void 0}))}),t}function D(e){const t=(e.triggerChar||"/")[0]||"/",o=e.includeDefaultItems!==!1,n=o?[...e.items||[],...q()]:e.items||[];return{triggerChar:t,minChars:Math.max(0,e.minChars??0),maxQueryLength:Math.max(1,e.maxQueryLength??48),maxSuggestions:Math.max(1,e.maxSuggestions??10),requireBoundary:e.requireBoundary!==!1,includeDefaultItems:o,items:$(n),itemRenderer:e.itemRenderer||(r=>r.label),emptyStateText:e.emptyStateText||"No commands found",panelLabel:e.panelLabel||"Slash commands"}}const u='[data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark';let E=!1;function B(){if(E||typeof document>"u")return;E=!0;const e=document.createElement("style");e.id="rte-slash-commands-styles",e.textContent=`
|
|
2
2
|
.rte-slash-panel {
|
|
3
3
|
width: min(225px, calc(100vw - 16px));
|
|
4
4
|
max-height: min(360px, calc(100vh - 24px));
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
${u} .rte-slash-empty {
|
|
85
85
|
color: #9ca3af;
|
|
86
86
|
}
|
|
87
|
-
`,document.head.appendChild(e)}const s=".rte-content, .editora-content",g=new WeakMap,p=new WeakMap;let b=!1,f=null,h=0,z=0;function P(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function I(e){return e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||e}function _(e){if(e
|
|
87
|
+
`,document.head.appendChild(e)}const s=".rte-content, .editora-content",g=new WeakMap,p=new WeakMap;let b=!1,f=null,h=0,z=0;function P(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function I(e){return e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||e}function _(e){if((e==null?void 0:e.contentElement)instanceof HTMLElement)return e.contentElement;if((e==null?void 0:e.editorElement)instanceof HTMLElement){const n=e.editorElement;if(n.matches(s))return n;const r=n.querySelector(s);if(r instanceof HTMLElement)return r}const t=window.getSelection();if(t&&t.rangeCount>0){const n=t.getRangeAt(0).startContainer,r=n.nodeType===Node.ELEMENT_NODE?n:n.parentElement,i=r==null?void 0:r.closest(s);if(i)return i}const o=document.activeElement;if(o){if(o.matches(s))return o;const n=o.closest(s);if(n)return n}return document.querySelector(s)}function m(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function F(e){return e?/\s|[([{"'`]/.test(e):!0}function v(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const o=t.getRangeAt(0);return e.contains(o.commonAncestorContainer)?o.cloneRange():null}function y(e,t){const o=window.getSelection();o&&(o.removeAllRanges(),o.addRange(t),e.focus({preventScroll:!0}))}function j(e){if(!e.collapsed)return null;const t=e.startContainer,o=e.startOffset;if(t.nodeType===Node.TEXT_NODE){const n=t;return{node:n,textBefore:n.data.slice(0,o),caretOffset:o}}if(t.nodeType===Node.ELEMENT_NODE){const n=t;if(o>0){const r=n.childNodes[o-1];if(r&&r.nodeType===Node.TEXT_NODE){const i=r;return{node:i,textBefore:i.data,caretOffset:i.length}}}}return null}function K(e,t,o,n){const r=e.lastIndexOf(t);if(r<0||n&&!F(e[r-1]))return null;const i=e.slice(r+1);return/\s/.test(i)||i.length>o?null:{trigger:t,query:i,startOffset:r}}function Q(e,t){const o=t.cloneRange();o.collapse(!1);const n=o.getClientRects();if(n.length>0)return n[n.length-1];const r=document.createElement("span");r.textContent="",o.insertNode(r);const i=r.getBoundingClientRect();return r.remove(),e.normalize(),i}function A(e,t){if(!e.panel)return;const o=Q(e.editor,t),n=e.panel;n.style.display="block",n.classList.add("show"),n.style.left="0px",n.style.top="0px";const r=n.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight;let l=Math.max(8,Math.min(o.left,i-r.width-8)),d=o.bottom+8;d+r.height>a-8&&(d=Math.max(8,o.top-r.height-8)),n.style.position="fixed",n.style.left=`${l}px`,n.style.top=`${d}px`}function k(e,t){if(!t)return m(e);const o=e.toLowerCase(),n=t.toLowerCase(),r=o.indexOf(n);if(r<0)return m(e);const i=m(e.slice(0,r)),a=m(e.slice(r,r+t.length)),l=m(e.slice(r+t.length));return`${i}<mark>${a}</mark>${l}`}function U(e,t){if(e.panel&&e.list)return;const o=document.createElement("div");o.className="rte-slash-panel",o.style.display="none",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","false");const n=document.createElement("div");n.className="rte-slash-list",n.setAttribute("role","listbox"),n.setAttribute("aria-label",t.panelLabel),o.appendChild(n),document.body.appendChild(o),e.panel=o,e.list=n,o.addEventListener("mousedown",r=>{r.preventDefault()}),o.addEventListener("click",r=>{const i=r.target;if(!i)return;const a=i.closest(".rte-slash-item");if(!a)return;const l=Number(a.getAttribute("data-index"));Number.isFinite(l)&&M(e,l)})}function c(e){e.panel&&(e.panel.style.display="none",e.panel.classList.remove("show"),e.isOpen=!1,e.filteredItems=[],e.activeIndex=0,e.query="",e.replaceRange=null,e.anchorRange=null)}function W(e,t,o){if(!t)return e.slice(0,o);const n=t.toLowerCase();return e.filter(i=>[i.id,i.label,i.description||"",i.command||"",...i.keywords||[]].join(" ").toLowerCase().includes(n)).slice(0,o)}function Z(e,t){if(!e.list)return;const o=e.list;if(o.innerHTML="",e.filteredItems.length===0){const n=document.createElement("div");n.className="rte-slash-empty",n.textContent=t.emptyStateText,o.appendChild(n),o.removeAttribute("aria-activedescendant");return}e.filteredItems.forEach((n,r)=>{const i=document.createElement("button");i.type="button",i.className="rte-slash-item",i.setAttribute("role","option"),i.setAttribute("data-index",String(r)),i.setAttribute("id",`rte-slash-item-${e.instanceId}-${r}`),i.setAttribute("aria-selected",r===e.activeIndex?"true":"false"),i.setAttribute("aria-label",n.description?`${n.label} - ${n.description}`:n.label),r===e.activeIndex&&i.classList.add("active"),t.itemRenderer?i.innerHTML=t.itemRenderer(n,e.query):i.innerHTML=`
|
|
88
88
|
<span class="rte-slash-item-title">${k(n.label,e.query)}</span>
|
|
89
89
|
${n.description?`<span class="rte-slash-item-description">${k(n.description,e.query)}</span>`:""}
|
|
90
|
-
`,
|
|
90
|
+
`,o.appendChild(i)}),e.filteredItems.length>0&&o.setAttribute("aria-activedescendant",`rte-slash-item-${e.instanceId}-${e.activeIndex}`)}function G(e,t){if(t===e.innerHTML)return;const o=window.execEditorCommand||window.executeEditorCommand;if(typeof o=="function")try{o("recordDomTransaction",e,t,e.innerHTML)}catch{}}function V(e){e.dispatchEvent(new Event("input",{bubbles:!0}))}function L(e,t){e.focus({preventScroll:!0});try{if(document.execCommand("insertHTML",!1,t))return!0}catch{}const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);if(!e.contains(n.commonAncestorContainer))return!1;n.deleteContents();const r=document.createElement("template");r.innerHTML=t;const i=r.content,a=i.lastChild;if(n.insertNode(i),a){const l=document.createRange();l.setStartAfter(a),l.collapse(!0),y(e,l)}return!0}function X(e,t){e.focus({preventScroll:!0});try{if(document.execCommand("insertText",!1,t))return!0}catch{}const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);if(!e.contains(n.commonAncestorContainer))return!1;n.deleteContents();const r=document.createTextNode(t);n.insertNode(r);const i=document.createRange();return i.setStart(r,r.length),i.collapse(!0),y(e,i),!0}function J(e,t){switch(e.toLowerCase()){case"paragraph":case"p":return document.execCommand("formatBlock",!1,"<p>");case"heading1":case"h1":return document.execCommand("formatBlock",!1,"<h1>");case"heading2":case"h2":return document.execCommand("formatBlock",!1,"<h2>");case"heading3":case"h3":return document.execCommand("formatBlock",!1,"<h3>");case"blockquote":case"toggleblockquote":return document.execCommand("formatBlock",!1,"<blockquote>");case"bulletlist":case"togglebulletlist":case"insertunorderedlist":return document.execCommand("insertUnorderedList");case"numberedlist":case"toggleorderedlist":case"insertorderedlist":return document.execCommand("insertOrderedList");case"horizontalrule":case"divider":case"inserthorizontalrule":return document.execCommand("insertHorizontalRule");case"bold":case"togglebold":return document.execCommand("bold");case"italic":case"toggleitalic":return document.execCommand("italic");case"underline":case"toggleunderline":return document.execCommand("underline");case"strikethrough":case"togglestrikethrough":return document.execCommand("strikeThrough");case"clearformatting":case"removeformat":return document.execCommand("removeFormat");default:try{return document.execCommand(e,!1,t)}catch{return!1}}}function S(e,t,o){const n=I(e);if(n&&typeof n.execCommand=="function")try{if(n.execCommand(t,o)!==!1)return!0}catch{}const r=window.execEditorCommand||window.executeEditorCommand;if(typeof r=="function")try{if(r(t,o,{editorElement:n,contentElement:e})!==!1)return!0}catch{}return J(t,o)}async function Y(e,t){const o=e.editor,n=I(o),r={editor:o,editorRoot:n,query:e.query,trigger:e.trigger,executeCommand:(i,a)=>S(o,i,a),insertHTML:i=>L(o,i)};return t.action?await Promise.resolve(t.action(r))!==!1:t.insertHTML?L(o,t.insertHTML):t.command?S(o,t.command,t.commandValue):!1}async function M(e,t){if(t<0||t>=e.filteredItems.length||!e.replaceRange)return;const o=e.filteredItems[t],n=e.editor,r=n.innerHTML,i=`${e.trigger}${e.query}`;if(!window.getSelection())return;const l=e.replaceRange.cloneRange();if(!n.contains(l.commonAncestorContainer))return;l.deleteContents();const d=l.cloneRange();d.collapse(!0),y(n,d);let x=!1;try{x=await Y(e,o)}catch{x=!1}c(e),x?(V(n),G(n,r)):i&&X(n,i),n.focus({preventScroll:!0})}function R(e,t){if(e.filteredItems.length===0)return;const o=e.filteredItems.length;if(e.activeIndex=((e.activeIndex+t)%o+o)%o,!e.list)return;const n=Array.from(e.list.querySelectorAll(".rte-slash-item"));n.forEach((i,a)=>{const l=a===e.activeIndex;i.classList.toggle("active",l),i.setAttribute("aria-selected",l?"true":"false")});const r=n[e.activeIndex];r&&(e.list.setAttribute("aria-activedescendant",r.id),r.scrollIntoView({block:"nearest"}))}function T(e){if(!(!e.isOpen||!e.panel||!e.anchorRange)){if(!e.editor.isConnected){c(e);return}A(e,e.anchorRange)}}function N(e,t,o,n,r,i){U(e,t),e.query=n,e.trigger=r,e.replaceRange=i.cloneRange(),e.anchorRange=o.cloneRange(),e.filteredItems=W(e.items,n,t.maxSuggestions),e.activeIndex=0,e.isOpen=!0,e.panel&&(Z(e,t),A(e,o))}function ee(e,t){const o=e.editor;if(o.getAttribute("contenteditable")==="false"){c(e);return}const n=v(o);if(!n||!n.collapsed){c(e);return}const r=j(n);if(!r){c(e);return}const i=K(r.textBefore,t.triggerChar,t.maxQueryLength,t.requireBoundary);if(!i){c(e);return}if(i.query.length<t.minChars){c(e);return}const a=n.cloneRange();a.setStart(r.node,i.startOffset),a.setEnd(r.node,r.caretOffset),N(e,t,n,i.query,i.trigger,a)}function O(e,t){const o=e.editor;if(o.getAttribute("contenteditable")==="false")return!1;let n=v(o);n||(n=document.createRange(),n.selectNodeContents(o),n.collapse(!1),y(o,n));const r=n.cloneRange();return r.collapse(!0),N(e,t,n,"",t.triggerChar,r),!0}function te(e){return!(e.metaKey||e.ctrlKey)||e.altKey?!1:e.key==="/"||e.code==="Slash"}function ne(e,t){return{editor:e,panel:null,list:null,replaceRange:null,items:t.items,filteredItems:[],activeIndex:0,query:"",trigger:t.triggerChar,isOpen:!1,instanceId:++z,anchorRange:null}}function w(e,t){const o=g.get(e);if(o)return o.items=t.items,o;const n=ne(e,t);return g.set(e,n),n}function re(e){var o;const t=g.get(e);t&&((o=t.panel)!=null&&o.parentNode&&t.panel.parentNode.removeChild(t.panel),g.delete(e))}function C(e,t,o){if(p.has(e))return;const n={input:()=>{ee(t,o)},keydown:r=>{if(t.editor.getAttribute("contenteditable")==="false"){c(t);return}if(!t.isOpen&&te(r)){r.preventDefault(),O(t,o);return}if(t.isOpen){if(r.key==="ArrowDown"){r.preventDefault(),R(t,1);return}if(r.key==="ArrowUp"){r.preventDefault(),R(t,-1);return}if(r.key==="Enter"||r.key==="Tab"){if(t.filteredItems.length===0){r.key==="Tab"&&r.preventDefault(),c(t);return}r.preventDefault(),M(t,t.activeIndex);return}if(r.key==="Escape"){r.preventDefault(),c(t);return}}},blur:()=>{window.setTimeout(()=>{const r=document.activeElement;t.panel&&r&&t.panel.contains(r)||c(t)},0)},mousedown:r=>{if(!t.isOpen||!t.panel)return;const i=r.target;i&&!t.panel.contains(i)&&!e.contains(i)&&c(t)},selectionchange:()=>{if(!t.isOpen)return;const r=v(e);if(!r||!r.collapsed){c(t);return}t.anchorRange=r.cloneRange(),T(t)},reposition:()=>{T(t)}};e.addEventListener("input",n.input),e.addEventListener("keydown",n.keydown),e.addEventListener("blur",n.blur),document.addEventListener("mousedown",n.mousedown,!0),document.addEventListener("selectionchange",n.selectionchange),window.addEventListener("resize",n.reposition,{passive:!0}),window.addEventListener("scroll",n.reposition,!0),p.set(e,n)}function oe(e){const t=p.get(e);t&&(e.removeEventListener("input",t.input),e.removeEventListener("keydown",t.keydown),e.removeEventListener("blur",t.blur),document.removeEventListener("mousedown",t.mousedown,!0),document.removeEventListener("selectionchange",t.selectionchange),window.removeEventListener("resize",t.reposition),window.removeEventListener("scroll",t.reposition,!0),p.delete(e))}function ie(e){b||(b=!0,f=t=>{const o=t.target;if(!(o instanceof Node))return;const n=P(o),r=(n==null?void 0:n.closest(s))||null;if(!r)return;const i=w(r,e);C(r,i,e)},document.addEventListener("focusin",f,!0))}function ae(){!b||!f||(document.removeEventListener("focusin",f,!0),b=!1,f=null)}const le=(e={})=>{B();const t=D(e);return{name:"slashCommands",toolbar:[{id:"slashCommands",label:"Slash Commands",command:"openSlashCommands",icon:'<svg width="24" height="24" focusable="false" aria-hidden="true"><path d="M8.7 20a1 1 0 0 1-.7-.3c-.4-.4-.4-1 0-1.4L15.6 5a1 1 0 0 1 1.4 1.4L9.4 19.7a1 1 0 0 1-.7.3Zm7.8 0c-.3 0-.5 0-.7-.3l-1.8-1.8a1 1 0 1 1 1.4-1.4l1.8 1.8a1 1 0 0 1-.7 1.7Zm-9-12a1 1 0 0 1-.7-1.7L8.6 4.5A1 1 0 1 1 10 6L8.2 7.8a1 1 0 0 1-.7.3Z"></path></svg>'}],commands:{openSlashCommands:(o,n)=>{const r=_(n);if(!r)return!1;const i=w(r,t);return C(r,i,t),O(i,t)}},keymap:{"Mod-/":"openSlashCommands","Mod-Shift-7":"openSlashCommands"},init:()=>{h+=1,ie(t),Array.from(document.querySelectorAll(s)).forEach(n=>{const r=w(n,t);C(n,r,t)})},destroy:()=>{h=Math.max(0,h-1),Array.from(document.querySelectorAll(s)).forEach(n=>{const r=g.get(n);r&&(c(r),oe(n),re(n))}),h===0&&ae()}}};exports.SlashCommandsPlugin=le;
|