@rankingcoach/vanguard 1.3.1 → 1.4.2

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 (340) hide show
  1. package/dist/index-AMPMMidnightParser.js +1 -1
  2. package/dist/index-AMPMParser.js +1 -1
  3. package/dist/index-Accordion2.js +1 -1
  4. package/dist/index-AccordionDetails.js +1 -1
  5. package/dist/index-AccordionSummary.js +1 -1
  6. package/dist/index-AiGlow.js +1 -1
  7. package/dist/index-AppBar2.js +1 -1
  8. package/dist/index-Autocomplete.js +2 -2
  9. package/dist/index-Autocomplete2.js +1 -1
  10. package/dist/index-Backdrop.js +1 -1
  11. package/dist/index-BasePopper.js +1 -1
  12. package/dist/index-Box.js +1 -1
  13. package/dist/index-Button2.js +1 -1
  14. package/dist/index-ButtonBase.js +1 -1
  15. package/dist/index-CSSTransition.js +1 -1
  16. package/dist/index-Calendar.js +20 -20
  17. package/dist/index-CalendarPicker.js +1 -1
  18. package/dist/index-Chip.js +1 -1
  19. package/dist/index-ClickAwayListener.js +1 -1
  20. package/dist/index-ClockPicker.js +1 -1
  21. package/dist/index-Collapse2.js +1 -1
  22. package/dist/index-CreditCard.js +1 -1
  23. package/dist/index-DateInput.js +1 -1
  24. package/dist/index-DateParser.js +1 -1
  25. package/dist/index-DatePicker2.js +1 -1
  26. package/dist/index-DateRange2.js +7 -7
  27. package/dist/index-DateRangePicker2.js +1 -1
  28. package/dist/index-DayCell.js +5 -5
  29. package/dist/index-DayOfYearParser.js +1 -1
  30. package/dist/index-DayParser.js +1 -1
  31. package/dist/index-DayPeriodParser.js +1 -1
  32. package/dist/index-DefaultPropsProvider.js +1 -1
  33. package/dist/index-DefaultPropsProvider2.js +1 -1
  34. package/dist/index-DefinedRange.js +1 -1
  35. package/dist/index-DesktopDatePicker.js +1 -1
  36. package/dist/index-Dialog.js +1 -1
  37. package/dist/index-DialogActions.js +1 -1
  38. package/dist/index-DialogContent.js +1 -1
  39. package/dist/index-Drawer.js +1 -1
  40. package/dist/index-Drawer2.js +1 -1
  41. package/dist/index-EraParser.js +1 -1
  42. package/dist/index-ExtendedYearParser.js +1 -1
  43. package/dist/index-Fade.js +1 -1
  44. package/dist/index-FilledInput.js +1 -1
  45. package/dist/index-FocusTrap.js +1 -1
  46. package/dist/index-FormControl2.js +1 -1
  47. package/dist/index-FormHelperText.js +1 -1
  48. package/dist/index-FormLabel.js +1 -1
  49. package/dist/index-FractionOfSecondParser.js +1 -1
  50. package/dist/index-GlobalStyles.js +1 -1
  51. package/dist/index-GlobalStyles2.js +1 -1
  52. package/dist/index-GlobalStyles3.js +1 -1
  53. package/dist/index-Grid.js +1 -1
  54. package/dist/index-Grow.js +1 -1
  55. package/dist/index-Header.js +1 -1
  56. package/dist/index-Hour0To11Parser.js +1 -1
  57. package/dist/index-Hour0to23Parser.js +1 -1
  58. package/dist/index-Hour1To24Parser.js +1 -1
  59. package/dist/index-Hour1to12Parser.js +1 -1
  60. package/dist/index-ISODayParser.js +1 -1
  61. package/dist/index-ISOTimezoneParser.js +1 -1
  62. package/dist/index-ISOTimezoneWithZParser.js +1 -1
  63. package/dist/index-ISOWeekParser.js +1 -1
  64. package/dist/index-ISOWeekYearParser.js +1 -1
  65. package/dist/index-IconButton2.js +1 -1
  66. package/dist/index-Input2.js +1 -1
  67. package/dist/index-InputAdornment.js +1 -1
  68. package/dist/index-InputBase.js +155 -150
  69. package/dist/index-InputBase2.js +1 -1
  70. package/dist/index-InputLabel.js +1 -1
  71. package/dist/index-LinearProgress.js +1 -1
  72. package/dist/index-List2.js +1 -1
  73. package/dist/index-ListSubheader.js +1 -1
  74. package/dist/index-LocalDayParser.js +1 -1
  75. package/dist/index-LocalWeekParser.js +1 -1
  76. package/dist/index-LocalWeekYearParser.js +1 -1
  77. package/dist/index-LocalizationProvider.js +1 -1
  78. package/dist/index-LoginButton.js +1 -1
  79. package/dist/index-Menu.js +1 -1
  80. package/dist/index-MenuItem.js +1 -1
  81. package/dist/index-MenuList.js +1 -1
  82. package/dist/index-MinuteParser.js +1 -1
  83. package/dist/index-MobileDatePicker.js +1 -1
  84. package/dist/index-Modal2.js +1 -1
  85. package/dist/index-Month.js +9 -9
  86. package/dist/index-MonthParser.js +1 -1
  87. package/dist/index-MonthPicker.js +1 -1
  88. package/dist/index-NativeSelectInput.js +1 -1
  89. package/dist/index-NotchedOutline.js +1 -1
  90. package/dist/index-OutlinedInput.js +1 -1
  91. package/dist/index-Paper.js +1 -1
  92. package/dist/index-Parser2.js +315 -255
  93. package/dist/index-Parser3.js +129 -2
  94. package/dist/index-PickersDay.js +1 -1
  95. package/dist/index-Popover2.js +1 -1
  96. package/dist/index-Popper.js +1 -1
  97. package/dist/index-Portal.js +1 -1
  98. package/dist/index-PropTypes.js +1 -1
  99. package/dist/index-QuarterParser.js +1 -1
  100. package/dist/index-QuoteContainer.js +1 -1
  101. package/dist/index-Ripple.js +1 -1
  102. package/dist/index-RtlProvider.js +1 -1
  103. package/dist/index-ScrollbarSize.js +1 -1
  104. package/dist/index-SecondParser.js +1 -1
  105. package/dist/index-Select2.js +1 -1
  106. package/dist/index-SelectInput2.js +1 -1
  107. package/dist/index-Skeleton2.js +1 -1
  108. package/dist/index-Slide.js +1 -1
  109. package/dist/index-Slider2.js +1 -1
  110. package/dist/index-SliderValueLabel.js +1 -1
  111. package/dist/index-Snackbar2.js +1 -1
  112. package/dist/index-SnackbarContent.js +1 -1
  113. package/dist/index-StandAloneLocalDayParser.js +1 -1
  114. package/dist/index-StandAloneMonthParser.js +1 -1
  115. package/dist/index-StandAloneQuarterParser.js +1 -1
  116. package/dist/index-StyledEngineProvider.js +1 -1
  117. package/dist/index-StyledSVG2.js +1 -1
  118. package/dist/index-SvgIcon.js +1 -1
  119. package/dist/index-Tab2.js +1 -1
  120. package/dist/index-TabScrollButton.js +1 -1
  121. package/dist/index-Tabs2.js +1 -1
  122. package/dist/index-Text.js +18 -18
  123. package/dist/index-TextField.js +1 -1
  124. package/dist/index-TextHighlighted.js +23 -19
  125. package/dist/index-TextareaAutosize.js +1 -1
  126. package/dist/index-TimestampMillisecondsParser.js +1 -1
  127. package/dist/index-TimestampSecondsParser.js +1 -1
  128. package/dist/index-ToggleButton2.js +1 -1
  129. package/dist/index-ToggleButtonGroup2.js +1 -1
  130. package/dist/index-Tokenizer.js +411 -334
  131. package/dist/index-Tokenizer2.js +139 -2
  132. package/dist/index-Toolbar2.js +1 -1
  133. package/dist/index-Tooltip.js +1 -1
  134. package/dist/index-TouchRipple.js +1 -1
  135. package/dist/index-Transition.js +1 -1
  136. package/dist/index-TransitionGroup.js +1 -1
  137. package/dist/index-Typography.js +1 -1
  138. package/dist/index-YearParser.js +1 -1
  139. package/dist/index-YearPicker.js +1 -1
  140. package/dist/index-_virtual12.js +1 -1
  141. package/dist/index-_virtual15.js +2 -5
  142. package/dist/index-_virtual16.js +5 -3
  143. package/dist/index-_virtual17.js +5 -2
  144. package/dist/index-_virtual18.js +2 -7
  145. package/dist/index-_virtual19.js +5 -2
  146. package/dist/index-_virtual2.js +5 -5
  147. package/dist/index-_virtual20.js +2 -5
  148. package/dist/index-_virtual23.js +1 -1
  149. package/dist/index-_virtual3.js +4 -4
  150. package/dist/index-_virtual34.js +2 -2
  151. package/dist/index-_virtual35.js +2 -4
  152. package/dist/index-_virtual36.js +1 -1
  153. package/dist/index-_virtual37.js +1 -1
  154. package/dist/index-_virtual38.js +1 -1
  155. package/dist/index-_virtual39.js +1 -1
  156. package/dist/index-_virtual4.js +5 -5
  157. package/dist/index-_virtual40.js +1 -1
  158. package/dist/index-_virtual41.js +4 -2
  159. package/dist/index-_virtual42.js +2 -4
  160. package/dist/index-_virtual43.js +1 -1
  161. package/dist/index-_virtual44.js +1 -1
  162. package/dist/index-_virtual45.js +1 -1
  163. package/dist/index-_virtual46.js +1 -1
  164. package/dist/index-_virtual47.js +1 -1
  165. package/dist/index-_virtual48.js +1 -1
  166. package/dist/index-_virtual49.js +1 -1
  167. package/dist/index-_virtual50.js +1 -1
  168. package/dist/index-_virtual51.js +1 -1
  169. package/dist/index-_virtual52.js +1 -1
  170. package/dist/index-_virtual53.js +1 -1
  171. package/dist/index-_virtual54.js +1 -1
  172. package/dist/index-_virtual55.js +1 -1
  173. package/dist/index-_virtual56.js +1 -1
  174. package/dist/index-_virtual57.js +1 -1
  175. package/dist/index-_virtual58.js +4 -2
  176. package/dist/index-_virtual60.js +2 -4
  177. package/dist/index-_virtual61.js +1 -1
  178. package/dist/index-_virtual62.js +4 -2
  179. package/dist/index-_virtual63.js +2 -2
  180. package/dist/index-_virtual75.js +1 -1
  181. package/dist/index-_virtual77.js +4 -2
  182. package/dist/index-_virtual78.js +1 -1
  183. package/dist/index-_virtual79.js +1 -1
  184. package/dist/index-_virtual80.js +1 -1
  185. package/dist/index-_virtual81.js +1 -1
  186. package/dist/index-_virtual82.js +1 -1
  187. package/dist/index-_virtual83.js +1 -1
  188. package/dist/index-_virtual84.js +1 -1
  189. package/dist/index-_virtual85.js +2 -4
  190. package/dist/index-_virtual86.js +2 -2
  191. package/dist/index-applyInternationalSeparatorStyle.js +1 -1
  192. package/dist/index-attributes-to-props.js +1 -1
  193. package/dist/index-cjs.js +19 -75
  194. package/dist/index-colorManipulator3.js +2 -2
  195. package/dist/index-constants.js +38 -8
  196. package/dist/index-constants2.js +8 -38
  197. package/dist/index-createExtensionPattern.js +1 -1
  198. package/dist/index-createStyled2.js +6 -6
  199. package/dist/index-decode-data-html.js +5 -11
  200. package/dist/index-decode-data-xml.js +5 -11
  201. package/dist/index-decode.js +263 -216
  202. package/dist/index-decode_codepoint.js +43 -53
  203. package/dist/index-defaultRanges.js +10 -10
  204. package/dist/index-dist4.js +1 -1
  205. package/dist/index-dist5.js +1 -1
  206. package/dist/index-elementAcceptingRef.js +1 -1
  207. package/dist/index-elementTypeAcceptingRef.js +1 -1
  208. package/dist/index-emotion-cache.browser.esm.js +2 -2
  209. package/dist/index-escape.js +43 -48
  210. package/dist/index-esm2.js +108 -129
  211. package/dist/index-esm3.js +12 -301
  212. package/dist/index-esm4.js +135 -17
  213. package/dist/index-esm5.js +303 -0
  214. package/dist/index-esm6.js +21 -0
  215. package/dist/index-esm7.js +102 -0
  216. package/dist/index-exenv.js +1 -1
  217. package/dist/index-extractCountryCallingCode.js +1 -1
  218. package/dist/index-extractPhoneContext.js +1 -1
  219. package/dist/index-foreignNames.js +101 -108
  220. package/dist/index-helpers3.js +1 -1
  221. package/dist/index-http.store.js +1 -1
  222. package/dist/index-isViablePhoneNumber.js +1 -1
  223. package/dist/index-lib.js +2 -2
  224. package/dist/index-lib2.js +424 -111
  225. package/dist/index-lib3.js +14 -433
  226. package/dist/index-lib4.js +120 -14
  227. package/dist/index-lib5.js +10 -69
  228. package/dist/index-node.js +1 -1
  229. package/dist/index-node2.js +1 -1
  230. package/dist/index-parse2.js +1 -1
  231. package/dist/index-parse3.js +122 -20
  232. package/dist/index-refType.js +1 -1
  233. package/dist/index-responsivePropType.js +1 -1
  234. package/dist/index-sanitize-html.js +91 -48
  235. package/dist/index-stripIddPrefix.js +1 -1
  236. package/dist/index-style-to-object.js +1 -1
  237. package/dist/index-text-animate-words-style.js +12 -12
  238. package/dist/index-tiny-emitter.js +1 -1
  239. package/dist/index-useRteAiAssistant-selection.js +5 -5
  240. package/dist/index-useThemeWithoutDefault3.js +1 -1
  241. package/dist/index-utilities.js +1 -1
  242. package/dist/index-utilities2.js +1 -1
  243. package/dist/index-utils2.js +1 -1
  244. package/dist/index-utils6.js +7 -7
  245. package/dist/index.js +428 -426
  246. package/dist/types/core/Form/stories/SelectChangeDetection.story.d.ts +2 -0
  247. package/dist/types/core/Form/stories/bootstrap/form.test.slice.d.ts +58 -17
  248. package/dist/types/core/RichTextEditor/stories/RichTextEditorStory.story.d.ts +2 -0
  249. package/dist/types/core/RichTextEditor/stories/RichTextEditorWithXSSAttackStory.story.d.ts +2 -0
  250. package/dist/types/core/RichTextEditor/stories/_RichTextEditor.default.d.ts +4 -0
  251. package/dist/types/core/RichTextEditor/stories/bootstrap/richtexteditor.test.slice.d.ts +1 -0
  252. package/dist/types/core/TextHighlighted/stories/TextHighlightedStory.story.d.ts +2 -0
  253. package/dist/types/core/TextHighlighted/stories/TextHighlightedStory2.story.d.ts +2 -0
  254. package/dist/types/core/TextHighlighted/stories/TextHighlightedWithEmphasisStory.story.d.ts +2 -0
  255. package/dist/types/core/TextHighlighted/stories/TextHighlightedWithXSSAttackStory.story.d.ts +2 -0
  256. package/dist/types/core/TextHighlighted/stories/_TextHighlighted.default.d.ts +7 -0
  257. package/dist/types/core/_internal/InputBase/stories/HighlightLengthExceededTest.story.d.ts +2 -0
  258. package/dist/types/core/_internal/InputBase/stories/HighlightUrlTest.story.d.ts +2 -0
  259. package/dist/types/core/_internal/InputBase/stories/HighlightWordsTest.story.d.ts +2 -0
  260. package/dist/types/helpers/sanitize-html.d.ts +18 -3
  261. package/dist/types/index.d.ts +2 -0
  262. package/dist/vanguard-asset-analysis.json +1 -1
  263. package/dist-wordpress/index.js +23637 -22231
  264. package/package.json +5 -2
  265. package/scripts/check-meta-coverage.js +117 -0
  266. package/scripts/generate-exports-props.js +855 -0
  267. package/dist/index-Parser5.js +0 -131
  268. package/dist/index-Tokenizer3.js +0 -141
  269. package/dist/index-_virtual87.js +0 -4
  270. package/dist/index-_virtual88.js +0 -4
  271. package/dist/index-_virtual89.js +0 -4
  272. package/dist/index-_virtual90.js +0 -4
  273. package/dist/index-_virtual91.js +0 -4
  274. package/dist/index-at-rule.js +0 -22
  275. package/dist/index-cjs2.js +0 -23
  276. package/dist/index-comment.js +0 -16
  277. package/dist/index-container.js +0 -223
  278. package/dist/index-css-syntax-error.js +0 -56
  279. package/dist/index-declaration.js +0 -19
  280. package/dist/index-decode-data-html2.js +0 -4
  281. package/dist/index-decode-data-xml2.js +0 -4
  282. package/dist/index-decode2.js +0 -4
  283. package/dist/index-decode_codepoint2.js +0 -4
  284. package/dist/index-document3.js +0 -23
  285. package/dist/index-encode-html.js +0 -15
  286. package/dist/index-encode-html2.js +0 -4
  287. package/dist/index-encode.js +0 -49
  288. package/dist/index-encode2.js +0 -4
  289. package/dist/index-escape-string-regexp.js +0 -11
  290. package/dist/index-escape2.js +0 -4
  291. package/dist/index-feeds.js +0 -92
  292. package/dist/index-feeds2.js +0 -4
  293. package/dist/index-foreignNames2.js +0 -4
  294. package/dist/index-fromJSON.js +0 -46
  295. package/dist/index-helpers4.js +0 -54
  296. package/dist/index-helpers5.js +0 -4
  297. package/dist/index-input3.js +0 -139
  298. package/dist/index-is-plain-object.js +0 -17
  299. package/dist/index-is-plain-object2.js +0 -4
  300. package/dist/index-lazy-result.js +0 -343
  301. package/dist/index-legacy.js +0 -75
  302. package/dist/index-legacy2.js +0 -4
  303. package/dist/index-lib6.js +0 -13
  304. package/dist/index-lib7.js +0 -43
  305. package/dist/index-lib8.js +0 -147
  306. package/dist/index-lib9.js +0 -90
  307. package/dist/index-list3.js +0 -25
  308. package/dist/index-manipulation.js +0 -61
  309. package/dist/index-manipulation2.js +0 -4
  310. package/dist/index-map-generator.js +0 -171
  311. package/dist/index-no-work-result.js +0 -94
  312. package/dist/index-node4.js +0 -259
  313. package/dist/index-non-secure.js +0 -20
  314. package/dist/index-parse-srcset.js +0 -71
  315. package/dist/index-parse-srcset2.js +0 -4
  316. package/dist/index-parse4.js +0 -127
  317. package/dist/index-parser4.js +0 -322
  318. package/dist/index-picocolors.browser.js +0 -13
  319. package/dist/index-picocolors.browser2.js +0 -4
  320. package/dist/index-postcss.js +0 -46
  321. package/dist/index-previous-map.js +0 -92
  322. package/dist/index-processor.js +0 -43
  323. package/dist/index-querying.js +0 -63
  324. package/dist/index-querying2.js +0 -4
  325. package/dist/index-result.js +0 -30
  326. package/dist/index-root.js +0 -38
  327. package/dist/index-rule.js +0 -24
  328. package/dist/index-sanitize-html2.js +0 -672
  329. package/dist/index-stringifier.js +0 -196
  330. package/dist/index-stringify.js +0 -14
  331. package/dist/index-stringify2.js +0 -36
  332. package/dist/index-stringify3.js +0 -4
  333. package/dist/index-symbols.js +0 -8
  334. package/dist/index-symbols2.js +0 -4
  335. package/dist/index-tokenize.js +0 -114
  336. package/dist/index-traversal.js +0 -48
  337. package/dist/index-traversal2.js +0 -4
  338. package/dist/index-warn-once.js +0 -12
  339. package/dist/index-warning2.js +0 -25
  340. /package/dist/{index-Parser6.js → index-Parser4.js} +0 -0
@@ -1,260 +1,320 @@
1
- import { __exports as c } from "./index-Parser3.js";
2
- import { __require as N } from "./index-Tokenizer.js";
3
- import { __require as E } from "./index-decode.js";
4
- var T;
5
- function B() {
6
- if (T) return c;
7
- T = 1;
8
- var k = c && c.__createBinding || (Object.create ? (function(s, t, e, i) {
9
- i === void 0 && (i = e);
10
- var n = Object.getOwnPropertyDescriptor(t, e);
11
- (!n || ("get" in n ? !t.__esModule : n.writable || n.configurable)) && (n = { enumerable: !0, get: function() {
12
- return t[e];
13
- } }), Object.defineProperty(s, i, n);
14
- }) : (function(s, t, e, i) {
15
- i === void 0 && (i = e), s[i] = t[e];
16
- })), O = c && c.__setModuleDefault || (Object.create ? (function(s, t) {
17
- Object.defineProperty(s, "default", { enumerable: !0, value: t });
18
- }) : function(s, t) {
19
- s.default = t;
20
- }), I = c && c.__importStar || function(s) {
21
- if (s && s.__esModule) return s;
22
- var t = {};
23
- if (s != null) for (var e in s) e !== "default" && Object.prototype.hasOwnProperty.call(s, e) && k(t, s, e);
24
- return O(t, s), t;
25
- };
26
- Object.defineProperty(c, "__esModule", { value: !0 }), c.Parser = void 0;
27
- var b = I(/* @__PURE__ */ N()), g = /* @__PURE__ */ E(), f = /* @__PURE__ */ new Set([
28
- "input",
29
- "option",
30
- "optgroup",
31
- "select",
32
- "button",
33
- "datalist",
34
- "textarea"
35
- ]), o = /* @__PURE__ */ new Set(["p"]), m = /* @__PURE__ */ new Set(["thead", "tbody"]), _ = /* @__PURE__ */ new Set(["dd", "dt"]), w = /* @__PURE__ */ new Set(["rt", "rp"]), z = /* @__PURE__ */ new Map([
36
- ["tr", /* @__PURE__ */ new Set(["tr", "th", "td"])],
37
- ["th", /* @__PURE__ */ new Set(["th"])],
38
- ["td", /* @__PURE__ */ new Set(["thead", "th", "td"])],
39
- ["body", /* @__PURE__ */ new Set(["head", "link", "script"])],
40
- ["li", /* @__PURE__ */ new Set(["li"])],
41
- ["p", o],
42
- ["h1", o],
43
- ["h2", o],
44
- ["h3", o],
45
- ["h4", o],
46
- ["h5", o],
47
- ["h6", o],
48
- ["select", f],
49
- ["input", f],
50
- ["output", f],
51
- ["button", f],
52
- ["datalist", f],
53
- ["textarea", f],
54
- ["option", /* @__PURE__ */ new Set(["option"])],
55
- ["optgroup", /* @__PURE__ */ new Set(["optgroup", "option"])],
56
- ["dd", _],
57
- ["dt", _],
58
- ["address", o],
59
- ["article", o],
60
- ["aside", o],
61
- ["blockquote", o],
62
- ["details", o],
63
- ["div", o],
64
- ["dl", o],
65
- ["fieldset", o],
66
- ["figcaption", o],
67
- ["figure", o],
68
- ["footer", o],
69
- ["form", o],
70
- ["header", o],
71
- ["hr", o],
72
- ["main", o],
73
- ["nav", o],
74
- ["ol", o],
75
- ["pre", o],
76
- ["section", o],
77
- ["table", o],
78
- ["ul", o],
79
- ["rt", w],
80
- ["rp", w],
81
- ["tbody", m],
82
- ["tfoot", m]
83
- ]), P = /* @__PURE__ */ new Set([
84
- "area",
85
- "base",
86
- "basefont",
87
- "br",
88
- "col",
89
- "command",
90
- "embed",
91
- "frame",
92
- "hr",
93
- "img",
94
- "input",
95
- "isindex",
96
- "keygen",
97
- "link",
98
- "meta",
99
- "param",
100
- "source",
101
- "track",
102
- "wbr"
103
- ]), x = /* @__PURE__ */ new Set(["math", "svg"]), y = /* @__PURE__ */ new Set([
104
- "mi",
105
- "mo",
106
- "mn",
107
- "ms",
108
- "mtext",
109
- "annotation-xml",
110
- "foreignobject",
111
- "desc",
112
- "title"
113
- ]), M = /\s|\//, j = (
114
- /** @class */
115
- (function() {
116
- function s(t, e) {
117
- e === void 0 && (e = {});
118
- var i, n, r, h, a;
119
- this.options = e, this.startIndex = 0, this.endIndex = 0, this.openTagStart = 0, this.tagname = "", this.attribname = "", this.attribvalue = "", this.attribs = null, this.stack = [], this.foreignContext = [], this.buffers = [], this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1, this.cbs = t ?? {}, this.lowerCaseTagNames = (i = e.lowerCaseTags) !== null && i !== void 0 ? i : !e.xmlMode, this.lowerCaseAttributeNames = (n = e.lowerCaseAttributeNames) !== null && n !== void 0 ? n : !e.xmlMode, this.tokenizer = new ((r = e.Tokenizer) !== null && r !== void 0 ? r : b.default)(this.options, this), (a = (h = this.cbs).onparserinit) === null || a === void 0 || a.call(h, this);
1
+ import S, { QuoteType as u } from "./index-Tokenizer.js";
2
+ import "./index-decode.js";
3
+ import { fromCodePoint as p } from "./index-decode_codepoint.js";
4
+ const f = /* @__PURE__ */ new Set([
5
+ "input",
6
+ "option",
7
+ "optgroup",
8
+ "select",
9
+ "button",
10
+ "datalist",
11
+ "textarea"
12
+ ]), n = /* @__PURE__ */ new Set(["p"]), v = /* @__PURE__ */ new Set(["thead", "tbody"]), w = /* @__PURE__ */ new Set(["dd", "dt"]), x = /* @__PURE__ */ new Set(["rt", "rp"]), C = /* @__PURE__ */ new Map([
13
+ ["tr", /* @__PURE__ */ new Set(["tr", "th", "td"])],
14
+ ["th", /* @__PURE__ */ new Set(["th"])],
15
+ ["td", /* @__PURE__ */ new Set(["thead", "th", "td"])],
16
+ ["body", /* @__PURE__ */ new Set(["head", "link", "script"])],
17
+ ["li", /* @__PURE__ */ new Set(["li"])],
18
+ ["p", n],
19
+ ["h1", n],
20
+ ["h2", n],
21
+ ["h3", n],
22
+ ["h4", n],
23
+ ["h5", n],
24
+ ["h6", n],
25
+ ["select", f],
26
+ ["input", f],
27
+ ["output", f],
28
+ ["button", f],
29
+ ["datalist", f],
30
+ ["textarea", f],
31
+ ["option", /* @__PURE__ */ new Set(["option"])],
32
+ ["optgroup", /* @__PURE__ */ new Set(["optgroup", "option"])],
33
+ ["dd", w],
34
+ ["dt", w],
35
+ ["address", n],
36
+ ["article", n],
37
+ ["aside", n],
38
+ ["blockquote", n],
39
+ ["details", n],
40
+ ["div", n],
41
+ ["dl", n],
42
+ ["fieldset", n],
43
+ ["figcaption", n],
44
+ ["figure", n],
45
+ ["footer", n],
46
+ ["form", n],
47
+ ["header", n],
48
+ ["hr", n],
49
+ ["main", n],
50
+ ["nav", n],
51
+ ["ol", n],
52
+ ["pre", n],
53
+ ["section", n],
54
+ ["table", n],
55
+ ["ul", n],
56
+ ["rt", x],
57
+ ["rp", x],
58
+ ["tbody", v],
59
+ ["tfoot", v]
60
+ ]), T = /* @__PURE__ */ new Set([
61
+ "area",
62
+ "base",
63
+ "basefont",
64
+ "br",
65
+ "col",
66
+ "command",
67
+ "embed",
68
+ "frame",
69
+ "hr",
70
+ "img",
71
+ "input",
72
+ "isindex",
73
+ "keygen",
74
+ "link",
75
+ "meta",
76
+ "param",
77
+ "source",
78
+ "track",
79
+ "wbr"
80
+ ]), _ = /* @__PURE__ */ new Set(["math", "svg"]), k = /* @__PURE__ */ new Set([
81
+ "mi",
82
+ "mo",
83
+ "mn",
84
+ "ms",
85
+ "mtext",
86
+ "annotation-xml",
87
+ "foreignobject",
88
+ "desc",
89
+ "title"
90
+ ]), I = /\s|\//;
91
+ class y {
92
+ constructor(t, e = {}) {
93
+ var s, i, o, h, a;
94
+ this.options = e, this.startIndex = 0, this.endIndex = 0, this.openTagStart = 0, this.tagname = "", this.attribname = "", this.attribvalue = "", this.attribs = null, this.stack = [], this.foreignContext = [], this.buffers = [], this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1, this.cbs = t ?? {}, this.lowerCaseTagNames = (s = e.lowerCaseTags) !== null && s !== void 0 ? s : !e.xmlMode, this.lowerCaseAttributeNames = (i = e.lowerCaseAttributeNames) !== null && i !== void 0 ? i : !e.xmlMode, this.tokenizer = new ((o = e.Tokenizer) !== null && o !== void 0 ? o : S)(this.options, this), (a = (h = this.cbs).onparserinit) === null || a === void 0 || a.call(h, this);
95
+ }
96
+ // Tokenizer event handlers
97
+ /** @internal */
98
+ ontext(t, e) {
99
+ var s, i;
100
+ const o = this.getSlice(t, e);
101
+ this.endIndex = e - 1, (i = (s = this.cbs).ontext) === null || i === void 0 || i.call(s, o), this.startIndex = e;
102
+ }
103
+ /** @internal */
104
+ ontextentity(t) {
105
+ var e, s;
106
+ const i = this.tokenizer.getSectionStart();
107
+ this.endIndex = i - 1, (s = (e = this.cbs).ontext) === null || s === void 0 || s.call(e, p(t)), this.startIndex = i;
108
+ }
109
+ isVoidElement(t) {
110
+ return !this.options.xmlMode && T.has(t);
111
+ }
112
+ /** @internal */
113
+ onopentagname(t, e) {
114
+ this.endIndex = e;
115
+ let s = this.getSlice(t, e);
116
+ this.lowerCaseTagNames && (s = s.toLowerCase()), this.emitOpenTag(s);
117
+ }
118
+ emitOpenTag(t) {
119
+ var e, s, i, o;
120
+ this.openTagStart = this.startIndex, this.tagname = t;
121
+ const h = !this.options.xmlMode && C.get(t);
122
+ if (h)
123
+ for (; this.stack.length > 0 && h.has(this.stack[this.stack.length - 1]); ) {
124
+ const a = this.stack.pop();
125
+ (s = (e = this.cbs).onclosetag) === null || s === void 0 || s.call(e, a, !0);
120
126
  }
121
- return s.prototype.ontext = function(t, e) {
122
- var i, n, r = this.getSlice(t, e);
123
- this.endIndex = e - 1, (n = (i = this.cbs).ontext) === null || n === void 0 || n.call(i, r), this.startIndex = e;
124
- }, s.prototype.ontextentity = function(t) {
125
- var e, i, n = this.tokenizer.getSectionStart();
126
- this.endIndex = n - 1, (i = (e = this.cbs).ontext) === null || i === void 0 || i.call(e, (0, g.fromCodePoint)(t)), this.startIndex = n;
127
- }, s.prototype.isVoidElement = function(t) {
128
- return !this.options.xmlMode && P.has(t);
129
- }, s.prototype.onopentagname = function(t, e) {
130
- this.endIndex = e;
131
- var i = this.getSlice(t, e);
132
- this.lowerCaseTagNames && (i = i.toLowerCase()), this.emitOpenTag(i);
133
- }, s.prototype.emitOpenTag = function(t) {
134
- var e, i, n, r;
135
- this.openTagStart = this.startIndex, this.tagname = t;
136
- var h = !this.options.xmlMode && z.get(t);
137
- if (h)
138
- for (; this.stack.length > 0 && h.has(this.stack[this.stack.length - 1]); ) {
139
- var a = this.stack.pop();
140
- (i = (e = this.cbs).onclosetag) === null || i === void 0 || i.call(e, a, !0);
141
- }
142
- this.isVoidElement(t) || (this.stack.push(t), x.has(t) ? this.foreignContext.push(!0) : y.has(t) && this.foreignContext.push(!1)), (r = (n = this.cbs).onopentagname) === null || r === void 0 || r.call(n, t), this.cbs.onopentag && (this.attribs = {});
143
- }, s.prototype.endOpenTag = function(t) {
144
- var e, i;
145
- this.startIndex = this.openTagStart, this.attribs && ((i = (e = this.cbs).onopentag) === null || i === void 0 || i.call(e, this.tagname, this.attribs, t), this.attribs = null), this.cbs.onclosetag && this.isVoidElement(this.tagname) && this.cbs.onclosetag(this.tagname, !0), this.tagname = "";
146
- }, s.prototype.onopentagend = function(t) {
147
- this.endIndex = t, this.endOpenTag(!1), this.startIndex = t + 1;
148
- }, s.prototype.onclosetag = function(t, e) {
149
- var i, n, r, h, a, u;
150
- this.endIndex = e;
151
- var l = this.getSlice(t, e);
152
- if (this.lowerCaseTagNames && (l = l.toLowerCase()), (x.has(l) || y.has(l)) && this.foreignContext.pop(), this.isVoidElement(l))
153
- !this.options.xmlMode && l === "br" && ((n = (i = this.cbs).onopentagname) === null || n === void 0 || n.call(i, "br"), (h = (r = this.cbs).onopentag) === null || h === void 0 || h.call(r, "br", {}, !0), (u = (a = this.cbs).onclosetag) === null || u === void 0 || u.call(a, "br", !1));
154
- else {
155
- var d = this.stack.lastIndexOf(l);
156
- if (d !== -1)
157
- if (this.cbs.onclosetag)
158
- for (var p = this.stack.length - d; p--; )
159
- this.cbs.onclosetag(this.stack.pop(), p !== 0);
160
- else
161
- this.stack.length = d;
162
- else !this.options.xmlMode && l === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(!0));
163
- }
164
- this.startIndex = e + 1;
165
- }, s.prototype.onselfclosingtag = function(t) {
166
- this.endIndex = t, this.options.xmlMode || this.options.recognizeSelfClosing || this.foreignContext[this.foreignContext.length - 1] ? (this.closeCurrentTag(!1), this.startIndex = t + 1) : this.onopentagend(t);
167
- }, s.prototype.closeCurrentTag = function(t) {
168
- var e, i, n = this.tagname;
169
- this.endOpenTag(t), this.stack[this.stack.length - 1] === n && ((i = (e = this.cbs).onclosetag) === null || i === void 0 || i.call(e, n, !t), this.stack.pop());
170
- }, s.prototype.onattribname = function(t, e) {
171
- this.startIndex = t;
172
- var i = this.getSlice(t, e);
173
- this.attribname = this.lowerCaseAttributeNames ? i.toLowerCase() : i;
174
- }, s.prototype.onattribdata = function(t, e) {
175
- this.attribvalue += this.getSlice(t, e);
176
- }, s.prototype.onattribentity = function(t) {
177
- this.attribvalue += (0, g.fromCodePoint)(t);
178
- }, s.prototype.onattribend = function(t, e) {
179
- var i, n;
180
- this.endIndex = e, (n = (i = this.cbs).onattribute) === null || n === void 0 || n.call(i, this.attribname, this.attribvalue, t === b.QuoteType.Double ? '"' : t === b.QuoteType.Single ? "'" : t === b.QuoteType.NoValue ? void 0 : null), this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = "";
181
- }, s.prototype.getInstructionName = function(t) {
182
- var e = t.search(M), i = e < 0 ? t : t.substr(0, e);
183
- return this.lowerCaseTagNames && (i = i.toLowerCase()), i;
184
- }, s.prototype.ondeclaration = function(t, e) {
185
- this.endIndex = e;
186
- var i = this.getSlice(t, e);
187
- if (this.cbs.onprocessinginstruction) {
188
- var n = this.getInstructionName(i);
189
- this.cbs.onprocessinginstruction("!".concat(n), "!".concat(i));
190
- }
191
- this.startIndex = e + 1;
192
- }, s.prototype.onprocessinginstruction = function(t, e) {
193
- this.endIndex = e;
194
- var i = this.getSlice(t, e);
195
- if (this.cbs.onprocessinginstruction) {
196
- var n = this.getInstructionName(i);
197
- this.cbs.onprocessinginstruction("?".concat(n), "?".concat(i));
198
- }
199
- this.startIndex = e + 1;
200
- }, s.prototype.oncomment = function(t, e, i) {
201
- var n, r, h, a;
202
- this.endIndex = e, (r = (n = this.cbs).oncomment) === null || r === void 0 || r.call(n, this.getSlice(t, e - i)), (a = (h = this.cbs).oncommentend) === null || a === void 0 || a.call(h), this.startIndex = e + 1;
203
- }, s.prototype.oncdata = function(t, e, i) {
204
- var n, r, h, a, u, l, d, p, S, v;
205
- this.endIndex = e;
206
- var C = this.getSlice(t, e - i);
207
- this.options.xmlMode || this.options.recognizeCDATA ? ((r = (n = this.cbs).oncdatastart) === null || r === void 0 || r.call(n), (a = (h = this.cbs).ontext) === null || a === void 0 || a.call(h, C), (l = (u = this.cbs).oncdataend) === null || l === void 0 || l.call(u)) : ((p = (d = this.cbs).oncomment) === null || p === void 0 || p.call(d, "[CDATA[".concat(C, "]]")), (v = (S = this.cbs).oncommentend) === null || v === void 0 || v.call(S)), this.startIndex = e + 1;
208
- }, s.prototype.onend = function() {
209
- var t, e;
127
+ this.isVoidElement(t) || (this.stack.push(t), _.has(t) ? this.foreignContext.push(!0) : k.has(t) && this.foreignContext.push(!1)), (o = (i = this.cbs).onopentagname) === null || o === void 0 || o.call(i, t), this.cbs.onopentag && (this.attribs = {});
128
+ }
129
+ endOpenTag(t) {
130
+ var e, s;
131
+ this.startIndex = this.openTagStart, this.attribs && ((s = (e = this.cbs).onopentag) === null || s === void 0 || s.call(e, this.tagname, this.attribs, t), this.attribs = null), this.cbs.onclosetag && this.isVoidElement(this.tagname) && this.cbs.onclosetag(this.tagname, !0), this.tagname = "";
132
+ }
133
+ /** @internal */
134
+ onopentagend(t) {
135
+ this.endIndex = t, this.endOpenTag(!1), this.startIndex = t + 1;
136
+ }
137
+ /** @internal */
138
+ onclosetag(t, e) {
139
+ var s, i, o, h, a, l;
140
+ this.endIndex = e;
141
+ let r = this.getSlice(t, e);
142
+ if (this.lowerCaseTagNames && (r = r.toLowerCase()), (_.has(r) || k.has(r)) && this.foreignContext.pop(), this.isVoidElement(r))
143
+ !this.options.xmlMode && r === "br" && ((i = (s = this.cbs).onopentagname) === null || i === void 0 || i.call(s, "br"), (h = (o = this.cbs).onopentag) === null || h === void 0 || h.call(o, "br", {}, !0), (l = (a = this.cbs).onclosetag) === null || l === void 0 || l.call(a, "br", !1));
144
+ else {
145
+ const c = this.stack.lastIndexOf(r);
146
+ if (c !== -1)
210
147
  if (this.cbs.onclosetag) {
211
- this.endIndex = this.startIndex;
212
- for (var i = this.stack.length; i > 0; this.cbs.onclosetag(this.stack[--i], !0))
213
- ;
214
- }
215
- (e = (t = this.cbs).onend) === null || e === void 0 || e.call(t);
216
- }, s.prototype.reset = function() {
217
- var t, e, i, n;
218
- (e = (t = this.cbs).onreset) === null || e === void 0 || e.call(t), this.tokenizer.reset(), this.tagname = "", this.attribname = "", this.attribs = null, this.stack.length = 0, this.startIndex = 0, this.endIndex = 0, (n = (i = this.cbs).onparserinit) === null || n === void 0 || n.call(i, this), this.buffers.length = 0, this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1;
219
- }, s.prototype.parseComplete = function(t) {
220
- this.reset(), this.end(t);
221
- }, s.prototype.getSlice = function(t, e) {
222
- for (; t - this.bufferOffset >= this.buffers[0].length; )
223
- this.shiftBuffer();
224
- for (var i = this.buffers[0].slice(t - this.bufferOffset, e - this.bufferOffset); e - this.bufferOffset > this.buffers[0].length; )
225
- this.shiftBuffer(), i += this.buffers[0].slice(0, e - this.bufferOffset);
226
- return i;
227
- }, s.prototype.shiftBuffer = function() {
228
- this.bufferOffset += this.buffers[0].length, this.writeIndex--, this.buffers.shift();
229
- }, s.prototype.write = function(t) {
230
- var e, i;
231
- if (this.ended) {
232
- (i = (e = this.cbs).onerror) === null || i === void 0 || i.call(e, new Error(".write() after done!"));
233
- return;
234
- }
235
- this.buffers.push(t), this.tokenizer.running && (this.tokenizer.write(t), this.writeIndex++);
236
- }, s.prototype.end = function(t) {
237
- var e, i;
238
- if (this.ended) {
239
- (i = (e = this.cbs).onerror) === null || i === void 0 || i.call(e, new Error(".end() after done!"));
240
- return;
241
- }
242
- t && this.write(t), this.ended = !0, this.tokenizer.end();
243
- }, s.prototype.pause = function() {
244
- this.tokenizer.pause();
245
- }, s.prototype.resume = function() {
246
- for (this.tokenizer.resume(); this.tokenizer.running && this.writeIndex < this.buffers.length; )
247
- this.tokenizer.write(this.buffers[this.writeIndex++]);
248
- this.ended && this.tokenizer.end();
249
- }, s.prototype.parseChunk = function(t) {
250
- this.write(t);
251
- }, s.prototype.done = function(t) {
252
- this.end(t);
253
- }, s;
254
- })()
255
- );
256
- return c.Parser = j, c;
148
+ let d = this.stack.length - c;
149
+ for (; d--; )
150
+ this.cbs.onclosetag(this.stack.pop(), d !== 0);
151
+ } else
152
+ this.stack.length = c;
153
+ else !this.options.xmlMode && r === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(!0));
154
+ }
155
+ this.startIndex = e + 1;
156
+ }
157
+ /** @internal */
158
+ onselfclosingtag(t) {
159
+ this.endIndex = t, this.options.xmlMode || this.options.recognizeSelfClosing || this.foreignContext[this.foreignContext.length - 1] ? (this.closeCurrentTag(!1), this.startIndex = t + 1) : this.onopentagend(t);
160
+ }
161
+ closeCurrentTag(t) {
162
+ var e, s;
163
+ const i = this.tagname;
164
+ this.endOpenTag(t), this.stack[this.stack.length - 1] === i && ((s = (e = this.cbs).onclosetag) === null || s === void 0 || s.call(e, i, !t), this.stack.pop());
165
+ }
166
+ /** @internal */
167
+ onattribname(t, e) {
168
+ this.startIndex = t;
169
+ const s = this.getSlice(t, e);
170
+ this.attribname = this.lowerCaseAttributeNames ? s.toLowerCase() : s;
171
+ }
172
+ /** @internal */
173
+ onattribdata(t, e) {
174
+ this.attribvalue += this.getSlice(t, e);
175
+ }
176
+ /** @internal */
177
+ onattribentity(t) {
178
+ this.attribvalue += p(t);
179
+ }
180
+ /** @internal */
181
+ onattribend(t, e) {
182
+ var s, i;
183
+ this.endIndex = e, (i = (s = this.cbs).onattribute) === null || i === void 0 || i.call(s, this.attribname, this.attribvalue, t === u.Double ? '"' : t === u.Single ? "'" : t === u.NoValue ? void 0 : null), this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = "";
184
+ }
185
+ getInstructionName(t) {
186
+ const e = t.search(I);
187
+ let s = e < 0 ? t : t.substr(0, e);
188
+ return this.lowerCaseTagNames && (s = s.toLowerCase()), s;
189
+ }
190
+ /** @internal */
191
+ ondeclaration(t, e) {
192
+ this.endIndex = e;
193
+ const s = this.getSlice(t, e);
194
+ if (this.cbs.onprocessinginstruction) {
195
+ const i = this.getInstructionName(s);
196
+ this.cbs.onprocessinginstruction(`!${i}`, `!${s}`);
197
+ }
198
+ this.startIndex = e + 1;
199
+ }
200
+ /** @internal */
201
+ onprocessinginstruction(t, e) {
202
+ this.endIndex = e;
203
+ const s = this.getSlice(t, e);
204
+ if (this.cbs.onprocessinginstruction) {
205
+ const i = this.getInstructionName(s);
206
+ this.cbs.onprocessinginstruction(`?${i}`, `?${s}`);
207
+ }
208
+ this.startIndex = e + 1;
209
+ }
210
+ /** @internal */
211
+ oncomment(t, e, s) {
212
+ var i, o, h, a;
213
+ this.endIndex = e, (o = (i = this.cbs).oncomment) === null || o === void 0 || o.call(i, this.getSlice(t, e - s)), (a = (h = this.cbs).oncommentend) === null || a === void 0 || a.call(h), this.startIndex = e + 1;
214
+ }
215
+ /** @internal */
216
+ oncdata(t, e, s) {
217
+ var i, o, h, a, l, r, c, d, g, b;
218
+ this.endIndex = e;
219
+ const m = this.getSlice(t, e - s);
220
+ this.options.xmlMode || this.options.recognizeCDATA ? ((o = (i = this.cbs).oncdatastart) === null || o === void 0 || o.call(i), (a = (h = this.cbs).ontext) === null || a === void 0 || a.call(h, m), (r = (l = this.cbs).oncdataend) === null || r === void 0 || r.call(l)) : ((d = (c = this.cbs).oncomment) === null || d === void 0 || d.call(c, `[CDATA[${m}]]`), (b = (g = this.cbs).oncommentend) === null || b === void 0 || b.call(g)), this.startIndex = e + 1;
221
+ }
222
+ /** @internal */
223
+ onend() {
224
+ var t, e;
225
+ if (this.cbs.onclosetag) {
226
+ this.endIndex = this.startIndex;
227
+ for (let s = this.stack.length; s > 0; this.cbs.onclosetag(this.stack[--s], !0))
228
+ ;
229
+ }
230
+ (e = (t = this.cbs).onend) === null || e === void 0 || e.call(t);
231
+ }
232
+ /**
233
+ * Resets the parser to a blank state, ready to parse a new HTML document
234
+ */
235
+ reset() {
236
+ var t, e, s, i;
237
+ (e = (t = this.cbs).onreset) === null || e === void 0 || e.call(t), this.tokenizer.reset(), this.tagname = "", this.attribname = "", this.attribs = null, this.stack.length = 0, this.startIndex = 0, this.endIndex = 0, (i = (s = this.cbs).onparserinit) === null || i === void 0 || i.call(s, this), this.buffers.length = 0, this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1;
238
+ }
239
+ /**
240
+ * Resets the parser, then parses a complete document and
241
+ * pushes it to the handler.
242
+ *
243
+ * @param data Document to parse.
244
+ */
245
+ parseComplete(t) {
246
+ this.reset(), this.end(t);
247
+ }
248
+ getSlice(t, e) {
249
+ for (; t - this.bufferOffset >= this.buffers[0].length; )
250
+ this.shiftBuffer();
251
+ let s = this.buffers[0].slice(t - this.bufferOffset, e - this.bufferOffset);
252
+ for (; e - this.bufferOffset > this.buffers[0].length; )
253
+ this.shiftBuffer(), s += this.buffers[0].slice(0, e - this.bufferOffset);
254
+ return s;
255
+ }
256
+ shiftBuffer() {
257
+ this.bufferOffset += this.buffers[0].length, this.writeIndex--, this.buffers.shift();
258
+ }
259
+ /**
260
+ * Parses a chunk of data and calls the corresponding callbacks.
261
+ *
262
+ * @param chunk Chunk to parse.
263
+ */
264
+ write(t) {
265
+ var e, s;
266
+ if (this.ended) {
267
+ (s = (e = this.cbs).onerror) === null || s === void 0 || s.call(e, new Error(".write() after done!"));
268
+ return;
269
+ }
270
+ this.buffers.push(t), this.tokenizer.running && (this.tokenizer.write(t), this.writeIndex++);
271
+ }
272
+ /**
273
+ * Parses the end of the buffer and clears the stack, calls onend.
274
+ *
275
+ * @param chunk Optional final chunk to parse.
276
+ */
277
+ end(t) {
278
+ var e, s;
279
+ if (this.ended) {
280
+ (s = (e = this.cbs).onerror) === null || s === void 0 || s.call(e, new Error(".end() after done!"));
281
+ return;
282
+ }
283
+ t && this.write(t), this.ended = !0, this.tokenizer.end();
284
+ }
285
+ /**
286
+ * Pauses parsing. The parser won't emit events until `resume` is called.
287
+ */
288
+ pause() {
289
+ this.tokenizer.pause();
290
+ }
291
+ /**
292
+ * Resumes parsing after `pause` was called.
293
+ */
294
+ resume() {
295
+ for (this.tokenizer.resume(); this.tokenizer.running && this.writeIndex < this.buffers.length; )
296
+ this.tokenizer.write(this.buffers[this.writeIndex++]);
297
+ this.ended && this.tokenizer.end();
298
+ }
299
+ /**
300
+ * Alias of `write`, for backwards compatibility.
301
+ *
302
+ * @param chunk Chunk to parse.
303
+ * @deprecated
304
+ */
305
+ parseChunk(t) {
306
+ this.write(t);
307
+ }
308
+ /**
309
+ * Alias of `end`, for backwards compatibility.
310
+ *
311
+ * @param chunk Optional final chunk to parse.
312
+ * @deprecated
313
+ */
314
+ done(t) {
315
+ this.end(t);
316
+ }
257
317
  }
258
318
  export {
259
- B as __require
319
+ y as Parser
260
320
  };