diff --git a/CONTRIBUTORS.svg b/CONTRIBUTORS.svg index e9bdca6b..d507e4b4 100644 --- a/CONTRIBUTORS.svg +++ b/CONTRIBUTORS.svg @@ -30,77 +30,79 @@ - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + \ No newline at end of file diff --git a/asset-manifest.json b/asset-manifest.json index e5bd1170..492ce9c5 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,13 +1,13 @@ { "files": { "main.css": "/hotkeys-js/static/css/main.ff7ef0b5.css", - "main.js": "/hotkeys-js/static/js/main.32125283.js", + "main.js": "/hotkeys-js/static/js/main.4c74d204.js", "refractor-vendor.js": "/hotkeys-js/static/js/refractor-vendor.f1950cb6.js", "react-vendor.js": "/hotkeys-js/static/js/react-vendor.9808e2f4.js", "static/media/bg.jpg": "/hotkeys-js/static/media/bg.c118c911b775de37ecf2.jpg", "index.html": "/hotkeys-js/index.html", "main.ff7ef0b5.css.map": "/hotkeys-js/static/css/main.ff7ef0b5.css.map", - "main.32125283.js.map": "/hotkeys-js/static/js/main.32125283.js.map", + "main.4c74d204.js.map": "/hotkeys-js/static/js/main.4c74d204.js.map", "refractor-vendor.f1950cb6.js.map": "/hotkeys-js/static/js/refractor-vendor.f1950cb6.js.map", "react-vendor.9808e2f4.js.map": "/hotkeys-js/static/js/react-vendor.9808e2f4.js.map" }, @@ -15,6 +15,6 @@ "static/js/refractor-vendor.f1950cb6.js", "static/js/react-vendor.9808e2f4.js", "static/css/main.ff7ef0b5.css", - "static/js/main.32125283.js" + "static/js/main.4c74d204.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index 6909a666..39303cd7 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -hotkeys.js - A robust Javascript library for capturing keyboard input.
\ No newline at end of file +hotkeys.js - A robust Javascript library for capturing keyboard input.
\ No newline at end of file diff --git a/static/js/main.32125283.js.map b/static/js/main.32125283.js.map deleted file mode 100644 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AE/zC,OAAQ,QAASpW,KAAM,QAAS0hC,UAAWmgB,GAAGsI,UAGvDwd,GAA+B,IAAI79D,IAAI,CAChD,WACA,cACA,eACA,eACA,gBACA,mBACA,WACA,UACA,gBACA,sBACA,cACA,mBACA,oBACA,oBACA,iBACA,UACA,UACA,UACA,UACA,UACA,iBACA,UACA,UACA,cACA,eACA,WACA,eACA,qBACA,cACA,SACA,eACA,gBACA,WACA,iBACA,iBACA,YACFpH,KAAK2nD,GAAO,CAACA,EAAG59C,cAAe49C,MAE3Bud,GAAwB,IAAI19D,IAAI,CAClCwoB,GAAEgwB,EACFhwB,GAAEowB,IACFpwB,GAAEqwB,WACFrwB,GAAEswB,KACFtwB,GAAEuwB,GACFvwB,GAAE0wB,OACF1wB,GAAE2wB,KACF3wB,GAAE8wB,GACF9wB,GAAEmxB,IACFnxB,GAAEoxB,GACFpxB,GAAEqxB,GACFrxB,GAAEsxB,GACFtxB,GAAEuxB,MACFvxB,GAAEiyB,GACFjyB,GAAEkyB,GACFlyB,GAAEmyB,GACFnyB,GAAEoyB,GACFpyB,GAAEqyB,GACFryB,GAAEsyB,GACFtyB,GAAEuyB,KACFvyB,GAAE0yB,GACF1yB,GAAE4yB,EACF5yB,GAAE6yB,IACF7yB,GAAEmzB,GACFnzB,GAAEqzB,QACFrzB,GAAE0zB,KACF1zB,GAAE2zB,KACF3zB,GAAEm0B,KACFn0B,GAAEw0B,GACFx0B,GAAE20B,EACF30B,GAAE80B,IACF90B,GAAEm1B,KACFn1B,GAAEo1B,EACFp1B,GAAEy1B,MACFz1B,GAAE01B,KACF11B,GAAE41B,OACF51B,GAAE21B,OACF31B,GAAE81B,IACF91B,GAAEg2B,IACFh2B,GAAEi2B,MACFj2B,GAAE42B,GACF52B,GAAE62B,EACF72B,GAAE82B,GACF92B,GAAEg3B,MAUC,SAASme,GAAuB50D,GACnC,IAAK,IAAInV,EAAI,EAAGA,EAAImV,EAAM0lC,MAAM36C,OAAQF,IACpC,GAAImV,EAAM0lC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,IAAK,MACX,CACDgwF,QAAS,GACThwF,KAAM,CAAC,IAAK,MACX,CACDgwF,QAAS,IACThwF,KAAM,CAAC,SAAK,MACX,CACDgwF,QAAS,IACThwF,KAAM,CAAC,SAAK,OACX,CACDgwF,QAAS,EACThwF,KAAM,CAAC,WACN,CACDgwF,QAAS,EACThwF,KAAM,CAAC,QACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,IACThwF,KAAM,CAAC,IAAK,MACX,CACDgwF,QAAS,IACThwF,KAAM,CAAC,IAAK,MACX,CACDgwF,QAAS,IACThwF,KAAM,CAAC,IAAK,OACX,CACDgwF,QAAS,GACThwF,KAAM,CAAC,GAAI,aACV,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,IACThwF,KAAM,CAAC,IAAK,MACX,CACDgwF,QAAS,IACThwF,KAAM,CAAC,IAAK,MACX,CACDgwF,QAAS,GACThwF,KAAM,CAAC,QAAS,WACf,CACDgwF,QAAS,GACThwF,KAAM,CAAC,WACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MACN,CACDgwF,QAAS,IACThwF,KAAM,CAAC,IAAK,MACX,CACDgwF,QAAS,IACThwF,KAAM,CAAC,IAAK,MACX,CACDgwF,QAAS,IACThwF,KAAM,CAAC,IAAK,MACX,CACDgwF,QAAS,GACThwF,KAAM,CAAC,WACN,CACDgwF,SAAU,EACVhwF,KAAM,CAAC,OACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,YACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MAAO,WACb,CACDgwF,QAAS,GACThwF,KAAM,CAAC,YACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,KACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,YACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,MAAO,WACb,CACDgwF,QAAS,GACThwF,KAAM,CAAC,WACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,WACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,WACN,CACDgwF,QAAS,GACThwF,KAAM,CAAC,YAEM,SAASiwF,GAAY38D,GAClC,IAAI,UACAsoD,EAAY,iBAAgB,UAC5BjkD,EAAS,MACTl3B,EAAK,QACLyvF,EAAU,GACVC,YAAaC,EACbC,UAAWC,GACTh9D,EACJlyB,EAAQ5C,EAA8B80B,EAAMpyB,IAC9C,OAAoBe,EAAAA,EAAAA,KAAK,MAAO,CAC9B01B,WAAYikD,GAAa,IAAM,KAAOjkD,GAAa,IACnDl3B,MAAOA,EACPgC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MoD,MAA8B,kBAAfpD,EAAMoD,KAClD,OAAO,EAGT,GAAI,aAAcpD,GAAS6K,MAAMC,QAAQ9K,EAAMwC,UAC7C,OAAO,EAGT,GAAa,WAATzC,EACF,OAAOy2C,EAAY1pC,IAAI9M,EAAMoD,KAAKoJ,eAGpC,QAAS,UAAWxM,EACtB,CA5Dcg3C,CAAapqC,EAAY/E,EAAK0E,SAAU,CAE1C,IAAItO,EAEJ,IAAKA,KAAO2O,EACNjD,EAAIvL,KAAKwO,EAAY3O,IAEvBg5C,EAAYlrC,EAAQlE,EAAK+E,WAAY3O,EAAK2O,EAAW3O,GAG3D,MACEuE,EAASwP,QAAQpF,GAKrB,OAASzE,EAAQ3F,EAASzE,QACxBm5C,EAASrvC,EAAKrF,SAAUA,EAAS2F,IAQnC,MALkB,YAAdN,EAAKzE,MAAuC,aAAjByE,EAAK0E,UAClC1E,EAAKjI,QAAU,CAACwD,KAAM,OAAQZ,SAAUqF,EAAKrF,UAC7CqF,EAAKrF,SAAW,IAGXqF,CACT,CAIN,CCtGiBm7F,CAAK/2F,EAAAA,GAAM,qDCZrB,MAAMg3F,EAA0B,CACrC,QACA,MACA,SACA,QACA,SACA,QACA,SACA,OACA,OACA,SACA,MACA,SACA,QACA,SACA,OACA,KACA,SACA,QACA,SACA,OACA,KACA,SACA,SACA,QACA,SACA,SACA,SACA,OACA,OACA,MACA,QACA,SACA,QACA,SACA,OACA,SACA,SACA,QACA,QACA,QACA,SACA,MACA,QACA,SACA,OACA,SACA,SACA,QACA,OACA,OACA,SACA,MACA,SACA,SACA,QACA,SACA,MACA,OACA,SACA,SACA,SACA,KACA,SACA,QACA,QACA,SACA,SACA,OACA,QACA,KACA,OACA,QACA,SACA,OACA,MACA,SACA,SACA,QACA,SACA,OACA,OACA,SACA,SACA,OACA,OACA,SACA,QACA,OACA,QACA,MACA,OACA,MACA,OACA,OACA,OACA,QACA,QACA,QACA,SACA,QACA,SACA,MACA,OACA,SACA,MACA,QC1GWC,EAA4B,C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Ow9G,EAAoB,QACjGkB,EAAsBlB,EAAoBrnC,EAAEuoC","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@uiw/github-corners/src/index.ts","../node_modules/@uiw/react-github-corners/esm/index.js","../node_modules/@uiw/react-shields/esm/common/Container.js","../node_modules/@uiw/react-shields/esm/common/Base.js","../node_modules/@uiw/react-shields/esm/github/Issues.js","../node_modules/@uiw/react-shields/esm/github/Size.js","../node_modules/@uiw/react-shields/esm/github/License.js","../node_modules/@uiw/react-shields/esm/github/Downloads.js","../node_modules/@uiw/react-shields/esm/github/Activity.js","../node_modules/@uiw/react-shields/esm/github/Version.js","../node_modules/@uiw/react-shields/esm/github/Analysis.js","../node_modules/@uiw/react-shields/esm/github/Social.js","../node_modules/@uiw/react-shields/esm/github/index.js","../node_modules/@uiw/react-shields/esm/coverages/Coverages.js","../node_modules/@uiw/react-shields/esm/coverages/Codacy.js","../node_modules/@uiw/react-shields/esm/coverages/index.js","../node_modules/@uiw/react-shields/esm/npm/Version.js","../node_modules/@uiw/react-shields/esm/npm/Size.js","../node_modules/@uiw/react-shields/esm/npm/Downloads.js","../node_modules/@uiw/react-shields/esm/npm/index.js","../node_modules/estree-util-is-identifier-name/lib/index.js","../node_modules/hast-util-whitespace/lib/index.js","../node_modules/property-information/lib/hast-to-react.js","../node_modules/style-to-object/esm/index.mjs","../node_modules/unist-util-position/lib/index.js","../node_modules/unist-util-stringify-position/lib/index.js","../node_modules/vfile-message/lib/index.js","../node_modules/hast-util-to-jsx-runtime/lib/index.js","../node_modules/html-url-attributes/lib/index.js","../node_modules/mdast-util-to-string/lib/index.js","../node_modules/micromark-util-chunked/index.js","../node_modules/micromark-util-subtokenize/index.js","../node_modules/micromark-util-combine-extensions/index.js","../node_modules/micromark-util-character/index.js","../node_modules/micromark-factory-space/index.js","../node_modules/micromark/lib/initialize/content.js","../node_modules/micromark/lib/initialize/document.js","../node_modules/micromark-core-commonmark/lib/blank-line.js","../node_modules/micromark-core-commonmark/lib/content.js","../node_modules/micromark/lib/initialize/flow.js","../node_modules/micromark/lib/initialize/text.js","../node_modules/micromark-util-resolve-all/index.js","../node_modules/micromark/lib/create-tokenizer.js","../node_modules/micromark-core-commonmark/lib/thematic-break.js","../node_modules/micromark-core-commonmark/lib/list.js","../node_modules/micromark-core-commonmark/lib/block-quote.js","../node_modules/micromark-factory-destination/index.js","../node_modules/micromark-factory-label/index.js","../node_modules/micromark-factory-title/index.js","../node_modules/micromark-factory-whitespace/index.js","../node_modules/micromark-util-normalize-identifier/index.js","../node_modules/micromark-core-commonmark/lib/definition.js","../node_modules/micromark-core-commonmark/lib/code-indented.js","../node_modules/micromark-core-commonmark/lib/heading-atx.js","../node_modules/micromark-core-commonmark/lib/setext-underline.js","../node_modules/micromark-util-html-tag-name/index.js","../node_modules/micromark-core-commonmark/lib/html-flow.js","../node_modules/micromark-core-commonmark/lib/code-fenced.js","../node_modules/micromark-core-commonmark/lib/character-reference.js","../node_modules/micromark-core-commonmark/lib/character-escape.js","../node_modules/micromark-core-commonmark/lib/line-ending.js","../node_modules/micromark-core-commonmark/lib/label-end.js","../node_modules/micromark-core-commonmark/lib/label-start-image.js","../node_modules/micromark-util-classify-character/index.js","../node_modules/micromark-core-commonmark/lib/attention.js","../node_modules/micromark-core-commonmark/lib/autolink.js","../node_modules/micromark-core-commonmark/lib/html-text.js","../node_modules/micromark-core-commonmark/lib/label-start-link.js","../node_modules/micromark-core-commonmark/lib/hard-break-escape.js","../node_modules/micromark-core-commonmark/lib/code-text.js","../node_modules/micromark/lib/constructs.js","../node_modules/micromark/lib/preprocess.js","../node_modules/micromark-util-decode-numeric-character-reference/index.js","../node_modules/micromark-util-decode-string/index.js","../node_modules/mdast-util-from-markdown/lib/index.js","../node_modules/micromark/lib/postprocess.js","../node_modules/micromark/lib/parse.js","../node_modules/remark-parse/lib/index.js","../node_modules/@ungap/structured-clone/esm/types.js","../node_modules/@ungap/structured-clone/esm/deserialize.js","../node_modules/@ungap/structured-clone/esm/serialize.js","../node_modules/@ungap/structured-clone/esm/index.js","../node_modules/micromark-util-sanitize-uri/index.js","../node_modules/mdast-util-to-hast/lib/footer.js","../node_modules/unist-util-is/lib/index.js","../node_modules/unist-util-visit-parents/lib/index.js","../node_modules/unist-util-visit/lib/index.js","../node_modules/mdast-util-to-hast/lib/revert.js","../node_modules/mdast-util-to-hast/lib/handlers/list-item.js","../node_modules/trim-lines/index.js","../node_modules/mdast-util-to-hast/lib/handlers/index.js","../node_modules/mdast-util-to-hast/lib/handlers/blockquote.js","../node_modules/mdast-util-to-hast/lib/handlers/break.js","../node_modules/mdast-util-to-hast/lib/handlers/code.js","../node_modules/mdast-util-to-hast/lib/handlers/delete.js","../node_modules/mdast-util-to-hast/lib/handlers/emphasis.js","../node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js","../node_modules/mdast-util-to-hast/lib/handlers/heading.js","../node_modules/mdast-util-to-hast/lib/handlers/html.js","../node_modules/mdast-util-to-hast/lib/handlers/image-reference.js","../node_modules/mdast-util-to-hast/lib/handlers/image.js","../node_modules/mdast-util-to-hast/lib/handlers/inline-code.js","../node_modules/mdast-util-to-hast/lib/handlers/link-reference.js","../node_modules/mdast-util-to-hast/lib/handlers/link.js","../node_modules/mdast-util-to-hast/lib/handlers/list.js","../node_modules/mdast-util-to-hast/lib/handlers/paragraph.js","../node_modules/mdast-util-to-hast/lib/handlers/root.js","../node_modules/mdast-util-to-hast/lib/handlers/strong.js","../node_modules/mdast-util-to-hast/lib/handlers/table.js","../node_modules/mdast-util-to-hast/lib/handlers/table-cell.js","../node_modules/mdast-util-to-hast/lib/handlers/table-row.js","../node_modules/mdast-util-to-hast/lib/handlers/text.js","../node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js","../node_modules/mdast-util-to-hast/lib/state.js","../node_modules/mdast-util-to-hast/lib/index.js","../node_modules/remark-rehype/lib/index.js","../node_modules/bail/index.js","../node_modules/unified/node_modules/is-plain-obj/index.js","../node_modules/trough/index.js","../node_modules/vfile/lib/minpath.browser.js","../node_modules/vfile/lib/minproc.browser.js","../node_modules/vfile/lib/minurl.shared.js","../node_modules/vfile/lib/minurl.browser.js","../node_modules/vfile/lib/index.js","../node_modules/unified/lib/callable-instance.js","../node_modules/unified/lib/index.js","../node_modules/react-markdown/lib/index.js","../node_modules/ccount/index.js","../node_modules/mdast-util-find-and-replace/lib/index.js","../node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js","../node_modules/mdast-util-gfm-autolink-literal/lib/index.js","../node_modules/mdast-util-gfm-footnote/lib/index.js","../node_modules/mdast-util-gfm-strikethrough/lib/index.js","../node_modules/markdown-table/index.js","../node_modules/mdast-util-to-markdown/lib/handle/blockquote.js","../node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js","../node_modules/mdast-util-to-markdown/lib/handle/break.js","../node_modules/mdast-util-to-markdown/lib/handle/code.js","../node_modules/mdast-util-to-markdown/lib/util/check-quote.js","../node_modules/mdast-util-to-markdown/lib/handle/emphasis.js","../node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js","../node_modules/mdast-util-to-markdown/lib/handle/html.js","../node_modules/mdast-util-to-markdown/lib/handle/image.js","../node_modules/mdast-util-to-markdown/lib/handle/image-reference.js","../node_modules/mdast-util-to-markdown/lib/handle/inline-code.js","../node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js","../node_modules/mdast-util-to-markdown/lib/handle/link.js","../node_modules/mdast-util-to-markdown/lib/handle/link-reference.js","../node_modules/mdast-util-to-markdown/lib/util/check-bullet.js","../node_modules/mdast-util-to-markdown/lib/util/check-rule.js","../node_modules/mdast-util-phrasing/lib/index.js","../node_modules/mdast-util-to-markdown/lib/handle/strong.js","../node_modules/mdast-util-to-markdown/lib/util/check-strong.js","../node_modules/mdast-util-to-markdown/lib/handle/index.js","../node_modules/mdast-util-to-markdown/lib/util/check-fence.js","../node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js","../node_modules/longest-streak/index.js","../node_modules/mdast-util-to-markdown/lib/handle/definition.js","../node_modules/mdast-util-to-markdown/lib/handle/heading.js","../node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js","../node_modules/mdast-util-to-markdown/lib/handle/list.js","../node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js","../node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js","../node_modules/mdast-util-to-markdown/lib/handle/list-item.js","../node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js","../node_modules/mdast-util-to-markdown/lib/handle/paragraph.js","../node_modules/mdast-util-to-markdown/lib/handle/root.js","../node_modules/mdast-util-to-markdown/lib/handle/text.js","../node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js","../node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js","../node_modules/mdast-util-gfm-table/lib/index.js","../node_modules/mdast-util-gfm-task-list-item/lib/index.js","../node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js","../node_modules/micromark-extension-gfm-footnote/lib/syntax.js","../node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js","../node_modules/micromark-extension-gfm-table/lib/edit-map.js","../node_modules/micromark-extension-gfm-table/lib/infer.js","../node_modules/micromark-extension-gfm-table/lib/syntax.js","../node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js","../node_modules/remark-gfm/lib/index.js","../node_modules/micromark-extension-gfm/index.js","../node_modules/mdast-util-gfm/lib/index.js","../node_modules/hast-util-raw/node_modules/hast-util-parse-selector/lib/index.js","../node_modules/hast-util-raw/node_modules/hastscript/lib/create-h.js","../node_modules/hast-util-raw/node_modules/hastscript/lib/svg-case-sensitive-tag-names.js","../node_modules/hast-util-raw/node_modules/hastscript/lib/index.js","../node_modules/hast-util-raw/node_modules/vfile-location/lib/index.js","../node_modules/web-namespaces/index.js","../node_modules/hast-util-raw/node_modules/hast-util-from-parse5/lib/index.js","../node_modules/zwitch/index.js","../node_modules/hast-util-to-parse5/lib/index.js","../node_modules/html-void-elements/index.js","../node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.js","../node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.js","../node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.js","../node_modules/hast-util-raw/node_modules/parse5/dist/common/token.js","../https:/raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/generated/decode-data-html.ts","../https:/raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/generated/decode-data-xml.ts","../https:/raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/decode_codepoint.ts","../https:/raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/decode.ts","../node_modules/hast-util-raw/node_modules/parse5/dist/common/html.js","../node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.js","../node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.js","../node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.js","../node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.js","../node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.js","../node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.js","../node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.js","../https:/raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/escape.ts","../node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.js","../node_modules/hast-util-raw/lib/index.js","../node_modules/rehype-raw/lib/index.js","../node_modules/@uiw/react-markdown-preview/esm/plugins/useCopied.js","../node_modules/@uiw/react-markdown-preview/esm/preview.js","../node_modules/rehype-prism-plus/node_modules/unist-util-is/lib/index.js","../node_modules/rehype-prism-plus/node_modules/unist-util-visit-parents/lib/index.js","../node_modules/rehype-prism-plus/node_modules/hast-util-to-string/index.js","../node_modules/unist-util-filter/node_modules/unist-util-is/lib/index.js","../node_modules/unist-util-filter/lib/index.js","../../src/generator.js","../node_modules/rehype-prism-plus/node_modules/unist-util-visit/lib/index.js","../../src/all.js","../../src/common.js","../node_modules/css-selector-parser/dist/mjs/indexes.js","../node_modules/css-selector-parser/dist/mjs/pseudo-signatures.js","../node_modules/css-selector-parser/dist/mjs/syntax-definitions.js","../node_modules/css-selector-parser/dist/mjs/utils.js","../node_modules/css-selector-parser/dist/mjs/parser.js","../node_modules/css-selector-parser/dist/mjs/ast.js","../node_modules/hast-util-select/lib/parse.js","../node_modules/direction/index.js","../node_modules/hast-util-to-string/lib/index.js","../node_modules/hast-util-select/lib/enter-state.js","../node_modules/hast-util-select/lib/attribute.js","../node_modules/hast-util-select/lib/class-name.js","../node_modules/hast-util-select/lib/id.js","../node_modules/hast-util-select/lib/name.js","../node_modules/bcp-47-match/index.js","../node_modules/hast-util-has-property/lib/index.js","../https:/raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/parse.ts","../https:/raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/index.ts","../https:/raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/compile.ts","../node_modules/hast-util-select/lib/pseudo.js","../node_modules/hast-util-select/lib/test.js","../node_modules/hast-util-select/lib/walk.js","../node_modules/hast-util-select/lib/index.js","../node_modules/rehype-rewrite/src/index.ts","../node_modules/rehype-attr/src/utils.ts","../node_modules/rehype-attr/src/index.ts","../node_modules/@uiw/react-markdown-preview/esm/plugins/reservedMeta.js","../node_modules/@uiw/react-markdown-preview/esm/plugins/retrieveMeta.js","../node_modules/github-slugger/regex.js","../node_modules/github-slugger/index.js","../node_modules/hast-util-heading-rank/lib/index.js","../node_modules/rehype-slug/lib/index.js","../node_modules/hast-util-is-element/lib/index.js","../node_modules/rehype-autolink-headings/lib/index.js","../node_modules/rehype-ignore/src/index.ts","../node_modules/@uiw/react-markdown-preview/esm/nodes/octiconLink.js","../node_modules/@uiw/react-markdown-preview/esm/rehypePlugins.js","../node_modules/@uiw/react-markdown-preview/esm/index.js","../node_modules/@uiw/react-markdown-preview/esm/nodes/copy.js","../node_modules/@uiw/react-mac-keyboard/esm/index.js","webpack://hotkeys-js/./website/components/Footer.module.less?cff4","components/Footer.js","webpack://hotkeys-js/./website/styles/index.module.less?2aeb","../README.md","../dist/hotkeys.esm.js","App.js","index.js","../../src/main.js","../node_modules/@wcj/dark-mode/dist/dark-mode.min.js","../node_modules/boolbase/index.js","../node_modules/extend/index.js","../node_modules/inline-style-parser/index.js","../node_modules/parse-numeric-range/index.js","../node_modules/scheduler/cjs/scheduler.production.min.js","../node_modules/scheduler/index.js","../node_modules/style-to-object/src/index.ts","../node_modules/@babel/runtime/helpers/defineProperty.js","../node_modules/@babel/runtime/helpers/toPrimitive.js","../node_modules/@babel/runtime/helpers/toPropertyKey.js","../node_modules/@babel/runtime/helpers/typeof.js","../node_modules/comma-separated-tokens/index.js","../node_modules/decode-named-character-reference/index.dom.js","../node_modules/hast-util-parse-selector/lib/index.js","../node_modules/hastscript/lib/core.js","../node_modules/hastscript/lib/html.js","../node_modules/character-entities-legacy/index.js","../node_modules/character-reference-invalid/index.js","../node_modules/is-decimal/index.js","../node_modules/is-hexadecimal/index.js","../node_modules/is-alphanumerical/index.js","../node_modules/is-alphabetical/index.js","../node_modules/parse-entities/lib/index.js","../node_modules/property-information/lib/util/schema.js","../node_modules/property-information/lib/util/merge.js","../node_modules/property-information/lib/util/create.js","../node_modules/property-information/lib/xlink.js","../node_modules/property-information/lib/xml.js","../node_modules/property-information/lib/util/case-sensitive-transform.js","../node_modules/property-information/lib/util/case-insensitive-transform.js","../node_modules/property-information/lib/xmlns.js","../node_modules/property-information/lib/aria.js","../node_modules/property-information/lib/html.js","../node_modules/property-information/lib/svg.js","../node_modules/property-information/index.js","../node_modules/property-information/lib/find.js","../node_modules/property-information/lib/normalize.js","../node_modules/property-information/lib/util/defined-info.js","../node_modules/property-information/lib/util/info.js","../node_modules/property-information/lib/util/types.js","../node_modules/space-separated-tokens/index.js","../webpack/bootstrap","../webpack/runtime/chunk loaded","../webpack/runtime/compat get default export","../webpack/runtime/define property getters","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/make namespace object","../webpack/runtime/jsonp chunk loading","../webpack/startup"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","// @ts-ignore\ndeclare global {\n interface HTMLElementTagNameMap {\n 'github-corners': GithubCorners;\n }\n namespace JSX {\n interface IntrinsicElements {\n 'github-corners': Partial | {\n style?: Partial | React.CSSProperties;\n };\n }\n }\n}\n\nconst GITHUB_CORNERS_TEMPLATE = document.createElement(\"template\");\nGITHUB_CORNERS_TEMPLATE.innerHTML = `\n\n\n \n \n \n \n \n \n \n\n`;\n\nexport class GithubCorners extends HTMLElement {\n /** Sets the z-order of a positioned element and its descendants or flex items. */\n 'z-index'?: string;\n height?: string | number;\n width?: string | number;\n href?: string;\n color?: string;\n fill?: string;\n position?: string;\n target?: string;\n top?: string;\n left?: string;\n right?: string = '0';\n bottom?: string;\n transform?: string;\n private shadow: ShadowRoot\n static get observedAttributes(): string[] {\n return ['style', 'z-index', 'target', 'height', 'width', 'href', 'color', 'fill', 'position', 'top', 'left', 'right', 'bottom', 'transform'];\n }\n constructor() {\n super();\n this.shadow = this.attachShadow({ mode: 'open' });\n this.shadow.appendChild(this.ownerDocument.importNode(GITHUB_CORNERS_TEMPLATE.content, true));\n this.update()\n }\n private setAttr(name: string, value: string) {\n const svg = this.shadow.querySelector('svg');\n if (/(href)/.test(name.toLocaleLowerCase())) {\n svg.lastElementChild.setAttribute('xlink:href', value);\n } else if (/(color|fill)/.test(name.toLocaleLowerCase())) {\n (svg.firstElementChild as HTMLAnchorElement).style[name as any] = value;\n } else if (/(z-index|position|top|left|right|bottom|transform)/.test(name.toLocaleLowerCase())) {\n svg.style[name as any] = value;\n } else {\n svg.setAttribute(name, value);\n }\n }\n private update() {\n ;[...this.getAttributeNames(), 'right'].forEach((name) => {\n const value = this.getAttribute(name) || this[name as keyof GithubCorners] as any || '';\n this.setAttr(name, value);\n });\n }\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (oldValue !== newValue) {\n this.setAttr(name, newValue);\n }\n }\n}\n\ncustomElements.define('github-corners', GithubCorners);","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"size\", \"fixed\", \"bottom\", \"zIndex\", \"className\", \"style\", \"bgColor\", \"color\", \"position\"];\nimport React from 'react';\nimport '@uiw/github-corners';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function githubCorners(props) {\n var {\n size = 80,\n fixed = false,\n bottom,\n zIndex,\n style,\n bgColor = '#151513',\n color = '#fff',\n position = 'right'\n } = props,\n otherProps = _objectWithoutPropertiesLoose(props, _excluded);\n var styl = position === 'left' ? {\n left: 0,\n right: 'initial',\n transform: 'scale(-1, 1)'\n } : {\n right: 0,\n left: 'initial',\n transform: 'scale(1, 1)'\n };\n if (bottom) {\n styl.bottom = 0;\n styl.top = 'initial';\n styl.transform = position === 'left' ? 'scale(-1, -1)' : 'scale(1, -1)';\n } else {\n styl.bottom = 'initial';\n styl.top = 0;\n }\n return /*#__PURE__*/_jsx(\"github-corners\", _extends({\n target: \"__blank\",\n width: size,\n height: size,\n href: props.href,\n position: fixed ? 'fixed' : 'absolute',\n \"z-index\": zIndex,\n style: style,\n fill: bgColor,\n color: color\n }, styl, otherProps));\n}","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nexport default function Container(props) {\n return React.Children.toArray(props.children).map(child => {\n if (! /*#__PURE__*/React.isValidElement(child)) return null;\n return /*#__PURE__*/React.cloneElement(child, _extends({}, props, child.props));\n });\n}\nContainer.displayName = 'Container';","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"href\", \"anchor\", \"imgSrc\", \"platform\", \"type\", \"user\", \"repo\", \"base\", \"children\"];\nimport React from 'react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport var Internal = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n href,\n anchor = {},\n imgSrc\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n if (href) {\n return /*#__PURE__*/_jsx(\"a\", _extends({}, anchor, {\n href: href,\n children: /*#__PURE__*/_jsx(\"img\", _extends({\n alt: \"\",\n ref: ref,\n src: imgSrc\n }, other))\n }));\n }\n return /*#__PURE__*/_jsx(\"img\", _extends({\n alt: \"\",\n ref: ref,\n src: imgSrc\n }, other));\n});\nInternal.displayName = 'Internal';","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"type\", \"platform\", \"base\", \"property\", \"user\", \"repo\", \"label\"];\nimport React from 'react';\nimport { Internal } from '../common/Base';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport var Issues = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n type = 'issues',\n platform = 'github',\n base = 'https://img.shields.io',\n property,\n user,\n repo,\n label\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n var getUrl = () => {\n if (platform !== 'github') return '';\n if (type === 'issues' || /^issues-(raw|closed|closed-raw|pr|pr-raw|pr-closed|pr-closed-raw)/.test(type)) {\n if (label && (type === 'issues' || /^issues-(raw|pr|pr-raw)/.test(type || ''))) {\n return [base, platform, type, user, repo, label].join('/');\n }\n return [base, platform, type, user, repo].join('/');\n }\n if (type === 'issueKind') {\n return [base, platform, type, 'detail', property, user, repo].join('/');\n }\n return '';\n };\n return /*#__PURE__*/_jsx(Internal, _extends({\n imgSrc: getUrl(),\n ref: ref\n }, other));\n});\nIssues.displayName = 'Issues';","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"type\", \"platform\", \"base\", \"user\", \"repo\", \"path\"];\nimport React from 'react';\nimport { Internal } from '../common/Base';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport var Size = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n type = 'languages',\n platform = 'github',\n base = 'https://img.shields.io',\n user,\n repo,\n path\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n var getUrl = () => {\n if (platform !== 'github') return '';\n /**\n * /github/languages/code-size/:user/:repo\n */\n if (type === 'languages') {\n return [base, platform, type, 'code-size', user, repo].join('/');\n }\n /**\n * /github/repo-size/:user/:repo\n */\n if (type === 'repo-size') {\n return [base, platform, type, user, repo].join('/');\n }\n /**\n * /github/size/:user/:repo/:path*\n */\n if (type === 'size' && path) {\n return [base, platform, type, user, repo, path].join('/');\n }\n return '';\n };\n return /*#__PURE__*/_jsx(Internal, _extends({\n imgSrc: getUrl(),\n ref: ref\n }, other));\n});\nSize.displayName = 'Size';","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"platform\", \"type\", \"base\", \"user\", \"repo\"];\nimport React from 'react';\nimport { Internal } from '../common/Base';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport var License = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n platform = 'github',\n type = 'license',\n base = 'https://img.shields.io',\n user,\n repo\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n var getUrl = () => {\n if (platform !== 'github') return '';\n return [base, platform, type, user, repo].join('/');\n };\n return /*#__PURE__*/_jsx(Internal, _extends({\n imgSrc: getUrl(),\n ref: ref\n }, other));\n});\nLicense.displayName = 'License';","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"platform\", \"type\", \"base\", \"user\", \"repo\", \"tag\", \"path\", \"total\"];\nimport React from 'react';\nimport { Internal } from '../common/Base';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar Downloads = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n platform = 'github',\n type = 'downloads',\n base = 'https://img.shields.io',\n user,\n repo,\n tag,\n path,\n total = true\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n var getUrl = () => {\n if (platform !== 'github' || !/^(downloads|downloads-pre)/.test(type || '')) return '';\n var baseData = [base, platform, type, user, repo];\n if (path && tag) {\n return [...baseData, tag, path].join('/');\n }\n if (total && tag || type === 'downloads-pre' && tag && total) {\n return [...baseData, tag, 'total'].join('/');\n }\n if (total) {\n return [...baseData, 'total'].join('/');\n }\n return '';\n };\n return /*#__PURE__*/_jsx(Internal, _extends({\n imgSrc: getUrl(),\n ref: ref\n }, other));\n});\nDownloads.displayName = 'Downloads';\nexport default Downloads;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"platform\", \"base\", \"type\", \"user\", \"repo\", \"interval\", \"variant\", \"version\", \"branch\"];\nimport React from 'react';\nimport { Internal } from '../common/Base';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar Activity = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n platform = 'github',\n base = 'https://img.shields.io',\n type = 'commits-since',\n user,\n repo,\n interval,\n variant,\n version,\n branch\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n var getUrl = () => {\n if (platform !== 'github') return '';\n if (type === 'commits-since' && version && branch) {\n return [base, platform, type, user, repo, version, branch].join('/');\n }\n if (type === 'commit-activity' && interval) {\n return [base, platform, type, interval, user, repo].join('/');\n }\n if (type === 'variant' && variant) {\n return [base, platform, type, variant, user, repo].join('/');\n }\n if (type === 'last-commit') {\n return branch ? [base, platform, type, user, repo, branch].join('/') : [base, platform, type, user, repo].join('/');\n }\n if (type && /^release-(date|date-pre)/.test(type)) {\n return [base, platform, type, user, repo].join('/');\n }\n return '';\n };\n return /*#__PURE__*/_jsx(Internal, _extends({\n imgSrc: getUrl(),\n ref: ref\n }, other));\n});\nActivity.displayName = 'Activity';\nexport default Activity;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"platform\", \"type\", \"base\", \"user\", \"repo\", \"branch\"];\nimport React from 'react';\nimport { Internal } from '../common/Base';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n platform = 'github',\n type = 'version-release',\n base = 'https://img.shields.io',\n user,\n repo,\n branch\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n var getUrl = () => {\n var typePath = '';\n switch (type) {\n case 'version-release':\n typePath = 'v/release';\n break;\n case 'version-tag':\n typePath = 'v/tag';\n break;\n case 'package-json':\n typePath = 'package-json/v';\n break;\n case 'manifest-json':\n typePath = 'manifest-json/v';\n break;\n case 'go-mod':\n typePath = 'go-mod/go-version';\n break;\n default:\n break;\n }\n if (platform !== 'github' || !typePath) return '';\n var baseData = [base, platform, typePath, user, repo];\n if (/(go-mod|manifest-json|package-json)/.test(type || '') && branch) {\n return [...baseData, branch].join('/');\n }\n return baseData.join('/');\n };\n return /*#__PURE__*/_jsx(Internal, _extends({\n imgSrc: getUrl(),\n ref: ref\n }, other));\n});","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"platform\", \"type\", \"base\", \"user\", \"repo\", \"query\"];\nimport React from 'react';\nimport { Internal } from '../common/Base';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar Analysis = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n platform = 'github',\n type = 'languages-count',\n base = 'https://img.shields.io',\n user,\n repo,\n query\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n var getUrl = () => {\n var typePath = '';\n switch (type) {\n case 'languages-count':\n typePath = 'languages/count';\n break;\n case 'languages-top':\n typePath = 'languages/top';\n break;\n case 'search':\n typePath = 'search';\n break;\n default:\n break;\n }\n if (platform !== 'github' || !typePath) return '';\n var baseData = [base, platform, typePath, user, repo];\n if (query) {\n return [...baseData, query].join('/');\n }\n return baseData.join('/');\n };\n return /*#__PURE__*/_jsx(Internal, _extends({\n imgSrc: getUrl(),\n ref: ref\n }, other));\n});\nAnalysis.displayName = 'Analysis';\nexport default Analysis;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"type\", \"platform\", \"base\", \"user\", \"repo\"];\nimport React from 'react';\nimport { Internal } from '../common/Base';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar Social = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n type = 'followers',\n platform = 'github',\n base = 'https://img.shields.io',\n user,\n repo\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n var getUrl = () => {\n if (platform !== 'github') return '';\n if (type === 'followers') return [base, platform, type, user].join('/');\n return [base, platform, type, user, repo].join('/');\n };\n return /*#__PURE__*/_jsx(Internal, _extends({\n imgSrc: getUrl(),\n ref: ref\n }, other));\n});\nSocial.displayName = 'Social';\nexport default Social;","import _extends from \"@babel/runtime/helpers/extends\";\nimport Container from '../common/Container';\nimport { Issues } from './Issues';\nimport { Size } from './Size';\nimport { License } from './License';\nimport Downloads from './Downloads';\nimport Activity from './Activity';\nimport Version from './Version';\nimport Analysis from './Analysis';\nimport Social from './Social';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar Github = props => /*#__PURE__*/_jsx(Container, _extends({}, props));\nGithub.Issues = Issues;\nGithub.Size = Size;\nGithub.Downloads = Downloads;\nGithub.License = License;\nGithub.Activity = Activity;\nGithub.Analysis = Analysis;\nGithub.Version = Version;\nGithub.Social = Social;\nGithub.displayName = 'Github';\nexport default Github;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"type\", \"platform\", \"base\", \"user\", \"repo\"];\nimport React from 'react';\nimport { Internal } from '../common/Base';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar Coverages = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n type = 'github',\n platform = 'coveralls',\n base = 'https://img.shields.io',\n user,\n repo\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n var getUrl = () => {\n if (platform !== 'coveralls') return '';\n return [base, platform, type, user, repo].join('/');\n };\n return /*#__PURE__*/_jsx(Internal, _extends({\n imgSrc: getUrl(),\n ref: ref\n }, other));\n});\nCoverages.displayName = 'Coverages';\nexport default Coverages;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"platform\", \"base\", \"projectId\", \"branch\"];\nimport React from 'react';\nimport { Internal } from '../common/Base';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar Codacy = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n platform = 'coveralls',\n base = 'https://img.shields.io',\n projectId,\n branch\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n var getUrl = () => {\n if (platform !== 'coveralls') return '';\n if (branch) return [base, platform, projectId, branch].join('/');\n return [base, 'codacy/coverage', projectId].join('/');\n };\n return /*#__PURE__*/_jsx(Internal, _extends({\n imgSrc: getUrl(),\n ref: ref\n }, other));\n});\nCodacy.displayName = 'Codacy';\nexport default Codacy;","import _extends from \"@babel/runtime/helpers/extends\";\nimport Container from '../common/Container';\nimport Coverages from './Coverages';\nimport Codacy from './Codacy';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar Coverage = props => /*#__PURE__*/_jsx(Container, _extends({}, props));\nCoverage.Coverages = Coverages;\nCoverage.Codacy = Codacy;\nCoverage.displayName = 'Github';\nexport default Coverage;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"base\", \"platform\", \"type\", \"scope\", \"packageName\", \"dependency\", \"dependencyScope\", \"version\", \"registryUri\"];\nimport React from 'react';\nimport { Internal } from '../common/Base';\n\n/**\n * NPM Version\n *\n * `/npm/v/:packageName`\n * npm: npm badge\n *\n * `/npm/v/:scope/:packageName`\n * npm (scoped): npm (scoped) badge\n *\n * `/npm/v/:packageName/:tag`\n * npm (tag): npm (tag) badge\n *\n * `/npm/v/:packageName/:tag?registry_uri=https%3A%2F%2Fregistry.npmjs.com`\n * npm (custom registry): npm (custom registry) badge\n *\n * `/npm/v/:scope/:packageName/:tag`\n * npm (scoped with tag): npm (scoped with tag) badge\n *\n * `/npm/dependency-version/:packageName/peer/:dependency`\n * npm peer dependency version: npm peer dependency version badge\n *\n * `/npm/dependency-version/:scope?/:packageName/dev/:dependencyScope?/:dependency`\n * npm peer dependency version (scoped): npm peer dependency version (scoped) badge\n *\n * `/npm/dependency-version/:packageName/dev/:dependency`\n * npm dev dependency version: npm dev dependency version badge\n *\n * `/npm/dependency-version/:scope?/:packageName/dev/:dependencyScope?/:dependency`\n * npm dev dependency version (scoped): npm dev dependency version (scoped) badge\n *\n * `/npm/dependency-version/:packageName/:dependency`\n * npm (prod) dependency version: npm (prod) dependency version badge\n *\n * `/npm/dependency-version/:scope?/:packageName/:dependencyScope?/:dependency`\n * npm (prod) dependency version (scoped): npm (prod) dependency version (scoped) badge\n *\n * `/npm/types/:packageName`\n * npm type definitions: npm type definitions badge\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar Version = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n base = 'https://img.shields.io',\n platform = 'npm',\n type = 'version',\n scope,\n packageName,\n dependency,\n dependencyScope,\n version,\n registryUri\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n var getUrl = () => {\n if (platform !== 'npm' || !packageName) return '';\n var url = '';\n var baseData = [base, platform];\n if (type === 'version' && packageName) {\n baseData.push('v');\n if (scope) {\n baseData.push(scope);\n }\n baseData.push(packageName);\n if (version) {\n baseData.push(version);\n }\n url = baseData.join('/');\n if (registryUri) {\n url = url + \"?registry_uri=\" + registryUri;\n }\n } else if (type === 'peer-dependency' && packageName && dependency) {\n baseData.push('dependency-version');\n if (scope) {\n baseData.push(scope);\n }\n url = [...baseData, packageName, 'peer', dependency].join('/');\n } else if (type === 'dev-dependency' && packageName && dependency) {\n baseData.push('dependency-version');\n if (scope) {\n baseData.push(scope);\n }\n baseData.concat([packageName, 'dev']);\n if (dependencyScope) {\n baseData.push(dependencyScope);\n }\n baseData.push(dependency);\n url = baseData.join('/');\n } else if (packageName && dependency) {\n baseData.concat([packageName, dependency]);\n url = baseData.join('/');\n }\n return url;\n };\n return /*#__PURE__*/_jsx(Internal, _extends({\n imgSrc: getUrl(),\n ref: ref\n }, other));\n});\nVersion.displayName = 'Version';\nexport default Version;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"base\", \"platform\", \"format\", \"packageName\", \"scope\", \"version\"];\nimport React from 'react';\nimport { Internal } from '../common/Base';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Npm Size\n *\n * `/bundlephobia/:format/:packageName`\n * npm bundle size: npm bundle size badge\n *\n * `/bundlephobia/:format/:scope/:packageName`\n * npm bundle size (scoped): npm bundle size (scoped) badge\n *\n * `/bundlephobia/:format/:packageName/:version`\n * npm bundle size (version): npm bundle size (version) badge\n *\n * `/bundlephobia/:format/:scope/:packageName/:version`\n * npm bundle size (scoped version): npm bundle size (scoped version) badge\n *\n */\nvar Size = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n base = 'https://img.shields.io',\n platform = 'npm',\n format = 'min',\n packageName,\n scope,\n version\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n var getUrl = () => {\n if (platform !== 'npm') return '';\n var baseData = [base, 'bundlephobia'];\n var url = '';\n if (packageName && format) {\n url = [...baseData, format, packageName].join('/');\n }\n if (packageName && format && scope) {\n url = [...baseData, format, scope, packageName].join('/');\n }\n if (packageName && format && scope && version) {\n url = [...baseData, format, scope, packageName, version].join('/');\n }\n if (packageName && format && version) {\n url = [...baseData, format, packageName, version].join('/');\n }\n return url;\n };\n return /*#__PURE__*/_jsx(Internal, _extends({\n imgSrc: getUrl(),\n ref: ref\n }, other));\n});\nSize.displayName = 'Size';\nexport default Size;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"base\", \"platform\", \"interval\", \"packageName\", \"scope\"];\nimport React from 'react';\nimport { Internal } from '../common/Base';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Npm Downloads\n *\n * `/npm/:interval/:packageName`\n * npm downloads: npm downloads per interval badge\n *\n * `/npm/:interval/:scope/:packageName`\n * npm downloads (scoped): npm downloads per interval (scoped version) badge\n *\n */\nvar Downloads = /*#__PURE__*/React.forwardRef((props, ref) => {\n var {\n base = 'https://img.shields.io',\n platform = 'npm',\n interval = 'dm',\n packageName,\n scope\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n var getUrl = () => {\n if (platform !== 'npm' || !packageName) return '';\n var url = [base, 'npm', interval];\n if (scope) {\n url.push(scope);\n }\n url.push(packageName);\n return url.join('/');\n };\n return /*#__PURE__*/_jsx(Internal, _extends({\n imgSrc: getUrl(),\n ref: ref\n }, other));\n});\nDownloads.displayName = 'Downloads';\nexport default Downloads;","import _extends from \"@babel/runtime/helpers/extends\";\nimport Container from '../common/Container';\nimport Version from './Version';\nimport Size from './Size';\nimport Downloads from './Downloads';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar Npm = props => /*#__PURE__*/_jsx(Container, _extends({}, props));\nNpm.Version = Version;\nNpm.Size = Size;\nNpm.Downloads = Downloads;\nNpm.displayName = 'Npm';\nexport default Npm;","/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [jsx=false]\n * Support JSX identifiers (default: `false`).\n */\n\nconst startRe = /[$_\\p{ID_Start}]/u\nconst contRe = /[$_\\u{200C}\\u{200D}\\p{ID_Continue}]/u\nconst contReJsx = /[-$_\\u{200C}\\u{200D}\\p{ID_Continue}]/u\nconst nameRe = /^[$_\\p{ID_Start}][$_\\u{200C}\\u{200D}\\p{ID_Continue}]*$/u\nconst nameReJsx = /^[$_\\p{ID_Start}][-$_\\u{200C}\\u{200D}\\p{ID_Continue}]*$/u\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Checks if the given code point can start an identifier.\n *\n * @param {number | undefined} code\n * Code point to check.\n * @returns {boolean}\n * Whether `code` can start an identifier.\n */\n// Note: `undefined` is supported so you can pass the result from `''.codePointAt`.\nexport function start(code) {\n return code ? startRe.test(String.fromCodePoint(code)) : false\n}\n\n/**\n * Checks if the given code point can continue an identifier.\n *\n * @param {number | undefined} code\n * Code point to check.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {boolean}\n * Whether `code` can continue an identifier.\n */\n// Note: `undefined` is supported so you can pass the result from `''.codePointAt`.\nexport function cont(code, options) {\n const settings = options || emptyOptions\n const re = settings.jsx ? contReJsx : contRe\n return code ? re.test(String.fromCodePoint(code)) : false\n}\n\n/**\n * Checks if the given value is a valid identifier name.\n *\n * @param {string} name\n * Identifier to check.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {boolean}\n * Whether `name` can be an identifier.\n */\nexport function name(name, options) {\n const settings = options || emptyOptions\n const re = settings.jsx ? nameReJsx : nameRe\n return re.test(name)\n}\n","/**\n * @typedef {import('hast').Nodes} Nodes\n */\n\n// HTML whitespace expression.\n// See .\nconst re = /[ \\t\\n\\f\\r]/g\n\n/**\n * Check if the given value is *inter-element whitespace*.\n *\n * @param {Nodes | string} thing\n * Thing to check (`Node` or `string`).\n * @returns {boolean}\n * Whether the `value` is inter-element whitespace (`boolean`): consisting of\n * zero or more of space, tab (`\\t`), line feed (`\\n`), carriage return\n * (`\\r`), or form feed (`\\f`); if a node is passed it must be a `Text` node,\n * whose `value` field is checked.\n */\nexport function whitespace(thing) {\n return typeof thing === 'object'\n ? thing.type === 'text'\n ? empty(thing.value)\n : false\n : empty(thing)\n}\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction empty(value) {\n return value.replace(re, '') === ''\n}\n","/**\n * `hast` is close to `React`, but differs in a couple of cases.\n *\n * To get a React property from a hast property, check if it is in\n * `hastToReact`, if it is, then use the corresponding value,\n * otherwise, use the hast property.\n *\n * @type {Record}\n */\nexport const hastToReact = {\n classId: 'classID',\n dataType: 'datatype',\n itemId: 'itemID',\n strokeDashArray: 'strokeDasharray',\n strokeDashOffset: 'strokeDashoffset',\n strokeLineCap: 'strokeLinecap',\n strokeLineJoin: 'strokeLinejoin',\n strokeMiterLimit: 'strokeMiterlimit',\n typeOf: 'typeof',\n xLinkActuate: 'xlinkActuate',\n xLinkArcRole: 'xlinkArcrole',\n xLinkHref: 'xlinkHref',\n xLinkRole: 'xlinkRole',\n xLinkShow: 'xlinkShow',\n xLinkTitle: 'xlinkTitle',\n xLinkType: 'xlinkType',\n xmlnsXLink: 'xmlnsXlink'\n}\n","import StyleToObject from '../cjs/index.js';\n\n// ensure compatibility with rollup umd build\nexport default StyleToObject.default || StyleToObject;\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n * @typedef {import('unist').Position} Position\n */\n\n/**\n * @typedef NodeLike\n * @property {string} type\n * @property {PositionLike | null | undefined} [position]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n *\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n */\n\n/**\n * Get the ending point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointEnd = point('end')\n\n/**\n * Get the starting point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointStart = point('start')\n\n/**\n * Get the positional info of `node`.\n *\n * @param {'end' | 'start'} type\n * Side.\n * @returns\n * Getter.\n */\nfunction point(type) {\n return point\n\n /**\n * Get the point info of `node` at a bound side.\n *\n * @param {Node | NodeLike | null | undefined} [node]\n * @returns {Point | undefined}\n */\n function point(node) {\n const point = (node && node.position && node.position[type]) || {}\n\n if (\n typeof point.line === 'number' &&\n point.line > 0 &&\n typeof point.column === 'number' &&\n point.column > 0\n ) {\n return {\n line: point.line,\n column: point.column,\n offset:\n typeof point.offset === 'number' && point.offset > -1\n ? point.offset\n : undefined\n }\n }\n }\n}\n\n/**\n * Get the positional info of `node`.\n *\n * @param {Node | NodeLike | null | undefined} [node]\n * Node.\n * @returns {Position | undefined}\n * Position.\n */\nexport function position(node) {\n const start = pointStart(node)\n const end = pointEnd(node)\n\n if (start && end) {\n return {start, end}\n }\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n * @typedef {import('unist').Position} Position\n */\n\n/**\n * @typedef NodeLike\n * @property {string} type\n * @property {PositionLike | null | undefined} [position]\n *\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n */\n\n/**\n * Serialize the positional info of a point, position (start and end points),\n * or node.\n *\n * @param {Node | NodeLike | Point | PointLike | Position | PositionLike | null | undefined} [value]\n * Node, position, or point.\n * @returns {string}\n * Pretty printed positional info of a node (`string`).\n *\n * In the format of a range `ls:cs-le:ce` (when given `node` or `position`)\n * or a point `l:c` (when given `point`), where `l` stands for line, `c` for\n * column, `s` for `start`, and `e` for end.\n * An empty string (`''`) is returned if the given value is neither `node`,\n * `position`, nor `point`.\n */\nexport function stringifyPosition(value) {\n // Nothing.\n if (!value || typeof value !== 'object') {\n return ''\n }\n\n // Node.\n if ('position' in value || 'type' in value) {\n return position(value.position)\n }\n\n // Position.\n if ('start' in value || 'end' in value) {\n return position(value)\n }\n\n // Point.\n if ('line' in value || 'column' in value) {\n return point(value)\n }\n\n // ?\n return ''\n}\n\n/**\n * @param {Point | PointLike | null | undefined} point\n * @returns {string}\n */\nfunction point(point) {\n return index(point && point.line) + ':' + index(point && point.column)\n}\n\n/**\n * @param {Position | PositionLike | null | undefined} pos\n * @returns {string}\n */\nfunction position(pos) {\n return point(pos && pos.start) + '-' + point(pos && pos.end)\n}\n\n/**\n * @param {number | null | undefined} value\n * @returns {number}\n */\nfunction index(value) {\n return value && typeof value === 'number' ? value : 1\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n * @typedef {import('unist').Position} Position\n */\n\n/**\n * @typedef {object & {type: string, position?: Position | undefined}} NodeLike\n *\n * @typedef Options\n * Configuration.\n * @property {Array | null | undefined} [ancestors]\n * Stack of (inclusive) ancestor nodes surrounding the message (optional).\n * @property {Error | null | undefined} [cause]\n * Original error cause of the message (optional).\n * @property {Point | Position | null | undefined} [place]\n * Place of message (optional).\n * @property {string | null | undefined} [ruleId]\n * Category of message (optional, example: `'my-rule'`).\n * @property {string | null | undefined} [source]\n * Namespace of who sent the message (optional, example: `'my-package'`).\n */\n\nimport {stringifyPosition} from 'unist-util-stringify-position'\n\n/**\n * Message.\n */\nexport class VFileMessage extends Error {\n /**\n * Create a message for `reason`.\n *\n * > 🪦 **Note**: also has obsolete signatures.\n *\n * @overload\n * @param {string} reason\n * @param {Options | null | undefined} [options]\n * @returns\n *\n * @overload\n * @param {string} reason\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {string} reason\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {string} reason\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @param {Error | VFileMessage | string} causeOrReason\n * Reason for message, should use markdown.\n * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace]\n * Configuration (optional).\n * @param {string | null | undefined} [origin]\n * Place in code where the message originates (example:\n * `'my-package:my-rule'` or `'my-rule'`).\n * @returns\n * Instance of `VFileMessage`.\n */\n // eslint-disable-next-line complexity\n constructor(causeOrReason, optionsOrParentOrPlace, origin) {\n super()\n\n if (typeof optionsOrParentOrPlace === 'string') {\n origin = optionsOrParentOrPlace\n optionsOrParentOrPlace = undefined\n }\n\n /** @type {string} */\n let reason = ''\n /** @type {Options} */\n let options = {}\n let legacyCause = false\n\n if (optionsOrParentOrPlace) {\n // Point.\n if (\n 'line' in optionsOrParentOrPlace &&\n 'column' in optionsOrParentOrPlace\n ) {\n options = {place: optionsOrParentOrPlace}\n }\n // Position.\n else if (\n 'start' in optionsOrParentOrPlace &&\n 'end' in optionsOrParentOrPlace\n ) {\n options = {place: optionsOrParentOrPlace}\n }\n // Node.\n else if ('type' in optionsOrParentOrPlace) {\n options = {\n ancestors: [optionsOrParentOrPlace],\n place: optionsOrParentOrPlace.position\n }\n }\n // Options.\n else {\n options = {...optionsOrParentOrPlace}\n }\n }\n\n if (typeof causeOrReason === 'string') {\n reason = causeOrReason\n }\n // Error.\n else if (!options.cause && causeOrReason) {\n legacyCause = true\n reason = causeOrReason.message\n options.cause = causeOrReason\n }\n\n if (!options.ruleId && !options.source && typeof origin === 'string') {\n const index = origin.indexOf(':')\n\n if (index === -1) {\n options.ruleId = origin\n } else {\n options.source = origin.slice(0, index)\n options.ruleId = origin.slice(index + 1)\n }\n }\n\n if (!options.place && options.ancestors && options.ancestors) {\n const parent = options.ancestors[options.ancestors.length - 1]\n\n if (parent) {\n options.place = parent.position\n }\n }\n\n const start =\n options.place && 'start' in options.place\n ? options.place.start\n : options.place\n\n /* eslint-disable no-unused-expressions */\n /**\n * Stack of ancestor nodes surrounding the message.\n *\n * @type {Array | undefined}\n */\n this.ancestors = options.ancestors || undefined\n\n /**\n * Original error cause of the message.\n *\n * @type {Error | undefined}\n */\n this.cause = options.cause || undefined\n\n /**\n * Starting column of message.\n *\n * @type {number | undefined}\n */\n this.column = start ? start.column : undefined\n\n /**\n * State of problem.\n *\n * * `true` — error, file not usable\n * * `false` — warning, change may be needed\n * * `undefined` — change likely not needed\n *\n * @type {boolean | null | undefined}\n */\n this.fatal = undefined\n\n /**\n * Path of a file (used throughout the `VFile` ecosystem).\n *\n * @type {string | undefined}\n */\n this.file\n\n // Field from `Error`.\n /**\n * Reason for message.\n *\n * @type {string}\n */\n this.message = reason\n\n /**\n * Starting line of error.\n *\n * @type {number | undefined}\n */\n this.line = start ? start.line : undefined\n\n // Field from `Error`.\n /**\n * Serialized positional info of message.\n *\n * On normal errors, this would be something like `ParseError`, buit in\n * `VFile` messages we use this space to show where an error happened.\n */\n this.name = stringifyPosition(options.place) || '1:1'\n\n /**\n * Place of message.\n *\n * @type {Point | Position | undefined}\n */\n this.place = options.place || undefined\n\n /**\n * Reason for message, should use markdown.\n *\n * @type {string}\n */\n this.reason = this.message\n\n /**\n * Category of message (example: `'my-rule'`).\n *\n * @type {string | undefined}\n */\n this.ruleId = options.ruleId || undefined\n\n /**\n * Namespace of message (example: `'my-package'`).\n *\n * @type {string | undefined}\n */\n this.source = options.source || undefined\n\n // Field from `Error`.\n /**\n * Stack of message.\n *\n * This is used by normal errors to show where something happened in\n * programming code, irrelevant for `VFile` messages,\n *\n * @type {string}\n */\n this.stack =\n legacyCause && options.cause && typeof options.cause.stack === 'string'\n ? options.cause.stack\n : ''\n\n // The following fields are “well known”.\n // Not standard.\n // Feel free to add other non-standard fields to your messages.\n\n /**\n * Specify the source value that’s being reported, which is deemed\n * incorrect.\n *\n * @type {string | undefined}\n */\n this.actual\n\n /**\n * Suggest acceptable values that can be used instead of `actual`.\n *\n * @type {Array | undefined}\n */\n this.expected\n\n /**\n * Long form description of the message (you should use markdown).\n *\n * @type {string | undefined}\n */\n this.note\n\n /**\n * Link to docs for the message.\n *\n * > 👉 **Note**: this must be an absolute URL that can be passed as `x`\n * > to `new URL(x)`.\n *\n * @type {string | undefined}\n */\n this.url\n /* eslint-enable no-unused-expressions */\n }\n}\n\nVFileMessage.prototype.file = ''\nVFileMessage.prototype.name = ''\nVFileMessage.prototype.reason = ''\nVFileMessage.prototype.message = ''\nVFileMessage.prototype.stack = ''\nVFileMessage.prototype.column = undefined\nVFileMessage.prototype.line = undefined\nVFileMessage.prototype.ancestors = undefined\nVFileMessage.prototype.cause = undefined\nVFileMessage.prototype.fatal = undefined\nVFileMessage.prototype.place = undefined\nVFileMessage.prototype.ruleId = undefined\nVFileMessage.prototype.source = undefined\n","// Register MDX nodes in mdast:\n/// \n/// \n/// \n\n/**\n * @typedef {import('estree').Identifier} Identifier\n * @typedef {import('estree').Literal} Literal\n * @typedef {import('estree').MemberExpression} MemberExpression\n * @typedef {import('estree').Expression} Expression\n * @typedef {import('estree').Program} Program\n *\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Nodes} Nodes\n * @typedef {import('hast').Parents} Parents\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').Text} Text\n *\n * @typedef {import('mdast-util-mdx-expression').MdxFlowExpressionHast} MdxFlowExpression\n * @typedef {import('mdast-util-mdx-expression').MdxTextExpressionHast} MdxTextExpression\n *\n * @typedef {import('mdast-util-mdx-jsx').MdxJsxFlowElementHast} MdxJsxFlowElement\n * @typedef {import('mdast-util-mdx-jsx').MdxJsxTextElementHast} MdxJsxTextElement\n *\n * @typedef {import('mdast-util-mdxjs-esm').MdxjsEsmHast} MdxjsEsm\n *\n * @typedef {import('property-information').Schema} Schema\n *\n * @typedef {import('unist').Position} Position\n *\n * @typedef {import('./components.js').Components} Components\n */\n\n/**\n * @typedef {JSX.Element | string | null | undefined} Child\n * Child.\n *\n * @callback Create\n * Create something in development or production.\n * @param {Nodes} node\n * hast node.\n * @param {unknown} type\n * Fragment symbol or tag name.\n * @param {Props} props\n * Properties and children.\n * @param {string | undefined} key\n * Key.\n * @returns {JSX.Element}\n * Result.\n *\n * @callback CreateEvaluater\n * Create an evaluator that turns ESTree ASTs from embedded MDX into values.\n * @returns {Evaluater}\n * Evaluater.\n *\n * @typedef {'html' | 'react'} ElementAttributeNameCase\n * Casing to use for attribute names.\n *\n * HTML casing is for example `class`, `stroke-linecap`, `xml:lang`.\n * React casing is for example `className`, `strokeLinecap`, `xmlLang`.\n *\n * @callback EvaluateExpression\n * Turn an MDX expression into a value.\n * @param {Expression} expression\n * ESTree expression.\n * @returns {unknown}\n * Result of expression.\n *\n * @callback EvaluateProgram\n * Turn an MDX program (export/import statements) into a value.\n * @param {Program} expression\n * ESTree program.\n * @returns {unknown}\n * Result of program;\n * should likely be `undefined` as ESM changes the scope but doesn’t yield\n * something.\n *\n * @typedef Evaluater\n * Evaluator that turns ESTree ASTs from embedded MDX into values.\n * @property {EvaluateExpression} evaluateExpression\n * Evaluate an expression.\n * @property {EvaluateProgram} evaluateProgram\n * Evaluate a program.\n *\n * @typedef {[string, Value]} Field\n * Property field.\n *\n * @typedef {unknown} Fragment\n * Represent the children, typically a symbol.\n *\n * @callback Jsx\n * Create a production element.\n * @param {unknown} type\n * Element type: `Fragment` symbol, tag name (`string`), component.\n * @param {Props} props\n * Element props, `children`, and maybe `node`.\n * @param {string | undefined} [key]\n * Dynamicly generated key to use.\n * @returns {JSX.Element}\n * Element from your framework.\n *\n * @callback JsxDev\n * Create a development element.\n * @param {unknown} type\n * Element type: `Fragment` symbol, tag name (`string`), component.\n * @param {Props} props\n * Element props, `children`, and maybe `node`.\n * @param {string | undefined} key\n * Dynamicly generated key to use.\n * @param {boolean} isStaticChildren\n * Whether two or more children are passed (in an array), which is whether\n * `jsxs` or `jsx` would be used.\n * @param {Source} source\n * Info about source.\n * @param {undefined} self\n * Nothing (this is used by frameworks that have components, we don’t).\n * @returns {JSX.Element}\n * Element from your framework.\n *\n * @typedef {{children?: Array | Child, node?: Element | MdxJsxFlowElement | MdxJsxTextElement | undefined, [prop: string]: Array | Child | Element | MdxJsxFlowElement | MdxJsxTextElement | Value | undefined}} Props\n * Properties and children.\n *\n * @typedef RegularFields\n * Configuration.\n * @property {Partial | null | undefined} [components]\n * Components to use (optional).\n * @property {CreateEvaluater | null | undefined} [createEvaluater]\n * Create an evaluator that turns ESTree ASTs into values (optional).\n * @property {ElementAttributeNameCase | null | undefined} [elementAttributeNameCase='react']\n * Specify casing to use for attribute names (default: `'react'`).\n * @property {string | null | undefined} [filePath]\n * File path to the original source file (optional).\n *\n * Passed in source info to `jsxDEV` when using the automatic runtime with\n * `development: true`.\n * @property {boolean | null | undefined} [ignoreInvalidStyle=false]\n * Ignore invalid CSS in `style` props (default: `false`);\n * the default behavior is to throw an error.\n * @property {boolean | null | undefined} [passKeys=true]\n * Generate keys to optimize frameworks that support them (default: `true`).\n *\n * > 👉 **Note**: Solid currently fails if keys are passed.\n * @property {boolean | null | undefined} [passNode=false]\n * Pass the hast element node to components (default: `false`).\n * @property {Space | null | undefined} [space='html']\n * Whether `tree` is in the `'html'` or `'svg'` space (default: `'html'`).\n *\n * When an `` element is found in the HTML space, this package already\n * automatically switches to and from the SVG space when entering and exiting\n * it.\n * @property {StylePropertyNameCase | null | undefined} [stylePropertyNameCase='dom']\n * Specify casing to use for property names in `style` objects (default:\n * `'dom'`).\n * @property {boolean | null | undefined} [tableCellAlignToStyle=true]\n * Turn obsolete `align` props on `td` and `th` into CSS `style` props\n * (default: `true`).\n *\n * @typedef RuntimeDevelopment\n * Runtime fields when development is on.\n * @property {Fragment} Fragment\n * Fragment.\n * @property {true} development\n * Whether to use `jsxDEV` (when on) or `jsx` and `jsxs` (when off).\n * @property {Jsx | null | undefined} [jsx]\n * Dynamic JSX (optional).\n * @property {JsxDev} jsxDEV\n * Development JSX.\n * @property {Jsx | null | undefined} [jsxs]\n * Static JSX (optional).\n *\n * @typedef RuntimeProduction\n * Runtime fields when development is off.\n * @property {Fragment} Fragment\n * Fragment.\n * @property {false | null | undefined} [development]\n * Whether to use `jsxDEV` (when on) or `jsx` and `jsxs` (when off) (optional).\n * @property {Jsx} jsx\n * Dynamic JSX.\n * @property {JsxDev | null | undefined} [jsxDEV]\n * Development JSX (optional).\n * @property {Jsx} jsxs\n * Static JSX.\n *\n * @typedef RuntimeUnknown\n * Runtime fields when development might be on or off.\n * @property {Fragment} Fragment\n * Fragment.\n * @property {boolean} development\n * Whether to use `jsxDEV` (when on) or `jsx` and `jsxs` (when off).\n * @property {Jsx | null | undefined} [jsx]\n * Dynamic JSX (optional).\n * @property {JsxDev | null | undefined} [jsxDEV]\n * Development JSX (optional).\n * @property {Jsx | null | undefined} [jsxs]\n * Static JSX (optional).\n *\n * @typedef Source\n * Info about source.\n * @property {number | undefined} columnNumber\n * Column where thing starts (0-indexed).\n * @property {string | undefined} fileName\n * Name of source file.\n * @property {number | undefined} lineNumber\n * Line where thing starts (1-indexed).\n *\n * @typedef {'html' | 'svg'} Space\n * Namespace.\n *\n * > 👉 **Note**: hast is not XML.\n * > It supports SVG as embedded in HTML.\n * > It does not support the features available in XML.\n * > Passing SVG might break but fragments of modern SVG should be fine.\n * > Use `xast` if you need to support SVG as XML.\n *\n * @typedef State\n * Info passed around.\n * @property {unknown} Fragment\n * Fragment symbol.\n * @property {Array} ancestors\n * Stack of parents.\n * @property {Partial} components\n * Components to swap.\n * @property {Create} create\n * Create something in development or production.\n * @property {ElementAttributeNameCase} elementAttributeNameCase\n * Casing to use for attribute names.\n * @property {Evaluater | undefined} evaluater\n * Evaluator that turns ESTree ASTs into values.\n * @property {string | undefined} filePath\n * File path.\n * @property {boolean} ignoreInvalidStyle\n * Ignore invalid CSS in `style` props.\n * @property {boolean} passKeys\n * Generate keys to optimize frameworks that support them.\n * @property {boolean} passNode\n * Pass `node` to components.\n * @property {Schema} schema\n * Current schema.\n * @property {StylePropertyNameCase} stylePropertyNameCase\n * Casing to use for property names in `style` objects.\n * @property {boolean} tableCellAlignToStyle\n * Turn obsolete `align` props on `td` and `th` into CSS `style` props.\n *\n * @typedef {Record} Style\n * Style map.\n *\n * @typedef {'css' | 'dom'} StylePropertyNameCase\n * Casing to use for property names in `style` objects.\n *\n * CSS casing is for example `background-color` and `-webkit-line-clamp`.\n * DOM casing is for example `backgroundColor` and `WebkitLineClamp`.\n *\n * @typedef {Style | boolean | number | string} Value\n * Primitive property value and `Style` map.\n */\n\n/**\n * @typedef {RuntimeDevelopment & RegularFields} Development\n * Configuration (development).\n * @typedef {Development | Production | Unknown} Options\n * Configuration.\n * @typedef {RegularFields & RuntimeProduction} Production\n * Configuration (production).\n * @typedef {RegularFields & RuntimeUnknown} Unknown\n * Configuration (production or development).\n */\n\nimport {stringify as commas} from 'comma-separated-tokens'\nimport {ok as assert} from 'devlop'\nimport {name as isIdentifierName} from 'estree-util-is-identifier-name'\nimport {whitespace} from 'hast-util-whitespace'\nimport {find, hastToReact, html, svg} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport styleToObject from 'style-to-object'\nimport {pointStart} from 'unist-util-position'\nimport {VFileMessage} from 'vfile-message'\n\nconst own = {}.hasOwnProperty\n\n/** @type {Map} */\nconst emptyMap = new Map()\n\nconst cap = /[A-Z]/g\nconst dashSomething = /-([a-z])/g\n\n// `react-dom` triggers a warning for *any* white space in tables.\n// To follow GFM, `mdast-util-to-hast` injects line endings between elements.\n// Other tools might do so too, but they don’t do here, so we remove all of\n// that.\n\n// See: .\n// See: .\n// See: .\n// See: .\n// See: .\n// See: .\nconst tableElements = new Set(['table', 'tbody', 'thead', 'tfoot', 'tr'])\n\nconst tableCellElement = new Set(['td', 'th'])\n\nconst docs = 'https://github.com/syntax-tree/hast-util-to-jsx-runtime'\n\n/**\n * Transform a hast tree to preact, react, solid, svelte, vue, etc.,\n * with an automatic JSX runtime.\n *\n * @param {Nodes} tree\n * Tree to transform.\n * @param {Options} options\n * Configuration (required).\n * @returns {JSX.Element}\n * JSX element.\n */\n\nexport function toJsxRuntime(tree, options) {\n if (!options || options.Fragment === undefined) {\n throw new TypeError('Expected `Fragment` in options')\n }\n\n const filePath = options.filePath || undefined\n /** @type {Create} */\n let create\n\n if (options.development) {\n if (typeof options.jsxDEV !== 'function') {\n throw new TypeError(\n 'Expected `jsxDEV` in options when `development: true`'\n )\n }\n\n create = developmentCreate(filePath, options.jsxDEV)\n } else {\n if (typeof options.jsx !== 'function') {\n throw new TypeError('Expected `jsx` in production options')\n }\n\n if (typeof options.jsxs !== 'function') {\n throw new TypeError('Expected `jsxs` in production options')\n }\n\n create = productionCreate(filePath, options.jsx, options.jsxs)\n }\n\n /** @type {State} */\n const state = {\n Fragment: options.Fragment,\n ancestors: [],\n components: options.components || {},\n create,\n elementAttributeNameCase: options.elementAttributeNameCase || 'react',\n evaluater: options.createEvaluater ? options.createEvaluater() : undefined,\n filePath,\n ignoreInvalidStyle: options.ignoreInvalidStyle || false,\n passKeys: options.passKeys !== false,\n passNode: options.passNode || false,\n schema: options.space === 'svg' ? svg : html,\n stylePropertyNameCase: options.stylePropertyNameCase || 'dom',\n tableCellAlignToStyle: options.tableCellAlignToStyle !== false\n }\n\n const result = one(state, tree, undefined)\n\n // JSX element.\n if (result && typeof result !== 'string') {\n return result\n }\n\n // Text node or something that turned into nothing.\n return state.create(\n tree,\n state.Fragment,\n {children: result || undefined},\n undefined\n )\n}\n\n/**\n * Transform a node.\n *\n * @param {State} state\n * Info passed around.\n * @param {Nodes} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction one(state, node, key) {\n if (node.type === 'element') {\n return element(state, node, key)\n }\n\n if (node.type === 'mdxFlowExpression' || node.type === 'mdxTextExpression') {\n return mdxExpression(state, node)\n }\n\n if (node.type === 'mdxJsxFlowElement' || node.type === 'mdxJsxTextElement') {\n return mdxJsxElement(state, node, key)\n }\n\n if (node.type === 'mdxjsEsm') {\n return mdxEsm(state, node)\n }\n\n if (node.type === 'root') {\n return root(state, node, key)\n }\n\n if (node.type === 'text') {\n return text(state, node)\n }\n}\n\n/**\n * Handle element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Element} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction element(state, node, key) {\n const parentSchema = state.schema\n let schema = parentSchema\n\n if (node.tagName.toLowerCase() === 'svg' && parentSchema.space === 'html') {\n schema = svg\n state.schema = schema\n }\n\n state.ancestors.push(node)\n\n const type = findComponentFromName(state, node.tagName, false)\n const props = createElementProps(state, node)\n let children = createChildren(state, node)\n\n if (tableElements.has(node.tagName)) {\n children = children.filter(function (child) {\n return typeof child === 'string' ? !whitespace(child) : true\n })\n }\n\n addNode(state, props, type, node)\n addChildren(props, children)\n\n // Restore.\n state.ancestors.pop()\n state.schema = parentSchema\n\n return state.create(node, type, props, key)\n}\n\n/**\n * Handle MDX expression.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxFlowExpression | MdxTextExpression} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxExpression(state, node) {\n if (node.data && node.data.estree && state.evaluater) {\n const program = node.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n\n // Assume result is a child.\n return /** @type {Child | undefined} */ (\n state.evaluater.evaluateExpression(expression.expression)\n )\n }\n\n crashEstree(state, node.position)\n}\n\n/**\n * Handle MDX ESM.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxjsEsm} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxEsm(state, node) {\n if (node.data && node.data.estree && state.evaluater) {\n // Assume result is a child.\n return /** @type {Child | undefined} */ (\n state.evaluater.evaluateProgram(node.data.estree)\n )\n }\n\n crashEstree(state, node.position)\n}\n\n/**\n * Handle MDX JSX.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxJsxFlowElement | MdxJsxTextElement} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxJsxElement(state, node, key) {\n const parentSchema = state.schema\n let schema = parentSchema\n\n if (node.name === 'svg' && parentSchema.space === 'html') {\n schema = svg\n state.schema = schema\n }\n\n state.ancestors.push(node)\n\n const type =\n node.name === null\n ? state.Fragment\n : findComponentFromName(state, node.name, true)\n const props = createJsxElementProps(state, node)\n const children = createChildren(state, node)\n\n addNode(state, props, type, node)\n addChildren(props, children)\n\n // Restore.\n state.ancestors.pop()\n state.schema = parentSchema\n\n return state.create(node, type, props, key)\n}\n\n/**\n * Handle root.\n *\n * @param {State} state\n * Info passed around.\n * @param {Root} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction root(state, node, key) {\n /** @type {Props} */\n const props = {}\n\n addChildren(props, createChildren(state, node))\n\n return state.create(node, state.Fragment, props, key)\n}\n\n/**\n * Handle text.\n *\n * @param {State} _\n * Info passed around.\n * @param {Text} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction text(_, node) {\n return node.value\n}\n\n/**\n * Add `node` to props.\n *\n * @param {State} state\n * Info passed around.\n * @param {Props} props\n * Props.\n * @param {unknown} type\n * Type.\n * @param {Element | MdxJsxFlowElement | MdxJsxTextElement} node\n * Node.\n * @returns {undefined}\n * Nothing.\n */\nfunction addNode(state, props, type, node) {\n // If this is swapped out for a component:\n if (typeof type !== 'string' && type !== state.Fragment && state.passNode) {\n props.node = node\n }\n}\n\n/**\n * Add children to props.\n *\n * @param {Props} props\n * Props.\n * @param {Array} children\n * Children.\n * @returns {undefined}\n * Nothing.\n */\nfunction addChildren(props, children) {\n if (children.length > 0) {\n const value = children.length > 1 ? children : children[0]\n\n if (value) {\n props.children = value\n }\n }\n}\n\n/**\n * @param {string | undefined} _\n * Path to file.\n * @param {Jsx} jsx\n * Dynamic.\n * @param {Jsx} jsxs\n * Static.\n * @returns {Create}\n * Create a production element.\n */\nfunction productionCreate(_, jsx, jsxs) {\n return create\n /** @type {Create} */\n function create(_, type, props, key) {\n // Only an array when there are 2 or more children.\n const isStaticChildren = Array.isArray(props.children)\n const fn = isStaticChildren ? jsxs : jsx\n return key ? fn(type, props, key) : fn(type, props)\n }\n}\n\n/**\n * @param {string | undefined} filePath\n * Path to file.\n * @param {JsxDev} jsxDEV\n * Development.\n * @returns {Create}\n * Create a development element.\n */\nfunction developmentCreate(filePath, jsxDEV) {\n return create\n /** @type {Create} */\n function create(node, type, props, key) {\n // Only an array when there are 2 or more children.\n const isStaticChildren = Array.isArray(props.children)\n const point = pointStart(node)\n return jsxDEV(\n type,\n props,\n key,\n isStaticChildren,\n {\n columnNumber: point ? point.column - 1 : undefined,\n fileName: filePath,\n lineNumber: point ? point.line : undefined\n },\n undefined\n )\n }\n}\n\n/**\n * Create props from an element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Element} node\n * Current element.\n * @returns {Props}\n * Props.\n */\nfunction createElementProps(state, node) {\n /** @type {Props} */\n const props = {}\n /** @type {string | undefined} */\n let alignValue\n /** @type {string} */\n let prop\n\n for (prop in node.properties) {\n if (prop !== 'children' && own.call(node.properties, prop)) {\n const result = createProperty(state, prop, node.properties[prop])\n\n if (result) {\n const [key, value] = result\n\n if (\n state.tableCellAlignToStyle &&\n key === 'align' &&\n typeof value === 'string' &&\n tableCellElement.has(node.tagName)\n ) {\n alignValue = value\n } else {\n props[key] = value\n }\n }\n }\n }\n\n if (alignValue) {\n // Assume style is an object.\n const style = /** @type {Style} */ (props.style || (props.style = {}))\n style[state.stylePropertyNameCase === 'css' ? 'text-align' : 'textAlign'] =\n alignValue\n }\n\n return props\n}\n\n/**\n * Create props from a JSX element.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxJsxFlowElement | MdxJsxTextElement} node\n * Current JSX element.\n * @returns {Props}\n * Props.\n */\nfunction createJsxElementProps(state, node) {\n /** @type {Props} */\n const props = {}\n\n for (const attribute of node.attributes) {\n if (attribute.type === 'mdxJsxExpressionAttribute') {\n if (attribute.data && attribute.data.estree && state.evaluater) {\n const program = attribute.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n const objectExpression = expression.expression\n assert(objectExpression.type === 'ObjectExpression')\n const property = objectExpression.properties[0]\n assert(property.type === 'SpreadElement')\n\n Object.assign(\n props,\n state.evaluater.evaluateExpression(property.argument)\n )\n } else {\n crashEstree(state, node.position)\n }\n } else {\n // For JSX, the author is responsible of passing in the correct values.\n const name = attribute.name\n /** @type {unknown} */\n let value\n\n if (attribute.value && typeof attribute.value === 'object') {\n if (\n attribute.value.data &&\n attribute.value.data.estree &&\n state.evaluater\n ) {\n const program = attribute.value.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n value = state.evaluater.evaluateExpression(expression.expression)\n } else {\n crashEstree(state, node.position)\n }\n } else {\n value = attribute.value === null ? true : attribute.value\n }\n\n // Assume a prop.\n props[name] = /** @type {Props[keyof Props]} */ (value)\n }\n }\n\n return props\n}\n\n/**\n * Create children.\n *\n * @param {State} state\n * Info passed around.\n * @param {Parents} node\n * Current element.\n * @returns {Array}\n * Children.\n */\nfunction createChildren(state, node) {\n /** @type {Array} */\n const children = []\n let index = -1\n /** @type {Map} */\n // Note: test this when Solid doesn’t want to merge my upcoming PR.\n /* c8 ignore next */\n const countsByName = state.passKeys ? new Map() : emptyMap\n\n while (++index < node.children.length) {\n const child = node.children[index]\n /** @type {string | undefined} */\n let key\n\n if (state.passKeys) {\n const name =\n child.type === 'element'\n ? child.tagName\n : child.type === 'mdxJsxFlowElement' ||\n child.type === 'mdxJsxTextElement'\n ? child.name\n : undefined\n\n if (name) {\n const count = countsByName.get(name) || 0\n key = name + '-' + count\n countsByName.set(name, count + 1)\n }\n }\n\n const result = one(state, child, key)\n if (result !== undefined) children.push(result)\n }\n\n return children\n}\n\n/**\n * Handle a property.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} prop\n * Key.\n * @param {Array | boolean | number | string | null | undefined} value\n * hast property value.\n * @returns {Field | undefined}\n * Field for runtime, optional.\n */\nfunction createProperty(state, prop, value) {\n const info = find(state.schema, prop)\n\n // Ignore nullish and `NaN` values.\n if (\n value === null ||\n value === undefined ||\n (typeof value === 'number' && Number.isNaN(value))\n ) {\n return\n }\n\n if (Array.isArray(value)) {\n // Accept `array`.\n // Most props are space-separated.\n value = info.commaSeparated ? commas(value) : spaces(value)\n }\n\n // React only accepts `style` as object.\n if (info.property === 'style') {\n let styleObject =\n typeof value === 'object' ? value : parseStyle(state, String(value))\n\n if (state.stylePropertyNameCase === 'css') {\n styleObject = transformStylesToCssCasing(styleObject)\n }\n\n return ['style', styleObject]\n }\n\n return [\n state.elementAttributeNameCase === 'react' && info.space\n ? hastToReact[info.property] || info.property\n : info.attribute,\n value\n ]\n}\n\n/**\n * Parse a CSS declaration to an object.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} value\n * CSS declarations.\n * @returns {Style}\n * Properties.\n * @throws\n * Throws `VFileMessage` when CSS cannot be parsed.\n */\nfunction parseStyle(state, value) {\n /** @type {Style} */\n const result = {}\n\n try {\n // @ts-expect-error: `style-to-object` types are broken.\n styleToObject(value, replacer)\n } catch (error) {\n if (!state.ignoreInvalidStyle) {\n const cause = /** @type {Error} */ (error)\n const message = new VFileMessage('Cannot parse `style` attribute', {\n ancestors: state.ancestors,\n cause,\n ruleId: 'style',\n source: 'hast-util-to-jsx-runtime'\n })\n message.file = state.filePath || undefined\n message.url = docs + '#cannot-parse-style-attribute'\n\n throw message\n }\n }\n\n return result\n\n /**\n * Add a CSS property (normal, so with dashes) to `result` as a DOM CSS\n * property.\n *\n * @param {string} name\n * Key.\n * @param {string} value\n * Value\n * @returns {undefined}\n * Nothing.\n */\n function replacer(name, value) {\n let key = name\n\n if (key.slice(0, 2) !== '--') {\n if (key.slice(0, 4) === '-ms-') key = 'ms-' + key.slice(4)\n key = key.replace(dashSomething, toCamel)\n }\n\n result[key] = value\n }\n}\n\n/**\n * Create a JSX name from a string.\n *\n * @param {State} state\n * To do.\n * @param {string} name\n * Name.\n * @param {boolean} allowExpression\n * Allow member expressions and identifiers.\n * @returns {unknown}\n * To do.\n */\nfunction findComponentFromName(state, name, allowExpression) {\n /** @type {Identifier | Literal | MemberExpression} */\n let result\n\n if (!allowExpression) {\n result = {type: 'Literal', value: name}\n } else if (name.includes('.')) {\n const identifiers = name.split('.')\n let index = -1\n /** @type {Identifier | Literal | MemberExpression | undefined} */\n let node\n\n while (++index < identifiers.length) {\n /** @type {Identifier | Literal} */\n const prop = isIdentifierName(identifiers[index])\n ? {type: 'Identifier', name: identifiers[index]}\n : {type: 'Literal', value: identifiers[index]}\n node = node\n ? {\n type: 'MemberExpression',\n object: node,\n property: prop,\n computed: Boolean(index && prop.type === 'Literal'),\n optional: false\n }\n : prop\n }\n\n assert(node, 'always a result')\n result = node\n } else {\n result =\n isIdentifierName(name) && !/^[a-z]/.test(name)\n ? {type: 'Identifier', name}\n : {type: 'Literal', value: name}\n }\n\n // Only literals can be passed in `components` currently.\n // No identifiers / member expressions.\n if (result.type === 'Literal') {\n const name = /** @type {keyof JSX.IntrinsicElements} */ (result.value)\n\n return own.call(state.components, name) ? state.components[name] : name\n }\n\n // Assume component.\n if (state.evaluater) {\n return state.evaluater.evaluateExpression(result)\n }\n\n crashEstree(state)\n}\n\n/**\n * @param {State} state\n * @param {Position | undefined} [place]\n * @returns {never}\n */\nfunction crashEstree(state, place) {\n const message = new VFileMessage(\n 'Cannot handle MDX estrees without `createEvaluater`',\n {\n ancestors: state.ancestors,\n place,\n ruleId: 'mdx-estree',\n source: 'hast-util-to-jsx-runtime'\n }\n )\n message.file = state.filePath || undefined\n message.url = docs + '#cannot-handle-mdx-estrees-without-createevaluater'\n\n throw message\n}\n\n/**\n * Transform a DOM casing style object to a CSS casing style object.\n *\n * @param {Style} domCasing\n * @returns {Style}\n */\nfunction transformStylesToCssCasing(domCasing) {\n /** @type {Style} */\n const cssCasing = {}\n /** @type {string} */\n let from\n\n for (from in domCasing) {\n if (own.call(domCasing, from)) {\n cssCasing[transformStyleToCssCasing(from)] = domCasing[from]\n }\n }\n\n return cssCasing\n}\n\n/**\n * Transform a DOM casing style field to a CSS casing style field.\n *\n * @param {string} from\n * @returns {string}\n */\nfunction transformStyleToCssCasing(from) {\n let to = from.replace(cap, toDash)\n // Handle `ms-xxx` -> `-ms-xxx`.\n if (to.slice(0, 3) === 'ms-') to = '-' + to\n return to\n}\n\n/**\n * Make `$1` capitalized.\n *\n * @param {string} _\n * Whatever.\n * @param {string} $1\n * Single ASCII alphabetical.\n * @returns {string}\n * Capitalized `$1`.\n */\nfunction toCamel(_, $1) {\n return $1.toUpperCase()\n}\n\n/**\n * Make `$0` dash cased.\n *\n * @param {string} $0\n * Capitalized ASCII leter.\n * @returns {string}\n * Dash and lower letter.\n */\nfunction toDash($0) {\n return '-' + $0.toLowerCase()\n}\n","/**\n * HTML URL properties.\n *\n * Each key is a property name and each value is a list of tag names it applies\n * to or `null` if it applies to all elements.\n *\n * @type {Record | null>}\n */\nexport const urlAttributes = {\n action: ['form'],\n cite: ['blockquote', 'del', 'ins', 'q'],\n data: ['object'],\n formAction: ['button', 'input'],\n href: ['a', 'area', 'base', 'link'],\n icon: ['menuitem'],\n itemId: null,\n manifest: ['html'],\n ping: ['a', 'area'],\n poster: ['video'],\n src: [\n 'audio',\n 'embed',\n 'iframe',\n 'img',\n 'input',\n 'script',\n 'source',\n 'track',\n 'video'\n ]\n}\n","/**\n * @typedef {import('mdast').Nodes} Nodes\n *\n * @typedef Options\n * Configuration (optional).\n * @property {boolean | null | undefined} [includeImageAlt=true]\n * Whether to use `alt` for `image`s (default: `true`).\n * @property {boolean | null | undefined} [includeHtml=true]\n * Whether to use `value` of HTML (default: `true`).\n */\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Get the text content of a node or list of nodes.\n *\n * Prefers the node’s plain-text fields, otherwise serializes its children,\n * and if the given value is an array, serialize the nodes in it.\n *\n * @param {unknown} [value]\n * Thing to serialize, typically `Node`.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {string}\n * Serialized `value`.\n */\nexport function toString(value, options) {\n const settings = options || emptyOptions\n const includeImageAlt =\n typeof settings.includeImageAlt === 'boolean'\n ? settings.includeImageAlt\n : true\n const includeHtml =\n typeof settings.includeHtml === 'boolean' ? settings.includeHtml : true\n\n return one(value, includeImageAlt, includeHtml)\n}\n\n/**\n * One node or several nodes.\n *\n * @param {unknown} value\n * Thing to serialize.\n * @param {boolean} includeImageAlt\n * Include image `alt`s.\n * @param {boolean} includeHtml\n * Include HTML.\n * @returns {string}\n * Serialized node.\n */\nfunction one(value, includeImageAlt, includeHtml) {\n if (node(value)) {\n if ('value' in value) {\n return value.type === 'html' && !includeHtml ? '' : value.value\n }\n\n if (includeImageAlt && 'alt' in value && value.alt) {\n return value.alt\n }\n\n if ('children' in value) {\n return all(value.children, includeImageAlt, includeHtml)\n }\n }\n\n if (Array.isArray(value)) {\n return all(value, includeImageAlt, includeHtml)\n }\n\n return ''\n}\n\n/**\n * Serialize a list of nodes.\n *\n * @param {Array} values\n * Thing to serialize.\n * @param {boolean} includeImageAlt\n * Include image `alt`s.\n * @param {boolean} includeHtml\n * Include HTML.\n * @returns {string}\n * Serialized nodes.\n */\nfunction all(values, includeImageAlt, includeHtml) {\n /** @type {Array} */\n const result = []\n let index = -1\n\n while (++index < values.length) {\n result[index] = one(values[index], includeImageAlt, includeHtml)\n }\n\n return result.join('')\n}\n\n/**\n * Check if `value` looks like a node.\n *\n * @param {unknown} value\n * Thing.\n * @returns {value is Nodes}\n * Whether `value` is a node.\n */\nfunction node(value) {\n return Boolean(value && typeof value === 'object')\n}\n","/**\n * Like `Array#splice`, but smarter for giant arrays.\n *\n * `Array#splice` takes all items to be inserted as individual argument which\n * causes a stack overflow in V8 when trying to insert 100k items for instance.\n *\n * Otherwise, this does not return the removed items, and takes `items` as an\n * array instead of rest parameters.\n *\n * @template {unknown} T\n * Item type.\n * @param {Array} list\n * List to operate on.\n * @param {number} start\n * Index to remove/insert at (can be negative).\n * @param {number} remove\n * Number of items to remove.\n * @param {Array} items\n * Items to inject into `list`.\n * @returns {undefined}\n * Nothing.\n */\nexport function splice(list, start, remove, items) {\n const end = list.length\n let chunkStart = 0\n /** @type {Array} */\n let parameters\n\n // Make start between zero and `end` (included).\n if (start < 0) {\n start = -start > end ? 0 : end + start\n } else {\n start = start > end ? end : start\n }\n remove = remove > 0 ? remove : 0\n\n // No need to chunk the items if there’s only a couple (10k) items.\n if (items.length < 10000) {\n parameters = Array.from(items)\n parameters.unshift(start, remove)\n // @ts-expect-error Hush, it’s fine.\n list.splice(...parameters)\n } else {\n // Delete `remove` items starting from `start`\n if (remove) list.splice(start, remove)\n\n // Insert the items in chunks to not cause stack overflows.\n while (chunkStart < items.length) {\n parameters = items.slice(chunkStart, chunkStart + 10000)\n parameters.unshift(start, 0)\n // @ts-expect-error Hush, it’s fine.\n list.splice(...parameters)\n chunkStart += 10000\n start += 10000\n }\n }\n}\n\n/**\n * Append `items` (an array) at the end of `list` (another array).\n * When `list` was empty, returns `items` instead.\n *\n * This prevents a potentially expensive operation when `list` is empty,\n * and adds items in batches to prevent V8 from hanging.\n *\n * @template {unknown} T\n * Item type.\n * @param {Array} list\n * List to operate on.\n * @param {Array} items\n * Items to add to `list`.\n * @returns {Array}\n * Either `list` or `items`.\n */\nexport function push(list, items) {\n if (list.length > 0) {\n splice(list, list.length, 0, items)\n return list\n }\n return items\n}\n","/**\n * @typedef {import('micromark-util-types').Chunk} Chunk\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Token} Token\n */\n\nimport {splice} from 'micromark-util-chunked'\n/**\n * Tokenize subcontent.\n *\n * @param {Array} events\n * List of events.\n * @returns {boolean}\n * Whether subtokens were found.\n */ // eslint-disable-next-line complexity\nexport function subtokenize(events) {\n /** @type {Record} */\n const jumps = {}\n let index = -1\n /** @type {Event} */\n let event\n /** @type {number | undefined} */\n let lineIndex\n /** @type {number} */\n let otherIndex\n /** @type {Event} */\n let otherEvent\n /** @type {Array} */\n let parameters\n /** @type {Array} */\n let subevents\n /** @type {boolean | undefined} */\n let more\n while (++index < events.length) {\n while (index in jumps) {\n index = jumps[index]\n }\n event = events[index]\n\n // Add a hook for the GFM tasklist extension, which needs to know if text\n // is in the first content of a list item.\n if (\n index &&\n event[1].type === 'chunkFlow' &&\n events[index - 1][1].type === 'listItemPrefix'\n ) {\n subevents = event[1]._tokenizer.events\n otherIndex = 0\n if (\n otherIndex < subevents.length &&\n subevents[otherIndex][1].type === 'lineEndingBlank'\n ) {\n otherIndex += 2\n }\n if (\n otherIndex < subevents.length &&\n subevents[otherIndex][1].type === 'content'\n ) {\n while (++otherIndex < subevents.length) {\n if (subevents[otherIndex][1].type === 'content') {\n break\n }\n if (subevents[otherIndex][1].type === 'chunkText') {\n subevents[otherIndex][1]._isInFirstContentOfListItem = true\n otherIndex++\n }\n }\n }\n }\n\n // Enter.\n if (event[0] === 'enter') {\n if (event[1].contentType) {\n Object.assign(jumps, subcontent(events, index))\n index = jumps[index]\n more = true\n }\n }\n // Exit.\n else if (event[1]._container) {\n otherIndex = index\n lineIndex = undefined\n while (otherIndex--) {\n otherEvent = events[otherIndex]\n if (\n otherEvent[1].type === 'lineEnding' ||\n otherEvent[1].type === 'lineEndingBlank'\n ) {\n if (otherEvent[0] === 'enter') {\n if (lineIndex) {\n events[lineIndex][1].type = 'lineEndingBlank'\n }\n otherEvent[1].type = 'lineEnding'\n lineIndex = otherIndex\n }\n } else {\n break\n }\n }\n if (lineIndex) {\n // Fix position.\n event[1].end = Object.assign({}, events[lineIndex][1].start)\n\n // Switch container exit w/ line endings.\n parameters = events.slice(lineIndex, index)\n parameters.unshift(event)\n splice(events, lineIndex, index - lineIndex + 1, parameters)\n }\n }\n }\n return !more\n}\n\n/**\n * Tokenize embedded tokens.\n *\n * @param {Array} events\n * @param {number} eventIndex\n * @returns {Record}\n */\nfunction subcontent(events, eventIndex) {\n const token = events[eventIndex][1]\n const context = events[eventIndex][2]\n let startPosition = eventIndex - 1\n /** @type {Array} */\n const startPositions = []\n const tokenizer =\n token._tokenizer || context.parser[token.contentType](token.start)\n const childEvents = tokenizer.events\n /** @type {Array<[number, number]>} */\n const jumps = []\n /** @type {Record} */\n const gaps = {}\n /** @type {Array} */\n let stream\n /** @type {Token | undefined} */\n let previous\n let index = -1\n /** @type {Token | undefined} */\n let current = token\n let adjust = 0\n let start = 0\n const breaks = [start]\n\n // Loop forward through the linked tokens to pass them in order to the\n // subtokenizer.\n while (current) {\n // Find the position of the event for this token.\n while (events[++startPosition][1] !== current) {\n // Empty.\n }\n startPositions.push(startPosition)\n if (!current._tokenizer) {\n stream = context.sliceStream(current)\n if (!current.next) {\n stream.push(null)\n }\n if (previous) {\n tokenizer.defineSkip(current.start)\n }\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = true\n }\n tokenizer.write(stream)\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = undefined\n }\n }\n\n // Unravel the next token.\n previous = current\n current = current.next\n }\n\n // Now, loop back through all events (and linked tokens), to figure out which\n // parts belong where.\n current = token\n while (++index < childEvents.length) {\n if (\n // Find a void token that includes a break.\n childEvents[index][0] === 'exit' &&\n childEvents[index - 1][0] === 'enter' &&\n childEvents[index][1].type === childEvents[index - 1][1].type &&\n childEvents[index][1].start.line !== childEvents[index][1].end.line\n ) {\n start = index + 1\n breaks.push(start)\n // Help GC.\n current._tokenizer = undefined\n current.previous = undefined\n current = current.next\n }\n }\n\n // Help GC.\n tokenizer.events = []\n\n // If there’s one more token (which is the cases for lines that end in an\n // EOF), that’s perfect: the last point we found starts it.\n // If there isn’t then make sure any remaining content is added to it.\n if (current) {\n // Help GC.\n current._tokenizer = undefined\n current.previous = undefined\n } else {\n breaks.pop()\n }\n\n // Now splice the events from the subtokenizer into the current events,\n // moving back to front so that splice indices aren’t affected.\n index = breaks.length\n while (index--) {\n const slice = childEvents.slice(breaks[index], breaks[index + 1])\n const start = startPositions.pop()\n jumps.unshift([start, start + slice.length - 1])\n splice(events, start, 2, slice)\n }\n index = -1\n while (++index < jumps.length) {\n gaps[adjust + jumps[index][0]] = adjust + jumps[index][1]\n adjust += jumps[index][1] - jumps[index][0] - 1\n }\n return gaps\n}\n","/**\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Handles} Handles\n * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension\n * @typedef {import('micromark-util-types').NormalizedExtension} NormalizedExtension\n */\n\nimport {splice} from 'micromark-util-chunked'\n\nconst hasOwnProperty = {}.hasOwnProperty\n\n/**\n * Combine multiple syntax extensions into one.\n *\n * @param {Array} extensions\n * List of syntax extensions.\n * @returns {NormalizedExtension}\n * A single combined extension.\n */\nexport function combineExtensions(extensions) {\n /** @type {NormalizedExtension} */\n const all = {}\n let index = -1\n\n while (++index < extensions.length) {\n syntaxExtension(all, extensions[index])\n }\n\n return all\n}\n\n/**\n * Merge `extension` into `all`.\n *\n * @param {NormalizedExtension} all\n * Extension to merge into.\n * @param {Extension} extension\n * Extension to merge.\n * @returns {undefined}\n */\nfunction syntaxExtension(all, extension) {\n /** @type {keyof Extension} */\n let hook\n\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined\n /** @type {Record} */\n const left = maybe || (all[hook] = {})\n /** @type {Record | undefined} */\n const right = extension[hook]\n /** @type {string} */\n let code\n\n if (right) {\n for (code in right) {\n if (!hasOwnProperty.call(left, code)) left[code] = []\n const value = right[code]\n constructs(\n // @ts-expect-error Looks like a list.\n left[code],\n Array.isArray(value) ? value : value ? [value] : []\n )\n }\n }\n }\n}\n\n/**\n * Merge `list` into `existing` (both lists of constructs).\n * Mutates `existing`.\n *\n * @param {Array} existing\n * @param {Array} list\n * @returns {undefined}\n */\nfunction constructs(existing, list) {\n let index = -1\n /** @type {Array} */\n const before = []\n\n while (++index < list.length) {\n // @ts-expect-error Looks like an object.\n ;(list[index].add === 'after' ? existing : before).push(list[index])\n }\n\n splice(existing, 0, 0, before)\n}\n\n/**\n * Combine multiple HTML extensions into one.\n *\n * @param {Array} htmlExtensions\n * List of HTML extensions.\n * @returns {HtmlExtension}\n * A single combined HTML extension.\n */\nexport function combineHtmlExtensions(htmlExtensions) {\n /** @type {HtmlExtension} */\n const handlers = {}\n let index = -1\n\n while (++index < htmlExtensions.length) {\n htmlExtension(handlers, htmlExtensions[index])\n }\n\n return handlers\n}\n\n/**\n * Merge `extension` into `all`.\n *\n * @param {HtmlExtension} all\n * Extension to merge into.\n * @param {HtmlExtension} extension\n * Extension to merge.\n * @returns {undefined}\n */\nfunction htmlExtension(all, extension) {\n /** @type {keyof HtmlExtension} */\n let hook\n\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined\n const left = maybe || (all[hook] = {})\n const right = extension[hook]\n /** @type {keyof Handles} */\n let type\n\n if (right) {\n for (type in right) {\n // @ts-expect-error assume document vs regular handler are managed correctly.\n left[type] = right[type]\n }\n }\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n */\n\nconst unicodePunctuationInternal = regexCheck(/\\p{P}/u)\n\n/**\n * Check whether the character code represents an ASCII alpha (`a` through `z`,\n * case insensitive).\n *\n * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.\n *\n * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)\n * to U+005A (`Z`).\n *\n * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)\n * to U+007A (`z`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAlpha = regexCheck(/[A-Za-z]/)\n\n/**\n * Check whether the character code represents an ASCII alphanumeric (`a`\n * through `z`, case insensitive, or `0` through `9`).\n *\n * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha\n * (see `asciiAlpha`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAlphanumeric = regexCheck(/[\\dA-Za-z]/)\n\n/**\n * Check whether the character code represents an ASCII atext.\n *\n * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in\n * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),\n * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F\n * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E\n * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE\n * (`{`) to U+007E TILDE (`~`).\n *\n * See:\n * **\\[RFC5322]**:\n * [Internet Message Format](https://tools.ietf.org/html/rfc5322).\n * P. Resnick.\n * IETF.\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAtext = regexCheck(/[#-'*+\\--9=?A-Z^-~]/)\n\n/**\n * Check whether a character code is an ASCII control character.\n *\n * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)\n * to U+001F (US), or U+007F (DEL).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function asciiControl(code) {\n return (\n // Special whitespace codes (which have negative values), C0 and Control\n // character DEL\n code !== null && (code < 32 || code === 127)\n )\n}\n\n/**\n * Check whether the character code represents an ASCII digit (`0` through `9`).\n *\n * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to\n * U+0039 (`9`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiDigit = regexCheck(/\\d/)\n\n/**\n * Check whether the character code represents an ASCII hex digit (`a` through\n * `f`, case insensitive, or `0` through `9`).\n *\n * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex\n * digit, or an ASCII lower hex digit.\n *\n * An **ASCII upper hex digit** is a character in the inclusive range U+0041\n * (`A`) to U+0046 (`F`).\n *\n * An **ASCII lower hex digit** is a character in the inclusive range U+0061\n * (`a`) to U+0066 (`f`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiHexDigit = regexCheck(/[\\dA-Fa-f]/)\n\n/**\n * Check whether the character code represents ASCII punctuation.\n *\n * An **ASCII punctuation** is a character in the inclusive ranges U+0021\n * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT\n * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT\n * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/)\n\n/**\n * Check whether a character code is a markdown line ending.\n *\n * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN\n * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).\n *\n * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE\n * RETURN (CR) are replaced by these virtual characters depending on whether\n * they occurred together.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEnding(code) {\n return code !== null && code < -2\n}\n\n/**\n * Check whether a character code is a markdown line ending (see\n * `markdownLineEnding`) or markdown space (see `markdownSpace`).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEndingOrSpace(code) {\n return code !== null && (code < 0 || code === 32)\n}\n\n/**\n * Check whether a character code is a markdown space.\n *\n * A **markdown space** is the concrete character U+0020 SPACE (SP) and the\n * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).\n *\n * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is\n * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL\n * SPACE (VS) characters, depending on the column at which the tab occurred.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownSpace(code) {\n return code === -2 || code === -1 || code === 32\n}\n\n// Size note: removing ASCII from the regex and using `asciiPunctuation` here\n// In fact adds to the bundle size.\n/**\n * Check whether the character code represents Unicode punctuation.\n *\n * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,\n * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`\n * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`\n * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII\n * punctuation (see `asciiPunctuation`).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function unicodePunctuation(code) {\n return asciiPunctuation(code) || unicodePunctuationInternal(code)\n}\n\n/**\n * Check whether the character code represents Unicode whitespace.\n *\n * Note that this does handle micromark specific markdown whitespace characters.\n * See `markdownLineEndingOrSpace` to check that.\n *\n * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,\n * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),\n * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\\[UNICODE]**).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const unicodeWhitespace = regexCheck(/\\s/)\n\n/**\n * Create a code check from a regex.\n *\n * @param {RegExp} regex\n * @returns {(code: Code) => boolean}\n */\nfunction regexCheck(regex) {\n return check\n\n /**\n * Check whether a code matches the bound regex.\n *\n * @param {Code} code\n * Character code.\n * @returns {boolean}\n * Whether the character code matches the bound regex.\n */\n function check(code) {\n return code !== null && code > -1 && regex.test(String.fromCharCode(code))\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenType} TokenType\n */\n\nimport {markdownSpace} from 'micromark-util-character'\n\n// To do: implement `spaceOrTab`, `spaceOrTabMinMax`, `spaceOrTabWithOptions`.\n\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * spaces in markdown are often optional, in which case this factory can be\n * used and `ok` will be switched to whether spaces were found or not\n * * one line ending or space can be detected with `markdownSpace(code)` right\n * before using `factorySpace`\n *\n * ###### Examples\n *\n * Where `␉` represents a tab (plus how much it expands) and `␠` represents a\n * single space.\n *\n * ```markdown\n * ␉\n * ␠␠␠␠\n * ␉␠\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {TokenType} type\n * Type (`' \\t'`).\n * @param {number | undefined} [max=Infinity]\n * Max (exclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpace(effects, ok, type, max) {\n const limit = max ? max - 1 : Number.POSITIVE_INFINITY\n let size = 0\n return start\n\n /** @type {State} */\n function start(code) {\n if (markdownSpace(code)) {\n effects.enter(type)\n return prefix(code)\n }\n return ok(code)\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size++ < limit) {\n effects.consume(code)\n return prefix\n }\n effects.exit(type)\n return ok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').Initializer} Initializer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\n/** @type {InitialConstruct} */\nexport const content = {\n tokenize: initializeContent\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Initializer}\n */\nfunction initializeContent(effects) {\n const contentStart = effects.attempt(\n this.parser.constructs.contentInitial,\n afterContentStartConstruct,\n paragraphInitial\n )\n /** @type {Token} */\n let previous\n return contentStart\n\n /** @type {State} */\n function afterContentStartConstruct(code) {\n if (code === null) {\n effects.consume(code)\n return\n }\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, contentStart, 'linePrefix')\n }\n\n /** @type {State} */\n function paragraphInitial(code) {\n effects.enter('paragraph')\n return lineStart(code)\n }\n\n /** @type {State} */\n function lineStart(code) {\n const token = effects.enter('chunkText', {\n contentType: 'text',\n previous\n })\n if (previous) {\n previous.next = token\n }\n previous = token\n return data(code)\n }\n\n /** @type {State} */\n function data(code) {\n if (code === null) {\n effects.exit('chunkText')\n effects.exit('paragraph')\n effects.consume(code)\n return\n }\n if (markdownLineEnding(code)) {\n effects.consume(code)\n effects.exit('chunkText')\n return lineStart\n }\n\n // Data.\n effects.consume(code)\n return data\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').ContainerState} ContainerState\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').Initializer} Initializer\n * @typedef {import('micromark-util-types').Point} Point\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\n/**\n * @typedef {[Construct, ContainerState]} StackItem\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\nimport {splice} from 'micromark-util-chunked'\n/** @type {InitialConstruct} */\nexport const document = {\n tokenize: initializeDocument\n}\n\n/** @type {Construct} */\nconst containerConstruct = {\n tokenize: tokenizeContainer\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Initializer}\n */\nfunction initializeDocument(effects) {\n const self = this\n /** @type {Array} */\n const stack = []\n let continued = 0\n /** @type {TokenizeContext | undefined} */\n let childFlow\n /** @type {Token | undefined} */\n let childToken\n /** @type {number} */\n let lineStartOffset\n return start\n\n /** @type {State} */\n function start(code) {\n // First we iterate through the open blocks, starting with the root\n // document, and descending through last children down to the last open\n // block.\n // Each block imposes a condition that the line must satisfy if the block is\n // to remain open.\n // For example, a block quote requires a `>` character.\n // A paragraph requires a non-blank line.\n // In this phase we may match all or just some of the open blocks.\n // But we cannot close unmatched blocks yet, because we may have a lazy\n // continuation line.\n if (continued < stack.length) {\n const item = stack[continued]\n self.containerState = item[1]\n return effects.attempt(\n item[0].continuation,\n documentContinue,\n checkNewContainers\n )(code)\n }\n\n // Done.\n return checkNewContainers(code)\n }\n\n /** @type {State} */\n function documentContinue(code) {\n continued++\n\n // Note: this field is called `_closeFlow` but it also closes containers.\n // Perhaps a good idea to rename it but it’s already used in the wild by\n // extensions.\n if (self.containerState._closeFlow) {\n self.containerState._closeFlow = undefined\n if (childFlow) {\n closeFlow()\n }\n\n // Note: this algorithm for moving events around is similar to the\n // algorithm when dealing with lazy lines in `writeToChild`.\n const indexBeforeExits = self.events.length\n let indexBeforeFlow = indexBeforeExits\n /** @type {Point | undefined} */\n let point\n\n // Find the flow chunk.\n while (indexBeforeFlow--) {\n if (\n self.events[indexBeforeFlow][0] === 'exit' &&\n self.events[indexBeforeFlow][1].type === 'chunkFlow'\n ) {\n point = self.events[indexBeforeFlow][1].end\n break\n }\n }\n exitContainers(continued)\n\n // Fix positions.\n let index = indexBeforeExits\n while (index < self.events.length) {\n self.events[index][1].end = Object.assign({}, point)\n index++\n }\n\n // Inject the exits earlier (they’re still also at the end).\n splice(\n self.events,\n indexBeforeFlow + 1,\n 0,\n self.events.slice(indexBeforeExits)\n )\n\n // Discard the duplicate exits.\n self.events.length = index\n return checkNewContainers(code)\n }\n return start(code)\n }\n\n /** @type {State} */\n function checkNewContainers(code) {\n // Next, after consuming the continuation markers for existing blocks, we\n // look for new block starts (e.g. `>` for a block quote).\n // If we encounter a new block start, we close any blocks unmatched in\n // step 1 before creating the new block as a child of the last matched\n // block.\n if (continued === stack.length) {\n // No need to `check` whether there’s a container, of `exitContainers`\n // would be moot.\n // We can instead immediately `attempt` to parse one.\n if (!childFlow) {\n return documentContinued(code)\n }\n\n // If we have concrete content, such as block HTML or fenced code,\n // we can’t have containers “pierce” into them, so we can immediately\n // start.\n if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {\n return flowStart(code)\n }\n\n // If we do have flow, it could still be a blank line,\n // but we’d be interrupting it w/ a new container if there’s a current\n // construct.\n // To do: next major: remove `_gfmTableDynamicInterruptHack` (no longer\n // needed in micromark-extension-gfm-table@1.0.6).\n self.interrupt = Boolean(\n childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack\n )\n }\n\n // Check if there is a new container.\n self.containerState = {}\n return effects.check(\n containerConstruct,\n thereIsANewContainer,\n thereIsNoNewContainer\n )(code)\n }\n\n /** @type {State} */\n function thereIsANewContainer(code) {\n if (childFlow) closeFlow()\n exitContainers(continued)\n return documentContinued(code)\n }\n\n /** @type {State} */\n function thereIsNoNewContainer(code) {\n self.parser.lazy[self.now().line] = continued !== stack.length\n lineStartOffset = self.now().offset\n return flowStart(code)\n }\n\n /** @type {State} */\n function documentContinued(code) {\n // Try new containers.\n self.containerState = {}\n return effects.attempt(\n containerConstruct,\n containerContinue,\n flowStart\n )(code)\n }\n\n /** @type {State} */\n function containerContinue(code) {\n continued++\n stack.push([self.currentConstruct, self.containerState])\n // Try another.\n return documentContinued(code)\n }\n\n /** @type {State} */\n function flowStart(code) {\n if (code === null) {\n if (childFlow) closeFlow()\n exitContainers(0)\n effects.consume(code)\n return\n }\n childFlow = childFlow || self.parser.flow(self.now())\n effects.enter('chunkFlow', {\n contentType: 'flow',\n previous: childToken,\n _tokenizer: childFlow\n })\n return flowContinue(code)\n }\n\n /** @type {State} */\n function flowContinue(code) {\n if (code === null) {\n writeToChild(effects.exit('chunkFlow'), true)\n exitContainers(0)\n effects.consume(code)\n return\n }\n if (markdownLineEnding(code)) {\n effects.consume(code)\n writeToChild(effects.exit('chunkFlow'))\n // Get ready for the next line.\n continued = 0\n self.interrupt = undefined\n return start\n }\n effects.consume(code)\n return flowContinue\n }\n\n /**\n * @param {Token} token\n * @param {boolean | undefined} [eof]\n * @returns {undefined}\n */\n function writeToChild(token, eof) {\n const stream = self.sliceStream(token)\n if (eof) stream.push(null)\n token.previous = childToken\n if (childToken) childToken.next = token\n childToken = token\n childFlow.defineSkip(token.start)\n childFlow.write(stream)\n\n // Alright, so we just added a lazy line:\n //\n // ```markdown\n // > a\n // b.\n //\n // Or:\n //\n // > ~~~c\n // d\n //\n // Or:\n //\n // > | e |\n // f\n // ```\n //\n // The construct in the second example (fenced code) does not accept lazy\n // lines, so it marked itself as done at the end of its first line, and\n // then the content construct parses `d`.\n // Most constructs in markdown match on the first line: if the first line\n // forms a construct, a non-lazy line can’t “unmake” it.\n //\n // The construct in the third example is potentially a GFM table, and\n // those are *weird*.\n // It *could* be a table, from the first line, if the following line\n // matches a condition.\n // In this case, that second line is lazy, which “unmakes” the first line\n // and turns the whole into one content block.\n //\n // We’ve now parsed the non-lazy and the lazy line, and can figure out\n // whether the lazy line started a new flow block.\n // If it did, we exit the current containers between the two flow blocks.\n if (self.parser.lazy[token.start.line]) {\n let index = childFlow.events.length\n while (index--) {\n if (\n // The token starts before the line ending…\n childFlow.events[index][1].start.offset < lineStartOffset &&\n // …and either is not ended yet…\n (!childFlow.events[index][1].end ||\n // …or ends after it.\n childFlow.events[index][1].end.offset > lineStartOffset)\n ) {\n // Exit: there’s still something open, which means it’s a lazy line\n // part of something.\n return\n }\n }\n\n // Note: this algorithm for moving events around is similar to the\n // algorithm when closing flow in `documentContinue`.\n const indexBeforeExits = self.events.length\n let indexBeforeFlow = indexBeforeExits\n /** @type {boolean | undefined} */\n let seen\n /** @type {Point | undefined} */\n let point\n\n // Find the previous chunk (the one before the lazy line).\n while (indexBeforeFlow--) {\n if (\n self.events[indexBeforeFlow][0] === 'exit' &&\n self.events[indexBeforeFlow][1].type === 'chunkFlow'\n ) {\n if (seen) {\n point = self.events[indexBeforeFlow][1].end\n break\n }\n seen = true\n }\n }\n exitContainers(continued)\n\n // Fix positions.\n index = indexBeforeExits\n while (index < self.events.length) {\n self.events[index][1].end = Object.assign({}, point)\n index++\n }\n\n // Inject the exits earlier (they’re still also at the end).\n splice(\n self.events,\n indexBeforeFlow + 1,\n 0,\n self.events.slice(indexBeforeExits)\n )\n\n // Discard the duplicate exits.\n self.events.length = index\n }\n }\n\n /**\n * @param {number} size\n * @returns {undefined}\n */\n function exitContainers(size) {\n let index = stack.length\n\n // Exit open containers.\n while (index-- > size) {\n const entry = stack[index]\n self.containerState = entry[1]\n entry[0].exit.call(self, effects)\n }\n stack.length = size\n }\n function closeFlow() {\n childFlow.write([null])\n childToken = undefined\n childFlow = undefined\n self.containerState._closeFlow = undefined\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeContainer(effects, ok, nok) {\n // Always populated by defaults.\n\n return factorySpace(\n effects,\n effects.attempt(this.parser.constructs.document, ok, nok),\n 'linePrefix',\n this.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4\n )\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding, markdownSpace} from 'micromark-util-character'\n/** @type {Construct} */\nexport const blankLine = {\n tokenize: tokenizeBlankLine,\n partial: true\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLine(effects, ok, nok) {\n return start\n\n /**\n * Start of blank line.\n *\n * > 👉 **Note**: `␠` represents a space character.\n *\n * ```markdown\n * > | ␠␠␊\n * ^\n * > | ␊\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n return markdownSpace(code)\n ? factorySpace(effects, after, 'linePrefix')(code)\n : after(code)\n }\n\n /**\n * At eof/eol, after optional whitespace.\n *\n * > 👉 **Note**: `␠` represents a space character.\n *\n * ```markdown\n * > | ␠␠␊\n * ^\n * > | ␊\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\nimport {subtokenize} from 'micromark-util-subtokenize'\n/**\n * No name because it must not be turned off.\n * @type {Construct}\n */\nexport const content = {\n tokenize: tokenizeContent,\n resolve: resolveContent\n}\n\n/** @type {Construct} */\nconst continuationConstruct = {\n tokenize: tokenizeContinuation,\n partial: true\n}\n\n/**\n * Content is transparent: it’s parsed right now. That way, definitions are also\n * parsed right now: before text in paragraphs (specifically, media) are parsed.\n *\n * @type {Resolver}\n */\nfunction resolveContent(events) {\n subtokenize(events)\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeContent(effects, ok) {\n /** @type {Token | undefined} */\n let previous\n return chunkStart\n\n /**\n * Before a content chunk.\n *\n * ```markdown\n * > | abc\n * ^\n * ```\n *\n * @type {State}\n */\n function chunkStart(code) {\n effects.enter('content')\n previous = effects.enter('chunkContent', {\n contentType: 'content'\n })\n return chunkInside(code)\n }\n\n /**\n * In a content chunk.\n *\n * ```markdown\n * > | abc\n * ^^^\n * ```\n *\n * @type {State}\n */\n function chunkInside(code) {\n if (code === null) {\n return contentEnd(code)\n }\n\n // To do: in `markdown-rs`, each line is parsed on its own, and everything\n // is stitched together resolving.\n if (markdownLineEnding(code)) {\n return effects.check(\n continuationConstruct,\n contentContinue,\n contentEnd\n )(code)\n }\n\n // Data.\n effects.consume(code)\n return chunkInside\n }\n\n /**\n *\n *\n * @type {State}\n */\n function contentEnd(code) {\n effects.exit('chunkContent')\n effects.exit('content')\n return ok(code)\n }\n\n /**\n *\n *\n * @type {State}\n */\n function contentContinue(code) {\n effects.consume(code)\n effects.exit('chunkContent')\n previous.next = effects.enter('chunkContent', {\n contentType: 'content',\n previous\n })\n previous = previous.next\n return chunkInside\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeContinuation(effects, ok, nok) {\n const self = this\n return startLookahead\n\n /**\n *\n *\n * @type {State}\n */\n function startLookahead(code) {\n effects.exit('chunkContent')\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, prefixed, 'linePrefix')\n }\n\n /**\n *\n *\n * @type {State}\n */\n function prefixed(code) {\n if (code === null || markdownLineEnding(code)) {\n return nok(code)\n }\n\n // Always populated by defaults.\n\n const tail = self.events[self.events.length - 1]\n if (\n !self.parser.constructs.disable.null.includes('codeIndented') &&\n tail &&\n tail[1].type === 'linePrefix' &&\n tail[2].sliceSerialize(tail[1], true).length >= 4\n ) {\n return ok(code)\n }\n return effects.interrupt(self.parser.constructs.flow, nok, ok)(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').Initializer} Initializer\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n */\n\nimport {blankLine, content} from 'micromark-core-commonmark'\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\n/** @type {InitialConstruct} */\nexport const flow = {\n tokenize: initializeFlow\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Initializer}\n */\nfunction initializeFlow(effects) {\n const self = this\n const initial = effects.attempt(\n // Try to parse a blank line.\n blankLine,\n atBlankEnding,\n // Try to parse initial flow (essentially, only code).\n effects.attempt(\n this.parser.constructs.flowInitial,\n afterConstruct,\n factorySpace(\n effects,\n effects.attempt(\n this.parser.constructs.flow,\n afterConstruct,\n effects.attempt(content, afterConstruct)\n ),\n 'linePrefix'\n )\n )\n )\n return initial\n\n /** @type {State} */\n function atBlankEnding(code) {\n if (code === null) {\n effects.consume(code)\n return\n }\n effects.enter('lineEndingBlank')\n effects.consume(code)\n effects.exit('lineEndingBlank')\n self.currentConstruct = undefined\n return initial\n }\n\n /** @type {State} */\n function afterConstruct(code) {\n if (code === null) {\n effects.consume(code)\n return\n }\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n self.currentConstruct = undefined\n return initial\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').Initializer} Initializer\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n */\n\nexport const resolver = {\n resolveAll: createResolver()\n}\nexport const string = initializeFactory('string')\nexport const text = initializeFactory('text')\n\n/**\n * @param {'string' | 'text'} field\n * @returns {InitialConstruct}\n */\nfunction initializeFactory(field) {\n return {\n tokenize: initializeText,\n resolveAll: createResolver(\n field === 'text' ? resolveAllLineSuffixes : undefined\n )\n }\n\n /**\n * @this {TokenizeContext}\n * @type {Initializer}\n */\n function initializeText(effects) {\n const self = this\n const constructs = this.parser.constructs[field]\n const text = effects.attempt(constructs, start, notText)\n return start\n\n /** @type {State} */\n function start(code) {\n return atBreak(code) ? text(code) : notText(code)\n }\n\n /** @type {State} */\n function notText(code) {\n if (code === null) {\n effects.consume(code)\n return\n }\n effects.enter('data')\n effects.consume(code)\n return data\n }\n\n /** @type {State} */\n function data(code) {\n if (atBreak(code)) {\n effects.exit('data')\n return text(code)\n }\n\n // Data.\n effects.consume(code)\n return data\n }\n\n /**\n * @param {Code} code\n * @returns {boolean}\n */\n function atBreak(code) {\n if (code === null) {\n return true\n }\n const list = constructs[code]\n let index = -1\n if (list) {\n // Always populated by defaults.\n\n while (++index < list.length) {\n const item = list[index]\n if (!item.previous || item.previous.call(self, self.previous)) {\n return true\n }\n }\n }\n return false\n }\n }\n}\n\n/**\n * @param {Resolver | undefined} [extraResolver]\n * @returns {Resolver}\n */\nfunction createResolver(extraResolver) {\n return resolveAllText\n\n /** @type {Resolver} */\n function resolveAllText(events, context) {\n let index = -1\n /** @type {number | undefined} */\n let enter\n\n // A rather boring computation (to merge adjacent `data` events) which\n // improves mm performance by 29%.\n while (++index <= events.length) {\n if (enter === undefined) {\n if (events[index] && events[index][1].type === 'data') {\n enter = index\n index++\n }\n } else if (!events[index] || events[index][1].type !== 'data') {\n // Don’t do anything if there is one data token.\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end\n events.splice(enter + 2, index - enter - 2)\n index = enter + 2\n }\n enter = undefined\n }\n }\n return extraResolver ? extraResolver(events, context) : events\n }\n}\n\n/**\n * A rather ugly set of instructions which again looks at chunks in the input\n * stream.\n * The reason to do this here is that it is *much* faster to parse in reverse.\n * And that we can’t hook into `null` to split the line suffix before an EOF.\n * To do: figure out if we can make this into a clean utility, or even in core.\n * As it will be useful for GFMs literal autolink extension (and maybe even\n * tables?)\n *\n * @type {Resolver}\n */\nfunction resolveAllLineSuffixes(events, context) {\n let eventIndex = 0 // Skip first.\n\n while (++eventIndex <= events.length) {\n if (\n (eventIndex === events.length ||\n events[eventIndex][1].type === 'lineEnding') &&\n events[eventIndex - 1][1].type === 'data'\n ) {\n const data = events[eventIndex - 1][1]\n const chunks = context.sliceStream(data)\n let index = chunks.length\n let bufferIndex = -1\n let size = 0\n /** @type {boolean | undefined} */\n let tabs\n while (index--) {\n const chunk = chunks[index]\n if (typeof chunk === 'string') {\n bufferIndex = chunk.length\n while (chunk.charCodeAt(bufferIndex - 1) === 32) {\n size++\n bufferIndex--\n }\n if (bufferIndex) break\n bufferIndex = -1\n }\n // Number\n else if (chunk === -2) {\n tabs = true\n size++\n } else if (chunk === -1) {\n // Empty\n } else {\n // Replacement character, exit.\n index++\n break\n }\n }\n if (size) {\n const token = {\n type:\n eventIndex === events.length || tabs || size < 2\n ? 'lineSuffix'\n : 'hardBreakTrailing',\n start: {\n line: data.end.line,\n column: data.end.column - size,\n offset: data.end.offset - size,\n _index: data.start._index + index,\n _bufferIndex: index\n ? bufferIndex\n : data.start._bufferIndex + bufferIndex\n },\n end: Object.assign({}, data.end)\n }\n data.end = Object.assign({}, token.start)\n if (data.start.offset === data.end.offset) {\n Object.assign(data, token)\n } else {\n events.splice(\n eventIndex,\n 0,\n ['enter', token, context],\n ['exit', token, context]\n )\n eventIndex += 2\n }\n }\n eventIndex++\n }\n }\n return events\n}\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n */\n\n/**\n * Call all `resolveAll`s.\n *\n * @param {Array<{resolveAll?: Resolver | undefined}>} constructs\n * List of constructs, optionally with `resolveAll`s.\n * @param {Array} events\n * List of events.\n * @param {TokenizeContext} context\n * Context used by `tokenize`.\n * @returns {Array}\n * Changed events.\n */\nexport function resolveAll(constructs, events, context) {\n /** @type {Array} */\n const called = []\n let index = -1\n\n while (++index < constructs.length) {\n const resolve = constructs[index].resolveAll\n\n if (resolve && !called.includes(resolve)) {\n events = resolve(events, context)\n called.push(resolve)\n }\n }\n\n return events\n}\n","/**\n * @typedef {import('micromark-util-types').Chunk} Chunk\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').ParseContext} ParseContext\n * @typedef {import('micromark-util-types').Point} Point\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenType} TokenType\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n */\n\n/**\n * @callback Restore\n * @returns {undefined}\n *\n * @typedef Info\n * @property {Restore} restore\n * @property {number} from\n *\n * @callback ReturnHandle\n * Handle a successful run.\n * @param {Construct} construct\n * @param {Info} info\n * @returns {undefined}\n */\n\nimport {markdownLineEnding} from 'micromark-util-character'\nimport {push, splice} from 'micromark-util-chunked'\nimport {resolveAll} from 'micromark-util-resolve-all'\n/**\n * Create a tokenizer.\n * Tokenizers deal with one type of data (e.g., containers, flow, text).\n * The parser is the object dealing with it all.\n * `initialize` works like other constructs, except that only its `tokenize`\n * function is used, in which case it doesn’t receive an `ok` or `nok`.\n * `from` can be given to set the point before the first character, although\n * when further lines are indented, they must be set with `defineSkip`.\n *\n * @param {ParseContext} parser\n * @param {InitialConstruct} initialize\n * @param {Omit | undefined} [from]\n * @returns {TokenizeContext}\n */\nexport function createTokenizer(parser, initialize, from) {\n /** @type {Point} */\n let point = Object.assign(\n from\n ? Object.assign({}, from)\n : {\n line: 1,\n column: 1,\n offset: 0\n },\n {\n _index: 0,\n _bufferIndex: -1\n }\n )\n /** @type {Record} */\n const columnStart = {}\n /** @type {Array} */\n const resolveAllConstructs = []\n /** @type {Array} */\n let chunks = []\n /** @type {Array} */\n let stack = []\n /** @type {boolean | undefined} */\n let consumed = true\n\n /**\n * Tools used for tokenizing.\n *\n * @type {Effects}\n */\n const effects = {\n consume,\n enter,\n exit,\n attempt: constructFactory(onsuccessfulconstruct),\n check: constructFactory(onsuccessfulcheck),\n interrupt: constructFactory(onsuccessfulcheck, {\n interrupt: true\n })\n }\n\n /**\n * State and tools for resolving and serializing.\n *\n * @type {TokenizeContext}\n */\n const context = {\n previous: null,\n code: null,\n containerState: {},\n events: [],\n parser,\n sliceStream,\n sliceSerialize,\n now,\n defineSkip,\n write\n }\n\n /**\n * The state function.\n *\n * @type {State | undefined}\n */\n let state = initialize.tokenize.call(context, effects)\n\n /**\n * Track which character we expect to be consumed, to catch bugs.\n *\n * @type {Code}\n */\n let expectedCode\n if (initialize.resolveAll) {\n resolveAllConstructs.push(initialize)\n }\n return context\n\n /** @type {TokenizeContext['write']} */\n function write(slice) {\n chunks = push(chunks, slice)\n main()\n\n // Exit if we’re not done, resolve might change stuff.\n if (chunks[chunks.length - 1] !== null) {\n return []\n }\n addResult(initialize, 0)\n\n // Otherwise, resolve, and exit.\n context.events = resolveAll(resolveAllConstructs, context.events, context)\n return context.events\n }\n\n //\n // Tools.\n //\n\n /** @type {TokenizeContext['sliceSerialize']} */\n function sliceSerialize(token, expandTabs) {\n return serializeChunks(sliceStream(token), expandTabs)\n }\n\n /** @type {TokenizeContext['sliceStream']} */\n function sliceStream(token) {\n return sliceChunks(chunks, token)\n }\n\n /** @type {TokenizeContext['now']} */\n function now() {\n // This is a hot path, so we clone manually instead of `Object.assign({}, point)`\n const {line, column, offset, _index, _bufferIndex} = point\n return {\n line,\n column,\n offset,\n _index,\n _bufferIndex\n }\n }\n\n /** @type {TokenizeContext['defineSkip']} */\n function defineSkip(value) {\n columnStart[value.line] = value.column\n accountForPotentialSkip()\n }\n\n //\n // State management.\n //\n\n /**\n * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by\n * `consume`).\n * Here is where we walk through the chunks, which either include strings of\n * several characters, or numerical character codes.\n * The reason to do this in a loop instead of a call is so the stack can\n * drain.\n *\n * @returns {undefined}\n */\n function main() {\n /** @type {number} */\n let chunkIndex\n while (point._index < chunks.length) {\n const chunk = chunks[point._index]\n\n // If we’re in a buffer chunk, loop through it.\n if (typeof chunk === 'string') {\n chunkIndex = point._index\n if (point._bufferIndex < 0) {\n point._bufferIndex = 0\n }\n while (\n point._index === chunkIndex &&\n point._bufferIndex < chunk.length\n ) {\n go(chunk.charCodeAt(point._bufferIndex))\n }\n } else {\n go(chunk)\n }\n }\n }\n\n /**\n * Deal with one code.\n *\n * @param {Code} code\n * @returns {undefined}\n */\n function go(code) {\n consumed = undefined\n expectedCode = code\n state = state(code)\n }\n\n /** @type {Effects['consume']} */\n function consume(code) {\n if (markdownLineEnding(code)) {\n point.line++\n point.column = 1\n point.offset += code === -3 ? 2 : 1\n accountForPotentialSkip()\n } else if (code !== -1) {\n point.column++\n point.offset++\n }\n\n // Not in a string chunk.\n if (point._bufferIndex < 0) {\n point._index++\n } else {\n point._bufferIndex++\n\n // At end of string chunk.\n // @ts-expect-error Points w/ non-negative `_bufferIndex` reference\n // strings.\n if (point._bufferIndex === chunks[point._index].length) {\n point._bufferIndex = -1\n point._index++\n }\n }\n\n // Expose the previous character.\n context.previous = code\n\n // Mark as consumed.\n consumed = true\n }\n\n /** @type {Effects['enter']} */\n function enter(type, fields) {\n /** @type {Token} */\n // @ts-expect-error Patch instead of assign required fields to help GC.\n const token = fields || {}\n token.type = type\n token.start = now()\n context.events.push(['enter', token, context])\n stack.push(token)\n return token\n }\n\n /** @type {Effects['exit']} */\n function exit(type) {\n const token = stack.pop()\n token.end = now()\n context.events.push(['exit', token, context])\n return token\n }\n\n /**\n * Use results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulconstruct(construct, info) {\n addResult(construct, info.from)\n }\n\n /**\n * Discard results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulcheck(_, info) {\n info.restore()\n }\n\n /**\n * Factory to attempt/check/interrupt.\n *\n * @param {ReturnHandle} onreturn\n * @param {{interrupt?: boolean | undefined} | undefined} [fields]\n */\n function constructFactory(onreturn, fields) {\n return hook\n\n /**\n * Handle either an object mapping codes to constructs, a list of\n * constructs, or a single construct.\n *\n * @param {Array | Construct | ConstructRecord} constructs\n * @param {State} returnState\n * @param {State | undefined} [bogusState]\n * @returns {State}\n */\n function hook(constructs, returnState, bogusState) {\n /** @type {Array} */\n let listOfConstructs\n /** @type {number} */\n let constructIndex\n /** @type {Construct} */\n let currentConstruct\n /** @type {Info} */\n let info\n return Array.isArray(constructs) /* c8 ignore next 1 */\n ? handleListOfConstructs(constructs)\n : 'tokenize' in constructs\n ? // @ts-expect-error Looks like a construct.\n handleListOfConstructs([constructs])\n : handleMapOfConstructs(constructs)\n\n /**\n * Handle a list of construct.\n *\n * @param {ConstructRecord} map\n * @returns {State}\n */\n function handleMapOfConstructs(map) {\n return start\n\n /** @type {State} */\n function start(code) {\n const def = code !== null && map[code]\n const all = code !== null && map.null\n const list = [\n // To do: add more extension tests.\n /* c8 ignore next 2 */\n ...(Array.isArray(def) ? def : def ? [def] : []),\n ...(Array.isArray(all) ? all : all ? [all] : [])\n ]\n return handleListOfConstructs(list)(code)\n }\n }\n\n /**\n * Handle a list of construct.\n *\n * @param {Array} list\n * @returns {State}\n */\n function handleListOfConstructs(list) {\n listOfConstructs = list\n constructIndex = 0\n if (list.length === 0) {\n return bogusState\n }\n return handleConstruct(list[constructIndex])\n }\n\n /**\n * Handle a single construct.\n *\n * @param {Construct} construct\n * @returns {State}\n */\n function handleConstruct(construct) {\n return start\n\n /** @type {State} */\n function start(code) {\n // To do: not needed to store if there is no bogus state, probably?\n // Currently doesn’t work because `inspect` in document does a check\n // w/o a bogus, which doesn’t make sense. But it does seem to help perf\n // by not storing.\n info = store()\n currentConstruct = construct\n if (!construct.partial) {\n context.currentConstruct = construct\n }\n\n // Always populated by defaults.\n\n if (\n construct.name &&\n context.parser.constructs.disable.null.includes(construct.name)\n ) {\n return nok(code)\n }\n return construct.tokenize.call(\n // If we do have fields, create an object w/ `context` as its\n // prototype.\n // This allows a “live binding”, which is needed for `interrupt`.\n fields ? Object.assign(Object.create(context), fields) : context,\n effects,\n ok,\n nok\n )(code)\n }\n }\n\n /** @type {State} */\n function ok(code) {\n consumed = true\n onreturn(currentConstruct, info)\n return returnState\n }\n\n /** @type {State} */\n function nok(code) {\n consumed = true\n info.restore()\n if (++constructIndex < listOfConstructs.length) {\n return handleConstruct(listOfConstructs[constructIndex])\n }\n return bogusState\n }\n }\n }\n\n /**\n * @param {Construct} construct\n * @param {number} from\n * @returns {undefined}\n */\n function addResult(construct, from) {\n if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {\n resolveAllConstructs.push(construct)\n }\n if (construct.resolve) {\n splice(\n context.events,\n from,\n context.events.length - from,\n construct.resolve(context.events.slice(from), context)\n )\n }\n if (construct.resolveTo) {\n context.events = construct.resolveTo(context.events, context)\n }\n }\n\n /**\n * Store state.\n *\n * @returns {Info}\n */\n function store() {\n const startPoint = now()\n const startPrevious = context.previous\n const startCurrentConstruct = context.currentConstruct\n const startEventsIndex = context.events.length\n const startStack = Array.from(stack)\n return {\n restore,\n from: startEventsIndex\n }\n\n /**\n * Restore state.\n *\n * @returns {undefined}\n */\n function restore() {\n point = startPoint\n context.previous = startPrevious\n context.currentConstruct = startCurrentConstruct\n context.events.length = startEventsIndex\n stack = startStack\n accountForPotentialSkip()\n }\n }\n\n /**\n * Move the current point a bit forward in the line when it’s on a column\n * skip.\n *\n * @returns {undefined}\n */\n function accountForPotentialSkip() {\n if (point.line in columnStart && point.column < 2) {\n point.column = columnStart[point.line]\n point.offset += columnStart[point.line] - 1\n }\n }\n}\n\n/**\n * Get the chunks from a slice of chunks in the range of a token.\n *\n * @param {Array} chunks\n * @param {Pick} token\n * @returns {Array}\n */\nfunction sliceChunks(chunks, token) {\n const startIndex = token.start._index\n const startBufferIndex = token.start._bufferIndex\n const endIndex = token.end._index\n const endBufferIndex = token.end._bufferIndex\n /** @type {Array} */\n let view\n if (startIndex === endIndex) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]\n } else {\n view = chunks.slice(startIndex, endIndex)\n if (startBufferIndex > -1) {\n const head = view[0]\n if (typeof head === 'string') {\n view[0] = head.slice(startBufferIndex)\n } else {\n view.shift()\n }\n }\n if (endBufferIndex > 0) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view.push(chunks[endIndex].slice(0, endBufferIndex))\n }\n }\n return view\n}\n\n/**\n * Get the string value of a slice of chunks.\n *\n * @param {Array} chunks\n * @param {boolean | undefined} [expandTabs=false]\n * @returns {string}\n */\nfunction serializeChunks(chunks, expandTabs) {\n let index = -1\n /** @type {Array} */\n const result = []\n /** @type {boolean | undefined} */\n let atTab\n while (++index < chunks.length) {\n const chunk = chunks[index]\n /** @type {string} */\n let value\n if (typeof chunk === 'string') {\n value = chunk\n } else\n switch (chunk) {\n case -5: {\n value = '\\r'\n break\n }\n case -4: {\n value = '\\n'\n break\n }\n case -3: {\n value = '\\r' + '\\n'\n break\n }\n case -2: {\n value = expandTabs ? ' ' : '\\t'\n break\n }\n case -1: {\n if (!expandTabs && atTab) continue\n value = ' '\n break\n }\n default: {\n // Currently only replacement character.\n value = String.fromCharCode(chunk)\n }\n }\n atTab = chunk === -2\n result.push(value)\n }\n return result.join('')\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding, markdownSpace} from 'micromark-util-character'\n/** @type {Construct} */\nexport const thematicBreak = {\n name: 'thematicBreak',\n tokenize: tokenizeThematicBreak\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeThematicBreak(effects, ok, nok) {\n let size = 0\n /** @type {NonNullable} */\n let marker\n return start\n\n /**\n * Start of thematic break.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('thematicBreak')\n // To do: parse indent like `markdown-rs`.\n return before(code)\n }\n\n /**\n * After optional whitespace, at marker.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n marker = code\n return atBreak(code)\n }\n\n /**\n * After something, before something else.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === marker) {\n effects.enter('thematicBreakSequence')\n return sequence(code)\n }\n if (size >= 3 && (code === null || markdownLineEnding(code))) {\n effects.exit('thematicBreak')\n return ok(code)\n }\n return nok(code)\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function sequence(code) {\n if (code === marker) {\n effects.consume(code)\n size++\n return sequence\n }\n effects.exit('thematicBreakSequence')\n return markdownSpace(code)\n ? factorySpace(effects, atBreak, 'whitespace')(code)\n : atBreak(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').ContainerState} ContainerState\n * @typedef {import('micromark-util-types').Exiter} Exiter\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {asciiDigit, markdownSpace} from 'micromark-util-character'\nimport {blankLine} from './blank-line.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/** @type {Construct} */\nexport const list = {\n name: 'list',\n tokenize: tokenizeListStart,\n continuation: {\n tokenize: tokenizeListContinuation\n },\n exit: tokenizeListEnd\n}\n\n/** @type {Construct} */\nconst listItemPrefixWhitespaceConstruct = {\n tokenize: tokenizeListItemPrefixWhitespace,\n partial: true\n}\n\n/** @type {Construct} */\nconst indentConstruct = {\n tokenize: tokenizeIndent,\n partial: true\n}\n\n// To do: `markdown-rs` parses list items on their own and later stitches them\n// together.\n\n/**\n * @type {Tokenizer}\n * @this {TokenizeContext}\n */\nfunction tokenizeListStart(effects, ok, nok) {\n const self = this\n const tail = self.events[self.events.length - 1]\n let initialSize =\n tail && tail[1].type === 'linePrefix'\n ? tail[2].sliceSerialize(tail[1], true).length\n : 0\n let size = 0\n return start\n\n /** @type {State} */\n function start(code) {\n const kind =\n self.containerState.type ||\n (code === 42 || code === 43 || code === 45\n ? 'listUnordered'\n : 'listOrdered')\n if (\n kind === 'listUnordered'\n ? !self.containerState.marker || code === self.containerState.marker\n : asciiDigit(code)\n ) {\n if (!self.containerState.type) {\n self.containerState.type = kind\n effects.enter(kind, {\n _container: true\n })\n }\n if (kind === 'listUnordered') {\n effects.enter('listItemPrefix')\n return code === 42 || code === 45\n ? effects.check(thematicBreak, nok, atMarker)(code)\n : atMarker(code)\n }\n if (!self.interrupt || code === 49) {\n effects.enter('listItemPrefix')\n effects.enter('listItemValue')\n return inside(code)\n }\n }\n return nok(code)\n }\n\n /** @type {State} */\n function inside(code) {\n if (asciiDigit(code) && ++size < 10) {\n effects.consume(code)\n return inside\n }\n if (\n (!self.interrupt || size < 2) &&\n (self.containerState.marker\n ? code === self.containerState.marker\n : code === 41 || code === 46)\n ) {\n effects.exit('listItemValue')\n return atMarker(code)\n }\n return nok(code)\n }\n\n /**\n * @type {State}\n **/\n function atMarker(code) {\n effects.enter('listItemMarker')\n effects.consume(code)\n effects.exit('listItemMarker')\n self.containerState.marker = self.containerState.marker || code\n return effects.check(\n blankLine,\n // Can’t be empty when interrupting.\n self.interrupt ? nok : onBlank,\n effects.attempt(\n listItemPrefixWhitespaceConstruct,\n endOfPrefix,\n otherPrefix\n )\n )\n }\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.initialBlankLine = true\n initialSize++\n return endOfPrefix(code)\n }\n\n /** @type {State} */\n function otherPrefix(code) {\n if (markdownSpace(code)) {\n effects.enter('listItemPrefixWhitespace')\n effects.consume(code)\n effects.exit('listItemPrefixWhitespace')\n return endOfPrefix\n }\n return nok(code)\n }\n\n /** @type {State} */\n function endOfPrefix(code) {\n self.containerState.size =\n initialSize +\n self.sliceSerialize(effects.exit('listItemPrefix'), true).length\n return ok(code)\n }\n}\n\n/**\n * @type {Tokenizer}\n * @this {TokenizeContext}\n */\nfunction tokenizeListContinuation(effects, ok, nok) {\n const self = this\n self.containerState._closeFlow = undefined\n return effects.check(blankLine, onBlank, notBlank)\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.furtherBlankLines =\n self.containerState.furtherBlankLines ||\n self.containerState.initialBlankLine\n\n // We have a blank line.\n // Still, try to consume at most the items size.\n return factorySpace(\n effects,\n ok,\n 'listItemIndent',\n self.containerState.size + 1\n )(code)\n }\n\n /** @type {State} */\n function notBlank(code) {\n if (self.containerState.furtherBlankLines || !markdownSpace(code)) {\n self.containerState.furtherBlankLines = undefined\n self.containerState.initialBlankLine = undefined\n return notInCurrentItem(code)\n }\n self.containerState.furtherBlankLines = undefined\n self.containerState.initialBlankLine = undefined\n return effects.attempt(indentConstruct, ok, notInCurrentItem)(code)\n }\n\n /** @type {State} */\n function notInCurrentItem(code) {\n // While we do continue, we signal that the flow should be closed.\n self.containerState._closeFlow = true\n // As we’re closing flow, we’re no longer interrupting.\n self.interrupt = undefined\n // Always populated by defaults.\n\n return factorySpace(\n effects,\n effects.attempt(list, ok, nok),\n 'linePrefix',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )(code)\n }\n}\n\n/**\n * @type {Tokenizer}\n * @this {TokenizeContext}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this\n return factorySpace(\n effects,\n afterPrefix,\n 'listItemIndent',\n self.containerState.size + 1\n )\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1]\n return tail &&\n tail[1].type === 'listItemIndent' &&\n tail[2].sliceSerialize(tail[1], true).length === self.containerState.size\n ? ok(code)\n : nok(code)\n }\n}\n\n/**\n * @type {Exiter}\n * @this {TokenizeContext}\n */\nfunction tokenizeListEnd(effects) {\n effects.exit(this.containerState.type)\n}\n\n/**\n * @type {Tokenizer}\n * @this {TokenizeContext}\n */\nfunction tokenizeListItemPrefixWhitespace(effects, ok, nok) {\n const self = this\n\n // Always populated by defaults.\n\n return factorySpace(\n effects,\n afterPrefix,\n 'listItemPrefixWhitespace',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4 + 1\n )\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1]\n return !markdownSpace(code) &&\n tail &&\n tail[1].type === 'listItemPrefixWhitespace'\n ? ok(code)\n : nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Exiter} Exiter\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownSpace} from 'micromark-util-character'\n/** @type {Construct} */\nexport const blockQuote = {\n name: 'blockQuote',\n tokenize: tokenizeBlockQuoteStart,\n continuation: {\n tokenize: tokenizeBlockQuoteContinuation\n },\n exit\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeBlockQuoteStart(effects, ok, nok) {\n const self = this\n return start\n\n /**\n * Start of block quote.\n *\n * ```markdown\n * > | > a\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 62) {\n const state = self.containerState\n if (!state.open) {\n effects.enter('blockQuote', {\n _container: true\n })\n state.open = true\n }\n effects.enter('blockQuotePrefix')\n effects.enter('blockQuoteMarker')\n effects.consume(code)\n effects.exit('blockQuoteMarker')\n return after\n }\n return nok(code)\n }\n\n /**\n * After `>`, before optional whitespace.\n *\n * ```markdown\n * > | > a\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownSpace(code)) {\n effects.enter('blockQuotePrefixWhitespace')\n effects.consume(code)\n effects.exit('blockQuotePrefixWhitespace')\n effects.exit('blockQuotePrefix')\n return ok\n }\n effects.exit('blockQuotePrefix')\n return ok(code)\n }\n}\n\n/**\n * Start of block quote continuation.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeBlockQuoteContinuation(effects, ok, nok) {\n const self = this\n return contStart\n\n /**\n * Start of block quote continuation.\n *\n * Also used to parse the first block quote opening.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @type {State}\n */\n function contStart(code) {\n if (markdownSpace(code)) {\n // Always populated by defaults.\n\n return factorySpace(\n effects,\n contBefore,\n 'linePrefix',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )(code)\n }\n return contBefore(code)\n }\n\n /**\n * At `>`, after optional whitespace.\n *\n * Also used to parse the first block quote opening.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @type {State}\n */\n function contBefore(code) {\n return effects.attempt(blockQuote, ok, nok)(code)\n }\n}\n\n/** @type {Exiter} */\nfunction exit(effects) {\n effects.exit('blockQuote')\n}\n","/**\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenType} TokenType\n */\n\nimport {\n asciiControl,\n markdownLineEndingOrSpace,\n markdownLineEnding\n} from 'micromark-util-character'\n/**\n * Parse destinations.\n *\n * ###### Examples\n *\n * ```markdown\n * \n * b>\n * \n * \n * a\n * a\\)b\n * a(b)c\n * a(b)\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type for whole (`` or `b`).\n * @param {TokenType} literalType\n * Type when enclosed (``).\n * @param {TokenType} literalMarkerType\n * Type for enclosing (`<` and `>`).\n * @param {TokenType} rawType\n * Type when not enclosed (`b`).\n * @param {TokenType} stringType\n * Type for the value (`a` or `b`).\n * @param {number | undefined} [max=Infinity]\n * Depth of nested parens (inclusive).\n * @returns {State}\n * Start state.\n */ // eslint-disable-next-line max-params\nexport function factoryDestination(\n effects,\n ok,\n nok,\n type,\n literalType,\n literalMarkerType,\n rawType,\n stringType,\n max\n) {\n const limit = max || Number.POSITIVE_INFINITY\n let balance = 0\n return start\n\n /**\n * Start of destination.\n *\n * ```markdown\n * > | \n * ^\n * > | aa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 60) {\n effects.enter(type)\n effects.enter(literalType)\n effects.enter(literalMarkerType)\n effects.consume(code)\n effects.exit(literalMarkerType)\n return enclosedBefore\n }\n\n // ASCII control, space, closing paren.\n if (code === null || code === 32 || code === 41 || asciiControl(code)) {\n return nok(code)\n }\n effects.enter(type)\n effects.enter(rawType)\n effects.enter(stringType)\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return raw(code)\n }\n\n /**\n * After `<`, at an enclosed destination.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function enclosedBefore(code) {\n if (code === 62) {\n effects.enter(literalMarkerType)\n effects.consume(code)\n effects.exit(literalMarkerType)\n effects.exit(literalType)\n effects.exit(type)\n return ok\n }\n effects.enter(stringType)\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return enclosed(code)\n }\n\n /**\n * In enclosed destination.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function enclosed(code) {\n if (code === 62) {\n effects.exit('chunkString')\n effects.exit(stringType)\n return enclosedBefore(code)\n }\n if (code === null || code === 60 || markdownLineEnding(code)) {\n return nok(code)\n }\n effects.consume(code)\n return code === 92 ? enclosedEscape : enclosed\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function enclosedEscape(code) {\n if (code === 60 || code === 62 || code === 92) {\n effects.consume(code)\n return enclosed\n }\n return enclosed(code)\n }\n\n /**\n * In raw destination.\n *\n * ```markdown\n * > | aa\n * ^\n * ```\n *\n * @type {State}\n */\n function raw(code) {\n if (\n !balance &&\n (code === null || code === 41 || markdownLineEndingOrSpace(code))\n ) {\n effects.exit('chunkString')\n effects.exit(stringType)\n effects.exit(rawType)\n effects.exit(type)\n return ok(code)\n }\n if (balance < limit && code === 40) {\n effects.consume(code)\n balance++\n return raw\n }\n if (code === 41) {\n effects.consume(code)\n balance--\n return raw\n }\n\n // ASCII control (but *not* `\\0`) and space and `(`.\n // Note: in `markdown-rs`, `\\0` exists in codes, in `micromark-js` it\n // doesn’t.\n if (code === null || code === 32 || code === 40 || asciiControl(code)) {\n return nok(code)\n }\n effects.consume(code)\n return code === 92 ? rawEscape : raw\n }\n\n /**\n * After `\\`, at special character.\n *\n * ```markdown\n * > | a\\*a\n * ^\n * ```\n *\n * @type {State}\n */\n function rawEscape(code) {\n if (code === 40 || code === 41 || code === 92) {\n effects.consume(code)\n return raw\n }\n return raw(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').TokenType} TokenType\n */\n\nimport {markdownLineEnding, markdownSpace} from 'micromark-util-character'\n/**\n * Parse labels.\n *\n * > 👉 **Note**: labels in markdown are capped at 999 characters in the string.\n *\n * ###### Examples\n *\n * ```markdown\n * [a]\n * [a\n * b]\n * [a\\]b]\n * ```\n *\n * @this {TokenizeContext}\n * Tokenize context.\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole label (`[a]`).\n * @param {TokenType} markerType\n * Type for the markers (`[` and `]`).\n * @param {TokenType} stringType\n * Type for the identifier (`a`).\n * @returns {State}\n * Start state.\n */ // eslint-disable-next-line max-params\nexport function factoryLabel(effects, ok, nok, type, markerType, stringType) {\n const self = this\n let size = 0\n /** @type {boolean} */\n let seen\n return start\n\n /**\n * Start of label.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(type)\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n effects.enter(stringType)\n return atBreak\n }\n\n /**\n * In label, at something, before something else.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (\n size > 999 ||\n code === null ||\n code === 91 ||\n (code === 93 && !seen) ||\n // To do: remove in the future once we’ve switched from\n // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,\n // which doesn’t need this.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n (code === 94 &&\n !size &&\n '_hiddenFootnoteSupport' in self.parser.constructs)\n ) {\n return nok(code)\n }\n if (code === 93) {\n effects.exit(stringType)\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n effects.exit(type)\n return ok\n }\n\n // To do: indent? Link chunks and EOLs together?\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return atBreak\n }\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return labelInside(code)\n }\n\n /**\n * In label, in text.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function labelInside(code) {\n if (\n code === null ||\n code === 91 ||\n code === 93 ||\n markdownLineEnding(code) ||\n size++ > 999\n ) {\n effects.exit('chunkString')\n return atBreak(code)\n }\n effects.consume(code)\n if (!seen) seen = !markdownSpace(code)\n return code === 92 ? labelEscape : labelInside\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | [a\\*a]\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code)\n size++\n return labelInside\n }\n return labelInside(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenType} TokenType\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\n/**\n * Parse titles.\n *\n * ###### Examples\n *\n * ```markdown\n * \"a\"\n * 'b'\n * (c)\n * \"a\n * b\"\n * 'a\n * b'\n * (a\\)b)\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole title (`\"a\"`, `'b'`, `(c)`).\n * @param {TokenType} markerType\n * Type for the markers (`\"`, `'`, `(`, and `)`).\n * @param {TokenType} stringType\n * Type for the value (`a`).\n * @returns {State}\n * Start state.\n */ // eslint-disable-next-line max-params\nexport function factoryTitle(effects, ok, nok, type, markerType, stringType) {\n /** @type {NonNullable} */\n let marker\n return start\n\n /**\n * Start of title.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 34 || code === 39 || code === 40) {\n effects.enter(type)\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n marker = code === 40 ? 41 : code\n return begin\n }\n return nok(code)\n }\n\n /**\n * After opening marker.\n *\n * This is also used at the closing marker.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function begin(code) {\n if (code === marker) {\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n effects.exit(type)\n return ok\n }\n effects.enter(stringType)\n return atBreak(code)\n }\n\n /**\n * At something, before something else.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === marker) {\n effects.exit(stringType)\n return begin(marker)\n }\n if (code === null) {\n return nok(code)\n }\n\n // Note: blank lines can’t exist in content.\n if (markdownLineEnding(code)) {\n // To do: use `space_or_tab_eol_with_options`, connect.\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, atBreak, 'linePrefix')\n }\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return inside(code)\n }\n\n /**\n *\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker || code === null || markdownLineEnding(code)) {\n effects.exit('chunkString')\n return atBreak(code)\n }\n effects.consume(code)\n return code === 92 ? escape : inside\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | \"a\\*b\"\n * ^\n * ```\n *\n * @type {State}\n */\n function escape(code) {\n if (code === marker || code === 92) {\n effects.consume(code)\n return inside\n }\n return inside(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Effects} Effects\n * @typedef {import('micromark-util-types').State} State\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding, markdownSpace} from 'micromark-util-character'\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * line endings or spaces in markdown are often optional, in which case this\n * factory can be used and `ok` will be switched to whether spaces were found\n * or not\n * * one line ending or space can be detected with\n * `markdownLineEndingOrSpace(code)` right before using `factoryWhitespace`\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @returns {State}\n * Start state.\n */\nexport function factoryWhitespace(effects, ok) {\n /** @type {boolean} */\n let seen\n return start\n\n /** @type {State} */\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n seen = true\n return start\n }\n if (markdownSpace(code)) {\n return factorySpace(\n effects,\n start,\n seen ? 'linePrefix' : 'lineSuffix'\n )(code)\n }\n return ok(code)\n }\n}\n","/**\n * Normalize an identifier (as found in references, definitions).\n *\n * Collapses markdown whitespace, trim, and then lower- and uppercase.\n *\n * Some characters are considered “uppercase”, such as U+03F4 (`ϴ`), but if their\n * lowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different\n * uppercase character (U+0398 (`Θ`)).\n * So, to get a canonical form, we perform both lower- and uppercase.\n *\n * Using uppercase last makes sure keys will never interact with default\n * prototypal values (such as `constructor`): nothing in the prototype of\n * `Object` is uppercase.\n *\n * @param {string} value\n * Identifier to normalize.\n * @returns {string}\n * Normalized identifier.\n */\nexport function normalizeIdentifier(value) {\n return (\n value\n // Collapse markdown whitespace.\n .replace(/[\\t\\n\\r ]+/g, ' ')\n // Trim.\n .replace(/^ | $/g, '')\n // Some characters are considered “uppercase”, but if their lowercase\n // counterpart is uppercased will result in a different uppercase\n // character.\n // Hence, to get that form, we perform both lower- and uppercase.\n // Upper case makes sure keys will not interact with default prototypal\n // methods: no method is uppercase.\n .toLowerCase()\n .toUpperCase()\n )\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factoryDestination} from 'micromark-factory-destination'\nimport {factoryLabel} from 'micromark-factory-label'\nimport {factorySpace} from 'micromark-factory-space'\nimport {factoryTitle} from 'micromark-factory-title'\nimport {factoryWhitespace} from 'micromark-factory-whitespace'\nimport {\n markdownLineEnding,\n markdownLineEndingOrSpace,\n markdownSpace\n} from 'micromark-util-character'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\n/** @type {Construct} */\nexport const definition = {\n name: 'definition',\n tokenize: tokenizeDefinition\n}\n\n/** @type {Construct} */\nconst titleBefore = {\n tokenize: tokenizeTitleBefore,\n partial: true\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinition(effects, ok, nok) {\n const self = this\n /** @type {string} */\n let identifier\n return start\n\n /**\n * At start of a definition.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Do not interrupt paragraphs (but do follow definitions).\n // To do: do `interrupt` the way `markdown-rs` does.\n // To do: parse whitespace the way `markdown-rs` does.\n effects.enter('definition')\n return before(code)\n }\n\n /**\n * After optional whitespace, at `[`.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n // To do: parse whitespace the way `markdown-rs` does.\n\n return factoryLabel.call(\n self,\n effects,\n labelAfter,\n // Note: we don’t need to reset the way `markdown-rs` does.\n nok,\n 'definitionLabel',\n 'definitionLabelMarker',\n 'definitionLabelString'\n )(code)\n }\n\n /**\n * After label.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAfter(code) {\n identifier = normalizeIdentifier(\n self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)\n )\n if (code === 58) {\n effects.enter('definitionMarker')\n effects.consume(code)\n effects.exit('definitionMarker')\n return markerAfter\n }\n return nok(code)\n }\n\n /**\n * After marker.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function markerAfter(code) {\n // Note: whitespace is optional.\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, destinationBefore)(code)\n : destinationBefore(code)\n }\n\n /**\n * Before destination.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function destinationBefore(code) {\n return factoryDestination(\n effects,\n destinationAfter,\n // Note: we don’t need to reset the way `markdown-rs` does.\n nok,\n 'definitionDestination',\n 'definitionDestinationLiteral',\n 'definitionDestinationLiteralMarker',\n 'definitionDestinationRaw',\n 'definitionDestinationString'\n )(code)\n }\n\n /**\n * After destination.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function destinationAfter(code) {\n return effects.attempt(titleBefore, after, after)(code)\n }\n\n /**\n * After definition.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return markdownSpace(code)\n ? factorySpace(effects, afterWhitespace, 'whitespace')(code)\n : afterWhitespace(code)\n }\n\n /**\n * After definition, after optional whitespace.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function afterWhitespace(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('definition')\n\n // Note: we don’t care about uniqueness.\n // It’s likely that that doesn’t happen very frequently.\n // It is more likely that it wastes precious time.\n self.parser.defined.push(identifier)\n\n // To do: `markdown-rs` interrupt.\n // // You’d be interrupting.\n // tokenizer.interrupt = true\n return ok(code)\n }\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTitleBefore(effects, ok, nok) {\n return titleBefore\n\n /**\n * After destination, at whitespace.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleBefore(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, beforeMarker)(code)\n : nok(code)\n }\n\n /**\n * At title.\n *\n * ```markdown\n * | [a]: b\n * > | \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeMarker(code) {\n return factoryTitle(\n effects,\n titleAfter,\n nok,\n 'definitionTitle',\n 'definitionTitleMarker',\n 'definitionTitleString'\n )(code)\n }\n\n /**\n * After title.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleAfter(code) {\n return markdownSpace(code)\n ? factorySpace(effects, titleAfterOptionalWhitespace, 'whitespace')(code)\n : titleAfterOptionalWhitespace(code)\n }\n\n /**\n * After title, after optional whitespace.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleAfterOptionalWhitespace(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding, markdownSpace} from 'micromark-util-character'\n/** @type {Construct} */\nexport const codeIndented = {\n name: 'codeIndented',\n tokenize: tokenizeCodeIndented\n}\n\n/** @type {Construct} */\nconst furtherStart = {\n tokenize: tokenizeFurtherStart,\n partial: true\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCodeIndented(effects, ok, nok) {\n const self = this\n return start\n\n /**\n * Start of code (indented).\n *\n * > **Parsing note**: it is not needed to check if this first line is a\n * > filled line (that it has a non-whitespace character), because blank lines\n * > are parsed already, so we never run into that.\n *\n * ```markdown\n * > | aaa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: manually check if interrupting like `markdown-rs`.\n\n effects.enter('codeIndented')\n // To do: use an improved `space_or_tab` function like `markdown-rs`,\n // so that we can drop the next state.\n return factorySpace(effects, afterPrefix, 'linePrefix', 4 + 1)(code)\n }\n\n /**\n * At start, after 1 or 4 spaces.\n *\n * ```markdown\n * > | aaa\n * ^\n * ```\n *\n * @type {State}\n */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1]\n return tail &&\n tail[1].type === 'linePrefix' &&\n tail[2].sliceSerialize(tail[1], true).length >= 4\n ? atBreak(code)\n : nok(code)\n }\n\n /**\n * At a break.\n *\n * ```markdown\n * > | aaa\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === null) {\n return after(code)\n }\n if (markdownLineEnding(code)) {\n return effects.attempt(furtherStart, atBreak, after)(code)\n }\n effects.enter('codeFlowValue')\n return inside(code)\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * > | aaa\n * ^^^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFlowValue')\n return atBreak(code)\n }\n effects.consume(code)\n return inside\n }\n\n /** @type {State} */\n function after(code) {\n effects.exit('codeIndented')\n // To do: allow interrupting like `markdown-rs`.\n // Feel free to interrupt.\n // tokenizer.interrupt = false\n return ok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeFurtherStart(effects, ok, nok) {\n const self = this\n return furtherStart\n\n /**\n * At eol, trying to parse another indent.\n *\n * ```markdown\n * > | aaa\n * ^\n * | bbb\n * ```\n *\n * @type {State}\n */\n function furtherStart(code) {\n // To do: improve `lazy` / `pierce` handling.\n // If this is a lazy line, it can’t be code.\n if (self.parser.lazy[self.now().line]) {\n return nok(code)\n }\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return furtherStart\n }\n\n // To do: the code here in `micromark-js` is a bit different from\n // `markdown-rs` because there it can attempt spaces.\n // We can’t yet.\n //\n // To do: use an improved `space_or_tab` function like `markdown-rs`,\n // so that we can drop the next state.\n return factorySpace(effects, afterPrefix, 'linePrefix', 4 + 1)(code)\n }\n\n /**\n * At start, after 1 or 4 spaces.\n *\n * ```markdown\n * > | aaa\n * ^\n * ```\n *\n * @type {State}\n */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1]\n return tail &&\n tail[1].type === 'linePrefix' &&\n tail[2].sliceSerialize(tail[1], true).length >= 4\n ? ok(code)\n : markdownLineEnding(code)\n ? furtherStart(code)\n : nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n markdownLineEnding,\n markdownLineEndingOrSpace,\n markdownSpace\n} from 'micromark-util-character'\nimport {splice} from 'micromark-util-chunked'\n/** @type {Construct} */\nexport const headingAtx = {\n name: 'headingAtx',\n tokenize: tokenizeHeadingAtx,\n resolve: resolveHeadingAtx\n}\n\n/** @type {Resolver} */\nfunction resolveHeadingAtx(events, context) {\n let contentEnd = events.length - 2\n let contentStart = 3\n /** @type {Token} */\n let content\n /** @type {Token} */\n let text\n\n // Prefix whitespace, part of the opening.\n if (events[contentStart][1].type === 'whitespace') {\n contentStart += 2\n }\n\n // Suffix whitespace, part of the closing.\n if (\n contentEnd - 2 > contentStart &&\n events[contentEnd][1].type === 'whitespace'\n ) {\n contentEnd -= 2\n }\n if (\n events[contentEnd][1].type === 'atxHeadingSequence' &&\n (contentStart === contentEnd - 1 ||\n (contentEnd - 4 > contentStart &&\n events[contentEnd - 2][1].type === 'whitespace'))\n ) {\n contentEnd -= contentStart + 1 === contentEnd ? 2 : 4\n }\n if (contentEnd > contentStart) {\n content = {\n type: 'atxHeadingText',\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end\n }\n text = {\n type: 'chunkText',\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end,\n contentType: 'text'\n }\n splice(events, contentStart, contentEnd - contentStart + 1, [\n ['enter', content, context],\n ['enter', text, context],\n ['exit', text, context],\n ['exit', content, context]\n ])\n }\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeHeadingAtx(effects, ok, nok) {\n let size = 0\n return start\n\n /**\n * Start of a heading (atx).\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse indent like `markdown-rs`.\n effects.enter('atxHeading')\n return before(code)\n }\n\n /**\n * After optional whitespace, at `#`.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter('atxHeadingSequence')\n return sequenceOpen(code)\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 35 && size++ < 6) {\n effects.consume(code)\n return sequenceOpen\n }\n\n // Always at least one `#`.\n if (code === null || markdownLineEndingOrSpace(code)) {\n effects.exit('atxHeadingSequence')\n return atBreak(code)\n }\n return nok(code)\n }\n\n /**\n * After something, before something else.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === 35) {\n effects.enter('atxHeadingSequence')\n return sequenceFurther(code)\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit('atxHeading')\n // To do: interrupt like `markdown-rs`.\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n return ok(code)\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, atBreak, 'whitespace')(code)\n }\n\n // To do: generate `data` tokens, add the `text` token later.\n // Needs edit map, see: `markdown.rs`.\n effects.enter('atxHeadingText')\n return data(code)\n }\n\n /**\n * In further sequence (after whitespace).\n *\n * Could be normal “visible” hashes in the heading or a final sequence.\n *\n * ```markdown\n * > | ## aa ##\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceFurther(code) {\n if (code === 35) {\n effects.consume(code)\n return sequenceFurther\n }\n effects.exit('atxHeadingSequence')\n return atBreak(code)\n }\n\n /**\n * In text.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (code === null || code === 35 || markdownLineEndingOrSpace(code)) {\n effects.exit('atxHeadingText')\n return atBreak(code)\n }\n effects.consume(code)\n return data\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding, markdownSpace} from 'micromark-util-character'\n/** @type {Construct} */\nexport const setextUnderline = {\n name: 'setextUnderline',\n tokenize: tokenizeSetextUnderline,\n resolveTo: resolveToSetextUnderline\n}\n\n/** @type {Resolver} */\nfunction resolveToSetextUnderline(events, context) {\n // To do: resolve like `markdown-rs`.\n let index = events.length\n /** @type {number | undefined} */\n let content\n /** @type {number | undefined} */\n let text\n /** @type {number | undefined} */\n let definition\n\n // Find the opening of the content.\n // It’ll always exist: we don’t tokenize if it isn’t there.\n while (index--) {\n if (events[index][0] === 'enter') {\n if (events[index][1].type === 'content') {\n content = index\n break\n }\n if (events[index][1].type === 'paragraph') {\n text = index\n }\n }\n // Exit\n else {\n if (events[index][1].type === 'content') {\n // Remove the content end (if needed we’ll add it later)\n events.splice(index, 1)\n }\n if (!definition && events[index][1].type === 'definition') {\n definition = index\n }\n }\n }\n const heading = {\n type: 'setextHeading',\n start: Object.assign({}, events[text][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n }\n\n // Change the paragraph to setext heading text.\n events[text][1].type = 'setextHeadingText'\n\n // If we have definitions in the content, we’ll keep on having content,\n // but we need move it.\n if (definition) {\n events.splice(text, 0, ['enter', heading, context])\n events.splice(definition + 1, 0, ['exit', events[content][1], context])\n events[content][1].end = Object.assign({}, events[definition][1].end)\n } else {\n events[content][1] = heading\n }\n\n // Add the heading exit at the end.\n events.push(['exit', heading, context])\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeSetextUnderline(effects, ok, nok) {\n const self = this\n /** @type {NonNullable} */\n let marker\n return start\n\n /**\n * At start of heading (setext) underline.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n let index = self.events.length\n /** @type {boolean | undefined} */\n let paragraph\n // Find an opening.\n while (index--) {\n // Skip enter/exit of line ending, line prefix, and content.\n // We can now either have a definition or a paragraph.\n if (\n self.events[index][1].type !== 'lineEnding' &&\n self.events[index][1].type !== 'linePrefix' &&\n self.events[index][1].type !== 'content'\n ) {\n paragraph = self.events[index][1].type === 'paragraph'\n break\n }\n }\n\n // To do: handle lazy/pierce like `markdown-rs`.\n // To do: parse indent like `markdown-rs`.\n if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) {\n effects.enter('setextHeadingLine')\n marker = code\n return before(code)\n }\n return nok(code)\n }\n\n /**\n * After optional whitespace, at `-` or `=`.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter('setextHeadingLineSequence')\n return inside(code)\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code)\n return inside\n }\n effects.exit('setextHeadingLineSequence')\n return markdownSpace(code)\n ? factorySpace(effects, after, 'lineSuffix')(code)\n : after(code)\n }\n\n /**\n * After sequence, after optional whitespace.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('setextHeadingLine')\n return ok(code)\n }\n return nok(code)\n }\n}\n","/**\n * List of lowercase HTML “block” tag names.\n *\n * The list, when parsing HTML (flow), results in more relaxed rules (condition\n * 6).\n * Because they are known blocks, the HTML-like syntax doesn’t have to be\n * strictly parsed.\n * For tag names not in this list, a more strict algorithm (condition 7) is used\n * to detect whether the HTML-like syntax is seen as HTML (flow) or not.\n *\n * This is copied from:\n * .\n *\n * > 👉 **Note**: `search` was added in `CommonMark@0.31`.\n */\nexport const htmlBlockNames = [\n 'address',\n 'article',\n 'aside',\n 'base',\n 'basefont',\n 'blockquote',\n 'body',\n 'caption',\n 'center',\n 'col',\n 'colgroup',\n 'dd',\n 'details',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'iframe',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'menu',\n 'menuitem',\n 'nav',\n 'noframes',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'param',\n 'search',\n 'section',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'track',\n 'ul'\n]\n\n/**\n * List of lowercase HTML “raw” tag names.\n *\n * The list, when parsing HTML (flow), results in HTML that can include lines\n * without exiting, until a closing tag also in this list is found (condition\n * 1).\n *\n * This module is copied from:\n * .\n *\n * > 👉 **Note**: `textarea` was added in `CommonMark@0.30`.\n */\nexport const htmlRawNames = ['pre', 'script', 'style', 'textarea']\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n markdownLineEnding,\n markdownLineEndingOrSpace,\n markdownSpace\n} from 'micromark-util-character'\nimport {htmlBlockNames, htmlRawNames} from 'micromark-util-html-tag-name'\nimport {blankLine} from './blank-line.js'\n\n/** @type {Construct} */\nexport const htmlFlow = {\n name: 'htmlFlow',\n tokenize: tokenizeHtmlFlow,\n resolveTo: resolveToHtmlFlow,\n concrete: true\n}\n\n/** @type {Construct} */\nconst blankLineBefore = {\n tokenize: tokenizeBlankLineBefore,\n partial: true\n}\nconst nonLazyContinuationStart = {\n tokenize: tokenizeNonLazyContinuationStart,\n partial: true\n}\n\n/** @type {Resolver} */\nfunction resolveToHtmlFlow(events) {\n let index = events.length\n while (index--) {\n if (events[index][0] === 'enter' && events[index][1].type === 'htmlFlow') {\n break\n }\n }\n if (index > 1 && events[index - 2][1].type === 'linePrefix') {\n // Add the prefix start to the HTML token.\n events[index][1].start = events[index - 2][1].start\n // Add the prefix start to the HTML line token.\n events[index + 1][1].start = events[index - 2][1].start\n // Remove the line prefix.\n events.splice(index - 2, 2)\n }\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlFlow(effects, ok, nok) {\n const self = this\n /** @type {number} */\n let marker\n /** @type {boolean} */\n let closingTag\n /** @type {string} */\n let buffer\n /** @type {number} */\n let index\n /** @type {Code} */\n let markerB\n return start\n\n /**\n * Start of HTML (flow).\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse indent like `markdown-rs`.\n return before(code)\n }\n\n /**\n * At `<`, after optional whitespace.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter('htmlFlow')\n effects.enter('htmlFlowData')\n effects.consume(code)\n return open\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code)\n return declarationOpen\n }\n if (code === 47) {\n effects.consume(code)\n closingTag = true\n return tagCloseStart\n }\n if (code === 63) {\n effects.consume(code)\n marker = 3\n // To do:\n // tokenizer.concrete = true\n // To do: use `markdown-rs` style interrupt.\n // While we’re in an instruction instead of a declaration, we’re on a `?`\n // right now, so we do need to search for `>`, similar to declarations.\n return self.interrupt ? ok : continuationDeclarationInside\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code)\n // @ts-expect-error: not null.\n buffer = String.fromCharCode(code)\n return tagName\n }\n return nok(code)\n }\n\n /**\n * After ` | \n * ^\n * > | \n * ^\n * > | &<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code)\n marker = 2\n return commentOpenInside\n }\n if (code === 91) {\n effects.consume(code)\n marker = 5\n index = 0\n return cdataOpenInside\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code)\n marker = 4\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuationDeclarationInside\n }\n return nok(code)\n }\n\n /**\n * After ` | \n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code)\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuationDeclarationInside\n }\n return nok(code)\n }\n\n /**\n * After ` | &<]]>\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = 'CDATA['\n if (code === value.charCodeAt(index++)) {\n effects.consume(code)\n if (index === value.length) {\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuation\n }\n return cdataOpenInside\n }\n return nok(code)\n }\n\n /**\n * After ` | \n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n // @ts-expect-error: not null.\n buffer = String.fromCharCode(code)\n return tagName\n }\n return nok(code)\n }\n\n /**\n * In tag name.\n *\n * ```markdown\n * > | \n * ^^\n * > | \n * ^^\n * ```\n *\n * @type {State}\n */\n function tagName(code) {\n if (\n code === null ||\n code === 47 ||\n code === 62 ||\n markdownLineEndingOrSpace(code)\n ) {\n const slash = code === 47\n const name = buffer.toLowerCase()\n if (!slash && !closingTag && htmlRawNames.includes(name)) {\n marker = 1\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok(code) : continuation(code)\n }\n if (htmlBlockNames.includes(buffer.toLowerCase())) {\n marker = 6\n if (slash) {\n effects.consume(code)\n return basicSelfClosing\n }\n\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok(code) : continuation(code)\n }\n marker = 7\n // Do not support complete HTML when interrupting.\n return self.interrupt && !self.parser.lazy[self.now().line]\n ? nok(code)\n : closingTag\n ? completeClosingTagAfter(code)\n : completeAttributeNameBefore(code)\n }\n\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n buffer += String.fromCharCode(code)\n return tagName\n }\n return nok(code)\n }\n\n /**\n * After closing slash of a basic tag name.\n *\n * ```markdown\n * > |
\n * ^\n * ```\n *\n * @type {State}\n */\n function basicSelfClosing(code) {\n if (code === 62) {\n effects.consume(code)\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuation\n }\n return nok(code)\n }\n\n /**\n * After closing slash of a complete tag name.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeClosingTagAfter(code) {\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeClosingTagAfter\n }\n return completeEnd(code)\n }\n\n /**\n * At an attribute name.\n *\n * At first, this state is used after a complete tag name, after whitespace,\n * where it expects optional attributes or the end of the tag.\n * It is also reused after attributes, when expecting more optional\n * attributes.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeNameBefore(code) {\n if (code === 47) {\n effects.consume(code)\n return completeEnd\n }\n\n // ASCII alphanumerical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code)\n return completeAttributeName\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAttributeNameBefore\n }\n return completeEnd(code)\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeName(code) {\n // ASCII alphanumerical and `-`, `.`, `:`, and `_`.\n if (\n code === 45 ||\n code === 46 ||\n code === 58 ||\n code === 95 ||\n asciiAlphanumeric(code)\n ) {\n effects.consume(code)\n return completeAttributeName\n }\n return completeAttributeNameAfter(code)\n }\n\n /**\n * After attribute name, at an optional initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code)\n return completeAttributeValueBefore\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAttributeNameAfter\n }\n return completeAttributeNameBefore(code)\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueBefore(code) {\n if (\n code === null ||\n code === 60 ||\n code === 61 ||\n code === 62 ||\n code === 96\n ) {\n return nok(code)\n }\n if (code === 34 || code === 39) {\n effects.consume(code)\n markerB = code\n return completeAttributeValueQuoted\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAttributeValueBefore\n }\n return completeAttributeValueUnquoted(code)\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueQuoted(code) {\n if (code === markerB) {\n effects.consume(code)\n markerB = null\n return completeAttributeValueQuotedAfter\n }\n if (code === null || markdownLineEnding(code)) {\n return nok(code)\n }\n effects.consume(code)\n return completeAttributeValueQuoted\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueUnquoted(code) {\n if (\n code === null ||\n code === 34 ||\n code === 39 ||\n code === 47 ||\n code === 60 ||\n code === 61 ||\n code === 62 ||\n code === 96 ||\n markdownLineEndingOrSpace(code)\n ) {\n return completeAttributeNameAfter(code)\n }\n effects.consume(code)\n return completeAttributeValueUnquoted\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the\n * end of the tag.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownSpace(code)) {\n return completeAttributeNameBefore(code)\n }\n return nok(code)\n }\n\n /**\n * In certain circumstances of a complete tag where only an `>` is allowed.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeEnd(code) {\n if (code === 62) {\n effects.consume(code)\n return completeAfter\n }\n return nok(code)\n }\n\n /**\n * After `>` in a complete tag.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function completeAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n // // Do not form containers.\n // tokenizer.concrete = true\n return continuation(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAfter\n }\n return nok(code)\n }\n\n /**\n * In continuation of any HTML kind.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuation(code) {\n if (code === 45 && marker === 2) {\n effects.consume(code)\n return continuationCommentInside\n }\n if (code === 60 && marker === 1) {\n effects.consume(code)\n return continuationRawTagOpen\n }\n if (code === 62 && marker === 4) {\n effects.consume(code)\n return continuationClose\n }\n if (code === 63 && marker === 3) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n if (code === 93 && marker === 5) {\n effects.consume(code)\n return continuationCdataInside\n }\n if (markdownLineEnding(code) && (marker === 6 || marker === 7)) {\n effects.exit('htmlFlowData')\n return effects.check(\n blankLineBefore,\n continuationAfter,\n continuationStart\n )(code)\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit('htmlFlowData')\n return continuationStart(code)\n }\n effects.consume(code)\n return continuation\n }\n\n /**\n * In continuation, at eol.\n *\n * ```markdown\n * > | \n * ^\n * | asd\n * ```\n *\n * @type {State}\n */\n function continuationStart(code) {\n return effects.check(\n nonLazyContinuationStart,\n continuationStartNonLazy,\n continuationAfter\n )(code)\n }\n\n /**\n * In continuation, at eol, before non-lazy content.\n *\n * ```markdown\n * > | \n * ^\n * | asd\n * ```\n *\n * @type {State}\n */\n function continuationStartNonLazy(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return continuationBefore\n }\n\n /**\n * In continuation, before non-lazy content.\n *\n * ```markdown\n * | \n * > | asd\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return continuationStart(code)\n }\n effects.enter('htmlFlowData')\n return continuation(code)\n }\n\n /**\n * In comment continuation, after one `-`, expecting another.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCommentInside(code) {\n if (code === 45) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n return continuation(code)\n }\n\n /**\n * In raw continuation, after `<`, at `/`.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationRawTagOpen(code) {\n if (code === 47) {\n effects.consume(code)\n buffer = ''\n return continuationRawEndTag\n }\n return continuation(code)\n }\n\n /**\n * In raw continuation, after ` | \n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function continuationRawEndTag(code) {\n if (code === 62) {\n const name = buffer.toLowerCase()\n if (htmlRawNames.includes(name)) {\n effects.consume(code)\n return continuationClose\n }\n return continuation(code)\n }\n if (asciiAlpha(code) && buffer.length < 8) {\n effects.consume(code)\n // @ts-expect-error: not null.\n buffer += String.fromCharCode(code)\n return continuationRawEndTag\n }\n return continuation(code)\n }\n\n /**\n * In cdata continuation, after `]`, expecting `]>`.\n *\n * ```markdown\n * > | &<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCdataInside(code) {\n if (code === 93) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n return continuation(code)\n }\n\n /**\n * In declaration or instruction continuation, at `>`.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | &<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationDeclarationInside(code) {\n if (code === 62) {\n effects.consume(code)\n return continuationClose\n }\n\n // More dashes.\n if (code === 45 && marker === 2) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n return continuation(code)\n }\n\n /**\n * In closed continuation: everything we get until the eol/eof is part of it.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('htmlFlowData')\n return continuationAfter(code)\n }\n effects.consume(code)\n return continuationClose\n }\n\n /**\n * Done.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationAfter(code) {\n effects.exit('htmlFlow')\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n // // No longer concrete.\n // tokenizer.concrete = false\n return ok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuationStart(effects, ok, nok) {\n const self = this\n return start\n\n /**\n * At eol, before continuation.\n *\n * ```markdown\n * > | * ```js\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return after\n }\n return nok(code)\n }\n\n /**\n * A continuation.\n *\n * ```markdown\n * | * ```js\n * > | b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLineBefore(effects, ok, nok) {\n return start\n\n /**\n * Before eol, expecting blank line.\n *\n * ```markdown\n * > |
\n * ^\n * |\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return effects.attempt(blankLine, ok, nok)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding, markdownSpace} from 'micromark-util-character'\n/** @type {Construct} */\nconst nonLazyContinuation = {\n tokenize: tokenizeNonLazyContinuation,\n partial: true\n}\n\n/** @type {Construct} */\nexport const codeFenced = {\n name: 'codeFenced',\n tokenize: tokenizeCodeFenced,\n concrete: true\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCodeFenced(effects, ok, nok) {\n const self = this\n /** @type {Construct} */\n const closeStart = {\n tokenize: tokenizeCloseStart,\n partial: true\n }\n let initialPrefix = 0\n let sizeOpen = 0\n /** @type {NonNullable} */\n let marker\n return start\n\n /**\n * Start of code.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse whitespace like `markdown-rs`.\n return beforeSequenceOpen(code)\n }\n\n /**\n * In opening fence, after prefix, at sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeSequenceOpen(code) {\n const tail = self.events[self.events.length - 1]\n initialPrefix =\n tail && tail[1].type === 'linePrefix'\n ? tail[2].sliceSerialize(tail[1], true).length\n : 0\n marker = code\n effects.enter('codeFenced')\n effects.enter('codeFencedFence')\n effects.enter('codeFencedFenceSequence')\n return sequenceOpen(code)\n }\n\n /**\n * In opening fence sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === marker) {\n sizeOpen++\n effects.consume(code)\n return sequenceOpen\n }\n if (sizeOpen < 3) {\n return nok(code)\n }\n effects.exit('codeFencedFenceSequence')\n return markdownSpace(code)\n ? factorySpace(effects, infoBefore, 'whitespace')(code)\n : infoBefore(code)\n }\n\n /**\n * In opening fence, after the sequence (and optional whitespace), before info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function infoBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFencedFence')\n return self.interrupt\n ? ok(code)\n : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code)\n }\n effects.enter('codeFencedFenceInfo')\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return info(code)\n }\n\n /**\n * In info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function info(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceInfo')\n return infoBefore(code)\n }\n if (markdownSpace(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceInfo')\n return factorySpace(effects, metaBefore, 'whitespace')(code)\n }\n if (code === 96 && code === marker) {\n return nok(code)\n }\n effects.consume(code)\n return info\n }\n\n /**\n * In opening fence, after info and whitespace, before meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function metaBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return infoBefore(code)\n }\n effects.enter('codeFencedFenceMeta')\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return meta(code)\n }\n\n /**\n * In meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceMeta')\n return infoBefore(code)\n }\n if (code === 96 && code === marker) {\n return nok(code)\n }\n effects.consume(code)\n return meta\n }\n\n /**\n * At eol/eof in code, before a non-lazy closing fence or content.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function atNonLazyBreak(code) {\n return effects.attempt(closeStart, after, contentBefore)(code)\n }\n\n /**\n * Before code content, not a closing fence, at eol.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentBefore(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return contentStart\n }\n\n /**\n * Before code content, not a closing fence.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentStart(code) {\n return initialPrefix > 0 && markdownSpace(code)\n ? factorySpace(\n effects,\n beforeContentChunk,\n 'linePrefix',\n initialPrefix + 1\n )(code)\n : beforeContentChunk(code)\n }\n\n /**\n * Before code content, after optional prefix.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeContentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code)\n }\n effects.enter('codeFlowValue')\n return contentChunk(code)\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^^^^^^^^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFlowValue')\n return beforeContentChunk(code)\n }\n effects.consume(code)\n return contentChunk\n }\n\n /**\n * After code.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n effects.exit('codeFenced')\n return ok(code)\n }\n\n /**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\n function tokenizeCloseStart(effects, ok, nok) {\n let size = 0\n return startBefore\n\n /**\n *\n *\n * @type {State}\n */\n function startBefore(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return start\n }\n\n /**\n * Before closing fence, at optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Always populated by defaults.\n\n // To do: `enter` here or in next state?\n effects.enter('codeFencedFence')\n return markdownSpace(code)\n ? factorySpace(\n effects,\n beforeSequenceClose,\n 'linePrefix',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )(code)\n : beforeSequenceClose(code)\n }\n\n /**\n * In closing fence, after optional whitespace, at sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeSequenceClose(code) {\n if (code === marker) {\n effects.enter('codeFencedFenceSequence')\n return sequenceClose(code)\n }\n return nok(code)\n }\n\n /**\n * In closing fence sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n if (code === marker) {\n size++\n effects.consume(code)\n return sequenceClose\n }\n if (size >= sizeOpen) {\n effects.exit('codeFencedFenceSequence')\n return markdownSpace(code)\n ? factorySpace(effects, sequenceCloseAfter, 'whitespace')(code)\n : sequenceCloseAfter(code)\n }\n return nok(code)\n }\n\n /**\n * After closing fence sequence, after optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceCloseAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFencedFence')\n return ok(code)\n }\n return nok(code)\n }\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuation(effects, ok, nok) {\n const self = this\n return start\n\n /**\n *\n *\n * @type {State}\n */\n function start(code) {\n if (code === null) {\n return nok(code)\n }\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return lineStart\n }\n\n /**\n *\n *\n * @type {State}\n */\n function lineStart(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {\n asciiAlphanumeric,\n asciiDigit,\n asciiHexDigit\n} from 'micromark-util-character'\n/** @type {Construct} */\nexport const characterReference = {\n name: 'characterReference',\n tokenize: tokenizeCharacterReference\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterReference(effects, ok, nok) {\n const self = this\n let size = 0\n /** @type {number} */\n let max\n /** @type {(code: Code) => boolean} */\n let test\n return start\n\n /**\n * Start of character reference.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('characterReference')\n effects.enter('characterReferenceMarker')\n effects.consume(code)\n effects.exit('characterReferenceMarker')\n return open\n }\n\n /**\n * After `&`, at `#` for numeric references or alphanumeric for named\n * references.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 35) {\n effects.enter('characterReferenceMarkerNumeric')\n effects.consume(code)\n effects.exit('characterReferenceMarkerNumeric')\n return numeric\n }\n effects.enter('characterReferenceValue')\n max = 31\n test = asciiAlphanumeric\n return value(code)\n }\n\n /**\n * After `#`, at `x` for hexadecimals or digit for decimals.\n *\n * ```markdown\n * > | a{b\n * ^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function numeric(code) {\n if (code === 88 || code === 120) {\n effects.enter('characterReferenceMarkerHexadecimal')\n effects.consume(code)\n effects.exit('characterReferenceMarkerHexadecimal')\n effects.enter('characterReferenceValue')\n max = 6\n test = asciiHexDigit\n return value\n }\n effects.enter('characterReferenceValue')\n max = 7\n test = asciiDigit\n return value(code)\n }\n\n /**\n * After markers (`&#x`, `&#`, or `&`), in value, before `;`.\n *\n * The character reference kind defines what and how many characters are\n * allowed.\n *\n * ```markdown\n * > | a&b\n * ^^^\n * > | a{b\n * ^^^\n * > | a b\n * ^\n * ```\n *\n * @type {State}\n */\n function value(code) {\n if (code === 59 && size) {\n const token = effects.exit('characterReferenceValue')\n if (\n test === asciiAlphanumeric &&\n !decodeNamedCharacterReference(self.sliceSerialize(token))\n ) {\n return nok(code)\n }\n\n // To do: `markdown-rs` uses a different name:\n // `CharacterReferenceMarkerSemi`.\n effects.enter('characterReferenceMarker')\n effects.consume(code)\n effects.exit('characterReferenceMarker')\n effects.exit('characterReference')\n return ok\n }\n if (test(code) && size++ < max) {\n effects.consume(code)\n return value\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {asciiPunctuation} from 'micromark-util-character'\n/** @type {Construct} */\nexport const characterEscape = {\n name: 'characterEscape',\n tokenize: tokenizeCharacterEscape\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterEscape(effects, ok, nok) {\n return start\n\n /**\n * Start of character escape.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('characterEscape')\n effects.enter('escapeMarker')\n effects.consume(code)\n effects.exit('escapeMarker')\n return inside\n }\n\n /**\n * After `\\`, at punctuation.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // ASCII punctuation.\n if (asciiPunctuation(code)) {\n effects.enter('characterEscapeValue')\n effects.consume(code)\n effects.exit('characterEscapeValue')\n effects.exit('characterEscape')\n return ok\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEnding} from 'micromark-util-character'\n/** @type {Construct} */\nexport const lineEnding = {\n name: 'lineEnding',\n tokenize: tokenizeLineEnding\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLineEnding(effects, ok) {\n return start\n\n /** @type {State} */\n function start(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, ok, 'linePrefix')\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factoryDestination} from 'micromark-factory-destination'\nimport {factoryLabel} from 'micromark-factory-label'\nimport {factoryTitle} from 'micromark-factory-title'\nimport {factoryWhitespace} from 'micromark-factory-whitespace'\nimport {markdownLineEndingOrSpace} from 'micromark-util-character'\nimport {push, splice} from 'micromark-util-chunked'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nimport {resolveAll} from 'micromark-util-resolve-all'\n/** @type {Construct} */\nexport const labelEnd = {\n name: 'labelEnd',\n tokenize: tokenizeLabelEnd,\n resolveTo: resolveToLabelEnd,\n resolveAll: resolveAllLabelEnd\n}\n\n/** @type {Construct} */\nconst resourceConstruct = {\n tokenize: tokenizeResource\n}\n/** @type {Construct} */\nconst referenceFullConstruct = {\n tokenize: tokenizeReferenceFull\n}\n/** @type {Construct} */\nconst referenceCollapsedConstruct = {\n tokenize: tokenizeReferenceCollapsed\n}\n\n/** @type {Resolver} */\nfunction resolveAllLabelEnd(events) {\n let index = -1\n while (++index < events.length) {\n const token = events[index][1]\n if (\n token.type === 'labelImage' ||\n token.type === 'labelLink' ||\n token.type === 'labelEnd'\n ) {\n // Remove the marker.\n events.splice(index + 1, token.type === 'labelImage' ? 4 : 2)\n token.type = 'data'\n index++\n }\n }\n return events\n}\n\n/** @type {Resolver} */\nfunction resolveToLabelEnd(events, context) {\n let index = events.length\n let offset = 0\n /** @type {Token} */\n let token\n /** @type {number | undefined} */\n let open\n /** @type {number | undefined} */\n let close\n /** @type {Array} */\n let media\n\n // Find an opening.\n while (index--) {\n token = events[index][1]\n if (open) {\n // If we see another link, or inactive link label, we’ve been here before.\n if (\n token.type === 'link' ||\n (token.type === 'labelLink' && token._inactive)\n ) {\n break\n }\n\n // Mark other link openings as inactive, as we can’t have links in\n // links.\n if (events[index][0] === 'enter' && token.type === 'labelLink') {\n token._inactive = true\n }\n } else if (close) {\n if (\n events[index][0] === 'enter' &&\n (token.type === 'labelImage' || token.type === 'labelLink') &&\n !token._balanced\n ) {\n open = index\n if (token.type !== 'labelLink') {\n offset = 2\n break\n }\n }\n } else if (token.type === 'labelEnd') {\n close = index\n }\n }\n const group = {\n type: events[open][1].type === 'labelLink' ? 'link' : 'image',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n }\n const label = {\n type: 'label',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[close][1].end)\n }\n const text = {\n type: 'labelText',\n start: Object.assign({}, events[open + offset + 2][1].end),\n end: Object.assign({}, events[close - 2][1].start)\n }\n media = [\n ['enter', group, context],\n ['enter', label, context]\n ]\n\n // Opening marker.\n media = push(media, events.slice(open + 1, open + offset + 3))\n\n // Text open.\n media = push(media, [['enter', text, context]])\n\n // Always populated by defaults.\n\n // Between.\n media = push(\n media,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + offset + 4, close - 3),\n context\n )\n )\n\n // Text close, marker close, label close.\n media = push(media, [\n ['exit', text, context],\n events[close - 2],\n events[close - 1],\n ['exit', label, context]\n ])\n\n // Reference, resource, or so.\n media = push(media, events.slice(close + 1))\n\n // Media close.\n media = push(media, [['exit', group, context]])\n splice(events, open, events.length, media)\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLabelEnd(effects, ok, nok) {\n const self = this\n let index = self.events.length\n /** @type {Token} */\n let labelStart\n /** @type {boolean} */\n let defined\n\n // Find an opening.\n while (index--) {\n if (\n (self.events[index][1].type === 'labelImage' ||\n self.events[index][1].type === 'labelLink') &&\n !self.events[index][1]._balanced\n ) {\n labelStart = self.events[index][1]\n break\n }\n }\n return start\n\n /**\n * Start of label end.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // If there is not an okay opening.\n if (!labelStart) {\n return nok(code)\n }\n\n // If the corresponding label (link) start is marked as inactive,\n // it means we’d be wrapping a link, like this:\n //\n // ```markdown\n // > | a [b [c](d) e](f) g.\n // ^\n // ```\n //\n // We can’t have that, so it’s just balanced brackets.\n if (labelStart._inactive) {\n return labelEndNok(code)\n }\n defined = self.parser.defined.includes(\n normalizeIdentifier(\n self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })\n )\n )\n effects.enter('labelEnd')\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelEnd')\n return after\n }\n\n /**\n * After `]`.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Note: `markdown-rs` also parses GFM footnotes here, which for us is in\n // an extension.\n\n // Resource (`[asd](fgh)`)?\n if (code === 40) {\n return effects.attempt(\n resourceConstruct,\n labelEndOk,\n defined ? labelEndOk : labelEndNok\n )(code)\n }\n\n // Full (`[asd][fgh]`) or collapsed (`[asd][]`) reference?\n if (code === 91) {\n return effects.attempt(\n referenceFullConstruct,\n labelEndOk,\n defined ? referenceNotFull : labelEndNok\n )(code)\n }\n\n // Shortcut (`[asd]`) reference?\n return defined ? labelEndOk(code) : labelEndNok(code)\n }\n\n /**\n * After `]`, at `[`, but not at a full reference.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceNotFull(code) {\n return effects.attempt(\n referenceCollapsedConstruct,\n labelEndOk,\n labelEndNok\n )(code)\n }\n\n /**\n * Done, we found something.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndOk(code) {\n // Note: `markdown-rs` does a bunch of stuff here.\n return ok(code)\n }\n\n /**\n * Done, it’s nothing.\n *\n * There was an okay opening, but we didn’t match anything.\n *\n * ```markdown\n * > | [a](b c\n * ^\n * > | [a][b c\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndNok(code) {\n labelStart._balanced = true\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeResource(effects, ok, nok) {\n return resourceStart\n\n /**\n * At a resource.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceStart(code) {\n effects.enter('resource')\n effects.enter('resourceMarker')\n effects.consume(code)\n effects.exit('resourceMarker')\n return resourceBefore\n }\n\n /**\n * In resource, after `(`, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBefore(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, resourceOpen)(code)\n : resourceOpen(code)\n }\n\n /**\n * In resource, after optional whitespace, at `)` or a destination.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceOpen(code) {\n if (code === 41) {\n return resourceEnd(code)\n }\n return factoryDestination(\n effects,\n resourceDestinationAfter,\n resourceDestinationMissing,\n 'resourceDestination',\n 'resourceDestinationLiteral',\n 'resourceDestinationLiteralMarker',\n 'resourceDestinationRaw',\n 'resourceDestinationString',\n 32\n )(code)\n }\n\n /**\n * In resource, after destination, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationAfter(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, resourceBetween)(code)\n : resourceEnd(code)\n }\n\n /**\n * At invalid destination.\n *\n * ```markdown\n * > | [a](<<) b\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationMissing(code) {\n return nok(code)\n }\n\n /**\n * In resource, after destination and whitespace, at `(` or title.\n *\n * ```markdown\n * > | [a](b ) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBetween(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(\n effects,\n resourceTitleAfter,\n nok,\n 'resourceTitle',\n 'resourceTitleMarker',\n 'resourceTitleString'\n )(code)\n }\n return resourceEnd(code)\n }\n\n /**\n * In resource, after title, at optional whitespace.\n *\n * ```markdown\n * > | [a](b \"c\") d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceTitleAfter(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, resourceEnd)(code)\n : resourceEnd(code)\n }\n\n /**\n * In resource, at `)`.\n *\n * ```markdown\n * > | [a](b) d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceEnd(code) {\n if (code === 41) {\n effects.enter('resourceMarker')\n effects.consume(code)\n effects.exit('resourceMarker')\n effects.exit('resource')\n return ok\n }\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceFull(effects, ok, nok) {\n const self = this\n return referenceFull\n\n /**\n * In a reference (full), at the `[`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFull(code) {\n return factoryLabel.call(\n self,\n effects,\n referenceFullAfter,\n referenceFullMissing,\n 'reference',\n 'referenceMarker',\n 'referenceString'\n )(code)\n }\n\n /**\n * In a reference (full), after `]`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullAfter(code) {\n return self.parser.defined.includes(\n normalizeIdentifier(\n self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)\n )\n )\n ? ok(code)\n : nok(code)\n }\n\n /**\n * In reference (full) that was missing.\n *\n * ```markdown\n * > | [a][b d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullMissing(code) {\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceCollapsed(effects, ok, nok) {\n return referenceCollapsedStart\n\n /**\n * In reference (collapsed), at `[`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedStart(code) {\n // We only attempt a collapsed label if there’s a `[`.\n\n effects.enter('reference')\n effects.enter('referenceMarker')\n effects.consume(code)\n effects.exit('referenceMarker')\n return referenceCollapsedOpen\n }\n\n /**\n * In reference (collapsed), at `]`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedOpen(code) {\n if (code === 93) {\n effects.enter('referenceMarker')\n effects.consume(code)\n effects.exit('referenceMarker')\n effects.exit('reference')\n return ok\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {labelEnd} from './label-end.js'\n\n/** @type {Construct} */\nexport const labelStartImage = {\n name: 'labelStartImage',\n tokenize: tokenizeLabelStartImage,\n resolveAll: labelEnd.resolveAll\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartImage(effects, ok, nok) {\n const self = this\n return start\n\n /**\n * Start of label (image) start.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('labelImage')\n effects.enter('labelImageMarker')\n effects.consume(code)\n effects.exit('labelImageMarker')\n return open\n }\n\n /**\n * After `!`, at `[`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 91) {\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelImage')\n return after\n }\n return nok(code)\n }\n\n /**\n * After `![`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * This is needed in because, when GFM footnotes are enabled, images never\n * form when started with a `^`.\n * Instead, links form:\n *\n * ```markdown\n * ![^a](b)\n *\n * ![^a][b]\n *\n * [b]: c\n * ```\n *\n * ```html\n *

!^a

\n *

!^a

\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // To do: use a new field to do this, this is still needed for\n // `micromark-extension-gfm-footnote`, but the `label-start-link`\n // behavior isn’t.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs\n ? nok(code)\n : ok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n */\n\nimport {\n markdownLineEndingOrSpace,\n unicodePunctuation,\n unicodeWhitespace\n} from 'micromark-util-character'\n/**\n * Classify whether a code represents whitespace, punctuation, or something\n * else.\n *\n * Used for attention (emphasis, strong), whose sequences can open or close\n * based on the class of surrounding characters.\n *\n * > 👉 **Note**: eof (`null`) is seen as whitespace.\n *\n * @param {Code} code\n * Code.\n * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}\n * Group.\n */\nexport function classifyCharacter(code) {\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return 1\n }\n if (unicodePunctuation(code)) {\n return 2\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Point} Point\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {push, splice} from 'micromark-util-chunked'\nimport {classifyCharacter} from 'micromark-util-classify-character'\nimport {resolveAll} from 'micromark-util-resolve-all'\n/** @type {Construct} */\nexport const attention = {\n name: 'attention',\n tokenize: tokenizeAttention,\n resolveAll: resolveAllAttention\n}\n\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\n// eslint-disable-next-line complexity\nfunction resolveAllAttention(events, context) {\n let index = -1\n /** @type {number} */\n let open\n /** @type {Token} */\n let group\n /** @type {Token} */\n let text\n /** @type {Token} */\n let openingSequence\n /** @type {Token} */\n let closingSequence\n /** @type {number} */\n let use\n /** @type {Array} */\n let nextEvents\n /** @type {number} */\n let offset\n\n // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n while (++index < events.length) {\n // Find a token that can close.\n if (\n events[index][0] === 'enter' &&\n events[index][1].type === 'attentionSequence' &&\n events[index][1]._close\n ) {\n open = index\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (\n events[open][0] === 'exit' &&\n events[open][1].type === 'attentionSequence' &&\n events[open][1]._open &&\n // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) ===\n context.sliceSerialize(events[index][1]).charCodeAt(0)\n ) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if (\n (events[open][1]._close || events[index][1]._open) &&\n (events[index][1].end.offset - events[index][1].start.offset) % 3 &&\n !(\n (events[open][1].end.offset -\n events[open][1].start.offset +\n events[index][1].end.offset -\n events[index][1].start.offset) %\n 3\n )\n ) {\n continue\n }\n\n // Number of markers to use from the sequence.\n use =\n events[open][1].end.offset - events[open][1].start.offset > 1 &&\n events[index][1].end.offset - events[index][1].start.offset > 1\n ? 2\n : 1\n const start = Object.assign({}, events[open][1].end)\n const end = Object.assign({}, events[index][1].start)\n movePoint(start, -use)\n movePoint(end, use)\n openingSequence = {\n type: use > 1 ? 'strongSequence' : 'emphasisSequence',\n start,\n end: Object.assign({}, events[open][1].end)\n }\n closingSequence = {\n type: use > 1 ? 'strongSequence' : 'emphasisSequence',\n start: Object.assign({}, events[index][1].start),\n end\n }\n text = {\n type: use > 1 ? 'strongText' : 'emphasisText',\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n }\n group = {\n type: use > 1 ? 'strong' : 'emphasis',\n start: Object.assign({}, openingSequence.start),\n end: Object.assign({}, closingSequence.end)\n }\n events[open][1].end = Object.assign({}, openingSequence.start)\n events[index][1].start = Object.assign({}, closingSequence.end)\n nextEvents = []\n\n // If there are more markers in the opening, add them before.\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [\n ['enter', events[open][1], context],\n ['exit', events[open][1], context]\n ])\n }\n\n // Opening.\n nextEvents = push(nextEvents, [\n ['enter', group, context],\n ['enter', openingSequence, context],\n ['exit', openingSequence, context],\n ['enter', text, context]\n ])\n\n // Always populated by defaults.\n\n // Between.\n nextEvents = push(\n nextEvents,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + 1, index),\n context\n )\n )\n\n // Closing.\n nextEvents = push(nextEvents, [\n ['exit', text, context],\n ['enter', closingSequence, context],\n ['exit', closingSequence, context],\n ['exit', group, context]\n ])\n\n // If there are more markers in the closing, add them after.\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2\n nextEvents = push(nextEvents, [\n ['enter', events[index][1], context],\n ['exit', events[index][1], context]\n ])\n } else {\n offset = 0\n }\n splice(events, open - 1, index - open + 3, nextEvents)\n index = open + nextEvents.length - offset - 2\n break\n }\n }\n }\n }\n\n // Remove remaining sequences.\n index = -1\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data'\n }\n }\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null\n const previous = this.previous\n const before = classifyCharacter(previous)\n\n /** @type {NonNullable} */\n let marker\n return start\n\n /**\n * Before a sequence.\n *\n * ```markdown\n * > | **\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n marker = code\n effects.enter('attentionSequence')\n return inside(code)\n }\n\n /**\n * In a sequence.\n *\n * ```markdown\n * > | **\n * ^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code)\n return inside\n }\n const token = effects.exit('attentionSequence')\n\n // To do: next major: move this to resolver, just like `markdown-rs`.\n const after = classifyCharacter(code)\n\n // Always populated by defaults.\n\n const open =\n !after || (after === 2 && before) || attentionMarkers.includes(code)\n const close =\n !before || (before === 2 && after) || attentionMarkers.includes(previous)\n token._open = Boolean(marker === 42 ? open : open && (before || !close))\n token._close = Boolean(marker === 42 ? close : close && (after || !open))\n return ok(code)\n }\n}\n\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * @param {number} offset\n * @returns {undefined}\n */\nfunction movePoint(point, offset) {\n point.column += offset\n point.offset += offset\n point._bufferIndex += offset\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n asciiAtext,\n asciiControl\n} from 'micromark-util-character'\n/** @type {Construct} */\nexport const autolink = {\n name: 'autolink',\n tokenize: tokenizeAutolink\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeAutolink(effects, ok, nok) {\n let size = 0\n return start\n\n /**\n * Start of an autolink.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('autolink')\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.enter('autolinkProtocol')\n return open\n }\n\n /**\n * After `<`, at protocol or atext.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n return schemeOrEmailAtext\n }\n return emailAtext(code)\n }\n\n /**\n * At second byte of protocol or atext.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeOrEmailAtext(code) {\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) {\n // Count the previous alphabetical from `open` too.\n size = 1\n return schemeInsideOrEmailAtext(code)\n }\n return emailAtext(code)\n }\n\n /**\n * In ambiguous protocol or atext.\n *\n * ```markdown\n * > | ab\n * ^\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeInsideOrEmailAtext(code) {\n if (code === 58) {\n effects.consume(code)\n size = 0\n return urlInside\n }\n\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if (\n (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) &&\n size++ < 32\n ) {\n effects.consume(code)\n return schemeInsideOrEmailAtext\n }\n size = 0\n return emailAtext(code)\n }\n\n /**\n * After protocol, in URL.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function urlInside(code) {\n if (code === 62) {\n effects.exit('autolinkProtocol')\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.exit('autolink')\n return ok\n }\n\n // ASCII control, space, or `<`.\n if (code === null || code === 32 || code === 60 || asciiControl(code)) {\n return nok(code)\n }\n effects.consume(code)\n return urlInside\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function emailAtext(code) {\n if (code === 64) {\n effects.consume(code)\n return emailAtSignOrDot\n }\n if (asciiAtext(code)) {\n effects.consume(code)\n return emailAtext\n }\n return nok(code)\n }\n\n /**\n * In label, after at-sign or dot.\n *\n * ```markdown\n * > | ab\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function emailAtSignOrDot(code) {\n return asciiAlphanumeric(code) ? emailLabel(code) : nok(code)\n }\n\n /**\n * In label, where `.` and `>` are allowed.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function emailLabel(code) {\n if (code === 46) {\n effects.consume(code)\n size = 0\n return emailAtSignOrDot\n }\n if (code === 62) {\n // Exit, then change the token type.\n effects.exit('autolinkProtocol').type = 'autolinkEmail'\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.exit('autolink')\n return ok\n }\n return emailValue(code)\n }\n\n /**\n * In label, where `.` and `>` are *not* allowed.\n *\n * Though, this is also used in `emailLabel` to parse other values.\n *\n * ```markdown\n * > | ab\n * ^\n * ```\n *\n * @type {State}\n */\n function emailValue(code) {\n // ASCII alphanumeric or `-`.\n if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) {\n const next = code === 45 ? emailValue : emailLabel\n effects.consume(code)\n return next\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n markdownLineEnding,\n markdownLineEndingOrSpace,\n markdownSpace\n} from 'micromark-util-character'\n/** @type {Construct} */\nexport const htmlText = {\n name: 'htmlText',\n tokenize: tokenizeHtmlText\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlText(effects, ok, nok) {\n const self = this\n /** @type {NonNullable | undefined} */\n let marker\n /** @type {number} */\n let index\n /** @type {State} */\n let returnState\n return start\n\n /**\n * Start of HTML (text).\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('htmlText')\n effects.enter('htmlTextData')\n effects.consume(code)\n return open\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | a c\n * ^\n * > | a c\n * ^\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code)\n return declarationOpen\n }\n if (code === 47) {\n effects.consume(code)\n return tagCloseStart\n }\n if (code === 63) {\n effects.consume(code)\n return instruction\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code)\n return tagOpen\n }\n return nok(code)\n }\n\n /**\n * After ` | a c\n * ^\n * > | a c\n * ^\n * > | a &<]]> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code)\n return commentOpenInside\n }\n if (code === 91) {\n effects.consume(code)\n index = 0\n return cdataOpenInside\n }\n if (asciiAlpha(code)) {\n effects.consume(code)\n return declaration\n }\n return nok(code)\n }\n\n /**\n * In a comment, after ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code)\n return commentEnd\n }\n return nok(code)\n }\n\n /**\n * In comment.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function comment(code) {\n if (code === null) {\n return nok(code)\n }\n if (code === 45) {\n effects.consume(code)\n return commentClose\n }\n if (markdownLineEnding(code)) {\n returnState = comment\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return comment\n }\n\n /**\n * In comment, after `-`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentClose(code) {\n if (code === 45) {\n effects.consume(code)\n return commentEnd\n }\n return comment(code)\n }\n\n /**\n * In comment, after `--`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentEnd(code) {\n return code === 62\n ? end(code)\n : code === 45\n ? commentClose(code)\n : comment(code)\n }\n\n /**\n * After ` | a &<]]> b\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = 'CDATA['\n if (code === value.charCodeAt(index++)) {\n effects.consume(code)\n return index === value.length ? cdata : cdataOpenInside\n }\n return nok(code)\n }\n\n /**\n * In CDATA.\n *\n * ```markdown\n * > | a &<]]> b\n * ^^^\n * ```\n *\n * @type {State}\n */\n function cdata(code) {\n if (code === null) {\n return nok(code)\n }\n if (code === 93) {\n effects.consume(code)\n return cdataClose\n }\n if (markdownLineEnding(code)) {\n returnState = cdata\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return cdata\n }\n\n /**\n * In CDATA, after `]`, at another `]`.\n *\n * ```markdown\n * > | a &<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataClose(code) {\n if (code === 93) {\n effects.consume(code)\n return cdataEnd\n }\n return cdata(code)\n }\n\n /**\n * In CDATA, after `]]`, at `>`.\n *\n * ```markdown\n * > | a &<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataEnd(code) {\n if (code === 62) {\n return end(code)\n }\n if (code === 93) {\n effects.consume(code)\n return cdataEnd\n }\n return cdata(code)\n }\n\n /**\n * In declaration.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function declaration(code) {\n if (code === null || code === 62) {\n return end(code)\n }\n if (markdownLineEnding(code)) {\n returnState = declaration\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return declaration\n }\n\n /**\n * In instruction.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function instruction(code) {\n if (code === null) {\n return nok(code)\n }\n if (code === 63) {\n effects.consume(code)\n return instructionClose\n }\n if (markdownLineEnding(code)) {\n returnState = instruction\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return instruction\n }\n\n /**\n * In instruction, after `?`, at `>`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function instructionClose(code) {\n return code === 62 ? end(code) : instruction(code)\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code)\n return tagClose\n }\n return nok(code)\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagClose(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n return tagClose\n }\n return tagCloseBetween(code)\n }\n\n /**\n * In closing tag, after tag name.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseBetween(code) {\n if (markdownLineEnding(code)) {\n returnState = tagCloseBetween\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagCloseBetween\n }\n return end(code)\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpen(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n return tagOpen\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n return nok(code)\n }\n\n /**\n * In opening tag, after tag name.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenBetween(code) {\n if (code === 47) {\n effects.consume(code)\n return end\n }\n\n // ASCII alphabetical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code)\n return tagOpenAttributeName\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenBetween\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenBetween\n }\n return end(code)\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | a d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeName(code) {\n // ASCII alphabetical and `-`, `.`, `:`, and `_`.\n if (\n code === 45 ||\n code === 46 ||\n code === 58 ||\n code === 95 ||\n asciiAlphanumeric(code)\n ) {\n effects.consume(code)\n return tagOpenAttributeName\n }\n return tagOpenAttributeNameAfter(code)\n }\n\n /**\n * After attribute name, before initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | a d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code)\n return tagOpenAttributeValueBefore\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeNameAfter\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenAttributeNameAfter\n }\n return tagOpenBetween(code)\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueBefore(code) {\n if (\n code === null ||\n code === 60 ||\n code === 61 ||\n code === 62 ||\n code === 96\n ) {\n return nok(code)\n }\n if (code === 34 || code === 39) {\n effects.consume(code)\n marker = code\n return tagOpenAttributeValueQuoted\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueBefore\n return lineEndingBefore(code)\n }\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenAttributeValueBefore\n }\n effects.consume(code)\n return tagOpenAttributeValueUnquoted\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code)\n marker = undefined\n return tagOpenAttributeValueQuotedAfter\n }\n if (code === null) {\n return nok(code)\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueQuoted\n return lineEndingBefore(code)\n }\n effects.consume(code)\n return tagOpenAttributeValueQuoted\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueUnquoted(code) {\n if (\n code === null ||\n code === 34 ||\n code === 39 ||\n code === 60 ||\n code === 61 ||\n code === 96\n ) {\n return nok(code)\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n effects.consume(code)\n return tagOpenAttributeValueUnquoted\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the end\n * of the tag.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n return nok(code)\n }\n\n /**\n * In certain circumstances of a tag where only an `>` is allowed.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function end(code) {\n if (code === 62) {\n effects.consume(code)\n effects.exit('htmlTextData')\n effects.exit('htmlText')\n return ok\n }\n return nok(code)\n }\n\n /**\n * At eol.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * > | a \n * ```\n *\n * @type {State}\n */\n function lineEndingBefore(code) {\n effects.exit('htmlTextData')\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return lineEndingAfter\n }\n\n /**\n * After eol, at optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a \n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfter(code) {\n // Always populated by defaults.\n\n return markdownSpace(code)\n ? factorySpace(\n effects,\n lineEndingAfterPrefix,\n 'linePrefix',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )(code)\n : lineEndingAfterPrefix(code)\n }\n\n /**\n * After eol, after optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a \n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfterPrefix(code) {\n effects.enter('htmlTextData')\n return returnState(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {labelEnd} from './label-end.js'\n\n/** @type {Construct} */\nexport const labelStartLink = {\n name: 'labelStartLink',\n tokenize: tokenizeLabelStartLink,\n resolveAll: labelEnd.resolveAll\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartLink(effects, ok, nok) {\n const self = this\n return start\n\n /**\n * Start of label (link) start.\n *\n * ```markdown\n * > | a [b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('labelLink')\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelLink')\n return after\n }\n\n /** @type {State} */\n function after(code) {\n // To do: this isn’t needed in `micromark-extension-gfm-footnote`,\n // remove.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs\n ? nok(code)\n : ok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {markdownLineEnding} from 'micromark-util-character'\n/** @type {Construct} */\nexport const hardBreakEscape = {\n name: 'hardBreakEscape',\n tokenize: tokenizeHardBreakEscape\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeHardBreakEscape(effects, ok, nok) {\n return start\n\n /**\n * Start of a hard break (escape).\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('hardBreakEscape')\n effects.consume(code)\n return after\n }\n\n /**\n * After `\\`, at eol.\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownLineEnding(code)) {\n effects.exit('hardBreakEscape')\n return ok(code)\n }\n return nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').Previous} Previous\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {markdownLineEnding} from 'micromark-util-character'\n/** @type {Construct} */\nexport const codeText = {\n name: 'codeText',\n tokenize: tokenizeCodeText,\n resolve: resolveCodeText,\n previous\n}\n\n// To do: next major: don’t resolve, like `markdown-rs`.\n/** @type {Resolver} */\nfunction resolveCodeText(events) {\n let tailExitIndex = events.length - 4\n let headEnterIndex = 3\n /** @type {number} */\n let index\n /** @type {number | undefined} */\n let enter\n\n // If we start and end with an EOL or a space.\n if (\n (events[headEnterIndex][1].type === 'lineEnding' ||\n events[headEnterIndex][1].type === 'space') &&\n (events[tailExitIndex][1].type === 'lineEnding' ||\n events[tailExitIndex][1].type === 'space')\n ) {\n index = headEnterIndex\n\n // And we have data.\n while (++index < tailExitIndex) {\n if (events[index][1].type === 'codeTextData') {\n // Then we have padding.\n events[headEnterIndex][1].type = 'codeTextPadding'\n events[tailExitIndex][1].type = 'codeTextPadding'\n headEnterIndex += 2\n tailExitIndex -= 2\n break\n }\n }\n }\n\n // Merge adjacent spaces and data.\n index = headEnterIndex - 1\n tailExitIndex++\n while (++index <= tailExitIndex) {\n if (enter === undefined) {\n if (index !== tailExitIndex && events[index][1].type !== 'lineEnding') {\n enter = index\n }\n } else if (\n index === tailExitIndex ||\n events[index][1].type === 'lineEnding'\n ) {\n events[enter][1].type = 'codeTextData'\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end\n events.splice(enter + 2, index - enter - 2)\n tailExitIndex -= index - enter - 2\n index = enter + 2\n }\n enter = undefined\n }\n }\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Previous}\n */\nfunction previous(code) {\n // If there is a previous code, there will always be a tail.\n return (\n code !== 96 ||\n this.events[this.events.length - 1][1].type === 'characterEscape'\n )\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeCodeText(effects, ok, nok) {\n const self = this\n let sizeOpen = 0\n /** @type {number} */\n let size\n /** @type {Token} */\n let token\n return start\n\n /**\n * Start of code (text).\n *\n * ```markdown\n * > | `a`\n * ^\n * > | \\`a`\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('codeText')\n effects.enter('codeTextSequence')\n return sequenceOpen(code)\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 96) {\n effects.consume(code)\n sizeOpen++\n return sequenceOpen\n }\n effects.exit('codeTextSequence')\n return between(code)\n }\n\n /**\n * Between something and something else.\n *\n * ```markdown\n * > | `a`\n * ^^\n * ```\n *\n * @type {State}\n */\n function between(code) {\n // EOF.\n if (code === null) {\n return nok(code)\n }\n\n // To do: next major: don’t do spaces in resolve, but when compiling,\n // like `markdown-rs`.\n // Tabs don’t work, and virtual spaces don’t make sense.\n if (code === 32) {\n effects.enter('space')\n effects.consume(code)\n effects.exit('space')\n return between\n }\n\n // Closing fence? Could also be data.\n if (code === 96) {\n token = effects.enter('codeTextSequence')\n size = 0\n return sequenceClose(code)\n }\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return between\n }\n\n // Data.\n effects.enter('codeTextData')\n return data(code)\n }\n\n /**\n * In data.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (\n code === null ||\n code === 32 ||\n code === 96 ||\n markdownLineEnding(code)\n ) {\n effects.exit('codeTextData')\n return between(code)\n }\n effects.consume(code)\n return data\n }\n\n /**\n * In closing sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n // More.\n if (code === 96) {\n effects.consume(code)\n size++\n return sequenceClose\n }\n\n // Done!\n if (size === sizeOpen) {\n effects.exit('codeTextSequence')\n effects.exit('codeText')\n return ok(code)\n }\n\n // More or less accents: mark as data.\n token.type = 'codeTextData'\n return data(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Extension} Extension\n */\n\nimport {\n attention,\n autolink,\n blockQuote,\n characterEscape,\n characterReference,\n codeFenced,\n codeIndented,\n codeText,\n definition,\n hardBreakEscape,\n headingAtx,\n htmlFlow,\n htmlText,\n labelEnd,\n labelStartImage,\n labelStartLink,\n lineEnding,\n list,\n setextUnderline,\n thematicBreak\n} from 'micromark-core-commonmark'\nimport {resolver as resolveText} from './initialize/text.js'\n\n/** @satisfies {Extension['document']} */\nexport const document = {\n [42]: list,\n [43]: list,\n [45]: list,\n [48]: list,\n [49]: list,\n [50]: list,\n [51]: list,\n [52]: list,\n [53]: list,\n [54]: list,\n [55]: list,\n [56]: list,\n [57]: list,\n [62]: blockQuote\n}\n\n/** @satisfies {Extension['contentInitial']} */\nexport const contentInitial = {\n [91]: definition\n}\n\n/** @satisfies {Extension['flowInitial']} */\nexport const flowInitial = {\n [-2]: codeIndented,\n [-1]: codeIndented,\n [32]: codeIndented\n}\n\n/** @satisfies {Extension['flow']} */\nexport const flow = {\n [35]: headingAtx,\n [42]: thematicBreak,\n [45]: [setextUnderline, thematicBreak],\n [60]: htmlFlow,\n [61]: setextUnderline,\n [95]: thematicBreak,\n [96]: codeFenced,\n [126]: codeFenced\n}\n\n/** @satisfies {Extension['string']} */\nexport const string = {\n [38]: characterReference,\n [92]: characterEscape\n}\n\n/** @satisfies {Extension['text']} */\nexport const text = {\n [-5]: lineEnding,\n [-4]: lineEnding,\n [-3]: lineEnding,\n [33]: labelStartImage,\n [38]: characterReference,\n [42]: attention,\n [60]: [autolink, htmlText],\n [91]: labelStartLink,\n [92]: [hardBreakEscape, characterEscape],\n [93]: labelEnd,\n [95]: attention,\n [96]: codeText\n}\n\n/** @satisfies {Extension['insideSpan']} */\nexport const insideSpan = {\n null: [attention, resolveText]\n}\n\n/** @satisfies {Extension['attentionMarkers']} */\nexport const attentionMarkers = {\n null: [42, 95]\n}\n\n/** @satisfies {Extension['disable']} */\nexport const disable = {\n null: []\n}\n","/**\n * @typedef {import('micromark-util-types').Chunk} Chunk\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').Encoding} Encoding\n * @typedef {import('micromark-util-types').Value} Value\n */\n\n/**\n * @callback Preprocessor\n * @param {Value} value\n * @param {Encoding | null | undefined} [encoding]\n * @param {boolean | null | undefined} [end=false]\n * @returns {Array}\n */\n\nconst search = /[\\0\\t\\n\\r]/g\n\n/**\n * @returns {Preprocessor}\n */\nexport function preprocess() {\n let column = 1\n let buffer = ''\n /** @type {boolean | undefined} */\n let start = true\n /** @type {boolean | undefined} */\n let atCarriageReturn\n return preprocessor\n\n /** @type {Preprocessor} */\n // eslint-disable-next-line complexity\n function preprocessor(value, encoding, end) {\n /** @type {Array} */\n const chunks = []\n /** @type {RegExpMatchArray | null} */\n let match\n /** @type {number} */\n let next\n /** @type {number} */\n let startPosition\n /** @type {number} */\n let endPosition\n /** @type {Code} */\n let code\n value =\n buffer +\n (typeof value === 'string'\n ? value.toString()\n : new TextDecoder(encoding || undefined).decode(value))\n startPosition = 0\n buffer = ''\n if (start) {\n // To do: `markdown-rs` actually parses BOMs (byte order mark).\n if (value.charCodeAt(0) === 65279) {\n startPosition++\n }\n start = undefined\n }\n while (startPosition < value.length) {\n search.lastIndex = startPosition\n match = search.exec(value)\n endPosition =\n match && match.index !== undefined ? match.index : value.length\n code = value.charCodeAt(endPosition)\n if (!match) {\n buffer = value.slice(startPosition)\n break\n }\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3)\n atCarriageReturn = undefined\n } else {\n if (atCarriageReturn) {\n chunks.push(-5)\n atCarriageReturn = undefined\n }\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition))\n column += endPosition - startPosition\n }\n switch (code) {\n case 0: {\n chunks.push(65533)\n column++\n break\n }\n case 9: {\n next = Math.ceil(column / 4) * 4\n chunks.push(-2)\n while (column++ < next) chunks.push(-1)\n break\n }\n case 10: {\n chunks.push(-4)\n column = 1\n break\n }\n default: {\n atCarriageReturn = true\n column = 1\n }\n }\n }\n startPosition = endPosition + 1\n }\n if (end) {\n if (atCarriageReturn) chunks.push(-5)\n if (buffer) chunks.push(buffer)\n chunks.push(null)\n }\n return chunks\n }\n}\n","/**\n * Turn the number (in string form as either hexa- or plain decimal) coming from\n * a numeric character reference into a character.\n *\n * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes\n * non-characters and control characters safe.\n *\n * @param {string} value\n * Value to decode.\n * @param {number} base\n * Numeric base.\n * @returns {string}\n * Character.\n */\nexport function decodeNumericCharacterReference(value, base) {\n const code = Number.parseInt(value, base);\n if (\n // C0 except for HT, LF, FF, CR, space.\n code < 9 || code === 11 || code > 13 && code < 32 ||\n // Control character (DEL) of C0, and C1 controls.\n code > 126 && code < 160 ||\n // Lone high surrogates and low surrogates.\n code > 55_295 && code < 57_344 ||\n // Noncharacters.\n code > 64_975 && code < 65_008 || /* eslint-disable no-bitwise */\n (code & 65_535) === 65_535 || (code & 65_535) === 65_534 || /* eslint-enable no-bitwise */\n // Out of range\n code > 1_114_111) {\n return \"\\uFFFD\";\n }\n return String.fromCodePoint(code);\n}","import {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'\nconst characterEscapeOrReference =\n /\\\\([!-/:-@[-`{-~])|&(#(?:\\d{1,7}|x[\\da-f]{1,6})|[\\da-z]{1,31});/gi\n\n/**\n * Decode markdown strings (which occur in places such as fenced code info\n * strings, destinations, labels, and titles).\n *\n * The “string” content type allows character escapes and -references.\n * This decodes those.\n *\n * @param {string} value\n * Value to decode.\n * @returns {string}\n * Decoded value.\n */\nexport function decodeString(value) {\n return value.replace(characterEscapeOrReference, decode)\n}\n\n/**\n * @param {string} $0\n * @param {string} $1\n * @param {string} $2\n * @returns {string}\n */\nfunction decode($0, $1, $2) {\n if ($1) {\n // Escape.\n return $1\n }\n\n // Reference.\n const head = $2.charCodeAt(0)\n if (head === 35) {\n const head = $2.charCodeAt(1)\n const hex = head === 120 || head === 88\n return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10)\n }\n return decodeNamedCharacterReference($2) || $0\n}\n","/**\n * @typedef {import('mdast').Break} Break\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('mdast').Code} Code\n * @typedef {import('mdast').Definition} Definition\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('mdast').Html} Html\n * @typedef {import('mdast').Image} Image\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('mdast').Link} Link\n * @typedef {import('mdast').List} List\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Nodes} Nodes\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n * @typedef {import('mdast').ReferenceType} ReferenceType\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('mdast').Text} Text\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n *\n * @typedef {import('micromark-util-types').Encoding} Encoding\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').ParseOptions} ParseOptions\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Value} Value\n *\n * @typedef {import('unist').Point} Point\n *\n * @typedef {import('../index.js').CompileData} CompileData\n */\n\n/**\n * @typedef {Omit & {type: 'fragment', children: Array}} Fragment\n */\n\n/**\n * @callback Transform\n * Extra transform, to change the AST afterwards.\n * @param {Root} tree\n * Tree to transform.\n * @returns {Root | null | undefined | void}\n * New tree or nothing (in which case the current tree is used).\n *\n * @callback Handle\n * Handle a token.\n * @param {CompileContext} this\n * Context.\n * @param {Token} token\n * Current token.\n * @returns {undefined | void}\n * Nothing.\n *\n * @typedef {Record} Handles\n * Token types mapping to handles\n *\n * @callback OnEnterError\n * Handle the case where the `right` token is open, but it is closed (by the\n * `left` token) or because we reached the end of the document.\n * @param {Omit} this\n * Context.\n * @param {Token | undefined} left\n * Left token.\n * @param {Token} right\n * Right token.\n * @returns {undefined}\n * Nothing.\n *\n * @callback OnExitError\n * Handle the case where the `right` token is open but it is closed by\n * exiting the `left` token.\n * @param {Omit} this\n * Context.\n * @param {Token} left\n * Left token.\n * @param {Token} right\n * Right token.\n * @returns {undefined}\n * Nothing.\n *\n * @typedef {[Token, OnEnterError | undefined]} TokenTuple\n * Open token on the stack, with an optional error handler for when\n * that token isn’t closed properly.\n */\n\n/**\n * @typedef Config\n * Configuration.\n *\n * We have our defaults, but extensions will add more.\n * @property {Array} canContainEols\n * Token types where line endings are used.\n * @property {Handles} enter\n * Opening handles.\n * @property {Handles} exit\n * Closing handles.\n * @property {Array} transforms\n * Tree transforms.\n *\n * @typedef {Partial} Extension\n * Change how markdown tokens from micromark are turned into mdast.\n *\n * @typedef CompileContext\n * mdast compiler context.\n * @property {Array} stack\n * Stack of nodes.\n * @property {Array} tokenStack\n * Stack of tokens.\n * @property {(this: CompileContext) => undefined} buffer\n * Capture some of the output data.\n * @property {(this: CompileContext) => string} resume\n * Stop capturing and access the output data.\n * @property {(this: CompileContext, node: Nodes, token: Token, onError?: OnEnterError) => undefined} enter\n * Enter a node.\n * @property {(this: CompileContext, token: Token, onError?: OnExitError) => undefined} exit\n * Exit a node.\n * @property {TokenizeContext['sliceSerialize']} sliceSerialize\n * Get the string value of a token.\n * @property {Config} config\n * Configuration.\n * @property {CompileData} data\n * Info passed around; key/value store.\n *\n * @typedef FromMarkdownOptions\n * Configuration for how to build mdast.\n * @property {Array> | null | undefined} [mdastExtensions]\n * Extensions for this utility to change how tokens are turned into a tree.\n *\n * @typedef {ParseOptions & FromMarkdownOptions} Options\n * Configuration.\n */\n\nimport {toString} from 'mdast-util-to-string'\nimport {parse, postprocess, preprocess} from 'micromark'\nimport {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'\nimport {decodeString} from 'micromark-util-decode-string'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nimport {decodeNamedCharacterReference} from 'decode-named-character-reference'\nimport {stringifyPosition} from 'unist-util-stringify-position'\nconst own = {}.hasOwnProperty\n\n/**\n * Turn markdown into a syntax tree.\n *\n * @overload\n * @param {Value} value\n * @param {Encoding | null | undefined} [encoding]\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @overload\n * @param {Value} value\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @param {Value} value\n * Markdown to parse.\n * @param {Encoding | Options | null | undefined} [encoding]\n * Character encoding for when `value` is `Buffer`.\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {Root}\n * mdast tree.\n */\nexport function fromMarkdown(value, encoding, options) {\n if (typeof encoding !== 'string') {\n options = encoding\n encoding = undefined\n }\n return compiler(options)(\n postprocess(\n parse(options).document().write(preprocess()(value, encoding, true))\n )\n )\n}\n\n/**\n * Note this compiler only understand complete buffering, not streaming.\n *\n * @param {Options | null | undefined} [options]\n */\nfunction compiler(options) {\n /** @type {Config} */\n const config = {\n transforms: [],\n canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],\n enter: {\n autolink: opener(link),\n autolinkProtocol: onenterdata,\n autolinkEmail: onenterdata,\n atxHeading: opener(heading),\n blockQuote: opener(blockQuote),\n characterEscape: onenterdata,\n characterReference: onenterdata,\n codeFenced: opener(codeFlow),\n codeFencedFenceInfo: buffer,\n codeFencedFenceMeta: buffer,\n codeIndented: opener(codeFlow, buffer),\n codeText: opener(codeText, buffer),\n codeTextData: onenterdata,\n data: onenterdata,\n codeFlowValue: onenterdata,\n definition: opener(definition),\n definitionDestinationString: buffer,\n definitionLabelString: buffer,\n definitionTitleString: buffer,\n emphasis: opener(emphasis),\n hardBreakEscape: opener(hardBreak),\n hardBreakTrailing: opener(hardBreak),\n htmlFlow: opener(html, buffer),\n htmlFlowData: onenterdata,\n htmlText: opener(html, buffer),\n htmlTextData: onenterdata,\n image: opener(image),\n label: buffer,\n link: opener(link),\n listItem: opener(listItem),\n listItemValue: onenterlistitemvalue,\n listOrdered: opener(list, onenterlistordered),\n listUnordered: opener(list),\n paragraph: opener(paragraph),\n reference: onenterreference,\n referenceString: buffer,\n resourceDestinationString: buffer,\n resourceTitleString: buffer,\n setextHeading: opener(heading),\n strong: opener(strong),\n thematicBreak: opener(thematicBreak)\n },\n exit: {\n atxHeading: closer(),\n atxHeadingSequence: onexitatxheadingsequence,\n autolink: closer(),\n autolinkEmail: onexitautolinkemail,\n autolinkProtocol: onexitautolinkprotocol,\n blockQuote: closer(),\n characterEscapeValue: onexitdata,\n characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,\n characterReferenceMarkerNumeric: onexitcharacterreferencemarker,\n characterReferenceValue: onexitcharacterreferencevalue,\n codeFenced: closer(onexitcodefenced),\n codeFencedFence: onexitcodefencedfence,\n codeFencedFenceInfo: onexitcodefencedfenceinfo,\n codeFencedFenceMeta: onexitcodefencedfencemeta,\n codeFlowValue: onexitdata,\n codeIndented: closer(onexitcodeindented),\n codeText: closer(onexitcodetext),\n codeTextData: onexitdata,\n data: onexitdata,\n definition: closer(),\n definitionDestinationString: onexitdefinitiondestinationstring,\n definitionLabelString: onexitdefinitionlabelstring,\n definitionTitleString: onexitdefinitiontitlestring,\n emphasis: closer(),\n hardBreakEscape: closer(onexithardbreak),\n hardBreakTrailing: closer(onexithardbreak),\n htmlFlow: closer(onexithtmlflow),\n htmlFlowData: onexitdata,\n htmlText: closer(onexithtmltext),\n htmlTextData: onexitdata,\n image: closer(onexitimage),\n label: onexitlabel,\n labelText: onexitlabeltext,\n lineEnding: onexitlineending,\n link: closer(onexitlink),\n listItem: closer(),\n listOrdered: closer(),\n listUnordered: closer(),\n paragraph: closer(),\n referenceString: onexitreferencestring,\n resourceDestinationString: onexitresourcedestinationstring,\n resourceTitleString: onexitresourcetitlestring,\n resource: onexitresource,\n setextHeading: closer(onexitsetextheading),\n setextHeadingLineSequence: onexitsetextheadinglinesequence,\n setextHeadingText: onexitsetextheadingtext,\n strong: closer(),\n thematicBreak: closer()\n }\n }\n configure(config, (options || {}).mdastExtensions || [])\n\n /** @type {CompileData} */\n const data = {}\n return compile\n\n /**\n * Turn micromark events into an mdast tree.\n *\n * @param {Array} events\n * Events.\n * @returns {Root}\n * mdast tree.\n */\n function compile(events) {\n /** @type {Root} */\n let tree = {\n type: 'root',\n children: []\n }\n /** @type {Omit} */\n const context = {\n stack: [tree],\n tokenStack: [],\n config,\n enter,\n exit,\n buffer,\n resume,\n data\n }\n /** @type {Array} */\n const listStack = []\n let index = -1\n while (++index < events.length) {\n // We preprocess lists to add `listItem` tokens, and to infer whether\n // items the list itself are spread out.\n if (\n events[index][1].type === 'listOrdered' ||\n events[index][1].type === 'listUnordered'\n ) {\n if (events[index][0] === 'enter') {\n listStack.push(index)\n } else {\n const tail = listStack.pop()\n index = prepareList(events, tail, index)\n }\n }\n }\n index = -1\n while (++index < events.length) {\n const handler = config[events[index][0]]\n if (own.call(handler, events[index][1].type)) {\n handler[events[index][1].type].call(\n Object.assign(\n {\n sliceSerialize: events[index][2].sliceSerialize\n },\n context\n ),\n events[index][1]\n )\n }\n }\n\n // Handle tokens still being open.\n if (context.tokenStack.length > 0) {\n const tail = context.tokenStack[context.tokenStack.length - 1]\n const handler = tail[1] || defaultOnError\n handler.call(context, undefined, tail[0])\n }\n\n // Figure out `root` position.\n tree.position = {\n start: point(\n events.length > 0\n ? events[0][1].start\n : {\n line: 1,\n column: 1,\n offset: 0\n }\n ),\n end: point(\n events.length > 0\n ? events[events.length - 2][1].end\n : {\n line: 1,\n column: 1,\n offset: 0\n }\n )\n }\n\n // Call transforms.\n index = -1\n while (++index < config.transforms.length) {\n tree = config.transforms[index](tree) || tree\n }\n return tree\n }\n\n /**\n * @param {Array} events\n * @param {number} start\n * @param {number} length\n * @returns {number}\n */\n function prepareList(events, start, length) {\n let index = start - 1\n let containerBalance = -1\n let listSpread = false\n /** @type {Token | undefined} */\n let listItem\n /** @type {number | undefined} */\n let lineIndex\n /** @type {number | undefined} */\n let firstBlankLineIndex\n /** @type {boolean | undefined} */\n let atMarker\n while (++index <= length) {\n const event = events[index]\n switch (event[1].type) {\n case 'listUnordered':\n case 'listOrdered':\n case 'blockQuote': {\n if (event[0] === 'enter') {\n containerBalance++\n } else {\n containerBalance--\n }\n atMarker = undefined\n break\n }\n case 'lineEndingBlank': {\n if (event[0] === 'enter') {\n if (\n listItem &&\n !atMarker &&\n !containerBalance &&\n !firstBlankLineIndex\n ) {\n firstBlankLineIndex = index\n }\n atMarker = undefined\n }\n break\n }\n case 'linePrefix':\n case 'listItemValue':\n case 'listItemMarker':\n case 'listItemPrefix':\n case 'listItemPrefixWhitespace': {\n // Empty.\n\n break\n }\n default: {\n atMarker = undefined\n }\n }\n if (\n (!containerBalance &&\n event[0] === 'enter' &&\n event[1].type === 'listItemPrefix') ||\n (containerBalance === -1 &&\n event[0] === 'exit' &&\n (event[1].type === 'listUnordered' ||\n event[1].type === 'listOrdered'))\n ) {\n if (listItem) {\n let tailIndex = index\n lineIndex = undefined\n while (tailIndex--) {\n const tailEvent = events[tailIndex]\n if (\n tailEvent[1].type === 'lineEnding' ||\n tailEvent[1].type === 'lineEndingBlank'\n ) {\n if (tailEvent[0] === 'exit') continue\n if (lineIndex) {\n events[lineIndex][1].type = 'lineEndingBlank'\n listSpread = true\n }\n tailEvent[1].type = 'lineEnding'\n lineIndex = tailIndex\n } else if (\n tailEvent[1].type === 'linePrefix' ||\n tailEvent[1].type === 'blockQuotePrefix' ||\n tailEvent[1].type === 'blockQuotePrefixWhitespace' ||\n tailEvent[1].type === 'blockQuoteMarker' ||\n tailEvent[1].type === 'listItemIndent'\n ) {\n // Empty\n } else {\n break\n }\n }\n if (\n firstBlankLineIndex &&\n (!lineIndex || firstBlankLineIndex < lineIndex)\n ) {\n listItem._spread = true\n }\n\n // Fix position.\n listItem.end = Object.assign(\n {},\n lineIndex ? events[lineIndex][1].start : event[1].end\n )\n events.splice(lineIndex || index, 0, ['exit', listItem, event[2]])\n index++\n length++\n }\n\n // Create a new list item.\n if (event[1].type === 'listItemPrefix') {\n /** @type {Token} */\n const item = {\n type: 'listItem',\n _spread: false,\n start: Object.assign({}, event[1].start),\n // @ts-expect-error: we’ll add `end` in a second.\n end: undefined\n }\n listItem = item\n events.splice(index, 0, ['enter', item, event[2]])\n index++\n length++\n firstBlankLineIndex = undefined\n atMarker = true\n }\n }\n }\n events[start][1]._spread = listSpread\n return length\n }\n\n /**\n * Create an opener handle.\n *\n * @param {(token: Token) => Nodes} create\n * Create a node.\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function opener(create, and) {\n return open\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function open(token) {\n enter.call(this, create(token), token)\n if (and) and.call(this, token)\n }\n }\n\n /**\n * @this {CompileContext}\n * @returns {undefined}\n */\n function buffer() {\n this.stack.push({\n type: 'fragment',\n children: []\n })\n }\n\n /**\n * @this {CompileContext}\n * Context.\n * @param {Nodes} node\n * Node to enter.\n * @param {Token} token\n * Corresponding token.\n * @param {OnEnterError | undefined} [errorHandler]\n * Handle the case where this token is open, but it is closed by something else.\n * @returns {undefined}\n * Nothing.\n */\n function enter(node, token, errorHandler) {\n const parent = this.stack[this.stack.length - 1]\n /** @type {Array} */\n const siblings = parent.children\n siblings.push(node)\n this.stack.push(node)\n this.tokenStack.push([token, errorHandler])\n node.position = {\n start: point(token.start),\n // @ts-expect-error: `end` will be patched later.\n end: undefined\n }\n }\n\n /**\n * Create a closer handle.\n *\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function closer(and) {\n return close\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function close(token) {\n if (and) and.call(this, token)\n exit.call(this, token)\n }\n }\n\n /**\n * @this {CompileContext}\n * Context.\n * @param {Token} token\n * Corresponding token.\n * @param {OnExitError | undefined} [onExitError]\n * Handle the case where another token is open.\n * @returns {undefined}\n * Nothing.\n */\n function exit(token, onExitError) {\n const node = this.stack.pop()\n const open = this.tokenStack.pop()\n if (!open) {\n throw new Error(\n 'Cannot close `' +\n token.type +\n '` (' +\n stringifyPosition({\n start: token.start,\n end: token.end\n }) +\n '): it’s not open'\n )\n } else if (open[0].type !== token.type) {\n if (onExitError) {\n onExitError.call(this, token, open[0])\n } else {\n const handler = open[1] || defaultOnError\n handler.call(this, token, open[0])\n }\n }\n node.position.end = point(token.end)\n }\n\n /**\n * @this {CompileContext}\n * @returns {string}\n */\n function resume() {\n return toString(this.stack.pop())\n }\n\n //\n // Handlers.\n //\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistordered() {\n this.data.expectingFirstListItemValue = true\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistitemvalue(token) {\n if (this.data.expectingFirstListItemValue) {\n const ancestor = this.stack[this.stack.length - 2]\n ancestor.start = Number.parseInt(this.sliceSerialize(token), 10)\n this.data.expectingFirstListItemValue = undefined\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfenceinfo() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.lang = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfencemeta() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.meta = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfence() {\n // Exit if this is the closing fence.\n if (this.data.flowCodeInside) return\n this.buffer()\n this.data.flowCodeInside = true\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefenced() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data.replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '')\n this.data.flowCodeInside = undefined\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodeindented() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data.replace(/(\\r?\\n|\\r)$/g, '')\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitionlabelstring(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.label = label\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiontitlestring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.title = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiondestinationstring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.url = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitatxheadingsequence(token) {\n const node = this.stack[this.stack.length - 1]\n if (!node.depth) {\n const depth = this.sliceSerialize(token).length\n node.depth = depth\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadingtext() {\n this.data.setextHeadingSlurpLineEnding = true\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadinglinesequence(token) {\n const node = this.stack[this.stack.length - 1]\n node.depth = this.sliceSerialize(token).codePointAt(0) === 61 ? 1 : 2\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheading() {\n this.data.setextHeadingSlurpLineEnding = undefined\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterdata(token) {\n const node = this.stack[this.stack.length - 1]\n /** @type {Array} */\n const siblings = node.children\n let tail = siblings[siblings.length - 1]\n if (!tail || tail.type !== 'text') {\n // Add a new text node.\n tail = text()\n tail.position = {\n start: point(token.start),\n // @ts-expect-error: we’ll add `end` later.\n end: undefined\n }\n siblings.push(tail)\n }\n this.stack.push(tail)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitdata(token) {\n const tail = this.stack.pop()\n tail.value += this.sliceSerialize(token)\n tail.position.end = point(token.end)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlineending(token) {\n const context = this.stack[this.stack.length - 1]\n // If we’re at a hard break, include the line ending in there.\n if (this.data.atHardBreak) {\n const tail = context.children[context.children.length - 1]\n tail.position.end = point(token.end)\n this.data.atHardBreak = undefined\n return\n }\n if (\n !this.data.setextHeadingSlurpLineEnding &&\n config.canContainEols.includes(context.type)\n ) {\n onenterdata.call(this, token)\n onexitdata.call(this, token)\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithardbreak() {\n this.data.atHardBreak = true\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmlflow() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmltext() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcodetext() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.value = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlink() {\n const node = this.stack[this.stack.length - 1]\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut'\n node.type += 'Reference'\n // @ts-expect-error: mutate.\n node.referenceType = referenceType\n // @ts-expect-error: mutate.\n delete node.url\n delete node.title\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier\n // @ts-expect-error: mutate.\n delete node.label\n }\n this.data.referenceType = undefined\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitimage() {\n const node = this.stack[this.stack.length - 1]\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut'\n node.type += 'Reference'\n // @ts-expect-error: mutate.\n node.referenceType = referenceType\n // @ts-expect-error: mutate.\n delete node.url\n delete node.title\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier\n // @ts-expect-error: mutate.\n delete node.label\n }\n this.data.referenceType = undefined\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabeltext(token) {\n const string = this.sliceSerialize(token)\n const ancestor = this.stack[this.stack.length - 2]\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n ancestor.label = decodeString(string)\n // @ts-expect-error: same as above.\n ancestor.identifier = normalizeIdentifier(string).toLowerCase()\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabel() {\n const fragment = this.stack[this.stack.length - 1]\n const value = this.resume()\n const node = this.stack[this.stack.length - 1]\n // Assume a reference.\n this.data.inReference = true\n if (node.type === 'link') {\n /** @type {Array} */\n const children = fragment.children\n node.children = children\n } else {\n node.alt = value\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcedestinationstring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.url = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcetitlestring() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n node.title = data\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresource() {\n this.data.inReference = undefined\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterreference() {\n this.data.referenceType = 'collapsed'\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitreferencestring(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n node.label = label\n // @ts-expect-error: same as above.\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n this.data.referenceType = 'full'\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcharacterreferencemarker(token) {\n this.data.characterReferenceType = token.type\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreferencevalue(token) {\n const data = this.sliceSerialize(token)\n const type = this.data.characterReferenceType\n /** @type {string} */\n let value\n if (type) {\n value = decodeNumericCharacterReference(\n data,\n type === 'characterReferenceMarkerNumeric' ? 10 : 16\n )\n this.data.characterReferenceType = undefined\n } else {\n const result = decodeNamedCharacterReference(data)\n value = result\n }\n const tail = this.stack.pop()\n tail.value += value\n tail.position.end = point(token.end)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkprotocol(token) {\n onexitdata.call(this, token)\n const node = this.stack[this.stack.length - 1]\n node.url = this.sliceSerialize(token)\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkemail(token) {\n onexitdata.call(this, token)\n const node = this.stack[this.stack.length - 1]\n node.url = 'mailto:' + this.sliceSerialize(token)\n }\n\n //\n // Creaters.\n //\n\n /** @returns {Blockquote} */\n function blockQuote() {\n return {\n type: 'blockquote',\n children: []\n }\n }\n\n /** @returns {Code} */\n function codeFlow() {\n return {\n type: 'code',\n lang: null,\n meta: null,\n value: ''\n }\n }\n\n /** @returns {InlineCode} */\n function codeText() {\n return {\n type: 'inlineCode',\n value: ''\n }\n }\n\n /** @returns {Definition} */\n function definition() {\n return {\n type: 'definition',\n identifier: '',\n label: null,\n title: null,\n url: ''\n }\n }\n\n /** @returns {Emphasis} */\n function emphasis() {\n return {\n type: 'emphasis',\n children: []\n }\n }\n\n /** @returns {Heading} */\n function heading() {\n return {\n type: 'heading',\n // @ts-expect-error `depth` will be set later.\n depth: 0,\n children: []\n }\n }\n\n /** @returns {Break} */\n function hardBreak() {\n return {\n type: 'break'\n }\n }\n\n /** @returns {Html} */\n function html() {\n return {\n type: 'html',\n value: ''\n }\n }\n\n /** @returns {Image} */\n function image() {\n return {\n type: 'image',\n title: null,\n url: '',\n alt: null\n }\n }\n\n /** @returns {Link} */\n function link() {\n return {\n type: 'link',\n title: null,\n url: '',\n children: []\n }\n }\n\n /**\n * @param {Token} token\n * @returns {List}\n */\n function list(token) {\n return {\n type: 'list',\n ordered: token.type === 'listOrdered',\n start: null,\n spread: token._spread,\n children: []\n }\n }\n\n /**\n * @param {Token} token\n * @returns {ListItem}\n */\n function listItem(token) {\n return {\n type: 'listItem',\n spread: token._spread,\n checked: null,\n children: []\n }\n }\n\n /** @returns {Paragraph} */\n function paragraph() {\n return {\n type: 'paragraph',\n children: []\n }\n }\n\n /** @returns {Strong} */\n function strong() {\n return {\n type: 'strong',\n children: []\n }\n }\n\n /** @returns {Text} */\n function text() {\n return {\n type: 'text',\n value: ''\n }\n }\n\n /** @returns {ThematicBreak} */\n function thematicBreak() {\n return {\n type: 'thematicBreak'\n }\n }\n}\n\n/**\n * Copy a point-like value.\n *\n * @param {Point} d\n * Point-like value.\n * @returns {Point}\n * unist point.\n */\nfunction point(d) {\n return {\n line: d.line,\n column: d.column,\n offset: d.offset\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Array | Extension>} extensions\n * @returns {undefined}\n */\nfunction configure(combined, extensions) {\n let index = -1\n while (++index < extensions.length) {\n const value = extensions[index]\n if (Array.isArray(value)) {\n configure(combined, value)\n } else {\n extension(combined, value)\n }\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Extension} extension\n * @returns {undefined}\n */\nfunction extension(combined, extension) {\n /** @type {keyof Extension} */\n let key\n for (key in extension) {\n if (own.call(extension, key)) {\n switch (key) {\n case 'canContainEols': {\n const right = extension[key]\n if (right) {\n combined[key].push(...right)\n }\n break\n }\n case 'transforms': {\n const right = extension[key]\n if (right) {\n combined[key].push(...right)\n }\n break\n }\n case 'enter':\n case 'exit': {\n const right = extension[key]\n if (right) {\n Object.assign(combined[key], right)\n }\n break\n }\n // No default\n }\n }\n }\n}\n\n/** @type {OnEnterError} */\nfunction defaultOnError(left, right) {\n if (left) {\n throw new Error(\n 'Cannot close `' +\n left.type +\n '` (' +\n stringifyPosition({\n start: left.start,\n end: left.end\n }) +\n '): a different token (`' +\n right.type +\n '`, ' +\n stringifyPosition({\n start: right.start,\n end: right.end\n }) +\n ') is open'\n )\n } else {\n throw new Error(\n 'Cannot close document, a token (`' +\n right.type +\n '`, ' +\n stringifyPosition({\n start: right.start,\n end: right.end\n }) +\n ') is still open'\n )\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n */\n\nimport {subtokenize} from 'micromark-util-subtokenize'\n\n/**\n * @param {Array} events\n * @returns {Array}\n */\nexport function postprocess(events) {\n while (!subtokenize(events)) {\n // Empty\n }\n return events\n}\n","/**\n * @typedef {import('micromark-util-types').Create} Create\n * @typedef {import('micromark-util-types').FullNormalizedExtension} FullNormalizedExtension\n * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct\n * @typedef {import('micromark-util-types').ParseContext} ParseContext\n * @typedef {import('micromark-util-types').ParseOptions} ParseOptions\n */\n\nimport {combineExtensions} from 'micromark-util-combine-extensions'\nimport {content} from './initialize/content.js'\nimport {document} from './initialize/document.js'\nimport {flow} from './initialize/flow.js'\nimport {string, text} from './initialize/text.js'\nimport {createTokenizer} from './create-tokenizer.js'\nimport * as defaultConstructs from './constructs.js'\n\n/**\n * @param {ParseOptions | null | undefined} [options]\n * @returns {ParseContext}\n */\nexport function parse(options) {\n const settings = options || {}\n const constructs =\n /** @type {FullNormalizedExtension} */\n combineExtensions([defaultConstructs, ...(settings.extensions || [])])\n\n /** @type {ParseContext} */\n const parser = {\n defined: [],\n lazy: {},\n constructs,\n content: create(content),\n document: create(document),\n flow: create(flow),\n string: create(string),\n text: create(text)\n }\n return parser\n\n /**\n * @param {InitialConstruct} initial\n */\n function create(initial) {\n return creator\n /** @type {Create} */\n function creator(from) {\n return createTokenizer(parser, initial, from)\n }\n }\n}\n","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast-util-from-markdown').Options} FromMarkdownOptions\n * @typedef {import('unified').Parser} Parser\n * @typedef {import('unified').Processor} Processor\n */\n\n/**\n * @typedef {Omit} Options\n */\n\nimport {fromMarkdown} from 'mdast-util-from-markdown'\n\n/**\n * Aadd support for parsing from markdown.\n *\n * @param {Readonly | null | undefined} [options]\n * Configuration (optional).\n * @returns {undefined}\n * Nothing.\n */\nexport default function remarkParse(options) {\n /** @type {Processor} */\n // @ts-expect-error: TS in JSDoc generates wrong types if `this` is typed regularly.\n const self = this\n\n self.parser = parser\n\n /**\n * @type {Parser}\n */\n function parser(doc) {\n return fromMarkdown(doc, {\n ...self.data('settings'),\n ...options,\n // Note: these options are not in the readme.\n // The goal is for them to be set by plugins on `data` instead of being\n // passed by users.\n extensions: self.data('micromarkExtensions') || [],\n mdastExtensions: self.data('fromMarkdownExtensions') || []\n })\n }\n}\n","export const VOID = -1;\nexport const PRIMITIVE = 0;\nexport const ARRAY = 1;\nexport const OBJECT = 2;\nexport const DATE = 3;\nexport const REGEXP = 4;\nexport const MAP = 5;\nexport const SET = 6;\nexport const ERROR = 7;\nexport const BIGINT = 8;\n// export const SYMBOL = 9;\n","import {\n VOID, PRIMITIVE,\n ARRAY, OBJECT,\n DATE, REGEXP, MAP, SET,\n ERROR, BIGINT\n} from './types.js';\n\nconst env = typeof self === 'object' ? self : globalThis;\n\nconst deserializer = ($, _) => {\n const as = (out, index) => {\n $.set(index, out);\n return out;\n };\n\n const unpair = index => {\n if ($.has(index))\n return $.get(index);\n\n const [type, value] = _[index];\n switch (type) {\n case PRIMITIVE:\n case VOID:\n return as(value, index);\n case ARRAY: {\n const arr = as([], index);\n for (const index of value)\n arr.push(unpair(index));\n return arr;\n }\n case OBJECT: {\n const object = as({}, index);\n for (const [key, index] of value)\n object[unpair(key)] = unpair(index);\n return object;\n }\n case DATE:\n return as(new Date(value), index);\n case REGEXP: {\n const {source, flags} = value;\n return as(new RegExp(source, flags), index);\n }\n case MAP: {\n const map = as(new Map, index);\n for (const [key, index] of value)\n map.set(unpair(key), unpair(index));\n return map;\n }\n case SET: {\n const set = as(new Set, index);\n for (const index of value)\n set.add(unpair(index));\n return set;\n }\n case ERROR: {\n const {name, message} = value;\n return as(new env[name](message), index);\n }\n case BIGINT:\n return as(BigInt(value), index);\n case 'BigInt':\n return as(Object(BigInt(value)), index);\n }\n return as(new env[type](value), index);\n };\n\n return unpair;\n};\n\n/**\n * @typedef {Array} Record a type representation\n */\n\n/**\n * Returns a deserialized value from a serialized array of Records.\n * @param {Record[]} serialized a previously serialized value.\n * @returns {any}\n */\nexport const deserialize = serialized => deserializer(new Map, serialized)(0);\n","import {\n VOID, PRIMITIVE,\n ARRAY, OBJECT,\n DATE, REGEXP, MAP, SET,\n ERROR, BIGINT\n} from './types.js';\n\nconst EMPTY = '';\n\nconst {toString} = {};\nconst {keys} = Object;\n\nconst typeOf = value => {\n const type = typeof value;\n if (type !== 'object' || !value)\n return [PRIMITIVE, type];\n\n const asString = toString.call(value).slice(8, -1);\n switch (asString) {\n case 'Array':\n return [ARRAY, EMPTY];\n case 'Object':\n return [OBJECT, EMPTY];\n case 'Date':\n return [DATE, EMPTY];\n case 'RegExp':\n return [REGEXP, EMPTY];\n case 'Map':\n return [MAP, EMPTY];\n case 'Set':\n return [SET, EMPTY];\n }\n\n if (asString.includes('Array'))\n return [ARRAY, asString];\n\n if (asString.includes('Error'))\n return [ERROR, asString];\n\n return [OBJECT, asString];\n};\n\nconst shouldSkip = ([TYPE, type]) => (\n TYPE === PRIMITIVE &&\n (type === 'function' || type === 'symbol')\n);\n\nconst serializer = (strict, json, $, _) => {\n\n const as = (out, value) => {\n const index = _.push(out) - 1;\n $.set(value, index);\n return index;\n };\n\n const pair = value => {\n if ($.has(value))\n return $.get(value);\n\n let [TYPE, type] = typeOf(value);\n switch (TYPE) {\n case PRIMITIVE: {\n let entry = value;\n switch (type) {\n case 'bigint':\n TYPE = BIGINT;\n entry = value.toString();\n break;\n case 'function':\n case 'symbol':\n if (strict)\n throw new TypeError('unable to serialize ' + type);\n entry = null;\n break;\n case 'undefined':\n return as([VOID], value);\n }\n return as([TYPE, entry], value);\n }\n case ARRAY: {\n if (type)\n return as([type, [...value]], value);\n \n const arr = [];\n const index = as([TYPE, arr], value);\n for (const entry of value)\n arr.push(pair(entry));\n return index;\n }\n case OBJECT: {\n if (type) {\n switch (type) {\n case 'BigInt':\n return as([type, value.toString()], value);\n case 'Boolean':\n case 'Number':\n case 'String':\n return as([type, value.valueOf()], value);\n }\n }\n\n if (json && ('toJSON' in value))\n return pair(value.toJSON());\n\n const entries = [];\n const index = as([TYPE, entries], value);\n for (const key of keys(value)) {\n if (strict || !shouldSkip(typeOf(value[key])))\n entries.push([pair(key), pair(value[key])]);\n }\n return index;\n }\n case DATE:\n return as([TYPE, value.toISOString()], value);\n case REGEXP: {\n const {source, flags} = value;\n return as([TYPE, {source, flags}], value);\n }\n case MAP: {\n const entries = [];\n const index = as([TYPE, entries], value);\n for (const [key, entry] of value) {\n if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry))))\n entries.push([pair(key), pair(entry)]);\n }\n return index;\n }\n case SET: {\n const entries = [];\n const index = as([TYPE, entries], value);\n for (const entry of value) {\n if (strict || !shouldSkip(typeOf(entry)))\n entries.push(pair(entry));\n }\n return index;\n }\n }\n\n const {message} = value;\n return as([TYPE, {name: type, message}], value);\n };\n\n return pair;\n};\n\n/**\n * @typedef {Array} Record a type representation\n */\n\n/**\n * Returns an array of serialized Records.\n * @param {any} value a serializable value.\n * @param {{json?: boolean, lossy?: boolean}?} options an object with a `lossy` or `json` property that,\n * if `true`, will not throw errors on incompatible types, and behave more\n * like JSON stringify would behave. Symbol and Function will be discarded.\n * @returns {Record[]}\n */\n export const serialize = (value, {json, lossy} = {}) => {\n const _ = [];\n return serializer(!(json || lossy), !!json, new Map, _)(value), _;\n};\n","import {deserialize} from './deserialize.js';\nimport {serialize} from './serialize.js';\n\n/**\n * @typedef {Array} Record a type representation\n */\n\n/**\n * Returns an array of serialized Records.\n * @param {any} any a serializable value.\n * @param {{transfer?: any[], json?: boolean, lossy?: boolean}?} options an object with\n * a transfer option (ignored when polyfilled) and/or non standard fields that\n * fallback to the polyfill if present.\n * @returns {Record[]}\n */\nexport default typeof structuredClone === \"function\" ?\n /* c8 ignore start */\n (any, options) => (\n options && ('json' in options || 'lossy' in options) ?\n deserialize(serialize(any, options)) : structuredClone(any)\n ) :\n (any, options) => deserialize(serialize(any, options));\n /* c8 ignore stop */\n\nexport {deserialize, serialize};\n","import {asciiAlphanumeric} from 'micromark-util-character'\nimport {encode} from 'micromark-util-encode'\n/**\n * Make a value safe for injection as a URL.\n *\n * This encodes unsafe characters with percent-encoding and skips already\n * encoded sequences (see `normalizeUri`).\n * Further unsafe characters are encoded as character references (see\n * `micromark-util-encode`).\n *\n * A regex of allowed protocols can be given, in which case the URL is\n * sanitized.\n * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or\n * `/^https?$/i` for `img[src]` (this is what `github.com` allows).\n * If the URL includes an unknown protocol (one not matched by `protocol`, such\n * as a dangerous example, `javascript:`), the value is ignored.\n *\n * @param {string | null | undefined} url\n * URI to sanitize.\n * @param {RegExp | null | undefined} [protocol]\n * Allowed protocols.\n * @returns {string}\n * Sanitized URI.\n */\nexport function sanitizeUri(url, protocol) {\n const value = encode(normalizeUri(url || ''))\n if (!protocol) {\n return value\n }\n const colon = value.indexOf(':')\n const questionMark = value.indexOf('?')\n const numberSign = value.indexOf('#')\n const slash = value.indexOf('/')\n if (\n // If there is no protocol, it’s relative.\n colon < 0 ||\n // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n (slash > -1 && colon > slash) ||\n (questionMark > -1 && colon > questionMark) ||\n (numberSign > -1 && colon > numberSign) ||\n // It is a protocol, it should be allowed.\n protocol.test(value.slice(0, colon))\n ) {\n return value\n }\n return ''\n}\n\n/**\n * Normalize a URL.\n *\n * Encode unsafe characters with percent-encoding, skipping already encoded\n * sequences.\n *\n * @param {string} value\n * URI to normalize.\n * @returns {string}\n * Normalized URI.\n */\nexport function normalizeUri(value) {\n /** @type {Array} */\n const result = []\n let index = -1\n let start = 0\n let skip = 0\n while (++index < value.length) {\n const code = value.charCodeAt(index)\n /** @type {string} */\n let replace = ''\n\n // A correct percent encoded value.\n if (\n code === 37 &&\n asciiAlphanumeric(value.charCodeAt(index + 1)) &&\n asciiAlphanumeric(value.charCodeAt(index + 2))\n ) {\n skip = 2\n }\n // ASCII.\n else if (code < 128) {\n if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {\n replace = String.fromCharCode(code)\n }\n }\n // Astral.\n else if (code > 55_295 && code < 57_344) {\n const next = value.charCodeAt(index + 1)\n\n // A correct surrogate pair.\n if (code < 56_320 && next > 56_319 && next < 57_344) {\n replace = String.fromCharCode(code, next)\n skip = 1\n }\n // Lone surrogate.\n else {\n replace = '\\uFFFD'\n }\n }\n // Unicode.\n else {\n replace = String.fromCharCode(code)\n }\n if (replace) {\n result.push(value.slice(start, index), encodeURIComponent(replace))\n start = index + skip + 1\n replace = ''\n }\n if (skip) {\n index += skip\n skip = 0\n }\n }\n return result.join('') + value.slice(start)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n *\n * @typedef {import('./state.js').State} State\n */\n\n/**\n * @callback FootnoteBackContentTemplate\n * Generate content for the backreference dynamically.\n *\n * For the following markdown:\n *\n * ```markdown\n * Alpha[^micromark], bravo[^micromark], and charlie[^remark].\n *\n * [^remark]: things about remark\n * [^micromark]: things about micromark\n * ```\n *\n * This function will be called with:\n *\n * * `0` and `0` for the backreference from `things about micromark` to\n * `alpha`, as it is the first used definition, and the first call to it\n * * `0` and `1` for the backreference from `things about micromark` to\n * `bravo`, as it is the first used definition, and the second call to it\n * * `1` and `0` for the backreference from `things about remark` to\n * `charlie`, as it is the second used definition\n * @param {number} referenceIndex\n * Index of the definition in the order that they are first referenced,\n * 0-indexed.\n * @param {number} rereferenceIndex\n * Index of calls to the same definition, 0-indexed.\n * @returns {Array | ElementContent | string}\n * Content for the backreference when linking back from definitions to their\n * reference.\n *\n * @callback FootnoteBackLabelTemplate\n * Generate a back label dynamically.\n *\n * For the following markdown:\n *\n * ```markdown\n * Alpha[^micromark], bravo[^micromark], and charlie[^remark].\n *\n * [^remark]: things about remark\n * [^micromark]: things about micromark\n * ```\n *\n * This function will be called with:\n *\n * * `0` and `0` for the backreference from `things about micromark` to\n * `alpha`, as it is the first used definition, and the first call to it\n * * `0` and `1` for the backreference from `things about micromark` to\n * `bravo`, as it is the first used definition, and the second call to it\n * * `1` and `0` for the backreference from `things about remark` to\n * `charlie`, as it is the second used definition\n * @param {number} referenceIndex\n * Index of the definition in the order that they are first referenced,\n * 0-indexed.\n * @param {number} rereferenceIndex\n * Index of calls to the same definition, 0-indexed.\n * @returns {string}\n * Back label to use when linking back from definitions to their reference.\n */\n\nimport structuredClone from '@ungap/structured-clone'\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Generate the default content that GitHub uses on backreferences.\n *\n * @param {number} _\n * Index of the definition in the order that they are first referenced,\n * 0-indexed.\n * @param {number} rereferenceIndex\n * Index of calls to the same definition, 0-indexed.\n * @returns {Array}\n * Content.\n */\nexport function defaultFootnoteBackContent(_, rereferenceIndex) {\n /** @type {Array} */\n const result = [{type: 'text', value: '↩'}]\n\n if (rereferenceIndex > 1) {\n result.push({\n type: 'element',\n tagName: 'sup',\n properties: {},\n children: [{type: 'text', value: String(rereferenceIndex)}]\n })\n }\n\n return result\n}\n\n/**\n * Generate the default label that GitHub uses on backreferences.\n *\n * @param {number} referenceIndex\n * Index of the definition in the order that they are first referenced,\n * 0-indexed.\n * @param {number} rereferenceIndex\n * Index of calls to the same definition, 0-indexed.\n * @returns {string}\n * Label.\n */\nexport function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) {\n return (\n 'Back to reference ' +\n (referenceIndex + 1) +\n (rereferenceIndex > 1 ? '-' + rereferenceIndex : '')\n )\n}\n\n/**\n * Generate a hast footer for called footnote definitions.\n *\n * @param {State} state\n * Info passed around.\n * @returns {Element | undefined}\n * `section` element or `undefined`.\n */\n// eslint-disable-next-line complexity\nexport function footer(state) {\n const clobberPrefix =\n typeof state.options.clobberPrefix === 'string'\n ? state.options.clobberPrefix\n : 'user-content-'\n const footnoteBackContent =\n state.options.footnoteBackContent || defaultFootnoteBackContent\n const footnoteBackLabel =\n state.options.footnoteBackLabel || defaultFootnoteBackLabel\n const footnoteLabel = state.options.footnoteLabel || 'Footnotes'\n const footnoteLabelTagName = state.options.footnoteLabelTagName || 'h2'\n const footnoteLabelProperties = state.options.footnoteLabelProperties || {\n className: ['sr-only']\n }\n /** @type {Array} */\n const listItems = []\n let referenceIndex = -1\n\n while (++referenceIndex < state.footnoteOrder.length) {\n const def = state.footnoteById.get(state.footnoteOrder[referenceIndex])\n\n if (!def) {\n continue\n }\n\n const content = state.all(def)\n const id = String(def.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n let rereferenceIndex = 0\n /** @type {Array} */\n const backReferences = []\n const counts = state.footnoteCounts.get(id)\n\n // eslint-disable-next-line no-unmodified-loop-condition\n while (counts !== undefined && ++rereferenceIndex <= counts) {\n if (backReferences.length > 0) {\n backReferences.push({type: 'text', value: ' '})\n }\n\n let children =\n typeof footnoteBackContent === 'string'\n ? footnoteBackContent\n : footnoteBackContent(referenceIndex, rereferenceIndex)\n\n if (typeof children === 'string') {\n children = {type: 'text', value: children}\n }\n\n backReferences.push({\n type: 'element',\n tagName: 'a',\n properties: {\n href:\n '#' +\n clobberPrefix +\n 'fnref-' +\n safeId +\n (rereferenceIndex > 1 ? '-' + rereferenceIndex : ''),\n dataFootnoteBackref: '',\n ariaLabel:\n typeof footnoteBackLabel === 'string'\n ? footnoteBackLabel\n : footnoteBackLabel(referenceIndex, rereferenceIndex),\n className: ['data-footnote-backref']\n },\n children: Array.isArray(children) ? children : [children]\n })\n }\n\n const tail = content[content.length - 1]\n\n if (tail && tail.type === 'element' && tail.tagName === 'p') {\n const tailTail = tail.children[tail.children.length - 1]\n if (tailTail && tailTail.type === 'text') {\n tailTail.value += ' '\n } else {\n tail.children.push({type: 'text', value: ' '})\n }\n\n tail.children.push(...backReferences)\n } else {\n content.push(...backReferences)\n }\n\n /** @type {Element} */\n const listItem = {\n type: 'element',\n tagName: 'li',\n properties: {id: clobberPrefix + 'fn-' + safeId},\n children: state.wrap(content, true)\n }\n\n state.patch(def, listItem)\n\n listItems.push(listItem)\n }\n\n if (listItems.length === 0) {\n return\n }\n\n return {\n type: 'element',\n tagName: 'section',\n properties: {dataFootnotes: true, className: ['footnotes']},\n children: [\n {\n type: 'element',\n tagName: footnoteLabelTagName,\n properties: {\n ...structuredClone(footnoteLabelProperties),\n id: 'footnote-label'\n },\n children: [{type: 'text', value: footnoteLabel}]\n },\n {type: 'text', value: '\\n'},\n {\n type: 'element',\n tagName: 'ol',\n properties: {},\n children: state.wrap(listItems, true)\n },\n {type: 'text', value: '\\n'}\n ]\n }\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Parent} Parent\n */\n\n/**\n * @template Fn\n * @template Fallback\n * @typedef {Fn extends (value: any) => value is infer Thing ? Thing : Fallback} Predicate\n */\n\n/**\n * @callback Check\n * Check that an arbitrary value is a node.\n * @param {unknown} this\n * The given context.\n * @param {unknown} [node]\n * Anything (typically a node).\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {boolean}\n * Whether this is a node and passes a test.\n *\n * @typedef {Record | Node} Props\n * Object to check for equivalence.\n *\n * Note: `Node` is included as it is common but is not indexable.\n *\n * @typedef {Array | Props | TestFunction | string | null | undefined} Test\n * Check for an arbitrary node.\n *\n * @callback TestFunction\n * Check if a node passes a test.\n * @param {unknown} this\n * The given context.\n * @param {Node} node\n * A node.\n * @param {number | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | undefined} [parent]\n * The node’s parent.\n * @returns {boolean | undefined | void}\n * Whether this node passes the test.\n *\n * Note: `void` is included until TS sees no return as `undefined`.\n */\n\n/**\n * Check if `node` is a `Node` and whether it passes the given test.\n *\n * @param {unknown} node\n * Thing to check, typically `Node`.\n * @param {Test} test\n * A check for a specific node.\n * @param {number | null | undefined} index\n * The node’s position in its parent.\n * @param {Parent | null | undefined} parent\n * The node’s parent.\n * @param {unknown} context\n * Context object (`this`) to pass to `test` functions.\n * @returns {boolean}\n * Whether `node` is a node and passes a test.\n */\nexport const is =\n // Note: overloads in JSDoc can’t yet use different `@template`s.\n /**\n * @type {(\n * ((node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &\n * ((node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &\n * ((node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate) &\n * ((node?: null | undefined) => false) &\n * ((node: unknown, test?: null | undefined, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &\n * ((node: unknown, test?: Test, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => boolean)\n * )}\n */\n (\n /**\n * @param {unknown} [node]\n * @param {Test} [test]\n * @param {number | null | undefined} [index]\n * @param {Parent | null | undefined} [parent]\n * @param {unknown} [context]\n * @returns {boolean}\n */\n // eslint-disable-next-line max-params\n function (node, test, index, parent, context) {\n const check = convert(test)\n\n if (\n index !== undefined &&\n index !== null &&\n (typeof index !== 'number' ||\n index < 0 ||\n index === Number.POSITIVE_INFINITY)\n ) {\n throw new Error('Expected positive finite index')\n }\n\n if (\n parent !== undefined &&\n parent !== null &&\n (!is(parent) || !parent.children)\n ) {\n throw new Error('Expected parent node')\n }\n\n if (\n (parent === undefined || parent === null) !==\n (index === undefined || index === null)\n ) {\n throw new Error('Expected both parent and index')\n }\n\n return looksLikeANode(node)\n ? check.call(context, node, index, parent)\n : false\n }\n )\n\n/**\n * Generate an assertion from a test.\n *\n * Useful if you’re going to test many nodes, for example when creating a\n * utility where something else passes a compatible test.\n *\n * The created function is a bit faster because it expects valid input only:\n * a `node`, `index`, and `parent`.\n *\n * @param {Test} test\n * * when nullish, checks if `node` is a `Node`.\n * * when `string`, works like passing `(node) => node.type === test`.\n * * when `function` checks if function passed the node is true.\n * * when `object`, checks that all keys in test are in node, and that they have (strictly) equal values.\n * * when `array`, checks if any one of the subtests pass.\n * @returns {Check}\n * An assertion.\n */\nexport const convert =\n // Note: overloads in JSDoc can’t yet use different `@template`s.\n /**\n * @type {(\n * ((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &\n * ((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &\n * ((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate) &\n * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &\n * ((test?: Test) => Check)\n * )}\n */\n (\n /**\n * @param {Test} [test]\n * @returns {Check}\n */\n function (test) {\n if (test === null || test === undefined) {\n return ok\n }\n\n if (typeof test === 'function') {\n return castFactory(test)\n }\n\n if (typeof test === 'object') {\n return Array.isArray(test) ? anyFactory(test) : propsFactory(test)\n }\n\n if (typeof test === 'string') {\n return typeFactory(test)\n }\n\n throw new Error('Expected function, string, or object as test')\n }\n )\n\n/**\n * @param {Array} tests\n * @returns {Check}\n */\nfunction anyFactory(tests) {\n /** @type {Array} */\n const checks = []\n let index = -1\n\n while (++index < tests.length) {\n checks[index] = convert(tests[index])\n }\n\n return castFactory(any)\n\n /**\n * @this {unknown}\n * @type {TestFunction}\n */\n function any(...parameters) {\n let index = -1\n\n while (++index < checks.length) {\n if (checks[index].apply(this, parameters)) return true\n }\n\n return false\n }\n}\n\n/**\n * Turn an object into a test for a node with a certain fields.\n *\n * @param {Props} check\n * @returns {Check}\n */\nfunction propsFactory(check) {\n const checkAsRecord = /** @type {Record} */ (check)\n\n return castFactory(all)\n\n /**\n * @param {Node} node\n * @returns {boolean}\n */\n function all(node) {\n const nodeAsRecord = /** @type {Record} */ (\n /** @type {unknown} */ (node)\n )\n\n /** @type {string} */\n let key\n\n for (key in check) {\n if (nodeAsRecord[key] !== checkAsRecord[key]) return false\n }\n\n return true\n }\n}\n\n/**\n * Turn a string into a test for a node with a certain type.\n *\n * @param {string} check\n * @returns {Check}\n */\nfunction typeFactory(check) {\n return castFactory(type)\n\n /**\n * @param {Node} node\n */\n function type(node) {\n return node && node.type === check\n }\n}\n\n/**\n * Turn a custom test into a test for a node that passes that test.\n *\n * @param {TestFunction} testFunction\n * @returns {Check}\n */\nfunction castFactory(testFunction) {\n return check\n\n /**\n * @this {unknown}\n * @type {Check}\n */\n function check(value, index, parent) {\n return Boolean(\n looksLikeANode(value) &&\n testFunction.call(\n this,\n value,\n typeof index === 'number' ? index : undefined,\n parent || undefined\n )\n )\n }\n}\n\nfunction ok() {\n return true\n}\n\n/**\n * @param {unknown} value\n * @returns {value is Node}\n */\nfunction looksLikeANode(value) {\n return value !== null && typeof value === 'object' && 'type' in value\n}\n","/**\n * @typedef {import('unist').Node} UnistNode\n * @typedef {import('unist').Parent} UnistParent\n */\n\n/**\n * @typedef {Exclude | undefined} Test\n * Test from `unist-util-is`.\n *\n * Note: we have remove and add `undefined`, because otherwise when generating\n * automatic `.d.ts` files, TS tries to flatten paths from a local perspective,\n * which doesn’t work when publishing on npm.\n */\n\n/**\n * @typedef {(\n * Fn extends (value: any) => value is infer Thing\n * ? Thing\n * : Fallback\n * )} Predicate\n * Get the value of a type guard `Fn`.\n * @template Fn\n * Value; typically function that is a type guard (such as `(x): x is Y`).\n * @template Fallback\n * Value to yield if `Fn` is not a type guard.\n */\n\n/**\n * @typedef {(\n * Check extends null | undefined // No test.\n * ? Value\n * : Value extends {type: Check} // String (type) test.\n * ? Value\n * : Value extends Check // Partial test.\n * ? Value\n * : Check extends Function // Function test.\n * ? Predicate extends Value\n * ? Predicate\n * : never\n * : never // Some other test?\n * )} MatchesOne\n * Check whether a node matches a primitive check in the type system.\n * @template Value\n * Value; typically unist `Node`.\n * @template Check\n * Value; typically `unist-util-is`-compatible test, but not arrays.\n */\n\n/**\n * @typedef {(\n * Check extends Array\n * ? MatchesOne\n * : MatchesOne\n * )} Matches\n * Check whether a node matches a check in the type system.\n * @template Value\n * Value; typically unist `Node`.\n * @template Check\n * Value; typically `unist-util-is`-compatible test.\n */\n\n/**\n * @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint\n * Number; capped reasonably.\n */\n\n/**\n * @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment\n * Increment a number in the type system.\n * @template {Uint} [I=0]\n * Index.\n */\n\n/**\n * @typedef {(\n * Node extends UnistParent\n * ? Node extends {children: Array}\n * ? Child extends Children ? Node : never\n * : never\n * : never\n * )} InternalParent\n * Collect nodes that can be parents of `Child`.\n * @template {UnistNode} Node\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {InternalParent, Child>} Parent\n * Collect nodes in `Tree` that can be parents of `Child`.\n * @template {UnistNode} Tree\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {(\n * Depth extends Max\n * ? never\n * :\n * | InternalParent\n * | InternalAncestor, Max, Increment>\n * )} InternalAncestor\n * Collect nodes in `Tree` that can be ancestors of `Child`.\n * @template {UnistNode} Node\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n * @template {Uint} [Max=10]\n * Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n * Current depth.\n */\n\n/**\n * @typedef {InternalAncestor, Child>} Ancestor\n * Collect nodes in `Tree` that can be ancestors of `Child`.\n * @template {UnistNode} Tree\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {(\n * Tree extends UnistParent\n * ? Depth extends Max\n * ? Tree\n * : Tree | InclusiveDescendant>\n * : Tree\n * )} InclusiveDescendant\n * Collect all (inclusive) descendants of `Tree`.\n *\n * > 👉 **Note**: for performance reasons, this seems to be the fastest way to\n * > recurse without actually running into an infinite loop, which the\n * > previous version did.\n * >\n * > Practically, a max of `2` is typically enough assuming a `Root` is\n * > passed, but it doesn’t improve performance.\n * > It gets higher with `List > ListItem > Table > TableRow > TableCell`.\n * > Using up to `10` doesn’t hurt or help either.\n * @template {UnistNode} Tree\n * Tree type.\n * @template {Uint} [Max=10]\n * Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n * Current depth.\n */\n\n/**\n * @typedef {'skip' | boolean} Action\n * Union of the action types.\n *\n * @typedef {number} Index\n * Move to the sibling at `index` next (after node itself is completely\n * traversed).\n *\n * Useful if mutating the tree, such as removing the node the visitor is\n * currently on, or any of its previous siblings.\n * Results less than 0 or greater than or equal to `children.length` stop\n * traversing the parent.\n *\n * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple\n * List with one or two values, the first an action, the second an index.\n *\n * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult\n * Any value that can be returned from a visitor.\n */\n\n/**\n * @callback Visitor\n * Handle a node (matching `test`, if given).\n *\n * Visitors are free to transform `node`.\n * They can also transform the parent of node (the last of `ancestors`).\n *\n * Replacing `node` itself, if `SKIP` is not returned, still causes its\n * descendants to be walked (which is a bug).\n *\n * When adding or removing previous siblings of `node` (or next siblings, in\n * case of reverse), the `Visitor` should return a new `Index` to specify the\n * sibling to traverse after `node` is traversed.\n * Adding or removing next siblings of `node` (or previous siblings, in case\n * of reverse) is handled as expected without needing to return a new `Index`.\n *\n * Removing the children property of an ancestor still results in them being\n * traversed.\n * @param {Visited} node\n * Found node.\n * @param {Array} ancestors\n * Ancestors of `node`.\n * @returns {VisitorResult}\n * What to do next.\n *\n * An `Index` is treated as a tuple of `[CONTINUE, Index]`.\n * An `Action` is treated as a tuple of `[Action]`.\n *\n * Passing a tuple back only makes sense if the `Action` is `SKIP`.\n * When the `Action` is `EXIT`, that action can be returned.\n * When the `Action` is `CONTINUE`, `Index` can be returned.\n * @template {UnistNode} [Visited=UnistNode]\n * Visited node type.\n * @template {UnistParent} [VisitedParents=UnistParent]\n * Ancestor type.\n */\n\n/**\n * @typedef {Visitor, Check>, Ancestor, Check>>>} BuildVisitor\n * Build a typed `Visitor` function from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parents`.\n * @template {UnistNode} [Tree=UnistNode]\n * Tree type.\n * @template {Test} [Check=Test]\n * Test type.\n */\n\nimport {convert} from 'unist-util-is'\nimport {color} from 'unist-util-visit-parents/do-not-use-color'\n\n/** @type {Readonly} */\nconst empty = []\n\n/**\n * Continue traversing as normal.\n */\nexport const CONTINUE = true\n\n/**\n * Stop traversing immediately.\n */\nexport const EXIT = false\n\n/**\n * Do not traverse this node’s children.\n */\nexport const SKIP = 'skip'\n\n/**\n * Visit nodes, with ancestral information.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).\n *\n * You can choose for which nodes `visitor` is called by passing a `test`.\n * For complex tests, you should test yourself in `visitor`, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * See `Visitor` for more info.\n *\n * @overload\n * @param {Tree} tree\n * @param {Check} check\n * @param {BuildVisitor} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {undefined}\n *\n * @overload\n * @param {Tree} tree\n * @param {BuildVisitor} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {undefined}\n *\n * @param {UnistNode} tree\n * Tree to traverse.\n * @param {Visitor | Test} test\n * `unist-util-is`-compatible test\n * @param {Visitor | boolean | null | undefined} [visitor]\n * Handle each node.\n * @param {boolean | null | undefined} [reverse]\n * Traverse in reverse preorder (NRL) instead of the default preorder (NLR).\n * @returns {undefined}\n * Nothing.\n *\n * @template {UnistNode} Tree\n * Node type.\n * @template {Test} Check\n * `unist-util-is`-compatible test.\n */\nexport function visitParents(tree, test, visitor, reverse) {\n /** @type {Test} */\n let check\n\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor\n // @ts-expect-error no visitor given, so `visitor` is test.\n visitor = test\n } else {\n // @ts-expect-error visitor given, so `test` isn’t a visitor.\n check = test\n }\n\n const is = convert(check)\n const step = reverse ? -1 : 1\n\n factory(tree, undefined, [])()\n\n /**\n * @param {UnistNode} node\n * @param {number | undefined} index\n * @param {Array} parents\n */\n function factory(node, index, parents) {\n const value = /** @type {Record} */ (\n node && typeof node === 'object' ? node : {}\n )\n\n if (typeof value.type === 'string') {\n const name =\n // `hast`\n typeof value.tagName === 'string'\n ? value.tagName\n : // `xast`\n typeof value.name === 'string'\n ? value.name\n : undefined\n\n Object.defineProperty(visit, 'name', {\n value:\n 'node (' + color(node.type + (name ? '<' + name + '>' : '')) + ')'\n })\n }\n\n return visit\n\n function visit() {\n /** @type {Readonly} */\n let result = empty\n /** @type {Readonly} */\n let subresult\n /** @type {number} */\n let offset\n /** @type {Array} */\n let grandparents\n\n if (!test || is(node, index, parents[parents.length - 1] || undefined)) {\n // @ts-expect-error: `visitor` is now a visitor.\n result = toResult(visitor(node, parents))\n\n if (result[0] === EXIT) {\n return result\n }\n }\n\n if ('children' in node && node.children) {\n const nodeAsParent = /** @type {UnistParent} */ (node)\n\n if (nodeAsParent.children && result[0] !== SKIP) {\n offset = (reverse ? nodeAsParent.children.length : -1) + step\n grandparents = parents.concat(nodeAsParent)\n\n while (offset > -1 && offset < nodeAsParent.children.length) {\n const child = nodeAsParent.children[offset]\n\n subresult = factory(child, offset, grandparents)()\n\n if (subresult[0] === EXIT) {\n return subresult\n }\n\n offset =\n typeof subresult[1] === 'number' ? subresult[1] : offset + step\n }\n }\n }\n\n return result\n }\n }\n}\n\n/**\n * Turn a return value into a clean result.\n *\n * @param {VisitorResult} value\n * Valid return values from visitors.\n * @returns {Readonly}\n * Clean result.\n */\nfunction toResult(value) {\n if (Array.isArray(value)) {\n return value\n }\n\n if (typeof value === 'number') {\n return [CONTINUE, value]\n }\n\n return value === null || value === undefined ? empty : [value]\n}\n","/**\n * @typedef {import('unist').Node} UnistNode\n * @typedef {import('unist').Parent} UnistParent\n * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult\n */\n\n/**\n * @typedef {Exclude | undefined} Test\n * Test from `unist-util-is`.\n *\n * Note: we have remove and add `undefined`, because otherwise when generating\n * automatic `.d.ts` files, TS tries to flatten paths from a local perspective,\n * which doesn’t work when publishing on npm.\n */\n\n// To do: use types from `unist-util-visit-parents` when it’s released.\n\n/**\n * @typedef {(\n * Fn extends (value: any) => value is infer Thing\n * ? Thing\n * : Fallback\n * )} Predicate\n * Get the value of a type guard `Fn`.\n * @template Fn\n * Value; typically function that is a type guard (such as `(x): x is Y`).\n * @template Fallback\n * Value to yield if `Fn` is not a type guard.\n */\n\n/**\n * @typedef {(\n * Check extends null | undefined // No test.\n * ? Value\n * : Value extends {type: Check} // String (type) test.\n * ? Value\n * : Value extends Check // Partial test.\n * ? Value\n * : Check extends Function // Function test.\n * ? Predicate extends Value\n * ? Predicate\n * : never\n * : never // Some other test?\n * )} MatchesOne\n * Check whether a node matches a primitive check in the type system.\n * @template Value\n * Value; typically unist `Node`.\n * @template Check\n * Value; typically `unist-util-is`-compatible test, but not arrays.\n */\n\n/**\n * @typedef {(\n * Check extends Array\n * ? MatchesOne\n * : MatchesOne\n * )} Matches\n * Check whether a node matches a check in the type system.\n * @template Value\n * Value; typically unist `Node`.\n * @template Check\n * Value; typically `unist-util-is`-compatible test.\n */\n\n/**\n * @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint\n * Number; capped reasonably.\n */\n\n/**\n * @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment\n * Increment a number in the type system.\n * @template {Uint} [I=0]\n * Index.\n */\n\n/**\n * @typedef {(\n * Node extends UnistParent\n * ? Node extends {children: Array}\n * ? Child extends Children ? Node : never\n * : never\n * : never\n * )} InternalParent\n * Collect nodes that can be parents of `Child`.\n * @template {UnistNode} Node\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {InternalParent, Child>} Parent\n * Collect nodes in `Tree` that can be parents of `Child`.\n * @template {UnistNode} Tree\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {(\n * Depth extends Max\n * ? never\n * :\n * | InternalParent\n * | InternalAncestor, Max, Increment>\n * )} InternalAncestor\n * Collect nodes in `Tree` that can be ancestors of `Child`.\n * @template {UnistNode} Node\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n * @template {Uint} [Max=10]\n * Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n * Current depth.\n */\n\n/**\n * @typedef {(\n * Tree extends UnistParent\n * ? Depth extends Max\n * ? Tree\n * : Tree | InclusiveDescendant>\n * : Tree\n * )} InclusiveDescendant\n * Collect all (inclusive) descendants of `Tree`.\n *\n * > 👉 **Note**: for performance reasons, this seems to be the fastest way to\n * > recurse without actually running into an infinite loop, which the\n * > previous version did.\n * >\n * > Practically, a max of `2` is typically enough assuming a `Root` is\n * > passed, but it doesn’t improve performance.\n * > It gets higher with `List > ListItem > Table > TableRow > TableCell`.\n * > Using up to `10` doesn’t hurt or help either.\n * @template {UnistNode} Tree\n * Tree type.\n * @template {Uint} [Max=10]\n * Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n * Current depth.\n */\n\n/**\n * @callback Visitor\n * Handle a node (matching `test`, if given).\n *\n * Visitors are free to transform `node`.\n * They can also transform `parent`.\n *\n * Replacing `node` itself, if `SKIP` is not returned, still causes its\n * descendants to be walked (which is a bug).\n *\n * When adding or removing previous siblings of `node` (or next siblings, in\n * case of reverse), the `Visitor` should return a new `Index` to specify the\n * sibling to traverse after `node` is traversed.\n * Adding or removing next siblings of `node` (or previous siblings, in case\n * of reverse) is handled as expected without needing to return a new `Index`.\n *\n * Removing the children property of `parent` still results in them being\n * traversed.\n * @param {Visited} node\n * Found node.\n * @param {Visited extends UnistNode ? number | undefined : never} index\n * Index of `node` in `parent`.\n * @param {Ancestor extends UnistParent ? Ancestor | undefined : never} parent\n * Parent of `node`.\n * @returns {VisitorResult}\n * What to do next.\n *\n * An `Index` is treated as a tuple of `[CONTINUE, Index]`.\n * An `Action` is treated as a tuple of `[Action]`.\n *\n * Passing a tuple back only makes sense if the `Action` is `SKIP`.\n * When the `Action` is `EXIT`, that action can be returned.\n * When the `Action` is `CONTINUE`, `Index` can be returned.\n * @template {UnistNode} [Visited=UnistNode]\n * Visited node type.\n * @template {UnistParent} [Ancestor=UnistParent]\n * Ancestor type.\n */\n\n/**\n * @typedef {Visitor>} BuildVisitorFromMatch\n * Build a typed `Visitor` function from a node and all possible parents.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} Visited\n * Node type.\n * @template {UnistParent} Ancestor\n * Parent type.\n */\n\n/**\n * @typedef {(\n * BuildVisitorFromMatch<\n * Matches,\n * Extract\n * >\n * )} BuildVisitorFromDescendants\n * Build a typed `Visitor` function from a list of descendants and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} Descendant\n * Node type.\n * @template {Test} Check\n * Test type.\n */\n\n/**\n * @typedef {(\n * BuildVisitorFromDescendants<\n * InclusiveDescendant,\n * Check\n * >\n * )} BuildVisitor\n * Build a typed `Visitor` function from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} [Tree=UnistNode]\n * Node type.\n * @template {Test} [Check=Test]\n * Test type.\n */\n\nimport {visitParents} from 'unist-util-visit-parents'\n\nexport {CONTINUE, EXIT, SKIP} from 'unist-util-visit-parents'\n\n/**\n * Visit nodes.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).\n *\n * You can choose for which nodes `visitor` is called by passing a `test`.\n * For complex tests, you should test yourself in `visitor`, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * See `Visitor` for more info.\n *\n * @overload\n * @param {Tree} tree\n * @param {Check} check\n * @param {BuildVisitor} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {undefined}\n *\n * @overload\n * @param {Tree} tree\n * @param {BuildVisitor} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {undefined}\n *\n * @param {UnistNode} tree\n * Tree to traverse.\n * @param {Visitor | Test} testOrVisitor\n * `unist-util-is`-compatible test (optional, omit to pass a visitor).\n * @param {Visitor | boolean | null | undefined} [visitorOrReverse]\n * Handle each node (when test is omitted, pass `reverse`).\n * @param {boolean | null | undefined} [maybeReverse=false]\n * Traverse in reverse preorder (NRL) instead of the default preorder (NLR).\n * @returns {undefined}\n * Nothing.\n *\n * @template {UnistNode} Tree\n * Node type.\n * @template {Test} Check\n * `unist-util-is`-compatible test.\n */\nexport function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {\n /** @type {boolean | null | undefined} */\n let reverse\n /** @type {Test} */\n let test\n /** @type {Visitor} */\n let visitor\n\n if (\n typeof testOrVisitor === 'function' &&\n typeof visitorOrReverse !== 'function'\n ) {\n test = undefined\n visitor = testOrVisitor\n reverse = visitorOrReverse\n } else {\n // @ts-expect-error: assume the overload with test was given.\n test = testOrVisitor\n // @ts-expect-error: assume the overload with test was given.\n visitor = visitorOrReverse\n reverse = maybeReverse\n }\n\n visitParents(tree, test, overload, reverse)\n\n /**\n * @param {UnistNode} node\n * @param {Array} parents\n */\n function overload(node, parents) {\n const parent = parents[parents.length - 1]\n const index = parent ? parent.children.indexOf(node) : undefined\n return visitor(node, index, parent)\n }\n}\n","/**\n * @typedef {import('hast').ElementContent} ElementContent\n *\n * @typedef {import('mdast').Nodes} Nodes\n * @typedef {import('mdast').Reference} Reference\n *\n * @typedef {import('./state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Return the content of a reference without definition as plain text.\n *\n * @param {State} state\n * Info passed around.\n * @param {Extract} node\n * Reference node (image, link).\n * @returns {Array}\n * hast content.\n */\nexport function revert(state, node) {\n const subtype = node.referenceType\n let suffix = ']'\n\n if (subtype === 'collapsed') {\n suffix += '[]'\n } else if (subtype === 'full') {\n suffix += '[' + (node.label || node.identifier) + ']'\n }\n\n if (node.type === 'imageReference') {\n return [{type: 'text', value: '![' + node.alt + suffix}]\n }\n\n const contents = state.all(node)\n const head = contents[0]\n\n if (head && head.type === 'text') {\n head.value = '[' + head.value\n } else {\n contents.unshift({type: 'text', value: '['})\n }\n\n const tail = contents[contents.length - 1]\n\n if (tail && tail.type === 'text') {\n tail.value += suffix\n } else {\n contents.push({type: 'text', value: suffix})\n }\n\n return contents\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `listItem` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {ListItem} node\n * mdast node.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @returns {Element}\n * hast node.\n */\nexport function listItem(state, node, parent) {\n const results = state.all(node)\n const loose = parent ? listLoose(parent) : listItemLoose(node)\n /** @type {Properties} */\n const properties = {}\n /** @type {Array} */\n const children = []\n\n if (typeof node.checked === 'boolean') {\n const head = results[0]\n /** @type {Element} */\n let paragraph\n\n if (head && head.type === 'element' && head.tagName === 'p') {\n paragraph = head\n } else {\n paragraph = {type: 'element', tagName: 'p', properties: {}, children: []}\n results.unshift(paragraph)\n }\n\n if (paragraph.children.length > 0) {\n paragraph.children.unshift({type: 'text', value: ' '})\n }\n\n paragraph.children.unshift({\n type: 'element',\n tagName: 'input',\n properties: {type: 'checkbox', checked: node.checked, disabled: true},\n children: []\n })\n\n // According to github-markdown-css, this class hides bullet.\n // See: .\n properties.className = ['task-list-item']\n }\n\n let index = -1\n\n while (++index < results.length) {\n const child = results[index]\n\n // Add eols before nodes, except if this is a loose, first paragraph.\n if (\n loose ||\n index !== 0 ||\n child.type !== 'element' ||\n child.tagName !== 'p'\n ) {\n children.push({type: 'text', value: '\\n'})\n }\n\n if (child.type === 'element' && child.tagName === 'p' && !loose) {\n children.push(...child.children)\n } else {\n children.push(child)\n }\n }\n\n const tail = results[results.length - 1]\n\n // Add a final eol.\n if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) {\n children.push({type: 'text', value: '\\n'})\n }\n\n /** @type {Element} */\n const result = {type: 'element', tagName: 'li', properties, children}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n\n/**\n * @param {Parents} node\n * @return {Boolean}\n */\nfunction listLoose(node) {\n let loose = false\n if (node.type === 'list') {\n loose = node.spread || false\n const children = node.children\n let index = -1\n\n while (!loose && ++index < children.length) {\n loose = listItemLoose(children[index])\n }\n }\n\n return loose\n}\n\n/**\n * @param {ListItem} node\n * @return {Boolean}\n */\nfunction listItemLoose(node) {\n const spread = node.spread\n\n return spread === null || spread === undefined\n ? node.children.length > 1\n : spread\n}\n","const tab = 9 /* `\\t` */\nconst space = 32 /* ` ` */\n\n/**\n * Remove initial and final spaces and tabs at the line breaks in `value`.\n * Does not trim initial and final spaces and tabs of the value itself.\n *\n * @param {string} value\n * Value to trim.\n * @returns {string}\n * Trimmed value.\n */\nexport function trimLines(value) {\n const source = String(value)\n const search = /\\r?\\n|\\r/g\n let match = search.exec(source)\n let last = 0\n /** @type {Array} */\n const lines = []\n\n while (match) {\n lines.push(\n trimLine(source.slice(last, match.index), last > 0, true),\n match[0]\n )\n\n last = match.index + match[0].length\n match = search.exec(source)\n }\n\n lines.push(trimLine(source.slice(last), last > 0, false))\n\n return lines.join('')\n}\n\n/**\n * @param {string} value\n * Line to trim.\n * @param {boolean} start\n * Whether to trim the start of the line.\n * @param {boolean} end\n * Whether to trim the end of the line.\n * @returns {string}\n * Trimmed line.\n */\nfunction trimLine(value, start, end) {\n let startIndex = 0\n let endIndex = value.length\n\n if (start) {\n let code = value.codePointAt(startIndex)\n\n while (code === tab || code === space) {\n startIndex++\n code = value.codePointAt(startIndex)\n }\n }\n\n if (end) {\n let code = value.codePointAt(endIndex - 1)\n\n while (code === tab || code === space) {\n endIndex--\n code = value.codePointAt(endIndex - 1)\n }\n }\n\n return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''\n}\n","import {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {strikethrough} from './delete.js'\nimport {emphasis} from './emphasis.js'\nimport {footnoteReference} from './footnote-reference.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {imageReference} from './image-reference.js'\nimport {image} from './image.js'\nimport {inlineCode} from './inline-code.js'\nimport {linkReference} from './link-reference.js'\nimport {link} from './link.js'\nimport {listItem} from './list-item.js'\nimport {list} from './list.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {table} from './table.js'\nimport {tableRow} from './table-row.js'\nimport {tableCell} from './table-cell.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/**\n * Default handlers for nodes.\n *\n * @satisfies {import('../state.js').Handlers}\n */\nexport const handlers = {\n blockquote,\n break: hardBreak,\n code,\n delete: strikethrough,\n emphasis,\n footnoteReference,\n heading,\n html,\n imageReference,\n image,\n inlineCode,\n linkReference,\n link,\n listItem,\n list,\n paragraph,\n // @ts-expect-error: root is different, but hard to type.\n root,\n strong,\n table,\n tableCell,\n tableRow,\n text,\n thematicBreak,\n toml: ignore,\n yaml: ignore,\n definition: ignore,\n footnoteDefinition: ignore\n}\n\n// Return nothing for nodes that are ignored.\nfunction ignore() {\n return undefined\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `blockquote` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Blockquote} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function blockquote(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'blockquote',\n properties: {},\n children: state.wrap(state.all(node), true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('mdast').Break} Break\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `break` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Break} node\n * mdast node.\n * @returns {Array}\n * hast element content.\n */\nexport function hardBreak(state, node) {\n /** @type {Element} */\n const result = {type: 'element', tagName: 'br', properties: {}, children: []}\n state.patch(node, result)\n return [state.applyData(node, result), {type: 'text', value: '\\n'}]\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Code} Code\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `code` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Code} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function code(state, node) {\n const value = node.value ? node.value + '\\n' : ''\n /** @type {Properties} */\n const properties = {}\n\n if (node.lang) {\n properties.className = ['language-' + node.lang]\n }\n\n // Create ``.\n /** @type {Element} */\n let result = {\n type: 'element',\n tagName: 'code',\n properties,\n children: [{type: 'text', value}]\n }\n\n if (node.meta) {\n result.data = {meta: node.meta}\n }\n\n state.patch(node, result)\n result = state.applyData(node, result)\n\n // Create `
`.\n  result = {type: 'element', tagName: 'pre', properties: {}, children: [result]}\n  state.patch(node, result)\n  return result\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Delete} Delete\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `delete` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Delete} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strikethrough(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'del',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `emphasis` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Emphasis} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function emphasis(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'em',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').FootnoteReference} FootnoteReference\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `footnoteReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {FootnoteReference} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function footnoteReference(state, node) {\n  const clobberPrefix =\n    typeof state.options.clobberPrefix === 'string'\n      ? state.options.clobberPrefix\n      : 'user-content-'\n  const id = String(node.identifier).toUpperCase()\n  const safeId = normalizeUri(id.toLowerCase())\n  const index = state.footnoteOrder.indexOf(id)\n  /** @type {number} */\n  let counter\n\n  let reuseCounter = state.footnoteCounts.get(id)\n\n  if (reuseCounter === undefined) {\n    reuseCounter = 0\n    state.footnoteOrder.push(id)\n    counter = state.footnoteOrder.length\n  } else {\n    counter = index + 1\n  }\n\n  reuseCounter += 1\n  state.footnoteCounts.set(id, reuseCounter)\n\n  /** @type {Element} */\n  const link = {\n    type: 'element',\n    tagName: 'a',\n    properties: {\n      href: '#' + clobberPrefix + 'fn-' + safeId,\n      id:\n        clobberPrefix +\n        'fnref-' +\n        safeId +\n        (reuseCounter > 1 ? '-' + reuseCounter : ''),\n      dataFootnoteRef: true,\n      ariaDescribedBy: ['footnote-label']\n    },\n    children: [{type: 'text', value: String(counter)}]\n  }\n  state.patch(node, link)\n\n  /** @type {Element} */\n  const sup = {\n    type: 'element',\n    tagName: 'sup',\n    properties: {},\n    children: [link]\n  }\n  state.patch(node, sup)\n  return state.applyData(node, sup)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `heading` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Heading} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function heading(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'h' + node.depth,\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Html} Html\n * @typedef {import('../state.js').State} State\n * @typedef {import('../../index.js').Raw} Raw\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise\n * nothing).\n *\n * @param {State} state\n *   Info passed around.\n * @param {Html} node\n *   mdast node.\n * @returns {Element | Raw | undefined}\n *   hast node.\n */\nexport function html(state, node) {\n  if (state.options.allowDangerousHtml) {\n    /** @type {Raw} */\n    const result = {type: 'raw', value: node.value}\n    state.patch(node, result)\n    return state.applyData(node, result)\n  }\n\n  return undefined\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `imageReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ImageReference} node\n *   mdast node.\n * @returns {Array | ElementContent}\n *   hast node.\n */\nexport function imageReference(state, node) {\n  const id = String(node.identifier).toUpperCase()\n  const def = state.definitionById.get(id)\n\n  if (!def) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(def.url || ''), alt: node.alt}\n\n  if (def.title !== null && def.title !== undefined) {\n    properties.title = def.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Image} Image\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `image` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Image} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function image(state, node) {\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(node.url)}\n\n  if (node.alt !== null && node.alt !== undefined) {\n    properties.alt = node.alt\n  }\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Text} Text\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `inlineCode` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {InlineCode} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function inlineCode(state, node) {\n  /** @type {Text} */\n  const text = {type: 'text', value: node.value.replace(/\\r?\\n|\\r/g, ' ')}\n  state.patch(node, text)\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'code',\n    properties: {},\n    children: [text]\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `linkReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {LinkReference} node\n *   mdast node.\n * @returns {Array | ElementContent}\n *   hast node.\n */\nexport function linkReference(state, node) {\n  const id = String(node.identifier).toUpperCase()\n  const def = state.definitionById.get(id)\n\n  if (!def) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(def.url || '')}\n\n  if (def.title !== null && def.title !== undefined) {\n    properties.title = def.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Link} Link\n * @typedef {import('../state.js').State} State\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `link` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Link} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function link(state, node) {\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(node.url)}\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').List} List\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `list` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {List} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function list(state, node) {\n  /** @type {Properties} */\n  const properties = {}\n  const results = state.all(node)\n  let index = -1\n\n  if (typeof node.start === 'number' && node.start !== 1) {\n    properties.start = node.start\n  }\n\n  // Like GitHub, add a class for custom styling.\n  while (++index < results.length) {\n    const child = results[index]\n\n    if (\n      child.type === 'element' &&\n      child.tagName === 'li' &&\n      child.properties &&\n      Array.isArray(child.properties.className) &&\n      child.properties.className.includes('task-list-item')\n    ) {\n      properties.className = ['contains-task-list']\n      break\n    }\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: node.ordered ? 'ol' : 'ul',\n    properties,\n    children: state.wrap(results, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `paragraph` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Paragraph} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function paragraph(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'p',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Parents} HastParents\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `root` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastRoot} node\n *   mdast node.\n * @returns {HastParents}\n *   hast node.\n */\nexport function root(state, node) {\n  /** @type {HastRoot} */\n  const result = {type: 'root', children: state.wrap(state.all(node))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `strong` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Strong} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strong(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'strong',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').Table} Table\n * @typedef {import('../state.js').State} State\n */\n\nimport {pointEnd, pointStart} from 'unist-util-position'\n\n/**\n * Turn an mdast `table` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Table} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function table(state, node) {\n  const rows = state.all(node)\n  const firstRow = rows.shift()\n  /** @type {Array} */\n  const tableContent = []\n\n  if (firstRow) {\n    /** @type {Element} */\n    const head = {\n      type: 'element',\n      tagName: 'thead',\n      properties: {},\n      children: state.wrap([firstRow], true)\n    }\n    state.patch(node.children[0], head)\n    tableContent.push(head)\n  }\n\n  if (rows.length > 0) {\n    /** @type {Element} */\n    const body = {\n      type: 'element',\n      tagName: 'tbody',\n      properties: {},\n      children: state.wrap(rows, true)\n    }\n\n    const start = pointStart(node.children[1])\n    const end = pointEnd(node.children[node.children.length - 1])\n    if (start && end) body.position = {start, end}\n    tableContent.push(body)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'table',\n    properties: {},\n    children: state.wrap(tableContent, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').TableCell} TableCell\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `tableCell` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableCell} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function tableCell(state, node) {\n  // Note: this function is normally not called: see `table-row` for how rows\n  // and their cells are compiled.\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'td', // Assume body cell.\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Properties} Properties\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('mdast').TableRow} TableRow\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `tableRow` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableRow} node\n *   mdast node.\n * @param {Parents | undefined} parent\n *   Parent of `node`.\n * @returns {Element}\n *   hast node.\n */\nexport function tableRow(state, node, parent) {\n  const siblings = parent ? parent.children : undefined\n  // Generate a body row when without parent.\n  const rowIndex = siblings ? siblings.indexOf(node) : 1\n  const tagName = rowIndex === 0 ? 'th' : 'td'\n  // To do: option to use `style`?\n  const align = parent && parent.type === 'table' ? parent.align : undefined\n  const length = align ? align.length : node.children.length\n  let cellIndex = -1\n  /** @type {Array} */\n  const cells = []\n\n  while (++cellIndex < length) {\n    // Note: can also be undefined.\n    const cell = node.children[cellIndex]\n    /** @type {Properties} */\n    const properties = {}\n    const alignValue = align ? align[cellIndex] : undefined\n\n    if (alignValue) {\n      properties.align = alignValue\n    }\n\n    /** @type {Element} */\n    let result = {type: 'element', tagName, properties, children: []}\n\n    if (cell) {\n      result.children = state.all(cell)\n      state.patch(cell, result)\n      result = state.applyData(cell, result)\n    }\n\n    cells.push(result)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'tr',\n    properties: {},\n    children: state.wrap(cells, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('hast').Text} HastText\n * @typedef {import('mdast').Text} MdastText\n * @typedef {import('../state.js').State} State\n */\n\nimport {trimLines} from 'trim-lines'\n\n/**\n * Turn an mdast `text` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastText} node\n *   mdast node.\n * @returns {HastElement | HastText}\n *   hast node.\n */\nexport function text(state, node) {\n  /** @type {HastText} */\n  const result = {type: 'text', value: trimLines(String(node.value))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n * @typedef {import('../state.js').State} State\n */\n\n// Make VS Code show references to the above types.\n''\n\n/**\n * Turn an mdast `thematicBreak` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ThematicBreak} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function thematicBreak(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'hr',\n    properties: {},\n    children: []\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n","/**\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('hast').ElementContent} HastElementContent\n * @typedef {import('hast').Nodes} HastNodes\n * @typedef {import('hast').Properties} HastProperties\n * @typedef {import('hast').RootContent} HastRootContent\n * @typedef {import('hast').Text} HastText\n *\n * @typedef {import('mdast').Definition} MdastDefinition\n * @typedef {import('mdast').FootnoteDefinition} MdastFootnoteDefinition\n * @typedef {import('mdast').Nodes} MdastNodes\n * @typedef {import('mdast').Parents} MdastParents\n *\n * @typedef {import('./footer.js').FootnoteBackContentTemplate} FootnoteBackContentTemplate\n * @typedef {import('./footer.js').FootnoteBackLabelTemplate} FootnoteBackLabelTemplate\n */\n\n/**\n * @callback Handler\n *   Handle a node.\n * @param {State} state\n *   Info passed around.\n * @param {any} node\n *   mdast node to handle.\n * @param {MdastParents | undefined} parent\n *   Parent of `node`.\n * @returns {Array | HastElementContent | undefined}\n *   hast node.\n *\n * @typedef {Partial>} Handlers\n *   Handle nodes.\n *\n * @typedef Options\n *   Configuration (optional).\n * @property {boolean | null | undefined} [allowDangerousHtml=false]\n *   Whether to persist raw HTML in markdown in the hast tree (default:\n *   `false`).\n * @property {string | null | undefined} [clobberPrefix='user-content-']\n *   Prefix to use before the `id` property on footnotes to prevent them from\n *   *clobbering* (default: `'user-content-'`).\n *\n *   Pass `''` for trusted markdown and when you are careful with\n *   polyfilling.\n *   You could pass a different prefix.\n *\n *   DOM clobbering is this:\n *\n *   ```html\n *   

\n * \n * ```\n *\n * The above example shows that elements are made available by browsers, by\n * their ID, on the `window` object.\n * This is a security risk because you might be expecting some other variable\n * at that place.\n * It can also break polyfills.\n * Using a prefix solves these problems.\n * @property {FootnoteBackContentTemplate | string | null | undefined} [footnoteBackContent]\n * Content of the backreference back to references (default: `defaultFootnoteBackContent`).\n *\n * The default value is:\n *\n * ```js\n * function defaultFootnoteBackContent(_, rereferenceIndex) {\n * const result = [{type: 'text', value: '↩'}]\n *\n * if (rereferenceIndex > 1) {\n * result.push({\n * type: 'element',\n * tagName: 'sup',\n * properties: {},\n * children: [{type: 'text', value: String(rereferenceIndex)}]\n * })\n * }\n *\n * return result\n * }\n * ```\n *\n * This content is used in the `a` element of each backreference (the `↩`\n * links).\n * @property {FootnoteBackLabelTemplate | string | null | undefined} [footnoteBackLabel]\n * Label to describe the backreference back to references (default:\n * `defaultFootnoteBackLabel`).\n *\n * The default value is:\n *\n * ```js\n * function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) {\n * return (\n * 'Back to reference ' +\n * (referenceIndex + 1) +\n * (rereferenceIndex > 1 ? '-' + rereferenceIndex : '')\n * )\n * }\n * ```\n *\n * Change it when the markdown is not in English.\n *\n * This label is used in the `ariaLabel` property on each backreference\n * (the `↩` links).\n * It affects users of assistive technology.\n * @property {string | null | undefined} [footnoteLabel='Footnotes']\n * Textual label to use for the footnotes section (default: `'Footnotes'`).\n *\n * Change it when the markdown is not in English.\n *\n * This label is typically hidden visually (assuming a `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass different properties with the `footnoteLabelProperties` option.\n * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}]\n * Properties to use on the footnote label (default: `{className:\n * ['sr-only']}`).\n *\n * Change it to show the label and add other properties.\n *\n * This label is typically hidden visually (assuming an `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass an empty string.\n * You can also add different properties.\n *\n * > 👉 **Note**: `id: 'footnote-label'` is always added, because footnote\n * > calls use it with `aria-describedby` to provide an accessible label.\n * @property {string | null | undefined} [footnoteLabelTagName='h2']\n * HTML tag name to use for the footnote label element (default: `'h2'`).\n *\n * Change it to match your document structure.\n *\n * This label is typically hidden visually (assuming a `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass different properties with the `footnoteLabelProperties` option.\n * @property {Handlers | null | undefined} [handlers]\n * Extra handlers for nodes (optional).\n * @property {Array | null | undefined} [passThrough]\n * List of custom mdast node types to pass through (keep) in hast (note that\n * the node itself is passed, but eventual children are transformed)\n * (optional).\n * @property {Handler | null | undefined} [unknownHandler]\n * Handler for all unknown nodes (optional).\n *\n * @typedef State\n * Info passed around.\n * @property {(node: MdastNodes) => Array} all\n * Transform the children of an mdast parent to hast.\n * @property {(from: MdastNodes, to: Type) => HastElement | Type} applyData\n * Honor the `data` of `from`, and generate an element instead of `node`.\n * @property {Map} definitionById\n * Definitions by their identifier.\n * @property {Map} footnoteById\n * Footnote definitions by their identifier.\n * @property {Map} footnoteCounts\n * Counts for how often the same footnote was called.\n * @property {Array} footnoteOrder\n * Identifiers of order when footnote calls first appear in tree order.\n * @property {Handlers} handlers\n * Applied handlers.\n * @property {(node: MdastNodes, parent: MdastParents | undefined) => Array | HastElementContent | undefined} one\n * Transform an mdast node to hast.\n * @property {Options} options\n * Configuration.\n * @property {(from: MdastNodes, node: HastNodes) => undefined} patch\n * Copy a node’s positional info.\n * @property {(nodes: Array, loose?: boolean | undefined) => Array} wrap\n * Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`.\n */\n\nimport structuredClone from '@ungap/structured-clone'\nimport {visit} from 'unist-util-visit'\nimport {position} from 'unist-util-position'\nimport {handlers as defaultHandlers} from './handlers/index.js'\n\nconst own = {}.hasOwnProperty\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Create `state` from an mdast tree.\n *\n * @param {MdastNodes} tree\n * mdast node to transform.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {State}\n * `state` function.\n */\nexport function createState(tree, options) {\n const settings = options || emptyOptions\n /** @type {Map} */\n const definitionById = new Map()\n /** @type {Map} */\n const footnoteById = new Map()\n /** @type {Map} */\n const footnoteCounts = new Map()\n /** @type {Handlers} */\n // @ts-expect-error: the root handler returns a root.\n // Hard to type.\n const handlers = {...defaultHandlers, ...settings.handlers}\n\n /** @type {State} */\n const state = {\n all,\n applyData,\n definitionById,\n footnoteById,\n footnoteCounts,\n footnoteOrder: [],\n handlers,\n one,\n options: settings,\n patch,\n wrap\n }\n\n visit(tree, function (node) {\n if (node.type === 'definition' || node.type === 'footnoteDefinition') {\n const map = node.type === 'definition' ? definitionById : footnoteById\n const id = String(node.identifier).toUpperCase()\n\n // Mimick CM behavior of link definitions.\n // See: .\n if (!map.has(id)) {\n // @ts-expect-error: node type matches map.\n map.set(id, node)\n }\n }\n })\n\n return state\n\n /**\n * Transform an mdast node into a hast node.\n *\n * @param {MdastNodes} node\n * mdast node.\n * @param {MdastParents | undefined} [parent]\n * Parent of `node`.\n * @returns {Array | HastElementContent | undefined}\n * Resulting hast node.\n */\n function one(node, parent) {\n const type = node.type\n const handle = state.handlers[type]\n\n if (own.call(state.handlers, type) && handle) {\n return handle(state, node, parent)\n }\n\n if (state.options.passThrough && state.options.passThrough.includes(type)) {\n if ('children' in node) {\n const {children, ...shallow} = node\n const result = structuredClone(shallow)\n // @ts-expect-error: TS doesn’t understand…\n result.children = state.all(node)\n // @ts-expect-error: TS doesn’t understand…\n return result\n }\n\n // @ts-expect-error: it’s custom.\n return structuredClone(node)\n }\n\n const unknown = state.options.unknownHandler || defaultUnknownHandler\n\n return unknown(state, node, parent)\n }\n\n /**\n * Transform the children of an mdast node into hast nodes.\n *\n * @param {MdastNodes} parent\n * mdast node to compile\n * @returns {Array}\n * Resulting hast nodes.\n */\n function all(parent) {\n /** @type {Array} */\n const values = []\n\n if ('children' in parent) {\n const nodes = parent.children\n let index = -1\n while (++index < nodes.length) {\n const result = state.one(nodes[index], parent)\n\n // To do: see if we van clean this? Can we merge texts?\n if (result) {\n if (index && nodes[index - 1].type === 'break') {\n if (!Array.isArray(result) && result.type === 'text') {\n result.value = trimMarkdownSpaceStart(result.value)\n }\n\n if (!Array.isArray(result) && result.type === 'element') {\n const head = result.children[0]\n\n if (head && head.type === 'text') {\n head.value = trimMarkdownSpaceStart(head.value)\n }\n }\n }\n\n if (Array.isArray(result)) {\n values.push(...result)\n } else {\n values.push(result)\n }\n }\n }\n }\n\n return values\n }\n}\n\n/**\n * Copy a node’s positional info.\n *\n * @param {MdastNodes} from\n * mdast node to copy from.\n * @param {HastNodes} to\n * hast node to copy into.\n * @returns {undefined}\n * Nothing.\n */\nfunction patch(from, to) {\n if (from.position) to.position = position(from)\n}\n\n/**\n * Honor the `data` of `from` and maybe generate an element instead of `to`.\n *\n * @template {HastNodes} Type\n * Node type.\n * @param {MdastNodes} from\n * mdast node to use data from.\n * @param {Type} to\n * hast node to change.\n * @returns {HastElement | Type}\n * Nothing.\n */\nfunction applyData(from, to) {\n /** @type {HastElement | Type} */\n let result = to\n\n // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n if (from && from.data) {\n const hName = from.data.hName\n const hChildren = from.data.hChildren\n const hProperties = from.data.hProperties\n\n if (typeof hName === 'string') {\n // Transforming the node resulted in an element with a different name\n // than wanted:\n if (result.type === 'element') {\n result.tagName = hName\n }\n // Transforming the node resulted in a non-element, which happens for\n // raw, text, and root nodes (unless custom handlers are passed).\n // The intent of `hName` is to create an element, but likely also to keep\n // the content around (otherwise: pass `hChildren`).\n else {\n /** @type {Array} */\n // @ts-expect-error: assume no doctypes in `root`.\n const children = 'children' in result ? result.children : [result]\n result = {type: 'element', tagName: hName, properties: {}, children}\n }\n }\n\n if (result.type === 'element' && hProperties) {\n Object.assign(result.properties, structuredClone(hProperties))\n }\n\n if (\n 'children' in result &&\n result.children &&\n hChildren !== null &&\n hChildren !== undefined\n ) {\n result.children = hChildren\n }\n }\n\n return result\n}\n\n/**\n * Transform an unknown node.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdastNodes} node\n * Unknown mdast node.\n * @returns {HastElement | HastText}\n * Resulting hast node.\n */\nfunction defaultUnknownHandler(state, node) {\n const data = node.data || {}\n /** @type {HastElement | HastText} */\n const result =\n 'value' in node &&\n !(own.call(data, 'hProperties') || own.call(data, 'hChildren'))\n ? {type: 'text', value: node.value}\n : {\n type: 'element',\n tagName: 'div',\n properties: {},\n children: state.all(node)\n }\n\n state.patch(node, result)\n return state.applyData(node, result)\n}\n\n/**\n * Wrap `nodes` with line endings between each node.\n *\n * @template {HastRootContent} Type\n * Node type.\n * @param {Array} nodes\n * List of nodes to wrap.\n * @param {boolean | undefined} [loose=false]\n * Whether to add line endings at start and end (default: `false`).\n * @returns {Array}\n * Wrapped nodes.\n */\nexport function wrap(nodes, loose) {\n /** @type {Array} */\n const result = []\n let index = -1\n\n if (loose) {\n result.push({type: 'text', value: '\\n'})\n }\n\n while (++index < nodes.length) {\n if (index) result.push({type: 'text', value: '\\n'})\n result.push(nodes[index])\n }\n\n if (loose && nodes.length > 0) {\n result.push({type: 'text', value: '\\n'})\n }\n\n return result\n}\n\n/**\n * Trim spaces and tabs at the start of `value`.\n *\n * @param {string} value\n * Value to trim.\n * @returns {string}\n * Result.\n */\nfunction trimMarkdownSpaceStart(value) {\n let index = 0\n let code = value.charCodeAt(index)\n\n while (code === 9 || code === 32) {\n index++\n code = value.charCodeAt(index)\n }\n\n return value.slice(index)\n}\n","/**\n * @typedef {import('hast').Nodes} HastNodes\n * @typedef {import('mdast').Nodes} MdastNodes\n * @typedef {import('./state.js').Options} Options\n */\n\nimport {ok as assert} from 'devlop'\nimport {footer} from './footer.js'\nimport {createState} from './state.js'\n\n/**\n * Transform mdast to hast.\n *\n * ##### Notes\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most utilities ignore `raw` nodes but two notable ones don’t:\n *\n * * `hast-util-to-html` also has an option `allowDangerousHtml` which will\n * output the raw HTML.\n * This is typically discouraged as noted by the option name but is useful\n * if you completely trust authors\n * * `hast-util-raw` can handle the raw embedded HTML strings by parsing them\n * into standard hast nodes (`element`, `text`, etc).\n * This is a heavy task as it needs a full HTML parser, but it is the only\n * way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark, which we follow by default.\n * They are supported by GitHub, so footnotes can be enabled in markdown with\n * `mdast-util-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes, which is hidden for sighted users but shown to\n * assistive technology.\n * When your page is not in English, you must define translated values.\n *\n * Back references use ARIA attributes, but the section label itself uses a\n * heading that is hidden with an `sr-only` class.\n * To show it to sighted users, define different attributes in\n * `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem, as it links footnote calls to footnote\n * definitions on the page through `id` attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n *

\n * \n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * Example: headings (DOM clobbering) in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value` (and doesn’t have `data.hName`,\n * `data.hProperties`, or `data.hChildren`, see later), create a hast `text`\n * node\n * * otherwise, create a `
` element (which could be changed with\n * `data.hName`), with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @param {MdastNodes} tree\n * mdast tree.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {HastNodes}\n * hast tree.\n */\nexport function toHast(tree, options) {\n const state = createState(tree, options)\n const node = state.one(tree, undefined)\n const foot = footer(state)\n /** @type {HastNodes} */\n const result = Array.isArray(node)\n ? {type: 'root', children: node}\n : node || {type: 'root', children: []}\n\n if (foot) {\n // If there’s a footer, there were definitions, meaning block\n // content.\n // So `result` is a parent node.\n assert('children' in result)\n result.children.push({type: 'text', value: '\\n'}, foot)\n }\n\n return result\n}\n","// Include `data` fields in mdast and `raw` nodes in hast.\n/// \n\n/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('mdast-util-to-hast').Options} Options\n * @typedef {import('unified').Processor} Processor\n * @typedef {import('vfile').VFile} VFile\n */\n\n/**\n * @callback TransformBridge\n * Bridge-mode.\n *\n * Runs the destination with the new hast tree.\n * Discards result.\n * @param {MdastRoot} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {Promise}\n * Nothing.\n *\n * @callback TransformMutate\n * Mutate-mode.\n *\n * Further transformers run on the hast tree.\n * @param {MdastRoot} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {HastRoot}\n * Tree (hast).\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n/**\n * Turn markdown into HTML.\n *\n * ##### Notes\n *\n * ###### Signature\n *\n * * if a processor is given, runs the (rehype) plugins used on it with a\n * hast tree, then discards the result (*bridge mode*)\n * * otherwise, returns a hast tree, the plugins used after `remarkRehype`\n * are rehype plugins (*mutate mode*)\n *\n * > 👉 **Note**: It’s highly unlikely that you want to pass a `processor`.\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most plugins ignore `raw` nodes but two notable ones don’t:\n *\n * * `rehype-stringify` also has an option `allowDangerousHtml` which will\n * output the raw HTML.\n * This is typically discouraged as noted by the option name but is useful if\n * you completely trust authors\n * * `rehype-raw` can handle the raw embedded HTML strings by parsing them\n * into standard hast nodes (`element`, `text`, etc).\n * This is a heavy task as it needs a full HTML parser, but it is the only way\n * to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark, which we follow by default.\n * They are supported by GitHub, so footnotes can be enabled in markdown with\n * `remark-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes, which is hidden for sighted users but shown to\n * assistive technology.\n * When your page is not in English, you must define translated values.\n *\n * Back references use ARIA attributes, but the section label itself uses a\n * heading that is hidden with an `sr-only` class.\n * To show it to sighted users, define different attributes in\n * `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem, as it links footnote calls to footnote\n * definitions on the page through `id` attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n *

\n * \n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * *Example: headings (DOM clobbering)* in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value` (and doesn’t have `data.hName`,\n * `data.hProperties`, or `data.hChildren`, see later), create a hast `text`\n * node\n * * otherwise, create a `
` element (which could be changed with\n * `data.hName`), with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @overload\n * @param {Processor} processor\n * @param {Readonly | null | undefined} [options]\n * @returns {TransformBridge}\n *\n * @overload\n * @param {Readonly | null | undefined} [options]\n * @returns {TransformMutate}\n *\n * @param {Readonly | Processor | null | undefined} [destination]\n * Processor or configuration (optional).\n * @param {Readonly | null | undefined} [options]\n * When a processor was given, configuration (optional).\n * @returns {TransformBridge | TransformMutate}\n * Transform.\n */\nexport default function remarkRehype(destination, options) {\n if (destination && 'run' in destination) {\n /**\n * @type {TransformBridge}\n */\n return async function (tree, file) {\n // Cast because root in -> root out.\n const hastTree = /** @type {HastRoot} */ (toHast(tree, options))\n await destination.run(hastTree, file)\n }\n }\n\n /**\n * @type {TransformMutate}\n */\n return function (tree) {\n // Cast because root in -> root out.\n return /** @type {HastRoot} */ (toHast(tree, options || destination))\n }\n}\n","/**\n * Throw a given error.\n *\n * @param {Error|null|undefined} [error]\n * Maybe error.\n * @returns {asserts error is null|undefined}\n */\nexport function bail(error) {\n if (error) {\n throw error\n }\n}\n","export default function isPlainObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);\n}\n","/**\n * @typedef {(error?: Error|null|undefined, ...output: Array) => void} Callback\n * @typedef {(...input: Array) => any} Middleware\n *\n * @typedef {(...input: Array) => void} Run\n * Call all middleware.\n * @typedef {(fn: Middleware) => Pipeline} Use\n * Add `fn` (middleware) to the list.\n * @typedef {{run: Run, use: Use}} Pipeline\n * Middleware.\n */\n\n/**\n * Create new middleware.\n *\n * @returns {Pipeline}\n */\nexport function trough() {\n /** @type {Array} */\n const fns = []\n /** @type {Pipeline} */\n const pipeline = {run, use}\n\n return pipeline\n\n /** @type {Run} */\n function run(...values) {\n let middlewareIndex = -1\n /** @type {Callback} */\n const callback = values.pop()\n\n if (typeof callback !== 'function') {\n throw new TypeError('Expected function as last argument, not ' + callback)\n }\n\n next(null, ...values)\n\n /**\n * Run the next `fn`, or we’re done.\n *\n * @param {Error|null|undefined} error\n * @param {Array} output\n */\n function next(error, ...output) {\n const fn = fns[++middlewareIndex]\n let index = -1\n\n if (error) {\n callback(error)\n return\n }\n\n // Copy non-nullish input into values.\n while (++index < values.length) {\n if (output[index] === null || output[index] === undefined) {\n output[index] = values[index]\n }\n }\n\n // Save the newly created `output` for the next call.\n values = output\n\n // Next or done.\n if (fn) {\n wrap(fn, next)(...output)\n } else {\n callback(null, ...output)\n }\n }\n }\n\n /** @type {Use} */\n function use(middelware) {\n if (typeof middelware !== 'function') {\n throw new TypeError(\n 'Expected `middelware` to be a function, not ' + middelware\n )\n }\n\n fns.push(middelware)\n return pipeline\n }\n}\n\n/**\n * Wrap `middleware`.\n * Can be sync or async; return a promise, receive a callback, or return new\n * values and errors.\n *\n * @param {Middleware} middleware\n * @param {Callback} callback\n */\nexport function wrap(middleware, callback) {\n /** @type {boolean} */\n let called\n\n return wrapped\n\n /**\n * Call `middleware`.\n * @this {any}\n * @param {Array} parameters\n * @returns {void}\n */\n function wrapped(...parameters) {\n const fnExpectsCallback = middleware.length > parameters.length\n /** @type {any} */\n let result\n\n if (fnExpectsCallback) {\n parameters.push(done)\n }\n\n try {\n result = middleware.apply(this, parameters)\n } catch (error) {\n const exception = /** @type {Error} */ (error)\n\n // Well, this is quite the pickle.\n // `middleware` received a callback and called it synchronously, but that\n // threw an error.\n // The only thing left to do is to throw the thing instead.\n if (fnExpectsCallback && called) {\n throw exception\n }\n\n return done(exception)\n }\n\n if (!fnExpectsCallback) {\n if (result instanceof Promise) {\n result.then(then, done)\n } else if (result instanceof Error) {\n done(result)\n } else {\n then(result)\n }\n }\n }\n\n /**\n * Call `callback`, only once.\n * @type {Callback}\n */\n function done(error, ...output) {\n if (!called) {\n called = true\n callback(error, ...output)\n }\n }\n\n /**\n * Call `done` with one value.\n *\n * @param {any} [value]\n */\n function then(value) {\n done(null, value)\n }\n}\n","// A derivative work based on:\n// .\n// Which is licensed:\n//\n// MIT License\n//\n// Copyright (c) 2013 James Halliday\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of\n// this software and associated documentation files (the \"Software\"), to deal in\n// the Software without restriction, including without limitation the rights to\n// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n// the Software, and to permit persons to whom the Software is furnished to do so,\n// subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n// A derivative work based on:\n//\n// Parts of that are extracted from Node’s internal `path` module:\n// .\n// Which is licensed:\n//\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nexport const path = {basename, dirname, extname, join, sep: '/'}\n\n/* eslint-disable max-depth, complexity */\n\n/**\n * Get the basename from a path.\n *\n * @param {string} path\n * File path.\n * @param {string | null | undefined} [ext]\n * Extension to strip.\n * @returns {string}\n * Stem or basename.\n */\nfunction basename(path, ext) {\n if (ext !== undefined && typeof ext !== 'string') {\n throw new TypeError('\"ext\" argument must be a string')\n }\n\n assertPath(path)\n let start = 0\n let end = -1\n let index = path.length\n /** @type {boolean | undefined} */\n let seenNonSlash\n\n if (ext === undefined || ext.length === 0 || ext.length > path.length) {\n while (index--) {\n if (path.codePointAt(index) === 47 /* `/` */) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now.\n if (seenNonSlash) {\n start = index + 1\n break\n }\n } else if (end < 0) {\n // We saw the first non-path separator, mark this as the end of our\n // path component.\n seenNonSlash = true\n end = index + 1\n }\n }\n\n return end < 0 ? '' : path.slice(start, end)\n }\n\n if (ext === path) {\n return ''\n }\n\n let firstNonSlashEnd = -1\n let extIndex = ext.length - 1\n\n while (index--) {\n if (path.codePointAt(index) === 47 /* `/` */) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now.\n if (seenNonSlash) {\n start = index + 1\n break\n }\n } else {\n if (firstNonSlashEnd < 0) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching.\n seenNonSlash = true\n firstNonSlashEnd = index + 1\n }\n\n if (extIndex > -1) {\n // Try to match the explicit extension.\n if (path.codePointAt(index) === ext.codePointAt(extIndex--)) {\n if (extIndex < 0) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = index\n }\n } else {\n // Extension does not match, so our result is the entire path\n // component\n extIndex = -1\n end = firstNonSlashEnd\n }\n }\n }\n }\n\n if (start === end) {\n end = firstNonSlashEnd\n } else if (end < 0) {\n end = path.length\n }\n\n return path.slice(start, end)\n}\n\n/**\n * Get the dirname from a path.\n *\n * @param {string} path\n * File path.\n * @returns {string}\n * File path.\n */\nfunction dirname(path) {\n assertPath(path)\n\n if (path.length === 0) {\n return '.'\n }\n\n let end = -1\n let index = path.length\n /** @type {boolean | undefined} */\n let unmatchedSlash\n\n // Prefix `--` is important to not run on `0`.\n while (--index) {\n if (path.codePointAt(index) === 47 /* `/` */) {\n if (unmatchedSlash) {\n end = index\n break\n }\n } else if (!unmatchedSlash) {\n // We saw the first non-path separator\n unmatchedSlash = true\n }\n }\n\n return end < 0\n ? path.codePointAt(0) === 47 /* `/` */\n ? '/'\n : '.'\n : end === 1 && path.codePointAt(0) === 47 /* `/` */\n ? '//'\n : path.slice(0, end)\n}\n\n/**\n * Get an extname from a path.\n *\n * @param {string} path\n * File path.\n * @returns {string}\n * Extname.\n */\nfunction extname(path) {\n assertPath(path)\n\n let index = path.length\n\n let end = -1\n let startPart = 0\n let startDot = -1\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find.\n let preDotState = 0\n /** @type {boolean | undefined} */\n let unmatchedSlash\n\n while (index--) {\n const code = path.codePointAt(index)\n\n if (code === 47 /* `/` */) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now.\n if (unmatchedSlash) {\n startPart = index + 1\n break\n }\n\n continue\n }\n\n if (end < 0) {\n // We saw the first non-path separator, mark this as the end of our\n // extension.\n unmatchedSlash = true\n end = index + 1\n }\n\n if (code === 46 /* `.` */) {\n // If this is our first dot, mark it as the start of our extension.\n if (startDot < 0) {\n startDot = index\n } else if (preDotState !== 1) {\n preDotState = 1\n }\n } else if (startDot > -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension.\n preDotState = -1\n }\n }\n\n if (\n startDot < 0 ||\n end < 0 ||\n // We saw a non-dot character immediately before the dot.\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly `..`.\n (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)\n ) {\n return ''\n }\n\n return path.slice(startDot, end)\n}\n\n/**\n * Join segments from a path.\n *\n * @param {Array} segments\n * Path segments.\n * @returns {string}\n * File path.\n */\nfunction join(...segments) {\n let index = -1\n /** @type {string | undefined} */\n let joined\n\n while (++index < segments.length) {\n assertPath(segments[index])\n\n if (segments[index]) {\n joined =\n joined === undefined ? segments[index] : joined + '/' + segments[index]\n }\n }\n\n return joined === undefined ? '.' : normalize(joined)\n}\n\n/**\n * Normalize a basic file path.\n *\n * @param {string} path\n * File path.\n * @returns {string}\n * File path.\n */\n// Note: `normalize` is not exposed as `path.normalize`, so some code is\n// manually removed from it.\nfunction normalize(path) {\n assertPath(path)\n\n const absolute = path.codePointAt(0) === 47 /* `/` */\n\n // Normalize the path according to POSIX rules.\n let value = normalizeString(path, !absolute)\n\n if (value.length === 0 && !absolute) {\n value = '.'\n }\n\n if (value.length > 0 && path.codePointAt(path.length - 1) === 47 /* / */) {\n value += '/'\n }\n\n return absolute ? '/' + value : value\n}\n\n/**\n * Resolve `.` and `..` elements in a path with directory names.\n *\n * @param {string} path\n * File path.\n * @param {boolean} allowAboveRoot\n * Whether `..` can move above root.\n * @returns {string}\n * File path.\n */\nfunction normalizeString(path, allowAboveRoot) {\n let result = ''\n let lastSegmentLength = 0\n let lastSlash = -1\n let dots = 0\n let index = -1\n /** @type {number | undefined} */\n let code\n /** @type {number} */\n let lastSlashIndex\n\n while (++index <= path.length) {\n if (index < path.length) {\n code = path.codePointAt(index)\n } else if (code === 47 /* `/` */) {\n break\n } else {\n code = 47 /* `/` */\n }\n\n if (code === 47 /* `/` */) {\n if (lastSlash === index - 1 || dots === 1) {\n // Empty.\n } else if (lastSlash !== index - 1 && dots === 2) {\n if (\n result.length < 2 ||\n lastSegmentLength !== 2 ||\n result.codePointAt(result.length - 1) !== 46 /* `.` */ ||\n result.codePointAt(result.length - 2) !== 46 /* `.` */\n ) {\n if (result.length > 2) {\n lastSlashIndex = result.lastIndexOf('/')\n\n if (lastSlashIndex !== result.length - 1) {\n if (lastSlashIndex < 0) {\n result = ''\n lastSegmentLength = 0\n } else {\n result = result.slice(0, lastSlashIndex)\n lastSegmentLength = result.length - 1 - result.lastIndexOf('/')\n }\n\n lastSlash = index\n dots = 0\n continue\n }\n } else if (result.length > 0) {\n result = ''\n lastSegmentLength = 0\n lastSlash = index\n dots = 0\n continue\n }\n }\n\n if (allowAboveRoot) {\n result = result.length > 0 ? result + '/..' : '..'\n lastSegmentLength = 2\n }\n } else {\n if (result.length > 0) {\n result += '/' + path.slice(lastSlash + 1, index)\n } else {\n result = path.slice(lastSlash + 1, index)\n }\n\n lastSegmentLength = index - lastSlash - 1\n }\n\n lastSlash = index\n dots = 0\n } else if (code === 46 /* `.` */ && dots > -1) {\n dots++\n } else {\n dots = -1\n }\n }\n\n return result\n}\n\n/**\n * Make sure `path` is a string.\n *\n * @param {string} path\n * File path.\n * @returns {asserts path is string}\n * Nothing.\n */\nfunction assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError(\n 'Path must be a string. Received ' + JSON.stringify(path)\n )\n }\n}\n\n/* eslint-enable max-depth, complexity */\n","// Somewhat based on:\n// .\n// But I don’t think one tiny line of code can be copyrighted. 😅\nexport const proc = {cwd}\n\nfunction cwd() {\n return '/'\n}\n","/**\n * Checks if a value has the shape of a WHATWG URL object.\n *\n * Using a symbol or instanceof would not be able to recognize URL objects\n * coming from other implementations (e.g. in Electron), so instead we are\n * checking some well known properties for a lack of a better test.\n *\n * We use `href` and `protocol` as they are the only properties that are\n * easy to retrieve and calculate due to the lazy nature of the getters.\n *\n * We check for auth attribute to distinguish legacy url instance with\n * WHATWG URL instance.\n *\n * @param {unknown} fileUrlOrPath\n * File path or URL.\n * @returns {fileUrlOrPath is URL}\n * Whether it’s a URL.\n */\n// From: \nexport function isUrl(fileUrlOrPath) {\n return Boolean(\n fileUrlOrPath !== null &&\n typeof fileUrlOrPath === 'object' &&\n 'href' in fileUrlOrPath &&\n fileUrlOrPath.href &&\n 'protocol' in fileUrlOrPath &&\n fileUrlOrPath.protocol &&\n // @ts-expect-error: indexing is fine.\n fileUrlOrPath.auth === undefined\n )\n}\n","import {isUrl} from './minurl.shared.js'\n\nexport {isUrl} from './minurl.shared.js'\n\n// See: \n\n/**\n * @param {URL | string} path\n * File URL.\n * @returns {string}\n * File URL.\n */\nexport function urlToPath(path) {\n if (typeof path === 'string') {\n path = new URL(path)\n } else if (!isUrl(path)) {\n /** @type {NodeJS.ErrnoException} */\n const error = new TypeError(\n 'The \"path\" argument must be of type string or an instance of URL. Received `' +\n path +\n '`'\n )\n error.code = 'ERR_INVALID_ARG_TYPE'\n throw error\n }\n\n if (path.protocol !== 'file:') {\n /** @type {NodeJS.ErrnoException} */\n const error = new TypeError('The URL must be of scheme file')\n error.code = 'ERR_INVALID_URL_SCHEME'\n throw error\n }\n\n return getPathFromURLPosix(path)\n}\n\n/**\n * Get a path from a POSIX URL.\n *\n * @param {URL} url\n * URL.\n * @returns {string}\n * File path.\n */\nfunction getPathFromURLPosix(url) {\n if (url.hostname !== '') {\n /** @type {NodeJS.ErrnoException} */\n const error = new TypeError(\n 'File URL host must be \"localhost\" or empty on darwin'\n )\n error.code = 'ERR_INVALID_FILE_URL_HOST'\n throw error\n }\n\n const pathname = url.pathname\n let index = -1\n\n while (++index < pathname.length) {\n if (\n pathname.codePointAt(index) === 37 /* `%` */ &&\n pathname.codePointAt(index + 1) === 50 /* `2` */\n ) {\n const third = pathname.codePointAt(index + 2)\n if (third === 70 /* `F` */ || third === 102 /* `f` */) {\n /** @type {NodeJS.ErrnoException} */\n const error = new TypeError(\n 'File URL path must not include encoded / characters'\n )\n error.code = 'ERR_INVALID_FILE_URL_PATH'\n throw error\n }\n }\n }\n\n return decodeURIComponent(pathname)\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n * @typedef {import('unist').Position} Position\n * @typedef {import('vfile-message').Options} MessageOptions\n * @typedef {import('../index.js').Data} Data\n * @typedef {import('../index.js').Value} Value\n */\n\n/**\n * @typedef {object & {type: string, position?: Position | undefined}} NodeLike\n *\n * @typedef {Options | URL | VFile | Value} Compatible\n * Things that can be passed to the constructor.\n *\n * @typedef VFileCoreOptions\n * Set multiple values.\n * @property {string | null | undefined} [basename]\n * Set `basename` (name).\n * @property {string | null | undefined} [cwd]\n * Set `cwd` (working directory).\n * @property {Data | null | undefined} [data]\n * Set `data` (associated info).\n * @property {string | null | undefined} [dirname]\n * Set `dirname` (path w/o basename).\n * @property {string | null | undefined} [extname]\n * Set `extname` (extension with dot).\n * @property {Array | null | undefined} [history]\n * Set `history` (paths the file moved between).\n * @property {URL | string | null | undefined} [path]\n * Set `path` (current path).\n * @property {string | null | undefined} [stem]\n * Set `stem` (name without extension).\n * @property {Value | null | undefined} [value]\n * Set `value` (the contents of the file).\n *\n * @typedef Map\n * Raw source map.\n *\n * See:\n * .\n * @property {number} version\n * Which version of the source map spec this map is following.\n * @property {Array} sources\n * An array of URLs to the original source files.\n * @property {Array} names\n * An array of identifiers which can be referenced by individual mappings.\n * @property {string | undefined} [sourceRoot]\n * The URL root from which all sources are relative.\n * @property {Array | undefined} [sourcesContent]\n * An array of contents of the original source files.\n * @property {string} mappings\n * A string of base64 VLQs which contain the actual mappings.\n * @property {string} file\n * The generated file this source map is associated with.\n *\n * @typedef {Record & VFileCoreOptions} Options\n * Configuration.\n *\n * A bunch of keys that will be shallow copied over to the new file.\n *\n * @typedef {Record} ReporterSettings\n * Configuration for reporters.\n */\n\n/**\n * @template [Settings=ReporterSettings]\n * Options type.\n * @callback Reporter\n * Type for a reporter.\n * @param {Array} files\n * Files to report.\n * @param {Settings} options\n * Configuration.\n * @returns {string}\n * Report.\n */\n\nimport {VFileMessage} from 'vfile-message'\nimport {path} from 'vfile/do-not-use-conditional-minpath'\nimport {proc} from 'vfile/do-not-use-conditional-minproc'\nimport {urlToPath, isUrl} from 'vfile/do-not-use-conditional-minurl'\n\n/**\n * Order of setting (least specific to most), we need this because otherwise\n * `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a\n * stem can be set.\n */\nconst order = /** @type {const} */ ([\n 'history',\n 'path',\n 'basename',\n 'stem',\n 'extname',\n 'dirname'\n])\n\nexport class VFile {\n /**\n * Create a new virtual file.\n *\n * `options` is treated as:\n *\n * * `string` or `Uint8Array` — `{value: options}`\n * * `URL` — `{path: options}`\n * * `VFile` — shallow copies its data over to the new file\n * * `object` — all fields are shallow copied over to the new file\n *\n * Path related fields are set in the following order (least specific to\n * most specific): `history`, `path`, `basename`, `stem`, `extname`,\n * `dirname`.\n *\n * You cannot set `dirname` or `extname` without setting either `history`,\n * `path`, `basename`, or `stem` too.\n *\n * @param {Compatible | null | undefined} [value]\n * File value.\n * @returns\n * New instance.\n */\n constructor(value) {\n /** @type {Options | VFile} */\n let options\n\n if (!value) {\n options = {}\n } else if (isUrl(value)) {\n options = {path: value}\n } else if (typeof value === 'string' || isUint8Array(value)) {\n options = {value}\n } else {\n options = value\n }\n\n /* eslint-disable no-unused-expressions */\n\n /**\n * Base of `path` (default: `process.cwd()` or `'/'` in browsers).\n *\n * @type {string}\n */\n this.cwd = proc.cwd()\n\n /**\n * Place to store custom info (default: `{}`).\n *\n * It’s OK to store custom data directly on the file but moving it to\n * `data` is recommended.\n *\n * @type {Data}\n */\n this.data = {}\n\n /**\n * List of file paths the file moved between.\n *\n * The first is the original path and the last is the current path.\n *\n * @type {Array}\n */\n this.history = []\n\n /**\n * List of messages associated with the file.\n *\n * @type {Array}\n */\n this.messages = []\n\n /**\n * Raw value.\n *\n * @type {Value}\n */\n this.value\n\n // The below are non-standard, they are “well-known”.\n // As in, used in several tools.\n /**\n * Source map.\n *\n * This type is equivalent to the `RawSourceMap` type from the `source-map`\n * module.\n *\n * @type {Map | null | undefined}\n */\n this.map\n\n /**\n * Custom, non-string, compiled, representation.\n *\n * This is used by unified to store non-string results.\n * One example is when turning markdown into React nodes.\n *\n * @type {unknown}\n */\n this.result\n\n /**\n * Whether a file was saved to disk.\n *\n * This is used by vfile reporters.\n *\n * @type {boolean}\n */\n this.stored\n /* eslint-enable no-unused-expressions */\n\n // Set path related properties in the correct order.\n let index = -1\n\n while (++index < order.length) {\n const prop = order[index]\n\n // Note: we specifically use `in` instead of `hasOwnProperty` to accept\n // `vfile`s too.\n if (\n prop in options &&\n options[prop] !== undefined &&\n options[prop] !== null\n ) {\n // @ts-expect-error: TS doesn’t understand basic reality.\n this[prop] = prop === 'history' ? [...options[prop]] : options[prop]\n }\n }\n\n /** @type {string} */\n let prop\n\n // Set non-path related properties.\n for (prop in options) {\n // @ts-expect-error: fine to set other things.\n if (!order.includes(prop)) {\n // @ts-expect-error: fine to set other things.\n this[prop] = options[prop]\n }\n }\n }\n\n /**\n * Get the basename (including extname) (example: `'index.min.js'`).\n *\n * @returns {string | undefined}\n * Basename.\n */\n get basename() {\n return typeof this.path === 'string' ? path.basename(this.path) : undefined\n }\n\n /**\n * Set basename (including extname) (`'index.min.js'`).\n *\n * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\\'`\n * on windows).\n * Cannot be nullified (use `file.path = file.dirname` instead).\n *\n * @param {string} basename\n * Basename.\n * @returns {undefined}\n * Nothing.\n */\n set basename(basename) {\n assertNonEmpty(basename, 'basename')\n assertPart(basename, 'basename')\n this.path = path.join(this.dirname || '', basename)\n }\n\n /**\n * Get the parent path (example: `'~'`).\n *\n * @returns {string | undefined}\n * Dirname.\n */\n get dirname() {\n return typeof this.path === 'string' ? path.dirname(this.path) : undefined\n }\n\n /**\n * Set the parent path (example: `'~'`).\n *\n * Cannot be set if there’s no `path` yet.\n *\n * @param {string | undefined} dirname\n * Dirname.\n * @returns {undefined}\n * Nothing.\n */\n set dirname(dirname) {\n assertPath(this.basename, 'dirname')\n this.path = path.join(dirname || '', this.basename)\n }\n\n /**\n * Get the extname (including dot) (example: `'.js'`).\n *\n * @returns {string | undefined}\n * Extname.\n */\n get extname() {\n return typeof this.path === 'string' ? path.extname(this.path) : undefined\n }\n\n /**\n * Set the extname (including dot) (example: `'.js'`).\n *\n * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\\'`\n * on windows).\n * Cannot be set if there’s no `path` yet.\n *\n * @param {string | undefined} extname\n * Extname.\n * @returns {undefined}\n * Nothing.\n */\n set extname(extname) {\n assertPart(extname, 'extname')\n assertPath(this.dirname, 'extname')\n\n if (extname) {\n if (extname.codePointAt(0) !== 46 /* `.` */) {\n throw new Error('`extname` must start with `.`')\n }\n\n if (extname.includes('.', 1)) {\n throw new Error('`extname` cannot contain multiple dots')\n }\n }\n\n this.path = path.join(this.dirname, this.stem + (extname || ''))\n }\n\n /**\n * Get the full path (example: `'~/index.min.js'`).\n *\n * @returns {string}\n * Path.\n */\n get path() {\n return this.history[this.history.length - 1]\n }\n\n /**\n * Set the full path (example: `'~/index.min.js'`).\n *\n * Cannot be nullified.\n * You can set a file URL (a `URL` object with a `file:` protocol) which will\n * be turned into a path with `url.fileURLToPath`.\n *\n * @param {URL | string} path\n * Path.\n * @returns {undefined}\n * Nothing.\n */\n set path(path) {\n if (isUrl(path)) {\n path = urlToPath(path)\n }\n\n assertNonEmpty(path, 'path')\n\n if (this.path !== path) {\n this.history.push(path)\n }\n }\n\n /**\n * Get the stem (basename w/o extname) (example: `'index.min'`).\n *\n * @returns {string | undefined}\n * Stem.\n */\n get stem() {\n return typeof this.path === 'string'\n ? path.basename(this.path, this.extname)\n : undefined\n }\n\n /**\n * Set the stem (basename w/o extname) (example: `'index.min'`).\n *\n * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\\'`\n * on windows).\n * Cannot be nullified (use `file.path = file.dirname` instead).\n *\n * @param {string} stem\n * Stem.\n * @returns {undefined}\n * Nothing.\n */\n set stem(stem) {\n assertNonEmpty(stem, 'stem')\n assertPart(stem, 'stem')\n this.path = path.join(this.dirname || '', stem + (this.extname || ''))\n }\n\n // Normal prototypal methods.\n /**\n * Create a fatal message for `reason` associated with the file.\n *\n * The `fatal` field of the message is set to `true` (error; file not usable)\n * and the `file` field is set to the current file path.\n * The message is added to the `messages` field on `file`.\n *\n * > 🪦 **Note**: also has obsolete signatures.\n *\n * @overload\n * @param {string} reason\n * @param {MessageOptions | null | undefined} [options]\n * @returns {never}\n *\n * @overload\n * @param {string} reason\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {string} reason\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {string} reason\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @param {Error | VFileMessage | string} causeOrReason\n * Reason for message, should use markdown.\n * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]\n * Configuration (optional).\n * @param {string | null | undefined} [origin]\n * Place in code where the message originates (example:\n * `'my-package:my-rule'` or `'my-rule'`).\n * @returns {never}\n * Never.\n * @throws {VFileMessage}\n * Message.\n */\n fail(causeOrReason, optionsOrParentOrPlace, origin) {\n // @ts-expect-error: the overloads are fine.\n const message = this.message(causeOrReason, optionsOrParentOrPlace, origin)\n\n message.fatal = true\n\n throw message\n }\n\n /**\n * Create an info message for `reason` associated with the file.\n *\n * The `fatal` field of the message is set to `undefined` (info; change\n * likely not needed) and the `file` field is set to the current file path.\n * The message is added to the `messages` field on `file`.\n *\n * > 🪦 **Note**: also has obsolete signatures.\n *\n * @overload\n * @param {string} reason\n * @param {MessageOptions | null | undefined} [options]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @param {Error | VFileMessage | string} causeOrReason\n * Reason for message, should use markdown.\n * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]\n * Configuration (optional).\n * @param {string | null | undefined} [origin]\n * Place in code where the message originates (example:\n * `'my-package:my-rule'` or `'my-rule'`).\n * @returns {VFileMessage}\n * Message.\n */\n info(causeOrReason, optionsOrParentOrPlace, origin) {\n // @ts-expect-error: the overloads are fine.\n const message = this.message(causeOrReason, optionsOrParentOrPlace, origin)\n\n message.fatal = undefined\n\n return message\n }\n\n /**\n * Create a message for `reason` associated with the file.\n *\n * The `fatal` field of the message is set to `false` (warning; change may be\n * needed) and the `file` field is set to the current file path.\n * The message is added to the `messages` field on `file`.\n *\n * > 🪦 **Note**: also has obsolete signatures.\n *\n * @overload\n * @param {string} reason\n * @param {MessageOptions | null | undefined} [options]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @param {Error | VFileMessage | string} causeOrReason\n * Reason for message, should use markdown.\n * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]\n * Configuration (optional).\n * @param {string | null | undefined} [origin]\n * Place in code where the message originates (example:\n * `'my-package:my-rule'` or `'my-rule'`).\n * @returns {VFileMessage}\n * Message.\n */\n message(causeOrReason, optionsOrParentOrPlace, origin) {\n const message = new VFileMessage(\n // @ts-expect-error: the overloads are fine.\n causeOrReason,\n optionsOrParentOrPlace,\n origin\n )\n\n if (this.path) {\n message.name = this.path + ':' + message.name\n message.file = this.path\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n }\n\n /**\n * Serialize the file.\n *\n * > **Note**: which encodings are supported depends on the engine.\n * > For info on Node.js, see:\n * > .\n *\n * @param {string | null | undefined} [encoding='utf8']\n * Character encoding to understand `value` as when it’s a `Uint8Array`\n * (default: `'utf-8'`).\n * @returns {string}\n * Serialized file.\n */\n toString(encoding) {\n if (this.value === undefined) {\n return ''\n }\n\n if (typeof this.value === 'string') {\n return this.value\n }\n\n const decoder = new TextDecoder(encoding || undefined)\n return decoder.decode(this.value)\n }\n}\n\n/**\n * Assert that `part` is not a path (as in, does not contain `path.sep`).\n *\n * @param {string | null | undefined} part\n * File path part.\n * @param {string} name\n * Part name.\n * @returns {undefined}\n * Nothing.\n */\nfunction assertPart(part, name) {\n if (part && part.includes(path.sep)) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + path.sep + '`'\n )\n }\n}\n\n/**\n * Assert that `part` is not empty.\n *\n * @param {string | undefined} part\n * Thing.\n * @param {string} name\n * Part name.\n * @returns {asserts part is string}\n * Nothing.\n */\nfunction assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}\n\n/**\n * Assert `path` exists.\n *\n * @param {string | undefined} path\n * Path.\n * @param {string} name\n * Dependency name.\n * @returns {asserts path is string}\n * Nothing.\n */\nfunction assertPath(path, name) {\n if (!path) {\n throw new Error('Setting `' + name + '` requires `path` to be set too')\n }\n}\n\n/**\n * Assert `value` is an `Uint8Array`.\n *\n * @param {unknown} value\n * thing.\n * @returns {value is Uint8Array}\n * Whether `value` is an `Uint8Array`.\n */\nfunction isUint8Array(value) {\n return Boolean(\n value &&\n typeof value === 'object' &&\n 'byteLength' in value &&\n 'byteOffset' in value\n )\n}\n","export const CallableInstance =\n /**\n * @type {new , Result>(property: string | symbol) => (...parameters: Parameters) => Result}\n */\n (\n /** @type {unknown} */\n (\n /**\n * @this {Function}\n * @param {string | symbol} property\n * @returns {(...parameters: Array) => unknown}\n */\n function (property) {\n const self = this\n const constr = self.constructor\n const proto = /** @type {Record} */ (\n // Prototypes do exist.\n // type-coverage:ignore-next-line\n constr.prototype\n )\n const func = proto[property]\n /** @type {(...parameters: Array) => unknown} */\n const apply = function () {\n return func.apply(apply, arguments)\n }\n\n Object.setPrototypeOf(apply, proto)\n\n const names = Object.getOwnPropertyNames(func)\n\n for (const p of names) {\n const descriptor = Object.getOwnPropertyDescriptor(func, p)\n if (descriptor) Object.defineProperty(apply, p, descriptor)\n }\n\n return apply\n }\n )\n )\n","/**\n * @typedef {import('trough').Pipeline} Pipeline\n *\n * @typedef {import('unist').Node} Node\n *\n * @typedef {import('vfile').Compatible} Compatible\n * @typedef {import('vfile').Value} Value\n *\n * @typedef {import('../index.js').CompileResultMap} CompileResultMap\n * @typedef {import('../index.js').Data} Data\n * @typedef {import('../index.js').Settings} Settings\n */\n\n/**\n * @typedef {CompileResultMap[keyof CompileResultMap]} CompileResults\n * Acceptable results from compilers.\n *\n * To register custom results, add them to\n * {@link CompileResultMap `CompileResultMap`}.\n */\n\n/**\n * @template {Node} [Tree=Node]\n * The node that the compiler receives (default: `Node`).\n * @template {CompileResults} [Result=CompileResults]\n * The thing that the compiler yields (default: `CompileResults`).\n * @callback Compiler\n * A **compiler** handles the compiling of a syntax tree to something else\n * (in most cases, text) (TypeScript type).\n *\n * It is used in the stringify phase and called with a {@link Node `Node`}\n * and {@link VFile `VFile`} representation of the document to compile.\n * It should return the textual representation of the given tree (typically\n * `string`).\n *\n * > 👉 **Note**: unified typically compiles by serializing: most compilers\n * > return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@link CompileResultMap `CompileResultMap`}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n * @param {Tree} tree\n * Tree to compile.\n * @param {VFile} file\n * File associated with `tree`.\n * @returns {Result}\n * New content: compiled text (`string` or `Uint8Array`, for `file.value`) or\n * something else (for `file.result`).\n */\n\n/**\n * @template {Node} [Tree=Node]\n * The node that the parser yields (default: `Node`)\n * @callback Parser\n * A **parser** handles the parsing of text to a syntax tree.\n *\n * It is used in the parse phase and is called with a `string` and\n * {@link VFile `VFile`} of the document to parse.\n * It must return the syntax tree representation of the given file\n * ({@link Node `Node`}).\n * @param {string} document\n * Document to parse.\n * @param {VFile} file\n * File associated with `document`.\n * @returns {Tree}\n * Node representing the given file.\n */\n\n/**\n * @typedef {(\n * Plugin, any, any> |\n * PluginTuple, any, any> |\n * Preset\n * )} Pluggable\n * Union of the different ways to add plugins and settings.\n */\n\n/**\n * @typedef {Array} PluggableList\n * List of plugins and presets.\n */\n\n// Note: we can’t use `callback` yet as it messes up `this`:\n// .\n/**\n * @template {Array} [PluginParameters=[]]\n * Arguments passed to the plugin (default: `[]`, the empty tuple).\n * @template {Node | string | undefined} [Input=Node]\n * Value that is expected as input (default: `Node`).\n *\n * * If the plugin returns a {@link Transformer `Transformer`}, this\n * should be the node it expects.\n * * If the plugin sets a {@link Parser `Parser`}, this should be\n * `string`.\n * * If the plugin sets a {@link Compiler `Compiler`}, this should be the\n * node it expects.\n * @template [Output=Input]\n * Value that is yielded as output (default: `Input`).\n *\n * * If the plugin returns a {@link Transformer `Transformer`}, this\n * should be the node that that yields.\n * * If the plugin sets a {@link Parser `Parser`}, this should be the\n * node that it yields.\n * * If the plugin sets a {@link Compiler `Compiler`}, this should be\n * result it yields.\n * @typedef {(\n * (this: Processor, ...parameters: PluginParameters) =>\n * Input extends string ? // Parser.\n * Output extends Node | undefined ? undefined | void : never :\n * Output extends CompileResults ? // Compiler.\n * Input extends Node | undefined ? undefined | void : never :\n * Transformer<\n * Input extends Node ? Input : Node,\n * Output extends Node ? Output : Node\n * > | undefined | void\n * )} Plugin\n * Single plugin.\n *\n * Plugins configure the processors they are applied on in the following\n * ways:\n *\n * * they change the processor, such as the parser, the compiler, or by\n * configuring data\n * * they specify how to handle trees and files\n *\n * In practice, they are functions that can receive options and configure the\n * processor (`this`).\n *\n * > 👉 **Note**: plugins are called when the processor is *frozen*, not when\n * > they are applied.\n */\n\n/**\n * Tuple of a plugin and its configuration.\n *\n * The first item is a plugin, the rest are its parameters.\n *\n * @template {Array} [TupleParameters=[]]\n * Arguments passed to the plugin (default: `[]`, the empty tuple).\n * @template {Node | string | undefined} [Input=undefined]\n * Value that is expected as input (optional).\n *\n * * If the plugin returns a {@link Transformer `Transformer`}, this\n * should be the node it expects.\n * * If the plugin sets a {@link Parser `Parser`}, this should be\n * `string`.\n * * If the plugin sets a {@link Compiler `Compiler`}, this should be the\n * node it expects.\n * @template [Output=undefined] (optional).\n * Value that is yielded as output.\n *\n * * If the plugin returns a {@link Transformer `Transformer`}, this\n * should be the node that that yields.\n * * If the plugin sets a {@link Parser `Parser`}, this should be the\n * node that it yields.\n * * If the plugin sets a {@link Compiler `Compiler`}, this should be\n * result it yields.\n * @typedef {(\n * [\n * plugin: Plugin,\n * ...parameters: TupleParameters\n * ]\n * )} PluginTuple\n */\n\n/**\n * @typedef Preset\n * Sharable configuration.\n *\n * They can contain plugins and settings.\n * @property {PluggableList | undefined} [plugins]\n * List of plugins and presets (optional).\n * @property {Settings | undefined} [settings]\n * Shared settings for parsers and compilers (optional).\n */\n\n/**\n * @template {VFile} [File=VFile]\n * The file that the callback receives (default: `VFile`).\n * @callback ProcessCallback\n * Callback called when the process is done.\n *\n * Called with either an error or a result.\n * @param {Error | undefined} [error]\n * Fatal error (optional).\n * @param {File | undefined} [file]\n * Processed file (optional).\n * @returns {undefined}\n * Nothing.\n */\n\n/**\n * @template {Node} [Tree=Node]\n * The tree that the callback receives (default: `Node`).\n * @callback RunCallback\n * Callback called when transformers are done.\n *\n * Called with either an error or results.\n * @param {Error | undefined} [error]\n * Fatal error (optional).\n * @param {Tree | undefined} [tree]\n * Transformed tree (optional).\n * @param {VFile | undefined} [file]\n * File (optional).\n * @returns {undefined}\n * Nothing.\n */\n\n/**\n * @template {Node} [Output=Node]\n * Node type that the transformer yields (default: `Node`).\n * @callback TransformCallback\n * Callback passed to transforms.\n *\n * If the signature of a `transformer` accepts a third argument, the\n * transformer may perform asynchronous operations, and must call it.\n * @param {Error | undefined} [error]\n * Fatal error to stop the process (optional).\n * @param {Output | undefined} [tree]\n * New, changed, tree (optional).\n * @param {VFile | undefined} [file]\n * New, changed, file (optional).\n * @returns {undefined}\n * Nothing.\n */\n\n/**\n * @template {Node} [Input=Node]\n * Node type that the transformer expects (default: `Node`).\n * @template {Node} [Output=Input]\n * Node type that the transformer yields (default: `Input`).\n * @callback Transformer\n * Transformers handle syntax trees and files.\n *\n * They are functions that are called each time a syntax tree and file are\n * passed through the run phase.\n * When an error occurs in them (either because it’s thrown, returned,\n * rejected, or passed to `next`), the process stops.\n *\n * The run phase is handled by [`trough`][trough], see its documentation for\n * the exact semantics of these functions.\n *\n * > 👉 **Note**: you should likely ignore `next`: don’t accept it.\n * > it supports callback-style async work.\n * > But promises are likely easier to reason about.\n *\n * [trough]: https://github.com/wooorm/trough#function-fninput-next\n * @param {Input} tree\n * Tree to handle.\n * @param {VFile} file\n * File to handle.\n * @param {TransformCallback} next\n * Callback.\n * @returns {(\n * Promise |\n * Promise | // For some reason this is needed separately.\n * Output |\n * Error |\n * undefined |\n * void\n * )}\n * If you accept `next`, nothing.\n * Otherwise:\n *\n * * `Error` — fatal error to stop the process\n * * `Promise` or `undefined` — the next transformer keeps using\n * same tree\n * * `Promise` or `Node` — new, changed, tree\n */\n\n/**\n * @template {Node | undefined} ParseTree\n * Output of `parse`.\n * @template {Node | undefined} HeadTree\n * Input for `run`.\n * @template {Node | undefined} TailTree\n * Output for `run`.\n * @template {Node | undefined} CompileTree\n * Input of `stringify`.\n * @template {CompileResults | undefined} CompileResult\n * Output of `stringify`.\n * @template {Node | string | undefined} Input\n * Input of plugin.\n * @template Output\n * Output of plugin (optional).\n * @typedef {(\n * Input extends string\n * ? Output extends Node | undefined\n * ? // Parser.\n * Processor<\n * Output extends undefined ? ParseTree : Output,\n * HeadTree,\n * TailTree,\n * CompileTree,\n * CompileResult\n * >\n * : // Unknown.\n * Processor\n * : Output extends CompileResults\n * ? Input extends Node | undefined\n * ? // Compiler.\n * Processor<\n * ParseTree,\n * HeadTree,\n * TailTree,\n * Input extends undefined ? CompileTree : Input,\n * Output extends undefined ? CompileResult : Output\n * >\n * : // Unknown.\n * Processor\n * : Input extends Node | undefined\n * ? Output extends Node | undefined\n * ? // Transform.\n * Processor<\n * ParseTree,\n * HeadTree extends undefined ? Input : HeadTree,\n * Output extends undefined ? TailTree : Output,\n * CompileTree,\n * CompileResult\n * >\n * : // Unknown.\n * Processor\n * : // Unknown.\n * Processor\n * )} UsePlugin\n * Create a processor based on the input/output of a {@link Plugin plugin}.\n */\n\n/**\n * @template {CompileResults | undefined} Result\n * Node type that the transformer yields.\n * @typedef {(\n * Result extends Value | undefined ?\n * VFile :\n * VFile & {result: Result}\n * )} VFileWithOutput\n * Type to generate a {@link VFile `VFile`} corresponding to a compiler result.\n *\n * If a result that is not acceptable on a `VFile` is used, that will\n * be stored on the `result` field of {@link VFile `VFile`}.\n */\n\nimport {bail} from 'bail'\nimport extend from 'extend'\nimport {ok as assert} from 'devlop'\nimport isPlainObj from 'is-plain-obj'\nimport {trough} from 'trough'\nimport {VFile} from 'vfile'\nimport {CallableInstance} from './callable-instance.js'\n\n// To do: next major: drop `Compiler`, `Parser`: prefer lowercase.\n\n// To do: we could start yielding `never` in TS when a parser is missing and\n// `parse` is called.\n// Currently, we allow directly setting `processor.parser`, which is untyped.\n\nconst own = {}.hasOwnProperty\n\n/**\n * @template {Node | undefined} [ParseTree=undefined]\n * Output of `parse` (optional).\n * @template {Node | undefined} [HeadTree=undefined]\n * Input for `run` (optional).\n * @template {Node | undefined} [TailTree=undefined]\n * Output for `run` (optional).\n * @template {Node | undefined} [CompileTree=undefined]\n * Input of `stringify` (optional).\n * @template {CompileResults | undefined} [CompileResult=undefined]\n * Output of `stringify` (optional).\n * @extends {CallableInstance<[], Processor>}\n */\nexport class Processor extends CallableInstance {\n /**\n * Create a processor.\n */\n constructor() {\n // If `Processor()` is called (w/o new), `copy` is called instead.\n super('copy')\n\n /**\n * Compiler to use (deprecated).\n *\n * @deprecated\n * Use `compiler` instead.\n * @type {(\n * Compiler<\n * CompileTree extends undefined ? Node : CompileTree,\n * CompileResult extends undefined ? CompileResults : CompileResult\n * > |\n * undefined\n * )}\n */\n this.Compiler = undefined\n\n /**\n * Parser to use (deprecated).\n *\n * @deprecated\n * Use `parser` instead.\n * @type {(\n * Parser |\n * undefined\n * )}\n */\n this.Parser = undefined\n\n // Note: the following fields are considered private.\n // However, they are needed for tests, and TSC generates an untyped\n // `private freezeIndex` field for, which trips `type-coverage` up.\n // Instead, we use `@deprecated` to visualize that they shouldn’t be used.\n /**\n * Internal list of configured plugins.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {Array>>}\n */\n this.attachers = []\n\n /**\n * Compiler to use.\n *\n * @type {(\n * Compiler<\n * CompileTree extends undefined ? Node : CompileTree,\n * CompileResult extends undefined ? CompileResults : CompileResult\n * > |\n * undefined\n * )}\n */\n this.compiler = undefined\n\n /**\n * Internal state to track where we are while freezing.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {number}\n */\n this.freezeIndex = -1\n\n /**\n * Internal state to track whether we’re frozen.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {boolean | undefined}\n */\n this.frozen = undefined\n\n /**\n * Internal state.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {Data}\n */\n this.namespace = {}\n\n /**\n * Parser to use.\n *\n * @type {(\n * Parser |\n * undefined\n * )}\n */\n this.parser = undefined\n\n /**\n * Internal list of configured transformers.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {Pipeline}\n */\n this.transformers = trough()\n }\n\n /**\n * Copy a processor.\n *\n * @deprecated\n * This is a private internal method and should not be used.\n * @returns {Processor}\n * New *unfrozen* processor ({@link Processor `Processor`}) that is\n * configured to work the same as its ancestor.\n * When the descendant processor is configured in the future it does not\n * affect the ancestral processor.\n */\n copy() {\n // Cast as the type parameters will be the same after attaching.\n const destination =\n /** @type {Processor} */ (\n new Processor()\n )\n let index = -1\n\n while (++index < this.attachers.length) {\n const attacher = this.attachers[index]\n destination.use(...attacher)\n }\n\n destination.data(extend(true, {}, this.namespace))\n\n return destination\n }\n\n /**\n * Configure the processor with info available to all plugins.\n * Information is stored in an object.\n *\n * Typically, options can be given to a specific plugin, but sometimes it\n * makes sense to have information shared with several plugins.\n * For example, a list of HTML elements that are self-closing, which is\n * needed during all phases.\n *\n * > 👉 **Note**: setting information cannot occur on *frozen* processors.\n * > Call the processor first to create a new unfrozen processor.\n *\n * > 👉 **Note**: to register custom data in TypeScript, augment the\n * > {@link Data `Data`} interface.\n *\n * @example\n * This example show how to get and set info:\n *\n * ```js\n * import {unified} from 'unified'\n *\n * const processor = unified().data('alpha', 'bravo')\n *\n * processor.data('alpha') // => 'bravo'\n *\n * processor.data() // => {alpha: 'bravo'}\n *\n * processor.data({charlie: 'delta'})\n *\n * processor.data() // => {charlie: 'delta'}\n * ```\n *\n * @template {keyof Data} Key\n *\n * @overload\n * @returns {Data}\n *\n * @overload\n * @param {Data} dataset\n * @returns {Processor}\n *\n * @overload\n * @param {Key} key\n * @returns {Data[Key]}\n *\n * @overload\n * @param {Key} key\n * @param {Data[Key]} value\n * @returns {Processor}\n *\n * @param {Data | Key} [key]\n * Key to get or set, or entire dataset to set, or nothing to get the\n * entire dataset (optional).\n * @param {Data[Key]} [value]\n * Value to set (optional).\n * @returns {unknown}\n * The current processor when setting, the value at `key` when getting, or\n * the entire dataset when getting without key.\n */\n data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', this.frozen)\n this.namespace[key] = value\n return this\n }\n\n // Get `key`.\n return (own.call(this.namespace, key) && this.namespace[key]) || undefined\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', this.frozen)\n this.namespace = key\n return this\n }\n\n // Get space.\n return this.namespace\n }\n\n /**\n * Freeze a processor.\n *\n * Frozen processors are meant to be extended and not to be configured\n * directly.\n *\n * When a processor is frozen it cannot be unfrozen.\n * New processors working the same way can be created by calling the\n * processor.\n *\n * It’s possible to freeze processors explicitly by calling `.freeze()`.\n * Processors freeze automatically when `.parse()`, `.run()`, `.runSync()`,\n * `.stringify()`, `.process()`, or `.processSync()` are called.\n *\n * @returns {Processor}\n * The current processor.\n */\n freeze() {\n if (this.frozen) {\n return this\n }\n\n // Cast so that we can type plugins easier.\n // Plugins are supposed to be usable on different processors, not just on\n // this exact processor.\n const self = /** @type {Processor} */ (/** @type {unknown} */ (this))\n\n while (++this.freezeIndex < this.attachers.length) {\n const [attacher, ...options] = this.attachers[this.freezeIndex]\n\n if (options[0] === false) {\n continue\n }\n\n if (options[0] === true) {\n options[0] = undefined\n }\n\n const transformer = attacher.call(self, ...options)\n\n if (typeof transformer === 'function') {\n this.transformers.use(transformer)\n }\n }\n\n this.frozen = true\n this.freezeIndex = Number.POSITIVE_INFINITY\n\n return this\n }\n\n /**\n * Parse text to a syntax tree.\n *\n * > 👉 **Note**: `parse` freezes the processor if not already *frozen*.\n *\n * > 👉 **Note**: `parse` performs the parse phase, not the run phase or other\n * > phases.\n *\n * @param {Compatible | undefined} [file]\n * file to parse (optional); typically `string` or `VFile`; any value\n * accepted as `x` in `new VFile(x)`.\n * @returns {ParseTree extends undefined ? Node : ParseTree}\n * Syntax tree representing `file`.\n */\n parse(file) {\n this.freeze()\n const realFile = vfile(file)\n const parser = this.parser || this.Parser\n assertParser('parse', parser)\n return parser(String(realFile), realFile)\n }\n\n /**\n * Process the given file as configured on the processor.\n *\n * > 👉 **Note**: `process` freezes the processor if not already *frozen*.\n *\n * > 👉 **Note**: `process` performs the parse, run, and stringify phases.\n *\n * @overload\n * @param {Compatible | undefined} file\n * @param {ProcessCallback>} done\n * @returns {undefined}\n *\n * @overload\n * @param {Compatible | undefined} [file]\n * @returns {Promise>}\n *\n * @param {Compatible | undefined} [file]\n * File (optional); typically `string` or `VFile`]; any value accepted as\n * `x` in `new VFile(x)`.\n * @param {ProcessCallback> | undefined} [done]\n * Callback (optional).\n * @returns {Promise | undefined}\n * Nothing if `done` is given.\n * Otherwise a promise, rejected with a fatal error or resolved with the\n * processed file.\n *\n * The parsed, transformed, and compiled value is available at\n * `file.value` (see note).\n *\n * > 👉 **Note**: unified typically compiles by serializing: most\n * > compilers return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@link CompileResultMap `CompileResultMap`}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n */\n process(file, done) {\n const self = this\n\n this.freeze()\n assertParser('process', this.parser || this.Parser)\n assertCompiler('process', this.compiler || this.Compiler)\n\n return done ? executor(undefined, done) : new Promise(executor)\n\n // Note: `void`s needed for TS.\n /**\n * @param {((file: VFileWithOutput) => undefined | void) | undefined} resolve\n * @param {(error: Error | undefined) => undefined | void} reject\n * @returns {undefined}\n */\n function executor(resolve, reject) {\n const realFile = vfile(file)\n // Assume `ParseTree` (the result of the parser) matches `HeadTree` (the\n // input of the first transform).\n const parseTree =\n /** @type {HeadTree extends undefined ? Node : HeadTree} */ (\n /** @type {unknown} */ (self.parse(realFile))\n )\n\n self.run(parseTree, realFile, function (error, tree, file) {\n if (error || !tree || !file) {\n return realDone(error)\n }\n\n // Assume `TailTree` (the output of the last transform) matches\n // `CompileTree` (the input of the compiler).\n const compileTree =\n /** @type {CompileTree extends undefined ? Node : CompileTree} */ (\n /** @type {unknown} */ (tree)\n )\n\n const compileResult = self.stringify(compileTree, file)\n\n if (looksLikeAValue(compileResult)) {\n file.value = compileResult\n } else {\n file.result = compileResult\n }\n\n realDone(error, /** @type {VFileWithOutput} */ (file))\n })\n\n /**\n * @param {Error | undefined} error\n * @param {VFileWithOutput | undefined} [file]\n * @returns {undefined}\n */\n function realDone(error, file) {\n if (error || !file) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n assert(done, '`done` is defined if `resolve` is not')\n done(undefined, file)\n }\n }\n }\n }\n\n /**\n * Process the given file as configured on the processor.\n *\n * An error is thrown if asynchronous transforms are configured.\n *\n * > 👉 **Note**: `processSync` freezes the processor if not already *frozen*.\n *\n * > 👉 **Note**: `processSync` performs the parse, run, and stringify phases.\n *\n * @param {Compatible | undefined} [file]\n * File (optional); typically `string` or `VFile`; any value accepted as\n * `x` in `new VFile(x)`.\n * @returns {VFileWithOutput}\n * The processed file.\n *\n * The parsed, transformed, and compiled value is available at\n * `file.value` (see note).\n *\n * > 👉 **Note**: unified typically compiles by serializing: most\n * > compilers return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@link CompileResultMap `CompileResultMap`}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n */\n processSync(file) {\n /** @type {boolean} */\n let complete = false\n /** @type {VFileWithOutput | undefined} */\n let result\n\n this.freeze()\n assertParser('processSync', this.parser || this.Parser)\n assertCompiler('processSync', this.compiler || this.Compiler)\n\n this.process(file, realDone)\n assertDone('processSync', 'process', complete)\n assert(result, 'we either bailed on an error or have a tree')\n\n return result\n\n /**\n * @type {ProcessCallback>}\n */\n function realDone(error, file) {\n complete = true\n bail(error)\n result = file\n }\n }\n\n /**\n * Run *transformers* on a syntax tree.\n *\n * > 👉 **Note**: `run` freezes the processor if not already *frozen*.\n *\n * > 👉 **Note**: `run` performs the run phase, not other phases.\n *\n * @overload\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * @param {RunCallback} done\n * @returns {undefined}\n *\n * @overload\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * @param {Compatible | undefined} file\n * @param {RunCallback} done\n * @returns {undefined}\n *\n * @overload\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * @param {Compatible | undefined} [file]\n * @returns {Promise}\n *\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * Tree to transform and inspect.\n * @param {(\n * RunCallback |\n * Compatible\n * )} [file]\n * File associated with `node` (optional); any value accepted as `x` in\n * `new VFile(x)`.\n * @param {RunCallback} [done]\n * Callback (optional).\n * @returns {Promise | undefined}\n * Nothing if `done` is given.\n * Otherwise, a promise rejected with a fatal error or resolved with the\n * transformed tree.\n */\n run(tree, file, done) {\n assertNode(tree)\n this.freeze()\n\n const transformers = this.transformers\n\n if (!done && typeof file === 'function') {\n done = file\n file = undefined\n }\n\n return done ? executor(undefined, done) : new Promise(executor)\n\n // Note: `void`s needed for TS.\n /**\n * @param {(\n * ((tree: TailTree extends undefined ? Node : TailTree) => undefined | void) |\n * undefined\n * )} resolve\n * @param {(error: Error) => undefined | void} reject\n * @returns {undefined}\n */\n function executor(resolve, reject) {\n assert(\n typeof file !== 'function',\n '`file` can’t be a `done` anymore, we checked'\n )\n const realFile = vfile(file)\n transformers.run(tree, realFile, realDone)\n\n /**\n * @param {Error | undefined} error\n * @param {Node} outputTree\n * @param {VFile} file\n * @returns {undefined}\n */\n function realDone(error, outputTree, file) {\n const resultingTree =\n /** @type {TailTree extends undefined ? Node : TailTree} */ (\n outputTree || tree\n )\n\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(resultingTree)\n } else {\n assert(done, '`done` is defined if `resolve` is not')\n done(undefined, resultingTree, file)\n }\n }\n }\n }\n\n /**\n * Run *transformers* on a syntax tree.\n *\n * An error is thrown if asynchronous transforms are configured.\n *\n * > 👉 **Note**: `runSync` freezes the processor if not already *frozen*.\n *\n * > 👉 **Note**: `runSync` performs the run phase, not other phases.\n *\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * Tree to transform and inspect.\n * @param {Compatible | undefined} [file]\n * File associated with `node` (optional); any value accepted as `x` in\n * `new VFile(x)`.\n * @returns {TailTree extends undefined ? Node : TailTree}\n * Transformed tree.\n */\n runSync(tree, file) {\n /** @type {boolean} */\n let complete = false\n /** @type {(TailTree extends undefined ? Node : TailTree) | undefined} */\n let result\n\n this.run(tree, file, realDone)\n\n assertDone('runSync', 'run', complete)\n assert(result, 'we either bailed on an error or have a tree')\n return result\n\n /**\n * @type {RunCallback}\n */\n function realDone(error, tree) {\n bail(error)\n result = tree\n complete = true\n }\n }\n\n /**\n * Compile a syntax tree.\n *\n * > 👉 **Note**: `stringify` freezes the processor if not already *frozen*.\n *\n * > 👉 **Note**: `stringify` performs the stringify phase, not the run phase\n * > or other phases.\n *\n * @param {CompileTree extends undefined ? Node : CompileTree} tree\n * Tree to compile.\n * @param {Compatible | undefined} [file]\n * File associated with `node` (optional); any value accepted as `x` in\n * `new VFile(x)`.\n * @returns {CompileResult extends undefined ? Value : CompileResult}\n * Textual representation of the tree (see note).\n *\n * > 👉 **Note**: unified typically compiles by serializing: most compilers\n * > return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@link CompileResultMap `CompileResultMap`}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n */\n stringify(tree, file) {\n this.freeze()\n const realFile = vfile(file)\n const compiler = this.compiler || this.Compiler\n assertCompiler('stringify', compiler)\n assertNode(tree)\n\n return compiler(tree, realFile)\n }\n\n /**\n * Configure the processor to use a plugin, a list of usable values, or a\n * preset.\n *\n * If the processor is already using a plugin, the previous plugin\n * configuration is changed based on the options that are passed in.\n * In other words, the plugin is not added a second time.\n *\n * > 👉 **Note**: `use` cannot be called on *frozen* processors.\n * > Call the processor first to create a new unfrozen processor.\n *\n * @example\n * There are many ways to pass plugins to `.use()`.\n * This example gives an overview:\n *\n * ```js\n * import {unified} from 'unified'\n *\n * unified()\n * // Plugin with options:\n * .use(pluginA, {x: true, y: true})\n * // Passing the same plugin again merges configuration (to `{x: true, y: false, z: true}`):\n * .use(pluginA, {y: false, z: true})\n * // Plugins:\n * .use([pluginB, pluginC])\n * // Two plugins, the second with options:\n * .use([pluginD, [pluginE, {}]])\n * // Preset with plugins and settings:\n * .use({plugins: [pluginF, [pluginG, {}]], settings: {position: false}})\n * // Settings only:\n * .use({settings: {position: false}})\n * ```\n *\n * @template {Array} [Parameters=[]]\n * @template {Node | string | undefined} [Input=undefined]\n * @template [Output=Input]\n *\n * @overload\n * @param {Preset | null | undefined} [preset]\n * @returns {Processor}\n *\n * @overload\n * @param {PluggableList} list\n * @returns {Processor}\n *\n * @overload\n * @param {Plugin} plugin\n * @param {...(Parameters | [boolean])} parameters\n * @returns {UsePlugin}\n *\n * @param {PluggableList | Plugin | Preset | null | undefined} value\n * Usable value.\n * @param {...unknown} parameters\n * Parameters, when a plugin is given as a usable value.\n * @returns {Processor}\n * Current processor.\n */\n use(value, ...parameters) {\n const attachers = this.attachers\n const namespace = this.namespace\n\n assertUnfrozen('use', this.frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin(value, parameters)\n } else if (typeof value === 'object') {\n if (Array.isArray(value)) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new TypeError('Expected usable value, not `' + value + '`')\n }\n\n return this\n\n /**\n * @param {Pluggable} value\n * @returns {undefined}\n */\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value, [])\n } else if (typeof value === 'object') {\n if (Array.isArray(value)) {\n const [plugin, ...parameters] =\n /** @type {PluginTuple>} */ (value)\n addPlugin(plugin, parameters)\n } else {\n addPreset(value)\n }\n } else {\n throw new TypeError('Expected usable value, not `' + value + '`')\n }\n }\n\n /**\n * @param {Preset} result\n * @returns {undefined}\n */\n function addPreset(result) {\n if (!('plugins' in result) && !('settings' in result)) {\n throw new Error(\n 'Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither'\n )\n }\n\n addList(result.plugins)\n\n if (result.settings) {\n namespace.settings = extend(true, namespace.settings, result.settings)\n }\n }\n\n /**\n * @param {PluggableList | null | undefined} plugins\n * @returns {undefined}\n */\n function addList(plugins) {\n let index = -1\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (Array.isArray(plugins)) {\n while (++index < plugins.length) {\n const thing = plugins[index]\n add(thing)\n }\n } else {\n throw new TypeError('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n /**\n * @param {Plugin} plugin\n * @param {Array} parameters\n * @returns {undefined}\n */\n function addPlugin(plugin, parameters) {\n let index = -1\n let entryIndex = -1\n\n while (++index < attachers.length) {\n if (attachers[index][0] === plugin) {\n entryIndex = index\n break\n }\n }\n\n if (entryIndex === -1) {\n attachers.push([plugin, ...parameters])\n }\n // Only set if there was at least a `primary` value, otherwise we’d change\n // `arguments.length`.\n else if (parameters.length > 0) {\n let [primary, ...rest] = parameters\n const currentPrimary = attachers[entryIndex][1]\n if (isPlainObj(currentPrimary) && isPlainObj(primary)) {\n primary = extend(true, currentPrimary, primary)\n }\n\n attachers[entryIndex] = [plugin, primary, ...rest]\n }\n }\n }\n}\n\n// Note: this returns a *callable* instance.\n// That’s why it’s documented as a function.\n/**\n * Create a new processor.\n *\n * @example\n * This example shows how a new processor can be created (from `remark`) and linked\n * to **stdin**(4) and **stdout**(4).\n *\n * ```js\n * import process from 'node:process'\n * import concatStream from 'concat-stream'\n * import {remark} from 'remark'\n *\n * process.stdin.pipe(\n * concatStream(function (buf) {\n * process.stdout.write(String(remark().processSync(buf)))\n * })\n * )\n * ```\n *\n * @returns\n * New *unfrozen* processor (`processor`).\n *\n * This processor is configured to work the same as its ancestor.\n * When the descendant processor is configured in the future it does not\n * affect the ancestral processor.\n */\nexport const unified = new Processor().freeze()\n\n/**\n * Assert a parser is available.\n *\n * @param {string} name\n * @param {unknown} value\n * @returns {asserts value is Parser}\n */\nfunction assertParser(name, value) {\n if (typeof value !== 'function') {\n throw new TypeError('Cannot `' + name + '` without `parser`')\n }\n}\n\n/**\n * Assert a compiler is available.\n *\n * @param {string} name\n * @param {unknown} value\n * @returns {asserts value is Compiler}\n */\nfunction assertCompiler(name, value) {\n if (typeof value !== 'function') {\n throw new TypeError('Cannot `' + name + '` without `compiler`')\n }\n}\n\n/**\n * Assert the processor is not frozen.\n *\n * @param {string} name\n * @param {unknown} frozen\n * @returns {asserts frozen is false}\n */\nfunction assertUnfrozen(name, frozen) {\n if (frozen) {\n throw new Error(\n 'Cannot call `' +\n name +\n '` on a frozen processor.\\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.'\n )\n }\n}\n\n/**\n * Assert `node` is a unist node.\n *\n * @param {unknown} node\n * @returns {asserts node is Node}\n */\nfunction assertNode(node) {\n // `isPlainObj` unfortunately uses `any` instead of `unknown`.\n // type-coverage:ignore-next-line\n if (!isPlainObj(node) || typeof node.type !== 'string') {\n throw new TypeError('Expected node, got `' + node + '`')\n // Fine.\n }\n}\n\n/**\n * Assert that `complete` is `true`.\n *\n * @param {string} name\n * @param {string} asyncName\n * @param {unknown} complete\n * @returns {asserts complete is true}\n */\nfunction assertDone(name, asyncName, complete) {\n if (!complete) {\n throw new Error(\n '`' + name + '` finished async. Use `' + asyncName + '` instead'\n )\n }\n}\n\n/**\n * @param {Compatible | undefined} [value]\n * @returns {VFile}\n */\nfunction vfile(value) {\n return looksLikeAVFile(value) ? value : new VFile(value)\n}\n\n/**\n * @param {Compatible | undefined} [value]\n * @returns {value is VFile}\n */\nfunction looksLikeAVFile(value) {\n return Boolean(\n value &&\n typeof value === 'object' &&\n 'message' in value &&\n 'messages' in value\n )\n}\n\n/**\n * @param {unknown} [value]\n * @returns {value is Value}\n */\nfunction looksLikeAValue(value) {\n return typeof value === 'string' || isUint8Array(value)\n}\n\n/**\n * Assert `value` is an `Uint8Array`.\n *\n * @param {unknown} value\n * thing.\n * @returns {value is Uint8Array}\n * Whether `value` is an `Uint8Array`.\n */\nfunction isUint8Array(value) {\n return Boolean(\n value &&\n typeof value === 'object' &&\n 'byteLength' in value &&\n 'byteOffset' in value\n )\n}\n","// Register `Raw` in tree:\n/// \n\n/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementContent} ElementContent\n * @typedef {import('hast').Nodes} Nodes\n * @typedef {import('hast').Parents} Parents\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast-util-to-jsx-runtime').Components} JsxRuntimeComponents\n * @typedef {import('remark-rehype').Options} RemarkRehypeOptions\n * @typedef {import('unist-util-visit').BuildVisitor} Visitor\n * @typedef {import('unified').PluggableList} PluggableList\n */\n\n/**\n * @callback AllowElement\n * Filter elements.\n * @param {Readonly} element\n * Element to check.\n * @param {number} index\n * Index of `element` in `parent`.\n * @param {Readonly | undefined} parent\n * Parent of `element`.\n * @returns {boolean | null | undefined}\n * Whether to allow `element` (default: `false`).\n *\n * @typedef {Partial} Components\n * Map tag names to components.\n *\n * @typedef Deprecation\n * Deprecation.\n * @property {string} from\n * Old field.\n * @property {string} id\n * ID in readme.\n * @property {keyof Options} [to]\n * New field.\n *\n * @typedef Options\n * Configuration.\n * @property {AllowElement | null | undefined} [allowElement]\n * Filter elements (optional);\n * `allowedElements` / `disallowedElements` is used first.\n * @property {ReadonlyArray | null | undefined} [allowedElements]\n * Tag names to allow (default: all tag names);\n * cannot combine w/ `disallowedElements`.\n * @property {string | null | undefined} [children]\n * Markdown.\n * @property {string | null | undefined} [className]\n * Wrap in a `div` with this class name.\n * @property {Components | null | undefined} [components]\n * Map tag names to components.\n * @property {ReadonlyArray | null | undefined} [disallowedElements]\n * Tag names to disallow (default: `[]`);\n * cannot combine w/ `allowedElements`.\n * @property {PluggableList | null | undefined} [rehypePlugins]\n * List of rehype plugins to use.\n * @property {PluggableList | null | undefined} [remarkPlugins]\n * List of remark plugins to use.\n * @property {Readonly | null | undefined} [remarkRehypeOptions]\n * Options to pass through to `remark-rehype`.\n * @property {boolean | null | undefined} [skipHtml=false]\n * Ignore HTML in markdown completely (default: `false`).\n * @property {boolean | null | undefined} [unwrapDisallowed=false]\n * Extract (unwrap) what’s in disallowed elements (default: `false`);\n * normally when say `strong` is not allowed, it and it’s children are dropped,\n * with `unwrapDisallowed` the element itself is replaced by its children.\n * @property {UrlTransform | null | undefined} [urlTransform]\n * Change URLs (default: `defaultUrlTransform`)\n *\n * @callback UrlTransform\n * Transform all URLs.\n * @param {string} url\n * URL.\n * @param {string} key\n * Property name (example: `'href'`).\n * @param {Readonly} node\n * Node.\n * @returns {string | null | undefined}\n * Transformed URL (optional).\n */\n\nimport {unreachable} from 'devlop'\nimport {toJsxRuntime} from 'hast-util-to-jsx-runtime'\nimport {urlAttributes} from 'html-url-attributes'\n// @ts-expect-error: untyped.\nimport {Fragment, jsx, jsxs} from 'react/jsx-runtime'\nimport remarkParse from 'remark-parse'\nimport remarkRehype from 'remark-rehype'\nimport {unified} from 'unified'\nimport {visit} from 'unist-util-visit'\nimport {VFile} from 'vfile'\n\nconst changelog =\n 'https://github.com/remarkjs/react-markdown/blob/main/changelog.md'\n\n/** @type {PluggableList} */\nconst emptyPlugins = []\n/** @type {Readonly} */\nconst emptyRemarkRehypeOptions = {allowDangerousHtml: true}\nconst safeProtocol = /^(https?|ircs?|mailto|xmpp)$/i\n\n// Mutable because we `delete` any time it’s used and a message is sent.\n/** @type {ReadonlyArray>} */\nconst deprecations = [\n {from: 'astPlugins', id: 'remove-buggy-html-in-markdown-parser'},\n {from: 'allowDangerousHtml', id: 'remove-buggy-html-in-markdown-parser'},\n {\n from: 'allowNode',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes',\n to: 'allowElement'\n },\n {\n from: 'allowedTypes',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes',\n to: 'allowedElements'\n },\n {\n from: 'disallowedTypes',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes',\n to: 'disallowedElements'\n },\n {from: 'escapeHtml', id: 'remove-buggy-html-in-markdown-parser'},\n {from: 'includeElementIndex', id: '#remove-includeelementindex'},\n {\n from: 'includeNodeIndex',\n id: 'change-includenodeindex-to-includeelementindex'\n },\n {from: 'linkTarget', id: 'remove-linktarget'},\n {from: 'plugins', id: 'change-plugins-to-remarkplugins', to: 'remarkPlugins'},\n {from: 'rawSourcePos', id: '#remove-rawsourcepos'},\n {from: 'renderers', id: 'change-renderers-to-components', to: 'components'},\n {from: 'source', id: 'change-source-to-children', to: 'children'},\n {from: 'sourcePos', id: '#remove-sourcepos'},\n {from: 'transformImageUri', id: '#add-urltransform', to: 'urlTransform'},\n {from: 'transformLinkUri', id: '#add-urltransform', to: 'urlTransform'}\n]\n\n/**\n * Component to render markdown.\n *\n * @param {Readonly} options\n * Props.\n * @returns {JSX.Element}\n * React element.\n */\nexport function Markdown(options) {\n const allowedElements = options.allowedElements\n const allowElement = options.allowElement\n const children = options.children || ''\n const className = options.className\n const components = options.components\n const disallowedElements = options.disallowedElements\n const rehypePlugins = options.rehypePlugins || emptyPlugins\n const remarkPlugins = options.remarkPlugins || emptyPlugins\n const remarkRehypeOptions = options.remarkRehypeOptions\n ? {...options.remarkRehypeOptions, ...emptyRemarkRehypeOptions}\n : emptyRemarkRehypeOptions\n const skipHtml = options.skipHtml\n const unwrapDisallowed = options.unwrapDisallowed\n const urlTransform = options.urlTransform || defaultUrlTransform\n\n const processor = unified()\n .use(remarkParse)\n .use(remarkPlugins)\n .use(remarkRehype, remarkRehypeOptions)\n .use(rehypePlugins)\n\n const file = new VFile()\n\n if (typeof children === 'string') {\n file.value = children\n } else {\n unreachable(\n 'Unexpected value `' +\n children +\n '` for `children` prop, expected `string`'\n )\n }\n\n if (allowedElements && disallowedElements) {\n unreachable(\n 'Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other'\n )\n }\n\n for (const deprecation of deprecations) {\n if (Object.hasOwn(options, deprecation.from)) {\n unreachable(\n 'Unexpected `' +\n deprecation.from +\n '` prop, ' +\n (deprecation.to\n ? 'use `' + deprecation.to + '` instead'\n : 'remove it') +\n ' (see <' +\n changelog +\n '#' +\n deprecation.id +\n '> for more info)'\n )\n }\n }\n\n const mdastTree = processor.parse(file)\n /** @type {Nodes} */\n let hastTree = processor.runSync(mdastTree, file)\n\n // Wrap in `div` if there’s a class name.\n if (className) {\n hastTree = {\n type: 'element',\n tagName: 'div',\n properties: {className},\n // Assume no doctypes.\n children: /** @type {Array} */ (\n hastTree.type === 'root' ? hastTree.children : [hastTree]\n )\n }\n }\n\n visit(hastTree, transform)\n\n return toJsxRuntime(hastTree, {\n Fragment,\n components,\n ignoreInvalidStyle: true,\n jsx,\n jsxs,\n passKeys: true,\n passNode: true\n })\n\n /** @type {Visitor} */\n function transform(node, index, parent) {\n if (node.type === 'raw' && parent && typeof index === 'number') {\n if (skipHtml) {\n parent.children.splice(index, 1)\n } else {\n parent.children[index] = {type: 'text', value: node.value}\n }\n\n return index\n }\n\n if (node.type === 'element') {\n /** @type {string} */\n let key\n\n for (key in urlAttributes) {\n if (\n Object.hasOwn(urlAttributes, key) &&\n Object.hasOwn(node.properties, key)\n ) {\n const value = node.properties[key]\n const test = urlAttributes[key]\n if (test === null || test.includes(node.tagName)) {\n node.properties[key] = urlTransform(String(value || ''), key, node)\n }\n }\n }\n }\n\n if (node.type === 'element') {\n let remove = allowedElements\n ? !allowedElements.includes(node.tagName)\n : disallowedElements\n ? disallowedElements.includes(node.tagName)\n : false\n\n if (!remove && allowElement && typeof index === 'number') {\n remove = !allowElement(node, index, parent)\n }\n\n if (remove && parent && typeof index === 'number') {\n if (unwrapDisallowed && node.children) {\n parent.children.splice(index, 1, ...node.children)\n } else {\n parent.children.splice(index, 1)\n }\n\n return index\n }\n }\n }\n}\n\n/**\n * Make a URL safe.\n *\n * @satisfies {UrlTransform}\n * @param {string} value\n * URL.\n * @returns {string}\n * Safe URL.\n */\nexport function defaultUrlTransform(value) {\n // Same as:\n // \n // But without the `encode` part.\n const colon = value.indexOf(':')\n const questionMark = value.indexOf('?')\n const numberSign = value.indexOf('#')\n const slash = value.indexOf('/')\n\n if (\n // If there is no protocol, it’s relative.\n colon < 0 ||\n // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n (slash > -1 && colon > slash) ||\n (questionMark > -1 && colon > questionMark) ||\n (numberSign > -1 && colon > numberSign) ||\n // It is a protocol, it should be allowed.\n safeProtocol.test(value.slice(0, colon))\n ) {\n return value\n }\n\n return ''\n}\n","/**\n * Count how often a character (or substring) is used in a string.\n *\n * @param {string} value\n * Value to search in.\n * @param {string} character\n * Character (or substring) to look for.\n * @return {number}\n * Number of times `character` occurred in `value`.\n */\nexport function ccount(value, character) {\n const source = String(value)\n\n if (typeof character !== 'string') {\n throw new TypeError('Expected character')\n }\n\n let count = 0\n let index = source.indexOf(character)\n\n while (index !== -1) {\n count++\n index = source.indexOf(character, index + character.length)\n }\n\n return count\n}\n","/**\n * @typedef {import('mdast').Nodes} Nodes\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast').Text} Text\n * @typedef {import('unist-util-visit-parents').Test} Test\n * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult\n */\n\n/**\n * @typedef RegExpMatchObject\n * Info on the match.\n * @property {number} index\n * The index of the search at which the result was found.\n * @property {string} input\n * A copy of the search string in the text node.\n * @property {[...Array, Text]} stack\n * All ancestors of the text node, where the last node is the text itself.\n *\n * @typedef {RegExp | string} Find\n * Pattern to find.\n *\n * Strings are escaped and then turned into global expressions.\n *\n * @typedef {Array} FindAndReplaceList\n * Several find and replaces, in array form.\n *\n * @typedef {[Find, Replace?]} FindAndReplaceTuple\n * Find and replace in tuple form.\n *\n * @typedef {ReplaceFunction | string | null | undefined} Replace\n * Thing to replace with.\n *\n * @callback ReplaceFunction\n * Callback called when a search matches.\n * @param {...any} parameters\n * The parameters are the result of corresponding search expression:\n *\n * * `value` (`string`) — whole match\n * * `...capture` (`Array`) — matches from regex capture groups\n * * `match` (`RegExpMatchObject`) — info on the match\n * @returns {Array | PhrasingContent | string | false | null | undefined}\n * Thing to replace with.\n *\n * * when `null`, `undefined`, `''`, remove the match\n * * …or when `false`, do not replace at all\n * * …or when `string`, replace with a text node of that value\n * * …or when `Node` or `Array`, replace with those nodes\n *\n * @typedef {[RegExp, ReplaceFunction]} Pair\n * Normalized find and replace.\n *\n * @typedef {Array} Pairs\n * All find and replaced.\n *\n * @typedef Options\n * Configuration.\n * @property {Test | null | undefined} [ignore]\n * Test for which nodes to ignore (optional).\n */\n\nimport escape from 'escape-string-regexp'\nimport {visitParents} from 'unist-util-visit-parents'\nimport {convert} from 'unist-util-is'\n\n/**\n * Find patterns in a tree and replace them.\n *\n * The algorithm searches the tree in *preorder* for complete values in `Text`\n * nodes.\n * Partial matches are not supported.\n *\n * @param {Nodes} tree\n * Tree to change.\n * @param {FindAndReplaceList | FindAndReplaceTuple} list\n * Patterns to find.\n * @param {Options | null | undefined} [options]\n * Configuration (when `find` is not `Find`).\n * @returns {undefined}\n * Nothing.\n */\nexport function findAndReplace(tree, list, options) {\n const settings = options || {}\n const ignored = convert(settings.ignore || [])\n const pairs = toPairs(list)\n let pairIndex = -1\n\n while (++pairIndex < pairs.length) {\n visitParents(tree, 'text', visitor)\n }\n\n /** @type {import('unist-util-visit-parents').BuildVisitor} */\n function visitor(node, parents) {\n let index = -1\n /** @type {Parents | undefined} */\n let grandparent\n\n while (++index < parents.length) {\n const parent = parents[index]\n /** @type {Array | undefined} */\n const siblings = grandparent ? grandparent.children : undefined\n\n if (\n ignored(\n parent,\n siblings ? siblings.indexOf(parent) : undefined,\n grandparent\n )\n ) {\n return\n }\n\n grandparent = parent\n }\n\n if (grandparent) {\n return handler(node, parents)\n }\n }\n\n /**\n * Handle a text node which is not in an ignored parent.\n *\n * @param {Text} node\n * Text node.\n * @param {Array} parents\n * Parents.\n * @returns {VisitorResult}\n * Result.\n */\n function handler(node, parents) {\n const parent = parents[parents.length - 1]\n const find = pairs[pairIndex][0]\n const replace = pairs[pairIndex][1]\n let start = 0\n /** @type {Array} */\n const siblings = parent.children\n const index = siblings.indexOf(node)\n let change = false\n /** @type {Array} */\n let nodes = []\n\n find.lastIndex = 0\n\n let match = find.exec(node.value)\n\n while (match) {\n const position = match.index\n /** @type {RegExpMatchObject} */\n const matchObject = {\n index: match.index,\n input: match.input,\n stack: [...parents, node]\n }\n let value = replace(...match, matchObject)\n\n if (typeof value === 'string') {\n value = value.length > 0 ? {type: 'text', value} : undefined\n }\n\n // It wasn’t a match after all.\n if (value === false) {\n // False acts as if there was no match.\n // So we need to reset `lastIndex`, which currently being at the end of\n // the current match, to the beginning.\n find.lastIndex = position + 1\n } else {\n if (start !== position) {\n nodes.push({\n type: 'text',\n value: node.value.slice(start, position)\n })\n }\n\n if (Array.isArray(value)) {\n nodes.push(...value)\n } else if (value) {\n nodes.push(value)\n }\n\n start = position + match[0].length\n change = true\n }\n\n if (!find.global) {\n break\n }\n\n match = find.exec(node.value)\n }\n\n if (change) {\n if (start < node.value.length) {\n nodes.push({type: 'text', value: node.value.slice(start)})\n }\n\n parent.children.splice(index, 1, ...nodes)\n } else {\n nodes = [node]\n }\n\n return index + nodes.length\n }\n}\n\n/**\n * Turn a tuple or a list of tuples into pairs.\n *\n * @param {FindAndReplaceList | FindAndReplaceTuple} tupleOrList\n * Schema.\n * @returns {Pairs}\n * Clean pairs.\n */\nfunction toPairs(tupleOrList) {\n /** @type {Pairs} */\n const result = []\n\n if (!Array.isArray(tupleOrList)) {\n throw new TypeError('Expected find and replace tuple or list of tuples')\n }\n\n /** @type {FindAndReplaceList} */\n // @ts-expect-error: correct.\n const list =\n !tupleOrList[0] || Array.isArray(tupleOrList[0])\n ? tupleOrList\n : [tupleOrList]\n\n let index = -1\n\n while (++index < list.length) {\n const tuple = list[index]\n result.push([toExpression(tuple[0]), toFunction(tuple[1])])\n }\n\n return result\n}\n\n/**\n * Turn a find into an expression.\n *\n * @param {Find} find\n * Find.\n * @returns {RegExp}\n * Expression.\n */\nfunction toExpression(find) {\n return typeof find === 'string' ? new RegExp(escape(find), 'g') : find\n}\n\n/**\n * Turn a replace into a function.\n *\n * @param {Replace} replace\n * Replace.\n * @returns {ReplaceFunction}\n * Function.\n */\nfunction toFunction(replace) {\n return typeof replace === 'function'\n ? replace\n : function () {\n return replace\n }\n}\n","export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","/**\n * @typedef {import('mdast').Link} Link\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-from-markdown').Transform} FromMarkdownTransform\n *\n * @typedef {import('mdast-util-to-markdown').ConstructName} ConstructName\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n *\n * @typedef {import('mdast-util-find-and-replace').RegExpMatchObject} RegExpMatchObject\n * @typedef {import('mdast-util-find-and-replace').ReplaceFunction} ReplaceFunction\n */\n\nimport {ccount} from 'ccount'\nimport {ok as assert} from 'devlop'\nimport {unicodePunctuation, unicodeWhitespace} from 'micromark-util-character'\nimport {findAndReplace} from 'mdast-util-find-and-replace'\n\n/** @type {ConstructName} */\nconst inConstruct = 'phrasing'\n/** @type {Array} */\nconst notInConstruct = ['autolink', 'link', 'image', 'label']\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM autolink\n * literals in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n */\nexport function gfmAutolinkLiteralFromMarkdown() {\n return {\n transforms: [transformGfmAutolinkLiterals],\n enter: {\n literalAutolink: enterLiteralAutolink,\n literalAutolinkEmail: enterLiteralAutolinkValue,\n literalAutolinkHttp: enterLiteralAutolinkValue,\n literalAutolinkWww: enterLiteralAutolinkValue\n },\n exit: {\n literalAutolink: exitLiteralAutolink,\n literalAutolinkEmail: exitLiteralAutolinkEmail,\n literalAutolinkHttp: exitLiteralAutolinkHttp,\n literalAutolinkWww: exitLiteralAutolinkWww\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM autolink\n * literals in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n */\nexport function gfmAutolinkLiteralToMarkdown() {\n return {\n unsafe: [\n {\n character: '@',\n before: '[+\\\\-.\\\\w]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: '.',\n before: '[Ww]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: ':',\n before: '[ps]',\n after: '\\\\/',\n inConstruct,\n notInConstruct\n }\n ]\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolink(token) {\n this.enter({type: 'link', title: null, url: '', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolinkValue(token) {\n this.config.enter.autolinkProtocol.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkHttp(token) {\n this.config.exit.autolinkProtocol.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkWww(token) {\n this.config.exit.data.call(this, token)\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'link')\n node.url = 'http://' + this.sliceSerialize(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkEmail(token) {\n this.config.exit.autolinkEmail.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolink(token) {\n this.exit(token)\n}\n\n/** @type {FromMarkdownTransform} */\nfunction transformGfmAutolinkLiterals(tree) {\n findAndReplace(\n tree,\n [\n [/(https?:\\/\\/|www(?=\\.))([-.\\w]+)([^ \\t\\r\\n]*)/gi, findUrl],\n [/([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)/g, findEmail]\n ],\n {ignore: ['link', 'linkReference']}\n )\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} protocol\n * @param {string} domain\n * @param {string} path\n * @param {RegExpMatchObject} match\n * @returns {Array | Link | false}\n */\n// eslint-disable-next-line max-params\nfunction findUrl(_, protocol, domain, path, match) {\n let prefix = ''\n\n // Not an expected previous character.\n if (!previous(match)) {\n return false\n }\n\n // Treat `www` as part of the domain.\n if (/^w/i.test(protocol)) {\n domain = protocol + domain\n protocol = ''\n prefix = 'http://'\n }\n\n if (!isCorrectDomain(domain)) {\n return false\n }\n\n const parts = splitUrl(domain + path)\n\n if (!parts[0]) return false\n\n /** @type {Link} */\n const result = {\n type: 'link',\n title: null,\n url: prefix + protocol + parts[0],\n children: [{type: 'text', value: protocol + parts[0]}]\n }\n\n if (parts[1]) {\n return [result, {type: 'text', value: parts[1]}]\n }\n\n return result\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} atext\n * @param {string} label\n * @param {RegExpMatchObject} match\n * @returns {Link | false}\n */\nfunction findEmail(_, atext, label, match) {\n if (\n // Not an expected previous character.\n !previous(match, true) ||\n // Label ends in not allowed character.\n /[-\\d_]$/.test(label)\n ) {\n return false\n }\n\n return {\n type: 'link',\n title: null,\n url: 'mailto:' + atext + '@' + label,\n children: [{type: 'text', value: atext + '@' + label}]\n }\n}\n\n/**\n * @param {string} domain\n * @returns {boolean}\n */\nfunction isCorrectDomain(domain) {\n const parts = domain.split('.')\n\n if (\n parts.length < 2 ||\n (parts[parts.length - 1] &&\n (/_/.test(parts[parts.length - 1]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 1]))) ||\n (parts[parts.length - 2] &&\n (/_/.test(parts[parts.length - 2]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 2])))\n ) {\n return false\n }\n\n return true\n}\n\n/**\n * @param {string} url\n * @returns {[string, string | undefined]}\n */\nfunction splitUrl(url) {\n const trailExec = /[!\"&'),.:;<>?\\]}]+$/.exec(url)\n\n if (!trailExec) {\n return [url, undefined]\n }\n\n url = url.slice(0, trailExec.index)\n\n let trail = trailExec[0]\n let closingParenIndex = trail.indexOf(')')\n const openingParens = ccount(url, '(')\n let closingParens = ccount(url, ')')\n\n while (closingParenIndex !== -1 && openingParens > closingParens) {\n url += trail.slice(0, closingParenIndex + 1)\n trail = trail.slice(closingParenIndex + 1)\n closingParenIndex = trail.indexOf(')')\n closingParens++\n }\n\n return [url, trail]\n}\n\n/**\n * @param {RegExpMatchObject} match\n * @param {boolean | null | undefined} [email=false]\n * @returns {boolean}\n */\nfunction previous(match, email) {\n const code = match.input.charCodeAt(match.index - 1)\n\n return (\n (match.index === 0 ||\n unicodeWhitespace(code) ||\n unicodePunctuation(code)) &&\n (!email || code !== 47)\n )\n}\n","/**\n * @typedef {import('mdast').FootnoteDefinition} FootnoteDefinition\n * @typedef {import('mdast').FootnoteReference} FootnoteReference\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Map} Map\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n */\n\nimport {ok as assert} from 'devlop'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\n\nfootnoteReference.peek = footnoteReferencePeek\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown`.\n */\nexport function gfmFootnoteFromMarkdown() {\n return {\n enter: {\n gfmFootnoteDefinition: enterFootnoteDefinition,\n gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,\n gfmFootnoteCall: enterFootnoteCall,\n gfmFootnoteCallString: enterFootnoteCallString\n },\n exit: {\n gfmFootnoteDefinition: exitFootnoteDefinition,\n gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,\n gfmFootnoteCall: exitFootnoteCall,\n gfmFootnoteCallString: exitFootnoteCallString\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown`.\n */\nexport function gfmFootnoteToMarkdown() {\n return {\n // This is on by default already.\n unsafe: [{character: '[', inConstruct: ['phrasing', 'label', 'reference']}],\n handlers: {footnoteDefinition, footnoteReference}\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinition(token) {\n this.enter(\n {type: 'footnoteDefinition', identifier: '', label: '', children: []},\n token\n )\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinitionLabelString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinitionLabelString(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'footnoteDefinition')\n node.label = label\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinition(token) {\n this.exit(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCall(token) {\n this.enter({type: 'footnoteReference', identifier: '', label: ''}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCallString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCallString(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'footnoteReference')\n node.label = label\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCall(token) {\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {FootnoteReference} node\n */\nfunction footnoteReference(node, _, state, info) {\n const tracker = state.createTracker(info)\n let value = tracker.move('[^')\n const exit = state.enter('footnoteReference')\n const subexit = state.enter('reference')\n value += tracker.move(\n state.safe(state.associationId(node), {\n ...tracker.current(),\n before: value,\n after: ']'\n })\n )\n subexit()\n exit()\n value += tracker.move(']')\n return value\n}\n\n/** @type {ToMarkdownHandle} */\nfunction footnoteReferencePeek() {\n return '['\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {FootnoteDefinition} node\n */\nfunction footnoteDefinition(node, _, state, info) {\n const tracker = state.createTracker(info)\n let value = tracker.move('[^')\n const exit = state.enter('footnoteDefinition')\n const subexit = state.enter('label')\n value += tracker.move(\n state.safe(state.associationId(node), {\n ...tracker.current(),\n before: value,\n after: ']'\n })\n )\n subexit()\n value += tracker.move(\n ']:' + (node.children && node.children.length > 0 ? ' ' : '')\n )\n tracker.shift(4)\n value += tracker.move(\n state.indentLines(state.containerFlow(node, tracker.current()), map)\n )\n exit()\n\n return value\n}\n\n/** @type {Map} */\nfunction map(line, index, blank) {\n if (index === 0) {\n return line\n }\n\n return (blank ? '' : ' ') + line\n}\n","/**\n * @typedef {import('mdast').Delete} Delete\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n *\n * @typedef {import('mdast-util-to-markdown').ConstructName} ConstructName\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n */\n\n/**\n * List of constructs that occur in phrasing (paragraphs, headings), but cannot\n * contain strikethrough.\n * So they sort of cancel each other out.\n * Note: could use a better name.\n *\n * Note: keep in sync with: \n *\n * @type {Array}\n */\nconst constructsWithoutStrikethrough = [\n 'autolink',\n 'destinationLiteral',\n 'destinationRaw',\n 'reference',\n 'titleQuote',\n 'titleApostrophe'\n]\n\nhandleDelete.peek = peekDelete\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM\n * strikethrough in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM strikethrough.\n */\nexport function gfmStrikethroughFromMarkdown() {\n return {\n canContainEols: ['delete'],\n enter: {strikethrough: enterStrikethrough},\n exit: {strikethrough: exitStrikethrough}\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM\n * strikethrough in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM strikethrough.\n */\nexport function gfmStrikethroughToMarkdown() {\n return {\n unsafe: [\n {\n character: '~',\n inConstruct: 'phrasing',\n notInConstruct: constructsWithoutStrikethrough\n }\n ],\n handlers: {delete: handleDelete}\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterStrikethrough(token) {\n this.enter({type: 'delete', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitStrikethrough(token) {\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {Delete} node\n */\nfunction handleDelete(node, _, state, info) {\n const tracker = state.createTracker(info)\n const exit = state.enter('strikethrough')\n let value = tracker.move('~~')\n value += state.containerPhrasing(node, {\n ...tracker.current(),\n before: value,\n after: '~'\n })\n value += tracker.move('~~')\n exit()\n return value\n}\n\n/** @type {ToMarkdownHandle} */\nfunction peekDelete() {\n return '~'\n}\n","/**\n * @typedef Options\n * Configuration (optional).\n * @property {string|null|ReadonlyArray} [align]\n * One style for all columns, or styles for their respective columns.\n * Each style is either `'l'` (left), `'r'` (right), or `'c'` (center).\n * Other values are treated as `''`, which doesn’t place the colon in the\n * alignment row but does align left.\n * *Only the lowercased first character is used, so `Right` is fine.*\n * @property {boolean} [padding=true]\n * Whether to add a space of padding between delimiters and cells.\n *\n * When `true`, there is padding:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there is no padding:\n *\n * ```markdown\n * |Alpha|B |\n * |-----|-----|\n * |C |Delta|\n * ```\n * @property {boolean} [delimiterStart=true]\n * Whether to begin each row with the delimiter.\n *\n * > 👉 **Note**: please don’t use this: it could create fragile structures\n * > that aren’t understandable to some markdown parsers.\n *\n * When `true`, there are starting delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no starting delimiters:\n *\n * ```markdown\n * Alpha | B |\n * ----- | ----- |\n * C | Delta |\n * ```\n * @property {boolean} [delimiterEnd=true]\n * Whether to end each row with the delimiter.\n *\n * > 👉 **Note**: please don’t use this: it could create fragile structures\n * > that aren’t understandable to some markdown parsers.\n *\n * When `true`, there are ending delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no ending delimiters:\n *\n * ```markdown\n * | Alpha | B\n * | ----- | -----\n * | C | Delta\n * ```\n * @property {boolean} [alignDelimiters=true]\n * Whether to align the delimiters.\n * By default, they are aligned:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * Pass `false` to make them staggered:\n *\n * ```markdown\n * | Alpha | B |\n * | - | - |\n * | C | Delta |\n * ```\n * @property {(value: string) => number} [stringLength]\n * Function to detect the length of table cell content.\n * This is used when aligning the delimiters (`|`) between table cells.\n * Full-width characters and emoji mess up delimiter alignment when viewing\n * the markdown source.\n * To fix this, you can pass this function, which receives the cell content\n * and returns its “visible” size.\n * Note that what is and isn’t visible depends on where the text is displayed.\n *\n * Without such a function, the following:\n *\n * ```js\n * markdownTable([\n * ['Alpha', 'Bravo'],\n * ['中文', 'Charlie'],\n * ['👩‍❤️‍👩', 'Delta']\n * ])\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | - | - |\n * | 中文 | Charlie |\n * | 👩‍❤️‍👩 | Delta |\n * ```\n *\n * With [`string-width`](https://github.com/sindresorhus/string-width):\n *\n * ```js\n * import stringWidth from 'string-width'\n *\n * markdownTable(\n * [\n * ['Alpha', 'Bravo'],\n * ['中文', 'Charlie'],\n * ['👩‍❤️‍👩', 'Delta']\n * ],\n * {stringLength: stringWidth}\n * )\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | ----- | ------- |\n * | 中文 | Charlie |\n * | 👩‍❤️‍👩 | Delta |\n * ```\n */\n\n/**\n * @typedef {Options} MarkdownTableOptions\n * @todo\n * Remove next major.\n */\n\n/**\n * Generate a markdown ([GFM](https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables)) table..\n *\n * @param {ReadonlyArray>} table\n * Table data (matrix of strings).\n * @param {Options} [options]\n * Configuration (optional).\n * @returns {string}\n */\nexport function markdownTable(table, options = {}) {\n const align = (options.align || []).concat()\n const stringLength = options.stringLength || defaultStringLength\n /** @type {Array} Character codes as symbols for alignment per column. */\n const alignments = []\n /** @type {Array>} Cells per row. */\n const cellMatrix = []\n /** @type {Array>} Sizes of each cell per row. */\n const sizeMatrix = []\n /** @type {Array} */\n const longestCellByColumn = []\n let mostCellsPerRow = 0\n let rowIndex = -1\n\n // This is a superfluous loop if we don’t align delimiters, but otherwise we’d\n // do superfluous work when aligning, so optimize for aligning.\n while (++rowIndex < table.length) {\n /** @type {Array} */\n const row = []\n /** @type {Array} */\n const sizes = []\n let columnIndex = -1\n\n if (table[rowIndex].length > mostCellsPerRow) {\n mostCellsPerRow = table[rowIndex].length\n }\n\n while (++columnIndex < table[rowIndex].length) {\n const cell = serialize(table[rowIndex][columnIndex])\n\n if (options.alignDelimiters !== false) {\n const size = stringLength(cell)\n sizes[columnIndex] = size\n\n if (\n longestCellByColumn[columnIndex] === undefined ||\n size > longestCellByColumn[columnIndex]\n ) {\n longestCellByColumn[columnIndex] = size\n }\n }\n\n row.push(cell)\n }\n\n cellMatrix[rowIndex] = row\n sizeMatrix[rowIndex] = sizes\n }\n\n // Figure out which alignments to use.\n let columnIndex = -1\n\n if (typeof align === 'object' && 'length' in align) {\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = toAlignment(align[columnIndex])\n }\n } else {\n const code = toAlignment(align)\n\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = code\n }\n }\n\n // Inject the alignment row.\n columnIndex = -1\n /** @type {Array} */\n const row = []\n /** @type {Array} */\n const sizes = []\n\n while (++columnIndex < mostCellsPerRow) {\n const code = alignments[columnIndex]\n let before = ''\n let after = ''\n\n if (code === 99 /* `c` */) {\n before = ':'\n after = ':'\n } else if (code === 108 /* `l` */) {\n before = ':'\n } else if (code === 114 /* `r` */) {\n after = ':'\n }\n\n // There *must* be at least one hyphen-minus in each alignment cell.\n let size =\n options.alignDelimiters === false\n ? 1\n : Math.max(\n 1,\n longestCellByColumn[columnIndex] - before.length - after.length\n )\n\n const cell = before + '-'.repeat(size) + after\n\n if (options.alignDelimiters !== false) {\n size = before.length + size + after.length\n\n if (size > longestCellByColumn[columnIndex]) {\n longestCellByColumn[columnIndex] = size\n }\n\n sizes[columnIndex] = size\n }\n\n row[columnIndex] = cell\n }\n\n // Inject the alignment row.\n cellMatrix.splice(1, 0, row)\n sizeMatrix.splice(1, 0, sizes)\n\n rowIndex = -1\n /** @type {Array} */\n const lines = []\n\n while (++rowIndex < cellMatrix.length) {\n const row = cellMatrix[rowIndex]\n const sizes = sizeMatrix[rowIndex]\n columnIndex = -1\n /** @type {Array} */\n const line = []\n\n while (++columnIndex < mostCellsPerRow) {\n const cell = row[columnIndex] || ''\n let before = ''\n let after = ''\n\n if (options.alignDelimiters !== false) {\n const size =\n longestCellByColumn[columnIndex] - (sizes[columnIndex] || 0)\n const code = alignments[columnIndex]\n\n if (code === 114 /* `r` */) {\n before = ' '.repeat(size)\n } else if (code === 99 /* `c` */) {\n if (size % 2) {\n before = ' '.repeat(size / 2 + 0.5)\n after = ' '.repeat(size / 2 - 0.5)\n } else {\n before = ' '.repeat(size / 2)\n after = before\n }\n } else {\n after = ' '.repeat(size)\n }\n }\n\n if (options.delimiterStart !== false && !columnIndex) {\n line.push('|')\n }\n\n if (\n options.padding !== false &&\n // Don’t add the opening space if we’re not aligning and the cell is\n // empty: there will be a closing space.\n !(options.alignDelimiters === false && cell === '') &&\n (options.delimiterStart !== false || columnIndex)\n ) {\n line.push(' ')\n }\n\n if (options.alignDelimiters !== false) {\n line.push(before)\n }\n\n line.push(cell)\n\n if (options.alignDelimiters !== false) {\n line.push(after)\n }\n\n if (options.padding !== false) {\n line.push(' ')\n }\n\n if (\n options.delimiterEnd !== false ||\n columnIndex !== mostCellsPerRow - 1\n ) {\n line.push('|')\n }\n }\n\n lines.push(\n options.delimiterEnd === false\n ? line.join('').replace(/ +$/, '')\n : line.join('')\n )\n }\n\n return lines.join('\\n')\n}\n\n/**\n * @param {string|null|undefined} [value]\n * @returns {string}\n */\nfunction serialize(value) {\n return value === null || value === undefined ? '' : String(value)\n}\n\n/**\n * @param {string} value\n * @returns {number}\n */\nfunction defaultStringLength(value) {\n return value.length\n}\n\n/**\n * @param {string|null|undefined} value\n * @returns {number}\n */\nfunction toAlignment(value) {\n const code = typeof value === 'string' ? value.codePointAt(0) : 0\n\n return code === 67 /* `C` */ || code === 99 /* `c` */\n ? 99 /* `c` */\n : code === 76 /* `L` */ || code === 108 /* `l` */\n ? 108 /* `l` */\n : code === 82 /* `R` */ || code === 114 /* `r` */\n ? 114 /* `r` */\n : 0\n}\n","/**\n * @typedef {import('mdast').Blockquote} Blockquote\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').Map} Map\n * @typedef {import('../types.js').State} State\n */\n\n/**\n * @param {Blockquote} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function blockquote(node, _, state, info) {\n const exit = state.enter('blockquote')\n const tracker = state.createTracker(info)\n tracker.move('> ')\n tracker.shift(2)\n const value = state.indentLines(\n state.containerFlow(node, tracker.current()),\n map\n )\n exit()\n return value\n}\n\n/** @type {Map} */\nfunction map(line, _, blank) {\n return '>' + (blank ? '' : ' ') + line\n}\n","/**\n * @typedef {import('../types.js').ConstructName} ConstructName\n * @typedef {import('../types.js').Unsafe} Unsafe\n */\n\n/**\n * @param {Array} stack\n * @param {Unsafe} pattern\n * @returns {boolean}\n */\nexport function patternInScope(stack, pattern) {\n return (\n listInScope(stack, pattern.inConstruct, true) &&\n !listInScope(stack, pattern.notInConstruct, false)\n )\n}\n\n/**\n * @param {Array} stack\n * @param {Unsafe['inConstruct']} list\n * @param {boolean} none\n * @returns {boolean}\n */\nfunction listInScope(stack, list, none) {\n if (typeof list === 'string') {\n list = [list]\n }\n\n if (!list || list.length === 0) {\n return none\n }\n\n let index = -1\n\n while (++index < list.length) {\n if (stack.includes(list[index])) {\n return true\n }\n }\n\n return false\n}\n","/**\n * @typedef {import('mdast').Break} Break\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').State} State\n */\n\nimport {patternInScope} from '../util/pattern-in-scope.js'\n\n/**\n * @param {Break} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function hardBreak(_, _1, state, info) {\n let index = -1\n\n while (++index < state.unsafe.length) {\n // If we can’t put eols in this construct (setext headings, tables), use a\n // space instead.\n if (\n state.unsafe[index].character === '\\n' &&\n patternInScope(state.stack, state.unsafe[index])\n ) {\n return /[ \\t]/.test(info.before) ? '' : ' '\n }\n }\n\n return '\\\\\\n'\n}\n","/**\n * @typedef {import('mdast').Code} Code\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').Map} Map\n * @typedef {import('../types.js').State} State\n */\n\nimport {longestStreak} from 'longest-streak'\nimport {formatCodeAsIndented} from '../util/format-code-as-indented.js'\nimport {checkFence} from '../util/check-fence.js'\n\n/**\n * @param {Code} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function code(node, _, state, info) {\n const marker = checkFence(state)\n const raw = node.value || ''\n const suffix = marker === '`' ? 'GraveAccent' : 'Tilde'\n\n if (formatCodeAsIndented(node, state)) {\n const exit = state.enter('codeIndented')\n const value = state.indentLines(raw, map)\n exit()\n return value\n }\n\n const tracker = state.createTracker(info)\n const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3))\n const exit = state.enter('codeFenced')\n let value = tracker.move(sequence)\n\n if (node.lang) {\n const subexit = state.enter(`codeFencedLang${suffix}`)\n value += tracker.move(\n state.safe(node.lang, {\n before: value,\n after: ' ',\n encode: ['`'],\n ...tracker.current()\n })\n )\n subexit()\n }\n\n if (node.lang && node.meta) {\n const subexit = state.enter(`codeFencedMeta${suffix}`)\n value += tracker.move(' ')\n value += tracker.move(\n state.safe(node.meta, {\n before: value,\n after: '\\n',\n encode: ['`'],\n ...tracker.current()\n })\n )\n subexit()\n }\n\n value += tracker.move('\\n')\n\n if (raw) {\n value += tracker.move(raw + '\\n')\n }\n\n value += tracker.move(sequence)\n exit()\n return value\n}\n\n/** @type {Map} */\nfunction map(line, _, blank) {\n return (blank ? '' : ' ') + line\n}\n","/**\n * @typedef {import('../types.js').Options} Options\n * @typedef {import('../types.js').State} State\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkQuote(state) {\n const marker = state.options.quote || '\"'\n\n if (marker !== '\"' && marker !== \"'\") {\n throw new Error(\n 'Cannot serialize title with `' +\n marker +\n '` for `options.quote`, expected `\"`, or `\\'`'\n )\n }\n\n return marker\n}\n","/**\n * @typedef {import('mdast').Emphasis} Emphasis\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').State} State\n */\n\nimport {checkEmphasis} from '../util/check-emphasis.js'\n\nemphasis.peek = emphasisPeek\n\n// To do: there are cases where emphasis cannot “form” depending on the\n// previous or next character of sequences.\n// There’s no way around that though, except for injecting zero-width stuff.\n// Do we need to safeguard against that?\n/**\n * @param {Emphasis} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function emphasis(node, _, state, info) {\n const marker = checkEmphasis(state)\n const exit = state.enter('emphasis')\n const tracker = state.createTracker(info)\n let value = tracker.move(marker)\n value += tracker.move(\n state.containerPhrasing(node, {\n before: value,\n after: marker,\n ...tracker.current()\n })\n )\n value += tracker.move(marker)\n exit()\n return value\n}\n\n/**\n * @param {Emphasis} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @returns {string}\n */\nfunction emphasisPeek(_, _1, state) {\n return state.options.emphasis || '*'\n}\n","/**\n * @typedef {import('../types.js').Options} Options\n * @typedef {import('../types.js').State} State\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkEmphasis(state) {\n const marker = state.options.emphasis || '*'\n\n if (marker !== '*' && marker !== '_') {\n throw new Error(\n 'Cannot serialize emphasis with `' +\n marker +\n '` for `options.emphasis`, expected `*`, or `_`'\n )\n }\n\n return marker\n}\n","/**\n * @typedef {import('mdast').Html} Html\n */\n\nhtml.peek = htmlPeek\n\n/**\n * @param {Html} node\n * @returns {string}\n */\nexport function html(node) {\n return node.value || ''\n}\n\n/**\n * @returns {string}\n */\nfunction htmlPeek() {\n return '<'\n}\n","/**\n * @typedef {import('mdast').Image} Image\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').State} State\n */\n\nimport {checkQuote} from '../util/check-quote.js'\n\nimage.peek = imagePeek\n\n/**\n * @param {Image} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function image(node, _, state, info) {\n const quote = checkQuote(state)\n const suffix = quote === '\"' ? 'Quote' : 'Apostrophe'\n const exit = state.enter('image')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('![')\n value += tracker.move(\n state.safe(node.alt, {before: value, after: ']', ...tracker.current()})\n )\n value += tracker.move('](')\n\n subexit()\n\n if (\n // If there’s no url but there is a title…\n (!node.url && node.title) ||\n // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node.url)\n ) {\n subexit = state.enter('destinationLiteral')\n value += tracker.move('<')\n value += tracker.move(\n state.safe(node.url, {before: value, after: '>', ...tracker.current()})\n )\n value += tracker.move('>')\n } else {\n // No whitespace, raw is prettier.\n subexit = state.enter('destinationRaw')\n value += tracker.move(\n state.safe(node.url, {\n before: value,\n after: node.title ? ' ' : ')',\n ...tracker.current()\n })\n )\n }\n\n subexit()\n\n if (node.title) {\n subexit = state.enter(`title${suffix}`)\n value += tracker.move(' ' + quote)\n value += tracker.move(\n state.safe(node.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n )\n value += tracker.move(quote)\n subexit()\n }\n\n value += tracker.move(')')\n exit()\n\n return value\n}\n\n/**\n * @returns {string}\n */\nfunction imagePeek() {\n return '!'\n}\n","/**\n * @typedef {import('mdast').ImageReference} ImageReference\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').State} State\n */\n\nimageReference.peek = imageReferencePeek\n\n/**\n * @param {ImageReference} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function imageReference(node, _, state, info) {\n const type = node.referenceType\n const exit = state.enter('imageReference')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('![')\n const alt = state.safe(node.alt, {\n before: value,\n after: ']',\n ...tracker.current()\n })\n value += tracker.move(alt + '][')\n\n subexit()\n // Hide the fact that we’re in phrasing, because escapes don’t work.\n const stack = state.stack\n state.stack = []\n subexit = state.enter('reference')\n // Note: for proper tracking, we should reset the output positions when we end\n // up making a `shortcut` reference, because then there is no brace output.\n // Practically, in that case, there is no content, so it doesn’t matter that\n // we’ve tracked one too many characters.\n const reference = state.safe(state.associationId(node), {\n before: value,\n after: ']',\n ...tracker.current()\n })\n subexit()\n state.stack = stack\n exit()\n\n if (type === 'full' || !alt || alt !== reference) {\n value += tracker.move(reference + ']')\n } else if (type === 'shortcut') {\n // Remove the unwanted `[`.\n value = value.slice(0, -1)\n } else {\n value += tracker.move(']')\n }\n\n return value\n}\n\n/**\n * @returns {string}\n */\nfunction imageReferencePeek() {\n return '!'\n}\n","/**\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../types.js').State} State\n */\n\ninlineCode.peek = inlineCodePeek\n\n/**\n * @param {InlineCode} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @returns {string}\n */\nexport function inlineCode(node, _, state) {\n let value = node.value || ''\n let sequence = '`'\n let index = -1\n\n // If there is a single grave accent on its own in the code, use a fence of\n // two.\n // If there are two in a row, use one.\n while (new RegExp('(^|[^`])' + sequence + '([^`]|$)').test(value)) {\n sequence += '`'\n }\n\n // If this is not just spaces or eols (tabs don’t count), and either the\n // first or last character are a space, eol, or tick, then pad with spaces.\n if (\n /[^ \\r\\n]/.test(value) &&\n ((/^[ \\r\\n]/.test(value) && /[ \\r\\n]$/.test(value)) || /^`|`$/.test(value))\n ) {\n value = ' ' + value + ' '\n }\n\n // We have a potential problem: certain characters after eols could result in\n // blocks being seen.\n // For example, if someone injected the string `'\\n# b'`, then that would\n // result in an ATX heading.\n // We can’t escape characters in `inlineCode`, but because eols are\n // transformed to spaces when going from markdown to HTML anyway, we can swap\n // them out.\n while (++index < state.unsafe.length) {\n const pattern = state.unsafe[index]\n const expression = state.compilePattern(pattern)\n /** @type {RegExpExecArray | null} */\n let match\n\n // Only look for `atBreak`s.\n // Btw: note that `atBreak` patterns will always start the regex at LF or\n // CR.\n if (!pattern.atBreak) continue\n\n while ((match = expression.exec(value))) {\n let position = match.index\n\n // Support CRLF (patterns only look for one of the characters).\n if (\n value.charCodeAt(position) === 10 /* `\\n` */ &&\n value.charCodeAt(position - 1) === 13 /* `\\r` */\n ) {\n position--\n }\n\n value = value.slice(0, position) + ' ' + value.slice(match.index + 1)\n }\n }\n\n return sequence + value + sequence\n}\n\n/**\n * @returns {string}\n */\nfunction inlineCodePeek() {\n return '`'\n}\n","/**\n * @typedef {import('mdast').Link} Link\n * @typedef {import('../types.js').State} State\n */\n\nimport {toString} from 'mdast-util-to-string'\n\n/**\n * @param {Link} node\n * @param {State} state\n * @returns {boolean}\n */\nexport function formatLinkAsAutolink(node, state) {\n const raw = toString(node)\n\n return Boolean(\n !state.options.resourceLink &&\n // If there’s a url…\n node.url &&\n // And there’s a no title…\n !node.title &&\n // And the content of `node` is a single text node…\n node.children &&\n node.children.length === 1 &&\n node.children[0].type === 'text' &&\n // And if the url is the same as the content…\n (raw === node.url || 'mailto:' + raw === node.url) &&\n // And that starts w/ a protocol…\n /^[a-z][a-z+.-]+:/i.test(node.url) &&\n // And that doesn’t contain ASCII control codes (character escapes and\n // references don’t work), space, or angle brackets…\n !/[\\0- <>\\u007F]/.test(node.url)\n )\n}\n","/**\n * @typedef {import('mdast').Link} Link\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../types.js').Exit} Exit\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').State} State\n */\n\nimport {checkQuote} from '../util/check-quote.js'\nimport {formatLinkAsAutolink} from '../util/format-link-as-autolink.js'\n\nlink.peek = linkPeek\n\n/**\n * @param {Link} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function link(node, _, state, info) {\n const quote = checkQuote(state)\n const suffix = quote === '\"' ? 'Quote' : 'Apostrophe'\n const tracker = state.createTracker(info)\n /** @type {Exit} */\n let exit\n /** @type {Exit} */\n let subexit\n\n if (formatLinkAsAutolink(node, state)) {\n // Hide the fact that we’re in phrasing, because escapes don’t work.\n const stack = state.stack\n state.stack = []\n exit = state.enter('autolink')\n let value = tracker.move('<')\n value += tracker.move(\n state.containerPhrasing(node, {\n before: value,\n after: '>',\n ...tracker.current()\n })\n )\n value += tracker.move('>')\n exit()\n state.stack = stack\n return value\n }\n\n exit = state.enter('link')\n subexit = state.enter('label')\n let value = tracker.move('[')\n value += tracker.move(\n state.containerPhrasing(node, {\n before: value,\n after: '](',\n ...tracker.current()\n })\n )\n value += tracker.move('](')\n subexit()\n\n if (\n // If there’s no url but there is a title…\n (!node.url && node.title) ||\n // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node.url)\n ) {\n subexit = state.enter('destinationLiteral')\n value += tracker.move('<')\n value += tracker.move(\n state.safe(node.url, {before: value, after: '>', ...tracker.current()})\n )\n value += tracker.move('>')\n } else {\n // No whitespace, raw is prettier.\n subexit = state.enter('destinationRaw')\n value += tracker.move(\n state.safe(node.url, {\n before: value,\n after: node.title ? ' ' : ')',\n ...tracker.current()\n })\n )\n }\n\n subexit()\n\n if (node.title) {\n subexit = state.enter(`title${suffix}`)\n value += tracker.move(' ' + quote)\n value += tracker.move(\n state.safe(node.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n )\n value += tracker.move(quote)\n subexit()\n }\n\n value += tracker.move(')')\n\n exit()\n return value\n}\n\n/**\n * @param {Link} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @returns {string}\n */\nfunction linkPeek(node, _, state) {\n return formatLinkAsAutolink(node, state) ? '<' : '['\n}\n","/**\n * @typedef {import('mdast').LinkReference} LinkReference\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').State} State\n */\n\nlinkReference.peek = linkReferencePeek\n\n/**\n * @param {LinkReference} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function linkReference(node, _, state, info) {\n const type = node.referenceType\n const exit = state.enter('linkReference')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('[')\n const text = state.containerPhrasing(node, {\n before: value,\n after: ']',\n ...tracker.current()\n })\n value += tracker.move(text + '][')\n\n subexit()\n // Hide the fact that we’re in phrasing, because escapes don’t work.\n const stack = state.stack\n state.stack = []\n subexit = state.enter('reference')\n // Note: for proper tracking, we should reset the output positions when we end\n // up making a `shortcut` reference, because then there is no brace output.\n // Practically, in that case, there is no content, so it doesn’t matter that\n // we’ve tracked one too many characters.\n const reference = state.safe(state.associationId(node), {\n before: value,\n after: ']',\n ...tracker.current()\n })\n subexit()\n state.stack = stack\n exit()\n\n if (type === 'full' || !text || text !== reference) {\n value += tracker.move(reference + ']')\n } else if (type === 'shortcut') {\n // Remove the unwanted `[`.\n value = value.slice(0, -1)\n } else {\n value += tracker.move(']')\n }\n\n return value\n}\n\n/**\n * @returns {string}\n */\nfunction linkReferencePeek() {\n return '['\n}\n","/**\n * @typedef {import('../types.js').Options} Options\n * @typedef {import('../types.js').State} State\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkBullet(state) {\n const marker = state.options.bullet || '*'\n\n if (marker !== '*' && marker !== '+' && marker !== '-') {\n throw new Error(\n 'Cannot serialize items with `' +\n marker +\n '` for `options.bullet`, expected `*`, `+`, or `-`'\n )\n }\n\n return marker\n}\n","/**\n * @typedef {import('../types.js').Options} Options\n * @typedef {import('../types.js').State} State\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkRule(state) {\n const marker = state.options.rule || '*'\n\n if (marker !== '*' && marker !== '-' && marker !== '_') {\n throw new Error(\n 'Cannot serialize rules with `' +\n marker +\n '` for `options.rule`, expected `*`, `-`, or `_`'\n )\n }\n\n return marker\n}\n","/**\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n */\n\nimport {convert} from 'unist-util-is'\n\n/**\n * Check if the given value is *phrasing content*.\n *\n * > 👉 **Note**: Excludes `html`, which can be both phrasing or flow.\n *\n * @param node\n * Thing to check, typically `Node`.\n * @returns\n * Whether `value` is phrasing content.\n */\n\nexport const phrasing =\n /** @type {(node?: unknown) => node is PhrasingContent} */\n (\n convert([\n 'break',\n 'delete',\n 'emphasis',\n 'footnote',\n 'footnoteReference',\n 'image',\n 'imageReference',\n 'inlineCode',\n 'link',\n 'linkReference',\n 'strong',\n 'text'\n ])\n )\n","/**\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('mdast').Strong} Strong\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').State} State\n */\n\nimport {checkStrong} from '../util/check-strong.js'\n\nstrong.peek = strongPeek\n\n// To do: there are cases where emphasis cannot “form” depending on the\n// previous or next character of sequences.\n// There’s no way around that though, except for injecting zero-width stuff.\n// Do we need to safeguard against that?\n/**\n * @param {Strong} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function strong(node, _, state, info) {\n const marker = checkStrong(state)\n const exit = state.enter('strong')\n const tracker = state.createTracker(info)\n let value = tracker.move(marker + marker)\n value += tracker.move(\n state.containerPhrasing(node, {\n before: value,\n after: marker,\n ...tracker.current()\n })\n )\n value += tracker.move(marker + marker)\n exit()\n return value\n}\n\n/**\n * @param {Strong} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @returns {string}\n */\nfunction strongPeek(_, _1, state) {\n return state.options.strong || '*'\n}\n","/**\n * @typedef {import('../types.js').Options} Options\n * @typedef {import('../types.js').State} State\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkStrong(state) {\n const marker = state.options.strong || '*'\n\n if (marker !== '*' && marker !== '_') {\n throw new Error(\n 'Cannot serialize strong with `' +\n marker +\n '` for `options.strong`, expected `*`, or `_`'\n )\n }\n\n return marker\n}\n","import {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {definition} from './definition.js'\nimport {emphasis} from './emphasis.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {image} from './image.js'\nimport {imageReference} from './image-reference.js'\nimport {inlineCode} from './inline-code.js'\nimport {link} from './link.js'\nimport {linkReference} from './link-reference.js'\nimport {list} from './list.js'\nimport {listItem} from './list-item.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/**\n * Default (CommonMark) handlers.\n */\nexport const handle = {\n blockquote,\n break: hardBreak,\n code,\n definition,\n emphasis,\n hardBreak,\n heading,\n html,\n image,\n imageReference,\n inlineCode,\n link,\n linkReference,\n list,\n listItem,\n paragraph,\n root,\n strong,\n text,\n thematicBreak\n}\n","/**\n * @typedef {import('../types.js').Options} Options\n * @typedef {import('../types.js').State} State\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkFence(state) {\n const marker = state.options.fence || '`'\n\n if (marker !== '`' && marker !== '~') {\n throw new Error(\n 'Cannot serialize code with `' +\n marker +\n '` for `options.fence`, expected `` ` `` or `~`'\n )\n }\n\n return marker\n}\n","/**\n * @typedef {import('mdast').Code} Code\n * @typedef {import('../types.js').State} State\n */\n\n/**\n * @param {Code} node\n * @param {State} state\n * @returns {boolean}\n */\nexport function formatCodeAsIndented(node, state) {\n return Boolean(\n state.options.fences === false &&\n node.value &&\n // If there’s no info…\n !node.lang &&\n // And there’s a non-whitespace character…\n /[^ \\r\\n]/.test(node.value) &&\n // And the value doesn’t start or end in a blank…\n !/^[\\t ]*(?:[\\r\\n]|$)|(?:^|[\\r\\n])[\\t ]*$/.test(node.value)\n )\n}\n","/**\n * Get the count of the longest repeating streak of `substring` in `value`.\n *\n * @param {string} value\n * Content to search in.\n * @param {string} substring\n * Substring to look for, typically one character.\n * @returns {number}\n * Count of most frequent adjacent `substring`s in `value`.\n */\nexport function longestStreak(value, substring) {\n const source = String(value)\n let index = source.indexOf(substring)\n let expected = index\n let count = 0\n let max = 0\n\n if (typeof substring !== 'string') {\n throw new TypeError('Expected substring')\n }\n\n while (index !== -1) {\n if (index === expected) {\n if (++count > max) {\n max = count\n }\n } else {\n count = 1\n }\n\n expected = index + substring.length\n index = source.indexOf(substring, expected)\n }\n\n return max\n}\n","/**\n * @typedef {import('mdast').Definition} Definition\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').State} State\n */\n\nimport {checkQuote} from '../util/check-quote.js'\n\n/**\n * @param {Definition} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function definition(node, _, state, info) {\n const quote = checkQuote(state)\n const suffix = quote === '\"' ? 'Quote' : 'Apostrophe'\n const exit = state.enter('definition')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('[')\n value += tracker.move(\n state.safe(state.associationId(node), {\n before: value,\n after: ']',\n ...tracker.current()\n })\n )\n value += tracker.move(']: ')\n\n subexit()\n\n if (\n // If there’s no url, or…\n !node.url ||\n // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node.url)\n ) {\n subexit = state.enter('destinationLiteral')\n value += tracker.move('<')\n value += tracker.move(\n state.safe(node.url, {before: value, after: '>', ...tracker.current()})\n )\n value += tracker.move('>')\n } else {\n // No whitespace, raw is prettier.\n subexit = state.enter('destinationRaw')\n value += tracker.move(\n state.safe(node.url, {\n before: value,\n after: node.title ? ' ' : '\\n',\n ...tracker.current()\n })\n )\n }\n\n subexit()\n\n if (node.title) {\n subexit = state.enter(`title${suffix}`)\n value += tracker.move(' ' + quote)\n value += tracker.move(\n state.safe(node.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n )\n value += tracker.move(quote)\n subexit()\n }\n\n exit()\n\n return value\n}\n","/**\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').State} State\n */\n\nimport {formatHeadingAsSetext} from '../util/format-heading-as-setext.js'\n\n/**\n * @param {Heading} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function heading(node, _, state, info) {\n const rank = Math.max(Math.min(6, node.depth || 1), 1)\n const tracker = state.createTracker(info)\n\n if (formatHeadingAsSetext(node, state)) {\n const exit = state.enter('headingSetext')\n const subexit = state.enter('phrasing')\n const value = state.containerPhrasing(node, {\n ...tracker.current(),\n before: '\\n',\n after: '\\n'\n })\n subexit()\n exit()\n\n return (\n value +\n '\\n' +\n (rank === 1 ? '=' : '-').repeat(\n // The whole size…\n value.length -\n // Minus the position of the character after the last EOL (or\n // 0 if there is none)…\n (Math.max(value.lastIndexOf('\\r'), value.lastIndexOf('\\n')) + 1)\n )\n )\n }\n\n const sequence = '#'.repeat(rank)\n const exit = state.enter('headingAtx')\n const subexit = state.enter('phrasing')\n\n // Note: for proper tracking, we should reset the output positions when there\n // is no content returned, because then the space is not output.\n // Practically, in that case, there is no content, so it doesn’t matter that\n // we’ve tracked one too many characters.\n tracker.move(sequence + ' ')\n\n let value = state.containerPhrasing(node, {\n before: '# ',\n after: '\\n',\n ...tracker.current()\n })\n\n if (/^[\\t ]/.test(value)) {\n // To do: what effect has the character reference on tracking?\n value =\n '&#x' +\n value.charCodeAt(0).toString(16).toUpperCase() +\n ';' +\n value.slice(1)\n }\n\n value = value ? sequence + ' ' + value : sequence\n\n if (state.options.closeAtx) {\n value += ' ' + sequence\n }\n\n subexit()\n exit()\n\n return value\n}\n","/**\n * @typedef {import('mdast').Heading} Heading\n * @typedef {import('../types.js').State} State\n */\n\nimport {EXIT, visit} from 'unist-util-visit'\nimport {toString} from 'mdast-util-to-string'\n\n/**\n * @param {Heading} node\n * @param {State} state\n * @returns {boolean}\n */\nexport function formatHeadingAsSetext(node, state) {\n let literalWithBreak = false\n\n // Look for literals with a line break.\n // Note that this also\n visit(node, function (node) {\n if (\n ('value' in node && /\\r?\\n|\\r/.test(node.value)) ||\n node.type === 'break'\n ) {\n literalWithBreak = true\n return EXIT\n }\n })\n\n return Boolean(\n (!node.depth || node.depth < 3) &&\n toString(node) &&\n (state.options.setext || literalWithBreak)\n )\n}\n","/**\n * @typedef {import('mdast').List} List\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').State} State\n */\n\nimport {checkBullet} from '../util/check-bullet.js'\nimport {checkBulletOther} from '../util/check-bullet-other.js'\nimport {checkBulletOrdered} from '../util/check-bullet-ordered.js'\nimport {checkRule} from '../util/check-rule.js'\n\n/**\n * @param {List} node\n * @param {Parents | undefined} parent\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function list(node, parent, state, info) {\n const exit = state.enter('list')\n const bulletCurrent = state.bulletCurrent\n /** @type {string} */\n let bullet = node.ordered ? checkBulletOrdered(state) : checkBullet(state)\n /** @type {string} */\n const bulletOther = node.ordered\n ? bullet === '.'\n ? ')'\n : '.'\n : checkBulletOther(state)\n let useDifferentMarker =\n parent && state.bulletLastUsed ? bullet === state.bulletLastUsed : false\n\n if (!node.ordered) {\n const firstListItem = node.children ? node.children[0] : undefined\n\n // If there’s an empty first list item directly in two list items,\n // we have to use a different bullet:\n //\n // ```markdown\n // * - *\n // ```\n //\n // …because otherwise it would become one big thematic break.\n if (\n // Bullet could be used as a thematic break marker:\n (bullet === '*' || bullet === '-') &&\n // Empty first list item:\n firstListItem &&\n (!firstListItem.children || !firstListItem.children[0]) &&\n // Directly in two other list items:\n state.stack[state.stack.length - 1] === 'list' &&\n state.stack[state.stack.length - 2] === 'listItem' &&\n state.stack[state.stack.length - 3] === 'list' &&\n state.stack[state.stack.length - 4] === 'listItem' &&\n // That are each the first child.\n state.indexStack[state.indexStack.length - 1] === 0 &&\n state.indexStack[state.indexStack.length - 2] === 0 &&\n state.indexStack[state.indexStack.length - 3] === 0\n ) {\n useDifferentMarker = true\n }\n\n // If there’s a thematic break at the start of the first list item,\n // we have to use a different bullet:\n //\n // ```markdown\n // * ---\n // ```\n //\n // …because otherwise it would become one big thematic break.\n if (checkRule(state) === bullet && firstListItem) {\n let index = -1\n\n while (++index < node.children.length) {\n const item = node.children[index]\n\n if (\n item &&\n item.type === 'listItem' &&\n item.children &&\n item.children[0] &&\n item.children[0].type === 'thematicBreak'\n ) {\n useDifferentMarker = true\n break\n }\n }\n }\n }\n\n if (useDifferentMarker) {\n bullet = bulletOther\n }\n\n state.bulletCurrent = bullet\n const value = state.containerFlow(node, info)\n state.bulletLastUsed = bullet\n state.bulletCurrent = bulletCurrent\n exit()\n return value\n}\n","/**\n * @typedef {import('../types.js').Options} Options\n * @typedef {import('../types.js').State} State\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkBulletOrdered(state) {\n const marker = state.options.bulletOrdered || '.'\n\n if (marker !== '.' && marker !== ')') {\n throw new Error(\n 'Cannot serialize items with `' +\n marker +\n '` for `options.bulletOrdered`, expected `.` or `)`'\n )\n }\n\n return marker\n}\n","/**\n * @typedef {import('../types.js').Options} Options\n * @typedef {import('../types.js').State} State\n */\n\nimport {checkBullet} from './check-bullet.js'\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkBulletOther(state) {\n const bullet = checkBullet(state)\n const bulletOther = state.options.bulletOther\n\n if (!bulletOther) {\n return bullet === '*' ? '-' : '*'\n }\n\n if (bulletOther !== '*' && bulletOther !== '+' && bulletOther !== '-') {\n throw new Error(\n 'Cannot serialize items with `' +\n bulletOther +\n '` for `options.bulletOther`, expected `*`, `+`, or `-`'\n )\n }\n\n if (bulletOther === bullet) {\n throw new Error(\n 'Expected `bullet` (`' +\n bullet +\n '`) and `bulletOther` (`' +\n bulletOther +\n '`) to be different'\n )\n }\n\n return bulletOther\n}\n","/**\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').Map} Map\n * @typedef {import('../types.js').State} State\n */\n\nimport {checkBullet} from '../util/check-bullet.js'\nimport {checkListItemIndent} from '../util/check-list-item-indent.js'\n\n/**\n * @param {ListItem} node\n * @param {Parents | undefined} parent\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function listItem(node, parent, state, info) {\n const listItemIndent = checkListItemIndent(state)\n let bullet = state.bulletCurrent || checkBullet(state)\n\n // Add the marker value for ordered lists.\n if (parent && parent.type === 'list' && parent.ordered) {\n bullet =\n (typeof parent.start === 'number' && parent.start > -1\n ? parent.start\n : 1) +\n (state.options.incrementListMarker === false\n ? 0\n : parent.children.indexOf(node)) +\n bullet\n }\n\n let size = bullet.length + 1\n\n if (\n listItemIndent === 'tab' ||\n (listItemIndent === 'mixed' &&\n ((parent && parent.type === 'list' && parent.spread) || node.spread))\n ) {\n size = Math.ceil(size / 4) * 4\n }\n\n const tracker = state.createTracker(info)\n tracker.move(bullet + ' '.repeat(size - bullet.length))\n tracker.shift(size)\n const exit = state.enter('listItem')\n const value = state.indentLines(\n state.containerFlow(node, tracker.current()),\n map\n )\n exit()\n\n return value\n\n /** @type {Map} */\n function map(line, index, blank) {\n if (index) {\n return (blank ? '' : ' '.repeat(size)) + line\n }\n\n return (blank ? bullet : bullet + ' '.repeat(size - bullet.length)) + line\n }\n}\n","/**\n * @typedef {import('../types.js').Options} Options\n * @typedef {import('../types.js').State} State\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkListItemIndent(state) {\n const style = state.options.listItemIndent || 'one'\n\n if (style !== 'tab' && style !== 'one' && style !== 'mixed') {\n throw new Error(\n 'Cannot serialize items with `' +\n style +\n '` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`'\n )\n }\n\n return style\n}\n","/**\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').State} State\n */\n\n/**\n * @param {Paragraph} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function paragraph(node, _, state, info) {\n const exit = state.enter('paragraph')\n const subexit = state.enter('phrasing')\n const value = state.containerPhrasing(node, info)\n subexit()\n exit()\n return value\n}\n","/**\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('mdast').Root} Root\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').State} State\n */\n\nimport {phrasing} from 'mdast-util-phrasing'\n\n/**\n * @param {Root} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function root(node, _, state, info) {\n // Note: `html` nodes are ambiguous.\n const hasPhrasing = node.children.some(function (d) {\n return phrasing(d)\n })\n const fn = hasPhrasing ? state.containerPhrasing : state.containerFlow\n return fn.call(state, node, info)\n}\n","/**\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('mdast').Text} Text\n * @typedef {import('../types.js').Info} Info\n * @typedef {import('../types.js').State} State\n */\n\n/**\n * @param {Text} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function text(node, _, state, info) {\n return state.safe(node.value, info)\n}\n","/**\n * @typedef {import('mdast').Parents} Parents\n * @typedef {import('mdast').ThematicBreak} ThematicBreak\n * @typedef {import('../types.js').State} State\n */\n\nimport {checkRuleRepetition} from '../util/check-rule-repetition.js'\nimport {checkRule} from '../util/check-rule.js'\n\n/**\n * @param {ThematicBreak} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @returns {string}\n */\nexport function thematicBreak(_, _1, state) {\n const value = (\n checkRule(state) + (state.options.ruleSpaces ? ' ' : '')\n ).repeat(checkRuleRepetition(state))\n\n return state.options.ruleSpaces ? value.slice(0, -1) : value\n}\n","/**\n * @typedef {import('../types.js').Options} Options\n * @typedef {import('../types.js').State} State\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkRuleRepetition(state) {\n const repetition = state.options.ruleRepetition || 3\n\n if (repetition < 3) {\n throw new Error(\n 'Cannot serialize rules with repetition `' +\n repetition +\n '` for `options.ruleRepetition`, expected `3` or more'\n )\n }\n\n return repetition\n}\n","/**\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('mdast').Table} Table\n * @typedef {import('mdast').TableCell} TableCell\n * @typedef {import('mdast').TableRow} TableRow\n *\n * @typedef {import('markdown-table').Options} MarkdownTableOptions\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n *\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').State} State\n * @typedef {import('mdast-util-to-markdown').Info} Info\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [tableCellPadding=true]\n * Whether to add a space of padding between delimiters and cells (default:\n * `true`).\n * @property {boolean | null | undefined} [tablePipeAlign=true]\n * Whether to align the delimiters (default: `true`).\n * @property {MarkdownTableOptions['stringLength'] | null | undefined} [stringLength]\n * Function to detect the length of table cell content, used when aligning\n * the delimiters between cells (optional).\n */\n\nimport {ok as assert} from 'devlop'\nimport {markdownTable} from 'markdown-table'\nimport {defaultHandlers} from 'mdast-util-to-markdown'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM tables in\n * markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM tables.\n */\nexport function gfmTableFromMarkdown() {\n return {\n enter: {\n table: enterTable,\n tableData: enterCell,\n tableHeader: enterCell,\n tableRow: enterRow\n },\n exit: {\n codeText: exitCodeText,\n table: exitTable,\n tableData: exit,\n tableHeader: exit,\n tableRow: exit\n }\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterTable(token) {\n const align = token._align\n assert(align, 'expected `_align` on table')\n this.enter(\n {\n type: 'table',\n align: align.map(function (d) {\n return d === 'none' ? null : d\n }),\n children: []\n },\n token\n )\n this.data.inTable = true\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitTable(token) {\n this.exit(token)\n this.data.inTable = undefined\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterRow(token) {\n this.enter({type: 'tableRow', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exit(token) {\n this.exit(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterCell(token) {\n this.enter({type: 'tableCell', children: []}, token)\n}\n\n// Overwrite the default code text data handler to unescape escaped pipes when\n// they are in tables.\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitCodeText(token) {\n let value = this.resume()\n\n if (this.data.inTable) {\n value = value.replace(/\\\\([\\\\|])/g, replace)\n }\n\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'inlineCode')\n node.value = value\n this.exit(token)\n}\n\n/**\n * @param {string} $0\n * @param {string} $1\n * @returns {string}\n */\nfunction replace($0, $1) {\n // Pipes work, backslashes don’t (but can’t escape pipes).\n return $1 === '|' ? $1 : $0\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM tables in\n * markdown.\n *\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM tables.\n */\nexport function gfmTableToMarkdown(options) {\n const settings = options || {}\n const padding = settings.tableCellPadding\n const alignDelimiters = settings.tablePipeAlign\n const stringLength = settings.stringLength\n const around = padding ? ' ' : '|'\n\n return {\n unsafe: [\n {character: '\\r', inConstruct: 'tableCell'},\n {character: '\\n', inConstruct: 'tableCell'},\n // A pipe, when followed by a tab or space (padding), or a dash or colon\n // (unpadded delimiter row), could result in a table.\n {atBreak: true, character: '|', after: '[\\t :-]'},\n // A pipe in a cell must be encoded.\n {character: '|', inConstruct: 'tableCell'},\n // A colon must be followed by a dash, in which case it could start a\n // delimiter row.\n {atBreak: true, character: ':', after: '-'},\n // A delimiter row can also start with a dash, when followed by more\n // dashes, a colon, or a pipe.\n // This is a stricter version than the built in check for lists, thematic\n // breaks, and setex heading underlines though:\n // \n {atBreak: true, character: '-', after: '[:|-]'}\n ],\n handlers: {\n inlineCode: inlineCodeWithTable,\n table: handleTable,\n tableCell: handleTableCell,\n tableRow: handleTableRow\n }\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {Table} node\n */\n function handleTable(node, _, state, info) {\n return serializeData(handleTableAsData(node, state, info), node.align)\n }\n\n /**\n * This function isn’t really used normally, because we handle rows at the\n * table level.\n * But, if someone passes in a table row, this ensures we make somewhat sense.\n *\n * @type {ToMarkdownHandle}\n * @param {TableRow} node\n */\n function handleTableRow(node, _, state, info) {\n const row = handleTableRowAsData(node, state, info)\n const value = serializeData([row])\n // `markdown-table` will always add an align row\n return value.slice(0, value.indexOf('\\n'))\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {TableCell} node\n */\n function handleTableCell(node, _, state, info) {\n const exit = state.enter('tableCell')\n const subexit = state.enter('phrasing')\n const value = state.containerPhrasing(node, {\n ...info,\n before: around,\n after: around\n })\n subexit()\n exit()\n return value\n }\n\n /**\n * @param {Array>} matrix\n * @param {Array | null | undefined} [align]\n */\n function serializeData(matrix, align) {\n return markdownTable(matrix, {\n align,\n // @ts-expect-error: `markdown-table` types should support `null`.\n alignDelimiters,\n // @ts-expect-error: `markdown-table` types should support `null`.\n padding,\n // @ts-expect-error: `markdown-table` types should support `null`.\n stringLength\n })\n }\n\n /**\n * @param {Table} node\n * @param {State} state\n * @param {Info} info\n */\n function handleTableAsData(node, state, info) {\n const children = node.children\n let index = -1\n /** @type {Array>} */\n const result = []\n const subexit = state.enter('table')\n\n while (++index < children.length) {\n result[index] = handleTableRowAsData(children[index], state, info)\n }\n\n subexit()\n\n return result\n }\n\n /**\n * @param {TableRow} node\n * @param {State} state\n * @param {Info} info\n */\n function handleTableRowAsData(node, state, info) {\n const children = node.children\n let index = -1\n /** @type {Array} */\n const result = []\n const subexit = state.enter('tableRow')\n\n while (++index < children.length) {\n // Note: the positional info as used here is incorrect.\n // Making it correct would be impossible due to aligning cells?\n // And it would need copy/pasting `markdown-table` into this project.\n result[index] = handleTableCell(children[index], node, state, info)\n }\n\n subexit()\n\n return result\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {InlineCode} node\n */\n function inlineCodeWithTable(node, parent, state) {\n let value = defaultHandlers.inlineCode(node, parent, state)\n\n if (state.stack.includes('tableCell')) {\n value = value.replace(/\\|/g, '\\\\$&')\n }\n\n return value\n }\n}\n","/**\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n */\n\nimport {ok as assert} from 'devlop'\nimport {defaultHandlers} from 'mdast-util-to-markdown'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM task\n * list items in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM task list items.\n */\nexport function gfmTaskListItemFromMarkdown() {\n return {\n exit: {\n taskListCheckValueChecked: exitCheck,\n taskListCheckValueUnchecked: exitCheck,\n paragraph: exitParagraphWithTaskListItem\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM task list\n * items in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM task list items.\n */\nexport function gfmTaskListItemToMarkdown() {\n return {\n unsafe: [{atBreak: true, character: '-', after: '[:|-]'}],\n handlers: {listItem: listItemWithTaskListItem}\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitCheck(token) {\n // We’re always in a paragraph, in a list item.\n const node = this.stack[this.stack.length - 2]\n assert(node.type === 'listItem')\n node.checked = token.type === 'taskListCheckValueChecked'\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitParagraphWithTaskListItem(token) {\n const parent = this.stack[this.stack.length - 2]\n\n if (\n parent &&\n parent.type === 'listItem' &&\n typeof parent.checked === 'boolean'\n ) {\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'paragraph')\n const head = node.children[0]\n\n if (head && head.type === 'text') {\n const siblings = parent.children\n let index = -1\n /** @type {Paragraph | undefined} */\n let firstParaghraph\n\n while (++index < siblings.length) {\n const sibling = siblings[index]\n if (sibling.type === 'paragraph') {\n firstParaghraph = sibling\n break\n }\n }\n\n if (firstParaghraph === node) {\n // Must start with a space or a tab.\n head.value = head.value.slice(1)\n\n if (head.value.length === 0) {\n node.children.shift()\n } else if (\n node.position &&\n head.position &&\n typeof head.position.start.offset === 'number'\n ) {\n head.position.start.column++\n head.position.start.offset++\n node.position.start = Object.assign({}, head.position.start)\n }\n }\n }\n }\n\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {ListItem} node\n */\nfunction listItemWithTaskListItem(node, parent, state, info) {\n const head = node.children[0]\n const checkable =\n typeof node.checked === 'boolean' && head && head.type === 'paragraph'\n const checkbox = '[' + (node.checked ? 'x' : ' ') + '] '\n const tracker = state.createTracker(info)\n\n if (checkable) {\n tracker.move(checkbox)\n }\n\n let value = defaultHandlers.listItem(node, parent, state, {\n ...info,\n ...tracker.current()\n })\n\n if (checkable) {\n value = value.replace(/^(?:[*+-]|\\d+\\.)([\\r\\n]| {1,3})/, check)\n }\n\n return value\n\n /**\n * @param {string} $0\n * @returns {string}\n */\n function check($0) {\n return $0 + checkbox\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Code} Code\n * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Previous} Previous\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {\n asciiAlpha,\n asciiAlphanumeric,\n asciiControl,\n markdownLineEndingOrSpace,\n unicodePunctuation,\n unicodeWhitespace\n} from 'micromark-util-character'\nconst wwwPrefix = {\n tokenize: tokenizeWwwPrefix,\n partial: true\n}\nconst domain = {\n tokenize: tokenizeDomain,\n partial: true\n}\nconst path = {\n tokenize: tokenizePath,\n partial: true\n}\nconst trail = {\n tokenize: tokenizeTrail,\n partial: true\n}\nconst emailDomainDotTrail = {\n tokenize: tokenizeEmailDomainDotTrail,\n partial: true\n}\nconst wwwAutolink = {\n tokenize: tokenizeWwwAutolink,\n previous: previousWww\n}\nconst protocolAutolink = {\n tokenize: tokenizeProtocolAutolink,\n previous: previousProtocol\n}\nconst emailAutolink = {\n tokenize: tokenizeEmailAutolink,\n previous: previousEmail\n}\n\n/** @type {ConstructRecord} */\nconst text = {}\n\n/**\n * Create an extension for `micromark` to support GitHub autolink literal\n * syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * autolink literal syntax.\n */\nexport function gfmAutolinkLiteral() {\n return {\n text\n }\n}\n\n/** @type {Code} */\nlet code = 48\n\n// Add alphanumerics.\nwhile (code < 123) {\n text[code] = emailAutolink\n code++\n if (code === 58) code = 65\n else if (code === 91) code = 97\n}\ntext[43] = emailAutolink\ntext[45] = emailAutolink\ntext[46] = emailAutolink\ntext[95] = emailAutolink\ntext[72] = [emailAutolink, protocolAutolink]\ntext[104] = [emailAutolink, protocolAutolink]\ntext[87] = [emailAutolink, wwwAutolink]\ntext[119] = [emailAutolink, wwwAutolink]\n\n// To do: perform email autolink literals on events, afterwards.\n// That’s where `markdown-rs` and `cmark-gfm` perform it.\n// It should look for `@`, then for atext backwards, and then for a label\n// forwards.\n// To do: `mailto:`, `xmpp:` protocol as prefix.\n\n/**\n * Email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailAutolink(effects, ok, nok) {\n const self = this\n /** @type {boolean | undefined} */\n let dot\n /** @type {boolean} */\n let data\n return start\n\n /**\n * Start of email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (\n !gfmAtext(code) ||\n !previousEmail.call(self, self.previous) ||\n previousUnbalanced(self.events)\n ) {\n return nok(code)\n }\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkEmail')\n return atext(code)\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function atext(code) {\n if (gfmAtext(code)) {\n effects.consume(code)\n return atext\n }\n if (code === 64) {\n effects.consume(code)\n return emailDomain\n }\n return nok(code)\n }\n\n /**\n * In email domain.\n *\n * The reference code is a bit overly complex as it handles the `@`, of which\n * there may be just one.\n * Source: \n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomain(code) {\n // Dot followed by alphanumerical (not `-` or `_`).\n if (code === 46) {\n return effects.check(\n emailDomainDotTrail,\n emailDomainAfter,\n emailDomainDot\n )(code)\n }\n\n // Alphanumerical, `-`, and `_`.\n if (code === 45 || code === 95 || asciiAlphanumeric(code)) {\n data = true\n effects.consume(code)\n return emailDomain\n }\n\n // To do: `/` if xmpp.\n\n // Note: normally we’d truncate trailing punctuation from the link.\n // However, email autolink literals cannot contain any of those markers,\n // except for `.`, but that can only occur if it isn’t trailing.\n // So we can ignore truncating!\n return emailDomainAfter(code)\n }\n\n /**\n * In email domain, on dot that is not a trail.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainDot(code) {\n effects.consume(code)\n dot = true\n return emailDomain\n }\n\n /**\n * After email domain.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainAfter(code) {\n // Domain must not be empty, must include a dot, and must end in alphabetical.\n // Source: .\n if (data && dot && asciiAlpha(self.previous)) {\n effects.exit('literalAutolinkEmail')\n effects.exit('literalAutolink')\n return ok(code)\n }\n return nok(code)\n }\n}\n\n/**\n * `www` autolink literal.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwAutolink(effects, ok, nok) {\n const self = this\n return wwwStart\n\n /**\n * Start of www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwStart(code) {\n if (\n (code !== 87 && code !== 119) ||\n !previousWww.call(self, self.previous) ||\n previousUnbalanced(self.events)\n ) {\n return nok(code)\n }\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkWww')\n // Note: we *check*, so we can discard the `www.` we parsed.\n // If it worked, we consider it as a part of the domain.\n return effects.check(\n wwwPrefix,\n effects.attempt(domain, effects.attempt(path, wwwAfter), nok),\n nok\n )(code)\n }\n\n /**\n * After a www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwAfter(code) {\n effects.exit('literalAutolinkWww')\n effects.exit('literalAutolink')\n return ok(code)\n }\n}\n\n/**\n * Protocol autolink literal.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeProtocolAutolink(effects, ok, nok) {\n const self = this\n let buffer = ''\n let seen = false\n return protocolStart\n\n /**\n * Start of protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolStart(code) {\n if (\n (code === 72 || code === 104) &&\n previousProtocol.call(self, self.previous) &&\n !previousUnbalanced(self.events)\n ) {\n effects.enter('literalAutolink')\n effects.enter('literalAutolinkHttp')\n buffer += String.fromCodePoint(code)\n effects.consume(code)\n return protocolPrefixInside\n }\n return nok(code)\n }\n\n /**\n * In protocol.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^^^^\n * ```\n *\n * @type {State}\n */\n function protocolPrefixInside(code) {\n // `5` is size of `https`\n if (asciiAlpha(code) && buffer.length < 5) {\n // @ts-expect-error: definitely number.\n buffer += String.fromCodePoint(code)\n effects.consume(code)\n return protocolPrefixInside\n }\n if (code === 58) {\n const protocol = buffer.toLowerCase()\n if (protocol === 'http' || protocol === 'https') {\n effects.consume(code)\n return protocolSlashesInside\n }\n }\n return nok(code)\n }\n\n /**\n * In slashes.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^\n * ```\n *\n * @type {State}\n */\n function protocolSlashesInside(code) {\n if (code === 47) {\n effects.consume(code)\n if (seen) {\n return afterProtocol\n }\n seen = true\n return protocolSlashesInside\n }\n return nok(code)\n }\n\n /**\n * After protocol, before domain.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function afterProtocol(code) {\n // To do: this is different from `markdown-rs`:\n // https://github.com/wooorm/markdown-rs/blob/b3a921c761309ae00a51fe348d8a43adbc54b518/src/construct/gfm_autolink_literal.rs#L172-L182\n return code === null ||\n asciiControl(code) ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code) ||\n unicodePunctuation(code)\n ? nok(code)\n : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code)\n }\n\n /**\n * After a protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolAfter(code) {\n effects.exit('literalAutolinkHttp')\n effects.exit('literalAutolink')\n return ok(code)\n }\n}\n\n/**\n * `www` prefix.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwPrefix(effects, ok, nok) {\n let size = 0\n return wwwPrefixInside\n\n /**\n * In www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^^^^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixInside(code) {\n if ((code === 87 || code === 119) && size < 3) {\n size++\n effects.consume(code)\n return wwwPrefixInside\n }\n if (code === 46 && size === 3) {\n effects.consume(code)\n return wwwPrefixAfter\n }\n return nok(code)\n }\n\n /**\n * After www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixAfter(code) {\n // If there is *anything*, we can link.\n return code === null ? nok(code) : ok(code)\n }\n}\n\n/**\n * Domain.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDomain(effects, ok, nok) {\n /** @type {boolean | undefined} */\n let underscoreInLastSegment\n /** @type {boolean | undefined} */\n let underscoreInLastLastSegment\n /** @type {boolean | undefined} */\n let seen\n return domainInside\n\n /**\n * In domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^^^^^^^^^^\n * ```\n *\n * @type {State}\n */\n function domainInside(code) {\n // Check whether this marker, which is a trailing punctuation\n // marker, optionally followed by more trailing markers, and then\n // followed by an end.\n if (code === 46 || code === 95) {\n return effects.check(trail, domainAfter, domainAtPunctuation)(code)\n }\n\n // GH documents that only alphanumerics (other than `-`, `.`, and `_`) can\n // occur, which sounds like ASCII only, but they also support `www.點看.com`,\n // so that’s Unicode.\n // Instead of some new production for Unicode alphanumerics, markdown\n // already has that for Unicode punctuation and whitespace, so use those.\n // Source: .\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code) ||\n (code !== 45 && unicodePunctuation(code))\n ) {\n return domainAfter(code)\n }\n seen = true\n effects.consume(code)\n return domainInside\n }\n\n /**\n * In domain, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function domainAtPunctuation(code) {\n // There is an underscore in the last segment of the domain\n if (code === 95) {\n underscoreInLastSegment = true\n }\n // Otherwise, it’s a `.`: save the last segment underscore in the\n // penultimate segment slot.\n else {\n underscoreInLastLastSegment = underscoreInLastSegment\n underscoreInLastSegment = undefined\n }\n effects.consume(code)\n return domainInside\n }\n\n /**\n * After domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^\n * ```\n *\n * @type {State} */\n function domainAfter(code) {\n // Note: that’s GH says a dot is needed, but it’s not true:\n // \n if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) {\n return nok(code)\n }\n return ok(code)\n }\n}\n\n/**\n * Path.\n *\n * ```markdown\n * > | a https://example.org/stuff b\n * ^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePath(effects, ok) {\n let sizeOpen = 0\n let sizeClose = 0\n return pathInside\n\n /**\n * In path.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^\n * ```\n *\n * @type {State}\n */\n function pathInside(code) {\n if (code === 40) {\n sizeOpen++\n effects.consume(code)\n return pathInside\n }\n\n // To do: `markdown-rs` also needs this.\n // If this is a paren, and there are less closings than openings,\n // we don’t check for a trail.\n if (code === 41 && sizeClose < sizeOpen) {\n return pathAtPunctuation(code)\n }\n\n // Check whether this trailing punctuation marker is optionally\n // followed by more trailing markers, and then followed\n // by an end.\n if (\n code === 33 ||\n code === 34 ||\n code === 38 ||\n code === 39 ||\n code === 41 ||\n code === 42 ||\n code === 44 ||\n code === 46 ||\n code === 58 ||\n code === 59 ||\n code === 60 ||\n code === 63 ||\n code === 93 ||\n code === 95 ||\n code === 126\n ) {\n return effects.check(trail, ok, pathAtPunctuation)(code)\n }\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return ok(code)\n }\n effects.consume(code)\n return pathInside\n }\n\n /**\n * In path, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com/a\"b\n * ^\n * ```\n *\n * @type {State}\n */\n function pathAtPunctuation(code) {\n // Count closing parens.\n if (code === 41) {\n sizeClose++\n }\n effects.consume(code)\n return pathInside\n }\n}\n\n/**\n * Trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the entire trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | https://example.com\").\n * ^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTrail(effects, ok, nok) {\n return trail\n\n /**\n * In trail of domain or path.\n *\n * ```markdown\n * > | https://example.com\").\n * ^\n * ```\n *\n * @type {State}\n */\n function trail(code) {\n // Regular trailing punctuation.\n if (\n code === 33 ||\n code === 34 ||\n code === 39 ||\n code === 41 ||\n code === 42 ||\n code === 44 ||\n code === 46 ||\n code === 58 ||\n code === 59 ||\n code === 63 ||\n code === 95 ||\n code === 126\n ) {\n effects.consume(code)\n return trail\n }\n\n // `&` followed by one or more alphabeticals and then a `;`, is\n // as a whole considered as trailing punctuation.\n // In all other cases, it is considered as continuation of the URL.\n if (code === 38) {\n effects.consume(code)\n return trailCharRefStart\n }\n\n // Needed because we allow literals after `[`, as we fix:\n // .\n // Check that it is not followed by `(` or `[`.\n if (code === 93) {\n effects.consume(code)\n return trailBracketAfter\n }\n if (\n // `<` is an end.\n code === 60 ||\n // So is whitespace.\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return ok(code)\n }\n return nok(code)\n }\n\n /**\n * In trail, after `]`.\n *\n * > 👉 **Note**: this deviates from `cmark-gfm` to fix a bug.\n * > See end of for more.\n *\n * ```markdown\n * > | https://example.com](\n * ^\n * ```\n *\n * @type {State}\n */\n function trailBracketAfter(code) {\n // Whitespace or something that could start a resource or reference is the end.\n // Switch back to trail otherwise.\n if (\n code === null ||\n code === 40 ||\n code === 91 ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return ok(code)\n }\n return trail(code)\n }\n\n /**\n * In character-reference like trail, after `&`.\n *\n * ```markdown\n * > | https://example.com&).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharRefStart(code) {\n // When non-alpha, it’s not a trail.\n return asciiAlpha(code) ? trailCharRefInside(code) : nok(code)\n }\n\n /**\n * In character-reference like trail.\n *\n * ```markdown\n * > | https://example.com&).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharRefInside(code) {\n // Switch back to trail if this is well-formed.\n if (code === 59) {\n effects.consume(code)\n return trail\n }\n if (asciiAlpha(code)) {\n effects.consume(code)\n return trailCharRefInside\n }\n\n // It’s not a trail.\n return nok(code)\n }\n}\n\n/**\n * Dot in email domain trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | contact@example.org.\n * ^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailDomainDotTrail(effects, ok, nok) {\n return start\n\n /**\n * Dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Must be dot.\n effects.consume(code)\n return after\n }\n\n /**\n * After dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Not a trail if alphanumeric.\n return asciiAlphanumeric(code) ? nok(code) : ok(code)\n }\n}\n\n/**\n * See:\n * .\n *\n * @type {Previous}\n */\nfunction previousWww(code) {\n return (\n code === null ||\n code === 40 ||\n code === 42 ||\n code === 95 ||\n code === 91 ||\n code === 93 ||\n code === 126 ||\n markdownLineEndingOrSpace(code)\n )\n}\n\n/**\n * See:\n * .\n *\n * @type {Previous}\n */\nfunction previousProtocol(code) {\n return !asciiAlpha(code)\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Previous}\n */\nfunction previousEmail(code) {\n // Do not allow a slash “inside” atext.\n // The reference code is a bit weird, but that’s what it results in.\n // Source: .\n // Other than slash, every preceding character is allowed.\n return !(code === 47 || gfmAtext(code))\n}\n\n/**\n * @param {Code} code\n * @returns {boolean}\n */\nfunction gfmAtext(code) {\n return (\n code === 43 ||\n code === 45 ||\n code === 46 ||\n code === 95 ||\n asciiAlphanumeric(code)\n )\n}\n\n/**\n * @param {Array} events\n * @returns {boolean}\n */\nfunction previousUnbalanced(events) {\n let index = events.length\n let result = false\n while (index--) {\n const token = events[index][1]\n if (\n (token.type === 'labelLink' || token.type === 'labelImage') &&\n !token._balanced\n ) {\n result = true\n break\n }\n\n // If we’ve seen this token, and it was marked as not having any unbalanced\n // bracket before it, we can exit.\n if (token._gfmAutolinkLiteralWalkedInto) {\n result = false\n break\n }\n }\n if (events.length > 0 && !result) {\n // Mark the last token as “walked into” w/o finding\n // anything.\n events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true\n }\n return result\n}\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Exiter} Exiter\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {blankLine} from 'micromark-core-commonmark'\nimport {factorySpace} from 'micromark-factory-space'\nimport {markdownLineEndingOrSpace} from 'micromark-util-character'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\nconst indent = {\n tokenize: tokenizeIndent,\n partial: true\n}\n\n// To do: micromark should support a `_hiddenGfmFootnoteSupport`, which only\n// affects label start (image).\n// That will let us drop `tokenizePotentialGfmFootnote*`.\n// It currently has a `_hiddenFootnoteSupport`, which affects that and more.\n// That can be removed when `micromark-extension-footnote` is archived.\n\n/**\n * Create an extension for `micromark` to enable GFM footnote syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to\n * enable GFM footnote syntax.\n */\nexport function gfmFootnote() {\n /** @type {Extension} */\n return {\n document: {\n [91]: {\n tokenize: tokenizeDefinitionStart,\n continuation: {\n tokenize: tokenizeDefinitionContinuation\n },\n exit: gfmFootnoteDefinitionEnd\n }\n },\n text: {\n [91]: {\n tokenize: tokenizeGfmFootnoteCall\n },\n [93]: {\n add: 'after',\n tokenize: tokenizePotentialGfmFootnoteCall,\n resolveTo: resolveToPotentialGfmFootnoteCall\n }\n }\n }\n}\n\n// To do: remove after micromark update.\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePotentialGfmFootnoteCall(effects, ok, nok) {\n const self = this\n let index = self.events.length\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])\n /** @type {Token} */\n let labelStart\n\n // Find an opening.\n while (index--) {\n const token = self.events[index][1]\n if (token.type === 'labelImage') {\n labelStart = token\n break\n }\n\n // Exit if we’ve walked far enough.\n if (\n token.type === 'gfmFootnoteCall' ||\n token.type === 'labelLink' ||\n token.type === 'label' ||\n token.type === 'image' ||\n token.type === 'link'\n ) {\n break\n }\n }\n return start\n\n /**\n * @type {State}\n */\n function start(code) {\n if (!labelStart || !labelStart._balanced) {\n return nok(code)\n }\n const id = normalizeIdentifier(\n self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })\n )\n if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) {\n return nok(code)\n }\n effects.enter('gfmFootnoteCallLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallLabelMarker')\n return ok(code)\n }\n}\n\n// To do: remove after micromark update.\n/** @type {Resolver} */\nfunction resolveToPotentialGfmFootnoteCall(events, context) {\n let index = events.length\n /** @type {Token | undefined} */\n let labelStart\n\n // Find an opening.\n while (index--) {\n if (\n events[index][1].type === 'labelImage' &&\n events[index][0] === 'enter'\n ) {\n labelStart = events[index][1]\n break\n }\n }\n // Change the `labelImageMarker` to a `data`.\n events[index + 1][1].type = 'data'\n events[index + 3][1].type = 'gfmFootnoteCallLabelMarker'\n\n // The whole (without `!`):\n /** @type {Token} */\n const call = {\n type: 'gfmFootnoteCall',\n start: Object.assign({}, events[index + 3][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n }\n // The `^` marker\n /** @type {Token} */\n const marker = {\n type: 'gfmFootnoteCallMarker',\n start: Object.assign({}, events[index + 3][1].end),\n end: Object.assign({}, events[index + 3][1].end)\n }\n // Increment the end 1 character.\n marker.end.column++\n marker.end.offset++\n marker.end._bufferIndex++\n /** @type {Token} */\n const string = {\n type: 'gfmFootnoteCallString',\n start: Object.assign({}, marker.end),\n end: Object.assign({}, events[events.length - 1][1].start)\n }\n /** @type {Token} */\n const chunk = {\n type: 'chunkString',\n contentType: 'string',\n start: Object.assign({}, string.start),\n end: Object.assign({}, string.end)\n }\n\n /** @type {Array} */\n const replacement = [\n // Take the `labelImageMarker` (now `data`, the `!`)\n events[index + 1],\n events[index + 2],\n ['enter', call, context],\n // The `[`\n events[index + 3],\n events[index + 4],\n // The `^`.\n ['enter', marker, context],\n ['exit', marker, context],\n // Everything in between.\n ['enter', string, context],\n ['enter', chunk, context],\n ['exit', chunk, context],\n ['exit', string, context],\n // The ending (`]`, properly parsed and labelled).\n events[events.length - 2],\n events[events.length - 1],\n ['exit', call, context]\n ]\n events.splice(index, events.length - index + 1, ...replacement)\n return events\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeGfmFootnoteCall(effects, ok, nok) {\n const self = this\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])\n let size = 0\n /** @type {boolean} */\n let data\n\n // Note: the implementation of `markdown-rs` is different, because it houses\n // core *and* extensions in one project.\n // Therefore, it can include footnote logic inside `label-end`.\n // We can’t do that, but luckily, we can parse footnotes in a simpler way than\n // needed for labels.\n return start\n\n /**\n * Start of footnote label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteCall')\n effects.enter('gfmFootnoteCallLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallLabelMarker')\n return callStart\n }\n\n /**\n * After `[`, at `^`.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callStart(code) {\n if (code !== 94) return nok(code)\n effects.enter('gfmFootnoteCallMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallMarker')\n effects.enter('gfmFootnoteCallString')\n effects.enter('chunkString').contentType = 'string'\n return callData\n }\n\n /**\n * In label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callData(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n (code === 93 && !data) ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null ||\n code === 91 ||\n markdownLineEndingOrSpace(code)\n ) {\n return nok(code)\n }\n if (code === 93) {\n effects.exit('chunkString')\n const token = effects.exit('gfmFootnoteCallString')\n if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {\n return nok(code)\n }\n effects.enter('gfmFootnoteCallLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteCallLabelMarker')\n effects.exit('gfmFootnoteCall')\n return ok\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true\n }\n size++\n effects.consume(code)\n return code === 92 ? callEscape : callData\n }\n\n /**\n * On character after escape.\n *\n * ```markdown\n * > | a [^b\\c] d\n * ^\n * ```\n *\n * @type {State}\n */\n function callEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code)\n size++\n return callData\n }\n return callData(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionStart(effects, ok, nok) {\n const self = this\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])\n /** @type {string} */\n let identifier\n let size = 0\n /** @type {boolean | undefined} */\n let data\n return start\n\n /**\n * Start of GFM footnote definition.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteDefinition')._container = true\n effects.enter('gfmFootnoteDefinitionLabel')\n effects.enter('gfmFootnoteDefinitionLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteDefinitionLabelMarker')\n return labelAtMarker\n }\n\n /**\n * In label, at caret.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAtMarker(code) {\n if (code === 94) {\n effects.enter('gfmFootnoteDefinitionMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteDefinitionMarker')\n effects.enter('gfmFootnoteDefinitionLabelString')\n effects.enter('chunkString').contentType = 'string'\n return labelInside\n }\n return nok(code)\n }\n\n /**\n * In label.\n *\n * > 👉 **Note**: `cmark-gfm` prevents whitespace from occurring in footnote\n * > definition labels.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelInside(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n (code === 93 && !data) ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null ||\n code === 91 ||\n markdownLineEndingOrSpace(code)\n ) {\n return nok(code)\n }\n if (code === 93) {\n effects.exit('chunkString')\n const token = effects.exit('gfmFootnoteDefinitionLabelString')\n identifier = normalizeIdentifier(self.sliceSerialize(token))\n effects.enter('gfmFootnoteDefinitionLabelMarker')\n effects.consume(code)\n effects.exit('gfmFootnoteDefinitionLabelMarker')\n effects.exit('gfmFootnoteDefinitionLabel')\n return labelAfter\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true\n }\n size++\n effects.consume(code)\n return code === 92 ? labelEscape : labelInside\n }\n\n /**\n * After `\\`, at a special character.\n *\n * > 👉 **Note**: `cmark-gfm` currently does not support escaped brackets:\n * > \n *\n * ```markdown\n * > | [^a\\*b]: c\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code)\n size++\n return labelInside\n }\n return labelInside(code)\n }\n\n /**\n * After definition label.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAfter(code) {\n if (code === 58) {\n effects.enter('definitionMarker')\n effects.consume(code)\n effects.exit('definitionMarker')\n if (!defined.includes(identifier)) {\n defined.push(identifier)\n }\n\n // Any whitespace after the marker is eaten, forming indented code\n // is not possible.\n // No space is also fine, just like a block quote marker.\n return factorySpace(\n effects,\n whitespaceAfter,\n 'gfmFootnoteDefinitionWhitespace'\n )\n }\n return nok(code)\n }\n\n /**\n * After definition prefix.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function whitespaceAfter(code) {\n // `markdown-rs` has a wrapping token for the prefix that is closed here.\n return ok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionContinuation(effects, ok, nok) {\n /// Start of footnote definition continuation.\n ///\n /// ```markdown\n /// | [^a]: b\n /// > | c\n /// ^\n /// ```\n //\n // Either a blank line, which is okay, or an indented thing.\n return effects.check(blankLine, ok, effects.attempt(indent, ok, nok))\n}\n\n/** @type {Exiter} */\nfunction gfmFootnoteDefinitionEnd(effects) {\n effects.exit('gfmFootnoteDefinition')\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this\n return factorySpace(\n effects,\n afterPrefix,\n 'gfmFootnoteDefinitionIndent',\n 4 + 1\n )\n\n /**\n * @type {State}\n */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1]\n return tail &&\n tail[1].type === 'gfmFootnoteDefinitionIndent' &&\n tail[2].sliceSerialize(tail[1], true).length === 4\n ? ok(code)\n : nok(code)\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n *\n * @typedef Options\n * Configuration (optional).\n * @property {boolean | null | undefined} [singleTilde=true]\n * Whether to support strikethrough with a single tilde (default: `true`).\n *\n * Single tildes work on github.com, but are technically prohibited by the\n * GFM spec.\n */\n\nimport {splice} from 'micromark-util-chunked'\nimport {classifyCharacter} from 'micromark-util-classify-character'\nimport {resolveAll} from 'micromark-util-resolve-all'\n/**\n * Create an extension for `micromark` to enable GFM strikethrough syntax.\n *\n * @param {Options | null | undefined} [options={}]\n * Configuration.\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions`, to\n * enable GFM strikethrough syntax.\n */\nexport function gfmStrikethrough(options) {\n const options_ = options || {}\n let single = options_.singleTilde\n const tokenizer = {\n tokenize: tokenizeStrikethrough,\n resolveAll: resolveAllStrikethrough\n }\n if (single === null || single === undefined) {\n single = true\n }\n return {\n text: {\n [126]: tokenizer\n },\n insideSpan: {\n null: [tokenizer]\n },\n attentionMarkers: {\n null: [126]\n }\n }\n\n /**\n * Take events and resolve strikethrough.\n *\n * @type {Resolver}\n */\n function resolveAllStrikethrough(events, context) {\n let index = -1\n\n // Walk through all events.\n while (++index < events.length) {\n // Find a token that can close.\n if (\n events[index][0] === 'enter' &&\n events[index][1].type === 'strikethroughSequenceTemporary' &&\n events[index][1]._close\n ) {\n let open = index\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (\n events[open][0] === 'exit' &&\n events[open][1].type === 'strikethroughSequenceTemporary' &&\n events[open][1]._open &&\n // If the sizes are the same:\n events[index][1].end.offset - events[index][1].start.offset ===\n events[open][1].end.offset - events[open][1].start.offset\n ) {\n events[index][1].type = 'strikethroughSequence'\n events[open][1].type = 'strikethroughSequence'\n\n /** @type {Token} */\n const strikethrough = {\n type: 'strikethrough',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[index][1].end)\n }\n\n /** @type {Token} */\n const text = {\n type: 'strikethroughText',\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n }\n\n // Opening.\n /** @type {Array} */\n const nextEvents = [\n ['enter', strikethrough, context],\n ['enter', events[open][1], context],\n ['exit', events[open][1], context],\n ['enter', text, context]\n ]\n const insideSpan = context.parser.constructs.insideSpan.null\n if (insideSpan) {\n // Between.\n splice(\n nextEvents,\n nextEvents.length,\n 0,\n resolveAll(insideSpan, events.slice(open + 1, index), context)\n )\n }\n\n // Closing.\n splice(nextEvents, nextEvents.length, 0, [\n ['exit', text, context],\n ['enter', events[index][1], context],\n ['exit', events[index][1], context],\n ['exit', strikethrough, context]\n ])\n splice(events, open - 1, index - open + 3, nextEvents)\n index = open + nextEvents.length - 2\n break\n }\n }\n }\n }\n index = -1\n while (++index < events.length) {\n if (events[index][1].type === 'strikethroughSequenceTemporary') {\n events[index][1].type = 'data'\n }\n }\n return events\n }\n\n /**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\n function tokenizeStrikethrough(effects, ok, nok) {\n const previous = this.previous\n const events = this.events\n let size = 0\n return start\n\n /** @type {State} */\n function start(code) {\n if (\n previous === 126 &&\n events[events.length - 1][1].type !== 'characterEscape'\n ) {\n return nok(code)\n }\n effects.enter('strikethroughSequenceTemporary')\n return more(code)\n }\n\n /** @type {State} */\n function more(code) {\n const before = classifyCharacter(previous)\n if (code === 126) {\n // If this is the third marker, exit.\n if (size > 1) return nok(code)\n effects.consume(code)\n size++\n return more\n }\n if (size < 2 && !single) return nok(code)\n const token = effects.exit('strikethroughSequenceTemporary')\n const after = classifyCharacter(code)\n token._open = !after || (after === 2 && Boolean(before))\n token._close = !before || (before === 2 && Boolean(after))\n return ok(code)\n }\n }\n}\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n */\n\n// Port of `edit_map.rs` from `markdown-rs`.\n// This should move to `markdown-js` later.\n\n// Deal with several changes in events, batching them together.\n//\n// Preferably, changes should be kept to a minimum.\n// Sometimes, it’s needed to change the list of events, because parsing can be\n// messy, and it helps to expose a cleaner interface of events to the compiler\n// and other users.\n// It can also help to merge many adjacent similar events.\n// And, in other cases, it’s needed to parse subcontent: pass some events\n// through another tokenizer and inject the result.\n\n/**\n * @typedef {[number, number, Array]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n */\n constructor() {\n /**\n * Record of changes.\n *\n * @type {Array}\n */\n this.map = []\n }\n\n /**\n * Create an edit: a remove and/or add at a certain place.\n *\n * @param {number} index\n * @param {number} remove\n * @param {Array} add\n * @returns {undefined}\n */\n add(index, remove, add) {\n addImpl(this, index, remove, add)\n }\n\n // To do: add this when moving to `micromark`.\n // /**\n // * Create an edit: but insert `add` before existing additions.\n // *\n // * @param {number} index\n // * @param {number} remove\n // * @param {Array} add\n // * @returns {undefined}\n // */\n // addBefore(index, remove, add) {\n // addImpl(this, index, remove, add, true)\n // }\n\n /**\n * Done, change the events.\n *\n * @param {Array} events\n * @returns {undefined}\n */\n consume(events) {\n this.map.sort(function (a, b) {\n return a[0] - b[0]\n })\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\n if (this.map.length === 0) {\n return\n }\n\n // To do: if links are added in events, like they are in `markdown-rs`,\n // this is needed.\n // // Calculate jumps: where items in the current list move to.\n // /** @type {Array} */\n // const jumps = []\n // let index = 0\n // let addAcc = 0\n // let removeAcc = 0\n // while (index < this.map.length) {\n // const [at, remove, add] = this.map[index]\n // removeAcc += remove\n // addAcc += add.length\n // jumps.push([at, removeAcc, addAcc])\n // index += 1\n // }\n //\n // . shiftLinks(events, jumps)\n\n let index = this.map.length\n /** @type {Array>} */\n const vecs = []\n while (index > 0) {\n index -= 1\n vecs.push(\n events.slice(this.map[index][0] + this.map[index][1]),\n this.map[index][2]\n )\n\n // Truncate rest.\n events.length = this.map[index][0]\n }\n vecs.push([...events])\n events.length = 0\n let slice = vecs.pop()\n while (slice) {\n events.push(...slice)\n slice = vecs.pop()\n }\n\n // Truncate everything.\n this.map.length = 0\n }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * @param {number} at\n * @param {number} remove\n * @param {Array} add\n * @returns {undefined}\n */\nfunction addImpl(editMap, at, remove, add) {\n let index = 0\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\n if (remove === 0 && add.length === 0) {\n return\n }\n while (index < editMap.map.length) {\n if (editMap.map[index][0] === at) {\n editMap.map[index][1] += remove\n\n // To do: before not used by tables, use when moving to micromark.\n // if (before) {\n // add.push(...editMap.map[index][2])\n // editMap.map[index][2] = add\n // } else {\n editMap.map[index][2].push(...add)\n // }\n\n return\n }\n index += 1\n }\n editMap.map.push([at, remove, add])\n}\n\n// /**\n// * Shift `previous` and `next` links according to `jumps`.\n// *\n// * This fixes links in case there are events removed or added between them.\n// *\n// * @param {Array} events\n// * @param {Array} jumps\n// */\n// function shiftLinks(events, jumps) {\n// let jumpIndex = 0\n// let index = 0\n// let add = 0\n// let rm = 0\n\n// while (index < events.length) {\n// const rmCurr = rm\n\n// while (jumpIndex < jumps.length && jumps[jumpIndex][0] <= index) {\n// add = jumps[jumpIndex][2]\n// rm = jumps[jumpIndex][1]\n// jumpIndex += 1\n// }\n\n// // Ignore items that will be removed.\n// if (rm > rmCurr) {\n// index += rm - rmCurr\n// } else {\n// // ?\n// // if let Some(link) = &events[index].link {\n// // if let Some(next) = link.next {\n// // events[next].link.as_mut().unwrap().previous = Some(index + add - rm);\n// // while jumpIndex < jumps.len() && jumps[jumpIndex].0 <= next {\n// // add = jumps[jumpIndex].2;\n// // rm = jumps[jumpIndex].1;\n// // jumpIndex += 1;\n// // }\n// // events[index].link.as_mut().unwrap().next = Some(next + add - rm);\n// // index = next;\n// // continue;\n// // }\n// // }\n// index += 1\n// }\n// }\n// }\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n */\n\n/**\n * @typedef {'center' | 'left' | 'none' | 'right'} Align\n */\n\n/**\n * Figure out the alignment of a GFM table.\n *\n * @param {Readonly>} events\n * List of events.\n * @param {number} index\n * Table enter event.\n * @returns {Array}\n * List of aligns.\n */\nexport function gfmTableAlign(events, index) {\n let inDelimiterRow = false\n /** @type {Array} */\n const align = []\n while (index < events.length) {\n const event = events[index]\n if (inDelimiterRow) {\n if (event[0] === 'enter') {\n // Start of alignment value: set a new column.\n // To do: `markdown-rs` uses `tableDelimiterCellValue`.\n if (event[1].type === 'tableContent') {\n align.push(\n events[index + 1][1].type === 'tableDelimiterMarker'\n ? 'left'\n : 'none'\n )\n }\n }\n // Exits:\n // End of alignment value: change the column.\n // To do: `markdown-rs` uses `tableDelimiterCellValue`.\n else if (event[1].type === 'tableContent') {\n if (events[index - 1][1].type === 'tableDelimiterMarker') {\n const alignIndex = align.length - 1\n align[alignIndex] = align[alignIndex] === 'left' ? 'center' : 'right'\n }\n }\n // Done!\n else if (event[1].type === 'tableDelimiterRow') {\n break\n }\n } else if (event[0] === 'enter' && event[1].type === 'tableDelimiterRow') {\n inDelimiterRow = true\n }\n index += 1\n }\n return align\n}\n","/**\n * @typedef {import('micromark-util-types').Event} Event\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Point} Point\n * @typedef {import('micromark-util-types').Resolver} Resolver\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').Token} Token\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\n/**\n * @typedef {[number, number, number, number]} Range\n * Cell info.\n *\n * @typedef {0 | 1 | 2 | 3} RowKind\n * Where we are: `1` for head row, `2` for delimiter row, `3` for body row.\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n markdownLineEnding,\n markdownLineEndingOrSpace,\n markdownSpace\n} from 'micromark-util-character'\nimport {EditMap} from './edit-map.js'\nimport {gfmTableAlign} from './infer.js'\n\n/**\n * Create an HTML extension for `micromark` to support GitHub tables syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * table syntax.\n */\nexport function gfmTable() {\n return {\n flow: {\n null: {\n tokenize: tokenizeTable,\n resolveAll: resolveTable\n }\n }\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTable(effects, ok, nok) {\n const self = this\n let size = 0\n let sizeB = 0\n /** @type {boolean | undefined} */\n let seen\n return start\n\n /**\n * Start of a GFM table.\n *\n * If there is a valid table row or table head before, then we try to parse\n * another row.\n * Otherwise, we try to parse a head.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * > | | b |\n * ^\n * ```\n * @type {State}\n */\n function start(code) {\n let index = self.events.length - 1\n while (index > -1) {\n const type = self.events[index][1].type\n if (\n type === 'lineEnding' ||\n // Note: markdown-rs uses `whitespace` instead of `linePrefix`\n type === 'linePrefix'\n )\n index--\n else break\n }\n const tail = index > -1 ? self.events[index][1].type : null\n const next =\n tail === 'tableHead' || tail === 'tableRow' ? bodyRowStart : headRowBefore\n\n // Don’t allow lazy body rows.\n if (next === bodyRowStart && self.parser.lazy[self.now().line]) {\n return nok(code)\n }\n return next(code)\n }\n\n /**\n * Before table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBefore(code) {\n effects.enter('tableHead')\n effects.enter('tableRow')\n return headRowStart(code)\n }\n\n /**\n * Before table head row, after whitespace.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowStart(code) {\n if (code === 124) {\n return headRowBreak(code)\n }\n\n // To do: micromark-js should let us parse our own whitespace in extensions,\n // like `markdown-rs`:\n //\n // ```js\n // // 4+ spaces.\n // if (markdownSpace(code)) {\n // return nok(code)\n // }\n // ```\n\n seen = true\n // Count the first character, that isn’t a pipe, double.\n sizeB += 1\n return headRowBreak(code)\n }\n\n /**\n * At break in table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * ^\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBreak(code) {\n if (code === null) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code)\n }\n if (markdownLineEnding(code)) {\n // If anything other than one pipe (ignoring whitespace) was used, it’s fine.\n if (sizeB > 1) {\n sizeB = 0\n // To do: check if this works.\n // Feel free to interrupt:\n self.interrupt = true\n effects.exit('tableRow')\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return headDelimiterStart\n }\n\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code)\n }\n if (markdownSpace(code)) {\n // To do: check if this is fine.\n // effects.attempt(State::Next(StateName::GfmTableHeadRowBreak), State::Nok)\n // State::Retry(space_or_tab(tokenizer))\n return factorySpace(effects, headRowBreak, 'whitespace')(code)\n }\n sizeB += 1\n if (seen) {\n seen = false\n // Header cell count.\n size += 1\n }\n if (code === 124) {\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n // Whether a delimiter was seen.\n seen = true\n return headRowBreak\n }\n\n // Anything else is cell data.\n effects.enter('data')\n return headRowData(code)\n }\n\n /**\n * In table head row data.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit('data')\n return headRowBreak(code)\n }\n effects.consume(code)\n return code === 92 ? headRowEscape : headRowData\n }\n\n /**\n * In table head row escape.\n *\n * ```markdown\n * > | | a\\-b |\n * ^\n * | | ---- |\n * | | c |\n * ```\n *\n * @type {State}\n */\n function headRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code)\n return headRowData\n }\n return headRowData(code)\n }\n\n /**\n * Before delimiter row.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterStart(code) {\n // Reset `interrupt`.\n self.interrupt = false\n\n // Note: in `markdown-rs`, we need to handle piercing here too.\n if (self.parser.lazy[self.now().line]) {\n return nok(code)\n }\n effects.enter('tableDelimiterRow')\n // Track if we’ve seen a `:` or `|`.\n seen = false\n if (markdownSpace(code)) {\n return factorySpace(\n effects,\n headDelimiterBefore,\n 'linePrefix',\n self.parser.constructs.disable.null.includes('codeIndented')\n ? undefined\n : 4\n )(code)\n }\n return headDelimiterBefore(code)\n }\n\n /**\n * Before delimiter row, after optional whitespace.\n *\n * Reused when a `|` is found later, to parse another cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterBefore(code) {\n if (code === 45 || code === 58) {\n return headDelimiterValueBefore(code)\n }\n if (code === 124) {\n seen = true\n // If we start with a pipe, we open a cell marker.\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n return headDelimiterCellBefore\n }\n\n // More whitespace / empty row not allowed at start.\n return headDelimiterNok(code)\n }\n\n /**\n * After `|`, before delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellBefore(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterValueBefore, 'whitespace')(code)\n }\n return headDelimiterValueBefore(code)\n }\n\n /**\n * Before delimiter cell value.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterValueBefore(code) {\n // Align: left.\n if (code === 58) {\n sizeB += 1\n seen = true\n effects.enter('tableDelimiterMarker')\n effects.consume(code)\n effects.exit('tableDelimiterMarker')\n return headDelimiterLeftAlignmentAfter\n }\n\n // Align: none.\n if (code === 45) {\n sizeB += 1\n // To do: seems weird that this *isn’t* left aligned, but that state is used?\n return headDelimiterLeftAlignmentAfter(code)\n }\n if (code === null || markdownLineEnding(code)) {\n return headDelimiterCellAfter(code)\n }\n return headDelimiterNok(code)\n }\n\n /**\n * After delimiter cell left alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | :- |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterLeftAlignmentAfter(code) {\n if (code === 45) {\n effects.enter('tableDelimiterFiller')\n return headDelimiterFiller(code)\n }\n\n // Anything else is not ok after the left-align colon.\n return headDelimiterNok(code)\n }\n\n /**\n * In delimiter cell filler.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterFiller(code) {\n if (code === 45) {\n effects.consume(code)\n return headDelimiterFiller\n }\n\n // Align is `center` if it was `left`, `right` otherwise.\n if (code === 58) {\n seen = true\n effects.exit('tableDelimiterFiller')\n effects.enter('tableDelimiterMarker')\n effects.consume(code)\n effects.exit('tableDelimiterMarker')\n return headDelimiterRightAlignmentAfter\n }\n effects.exit('tableDelimiterFiller')\n return headDelimiterRightAlignmentAfter(code)\n }\n\n /**\n * After delimiter cell right alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterRightAlignmentAfter(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterCellAfter, 'whitespace')(code)\n }\n return headDelimiterCellAfter(code)\n }\n\n /**\n * After delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellAfter(code) {\n if (code === 124) {\n return headDelimiterBefore(code)\n }\n if (code === null || markdownLineEnding(code)) {\n // Exit when:\n // * there was no `:` or `|` at all (it’s a thematic break or setext\n // underline instead)\n // * the header cell count is not the delimiter cell count\n if (!seen || size !== sizeB) {\n return headDelimiterNok(code)\n }\n\n // Note: in markdown-rs`, a reset is needed here.\n effects.exit('tableDelimiterRow')\n effects.exit('tableHead')\n // To do: in `markdown-rs`, resolvers need to be registered manually.\n // effects.register_resolver(ResolveName::GfmTable)\n return ok(code)\n }\n return headDelimiterNok(code)\n }\n\n /**\n * In delimiter row, at a disallowed byte.\n *\n * ```markdown\n * | | a |\n * > | | x |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterNok(code) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code)\n }\n\n /**\n * Before table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowStart(code) {\n // Note: in `markdown-rs` we need to manually take care of a prefix,\n // but in `micromark-js` that is done for us, so if we’re here, we’re\n // never at whitespace.\n effects.enter('tableRow')\n return bodyRowBreak(code)\n }\n\n /**\n * At break in table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ^\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowBreak(code) {\n if (code === 124) {\n effects.enter('tableCellDivider')\n effects.consume(code)\n effects.exit('tableCellDivider')\n return bodyRowBreak\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit('tableRow')\n return ok(code)\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, bodyRowBreak, 'whitespace')(code)\n }\n\n // Anything else is cell content.\n effects.enter('data')\n return bodyRowData(code)\n }\n\n /**\n * In table body row data.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit('data')\n return bodyRowBreak(code)\n }\n effects.consume(code)\n return code === 92 ? bodyRowEscape : bodyRowData\n }\n\n /**\n * In table body row escape.\n *\n * ```markdown\n * | | a |\n * | | ---- |\n * > | | b\\-c |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code)\n return bodyRowData\n }\n return bodyRowData(code)\n }\n}\n\n/** @type {Resolver} */\n\nfunction resolveTable(events, context) {\n let index = -1\n let inFirstCellAwaitingPipe = true\n /** @type {RowKind} */\n let rowKind = 0\n /** @type {Range} */\n let lastCell = [0, 0, 0, 0]\n /** @type {Range} */\n let cell = [0, 0, 0, 0]\n let afterHeadAwaitingFirstBodyRow = false\n let lastTableEnd = 0\n /** @type {Token | undefined} */\n let currentTable\n /** @type {Token | undefined} */\n let currentBody\n /** @type {Token | undefined} */\n let currentCell\n const map = new EditMap()\n while (++index < events.length) {\n const event = events[index]\n const token = event[1]\n if (event[0] === 'enter') {\n // Start of head.\n if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = false\n\n // Inject previous (body end and) table end.\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody)\n currentBody = undefined\n lastTableEnd = 0\n }\n\n // Inject table start.\n currentTable = {\n type: 'table',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n }\n map.add(index, 0, [['enter', currentTable, context]])\n } else if (\n token.type === 'tableRow' ||\n token.type === 'tableDelimiterRow'\n ) {\n inFirstCellAwaitingPipe = true\n currentCell = undefined\n lastCell = [0, 0, 0, 0]\n cell = [0, index + 1, 0, 0]\n\n // Inject table body start.\n if (afterHeadAwaitingFirstBodyRow) {\n afterHeadAwaitingFirstBodyRow = false\n currentBody = {\n type: 'tableBody',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n }\n map.add(index, 0, [['enter', currentBody, context]])\n }\n rowKind = token.type === 'tableDelimiterRow' ? 2 : currentBody ? 3 : 1\n }\n // Cell data.\n else if (\n rowKind &&\n (token.type === 'data' ||\n token.type === 'tableDelimiterMarker' ||\n token.type === 'tableDelimiterFiller')\n ) {\n inFirstCellAwaitingPipe = false\n\n // First value in cell.\n if (cell[2] === 0) {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1]\n currentCell = flushCell(\n map,\n context,\n lastCell,\n rowKind,\n undefined,\n currentCell\n )\n lastCell = [0, 0, 0, 0]\n }\n cell[2] = index\n }\n } else if (token.type === 'tableCellDivider') {\n if (inFirstCellAwaitingPipe) {\n inFirstCellAwaitingPipe = false\n } else {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1]\n currentCell = flushCell(\n map,\n context,\n lastCell,\n rowKind,\n undefined,\n currentCell\n )\n }\n lastCell = cell\n cell = [lastCell[1], index, 0, 0]\n }\n }\n }\n // Exit events.\n else if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = true\n lastTableEnd = index\n } else if (\n token.type === 'tableRow' ||\n token.type === 'tableDelimiterRow'\n ) {\n lastTableEnd = index\n if (lastCell[1] !== 0) {\n cell[0] = cell[1]\n currentCell = flushCell(\n map,\n context,\n lastCell,\n rowKind,\n index,\n currentCell\n )\n } else if (cell[1] !== 0) {\n currentCell = flushCell(map, context, cell, rowKind, index, currentCell)\n }\n rowKind = 0\n } else if (\n rowKind &&\n (token.type === 'data' ||\n token.type === 'tableDelimiterMarker' ||\n token.type === 'tableDelimiterFiller')\n ) {\n cell[3] = index\n }\n }\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody)\n }\n map.consume(context.events)\n\n // To do: move this into `html`, when events are exposed there.\n // That’s what `markdown-rs` does.\n // That needs updates to `mdast-util-gfm-table`.\n index = -1\n while (++index < context.events.length) {\n const event = context.events[index]\n if (event[0] === 'enter' && event[1].type === 'table') {\n event[1]._align = gfmTableAlign(context.events, index)\n }\n }\n return events\n}\n\n/**\n * Generate a cell.\n *\n * @param {EditMap} map\n * @param {Readonly} context\n * @param {Readonly} range\n * @param {RowKind} rowKind\n * @param {number | undefined} rowEnd\n * @param {Token | undefined} previousCell\n * @returns {Token | undefined}\n */\n// eslint-disable-next-line max-params\nfunction flushCell(map, context, range, rowKind, rowEnd, previousCell) {\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCell' : 'tableCell'\n const groupName =\n rowKind === 1\n ? 'tableHeader'\n : rowKind === 2\n ? 'tableDelimiter'\n : 'tableData'\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCellValue' : 'tableCellText'\n const valueName = 'tableContent'\n\n // Insert an exit for the previous cell, if there is one.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[0] !== 0) {\n previousCell.end = Object.assign({}, getPoint(context.events, range[0]))\n map.add(range[0], 0, [['exit', previousCell, context]])\n }\n\n // Insert enter of this cell.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^^^^-- this cell\n // ```\n const now = getPoint(context.events, range[1])\n previousCell = {\n type: groupName,\n start: Object.assign({}, now),\n // Note: correct end is set later.\n end: Object.assign({}, now)\n }\n map.add(range[1], 0, [['enter', previousCell, context]])\n\n // Insert text start at first data start and end at last data end, and\n // remove events between.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[2] !== 0) {\n const relatedStart = getPoint(context.events, range[2])\n const relatedEnd = getPoint(context.events, range[3])\n /** @type {Token} */\n const valueToken = {\n type: valueName,\n start: Object.assign({}, relatedStart),\n end: Object.assign({}, relatedEnd)\n }\n map.add(range[2], 0, [['enter', valueToken, context]])\n if (rowKind !== 2) {\n // Fix positional info on remaining events\n const start = context.events[range[2]]\n const end = context.events[range[3]]\n start[1].end = Object.assign({}, end[1].end)\n start[1].type = 'chunkText'\n start[1].contentType = 'text'\n\n // Remove if needed.\n if (range[3] > range[2] + 1) {\n const a = range[2] + 1\n const b = range[3] - range[2] - 1\n map.add(a, b, [])\n }\n }\n map.add(range[3] + 1, 0, [['exit', valueToken, context]])\n }\n\n // Insert an exit for the last cell, if at the row end.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^^^-- this cell (the last one contains two “between” parts)\n // ```\n if (rowEnd !== undefined) {\n previousCell.end = Object.assign({}, getPoint(context.events, rowEnd))\n map.add(rowEnd, 0, [['exit', previousCell, context]])\n previousCell = undefined\n }\n return previousCell\n}\n\n/**\n * Generate table end (and table body end).\n *\n * @param {Readonly} map\n * @param {Readonly} context\n * @param {number} index\n * @param {Token} table\n * @param {Token | undefined} tableBody\n */\n// eslint-disable-next-line max-params\nfunction flushTableEnd(map, context, index, table, tableBody) {\n /** @type {Array} */\n const exits = []\n const related = getPoint(context.events, index)\n if (tableBody) {\n tableBody.end = Object.assign({}, related)\n exits.push(['exit', tableBody, context])\n }\n table.end = Object.assign({}, related)\n exits.push(['exit', table, context])\n map.add(index + 1, 0, exits)\n}\n\n/**\n * @param {Readonly>} events\n * @param {number} index\n * @returns {Readonly}\n */\nfunction getPoint(events, index) {\n const event = events[index]\n const side = event[0] === 'enter' ? 'start' : 'end'\n return event[1][side]\n}\n","/**\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').State} State\n * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext\n * @typedef {import('micromark-util-types').Tokenizer} Tokenizer\n */\n\nimport {factorySpace} from 'micromark-factory-space'\nimport {\n markdownLineEnding,\n markdownLineEndingOrSpace,\n markdownSpace\n} from 'micromark-util-character'\nconst tasklistCheck = {\n tokenize: tokenizeTasklistCheck\n}\n\n/**\n * Create an HTML extension for `micromark` to support GFM task list items\n * syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `htmlExtensions` to\n * support GFM task list items when serializing to HTML.\n */\nexport function gfmTaskListItem() {\n return {\n text: {\n [91]: tasklistCheck\n }\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTasklistCheck(effects, ok, nok) {\n const self = this\n return open\n\n /**\n * At start of task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (\n // Exit if there’s stuff before.\n self.previous !== null ||\n // Exit if not in the first content that is the first child of a list\n // item.\n !self._gfmTasklistFirstContentOfListItem\n ) {\n return nok(code)\n }\n effects.enter('taskListCheck')\n effects.enter('taskListCheckMarker')\n effects.consume(code)\n effects.exit('taskListCheckMarker')\n return inside\n }\n\n /**\n * In task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // Currently we match how GH works in files.\n // To match how GH works in comments, use `markdownSpace` (`[\\t ]`) instead\n // of `markdownLineEndingOrSpace` (`[\\t\\n\\r ]`).\n if (markdownLineEndingOrSpace(code)) {\n effects.enter('taskListCheckValueUnchecked')\n effects.consume(code)\n effects.exit('taskListCheckValueUnchecked')\n return close\n }\n if (code === 88 || code === 120) {\n effects.enter('taskListCheckValueChecked')\n effects.consume(code)\n effects.exit('taskListCheckValueChecked')\n return close\n }\n return nok(code)\n }\n\n /**\n * At close of task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function close(code) {\n if (code === 93) {\n effects.enter('taskListCheckMarker')\n effects.consume(code)\n effects.exit('taskListCheckMarker')\n effects.exit('taskListCheck')\n return after\n }\n return nok(code)\n }\n\n /**\n * @type {State}\n */\n function after(code) {\n // EOL in paragraph means there must be something else after it.\n if (markdownLineEnding(code)) {\n return ok(code)\n }\n\n // Space or tab?\n // Check what comes after.\n if (markdownSpace(code)) {\n return effects.check(\n {\n tokenize: spaceThenNonSpace\n },\n ok,\n nok\n )(code)\n }\n\n // EOF, or non-whitespace, both wrong.\n return nok(code)\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction spaceThenNonSpace(effects, ok, nok) {\n return factorySpace(effects, after, 'whitespace')\n\n /**\n * After whitespace, after task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // EOF means there was nothing, so bad.\n // EOL means there’s content after it, so good.\n // Impossible to have more spaces.\n // Anything else is good.\n return code === null ? nok(code) : ok(code)\n }\n}\n","/// \n/// \n\n/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast-util-gfm').Options} MdastOptions\n * @typedef {import('micromark-extension-gfm').Options} MicromarkOptions\n * @typedef {import('unified').Processor} Processor\n */\n\n/**\n * @typedef {MicromarkOptions & MdastOptions} Options\n * Configuration.\n */\n\nimport {gfmFromMarkdown, gfmToMarkdown} from 'mdast-util-gfm'\nimport {gfm} from 'micromark-extension-gfm'\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Add support GFM (autolink literals, footnotes, strikethrough, tables,\n * tasklists).\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {undefined}\n * Nothing.\n */\nexport default function remarkGfm(options) {\n // @ts-expect-error: TS is wrong about `this`.\n // eslint-disable-next-line unicorn/no-this-assignment\n const self = /** @type {Processor} */ (this)\n const settings = options || emptyOptions\n const data = self.data()\n\n const micromarkExtensions =\n data.micromarkExtensions || (data.micromarkExtensions = [])\n const fromMarkdownExtensions =\n data.fromMarkdownExtensions || (data.fromMarkdownExtensions = [])\n const toMarkdownExtensions =\n data.toMarkdownExtensions || (data.toMarkdownExtensions = [])\n\n micromarkExtensions.push(gfm(settings))\n fromMarkdownExtensions.push(gfmFromMarkdown())\n toMarkdownExtensions.push(gfmToMarkdown(settings))\n}\n","/**\n * @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions\n * @typedef {import('micromark-extension-gfm-strikethrough').Options} Options\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension\n */\n\nimport {\n combineExtensions,\n combineHtmlExtensions\n} from 'micromark-util-combine-extensions'\nimport {\n gfmAutolinkLiteral,\n gfmAutolinkLiteralHtml\n} from 'micromark-extension-gfm-autolink-literal'\nimport {gfmFootnote, gfmFootnoteHtml} from 'micromark-extension-gfm-footnote'\nimport {\n gfmStrikethrough,\n gfmStrikethroughHtml\n} from 'micromark-extension-gfm-strikethrough'\nimport {gfmTable, gfmTableHtml} from 'micromark-extension-gfm-table'\nimport {gfmTagfilterHtml} from 'micromark-extension-gfm-tagfilter'\nimport {\n gfmTaskListItem,\n gfmTaskListItemHtml\n} from 'micromark-extension-gfm-task-list-item'\n\n/**\n * Create an extension for `micromark` to enable GFM syntax.\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n *\n * Passed to `micromark-extens-gfm-strikethrough`.\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * syntax.\n */\nexport function gfm(options) {\n return combineExtensions([\n gfmAutolinkLiteral(),\n gfmFootnote(),\n gfmStrikethrough(options),\n gfmTable(),\n gfmTaskListItem()\n ])\n}\n\n/**\n * Create an extension for `micromark` to support GFM when serializing to HTML.\n *\n * @param {HtmlOptions | null | undefined} [options]\n * Configuration (optional).\n *\n * Passed to `micromark-extens-gfm-footnote`.\n * @returns {HtmlExtension}\n * Extension for `micromark` that can be passed in `htmlExtensions` to\n * support GFM when serializing to HTML.\n */\nexport function gfmHtml(options) {\n return combineHtmlExtensions([\n gfmAutolinkLiteralHtml(),\n gfmFootnoteHtml(options),\n gfmStrikethroughHtml(),\n gfmTableHtml(),\n gfmTagfilterHtml(),\n gfmTaskListItemHtml()\n ])\n}\n","/**\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n */\n\n/**\n * @typedef {import('mdast-util-gfm-table').Options} Options\n * Configuration.\n */\n\nimport {\n gfmAutolinkLiteralFromMarkdown,\n gfmAutolinkLiteralToMarkdown\n} from 'mdast-util-gfm-autolink-literal'\nimport {\n gfmFootnoteFromMarkdown,\n gfmFootnoteToMarkdown\n} from 'mdast-util-gfm-footnote'\nimport {\n gfmStrikethroughFromMarkdown,\n gfmStrikethroughToMarkdown\n} from 'mdast-util-gfm-strikethrough'\nimport {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'\nimport {\n gfmTaskListItemFromMarkdown,\n gfmTaskListItemToMarkdown\n} from 'mdast-util-gfm-task-list-item'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM (autolink\n * literals, footnotes, strikethrough, tables, tasklists).\n *\n * @returns {Array}\n * Extension for `mdast-util-from-markdown` to enable GFM (autolink literals,\n * footnotes, strikethrough, tables, tasklists).\n */\nexport function gfmFromMarkdown() {\n return [\n gfmAutolinkLiteralFromMarkdown(),\n gfmFootnoteFromMarkdown(),\n gfmStrikethroughFromMarkdown(),\n gfmTableFromMarkdown(),\n gfmTaskListItemFromMarkdown()\n ]\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM (autolink\n * literals, footnotes, strikethrough, tables, tasklists).\n *\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM (autolink literals,\n * footnotes, strikethrough, tables, tasklists).\n */\nexport function gfmToMarkdown(options) {\n return {\n extensions: [\n gfmAutolinkLiteralToMarkdown(),\n gfmFootnoteToMarkdown(),\n gfmStrikethroughToMarkdown(),\n gfmTableToMarkdown(options),\n gfmTaskListItemToMarkdown()\n ]\n }\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Properties} Properties\n */\n\n/**\n * @template {string} SimpleSelector\n * Selector type.\n * @template {string} DefaultTagName\n * Default tag name.\n * @typedef {(\n * SimpleSelector extends ''\n * ? DefaultTagName\n * : SimpleSelector extends `${infer TagName}.${infer Rest}`\n * ? ExtractTagName\n * : SimpleSelector extends `${infer TagName}#${infer Rest}`\n * ? ExtractTagName\n * : SimpleSelector extends string\n * ? SimpleSelector\n * : DefaultTagName\n * )} ExtractTagName\n * Extract tag name from a simple selector.\n */\n\nconst search = /[#.]/g\n\n/**\n * Create a hast element from a simple CSS selector.\n *\n * @template {string} Selector\n * Type of selector.\n * @template {string} [DefaultTagName='div']\n * Type of default tag name (default: `'div'`).\n * @param {Selector | null | undefined} [selector]\n * Simple CSS selector (optional).\n *\n * Can contain a tag name (`foo`), classes (`.bar`), and an ID (`#baz`).\n * Multiple classes are allowed.\n * Uses the last ID if multiple IDs are found.\n * @param {DefaultTagName | null | undefined} [defaultTagName='div']\n * Tag name to use if `selector` does not specify one (default: `'div'`).\n * @returns {Element & {tagName: ExtractTagName}}\n * Built element.\n */\nexport function parseSelector(selector, defaultTagName) {\n const value = selector || ''\n /** @type {Properties} */\n const props = {}\n let start = 0\n /** @type {string | undefined} */\n let previous\n /** @type {string | undefined} */\n let tagName\n\n while (start < value.length) {\n search.lastIndex = start\n const match = search.exec(value)\n const subvalue = value.slice(start, match ? match.index : value.length)\n\n if (subvalue) {\n if (!previous) {\n tagName = subvalue\n } else if (previous === '#') {\n props.id = subvalue\n } else if (Array.isArray(props.className)) {\n props.className.push(subvalue)\n } else {\n props.className = [subvalue]\n }\n\n start += subvalue.length\n }\n\n if (match) {\n previous = match[0]\n start++\n }\n }\n\n return {\n type: 'element',\n // @ts-expect-error: tag name is parsed.\n tagName: tagName || defaultTagName || 'div',\n properties: props,\n children: []\n }\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Nodes} Nodes\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').RootContent} RootContent\n *\n * @typedef {import('property-information').Info} Info\n * @typedef {import('property-information').Schema} Schema\n */\n\n/**\n * @typedef {Element | Root} Result\n * Result from a `h` (or `s`) call.\n *\n * @typedef {number | string} StyleValue\n * Value for a CSS style field.\n * @typedef {Record} Style\n * Supported value of a `style` prop.\n * @typedef {boolean | number | string | null | undefined} PrimitiveValue\n * Primitive property value.\n * @typedef {Array} ArrayValue\n * List of property values for space- or comma separated values (such as `className`).\n * @typedef {ArrayValue | PrimitiveValue} PropertyValue\n * Primitive value or list value.\n * @typedef {{[property: string]: PropertyValue | Style}} Properties\n * Acceptable value for element properties.\n *\n * @typedef {number | string | null | undefined} PrimitiveChild\n * Primitive children, either ignored (nullish), or turned into text nodes.\n * @typedef {Array} ArrayChild\n * List of children.\n * @typedef {Array} ArrayChildNested\n * List of children (deep).\n * @typedef {ArrayChild | Nodes | PrimitiveChild} Child\n * Acceptable child value.\n */\n\nimport {parse as commas} from 'comma-separated-tokens'\nimport {parseSelector} from 'hast-util-parse-selector'\nimport {find, normalize} from 'property-information'\nimport {parse as spaces} from 'space-separated-tokens'\n\nconst buttonTypes = new Set(['button', 'menu', 'reset', 'submit'])\n\nconst own = {}.hasOwnProperty\n\n/**\n * @param {Schema} schema\n * Schema to use.\n * @param {string} defaultTagName\n * Default tag name.\n * @param {Array | undefined} [caseSensitive]\n * Case-sensitive tag names (default: `undefined`).\n * @returns\n * `h`.\n */\nexport function createH(schema, defaultTagName, caseSensitive) {\n const adjust = caseSensitive && createAdjustMap(caseSensitive)\n\n /**\n * Hyperscript compatible DSL for creating virtual hast trees.\n *\n * @overload\n * @param {null | undefined} [selector]\n * @param {...Child} children\n * @returns {Root}\n *\n * @overload\n * @param {string} selector\n * @param {Properties} properties\n * @param {...Child} children\n * @returns {Element}\n *\n * @overload\n * @param {string} selector\n * @param {...Child} children\n * @returns {Element}\n *\n * @param {string | null | undefined} [selector]\n * Selector.\n * @param {Child | Properties | null | undefined} [properties]\n * Properties (or first child) (default: `undefined`).\n * @param {...Child} children\n * Children.\n * @returns {Result}\n * Result.\n */\n function h(selector, properties, ...children) {\n let index = -1\n /** @type {Result} */\n let node\n\n if (selector === undefined || selector === null) {\n node = {type: 'root', children: []}\n // Properties are not supported for roots.\n const child = /** @type {Child} */ (properties)\n children.unshift(child)\n } else {\n node = parseSelector(selector, defaultTagName)\n // Normalize the name.\n node.tagName = node.tagName.toLowerCase()\n if (adjust && own.call(adjust, node.tagName)) {\n node.tagName = adjust[node.tagName]\n }\n\n // Handle props.\n if (isProperties(properties, node.tagName)) {\n /** @type {string} */\n let key\n\n for (key in properties) {\n if (own.call(properties, key)) {\n addProperty(schema, node.properties, key, properties[key])\n }\n }\n } else {\n children.unshift(properties)\n }\n }\n\n // Handle children.\n while (++index < children.length) {\n addChild(node.children, children[index])\n }\n\n if (node.type === 'element' && node.tagName === 'template') {\n node.content = {type: 'root', children: node.children}\n node.children = []\n }\n\n return node\n }\n\n return h\n}\n\n/**\n * Check if something is properties or a child.\n *\n * @param {Child | Properties} value\n * Value to check.\n * @param {string} name\n * Tag name.\n * @returns {value is Properties}\n * Whether `value` is a properties object.\n */\nfunction isProperties(value, name) {\n if (\n value === null ||\n value === undefined ||\n typeof value !== 'object' ||\n Array.isArray(value)\n ) {\n return false\n }\n\n if (name === 'input' || !value.type || typeof value.type !== 'string') {\n return true\n }\n\n if ('children' in value && Array.isArray(value.children)) {\n return false\n }\n\n if (name === 'button') {\n return buttonTypes.has(value.type.toLowerCase())\n }\n\n return !('value' in value)\n}\n\n/**\n * @param {Schema} schema\n * Schema.\n * @param {Properties} properties\n * Properties object.\n * @param {string} key\n * Property name.\n * @param {PropertyValue | Style} value\n * Property value.\n * @returns {undefined}\n * Nothing.\n */\nfunction addProperty(schema, properties, key, value) {\n const info = find(schema, key)\n let index = -1\n /** @type {PropertyValue} */\n let result\n\n // Ignore nullish and NaN values.\n if (value === undefined || value === null) return\n\n if (typeof value === 'number') {\n // Ignore NaN.\n if (Number.isNaN(value)) return\n\n result = value\n }\n // Booleans.\n else if (typeof value === 'boolean') {\n result = value\n }\n // Handle list values.\n else if (typeof value === 'string') {\n if (info.spaceSeparated) {\n result = spaces(value)\n } else if (info.commaSeparated) {\n result = commas(value)\n } else if (info.commaOrSpaceSeparated) {\n result = spaces(commas(value).join(' '))\n } else {\n result = parsePrimitive(info, info.property, value)\n }\n } else if (Array.isArray(value)) {\n result = value.concat()\n } else {\n result = info.property === 'style' ? style(value) : String(value)\n }\n\n if (Array.isArray(result)) {\n /** @type {Array} */\n const finalResult = []\n\n while (++index < result.length) {\n // Assume no booleans in array.\n const value = /** @type {number | string} */ (\n parsePrimitive(info, info.property, result[index])\n )\n finalResult[index] = value\n }\n\n result = finalResult\n }\n\n // Class names (which can be added both on the `selector` and here).\n if (info.property === 'className' && Array.isArray(properties.className)) {\n // Assume no booleans in `className`.\n const value = /** @type {number | string} */ (result)\n result = properties.className.concat(value)\n }\n\n properties[info.property] = result\n}\n\n/**\n * @param {Array} nodes\n * Children.\n * @param {Child} value\n * Child.\n * @returns {undefined}\n * Nothing.\n */\nfunction addChild(nodes, value) {\n let index = -1\n\n if (value === undefined || value === null) {\n // Empty.\n } else if (typeof value === 'string' || typeof value === 'number') {\n nodes.push({type: 'text', value: String(value)})\n } else if (Array.isArray(value)) {\n while (++index < value.length) {\n addChild(nodes, value[index])\n }\n } else if (typeof value === 'object' && 'type' in value) {\n if (value.type === 'root') {\n addChild(nodes, value.children)\n } else {\n nodes.push(value)\n }\n } else {\n throw new Error('Expected node, nodes, or string, got `' + value + '`')\n }\n}\n\n/**\n * Parse a single primitives.\n *\n * @param {Info} info\n * Property information.\n * @param {string} name\n * Property name.\n * @param {PrimitiveValue} value\n * Property value.\n * @returns {PrimitiveValue}\n * Property value.\n */\nfunction parsePrimitive(info, name, value) {\n if (typeof value === 'string') {\n if (info.number && value && !Number.isNaN(Number(value))) {\n return Number(value)\n }\n\n if (\n (info.boolean || info.overloadedBoolean) &&\n (value === '' || normalize(value) === normalize(name))\n ) {\n return true\n }\n }\n\n return value\n}\n\n/**\n * Serialize a `style` object as a string.\n *\n * @param {Style} value\n * Style object.\n * @returns {string}\n * CSS string.\n */\nfunction style(value) {\n /** @type {Array} */\n const result = []\n /** @type {string} */\n let key\n\n for (key in value) {\n if (own.call(value, key)) {\n result.push([key, value[key]].join(': '))\n }\n }\n\n return result.join('; ')\n}\n\n/**\n * Create a map to adjust casing.\n *\n * @param {Array} values\n * List of properly cased keys.\n * @returns {Record}\n * Map of lowercase keys to uppercase keys.\n */\nfunction createAdjustMap(values) {\n /** @type {Record} */\n const result = {}\n let index = -1\n\n while (++index < values.length) {\n result[values[index].toLowerCase()] = values[index]\n }\n\n return result\n}\n","export const svgCaseSensitiveTagNames = [\n 'altGlyph',\n 'altGlyphDef',\n 'altGlyphItem',\n 'animateColor',\n 'animateMotion',\n 'animateTransform',\n 'clipPath',\n 'feBlend',\n 'feColorMatrix',\n 'feComponentTransfer',\n 'feComposite',\n 'feConvolveMatrix',\n 'feDiffuseLighting',\n 'feDisplacementMap',\n 'feDistantLight',\n 'feDropShadow',\n 'feFlood',\n 'feFuncA',\n 'feFuncB',\n 'feFuncG',\n 'feFuncR',\n 'feGaussianBlur',\n 'feImage',\n 'feMerge',\n 'feMergeNode',\n 'feMorphology',\n 'feOffset',\n 'fePointLight',\n 'feSpecularLighting',\n 'feSpotLight',\n 'feTile',\n 'feTurbulence',\n 'foreignObject',\n 'glyphRef',\n 'linearGradient',\n 'radialGradient',\n 'solidColor',\n 'textArea',\n 'textPath'\n]\n","/**\n * @typedef {import('./create-h.js').Child} Child\n * Acceptable child value.\n * @typedef {import('./create-h.js').Properties} Properties\n * Acceptable value for element properties.\n * @typedef {import('./create-h.js').Result} Result\n * Result from a `h` (or `s`) call.\n */\n\n// Register the JSX namespace on `h`.\n/**\n * @typedef {import('./jsx-classic.js').Element} h.JSX.Element\n * @typedef {import('./jsx-classic.js').ElementChildrenAttribute} h.JSX.ElementChildrenAttribute\n * @typedef {import('./jsx-classic.js').IntrinsicAttributes} h.JSX.IntrinsicAttributes\n * @typedef {import('./jsx-classic.js').IntrinsicElements} h.JSX.IntrinsicElements\n */\n\n// Register the JSX namespace on `s`.\n/**\n * @typedef {import('./jsx-classic.js').Element} s.JSX.Element\n * @typedef {import('./jsx-classic.js').ElementChildrenAttribute} s.JSX.ElementChildrenAttribute\n * @typedef {import('./jsx-classic.js').IntrinsicAttributes} s.JSX.IntrinsicAttributes\n * @typedef {import('./jsx-classic.js').IntrinsicElements} s.JSX.IntrinsicElements\n */\n\nimport {html, svg} from 'property-information'\nimport {createH} from './create-h.js'\nimport {svgCaseSensitiveTagNames} from './svg-case-sensitive-tag-names.js'\n\n// Note: this explicit type is needed, otherwise TS creates broken types.\n/** @type {ReturnType} */\nexport const h = createH(html, 'div')\n\n// Note: this explicit type is needed, otherwise TS creates broken types.\n/** @type {ReturnType} */\nexport const s = createH(svg, 'g', svgCaseSensitiveTagNames)\n","/**\n * @typedef {import('vfile').VFile} VFile\n * @typedef {import('vfile').Value} Value\n * @typedef {import('unist').Point} UnistPoint\n */\n\n/**\n *\n * @typedef PointLike\n * unist point, allowed as input.\n * @property {number | null | undefined} [line]\n * Line.\n * @property {number | null | undefined} [column]\n * Column.\n * @property {number | null | undefined} [offset]\n * Offset.\n *\n * @callback ToPoint\n * Get the line/column based `Point` for `offset` in the bound indices.\n *\n * Returns `undefined` when given out of bounds input.\n *\n * Also implemented in Rust in [`wooorm/markdown-rs`][markdown-rs].\n *\n * [markdown-rs]: https://github.com/wooorm/markdown-rs/blob/main/src/util/location.rs\n * @param {number | null | undefined} [offset]\n * Something that should be an `offset.\n * @returns {UnistPoint | undefined}\n * Point, if `offset` is valid and in-bounds input.\n *\n * @callback ToOffset\n * Get the `offset` from a line/column based `Point` in the bound indices.\n * @param {PointLike | null | undefined} [point]\n * Something that should be a `point.\n * @returns {number | undefined}\n * Offset (`number`) or `undefined` for invalid or out of bounds input.\n *\n * @typedef Location\n * Accessors for index.\n * @property {ToPoint} toPoint\n * Get the line/column based `Point` for `offset` in the bound indices.\n * @property {ToOffset} toOffset\n * Get the `offset` from a line/column based `Point` in the bound indices.\n */\n\nconst search = /\\r?\\n|\\r/g\n\n/**\n * Create an index of the given document to translate between line/column and\n * offset based positional info.\n *\n * Also implemented in Rust in [`wooorm/markdown-rs`][markdown-rs].\n *\n * [markdown-rs]: https://github.com/wooorm/markdown-rs/blob/main/src/util/location.rs\n *\n * @param {VFile | Value} file\n * File to index.\n * @returns {Location}\n * Accessors for index.\n */\nexport function location(file) {\n const value = String(file)\n /**\n * List, where each index is a line number (0-based), and each value is the\n * byte index *after* where the line ends.\n *\n * @type {Array}\n */\n const indices = []\n\n search.lastIndex = 0\n\n while (search.test(value)) {\n indices.push(search.lastIndex)\n }\n\n indices.push(value.length + 1)\n\n return {toPoint, toOffset}\n\n /** @type {ToPoint} */\n function toPoint(offset) {\n let index = -1\n\n if (\n typeof offset === 'number' &&\n offset > -1 &&\n offset < indices[indices.length - 1]\n ) {\n while (++index < indices.length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (index > 0 ? indices[index - 1] : 0) + 1,\n offset\n }\n }\n }\n }\n }\n\n /** @type {ToOffset} */\n function toOffset(point) {\n const line = point && point.line\n const column = point && point.column\n\n if (\n typeof line === 'number' &&\n typeof column === 'number' &&\n !Number.isNaN(line) &&\n !Number.isNaN(column) &&\n line - 1 in indices\n ) {\n const offset = (indices[line - 2] || 0) + column - 1 || 0\n\n if (offset > -1 && offset < indices[indices.length - 1]) {\n return offset\n }\n }\n }\n}\n","/**\n * Map of web namespaces.\n *\n * @type {Record}\n */\nexport const webNamespaces = {\n html: 'http://www.w3.org/1999/xhtml',\n mathml: 'http://www.w3.org/1998/Math/MathML',\n svg: 'http://www.w3.org/2000/svg',\n xlink: 'http://www.w3.org/1999/xlink',\n xml: 'http://www.w3.org/XML/1998/namespace',\n xmlns: 'http://www.w3.org/2000/xmlns/'\n}\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').ElementData} ElementData\n * @typedef {import('hast').Nodes} Nodes\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').RootContent} RootContent\n *\n * @typedef {import('parse5').DefaultTreeAdapterMap} DefaultTreeAdapterMap\n * @typedef {import('parse5').Token.ElementLocation} P5ElementLocation\n * @typedef {import('parse5').Token.Location} P5Location\n *\n * @typedef {import('property-information').Schema} Schema\n *\n * @typedef {import('unist').Point} Point\n * @typedef {import('unist').Position} Position\n *\n * @typedef {import('vfile').VFile} VFile\n */\n\n/**\n * @typedef {DefaultTreeAdapterMap['document']} P5Document\n * @typedef {DefaultTreeAdapterMap['documentFragment']} P5DocumentFragment\n * @typedef {DefaultTreeAdapterMap['documentType']} P5DocumentType\n * @typedef {DefaultTreeAdapterMap['commentNode']} P5Comment\n * @typedef {DefaultTreeAdapterMap['textNode']} P5Text\n * @typedef {DefaultTreeAdapterMap['element']} P5Element\n * @typedef {DefaultTreeAdapterMap['node']} P5Node\n * @typedef {DefaultTreeAdapterMap['template']} P5Template\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {Space | null | undefined} [space='html']\n * Which space the document is in (default: `'html'`).\n *\n * When an `` element is found in the HTML space, this package already\n * automatically switches to and from the SVG space when entering and exiting\n * it.\n * @property {VFile | null | undefined} [file]\n * File used to add positional info to nodes (optional).\n *\n * If given, the file should represent the original HTML source.\n * @property {boolean | null | undefined} [verbose=false]\n * Whether to add extra positional info about starting tags, closing tags,\n * and attributes to elements (default: `false`).\n *\n * > 👉 **Note**: only used when `file` is given.\n *\n * @typedef {'html' | 'svg'} Space\n * Namespace.\n *\n * @typedef State\n * Info passed around about the current state.\n * @property {VFile | undefined} file\n * Corresponding file.\n * @property {boolean} location\n * Whether location info was found.\n * @property {Schema} schema\n * Current schema.\n * @property {boolean | undefined} verbose\n * Add extra positional info.\n */\n\nimport {ok as assert} from 'devlop'\nimport {h, s} from 'hastscript'\nimport {find, html, svg} from 'property-information'\nimport {location} from 'vfile-location'\nimport {webNamespaces} from 'web-namespaces'\n\nconst own = {}.hasOwnProperty\n/** @type {unknown} */\n// type-coverage:ignore-next-line\nconst proto = Object.prototype\n\n/**\n * Transform a `parse5` AST to hast.\n *\n * @param {P5Node} tree\n * `parse5` tree to transform.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {Nodes}\n * hast tree.\n */\nexport function fromParse5(tree, options) {\n const settings = options || {}\n\n return one(\n {\n file: settings.file || undefined,\n location: false,\n schema: settings.space === 'svg' ? svg : html,\n verbose: settings.verbose || false\n },\n tree\n )\n}\n\n/**\n * Transform a node.\n *\n * @param {State} state\n * Info passed around about the current state.\n * @param {P5Node} node\n * p5 node.\n * @returns {Nodes}\n * hast node.\n */\nfunction one(state, node) {\n /** @type {Nodes} */\n let result\n\n switch (node.nodeName) {\n case '#comment': {\n const reference = /** @type {P5Comment} */ (node)\n result = {type: 'comment', value: reference.data}\n patch(state, reference, result)\n return result\n }\n\n case '#document':\n case '#document-fragment': {\n const reference = /** @type {P5Document | P5DocumentFragment} */ (node)\n const quirksMode =\n 'mode' in reference\n ? reference.mode === 'quirks' || reference.mode === 'limited-quirks'\n : false\n\n result = {\n type: 'root',\n children: all(state, node.childNodes),\n data: {quirksMode}\n }\n\n if (state.file && state.location) {\n const doc = String(state.file)\n const loc = location(doc)\n const start = loc.toPoint(0)\n const end = loc.toPoint(doc.length)\n // Always defined as we give valid input.\n assert(start, 'expected `start`')\n assert(end, 'expected `end`')\n result.position = {start, end}\n }\n\n return result\n }\n\n case '#documentType': {\n const reference = /** @type {P5DocumentType} */ (node)\n result = {type: 'doctype'}\n patch(state, reference, result)\n return result\n }\n\n case '#text': {\n const reference = /** @type {P5Text} */ (node)\n result = {type: 'text', value: reference.value}\n patch(state, reference, result)\n return result\n }\n\n // Element.\n default: {\n const reference = /** @type {P5Element} */ (node)\n result = element(state, reference)\n return result\n }\n }\n}\n\n/**\n * Transform children.\n *\n * @param {State} state\n * Info passed around about the current state.\n * @param {Array} nodes\n * Nodes.\n * @returns {Array}\n * hast nodes.\n */\nfunction all(state, nodes) {\n let index = -1\n /** @type {Array} */\n const results = []\n\n while (++index < nodes.length) {\n // Assume no roots in `nodes`.\n const result = /** @type {RootContent} */ (one(state, nodes[index]))\n results.push(result)\n }\n\n return results\n}\n\n/**\n * Transform an element.\n *\n * @param {State} state\n * Info passed around about the current state.\n * @param {P5Element} node\n * `parse5` node to transform.\n * @returns {Element}\n * hast node.\n */\nfunction element(state, node) {\n const schema = state.schema\n\n state.schema = node.namespaceURI === webNamespaces.svg ? svg : html\n\n // Props.\n let index = -1\n /** @type {Record} */\n const props = {}\n\n while (++index < node.attrs.length) {\n const attribute = node.attrs[index]\n const name =\n (attribute.prefix ? attribute.prefix + ':' : '') + attribute.name\n if (!own.call(proto, name)) {\n props[name] = attribute.value\n }\n }\n\n // Build.\n const fn = state.schema.space === 'svg' ? s : h\n const result = fn(node.tagName, props, all(state, node.childNodes))\n patch(state, node, result)\n\n // Switch content.\n if (result.tagName === 'template') {\n const reference = /** @type {P5Template} */ (node)\n const pos = reference.sourceCodeLocation\n const startTag = pos && pos.startTag && position(pos.startTag)\n const endTag = pos && pos.endTag && position(pos.endTag)\n\n // Root in, root out.\n const content = /** @type {Root} */ (one(state, reference.content))\n\n if (startTag && endTag && state.file) {\n content.position = {start: startTag.end, end: endTag.start}\n }\n\n result.content = content\n }\n\n state.schema = schema\n\n return result\n}\n\n/**\n * Patch positional info from `from` onto `to`.\n *\n * @param {State} state\n * Info passed around about the current state.\n * @param {P5Node} from\n * p5 node.\n * @param {Nodes} to\n * hast node.\n * @returns {undefined}\n * Nothing.\n */\nfunction patch(state, from, to) {\n if ('sourceCodeLocation' in from && from.sourceCodeLocation && state.file) {\n const position = createLocation(state, to, from.sourceCodeLocation)\n\n if (position) {\n state.location = true\n to.position = position\n }\n }\n}\n\n/**\n * Create clean positional information.\n *\n * @param {State} state\n * Info passed around about the current state.\n * @param {Nodes} node\n * hast node.\n * @param {P5ElementLocation} location\n * p5 location info.\n * @returns {Position | undefined}\n * Position, or nothing.\n */\nfunction createLocation(state, node, location) {\n const result = position(location)\n\n if (node.type === 'element') {\n const tail = node.children[node.children.length - 1]\n\n // Bug for unclosed with children.\n // See: .\n if (\n result &&\n !location.endTag &&\n tail &&\n tail.position &&\n tail.position.end\n ) {\n result.end = Object.assign({}, tail.position.end)\n }\n\n if (state.verbose) {\n /** @type {Record} */\n const props = {}\n /** @type {string} */\n let key\n\n if (location.attrs) {\n for (key in location.attrs) {\n if (own.call(location.attrs, key)) {\n props[find(state.schema, key).property] = position(\n location.attrs[key]\n )\n }\n }\n }\n\n assert(location.startTag, 'a start tag should exist')\n const opening = position(location.startTag)\n const closing = location.endTag ? position(location.endTag) : undefined\n /** @type {ElementData['position']} */\n const data = {opening}\n if (closing) data.closing = closing\n data.properties = props\n\n node.data = {position: data}\n }\n }\n\n return result\n}\n\n/**\n * Turn a p5 location into a position.\n *\n * @param {P5Location} loc\n * Location.\n * @returns {Position | undefined}\n * Position or nothing.\n */\nfunction position(loc) {\n const start = point({\n line: loc.startLine,\n column: loc.startCol,\n offset: loc.startOffset\n })\n const end = point({\n line: loc.endLine,\n column: loc.endCol,\n offset: loc.endOffset\n })\n\n // @ts-expect-error: we do use `undefined` for points if one or the other\n // exists.\n return start || end ? {start, end} : undefined\n}\n\n/**\n * Filter out invalid points.\n *\n * @param {Point} point\n * Point with potentially `undefined` values.\n * @returns {Point | undefined}\n * Point or nothing.\n */\nfunction point(point) {\n return point.line && point.column ? point : undefined\n}\n","/**\n * @callback Handler\n * Handle a value, with a certain ID field set to a certain value.\n * The ID field is passed to `zwitch`, and it’s value is this function’s\n * place on the `handlers` record.\n * @param {...any} parameters\n * Arbitrary parameters passed to the zwitch.\n * The first will be an object with a certain ID field set to a certain value.\n * @returns {any}\n * Anything!\n */\n\n/**\n * @callback UnknownHandler\n * Handle values that do have a certain ID field, but it’s set to a value\n * that is not listed in the `handlers` record.\n * @param {unknown} value\n * An object with a certain ID field set to an unknown value.\n * @param {...any} rest\n * Arbitrary parameters passed to the zwitch.\n * @returns {any}\n * Anything!\n */\n\n/**\n * @callback InvalidHandler\n * Handle values that do not have a certain ID field.\n * @param {unknown} value\n * Any unknown value.\n * @param {...any} rest\n * Arbitrary parameters passed to the zwitch.\n * @returns {void|null|undefined|never}\n * This should crash or return nothing.\n */\n\n/**\n * @template {InvalidHandler} [Invalid=InvalidHandler]\n * @template {UnknownHandler} [Unknown=UnknownHandler]\n * @template {Record} [Handlers=Record]\n * @typedef Options\n * Configuration (required).\n * @property {Invalid} [invalid]\n * Handler to use for invalid values.\n * @property {Unknown} [unknown]\n * Handler to use for unknown values.\n * @property {Handlers} [handlers]\n * Handlers to use.\n */\n\nconst own = {}.hasOwnProperty\n\n/**\n * Handle values based on a field.\n *\n * @template {InvalidHandler} [Invalid=InvalidHandler]\n * @template {UnknownHandler} [Unknown=UnknownHandler]\n * @template {Record} [Handlers=Record]\n * @param {string} key\n * Field to switch on.\n * @param {Options} [options]\n * Configuration (required).\n * @returns {{unknown: Unknown, invalid: Invalid, handlers: Handlers, (...parameters: Parameters): ReturnType, (...parameters: Parameters): ReturnType}}\n */\nexport function zwitch(key, options) {\n const settings = options || {}\n\n /**\n * Handle one value.\n *\n * Based on the bound `key`, a respective handler will be called.\n * If `value` is not an object, or doesn’t have a `key` property, the special\n * “invalid” handler will be called.\n * If `value` has an unknown `key`, the special “unknown” handler will be\n * called.\n *\n * All arguments, and the context object, are passed through to the handler,\n * and it’s result is returned.\n *\n * @this {unknown}\n * Any context object.\n * @param {unknown} [value]\n * Any value.\n * @param {...unknown} parameters\n * Arbitrary parameters passed to the zwitch.\n * @property {Handler} invalid\n * Handle for values that do not have a certain ID field.\n * @property {Handler} unknown\n * Handle values that do have a certain ID field, but it’s set to a value\n * that is not listed in the `handlers` record.\n * @property {Handlers} handlers\n * Record of handlers.\n * @returns {unknown}\n * Anything.\n */\n function one(value, ...parameters) {\n /** @type {Handler|undefined} */\n let fn = one.invalid\n const handlers = one.handlers\n\n if (value && own.call(value, key)) {\n // @ts-expect-error Indexable.\n const id = String(value[key])\n // @ts-expect-error Indexable.\n fn = own.call(handlers, id) ? handlers[id] : one.unknown\n }\n\n if (fn) {\n return fn.call(this, value, ...parameters)\n }\n }\n\n one.handlers = settings.handlers || {}\n one.invalid = settings.invalid\n one.unknown = settings.unknown\n\n // @ts-expect-error: matches!\n return one\n}\n","/**\n * @typedef {import('hast').Comment} Comment\n * @typedef {import('hast').Doctype} Doctype\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Nodes} Nodes\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast').RootContent} RootContent\n * @typedef {import('hast').Text} Text\n *\n * @typedef {import('parse5').DefaultTreeAdapterMap['document']} Parse5Document\n * @typedef {import('parse5').DefaultTreeAdapterMap['documentFragment']} Parse5Fragment\n * @typedef {import('parse5').DefaultTreeAdapterMap['element']} Parse5Element\n * @typedef {import('parse5').DefaultTreeAdapterMap['node']} Parse5Nodes\n * @typedef {import('parse5').DefaultTreeAdapterMap['documentType']} Parse5Doctype\n * @typedef {import('parse5').DefaultTreeAdapterMap['commentNode']} Parse5Comment\n * @typedef {import('parse5').DefaultTreeAdapterMap['textNode']} Parse5Text\n * @typedef {import('parse5').DefaultTreeAdapterMap['parentNode']} Parse5Parent\n * @typedef {import('parse5').Token.Attribute} Parse5Attribute\n *\n * @typedef {import('property-information').Schema} Schema\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {Space | null | undefined} [space='html']\n * Which space the document is in (default: `'html'`).\n *\n * When an `` element is found in the HTML space, this package already\n * automatically switches to and from the SVG space when entering and exiting\n * it.\n *\n * @typedef {Exclude} Parse5Content\n *\n * @typedef {'html' | 'svg'} Space\n */\n\nimport {stringify as commas} from 'comma-separated-tokens'\nimport {ok as assert} from 'devlop'\nimport {find, html, svg} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport {webNamespaces} from 'web-namespaces'\nimport {zwitch} from 'zwitch'\n\n/** @type {Options} */\nconst emptyOptions = {}\n\nconst own = {}.hasOwnProperty\n\nconst one = zwitch('type', {handlers: {root, element, text, comment, doctype}})\n\n/**\n * Transform a hast tree to a `parse5` AST.\n *\n * @param {Nodes} tree\n * Tree to transform.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {Parse5Nodes}\n * `parse5` node.\n */\nexport function toParse5(tree, options) {\n const settings = options || emptyOptions\n const space = settings.space\n return one(tree, space === 'svg' ? svg : html)\n}\n\n/**\n * @param {Root} node\n * Node (hast) to transform.\n * @param {Schema} schema\n * Current schema.\n * @returns {Parse5Document}\n * Parse5 node.\n */\nfunction root(node, schema) {\n /** @type {Parse5Document} */\n const result = {\n nodeName: '#document',\n // @ts-expect-error: `parse5` uses enums, which are actually strings.\n mode: (node.data || {}).quirksMode ? 'quirks' : 'no-quirks',\n childNodes: []\n }\n result.childNodes = all(node.children, result, schema)\n patch(node, result)\n return result\n}\n\n/**\n * @param {Root} node\n * Node (hast) to transform.\n * @param {Schema} schema\n * Current schema.\n * @returns {Parse5Fragment}\n * Parse5 node.\n */\nfunction fragment(node, schema) {\n /** @type {Parse5Fragment} */\n const result = {nodeName: '#document-fragment', childNodes: []}\n result.childNodes = all(node.children, result, schema)\n patch(node, result)\n return result\n}\n\n/**\n * @param {Doctype} node\n * Node (hast) to transform.\n * @returns {Parse5Doctype}\n * Parse5 node.\n */\nfunction doctype(node) {\n /** @type {Parse5Doctype} */\n const result = {\n nodeName: '#documentType',\n name: 'html',\n publicId: '',\n systemId: '',\n parentNode: null\n }\n\n patch(node, result)\n return result\n}\n\n/**\n * @param {Text} node\n * Node (hast) to transform.\n * @returns {Parse5Text}\n * Parse5 node.\n */\nfunction text(node) {\n /** @type {Parse5Text} */\n const result = {\n nodeName: '#text',\n value: node.value,\n parentNode: null\n }\n patch(node, result)\n return result\n}\n\n/**\n * @param {Comment} node\n * Node (hast) to transform.\n * @returns {Parse5Comment}\n * Parse5 node.\n */\nfunction comment(node) {\n /** @type {Parse5Comment} */\n const result = {\n nodeName: '#comment',\n data: node.value,\n parentNode: null\n }\n\n patch(node, result)\n\n return result\n}\n\n/**\n * @param {Element} node\n * Node (hast) to transform.\n * @param {Schema} schema\n * Current schema.\n * @returns {Parse5Element}\n * Parse5 node.\n */\nfunction element(node, schema) {\n const parentSchema = schema\n let currentSchema = parentSchema\n\n if (\n node.type === 'element' &&\n node.tagName.toLowerCase() === 'svg' &&\n parentSchema.space === 'html'\n ) {\n currentSchema = svg\n }\n\n /** @type {Array} */\n const attrs = []\n /** @type {string} */\n let prop\n\n if (node.properties) {\n for (prop in node.properties) {\n if (prop !== 'children' && own.call(node.properties, prop)) {\n const result = createProperty(\n currentSchema,\n prop,\n node.properties[prop]\n )\n\n if (result) {\n attrs.push(result)\n }\n }\n }\n }\n\n const space = currentSchema.space\n // `html` and `svg` both have a space.\n assert(space)\n\n /** @type {Parse5Element} */\n const result = {\n nodeName: node.tagName,\n tagName: node.tagName,\n attrs,\n // @ts-expect-error: `parse5` types are wrong.\n namespaceURI: webNamespaces[space],\n childNodes: [],\n parentNode: null\n }\n result.childNodes = all(node.children, result, currentSchema)\n patch(node, result)\n\n if (node.tagName === 'template' && node.content) {\n // @ts-expect-error: `parse5` types are wrong.\n result.content = fragment(node.content, currentSchema)\n }\n\n return result\n}\n\n/**\n * Handle a property.\n *\n * @param {Schema} schema\n * Current schema.\n * @param {string} prop\n * Key.\n * @param {Array | boolean | number | string | null | undefined} value\n * hast property value.\n * @returns {Parse5Attribute | undefined}\n * Field for runtime, optional.\n */\nfunction createProperty(schema, prop, value) {\n const info = find(schema, prop)\n\n // Ignore nullish and `NaN` values.\n if (\n value === false ||\n value === null ||\n value === undefined ||\n (typeof value === 'number' && Number.isNaN(value)) ||\n (!value && info.boolean)\n ) {\n return\n }\n\n if (Array.isArray(value)) {\n // Accept `array`.\n // Most props are space-separated.\n value = info.commaSeparated ? commas(value) : spaces(value)\n }\n\n /** @type {Parse5Attribute} */\n const attribute = {\n name: info.attribute,\n value: value === true ? '' : String(value)\n }\n\n if (info.space && info.space !== 'html' && info.space !== 'svg') {\n const index = attribute.name.indexOf(':')\n\n if (index < 0) {\n attribute.prefix = ''\n } else {\n attribute.name = attribute.name.slice(index + 1)\n attribute.prefix = info.attribute.slice(0, index)\n }\n\n attribute.namespace = webNamespaces[info.space]\n }\n\n return attribute\n}\n\n/**\n * Transform all hast nodes.\n *\n * @param {Array} children\n * List of children.\n * @param {Parse5Parent} parentNode\n * `parse5` parent node.\n * @param {Schema} schema\n * Current schema.\n * @returns {Array}\n * Transformed children.\n */\nfunction all(children, parentNode, schema) {\n let index = -1\n /** @type {Array} */\n const results = []\n\n if (children) {\n while (++index < children.length) {\n /** @type {Parse5Content} */\n const child = one(children[index], schema)\n\n child.parentNode = parentNode\n\n results.push(child)\n }\n }\n\n return results\n}\n\n/**\n * Add position info from `from` to `to`.\n *\n * @param {Nodes} from\n * hast node.\n * @param {Parse5Nodes} to\n * `parse5` node.\n * @returns {undefined}\n * Nothing.\n */\nfunction patch(from, to) {\n const position = from.position\n\n if (position && position.start && position.end) {\n assert(typeof position.start.offset === 'number')\n assert(typeof position.end.offset === 'number')\n\n to.sourceCodeLocation = {\n startLine: position.start.line,\n startCol: position.start.column,\n startOffset: position.start.offset,\n endLine: position.end.line,\n endCol: position.end.column,\n endOffset: position.end.offset\n }\n }\n}\n","/**\n * List of HTML void tag names.\n *\n * @type {Array}\n */\nexport const htmlVoidElements = [\n 'area',\n 'base',\n 'basefont',\n 'bgsound',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'frame',\n 'hr',\n 'image',\n 'img',\n 'input',\n 'keygen',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr'\n]\n","const UNDEFINED_CODE_POINTS = new Set([\n 65534, 65535, 131070, 131071, 196606, 196607, 262142, 262143, 327678, 327679, 393214,\n 393215, 458750, 458751, 524286, 524287, 589822, 589823, 655358, 655359, 720894,\n 720895, 786430, 786431, 851966, 851967, 917502, 917503, 983038, 983039, 1048574,\n 1048575, 1114110, 1114111,\n]);\nexport const REPLACEMENT_CHARACTER = '\\uFFFD';\nexport var CODE_POINTS;\n(function (CODE_POINTS) {\n CODE_POINTS[CODE_POINTS[\"EOF\"] = -1] = \"EOF\";\n CODE_POINTS[CODE_POINTS[\"NULL\"] = 0] = \"NULL\";\n CODE_POINTS[CODE_POINTS[\"TABULATION\"] = 9] = \"TABULATION\";\n CODE_POINTS[CODE_POINTS[\"CARRIAGE_RETURN\"] = 13] = \"CARRIAGE_RETURN\";\n CODE_POINTS[CODE_POINTS[\"LINE_FEED\"] = 10] = \"LINE_FEED\";\n CODE_POINTS[CODE_POINTS[\"FORM_FEED\"] = 12] = \"FORM_FEED\";\n CODE_POINTS[CODE_POINTS[\"SPACE\"] = 32] = \"SPACE\";\n CODE_POINTS[CODE_POINTS[\"EXCLAMATION_MARK\"] = 33] = \"EXCLAMATION_MARK\";\n CODE_POINTS[CODE_POINTS[\"QUOTATION_MARK\"] = 34] = \"QUOTATION_MARK\";\n CODE_POINTS[CODE_POINTS[\"NUMBER_SIGN\"] = 35] = \"NUMBER_SIGN\";\n CODE_POINTS[CODE_POINTS[\"AMPERSAND\"] = 38] = \"AMPERSAND\";\n CODE_POINTS[CODE_POINTS[\"APOSTROPHE\"] = 39] = \"APOSTROPHE\";\n CODE_POINTS[CODE_POINTS[\"HYPHEN_MINUS\"] = 45] = \"HYPHEN_MINUS\";\n CODE_POINTS[CODE_POINTS[\"SOLIDUS\"] = 47] = \"SOLIDUS\";\n CODE_POINTS[CODE_POINTS[\"DIGIT_0\"] = 48] = \"DIGIT_0\";\n CODE_POINTS[CODE_POINTS[\"DIGIT_9\"] = 57] = \"DIGIT_9\";\n CODE_POINTS[CODE_POINTS[\"SEMICOLON\"] = 59] = \"SEMICOLON\";\n CODE_POINTS[CODE_POINTS[\"LESS_THAN_SIGN\"] = 60] = \"LESS_THAN_SIGN\";\n CODE_POINTS[CODE_POINTS[\"EQUALS_SIGN\"] = 61] = \"EQUALS_SIGN\";\n CODE_POINTS[CODE_POINTS[\"GREATER_THAN_SIGN\"] = 62] = \"GREATER_THAN_SIGN\";\n CODE_POINTS[CODE_POINTS[\"QUESTION_MARK\"] = 63] = \"QUESTION_MARK\";\n CODE_POINTS[CODE_POINTS[\"LATIN_CAPITAL_A\"] = 65] = \"LATIN_CAPITAL_A\";\n CODE_POINTS[CODE_POINTS[\"LATIN_CAPITAL_F\"] = 70] = \"LATIN_CAPITAL_F\";\n CODE_POINTS[CODE_POINTS[\"LATIN_CAPITAL_X\"] = 88] = \"LATIN_CAPITAL_X\";\n CODE_POINTS[CODE_POINTS[\"LATIN_CAPITAL_Z\"] = 90] = \"LATIN_CAPITAL_Z\";\n CODE_POINTS[CODE_POINTS[\"RIGHT_SQUARE_BRACKET\"] = 93] = \"RIGHT_SQUARE_BRACKET\";\n CODE_POINTS[CODE_POINTS[\"GRAVE_ACCENT\"] = 96] = \"GRAVE_ACCENT\";\n CODE_POINTS[CODE_POINTS[\"LATIN_SMALL_A\"] = 97] = \"LATIN_SMALL_A\";\n CODE_POINTS[CODE_POINTS[\"LATIN_SMALL_F\"] = 102] = \"LATIN_SMALL_F\";\n CODE_POINTS[CODE_POINTS[\"LATIN_SMALL_X\"] = 120] = \"LATIN_SMALL_X\";\n CODE_POINTS[CODE_POINTS[\"LATIN_SMALL_Z\"] = 122] = \"LATIN_SMALL_Z\";\n CODE_POINTS[CODE_POINTS[\"REPLACEMENT_CHARACTER\"] = 65533] = \"REPLACEMENT_CHARACTER\";\n})(CODE_POINTS = CODE_POINTS || (CODE_POINTS = {}));\nexport const SEQUENCES = {\n DASH_DASH: '--',\n CDATA_START: '[CDATA[',\n DOCTYPE: 'doctype',\n SCRIPT: 'script',\n PUBLIC: 'public',\n SYSTEM: 'system',\n};\n//Surrogates\nexport function isSurrogate(cp) {\n return cp >= 55296 && cp <= 57343;\n}\nexport function isSurrogatePair(cp) {\n return cp >= 56320 && cp <= 57343;\n}\nexport function getSurrogatePairCodePoint(cp1, cp2) {\n return (cp1 - 55296) * 1024 + 9216 + cp2;\n}\n//NOTE: excluding NULL and ASCII whitespace\nexport function isControlCodePoint(cp) {\n return ((cp !== 0x20 && cp !== 0x0a && cp !== 0x0d && cp !== 0x09 && cp !== 0x0c && cp >= 0x01 && cp <= 0x1f) ||\n (cp >= 0x7f && cp <= 0x9f));\n}\nexport function isUndefinedCodePoint(cp) {\n return (cp >= 64976 && cp <= 65007) || UNDEFINED_CODE_POINTS.has(cp);\n}\n//# sourceMappingURL=unicode.js.map","export var ERR;\n(function (ERR) {\n ERR[\"controlCharacterInInputStream\"] = \"control-character-in-input-stream\";\n ERR[\"noncharacterInInputStream\"] = \"noncharacter-in-input-stream\";\n ERR[\"surrogateInInputStream\"] = \"surrogate-in-input-stream\";\n ERR[\"nonVoidHtmlElementStartTagWithTrailingSolidus\"] = \"non-void-html-element-start-tag-with-trailing-solidus\";\n ERR[\"endTagWithAttributes\"] = \"end-tag-with-attributes\";\n ERR[\"endTagWithTrailingSolidus\"] = \"end-tag-with-trailing-solidus\";\n ERR[\"unexpectedSolidusInTag\"] = \"unexpected-solidus-in-tag\";\n ERR[\"unexpectedNullCharacter\"] = \"unexpected-null-character\";\n ERR[\"unexpectedQuestionMarkInsteadOfTagName\"] = \"unexpected-question-mark-instead-of-tag-name\";\n ERR[\"invalidFirstCharacterOfTagName\"] = \"invalid-first-character-of-tag-name\";\n ERR[\"unexpectedEqualsSignBeforeAttributeName\"] = \"unexpected-equals-sign-before-attribute-name\";\n ERR[\"missingEndTagName\"] = \"missing-end-tag-name\";\n ERR[\"unexpectedCharacterInAttributeName\"] = \"unexpected-character-in-attribute-name\";\n ERR[\"unknownNamedCharacterReference\"] = \"unknown-named-character-reference\";\n ERR[\"missingSemicolonAfterCharacterReference\"] = \"missing-semicolon-after-character-reference\";\n ERR[\"unexpectedCharacterAfterDoctypeSystemIdentifier\"] = \"unexpected-character-after-doctype-system-identifier\";\n ERR[\"unexpectedCharacterInUnquotedAttributeValue\"] = \"unexpected-character-in-unquoted-attribute-value\";\n ERR[\"eofBeforeTagName\"] = \"eof-before-tag-name\";\n ERR[\"eofInTag\"] = \"eof-in-tag\";\n ERR[\"missingAttributeValue\"] = \"missing-attribute-value\";\n ERR[\"missingWhitespaceBetweenAttributes\"] = \"missing-whitespace-between-attributes\";\n ERR[\"missingWhitespaceAfterDoctypePublicKeyword\"] = \"missing-whitespace-after-doctype-public-keyword\";\n ERR[\"missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers\"] = \"missing-whitespace-between-doctype-public-and-system-identifiers\";\n ERR[\"missingWhitespaceAfterDoctypeSystemKeyword\"] = \"missing-whitespace-after-doctype-system-keyword\";\n ERR[\"missingQuoteBeforeDoctypePublicIdentifier\"] = \"missing-quote-before-doctype-public-identifier\";\n ERR[\"missingQuoteBeforeDoctypeSystemIdentifier\"] = \"missing-quote-before-doctype-system-identifier\";\n ERR[\"missingDoctypePublicIdentifier\"] = \"missing-doctype-public-identifier\";\n ERR[\"missingDoctypeSystemIdentifier\"] = \"missing-doctype-system-identifier\";\n ERR[\"abruptDoctypePublicIdentifier\"] = \"abrupt-doctype-public-identifier\";\n ERR[\"abruptDoctypeSystemIdentifier\"] = \"abrupt-doctype-system-identifier\";\n ERR[\"cdataInHtmlContent\"] = \"cdata-in-html-content\";\n ERR[\"incorrectlyOpenedComment\"] = \"incorrectly-opened-comment\";\n ERR[\"eofInScriptHtmlCommentLikeText\"] = \"eof-in-script-html-comment-like-text\";\n ERR[\"eofInDoctype\"] = \"eof-in-doctype\";\n ERR[\"nestedComment\"] = \"nested-comment\";\n ERR[\"abruptClosingOfEmptyComment\"] = \"abrupt-closing-of-empty-comment\";\n ERR[\"eofInComment\"] = \"eof-in-comment\";\n ERR[\"incorrectlyClosedComment\"] = \"incorrectly-closed-comment\";\n ERR[\"eofInCdata\"] = \"eof-in-cdata\";\n ERR[\"absenceOfDigitsInNumericCharacterReference\"] = \"absence-of-digits-in-numeric-character-reference\";\n ERR[\"nullCharacterReference\"] = \"null-character-reference\";\n ERR[\"surrogateCharacterReference\"] = \"surrogate-character-reference\";\n ERR[\"characterReferenceOutsideUnicodeRange\"] = \"character-reference-outside-unicode-range\";\n ERR[\"controlCharacterReference\"] = \"control-character-reference\";\n ERR[\"noncharacterCharacterReference\"] = \"noncharacter-character-reference\";\n ERR[\"missingWhitespaceBeforeDoctypeName\"] = \"missing-whitespace-before-doctype-name\";\n ERR[\"missingDoctypeName\"] = \"missing-doctype-name\";\n ERR[\"invalidCharacterSequenceAfterDoctypeName\"] = \"invalid-character-sequence-after-doctype-name\";\n ERR[\"duplicateAttribute\"] = \"duplicate-attribute\";\n ERR[\"nonConformingDoctype\"] = \"non-conforming-doctype\";\n ERR[\"missingDoctype\"] = \"missing-doctype\";\n ERR[\"misplacedDoctype\"] = \"misplaced-doctype\";\n ERR[\"endTagWithoutMatchingOpenElement\"] = \"end-tag-without-matching-open-element\";\n ERR[\"closingOfElementWithOpenChildElements\"] = \"closing-of-element-with-open-child-elements\";\n ERR[\"disallowedContentInNoscriptInHead\"] = \"disallowed-content-in-noscript-in-head\";\n ERR[\"openElementsLeftAfterEof\"] = \"open-elements-left-after-eof\";\n ERR[\"abandonedHeadElementChild\"] = \"abandoned-head-element-child\";\n ERR[\"misplacedStartTagForHeadElement\"] = \"misplaced-start-tag-for-head-element\";\n ERR[\"nestedNoscriptInHead\"] = \"nested-noscript-in-head\";\n ERR[\"eofInElementThatCanContainOnlyText\"] = \"eof-in-element-that-can-contain-only-text\";\n})(ERR = ERR || (ERR = {}));\n//# sourceMappingURL=error-codes.js.map","import { CODE_POINTS as $, getSurrogatePairCodePoint, isControlCodePoint, isSurrogate, isSurrogatePair, isUndefinedCodePoint, } from '../common/unicode.js';\nimport { ERR } from '../common/error-codes.js';\n//Const\nconst DEFAULT_BUFFER_WATERLINE = 1 << 16;\n//Preprocessor\n//NOTE: HTML input preprocessing\n//(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#preprocessing-the-input-stream)\nexport class Preprocessor {\n constructor(handler) {\n this.handler = handler;\n this.html = '';\n this.pos = -1;\n // NOTE: Initial `lastGapPos` is -2, to ensure `col` on initialisation is 0\n this.lastGapPos = -2;\n this.gapStack = [];\n this.skipNextNewLine = false;\n this.lastChunkWritten = false;\n this.endOfChunkHit = false;\n this.bufferWaterline = DEFAULT_BUFFER_WATERLINE;\n this.isEol = false;\n this.lineStartPos = 0;\n this.droppedBufferSize = 0;\n this.line = 1;\n //NOTE: avoid reporting errors twice on advance/retreat\n this.lastErrOffset = -1;\n }\n /** The column on the current line. If we just saw a gap (eg. a surrogate pair), return the index before. */\n get col() {\n return this.pos - this.lineStartPos + Number(this.lastGapPos !== this.pos);\n }\n get offset() {\n return this.droppedBufferSize + this.pos;\n }\n getError(code) {\n const { line, col, offset } = this;\n return {\n code,\n startLine: line,\n endLine: line,\n startCol: col,\n endCol: col,\n startOffset: offset,\n endOffset: offset,\n };\n }\n _err(code) {\n if (this.handler.onParseError && this.lastErrOffset !== this.offset) {\n this.lastErrOffset = this.offset;\n this.handler.onParseError(this.getError(code));\n }\n }\n _addGap() {\n this.gapStack.push(this.lastGapPos);\n this.lastGapPos = this.pos;\n }\n _processSurrogate(cp) {\n //NOTE: try to peek a surrogate pair\n if (this.pos !== this.html.length - 1) {\n const nextCp = this.html.charCodeAt(this.pos + 1);\n if (isSurrogatePair(nextCp)) {\n //NOTE: we have a surrogate pair. Peek pair character and recalculate code point.\n this.pos++;\n //NOTE: add a gap that should be avoided during retreat\n this._addGap();\n return getSurrogatePairCodePoint(cp, nextCp);\n }\n }\n //NOTE: we are at the end of a chunk, therefore we can't infer the surrogate pair yet.\n else if (!this.lastChunkWritten) {\n this.endOfChunkHit = true;\n return $.EOF;\n }\n //NOTE: isolated surrogate\n this._err(ERR.surrogateInInputStream);\n return cp;\n }\n willDropParsedChunk() {\n return this.pos > this.bufferWaterline;\n }\n dropParsedChunk() {\n if (this.willDropParsedChunk()) {\n this.html = this.html.substring(this.pos);\n this.lineStartPos -= this.pos;\n this.droppedBufferSize += this.pos;\n this.pos = 0;\n this.lastGapPos = -2;\n this.gapStack.length = 0;\n }\n }\n write(chunk, isLastChunk) {\n if (this.html.length > 0) {\n this.html += chunk;\n }\n else {\n this.html = chunk;\n }\n this.endOfChunkHit = false;\n this.lastChunkWritten = isLastChunk;\n }\n insertHtmlAtCurrentPos(chunk) {\n this.html = this.html.substring(0, this.pos + 1) + chunk + this.html.substring(this.pos + 1);\n this.endOfChunkHit = false;\n }\n startsWith(pattern, caseSensitive) {\n // Check if our buffer has enough characters\n if (this.pos + pattern.length > this.html.length) {\n this.endOfChunkHit = !this.lastChunkWritten;\n return false;\n }\n if (caseSensitive) {\n return this.html.startsWith(pattern, this.pos);\n }\n for (let i = 0; i < pattern.length; i++) {\n const cp = this.html.charCodeAt(this.pos + i) | 0x20;\n if (cp !== pattern.charCodeAt(i)) {\n return false;\n }\n }\n return true;\n }\n peek(offset) {\n const pos = this.pos + offset;\n if (pos >= this.html.length) {\n this.endOfChunkHit = !this.lastChunkWritten;\n return $.EOF;\n }\n const code = this.html.charCodeAt(pos);\n return code === $.CARRIAGE_RETURN ? $.LINE_FEED : code;\n }\n advance() {\n this.pos++;\n //NOTE: LF should be in the last column of the line\n if (this.isEol) {\n this.isEol = false;\n this.line++;\n this.lineStartPos = this.pos;\n }\n if (this.pos >= this.html.length) {\n this.endOfChunkHit = !this.lastChunkWritten;\n return $.EOF;\n }\n let cp = this.html.charCodeAt(this.pos);\n //NOTE: all U+000D CARRIAGE RETURN (CR) characters must be converted to U+000A LINE FEED (LF) characters\n if (cp === $.CARRIAGE_RETURN) {\n this.isEol = true;\n this.skipNextNewLine = true;\n return $.LINE_FEED;\n }\n //NOTE: any U+000A LINE FEED (LF) characters that immediately follow a U+000D CARRIAGE RETURN (CR) character\n //must be ignored.\n if (cp === $.LINE_FEED) {\n this.isEol = true;\n if (this.skipNextNewLine) {\n // `line` will be bumped again in the recursive call.\n this.line--;\n this.skipNextNewLine = false;\n this._addGap();\n return this.advance();\n }\n }\n this.skipNextNewLine = false;\n if (isSurrogate(cp)) {\n cp = this._processSurrogate(cp);\n }\n //OPTIMIZATION: first check if code point is in the common allowed\n //range (ASCII alphanumeric, whitespaces, big chunk of BMP)\n //before going into detailed performance cost validation.\n const isCommonValidRange = this.handler.onParseError === null ||\n (cp > 0x1f && cp < 0x7f) ||\n cp === $.LINE_FEED ||\n cp === $.CARRIAGE_RETURN ||\n (cp > 0x9f && cp < 64976);\n if (!isCommonValidRange) {\n this._checkForProblematicCharacters(cp);\n }\n return cp;\n }\n _checkForProblematicCharacters(cp) {\n if (isControlCodePoint(cp)) {\n this._err(ERR.controlCharacterInInputStream);\n }\n else if (isUndefinedCodePoint(cp)) {\n this._err(ERR.noncharacterInInputStream);\n }\n }\n retreat(count) {\n this.pos -= count;\n while (this.pos < this.lastGapPos) {\n this.lastGapPos = this.gapStack.pop();\n this.pos--;\n }\n this.isEol = false;\n }\n}\n//# sourceMappingURL=preprocessor.js.map","export var TokenType;\n(function (TokenType) {\n TokenType[TokenType[\"CHARACTER\"] = 0] = \"CHARACTER\";\n TokenType[TokenType[\"NULL_CHARACTER\"] = 1] = \"NULL_CHARACTER\";\n TokenType[TokenType[\"WHITESPACE_CHARACTER\"] = 2] = \"WHITESPACE_CHARACTER\";\n TokenType[TokenType[\"START_TAG\"] = 3] = \"START_TAG\";\n TokenType[TokenType[\"END_TAG\"] = 4] = \"END_TAG\";\n TokenType[TokenType[\"COMMENT\"] = 5] = \"COMMENT\";\n TokenType[TokenType[\"DOCTYPE\"] = 6] = \"DOCTYPE\";\n TokenType[TokenType[\"EOF\"] = 7] = \"EOF\";\n TokenType[TokenType[\"HIBERNATION\"] = 8] = \"HIBERNATION\";\n})(TokenType = TokenType || (TokenType = {}));\nexport function getTokenAttr(token, attrName) {\n for (let i = token.attrs.length - 1; i >= 0; i--) {\n if (token.attrs[i].name === attrName) {\n return token.attrs[i].value;\n }\n }\n return null;\n}\n//# sourceMappingURL=token.js.map",null,null,null,null,"/** All valid namespaces in HTML. */\nexport var NS;\n(function (NS) {\n NS[\"HTML\"] = \"http://www.w3.org/1999/xhtml\";\n NS[\"MATHML\"] = \"http://www.w3.org/1998/Math/MathML\";\n NS[\"SVG\"] = \"http://www.w3.org/2000/svg\";\n NS[\"XLINK\"] = \"http://www.w3.org/1999/xlink\";\n NS[\"XML\"] = \"http://www.w3.org/XML/1998/namespace\";\n NS[\"XMLNS\"] = \"http://www.w3.org/2000/xmlns/\";\n})(NS = NS || (NS = {}));\nexport var ATTRS;\n(function (ATTRS) {\n ATTRS[\"TYPE\"] = \"type\";\n ATTRS[\"ACTION\"] = \"action\";\n ATTRS[\"ENCODING\"] = \"encoding\";\n ATTRS[\"PROMPT\"] = \"prompt\";\n ATTRS[\"NAME\"] = \"name\";\n ATTRS[\"COLOR\"] = \"color\";\n ATTRS[\"FACE\"] = \"face\";\n ATTRS[\"SIZE\"] = \"size\";\n})(ATTRS = ATTRS || (ATTRS = {}));\n/**\n * The mode of the document.\n *\n * @see {@link https://dom.spec.whatwg.org/#concept-document-limited-quirks}\n */\nexport var DOCUMENT_MODE;\n(function (DOCUMENT_MODE) {\n DOCUMENT_MODE[\"NO_QUIRKS\"] = \"no-quirks\";\n DOCUMENT_MODE[\"QUIRKS\"] = \"quirks\";\n DOCUMENT_MODE[\"LIMITED_QUIRKS\"] = \"limited-quirks\";\n})(DOCUMENT_MODE = DOCUMENT_MODE || (DOCUMENT_MODE = {}));\nexport var TAG_NAMES;\n(function (TAG_NAMES) {\n TAG_NAMES[\"A\"] = \"a\";\n TAG_NAMES[\"ADDRESS\"] = \"address\";\n TAG_NAMES[\"ANNOTATION_XML\"] = \"annotation-xml\";\n TAG_NAMES[\"APPLET\"] = \"applet\";\n TAG_NAMES[\"AREA\"] = \"area\";\n TAG_NAMES[\"ARTICLE\"] = \"article\";\n TAG_NAMES[\"ASIDE\"] = \"aside\";\n TAG_NAMES[\"B\"] = \"b\";\n TAG_NAMES[\"BASE\"] = \"base\";\n TAG_NAMES[\"BASEFONT\"] = \"basefont\";\n TAG_NAMES[\"BGSOUND\"] = \"bgsound\";\n TAG_NAMES[\"BIG\"] = \"big\";\n TAG_NAMES[\"BLOCKQUOTE\"] = \"blockquote\";\n TAG_NAMES[\"BODY\"] = \"body\";\n TAG_NAMES[\"BR\"] = \"br\";\n TAG_NAMES[\"BUTTON\"] = \"button\";\n TAG_NAMES[\"CAPTION\"] = \"caption\";\n TAG_NAMES[\"CENTER\"] = \"center\";\n TAG_NAMES[\"CODE\"] = \"code\";\n TAG_NAMES[\"COL\"] = \"col\";\n TAG_NAMES[\"COLGROUP\"] = \"colgroup\";\n TAG_NAMES[\"DD\"] = \"dd\";\n TAG_NAMES[\"DESC\"] = \"desc\";\n TAG_NAMES[\"DETAILS\"] = \"details\";\n TAG_NAMES[\"DIALOG\"] = \"dialog\";\n TAG_NAMES[\"DIR\"] = \"dir\";\n TAG_NAMES[\"DIV\"] = \"div\";\n TAG_NAMES[\"DL\"] = \"dl\";\n TAG_NAMES[\"DT\"] = \"dt\";\n TAG_NAMES[\"EM\"] = \"em\";\n TAG_NAMES[\"EMBED\"] = \"embed\";\n TAG_NAMES[\"FIELDSET\"] = \"fieldset\";\n TAG_NAMES[\"FIGCAPTION\"] = \"figcaption\";\n TAG_NAMES[\"FIGURE\"] = \"figure\";\n TAG_NAMES[\"FONT\"] = \"font\";\n TAG_NAMES[\"FOOTER\"] = \"footer\";\n TAG_NAMES[\"FOREIGN_OBJECT\"] = \"foreignObject\";\n TAG_NAMES[\"FORM\"] = \"form\";\n TAG_NAMES[\"FRAME\"] = \"frame\";\n TAG_NAMES[\"FRAMESET\"] = \"frameset\";\n TAG_NAMES[\"H1\"] = \"h1\";\n TAG_NAMES[\"H2\"] = \"h2\";\n TAG_NAMES[\"H3\"] = \"h3\";\n TAG_NAMES[\"H4\"] = \"h4\";\n TAG_NAMES[\"H5\"] = \"h5\";\n TAG_NAMES[\"H6\"] = \"h6\";\n TAG_NAMES[\"HEAD\"] = \"head\";\n TAG_NAMES[\"HEADER\"] = \"header\";\n TAG_NAMES[\"HGROUP\"] = \"hgroup\";\n TAG_NAMES[\"HR\"] = \"hr\";\n TAG_NAMES[\"HTML\"] = \"html\";\n TAG_NAMES[\"I\"] = \"i\";\n TAG_NAMES[\"IMG\"] = \"img\";\n TAG_NAMES[\"IMAGE\"] = \"image\";\n TAG_NAMES[\"INPUT\"] = \"input\";\n TAG_NAMES[\"IFRAME\"] = \"iframe\";\n TAG_NAMES[\"KEYGEN\"] = \"keygen\";\n TAG_NAMES[\"LABEL\"] = \"label\";\n TAG_NAMES[\"LI\"] = \"li\";\n TAG_NAMES[\"LINK\"] = \"link\";\n TAG_NAMES[\"LISTING\"] = \"listing\";\n TAG_NAMES[\"MAIN\"] = \"main\";\n TAG_NAMES[\"MALIGNMARK\"] = \"malignmark\";\n TAG_NAMES[\"MARQUEE\"] = \"marquee\";\n TAG_NAMES[\"MATH\"] = \"math\";\n TAG_NAMES[\"MENU\"] = \"menu\";\n TAG_NAMES[\"META\"] = \"meta\";\n TAG_NAMES[\"MGLYPH\"] = \"mglyph\";\n TAG_NAMES[\"MI\"] = \"mi\";\n TAG_NAMES[\"MO\"] = \"mo\";\n TAG_NAMES[\"MN\"] = \"mn\";\n TAG_NAMES[\"MS\"] = \"ms\";\n TAG_NAMES[\"MTEXT\"] = \"mtext\";\n TAG_NAMES[\"NAV\"] = \"nav\";\n TAG_NAMES[\"NOBR\"] = \"nobr\";\n TAG_NAMES[\"NOFRAMES\"] = \"noframes\";\n TAG_NAMES[\"NOEMBED\"] = \"noembed\";\n TAG_NAMES[\"NOSCRIPT\"] = \"noscript\";\n TAG_NAMES[\"OBJECT\"] = \"object\";\n TAG_NAMES[\"OL\"] = \"ol\";\n TAG_NAMES[\"OPTGROUP\"] = \"optgroup\";\n TAG_NAMES[\"OPTION\"] = \"option\";\n TAG_NAMES[\"P\"] = \"p\";\n TAG_NAMES[\"PARAM\"] = \"param\";\n TAG_NAMES[\"PLAINTEXT\"] = \"plaintext\";\n TAG_NAMES[\"PRE\"] = \"pre\";\n TAG_NAMES[\"RB\"] = \"rb\";\n TAG_NAMES[\"RP\"] = \"rp\";\n TAG_NAMES[\"RT\"] = \"rt\";\n TAG_NAMES[\"RTC\"] = \"rtc\";\n TAG_NAMES[\"RUBY\"] = \"ruby\";\n TAG_NAMES[\"S\"] = \"s\";\n TAG_NAMES[\"SCRIPT\"] = \"script\";\n TAG_NAMES[\"SECTION\"] = \"section\";\n TAG_NAMES[\"SELECT\"] = \"select\";\n TAG_NAMES[\"SOURCE\"] = \"source\";\n TAG_NAMES[\"SMALL\"] = \"small\";\n TAG_NAMES[\"SPAN\"] = \"span\";\n TAG_NAMES[\"STRIKE\"] = \"strike\";\n TAG_NAMES[\"STRONG\"] = \"strong\";\n TAG_NAMES[\"STYLE\"] = \"style\";\n TAG_NAMES[\"SUB\"] = \"sub\";\n TAG_NAMES[\"SUMMARY\"] = \"summary\";\n TAG_NAMES[\"SUP\"] = \"sup\";\n TAG_NAMES[\"TABLE\"] = \"table\";\n TAG_NAMES[\"TBODY\"] = \"tbody\";\n TAG_NAMES[\"TEMPLATE\"] = \"template\";\n TAG_NAMES[\"TEXTAREA\"] = \"textarea\";\n TAG_NAMES[\"TFOOT\"] = \"tfoot\";\n TAG_NAMES[\"TD\"] = \"td\";\n TAG_NAMES[\"TH\"] = \"th\";\n TAG_NAMES[\"THEAD\"] = \"thead\";\n TAG_NAMES[\"TITLE\"] = \"title\";\n TAG_NAMES[\"TR\"] = \"tr\";\n TAG_NAMES[\"TRACK\"] = \"track\";\n TAG_NAMES[\"TT\"] = \"tt\";\n TAG_NAMES[\"U\"] = \"u\";\n TAG_NAMES[\"UL\"] = \"ul\";\n TAG_NAMES[\"SVG\"] = \"svg\";\n TAG_NAMES[\"VAR\"] = \"var\";\n TAG_NAMES[\"WBR\"] = \"wbr\";\n TAG_NAMES[\"XMP\"] = \"xmp\";\n})(TAG_NAMES = TAG_NAMES || (TAG_NAMES = {}));\n/**\n * Tag IDs are numeric IDs for known tag names.\n *\n * We use tag IDs to improve the performance of tag name comparisons.\n */\nexport var TAG_ID;\n(function (TAG_ID) {\n TAG_ID[TAG_ID[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n TAG_ID[TAG_ID[\"A\"] = 1] = \"A\";\n TAG_ID[TAG_ID[\"ADDRESS\"] = 2] = \"ADDRESS\";\n TAG_ID[TAG_ID[\"ANNOTATION_XML\"] = 3] = \"ANNOTATION_XML\";\n TAG_ID[TAG_ID[\"APPLET\"] = 4] = \"APPLET\";\n TAG_ID[TAG_ID[\"AREA\"] = 5] = \"AREA\";\n TAG_ID[TAG_ID[\"ARTICLE\"] = 6] = \"ARTICLE\";\n TAG_ID[TAG_ID[\"ASIDE\"] = 7] = \"ASIDE\";\n TAG_ID[TAG_ID[\"B\"] = 8] = \"B\";\n TAG_ID[TAG_ID[\"BASE\"] = 9] = \"BASE\";\n TAG_ID[TAG_ID[\"BASEFONT\"] = 10] = \"BASEFONT\";\n TAG_ID[TAG_ID[\"BGSOUND\"] = 11] = \"BGSOUND\";\n TAG_ID[TAG_ID[\"BIG\"] = 12] = \"BIG\";\n TAG_ID[TAG_ID[\"BLOCKQUOTE\"] = 13] = \"BLOCKQUOTE\";\n TAG_ID[TAG_ID[\"BODY\"] = 14] = \"BODY\";\n TAG_ID[TAG_ID[\"BR\"] = 15] = \"BR\";\n TAG_ID[TAG_ID[\"BUTTON\"] = 16] = \"BUTTON\";\n TAG_ID[TAG_ID[\"CAPTION\"] = 17] = \"CAPTION\";\n TAG_ID[TAG_ID[\"CENTER\"] = 18] = \"CENTER\";\n TAG_ID[TAG_ID[\"CODE\"] = 19] = \"CODE\";\n TAG_ID[TAG_ID[\"COL\"] = 20] = \"COL\";\n TAG_ID[TAG_ID[\"COLGROUP\"] = 21] = \"COLGROUP\";\n TAG_ID[TAG_ID[\"DD\"] = 22] = \"DD\";\n TAG_ID[TAG_ID[\"DESC\"] = 23] = \"DESC\";\n TAG_ID[TAG_ID[\"DETAILS\"] = 24] = \"DETAILS\";\n TAG_ID[TAG_ID[\"DIALOG\"] = 25] = \"DIALOG\";\n TAG_ID[TAG_ID[\"DIR\"] = 26] = \"DIR\";\n TAG_ID[TAG_ID[\"DIV\"] = 27] = \"DIV\";\n TAG_ID[TAG_ID[\"DL\"] = 28] = \"DL\";\n TAG_ID[TAG_ID[\"DT\"] = 29] = \"DT\";\n TAG_ID[TAG_ID[\"EM\"] = 30] = \"EM\";\n TAG_ID[TAG_ID[\"EMBED\"] = 31] = \"EMBED\";\n TAG_ID[TAG_ID[\"FIELDSET\"] = 32] = \"FIELDSET\";\n TAG_ID[TAG_ID[\"FIGCAPTION\"] = 33] = \"FIGCAPTION\";\n TAG_ID[TAG_ID[\"FIGURE\"] = 34] = \"FIGURE\";\n TAG_ID[TAG_ID[\"FONT\"] = 35] = \"FONT\";\n TAG_ID[TAG_ID[\"FOOTER\"] = 36] = \"FOOTER\";\n TAG_ID[TAG_ID[\"FOREIGN_OBJECT\"] = 37] = \"FOREIGN_OBJECT\";\n TAG_ID[TAG_ID[\"FORM\"] = 38] = \"FORM\";\n TAG_ID[TAG_ID[\"FRAME\"] = 39] = \"FRAME\";\n TAG_ID[TAG_ID[\"FRAMESET\"] = 40] = \"FRAMESET\";\n TAG_ID[TAG_ID[\"H1\"] = 41] = \"H1\";\n TAG_ID[TAG_ID[\"H2\"] = 42] = \"H2\";\n TAG_ID[TAG_ID[\"H3\"] = 43] = \"H3\";\n TAG_ID[TAG_ID[\"H4\"] = 44] = \"H4\";\n TAG_ID[TAG_ID[\"H5\"] = 45] = \"H5\";\n TAG_ID[TAG_ID[\"H6\"] = 46] = \"H6\";\n TAG_ID[TAG_ID[\"HEAD\"] = 47] = \"HEAD\";\n TAG_ID[TAG_ID[\"HEADER\"] = 48] = \"HEADER\";\n TAG_ID[TAG_ID[\"HGROUP\"] = 49] = \"HGROUP\";\n TAG_ID[TAG_ID[\"HR\"] = 50] = \"HR\";\n TAG_ID[TAG_ID[\"HTML\"] = 51] = \"HTML\";\n TAG_ID[TAG_ID[\"I\"] = 52] = \"I\";\n TAG_ID[TAG_ID[\"IMG\"] = 53] = \"IMG\";\n TAG_ID[TAG_ID[\"IMAGE\"] = 54] = \"IMAGE\";\n TAG_ID[TAG_ID[\"INPUT\"] = 55] = \"INPUT\";\n TAG_ID[TAG_ID[\"IFRAME\"] = 56] = \"IFRAME\";\n TAG_ID[TAG_ID[\"KEYGEN\"] = 57] = \"KEYGEN\";\n TAG_ID[TAG_ID[\"LABEL\"] = 58] = \"LABEL\";\n TAG_ID[TAG_ID[\"LI\"] = 59] = \"LI\";\n TAG_ID[TAG_ID[\"LINK\"] = 60] = \"LINK\";\n TAG_ID[TAG_ID[\"LISTING\"] = 61] = \"LISTING\";\n TAG_ID[TAG_ID[\"MAIN\"] = 62] = \"MAIN\";\n TAG_ID[TAG_ID[\"MALIGNMARK\"] = 63] = \"MALIGNMARK\";\n TAG_ID[TAG_ID[\"MARQUEE\"] = 64] = \"MARQUEE\";\n TAG_ID[TAG_ID[\"MATH\"] = 65] = \"MATH\";\n TAG_ID[TAG_ID[\"MENU\"] = 66] = \"MENU\";\n TAG_ID[TAG_ID[\"META\"] = 67] = \"META\";\n TAG_ID[TAG_ID[\"MGLYPH\"] = 68] = \"MGLYPH\";\n TAG_ID[TAG_ID[\"MI\"] = 69] = \"MI\";\n TAG_ID[TAG_ID[\"MO\"] = 70] = \"MO\";\n TAG_ID[TAG_ID[\"MN\"] = 71] = \"MN\";\n TAG_ID[TAG_ID[\"MS\"] = 72] = \"MS\";\n TAG_ID[TAG_ID[\"MTEXT\"] = 73] = \"MTEXT\";\n TAG_ID[TAG_ID[\"NAV\"] = 74] = \"NAV\";\n TAG_ID[TAG_ID[\"NOBR\"] = 75] = \"NOBR\";\n TAG_ID[TAG_ID[\"NOFRAMES\"] = 76] = \"NOFRAMES\";\n TAG_ID[TAG_ID[\"NOEMBED\"] = 77] = \"NOEMBED\";\n TAG_ID[TAG_ID[\"NOSCRIPT\"] = 78] = \"NOSCRIPT\";\n TAG_ID[TAG_ID[\"OBJECT\"] = 79] = \"OBJECT\";\n TAG_ID[TAG_ID[\"OL\"] = 80] = \"OL\";\n TAG_ID[TAG_ID[\"OPTGROUP\"] = 81] = \"OPTGROUP\";\n TAG_ID[TAG_ID[\"OPTION\"] = 82] = \"OPTION\";\n TAG_ID[TAG_ID[\"P\"] = 83] = \"P\";\n TAG_ID[TAG_ID[\"PARAM\"] = 84] = \"PARAM\";\n TAG_ID[TAG_ID[\"PLAINTEXT\"] = 85] = \"PLAINTEXT\";\n TAG_ID[TAG_ID[\"PRE\"] = 86] = \"PRE\";\n TAG_ID[TAG_ID[\"RB\"] = 87] = \"RB\";\n TAG_ID[TAG_ID[\"RP\"] = 88] = \"RP\";\n TAG_ID[TAG_ID[\"RT\"] = 89] = \"RT\";\n TAG_ID[TAG_ID[\"RTC\"] = 90] = \"RTC\";\n TAG_ID[TAG_ID[\"RUBY\"] = 91] = \"RUBY\";\n TAG_ID[TAG_ID[\"S\"] = 92] = \"S\";\n TAG_ID[TAG_ID[\"SCRIPT\"] = 93] = \"SCRIPT\";\n TAG_ID[TAG_ID[\"SECTION\"] = 94] = \"SECTION\";\n TAG_ID[TAG_ID[\"SELECT\"] = 95] = \"SELECT\";\n TAG_ID[TAG_ID[\"SOURCE\"] = 96] = \"SOURCE\";\n TAG_ID[TAG_ID[\"SMALL\"] = 97] = \"SMALL\";\n TAG_ID[TAG_ID[\"SPAN\"] = 98] = \"SPAN\";\n TAG_ID[TAG_ID[\"STRIKE\"] = 99] = \"STRIKE\";\n TAG_ID[TAG_ID[\"STRONG\"] = 100] = \"STRONG\";\n TAG_ID[TAG_ID[\"STYLE\"] = 101] = \"STYLE\";\n TAG_ID[TAG_ID[\"SUB\"] = 102] = \"SUB\";\n TAG_ID[TAG_ID[\"SUMMARY\"] = 103] = \"SUMMARY\";\n TAG_ID[TAG_ID[\"SUP\"] = 104] = \"SUP\";\n TAG_ID[TAG_ID[\"TABLE\"] = 105] = \"TABLE\";\n TAG_ID[TAG_ID[\"TBODY\"] = 106] = \"TBODY\";\n TAG_ID[TAG_ID[\"TEMPLATE\"] = 107] = \"TEMPLATE\";\n TAG_ID[TAG_ID[\"TEXTAREA\"] = 108] = \"TEXTAREA\";\n TAG_ID[TAG_ID[\"TFOOT\"] = 109] = \"TFOOT\";\n TAG_ID[TAG_ID[\"TD\"] = 110] = \"TD\";\n TAG_ID[TAG_ID[\"TH\"] = 111] = \"TH\";\n TAG_ID[TAG_ID[\"THEAD\"] = 112] = \"THEAD\";\n TAG_ID[TAG_ID[\"TITLE\"] = 113] = \"TITLE\";\n TAG_ID[TAG_ID[\"TR\"] = 114] = \"TR\";\n TAG_ID[TAG_ID[\"TRACK\"] = 115] = \"TRACK\";\n TAG_ID[TAG_ID[\"TT\"] = 116] = \"TT\";\n TAG_ID[TAG_ID[\"U\"] = 117] = \"U\";\n TAG_ID[TAG_ID[\"UL\"] = 118] = \"UL\";\n TAG_ID[TAG_ID[\"SVG\"] = 119] = \"SVG\";\n TAG_ID[TAG_ID[\"VAR\"] = 120] = \"VAR\";\n TAG_ID[TAG_ID[\"WBR\"] = 121] = \"WBR\";\n TAG_ID[TAG_ID[\"XMP\"] = 122] = \"XMP\";\n})(TAG_ID = TAG_ID || (TAG_ID = {}));\nconst TAG_NAME_TO_ID = new Map([\n [TAG_NAMES.A, TAG_ID.A],\n [TAG_NAMES.ADDRESS, TAG_ID.ADDRESS],\n [TAG_NAMES.ANNOTATION_XML, TAG_ID.ANNOTATION_XML],\n [TAG_NAMES.APPLET, TAG_ID.APPLET],\n [TAG_NAMES.AREA, TAG_ID.AREA],\n [TAG_NAMES.ARTICLE, TAG_ID.ARTICLE],\n [TAG_NAMES.ASIDE, TAG_ID.ASIDE],\n [TAG_NAMES.B, TAG_ID.B],\n [TAG_NAMES.BASE, TAG_ID.BASE],\n [TAG_NAMES.BASEFONT, TAG_ID.BASEFONT],\n [TAG_NAMES.BGSOUND, TAG_ID.BGSOUND],\n [TAG_NAMES.BIG, TAG_ID.BIG],\n [TAG_NAMES.BLOCKQUOTE, TAG_ID.BLOCKQUOTE],\n [TAG_NAMES.BODY, TAG_ID.BODY],\n [TAG_NAMES.BR, TAG_ID.BR],\n [TAG_NAMES.BUTTON, TAG_ID.BUTTON],\n [TAG_NAMES.CAPTION, TAG_ID.CAPTION],\n [TAG_NAMES.CENTER, TAG_ID.CENTER],\n [TAG_NAMES.CODE, TAG_ID.CODE],\n [TAG_NAMES.COL, TAG_ID.COL],\n [TAG_NAMES.COLGROUP, TAG_ID.COLGROUP],\n [TAG_NAMES.DD, TAG_ID.DD],\n [TAG_NAMES.DESC, TAG_ID.DESC],\n [TAG_NAMES.DETAILS, TAG_ID.DETAILS],\n [TAG_NAMES.DIALOG, TAG_ID.DIALOG],\n [TAG_NAMES.DIR, TAG_ID.DIR],\n [TAG_NAMES.DIV, TAG_ID.DIV],\n [TAG_NAMES.DL, TAG_ID.DL],\n [TAG_NAMES.DT, TAG_ID.DT],\n [TAG_NAMES.EM, TAG_ID.EM],\n [TAG_NAMES.EMBED, TAG_ID.EMBED],\n [TAG_NAMES.FIELDSET, TAG_ID.FIELDSET],\n [TAG_NAMES.FIGCAPTION, TAG_ID.FIGCAPTION],\n [TAG_NAMES.FIGURE, TAG_ID.FIGURE],\n [TAG_NAMES.FONT, TAG_ID.FONT],\n [TAG_NAMES.FOOTER, TAG_ID.FOOTER],\n [TAG_NAMES.FOREIGN_OBJECT, TAG_ID.FOREIGN_OBJECT],\n [TAG_NAMES.FORM, TAG_ID.FORM],\n [TAG_NAMES.FRAME, TAG_ID.FRAME],\n [TAG_NAMES.FRAMESET, TAG_ID.FRAMESET],\n [TAG_NAMES.H1, TAG_ID.H1],\n [TAG_NAMES.H2, TAG_ID.H2],\n [TAG_NAMES.H3, TAG_ID.H3],\n [TAG_NAMES.H4, TAG_ID.H4],\n [TAG_NAMES.H5, TAG_ID.H5],\n [TAG_NAMES.H6, TAG_ID.H6],\n [TAG_NAMES.HEAD, TAG_ID.HEAD],\n [TAG_NAMES.HEADER, TAG_ID.HEADER],\n [TAG_NAMES.HGROUP, TAG_ID.HGROUP],\n [TAG_NAMES.HR, TAG_ID.HR],\n [TAG_NAMES.HTML, TAG_ID.HTML],\n [TAG_NAMES.I, TAG_ID.I],\n [TAG_NAMES.IMG, TAG_ID.IMG],\n [TAG_NAMES.IMAGE, TAG_ID.IMAGE],\n [TAG_NAMES.INPUT, TAG_ID.INPUT],\n [TAG_NAMES.IFRAME, TAG_ID.IFRAME],\n [TAG_NAMES.KEYGEN, TAG_ID.KEYGEN],\n [TAG_NAMES.LABEL, TAG_ID.LABEL],\n [TAG_NAMES.LI, TAG_ID.LI],\n [TAG_NAMES.LINK, TAG_ID.LINK],\n [TAG_NAMES.LISTING, TAG_ID.LISTING],\n [TAG_NAMES.MAIN, TAG_ID.MAIN],\n [TAG_NAMES.MALIGNMARK, TAG_ID.MALIGNMARK],\n [TAG_NAMES.MARQUEE, TAG_ID.MARQUEE],\n [TAG_NAMES.MATH, TAG_ID.MATH],\n [TAG_NAMES.MENU, TAG_ID.MENU],\n [TAG_NAMES.META, TAG_ID.META],\n [TAG_NAMES.MGLYPH, TAG_ID.MGLYPH],\n [TAG_NAMES.MI, TAG_ID.MI],\n [TAG_NAMES.MO, TAG_ID.MO],\n [TAG_NAMES.MN, TAG_ID.MN],\n [TAG_NAMES.MS, TAG_ID.MS],\n [TAG_NAMES.MTEXT, TAG_ID.MTEXT],\n [TAG_NAMES.NAV, TAG_ID.NAV],\n [TAG_NAMES.NOBR, TAG_ID.NOBR],\n [TAG_NAMES.NOFRAMES, TAG_ID.NOFRAMES],\n [TAG_NAMES.NOEMBED, TAG_ID.NOEMBED],\n [TAG_NAMES.NOSCRIPT, TAG_ID.NOSCRIPT],\n [TAG_NAMES.OBJECT, TAG_ID.OBJECT],\n [TAG_NAMES.OL, TAG_ID.OL],\n [TAG_NAMES.OPTGROUP, TAG_ID.OPTGROUP],\n [TAG_NAMES.OPTION, TAG_ID.OPTION],\n [TAG_NAMES.P, TAG_ID.P],\n [TAG_NAMES.PARAM, TAG_ID.PARAM],\n [TAG_NAMES.PLAINTEXT, TAG_ID.PLAINTEXT],\n [TAG_NAMES.PRE, TAG_ID.PRE],\n [TAG_NAMES.RB, TAG_ID.RB],\n [TAG_NAMES.RP, TAG_ID.RP],\n [TAG_NAMES.RT, TAG_ID.RT],\n [TAG_NAMES.RTC, TAG_ID.RTC],\n [TAG_NAMES.RUBY, TAG_ID.RUBY],\n [TAG_NAMES.S, TAG_ID.S],\n [TAG_NAMES.SCRIPT, TAG_ID.SCRIPT],\n [TAG_NAMES.SECTION, TAG_ID.SECTION],\n [TAG_NAMES.SELECT, TAG_ID.SELECT],\n [TAG_NAMES.SOURCE, TAG_ID.SOURCE],\n [TAG_NAMES.SMALL, TAG_ID.SMALL],\n [TAG_NAMES.SPAN, TAG_ID.SPAN],\n [TAG_NAMES.STRIKE, TAG_ID.STRIKE],\n [TAG_NAMES.STRONG, TAG_ID.STRONG],\n [TAG_NAMES.STYLE, TAG_ID.STYLE],\n [TAG_NAMES.SUB, TAG_ID.SUB],\n [TAG_NAMES.SUMMARY, TAG_ID.SUMMARY],\n [TAG_NAMES.SUP, TAG_ID.SUP],\n [TAG_NAMES.TABLE, TAG_ID.TABLE],\n [TAG_NAMES.TBODY, TAG_ID.TBODY],\n [TAG_NAMES.TEMPLATE, TAG_ID.TEMPLATE],\n [TAG_NAMES.TEXTAREA, TAG_ID.TEXTAREA],\n [TAG_NAMES.TFOOT, TAG_ID.TFOOT],\n [TAG_NAMES.TD, TAG_ID.TD],\n [TAG_NAMES.TH, TAG_ID.TH],\n [TAG_NAMES.THEAD, TAG_ID.THEAD],\n [TAG_NAMES.TITLE, TAG_ID.TITLE],\n [TAG_NAMES.TR, TAG_ID.TR],\n [TAG_NAMES.TRACK, TAG_ID.TRACK],\n [TAG_NAMES.TT, TAG_ID.TT],\n [TAG_NAMES.U, TAG_ID.U],\n [TAG_NAMES.UL, TAG_ID.UL],\n [TAG_NAMES.SVG, TAG_ID.SVG],\n [TAG_NAMES.VAR, TAG_ID.VAR],\n [TAG_NAMES.WBR, TAG_ID.WBR],\n [TAG_NAMES.XMP, TAG_ID.XMP],\n]);\nexport function getTagID(tagName) {\n var _a;\n return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !== void 0 ? _a : TAG_ID.UNKNOWN;\n}\nconst $ = TAG_ID;\nexport const SPECIAL_ELEMENTS = {\n [NS.HTML]: new Set([\n $.ADDRESS,\n $.APPLET,\n $.AREA,\n $.ARTICLE,\n $.ASIDE,\n $.BASE,\n $.BASEFONT,\n $.BGSOUND,\n $.BLOCKQUOTE,\n $.BODY,\n $.BR,\n $.BUTTON,\n $.CAPTION,\n $.CENTER,\n $.COL,\n $.COLGROUP,\n $.DD,\n $.DETAILS,\n $.DIR,\n $.DIV,\n $.DL,\n $.DT,\n $.EMBED,\n $.FIELDSET,\n $.FIGCAPTION,\n $.FIGURE,\n $.FOOTER,\n $.FORM,\n $.FRAME,\n $.FRAMESET,\n $.H1,\n $.H2,\n $.H3,\n $.H4,\n $.H5,\n $.H6,\n $.HEAD,\n $.HEADER,\n $.HGROUP,\n $.HR,\n $.HTML,\n $.IFRAME,\n $.IMG,\n $.INPUT,\n $.LI,\n $.LINK,\n $.LISTING,\n $.MAIN,\n $.MARQUEE,\n $.MENU,\n $.META,\n $.NAV,\n $.NOEMBED,\n $.NOFRAMES,\n $.NOSCRIPT,\n $.OBJECT,\n $.OL,\n $.P,\n $.PARAM,\n $.PLAINTEXT,\n $.PRE,\n $.SCRIPT,\n $.SECTION,\n $.SELECT,\n $.SOURCE,\n $.STYLE,\n $.SUMMARY,\n $.TABLE,\n $.TBODY,\n $.TD,\n $.TEMPLATE,\n $.TEXTAREA,\n $.TFOOT,\n $.TH,\n $.THEAD,\n $.TITLE,\n $.TR,\n $.TRACK,\n $.UL,\n $.WBR,\n $.XMP,\n ]),\n [NS.MATHML]: new Set([$.MI, $.MO, $.MN, $.MS, $.MTEXT, $.ANNOTATION_XML]),\n [NS.SVG]: new Set([$.TITLE, $.FOREIGN_OBJECT, $.DESC]),\n [NS.XLINK]: new Set(),\n [NS.XML]: new Set(),\n [NS.XMLNS]: new Set(),\n};\nexport function isNumberedHeader(tn) {\n return tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6;\n}\nconst UNESCAPED_TEXT = new Set([\n TAG_NAMES.STYLE,\n TAG_NAMES.SCRIPT,\n TAG_NAMES.XMP,\n TAG_NAMES.IFRAME,\n TAG_NAMES.NOEMBED,\n TAG_NAMES.NOFRAMES,\n TAG_NAMES.PLAINTEXT,\n]);\nexport function hasUnescapedText(tn, scriptingEnabled) {\n return UNESCAPED_TEXT.has(tn) || (scriptingEnabled && tn === TAG_NAMES.NOSCRIPT);\n}\n//# sourceMappingURL=html.js.map","import { Preprocessor } from './preprocessor.js';\nimport { CODE_POINTS as $, SEQUENCES as $$, REPLACEMENT_CHARACTER, isSurrogate, isUndefinedCodePoint, isControlCodePoint, } from '../common/unicode.js';\nimport { TokenType, getTokenAttr, } from '../common/token.js';\nimport { htmlDecodeTree, BinTrieFlags, determineBranch } from 'entities/lib/decode.js';\nimport { ERR } from '../common/error-codes.js';\nimport { TAG_ID, getTagID } from '../common/html.js';\n//C1 Unicode control character reference replacements\nconst C1_CONTROLS_REFERENCE_REPLACEMENTS = new Map([\n [0x80, 8364],\n [0x82, 8218],\n [0x83, 402],\n [0x84, 8222],\n [0x85, 8230],\n [0x86, 8224],\n [0x87, 8225],\n [0x88, 710],\n [0x89, 8240],\n [0x8a, 352],\n [0x8b, 8249],\n [0x8c, 338],\n [0x8e, 381],\n [0x91, 8216],\n [0x92, 8217],\n [0x93, 8220],\n [0x94, 8221],\n [0x95, 8226],\n [0x96, 8211],\n [0x97, 8212],\n [0x98, 732],\n [0x99, 8482],\n [0x9a, 353],\n [0x9b, 8250],\n [0x9c, 339],\n [0x9e, 382],\n [0x9f, 376],\n]);\n//States\nvar State;\n(function (State) {\n State[State[\"DATA\"] = 0] = \"DATA\";\n State[State[\"RCDATA\"] = 1] = \"RCDATA\";\n State[State[\"RAWTEXT\"] = 2] = \"RAWTEXT\";\n State[State[\"SCRIPT_DATA\"] = 3] = \"SCRIPT_DATA\";\n State[State[\"PLAINTEXT\"] = 4] = \"PLAINTEXT\";\n State[State[\"TAG_OPEN\"] = 5] = \"TAG_OPEN\";\n State[State[\"END_TAG_OPEN\"] = 6] = \"END_TAG_OPEN\";\n State[State[\"TAG_NAME\"] = 7] = \"TAG_NAME\";\n State[State[\"RCDATA_LESS_THAN_SIGN\"] = 8] = \"RCDATA_LESS_THAN_SIGN\";\n State[State[\"RCDATA_END_TAG_OPEN\"] = 9] = \"RCDATA_END_TAG_OPEN\";\n State[State[\"RCDATA_END_TAG_NAME\"] = 10] = \"RCDATA_END_TAG_NAME\";\n State[State[\"RAWTEXT_LESS_THAN_SIGN\"] = 11] = \"RAWTEXT_LESS_THAN_SIGN\";\n State[State[\"RAWTEXT_END_TAG_OPEN\"] = 12] = \"RAWTEXT_END_TAG_OPEN\";\n State[State[\"RAWTEXT_END_TAG_NAME\"] = 13] = \"RAWTEXT_END_TAG_NAME\";\n State[State[\"SCRIPT_DATA_LESS_THAN_SIGN\"] = 14] = \"SCRIPT_DATA_LESS_THAN_SIGN\";\n State[State[\"SCRIPT_DATA_END_TAG_OPEN\"] = 15] = \"SCRIPT_DATA_END_TAG_OPEN\";\n State[State[\"SCRIPT_DATA_END_TAG_NAME\"] = 16] = \"SCRIPT_DATA_END_TAG_NAME\";\n State[State[\"SCRIPT_DATA_ESCAPE_START\"] = 17] = \"SCRIPT_DATA_ESCAPE_START\";\n State[State[\"SCRIPT_DATA_ESCAPE_START_DASH\"] = 18] = \"SCRIPT_DATA_ESCAPE_START_DASH\";\n State[State[\"SCRIPT_DATA_ESCAPED\"] = 19] = \"SCRIPT_DATA_ESCAPED\";\n State[State[\"SCRIPT_DATA_ESCAPED_DASH\"] = 20] = \"SCRIPT_DATA_ESCAPED_DASH\";\n State[State[\"SCRIPT_DATA_ESCAPED_DASH_DASH\"] = 21] = \"SCRIPT_DATA_ESCAPED_DASH_DASH\";\n State[State[\"SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN\"] = 22] = \"SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN\";\n State[State[\"SCRIPT_DATA_ESCAPED_END_TAG_OPEN\"] = 23] = \"SCRIPT_DATA_ESCAPED_END_TAG_OPEN\";\n State[State[\"SCRIPT_DATA_ESCAPED_END_TAG_NAME\"] = 24] = \"SCRIPT_DATA_ESCAPED_END_TAG_NAME\";\n State[State[\"SCRIPT_DATA_DOUBLE_ESCAPE_START\"] = 25] = \"SCRIPT_DATA_DOUBLE_ESCAPE_START\";\n State[State[\"SCRIPT_DATA_DOUBLE_ESCAPED\"] = 26] = \"SCRIPT_DATA_DOUBLE_ESCAPED\";\n State[State[\"SCRIPT_DATA_DOUBLE_ESCAPED_DASH\"] = 27] = \"SCRIPT_DATA_DOUBLE_ESCAPED_DASH\";\n State[State[\"SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH\"] = 28] = \"SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH\";\n State[State[\"SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN\"] = 29] = \"SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN\";\n State[State[\"SCRIPT_DATA_DOUBLE_ESCAPE_END\"] = 30] = \"SCRIPT_DATA_DOUBLE_ESCAPE_END\";\n State[State[\"BEFORE_ATTRIBUTE_NAME\"] = 31] = \"BEFORE_ATTRIBUTE_NAME\";\n State[State[\"ATTRIBUTE_NAME\"] = 32] = \"ATTRIBUTE_NAME\";\n State[State[\"AFTER_ATTRIBUTE_NAME\"] = 33] = \"AFTER_ATTRIBUTE_NAME\";\n State[State[\"BEFORE_ATTRIBUTE_VALUE\"] = 34] = \"BEFORE_ATTRIBUTE_VALUE\";\n State[State[\"ATTRIBUTE_VALUE_DOUBLE_QUOTED\"] = 35] = \"ATTRIBUTE_VALUE_DOUBLE_QUOTED\";\n State[State[\"ATTRIBUTE_VALUE_SINGLE_QUOTED\"] = 36] = \"ATTRIBUTE_VALUE_SINGLE_QUOTED\";\n State[State[\"ATTRIBUTE_VALUE_UNQUOTED\"] = 37] = \"ATTRIBUTE_VALUE_UNQUOTED\";\n State[State[\"AFTER_ATTRIBUTE_VALUE_QUOTED\"] = 38] = \"AFTER_ATTRIBUTE_VALUE_QUOTED\";\n State[State[\"SELF_CLOSING_START_TAG\"] = 39] = \"SELF_CLOSING_START_TAG\";\n State[State[\"BOGUS_COMMENT\"] = 40] = \"BOGUS_COMMENT\";\n State[State[\"MARKUP_DECLARATION_OPEN\"] = 41] = \"MARKUP_DECLARATION_OPEN\";\n State[State[\"COMMENT_START\"] = 42] = \"COMMENT_START\";\n State[State[\"COMMENT_START_DASH\"] = 43] = \"COMMENT_START_DASH\";\n State[State[\"COMMENT\"] = 44] = \"COMMENT\";\n State[State[\"COMMENT_LESS_THAN_SIGN\"] = 45] = \"COMMENT_LESS_THAN_SIGN\";\n State[State[\"COMMENT_LESS_THAN_SIGN_BANG\"] = 46] = \"COMMENT_LESS_THAN_SIGN_BANG\";\n State[State[\"COMMENT_LESS_THAN_SIGN_BANG_DASH\"] = 47] = \"COMMENT_LESS_THAN_SIGN_BANG_DASH\";\n State[State[\"COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH\"] = 48] = \"COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH\";\n State[State[\"COMMENT_END_DASH\"] = 49] = \"COMMENT_END_DASH\";\n State[State[\"COMMENT_END\"] = 50] = \"COMMENT_END\";\n State[State[\"COMMENT_END_BANG\"] = 51] = \"COMMENT_END_BANG\";\n State[State[\"DOCTYPE\"] = 52] = \"DOCTYPE\";\n State[State[\"BEFORE_DOCTYPE_NAME\"] = 53] = \"BEFORE_DOCTYPE_NAME\";\n State[State[\"DOCTYPE_NAME\"] = 54] = \"DOCTYPE_NAME\";\n State[State[\"AFTER_DOCTYPE_NAME\"] = 55] = \"AFTER_DOCTYPE_NAME\";\n State[State[\"AFTER_DOCTYPE_PUBLIC_KEYWORD\"] = 56] = \"AFTER_DOCTYPE_PUBLIC_KEYWORD\";\n State[State[\"BEFORE_DOCTYPE_PUBLIC_IDENTIFIER\"] = 57] = \"BEFORE_DOCTYPE_PUBLIC_IDENTIFIER\";\n State[State[\"DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED\"] = 58] = \"DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED\";\n State[State[\"DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED\"] = 59] = \"DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED\";\n State[State[\"AFTER_DOCTYPE_PUBLIC_IDENTIFIER\"] = 60] = \"AFTER_DOCTYPE_PUBLIC_IDENTIFIER\";\n State[State[\"BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS\"] = 61] = \"BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS\";\n State[State[\"AFTER_DOCTYPE_SYSTEM_KEYWORD\"] = 62] = \"AFTER_DOCTYPE_SYSTEM_KEYWORD\";\n State[State[\"BEFORE_DOCTYPE_SYSTEM_IDENTIFIER\"] = 63] = \"BEFORE_DOCTYPE_SYSTEM_IDENTIFIER\";\n State[State[\"DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED\"] = 64] = \"DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED\";\n State[State[\"DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED\"] = 65] = \"DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED\";\n State[State[\"AFTER_DOCTYPE_SYSTEM_IDENTIFIER\"] = 66] = \"AFTER_DOCTYPE_SYSTEM_IDENTIFIER\";\n State[State[\"BOGUS_DOCTYPE\"] = 67] = \"BOGUS_DOCTYPE\";\n State[State[\"CDATA_SECTION\"] = 68] = \"CDATA_SECTION\";\n State[State[\"CDATA_SECTION_BRACKET\"] = 69] = \"CDATA_SECTION_BRACKET\";\n State[State[\"CDATA_SECTION_END\"] = 70] = \"CDATA_SECTION_END\";\n State[State[\"CHARACTER_REFERENCE\"] = 71] = \"CHARACTER_REFERENCE\";\n State[State[\"NAMED_CHARACTER_REFERENCE\"] = 72] = \"NAMED_CHARACTER_REFERENCE\";\n State[State[\"AMBIGUOUS_AMPERSAND\"] = 73] = \"AMBIGUOUS_AMPERSAND\";\n State[State[\"NUMERIC_CHARACTER_REFERENCE\"] = 74] = \"NUMERIC_CHARACTER_REFERENCE\";\n State[State[\"HEXADEMICAL_CHARACTER_REFERENCE_START\"] = 75] = \"HEXADEMICAL_CHARACTER_REFERENCE_START\";\n State[State[\"HEXADEMICAL_CHARACTER_REFERENCE\"] = 76] = \"HEXADEMICAL_CHARACTER_REFERENCE\";\n State[State[\"DECIMAL_CHARACTER_REFERENCE\"] = 77] = \"DECIMAL_CHARACTER_REFERENCE\";\n State[State[\"NUMERIC_CHARACTER_REFERENCE_END\"] = 78] = \"NUMERIC_CHARACTER_REFERENCE_END\";\n})(State || (State = {}));\n//Tokenizer initial states for different modes\nexport const TokenizerMode = {\n DATA: State.DATA,\n RCDATA: State.RCDATA,\n RAWTEXT: State.RAWTEXT,\n SCRIPT_DATA: State.SCRIPT_DATA,\n PLAINTEXT: State.PLAINTEXT,\n CDATA_SECTION: State.CDATA_SECTION,\n};\n//Utils\n//OPTIMIZATION: these utility functions should not be moved out of this module. V8 Crankshaft will not inline\n//this functions if they will be situated in another module due to context switch.\n//Always perform inlining check before modifying this functions ('node --trace-inlining').\nfunction isAsciiDigit(cp) {\n return cp >= $.DIGIT_0 && cp <= $.DIGIT_9;\n}\nfunction isAsciiUpper(cp) {\n return cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_Z;\n}\nfunction isAsciiLower(cp) {\n return cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_Z;\n}\nfunction isAsciiLetter(cp) {\n return isAsciiLower(cp) || isAsciiUpper(cp);\n}\nfunction isAsciiAlphaNumeric(cp) {\n return isAsciiLetter(cp) || isAsciiDigit(cp);\n}\nfunction isAsciiUpperHexDigit(cp) {\n return cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_F;\n}\nfunction isAsciiLowerHexDigit(cp) {\n return cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_F;\n}\nfunction isAsciiHexDigit(cp) {\n return isAsciiDigit(cp) || isAsciiUpperHexDigit(cp) || isAsciiLowerHexDigit(cp);\n}\nfunction toAsciiLower(cp) {\n return cp + 32;\n}\nfunction isWhitespace(cp) {\n return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;\n}\nfunction isEntityInAttributeInvalidEnd(nextCp) {\n return nextCp === $.EQUALS_SIGN || isAsciiAlphaNumeric(nextCp);\n}\nfunction isScriptDataDoubleEscapeSequenceEnd(cp) {\n return isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN;\n}\n//Tokenizer\nexport class Tokenizer {\n constructor(options, handler) {\n this.options = options;\n this.handler = handler;\n this.paused = false;\n /** Ensures that the parsing loop isn't run multiple times at once. */\n this.inLoop = false;\n /**\n * Indicates that the current adjusted node exists, is not an element in the HTML namespace,\n * and that it is not an integration point for either MathML or HTML.\n *\n * @see {@link https://html.spec.whatwg.org/multipage/parsing.html#tree-construction}\n */\n this.inForeignNode = false;\n this.lastStartTagName = '';\n this.active = false;\n this.state = State.DATA;\n this.returnState = State.DATA;\n this.charRefCode = -1;\n this.consumedAfterSnapshot = -1;\n this.currentCharacterToken = null;\n this.currentToken = null;\n this.currentAttr = { name: '', value: '' };\n this.preprocessor = new Preprocessor(handler);\n this.currentLocation = this.getCurrentLocation(-1);\n }\n //Errors\n _err(code) {\n var _a, _b;\n (_b = (_a = this.handler).onParseError) === null || _b === void 0 ? void 0 : _b.call(_a, this.preprocessor.getError(code));\n }\n // NOTE: `offset` may never run across line boundaries.\n getCurrentLocation(offset) {\n if (!this.options.sourceCodeLocationInfo) {\n return null;\n }\n return {\n startLine: this.preprocessor.line,\n startCol: this.preprocessor.col - offset,\n startOffset: this.preprocessor.offset - offset,\n endLine: -1,\n endCol: -1,\n endOffset: -1,\n };\n }\n _runParsingLoop() {\n if (this.inLoop)\n return;\n this.inLoop = true;\n while (this.active && !this.paused) {\n this.consumedAfterSnapshot = 0;\n const cp = this._consume();\n if (!this._ensureHibernation()) {\n this._callState(cp);\n }\n }\n this.inLoop = false;\n }\n //API\n pause() {\n this.paused = true;\n }\n resume(writeCallback) {\n if (!this.paused) {\n throw new Error('Parser was already resumed');\n }\n this.paused = false;\n // Necessary for synchronous resume.\n if (this.inLoop)\n return;\n this._runParsingLoop();\n if (!this.paused) {\n writeCallback === null || writeCallback === void 0 ? void 0 : writeCallback();\n }\n }\n write(chunk, isLastChunk, writeCallback) {\n this.active = true;\n this.preprocessor.write(chunk, isLastChunk);\n this._runParsingLoop();\n if (!this.paused) {\n writeCallback === null || writeCallback === void 0 ? void 0 : writeCallback();\n }\n }\n insertHtmlAtCurrentPos(chunk) {\n this.active = true;\n this.preprocessor.insertHtmlAtCurrentPos(chunk);\n this._runParsingLoop();\n }\n //Hibernation\n _ensureHibernation() {\n if (this.preprocessor.endOfChunkHit) {\n this._unconsume(this.consumedAfterSnapshot);\n this.active = false;\n return true;\n }\n return false;\n }\n //Consumption\n _consume() {\n this.consumedAfterSnapshot++;\n return this.preprocessor.advance();\n }\n _unconsume(count) {\n this.consumedAfterSnapshot -= count;\n this.preprocessor.retreat(count);\n }\n _reconsumeInState(state, cp) {\n this.state = state;\n this._callState(cp);\n }\n _advanceBy(count) {\n this.consumedAfterSnapshot += count;\n for (let i = 0; i < count; i++) {\n this.preprocessor.advance();\n }\n }\n _consumeSequenceIfMatch(pattern, caseSensitive) {\n if (this.preprocessor.startsWith(pattern, caseSensitive)) {\n // We will already have consumed one character before calling this method.\n this._advanceBy(pattern.length - 1);\n return true;\n }\n return false;\n }\n //Token creation\n _createStartTagToken() {\n this.currentToken = {\n type: TokenType.START_TAG,\n tagName: '',\n tagID: TAG_ID.UNKNOWN,\n selfClosing: false,\n ackSelfClosing: false,\n attrs: [],\n location: this.getCurrentLocation(1),\n };\n }\n _createEndTagToken() {\n this.currentToken = {\n type: TokenType.END_TAG,\n tagName: '',\n tagID: TAG_ID.UNKNOWN,\n selfClosing: false,\n ackSelfClosing: false,\n attrs: [],\n location: this.getCurrentLocation(2),\n };\n }\n _createCommentToken(offset) {\n this.currentToken = {\n type: TokenType.COMMENT,\n data: '',\n location: this.getCurrentLocation(offset),\n };\n }\n _createDoctypeToken(initialName) {\n this.currentToken = {\n type: TokenType.DOCTYPE,\n name: initialName,\n forceQuirks: false,\n publicId: null,\n systemId: null,\n location: this.currentLocation,\n };\n }\n _createCharacterToken(type, chars) {\n this.currentCharacterToken = {\n type,\n chars,\n location: this.currentLocation,\n };\n }\n //Tag attributes\n _createAttr(attrNameFirstCh) {\n this.currentAttr = {\n name: attrNameFirstCh,\n value: '',\n };\n this.currentLocation = this.getCurrentLocation(0);\n }\n _leaveAttrName() {\n var _a;\n var _b;\n const token = this.currentToken;\n if (getTokenAttr(token, this.currentAttr.name) === null) {\n token.attrs.push(this.currentAttr);\n if (token.location && this.currentLocation) {\n const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !== void 0 ? _a : (_b.attrs = Object.create(null)));\n attrLocations[this.currentAttr.name] = this.currentLocation;\n // Set end location\n this._leaveAttrValue();\n }\n }\n else {\n this._err(ERR.duplicateAttribute);\n }\n }\n _leaveAttrValue() {\n if (this.currentLocation) {\n this.currentLocation.endLine = this.preprocessor.line;\n this.currentLocation.endCol = this.preprocessor.col;\n this.currentLocation.endOffset = this.preprocessor.offset;\n }\n }\n //Token emission\n prepareToken(ct) {\n this._emitCurrentCharacterToken(ct.location);\n this.currentToken = null;\n if (ct.location) {\n ct.location.endLine = this.preprocessor.line;\n ct.location.endCol = this.preprocessor.col + 1;\n ct.location.endOffset = this.preprocessor.offset + 1;\n }\n this.currentLocation = this.getCurrentLocation(-1);\n }\n emitCurrentTagToken() {\n const ct = this.currentToken;\n this.prepareToken(ct);\n ct.tagID = getTagID(ct.tagName);\n if (ct.type === TokenType.START_TAG) {\n this.lastStartTagName = ct.tagName;\n this.handler.onStartTag(ct);\n }\n else {\n if (ct.attrs.length > 0) {\n this._err(ERR.endTagWithAttributes);\n }\n if (ct.selfClosing) {\n this._err(ERR.endTagWithTrailingSolidus);\n }\n this.handler.onEndTag(ct);\n }\n this.preprocessor.dropParsedChunk();\n }\n emitCurrentComment(ct) {\n this.prepareToken(ct);\n this.handler.onComment(ct);\n this.preprocessor.dropParsedChunk();\n }\n emitCurrentDoctype(ct) {\n this.prepareToken(ct);\n this.handler.onDoctype(ct);\n this.preprocessor.dropParsedChunk();\n }\n _emitCurrentCharacterToken(nextLocation) {\n if (this.currentCharacterToken) {\n //NOTE: if we have a pending character token, make it's end location equal to the\n //current token's start location.\n if (nextLocation && this.currentCharacterToken.location) {\n this.currentCharacterToken.location.endLine = nextLocation.startLine;\n this.currentCharacterToken.location.endCol = nextLocation.startCol;\n this.currentCharacterToken.location.endOffset = nextLocation.startOffset;\n }\n switch (this.currentCharacterToken.type) {\n case TokenType.CHARACTER: {\n this.handler.onCharacter(this.currentCharacterToken);\n break;\n }\n case TokenType.NULL_CHARACTER: {\n this.handler.onNullCharacter(this.currentCharacterToken);\n break;\n }\n case TokenType.WHITESPACE_CHARACTER: {\n this.handler.onWhitespaceCharacter(this.currentCharacterToken);\n break;\n }\n }\n this.currentCharacterToken = null;\n }\n }\n _emitEOFToken() {\n const location = this.getCurrentLocation(0);\n if (location) {\n location.endLine = location.startLine;\n location.endCol = location.startCol;\n location.endOffset = location.startOffset;\n }\n this._emitCurrentCharacterToken(location);\n this.handler.onEof({ type: TokenType.EOF, location });\n this.active = false;\n }\n //Characters emission\n //OPTIMIZATION: specification uses only one type of character tokens (one token per character).\n //This causes a huge memory overhead and a lot of unnecessary parser loops. parse5 uses 3 groups of characters.\n //If we have a sequence of characters that belong to the same group, the parser can process it\n //as a single solid character token.\n //So, there are 3 types of character tokens in parse5:\n //1)TokenType.NULL_CHARACTER - \\u0000-character sequences (e.g. '\\u0000\\u0000\\u0000')\n //2)TokenType.WHITESPACE_CHARACTER - any whitespace/new-line character sequences (e.g. '\\n \\r\\t \\f')\n //3)TokenType.CHARACTER - any character sequence which don't belong to groups 1 and 2 (e.g. 'abcdef1234@@#$%^')\n _appendCharToCurrentCharacterToken(type, ch) {\n if (this.currentCharacterToken) {\n if (this.currentCharacterToken.type !== type) {\n this.currentLocation = this.getCurrentLocation(0);\n this._emitCurrentCharacterToken(this.currentLocation);\n this.preprocessor.dropParsedChunk();\n }\n else {\n this.currentCharacterToken.chars += ch;\n return;\n }\n }\n this._createCharacterToken(type, ch);\n }\n _emitCodePoint(cp) {\n const type = isWhitespace(cp)\n ? TokenType.WHITESPACE_CHARACTER\n : cp === $.NULL\n ? TokenType.NULL_CHARACTER\n : TokenType.CHARACTER;\n this._appendCharToCurrentCharacterToken(type, String.fromCodePoint(cp));\n }\n //NOTE: used when we emit characters explicitly.\n //This is always for non-whitespace and non-null characters, which allows us to avoid additional checks.\n _emitChars(ch) {\n this._appendCharToCurrentCharacterToken(TokenType.CHARACTER, ch);\n }\n // Character reference helpers\n _matchNamedCharacterReference(cp) {\n let result = null;\n let excess = 0;\n let withoutSemicolon = false;\n for (let i = 0, current = htmlDecodeTree[0]; i >= 0; cp = this._consume()) {\n i = determineBranch(htmlDecodeTree, current, i + 1, cp);\n if (i < 0)\n break;\n excess += 1;\n current = htmlDecodeTree[i];\n const masked = current & 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 // Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.\n // See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state\n if (cp !== $.SEMICOLON &&\n this._isCharacterReferenceInAttribute() &&\n isEntityInAttributeInvalidEnd(this.preprocessor.peek(1))) {\n //NOTE: we don't flush all consumed code points here, and instead switch back to the original state after\n //emitting an ampersand. This is fine, as alphanumeric characters won't be parsed differently in attributes.\n result = [$.AMPERSAND];\n // Skip over the value.\n i += valueLength;\n }\n else {\n // If this is a surrogate pair, consume the next two bytes.\n result =\n valueLength === 0\n ? [htmlDecodeTree[i] & ~BinTrieFlags.VALUE_LENGTH]\n : valueLength === 1\n ? [htmlDecodeTree[++i]]\n : [htmlDecodeTree[++i], htmlDecodeTree[++i]];\n excess = 0;\n withoutSemicolon = cp !== $.SEMICOLON;\n }\n if (valueLength === 0) {\n // If the value is zero-length, we're done.\n this._consume();\n break;\n }\n }\n }\n this._unconsume(excess);\n if (withoutSemicolon && !this.preprocessor.endOfChunkHit) {\n this._err(ERR.missingSemicolonAfterCharacterReference);\n }\n // We want to emit the error above on the code point after the entity.\n // We always consume one code point too many in the loop, and we wait to\n // unconsume it until after the error is emitted.\n this._unconsume(1);\n return result;\n }\n _isCharacterReferenceInAttribute() {\n return (this.returnState === State.ATTRIBUTE_VALUE_DOUBLE_QUOTED ||\n this.returnState === State.ATTRIBUTE_VALUE_SINGLE_QUOTED ||\n this.returnState === State.ATTRIBUTE_VALUE_UNQUOTED);\n }\n _flushCodePointConsumedAsCharacterReference(cp) {\n if (this._isCharacterReferenceInAttribute()) {\n this.currentAttr.value += String.fromCodePoint(cp);\n }\n else {\n this._emitCodePoint(cp);\n }\n }\n // Calling states this way turns out to be much faster than any other approach.\n _callState(cp) {\n switch (this.state) {\n case State.DATA: {\n this._stateData(cp);\n break;\n }\n case State.RCDATA: {\n this._stateRcdata(cp);\n break;\n }\n case State.RAWTEXT: {\n this._stateRawtext(cp);\n break;\n }\n case State.SCRIPT_DATA: {\n this._stateScriptData(cp);\n break;\n }\n case State.PLAINTEXT: {\n this._statePlaintext(cp);\n break;\n }\n case State.TAG_OPEN: {\n this._stateTagOpen(cp);\n break;\n }\n case State.END_TAG_OPEN: {\n this._stateEndTagOpen(cp);\n break;\n }\n case State.TAG_NAME: {\n this._stateTagName(cp);\n break;\n }\n case State.RCDATA_LESS_THAN_SIGN: {\n this._stateRcdataLessThanSign(cp);\n break;\n }\n case State.RCDATA_END_TAG_OPEN: {\n this._stateRcdataEndTagOpen(cp);\n break;\n }\n case State.RCDATA_END_TAG_NAME: {\n this._stateRcdataEndTagName(cp);\n break;\n }\n case State.RAWTEXT_LESS_THAN_SIGN: {\n this._stateRawtextLessThanSign(cp);\n break;\n }\n case State.RAWTEXT_END_TAG_OPEN: {\n this._stateRawtextEndTagOpen(cp);\n break;\n }\n case State.RAWTEXT_END_TAG_NAME: {\n this._stateRawtextEndTagName(cp);\n break;\n }\n case State.SCRIPT_DATA_LESS_THAN_SIGN: {\n this._stateScriptDataLessThanSign(cp);\n break;\n }\n case State.SCRIPT_DATA_END_TAG_OPEN: {\n this._stateScriptDataEndTagOpen(cp);\n break;\n }\n case State.SCRIPT_DATA_END_TAG_NAME: {\n this._stateScriptDataEndTagName(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPE_START: {\n this._stateScriptDataEscapeStart(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPE_START_DASH: {\n this._stateScriptDataEscapeStartDash(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPED: {\n this._stateScriptDataEscaped(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPED_DASH: {\n this._stateScriptDataEscapedDash(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPED_DASH_DASH: {\n this._stateScriptDataEscapedDashDash(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: {\n this._stateScriptDataEscapedLessThanSign(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPED_END_TAG_OPEN: {\n this._stateScriptDataEscapedEndTagOpen(cp);\n break;\n }\n case State.SCRIPT_DATA_ESCAPED_END_TAG_NAME: {\n this._stateScriptDataEscapedEndTagName(cp);\n break;\n }\n case State.SCRIPT_DATA_DOUBLE_ESCAPE_START: {\n this._stateScriptDataDoubleEscapeStart(cp);\n break;\n }\n case State.SCRIPT_DATA_DOUBLE_ESCAPED: {\n this._stateScriptDataDoubleEscaped(cp);\n break;\n }\n case State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH: {\n this._stateScriptDataDoubleEscapedDash(cp);\n break;\n }\n case State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH: {\n this._stateScriptDataDoubleEscapedDashDash(cp);\n break;\n }\n case State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN: {\n this._stateScriptDataDoubleEscapedLessThanSign(cp);\n break;\n }\n case State.SCRIPT_DATA_DOUBLE_ESCAPE_END: {\n this._stateScriptDataDoubleEscapeEnd(cp);\n break;\n }\n case State.BEFORE_ATTRIBUTE_NAME: {\n this._stateBeforeAttributeName(cp);\n break;\n }\n case State.ATTRIBUTE_NAME: {\n this._stateAttributeName(cp);\n break;\n }\n case State.AFTER_ATTRIBUTE_NAME: {\n this._stateAfterAttributeName(cp);\n break;\n }\n case State.BEFORE_ATTRIBUTE_VALUE: {\n this._stateBeforeAttributeValue(cp);\n break;\n }\n case State.ATTRIBUTE_VALUE_DOUBLE_QUOTED: {\n this._stateAttributeValueDoubleQuoted(cp);\n break;\n }\n case State.ATTRIBUTE_VALUE_SINGLE_QUOTED: {\n this._stateAttributeValueSingleQuoted(cp);\n break;\n }\n case State.ATTRIBUTE_VALUE_UNQUOTED: {\n this._stateAttributeValueUnquoted(cp);\n break;\n }\n case State.AFTER_ATTRIBUTE_VALUE_QUOTED: {\n this._stateAfterAttributeValueQuoted(cp);\n break;\n }\n case State.SELF_CLOSING_START_TAG: {\n this._stateSelfClosingStartTag(cp);\n break;\n }\n case State.BOGUS_COMMENT: {\n this._stateBogusComment(cp);\n break;\n }\n case State.MARKUP_DECLARATION_OPEN: {\n this._stateMarkupDeclarationOpen(cp);\n break;\n }\n case State.COMMENT_START: {\n this._stateCommentStart(cp);\n break;\n }\n case State.COMMENT_START_DASH: {\n this._stateCommentStartDash(cp);\n break;\n }\n case State.COMMENT: {\n this._stateComment(cp);\n break;\n }\n case State.COMMENT_LESS_THAN_SIGN: {\n this._stateCommentLessThanSign(cp);\n break;\n }\n case State.COMMENT_LESS_THAN_SIGN_BANG: {\n this._stateCommentLessThanSignBang(cp);\n break;\n }\n case State.COMMENT_LESS_THAN_SIGN_BANG_DASH: {\n this._stateCommentLessThanSignBangDash(cp);\n break;\n }\n case State.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH: {\n this._stateCommentLessThanSignBangDashDash(cp);\n break;\n }\n case State.COMMENT_END_DASH: {\n this._stateCommentEndDash(cp);\n break;\n }\n case State.COMMENT_END: {\n this._stateCommentEnd(cp);\n break;\n }\n case State.COMMENT_END_BANG: {\n this._stateCommentEndBang(cp);\n break;\n }\n case State.DOCTYPE: {\n this._stateDoctype(cp);\n break;\n }\n case State.BEFORE_DOCTYPE_NAME: {\n this._stateBeforeDoctypeName(cp);\n break;\n }\n case State.DOCTYPE_NAME: {\n this._stateDoctypeName(cp);\n break;\n }\n case State.AFTER_DOCTYPE_NAME: {\n this._stateAfterDoctypeName(cp);\n break;\n }\n case State.AFTER_DOCTYPE_PUBLIC_KEYWORD: {\n this._stateAfterDoctypePublicKeyword(cp);\n break;\n }\n case State.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: {\n this._stateBeforeDoctypePublicIdentifier(cp);\n break;\n }\n case State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: {\n this._stateDoctypePublicIdentifierDoubleQuoted(cp);\n break;\n }\n case State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: {\n this._stateDoctypePublicIdentifierSingleQuoted(cp);\n break;\n }\n case State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER: {\n this._stateAfterDoctypePublicIdentifier(cp);\n break;\n }\n case State.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: {\n this._stateBetweenDoctypePublicAndSystemIdentifiers(cp);\n break;\n }\n case State.AFTER_DOCTYPE_SYSTEM_KEYWORD: {\n this._stateAfterDoctypeSystemKeyword(cp);\n break;\n }\n case State.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: {\n this._stateBeforeDoctypeSystemIdentifier(cp);\n break;\n }\n case State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: {\n this._stateDoctypeSystemIdentifierDoubleQuoted(cp);\n break;\n }\n case State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: {\n this._stateDoctypeSystemIdentifierSingleQuoted(cp);\n break;\n }\n case State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER: {\n this._stateAfterDoctypeSystemIdentifier(cp);\n break;\n }\n case State.BOGUS_DOCTYPE: {\n this._stateBogusDoctype(cp);\n break;\n }\n case State.CDATA_SECTION: {\n this._stateCdataSection(cp);\n break;\n }\n case State.CDATA_SECTION_BRACKET: {\n this._stateCdataSectionBracket(cp);\n break;\n }\n case State.CDATA_SECTION_END: {\n this._stateCdataSectionEnd(cp);\n break;\n }\n case State.CHARACTER_REFERENCE: {\n this._stateCharacterReference(cp);\n break;\n }\n case State.NAMED_CHARACTER_REFERENCE: {\n this._stateNamedCharacterReference(cp);\n break;\n }\n case State.AMBIGUOUS_AMPERSAND: {\n this._stateAmbiguousAmpersand(cp);\n break;\n }\n case State.NUMERIC_CHARACTER_REFERENCE: {\n this._stateNumericCharacterReference(cp);\n break;\n }\n case State.HEXADEMICAL_CHARACTER_REFERENCE_START: {\n this._stateHexademicalCharacterReferenceStart(cp);\n break;\n }\n case State.HEXADEMICAL_CHARACTER_REFERENCE: {\n this._stateHexademicalCharacterReference(cp);\n break;\n }\n case State.DECIMAL_CHARACTER_REFERENCE: {\n this._stateDecimalCharacterReference(cp);\n break;\n }\n case State.NUMERIC_CHARACTER_REFERENCE_END: {\n this._stateNumericCharacterReferenceEnd(cp);\n break;\n }\n default: {\n throw new Error('Unknown state');\n }\n }\n }\n // State machine\n // Data state\n //------------------------------------------------------------------\n _stateData(cp) {\n switch (cp) {\n case $.LESS_THAN_SIGN: {\n this.state = State.TAG_OPEN;\n break;\n }\n case $.AMPERSAND: {\n this.returnState = State.DATA;\n this.state = State.CHARACTER_REFERENCE;\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n this._emitCodePoint(cp);\n break;\n }\n case $.EOF: {\n this._emitEOFToken();\n break;\n }\n default: {\n this._emitCodePoint(cp);\n }\n }\n }\n // RCDATA state\n //------------------------------------------------------------------\n _stateRcdata(cp) {\n switch (cp) {\n case $.AMPERSAND: {\n this.returnState = State.RCDATA;\n this.state = State.CHARACTER_REFERENCE;\n break;\n }\n case $.LESS_THAN_SIGN: {\n this.state = State.RCDATA_LESS_THAN_SIGN;\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(REPLACEMENT_CHARACTER);\n break;\n }\n case $.EOF: {\n this._emitEOFToken();\n break;\n }\n default: {\n this._emitCodePoint(cp);\n }\n }\n }\n // RAWTEXT state\n //------------------------------------------------------------------\n _stateRawtext(cp) {\n switch (cp) {\n case $.LESS_THAN_SIGN: {\n this.state = State.RAWTEXT_LESS_THAN_SIGN;\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(REPLACEMENT_CHARACTER);\n break;\n }\n case $.EOF: {\n this._emitEOFToken();\n break;\n }\n default: {\n this._emitCodePoint(cp);\n }\n }\n }\n // Script data state\n //------------------------------------------------------------------\n _stateScriptData(cp) {\n switch (cp) {\n case $.LESS_THAN_SIGN: {\n this.state = State.SCRIPT_DATA_LESS_THAN_SIGN;\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(REPLACEMENT_CHARACTER);\n break;\n }\n case $.EOF: {\n this._emitEOFToken();\n break;\n }\n default: {\n this._emitCodePoint(cp);\n }\n }\n }\n // PLAINTEXT state\n //------------------------------------------------------------------\n _statePlaintext(cp) {\n switch (cp) {\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(REPLACEMENT_CHARACTER);\n break;\n }\n case $.EOF: {\n this._emitEOFToken();\n break;\n }\n default: {\n this._emitCodePoint(cp);\n }\n }\n }\n // Tag open state\n //------------------------------------------------------------------\n _stateTagOpen(cp) {\n if (isAsciiLetter(cp)) {\n this._createStartTagToken();\n this.state = State.TAG_NAME;\n this._stateTagName(cp);\n }\n else\n switch (cp) {\n case $.EXCLAMATION_MARK: {\n this.state = State.MARKUP_DECLARATION_OPEN;\n break;\n }\n case $.SOLIDUS: {\n this.state = State.END_TAG_OPEN;\n break;\n }\n case $.QUESTION_MARK: {\n this._err(ERR.unexpectedQuestionMarkInsteadOfTagName);\n this._createCommentToken(1);\n this.state = State.BOGUS_COMMENT;\n this._stateBogusComment(cp);\n break;\n }\n case $.EOF: {\n this._err(ERR.eofBeforeTagName);\n this._emitChars('<');\n this._emitEOFToken();\n break;\n }\n default: {\n this._err(ERR.invalidFirstCharacterOfTagName);\n this._emitChars('<');\n this.state = State.DATA;\n this._stateData(cp);\n }\n }\n }\n // End tag open state\n //------------------------------------------------------------------\n _stateEndTagOpen(cp) {\n if (isAsciiLetter(cp)) {\n this._createEndTagToken();\n this.state = State.TAG_NAME;\n this._stateTagName(cp);\n }\n else\n switch (cp) {\n case $.GREATER_THAN_SIGN: {\n this._err(ERR.missingEndTagName);\n this.state = State.DATA;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofBeforeTagName);\n this._emitChars('');\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n this.state = State.SCRIPT_DATA_ESCAPED;\n this._emitChars(REPLACEMENT_CHARACTER);\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n break;\n }\n default: {\n this.state = State.SCRIPT_DATA_ESCAPED;\n this._emitCodePoint(cp);\n }\n }\n }\n // Script data escaped less-than sign state\n //------------------------------------------------------------------\n _stateScriptDataEscapedLessThanSign(cp) {\n if (cp === $.SOLIDUS) {\n this.state = State.SCRIPT_DATA_ESCAPED_END_TAG_OPEN;\n }\n else if (isAsciiLetter(cp)) {\n this._emitChars('<');\n this.state = State.SCRIPT_DATA_DOUBLE_ESCAPE_START;\n this._stateScriptDataDoubleEscapeStart(cp);\n }\n else {\n this._emitChars('<');\n this.state = State.SCRIPT_DATA_ESCAPED;\n this._stateScriptDataEscaped(cp);\n }\n }\n // Script data escaped end tag open state\n //------------------------------------------------------------------\n _stateScriptDataEscapedEndTagOpen(cp) {\n if (isAsciiLetter(cp)) {\n this.state = State.SCRIPT_DATA_ESCAPED_END_TAG_NAME;\n this._stateScriptDataEscapedEndTagName(cp);\n }\n else {\n this._emitChars('');\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;\n this._emitChars(REPLACEMENT_CHARACTER);\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n break;\n }\n default: {\n this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;\n this._emitCodePoint(cp);\n }\n }\n }\n // Script data double escaped less-than sign state\n //------------------------------------------------------------------\n _stateScriptDataDoubleEscapedLessThanSign(cp) {\n if (cp === $.SOLIDUS) {\n this.state = State.SCRIPT_DATA_DOUBLE_ESCAPE_END;\n this._emitChars('/');\n }\n else {\n this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;\n this._stateScriptDataDoubleEscaped(cp);\n }\n }\n // Script data double escape end state\n //------------------------------------------------------------------\n _stateScriptDataDoubleEscapeEnd(cp) {\n if (this.preprocessor.startsWith($$.SCRIPT, false) &&\n isScriptDataDoubleEscapeSequenceEnd(this.preprocessor.peek($$.SCRIPT.length))) {\n this._emitCodePoint(cp);\n for (let i = 0; i < $$.SCRIPT.length; i++) {\n this._emitCodePoint(this._consume());\n }\n this.state = State.SCRIPT_DATA_ESCAPED;\n }\n else if (!this._ensureHibernation()) {\n this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;\n this._stateScriptDataDoubleEscaped(cp);\n }\n }\n // Before attribute name state\n //------------------------------------------------------------------\n _stateBeforeAttributeName(cp) {\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n // Ignore whitespace\n break;\n }\n case $.SOLIDUS:\n case $.GREATER_THAN_SIGN:\n case $.EOF: {\n this.state = State.AFTER_ATTRIBUTE_NAME;\n this._stateAfterAttributeName(cp);\n break;\n }\n case $.EQUALS_SIGN: {\n this._err(ERR.unexpectedEqualsSignBeforeAttributeName);\n this._createAttr('=');\n this.state = State.ATTRIBUTE_NAME;\n break;\n }\n default: {\n this._createAttr('');\n this.state = State.ATTRIBUTE_NAME;\n this._stateAttributeName(cp);\n }\n }\n }\n // Attribute name state\n //------------------------------------------------------------------\n _stateAttributeName(cp) {\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED:\n case $.SOLIDUS:\n case $.GREATER_THAN_SIGN:\n case $.EOF: {\n this._leaveAttrName();\n this.state = State.AFTER_ATTRIBUTE_NAME;\n this._stateAfterAttributeName(cp);\n break;\n }\n case $.EQUALS_SIGN: {\n this._leaveAttrName();\n this.state = State.BEFORE_ATTRIBUTE_VALUE;\n break;\n }\n case $.QUOTATION_MARK:\n case $.APOSTROPHE:\n case $.LESS_THAN_SIGN: {\n this._err(ERR.unexpectedCharacterInAttributeName);\n this.currentAttr.name += String.fromCodePoint(cp);\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n this.currentAttr.name += REPLACEMENT_CHARACTER;\n break;\n }\n default: {\n this.currentAttr.name += String.fromCodePoint(isAsciiUpper(cp) ? toAsciiLower(cp) : cp);\n }\n }\n }\n // After attribute name state\n //------------------------------------------------------------------\n _stateAfterAttributeName(cp) {\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n // Ignore whitespace\n break;\n }\n case $.SOLIDUS: {\n this.state = State.SELF_CLOSING_START_TAG;\n break;\n }\n case $.EQUALS_SIGN: {\n this.state = State.BEFORE_ATTRIBUTE_VALUE;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this.state = State.DATA;\n this.emitCurrentTagToken();\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInTag);\n this._emitEOFToken();\n break;\n }\n default: {\n this._createAttr('');\n this.state = State.ATTRIBUTE_NAME;\n this._stateAttributeName(cp);\n }\n }\n }\n // Before attribute value state\n //------------------------------------------------------------------\n _stateBeforeAttributeValue(cp) {\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n // Ignore whitespace\n break;\n }\n case $.QUOTATION_MARK: {\n this.state = State.ATTRIBUTE_VALUE_DOUBLE_QUOTED;\n break;\n }\n case $.APOSTROPHE: {\n this.state = State.ATTRIBUTE_VALUE_SINGLE_QUOTED;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._err(ERR.missingAttributeValue);\n this.state = State.DATA;\n this.emitCurrentTagToken();\n break;\n }\n default: {\n this.state = State.ATTRIBUTE_VALUE_UNQUOTED;\n this._stateAttributeValueUnquoted(cp);\n }\n }\n }\n // Attribute value (double-quoted) state\n //------------------------------------------------------------------\n _stateAttributeValueDoubleQuoted(cp) {\n switch (cp) {\n case $.QUOTATION_MARK: {\n this.state = State.AFTER_ATTRIBUTE_VALUE_QUOTED;\n break;\n }\n case $.AMPERSAND: {\n this.returnState = State.ATTRIBUTE_VALUE_DOUBLE_QUOTED;\n this.state = State.CHARACTER_REFERENCE;\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n this.currentAttr.value += REPLACEMENT_CHARACTER;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInTag);\n this._emitEOFToken();\n break;\n }\n default: {\n this.currentAttr.value += String.fromCodePoint(cp);\n }\n }\n }\n // Attribute value (single-quoted) state\n //------------------------------------------------------------------\n _stateAttributeValueSingleQuoted(cp) {\n switch (cp) {\n case $.APOSTROPHE: {\n this.state = State.AFTER_ATTRIBUTE_VALUE_QUOTED;\n break;\n }\n case $.AMPERSAND: {\n this.returnState = State.ATTRIBUTE_VALUE_SINGLE_QUOTED;\n this.state = State.CHARACTER_REFERENCE;\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n this.currentAttr.value += REPLACEMENT_CHARACTER;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInTag);\n this._emitEOFToken();\n break;\n }\n default: {\n this.currentAttr.value += String.fromCodePoint(cp);\n }\n }\n }\n // Attribute value (unquoted) state\n //------------------------------------------------------------------\n _stateAttributeValueUnquoted(cp) {\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n this._leaveAttrValue();\n this.state = State.BEFORE_ATTRIBUTE_NAME;\n break;\n }\n case $.AMPERSAND: {\n this.returnState = State.ATTRIBUTE_VALUE_UNQUOTED;\n this.state = State.CHARACTER_REFERENCE;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._leaveAttrValue();\n this.state = State.DATA;\n this.emitCurrentTagToken();\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n this.currentAttr.value += REPLACEMENT_CHARACTER;\n break;\n }\n case $.QUOTATION_MARK:\n case $.APOSTROPHE:\n case $.LESS_THAN_SIGN:\n case $.EQUALS_SIGN:\n case $.GRAVE_ACCENT: {\n this._err(ERR.unexpectedCharacterInUnquotedAttributeValue);\n this.currentAttr.value += String.fromCodePoint(cp);\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInTag);\n this._emitEOFToken();\n break;\n }\n default: {\n this.currentAttr.value += String.fromCodePoint(cp);\n }\n }\n }\n // After attribute value (quoted) state\n //------------------------------------------------------------------\n _stateAfterAttributeValueQuoted(cp) {\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n this._leaveAttrValue();\n this.state = State.BEFORE_ATTRIBUTE_NAME;\n break;\n }\n case $.SOLIDUS: {\n this._leaveAttrValue();\n this.state = State.SELF_CLOSING_START_TAG;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._leaveAttrValue();\n this.state = State.DATA;\n this.emitCurrentTagToken();\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInTag);\n this._emitEOFToken();\n break;\n }\n default: {\n this._err(ERR.missingWhitespaceBetweenAttributes);\n this.state = State.BEFORE_ATTRIBUTE_NAME;\n this._stateBeforeAttributeName(cp);\n }\n }\n }\n // Self-closing start tag state\n //------------------------------------------------------------------\n _stateSelfClosingStartTag(cp) {\n switch (cp) {\n case $.GREATER_THAN_SIGN: {\n const token = this.currentToken;\n token.selfClosing = true;\n this.state = State.DATA;\n this.emitCurrentTagToken();\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInTag);\n this._emitEOFToken();\n break;\n }\n default: {\n this._err(ERR.unexpectedSolidusInTag);\n this.state = State.BEFORE_ATTRIBUTE_NAME;\n this._stateBeforeAttributeName(cp);\n }\n }\n }\n // Bogus comment state\n //------------------------------------------------------------------\n _stateBogusComment(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.GREATER_THAN_SIGN: {\n this.state = State.DATA;\n this.emitCurrentComment(token);\n break;\n }\n case $.EOF: {\n this.emitCurrentComment(token);\n this._emitEOFToken();\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n token.data += REPLACEMENT_CHARACTER;\n break;\n }\n default: {\n token.data += String.fromCodePoint(cp);\n }\n }\n }\n // Markup declaration open state\n //------------------------------------------------------------------\n _stateMarkupDeclarationOpen(cp) {\n if (this._consumeSequenceIfMatch($$.DASH_DASH, true)) {\n this._createCommentToken($$.DASH_DASH.length + 1);\n this.state = State.COMMENT_START;\n }\n else if (this._consumeSequenceIfMatch($$.DOCTYPE, false)) {\n // NOTE: Doctypes tokens are created without fixed offsets. We keep track of the moment a doctype *might* start here.\n this.currentLocation = this.getCurrentLocation($$.DOCTYPE.length + 1);\n this.state = State.DOCTYPE;\n }\n else if (this._consumeSequenceIfMatch($$.CDATA_START, true)) {\n if (this.inForeignNode) {\n this.state = State.CDATA_SECTION;\n }\n else {\n this._err(ERR.cdataInHtmlContent);\n this._createCommentToken($$.CDATA_START.length + 1);\n this.currentToken.data = '[CDATA[';\n this.state = State.BOGUS_COMMENT;\n }\n }\n //NOTE: Sequence lookups can be abrupted by hibernation. In that case, lookup\n //results are no longer valid and we will need to start over.\n else if (!this._ensureHibernation()) {\n this._err(ERR.incorrectlyOpenedComment);\n this._createCommentToken(2);\n this.state = State.BOGUS_COMMENT;\n this._stateBogusComment(cp);\n }\n }\n // Comment start state\n //------------------------------------------------------------------\n _stateCommentStart(cp) {\n switch (cp) {\n case $.HYPHEN_MINUS: {\n this.state = State.COMMENT_START_DASH;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._err(ERR.abruptClosingOfEmptyComment);\n this.state = State.DATA;\n const token = this.currentToken;\n this.emitCurrentComment(token);\n break;\n }\n default: {\n this.state = State.COMMENT;\n this._stateComment(cp);\n }\n }\n }\n // Comment start dash state\n //------------------------------------------------------------------\n _stateCommentStartDash(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.HYPHEN_MINUS: {\n this.state = State.COMMENT_END;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._err(ERR.abruptClosingOfEmptyComment);\n this.state = State.DATA;\n this.emitCurrentComment(token);\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInComment);\n this.emitCurrentComment(token);\n this._emitEOFToken();\n break;\n }\n default: {\n token.data += '-';\n this.state = State.COMMENT;\n this._stateComment(cp);\n }\n }\n }\n // Comment state\n //------------------------------------------------------------------\n _stateComment(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.HYPHEN_MINUS: {\n this.state = State.COMMENT_END_DASH;\n break;\n }\n case $.LESS_THAN_SIGN: {\n token.data += '<';\n this.state = State.COMMENT_LESS_THAN_SIGN;\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n token.data += REPLACEMENT_CHARACTER;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInComment);\n this.emitCurrentComment(token);\n this._emitEOFToken();\n break;\n }\n default: {\n token.data += String.fromCodePoint(cp);\n }\n }\n }\n // Comment less-than sign state\n //------------------------------------------------------------------\n _stateCommentLessThanSign(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.EXCLAMATION_MARK: {\n token.data += '!';\n this.state = State.COMMENT_LESS_THAN_SIGN_BANG;\n break;\n }\n case $.LESS_THAN_SIGN: {\n token.data += '<';\n break;\n }\n default: {\n this.state = State.COMMENT;\n this._stateComment(cp);\n }\n }\n }\n // Comment less-than sign bang state\n //------------------------------------------------------------------\n _stateCommentLessThanSignBang(cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = State.COMMENT_LESS_THAN_SIGN_BANG_DASH;\n }\n else {\n this.state = State.COMMENT;\n this._stateComment(cp);\n }\n }\n // Comment less-than sign bang dash state\n //------------------------------------------------------------------\n _stateCommentLessThanSignBangDash(cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = State.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH;\n }\n else {\n this.state = State.COMMENT_END_DASH;\n this._stateCommentEndDash(cp);\n }\n }\n // Comment less-than sign bang dash dash state\n //------------------------------------------------------------------\n _stateCommentLessThanSignBangDashDash(cp) {\n if (cp !== $.GREATER_THAN_SIGN && cp !== $.EOF) {\n this._err(ERR.nestedComment);\n }\n this.state = State.COMMENT_END;\n this._stateCommentEnd(cp);\n }\n // Comment end dash state\n //------------------------------------------------------------------\n _stateCommentEndDash(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.HYPHEN_MINUS: {\n this.state = State.COMMENT_END;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInComment);\n this.emitCurrentComment(token);\n this._emitEOFToken();\n break;\n }\n default: {\n token.data += '-';\n this.state = State.COMMENT;\n this._stateComment(cp);\n }\n }\n }\n // Comment end state\n //------------------------------------------------------------------\n _stateCommentEnd(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.GREATER_THAN_SIGN: {\n this.state = State.DATA;\n this.emitCurrentComment(token);\n break;\n }\n case $.EXCLAMATION_MARK: {\n this.state = State.COMMENT_END_BANG;\n break;\n }\n case $.HYPHEN_MINUS: {\n token.data += '-';\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInComment);\n this.emitCurrentComment(token);\n this._emitEOFToken();\n break;\n }\n default: {\n token.data += '--';\n this.state = State.COMMENT;\n this._stateComment(cp);\n }\n }\n }\n // Comment end bang state\n //------------------------------------------------------------------\n _stateCommentEndBang(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.HYPHEN_MINUS: {\n token.data += '--!';\n this.state = State.COMMENT_END_DASH;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._err(ERR.incorrectlyClosedComment);\n this.state = State.DATA;\n this.emitCurrentComment(token);\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInComment);\n this.emitCurrentComment(token);\n this._emitEOFToken();\n break;\n }\n default: {\n token.data += '--!';\n this.state = State.COMMENT;\n this._stateComment(cp);\n }\n }\n }\n // DOCTYPE state\n //------------------------------------------------------------------\n _stateDoctype(cp) {\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n this.state = State.BEFORE_DOCTYPE_NAME;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this.state = State.BEFORE_DOCTYPE_NAME;\n this._stateBeforeDoctypeName(cp);\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n this._createDoctypeToken(null);\n const token = this.currentToken;\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n this._err(ERR.missingWhitespaceBeforeDoctypeName);\n this.state = State.BEFORE_DOCTYPE_NAME;\n this._stateBeforeDoctypeName(cp);\n }\n }\n }\n // Before DOCTYPE name state\n //------------------------------------------------------------------\n _stateBeforeDoctypeName(cp) {\n if (isAsciiUpper(cp)) {\n this._createDoctypeToken(String.fromCharCode(toAsciiLower(cp)));\n this.state = State.DOCTYPE_NAME;\n }\n else\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n // Ignore whitespace\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n this._createDoctypeToken(REPLACEMENT_CHARACTER);\n this.state = State.DOCTYPE_NAME;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._err(ERR.missingDoctypeName);\n this._createDoctypeToken(null);\n const token = this.currentToken;\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this.state = State.DATA;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n this._createDoctypeToken(null);\n const token = this.currentToken;\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n this._createDoctypeToken(String.fromCodePoint(cp));\n this.state = State.DOCTYPE_NAME;\n }\n }\n }\n // DOCTYPE name state\n //------------------------------------------------------------------\n _stateDoctypeName(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n this.state = State.AFTER_DOCTYPE_NAME;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this.state = State.DATA;\n this.emitCurrentDoctype(token);\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n token.name += REPLACEMENT_CHARACTER;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n token.name += String.fromCodePoint(isAsciiUpper(cp) ? toAsciiLower(cp) : cp);\n }\n }\n }\n // After DOCTYPE name state\n //------------------------------------------------------------------\n _stateAfterDoctypeName(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n // Ignore whitespace\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this.state = State.DATA;\n this.emitCurrentDoctype(token);\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n if (this._consumeSequenceIfMatch($$.PUBLIC, false)) {\n this.state = State.AFTER_DOCTYPE_PUBLIC_KEYWORD;\n }\n else if (this._consumeSequenceIfMatch($$.SYSTEM, false)) {\n this.state = State.AFTER_DOCTYPE_SYSTEM_KEYWORD;\n }\n //NOTE: sequence lookup can be abrupted by hibernation. In that case lookup\n //results are no longer valid and we will need to start over.\n else if (!this._ensureHibernation()) {\n this._err(ERR.invalidCharacterSequenceAfterDoctypeName);\n token.forceQuirks = true;\n this.state = State.BOGUS_DOCTYPE;\n this._stateBogusDoctype(cp);\n }\n }\n }\n }\n // After DOCTYPE public keyword state\n //------------------------------------------------------------------\n _stateAfterDoctypePublicKeyword(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n this.state = State.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;\n break;\n }\n case $.QUOTATION_MARK: {\n this._err(ERR.missingWhitespaceAfterDoctypePublicKeyword);\n token.publicId = '';\n this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;\n break;\n }\n case $.APOSTROPHE: {\n this._err(ERR.missingWhitespaceAfterDoctypePublicKeyword);\n token.publicId = '';\n this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._err(ERR.missingDoctypePublicIdentifier);\n token.forceQuirks = true;\n this.state = State.DATA;\n this.emitCurrentDoctype(token);\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n this._err(ERR.missingQuoteBeforeDoctypePublicIdentifier);\n token.forceQuirks = true;\n this.state = State.BOGUS_DOCTYPE;\n this._stateBogusDoctype(cp);\n }\n }\n }\n // Before DOCTYPE public identifier state\n //------------------------------------------------------------------\n _stateBeforeDoctypePublicIdentifier(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n // Ignore whitespace\n break;\n }\n case $.QUOTATION_MARK: {\n token.publicId = '';\n this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;\n break;\n }\n case $.APOSTROPHE: {\n token.publicId = '';\n this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._err(ERR.missingDoctypePublicIdentifier);\n token.forceQuirks = true;\n this.state = State.DATA;\n this.emitCurrentDoctype(token);\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n this._err(ERR.missingQuoteBeforeDoctypePublicIdentifier);\n token.forceQuirks = true;\n this.state = State.BOGUS_DOCTYPE;\n this._stateBogusDoctype(cp);\n }\n }\n }\n // DOCTYPE public identifier (double-quoted) state\n //------------------------------------------------------------------\n _stateDoctypePublicIdentifierDoubleQuoted(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.QUOTATION_MARK: {\n this.state = State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n token.publicId += REPLACEMENT_CHARACTER;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._err(ERR.abruptDoctypePublicIdentifier);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this.state = State.DATA;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n token.publicId += String.fromCodePoint(cp);\n }\n }\n }\n // DOCTYPE public identifier (single-quoted) state\n //------------------------------------------------------------------\n _stateDoctypePublicIdentifierSingleQuoted(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.APOSTROPHE: {\n this.state = State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n token.publicId += REPLACEMENT_CHARACTER;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._err(ERR.abruptDoctypePublicIdentifier);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this.state = State.DATA;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n token.publicId += String.fromCodePoint(cp);\n }\n }\n }\n // After DOCTYPE public identifier state\n //------------------------------------------------------------------\n _stateAfterDoctypePublicIdentifier(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n this.state = State.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this.state = State.DATA;\n this.emitCurrentDoctype(token);\n break;\n }\n case $.QUOTATION_MARK: {\n this._err(ERR.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers);\n token.systemId = '';\n this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;\n break;\n }\n case $.APOSTROPHE: {\n this._err(ERR.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers);\n token.systemId = '';\n this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);\n token.forceQuirks = true;\n this.state = State.BOGUS_DOCTYPE;\n this._stateBogusDoctype(cp);\n }\n }\n }\n // Between DOCTYPE public and system identifiers state\n //------------------------------------------------------------------\n _stateBetweenDoctypePublicAndSystemIdentifiers(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n // Ignore whitespace\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this.emitCurrentDoctype(token);\n this.state = State.DATA;\n break;\n }\n case $.QUOTATION_MARK: {\n token.systemId = '';\n this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;\n break;\n }\n case $.APOSTROPHE: {\n token.systemId = '';\n this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);\n token.forceQuirks = true;\n this.state = State.BOGUS_DOCTYPE;\n this._stateBogusDoctype(cp);\n }\n }\n }\n // After DOCTYPE system keyword state\n //------------------------------------------------------------------\n _stateAfterDoctypeSystemKeyword(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n this.state = State.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;\n break;\n }\n case $.QUOTATION_MARK: {\n this._err(ERR.missingWhitespaceAfterDoctypeSystemKeyword);\n token.systemId = '';\n this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;\n break;\n }\n case $.APOSTROPHE: {\n this._err(ERR.missingWhitespaceAfterDoctypeSystemKeyword);\n token.systemId = '';\n this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._err(ERR.missingDoctypeSystemIdentifier);\n token.forceQuirks = true;\n this.state = State.DATA;\n this.emitCurrentDoctype(token);\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);\n token.forceQuirks = true;\n this.state = State.BOGUS_DOCTYPE;\n this._stateBogusDoctype(cp);\n }\n }\n }\n // Before DOCTYPE system identifier state\n //------------------------------------------------------------------\n _stateBeforeDoctypeSystemIdentifier(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n // Ignore whitespace\n break;\n }\n case $.QUOTATION_MARK: {\n token.systemId = '';\n this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;\n break;\n }\n case $.APOSTROPHE: {\n token.systemId = '';\n this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._err(ERR.missingDoctypeSystemIdentifier);\n token.forceQuirks = true;\n this.state = State.DATA;\n this.emitCurrentDoctype(token);\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);\n token.forceQuirks = true;\n this.state = State.BOGUS_DOCTYPE;\n this._stateBogusDoctype(cp);\n }\n }\n }\n // DOCTYPE system identifier (double-quoted) state\n //------------------------------------------------------------------\n _stateDoctypeSystemIdentifierDoubleQuoted(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.QUOTATION_MARK: {\n this.state = State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n token.systemId += REPLACEMENT_CHARACTER;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._err(ERR.abruptDoctypeSystemIdentifier);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this.state = State.DATA;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n token.systemId += String.fromCodePoint(cp);\n }\n }\n }\n // DOCTYPE system identifier (single-quoted) state\n //------------------------------------------------------------------\n _stateDoctypeSystemIdentifierSingleQuoted(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.APOSTROPHE: {\n this.state = State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n token.systemId += REPLACEMENT_CHARACTER;\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this._err(ERR.abruptDoctypeSystemIdentifier);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this.state = State.DATA;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n token.systemId += String.fromCodePoint(cp);\n }\n }\n }\n // After DOCTYPE system identifier state\n //------------------------------------------------------------------\n _stateAfterDoctypeSystemIdentifier(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.SPACE:\n case $.LINE_FEED:\n case $.TABULATION:\n case $.FORM_FEED: {\n // Ignore whitespace\n break;\n }\n case $.GREATER_THAN_SIGN: {\n this.emitCurrentDoctype(token);\n this.state = State.DATA;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInDoctype);\n token.forceQuirks = true;\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default: {\n this._err(ERR.unexpectedCharacterAfterDoctypeSystemIdentifier);\n this.state = State.BOGUS_DOCTYPE;\n this._stateBogusDoctype(cp);\n }\n }\n }\n // Bogus DOCTYPE state\n //------------------------------------------------------------------\n _stateBogusDoctype(cp) {\n const token = this.currentToken;\n switch (cp) {\n case $.GREATER_THAN_SIGN: {\n this.emitCurrentDoctype(token);\n this.state = State.DATA;\n break;\n }\n case $.NULL: {\n this._err(ERR.unexpectedNullCharacter);\n break;\n }\n case $.EOF: {\n this.emitCurrentDoctype(token);\n this._emitEOFToken();\n break;\n }\n default:\n // Do nothing\n }\n }\n // CDATA section state\n //------------------------------------------------------------------\n _stateCdataSection(cp) {\n switch (cp) {\n case $.RIGHT_SQUARE_BRACKET: {\n this.state = State.CDATA_SECTION_BRACKET;\n break;\n }\n case $.EOF: {\n this._err(ERR.eofInCdata);\n this._emitEOFToken();\n break;\n }\n default: {\n this._emitCodePoint(cp);\n }\n }\n }\n // CDATA section bracket state\n //------------------------------------------------------------------\n _stateCdataSectionBracket(cp) {\n if (cp === $.RIGHT_SQUARE_BRACKET) {\n this.state = State.CDATA_SECTION_END;\n }\n else {\n this._emitChars(']');\n this.state = State.CDATA_SECTION;\n this._stateCdataSection(cp);\n }\n }\n // CDATA section end state\n //------------------------------------------------------------------\n _stateCdataSectionEnd(cp) {\n switch (cp) {\n case $.GREATER_THAN_SIGN: {\n this.state = State.DATA;\n break;\n }\n case $.RIGHT_SQUARE_BRACKET: {\n this._emitChars(']');\n break;\n }\n default: {\n this._emitChars(']]');\n this.state = State.CDATA_SECTION;\n this._stateCdataSection(cp);\n }\n }\n }\n // Character reference state\n //------------------------------------------------------------------\n _stateCharacterReference(cp) {\n if (cp === $.NUMBER_SIGN) {\n this.state = State.NUMERIC_CHARACTER_REFERENCE;\n }\n else if (isAsciiAlphaNumeric(cp)) {\n this.state = State.NAMED_CHARACTER_REFERENCE;\n this._stateNamedCharacterReference(cp);\n }\n else {\n this._flushCodePointConsumedAsCharacterReference($.AMPERSAND);\n this._reconsumeInState(this.returnState, cp);\n }\n }\n // Named character reference state\n //------------------------------------------------------------------\n _stateNamedCharacterReference(cp) {\n const matchResult = this._matchNamedCharacterReference(cp);\n //NOTE: Matching can be abrupted by hibernation. In that case, match\n //results are no longer valid and we will need to start over.\n if (this._ensureHibernation()) {\n // Stay in the state, try again.\n }\n else if (matchResult) {\n for (let i = 0; i < matchResult.length; i++) {\n this._flushCodePointConsumedAsCharacterReference(matchResult[i]);\n }\n this.state = this.returnState;\n }\n else {\n this._flushCodePointConsumedAsCharacterReference($.AMPERSAND);\n this.state = State.AMBIGUOUS_AMPERSAND;\n }\n }\n // Ambiguos ampersand state\n //------------------------------------------------------------------\n _stateAmbiguousAmpersand(cp) {\n if (isAsciiAlphaNumeric(cp)) {\n this._flushCodePointConsumedAsCharacterReference(cp);\n }\n else {\n if (cp === $.SEMICOLON) {\n this._err(ERR.unknownNamedCharacterReference);\n }\n this._reconsumeInState(this.returnState, cp);\n }\n }\n // Numeric character reference state\n //------------------------------------------------------------------\n _stateNumericCharacterReference(cp) {\n this.charRefCode = 0;\n if (cp === $.LATIN_SMALL_X || cp === $.LATIN_CAPITAL_X) {\n this.state = State.HEXADEMICAL_CHARACTER_REFERENCE_START;\n }\n // Inlined decimal character reference start state\n else if (isAsciiDigit(cp)) {\n this.state = State.DECIMAL_CHARACTER_REFERENCE;\n this._stateDecimalCharacterReference(cp);\n }\n else {\n this._err(ERR.absenceOfDigitsInNumericCharacterReference);\n this._flushCodePointConsumedAsCharacterReference($.AMPERSAND);\n this._flushCodePointConsumedAsCharacterReference($.NUMBER_SIGN);\n this._reconsumeInState(this.returnState, cp);\n }\n }\n // Hexademical character reference start state\n //------------------------------------------------------------------\n _stateHexademicalCharacterReferenceStart(cp) {\n if (isAsciiHexDigit(cp)) {\n this.state = State.HEXADEMICAL_CHARACTER_REFERENCE;\n this._stateHexademicalCharacterReference(cp);\n }\n else {\n this._err(ERR.absenceOfDigitsInNumericCharacterReference);\n this._flushCodePointConsumedAsCharacterReference($.AMPERSAND);\n this._flushCodePointConsumedAsCharacterReference($.NUMBER_SIGN);\n this._unconsume(2);\n this.state = this.returnState;\n }\n }\n // Hexademical character reference state\n //------------------------------------------------------------------\n _stateHexademicalCharacterReference(cp) {\n if (isAsciiUpperHexDigit(cp)) {\n this.charRefCode = this.charRefCode * 16 + cp - 0x37;\n }\n else if (isAsciiLowerHexDigit(cp)) {\n this.charRefCode = this.charRefCode * 16 + cp - 0x57;\n }\n else if (isAsciiDigit(cp)) {\n this.charRefCode = this.charRefCode * 16 + cp - 0x30;\n }\n else if (cp === $.SEMICOLON) {\n this.state = State.NUMERIC_CHARACTER_REFERENCE_END;\n }\n else {\n this._err(ERR.missingSemicolonAfterCharacterReference);\n this.state = State.NUMERIC_CHARACTER_REFERENCE_END;\n this._stateNumericCharacterReferenceEnd(cp);\n }\n }\n // Decimal character reference state\n //------------------------------------------------------------------\n _stateDecimalCharacterReference(cp) {\n if (isAsciiDigit(cp)) {\n this.charRefCode = this.charRefCode * 10 + cp - 0x30;\n }\n else if (cp === $.SEMICOLON) {\n this.state = State.NUMERIC_CHARACTER_REFERENCE_END;\n }\n else {\n this._err(ERR.missingSemicolonAfterCharacterReference);\n this.state = State.NUMERIC_CHARACTER_REFERENCE_END;\n this._stateNumericCharacterReferenceEnd(cp);\n }\n }\n // Numeric character reference end state\n //------------------------------------------------------------------\n _stateNumericCharacterReferenceEnd(cp) {\n if (this.charRefCode === $.NULL) {\n this._err(ERR.nullCharacterReference);\n this.charRefCode = $.REPLACEMENT_CHARACTER;\n }\n else if (this.charRefCode > 1114111) {\n this._err(ERR.characterReferenceOutsideUnicodeRange);\n this.charRefCode = $.REPLACEMENT_CHARACTER;\n }\n else if (isSurrogate(this.charRefCode)) {\n this._err(ERR.surrogateCharacterReference);\n this.charRefCode = $.REPLACEMENT_CHARACTER;\n }\n else if (isUndefinedCodePoint(this.charRefCode)) {\n this._err(ERR.noncharacterCharacterReference);\n }\n else if (isControlCodePoint(this.charRefCode) || this.charRefCode === $.CARRIAGE_RETURN) {\n this._err(ERR.controlCharacterReference);\n const replacement = C1_CONTROLS_REFERENCE_REPLACEMENTS.get(this.charRefCode);\n if (replacement !== undefined) {\n this.charRefCode = replacement;\n }\n }\n this._flushCodePointConsumedAsCharacterReference(this.charRefCode);\n this._reconsumeInState(this.returnState, cp);\n }\n}\n//# sourceMappingURL=index.js.map","import { TAG_ID as $, NS, isNumberedHeader } from '../common/html.js';\n//Element utils\nconst IMPLICIT_END_TAG_REQUIRED = new Set([$.DD, $.DT, $.LI, $.OPTGROUP, $.OPTION, $.P, $.RB, $.RP, $.RT, $.RTC]);\nconst IMPLICIT_END_TAG_REQUIRED_THOROUGHLY = new Set([\n ...IMPLICIT_END_TAG_REQUIRED,\n $.CAPTION,\n $.COLGROUP,\n $.TBODY,\n $.TD,\n $.TFOOT,\n $.TH,\n $.THEAD,\n $.TR,\n]);\nconst SCOPING_ELEMENT_NS = new Map([\n [$.APPLET, NS.HTML],\n [$.CAPTION, NS.HTML],\n [$.HTML, NS.HTML],\n [$.MARQUEE, NS.HTML],\n [$.OBJECT, NS.HTML],\n [$.TABLE, NS.HTML],\n [$.TD, NS.HTML],\n [$.TEMPLATE, NS.HTML],\n [$.TH, NS.HTML],\n [$.ANNOTATION_XML, NS.MATHML],\n [$.MI, NS.MATHML],\n [$.MN, NS.MATHML],\n [$.MO, NS.MATHML],\n [$.MS, NS.MATHML],\n [$.MTEXT, NS.MATHML],\n [$.DESC, NS.SVG],\n [$.FOREIGN_OBJECT, NS.SVG],\n [$.TITLE, NS.SVG],\n]);\nconst NAMED_HEADERS = [$.H1, $.H2, $.H3, $.H4, $.H5, $.H6];\nconst TABLE_ROW_CONTEXT = [$.TR, $.TEMPLATE, $.HTML];\nconst TABLE_BODY_CONTEXT = [$.TBODY, $.TFOOT, $.THEAD, $.TEMPLATE, $.HTML];\nconst TABLE_CONTEXT = [$.TABLE, $.TEMPLATE, $.HTML];\nconst TABLE_CELLS = [$.TD, $.TH];\n//Stack of open elements\nexport class OpenElementStack {\n get currentTmplContentOrNode() {\n return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current;\n }\n constructor(document, treeAdapter, handler) {\n this.treeAdapter = treeAdapter;\n this.handler = handler;\n this.items = [];\n this.tagIDs = [];\n this.stackTop = -1;\n this.tmplCount = 0;\n this.currentTagId = $.UNKNOWN;\n this.current = document;\n }\n //Index of element\n _indexOf(element) {\n return this.items.lastIndexOf(element, this.stackTop);\n }\n //Update current element\n _isInTemplate() {\n return this.currentTagId === $.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === NS.HTML;\n }\n _updateCurrentElement() {\n this.current = this.items[this.stackTop];\n this.currentTagId = this.tagIDs[this.stackTop];\n }\n //Mutations\n push(element, tagID) {\n this.stackTop++;\n this.items[this.stackTop] = element;\n this.current = element;\n this.tagIDs[this.stackTop] = tagID;\n this.currentTagId = tagID;\n if (this._isInTemplate()) {\n this.tmplCount++;\n }\n this.handler.onItemPush(element, tagID, true);\n }\n pop() {\n const popped = this.current;\n if (this.tmplCount > 0 && this._isInTemplate()) {\n this.tmplCount--;\n }\n this.stackTop--;\n this._updateCurrentElement();\n this.handler.onItemPop(popped, true);\n }\n replace(oldElement, newElement) {\n const idx = this._indexOf(oldElement);\n this.items[idx] = newElement;\n if (idx === this.stackTop) {\n this.current = newElement;\n }\n }\n insertAfter(referenceElement, newElement, newElementID) {\n const insertionIdx = this._indexOf(referenceElement) + 1;\n this.items.splice(insertionIdx, 0, newElement);\n this.tagIDs.splice(insertionIdx, 0, newElementID);\n this.stackTop++;\n if (insertionIdx === this.stackTop) {\n this._updateCurrentElement();\n }\n this.handler.onItemPush(this.current, this.currentTagId, insertionIdx === this.stackTop);\n }\n popUntilTagNamePopped(tagName) {\n let targetIdx = this.stackTop + 1;\n do {\n targetIdx = this.tagIDs.lastIndexOf(tagName, targetIdx - 1);\n } while (targetIdx > 0 && this.treeAdapter.getNamespaceURI(this.items[targetIdx]) !== NS.HTML);\n this.shortenToLength(targetIdx < 0 ? 0 : targetIdx);\n }\n shortenToLength(idx) {\n while (this.stackTop >= idx) {\n const popped = this.current;\n if (this.tmplCount > 0 && this._isInTemplate()) {\n this.tmplCount -= 1;\n }\n this.stackTop--;\n this._updateCurrentElement();\n this.handler.onItemPop(popped, this.stackTop < idx);\n }\n }\n popUntilElementPopped(element) {\n const idx = this._indexOf(element);\n this.shortenToLength(idx < 0 ? 0 : idx);\n }\n popUntilPopped(tagNames, targetNS) {\n const idx = this._indexOfTagNames(tagNames, targetNS);\n this.shortenToLength(idx < 0 ? 0 : idx);\n }\n popUntilNumberedHeaderPopped() {\n this.popUntilPopped(NAMED_HEADERS, NS.HTML);\n }\n popUntilTableCellPopped() {\n this.popUntilPopped(TABLE_CELLS, NS.HTML);\n }\n popAllUpToHtmlElement() {\n //NOTE: here we assume that the root element is always first in the open element stack, so\n //we perform this fast stack clean up.\n this.tmplCount = 0;\n this.shortenToLength(1);\n }\n _indexOfTagNames(tagNames, namespace) {\n for (let i = this.stackTop; i >= 0; i--) {\n if (tagNames.includes(this.tagIDs[i]) && this.treeAdapter.getNamespaceURI(this.items[i]) === namespace) {\n return i;\n }\n }\n return -1;\n }\n clearBackTo(tagNames, targetNS) {\n const idx = this._indexOfTagNames(tagNames, targetNS);\n this.shortenToLength(idx + 1);\n }\n clearBackToTableContext() {\n this.clearBackTo(TABLE_CONTEXT, NS.HTML);\n }\n clearBackToTableBodyContext() {\n this.clearBackTo(TABLE_BODY_CONTEXT, NS.HTML);\n }\n clearBackToTableRowContext() {\n this.clearBackTo(TABLE_ROW_CONTEXT, NS.HTML);\n }\n remove(element) {\n const idx = this._indexOf(element);\n if (idx >= 0) {\n if (idx === this.stackTop) {\n this.pop();\n }\n else {\n this.items.splice(idx, 1);\n this.tagIDs.splice(idx, 1);\n this.stackTop--;\n this._updateCurrentElement();\n this.handler.onItemPop(element, false);\n }\n }\n }\n //Search\n tryPeekProperlyNestedBodyElement() {\n //Properly nested element (should be second element in stack).\n return this.stackTop >= 1 && this.tagIDs[1] === $.BODY ? this.items[1] : null;\n }\n contains(element) {\n return this._indexOf(element) > -1;\n }\n getCommonAncestor(element) {\n const elementIdx = this._indexOf(element) - 1;\n return elementIdx >= 0 ? this.items[elementIdx] : null;\n }\n isRootHtmlElementCurrent() {\n return this.stackTop === 0 && this.tagIDs[0] === $.HTML;\n }\n //Element in scope\n hasInScope(tagName) {\n for (let i = this.stackTop; i >= 0; i--) {\n const tn = this.tagIDs[i];\n const ns = this.treeAdapter.getNamespaceURI(this.items[i]);\n if (tn === tagName && ns === NS.HTML) {\n return true;\n }\n if (SCOPING_ELEMENT_NS.get(tn) === ns) {\n return false;\n }\n }\n return true;\n }\n hasNumberedHeaderInScope() {\n for (let i = this.stackTop; i >= 0; i--) {\n const tn = this.tagIDs[i];\n const ns = this.treeAdapter.getNamespaceURI(this.items[i]);\n if (isNumberedHeader(tn) && ns === NS.HTML) {\n return true;\n }\n if (SCOPING_ELEMENT_NS.get(tn) === ns) {\n return false;\n }\n }\n return true;\n }\n hasInListItemScope(tagName) {\n for (let i = this.stackTop; i >= 0; i--) {\n const tn = this.tagIDs[i];\n const ns = this.treeAdapter.getNamespaceURI(this.items[i]);\n if (tn === tagName && ns === NS.HTML) {\n return true;\n }\n if (((tn === $.UL || tn === $.OL) && ns === NS.HTML) || SCOPING_ELEMENT_NS.get(tn) === ns) {\n return false;\n }\n }\n return true;\n }\n hasInButtonScope(tagName) {\n for (let i = this.stackTop; i >= 0; i--) {\n const tn = this.tagIDs[i];\n const ns = this.treeAdapter.getNamespaceURI(this.items[i]);\n if (tn === tagName && ns === NS.HTML) {\n return true;\n }\n if ((tn === $.BUTTON && ns === NS.HTML) || SCOPING_ELEMENT_NS.get(tn) === ns) {\n return false;\n }\n }\n return true;\n }\n hasInTableScope(tagName) {\n for (let i = this.stackTop; i >= 0; i--) {\n const tn = this.tagIDs[i];\n const ns = this.treeAdapter.getNamespaceURI(this.items[i]);\n if (ns !== NS.HTML) {\n continue;\n }\n if (tn === tagName) {\n return true;\n }\n if (tn === $.TABLE || tn === $.TEMPLATE || tn === $.HTML) {\n return false;\n }\n }\n return true;\n }\n hasTableBodyContextInTableScope() {\n for (let i = this.stackTop; i >= 0; i--) {\n const tn = this.tagIDs[i];\n const ns = this.treeAdapter.getNamespaceURI(this.items[i]);\n if (ns !== NS.HTML) {\n continue;\n }\n if (tn === $.TBODY || tn === $.THEAD || tn === $.TFOOT) {\n return true;\n }\n if (tn === $.TABLE || tn === $.HTML) {\n return false;\n }\n }\n return true;\n }\n hasInSelectScope(tagName) {\n for (let i = this.stackTop; i >= 0; i--) {\n const tn = this.tagIDs[i];\n const ns = this.treeAdapter.getNamespaceURI(this.items[i]);\n if (ns !== NS.HTML) {\n continue;\n }\n if (tn === tagName) {\n return true;\n }\n if (tn !== $.OPTION && tn !== $.OPTGROUP) {\n return false;\n }\n }\n return true;\n }\n //Implied end tags\n generateImpliedEndTags() {\n while (IMPLICIT_END_TAG_REQUIRED.has(this.currentTagId)) {\n this.pop();\n }\n }\n generateImpliedEndTagsThoroughly() {\n while (IMPLICIT_END_TAG_REQUIRED_THOROUGHLY.has(this.currentTagId)) {\n this.pop();\n }\n }\n generateImpliedEndTagsWithExclusion(exclusionId) {\n while (this.currentTagId !== exclusionId && IMPLICIT_END_TAG_REQUIRED_THOROUGHLY.has(this.currentTagId)) {\n this.pop();\n }\n }\n}\n//# sourceMappingURL=open-element-stack.js.map","//Const\nconst NOAH_ARK_CAPACITY = 3;\nexport var EntryType;\n(function (EntryType) {\n EntryType[EntryType[\"Marker\"] = 0] = \"Marker\";\n EntryType[EntryType[\"Element\"] = 1] = \"Element\";\n})(EntryType = EntryType || (EntryType = {}));\nconst MARKER = { type: EntryType.Marker };\n//List of formatting elements\nexport class FormattingElementList {\n constructor(treeAdapter) {\n this.treeAdapter = treeAdapter;\n this.entries = [];\n this.bookmark = null;\n }\n //Noah Ark's condition\n //OPTIMIZATION: at first we try to find possible candidates for exclusion using\n //lightweight heuristics without thorough attributes check.\n _getNoahArkConditionCandidates(newElement, neAttrs) {\n const candidates = [];\n const neAttrsLength = neAttrs.length;\n const neTagName = this.treeAdapter.getTagName(newElement);\n const neNamespaceURI = this.treeAdapter.getNamespaceURI(newElement);\n for (let i = 0; i < this.entries.length; i++) {\n const entry = this.entries[i];\n if (entry.type === EntryType.Marker) {\n break;\n }\n const { element } = entry;\n if (this.treeAdapter.getTagName(element) === neTagName &&\n this.treeAdapter.getNamespaceURI(element) === neNamespaceURI) {\n const elementAttrs = this.treeAdapter.getAttrList(element);\n if (elementAttrs.length === neAttrsLength) {\n candidates.push({ idx: i, attrs: elementAttrs });\n }\n }\n }\n return candidates;\n }\n _ensureNoahArkCondition(newElement) {\n if (this.entries.length < NOAH_ARK_CAPACITY)\n return;\n const neAttrs = this.treeAdapter.getAttrList(newElement);\n const candidates = this._getNoahArkConditionCandidates(newElement, neAttrs);\n if (candidates.length < NOAH_ARK_CAPACITY)\n return;\n //NOTE: build attrs map for the new element, so we can perform fast lookups\n const neAttrsMap = new Map(neAttrs.map((neAttr) => [neAttr.name, neAttr.value]));\n let validCandidates = 0;\n //NOTE: remove bottommost candidates, until Noah's Ark condition will not be met\n for (let i = 0; i < candidates.length; i++) {\n const candidate = candidates[i];\n // We know that `candidate.attrs.length === neAttrs.length`\n if (candidate.attrs.every((cAttr) => neAttrsMap.get(cAttr.name) === cAttr.value)) {\n validCandidates += 1;\n if (validCandidates >= NOAH_ARK_CAPACITY) {\n this.entries.splice(candidate.idx, 1);\n }\n }\n }\n }\n //Mutations\n insertMarker() {\n this.entries.unshift(MARKER);\n }\n pushElement(element, token) {\n this._ensureNoahArkCondition(element);\n this.entries.unshift({\n type: EntryType.Element,\n element,\n token,\n });\n }\n insertElementAfterBookmark(element, token) {\n const bookmarkIdx = this.entries.indexOf(this.bookmark);\n this.entries.splice(bookmarkIdx, 0, {\n type: EntryType.Element,\n element,\n token,\n });\n }\n removeEntry(entry) {\n const entryIndex = this.entries.indexOf(entry);\n if (entryIndex >= 0) {\n this.entries.splice(entryIndex, 1);\n }\n }\n /**\n * Clears the list of formatting elements up to the last marker.\n *\n * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-list-of-active-formatting-elements-up-to-the-last-marker\n */\n clearToLastMarker() {\n const markerIdx = this.entries.indexOf(MARKER);\n if (markerIdx >= 0) {\n this.entries.splice(0, markerIdx + 1);\n }\n else {\n this.entries.length = 0;\n }\n }\n //Search\n getElementEntryInScopeWithTagName(tagName) {\n const entry = this.entries.find((entry) => entry.type === EntryType.Marker || this.treeAdapter.getTagName(entry.element) === tagName);\n return entry && entry.type === EntryType.Element ? entry : null;\n }\n getElementEntry(element) {\n return this.entries.find((entry) => entry.type === EntryType.Element && entry.element === element);\n }\n}\n//# sourceMappingURL=formatting-element-list.js.map","import { DOCUMENT_MODE } from '../common/html.js';\nfunction createTextNode(value) {\n return {\n nodeName: '#text',\n value,\n parentNode: null,\n };\n}\nexport const defaultTreeAdapter = {\n //Node construction\n createDocument() {\n return {\n nodeName: '#document',\n mode: DOCUMENT_MODE.NO_QUIRKS,\n childNodes: [],\n };\n },\n createDocumentFragment() {\n return {\n nodeName: '#document-fragment',\n childNodes: [],\n };\n },\n createElement(tagName, namespaceURI, attrs) {\n return {\n nodeName: tagName,\n tagName,\n attrs,\n namespaceURI,\n childNodes: [],\n parentNode: null,\n };\n },\n createCommentNode(data) {\n return {\n nodeName: '#comment',\n data,\n parentNode: null,\n };\n },\n //Tree mutation\n appendChild(parentNode, newNode) {\n parentNode.childNodes.push(newNode);\n newNode.parentNode = parentNode;\n },\n insertBefore(parentNode, newNode, referenceNode) {\n const insertionIdx = parentNode.childNodes.indexOf(referenceNode);\n parentNode.childNodes.splice(insertionIdx, 0, newNode);\n newNode.parentNode = parentNode;\n },\n setTemplateContent(templateElement, contentElement) {\n templateElement.content = contentElement;\n },\n getTemplateContent(templateElement) {\n return templateElement.content;\n },\n setDocumentType(document, name, publicId, systemId) {\n const doctypeNode = document.childNodes.find((node) => node.nodeName === '#documentType');\n if (doctypeNode) {\n doctypeNode.name = name;\n doctypeNode.publicId = publicId;\n doctypeNode.systemId = systemId;\n }\n else {\n const node = {\n nodeName: '#documentType',\n name,\n publicId,\n systemId,\n parentNode: null,\n };\n defaultTreeAdapter.appendChild(document, node);\n }\n },\n setDocumentMode(document, mode) {\n document.mode = mode;\n },\n getDocumentMode(document) {\n return document.mode;\n },\n detachNode(node) {\n if (node.parentNode) {\n const idx = node.parentNode.childNodes.indexOf(node);\n node.parentNode.childNodes.splice(idx, 1);\n node.parentNode = null;\n }\n },\n insertText(parentNode, text) {\n if (parentNode.childNodes.length > 0) {\n const prevNode = parentNode.childNodes[parentNode.childNodes.length - 1];\n if (defaultTreeAdapter.isTextNode(prevNode)) {\n prevNode.value += text;\n return;\n }\n }\n defaultTreeAdapter.appendChild(parentNode, createTextNode(text));\n },\n insertTextBefore(parentNode, text, referenceNode) {\n const prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1];\n if (prevNode && defaultTreeAdapter.isTextNode(prevNode)) {\n prevNode.value += text;\n }\n else {\n defaultTreeAdapter.insertBefore(parentNode, createTextNode(text), referenceNode);\n }\n },\n adoptAttributes(recipient, attrs) {\n const recipientAttrsMap = new Set(recipient.attrs.map((attr) => attr.name));\n for (let j = 0; j < attrs.length; j++) {\n if (!recipientAttrsMap.has(attrs[j].name)) {\n recipient.attrs.push(attrs[j]);\n }\n }\n },\n //Tree traversing\n getFirstChild(node) {\n return node.childNodes[0];\n },\n getChildNodes(node) {\n return node.childNodes;\n },\n getParentNode(node) {\n return node.parentNode;\n },\n getAttrList(element) {\n return element.attrs;\n },\n //Node data\n getTagName(element) {\n return element.tagName;\n },\n getNamespaceURI(element) {\n return element.namespaceURI;\n },\n getTextNodeContent(textNode) {\n return textNode.value;\n },\n getCommentNodeContent(commentNode) {\n return commentNode.data;\n },\n getDocumentTypeNodeName(doctypeNode) {\n return doctypeNode.name;\n },\n getDocumentTypeNodePublicId(doctypeNode) {\n return doctypeNode.publicId;\n },\n getDocumentTypeNodeSystemId(doctypeNode) {\n return doctypeNode.systemId;\n },\n //Node types\n isTextNode(node) {\n return node.nodeName === '#text';\n },\n isCommentNode(node) {\n return node.nodeName === '#comment';\n },\n isDocumentTypeNode(node) {\n return node.nodeName === '#documentType';\n },\n isElementNode(node) {\n return Object.prototype.hasOwnProperty.call(node, 'tagName');\n },\n // Source code location\n setNodeSourceCodeLocation(node, location) {\n node.sourceCodeLocation = location;\n },\n getNodeSourceCodeLocation(node) {\n return node.sourceCodeLocation;\n },\n updateNodeSourceCodeLocation(node, endLocation) {\n node.sourceCodeLocation = { ...node.sourceCodeLocation, ...endLocation };\n },\n};\n//# sourceMappingURL=default.js.map","import { DOCUMENT_MODE } from './html.js';\n//Const\nconst VALID_DOCTYPE_NAME = 'html';\nconst VALID_SYSTEM_ID = 'about:legacy-compat';\nconst QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd';\nconst QUIRKS_MODE_PUBLIC_ID_PREFIXES = [\n '+//silmaril//dtd html pro v0r11 19970101//',\n '-//as//dtd html 3.0 aswedit + extensions//',\n '-//advasoft ltd//dtd html 3.0 aswedit + extensions//',\n '-//ietf//dtd html 2.0 level 1//',\n '-//ietf//dtd html 2.0 level 2//',\n '-//ietf//dtd html 2.0 strict level 1//',\n '-//ietf//dtd html 2.0 strict level 2//',\n '-//ietf//dtd html 2.0 strict//',\n '-//ietf//dtd html 2.0//',\n '-//ietf//dtd html 2.1e//',\n '-//ietf//dtd html 3.0//',\n '-//ietf//dtd html 3.2 final//',\n '-//ietf//dtd html 3.2//',\n '-//ietf//dtd html 3//',\n '-//ietf//dtd html level 0//',\n '-//ietf//dtd html level 1//',\n '-//ietf//dtd html level 2//',\n '-//ietf//dtd html level 3//',\n '-//ietf//dtd html strict level 0//',\n '-//ietf//dtd html strict level 1//',\n '-//ietf//dtd html strict level 2//',\n '-//ietf//dtd html strict level 3//',\n '-//ietf//dtd html strict//',\n '-//ietf//dtd html//',\n '-//metrius//dtd metrius presentational//',\n '-//microsoft//dtd internet explorer 2.0 html strict//',\n '-//microsoft//dtd internet explorer 2.0 html//',\n '-//microsoft//dtd internet explorer 2.0 tables//',\n '-//microsoft//dtd internet explorer 3.0 html strict//',\n '-//microsoft//dtd internet explorer 3.0 html//',\n '-//microsoft//dtd internet explorer 3.0 tables//',\n '-//netscape comm. corp.//dtd html//',\n '-//netscape comm. corp.//dtd strict html//',\n \"-//o'reilly and associates//dtd html 2.0//\",\n \"-//o'reilly and associates//dtd html extended 1.0//\",\n \"-//o'reilly and associates//dtd html extended relaxed 1.0//\",\n '-//sq//dtd html 2.0 hotmetal + extensions//',\n '-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//',\n '-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//',\n '-//spyglass//dtd html 2.0 extended//',\n '-//sun microsystems corp.//dtd hotjava html//',\n '-//sun microsystems corp.//dtd hotjava strict html//',\n '-//w3c//dtd html 3 1995-03-24//',\n '-//w3c//dtd html 3.2 draft//',\n '-//w3c//dtd html 3.2 final//',\n '-//w3c//dtd html 3.2//',\n '-//w3c//dtd html 3.2s draft//',\n '-//w3c//dtd html 4.0 frameset//',\n '-//w3c//dtd html 4.0 transitional//',\n '-//w3c//dtd html experimental 19960712//',\n '-//w3c//dtd html experimental 970421//',\n '-//w3c//dtd w3 html//',\n '-//w3o//dtd w3 html 3.0//',\n '-//webtechs//dtd mozilla html 2.0//',\n '-//webtechs//dtd mozilla html//',\n];\nconst QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = [\n ...QUIRKS_MODE_PUBLIC_ID_PREFIXES,\n '-//w3c//dtd html 4.01 frameset//',\n '-//w3c//dtd html 4.01 transitional//',\n];\nconst QUIRKS_MODE_PUBLIC_IDS = new Set([\n '-//w3o//dtd w3 html strict 3.0//en//',\n '-/w3c/dtd html 4.0 transitional/en',\n 'html',\n]);\nconst LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = ['-//w3c//dtd xhtml 1.0 frameset//', '-//w3c//dtd xhtml 1.0 transitional//'];\nconst LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = [\n ...LIMITED_QUIRKS_PUBLIC_ID_PREFIXES,\n '-//w3c//dtd html 4.01 frameset//',\n '-//w3c//dtd html 4.01 transitional//',\n];\n//Utils\nfunction hasPrefix(publicId, prefixes) {\n return prefixes.some((prefix) => publicId.startsWith(prefix));\n}\n//API\nexport function isConforming(token) {\n return (token.name === VALID_DOCTYPE_NAME &&\n token.publicId === null &&\n (token.systemId === null || token.systemId === VALID_SYSTEM_ID));\n}\nexport function getDocumentMode(token) {\n if (token.name !== VALID_DOCTYPE_NAME) {\n return DOCUMENT_MODE.QUIRKS;\n }\n const { systemId } = token;\n if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) {\n return DOCUMENT_MODE.QUIRKS;\n }\n let { publicId } = token;\n if (publicId !== null) {\n publicId = publicId.toLowerCase();\n if (QUIRKS_MODE_PUBLIC_IDS.has(publicId)) {\n return DOCUMENT_MODE.QUIRKS;\n }\n let prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES;\n if (hasPrefix(publicId, prefixes)) {\n return DOCUMENT_MODE.QUIRKS;\n }\n prefixes =\n systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES;\n if (hasPrefix(publicId, prefixes)) {\n return DOCUMENT_MODE.LIMITED_QUIRKS;\n }\n }\n return DOCUMENT_MODE.NO_QUIRKS;\n}\n//# sourceMappingURL=doctype.js.map","import { TAG_ID as $, NS, ATTRS, getTagID } from './html.js';\n//MIME types\nconst MIME_TYPES = {\n TEXT_HTML: 'text/html',\n APPLICATION_XML: 'application/xhtml+xml',\n};\n//Attributes\nconst DEFINITION_URL_ATTR = 'definitionurl';\nconst ADJUSTED_DEFINITION_URL_ATTR = 'definitionURL';\nconst SVG_ATTRS_ADJUSTMENT_MAP = new Map([\n 'attributeName',\n 'attributeType',\n 'baseFrequency',\n 'baseProfile',\n 'calcMode',\n 'clipPathUnits',\n 'diffuseConstant',\n 'edgeMode',\n 'filterUnits',\n 'glyphRef',\n 'gradientTransform',\n 'gradientUnits',\n 'kernelMatrix',\n 'kernelUnitLength',\n 'keyPoints',\n 'keySplines',\n 'keyTimes',\n 'lengthAdjust',\n 'limitingConeAngle',\n 'markerHeight',\n 'markerUnits',\n 'markerWidth',\n 'maskContentUnits',\n 'maskUnits',\n 'numOctaves',\n 'pathLength',\n 'patternContentUnits',\n 'patternTransform',\n 'patternUnits',\n 'pointsAtX',\n 'pointsAtY',\n 'pointsAtZ',\n 'preserveAlpha',\n 'preserveAspectRatio',\n 'primitiveUnits',\n 'refX',\n 'refY',\n 'repeatCount',\n 'repeatDur',\n 'requiredExtensions',\n 'requiredFeatures',\n 'specularConstant',\n 'specularExponent',\n 'spreadMethod',\n 'startOffset',\n 'stdDeviation',\n 'stitchTiles',\n 'surfaceScale',\n 'systemLanguage',\n 'tableValues',\n 'targetX',\n 'targetY',\n 'textLength',\n 'viewBox',\n 'viewTarget',\n 'xChannelSelector',\n 'yChannelSelector',\n 'zoomAndPan',\n].map((attr) => [attr.toLowerCase(), attr]));\nconst XML_ATTRS_ADJUSTMENT_MAP = new Map([\n ['xlink:actuate', { prefix: 'xlink', name: 'actuate', namespace: NS.XLINK }],\n ['xlink:arcrole', { prefix: 'xlink', name: 'arcrole', namespace: NS.XLINK }],\n ['xlink:href', { prefix: 'xlink', name: 'href', namespace: NS.XLINK }],\n ['xlink:role', { prefix: 'xlink', name: 'role', namespace: NS.XLINK }],\n ['xlink:show', { prefix: 'xlink', name: 'show', namespace: NS.XLINK }],\n ['xlink:title', { prefix: 'xlink', name: 'title', namespace: NS.XLINK }],\n ['xlink:type', { prefix: 'xlink', name: 'type', namespace: NS.XLINK }],\n ['xml:base', { prefix: 'xml', name: 'base', namespace: NS.XML }],\n ['xml:lang', { prefix: 'xml', name: 'lang', namespace: NS.XML }],\n ['xml:space', { prefix: 'xml', name: 'space', namespace: NS.XML }],\n ['xmlns', { prefix: '', name: 'xmlns', namespace: NS.XMLNS }],\n ['xmlns:xlink', { prefix: 'xmlns', name: 'xlink', namespace: NS.XMLNS }],\n]);\n//SVG tag names adjustment map\nexport const SVG_TAG_NAMES_ADJUSTMENT_MAP = new Map([\n 'altGlyph',\n 'altGlyphDef',\n 'altGlyphItem',\n 'animateColor',\n 'animateMotion',\n 'animateTransform',\n 'clipPath',\n 'feBlend',\n 'feColorMatrix',\n 'feComponentTransfer',\n 'feComposite',\n 'feConvolveMatrix',\n 'feDiffuseLighting',\n 'feDisplacementMap',\n 'feDistantLight',\n 'feFlood',\n 'feFuncA',\n 'feFuncB',\n 'feFuncG',\n 'feFuncR',\n 'feGaussianBlur',\n 'feImage',\n 'feMerge',\n 'feMergeNode',\n 'feMorphology',\n 'feOffset',\n 'fePointLight',\n 'feSpecularLighting',\n 'feSpotLight',\n 'feTile',\n 'feTurbulence',\n 'foreignObject',\n 'glyphRef',\n 'linearGradient',\n 'radialGradient',\n 'textPath',\n].map((tn) => [tn.toLowerCase(), tn]));\n//Tags that causes exit from foreign content\nconst EXITS_FOREIGN_CONTENT = new Set([\n $.B,\n $.BIG,\n $.BLOCKQUOTE,\n $.BODY,\n $.BR,\n $.CENTER,\n $.CODE,\n $.DD,\n $.DIV,\n $.DL,\n $.DT,\n $.EM,\n $.EMBED,\n $.H1,\n $.H2,\n $.H3,\n $.H4,\n $.H5,\n $.H6,\n $.HEAD,\n $.HR,\n $.I,\n $.IMG,\n $.LI,\n $.LISTING,\n $.MENU,\n $.META,\n $.NOBR,\n $.OL,\n $.P,\n $.PRE,\n $.RUBY,\n $.S,\n $.SMALL,\n $.SPAN,\n $.STRONG,\n $.STRIKE,\n $.SUB,\n $.SUP,\n $.TABLE,\n $.TT,\n $.U,\n $.UL,\n $.VAR,\n]);\n//Check exit from foreign content\nexport function causesExit(startTagToken) {\n const tn = startTagToken.tagID;\n const isFontWithAttrs = tn === $.FONT &&\n startTagToken.attrs.some(({ name }) => name === ATTRS.COLOR || name === ATTRS.SIZE || name === ATTRS.FACE);\n return isFontWithAttrs || EXITS_FOREIGN_CONTENT.has(tn);\n}\n//Token adjustments\nexport function adjustTokenMathMLAttrs(token) {\n for (let i = 0; i < token.attrs.length; i++) {\n if (token.attrs[i].name === DEFINITION_URL_ATTR) {\n token.attrs[i].name = ADJUSTED_DEFINITION_URL_ATTR;\n break;\n }\n }\n}\nexport function adjustTokenSVGAttrs(token) {\n for (let i = 0; i < token.attrs.length; i++) {\n const adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP.get(token.attrs[i].name);\n if (adjustedAttrName != null) {\n token.attrs[i].name = adjustedAttrName;\n }\n }\n}\nexport function adjustTokenXMLAttrs(token) {\n for (let i = 0; i < token.attrs.length; i++) {\n const adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP.get(token.attrs[i].name);\n if (adjustedAttrEntry) {\n token.attrs[i].prefix = adjustedAttrEntry.prefix;\n token.attrs[i].name = adjustedAttrEntry.name;\n token.attrs[i].namespace = adjustedAttrEntry.namespace;\n }\n }\n}\nexport function adjustTokenSVGTagName(token) {\n const adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP.get(token.tagName);\n if (adjustedTagName != null) {\n token.tagName = adjustedTagName;\n token.tagID = getTagID(token.tagName);\n }\n}\n//Integration points\nfunction isMathMLTextIntegrationPoint(tn, ns) {\n return ns === NS.MATHML && (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS || tn === $.MTEXT);\n}\nfunction isHtmlIntegrationPoint(tn, ns, attrs) {\n if (ns === NS.MATHML && tn === $.ANNOTATION_XML) {\n for (let i = 0; i < attrs.length; i++) {\n if (attrs[i].name === ATTRS.ENCODING) {\n const value = attrs[i].value.toLowerCase();\n return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML;\n }\n }\n }\n return ns === NS.SVG && (tn === $.FOREIGN_OBJECT || tn === $.DESC || tn === $.TITLE);\n}\nexport function isIntegrationPoint(tn, ns, attrs, foreignNS) {\n return (((!foreignNS || foreignNS === NS.HTML) && isHtmlIntegrationPoint(tn, ns, attrs)) ||\n ((!foreignNS || foreignNS === NS.MATHML) && isMathMLTextIntegrationPoint(tn, ns)));\n}\n//# sourceMappingURL=foreign-content.js.map","import { Tokenizer, TokenizerMode } from '../tokenizer/index.js';\nimport { OpenElementStack } from './open-element-stack.js';\nimport { FormattingElementList, EntryType } from './formatting-element-list.js';\nimport { defaultTreeAdapter } from '../tree-adapters/default.js';\nimport * as doctype from '../common/doctype.js';\nimport * as foreignContent from '../common/foreign-content.js';\nimport { ERR } from '../common/error-codes.js';\nimport * as unicode from '../common/unicode.js';\nimport { TAG_ID as $, TAG_NAMES as TN, NS, ATTRS, SPECIAL_ELEMENTS, DOCUMENT_MODE, isNumberedHeader, getTagID, } from '../common/html.js';\nimport { TokenType, getTokenAttr, } from '../common/token.js';\n//Misc constants\nconst HIDDEN_INPUT_TYPE = 'hidden';\n//Adoption agency loops iteration count\nconst AA_OUTER_LOOP_ITER = 8;\nconst AA_INNER_LOOP_ITER = 3;\n//Insertion modes\nvar InsertionMode;\n(function (InsertionMode) {\n InsertionMode[InsertionMode[\"INITIAL\"] = 0] = \"INITIAL\";\n InsertionMode[InsertionMode[\"BEFORE_HTML\"] = 1] = \"BEFORE_HTML\";\n InsertionMode[InsertionMode[\"BEFORE_HEAD\"] = 2] = \"BEFORE_HEAD\";\n InsertionMode[InsertionMode[\"IN_HEAD\"] = 3] = \"IN_HEAD\";\n InsertionMode[InsertionMode[\"IN_HEAD_NO_SCRIPT\"] = 4] = \"IN_HEAD_NO_SCRIPT\";\n InsertionMode[InsertionMode[\"AFTER_HEAD\"] = 5] = \"AFTER_HEAD\";\n InsertionMode[InsertionMode[\"IN_BODY\"] = 6] = \"IN_BODY\";\n InsertionMode[InsertionMode[\"TEXT\"] = 7] = \"TEXT\";\n InsertionMode[InsertionMode[\"IN_TABLE\"] = 8] = \"IN_TABLE\";\n InsertionMode[InsertionMode[\"IN_TABLE_TEXT\"] = 9] = \"IN_TABLE_TEXT\";\n InsertionMode[InsertionMode[\"IN_CAPTION\"] = 10] = \"IN_CAPTION\";\n InsertionMode[InsertionMode[\"IN_COLUMN_GROUP\"] = 11] = \"IN_COLUMN_GROUP\";\n InsertionMode[InsertionMode[\"IN_TABLE_BODY\"] = 12] = \"IN_TABLE_BODY\";\n InsertionMode[InsertionMode[\"IN_ROW\"] = 13] = \"IN_ROW\";\n InsertionMode[InsertionMode[\"IN_CELL\"] = 14] = \"IN_CELL\";\n InsertionMode[InsertionMode[\"IN_SELECT\"] = 15] = \"IN_SELECT\";\n InsertionMode[InsertionMode[\"IN_SELECT_IN_TABLE\"] = 16] = \"IN_SELECT_IN_TABLE\";\n InsertionMode[InsertionMode[\"IN_TEMPLATE\"] = 17] = \"IN_TEMPLATE\";\n InsertionMode[InsertionMode[\"AFTER_BODY\"] = 18] = \"AFTER_BODY\";\n InsertionMode[InsertionMode[\"IN_FRAMESET\"] = 19] = \"IN_FRAMESET\";\n InsertionMode[InsertionMode[\"AFTER_FRAMESET\"] = 20] = \"AFTER_FRAMESET\";\n InsertionMode[InsertionMode[\"AFTER_AFTER_BODY\"] = 21] = \"AFTER_AFTER_BODY\";\n InsertionMode[InsertionMode[\"AFTER_AFTER_FRAMESET\"] = 22] = \"AFTER_AFTER_FRAMESET\";\n})(InsertionMode || (InsertionMode = {}));\nconst BASE_LOC = {\n startLine: -1,\n startCol: -1,\n startOffset: -1,\n endLine: -1,\n endCol: -1,\n endOffset: -1,\n};\nconst TABLE_STRUCTURE_TAGS = new Set([$.TABLE, $.TBODY, $.TFOOT, $.THEAD, $.TR]);\nconst defaultParserOptions = {\n scriptingEnabled: true,\n sourceCodeLocationInfo: false,\n treeAdapter: defaultTreeAdapter,\n onParseError: null,\n};\n//Parser\nexport class Parser {\n constructor(options, document, fragmentContext = null, scriptHandler = null) {\n this.fragmentContext = fragmentContext;\n this.scriptHandler = scriptHandler;\n this.currentToken = null;\n this.stopped = false;\n this.insertionMode = InsertionMode.INITIAL;\n this.originalInsertionMode = InsertionMode.INITIAL;\n this.headElement = null;\n this.formElement = null;\n /** Indicates that the current node is not an element in the HTML namespace */\n this.currentNotInHTML = false;\n /**\n * The template insertion mode stack is maintained from the left.\n * Ie. the topmost element will always have index 0.\n */\n this.tmplInsertionModeStack = [];\n this.pendingCharacterTokens = [];\n this.hasNonWhitespacePendingCharacterToken = false;\n this.framesetOk = true;\n this.skipNextNewLine = false;\n this.fosterParentingEnabled = false;\n this.options = {\n ...defaultParserOptions,\n ...options,\n };\n this.treeAdapter = this.options.treeAdapter;\n this.onParseError = this.options.onParseError;\n // Always enable location info if we report parse errors.\n if (this.onParseError) {\n this.options.sourceCodeLocationInfo = true;\n }\n this.document = document !== null && document !== void 0 ? document : this.treeAdapter.createDocument();\n this.tokenizer = new Tokenizer(this.options, this);\n this.activeFormattingElements = new FormattingElementList(this.treeAdapter);\n this.fragmentContextID = fragmentContext ? getTagID(this.treeAdapter.getTagName(fragmentContext)) : $.UNKNOWN;\n this._setContextModes(fragmentContext !== null && fragmentContext !== void 0 ? fragmentContext : this.document, this.fragmentContextID);\n this.openElements = new OpenElementStack(this.document, this.treeAdapter, this);\n }\n // API\n static parse(html, options) {\n const parser = new this(options);\n parser.tokenizer.write(html, true);\n return parser.document;\n }\n static getFragmentParser(fragmentContext, options) {\n const opts = {\n ...defaultParserOptions,\n ...options,\n };\n //NOTE: use a