@file-viewer/vue3 3.2.2 → 3.3.1
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.en.md +31 -9
- package/README.md +265 -246
- package/README.zh-CN.md +465 -0
- package/dist/components/export.js +2 -3
- package/dist/components/export2.js +458 -426
- package/dist/components/fit.js +4 -14
- package/dist/components/image.js +130 -66
- package/dist/components/messages.js +1 -2
- package/dist/components/objectSpread2.js +6 -12
- package/dist/components/print-mask.js +1 -2
- package/dist/components/printMask.js +1 -2
- package/dist/index.mjs +1414 -1401
- package/dist/src/package/components/FileViewer/hooks/useViewerSourceLoading.d.ts +2 -1
- package/dist/src/package/components/FileViewer/hooks/useViewerToolbar.d.ts +1 -0
- package/dist/vue3.css +1 -1
- package/package.json +6 -5
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { r as e, t } from "./objectSpread2.js";
|
|
2
2
|
import { a as n, c as r, i, l as a, n as o, o as s, r as c, s as l, t as u } from "./export.js";
|
|
3
|
-
import { i as d, n as f, r as p, t as
|
|
4
|
-
|
|
5
|
-
function
|
|
3
|
+
import { i as d, n as f, r as p, t as ee } from "./printMask.js";
|
|
4
|
+
// ../../../node_modules/.pnpm/dompurify@3.4.17/node_modules/dompurify/dist/purify.es.mjs
|
|
5
|
+
function m(e, t) {
|
|
6
6
|
this.v = e, this.k = t;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function h(e, t) {
|
|
9
9
|
(t == null || t > e.length) && (t = e.length);
|
|
10
10
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
11
11
|
return r;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function g(e) {
|
|
14
14
|
if (Array.isArray(e)) return e;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function te(e, t) {
|
|
17
17
|
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
18
18
|
if (n != null) {
|
|
19
19
|
var r, i, a, o, s = [], c = !0, l = !1;
|
|
@@ -34,24 +34,24 @@ function ee(e, t) {
|
|
|
34
34
|
return s;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function ne() {
|
|
38
38
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
40
|
+
function _(e, t) {
|
|
41
|
+
return g(e) || te(e, t) || v(e, t) || ne();
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function v(e, t) {
|
|
44
44
|
if (e) {
|
|
45
|
-
if (typeof e == "string") return
|
|
45
|
+
if (typeof e == "string") return h(e, t);
|
|
46
46
|
var n = {}.toString.call(e).slice(8, -1);
|
|
47
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
47
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? h(e, t) : void 0;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function y(e) {
|
|
51
51
|
var t, n;
|
|
52
52
|
function r(t, n) {
|
|
53
53
|
try {
|
|
54
|
-
var a = e[t](n), o = a.value, s = o instanceof
|
|
54
|
+
var a = e[t](n), o = a.value, s = o instanceof m;
|
|
55
55
|
Promise.resolve(s ? o.v : o).then(function(n) {
|
|
56
56
|
if (s) {
|
|
57
57
|
var c = t === "return" && o.k ? t : "next";
|
|
@@ -85,113 +85,119 @@ function b(e) {
|
|
|
85
85
|
});
|
|
86
86
|
}, typeof e.return != "function" && (this.return = void 0);
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
y.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
89
89
|
return this;
|
|
90
|
-
},
|
|
90
|
+
}, y.prototype.next = function(e) {
|
|
91
91
|
return this._invoke("next", e);
|
|
92
|
-
},
|
|
92
|
+
}, y.prototype.throw = function(e) {
|
|
93
93
|
return this._invoke("throw", e);
|
|
94
|
-
},
|
|
94
|
+
}, y.prototype.return = function(e) {
|
|
95
95
|
return this._invoke("return", e);
|
|
96
96
|
};
|
|
97
|
-
var
|
|
98
|
-
|
|
97
|
+
var re = Object.entries, b = Object.setPrototypeOf, ie = Object.isFrozen, ae = Object.getPrototypeOf, oe = Object.getOwnPropertyDescriptor, x = Object.freeze, S = Object.seal, se = Object.create, C = typeof Reflect < "u" && Reflect, w = C.apply, ce = C.construct;
|
|
98
|
+
x || (x = function(e) {
|
|
99
99
|
return e;
|
|
100
|
-
}),
|
|
100
|
+
}), S || (S = function(e) {
|
|
101
101
|
return e;
|
|
102
|
-
}),
|
|
102
|
+
}), w || (w = function(e, t) {
|
|
103
103
|
var n = [...arguments].slice(2);
|
|
104
104
|
return e.apply(t, n);
|
|
105
|
-
}),
|
|
105
|
+
}), ce || (ce = function(e) {
|
|
106
106
|
return new e(...[...arguments].slice(1));
|
|
107
107
|
});
|
|
108
|
-
var
|
|
108
|
+
var T = j(Array.prototype.forEach);
|
|
109
109
|
Array.prototype.indexOf;
|
|
110
|
-
var
|
|
111
|
-
|
|
112
|
-
var le = P(Array.prototype.splice), ue = Array.isArray, de = P(String.prototype.toLowerCase), fe = P(String.prototype.toString), pe = P(String.prototype.match), me = P(String.prototype.replace), he = P(String.prototype.indexOf), ge = P(String.prototype.trim), _e = P(Number.prototype.toString), k = P(Boolean.prototype.toString), ve = typeof BigInt > "u" ? null : P(BigInt.prototype.toString), ye = typeof Symbol > "u" ? null : P(Symbol.prototype.toString), A = P(Object.prototype.hasOwnProperty), j = P(Object.prototype.toString), M = P(RegExp.prototype.test), N = be(TypeError);
|
|
113
|
-
function P(e) {
|
|
110
|
+
var le = j(Array.prototype.lastIndexOf), ue = j(Array.prototype.pop), de = j(Array.prototype.push), fe = j(Array.prototype.slice), pe = j(Array.prototype.splice), me = Array.isArray, he = De(Set), ge = j(Set.prototype.add), _e = j(Set.prototype.has), E = j(String.prototype.toLowerCase), ve = j(String.prototype.toString), ye = j(String.prototype.match), be = j(String.prototype.replace), xe = j(String.prototype.indexOf), Se = j(String.prototype.trim), Ce = j(Number.prototype.toString), we = j(Boolean.prototype.toString), Te = typeof BigInt > "u" ? null : j(BigInt.prototype.toString), D = typeof Symbol > "u" ? null : j(Symbol.prototype.toString), O = j(Object.prototype.hasOwnProperty), Ee = j(Object.prototype.toString), k = j(RegExp.prototype.test), A = De(TypeError);
|
|
111
|
+
function j(e) {
|
|
114
112
|
return function(t) {
|
|
115
113
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
116
114
|
var n = [...arguments].slice(1);
|
|
117
|
-
return
|
|
115
|
+
return w(e, t, n);
|
|
118
116
|
};
|
|
119
117
|
}
|
|
120
|
-
function
|
|
118
|
+
function De(e) {
|
|
121
119
|
return function() {
|
|
122
|
-
return
|
|
120
|
+
return ce(e, [...arguments]);
|
|
123
121
|
};
|
|
124
122
|
}
|
|
125
|
-
function
|
|
126
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
127
|
-
if (
|
|
123
|
+
function M(e, t) {
|
|
124
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : E;
|
|
125
|
+
if (b && b(e, null), !me(t)) return e;
|
|
128
126
|
let r = t.length;
|
|
129
127
|
for (; r--;) {
|
|
130
128
|
let i = t[r];
|
|
131
129
|
if (typeof i == "string") {
|
|
132
130
|
let e = n(i);
|
|
133
|
-
e !== i && (
|
|
131
|
+
e !== i && (ie(t) || (t[r] = e), i = e);
|
|
134
132
|
}
|
|
135
133
|
e[i] = !0;
|
|
136
134
|
}
|
|
137
135
|
return e;
|
|
138
136
|
}
|
|
139
|
-
function
|
|
140
|
-
for (let t = 0; t < e.length; t++)
|
|
137
|
+
function Oe(e) {
|
|
138
|
+
for (let t = 0; t < e.length; t++) O(e, t) || (e[t] = null);
|
|
141
139
|
return e;
|
|
142
140
|
}
|
|
143
|
-
function
|
|
144
|
-
let t =
|
|
145
|
-
for (let r of
|
|
146
|
-
var n =
|
|
141
|
+
function N(e) {
|
|
142
|
+
let t = se(null);
|
|
143
|
+
for (let r of re(e)) {
|
|
144
|
+
var n = _(r, 2);
|
|
147
145
|
let i = n[0], a = n[1];
|
|
148
|
-
|
|
146
|
+
O(e, i) && (t[i] = me(a) ? Oe(a) : a && typeof a == "object" && a.constructor === Object ? N(a) : a);
|
|
149
147
|
}
|
|
150
148
|
return t;
|
|
151
149
|
}
|
|
152
|
-
function
|
|
150
|
+
function ke(e) {
|
|
153
151
|
switch (typeof e) {
|
|
154
152
|
case "string": return e;
|
|
155
|
-
case "number": return
|
|
156
|
-
case "boolean": return
|
|
157
|
-
case "bigint": return
|
|
158
|
-
case "symbol": return
|
|
159
|
-
case "undefined": return
|
|
153
|
+
case "number": return Ce(e);
|
|
154
|
+
case "boolean": return we(e);
|
|
155
|
+
case "bigint": return Te ? Te(e) : "0";
|
|
156
|
+
case "symbol": return D ? D(e) : "Symbol()";
|
|
157
|
+
case "undefined": return Ee(e);
|
|
160
158
|
case "function":
|
|
161
159
|
case "object": {
|
|
162
|
-
if (e === null) return
|
|
163
|
-
let t = e, n =
|
|
160
|
+
if (e === null) return Ee(e);
|
|
161
|
+
let t = e, n = P(t, "toString");
|
|
164
162
|
if (typeof n == "function") {
|
|
165
163
|
let e = n(t);
|
|
166
|
-
return typeof e == "string" ? e :
|
|
164
|
+
return typeof e == "string" ? e : Ee(e);
|
|
167
165
|
}
|
|
168
|
-
return
|
|
166
|
+
return Ee(e);
|
|
169
167
|
}
|
|
170
|
-
default: return
|
|
168
|
+
default: return Ee(e);
|
|
171
169
|
}
|
|
172
170
|
}
|
|
173
|
-
function
|
|
171
|
+
function P(e, t) {
|
|
174
172
|
for (; e !== null;) {
|
|
175
|
-
let n =
|
|
173
|
+
let n = oe(e, t);
|
|
176
174
|
if (n) {
|
|
177
|
-
if (n.get) return
|
|
178
|
-
if (typeof n.value == "function") return
|
|
175
|
+
if (n.get) return j(n.get);
|
|
176
|
+
if (typeof n.value == "function") return j(n.value);
|
|
179
177
|
}
|
|
180
|
-
e =
|
|
178
|
+
e = ae(e);
|
|
181
179
|
}
|
|
182
180
|
function n() {
|
|
183
181
|
return null;
|
|
184
182
|
}
|
|
185
183
|
return n;
|
|
186
184
|
}
|
|
187
|
-
function
|
|
185
|
+
function Ae(e, t) {
|
|
186
|
+
for (; e !== null;) {
|
|
187
|
+
let n = oe(e, t);
|
|
188
|
+
if (n) return n.get ? j(n.get) : null;
|
|
189
|
+
e = ae(e);
|
|
190
|
+
}
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
function je(e) {
|
|
188
194
|
try {
|
|
189
|
-
return
|
|
195
|
+
return k(e, ""), !0;
|
|
190
196
|
} catch (e) {
|
|
191
197
|
return !1;
|
|
192
198
|
}
|
|
193
199
|
}
|
|
194
|
-
var
|
|
200
|
+
var Me = x(/* @__PURE__ */ "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.search.section.select.shadow.slot.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".split(".")), Ne = x(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), Pe = x([
|
|
195
201
|
"feBlend",
|
|
196
202
|
"feColorMatrix",
|
|
197
203
|
"feComponentTransfer",
|
|
@@ -217,7 +223,7 @@ var we = w(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
217
223
|
"feSpotLight",
|
|
218
224
|
"feTile",
|
|
219
225
|
"feTurbulence"
|
|
220
|
-
]),
|
|
226
|
+
]), Fe = x([
|
|
221
227
|
"animate",
|
|
222
228
|
"color-profile",
|
|
223
229
|
"cursor",
|
|
@@ -240,7 +246,7 @@ var we = w(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
240
246
|
"solidcolor",
|
|
241
247
|
"unknown",
|
|
242
248
|
"use"
|
|
243
|
-
]),
|
|
249
|
+
]), Ie = x(/* @__PURE__ */ "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.mprescripts".split(".")), Le = x([
|
|
244
250
|
"maction",
|
|
245
251
|
"maligngroup",
|
|
246
252
|
"malignmark",
|
|
@@ -256,13 +262,13 @@ var we = w(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
256
262
|
"annotation-xml",
|
|
257
263
|
"mprescripts",
|
|
258
264
|
"none"
|
|
259
|
-
]),
|
|
265
|
+
]), Re = x(["#text"]), ze = x(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.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.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Be = x(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.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.dominant-baseline.dur.edgemode.elevation.end.exponent.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.intercept.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.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.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.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.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".split(".")), Ve = x(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.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".split(".")), He = x([
|
|
260
266
|
"xlink:href",
|
|
261
267
|
"xml:id",
|
|
262
268
|
"xlink:title",
|
|
263
269
|
"xml:space",
|
|
264
270
|
"xmlns:xlink"
|
|
265
|
-
]),
|
|
271
|
+
]), Ue = S(/{{[\w\W]*|^[\w\W]*}}/g), We = S(/<%[\w\W]*|^[\w\W]*%>/g), Ge = S(/\${[\w\W]*/g), Ke = S(/^data-[\-\w.\u00B7-\uFFFF]+$/), qe = S(/^aria-[\-\w]+$/), Je = S(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Ye = S(/^(?:\w+script|data):/i), Xe = S(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Ze = S(/^html$/i), Qe = S(/^[a-z][.\w]*(-[.\w]+)+$/i), $e = S(/<[/\w!]/g), et = S(/<[/\w]/g), tt = S(/<\/no(script|embed|frames)/i), nt = S(/\/>/i), F = {
|
|
266
272
|
element: 1,
|
|
267
273
|
attribute: 2,
|
|
268
274
|
text: 3,
|
|
@@ -275,7 +281,7 @@ var we = w(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
275
281
|
documentType: 10,
|
|
276
282
|
documentFragment: 11,
|
|
277
283
|
notation: 12
|
|
278
|
-
},
|
|
284
|
+
}, rt = x(M({}, [
|
|
279
285
|
"style",
|
|
280
286
|
"script",
|
|
281
287
|
"xmp",
|
|
@@ -284,14 +290,9 @@ var we = w(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
284
290
|
"noframes",
|
|
285
291
|
"plaintext",
|
|
286
292
|
"noscript"
|
|
287
|
-
]
|
|
288
|
-
let e = {};
|
|
289
|
-
return O(Ye, (t) => {
|
|
290
|
-
e[t] = T(RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
291
|
-
}), w(e);
|
|
292
|
-
}(), Qe = function() {
|
|
293
|
+
])), it = function() {
|
|
293
294
|
return typeof window > "u" ? null : window;
|
|
294
|
-
},
|
|
295
|
+
}, at = function(e, t) {
|
|
295
296
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
296
297
|
let n = null, r = "data-tt-policy-suffix";
|
|
297
298
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -308,7 +309,7 @@ var we = w(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
308
309
|
} catch (e) {
|
|
309
310
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
310
311
|
}
|
|
311
|
-
},
|
|
312
|
+
}, ot = function() {
|
|
312
313
|
return {
|
|
313
314
|
afterSanitizeAttributes: [],
|
|
314
315
|
afterSanitizeElements: [],
|
|
@@ -320,60 +321,62 @@ var we = w(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
320
321
|
uponSanitizeElement: [],
|
|
321
322
|
uponSanitizeShadowNode: []
|
|
322
323
|
};
|
|
323
|
-
},
|
|
324
|
-
return
|
|
325
|
-
},
|
|
326
|
-
let r =
|
|
327
|
-
return r && typeof r == "object" ?
|
|
324
|
+
}, I = function(e, t, n, r) {
|
|
325
|
+
return O(e, t) && me(e[t]) ? M(r.base ? N(r.base) : {}, e[t], r.transform) : n;
|
|
326
|
+
}, st = function(e, t, n) {
|
|
327
|
+
let r = O(e, t) ? e[t] : void 0;
|
|
328
|
+
return r && typeof r == "object" ? N(r) : n();
|
|
328
329
|
};
|
|
329
|
-
function
|
|
330
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
331
|
-
if (t.version = "3.4.
|
|
330
|
+
function ct() {
|
|
331
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : it(), t = (e) => ct(e);
|
|
332
|
+
if (t.version = "3.4.17", t.removed = [], !e || !e.document || e.document.nodeType !== F.document || !e.Element) return t.isSupported = !1, t;
|
|
332
333
|
let n = e.document, r = n, i = r.currentScript;
|
|
333
334
|
e.DocumentFragment;
|
|
334
335
|
let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
|
|
335
336
|
e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
|
|
336
|
-
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f =
|
|
337
|
-
return
|
|
338
|
-
},
|
|
339
|
-
return
|
|
337
|
+
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = P(d, "cloneNode"), p = P(d, "remove"), ee = P(d, "removeAttributeNode"), m = P(d, "nextSibling"), h = P(d, "childNodes"), g = P(d, "parentNode"), te = P(d, "shadowRoot"), ne = P(d, "attributes"), _ = o && o.prototype ? P(o.prototype, "nodeType") : null, v = o && o.prototype ? P(o.prototype, "nodeName") : null, y = o && o.prototype ? P(o.prototype, "ownerDocument") : null, b = function(e) {
|
|
338
|
+
return _ ? _(e) : e.nodeType;
|
|
339
|
+
}, ie = function(e) {
|
|
340
|
+
return v ? v(e) : e.nodeName;
|
|
341
|
+
}, ae = Ae(d, "namespaceURI"), oe = function(e) {
|
|
342
|
+
return ae ? ae(e) : e.namespaceURI;
|
|
340
343
|
};
|
|
341
344
|
if (typeof a == "function") {
|
|
342
345
|
let e = n.createElement("template");
|
|
343
346
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
344
347
|
}
|
|
345
|
-
let
|
|
346
|
-
if (
|
|
347
|
-
},
|
|
348
|
-
|
|
348
|
+
let C, w = "", ce, Ce = !1, we = 0, Te = function() {
|
|
349
|
+
if (we > 0) throw A("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.");
|
|
350
|
+
}, D = function(e) {
|
|
351
|
+
Te(), we++;
|
|
349
352
|
try {
|
|
350
|
-
return
|
|
353
|
+
return C.createHTML(e);
|
|
351
354
|
} finally {
|
|
352
|
-
|
|
355
|
+
we--;
|
|
353
356
|
}
|
|
354
|
-
},
|
|
355
|
-
|
|
357
|
+
}, Ee = function(e) {
|
|
358
|
+
Te(), we++;
|
|
356
359
|
try {
|
|
357
|
-
return
|
|
360
|
+
return C.createScriptURL(e);
|
|
358
361
|
} finally {
|
|
359
|
-
|
|
362
|
+
we--;
|
|
360
363
|
}
|
|
361
|
-
},
|
|
362
|
-
return
|
|
363
|
-
},
|
|
364
|
-
t.isSupported = typeof
|
|
365
|
-
let
|
|
366
|
-
...we,
|
|
367
|
-
...Te,
|
|
368
|
-
...Ee,
|
|
369
|
-
...Oe,
|
|
370
|
-
...Ae
|
|
371
|
-
]), H = null, mt = F({}, [
|
|
372
|
-
...je,
|
|
364
|
+
}, j = function() {
|
|
365
|
+
return Ce || (ce = at(u, i), Ce = !0), ce;
|
|
366
|
+
}, De = n, Oe = De.implementation, lt = De.createNodeIterator, ut = De.createDocumentFragment, dt = De.getElementsByTagName, ft = r.importNode, L = ot();
|
|
367
|
+
t.isSupported = typeof re == "function" && typeof g == "function" && Oe && Oe.createHTMLDocument !== void 0;
|
|
368
|
+
let pt = Ue, mt = We, ht = Ge, gt = Ke, _t = qe, vt = Ye, yt = Xe, bt = Qe, R = Je, z = null, xt = M({}, [
|
|
373
369
|
...Me,
|
|
374
370
|
...Ne,
|
|
375
|
-
...Pe
|
|
376
|
-
|
|
371
|
+
...Pe,
|
|
372
|
+
...Ie,
|
|
373
|
+
...Re
|
|
374
|
+
]), B = null, St = M({}, [
|
|
375
|
+
...ze,
|
|
376
|
+
...Be,
|
|
377
|
+
...Ve,
|
|
378
|
+
...He
|
|
379
|
+
]), V = Object.seal(se(null, {
|
|
377
380
|
tagNameCheck: {
|
|
378
381
|
writable: !0,
|
|
379
382
|
configurable: !1,
|
|
@@ -392,7 +395,7 @@ function nt() {
|
|
|
392
395
|
enumerable: !0,
|
|
393
396
|
value: !1
|
|
394
397
|
}
|
|
395
|
-
})),
|
|
398
|
+
})), H = null, Ct = null, U = Object.seal(se(null, {
|
|
396
399
|
tagCheck: {
|
|
397
400
|
writable: !0,
|
|
398
401
|
configurable: !1,
|
|
@@ -405,14 +408,14 @@ function nt() {
|
|
|
405
408
|
enumerable: !0,
|
|
406
409
|
value: null
|
|
407
410
|
}
|
|
408
|
-
})),
|
|
411
|
+
})), wt = !0, Tt = !0, Et = !1, Dt = !0, W = !1, G = !0, K = !1, Ot = !1, kt = null, At = null, jt = !1, Mt = !1, Nt = !1, Pt = !1, Ft = !0, It = !1, Lt = "user-content-", Rt = !0, zt = !1, q = null, Bt = {}, J = null, Vt = M({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), Ht = null, Ut = M({}, [
|
|
409
412
|
"audio",
|
|
410
413
|
"video",
|
|
411
414
|
"img",
|
|
412
415
|
"source",
|
|
413
416
|
"image",
|
|
414
417
|
"track"
|
|
415
|
-
]),
|
|
418
|
+
]), Wt = null, Gt = M({}, [
|
|
416
419
|
"alt",
|
|
417
420
|
"class",
|
|
418
421
|
"for",
|
|
@@ -427,265 +430,298 @@ function nt() {
|
|
|
427
430
|
"value",
|
|
428
431
|
"style",
|
|
429
432
|
"xmlns"
|
|
430
|
-
]),
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
],
|
|
433
|
+
]), Kt = "http://www.w3.org/1998/Math/MathML", qt = "http://www.w3.org/2000/svg", Y = "http://www.w3.org/1999/xhtml", Jt = Y, Yt = !1, Xt = null, Zt = M({}, [
|
|
434
|
+
Kt,
|
|
435
|
+
qt,
|
|
436
|
+
Y
|
|
437
|
+
], ve), Qt = x([
|
|
435
438
|
"mi",
|
|
436
439
|
"mo",
|
|
437
440
|
"mn",
|
|
438
441
|
"ms",
|
|
439
442
|
"mtext"
|
|
440
|
-
]),
|
|
443
|
+
]), $t = M({}, Qt), en = x(["annotation-xml"]), tn = M({}, en), nn = M({}, [
|
|
441
444
|
"title",
|
|
442
445
|
"style",
|
|
443
446
|
"font",
|
|
444
447
|
"a",
|
|
445
448
|
"script"
|
|
446
|
-
]),
|
|
449
|
+
]), rn = null, an = ["application/xhtml+xml", "text/html"], X = null, on = null, sn = n.createElement("form"), cn = function(e) {
|
|
447
450
|
return e instanceof RegExp || e instanceof Function;
|
|
448
|
-
},
|
|
451
|
+
}, ln = function() {
|
|
449
452
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
450
|
-
if (
|
|
451
|
-
|
|
452
|
-
transform:
|
|
453
|
-
base:
|
|
454
|
-
}),
|
|
455
|
-
transform:
|
|
456
|
-
base:
|
|
457
|
-
}),
|
|
458
|
-
let t =
|
|
459
|
-
if (
|
|
453
|
+
if (on && on === e) return;
|
|
454
|
+
e && typeof e == "object" || (e = {}), e = N(e), rn = an.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, X = rn === "application/xhtml+xml" ? ve : E, z = I(e, "ALLOWED_TAGS", xt, { transform: X }), B = I(e, "ALLOWED_ATTR", St, { transform: X }), Xt = I(e, "ALLOWED_NAMESPACES", Zt, { transform: ve }), Wt = I(e, "ADD_URI_SAFE_ATTR", Gt, {
|
|
455
|
+
transform: X,
|
|
456
|
+
base: Gt
|
|
457
|
+
}), Ht = I(e, "ADD_DATA_URI_TAGS", Ut, {
|
|
458
|
+
transform: X,
|
|
459
|
+
base: Ut
|
|
460
|
+
}), J = I(e, "FORBID_CONTENTS", Vt, { transform: X }), H = I(e, "FORBID_TAGS", N({}), { transform: X }), Ct = I(e, "FORBID_ATTR", N({}), { transform: X }), Bt = O(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? N(e.USE_PROFILES) : e.USE_PROFILES : !1, wt = e.ALLOW_ARIA_ATTR !== !1, Tt = e.ALLOW_DATA_ATTR !== !1, Et = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Dt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, W = e.SAFE_FOR_TEMPLATES || !1, G = e.SAFE_FOR_XML !== !1, K = e.WHOLE_DOCUMENT || !1, Mt = e.RETURN_DOM || !1, Nt = e.RETURN_DOM_FRAGMENT || !1, Pt = e.RETURN_TRUSTED_TYPE || !1, jt = e.FORCE_BODY || !1, Ft = e.SANITIZE_DOM !== !1, It = e.SANITIZE_NAMED_PROPS || !1, Rt = e.KEEP_CONTENT !== !1, zt = e.IN_PLACE || !1, R = je(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Je, Jt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : Y, $t = st(e, "MATHML_TEXT_INTEGRATION_POINTS", () => M({}, Qt)), tn = st(e, "HTML_INTEGRATION_POINTS", () => M({}, en));
|
|
461
|
+
let t = st(e, "CUSTOM_ELEMENT_HANDLING", () => se(null));
|
|
462
|
+
if (V = se(null), O(t, "tagNameCheck") && cn(t.tagNameCheck) && (V.tagNameCheck = t.tagNameCheck), O(t, "attributeNameCheck") && cn(t.attributeNameCheck) && (V.attributeNameCheck = t.attributeNameCheck), O(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (V.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), S(V), W && (Tt = !1), Nt && (Mt = !0), Bt && (z = M({}, Re), B = se(null), Bt.html === !0 && (M(z, Me), M(B, ze)), Bt.svg === !0 && (M(z, Ne), M(B, Be), M(B, He)), Bt.svgFilters === !0 && (M(z, Pe), M(B, Be), M(B, He)), Bt.mathMl === !0 && (M(z, Ie), M(B, Ve), M(B, He))), U.tagCheck = null, U.attributeCheck = null, O(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? U.tagCheck = e.ADD_TAGS : me(e.ADD_TAGS) && (z === xt && (z = N(z)), M(z, e.ADD_TAGS, X))), O(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? U.attributeCheck = e.ADD_ATTR : me(e.ADD_ATTR) && (B === St && (B = N(B)), M(B, e.ADD_ATTR, X))), O(e, "ADD_FORBID_CONTENTS") && me(e.ADD_FORBID_CONTENTS) && (J === Vt && (J = N(J)), M(J, e.ADD_FORBID_CONTENTS, X)), Rt && (z["#text"] = !0), K && M(z, [
|
|
460
463
|
"html",
|
|
461
464
|
"head",
|
|
462
465
|
"body"
|
|
463
|
-
]),
|
|
464
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
465
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
466
|
-
let t =
|
|
467
|
-
|
|
466
|
+
]), z.table && (M(z, ["tbody"]), delete H.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
467
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw A("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
468
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw A("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
469
|
+
let t = C;
|
|
470
|
+
C = e.TRUSTED_TYPES_POLICY;
|
|
468
471
|
try {
|
|
469
|
-
|
|
472
|
+
w = D("");
|
|
470
473
|
} catch (e) {
|
|
471
|
-
throw
|
|
474
|
+
throw C = t, e;
|
|
472
475
|
}
|
|
473
|
-
} else e.TRUSTED_TYPES_POLICY === null ? (
|
|
474
|
-
|
|
475
|
-
},
|
|
476
|
-
...
|
|
477
|
-
...
|
|
478
|
-
...
|
|
479
|
-
]),
|
|
480
|
-
return t.namespaceURI ===
|
|
481
|
-
},
|
|
482
|
-
return t.namespaceURI ===
|
|
483
|
-
},
|
|
484
|
-
return t.namespaceURI ===
|
|
485
|
-
},
|
|
486
|
-
let t =
|
|
487
|
-
(
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
});
|
|
491
|
-
let n = de(e.tagName), r = de(t.tagName);
|
|
492
|
-
return Ht[e.namespaceURI] ? e.namespaceURI === zt ? rn(n, t, r) : e.namespaceURI === Rt ? an(n, t, r) : e.namespaceURI === X ? on(n, t, r) : !!(Yt === "application/xhtml+xml" && Ht[e.namespaceURI]) : !1;
|
|
493
|
-
}, Q = function(e) {
|
|
494
|
-
ce(t.removed, { element: e });
|
|
476
|
+
} else e.TRUSTED_TYPES_POLICY === null ? (C = void 0, w = "") : (C === void 0 && (C = j()), C && typeof w == "string" && (w = D("")));
|
|
477
|
+
x && x(e), on = e;
|
|
478
|
+
}, un = M({}, [
|
|
479
|
+
...Ne,
|
|
480
|
+
...Pe,
|
|
481
|
+
...Fe
|
|
482
|
+
]), dn = M({}, [...Ie, ...Le]), fn = function(e, t, n) {
|
|
483
|
+
return t.namespaceURI === Y ? e === "svg" : t.namespaceURI === Kt ? e === "svg" && (n === "annotation-xml" || $t[n]) : !!un[e];
|
|
484
|
+
}, pn = function(e, t, n) {
|
|
485
|
+
return t.namespaceURI === Y ? e === "math" : t.namespaceURI === qt ? e === "math" && tn[n] : !!dn[e];
|
|
486
|
+
}, mn = function(e, t, n) {
|
|
487
|
+
return t.namespaceURI === qt && !tn[n] || t.namespaceURI === Kt && !$t[n] ? !1 : !dn[e] && (nn[e] || !un[e]);
|
|
488
|
+
}, hn = function(e) {
|
|
489
|
+
let t = oe(e), n = E(ie(e)), r = g(e), i, a;
|
|
490
|
+
return r && b(r) === F.element ? (i = { namespaceURI: oe(r) }, a = E(ie(r))) : (i = { namespaceURI: Jt }, a = "template"), Xt[t] ? t === qt ? fn(n, i, a) : t === Kt ? pn(n, i, a) : t === Y ? mn(n, i, a) : !!(rn === "application/xhtml+xml" && Xt[t]) : !1;
|
|
491
|
+
}, Z = function(e) {
|
|
492
|
+
de(t.removed, { element: e });
|
|
495
493
|
try {
|
|
496
|
-
|
|
494
|
+
g(e).removeChild(e);
|
|
497
495
|
} catch (t) {
|
|
498
|
-
if (p(e), !
|
|
496
|
+
if (p(e), !g(e)) throw A("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
499
497
|
}
|
|
500
|
-
},
|
|
498
|
+
}, gn = function(e, t, n) {
|
|
501
499
|
try {
|
|
502
|
-
|
|
500
|
+
ee(e, t);
|
|
503
501
|
} catch (t) {
|
|
504
502
|
try {
|
|
505
503
|
e.removeAttribute(n);
|
|
506
504
|
} catch (e) {}
|
|
507
505
|
}
|
|
508
|
-
},
|
|
509
|
-
|
|
510
|
-
let t =
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
p(e);
|
|
518
|
-
} catch (e) {}
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
let n = te(e);
|
|
506
|
+
}, _n = function(e) {
|
|
507
|
+
xn(e);
|
|
508
|
+
let t = h(e);
|
|
509
|
+
t && T(fe(t), (e) => {
|
|
510
|
+
try {
|
|
511
|
+
p(e);
|
|
512
|
+
} catch (e) {}
|
|
513
|
+
});
|
|
514
|
+
let n = b(e) === F.element ? ne(e) : null;
|
|
522
515
|
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
523
516
|
let r = n[t], i = r && r.name;
|
|
524
|
-
typeof i == "string" &&
|
|
517
|
+
typeof i == "string" && gn(e, r, i);
|
|
525
518
|
}
|
|
526
|
-
},
|
|
519
|
+
}, vn = function(e, n, r) {
|
|
527
520
|
if (!r) try {
|
|
528
521
|
r = n.getAttributeNode(e);
|
|
529
522
|
} catch (e) {
|
|
530
523
|
r = null;
|
|
531
524
|
}
|
|
532
|
-
|
|
525
|
+
de(t.removed, {
|
|
533
526
|
attribute: r || null,
|
|
534
527
|
from: n
|
|
535
528
|
});
|
|
536
529
|
try {
|
|
537
|
-
r ?
|
|
530
|
+
r ? ee(n, r) : n.removeAttribute(e);
|
|
538
531
|
} catch (t) {
|
|
539
532
|
try {
|
|
540
533
|
n.removeAttribute(e);
|
|
541
534
|
} catch (e) {}
|
|
542
535
|
}
|
|
543
536
|
if (e === "is") {
|
|
544
|
-
if (
|
|
545
|
-
|
|
537
|
+
if (Mt || Nt) try {
|
|
538
|
+
Z(n);
|
|
546
539
|
} catch (e) {}
|
|
547
540
|
else try {
|
|
548
541
|
n.setAttribute(e, "");
|
|
549
542
|
} catch (e) {}
|
|
550
543
|
}
|
|
551
|
-
},
|
|
552
|
-
let t =
|
|
544
|
+
}, yn = function(e) {
|
|
545
|
+
let t = ne(e);
|
|
553
546
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
554
547
|
let r = t[n], i = r && r.name;
|
|
555
|
-
typeof i != "string" ||
|
|
548
|
+
typeof i != "string" || B[X(i)] || gn(e, r, i);
|
|
556
549
|
}
|
|
557
|
-
},
|
|
558
|
-
let
|
|
559
|
-
for (;
|
|
560
|
-
let e =
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
550
|
+
}, bn = function(e, t) {
|
|
551
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], r = [e];
|
|
552
|
+
for (; r.length > 0;) {
|
|
553
|
+
let e = r.pop();
|
|
554
|
+
if (t(e) === !1) continue;
|
|
555
|
+
if (n && b(e) === F.element) {
|
|
556
|
+
let t = te(e);
|
|
557
|
+
Q(t) && r.push(t);
|
|
558
|
+
}
|
|
559
|
+
let i = h(e);
|
|
560
|
+
if (i) for (let e = i.length - 1; e >= 0; --e) r.push(i[e]);
|
|
564
561
|
}
|
|
565
|
-
},
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
562
|
+
}, xn = function(e) {
|
|
563
|
+
bn(e, (e) => {
|
|
564
|
+
b(e) === F.element && yn(e);
|
|
565
|
+
});
|
|
566
|
+
}, Sn = function(e) {
|
|
567
|
+
let t = [];
|
|
568
|
+
return bn(e, (e) => {
|
|
569
|
+
t.push(e);
|
|
570
|
+
}, !0), t;
|
|
571
|
+
}, Cn = function(e, t) {
|
|
572
|
+
let n = he();
|
|
573
|
+
T(Sn(e), (e) => {
|
|
574
|
+
b(e) === F.element && ge(n, e);
|
|
575
|
+
}), T(t, (e) => {
|
|
576
|
+
b(e) === F.element && !_e(n, e) && yn(e);
|
|
577
|
+
});
|
|
578
|
+
}, wn = function(e, n) {
|
|
579
|
+
let r = !1;
|
|
580
|
+
return T(t.removed, (t) => {
|
|
581
|
+
t.element && (r = r || t.element === e, xn(t.element));
|
|
582
|
+
}), Cn(e, n), r;
|
|
583
|
+
}, Tn = function(e, t) {
|
|
584
|
+
let n = q, r = null, i = () => (r || (r = he(), T(t, (e) => {
|
|
585
|
+
ge(r, e);
|
|
586
|
+
})), r);
|
|
587
|
+
for (let t = 0;; t++) {
|
|
588
|
+
let r = Sn(e), a = [e], o = !1;
|
|
589
|
+
if (T(r, (e) => {
|
|
590
|
+
b(e) === F.documentFragment ? de(a, e) : !o && !_e(n, e) && (o = _e(i(), e));
|
|
591
|
+
}), !o) return;
|
|
592
|
+
if (t >= 8) throw A("the tree kept changing during in-place sanitization; refusing to return it");
|
|
593
|
+
T(a, (t, n) => {
|
|
594
|
+
En(t, n > 0, e, i());
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
}, En = function(e, t, n, r) {
|
|
598
|
+
let i = jn(e), a;
|
|
599
|
+
for (; a = i.nextNode();) _e(r, a) && !_e(q, a) && (t && $(L.uponSanitizeShadowNode, a, null), Hn(a, n), Yn(a, n), Q(a.content) && Xn(a.content));
|
|
600
|
+
}, Dn = function(e) {
|
|
601
|
+
q && ge(q, e);
|
|
602
|
+
}, On = function(e, t) {
|
|
603
|
+
return G ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
|
|
604
|
+
}, kn = function(e) {
|
|
605
|
+
G && bn(e, (e) => {
|
|
606
|
+
let t = b(e);
|
|
607
|
+
if (t === F.processingInstruction || t === F.comment && k(et, e.data)) {
|
|
573
608
|
try {
|
|
574
609
|
p(e);
|
|
575
610
|
} catch (e) {}
|
|
576
|
-
|
|
611
|
+
return !1;
|
|
577
612
|
}
|
|
578
|
-
if (
|
|
579
|
-
let t = e, n =
|
|
613
|
+
if (t === F.element) {
|
|
614
|
+
let t = e, n = X(ie(e));
|
|
580
615
|
try {
|
|
581
|
-
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") &&
|
|
616
|
+
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && On("for", n) && t.removeAttribute("for");
|
|
582
617
|
} catch (e) {}
|
|
583
618
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
}, hn = function(e) {
|
|
619
|
+
return !0;
|
|
620
|
+
});
|
|
621
|
+
}, An = function(e) {
|
|
588
622
|
let t = null, r = null;
|
|
589
|
-
if (
|
|
623
|
+
if (jt) e = "<remove></remove>" + e;
|
|
590
624
|
else {
|
|
591
|
-
let t =
|
|
625
|
+
let t = ye(e, /^[\r\n\t ]+/);
|
|
592
626
|
r = t && t[0];
|
|
593
627
|
}
|
|
594
|
-
|
|
595
|
-
let i =
|
|
596
|
-
if (
|
|
597
|
-
t = new l().parseFromString(i,
|
|
628
|
+
rn === "application/xhtml+xml" && Jt === Y && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
629
|
+
let i = C ? D(e) : e;
|
|
630
|
+
if (Jt === Y) try {
|
|
631
|
+
t = new l().parseFromString(i, rn);
|
|
598
632
|
} catch (e) {}
|
|
599
633
|
if (!t || !t.documentElement) {
|
|
600
|
-
t =
|
|
634
|
+
t = Oe.createDocument(Jt, "template", null);
|
|
601
635
|
try {
|
|
602
|
-
t.documentElement.innerHTML =
|
|
636
|
+
t.documentElement.innerHTML = Yt ? w : i;
|
|
603
637
|
} catch (e) {}
|
|
604
638
|
}
|
|
605
639
|
let a = t.body || t.documentElement;
|
|
606
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null),
|
|
607
|
-
},
|
|
608
|
-
let t =
|
|
609
|
-
return
|
|
610
|
-
},
|
|
611
|
-
return e =
|
|
612
|
-
},
|
|
640
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Jt === Y ? dt.call(t, K ? "html" : "body")[0] : K ? t.documentElement : a;
|
|
641
|
+
}, jn = function(e) {
|
|
642
|
+
let t = y ? y(e) : e.ownerDocument;
|
|
643
|
+
return lt.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
644
|
+
}, Mn = function(e) {
|
|
645
|
+
return e = be(e, pt, " "), e = be(e, mt, " "), e = be(e, ht, " "), e;
|
|
646
|
+
}, Nn = function(e) {
|
|
613
647
|
var t;
|
|
614
|
-
e
|
|
615
|
-
let n =
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
a && O(a, (e) => {
|
|
619
|
-
bn(e.content) && vn(e.content);
|
|
648
|
+
Pn(e);
|
|
649
|
+
let n = (t = e.querySelectorAll) == null ? void 0 : t.call(e, "template");
|
|
650
|
+
n && T(n, (e) => {
|
|
651
|
+
Q(e.content) && Nn(e.content);
|
|
620
652
|
});
|
|
621
|
-
},
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
653
|
+
}, Pn = function(e) {
|
|
654
|
+
e.normalize();
|
|
655
|
+
let t = y ? y(e) : e.ownerDocument, n = lt.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
656
|
+
for (; r;) r.data = Mn(r.data), r = n.nextNode();
|
|
657
|
+
}, Fn = function(e) {
|
|
658
|
+
let t = v ? v(e) : null;
|
|
659
|
+
return typeof t != "string" || X(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== ne(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== _(e) || e.childNodes !== h(e);
|
|
660
|
+
}, Q = function(e) {
|
|
661
|
+
if (!_ || typeof e != "object" || !e) return !1;
|
|
626
662
|
try {
|
|
627
|
-
return
|
|
663
|
+
return _(e) === F.documentFragment;
|
|
628
664
|
} catch (e) {
|
|
629
665
|
return !1;
|
|
630
666
|
}
|
|
631
|
-
},
|
|
632
|
-
if (!
|
|
667
|
+
}, In = function(e) {
|
|
668
|
+
if (!_ || typeof e != "object" || !e) return !1;
|
|
633
669
|
try {
|
|
634
|
-
return typeof
|
|
670
|
+
return typeof _(e) == "number";
|
|
635
671
|
} catch (e) {
|
|
636
672
|
return !1;
|
|
637
673
|
}
|
|
638
674
|
};
|
|
639
675
|
function $(e, n, r) {
|
|
640
|
-
e.length !== 0 &&
|
|
641
|
-
e.call(t, n, r,
|
|
676
|
+
e.length !== 0 && T(e, (e) => {
|
|
677
|
+
e.call(t, n, r, on);
|
|
642
678
|
});
|
|
643
679
|
}
|
|
644
|
-
let
|
|
645
|
-
return !!(
|
|
646
|
-
},
|
|
647
|
-
return e instanceof RegExp ?
|
|
648
|
-
},
|
|
649
|
-
if (!
|
|
650
|
-
if (
|
|
651
|
-
let t =
|
|
680
|
+
let Ln = function(e, t) {
|
|
681
|
+
return !!(G && e.hasChildNodes() && !In(e.firstElementChild) && k($e, e.textContent) && k($e, e.innerHTML) || G && rt[t] && b(e) === F.element && oe(e) === Y && (In(e.firstElementChild) || typeof e.textContent == "string" && k($e, e.textContent)) || e.nodeType === F.processingInstruction || G && e.nodeType === F.comment && k(et, e.data));
|
|
682
|
+
}, Rn = function(e, t) {
|
|
683
|
+
return e instanceof RegExp ? k(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
|
|
684
|
+
}, zn = function(e, t, n) {
|
|
685
|
+
if (!H[t] && Gn(t) && Rn(V.tagNameCheck, t)) return !1;
|
|
686
|
+
if (Rt && !J[t] && !J[E(t)]) {
|
|
687
|
+
let t = g(e), r = h(e);
|
|
652
688
|
if (r && t) {
|
|
653
689
|
let i = r.length;
|
|
654
690
|
for (let a = i - 1; a >= 0; --a) {
|
|
655
691
|
let i = e === n ? f(r[a], !0) : r[a];
|
|
656
|
-
t.insertBefore(i,
|
|
692
|
+
t.insertBefore(i, m(e));
|
|
657
693
|
}
|
|
658
694
|
}
|
|
659
695
|
}
|
|
660
|
-
return
|
|
661
|
-
},
|
|
662
|
-
return e.length === 0 ? t : t === n || t === r ?
|
|
663
|
-
},
|
|
664
|
-
return e === t ||
|
|
665
|
-
},
|
|
666
|
-
if ($(
|
|
667
|
-
if (
|
|
668
|
-
let r =
|
|
669
|
-
if (
|
|
696
|
+
return Z(e), !0;
|
|
697
|
+
}, Bn = function(e, t, n, r) {
|
|
698
|
+
return e.length === 0 ? t : t === n || t === r ? N(t) : t;
|
|
699
|
+
}, Vn = function(e, t) {
|
|
700
|
+
return e === t || g(e) !== null ? !1 : (zt && xn(e), !0);
|
|
701
|
+
}, Hn = function(e, n) {
|
|
702
|
+
if (Dn(e), $(L.beforeSanitizeElements, e, null), Vn(e, n)) return !0;
|
|
703
|
+
if (Fn(e)) return Z(e), !0;
|
|
704
|
+
let r = X(ie(e));
|
|
705
|
+
if (z = Bn(L.uponSanitizeElement, z, xt, kt), $(L.uponSanitizeElement, e, {
|
|
670
706
|
tagName: r,
|
|
671
|
-
allowedTags:
|
|
672
|
-
}),
|
|
673
|
-
if (
|
|
674
|
-
if (
|
|
675
|
-
let t =
|
|
676
|
-
return t === !1 && ($(
|
|
707
|
+
allowedTags: z
|
|
708
|
+
}), Vn(e, n)) return !0;
|
|
709
|
+
if (Ln(e, r)) return Z(e), !0;
|
|
710
|
+
if (H[r] || !(U.tagCheck instanceof Function && U.tagCheck(r)) && !z[r]) {
|
|
711
|
+
let t = zn(e, r, n);
|
|
712
|
+
return t === !1 && ($(L.afterSanitizeElements, e, null), Vn(e, n)) ? !0 : t;
|
|
677
713
|
}
|
|
678
|
-
if (
|
|
679
|
-
if (
|
|
680
|
-
let n =
|
|
681
|
-
e.textContent !== n && (
|
|
714
|
+
if (b(e) === F.element && !hn(e) || (r === "noscript" || r === "noembed" || r === "noframes") && k(tt, e.innerHTML)) return Z(e), !0;
|
|
715
|
+
if (W && e.nodeType === F.text) {
|
|
716
|
+
let n = Mn(e.textContent);
|
|
717
|
+
e.textContent !== n && (de(t.removed, { element: e.cloneNode() }), e.textContent = n);
|
|
682
718
|
}
|
|
683
|
-
return $(
|
|
684
|
-
},
|
|
685
|
-
if (
|
|
686
|
-
let i =
|
|
687
|
-
return
|
|
688
|
-
},
|
|
719
|
+
return $(L.afterSanitizeElements, e, null), Vn(e, n);
|
|
720
|
+
}, Un = function(e, t, r) {
|
|
721
|
+
if (Ct[t] || On(t, e) || Ft && (t === "id" || t === "name") && (r in n || r in sn)) return !1;
|
|
722
|
+
let i = B[t] || U.attributeCheck instanceof Function && U.attributeCheck(t, e);
|
|
723
|
+
return Tt && k(gt, t) || wt && k(_t, t) ? !0 : i ? Wt[t] || k(R, be(r, yt, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && xe(r, "data:") === 0 && Ht[e] || Et && !k(vt, be(r, yt, "")) ? !0 : !r : Gn(e) && Rn(V.tagNameCheck, e) && Rn(V.attributeNameCheck, t, e) || t === "is" && V.allowCustomizedBuiltInElements && Rn(V.tagNameCheck, r);
|
|
724
|
+
}, Wn = M({}, [
|
|
689
725
|
"annotation-xml",
|
|
690
726
|
"color-profile",
|
|
691
727
|
"font-face",
|
|
@@ -694,45 +730,47 @@ function nt() {
|
|
|
694
730
|
"font-face-src",
|
|
695
731
|
"font-face-uri",
|
|
696
732
|
"missing-glyph"
|
|
697
|
-
]),
|
|
698
|
-
return !
|
|
699
|
-
},
|
|
700
|
-
if (
|
|
701
|
-
case "TrustedHTML": return
|
|
702
|
-
case "TrustedScriptURL": return
|
|
733
|
+
]), Gn = function(e) {
|
|
734
|
+
return !Wn[E(e)] && k(bt, e);
|
|
735
|
+
}, Kn = function(e, t, n, r) {
|
|
736
|
+
if (C && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
737
|
+
case "TrustedHTML": return D(r);
|
|
738
|
+
case "TrustedScriptURL": return Ee(r);
|
|
703
739
|
}
|
|
704
740
|
return r;
|
|
705
|
-
},
|
|
741
|
+
}, qn = function(e, t, n, r) {
|
|
706
742
|
try {
|
|
707
|
-
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !
|
|
743
|
+
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !Fn(e) || (Z(e), !1);
|
|
708
744
|
} catch (n) {
|
|
709
|
-
return
|
|
745
|
+
return vn(t, e), !1;
|
|
710
746
|
}
|
|
711
|
-
},
|
|
712
|
-
|
|
747
|
+
}, Jn = function(e, t) {
|
|
748
|
+
return G && k(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, t) ? !0 : E(e) === "attributename" && ye(t, "href") !== null;
|
|
749
|
+
}, Yn = function(e, n) {
|
|
750
|
+
if ($(L.beforeSanitizeAttributes, e, null), Vn(e, n)) return;
|
|
713
751
|
let r = e.attributes;
|
|
714
|
-
if (!r ||
|
|
715
|
-
|
|
752
|
+
if (!r || Fn(e)) return;
|
|
753
|
+
B = Bn(L.uponSanitizeAttribute, B, St, At);
|
|
716
754
|
let i = {
|
|
717
755
|
attrName: "",
|
|
718
756
|
attrValue: "",
|
|
719
757
|
keepAttr: !0,
|
|
720
|
-
allowedAttributes:
|
|
758
|
+
allowedAttributes: B,
|
|
721
759
|
forceKeepAttr: void 0
|
|
722
|
-
}, a = r.length, o =
|
|
760
|
+
}, a = r.length, o = X(e.nodeName);
|
|
723
761
|
for (; a--;) {
|
|
724
|
-
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u =
|
|
725
|
-
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, $(
|
|
762
|
+
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = X(s), d = l, f = s === "value" ? d : Se(d), p = !1;
|
|
763
|
+
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, $(L.uponSanitizeAttribute, e, i), f = i.attrValue, It && (u === "id" || u === "name") && xe(f, Lt) !== 0 && (vn(s, e, n), f = Lt + f, p = !0), Jn(s, f) ? vn(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !Dt && k(nt, f) ? vn(s, e, n) : (W && (f = Mn(f)), Un(o, u, f) ? (f = Kn(o, u, c, f), f !== d && qn(e, s, c, f) && p && ue(t.removed)) : vn(s, e, n)) : vn(s, e, n));
|
|
726
764
|
}
|
|
727
|
-
$(
|
|
728
|
-
},
|
|
729
|
-
let t = null, n =
|
|
730
|
-
for ($(
|
|
731
|
-
let e =
|
|
732
|
-
|
|
765
|
+
$(L.afterSanitizeAttributes, e, null), Vn(e, n);
|
|
766
|
+
}, Xn = function(e) {
|
|
767
|
+
let t = null, n = jn(e);
|
|
768
|
+
for ($(L.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if ($(L.uponSanitizeShadowNode, t, null), Hn(t, e), Yn(t, e), Q(t.content) && Xn(t.content), b(t) === F.element) {
|
|
769
|
+
let e = te(t);
|
|
770
|
+
Q(e) && (Zn(e), Xn(e));
|
|
733
771
|
}
|
|
734
|
-
$(
|
|
735
|
-
},
|
|
772
|
+
W && Pn(e), $(L.afterSanitizeShadowDOM, e, null);
|
|
773
|
+
}, Zn = function(e) {
|
|
736
774
|
let t = [{
|
|
737
775
|
node: e,
|
|
738
776
|
shadow: null
|
|
@@ -740,27 +778,27 @@ function nt() {
|
|
|
740
778
|
for (; t.length > 0;) {
|
|
741
779
|
let e = t.pop();
|
|
742
780
|
if (e.shadow) {
|
|
743
|
-
|
|
781
|
+
Xn(e.shadow);
|
|
744
782
|
continue;
|
|
745
783
|
}
|
|
746
|
-
let n = e.node, r =
|
|
784
|
+
let n = e.node, r = b(n) === F.element, i = h(n);
|
|
747
785
|
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
|
|
748
786
|
node: i[e],
|
|
749
787
|
shadow: null
|
|
750
788
|
});
|
|
751
789
|
if (r) {
|
|
752
|
-
let e =
|
|
753
|
-
if (typeof e == "string" &&
|
|
790
|
+
let e = v ? v(n) : null;
|
|
791
|
+
if (typeof e == "string" && X(e) === "template") {
|
|
754
792
|
let e = n.content;
|
|
755
|
-
|
|
793
|
+
Q(e) && t.push({
|
|
756
794
|
node: e,
|
|
757
795
|
shadow: null
|
|
758
796
|
});
|
|
759
797
|
}
|
|
760
798
|
}
|
|
761
799
|
if (r) {
|
|
762
|
-
let e =
|
|
763
|
-
|
|
800
|
+
let e = te(n);
|
|
801
|
+
Q(e) && t.push({
|
|
764
802
|
node: null,
|
|
765
803
|
shadow: e
|
|
766
804
|
}, {
|
|
@@ -772,78 +810,73 @@ function nt() {
|
|
|
772
810
|
};
|
|
773
811
|
return t.sanitize = function(e) {
|
|
774
812
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
|
|
775
|
-
if (
|
|
813
|
+
if (Yt = !e, Yt && (e = "<!-->"), typeof e != "string" && !In(e) && (e = ke(e), typeof e != "string")) throw A("dirty is not a string, aborting");
|
|
776
814
|
if (!t.isSupported) return e;
|
|
777
|
-
|
|
778
|
-
let c =
|
|
815
|
+
Ot ? (z = kt, B = At) : ln(n), (L.uponSanitizeElement.length > 0 || L.uponSanitizeAttribute.length > 0) && (z = N(z)), L.uponSanitizeAttribute.length > 0 && (B = N(B)), t.removed = [];
|
|
816
|
+
let c = zt && typeof e != "string" && In(e), l = [], u = q;
|
|
779
817
|
if (c) {
|
|
780
|
-
|
|
781
|
-
let t =
|
|
818
|
+
kn(e);
|
|
819
|
+
let t = ie(e);
|
|
782
820
|
if (typeof t == "string") {
|
|
783
|
-
let n =
|
|
784
|
-
if (!
|
|
821
|
+
let n = X(t);
|
|
822
|
+
if (!z[n] || H[n]) throw _n(e), A("root node is forbidden and cannot be sanitized in-place");
|
|
785
823
|
}
|
|
786
|
-
if (
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
} catch (t) {
|
|
790
|
-
throw ln(e), t;
|
|
791
|
-
}
|
|
792
|
-
} else if (xn(e)) i = hn("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === R.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Fn(i);
|
|
824
|
+
if (Fn(e)) throw _n(e), A("root node is clobbered and cannot be sanitized in-place");
|
|
825
|
+
l = Sn(e), q = he();
|
|
826
|
+
} else if (In(e)) i = An("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === F.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Zn(i);
|
|
793
827
|
else {
|
|
794
|
-
if (!
|
|
795
|
-
if (i =
|
|
828
|
+
if (!Mt && !W && !K && e.indexOf("<") === -1) return C && Pt ? D(e) : e;
|
|
829
|
+
if (i = An(e), !i) return Mt ? null : Pt ? w : "";
|
|
796
830
|
}
|
|
797
|
-
i &&
|
|
798
|
-
let
|
|
831
|
+
i && jt && Z(i.firstChild);
|
|
832
|
+
let d = c ? e : i;
|
|
799
833
|
try {
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
834
|
+
c && Zn(e);
|
|
835
|
+
let t = jn(d);
|
|
836
|
+
for (; o = t.nextNode();) Hn(o, d), Yn(o, d), Q(o.content) && Xn(o.content);
|
|
837
|
+
c && Tn(e, l);
|
|
838
|
+
} catch (t) {
|
|
839
|
+
throw c && (_n(e), wn(e, l)), t;
|
|
840
|
+
} finally {
|
|
841
|
+
q = u;
|
|
806
842
|
}
|
|
807
843
|
if (c) {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
t.element && (t.element === e && (n = !0), fn(t.element));
|
|
811
|
-
}), n) throw N("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
812
|
-
return G && vn(e), e;
|
|
844
|
+
if (wn(e, l)) throw A("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
845
|
+
return W && Nn(e), e;
|
|
813
846
|
}
|
|
814
|
-
if (
|
|
815
|
-
if (
|
|
847
|
+
if (Mt) {
|
|
848
|
+
if (W && Nn(i), Nt) for (s = ut.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
|
|
816
849
|
else s = i;
|
|
817
|
-
return (
|
|
850
|
+
return (B.shadowroot || B.shadowrootmode) && (s = ft.call(r, s, !0)), s;
|
|
818
851
|
}
|
|
819
|
-
let
|
|
820
|
-
return
|
|
852
|
+
let f = K ? i.outerHTML : i.innerHTML;
|
|
853
|
+
return K && z["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && k(Ze, i.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + f), W && (f = Mn(f)), C && Pt ? D(f) : f;
|
|
821
854
|
}, t.setConfig = function() {
|
|
822
855
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
823
|
-
|
|
856
|
+
ln(e), Ot = !0, kt = z, At = B;
|
|
824
857
|
}, t.clearConfig = function() {
|
|
825
|
-
|
|
858
|
+
on = null, Ot = !1, kt = null, At = null, C = ce, w = "";
|
|
826
859
|
}, t.isValidAttribute = function(e, t, n) {
|
|
827
|
-
|
|
828
|
-
let r =
|
|
829
|
-
return
|
|
860
|
+
on || ln({});
|
|
861
|
+
let r = X(e), i = X(t);
|
|
862
|
+
return typeof n == "string" && (Jn(t, n) || !Dt && k(nt, n)) ? !1 : Un(r, i, n);
|
|
830
863
|
}, t.addHook = function(e, t) {
|
|
831
|
-
typeof t == "function" &&
|
|
864
|
+
typeof t == "function" && O(L, e) && de(L[e], t);
|
|
832
865
|
}, t.removeHook = function(e, t) {
|
|
833
|
-
if (
|
|
866
|
+
if (O(L, e)) {
|
|
834
867
|
if (t !== void 0) {
|
|
835
|
-
let n =
|
|
836
|
-
return n === -1 ? void 0 :
|
|
868
|
+
let n = le(L[e], t);
|
|
869
|
+
return n === -1 ? void 0 : pe(L[e], n, 1)[0];
|
|
837
870
|
}
|
|
838
|
-
return
|
|
871
|
+
return ue(L[e]);
|
|
839
872
|
}
|
|
840
873
|
}, t.removeHooks = function(e) {
|
|
841
|
-
|
|
874
|
+
O(L, e) && (L[e] = []);
|
|
842
875
|
}, t.removeAllHooks = function() {
|
|
843
|
-
|
|
876
|
+
L = ot();
|
|
844
877
|
}, t;
|
|
845
878
|
}
|
|
846
|
-
var
|
|
879
|
+
var lt = ct(), ut = (e) => e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), dt = {
|
|
847
880
|
WHOLE_DOCUMENT: !0,
|
|
848
881
|
USE_PROFILES: {
|
|
849
882
|
html: !0,
|
|
@@ -867,7 +900,7 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
867
900
|
"link"
|
|
868
901
|
],
|
|
869
902
|
FORBID_ATTR: ["srcdoc"]
|
|
870
|
-
},
|
|
903
|
+
}, ft = (e) => e || globalThis.document || null, L = (e) => /[A-Za-z0-9_-]/.test(e), pt = (e, t) => {
|
|
871
904
|
let n = t + 1, r = e[n] || "";
|
|
872
905
|
if (!r) return {
|
|
873
906
|
value: "",
|
|
@@ -891,7 +924,7 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
891
924
|
value: r,
|
|
892
925
|
nextIndex: n + 1
|
|
893
926
|
};
|
|
894
|
-
},
|
|
927
|
+
}, mt = (e) => {
|
|
895
928
|
let t = "", n = "", r = 0;
|
|
896
929
|
for (; r < e.length;) {
|
|
897
930
|
let i = e[r] || "";
|
|
@@ -913,7 +946,7 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
913
946
|
continue;
|
|
914
947
|
}
|
|
915
948
|
if (i === "\\") {
|
|
916
|
-
let n =
|
|
949
|
+
let n = pt(e, r);
|
|
917
950
|
t += n.value, r = n.nextIndex;
|
|
918
951
|
continue;
|
|
919
952
|
}
|
|
@@ -921,7 +954,7 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
921
954
|
t += a < 32 && i !== " " && i !== "\n" && i !== "\r" ? " " : i, r += 1;
|
|
922
955
|
}
|
|
923
956
|
return t;
|
|
924
|
-
},
|
|
957
|
+
}, ht = /^data:(?:image\/(?:avif|bmp|gif|jpeg|png|webp|x-icon)|font\/(?:collection|otf|sfnt|ttf|woff2?)|application\/(?:font-sfnt|font-woff|vnd\.ms-fontobject|x-font-opentype|x-font-ttf|x-font-woff));/i, gt = (e) => {
|
|
925
958
|
let t = /^data:image\/svg\+xml(?:;charset=[A-Za-z0-9._-]+)?,([\s\S]*)$/i.exec(e);
|
|
926
959
|
if (!t || t[1].length > 1048576) return !1;
|
|
927
960
|
let n;
|
|
@@ -932,31 +965,31 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
932
965
|
}
|
|
933
966
|
if (!/^\s*<svg(?:\s|>)/i.test(n) || /<\/?(?:script|style|foreignObject|iframe|object|embed|form|link)\b/i.test(n) || /<!\s*(?:doctype|entity)\b/i.test(n) || /\son[a-z0-9_-]+\s*=/i.test(n) || /@import\b/i.test(n) || /url\s*\(\s*(?!["']?#)/i.test(n)) return !1;
|
|
934
967
|
for (let e of n.matchAll(/\s(?:href|xlink:href|src)\s*=\s*(["'])([\s\S]*?)\1/gi)) {
|
|
935
|
-
let t =
|
|
936
|
-
if (!/^#[A-Za-z0-9_.:-]+$/.test(t) && !
|
|
968
|
+
let t = vt(e[2] || "");
|
|
969
|
+
if (!/^#[A-Za-z0-9_.:-]+$/.test(t) && !ht.test(t)) return !1;
|
|
937
970
|
}
|
|
938
971
|
return !0;
|
|
939
|
-
},
|
|
972
|
+
}, _t = (e) => {
|
|
940
973
|
let t = "";
|
|
941
974
|
for (let n of e) {
|
|
942
975
|
let e = n.charCodeAt(0);
|
|
943
976
|
e <= 32 || e >= 127 && e <= 159 || (t += n);
|
|
944
977
|
}
|
|
945
978
|
return t.trim();
|
|
946
|
-
},
|
|
947
|
-
let t =
|
|
948
|
-
return t ? t.startsWith("#") || /^blob:/i.test(t) ? !0 :
|
|
949
|
-
},
|
|
979
|
+
}, vt = _t, yt = /^data:(?:image\/(?:avif|bmp|gif|jpeg|png|webp|x-icon)|audio\/[a-z0-9.+-]+|video\/[a-z0-9.+-]+|text\/vtt)(?:;[^,]*)?,/i, bt = (e) => {
|
|
980
|
+
let t = _t(e);
|
|
981
|
+
return t ? t.startsWith("#") || /^blob:/i.test(t) ? !0 : yt.test(t) : !1;
|
|
982
|
+
}, R = (e, t, n = {}) => {
|
|
950
983
|
if (!e.hasAttribute(t)) return;
|
|
951
|
-
let r =
|
|
952
|
-
(n.fragmentOnly ? /^#[A-Za-z0-9_.:-]+$/.test(r) :
|
|
953
|
-
},
|
|
984
|
+
let r = _t(e.getAttribute(t) || "");
|
|
985
|
+
(n.fragmentOnly ? /^#[A-Za-z0-9_.:-]+$/.test(r) : bt(r)) ? e.setAttribute(t, r) : e.removeAttribute(t);
|
|
986
|
+
}, z = (e) => {
|
|
954
987
|
let t = e.trim(), n = t[0];
|
|
955
|
-
return (n === "\"" || n === "'") && t[t.length - 1] === n && (t = t.slice(1, -1).trim()),
|
|
956
|
-
},
|
|
957
|
-
let t =
|
|
958
|
-
return t ? t.startsWith("#") || /^blob:/i.test(t) ? !0 :
|
|
959
|
-
},
|
|
988
|
+
return (n === "\"" || n === "'") && t[t.length - 1] === n && (t = t.slice(1, -1).trim()), _t(t);
|
|
989
|
+
}, xt = (e) => {
|
|
990
|
+
let t = z(e);
|
|
991
|
+
return t ? t.startsWith("#") || /^blob:/i.test(t) ? !0 : ht.test(t) || gt(t) : !1;
|
|
992
|
+
}, B = (e, t) => {
|
|
960
993
|
let n = "";
|
|
961
994
|
for (let r = t; r < e.length; r += 1) {
|
|
962
995
|
let t = e[r] || "";
|
|
@@ -965,7 +998,7 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
965
998
|
else if (t === ")") return r;
|
|
966
999
|
}
|
|
967
1000
|
return -1;
|
|
968
|
-
},
|
|
1001
|
+
}, St = (e) => {
|
|
969
1002
|
let t = !1, n = !1, r = "", i = 0;
|
|
970
1003
|
for (; i < e.length;) {
|
|
971
1004
|
let a = e[i] || "";
|
|
@@ -983,9 +1016,9 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
983
1016
|
else {
|
|
984
1017
|
if (a === "@" && e.slice(i + 1, i + 7).toLowerCase() === "import") {
|
|
985
1018
|
let n = e[i + 7] || "";
|
|
986
|
-
|
|
1019
|
+
n && L(n) || (t = !0);
|
|
987
1020
|
}
|
|
988
|
-
if (e.slice(i, i + 3).toLowerCase() === "url" && !
|
|
1021
|
+
if (e.slice(i, i + 3).toLowerCase() === "url" && !L(e[i - 1] || "")) {
|
|
989
1022
|
let t = i + 3;
|
|
990
1023
|
for (; /\s/.test(e[t] || "");) t += 1;
|
|
991
1024
|
e[t] === "(" && (n = !0);
|
|
@@ -997,8 +1030,8 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
997
1030
|
hasImport: t,
|
|
998
1031
|
hasUrl: n
|
|
999
1032
|
};
|
|
1000
|
-
},
|
|
1001
|
-
let t =
|
|
1033
|
+
}, V = (e) => {
|
|
1034
|
+
let t = St(mt(e)), n = St(e);
|
|
1002
1035
|
if (t.hasImport || t.hasUrl && !n.hasUrl) return "";
|
|
1003
1036
|
if (!n.hasUrl) return e;
|
|
1004
1037
|
let r = "", i = "", a = 0;
|
|
@@ -1020,14 +1053,14 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
1020
1053
|
r += e.slice(a, t + 2), a = t + 2;
|
|
1021
1054
|
} else if (t === "\\") r += t, r += e[a + 1] || "", a += 2;
|
|
1022
1055
|
else {
|
|
1023
|
-
if (e.slice(a, a + 3).toLowerCase() === "url" && !
|
|
1056
|
+
if (e.slice(a, a + 3).toLowerCase() === "url" && !L(e[a - 1] || "")) {
|
|
1024
1057
|
let t = a + 3;
|
|
1025
1058
|
for (; /\s/.test(e[t] || "");) t += 1;
|
|
1026
1059
|
if (e[t] === "(") {
|
|
1027
|
-
let n =
|
|
1060
|
+
let n = B(e, t + 1);
|
|
1028
1061
|
if (n < 0) return "";
|
|
1029
1062
|
let i = e.slice(t + 1, n);
|
|
1030
|
-
r +=
|
|
1063
|
+
r += xt(i) ? e.slice(a, n + 1) : "none", a = n + 1;
|
|
1031
1064
|
continue;
|
|
1032
1065
|
}
|
|
1033
1066
|
}
|
|
@@ -1035,15 +1068,15 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
1035
1068
|
}
|
|
1036
1069
|
}
|
|
1037
1070
|
return r;
|
|
1038
|
-
},
|
|
1071
|
+
}, H = (e) => {
|
|
1039
1072
|
let t = e.defaultView;
|
|
1040
1073
|
if (!t) return null;
|
|
1041
|
-
let n =
|
|
1074
|
+
let n = lt(t);
|
|
1042
1075
|
return n.isSupported ? (n.addHook("afterSanitizeElements", (e) => {
|
|
1043
1076
|
var t;
|
|
1044
1077
|
let n = e;
|
|
1045
1078
|
if (((t = n.localName) == null ? void 0 : t.toLowerCase()) !== "style") return;
|
|
1046
|
-
let r =
|
|
1079
|
+
let r = V(n.textContent || "");
|
|
1047
1080
|
r ? n.textContent = r : n.remove();
|
|
1048
1081
|
}), n.addHook("afterSanitizeAttributes", (e) => {
|
|
1049
1082
|
var t;
|
|
@@ -1055,24 +1088,24 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
1055
1088
|
"source",
|
|
1056
1089
|
"track",
|
|
1057
1090
|
"input"
|
|
1058
|
-
].includes(r || "") &&
|
|
1091
|
+
].includes(r || "") && R(n, "src"), r === "video" && R(n, "poster"), n.hasAttribute("background") && R(n, "background"), n.namespaceURI === "http://www.w3.org/2000/svg" && r !== "a") {
|
|
1059
1092
|
let e = r === "use" || r === "mpath";
|
|
1060
|
-
|
|
1093
|
+
R(n, "href", { fragmentOnly: e }), R(n, "xlink:href", { fragmentOnly: e });
|
|
1061
1094
|
}
|
|
1062
1095
|
if (n.hasAttribute("style")) {
|
|
1063
|
-
let e =
|
|
1096
|
+
let e = V(n.getAttribute("style") || "");
|
|
1064
1097
|
e ? n.setAttribute("style", e) : n.removeAttribute("style");
|
|
1065
1098
|
}
|
|
1066
1099
|
}), n) : null;
|
|
1067
|
-
},
|
|
1068
|
-
let n =
|
|
1069
|
-
return r ? `<!doctype html>\n${String(r.sanitize(e,
|
|
1070
|
-
},
|
|
1100
|
+
}, Ct = "<meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />", U = (e, t) => {
|
|
1101
|
+
let n = ft(t), r = n ? H(n) : null;
|
|
1102
|
+
return r ? `<!doctype html>\n${String(r.sanitize(e, dt)).replace("<head>", `<head>\n ${Ct}`)}` : "<!doctype html>\n<html lang=\"en\"><head><meta charset=\"utf-8\" /></head><body></body></html>";
|
|
1103
|
+
}, wt = (e) => {
|
|
1071
1104
|
let t = e.createElement("html");
|
|
1072
1105
|
t.lang = "en";
|
|
1073
1106
|
let n = e.createElement("head"), r = e.createElement("meta");
|
|
1074
1107
|
return r.setAttribute("charset", "utf-8"), n.append(r), t.append(n, e.createElement("body")), t;
|
|
1075
|
-
},
|
|
1108
|
+
}, Tt = (e) => {
|
|
1076
1109
|
let t = e.querySelector(":scope > head");
|
|
1077
1110
|
if (!t) return e;
|
|
1078
1111
|
if (!t.querySelector("meta[charset]")) {
|
|
@@ -1086,15 +1119,15 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
1086
1119
|
r == null || r.after(n);
|
|
1087
1120
|
}
|
|
1088
1121
|
return e;
|
|
1089
|
-
},
|
|
1090
|
-
let r =
|
|
1122
|
+
}, Et = (e, n) => {
|
|
1123
|
+
let r = ft(n);
|
|
1091
1124
|
if (!r) throw Error("A browser document is required to build printable DOM.");
|
|
1092
|
-
let i =
|
|
1093
|
-
if (!i) return
|
|
1094
|
-
let a = i.sanitize(e, t(t({},
|
|
1095
|
-
return !a || a.nodeType !== 1 || a.localName.toLowerCase() !== "html" ?
|
|
1096
|
-
}, q = "\n * { box-sizing: border-box; }\n html, body { margin: 0; min-height: 100%; background: #f2f4f7; color: #172033; font-family: Aptos, \"Segoe UI\", \"PingFang SC\", \"Microsoft YaHei\", sans-serif; print-color-adjust: exact; -webkit-print-color-adjust: exact; }\n body { padding: 24px; }\n .viewer-export-shell { position: relative; min-height: calc(100vh - 48px); overflow: visible; background: #f2f4f7; }\n .viewer-export-content { position: relative; z-index: 1; contain: none; width: 100%; min-height: 100%; overflow: visible; }\n .viewer-export-watermark { position: absolute; inset: 0; pointer-events: none; z-index: 20; background-repeat: repeat; print-color-adjust: exact; -webkit-print-color-adjust: exact; }\n .viewer-export-content .file-render,\n .viewer-export-content .file-viewer,\n .viewer-export-content .viewer-stage,\n .viewer-export-content .content,\n .viewer-export-content .pdf-shell,\n .viewer-export-content .pdf-content,\n .viewer-export-content .pdf-viewport,\n .viewer-export-content .pdf-wrapper,\n .viewer-export-content .docx-fit-viewer,\n .viewer-export-content .docx-wrapper,\n .viewer-export-content .docx-canvas-wrapper,\n .viewer-export-content .msdoc-stage,\n .viewer-export-content .msdoc-paged-view,\n .viewer-export-content .code-viewer,\n .viewer-export-content .markdown-viewer,\n .viewer-export-content .email-shell,\n .viewer-export-content .archive-shell,\n .viewer-export-content .eda-shell,\n .viewer-export-content .ebook-shell,\n .viewer-export-content .umd-shell,\n .viewer-export-content .drawing-shell,\n .viewer-export-content .audio-shell,\n .viewer-export-content .cad-shell,\n .viewer-export-content .cad-body,\n .viewer-export-content .cad-canvas-wrap,\n .viewer-export-content .dwg-preview-frame {\n position: relative !important;\n inset: auto !important;\n contain: none !important;\n width: 100% !important;\n height: auto !important;\n min-height: 0 !important;\n max-height: none !important;\n overflow: visible !important;\n }\n .viewer-export-content .docx-wrapper {\n display: block !important;\n padding: 0 !important;\n background: transparent !important;\n }\n .viewer-export-content .docx-canvas-wrapper {\n display: block !important;\n padding: 0 !important;\n background: transparent !important;\n }\n .viewer-export-content .docx-print-document {\n display: block !important;\n width: fit-content !important;\n max-width: 100% !important;\n height: auto !important;\n overflow: visible !important;\n margin: 0 auto !important;\n }\n .viewer-export-content .docx-page-frame {\n position: relative !important;\n width: var(--viewer-print-page-width, fit-content) !important;\n height: var(--viewer-print-page-height, auto) !important;\n min-height: var(--viewer-print-page-height, 0) !important;\n max-width: 100% !important;\n margin: 0 auto 18px !important;\n overflow: hidden !important;\n break-inside: avoid;\n page-break-inside: avoid;\n break-after: page;\n page-break-after: always;\n }\n .viewer-export-content .docx-canvas-sheet {\n position: relative !important;\n contain: none !important;\n width: var(--viewer-print-page-width, 794px) !important;\n height: var(--viewer-print-page-height, 1123px) !important;\n min-height: var(--viewer-print-page-height, 1123px) !important;\n max-width: 100% !important;\n margin: 0 auto 18px !important;\n overflow: hidden !important;\n box-shadow: none !important;\n break-inside: avoid;\n page-break-inside: avoid;\n break-after: page;\n page-break-after: always;\n }\n .viewer-export-content .docx-canvas-sheet > img {\n display: block !important;\n width: 100% !important;\n height: 100% !important;\n max-width: none !important;\n object-fit: fill;\n }\n .viewer-export-content .msdoc-page {\n position: relative !important;\n width: var(--viewer-print-page-width, 794px) !important;\n min-height: var(--viewer-print-page-height, 1123px) !important;\n max-width: 100% !important;\n height: auto !important;\n margin: 0 auto 18px !important;\n overflow: visible !important;\n break-after: page;\n page-break-after: always;\n }\n .viewer-export-content .docx-page-frame:last-child,\n .viewer-export-content .docx-canvas-sheet:last-child,\n .viewer-export-content .msdoc-page:last-child {\n break-after: auto;\n page-break-after: auto;\n }\n .viewer-export-content .docx-page-frame > section.docx {\n position: relative !important;\n top: auto !important;\n left: auto !important;\n width: var(--viewer-print-page-width, auto) !important;\n min-height: var(--viewer-print-page-height, auto) !important;\n max-width: none !important;\n margin: 0 auto !important;\n overflow: visible !important;\n transform: none !important;\n box-shadow: none !important;\n break-inside: avoid;\n page-break-inside: avoid;\n }\n .viewer-export-content .msdoc-stage {\n display: block !important;\n padding: 0 !important;\n background: transparent !important;\n }\n .viewer-export-content .msdoc-paged-view {\n display: block !important;\n gap: 0 !important;\n padding: 0 !important;\n background: transparent !important;\n }\n .viewer-export-content .msdoc-page > .msdoc-root {\n margin: 0 auto !important;\n box-shadow: none !important;\n overflow: visible !important;\n }\n .viewer-export-content .pdf-toolbar,\n .viewer-export-content .pdf-nav-pane,\n .viewer-export-content .viewer-actions,\n .viewer-export-content .code-toolbar,\n .viewer-export-content .umd-toolbar,\n .viewer-export-content .drawing-toolbar,\n .viewer-export-content .cad-toolbar {\n display: none !important;\n }\n .viewer-export-content .pdf-content,\n .viewer-export-content .pdf-shell--nav-hidden .pdf-content,\n .viewer-export-content .cad-body.without-layers {\n display: block !important;\n grid-template-columns: none !important;\n }\n .viewer-export-content .pdfViewer { padding: 0 !important; }\n .viewer-export-content .pdfViewer .page {\n margin: 0 auto 16px !important;\n border: 0 !important;\n box-shadow: none !important;\n break-after: page;\n page-break-after: always;\n }\n .viewer-export-content .pdfViewer .page:last-child {\n break-after: auto;\n page-break-after: auto;\n }\n .viewer-export-content .pdf-export-document {\n display: grid;\n justify-items: center;\n gap: 18px;\n padding: 4px 0;\n }\n .viewer-export-content .pdf-export-page {\n width: var(--viewer-print-page-width, auto);\n height: var(--viewer-print-page-height, auto);\n max-width: 100%;\n overflow: hidden;\n background: #ffffff;\n box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);\n break-inside: avoid;\n page-break-inside: avoid;\n break-after: page;\n page-break-after: always;\n }\n .viewer-export-content .pdf-export-page:last-child {\n break-after: auto;\n page-break-after: auto;\n }\n .viewer-export-content .pdf-export-page img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .viewer-export-content .pptx-wrapper {\n width: 100% !important;\n max-width: 100% !important;\n height: auto !important;\n overflow: visible !important;\n transform: none !important;\n }\n .viewer-export-content .pptx-wrapper .slide {\n margin: 0 auto 18px !important;\n break-inside: avoid;\n page-break-inside: avoid;\n break-after: page;\n page-break-after: always;\n box-shadow: none !important;\n }\n .viewer-export-content .pptx-wrapper .slide:last-child {\n break-after: auto;\n page-break-after: auto;\n }\n .viewer-export-content .ofd-stage {\n padding: 0 !important;\n overflow: visible !important;\n }\n .viewer-export-content .ofd-page,\n .viewer-export-content .drawing-svg,\n .viewer-export-content .cad-canvas-wrap,\n .viewer-export-content .dwg-preview-frame {\n break-inside: avoid;\n page-break-inside: avoid;\n break-after: page;\n page-break-after: always;\n box-shadow: none !important;\n }\n .viewer-export-content .ofd-page:last-child,\n .viewer-export-content .drawing-svg:last-child,\n .viewer-export-content .cad-canvas-wrap:last-child,\n .viewer-export-content .dwg-preview-frame:last-child {\n break-after: auto;\n page-break-after: auto;\n }\n .viewer-export-content .code-area {\n overflow: visible !important;\n white-space: pre-wrap !important;\n word-break: break-word !important;\n }\n .viewer-export-content .umd-body,\n .viewer-export-content .umd-stage-wrap,\n .viewer-export-content .umd-stage {\n display: block !important;\n height: auto !important;\n max-height: none !important;\n overflow: visible !important;\n }\n .viewer-export-content .umd-toc {\n display: none !important;\n }\n img, canvas, svg, video { max-width: 100%; }\n @media print {\n @page { margin: 12mm; }\n html, body { min-height: auto; background: #ffffff; }\n body { padding: 0; }\n .viewer-export-shell,\n .viewer-export-content {\n min-height: 0;\n overflow: visible;\n background: #ffffff;\n }\n .viewer-export-content .docx-print-document {\n width: auto !important;\n max-width: none !important;\n margin: 0 !important;\n }\n .viewer-export-content .pdf-export-document {\n display: block;\n padding: 0;\n }\n .viewer-export-content .pdf-export-page {\n width: var(--viewer-print-page-width, auto) !important;\n height: var(--viewer-print-page-height, auto) !important;\n max-width: none !important;\n margin: 0;\n overflow: hidden;\n box-shadow: none;\n }\n .viewer-export-content .docx-page-frame {\n width: var(--viewer-print-page-width, auto) !important;\n height: var(--viewer-print-page-height, auto) !important;\n min-height: var(--viewer-print-page-height, 0) !important;\n max-width: none !important;\n margin: 0 !important;\n overflow: hidden !important;\n }\n .viewer-export-content .docx-canvas-sheet {\n contain: none !important;\n width: var(--viewer-print-page-width, 794px) !important;\n height: var(--viewer-print-page-height, 1123px) !important;\n min-height: var(--viewer-print-page-height, 1123px) !important;\n max-width: none !important;\n margin: 0 !important;\n overflow: hidden !important;\n box-shadow: none !important;\n }\n .viewer-export-content .msdoc-page {\n width: var(--viewer-print-page-width, 794px) !important;\n min-height: var(--viewer-print-page-height, 1123px) !important;\n max-width: none !important;\n margin: 0 !important;\n overflow: visible !important;\n }\n .viewer-export-content .docx-page-frame > section.docx,\n .viewer-export-content .msdoc-page > .msdoc-root {\n width: var(--viewer-print-page-width, 100%) !important;\n max-width: none !important;\n border: 0 !important;\n }\n .viewer-export-content .pptx-wrapper .slide,\n .viewer-export-content .ofd-page,\n .viewer-export-content .drawing-svg,\n .viewer-export-content .cad-canvas-wrap,\n .viewer-export-content .dwg-preview-frame {\n box-shadow: none !important;\n }\n }\n", xt = (e) => {
|
|
1097
|
-
let t =
|
|
1125
|
+
let i = H(r);
|
|
1126
|
+
if (!i) return wt(r);
|
|
1127
|
+
let a = i.sanitize(e, t(t({}, dt), {}, { RETURN_DOM: !0 }));
|
|
1128
|
+
return !a || a.nodeType !== 1 || a.localName.toLowerCase() !== "html" ? wt(r) : Tt(a);
|
|
1129
|
+
}, Dt = "\n * { box-sizing: border-box; }\n html, body { margin: 0; min-height: 100%; background: #f2f4f7; color: #172033; font-family: Aptos, \"Segoe UI\", \"PingFang SC\", \"Microsoft YaHei\", sans-serif; print-color-adjust: exact; -webkit-print-color-adjust: exact; }\n body { padding: 24px; }\n .viewer-export-shell { position: relative; min-height: calc(100vh - 48px); overflow: visible; background: #f2f4f7; }\n .viewer-export-content { position: relative; z-index: 1; contain: none; width: 100%; min-height: 100%; overflow: visible; }\n .viewer-export-watermark { position: absolute; inset: 0; pointer-events: none; z-index: 20; background-repeat: repeat; print-color-adjust: exact; -webkit-print-color-adjust: exact; }\n .viewer-export-content .file-render,\n .viewer-export-content .file-viewer,\n .viewer-export-content .viewer-stage,\n .viewer-export-content .content,\n .viewer-export-content .pdf-shell,\n .viewer-export-content .pdf-content,\n .viewer-export-content .pdf-viewport,\n .viewer-export-content .pdf-wrapper,\n .viewer-export-content .docx-fit-viewer,\n .viewer-export-content .docx-wrapper,\n .viewer-export-content .docx-canvas-wrapper,\n .viewer-export-content .msdoc-stage,\n .viewer-export-content .msdoc-paged-view,\n .viewer-export-content .code-viewer,\n .viewer-export-content .markdown-viewer,\n .viewer-export-content .email-shell,\n .viewer-export-content .archive-shell,\n .viewer-export-content .eda-shell,\n .viewer-export-content .ebook-shell,\n .viewer-export-content .umd-shell,\n .viewer-export-content .drawing-shell,\n .viewer-export-content .audio-shell,\n .viewer-export-content .cad-shell,\n .viewer-export-content .cad-body,\n .viewer-export-content .cad-canvas-wrap,\n .viewer-export-content .dwg-preview-frame {\n position: relative !important;\n inset: auto !important;\n contain: none !important;\n width: 100% !important;\n height: auto !important;\n min-height: 0 !important;\n max-height: none !important;\n overflow: visible !important;\n }\n .viewer-export-content .docx-wrapper {\n display: block !important;\n padding: 0 !important;\n background: transparent !important;\n }\n .viewer-export-content .docx-canvas-wrapper {\n display: block !important;\n padding: 0 !important;\n background: transparent !important;\n }\n .viewer-export-content .docx-print-document {\n display: block !important;\n width: fit-content !important;\n max-width: 100% !important;\n height: auto !important;\n overflow: visible !important;\n margin: 0 auto !important;\n }\n .viewer-export-content .docx-page-frame {\n position: relative !important;\n width: var(--viewer-print-page-width, fit-content) !important;\n height: var(--viewer-print-page-height, auto) !important;\n min-height: var(--viewer-print-page-height, 0) !important;\n max-width: 100% !important;\n margin: 0 auto 18px !important;\n overflow: hidden !important;\n break-inside: avoid;\n page-break-inside: avoid;\n break-after: page;\n page-break-after: always;\n }\n .viewer-export-content .docx-canvas-sheet {\n position: relative !important;\n contain: none !important;\n width: var(--viewer-print-page-width, 794px) !important;\n height: var(--viewer-print-page-height, 1123px) !important;\n min-height: var(--viewer-print-page-height, 1123px) !important;\n max-width: 100% !important;\n margin: 0 auto 18px !important;\n overflow: hidden !important;\n box-shadow: none !important;\n break-inside: avoid;\n page-break-inside: avoid;\n break-after: page;\n page-break-after: always;\n }\n .viewer-export-content .docx-canvas-sheet > img {\n display: block !important;\n width: 100% !important;\n height: 100% !important;\n max-width: none !important;\n object-fit: fill;\n }\n .viewer-export-content .msdoc-page {\n position: relative !important;\n width: var(--viewer-print-page-width, 794px) !important;\n min-height: var(--viewer-print-page-height, 1123px) !important;\n max-width: 100% !important;\n height: auto !important;\n margin: 0 auto 18px !important;\n overflow: visible !important;\n break-after: page;\n page-break-after: always;\n }\n .viewer-export-content .docx-page-frame:last-child,\n .viewer-export-content .docx-canvas-sheet:last-child,\n .viewer-export-content .msdoc-page:last-child {\n break-after: auto;\n page-break-after: auto;\n }\n .viewer-export-content .docx-page-frame > section.docx {\n position: relative !important;\n top: auto !important;\n left: auto !important;\n width: var(--viewer-print-page-width, auto) !important;\n min-height: var(--viewer-print-page-height, auto) !important;\n max-width: none !important;\n margin: 0 auto !important;\n overflow: visible !important;\n transform: none !important;\n box-shadow: none !important;\n break-inside: avoid;\n page-break-inside: avoid;\n }\n .viewer-export-content .msdoc-stage {\n display: block !important;\n padding: 0 !important;\n background: transparent !important;\n }\n .viewer-export-content .msdoc-paged-view {\n display: block !important;\n gap: 0 !important;\n padding: 0 !important;\n background: transparent !important;\n }\n .viewer-export-content .msdoc-page > .msdoc-root {\n margin: 0 auto !important;\n box-shadow: none !important;\n overflow: visible !important;\n }\n .viewer-export-content .pdf-toolbar,\n .viewer-export-content .pdf-nav-pane,\n .viewer-export-content .viewer-actions,\n .viewer-export-content .code-toolbar,\n .viewer-export-content .umd-toolbar,\n .viewer-export-content .drawing-toolbar,\n .viewer-export-content .cad-toolbar {\n display: none !important;\n }\n .viewer-export-content .pdf-content,\n .viewer-export-content .pdf-shell--nav-hidden .pdf-content,\n .viewer-export-content .cad-body.without-layers {\n display: block !important;\n grid-template-columns: none !important;\n }\n .viewer-export-content .pdfViewer { padding: 0 !important; }\n .viewer-export-content .pdfViewer .page {\n margin: 0 auto 16px !important;\n border: 0 !important;\n box-shadow: none !important;\n break-after: page;\n page-break-after: always;\n }\n .viewer-export-content .pdfViewer .page:last-child {\n break-after: auto;\n page-break-after: auto;\n }\n .viewer-export-content .pdf-export-document {\n display: grid;\n justify-items: center;\n gap: 18px;\n padding: 4px 0;\n }\n .viewer-export-content .pdf-export-page {\n width: var(--viewer-print-page-width, auto);\n height: var(--viewer-print-page-height, auto);\n max-width: 100%;\n overflow: hidden;\n background: #ffffff;\n box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);\n break-inside: avoid;\n page-break-inside: avoid;\n break-after: page;\n page-break-after: always;\n }\n .viewer-export-content .pdf-export-page:last-child {\n break-after: auto;\n page-break-after: auto;\n }\n .viewer-export-content .pdf-export-page img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .viewer-export-content .pptx-wrapper {\n width: 100% !important;\n max-width: 100% !important;\n height: auto !important;\n overflow: visible !important;\n transform: none !important;\n }\n .viewer-export-content .pptx-wrapper .slide {\n margin: 0 auto 18px !important;\n break-inside: avoid;\n page-break-inside: avoid;\n break-after: page;\n page-break-after: always;\n box-shadow: none !important;\n }\n .viewer-export-content .pptx-wrapper .slide:last-child {\n break-after: auto;\n page-break-after: auto;\n }\n .viewer-export-content .ofd-stage {\n padding: 0 !important;\n overflow: visible !important;\n }\n .viewer-export-content .ofd-page,\n .viewer-export-content .drawing-svg,\n .viewer-export-content .cad-canvas-wrap,\n .viewer-export-content .dwg-preview-frame {\n break-inside: avoid;\n page-break-inside: avoid;\n break-after: page;\n page-break-after: always;\n box-shadow: none !important;\n }\n .viewer-export-content .ofd-page:last-child,\n .viewer-export-content .drawing-svg:last-child,\n .viewer-export-content .cad-canvas-wrap:last-child,\n .viewer-export-content .dwg-preview-frame:last-child {\n break-after: auto;\n page-break-after: auto;\n }\n .viewer-export-content .code-area {\n overflow: visible !important;\n white-space: pre-wrap !important;\n word-break: break-word !important;\n }\n .viewer-export-content .umd-body,\n .viewer-export-content .umd-stage-wrap,\n .viewer-export-content .umd-stage {\n display: block !important;\n height: auto !important;\n max-height: none !important;\n overflow: visible !important;\n }\n .viewer-export-content .umd-toc {\n display: none !important;\n }\n img, canvas, svg, video { max-width: 100%; }\n @media print {\n @page { margin: 12mm; }\n html, body { min-height: auto; background: #ffffff; }\n body { padding: 0; }\n .viewer-export-shell,\n .viewer-export-content {\n min-height: 0;\n overflow: visible;\n background: #ffffff;\n }\n .viewer-export-content .docx-print-document {\n width: auto !important;\n max-width: none !important;\n margin: 0 !important;\n }\n .viewer-export-content .pdf-export-document {\n display: block;\n padding: 0;\n }\n .viewer-export-content .pdf-export-page {\n width: var(--viewer-print-page-width, auto) !important;\n height: var(--viewer-print-page-height, auto) !important;\n max-width: none !important;\n margin: 0;\n overflow: hidden;\n box-shadow: none;\n }\n .viewer-export-content .docx-page-frame {\n width: var(--viewer-print-page-width, auto) !important;\n height: var(--viewer-print-page-height, auto) !important;\n min-height: var(--viewer-print-page-height, 0) !important;\n max-width: none !important;\n margin: 0 !important;\n overflow: hidden !important;\n }\n .viewer-export-content .docx-canvas-sheet {\n contain: none !important;\n width: var(--viewer-print-page-width, 794px) !important;\n height: var(--viewer-print-page-height, 1123px) !important;\n min-height: var(--viewer-print-page-height, 1123px) !important;\n max-width: none !important;\n margin: 0 !important;\n overflow: hidden !important;\n box-shadow: none !important;\n }\n .viewer-export-content .msdoc-page {\n width: var(--viewer-print-page-width, 794px) !important;\n min-height: var(--viewer-print-page-height, 1123px) !important;\n max-width: none !important;\n margin: 0 !important;\n overflow: visible !important;\n }\n .viewer-export-content .docx-page-frame > section.docx,\n .viewer-export-content .msdoc-page > .msdoc-root {\n width: var(--viewer-print-page-width, 100%) !important;\n max-width: none !important;\n border: 0 !important;\n }\n .viewer-export-content .pptx-wrapper .slide,\n .viewer-export-content .ofd-page,\n .viewer-export-content .drawing-svg,\n .viewer-export-content .cad-canvas-wrap,\n .viewer-export-content .dwg-preview-frame {\n box-shadow: none !important;\n }\n }\n", W = (e) => {
|
|
1130
|
+
let t = ft(e);
|
|
1098
1131
|
return t ? Array.from(t.querySelectorAll("style, link[rel=\"stylesheet\"]")).map((e) => {
|
|
1099
1132
|
var t;
|
|
1100
1133
|
if (e.localName.toLowerCase() === "style") return `<style>${e.textContent || ""}</style>`;
|
|
@@ -1106,32 +1139,32 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
1106
1139
|
return "";
|
|
1107
1140
|
}
|
|
1108
1141
|
}).filter(Boolean).join("\n") : "";
|
|
1109
|
-
},
|
|
1142
|
+
}, G = ({ contentHtml: e, includeDocumentStyles: n = !0, printStyle: r = "", title: i, watermarkInlineStyle: a = "", mask: o = null, documentRef: s }) => {
|
|
1110
1143
|
var c, l;
|
|
1111
|
-
let u = a ? `<div class="viewer-export-watermark" style="${
|
|
1112
|
-
regions: (c =
|
|
1113
|
-
stamps: (l =
|
|
1114
|
-
}) : null,
|
|
1144
|
+
let u = a ? `<div class="viewer-export-watermark" style="${ut(a)}"></div>` : "", m = d(o), h = m ? t(t({}, m), {}, {
|
|
1145
|
+
regions: (c = m.regions) == null ? void 0 : c.filter((e) => e.pageIndex === void 0),
|
|
1146
|
+
stamps: (l = m.stamps) == null ? void 0 : l.filter((e) => e.pageIndex === void 0)
|
|
1147
|
+
}) : null, g = p(h), te = f(e, m), ne = n ? W(s) : "", _ = r ? `<style data-viewer-print-style>${r}</style>` : "", v = m ? `<style data-viewer-print-mask-style>${ee}</style>` : "";
|
|
1115
1148
|
return `<!doctype html>
|
|
1116
1149
|
<html lang="zh-CN">
|
|
1117
1150
|
<head>
|
|
1118
1151
|
<meta charset="utf-8" />
|
|
1119
1152
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
1120
|
-
<title>${
|
|
1121
|
-
${
|
|
1122
|
-
<style>${
|
|
1123
|
-
${
|
|
1153
|
+
<title>${ut(i)}</title>
|
|
1154
|
+
${ne}
|
|
1155
|
+
<style>${Dt}</style>
|
|
1156
|
+
${v}
|
|
1124
1157
|
</head>
|
|
1125
1158
|
<body>
|
|
1126
1159
|
<main class="viewer-export-shell">
|
|
1127
|
-
<div class="viewer-export-content">${
|
|
1128
|
-
${
|
|
1160
|
+
<div class="viewer-export-content">${te}</div>
|
|
1161
|
+
${g}
|
|
1129
1162
|
${u}
|
|
1130
1163
|
</main>
|
|
1131
|
-
${
|
|
1164
|
+
${_}
|
|
1132
1165
|
</body>
|
|
1133
1166
|
</html>`;
|
|
1134
|
-
},
|
|
1167
|
+
}, K = (e) => U(G(e), e.documentRef), Ot = (e) => Et(G(e), e.documentRef), kt = function() {
|
|
1135
1168
|
var t = e(function* ({ source: e, mode: t = "export", title: n, adapter: r = null, watermarkInlineStyle: a = "", mask: s = null }) {
|
|
1136
1169
|
let l = {
|
|
1137
1170
|
mode: t,
|
|
@@ -1151,12 +1184,12 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
1151
1184
|
};
|
|
1152
1185
|
}
|
|
1153
1186
|
yield o(e, r);
|
|
1154
|
-
let
|
|
1155
|
-
|
|
1156
|
-
let
|
|
1187
|
+
let ee = e.cloneNode(!0);
|
|
1188
|
+
ee.querySelectorAll(".viewer-watermark").forEach((e) => e.remove()), c(e, ee);
|
|
1189
|
+
let m = yield i(r, l);
|
|
1157
1190
|
return {
|
|
1158
|
-
contentHtml: yield u(
|
|
1159
|
-
printStyle:
|
|
1191
|
+
contentHtml: yield u(ee.innerHTML),
|
|
1192
|
+
printStyle: m,
|
|
1160
1193
|
title: n,
|
|
1161
1194
|
watermarkInlineStyle: a,
|
|
1162
1195
|
mask: p,
|
|
@@ -1166,20 +1199,19 @@ var rt = nt(), B = (e) => e.replace(/&/g, "&").replace(/"/g, """).repla
|
|
|
1166
1199
|
return function(e) {
|
|
1167
1200
|
return t.apply(this, arguments);
|
|
1168
1201
|
};
|
|
1169
|
-
}(),
|
|
1202
|
+
}(), At = function() {
|
|
1170
1203
|
var t = e(function* (e) {
|
|
1171
|
-
return
|
|
1204
|
+
return K(yield kt(e));
|
|
1172
1205
|
});
|
|
1173
1206
|
return function(e) {
|
|
1174
1207
|
return t.apply(this, arguments);
|
|
1175
1208
|
};
|
|
1176
|
-
}(),
|
|
1209
|
+
}(), jt = function() {
|
|
1177
1210
|
var t = e(function* (e) {
|
|
1178
|
-
return
|
|
1211
|
+
return Ot(yield kt(e));
|
|
1179
1212
|
});
|
|
1180
1213
|
return function(e) {
|
|
1181
1214
|
return t.apply(this, arguments);
|
|
1182
1215
|
};
|
|
1183
1216
|
}();
|
|
1184
|
-
|
|
1185
|
-
export { wt as buildExportDomDocument, Ct as buildExportHtmlDocument, Et as buildFileViewerRenderedDomDocument, Tt as buildFileViewerRenderedHtmlDocument, xt as collectDocumentStyles, u as inlineFileViewerBlobUrlsInHtml, o as prepareFileViewerRenderedContentForSnapshot, c as replaceFileViewerCanvasWithImages, i as resolveFileViewerPrintStyle, K as sanitizeFileViewerExportDocumentDom, yt as sanitizeFileViewerExportDocumentHtml, n as triggerFileViewerBlobDownload, s as triggerFileViewerUrlDownload, l as waitForFileViewerImages, r as waitForFileViewerNextPaint, a as waitForFileViewerPrintWindowReady };
|
|
1217
|
+
export { Ot as buildExportDomDocument, K as buildExportHtmlDocument, jt as buildFileViewerRenderedDomDocument, At as buildFileViewerRenderedHtmlDocument, W as collectDocumentStyles, u as inlineFileViewerBlobUrlsInHtml, o as prepareFileViewerRenderedContentForSnapshot, c as replaceFileViewerCanvasWithImages, i as resolveFileViewerPrintStyle, Et as sanitizeFileViewerExportDocumentDom, U as sanitizeFileViewerExportDocumentHtml, n as triggerFileViewerBlobDownload, s as triggerFileViewerUrlDownload, l as waitForFileViewerImages, r as waitForFileViewerNextPaint, a as waitForFileViewerPrintWindowReady };
|