@rankingcoach/vanguard 1.3.1 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-AMPMMidnightParser.js +1 -1
- package/dist/index-AMPMParser.js +1 -1
- package/dist/index-Accordion2.js +1 -1
- package/dist/index-AccordionDetails.js +1 -1
- package/dist/index-AccordionSummary.js +1 -1
- package/dist/index-AiGlow.js +1 -1
- package/dist/index-AppBar2.js +1 -1
- package/dist/index-Autocomplete.js +2 -2
- package/dist/index-Autocomplete2.js +1 -1
- package/dist/index-Backdrop.js +1 -1
- package/dist/index-BasePopper.js +1 -1
- package/dist/index-Box.js +1 -1
- package/dist/index-Button2.js +1 -1
- package/dist/index-ButtonBase.js +1 -1
- package/dist/index-CSSTransition.js +1 -1
- package/dist/index-Calendar.js +20 -20
- package/dist/index-CalendarPicker.js +1 -1
- package/dist/index-Chip.js +1 -1
- package/dist/index-ClickAwayListener.js +1 -1
- package/dist/index-ClockPicker.js +1 -1
- package/dist/index-Collapse2.js +1 -1
- package/dist/index-ControlledValuePlugin.js +1 -1
- package/dist/index-CreditCard.js +1 -1
- package/dist/index-DateInput.js +5 -5
- package/dist/index-DateParser.js +1 -1
- package/dist/index-DatePicker2.js +1 -1
- package/dist/index-DateRange2.js +7 -7
- package/dist/index-DateRangePicker2.js +1 -1
- package/dist/index-DayCell.js +5 -5
- package/dist/index-DayOfYearParser.js +1 -1
- package/dist/index-DayParser.js +1 -1
- package/dist/index-DayPeriodParser.js +1 -1
- package/dist/index-DefaultPropsProvider.js +1 -1
- package/dist/index-DefaultPropsProvider2.js +1 -1
- package/dist/index-DefaultValuePlugin.js +1 -1
- package/dist/index-DefinedRange.js +1 -1
- package/dist/index-DesktopDatePicker.js +1 -1
- package/dist/index-Dialog.js +1 -1
- package/dist/index-DialogActions.js +1 -1
- package/dist/index-DialogContent.js +1 -1
- package/dist/index-Drawer.js +1 -1
- package/dist/index-Drawer2.js +1 -1
- package/dist/index-EraParser.js +1 -1
- package/dist/index-ExtendedYearParser.js +1 -1
- package/dist/index-Fade.js +1 -1
- package/dist/index-FilledInput.js +1 -1
- package/dist/index-FocusTrap.js +1 -1
- package/dist/index-FormControl2.js +1 -1
- package/dist/index-FormHelperText.js +1 -1
- package/dist/index-FormLabel.js +1 -1
- package/dist/index-FractionOfSecondParser.js +1 -1
- package/dist/index-GlobalStyles.js +1 -1
- package/dist/index-GlobalStyles2.js +1 -1
- package/dist/index-GlobalStyles3.js +1 -1
- package/dist/index-Grid.js +1 -1
- package/dist/index-Grow.js +1 -1
- package/dist/index-Header.js +1 -1
- package/dist/index-Hour0To11Parser.js +1 -1
- package/dist/index-Hour0to23Parser.js +1 -1
- package/dist/index-Hour1To24Parser.js +1 -1
- package/dist/index-Hour1to12Parser.js +1 -1
- package/dist/index-HyperlinkPlugin.js +1 -1
- package/dist/index-ISODayParser.js +1 -1
- package/dist/index-ISOTimezoneParser.js +1 -1
- package/dist/index-ISOTimezoneWithZParser.js +1 -1
- package/dist/index-ISOWeekParser.js +1 -1
- package/dist/index-ISOWeekYearParser.js +1 -1
- package/dist/index-IconButton2.js +1 -1
- package/dist/index-Input2.js +1 -1
- package/dist/index-InputAdornment.js +1 -1
- package/dist/index-InputBase.js +48 -43
- package/dist/index-InputBase2.js +1 -1
- package/dist/index-InputLabel.js +1 -1
- package/dist/index-InputRangeField.js +1 -1
- package/dist/index-KeywordNode.js +1 -1
- package/dist/index-KeywordPlugin.js +1 -1
- package/dist/index-LinearProgress.js +1 -1
- package/dist/index-List2.js +1 -1
- package/dist/index-ListSubheader.js +1 -1
- package/dist/index-LocalDayParser.js +1 -1
- package/dist/index-LocalWeekParser.js +1 -1
- package/dist/index-LocalWeekYearParser.js +1 -1
- package/dist/index-LocalizationProvider.js +1 -1
- package/dist/index-LoginButton.js +1 -1
- package/dist/index-Menu.js +1 -1
- package/dist/index-MenuItem.js +1 -1
- package/dist/index-MenuList.js +1 -1
- package/dist/index-MinuteParser.js +1 -1
- package/dist/index-MobileDatePicker.js +1 -1
- package/dist/index-Modal2.js +1 -1
- package/dist/index-Month.js +11 -11
- package/dist/index-MonthParser.js +1 -1
- package/dist/index-MonthPicker.js +1 -1
- package/dist/index-NativeSelectInput.js +1 -1
- package/dist/index-NotchedOutline.js +1 -1
- package/dist/index-OnChangeContentPlugin.js +1 -1
- package/dist/index-OnFocusOnBlurPlugin.js +1 -1
- package/dist/index-OutlinedInput.js +1 -1
- package/dist/index-Paper.js +1 -1
- package/dist/index-Parser2.js +314 -255
- package/dist/index-Parser3.js +129 -2
- package/dist/index-PickersDay.js +1 -1
- package/dist/index-Popover2.js +1 -1
- package/dist/index-Popper.js +1 -1
- package/dist/index-Portal.js +1 -1
- package/dist/index-PropTypes.js +1 -1
- package/dist/index-QuarterParser.js +1 -1
- package/dist/index-QuoteContainer.js +1 -1
- package/dist/index-Ripple.js +1 -1
- package/dist/index-RtlProvider.js +1 -1
- package/dist/index-ScrollbarSize.js +1 -1
- package/dist/index-SecondParser.js +1 -1
- package/dist/index-Select2.js +1 -1
- package/dist/index-SelectInput2.js +1 -1
- package/dist/index-Skeleton2.js +1 -1
- package/dist/index-Slide.js +1 -1
- package/dist/index-Slider2.js +1 -1
- package/dist/index-SliderValueLabel.js +1 -1
- package/dist/index-Snackbar2.js +1 -1
- package/dist/index-SnackbarContent.js +1 -1
- package/dist/index-StandAloneLocalDayParser.js +1 -1
- package/dist/index-StandAloneMonthParser.js +1 -1
- package/dist/index-StandAloneQuarterParser.js +1 -1
- package/dist/index-StyledEngineProvider.js +1 -1
- package/dist/index-StyledSVG2.js +1 -1
- package/dist/index-SvgIcon.js +1 -1
- package/dist/index-Tab2.js +1 -1
- package/dist/index-TabScrollButton.js +1 -1
- package/dist/index-Tabs2.js +1 -1
- package/dist/index-Text.js +18 -18
- package/dist/index-TextField.js +1 -1
- package/dist/index-TextHighlighted.js +23 -19
- package/dist/index-TextareaAutosize.js +1 -1
- package/dist/index-TimestampMillisecondsParser.js +1 -1
- package/dist/index-TimestampSecondsParser.js +1 -1
- package/dist/index-ToggleButton2.js +1 -1
- package/dist/index-ToggleButtonGroup2.js +1 -1
- package/dist/index-Tokenizer.js +411 -334
- package/dist/index-Tokenizer2.js +139 -2
- package/dist/index-Toolbar2.js +1 -1
- package/dist/index-Tooltip.js +1 -1
- package/dist/index-TouchRipple.js +1 -1
- package/dist/index-Transition.js +1 -1
- package/dist/index-TransitionGroup.js +1 -1
- package/dist/index-Typography.js +1 -1
- package/dist/index-YearParser.js +1 -1
- package/dist/index-YearPicker.js +1 -1
- package/dist/index-_virtual12.js +1 -1
- package/dist/index-_virtual15.js +2 -5
- package/dist/index-_virtual16.js +5 -3
- package/dist/index-_virtual17.js +5 -2
- package/dist/index-_virtual18.js +2 -7
- package/dist/index-_virtual19.js +5 -2
- package/dist/index-_virtual2.js +5 -5
- package/dist/index-_virtual20.js +2 -5
- package/dist/index-_virtual21.js +2 -2
- package/dist/index-_virtual22.js +2 -2
- package/dist/index-_virtual23.js +2 -3
- package/dist/index-_virtual24.js +2 -2
- package/dist/index-_virtual25.js +2 -2
- package/dist/index-_virtual26.js +2 -2
- package/dist/index-_virtual27.js +2 -2
- package/dist/index-_virtual28.js +2 -2
- package/dist/index-_virtual3.js +4 -4
- package/dist/index-_virtual30.js +2 -2
- package/dist/index-_virtual31.js +2 -2
- package/dist/index-_virtual32.js +3 -2
- package/dist/index-_virtual34.js +2 -2
- package/dist/index-_virtual35.js +2 -4
- package/dist/index-_virtual36.js +1 -1
- package/dist/index-_virtual37.js +1 -1
- package/dist/index-_virtual38.js +1 -1
- package/dist/index-_virtual39.js +1 -1
- package/dist/index-_virtual4.js +5 -5
- package/dist/index-_virtual40.js +1 -1
- package/dist/index-_virtual41.js +4 -2
- package/dist/index-_virtual42.js +2 -4
- package/dist/index-_virtual43.js +1 -1
- package/dist/index-_virtual44.js +1 -1
- package/dist/index-_virtual45.js +1 -1
- package/dist/index-_virtual46.js +1 -1
- package/dist/index-_virtual47.js +1 -1
- package/dist/index-_virtual48.js +1 -1
- package/dist/index-_virtual49.js +1 -1
- package/dist/index-_virtual50.js +1 -1
- package/dist/index-_virtual51.js +1 -1
- package/dist/index-_virtual52.js +1 -1
- package/dist/index-_virtual53.js +1 -1
- package/dist/index-_virtual54.js +1 -1
- package/dist/index-_virtual55.js +1 -1
- package/dist/index-_virtual56.js +1 -1
- package/dist/index-_virtual57.js +1 -1
- package/dist/index-_virtual58.js +4 -2
- package/dist/index-_virtual60.js +2 -4
- package/dist/index-_virtual61.js +1 -1
- package/dist/index-_virtual62.js +4 -2
- package/dist/index-_virtual63.js +2 -2
- package/dist/index-_virtual69.js +2 -2
- package/dist/index-_virtual70.js +4 -2
- package/dist/index-_virtual71.js +2 -4
- package/dist/index-_virtual72.js +4 -2
- package/dist/index-_virtual73.js +1 -1
- package/dist/index-_virtual74.js +1 -1
- package/dist/index-_virtual75.js +2 -4
- package/dist/index-_virtual76.js +2 -2
- package/dist/index-_virtual77.js +4 -2
- package/dist/index-_virtual78.js +1 -1
- package/dist/index-_virtual79.js +1 -1
- package/dist/index-_virtual80.js +1 -1
- package/dist/index-_virtual81.js +1 -1
- package/dist/index-_virtual82.js +1 -1
- package/dist/index-_virtual83.js +1 -1
- package/dist/index-_virtual84.js +1 -1
- package/dist/index-_virtual85.js +2 -4
- package/dist/index-_virtual86.js +2 -2
- package/dist/index-accessibility.js +1 -1
- package/dist/index-applyInternationalSeparatorStyle.js +1 -1
- package/dist/index-attributes-to-props.js +1 -1
- package/dist/index-cjs.js +19 -75
- package/dist/index-colorManipulator3.js +2 -2
- package/dist/index-constants.js +38 -8
- package/dist/index-constants2.js +8 -38
- package/dist/index-createExtensionPattern.js +1 -1
- package/dist/index-createStyled2.js +6 -6
- package/dist/index-decode-data-html.js +5 -11
- package/dist/index-decode-data-xml.js +5 -11
- package/dist/index-decode.js +263 -216
- package/dist/index-decode_codepoint.js +43 -53
- package/dist/index-defaultRanges.js +10 -10
- package/dist/index-dist4.js +1 -1
- package/dist/index-dist5.js +1 -1
- package/dist/index-elementAcceptingRef.js +1 -1
- package/dist/index-elementTypeAcceptingRef.js +1 -1
- package/dist/index-emotion-cache.browser.esm.js +2 -2
- package/dist/index-escape.js +43 -48
- package/dist/index-esm2.js +108 -129
- package/dist/index-esm3.js +12 -301
- package/dist/index-esm4.js +135 -17
- package/dist/index-esm5.js +303 -0
- package/dist/index-esm6.js +21 -0
- package/dist/index-esm7.js +102 -0
- package/dist/index-exenv.js +1 -1
- package/dist/index-extractCountryCallingCode.js +1 -1
- package/dist/index-extractPhoneContext.js +1 -1
- package/dist/index-foreignNames.js +101 -108
- package/dist/index-helpers3.js +1 -1
- package/dist/index-http.store.js +1 -1
- package/dist/index-isViablePhoneNumber.js +1 -1
- package/dist/index-keycode.js +1 -1
- package/dist/index-lib.js +2 -2
- package/dist/index-lib2.js +424 -111
- package/dist/index-lib3.js +14 -433
- package/dist/index-lib4.js +120 -14
- package/dist/index-lib5.js +10 -69
- package/dist/index-mpd-parser.es.js +1 -1
- package/dist/index-node.js +1 -1
- package/dist/index-node2.js +1 -1
- package/dist/index-parse2.js +1 -1
- package/dist/index-parse3.js +122 -20
- package/dist/index-refType.js +1 -1
- package/dist/index-responsivePropType.js +1 -1
- package/dist/index-sanitize-html.js +91 -48
- package/dist/index-stripIddPrefix.js +1 -1
- package/dist/index-style-to-object.js +1 -1
- package/dist/index-text-animate-words-style.js +12 -12
- package/dist/index-tiny-emitter.js +1 -1
- package/dist/index-useHyperlinkEditor.js +1 -1
- package/dist/index-useLexicalToolbar.js +1 -1
- package/dist/index-useRteAiAssistant-selection.js +5 -5
- package/dist/index-useThemeWithoutDefault3.js +1 -1
- package/dist/index-utilities.js +1 -1
- package/dist/index-utilities2.js +1 -1
- package/dist/index-utils2.js +1 -1
- package/dist/index-utils6.js +7 -7
- package/dist/index.js +428 -426
- package/dist/types/core/RichTextEditor/stories/RichTextEditorStory.story.d.ts +2 -0
- package/dist/types/core/RichTextEditor/stories/RichTextEditorWithXSSAttackStory.story.d.ts +2 -0
- package/dist/types/core/RichTextEditor/stories/_RichTextEditor.default.d.ts +4 -0
- package/dist/types/core/RichTextEditor/stories/bootstrap/richtexteditor.test.slice.d.ts +1 -0
- package/dist/types/core/TextHighlighted/stories/TextHighlightedStory.story.d.ts +2 -0
- package/dist/types/core/TextHighlighted/stories/TextHighlightedStory2.story.d.ts +2 -0
- package/dist/types/core/TextHighlighted/stories/TextHighlightedWithEmphasisStory.story.d.ts +2 -0
- package/dist/types/core/TextHighlighted/stories/TextHighlightedWithXSSAttackStory.story.d.ts +2 -0
- package/dist/types/core/TextHighlighted/stories/_TextHighlighted.default.d.ts +7 -0
- package/dist/types/core/_internal/InputBase/stories/HighlightLengthExceededTest.story.d.ts +2 -0
- package/dist/types/core/_internal/InputBase/stories/HighlightUrlTest.story.d.ts +2 -0
- package/dist/types/core/_internal/InputBase/stories/HighlightWordsTest.story.d.ts +2 -0
- package/dist/types/helpers/sanitize-html.d.ts +18 -3
- package/dist/types/index.d.ts +2 -0
- package/dist/vanguard-asset-analysis.json +1 -1
- package/dist-wordpress/index.js +23651 -22245
- package/package.json +5 -2
- package/scripts/check-meta-coverage.js +117 -0
- package/scripts/generate-exports-props.js +855 -0
- package/dist/index-Parser5.js +0 -131
- package/dist/index-Tokenizer3.js +0 -141
- package/dist/index-_virtual87.js +0 -4
- package/dist/index-_virtual88.js +0 -4
- package/dist/index-_virtual89.js +0 -4
- package/dist/index-_virtual90.js +0 -4
- package/dist/index-_virtual91.js +0 -4
- package/dist/index-at-rule.js +0 -22
- package/dist/index-cjs2.js +0 -23
- package/dist/index-comment.js +0 -16
- package/dist/index-container.js +0 -223
- package/dist/index-css-syntax-error.js +0 -56
- package/dist/index-declaration.js +0 -19
- package/dist/index-decode-data-html2.js +0 -4
- package/dist/index-decode-data-xml2.js +0 -4
- package/dist/index-decode2.js +0 -4
- package/dist/index-decode_codepoint2.js +0 -4
- package/dist/index-document3.js +0 -23
- package/dist/index-encode-html.js +0 -15
- package/dist/index-encode-html2.js +0 -4
- package/dist/index-encode.js +0 -49
- package/dist/index-encode2.js +0 -4
- package/dist/index-escape-string-regexp.js +0 -11
- package/dist/index-escape2.js +0 -4
- package/dist/index-feeds.js +0 -92
- package/dist/index-feeds2.js +0 -4
- package/dist/index-foreignNames2.js +0 -4
- package/dist/index-fromJSON.js +0 -46
- package/dist/index-helpers4.js +0 -54
- package/dist/index-helpers5.js +0 -4
- package/dist/index-input3.js +0 -139
- package/dist/index-is-plain-object.js +0 -17
- package/dist/index-is-plain-object2.js +0 -4
- package/dist/index-lazy-result.js +0 -343
- package/dist/index-legacy.js +0 -75
- package/dist/index-legacy2.js +0 -4
- package/dist/index-lib6.js +0 -13
- package/dist/index-lib7.js +0 -43
- package/dist/index-lib8.js +0 -147
- package/dist/index-lib9.js +0 -90
- package/dist/index-list3.js +0 -25
- package/dist/index-manipulation.js +0 -61
- package/dist/index-manipulation2.js +0 -4
- package/dist/index-map-generator.js +0 -171
- package/dist/index-no-work-result.js +0 -94
- package/dist/index-node4.js +0 -259
- package/dist/index-non-secure.js +0 -20
- package/dist/index-parse-srcset.js +0 -71
- package/dist/index-parse-srcset2.js +0 -4
- package/dist/index-parse4.js +0 -127
- package/dist/index-parser4.js +0 -322
- package/dist/index-picocolors.browser.js +0 -13
- package/dist/index-picocolors.browser2.js +0 -4
- package/dist/index-postcss.js +0 -46
- package/dist/index-previous-map.js +0 -92
- package/dist/index-processor.js +0 -43
- package/dist/index-querying.js +0 -63
- package/dist/index-querying2.js +0 -4
- package/dist/index-result.js +0 -30
- package/dist/index-root.js +0 -38
- package/dist/index-rule.js +0 -24
- package/dist/index-sanitize-html2.js +0 -672
- package/dist/index-stringifier.js +0 -196
- package/dist/index-stringify.js +0 -14
- package/dist/index-stringify2.js +0 -36
- package/dist/index-stringify3.js +0 -4
- package/dist/index-symbols.js +0 -8
- package/dist/index-symbols2.js +0 -4
- package/dist/index-tokenize.js +0 -114
- package/dist/index-traversal.js +0 -48
- package/dist/index-traversal2.js +0 -4
- package/dist/index-warn-once.js +0 -12
- package/dist/index-warning2.js +0 -25
- /package/dist/{index-Parser6.js → index-Parser4.js} +0 -0
package/dist/index-Tokenizer.js
CHANGED
|
@@ -1,343 +1,420 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { determineBranch as m, BinTrieFlags as c } from "./index-decode.js";
|
|
2
|
+
import x from "./index-decode-data-xml.js";
|
|
3
|
+
import b from "./index-decode-data-html.js";
|
|
4
|
+
import { replaceCodePoint as I } from "./index-decode_codepoint.js";
|
|
5
|
+
var s;
|
|
6
|
+
(function(e) {
|
|
7
|
+
e[e.Tab = 9] = "Tab", e[e.NewLine = 10] = "NewLine", e[e.FormFeed = 12] = "FormFeed", e[e.CarriageReturn = 13] = "CarriageReturn", e[e.Space = 32] = "Space", e[e.ExclamationMark = 33] = "ExclamationMark", e[e.Number = 35] = "Number", e[e.Amp = 38] = "Amp", e[e.SingleQuote = 39] = "SingleQuote", e[e.DoubleQuote = 34] = "DoubleQuote", e[e.Dash = 45] = "Dash", e[e.Slash = 47] = "Slash", e[e.Zero = 48] = "Zero", e[e.Nine = 57] = "Nine", e[e.Semi = 59] = "Semi", e[e.Lt = 60] = "Lt", e[e.Eq = 61] = "Eq", e[e.Gt = 62] = "Gt", e[e.Questionmark = 63] = "Questionmark", e[e.UpperA = 65] = "UpperA", e[e.LowerA = 97] = "LowerA", e[e.UpperF = 70] = "UpperF", e[e.LowerF = 102] = "LowerF", e[e.UpperZ = 90] = "UpperZ", e[e.LowerZ = 122] = "LowerZ", e[e.LowerX = 120] = "LowerX", e[e.OpeningSquareBracket = 91] = "OpeningSquareBracket";
|
|
8
|
+
})(s || (s = {}));
|
|
9
|
+
var i;
|
|
10
|
+
(function(e) {
|
|
11
|
+
e[e.Text = 1] = "Text", e[e.BeforeTagName = 2] = "BeforeTagName", e[e.InTagName = 3] = "InTagName", e[e.InSelfClosingTag = 4] = "InSelfClosingTag", e[e.BeforeClosingTagName = 5] = "BeforeClosingTagName", e[e.InClosingTagName = 6] = "InClosingTagName", e[e.AfterClosingTagName = 7] = "AfterClosingTagName", e[e.BeforeAttributeName = 8] = "BeforeAttributeName", e[e.InAttributeName = 9] = "InAttributeName", e[e.AfterAttributeName = 10] = "AfterAttributeName", e[e.BeforeAttributeValue = 11] = "BeforeAttributeValue", e[e.InAttributeValueDq = 12] = "InAttributeValueDq", e[e.InAttributeValueSq = 13] = "InAttributeValueSq", e[e.InAttributeValueNq = 14] = "InAttributeValueNq", e[e.BeforeDeclaration = 15] = "BeforeDeclaration", e[e.InDeclaration = 16] = "InDeclaration", e[e.InProcessingInstruction = 17] = "InProcessingInstruction", e[e.BeforeComment = 18] = "BeforeComment", e[e.CDATASequence = 19] = "CDATASequence", e[e.InSpecialComment = 20] = "InSpecialComment", e[e.InCommentLike = 21] = "InCommentLike", e[e.BeforeSpecialS = 22] = "BeforeSpecialS", e[e.SpecialStartSequence = 23] = "SpecialStartSequence", e[e.InSpecialTag = 24] = "InSpecialTag", e[e.BeforeEntity = 25] = "BeforeEntity", e[e.BeforeNumericEntity = 26] = "BeforeNumericEntity", e[e.InNamedEntity = 27] = "InNamedEntity", e[e.InNumericEntity = 28] = "InNumericEntity", e[e.InHexEntity = 29] = "InHexEntity";
|
|
12
|
+
})(i || (i = {}));
|
|
13
|
+
function h(e) {
|
|
14
|
+
return e === s.Space || e === s.NewLine || e === s.Tab || e === s.FormFeed || e === s.CarriageReturn;
|
|
15
|
+
}
|
|
16
|
+
function u(e) {
|
|
17
|
+
return e === s.Slash || e === s.Gt || h(e);
|
|
18
|
+
}
|
|
19
|
+
function f(e) {
|
|
20
|
+
return e >= s.Zero && e <= s.Nine;
|
|
21
|
+
}
|
|
22
|
+
function d(e) {
|
|
23
|
+
return e >= s.LowerA && e <= s.LowerZ || e >= s.UpperA && e <= s.UpperZ;
|
|
24
|
+
}
|
|
25
|
+
function S(e) {
|
|
26
|
+
return e >= s.UpperA && e <= s.UpperF || e >= s.LowerA && e <= s.LowerF;
|
|
27
|
+
}
|
|
28
|
+
var o;
|
|
29
|
+
(function(e) {
|
|
30
|
+
e[e.NoValue = 0] = "NoValue", e[e.Unquoted = 1] = "Unquoted", e[e.Single = 2] = "Single", e[e.Double = 3] = "Double";
|
|
31
|
+
})(o || (o = {}));
|
|
32
|
+
const a = {
|
|
33
|
+
Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
|
|
34
|
+
CdataEnd: new Uint8Array([93, 93, 62]),
|
|
35
|
+
CommentEnd: new Uint8Array([45, 45, 62]),
|
|
36
|
+
ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),
|
|
37
|
+
StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),
|
|
38
|
+
TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101])
|
|
39
|
+
// `</title`
|
|
40
|
+
};
|
|
41
|
+
class E {
|
|
42
|
+
constructor({ xmlMode: t = !1, decodeEntities: n = !0 }, r) {
|
|
43
|
+
this.cbs = r, this.state = i.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.baseState = i.Text, this.isSpecial = !1, this.running = !0, this.offset = 0, this.currentSequence = void 0, this.sequenceIndex = 0, this.trieIndex = 0, this.trieCurrent = 0, this.entityResult = 0, this.entityExcess = 0, this.xmlMode = t, this.decodeEntities = n, this.entityTrie = t ? x : b;
|
|
44
|
+
}
|
|
45
|
+
reset() {
|
|
46
|
+
this.state = i.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.baseState = i.Text, this.currentSequence = void 0, this.running = !0, this.offset = 0;
|
|
47
|
+
}
|
|
48
|
+
write(t) {
|
|
49
|
+
this.offset += this.buffer.length, this.buffer = t, this.parse();
|
|
50
|
+
}
|
|
51
|
+
end() {
|
|
52
|
+
this.running && this.finish();
|
|
53
|
+
}
|
|
54
|
+
pause() {
|
|
55
|
+
this.running = !1;
|
|
56
|
+
}
|
|
57
|
+
resume() {
|
|
58
|
+
this.running = !0, this.index < this.buffer.length + this.offset && this.parse();
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The current index within all of the written data.
|
|
62
|
+
*/
|
|
63
|
+
getIndex() {
|
|
64
|
+
return this.index;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The start of the current section.
|
|
68
|
+
*/
|
|
69
|
+
getSectionStart() {
|
|
70
|
+
return this.sectionStart;
|
|
71
|
+
}
|
|
72
|
+
stateText(t) {
|
|
73
|
+
t === s.Lt || !this.decodeEntities && this.fastForwardTo(s.Lt) ? (this.index > this.sectionStart && this.cbs.ontext(this.sectionStart, this.index), this.state = i.BeforeTagName, this.sectionStart = this.index) : this.decodeEntities && t === s.Amp && (this.state = i.BeforeEntity);
|
|
74
|
+
}
|
|
75
|
+
stateSpecialStartSequence(t) {
|
|
76
|
+
const n = this.sequenceIndex === this.currentSequence.length;
|
|
77
|
+
if (!(n ? (
|
|
78
|
+
// If we are at the end of the sequence, make sure the tag name has ended
|
|
79
|
+
u(t)
|
|
80
|
+
) : (
|
|
81
|
+
// Otherwise, do a case-insensitive comparison
|
|
82
|
+
(t | 32) === this.currentSequence[this.sequenceIndex]
|
|
83
|
+
)))
|
|
84
|
+
this.isSpecial = !1;
|
|
85
|
+
else if (!n) {
|
|
86
|
+
this.sequenceIndex++;
|
|
87
|
+
return;
|
|
17
88
|
}
|
|
18
|
-
|
|
19
|
-
|
|
89
|
+
this.sequenceIndex = 0, this.state = i.InTagName, this.stateInTagName(t);
|
|
90
|
+
}
|
|
91
|
+
/** Look for an end tag. For <title> tags, also decode entities. */
|
|
92
|
+
stateInSpecialTag(t) {
|
|
93
|
+
if (this.sequenceIndex === this.currentSequence.length) {
|
|
94
|
+
if (t === s.Gt || h(t)) {
|
|
95
|
+
const n = this.index - this.currentSequence.length;
|
|
96
|
+
if (this.sectionStart < n) {
|
|
97
|
+
const r = this.index;
|
|
98
|
+
this.index = n, this.cbs.ontext(this.sectionStart, n), this.index = r;
|
|
99
|
+
}
|
|
100
|
+
this.isSpecial = !1, this.sectionStart = n + 2, this.stateInClosingTagName(t);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
this.sequenceIndex = 0;
|
|
20
104
|
}
|
|
21
|
-
|
|
22
|
-
|
|
105
|
+
(t | 32) === this.currentSequence[this.sequenceIndex] ? this.sequenceIndex += 1 : this.sequenceIndex === 0 ? this.currentSequence === a.TitleEnd ? this.decodeEntities && t === s.Amp && (this.state = i.BeforeEntity) : this.fastForwardTo(s.Lt) && (this.sequenceIndex = 1) : this.sequenceIndex = +(t === s.Lt);
|
|
106
|
+
}
|
|
107
|
+
stateCDATASequence(t) {
|
|
108
|
+
t === a.Cdata[this.sequenceIndex] ? ++this.sequenceIndex === a.Cdata.length && (this.state = i.InCommentLike, this.currentSequence = a.CdataEnd, this.sequenceIndex = 0, this.sectionStart = this.index + 1) : (this.sequenceIndex = 0, this.state = i.InDeclaration, this.stateInDeclaration(t));
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* When we wait for one specific character, we can speed things up
|
|
112
|
+
* by skipping through the buffer until we find it.
|
|
113
|
+
*
|
|
114
|
+
* @returns Whether the character was found.
|
|
115
|
+
*/
|
|
116
|
+
fastForwardTo(t) {
|
|
117
|
+
for (; ++this.index < this.buffer.length + this.offset; )
|
|
118
|
+
if (this.buffer.charCodeAt(this.index - this.offset) === t)
|
|
119
|
+
return !0;
|
|
120
|
+
return this.index = this.buffer.length + this.offset - 1, !1;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Comments and CDATA end with `-->` and `]]>`.
|
|
124
|
+
*
|
|
125
|
+
* Their common qualities are:
|
|
126
|
+
* - Their end sequences have a distinct character they start with.
|
|
127
|
+
* - That character is then repeated, so we have to check multiple repeats.
|
|
128
|
+
* - All characters but the start character of the sequence can be skipped.
|
|
129
|
+
*/
|
|
130
|
+
stateInCommentLike(t) {
|
|
131
|
+
t === this.currentSequence[this.sequenceIndex] ? ++this.sequenceIndex === this.currentSequence.length && (this.currentSequence === a.CdataEnd ? this.cbs.oncdata(this.sectionStart, this.index, 2) : this.cbs.oncomment(this.sectionStart, this.index, 2), this.sequenceIndex = 0, this.sectionStart = this.index + 1, this.state = i.Text) : this.sequenceIndex === 0 ? this.fastForwardTo(this.currentSequence[0]) && (this.sequenceIndex = 1) : t !== this.currentSequence[this.sequenceIndex - 1] && (this.sequenceIndex = 0);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.
|
|
135
|
+
*
|
|
136
|
+
* XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).
|
|
137
|
+
* We allow anything that wouldn't end the tag.
|
|
138
|
+
*/
|
|
139
|
+
isTagStartChar(t) {
|
|
140
|
+
return this.xmlMode ? !u(t) : d(t);
|
|
141
|
+
}
|
|
142
|
+
startSpecial(t, n) {
|
|
143
|
+
this.isSpecial = !0, this.currentSequence = t, this.sequenceIndex = n, this.state = i.SpecialStartSequence;
|
|
144
|
+
}
|
|
145
|
+
stateBeforeTagName(t) {
|
|
146
|
+
if (t === s.ExclamationMark)
|
|
147
|
+
this.state = i.BeforeDeclaration, this.sectionStart = this.index + 1;
|
|
148
|
+
else if (t === s.Questionmark)
|
|
149
|
+
this.state = i.InProcessingInstruction, this.sectionStart = this.index + 1;
|
|
150
|
+
else if (this.isTagStartChar(t)) {
|
|
151
|
+
const n = t | 32;
|
|
152
|
+
this.sectionStart = this.index, !this.xmlMode && n === a.TitleEnd[2] ? this.startSpecial(a.TitleEnd, 3) : this.state = !this.xmlMode && n === a.ScriptEnd[2] ? i.BeforeSpecialS : i.InTagName;
|
|
153
|
+
} else t === s.Slash ? this.state = i.BeforeClosingTagName : (this.state = i.Text, this.stateText(t));
|
|
154
|
+
}
|
|
155
|
+
stateInTagName(t) {
|
|
156
|
+
u(t) && (this.cbs.onopentagname(this.sectionStart, this.index), this.sectionStart = -1, this.state = i.BeforeAttributeName, this.stateBeforeAttributeName(t));
|
|
157
|
+
}
|
|
158
|
+
stateBeforeClosingTagName(t) {
|
|
159
|
+
h(t) || (t === s.Gt ? this.state = i.Text : (this.state = this.isTagStartChar(t) ? i.InClosingTagName : i.InSpecialComment, this.sectionStart = this.index));
|
|
160
|
+
}
|
|
161
|
+
stateInClosingTagName(t) {
|
|
162
|
+
(t === s.Gt || h(t)) && (this.cbs.onclosetag(this.sectionStart, this.index), this.sectionStart = -1, this.state = i.AfterClosingTagName, this.stateAfterClosingTagName(t));
|
|
163
|
+
}
|
|
164
|
+
stateAfterClosingTagName(t) {
|
|
165
|
+
(t === s.Gt || this.fastForwardTo(s.Gt)) && (this.state = i.Text, this.baseState = i.Text, this.sectionStart = this.index + 1);
|
|
166
|
+
}
|
|
167
|
+
stateBeforeAttributeName(t) {
|
|
168
|
+
t === s.Gt ? (this.cbs.onopentagend(this.index), this.isSpecial ? (this.state = i.InSpecialTag, this.sequenceIndex = 0) : this.state = i.Text, this.baseState = this.state, this.sectionStart = this.index + 1) : t === s.Slash ? this.state = i.InSelfClosingTag : h(t) || (this.state = i.InAttributeName, this.sectionStart = this.index);
|
|
169
|
+
}
|
|
170
|
+
stateInSelfClosingTag(t) {
|
|
171
|
+
t === s.Gt ? (this.cbs.onselfclosingtag(this.index), this.state = i.Text, this.baseState = i.Text, this.sectionStart = this.index + 1, this.isSpecial = !1) : h(t) || (this.state = i.BeforeAttributeName, this.stateBeforeAttributeName(t));
|
|
172
|
+
}
|
|
173
|
+
stateInAttributeName(t) {
|
|
174
|
+
(t === s.Eq || u(t)) && (this.cbs.onattribname(this.sectionStart, this.index), this.sectionStart = -1, this.state = i.AfterAttributeName, this.stateAfterAttributeName(t));
|
|
175
|
+
}
|
|
176
|
+
stateAfterAttributeName(t) {
|
|
177
|
+
t === s.Eq ? this.state = i.BeforeAttributeValue : t === s.Slash || t === s.Gt ? (this.cbs.onattribend(o.NoValue, this.index), this.state = i.BeforeAttributeName, this.stateBeforeAttributeName(t)) : h(t) || (this.cbs.onattribend(o.NoValue, this.index), this.state = i.InAttributeName, this.sectionStart = this.index);
|
|
178
|
+
}
|
|
179
|
+
stateBeforeAttributeValue(t) {
|
|
180
|
+
t === s.DoubleQuote ? (this.state = i.InAttributeValueDq, this.sectionStart = this.index + 1) : t === s.SingleQuote ? (this.state = i.InAttributeValueSq, this.sectionStart = this.index + 1) : h(t) || (this.sectionStart = this.index, this.state = i.InAttributeValueNq, this.stateInAttributeValueNoQuotes(t));
|
|
181
|
+
}
|
|
182
|
+
handleInAttributeValue(t, n) {
|
|
183
|
+
t === n || !this.decodeEntities && this.fastForwardTo(n) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(n === s.DoubleQuote ? o.Double : o.Single, this.index), this.state = i.BeforeAttributeName) : this.decodeEntities && t === s.Amp && (this.baseState = this.state, this.state = i.BeforeEntity);
|
|
184
|
+
}
|
|
185
|
+
stateInAttributeValueDoubleQuotes(t) {
|
|
186
|
+
this.handleInAttributeValue(t, s.DoubleQuote);
|
|
187
|
+
}
|
|
188
|
+
stateInAttributeValueSingleQuotes(t) {
|
|
189
|
+
this.handleInAttributeValue(t, s.SingleQuote);
|
|
190
|
+
}
|
|
191
|
+
stateInAttributeValueNoQuotes(t) {
|
|
192
|
+
h(t) || t === s.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(o.Unquoted, this.index), this.state = i.BeforeAttributeName, this.stateBeforeAttributeName(t)) : this.decodeEntities && t === s.Amp && (this.baseState = this.state, this.state = i.BeforeEntity);
|
|
193
|
+
}
|
|
194
|
+
stateBeforeDeclaration(t) {
|
|
195
|
+
t === s.OpeningSquareBracket ? (this.state = i.CDATASequence, this.sequenceIndex = 0) : this.state = t === s.Dash ? i.BeforeComment : i.InDeclaration;
|
|
196
|
+
}
|
|
197
|
+
stateInDeclaration(t) {
|
|
198
|
+
(t === s.Gt || this.fastForwardTo(s.Gt)) && (this.cbs.ondeclaration(this.sectionStart, this.index), this.state = i.Text, this.sectionStart = this.index + 1);
|
|
199
|
+
}
|
|
200
|
+
stateInProcessingInstruction(t) {
|
|
201
|
+
(t === s.Gt || this.fastForwardTo(s.Gt)) && (this.cbs.onprocessinginstruction(this.sectionStart, this.index), this.state = i.Text, this.sectionStart = this.index + 1);
|
|
202
|
+
}
|
|
203
|
+
stateBeforeComment(t) {
|
|
204
|
+
t === s.Dash ? (this.state = i.InCommentLike, this.currentSequence = a.CommentEnd, this.sequenceIndex = 2, this.sectionStart = this.index + 1) : this.state = i.InDeclaration;
|
|
205
|
+
}
|
|
206
|
+
stateInSpecialComment(t) {
|
|
207
|
+
(t === s.Gt || this.fastForwardTo(s.Gt)) && (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = i.Text, this.sectionStart = this.index + 1);
|
|
208
|
+
}
|
|
209
|
+
stateBeforeSpecialS(t) {
|
|
210
|
+
const n = t | 32;
|
|
211
|
+
n === a.ScriptEnd[3] ? this.startSpecial(a.ScriptEnd, 4) : n === a.StyleEnd[3] ? this.startSpecial(a.StyleEnd, 4) : (this.state = i.InTagName, this.stateInTagName(t));
|
|
212
|
+
}
|
|
213
|
+
stateBeforeEntity(t) {
|
|
214
|
+
this.entityExcess = 1, this.entityResult = 0, t === s.Number ? this.state = i.BeforeNumericEntity : t === s.Amp || (this.trieIndex = 0, this.trieCurrent = this.entityTrie[0], this.state = i.InNamedEntity, this.stateInNamedEntity(t));
|
|
215
|
+
}
|
|
216
|
+
stateInNamedEntity(t) {
|
|
217
|
+
if (this.entityExcess += 1, this.trieIndex = m(this.entityTrie, this.trieCurrent, this.trieIndex + 1, t), this.trieIndex < 0) {
|
|
218
|
+
this.emitNamedEntity(), this.index--;
|
|
219
|
+
return;
|
|
23
220
|
}
|
|
24
|
-
|
|
25
|
-
|
|
221
|
+
this.trieCurrent = this.entityTrie[this.trieIndex];
|
|
222
|
+
const n = this.trieCurrent & c.VALUE_LENGTH;
|
|
223
|
+
if (n) {
|
|
224
|
+
const r = (n >> 14) - 1;
|
|
225
|
+
if (!this.allowLegacyEntity() && t !== s.Semi)
|
|
226
|
+
this.trieIndex += r;
|
|
227
|
+
else {
|
|
228
|
+
const l = this.index - this.entityExcess + 1;
|
|
229
|
+
l > this.sectionStart && this.emitPartial(this.sectionStart, l), this.entityResult = this.trieIndex, this.trieIndex += r, this.entityExcess = 0, this.sectionStart = this.index + 1, r === 0 && this.emitNamedEntity();
|
|
230
|
+
}
|
|
26
231
|
}
|
|
27
|
-
|
|
28
|
-
|
|
232
|
+
}
|
|
233
|
+
emitNamedEntity() {
|
|
234
|
+
if (this.state = this.baseState, this.entityResult === 0)
|
|
235
|
+
return;
|
|
236
|
+
switch ((this.entityTrie[this.entityResult] & c.VALUE_LENGTH) >> 14) {
|
|
237
|
+
case 1: {
|
|
238
|
+
this.emitCodePoint(this.entityTrie[this.entityResult] & ~c.VALUE_LENGTH);
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
case 2: {
|
|
242
|
+
this.emitCodePoint(this.entityTrie[this.entityResult + 1]);
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
case 3:
|
|
246
|
+
this.emitCodePoint(this.entityTrie[this.entityResult + 1]), this.emitCodePoint(this.entityTrie[this.entityResult + 2]);
|
|
29
247
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
248
|
+
}
|
|
249
|
+
stateBeforeNumericEntity(t) {
|
|
250
|
+
(t | 32) === s.LowerX ? (this.entityExcess++, this.state = i.InHexEntity) : (this.state = i.InNumericEntity, this.stateInNumericEntity(t));
|
|
251
|
+
}
|
|
252
|
+
emitNumericEntity(t) {
|
|
253
|
+
const n = this.index - this.entityExcess - 1;
|
|
254
|
+
n + 2 + +(this.state === i.InHexEntity) !== this.index && (n > this.sectionStart && this.emitPartial(this.sectionStart, n), this.sectionStart = this.index + Number(t), this.emitCodePoint(I(this.entityResult))), this.state = this.baseState;
|
|
255
|
+
}
|
|
256
|
+
stateInNumericEntity(t) {
|
|
257
|
+
t === s.Semi ? this.emitNumericEntity(!0) : f(t) ? (this.entityResult = this.entityResult * 10 + (t - s.Zero), this.entityExcess++) : (this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state = this.baseState, this.index--);
|
|
258
|
+
}
|
|
259
|
+
stateInHexEntity(t) {
|
|
260
|
+
t === s.Semi ? this.emitNumericEntity(!0) : f(t) ? (this.entityResult = this.entityResult * 16 + (t - s.Zero), this.entityExcess++) : S(t) ? (this.entityResult = this.entityResult * 16 + ((t | 32) - s.LowerA + 10), this.entityExcess++) : (this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state = this.baseState, this.index--);
|
|
261
|
+
}
|
|
262
|
+
allowLegacyEntity() {
|
|
263
|
+
return !this.xmlMode && (this.baseState === i.Text || this.baseState === i.InSpecialTag);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Remove data that has already been consumed from the buffer.
|
|
267
|
+
*/
|
|
268
|
+
cleanup() {
|
|
269
|
+
this.running && this.sectionStart !== this.index && (this.state === i.Text || this.state === i.InSpecialTag && this.sequenceIndex === 0 ? (this.cbs.ontext(this.sectionStart, this.index), this.sectionStart = this.index) : (this.state === i.InAttributeValueDq || this.state === i.InAttributeValueSq || this.state === i.InAttributeValueNq) && (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = this.index));
|
|
270
|
+
}
|
|
271
|
+
shouldContinue() {
|
|
272
|
+
return this.index < this.buffer.length + this.offset && this.running;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Iterates through the buffer, calling the function corresponding to the current state.
|
|
276
|
+
*
|
|
277
|
+
* States that are more likely to be hit are higher up, as a performance improvement.
|
|
278
|
+
*/
|
|
279
|
+
parse() {
|
|
280
|
+
for (; this.shouldContinue(); ) {
|
|
281
|
+
const t = this.buffer.charCodeAt(this.index - this.offset);
|
|
282
|
+
switch (this.state) {
|
|
283
|
+
case i.Text: {
|
|
284
|
+
this.stateText(t);
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
287
|
+
case i.SpecialStartSequence: {
|
|
288
|
+
this.stateSpecialStartSequence(t);
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
case i.InSpecialTag: {
|
|
292
|
+
this.stateInSpecialTag(t);
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
case i.CDATASequence: {
|
|
296
|
+
this.stateCDATASequence(t);
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
case i.InAttributeValueDq: {
|
|
300
|
+
this.stateInAttributeValueDoubleQuotes(t);
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
case i.InAttributeName: {
|
|
304
|
+
this.stateInAttributeName(t);
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
case i.InCommentLike: {
|
|
308
|
+
this.stateInCommentLike(t);
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
case i.InSpecialComment: {
|
|
312
|
+
this.stateInSpecialComment(t);
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
case i.BeforeAttributeName: {
|
|
316
|
+
this.stateBeforeAttributeName(t);
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
case i.InTagName: {
|
|
320
|
+
this.stateInTagName(t);
|
|
321
|
+
break;
|
|
322
|
+
}
|
|
323
|
+
case i.InClosingTagName: {
|
|
324
|
+
this.stateInClosingTagName(t);
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
case i.BeforeTagName: {
|
|
328
|
+
this.stateBeforeTagName(t);
|
|
329
|
+
break;
|
|
48
330
|
}
|
|
49
|
-
|
|
50
|
-
this.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
this.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
this.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}, t.prototype.handleInAttributeValue = function(e, n) {
|
|
135
|
-
e === n || !this.decodeEntities && this.fastForwardTo(n) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(n === s.DoubleQuote ? u.Double : u.Single, this.index), this.state = i.BeforeAttributeName) : this.decodeEntities && e === s.Amp && (this.baseState = this.state, this.state = i.BeforeEntity);
|
|
136
|
-
}, t.prototype.stateInAttributeValueDoubleQuotes = function(e) {
|
|
137
|
-
this.handleInAttributeValue(e, s.DoubleQuote);
|
|
138
|
-
}, t.prototype.stateInAttributeValueSingleQuotes = function(e) {
|
|
139
|
-
this.handleInAttributeValue(e, s.SingleQuote);
|
|
140
|
-
}, t.prototype.stateInAttributeValueNoQuotes = function(e) {
|
|
141
|
-
o(e) || e === s.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(u.Unquoted, this.index), this.state = i.BeforeAttributeName, this.stateBeforeAttributeName(e)) : this.decodeEntities && e === s.Amp && (this.baseState = this.state, this.state = i.BeforeEntity);
|
|
142
|
-
}, t.prototype.stateBeforeDeclaration = function(e) {
|
|
143
|
-
e === s.OpeningSquareBracket ? (this.state = i.CDATASequence, this.sequenceIndex = 0) : this.state = e === s.Dash ? i.BeforeComment : i.InDeclaration;
|
|
144
|
-
}, t.prototype.stateInDeclaration = function(e) {
|
|
145
|
-
(e === s.Gt || this.fastForwardTo(s.Gt)) && (this.cbs.ondeclaration(this.sectionStart, this.index), this.state = i.Text, this.sectionStart = this.index + 1);
|
|
146
|
-
}, t.prototype.stateInProcessingInstruction = function(e) {
|
|
147
|
-
(e === s.Gt || this.fastForwardTo(s.Gt)) && (this.cbs.onprocessinginstruction(this.sectionStart, this.index), this.state = i.Text, this.sectionStart = this.index + 1);
|
|
148
|
-
}, t.prototype.stateBeforeComment = function(e) {
|
|
149
|
-
e === s.Dash ? (this.state = i.InCommentLike, this.currentSequence = a.CommentEnd, this.sequenceIndex = 2, this.sectionStart = this.index + 1) : this.state = i.InDeclaration;
|
|
150
|
-
}, t.prototype.stateInSpecialComment = function(e) {
|
|
151
|
-
(e === s.Gt || this.fastForwardTo(s.Gt)) && (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = i.Text, this.sectionStart = this.index + 1);
|
|
152
|
-
}, t.prototype.stateBeforeSpecialS = function(e) {
|
|
153
|
-
var n = e | 32;
|
|
154
|
-
n === a.ScriptEnd[3] ? this.startSpecial(a.ScriptEnd, 4) : n === a.StyleEnd[3] ? this.startSpecial(a.StyleEnd, 4) : (this.state = i.InTagName, this.stateInTagName(e));
|
|
155
|
-
}, t.prototype.stateBeforeEntity = function(e) {
|
|
156
|
-
this.entityExcess = 1, this.entityResult = 0, e === s.Number ? this.state = i.BeforeNumericEntity : e === s.Amp || (this.trieIndex = 0, this.trieCurrent = this.entityTrie[0], this.state = i.InNamedEntity, this.stateInNamedEntity(e));
|
|
157
|
-
}, t.prototype.stateInNamedEntity = function(e) {
|
|
158
|
-
if (this.entityExcess += 1, this.trieIndex = (0, h.determineBranch)(this.entityTrie, this.trieCurrent, this.trieIndex + 1, e), this.trieIndex < 0) {
|
|
159
|
-
this.emitNamedEntity(), this.index--;
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
this.trieCurrent = this.entityTrie[this.trieIndex];
|
|
163
|
-
var n = this.trieCurrent & h.BinTrieFlags.VALUE_LENGTH;
|
|
164
|
-
if (n) {
|
|
165
|
-
var r = (n >> 14) - 1;
|
|
166
|
-
if (!this.allowLegacyEntity() && e !== s.Semi)
|
|
167
|
-
this.trieIndex += r;
|
|
168
|
-
else {
|
|
169
|
-
var f = this.index - this.entityExcess + 1;
|
|
170
|
-
f > this.sectionStart && this.emitPartial(this.sectionStart, f), this.entityResult = this.trieIndex, this.trieIndex += r, this.entityExcess = 0, this.sectionStart = this.index + 1, r === 0 && this.emitNamedEntity();
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}, t.prototype.emitNamedEntity = function() {
|
|
174
|
-
if (this.state = this.baseState, this.entityResult !== 0) {
|
|
175
|
-
var e = (this.entityTrie[this.entityResult] & h.BinTrieFlags.VALUE_LENGTH) >> 14;
|
|
176
|
-
switch (e) {
|
|
177
|
-
case 1: {
|
|
178
|
-
this.emitCodePoint(this.entityTrie[this.entityResult] & ~h.BinTrieFlags.VALUE_LENGTH);
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
181
|
-
case 2: {
|
|
182
|
-
this.emitCodePoint(this.entityTrie[this.entityResult + 1]);
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
|
-
case 3:
|
|
186
|
-
this.emitCodePoint(this.entityTrie[this.entityResult + 1]), this.emitCodePoint(this.entityTrie[this.entityResult + 2]);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}, t.prototype.stateBeforeNumericEntity = function(e) {
|
|
190
|
-
(e | 32) === s.LowerX ? (this.entityExcess++, this.state = i.InHexEntity) : (this.state = i.InNumericEntity, this.stateInNumericEntity(e));
|
|
191
|
-
}, t.prototype.emitNumericEntity = function(e) {
|
|
192
|
-
var n = this.index - this.entityExcess - 1, r = n + 2 + +(this.state === i.InHexEntity);
|
|
193
|
-
r !== this.index && (n > this.sectionStart && this.emitPartial(this.sectionStart, n), this.sectionStart = this.index + Number(e), this.emitCodePoint((0, h.replaceCodePoint)(this.entityResult))), this.state = this.baseState;
|
|
194
|
-
}, t.prototype.stateInNumericEntity = function(e) {
|
|
195
|
-
e === s.Semi ? this.emitNumericEntity(!0) : x(e) ? (this.entityResult = this.entityResult * 10 + (e - s.Zero), this.entityExcess++) : (this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state = this.baseState, this.index--);
|
|
196
|
-
}, t.prototype.stateInHexEntity = function(e) {
|
|
197
|
-
e === s.Semi ? this.emitNumericEntity(!0) : x(e) ? (this.entityResult = this.entityResult * 16 + (e - s.Zero), this.entityExcess++) : I(e) ? (this.entityResult = this.entityResult * 16 + ((e | 32) - s.LowerA + 10), this.entityExcess++) : (this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state = this.baseState, this.index--);
|
|
198
|
-
}, t.prototype.allowLegacyEntity = function() {
|
|
199
|
-
return !this.xmlMode && (this.baseState === i.Text || this.baseState === i.InSpecialTag);
|
|
200
|
-
}, t.prototype.cleanup = function() {
|
|
201
|
-
this.running && this.sectionStart !== this.index && (this.state === i.Text || this.state === i.InSpecialTag && this.sequenceIndex === 0 ? (this.cbs.ontext(this.sectionStart, this.index), this.sectionStart = this.index) : (this.state === i.InAttributeValueDq || this.state === i.InAttributeValueSq || this.state === i.InAttributeValueNq) && (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = this.index));
|
|
202
|
-
}, t.prototype.shouldContinue = function() {
|
|
203
|
-
return this.index < this.buffer.length + this.offset && this.running;
|
|
204
|
-
}, t.prototype.parse = function() {
|
|
205
|
-
for (; this.shouldContinue(); ) {
|
|
206
|
-
var e = this.buffer.charCodeAt(this.index - this.offset);
|
|
207
|
-
switch (this.state) {
|
|
208
|
-
case i.Text: {
|
|
209
|
-
this.stateText(e);
|
|
210
|
-
break;
|
|
211
|
-
}
|
|
212
|
-
case i.SpecialStartSequence: {
|
|
213
|
-
this.stateSpecialStartSequence(e);
|
|
214
|
-
break;
|
|
215
|
-
}
|
|
216
|
-
case i.InSpecialTag: {
|
|
217
|
-
this.stateInSpecialTag(e);
|
|
218
|
-
break;
|
|
219
|
-
}
|
|
220
|
-
case i.CDATASequence: {
|
|
221
|
-
this.stateCDATASequence(e);
|
|
222
|
-
break;
|
|
223
|
-
}
|
|
224
|
-
case i.InAttributeValueDq: {
|
|
225
|
-
this.stateInAttributeValueDoubleQuotes(e);
|
|
226
|
-
break;
|
|
227
|
-
}
|
|
228
|
-
case i.InAttributeName: {
|
|
229
|
-
this.stateInAttributeName(e);
|
|
230
|
-
break;
|
|
231
|
-
}
|
|
232
|
-
case i.InCommentLike: {
|
|
233
|
-
this.stateInCommentLike(e);
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
236
|
-
case i.InSpecialComment: {
|
|
237
|
-
this.stateInSpecialComment(e);
|
|
238
|
-
break;
|
|
239
|
-
}
|
|
240
|
-
case i.BeforeAttributeName: {
|
|
241
|
-
this.stateBeforeAttributeName(e);
|
|
242
|
-
break;
|
|
243
|
-
}
|
|
244
|
-
case i.InTagName: {
|
|
245
|
-
this.stateInTagName(e);
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
case i.InClosingTagName: {
|
|
249
|
-
this.stateInClosingTagName(e);
|
|
250
|
-
break;
|
|
251
|
-
}
|
|
252
|
-
case i.BeforeTagName: {
|
|
253
|
-
this.stateBeforeTagName(e);
|
|
254
|
-
break;
|
|
255
|
-
}
|
|
256
|
-
case i.AfterAttributeName: {
|
|
257
|
-
this.stateAfterAttributeName(e);
|
|
258
|
-
break;
|
|
259
|
-
}
|
|
260
|
-
case i.InAttributeValueSq: {
|
|
261
|
-
this.stateInAttributeValueSingleQuotes(e);
|
|
262
|
-
break;
|
|
263
|
-
}
|
|
264
|
-
case i.BeforeAttributeValue: {
|
|
265
|
-
this.stateBeforeAttributeValue(e);
|
|
266
|
-
break;
|
|
267
|
-
}
|
|
268
|
-
case i.BeforeClosingTagName: {
|
|
269
|
-
this.stateBeforeClosingTagName(e);
|
|
270
|
-
break;
|
|
271
|
-
}
|
|
272
|
-
case i.AfterClosingTagName: {
|
|
273
|
-
this.stateAfterClosingTagName(e);
|
|
274
|
-
break;
|
|
275
|
-
}
|
|
276
|
-
case i.BeforeSpecialS: {
|
|
277
|
-
this.stateBeforeSpecialS(e);
|
|
278
|
-
break;
|
|
279
|
-
}
|
|
280
|
-
case i.InAttributeValueNq: {
|
|
281
|
-
this.stateInAttributeValueNoQuotes(e);
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
case i.InSelfClosingTag: {
|
|
285
|
-
this.stateInSelfClosingTag(e);
|
|
286
|
-
break;
|
|
287
|
-
}
|
|
288
|
-
case i.InDeclaration: {
|
|
289
|
-
this.stateInDeclaration(e);
|
|
290
|
-
break;
|
|
291
|
-
}
|
|
292
|
-
case i.BeforeDeclaration: {
|
|
293
|
-
this.stateBeforeDeclaration(e);
|
|
294
|
-
break;
|
|
295
|
-
}
|
|
296
|
-
case i.BeforeComment: {
|
|
297
|
-
this.stateBeforeComment(e);
|
|
298
|
-
break;
|
|
299
|
-
}
|
|
300
|
-
case i.InProcessingInstruction: {
|
|
301
|
-
this.stateInProcessingInstruction(e);
|
|
302
|
-
break;
|
|
303
|
-
}
|
|
304
|
-
case i.InNamedEntity: {
|
|
305
|
-
this.stateInNamedEntity(e);
|
|
306
|
-
break;
|
|
307
|
-
}
|
|
308
|
-
case i.BeforeEntity: {
|
|
309
|
-
this.stateBeforeEntity(e);
|
|
310
|
-
break;
|
|
311
|
-
}
|
|
312
|
-
case i.InHexEntity: {
|
|
313
|
-
this.stateInHexEntity(e);
|
|
314
|
-
break;
|
|
315
|
-
}
|
|
316
|
-
case i.InNumericEntity: {
|
|
317
|
-
this.stateInNumericEntity(e);
|
|
318
|
-
break;
|
|
319
|
-
}
|
|
320
|
-
default:
|
|
321
|
-
this.stateBeforeNumericEntity(e);
|
|
322
|
-
}
|
|
323
|
-
this.index++;
|
|
324
|
-
}
|
|
325
|
-
this.cleanup();
|
|
326
|
-
}, t.prototype.finish = function() {
|
|
327
|
-
this.state === i.InNamedEntity && this.emitNamedEntity(), this.sectionStart < this.index && this.handleTrailingData(), this.cbs.onend();
|
|
328
|
-
}, t.prototype.handleTrailingData = function() {
|
|
329
|
-
var e = this.buffer.length + this.offset;
|
|
330
|
-
this.state === i.InCommentLike ? this.currentSequence === a.CdataEnd ? this.cbs.oncdata(this.sectionStart, e, 0) : this.cbs.oncomment(this.sectionStart, e, 0) : this.state === i.InNumericEntity && this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state === i.InHexEntity && this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state === i.InTagName || this.state === i.BeforeAttributeName || this.state === i.BeforeAttributeValue || this.state === i.AfterAttributeName || this.state === i.InAttributeName || this.state === i.InAttributeValueSq || this.state === i.InAttributeValueDq || this.state === i.InAttributeValueNq || this.state === i.InClosingTagName || this.cbs.ontext(this.sectionStart, e);
|
|
331
|
-
}, t.prototype.emitPartial = function(e, n) {
|
|
332
|
-
this.baseState !== i.Text && this.baseState !== i.InSpecialTag ? this.cbs.onattribdata(e, n) : this.cbs.ontext(e, n);
|
|
333
|
-
}, t.prototype.emitCodePoint = function(e) {
|
|
334
|
-
this.baseState !== i.Text && this.baseState !== i.InSpecialTag ? this.cbs.onattribentity(e) : this.cbs.ontextentity(e);
|
|
335
|
-
}, t;
|
|
336
|
-
})()
|
|
337
|
-
);
|
|
338
|
-
c.default = y;
|
|
339
|
-
})(m), m);
|
|
331
|
+
case i.AfterAttributeName: {
|
|
332
|
+
this.stateAfterAttributeName(t);
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
case i.InAttributeValueSq: {
|
|
336
|
+
this.stateInAttributeValueSingleQuotes(t);
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
case i.BeforeAttributeValue: {
|
|
340
|
+
this.stateBeforeAttributeValue(t);
|
|
341
|
+
break;
|
|
342
|
+
}
|
|
343
|
+
case i.BeforeClosingTagName: {
|
|
344
|
+
this.stateBeforeClosingTagName(t);
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
case i.AfterClosingTagName: {
|
|
348
|
+
this.stateAfterClosingTagName(t);
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
case i.BeforeSpecialS: {
|
|
352
|
+
this.stateBeforeSpecialS(t);
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
case i.InAttributeValueNq: {
|
|
356
|
+
this.stateInAttributeValueNoQuotes(t);
|
|
357
|
+
break;
|
|
358
|
+
}
|
|
359
|
+
case i.InSelfClosingTag: {
|
|
360
|
+
this.stateInSelfClosingTag(t);
|
|
361
|
+
break;
|
|
362
|
+
}
|
|
363
|
+
case i.InDeclaration: {
|
|
364
|
+
this.stateInDeclaration(t);
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
case i.BeforeDeclaration: {
|
|
368
|
+
this.stateBeforeDeclaration(t);
|
|
369
|
+
break;
|
|
370
|
+
}
|
|
371
|
+
case i.BeforeComment: {
|
|
372
|
+
this.stateBeforeComment(t);
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
case i.InProcessingInstruction: {
|
|
376
|
+
this.stateInProcessingInstruction(t);
|
|
377
|
+
break;
|
|
378
|
+
}
|
|
379
|
+
case i.InNamedEntity: {
|
|
380
|
+
this.stateInNamedEntity(t);
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
case i.BeforeEntity: {
|
|
384
|
+
this.stateBeforeEntity(t);
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
case i.InHexEntity: {
|
|
388
|
+
this.stateInHexEntity(t);
|
|
389
|
+
break;
|
|
390
|
+
}
|
|
391
|
+
case i.InNumericEntity: {
|
|
392
|
+
this.stateInNumericEntity(t);
|
|
393
|
+
break;
|
|
394
|
+
}
|
|
395
|
+
default:
|
|
396
|
+
this.stateBeforeNumericEntity(t);
|
|
397
|
+
}
|
|
398
|
+
this.index++;
|
|
399
|
+
}
|
|
400
|
+
this.cleanup();
|
|
401
|
+
}
|
|
402
|
+
finish() {
|
|
403
|
+
this.state === i.InNamedEntity && this.emitNamedEntity(), this.sectionStart < this.index && this.handleTrailingData(), this.cbs.onend();
|
|
404
|
+
}
|
|
405
|
+
/** Handle any trailing data. */
|
|
406
|
+
handleTrailingData() {
|
|
407
|
+
const t = this.buffer.length + this.offset;
|
|
408
|
+
this.state === i.InCommentLike ? this.currentSequence === a.CdataEnd ? this.cbs.oncdata(this.sectionStart, t, 0) : this.cbs.oncomment(this.sectionStart, t, 0) : this.state === i.InNumericEntity && this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state === i.InHexEntity && this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state === i.InTagName || this.state === i.BeforeAttributeName || this.state === i.BeforeAttributeValue || this.state === i.AfterAttributeName || this.state === i.InAttributeName || this.state === i.InAttributeValueSq || this.state === i.InAttributeValueDq || this.state === i.InAttributeValueNq || this.state === i.InClosingTagName || this.cbs.ontext(this.sectionStart, t);
|
|
409
|
+
}
|
|
410
|
+
emitPartial(t, n) {
|
|
411
|
+
this.baseState !== i.Text && this.baseState !== i.InSpecialTag ? this.cbs.onattribdata(t, n) : this.cbs.ontext(t, n);
|
|
412
|
+
}
|
|
413
|
+
emitCodePoint(t) {
|
|
414
|
+
this.baseState !== i.Text && this.baseState !== i.InSpecialTag ? this.cbs.onattribentity(t) : this.cbs.ontextentity(t);
|
|
415
|
+
}
|
|
340
416
|
}
|
|
341
417
|
export {
|
|
342
|
-
|
|
418
|
+
o as QuoteType,
|
|
419
|
+
E as default
|
|
343
420
|
};
|