@sheetxl/io-xlsx 0.8.0-beta.7 → 1.0.0

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.
Files changed (215) hide show
  1. package/LICENSE.md +8 -7
  2. package/browser/esm/7rZlWcm56hn3Jmnk.mjs +7021 -0
  3. package/browser/esm/AZus_5slvoIVhf1u.mjs +10323 -0
  4. package/browser/esm/B9QfzGvsvg-V3utu.mjs +4632 -0
  5. package/browser/esm/{CX3yVwe-BnhCk4FY.mjs → BIR_Si489gIkGOnc.mjs} +194 -144
  6. package/browser/esm/BJFvc-i40R4rPZ5y.mjs +2433 -0
  7. package/browser/esm/{CGXxwkCRWLc0gcRQ.mjs → BX8Ebx4NC5zp7_3J.mjs} +3 -3
  8. package/browser/esm/{B4eKxNwxJjHLN126.mjs → Bnxw38IvtA04zXEE.mjs} +2 -2
  9. package/browser/esm/{DwcLXqv8-6Tl1zLO.mjs → CfVhYH77KdrR3fEK.mjs} +3 -3
  10. package/browser/esm/index.mjs +3 -4
  11. package/browser/esm/jIQks3Crw6jehdDU.mjs +2474 -0
  12. package/browser/esm/{DUi-V-E_AJwTIqlO.mjs → qc9hnuR2z-whY8YO.mjs} +3 -3
  13. package/browser/esm/wZGpmkMUubNjClhG.mjs +104 -0
  14. package/licenses/dependencies.txt +2 -2
  15. package/node/esm/{C51yFT2l-6il_xXO.mjs → BNLHWJHyy5eB0P_4.mjs} +2 -2
  16. package/node/esm/CVtsY2F9A9NzEGLk.mjs +2478 -0
  17. package/node/esm/CoeQ0LO-nNXiowwv.mjs +7284 -0
  18. package/node/esm/CxY3iIYLXVhCebeV.mjs +4746 -0
  19. package/node/esm/D2CZy9TQM9h2uqBh.mjs +2562 -0
  20. package/node/esm/{CMq7eF1vxibUumqT.mjs → Dm0hvKcR4xb0TV_N.mjs} +3 -3
  21. package/node/esm/_IA1gQ-zFQYQSZSs.mjs +6957 -0
  22. package/node/esm/index.mjs +65 -28
  23. package/node/esm/{DLBm8l0jyL2fVlxg.mjs → zZFe3mW0xjmobowq.mjs} +3 -3
  24. package/package.json +9 -10
  25. package/types/src/AutoFilterRules.d.ts +85 -22
  26. package/types/src/ConditionalFormatRules.d.ts +2 -2
  27. package/types/src/DataTableFormula.d.ts +26 -0
  28. package/types/src/DataValidationRules.d.ts +0 -5
  29. package/types/src/DefinedNameAttributes.d.ts +8 -0
  30. package/types/src/ExcelCalcStamp.d.ts +0 -36
  31. package/types/src/ExcelCompat.d.ts +15 -143
  32. package/types/src/ExcelFunctionFacts.d.ts +0 -272
  33. package/types/src/ExcelReservedNames.d.ts +0 -65
  34. package/types/src/KnownFonts.d.ts +37 -0
  35. package/types/src/LegacyFormula.d.ts +1 -46
  36. package/types/src/OOXMLExtensions.d.ts +30 -2
  37. package/types/src/PageLayoutAttributes.d.ts +8 -0
  38. package/types/src/Plugin.d.ts +15 -3
  39. package/types/src/ProtectionAttributes.d.ts +2 -2
  40. package/types/src/SheetKinds.d.ts +42 -0
  41. package/types/src/SheetViewAttributes.d.ts +4 -0
  42. package/types/src/SortExtent.d.ts +16 -0
  43. package/types/src/SourcePackage.d.ts +0 -44
  44. package/types/src/SparklineGroups.d.ts +52 -0
  45. package/types/src/Types.d.ts +13 -3
  46. package/types/src/XlsxHeader.d.ts +19 -0
  47. package/types/src/chart/ChartExXml.d.ts +38 -0
  48. package/types/src/chart/ChartPartXml.d.ts +47 -0
  49. package/types/src/chart/ChartSpaceXml.d.ts +37 -0
  50. package/types/src/chart/_XmlTree.d.ts +34 -0
  51. package/types/src/chart/_chartCodecs.d.ts +12 -0
  52. package/types/src/chart/_chartExCodecs.d.ts +7 -0
  53. package/types/src/chart/_chartExFold.d.ts +14 -0
  54. package/types/src/chart/_chartExMarkup.d.ts +236 -0
  55. package/types/src/chart/_chartExStyle.d.ts +13 -0
  56. package/types/src/chart/_codec.d.ts +78 -0
  57. package/types/src/chart/_drawingml.d.ts +10 -0
  58. package/types/src/chart/_xml.d.ts +70 -0
  59. package/types/src/pivot/PivotArea.d.ts +20 -0
  60. package/types/src/pivot/PivotCacheRead.d.ts +30 -0
  61. package/types/src/pivot/PivotCacheWrite.d.ts +23 -0
  62. package/types/src/pivot/PivotFilters.d.ts +29 -0
  63. package/types/src/pivot/PivotFormats.d.ts +60 -0
  64. package/types/src/pivot/PivotTableRead.d.ts +44 -0
  65. package/types/src/pivot/PivotTableWrite.d.ts +13 -0
  66. package/types/src/pivot/_PivotCacheXml.d.ts +48 -0
  67. package/types/src/pivot/_PivotTableXml.d.ts +23 -0
  68. package/types/src/reader/CellControls.d.ts +18 -0
  69. package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
  70. package/types/src/reader/DummyFunctionUnwrap.d.ts +43 -23
  71. package/types/src/reader/HeaderStyles.d.ts +15 -0
  72. package/types/src/reader/IsoDateCell.d.ts +20 -0
  73. package/types/src/reader/LibreOfficeDataTable.d.ts +12 -0
  74. package/types/src/reader/PivotButtons.d.ts +14 -0
  75. package/types/src/reader/PivotCellFormats.d.ts +22 -0
  76. package/types/src/reader/SlicerJoin.d.ts +26 -0
  77. package/types/src/reader/ZipReader.d.ts +1 -1
  78. package/types/src/reader/_SlicerRecord.d.ts +59 -0
  79. package/types/src/reader/dom/CustGeomUtils.d.ts +7 -0
  80. package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
  81. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
  82. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +8 -3
  83. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +15 -2
  84. package/types/src/reader/domVisitors/CommentVisitor.d.ts +2 -2
  85. package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
  86. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +30 -1
  87. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
  88. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +14 -2
  89. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +30 -2
  90. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
  91. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +10 -0
  92. package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +1 -11
  93. package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +18 -0
  94. package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +0 -11
  95. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
  96. package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
  97. package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
  98. package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
  99. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
  100. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +26 -5
  101. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +11 -2
  102. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +9 -3
  103. package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
  104. package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
  105. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  106. package/types/src/reader/domVisitors/TimelinesVisitor.d.ts +13 -0
  107. package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +0 -9
  108. package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
  109. package/types/src/reader/domVisitors/index.d.ts +10 -36
  110. package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +1 -0
  111. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +31 -6
  112. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +26 -8
  113. package/types/src/richValue/ErrorRichValueHandler.d.ts +22 -0
  114. package/types/src/richValue/IRichValueHandler.d.ts +109 -0
  115. package/types/src/richValue/LocalImageRichValueHandler.d.ts +18 -0
  116. package/types/src/richValue/RichDataParts.d.ts +69 -0
  117. package/types/src/richValue/RichRecordWriter.d.ts +61 -0
  118. package/types/src/richValue/RichValueHandlers.d.ts +25 -0
  119. package/types/src/richValue/RichValueResolver.d.ts +54 -0
  120. package/types/src/richValue/WebImageRichValueHandler.d.ts +37 -0
  121. package/types/src/richValue/index.d.ts +7 -0
  122. package/types/src/utils/DrawingMLText.d.ts +39 -0
  123. package/types/src/utils/FormControls.d.ts +170 -0
  124. package/types/src/utils/SharedNames.d.ts +13 -0
  125. package/types/src/utils/SpreadsheetFont.d.ts +38 -0
  126. package/types/src/utils/VmlNoteShapes.d.ts +25 -32
  127. package/types/src/utils/VmlNoteStyle.d.ts +25 -0
  128. package/types/src/utils/VmlPrefixes.d.ts +24 -0
  129. package/types/src/vba/VBAProject.d.ts +0 -19
  130. package/types/src/writer/EvaluationSheet.d.ts +5 -0
  131. package/types/src/writer/builder/Emitter.d.ts +5 -0
  132. package/types/src/writer/builder/OpcXmlUtils.d.ts +0 -8
  133. package/types/src/writer/builder/PackageBuilder.d.ts +4 -41
  134. package/types/src/writer/builder/Types.d.ts +28 -28
  135. package/types/src/writer/emitters/CommentsEmitter.d.ts +3 -3
  136. package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
  137. package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +0 -11
  138. package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +8 -0
  139. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
  140. package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
  141. package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
  142. package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
  143. package/types/src/writer/emitters/RichValuePartsEmitters.d.ts +36 -0
  144. package/types/src/writer/emitters/RichValueRelEmitter.d.ts +12 -0
  145. package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +4 -3
  146. package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +3 -2
  147. package/types/src/writer/emitters/RichValueWebImageEmitter.d.ts +24 -0
  148. package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
  149. package/types/src/writer/emitters/SlicerEmitter.d.ts +132 -0
  150. package/types/src/writer/emitters/StylesEmitter.d.ts +35 -2
  151. package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
  152. package/types/src/writer/emitters/WorkbookEmitter.d.ts +24 -2
  153. package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
  154. package/types/src/writer/utils/AutoFilter.d.ts +3 -3
  155. package/types/src/writer/utils/CellControlComplements.d.ts +29 -0
  156. package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
  157. package/types/src/writer/utils/DateSystem.d.ts +6 -0
  158. package/types/src/writer/utils/DefaultRows.d.ts +22 -0
  159. package/types/src/writer/utils/DrawMLUtils.d.ts +42 -3
  160. package/types/src/writer/utils/DummyFunction.d.ts +0 -25
  161. package/types/src/writer/utils/DxfCollector.d.ts +14 -11
  162. package/types/src/writer/utils/PrstGeomUtils.d.ts +14 -0
  163. package/types/src/writer/utils/RichValueCollector.d.ts +81 -129
  164. package/types/src/writer/utils/SheetStyleLayout.d.ts +86 -0
  165. package/types/src/writer/utils/TextUtils.d.ts +26 -2
  166. package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
  167. package/types/src/writer/utils/XfVariants.d.ts +61 -0
  168. package/browser/cjs/17tMBnuyu4YIxixh.cjs +0 -1
  169. package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
  170. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
  171. package/browser/cjs/BxU-OlZIQViQl7gX.cjs +0 -1
  172. package/browser/cjs/CDs8etXnw0kbBKKv.cjs +0 -1
  173. package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
  174. package/browser/cjs/CycnxkfuKrDdwoJN.cjs +0 -5
  175. package/browser/cjs/D3EWCPfCu-qMOIGd.cjs +0 -1
  176. package/browser/cjs/DHKWtqZ0vQfXrbq1.cjs +0 -2
  177. package/browser/cjs/MqKQ_B5qRARrRbO4.cjs +0 -24
  178. package/browser/cjs/index.cjs +0 -1
  179. package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
  180. package/browser/esm/9n64lXAgZUe3aThr.mjs +0 -159
  181. package/browser/esm/BsNoW41d6hdpxTTS.mjs +0 -67
  182. package/browser/esm/BvAptAMpZVyBCx6-.mjs +0 -2402
  183. package/browser/esm/CjKioy-GzeSf08f8.mjs +0 -3326
  184. package/browser/esm/cJxidonaVNZHAXiZ.mjs +0 -4532
  185. package/browser/esm/dsVZVtt5w_yLb967.mjs +0 -5300
  186. package/node/esm/BRQYaMYO4UfhjJHw.mjs +0 -170
  187. package/node/esm/BlbtH3EvAf3K4foF.mjs +0 -2450
  188. package/node/esm/DhSPOg9wN0kD87Tb.mjs +0 -3051
  189. package/node/esm/KeV-N47eTyh5YE70.mjs +0 -4642
  190. package/node/esm/s_yVG0m9KB14YKeN.mjs +0 -3412
  191. package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
  192. package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
  193. package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
  194. package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
  195. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
  196. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
  197. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
  198. package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
  199. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
  200. package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
  201. package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
  202. package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
  203. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
  204. package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
  205. package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
  206. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
  207. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
  208. package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +0 -7
  209. package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +0 -6
  210. package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
  211. package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
  212. package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
  213. package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
  214. package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
  215. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.7
2
+ * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v1.0.0
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
5
+ * License: SheetXL EULA — https://www.sheetxl.com/eula
6
6
  */
7
- import { t as e } from "./DwcLXqv8-6Tl1zLO.mjs";
7
+ import { t as e } from "./CfVhYH77KdrR3fEK.mjs";
8
8
  var t = e((e) => {
9
9
  function t(e, t) {
10
10
  return t === void 0 && (t = Object), t && typeof t.getOwnPropertyDescriptors == "function" && (e = t.create(null, t.getOwnPropertyDescriptors(e))), t && typeof t.freeze == "function" ? t.freeze(e) : e;
@@ -191,8 +191,8 @@ var t = e((e) => {
191
191
  INVALID_NODE_TYPE_ERR: 24,
192
192
  DATA_CLONE_ERR: 25
193
193
  }, c = Object.entries(s), l = 0; l < c.length; l++) o[c[l][0]] = c[l][1];
194
- function u(e, t) {
195
- this.message = e, this.locator = t, Error.captureStackTrace && Error.captureStackTrace(this, u);
194
+ function u(e, t, n) {
195
+ this.message = e, this.locator = t, this.cause = n, Error.captureStackTrace && Error.captureStackTrace(this, u);
196
196
  }
197
197
  n(u), e.DOMException = o, e.DOMExceptionName = r, e.ExceptionCode = s, e.ParseError = u;
198
198
  }), r = e((e) => {
@@ -222,7 +222,7 @@ var t = e((e) => {
222
222
  var n = typeof e == "string";
223
223
  if (n && t === void 0 && e === "|") throw Error("use regg instead of reg to wrap expressions with `|`!");
224
224
  return n ? e : e.source;
225
- }).join(""), n ? "mu" : "m");
225
+ }).join(""), n ? "u" : "");
226
226
  }
227
227
  function o(e) {
228
228
  if (arguments.length === 0) throw Error("no parameters provided");
@@ -232,8 +232,8 @@ var t = e((e) => {
232
232
  n && (s = a("[", r(s), "\\u{10000}-\\u{10FFFF}", "]"));
233
233
  var c = RegExp("[^" + r(s) + "]", n ? "u" : ""), l = /[\x20\x09\x0D\x0A]/, u = r(l), d = a(l, "+"), f = a(l, "*"), p = /[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
234
234
  n && (p = a("[", r(p), "\\u{10000}-\\u{10FFFF}", "]"));
235
- var m = a("[", r(p), r(/[-.0-9\xB7]/), r(/[\u0300-\u036F\u203F-\u2040]/), "]"), h = a(p, m, "*"), g = a(m, "+"), _ = o(a("&", h, ";"), "|", o(/&#[0-9]+;|&#x[0-9a-fA-F]+;/)), v = a("%", h, ";"), y = o(a("\"", o(/[^%&"]/, "|", v, "|", _), "*", "\""), "|", a("'", o(/[^%&']/, "|", v, "|", _), "*", "'")), b = o("\"", o(/[^<&"]/, "|", _), "*", "\"", "|", "'", o(/[^<&']/, "|", _), "*", "'"), x = a(i(p, ":"), i(m, ":"), "*"), S = a(x, o(":", x), "?"), C = a("^", S, "$"), w = a("(", S, ")"), T = o(/"[^"]*"|'[^']*'/), E = a(/^<\?/, "(", h, ")", o(d, "(", s, "*?)"), "?", /\?>/), D = /[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/, O = o("\"", D, "*\"", "|", "'", i(D, "'"), "*'"), k = "<!--", A = a(k, o(i(s, "-"), "|", a("-", i(s, "-"))), "*", "-->"), j = "#PCDATA", M = o("EMPTY", "|", "ANY", "|", o(a(/\(/, f, j, o(f, /\|/, f, S), "*", f, /\)\*/), "|", a(/\(/, f, j, f, /\)/)), "|", a(/\([^>]+\)/, /[?*+]?/)), ee = a("<!ELEMENT", d, o(S, "|", v), d, o(M, "|", v), f, ">"), N = a("<!ATTLIST", d, h, o(d, h, d, o(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/, "|", o(a("NOTATION", d, /\(/, f, h, o(f, /\|/, f, h), "*", f, /\)/), "|", a(/\(/, f, g, o(f, /\|/, f, g), "*", f, /\)/))), d, o(/#REQUIRED|#IMPLIED/, "|", o(o("#FIXED", d), "?", b))), "*", f, ">"), P = "about:legacy-compat", F = o("\"" + P + "\"", "|", "'" + P + "'"), I = "SYSTEM", L = "PUBLIC", R = o(o(I, d, T), "|", o(L, d, O, d, T)), z = a("^", o(o(I, d, "(?<SystemLiteralOnly>", T, ")"), "|", o(L, d, "(?<PubidLiteral>", O, ")", d, "(?<SystemLiteral>", T, ")"))), B = a("^", O, "$"), V = a("^", T, "$"), H = o(y, "|", o(R, o(d, "NDATA", d, h), "?")), U = "<!ENTITY", W = o(a(U, d, h, d, H, f, ">"), "|", a(U, d, "%", d, h, d, o(y, "|", R), f, ">")), te = a("<!NOTATION", d, h, d, o(R, "|", a(L, d, O)), f, ">"), G = a(f, "=", f), K = /1[.]\d+/, ne = a(d, "version", G, o("'", K, "'", "|", "\"", K, "\"")), q = /[A-Za-z][-A-Za-z0-9._]*/, re = a(/^<\?xml/, ne, o(d, "encoding", G, o("\"", q, "\"", "|", "'", q, "'")), "?", o(d, "standalone", G, o("'", o("yes", "|", "no"), "'", "|", "\"", o("yes", "|", "no"), "\"")), "?", f, /\?>/), ie = a(/<!\[CDATA\[/, a(s, "*?", /\]\]>/));
236
- e.chars = r, e.chars_without = i, e.detectUnicodeSupport = t, e.reg = a, e.regg = o, e.ABOUT_LEGACY_COMPAT = P, e.ABOUT_LEGACY_COMPAT_SystemLiteral = F, e.AttlistDecl = N, e.CDATA_START = "<![CDATA[", e.CDATA_END = "]]>", e.CDSect = ie, e.Char = s, e.Comment = A, e.COMMENT_START = k, e.COMMENT_END = "-->", e.DOCTYPE_DECL_START = "<!DOCTYPE", e.elementdecl = ee, e.EntityDecl = W, e.EntityValue = y, e.ExternalID = R, e.ExternalID_match = z, e.Name = h, e.NotationDecl = te, e.Reference = _, e.PEReference = v, e.PI = E, e.PUBLIC = L, e.PubidLiteral = O, e.PubidLiteral_match = B, e.QName = S, e.QName_exact = C, e.QName_group = w, e.S = d, e.SChar_s = u, e.S_OPT = f, e.SYSTEM = I, e.SystemLiteral = T, e.SystemLiteral_match = V, e.InvalidChar = c, e.UNICODE_REPLACEMENT_CHARACTER = "�", e.UNICODE_SUPPORT = n, e.XMLDecl = re;
235
+ var m = a("[", r(p), r(/[-.0-9\xB7]/), r(/[\u0300-\u036F\u203F-\u2040]/), "]"), h = a(p, m, "*"), g = a("^", h, "$"), _ = a(m, "+"), v = o(a("&", h, ";"), "|", o(/&#[0-9]+;|&#x[0-9a-fA-F]+;/)), y = a("%", h, ";"), b = o(a("\"", o(/[^%&"]/, "|", y, "|", v), "*", "\""), "|", a("'", o(/[^%&']/, "|", y, "|", v), "*", "'")), x = o("\"", o(/[^<&"]/, "|", v), "*", "\"", "|", "'", o(/[^<&']/, "|", v), "*", "'"), S = a(i(p, ":"), i(m, ":"), "*"), C = a("^", S, "$"), w = a(S, o(":", S), "?"), T = a("^", w, "$"), E = a("(", w, ")"), D = o(/"[^"]*"|'[^']*'/), O = a(/^<\?/, "(", h, ")", o(d, "(?!", l, ")(", s, "*?)"), "?", /\?>/), k = /[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/, A = o("\"", k, "*\"", "|", "'", i(k, "'"), "*'"), j = "<!--", M = a(j, o(i(s, "-"), "|", a("-", i(s, "-"))), "*", "-->"), ee = "#PCDATA", N = o("EMPTY", "|", "ANY", "|", o(a(/\(/, f, ee, o(f, /\|/, f, w), "*", f, /\)\*/), "|", a(/\(/, f, ee, f, /\)/)), "|", a(/\([^>]+\)/, /[?*+]?/)), P = a("<!ELEMENT", d, o(w, "|", y), d, o(N, "|", y), f, ">"), F = a("<!ATTLIST", d, h, o(d, h, d, o(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/, "|", o(a("NOTATION", d, /\(/, f, h, o(f, /\|/, f, h), "*", f, /\)/), "|", a(/\(/, f, _, o(f, /\|/, f, _), "*", f, /\)/))), d, o(/#REQUIRED|#IMPLIED/, "|", o(o("#FIXED", d), "?", x))), "*", f, ">"), I = "about:legacy-compat", L = o("\"" + I + "\"", "|", "'" + I + "'"), R = "SYSTEM", z = "PUBLIC", B = o(o(R, d, D), "|", o(z, d, A, d, D)), V = a("^", o(o(R, d, "(?<SystemLiteralOnly>", D, ")"), "|", o(z, d, "(?<PubidLiteral>", A, ")", d, "(?<SystemLiteral>", D, ")"))), H = a("^", A, "$"), U = a("^", D, "$"), W = o(b, "|", o(B, o(d, "NDATA", d, h), "?")), G = "<!ENTITY", te = o(a(G, d, h, d, W, f, ">"), "|", a(G, d, "%", d, h, d, o(b, "|", B), f, ">")), ne = a("<!NOTATION", d, h, d, o(B, "|", a(z, d, A)), f, ">"), K = a(f, "=", f), re = /1[.]\d+/, q = a(d, "version", K, o("'", re, "'", "|", "\"", re, "\"")), ie = /[A-Za-z][-A-Za-z0-9._]*/, ae = a(/^<\?xml/, q, o(d, "encoding", K, o("\"", ie, "\"", "|", "'", ie, "'")), "?", o(d, "standalone", K, o("'", o("yes", "|", "no"), "'", "|", "\"", o("yes", "|", "no"), "\"")), "?", f, /\?>/), J = a(/<!\[CDATA\[/, a(s, "*?", /\]\]>/));
236
+ e.chars = r, e.chars_without = i, e.detectUnicodeSupport = t, e.reg = a, e.regg = o, e.ABOUT_LEGACY_COMPAT = I, e.ABOUT_LEGACY_COMPAT_SystemLiteral = L, e.AttlistDecl = F, e.CDATA_START = "<![CDATA[", e.CDATA_END = "]]>", e.CDSect = J, e.Char = s, e.Comment = M, e.COMMENT_START = j, e.COMMENT_END = "-->", e.DOCTYPE_DECL_START = "<!DOCTYPE", e.elementdecl = P, e.EntityDecl = te, e.EntityValue = b, e.ExternalID = B, e.ExternalID_match = V, e.Name = h, e.Name_exact = g, e.NCName_exact = C, e.NotationDecl = ne, e.Reference = v, e.PEReference = y, e.PI = O, e.PUBLIC = z, e.PubidLiteral = A, e.PubidLiteral_match = H, e.QName = w, e.QName_exact = T, e.QName_group = E, e.S = d, e.SChar_s = u, e.S_OPT = f, e.SYSTEM = R, e.SystemLiteral = D, e.SystemLiteral_match = U, e.InvalidChar = c, e.UNICODE_REPLACEMENT_CHARACTER = "�", e.UNICODE_SUPPORT = n, e.XMLDecl = ae;
237
237
  }), i = e((e) => {
238
238
  var i = t(), a = i.find, o = i.hasDefaultHTMLNamespace, s = i.hasOwn, c = i.isHTMLMimeType, l = i.isHTMLRawTextElement, u = i.isHTMLVoidElement, d = i.MIME_TYPE, f = i.NAMESPACE, p = Symbol(), m = n(), h = m.DOMException, g = m.DOMExceptionName, _ = r();
239
239
  function v(e) {
@@ -311,44 +311,55 @@ var t = e((e) => {
311
311
  var t = e._node._inc || e._node.ownerDocument._inc;
312
312
  if (e._inc !== t) {
313
313
  var n = e._refresh(e._node);
314
- if (je(e, "length", n.length), !e.$$length || n.length < e.$$length) for (var r = n.length; r in e; r++) s(e, r) && delete e[r];
314
+ if (Me(e, "length", n.length), !e.$$length || n.length < e.$$length) for (var r = n.length; r in e; r++) s(e, r) && delete e[r];
315
315
  w(n, e), e._inc = t;
316
316
  }
317
317
  }
318
- function W() {}
319
- function te(e, t) {
318
+ function W() {
319
+ this._nsIndex = Object.create(null), this._noNsIndex = Object.create(null);
320
+ }
321
+ function G(e, t) {
320
322
  for (var n = 0; n < e.length;) {
321
323
  if (e[n] === t) return n;
322
324
  n++;
323
325
  }
324
326
  }
325
- function G(e, t, n, r) {
326
- if (r ? t[te(t, r)] = n : (t[t.length] = n, t.length++), e) {
327
+ function te(e, t, n) {
328
+ if (!t) return e._noNsIndex;
329
+ var r = e._nsIndex[t];
330
+ return !r && n && (r = e._nsIndex[t] = Object.create(null)), r;
331
+ }
332
+ function ne(e, t, n, r) {
333
+ var i;
334
+ if (r ? t[G(t, r)] = n : (t[t.length] = n, t.length++), te(t, (i = n).namespaceURI, !0)[i.localName] = i, e) {
327
335
  n.ownerElement = e;
328
- var i = e.ownerDocument;
329
- i && (r && ae(i, e, r), function(e, t, n) {
336
+ var a = e.ownerDocument;
337
+ a && (r && oe(a, e, r), function(e, t, n) {
330
338
  e && e._inc++, n.namespaceURI === f.XMLNS && (t._nsMap[n.prefix ? n.localName : ""] = n.value);
331
- }(i, e, n));
339
+ }(a, e, n));
332
340
  }
333
341
  }
334
342
  function K(e, t, n) {
335
- var r = te(t, n);
343
+ var r = G(t, n);
336
344
  if (r >= 0) {
337
345
  for (var i = t.length - 1; r <= i;) t[r] = t[++r];
338
- if (t.length = i, e) {
346
+ if (t.length = i, function(e, t) {
347
+ var n = te(e, t.namespaceURI, !1);
348
+ n && delete n[t.localName];
349
+ }(t, n), e) {
339
350
  var a = e.ownerDocument;
340
- a && ae(a, e, n), n.ownerElement = null;
351
+ a && oe(a, e, n), n.ownerElement = null;
341
352
  }
342
353
  }
343
354
  }
344
- function ne() {}
355
+ function re() {}
345
356
  function q(e) {
346
357
  v(e);
347
358
  }
348
- function re(e) {
359
+ function ie(e) {
349
360
  return (e == "<" ? "&lt;" : e == ">" && "&gt;") || e == "&" && "&amp;" || e == "\"" && "&quot;" || "&#" + e.charCodeAt() + ";";
350
361
  }
351
- function ie(e, t) {
362
+ function ae(e, t) {
352
363
  J(e, null, { enter: function(e) {
353
364
  return !t(e) || J.STOP;
354
365
  } });
@@ -381,10 +392,10 @@ var t = e((e) => {
381
392
  var n = t || {};
382
393
  this.ownerDocument = this, this.contentType = n.contentType || d.XML_APPLICATION, this.type = c(this.contentType) ? "html" : "xml";
383
394
  }
384
- function ae(e, t, n, r) {
395
+ function oe(e, t, n, r) {
385
396
  e && e._inc++, n.namespaceURI === f.XMLNS && delete t._nsMap[n.prefix ? n.localName : ""];
386
397
  }
387
- function oe(e, t, n) {
398
+ function se(e, t, n) {
388
399
  if (e && e._inc) {
389
400
  e._inc++;
390
401
  var r = t.childNodes;
@@ -395,10 +406,10 @@ var t = e((e) => {
395
406
  }
396
407
  }
397
408
  }
398
- function se(e, t) {
409
+ function ce(e, t) {
399
410
  if (e !== t.parentNode) throw new h(h.NOT_FOUND_ERR, "child's parent is not parent");
400
411
  var n = t.previousSibling, r = t.nextSibling;
401
- return n ? n.nextSibling = r : e.firstChild = r, r ? r.previousSibling = n : e.lastChild = n, oe(e.ownerDocument, e), t.parentNode = null, t.previousSibling = null, t.nextSibling = null, t;
412
+ return n ? n.nextSibling = r : e.firstChild = r, r ? r.previousSibling = n : e.lastChild = n, se(e.ownerDocument, e), t.parentNode = null, t.previousSibling = null, t.nextSibling = null, t;
402
413
  }
403
414
  function X(e) {
404
415
  return e && e.nodeType === q.DOCUMENT_TYPE_NODE;
@@ -406,16 +417,16 @@ var t = e((e) => {
406
417
  function Z(e) {
407
418
  return e && e.nodeType === q.ELEMENT_NODE;
408
419
  }
409
- function ce(e) {
420
+ function le(e) {
410
421
  return e && e.nodeType === q.TEXT_NODE;
411
422
  }
412
- function le(e, t) {
423
+ function ue(e, t) {
413
424
  var n = e.childNodes || [];
414
425
  if (a(n, Z) || X(t)) return !1;
415
426
  var r = a(n, X);
416
427
  return !(t && r && n.indexOf(r) > n.indexOf(t));
417
428
  }
418
- function ue(e, t) {
429
+ function de(e, t) {
419
430
  var n = e.childNodes || [];
420
431
  if (a(n, function(e) {
421
432
  return Z(e) && e !== t;
@@ -423,7 +434,7 @@ var t = e((e) => {
423
434
  var r = a(n, X);
424
435
  return !(t && r && n.indexOf(r) > n.indexOf(t));
425
436
  }
426
- function de(e, t, n) {
437
+ function fe(e, t, n) {
427
438
  if (!function(e) {
428
439
  return e && (e.nodeType === q.DOCUMENT_NODE || e.nodeType === q.DOCUMENT_FRAGMENT_NODE || e.nodeType === q.ELEMENT_NODE);
429
440
  }(e)) throw new h(h.HIERARCHY_REQUEST_ERR, "Unexpected parent node type " + e.nodeType);
@@ -432,14 +443,14 @@ var t = e((e) => {
432
443
  return e && (e.nodeType === q.CDATA_SECTION_NODE || e.nodeType === q.COMMENT_NODE || e.nodeType === q.DOCUMENT_FRAGMENT_NODE || e.nodeType === q.DOCUMENT_TYPE_NODE || e.nodeType === q.ELEMENT_NODE || e.nodeType === q.PROCESSING_INSTRUCTION_NODE || e.nodeType === q.TEXT_NODE);
433
444
  }(t) || X(t) && e.nodeType !== q.DOCUMENT_NODE) throw new h(h.HIERARCHY_REQUEST_ERR, "Unexpected node type " + t.nodeType + " for parent node type " + e.nodeType);
434
445
  }
435
- function fe(e, t, n) {
446
+ function pe(e, t, n) {
436
447
  var r = e.childNodes || [], i = t.childNodes || [];
437
448
  if (t.nodeType === q.DOCUMENT_FRAGMENT_NODE) {
438
449
  var o = i.filter(Z);
439
- if (o.length > 1 || a(i, ce)) throw new h(h.HIERARCHY_REQUEST_ERR, "More than one element or text in fragment");
440
- if (o.length === 1 && !le(e, n)) throw new h(h.HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype");
450
+ if (o.length > 1 || a(i, le)) throw new h(h.HIERARCHY_REQUEST_ERR, "More than one element or text in fragment");
451
+ if (o.length === 1 && !ue(e, n)) throw new h(h.HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype");
441
452
  }
442
- if (Z(t) && !le(e, n)) throw new h(h.HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype");
453
+ if (Z(t) && !ue(e, n)) throw new h(h.HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype");
443
454
  if (X(t)) {
444
455
  if (a(r, X)) throw new h(h.HIERARCHY_REQUEST_ERR, "Only one doctype is allowed");
445
456
  var s = a(r, Z);
@@ -447,14 +458,14 @@ var t = e((e) => {
447
458
  if (!n && s) throw new h(h.HIERARCHY_REQUEST_ERR, "Doctype can not be appended since element is present");
448
459
  }
449
460
  }
450
- function pe(e, t, n) {
461
+ function me(e, t, n) {
451
462
  var r = e.childNodes || [], i = t.childNodes || [];
452
463
  if (t.nodeType === q.DOCUMENT_FRAGMENT_NODE) {
453
464
  var o = i.filter(Z);
454
- if (o.length > 1 || a(i, ce)) throw new h(h.HIERARCHY_REQUEST_ERR, "More than one element or text in fragment");
455
- if (o.length === 1 && !ue(e, n)) throw new h(h.HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype");
465
+ if (o.length > 1 || a(i, le)) throw new h(h.HIERARCHY_REQUEST_ERR, "More than one element or text in fragment");
466
+ if (o.length === 1 && !de(e, n)) throw new h(h.HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype");
456
467
  }
457
- if (Z(t) && !ue(e, n)) throw new h(h.HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype");
468
+ if (Z(t) && !de(e, n)) throw new h(h.HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype");
458
469
  if (X(t)) {
459
470
  function e(e) {
460
471
  return X(e) && e !== n;
@@ -464,8 +475,8 @@ var t = e((e) => {
464
475
  if (n && r.indexOf(s) < r.indexOf(n)) throw new h(h.HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element");
465
476
  }
466
477
  }
467
- function me(e, t, n, r) {
468
- de(e, t, n), e.nodeType === q.DOCUMENT_NODE && (r || fe)(e, t, n);
478
+ function he(e, t, n, r) {
479
+ fe(e, t, n), e.nodeType === q.DOCUMENT_NODE && (r || pe)(e, t, n);
469
480
  var i = t.parentNode;
470
481
  if (i && i.removeChild(t), t.nodeType === I) {
471
482
  var a = t.firstChild;
@@ -477,18 +488,15 @@ var t = e((e) => {
477
488
  do
478
489
  a.parentNode = e;
479
490
  while (a !== o && (a = a.nextSibling));
480
- return oe(e.ownerDocument || e, e, t), t.nodeType == I && (t.firstChild = t.lastChild = null), t;
491
+ return se(e.ownerDocument || e, e, t), t.nodeType == I && (t.firstChild = t.lastChild = null), t;
481
492
  }
482
493
  function Q(e) {
483
494
  v(e), this._nsMap = Object.create(null);
484
495
  }
485
- function $(e) {
496
+ function ge(e) {
486
497
  v(e), this.namespaceURI = null, this.prefix = null, this.ownerElement = null;
487
498
  }
488
- function he(e) {
489
- v(e);
490
- }
491
- function ge(e) {
499
+ function $(e) {
492
500
  v(e);
493
501
  }
494
502
  function _e(e) {
@@ -515,8 +523,11 @@ var t = e((e) => {
515
523
  function we(e) {
516
524
  v(e);
517
525
  }
518
- function Te() {}
519
- function Ee(e) {
526
+ function Te(e) {
527
+ v(e);
528
+ }
529
+ function Ee() {}
530
+ function De(e) {
520
531
  var t = typeof e == "function" ? {
521
532
  requireWellFormed: !1,
522
533
  splitCDATASections: !0,
@@ -534,9 +545,9 @@ var t = e((e) => {
534
545
  namespace: a,
535
546
  prefix: null
536
547
  }];
537
- return ke(this, n, o, t), n.join("");
548
+ return Ae(this, n, o, t), n.join("");
538
549
  }
539
- function De(e, t, n) {
550
+ function Oe(e, t, n) {
540
551
  var r = e.prefix || "", i = e.namespaceURI;
541
552
  if (!i || r === "xml" && i === f.XML || i === f.XMLNS) return !1;
542
553
  for (var a = n.length; a--;) {
@@ -545,10 +556,11 @@ var t = e((e) => {
545
556
  }
546
557
  return !0;
547
558
  }
548
- function Oe(e, t, n) {
549
- e.push(" ", t, "=\"", n.replace(/[<>&"\t\n\r]/g, re), "\"");
550
- }
551
559
  function ke(e, t, n, r) {
560
+ if (r && !_.QName_exact.test(t)) throw new h("The attribute name \"" + t + "\" is not a valid XML QName", g.InvalidStateError);
561
+ e.push(" ", t, "=\"", n.replace(/[<>&"\t\n\r]/g, ie), "\"");
562
+ }
563
+ function Ae(e, t, n, r) {
552
564
  n ||= [];
553
565
  var i = r.nodeFilter, a = r.requireWellFormed, o = r.splitCDATASections, s = (e.nodeType === P ? e : e.ownerDocument).type === "html";
554
566
  J(e, { ns: n }, {
@@ -580,6 +592,7 @@ var t = e((e) => {
580
592
  }
581
593
  }
582
594
  }
595
+ if (a && !_.QName_exact.test(v)) throw new h("The element name \"" + v + "\" is not a valid XML QName", g.InvalidStateError);
583
596
  t.push("<", v);
584
597
  for (var C = c.slice(), w = 0; w < p; w++) (T = d.item(w)).prefix == "xmlns" ? C.push({
585
598
  prefix: T.localName,
@@ -590,19 +603,19 @@ var t = e((e) => {
590
603
  });
591
604
  for (w = 0; w < p; w++) {
592
605
  var T;
593
- if (De(T = d.item(w), 0, C)) {
606
+ if (Oe(T = d.item(w), 0, C)) {
594
607
  var E = T.prefix || "", M = T.namespaceURI;
595
- Oe(t, E ? "xmlns:" + E : "xmlns", M), C.push({
608
+ ke(t, E ? "xmlns:" + E : "xmlns", M, a), C.push({
596
609
  prefix: E,
597
610
  namespace: M
598
611
  });
599
612
  }
600
613
  var L = i ? i(T) : T;
601
- L && (typeof L == "string" ? t.push(L) : Oe(t, L.name, L.value));
614
+ L && (typeof L == "string" ? t.push(L) : ke(t, L.name, L.value, a));
602
615
  }
603
- if (m === v && De(e, 0, C)) {
616
+ if (m === v && Oe(e, 0, C)) {
604
617
  var R = e.prefix || "";
605
- M = e.namespaceURI, Oe(t, R ? "xmlns:" + R : "xmlns", M), C.push({
618
+ M = e.namespaceURI, ke(t, R ? "xmlns:" + R : "xmlns", M, a), C.push({
606
619
  prefix: R,
607
620
  namespace: M
608
621
  });
@@ -610,7 +623,7 @@ var t = e((e) => {
610
623
  var z = !e.firstChild;
611
624
  if (z && (s || e.namespaceURI === f.HTML) && (z = u(m)), z) return t.push("/>"), null;
612
625
  if (t.push(">"), s && l(m)) {
613
- for (var B = e.firstChild; B;) B.data ? t.push(B.data) : ke(B, t, C.slice(), r), B = B.nextSibling;
626
+ for (var B = e.firstChild; B;) B.data ? t.push(B.data) : Ae(B, t, C.slice(), r), B = B.nextSibling;
614
627
  return t.push("</", v, ">"), null;
615
628
  }
616
629
  return {
@@ -621,10 +634,10 @@ var t = e((e) => {
621
634
  case I:
622
635
  if (a && e.nodeType === P && e.documentElement == null) throw new h("The Document has no documentElement", g.InvalidStateError);
623
636
  return { ns: c };
624
- case O: return Oe(t, e.name, e.value), null;
637
+ case O: return ke(t, e.name, e.value, a), null;
625
638
  case k:
626
639
  if (a && _.InvalidChar.test(e.data)) throw new h("The Text node data contains characters outside the XML Char production", g.InvalidStateError);
627
- return t.push(e.data.replace(/[<&>]/g, re)), null;
640
+ return t.push(e.data.replace(/[<&>]/g, ie)), null;
628
641
  case A:
629
642
  if (a && e.data.indexOf("]]>") !== -1) throw new h("The CDATASection data contains \"]]>\"", g.InvalidStateError);
630
643
  return o ? t.push(_.CDATA_START, e.data.replace(/]]>/g, "]]]]><![CDATA[>"), _.CDATA_END) : t.push(_.CDATA_START, e.data, _.CDATA_END), null;
@@ -637,6 +650,7 @@ var t = e((e) => {
637
650
  case F:
638
651
  var V = e.publicId, H = e.systemId;
639
652
  if (a) {
653
+ if (!_.Name_exact.test(e.name)) throw new h("The doctype name \"" + e.name + "\" is not a valid XML Name", g.InvalidStateError);
640
654
  if (V && !_.PubidLiteral_match.test(V)) throw new h("DocumentType publicId is not a valid PubidLiteral", g.InvalidStateError);
641
655
  if (H && H !== "." && !_.SystemLiteral_match.test(H)) throw new h("DocumentType systemId is not a valid SystemLiteral", g.InvalidStateError);
642
656
  if (e.internalSubset && e.internalSubset.indexOf("]>") !== -1) throw new h("DocumentType internalSubset contains \"]>\"", g.InvalidStateError);
@@ -644,12 +658,14 @@ var t = e((e) => {
644
658
  return t.push(_.DOCTYPE_DECL_START, " ", e.name), V ? (t.push(" ", _.PUBLIC, " ", V), H && H !== "." && t.push(" ", H)) : H && H !== "." && t.push(" ", _.SYSTEM, " ", H), e.internalSubset && t.push(" [", e.internalSubset, "]"), t.push(">"), null;
645
659
  case ee:
646
660
  if (a) {
647
- if (e.target.indexOf(":") !== -1 || e.target.toLowerCase() === "xml") throw new h("The ProcessingInstruction target is not well-formed", g.InvalidStateError);
661
+ if (!_.NCName_exact.test(e.target) || e.target.toLowerCase() === "xml") throw new h("The processing instruction target \"" + e.target + "\" is not a valid XML NCName or is reserved", g.InvalidStateError);
648
662
  if (_.InvalidChar.test(e.data)) throw new h("The ProcessingInstruction data contains characters outside the XML Char production", g.InvalidStateError);
649
663
  if (e.data.indexOf("?>") !== -1) throw new h("The ProcessingInstruction data contains \"?>\"", g.InvalidStateError);
650
664
  }
651
665
  return t.push("<?", e.target, " ", e.data, "?>"), null;
652
- case j: return t.push("&", e.nodeName, ";"), null;
666
+ case j:
667
+ if (a && !_.Name_exact.test(e.nodeName)) throw new h("The entity reference name \"" + e.nodeName + "\" is not a valid XML Name", g.InvalidStateError);
668
+ return t.push("&", e.nodeName, ";"), null;
653
669
  default: return t.push("??", e.nodeName), null;
654
670
  }
655
671
  },
@@ -658,7 +674,7 @@ var t = e((e) => {
658
674
  }
659
675
  });
660
676
  }
661
- function Ae(e, t, n) {
677
+ function je(e, t, n) {
662
678
  var r;
663
679
  return J(t, null, { enter: function(t, i) {
664
680
  var a = new t.constructor(p);
@@ -672,17 +688,17 @@ var t = e((e) => {
672
688
  case D:
673
689
  var u = t.attributes, d = a.attributes = new W(), f = u.length;
674
690
  d._ownerElement = a;
675
- for (var m = 0; m < f; m++) a.setAttributeNode(Ae(e, u.item(m), !0));
691
+ for (var m = 0; m < f; m++) a.setAttributeNode(je(e, u.item(m), !0));
676
692
  break;
677
693
  case O: l = !0;
678
694
  }
679
695
  return i === null ? r = a : i.appendChild(a), l ? a : null;
680
696
  } }), r;
681
697
  }
682
- function je(e, t, n) {
698
+ function Me(e, t, n) {
683
699
  e[t] = n;
684
700
  }
685
- function Me(e) {
701
+ function Ne(e) {
686
702
  for (var t = [], n = e.firstChild; n;) n.nodeType === D && t.push(n), n = n.nextSibling;
687
703
  return t;
688
704
  }
@@ -704,7 +720,7 @@ var t = e((e) => {
704
720
  requireWellFormed: !1,
705
721
  splitCDATASections: !0,
706
722
  nodeFilter: null
707
- }, n = [], r = 0; r < this.length; r++) ke(this[r], n, null, t);
723
+ }, n = [], r = 0; r < this.length; r++) Ae(this[r], n, null, t);
708
724
  return n.join("");
709
725
  },
710
726
  filter: function(e) {
@@ -743,8 +759,8 @@ var t = e((e) => {
743
759
  setNamedItem: function(e) {
744
760
  var t = e.ownerElement;
745
761
  if (t && t !== this._ownerElement) throw new h(h.INUSE_ATTRIBUTE_ERR);
746
- var n = this.getNamedItemNS(e.namespaceURI, e.localName);
747
- return n === e ? e : (G(this._ownerElement, this, e, n), n);
762
+ var n, r, i, a, o = (n = this, r = e.namespaceURI, i = e.localName, (a = te(n, r, !1)) && a[i] || null);
763
+ return o === e ? e : (ne(this._ownerElement, this, e, o), o);
748
764
  },
749
765
  setNamedItemNS: function(e) {
750
766
  return this.setNamedItem(e);
@@ -781,7 +797,7 @@ var t = e((e) => {
781
797
  return { done: !0 };
782
798
  }
783
799
  };
784
- }, ne.prototype = {
800
+ }, re.prototype = {
785
801
  hasFeature: function(e, t) {
786
802
  return !0;
787
803
  },
@@ -797,7 +813,7 @@ var t = e((e) => {
797
813
  },
798
814
  createDocumentType: function(e, t, n, r) {
799
815
  S(e);
800
- var i = new ye(p);
816
+ var i = new be(p);
801
817
  return i.name = e, i.nodeName = e, i.publicId = t || "", i.systemId = n || "", i.internalSubset = r || "", i.childNodes = new V(), i;
802
818
  },
803
819
  createHTMLDocument: function(e) {
@@ -896,13 +912,13 @@ var t = e((e) => {
896
912
  return this === e;
897
913
  },
898
914
  insertBefore: function(e, t) {
899
- return me(this, e, t);
915
+ return he(this, e, t);
900
916
  },
901
917
  replaceChild: function(e, t) {
902
- me(this, e, t, pe), t && this.removeChild(t);
918
+ he(this, e, t, me), t && this.removeChild(t);
903
919
  },
904
920
  removeChild: function(e) {
905
- return se(this, e);
921
+ return ce(this, e);
906
922
  },
907
923
  appendChild: function(e) {
908
924
  return this.insertBefore(e, null);
@@ -911,13 +927,20 @@ var t = e((e) => {
911
927
  return this.firstChild != null;
912
928
  },
913
929
  cloneNode: function(e) {
914
- return Ae(this.ownerDocument || this, this, e);
930
+ return je(this.ownerDocument || this, this, e);
915
931
  },
916
932
  normalize: function() {
917
933
  J(this, null, { enter: function(e) {
918
934
  for (var t = e.firstChild; t;) {
919
935
  var n = t.nextSibling;
920
- n !== null && n.nodeType === k && t.nodeType === k ? (e.removeChild(n), t.appendData(n.data)) : t = n;
936
+ if (n !== null && n.nodeType === k && t.nodeType === k) {
937
+ for (var r = [], i = n; i !== null && i.nodeType === k;) r.push(i.data), i = i.nextSibling;
938
+ for (var a = t.nextSibling; a !== i;) {
939
+ var o = a.nextSibling;
940
+ a.parentNode = null, a.previousSibling = null, a.nextSibling = null, a = o;
941
+ }
942
+ t.nextSibling = i, i === null ? e.lastChild = t : i.previousSibling = t, t.appendData(r.join("")), se(e.ownerDocument, e), t = i;
943
+ } else t = n;
921
944
  }
922
945
  return !0;
923
946
  } });
@@ -949,7 +972,7 @@ var t = e((e) => {
949
972
  compareDocumentPosition: function(e) {
950
973
  if (this === e) return 0;
951
974
  var t = e, n = this, r = null, i = null;
952
- if (t instanceof $ && (t = (r = t).ownerElement), n instanceof $ && (n = (i = n).ownerElement, r && t && n === t)) for (var a, o = 0; a = n.attributes[o]; o++) {
975
+ if (t instanceof ge && (t = (r = t).ownerElement), n instanceof ge && (n = (i = n).ownerElement, r && t && n === t)) for (var a, o = 0; a = n.attributes[o]; o++) {
953
976
  if (a === r) return R.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC + R.DOCUMENT_POSITION_PRECEDING;
954
977
  if (a === i) return R.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC + R.DOCUMENT_POSITION_FOLLOWING;
955
978
  }
@@ -991,14 +1014,14 @@ var t = e((e) => {
991
1014
  }
992
1015
  return e;
993
1016
  }
994
- return me(this, e, t), e.ownerDocument = this, this.documentElement === null && e.nodeType === D && (this.documentElement = e), e;
1017
+ return he(this, e, t), e.ownerDocument = this, this.documentElement === null && e.nodeType === D && (this.documentElement = e), e;
995
1018
  },
996
1019
  removeChild: function(e) {
997
- var t = se(this, e);
1020
+ var t = ce(this, e);
998
1021
  return t === this.documentElement && (this.documentElement = null), t;
999
1022
  },
1000
1023
  replaceChild: function(e, t) {
1001
- me(this, e, t, pe), e.ownerDocument = this, t && this.removeChild(t), Z(e) && (this.documentElement = e);
1024
+ he(this, e, t, me), e.ownerDocument = this, t && this.removeChild(t), Z(e) && (this.documentElement = e);
1002
1025
  },
1003
1026
  importNode: function(e, t) {
1004
1027
  return function(e, t, n) {
@@ -1011,7 +1034,7 @@ var t = e((e) => {
1011
1034
  },
1012
1035
  getElementById: function(e) {
1013
1036
  var t = null;
1014
- return ie(this.documentElement, function(n) {
1037
+ return ae(this.documentElement, function(n) {
1015
1038
  if (n.nodeType == D && n.getAttribute("id") == e) return t = n, !0;
1016
1039
  }), t;
1017
1040
  },
@@ -1020,24 +1043,24 @@ var t = e((e) => {
1020
1043
  return t.ownerDocument = this, this.type === "html" && (e = e.toLowerCase()), o(this.contentType) && (t.namespaceURI = f.HTML), t.nodeName = e, t.tagName = e, t.localName = e, t.childNodes = new V(), (t.attributes = new W())._ownerElement = t, t;
1021
1044
  },
1022
1045
  createDocumentFragment: function() {
1023
- var e = new Ce(p);
1046
+ var e = new we(p);
1024
1047
  return e.ownerDocument = this, e.childNodes = new V(), e;
1025
1048
  },
1026
1049
  createTextNode: function(e) {
1027
- var t = new ge(p);
1050
+ var t = new _e(p);
1028
1051
  return t.ownerDocument = this, t.childNodes = new V(), t.appendData(e), t;
1029
1052
  },
1030
1053
  createComment: function(e) {
1031
- var t = new _e(p);
1054
+ var t = new ve(p);
1032
1055
  return t.ownerDocument = this, t.childNodes = new V(), t.appendData(e), t;
1033
1056
  },
1034
1057
  createCDATASection: function(e) {
1035
1058
  if (e.indexOf("]]>") !== -1) throw new h(h.INVALID_CHARACTER_ERR, "data contains \"]]>\"");
1036
- var t = new ve(p);
1059
+ var t = new ye(p);
1037
1060
  return t.ownerDocument = this, t.childNodes = new V(), t.appendData(e), t;
1038
1061
  },
1039
1062
  createProcessingInstruction: function(e, t) {
1040
- var n = new we(p);
1063
+ var n = new Te(p);
1041
1064
  return n.ownerDocument = this, n.childNodes = new V(), n.nodeName = n.target = e, n.nodeValue = n.data = t, n;
1042
1065
  },
1043
1066
  createAttribute: function(e) {
@@ -1045,13 +1068,13 @@ var t = e((e) => {
1045
1068
  return this.type === "html" && (e = e.toLowerCase()), this._createAttribute(e);
1046
1069
  },
1047
1070
  _createAttribute: function(e) {
1048
- var t = new $(p);
1071
+ var t = new ge(p);
1049
1072
  return t.ownerDocument = this, t.childNodes = new V(), t.name = e, t.nodeName = e, t.localName = e, t.specified = !0, t;
1050
1073
  },
1051
1074
  createEntityReference: function(e) {
1052
- if (!_.Name.test(e)) throw new h(h.INVALID_CHARACTER_ERR, "not a valid xml name \"" + e + "\"");
1075
+ if (!_.Name_exact.test(e)) throw new h(h.INVALID_CHARACTER_ERR, "not a valid xml name \"" + e + "\"");
1053
1076
  if (this.type === "html") throw new h("document is an html document", g.NotSupportedError);
1054
- var t = new Se(p);
1077
+ var t = new Ce(p);
1055
1078
  return t.ownerDocument = this, t.childNodes = new V(), t.nodeName = e, t;
1056
1079
  },
1057
1080
  createElementNS: function(e, t) {
@@ -1059,7 +1082,7 @@ var t = e((e) => {
1059
1082
  return r.childNodes = new V(), r.ownerDocument = this, r.nodeName = t, r.tagName = t, r.namespaceURI = n[0], r.prefix = n[1], r.localName = n[2], i._ownerElement = r, r;
1060
1083
  },
1061
1084
  createAttributeNS: function(e, t) {
1062
- var n = C(e, t), r = new $(p);
1085
+ var n = C(e, t), r = new ge(p);
1063
1086
  return r.ownerDocument = this, r.childNodes = new V(), r.nodeName = t, r.name = t, r.specified = !0, r.namespaceURI = n[0], r.prefix = n[1], r.localName = n[2], r;
1064
1087
  }
1065
1088
  }, T(Y, q), Q.prototype = {
@@ -1124,7 +1147,7 @@ var t = e((e) => {
1124
1147
  var t = x(e);
1125
1148
  return new H(this, function(n) {
1126
1149
  var r = [];
1127
- return t.length > 0 && ie(n, function(i) {
1150
+ return t.length > 0 && ae(n, function(i) {
1128
1151
  if (i !== n && i.nodeType === D) {
1129
1152
  var a = i.getAttribute("class");
1130
1153
  if (a) {
@@ -1146,7 +1169,7 @@ var t = e((e) => {
1146
1169
  var t = (this.nodeType === P ? this : this.ownerDocument).type === "html", n = e.toLowerCase();
1147
1170
  return new H(this, function(r) {
1148
1171
  var i = [];
1149
- return ie(r, function(a) {
1172
+ return ae(r, function(a) {
1150
1173
  a !== r && a.nodeType === D && (e === "*" || a.getQualifiedName() === (t && a.namespaceURI === f.HTML ? n : e)) && i.push(a);
1151
1174
  }), i;
1152
1175
  });
@@ -1154,12 +1177,12 @@ var t = e((e) => {
1154
1177
  getElementsByTagNameNS: function(e, t) {
1155
1178
  return new H(this, function(n) {
1156
1179
  var r = [];
1157
- return ie(n, function(i) {
1180
+ return ae(n, function(i) {
1158
1181
  i === n || i.nodeType !== D || e !== "*" && i.namespaceURI !== e || t !== "*" && i.localName != t || r.push(i);
1159
1182
  }), r;
1160
1183
  });
1161
1184
  }
1162
- }, Y.prototype.getElementsByClassName = Q.prototype.getElementsByClassName, Y.prototype.getElementsByTagName = Q.prototype.getElementsByTagName, Y.prototype.getElementsByTagNameNS = Q.prototype.getElementsByTagNameNS, T(Q, q), $.prototype.nodeType = O, T($, q), he.prototype = {
1185
+ }, Y.prototype.getElementsByClassName = Q.prototype.getElementsByClassName, Y.prototype.getElementsByTagName = Q.prototype.getElementsByTagName, Y.prototype.getElementsByTagNameNS = Q.prototype.getElementsByTagNameNS, T(Q, q), ge.prototype.nodeType = O, T(ge, q), $.prototype = {
1163
1186
  data: "",
1164
1187
  substringData: function(e, t) {
1165
1188
  return this.data.substring(e, e + t);
@@ -1176,7 +1199,7 @@ var t = e((e) => {
1176
1199
  replaceData: function(e, t, n) {
1177
1200
  n = this.data.substring(0, e) + n + this.data.substring(e + t), this.nodeValue = this.data = n, this.length = n.length;
1178
1201
  }
1179
- }, T(he, q), ge.prototype = {
1202
+ }, T($, q), _e.prototype = {
1180
1203
  nodeName: "#text",
1181
1204
  nodeType: k,
1182
1205
  splitText: function(e) {
@@ -1185,15 +1208,15 @@ var t = e((e) => {
1185
1208
  var r = this.ownerDocument.createTextNode(n);
1186
1209
  return this.parentNode && this.parentNode.insertBefore(r, this.nextSibling), r;
1187
1210
  }
1188
- }, T(ge, he), _e.prototype = {
1211
+ }, T(_e, $), ve.prototype = {
1189
1212
  nodeName: "#comment",
1190
1213
  nodeType: N
1191
- }, T(_e, he), ve.prototype = {
1214
+ }, T(ve, $), ye.prototype = {
1192
1215
  nodeName: "#cdata-section",
1193
1216
  nodeType: A
1194
- }, T(ve, ge), ye.prototype.nodeType = F, T(ye, q), be.prototype.nodeType = L, T(be, q), xe.prototype.nodeType = M, T(xe, q), Se.prototype.nodeType = j, T(Se, q), Ce.prototype.nodeName = "#document-fragment", Ce.prototype.nodeType = I, T(Ce, q), we.prototype.nodeType = ee, T(we, he), Te.prototype.serializeToString = function(e, t) {
1195
- return Ee.call(e, t);
1196
- }, q.prototype.toString = Ee;
1217
+ }, T(ye, _e), be.prototype.nodeType = F, T(be, q), xe.prototype.nodeType = L, T(xe, q), Se.prototype.nodeType = M, T(Se, q), Ce.prototype.nodeType = j, T(Ce, q), we.prototype.nodeName = "#document-fragment", we.prototype.nodeType = I, T(we, q), Te.prototype.nodeType = ee, T(Te, $), Ee.prototype.serializeToString = function(e, t) {
1218
+ return De.call(e, t);
1219
+ }, q.prototype.toString = De;
1197
1220
  try {
1198
1221
  Object.defineProperty && (Object.defineProperty(H.prototype, "length", { get: function() {
1199
1222
  return U(this), this.$$length;
@@ -1217,17 +1240,33 @@ var t = e((e) => {
1217
1240
  default: this.data = e, this.value = e, this.nodeValue = e;
1218
1241
  }
1219
1242
  }
1243
+ }), Object.defineProperty($.prototype, "data", {
1244
+ get: function() {
1245
+ return this._data == null ? "" : this._data;
1246
+ },
1247
+ set: function(e) {
1248
+ this._data = e, this.length = typeof e == "string" ? e.length : 0;
1249
+ }
1250
+ }), Object.defineProperty($.prototype, "nodeValue", {
1251
+ get: function() {
1252
+ return this.data;
1253
+ },
1254
+ set: function(e) {
1255
+ this.data = e;
1256
+ },
1257
+ enumerable: !0,
1258
+ configurable: !0
1220
1259
  }), Object.defineProperty(Q.prototype, "children", { get: function() {
1221
- return new H(this, Me);
1260
+ return new H(this, Ne);
1222
1261
  } }), Object.defineProperty(Y.prototype, "children", { get: function() {
1223
- return new H(this, Me);
1224
- } }), Object.defineProperty(Ce.prototype, "children", { get: function() {
1225
- return new H(this, Me);
1226
- } }), je = function(e, t, n) {
1262
+ return new H(this, Ne);
1263
+ } }), Object.defineProperty(we.prototype, "children", { get: function() {
1264
+ return new H(this, Ne);
1265
+ } }), Me = function(e, t, n) {
1227
1266
  e["$$" + t] = n;
1228
1267
  });
1229
1268
  } catch {}
1230
- e._updateLiveList = U, e.Attr = $, e.CDATASection = ve, e.CharacterData = he, e.Comment = _e, e.Document = Y, e.DocumentFragment = Ce, e.DocumentType = ye, e.DOMImplementation = ne, e.Element = Q, e.Entity = xe, e.EntityReference = Se, e.LiveNodeList = H, e.NamedNodeMap = W, e.Node = q, e.NodeList = V, e.Notation = be, e.Text = ge, e.ProcessingInstruction = we, e.walkDOM = J, e.XMLSerializer = Te;
1269
+ e._updateLiveList = U, e.Attr = ge, e.CDATASection = ye, e.CharacterData = $, e.Comment = ve, e.Document = Y, e.DocumentFragment = we, e.DocumentType = be, e.DOMImplementation = re, e.Element = Q, e.Entity = Se, e.EntityReference = Ce, e.LiveNodeList = H, e.NamedNodeMap = W, e.Node = q, e.NodeList = V, e.Notation = xe, e.Text = _e, e.ProcessingInstruction = Te, e.walkDOM = J, e.XMLSerializer = Ee;
1231
1270
  }), a = e((e) => {
1232
1271
  var n = t().freeze;
1233
1272
  e.XML_ENTITIES = n({
@@ -3368,7 +3407,9 @@ var t = e((e) => {
3368
3407
  function m() {}
3369
3408
  m.prototype = { parse: function(e, t, n) {
3370
3409
  var r = this.domBuilder;
3371
- r.startDocument(), b(t, t = Object.create(null)), function(e, t, n, r, o) {
3410
+ r.startDocument(), function(e, t) {
3411
+ for (var n in e) u(e, n) && (t[n] = e[n]);
3412
+ }(t, t = Object.create(null)), function(e, t, n, r, o) {
3372
3413
  var s = c(r.mimeType);
3373
3414
  e.indexOf(a.UNICODE_REPLACEMENT_CHARACTER) >= 0 && o.warning("Unicode replacement character detected, source encoding issues?");
3374
3415
  function l(e) {
@@ -3392,9 +3433,9 @@ var t = e((e) => {
3392
3433
  E && D(A), r.characters(n, 0, t - A), A = t;
3393
3434
  }
3394
3435
  }
3395
- var b = 0, x = 0, T = /\r\n?|\n|$/g, E = r.locator;
3436
+ var b = 0, w = 0, T = /\r\n?|\n|$/g, E = r.locator;
3396
3437
  function D(t, n) {
3397
- for (; t >= x && (n = T.exec(e));) b = x, x = n.index + n[0].length, E.lineNumber++;
3438
+ for (; t >= w && (n = T.exec(e));) b = w, w = n.index + n[0].length, E.lineNumber++;
3398
3439
  E.columnNumber = t - b + 1;
3399
3440
  }
3400
3441
  for (var O = [{ currentNSMap: t }], k = [], A = 0;;) {
@@ -3417,41 +3458,48 @@ var t = e((e) => {
3417
3458
  case "/":
3418
3459
  var P = e.indexOf(">", j + 2), F = e.substring(j + 2, P > 0 ? P : void 0);
3419
3460
  if (!F) return o.fatalError("end tag name missing");
3420
- var I = P > 0 && a.reg("^", a.QName_group, a.S_OPT, "$").exec(F);
3421
- if (!I) return o.fatalError("end tag name contains invalid characters: \"" + F + "\"");
3461
+ var I = a.reg("^", a.QName_group, a.S_OPT, "$"), L = P > 0 && I.exec(F);
3462
+ if (!L) {
3463
+ var R = P > 0 && a.reg("^", a.QName_group).exec(F);
3464
+ if (s && R) o.warning("end tag name contains invalid trailing characters: \"" + F + "\""), L = R;
3465
+ else {
3466
+ if (!R || !new RegExp(I.source, I.flags + "m").test(F)) return o.fatalError("end tag name contains invalid characters: \"" + F + "\"");
3467
+ o.error("end tag name is followed by a line break and trailing content: \"" + F + "\""), L = R;
3468
+ }
3469
+ }
3422
3470
  if (!r.currentElement && !r.doc.documentElement) return;
3423
- var L = k[k.length - 1] || r.currentElement.tagName || r.doc.documentElement.tagName || "";
3424
- if (L !== I[1]) {
3425
- var R = I[1].toLowerCase();
3426
- if (!s || L.toLowerCase() !== R) return o.fatalError("Opening and ending tag mismatch: \"" + L + "\" != \"" + F + "\"");
3471
+ var z = k[k.length - 1] || r.currentElement.tagName || r.doc.documentElement.tagName || "";
3472
+ if (z !== L[1]) {
3473
+ var B = L[1].toLowerCase();
3474
+ if (!s || z.toLowerCase() !== B) return o.fatalError("Opening and ending tag mismatch: \"" + z + "\" != \"" + F + "\"");
3427
3475
  }
3428
- var z = O.pop();
3476
+ var V = O.pop();
3429
3477
  k.pop();
3430
- var B = z.localNSMap;
3431
- if (r.endElement(z.uri, z.localName, L), B) for (var V in B) u(B, V) && r.endPrefixMapping(V);
3478
+ var H = V.localNSMap;
3479
+ if (r.endElement(V.uri, V.localName, z), H) for (var U in H) u(H, U) && r.endPrefixMapping(U);
3432
3480
  P++;
3433
3481
  break;
3434
3482
  case "?":
3435
- E && D(j), P = C(e, j, r, o);
3483
+ E && D(j), P = S(e, j, r, o);
3436
3484
  break;
3437
3485
  case "!":
3438
- E && D(j), P = S(e, j, r, o, s);
3486
+ E && D(j), P = x(e, j, r, o, s);
3439
3487
  break;
3440
3488
  default:
3441
3489
  E && D(j);
3442
- var H = new w(), U = O[O.length - 1].currentNSMap, W = (P = _(e, j, H, U, d, o, s), H.length);
3443
- if (H.closed || (s && i.isHTMLVoidElement(H.tagName) ? H.closed = !0 : k.push(H.tagName)), E && W) {
3444
- for (var te = g(E, {}), G = 0; G < W; G++) {
3445
- var K = H[G];
3446
- D(K.offset), K.locator = g(E, {});
3490
+ var W = new C(), G = O[O.length - 1].currentNSMap, te = (P = _(e, j, W, G, d, o, s), W.length);
3491
+ if (W.closed || (s && i.isHTMLVoidElement(W.tagName) ? W.closed = !0 : k.push(W.tagName)), E && te) {
3492
+ for (var ne = g(E, {}), K = 0; K < te; K++) {
3493
+ var re = W[K];
3494
+ D(re.offset), re.locator = g(E, {});
3447
3495
  }
3448
- r.locator = te, v(H, r, U) && O.push(H), r.locator = E;
3449
- } else v(H, r, U) && O.push(H);
3450
- s && !H.closed ? P = y(e, P, H.tagName, d, r) : P++;
3496
+ r.locator = ne, v(W, r, G) && O.push(W), r.locator = E;
3497
+ } else v(W, r, G) && O.push(W);
3498
+ s && !W.closed ? P = y(e, P, W.tagName, d, r) : P++;
3451
3499
  }
3452
3500
  } catch (e) {
3453
3501
  if (e instanceof f) throw e;
3454
- if (e instanceof p) throw new f(e.name + ": " + e.message, r.locator, e);
3502
+ if (e instanceof p) return o.fatalError("Error constructing the DOM: " + e.name + ": " + e.message, e);
3455
3503
  o.error("element parse error: " + e), P = -1;
3456
3504
  }
3457
3505
  P > A ? A = P : m(Math.max(j, A) + 1);
@@ -3468,6 +3516,7 @@ var t = e((e) => {
3468
3516
  }
3469
3517
  for (var c, l = ++t, d = 0;;) {
3470
3518
  var f = e.charAt(l);
3519
+ if (d === 0 && f === "<") throw Error("unexpected < in tag name: " + e.slice(t, l));
3471
3520
  switch (f) {
3472
3521
  case "=":
3473
3522
  if (d === 1) c = e.slice(t, l), d = 3;
@@ -3550,7 +3599,7 @@ var t = e((e) => {
3550
3599
  var o = e[a], s = o.qName, c = o.value;
3551
3600
  if ((m = s.indexOf(":")) > 0) var l = o.prefix = s.slice(0, m), f = s.slice(m + 1), p = l === "xmlns" && f;
3552
3601
  else f = s, l = null, p = s === "xmlns" && "";
3553
- o.localName = f, !1 !== p && (i ?? (i = Object.create(null), b(n, n = Object.create(null))), n[p] = i[p] = c, o.uri = d.XMLNS, t.startPrefixMapping(p, c));
3602
+ o.localName = f, !1 !== p && (i ?? (i = Object.create(null), n = Object.create(n)), n[p] = i[p] = c, o.uri = d.XMLNS, t.startPrefixMapping(p, c));
3554
3603
  }
3555
3604
  for (a = e.length; a--;) (o = e[a]).prefix && (o.prefix === "xml" && (o.uri = d.XML), o.prefix !== "xmlns" && (o.uri = n[o.prefix]));
3556
3605
  var m;
@@ -3562,15 +3611,16 @@ var t = e((e) => {
3562
3611
  function y(e, t, n, r, i) {
3563
3612
  var a = s(n);
3564
3613
  if (a || l(n)) {
3565
- var o = e.indexOf("</" + n + ">", t), c = e.substring(t + 1, o);
3566
- return a && (c = c.replace(h, r)), i.characters(c, 0, c.length), o;
3614
+ var o = RegExp("</" + n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + ">", "ig");
3615
+ o.lastIndex = t;
3616
+ var c = o.exec(e), u = c ? c.index : -1;
3617
+ if (u < 0) return t + 1;
3618
+ var d = e.substring(t + 1, u);
3619
+ return a && (d = d.replace(h, r)), i.characters(d, 0, d.length), u;
3567
3620
  }
3568
3621
  return t + 1;
3569
3622
  }
3570
3623
  function b(e, t) {
3571
- for (var n in e) u(e, n) && (t[n] = e[n]);
3572
- }
3573
- function x(e, t) {
3574
3624
  var n = t;
3575
3625
  function r(t) {
3576
3626
  return t ||= 0, e.charAt(n + t);
@@ -3611,8 +3661,8 @@ var t = e((e) => {
3611
3661
  }
3612
3662
  };
3613
3663
  }
3614
- function S(e, t, n, r, i) {
3615
- var o = x(e, t);
3664
+ function x(e, t, n, r, i) {
3665
+ var o = b(e, t);
3616
3666
  switch (i ? o.char(2).toUpperCase() : o.char(2)) {
3617
3667
  case "-":
3618
3668
  var s = o.getMatch(a.Comment);
@@ -3678,7 +3728,7 @@ var t = e((e) => {
3678
3728
  default: return r.fatalError("Not well-formed XML starting with \"<!\" at position " + t);
3679
3729
  }
3680
3730
  }
3681
- function C(e, t, n, r) {
3731
+ function S(e, t, n, r) {
3682
3732
  var i = e.substring(t).match(a.PI);
3683
3733
  if (!i) return r.fatalError("Invalid processing instruction starting at position " + t);
3684
3734
  if (i[1].toLowerCase() === "xml") {
@@ -3687,10 +3737,10 @@ var t = e((e) => {
3687
3737
  }
3688
3738
  return n.processingInstruction(i[1], i[2]), t + i[0].length;
3689
3739
  }
3690
- function w() {
3740
+ function C() {
3691
3741
  this.attributeNames = Object.create(null);
3692
3742
  }
3693
- w.prototype = {
3743
+ C.prototype = {
3694
3744
  setTagName: function(e) {
3695
3745
  if (!a.QName_exact.test(e)) throw Error("invalid tagName:" + e);
3696
3746
  this.tagName = e;
@@ -3719,7 +3769,7 @@ var t = e((e) => {
3719
3769
  getValue: function(e) {
3720
3770
  return this[e].value;
3721
3771
  }
3722
- }, e.XMLReader = m, e.parseUtils = x, e.parseDoctypeCommentOrCData = S;
3772
+ }, e.XMLReader = m, e.parseUtils = b, e.parseDoctypeCommentOrCData = x;
3723
3773
  }), s = e((e) => {
3724
3774
  var r = t(), s = i(), c = n(), l = a(), u = o(), d = s.DOMImplementation, f = r.hasDefaultHTMLNamespace, p = r.isHTMLMimeType, m = r.isValidMimeType, h = r.MIME_TYPE, g = r.NAMESPACE, _ = c.ParseError, v = u.XMLReader;
3725
3775
  function y(e) {
@@ -3826,8 +3876,8 @@ var t = e((e) => {
3826
3876
  error: function(e) {
3827
3877
  this.reportError("error", e);
3828
3878
  },
3829
- fatalError: function(e) {
3830
- throw this.reportError("fatalError", e), new _(e, this.locator);
3879
+ fatalError: function(e, t) {
3880
+ throw this.reportError("fatalError", e), new _(e, this.locator, t);
3831
3881
  }
3832
3882
  }, "endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g, function(e) {
3833
3883
  x.prototype[e] = function() {