/* .Config */

/* .DefinedInfo */

/* .DingBizType.INVITATION */

/* .DingBizType.TASK */

/* .ExtFramework.getInstance */

/* .ExtensionFrameInstance.defineExtension */

/* .ExtensionFrameInstance.obtainExtensionValue */

/* .IAuthMediaBiztype.im */

/* .Info */

/* .IsRemoteEnum.YES */

/* .OpenSendDingModalBizType.CREATE_DING */

/* .OpenSendDingModalBizType.CREATE_DING_CONV */

/* .OpenSendDingModalBizType.CREATE_SUB_TASK */

/* .OpenSendDingModalBizType.DING_AGAIN */

/* .OpenSendDingModalBizType.EDIT_DING */

/* .OpenSendDingModalBizType.REMIND_CALENDAR */

/* .asciiAlpha */

/* .asciiAlphanumeric */

/* .asciiControl */

/* .asciiDigit */

/* .blankLine */

/* .classifyCharacter */

/* .color */

/* .combineExtensions */

/* .containerPhrasing */

/* .content */

/* .convert */

/* .createState */

/* .createTokenizer */

/* .decodeNamedCharacterReference */

/* .decodeNumericCharacterReference */

/* .decodeString */

/* .defaultSchema */

/* .definitions */

/* .document */

/* .escape */

/* .factorySpace */

/* .find */

/* .flow */

/* .footer */

/* .fromMarkdown */

/* .fromParse5 */

/* .generated */

/* .getImageSizeWithUrl */

/* .gfm */

/* .gfmAutolinkLiteral */

/* .gfmAutolinkLiteralFromMarkdown */

/* .gfmAutolinkLiteralToMarkdown */

/* .gfmFootnote */

/* .gfmFootnoteFromMarkdown */

/* .gfmFootnoteToMarkdown */

/* .gfmFromMarkdown */

/* .gfmStrikethrough */

/* .gfmStrikethroughFromMarkdown */

/* .gfmStrikethroughToMarkdown */

/* .gfmTable */

/* .gfmTableFromMarkdown */

/* .gfmTableToMarkdown */

/* .gfmTaskListItem */

/* .gfmTaskListItemFromMarkdown */

/* .gfmTaskListItemToMarkdown */

/* .gfmToMarkdown */

/* .handlers */

/* .html */

/* .htmlVoidElements.includes */

/* .inlineCode */

/* .isGif */

/* .isUrl */

/* .location */

/* .markdownLineEnding */

/* .markdownLineEndingOrSpace */

/* .markdownSpace */

/* .markdownTable */

/* .marked.Lexer.rules.block.code.exec */

/* .marked.Lexer.rules.inline.code.exec */

/* .marked.Lexer.rules.inline.gfm.del */

/* .marked.parse */

/* .marked.use */

/* .maybeCanOpenInApp */

/* .mid2Object */

/* .normalize */

/* .normalizeIdentifier */

/* .normalizeUri */

/* .parse */

/* .parseSelector */

/* .patternCompile */

/* .pointEnd */

/* .pointStart */

/* .position */

/* .postprocess */

/* .preprocess */

/* .push */

/* .raw */

/* .resolveAll */

/* .sanitize */

/* .splice */

/* .string */

/* .stringify */

/* .stringifyPosition */

/* .subtokenize */

/* .svg */

/* .text */

/* .toParse5 */

/* .toString */

/* .track */

/* .unescape */

/* .unicodePunctuation */

/* .unicodeWhitespace */

/* .urlSafeHttpFilter */

/* .visit */

/* .visitParents */

/* .webNamespaces */

/* .webNamespaces.html */

/* .webNamespaces.svg */

/* .zwitch */

/* / */

/* 0 */

/* 1 */

/* 2 */

/* 3 */

/* 4 */

/* 5 */

/* 6 */

/* APPConfig */

/* App */

/* Built-in method references for those with the same name as other `lodash` methods. */

/* Config */

/* DefinedInfo */

/* DingConfig */

/* EmotionConfig */

/* ExtensionFactory */

/* FileConfig */

/* Hidden footnotes hook */

/* Hidden footnotes hook. */

/* IAuthMediaBiztype.im */

/* MENUTYPE.addEmotion */

/* MENUTYPE.comment */

/* MENUTYPE.ding */

/* MENUTYPE.dingmeeting */

/* MENUTYPE.fileShare */

/* MENUTYPE.fileStore */

/* MENUTYPE.forword */

/* MENUTYPE.laterHandler */

/* MENUTYPE.moreGifEmotion */

/* MENUTYPE.mutilSelect */

/* MENUTYPE.newDingTask */

/* MENUTYPE.print */

/* MENUTYPE.quote */

/* MENUTYPE.recall */

/* MENUTYPE.reportEmotion */

/* MENUTYPE.showEmotionAlbum */

/* MENUTYPE.top */

/* MENUTYPE.translate */

/* MENUTYPE.translateToText */

/* MENUTYPE.unTop */

/* MENUTYPE.undoTranslate */

/* MENUTYPE.undoTranslateToText */

/* MENUTYPE.zan */

/* Media */

/* MessageBubbleConfig */

/* ReactMarkdown */

/* Schema */

/* SchemaConfig */

/* Subject */

/* To do: remove in the future once we’ve switched from
       * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
       * which doesn’t need this */

/* To do: remove in the future once we’ve switched from
     * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
     * which doesn’t need this */

/* UserProfile */

/* VFileMessage */

/* WaterMark */

/* ["default"].callHookApi */

/* ["default"].getI18next */

/* ["default"].hasHookApi */

/* ` ` */

/* `%` */

/* `.` */

/* `/` */

/* `2` */

/* `;` */

/* `C` */

/* `F` */

/* `L` */

/* `R` */

/* `\n` */

/* `\r` */

/* `\t` */

/* `c` */

/* `f` */

/* `l` */

/* `r` */

/* asciiAlpha */

/* asciiAlphanumeric */

/* asciiAtext */

/* asciiControl */

/* asciiDigit */

/* asciiHexDigit */

/* asciiPunctuation */

/* batchUserProfiles$ */

/* binding */

/* blankLine */

/* browserUrl */

/* c8 ignore next */

/* c8 ignore next 1 */

/* c8 ignore next 2 */

/* c8 ignore next 3 */

/* c8 ignore next 4 */

/* c8 ignore next 5 */

/* c8 ignore start */

/* c8 ignore stop */

/* caseSensitiveTransform */

/* checkBullet */

/* checkListItemIndent */

/* classifyCharacter */

/* containerFlow */

/* convert */

/* decodeNamedCharacterReference */

/* decodeString */

/* default */

/* defaultSchema */

/* eslint-disable max-depth, complexity */

/* eslint-disable no-unused-expressions */

/* eslint-enable max-depth, complexity */

/* eslint-enable no-unused-expressions */

/* eslint-env browser */

/* factorySpace */

/* find */

/* footnoteReference */

/* getImageSizeWithUrl */

/* getTopic$ */

/* getTopicReplys$ */

/* harmony default export */

/* harmony export (binding) */

/* harmony export */

/* harmony import */

/* hastToReact */

/* html */

/* indentLines */

/* isGif */

/* isUrl */

/* istanbul ignore else - invalid nodes, see rehypejs/rehype-raw#7. */

/* istanbul ignore next */

/* markdownLineEnding */

/* markdownLineEndingOrSpace */

/* markdownSpace */

/* maybeCanOpenInApp */

/* mid2Object */

/* mid2Url */

/* normalize */

/* normalizeIdentifier */

/* normalizeUri */

/* path.basename */

/* path.dirname */

/* path.extname */

/* path.join */

/* path.sep */

/* patternCompile */

/* patternInScope */

/* pointEnd */

/* pointStart */

/* proc.cwd */

/* push */

/* reexport */

/* resolveAll */

/* resolver */

/* revert */

/* runtime-dependent pure expression or super */

/* splice */

/* stringify */

/* subtokenize */

/* svg */

/* toHast */

/* track */

/* trimLines */

/* unicodePunctuation */

/* unicodeWhitespace */

/* unused harmony export BaseExtension */

/* unused harmony export MenuType */

/* unused harmony export combineHtmlExtensions */

/* unused harmony export gfmHtml */

/* unused harmony export is */

/* unused harmony export sanitizeUri */

/* unused harmony exports CONTINUE, EXIT, SKIP */

/* unused harmony exports CalendarAction, CheckInResult, IRecurRuleModelFreq, IRuleDayEnum, ScopeEnum, IScope, CalendarSelfStatusEnum, IsShareCalendarEnum, ICalendarReceverListTypeEnum, ChangePushAction, CalendarReceiverChangeSource, CalendarStatusEnum, CalendarResponseStatusEnum, CalendarIdentityEnum, IAclEnum, OpenCreateCalendarModalBizType, ReminderMinutesEnum, NotificationTypeEnum, ReceiverType, CheckInStatus, CommentTypeEnum, CommentContentTypeEnum, CalendarShareTypeEnum, CheckInConfigUpdateTypeEnum, ActionCardStatusEnum */

/* unused harmony exports ChatboxBiz, ChatboxLifecycle */

/* unused harmony exports IScope, DingNoticeType, DingInviteSubBizType, RemindTypeEnum, DingStatus, DingSendStatus, DingConfirmStatus, DingListQueryRequestType */

/* unused harmony exports Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, options, parse, parseInline, parser, setOptions, use, walkTokens */

/* unused harmony exports abilityEnableDecorator, abilityActionDecorator, abilityEnableBeforeDecorator, abilityActionBeforeDecorator, abilityEnableAfterDecorator, abilityActionAfterDecorator */

/* unused harmony exports one, all, wrap */

/* unused harmony exports setExtensionBiz, hookLifecycleFn, updateExtensionContext */

/* uriTransformer */

/* urlSafeHttpFilter */

/* urlToPath */

/* visit */

/* visitParents */

/* whitespace */

/*!
 * Determine if an object is a Buffer
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */

/*#__PURE__*/

/**
       * @param {Array<Content>} nodes
       * @returns {void}
       */

/**
       * @param {Comment|Stitch} node
       * @returns {void}
       */

/**
       * @param {Doctype} node
       * @returns {void}
       */

/**
       * @param {Element} node
       * @returns {void}
       */

/**
       * @param {Error|null|undefined} [error]
       * @param {VFile|undefined} [file]
       * @returns {void}
       */

/**
       * @param {Error|null} error
       * @param {Node} tree
       * @param {VFile} file
       * @returns {void}
       */

/**
       * @param {Node} node
       * @param {Array<Parent>} parents
       */

/**
       * @param {Node} node
       * @param {number | undefined} index
       * @param {Array<Parent>} parents
       */

/**
       * @param {Node} node
       */

/**
       * @param {Raw} node
       * @returns {void}
       */

/**
       * @param {Root} node
       * @returns {void}
       */

/**
       * @param {Text} node
       * @returns {void}
       */

/**
       * @returns {P5Document}
       */

/**
       * @returns {P5Fragment}
       */

/**
       * Handle a list of construct.
       *
       * @param {Array<Construct>} list
       * @returns {State}
       */

/**
       * Handle a list of construct.
       *
       * @param {ConstructRecord} map
       * @returns {State}
       */

/**
       * Handle a single construct.
       *
       * @param {Construct} construct
       * @returns {State}
       */

/**
       * Handle a text node which is not in an ignored parent.
       *
       * @param {Text} node
       *   Text node.
       * @param {Array<Parent>} parents
       *   Parents.
       * @returns {VisitorResult}
       *   Result.
       */

/**
       * Hyperscript compatible DSL for creating virtual hast trees.
       *
       * @param {string | null} [selector]
       * @param {HProperties | HChild} [properties]
       * @param {Array<HChild>} children
       * @returns {HResult}
       */

/**
     * @param {Code} code
     * @returns {boolean}
     */

/**
     * @param {Error|null|undefined} [error]
     * @returns {void}
     */

/**
     * @param {Error|null} [error]
     * @param {Node} [tree]
     * @returns {void}
     */

/**
     * @param {Node} tree
     * @param {Test} test
     * @param {Visitor<Node>} visitor
     * @param {boolean | null | undefined} [reverse]
     * @returns {void}
     */

/**
     * @param {Node} tree
     * @param {Test} test
     * @param {Visitor} visitor
     * @param {boolean | null | undefined} [reverse]
     * @returns {void}
     */

/**
     * @param {Node} tree
     * @param {VFile} [file]
     * @param {Options} [options]
     */

/**
     * @param {PluggableList|null|undefined} [plugins]
     * @returns {void}
     */

/**
     * @param {Plugin} plugin
     * @param {...unknown} [value]
     * @returns {void}
     */

/**
     * @param {Preset} result
     * @returns {void}
     */

/**
     * @param {Test} [test]
     * @returns {AssertAnything}
     */

/**
     * @param {import('..').Pluggable<unknown[]>} value
     * @returns {void}
     */

/**
     * @param {null|((file: VFile) => void)} resolve
     * @param {(error?: Error|null|undefined) => void} reject
     * @returns {void}
     */

/**
     * @param {null|((node: Node) => void)} resolve
     * @param {(error: Error) => void} reject
     * @returns {void}
     */

/**
     * @template {Node} Tree
     * @param {Tree} tree
     * @param {Find | FindAndReplaceSchema | FindAndReplaceList} find
     * @param {Replace | Options | null | undefined} [replace]
     * @param {Options | null | undefined} [options]
     * @returns {Tree}
     */

/**
     * @this {CompileContext}
     * @param {Token} token
     * @returns {void}
     */

/**
     * @type {{
     *   (): Root
     *   (selector: null | undefined, ...children: Array<HChild>): Root
     *   (selector: string, properties?: HProperties, ...children: Array<HChild>): Element
     *   (selector: string, ...children: Array<HChild>): Element
     * }}
     */

/**
     * Base of `path` (default: `process.cwd()` or `'/'` in browsers).
     *
     * @type {string}
     */

/**
     * Category of message (example: `'my-rule'`).
     *
     * @type {string | null}
     */

/**
     * Check if the element is within the visible viewport
     */

/**
     * Custom, non-string, compiled, representation.
     *
     * This is used by unified to store non-string results.
     * One example is when turning markdown into React nodes.
     *
     * @type {unknown}
     */

/**
     * Full unist position.
     *
     * @type {Position | null}
     */

/**
     * Handle either an object mapping codes to constructs, a list of
     * constructs, or a single construct.
     *
     * @param {Construct|Array<Construct>|ConstructRecord} constructs
     * @param {State} returnState
     * @param {State} [bogusState]
     * @returns {State}
     */

/**
     * Link to docs for the message.
     *
     * > 👉 **Note**: this must be an absolute URL that can be passed as `x`
     * > to `new URL(x)`.
     *
     * @type {string | null}
     */

/**
     * List of filepaths the file moved between.
     *
     * The first is the original path and the last is the current path.
     *
     * @type {Array<string>}
     */

/**
     * List of messages associated with the file.
     *
     * @type {Array<VFileMessage>}
     */

/**
     * Long form description of the message (you should use markdown).
     *
     * @type {string | null}
     */

/**
     * Namespace of message (example: `'my-package'`).
     *
     * @type {string | null}
     */

/**
     * Path of a file (used throughout the `VFile` ecosystem).
     *
     * @type {string | null}
     */

/**
     * Place to store custom information (default: `{}`).
     *
     * It’s OK to store custom data directly on the file but moving it to
     * `data` is recommended.
     *
     * @type {Data}
     */

/**
     * Raw value.
     *
     * @type {Value}
     */

/**
     * Reason for message.
     *
     * > 👉 **Note**: you should use markdown.
     *
     * @type {string}
     */

/**
     * Reason for message.
     *
     * @type {string}
     */

/**
     * Restore state.
     *
     * @returns {void}
     */

/**
     * Run the next `fn`, or we’re done.
     *
     * @param {Error|null|undefined} error
     * @param {Array<any>} output
     */

/**
     * Serialized positional info of error.
     *
     * On normal errors, this would be something like `ParseError`, buit in
     * `VFile` messages we use this space to show where an error happened.
     */

/**
     * Source map.
     *
     * This type is equivalent to the `RawSourceMap` type from the `source-map`
     * module.
     *
     * @type {Map | null | undefined}
     */

/**
     * Specify the source value that’s being reported, which is deemed
     * incorrect.
     *
     * @type {string | null}
     */

/**
     * Stack of message.
     *
     * This is used by normal errors to show where something happened in
     * programming code, irrelevant for `VFile` messages,
     *
     * @type {string}
     */

/**
     * Starting column of error.
     *
     * @type {number | null}
     */

/**
     * Starting line of error.
     *
     * @type {number | null}
     */

/**
     * State of problem.
     *
     * * `true` — marks associated file as no longer processable (error)
     * * `false` — necessitates a (potential) change (warning)
     * * `null | undefined` — for things that might not need changing (info)
     *
     * @type {boolean | null | undefined}
     */

/**
     * Suggest acceptable values that can be used instead of `actual`.
     *
     * @type {Array<string> | null}
     */

/**
     * Whether a file was saved to disk.
     *
     * This is used by vfile reporters.
     *
     * @type {boolean}
     */

/**
   * @constructor
   * @param {Properties} property
   * @param {Normal} normal
   * @param {string} [space]
   */

/**
   * @constructor
   * @param {string} property
   * @param {string} attribute
   * @param {number|null} [mask]
   * @param {string} [space]
   */

/**
   * @constructor
   * @param {string} property
   * @param {string} attribute
   */

/**
   * @param {Array<Array<string>>} matrix
   * @param {Array<string | null | undefined> | null | undefined} [align]
   */

/**
   * @param {Array<Event>} events
   * @param {number} start
   * @param {number} length
   * @returns {number}
   */

/**
   * @param {Construct} construct
   * @param {number} from
   * @returns {void}
   */

/**
   * @param {InitialConstruct} initial
   */

/**
   * @param {Node} node
   * @param {VFileCompatible|RunCallback} [doc]
   * @param {RunCallback} [callback]
   * @returns {Promise<Node>|void}
   */

/**
   * @param {Node} node
   * @returns {boolean}
   */

/**
   * @param {Node} node
   */

/**
   * @param {Pluggable|null|undefined} [value]
   * @param {...unknown} options
   * @returns {Processor}
   */

/**
   * @param {TableRow} node
   * @param {ToMarkdownContext} context
   * @param {SafeOptions} safeOptions
   */

/**
   * @param {Table} node
   * @param {ToMarkdownContext} context
   * @param {SafeOptions} safeOptions
   */

/**
   * @param {Token} token
   * @param {boolean} [eof]
   * @returns {void}
   */

/**
   * @param {Token} token
   * @returns {ListItem}
   */

/**
   * @param {Token} token
   * @returns {List}
   */

/**
   * @param {VFileCompatible} doc
   * @param {ProcessCallback} [callback]
   * @returns {Promise<VFile>|undefined}
   */

/**
   * @param {Value} value
   * @param {Encoding | Options | null | undefined} [encoding]
   * @param {Options | null | undefined} [options]
   * @returns {Root}
   */

/**
   * @param {number} size
   * @returns {void}
   */

/**
   * @param {string|Record<string, unknown>} [key]
   * @param {unknown} [value]
   * @returns {unknown}
   */

/**
   * @param {string} $0
   * @returns {string}
   */

/**
   * @param {string} content
   */

/**
   * @param {string} field
   * @param {unknown} value
   */

/**
   * @param {string} header
   * @param {string} body
   */

/**
   * @param {string} href
   * @param {string} title
   * @param {string} text
   */

/**
   * @param {string} name
   * @param {string} v
   */

/**
   * @param {string} quote
   */

/**
   * @param {string} text
   * @param {string} level
   * @param {string} raw
   * @param {any} slugger
   */

/**
   * @param {string} text
   */

/**
   * @param {string} value
   */

/**
   * @template {Node} Kind
   *   Node type.
   * @this {CompileContext}
   *   Context.
   * @param {Kind} node
   *   Node to enter.
   * @param {Token} token
   *   Corresponding token.
   * @param {OnEnterError | undefined} [errorHandler]
   *   Handle the case where this token is open, but it is closed by something else.
   * @returns {Kind}
   *   The given node.
   */

/**
   * @this {CompileContext}
   *   Context.
   * @param {Token} token
   *   Corresponding token.
   * @param {OnExitError | undefined} [onExitError]
   *   Handle the case where another token is open.
   * @returns {Node}
   *   The closed node.
   */

/**
   * @this {CompileContext}
   * @returns {string}
   */

/**
   * @this {CompileContext}
   * @returns {void}
   */

/**
   * @this {CompileContext}
   * @type {Handle}
   */

/**
   * @this {unknown}
   * @param {Array<unknown>} parameters
   * @returns {boolean}
   */

/**
   * @this {unknown}
   * @param {unknown} node
   * @param {Array<unknown>} parameters
   * @returns {boolean}
   */

/**
   * @type {(
   *   ((tree: Node, file: VFile|undefined, options?: Options) => Node) &
   *   ((tree: Node, options?: Options) => Node)
   * )}
   */

/**
   * @type {(
   *   ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) &
   *   ((value: Value, options?: Options | null | undefined) => Root)
   * )}
   */

/**
   * @type {(
   *   (<Kind extends Node>(test: PredicateTest<Kind>) => AssertPredicate<Kind>) &
   *   ((test?: Test) => AssertAnything)
   * )}
   */

/**
   * @type {(
   *   (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: BuildVisitor<Tree, Check>, reverse?: boolean | null | undefined) => void) &
   *   (<Tree extends Node>(tree: Tree, visitor: BuildVisitor<Tree>, reverse?: boolean | null | undefined) => void)
   * )}
   */

/**
   * @type {(
   *   (<Tree extends Node>(tree: Tree, find: Find, replace?: Replace | null | undefined, options?: Options | null | undefined) => Tree) &
   *   (<Tree extends Node>(tree: Tree, schema: FindAndReplaceSchema | FindAndReplaceList, options?: Options | null | undefined) => Tree)
   * )}
   **/

/**
   * @type {State}
   **/

/**
   * @type {ToMarkdownHandle}
   * @param {InlineCode} node
   */

/**
   * @type {ToMarkdownHandle}
   * @param {TableCell} node
   */

/**
   * @type {ToMarkdownHandle}
   * @param {Table} node
   */

/**
   * Call `callback`, only once.
   * @type {Callback}
   */

/**
   * Call `done` with one value.
   *
   * @param {any} [value]
   */

/**
   * Call `middleware`.
   * @this {any}
   * @param {Array<any>} parameters
   * @returns {void}
   */

/**
   * Check whether a code matches the bound regex.
   *
   * @param {Code} code Character code
   * @returns {code is number} Whether the character code matches the bound regex
   */

/**
   * Convert string to unique id
   * @param {object} [options]
   * @param {boolean} [options.dryrun] Generates the next unique slug without
   * updating the internal accumulator.
   */

/**
   * Create a closer handle.
   *
   * @param {Handle} [and]
   *   Optional function to also run.
   * @returns {Handle}
   *   Handle.
   */

/**
   * Create a fatal error associated with the file.
   *
   * Its `fatal` is set to `true` and `file` is set to the current file path.
   * Its added to `file.messages`.
   *
   * > 👉 **Note**: a fatal error means that a file is no longer processable.
   *
   * @param {string | Error | VFileMessage} reason
   *   Reason for message, uses the stack and message of the error if given.
   * @param {Node | NodeLike | Position | Point | null | undefined} [place]
   *   Place in file where the message occurred.
   * @param {string | null | undefined} [origin]
   *   Place in code where the message originates (example:
   *   `'my-package:my-rule'` or `'my-rule'`).
   * @returns {never}
   *   Message.
   * @throws {VFileMessage}
   *   Message.
   */

/**
   * Create a message for `reason` at `place` from `origin`.
   *
   * When an error is passed in as `reason`, the `stack` is copied.
   *
   * @param {string | Error | VFileMessage} reason
   *   Reason for message, uses the stack and message of the error if given.
   *
   *   > 👉 **Note**: you should use markdown.
   * @param {Node | NodeLike | Position | Point | null | undefined} [place]
   *   Place in file where the message occurred.
   * @param {string | null | undefined} [origin]
   *   Place in code where the message originates (example:
   *   `'my-package:my-rule'` or `'my-rule'`).
   * @returns
   *   Instance of `VFileMessage`.
   */

/**
   * Create a new virtual file.
   *
   * `options` is treated as:
   *
   * *   `string` or `Buffer` — `{value: options}`
   * *   `URL` — `{path: options}`
   * *   `VFile` — shallow copies its data over to the new file
   * *   `object` — all fields are shallow copied over to the new file
   *
   * Path related fields are set in the following order (least specific to
   * most specific): `history`, `path`, `basename`, `stem`, `extname`,
   * `dirname`.
   *
   * You cannot set `dirname` or `extname` without setting either `history`,
   * `path`, `basename`, or `stem` too.
   *
   * @param {Compatible | null | undefined} [value]
   *   File value.
   * @returns
   *   New instance.
   */

/**
   * Create a warning message associated with the file.
   *
   * Its `fatal` is set to `false` and `file` is set to the current file path.
   * Its added to `file.messages`.
   *
   * @param {string | Error | VFileMessage} reason
   *   Reason for message, uses the stack and message of the error if given.
   * @param {Node | NodeLike | Position | Point | null | undefined} [place]
   *   Place in file where the message occurred.
   * @param {string | null | undefined} [origin]
   *   Place in code where the message originates (example:
   *   `'my-package:my-rule'` or `'my-rule'`).
   * @returns {VFileMessage}
   *   Message.
   */

/**
   * Create an element for `node`.
   *
   * @type {HFunctionProps}
   */

/**
   * Create an info message associated with the file.
   *
   * Its `fatal` is set to `null` and `file` is set to the current file path.
   * Its added to `file.messages`.
   *
   * @param {string | Error | VFileMessage} reason
   *   Reason for message, uses the stack and message of the error if given.
   * @param {Node | NodeLike | Position | Point | null | undefined} [place]
   *   Place in file where the message occurred.
   * @param {string | null | undefined} [origin]
   *   Place in code where the message originates (example:
   *   `'my-package:my-rule'` or `'my-rule'`).
   * @returns {VFileMessage}
   *   Message.
   */

/**
   * Create an opener handle.
   *
   * @param {(token: Token) => Node} create
   *   Create a node.
   * @param {Handle} [and]
   *   Optional function to also run.
   * @returns {Handle}
   *   Handle.
   */

/**
   * Deal with one code.
   *
   * @param {Code} code
   * @returns {void}
   */

/**
   * Define an increased line shift (the typical indent for lines).
   *
   * @type {TrackShift}
   */

/**
   * Discard results.
   *
   * @type {ReturnHandle}
   */

/**
   * Error `msg`.
   *
   * @param {String} msg
   * @throws {Error}
   */

/**
   * Expose Rules
   */

/**
   * Factory to attempt/check/interrupt.
   *
   * @param {ReturnHandle} onreturn
   * @param {Record<string, unknown>} [fields]
   */

/**
   * Finalise the created `right`, a hast node, from `left`, an mdast node.
   *
   * @param {MdastNodeWithData | PositionLike | null | undefined} left
   * @param {HastElementContent} right
   * @returns {HastElementContent}
   */

/**
   * Finds the next safe (unique) slug to use
   * @param {string} originalSlug
   * @param {boolean} isDryRun
   */

/**
   * Get data.
   *
   * @template {keyof CompileData} Key
   *   Field type.
   * @param {Key} key
   *   Key of field.
   * @returns {CompileData[Key]}
   *   Value.
   */

/**
   * Get the basename (including extname) (example: `'index.min.js'`).
   */

/**
   * Get the current tracked info.
   *
   * @type {TrackCurrent}
   */

/**
   * Get the extname (including dot) (example: `'.js'`).
   */

/**
   * Get the full path (example: `'~/index.min.js'`).
   *
   * @returns {string}
   */

/**
   * Get the parent path (example: `'~'`).
   */

/**
   * Get the point info of `node` at a bound side.
   *
   * @param {NodeLike | Node | null | undefined} [node]
   * @returns {Point}
   */

/**
   * Get the stem (basename w/o extname) (example: `'index.min'`).
   */

/**
   * Handle one value.
   *
   * Based on the bound `key`, a respective handler will be called.
   * If `value` is not an object, or doesn’t have a `key` property, the special
   * “invalid” handler will be called.
   * If `value` has an unknown `key`, the special “unknown” handler will be
   * called.
   *
   * All arguments, and the context object, are passed through to the handler,
   * and it’s result is returned.
   *
   * @this {unknown}
   *   Any context object.
   * @param {unknown} [value]
   *   Any value.
   * @param {...unknown} parameters
   *   Arbitrary parameters passed to the zwitch.
   * @property {Handler} invalid
   *   Handle for values that do not have a certain ID field.
   * @property {Handler} unknown
   *   Handle values that do have a certain ID field, but it’s set to a value
   *   that is not listed in the `handlers` record.
   * @property {Handlers} handlers
   *   Record of handlers.
   * @returns {unknown}
   *   Anything.
   */

/**
   * Lexing
   */

/**
   * Lexing/Compiling
   */

/**
   * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by
   * `consume`).
   * Here is where we walk through the chunks, which either include strings of
   * several characters, or numerical character codes.
   * The reason to do this in a loop instead of a call is so the stack can
   * drain.
   *
   * @returns {void}
   */

/**
   * Mark position and patch `node.position`.
   *
   * @return {Function}
   */

/**
   * Match `re` and return captures.
   *
   * @param {RegExp} re
   * @return {undefined|Array}
   */

/**
   * Move past some generated markdown.
   *
   * @type {TrackMove}
   */

/**
   * Move the current point a bit forward in the line when it’s on a column
   * skip.
   *
   * @returns {void}
   */

/**
   * Non-enumerable source string.
   */

/**
   * Parse Inline Tokens
   */

/**
   * Parse Loop
   */

/**
   * Parse comment.
   *
   * @return {Object}
   * @throws {Error}
   */

/**
   * Parse comments.
   *
   * @param {Object[]} [rules]
   * @return {Object[]}
   */

/**
   * Parse declaration.
   *
   * @return {Object}
   * @throws {Error}
   */

/**
   * Parse declarations.
   *
   * @return {Object[]}
   */

/**
   * Parse whitespace.
   */

/**
   * Positional.
   */

/**
   * Preprocessing
   */

/**
   * Serialize the file.
   *
   * @param {BufferEncoding | null | undefined} [encoding='utf8']
   *   Character encoding to understand `value` as when it’s a `Buffer`
   *   (default: `'utf8'`).
   * @returns {string}
   *   Serialized file.
   */

/**
   * Set basename (including extname) (`'index.min.js'`).
   *
   * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
   * on windows).
   * Cannot be nullified (use `file.path = file.dirname` instead).
   */

/**
   * Set data.
   *
   * @template {keyof CompileData} Key
   *   Field type.
   * @param {Key} key
   *   Key of field.
   * @param {CompileData[Key]} [value]
   *   New value.
   * @returns {void}
   *   Nothing.
   */

/**
   * Set the extname (including dot) (example: `'.js'`).
   *
   * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
   * on windows).
   * Cannot be set if there’s no `path` yet.
   */

/**
   * Set the full path (example: `'~/index.min.js'`).
   *
   * Cannot be nullified.
   * You can set a file URL (a `URL` object with a `file:` protocol) which will
   * be turned into a path with `url.fileURLToPath`.
   *
   * @param {string | URL} path
   */

/**
   * Set the parent path (example: `'~'`).
   *
   * Cannot be set if there’s no `path` yet.
   */

/**
   * Set the stem (basename w/o extname) (example: `'index.min'`).
   *
   * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
   * on windows).
   * Cannot be nullified (use `file.path = file.dirname` instead).
   */

/**
   * State and tools for resolving and serializing.
   *
   * @type {TokenizeContext}
   */

/**
   * Static Lex Inline Method
   */

/**
   * Static Lex Method
   */

/**
   * Static Parse Inline Method
   */

/**
   * Static Parse Method
   */

/**
   * Store position information for a node.
   *
   * @constructor
   * @property {Object} start
   * @property {Object} end
   * @property {undefined|String} source
   */

/**
   * Store state.
   *
   * @returns {Info}
   */

/**
   * Take events and resolve strikethrough.
   *
   * @type {Resolver}
   */

/**
   * The state function.
   *
   * @type {State|void}
   */

/**
   * This function isn’t really used normally, because we handle rows at the
   * table level.
   * But, if someone passes in a table row, this ensures we make somewhat sense.
   *
   * @type {ToMarkdownHandle}
   * @param {TableRow} node
   */

/**
   * Tools used for tokenizing.
   *
   * @type {Effects}
   */

/**
   * Track which character we expect to be consumed, to catch bugs.
   *
   * @type {Code}
   */

/**
   * Transform an mdast node into a hast node.
   *
   * @param {MdastNodes} node
   *   mdast node.
   * @param {MdastParents | null | undefined} [parent]
   *   Parent of `node`.
   * @returns {HastElementContent | Array<HastElementContent> | null | undefined}
   *   Resulting hast node.
   */

/**
   * Transform the children of an mdast node into hast nodes.
   *
   * @param {MdastNodes} parent
   *   mdast node to compile
   * @returns {Array<HastElementContent>}
   *   Resulting hast nodes.
   */

/**
   * Turn micromark events into an mdast tree.
   *
   * @param {Array<Event>} events
   *   Events.
   * @returns {Root}
   *   mdast tree.
   */

/**
   * Update lineno and column based on `str`.
   *
   * @param {String} str
   */

/**
   * Use results.
   *
   * @type {ReturnHandle}
   */

/**
   * span level renderer
   * @param {string} text
   */

/**
 * @callback AssertAnything
 *   Check that an arbitrary value is a node, unaware of TypeScript inferral.
 * @param {unknown} [node]
 *   Anything (typically a node).
 * @param {number | null | undefined} [index]
 *   The node’s position in its parent.
 * @param {Parent | null | undefined} [parent]
 *   The node’s parent.
 * @returns {boolean}
 *   Whether this is a node and passes a test.
 */

/**
 * @callback Handler
 *   Handle a value, with a certain ID field set to a certain value.
 *   The ID field is passed to `zwitch`, and it’s value is this function’s
 *   place on the `handlers` record.
 * @param {...any} parameters
 *   Arbitrary parameters passed to the zwitch.
 *   The first will be an object with a certain ID field set to a certain value.
 * @returns {any}
 *   Anything!
 */

/**
 * @callback InvalidHandler
 *   Handle values that do not have a certain ID field.
 * @param {unknown} value
 *   Any unknown value.
 * @param {...any} rest
 *   Arbitrary parameters passed to the zwitch.
 * @returns {void|null|undefined|never}
 *   This should crash or return nothing.
 */

/**
 * @callback Preprocessor
 * @param {Value} value
 * @param {Encoding} [encoding]
 * @param {boolean} [end=false]
 * @returns {Array<Chunk>}
 */

/**
 * @callback Transform
 *   Extra transform, to change the AST afterwards.
 * @param {Root} tree
 *   Tree to transform.
 * @returns {Root | undefined | null | void}
 *   New tree or nothing (in which case the current tree is used).
 *
 * @callback Handle
 *   Handle a token.
 * @param {CompileContext} this
 *   Context.
 * @param {Token} token
 *   Current token.
 * @returns {void}
 *   Nothing.
 *
 * @typedef {Record<string, Handle>} Handles
 *   Token types mapping to handles
 *
 * @callback OnEnterError
 *   Handle the case where the `right` token is open, but it is closed (by the
 *   `left` token) or because we reached the end of the document.
 * @param {Omit<CompileContext, 'sliceSerialize'>} this
 *   Context.
 * @param {Token | undefined} left
 *   Left token.
 * @param {Token} right
 *   Right token.
 * @returns {void}
 *   Nothing.
 *
 * @callback OnExitError
 *   Handle the case where the `right` token is open but it is closed by
 *   exiting the `left` token.
 * @param {Omit<CompileContext, 'sliceSerialize'>} this
 *   Context.
 * @param {Token} left
 *   Left token.
 * @param {Token} right
 *   Right token.
 * @returns {void}
 *   Nothing.
 *
 * @typedef {[Token, OnEnterError | undefined]} TokenTuple
 *   Open token on the stack, with an optional error handler for when
 *   that token isn’t closed properly.
 */

/**
 * @callback UnknownHandler
 *   Handle values that do have a certain ID field, but it’s set to a value
 *   that is not listed in the `handlers` record.
 * @param {unknown} value
 *   An object with a certain ID field set to an unknown value.
 * @param {...any} rest
 *   Arbitrary parameters passed to the zwitch.
 * @returns {any}
 *   Anything!
 */

/**
 * @license React
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * @param value
 *   Markdown to parse.
 * @param encoding
 *   Character encoding for when `value` is `Buffer`.
 * @param options
 *   Configuration.
 * @returns
 *   mdast tree.
 */

/**
 * @param {'string'|'text'} field
 * @returns {InitialConstruct}
 */

/**
 * @param {Array<ConstructName>} stack
 * @param {Unsafe['inConstruct']} list
 * @param {boolean} none
 * @returns {boolean}
 */

/**
 * @param {Array<ConstructName>} stack
 * @param {Unsafe} pattern
 * @returns {boolean}
 */

/**
 * @param {Array<Content>} nodes
 * @param {HChild} value
 * @returns {void}
 */

/**
 * @param {Array<Event>} events
 * @returns {Array<Event>}
 */

/**
 * @param {Array<Event>} events
 * @returns {boolean}
 */

/**
 * @param {Array<string | Props | TestFunctionAnything>} tests
 * @returns {AssertAnything}
 */

/**
 * @param {Code} code
 * @returns {boolean}
 */

/**
 * @param {Comment} node
 * @returns {P5Comment}
 */

/**
 * @param {Config} combined
 * @param {Array<Extension | Array<Extension>>} extensions
 * @returns {void}
 */

/**
 * @param {Config} combined
 * @param {Extension} extension
 * @returns {void}
 */

/**
 * @param {Context} context
 * @param {Element|Root} node
 */

/**
 * @param {Context} context
 * @param {Element} node
 * @param {number} index
 * @param {Element|Root} parent
 */

/**
 * @param {DefinedInfo} values
 * @param {string} key
 * @param {unknown} value
 */

/**
 * @param {Definition} definition
 * @returns {Schema}
 */

/**
 * @param {Doctype} node
 * @returns {P5Doctype}
 */

/**
 * @param {Effects} effects
 * @param {State} ok
 * @param {State} nok
 * @param {string} type
 * @param {string} literalType
 * @param {string} literalMarkerType
 * @param {string} rawType
 * @param {string} stringType
 * @param {number} [max=Infinity]
 * @returns {State}
 */

/**
 * @param {Effects} effects
 * @param {State} ok
 * @param {State} nok
 * @param {string} type
 * @param {string} markerType
 * @param {string} stringType
 * @returns {State}
 */

/**
 * @param {Effects} effects
 * @param {State} ok
 * @param {string} type
 * @param {number} [max=Infinity]
 * @returns {State}
 */

/**
 * @param {Effects} effects
 * @param {State} ok
 */

/**
 * @param {Element|Root} node
 * @returns {Element?}
 */

/**
 * @param {Element|Root} parent
 * @param {Element} [node]
 * @returns {number}
 */

/**
 * @param {Element} node
 * @param {Schema} schema
 *   Current schema.
 * @returns {P5Element}
 *   `parse5` node.
 */

/**
 * @param {Element} node
 * @returns {Array<P5Attribute>}
 */

/**
 * @param {Element} node
 * @returns {HiddenToken}
 */

/**
 * @param {HProperties | HChild} value
 * @param {string} name
 * @returns {value is HProperties}
 */

/**
 * @param {InlineCode} node
 * @param {Parent | undefined} _
 * @param {State} state
 * @returns {string}
 */

/**
 * @param {ListItem} node
 * @param {Parent | undefined} parent
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */

/**
 * @param {ListItem} node
 * @return {Boolean}
 */

/**
 * @param {Node|Stitch} node
 * @returns {P5Location}
 */

/**
 * @param {Node} left
 * @param {Node} right
 * @param {Parent} parent
 * @param {State} state
 * @returns {string}
 */

/**
 * @param {Node} node
 * @returns {boolean}
 */

/**
 * @param {Node} node
 */

/**
 * @param {Options} [options]
 * @returns {Extension}
 */

/**
 * @param {Parent & {children: Array<FlowContent>}} parent
 *   Parent of flow nodes.
 * @param {State} state
 *   Info passed around about the current state.
 * @param {TrackFields} info
 *   Info on where we are in the document we are generating.
 * @returns {string}
 *   Serialized children, joined by (blank) lines.
 */

/**
 * @param {Parents} node
 * @return {Boolean}
 */

/**
 * @param {ParseOptions} [options]
 * @returns {ParseContext}
 */

/**
 * @param {Point | PointLike | null | undefined} point
 * @returns {string}
 */

/**
 * @param {Position | PositionLike | null | undefined} pos
 * @returns {string}
 */

/**
 * @param {Position|{start: {line: null, column: null, offset: null}, end: {line: null, column: null, offset: null}}} pos
 * @returns {string}
 */

/**
 * @param {Record<string, string>} attributes
 * @param {string} attribute
 * @returns {string}
 */

/**
 * @param {Record<string, string>} attributes
 * @param {string} property
 * @returns {string}
 */

/**
 * @param {Record<string, unknown>} props
 * @param {string} prop
 * @param {unknown} value
 * @param {Context} ctx
 */

/**
 * @param {RegExpMatchObject} match
 * @param {boolean | null | undefined} [email=false]
 * @returns {boolean}
 */

/**
 * @param {Resolver} [extraResolver]
 * @returns {Resolver}
 */

/**
 * @param {Root} node
 * @param {Schema} schema
 *   Current schema.
 * @returns {P5Document}
 */

/**
 * @param {Root} node
 * @param {Schema} schema
 *   Current schema.
 * @returns {P5Fragment}
 */

/**
 * @param {Schema[]} definitions
 * @param {string} [space]
 * @returns {Schema}
 */

/**
 * @param {Schema} schema
 * @param {Properties} properties
 * @param {string} key
 * @param {HStyle | HPropertyValue} value
 * @returns {void}
 */

/**
 * @param {Schema} schema
 * @param {string} defaultTagName
 * @param {Array<string>} [caseSensitive]
 */

/**
 * @param {Schema} schema
 * @param {string} value
 * @returns {Info}
 */

/**
 * @param {State} state
 * @returns {Exclude<Options['bullet'], null | undefined>}
 */

/**
 * @param {State} state
 * @returns {Exclude<Options['listItemIndent'], null | undefined>}
 */

/**
 * @param {String} style
 * @param {Object} [options]
 * @return {Object[]}
 * @throws {TypeError}
 * @throws {Error}
 */

/**
 * @param {Text} node
 * @returns {P5Text}
 */

/**
 * @param {Unsafe} pattern
 * @returns {RegExp}
 */

/**
 * @param {VFileCompatible} [value]
 * @returns {VFile}
 */

/**
 * @param {VFileCompatible} [value]
 * @returns {value is VFile}
 */

/**
 * @param {VFile|Options|undefined} value
 * @return {value is Options}
 */

/**
 * @param {boolean} sanitize
 * @param {string} base
 * @param {string} href
 */

/**
 * @param {number | null | undefined} value
 * @returns {number}
 */

/**
 * @param {number} a
 * @param {number} b
 * @returns {number}
 */

/**
 * @param {string | RegExp} regex
 * @param {string} opt
 */

/**
 * @param {string | URL} path
 *   File URL.
 * @returns {string}
 *   File URL.
 */

/**
 * @param {string | null | undefined} [value]
 * @returns {string}
 */

/**
 * @param {string|null|undefined} [value]
 * @returns {string}
 */

/**
 * @param {string|null|undefined} value
 * @returns {number}
 */

/**
 * @param {string} $0
 * @param {string} $1
 * @param {string} $2
 * @returns {string}
 */

/**
 * @param {string} $0
 * @param {string} $1
 * @returns {string}
 */

/**
 * @param {string} $0
 * @returns {string}
 */

/**
 * @param {string} base
 * @param {string} href
 */

/**
 * @param {string} d
 * @returns {string}
 */

/**
 * @param {string} domain
 * @returns {boolean}
 */

/**
 * @param {string} html
 */

/**
 * @param {string} pattern
 * @param {number} count
 */

/**
 * @param {string} uri
 * @returns {string}
 */

/**
 * @param {string} url
 * @returns {[string, string | undefined]}
 */

/**
 * @param {string} value
 *   Line to trim.
 * @param {boolean} start
 *   Whether to trim the start of the line.
 * @param {boolean} end
 *   Whether to trim the end of the line.
 * @returns {string}
 *   Trimmed line.
 */

/**
 * @param {string} value
 * @param {string} after
 * @returns {string}
 */

/**
 * @param {string} value
 * @returns {Record<string, string>}
 */

/**
 * @param {string} value
 * @returns {number}
 */

/**
 * @param {string} value
 * @returns {string|false}
 */

/**
 * @param {string} value
 * @returns {string}
 */

/**
 * @param {unknown} [value]
 * @returns {value is VFileValue}
 */

/**
 * @param {unknown} _
 * @param {string} $1
 */

/**
 * @returns {Extension}
 */

/**
 * @returns {Preprocessor}
 */

/**
 * @returns {Processor}
 */

/**
 * @returns {string}
 */

/**
 * @template T
 * @typedef {import('react').ComponentPropsWithoutRef<T>} ComponentPropsWithoutRef<T>
 */

/**
 * @template T
 * @typedef {import('react').ComponentType<T>} ComponentType<T>
 */

/**
 * @template {InvalidHandler} [Invalid=InvalidHandler]
 * @template {UnknownHandler} [Unknown=UnknownHandler]
 * @template {Record<string, Handler>} [Handlers=Record<string, Handler>]
 * @typedef Options
 *   Configuration (required).
 * @property {Invalid} [invalid]
 *   Handler to use for invalid values.
 * @property {Unknown} [unknown]
 *   Handler to use for unknown values.
 * @property {Handlers} [handlers]
 *   Handlers to use.
 */

/**
 * @template {Node} Kind
 *   Node type.
 * @typedef {Kind['type'] | Partial<Kind> | TestFunctionPredicate<Kind> | Array<Kind['type'] | Partial<Kind> | TestFunctionPredicate<Kind>>} PredicateTest
 *   Check for a node that can be inferred by TypeScript.
 */

/**
 * @template {Node} [Tree=Node]
 *   Tree type.
 * @template {Test} [Check=string]
 *   Test type.
 * @typedef {Visitor<import('./complex-types.js').Matches<import('./complex-types.js').InclusiveDescendant<Tree>, Check>, Extract<import('./complex-types.js').InclusiveDescendant<Tree>, Parent>>} BuildVisitor
 *   Build a typed `Visitor` function from a tree and a test.
 *
 *   It will infer which values are passed as `node` and which as `parents`.
 */

/**
 * @template {Node} [Visited=Node]
 *   Visited node type.
 * @template {Parent} [Ancestor=Parent]
 *   Ancestor type.
 * @callback Visitor
 *   Handle a node (matching `test`, if given).
 *
 *   Visitors are free to transform `node`.
 *   They can also transform `parent`.
 *
 *   Replacing `node` itself, if `SKIP` is not returned, still causes its
 *   descendants to be walked (which is a bug).
 *
 *   When adding or removing previous siblings of `node` (or next siblings, in
 *   case of reverse), the `Visitor` should return a new `Index` to specify the
 *   sibling to traverse after `node` is traversed.
 *   Adding or removing next siblings of `node` (or previous siblings, in case
 *   of reverse) is handled as expected without needing to return a new `Index`.
 *
 *   Removing the children property of `parent` still results in them being
 *   traversed.
 * @param {Visited} node
 *   Found node.
 * @param {Visited extends Node ? number | null : never} index
 *   Index of `node` in `parent`.
 * @param {Ancestor extends Node ? Ancestor | null : never} parent
 *   Parent of `node`.
 * @returns {VisitorResult}
 *   What to do next.
 *
 *   An `Index` is treated as a tuple of `[CONTINUE, Index]`.
 *   An `Action` is treated as a tuple of `[Action]`.
 *
 *   Passing a tuple back only makes sense if the `Action` is `SKIP`.
 *   When the `Action` is `EXIT`, that action can be returned.
 *   When the `Action` is `CONTINUE`, `Index` can be returned.
 */

/**
 * @template {Node} [Visited=Node]
 *   Visited node type.
 * @template {Parent} [Ancestor=Parent]
 *   Ancestor type.
 * @callback Visitor
 *   Handle a node (matching `test`, if given).
 *
 *   Visitors are free to transform `node`.
 *   They can also transform the parent of node (the last of `ancestors`).
 *
 *   Replacing `node` itself, if `SKIP` is not returned, still causes its
 *   descendants to be walked (which is a bug).
 *
 *   When adding or removing previous siblings of `node` (or next siblings, in
 *   case of reverse), the `Visitor` should return a new `Index` to specify the
 *   sibling to traverse after `node` is traversed.
 *   Adding or removing next siblings of `node` (or previous siblings, in case
 *   of reverse) is handled as expected without needing to return a new `Index`.
 *
 *   Removing the children property of an ancestor still results in them being
 *   traversed.
 * @param {Visited} node
 *   Found node.
 * @param {Array<Ancestor>} ancestors
 *   Ancestors of `node`.
 * @returns {VisitorResult}
 *   What to do next.
 *
 *   An `Index` is treated as a tuple of `[CONTINUE, Index]`.
 *   An `Action` is treated as a tuple of `[Action]`.
 *
 *   Passing a tuple back only makes sense if the `Action` is `SKIP`.
 *   When the `Action` is `EXIT`, that action can be returned.
 *   When the `Action` is `CONTINUE`, `Index` can be returned.
 */

/**
 * @template {ReporterSettings} Settings
 *   Options type.
 * @callback Reporter
 *   Type for a reporter.
 * @param {Array<VFile>} files
 *   Files to report.
 * @param {Settings} options
 *   Configuration.
 * @returns {string}
 *   Report.
 */

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */

/**
 * @this {TokenizeContext}
 * @param {Effects} effects
 * @param {State} ok
 * @param {State} nok
 * @param {string} type
 * @param {string} markerType
 * @param {string} stringType
 * @returns {State}
 */

/**
 * @type {Exiter}
 * @this {TokenizeContextWithState}
 */

/**
 * @type {IndentLines}
 */

/**
 * @type {ReplaceFunction}
 * @param {string} _
 * @param {string} atext
 * @param {string} label
 * @param {RegExpMatchObject} match
 * @returns {Link | false}
 */

/**
 * @type {ReplaceFunction}
 * @param {string} _
 * @param {string} protocol
 * @param {string} domain
 * @param {string} path
 * @param {RegExpMatchObject} match
 * @returns {Link | Array<PhrasingContent> | false}
 */

/**
 * @type {ToMarkdownHandle}
 * @param {Delete} node
 */

/**
 * @type {ToMarkdownHandle}
 * @param {FootnoteDefinition} node
 */

/**
 * @type {ToMarkdownHandle}
 * @param {FootnoteReference} node
 */

/**
 * @type {ToMarkdownHandle}
 * @param {ListItem} node
 */

/**
 * @type {Tokenizer}
 * @this {TokenizeContextWithState}
 */

/**
 * @type {import('unified').Plugin<[Options], Root>}
 */

/**
 * @typedef Config
 *   Configuration.
 *
 *   We have our defaults, but extensions will add more.
 * @property {Array<string>} canContainEols
 *   Token types where line endings are used.
 * @property {Handles} enter
 *   Opening handles.
 * @property {Handles} exit
 *   Closing handles.
 * @property {Array<Transform>} transforms
 *   Tree transforms.
 *
 * @typedef {Partial<Config>} Extension
 *   Change how markdown tokens from micromark are turned into mdast.
 *
 * @typedef CompileContext
 *   mdast compiler context.
 * @property {Array<Node | Fragment>} stack
 *   Stack of nodes.
 * @property {Array<TokenTuple>} tokenStack
 *   Stack of tokens.
 * @property {<Key extends keyof CompileData>(key: Key) => CompileData[Key]} getData
 *   Get data from the key/value store.
 * @property {<Key extends keyof CompileData>(key: Key, value?: CompileData[Key]) => void} setData
 *   Set data into the key/value store.
 * @property {(this: CompileContext) => void} buffer
 *   Capture some of the output data.
 * @property {(this: CompileContext) => string} resume
 *   Stop capturing and access the output data.
 * @property {<Kind extends Node>(this: CompileContext, node: Kind, token: Token, onError?: OnEnterError) => Kind} enter
 *   Enter a token.
 * @property {(this: CompileContext, token: Token, onError?: OnExitError) => Node} exit
 *   Exit a token.
 * @property {TokenizeContext['sliceSerialize']} sliceSerialize
 *   Get the string value of a token.
 * @property {Config} config
 *   Configuration.
 *
 * @typedef FromMarkdownOptions
 *   Configuration for how to build mdast.
 * @property {Array<Extension | Array<Extension>> | null | undefined} [mdastExtensions]
 *   Extensions for this utility to change how tokens are turned into a tree.
 *
 * @typedef {ParseOptions & FromMarkdownOptions} Options
 *   Configuration.
 */

/**
 * @typedef Info
 * @property {() => void} restore
 * @property {number} from
 *
 * @callback ReturnHandle
 *   Handle a successful run.
 * @param {Construct} construct
 * @param {Info} info
 * @returns {void}
 */

/**
 * @typedef NodeLike
 * @property {string} type
 * @property {PositionLike | null | undefined} [position]
 *
 * @typedef PositionLike
 * @property {PointLike | null | undefined} [start]
 * @property {PointLike | null | undefined} [end]
 *
 * @typedef PointLike
 * @property {number | null | undefined} [line]
 * @property {number | null | undefined} [column]
 * @property {number | null | undefined} [offset]
 */

/**
 * @typedef Options
 *   Configuration (optional).
 * @property {boolean} [singleTilde=true]
 *   Whether to support strikethrough with a single tilde (`boolean`, default:
 *   `true`).
 *   Single tildes work on github.com, but are technically prohibited by the
 *   GFM spec.
 */

/**
 * @typedef Options
 *   Configuration (optional).
 * @property {string|null|ReadonlyArray<string|null|undefined>} [align]
 *   One style for all columns, or styles for their respective columns.
 *   Each style is either `'l'` (left), `'r'` (right), or `'c'` (center).
 *   Other values are treated as `''`, which doesn’t place the colon in the
 *   alignment row but does align left.
 *   *Only the lowercased first character is used, so `Right` is fine.*
 * @property {boolean} [padding=true]
 *   Whether to add a space of padding between delimiters and cells.
 *
 *   When `true`, there is padding:
 *
 *   ```markdown
 *   | Alpha | B     |
 *   | ----- | ----- |
 *   | C     | Delta |
 *   ```
 *
 *   When `false`, there is no padding:
 *
 *   ```markdown
 *   |Alpha|B    |
 *   |-----|-----|
 *   |C    |Delta|
 *   ```
 * @property {boolean} [delimiterStart=true]
 *   Whether to begin each row with the delimiter.
 *
 *   > 👉 **Note**: please don’t use this: it could create fragile structures
 *   > that aren’t understandable to some markdown parsers.
 *
 *   When `true`, there are starting delimiters:
 *
 *   ```markdown
 *   | Alpha | B     |
 *   | ----- | ----- |
 *   | C     | Delta |
 *   ```
 *
 *   When `false`, there are no starting delimiters:
 *
 *   ```markdown
 *   Alpha | B     |
 *   ----- | ----- |
 *   C     | Delta |
 *   ```
 * @property {boolean} [delimiterEnd=true]
 *   Whether to end each row with the delimiter.
 *
 *   > 👉 **Note**: please don’t use this: it could create fragile structures
 *   > that aren’t understandable to some markdown parsers.
 *
 *   When `true`, there are ending delimiters:
 *
 *   ```markdown
 *   | Alpha | B     |
 *   | ----- | ----- |
 *   | C     | Delta |
 *   ```
 *
 *   When `false`, there are no ending delimiters:
 *
 *   ```markdown
 *   | Alpha | B
 *   | ----- | -----
 *   | C     | Delta
 *   ```
 * @property {boolean} [alignDelimiters=true]
 *   Whether to align the delimiters.
 *   By default, they are aligned:
 *
 *   ```markdown
 *   | Alpha | B     |
 *   | ----- | ----- |
 *   | C     | Delta |
 *   ```
 *
 *   Pass `false` to make them staggered:
 *
 *   ```markdown
 *   | Alpha | B |
 *   | - | - |
 *   | C | Delta |
 *   ```
 * @property {(value: string) => number} [stringLength]
 *   Function to detect the length of table cell content.
 *   This is used when aligning the delimiters (`|`) between table cells.
 *   Full-width characters and emoji mess up delimiter alignment when viewing
 *   the markdown source.
 *   To fix this, you can pass this function, which receives the cell content
 *   and returns its “visible” size.
 *   Note that what is and isn’t visible depends on where the text is displayed.
 *
 *   Without such a function, the following:
 *
 *   ```js
 *   markdownTable([
 *     ['Alpha', 'Bravo'],
 *     ['中文', 'Charlie'],
 *     ['👩‍❤️‍👩', 'Delta']
 *   ])
 *   ```
 *
 *   Yields:
 *
 *   ```markdown
 *   | Alpha | Bravo |
 *   | - | - |
 *   | 中文 | Charlie |
 *   | 👩‍❤️‍👩 | Delta |
 *   ```
 *
 *   With [`string-width`](https://github.com/sindresorhus/string-width):
 *
 *   ```js
 *   import stringWidth from 'string-width'
 *
 *   markdownTable(
 *     [
 *       ['Alpha', 'Bravo'],
 *       ['中文', 'Charlie'],
 *       ['👩‍❤️‍👩', 'Delta']
 *     ],
 *     {stringLength: stringWidth}
 *   )
 *   ```
 *
 *   Yields:
 *
 *   ```markdown
 *   | Alpha | Bravo   |
 *   | ----- | ------- |
 *   | 中文  | Charlie |
 *   | 👩‍❤️‍👩    | Delta   |
 *   ```
 */

/**
 * @typedef Options
 *   Configuration for `stringify`.
 * @property {boolean} [padLeft=true]
 *   Whether to pad a space before a token.
 * @property {boolean} [padRight=false]
 *   Whether to pad a space after a token.
 */

/**
 * @typedef Options
 *   Configuration.
 * @property {boolean | null | undefined} [tableCellPadding=true]
 *   Whether to add a space of padding between delimiters and cells.
 * @property {boolean | null | undefined} [tablePipeAlign=true]
 *   Whether to align the delimiters.
 * @property {MarkdownTableOptions['stringLength'] | null | undefined} [stringLength]
 *   Function to detect the length of table cell content, used when aligning
 *   the delimiters between cells
 */

/**
 * @typedef Point
 *   unist point, where `line` and `column` can be `undefined`.
 * @property {number | undefined} line
 *   Line.
 * @property {number | undefined} column
 *   Column.
 * @property {number | undefined} [offset]
 *   Offset.
 *
 * @typedef PointLike
 *   unist point, allowed as input.
 * @property {number | null | undefined} [line]
 *   Line.
 * @property {number | null | undefined} [column]
 *   Column.
 * @property {number | null | undefined} [offset]
 *   Offset.
 *
 * @callback ToPoint
 *   Get a line/column-based `point` from `offset`.
 * @param {number | null | undefined} [offset]
 *   Something that should be an `offset.
 * @returns {Point}
 *   Point, line/column are undefined for invalid or out of bounds input.
 *
 * @callback ToOffset
 *   Get an offset from a line/column-based `point`.
 * @param {Point | null | undefined} [point]
 *   Something that should be a `point.
 * @returns {number}
 *   Offset or `-1` for invalid or out of bounds input.
 *
 * @typedef Location
 *   Accessors for index.
 * @property {ToPoint} toPoint
 *   Get a line/column-based `point` from `offset`.
 * @property {ToOffset} toOffset
 *   Get an offset from a line/column-based `point`.
 */

/**
 * @typedef PointLike
 * @property {number | null | undefined} [line]
 * @property {number | null | undefined} [column]
 * @property {number | null | undefined} [offset]
 *
 * @typedef PositionLike
 * @property {PointLike | null | undefined} [start]
 * @property {PointLike | null | undefined} [end]
 *
 * @typedef NodeLike
 * @property {PositionLike | null | undefined} [position]
 */

/**
 * @typedef URL
 * @property {string} hash
 * @property {string} host
 * @property {string} hostname
 * @property {string} href
 * @property {string} origin
 * @property {string} password
 * @property {string} pathname
 * @property {string} port
 * @property {string} protocol
 * @property {string} search
 * @property {any} searchParams
 * @property {string} username
 * @property {() => string} toString
 * @property {() => string} toJSON
 */

/**
 * @typedef {'left'|'center'|'right'|'none'} Align
 */

/**
 * @typedef {(error?: Error|null|undefined, ...output: Array<any>) => void} Callback
 * @typedef {(...input: Array<any>) => any} Middleware
 *
 * @typedef {(...input: Array<any>) => void} Run
 *   Call all middleware.
 * @typedef {(fn: Middleware) => Pipeline} Use
 *   Add `fn` (middleware) to the list.
 * @typedef {{run: Run, use: Use}} Pipeline
 *   Middleware.
 */

/**
 * @typedef {Content | Root} Node
 *   Any concrete `hast` node.
 * @typedef {Root | Element} HResult
 *   Result from a `h` (or `s`) call.
 *
 * @typedef {string | number} HStyleValue
 *   Value for a CSS style field.
 * @typedef {Record<string, HStyleValue>} HStyle
 *   Supported value of a `style` prop.
 * @typedef {string | number | boolean | null | undefined} HPrimitiveValue
 *   Primitive property value.
 * @typedef {Array<string | number>} HArrayValue
 *   List of property values for space- or comma separated values (such as `className`).
 * @typedef {HPrimitiveValue | HArrayValue} HPropertyValue
 *   Primitive value or list value.
 * @typedef {{[property: string]: HPropertyValue | HStyle}} HProperties
 *   Acceptable value for element properties.
 *
 * @typedef {string | number | null | undefined} HPrimitiveChild
 *   Primitive children, either ignored (nullish), or turned into text nodes.
 * @typedef {Array<Node | HPrimitiveChild>} HArrayChild
 *   List of children.
 * @typedef {Node | HPrimitiveChild | HArrayChild} HChild
 *   Acceptable child value.
 */

/**
 * @typedef {Content | Root} Node
 * @typedef {'html' | 'svg'} Space
 *
 * @typedef Options
 *   Configuration.
 * @property {Space | null | undefined} [space='html']
 *   Which space the document is in.
 *
 *   When an `<svg>` element is found in the HTML space, this package already
 *   automatically switches to and from the SVG space when entering and exiting
 *   it.
 */

/**
 * @typedef {Content | Root} Node
 * @typedef {DefaultTreeAdapterMap['document']} P5Document
 * @typedef {DefaultTreeAdapterMap['documentFragment']} P5DocumentFragment
 * @typedef {DefaultTreeAdapterMap['documentType']} P5DocumentType
 * @typedef {DefaultTreeAdapterMap['commentNode']} P5Comment
 * @typedef {DefaultTreeAdapterMap['textNode']} P5Text
 * @typedef {DefaultTreeAdapterMap['element']} P5Element
 * @typedef {DefaultTreeAdapterMap['node']} P5Node
 * @typedef {DefaultTreeAdapterMap['template']} P5Template
 *
 * @typedef {'html' | 'svg'} Space
 *   Namespace.
 *
 * @typedef Options
 *   Configuration.
 * @property {Space | null | undefined} [space='html']
 *   Which space the document is in.
 *
 *   When an `<svg>` element is found in the HTML space, this package already
 *   automatically switches to and from the SVG space when entering and exiting
 *   it.
 * @property {VFile | null | undefined} [file]
 *   File used to add positional info to nodes.
 *
 *   If given, the file should represent the original HTML source.
 * @property {boolean} [verbose=false]
 *   Whether to add extra positional info about starting tags, closing tags,
 *   and attributes to elements.
 *
 *   > 👉 **Note**: only used when `file` is given.
 *
 * @typedef State
 *   Info passed around about the current state.
 * @property {Schema} schema
 *   Current schema.
 * @property {VFile | undefined} file
 *   Corresponding file.
 * @property {boolean | undefined} verbose
 *   Add extra positional info.
 * @property {boolean} location
 *   Whether location info was found.
 */

/**
 * @typedef {Content | Root} Node
 * @typedef {Extract<Node, MdastParent>} Parent
 * @typedef {Exclude<Parent, Root>} ContentParent
 *
 * @typedef RegExpMatchObject
 *   Info on the match.
 * @property {number} index
 *   The index of the search at which the result was found.
 * @property {string} input
 *   A copy of the search string in the text node.
 * @property {[Root, ...Array<ContentParent>, Text]} stack
 *   All ancestors of the text node, where the last node is the text itself.
 *
 * @callback ReplaceFunction
 *   Callback called when a search matches.
 * @param {...any} parameters
 *   The parameters are the result of corresponding search expression:
 *
 *   * `value` (`string`) — whole match
 *   * `...capture` (`Array<string>`) — matches from regex capture groups
 *   * `match` (`RegExpMatchObject`) — info on the match
 * @returns {Array<PhrasingContent> | PhrasingContent | string | false | undefined | null}
 *   Thing to replace with.
 *
 *   * when `null`, `undefined`, `''`, remove the match
 *   * …or when `false`, do not replace at all
 *   * …or when `string`, replace with a text node of that value
 *   * …or when `Node` or `Array<Node>`, replace with those nodes
 *
 * @typedef {string | RegExp} Find
 *   Pattern to find.
 *
 *   Strings are escaped and then turned into global expressions.
 *
 * @typedef {Array<FindAndReplaceTuple>} FindAndReplaceList
 *   Several find and replaces, in array form.
 * @typedef {Record<string, Replace>} FindAndReplaceSchema
 *   Several find and replaces, in object form.
 * @typedef {[Find, Replace]} FindAndReplaceTuple
 *   Find and replace in tuple form.
 * @typedef {string | ReplaceFunction} Replace
 *   Thing to replace with.
 * @typedef {[RegExp, ReplaceFunction]} Pair
 *   Normalized find and replace.
 * @typedef {Array<Pair>} Pairs
 *   All find and replaced.
 *
 * @typedef Options
 *   Configuration.
 * @property {Test | null | undefined} [ignore]
 *   Test for which nodes to ignore.
 */

/**
 * @typedef {Extract<Root | Content, Parent>} Parents
 */

/**
 * @typedef {HastRoot | HastContent} HastNodes
 * @typedef {MdastRoot | MdastContent} MdastNodes
 * @typedef {Extract<MdastNodes, MdastParent>} MdastParents
 *
 * @typedef EmbeddedHastFields
 *   hast fields.
 * @property {string | null | undefined} [hName]
 *   Generate a specific element with this tag name instead.
 * @property {HastProperties | null | undefined} [hProperties]
 *   Generate an element with these properties instead.
 * @property {Array<HastElementContent> | null | undefined} [hChildren]
 *   Generate an element with this content instead.
 *
 * @typedef {Record<string, unknown> & EmbeddedHastFields} MdastData
 *   mdast data with embedded hast fields.
 *
 * @typedef {MdastNodes & {data?: MdastData | null | undefined}} MdastNodeWithData
 *   mdast node with embedded hast data.
 *
 * @typedef PointLike
 *   Point-like value.
 * @property {number | null | undefined} [line]
 *   Line.
 * @property {number | null | undefined} [column]
 *   Column.
 * @property {number | null | undefined} [offset]
 *   Offset.
 *
 * @typedef PositionLike
 *   Position-like value.
 * @property {PointLike | null | undefined} [start]
 *   Point-like value.
 * @property {PointLike | null | undefined} [end]
 *   Point-like value.
 *
 * @callback Handler
 *   Handle a node.
 * @param {State} state
 *   Info passed around.
 * @param {any} node
 *   mdast node to handle.
 * @param {MdastParents | null | undefined} parent
 *   Parent of `node`.
 * @returns {HastElementContent | Array<HastElementContent> | null | undefined}
 *   hast node.
 *
 * @callback HFunctionProps
 *   Signature of `state` for when props are passed.
 * @param {MdastNodes | PositionLike | null | undefined} node
 *   mdast node or unist position.
 * @param {string} tagName
 *   HTML tag name.
 * @param {HastProperties} props
 *   Properties.
 * @param {Array<HastElementContent> | null | undefined} [children]
 *   hast content.
 * @returns {HastElement}
 *   Compiled element.
 *
 * @callback HFunctionNoProps
 *   Signature of `state` for when no props are passed.
 * @param {MdastNodes | PositionLike | null | undefined} node
 *   mdast node or unist position.
 * @param {string} tagName
 *   HTML tag name.
 * @param {Array<HastElementContent> | null | undefined} [children]
 *   hast content.
 * @returns {HastElement}
 *   Compiled element.
 *
 * @typedef HFields
 *   Info on `state`.
 * @property {boolean} dangerous
 *   Whether HTML is allowed.
 * @property {string} clobberPrefix
 *   Prefix to use to prevent DOM clobbering.
 * @property {string} footnoteLabel
 *   Label to use to introduce the footnote section.
 * @property {string} footnoteLabelTagName
 *   HTML used for the footnote label.
 * @property {HastProperties} footnoteLabelProperties
 *   Properties on the HTML tag used for the footnote label.
 * @property {string} footnoteBackLabel
 *   Label to use from backreferences back to their footnote call.
 * @property {(identifier: string) => MdastDefinition | null} definition
 *   Definition cache.
 * @property {Record<string, MdastFootnoteDefinition>} footnoteById
 *   Footnote definitions by their identifier.
 * @property {Array<string>} footnoteOrder
 *   Identifiers of order when footnote calls first appear in tree order.
 * @property {Record<string, number>} footnoteCounts
 *   Counts for how often the same footnote was called.
 * @property {Handlers} handlers
 *   Applied handlers.
 * @property {Handler} unknownHandler
 *   Handler for any none not in `passThrough` or otherwise handled.
 * @property {(from: MdastNodes, node: HastNodes) => void} patch
 *   Copy a node’s positional info.
 * @property {<Type extends HastNodes>(from: MdastNodes, to: Type) => Type | HastElement} applyData
 *   Honor the `data` of `from`, and generate an element instead of `node`.
 * @property {(node: MdastNodes, parent: MdastParents | null | undefined) => HastElementContent | Array<HastElementContent> | null | undefined} one
 *   Transform an mdast node to hast.
 * @property {(node: MdastNodes) => Array<HastElementContent>} all
 *   Transform the children of an mdast parent to hast.
 * @property {<Type extends HastContent>(nodes: Array<Type>, loose?: boolean | null | undefined) => Array<Type | HastText>} wrap
 *   Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`.
 * @property {(left: MdastNodeWithData | PositionLike | null | undefined, right: HastElementContent) => HastElementContent} augment
 *   Like `state` but lower-level and usable on non-elements.
 *   Deprecated: use `patch` and `applyData`.
 * @property {Array<string>} passThrough
 *   List of node types to pass through untouched (except for their children).
 *
 * @typedef Options
 *   Configuration (optional).
 * @property {boolean | null | undefined} [allowDangerousHtml=false]
 *   Whether to persist raw HTML in markdown in the hast tree.
 * @property {string | null | undefined} [clobberPrefix='user-content-']
 *   Prefix to use before the `id` attribute on footnotes to prevent it from
 *   *clobbering*.
 * @property {string | null | undefined} [footnoteBackLabel='Back to content']
 *   Label to use from backreferences back to their footnote call (affects
 *   screen readers).
 * @property {string | null | undefined} [footnoteLabel='Footnotes']
 *   Label to use for the footnotes section (affects screen readers).
 * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}]
 *   Properties to use on the footnote label (note that `id: 'footnote-label'`
 *   is always added as footnote calls use it with `aria-describedby` to
 *   provide an accessible label).
 * @property {string | null | undefined} [footnoteLabelTagName='h2']
 *   Tag name to use for the footnote label.
 * @property {Handlers | null | undefined} [handlers]
 *   Extra handlers for nodes.
 * @property {Array<string> | null | undefined} [passThrough]
 *   List of custom mdast node types to pass through (keep) in hast (note that
 *   the node itself is passed, but eventual children are transformed).
 * @property {Handler | null | undefined} [unknownHandler]
 *   Handler for all unknown nodes.
 *
 * @typedef {Record<string, Handler>} Handlers
 *   Handle nodes.
 *
 * @typedef {HFunctionProps & HFunctionNoProps & HFields} State
 *   Info passed around.
 */

/**
 * @typedef {HastRoot | HastContent} HastNodes
 * @typedef {MdastRoot | MdastContent} MdastNodes
 */

/**
 * @typedef {Options} MarkdownTableOptions
 * @todo
 *   Remove next major.
 */

/**
 * @typedef {Options} StringifyOptions
 *   Please use `StringifyOptions` instead.
 */

/**
 * @typedef {Record<string, unknown> & {marker: Code, type: string, size: number}} ListContainerState
 * @typedef {TokenizeContext & {containerState: ListContainerState}} TokenizeContextWithState
 */

/**
 * @typedef {Record<string, unknown> & {type: string, position?: Position | undefined}} NodeLike
 *
 * @typedef {'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'} BufferEncoding
 *   Encodings supported by the buffer class.
 *
 *   This is a copy of the types from Node, copied to prevent Node globals from
 *   being needed.
 *   Copied from: <https://github.com/DefinitelyTyped/DefinitelyTyped/blob/90a4ec8/types/node/buffer.d.ts#L170>
 *
 * @typedef {Options | URL | Value | VFile} Compatible
 *   Things that can be passed to the constructor.
 *
 * @typedef VFileCoreOptions
 *   Set multiple values.
 * @property {Value | null | undefined} [value]
 *   Set `value`.
 * @property {string | null | undefined} [cwd]
 *   Set `cwd`.
 * @property {Array<string> | null | undefined} [history]
 *   Set `history`.
 * @property {URL | string | null | undefined} [path]
 *   Set `path`.
 * @property {string | null | undefined} [basename]
 *   Set `basename`.
 * @property {string | null | undefined} [stem]
 *   Set `stem`.
 * @property {string | null | undefined} [extname]
 *   Set `extname`.
 * @property {string | null | undefined} [dirname]
 *   Set `dirname`.
 * @property {Data | null | undefined} [data]
 *   Set `data`.
 *
 * @typedef Map
 *   Raw source map.
 *
 *   See:
 *   <https://github.com/mozilla/source-map/blob/58819f0/source-map.d.ts#L15-L23>.
 * @property {number} version
 *   Which version of the source map spec this map is following.
 * @property {Array<string>} sources
 *   An array of URLs to the original source files.
 * @property {Array<string>} names
 *   An array of identifiers which can be referenced by individual mappings.
 * @property {string | undefined} [sourceRoot]
 *   The URL root from which all sources are relative.
 * @property {Array<string> | undefined} [sourcesContent]
 *   An array of contents of the original source files.
 * @property {string} mappings
 *   A string of base64 VLQs which contain the actual mappings.
 * @property {string} file
 *   The generated file this source map is associated with.
 *
 * @typedef {{[key: string]: unknown} & VFileCoreOptions} Options
 *   Configuration.
 *
 *   A bunch of keys that will be shallow copied over to the new file.
 *
 * @typedef {Record<string, unknown>} ReporterSettings
 *   Configuration for reporters.
 */

/**
 * @typedef {Record<string, unknown>} Props
 * @typedef {null | undefined | string | Props | TestFunctionAnything | Array<string | Props | TestFunctionAnything>} Test
 *   Check for an arbitrary node, unaware of TypeScript inferral.
 *
 * @callback TestFunctionAnything
 *   Check if a node passes a test, unaware of TypeScript inferral.
 * @param {unknown} this
 *   The given context.
 * @param {Node} node
 *   A node.
 * @param {number | null | undefined} [index]
 *   The node’s position in its parent.
 * @param {Parent | null | undefined} [parent]
 *   The node’s parent.
 * @returns {boolean | void}
 *   Whether this node passes the test.
 */

/**
 * @typedef {Record<string, unknown>} StackState
 * @typedef {[Construct, StackState]} StackItem
 */

/**
 * @typedef {Root | Content} Node
 *
 * @callback GetDefinition
 *   Get a definition by identifier.
 * @param {string | null | undefined} [identifier]
 *   Identifier of definition.
 * @returns {Definition | null}
 *   Definition corresponding to `identifier` or `null`.
 */

/**
 * @typedef {Root | Content} Node
 * @typedef {Extract<Node, UnistParent>} Parent
 *
 * @typedef {Omit<UnistParent, 'type' | 'children'> & {type: 'fragment', children: Array<PhrasingContent>}} Fragment
 */

/**
 * @typedef {Root | Content} Nodes
 * @typedef {Extract<Nodes, Parent>} Parents
 */

/**
 * @typedef {Root | Content} Nodes
 * @typedef {Extract<Nodes, Reference>} References
 */

/**
 * @typedef {boolean | 'skip'} Action
 *   Union of the action types.
 *
 * @typedef {number} Index
 *   Move to the sibling at `index` next (after node itself is completely
 *   traversed).
 *
 *   Useful if mutating the tree, such as removing the node the visitor is
 *   currently on, or any of its previous siblings.
 *   Results less than 0 or greater than or equal to `children.length` stop
 *   traversing the parent.
 *
 * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple
 *   List with one or two values, the first an action, the second an index.
 *
 * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult
 *   Any value that can be returned from a visitor.
 */

/**
 * @typedef {import('../types.js').AssociationId} AssociationId
 */

/**
 * @typedef {import('../types.js').CreateTracker} CreateTracker
 * @typedef {import('../types.js').TrackCurrent} TrackCurrent
 * @typedef {import('../types.js').TrackMove} TrackMove
 * @typedef {import('../types.js').TrackShift} TrackShift
 */

/**
 * @typedef {import('../types.js').FlowContent} FlowContent
 * @typedef {import('../types.js').Node} Node
 * @typedef {import('../types.js').Parent} Parent
 * @typedef {import('../types.js').State} State
 * @typedef {import('../types.js').TrackFields} TrackFields
 */

/**
 * @typedef {import('../types.js').Handle} Handle
 * @typedef {import('../types.js').Info} Info
 * @typedef {import('../types.js').Parent} Parent
 * @typedef {import('../types.js').PhrasingContent} PhrasingContent
 * @typedef {import('../types.js').State} State
 */

/**
 * @typedef {import('../types.js').IndentLines} IndentLines
 */

/**
 * @typedef {import('../types.js').State} State
 * @typedef {import('../types.js').Options} Options
 */

/**
 * @typedef {import('../types.js').State} State
 * @typedef {import('../types.js').SafeConfig} SafeConfig
 */

/**
 * @typedef {import('../types.js').Unsafe} Unsafe
 * @typedef {import('../types.js').ConstructName} ConstructName
 */

/**
 * @typedef {import('../types.js').Unsafe} Unsafe
 */

/**
 * @typedef {import('./core.js').HChild} Child
 *   Acceptable child value.
 * @typedef {import('./core.js').HProperties} Properties
 *   Acceptable value for element properties.
 * @typedef {import('./core.js').HResult} Result
 *   Result from a `h` (or `s`) call.
 *
 * @typedef {import('./jsx-classic.js').Element} h.JSX.Element
 * @typedef {import('./jsx-classic.js').IntrinsicAttributes} h.JSX.IntrinsicAttributes
 * @typedef {import('./jsx-classic.js').IntrinsicElements} h.JSX.IntrinsicElements
 * @typedef {import('./jsx-classic.js').ElementChildrenAttribute} h.JSX.ElementChildrenAttribute
 */

/**
 * @typedef {import('./core.js').HChild} Child
 *   Acceptable child value.
 * @typedef {import('./core.js').HProperties} Properties
 *   Acceptable value for element properties.
 * @typedef {import('./core.js').HResult} Result
 *   Result from a `h` (or `s`) call.
 *
 * @typedef {import('./jsx-classic.js').Element} s.JSX.Element
 * @typedef {import('./jsx-classic.js').IntrinsicAttributes} s.JSX.IntrinsicAttributes
 * @typedef {import('./jsx-classic.js').IntrinsicElements} s.JSX.IntrinsicElements
 * @typedef {import('./jsx-classic.js').ElementChildrenAttribute} s.JSX.ElementChildrenAttribute
 */

/**
 * @typedef {import('./info.js').Info} Info
 * @typedef {Record<string, Info>} Properties
 * @typedef {Record<string, string>} Normal
 */

/**
 * @typedef {import('./schema.js').Properties} Properties
 * @typedef {import('./schema.js').Normal} Normal
 *
 * @typedef {Record<string, string>} Attributes
 *
 * @typedef {Object} Definition
 * @property {Record<string, number|null>} properties
 * @property {(attributes: Attributes, property: string) => string} transform
 * @property {string} [space]
 * @property {Attributes} [attributes]
 * @property {Array<string>} [mustUseProperty]
 */

/**
 * @typedef {import('./schema.js').Properties} Properties
 * @typedef {import('./schema.js').Normal} Normal
 */

/**
 * @typedef {import('./util/schema.js').Schema} Schema
 */

/**
 * @typedef {import('hast').Content} HastContent
 * @typedef {import('hast').Element} HastElement
 * @typedef {import('hast').ElementContent} HastElementContent
 * @typedef {import('hast').Properties} HastProperties
 * @typedef {import('hast').Root} HastRoot
 * @typedef {import('hast').Text} HastText
 *
 * @typedef {import('mdast').Content} MdastContent
 * @typedef {import('mdast').Definition} MdastDefinition
 * @typedef {import('mdast').FootnoteDefinition} MdastFootnoteDefinition
 * @typedef {import('mdast').Parent} MdastParent
 * @typedef {import('mdast').Root} MdastRoot
 */

/**
 * @typedef {import('hast').Content} HastContent
 * @typedef {import('hast').Root} HastRoot
 *
 * @typedef {import('mdast').Content} MdastContent
 * @typedef {import('mdast').Root} MdastRoot
 *
 * @typedef {import('./state.js').Options} Options
 */

/**
 * @typedef {import('hast').ElementContent} ElementContent
 *
 * @typedef {import('mdast').Content} Content
 * @typedef {import('mdast').Reference} Reference
 * @typedef {import('mdast').Root} Root
 *
 * @typedef {import('./state.js').State} State
 */

/**
 * @typedef {import('hast').ElementContent} ElementContent
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').Properties} Properties
 * @typedef {import('mdast').ImageReference} ImageReference
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').ElementContent} ElementContent
 *
 * @typedef {import('./state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').ElementContent} ElementContent
 * @typedef {import('hast').Properties} Properties
 * @typedef {import('mdast').Content} Content
 * @typedef {import('mdast').ListItem} ListItem
 * @typedef {import('mdast').Parent} Parent
 * @typedef {import('mdast').Root} Root
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').ElementContent} ElementContent
 * @typedef {import('hast').Properties} Properties
 * @typedef {import('mdast').LinkReference} LinkReference
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').Properties} Properties
 * @typedef {import('mdast').Code} Code
 * @typedef {import('../state.js').State} State

 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').Properties} Properties
 * @typedef {import('mdast').Image} Image
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').Properties} Properties
 * @typedef {import('mdast').Link} Link
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').Properties} Properties
 * @typedef {import('mdast').List} List
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').Text} Text
 * @typedef {import('mdast').Break} Break
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').Text} Text
 * @typedef {import('mdast').InlineCode} InlineCode
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('mdast').Blockquote} Blockquote
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('mdast').Delete} Delete
 * @typedef {import('../state.js').State} State

 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('mdast').Emphasis} Emphasis
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('mdast').Footnote} Footnote
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('mdast').HTML} Html
 * @typedef {import('../state.js').State} State
 * @typedef {import('../../index.js').Raw} Raw
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('mdast').Heading} Heading
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('mdast').Paragraph} Paragraph
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('mdast').Strong} Strong
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('mdast').TableCell} TableCell
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('mdast').Table} Table
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} Element
 * @typedef {import('mdast').ThematicBreak} ThematicBreak
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Element} HastElement
 * @typedef {import('hast').Text} HastText
 * @typedef {import('mdast').Text} MdastText
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Properties} Properties
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').ElementContent} ElementContent
 * @typedef {import('mdast').Content} Content
 * @typedef {import('mdast').Parent} Parent
 * @typedef {import('mdast').Root} Root
 * @typedef {import('mdast').TableRow} TableRow
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Properties} Properties
 * @typedef {import('hast').Element} Element
 */

/**
 * @typedef {import('hast').Root} HastRoot
 * @typedef {import('hast').Element} HastElement
 * @typedef {import('mdast').Root} MdastRoot
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('hast').Root} HastRoot
 * @typedef {import('mdast').Root} MdastRoot
 * @typedef {import('mdast-util-to-hast').Options} Options
 * @typedef {import('unified').Processor<any, any, any, any>} Processor
 *
 * @typedef {import('mdast-util-to-hast')} DoNotTouchAsThisImportIncludesRawInTree
 */

/**
 * @typedef {import('hast').Root} Root
 *
 * @typedef {import('hast-util-sanitize').Schema} Options
 *   The sanitation schema defines how and if nodes and properties should be cleaned.
 *   See `hast-util-sanitize`.
 *   The default schema is exported as `defaultSchema`.
 */

/**
 * @typedef {import('hast').Root} Root
 * @typedef {import('hast').Content} Content
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').Properties} Properties
 * @typedef {Content | Root} Node
 *
 * @typedef {Properties[string]} PropertyValue
 *   Possible property values.
 * @typedef {string | number | boolean} PrimitivePropertyValue
 *   Possible primitive HTML attribute values.
 *
 * @typedef {Record<string, Array<string | [string, ...Array<PrimitivePropertyValue | RegExp>]>>} Attributes
 *  Map of tag names to allow lists for each property.
 * @typedef {Record<string, Array<PrimitivePropertyValue | RegExp>>} AttributeClean
 *   Normalized input.
 *
 * @typedef Schema
 *   Sanitization configuration.
 * @property {Attributes | undefined} [attributes]
 *   Map of tag names to allowed properties.
 *
 *   The special `'*'` key defines property names allowed on all elements.
 * @property {Record<string, Record<string, PropertyValue>> | undefined} [required]
 *   Map of tag names to required property names and their default property value.
 * @property {Array<string> | undefined} [tagNames]
 *   List of allowed tag names.
 * @property {Record<string, Array<string>> | undefined} [protocols]
 *   Map of protocols to allow in property values.
 * @property {Record<string, Array<string>> | undefined} [ancestors]
 *   Map of tag names to their required ancestor elements.
 * @property {Array<string> | undefined} [clobber]
 *   List of allowed property names which can clobber.
 * @property {string | undefined} [clobberPrefix]
 *   Prefix to use before potentially clobbering property names.
 * @property {Array<string> | undefined} [strip]
 *   Names of elements to strip from the tree.
 * @property {boolean | undefined} [allowComments]
 *   Whether to allow comments.
 * @property {boolean | undefined} [allowDoctypes]
 *   Whether to allow doctypes.
 *
 * @typedef {(schema: Schema, value: any, node: any, stack: Array<string>) => unknown} Handler
 * @typedef {Record<string, Handler>} NodeDefinition
 * @typedef {((schema: Schema, node: Node) => NodeDefinition | undefined)} NodeDefinitionGetter
 * @typedef {Record<string, NodeDefinition | NodeDefinitionGetter>} NodeSchema
 */

/**
 * @typedef {import('hast').Root} Root
 * @typedef {import('hast').Content} Content
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').Properties} Properties
 * @typedef {import('property-information').Info} Info
 * @typedef {import('property-information').Schema} Schema
 */

/**
 * @typedef {import('hast').Root} Root
 * @typedef {import('hast-util-raw').Options} Options
 * @typedef {import('hast-util-raw')} DoNotTouchAsThisImportIncludesRawInTree
 */

/**
 * @typedef {import('mdast').Content} Content
 * @typedef {import('mdast').ListItem} ListItem
 * @typedef {import('mdast').Paragraph} Paragraph
 * @typedef {import('mdast').Parent} Parent
 * @typedef {import('mdast').Root} Root
 * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
 * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
 * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
 * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
 * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
 */

/**
 * @typedef {import('mdast').FootnoteReference} FootnoteReference
 * @typedef {import('hast').Element} Element
 * @typedef {import('../state.js').State} State
 */

/**
 * @typedef {import('mdast').FootnoteReference} FootnoteReference
 * @typedef {import('mdast').FootnoteDefinition} FootnoteDefinition
 * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
 * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
 * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
 * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
 * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
 * @typedef {import('mdast-util-to-markdown').Map} Map
 */

/**
 * @typedef {import('mdast').InlineCode} InlineCode
 * @typedef {import('../types.js').Parent} Parent
 * @typedef {import('../types.js').State} State
 */

/**
 * @typedef {import('mdast').Link} Link
 * @typedef {import('mdast').PhrasingContent} PhrasingContent
 *
 * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
 * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
 * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
 * @typedef {import('mdast-util-from-markdown').Transform} FromMarkdownTransform
 *
 * @typedef {import('mdast-util-to-markdown').ConstructName} ConstructName
 * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
 *
 * @typedef {import('mdast-util-find-and-replace').ReplaceFunction} ReplaceFunction
 * @typedef {import('mdast-util-find-and-replace').RegExpMatchObject} RegExpMatchObject
 */

/**
 * @typedef {import('mdast').ListItem} ListItem
 * @typedef {import('../types.js').Map} Map
 * @typedef {import('../types.js').Parent} Parent
 * @typedef {import('../types.js').State} State
 * @typedef {import('../types.js').Info} Info
 */

/**
 * @typedef {import('mdast').Parent} MdastParent
 * @typedef {import('mdast').Root} Root
 * @typedef {import('mdast').Content} Content
 * @typedef {import('mdast').PhrasingContent} PhrasingContent
 * @typedef {import('mdast').Text} Text
 * @typedef {import('unist-util-visit-parents').Test} Test
 * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult
 */

/**
 * @typedef {import('mdast').Root|import('mdast').Content} Node
 *
 * @typedef Options
 *   Configuration (optional).
 * @property {boolean | null | undefined} [includeImageAlt=true]
 *   Whether to use `alt` for `image`s.
 */

/**
 * @typedef {import('mdast').Root} Root
 * @typedef {import('mdast').Content} Content
 * @typedef {import('mdast').Definition} Definition
 */

/**
 * @typedef {import('mdast').Root} Root
 * @typedef {import('mdast-util-from-markdown').Options} Options
 */

/**
 * @typedef {import('mdast').Root} Root
 * @typedef {import('micromark-extension-gfm').Options & import('mdast-util-gfm').Options} Options
 */

/**
 * @typedef {import('mdast').Table} Table
 * @typedef {import('mdast').TableRow} TableRow
 * @typedef {import('mdast').TableCell} TableCell
 * @typedef {import('mdast').InlineCode} InlineCode
 *
 * @typedef {import('markdown-table').MarkdownTableOptions} MarkdownTableOptions
 *
 * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
 * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
 * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
 *
 * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
 * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
 * @typedef {import('mdast-util-to-markdown').Context} ToMarkdownContext
 * @typedef {import('mdast-util-to-markdown').SafeOptions} SafeOptions
 */

/**
 * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
 * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
 */

/**
 * @typedef {import('mdast-util-gfm-table').Options} Options
 *   Configuration.
 */

/**
 * @typedef {import('micromark-util-types').Code} Code
 * @typedef {import('micromark-util-types').Chunk} Chunk
 * @typedef {import('micromark-util-types').Point} Point
 * @typedef {import('micromark-util-types').Token} Token
 * @typedef {import('micromark-util-types').Effects} Effects
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
 * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord
 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
 * @typedef {import('micromark-util-types').ParseContext} ParseContext
 */

/**
 * @typedef {import('micromark-util-types').Code} Code
 */

/**
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').Resolver} Resolver
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').Event} Event
 * @typedef {import('micromark-util-types').Token} Token
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').Code} Code
 */

/**
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').Resolver} Resolver
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').Previous} Previous
 * @typedef {import('micromark-util-types').Token} Token
 * @typedef {import('micromark-util-types').State} State
 */

/**
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').Resolver} Resolver
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').Code} Code
 */

/**
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').Resolver} Resolver
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').Token} Token
 * @typedef {import('micromark-util-types').State} State
 */

/**
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
 * @typedef {import('micromark-util-types').Exiter} Exiter
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').Code} Code
 */

/**
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').Exiter} Exiter
 * @typedef {import('micromark-util-types').State} State
 */

/**
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').Resolver} Resolver
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').Token} Token
 * @typedef {import('micromark-util-types').Event} Event
 * @typedef {import('micromark-util-types').Code} Code
 * @typedef {import('micromark-util-types').Point} Point
 */

/**
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').Resolver} Resolver
 * @typedef {import('micromark-util-types').Token} Token
 * @typedef {import('micromark-util-types').State} State
 */

/**
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').Code} Code
 */

/**
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').State} State
 */

/**
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').Token} Token
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').Code} Code
 */

/**
 * @typedef {import('micromark-util-types').Effects} Effects
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').Code} Code
 */

/**
 * @typedef {import('micromark-util-types').Effects} Effects
 * @typedef {import('micromark-util-types').State} State
 */

/**
 * @typedef {import('micromark-util-types').Effects} Effects
 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
 * @typedef {import('micromark-util-types').State} State
 */

/**
 * @typedef {import('micromark-util-types').Encoding} Encoding
 * @typedef {import('micromark-util-types').Event} Event
 * @typedef {import('micromark-util-types').ParseOptions} ParseOptions
 * @typedef {import('micromark-util-types').Token} Token
 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
 * @typedef {import('micromark-util-types').Value} Value
 *
 * @typedef {import('unist').Parent} UnistParent
 * @typedef {import('unist').Point} Point
 *
 * @typedef {import('mdast').PhrasingContent} PhrasingContent
 * @typedef {import('mdast').StaticPhrasingContent} StaticPhrasingContent
 * @typedef {import('mdast').Content} Content
 * @typedef {import('mdast').Break} Break
 * @typedef {import('mdast').Blockquote} Blockquote
 * @typedef {import('mdast').Code} Code
 * @typedef {import('mdast').Definition} Definition
 * @typedef {import('mdast').Emphasis} Emphasis
 * @typedef {import('mdast').Heading} Heading
 * @typedef {import('mdast').HTML} HTML
 * @typedef {import('mdast').Image} Image
 * @typedef {import('mdast').ImageReference} ImageReference
 * @typedef {import('mdast').InlineCode} InlineCode
 * @typedef {import('mdast').Link} Link
 * @typedef {import('mdast').LinkReference} LinkReference
 * @typedef {import('mdast').List} List
 * @typedef {import('mdast').ListItem} ListItem
 * @typedef {import('mdast').Paragraph} Paragraph
 * @typedef {import('mdast').Root} Root
 * @typedef {import('mdast').Strong} Strong
 * @typedef {import('mdast').Text} Text
 * @typedef {import('mdast').ThematicBreak} ThematicBreak
 * @typedef {import('mdast').ReferenceType} ReferenceType
 * @typedef {import('../index.js').CompileData} CompileData
 */

/**
 * @typedef {import('micromark-util-types').Encoding} Encoding
 * @typedef {import('micromark-util-types').Value} Value
 * @typedef {import('micromark-util-types').Chunk} Chunk
 * @typedef {import('micromark-util-types').Code} Code
 */

/**
 * @typedef {import('micromark-util-types').Event} Event
 */

/**
 * @typedef {import('micromark-util-types').Extension} Extension
 * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').Previous} Previous
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').Event} Event
 * @typedef {import('micromark-util-types').Code} Code
 */

/**
 * @typedef {import('micromark-util-types').Extension} Extension
 * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
 * @typedef {import('micromark-extension-gfm-strikethrough').Options} Options
 * @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions
 */

/**
 * @typedef {import('micromark-util-types').Extension} Extension
 * @typedef {import('micromark-util-types').Resolver} Resolver
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').Token} Token
 * @typedef {import('micromark-util-types').Event} Event
 */

/**
 * @typedef {import('micromark-util-types').Extension} Extension
 * @typedef {import('micromark-util-types').Resolver} Resolver
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').Token} Token
 */

/**
 * @typedef {import('micromark-util-types').Extension} Extension
 * @typedef {import('micromark-util-types').Resolver} Resolver
 * @typedef {import('micromark-util-types').Token} Token
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').Exiter} Exiter
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').Event} Event
 */

/**
 * @typedef {import('micromark-util-types').Extension} Extension
 */

/**
 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
 * @typedef {import('micromark-util-types').FullNormalizedExtension} FullNormalizedExtension
 * @typedef {import('micromark-util-types').ParseOptions} ParseOptions
 * @typedef {import('micromark-util-types').ParseContext} ParseContext
 * @typedef {import('micromark-util-types').Create} Create
 */

/**
 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
 * @typedef {import('micromark-util-types').Initializer} Initializer
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 * @typedef {import('micromark-util-types').Token} Token
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').Point} Point
 */

/**
 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
 * @typedef {import('micromark-util-types').Initializer} Initializer
 * @typedef {import('micromark-util-types').State} State
 */

/**
 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
 * @typedef {import('micromark-util-types').Initializer} Initializer
 * @typedef {import('micromark-util-types').Token} Token
 * @typedef {import('micromark-util-types').State} State
 */

/**
 * @typedef {import('micromark-util-types').NormalizedExtension} NormalizedExtension
 * @typedef {import('micromark-util-types').Extension} Extension
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
 */

/**
 * @typedef {import('micromark-util-types').Resolver} Resolver
 * @typedef {import('micromark-util-types').Initializer} Initializer
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').Code} Code
 */

/**
 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
 * @typedef {import('micromark-util-types').Event} Event
 * @typedef {import('micromark-util-types').Resolver} Resolver
 */

/**
 * @typedef {import('micromark-util-types').Token} Token
 * @typedef {import('micromark-util-types').Chunk} Chunk
 * @typedef {import('micromark-util-types').Event} Event
 */

/**
 * @typedef {import('parse5').DefaultTreeAdapterMap} DefaultTreeAdapterMap
 * @typedef {DefaultTreeAdapterMap['document']} P5Document
 * @typedef {DefaultTreeAdapterMap['documentFragment']} P5Fragment
 * @typedef {DefaultTreeAdapterMap['element']} P5Element
 * @typedef {DefaultTreeAdapterMap['node']} P5Node
 * @typedef {DefaultTreeAdapterMap['documentType']} P5Doctype
 * @typedef {DefaultTreeAdapterMap['commentNode']} P5Comment
 * @typedef {DefaultTreeAdapterMap['textNode']} P5Text
 * @typedef {DefaultTreeAdapterMap['parentNode']} P5Parent
 * @typedef {import('parse5').Token.Attribute} P5Attribute
 * @typedef {Exclude<P5Node, P5Document | P5Fragment>} P5Child
 * @typedef {import('property-information').Schema} Schema
 * @typedef {import('hast').Root} Root
 * @typedef {import('hast').DocType} Doctype
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').Text} Text
 * @typedef {import('hast').Comment} Comment
 * @typedef {import('hast').Content} Content
 */

/**
 * @typedef {import('react').ReactNode} ReactNode
 * @typedef {import('react').ReactElement<{}>} ReactElement
 * @typedef {import('unified').PluggableList} PluggableList
 * @typedef {import('hast').Root} Root
 * @typedef {import('./rehype-filter.js').Options} FilterOptions
 * @typedef {import('./ast-to-react.js').Options} TransformOptions
 *
 * @typedef CoreOptions
 * @property {string} children
 *
 * @typedef PluginOptions
 * @property {PluggableList} [remarkPlugins=[]]
 * @property {PluggableList} [rehypePlugins=[]]
 * @property {import('remark-rehype').Options | undefined} [remarkRehypeOptions={}]
 *
 * @typedef LayoutOptions
 * @property {string} [className]
 *
 * @typedef {CoreOptions & PluginOptions & LayoutOptions & FilterOptions & TransformOptions} ReactMarkdownOptions
 *
 * @typedef Deprecation
 * @property {string} id
 * @property {string} [to]
 */

/**
 * @typedef {import('react').ReactNode} ReactNode
 * @typedef {import('unist').Position} Position
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').ElementContent} ElementContent
 * @typedef {import('hast').Root} Root
 * @typedef {import('hast').Text} Text
 * @typedef {import('hast').Comment} Comment
 * @typedef {import('hast').DocType} Doctype
 * @typedef {import('property-information').Info} Info
 * @typedef {import('property-information').Schema} Schema
 * @typedef {import('./complex-types.js').ReactMarkdownProps} ReactMarkdownProps
 *
 * @typedef Raw
 * @property {'raw'} type
 * @property {string} value
 *
 * @typedef Context
 * @property {Options} options
 * @property {Schema} schema
 * @property {number} listDepth
 *
 * @callback TransformLink
 * @param {string} href
 * @param {Array<ElementContent>} children
 * @param {string?} title
 * @returns {string}
 *
 * @callback TransformImage
 * @param {string} src
 * @param {string} alt
 * @param {string?} title
 * @returns {string}
 *
 * @typedef {import('react').HTMLAttributeAnchorTarget} TransformLinkTargetType
 *
 * @callback TransformLinkTarget
 * @param {string} href
 * @param {Array<ElementContent>} children
 * @param {string?} title
 * @returns {TransformLinkTargetType|undefined}
 *
 * @typedef {keyof JSX.IntrinsicElements} ReactMarkdownNames
 *
 * To do: is `data-sourcepos` typeable?
 *
 * @typedef {ComponentPropsWithoutRef<'code'> & ReactMarkdownProps & {inline?: boolean}} CodeProps
 * @typedef {ComponentPropsWithoutRef<'h1'> & ReactMarkdownProps & {level: number}} HeadingProps
 * @typedef {ComponentPropsWithoutRef<'li'> & ReactMarkdownProps & {checked: boolean|null, index: number, ordered: boolean}} LiProps
 * @typedef {ComponentPropsWithoutRef<'ol'> & ReactMarkdownProps & {depth: number, ordered: true}} OrderedListProps
 * @typedef {ComponentPropsWithoutRef<'td'> & ReactMarkdownProps & {style?: Record<string, unknown>, isHeader: false}} TableDataCellProps
 * @typedef {ComponentPropsWithoutRef<'th'> & ReactMarkdownProps & {style?: Record<string, unknown>, isHeader: true}} TableHeaderCellProps
 * @typedef {ComponentPropsWithoutRef<'tr'> & ReactMarkdownProps & {isHeader: boolean}} TableRowProps
 * @typedef {ComponentPropsWithoutRef<'ul'> & ReactMarkdownProps & {depth: number, ordered: false}} UnorderedListProps
 *
 * @typedef {ComponentType<CodeProps>} CodeComponent
 * @typedef {ComponentType<HeadingProps>} HeadingComponent
 * @typedef {ComponentType<LiProps>} LiComponent
 * @typedef {ComponentType<OrderedListProps>} OrderedListComponent
 * @typedef {ComponentType<TableDataCellProps>} TableDataCellComponent
 * @typedef {ComponentType<TableHeaderCellProps>} TableHeaderCellComponent
 * @typedef {ComponentType<TableRowProps>} TableRowComponent
 * @typedef {ComponentType<UnorderedListProps>} UnorderedListComponent
 *
 * @typedef SpecialComponents
 * @property {CodeComponent|ReactMarkdownNames} code
 * @property {HeadingComponent|ReactMarkdownNames} h1
 * @property {HeadingComponent|ReactMarkdownNames} h2
 * @property {HeadingComponent|ReactMarkdownNames} h3
 * @property {HeadingComponent|ReactMarkdownNames} h4
 * @property {HeadingComponent|ReactMarkdownNames} h5
 * @property {HeadingComponent|ReactMarkdownNames} h6
 * @property {LiComponent|ReactMarkdownNames} li
 * @property {OrderedListComponent|ReactMarkdownNames} ol
 * @property {TableDataCellComponent|ReactMarkdownNames} td
 * @property {TableHeaderCellComponent|ReactMarkdownNames} th
 * @property {TableRowComponent|ReactMarkdownNames} tr
 * @property {UnorderedListComponent|ReactMarkdownNames} ul
 *
 * @typedef {Partial<Omit<import('./complex-types.js').NormalComponents, keyof SpecialComponents> & SpecialComponents>} Components
 *
 * @typedef Options
 * @property {boolean} [sourcePos=false]
 * @property {boolean} [rawSourcePos=false]
 * @property {boolean} [skipHtml=false]
 * @property {boolean} [includeElementIndex=false]
 * @property {null|false|TransformLink} [transformLinkUri]
 * @property {TransformImage} [transformImageUri]
 * @property {TransformLinkTargetType|TransformLinkTarget} [linkTarget]
 * @property {Components} [components]
 */

/**
 * @typedef {import('unist').Node} Node
 * @typedef {import('hast').Root} Root
 * @typedef {import('hast').Element} Element
 *
 * @callback AllowElement
 * @param {Element} element
 * @param {number} index
 * @param {Element|Root} parent
 * @returns {boolean|undefined}
 *
 * @typedef Options
 * @property {Array<string>} [allowedElements]
 * @property {Array<string>} [disallowedElements=[]]
 * @property {AllowElement} [allowElement]
 * @property {boolean} [unwrapDisallowed=false]
 */

/**
 * @typedef {import('unist').Node} Node
 * @typedef {import('unist').Parent} Parent
 * @typedef {import('unist-util-is').Test} Test
 * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult
 */

/**
 * @typedef {import('unist').Node} Node
 * @typedef {import('unist').Parent} Parent
 * @typedef {import('unist-util-is').Test} Test
 */

/**
 * @typedef {import('unist').Node} Node
 * @typedef {import('unist').Parent} Parent
 */

/**
 * @typedef {import('unist').Node} Node
 * @typedef {import('unist').Point} Point
 * @typedef {import('unist').Position} Position
 */

/**
 * @typedef {import('unist').Node} Node
 * @typedef {import('unist').Position} Position
 * @typedef {import('unist').Point} Point
 * @typedef {import('./minurl.shared.js').URL} URL
 * @typedef {import('../index.js').Data} Data
 * @typedef {import('../index.js').Value} Value
 */

/**
 * @typedef {import('unist').Node} Node
 * @typedef {import('unist').Position} Position
 * @typedef {import('unist').Point} Point
 * @typedef {object & {type: string, position?: Position | undefined}} NodeLike
 */

/**
 * @typedef {import('unist').Node} Node
 * @typedef {import('vfile').VFileCompatible} VFileCompatible
 * @typedef {import('vfile').VFileValue} VFileValue
 * @typedef {import('..').Processor} Processor
 * @typedef {import('..').Plugin} Plugin
 * @typedef {import('..').Preset} Preset
 * @typedef {import('..').Pluggable} Pluggable
 * @typedef {import('..').PluggableList} PluggableList
 * @typedef {import('..').Transformer} Transformer
 * @typedef {import('..').Parser} Parser
 * @typedef {import('..').Compiler} Compiler
 * @typedef {import('..').RunCallback} RunCallback
 * @typedef {import('..').ProcessCallback} ProcessCallback
 *
 * @typedef Context
 * @property {Node} tree
 * @property {VFile} file
 */

/**
 * @typedef {import('unist').Position} Position
 * @typedef {import('unist').Node} Node
 * @typedef {import('unist').Point} Point
 */

/**
 * @typedef {import('vfile').VFile} VFile
 * @typedef {import('parse5').Document} P5Document
 * @typedef {import('parse5').DocumentFragment} P5Fragment
 * @typedef {Omit<import('parse5').Element, 'parentNode'>} P5Element
 * @typedef {import('parse5').Attribute} P5Attribute
 * @typedef {Omit<import('parse5').Location, 'startOffset' | 'endOffset'> & {startOffset: number|undefined, endOffset: number|undefined}} P5Location
 * @typedef {import('parse5').ParserOptions} P5ParserOptions
 * @typedef {import('hast').Root} Root
 * @typedef {import('hast').DocType} Doctype
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').Text} Text
 * @typedef {import('hast').Comment} Comment
 * @typedef {import('hast').Content} Content
 * @typedef {Root|Content} Node
 * @typedef {import('../complex-types').Raw} Raw
 *
 * @typedef {Omit<Comment, 'value'> & {value: {stitch: Node}}} Stitch
 *
 * @typedef Options
 * @property {Array<string>} [passThrough]
 *   List of custom hast node types to pass through (keep) in hast.
 *   If the passed through nodes have children, those children are expected to
 *   be hast and will be handled.
 *
 * @typedef HiddenTokenizer
 * @property {Array<HiddenLocationTracker>} __mixins
 *   Way too simple, but works for us.
 * @property {HiddenPreprocessor} preprocessor
 * @property {(value: string) => void} write
 * @property {() => number} _consume
 * @property {Array<HiddenToken>} tokenQueue
 * @property {string} state
 * @property {string} returnState
 * @property {number} charRefCode
 * @property {Array<number>} tempBuff
 * @property {Function} _flushCodePointsConsumedAsCharacterReference
 * @property {string} lastStartTagName
 * @property {number} consumedAfterSnapshot
 * @property {boolean} active
 * @property {HiddenToken|undefined} currentCharacterToken
 * @property {HiddenToken|undefined} currentToken
 * @property {unknown} currentAttr
 * @property {Function} NAMED_CHARACTER_REFERENCE_STATE
 * @property {Function} NUMERIC_CHARACTER_REFERENCE_END_STATE
 *
 * @typedef {Record<string, unknown> & {location: P5Location}} HiddenToken
 *
 * @typedef HiddenPreprocessor
 * @property {string|undefined} html
 * @property {number} pos
 * @property {number} lastGapPos
 * @property {number} lastCharPos
 * @property {Array<number>} gapStack
 * @property {boolean} skipNextNewLine
 * @property {boolean} lastChunkWritten
 * @property {boolean} endOfChunkHit
 *
 * @typedef HiddenLocationTracker
 * @property {P5Location|undefined} currentAttrLocation
 * @property {P5Location} ctLoc
 * @property {HiddenPosTracker} posTracker
 *
 * @typedef HiddenPosTracker
 * @property {boolean} isEol
 * @property {number} lineStartPos
 * @property {number} droppedBufferSize
 * @property {number} offset
 * @property {number} col
 * @property {number} line
 */

/**
 * @typedef {import('vfile').VFile} VFile
 * @typedef {import('property-information').Schema} Schema
 * @typedef {import('unist').Position} Position
 * @typedef {import('unist').Point} Point
 * @typedef {import('hast').Element} Element
 * @typedef {import('hast').Root} Root
 * @typedef {import('hast').Content} Content
 * @typedef {import('parse5').DefaultTreeAdapterMap} DefaultTreeAdapterMap
 * @typedef {import('parse5').Token.ElementLocation} P5ElementLocation
 * @typedef {import('parse5').Token.Location} P5Location
 */

/**
 * @typedef {import('vfile').VFile} VFile
 * @typedef {import('vfile').Value} Value
 */

/**
 * A rather ugly set of instructions which again looks at chunks in the input
 * stream.
 * The reason to do this here is that it is *much* faster to parse in reverse.
 * And that we can’t hook into `null` to split the line suffix before an EOF.
 * To do: figure out if we can make this into a clean utility, or even in core.
 * As it will be useful for GFMs literal autolink extension (and maybe even
 * tables?)
 *
 * @type {Resolver}
 */

/**
 * Add a listener for a given event.
 *
 * @param {(String|Symbol)} event The event name.
 * @param {Function} fn The listener function.
 * @param {*} [context=this] The context to invoke the listener with.
 * @returns {EventEmitter} `this`.
 * @public
 */

/**
 * Add a listener for a given event.
 *
 * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
 * @param {(String|Symbol)} event The event name.
 * @param {Function} fn The listener function.
 * @param {*} context The context to invoke the listener with.
 * @param {Boolean} once Specify if the listener is a one-time listener.
 * @returns {EventEmitter}
 * @private
 */

/**
 * Add a one-time listener for a given event.
 *
 * @param {(String|Symbol)} event The event name.
 * @param {Function} fn The listener function.
 * @param {*} [context=this] The context to invoke the listener with.
 * @returns {EventEmitter} `this`.
 * @public
 */

/**
 * Add position info from `from` to `to`.
 *
 * @param {Node} from
 *   hast node.
 * @param {P5Node} to
 *   `parse5` node.
 * @returns {void}
 *   Nothing.
 */

/**
 * Allow `value`.
 *
 * @type {Handler}
 * @param {unknown} value
 */

/**
 * Always return a valid HTML5 doctype.
 *
 * @type {Handler}
 * @returns {string}
 */

/**
 * Append `items` (an array) at the end of `list` (another array).
 * When `list` was empty, returns `items` instead.
 *
 * This prevents a potentially expensive operation when `list` is empty,
 * and adds items in batches to prevent V8 from hanging.
 *
 * @template {unknown} T
 * @param {T[]} list
 * @param {T[]} items
 * @returns {T[]}
 */

/**
 * Assert `node` is a unist node.
 *
 * @param {unknown} node
 * @returns {asserts node is Node}
 */

/**
 * Assert `path` exists.
 *
 * @param {string | undefined} path
 *   Path.
 * @param {string} name
 *   Dependency name.
 * @returns {asserts path is string}
 *   Nothing.
 */

/**
 * Assert `value` is a buffer.
 *
 * @param {unknown} value
 *   thing.
 * @returns {value is Buffer}
 *   Whether `value` is a Node.js buffer.
 */

/**
 * Assert a compiler is available.
 *
 * @param {string} name
 * @param {unknown} value
 * @returns {asserts value is Compiler}
 */

/**
 * Assert a parser is available.
 *
 * @param {string} name
 * @param {unknown} value
 * @returns {asserts value is Parser}
 */

/**
 * Assert that `complete` is `true`.
 *
 * @param {string} name
 * @param {string} asyncName
 * @param {unknown} complete
 * @returns {asserts complete is true}
 */

/**
 * Assert that `part` is not a path (as in, does not contain `path.sep`).
 *
 * @param {string | null | undefined} part
 *   File path part.
 * @param {string} name
 *   Part name.
 * @returns {void}
 *   Nothing.
 */

/**
 * Assert that `part` is not empty.
 *
 * @param {string | undefined} part
 *   Thing.
 * @param {string} name
 *   Part name.
 * @returns {asserts part is string}
 *   Nothing.
 */

/**
 * Assert the processor is not frozen.
 *
 * @param {string} name
 * @param {unknown} frozen
 * @returns {asserts frozen is false}
 */

/**
 * Block Lexer
 */

/**
 * Block-Level Grammar
 */

/**
 * Bridge-mode.
 * Runs the destination with the new hast tree.
 *
 * @type {import('unified').Plugin<[Processor, Options?], MdastRoot>}
 */

/**
 * Build a typed `Visitor` function from a list of descendants and a test.
 *
 * It will infer which values are passed as `node` and which as `parent`.
 *
 * @template {Node} Descendant
 *   Node type.
 * @template {Test} Check
 *   Test type.
 * @typedef {(
 *   BuildVisitorFromMatch<
 *     import('unist-util-visit-parents/complex-types.js').Matches<Descendant, Check>,
 *     Extract<Descendant, Parent>
 *   >
 * )} BuildVisitorFromDescendants
 */

/**
 * Build a typed `Visitor` function from a node and all possible parents.
 *
 * It will infer which values are passed as `node` and which as `parent`.
 *
 * @template {Node} Visited
 *   Node type.
 * @template {Parent} Ancestor
 *   Parent type.
 * @typedef {Visitor<Visited, ParentsOf<Ancestor, Visited>>} BuildVisitorFromMatch
 */

/**
 * Build a typed `Visitor` function from a tree and a test.
 *
 * It will infer which values are passed as `node` and which as `parent`.
 *
 * @template {Node} [Tree=Node]
 *   Node type.
 * @template {Test} [Check=string]
 *   Test type.
 * @typedef {(
 *   BuildVisitorFromDescendants<
 *     import('unist-util-visit-parents/complex-types.js').InclusiveDescendant<Tree>,
 *     Check
 *   >
 * )} BuildVisitor
 */

/**
 * Call all `resolveAll`s.
 *
 * @param {{resolveAll?: Resolver}[]} constructs
 * @param {Event[]} events
 * @param {TokenizeContext} context
 * @returns {Event[]}
 */

/**
 * Calls each of the listeners registered for a given event.
 *
 * @param {(String|Symbol)} event The event name.
 * @returns {Boolean} `true` if the event had listeners, else `false`.
 * @public
 */

/**
 * Check if `Child` can be a child of `Ancestor`.
 *
 * Returns the ancestor when `Child` can be a child of `Ancestor`, or returns
 * `never`.
 *
 * @template {Node} Ancestor
 *   Node type.
 * @template {Node} Child
 *   Node type.
 * @typedef {(
 *   Ancestor extends Parent
 *     ? Child extends Ancestor['children'][number]
 *       ? Ancestor
 *       : never
 *     : never
 * )} ParentsOf
 */

/**
 * Check if `fileUrlOrPath` looks like a URL.
 *
 * @param {unknown} fileUrlOrPath
 *   File path or URL.
 * @returns {fileUrlOrPath is URL}
 *   Whether it’s a URL.
 */

/**
 * Check if `node` is a `Node` and whether it passes the given test.
 *
 * @param node
 *   Thing to check, typically `Node`.
 * @param test
 *   A check for a specific node.
 * @param index
 *   The node’s position in its parent.
 * @param parent
 *   The node’s parent.
 * @returns
 *   Whether `node` is a node and passes a test.
 */

/**
 * Check if `node` is generated.
 *
 * @param {NodeLike | null | undefined} [node]
 *   Node to check.
 * @returns {boolean}
 *   Whether `node` is generated (does not have positional info).
 */

/**
 * Check if `prop` is a data property.
 *
 * @param {string} prop
 * @returns {boolean}
 */

/**
 * Check if `value` is a constructor.
 *
 * @param {unknown} value
 * @param {string} name
 * @returns {boolean}
 */

/**
 * Check if `value` is an object with keys.
 *
 * @param {Record<string, unknown>} value
 * @returns {boolean}
 */

/**
 * Check if `value` looks like a node.
 *
 * @param {unknown} value
 *   Thing.
 * @returns {value is Node}
 *   Whether `value` is a node.
 */

/**
 * Check if a node is a node and passes a certain node test.
 *
 * @template {Node} Kind
 *   Node type.
 * @callback AssertPredicate
 *   Check that an arbitrary value is a specific node, aware of TypeScript.
 * @param {unknown} [node]
 *   Anything (typically a node).
 * @param {number | null | undefined} [index]
 *   The node’s position in its parent.
 * @param {Parent | null | undefined} [parent]
 *   The node’s parent.
 * @returns {node is Kind}
 *   Whether this is a node and passes a test.
 */

/**
 * Check if a node passes a certain test.
 *
 * @template {Node} Kind
 *   Node type.
 * @callback TestFunctionPredicate
 *   Complex test function for a node that can be inferred by TypeScript.
 * @param {Node} node
 *   A node.
 * @param {number | null | undefined} [index]
 *   The node’s position in its parent.
 * @param {Parent | null | undefined} [parent]
 *   The node’s parent.
 * @returns {node is Kind}
 *   Whether this node passes the test.
 */

/**
 * Check if something is a file.
 *
 * @param {VFile | Options} value
 *   File or options.
 * @returns {value is VFile}
 *   Whether `value` is a file.
 */

/**
 * Check if the given value is *inter-element whitespace*.
 *
 * @param {unknown} thing
 *   Thing to check (typically `Node` or `string`).
 * @returns {boolean}
 *   Whether the `value` is inter-element whitespace (`boolean`): consisting of
 *   zero or more of space, tab (`\t`), line feed (`\n`), carriage return
 *   (`\r`), or form feed (`\f`).
 *   If a node is passed it must be a `Text` node, whose `value` field is
 *   checked.
 */

/**
 * Check whether `value` is a safe URL.
 *
 * @param {Schema} schema
 * @param {unknown} value
 * @param {string} prop
 * @returns {boolean}
 */

/**
 * Check whether a character code is a markdown line ending (see
 * `markdownLineEnding`) or markdown space (see `markdownSpace`).
 *
 * @param {Code} code
 * @returns {code is number}
 */

/**
 * Check whether a character code is a markdown line ending.
 *
 * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
 * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
 *
 * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
 * RETURN (CR) are replaced by these virtual characters depending on whether
 * they occurred together.
 *
 * @param {Code} code
 * @returns {code is number}
 */

/**
 * Check whether a character code is a markdown space.
 *
 * A **markdown space** is the concrete character U+0020 SPACE (SP) and the
 * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
 *
 * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
 * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
 * SPACE (VS) characters, depending on the column at which the tab occurred.
 *
 * @param {Code} code
 * @returns {code is number}
 */

/**
 * Check whether a character code is an ASCII control character.
 *
 * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
 * to U+001F (US), or U+007F (DEL).
 *
 * @param {Code} code
 * @returns {code is number}
 */

/**
 * Check whether the character code represents ASCII punctuation.
 *
 * An **ASCII punctuation** is a character in the inclusive ranges U+0021
 * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
 * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
 * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
 */

/**
 * Check whether the character code represents Unicode punctuation.
 *
 * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
 * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
 * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
 * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
 * punctuation (see `asciiPunctuation`).
 *
 * See:
 * **\[UNICODE]**:
 * [The Unicode Standard](https://www.unicode.org/versions/).
 * Unicode Consortium.
 */

/**
 * Check whether the character code represents Unicode whitespace.
 *
 * Note that this does handle micromark specific markdown whitespace characters.
 * See `markdownLineEndingOrSpace` to check that.
 *
 * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
 * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
 * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
 *
 * See:
 * **\[UNICODE]**:
 * [The Unicode Standard](https://www.unicode.org/versions/).
 * Unicode Consortium.
 */

/**
 * Check whether the character code represents an ASCII alpha (`a` through `z`,
 * case insensitive).
 *
 * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
 *
 * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
 * to U+005A (`Z`).
 *
 * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
 * to U+007A (`z`).
 */

/**
 * Check whether the character code represents an ASCII alphanumeric (`a`
 * through `z`, case insensitive, or `0` through `9`).
 *
 * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
 * (see `asciiAlpha`).
 */

/**
 * Check whether the character code represents an ASCII atext.
 *
 * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
 * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
 * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
 * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
 * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
 * (`{`) to U+007E TILDE (`~`).
 *
 * See:
 * **\[RFC5322]**:
 * [Internet Message Format](https://tools.ietf.org/html/rfc5322).
 * P. Resnick.
 * IETF.
 */

/**
 * Check whether the character code represents an ASCII digit (`0` through `9`).
 *
 * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
 * U+0039 (`9`).
 */

/**
 * Check whether the character code represents an ASCII hex digit (`a` through
 * `f`, case insensitive, or `0` through `9`).
 *
 * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
 * digit, or an ASCII lower hex digit.
 *
 * An **ASCII upper hex digit** is a character in the inclusive range U+0041
 * (`A`) to U+0046 (`F`).
 *
 * An **ASCII lower hex digit** is a character in the inclusive range U+0061
 * (`a`) to U+0066 (`f`).
 */

/**
 * Classify whether a character code represents whitespace, punctuation, or
 * something else.
 *
 * Used for attention (emphasis, strong), whose sequences can open or close
 * based on the class of surrounding characters.
 *
 * Note that eof (`null`) is seen as whitespace.
 *
 * @param {Code} code
 * @returns {number|undefined}
 */

/**
 * Clear event by name.
 *
 * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
 * @param {(String|Symbol)} evt The Event name.
 * @private
 */

/**
 * Combine several HTML extensions into one.
 *
 * @param {HtmlExtension[]} htmlExtensions List of HTML extensions.
 * @returns {HtmlExtension} A single combined extension.
 */

/**
 * Combine several syntax extensions into one.
 *
 * @param {Extension[]} extensions List of syntax extensions.
 * @returns {NormalizedExtension} A single combined extension.
 */

/**
 * Constructor to create a storage for our `EE` objects.
 * An `Events` instance is a plain object whose properties are event names.
 *
 * @constructor
 * @private
 */

/**
 * Content is transparent: it’s parsed right now. That way, definitions are also
 * parsed right now: before text in paragraphs (specifically, media) are parsed.
 *
 * @type {Resolver}
 */

/**
 * Continue traversing as normal.
 */

/**
 * Copy a node’s positional info.
 *
 * @param {MdastNodes} from
 *   mdast node to copy from.
 * @param {HastNodes} to
 *   hast node to copy into.
 * @returns {void}
 *   Nothing.
 */

/**
 * Copy a point-like value.
 *
 * @param {Point} d
 *   Point-like value.
 * @returns {Point}
 *   unist point.
 */

/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Count how often a character (or substring) is used in a string.
 *
 * @param {string} value
 *   Value to search in.
 * @param {string} character
 *   Character (or substring) to look for.
 * @return {number}
 *   Number of times `character` occurred in `value`.
 */

/**
 * Create `state` from an mdast tree.
 *
 * @param {MdastNodes} tree
 *   mdast node to transform.
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {State}
 *   `state` function.
 */

/**
 * Create a code check from a regex.
 *
 * @param {RegExp} regex
 * @returns {(code: Code) => code is number}
 */

/**
 * Create a hast element from a simple CSS selector.
 *
 * @template {string} Selector
 *   Type of selector.
 * @template {string} [DefaultTagName='div']
 *   Type of default tag name.
 * @param {Selector | null | undefined} [selector]
 *   Simple CSS selector.
 *
 *   Can contain a tag name (`foo`), classes (`.bar`), and an ID (`#baz`).
 *   Multiple classes are allowed.
 *   Uses the last ID if multiple IDs are found.
 * @param {DefaultTagName | null | undefined} [defaultTagName='div']
 *   Tag name to use if `selector` does not specify one (default: `'div'`).
 * @returns {Element & {tagName: import('./extract.js').ExtractTagName<Selector, DefaultTagName>}}
 *   Built element.
 */

/**
 * Create a map from a list of props or a list of properties and values.
 *
 * @param {Attributes[string]} values
 * @returns {AttributeClean}
 */

/**
 * Create a map to adjust casing.
 *
 * @param {Array<string>} values
 *   List of properly cased keys.
 * @returns {Record<string, string>}
 *   Map of lowercase keys to uppercase keys.
 */

/**
 * Create a tokenizer.
 * Tokenizers deal with one type of data (e.g., containers, flow, text).
 * The parser is the object dealing with it all.
 * `initialize` works like other constructs, except that only its `tokenize`
 * function is used, in which case it doesn’t receive an `ok` or `nok`.
 * `from` can be given to set the point before the first character, although
 * when further lines are indented, they must be set with `defineSkip`.
 *
 * @param {ParseContext} parser
 * @param {InitialConstruct} initialize
 * @param {Omit<Point, '_index'|'_bufferIndex'>} [from]
 * @returns {TokenizeContext}
 */

/**
 * Create an extension for `mdast-util-from-markdown` to enable GFM (autolink
 * literals, footnotes, strikethrough, tables, tasklists).
 *
 * @returns {Array<FromMarkdownExtension>}
 *   Extension for `mdast-util-from-markdown` to enable GFM (autolink literals,
 *   footnotes, strikethrough, tables, tasklists).
 */

/**
 * Create an extension for `mdast-util-from-markdown` to enable GFM footnotes
 * in markdown.
 *
 * @returns {FromMarkdownExtension}
 *   Extension for `mdast-util-from-markdown`.
 */

/**
 * Create an extension for `mdast-util-to-markdown` to enable GFM (autolink
 * literals, footnotes, strikethrough, tables, tasklists).
 *
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown` to enable GFM (autolink literals,
 *   footnotes, strikethrough, tables, tasklists).
 */

/**
 * Create an extension for `mdast-util-to-markdown` to enable GFM footnotes
 * in markdown.
 *
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown`.
 */

/**
 * Create an extension for `mdast-util-to-markdown` to enable GFM tables in
 * markdown.
 *
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown` to enable GFM tables.
 */

/**
 * Create clean positional information.
 *
 * @param {State} state
 *   Info passed around about the current state.
 * @param {Node} node
 *   hast node.
 * @param {P5ElementLocation} location
 *   p5 location info.
 * @returns {Position | undefined}
 *   Position, or nothing.
 */

/**
 * Create new middleware.
 *
 * @returns {Pipeline}
 */

/**
 * Creates a throttled function that only invokes `func` at most once per
 * every `wait` milliseconds. The throttled function comes with a `cancel`
 * method to cancel delayed `func` invocations and a `flush` method to
 * immediately invoke them. Provide `options` to indicate whether `func`
 * should be invoked on the leading and/or trailing edge of the `wait`
 * timeout. The `func` is invoked with the last arguments provided to the
 * throttled function. Subsequent calls to the throttled function return the
 * result of the last `func` invocation.
 *
 * **Note:** If `leading` and `trailing` options are `true`, `func` is
 * invoked on the trailing edge of the timeout only if the throttled function
 * is invoked more than once during the `wait` timeout.
 *
 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
 *
 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
 * for details over the differences between `_.throttle` and `_.debounce`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to throttle.
 * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
 * @param {Object} [options={}] The options object.
 * @param {boolean} [options.leading=true]
 *  Specify invoking on the leading edge of the timeout.
 * @param {boolean} [options.trailing=true]
 *  Specify invoking on the trailing edge of the timeout.
 * @returns {Function} Returns the new throttled function.
 * @example
 *
 * // Avoid excessively updating the position while scrolling.
 * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
 *
 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
 * jQuery(element).on('click', throttled);
 *
 * // Cancel the trailing throttled invocation.
 * jQuery(window).on('popstate', throttled.cancel);
 */

/**
 * DO NOT EDIT THIS FILE
 * The code in this file is generated from files in ./src/
 */

/**
 * Default handlers for nodes.
 */

/**
 * Do not traverse this node’s children.
 */

/**
 * Expose
 */

/**
 * Extension for `mdast-util-from-markdown` to enable GFM strikethrough.
 *
 * @type {FromMarkdownExtension}
 */

/**
 * Extension for `mdast-util-from-markdown` to enable GFM tables.
 *
 * @type {FromMarkdownExtension}
 */

/**
 * Extension for `mdast-util-from-markdown` to enable GFM task list items.
 *
 * @type {FromMarkdownExtension}
 */

/**
 * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.
 *
 * @type {ToMarkdownExtension}
 */

/**
 * Extension for `mdast-util-to-markdown` to enable GFM strikethrough.
 *
 * @type {ToMarkdownExtension}
 */

/**
 * Extension for `mdast-util-to-markdown` to enable GFM task list items.
 *
 * @type {ToMarkdownExtension}
 */

/**
 * Filter out invalid points.
 *
 * @param {Point} point
 *   Point with potentially `undefined` values.
 * @returns {Point | undefined}
 *   Point or nothing.
 */

/**
 * Find definitions in `tree`.
 *
 * Uses CommonMark precedence, which means that earlier definitions are
 * preferred over duplicate later definitions.
 *
 * @param {Node} tree
 *   Tree to check.
 * @returns {GetDefinition}
 *   Getter.
 */

/**
 * Find patterns in a tree and replace them.
 *
 * The algorithm searches the tree in *preorder* for complete values in `Text`
 * nodes.
 * Partial matches are not supported.
 *
 * @param tree
 *   Tree to change.
 * @param find
 *   Patterns to find.
 * @param replace
 *   Things to replace with (when `find` is `Find`) or configuration.
 * @param options
 *   Configuration (when `find` is not `Find`).
 * @returns
 *   Given, modified, tree.
 */

/**
 * GFM + Line Breaks Inline Grammar
 */

/**
 * GFM Block Grammar
 */

/**
 * GFM Inline Grammar
 */

/**
 * Generate a hast footer for called footnote definitions.
 *
 * @param {State} state
 *   Info passed around.
 * @returns {Element | undefined}
 *   `section` element or `undefined`.
 */

/**
 * Generate a markdown ([GFM](https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables)) table..
 *
 * @param {ReadonlyArray<ReadonlyArray<string|null|undefined>>} table
 *   Table data (matrix of strings).
 * @param {Options} [options]
 *   Configuration (optional).
 * @returns {string}
 */

/**
 * Generate an assertion from a test.
 *
 * Useful if you’re going to test many nodes, for example when creating a
 * utility where something else passes a compatible test.
 *
 * The created function is a bit faster because it expects valid input only:
 * a `node`, `index`, and `parent`.
 *
 * @param test
 *   *   when nullish, checks if `node` is a `Node`.
 *   *   when `string`, works like passing `(node) => node.type === test`.
 *   *   when `function` checks if function passed the node is true.
 *   *   when `object`, checks that all keys in test are in node, and that they have (strictly) equal values.
 *   *   when `array`, checks if any one of the subtests pass.
 * @returns
 *   An assertion.
 */

/**
 * Get a path from a POSIX URL.
 *
 * @param {URL} url
 *   URL.
 * @returns {string}
 *   File path.
 */

/**
 * Get an extname from a path.
 *
 * @param {string} path
 *   File path.
 * @returns {string}
 *   Extname.
 */

/**
 * Get an identifier from an association to match it to others.
 *
 * Associations are nodes that match to something else through an ID:
 * <https://github.com/syntax-tree/mdast#association>.
 *
 * The `label` of an association is the string value: character escapes and
 * references work, and casing is intact.
 * The `identifier` is used to match one association to another:
 * controversially, character escapes and references don’t work in this
 * matching: `&copy;` does not match `©`, and `\+` does not match `+`.
 *
 * But casing is ignored (and whitespace) is trimmed and collapsed: ` A\nb`
 * matches `a b`.
 * So, we do prefer the label when figuring out how we’re going to serialize:
 * it has whitespace, casing, and we can ignore most useless character
 * escapes and all character references.
 *
 * @type {AssociationId}
 */

/**
 * Get the basename from a path.
 *
 * @param {string} path
 *   File path.
 * @param {string | undefined} [ext]
 *   Extension to strip.
 * @returns {string}
 *   Stem or basename.
 */

/**
 * Get the chunks from a slice of chunks in the range of a token.
 *
 * @param {Array<Chunk>} chunks
 * @param {Pick<Token, 'start'|'end'>} token
 * @returns {Array<Chunk>}
 */

/**
 * Get the dirname from a path.
 *
 * @param {string} path
 *   File path.
 * @returns {string}
 *   File path.
 */

/**
 * Get the ending point of `node`.
 *
 * @param node
 *   Node.
 * @returns
 *   Point.
 */

/**
 * Get the positional info of `node`.
 *
 * @param {'start' | 'end'} type
 *   Side.
 * @returns
 *   Getter.
 */

/**
 * Get the positional info of `node`.
 *
 * @param {NodeLike | Node | null | undefined} [node]
 *   Node.
 * @returns {Position}
 *   Position.
 */

/**
 * Get the starting point of `node`.
 *
 * @param node
 *   Node.
 * @returns
 *   Point.
 */

/**
 * Get the string value of a slice of chunks.
 *
 * @param {Array<Chunk>} chunks
 * @param {boolean} [expandTabs=false]
 * @returns {string}
 */

/**
 * Get the text content of a node or list of nodes.
 *
 * Prefers the node’s plain-text fields, otherwise serializes its children,
 * and if the given value is an array, serialize the nodes in it.
 *
 * @param {unknown} value
 *   Thing to serialize, typically `Node`.
 * @param {Options | null | undefined} [options]
 *   Configuration (optional).
 * @returns {string}
 *   Serialized `value`.
 */

/**
 * Given a hast tree and an optional vfile (for positional info), return a new
 * parsed-again hast tree.
 *
 * @param tree
 *   Original hast tree.
 * @param file
 *   Virtual file for positional info, optional.
 * @param options
 *   Configuration.
 */

/**
 * Handle a property.
 *
 * @param {Schema} schema
 *   Current schema.
 * @param {string} prop
 *   Key.
 * @param {Array<string | number> | string | number | boolean | null | undefined} value
 *   hast property value.
 * @returns {P5Attribute | void}
 *   Field for runtime, optional.
 */

/**
 * Handle values based on a field.
 *
 * @template {InvalidHandler} [Invalid=InvalidHandler]
 * @template {UnknownHandler} [Unknown=UnknownHandler]
 * @template {Record<string, Handler>} [Handlers=Record<string, Handler>]
 * @param {string} key
 *   Field to switch on.
 * @param {Options<Invalid, Unknown, Handlers>} [options]
 *   Configuration (required).
 * @returns {{unknown: Unknown, invalid: Invalid, handlers: Handlers, (...parameters: Parameters<Handlers[keyof Handlers]>): ReturnType<Handlers[keyof Handlers]>, (...parameters: Parameters<Unknown>): ReturnType<Unknown>}}
 */

/**
 * Helpers
 */

/**
 * Honor the `data` of `from` and maybe generate an element instead of `to`.
 *
 * @template {HastNodes} Type
 *   Node type.
 * @param {MdastNodes} from
 *   mdast node to use data from.
 * @param {Type} to
 *   hast node to change.
 * @returns {Type | HastElement}
 *   Nothing.
 */

/**
 * Index the given document so you can translate between line/column and offset
 * based positional info.
 *
 * @param {VFile | Value} file
 *   File to index.
 * @returns {Location}
 *   Accessors for index.
 */

/**
 * Inline-Level Grammar
 */

/**
 * Join segments from a path.
 *
 * @param {Array<string>} segments
 *   Path segments.
 * @returns {string}
 *   File path.
 */

/**
 * Like `Array#splice`, but smarter for giant arrays.
 *
 * `Array#splice` takes all items to be inserted as individual argument which
 * causes a stack overflow in V8 when trying to insert 100k items for instance.
 *
 * Otherwise, this does not return the removed items, and takes `items` as an
 * array instead of rest parameters.
 *
 * @template {unknown} T
 * @param {T[]} list
 * @param {number} start
 * @param {number} remove
 * @param {T[]} items
 * @returns {void}
 */

/**
 * List of HTML void tag names.
 *
 * @type {Array<string>}
 */

/**
 * List of lowercase HTML tag names which when parsing HTML (flow), result
 * in more relaxed rules (condition 6): because they are known blocks, the
 * HTML-like syntax doesn’t have to be strictly parsed.
 * For tag names not in this list, a more strict algorithm (condition 7) is used
 * to detect whether the HTML-like syntax is seen as HTML (flow) or not.
 *
 * This is copied from:
 * <https://spec.commonmark.org/0.30/#html-blocks>.
 */

/**
 * List of lowercase HTML tag names which when parsing HTML (flow), result in
 * HTML that can include lines w/o exiting, until a closing tag also in this
 * list is found (condition 1).
 *
 * This module is copied from:
 * <https://spec.commonmark.org/0.30/#html-blocks>.
 *
 * Note that `textarea` was added in `CommonMark@0.30`.
 */

/**
 * Make a string safe for embedding in markdown constructs.
 *
 * In markdown, almost all punctuation characters can, in certain cases,
 * result in something.
 * Whether they do is highly subjective to where they happen and in what
 * they happen.
 *
 * To solve this, `mdast-util-to-markdown` tracks:
 *
 * * Characters before and after something;
 * * What “constructs” we are in.
 *
 * This information is then used by this function to escape or encode
 * special characters.
 *
 * @param {State} state
 *   Info passed around about the current state.
 * @param {string | null | undefined} input
 *   Raw value to make safe.
 * @param {SafeConfig} config
 *   Configuration.
 * @returns {string}
 *   Serialized markdown safe for embedding.
 */

/**
 * Make a value safe for injection as a URL.
 *
 * This encodes unsafe characters with percent-encoding and skips already
 * encoded sequences (see `normalizeUri` below).
 * Further unsafe characters are encoded as character references (see
 * `micromark-util-encode`).
 *
 * Then, a regex of allowed protocols can be given, in which case the URL is
 * sanitized.
 * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`,
 * or `/^https?$/i` for `img[src]`.
 * If the URL includes an unknown protocol (one not matched by `protocol`, such
 * as a dangerous example, `javascript:`), the value is ignored.
 *
 * @param {string|undefined} url
 * @param {RegExp} [protocol]
 * @returns {string}
 */

/**
 * Make sure `path` is a string.
 *
 * @param {string} path
 *   File path.
 * @returns {asserts path is string}
 *   Nothing.
 */

/**
 * Map of web namespaces.
 *
 * @type {Record<string, string>}
 */

/**
 * Marked
 */

/**
 * Merge `extension` into `all`.
 *
 * @param {NormalizedExtension} all Extension to merge into.
 * @param {Extension} extension Extension to merge.
 * @returns {void}
 */

/**
 * Merge `list` into `existing` (both lists of constructs).
 * Mutates `existing`.
 *
 * @param {unknown[]} existing
 * @param {unknown[]} list
 * @returns {void}
 */

/**
 * Message.
 */

/**
 * Minimal `EventEmitter` interface that is molded against the Node.js
 * `EventEmitter` interface.
 *
 * @constructor
 * @public
 */

/**
 * Move a point a bit.
 *
 * Note: `move` only works inside lines! It’s not possible to move past other
 * chunks (replacement characters, tabs, or line endings).
 *
 * @param {Point} point
 * @param {number} offset
 * @returns {void}
 */

/**
 * Mutate-mode.
 * Further plugins run on the hast tree.
 *
 * @type {import('unified').Plugin<[Options?]|void[], MdastRoot, HastRoot>}
 */

/**
 * No name because it must not be turned off.
 * @type {Construct}
 */

/**
 * Normal Block Grammar
 */

/**
 * Normal Inline Grammar
 */

/**
 * Normalize a URL (such as used in definitions).
 *
 * Encode unsafe characters with percent-encoding, skipping already encoded
 * sequences.
 *
 * @param {string} value
 * @returns {string}
 */

/**
 * Normalize a basic file path.
 *
 * @param {string} path
 *   File path.
 * @returns {string}
 *   File path.
 */

/**
 * Normalize an identifier (such as used in definitions).
 *
 * @param {string} value
 * @returns {string}
 */

/**
 * Note this compiler only understand complete buffering, not streaming.
 *
 * @param {Options | null | undefined} [options]
 */

/**
 * One node or several nodes.
 *
 * @param {unknown} value
 *   Thing to serialize.
 * @param {boolean} includeImageAlt
 *   Include image `alt`s.
 * @returns {string}
 *   Serialized node.
 */

/**
 * Options
 */

/**
 * Order of setting (least specific to most), we need this because otherwise
 * `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a
 * stem can be set.
 *
 * @type {Array<'basename' | 'dirname' | 'extname' | 'history' | 'path' | 'stem'>}
 */

/**
 * Parse Inline
 * @param {string} src
 */

/**
 * Parse a single primitives.
 *
 * @param {Info} info
 * @param {string} name
 * @param {HPrimitiveValue} value
 * @returns {HPrimitiveValue}
 */

/**
 * Parse comma-separated tokens to an array.
 *
 * @param {string} value
 *   Comma-separated tokens.
 * @returns {Array<string>}
 *   List of tokens.
 */

/**
 * Parse space-separated tokens to an array of strings.
 *
 * @param {string} value
 *   Space-separated tokens.
 * @returns {Array<string>}
 *   List of tokens.
 */

/**
 * Parses inline style to object.
 *
 * @example
 * // returns { 'line-height': '42' }
 * StyleToObject('line-height: 42;');
 *
 * @param  {String}      style      - The inline style.
 * @param  {Function}    [iterator] - The iterator function.
 * @return {null|Object}
 */

/**
 * Parsing & Compiling
 */

/**
 * Patch positional info from `from` onto `to`.
 *
 * @param {State} state
 *   Info passed around about the current state.
 * @param {P5Node} from
 *   p5 node.
 * @param {Node} to
 *   hast node.
 * @returns {void}
 *   Nothing.
 */

/**
 * Pedantic Inline Grammar
 */

/**
 * Pedantic grammar (original John Gruber's loose markdown specification)
 */

/**
 * Plugin that turns markdown into HTML to support rehype.
 *
 * *   If a destination processor is given, that processor runs with a new HTML
 *     (hast) tree (bridge-mode).
 *     As the given processor runs with a hast tree, and rehype plugins support
 *     hast, that means rehype plugins can be used with the given processor.
 *     The hast tree is discarded in the end.
 *     It’s highly unlikely that you want to do this.
 * *   The common case is to not pass a destination processor, in which case the
 *     current processor continues running with a new HTML (hast) tree
 *     (mutate-mode).
 *     As the current processor continues with a hast tree, and rehype plugins
 *     support hast, that means rehype plugins can be used after
 *     `remark-rehype`.
 *     It’s likely that this is what you want to do.
 *
 * @param destination
 *   Optional unified processor.
 * @param options
 *   Options passed to `mdast-util-to-hast`.
 */

/**
 * Plugin to parse the tree again (and raw nodes).
 * Keeping positional info OK.  🙌
 *
 * @type {import('unified').Plugin<[Options?] | Array<void>, Root>}
 */

/**
 * Plugin to sanitize HTML.
 *
 * @type {import('unified').Plugin<[Options?] | Array<void>, Root, Root>}
 */

/**
 * Plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists).
 *
 * @type {import('unified').Plugin<[Options?]|void[], Root>}
 */

/**
 * React component to render markdown.
 *
 * @param {ReactMarkdownOptions} options
 * @returns {ReactElement}
 */

/**
 * Remove all listeners, or those of the specified event.
 *
 * @param {(String|Symbol)} [event] The event name.
 * @returns {EventEmitter} `this`.
 * @public
 */

/**
 * Remove initial and final spaces and tabs at the line breaks in `value`.
 * Does not trim initial and final spaces and tabs of the value itself.
 *
 * @param {string} value
 *   Value to trim.
 * @returns {string}
 *   Trimmed value.
 */

/**
 * Remove the listeners of a given event.
 *
 * @param {(String|Symbol)} event The event name.
 * @param {Function} fn Only remove the listeners that match this function.
 * @param {*} context Only remove the listeners that have this context.
 * @param {Boolean} once Only remove one-time listeners.
 * @returns {EventEmitter} `this`.
 * @public
 */

/**
 * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').
 * /c*$/ is vulnerable to REDOS.
 *
 * @param {string} str
 * @param {string} c
 * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.
 */

/**
 * Renderer
 */

/**
 * Representation of a single event listener.
 *
 * @param {Function} fn The listener function.
 * @param {*} context The context to invoke the listener with.
 * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
 * @constructor
 * @private
 */

/**
 * Resolve `.` and `..` elements in a path with directory names.
 *
 * @param {string} path
 *   File path.
 * @param {boolean} allowAboveRoot
 *   Whether `..` can move above root.
 * @returns {string}
 *   File path.
 */

/**
 * Return an array listing the events for which the emitter has registered
 * listeners.
 *
 * @returns {Array}
 * @public
 */

/**
 * Return the content of a reference without definition as plain text.
 *
 * @param {State} state
 *   Info passed around.
 * @param {References} node
 *   Reference node (image, link).
 * @returns {ElementContent | Array<ElementContent>}
 *   hast content.
 */

/**
 * Return the listeners registered for a given event.
 *
 * @param {(String|Symbol)} event The event name.
 * @returns {Array} The registered listeners.
 * @public
 */

/**
 * Return the number of listeners listening to a given event.
 *
 * @param {(String|Symbol)} event The event name.
 * @returns {Number} The number of listeners.
 * @public
 */

/**
 * Run callback for every token
 */

/**
 * Sanitize `children`.
 *
 * @type {Handler}
 * @param {Array<Node>} children
 * @param {Node} node
 * @returns {Array<Node>}
 */

/**
 * Sanitize `node`.
 *
 * @param {Schema} schema
 * @param {Node} node
 * @param {Array<string>} stack
 * @returns {Node | Array<Node> | undefined}
 */

/**
 * Sanitize `properties`.
 *
 * @type {Handler}
 * @param {Properties} properties
 * @param {Element} node
 * @returns {Properties}
 */

/**
 * Sanitize `tagName`.
 *
 * @param {Schema} schema
 * @param {string} tagName
 * @param {Node} _
 * @param {Array<string>} stack
 * @returns {string | false}
 */

/**
 * Sanitize `value`.
 *
 * @type {Handler}
 * @param {unknown} value
 * @returns {string}
 */

/**
 * Sanitize a property value which is a list.
 *
 * @param {Schema} schema
 * @param {Array<unknown>} values
 * @param {string} prop
 * @param {AttributeClean[string]} definition
 * @returns {Array<string | number>}
 */

/**
 * Sanitize a property value.
 *
 * @param {Schema} schema
 * @param {unknown} value
 * @param {string} prop
 * @param {AttributeClean[string]} definition
 * @returns {PropertyValue}
 */

/**
 * See <https://html.spec.whatwg.org/multipage/parsing.html#serialising-html-fragments>
 *
 * @type {Handler}
 * @param {unknown} value
 * @returns {string}
 */

/**
 * Serialize a `style` object as a string.
 *
 * @param {HStyle} value
 *   Style object.
 * @returns {string}
 *   CSS string.
 */

/**
 * Serialize a list of nodes.
 *
 * @param {Array<unknown>} values
 *   Thing to serialize.
 * @param {boolean} includeImageAlt
 *   Include image `alt`s.
 * @returns {string}
 *   Serialized nodes.
 */

/**
 * Serialize an array of strings as space separated-tokens.
 *
 * @param {Array<string|number>} values
 *   List of tokens.
 * @returns {string}
 *   Space-separated tokens.
 */

/**
 * Serialize an array of strings or numbers to comma-separated tokens.
 *
 * @param {Array<string|number>} values
 *   List of tokens.
 * @param {Options} [options]
 *   Configuration for `stringify` (optional).
 * @returns {string}
 *   Comma-separated tokens.
 */

/**
 * Serialize the children of a parent that contains phrasing children.
 *
 * These children will be joined flush together.
 *
 * @param {Parent & {children: Array<PhrasingContent>}} parent
 *   Parent of flow nodes.
 * @param {State} state
 *   Info passed around about the current state.
 * @param {Info} info
 *   Info on where we are in the document we are generating.
 * @returns {string}
 *   Serialized children, joined together.
 */

/**
 * Serialize the positional info of a point, position (start and end points),
 * or node.
 *
 * @param {Node | NodeLike | Position | PositionLike | Point | PointLike | null | undefined} [value]
 *   Node, position, or point.
 * @returns {string}
 *   Pretty printed positional info of a node (`string`).
 *
 *   In the format of a range `ls:cs-le:ce` (when given `node` or `position`)
 *   or a point `l:c` (when given `point`), where `l` stands for line, `c` for
 *   column, `s` for `start`, and `e` for end.
 *   An empty string (`''`) is returned if the given value is neither `node`,
 *   `position`, nor `point`.
 */

/**
 * Slugger generates header id
 */

/**
 * Stop traversing immediately.
 */

/**
 * Support GFM or markdown on github.com.
 *
 * @param {Options} [options]
 * @returns {Extension}
 */

/**
 * Support to compile GFM to HTML.
 *
 * @param {HtmlOptions} [options]
 * @returns {HtmlExtension}
 */

/**
 * Take all events and resolve attention to emphasis or strong.
 *
 * @type {Resolver}
 */

/**
 * TextRenderer
 * returns only the textual part of the token
 */

/**
 * This method is like `_.find` except that it returns the index of the first
 * element `predicate` returns truthy for instead of the element itself.
 *
 * @static
 * @memberOf _
 * @since 1.1.0
 * @category Array
 * @param {Array} array The array to inspect.
 * @param {Function} [predicate=_.identity] The function invoked per iteration.
 * @param {number} [fromIndex=0] The index to search from.
 * @returns {number} Returns the index of the found element, else `-1`.
 * @example
 *
 * var users = [
 *   { 'user': 'barney',  'active': false },
 *   { 'user': 'fred',    'active': false },
 *   { 'user': 'pebbles', 'active': true }
 * ];
 *
 * _.findIndex(users, function(o) { return o.user == 'barney'; });
 * // => 0
 *
 * // The `_.matches` iteratee shorthand.
 * _.findIndex(users, { 'user': 'fred', 'active': false });
 * // => 1
 *
 * // The `_.matchesProperty` iteratee shorthand.
 * _.findIndex(users, ['active', false]);
 * // => 0
 *
 * // The `_.property` iteratee shorthand.
 * _.findIndex(users, 'active');
 * // => 2
 */

/**
 * This method is like `_.intersection` except that it accepts `iteratee`
 * which is invoked for each element of each `arrays` to generate the criterion
 * by which they're compared. The order and references of result values are
 * determined by the first array. The iteratee is invoked with one argument:
 * (value).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Array
 * @param {...Array} [arrays] The arrays to inspect.
 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
 * @returns {Array} Returns the new array of intersecting values.
 * @example
 *
 * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
 * // => [2.1]
 *
 * // The `_.property` iteratee shorthand.
 * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
 * // => [{ 'x': 1 }]
 */

/**
 * Throw a given error.
 *
 * @param {Error|null|undefined} [error]
 *   Maybe error.
 * @returns {asserts error is null|undefined}
 */

/**
 * Tokenize embedded tokens.
 *
 * @param {Event[]} events
 * @param {number} eventIndex
 * @returns {Record<string, number>}
 */

/**
 * Tokenize subcontent.
 *
 * @param {Event[]} events
 * @returns {boolean}
 */

/**
 * Tokenizer
 */

/**
 * Track positional info in the output.
 *
 * @type {CreateTracker}
 */

/**
 * Transform a `parse5` AST to hast.
 *
 * @param {P5Node} tree
 *   `parse5` tree to transform.
 * @param {Options | VFile | null | undefined} [options]
 *   Configuration.
 * @returns {Node}
 *   hast tree.
 */

/**
 * Transform a hast tree to Parse5’s AST.
 *
 * @param {Node} tree
 *   Tree to transform.
 * @param {Options | Space | null | undefined} [options]
 *   Configuration.
 * @returns {P5Node}
 *   `parse5` node.
 */

/**
 * Transform a node.
 *
 * @param {State} state
 *   Info passed around about the current state.
 * @param {P5Node} node
 *   p5 node.
 * @returns {Node}
 *   hast node.
 */

/**
 * Transform all hast nodes.
 *
 * @param {Array<Content>} children
 *   List of children.
 * @param {P5Parent} parentNode
 *   `parse5` parent node.
 * @param {Schema} schema
 *   Current schema.
 * @returns {Array<P5Child>}
 *   Transformed children.
 */

/**
 * Transform an element.
 *
 * @param {State} state
 *   Info passed around about the current state.
 * @param {P5Element} node
 *   `parse5` node to transform.
 * @returns {Element}
 *   hast node.
 */

/**
 * Transform an mdast node into a hast node.
 *
 * @param {State} state
 *   Info passed around.
 * @param {MdastNodes} node
 *   mdast node.
 * @param {MdastParents | null | undefined} [parent]
 *   Parent of `node`.
 * @returns {HastElementContent | Array<HastElementContent> | null | undefined}
 *   Resulting hast node.
 */

/**
 * Transform an unknown node.
 *
 * @param {State} state
 *   Info passed around.
 * @param {MdastNodes} node
 *   Unknown mdast node.
 * @returns {HastText | HastElement}
 *   Resulting hast node.
 */

/**
 * Transform children.
 *
 * @param {State} state
 *   Info passed around about the current state.
 * @param {Array<P5Node>} nodes
 *   Nodes.
 * @returns {Array<Content>}
 *   hast nodes.
 */

/**
 * Transform mdast to hast.
 *
 * ##### Notes
 *
 * ###### HTML
 *
 * Raw HTML is available in mdast as `html` nodes and can be embedded in hast
 * as semistandard `raw` nodes.
 * Most utilities ignore `raw` nodes but two notable ones don’t:
 *
 * *   `hast-util-to-html` also has an option `allowDangerousHtml` which will
 *     output the raw HTML.
 *     This is typically discouraged as noted by the option name but is useful
 *     if you completely trust authors
 * *   `hast-util-raw` can handle the raw embedded HTML strings by parsing them
 *     into standard hast nodes (`element`, `text`, etc).
 *     This is a heavy task as it needs a full HTML parser, but it is the only
 *     way to support untrusted content
 *
 * ###### Footnotes
 *
 * Many options supported here relate to footnotes.
 * Footnotes are not specified by CommonMark, which we follow by default.
 * They are supported by GitHub, so footnotes can be enabled in markdown with
 * `mdast-util-gfm`.
 *
 * The options `footnoteBackLabel` and `footnoteLabel` define natural language
 * that explains footnotes, which is hidden for sighted users but shown to
 * assistive technology.
 * When your page is not in English, you must define translated values.
 *
 * Back references use ARIA attributes, but the section label itself uses a
 * heading that is hidden with an `sr-only` class.
 * To show it to sighted users, define different attributes in
 * `footnoteLabelProperties`.
 *
 * ###### Clobbering
 *
 * Footnotes introduces a problem, as it links footnote calls to footnote
 * definitions on the page through `id` attributes generated from user content,
 * which results in DOM clobbering.
 *
 * DOM clobbering is this:
 *
 * ```html
 * <p id=x></p>
 * <script>alert(x) // `x` now refers to the DOM `p#x` element</script>
 * ```
 *
 * Elements by their ID are made available by browsers on the `window` object,
 * which is a security risk.
 * Using a prefix solves this problem.
 *
 * More information on how to handle clobbering and the prefix is explained in
 * Example: headings (DOM clobbering) in `rehype-sanitize`.
 *
 * ###### Unknown nodes
 *
 * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.
 * The default behavior for unknown nodes is:
 *
 * *   when the node has a `value` (and doesn’t have `data.hName`,
 *     `data.hProperties`, or `data.hChildren`, see later), create a hast `text`
 *     node
 * *   otherwise, create a `<div>` element (which could be changed with
 *     `data.hName`), with its children mapped from mdast to hast as well
 *
 * This behavior can be changed by passing an `unknownHandler`.
 *
 * @param {MdastNodes} tree
 *   mdast tree.
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {HastNodes | null | undefined}
 *   hast tree.
 */

/**
 * Transform the children of an mdast node into hast nodes.
 *
 * @param {State} state
 *   Info passed around.
 * @param {MdastNodes} parent
 *   mdast node to compile
 * @returns {Array<HastElementContent>}
 *   Resulting hast nodes.
 */

/**
 * Trim `str`.
 *
 * @param {String} str
 * @return {String}
 */

/**
 * Turn a custom test into a test for a node that passes that test.
 *
 * @param {TestFunctionAnything} check
 * @returns {AssertAnything}
 */

/**
 * Turn a find into an expression.
 *
 * @param {Find} find
 *   Find.
 * @returns {RegExp}
 *   Expression.
 */

/**
 * Turn a p5 location into a position.
 *
 * @param {P5Location} loc
 *   Location.
 * @returns {Position | undefined}
 *   Position or nothing.
 */

/**
 * Turn a replace into a function.
 *
 * @param {Replace} replace
 *   Replace.
 * @returns {ReplaceFunction}
 *   Function.
 */

/**
 * Turn a return value into a clean result.
 *
 * @param {VisitorResult} value
 *   Valid return values from visitors.
 * @returns {ActionTuple}
 *   Clean result.
 */

/**
 * Turn a schema into pairs.
 *
 * @param {FindAndReplaceSchema | FindAndReplaceList} schema
 *   Schema.
 * @returns {Pairs}
 *   Clean pairs.
 */

/**
 * Turn a string into a test for a node with a certain type.
 *
 * @param {string} check
 * @returns {AssertAnything}
 */

/**
 * Turn an mdast `blockquote` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {Blockquote} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `break` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {Break} node
 *   mdast node.
 * @returns {Array<Element | Text>}
 *   hast element content.
 */

/**
 * Turn an mdast `code` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {Code} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `delete` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {Delete} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `emphasis` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {Emphasis} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `footnoteReference` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {FootnoteReference} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `footnote` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {Footnote} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `heading` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {Heading} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise
 * nothing).
 *
 * @param {State} state
 *   Info passed around.
 * @param {Html} node
 *   mdast node.
 * @returns {Raw | Element | null}
 *   hast node.
 */

/**
 * Turn an mdast `imageReference` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {ImageReference} node
 *   mdast node.
 * @returns {ElementContent | Array<ElementContent>}
 *   hast node.
 */

/**
 * Turn an mdast `image` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {Image} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `inlineCode` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {InlineCode} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `linkReference` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {LinkReference} node
 *   mdast node.
 * @returns {ElementContent | Array<ElementContent>}
 *   hast node.
 */

/**
 * Turn an mdast `link` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {Link} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `listItem` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {ListItem} node
 *   mdast node.
 * @param {Parents | null | undefined} parent
 *   Parent of `node`.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `list` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {List} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `paragraph` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {Paragraph} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `root` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {MdastRoot} node
 *   mdast node.
 * @returns {HastRoot | HastElement}
 *   hast node.
 */

/**
 * Turn an mdast `strong` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {Strong} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `tableCell` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {TableCell} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `tableRow` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {TableRow} node
 *   mdast node.
 * @param {Parents | null | undefined} parent
 *   Parent of `node`.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `table` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {Table} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an mdast `text` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {MdastText} node
 *   mdast node.
 * @returns {HastText | HastElement}
 *   hast node.
 */

/**
 * Turn an mdast `thematicBreak` node into hast.
 *
 * @param {State} state
 *   Info passed around.
 * @param {ThematicBreak} node
 *   mdast node.
 * @returns {Element}
 *   hast node.
 */

/**
 * Turn an object into a test for a node with a certain fields.
 *
 * @param {Props} check
 * @returns {AssertAnything}
 */

/**
 * Turn the number (in string form as either hexa- or plain decimal) coming from
 * a numeric character reference into a character.
 *
 * @param {string} value
 *   Value to decode.
 * @param {number} base
 *   Numeric base.
 * @returns {string}
 */

/**
 * Use Extension
 */

/**
 * Utility to decode markdown strings (which occur in places such as fenced
 * code info strings, destinations, labels, and titles).
 * The “string” content type allows character escapes and -references.
 * This decodes those.
 *
 * @param {string} value
 * @returns {string}
 */

/**
 * Utility to sanitize a tree
 *
 * @param {Node} node
 *   Hast tree to sanitize
 * @param {Schema} [schema]
 *   Schema defining how to sanitize - defaults to Github style sanitation
 */

/**
 * Visit nodes, with ancestral information.
 *
 * This algorithm performs *depth-first* *tree traversal* in *preorder*
 * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).
 *
 * You can choose for which nodes `visitor` is called by passing a `test`.
 * For complex tests, you should test yourself in `visitor`, as it will be
 * faster and will have improved type information.
 *
 * Walking the tree is an intensive task.
 * Make use of the return values of the visitor when possible.
 * Instead of walking a tree multiple times, walk it once, use `unist-util-is`
 * to check if a node matches, and then perform different operations.
 *
 * You can change the tree.
 * See `Visitor` for more info.
 *
 * @param tree
 *   Tree to traverse.
 * @param test
 *   `unist-util-is`-compatible test
 * @param visitor
 *   Handle each node.
 * @param reverse
 *   Traverse in reverse preorder (NRL) instead of the default preorder (NLR).
 * @returns
 *   Nothing.
 */

/**
 * Visit nodes.
 *
 * This algorithm performs *depth-first* *tree traversal* in *preorder*
 * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).
 *
 * You can choose for which nodes `visitor` is called by passing a `test`.
 * For complex tests, you should test yourself in `visitor`, as it will be
 * faster and will have improved type information.
 *
 * Walking the tree is an intensive task.
 * Make use of the return values of the visitor when possible.
 * Instead of walking a tree multiple times, walk it once, use `unist-util-is`
 * to check if a node matches, and then perform different operations.
 *
 * You can change the tree.
 * See `Visitor` for more info.
 *
 * @param tree
 *   Tree to traverse.
 * @param test
 *   `unist-util-is`-compatible test
 * @param visitor
 *   Handle each node.
 * @param reverse
 *   Traverse in reverse preorder (NRL) instead of the default preorder (NLR).
 * @returns
 *   Nothing.
 */

/**
 * Wrap `middleware`.
 * Can be sync or async; return a promise, receive a callback, or return new
 * values and errors.
 *
 * @param {Middleware} middleware
 * @param {Callback} callback
 */

/**
 * Wrap `nodes` with line endings between each node.
 *
 * @template {HastContent} Type
 *   Node type.
 * @param {Array<Type>} nodes
 *   List of nodes to wrap.
 * @param {boolean | null | undefined} [loose=false]
 *   Whether to add line endings at start and end.
 * @returns {Array<Type | HastText>}
 *   Wrapped nodes.
 */

/**
 * `hast` is close to `React`, but differs in a couple of cases.
 *
 * To get a React property from a hast property, check if it is in
 * `hastToReact`, if it is, then use the corresponding value,
 * otherwise, use the hast property.
 *
 * @type {Record<string, string>}
 */

/**
 * mangle email addresses
 * @param {string} text
 */

/**
 * marked - a markdown parser
 * Copyright (c) 2011-2022, Christopher Jeffrey. (MIT Licensed)
 * https://github.com/markedjs/marked
 */

/**
 * smartypants text replacement
 * @param {string} text
 */

/**
 * 关闭webview
 * 调用此接口可以关闭当前浏览器窗口
 * @apiName biz.navigation.close
 * @supportVersion  ios: 2.4.0 android: 2.4.0 pc: 4.3.5
 */

/**
 * 根据messageId在会话页面跳转到对应的位置
 * @apiName internal.chat.focusMessage
 * @supportVersion ios: 4.6.25 android: 4.6.25
 */

/**
 * 根据messageId跳转消息详情页
 * @apiName internal.chat.previewMessage
 * @supportVersion ios: 4.6.25 android: 4.6.25
 */

/**
 * 根据图片URL规则，取到图片尺寸，避免渲染时候页面闪动。主要给 markdown 使用，medaiId 生成的图无需调用
 * @param url 图片url
 * @returns IGetImageSizeWithUrlResult
 */

/**
 * 根据话题id获取对用的话题
 * @apiName internal.chat.getTopic
 * @supportVersion ios: 4.6.25 android: 4.6.25
 */

/**
 * 获取 emoji 正则
 * @returns RegExp
 */

/**
 * 获取话题回复的表情列表
 * @apiName internal.chat.getTopicStickers
 * @supportVersion ios: 4.6.25 android: 4.6.25
 */

/**
 * 获取话题的回复列表
 * @apiName internal.chat.getTopicReplys
 * @supportVersion ios: 4.6.25 android: 4.6.25
 */

/**
 * 表情回复接口
 * @apiName internal.chat.stickerReply
 * @supportVersion ios: 4.6.25 android: 4.6.25
 */

/** @class */

/** @returns {Blockquote} */

/** @returns {Break} */

/** @returns {Code} */

/** @returns {Definition} */

/** @returns {Emphasis} */

/** @returns {HTML} */

/** @returns {Heading} */

/** @returns {Image} */

/** @returns {InlineCode} */

/** @returns {Link} */

/** @returns {Paragraph} */

/** @returns {Strong} */

/** @returns {Text} */

/** @returns {ThematicBreak} */

/** @type {(code: Code) => code is number} */

/** @type {(from: Node, schema: Schema) => P5Node} */

/** @type {(import('unified').Plugin<[Processor, Options?]|[null|undefined, Options?]|[Options]|[], MdastRoot>)} */

/** @type {ActionTuple} */

/** @type {Array<'left' | 'right' | 'center' | 'none'>} */

/** @type {Array<Align>} */

/** @type {Array<Array<number>>} Sizes of each cell per row. */

/** @type {Array<Array<string>>} */

/** @type {Array<Array<string>>} Cells per row. */

/** @type {Array<AssertAnything>} */

/** @type {Array<Chunk>} */

/** @type {Array<Construct>} */

/** @type {Array<ConstructName>} */

/** @type {Array<Content>} */

/** @type {Array<Element>} */

/** @type {Array<ElementContent>} */

/** @type {Array<Event>} */

/** @type {Array<HastElementContent>} */

/** @type {Array<Middleware>} */

/** @type {Array<Node>} */

/** @type {Array<P5Attribute>} */

/** @type {Array<P5Child>} */

/** @type {Array<Parent>} */

/** @type {Array<PhrasingContent>} */

/** @type {Array<ReactNode>} */

/** @type {Array<StackItem>} */

/** @type {Array<StaticPhrasingContent>} */

/** @type {Array<Token>} */

/** @type {Array<Type | HastText>} */

/** @type {Array<keyof types>} */

/** @type {Array<number>} */

/** @type {Array<number>} Character codes as symbols for alignment per column. */

/** @type {Array<string | number>} */

/** @type {Array<string>} */

/** @type {AttributeClean[string]} */

/** @type {AttributeClean} */

/** @type {Callback} */

/** @type {Chunk[]} */

/** @type {Code} */

/** @type {Comment|Doctype|Element|Raw|Text} */

/** @type {CompileData} */

/** @type {Config} */

/** @type {ConstructName} */

/** @type {ConstructRecord} */

/** @type {Construct} */

/** @type {Create} */

/** @type {Effects['consume']} */

/** @type {Effects['enter']} */

/** @type {Effects['exit']} */

/** @type {Element|Root} */

/** @type {Element} */

/** @type {Error} */

/** @type {Event[]} */

/** @type {Event} */

/** @type {Exiter} */

/** @type {Extension['attentionMarkers']} */

/** @type {Extension['contentInitial']} */

/** @type {Extension['disable']} */

/** @type {Extension['document']} */

/** @type {Extension['flow']} */

/** @type {Extension['flowInitial']} */

/** @type {Extension['insideSpan']} */

/** @type {Extension['string']} */

/** @type {Extension['text']} */

/** @type {Extension} */

/** @type {FindAndReplaceSchema|FindAndReplaceList} */

/** @type {FootnoteDefinition} */

/** @type {FromMarkdownTransform} */

/** @type {FullNormalizedExtension} */

/** @type {GetDefinition} */

/** @type {HPropertyValue} */

/** @type {HResult} */

/** @type {Handler|undefined} */

/** @type {Handle} */

/** @type {HastRoot} */

/** @type {HastText | HastElement} */

/** @type {HastText} */

/** @type {HiddenLocationTracker|undefined} */

/** @type {HiddenPosTracker|undefined} */

/** @type {HiddenPreprocessor|undefined} */

/** @type {HiddenTokenizer|undefined} */

/** @type {Info} */

/** @type {InitialConstruct} */

/** @type {Initializer} */

/** @type {InlineCode} */

/** @type {Link} */

/** @type {ListItem} */

/** @type {Map} */

/** @type {MdastData} */

/** @type {NodeDefinition | NodeDefinitionGetter | undefined} */

/** @type {NodeDefinitionGetter} */

/** @type {NodeJS.ErrnoException} */

/** @type {NodeSchema} */

/** @type {Node|undefined} */

/** @type {Node} */

/** @type {NonNullable<Code>|undefined} */

/** @type {NonNullable<Code>} */

/** @type {NormalizedExtension} */

/** @type {Normal} */

/** @type {Omit<CompileContext, 'sliceSerialize'>} */

/** @type {OnEnterError} */

/** @type {Options | VFile} */

/** @type {Options | null | undefined} */

/** @type {Options} */

/** @type {P5Attribute} */

/** @type {P5Child} */

/** @type {P5Comment} */

/** @type {P5Doctype} */

/** @type {P5Document | P5DocumentFragment} */

/** @type {P5DocumentType} */

/** @type {P5Document} */

/** @type {P5Element} */

/** @type {P5Fragment} */

/** @type {P5Location} */

/** @type {P5ParserOptions} */

/** @type {P5Template} */

/** @type {P5Text} */

/** @type {Pairs} */

/** @type {Paragraph | undefined} */

/** @type {Paragraph} */

/** @type {Parent | undefined} */

/** @type {Parents} */

/** @type {ParseContext} */

/** @type {Pipeline} */

/** @type {Point|undefined} */

/** @type {Point} */

/** @type {Position} */

/** @type {Preprocessor} */

/** @type {Previous} */

/** @type {Processor['attachers'][number]|undefined} */

/** @type {Processor['attachers']} */

/** @type {Processor['freeze']} */

/** @type {Processor['parse']} */

/** @type {Processor['processSync']} */

/** @type {Processor['runSync']} */

/** @type {Processor['stringify']} */

/** @type {Processor} */

/** @type {Properties} */

/** @type {Raw} */

/** @type {ReactElement} */

/** @type {Record<number, {before: boolean, after: boolean}>} */

/** @type {Record<string, Definition>} */

/** @type {Record<string, Deprecation>} */

/** @type {Record<string, MdastFootnoteDefinition>} */

/** @type {Record<string, Position | undefined>} */

/** @type {Record<string, number>} */

/** @type {Record<string, string>} */

/** @type {Record<string, unknown>|undefined} */

/** @type {Record<string, unknown>} */

/** @type {ReferenceType} */

/** @type {RegExpExecArray | null} */

/** @type {RegExpMatchArray|null} */

/** @type {RegExpMatchObject} */

/** @type {Resolver[]} */

/** @type {Resolver} */

/** @type {Root} */

/** @type {Run} */

/** @type {State} */

/** @type {Stitch} */

/** @type {Text} */

/** @type {ToMarkdownHandle} */

/** @type {ToOffset} */

/** @type {ToPoint} */

/** @type {Token | undefined} */

/** @type {TokenizeContext['defineSkip']} */

/** @type {TokenizeContext['now']} */

/** @type {TokenizeContext['sliceSerialize']} */

/** @type {TokenizeContext['sliceStream']} */

/** @type {TokenizeContext['write']} */

/** @type {TokenizeContext|undefined} */

/** @type {Tokenizer} */

/** @type {Token|undefined} */

/** @type {Token} */

/** @type {Transformer|void} */

/** @type {Type | HastElement} */

/** @type {Use} */

/** @type {VFile | undefined} */

/** @type {[number, number][]} */

/** @type {[string | null, string | null]} */

/** @type {any} */

/** @type {boolean | undefined} */

/** @type {boolean|undefined} */

/** @type {boolean} */

/** @type {import('./index.js').Schema} */

/** @type {import('unified').Plugin<[Options?] | void[], string, Root>} */

/** @type {import('unist-util-visit-parents/complex-types.js').BuildVisitor<Root, 'text'>} */

/** @type {keyof Extension} */

/** @type {number | undefined} */

/** @type {number[]} */

/** @type {number|undefined} */

/** @type {number} */

/** @type {string | undefined} */

/** @type {string|null} */

/** @type {string} */

/** @type {unknown[]} */

/** @type {unknown} */

/** Error message constants. */

/************************************************************************/

/******/

/***/

//

//          () Skip orphan inside strong  () Consume to delim (1) #***                (2) a***#, a***                   (3) #***a, ***a                 (4) ***#              (5) #***#                 (6) a***a

//        (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left.  (5) and (6) can be either Left or Right.

//  RCDATA state

// "Software"), to deal in the Software without restriction, including

// (`&not`, for instance), which leads to situations where parsing the assumed

// (`parse5` or `hast-util-from-parse5`) looks at it, we can pass nodes

// (flow).

// (unpadded delimiter row), could result in a table.

// * <https://github.com/micromark/micromark-extension-footnote>

// * <https://github.com/syntax-tree/mdast-util-footnote>

// .replace(/\\/g, '&#92;'); // 反斜杠处理：由于渲染使用 dangerouslySetInnerHTML , 双反斜杠只会渲染一个， 改为 实体

// 90px below viewport and offsetTop is 100, it is considered visible.

// :

// ;

// <https://github.com/browserify/path-browserify>.

// <https://github.com/defunctzombie/node-process/blob/master/browser.js>.

// <https://github.com/nodejs/node/blob/master/lib/path.js>.

// <https://github.com/syntax-tree/mdast-util-to-markdown/blob/51a2038/lib/unsafe.js#L57>

// ==-- Parse "addon" extensions --== //

// ==-- Parse "overwrite" extensions --== //

// ==-- Parse WalkTokens extensions --== //

// > a

// > | e |

// > ~~~c

// @ts-expect-error Assume `root` is not a child.

// @ts-expect-error Assume no booleans in `className`.

// @ts-expect-error Assume no booleans in array.

// @ts-expect-error Assume no booleans were in arrays.

// @ts-expect-error Assume no roots in `nodes`.

// @ts-expect-error Constants are fine to assign.

// @ts-expect-error Custom.

// @ts-expect-error Hush, it’s fine!

// @ts-expect-error If there’s a footer, there were definitions, meaning block

// @ts-expect-error If we’ve seen this token, and it was marked as not

// @ts-expect-error Indexable.

// @ts-expect-error It’s fine!

// @ts-expect-error It’s fine.

// @ts-expect-error Looks like a list.

// @ts-expect-error Mark the last token as “walked into” w/o finding

// @ts-expect-error Patch instead of assign required fields to help GC.

// @ts-expect-error Patched

// @ts-expect-error Patched.

// @ts-expect-error Points w/ non-negative `_bufferIndex` reference

// @ts-expect-error Properties are not supported for roots.

// @ts-expect-error Same as above.

// @ts-expect-error Types are out of date.

// @ts-expect-error `Buffer` does allow an encoding.

// @ts-expect-error `_bufferIndex` is used on string chunks.

// @ts-expect-error `defaultConstructs` is full, so the result will be too.

// @ts-expect-error `depth` will be set later.

// @ts-expect-error `node.properties` is set.

// @ts-expect-error `undefined` is fine.

// @ts-expect-error assume `style` is an object

// @ts-expect-error assume no document.

// @ts-expect-error assume this is set.

// @ts-expect-error augmenting an element yields an element.

// @ts-expect-error don’t expect options twice.

// @ts-expect-error don’t expect replace twice.

// @ts-expect-error extra positional info.

// @ts-expect-error looks like a node.

// @ts-expect-error looks like a parent.

// @ts-expect-error looks like a text.

// @ts-expect-error no visitor given, so `visitor` is test.

// @ts-expect-error rest of props added later.

// @ts-expect-error: "

// @ts-expect-error: Assume `Node` can exist as a child of `parent`.

// @ts-expect-error: Assume `parent` accepts `text`.

// @ts-expect-error: Assume static phrasing content.

// @ts-expect-error: TS doesn’t understand basic reality.

// @ts-expect-error: TS doesn’t understand but it’s perfect.

// @ts-expect-error: TS is wrong, some of these children can be text.

// @ts-expect-error: TypeScript is wrong that `textContent` on elements can

// @ts-expect-error: `align` is custom.

// @ts-expect-error: `callback` is defined if `resolve` is not.

// @ts-expect-error: `doc` can’t be a callback anymore, we checked.

// @ts-expect-error: `end` will be patched later.

// @ts-expect-error: `listItem` is most definitely defined, TS...

// @ts-expect-error: `markdown-table` types should support `null`.

// @ts-expect-error: `newable` checks this.

// @ts-expect-error: `parse5` types are wrong.

// @ts-expect-error: `parse5` uses enums, which are actually strings.

// @ts-expect-error: always defined as we give valid input.

// @ts-expect-error: assume `value` matches the expected value of `key`.

// @ts-expect-error: assume a corresponding node is returned by `toHast`.

// @ts-expect-error: assume input `root` matches output root.

// @ts-expect-error: assume not `undefined`.

// @ts-expect-error: assume the stitch is allowed.

// @ts-expect-error: assume valid children are defined.

// @ts-expect-error: change to `null` in a major?

// @ts-expect-error: deprecated.

// @ts-expect-error: fine to set other things.

// @ts-expect-error: fine.

// @ts-expect-error: html and svg both have a space.

// @ts-expect-error: hush

// @ts-expect-error: hush, it sure works as an index.

// @ts-expect-error: hush, it’s actually a `zwitch`.

// @ts-expect-error: hush.

// @ts-expect-error: in practice, null is allowed.

// @ts-expect-error: indexable.

// @ts-expect-error: looks like a position.

// @ts-expect-error: matches!

// @ts-expect-error: micromark types need to accept `null`.

// @ts-expect-error: mutate.

// @ts-expect-error: no `parentNode`

// @ts-expect-error: overloads are handled.

// @ts-expect-error: same as above.

// @ts-expect-error: stack is fine.

// @ts-expect-error: stash this on the node, as it might become a reference

// @ts-expect-error: that’s a state :)

// @ts-expect-error: untyped.

// @ts-expect-error: we always follows the structure of `position`.

// @ts-expect-error: we either bailed on an error or have a tree.

// @ts-expect-error: we’ll add `end` later.

// @ts-ignore

// A colon must be followed by a dash, in which case it could start a

// A correct percent encoded value.

// A correct surrogate pair.

// A delimiter row can also start with a dash, when followed by more

// A derivative work based on:

// A function with keys in its prototype is probably a constructor.

// A paragraph requires a non-blank line.

// A pipe in a cell must be encoded.

// A pipe, when followed by a tab or space (padding), or a dash or colon

// A rather boring computation (to merge adjacent `data` events) which

// API

// API.

// Accept `array`.

// According to github-markdown-css, this class hides bullet.

// Add a final eol.

// Add a hook for the GFM tasklist extension, which needs to know if text

// Add a new text node.

// Add alphanumerics.

// Add eols before nodes, except if this is a loose, first paragraph.

// Add the heading exit at the end.

// Add the marker value for ordered lists.

// Add the prefix start to the HTML line token.

// Add the prefix start to the HTML token.

// After DOCTYPE name state

// After DOCTYPE public identifier state

// After DOCTYPE public keyword state

// After DOCTYPE system identifier state

// After DOCTYPE system keyword state

// After attribute name state

// After attribute value (quoted) state

// Alias methods names because people roll like that.

// Allow `EventEmitter` to be imported as module namespace.

// Alright, so we just added a lazy line:

// Ambiguos ampersand state

// An indented code block cannot interrupt a paragraph.

// And it would need copy/pasting `markdown-table` into this project.

// And we have data.

// Anything else is cell content.

// Anything else is not ok.

// Anything else.

// As in, used in several tools.

// As we can’t escape or so to prevent it from happening, we take a somewhat

// As we’re closing flow, we’re no longer interrupting.

// Assume a reference.

// Assume body cell.

// Assume options.

// At end of string chunk.

// Attribute name state

// Attribute or property.

// Attribute value (double-quoted) state

// Attribute value (single-quoted) state

// Attribute value (unquoted) state

// Before DOCTYPE name state

// Before DOCTYPE public identifier state

// Before DOCTYPE system identifier state

// Before attribute name state

// Before attribute value state

// Between DOCTYPE public and system identifiers state

// Between.

// Blank or interrupting line.

// Bogus DOCTYPE state

// Bogus comment state

// Booleans.

// Btw: note that `atBreak` patterns will always start the regex at LF or

// Bug for unclosed with children.

// Build.

// But I don’t think one tiny line of code can be copyrighted. 😅

// But also if broken HTML is in `raw`, and then a correct element is given.

// But we cannot close unmatched blocks yet, because we may have a lazy

// By explicitly using `prop-types` you are opting into new production behavior.

// C0 except for HT, LF, FF, CR, space

// CDATA section

// CDATA section bracket state

// CDATA section end state

// CDATA section state

// CONCATENATED MODULE: ./node_modules/@ali/dd-desktop-extension/sdk/ExtensionFrame.ts

// CONCATENATED MODULE: ./node_modules/@ali/dd-desktop-extension/sdk/util/Store.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-ability/protocol/domain/message/audioMessage.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-ability/protocol/domain/message/base.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-ability/protocol/domain/message/cardMessage.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-ability/protocol/domain/message/comboForwardMessage.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-ability/protocol/domain/message/dingMessage.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-ability/protocol/domain/message/emotionMessage.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-ability/protocol/domain/message/fileMessage.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-ability/protocol/domain/message/geoMessage.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-ability/protocol/domain/message/imageMessage.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-ability/protocol/domain/message/index.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-ability/protocol/domain/message/menuMessage.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-ability/protocol/domain/message/renderMessage.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-ability/protocol/domain/message/videoMessage.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-framework/lib/abilityProxy.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-framework/lib/clientProxy.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-framework/lib/configProxy.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-framework/lib/context.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-framework/lib/eventBus.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-framework/lib/hostProxy.ts

// CONCATENATED MODULE: ./node_modules/@ali/extension-framework/lib/index.ts

// CONCATENATED MODULE: ./node_modules/@ali/interactionSdk/lib/mock/index.js

// CONCATENATED MODULE: ./node_modules/bail/index.js

// CONCATENATED MODULE: ./node_modules/ccount/index.js

// CONCATENATED MODULE: ./node_modules/hastscript/lib/svg-case-sensitive-tag-names.js

// CONCATENATED MODULE: ./node_modules/hastscript/lib/svg.js

// CONCATENATED MODULE: ./node_modules/mdast-util-find-and-replace/lib/index.js

// CONCATENATED MODULE: ./node_modules/mdast-util-gfm-autolink-literal/lib/index.js

// CONCATENATED MODULE: ./node_modules/mdast-util-gfm-footnote/lib/index.js

// CONCATENATED MODULE: ./node_modules/mdast-util-gfm-task-list-item/lib/index.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/blockquote.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/break.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/code.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/delete.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/emphasis.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/footnote.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/heading.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/html.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/image-reference.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/image.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/index.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/inline-code.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/link-reference.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/link.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/list-item.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/list.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/paragraph.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/root.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/strong.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/table-cell.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/table-row.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/table.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/text.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-markdown/lib/handle/list-item.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-markdown/lib/util/association.js

// CONCATENATED MODULE: ./node_modules/mdast-util-to-markdown/lib/util/safe.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/attention.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/autolink.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/block-quote.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/character-escape.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/character-reference.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/code-fenced.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/code-indented.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/code-text.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/content.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/definition.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/hard-break-escape.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/heading-atx.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/html-text.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/label-end.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/label-start-image.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/label-start-link.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/line-ending.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/list.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/setext-underline.js

// CONCATENATED MODULE: ./node_modules/micromark-core-commonmark/lib/thematic-break.js

// CONCATENATED MODULE: ./node_modules/micromark-factory-destination/index.js

// CONCATENATED MODULE: ./node_modules/micromark-factory-label/index.js

// CONCATENATED MODULE: ./node_modules/micromark-factory-title/index.js

// CONCATENATED MODULE: ./node_modules/micromark-factory-whitespace/index.js

// CONCATENATED MODULE: ./node_modules/micromark-util-character/index.js

// CONCATENATED MODULE: ./node_modules/micromark-util-character/lib/unicode-punctuation-regex.js

// CONCATENATED MODULE: ./node_modules/micromark-util-html-tag-name/index.js

// CONCATENATED MODULE: ./node_modules/micromark/lib/constructs.js

// CONCATENATED MODULE: ./node_modules/micromark/lib/initialize/flow.js

// CONCATENATED MODULE: ./node_modules/property-information/lib/aria.js

// CONCATENATED MODULE: ./node_modules/property-information/lib/html.js

// CONCATENATED MODULE: ./node_modules/property-information/lib/util/case-insensitive-transform.js

// CONCATENATED MODULE: ./node_modules/property-information/lib/util/create.js

// CONCATENATED MODULE: ./node_modules/property-information/lib/util/merge.js

// CONCATENATED MODULE: ./node_modules/property-information/lib/xlink.js

// CONCATENATED MODULE: ./node_modules/property-information/lib/xml.js

// CONCATENATED MODULE: ./node_modules/property-information/lib/xmlns.js

// CONCATENATED MODULE: ./node_modules/react-markdown/lib/ast-to-react.js

// CONCATENATED MODULE: ./node_modules/react-markdown/lib/react-markdown.js

// CONCATENATED MODULE: ./node_modules/react-markdown/lib/rehype-filter.js

// CONCATENATED MODULE: ./node_modules/remark-parse/index.js

// CONCATENATED MODULE: ./node_modules/remark-rehype/lib/index.js

// CONCATENATED MODULE: ./node_modules/style-to-object/index.mjs

// CONCATENATED MODULE: ./node_modules/trough/index.js

// CONCATENATED MODULE: ./node_modules/unified/lib/index.js

// CONCATENATED MODULE: ./node_modules/unified/node_modules/is-plain-obj/index.js

// CONCATENATED MODULE: ./node_modules/vfile-message/lib/index.js

// CONCATENATED MODULE: ./node_modules/vfile-message/node_modules/unist-util-stringify-position/lib/index.js

// CONCATENATED MODULE: ./node_modules/vfile/lib/index.js

// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER

// CR.

// Call transforms.

// Can’t be empty when interrupting.

// Can’t be space or eols at the start of a construct, so we’re in a cell.

// Change the `labelImageMarker` to a `data`.

// Change the paragraph to setext heading text.

// Character before or after matched:

// Character escape.

// Character reference helpers

// Character reference state

// Character reference.

// Character references hang, so if we ended there, we need to flush

// Check for task list items

// Check if current bullet point can start a new List Item

// Check if current line is blank

// Check if following lines should be included in List Item

// Check if module is in cache

// Check if there is a new container.

// Check if visibility is wanted via offset?

// Check the next.

// Child tokens to be visited by walkTokens

// Class names (which can be added both on the `selector` and here).

// Classes’ prototype methods are not enumerable, so we check if some value

// Clip maskedSrc to same section of string as src (move to lexer?)

// Closing fence.

// Closing fence?

// Closing.

// Collapsed (`[asd][]`) or full (`[asd][fgh]`) reference?

// Combine separate content parts into one.

// Comment end bang state

// Comment end dash state

// Comment end state

// Comment less-than sign bang dash dash state

// Comment less-than sign bang dash state

// Comment less-than sign bang state

// Comment less-than sign state

// Comment start dash state

// Comment start state

// Comment state

// CommonMark Emphasis Rules 9-10

// CommonMark handles attention (emphasis, strong) markers based on what comes

// CommonMark requires space before trailing #s

// Control character (DEL) of the basic block and C1 controls.

// Copy non-nullish input into values.

// Copyright (c) 2013 James Halliday

// Copyright Joyent, Inc. and other Node contributors.

// Core options:

// Could also be data.

// Create 'strong' if smallest delimiter has even char count. **a***

// Create `<code>`.

// Create `<pre>`.

// Create `em` if smallest delimiter has odd char count. *a***

// Create a new list item.

// Create a new module (and put it into the cache)

// Create a new processor based on the processor in the current scope.

// Creaters.

// Currently doesn’t work because `inspect` in document does a check

// Currently only replacement character.

// Currently, a warning is triggered by react for *any* white space in

// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR

// DOCTYPE name state

// DOCTYPE public identifier (double-quoted) state

// DOCTYPE public identifier (single-quoted) state

// DOCTYPE state

// DOCTYPE system identifier (double-quoted) state

// DOCTYPE system identifier (single-quoted) state

// Data management.

// Data state

// Data.

// Decimal character reference start state

// Decimal character reference state

// Dedent if possible

// Default behavior is to show (encoded) HTML.

// Defaults are used to prevent crashes when older utilities somehow activate

// Delete `remove` items starting from `start`

// Deprecated options for calculating offset.

// Deprecated: update.extend, update.isEquals and update.newContext

// Discard the duplicate exits.

// Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic

// Done!

// Done.

// Don’t do anything if there is one data token.

// EOF as the content is closed with blank lines.

// EOF or whitespace

// EOF), that’s perfect: the last point we found starts it.

// EOF, whitespace, pipe

// EOF.

// EOL.

// ESM COMPAT FLAG

// ESM support

// EXPORTS

// EXTERNAL MODULE: ./node_modules/@ali/dd-desktop-extension/node_modules/object-hash/dist/object_hash.js

// EXTERNAL MODULE: ./node_modules/@ali/dingtalk-jsapi/api/internal/chat/getTopic.js

// EXTERNAL MODULE: ./node_modules/@ali/dingtalk-jsapi/entry/mobile.js

// EXTERNAL MODULE: ./node_modules/@ali/extension-ability/protocol/config/ding.ts

// EXTERNAL MODULE: ./node_modules/@ali/extension-ability/protocol/config/emotion.ts

// EXTERNAL MODULE: ./node_modules/@ali/extension-ability/protocol/domain/app.ts

// EXTERNAL MODULE: ./node_modules/@ali/extension-ability/protocol/domain/media.ts

// EXTERNAL MODULE: ./node_modules/@ali/extension-ability/protocol/domain/userProfile.ts

// EXTERNAL MODULE: ./node_modules/@ali/interactionSdk/node_modules/immutability-helper/index.js

// EXTERNAL MODULE: ./node_modules/decode-named-character-reference/index.dom.js

// EXTERNAL MODULE: ./node_modules/eventemitter3/index.js

// EXTERNAL MODULE: ./node_modules/extend/index.js

// EXTERNAL MODULE: ./node_modules/hast-util-whitespace/index.js

// EXTERNAL MODULE: ./node_modules/hastscript/lib/core.js

// EXTERNAL MODULE: ./node_modules/is-buffer/index.js

// EXTERNAL MODULE: ./node_modules/jsuri/Uri.js

// EXTERNAL MODULE: ./node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js

// EXTERNAL MODULE: ./node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js

// EXTERNAL MODULE: ./node_modules/mdast-util-to-hast/lib/index.js

// EXTERNAL MODULE: ./node_modules/mdast-util-to-hast/lib/revert.js

// EXTERNAL MODULE: ./node_modules/mdast-util-to-markdown/lib/util/check-bullet.js

// EXTERNAL MODULE: ./node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js

// EXTERNAL MODULE: ./node_modules/mdast-util-to-markdown/lib/util/container-flow.js

// EXTERNAL MODULE: ./node_modules/mdast-util-to-markdown/lib/util/indent-lines.js

// EXTERNAL MODULE: ./node_modules/mdast-util-to-markdown/lib/util/track.js

// EXTERNAL MODULE: ./node_modules/micromark-core-commonmark/lib/blank-line.js

// EXTERNAL MODULE: ./node_modules/micromark-factory-space/index.js

// EXTERNAL MODULE: ./node_modules/micromark-util-character/index.js + 1 modules

// EXTERNAL MODULE: ./node_modules/micromark-util-chunked/index.js

// EXTERNAL MODULE: ./node_modules/micromark-util-classify-character/index.js

// EXTERNAL MODULE: ./node_modules/micromark-util-decode-string/index.js

// EXTERNAL MODULE: ./node_modules/micromark-util-normalize-identifier/index.js

// EXTERNAL MODULE: ./node_modules/micromark-util-resolve-all/index.js

// EXTERNAL MODULE: ./node_modules/micromark-util-sanitize-uri/index.js

// EXTERNAL MODULE: ./node_modules/micromark/lib/initialize/text.js

// EXTERNAL MODULE: ./node_modules/prop-types/index.js

// EXTERNAL MODULE: ./node_modules/property-information/index.js + 9 modules

// EXTERNAL MODULE: ./node_modules/property-information/lib/normalize.js

// EXTERNAL MODULE: ./node_modules/property-information/lib/util/case-sensitive-transform.js

// EXTERNAL MODULE: ./node_modules/property-information/lib/util/defined-info.js

// EXTERNAL MODULE: ./node_modules/property-information/lib/util/schema.js

// EXTERNAL MODULE: ./node_modules/property-information/lib/util/types.js

// EXTERNAL MODULE: ./node_modules/react-markdown/lib/uri-transformer.js

// EXTERNAL MODULE: ./node_modules/react-markdown/node_modules/react-is/index.js

// EXTERNAL MODULE: ./node_modules/react/index.js

// EXTERNAL MODULE: ./node_modules/remark-parse/lib/index.js

// EXTERNAL MODULE: ./node_modules/rxjs/Rx.js

// EXTERNAL MODULE: ./node_modules/trim-lines/index.js

// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.js

// EXTERNAL MODULE: ./node_modules/unist-util-position/lib/index.js

// EXTERNAL MODULE: ./node_modules/unist-util-visit-parents/lib/index.js

// Each block imposes a condition that the line must satisfy if the block is

// Either a blank line, which is okay, or an indented thing.

// Element.

// End tag open state

// Ensure no React warnings are emitted for void elements w/ children.

// Ensure the last empty entry is seen.

// Enter.

// Escape characters with special meaning either inside or outside character sets.

// Escape.

// Especially putting it back in the `data` state is useful: some elements,

// Everything in between.

// Execute the module function

// Exit

// Exit if not in the first content that is the first child of a list

// Exit if there was no dash at all, or if the header cell count is not the

// Exit if there’s stuff before.

// Exit if this is the closing fence.

// Exit if we’re not done, resolve might change stuff.

// Exit if we’ve walked far enough.

// Exit open containers.

// Exit, then change the type.

// Exit: there’s still something open, which means it’s a lazy line

// Expose a frozen processor.

// Expose the prefix.

// Expose the previous character.

// Expose.

// Extend the base object

// Extension does not match, so our result is the entire path

// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR

// Fail on non-nodes.

// Feel free to add other non-standard fields to your messages.

// Fields from `Error`.

// Figure out `root` position.

// Figure out which alignments to use.

// Filter options:

// Find a token that can close.

// Find a token that can open the closer.

// Find a void token that includes a break.

// Find an opening.

// Find first non-space char

// Find the flow chunk.

// Find the opening of the content.

// Find the position of the event for this token.

// Find the previous chunk (the one before the lazy line).

// Fine.

// First we iterate through the open blocks, starting with the root

// First/last cell in a row cannot be empty if it has no leading/trailing pipe

// Fix position.

// Fix positions.

// Flag the module as loaded

// For `www.` we check instead of attempt, because when it matches, GH

// For example, a block quote requires a `>` character.

// For example, if someone injected the string `'\n# b'`, then that would

// From: <https://github.com/nodejs/node/blob/fcf8ba4/lib/internal/url.js#L1501>

// Function to check for start of token

// Function to create the first processor.

// GH documents that only alphanumerics (other than `-`, `.`, and `_`) can

// Generate a body row when without parent.

// Get `key`.

// Get next list item

// Get ready for the next line.

// Get space.

// HTML whitespace expression.

// Hack: `value` is supposed to be a string, but as none of the tools

// Handle `data.hName`, `data.hProperties, `data.hChildren`.

// Handle a deep copy situation

// Handle children.

// Handle props.

// Handle tokens still being open.

// Handlers.

// Haven't found enough closing delimiters

// Having a single line break doesn't mean a list is loose. A single line break is terminating the last list item

// Help GC.

// Hexademical character reference start state

// Hexademical character reference state

// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS

// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN

// If `Object.create(null)` is not supported we prefix the event names with a

// If `includeElementIndex` is given, pass node index info to components.

// If `sourcePos` is given, pass source information (line/column info from markdown source).

// If it did, we exit the current containers between the two flow blocks.

// If the decoded string is equal to the input, the character reference was

// If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.

// If the markers are the same:

// If the named character reference is followed by the end of the path, it’s

// If the opening can close or the closing can open,

// If the previous item ended with a blank line, the list is loose

// If the punctuation marker is followed by the end of the path, it’s not

// If the sizes are the same:

// If there are more markers in the closing, add them after.

// If there are more markers in the opening, add them before.

// If there are two in a row, use one.

// If there is a previous code, there will always be a tail.

// If there is a single grave accent on its own in the code, use a fence of

// If there isn’t then make sure any remaining content is added to it.

// If there’s one more token (which is the cases for lines that end in an

// If this character is supposed to be escaped because it has a condition on

// If this is a lazy line, it can’t be code.

// If this is not just spaces or eols (tabs don’t count), and either the

// If this is our first dot, mark it as the start of our extension.

// If this is the third marker, exit.

// If we do have fields, create an object w/ `context` as its

// If we do have flow, it could still be a blank line,

// If we encounter a new block start, we close any blocks unmatched in

// If we have concrete content, such as block HTML or fenced code,

// If we have definitions in the content, we’ll keep on having content,

// If we have to use a character reference, an ampersand would be more

// If we reached a path separator that was not part of a set of path

// If we see another link, or inactive link label, we’ve been here before.

// If we start and end with an EOL or a space.

// If we start with a pipe, we open a cell marker.

// If we’re at a hard break, include the line ending in there.

// If we’re in a buffer chunk, loop through it.

// Ignore NaN.

// Ignore nullish and NaN values.

// Ignore nullish and `NaN` values.

// Important!

// In code.

// In early versions of node, obj['__proto__'] is buggy when obj has

// In fact adds to the bundle size.

// In some cases, html (text) can be found in phrasing right after an eol.

// In this case, that second line is lazy, which “unmakes” the first line

// In this phase we may match all or just some of the open blocks.

// Increment the end 1 character.

// Indented code can interrupt delimiter and body rows.

// Inject the alignment row.

// Inject the exits earlier (they’re still also at the end).

// Insert the items in chunks to not cause stack overflows.

// Instead of some new production for Unicode alphanumerics, markdown

// It *could* be a table, from the first line, if the following line

// It wasn’t a match after all.

// Item child tokens handled here at end because we needed to have the final item to trim it first

// Items begin with at most one blank line

// It’ll always exist: we don’t tokenize if it isn’t there.

// It’s a balanced bracket, but contains a link.

// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.

// Label ends in not allowed character.

// Layout options:

// Legacy.

// Length of suffix matching the invert condition.

// Like GitHub, add a class for custom styling.

// Lists. Use CSS to reduce space between items instead

// Load entry module and return exports

// Lock.

// Lone high surrogates and low surrogates.

// Looks weird, but ensures we get correct positional info.

// Loop forward through the linked tokens to pass them in order to the

// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN

// MIT License

// Mac 转换 emoji 为图片

// Make start between zero and `end` (included).

// Making it correct would be impossible due to aligning cells?

// Mark as consumed.

// Mark other link openings as inactive, as we can’t have links in

// Markup declaration open state

// Mask out escaped em & strong delimiters

// Mask out other blocks

// Mask out reflinks

// Media close.

// Merge adjacent spaces and data.

// Mimick CM behavior of link definitions.

// More dashes.

// More or less accents: mark as data.

// More.

// Most constructs in markdown match on the first line: if the first line

// Most props are space-separated.

// Must start with a space or a tab.

// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,

// NOTE: err reporting is noop by default. Enabled by mixin.

// NOTE: generate location info for elements

// Named character reference state

// Never move original objects, clone them

// Next or done.

// Next, after consuming the continuation markers for existing blocks, we

// No need to `check` whether there’s a container, of `exitContainers`

// No need to chunk the items if there’s only a couple (10k) items.

// Node.

// Nodes created by plugins do not have positional info, in which case we use

// Non-standard Properties.

// Noncharacters.

// Normalize the name.

// Normalize the path according to POSIX rules.

// Not an expected previous character.

// Not in a string chunk.

// Not own constructor property must be Object

// Not standard.

// Note: `normalize` is not exposed as `path.normalize`, so some code is

// Note: blank lines can’t exist in content.

// Note: can also be undefined.

// Note: performance of this is fine on an mb of normal markdown, but it’s

// Note: the `<MdastRoot, HastRoot>` overload doesn’t seem to work :'(

// Note: the positional info as used here is incorrect.

// Note: there are also `identifier` and `label` fields on this link node!

// Note: these options are not in the readme.

// Note: this algorithm for moving events around is similar to the

// Note: this field is called `_closeFlow` but it also closes containers.

// Note: this function is normally not called: see `table-row` for how rows

// Note: we specifically use `in` instead of `hasOwnProperty` to accept

// Nothing.

// Now splice the events from the subtokenizer into the current events,

// Now walk back to find an opener.

// Now, loop back through all events (and linked tokens), to figure out which

// Number

// Number of markers to use from the sequence.

// Numeric character reference end state

// Numeric character reference state

// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF

// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE

// Object.prototype.hasOwnProperty.call

// One such difference is if those characters are Unicode punctuation.

// Only deal with non-null/undefined values

// Only look for `atBreak`s.

// Opening marker.

// Opening.

// Or:

// Other extensions

// Otherwise, improper indentation ends this item

// Otherwise, resolve, and exit.

// Out of range

// Overwrite the default code text data handler to unescape escaped pipes when

// Own properties are enumerated firstly, so to speed up,

// PLAINTEXT state

// Parts of that are extracted from Node’s internal `path` module:

// Perhaps a good idea to rename it but it’s already used in the wild by

// Permission is hereby granted, free of charge, to any person obtaining a

// Permission is hereby granted, free of charge, to any person obtaining a copy of

// Pipes work, backslashes don’t (but can’t escape pipes).

// Plugin options:

// Plugins.

// Point.

// Position.

// Prefix `--` is important to not run on `0`.

// Prefix whitespace, part of the opening.

// Prevent never-ending loop

// Process final characters if they’re still there after hibernating.

// Props.

// Prototypes do exist.

// RAWTEXT end tag name state

// RAWTEXT end tag open state

// RAWTEXT less-than sign state

// RAWTEXT state

// RCDATA end tag name state

// RCDATA end tag open state

// RCDATA less-than sign state

// Re-align to follow commonmark nesting rules

// Recurse if we're merging plain objects or arrays

// Recurse, because to somewhat handle `[<x>]</x>` (where `[]` denotes the

// Reference, resource, or so.

// Reference.

// Remove extra characters. *a*** -> *a*

// Remove remaining sequences.

// Remove the content end (if needed we’ll add it later)

// Remove the line prefix.

// Remove the marker.

// Renderer extensions

// Replace extension with func to run new extension but fall back if false

// Replace renderer with func to run extension, but fall back if false

// Replace tokenizer with func to run extension, but fall back if false

// Replacement character, exit.

// Reset location tracker:

// Reset preprocessor mixin:

// Reset preprocessor:

// Reset the array, or remove it completely if we have no more listeners.

// Reset tokenizer:

// Resource: `[asd](fgh)`.

// Restore parent schema.

// Return nothing for nodes that are ignored.

// Return the exports of the module

// Return the modified object

// Rules for checking different kind of offsets. In example if the element is

// Run any renderer extensions

// SEMI_COLON_SEPARATED

// Safely stringify Object.create(null)

// Save the newly created `output` for the next call.

// Script data double escape end state

// Script data double escape start state

// Script data double escaped dash dash state

// Script data double escaped dash state

// Script data double escaped less-than sign state

// Script data double escaped state

// Script data end tag name state

// Script data end tag open state

// Script data escape start dash state

// Script data escape start state

// Script data escaped dash dash state

// Script data escaped dash state

// Script data escaped end tag name state

// Script data escaped end tag open state

// Script data escaped less-than sign state

// Script data escaped state

// Script data less-than sign state

// Script data state

// See <https://infra.spec.whatwg.org/#ascii-whitespace>.

// See GH-11.

// See GH-7.

// See the code for `parse` and `parseFragment`:

// See: <https://github.com/facebook/react/pull/7081>.

// See: <https://github.com/facebook/react/pull/7515>.

// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/extensions/location-info/tokenizer-mixin.js#L95>.

// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/extensions/location-info/tokenizer-mixin.js>.

// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/extensions/position-tracking/preprocessor-mixin.js>.

// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/parser/index.js#L371>.

// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/tokenizer/index.js#L218-L234>.

// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/tokenizer/preprocessor.js#L17>.

// See: <https://github.com/inikulin/parse5/issues/109>.

// See: <https://github.com/nodejs/node/blob/fcf8ba4/lib/internal/url.js>

// See: <https://github.com/remarkjs/react-markdown/issues/576>.

// See: <https://github.com/remarkjs/remark-react/issues/64>.

// See: <https://github.com/sindresorhus/github-markdown-css>.

// See: <https://github.com/syntax-tree/mdast-util-definitions/blob/8290999/index.js#L26>.

// See: <https://github.com/syntax-tree/mdast-util-to-markdown/issues/15>

// See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis

// Self-closing start tag state

// Set `key`.

// Set non-path related properties.

// Set path related properties in the correct order.

// Set space.

// Set the non-safe value.

// Several table elements. When `align=char`, sets the character to align on

// Several table elements. When `char`, offsets the alignment

// Several. Use CSS `text-align` instead,

// Several. Use CSS `vertical-align` instead

// Silent.

// Similar to:

// Size note: removing ASCII from the regex and using `asciiPunctuation` here

// Skip enter/exit of line ending, line prefix, and content.

// Skip first.

// So assume `node` is a parent node.

// So we drop it.

// Some named character references do not require the closing semicolon

// Some nodes can break out of their context if they don’t have a certain

// Somewhat based on:

// Source code location

// Special logic: when in mobile miniApp runtime, only use dd.addDTChannelEventListener to listener

// Special whitespace codes (which have negative values), C0 and Control

// Standard Properties.

// State machine

// State management.

// Step left until we fail to match the invert condition.

// Still, try to consume at most the items size.

// String with links masked to avoid interference with em and strong

// Suffix whitespace, part of the closing.

// Support CRLF (patterns only look for one of the characters).

// Switch container exit w/ line endings.

// Switch content.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

// TODO parse inline content if parameter markdown=1

// Tabs don’t work, and virtual spaces don’t make sense.

// Tag name state

// Tag open state

// Take the `labelImageMarker` (now `data`, the `!`)

// Tell whether the rect is visible, given an offset

// Text close, marker close, label close.

// Text open.

// The "after after body" insertion mode

// The "after after frameset" insertion mode

// The "after body" insertion mode

// The "after frameset" insertion mode

// The "after head" insertion mode

// The "before head" insertion mode

// The "before html" insertion mode

// The "in body" insertion mode

// The "in caption" insertion mode

// The "in cell" insertion mode

// The "in column group" insertion mode

// The "in frameset" insertion mode

// The "in head no script" insertion mode

// The "in head" insertion mode

// The "in row" insertion mode

// The "in select" insertion mode

// The "in table body" insertion mode

// The "in table text" insertion mode

// The "in table" insertion mode

// The "in template" insertion mode

// The "initial" insertion mode

// The "text" insertion mode

// The (right-most) trimmed path component is exactly `..`.

// The `[`

// The `^` marker

// The `^`.

// The above copyright notice and this permission notice shall be included

// The above copyright notice and this permission notice shall be included in all

// The below are non-standard, they are “well-known”.

// The construct in the second example (fenced code) does not accept lazy

// The construct in the third example is potentially a GFM table, and

// The ending (`]`, properly parsed and labelled).

// The following fields are “well known”.

// The goal is for them to be set by plugins on `data` instead of being

// The module cache

// The only thing left to do is to throw the thing instead.

// The require function

// The rules for parsing tokens in foreign content

// The table-related elements that must not contain whitespace text according

// The token starts before the line ending…

// The whole (without `!`):

// Then one single call to the relevant state does the trick, parse5

// Then we have padding.

// There *must* be at least one hyphen-minus in each alignment cell.

// These are used / cleaned here.

// These inline notes are not used in GFM.

// These were camelcased in Tiny. Now lowercased in SVG 2

// This allows a “live binding”, which is needed for `interrupt`.

// This hack is needed because the `__proto__` property is still inherited in

// This is a check, so we don’t care about tokens, but we open a bogus one

// This is a stricter version than the built in check for lists, thematic

// This is a superfluous loop if we don’t align delimiters, but otherwise we’d

// This is on by default already.

// This module is generated by `script/`.

// This script is generated from the Unicode data.

// To do next major: don’t return the given tree.

// To do: add more extension tests.

// To do: clean.

// To do: does this work to reset tracker?

// To do: micromark: create a registry of tokens?

// To do: next major, use `node.lang` w/o regex, the splitting’s been going

// To do: next major: add `options` to state, remove:

// To do: next major: always return a single `root`.

// To do: next major: always return array.

// To do: next major: always return root?

// To do: next major: deep clone.

// To do: next major: do not expose, keep bound.

// To do: next major: don’t return given `Node` from `enter`.

// To do: next major: don’t return points when invalid.

// To do: next major: expose `undefined` everywhere instead of `null`.

// To do: next major: expose functions.

// To do: next major: move to `state.options.allowDangerousHtml`.

// To do: next major: move to `state.options`.

// To do: next major: remove `augment`.

// To do: next major: remove `find` & `replace` combo, remove schema.

// To do: next major: remove setter/getter.

// To do: next major: remove.

// To do: next major: rename `context` -> `state`, `safeOptions` -> `info`, use

// To do: next major: rename `context` -> `state`, `safeOptions` to `info`, use

// To do: next major: replace exports with functions.

// To do: next major: replace utility with `definitionById` object, so we

// To do: next major: return `undefined` when not found.

// To do: next major: return `undefined`.

// To do: next major: use `defaultHandlers.inlineCode`.

// To do: next major: use `defaulthandlers.listItem`.

// To do: next major: use `state` and `state` utilities from `mdast-util-to-markdown`.

// To do: not needed to store if there is no bogus state, probably?

// To do: remove in a major.

// To do: see if we van clean this? Can we merge texts?

// To do: use structured clone.

// To do: when both:

// To match how GH works in comments, use `markdownSpace` (`[ \t]`) instead

// Tokenizer Extensions

// Tools.

// Track prevChar before string of ____ started

// Transform options:

// Transforming the node resulted in an element with a different name

// Treat `www` as part of the domain.

// Treat indented code blocks (> 4 spaces) as having only 1 indent

// Try another.

// Try new containers.

// Try to match the explicit extension.

// Try to parse a blank line.

// Try to parse initial flow (essentially, only code).

// Turn it into a property.

// Turn it into an attribute.

// UNUSED EXPORTS: DataFlowType, DisplayNameModel, ENV, EmotionType, InteractionSdkManager, SortType, closePage, focusMessage, getTopicEmotions, previewMsg

// UNUSED EXPORTS: appendParamToUrl, isUrlHostHasPunycode, makeUrlOpenInApp, makeUrlOpenInWorkspace, transformUrlToPageLink, transformUrlToWorkspaceLink, tryTransformUrlToPageLink, urlSafeFilter, wrapperWithQrcode

// UNUSED EXPORTS: find, hastToReact, normalize

// USE OR OTHER DEALINGS IN THE SOFTWARE.

// Unicode.

// Unpack if possible and when not given a `root`.

// Unravel the next token.

// Until blank line, item doesn't need indentation

// Untyped token.

// 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.

// Walk any extensions

// Walk through all events.

// We can instead immediately `attempt` to parse one.

// We can now either have a definition or a paragraph.

// We can’t escape characters in `inlineCode`, but because eols are

// We can’t have blank lines in content, so no need to worry about empty

// We either found spaces…

// We have a blank line.

// We have a potential problem: certain characters after eols could result in

// We matched the extension, so mark this as the end of our path

// We preprocess lists to add `listItem` tokens, and to infer whether

// We reset the preprocessor as if the document ends here.

// We saw a non-dot and non-path separator before our dot, so we should

// We saw a non-dot character immediately before the dot.

// We saw the first non-path separator

// We saw the first non-path separator, mark this as the end of our

// We saw the first non-path separator, remember this index in case

// We try to not inherit from `Object.prototype`. In some engines creating an

// Well, this is quite the pickle.

// We’re always in a paragraph, in a list item.

// We’ve now parsed the non-lazy and the lazy line, and can figure out

// When we encounter a trailing semicolon after parsing, and the character

// When we’d serialize that, in most cases that would be seen as html

// Which is licensed:

// While we do continue, we signal that the flow should be closed.

// _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well

// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.

// __webpack_public_path__

// `<applet>`

// `<area>`. Use no href instead of an explicit `nohref`

// `<body>`

// `<body>` and table elements. Use CSS `background-color` instead

// `<body>`. Use CSS `a:active {color}` instead

// `<body>`. Use CSS `a:link {color: *}` instead

// `<body>`. Use CSS `a:visited {color}` instead

// `<body>`. Use CSS `background-image` instead

// `<body>`. Use CSS `color` instead

// `<br>`. Use CSS `clear` instead

// `<font>` and `<hr>`. Use CSS instead

// `<font>`. Use CSS instead

// `<frame>`

// `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`

// `<frame>`. Use overflow in the child context

// `<head>`

// `<hr>`. Use background-color and height instead of borders

// `<html>`. Use a doctype.

// `<iframe>`. Use CSS `border` instead

// `<img>` and `<object>`

// `<img>`. Use a `<picture>`

// `<isindex>`

// `<link>`

// `<meta>`

// `<object>`

// `<object>`. List of URIs to archives

// `<param>`

// `<script>`

// `<table>`

// `<table>`. Use CSS `border-color` instead,

// `<table>`. Use CSS `border-width` instead,

// `<td>` and `<th>`

// `<td>` and `<th>`. Use `scope` on `<th>`

// ```

// ```markdown

// `dangerous`, `clobberPrefix`, `footnoteLabel`, `footnoteLabelTagName`,

// `footnoteLabelProperties`, `footnoteBackLabel`, `passThrough`,

// `hast`

// `isPlainObj` unfortunately uses `any` instead of `unknown`.

// `markdown-table` will always add an align row

// `middleware` received a callback and called it synchronously, but that

// `track` from `state`.

// `unknownHandler`.

// `vfile`s too.

// `xast`

// `|`

// a bottleneck for malicious stuff.

// account for partial visibility on a single edge

// after `www.`, but that’s not how it’s implemented by them).

// algorithm when closing flow in `documentContinue`.

// algorithm when dealing with lazy lines in `writeToChild`.

// already has that for Unicode punctuation and whitespace, so use those.

// an object that matches the position interface.

// ancestor.

// and the close size *is not* a multiple of three,

// and their cells are compiled.

// and turns the whole into one content block.

// anything.

// autolink

// b.

// before it to distinguish it from an escaped pipe

// before or after them.

// block.

// blockquote

// blocks being seen.

// br

// breaks, and setex heading underlines though:

// but the sum of the opening and closing size *is* multiple of three,

// but we might need to add _that_

// but we need move it.

// but we’d be interrupting it w/ a new container if there’s a current

// by not storing.

// cell child tokens

// character DEL

// character to make sure that the built-in object properties are not

// check for partial visibility

// clean the cache about current eventName

// clean up event listeners and their debounce callers

// code

// commonmark requires matching angle brackets

// component

// console

// construct.

// consumes the whole token.

// content.

// continuation line.

// continued punctuation.

// copied from https://stackoverflow.com/a/5450113/806777

// copies or substantial portions of the Software.

// copy of this software and associated documentation files (the

// correct, but as backslashes only care about punctuation, either will

// create a fake namespace object

// d

// dashes, a colon, or a pipe.

// def

// define __esModule on exports

// define getter function for harmony exports

// del (gfm)

// delimiter cell count.

// delimiter row.

// deprecated offset property

// distribute, sublicense, and/or sell copies of the Software, and to permit

// do extended autolink path validation

// do superfluous work when aligning, so optimize for aligning.

// do the trick

// document, and descending through last children down to the last open

// em & strong

// ending angle bracket cannot be escaped

// ensure that every cell-delimiting pipe has a space

// error log

// escape

// eslint-disable-line new-cap

// eslint-disable-next-line max-depth

// eslint-disable-next-line max-params

// eslint-disable-next-line no-self-compare

// eslint-disable-next-line unicorn/prefer-default-parameters

// exists in the prototype.

// explicitly match decimal, hex, and named HTML entities

// expose the module cache

// expose the modules object (__webpack_modules__)

// extension.

// extensions

// extensions.

// f

// fences

// fences not supported

// find closing parenthesis

// first or last character are a space, eol, or tick, then pad with spaces.

// following conditions:

// forms a construct, a non-lazy line can’t “unmake” it.

// found another Left Delim

// getDefaultExport function for compatibility with non-harmony modules

// have a good chance at having a non-empty extension.

// having any unbalanced bracket before it, we can exit.

// header

// header child tokens

// heading

// hr

// html

// http://fb.me/prop-types-in-prod

// http://www.w3.org/TR/CSS21/grammar.html

// https://github.com/joshwnj/react-visibility-sensor/pull/114

// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027

// https://tools.ietf.org/html/rfc3986#section-3

// if dont need delayed call, check on load ( before the first interval fires )

// if last one is own, then all properties are own.

// if the component has rendered to null, dont update visibility

// if there's a single \n as a spacer, it's terminating the last line,

// if we have minimum top visibility set by props, lets check, if it meets the passed value

// ignore IDs

// improves mm performance by 29%.

// in all copies or substantial portions of the Software.

// instance in this way is faster than calling `Object.create(null)` directly.

// interruption rules of commonmark and the original markdown spec:

// invariants

// is in the first content of a list item.

// item.

// items the list itself are spread out.

// later.

// leading or trailing whitespace is ignored per the gfm spec

// lheading

// like textareas and iframes, change the state.

// lines, so it marked itself as done at the end of its first line, and

// link

// links.

// list

// list of punctuation marks from CommonMark spec

// look for new block starts (e.g. `>` for a block quote).

// manually removed from it.

// matches a condition.

// matching was not complete.

// mode & 1: value is a module id, require it

// mode & 2: merge all properties of value into the ns

// mode & 4: return value when already ns object

// mode & 8|1: behave like require

// moving back to front so that splice indices aren’t affected.

// named reference of `&notit;` will result in the string `¬it;`.

// newline

// no need for block level renderers

// non-whitespace after that line ending, because otherwise we’d get an

// noop

// not continued punctuation.

// not valid.

// notify the parent when the value changes

// occur, which sounds like ASCII only, but they also support `www.點看.com`,

// of `markdownLineEndingOrSpace` (`[ \t\r\n]`).

// on for years in remark now.

// only walk once (as we need footnotes too).

// overridden or used as an attack vector.

// parse child tokens inside headers and cells

// part of something.

// parts belong where.

// passed by users.

// passed through node).

// path component.

// pedantic allows starting angle bracket without ending angle bracket

// persons to whom the Software is furnished to do so, subject to the

// prettier-ignore

// prevent inlineText consuming extensions by clipping 'src' to extension start

// prevent paragraph consuming extensions by clipping 'src' to extension start

// prop

// prototype.

// re-register node in componentDidUpdate if children diffs [#103]

// reasonable approach: replace that eol with a space.

// reference to decode was not a semicolon (`&semi;`), we can assume that the

// reflink, nolink

// regex template, placeholders will be replaced according to different paragraph

// remove trailing #s

// result in an ATX heading.

// return '';

// return MarkdownRender(str, markdownOptions, log)

// return: boolean

// separators at the end of the string, stop now.

// sequences em should skip over [title](link), `code`, <html>

// skip single * in __abc*abc__

// skip the boolean and the target

// so if for instance element is at least 200px in viewport, then show it.

// so move it there so that we don't get unecessary paragraph tags

// so that’s Unicode.

// so we’re valid.

// some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.

// split pedantic href and title

// start.

// step 1 before creating the new block as a child of the last matched

// strings.

// subject to the following conditions:

// subtokenizer.

// table (gfm)

// tables.

// tag

// text

// than wanted:

// that remains on open element stack

// the Software without restriction, including without limitation the rights to

// the Software, and to permit persons to whom the Software is furnished to do so,

// the next character, and the next character is definitly being escaped,

// them out.

// then don’t match.

// then skip this escape.

// then the content construct parses `d`.

// they are in tables.

// this code.

// this software and associated documentation files (the "Software"), to deal in

// this.tryUnSubscribeEvent(eventName);

// those are *weird*.

// those too.

// threw an error.

// through.

// throw error in case of non string input

// to React.

// to remain open.

// tokens.

// top-level paragraph

// transformed to spaces when going from markdown to HTML anyway, we can swap

// treats it as part of a domain (yes, it says a valid domain must come

// two.

// type-coverage:ignore-next-line

// url (gfm)

// url 包含尺寸信息

// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of

// utilities on `state`.

// val

// w/o a bogus, which doesn’t make sense. But it does seem to help perf

// we can ignore everything in base after the last slash of its path component,

// we can’t have containers “pierce” into them, so we can immediately

// we need it if the extension ends up not matching.

// webpackBootstrap

// when pc

// whether the lazy line started a new flow block.

// without * and _ to handle the different emphasis markers * and _

// without limitation the rights to use, copy, modify, merge, publish,

// would be moot.

// yield `null`.

// …and either is not ended yet…

// …are archived, remove this (also from mdast).

// …or ends after it.

// …or it was followed by a line ending, in which case, there has to be

// 从图片后缀往前面取尺寸

// 保存监听的listener以及option

// 兼容粗体的“**”与文字之间多了一个空格

// 去除 code 相关判断（不使用  walkTokens）

// 如：测试 ** 粗体 ** 非粗体

// 将 @openId 转换为 @name

// 尝试注册事件，如果返回了数据，则作为缓存事件抛出

// 尝试注销事件

// 当第一次监听的时候(内存里没有数据)

// 时序有点复杂，后续考虑不调用unSubscribeEvent

// 禁止单波浪线 解析del

// 记录取消监听的promise

// 记录正在监听的promise

// 设置了使用缓存的才吐回缓存

// 转义 "， 避免标签被闭合

// 转换 openId  为 name

// 避免类似文本： <font color="red" background-color="black">xxx</font>， 旧正则获取到错误的 color

// 非Mac，转换 emoji 为 图片来展示

//(details: https://github.com/inikulin/parse5/tree/master/scripts/generate-named-entity-data/README.md)

//(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#preprocessing-the-input-stream)

//(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#adoptionAgency)

//(see: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/fromCharCode#Getting_it_to_work_with_higher_values)

//--

//------------------------------------------------------------------

/// <reference lib="dom" />

//1)NULL_CHARACTER_TOKEN - \u0000-character sequences (e.g. '\u0000\u0000\u0000')

//12.2.5.4.17 The "in select in table" insertion mode

//2)WHITESPACE_CHARACTER_TOKEN - any whitespace/new-line character sequences (e.g. '\n  \r\t   \f')

//3)CHARACTER_TOKEN - any character sequence which don't belong to groups 1 and 2 (e.g. 'abcdef1234@@#$%^')

//<noembed> as a rawtext.

//API

//Active formatting elements reconstruction

//Adoption agency algorithm

//Algorithm entry point

//Aliases

//Always perform inlining check before modifying this functions ('node --trace-inlining').

//Bootstrap parser

//Characters emission

//Check exit from foreign content

//Close elements

//Comments

//Const

//Consumption

//DOCTYPE

//Doctype

//Element in scope

//Element utils

//Elements

//Entry types

//Errors

//Foster parenting

//Fragment parsing

//Generic token handlers

//Hibernation

//If we have a sequence of characters that belong to the same group, parser can process it

//Implied end tags

//Index of element

//Insertion modes

//Integration points

//It's faster than using dictionary.

//List of formatting elements

//Mutations

//NOTE: HTML input preprocessing

//NOTE: If the next token is a U+000A LINE FEED (LF) character token, then ignore that token and move

//NOTE: LF should be in the last column of the line

//NOTE: String.fromCharCode() function can handle only characters from BMP subset.

//NOTE: _attachElementToTree is called from _appendElement, _insertElement and _insertTemplate methods.

//NOTE: add gap that should be avoided during retreat

//NOTE: all U+000D CARRIAGE RETURN (CR) characters must be converted to U+000A LINE FEED (LF) characters

//NOTE: any U+000A LINE FEED (LF) characters that immediately follow a U+000D CARRIAGE RETURN (CR) character

//NOTE: avoid reporting error twice on advance/retreat

//NOTE: build attrs map for the new element so we can perform fast lookups

//NOTE: create fake element which will be used as 'document' for fragment parsing.

//NOTE: do nothing =)

//NOTE: excluding NULL and ASCII whitespace

//NOTE: here we assume that root <html> element is always first in the open element stack, so

//NOTE: here we assume that we always act as an user agent with enabled plugins, so we parse

//NOTE: if we have character token and it's location wasn't set in the _emitCurrentToken(),

//NOTE: if we have pending character token make it's end location equal to the

//NOTE: isolated surrogate

//NOTE: matching can be abrupted by hibernation. In that case match

//NOTE: patch initial states for each mode to obtain token start position

//NOTE: remove bottommost candidates until Noah's Ark condition will not be met

//NOTE: store emited start tag's tagName to determine is the following end tag token is appropriate.

//NOTE: store last foster parenting location, so we will be able to find inserted text

//NOTE: store next element for the next loop iteration (it may be deleted from the stack by step 9.5)

//NOTE: this file contains auto-generated array mapped radix tree that is used for the named entity references consumption

//NOTE: try to peek a surrogate pair

//NOTE: use <template> element as a fragment context if context element was not provided,

//NOTE: used then we emit character explicitly. This is always a non-whitespace and a non-null character.

//NOTE: we are at the end of a chunk, therefore we can't infer surrogate pair yet.

//NOTE: we have a surrogate pair. Peek pair character and recalculate code point.

//NOTE: we use greedy search, so we continue lookup at this point

//Noah Ark's condition

//Node construction

//Node data

//Node types

//OPTIMIZATION: Integer comparisons are low-cost, so we can use very fast tag name length filters here.

//OPTIMIZATION: at first we try to find possible candidates for exclusion using

//OPTIMIZATION: specification uses only one type of character tokens (one token per character).

//OPTIMIZATION: these utility functions should not be moved out of this module. V8 Crankshaft will not inline

//PUBLIC

//Parser

//Parsing loop

//Preprocessor

//Properly nested <body> element (should be second element in stack).

//Search

//So we can avoid additional checks here.

//So we will use token location stored in this methods for the element.

//So, there are 3 types of character tokens in parse5:

//So, we already have advanced position.

//So, we need to workaround this manually.

//Special elements

//Stack of open elements

//Static

//Step 13 of the algorithm

//Step 13.7 of the algorithm

//Step 14 of the algorithm

//Steps 15-19 of the algorithm

//Steps 5-8 of the algorithm

//Steps 9 and 10 of the algorithm

//Surrogates

//Tag attributes

//Temp buffer

//Text

//Text parsing

//This causes a huge memory overhead and a lot of unnecessary parser loops. parse5 uses 3 groups of characters.

//This is important for jsdom there 'document' can't be recreated, therefore

//Token adjustments

//Token creation

//Token emission

//Token processing

//Token types

//Tokenizer

//Tokenizer initial states for different modes

//Tree mutation

//Tree traversing

//Update current element

//Utils

//We don't need to increment preprocessor position, since character token

//[CDATA[

//as a single solid character token.

//current token's start location.

//emission is always forced by the start of the next character token here.

//fragment parsing causes messing of the main `document`.

//in case of foster parenting

//lightweight heuristics without thorough attributes check.

//must be ignored.

//on to the next one. (Newlines at the start of pre blocks are ignored as an authoring convenience.)

//on to the next one. (Newlines at the start of textarea elements are ignored as an authoring convenience.)

//results are no longer valid and we will need to start over.

//script

//so we will parse in "forgiving" manner

//then set it's location at the current preprocessor position.

//this functions if they will be situated in another module due to context switch.

//we perform this fast stack clean up.
