@websolutespa/bom-next 3.0.0 → 3.0.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.
- package/CHANGELOG.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +24 -0
- package/dist/client/client.d.ts +9 -0
- package/dist/client/client.d.ts.map +1 -0
- package/dist/client/client.js +18 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/extra.d.ts +17 -0
- package/dist/client/extra.d.ts.map +1 -0
- package/dist/client/extra.js +13 -0
- package/dist/client/extra.js.map +1 -0
- package/dist/client/label.d.ts +15 -0
- package/dist/client/label.d.ts.map +1 -0
- package/dist/client/label.js +20 -0
- package/dist/client/label.js.map +1 -0
- package/dist/client/layout.d.ts +18 -0
- package/dist/client/layout.d.ts.map +1 -0
- package/dist/client/layout.js +13 -0
- package/dist/client/layout.js.map +1 -0
- package/dist/client/local.collection.d.ts +32 -0
- package/dist/client/local.collection.d.ts.map +1 -0
- package/dist/client/local.collection.js +49 -0
- package/dist/client/local.collection.js.map +1 -0
- package/dist/client/metadata.d.ts +43 -0
- package/dist/client/metadata.d.ts.map +1 -0
- package/dist/client/metadata.js +146 -0
- package/dist/client/metadata.js.map +1 -0
- package/dist/client/page.d.ts +404 -0
- package/dist/client/page.d.ts.map +1 -0
- package/dist/client/page.js +13 -0
- package/dist/client/page.js.map +1 -0
- package/dist/client/useApi.d.ts +21 -0
- package/dist/client/useApi.d.ts.map +1 -0
- package/dist/client/useApi.js +65 -0
- package/dist/client/useApi.js.map +1 -0
- package/dist/client/useCollectionApi.d.ts +21 -0
- package/dist/client/useCollectionApi.d.ts.map +1 -0
- package/dist/client/useCollectionApi.js +65 -0
- package/dist/client/useCollectionApi.js.map +1 -0
- package/dist/client/useExtra.d.ts +9 -0
- package/dist/client/useExtra.d.ts.map +1 -0
- package/dist/client/useExtra.js +13 -0
- package/dist/client/useExtra.js.map +1 -0
- package/dist/client/useHttp.d.ts +15 -0
- package/dist/client/useHttp.d.ts.map +1 -0
- package/dist/client/useHttp.js +70 -0
- package/dist/client/useHttp.js.map +1 -0
- package/dist/client/useLabel.d.ts +9 -0
- package/dist/client/useLabel.d.ts.map +1 -0
- package/dist/client/useLabel.js +13 -0
- package/dist/client/useLabel.js.map +1 -0
- package/dist/client/useLayout.d.ts +9 -0
- package/dist/client/useLayout.d.ts.map +1 -0
- package/dist/client/useLayout.js +13 -0
- package/dist/client/useLayout.js.map +1 -0
- package/dist/client/useLink.d.ts +7 -0
- package/dist/client/useLink.d.ts.map +1 -0
- package/dist/client/useLink.js +15 -0
- package/dist/client/useLink.js.map +1 -0
- package/dist/client/useMetaData.d.ts +9 -0
- package/dist/client/useMetaData.d.ts.map +1 -0
- package/dist/client/useMetaData.js +13 -0
- package/dist/client/useMetaData.js.map +1 -0
- package/dist/client/usePage.d.ts +394 -0
- package/dist/client/usePage.d.ts.map +1 -0
- package/dist/client/usePage.js +13 -0
- package/dist/client/usePage.js.map +1 -0
- package/dist/client/useUser.d.ts +9 -0
- package/dist/client/useUser.d.ts.map +1 -0
- package/dist/client/useUser.js +13 -0
- package/dist/client/useUser.js.map +1 -0
- package/dist/client/user.d.ts +20 -0
- package/dist/client/user.d.ts.map +1 -0
- package/dist/client/user.js +33 -0
- package/dist/client/user.js.map +1 -0
- package/dist/exports/client.d.ts +20 -0
- package/dist/exports/client.js +19 -5734
- package/dist/exports/instrumentation.d.ts +2 -0
- package/dist/exports/instrumentation.js +1 -24
- package/dist/exports/proxy.d.ts +5 -0
- package/dist/exports/proxy.js +4 -253
- package/dist/exports/server.d.ts +19 -0
- package/dist/exports/server.js +18 -1973
- package/dist/index.d.ts +18 -0
- package/dist/index.js +10 -200
- package/dist/instrumentation/client.d.ts +8 -0
- package/dist/instrumentation/client.d.ts.map +1 -0
- package/dist/instrumentation/client.js +15 -0
- package/dist/instrumentation/client.js.map +1 -0
- package/dist/instrumentation/sentry/capture.requestError.js +10 -0
- package/dist/instrumentation/sentry/capture.requestError.js.map +1 -0
- package/dist/instrumentation/sentry/capture.routerTransitionStart.js +7 -0
- package/dist/instrumentation/sentry/capture.routerTransitionStart.js.map +1 -0
- package/dist/{exports/instrumentation-DBO6QH4d.d.ts → instrumentation/server.d.ts} +2 -2
- package/dist/instrumentation/server.d.ts.map +1 -0
- package/dist/instrumentation/server.js +19 -0
- package/dist/instrumentation/server.js.map +1 -0
- package/dist/{types-BatUTdbZ.d.ts → instrumentation/types.d.ts} +2 -2
- package/dist/instrumentation/types.d.ts.map +1 -0
- package/dist/lib/breadcrumb.d.ts +15 -0
- package/dist/lib/breadcrumb.d.ts.map +1 -0
- package/dist/lib/breadcrumb.js +20 -0
- package/dist/lib/breadcrumb.js.map +1 -0
- package/dist/lib/const.d.ts +9 -0
- package/dist/lib/const.d.ts.map +1 -0
- package/dist/lib/const.js +9 -0
- package/dist/lib/const.js.map +1 -0
- package/dist/lib/http.d.ts +36 -0
- package/dist/lib/http.d.ts.map +1 -0
- package/dist/{http-_2M-UFRx.js → lib/http.js} +2 -2
- package/dist/lib/http.js.map +1 -0
- package/dist/lib/label.d.ts +16 -0
- package/dist/lib/label.d.ts.map +1 -0
- package/dist/lib/label.js +33 -0
- package/dist/lib/label.js.map +1 -0
- package/dist/lib/layout.defaults.d.ts +9 -0
- package/dist/lib/layout.defaults.d.ts.map +1 -0
- package/dist/lib/layout.defaults.js +161 -0
- package/dist/lib/layout.defaults.js.map +1 -0
- package/dist/lib/link.d.ts +9 -0
- package/dist/lib/link.d.ts.map +1 -0
- package/dist/lib/link.js +16 -0
- package/dist/lib/link.js.map +1 -0
- package/dist/lib/meta-data.d.ts +56 -0
- package/dist/lib/meta-data.d.ts.map +1 -0
- package/dist/lib/open-graph.d.ts +143 -0
- package/dist/lib/open-graph.d.ts.map +1 -0
- package/dist/lib/pagination.d.ts +27 -0
- package/dist/lib/pagination.d.ts.map +1 -0
- package/dist/lib/pagination.js +39 -0
- package/dist/lib/pagination.js.map +1 -0
- package/dist/lib/route.d.ts +17 -0
- package/dist/lib/route.d.ts.map +1 -0
- package/dist/{route-DzFwERQP.js → lib/route.js} +2 -2
- package/dist/lib/route.js.map +1 -0
- package/dist/lib/store.d.ts +27 -0
- package/dist/lib/store.d.ts.map +1 -0
- package/dist/{store-CJzqrHsl.js → lib/store.js} +2 -25
- package/dist/lib/store.js.map +1 -0
- package/dist/lib/structured-data.d.ts +9 -0
- package/dist/lib/structured-data.d.ts.map +1 -0
- package/dist/lib/twitter-card.d.ts +43 -0
- package/dist/lib/twitter-card.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +13 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +35 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/mock.d.ts +127 -0
- package/dist/mock.d.ts.map +1 -0
- package/dist/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.js +75 -0
- package/dist/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.js.map +1 -0
- package/dist/node_modules/deepmerge/dist/cjs.js +86 -0
- package/dist/node_modules/deepmerge/dist/cjs.js.map +1 -0
- package/dist/node_modules/dom-serializer/lib/esm/foreignNames.js +105 -0
- package/dist/node_modules/dom-serializer/lib/esm/foreignNames.js.map +1 -0
- package/dist/node_modules/dom-serializer/lib/esm/index.js +146 -0
- package/dist/node_modules/dom-serializer/lib/esm/index.js.map +1 -0
- package/dist/node_modules/domelementtype/lib/esm/index.js +53 -0
- package/dist/node_modules/domelementtype/lib/esm/index.js.map +1 -0
- package/dist/node_modules/domhandler/lib/esm/index.js +130 -0
- package/dist/node_modules/domhandler/lib/esm/index.js.map +1 -0
- package/dist/node_modules/domhandler/lib/esm/node.js +307 -0
- package/dist/node_modules/domhandler/lib/esm/node.js.map +1 -0
- package/dist/node_modules/entities/lib/esm/decode.js +363 -0
- package/dist/node_modules/entities/lib/esm/decode.js.map +1 -0
- package/dist/node_modules/entities/lib/esm/decode_codepoint.js +59 -0
- package/dist/node_modules/entities/lib/esm/decode_codepoint.js.map +1 -0
- package/dist/node_modules/entities/lib/esm/escape.js +85 -0
- package/dist/node_modules/entities/lib/esm/escape.js.map +1 -0
- package/dist/node_modules/entities/lib/esm/generated/decode-data-html.js +6 -0
- package/dist/node_modules/entities/lib/esm/generated/decode-data-html.js.map +1 -0
- package/dist/node_modules/entities/lib/esm/generated/decode-data-xml.js +6 -0
- package/dist/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +1 -0
- package/dist/node_modules/html-to-text/lib/html-to-text.js +1816 -0
- package/dist/node_modules/html-to-text/lib/html-to-text.js.map +1 -0
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/Parser.js +435 -0
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/Parser.js.map +1 -0
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/Tokenizer.js +736 -0
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/Tokenizer.js.map +1 -0
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/index.js +19 -0
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/index.js.map +1 -0
- package/dist/node_modules/leac/lib/leac.js +101 -0
- package/dist/node_modules/leac/lib/leac.js.map +1 -0
- package/dist/node_modules/parseley/lib/parseley.js +310 -0
- package/dist/node_modules/parseley/lib/parseley.js.map +1 -0
- package/dist/node_modules/peberminta/lib/core.js +149 -0
- package/dist/node_modules/peberminta/lib/core.js.map +1 -0
- package/dist/node_modules/selderee/lib/selderee.js +319 -0
- package/dist/node_modules/selderee/lib/selderee.js.map +1 -0
- package/dist/proxy/protected-route.d.ts +9 -0
- package/dist/proxy/protected-route.d.ts.map +1 -0
- package/dist/proxy/protected-route.js +40 -0
- package/dist/proxy/protected-route.js.map +1 -0
- package/dist/proxy/proxy.d.ts +31 -0
- package/dist/proxy/proxy.d.ts.map +1 -0
- package/dist/proxy/proxy.js +49 -0
- package/dist/proxy/proxy.js.map +1 -0
- package/dist/proxy/route-auto-detection.d.ts +12 -0
- package/dist/proxy/route-auto-detection.d.ts.map +1 -0
- package/dist/proxy/route-auto-detection.js +82 -0
- package/dist/proxy/route-auto-detection.js.map +1 -0
- package/dist/proxy/route-proxy.d.ts +36 -0
- package/dist/proxy/route-proxy.d.ts.map +1 -0
- package/dist/proxy/route-proxy.js +103 -0
- package/dist/proxy/route-proxy.js.map +1 -0
- package/dist/server/context.d.ts +30 -0
- package/dist/server/context.d.ts.map +1 -0
- package/dist/server/context.js +106 -0
- package/dist/server/context.js.map +1 -0
- package/dist/server/handlers/auth.handler.d.ts +10 -0
- package/dist/server/handlers/auth.handler.d.ts.map +1 -0
- package/dist/server/handlers/auth.handler.js +29 -0
- package/dist/server/handlers/auth.handler.js.map +1 -0
- package/dist/server/handlers/captions.handler.d.ts +10 -0
- package/dist/server/handlers/captions.handler.d.ts.map +1 -0
- package/dist/server/handlers/captions.handler.js +33 -0
- package/dist/server/handlers/captions.handler.js.map +1 -0
- package/dist/server/handlers/collection.handler.d.ts +36 -0
- package/dist/server/handlers/collection.handler.d.ts.map +1 -0
- package/dist/server/handlers/collection.handler.js +166 -0
- package/dist/server/handlers/collection.handler.js.map +1 -0
- package/dist/server/handlers/error-response.js +24 -0
- package/dist/server/handlers/error-response.js.map +1 -0
- package/dist/server/handlers/index.handler.d.ts +9 -0
- package/dist/server/handlers/index.handler.d.ts.map +1 -0
- package/dist/server/handlers/index.handler.js +145 -0
- package/dist/server/handlers/index.handler.js.map +1 -0
- package/dist/server/handlers/preview.handler.d.ts +9 -0
- package/dist/server/handlers/preview.handler.d.ts.map +1 -0
- package/dist/server/handlers/preview.handler.js +15 -0
- package/dist/server/handlers/preview.handler.js.map +1 -0
- package/dist/server/handlers/registry.handler.d.ts +16 -0
- package/dist/server/handlers/registry.handler.d.ts.map +1 -0
- package/dist/server/handlers/registry.handler.js +260 -0
- package/dist/server/handlers/registry.handler.js.map +1 -0
- package/dist/server/handlers/route.handler.d.ts +20 -0
- package/dist/server/handlers/route.handler.d.ts.map +1 -0
- package/dist/server/handlers/route.handler.js +122 -0
- package/dist/server/handlers/route.handler.js.map +1 -0
- package/dist/server/handlers/sitemap.handler.d.ts +30 -0
- package/dist/server/handlers/sitemap.handler.d.ts.map +1 -0
- package/dist/server/handlers/sitemap.handler.js +338 -0
- package/dist/server/handlers/sitemap.handler.js.map +1 -0
- package/dist/server/handlers/static-params.handler.d.ts +24 -0
- package/dist/server/handlers/static-params.handler.d.ts.map +1 -0
- package/dist/server/handlers/static-params.handler.js +56 -0
- package/dist/server/handlers/static-params.handler.js.map +1 -0
- package/dist/server/handlers/vars.handler.d.ts +10 -0
- package/dist/server/handlers/vars.handler.d.ts.map +1 -0
- package/dist/server/handlers/vars.handler.js +159 -0
- package/dist/server/handlers/vars.handler.js.map +1 -0
- package/dist/server/layout.js +88 -0
- package/dist/server/layout.js.map +1 -0
- package/dist/server/lazy.d.ts +11 -0
- package/dist/server/lazy.d.ts.map +1 -0
- package/dist/server/lazy.js +33 -0
- package/dist/server/lazy.js.map +1 -0
- package/dist/server/local-api.d.ts +9 -0
- package/dist/server/local-api.d.ts.map +1 -0
- package/dist/server/local-api.js +60 -0
- package/dist/server/local-api.js.map +1 -0
- package/dist/server/metadata.d.ts +21 -0
- package/dist/server/metadata.d.ts.map +1 -0
- package/dist/server/metadata.js +20 -0
- package/dist/server/metadata.js.map +1 -0
- package/dist/server/mixer-payload.d.ts +63 -0
- package/dist/server/mixer-payload.d.ts.map +1 -0
- package/dist/server/mixer.d.ts +214 -0
- package/dist/server/mixer.d.ts.map +1 -0
- package/dist/server/mixer.js +355 -0
- package/dist/server/mixer.js.map +1 -0
- package/dist/server/page.d.ts +22 -0
- package/dist/server/page.d.ts.map +1 -0
- package/dist/server/page.js +57 -0
- package/dist/server/page.js.map +1 -0
- package/dist/server/utils.d.ts +12 -0
- package/dist/server/utils.d.ts.map +1 -0
- package/dist/{utils-YwteTbk7.js → server/utils.js} +3 -3
- package/dist/server/utils.js.map +1 -0
- package/dist/server/utmz.d.ts +9 -0
- package/dist/server/utmz.d.ts.map +1 -0
- package/dist/server/utmz.js +14 -0
- package/dist/server/utmz.js.map +1 -0
- package/dist/types.d.ts +136 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +0 -1
- package/dist/exports/client-xcFJNcG7.d.ts +0 -979
- package/dist/exports/client-xcFJNcG7.d.ts.map +0 -1
- package/dist/exports/client.js.map +0 -1
- package/dist/exports/instrumentation-DBO6QH4d.d.ts.map +0 -1
- package/dist/exports/instrumentation.js.map +0 -1
- package/dist/exports/proxy-Cv7QFVci.d.ts +0 -71
- package/dist/exports/proxy-Cv7QFVci.d.ts.map +0 -1
- package/dist/exports/proxy.js.map +0 -1
- package/dist/exports/server-BHObJHJ6.d.ts +0 -402
- package/dist/exports/server-BHObJHJ6.d.ts.map +0 -1
- package/dist/exports/server.js.map +0 -1
- package/dist/http-_2M-UFRx.js.map +0 -1
- package/dist/index-CdYcvudT.d.ts +0 -4
- package/dist/index-CtfAJ0y7.d.ts +0 -499
- package/dist/index-CtfAJ0y7.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/route-DzFwERQP.js.map +0 -1
- package/dist/store-CJzqrHsl.js.map +0 -1
- package/dist/types-BatUTdbZ.d.ts.map +0 -1
- package/dist/types-D29_snYY.d.ts +0 -191
- package/dist/types-D29_snYY.d.ts.map +0 -1
- package/dist/utils-Ca7xh5mm.js +0 -78
- package/dist/utils-Ca7xh5mm.js.map +0 -1
- package/dist/utils-YwteTbk7.js.map +0 -1
- /package/dist/{config.client-B8As5DY0.js → instrumentation/sentry/config.client.js} +0 -0
- /package/dist/{config.edge-B8As5DY0.js → instrumentation/sentry/config.edge.js} +0 -0
- /package/dist/{config.server-B8As5DY0.js → instrumentation/sentry/config.server.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tokenizer.js","names":["xmlDecodeTree","htmlDecodeTree"],"sources":["../../../../../../../../../node_modules/html-to-text/node_modules/htmlparser2/lib/esm/Tokenizer.js"],"sourcesContent":["import { htmlDecodeTree, xmlDecodeTree, BinTrieFlags, determineBranch, replaceCodePoint, } from \"entities/lib/decode.js\";\nvar CharCodes;\n(function (CharCodes) {\n CharCodes[CharCodes[\"Tab\"] = 9] = \"Tab\";\n CharCodes[CharCodes[\"NewLine\"] = 10] = \"NewLine\";\n CharCodes[CharCodes[\"FormFeed\"] = 12] = \"FormFeed\";\n CharCodes[CharCodes[\"CarriageReturn\"] = 13] = \"CarriageReturn\";\n CharCodes[CharCodes[\"Space\"] = 32] = \"Space\";\n CharCodes[CharCodes[\"ExclamationMark\"] = 33] = \"ExclamationMark\";\n CharCodes[CharCodes[\"Number\"] = 35] = \"Number\";\n CharCodes[CharCodes[\"Amp\"] = 38] = \"Amp\";\n CharCodes[CharCodes[\"SingleQuote\"] = 39] = \"SingleQuote\";\n CharCodes[CharCodes[\"DoubleQuote\"] = 34] = \"DoubleQuote\";\n CharCodes[CharCodes[\"Dash\"] = 45] = \"Dash\";\n CharCodes[CharCodes[\"Slash\"] = 47] = \"Slash\";\n CharCodes[CharCodes[\"Zero\"] = 48] = \"Zero\";\n CharCodes[CharCodes[\"Nine\"] = 57] = \"Nine\";\n CharCodes[CharCodes[\"Semi\"] = 59] = \"Semi\";\n CharCodes[CharCodes[\"Lt\"] = 60] = \"Lt\";\n CharCodes[CharCodes[\"Eq\"] = 61] = \"Eq\";\n CharCodes[CharCodes[\"Gt\"] = 62] = \"Gt\";\n CharCodes[CharCodes[\"Questionmark\"] = 63] = \"Questionmark\";\n CharCodes[CharCodes[\"UpperA\"] = 65] = \"UpperA\";\n CharCodes[CharCodes[\"LowerA\"] = 97] = \"LowerA\";\n CharCodes[CharCodes[\"UpperF\"] = 70] = \"UpperF\";\n CharCodes[CharCodes[\"LowerF\"] = 102] = \"LowerF\";\n CharCodes[CharCodes[\"UpperZ\"] = 90] = \"UpperZ\";\n CharCodes[CharCodes[\"LowerZ\"] = 122] = \"LowerZ\";\n CharCodes[CharCodes[\"LowerX\"] = 120] = \"LowerX\";\n CharCodes[CharCodes[\"OpeningSquareBracket\"] = 91] = \"OpeningSquareBracket\";\n})(CharCodes || (CharCodes = {}));\n/** All the states the tokenizer can be in. */\nvar State;\n(function (State) {\n State[State[\"Text\"] = 1] = \"Text\";\n State[State[\"BeforeTagName\"] = 2] = \"BeforeTagName\";\n State[State[\"InTagName\"] = 3] = \"InTagName\";\n State[State[\"InSelfClosingTag\"] = 4] = \"InSelfClosingTag\";\n State[State[\"BeforeClosingTagName\"] = 5] = \"BeforeClosingTagName\";\n State[State[\"InClosingTagName\"] = 6] = \"InClosingTagName\";\n State[State[\"AfterClosingTagName\"] = 7] = \"AfterClosingTagName\";\n // Attributes\n State[State[\"BeforeAttributeName\"] = 8] = \"BeforeAttributeName\";\n State[State[\"InAttributeName\"] = 9] = \"InAttributeName\";\n State[State[\"AfterAttributeName\"] = 10] = \"AfterAttributeName\";\n State[State[\"BeforeAttributeValue\"] = 11] = \"BeforeAttributeValue\";\n State[State[\"InAttributeValueDq\"] = 12] = \"InAttributeValueDq\";\n State[State[\"InAttributeValueSq\"] = 13] = \"InAttributeValueSq\";\n State[State[\"InAttributeValueNq\"] = 14] = \"InAttributeValueNq\";\n // Declarations\n State[State[\"BeforeDeclaration\"] = 15] = \"BeforeDeclaration\";\n State[State[\"InDeclaration\"] = 16] = \"InDeclaration\";\n // Processing instructions\n State[State[\"InProcessingInstruction\"] = 17] = \"InProcessingInstruction\";\n // Comments & CDATA\n State[State[\"BeforeComment\"] = 18] = \"BeforeComment\";\n State[State[\"CDATASequence\"] = 19] = \"CDATASequence\";\n State[State[\"InSpecialComment\"] = 20] = \"InSpecialComment\";\n State[State[\"InCommentLike\"] = 21] = \"InCommentLike\";\n // Special tags\n State[State[\"BeforeSpecialS\"] = 22] = \"BeforeSpecialS\";\n State[State[\"SpecialStartSequence\"] = 23] = \"SpecialStartSequence\";\n State[State[\"InSpecialTag\"] = 24] = \"InSpecialTag\";\n State[State[\"BeforeEntity\"] = 25] = \"BeforeEntity\";\n State[State[\"BeforeNumericEntity\"] = 26] = \"BeforeNumericEntity\";\n State[State[\"InNamedEntity\"] = 27] = \"InNamedEntity\";\n State[State[\"InNumericEntity\"] = 28] = \"InNumericEntity\";\n State[State[\"InHexEntity\"] = 29] = \"InHexEntity\";\n})(State || (State = {}));\nfunction isWhitespace(c) {\n return (c === CharCodes.Space ||\n c === CharCodes.NewLine ||\n c === CharCodes.Tab ||\n c === CharCodes.FormFeed ||\n c === CharCodes.CarriageReturn);\n}\nfunction isEndOfTagSection(c) {\n return c === CharCodes.Slash || c === CharCodes.Gt || isWhitespace(c);\n}\nfunction isNumber(c) {\n return c >= CharCodes.Zero && c <= CharCodes.Nine;\n}\nfunction isASCIIAlpha(c) {\n return ((c >= CharCodes.LowerA && c <= CharCodes.LowerZ) ||\n (c >= CharCodes.UpperA && c <= CharCodes.UpperZ));\n}\nfunction isHexDigit(c) {\n return ((c >= CharCodes.UpperA && c <= CharCodes.UpperF) ||\n (c >= CharCodes.LowerA && c <= CharCodes.LowerF));\n}\nexport var QuoteType;\n(function (QuoteType) {\n QuoteType[QuoteType[\"NoValue\"] = 0] = \"NoValue\";\n QuoteType[QuoteType[\"Unquoted\"] = 1] = \"Unquoted\";\n QuoteType[QuoteType[\"Single\"] = 2] = \"Single\";\n QuoteType[QuoteType[\"Double\"] = 3] = \"Double\";\n})(QuoteType || (QuoteType = {}));\n/**\n * Sequences used to match longer strings.\n *\n * We don't have `Script`, `Style`, or `Title` here. Instead, we re-use the *End\n * sequences with an increased offset.\n */\nconst Sequences = {\n Cdata: new Uint8Array([0x43, 0x44, 0x41, 0x54, 0x41, 0x5b]),\n CdataEnd: new Uint8Array([0x5d, 0x5d, 0x3e]),\n CommentEnd: new Uint8Array([0x2d, 0x2d, 0x3e]),\n ScriptEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74]),\n StyleEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x74, 0x79, 0x6c, 0x65]),\n TitleEnd: new Uint8Array([0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65]), // `</title`\n};\nexport default class Tokenizer {\n constructor({ xmlMode = false, decodeEntities = true, }, cbs) {\n this.cbs = cbs;\n /** The current state the tokenizer is in. */\n this.state = State.Text;\n /** The read buffer. */\n this.buffer = \"\";\n /** The beginning of the section that is currently being read. */\n this.sectionStart = 0;\n /** The index within the buffer that we are currently looking at. */\n this.index = 0;\n /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */\n this.baseState = State.Text;\n /** For special parsing behavior inside of script and style tags. */\n this.isSpecial = false;\n /** Indicates whether the tokenizer has been paused. */\n this.running = true;\n /** The offset of the current buffer. */\n this.offset = 0;\n this.currentSequence = undefined;\n this.sequenceIndex = 0;\n this.trieIndex = 0;\n this.trieCurrent = 0;\n /** For named entities, the index of the value. For numeric entities, the code point. */\n this.entityResult = 0;\n this.entityExcess = 0;\n this.xmlMode = xmlMode;\n this.decodeEntities = decodeEntities;\n this.entityTrie = xmlMode ? xmlDecodeTree : htmlDecodeTree;\n }\n reset() {\n this.state = State.Text;\n this.buffer = \"\";\n this.sectionStart = 0;\n this.index = 0;\n this.baseState = State.Text;\n this.currentSequence = undefined;\n this.running = true;\n this.offset = 0;\n }\n write(chunk) {\n this.offset += this.buffer.length;\n this.buffer = chunk;\n this.parse();\n }\n end() {\n if (this.running)\n this.finish();\n }\n pause() {\n this.running = false;\n }\n resume() {\n this.running = true;\n if (this.index < this.buffer.length + this.offset) {\n this.parse();\n }\n }\n /**\n * The current index within all of the written data.\n */\n getIndex() {\n return this.index;\n }\n /**\n * The start of the current section.\n */\n getSectionStart() {\n return this.sectionStart;\n }\n stateText(c) {\n if (c === CharCodes.Lt ||\n (!this.decodeEntities && this.fastForwardTo(CharCodes.Lt))) {\n if (this.index > this.sectionStart) {\n this.cbs.ontext(this.sectionStart, this.index);\n }\n this.state = State.BeforeTagName;\n this.sectionStart = this.index;\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.state = State.BeforeEntity;\n }\n }\n stateSpecialStartSequence(c) {\n const isEnd = this.sequenceIndex === this.currentSequence.length;\n const isMatch = isEnd\n ? // If we are at the end of the sequence, make sure the tag name has ended\n isEndOfTagSection(c)\n : // Otherwise, do a case-insensitive comparison\n (c | 0x20) === this.currentSequence[this.sequenceIndex];\n if (!isMatch) {\n this.isSpecial = false;\n }\n else if (!isEnd) {\n this.sequenceIndex++;\n return;\n }\n this.sequenceIndex = 0;\n this.state = State.InTagName;\n this.stateInTagName(c);\n }\n /** Look for an end tag. For <title> tags, also decode entities. */\n stateInSpecialTag(c) {\n if (this.sequenceIndex === this.currentSequence.length) {\n if (c === CharCodes.Gt || isWhitespace(c)) {\n const endOfText = this.index - this.currentSequence.length;\n if (this.sectionStart < endOfText) {\n // Spoof the index so that reported locations match up.\n const actualIndex = this.index;\n this.index = endOfText;\n this.cbs.ontext(this.sectionStart, endOfText);\n this.index = actualIndex;\n }\n this.isSpecial = false;\n this.sectionStart = endOfText + 2; // Skip over the `</`\n this.stateInClosingTagName(c);\n return; // We are done; skip the rest of the function.\n }\n this.sequenceIndex = 0;\n }\n if ((c | 0x20) === this.currentSequence[this.sequenceIndex]) {\n this.sequenceIndex += 1;\n }\n else if (this.sequenceIndex === 0) {\n if (this.currentSequence === Sequences.TitleEnd) {\n // We have to parse entities in <title> tags.\n if (this.decodeEntities && c === CharCodes.Amp) {\n this.state = State.BeforeEntity;\n }\n }\n else if (this.fastForwardTo(CharCodes.Lt)) {\n // Outside of <title> tags, we can fast-forward.\n this.sequenceIndex = 1;\n }\n }\n else {\n // If we see a `<`, set the sequence index to 1; useful for eg. `<</script>`.\n this.sequenceIndex = Number(c === CharCodes.Lt);\n }\n }\n stateCDATASequence(c) {\n if (c === Sequences.Cdata[this.sequenceIndex]) {\n if (++this.sequenceIndex === Sequences.Cdata.length) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CdataEnd;\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n }\n }\n else {\n this.sequenceIndex = 0;\n this.state = State.InDeclaration;\n this.stateInDeclaration(c); // Reconsume the character\n }\n }\n /**\n * When we wait for one specific character, we can speed things up\n * by skipping through the buffer until we find it.\n *\n * @returns Whether the character was found.\n */\n fastForwardTo(c) {\n while (++this.index < this.buffer.length + this.offset) {\n if (this.buffer.charCodeAt(this.index - this.offset) === c) {\n return true;\n }\n }\n /*\n * We increment the index at the end of the `parse` loop,\n * so set it to `buffer.length - 1` here.\n *\n * TODO: Refactor `parse` to increment index before calling states.\n */\n this.index = this.buffer.length + this.offset - 1;\n return false;\n }\n /**\n * Comments and CDATA end with `-->` and `]]>`.\n *\n * Their common qualities are:\n * - Their end sequences have a distinct character they start with.\n * - That character is then repeated, so we have to check multiple repeats.\n * - All characters but the start character of the sequence can be skipped.\n */\n stateInCommentLike(c) {\n if (c === this.currentSequence[this.sequenceIndex]) {\n if (++this.sequenceIndex === this.currentSequence.length) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, this.index, 2);\n }\n else {\n this.cbs.oncomment(this.sectionStart, this.index, 2);\n }\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n this.state = State.Text;\n }\n }\n else if (this.sequenceIndex === 0) {\n // Fast-forward to the first character of the sequence\n if (this.fastForwardTo(this.currentSequence[0])) {\n this.sequenceIndex = 1;\n }\n }\n else if (c !== this.currentSequence[this.sequenceIndex - 1]) {\n // Allow long sequences, eg. --->, ]]]>\n this.sequenceIndex = 0;\n }\n }\n /**\n * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.\n *\n * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).\n * We allow anything that wouldn't end the tag.\n */\n isTagStartChar(c) {\n return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);\n }\n startSpecial(sequence, offset) {\n this.isSpecial = true;\n this.currentSequence = sequence;\n this.sequenceIndex = offset;\n this.state = State.SpecialStartSequence;\n }\n stateBeforeTagName(c) {\n if (c === CharCodes.ExclamationMark) {\n this.state = State.BeforeDeclaration;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Questionmark) {\n this.state = State.InProcessingInstruction;\n this.sectionStart = this.index + 1;\n }\n else if (this.isTagStartChar(c)) {\n const lower = c | 0x20;\n this.sectionStart = this.index;\n if (!this.xmlMode && lower === Sequences.TitleEnd[2]) {\n this.startSpecial(Sequences.TitleEnd, 3);\n }\n else {\n this.state =\n !this.xmlMode && lower === Sequences.ScriptEnd[2]\n ? State.BeforeSpecialS\n : State.InTagName;\n }\n }\n else if (c === CharCodes.Slash) {\n this.state = State.BeforeClosingTagName;\n }\n else {\n this.state = State.Text;\n this.stateText(c);\n }\n }\n stateInTagName(c) {\n if (isEndOfTagSection(c)) {\n this.cbs.onopentagname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n }\n stateBeforeClosingTagName(c) {\n if (isWhitespace(c)) {\n // Ignore\n }\n else if (c === CharCodes.Gt) {\n this.state = State.Text;\n }\n else {\n this.state = this.isTagStartChar(c)\n ? State.InClosingTagName\n : State.InSpecialComment;\n this.sectionStart = this.index;\n }\n }\n stateInClosingTagName(c) {\n if (c === CharCodes.Gt || isWhitespace(c)) {\n this.cbs.onclosetag(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterClosingTagName;\n this.stateAfterClosingTagName(c);\n }\n }\n stateAfterClosingTagName(c) {\n // Skip everything until \">\"\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.state = State.Text;\n this.baseState = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeAttributeName(c) {\n if (c === CharCodes.Gt) {\n this.cbs.onopentagend(this.index);\n if (this.isSpecial) {\n this.state = State.InSpecialTag;\n this.sequenceIndex = 0;\n }\n else {\n this.state = State.Text;\n }\n this.baseState = this.state;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Slash) {\n this.state = State.InSelfClosingTag;\n }\n else if (!isWhitespace(c)) {\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n }\n stateInSelfClosingTag(c) {\n if (c === CharCodes.Gt) {\n this.cbs.onselfclosingtag(this.index);\n this.state = State.Text;\n this.baseState = State.Text;\n this.sectionStart = this.index + 1;\n this.isSpecial = false; // Reset special state, in case of self-closing special tags\n }\n else if (!isWhitespace(c)) {\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n }\n stateInAttributeName(c) {\n if (c === CharCodes.Eq || isEndOfTagSection(c)) {\n this.cbs.onattribname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterAttributeName;\n this.stateAfterAttributeName(c);\n }\n }\n stateAfterAttributeName(c) {\n if (c === CharCodes.Eq) {\n this.state = State.BeforeAttributeValue;\n }\n else if (c === CharCodes.Slash || c === CharCodes.Gt) {\n this.cbs.onattribend(QuoteType.NoValue, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (!isWhitespace(c)) {\n this.cbs.onattribend(QuoteType.NoValue, this.index);\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n }\n stateBeforeAttributeValue(c) {\n if (c === CharCodes.DoubleQuote) {\n this.state = State.InAttributeValueDq;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.SingleQuote) {\n this.state = State.InAttributeValueSq;\n this.sectionStart = this.index + 1;\n }\n else if (!isWhitespace(c)) {\n this.sectionStart = this.index;\n this.state = State.InAttributeValueNq;\n this.stateInAttributeValueNoQuotes(c); // Reconsume token\n }\n }\n handleInAttributeValue(c, quote) {\n if (c === quote ||\n (!this.decodeEntities && this.fastForwardTo(quote))) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(quote === CharCodes.DoubleQuote\n ? QuoteType.Double\n : QuoteType.Single, this.index);\n this.state = State.BeforeAttributeName;\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.baseState = this.state;\n this.state = State.BeforeEntity;\n }\n }\n stateInAttributeValueDoubleQuotes(c) {\n this.handleInAttributeValue(c, CharCodes.DoubleQuote);\n }\n stateInAttributeValueSingleQuotes(c) {\n this.handleInAttributeValue(c, CharCodes.SingleQuote);\n }\n stateInAttributeValueNoQuotes(c) {\n if (isWhitespace(c) || c === CharCodes.Gt) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(QuoteType.Unquoted, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.baseState = this.state;\n this.state = State.BeforeEntity;\n }\n }\n stateBeforeDeclaration(c) {\n if (c === CharCodes.OpeningSquareBracket) {\n this.state = State.CDATASequence;\n this.sequenceIndex = 0;\n }\n else {\n this.state =\n c === CharCodes.Dash\n ? State.BeforeComment\n : State.InDeclaration;\n }\n }\n stateInDeclaration(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.ondeclaration(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateInProcessingInstruction(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.onprocessinginstruction(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeComment(c) {\n if (c === CharCodes.Dash) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CommentEnd;\n // Allow short comments (eg. <!-->)\n this.sequenceIndex = 2;\n this.sectionStart = this.index + 1;\n }\n else {\n this.state = State.InDeclaration;\n }\n }\n stateInSpecialComment(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.oncomment(this.sectionStart, this.index, 0);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeSpecialS(c) {\n const lower = c | 0x20;\n if (lower === Sequences.ScriptEnd[3]) {\n this.startSpecial(Sequences.ScriptEnd, 4);\n }\n else if (lower === Sequences.StyleEnd[3]) {\n this.startSpecial(Sequences.StyleEnd, 4);\n }\n else {\n this.state = State.InTagName;\n this.stateInTagName(c); // Consume the token again\n }\n }\n stateBeforeEntity(c) {\n // Start excess with 1 to include the '&'\n this.entityExcess = 1;\n this.entityResult = 0;\n if (c === CharCodes.Number) {\n this.state = State.BeforeNumericEntity;\n }\n else if (c === CharCodes.Amp) {\n // We have two `&` characters in a row. Stay in the current state.\n }\n else {\n this.trieIndex = 0;\n this.trieCurrent = this.entityTrie[0];\n this.state = State.InNamedEntity;\n this.stateInNamedEntity(c);\n }\n }\n stateInNamedEntity(c) {\n this.entityExcess += 1;\n this.trieIndex = determineBranch(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c);\n if (this.trieIndex < 0) {\n this.emitNamedEntity();\n this.index--;\n return;\n }\n this.trieCurrent = this.entityTrie[this.trieIndex];\n const masked = this.trieCurrent & BinTrieFlags.VALUE_LENGTH;\n // If the branch is a value, store it and continue\n if (masked) {\n // The mask is the number of bytes of the value, including the current byte.\n const valueLength = (masked >> 14) - 1;\n // If we have a legacy entity while parsing strictly, just skip the number of bytes\n if (!this.allowLegacyEntity() && c !== CharCodes.Semi) {\n this.trieIndex += valueLength;\n }\n else {\n // Add 1 as we have already incremented the excess\n const entityStart = this.index - this.entityExcess + 1;\n if (entityStart > this.sectionStart) {\n this.emitPartial(this.sectionStart, entityStart);\n }\n // If this is a surrogate pair, consume the next two bytes\n this.entityResult = this.trieIndex;\n this.trieIndex += valueLength;\n this.entityExcess = 0;\n this.sectionStart = this.index + 1;\n if (valueLength === 0) {\n this.emitNamedEntity();\n }\n }\n }\n }\n emitNamedEntity() {\n this.state = this.baseState;\n if (this.entityResult === 0) {\n return;\n }\n const valueLength = (this.entityTrie[this.entityResult] & BinTrieFlags.VALUE_LENGTH) >>\n 14;\n switch (valueLength) {\n case 1: {\n this.emitCodePoint(this.entityTrie[this.entityResult] &\n ~BinTrieFlags.VALUE_LENGTH);\n break;\n }\n case 2: {\n this.emitCodePoint(this.entityTrie[this.entityResult + 1]);\n break;\n }\n case 3: {\n this.emitCodePoint(this.entityTrie[this.entityResult + 1]);\n this.emitCodePoint(this.entityTrie[this.entityResult + 2]);\n }\n }\n }\n stateBeforeNumericEntity(c) {\n if ((c | 0x20) === CharCodes.LowerX) {\n this.entityExcess++;\n this.state = State.InHexEntity;\n }\n else {\n this.state = State.InNumericEntity;\n this.stateInNumericEntity(c);\n }\n }\n emitNumericEntity(strict) {\n const entityStart = this.index - this.entityExcess - 1;\n const numberStart = entityStart + 2 + Number(this.state === State.InHexEntity);\n if (numberStart !== this.index) {\n // Emit leading data if any\n if (entityStart > this.sectionStart) {\n this.emitPartial(this.sectionStart, entityStart);\n }\n this.sectionStart = this.index + Number(strict);\n this.emitCodePoint(replaceCodePoint(this.entityResult));\n }\n this.state = this.baseState;\n }\n stateInNumericEntity(c) {\n if (c === CharCodes.Semi) {\n this.emitNumericEntity(true);\n }\n else if (isNumber(c)) {\n this.entityResult = this.entityResult * 10 + (c - CharCodes.Zero);\n this.entityExcess++;\n }\n else {\n if (this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n }\n else {\n this.state = this.baseState;\n }\n this.index--;\n }\n }\n stateInHexEntity(c) {\n if (c === CharCodes.Semi) {\n this.emitNumericEntity(true);\n }\n else if (isNumber(c)) {\n this.entityResult = this.entityResult * 16 + (c - CharCodes.Zero);\n this.entityExcess++;\n }\n else if (isHexDigit(c)) {\n this.entityResult =\n this.entityResult * 16 + ((c | 0x20) - CharCodes.LowerA + 10);\n this.entityExcess++;\n }\n else {\n if (this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n }\n else {\n this.state = this.baseState;\n }\n this.index--;\n }\n }\n allowLegacyEntity() {\n return (!this.xmlMode &&\n (this.baseState === State.Text ||\n this.baseState === State.InSpecialTag));\n }\n /**\n * Remove data that has already been consumed from the buffer.\n */\n cleanup() {\n // If we are inside of text or attributes, emit what we already have.\n if (this.running && this.sectionStart !== this.index) {\n if (this.state === State.Text ||\n (this.state === State.InSpecialTag && this.sequenceIndex === 0)) {\n this.cbs.ontext(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n else if (this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueNq) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n }\n }\n shouldContinue() {\n return this.index < this.buffer.length + this.offset && this.running;\n }\n /**\n * Iterates through the buffer, calling the function corresponding to the current state.\n *\n * States that are more likely to be hit are higher up, as a performance improvement.\n */\n parse() {\n while (this.shouldContinue()) {\n const c = this.buffer.charCodeAt(this.index - this.offset);\n switch (this.state) {\n case State.Text: {\n this.stateText(c);\n break;\n }\n case State.SpecialStartSequence: {\n this.stateSpecialStartSequence(c);\n break;\n }\n case State.InSpecialTag: {\n this.stateInSpecialTag(c);\n break;\n }\n case State.CDATASequence: {\n this.stateCDATASequence(c);\n break;\n }\n case State.InAttributeValueDq: {\n this.stateInAttributeValueDoubleQuotes(c);\n break;\n }\n case State.InAttributeName: {\n this.stateInAttributeName(c);\n break;\n }\n case State.InCommentLike: {\n this.stateInCommentLike(c);\n break;\n }\n case State.InSpecialComment: {\n this.stateInSpecialComment(c);\n break;\n }\n case State.BeforeAttributeName: {\n this.stateBeforeAttributeName(c);\n break;\n }\n case State.InTagName: {\n this.stateInTagName(c);\n break;\n }\n case State.InClosingTagName: {\n this.stateInClosingTagName(c);\n break;\n }\n case State.BeforeTagName: {\n this.stateBeforeTagName(c);\n break;\n }\n case State.AfterAttributeName: {\n this.stateAfterAttributeName(c);\n break;\n }\n case State.InAttributeValueSq: {\n this.stateInAttributeValueSingleQuotes(c);\n break;\n }\n case State.BeforeAttributeValue: {\n this.stateBeforeAttributeValue(c);\n break;\n }\n case State.BeforeClosingTagName: {\n this.stateBeforeClosingTagName(c);\n break;\n }\n case State.AfterClosingTagName: {\n this.stateAfterClosingTagName(c);\n break;\n }\n case State.BeforeSpecialS: {\n this.stateBeforeSpecialS(c);\n break;\n }\n case State.InAttributeValueNq: {\n this.stateInAttributeValueNoQuotes(c);\n break;\n }\n case State.InSelfClosingTag: {\n this.stateInSelfClosingTag(c);\n break;\n }\n case State.InDeclaration: {\n this.stateInDeclaration(c);\n break;\n }\n case State.BeforeDeclaration: {\n this.stateBeforeDeclaration(c);\n break;\n }\n case State.BeforeComment: {\n this.stateBeforeComment(c);\n break;\n }\n case State.InProcessingInstruction: {\n this.stateInProcessingInstruction(c);\n break;\n }\n case State.InNamedEntity: {\n this.stateInNamedEntity(c);\n break;\n }\n case State.BeforeEntity: {\n this.stateBeforeEntity(c);\n break;\n }\n case State.InHexEntity: {\n this.stateInHexEntity(c);\n break;\n }\n case State.InNumericEntity: {\n this.stateInNumericEntity(c);\n break;\n }\n default: {\n // `this._state === State.BeforeNumericEntity`\n this.stateBeforeNumericEntity(c);\n }\n }\n this.index++;\n }\n this.cleanup();\n }\n finish() {\n if (this.state === State.InNamedEntity) {\n this.emitNamedEntity();\n }\n // If there is remaining data, emit it in a reasonable way\n if (this.sectionStart < this.index) {\n this.handleTrailingData();\n }\n this.cbs.onend();\n }\n /** Handle any trailing data. */\n handleTrailingData() {\n const endIndex = this.buffer.length + this.offset;\n if (this.state === State.InCommentLike) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, endIndex, 0);\n }\n else {\n this.cbs.oncomment(this.sectionStart, endIndex, 0);\n }\n }\n else if (this.state === State.InNumericEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InHexEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InTagName ||\n this.state === State.BeforeAttributeName ||\n this.state === State.BeforeAttributeValue ||\n this.state === State.AfterAttributeName ||\n this.state === State.InAttributeName ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueNq ||\n this.state === State.InClosingTagName) {\n /*\n * If we are currently in an opening or closing tag, us not calling the\n * respective callback signals that the tag should be ignored.\n */\n }\n else {\n this.cbs.ontext(this.sectionStart, endIndex);\n }\n }\n emitPartial(start, endIndex) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n this.cbs.onattribdata(start, endIndex);\n }\n else {\n this.cbs.ontext(start, endIndex);\n }\n }\n emitCodePoint(cp) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n this.cbs.onattribentity(cp);\n }\n else {\n this.cbs.ontextentity(cp);\n }\n }\n}\n//# sourceMappingURL=Tokenizer.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;AACA,IAAI;CACH,SAAU,WAAW;CAClB,UAAU,UAAU,SAAS,KAAK;CAClC,UAAU,UAAU,aAAa,MAAM;CACvC,UAAU,UAAU,cAAc,MAAM;CACxC,UAAU,UAAU,oBAAoB,MAAM;CAC9C,UAAU,UAAU,WAAW,MAAM;CACrC,UAAU,UAAU,qBAAqB,MAAM;CAC/C,UAAU,UAAU,YAAY,MAAM;CACtC,UAAU,UAAU,SAAS,MAAM;CACnC,UAAU,UAAU,iBAAiB,MAAM;CAC3C,UAAU,UAAU,iBAAiB,MAAM;CAC3C,UAAU,UAAU,UAAU,MAAM;CACpC,UAAU,UAAU,WAAW,MAAM;CACrC,UAAU,UAAU,UAAU,MAAM;CACpC,UAAU,UAAU,UAAU,MAAM;CACpC,UAAU,UAAU,UAAU,MAAM;CACpC,UAAU,UAAU,QAAQ,MAAM;CAClC,UAAU,UAAU,QAAQ,MAAM;CAClC,UAAU,UAAU,QAAQ,MAAM;CAClC,UAAU,UAAU,kBAAkB,MAAM;CAC5C,UAAU,UAAU,YAAY,MAAM;CACtC,UAAU,UAAU,YAAY,MAAM;CACtC,UAAU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,KAAK,kBAAkB,GACvB,KAAK,kBAAkB,KAAK;OAG3B,IAAI,KAAK,UAAU,MAAM,eAC1B,KAAK,kBAAkB,GACvB,KAAK,kBAAkB,KAAK;OAG3B,IAAI,KAAK,UAAU,MAAM,aAC1B,KAAK,UAAU,MAAM,uBACrB,KAAK,UAAU,MAAM,wBACrB,KAAK,UAAU,MAAM,sBACrB,KAAK,UAAU,MAAM,mBACrB,KAAK,UAAU,MAAM,sBACrB,KAAK,UAAU,MAAM,sBACrB,KAAK,UAAU,MAAM,sBACrB,KAAK,UAAU,MAAM,kBAAkB,CAK3C,OAEI,KAAK,IAAI,OAAO,KAAK,cAAc,QAAQ;CAEnD;CACA,YAAY,OAAO,UAAU;EACzB,IAAI,KAAK,cAAc,MAAM,QACzB,KAAK,cAAc,MAAM,cACzB,KAAK,IAAI,aAAa,OAAO,QAAQ;OAGrC,KAAK,IAAI,OAAO,OAAO,QAAQ;CAEvC;CACA,cAAc,IAAI;EACd,IAAI,KAAK,cAAc,MAAM,QACzB,KAAK,cAAc,MAAM,cACzB,KAAK,IAAI,eAAe,EAAE;OAG1B,KAAK,IAAI,aAAa,EAAE;CAEhC;AACJ"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DomHandler } from "../../../../../domhandler/lib/esm/index.js";
|
|
2
|
+
import "./Tokenizer.js";
|
|
3
|
+
import { Parser } from "./Parser.js";
|
|
4
|
+
//#region ../../node_modules/html-to-text/node_modules/htmlparser2/lib/esm/index.js
|
|
5
|
+
/**
|
|
6
|
+
* Parses the data, returns the resulting document.
|
|
7
|
+
*
|
|
8
|
+
* @param data The data that should be parsed.
|
|
9
|
+
* @param options Optional options for the parser and DOM builder.
|
|
10
|
+
*/
|
|
11
|
+
function parseDocument(data, options) {
|
|
12
|
+
const handler = new DomHandler(void 0, options);
|
|
13
|
+
new Parser(handler, options).end(data);
|
|
14
|
+
return handler.root;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { parseDocument };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../../node_modules/html-to-text/node_modules/htmlparser2/lib/esm/index.js"],"sourcesContent":["import { Parser } from \"./Parser.js\";\nexport { Parser } from \"./Parser.js\";\nimport { DomHandler, } from \"domhandler\";\nexport { DomHandler, \n// Old name for DomHandler\nDomHandler as DefaultHandler, } from \"domhandler\";\n// Helper methods\n/**\n * Parses the data, returns the resulting document.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM builder.\n */\nexport function parseDocument(data, options) {\n const handler = new DomHandler(undefined, options);\n new Parser(handler, options).end(data);\n return handler.root;\n}\n/**\n * Parses data, returns an array of the root nodes.\n *\n * Note that the root nodes still have a `Document` node as their parent.\n * Use `parseDocument` to get the `Document` node instead.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM builder.\n * @deprecated Use `parseDocument` instead.\n */\nexport function parseDOM(data, options) {\n return parseDocument(data, options).children;\n}\n/**\n * Creates a parser instance, with an attached DOM handler.\n *\n * @param callback A callback that will be called once parsing has been completed.\n * @param options Optional options for the parser and DOM builder.\n * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM.\n */\nexport function createDomStream(callback, options, elementCallback) {\n const handler = new DomHandler(callback, options, elementCallback);\n return new Parser(handler, options);\n}\nexport { default as Tokenizer, } from \"./Tokenizer.js\";\n/*\n * All of the following exports exist for backwards-compatibility.\n * They should probably be removed eventually.\n */\nexport * as ElementType from \"domelementtype\";\nimport { getFeed } from \"domutils\";\nexport { getFeed } from \"domutils\";\nconst parseFeedDefaultOptions = { xmlMode: true };\n/**\n * Parse a feed.\n *\n * @param feed The feed that should be parsed, as a string.\n * @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`.\n */\nexport function parseFeed(feed, options = parseFeedDefaultOptions) {\n return getFeed(parseDOM(feed, options));\n}\nexport * as DomUtils from \"domutils\";\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAaA,SAAgB,cAAc,MAAM,SAAS;CACzC,MAAM,UAAU,IAAI,WAAW,KAAA,GAAW,OAAO;CACjD,IAAI,OAAO,SAAS,OAAO,CAAC,CAAC,IAAI,IAAI;CACrC,OAAO,QAAQ;AACnB"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
//#region ../../node_modules/leac/lib/leac.mjs
|
|
2
|
+
const e = /\n/g;
|
|
3
|
+
function n(n) {
|
|
4
|
+
const o = [...n.matchAll(e)].map(((e) => e.index || 0));
|
|
5
|
+
o.unshift(-1);
|
|
6
|
+
const s = t(o, 0, o.length);
|
|
7
|
+
return (e) => r(s, e);
|
|
8
|
+
}
|
|
9
|
+
function t(e, n, r) {
|
|
10
|
+
if (r - n == 1) return {
|
|
11
|
+
offset: e[n],
|
|
12
|
+
index: n + 1
|
|
13
|
+
};
|
|
14
|
+
const o = Math.ceil((n + r) / 2), s = t(e, n, o), l = t(e, o, r);
|
|
15
|
+
return {
|
|
16
|
+
offset: s.offset,
|
|
17
|
+
low: s,
|
|
18
|
+
high: l
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function r(e, n) {
|
|
22
|
+
return function(e) {
|
|
23
|
+
return Object.prototype.hasOwnProperty.call(e, "index");
|
|
24
|
+
}(e) ? {
|
|
25
|
+
line: e.index,
|
|
26
|
+
column: n - e.offset
|
|
27
|
+
} : r(e.high.offset < n ? e.high : e.low, n);
|
|
28
|
+
}
|
|
29
|
+
function o(e, t = "", r = {}) {
|
|
30
|
+
const o = "string" != typeof t ? t : r, l = "string" == typeof t ? t : "", c = e.map(s), f = !!o.lineNumbers;
|
|
31
|
+
return function(e, t = 0) {
|
|
32
|
+
const r = f ? n(e) : () => ({
|
|
33
|
+
line: 0,
|
|
34
|
+
column: 0
|
|
35
|
+
});
|
|
36
|
+
let o = t;
|
|
37
|
+
const s = [];
|
|
38
|
+
e: for (; o < e.length;) {
|
|
39
|
+
let n = !1;
|
|
40
|
+
for (const t of c) {
|
|
41
|
+
t.regex.lastIndex = o;
|
|
42
|
+
const c = t.regex.exec(e);
|
|
43
|
+
if (c && c[0].length > 0) {
|
|
44
|
+
if (!t.discard) {
|
|
45
|
+
const e = r(o), n = "string" == typeof t.replace ? c[0].replace(new RegExp(t.regex.source, t.regex.flags), t.replace) : c[0];
|
|
46
|
+
s.push({
|
|
47
|
+
state: l,
|
|
48
|
+
name: t.name,
|
|
49
|
+
text: n,
|
|
50
|
+
offset: o,
|
|
51
|
+
len: c[0].length,
|
|
52
|
+
line: e.line,
|
|
53
|
+
column: e.column
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (o = t.regex.lastIndex, n = !0, t.push) {
|
|
57
|
+
const n = t.push(e, o);
|
|
58
|
+
s.push(...n.tokens), o = n.offset;
|
|
59
|
+
}
|
|
60
|
+
if (t.pop) break e;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (!n) break;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
tokens: s,
|
|
68
|
+
offset: o,
|
|
69
|
+
complete: e.length <= o
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function s(e, n) {
|
|
74
|
+
return {
|
|
75
|
+
...e,
|
|
76
|
+
regex: l(e, n)
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function l(e, n) {
|
|
80
|
+
if (0 === e.name.length) throw new Error(`Rule #${n} has empty name, which is not allowed.`);
|
|
81
|
+
if (function(e) {
|
|
82
|
+
return Object.prototype.hasOwnProperty.call(e, "regex");
|
|
83
|
+
}(e)) return function(e) {
|
|
84
|
+
if (e.global) throw new Error(`Regular expression /${e.source}/${e.flags} contains the global flag, which is not allowed.`);
|
|
85
|
+
return e.sticky ? e : new RegExp(e.source, e.flags + "y");
|
|
86
|
+
}(e.regex);
|
|
87
|
+
if (function(e) {
|
|
88
|
+
return Object.prototype.hasOwnProperty.call(e, "str");
|
|
89
|
+
}(e)) {
|
|
90
|
+
if (0 === e.str.length) throw new Error(`Rule #${n} ("${e.name}") has empty "str" property, which is not allowed.`);
|
|
91
|
+
return new RegExp(c(e.str), "y");
|
|
92
|
+
}
|
|
93
|
+
return new RegExp(c(e.name), "y");
|
|
94
|
+
}
|
|
95
|
+
function c(e) {
|
|
96
|
+
return e.replace(/[-[\]{}()*+!<=:?./\\^$|#\s,]/g, "\\$&");
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { o as createLexer };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=leac.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leac.js","names":[],"sources":["../../../../../../node_modules/leac/lib/leac.mjs"],"sourcesContent":["const e=/\\n/g;function n(n){const o=[...n.matchAll(e)].map((e=>e.index||0));o.unshift(-1);const s=t(o,0,o.length);return e=>r(s,e)}function t(e,n,r){if(r-n==1)return{offset:e[n],index:n+1};const o=Math.ceil((n+r)/2),s=t(e,n,o),l=t(e,o,r);return{offset:s.offset,low:s,high:l}}function r(e,n){return function(e){return Object.prototype.hasOwnProperty.call(e,\"index\")}(e)?{line:e.index,column:n-e.offset}:r(e.high.offset<n?e.high:e.low,n)}function o(e,t=\"\",r={}){const o=\"string\"!=typeof t?t:r,l=\"string\"==typeof t?t:\"\",c=e.map(s),f=!!o.lineNumbers;return function(e,t=0){const r=f?n(e):()=>({line:0,column:0});let o=t;const s=[];e:for(;o<e.length;){let n=!1;for(const t of c){t.regex.lastIndex=o;const c=t.regex.exec(e);if(c&&c[0].length>0){if(!t.discard){const e=r(o),n=\"string\"==typeof t.replace?c[0].replace(new RegExp(t.regex.source,t.regex.flags),t.replace):c[0];s.push({state:l,name:t.name,text:n,offset:o,len:c[0].length,line:e.line,column:e.column})}if(o=t.regex.lastIndex,n=!0,t.push){const n=t.push(e,o);s.push(...n.tokens),o=n.offset}if(t.pop)break e;break}}if(!n)break}return{tokens:s,offset:o,complete:e.length<=o}}}function s(e,n){return{...e,regex:l(e,n)}}function l(e,n){if(0===e.name.length)throw new Error(`Rule #${n} has empty name, which is not allowed.`);if(function(e){return Object.prototype.hasOwnProperty.call(e,\"regex\")}(e))return function(e){if(e.global)throw new Error(`Regular expression /${e.source}/${e.flags} contains the global flag, which is not allowed.`);return e.sticky?e:new RegExp(e.source,e.flags+\"y\")}(e.regex);if(function(e){return Object.prototype.hasOwnProperty.call(e,\"str\")}(e)){if(0===e.str.length)throw new Error(`Rule #${n} (\"${e.name}\") has empty \"str\" property, which is not allowed.`);return new RegExp(c(e.str),\"y\")}return new RegExp(c(e.name),\"y\")}function c(e){return e.replace(/[-[\\]{}()*+!<=:?./\\\\^$|#\\s,]/g,\"\\\\$&\")}export{o as createLexer};\n"],"x_google_ignoreList":[0],"mappings":";AAAA,MAAM,IAAE;AAAM,SAAS,EAAE,GAAE;CAAC,MAAM,IAAE,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,MAAK,MAAG,EAAE,SAAO,EAAE;CAAE,EAAE,QAAQ,EAAE;CAAE,MAAM,IAAE,EAAE,GAAE,GAAE,EAAE,MAAM;CAAE,QAAO,MAAG,EAAE,GAAE,CAAC;AAAC;AAAC,SAAS,EAAE,GAAE,GAAE,GAAE;CAAC,IAAG,IAAE,KAAG,GAAE,OAAM;EAAC,QAAO,EAAE;EAAG,OAAM,IAAE;CAAC;CAAE,MAAM,IAAE,KAAK,MAAM,IAAE,KAAG,CAAC,GAAE,IAAE,EAAE,GAAE,GAAE,CAAC,GAAE,IAAE,EAAE,GAAE,GAAE,CAAC;CAAE,OAAM;EAAC,QAAO,EAAE;EAAO,KAAI;EAAE,MAAK;CAAC;AAAC;AAAC,SAAS,EAAE,GAAE,GAAE;CAAC,OAAO,SAAS,GAAE;EAAC,OAAO,OAAO,UAAU,eAAe,KAAK,GAAE,OAAO;CAAC,EAAE,CAAC,IAAE;EAAC,MAAK,E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AAC,IAAG,CAAC,GAAE;EAAK;EAAC,OAAM;GAAC,QAAO;GAAE,QAAO;GAAE,UAAS,EAAE,UAAQ;EAAC;CAAC;AAAC;AAAC,SAAS,EAAE,GAAE,GAAE;CAAC,OAAM;EAAC,GAAG;EAAE,OAAM,EAAE,GAAE,CAAC;CAAC;AAAC;AAAC,SAAS,EAAE,GAAE,GAAE;CAAC,IAAG,MAAI,EAAE,KAAK,QAAO,MAAM,IAAI,MAAM,SAAS,EAAE,uCAAuC;CAAE,IAAG,SAAS,GAAE;EAAC,OAAO,OAAO,UAAU,eAAe,KAAK,GAAE,OAAO;CAAC,EAAE,CAAC,GAAE,OAAO,SAAS,GAAE;EAAC,IAAG,EAAE,QAAO,MAAM,IAAI,MAAM,uBAAuB,EAAE,OAAO,GAAG,EAAE,MAAM,iDAAiD;EAAE,OAAO,EAAE,SAAO,IAAE,IAAI,OAAO,EAAE,QAAO,EAAE,QAAM,GAAG;CAAC,EAAE,EAAE,KAAK;CAAE,IAAG,SAAS,GAAE;EAAC,OAAO,OAAO,UAAU,eAAe,KAAK,GAAE,KAAK;CAAC,EAAE,CAAC,GAAE;EAAC,IAAG,MAAI,EAAE,IAAI,QAAO,MAAM,IAAI,MAAM,SAAS,EAAE,KAAK,EAAE,KAAK,mDAAmD;EAAE,OAAO,IAAI,OAAO,EAAE,EAAE,GAAG,GAAE,GAAG;CAAC;CAAC,OAAO,IAAI,OAAO,EAAE,EAAE,IAAI,GAAE,GAAG;AAAC;AAAC,SAAS,EAAE,GAAE;CAAC,OAAO,EAAE,QAAQ,iCAAgC,MAAM;AAAC"}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { createLexer as o } from "../../leac/lib/leac.js";
|
|
2
|
+
import { ab, abc, choice, eitherOr as otherwise, flatten, left, leftAssoc2, many, many1, map, middle, option, right, token } from "../../peberminta/lib/core.js";
|
|
3
|
+
//#region ../../node_modules/parseley/lib/parseley.mjs
|
|
4
|
+
const ws = `(?:[ \\t\\r\\n\\f]*)`;
|
|
5
|
+
const nl = `(?:\\n|\\r\\n|\\r|\\f)`;
|
|
6
|
+
const nonascii = `[^\\x00-\\x7F]`;
|
|
7
|
+
const unicode = `(?:\\\\[0-9a-f]{1,6}(?:\\r\\n|[ \\n\\r\\t\\f])?)`;
|
|
8
|
+
const escape = `(?:\\\\[^\\n\\r\\f0-9a-f])`;
|
|
9
|
+
const nmstart = `(?:[_a-z]|${nonascii}|${unicode}|${escape})`;
|
|
10
|
+
const nmchar = `(?:[_a-z0-9-]|${nonascii}|${unicode}|${escape})`;
|
|
11
|
+
const name = `(?:${nmchar}+)`;
|
|
12
|
+
const ident = `(?:[-]?${nmstart}${nmchar}*)`;
|
|
13
|
+
const string1 = `'([^\\n\\r\\f\\\\']|\\\\${nl}|${nonascii}|${unicode}|${escape})*'`;
|
|
14
|
+
const string2 = `"([^\\n\\r\\f\\\\"]|\\\\${nl}|${nonascii}|${unicode}|${escape})*"`;
|
|
15
|
+
const lexSelector = o([
|
|
16
|
+
{
|
|
17
|
+
name: "ws",
|
|
18
|
+
regex: new RegExp(ws)
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "hash",
|
|
22
|
+
regex: new RegExp(`#${name}`, "i")
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "ident",
|
|
26
|
+
regex: new RegExp(ident, "i")
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "str1",
|
|
30
|
+
regex: new RegExp(string1, "i")
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "str2",
|
|
34
|
+
regex: new RegExp(string2, "i")
|
|
35
|
+
},
|
|
36
|
+
{ name: "*" },
|
|
37
|
+
{ name: "." },
|
|
38
|
+
{ name: "," },
|
|
39
|
+
{ name: "[" },
|
|
40
|
+
{ name: "]" },
|
|
41
|
+
{ name: "=" },
|
|
42
|
+
{ name: ">" },
|
|
43
|
+
{ name: "|" },
|
|
44
|
+
{ name: "+" },
|
|
45
|
+
{ name: "~" },
|
|
46
|
+
{ name: "^" },
|
|
47
|
+
{ name: "$" }
|
|
48
|
+
]);
|
|
49
|
+
const lexEscapedString = o([
|
|
50
|
+
{
|
|
51
|
+
name: "unicode",
|
|
52
|
+
regex: new RegExp(unicode, "i")
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "escape",
|
|
56
|
+
regex: new RegExp(escape, "i")
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "any",
|
|
60
|
+
regex: /* @__PURE__ */ new RegExp("[\\s\\S]", "i")
|
|
61
|
+
}
|
|
62
|
+
]);
|
|
63
|
+
function sumSpec([a0, a1, a2], [b0, b1, b2]) {
|
|
64
|
+
return [
|
|
65
|
+
a0 + b0,
|
|
66
|
+
a1 + b1,
|
|
67
|
+
a2 + b2
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
function sumAllSpec(ss) {
|
|
71
|
+
return ss.reduce(sumSpec, [
|
|
72
|
+
0,
|
|
73
|
+
0,
|
|
74
|
+
0
|
|
75
|
+
]);
|
|
76
|
+
}
|
|
77
|
+
const unicodeEscapedSequence_ = token((t) => t.name === "unicode" ? String.fromCodePoint(parseInt(t.text.slice(1), 16)) : void 0);
|
|
78
|
+
const escapedSequence_ = token((t) => t.name === "escape" ? t.text.slice(1) : void 0);
|
|
79
|
+
const anyChar_ = token((t) => t.name === "any" ? t.text : void 0);
|
|
80
|
+
const escapedString_ = map(many(choice(unicodeEscapedSequence_, escapedSequence_, anyChar_)), (cs) => cs.join(""));
|
|
81
|
+
function unescape(escapedString) {
|
|
82
|
+
const lexerResult = lexEscapedString(escapedString);
|
|
83
|
+
return escapedString_({
|
|
84
|
+
tokens: lexerResult.tokens,
|
|
85
|
+
options: void 0
|
|
86
|
+
}, 0).value;
|
|
87
|
+
}
|
|
88
|
+
function literal(name) {
|
|
89
|
+
return token((t) => t.name === name ? true : void 0);
|
|
90
|
+
}
|
|
91
|
+
const whitespace_ = token((t) => t.name === "ws" ? null : void 0);
|
|
92
|
+
const optionalWhitespace_ = option(whitespace_, null);
|
|
93
|
+
function optionallySpaced(parser) {
|
|
94
|
+
return middle(optionalWhitespace_, parser, optionalWhitespace_);
|
|
95
|
+
}
|
|
96
|
+
const identifier_ = token((t) => t.name === "ident" ? unescape(t.text) : void 0);
|
|
97
|
+
const hashId_ = token((t) => t.name === "hash" ? unescape(t.text.slice(1)) : void 0);
|
|
98
|
+
const string_ = token((t) => t.name.startsWith("str") ? unescape(t.text.slice(1, -1)) : void 0);
|
|
99
|
+
const namespace_ = left(option(identifier_, ""), literal("|"));
|
|
100
|
+
const qualifiedName_ = otherwise(ab(namespace_, identifier_, (ns, name) => ({
|
|
101
|
+
name,
|
|
102
|
+
namespace: ns
|
|
103
|
+
})), map(identifier_, (name) => ({
|
|
104
|
+
name,
|
|
105
|
+
namespace: null
|
|
106
|
+
})));
|
|
107
|
+
const uniSelector_ = otherwise(ab(namespace_, literal("*"), (ns) => ({
|
|
108
|
+
type: "universal",
|
|
109
|
+
namespace: ns,
|
|
110
|
+
specificity: [
|
|
111
|
+
0,
|
|
112
|
+
0,
|
|
113
|
+
0
|
|
114
|
+
]
|
|
115
|
+
})), map(literal("*"), () => ({
|
|
116
|
+
type: "universal",
|
|
117
|
+
namespace: null,
|
|
118
|
+
specificity: [
|
|
119
|
+
0,
|
|
120
|
+
0,
|
|
121
|
+
0
|
|
122
|
+
]
|
|
123
|
+
})));
|
|
124
|
+
const tagSelector_ = map(qualifiedName_, ({ name, namespace }) => ({
|
|
125
|
+
type: "tag",
|
|
126
|
+
name,
|
|
127
|
+
namespace,
|
|
128
|
+
specificity: [
|
|
129
|
+
0,
|
|
130
|
+
0,
|
|
131
|
+
1
|
|
132
|
+
]
|
|
133
|
+
}));
|
|
134
|
+
const classSelector_ = ab(literal("."), identifier_, (fullstop, name) => ({
|
|
135
|
+
type: "class",
|
|
136
|
+
name,
|
|
137
|
+
specificity: [
|
|
138
|
+
0,
|
|
139
|
+
1,
|
|
140
|
+
0
|
|
141
|
+
]
|
|
142
|
+
}));
|
|
143
|
+
const idSelector_ = map(hashId_, (name) => ({
|
|
144
|
+
type: "id",
|
|
145
|
+
name,
|
|
146
|
+
specificity: [
|
|
147
|
+
1,
|
|
148
|
+
0,
|
|
149
|
+
0
|
|
150
|
+
]
|
|
151
|
+
}));
|
|
152
|
+
const attrModifier_ = token((t) => {
|
|
153
|
+
if (t.name === "ident") {
|
|
154
|
+
if (t.text === "i" || t.text === "I") return "i";
|
|
155
|
+
if (t.text === "s" || t.text === "S") return "s";
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
const attrValue_ = otherwise(ab(string_, option(right(optionalWhitespace_, attrModifier_), null), (v, mod) => ({
|
|
159
|
+
value: v,
|
|
160
|
+
modifier: mod
|
|
161
|
+
})), ab(identifier_, option(right(whitespace_, attrModifier_), null), (v, mod) => ({
|
|
162
|
+
value: v,
|
|
163
|
+
modifier: mod
|
|
164
|
+
})));
|
|
165
|
+
const attrMatcher_ = choice(map(literal("="), () => "="), ab(literal("~"), literal("="), () => "~="), ab(literal("|"), literal("="), () => "|="), ab(literal("^"), literal("="), () => "^="), ab(literal("$"), literal("="), () => "$="), ab(literal("*"), literal("="), () => "*="));
|
|
166
|
+
const attrPresenceSelector_ = abc(literal("["), optionallySpaced(qualifiedName_), literal("]"), (lbr, { name, namespace }) => ({
|
|
167
|
+
type: "attrPresence",
|
|
168
|
+
name,
|
|
169
|
+
namespace,
|
|
170
|
+
specificity: [
|
|
171
|
+
0,
|
|
172
|
+
1,
|
|
173
|
+
0
|
|
174
|
+
]
|
|
175
|
+
}));
|
|
176
|
+
const attrValueSelector_ = middle(literal("["), abc(optionallySpaced(qualifiedName_), attrMatcher_, optionallySpaced(attrValue_), ({ name, namespace }, matcher, { value, modifier }) => ({
|
|
177
|
+
type: "attrValue",
|
|
178
|
+
name,
|
|
179
|
+
namespace,
|
|
180
|
+
matcher,
|
|
181
|
+
value,
|
|
182
|
+
modifier,
|
|
183
|
+
specificity: [
|
|
184
|
+
0,
|
|
185
|
+
1,
|
|
186
|
+
0
|
|
187
|
+
]
|
|
188
|
+
})), literal("]"));
|
|
189
|
+
const attrSelector_ = otherwise(attrPresenceSelector_, attrValueSelector_);
|
|
190
|
+
const typeSelector_ = otherwise(uniSelector_, tagSelector_);
|
|
191
|
+
const subclassSelector_ = choice(idSelector_, classSelector_, attrSelector_);
|
|
192
|
+
const compoundSelector_ = map(otherwise(flatten(typeSelector_, many(subclassSelector_)), many1(subclassSelector_)), (ss) => {
|
|
193
|
+
return {
|
|
194
|
+
type: "compound",
|
|
195
|
+
list: ss,
|
|
196
|
+
specificity: sumAllSpec(ss.map((s) => s.specificity))
|
|
197
|
+
};
|
|
198
|
+
});
|
|
199
|
+
const combinator_ = choice(map(literal(">"), () => ">"), map(literal("+"), () => "+"), map(literal("~"), () => "~"), ab(literal("|"), literal("|"), () => "||"));
|
|
200
|
+
const combinatorSeparator_ = otherwise(optionallySpaced(combinator_), map(whitespace_, () => " "));
|
|
201
|
+
const complexSelector_ = leftAssoc2(compoundSelector_, map(combinatorSeparator_, (c) => (left, right) => ({
|
|
202
|
+
type: "compound",
|
|
203
|
+
list: [...right.list, {
|
|
204
|
+
type: "combinator",
|
|
205
|
+
combinator: c,
|
|
206
|
+
left,
|
|
207
|
+
specificity: left.specificity
|
|
208
|
+
}],
|
|
209
|
+
specificity: sumSpec(left.specificity, right.specificity)
|
|
210
|
+
})), compoundSelector_);
|
|
211
|
+
leftAssoc2(map(complexSelector_, (s) => ({
|
|
212
|
+
type: "list",
|
|
213
|
+
list: [s]
|
|
214
|
+
})), map(optionallySpaced(literal(",")), () => (acc, next) => ({
|
|
215
|
+
type: "list",
|
|
216
|
+
list: [...acc.list, next]
|
|
217
|
+
})), complexSelector_);
|
|
218
|
+
function parse_(parser, str) {
|
|
219
|
+
if (!(typeof str === "string" || str instanceof String)) throw new Error("Expected a selector string. Actual input is not a string!");
|
|
220
|
+
const lexerResult = lexSelector(str);
|
|
221
|
+
if (!lexerResult.complete) throw new Error(`The input "${str}" was only partially tokenized, stopped at offset ${lexerResult.offset}!\n` + prettyPrintPosition(str, lexerResult.offset));
|
|
222
|
+
const result = optionallySpaced(parser)({
|
|
223
|
+
tokens: lexerResult.tokens,
|
|
224
|
+
options: void 0
|
|
225
|
+
}, 0);
|
|
226
|
+
if (!result.matched) throw new Error(`No match for "${str}" input!`);
|
|
227
|
+
if (result.position < lexerResult.tokens.length) {
|
|
228
|
+
const token = lexerResult.tokens[result.position];
|
|
229
|
+
throw new Error(`The input "${str}" was only partially parsed, stopped at offset ${token.offset}!\n` + prettyPrintPosition(str, token.offset, token.len));
|
|
230
|
+
}
|
|
231
|
+
return result.value;
|
|
232
|
+
}
|
|
233
|
+
function prettyPrintPosition(str, offset, len = 1) {
|
|
234
|
+
return `${str.replace(/(\t)|(\r)|(\n)/g, (m, t, r) => t ? "␉" : r ? "␍" : "␊")}\n${"".padEnd(offset)}${"^".repeat(len)}`;
|
|
235
|
+
}
|
|
236
|
+
function parse1(str) {
|
|
237
|
+
return parse_(complexSelector_, str);
|
|
238
|
+
}
|
|
239
|
+
function serialize(selector) {
|
|
240
|
+
if (!selector.type) throw new Error("This is not an AST node.");
|
|
241
|
+
switch (selector.type) {
|
|
242
|
+
case "universal": return _serNs(selector.namespace) + "*";
|
|
243
|
+
case "tag": return _serNs(selector.namespace) + _serIdent(selector.name);
|
|
244
|
+
case "class": return "." + _serIdent(selector.name);
|
|
245
|
+
case "id": return "#" + _serIdent(selector.name);
|
|
246
|
+
case "attrPresence": return `[${_serNs(selector.namespace)}${_serIdent(selector.name)}]`;
|
|
247
|
+
case "attrValue": return `[${_serNs(selector.namespace)}${_serIdent(selector.name)}${selector.matcher}"${_serStr(selector.value)}"${selector.modifier ? selector.modifier : ""}]`;
|
|
248
|
+
case "combinator": return serialize(selector.left) + selector.combinator;
|
|
249
|
+
case "compound": return selector.list.reduce((acc, node) => {
|
|
250
|
+
if (node.type === "combinator") return serialize(node) + acc;
|
|
251
|
+
else return acc + serialize(node);
|
|
252
|
+
}, "");
|
|
253
|
+
case "list": return selector.list.map(serialize).join(",");
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
function _serNs(ns) {
|
|
257
|
+
return ns || ns === "" ? _serIdent(ns) + "|" : "";
|
|
258
|
+
}
|
|
259
|
+
function _codePoint(char) {
|
|
260
|
+
return `\\${char.codePointAt(0).toString(16)} `;
|
|
261
|
+
}
|
|
262
|
+
function _serIdent(str) {
|
|
263
|
+
return str.replace(/(^[0-9])|(^-[0-9])|(^-$)|([-0-9a-zA-Z_]|[^\x00-\x7F])|(\x00)|([\x01-\x1f]|\x7f)|([\s\S])/g, (m, d1, d2, hy, safe, nl, ctrl, other) => d1 ? _codePoint(d1) : d2 ? "-" + _codePoint(d2.slice(1)) : hy ? "\\-" : safe ? safe : nl ? "�" : ctrl ? _codePoint(ctrl) : "\\" + other);
|
|
264
|
+
}
|
|
265
|
+
function _serStr(str) {
|
|
266
|
+
return str.replace(/(")|(\\)|(\x00)|([\x01-\x1f]|\x7f)/g, (m, dq, bs, nl, ctrl) => dq ? "\\\"" : bs ? "\\\\" : nl ? "�" : _codePoint(ctrl));
|
|
267
|
+
}
|
|
268
|
+
function normalize(selector) {
|
|
269
|
+
if (!selector.type) throw new Error("This is not an AST node.");
|
|
270
|
+
switch (selector.type) {
|
|
271
|
+
case "compound":
|
|
272
|
+
selector.list.forEach(normalize);
|
|
273
|
+
selector.list.sort((a, b) => _compareArrays(_getSelectorPriority(a), _getSelectorPriority(b)));
|
|
274
|
+
break;
|
|
275
|
+
case "combinator":
|
|
276
|
+
normalize(selector.left);
|
|
277
|
+
break;
|
|
278
|
+
case "list":
|
|
279
|
+
selector.list.forEach(normalize);
|
|
280
|
+
selector.list.sort((a, b) => serialize(a) < serialize(b) ? -1 : 1);
|
|
281
|
+
}
|
|
282
|
+
return selector;
|
|
283
|
+
}
|
|
284
|
+
function _getSelectorPriority(selector) {
|
|
285
|
+
switch (selector.type) {
|
|
286
|
+
case "universal": return [1];
|
|
287
|
+
case "tag": return [1];
|
|
288
|
+
case "id": return [2];
|
|
289
|
+
case "class": return [3, selector.name];
|
|
290
|
+
case "attrPresence": return [4, serialize(selector)];
|
|
291
|
+
case "attrValue": return [5, serialize(selector)];
|
|
292
|
+
case "combinator": return [15, serialize(selector)];
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
function compareSpecificity(a, b) {
|
|
296
|
+
return _compareArrays(a, b);
|
|
297
|
+
}
|
|
298
|
+
function _compareArrays(a, b) {
|
|
299
|
+
if (!Array.isArray(a) || !Array.isArray(b)) throw new Error("Arguments must be arrays.");
|
|
300
|
+
const shorter = a.length < b.length ? a.length : b.length;
|
|
301
|
+
for (let i = 0; i < shorter; i++) {
|
|
302
|
+
if (a[i] === b[i]) continue;
|
|
303
|
+
return a[i] < b[i] ? -1 : 1;
|
|
304
|
+
}
|
|
305
|
+
return a.length - b.length;
|
|
306
|
+
}
|
|
307
|
+
//#endregion
|
|
308
|
+
export { compareSpecificity, normalize, parse1, serialize };
|
|
309
|
+
|
|
310
|
+
//# sourceMappingURL=parseley.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseley.js","names":["createLexer","p.token","p.map","p.many","p.or","p.option","p.middle","p.left","p.eitherOr","p.ab","p.right","p.choice","p.abc","p.flatten","p.many1","p.leftAssoc2"],"sources":["../../../../../../node_modules/parseley/lib/parseley.mjs"],"sourcesContent":["import { createLexer } from 'leac';\nimport * as p from 'peberminta';\n\nvar ast = /*#__PURE__*/Object.freeze({\n __proto__: null\n});\n\nconst ws = `(?:[ \\\\t\\\\r\\\\n\\\\f]*)`;\nconst nl = `(?:\\\\n|\\\\r\\\\n|\\\\r|\\\\f)`;\nconst nonascii = `[^\\\\x00-\\\\x7F]`;\nconst unicode = `(?:\\\\\\\\[0-9a-f]{1,6}(?:\\\\r\\\\n|[ \\\\n\\\\r\\\\t\\\\f])?)`;\nconst escape = `(?:\\\\\\\\[^\\\\n\\\\r\\\\f0-9a-f])`;\nconst nmstart = `(?:[_a-z]|${nonascii}|${unicode}|${escape})`;\nconst nmchar = `(?:[_a-z0-9-]|${nonascii}|${unicode}|${escape})`;\nconst name = `(?:${nmchar}+)`;\nconst ident = `(?:[-]?${nmstart}${nmchar}*)`;\nconst string1 = `'([^\\\\n\\\\r\\\\f\\\\\\\\']|\\\\\\\\${nl}|${nonascii}|${unicode}|${escape})*'`;\nconst string2 = `\"([^\\\\n\\\\r\\\\f\\\\\\\\\"]|\\\\\\\\${nl}|${nonascii}|${unicode}|${escape})*\"`;\nconst lexSelector = createLexer([\n { name: 'ws', regex: new RegExp(ws) },\n { name: 'hash', regex: new RegExp(`#${name}`, 'i') },\n { name: 'ident', regex: new RegExp(ident, 'i') },\n { name: 'str1', regex: new RegExp(string1, 'i') },\n { name: 'str2', regex: new RegExp(string2, 'i') },\n { name: '*' },\n { name: '.' },\n { name: ',' },\n { name: '[' },\n { name: ']' },\n { name: '=' },\n { name: '>' },\n { name: '|' },\n { name: '+' },\n { name: '~' },\n { name: '^' },\n { name: '$' },\n]);\nconst lexEscapedString = createLexer([\n { name: 'unicode', regex: new RegExp(unicode, 'i') },\n { name: 'escape', regex: new RegExp(escape, 'i') },\n { name: 'any', regex: new RegExp('[\\\\s\\\\S]', 'i') }\n]);\nfunction sumSpec([a0, a1, a2], [b0, b1, b2]) {\n return [a0 + b0, a1 + b1, a2 + b2];\n}\nfunction sumAllSpec(ss) {\n return ss.reduce(sumSpec, [0, 0, 0]);\n}\nconst unicodeEscapedSequence_ = p.token((t) => t.name === 'unicode' ? String.fromCodePoint(parseInt(t.text.slice(1), 16)) : undefined);\nconst escapedSequence_ = p.token((t) => t.name === 'escape' ? t.text.slice(1) : undefined);\nconst anyChar_ = p.token((t) => t.name === 'any' ? t.text : undefined);\nconst escapedString_ = p.map(p.many(p.or(unicodeEscapedSequence_, escapedSequence_, anyChar_)), (cs) => cs.join(''));\nfunction unescape(escapedString) {\n const lexerResult = lexEscapedString(escapedString);\n const result = escapedString_({ tokens: lexerResult.tokens, options: undefined }, 0);\n return result.value;\n}\nfunction literal(name) {\n return p.token((t) => t.name === name ? true : undefined);\n}\nconst whitespace_ = p.token((t) => t.name === 'ws' ? null : undefined);\nconst optionalWhitespace_ = p.option(whitespace_, null);\nfunction optionallySpaced(parser) {\n return p.middle(optionalWhitespace_, parser, optionalWhitespace_);\n}\nconst identifier_ = p.token((t) => t.name === 'ident' ? unescape(t.text) : undefined);\nconst hashId_ = p.token((t) => t.name === 'hash' ? unescape(t.text.slice(1)) : undefined);\nconst string_ = p.token((t) => t.name.startsWith('str') ? unescape(t.text.slice(1, -1)) : undefined);\nconst namespace_ = p.left(p.option(identifier_, ''), literal('|'));\nconst qualifiedName_ = p.eitherOr(p.ab(namespace_, identifier_, (ns, name) => ({ name: name, namespace: ns })), p.map(identifier_, (name) => ({ name: name, namespace: null })));\nconst uniSelector_ = p.eitherOr(p.ab(namespace_, literal('*'), (ns) => ({ type: 'universal', namespace: ns, specificity: [0, 0, 0] })), p.map(literal('*'), () => ({ type: 'universal', namespace: null, specificity: [0, 0, 0] })));\nconst tagSelector_ = p.map(qualifiedName_, ({ name, namespace }) => ({\n type: 'tag',\n name: name,\n namespace: namespace,\n specificity: [0, 0, 1]\n}));\nconst classSelector_ = p.ab(literal('.'), identifier_, (fullstop, name) => ({\n type: 'class',\n name: name,\n specificity: [0, 1, 0]\n}));\nconst idSelector_ = p.map(hashId_, (name) => ({\n type: 'id',\n name: name,\n specificity: [1, 0, 0]\n}));\nconst attrModifier_ = p.token((t) => {\n if (t.name === 'ident') {\n if (t.text === 'i' || t.text === 'I') {\n return 'i';\n }\n if (t.text === 's' || t.text === 'S') {\n return 's';\n }\n }\n return undefined;\n});\nconst attrValue_ = p.eitherOr(p.ab(string_, p.option(p.right(optionalWhitespace_, attrModifier_), null), (v, mod) => ({ value: v, modifier: mod })), p.ab(identifier_, p.option(p.right(whitespace_, attrModifier_), null), (v, mod) => ({ value: v, modifier: mod })));\nconst attrMatcher_ = p.choice(p.map(literal('='), () => '='), p.ab(literal('~'), literal('='), () => '~='), p.ab(literal('|'), literal('='), () => '|='), p.ab(literal('^'), literal('='), () => '^='), p.ab(literal('$'), literal('='), () => '$='), p.ab(literal('*'), literal('='), () => '*='));\nconst attrPresenceSelector_ = p.abc(literal('['), optionallySpaced(qualifiedName_), literal(']'), (lbr, { name, namespace }) => ({\n type: 'attrPresence',\n name: name,\n namespace: namespace,\n specificity: [0, 1, 0]\n}));\nconst attrValueSelector_ = p.middle(literal('['), p.abc(optionallySpaced(qualifiedName_), attrMatcher_, optionallySpaced(attrValue_), ({ name, namespace }, matcher, { value, modifier }) => ({\n type: 'attrValue',\n name: name,\n namespace: namespace,\n matcher: matcher,\n value: value,\n modifier: modifier,\n specificity: [0, 1, 0]\n})), literal(']'));\nconst attrSelector_ = p.eitherOr(attrPresenceSelector_, attrValueSelector_);\nconst typeSelector_ = p.eitherOr(uniSelector_, tagSelector_);\nconst subclassSelector_ = p.choice(idSelector_, classSelector_, attrSelector_);\nconst compoundSelector_ = p.map(p.eitherOr(p.flatten(typeSelector_, p.many(subclassSelector_)), p.many1(subclassSelector_)), (ss) => {\n return {\n type: 'compound',\n list: ss,\n specificity: sumAllSpec(ss.map(s => s.specificity))\n };\n});\nconst combinator_ = p.choice(p.map(literal('>'), () => '>'), p.map(literal('+'), () => '+'), p.map(literal('~'), () => '~'), p.ab(literal('|'), literal('|'), () => '||'));\nconst combinatorSeparator_ = p.eitherOr(optionallySpaced(combinator_), p.map(whitespace_, () => ' '));\nconst complexSelector_ = p.leftAssoc2(compoundSelector_, p.map(combinatorSeparator_, (c) => (left, right) => ({\n type: 'compound',\n list: [...right.list, { type: 'combinator', combinator: c, left: left, specificity: left.specificity }],\n specificity: sumSpec(left.specificity, right.specificity)\n})), compoundSelector_);\nconst listSelector_ = p.leftAssoc2(p.map(complexSelector_, (s) => ({ type: 'list', list: [s] })), p.map(optionallySpaced(literal(',')), () => (acc, next) => ({ type: 'list', list: [...acc.list, next] })), complexSelector_);\nfunction parse_(parser, str) {\n if (!(typeof str === 'string' || str instanceof String)) {\n throw new Error('Expected a selector string. Actual input is not a string!');\n }\n const lexerResult = lexSelector(str);\n if (!lexerResult.complete) {\n throw new Error(`The input \"${str}\" was only partially tokenized, stopped at offset ${lexerResult.offset}!\\n` +\n prettyPrintPosition(str, lexerResult.offset));\n }\n const result = optionallySpaced(parser)({ tokens: lexerResult.tokens, options: undefined }, 0);\n if (!result.matched) {\n throw new Error(`No match for \"${str}\" input!`);\n }\n if (result.position < lexerResult.tokens.length) {\n const token = lexerResult.tokens[result.position];\n throw new Error(`The input \"${str}\" was only partially parsed, stopped at offset ${token.offset}!\\n` +\n prettyPrintPosition(str, token.offset, token.len));\n }\n return result.value;\n}\nfunction prettyPrintPosition(str, offset, len = 1) {\n return `${str.replace(/(\\t)|(\\r)|(\\n)/g, (m, t, r) => t ? '\\u2409' : r ? '\\u240d' : '\\u240a')}\\n${''.padEnd(offset)}${'^'.repeat(len)}`;\n}\nfunction parse(str) {\n return parse_(listSelector_, str);\n}\nfunction parse1(str) {\n return parse_(complexSelector_, str);\n}\n\nfunction serialize(selector) {\n if (!selector.type) {\n throw new Error('This is not an AST node.');\n }\n switch (selector.type) {\n case 'universal':\n return _serNs(selector.namespace) + '*';\n case 'tag':\n return _serNs(selector.namespace) + _serIdent(selector.name);\n case 'class':\n return '.' + _serIdent(selector.name);\n case 'id':\n return '#' + _serIdent(selector.name);\n case 'attrPresence':\n return `[${_serNs(selector.namespace)}${_serIdent(selector.name)}]`;\n case 'attrValue':\n return `[${_serNs(selector.namespace)}${_serIdent(selector.name)}${selector.matcher}\"${_serStr(selector.value)}\"${(selector.modifier ? selector.modifier : '')}]`;\n case 'combinator':\n return serialize(selector.left) + selector.combinator;\n case 'compound':\n return selector.list.reduce((acc, node) => {\n if (node.type === 'combinator') {\n return serialize(node) + acc;\n }\n else {\n return acc + serialize(node);\n }\n }, '');\n case 'list':\n return selector.list.map(serialize).join(',');\n }\n}\nfunction _serNs(ns) {\n return (ns || ns === '')\n ? _serIdent(ns) + '|'\n : '';\n}\nfunction _codePoint(char) {\n return `\\\\${char.codePointAt(0).toString(16)} `;\n}\nfunction _serIdent(str) {\n return str.replace(\n /(^[0-9])|(^-[0-9])|(^-$)|([-0-9a-zA-Z_]|[^\\x00-\\x7F])|(\\x00)|([\\x01-\\x1f]|\\x7f)|([\\s\\S])/g, (m, d1, d2, hy, safe, nl, ctrl, other) => d1 ? _codePoint(d1) :\n d2 ? '-' + _codePoint(d2.slice(1)) :\n hy ? '\\\\-' :\n safe ? safe :\n nl ? '\\ufffd' :\n ctrl ? _codePoint(ctrl) :\n '\\\\' + other);\n}\nfunction _serStr(str) {\n return str.replace(\n /(\")|(\\\\)|(\\x00)|([\\x01-\\x1f]|\\x7f)/g, (m, dq, bs, nl, ctrl) => dq ? '\\\\\"' :\n bs ? '\\\\\\\\' :\n nl ? '\\ufffd' :\n _codePoint(ctrl));\n}\nfunction normalize(selector) {\n if (!selector.type) {\n throw new Error('This is not an AST node.');\n }\n switch (selector.type) {\n case 'compound': {\n selector.list.forEach(normalize);\n selector.list.sort((a, b) => _compareArrays(_getSelectorPriority(a), _getSelectorPriority(b)));\n break;\n }\n case 'combinator': {\n normalize(selector.left);\n break;\n }\n case 'list': {\n selector.list.forEach(normalize);\n selector.list.sort((a, b) => (serialize(a) < serialize(b)) ? -1 : 1);\n break;\n }\n }\n return selector;\n}\nfunction _getSelectorPriority(selector) {\n switch (selector.type) {\n case 'universal':\n return [1];\n case 'tag':\n return [1];\n case 'id':\n return [2];\n case 'class':\n return [3, selector.name];\n case 'attrPresence':\n return [4, serialize(selector)];\n case 'attrValue':\n return [5, serialize(selector)];\n case 'combinator':\n return [15, serialize(selector)];\n }\n}\nfunction compareSelectors(a, b) {\n return _compareArrays(a.specificity, b.specificity);\n}\nfunction compareSpecificity(a, b) {\n return _compareArrays(a, b);\n}\nfunction _compareArrays(a, b) {\n if (!Array.isArray(a) || !Array.isArray(b)) {\n throw new Error('Arguments must be arrays.');\n }\n const shorter = (a.length < b.length) ? a.length : b.length;\n for (let i = 0; i < shorter; i++) {\n if (a[i] === b[i]) {\n continue;\n }\n return (a[i] < b[i]) ? -1 : 1;\n }\n return a.length - b.length;\n}\n\nexport { ast as Ast, compareSelectors, compareSpecificity, normalize, parse, parse1, serialize };\n"],"x_google_ignoreList":[0],"mappings":";;;AAOA,MAAM,KAAK;AACX,MAAM,KAAK;AACX,MAAM,WAAW;AACjB,MAAM,UAAU;AAChB,MAAM,SAAS;AACf,MAAM,UAAU,aAAa,SAAS,GAAG,QAAQ,GAAG,OAAO;AAC3D,MAAM,SAAS,iBAAiB,SAAS,GAAG,QAAQ,GAAG,OAAO;AAC9D,MAAM,OAAO,MAAM,OAAO;AAC1B,MAAM,QAAQ,UAAU,UAAU,OAAO;AACzC,MAAM,UAAU,2BAA2B,GAAG,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO;AAC/E,MAAM,UAAU,2BAA2B,GAAG,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO;AAC/E,MAAM,cAAcA,EAAY;CAC5B;EAAE,MAAM;EAAM,OAAO,IAAI,OAAO,EAAE;CAAE;CACpC;EAAE,MAAM;EAAQ,OAAO,IAAI,OAAO,IAAI,QAAQ,GAAG;CAAE;CACnD;EAAE,MAAM;EAAS,OAAO,IAAI,OAAO,OAAO,GAAG;CAAE;CAC/C;EAAE,MAAM;EAAQ,OAAO,IAAI,OAAO,SAAS,GAAG;CAAE;CAChD;EAAE,MAAM;EAAQ,OAAO,IAAI,OAAO,SAAS,GAAG;CAAE;CAChD,EAAE,MAAM,IAAI;CACZ,EAAE,MAAM,IAAI;CACZ,EAAE,MAAM,IAAI;CACZ,EAAE,MAAM,IAAI;CACZ,EAAE,MAAM,IAAI;CACZ,EAAE,MAAM,IAAI;CACZ,EAAE,MAAM,IAAI;CACZ,EAAE,MAAM,IAAI;CACZ,EAAE,MAAM,IAAI;CACZ,EAAE,MAAM,IAA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