@ai-ecoverse/slicc-spectrum 1.108.2 → 1.108.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +10 -7
  2. package/dist/{chunk-5PPA6KWN.js → chunk-2GCRWCFO.js} +8 -2
  3. package/dist/{chunk-5PPA6KWN.js.map → chunk-2GCRWCFO.js.map} +2 -2
  4. package/dist/{chunk-FPDH5YML.js → chunk-2UI4FYPN.js} +3094 -3032
  5. package/dist/chunk-2UI4FYPN.js.map +7 -0
  6. package/dist/{chunk-RAC3YJAB.js → chunk-AEH5BY5Y.js} +4 -4
  7. package/dist/{chunk-V2C2XXFY.js → chunk-AUHHMQ6Y.js} +2 -2
  8. package/dist/{chunk-KR2QKUMB.js → chunk-EMSJG2PR.js} +2 -2
  9. package/dist/{chunk-SQG7U2FN.js → chunk-KYIEFCEE.js} +109 -20
  10. package/dist/chunk-KYIEFCEE.js.map +7 -0
  11. package/dist/{chunk-FVYTOJDL.js → chunk-RRDK7V7W.js} +4 -4
  12. package/dist/{chunk-LNKW3HPT.js → chunk-UJXGWPUR.js} +2 -2
  13. package/dist/{chunk-LCUBBZNK.js → chunk-UJYVSF46.js} +8 -7
  14. package/dist/{chunk-LCUBBZNK.js.map → chunk-UJYVSF46.js.map} +2 -2
  15. package/dist/{chunk-CGFE5O6B.js → chunk-VVAU2FZK.js} +2 -2
  16. package/dist/chunk-YYVXZKT2.js +1916 -0
  17. package/dist/chunk-YYVXZKT2.js.map +7 -0
  18. package/dist/slicc-dummy.js +11 -2
  19. package/dist/slicc-dummy.js.map +2 -2
  20. package/dist/slicc-terminal.js +1 -1
  21. package/dist/slicc-ui.js +4612 -4129
  22. package/dist/slicc-ui.js.map +4 -4
  23. package/dist/swc.css +104 -60
  24. package/dist/types/app/freezer.d.ts +5 -3
  25. package/dist/types/dummy/notices.d.ts +1 -1
  26. package/package.json +15 -15
  27. package/dist/chunk-FPDH5YML.js.map +0 -7
  28. package/dist/chunk-JYL7FSMY.js +0 -1828
  29. package/dist/chunk-JYL7FSMY.js.map +0 -7
  30. package/dist/chunk-SQG7U2FN.js.map +0 -7
  31. /package/dist/{chunk-RAC3YJAB.js.map → chunk-AEH5BY5Y.js.map} +0 -0
  32. /package/dist/{chunk-V2C2XXFY.js.map → chunk-AUHHMQ6Y.js.map} +0 -0
  33. /package/dist/{chunk-KR2QKUMB.js.map → chunk-EMSJG2PR.js.map} +0 -0
  34. /package/dist/{chunk-FVYTOJDL.js.map → chunk-RRDK7V7W.js.map} +0 -0
  35. /package/dist/{chunk-LNKW3HPT.js.map → chunk-UJXGWPUR.js.map} +0 -0
  36. /package/dist/{chunk-CGFE5O6B.js.map → chunk-VVAU2FZK.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../node_modules/@pierre/diffs/src/utils/isWorkerContext.ts", "../node_modules/@pierre/diffs/src/highlighter/themes/createCachedLoader.ts", "../node_modules/@pierre/theming/src/modules/createThemeResolver.ts", "../node_modules/@pierre/diffs/src/highlighter/themes/themeResolver.ts", "../node_modules/@pierre/diffs/src/constants.ts", "../node_modules/@pierre/diffs/src/highlighter/highlighterType.ts", "../node_modules/html-void-elements/index.js", "../node_modules/property-information/lib/util/schema.js", "../node_modules/property-information/lib/util/merge.js", "../node_modules/property-information/lib/normalize.js", "../node_modules/property-information/lib/util/info.js", "../node_modules/property-information/lib/util/types.js", "../node_modules/property-information/lib/util/defined-info.js", "../node_modules/property-information/lib/util/create.js", "../node_modules/property-information/lib/aria.js", "../node_modules/property-information/lib/util/case-sensitive-transform.js", "../node_modules/property-information/lib/util/case-insensitive-transform.js", "../node_modules/property-information/lib/html.js", "../node_modules/property-information/lib/svg.js", "../node_modules/property-information/lib/xlink.js", "../node_modules/property-information/lib/xmlns.js", "../node_modules/property-information/lib/xml.js", "../node_modules/property-information/lib/find.js", "../node_modules/property-information/index.js", "../node_modules/zwitch/index.js", "../node_modules/stringify-entities/lib/core.js", "../node_modules/stringify-entities/lib/util/to-hexadecimal.js", "../node_modules/stringify-entities/lib/util/to-decimal.js", "../node_modules/character-entities-legacy/index.js", "../node_modules/character-entities-html4/index.js", "../node_modules/stringify-entities/lib/constant/dangerous.js", "../node_modules/stringify-entities/lib/util/to-named.js", "../node_modules/stringify-entities/lib/util/format-smart.js", "../node_modules/stringify-entities/lib/index.js", "../node_modules/hast-util-to-html/lib/handle/comment.js", "../node_modules/hast-util-to-html/lib/handle/doctype.js", "../node_modules/ccount/index.js", "../node_modules/comma-separated-tokens/index.js", "../node_modules/space-separated-tokens/index.js", "../node_modules/hast-util-whitespace/lib/index.js", "../node_modules/hast-util-to-html/lib/omission/util/siblings.js", "../node_modules/hast-util-to-html/lib/omission/omission.js", "../node_modules/hast-util-to-html/lib/omission/closing.js", "../node_modules/hast-util-to-html/lib/omission/opening.js", "../node_modules/hast-util-to-html/lib/handle/element.js", "../node_modules/hast-util-to-html/lib/handle/text.js", "../node_modules/hast-util-to-html/lib/handle/raw.js", "../node_modules/hast-util-to-html/lib/handle/root.js", "../node_modules/hast-util-to-html/lib/handle/index.js", "../node_modules/hast-util-to-html/lib/index.js", "../node_modules/@pierre/diffs/src/utils/hastToHtml.ts", "../node_modules/@pierre/diffs/src/utils/hast_utils.ts", "../node_modules/@pierre/diffs/src/utils/processLine.ts", "../node_modules/@pierre/diffs/src/utils/setDeferredArrayItem.ts", "../node_modules/@pierre/diffs/src/utils/tokenStyle.ts", "../node_modules/@pierre/diffs/src/utils/wrapTokenFragments.ts", "../node_modules/@pierre/diffs/src/utils/renderTokenLines.ts", "../node_modules/@pierre/diffs/src/utils/tokensToHtml.ts", "../node_modules/@pierre/diffs/src/utils/appendItems.ts"],
4
- "sourcesContent": ["declare const WorkerGlobalScope: new () => Worker;\n\nexport function isWorkerContext(): boolean {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n typeof self !== 'undefined' &&\n self instanceof WorkerGlobalScope\n );\n}\n", "export function createCachedLoader<T extends object>(\n loader: () => Promise<T>\n): () => T | Promise<T> {\n let cached: T | Promise<T> | undefined;\n return () =>\n (cached ??= loader().then(\n (loaded) => {\n cached = loaded;\n return loaded;\n },\n (error: unknown) => {\n cached = undefined;\n throw error;\n }\n ));\n}\n", "/**\n * Concurrent requests for one name share a load. Resolved themes are cached\n * for synchronous reads; module default exports are unwrapped before caching.\n */\n\nimport type { ThemeLike } from './types';\nimport { type DefaultExport, unwrapDefault } from './unwrapDefault';\n\n// A loader is a zero-argument async factory that returns either a ThemeLike\n// directly or a module-style `{ default: ThemeLike }` (the shape produced by\n// `import()` on a JSON theme file or a re-exporting ESM module).\nexport interface ThemeLoader<TTheme extends ThemeLike = ThemeLike> {\n (): Promise<TTheme | DefaultExport<TTheme>>;\n}\n\nexport interface ThemeResolverOptions<TTheme extends ThemeLike = ThemeLike> {\n /** Load an unregistered name; undefined means the fallback does not know it. */\n fallbackLoader?: (\n name: string\n ) => Promise<TTheme | DefaultExport<TTheme> | undefined>;\n /** Normalize loaded themes before caching. Seeded themes are already resolved. */\n normalizeTheme?: (theme: TTheme, name: string) => TTheme | Promise<TTheme>;\n}\n\nexport interface ThemeResolver<TTheme extends ThemeLike = ThemeLike> {\n // Seed the resolved cache with an already-resolved theme under `name`,\n // without registering or running a loader. Intended for environments that\n // receive a fully-resolved theme object out of band (for example a worker\n // that is handed pre-resolved themes by the main thread and cannot run a\n // loader itself). A subsequent getResolvedTheme/getResolvedOrResolveTheme/\n // resolveTheme for `name` returns the seeded theme; a later resolveTheme is\n // served from the cache and never invokes a registered loader for that name.\n seedResolvedTheme(name: string, theme: TTheme): void;\n\n // Seed multiple resolved themes. Accepts any iterable of `[name, theme]`\n // entries so callers can pass arrays or Maps without reshaping.\n seedResolvedThemes(entries: Iterable<readonly [string, TTheme]>): void;\n\n // Clear the resolved cache and in-flight promises. Registered loaders are\n // kept so subsequent resolveTheme calls re-run them.\n clearResolvedThemes(): void;\n\n // Returns the cached ThemeLike synchronously when warm; otherwise returns\n // the resolveTheme Promise so callers can await it when cold.\n getResolvedOrResolveTheme(name: string): TTheme | Promise<TTheme>;\n\n // Synchronous cache read. Returns undefined if the theme has not been\n // resolved yet.\n getResolvedTheme(name: string): TTheme | undefined;\n\n // Synchronous cache read for a batch. Throws UnresolvedThemeError naming the\n // first missing theme if any requested name is not warm.\n getResolvedThemes(names: readonly string[]): TTheme[];\n\n // Registry/cache introspection helpers for callers that need to avoid an async\n // tick or decide whether to register a fallback loader.\n hasRegisteredTheme(name: string): boolean;\n hasResolvedTheme(name: string): boolean;\n hasResolvedThemes(names: readonly string[]): boolean;\n\n // Register a named loader. Throws DuplicateThemeError if a loader for\n // `name` is already present.\n registerTheme(name: string, loader: ThemeLoader<TTheme>): void;\n\n // Register a loader only when `name` has no loader yet. Returns true when the\n // loader was added and false when a loader already existed.\n registerThemeIfAbsent(name: string, loader: ThemeLoader<TTheme>): boolean;\n\n // Resolve a theme by name. Dedupes concurrent calls and caches the result.\n // Rejects with UnregisteredThemeError if no loader has been registered.\n resolveTheme(name: string): Promise<TTheme>;\n\n // Resolve a batch of themes in input order. Each name still goes through the\n // same cache and in-flight dedupe as resolveTheme.\n resolveThemes(names: readonly string[]): Promise<TTheme[]>;\n}\n\n// Thrown when a caller tries to register a second loader for an already-known\n// theme name. The generic resolver is strict — idempotency layers live above.\nexport class DuplicateThemeError extends Error {\n constructor(name: string) {\n super(`Theme \"${name}\" is already registered`);\n this.name = 'DuplicateThemeError';\n }\n}\n\n// Thrown when resolveTheme is called for a name with no registered loader.\nexport class UnregisteredThemeError extends Error {\n constructor(name: string) {\n super(`No loader registered for theme \"${name}\"`);\n this.name = 'UnregisteredThemeError';\n }\n}\n\n// Thrown when callers require a synchronously resolved theme but the cache does\n// not contain that name. This is distinct from UnregisteredThemeError: the\n// theme may have a loader, it just has not been resolved or seeded yet.\nexport class UnresolvedThemeError extends Error {\n constructor(name: string) {\n super(`Theme \"${name}\" has not been resolved`);\n this.name = 'UnresolvedThemeError';\n }\n}\n\n// Creates an isolated ThemeResolver instance with its own loader registry,\n// resolved-theme cache, and in-flight dedupe map. Multiple instances never\n// share state.\nexport function createThemeResolver<TTheme extends ThemeLike = ThemeLike>(\n options: ThemeResolverOptions<TTheme> = {}\n): ThemeResolver<TTheme> {\n // Maps theme name → registered loader function (set at register time).\n const loaders = new Map<string, ThemeLoader<TTheme>>();\n\n // Synchronous cache of successfully resolved ThemeLike objects.\n const resolved = new Map<string, TTheme>();\n\n // In-flight dedupe map: while a load is running, subsequent callers for the\n // same name receive the same Promise instead of launching another load.\n const inflight = new Map<string, Promise<TTheme>>();\n\n // Incremented whenever resolved/in-flight state is cleared. A loader that\n // started before a clear may still settle later; the generation check prevents\n // that stale promise from repopulating the cache.\n let cacheGeneration = 0;\n\n function registerTheme(name: string, loader: ThemeLoader<TTheme>): void {\n if (loaders.has(name)) {\n throw new DuplicateThemeError(name);\n }\n loaders.set(name, loader);\n }\n\n function registerThemeIfAbsent(\n name: string,\n loader: ThemeLoader<TTheme>\n ): boolean {\n if (loaders.has(name)) return false;\n loaders.set(name, loader);\n return true;\n }\n\n function hasRegisteredTheme(name: string): boolean {\n return loaders.has(name);\n }\n\n // Resolves a theme by name. Returns immediately if the theme is already in\n // the synchronous cache, dedupes concurrent calls via the inflight map, and\n // clears the inflight entry after settlement (success or failure) so that\n // failed loads can be retried by the next caller.\n function resolveTheme(name: string): Promise<TTheme> {\n const cached = resolved.get(name);\n if (cached !== undefined) {\n return Promise.resolve(cached);\n }\n\n const existing = inflight.get(name);\n if (existing !== undefined) {\n return existing;\n }\n\n const loader = loaders.get(name);\n if (loader === undefined && options.fallbackLoader === undefined) {\n return Promise.reject(new UnregisteredThemeError(name));\n }\n\n const generation = cacheGeneration;\n const promise = Promise.resolve()\n .then(() =>\n loader !== undefined ? loader() : options.fallbackLoader?.(name)\n )\n .then(async (result) => {\n // A loader may return either a bare ThemeLike or an ES-module namespace\n // object ({ default: ThemeLike }) — the latter is typical when the\n // loader calls a dynamic import() on a JSON or .ts theme file and the\n // bundler/runtime wraps the value under `default`. We treat any object\n // carrying a top-level `default` key as the module-namespace form.\n // Real ThemeLike theme objects never carry a top-level `default` key,\n // so the heuristic is unambiguous in practice.\n if (result === undefined) throw new UnregisteredThemeError(name);\n const loaded = unwrapDefault(result);\n const theme =\n options.normalizeTheme === undefined\n ? loaded\n : await options.normalizeTheme(loaded, name);\n if (generation === cacheGeneration) {\n resolved.set(name, theme);\n }\n if (inflight.get(name) === promise) {\n inflight.delete(name);\n }\n return theme;\n })\n .catch((err: unknown) => {\n // Clear the inflight entry so a later call can retry.\n if (inflight.get(name) === promise) {\n inflight.delete(name);\n }\n throw err;\n });\n\n inflight.set(name, promise);\n return promise;\n }\n\n function resolveThemes(names: readonly string[]): Promise<TTheme[]> {\n return Promise.all(names.map((name) => resolveTheme(name)));\n }\n\n // Seeds the resolved cache directly with a pre-resolved theme. No loader is\n // registered or run — the value is simply made available to subsequent\n // getResolvedTheme/getResolvedOrResolveTheme/resolveTheme calls. Used by\n // callers (e.g. workers) that obtain a fully-resolved theme object out of\n // band and want it served synchronously without a loader round-trip.\n function seedResolvedTheme(name: string, theme: TTheme): void {\n resolved.set(name, theme);\n }\n\n function seedResolvedThemes(\n entries: Iterable<readonly [string, TTheme]>\n ): void {\n for (const [name, theme] of entries) {\n seedResolvedTheme(name, theme);\n }\n }\n\n function getResolvedTheme(name: string): TTheme | undefined {\n return resolved.get(name);\n }\n\n function getResolvedThemes(names: readonly string[]): TTheme[] {\n const themes: TTheme[] = [];\n for (const name of names) {\n const theme = resolved.get(name);\n if (theme === undefined) {\n throw new UnresolvedThemeError(name);\n }\n themes.push(theme);\n }\n return themes;\n }\n\n function hasResolvedTheme(name: string): boolean {\n return resolved.has(name);\n }\n\n function hasResolvedThemes(names: readonly string[]): boolean {\n for (const name of names) {\n if (!resolved.has(name)) return false;\n }\n return true;\n }\n\n // Returns the cached ThemeLike synchronously if available, otherwise falls\n // through to resolveTheme so callers can await the returned Promise. This\n // matches the \"get hot, resolve cold\" pattern used throughout the diffs\n // package (getResolvedOrResolveTheme semantics).\n function getResolvedOrResolveTheme(name: string): TTheme | Promise<TTheme> {\n const cached = resolved.get(name);\n if (cached !== undefined) {\n return cached;\n }\n return resolveTheme(name);\n }\n\n // Clears the resolved cache and any in-flight promises so that subsequent\n // calls re-run loaders from scratch. Registered loaders are preserved.\n function clearResolvedThemes(): void {\n cacheGeneration++;\n resolved.clear();\n inflight.clear();\n }\n\n return {\n clearResolvedThemes,\n getResolvedOrResolveTheme,\n getResolvedTheme,\n getResolvedThemes,\n hasRegisteredTheme,\n hasResolvedTheme,\n hasResolvedThemes,\n registerTheme,\n registerThemeIfAbsent,\n resolveTheme,\n resolveThemes,\n seedResolvedTheme,\n seedResolvedThemes,\n };\n}\n", "import type {\n Theme as ZedTheme,\n ThemeFamily as ZedThemeFamily,\n} from '@pierre/highlights';\nimport {\n createThemeResolver,\n type ThemeLoader,\n type ThemeResolver,\n} from '@pierre/theming';\nimport type { ThemeRegistration } from 'shiki';\n\nimport type { HighlighterTypes } from '../../types';\nimport { isWorkerContext } from '../../utils/isWorkerContext';\nimport { createCachedLoader } from './createCachedLoader';\nimport type { DiffsTheme } from './types';\n\ndeclare const __DIFFS_WORKER__: boolean | undefined;\n\nexport type CustomThemeLoader = ThemeLoader<\n ThemeRegistration | DiffsTheme | ZedTheme | ZedThemeFamily\n>;\nexport const customThemes: Map<\n string,\n Partial<Record<'textmate' | 'zed' | 'diffs', CustomThemeLoader>>\n> = new Map();\nconst resolvers = new Map<HighlighterTypes, ThemeResolver<DiffsTheme>>();\n\nconst loadHighlightsThemeCatalog = createCachedLoader(\n () => import('@pierre/highlights/themes/loader')\n);\nconst loadPierreThemeCatalog = createCachedLoader(\n () => import('@pierre/theming/themes')\n);\nconst loadShikiCore = createCachedLoader(() => import('shiki/core'));\n\n// Map Zed colors to the VS Code keys used by editor and diff overlays.\nconst ZED_COLOR_ALIASES: readonly (readonly [\n target: string,\n ...sources: string[],\n])[] = [\n ['editor.lineHighlightBackground', 'editor.active_line.background'],\n ['editor.selectionBackground', 'element.selected'],\n ['editor.findMatchBackground', 'search.match_background'],\n ['editor.findMatchHighlightBackground', 'search.match_background'],\n [\n 'editorBracketMatch.background',\n 'editor.document_highlight.bracket_background',\n ],\n ['editorError.foreground', 'error'],\n ['editorWarning.foreground', 'warning'],\n ['editorInfo.foreground', 'info'],\n ['editorHint.foreground', 'hint'],\n ['gitDecoration.addedResourceForeground', 'created', 'terminal.ansi.green'],\n ['gitDecoration.deletedResourceForeground', 'deleted', 'terminal.ansi.red'],\n [\n 'gitDecoration.modifiedResourceForeground',\n 'modified',\n 'terminal.ansi.blue',\n ],\n];\n\nfunction createHighlightsTheme(\n name: string,\n raw: ZedTheme | ZedThemeFamily\n): DiffsTheme {\n const theme = 'themes' in raw ? raw.themes[0] : raw;\n if (theme == null)\n throw new Error(`Theme \"${name}\" is an empty Zed theme family.`);\n const zed = { ...theme, name };\n const colors: Record<string, string> = {};\n for (const [key, value] of Object.entries(zed.style)) {\n if (typeof value === 'string') colors[key] = value;\n }\n // Zed keeps the local user's caret and selection in the first player slot.\n const player = zed.style.players?.[0];\n if (player?.cursor != null)\n colors['editorCursor.foreground'] ??= player.cursor;\n if (player?.selection != null)\n colors['editor.selectionBackground'] ??= player.selection;\n for (const [target, ...sources] of ZED_COLOR_ALIASES) {\n if (colors[target] != null) continue;\n const source = sources.find((key) => colors[key] != null);\n if (source != null) colors[target] = colors[source];\n }\n if (zed.cssVariables === true) {\n colors['editor.foreground'] = 'var(--hls-foreground)';\n colors['editor.background'] = 'var(--hls-background)';\n } else if (typeof zed.cssVariables === 'object') {\n colors['editor.foreground'] ??=\n colors.text ?? colors.foreground ?? 'foreground';\n colors['editor.background'] ??= colors.background ?? 'background';\n const { prefix = '--hls-', defaults } = zed.cssVariables;\n for (const [key, value] of Object.entries(colors)) {\n const fallback = defaults?.[value];\n colors[key] = `var(${prefix}${value}${fallback ? `, ${fallback}` : ''})`;\n }\n }\n const type = zed.appearance === 'light' ? 'light' : 'dark';\n return {\n name,\n type,\n colors,\n zed,\n fg:\n colors['editor.foreground'] ??\n colors.text ??\n colors.foreground ??\n (type === 'light' ? '#333333' : '#bbbbbb'),\n bg:\n colors['editor.background'] ??\n colors.background ??\n (type === 'light' ? '#ffffff' : '#1e1e1e'),\n };\n}\n\n/** Keep caches separate because the same name can have TextMate and Zed palettes. */\nexport function createDiffsThemeResolver(\n backend: HighlighterTypes\n): ThemeResolver<DiffsTheme> {\n let resolver = resolvers.get(backend);\n if (resolver != null) return resolver;\n resolver = createThemeResolver<DiffsTheme>({\n fallbackLoader: async (name) => {\n if (\n typeof __DIFFS_WORKER__ !== 'undefined'\n ? __DIFFS_WORKER__\n : isWorkerContext()\n ) {\n throw new Error(\n `Theme \"${name}\" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedThemes parameter.`\n );\n }\n const custom = customThemes.get(name);\n if (backend === 'highlights') {\n const loader = custom?.zed ?? custom?.diffs;\n if (loader != null) {\n const loaded = await loader();\n const theme = 'default' in loaded ? loaded.default : loaded;\n if ('zed' in theme && theme.zed != null) return theme;\n if ('style' in theme || 'themes' in theme)\n return createHighlightsTheme(name, theme);\n throw new Error(\n `Theme \"${name}\" is a TextMate theme; register a Zed theme with registerCustomTheme(name, loader, 'zed') for Highlights.`\n );\n }\n const catalog = loadHighlightsThemeCatalog();\n const { themes } = catalog instanceof Promise ? await catalog : catalog;\n const bundledLoader = themes[name];\n if (bundledLoader != null) {\n const loaded = await bundledLoader();\n return createHighlightsTheme(name, loaded.default);\n }\n if (custom?.textmate != null) {\n throw new Error(\n `Theme \"${name}\" is only registered for TextMate; use registerCustomTheme(name, loader, 'zed') for Highlights.`\n );\n }\n } else {\n const loader = custom?.textmate ?? custom?.diffs;\n let loaded: ThemeRegistration | DiffsTheme | ZedTheme | ZedThemeFamily;\n if (loader != null) {\n const result = await loader();\n loaded = 'default' in result ? result.default : result;\n } else {\n const catalog = loadPierreThemeCatalog();\n const { themes } =\n catalog instanceof Promise ? await catalog : catalog;\n const descriptor = themes.getTheme(name);\n if (descriptor == null && custom?.zed != null) {\n throw new Error(\n `Theme \"${name}\" is only registered for Zed; use registerCustomTheme(name, loader, 'textmate') for Shiki.`\n );\n }\n if (descriptor == null)\n throw new Error(`No valid theme loader registered for \"${name}\"`);\n const result = await descriptor.load();\n loaded = 'default' in result ? result.default : result;\n }\n if ('style' in loaded || 'themes' in loaded) {\n throw new Error(\n `Theme \"${name}\" is a Zed theme; use preferredHighlighter: 'highlights' or register a TextMate theme for Shiki.`\n );\n }\n const core = loadShikiCore();\n const { normalizeTheme, createCssVariablesTheme } =\n core instanceof Promise ? await core : core;\n if ('cssVariables' in loaded && loaded.cssVariables != null) {\n return {\n ...loaded,\n textmate: normalizeTheme(\n createCssVariablesTheme(loaded.cssVariables)\n ),\n };\n }\n if ('textmate' in loaded && loaded.textmate != null) {\n return { ...loaded, textmate: normalizeTheme(loaded.textmate) };\n }\n const textmate = normalizeTheme(loaded);\n return {\n name: textmate.name,\n type: textmate.type,\n fg: textmate.fg,\n bg: textmate.bg,\n colors: textmate.colors,\n textmate,\n };\n }\n throw new Error(`No valid theme loader registered for \"${name}\"`);\n },\n normalizeTheme: (theme, name) => {\n if (theme.name !== name)\n throw new Error(\n `resolvedTheme: themeName: ${name} does not match theme.name: ${theme.name}`\n );\n return theme;\n },\n });\n resolvers.set(backend, resolver);\n return resolver;\n}\n", "import type {\n CodeViewLayout,\n HighlighterTypes,\n HunkExpansionRegion,\n RenderRange,\n SmoothScrollSettings,\n ThemesType,\n VirtualFileMetrics,\n} from './types';\n\nexport const DIFFS_TAG_NAME = 'diffs-container' as const;\n\n// Keep this as a NODE_ENV read so app builds can hard-disable development-only\n// checks unless they are explicitly built for development.\nexport const DIFFS_DEVELOPMENT_BUILD: boolean = (() => {\n try {\n return process.env.NODE_ENV === 'development';\n } catch {\n return false;\n }\n})();\n\n// Misc patch/content parsing regexes\nexport const COMMIT_METADATA_SPLIT: RegExp = /(?=^From [a-f0-9]+ .+$)/m;\nexport const GIT_DIFF_FILE_BREAK_REGEX: RegExp = /(?=^diff --git)/gm;\nexport const UNIFIED_DIFF_FILE_BREAK_REGEX: RegExp = /(?=^---\\s+\\S)/gm;\nexport const FILE_CONTEXT_BLOB: RegExp = /(?=^@@ )/gm;\nexport const HUNK_HEADER: RegExp =\n /^@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@(?: (.*))?/m;\nexport const SPLIT_WITH_NEWLINES: RegExp = /(?<=\\n)/;\nexport const FILENAME_HEADER_REGEX: RegExp = /^(---|\\+\\+\\+)\\s+([^\\t\\r\\n]+)/;\nexport const INDEX_LINE_METADATA: RegExp =\n /^index ([0-9a-f]+)\\.\\.([0-9a-f]+)(?: (\\d+))?$/i;\n\nexport const MERGE_CONFLICT_START_MARKER_REGEX: RegExp = /^<{7,}(?:\\s.*)?$/;\nexport const MERGE_CONFLICT_BASE_MARKER_REGEX: RegExp = /^\\|{7,}(?:\\s.*)?$/;\nexport const MERGE_CONFLICT_SEPARATOR_MARKER_REGEX: RegExp = /^={7,}$/;\nexport const MERGE_CONFLICT_END_MARKER_REGEX: RegExp = /^>{7,}(?:\\s.*)?$/;\n\nexport const HEADER_PREFIX_SLOT_ID = 'header-prefix';\nexport const HEADER_FILENAME_SUFFIX_SLOT_ID = 'header-filename-suffix';\nexport const HEADER_METADATA_SLOT_ID = 'header-metadata';\nexport const CUSTOM_HEADER_SLOT_ID = 'header-custom';\n\nexport const DEFAULT_THEMES: ThemesType = {\n dark: 'pierre-dark',\n light: 'pierre-light',\n};\n\n// The highlighter type used when no request names one and none is active yet.\nexport const DEFAULT_HIGHLIGHTER: HighlighterTypes = 'shiki-js';\n\nexport const THEME_CSS_ATTRIBUTE = 'data-theme-css';\nexport const UNSAFE_CSS_ATTRIBUTE = 'data-unsafe-css';\nexport const CORE_CSS_ATTRIBUTE = 'data-core-css';\nexport const DIFFS_SCROLLBAR_MEASURE_ATTRIBUTE = 'data-diffs-scrollbar-measure';\nexport const CODE_VIEW_HEADER_ATTRIBUTE = 'data-diffs-code-view-header';\nexport const CODE_VIEW_FOOTER_ATTRIBUTE = 'data-diffs-code-view-footer';\nexport const DIFFS_SCROLLBAR_GUTTER_MEASURED_PROPERTY =\n '--diffs-scrollbar-gutter-measured';\n\nexport const DEFAULT_COLLAPSED_CONTEXT_THRESHOLD = 1;\nexport const DEFAULT_TOKENIZE_MAX_LENGTH = 100_000;\nexport const DEFAULT_VIRTUAL_FILE_METRICS: VirtualFileMetrics = {\n hunkLineCount: 50,\n lineHeight: 20,\n diffHeaderHeight: 44,\n spacing: 8,\n};\n\nexport const DEFAULT_CODE_VIEW_FILE_METRICS: VirtualFileMetrics = {\n ...DEFAULT_VIRTUAL_FILE_METRICS,\n hunkLineCount: 1,\n};\n\nexport const DEFAULT_CODE_VIEW_LAYOUT: CodeViewLayout = {\n paddingTop: 8,\n paddingBottom: 8,\n gap: 8,\n};\n\nexport const DEFAULT_SMOOTH_SCROLL_SETTINGS: SmoothScrollSettings = {\n omega: 0.015,\n positionEpsilon: 0.5,\n velocityEpsilon: 0.05,\n};\n\nexport const DEFAULT_EXPANDED_REGION: HunkExpansionRegion = Object.freeze({\n fromStart: 0,\n fromEnd: 0,\n});\n\nexport const DEFAULT_RENDER_RANGE: RenderRange = {\n startingLine: 0,\n totalLines: Infinity,\n bufferBefore: 0,\n bufferAfter: 0,\n};\n\nexport const EMPTY_LINE_ANNOTATIONS: never[] = Object.freeze([]) as never[];\n\nexport const EMPTY_RENDER_RANGE: RenderRange = {\n startingLine: 0,\n totalLines: 0,\n bufferBefore: 0,\n bufferAfter: 0,\n};\n", "import { DEFAULT_HIGHLIGHTER } from '../constants';\nimport type { HighlighterTypes } from '../types';\n\n// The main thread and each worker allow one highlighter type at a time.\n// Pending creations and live instances prevent switching types.\nlet activeType: HighlighterTypes | undefined;\nlet holds = 0;\n\nexport class HighlighterDisposedError extends Error {\n constructor() {\n super('Highlighter is disposed');\n this.name = 'HighlighterDisposedError';\n }\n}\n\nexport function getHighlighterType(): HighlighterTypes | undefined {\n return activeType;\n}\n\nexport function resolveHighlighterType(\n type?: HighlighterTypes\n): HighlighterTypes {\n return type ?? activeType ?? DEFAULT_HIGHLIGHTER;\n}\n\nexport function assertHighlighterType(type: HighlighterTypes): void {\n if (activeType != null && activeType !== type) {\n throw new Error(\n `Cannot load the \"${type}\" highlighter while \"${activeType}\" is in use. Only one highlighter type can be active at a time; dispose every \"${activeType}\" instance (disposeHighlighter() disposes the shared one) before switching.`\n );\n }\n}\n\nexport function acquireHighlighterType(type: HighlighterTypes): void {\n assertHighlighterType(type);\n activeType = type;\n holds++;\n}\n\nexport function releaseHighlighterType(): void {\n holds--;\n if (holds === 0) {\n activeType = undefined;\n }\n}\n", "/**\n * List of HTML void tag names.\n *\n * @type {Array<string>}\n */\nexport const htmlVoidElements = [\n 'area',\n 'base',\n 'basefont',\n 'bgsound',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'frame',\n 'hr',\n 'image',\n 'img',\n 'input',\n 'keygen',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr'\n]\n", "/**\n * @import {Schema as SchemaType, Space} from 'property-information'\n */\n\n/** @type {SchemaType} */\nexport class Schema {\n /**\n * @param {SchemaType['property']} property\n * Property.\n * @param {SchemaType['normal']} normal\n * Normal.\n * @param {Space | undefined} [space]\n * Space.\n * @returns\n * Schema.\n */\n constructor(property, normal, space) {\n this.normal = normal\n this.property = property\n\n if (space) {\n this.space = space\n }\n }\n}\n\nSchema.prototype.normal = {}\nSchema.prototype.property = {}\nSchema.prototype.space = undefined\n", "/**\n * @import {Info, Space} from 'property-information'\n */\n\nimport {Schema} from './schema.js'\n\n/**\n * @param {ReadonlyArray<Schema>} definitions\n * Definitions.\n * @param {Space | undefined} [space]\n * Space.\n * @returns {Schema}\n * Schema.\n */\nexport function merge(definitions, space) {\n /** @type {Record<string, Info>} */\n const property = {}\n /** @type {Record<string, string>} */\n const normal = {}\n\n for (const definition of definitions) {\n Object.assign(property, definition.property)\n Object.assign(normal, definition.normal)\n }\n\n return new Schema(property, normal, space)\n}\n", "/**\n * Get the cleaned case insensitive form of an attribute or property.\n *\n * @param {string} value\n * An attribute-like or property-like name.\n * @returns {string}\n * Value that can be used to look up the properly cased property on a\n * `Schema`.\n */\nexport function normalize(value) {\n return value.toLowerCase()\n}\n", "/**\n * @import {Info as InfoType} from 'property-information'\n */\n\n/** @type {InfoType} */\nexport class Info {\n /**\n * @param {string} property\n * Property.\n * @param {string} attribute\n * Attribute.\n * @returns\n * Info.\n */\n constructor(property, attribute) {\n this.attribute = attribute\n this.property = property\n }\n}\n\nInfo.prototype.attribute = ''\nInfo.prototype.booleanish = false\nInfo.prototype.boolean = false\nInfo.prototype.commaOrSpaceSeparated = false\nInfo.prototype.commaSeparated = false\nInfo.prototype.defined = false\nInfo.prototype.mustUseProperty = false\nInfo.prototype.number = false\nInfo.prototype.overloadedBoolean = false\nInfo.prototype.property = ''\nInfo.prototype.spaceSeparated = false\nInfo.prototype.space = undefined\n", "let powers = 0\n\nexport const boolean = increment()\nexport const booleanish = increment()\nexport const overloadedBoolean = increment()\nexport const number = increment()\nexport const spaceSeparated = increment()\nexport const commaSeparated = increment()\nexport const commaOrSpaceSeparated = increment()\n\nfunction increment() {\n return 2 ** ++powers\n}\n", "/**\n * @import {Space} from 'property-information'\n */\n\nimport {Info} from './info.js'\nimport * as types from './types.js'\n\nconst checks = /** @type {ReadonlyArray<keyof typeof types>} */ (\n Object.keys(types)\n)\n\nexport class DefinedInfo extends Info {\n /**\n * @constructor\n * @param {string} property\n * Property.\n * @param {string} attribute\n * Attribute.\n * @param {number | null | undefined} [mask]\n * Mask.\n * @param {Space | undefined} [space]\n * Space.\n * @returns\n * Info.\n */\n constructor(property, attribute, mask, space) {\n let index = -1\n\n super(property, attribute)\n\n mark(this, 'space', space)\n\n if (typeof mask === 'number') {\n while (++index < checks.length) {\n const check = checks[index]\n mark(this, checks[index], (mask & types[check]) === types[check])\n }\n }\n }\n}\n\nDefinedInfo.prototype.defined = true\n\n/**\n * @template {keyof DefinedInfo} Key\n * Key type.\n * @param {DefinedInfo} values\n * Info.\n * @param {Key} key\n * Key.\n * @param {DefinedInfo[Key]} value\n * Value.\n * @returns {undefined}\n * Nothing.\n */\nfunction mark(values, key, value) {\n if (value) {\n values[key] = value\n }\n}\n", "/**\n * @import {Info, Space} from 'property-information'\n */\n\n/**\n * @typedef Definition\n * Definition of a schema.\n * @property {Record<string, string> | undefined} [attributes]\n * Normalzed names to special attribute case.\n * @property {ReadonlyArray<string> | undefined} [mustUseProperty]\n * Normalized names that must be set as properties.\n * @property {Record<string, number | null>} properties\n * Property names to their types.\n * @property {Space | undefined} [space]\n * Space.\n * @property {Transform} transform\n * Transform a property name.\n */\n\n/**\n * @callback Transform\n * Transform.\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} property\n * Property.\n * @returns {string}\n * Attribute.\n */\n\nimport {normalize} from '../normalize.js'\nimport {DefinedInfo} from './defined-info.js'\nimport {Schema} from './schema.js'\n\n/**\n * @param {Definition} definition\n * Definition.\n * @returns {Schema}\n * Schema.\n */\nexport function create(definition) {\n /** @type {Record<string, Info>} */\n const properties = {}\n /** @type {Record<string, string>} */\n const normals = {}\n\n for (const [property, value] of Object.entries(definition.properties)) {\n const info = new DefinedInfo(\n property,\n definition.transform(definition.attributes || {}, property),\n value,\n definition.space\n )\n\n if (\n definition.mustUseProperty &&\n definition.mustUseProperty.includes(property)\n ) {\n info.mustUseProperty = true\n }\n\n properties[property] = info\n\n normals[normalize(property)] = property\n normals[normalize(info.attribute)] = property\n }\n\n return new Schema(properties, normals, definition.space)\n}\n", "import {create} from './util/create.js'\nimport {booleanish, number, spaceSeparated} from './util/types.js'\n\nexport const aria = create({\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n },\n transform(_, property) {\n return property === 'role'\n ? property\n : 'aria-' + property.slice(4).toLowerCase()\n }\n})\n", "/**\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} attribute\n * Attribute.\n * @returns {string}\n * Transformed attribute.\n */\nexport function caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute\n}\n", "import {caseSensitiveTransform} from './case-sensitive-transform.js'\n\n/**\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} property\n * Property.\n * @returns {string}\n * Transformed property.\n */\nexport function caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n", "import {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\nimport {create} from './util/create.js'\nimport {\n booleanish,\n boolean,\n commaSeparated,\n number,\n overloadedBoolean,\n spaceSeparated\n} from './util/types.js'\n\nexport const html = create({\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: boolean,\n allowPaymentRequest: boolean,\n allowUserMedia: boolean,\n alpha: boolean,\n alt: null,\n as: null,\n async: boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: boolean,\n autoPlay: boolean,\n blocking: spaceSeparated,\n capture: null,\n charSet: null,\n checked: boolean,\n cite: null,\n className: spaceSeparated,\n closedBy: null,\n colorSpace: null,\n cols: number,\n colSpan: number,\n command: null,\n commandFor: null,\n content: null,\n contentEditable: booleanish,\n controls: boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n default: boolean,\n defer: boolean,\n dir: null,\n dirName: null,\n disabled: boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n fetchPriority: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: overloadedBoolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: null,\n inert: boolean,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loading: null,\n loop: boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: boolean,\n muted: boolean,\n name: null,\n nonce: null,\n noModule: boolean,\n noValidate: boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforeMatch: null,\n onBeforePrint: null,\n onBeforeToggle: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextLost: null,\n onContextMenu: null,\n onContextRestored: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onScrollEnd: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: boolean,\n popover: null,\n popoverTarget: null,\n popoverTargetAction: null,\n poster: null,\n preload: null,\n readOnly: boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: boolean,\n reversed: boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: boolean,\n seamless: boolean,\n selected: boolean,\n shadowRootClonable: boolean,\n shadowRootCustomElementRegistry: boolean,\n shadowRootDelegatesFocus: boolean,\n shadowRootMode: null,\n shadowRootSerializable: boolean,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: null,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n writingSuggestions: null,\n\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null, // Several. Use CSS `text-align` instead,\n aLink: null, // `<body>`. Use CSS `a:active {color}` instead\n archive: spaceSeparated, // `<object>`. List of URIs to archives\n axis: null, // `<td>` and `<th>`. Use `scope` on `<th>`\n background: null, // `<body>`. Use CSS `background-image` instead\n bgColor: null, // `<body>` and table elements. Use CSS `background-color` instead\n border: number, // `<table>`. Use CSS `border-width` instead,\n borderColor: null, // `<table>`. Use CSS `border-color` instead,\n bottomMargin: number, // `<body>`\n cellPadding: null, // `<table>`\n cellSpacing: null, // `<table>`\n char: null, // Several table elements. When `align=char`, sets the character to align on\n charOff: null, // Several table elements. When `char`, offsets the alignment\n classId: null, // `<object>`\n clear: null, // `<br>`. Use CSS `clear` instead\n code: null, // `<object>`\n codeBase: null, // `<object>`\n codeType: null, // `<object>`\n color: null, // `<font>` and `<hr>`. Use CSS instead\n compact: boolean, // Lists. Use CSS to reduce space between items instead\n declare: boolean, // `<object>`\n event: null, // `<script>`\n face: null, // `<font>`. Use CSS instead\n frame: null, // `<table>`\n frameBorder: null, // `<iframe>`. Use CSS `border` instead\n hSpace: number, // `<img>` and `<object>`\n leftMargin: number, // `<body>`\n link: null, // `<body>`. Use CSS `a:link {color: *}` instead\n longDesc: null, // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`\n lowSrc: null, // `<img>`. Use a `<picture>`\n marginHeight: number, // `<body>`\n marginWidth: number, // `<body>`\n noResize: boolean, // `<frame>`\n noHref: boolean, // `<area>`. Use no href instead of an explicit `nohref`\n noShade: boolean, // `<hr>`. Use background-color and height instead of borders\n noWrap: boolean, // `<td>` and `<th>`\n object: null, // `<applet>`\n profile: null, // `<head>`\n prompt: null, // `<isindex>`\n rev: null, // `<link>`\n rightMargin: number, // `<body>`\n rules: null, // `<table>`\n scheme: null, // `<meta>`\n scrolling: booleanish, // `<frame>`. Use overflow in the child context\n standby: null, // `<object>`\n summary: null, // `<table>`\n text: null, // `<body>`. Use CSS `color` instead\n topMargin: number, // `<body>`\n valueType: null, // `<param>`\n version: null, // `<html>`. Use a doctype.\n vAlign: null, // Several. Use CSS `vertical-align` instead\n vLink: null, // `<body>`. Use CSS `a:visited {color}` instead\n vSpace: number, // `<img>` and `<object>`\n\n // Non-standard Properties.\n allowTransparency: null,\n autoCorrect: null,\n autoSave: null,\n credentialless: boolean,\n disablePictureInPicture: boolean,\n disableRemotePlayback: boolean,\n exportParts: commaSeparated,\n part: spaceSeparated,\n prefix: null,\n property: null,\n results: number,\n security: null,\n unselectable: null\n },\n space: 'html',\n transform: caseInsensitiveTransform\n})\n", "import {caseSensitiveTransform} from './util/case-sensitive-transform.js'\nimport {create} from './util/create.js'\nimport {\n boolean,\n commaOrSpaceSeparated,\n commaSeparated,\n number,\n spaceSeparated\n} from './util/types.js'\n\nexport const svg = create({\n attributes: {\n accentHeight: 'accent-height',\n alignmentBaseline: 'alignment-baseline',\n arabicForm: 'arabic-form',\n baselineShift: 'baseline-shift',\n capHeight: 'cap-height',\n className: 'class',\n clipPath: 'clip-path',\n clipRule: 'clip-rule',\n colorInterpolation: 'color-interpolation',\n colorInterpolationFilters: 'color-interpolation-filters',\n colorProfile: 'color-profile',\n colorRendering: 'color-rendering',\n crossOrigin: 'crossorigin',\n dataType: 'datatype',\n dominantBaseline: 'dominant-baseline',\n enableBackground: 'enable-background',\n fillOpacity: 'fill-opacity',\n fillRule: 'fill-rule',\n floodColor: 'flood-color',\n floodOpacity: 'flood-opacity',\n fontFamily: 'font-family',\n fontSize: 'font-size',\n fontSizeAdjust: 'font-size-adjust',\n fontStretch: 'font-stretch',\n fontStyle: 'font-style',\n fontVariant: 'font-variant',\n fontWeight: 'font-weight',\n glyphName: 'glyph-name',\n glyphOrientationHorizontal: 'glyph-orientation-horizontal',\n glyphOrientationVertical: 'glyph-orientation-vertical',\n hrefLang: 'hreflang',\n horizAdvX: 'horiz-adv-x',\n horizOriginX: 'horiz-origin-x',\n horizOriginY: 'horiz-origin-y',\n imageRendering: 'image-rendering',\n letterSpacing: 'letter-spacing',\n lightingColor: 'lighting-color',\n markerEnd: 'marker-end',\n markerMid: 'marker-mid',\n markerStart: 'marker-start',\n maskType: 'mask-type',\n navDown: 'nav-down',\n navDownLeft: 'nav-down-left',\n navDownRight: 'nav-down-right',\n navLeft: 'nav-left',\n navNext: 'nav-next',\n navPrev: 'nav-prev',\n navRight: 'nav-right',\n navUp: 'nav-up',\n navUpLeft: 'nav-up-left',\n navUpRight: 'nav-up-right',\n onAbort: 'onabort',\n onActivate: 'onactivate',\n onAfterPrint: 'onafterprint',\n onBeforePrint: 'onbeforeprint',\n onBegin: 'onbegin',\n onCancel: 'oncancel',\n onCanPlay: 'oncanplay',\n onCanPlayThrough: 'oncanplaythrough',\n onChange: 'onchange',\n onClick: 'onclick',\n onClose: 'onclose',\n onCopy: 'oncopy',\n onCueChange: 'oncuechange',\n onCut: 'oncut',\n onDblClick: 'ondblclick',\n onDrag: 'ondrag',\n onDragEnd: 'ondragend',\n onDragEnter: 'ondragenter',\n onDragExit: 'ondragexit',\n onDragLeave: 'ondragleave',\n onDragOver: 'ondragover',\n onDragStart: 'ondragstart',\n onDrop: 'ondrop',\n onDurationChange: 'ondurationchange',\n onEmptied: 'onemptied',\n onEnd: 'onend',\n onEnded: 'onended',\n onError: 'onerror',\n onFocus: 'onfocus',\n onFocusIn: 'onfocusin',\n onFocusOut: 'onfocusout',\n onHashChange: 'onhashchange',\n onInput: 'oninput',\n onInvalid: 'oninvalid',\n onKeyDown: 'onkeydown',\n onKeyPress: 'onkeypress',\n onKeyUp: 'onkeyup',\n onLoad: 'onload',\n onLoadedData: 'onloadeddata',\n onLoadedMetadata: 'onloadedmetadata',\n onLoadStart: 'onloadstart',\n onMessage: 'onmessage',\n onMouseDown: 'onmousedown',\n onMouseEnter: 'onmouseenter',\n onMouseLeave: 'onmouseleave',\n onMouseMove: 'onmousemove',\n onMouseOut: 'onmouseout',\n onMouseOver: 'onmouseover',\n onMouseUp: 'onmouseup',\n onMouseWheel: 'onmousewheel',\n onOffline: 'onoffline',\n onOnline: 'ononline',\n onPageHide: 'onpagehide',\n onPageShow: 'onpageshow',\n onPaste: 'onpaste',\n onPause: 'onpause',\n onPlay: 'onplay',\n onPlaying: 'onplaying',\n onPopState: 'onpopstate',\n onProgress: 'onprogress',\n onRateChange: 'onratechange',\n onRepeat: 'onrepeat',\n onReset: 'onreset',\n onResize: 'onresize',\n onScroll: 'onscroll',\n onSeeked: 'onseeked',\n onSeeking: 'onseeking',\n onSelect: 'onselect',\n onShow: 'onshow',\n onStalled: 'onstalled',\n onStorage: 'onstorage',\n onSubmit: 'onsubmit',\n onSuspend: 'onsuspend',\n onTimeUpdate: 'ontimeupdate',\n onToggle: 'ontoggle',\n onUnload: 'onunload',\n onVolumeChange: 'onvolumechange',\n onWaiting: 'onwaiting',\n onZoom: 'onzoom',\n overlinePosition: 'overline-position',\n overlineThickness: 'overline-thickness',\n paintOrder: 'paint-order',\n panose1: 'panose-1',\n pointerEvents: 'pointer-events',\n referrerPolicy: 'referrerpolicy',\n renderingIntent: 'rendering-intent',\n shapeRendering: 'shape-rendering',\n stopColor: 'stop-color',\n stopOpacity: 'stop-opacity',\n strikethroughPosition: 'strikethrough-position',\n strikethroughThickness: 'strikethrough-thickness',\n strokeDashArray: 'stroke-dasharray',\n strokeDashOffset: 'stroke-dashoffset',\n strokeLineCap: 'stroke-linecap',\n strokeLineJoin: 'stroke-linejoin',\n strokeMiterLimit: 'stroke-miterlimit',\n strokeOpacity: 'stroke-opacity',\n strokeWidth: 'stroke-width',\n tabIndex: 'tabindex',\n textAnchor: 'text-anchor',\n textDecoration: 'text-decoration',\n textRendering: 'text-rendering',\n transformOrigin: 'transform-origin',\n typeOf: 'typeof',\n underlinePosition: 'underline-position',\n underlineThickness: 'underline-thickness',\n unicodeBidi: 'unicode-bidi',\n unicodeRange: 'unicode-range',\n unitsPerEm: 'units-per-em',\n vAlphabetic: 'v-alphabetic',\n vHanging: 'v-hanging',\n vIdeographic: 'v-ideographic',\n vMathematical: 'v-mathematical',\n vectorEffect: 'vector-effect',\n vertAdvY: 'vert-adv-y',\n vertOriginX: 'vert-origin-x',\n vertOriginY: 'vert-origin-y',\n wordSpacing: 'word-spacing',\n writingMode: 'writing-mode',\n xHeight: 'x-height',\n // These were camelcased in Tiny. Now lowercased in SVG 2\n playbackOrder: 'playbackorder',\n timelineBegin: 'timelinebegin'\n },\n properties: {\n about: commaOrSpaceSeparated,\n accentHeight: number,\n accumulate: null,\n additive: null,\n alignmentBaseline: null,\n alphabetic: number,\n amplitude: number,\n arabicForm: null,\n ascent: number,\n attributeName: null,\n attributeType: null,\n azimuth: number,\n bandwidth: null,\n baselineShift: null,\n baseFrequency: null,\n baseProfile: null,\n bbox: null,\n begin: null,\n bias: number,\n by: null,\n calcMode: null,\n capHeight: number,\n className: spaceSeparated,\n clip: null,\n clipPath: null,\n clipPathUnits: null,\n clipRule: null,\n color: null,\n colorInterpolation: null,\n colorInterpolationFilters: null,\n colorProfile: null,\n colorRendering: null,\n content: null,\n contentScriptType: null,\n contentStyleType: null,\n crossOrigin: null,\n cursor: null,\n cx: null,\n cy: null,\n d: null,\n dataType: null,\n defaultAction: null,\n descent: number,\n diffuseConstant: number,\n direction: null,\n display: null,\n dur: null,\n divisor: number,\n dominantBaseline: null,\n download: boolean,\n dx: null,\n dy: null,\n edgeMode: null,\n editable: null,\n elevation: number,\n enableBackground: null,\n end: null,\n event: null,\n exponent: number,\n externalResourcesRequired: null,\n fill: null,\n fillOpacity: number,\n fillRule: null,\n filter: null,\n filterRes: null,\n filterUnits: null,\n floodColor: null,\n floodOpacity: null,\n focusable: null,\n focusHighlight: null,\n fontFamily: null,\n fontSize: null,\n fontSizeAdjust: null,\n fontStretch: null,\n fontStyle: null,\n fontVariant: null,\n fontWeight: null,\n format: null,\n fr: null,\n from: null,\n fx: null,\n fy: null,\n g1: commaSeparated,\n g2: commaSeparated,\n glyphName: commaSeparated,\n glyphOrientationHorizontal: null,\n glyphOrientationVertical: null,\n glyphRef: null,\n gradientTransform: null,\n gradientUnits: null,\n handler: null,\n hanging: number,\n hatchContentUnits: null,\n hatchUnits: null,\n height: null,\n href: null,\n hrefLang: null,\n horizAdvX: number,\n horizOriginX: number,\n horizOriginY: number,\n id: null,\n ideographic: number,\n imageRendering: null,\n initialVisibility: null,\n in: null,\n in2: null,\n intercept: number,\n k: number,\n k1: number,\n k2: number,\n k3: number,\n k4: number,\n kernelMatrix: commaOrSpaceSeparated,\n kernelUnitLength: null,\n keyPoints: null, // SEMI_COLON_SEPARATED\n keySplines: null, // SEMI_COLON_SEPARATED\n keyTimes: null, // SEMI_COLON_SEPARATED\n kerning: null,\n lang: null,\n lengthAdjust: null,\n letterSpacing: null,\n lightingColor: null,\n limitingConeAngle: number,\n local: null,\n markerEnd: null,\n markerMid: null,\n markerStart: null,\n markerHeight: null,\n markerUnits: null,\n markerWidth: null,\n mask: null,\n maskContentUnits: null,\n maskType: null,\n maskUnits: null,\n mathematical: null,\n max: null,\n media: null,\n mediaCharacterEncoding: null,\n mediaContentEncodings: null,\n mediaSize: number,\n mediaTime: null,\n method: null,\n min: null,\n mode: null,\n name: null,\n navDown: null,\n navDownLeft: null,\n navDownRight: null,\n navLeft: null,\n navNext: null,\n navPrev: null,\n navRight: null,\n navUp: null,\n navUpLeft: null,\n navUpRight: null,\n numOctaves: null,\n observer: null,\n offset: null,\n onAbort: null,\n onActivate: null,\n onAfterPrint: null,\n onBeforePrint: null,\n onBegin: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnd: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFocusIn: null,\n onFocusOut: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadStart: null,\n onMessage: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onMouseWheel: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRepeat: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onShow: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onZoom: null,\n opacity: null,\n operator: null,\n order: null,\n orient: null,\n orientation: null,\n origin: null,\n overflow: null,\n overlay: null,\n overlinePosition: number,\n overlineThickness: number,\n paintOrder: null,\n panose1: null,\n path: null,\n pathLength: number,\n patternContentUnits: null,\n patternTransform: null,\n patternUnits: null,\n phase: null,\n ping: spaceSeparated,\n pitch: null,\n playbackOrder: null,\n pointerEvents: null,\n points: null,\n pointsAtX: number,\n pointsAtY: number,\n pointsAtZ: number,\n preserveAlpha: null,\n preserveAspectRatio: null,\n primitiveUnits: null,\n propagate: null,\n property: commaOrSpaceSeparated,\n r: null,\n radius: null,\n referrerPolicy: null,\n refX: null,\n refY: null,\n rel: commaOrSpaceSeparated,\n rev: commaOrSpaceSeparated,\n renderingIntent: null,\n repeatCount: null,\n repeatDur: null,\n requiredExtensions: commaOrSpaceSeparated,\n requiredFeatures: commaOrSpaceSeparated,\n requiredFonts: commaOrSpaceSeparated,\n requiredFormats: commaOrSpaceSeparated,\n resource: null,\n restart: null,\n result: null,\n rotate: null,\n rx: null,\n ry: null,\n scale: null,\n seed: null,\n shapeRendering: null,\n side: null,\n slope: null,\n snapshotTime: null,\n specularConstant: number,\n specularExponent: number,\n spreadMethod: null,\n spacing: null,\n startOffset: null,\n stdDeviation: null,\n stemh: null,\n stemv: null,\n stitchTiles: null,\n stopColor: null,\n stopOpacity: null,\n strikethroughPosition: number,\n strikethroughThickness: number,\n string: null,\n stroke: null,\n strokeDashArray: commaOrSpaceSeparated,\n strokeDashOffset: null,\n strokeLineCap: null,\n strokeLineJoin: null,\n strokeMiterLimit: number,\n strokeOpacity: number,\n strokeWidth: null,\n style: null,\n surfaceScale: number,\n syncBehavior: null,\n syncBehaviorDefault: null,\n syncMaster: null,\n syncTolerance: null,\n syncToleranceDefault: null,\n systemLanguage: commaOrSpaceSeparated,\n tabIndex: number,\n tableValues: null,\n target: null,\n targetX: number,\n targetY: number,\n textAnchor: null,\n textDecoration: null,\n textRendering: null,\n textLength: null,\n timelineBegin: null,\n title: null,\n transformBehavior: null,\n type: null,\n typeOf: commaOrSpaceSeparated,\n to: null,\n transform: null,\n transformOrigin: null,\n u1: null,\n u2: null,\n underlinePosition: number,\n underlineThickness: number,\n unicode: null,\n unicodeBidi: null,\n unicodeRange: null,\n unitsPerEm: number,\n values: null,\n vAlphabetic: number,\n vMathematical: number,\n vectorEffect: null,\n vHanging: number,\n vIdeographic: number,\n version: null,\n vertAdvY: number,\n vertOriginX: number,\n vertOriginY: number,\n viewBox: null,\n viewTarget: null,\n visibility: null,\n width: null,\n widths: null,\n wordSpacing: null,\n writingMode: null,\n x: null,\n x1: null,\n x2: null,\n xChannelSelector: null,\n xHeight: number,\n y: null,\n y1: null,\n y2: null,\n yChannelSelector: null,\n z: null,\n zoomAndPan: null\n },\n space: 'svg',\n transform: caseSensitiveTransform\n})\n", "import {create} from './util/create.js'\n\nexport const xlink = create({\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n },\n space: 'xlink',\n transform(_, property) {\n return 'xlink:' + property.slice(5).toLowerCase()\n }\n})\n", "import {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const xmlns = create({\n attributes: {xmlnsxlink: 'xmlns:xlink'},\n properties: {xmlnsXLink: null, xmlns: null},\n space: 'xmlns',\n transform: caseInsensitiveTransform\n})\n", "import {create} from './util/create.js'\n\nexport const xml = create({\n properties: {xmlBase: null, xmlLang: null, xmlSpace: null},\n space: 'xml',\n transform(_, property) {\n return 'xml:' + property.slice(3).toLowerCase()\n }\n})\n", "/**\n * @import {Schema} from 'property-information'\n */\n\nimport {DefinedInfo} from './util/defined-info.js'\nimport {Info} from './util/info.js'\nimport {normalize} from './normalize.js'\n\nconst cap = /[A-Z]/g\nconst dash = /-[a-z]/g\nconst valid = /^data[-\\w.:]+$/i\n\n/**\n * Look up info on a property.\n *\n * In most cases the given `schema` contains info on the property.\n * All standard,\n * most legacy,\n * and some non-standard properties are supported.\n * For these cases,\n * the returned `Info` has hints about the value of the property.\n *\n * `name` can also be a valid data attribute or property,\n * in which case an `Info` object with the correctly cased `attribute` and\n * `property` is returned.\n *\n * `name` can be an unknown attribute,\n * in which case an `Info` object with `attribute` and `property` set to the\n * given name is returned.\n * It is not recommended to provide unsupported legacy or recently specced\n * properties.\n *\n *\n * @param {Schema} schema\n * Schema;\n * either the `html` or `svg` export.\n * @param {string} value\n * An attribute-like or property-like name;\n * it will be passed through `normalize` to hopefully find the correct info.\n * @returns {Info}\n * Info.\n */\nexport function find(schema, value) {\n const normal = normalize(value)\n let property = value\n let Type = Info\n\n if (normal in schema.normal) {\n return schema.property[schema.normal[normal]]\n }\n\n if (normal.length > 4 && normal.slice(0, 4) === 'data' && valid.test(value)) {\n // Attribute or property.\n if (value.charAt(4) === '-') {\n // Turn it into a property.\n const rest = value.slice(5).replace(dash, camelcase)\n property = 'data' + rest.charAt(0).toUpperCase() + rest.slice(1)\n } else {\n // Turn it into an attribute.\n const rest = value.slice(4)\n\n if (!dash.test(rest)) {\n let dashes = rest.replace(cap, kebab)\n\n if (dashes.charAt(0) !== '-') {\n dashes = '-' + dashes\n }\n\n value = 'data' + dashes\n }\n }\n\n Type = DefinedInfo\n }\n\n return new Type(property, value)\n}\n\n/**\n * @param {string} $0\n * Value.\n * @returns {string}\n * Kebab.\n */\nfunction kebab($0) {\n return '-' + $0.toLowerCase()\n}\n\n/**\n * @param {string} $0\n * Value.\n * @returns {string}\n * Camel.\n */\nfunction camelcase($0) {\n return $0.charAt(1).toUpperCase()\n}\n", "// Note: types exposed from `index.d.ts`.\nimport {merge} from './lib/util/merge.js'\nimport {aria} from './lib/aria.js'\nimport {html as htmlBase} from './lib/html.js'\nimport {svg as svgBase} from './lib/svg.js'\nimport {xlink} from './lib/xlink.js'\nimport {xmlns} from './lib/xmlns.js'\nimport {xml} from './lib/xml.js'\n\nexport {hastToReact} from './lib/hast-to-react.js'\n\nexport const html = merge([aria, htmlBase, xlink, xmlns, xml], 'html')\n\nexport {find} from './lib/find.js'\nexport {normalize} from './lib/normalize.js'\n\nexport const svg = merge([aria, svgBase, xlink, xmlns, xml], 'svg')\n", "/**\n * @callback Handler\n * Handle a value, with a certain ID field set to a certain value.\n * The ID field is passed to `zwitch`, and it\u2019s value is this function\u2019s\n * place on the `handlers` record.\n * @param {...any} parameters\n * Arbitrary parameters passed to the zwitch.\n * The first will be an object with a certain ID field set to a certain value.\n * @returns {any}\n * Anything!\n */\n\n/**\n * @callback UnknownHandler\n * Handle values that do have a certain ID field, but it\u2019s set to a value\n * that is not listed in the `handlers` record.\n * @param {unknown} value\n * An object with a certain ID field set to an unknown value.\n * @param {...any} rest\n * Arbitrary parameters passed to the zwitch.\n * @returns {any}\n * Anything!\n */\n\n/**\n * @callback InvalidHandler\n * Handle values that do not have a certain ID field.\n * @param {unknown} value\n * Any unknown value.\n * @param {...any} rest\n * Arbitrary parameters passed to the zwitch.\n * @returns {void|null|undefined|never}\n * This should crash or return nothing.\n */\n\n/**\n * @template {InvalidHandler} [Invalid=InvalidHandler]\n * @template {UnknownHandler} [Unknown=UnknownHandler]\n * @template {Record<string, Handler>} [Handlers=Record<string, Handler>]\n * @typedef Options\n * Configuration (required).\n * @property {Invalid} [invalid]\n * Handler to use for invalid values.\n * @property {Unknown} [unknown]\n * Handler to use for unknown values.\n * @property {Handlers} [handlers]\n * Handlers to use.\n */\n\nconst own = {}.hasOwnProperty\n\n/**\n * Handle values based on a field.\n *\n * @template {InvalidHandler} [Invalid=InvalidHandler]\n * @template {UnknownHandler} [Unknown=UnknownHandler]\n * @template {Record<string, Handler>} [Handlers=Record<string, Handler>]\n * @param {string} key\n * Field to switch on.\n * @param {Options<Invalid, Unknown, Handlers>} [options]\n * Configuration (required).\n * @returns {{unknown: Unknown, invalid: Invalid, handlers: Handlers, (...parameters: Parameters<Handlers[keyof Handlers]>): ReturnType<Handlers[keyof Handlers]>, (...parameters: Parameters<Unknown>): ReturnType<Unknown>}}\n */\nexport function zwitch(key, options) {\n const settings = options || {}\n\n /**\n * Handle one value.\n *\n * Based on the bound `key`, a respective handler will be called.\n * If `value` is not an object, or doesn\u2019t have a `key` property, the special\n * \u201Cinvalid\u201D handler will be called.\n * If `value` has an unknown `key`, the special \u201Cunknown\u201D handler will be\n * called.\n *\n * All arguments, and the context object, are passed through to the handler,\n * and it\u2019s result is returned.\n *\n * @this {unknown}\n * Any context object.\n * @param {unknown} [value]\n * Any value.\n * @param {...unknown} parameters\n * Arbitrary parameters passed to the zwitch.\n * @property {Handler} invalid\n * Handle for values that do not have a certain ID field.\n * @property {Handler} unknown\n * Handle values that do have a certain ID field, but it\u2019s set to a value\n * that is not listed in the `handlers` record.\n * @property {Handlers} handlers\n * Record of handlers.\n * @returns {unknown}\n * Anything.\n */\n function one(value, ...parameters) {\n /** @type {Handler|undefined} */\n let fn = one.invalid\n const handlers = one.handlers\n\n if (value && own.call(value, key)) {\n // @ts-expect-error Indexable.\n const id = String(value[key])\n // @ts-expect-error Indexable.\n fn = own.call(handlers, id) ? handlers[id] : one.unknown\n }\n\n if (fn) {\n return fn.call(this, value, ...parameters)\n }\n }\n\n one.handlers = settings.handlers || {}\n one.invalid = settings.invalid\n one.unknown = settings.unknown\n\n // @ts-expect-error: matches!\n return one\n}\n", "/**\n * @typedef CoreOptions\n * @property {ReadonlyArray<string>} [subset=[]]\n * Whether to only escape the given subset of characters.\n * @property {boolean} [escapeOnly=false]\n * Whether to only escape possibly dangerous characters.\n * Those characters are `\"`, `&`, `'`, `<`, `>`, and `` ` ``.\n *\n * @typedef FormatOptions\n * @property {(code: number, next: number, options: CoreWithFormatOptions) => string} format\n * Format strategy.\n *\n * @typedef {CoreOptions & FormatOptions & import('./util/format-smart.js').FormatSmartOptions} CoreWithFormatOptions\n */\n\nconst defaultSubsetRegex = /[\"&'<>`]/g\nconst surrogatePairsRegex = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g\nconst controlCharactersRegex =\n // eslint-disable-next-line no-control-regex, unicorn/no-hex-escape\n /[\\x01-\\t\\v\\f\\x0E-\\x1F\\x7F\\x81\\x8D\\x8F\\x90\\x9D\\xA0-\\uFFFF]/g\nconst regexEscapeRegex = /[|\\\\{}()[\\]^$+*?.]/g\n\n/** @type {WeakMap<ReadonlyArray<string>, RegExp>} */\nconst subsetToRegexCache = new WeakMap()\n\n/**\n * Encode certain characters in `value`.\n *\n * @param {string} value\n * @param {CoreWithFormatOptions} options\n * @returns {string}\n */\nexport function core(value, options) {\n value = value.replace(\n options.subset\n ? charactersToExpressionCached(options.subset)\n : defaultSubsetRegex,\n basic\n )\n\n if (options.subset || options.escapeOnly) {\n return value\n }\n\n return (\n value\n // Surrogate pairs.\n .replace(surrogatePairsRegex, surrogate)\n // BMP control characters (C0 except for LF, CR, SP; DEL; and some more\n // non-ASCII ones).\n .replace(controlCharactersRegex, basic)\n )\n\n /**\n * @param {string} pair\n * @param {number} index\n * @param {string} all\n */\n function surrogate(pair, index, all) {\n return options.format(\n (pair.charCodeAt(0) - 0xd800) * 0x400 +\n pair.charCodeAt(1) -\n 0xdc00 +\n 0x10000,\n all.charCodeAt(index + 2),\n options\n )\n }\n\n /**\n * @param {string} character\n * @param {number} index\n * @param {string} all\n */\n function basic(character, index, all) {\n return options.format(\n character.charCodeAt(0),\n all.charCodeAt(index + 1),\n options\n )\n }\n}\n\n/**\n * A wrapper function that caches the result of `charactersToExpression` with a WeakMap.\n * This can improve performance when tooling calls `charactersToExpression` repeatedly\n * with the same subset.\n *\n * @param {ReadonlyArray<string>} subset\n * @returns {RegExp}\n */\nfunction charactersToExpressionCached(subset) {\n let cached = subsetToRegexCache.get(subset)\n\n if (!cached) {\n cached = charactersToExpression(subset)\n subsetToRegexCache.set(subset, cached)\n }\n\n return cached\n}\n\n/**\n * @param {ReadonlyArray<string>} subset\n * @returns {RegExp}\n */\nfunction charactersToExpression(subset) {\n /** @type {Array<string>} */\n const groups = []\n let index = -1\n\n while (++index < subset.length) {\n groups.push(subset[index].replace(regexEscapeRegex, '\\\\$&'))\n }\n\n return new RegExp('(?:' + groups.join('|') + ')', 'g')\n}\n", "const hexadecimalRegex = /[\\dA-Fa-f]/\n\n/**\n * Configurable ways to encode characters as hexadecimal references.\n *\n * @param {number} code\n * @param {number} next\n * @param {boolean|undefined} omit\n * @returns {string}\n */\nexport function toHexadecimal(code, next, omit) {\n const value = '&#x' + code.toString(16).toUpperCase()\n return omit && next && !hexadecimalRegex.test(String.fromCharCode(next))\n ? value\n : value + ';'\n}\n", "const decimalRegex = /\\d/\n\n/**\n * Configurable ways to encode characters as decimal references.\n *\n * @param {number} code\n * @param {number} next\n * @param {boolean|undefined} omit\n * @returns {string}\n */\nexport function toDecimal(code, next, omit) {\n const value = '&#' + String(code)\n return omit && next && !decimalRegex.test(String.fromCharCode(next))\n ? value\n : value + ';'\n}\n", "/**\n * List of legacy HTML named character references that don\u2019t need a trailing semicolon.\n *\n * @type {Array<string>}\n */\nexport const characterEntitiesLegacy = [\n 'AElig',\n 'AMP',\n 'Aacute',\n 'Acirc',\n 'Agrave',\n 'Aring',\n 'Atilde',\n 'Auml',\n 'COPY',\n 'Ccedil',\n 'ETH',\n 'Eacute',\n 'Ecirc',\n 'Egrave',\n 'Euml',\n 'GT',\n 'Iacute',\n 'Icirc',\n 'Igrave',\n 'Iuml',\n 'LT',\n 'Ntilde',\n 'Oacute',\n 'Ocirc',\n 'Ograve',\n 'Oslash',\n 'Otilde',\n 'Ouml',\n 'QUOT',\n 'REG',\n 'THORN',\n 'Uacute',\n 'Ucirc',\n 'Ugrave',\n 'Uuml',\n 'Yacute',\n 'aacute',\n 'acirc',\n 'acute',\n 'aelig',\n 'agrave',\n 'amp',\n 'aring',\n 'atilde',\n 'auml',\n 'brvbar',\n 'ccedil',\n 'cedil',\n 'cent',\n 'copy',\n 'curren',\n 'deg',\n 'divide',\n 'eacute',\n 'ecirc',\n 'egrave',\n 'eth',\n 'euml',\n 'frac12',\n 'frac14',\n 'frac34',\n 'gt',\n 'iacute',\n 'icirc',\n 'iexcl',\n 'igrave',\n 'iquest',\n 'iuml',\n 'laquo',\n 'lt',\n 'macr',\n 'micro',\n 'middot',\n 'nbsp',\n 'not',\n 'ntilde',\n 'oacute',\n 'ocirc',\n 'ograve',\n 'ordf',\n 'ordm',\n 'oslash',\n 'otilde',\n 'ouml',\n 'para',\n 'plusmn',\n 'pound',\n 'quot',\n 'raquo',\n 'reg',\n 'sect',\n 'shy',\n 'sup1',\n 'sup2',\n 'sup3',\n 'szlig',\n 'thorn',\n 'times',\n 'uacute',\n 'ucirc',\n 'ugrave',\n 'uml',\n 'uuml',\n 'yacute',\n 'yen',\n 'yuml'\n]\n", "/**\n * Map of named character references from HTML 4.\n *\n * @type {Record<string, string>}\n */\nexport const characterEntitiesHtml4 = {\n nbsp: '\u00A0',\n iexcl: '\u00A1',\n cent: '\u00A2',\n pound: '\u00A3',\n curren: '\u00A4',\n yen: '\u00A5',\n brvbar: '\u00A6',\n sect: '\u00A7',\n uml: '\u00A8',\n copy: '\u00A9',\n ordf: '\u00AA',\n laquo: '\u00AB',\n not: '\u00AC',\n shy: '\u00AD',\n reg: '\u00AE',\n macr: '\u00AF',\n deg: '\u00B0',\n plusmn: '\u00B1',\n sup2: '\u00B2',\n sup3: '\u00B3',\n acute: '\u00B4',\n micro: '\u00B5',\n para: '\u00B6',\n middot: '\u00B7',\n cedil: '\u00B8',\n sup1: '\u00B9',\n ordm: '\u00BA',\n raquo: '\u00BB',\n frac14: '\u00BC',\n frac12: '\u00BD',\n frac34: '\u00BE',\n iquest: '\u00BF',\n Agrave: '\u00C0',\n Aacute: '\u00C1',\n Acirc: '\u00C2',\n Atilde: '\u00C3',\n Auml: '\u00C4',\n Aring: '\u00C5',\n AElig: '\u00C6',\n Ccedil: '\u00C7',\n Egrave: '\u00C8',\n Eacute: '\u00C9',\n Ecirc: '\u00CA',\n Euml: '\u00CB',\n Igrave: '\u00CC',\n Iacute: '\u00CD',\n Icirc: '\u00CE',\n Iuml: '\u00CF',\n ETH: '\u00D0',\n Ntilde: '\u00D1',\n Ograve: '\u00D2',\n Oacute: '\u00D3',\n Ocirc: '\u00D4',\n Otilde: '\u00D5',\n Ouml: '\u00D6',\n times: '\u00D7',\n Oslash: '\u00D8',\n Ugrave: '\u00D9',\n Uacute: '\u00DA',\n Ucirc: '\u00DB',\n Uuml: '\u00DC',\n Yacute: '\u00DD',\n THORN: '\u00DE',\n szlig: '\u00DF',\n agrave: '\u00E0',\n aacute: '\u00E1',\n acirc: '\u00E2',\n atilde: '\u00E3',\n auml: '\u00E4',\n aring: '\u00E5',\n aelig: '\u00E6',\n ccedil: '\u00E7',\n egrave: '\u00E8',\n eacute: '\u00E9',\n ecirc: '\u00EA',\n euml: '\u00EB',\n igrave: '\u00EC',\n iacute: '\u00ED',\n icirc: '\u00EE',\n iuml: '\u00EF',\n eth: '\u00F0',\n ntilde: '\u00F1',\n ograve: '\u00F2',\n oacute: '\u00F3',\n ocirc: '\u00F4',\n otilde: '\u00F5',\n ouml: '\u00F6',\n divide: '\u00F7',\n oslash: '\u00F8',\n ugrave: '\u00F9',\n uacute: '\u00FA',\n ucirc: '\u00FB',\n uuml: '\u00FC',\n yacute: '\u00FD',\n thorn: '\u00FE',\n yuml: '\u00FF',\n fnof: '\u0192',\n Alpha: '\u0391',\n Beta: '\u0392',\n Gamma: '\u0393',\n Delta: '\u0394',\n Epsilon: '\u0395',\n Zeta: '\u0396',\n Eta: '\u0397',\n Theta: '\u0398',\n Iota: '\u0399',\n Kappa: '\u039A',\n Lambda: '\u039B',\n Mu: '\u039C',\n Nu: '\u039D',\n Xi: '\u039E',\n Omicron: '\u039F',\n Pi: '\u03A0',\n Rho: '\u03A1',\n Sigma: '\u03A3',\n Tau: '\u03A4',\n Upsilon: '\u03A5',\n Phi: '\u03A6',\n Chi: '\u03A7',\n Psi: '\u03A8',\n Omega: '\u03A9',\n alpha: '\u03B1',\n beta: '\u03B2',\n gamma: '\u03B3',\n delta: '\u03B4',\n epsilon: '\u03B5',\n zeta: '\u03B6',\n eta: '\u03B7',\n theta: '\u03B8',\n iota: '\u03B9',\n kappa: '\u03BA',\n lambda: '\u03BB',\n mu: '\u03BC',\n nu: '\u03BD',\n xi: '\u03BE',\n omicron: '\u03BF',\n pi: '\u03C0',\n rho: '\u03C1',\n sigmaf: '\u03C2',\n sigma: '\u03C3',\n tau: '\u03C4',\n upsilon: '\u03C5',\n phi: '\u03C6',\n chi: '\u03C7',\n psi: '\u03C8',\n omega: '\u03C9',\n thetasym: '\u03D1',\n upsih: '\u03D2',\n piv: '\u03D6',\n bull: '\u2022',\n hellip: '\u2026',\n prime: '\u2032',\n Prime: '\u2033',\n oline: '\u203E',\n frasl: '\u2044',\n weierp: '\u2118',\n image: '\u2111',\n real: '\u211C',\n trade: '\u2122',\n alefsym: '\u2135',\n larr: '\u2190',\n uarr: '\u2191',\n rarr: '\u2192',\n darr: '\u2193',\n harr: '\u2194',\n crarr: '\u21B5',\n lArr: '\u21D0',\n uArr: '\u21D1',\n rArr: '\u21D2',\n dArr: '\u21D3',\n hArr: '\u21D4',\n forall: '\u2200',\n part: '\u2202',\n exist: '\u2203',\n empty: '\u2205',\n nabla: '\u2207',\n isin: '\u2208',\n notin: '\u2209',\n ni: '\u220B',\n prod: '\u220F',\n sum: '\u2211',\n minus: '\u2212',\n lowast: '\u2217',\n radic: '\u221A',\n prop: '\u221D',\n infin: '\u221E',\n ang: '\u2220',\n and: '\u2227',\n or: '\u2228',\n cap: '\u2229',\n cup: '\u222A',\n int: '\u222B',\n there4: '\u2234',\n sim: '\u223C',\n cong: '\u2245',\n asymp: '\u2248',\n ne: '\u2260',\n equiv: '\u2261',\n le: '\u2264',\n ge: '\u2265',\n sub: '\u2282',\n sup: '\u2283',\n nsub: '\u2284',\n sube: '\u2286',\n supe: '\u2287',\n oplus: '\u2295',\n otimes: '\u2297',\n perp: '\u22A5',\n sdot: '\u22C5',\n lceil: '\u2308',\n rceil: '\u2309',\n lfloor: '\u230A',\n rfloor: '\u230B',\n lang: '\u2329',\n rang: '\u232A',\n loz: '\u25CA',\n spades: '\u2660',\n clubs: '\u2663',\n hearts: '\u2665',\n diams: '\u2666',\n quot: '\"',\n amp: '&',\n lt: '<',\n gt: '>',\n OElig: '\u0152',\n oelig: '\u0153',\n Scaron: '\u0160',\n scaron: '\u0161',\n Yuml: '\u0178',\n circ: '\u02C6',\n tilde: '\u02DC',\n ensp: '\u2002',\n emsp: '\u2003',\n thinsp: '\u2009',\n zwnj: '\u200C',\n zwj: '\u200D',\n lrm: '\u200E',\n rlm: '\u200F',\n ndash: '\u2013',\n mdash: '\u2014',\n lsquo: '\u2018',\n rsquo: '\u2019',\n sbquo: '\u201A',\n ldquo: '\u201C',\n rdquo: '\u201D',\n bdquo: '\u201E',\n dagger: '\u2020',\n Dagger: '\u2021',\n permil: '\u2030',\n lsaquo: '\u2039',\n rsaquo: '\u203A',\n euro: '\u20AC'\n}\n", "/**\n * List of legacy (that don\u2019t need a trailing `;`) named references which could,\n * depending on what follows them, turn into a different meaning\n *\n * @type {Array<string>}\n */\nexport const dangerous = [\n 'cent',\n 'copy',\n 'divide',\n 'gt',\n 'lt',\n 'not',\n 'para',\n 'times'\n]\n", "import {characterEntitiesLegacy} from 'character-entities-legacy'\nimport {characterEntitiesHtml4} from 'character-entities-html4'\nimport {dangerous} from '../constant/dangerous.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * `characterEntitiesHtml4` but inverted.\n *\n * @type {Record<string, string>}\n */\nconst characters = {}\n\n/** @type {string} */\nlet key\n\nfor (key in characterEntitiesHtml4) {\n if (own.call(characterEntitiesHtml4, key)) {\n characters[characterEntitiesHtml4[key]] = key\n }\n}\n\nconst notAlphanumericRegex = /[^\\dA-Za-z]/\n\n/**\n * Configurable ways to encode characters as named references.\n *\n * @param {number} code\n * @param {number} next\n * @param {boolean|undefined} omit\n * @param {boolean|undefined} attribute\n * @returns {string}\n */\nexport function toNamed(code, next, omit, attribute) {\n const character = String.fromCharCode(code)\n\n if (own.call(characters, character)) {\n const name = characters[character]\n const value = '&' + name\n\n if (\n omit &&\n characterEntitiesLegacy.includes(name) &&\n !dangerous.includes(name) &&\n (!attribute ||\n (next &&\n next !== 61 /* `=` */ &&\n notAlphanumericRegex.test(String.fromCharCode(next))))\n ) {\n return value\n }\n\n return value + ';'\n }\n\n return ''\n}\n", "/**\n * @typedef FormatSmartOptions\n * @property {boolean} [useNamedReferences=false]\n * Prefer named character references (`&amp;`) where possible.\n * @property {boolean} [useShortestReferences=false]\n * Prefer the shortest possible reference, if that results in less bytes.\n * **Note**: `useNamedReferences` can be omitted when using `useShortestReferences`.\n * @property {boolean} [omitOptionalSemicolons=false]\n * Whether to omit semicolons when possible.\n * **Note**: This creates what HTML calls \u201Cparse errors\u201D but is otherwise still valid HTML \u2014 don\u2019t use this except when building a minifier.\n * Omitting semicolons is possible for certain named and numeric references in some cases.\n * @property {boolean} [attribute=false]\n * Create character references which don\u2019t fail in attributes.\n * **Note**: `attribute` only applies when operating dangerously with\n * `omitOptionalSemicolons: true`.\n */\n\nimport {toHexadecimal} from './to-hexadecimal.js'\nimport {toDecimal} from './to-decimal.js'\nimport {toNamed} from './to-named.js'\n\n/**\n * Configurable ways to encode a character yielding pretty or small results.\n *\n * @param {number} code\n * @param {number} next\n * @param {FormatSmartOptions} options\n * @returns {string}\n */\nexport function formatSmart(code, next, options) {\n let numeric = toHexadecimal(code, next, options.omitOptionalSemicolons)\n /** @type {string|undefined} */\n let named\n\n if (options.useNamedReferences || options.useShortestReferences) {\n named = toNamed(\n code,\n next,\n options.omitOptionalSemicolons,\n options.attribute\n )\n }\n\n // Use the shortest numeric reference when requested.\n // A simple algorithm would use decimal for all code points under 100, as\n // those are shorter than hexadecimal:\n //\n // * `&#99;` vs `&#x63;` (decimal shorter)\n // * `&#100;` vs `&#x64;` (equal)\n //\n // However, because we take `next` into consideration when `omit` is used,\n // And it would be possible that decimals are shorter on bigger values as\n // well if `next` is hexadecimal but not decimal, we instead compare both.\n if (\n (options.useShortestReferences || !named) &&\n options.useShortestReferences\n ) {\n const decimal = toDecimal(code, next, options.omitOptionalSemicolons)\n\n if (decimal.length < numeric.length) {\n numeric = decimal\n }\n }\n\n return named &&\n (!options.useShortestReferences || named.length < numeric.length)\n ? named\n : numeric\n}\n", "/**\n * @typedef {import('./core.js').CoreOptions & import('./util/format-smart.js').FormatSmartOptions} Options\n * @typedef {import('./core.js').CoreOptions} LightOptions\n */\n\nimport {core} from './core.js'\nimport {formatSmart} from './util/format-smart.js'\nimport {formatBasic} from './util/format-basic.js'\n\n/**\n * Encode special characters in `value`.\n *\n * @param {string} value\n * Value to encode.\n * @param {Options} [options]\n * Configuration.\n * @returns {string}\n * Encoded value.\n */\nexport function stringifyEntities(value, options) {\n return core(value, Object.assign({format: formatSmart}, options))\n}\n\n/**\n * Encode special characters in `value` as hexadecimals.\n *\n * @param {string} value\n * Value to encode.\n * @param {LightOptions} [options]\n * Configuration.\n * @returns {string}\n * Encoded value.\n */\nexport function stringifyEntitiesLight(value, options) {\n return core(value, Object.assign({format: formatBasic}, options))\n}\n", "/**\n * @import {Comment, Parents} from 'hast'\n * @import {State} from '../index.js'\n */\n\nimport {stringifyEntities} from 'stringify-entities'\n\nconst htmlCommentRegex = /^>|^->|<!--|-->|--!>|<!-$/g\n\n// Declare arrays as variables so it can be cached by `stringifyEntities`\nconst bogusCommentEntitySubset = ['>']\nconst commentEntitySubset = ['<', '>']\n\n/**\n * Serialize a comment.\n *\n * @param {Comment} node\n * Node to handle.\n * @param {number | undefined} _1\n * Index of `node` in `parent.\n * @param {Parents | undefined} _2\n * Parent of `node`.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {string}\n * Serialized node.\n */\nexport function comment(node, _1, _2, state) {\n // See: <https://html.spec.whatwg.org/multipage/syntax.html#comments>\n return state.settings.bogusComments\n ? '<?' +\n stringifyEntities(\n node.value,\n Object.assign({}, state.settings.characterReferences, {\n subset: bogusCommentEntitySubset\n })\n ) +\n '>'\n : '<!--' + node.value.replace(htmlCommentRegex, encode) + '-->'\n\n /**\n * @param {string} $0\n */\n function encode($0) {\n return stringifyEntities(\n $0,\n Object.assign({}, state.settings.characterReferences, {\n subset: commentEntitySubset\n })\n )\n }\n}\n", "/**\n * @import {Doctype, Parents} from 'hast'\n * @import {State} from '../index.js'\n */\n\n/**\n * Serialize a doctype.\n *\n * @param {Doctype} _1\n * Node to handle.\n * @param {number | undefined} _2\n * Index of `node` in `parent.\n * @param {Parents | undefined} _3\n * Parent of `node`.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {string}\n * Serialized node.\n */\nexport function doctype(_1, _2, _3, state) {\n return (\n '<!' +\n (state.settings.upperDoctype ? 'DOCTYPE' : 'doctype') +\n (state.settings.tightDoctype ? '' : ' ') +\n 'html>'\n )\n}\n", "/**\n * Count how often a character (or substring) is used in a string.\n *\n * @param {string} value\n * Value to search in.\n * @param {string} character\n * Character (or substring) to look for.\n * @return {number}\n * Number of times `character` occurred in `value`.\n */\nexport function ccount(value, character) {\n const source = String(value)\n\n if (typeof character !== 'string') {\n throw new TypeError('Expected character')\n }\n\n let count = 0\n let index = source.indexOf(character)\n\n while (index !== -1) {\n count++\n index = source.indexOf(character, index + character.length)\n }\n\n return count\n}\n", "/**\n * @typedef Options\n * Configuration for `stringify`.\n * @property {boolean} [padLeft=true]\n * Whether to pad a space before a token.\n * @property {boolean} [padRight=false]\n * Whether to pad a space after a token.\n */\n\n/**\n * @typedef {Options} StringifyOptions\n * Please use `StringifyOptions` instead.\n */\n\n/**\n * Parse comma-separated tokens to an array.\n *\n * @param {string} value\n * Comma-separated tokens.\n * @returns {Array<string>}\n * List of tokens.\n */\nexport function parse(value) {\n /** @type {Array<string>} */\n const tokens = []\n const input = String(value || '')\n let index = input.indexOf(',')\n let start = 0\n /** @type {boolean} */\n let end = false\n\n while (!end) {\n if (index === -1) {\n index = input.length\n end = true\n }\n\n const token = input.slice(start, index).trim()\n\n if (token || !end) {\n tokens.push(token)\n }\n\n start = index + 1\n index = input.indexOf(',', start)\n }\n\n return tokens\n}\n\n/**\n * Serialize an array of strings or numbers to comma-separated tokens.\n *\n * @param {Array<string|number>} values\n * List of tokens.\n * @param {Options} [options]\n * Configuration for `stringify` (optional).\n * @returns {string}\n * Comma-separated tokens.\n */\nexport function stringify(values, options) {\n const settings = options || {}\n\n // Ensure the last empty entry is seen.\n const input = values[values.length - 1] === '' ? [...values, ''] : values\n\n return input\n .join(\n (settings.padRight ? ' ' : '') +\n ',' +\n (settings.padLeft === false ? '' : ' ')\n )\n .trim()\n}\n", "/**\n * Parse space-separated tokens to an array of strings.\n *\n * @param {string} value\n * Space-separated tokens.\n * @returns {Array<string>}\n * List of tokens.\n */\nexport function parse(value) {\n const input = String(value || '').trim()\n return input ? input.split(/[ \\t\\n\\r\\f]+/g) : []\n}\n\n/**\n * Serialize an array of strings as space separated-tokens.\n *\n * @param {Array<string|number>} values\n * List of tokens.\n * @returns {string}\n * Space-separated tokens.\n */\nexport function stringify(values) {\n return values.join(' ').trim()\n}\n", "/**\n * @typedef {import('hast').Nodes} Nodes\n */\n\n// HTML whitespace expression.\n// See <https://infra.spec.whatwg.org/#ascii-whitespace>.\nconst re = /[ \\t\\n\\f\\r]/g\n\n/**\n * Check if the given value is *inter-element whitespace*.\n *\n * @param {Nodes | string} thing\n * Thing to check (`Node` or `string`).\n * @returns {boolean}\n * Whether the `value` is inter-element whitespace (`boolean`): consisting of\n * zero or more of space, tab (`\\t`), line feed (`\\n`), carriage return\n * (`\\r`), or form feed (`\\f`); if a node is passed it must be a `Text` node,\n * whose `value` field is checked.\n */\nexport function whitespace(thing) {\n return typeof thing === 'object'\n ? thing.type === 'text'\n ? empty(thing.value)\n : false\n : empty(thing)\n}\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction empty(value) {\n return value.replace(re, '') === ''\n}\n", "/**\n * @import {Parents, RootContent} from 'hast'\n */\n\nimport {whitespace} from 'hast-util-whitespace'\n\nexport const siblingAfter = siblings(1)\nexport const siblingBefore = siblings(-1)\n\n/** @type {Array<RootContent>} */\nconst emptyChildren = []\n\n/**\n * Factory to check siblings in a direction.\n *\n * @param {number} increment\n */\nfunction siblings(increment) {\n return sibling\n\n /**\n * Find applicable siblings in a direction.\n *\n * @template {Parents} Parent\n * Parent type.\n * @param {Parent | undefined} parent\n * Parent.\n * @param {number | undefined} index\n * Index of child in `parent`.\n * @param {boolean | undefined} [includeWhitespace=false]\n * Whether to include whitespace (default: `false`).\n * @returns {Parent extends {children: Array<infer Child>} ? Child | undefined : never}\n * Child of parent.\n */\n function sibling(parent, index, includeWhitespace) {\n const siblings = parent ? parent.children : emptyChildren\n let offset = (index || 0) + increment\n let next = siblings[offset]\n\n if (!includeWhitespace) {\n while (next && whitespace(next)) {\n offset += increment\n next = siblings[offset]\n }\n }\n\n // @ts-expect-error: it\u2019s a correct child.\n return next\n }\n}\n", "/**\n * @import {Element, Parents} from 'hast'\n */\n\n/**\n * @callback OmitHandle\n * Check if a tag can be omitted.\n * @param {Element} element\n * Element to check.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether to omit a tag.\n *\n */\n\nconst own = {}.hasOwnProperty\n\n/**\n * Factory to check if a given node can have a tag omitted.\n *\n * @param {Record<string, OmitHandle>} handlers\n * Omission handlers, where each key is a tag name, and each value is the\n * corresponding handler.\n * @returns {OmitHandle}\n * Whether to omit a tag of an element.\n */\nexport function omission(handlers) {\n return omit\n\n /**\n * Check if a given node can have a tag omitted.\n *\n * @type {OmitHandle}\n */\n function omit(node, index, parent) {\n return (\n own.call(handlers, node.tagName) &&\n handlers[node.tagName](node, index, parent)\n )\n }\n}\n", "/**\n * @import {Element, Parents} from 'hast'\n */\n\nimport {whitespace} from 'hast-util-whitespace'\nimport {siblingAfter} from './util/siblings.js'\nimport {omission} from './omission.js'\n\nexport const closing = omission({\n body,\n caption: headOrColgroupOrCaption,\n colgroup: headOrColgroupOrCaption,\n dd,\n dt,\n head: headOrColgroupOrCaption,\n html,\n li,\n optgroup,\n option,\n p,\n rp: rubyElement,\n rt: rubyElement,\n tbody,\n td: cells,\n tfoot,\n th: cells,\n thead,\n tr\n})\n\n/**\n * Macro for `</head>`, `</colgroup>`, and `</caption>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction headOrColgroupOrCaption(_, index, parent) {\n const next = siblingAfter(parent, index, true)\n return (\n !next ||\n (next.type !== 'comment' &&\n !(next.type === 'text' && whitespace(next.value.charAt(0))))\n )\n}\n\n/**\n * Whether to omit `</html>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction html(_, index, parent) {\n const next = siblingAfter(parent, index)\n return !next || next.type !== 'comment'\n}\n\n/**\n * Whether to omit `</body>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction body(_, index, parent) {\n const next = siblingAfter(parent, index)\n return !next || next.type !== 'comment'\n}\n\n/**\n * Whether to omit `</p>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction p(_, index, parent) {\n const next = siblingAfter(parent, index)\n return next\n ? next.type === 'element' &&\n (next.tagName === 'address' ||\n next.tagName === 'article' ||\n next.tagName === 'aside' ||\n next.tagName === 'blockquote' ||\n next.tagName === 'details' ||\n next.tagName === 'div' ||\n next.tagName === 'dl' ||\n next.tagName === 'fieldset' ||\n next.tagName === 'figcaption' ||\n next.tagName === 'figure' ||\n next.tagName === 'footer' ||\n next.tagName === 'form' ||\n next.tagName === 'h1' ||\n next.tagName === 'h2' ||\n next.tagName === 'h3' ||\n next.tagName === 'h4' ||\n next.tagName === 'h5' ||\n next.tagName === 'h6' ||\n next.tagName === 'header' ||\n next.tagName === 'hgroup' ||\n next.tagName === 'hr' ||\n next.tagName === 'main' ||\n next.tagName === 'menu' ||\n next.tagName === 'nav' ||\n next.tagName === 'ol' ||\n next.tagName === 'p' ||\n next.tagName === 'pre' ||\n next.tagName === 'section' ||\n next.tagName === 'table' ||\n next.tagName === 'ul')\n : !parent ||\n // Confusing parent.\n !(\n parent.type === 'element' &&\n (parent.tagName === 'a' ||\n parent.tagName === 'audio' ||\n parent.tagName === 'del' ||\n parent.tagName === 'ins' ||\n parent.tagName === 'map' ||\n parent.tagName === 'noscript' ||\n parent.tagName === 'video')\n )\n}\n\n/**\n * Whether to omit `</li>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction li(_, index, parent) {\n const next = siblingAfter(parent, index)\n return !next || (next.type === 'element' && next.tagName === 'li')\n}\n\n/**\n * Whether to omit `</dt>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction dt(_, index, parent) {\n const next = siblingAfter(parent, index)\n return Boolean(\n next &&\n next.type === 'element' &&\n (next.tagName === 'dt' || next.tagName === 'dd')\n )\n}\n\n/**\n * Whether to omit `</dd>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction dd(_, index, parent) {\n const next = siblingAfter(parent, index)\n return (\n !next ||\n (next.type === 'element' &&\n (next.tagName === 'dt' || next.tagName === 'dd'))\n )\n}\n\n/**\n * Whether to omit `</rt>` or `</rp>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction rubyElement(_, index, parent) {\n const next = siblingAfter(parent, index)\n return (\n !next ||\n (next.type === 'element' &&\n (next.tagName === 'rp' || next.tagName === 'rt'))\n )\n}\n\n/**\n * Whether to omit `</optgroup>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction optgroup(_, index, parent) {\n const next = siblingAfter(parent, index)\n return !next || (next.type === 'element' && next.tagName === 'optgroup')\n}\n\n/**\n * Whether to omit `</option>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction option(_, index, parent) {\n const next = siblingAfter(parent, index)\n return (\n !next ||\n (next.type === 'element' &&\n (next.tagName === 'option' || next.tagName === 'optgroup'))\n )\n}\n\n/**\n * Whether to omit `</thead>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction thead(_, index, parent) {\n const next = siblingAfter(parent, index)\n return Boolean(\n next &&\n next.type === 'element' &&\n (next.tagName === 'tbody' || next.tagName === 'tfoot')\n )\n}\n\n/**\n * Whether to omit `</tbody>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction tbody(_, index, parent) {\n const next = siblingAfter(parent, index)\n return (\n !next ||\n (next.type === 'element' &&\n (next.tagName === 'tbody' || next.tagName === 'tfoot'))\n )\n}\n\n/**\n * Whether to omit `</tfoot>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction tfoot(_, index, parent) {\n return !siblingAfter(parent, index)\n}\n\n/**\n * Whether to omit `</tr>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction tr(_, index, parent) {\n const next = siblingAfter(parent, index)\n return !next || (next.type === 'element' && next.tagName === 'tr')\n}\n\n/**\n * Whether to omit `</td>` or `</th>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction cells(_, index, parent) {\n const next = siblingAfter(parent, index)\n return (\n !next ||\n (next.type === 'element' &&\n (next.tagName === 'td' || next.tagName === 'th'))\n )\n}\n", "/**\n * @import {Element, Parents} from 'hast'\n */\n\nimport {whitespace} from 'hast-util-whitespace'\nimport {siblingAfter, siblingBefore} from './util/siblings.js'\nimport {closing} from './closing.js'\nimport {omission} from './omission.js'\n\nexport const opening = omission({\n body,\n colgroup,\n head,\n html,\n tbody\n})\n\n/**\n * Whether to omit `<html>`.\n *\n * @param {Element} node\n * Element.\n * @returns {boolean}\n * Whether the opening tag can be omitted.\n */\nfunction html(node) {\n const head = siblingAfter(node, -1)\n return !head || head.type !== 'comment'\n}\n\n/**\n * Whether to omit `<head>`.\n *\n * @param {Element} node\n * Element.\n * @returns {boolean}\n * Whether the opening tag can be omitted.\n */\nfunction head(node) {\n /** @type {Set<string>} */\n const seen = new Set()\n\n // Whether `srcdoc` or not,\n // make sure the content model at least doesn\u2019t have too many `base`s/`title`s.\n for (const child of node.children) {\n if (\n child.type === 'element' &&\n (child.tagName === 'base' || child.tagName === 'title')\n ) {\n if (seen.has(child.tagName)) return false\n seen.add(child.tagName)\n }\n }\n\n // \u201CMay be omitted if the element is empty,\n // or if the first thing inside the head element is an element.\u201D\n const child = node.children[0]\n return !child || child.type === 'element'\n}\n\n/**\n * Whether to omit `<body>`.\n *\n * @param {Element} node\n * Element.\n * @returns {boolean}\n * Whether the opening tag can be omitted.\n */\nfunction body(node) {\n const head = siblingAfter(node, -1, true)\n\n return (\n !head ||\n (head.type !== 'comment' &&\n !(head.type === 'text' && whitespace(head.value.charAt(0))) &&\n !(\n head.type === 'element' &&\n (head.tagName === 'meta' ||\n head.tagName === 'link' ||\n head.tagName === 'script' ||\n head.tagName === 'style' ||\n head.tagName === 'template')\n ))\n )\n}\n\n/**\n * Whether to omit `<colgroup>`.\n * The spec describes some logic for the opening tag, but it\u2019s easier to\n * implement in the closing tag, to the same effect, so we handle it there\n * instead.\n *\n * @param {Element} node\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the opening tag can be omitted.\n */\nfunction colgroup(node, index, parent) {\n const previous = siblingBefore(parent, index)\n const head = siblingAfter(node, -1, true)\n\n // Previous colgroup was already omitted.\n if (\n parent &&\n previous &&\n previous.type === 'element' &&\n previous.tagName === 'colgroup' &&\n closing(previous, parent.children.indexOf(previous), parent)\n ) {\n return false\n }\n\n return Boolean(head && head.type === 'element' && head.tagName === 'col')\n}\n\n/**\n * Whether to omit `<tbody>`.\n *\n * @param {Element} node\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the opening tag can be omitted.\n */\nfunction tbody(node, index, parent) {\n const previous = siblingBefore(parent, index)\n const head = siblingAfter(node, -1)\n\n // Previous table section was already omitted.\n if (\n parent &&\n previous &&\n previous.type === 'element' &&\n (previous.tagName === 'thead' || previous.tagName === 'tbody') &&\n closing(previous, parent.children.indexOf(previous), parent)\n ) {\n return false\n }\n\n return Boolean(head && head.type === 'element' && head.tagName === 'tr')\n}\n", "/**\n * @import {Element, Parents, Properties} from 'hast'\n * @import {State} from '../index.js'\n */\n\nimport {ccount} from 'ccount'\nimport {stringify as commas} from 'comma-separated-tokens'\nimport {find, svg} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport {stringifyEntities} from 'stringify-entities'\nimport {closing} from '../omission/closing.js'\nimport {opening} from '../omission/opening.js'\n\n/**\n * Maps of subsets.\n *\n * Each value is a matrix of tuples.\n * The value at `0` causes parse errors, the value at `1` is valid.\n * Of both, the value at `0` is unsafe, and the value at `1` is safe.\n *\n * @type {Record<'double' | 'name' | 'single' | 'unquoted', Array<[Array<string>, Array<string>]>>}\n */\nconst constants = {\n // See: <https://html.spec.whatwg.org/#attribute-name-state>.\n name: [\n ['\\t\\n\\f\\r &/=>'.split(''), '\\t\\n\\f\\r \"&\\'/=>`'.split('')],\n ['\\0\\t\\n\\f\\r \"&\\'/<=>'.split(''), '\\0\\t\\n\\f\\r \"&\\'/<=>`'.split('')]\n ],\n // See: <https://html.spec.whatwg.org/#attribute-value-(unquoted)-state>.\n unquoted: [\n ['\\t\\n\\f\\r &>'.split(''), '\\0\\t\\n\\f\\r \"&\\'<=>`'.split('')],\n ['\\0\\t\\n\\f\\r \"&\\'<=>`'.split(''), '\\0\\t\\n\\f\\r \"&\\'<=>`'.split('')]\n ],\n // See: <https://html.spec.whatwg.org/#attribute-value-(single-quoted)-state>.\n single: [\n [\"&'\".split(''), '\"&\\'`'.split('')],\n [\"\\0&'\".split(''), '\\0\"&\\'`'.split('')]\n ],\n // See: <https://html.spec.whatwg.org/#attribute-value-(double-quoted)-state>.\n double: [\n ['\"&'.split(''), '\"&\\'`'.split('')],\n ['\\0\"&'.split(''), '\\0\"&\\'`'.split('')]\n ]\n}\n\n/**\n * Serialize an element node.\n *\n * @param {Element} node\n * Node to handle.\n * @param {number | undefined} index\n * Index of `node` in `parent.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {string}\n * Serialized node.\n */\nexport function element(node, index, parent, state) {\n const schema = state.schema\n const omit = schema.space === 'svg' ? false : state.settings.omitOptionalTags\n let selfClosing =\n schema.space === 'svg'\n ? state.settings.closeEmptyElements\n : state.settings.voids.includes(node.tagName.toLowerCase())\n /** @type {Array<string>} */\n const parts = []\n /** @type {string} */\n let last\n\n if (schema.space === 'html' && node.tagName === 'svg') {\n state.schema = svg\n }\n\n const attributes = serializeAttributes(state, node.properties)\n\n const content = state.all(\n schema.space === 'html' && node.tagName === 'template' ? node.content : node\n )\n\n state.schema = schema\n\n // If the node is categorised as void, but it has children, remove the\n // categorisation.\n // This enables for example `menuitem`s, which are void in W3C HTML but not\n // void in WHATWG HTML, to be stringified properly.\n // Note: `menuitem` has since been removed from the HTML spec, and so is no\n // longer void.\n if (content) selfClosing = false\n\n if (attributes || !omit || !opening(node, index, parent)) {\n parts.push('<', node.tagName, attributes ? ' ' + attributes : '')\n\n if (\n selfClosing &&\n (schema.space === 'svg' || state.settings.closeSelfClosing)\n ) {\n last = attributes.charAt(attributes.length - 1)\n if (\n !state.settings.tightSelfClosing ||\n last === '/' ||\n (last && last !== '\"' && last !== \"'\")\n ) {\n parts.push(' ')\n }\n\n parts.push('/')\n }\n\n parts.push('>')\n }\n\n parts.push(content)\n\n if (!selfClosing && (!omit || !closing(node, index, parent))) {\n parts.push('</' + node.tagName + '>')\n }\n\n return parts.join('')\n}\n\n/**\n * @param {State} state\n * @param {Properties | null | undefined} properties\n * @returns {string}\n */\nfunction serializeAttributes(state, properties) {\n /** @type {Array<string>} */\n const values = []\n let index = -1\n /** @type {string} */\n let key\n\n if (properties) {\n for (key in properties) {\n if (properties[key] !== null && properties[key] !== undefined) {\n const value = serializeAttribute(state, key, properties[key])\n if (value) values.push(value)\n }\n }\n }\n\n while (++index < values.length) {\n const last = state.settings.tightAttributes\n ? values[index].charAt(values[index].length - 1)\n : undefined\n\n // In tight mode, don\u2019t add a space after quoted attributes.\n if (index !== values.length - 1 && last !== '\"' && last !== \"'\") {\n values[index] += ' '\n }\n }\n\n return values.join('')\n}\n\n/**\n * @param {State} state\n * @param {string} key\n * @param {Properties[keyof Properties]} value\n * @returns {string}\n */\nfunction serializeAttribute(state, key, value) {\n const info = find(state.schema, key)\n const x =\n state.settings.allowParseErrors && state.schema.space === 'html' ? 0 : 1\n const y = state.settings.allowDangerousCharacters ? 0 : 1\n let quote = state.quote\n /** @type {string | undefined} */\n let result\n\n if (info.overloadedBoolean && (value === info.attribute || value === '')) {\n value = true\n } else if (\n (info.boolean || info.overloadedBoolean) &&\n (typeof value !== 'string' || value === info.attribute || value === '')\n ) {\n value = Boolean(value)\n }\n\n if (\n value === null ||\n value === undefined ||\n value === false ||\n (typeof value === 'number' && Number.isNaN(value))\n ) {\n return ''\n }\n\n const name = stringifyEntities(\n info.attribute,\n Object.assign({}, state.settings.characterReferences, {\n // Always encode without parse errors in non-HTML.\n subset: constants.name[x][y]\n })\n )\n\n // No value.\n // There is currently only one boolean property in SVG: `[download]` on\n // `<a>`.\n // This property does not seem to work in browsers (Firefox, Safari, Chrome),\n // so I can\u2019t test if dropping the value works.\n // But I assume that it should:\n //\n // ```html\n // <!doctype html>\n // <svg viewBox=\"0 0 100 100\">\n // <a href=https://example.com download>\n // <circle cx=50 cy=40 r=35 />\n // </a>\n // </svg>\n // ```\n //\n // See: <https://github.com/wooorm/property-information/blob/main/lib/svg.js>\n if (value === true) return name\n\n // `spaces` doesn\u2019t accept a second argument, but it\u2019s given here just to\n // keep the code cleaner.\n value = Array.isArray(value)\n ? (info.commaSeparated ? commas : spaces)(value, {\n padLeft: !state.settings.tightCommaSeparatedLists\n })\n : String(value)\n\n if (state.settings.collapseEmptyAttributes && !value) return name\n\n // Check unquoted value.\n if (state.settings.preferUnquoted) {\n result = stringifyEntities(\n value,\n Object.assign({}, state.settings.characterReferences, {\n attribute: true,\n subset: constants.unquoted[x][y]\n })\n )\n }\n\n // If we don\u2019t want unquoted, or if `value` contains character references when\n // unquoted\u2026\n if (result !== value) {\n // If the alternative is less common than `quote`, switch.\n if (\n state.settings.quoteSmart &&\n ccount(value, quote) > ccount(value, state.alternative)\n ) {\n quote = state.alternative\n }\n\n result =\n quote +\n stringifyEntities(\n value,\n Object.assign({}, state.settings.characterReferences, {\n // Always encode without parse errors in non-HTML.\n subset: (quote === \"'\" ? constants.single : constants.double)[x][y],\n attribute: true\n })\n ) +\n quote\n }\n\n // Don\u2019t add a `=` for unquoted empties.\n return name + (result ? '=' + result : result)\n}\n", "/**\n * @import {Parents, Text} from 'hast'\n * @import {Raw} from 'mdast-util-to-hast'\n * @import {State} from '../index.js'\n */\n\nimport {stringifyEntities} from 'stringify-entities'\n\n// Declare array as variable so it can be cached by `stringifyEntities`\nconst textEntitySubset = ['<', '&']\n\n/**\n * Serialize a text node.\n *\n * @param {Raw | Text} node\n * Node to handle.\n * @param {number | undefined} _\n * Index of `node` in `parent.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {string}\n * Serialized node.\n */\nexport function text(node, _, parent, state) {\n // Check if content of `node` should be escaped.\n return parent &&\n parent.type === 'element' &&\n (parent.tagName === 'script' || parent.tagName === 'style')\n ? node.value\n : stringifyEntities(\n node.value,\n Object.assign({}, state.settings.characterReferences, {\n subset: textEntitySubset\n })\n )\n}\n", "/**\n * @import {Parents} from 'hast'\n * @import {Raw} from 'mdast-util-to-hast'\n * @import {State} from '../index.js'\n */\n\nimport {text} from './text.js'\n\n/**\n * Serialize a raw node.\n *\n * @param {Raw} node\n * Node to handle.\n * @param {number | undefined} index\n * Index of `node` in `parent.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {string}\n * Serialized node.\n */\nexport function raw(node, index, parent, state) {\n return state.settings.allowDangerousHtml\n ? node.value\n : text(node, index, parent, state)\n}\n", "/**\n * @import {Parents, Root} from 'hast'\n * @import {State} from '../index.js'\n */\n\n/**\n * Serialize a root.\n *\n * @param {Root} node\n * Node to handle.\n * @param {number | undefined} _1\n * Index of `node` in `parent.\n * @param {Parents | undefined} _2\n * Parent of `node`.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {string}\n * Serialized node.\n */\nexport function root(node, _1, _2, state) {\n return state.all(node)\n}\n", "/**\n * @import {Nodes, Parents} from 'hast'\n * @import {State} from '../index.js'\n */\n\nimport {zwitch} from 'zwitch'\nimport {comment} from './comment.js'\nimport {doctype} from './doctype.js'\nimport {element} from './element.js'\nimport {raw} from './raw.js'\nimport {root} from './root.js'\nimport {text} from './text.js'\n\n/**\n * @type {(node: Nodes, index: number | undefined, parent: Parents | undefined, state: State) => string}\n */\nexport const handle = zwitch('type', {\n invalid,\n unknown,\n handlers: {comment, doctype, element, raw, root, text}\n})\n\n/**\n * Fail when a non-node is found in the tree.\n *\n * @param {unknown} node\n * Unknown value.\n * @returns {never}\n * Never.\n */\nfunction invalid(node) {\n throw new Error('Expected node, not `' + node + '`')\n}\n\n/**\n * Fail when a node with an unknown type is found in the tree.\n *\n * @param {unknown} node_\n * Unknown node.\n * @returns {never}\n * Never.\n */\nfunction unknown(node_) {\n // `type` is guaranteed by runtime JS.\n const node = /** @type {Nodes} */ (node_)\n throw new Error('Cannot compile unknown node `' + node.type + '`')\n}\n", "/**\n * @import {Nodes, Parents, RootContent} from 'hast'\n * @import {Schema} from 'property-information'\n * @import {Options as StringifyEntitiesOptions} from 'stringify-entities'\n */\n\n/**\n * @typedef {Omit<StringifyEntitiesOptions, 'attribute' | 'escapeOnly' | 'subset'>} CharacterReferences\n *\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [allowDangerousCharacters=false]\n * Do not encode some characters which cause XSS vulnerabilities in older\n * browsers (default: `false`).\n *\n * > \u26A0\uFE0F **Danger**: only set this if you completely trust the content.\n * @property {boolean | null | undefined} [allowDangerousHtml=false]\n * Allow `raw` nodes and insert them as raw HTML (default: `false`).\n *\n * When `false`, `Raw` nodes are encoded.\n *\n * > \u26A0\uFE0F **Danger**: only set this if you completely trust the content.\n * @property {boolean | null | undefined} [allowParseErrors=false]\n * Do not encode characters which cause parse errors (even though they work),\n * to save bytes (default: `false`).\n *\n * Not used in the SVG space.\n *\n * > \uD83D\uDC49 **Note**: intentionally creates parse errors in markup (how parse\n * > errors are handled is well defined, so this works but isn\u2019t pretty).\n * @property {boolean | null | undefined} [bogusComments=false]\n * Use \u201Cbogus comments\u201D instead of comments to save byes: `<?charlie>`\n * instead of `<!--charlie-->` (default: `false`).\n *\n * > \uD83D\uDC49 **Note**: intentionally creates parse errors in markup (how parse\n * > errors are handled is well defined, so this works but isn\u2019t pretty).\n * @property {CharacterReferences | null | undefined} [characterReferences]\n * Configure how to serialize character references (optional).\n * @property {boolean | null | undefined} [closeEmptyElements=false]\n * Close SVG elements without any content with slash (`/`) on the opening tag\n * instead of an end tag: `<circle />` instead of `<circle></circle>`\n * (default: `false`).\n *\n * See `tightSelfClosing` to control whether a space is used before the\n * slash.\n *\n * Not used in the HTML space.\n * @property {boolean | null | undefined} [closeSelfClosing=false]\n * Close self-closing nodes with an extra slash (`/`): `<img />` instead of\n * `<img>` (default: `false`).\n *\n * See `tightSelfClosing` to control whether a space is used before the\n * slash.\n *\n * Not used in the SVG space.\n * @property {boolean | null | undefined} [collapseEmptyAttributes=false]\n * Collapse empty attributes: get `class` instead of `class=\"\"` (default:\n * `false`).\n *\n * Not used in the SVG space.\n *\n * > \uD83D\uDC49 **Note**: boolean attributes (such as `hidden`) are always collapsed.\n * @property {boolean | null | undefined} [omitOptionalTags=false]\n * Omit optional opening and closing tags (default: `false`).\n *\n * For example, in `<ol><li>one</li><li>two</li></ol>`, both `</li>` closing\n * tags can be omitted.\n * The first because it\u2019s followed by another `li`, the last because it\u2019s\n * followed by nothing.\n *\n * Not used in the SVG space.\n * @property {boolean | null | undefined} [preferUnquoted=false]\n * Leave attributes unquoted if that results in less bytes (default: `false`).\n *\n * Not used in the SVG space.\n * @property {boolean | null | undefined} [quoteSmart=false]\n * Use the other quote if that results in less bytes (default: `false`).\n * @property {Quote | null | undefined} [quote='\"']\n * Preferred quote to use (default: `'\"'`).\n * @property {Space | null | undefined} [space='html']\n * When an `<svg>` element is found in the HTML space, this package already\n * automatically switches to and from the SVG space when entering and exiting\n * it (default: `'html'`).\n *\n * > \uD83D\uDC49 **Note**: hast is not XML.\n * > It supports SVG as embedded in HTML.\n * > It does not support the features available in XML.\n * > Passing SVG might break but fragments of modern SVG should be fine.\n * > Use [`xast`][xast] if you need to support SVG as XML.\n * @property {boolean | null | undefined} [tightAttributes=false]\n * Join attributes together, without whitespace, if possible: get\n * `class=\"a b\"title=\"c d\"` instead of `class=\"a b\" title=\"c d\"` to save\n * bytes (default: `false`).\n *\n * Not used in the SVG space.\n *\n * > \uD83D\uDC49 **Note**: intentionally creates parse errors in markup (how parse\n * > errors are handled is well defined, so this works but isn\u2019t pretty).\n * @property {boolean | null | undefined} [tightCommaSeparatedLists=false]\n * Join known comma-separated attribute values with just a comma (`,`),\n * instead of padding them on the right as well (`,\u2420`, where `\u2420` represents a\n * space) (default: `false`).\n * @property {boolean | null | undefined} [tightDoctype=false]\n * Drop unneeded spaces in doctypes: `<!doctypehtml>` instead of\n * `<!doctype html>` to save bytes (default: `false`).\n *\n * > \uD83D\uDC49 **Note**: intentionally creates parse errors in markup (how parse\n * > errors are handled is well defined, so this works but isn\u2019t pretty).\n * @property {boolean | null | undefined} [tightSelfClosing=false]\n * Do not use an extra space when closing self-closing elements: `<img/>`\n * instead of `<img />` (default: `false`).\n *\n * > \uD83D\uDC49 **Note**: only used if `closeSelfClosing: true` or\n * > `closeEmptyElements: true`.\n * @property {boolean | null | undefined} [upperDoctype=false]\n * Use a `<!DOCTYPE\u2026` instead of `<!doctype\u2026` (default: `false`).\n *\n * Useless except for XHTML.\n * @property {ReadonlyArray<string> | null | undefined} [voids]\n * Tag names of elements to serialize without closing tag (default: `html-void-elements`).\n *\n * Not used in the SVG space.\n *\n * > \uD83D\uDC49 **Note**: It\u2019s highly unlikely that you want to pass this, because\n * > hast is not for XML, and HTML will not add more void elements.\n *\n * @typedef {'\"' | \"'\"} Quote\n * HTML quotes for attribute values.\n *\n * @typedef {Omit<Required<{[key in keyof Options]: Exclude<Options[key], null | undefined>}>, 'space' | 'quote'>} Settings\n *\n * @typedef {'html' | 'svg'} Space\n * Namespace.\n *\n * @typedef State\n * Info passed around about the current state.\n * @property {(node: Parents | undefined) => string} all\n * Serialize the children of a parent node.\n * @property {Quote} alternative\n * Alternative quote.\n * @property {(node: Nodes, index: number | undefined, parent: Parents | undefined) => string} one\n * Serialize one node.\n * @property {Quote} quote\n * Preferred quote.\n * @property {Schema} schema\n * Current schema.\n * @property {Settings} settings\n * User configuration.\n */\n\nimport {htmlVoidElements} from 'html-void-elements'\nimport {html, svg} from 'property-information'\nimport {handle} from './handle/index.js'\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/** @type {CharacterReferences} */\nconst emptyCharacterReferences = {}\n\n/** @type {Array<never>} */\nconst emptyChildren = []\n\n/**\n * Serialize hast as HTML.\n *\n * @param {Array<RootContent> | Nodes} tree\n * Tree to serialize.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {string}\n * Serialized HTML.\n */\nexport function toHtml(tree, options) {\n const options_ = options || emptyOptions\n const quote = options_.quote || '\"'\n const alternative = quote === '\"' ? \"'\" : '\"'\n\n if (quote !== '\"' && quote !== \"'\") {\n throw new Error('Invalid quote `' + quote + '`, expected `\\'` or `\"`')\n }\n\n /** @type {State} */\n const state = {\n one,\n all,\n settings: {\n omitOptionalTags: options_.omitOptionalTags || false,\n allowParseErrors: options_.allowParseErrors || false,\n allowDangerousCharacters: options_.allowDangerousCharacters || false,\n quoteSmart: options_.quoteSmart || false,\n preferUnquoted: options_.preferUnquoted || false,\n tightAttributes: options_.tightAttributes || false,\n upperDoctype: options_.upperDoctype || false,\n tightDoctype: options_.tightDoctype || false,\n bogusComments: options_.bogusComments || false,\n tightCommaSeparatedLists: options_.tightCommaSeparatedLists || false,\n tightSelfClosing: options_.tightSelfClosing || false,\n collapseEmptyAttributes: options_.collapseEmptyAttributes || false,\n allowDangerousHtml: options_.allowDangerousHtml || false,\n voids: options_.voids || htmlVoidElements,\n characterReferences:\n options_.characterReferences || emptyCharacterReferences,\n closeSelfClosing: options_.closeSelfClosing || false,\n closeEmptyElements: options_.closeEmptyElements || false\n },\n schema: options_.space === 'svg' ? svg : html,\n quote,\n alternative\n }\n\n return state.one(\n Array.isArray(tree) ? {type: 'root', children: tree} : tree,\n undefined,\n undefined\n )\n}\n\n/**\n * Serialize a node.\n *\n * @this {State}\n * Info passed around about the current state.\n * @param {Nodes} node\n * Node to handle.\n * @param {number | undefined} index\n * Index of `node` in `parent.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @returns {string}\n * Serialized node.\n */\nfunction one(node, index, parent) {\n return handle(node, index, parent, this)\n}\n\n/**\n * Serialize all children of `parent`.\n *\n * @this {State}\n * Info passed around about the current state.\n * @param {Parents | undefined} parent\n * Parent whose children to serialize.\n * @returns {string}\n */\nexport function all(parent) {\n /** @type {Array<string>} */\n const results = []\n const children = (parent && parent.children) || emptyChildren\n let index = -1\n\n while (++index < children.length) {\n results[index] = this.one(children[index], index, parent)\n }\n\n return results.join('')\n}\n", "import type { Element, Nodes, Properties, RootContent } from 'hast';\nimport { toHtml } from 'hast-util-to-html';\n\n// Must match the html-void-elements list used by toHtml().\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'basefont',\n 'bgsound',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'frame',\n 'hr',\n 'image',\n 'img',\n 'input',\n 'keygen',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n]);\n\n// These elements require schema, fragment or raw-text handling in toHtml().\nconst DELEGATED_TAGS = new Set(['svg', 'template', 'script', 'style']);\n\n// Boolean and comma-separated attributes require the full HTML schema.\nconst ATTRIBUTE_NAMES: Record<string, string | undefined> = {\n class: 'class',\n className: 'class',\n id: 'id',\n role: 'role',\n style: 'style',\n tabIndex: 'tabindex',\n tabindex: 'tabindex',\n title: 'title',\n};\nconst DATA_ATTRIBUTE = /^data-[\\w.:-]+$/;\n\nconst TEXT_ESCAPE = /[<&]/g;\nconst ATTRIBUTE_ESCAPE = /[\\0\"&'`]/g;\n// Must match stringify-entities' default hexadecimal encoding.\nconst CHARACTER_REFERENCES: Record<string, string> = {\n '<': '&#x3C;',\n '&': '&#x26;',\n '\"': '&#x22;',\n \"'\": '&#x27;',\n '`': '&#x60;',\n '\\0': '&#x0;',\n};\nconst MAX_CACHED_STYLES = 256;\n\n/**\n * Serializes a HAST node or node array to HTML. Common token spans use a fast\n * path; other nodes and attributes use hast-util-to-html's default serialization.\n */\nexport function hastToHtml(tree: Nodes | RootContent[]): string {\n const styles = new Map<string, string>();\n return Array.isArray(tree)\n ? serializeChildren(tree, styles)\n : serializeNode(tree, styles);\n}\n\nfunction serializeChildren(\n children: readonly RootContent[],\n styles: Map<string, string>\n): string {\n let html = '';\n for (const child of children) {\n html += serializeNode(child, styles);\n }\n return html;\n}\n\nfunction serializeNode(node: Nodes, styles: Map<string, string>): string {\n switch (node.type) {\n case 'text':\n return escapeText(node.value);\n case 'element':\n return serializeElement(node, styles);\n case 'root':\n return serializeChildren(node.children, styles);\n default:\n return toHtml(node);\n }\n}\n\nfunction serializeElement(node: Element, styles: Map<string, string>): string {\n const { tagName } = node;\n if (\n tagName === 'span' &&\n node.children.length === 1 &&\n node.children[0].type === 'text' &&\n typeof node.properties?.style === 'string'\n ) {\n let styleOnly = true;\n for (const key in node.properties) {\n if (key !== 'style' && node.properties[key] != null) {\n styleOnly = false;\n break;\n }\n }\n if (styleOnly) {\n return `<span ${serializeStyle(node.properties.style, styles)}>${escapeText(node.children[0].value)}</span>`;\n }\n }\n if (DELEGATED_TAGS.has(tagName)) {\n return toHtml(node);\n }\n const attributes = serializeAttributes(node.properties, styles);\n if (attributes == null) {\n return toHtml(node);\n }\n const open =\n attributes === '' ? `<${tagName}>` : `<${tagName} ${attributes}>`;\n const content = serializeChildren(node.children, styles);\n if (content === '' && VOID_ELEMENTS.has(tagName.toLowerCase())) {\n return open;\n }\n return `${open}${content}</${tagName}>`;\n}\n\n// Cap the per-render cache because custom styles may be unique per token.\nfunction serializeStyle(value: string, styles: Map<string, string>): string {\n let attribute = styles.get(value);\n if (attribute == null) {\n attribute = `style=\"${escapeAttribute(value)}\"`;\n if (styles.size < MAX_CACHED_STYLES) styles.set(value, attribute);\n }\n return attribute;\n}\n\n// Returns undefined when a property needs the HTML schema to serialize.\nfunction serializeAttributes(\n properties: Properties | undefined,\n styles: Map<string, string>\n): string | undefined {\n let attributes = '';\n for (const key in properties) {\n const value = properties[key];\n if (value == null) {\n continue;\n }\n const name =\n ATTRIBUTE_NAMES[key] ?? (DATA_ATTRIBUTE.test(key) ? key : undefined);\n if (name == null) {\n return undefined;\n }\n if (value === false || (typeof value === 'number' && Number.isNaN(value))) {\n continue;\n }\n const attribute =\n key === 'style' && typeof value === 'string'\n ? serializeStyle(value, styles)\n : value === true\n ? name\n : `${name}=\"${escapeAttribute(\n Array.isArray(value) ? value.join(' ').trim() : String(value)\n )}\"`;\n attributes += attributes === '' ? attribute : ` ${attribute}`;\n }\n return attributes;\n}\n\nfunction escapeText(value: string): string {\n return value.indexOf('<') < 0 && value.indexOf('&') < 0\n ? value\n : value.replace(TEXT_ESCAPE, toCharacterReference);\n}\n\nfunction escapeAttribute(value: string): string {\n return value.replace(ATTRIBUTE_ESCAPE, toCharacterReference);\n}\n\nfunction toCharacterReference(character: string): string {\n return CHARACTER_REFERENCES[character];\n}\n", "import type {\n ElementContent,\n Element as HASTElement,\n Properties,\n Root,\n RootContent,\n Text,\n} from 'hast';\n\nimport type { SVGSpriteNames } from '../sprite';\nimport type { LineTypes } from '../types';\n\nexport function createTextNodeElement(value: string): Text {\n return { type: 'text', value };\n}\n\ninterface CreateHastElementProps {\n tagName:\n | 'span'\n | 'div'\n | 'button'\n | 'code'\n | 'pre'\n | 'slot'\n | 'svg'\n | 'use'\n | 'style'\n | 'template'\n | 'bdi';\n children?: ElementContent[];\n properties?: Properties;\n}\n\nexport function createHastElement({\n tagName,\n children = [],\n properties = {},\n}: CreateHastElementProps): HASTElement {\n return {\n type: 'element',\n tagName,\n properties,\n children,\n };\n}\n\ninterface CreateIconProps {\n name: SVGSpriteNames;\n width?: number;\n height?: number;\n properties?: Properties;\n}\n\nexport function createIconElement({\n name,\n width = 16,\n height = 16,\n properties,\n}: CreateIconProps): HASTElement {\n return createHastElement({\n tagName: 'svg',\n properties: { width, height, viewBox: '0 0 16 16', ...properties },\n children: [\n createHastElement({\n tagName: 'use',\n properties: { href: `#${name.replace(/^#/, '')}` },\n }),\n ],\n });\n}\n\nexport function findCodeElement(\n nodes: Root | HASTElement\n): HASTElement | undefined {\n let firstChild: RootContent | HASTElement | Root | null = nodes.children[0];\n while (firstChild != null) {\n if (firstChild.type === 'element' && firstChild.tagName === 'code') {\n return firstChild;\n }\n if ('children' in firstChild) {\n firstChild = firstChild.children[0];\n } else {\n firstChild = null;\n }\n }\n return undefined;\n}\n\nexport function createGutterWrapper(children?: ElementContent[]): HASTElement {\n return createHastElement({\n tagName: 'div',\n properties: { 'data-gutter': '' },\n children,\n });\n}\n\nexport function createGutterItem(\n lineType: LineTypes | 'buffer' | 'separator' | 'annotation',\n lineNumber: number,\n lineIndex: string,\n properties: Properties = {}\n): HASTElement {\n return createHastElement({\n tagName: 'div',\n properties: {\n 'data-line-type': lineType,\n 'data-column-number': lineNumber,\n 'data-line-index': lineIndex,\n ...properties,\n },\n children:\n lineNumber != null\n ? [\n createHastElement({\n tagName: 'span',\n properties: { 'data-line-number-content': '' },\n children: [createTextNodeElement(`${lineNumber}`)],\n }),\n ]\n : undefined,\n });\n}\n\nexport function createGutterGap(\n type: LineTypes | undefined,\n bufferType: 'annotation' | 'buffer' | 'metadata',\n size: number\n): HASTElement {\n return createHastElement({\n tagName: 'div',\n properties: {\n 'data-gutter-buffer': bufferType,\n 'data-buffer-size': size,\n 'data-line-type': bufferType === 'annotation' ? undefined : type,\n style:\n bufferType === 'annotation'\n ? `grid-row: span ${size};`\n : `grid-row: span ${size};min-height:calc(${size} * 1lh);`,\n },\n });\n}\n", "import type { ElementContent, Element as HASTElement } from 'hast';\n\nimport type { SharedRenderState } from '../types';\nimport { createTextNodeElement } from './hast_utils';\n\nexport function processLine(\n node: HASTElement,\n line: number,\n state: SharedRenderState\n): ElementContent {\n const lineInfo =\n typeof state.lineInfo === 'function'\n ? state.lineInfo(line)\n : state.lineInfo[line - 1];\n if (lineInfo == null) {\n const errorMessage = `processLine: line ${line}, contains no state.lineInfo`;\n console.error(errorMessage, { node, line, state });\n throw new Error(errorMessage);\n }\n // We need to convert the current line to a div but keep all the decorations\n // that may be applied\n node.tagName = 'div';\n node.properties['data-line'] = lineInfo.lineNumber;\n node.properties['data-alt-line'] = lineInfo.altLineNumber;\n node.properties['data-line-type'] = lineInfo.type;\n node.properties['data-line-index'] = lineInfo.lineIndex;\n\n // NOTE(amadeus): We need to push newline characters into empty rows or else\n // copy/pasta will have issues\n if (node.children.length === 0) {\n node.children.push(createTextNodeElement('\\n'));\n }\n\n return node;\n}\n", "export function setDeferredArrayItem<T>(\n array: T[],\n index: number,\n create: () => T\n): void {\n let initialized = false;\n let cached: T;\n Object.defineProperty(array, index, {\n configurable: true,\n enumerable: true,\n get() {\n if (!initialized) {\n cached = create();\n initialized = true;\n }\n if (\n Object.getOwnPropertyDescriptor(array, index)?.configurable === true\n ) {\n Object.defineProperty(array, index, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: cached,\n });\n }\n return cached;\n },\n set(value: T) {\n if (\n Object.getOwnPropertyDescriptor(array, index)?.configurable === true\n ) {\n Object.defineProperty(array, index, {\n configurable: true,\n enumerable: true,\n writable: true,\n value,\n });\n } else if (Object.isFrozen(array)) {\n throw new TypeError(\n `Cannot assign to read only array index '${index}'`\n );\n } else {\n cached = value;\n initialized = true;\n }\n },\n });\n}\n", "import type { ThemedToken } from '../types';\n\n// Warning: cache only tokens from Highlights, which reuses htmlStyle objects.\n// Shiki creates one per token, so caching them adds a WeakMap entry per token.\nconst htmlStyleCache = new WeakMap<Record<string, string>, string>();\n\n/**\n * Returns CSS declarations for a highlighted token. Enable caching only when\n * htmlStyle objects are immutable and reused across tokens.\n */\nexport function tokenStyle(\n token: ThemedToken,\n cacheHtmlStyle: boolean = false\n): string {\n const { htmlStyle } = token;\n if (htmlStyle != null) {\n let style = cacheHtmlStyle ? htmlStyleCache.get(htmlStyle) : undefined;\n if (style == null) {\n style = '';\n for (const name in htmlStyle) {\n style += `${style === '' ? '' : ';'}${name}:${htmlStyle[name]}`;\n }\n if (cacheHtmlStyle) htmlStyleCache.set(htmlStyle, style);\n }\n return style;\n }\n let style = token.color != null ? `color:${token.color}` : '';\n if (token.bgColor != null) style += `;background-color:${token.bgColor}`;\n if (token.fontStyle != null) {\n if ((token.fontStyle & 1) !== 0) style += ';font-style:italic';\n if ((token.fontStyle & 2) !== 0) style += ';font-weight:bold';\n const underline = (token.fontStyle & 4) !== 0;\n const strikethrough = (token.fontStyle & 8) !== 0;\n if (underline || strikethrough)\n style += `;text-decoration:${underline ? 'underline' : ''}${underline && strikethrough ? ' ' : ''}${strikethrough ? 'line-through' : ''}`;\n }\n return style.replace(/^;/, '');\n}\n", "import type { ElementContent, Element as HASTElement } from 'hast';\n\nimport { createHastElement } from './hast_utils';\n\nconst NO_TOKEN: unique symbol = Symbol('no-token');\nconst MULTIPLE_TOKENS: unique symbol = Symbol('multiple-tokens');\n\ntype TokenFragmentState = number | typeof NO_TOKEN | typeof MULTIPLE_TOKENS;\n\n// Walk a rendered line and add a single outer token wrapper around all\n// fragments that still belong to the same original syntax token.\nexport function wrapTokenFragments(container: HASTElement): TokenFragmentState {\n const ownTokenChar = getTokenChar(container);\n if (ownTokenChar != null) {\n return ownTokenChar;\n }\n\n let containerTokenState: TokenFragmentState = NO_TOKEN;\n const wrappedChildren: ElementContent[] = [];\n let currentTokenChildren: ElementContent[] = [];\n let currentTokenChar: number | undefined;\n\n const flushTokenChildren = () => {\n if (currentTokenChildren.length === 0 || currentTokenChar == null) {\n currentTokenChildren = [];\n currentTokenChar = undefined;\n return;\n }\n\n if (currentTokenChildren.length === 1) {\n const child = currentTokenChildren[0];\n if (child?.type === 'element') {\n setTokenChar(child, currentTokenChar);\n for (const grandChild of child.children) {\n stripTokenChar(grandChild);\n }\n } else {\n stripTokenChar(child);\n }\n wrappedChildren.push(child);\n currentTokenChildren = [];\n currentTokenChar = undefined;\n return;\n }\n\n for (const child of currentTokenChildren) {\n stripTokenChar(child);\n }\n\n wrappedChildren.push(\n createHastElement({\n tagName: 'span',\n properties: { 'data-char': currentTokenChar },\n children: currentTokenChildren,\n })\n );\n\n currentTokenChildren = [];\n currentTokenChar = undefined;\n };\n\n const mergeContainerTokenState = (childTokenState: TokenFragmentState) => {\n if (childTokenState === NO_TOKEN) {\n return;\n }\n if (childTokenState === MULTIPLE_TOKENS) {\n containerTokenState = MULTIPLE_TOKENS;\n return;\n }\n if (containerTokenState === NO_TOKEN) {\n containerTokenState = childTokenState;\n return;\n }\n if (containerTokenState !== childTokenState) {\n containerTokenState = MULTIPLE_TOKENS;\n }\n };\n\n for (const child of container.children) {\n const childTokenState: TokenFragmentState =\n child.type === 'element' ? wrapTokenFragments(child) : NO_TOKEN;\n mergeContainerTokenState(childTokenState);\n\n if (typeof childTokenState !== 'number') {\n flushTokenChildren();\n wrappedChildren.push(child);\n continue;\n }\n\n if (currentTokenChar != null && currentTokenChar !== childTokenState) {\n flushTokenChildren();\n }\n\n currentTokenChar ??= childTokenState;\n currentTokenChildren.push(child);\n }\n\n flushTokenChildren();\n container.children = wrappedChildren;\n return containerTokenState;\n}\n\nfunction getTokenChar(node: HASTElement): number | undefined {\n const value = node.properties['data-char'];\n if (typeof value === 'number') {\n return value;\n }\n return undefined;\n}\n\nfunction stripTokenChar(node: ElementContent): void {\n if (node.type !== 'element') return;\n node.properties['data-char'] = undefined;\n for (const child of node.children) {\n stripTokenChar(child);\n }\n}\n\nfunction setTokenChar(node: HASTElement, char: number): void {\n node.properties['data-char'] = char;\n}\n", "import type { Element, ElementContent, Properties } from 'hast';\n\nimport type { DecorationItem, SharedRenderState, ThemedToken } from '../types';\nimport { processLine } from './processLine';\nimport { setDeferredArrayItem } from './setDeferredArrayItem';\nimport { tokenStyle } from './tokenStyle';\nimport { wrapTokenFragments } from './wrapTokenFragments';\n\nexport interface RenderTokenLinesOptions {\n lazyLineAST?: boolean;\n cacheHtmlStyles?: boolean;\n state?: SharedRenderState;\n useTokenTransformer?: boolean;\n mergeWhitespaces?: 'never' | 'always';\n decorations?: DecorationItem[];\n /** UTF-16 line start offsets, required for numeric decoration positions. */\n lineOffsets?: number[];\n}\n\ninterface LineDecoration extends Omit<DecorationItem, 'start' | 'end'> {\n start: { line: number; character: number };\n end: { line: number; character: number };\n}\n\n// from/to are columns within this line; order preserves outer-to-inner nesting.\ninterface LineDecorationRange {\n decoration: LineDecoration;\n order: number;\n from: number;\n to: number;\n}\n\ninterface DecorationBoundary {\n position: number;\n range: LineDecorationRange;\n start: boolean;\n}\n\n/**\n * Converts highlighted tokens to one HAST element per line for custom renderers.\n * Callers provide any line separators and enclosing pre/code elements.\n */\nexport function renderTokenLines(\n lines: ThemedToken[][],\n {\n state,\n lazyLineAST = false,\n cacheHtmlStyles = false,\n useTokenTransformer = false,\n mergeWhitespaces = 'always',\n decorations = [],\n lineOffsets = [],\n }: RenderTokenLinesOptions\n): ElementContent[] {\n let decorationsByLine: Map<number, LineDecoration[]> | undefined;\n for (const decoration of decorations) {\n const byLine = (decorationsByLine ??= new Map());\n const normalized: LineDecoration = {\n ...decoration,\n start: getDecorationPosition(decoration.start, lineOffsets),\n end: getDecorationPosition(decoration.end, lineOffsets),\n };\n const lastLine = Math.min(normalized.end.line, lines.length - 1);\n for (let line = normalized.start.line; line <= lastLine; line++) {\n let spans = byLine.get(line);\n if (spans == null) byLine.set(line, (spans = []));\n spans.push(normalized);\n }\n }\n const renderLine = (tokens: ThemedToken[], lineIndex: number) => {\n let normalized: ThemedToken[] | undefined;\n if (useTokenTransformer || mergeWhitespaces !== 'never') {\n let pendingWhitespace = '';\n let whitespaceOffset = 0;\n for (let i = 0; i < tokens.length; i++) {\n let token = tokens[i];\n if (useTokenTransformer) {\n const content = token.content.trim();\n if (content !== '' && content !== token.content) {\n normalized ??= tokens.slice(0, i);\n const start = token.content.indexOf(content);\n if (start > 0)\n normalized.push({\n content: token.content.slice(0, start),\n offset: token.offset,\n });\n normalized.push({\n ...token,\n content,\n offset: token.offset + start,\n });\n const end = start + content.length;\n if (end < token.content.length)\n normalized.push({\n content: token.content.slice(end),\n offset: token.offset + end,\n });\n continue;\n }\n } else {\n const decoratedWhitespace = ((token.fontStyle ?? 0) & 12) !== 0;\n if (\n !decoratedWhitespace &&\n /^\\s+$/.test(token.content) &&\n i < tokens.length - 1\n ) {\n normalized ??= tokens.slice(0, i);\n if (pendingWhitespace === '') whitespaceOffset = token.offset;\n pendingWhitespace += token.content;\n continue;\n }\n if (pendingWhitespace !== '' && normalized != null) {\n if (decoratedWhitespace)\n normalized.push({\n content: pendingWhitespace,\n offset: whitespaceOffset,\n });\n else\n token = {\n ...token,\n content: pendingWhitespace + token.content,\n offset: whitespaceOffset,\n };\n pendingWhitespace = '';\n }\n }\n normalized?.push(token);\n }\n }\n normalized ??= tokens;\n const line: Element = {\n type: 'element',\n tagName: state == null ? 'span' : 'div',\n properties: state == null ? { class: 'line' } : {},\n children: [],\n };\n const spans = decorationsByLine?.get(lineIndex);\n const column =\n spans == null\n ? appendTokens(line, normalized, useTokenTransformer, cacheHtmlStyles)\n : appendDecoratedTokens(\n line,\n normalized,\n spans,\n lineIndex,\n useTokenTransformer,\n cacheHtmlStyles\n );\n if (useTokenTransformer && column === 0) {\n line.children.push({\n type: 'element',\n tagName: 'br',\n properties: {},\n children: [],\n });\n }\n // Undecorated tokens already have one span per editor position.\n if (useTokenTransformer && spans != null) wrapTokenFragments(line);\n return state == null ? line : processLine(line, lineIndex + 1, state);\n };\n if (!lazyLineAST) return lines.map(renderLine);\n const rows: ElementContent[] = new Array(lines.length);\n for (let index = 0; index < lines.length; index++) {\n // Warning: capture one line, not `lines`; unbuilt rows would keep every\n // line's tokens alive.\n const tokens = lines[index];\n setDeferredArrayItem(rows, index, () => renderLine(tokens, index));\n }\n return rows;\n}\n\n// Returns the line length in UTF-16 code units.\nfunction appendTokens(\n line: Element,\n tokens: ThemedToken[],\n useTokenTransformer: boolean,\n cacheHtmlStyles: boolean\n): number {\n let column = 0;\n for (const token of tokens) {\n if (token.content === '') continue;\n line.children.push(\n createTokenSpan(\n token,\n tokenStyle(token, cacheHtmlStyles),\n token.content,\n column,\n useTokenTransformer\n )\n );\n column += token.content.length;\n }\n return column;\n}\n\n// Visit sorted boundaries once to avoid scanning every decoration per token.\n// Emit empty ranges before text at the same position.\nfunction appendDecoratedTokens(\n line: Element,\n tokens: ThemedToken[],\n spans: LineDecoration[],\n lineIndex: number,\n useTokenTransformer: boolean,\n cacheHtmlStyles: boolean\n): number {\n // Open outer ranges first, regardless of their order in the input.\n if (spans.length > 1)\n spans.sort((a, b) => {\n if (a.start.line !== b.start.line) return a.start.line - b.start.line;\n if (a.start.character !== b.start.character)\n return a.start.character - b.start.character;\n if (a.end.line !== b.end.line) return b.end.line - a.end.line;\n return b.end.character - a.end.character;\n });\n const lineLength = tokens.reduce(\n (length, token) => length + token.content.length,\n 0\n );\n const boundaries: DecorationBoundary[] = [];\n for (let order = 0; order < spans.length; order++) {\n const decoration = spans[order];\n const range: LineDecorationRange = {\n decoration,\n order,\n from:\n decoration.start.line === lineIndex ? decoration.start.character : 0,\n to:\n decoration.end.line === lineIndex\n ? decoration.end.character\n : lineLength,\n };\n boundaries.push(\n {\n position: Math.max(0, Math.min(range.from, lineLength)),\n range,\n start: true,\n },\n {\n position: Math.max(0, Math.min(range.to, lineLength)),\n range,\n start: false,\n }\n );\n }\n boundaries.sort((a, b) => a.position - b.position);\n const active: LineDecorationRange[] = [];\n const decorationStack: { range: LineDecorationRange; node: Element }[] = [];\n let boundaryIndex = 0;\n\n // Keep the same outer-to-inner order even when decorations cross each other.\n const updateActive = (range: LineDecorationRange, add: boolean): void => {\n let low = 0;\n let high = active.length;\n while (low < high) {\n const middle = (low + high) >>> 1;\n if (active[middle].order < range.order) low = middle + 1;\n else high = middle;\n }\n if (add) active.splice(low, 0, range);\n else if (active[low] === range) active.splice(low, 1);\n };\n\n // Reuse wrappers across tokens so a continuous range stays in one element.\n const getParent = (): Element => {\n let parent = line;\n let depth = 0;\n for (const range of active) {\n if (decorationStack[depth]?.range !== range) {\n decorationStack.length = depth;\n const wrapper: Element = {\n type: 'element',\n tagName: 'span',\n properties: { ...range.decoration.properties },\n children: [],\n };\n parent.children.push(wrapper);\n decorationStack.push({ range, node: wrapper });\n }\n parent = decorationStack[depth++].node;\n }\n decorationStack.length = depth;\n return parent;\n };\n\n let parent = line;\n\n // Markers belong inside ranges starting here, except at the line end,\n // where they belong inside ranges ending here.\n const advanceBoundary = (position: number): void => {\n const first = boundaryIndex;\n while (boundaries[boundaryIndex]?.position === position) boundaryIndex++;\n let hasMarker = false;\n for (let i = first; i < boundaryIndex; i++) {\n const { range, start } = boundaries[i];\n if (!start && range.from !== range.to && position < lineLength)\n updateActive(range, false);\n }\n for (let i = first; i < boundaryIndex; i++) {\n const { range, start } = boundaries[i];\n if (\n start &&\n range.from <= position &&\n range.to >= position &&\n (range.to > position ||\n range.from === position ||\n position === lineLength)\n ) {\n updateActive(range, true);\n if (range.from === range.to) hasMarker = true;\n }\n }\n if (hasMarker) {\n getParent();\n for (let i = first; i < boundaryIndex; i++) {\n const { range, start } = boundaries[i];\n if (start && range.from === range.to) updateActive(range, false);\n }\n }\n if (position < lineLength) parent = getParent();\n };\n\n let column = 0;\n for (const token of tokens) {\n if (token.content === '') continue;\n const start = column;\n const end = start + token.content.length;\n const style = tokenStyle(token, cacheHtmlStyles);\n while (column < end) {\n if (boundaries[boundaryIndex]?.position === column)\n advanceBoundary(column);\n const to = Math.min(end, boundaries[boundaryIndex]?.position ?? end);\n parent.children.push(\n createTokenSpan(\n token,\n style,\n column === start && to === end\n ? token.content\n : token.content.slice(column - start, to - start),\n start,\n useTokenTransformer\n )\n );\n column = to;\n }\n }\n if (boundaries[boundaryIndex]?.position === column) advanceBoundary(column);\n return column;\n}\n\n// data-char must retain the original token column when decorations split it.\nfunction createTokenSpan(\n token: ThemedToken,\n style: string,\n text: string,\n start: number,\n useTokenTransformer: boolean\n): Element {\n const properties: Properties =\n token.htmlAttrs != null ? { ...token.htmlAttrs } : {};\n if (style !== '') properties.style = style;\n if (useTokenTransformer) properties['data-char'] = start;\n return {\n type: 'element',\n tagName: 'span',\n properties,\n children: [{ type: 'text', value: text }],\n };\n}\n\n// Convert absolute UTF-16 offsets to the line coordinates used by decorations.\nfunction getDecorationPosition(\n position: DecorationItem['start'],\n lineOffsets: number[]\n): { line: number; character: number } {\n if (typeof position !== 'number') return position;\n let low = 0;\n let high = lineOffsets.length;\n while (low + 1 < high) {\n const middle = (low + high) >>> 1;\n if (lineOffsets[middle] <= position) low = middle;\n else high = middle;\n }\n return { line: low, character: position - (lineOffsets[low] ?? 0) };\n}\n", "import type { Element, Root } from 'hast';\n\nimport type { CodeToHtmlOptions, TokensResult } from '../types';\nimport { hastToHtml } from './hastToHtml';\nimport { renderTokenLines } from './renderTokenLines';\n\n/**\n * Renders existing tokens as a pre/code HTML block without highlighting again.\n * Pass the original source to resolve numeric decoration offsets.\n */\nexport function tokensToHtml(\n source: string,\n result: TokensResult,\n options: CodeToHtmlOptions,\n cacheHtmlStyles: boolean = false\n): string {\n const lineOffsets = [0];\n if (\n options.decorations?.some(\n (item) => typeof item.start === 'number' || typeof item.end === 'number'\n ) === true\n ) {\n for (\n let index = source.indexOf('\\n');\n index !== -1;\n index = source.indexOf('\\n', index + 1)\n )\n lineOffsets.push(index + 1);\n }\n const code: Element = {\n type: 'element',\n tagName: 'code',\n properties: {},\n children: [],\n };\n const lines = renderTokenLines(result.tokens, {\n decorations: options.decorations,\n mergeWhitespaces: options.mergeWhitespaces,\n lineOffsets,\n cacheHtmlStyles,\n });\n for (let i = 0; i < lines.length; i++) {\n if (i > 0) code.children.push({ type: 'text', value: '\\n' });\n code.children.push(lines[i]);\n }\n const root: Root = {\n type: 'root',\n children: [\n {\n type: 'element',\n tagName: 'pre',\n properties: {\n class: 'diffs',\n style:\n result.rootStyle === false\n ? undefined\n : (result.rootStyle ??\n [\n result.fg != null ? `color:${result.fg}` : '',\n result.bg != null ? `background-color:${result.bg}` : '',\n ]\n .filter(Boolean)\n .join(';')),\n tabIndex: 0,\n },\n children: [code],\n },\n ],\n };\n return hastToHtml(root);\n}\n", "// Appends every entry of `items` onto `target` one at a time. Deliberately not\n// `target.push(...items)`: a spread passes one argument per entry and engines\n// cap argument counts (V8 near 124k, JavaScriptCore near 639k), so spreading a\n// line-sized array such as the rows of a massive hunk throws a RangeError.\nexport function appendItems<T>(target: T[], items: readonly T[]): void {\n for (const item of items) {\n target.push(item);\n }\n}\n"],
5
- "mappings": ";;;;;;;;AAEA,SAAgB,kBAA2B;AACzC,SACE,OAAO,sBAAsB,eAC7B,OAAO,SAAS,eAChB,gBAAgB;AAEpB;;;ACRA,SAAgB,mBACd,QACsB;AACtB,MAAI;AACJ,SAAA,MACG,WAAW,OAAO,EAAE,KAAA,CAClB,WAAW;AACV,aAAS;AACT,WAAO;EACT,GAAA,CACC,UAAmB;AAClB,aAAS;AACT,UAAM;EACR,CACF;AACJ;;;ACgEA,IAAa,sBAAb,cAAyC,MAAM;EAC7C,YAAY,MAAc;AACxB,UAAM,UAAU,IAAA,yBAA6B;AAC7C,SAAK,OAAO;EACd;AACF;AAGA,IAAa,yBAAb,cAA4C,MAAM;EAChD,YAAY,MAAc;AACxB,UAAM,mCAAmC,IAAA,GAAO;AAChD,SAAK,OAAO;EACd;AACF;AAKA,IAAa,uBAAb,cAA0C,MAAM;EAC9C,YAAY,MAAc;AACxB,UAAM,UAAU,IAAA,yBAA6B;AAC7C,SAAK,OAAO;EACd;AACF;AAKA,SAAgB,oBACd,UAAwC,CAAC,GAClB;AAEvB,QAAM,UAAU,oBAAI,IAA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MAAE,MAAM;MAAQ,OAAO;IAAK,CAAC;AAC3D,SAAK,SAAS,KAAK,MAAM,CAAA,CAAE;EAC7B;AACA,QAAMC,QAAa;IACjB,MAAM;IACN,UAAU,CACR;MACE,MAAM;MACN,SAAS;MACT,YAAY;QACV,OAAO;QACP,OACE,OAAO,cAAc,QACjB,SACC,OAAO,aACR,CACE,OAAO,MAAM,OAAO,SAAS,OAAO,EAAA,KAAO,IAC3C,OAAO,MAAM,OAAO,oBAAoB,OAAO,EAAA,KAAO,EACxD,EACG,OAAO,OAAO,EACd,KAAK,GAAG;QACjB,UAAU;MACZ;MACA,UAAU,CAAC,IAAI;IACjB,CACF;EACF;AACA,SAAO,WAAWA,KAAI;AACxB;;;AClEA,SAAgB,YAAe,QAAa,OAA2B;AACrE,aAAW,QAAQ,MACjB,QAAO,KAAK,IAAI;AAEpB;",
4
+ "sourcesContent": ["declare const WorkerGlobalScope: new () => Worker;\n\nexport function isWorkerContext(): boolean {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n typeof self !== 'undefined' &&\n self instanceof WorkerGlobalScope\n );\n}\n", "export function createCachedLoader<T extends object>(\n loader: () => Promise<T>\n): () => T | Promise<T> {\n let cached: T | Promise<T> | undefined;\n return () =>\n (cached ??= loader().then(\n (loaded) => {\n cached = loaded;\n return loaded;\n },\n (error: unknown) => {\n cached = undefined;\n throw error;\n }\n ));\n}\n", "/**\n * Concurrent requests for one name share a load. Resolved themes are cached\n * for synchronous reads; module default exports are unwrapped before caching.\n */\n\nimport type { ThemeLike } from './types';\nimport { type DefaultExport, unwrapDefault } from './unwrapDefault';\n\n// A loader is a zero-argument async factory that returns either a ThemeLike\n// directly or a module-style `{ default: ThemeLike }` (the shape produced by\n// `import()` on a JSON theme file or a re-exporting ESM module).\nexport interface ThemeLoader<TTheme extends ThemeLike = ThemeLike> {\n (): Promise<TTheme | DefaultExport<TTheme>>;\n}\n\nexport interface ThemeResolverOptions<TTheme extends ThemeLike = ThemeLike> {\n /** Load an unregistered name; undefined means the fallback does not know it. */\n fallbackLoader?: (\n name: string\n ) => Promise<TTheme | DefaultExport<TTheme> | undefined>;\n /** Normalize loaded themes before caching. Seeded themes are already resolved. */\n normalizeTheme?: (theme: TTheme, name: string) => TTheme | Promise<TTheme>;\n}\n\nexport interface ThemeResolver<TTheme extends ThemeLike = ThemeLike> {\n // Seed the resolved cache with an already-resolved theme under `name`,\n // without registering or running a loader. Intended for environments that\n // receive a fully-resolved theme object out of band (for example a worker\n // that is handed pre-resolved themes by the main thread and cannot run a\n // loader itself). A subsequent getResolvedTheme/getResolvedOrResolveTheme/\n // resolveTheme for `name` returns the seeded theme; a later resolveTheme is\n // served from the cache and never invokes a registered loader for that name.\n seedResolvedTheme(name: string, theme: TTheme): void;\n\n // Seed multiple resolved themes. Accepts any iterable of `[name, theme]`\n // entries so callers can pass arrays or Maps without reshaping.\n seedResolvedThemes(entries: Iterable<readonly [string, TTheme]>): void;\n\n // Clear the resolved cache and in-flight promises. Registered loaders are\n // kept so subsequent resolveTheme calls re-run them.\n clearResolvedThemes(): void;\n\n // Returns the cached ThemeLike synchronously when warm; otherwise returns\n // the resolveTheme Promise so callers can await it when cold.\n getResolvedOrResolveTheme(name: string): TTheme | Promise<TTheme>;\n\n // Synchronous cache read. Returns undefined if the theme has not been\n // resolved yet.\n getResolvedTheme(name: string): TTheme | undefined;\n\n // Synchronous cache read for a batch. Throws UnresolvedThemeError naming the\n // first missing theme if any requested name is not warm.\n getResolvedThemes(names: readonly string[]): TTheme[];\n\n // Registry/cache introspection helpers for callers that need to avoid an async\n // tick or decide whether to register a fallback loader.\n hasRegisteredTheme(name: string): boolean;\n hasResolvedTheme(name: string): boolean;\n hasResolvedThemes(names: readonly string[]): boolean;\n\n // Register a named loader. Throws DuplicateThemeError if a loader for\n // `name` is already present.\n registerTheme(name: string, loader: ThemeLoader<TTheme>): void;\n\n // Register a loader only when `name` has no loader yet. Returns true when the\n // loader was added and false when a loader already existed.\n registerThemeIfAbsent(name: string, loader: ThemeLoader<TTheme>): boolean;\n\n // Resolve a theme by name. Dedupes concurrent calls and caches the result.\n // Rejects with UnregisteredThemeError if no loader has been registered.\n resolveTheme(name: string): Promise<TTheme>;\n\n // Resolve a batch of themes in input order. Each name still goes through the\n // same cache and in-flight dedupe as resolveTheme.\n resolveThemes(names: readonly string[]): Promise<TTheme[]>;\n}\n\n// Thrown when a caller tries to register a second loader for an already-known\n// theme name. The generic resolver is strict — idempotency layers live above.\nexport class DuplicateThemeError extends Error {\n constructor(name: string) {\n super(`Theme \"${name}\" is already registered`);\n this.name = 'DuplicateThemeError';\n }\n}\n\n// Thrown when resolveTheme is called for a name with no registered loader.\nexport class UnregisteredThemeError extends Error {\n constructor(name: string) {\n super(`No loader registered for theme \"${name}\"`);\n this.name = 'UnregisteredThemeError';\n }\n}\n\n// Thrown when callers require a synchronously resolved theme but the cache does\n// not contain that name. This is distinct from UnregisteredThemeError: the\n// theme may have a loader, it just has not been resolved or seeded yet.\nexport class UnresolvedThemeError extends Error {\n constructor(name: string) {\n super(`Theme \"${name}\" has not been resolved`);\n this.name = 'UnresolvedThemeError';\n }\n}\n\n// Creates an isolated ThemeResolver instance with its own loader registry,\n// resolved-theme cache, and in-flight dedupe map. Multiple instances never\n// share state.\nexport function createThemeResolver<TTheme extends ThemeLike = ThemeLike>(\n options: ThemeResolverOptions<TTheme> = {}\n): ThemeResolver<TTheme> {\n // Maps theme name → registered loader function (set at register time).\n const loaders = new Map<string, ThemeLoader<TTheme>>();\n\n // Synchronous cache of successfully resolved ThemeLike objects.\n const resolved = new Map<string, TTheme>();\n\n // In-flight dedupe map: while a load is running, subsequent callers for the\n // same name receive the same Promise instead of launching another load.\n const inflight = new Map<string, Promise<TTheme>>();\n\n // Incremented whenever resolved/in-flight state is cleared. A loader that\n // started before a clear may still settle later; the generation check prevents\n // that stale promise from repopulating the cache.\n let cacheGeneration = 0;\n\n function registerTheme(name: string, loader: ThemeLoader<TTheme>): void {\n if (loaders.has(name)) {\n throw new DuplicateThemeError(name);\n }\n loaders.set(name, loader);\n }\n\n function registerThemeIfAbsent(\n name: string,\n loader: ThemeLoader<TTheme>\n ): boolean {\n if (loaders.has(name)) return false;\n loaders.set(name, loader);\n return true;\n }\n\n function hasRegisteredTheme(name: string): boolean {\n return loaders.has(name);\n }\n\n // Resolves a theme by name. Returns immediately if the theme is already in\n // the synchronous cache, dedupes concurrent calls via the inflight map, and\n // clears the inflight entry after settlement (success or failure) so that\n // failed loads can be retried by the next caller.\n function resolveTheme(name: string): Promise<TTheme> {\n const cached = resolved.get(name);\n if (cached !== undefined) {\n return Promise.resolve(cached);\n }\n\n const existing = inflight.get(name);\n if (existing !== undefined) {\n return existing;\n }\n\n const loader = loaders.get(name);\n if (loader === undefined && options.fallbackLoader === undefined) {\n return Promise.reject(new UnregisteredThemeError(name));\n }\n\n const generation = cacheGeneration;\n const promise = Promise.resolve()\n .then(() =>\n loader !== undefined ? loader() : options.fallbackLoader?.(name)\n )\n .then(async (result) => {\n // A loader may return either a bare ThemeLike or an ES-module namespace\n // object ({ default: ThemeLike }) — the latter is typical when the\n // loader calls a dynamic import() on a JSON or .ts theme file and the\n // bundler/runtime wraps the value under `default`. We treat any object\n // carrying a top-level `default` key as the module-namespace form.\n // Real ThemeLike theme objects never carry a top-level `default` key,\n // so the heuristic is unambiguous in practice.\n if (result === undefined) throw new UnregisteredThemeError(name);\n const loaded = unwrapDefault(result);\n const theme =\n options.normalizeTheme === undefined\n ? loaded\n : await options.normalizeTheme(loaded, name);\n if (generation === cacheGeneration) {\n resolved.set(name, theme);\n }\n if (inflight.get(name) === promise) {\n inflight.delete(name);\n }\n return theme;\n })\n .catch((err: unknown) => {\n // Clear the inflight entry so a later call can retry.\n if (inflight.get(name) === promise) {\n inflight.delete(name);\n }\n throw err;\n });\n\n inflight.set(name, promise);\n return promise;\n }\n\n function resolveThemes(names: readonly string[]): Promise<TTheme[]> {\n return Promise.all(names.map((name) => resolveTheme(name)));\n }\n\n // Seeds the resolved cache directly with a pre-resolved theme. No loader is\n // registered or run — the value is simply made available to subsequent\n // getResolvedTheme/getResolvedOrResolveTheme/resolveTheme calls. Used by\n // callers (e.g. workers) that obtain a fully-resolved theme object out of\n // band and want it served synchronously without a loader round-trip.\n function seedResolvedTheme(name: string, theme: TTheme): void {\n resolved.set(name, theme);\n }\n\n function seedResolvedThemes(\n entries: Iterable<readonly [string, TTheme]>\n ): void {\n for (const [name, theme] of entries) {\n seedResolvedTheme(name, theme);\n }\n }\n\n function getResolvedTheme(name: string): TTheme | undefined {\n return resolved.get(name);\n }\n\n function getResolvedThemes(names: readonly string[]): TTheme[] {\n const themes: TTheme[] = [];\n for (const name of names) {\n const theme = resolved.get(name);\n if (theme === undefined) {\n throw new UnresolvedThemeError(name);\n }\n themes.push(theme);\n }\n return themes;\n }\n\n function hasResolvedTheme(name: string): boolean {\n return resolved.has(name);\n }\n\n function hasResolvedThemes(names: readonly string[]): boolean {\n for (const name of names) {\n if (!resolved.has(name)) return false;\n }\n return true;\n }\n\n // Returns the cached ThemeLike synchronously if available, otherwise falls\n // through to resolveTheme so callers can await the returned Promise. This\n // matches the \"get hot, resolve cold\" pattern used throughout the diffs\n // package (getResolvedOrResolveTheme semantics).\n function getResolvedOrResolveTheme(name: string): TTheme | Promise<TTheme> {\n const cached = resolved.get(name);\n if (cached !== undefined) {\n return cached;\n }\n return resolveTheme(name);\n }\n\n // Clears the resolved cache and any in-flight promises so that subsequent\n // calls re-run loaders from scratch. Registered loaders are preserved.\n function clearResolvedThemes(): void {\n cacheGeneration++;\n resolved.clear();\n inflight.clear();\n }\n\n return {\n clearResolvedThemes,\n getResolvedOrResolveTheme,\n getResolvedTheme,\n getResolvedThemes,\n hasRegisteredTheme,\n hasResolvedTheme,\n hasResolvedThemes,\n registerTheme,\n registerThemeIfAbsent,\n resolveTheme,\n resolveThemes,\n seedResolvedTheme,\n seedResolvedThemes,\n };\n}\n", "import type {\n Theme as ZedTheme,\n ThemeFamily as ZedThemeFamily,\n} from '@pierre/highlights';\nimport {\n createThemeResolver,\n type ThemeLoader,\n type ThemeResolver,\n} from '@pierre/theming';\nimport type { ThemeRegistration } from 'shiki';\n\nimport type { HighlighterTypes } from '../../types';\nimport { isWorkerContext } from '../../utils/isWorkerContext';\nimport { createCachedLoader } from './createCachedLoader';\nimport type { DiffsTheme } from './types';\n\ndeclare const __DIFFS_WORKER__: boolean | undefined;\n\nexport type CustomThemeLoader = ThemeLoader<\n ThemeRegistration | DiffsTheme | ZedTheme | ZedThemeFamily\n>;\nexport const customThemes: Map<\n string,\n Partial<Record<'textmate' | 'zed' | 'diffs', CustomThemeLoader>>\n> = new Map();\nconst resolvers = new Map<HighlighterTypes, ThemeResolver<DiffsTheme>>();\n\nconst loadHighlightsThemeCatalog = createCachedLoader(\n () => import('@pierre/highlights/themes/loader')\n);\nconst loadPierreThemeCatalog = createCachedLoader(\n () => import('@pierre/theming/themes')\n);\nconst loadShikiCore = createCachedLoader(() => import('shiki/core'));\n\n// Map Zed colors to the VS Code keys used by editor and diff overlays.\nconst ZED_COLOR_ALIASES: readonly (readonly [\n target: string,\n ...sources: string[],\n])[] = [\n ['editor.lineHighlightBackground', 'editor.active_line.background'],\n ['editor.selectionBackground', 'element.selected'],\n ['editor.findMatchBackground', 'search.match_background'],\n ['editor.findMatchHighlightBackground', 'search.match_background'],\n [\n 'editorBracketMatch.background',\n 'editor.document_highlight.bracket_background',\n ],\n ['editorError.foreground', 'error'],\n ['editorWarning.foreground', 'warning'],\n ['editorInfo.foreground', 'info'],\n ['editorHint.foreground', 'hint'],\n ['gitDecoration.addedResourceForeground', 'created', 'terminal.ansi.green'],\n ['gitDecoration.deletedResourceForeground', 'deleted', 'terminal.ansi.red'],\n [\n 'gitDecoration.modifiedResourceForeground',\n 'modified',\n 'terminal.ansi.blue',\n ],\n];\n\nfunction createHighlightsTheme(\n name: string,\n raw: ZedTheme | ZedThemeFamily\n): DiffsTheme {\n const theme = 'themes' in raw ? raw.themes[0] : raw;\n if (theme == null)\n throw new Error(`Theme \"${name}\" is an empty Zed theme family.`);\n const zed = { ...theme, name };\n const colors: Record<string, string> = {};\n for (const [key, value] of Object.entries(zed.style)) {\n if (typeof value === 'string') colors[key] = value;\n }\n // Zed keeps the local user's caret and selection in the first player slot.\n const player = zed.style.players?.[0];\n if (player?.cursor != null)\n colors['editorCursor.foreground'] ??= player.cursor;\n if (player?.selection != null)\n colors['editor.selectionBackground'] ??= player.selection;\n for (const [target, ...sources] of ZED_COLOR_ALIASES) {\n if (colors[target] != null) continue;\n const source = sources.find((key) => colors[key] != null);\n if (source != null) colors[target] = colors[source];\n }\n if (zed.cssVariables === true) {\n colors['editor.foreground'] = 'var(--hls-foreground)';\n colors['editor.background'] = 'var(--hls-background)';\n } else if (typeof zed.cssVariables === 'object') {\n colors['editor.foreground'] ??=\n colors.text ?? colors.foreground ?? 'foreground';\n colors['editor.background'] ??= colors.background ?? 'background';\n const { prefix = '--hls-', defaults } = zed.cssVariables;\n for (const [key, value] of Object.entries(colors)) {\n const fallback = defaults?.[value];\n colors[key] = `var(${prefix}${value}${fallback ? `, ${fallback}` : ''})`;\n }\n }\n const type = zed.appearance === 'light' ? 'light' : 'dark';\n return {\n name,\n type,\n colors,\n zed,\n fg:\n colors['editor.foreground'] ??\n colors.text ??\n colors.foreground ??\n (type === 'light' ? '#333333' : '#bbbbbb'),\n bg:\n colors['editor.background'] ??\n colors.background ??\n (type === 'light' ? '#ffffff' : '#1e1e1e'),\n };\n}\n\n/** Keep caches separate because the same name can have TextMate and Zed palettes. */\nexport function createDiffsThemeResolver(\n backend: HighlighterTypes\n): ThemeResolver<DiffsTheme> {\n let resolver = resolvers.get(backend);\n if (resolver != null) return resolver;\n resolver = createThemeResolver<DiffsTheme>({\n fallbackLoader: async (name) => {\n if (\n typeof __DIFFS_WORKER__ !== 'undefined'\n ? __DIFFS_WORKER__\n : isWorkerContext()\n ) {\n throw new Error(\n `Theme \"${name}\" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedThemes parameter.`\n );\n }\n const custom = customThemes.get(name);\n if (backend === 'highlights') {\n const loader = custom?.zed ?? custom?.diffs;\n if (loader != null) {\n const loaded = await loader();\n const theme = 'default' in loaded ? loaded.default : loaded;\n if ('zed' in theme && theme.zed != null) return theme;\n if ('style' in theme || 'themes' in theme)\n return createHighlightsTheme(name, theme);\n throw new Error(\n `Theme \"${name}\" is a TextMate theme; register a Zed theme with registerCustomTheme(name, loader, 'zed') for Highlights.`\n );\n }\n const catalog = loadHighlightsThemeCatalog();\n const { themes } = catalog instanceof Promise ? await catalog : catalog;\n const bundledLoader = themes[name];\n if (bundledLoader != null) {\n const loaded = await bundledLoader();\n return createHighlightsTheme(name, loaded.default);\n }\n if (custom?.textmate != null) {\n throw new Error(\n `Theme \"${name}\" is only registered for TextMate; use registerCustomTheme(name, loader, 'zed') for Highlights.`\n );\n }\n } else {\n const loader = custom?.textmate ?? custom?.diffs;\n let loaded: ThemeRegistration | DiffsTheme | ZedTheme | ZedThemeFamily;\n if (loader != null) {\n const result = await loader();\n loaded = 'default' in result ? result.default : result;\n } else {\n const catalog = loadPierreThemeCatalog();\n const { themes } =\n catalog instanceof Promise ? await catalog : catalog;\n const descriptor = themes.getTheme(name);\n if (descriptor == null && custom?.zed != null) {\n throw new Error(\n `Theme \"${name}\" is only registered for Zed; use registerCustomTheme(name, loader, 'textmate') for Shiki.`\n );\n }\n if (descriptor == null)\n throw new Error(`No valid theme loader registered for \"${name}\"`);\n const result = await descriptor.load();\n loaded = 'default' in result ? result.default : result;\n }\n if ('style' in loaded || 'themes' in loaded) {\n throw new Error(\n `Theme \"${name}\" is a Zed theme; use preferredHighlighter: 'highlights' or register a TextMate theme for Shiki.`\n );\n }\n const core = loadShikiCore();\n const { normalizeTheme, createCssVariablesTheme } =\n core instanceof Promise ? await core : core;\n if ('cssVariables' in loaded && loaded.cssVariables != null) {\n return {\n ...loaded,\n textmate: normalizeTheme(\n createCssVariablesTheme(loaded.cssVariables)\n ),\n };\n }\n if ('textmate' in loaded && loaded.textmate != null) {\n return { ...loaded, textmate: normalizeTheme(loaded.textmate) };\n }\n const textmate = normalizeTheme(loaded);\n return {\n name: textmate.name,\n type: textmate.type,\n fg: textmate.fg,\n bg: textmate.bg,\n colors: textmate.colors,\n textmate,\n };\n }\n throw new Error(`No valid theme loader registered for \"${name}\"`);\n },\n normalizeTheme: (theme, name) => {\n if (theme.name !== name)\n throw new Error(\n `resolvedTheme: themeName: ${name} does not match theme.name: ${theme.name}`\n );\n return theme;\n },\n });\n resolvers.set(backend, resolver);\n return resolver;\n}\n", "import type {\n CodeViewLayout,\n HighlighterTypes,\n HunkExpansionRegion,\n RenderRange,\n SmoothScrollSettings,\n ThemesType,\n VirtualFileMetrics,\n} from './types';\n\nexport const DIFFS_TAG_NAME = 'diffs-container' as const;\n\n// Keep this as a NODE_ENV read so app builds can hard-disable development-only\n// checks unless they are explicitly built for development.\nexport const DIFFS_DEVELOPMENT_BUILD: boolean = (() => {\n try {\n return process.env.NODE_ENV === 'development';\n } catch {\n return false;\n }\n})();\n\n// Misc patch/content parsing regexes\nexport const COMMIT_METADATA_SPLIT: RegExp = /(?=^From [a-f0-9]+ .+$)/m;\nexport const GIT_DIFF_FILE_BREAK_REGEX: RegExp = /(?=^diff --git)/gm;\nexport const UNIFIED_DIFF_FILE_BREAK_REGEX: RegExp = /(?=^---\\s+\\S)/gm;\nexport const FILE_CONTEXT_BLOB: RegExp = /(?=^@@ )/gm;\nexport const HUNK_HEADER: RegExp =\n /^@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@(?: (.*))?/m;\nexport const SPLIT_WITH_NEWLINES: RegExp = /(?<=\\n)/;\nexport const FILENAME_HEADER_REGEX: RegExp = /^(---|\\+\\+\\+)\\s+([^\\t\\r\\n]+)/;\nexport const INDEX_LINE_METADATA: RegExp =\n /^index ([0-9a-f]+)\\.\\.([0-9a-f]+)(?: (\\d+))?$/i;\n\nexport const MERGE_CONFLICT_START_MARKER_REGEX: RegExp = /^<{7,}(?:\\s.*)?$/;\nexport const MERGE_CONFLICT_BASE_MARKER_REGEX: RegExp = /^\\|{7,}(?:\\s.*)?$/;\nexport const MERGE_CONFLICT_SEPARATOR_MARKER_REGEX: RegExp = /^={7,}$/;\nexport const MERGE_CONFLICT_END_MARKER_REGEX: RegExp = /^>{7,}(?:\\s.*)?$/;\n\nexport const HEADER_PREFIX_SLOT_ID = 'header-prefix';\nexport const HEADER_FILENAME_SUFFIX_SLOT_ID = 'header-filename-suffix';\nexport const HEADER_METADATA_SLOT_ID = 'header-metadata';\nexport const CUSTOM_HEADER_SLOT_ID = 'header-custom';\n\nexport const DEFAULT_THEMES: ThemesType = {\n dark: 'pierre-dark',\n light: 'pierre-light',\n};\n\n// The highlighter type used when no request names one and none is active yet.\nexport const DEFAULT_HIGHLIGHTER: HighlighterTypes = 'shiki-js';\n\nexport const THEME_CSS_ATTRIBUTE = 'data-theme-css';\nexport const UNSAFE_CSS_ATTRIBUTE = 'data-unsafe-css';\nexport const CORE_CSS_ATTRIBUTE = 'data-core-css';\nexport const DIFFS_SCROLLBAR_MEASURE_ATTRIBUTE = 'data-diffs-scrollbar-measure';\nexport const CODE_VIEW_HEADER_ATTRIBUTE = 'data-diffs-code-view-header';\nexport const CODE_VIEW_FOOTER_ATTRIBUTE = 'data-diffs-code-view-footer';\nexport const DIFFS_SCROLLBAR_GUTTER_MEASURED_PROPERTY =\n '--diffs-scrollbar-gutter-measured';\n\nexport const DEFAULT_COLLAPSED_CONTEXT_THRESHOLD = 1;\nexport const DEFAULT_TOKENIZE_MAX_LENGTH = 100_000;\nexport const DEFAULT_VIRTUAL_FILE_METRICS: VirtualFileMetrics = {\n hunkLineCount: 50,\n lineHeight: 20,\n diffHeaderHeight: 44,\n spacing: 8,\n};\n\nexport const DEFAULT_CODE_VIEW_FILE_METRICS: VirtualFileMetrics = {\n ...DEFAULT_VIRTUAL_FILE_METRICS,\n hunkLineCount: 1,\n};\n\nexport const DEFAULT_CODE_VIEW_LAYOUT: CodeViewLayout = {\n paddingTop: 8,\n paddingBottom: 8,\n gap: 8,\n};\n\nexport const DEFAULT_SMOOTH_SCROLL_SETTINGS: SmoothScrollSettings = {\n omega: 0.015,\n positionEpsilon: 0.5,\n velocityEpsilon: 0.05,\n};\n\nexport const DEFAULT_EXPANDED_REGION: HunkExpansionRegion = Object.freeze({\n fromStart: 0,\n fromEnd: 0,\n});\n\nexport const DEFAULT_RENDER_RANGE: RenderRange = {\n startingLine: 0,\n totalLines: Infinity,\n bufferBefore: 0,\n bufferAfter: 0,\n};\n\nexport const EMPTY_LINE_ANNOTATIONS: never[] = Object.freeze([]) as never[];\n\nexport const EMPTY_RENDER_RANGE: RenderRange = {\n startingLine: 0,\n totalLines: 0,\n bufferBefore: 0,\n bufferAfter: 0,\n};\n", "import { DEFAULT_HIGHLIGHTER } from '../constants';\nimport type { HighlighterTypes } from '../types';\n\n// The main thread and each worker allow one highlighter type at a time.\n// Pending creations and live instances prevent switching types.\nlet activeType: HighlighterTypes | undefined;\nlet holds = 0;\n\nexport class HighlighterDisposedError extends Error {\n constructor() {\n super('Highlighter is disposed');\n this.name = 'HighlighterDisposedError';\n }\n}\n\nexport function getHighlighterType(): HighlighterTypes | undefined {\n return activeType;\n}\n\nexport function resolveHighlighterType(\n type?: HighlighterTypes\n): HighlighterTypes {\n return type ?? activeType ?? DEFAULT_HIGHLIGHTER;\n}\n\nexport function assertHighlighterType(type: HighlighterTypes): void {\n if (activeType != null && activeType !== type) {\n throw new Error(\n `Cannot load the \"${type}\" highlighter while \"${activeType}\" is in use. Only one highlighter type can be active at a time; dispose every \"${activeType}\" instance (disposeHighlighter() disposes the shared one) before switching.`\n );\n }\n}\n\nexport function acquireHighlighterType(type: HighlighterTypes): void {\n assertHighlighterType(type);\n activeType = type;\n holds++;\n}\n\nexport function releaseHighlighterType(): void {\n holds--;\n if (holds === 0) {\n activeType = undefined;\n }\n}\n", "/**\n * List of HTML void tag names.\n *\n * @type {Array<string>}\n */\nexport const htmlVoidElements = [\n 'area',\n 'base',\n 'basefont',\n 'bgsound',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'frame',\n 'hr',\n 'image',\n 'img',\n 'input',\n 'keygen',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr'\n]\n", "/**\n * @import {Schema as SchemaType, Space} from 'property-information'\n */\n\n/** @type {SchemaType} */\nexport class Schema {\n /**\n * @param {SchemaType['property']} property\n * Property.\n * @param {SchemaType['normal']} normal\n * Normal.\n * @param {Space | undefined} [space]\n * Space.\n * @returns\n * Schema.\n */\n constructor(property, normal, space) {\n this.normal = normal\n this.property = property\n\n if (space) {\n this.space = space\n }\n }\n}\n\nSchema.prototype.normal = {}\nSchema.prototype.property = {}\nSchema.prototype.space = undefined\n", "/**\n * @import {Info, Space} from 'property-information'\n */\n\nimport {Schema} from './schema.js'\n\n/**\n * @param {ReadonlyArray<Schema>} definitions\n * Definitions.\n * @param {Space | undefined} [space]\n * Space.\n * @returns {Schema}\n * Schema.\n */\nexport function merge(definitions, space) {\n /** @type {Record<string, Info>} */\n const property = {}\n /** @type {Record<string, string>} */\n const normal = {}\n\n for (const definition of definitions) {\n Object.assign(property, definition.property)\n Object.assign(normal, definition.normal)\n }\n\n return new Schema(property, normal, space)\n}\n", "/**\n * Get the cleaned case insensitive form of an attribute or property.\n *\n * @param {string} value\n * An attribute-like or property-like name.\n * @returns {string}\n * Value that can be used to look up the properly cased property on a\n * `Schema`.\n */\nexport function normalize(value) {\n return value.toLowerCase()\n}\n", "/**\n * @import {Info as InfoType} from 'property-information'\n */\n\n/** @type {InfoType} */\nexport class Info {\n /**\n * @param {string} property\n * Property.\n * @param {string} attribute\n * Attribute.\n * @returns\n * Info.\n */\n constructor(property, attribute) {\n this.attribute = attribute\n this.property = property\n }\n}\n\nInfo.prototype.attribute = ''\nInfo.prototype.booleanish = false\nInfo.prototype.boolean = false\nInfo.prototype.commaOrSpaceSeparated = false\nInfo.prototype.commaSeparated = false\nInfo.prototype.defined = false\nInfo.prototype.mustUseProperty = false\nInfo.prototype.number = false\nInfo.prototype.overloadedBoolean = false\nInfo.prototype.property = ''\nInfo.prototype.spaceSeparated = false\nInfo.prototype.space = undefined\n", "let powers = 0\n\nexport const boolean = increment()\nexport const booleanish = increment()\nexport const overloadedBoolean = increment()\nexport const number = increment()\nexport const spaceSeparated = increment()\nexport const commaSeparated = increment()\nexport const commaOrSpaceSeparated = increment()\n\nfunction increment() {\n return 2 ** ++powers\n}\n", "/**\n * @import {Space} from 'property-information'\n */\n\nimport {Info} from './info.js'\nimport * as types from './types.js'\n\nconst checks = /** @type {ReadonlyArray<keyof typeof types>} */ (\n Object.keys(types)\n)\n\nexport class DefinedInfo extends Info {\n /**\n * @constructor\n * @param {string} property\n * Property.\n * @param {string} attribute\n * Attribute.\n * @param {number | null | undefined} [mask]\n * Mask.\n * @param {Space | undefined} [space]\n * Space.\n * @returns\n * Info.\n */\n constructor(property, attribute, mask, space) {\n let index = -1\n\n super(property, attribute)\n\n mark(this, 'space', space)\n\n if (typeof mask === 'number') {\n while (++index < checks.length) {\n const check = checks[index]\n mark(this, checks[index], (mask & types[check]) === types[check])\n }\n }\n }\n}\n\nDefinedInfo.prototype.defined = true\n\n/**\n * @template {keyof DefinedInfo} Key\n * Key type.\n * @param {DefinedInfo} values\n * Info.\n * @param {Key} key\n * Key.\n * @param {DefinedInfo[Key]} value\n * Value.\n * @returns {undefined}\n * Nothing.\n */\nfunction mark(values, key, value) {\n if (value) {\n values[key] = value\n }\n}\n", "/**\n * @import {Info, Space} from 'property-information'\n */\n\n/**\n * @typedef Definition\n * Definition of a schema.\n * @property {Record<string, string> | undefined} [attributes]\n * Normalzed names to special attribute case.\n * @property {ReadonlyArray<string> | undefined} [mustUseProperty]\n * Normalized names that must be set as properties.\n * @property {Record<string, number | null>} properties\n * Property names to their types.\n * @property {Space | undefined} [space]\n * Space.\n * @property {Transform} transform\n * Transform a property name.\n */\n\n/**\n * @callback Transform\n * Transform.\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} property\n * Property.\n * @returns {string}\n * Attribute.\n */\n\nimport {normalize} from '../normalize.js'\nimport {DefinedInfo} from './defined-info.js'\nimport {Schema} from './schema.js'\n\n/**\n * @param {Definition} definition\n * Definition.\n * @returns {Schema}\n * Schema.\n */\nexport function create(definition) {\n /** @type {Record<string, Info>} */\n const properties = {}\n /** @type {Record<string, string>} */\n const normals = {}\n\n for (const [property, value] of Object.entries(definition.properties)) {\n const info = new DefinedInfo(\n property,\n definition.transform(definition.attributes || {}, property),\n value,\n definition.space\n )\n\n if (\n definition.mustUseProperty &&\n definition.mustUseProperty.includes(property)\n ) {\n info.mustUseProperty = true\n }\n\n properties[property] = info\n\n normals[normalize(property)] = property\n normals[normalize(info.attribute)] = property\n }\n\n return new Schema(properties, normals, definition.space)\n}\n", "import {create} from './util/create.js'\nimport {booleanish, number, spaceSeparated} from './util/types.js'\n\nexport const aria = create({\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n },\n transform(_, property) {\n return property === 'role'\n ? property\n : 'aria-' + property.slice(4).toLowerCase()\n }\n})\n", "/**\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} attribute\n * Attribute.\n * @returns {string}\n * Transformed attribute.\n */\nexport function caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute\n}\n", "import {caseSensitiveTransform} from './case-sensitive-transform.js'\n\n/**\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} property\n * Property.\n * @returns {string}\n * Transformed property.\n */\nexport function caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n", "import {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\nimport {create} from './util/create.js'\nimport {\n booleanish,\n boolean,\n commaSeparated,\n number,\n overloadedBoolean,\n spaceSeparated\n} from './util/types.js'\n\nexport const html = create({\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: boolean,\n allowPaymentRequest: boolean,\n allowUserMedia: boolean,\n alpha: boolean,\n alt: null,\n as: null,\n async: boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: boolean,\n autoPlay: boolean,\n blocking: spaceSeparated,\n capture: null,\n charSet: null,\n checked: boolean,\n cite: null,\n className: spaceSeparated,\n closedBy: null,\n colorSpace: null,\n cols: number,\n colSpan: number,\n command: null,\n commandFor: null,\n content: null,\n contentEditable: booleanish,\n controls: boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n default: boolean,\n defer: boolean,\n dir: null,\n dirName: null,\n disabled: boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n fetchPriority: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: overloadedBoolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: null,\n inert: boolean,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loading: null,\n loop: boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: boolean,\n muted: boolean,\n name: null,\n nonce: null,\n noModule: boolean,\n noValidate: boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforeMatch: null,\n onBeforePrint: null,\n onBeforeToggle: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextLost: null,\n onContextMenu: null,\n onContextRestored: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onScrollEnd: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: boolean,\n popover: null,\n popoverTarget: null,\n popoverTargetAction: null,\n poster: null,\n preload: null,\n readOnly: boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: boolean,\n reversed: boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: boolean,\n seamless: boolean,\n selected: boolean,\n shadowRootClonable: boolean,\n shadowRootCustomElementRegistry: boolean,\n shadowRootDelegatesFocus: boolean,\n shadowRootMode: null,\n shadowRootSerializable: boolean,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: null,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n writingSuggestions: null,\n\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null, // Several. Use CSS `text-align` instead,\n aLink: null, // `<body>`. Use CSS `a:active {color}` instead\n archive: spaceSeparated, // `<object>`. List of URIs to archives\n axis: null, // `<td>` and `<th>`. Use `scope` on `<th>`\n background: null, // `<body>`. Use CSS `background-image` instead\n bgColor: null, // `<body>` and table elements. Use CSS `background-color` instead\n border: number, // `<table>`. Use CSS `border-width` instead,\n borderColor: null, // `<table>`. Use CSS `border-color` instead,\n bottomMargin: number, // `<body>`\n cellPadding: null, // `<table>`\n cellSpacing: null, // `<table>`\n char: null, // Several table elements. When `align=char`, sets the character to align on\n charOff: null, // Several table elements. When `char`, offsets the alignment\n classId: null, // `<object>`\n clear: null, // `<br>`. Use CSS `clear` instead\n code: null, // `<object>`\n codeBase: null, // `<object>`\n codeType: null, // `<object>`\n color: null, // `<font>` and `<hr>`. Use CSS instead\n compact: boolean, // Lists. Use CSS to reduce space between items instead\n declare: boolean, // `<object>`\n event: null, // `<script>`\n face: null, // `<font>`. Use CSS instead\n frame: null, // `<table>`\n frameBorder: null, // `<iframe>`. Use CSS `border` instead\n hSpace: number, // `<img>` and `<object>`\n leftMargin: number, // `<body>`\n link: null, // `<body>`. Use CSS `a:link {color: *}` instead\n longDesc: null, // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`\n lowSrc: null, // `<img>`. Use a `<picture>`\n marginHeight: number, // `<body>`\n marginWidth: number, // `<body>`\n noResize: boolean, // `<frame>`\n noHref: boolean, // `<area>`. Use no href instead of an explicit `nohref`\n noShade: boolean, // `<hr>`. Use background-color and height instead of borders\n noWrap: boolean, // `<td>` and `<th>`\n object: null, // `<applet>`\n profile: null, // `<head>`\n prompt: null, // `<isindex>`\n rev: null, // `<link>`\n rightMargin: number, // `<body>`\n rules: null, // `<table>`\n scheme: null, // `<meta>`\n scrolling: booleanish, // `<frame>`. Use overflow in the child context\n standby: null, // `<object>`\n summary: null, // `<table>`\n text: null, // `<body>`. Use CSS `color` instead\n topMargin: number, // `<body>`\n valueType: null, // `<param>`\n version: null, // `<html>`. Use a doctype.\n vAlign: null, // Several. Use CSS `vertical-align` instead\n vLink: null, // `<body>`. Use CSS `a:visited {color}` instead\n vSpace: number, // `<img>` and `<object>`\n\n // Non-standard Properties.\n allowTransparency: null,\n autoCorrect: null,\n autoSave: null,\n credentialless: boolean,\n disablePictureInPicture: boolean,\n disableRemotePlayback: boolean,\n exportParts: commaSeparated,\n part: spaceSeparated,\n prefix: null,\n property: null,\n results: number,\n security: null,\n unselectable: null\n },\n space: 'html',\n transform: caseInsensitiveTransform\n})\n", "import {caseSensitiveTransform} from './util/case-sensitive-transform.js'\nimport {create} from './util/create.js'\nimport {\n boolean,\n commaOrSpaceSeparated,\n commaSeparated,\n number,\n spaceSeparated\n} from './util/types.js'\n\nexport const svg = create({\n attributes: {\n accentHeight: 'accent-height',\n alignmentBaseline: 'alignment-baseline',\n arabicForm: 'arabic-form',\n baselineShift: 'baseline-shift',\n capHeight: 'cap-height',\n className: 'class',\n clipPath: 'clip-path',\n clipRule: 'clip-rule',\n colorInterpolation: 'color-interpolation',\n colorInterpolationFilters: 'color-interpolation-filters',\n colorProfile: 'color-profile',\n colorRendering: 'color-rendering',\n crossOrigin: 'crossorigin',\n dataType: 'datatype',\n dominantBaseline: 'dominant-baseline',\n enableBackground: 'enable-background',\n fillOpacity: 'fill-opacity',\n fillRule: 'fill-rule',\n floodColor: 'flood-color',\n floodOpacity: 'flood-opacity',\n fontFamily: 'font-family',\n fontSize: 'font-size',\n fontSizeAdjust: 'font-size-adjust',\n fontStretch: 'font-stretch',\n fontStyle: 'font-style',\n fontVariant: 'font-variant',\n fontWeight: 'font-weight',\n glyphName: 'glyph-name',\n glyphOrientationHorizontal: 'glyph-orientation-horizontal',\n glyphOrientationVertical: 'glyph-orientation-vertical',\n hrefLang: 'hreflang',\n horizAdvX: 'horiz-adv-x',\n horizOriginX: 'horiz-origin-x',\n horizOriginY: 'horiz-origin-y',\n imageRendering: 'image-rendering',\n letterSpacing: 'letter-spacing',\n lightingColor: 'lighting-color',\n markerEnd: 'marker-end',\n markerMid: 'marker-mid',\n markerStart: 'marker-start',\n maskType: 'mask-type',\n navDown: 'nav-down',\n navDownLeft: 'nav-down-left',\n navDownRight: 'nav-down-right',\n navLeft: 'nav-left',\n navNext: 'nav-next',\n navPrev: 'nav-prev',\n navRight: 'nav-right',\n navUp: 'nav-up',\n navUpLeft: 'nav-up-left',\n navUpRight: 'nav-up-right',\n onAbort: 'onabort',\n onActivate: 'onactivate',\n onAfterPrint: 'onafterprint',\n onBeforePrint: 'onbeforeprint',\n onBegin: 'onbegin',\n onCancel: 'oncancel',\n onCanPlay: 'oncanplay',\n onCanPlayThrough: 'oncanplaythrough',\n onChange: 'onchange',\n onClick: 'onclick',\n onClose: 'onclose',\n onCopy: 'oncopy',\n onCueChange: 'oncuechange',\n onCut: 'oncut',\n onDblClick: 'ondblclick',\n onDrag: 'ondrag',\n onDragEnd: 'ondragend',\n onDragEnter: 'ondragenter',\n onDragExit: 'ondragexit',\n onDragLeave: 'ondragleave',\n onDragOver: 'ondragover',\n onDragStart: 'ondragstart',\n onDrop: 'ondrop',\n onDurationChange: 'ondurationchange',\n onEmptied: 'onemptied',\n onEnd: 'onend',\n onEnded: 'onended',\n onError: 'onerror',\n onFocus: 'onfocus',\n onFocusIn: 'onfocusin',\n onFocusOut: 'onfocusout',\n onHashChange: 'onhashchange',\n onInput: 'oninput',\n onInvalid: 'oninvalid',\n onKeyDown: 'onkeydown',\n onKeyPress: 'onkeypress',\n onKeyUp: 'onkeyup',\n onLoad: 'onload',\n onLoadedData: 'onloadeddata',\n onLoadedMetadata: 'onloadedmetadata',\n onLoadStart: 'onloadstart',\n onMessage: 'onmessage',\n onMouseDown: 'onmousedown',\n onMouseEnter: 'onmouseenter',\n onMouseLeave: 'onmouseleave',\n onMouseMove: 'onmousemove',\n onMouseOut: 'onmouseout',\n onMouseOver: 'onmouseover',\n onMouseUp: 'onmouseup',\n onMouseWheel: 'onmousewheel',\n onOffline: 'onoffline',\n onOnline: 'ononline',\n onPageHide: 'onpagehide',\n onPageShow: 'onpageshow',\n onPaste: 'onpaste',\n onPause: 'onpause',\n onPlay: 'onplay',\n onPlaying: 'onplaying',\n onPopState: 'onpopstate',\n onProgress: 'onprogress',\n onRateChange: 'onratechange',\n onRepeat: 'onrepeat',\n onReset: 'onreset',\n onResize: 'onresize',\n onScroll: 'onscroll',\n onSeeked: 'onseeked',\n onSeeking: 'onseeking',\n onSelect: 'onselect',\n onShow: 'onshow',\n onStalled: 'onstalled',\n onStorage: 'onstorage',\n onSubmit: 'onsubmit',\n onSuspend: 'onsuspend',\n onTimeUpdate: 'ontimeupdate',\n onToggle: 'ontoggle',\n onUnload: 'onunload',\n onVolumeChange: 'onvolumechange',\n onWaiting: 'onwaiting',\n onZoom: 'onzoom',\n overlinePosition: 'overline-position',\n overlineThickness: 'overline-thickness',\n paintOrder: 'paint-order',\n panose1: 'panose-1',\n pointerEvents: 'pointer-events',\n referrerPolicy: 'referrerpolicy',\n renderingIntent: 'rendering-intent',\n shapeRendering: 'shape-rendering',\n stopColor: 'stop-color',\n stopOpacity: 'stop-opacity',\n strikethroughPosition: 'strikethrough-position',\n strikethroughThickness: 'strikethrough-thickness',\n strokeDashArray: 'stroke-dasharray',\n strokeDashOffset: 'stroke-dashoffset',\n strokeLineCap: 'stroke-linecap',\n strokeLineJoin: 'stroke-linejoin',\n strokeMiterLimit: 'stroke-miterlimit',\n strokeOpacity: 'stroke-opacity',\n strokeWidth: 'stroke-width',\n tabIndex: 'tabindex',\n textAnchor: 'text-anchor',\n textDecoration: 'text-decoration',\n textRendering: 'text-rendering',\n transformOrigin: 'transform-origin',\n typeOf: 'typeof',\n underlinePosition: 'underline-position',\n underlineThickness: 'underline-thickness',\n unicodeBidi: 'unicode-bidi',\n unicodeRange: 'unicode-range',\n unitsPerEm: 'units-per-em',\n vAlphabetic: 'v-alphabetic',\n vHanging: 'v-hanging',\n vIdeographic: 'v-ideographic',\n vMathematical: 'v-mathematical',\n vectorEffect: 'vector-effect',\n vertAdvY: 'vert-adv-y',\n vertOriginX: 'vert-origin-x',\n vertOriginY: 'vert-origin-y',\n wordSpacing: 'word-spacing',\n writingMode: 'writing-mode',\n xHeight: 'x-height',\n // These were camelcased in Tiny. Now lowercased in SVG 2\n playbackOrder: 'playbackorder',\n timelineBegin: 'timelinebegin'\n },\n properties: {\n about: commaOrSpaceSeparated,\n accentHeight: number,\n accumulate: null,\n additive: null,\n alignmentBaseline: null,\n alphabetic: number,\n amplitude: number,\n arabicForm: null,\n ascent: number,\n attributeName: null,\n attributeType: null,\n azimuth: number,\n bandwidth: null,\n baselineShift: null,\n baseFrequency: null,\n baseProfile: null,\n bbox: null,\n begin: null,\n bias: number,\n by: null,\n calcMode: null,\n capHeight: number,\n className: spaceSeparated,\n clip: null,\n clipPath: null,\n clipPathUnits: null,\n clipRule: null,\n color: null,\n colorInterpolation: null,\n colorInterpolationFilters: null,\n colorProfile: null,\n colorRendering: null,\n content: null,\n contentScriptType: null,\n contentStyleType: null,\n crossOrigin: null,\n cursor: null,\n cx: null,\n cy: null,\n d: null,\n dataType: null,\n defaultAction: null,\n descent: number,\n diffuseConstant: number,\n direction: null,\n display: null,\n dur: null,\n divisor: number,\n dominantBaseline: null,\n download: boolean,\n dx: null,\n dy: null,\n edgeMode: null,\n editable: null,\n elevation: number,\n enableBackground: null,\n end: null,\n event: null,\n exponent: number,\n externalResourcesRequired: null,\n fill: null,\n fillOpacity: number,\n fillRule: null,\n filter: null,\n filterRes: null,\n filterUnits: null,\n floodColor: null,\n floodOpacity: null,\n focusable: null,\n focusHighlight: null,\n fontFamily: null,\n fontSize: null,\n fontSizeAdjust: null,\n fontStretch: null,\n fontStyle: null,\n fontVariant: null,\n fontWeight: null,\n format: null,\n fr: null,\n from: null,\n fx: null,\n fy: null,\n g1: commaSeparated,\n g2: commaSeparated,\n glyphName: commaSeparated,\n glyphOrientationHorizontal: null,\n glyphOrientationVertical: null,\n glyphRef: null,\n gradientTransform: null,\n gradientUnits: null,\n handler: null,\n hanging: number,\n hatchContentUnits: null,\n hatchUnits: null,\n height: null,\n href: null,\n hrefLang: null,\n horizAdvX: number,\n horizOriginX: number,\n horizOriginY: number,\n id: null,\n ideographic: number,\n imageRendering: null,\n initialVisibility: null,\n in: null,\n in2: null,\n intercept: number,\n k: number,\n k1: number,\n k2: number,\n k3: number,\n k4: number,\n kernelMatrix: commaOrSpaceSeparated,\n kernelUnitLength: null,\n keyPoints: null, // SEMI_COLON_SEPARATED\n keySplines: null, // SEMI_COLON_SEPARATED\n keyTimes: null, // SEMI_COLON_SEPARATED\n kerning: null,\n lang: null,\n lengthAdjust: null,\n letterSpacing: null,\n lightingColor: null,\n limitingConeAngle: number,\n local: null,\n markerEnd: null,\n markerMid: null,\n markerStart: null,\n markerHeight: null,\n markerUnits: null,\n markerWidth: null,\n mask: null,\n maskContentUnits: null,\n maskType: null,\n maskUnits: null,\n mathematical: null,\n max: null,\n media: null,\n mediaCharacterEncoding: null,\n mediaContentEncodings: null,\n mediaSize: number,\n mediaTime: null,\n method: null,\n min: null,\n mode: null,\n name: null,\n navDown: null,\n navDownLeft: null,\n navDownRight: null,\n navLeft: null,\n navNext: null,\n navPrev: null,\n navRight: null,\n navUp: null,\n navUpLeft: null,\n navUpRight: null,\n numOctaves: null,\n observer: null,\n offset: null,\n onAbort: null,\n onActivate: null,\n onAfterPrint: null,\n onBeforePrint: null,\n onBegin: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnd: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFocusIn: null,\n onFocusOut: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadStart: null,\n onMessage: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onMouseWheel: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRepeat: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onShow: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onZoom: null,\n opacity: null,\n operator: null,\n order: null,\n orient: null,\n orientation: null,\n origin: null,\n overflow: null,\n overlay: null,\n overlinePosition: number,\n overlineThickness: number,\n paintOrder: null,\n panose1: null,\n path: null,\n pathLength: number,\n patternContentUnits: null,\n patternTransform: null,\n patternUnits: null,\n phase: null,\n ping: spaceSeparated,\n pitch: null,\n playbackOrder: null,\n pointerEvents: null,\n points: null,\n pointsAtX: number,\n pointsAtY: number,\n pointsAtZ: number,\n preserveAlpha: null,\n preserveAspectRatio: null,\n primitiveUnits: null,\n propagate: null,\n property: commaOrSpaceSeparated,\n r: null,\n radius: null,\n referrerPolicy: null,\n refX: null,\n refY: null,\n rel: commaOrSpaceSeparated,\n rev: commaOrSpaceSeparated,\n renderingIntent: null,\n repeatCount: null,\n repeatDur: null,\n requiredExtensions: commaOrSpaceSeparated,\n requiredFeatures: commaOrSpaceSeparated,\n requiredFonts: commaOrSpaceSeparated,\n requiredFormats: commaOrSpaceSeparated,\n resource: null,\n restart: null,\n result: null,\n rotate: null,\n rx: null,\n ry: null,\n scale: null,\n seed: null,\n shapeRendering: null,\n side: null,\n slope: null,\n snapshotTime: null,\n specularConstant: number,\n specularExponent: number,\n spreadMethod: null,\n spacing: null,\n startOffset: null,\n stdDeviation: null,\n stemh: null,\n stemv: null,\n stitchTiles: null,\n stopColor: null,\n stopOpacity: null,\n strikethroughPosition: number,\n strikethroughThickness: number,\n string: null,\n stroke: null,\n strokeDashArray: commaOrSpaceSeparated,\n strokeDashOffset: null,\n strokeLineCap: null,\n strokeLineJoin: null,\n strokeMiterLimit: number,\n strokeOpacity: number,\n strokeWidth: null,\n style: null,\n surfaceScale: number,\n syncBehavior: null,\n syncBehaviorDefault: null,\n syncMaster: null,\n syncTolerance: null,\n syncToleranceDefault: null,\n systemLanguage: commaOrSpaceSeparated,\n tabIndex: number,\n tableValues: null,\n target: null,\n targetX: number,\n targetY: number,\n textAnchor: null,\n textDecoration: null,\n textRendering: null,\n textLength: null,\n timelineBegin: null,\n title: null,\n transformBehavior: null,\n type: null,\n typeOf: commaOrSpaceSeparated,\n to: null,\n transform: null,\n transformOrigin: null,\n u1: null,\n u2: null,\n underlinePosition: number,\n underlineThickness: number,\n unicode: null,\n unicodeBidi: null,\n unicodeRange: null,\n unitsPerEm: number,\n values: null,\n vAlphabetic: number,\n vMathematical: number,\n vectorEffect: null,\n vHanging: number,\n vIdeographic: number,\n version: null,\n vertAdvY: number,\n vertOriginX: number,\n vertOriginY: number,\n viewBox: null,\n viewTarget: null,\n visibility: null,\n width: null,\n widths: null,\n wordSpacing: null,\n writingMode: null,\n x: null,\n x1: null,\n x2: null,\n xChannelSelector: null,\n xHeight: number,\n y: null,\n y1: null,\n y2: null,\n yChannelSelector: null,\n z: null,\n zoomAndPan: null\n },\n space: 'svg',\n transform: caseSensitiveTransform\n})\n", "import {create} from './util/create.js'\n\nexport const xlink = create({\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n },\n space: 'xlink',\n transform(_, property) {\n return 'xlink:' + property.slice(5).toLowerCase()\n }\n})\n", "import {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const xmlns = create({\n attributes: {xmlnsxlink: 'xmlns:xlink'},\n properties: {xmlnsXLink: null, xmlns: null},\n space: 'xmlns',\n transform: caseInsensitiveTransform\n})\n", "import {create} from './util/create.js'\n\nexport const xml = create({\n properties: {xmlBase: null, xmlLang: null, xmlSpace: null},\n space: 'xml',\n transform(_, property) {\n return 'xml:' + property.slice(3).toLowerCase()\n }\n})\n", "/**\n * @import {Schema} from 'property-information'\n */\n\nimport {DefinedInfo} from './util/defined-info.js'\nimport {Info} from './util/info.js'\nimport {normalize} from './normalize.js'\n\nconst cap = /[A-Z]/g\nconst dash = /-[a-z]/g\nconst valid = /^data[-\\w.:]+$/i\n\n/**\n * Look up info on a property.\n *\n * In most cases the given `schema` contains info on the property.\n * All standard,\n * most legacy,\n * and some non-standard properties are supported.\n * For these cases,\n * the returned `Info` has hints about the value of the property.\n *\n * `name` can also be a valid data attribute or property,\n * in which case an `Info` object with the correctly cased `attribute` and\n * `property` is returned.\n *\n * `name` can be an unknown attribute,\n * in which case an `Info` object with `attribute` and `property` set to the\n * given name is returned.\n * It is not recommended to provide unsupported legacy or recently specced\n * properties.\n *\n *\n * @param {Schema} schema\n * Schema;\n * either the `html` or `svg` export.\n * @param {string} value\n * An attribute-like or property-like name;\n * it will be passed through `normalize` to hopefully find the correct info.\n * @returns {Info}\n * Info.\n */\nexport function find(schema, value) {\n const normal = normalize(value)\n let property = value\n let Type = Info\n\n if (normal in schema.normal) {\n return schema.property[schema.normal[normal]]\n }\n\n if (normal.length > 4 && normal.slice(0, 4) === 'data' && valid.test(value)) {\n // Attribute or property.\n if (value.charAt(4) === '-') {\n // Turn it into a property.\n const rest = value.slice(5).replace(dash, camelcase)\n property = 'data' + rest.charAt(0).toUpperCase() + rest.slice(1)\n } else {\n // Turn it into an attribute.\n const rest = value.slice(4)\n\n if (!dash.test(rest)) {\n let dashes = rest.replace(cap, kebab)\n\n if (dashes.charAt(0) !== '-') {\n dashes = '-' + dashes\n }\n\n value = 'data' + dashes\n }\n }\n\n Type = DefinedInfo\n }\n\n return new Type(property, value)\n}\n\n/**\n * @param {string} $0\n * Value.\n * @returns {string}\n * Kebab.\n */\nfunction kebab($0) {\n return '-' + $0.toLowerCase()\n}\n\n/**\n * @param {string} $0\n * Value.\n * @returns {string}\n * Camel.\n */\nfunction camelcase($0) {\n return $0.charAt(1).toUpperCase()\n}\n", "// Note: types exposed from `index.d.ts`.\nimport {merge} from './lib/util/merge.js'\nimport {aria} from './lib/aria.js'\nimport {html as htmlBase} from './lib/html.js'\nimport {svg as svgBase} from './lib/svg.js'\nimport {xlink} from './lib/xlink.js'\nimport {xmlns} from './lib/xmlns.js'\nimport {xml} from './lib/xml.js'\n\nexport {hastToReact} from './lib/hast-to-react.js'\n\nexport const html = merge([aria, htmlBase, xlink, xmlns, xml], 'html')\n\nexport {find} from './lib/find.js'\nexport {normalize} from './lib/normalize.js'\n\nexport const svg = merge([aria, svgBase, xlink, xmlns, xml], 'svg')\n", "/**\n * @callback Handler\n * Handle a value, with a certain ID field set to a certain value.\n * The ID field is passed to `zwitch`, and it\u2019s value is this function\u2019s\n * place on the `handlers` record.\n * @param {...any} parameters\n * Arbitrary parameters passed to the zwitch.\n * The first will be an object with a certain ID field set to a certain value.\n * @returns {any}\n * Anything!\n */\n\n/**\n * @callback UnknownHandler\n * Handle values that do have a certain ID field, but it\u2019s set to a value\n * that is not listed in the `handlers` record.\n * @param {unknown} value\n * An object with a certain ID field set to an unknown value.\n * @param {...any} rest\n * Arbitrary parameters passed to the zwitch.\n * @returns {any}\n * Anything!\n */\n\n/**\n * @callback InvalidHandler\n * Handle values that do not have a certain ID field.\n * @param {unknown} value\n * Any unknown value.\n * @param {...any} rest\n * Arbitrary parameters passed to the zwitch.\n * @returns {void|null|undefined|never}\n * This should crash or return nothing.\n */\n\n/**\n * @template {InvalidHandler} [Invalid=InvalidHandler]\n * @template {UnknownHandler} [Unknown=UnknownHandler]\n * @template {Record<string, Handler>} [Handlers=Record<string, Handler>]\n * @typedef Options\n * Configuration (required).\n * @property {Invalid} [invalid]\n * Handler to use for invalid values.\n * @property {Unknown} [unknown]\n * Handler to use for unknown values.\n * @property {Handlers} [handlers]\n * Handlers to use.\n */\n\nconst own = {}.hasOwnProperty\n\n/**\n * Handle values based on a field.\n *\n * @template {InvalidHandler} [Invalid=InvalidHandler]\n * @template {UnknownHandler} [Unknown=UnknownHandler]\n * @template {Record<string, Handler>} [Handlers=Record<string, Handler>]\n * @param {string} key\n * Field to switch on.\n * @param {Options<Invalid, Unknown, Handlers>} [options]\n * Configuration (required).\n * @returns {{unknown: Unknown, invalid: Invalid, handlers: Handlers, (...parameters: Parameters<Handlers[keyof Handlers]>): ReturnType<Handlers[keyof Handlers]>, (...parameters: Parameters<Unknown>): ReturnType<Unknown>}}\n */\nexport function zwitch(key, options) {\n const settings = options || {}\n\n /**\n * Handle one value.\n *\n * Based on the bound `key`, a respective handler will be called.\n * If `value` is not an object, or doesn\u2019t have a `key` property, the special\n * \u201Cinvalid\u201D handler will be called.\n * If `value` has an unknown `key`, the special \u201Cunknown\u201D handler will be\n * called.\n *\n * All arguments, and the context object, are passed through to the handler,\n * and it\u2019s result is returned.\n *\n * @this {unknown}\n * Any context object.\n * @param {unknown} [value]\n * Any value.\n * @param {...unknown} parameters\n * Arbitrary parameters passed to the zwitch.\n * @property {Handler} invalid\n * Handle for values that do not have a certain ID field.\n * @property {Handler} unknown\n * Handle values that do have a certain ID field, but it\u2019s set to a value\n * that is not listed in the `handlers` record.\n * @property {Handlers} handlers\n * Record of handlers.\n * @returns {unknown}\n * Anything.\n */\n function one(value, ...parameters) {\n /** @type {Handler|undefined} */\n let fn = one.invalid\n const handlers = one.handlers\n\n if (value && own.call(value, key)) {\n // @ts-expect-error Indexable.\n const id = String(value[key])\n // @ts-expect-error Indexable.\n fn = own.call(handlers, id) ? handlers[id] : one.unknown\n }\n\n if (fn) {\n return fn.call(this, value, ...parameters)\n }\n }\n\n one.handlers = settings.handlers || {}\n one.invalid = settings.invalid\n one.unknown = settings.unknown\n\n // @ts-expect-error: matches!\n return one\n}\n", "/**\n * @typedef CoreOptions\n * @property {ReadonlyArray<string>} [subset=[]]\n * Whether to only escape the given subset of characters.\n * @property {boolean} [escapeOnly=false]\n * Whether to only escape possibly dangerous characters.\n * Those characters are `\"`, `&`, `'`, `<`, `>`, and `` ` ``.\n *\n * @typedef FormatOptions\n * @property {(code: number, next: number, options: CoreWithFormatOptions) => string} format\n * Format strategy.\n *\n * @typedef {CoreOptions & FormatOptions & import('./util/format-smart.js').FormatSmartOptions} CoreWithFormatOptions\n */\n\nconst defaultSubsetRegex = /[\"&'<>`]/g\nconst surrogatePairsRegex = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g\nconst controlCharactersRegex =\n // eslint-disable-next-line no-control-regex, unicorn/no-hex-escape\n /[\\x01-\\t\\v\\f\\x0E-\\x1F\\x7F\\x81\\x8D\\x8F\\x90\\x9D\\xA0-\\uFFFF]/g\nconst regexEscapeRegex = /[|\\\\{}()[\\]^$+*?.]/g\n\n/** @type {WeakMap<ReadonlyArray<string>, RegExp>} */\nconst subsetToRegexCache = new WeakMap()\n\n/**\n * Encode certain characters in `value`.\n *\n * @param {string} value\n * @param {CoreWithFormatOptions} options\n * @returns {string}\n */\nexport function core(value, options) {\n value = value.replace(\n options.subset\n ? charactersToExpressionCached(options.subset)\n : defaultSubsetRegex,\n basic\n )\n\n if (options.subset || options.escapeOnly) {\n return value\n }\n\n return (\n value\n // Surrogate pairs.\n .replace(surrogatePairsRegex, surrogate)\n // BMP control characters (C0 except for LF, CR, SP; DEL; and some more\n // non-ASCII ones).\n .replace(controlCharactersRegex, basic)\n )\n\n /**\n * @param {string} pair\n * @param {number} index\n * @param {string} all\n */\n function surrogate(pair, index, all) {\n return options.format(\n (pair.charCodeAt(0) - 0xd800) * 0x400 +\n pair.charCodeAt(1) -\n 0xdc00 +\n 0x10000,\n all.charCodeAt(index + 2),\n options\n )\n }\n\n /**\n * @param {string} character\n * @param {number} index\n * @param {string} all\n */\n function basic(character, index, all) {\n return options.format(\n character.charCodeAt(0),\n all.charCodeAt(index + 1),\n options\n )\n }\n}\n\n/**\n * A wrapper function that caches the result of `charactersToExpression` with a WeakMap.\n * This can improve performance when tooling calls `charactersToExpression` repeatedly\n * with the same subset.\n *\n * @param {ReadonlyArray<string>} subset\n * @returns {RegExp}\n */\nfunction charactersToExpressionCached(subset) {\n let cached = subsetToRegexCache.get(subset)\n\n if (!cached) {\n cached = charactersToExpression(subset)\n subsetToRegexCache.set(subset, cached)\n }\n\n return cached\n}\n\n/**\n * @param {ReadonlyArray<string>} subset\n * @returns {RegExp}\n */\nfunction charactersToExpression(subset) {\n /** @type {Array<string>} */\n const groups = []\n let index = -1\n\n while (++index < subset.length) {\n groups.push(subset[index].replace(regexEscapeRegex, '\\\\$&'))\n }\n\n return new RegExp('(?:' + groups.join('|') + ')', 'g')\n}\n", "const hexadecimalRegex = /[\\dA-Fa-f]/\n\n/**\n * Configurable ways to encode characters as hexadecimal references.\n *\n * @param {number} code\n * @param {number} next\n * @param {boolean|undefined} omit\n * @returns {string}\n */\nexport function toHexadecimal(code, next, omit) {\n const value = '&#x' + code.toString(16).toUpperCase()\n return omit && next && !hexadecimalRegex.test(String.fromCharCode(next))\n ? value\n : value + ';'\n}\n", "const decimalRegex = /\\d/\n\n/**\n * Configurable ways to encode characters as decimal references.\n *\n * @param {number} code\n * @param {number} next\n * @param {boolean|undefined} omit\n * @returns {string}\n */\nexport function toDecimal(code, next, omit) {\n const value = '&#' + String(code)\n return omit && next && !decimalRegex.test(String.fromCharCode(next))\n ? value\n : value + ';'\n}\n", "/**\n * List of legacy HTML named character references that don\u2019t need a trailing semicolon.\n *\n * @type {Array<string>}\n */\nexport const characterEntitiesLegacy = [\n 'AElig',\n 'AMP',\n 'Aacute',\n 'Acirc',\n 'Agrave',\n 'Aring',\n 'Atilde',\n 'Auml',\n 'COPY',\n 'Ccedil',\n 'ETH',\n 'Eacute',\n 'Ecirc',\n 'Egrave',\n 'Euml',\n 'GT',\n 'Iacute',\n 'Icirc',\n 'Igrave',\n 'Iuml',\n 'LT',\n 'Ntilde',\n 'Oacute',\n 'Ocirc',\n 'Ograve',\n 'Oslash',\n 'Otilde',\n 'Ouml',\n 'QUOT',\n 'REG',\n 'THORN',\n 'Uacute',\n 'Ucirc',\n 'Ugrave',\n 'Uuml',\n 'Yacute',\n 'aacute',\n 'acirc',\n 'acute',\n 'aelig',\n 'agrave',\n 'amp',\n 'aring',\n 'atilde',\n 'auml',\n 'brvbar',\n 'ccedil',\n 'cedil',\n 'cent',\n 'copy',\n 'curren',\n 'deg',\n 'divide',\n 'eacute',\n 'ecirc',\n 'egrave',\n 'eth',\n 'euml',\n 'frac12',\n 'frac14',\n 'frac34',\n 'gt',\n 'iacute',\n 'icirc',\n 'iexcl',\n 'igrave',\n 'iquest',\n 'iuml',\n 'laquo',\n 'lt',\n 'macr',\n 'micro',\n 'middot',\n 'nbsp',\n 'not',\n 'ntilde',\n 'oacute',\n 'ocirc',\n 'ograve',\n 'ordf',\n 'ordm',\n 'oslash',\n 'otilde',\n 'ouml',\n 'para',\n 'plusmn',\n 'pound',\n 'quot',\n 'raquo',\n 'reg',\n 'sect',\n 'shy',\n 'sup1',\n 'sup2',\n 'sup3',\n 'szlig',\n 'thorn',\n 'times',\n 'uacute',\n 'ucirc',\n 'ugrave',\n 'uml',\n 'uuml',\n 'yacute',\n 'yen',\n 'yuml'\n]\n", "/**\n * Map of named character references from HTML 4.\n *\n * @type {Record<string, string>}\n */\nexport const characterEntitiesHtml4 = {\n nbsp: '\u00A0',\n iexcl: '\u00A1',\n cent: '\u00A2',\n pound: '\u00A3',\n curren: '\u00A4',\n yen: '\u00A5',\n brvbar: '\u00A6',\n sect: '\u00A7',\n uml: '\u00A8',\n copy: '\u00A9',\n ordf: '\u00AA',\n laquo: '\u00AB',\n not: '\u00AC',\n shy: '\u00AD',\n reg: '\u00AE',\n macr: '\u00AF',\n deg: '\u00B0',\n plusmn: '\u00B1',\n sup2: '\u00B2',\n sup3: '\u00B3',\n acute: '\u00B4',\n micro: '\u00B5',\n para: '\u00B6',\n middot: '\u00B7',\n cedil: '\u00B8',\n sup1: '\u00B9',\n ordm: '\u00BA',\n raquo: '\u00BB',\n frac14: '\u00BC',\n frac12: '\u00BD',\n frac34: '\u00BE',\n iquest: '\u00BF',\n Agrave: '\u00C0',\n Aacute: '\u00C1',\n Acirc: '\u00C2',\n Atilde: '\u00C3',\n Auml: '\u00C4',\n Aring: '\u00C5',\n AElig: '\u00C6',\n Ccedil: '\u00C7',\n Egrave: '\u00C8',\n Eacute: '\u00C9',\n Ecirc: '\u00CA',\n Euml: '\u00CB',\n Igrave: '\u00CC',\n Iacute: '\u00CD',\n Icirc: '\u00CE',\n Iuml: '\u00CF',\n ETH: '\u00D0',\n Ntilde: '\u00D1',\n Ograve: '\u00D2',\n Oacute: '\u00D3',\n Ocirc: '\u00D4',\n Otilde: '\u00D5',\n Ouml: '\u00D6',\n times: '\u00D7',\n Oslash: '\u00D8',\n Ugrave: '\u00D9',\n Uacute: '\u00DA',\n Ucirc: '\u00DB',\n Uuml: '\u00DC',\n Yacute: '\u00DD',\n THORN: '\u00DE',\n szlig: '\u00DF',\n agrave: '\u00E0',\n aacute: '\u00E1',\n acirc: '\u00E2',\n atilde: '\u00E3',\n auml: '\u00E4',\n aring: '\u00E5',\n aelig: '\u00E6',\n ccedil: '\u00E7',\n egrave: '\u00E8',\n eacute: '\u00E9',\n ecirc: '\u00EA',\n euml: '\u00EB',\n igrave: '\u00EC',\n iacute: '\u00ED',\n icirc: '\u00EE',\n iuml: '\u00EF',\n eth: '\u00F0',\n ntilde: '\u00F1',\n ograve: '\u00F2',\n oacute: '\u00F3',\n ocirc: '\u00F4',\n otilde: '\u00F5',\n ouml: '\u00F6',\n divide: '\u00F7',\n oslash: '\u00F8',\n ugrave: '\u00F9',\n uacute: '\u00FA',\n ucirc: '\u00FB',\n uuml: '\u00FC',\n yacute: '\u00FD',\n thorn: '\u00FE',\n yuml: '\u00FF',\n fnof: '\u0192',\n Alpha: '\u0391',\n Beta: '\u0392',\n Gamma: '\u0393',\n Delta: '\u0394',\n Epsilon: '\u0395',\n Zeta: '\u0396',\n Eta: '\u0397',\n Theta: '\u0398',\n Iota: '\u0399',\n Kappa: '\u039A',\n Lambda: '\u039B',\n Mu: '\u039C',\n Nu: '\u039D',\n Xi: '\u039E',\n Omicron: '\u039F',\n Pi: '\u03A0',\n Rho: '\u03A1',\n Sigma: '\u03A3',\n Tau: '\u03A4',\n Upsilon: '\u03A5',\n Phi: '\u03A6',\n Chi: '\u03A7',\n Psi: '\u03A8',\n Omega: '\u03A9',\n alpha: '\u03B1',\n beta: '\u03B2',\n gamma: '\u03B3',\n delta: '\u03B4',\n epsilon: '\u03B5',\n zeta: '\u03B6',\n eta: '\u03B7',\n theta: '\u03B8',\n iota: '\u03B9',\n kappa: '\u03BA',\n lambda: '\u03BB',\n mu: '\u03BC',\n nu: '\u03BD',\n xi: '\u03BE',\n omicron: '\u03BF',\n pi: '\u03C0',\n rho: '\u03C1',\n sigmaf: '\u03C2',\n sigma: '\u03C3',\n tau: '\u03C4',\n upsilon: '\u03C5',\n phi: '\u03C6',\n chi: '\u03C7',\n psi: '\u03C8',\n omega: '\u03C9',\n thetasym: '\u03D1',\n upsih: '\u03D2',\n piv: '\u03D6',\n bull: '\u2022',\n hellip: '\u2026',\n prime: '\u2032',\n Prime: '\u2033',\n oline: '\u203E',\n frasl: '\u2044',\n weierp: '\u2118',\n image: '\u2111',\n real: '\u211C',\n trade: '\u2122',\n alefsym: '\u2135',\n larr: '\u2190',\n uarr: '\u2191',\n rarr: '\u2192',\n darr: '\u2193',\n harr: '\u2194',\n crarr: '\u21B5',\n lArr: '\u21D0',\n uArr: '\u21D1',\n rArr: '\u21D2',\n dArr: '\u21D3',\n hArr: '\u21D4',\n forall: '\u2200',\n part: '\u2202',\n exist: '\u2203',\n empty: '\u2205',\n nabla: '\u2207',\n isin: '\u2208',\n notin: '\u2209',\n ni: '\u220B',\n prod: '\u220F',\n sum: '\u2211',\n minus: '\u2212',\n lowast: '\u2217',\n radic: '\u221A',\n prop: '\u221D',\n infin: '\u221E',\n ang: '\u2220',\n and: '\u2227',\n or: '\u2228',\n cap: '\u2229',\n cup: '\u222A',\n int: '\u222B',\n there4: '\u2234',\n sim: '\u223C',\n cong: '\u2245',\n asymp: '\u2248',\n ne: '\u2260',\n equiv: '\u2261',\n le: '\u2264',\n ge: '\u2265',\n sub: '\u2282',\n sup: '\u2283',\n nsub: '\u2284',\n sube: '\u2286',\n supe: '\u2287',\n oplus: '\u2295',\n otimes: '\u2297',\n perp: '\u22A5',\n sdot: '\u22C5',\n lceil: '\u2308',\n rceil: '\u2309',\n lfloor: '\u230A',\n rfloor: '\u230B',\n lang: '\u2329',\n rang: '\u232A',\n loz: '\u25CA',\n spades: '\u2660',\n clubs: '\u2663',\n hearts: '\u2665',\n diams: '\u2666',\n quot: '\"',\n amp: '&',\n lt: '<',\n gt: '>',\n OElig: '\u0152',\n oelig: '\u0153',\n Scaron: '\u0160',\n scaron: '\u0161',\n Yuml: '\u0178',\n circ: '\u02C6',\n tilde: '\u02DC',\n ensp: '\u2002',\n emsp: '\u2003',\n thinsp: '\u2009',\n zwnj: '\u200C',\n zwj: '\u200D',\n lrm: '\u200E',\n rlm: '\u200F',\n ndash: '\u2013',\n mdash: '\u2014',\n lsquo: '\u2018',\n rsquo: '\u2019',\n sbquo: '\u201A',\n ldquo: '\u201C',\n rdquo: '\u201D',\n bdquo: '\u201E',\n dagger: '\u2020',\n Dagger: '\u2021',\n permil: '\u2030',\n lsaquo: '\u2039',\n rsaquo: '\u203A',\n euro: '\u20AC'\n}\n", "/**\n * List of legacy (that don\u2019t need a trailing `;`) named references which could,\n * depending on what follows them, turn into a different meaning\n *\n * @type {Array<string>}\n */\nexport const dangerous = [\n 'cent',\n 'copy',\n 'divide',\n 'gt',\n 'lt',\n 'not',\n 'para',\n 'times'\n]\n", "import {characterEntitiesLegacy} from 'character-entities-legacy'\nimport {characterEntitiesHtml4} from 'character-entities-html4'\nimport {dangerous} from '../constant/dangerous.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * `characterEntitiesHtml4` but inverted.\n *\n * @type {Record<string, string>}\n */\nconst characters = {}\n\n/** @type {string} */\nlet key\n\nfor (key in characterEntitiesHtml4) {\n if (own.call(characterEntitiesHtml4, key)) {\n characters[characterEntitiesHtml4[key]] = key\n }\n}\n\nconst notAlphanumericRegex = /[^\\dA-Za-z]/\n\n/**\n * Configurable ways to encode characters as named references.\n *\n * @param {number} code\n * @param {number} next\n * @param {boolean|undefined} omit\n * @param {boolean|undefined} attribute\n * @returns {string}\n */\nexport function toNamed(code, next, omit, attribute) {\n const character = String.fromCharCode(code)\n\n if (own.call(characters, character)) {\n const name = characters[character]\n const value = '&' + name\n\n if (\n omit &&\n characterEntitiesLegacy.includes(name) &&\n !dangerous.includes(name) &&\n (!attribute ||\n (next &&\n next !== 61 /* `=` */ &&\n notAlphanumericRegex.test(String.fromCharCode(next))))\n ) {\n return value\n }\n\n return value + ';'\n }\n\n return ''\n}\n", "/**\n * @typedef FormatSmartOptions\n * @property {boolean} [useNamedReferences=false]\n * Prefer named character references (`&amp;`) where possible.\n * @property {boolean} [useShortestReferences=false]\n * Prefer the shortest possible reference, if that results in less bytes.\n * **Note**: `useNamedReferences` can be omitted when using `useShortestReferences`.\n * @property {boolean} [omitOptionalSemicolons=false]\n * Whether to omit semicolons when possible.\n * **Note**: This creates what HTML calls \u201Cparse errors\u201D but is otherwise still valid HTML \u2014 don\u2019t use this except when building a minifier.\n * Omitting semicolons is possible for certain named and numeric references in some cases.\n * @property {boolean} [attribute=false]\n * Create character references which don\u2019t fail in attributes.\n * **Note**: `attribute` only applies when operating dangerously with\n * `omitOptionalSemicolons: true`.\n */\n\nimport {toHexadecimal} from './to-hexadecimal.js'\nimport {toDecimal} from './to-decimal.js'\nimport {toNamed} from './to-named.js'\n\n/**\n * Configurable ways to encode a character yielding pretty or small results.\n *\n * @param {number} code\n * @param {number} next\n * @param {FormatSmartOptions} options\n * @returns {string}\n */\nexport function formatSmart(code, next, options) {\n let numeric = toHexadecimal(code, next, options.omitOptionalSemicolons)\n /** @type {string|undefined} */\n let named\n\n if (options.useNamedReferences || options.useShortestReferences) {\n named = toNamed(\n code,\n next,\n options.omitOptionalSemicolons,\n options.attribute\n )\n }\n\n // Use the shortest numeric reference when requested.\n // A simple algorithm would use decimal for all code points under 100, as\n // those are shorter than hexadecimal:\n //\n // * `&#99;` vs `&#x63;` (decimal shorter)\n // * `&#100;` vs `&#x64;` (equal)\n //\n // However, because we take `next` into consideration when `omit` is used,\n // And it would be possible that decimals are shorter on bigger values as\n // well if `next` is hexadecimal but not decimal, we instead compare both.\n if (\n (options.useShortestReferences || !named) &&\n options.useShortestReferences\n ) {\n const decimal = toDecimal(code, next, options.omitOptionalSemicolons)\n\n if (decimal.length < numeric.length) {\n numeric = decimal\n }\n }\n\n return named &&\n (!options.useShortestReferences || named.length < numeric.length)\n ? named\n : numeric\n}\n", "/**\n * @typedef {import('./core.js').CoreOptions & import('./util/format-smart.js').FormatSmartOptions} Options\n * @typedef {import('./core.js').CoreOptions} LightOptions\n */\n\nimport {core} from './core.js'\nimport {formatSmart} from './util/format-smart.js'\nimport {formatBasic} from './util/format-basic.js'\n\n/**\n * Encode special characters in `value`.\n *\n * @param {string} value\n * Value to encode.\n * @param {Options} [options]\n * Configuration.\n * @returns {string}\n * Encoded value.\n */\nexport function stringifyEntities(value, options) {\n return core(value, Object.assign({format: formatSmart}, options))\n}\n\n/**\n * Encode special characters in `value` as hexadecimals.\n *\n * @param {string} value\n * Value to encode.\n * @param {LightOptions} [options]\n * Configuration.\n * @returns {string}\n * Encoded value.\n */\nexport function stringifyEntitiesLight(value, options) {\n return core(value, Object.assign({format: formatBasic}, options))\n}\n", "/**\n * @import {Comment, Parents} from 'hast'\n * @import {State} from '../index.js'\n */\n\nimport {stringifyEntities} from 'stringify-entities'\n\nconst htmlCommentRegex = /^>|^->|<!--|-->|--!>|<!-$/g\n\n// Declare arrays as variables so it can be cached by `stringifyEntities`\nconst bogusCommentEntitySubset = ['>']\nconst commentEntitySubset = ['<', '>']\n\n/**\n * Serialize a comment.\n *\n * @param {Comment} node\n * Node to handle.\n * @param {number | undefined} _1\n * Index of `node` in `parent.\n * @param {Parents | undefined} _2\n * Parent of `node`.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {string}\n * Serialized node.\n */\nexport function comment(node, _1, _2, state) {\n // See: <https://html.spec.whatwg.org/multipage/syntax.html#comments>\n return state.settings.bogusComments\n ? '<?' +\n stringifyEntities(\n node.value,\n Object.assign({}, state.settings.characterReferences, {\n subset: bogusCommentEntitySubset\n })\n ) +\n '>'\n : '<!--' + node.value.replace(htmlCommentRegex, encode) + '-->'\n\n /**\n * @param {string} $0\n */\n function encode($0) {\n return stringifyEntities(\n $0,\n Object.assign({}, state.settings.characterReferences, {\n subset: commentEntitySubset\n })\n )\n }\n}\n", "/**\n * @import {Doctype, Parents} from 'hast'\n * @import {State} from '../index.js'\n */\n\n/**\n * Serialize a doctype.\n *\n * @param {Doctype} _1\n * Node to handle.\n * @param {number | undefined} _2\n * Index of `node` in `parent.\n * @param {Parents | undefined} _3\n * Parent of `node`.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {string}\n * Serialized node.\n */\nexport function doctype(_1, _2, _3, state) {\n return (\n '<!' +\n (state.settings.upperDoctype ? 'DOCTYPE' : 'doctype') +\n (state.settings.tightDoctype ? '' : ' ') +\n 'html>'\n )\n}\n", "/**\n * Count how often a character (or substring) is used in a string.\n *\n * @param {string} value\n * Value to search in.\n * @param {string} character\n * Character (or substring) to look for.\n * @return {number}\n * Number of times `character` occurred in `value`.\n */\nexport function ccount(value, character) {\n const source = String(value)\n\n if (typeof character !== 'string') {\n throw new TypeError('Expected character')\n }\n\n let count = 0\n let index = source.indexOf(character)\n\n while (index !== -1) {\n count++\n index = source.indexOf(character, index + character.length)\n }\n\n return count\n}\n", "/**\n * @typedef Options\n * Configuration for `stringify`.\n * @property {boolean} [padLeft=true]\n * Whether to pad a space before a token.\n * @property {boolean} [padRight=false]\n * Whether to pad a space after a token.\n */\n\n/**\n * @typedef {Options} StringifyOptions\n * Please use `StringifyOptions` instead.\n */\n\n/**\n * Parse comma-separated tokens to an array.\n *\n * @param {string} value\n * Comma-separated tokens.\n * @returns {Array<string>}\n * List of tokens.\n */\nexport function parse(value) {\n /** @type {Array<string>} */\n const tokens = []\n const input = String(value || '')\n let index = input.indexOf(',')\n let start = 0\n /** @type {boolean} */\n let end = false\n\n while (!end) {\n if (index === -1) {\n index = input.length\n end = true\n }\n\n const token = input.slice(start, index).trim()\n\n if (token || !end) {\n tokens.push(token)\n }\n\n start = index + 1\n index = input.indexOf(',', start)\n }\n\n return tokens\n}\n\n/**\n * Serialize an array of strings or numbers to comma-separated tokens.\n *\n * @param {Array<string|number>} values\n * List of tokens.\n * @param {Options} [options]\n * Configuration for `stringify` (optional).\n * @returns {string}\n * Comma-separated tokens.\n */\nexport function stringify(values, options) {\n const settings = options || {}\n\n // Ensure the last empty entry is seen.\n const input = values[values.length - 1] === '' ? [...values, ''] : values\n\n return input\n .join(\n (settings.padRight ? ' ' : '') +\n ',' +\n (settings.padLeft === false ? '' : ' ')\n )\n .trim()\n}\n", "/**\n * Parse space-separated tokens to an array of strings.\n *\n * @param {string} value\n * Space-separated tokens.\n * @returns {Array<string>}\n * List of tokens.\n */\nexport function parse(value) {\n const input = String(value || '').trim()\n return input ? input.split(/[ \\t\\n\\r\\f]+/g) : []\n}\n\n/**\n * Serialize an array of strings as space separated-tokens.\n *\n * @param {Array<string|number>} values\n * List of tokens.\n * @returns {string}\n * Space-separated tokens.\n */\nexport function stringify(values) {\n return values.join(' ').trim()\n}\n", "/**\n * @typedef {import('hast').Nodes} Nodes\n */\n\n// HTML whitespace expression.\n// See <https://infra.spec.whatwg.org/#ascii-whitespace>.\nconst re = /[ \\t\\n\\f\\r]/g\n\n/**\n * Check if the given value is *inter-element whitespace*.\n *\n * @param {Nodes | string} thing\n * Thing to check (`Node` or `string`).\n * @returns {boolean}\n * Whether the `value` is inter-element whitespace (`boolean`): consisting of\n * zero or more of space, tab (`\\t`), line feed (`\\n`), carriage return\n * (`\\r`), or form feed (`\\f`); if a node is passed it must be a `Text` node,\n * whose `value` field is checked.\n */\nexport function whitespace(thing) {\n return typeof thing === 'object'\n ? thing.type === 'text'\n ? empty(thing.value)\n : false\n : empty(thing)\n}\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction empty(value) {\n return value.replace(re, '') === ''\n}\n", "/**\n * @import {Parents, RootContent} from 'hast'\n */\n\nimport {whitespace} from 'hast-util-whitespace'\n\nexport const siblingAfter = siblings(1)\nexport const siblingBefore = siblings(-1)\n\n/** @type {Array<RootContent>} */\nconst emptyChildren = []\n\n/**\n * Factory to check siblings in a direction.\n *\n * @param {number} increment\n */\nfunction siblings(increment) {\n return sibling\n\n /**\n * Find applicable siblings in a direction.\n *\n * @template {Parents} Parent\n * Parent type.\n * @param {Parent | undefined} parent\n * Parent.\n * @param {number | undefined} index\n * Index of child in `parent`.\n * @param {boolean | undefined} [includeWhitespace=false]\n * Whether to include whitespace (default: `false`).\n * @returns {Parent extends {children: Array<infer Child>} ? Child | undefined : never}\n * Child of parent.\n */\n function sibling(parent, index, includeWhitespace) {\n const siblings = parent ? parent.children : emptyChildren\n let offset = (index || 0) + increment\n let next = siblings[offset]\n\n if (!includeWhitespace) {\n while (next && whitespace(next)) {\n offset += increment\n next = siblings[offset]\n }\n }\n\n // @ts-expect-error: it\u2019s a correct child.\n return next\n }\n}\n", "/**\n * @import {Element, Parents} from 'hast'\n */\n\n/**\n * @callback OmitHandle\n * Check if a tag can be omitted.\n * @param {Element} element\n * Element to check.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether to omit a tag.\n *\n */\n\nconst own = {}.hasOwnProperty\n\n/**\n * Factory to check if a given node can have a tag omitted.\n *\n * @param {Record<string, OmitHandle>} handlers\n * Omission handlers, where each key is a tag name, and each value is the\n * corresponding handler.\n * @returns {OmitHandle}\n * Whether to omit a tag of an element.\n */\nexport function omission(handlers) {\n return omit\n\n /**\n * Check if a given node can have a tag omitted.\n *\n * @type {OmitHandle}\n */\n function omit(node, index, parent) {\n return (\n own.call(handlers, node.tagName) &&\n handlers[node.tagName](node, index, parent)\n )\n }\n}\n", "/**\n * @import {Element, Parents} from 'hast'\n */\n\nimport {whitespace} from 'hast-util-whitespace'\nimport {siblingAfter} from './util/siblings.js'\nimport {omission} from './omission.js'\n\nexport const closing = omission({\n body,\n caption: headOrColgroupOrCaption,\n colgroup: headOrColgroupOrCaption,\n dd,\n dt,\n head: headOrColgroupOrCaption,\n html,\n li,\n optgroup,\n option,\n p,\n rp: rubyElement,\n rt: rubyElement,\n tbody,\n td: cells,\n tfoot,\n th: cells,\n thead,\n tr\n})\n\n/**\n * Macro for `</head>`, `</colgroup>`, and `</caption>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction headOrColgroupOrCaption(_, index, parent) {\n const next = siblingAfter(parent, index, true)\n return (\n !next ||\n (next.type !== 'comment' &&\n !(next.type === 'text' && whitespace(next.value.charAt(0))))\n )\n}\n\n/**\n * Whether to omit `</html>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction html(_, index, parent) {\n const next = siblingAfter(parent, index)\n return !next || next.type !== 'comment'\n}\n\n/**\n * Whether to omit `</body>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction body(_, index, parent) {\n const next = siblingAfter(parent, index)\n return !next || next.type !== 'comment'\n}\n\n/**\n * Whether to omit `</p>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction p(_, index, parent) {\n const next = siblingAfter(parent, index)\n return next\n ? next.type === 'element' &&\n (next.tagName === 'address' ||\n next.tagName === 'article' ||\n next.tagName === 'aside' ||\n next.tagName === 'blockquote' ||\n next.tagName === 'details' ||\n next.tagName === 'div' ||\n next.tagName === 'dl' ||\n next.tagName === 'fieldset' ||\n next.tagName === 'figcaption' ||\n next.tagName === 'figure' ||\n next.tagName === 'footer' ||\n next.tagName === 'form' ||\n next.tagName === 'h1' ||\n next.tagName === 'h2' ||\n next.tagName === 'h3' ||\n next.tagName === 'h4' ||\n next.tagName === 'h5' ||\n next.tagName === 'h6' ||\n next.tagName === 'header' ||\n next.tagName === 'hgroup' ||\n next.tagName === 'hr' ||\n next.tagName === 'main' ||\n next.tagName === 'menu' ||\n next.tagName === 'nav' ||\n next.tagName === 'ol' ||\n next.tagName === 'p' ||\n next.tagName === 'pre' ||\n next.tagName === 'section' ||\n next.tagName === 'table' ||\n next.tagName === 'ul')\n : !parent ||\n // Confusing parent.\n !(\n parent.type === 'element' &&\n (parent.tagName === 'a' ||\n parent.tagName === 'audio' ||\n parent.tagName === 'del' ||\n parent.tagName === 'ins' ||\n parent.tagName === 'map' ||\n parent.tagName === 'noscript' ||\n parent.tagName === 'video')\n )\n}\n\n/**\n * Whether to omit `</li>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction li(_, index, parent) {\n const next = siblingAfter(parent, index)\n return !next || (next.type === 'element' && next.tagName === 'li')\n}\n\n/**\n * Whether to omit `</dt>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction dt(_, index, parent) {\n const next = siblingAfter(parent, index)\n return Boolean(\n next &&\n next.type === 'element' &&\n (next.tagName === 'dt' || next.tagName === 'dd')\n )\n}\n\n/**\n * Whether to omit `</dd>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction dd(_, index, parent) {\n const next = siblingAfter(parent, index)\n return (\n !next ||\n (next.type === 'element' &&\n (next.tagName === 'dt' || next.tagName === 'dd'))\n )\n}\n\n/**\n * Whether to omit `</rt>` or `</rp>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction rubyElement(_, index, parent) {\n const next = siblingAfter(parent, index)\n return (\n !next ||\n (next.type === 'element' &&\n (next.tagName === 'rp' || next.tagName === 'rt'))\n )\n}\n\n/**\n * Whether to omit `</optgroup>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction optgroup(_, index, parent) {\n const next = siblingAfter(parent, index)\n return !next || (next.type === 'element' && next.tagName === 'optgroup')\n}\n\n/**\n * Whether to omit `</option>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction option(_, index, parent) {\n const next = siblingAfter(parent, index)\n return (\n !next ||\n (next.type === 'element' &&\n (next.tagName === 'option' || next.tagName === 'optgroup'))\n )\n}\n\n/**\n * Whether to omit `</thead>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction thead(_, index, parent) {\n const next = siblingAfter(parent, index)\n return Boolean(\n next &&\n next.type === 'element' &&\n (next.tagName === 'tbody' || next.tagName === 'tfoot')\n )\n}\n\n/**\n * Whether to omit `</tbody>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction tbody(_, index, parent) {\n const next = siblingAfter(parent, index)\n return (\n !next ||\n (next.type === 'element' &&\n (next.tagName === 'tbody' || next.tagName === 'tfoot'))\n )\n}\n\n/**\n * Whether to omit `</tfoot>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction tfoot(_, index, parent) {\n return !siblingAfter(parent, index)\n}\n\n/**\n * Whether to omit `</tr>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction tr(_, index, parent) {\n const next = siblingAfter(parent, index)\n return !next || (next.type === 'element' && next.tagName === 'tr')\n}\n\n/**\n * Whether to omit `</td>` or `</th>`.\n *\n * @param {Element} _\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the closing tag can be omitted.\n */\nfunction cells(_, index, parent) {\n const next = siblingAfter(parent, index)\n return (\n !next ||\n (next.type === 'element' &&\n (next.tagName === 'td' || next.tagName === 'th'))\n )\n}\n", "/**\n * @import {Element, Parents} from 'hast'\n */\n\nimport {whitespace} from 'hast-util-whitespace'\nimport {siblingAfter, siblingBefore} from './util/siblings.js'\nimport {closing} from './closing.js'\nimport {omission} from './omission.js'\n\nexport const opening = omission({\n body,\n colgroup,\n head,\n html,\n tbody\n})\n\n/**\n * Whether to omit `<html>`.\n *\n * @param {Element} node\n * Element.\n * @returns {boolean}\n * Whether the opening tag can be omitted.\n */\nfunction html(node) {\n const head = siblingAfter(node, -1)\n return !head || head.type !== 'comment'\n}\n\n/**\n * Whether to omit `<head>`.\n *\n * @param {Element} node\n * Element.\n * @returns {boolean}\n * Whether the opening tag can be omitted.\n */\nfunction head(node) {\n /** @type {Set<string>} */\n const seen = new Set()\n\n // Whether `srcdoc` or not,\n // make sure the content model at least doesn\u2019t have too many `base`s/`title`s.\n for (const child of node.children) {\n if (\n child.type === 'element' &&\n (child.tagName === 'base' || child.tagName === 'title')\n ) {\n if (seen.has(child.tagName)) return false\n seen.add(child.tagName)\n }\n }\n\n // \u201CMay be omitted if the element is empty,\n // or if the first thing inside the head element is an element.\u201D\n const child = node.children[0]\n return !child || child.type === 'element'\n}\n\n/**\n * Whether to omit `<body>`.\n *\n * @param {Element} node\n * Element.\n * @returns {boolean}\n * Whether the opening tag can be omitted.\n */\nfunction body(node) {\n const head = siblingAfter(node, -1, true)\n\n return (\n !head ||\n (head.type !== 'comment' &&\n !(head.type === 'text' && whitespace(head.value.charAt(0))) &&\n !(\n head.type === 'element' &&\n (head.tagName === 'meta' ||\n head.tagName === 'link' ||\n head.tagName === 'script' ||\n head.tagName === 'style' ||\n head.tagName === 'template')\n ))\n )\n}\n\n/**\n * Whether to omit `<colgroup>`.\n * The spec describes some logic for the opening tag, but it\u2019s easier to\n * implement in the closing tag, to the same effect, so we handle it there\n * instead.\n *\n * @param {Element} node\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the opening tag can be omitted.\n */\nfunction colgroup(node, index, parent) {\n const previous = siblingBefore(parent, index)\n const head = siblingAfter(node, -1, true)\n\n // Previous colgroup was already omitted.\n if (\n parent &&\n previous &&\n previous.type === 'element' &&\n previous.tagName === 'colgroup' &&\n closing(previous, parent.children.indexOf(previous), parent)\n ) {\n return false\n }\n\n return Boolean(head && head.type === 'element' && head.tagName === 'col')\n}\n\n/**\n * Whether to omit `<tbody>`.\n *\n * @param {Element} node\n * Element.\n * @param {number | undefined} index\n * Index of element in parent.\n * @param {Parents | undefined} parent\n * Parent of element.\n * @returns {boolean}\n * Whether the opening tag can be omitted.\n */\nfunction tbody(node, index, parent) {\n const previous = siblingBefore(parent, index)\n const head = siblingAfter(node, -1)\n\n // Previous table section was already omitted.\n if (\n parent &&\n previous &&\n previous.type === 'element' &&\n (previous.tagName === 'thead' || previous.tagName === 'tbody') &&\n closing(previous, parent.children.indexOf(previous), parent)\n ) {\n return false\n }\n\n return Boolean(head && head.type === 'element' && head.tagName === 'tr')\n}\n", "/**\n * @import {Element, Parents, Properties} from 'hast'\n * @import {State} from '../index.js'\n */\n\nimport {ccount} from 'ccount'\nimport {stringify as commas} from 'comma-separated-tokens'\nimport {find, svg} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport {stringifyEntities} from 'stringify-entities'\nimport {closing} from '../omission/closing.js'\nimport {opening} from '../omission/opening.js'\n\n/**\n * Maps of subsets.\n *\n * Each value is a matrix of tuples.\n * The value at `0` causes parse errors, the value at `1` is valid.\n * Of both, the value at `0` is unsafe, and the value at `1` is safe.\n *\n * @type {Record<'double' | 'name' | 'single' | 'unquoted', Array<[Array<string>, Array<string>]>>}\n */\nconst constants = {\n // See: <https://html.spec.whatwg.org/#attribute-name-state>.\n name: [\n ['\\t\\n\\f\\r &/=>'.split(''), '\\t\\n\\f\\r \"&\\'/=>`'.split('')],\n ['\\0\\t\\n\\f\\r \"&\\'/<=>'.split(''), '\\0\\t\\n\\f\\r \"&\\'/<=>`'.split('')]\n ],\n // See: <https://html.spec.whatwg.org/#attribute-value-(unquoted)-state>.\n unquoted: [\n ['\\t\\n\\f\\r &>'.split(''), '\\0\\t\\n\\f\\r \"&\\'<=>`'.split('')],\n ['\\0\\t\\n\\f\\r \"&\\'<=>`'.split(''), '\\0\\t\\n\\f\\r \"&\\'<=>`'.split('')]\n ],\n // See: <https://html.spec.whatwg.org/#attribute-value-(single-quoted)-state>.\n single: [\n [\"&'\".split(''), '\"&\\'`'.split('')],\n [\"\\0&'\".split(''), '\\0\"&\\'`'.split('')]\n ],\n // See: <https://html.spec.whatwg.org/#attribute-value-(double-quoted)-state>.\n double: [\n ['\"&'.split(''), '\"&\\'`'.split('')],\n ['\\0\"&'.split(''), '\\0\"&\\'`'.split('')]\n ]\n}\n\n/**\n * Serialize an element node.\n *\n * @param {Element} node\n * Node to handle.\n * @param {number | undefined} index\n * Index of `node` in `parent.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {string}\n * Serialized node.\n */\nexport function element(node, index, parent, state) {\n const schema = state.schema\n const omit = schema.space === 'svg' ? false : state.settings.omitOptionalTags\n let selfClosing =\n schema.space === 'svg'\n ? state.settings.closeEmptyElements\n : state.settings.voids.includes(node.tagName.toLowerCase())\n /** @type {Array<string>} */\n const parts = []\n /** @type {string} */\n let last\n\n if (schema.space === 'html' && node.tagName === 'svg') {\n state.schema = svg\n }\n\n const attributes = serializeAttributes(state, node.properties)\n\n const content = state.all(\n schema.space === 'html' && node.tagName === 'template' ? node.content : node\n )\n\n state.schema = schema\n\n // If the node is categorised as void, but it has children, remove the\n // categorisation.\n // This enables for example `menuitem`s, which are void in W3C HTML but not\n // void in WHATWG HTML, to be stringified properly.\n // Note: `menuitem` has since been removed from the HTML spec, and so is no\n // longer void.\n if (content) selfClosing = false\n\n if (attributes || !omit || !opening(node, index, parent)) {\n parts.push('<', node.tagName, attributes ? ' ' + attributes : '')\n\n if (\n selfClosing &&\n (schema.space === 'svg' || state.settings.closeSelfClosing)\n ) {\n last = attributes.charAt(attributes.length - 1)\n if (\n !state.settings.tightSelfClosing ||\n last === '/' ||\n (last && last !== '\"' && last !== \"'\")\n ) {\n parts.push(' ')\n }\n\n parts.push('/')\n }\n\n parts.push('>')\n }\n\n parts.push(content)\n\n if (!selfClosing && (!omit || !closing(node, index, parent))) {\n parts.push('</' + node.tagName + '>')\n }\n\n return parts.join('')\n}\n\n/**\n * @param {State} state\n * @param {Properties | null | undefined} properties\n * @returns {string}\n */\nfunction serializeAttributes(state, properties) {\n /** @type {Array<string>} */\n const values = []\n let index = -1\n /** @type {string} */\n let key\n\n if (properties) {\n for (key in properties) {\n if (properties[key] !== null && properties[key] !== undefined) {\n const value = serializeAttribute(state, key, properties[key])\n if (value) values.push(value)\n }\n }\n }\n\n while (++index < values.length) {\n const last = state.settings.tightAttributes\n ? values[index].charAt(values[index].length - 1)\n : undefined\n\n // In tight mode, don\u2019t add a space after quoted attributes.\n if (index !== values.length - 1 && last !== '\"' && last !== \"'\") {\n values[index] += ' '\n }\n }\n\n return values.join('')\n}\n\n/**\n * @param {State} state\n * @param {string} key\n * @param {Properties[keyof Properties]} value\n * @returns {string}\n */\nfunction serializeAttribute(state, key, value) {\n const info = find(state.schema, key)\n const x =\n state.settings.allowParseErrors && state.schema.space === 'html' ? 0 : 1\n const y = state.settings.allowDangerousCharacters ? 0 : 1\n let quote = state.quote\n /** @type {string | undefined} */\n let result\n\n if (info.overloadedBoolean && (value === info.attribute || value === '')) {\n value = true\n } else if (\n (info.boolean || info.overloadedBoolean) &&\n (typeof value !== 'string' || value === info.attribute || value === '')\n ) {\n value = Boolean(value)\n }\n\n if (\n value === null ||\n value === undefined ||\n value === false ||\n (typeof value === 'number' && Number.isNaN(value))\n ) {\n return ''\n }\n\n const name = stringifyEntities(\n info.attribute,\n Object.assign({}, state.settings.characterReferences, {\n // Always encode without parse errors in non-HTML.\n subset: constants.name[x][y]\n })\n )\n\n // No value.\n // There is currently only one boolean property in SVG: `[download]` on\n // `<a>`.\n // This property does not seem to work in browsers (Firefox, Safari, Chrome),\n // so I can\u2019t test if dropping the value works.\n // But I assume that it should:\n //\n // ```html\n // <!doctype html>\n // <svg viewBox=\"0 0 100 100\">\n // <a href=https://example.com download>\n // <circle cx=50 cy=40 r=35 />\n // </a>\n // </svg>\n // ```\n //\n // See: <https://github.com/wooorm/property-information/blob/main/lib/svg.js>\n if (value === true) return name\n\n // `spaces` doesn\u2019t accept a second argument, but it\u2019s given here just to\n // keep the code cleaner.\n value = Array.isArray(value)\n ? (info.commaSeparated ? commas : spaces)(value, {\n padLeft: !state.settings.tightCommaSeparatedLists\n })\n : String(value)\n\n if (state.settings.collapseEmptyAttributes && !value) return name\n\n // Check unquoted value.\n if (state.settings.preferUnquoted) {\n result = stringifyEntities(\n value,\n Object.assign({}, state.settings.characterReferences, {\n attribute: true,\n subset: constants.unquoted[x][y]\n })\n )\n }\n\n // If we don\u2019t want unquoted, or if `value` contains character references when\n // unquoted\u2026\n if (result !== value) {\n // If the alternative is less common than `quote`, switch.\n if (\n state.settings.quoteSmart &&\n ccount(value, quote) > ccount(value, state.alternative)\n ) {\n quote = state.alternative\n }\n\n result =\n quote +\n stringifyEntities(\n value,\n Object.assign({}, state.settings.characterReferences, {\n // Always encode without parse errors in non-HTML.\n subset: (quote === \"'\" ? constants.single : constants.double)[x][y],\n attribute: true\n })\n ) +\n quote\n }\n\n // Don\u2019t add a `=` for unquoted empties.\n return name + (result ? '=' + result : result)\n}\n", "/**\n * @import {Parents, Text} from 'hast'\n * @import {Raw} from 'mdast-util-to-hast'\n * @import {State} from '../index.js'\n */\n\nimport {stringifyEntities} from 'stringify-entities'\n\n// Declare array as variable so it can be cached by `stringifyEntities`\nconst textEntitySubset = ['<', '&']\n\n/**\n * Serialize a text node.\n *\n * @param {Raw | Text} node\n * Node to handle.\n * @param {number | undefined} _\n * Index of `node` in `parent.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {string}\n * Serialized node.\n */\nexport function text(node, _, parent, state) {\n // Check if content of `node` should be escaped.\n return parent &&\n parent.type === 'element' &&\n (parent.tagName === 'script' || parent.tagName === 'style')\n ? node.value\n : stringifyEntities(\n node.value,\n Object.assign({}, state.settings.characterReferences, {\n subset: textEntitySubset\n })\n )\n}\n", "/**\n * @import {Parents} from 'hast'\n * @import {Raw} from 'mdast-util-to-hast'\n * @import {State} from '../index.js'\n */\n\nimport {text} from './text.js'\n\n/**\n * Serialize a raw node.\n *\n * @param {Raw} node\n * Node to handle.\n * @param {number | undefined} index\n * Index of `node` in `parent.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {string}\n * Serialized node.\n */\nexport function raw(node, index, parent, state) {\n return state.settings.allowDangerousHtml\n ? node.value\n : text(node, index, parent, state)\n}\n", "/**\n * @import {Parents, Root} from 'hast'\n * @import {State} from '../index.js'\n */\n\n/**\n * Serialize a root.\n *\n * @param {Root} node\n * Node to handle.\n * @param {number | undefined} _1\n * Index of `node` in `parent.\n * @param {Parents | undefined} _2\n * Parent of `node`.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {string}\n * Serialized node.\n */\nexport function root(node, _1, _2, state) {\n return state.all(node)\n}\n", "/**\n * @import {Nodes, Parents} from 'hast'\n * @import {State} from '../index.js'\n */\n\nimport {zwitch} from 'zwitch'\nimport {comment} from './comment.js'\nimport {doctype} from './doctype.js'\nimport {element} from './element.js'\nimport {raw} from './raw.js'\nimport {root} from './root.js'\nimport {text} from './text.js'\n\n/**\n * @type {(node: Nodes, index: number | undefined, parent: Parents | undefined, state: State) => string}\n */\nexport const handle = zwitch('type', {\n invalid,\n unknown,\n handlers: {comment, doctype, element, raw, root, text}\n})\n\n/**\n * Fail when a non-node is found in the tree.\n *\n * @param {unknown} node\n * Unknown value.\n * @returns {never}\n * Never.\n */\nfunction invalid(node) {\n throw new Error('Expected node, not `' + node + '`')\n}\n\n/**\n * Fail when a node with an unknown type is found in the tree.\n *\n * @param {unknown} node_\n * Unknown node.\n * @returns {never}\n * Never.\n */\nfunction unknown(node_) {\n // `type` is guaranteed by runtime JS.\n const node = /** @type {Nodes} */ (node_)\n throw new Error('Cannot compile unknown node `' + node.type + '`')\n}\n", "/**\n * @import {Nodes, Parents, RootContent} from 'hast'\n * @import {Schema} from 'property-information'\n * @import {Options as StringifyEntitiesOptions} from 'stringify-entities'\n */\n\n/**\n * @typedef {Omit<StringifyEntitiesOptions, 'attribute' | 'escapeOnly' | 'subset'>} CharacterReferences\n *\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [allowDangerousCharacters=false]\n * Do not encode some characters which cause XSS vulnerabilities in older\n * browsers (default: `false`).\n *\n * > \u26A0\uFE0F **Danger**: only set this if you completely trust the content.\n * @property {boolean | null | undefined} [allowDangerousHtml=false]\n * Allow `raw` nodes and insert them as raw HTML (default: `false`).\n *\n * When `false`, `Raw` nodes are encoded.\n *\n * > \u26A0\uFE0F **Danger**: only set this if you completely trust the content.\n * @property {boolean | null | undefined} [allowParseErrors=false]\n * Do not encode characters which cause parse errors (even though they work),\n * to save bytes (default: `false`).\n *\n * Not used in the SVG space.\n *\n * > \uD83D\uDC49 **Note**: intentionally creates parse errors in markup (how parse\n * > errors are handled is well defined, so this works but isn\u2019t pretty).\n * @property {boolean | null | undefined} [bogusComments=false]\n * Use \u201Cbogus comments\u201D instead of comments to save byes: `<?charlie>`\n * instead of `<!--charlie-->` (default: `false`).\n *\n * > \uD83D\uDC49 **Note**: intentionally creates parse errors in markup (how parse\n * > errors are handled is well defined, so this works but isn\u2019t pretty).\n * @property {CharacterReferences | null | undefined} [characterReferences]\n * Configure how to serialize character references (optional).\n * @property {boolean | null | undefined} [closeEmptyElements=false]\n * Close SVG elements without any content with slash (`/`) on the opening tag\n * instead of an end tag: `<circle />` instead of `<circle></circle>`\n * (default: `false`).\n *\n * See `tightSelfClosing` to control whether a space is used before the\n * slash.\n *\n * Not used in the HTML space.\n * @property {boolean | null | undefined} [closeSelfClosing=false]\n * Close self-closing nodes with an extra slash (`/`): `<img />` instead of\n * `<img>` (default: `false`).\n *\n * See `tightSelfClosing` to control whether a space is used before the\n * slash.\n *\n * Not used in the SVG space.\n * @property {boolean | null | undefined} [collapseEmptyAttributes=false]\n * Collapse empty attributes: get `class` instead of `class=\"\"` (default:\n * `false`).\n *\n * Not used in the SVG space.\n *\n * > \uD83D\uDC49 **Note**: boolean attributes (such as `hidden`) are always collapsed.\n * @property {boolean | null | undefined} [omitOptionalTags=false]\n * Omit optional opening and closing tags (default: `false`).\n *\n * For example, in `<ol><li>one</li><li>two</li></ol>`, both `</li>` closing\n * tags can be omitted.\n * The first because it\u2019s followed by another `li`, the last because it\u2019s\n * followed by nothing.\n *\n * Not used in the SVG space.\n * @property {boolean | null | undefined} [preferUnquoted=false]\n * Leave attributes unquoted if that results in less bytes (default: `false`).\n *\n * Not used in the SVG space.\n * @property {boolean | null | undefined} [quoteSmart=false]\n * Use the other quote if that results in less bytes (default: `false`).\n * @property {Quote | null | undefined} [quote='\"']\n * Preferred quote to use (default: `'\"'`).\n * @property {Space | null | undefined} [space='html']\n * When an `<svg>` element is found in the HTML space, this package already\n * automatically switches to and from the SVG space when entering and exiting\n * it (default: `'html'`).\n *\n * > \uD83D\uDC49 **Note**: hast is not XML.\n * > It supports SVG as embedded in HTML.\n * > It does not support the features available in XML.\n * > Passing SVG might break but fragments of modern SVG should be fine.\n * > Use [`xast`][xast] if you need to support SVG as XML.\n * @property {boolean | null | undefined} [tightAttributes=false]\n * Join attributes together, without whitespace, if possible: get\n * `class=\"a b\"title=\"c d\"` instead of `class=\"a b\" title=\"c d\"` to save\n * bytes (default: `false`).\n *\n * Not used in the SVG space.\n *\n * > \uD83D\uDC49 **Note**: intentionally creates parse errors in markup (how parse\n * > errors are handled is well defined, so this works but isn\u2019t pretty).\n * @property {boolean | null | undefined} [tightCommaSeparatedLists=false]\n * Join known comma-separated attribute values with just a comma (`,`),\n * instead of padding them on the right as well (`,\u2420`, where `\u2420` represents a\n * space) (default: `false`).\n * @property {boolean | null | undefined} [tightDoctype=false]\n * Drop unneeded spaces in doctypes: `<!doctypehtml>` instead of\n * `<!doctype html>` to save bytes (default: `false`).\n *\n * > \uD83D\uDC49 **Note**: intentionally creates parse errors in markup (how parse\n * > errors are handled is well defined, so this works but isn\u2019t pretty).\n * @property {boolean | null | undefined} [tightSelfClosing=false]\n * Do not use an extra space when closing self-closing elements: `<img/>`\n * instead of `<img />` (default: `false`).\n *\n * > \uD83D\uDC49 **Note**: only used if `closeSelfClosing: true` or\n * > `closeEmptyElements: true`.\n * @property {boolean | null | undefined} [upperDoctype=false]\n * Use a `<!DOCTYPE\u2026` instead of `<!doctype\u2026` (default: `false`).\n *\n * Useless except for XHTML.\n * @property {ReadonlyArray<string> | null | undefined} [voids]\n * Tag names of elements to serialize without closing tag (default: `html-void-elements`).\n *\n * Not used in the SVG space.\n *\n * > \uD83D\uDC49 **Note**: It\u2019s highly unlikely that you want to pass this, because\n * > hast is not for XML, and HTML will not add more void elements.\n *\n * @typedef {'\"' | \"'\"} Quote\n * HTML quotes for attribute values.\n *\n * @typedef {Omit<Required<{[key in keyof Options]: Exclude<Options[key], null | undefined>}>, 'space' | 'quote'>} Settings\n *\n * @typedef {'html' | 'svg'} Space\n * Namespace.\n *\n * @typedef State\n * Info passed around about the current state.\n * @property {(node: Parents | undefined) => string} all\n * Serialize the children of a parent node.\n * @property {Quote} alternative\n * Alternative quote.\n * @property {(node: Nodes, index: number | undefined, parent: Parents | undefined) => string} one\n * Serialize one node.\n * @property {Quote} quote\n * Preferred quote.\n * @property {Schema} schema\n * Current schema.\n * @property {Settings} settings\n * User configuration.\n */\n\nimport {htmlVoidElements} from 'html-void-elements'\nimport {html, svg} from 'property-information'\nimport {handle} from './handle/index.js'\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/** @type {CharacterReferences} */\nconst emptyCharacterReferences = {}\n\n/** @type {Array<never>} */\nconst emptyChildren = []\n\n/**\n * Serialize hast as HTML.\n *\n * @param {Array<RootContent> | Nodes} tree\n * Tree to serialize.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {string}\n * Serialized HTML.\n */\nexport function toHtml(tree, options) {\n const options_ = options || emptyOptions\n const quote = options_.quote || '\"'\n const alternative = quote === '\"' ? \"'\" : '\"'\n\n if (quote !== '\"' && quote !== \"'\") {\n throw new Error('Invalid quote `' + quote + '`, expected `\\'` or `\"`')\n }\n\n /** @type {State} */\n const state = {\n one,\n all,\n settings: {\n omitOptionalTags: options_.omitOptionalTags || false,\n allowParseErrors: options_.allowParseErrors || false,\n allowDangerousCharacters: options_.allowDangerousCharacters || false,\n quoteSmart: options_.quoteSmart || false,\n preferUnquoted: options_.preferUnquoted || false,\n tightAttributes: options_.tightAttributes || false,\n upperDoctype: options_.upperDoctype || false,\n tightDoctype: options_.tightDoctype || false,\n bogusComments: options_.bogusComments || false,\n tightCommaSeparatedLists: options_.tightCommaSeparatedLists || false,\n tightSelfClosing: options_.tightSelfClosing || false,\n collapseEmptyAttributes: options_.collapseEmptyAttributes || false,\n allowDangerousHtml: options_.allowDangerousHtml || false,\n voids: options_.voids || htmlVoidElements,\n characterReferences:\n options_.characterReferences || emptyCharacterReferences,\n closeSelfClosing: options_.closeSelfClosing || false,\n closeEmptyElements: options_.closeEmptyElements || false\n },\n schema: options_.space === 'svg' ? svg : html,\n quote,\n alternative\n }\n\n return state.one(\n Array.isArray(tree) ? {type: 'root', children: tree} : tree,\n undefined,\n undefined\n )\n}\n\n/**\n * Serialize a node.\n *\n * @this {State}\n * Info passed around about the current state.\n * @param {Nodes} node\n * Node to handle.\n * @param {number | undefined} index\n * Index of `node` in `parent.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @returns {string}\n * Serialized node.\n */\nfunction one(node, index, parent) {\n return handle(node, index, parent, this)\n}\n\n/**\n * Serialize all children of `parent`.\n *\n * @this {State}\n * Info passed around about the current state.\n * @param {Parents | undefined} parent\n * Parent whose children to serialize.\n * @returns {string}\n */\nexport function all(parent) {\n /** @type {Array<string>} */\n const results = []\n const children = (parent && parent.children) || emptyChildren\n let index = -1\n\n while (++index < children.length) {\n results[index] = this.one(children[index], index, parent)\n }\n\n return results.join('')\n}\n", "import type { Element, Nodes, Properties, RootContent } from 'hast';\nimport { toHtml } from 'hast-util-to-html';\n\n// Must match the html-void-elements list used by toHtml().\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'basefont',\n 'bgsound',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'frame',\n 'hr',\n 'image',\n 'img',\n 'input',\n 'keygen',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n]);\n\n// These elements require schema, fragment or raw-text handling in toHtml().\nconst DELEGATED_TAGS = new Set(['svg', 'template', 'script', 'style']);\n\n// Boolean and comma-separated attributes require the full HTML schema.\nconst ATTRIBUTE_NAMES: Record<string, string | undefined> = {\n class: 'class',\n className: 'class',\n id: 'id',\n role: 'role',\n style: 'style',\n tabIndex: 'tabindex',\n tabindex: 'tabindex',\n title: 'title',\n};\nconst DATA_ATTRIBUTE = /^data-[\\w.:-]+$/;\n\nconst TEXT_ESCAPE = /[<&]/g;\nconst ATTRIBUTE_ESCAPE = /[\\0\"&'`]/g;\n// Must match stringify-entities' default hexadecimal encoding.\nconst CHARACTER_REFERENCES: Record<string, string> = {\n '<': '&#x3C;',\n '&': '&#x26;',\n '\"': '&#x22;',\n \"'\": '&#x27;',\n '`': '&#x60;',\n '\\0': '&#x0;',\n};\nconst MAX_CACHED_STYLES = 256;\n\n/**\n * Serializes a HAST node or node array to HTML. Common token spans use a fast\n * path; other nodes and attributes use hast-util-to-html's default serialization.\n */\nexport function hastToHtml(tree: Nodes | RootContent[]): string {\n const styles = new Map<string, string>();\n return Array.isArray(tree)\n ? serializeChildren(tree, styles)\n : serializeNode(tree, styles);\n}\n\nfunction serializeChildren(\n children: readonly RootContent[],\n styles: Map<string, string>\n): string {\n let html = '';\n for (const child of children) {\n html += serializeNode(child, styles);\n }\n return html;\n}\n\nfunction serializeNode(node: Nodes, styles: Map<string, string>): string {\n switch (node.type) {\n case 'text':\n return escapeText(node.value);\n case 'element':\n return serializeElement(node, styles);\n case 'root':\n return serializeChildren(node.children, styles);\n default:\n return toHtml(node);\n }\n}\n\nfunction serializeElement(node: Element, styles: Map<string, string>): string {\n const { tagName } = node;\n if (\n tagName === 'span' &&\n node.children.length === 1 &&\n node.children[0].type === 'text' &&\n typeof node.properties?.style === 'string'\n ) {\n let styleOnly = true;\n for (const key in node.properties) {\n if (key !== 'style' && node.properties[key] != null) {\n styleOnly = false;\n break;\n }\n }\n if (styleOnly) {\n return `<span ${serializeStyle(node.properties.style, styles)}>${escapeText(node.children[0].value)}</span>`;\n }\n }\n if (DELEGATED_TAGS.has(tagName)) {\n return toHtml(node);\n }\n const attributes = serializeAttributes(node.properties, styles);\n if (attributes == null) {\n return toHtml(node);\n }\n const open =\n attributes === '' ? `<${tagName}>` : `<${tagName} ${attributes}>`;\n const content = serializeChildren(node.children, styles);\n if (content === '' && VOID_ELEMENTS.has(tagName.toLowerCase())) {\n return open;\n }\n return `${open}${content}</${tagName}>`;\n}\n\n// Cap the per-render cache because custom styles may be unique per token.\nfunction serializeStyle(value: string, styles: Map<string, string>): string {\n let attribute = styles.get(value);\n if (attribute == null) {\n attribute = `style=\"${escapeAttribute(value)}\"`;\n if (styles.size < MAX_CACHED_STYLES) styles.set(value, attribute);\n }\n return attribute;\n}\n\n// Returns undefined when a property needs the HTML schema to serialize.\nfunction serializeAttributes(\n properties: Properties | undefined,\n styles: Map<string, string>\n): string | undefined {\n let attributes = '';\n for (const key in properties) {\n const value = properties[key];\n if (value == null) {\n continue;\n }\n const name =\n ATTRIBUTE_NAMES[key] ?? (DATA_ATTRIBUTE.test(key) ? key : undefined);\n if (name == null) {\n return undefined;\n }\n if (value === false || (typeof value === 'number' && Number.isNaN(value))) {\n continue;\n }\n const attribute =\n key === 'style' && typeof value === 'string'\n ? serializeStyle(value, styles)\n : value === true\n ? name\n : `${name}=\"${escapeAttribute(\n Array.isArray(value) ? value.join(' ').trim() : String(value)\n )}\"`;\n attributes += attributes === '' ? attribute : ` ${attribute}`;\n }\n return attributes;\n}\n\nfunction escapeText(value: string): string {\n return value.indexOf('<') < 0 && value.indexOf('&') < 0\n ? value\n : value.replace(TEXT_ESCAPE, toCharacterReference);\n}\n\nfunction escapeAttribute(value: string): string {\n return value.replace(ATTRIBUTE_ESCAPE, toCharacterReference);\n}\n\nfunction toCharacterReference(character: string): string {\n return CHARACTER_REFERENCES[character];\n}\n", "import type {\n ElementContent,\n Element as HASTElement,\n Properties,\n Root,\n RootContent,\n Text,\n} from 'hast';\n\nimport type { SVGSpriteNames } from '../sprite';\nimport type { LineTypes } from '../types';\n\nexport function createTextNodeElement(value: string): Text {\n return { type: 'text', value };\n}\n\ninterface CreateHastElementProps {\n tagName:\n | 'span'\n | 'div'\n | 'button'\n | 'code'\n | 'pre'\n | 'slot'\n | 'svg'\n | 'use'\n | 'style'\n | 'template'\n | 'bdi';\n children?: ElementContent[];\n properties?: Properties;\n}\n\nexport function createHastElement({\n tagName,\n children = [],\n properties = {},\n}: CreateHastElementProps): HASTElement {\n return {\n type: 'element',\n tagName,\n properties,\n children,\n };\n}\n\ninterface CreateIconProps {\n name: SVGSpriteNames;\n width?: number;\n height?: number;\n properties?: Properties;\n}\n\nexport function createIconElement({\n name,\n width = 16,\n height = 16,\n properties,\n}: CreateIconProps): HASTElement {\n return createHastElement({\n tagName: 'svg',\n properties: { width, height, viewBox: '0 0 16 16', ...properties },\n children: [\n createHastElement({\n tagName: 'use',\n properties: { href: `#${name.replace(/^#/, '')}` },\n }),\n ],\n });\n}\n\nexport function findCodeElement(\n nodes: Root | HASTElement\n): HASTElement | undefined {\n let firstChild: RootContent | HASTElement | Root | null = nodes.children[0];\n while (firstChild != null) {\n if (firstChild.type === 'element' && firstChild.tagName === 'code') {\n return firstChild;\n }\n if ('children' in firstChild) {\n firstChild = firstChild.children[0];\n } else {\n firstChild = null;\n }\n }\n return undefined;\n}\n\nexport function createGutterWrapper(children?: ElementContent[]): HASTElement {\n return createHastElement({\n tagName: 'div',\n properties: { 'data-gutter': '' },\n children,\n });\n}\n\nexport function createGutterItem(\n lineType: LineTypes | 'buffer' | 'separator' | 'annotation',\n lineNumber: number,\n lineIndex: string,\n properties: Properties = {}\n): HASTElement {\n return createHastElement({\n tagName: 'div',\n properties: {\n 'data-line-type': lineType,\n 'data-column-number': lineNumber,\n 'data-line-index': lineIndex,\n ...properties,\n },\n children:\n lineNumber != null\n ? [\n createHastElement({\n tagName: 'span',\n properties: { 'data-line-number-content': '' },\n children: [createTextNodeElement(`${lineNumber}`)],\n }),\n ]\n : undefined,\n });\n}\n\nexport function createGutterGap(\n type: LineTypes | undefined,\n bufferType: 'annotation' | 'buffer' | 'metadata',\n size: number\n): HASTElement {\n return createHastElement({\n tagName: 'div',\n properties: {\n 'data-gutter-buffer': bufferType,\n 'data-buffer-size': size,\n 'data-line-type': bufferType === 'annotation' ? undefined : type,\n style:\n bufferType === 'annotation'\n ? `grid-row: span ${size};`\n : `grid-row: span ${size};min-height:calc(${size} * 1lh);`,\n },\n });\n}\n", "import type { ElementContent, Element as HASTElement } from 'hast';\n\nimport type { SharedRenderState } from '../types';\nimport { createTextNodeElement } from './hast_utils';\n\nexport function processLine(\n node: HASTElement,\n line: number,\n state: SharedRenderState\n): ElementContent {\n const lineInfo =\n typeof state.lineInfo === 'function'\n ? state.lineInfo(line)\n : state.lineInfo[line - 1];\n if (lineInfo == null) {\n const errorMessage = `processLine: line ${line}, contains no state.lineInfo`;\n console.error(errorMessage, { node, line, state });\n throw new Error(errorMessage);\n }\n // We need to convert the current line to a div but keep all the decorations\n // that may be applied\n node.tagName = 'div';\n node.properties['data-line'] = lineInfo.lineNumber;\n node.properties['data-alt-line'] = lineInfo.altLineNumber;\n node.properties['data-line-type'] = lineInfo.type;\n node.properties['data-line-index'] = lineInfo.lineIndex;\n\n // NOTE(amadeus): We need to push newline characters into empty rows or else\n // copy/pasta will have issues\n if (node.children.length === 0) {\n node.children.push(createTextNodeElement('\\n'));\n }\n\n return node;\n}\n", "// Defines `array[index]` as an item that `create` builds on read. By default\n// the first read keeps the built value as a plain array item. With\n// `retain: false`, every read builds a fresh value and nothing built is kept,\n// for items whose source stays available anyway. Assignments store the given\n// value like a normal array write and follow sealed/frozen array semantics.\nexport function setDeferredArrayItem<T>(\n array: T[],\n index: number,\n create: () => T,\n { retain = true }: { retain?: boolean } = {}\n): void {\n let initialized = false;\n let cached: T;\n Object.defineProperty(array, index, {\n configurable: true,\n enumerable: true,\n get() {\n if (initialized) return cached;\n const value = create();\n if (!retain) return value;\n cached = value;\n initialized = true;\n if (\n Object.getOwnPropertyDescriptor(array, index)?.configurable === true\n ) {\n Object.defineProperty(array, index, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: cached,\n });\n }\n return cached;\n },\n set(value: T) {\n if (\n Object.getOwnPropertyDescriptor(array, index)?.configurable === true\n ) {\n Object.defineProperty(array, index, {\n configurable: true,\n enumerable: true,\n writable: true,\n value,\n });\n } else if (Object.isFrozen(array)) {\n throw new TypeError(\n `Cannot assign to read only array index '${index}'`\n );\n } else {\n cached = value;\n initialized = true;\n }\n },\n });\n}\n", "import type { ThemedToken } from '../types';\n\n// Warning: cache only tokens from Highlights, which reuses htmlStyle objects.\n// Shiki creates one per token, so caching them adds a WeakMap entry per token.\nconst htmlStyleCache = new WeakMap<Record<string, string>, string>();\n\n/**\n * Returns CSS declarations for a highlighted token. Enable caching only when\n * htmlStyle objects are immutable and reused across tokens.\n */\nexport function tokenStyle(\n token: ThemedToken,\n cacheHtmlStyle: boolean = false\n): string {\n const { htmlStyle } = token;\n if (htmlStyle != null) {\n let style = cacheHtmlStyle ? htmlStyleCache.get(htmlStyle) : undefined;\n if (style == null) {\n style = '';\n for (const name in htmlStyle) {\n style += `${style === '' ? '' : ';'}${name}:${htmlStyle[name]}`;\n }\n if (cacheHtmlStyle) htmlStyleCache.set(htmlStyle, style);\n }\n return style;\n }\n let style = token.color != null ? `color:${token.color}` : '';\n if (token.bgColor != null) style += `;background-color:${token.bgColor}`;\n if (token.fontStyle != null) {\n if ((token.fontStyle & 1) !== 0) style += ';font-style:italic';\n if ((token.fontStyle & 2) !== 0) style += ';font-weight:bold';\n const underline = (token.fontStyle & 4) !== 0;\n const strikethrough = (token.fontStyle & 8) !== 0;\n if (underline || strikethrough)\n style += `;text-decoration:${underline ? 'underline' : ''}${underline && strikethrough ? ' ' : ''}${strikethrough ? 'line-through' : ''}`;\n }\n return style.replace(/^;/, '');\n}\n", "import type { ElementContent, Element as HASTElement } from 'hast';\n\nimport { createHastElement } from './hast_utils';\n\nconst NO_TOKEN: unique symbol = Symbol('no-token');\nconst MULTIPLE_TOKENS: unique symbol = Symbol('multiple-tokens');\n\ntype TokenFragmentState = number | typeof NO_TOKEN | typeof MULTIPLE_TOKENS;\n\n// Walk a rendered line and add a single outer token wrapper around all\n// fragments that still belong to the same original syntax token.\nexport function wrapTokenFragments(container: HASTElement): TokenFragmentState {\n const ownTokenChar = getTokenChar(container);\n if (ownTokenChar != null) {\n return ownTokenChar;\n }\n\n let containerTokenState: TokenFragmentState = NO_TOKEN;\n const wrappedChildren: ElementContent[] = [];\n let currentTokenChildren: ElementContent[] = [];\n let currentTokenChar: number | undefined;\n\n const flushTokenChildren = () => {\n if (currentTokenChildren.length === 0 || currentTokenChar == null) {\n currentTokenChildren = [];\n currentTokenChar = undefined;\n return;\n }\n\n if (currentTokenChildren.length === 1) {\n const child = currentTokenChildren[0];\n if (child?.type === 'element') {\n setTokenChar(child, currentTokenChar);\n for (const grandChild of child.children) {\n stripTokenChar(grandChild);\n }\n } else {\n stripTokenChar(child);\n }\n wrappedChildren.push(child);\n currentTokenChildren = [];\n currentTokenChar = undefined;\n return;\n }\n\n for (const child of currentTokenChildren) {\n stripTokenChar(child);\n }\n\n wrappedChildren.push(\n createHastElement({\n tagName: 'span',\n properties: { 'data-char': currentTokenChar },\n children: currentTokenChildren,\n })\n );\n\n currentTokenChildren = [];\n currentTokenChar = undefined;\n };\n\n const mergeContainerTokenState = (childTokenState: TokenFragmentState) => {\n if (childTokenState === NO_TOKEN) {\n return;\n }\n if (childTokenState === MULTIPLE_TOKENS) {\n containerTokenState = MULTIPLE_TOKENS;\n return;\n }\n if (containerTokenState === NO_TOKEN) {\n containerTokenState = childTokenState;\n return;\n }\n if (containerTokenState !== childTokenState) {\n containerTokenState = MULTIPLE_TOKENS;\n }\n };\n\n for (const child of container.children) {\n const childTokenState: TokenFragmentState =\n child.type === 'element' ? wrapTokenFragments(child) : NO_TOKEN;\n mergeContainerTokenState(childTokenState);\n\n if (typeof childTokenState !== 'number') {\n flushTokenChildren();\n wrappedChildren.push(child);\n continue;\n }\n\n if (currentTokenChar != null && currentTokenChar !== childTokenState) {\n flushTokenChildren();\n }\n\n currentTokenChar ??= childTokenState;\n currentTokenChildren.push(child);\n }\n\n flushTokenChildren();\n container.children = wrappedChildren;\n return containerTokenState;\n}\n\nfunction getTokenChar(node: HASTElement): number | undefined {\n const value = node.properties['data-char'];\n if (typeof value === 'number') {\n return value;\n }\n return undefined;\n}\n\nfunction stripTokenChar(node: ElementContent): void {\n if (node.type !== 'element') return;\n node.properties['data-char'] = undefined;\n for (const child of node.children) {\n stripTokenChar(child);\n }\n}\n\nfunction setTokenChar(node: HASTElement, char: number): void {\n node.properties['data-char'] = char;\n}\n", "import type { Element, ElementContent, Properties } from 'hast';\n\nimport type { DecorationItem, SharedRenderState, ThemedToken } from '../types';\nimport { processLine } from './processLine';\nimport { setDeferredArrayItem } from './setDeferredArrayItem';\nimport { tokenStyle } from './tokenStyle';\nimport { wrapTokenFragments } from './wrapTokenFragments';\n\nexport interface RenderTokenLinesOptions {\n lazyLineAST?: boolean;\n cacheHtmlStyles?: boolean;\n state?: SharedRenderState;\n useTokenTransformer?: boolean;\n mergeWhitespaces?: 'never' | 'always';\n decorations?: DecorationItem[];\n /** UTF-16 line start offsets, required for numeric decoration positions. */\n lineOffsets?: number[];\n}\n\ninterface LineDecoration extends Omit<DecorationItem, 'start' | 'end'> {\n start: { line: number; character: number };\n end: { line: number; character: number };\n}\n\n// from/to are columns within this line; order preserves outer-to-inner nesting.\ninterface LineDecorationRange {\n decoration: LineDecoration;\n order: number;\n from: number;\n to: number;\n}\n\ninterface DecorationBoundary {\n position: number;\n range: LineDecorationRange;\n start: boolean;\n}\n\n/**\n * Converts highlighted tokens to one HAST element per line for custom renderers.\n * Callers provide any line separators and enclosing pre/code elements.\n */\nexport function renderTokenLines(\n lines: ThemedToken[][],\n {\n state,\n lazyLineAST = false,\n cacheHtmlStyles = false,\n useTokenTransformer = false,\n mergeWhitespaces = 'always',\n decorations = [],\n lineOffsets = [],\n }: RenderTokenLinesOptions\n): ElementContent[] {\n let decorationsByLine: Map<number, LineDecoration[]> | undefined;\n for (const decoration of decorations) {\n const byLine = (decorationsByLine ??= new Map());\n const normalized: LineDecoration = {\n ...decoration,\n start: getDecorationPosition(decoration.start, lineOffsets),\n end: getDecorationPosition(decoration.end, lineOffsets),\n };\n const lastLine = Math.min(normalized.end.line, lines.length - 1);\n for (let line = normalized.start.line; line <= lastLine; line++) {\n let spans = byLine.get(line);\n if (spans == null) byLine.set(line, (spans = []));\n spans.push(normalized);\n }\n }\n const renderLine = (tokens: ThemedToken[], lineIndex: number) => {\n let normalized: ThemedToken[] | undefined;\n if (useTokenTransformer || mergeWhitespaces !== 'never') {\n let pendingWhitespace = '';\n let whitespaceOffset = 0;\n for (let i = 0; i < tokens.length; i++) {\n let token = tokens[i];\n if (useTokenTransformer) {\n const content = token.content.trim();\n if (content !== '' && content !== token.content) {\n normalized ??= tokens.slice(0, i);\n const start = token.content.indexOf(content);\n if (start > 0)\n normalized.push({\n content: token.content.slice(0, start),\n offset: token.offset,\n });\n normalized.push({\n ...token,\n content,\n offset: token.offset + start,\n });\n const end = start + content.length;\n if (end < token.content.length)\n normalized.push({\n content: token.content.slice(end),\n offset: token.offset + end,\n });\n continue;\n }\n } else {\n const decoratedWhitespace = ((token.fontStyle ?? 0) & 12) !== 0;\n if (\n !decoratedWhitespace &&\n /^\\s+$/.test(token.content) &&\n i < tokens.length - 1\n ) {\n normalized ??= tokens.slice(0, i);\n if (pendingWhitespace === '') whitespaceOffset = token.offset;\n pendingWhitespace += token.content;\n continue;\n }\n if (pendingWhitespace !== '' && normalized != null) {\n if (decoratedWhitespace)\n normalized.push({\n content: pendingWhitespace,\n offset: whitespaceOffset,\n });\n else\n token = {\n ...token,\n content: pendingWhitespace + token.content,\n offset: whitespaceOffset,\n };\n pendingWhitespace = '';\n }\n }\n normalized?.push(token);\n }\n }\n normalized ??= tokens;\n const line: Element = {\n type: 'element',\n tagName: state == null ? 'span' : 'div',\n properties: state == null ? { class: 'line' } : {},\n children: [],\n };\n const spans = decorationsByLine?.get(lineIndex);\n const column =\n spans == null\n ? appendTokens(line, normalized, useTokenTransformer, cacheHtmlStyles)\n : appendDecoratedTokens(\n line,\n normalized,\n spans,\n lineIndex,\n useTokenTransformer,\n cacheHtmlStyles\n );\n if (useTokenTransformer && column === 0) {\n line.children.push({\n type: 'element',\n tagName: 'br',\n properties: {},\n children: [],\n });\n }\n // Undecorated tokens already have one span per editor position.\n if (useTokenTransformer && spans != null) wrapTokenFragments(line);\n return state == null ? line : processLine(line, lineIndex + 1, state);\n };\n if (!lazyLineAST) return lines.map(renderLine);\n const rows: ElementContent[] = new Array(lines.length);\n for (let index = 0; index < lines.length; index++) {\n // Warning: capture one line, not `lines`; unbuilt rows would keep every\n // line's tokens alive.\n const tokens = lines[index];\n setDeferredArrayItem(rows, index, () => renderLine(tokens, index));\n }\n return rows;\n}\n\n// Returns the line length in UTF-16 code units.\nfunction appendTokens(\n line: Element,\n tokens: ThemedToken[],\n useTokenTransformer: boolean,\n cacheHtmlStyles: boolean\n): number {\n let column = 0;\n for (const token of tokens) {\n if (token.content === '') continue;\n line.children.push(\n createTokenSpan(\n token,\n tokenStyle(token, cacheHtmlStyles),\n token.content,\n column,\n useTokenTransformer\n )\n );\n column += token.content.length;\n }\n return column;\n}\n\n// Visit sorted boundaries once to avoid scanning every decoration per token.\n// Emit empty ranges before text at the same position.\nfunction appendDecoratedTokens(\n line: Element,\n tokens: ThemedToken[],\n spans: LineDecoration[],\n lineIndex: number,\n useTokenTransformer: boolean,\n cacheHtmlStyles: boolean\n): number {\n // Open outer ranges first, regardless of their order in the input.\n if (spans.length > 1)\n spans.sort((a, b) => {\n if (a.start.line !== b.start.line) return a.start.line - b.start.line;\n if (a.start.character !== b.start.character)\n return a.start.character - b.start.character;\n if (a.end.line !== b.end.line) return b.end.line - a.end.line;\n return b.end.character - a.end.character;\n });\n const lineLength = tokens.reduce(\n (length, token) => length + token.content.length,\n 0\n );\n const boundaries: DecorationBoundary[] = [];\n for (let order = 0; order < spans.length; order++) {\n const decoration = spans[order];\n const range: LineDecorationRange = {\n decoration,\n order,\n from:\n decoration.start.line === lineIndex ? decoration.start.character : 0,\n to:\n decoration.end.line === lineIndex\n ? decoration.end.character\n : lineLength,\n };\n boundaries.push(\n {\n position: Math.max(0, Math.min(range.from, lineLength)),\n range,\n start: true,\n },\n {\n position: Math.max(0, Math.min(range.to, lineLength)),\n range,\n start: false,\n }\n );\n }\n boundaries.sort((a, b) => a.position - b.position);\n const active: LineDecorationRange[] = [];\n const decorationStack: { range: LineDecorationRange; node: Element }[] = [];\n let boundaryIndex = 0;\n\n // Keep the same outer-to-inner order even when decorations cross each other.\n const updateActive = (range: LineDecorationRange, add: boolean): void => {\n let low = 0;\n let high = active.length;\n while (low < high) {\n const middle = (low + high) >>> 1;\n if (active[middle].order < range.order) low = middle + 1;\n else high = middle;\n }\n if (add) active.splice(low, 0, range);\n else if (active[low] === range) active.splice(low, 1);\n };\n\n // Reuse wrappers across tokens so a continuous range stays in one element.\n const getParent = (): Element => {\n let parent = line;\n let depth = 0;\n for (const range of active) {\n if (decorationStack[depth]?.range !== range) {\n decorationStack.length = depth;\n const wrapper: Element = {\n type: 'element',\n tagName: 'span',\n properties: { ...range.decoration.properties },\n children: [],\n };\n parent.children.push(wrapper);\n decorationStack.push({ range, node: wrapper });\n }\n parent = decorationStack[depth++].node;\n }\n decorationStack.length = depth;\n return parent;\n };\n\n let parent = line;\n\n // Markers belong inside ranges starting here, except at the line end,\n // where they belong inside ranges ending here.\n const advanceBoundary = (position: number): void => {\n const first = boundaryIndex;\n while (boundaries[boundaryIndex]?.position === position) boundaryIndex++;\n let hasMarker = false;\n for (let i = first; i < boundaryIndex; i++) {\n const { range, start } = boundaries[i];\n if (!start && range.from !== range.to && position < lineLength)\n updateActive(range, false);\n }\n for (let i = first; i < boundaryIndex; i++) {\n const { range, start } = boundaries[i];\n if (\n start &&\n range.from <= position &&\n range.to >= position &&\n (range.to > position ||\n range.from === position ||\n position === lineLength)\n ) {\n updateActive(range, true);\n if (range.from === range.to) hasMarker = true;\n }\n }\n if (hasMarker) {\n getParent();\n for (let i = first; i < boundaryIndex; i++) {\n const { range, start } = boundaries[i];\n if (start && range.from === range.to) updateActive(range, false);\n }\n }\n if (position < lineLength) parent = getParent();\n };\n\n let column = 0;\n for (const token of tokens) {\n if (token.content === '') continue;\n const start = column;\n const end = start + token.content.length;\n const style = tokenStyle(token, cacheHtmlStyles);\n while (column < end) {\n if (boundaries[boundaryIndex]?.position === column)\n advanceBoundary(column);\n const to = Math.min(end, boundaries[boundaryIndex]?.position ?? end);\n parent.children.push(\n createTokenSpan(\n token,\n style,\n column === start && to === end\n ? token.content\n : token.content.slice(column - start, to - start),\n start,\n useTokenTransformer\n )\n );\n column = to;\n }\n }\n if (boundaries[boundaryIndex]?.position === column) advanceBoundary(column);\n return column;\n}\n\n// data-char must retain the original token column when decorations split it.\nfunction createTokenSpan(\n token: ThemedToken,\n style: string,\n text: string,\n start: number,\n useTokenTransformer: boolean\n): Element {\n const properties: Properties =\n token.htmlAttrs != null ? { ...token.htmlAttrs } : {};\n if (style !== '') properties.style = style;\n if (useTokenTransformer) properties['data-char'] = start;\n return {\n type: 'element',\n tagName: 'span',\n properties,\n children: [{ type: 'text', value: text }],\n };\n}\n\n// Convert absolute UTF-16 offsets to the line coordinates used by decorations.\nfunction getDecorationPosition(\n position: DecorationItem['start'],\n lineOffsets: number[]\n): { line: number; character: number } {\n if (typeof position !== 'number') return position;\n let low = 0;\n let high = lineOffsets.length;\n while (low + 1 < high) {\n const middle = (low + high) >>> 1;\n if (lineOffsets[middle] <= position) low = middle;\n else high = middle;\n }\n return { line: low, character: position - (lineOffsets[low] ?? 0) };\n}\n", "import type { Element, Root } from 'hast';\n\nimport type { CodeToHtmlOptions, TokensResult } from '../types';\nimport { hastToHtml } from './hastToHtml';\nimport { renderTokenLines } from './renderTokenLines';\n\n/**\n * Renders existing tokens as a pre/code HTML block without highlighting again.\n * Pass the original source to resolve numeric decoration offsets.\n */\nexport function tokensToHtml(\n source: string,\n result: TokensResult,\n options: CodeToHtmlOptions,\n cacheHtmlStyles: boolean = false\n): string {\n const lineOffsets = [0];\n if (\n options.decorations?.some(\n (item) => typeof item.start === 'number' || typeof item.end === 'number'\n ) === true\n ) {\n for (\n let index = source.indexOf('\\n');\n index !== -1;\n index = source.indexOf('\\n', index + 1)\n )\n lineOffsets.push(index + 1);\n }\n const code: Element = {\n type: 'element',\n tagName: 'code',\n properties: {},\n children: [],\n };\n const lines = renderTokenLines(result.tokens, {\n decorations: options.decorations,\n mergeWhitespaces: options.mergeWhitespaces,\n lineOffsets,\n cacheHtmlStyles,\n });\n for (let i = 0; i < lines.length; i++) {\n if (i > 0) code.children.push({ type: 'text', value: '\\n' });\n code.children.push(lines[i]);\n }\n const root: Root = {\n type: 'root',\n children: [\n {\n type: 'element',\n tagName: 'pre',\n properties: {\n class: 'diffs',\n style:\n result.rootStyle === false\n ? undefined\n : (result.rootStyle ??\n [\n result.fg != null ? `color:${result.fg}` : '',\n result.bg != null ? `background-color:${result.bg}` : '',\n ]\n .filter(Boolean)\n .join(';')),\n tabIndex: 0,\n },\n children: [code],\n },\n ],\n };\n return hastToHtml(root);\n}\n", "// Appends every entry of `items` onto `target` one at a time. Deliberately not\n// `target.push(...items)`: a spread passes one argument per entry and engines\n// cap argument counts (V8 near 124k, JavaScriptCore near 639k), so spreading a\n// line-sized array such as the rows of a massive hunk throws a RangeError.\nexport function appendItems<T>(target: T[], items: readonly T[]): void {\n for (const item of items) {\n target.push(item);\n }\n}\n"],
5
+ "mappings": ";;;;;;;;AAEA,SAAgB,kBAA2B;AACzC,SACE,OAAO,sBAAsB,eAC7B,OAAO,SAAS,eAChB,gBAAgB;AAEpB;;;ACRA,SAAgB,mBACd,QACsB;AACtB,MAAI;AACJ,SAAA,MACG,WAAW,OAAO,EAAE,KAAA,CAClB,WAAW;AACV,aAAS;AACT,WAAO;EACT,GAAA,CACC,UAAmB;AAClB,aAAS;AACT,UAAM;EACR,CACF;AACJ;;;ACgEA,IAAa,sBAAb,cAAyC,MAAM;EAC7C,YAAY,MAAc;AACxB,UAAM,UAAU,IAAA,yBAA6B;AAC7C,SAAK,OAAO;EACd;AACF;AAGA,IAAa,yBAAb,cAA4C,MAAM;EAChD,YAAY,MAAc;AACxB,UAAM,mCAAmC,IAAA,GAAO;AAChD,SAAK,OAAO;EACd;AACF;AAKA,IAAa,uBAAb,cAA0C,MAAM;EAC9C,YAAY,MAAc;AACxB,UAAM,UAAU,IAAA,yBAA6B;AAC7C,SAAK,OAAO;EACd;AACF;AAKA,SAAgB,oBACd,UAAwC,CAAC,GAClB;AAEvB,QAAM,UAAU,oBAAI,IAAiC;AAGrD,QAAM,WAAW,oBAAI,IAAoB;AAIzC,QAAM,WAAW,oBAAI,IAA6B;AAKlD,MAAI,kBAAkB;AAEtB,WAAS,cAAc,MAAc,QAAmC;AACtE,QAAI,QAAQ,IAAI,IAAI,EAClB,OAAM,IAAI,oBAAoB,IAAI;AAEpC,YAAQ,IAAI,MAAM,MAAM;EAC1B;AAEA,WAAS,sBACP,MACA,QACS;AACT,QAAI,QAAQ,IAAI,IAAI,EAAG,QAAO;AAC9B,YAAQ,IAAI,MAAM,MAAM;AACxB,WAAO;EAC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,IAC3C,OAAO,MAAM,OAAO,oBAAoB,OAAO,EAAA,KAAO,EACxD,EACG,OAAO,OAAO,EACd,KAAK,GAAG;QACjB,UAAU;MACZ;MACA,UAAU,CAAC,IAAI;IACjB,CACF;EACF;AACA,SAAO,WAAWA,KAAI;AACxB;;;AClEA,SAAgB,YAAe,QAAa,OAA2B;AACrE,aAAW,QAAQ,MACjB,QAAO,KAAK,IAAI;AAEpB;",
6
6
  "names": ["raw", "key", "core", "key", "html", "svg", "key", "one", "all", "own", "stringify", "increment", "siblings", "own", "html", "body", "html", "tbody", "head", "child", "svg", "key", "stringify", "emptyChildren", "svg", "html", "html", "key", "serializeAttributes", "create", "style", "parent", "text", "root"]
7
7
  }