@blinkk/root 3.2.2 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/build-worker.js +2 -2
  2. package/dist/{chunk-KW7KTYGC.js → chunk-6QWKKJOB.js} +40 -9
  3. package/dist/chunk-6QWKKJOB.js.map +7 -0
  4. package/dist/{chunk-45M5ANS7.js → chunk-BZOYNXPF.js} +9 -2
  5. package/dist/{chunk-45M5ANS7.js.map → chunk-BZOYNXPF.js.map} +2 -2
  6. package/dist/{chunk-M3E4RKS7.js → chunk-DLPHCMFV.js} +43 -5
  7. package/dist/chunk-DLPHCMFV.js.map +7 -0
  8. package/dist/{chunk-YU22SAIG.js → chunk-QJ4F45DC.js} +2 -2
  9. package/dist/{chunk-WGQNQPWG.js → chunk-WRZLI2L2.js} +25 -12
  10. package/dist/chunk-WRZLI2L2.js.map +7 -0
  11. package/dist/{chunk-KHO3HMX6.js → chunk-Y4H75NIO.js} +8 -5
  12. package/dist/chunk-Y4H75NIO.js.map +7 -0
  13. package/dist/cli.js +4 -4
  14. package/dist/core/config.d.ts +16 -0
  15. package/dist/core/core.d.ts +1 -0
  16. package/dist/core/hooks/useAssetMap.d.ts +22 -0
  17. package/dist/core.js +7 -1
  18. package/dist/core.js.map +2 -2
  19. package/dist/functions/server.d.ts +1 -1
  20. package/dist/functions.js +4 -4
  21. package/dist/jsx.js +1 -1
  22. package/dist/node.js +2 -2
  23. package/dist/render/asset-map/asset-map.d.ts +8 -1
  24. package/dist/render/asset-map/build-asset-map.d.ts +8 -1
  25. package/dist/render/asset-map/dev-asset-map.d.ts +7 -1
  26. package/dist/render/render.d.ts +3 -1
  27. package/dist/render.js +22 -6
  28. package/dist/render.js.map +2 -2
  29. package/package.json +31 -32
  30. package/dist/chunk-KHO3HMX6.js.map +0 -7
  31. package/dist/chunk-KW7KTYGC.js.map +0 -7
  32. package/dist/chunk-M3E4RKS7.js.map +0 -7
  33. package/dist/chunk-WGQNQPWG.js.map +0 -7
  34. /package/dist/{chunk-YU22SAIG.js.map → chunk-QJ4F45DC.js.map} +0 -0
@@ -2,11 +2,11 @@ import {
2
2
  BuildAssetMap,
3
3
  ElementGraph,
4
4
  buildPage
5
- } from "./chunk-M3E4RKS7.js";
5
+ } from "./chunk-DLPHCMFV.js";
6
6
  import {
7
7
  loadBundledConfig,
8
8
  loadJson
9
- } from "./chunk-KHO3HMX6.js";
9
+ } from "./chunk-Y4H75NIO.js";
10
10
  import "./chunk-3PWR4F2R.js";
11
11
 
12
12
  // src/cli/build-worker.ts
@@ -14,13 +14,40 @@ var Html = ({ children, ...attrs }) => {
14
14
  return /* @__PURE__ */ jsx(Fragment, { children });
15
15
  };
16
16
 
17
- // src/core/hooks/useI18nContext.ts
18
- import path from "node:path";
17
+ // src/core/hooks/useAssetMap.ts
19
18
  import { createContext as createContext2 } from "preact";
20
19
  import { useContext as useContext2 } from "preact/hooks";
21
- var I18N_CONTEXT = createContext2(null);
20
+ var ASSET_MAP_CONTEXT = createContext2(null);
21
+ function useAssetMap() {
22
+ const assetMap = useContext2(ASSET_MAP_CONTEXT);
23
+ if (!assetMap) {
24
+ throw new Error("ASSET_MAP_CONTEXT not found");
25
+ }
26
+ return assetMap;
27
+ }
28
+ function useAsset(src) {
29
+ const normalizedSrc = src.replace(/^\/+/, "");
30
+ const asset = useAssetMap().get(normalizedSrc);
31
+ if (!asset) {
32
+ throw new Error(`asset not found: ${src}`);
33
+ }
34
+ return asset;
35
+ }
36
+ function useAssetUrl(src) {
37
+ const assetUrl = useAsset(src).assetUrl;
38
+ if (!assetUrl) {
39
+ throw new Error(`asset not found: ${src}`);
40
+ }
41
+ return assetUrl;
42
+ }
43
+
44
+ // src/core/hooks/useI18nContext.ts
45
+ import path from "node:path";
46
+ import { createContext as createContext3 } from "preact";
47
+ import { useContext as useContext3 } from "preact/hooks";
48
+ var I18N_CONTEXT = createContext3(null);
22
49
  function useI18nContext() {
23
- const context = useContext2(I18N_CONTEXT);
50
+ const context = useContext3(I18N_CONTEXT);
24
51
  if (!context) {
25
52
  throw new Error("I18N_CONTEXT not found");
26
53
  }
@@ -43,11 +70,11 @@ function getTranslations(locale) {
43
70
  }
44
71
 
45
72
  // src/core/hooks/useRequestContext.ts
46
- import { createContext as createContext3 } from "preact";
47
- import { useContext as useContext3 } from "preact/hooks";
48
- var REQUEST_CONTEXT = createContext3(null);
73
+ import { createContext as createContext4 } from "preact";
74
+ import { useContext as useContext4 } from "preact/hooks";
75
+ var REQUEST_CONTEXT = createContext4(null);
49
76
  function useRequestContext() {
50
- const context = useContext3(REQUEST_CONTEXT);
77
+ const context = useContext4(REQUEST_CONTEXT);
51
78
  if (!context) {
52
79
  throw new Error("REQUEST_CONTEXT not found");
53
80
  }
@@ -78,6 +105,10 @@ function testPathHasParams(urlPath) {
78
105
  export {
79
106
  HTML_CONTEXT,
80
107
  Html,
108
+ ASSET_MAP_CONTEXT,
109
+ useAssetMap,
110
+ useAsset,
111
+ useAssetUrl,
81
112
  I18N_CONTEXT,
82
113
  useI18nContext,
83
114
  getTranslations,
@@ -86,4 +117,4 @@ export {
86
117
  replaceParams,
87
118
  testPathHasParams
88
119
  };
89
- //# sourceMappingURL=chunk-KW7KTYGC.js.map
120
+ //# sourceMappingURL=chunk-6QWKKJOB.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/core/components/Html.tsx", "../src/core/hooks/useAssetMap.ts", "../src/core/hooks/useI18nContext.ts", "../src/core/hooks/useRequestContext.ts", "../src/utils/url-path-params.ts"],
4
+ "sourcesContent": ["import {ComponentChildren, FunctionalComponent, createContext} from 'preact';\nimport {useContext} from 'preact/hooks';\n\nexport interface HtmlContext {\n htmlAttrs: preact.JSX.HTMLAttributes<HTMLHtmlElement>;\n headAttrs: preact.JSX.HTMLAttributes<HTMLHeadElement>;\n headComponents: ComponentChildren[];\n bodyAttrs: preact.JSX.HTMLAttributes<HTMLBodyElement>;\n scriptDeps: Array<preact.JSX.ScriptHTMLAttributes<HTMLScriptElement>>;\n}\n\nexport const HTML_CONTEXT = createContext<HtmlContext | null>(null);\n\nexport type HtmlProps = preact.JSX.HTMLAttributes<HTMLHtmlElement> & {\n children?: ComponentChildren;\n};\n\n/**\n * The `<Html>` component can be used to update attrs in the `<html>` tag.\n *\n * Usage:\n *\n * ```tsx\n * <Html lang=\"en-US\">\n * <h1>Hello world</h1>\n * </Html>\n * ```\n */\nexport const Html: FunctionalComponent<HtmlProps> = ({children, ...attrs}) => {\n const context = useContext(HTML_CONTEXT);\n if (!context) {\n throw new Error(\n 'HTML_CONTEXT not found, double-check usage of the <Html> component'\n );\n }\n context.htmlAttrs = attrs;\n return <>{children}</>;\n};\n", "import {createContext} from 'preact';\nimport {useContext} from 'preact/hooks';\nimport type {Asset, AssetMap} from '../../render/asset-map/asset-map.js';\n\nexport const ASSET_MAP_CONTEXT = createContext<AssetMap | null>(null);\n\n/**\n * Returns the asset map for the current render.\n */\nexport function useAssetMap(): AssetMap {\n const assetMap = useContext(ASSET_MAP_CONTEXT);\n if (!assetMap) {\n throw new Error('ASSET_MAP_CONTEXT not found');\n }\n return assetMap;\n}\n\n/**\n * Returns an asset from the project's module graph. Paths are relative to the\n * project root and may optionally start with `/`.\n */\nexport function useAsset(src: string): Asset {\n const normalizedSrc = src.replace(/^\\/+/, '');\n const asset = useAssetMap().get(normalizedSrc);\n if (!asset) {\n throw new Error(`asset not found: ${src}`);\n }\n return asset;\n}\n\n/**\n * Returns the serving URL for a file compiled from the project's module graph.\n *\n * Usage:\n *\n * ```tsx\n * const customJs = useAssetUrl('/bundles/foo.ts');\n * return <div data-custom-js={customJs} />;\n * ```\n */\nexport function useAssetUrl(src: string): string {\n const assetUrl = useAsset(src).assetUrl;\n if (!assetUrl) {\n throw new Error(`asset not found: ${src}`);\n }\n return assetUrl;\n}\n", "import path from 'node:path';\nimport {createContext} from 'preact';\nimport {useContext} from 'preact/hooks';\n\nexport const I18N_CONTEXT = createContext<I18nContext | null>(null);\n\nexport interface I18nContext {\n locale: string;\n translations: Record<string, string>;\n}\n\n/**\n * A hook that returns information about the current i18n context, including the\n * locale for the given route and a map of translations for that locale.\n */\nexport function useI18nContext() {\n const context = useContext(I18N_CONTEXT);\n if (!context) {\n throw new Error('I18N_CONTEXT not found');\n }\n return context;\n}\n\nexport function getTranslations(locale: string): Record<string, string> {\n const translations: Record<string, Record<string, string>> = {};\n const translationsFiles = import.meta.glob(['/translations/*.json'], {\n eager: true,\n }) as Record<string, {default?: Record<string, string>}>;\n Object.keys(translationsFiles).forEach((translationPath) => {\n const parts = path.parse(translationPath);\n const locale = parts.name;\n const module = translationsFiles[translationPath];\n if (module && module.default) {\n translations[locale] = module.default;\n }\n });\n return translations[locale] || {};\n}\n", "import {createContext} from 'preact';\nimport {useContext} from 'preact/hooks';\nimport {Route} from '../types.js';\n\nexport interface RequestContext {\n /**\n * The current request path, e.g. `/foo/bar` (default route path) or\n * `/{locale}/foo/bar` (localized route path).\n */\n currentPath: string;\n /** The route file. */\n route: Route;\n /**\n * Route param values. E.g. for a route like `routes/blog/[slug].tsx`,\n * visiting `/blog/foo` will pass {slug: 'foo'} here.\n */\n routeParams: Record<string, string>;\n /** Props passed to the route's server component. */\n props: any;\n /** The current locale. */\n locale: string;\n /** Translations map for the current locale. */\n translations: Record<string, string>;\n /** CSP nonce value. */\n nonce?: string;\n}\n\nexport const REQUEST_CONTEXT = createContext<RequestContext | null>(null);\n\n/**\n * A hook that returns information about the current route.\n *\n * Usage:\n *\n * ```ts\n * const ctx = useRequestContext();\n * ctx.route.src;\n * // => 'routes/index.tsx'\n * ```\n */\nexport function useRequestContext() {\n const context = useContext(REQUEST_CONTEXT);\n if (!context) {\n throw new Error('REQUEST_CONTEXT not found');\n }\n return context;\n}\n", "export function replaceParams(\n urlPathFormat: string,\n params: Record<string, string>\n) {\n const urlPath = urlPathFormat.replaceAll(\n /\\[\\[?(\\.\\.\\.)?([\\w\\-_]*)\\]?\\]/g,\n (match: string, _wildcard: string, key: string) => {\n const val = params[key];\n if (!val) {\n throw new Error(`unreplaced param ${match} in url: ${urlPathFormat}`);\n }\n return val;\n }\n );\n return urlPath;\n}\n\nexport function testPathHasParams(urlPath: string) {\n const segments = urlPath.split('/');\n return segments.some((segment) => {\n return segment.startsWith('[') && segment.includes(']');\n });\n}\n"],
5
+ "mappings": ";AAAA,SAAgD,qBAAoB;AACpE,SAAQ,kBAAiB;AAmChB;AAzBF,IAAM,eAAe,cAAkC,IAAI;AAiB3D,IAAM,OAAuC,CAAC,EAAC,UAAU,GAAG,MAAK,MAAM;AAC5E,QAAM,UAAU,WAAW,YAAY;AACvC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,UAAQ,YAAY;AACpB,SAAO,gCAAG,UAAS;AACrB;;;ACrCA,SAAQ,iBAAAA,sBAAoB;AAC5B,SAAQ,cAAAC,mBAAiB;AAGlB,IAAM,oBAAoBD,eAA+B,IAAI;AAK7D,SAAS,cAAwB;AACtC,QAAM,WAAWC,YAAW,iBAAiB;AAC7C,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,MAAM,6BAA6B;AAAA,EAC/C;AACA,SAAO;AACT;AAMO,SAAS,SAAS,KAAoB;AAC3C,QAAM,gBAAgB,IAAI,QAAQ,QAAQ,EAAE;AAC5C,QAAM,QAAQ,YAAY,EAAE,IAAI,aAAa;AAC7C,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,MAAM,oBAAoB,GAAG,EAAE;AAAA,EAC3C;AACA,SAAO;AACT;AAYO,SAAS,YAAY,KAAqB;AAC/C,QAAM,WAAW,SAAS,GAAG,EAAE;AAC/B,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,MAAM,oBAAoB,GAAG,EAAE;AAAA,EAC3C;AACA,SAAO;AACT;;;AC9CA,OAAO,UAAU;AACjB,SAAQ,iBAAAC,sBAAoB;AAC5B,SAAQ,cAAAC,mBAAiB;AAElB,IAAM,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AK,QAAQ,SAAS,GAAG;AAAA,EACxD,CAAC;AACH;",
6
+ "names": ["createContext", "useContext", "createContext", "useContext", "locale", "createContext", "useContext"]
7
+ }
@@ -536,7 +536,14 @@ function renderJsxToString(vnode, options) {
536
536
  if (isTextarea && (key === "value" || key === "defaultValue")) {
537
537
  continue;
538
538
  }
539
- const attrName = PROP_TO_ATTR[key] || key;
539
+ let attrName = key;
540
+ const aliasedName = PROP_TO_ATTR[key];
541
+ if (isDef(aliasedName)) {
542
+ if (isDef(props[aliasedName])) {
543
+ continue;
544
+ }
545
+ attrName = aliasedName;
546
+ }
540
547
  const valueType = typeof value;
541
548
  if (valueType === "string") {
542
549
  result += " " + attrName + '="' + escapeAttr(value) + '"';
@@ -704,4 +711,4 @@ function noop() {
704
711
  export {
705
712
  renderJsxToString
706
713
  };
707
- //# sourceMappingURL=chunk-45M5ANS7.js.map
714
+ //# sourceMappingURL=chunk-BZOYNXPF.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/jsx/jsx-render.ts"],
4
- "sourcesContent": ["/* eslint-disable n/no-extraneous-import */\nimport {options as preactOptions} from 'preact';\nimport {VNode, Fragment} from './jsx-runtime.js';\n\n/** HTML void elements (self-closing, no end tag). */\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n]);\n\n/** Tags whose text content may contain literal newlines that should not be treated as block-child indicators. */\nconst RAW_CONTENT_ELEMENTS = new Set(['pre', 'textarea', 'script', 'style']);\n\n/**\n * Standard HTML block-level elements. Also includes the `<select>` content\n * model (`select`/`optgroup`/`option`) so that each `<option>` renders on its\n * own line in pretty mode, even though those tags aren't block-level per CSS.\n */\nconst DEFAULT_BLOCK_ELEMENTS = new Set([\n 'address',\n 'article',\n 'aside',\n 'base',\n 'blockquote',\n 'body',\n 'dd',\n 'details',\n 'dialog',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'li',\n 'link',\n 'main',\n 'meta',\n 'nav',\n 'noscript',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'pre',\n 'script',\n 'search',\n 'section',\n 'select',\n 'style',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'ul',\n]);\n\n/**\n * Non-visual metadata and resource elements. These produce no inline rendered\n * content, so in pretty mode they always start on their own line \u2014 even inside\n * a parent with mixed text/element children, where the inline heuristic would\n * otherwise keep all siblings on a single line. (`base`/`link`/`meta` are void;\n * `script`/`style`/`title` render no visible text.)\n */\nconst ALWAYS_BLOCK_ELEMENTS = new Set([\n 'base',\n 'link',\n 'meta',\n 'script',\n 'style',\n 'title',\n]);\n\n// Combined per-tag classification flags for the pretty-mode renderer. Each\n// element in `renderElement` needs to know whether a tag is void, an\n// always-block element, a raw-content element, and a default block-level\n// element. These classifications are static (they never depend on render\n// options), so they are precomputed into a single `Map<tag, bitmask>` lookup \u2014\n// one hash probe per element instead of four separate `Set.has` probes. Tags\n// absent from the map (the common inline elements like `span`/`a`/`em`) return\n// `undefined`, treated as flags 0. Runtime-configured block elements\n// (`options.blockElements`) are handled by a separate, usually-absent set so\n// the common path stays a single lookup.\nconst TAG_FLAG_VOID = 1;\nconst TAG_FLAG_ALWAYS_BLOCK = 2;\nconst TAG_FLAG_RAW = 4;\nconst TAG_FLAG_BLOCK = 8;\nconst TAG_STATIC_FLAGS = new Map<string, number>();\nfor (const t of VOID_ELEMENTS) {\n TAG_STATIC_FLAGS.set(t, (TAG_STATIC_FLAGS.get(t) || 0) | TAG_FLAG_VOID);\n}\nfor (const t of ALWAYS_BLOCK_ELEMENTS) {\n TAG_STATIC_FLAGS.set(\n t,\n (TAG_STATIC_FLAGS.get(t) || 0) | TAG_FLAG_ALWAYS_BLOCK\n );\n}\nfor (const t of RAW_CONTENT_ELEMENTS) {\n TAG_STATIC_FLAGS.set(t, (TAG_STATIC_FLAGS.get(t) || 0) | TAG_FLAG_RAW);\n}\nfor (const t of DEFAULT_BLOCK_ELEMENTS) {\n TAG_STATIC_FLAGS.set(t, (TAG_STATIC_FLAGS.get(t) || 0) | TAG_FLAG_BLOCK);\n}\n\n/**\n * HTML/SVG boolean attributes.\n * When present with a truthy value, render as a minimized attribute.\n */\nconst BOOLEAN_ATTRS = new Set([\n 'allowfullscreen',\n 'async',\n 'autofocus',\n 'autoplay',\n 'capture',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'disablepictureinpicture',\n 'disableremoteplayback',\n 'download',\n 'draggable',\n 'formnovalidate',\n 'hidden',\n 'inert',\n 'ismap',\n 'itemscope',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'popover',\n 'readonly',\n 'required',\n 'reversed',\n 'selected',\n]);\n\n/**\n * Enumerated attributes that have no boolean form. When written as a bare JSX\n * prop (e.g. `<link crossorigin />`, which Preact passes as `true`), rendering\n * `=\"true\"` would be an invalid value, so emit the attribute's spec-defined\n * default instead. For `crossorigin` the missing/invalid-value default is\n * `anonymous`.\n *\n * Keyed by HTML attribute name (post-`PROP_TO_ATTR` remapping). A\n * null-prototype object so the common \"not enumerated\" lookup misses without\n * walking `Object.prototype`.\n */\nconst ENUMERATED_ATTR_TRUE_DEFAULTS: Record<string, string> = Object.assign(\n Object.create(null),\n {\n crossorigin: 'anonymous',\n }\n);\n\n/**\n * JSX prop name -> HTML attribute name.\n *\n * A null-prototype object so that the very common \"no remapping needed\" lookup\n * (`class`, `href`, `id`, `data-*`, `aria-*`, etc., none of which are keys here)\n * misses without walking the `Object.prototype` chain. `renderAttrs` performs\n * one lookup per attribute, so for attribute-heavy trees this is a hot path.\n */\nconst PROP_TO_ATTR: Record<string, string> = Object.assign(\n Object.create(null),\n {\n acceptCharset: 'accept-charset',\n autoCapitalize: 'autocapitalize',\n autoComplete: 'autocomplete',\n autoFocus: 'autofocus',\n autoPlay: 'autoplay',\n charSet: 'charset',\n className: 'class',\n colSpan: 'colspan',\n contentEditable: 'contenteditable',\n crossOrigin: 'crossorigin',\n dateTime: 'datetime',\n disablePictureInPicture: 'disablepictureinpicture',\n disableRemotePlayback: 'disableremoteplayback',\n encType: 'enctype',\n formAction: 'formaction',\n formEncType: 'formenctype',\n formMethod: 'formmethod',\n formNoValidate: 'formnovalidate',\n formTarget: 'formtarget',\n frameBorder: 'frameborder',\n hrefLang: 'hreflang',\n htmlFor: 'for',\n httpEquiv: 'http-equiv',\n inputMode: 'inputmode',\n itemProp: 'itemprop',\n itemRef: 'itemref',\n itemScope: 'itemscope',\n itemType: 'itemtype',\n maxLength: 'maxlength',\n mediaGroup: 'mediagroup',\n minLength: 'minlength',\n noModule: 'nomodule',\n noValidate: 'novalidate',\n playsInline: 'playsinline',\n readOnly: 'readonly',\n referrerPolicy: 'referrerpolicy',\n rowSpan: 'rowspan',\n spellCheck: 'spellcheck',\n srcDoc: 'srcdoc',\n srcLang: 'srclang',\n srcSet: 'srcset',\n tabIndex: 'tabindex',\n useMap: 'usemap',\n\n // SVG presentation attributes (camelCase -> kebab-case).\n clipPath: 'clip-path',\n clipRule: 'clip-rule',\n colorInterpolation: 'color-interpolation',\n colorInterpolationFilters: 'color-interpolation-filters',\n dominantBaseline: 'dominant-baseline',\n fillOpacity: 'fill-opacity',\n fillRule: 'fill-rule',\n floodColor: 'flood-color',\n floodOpacity: 'flood-opacity',\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 paintOrder: 'paint-order',\n pointerEvents: 'pointer-events',\n shapeRendering: 'shape-rendering',\n stopColor: 'stop-color',\n stopOpacity: 'stop-opacity',\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 textAnchor: 'text-anchor',\n textDecoration: 'text-decoration',\n textRendering: 'text-rendering',\n transformOrigin: 'transform-origin',\n vectorEffect: 'vector-effect',\n wordSpacing: 'word-spacing',\n writingMode: 'writing-mode',\n }\n);\n\nconst AMP = '&amp;';\nconst LT = '&lt;';\nconst GT = '&gt;';\nconst QUOT = '&quot;';\n\n// Single-pass native prechecks for the common case where a string needs no\n// escaping (most class names, URLs, and text). `RegExp.test` scans in native\n// code, which is substantially faster than the JS `charCodeAt` loop below, so\n// strings that don't match return immediately without entering the loop.\nconst HTML_ESCAPE_RE = /[&<>]/;\nconst ATTR_ESCAPE_RE = /[&<>\"]/;\n\n// Shared empty object reused as the per-component context map when no contexts\n// have ever been pushed. Components only ever read from this map, so sharing is\n// safe and avoids a per-render allocation in the common case.\nconst EMPTY_GLOBAL_CTX: Record<string, any> = {};\n\n/** Returns `true` when `value` is neither `null` nor `undefined`. */\nfunction isDef<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined;\n}\n\nfunction escapeHtml(str: string): string {\n if (!HTML_ESCAPE_RE.test(str)) return str;\n let result = '';\n let last = 0;\n for (let i = 0; i < str.length; i++) {\n const ch = str.charCodeAt(i);\n let escaped: string | undefined;\n if (ch === 38) escaped = AMP;\n else if (ch === 60) escaped = LT;\n else if (ch === 62) escaped = GT;\n if (escaped) {\n result += str.slice(last, i) + escaped;\n last = i + 1;\n }\n }\n return result + str.slice(last);\n}\n\nfunction escapeAttr(str: string): string {\n if (!ATTR_ESCAPE_RE.test(str)) return str;\n let result = '';\n let last = 0;\n for (let i = 0; i < str.length; i++) {\n const ch = str.charCodeAt(i);\n let escaped: string | undefined;\n if (ch === 38) escaped = AMP;\n else if (ch === 34) escaped = QUOT;\n else if (ch === 60) escaped = LT;\n else if (ch === 62) escaped = GT;\n if (escaped) {\n result += str.slice(last, i) + escaped;\n last = i + 1;\n }\n }\n return result + str.slice(last);\n}\n\nconst STYLE_KEY_CACHE = new Map<string, string>();\nconst UPPERCASE_RE = /[A-Z]/g;\n\nfunction toKebabCase(key: string): string {\n let cached = STYLE_KEY_CACHE.get(key);\n if (cached === undefined) {\n cached = key.replace(UPPERCASE_RE, (m) => '-' + m.toLowerCase());\n STYLE_KEY_CACHE.set(key, cached);\n }\n return cached;\n}\n\nfunction styleToString(style: Record<string, any>): string {\n let result = '';\n let first = true;\n for (const key in style) {\n const value = style[key];\n if (!isDef(value) || value === '') continue;\n if (first) {\n first = false;\n } else {\n result += ';';\n }\n result += `${toKebabCase(key)}:${value}`;\n }\n return result;\n}\n\n/**\n * JSX render mode. `'pretty'` adds newlines around block elements; `'minimal'`\n * outputs compact HTML.\n */\nexport type JsxRenderMode = 'pretty' | 'minimal';\n\nexport interface JsxRenderOptions {\n /** Render mode. `'pretty'` adds newlines around block elements; `'minimal'` outputs compact HTML. Default: `'pretty'`. */\n mode?: JsxRenderMode;\n /** Additional tag names to treat as block-level elements in pretty mode. */\n blockElements?: string[];\n}\n\n/**\n * Renders a Preact VNode tree to an HTML string.\n */\nexport function renderJsxToString(\n vnode: VNode,\n options?: JsxRenderOptions\n): string {\n const mode = options?.mode ?? 'pretty';\n const isPretty = mode === 'pretty';\n // Default block-level elements are baked into the module-level\n // `TAG_STATIC_FLAGS` map (the `TAG_FLAG_BLOCK` bit), so the common case needs\n // no per-render set. Only when the caller supplies extra `blockElements` do we\n // build a small `customBlockSet` of just those additions; `renderElement`\n // consults it via a cheap \"is it defined?\" guard that is `undefined` (and so\n // skipped) in the common case.\n let customBlockSet: Set<string> | undefined;\n if (isPretty && options?.blockElements && options.blockElements.length > 0) {\n customBlockSet = new Set<string>();\n for (const el of options.blockElements) {\n // Only track elements that aren't already default block elements, so the\n // set stays empty (and the guard stays cheap) for redundant config.\n if (!DEFAULT_BLOCK_ELEMENTS.has(el)) {\n customBlockSet.add(el);\n }\n }\n if (customBlockSet.size === 0) {\n customBlockSet = undefined;\n }\n }\n\n // Context stacks: context.__c (id) -> value[]\n let contextStacks: Map<string, any[]> | undefined;\n\n // Version counter that bumps whenever a context value is pushed or popped.\n // `buildGlobalContext` uses it to skip rebuilding when nothing changed\n // between sibling component renders (the common case).\n let ctxVersion = 0;\n let cachedGlobalCtx: Record<string, any> = EMPTY_GLOBAL_CTX;\n let cachedGlobalCtxVersion = 0;\n\n // Side-channel reporting whether the most recently returned render string\n // contains a newline. Pretty mode uses this to decide whether a block\n // element's children start on their own line, instead of re-scanning the\n // element's concatenated inner HTML via `inner.includes('\\n')`. Because block\n // elements nest, that rescan walked the same characters once per enclosing\n // block level (O(html_size * block_depth)); threading the flag up makes it a\n // single pass. This is safe because rendering is fully synchronous and\n // single-pass: every code path assigns `nlFlag` before returning, and each\n // caller reads it immediately after the call, before the next call can\n // overwrite it. It is only meaningful in pretty mode; in minimal mode the\n // leaf scans are skipped and the value is never read.\n let nlFlag = false;\n\n function pushCtx(contextId: string, value: any) {\n if (!contextStacks) {\n contextStacks = new Map<string, any[]>();\n }\n let stack = contextStacks.get(contextId);\n if (!stack) {\n stack = [];\n contextStacks.set(contextId, stack);\n }\n stack.push(value);\n ctxVersion++;\n }\n\n function popCtx(contextId: string) {\n const stack = contextStacks?.get(contextId);\n if (stack) {\n stack.pop();\n if (stack.length === 0) {\n contextStacks?.delete(contextId);\n }\n }\n ctxVersion++;\n }\n\n /** Builds the __n (global context) map for hooks. */\n function buildGlobalContext(): Record<string, any> {\n if (ctxVersion === cachedGlobalCtxVersion) return cachedGlobalCtx;\n if (!contextStacks || contextStacks.size === 0) {\n cachedGlobalCtx = EMPTY_GLOBAL_CTX;\n cachedGlobalCtxVersion = ctxVersion;\n return cachedGlobalCtx;\n }\n const globalCtx: Record<string, any> = {};\n for (const [contextId, stack] of contextStacks) {\n if (stack.length > 0) {\n // useContext expects provider.props.value and provider.sub().\n globalCtx[contextId] = {\n props: {value: stack[stack.length - 1]},\n sub: noop,\n };\n }\n }\n cachedGlobalCtx = globalCtx;\n cachedGlobalCtxVersion = ctxVersion;\n return globalCtx;\n }\n\n function render(node: any, inline?: boolean): string {\n const t = typeof node;\n if (t === 'string') {\n // escapeHtml only replaces &<>, so it never adds or removes newlines; the\n // raw text's newline status is preserved. Each text node is scanned once\n // here, never re-walked by ancestors. (`render` is only reached in pretty\n // mode \u2014 minimal mode uses `mRender` \u2014 so the scan always applies.)\n nlFlag = node.indexOf('\\n') >= 0;\n return escapeHtml(node);\n }\n if (t === 'object') {\n if (node === null) {\n nlFlag = false;\n return '';\n }\n if (Array.isArray(node)) {\n let out = '';\n let anyNewline = false;\n for (let i = 0; i < node.length; i++) {\n const child = node[i];\n // Inline the string leaf (the most common array entry) to skip a\n // recursive `render` dispatch. This mirrors the string branch above\n // exactly: escape the text and record whether it contains a newline.\n if (typeof child === 'string') {\n out += escapeHtml(child);\n anyNewline = anyNewline || child.indexOf('\\n') >= 0;\n } else {\n out += render(child, inline);\n anyNewline = anyNewline || nlFlag;\n }\n }\n nlFlag = anyNewline;\n return out;\n }\n // Must be a VNode-like object.\n if (!('type' in node)) {\n nlFlag = false;\n return '';\n }\n const type = node.type;\n // HTML element (the most common VNode shape).\n if (typeof type === 'string') {\n return renderElement(type, node.props, inline);\n }\n // Fragment.\n if (type === Fragment) {\n return renderChildren(node.props ? node.props.children : undefined);\n }\n // Component (function or class).\n if (typeof type === 'function') {\n return renderComponent(node);\n }\n return '';\n }\n if (t === 'number' || t === 'bigint') {\n nlFlag = false;\n return String(node);\n }\n // boolean, undefined, function, symbol: render to nothing.\n nlFlag = false;\n return '';\n }\n\n function renderComponent(vnode: VNode): string {\n const {type, props} = vnode;\n const fn = type as Function;\n\n // Detect context Provider.\n // Root.js local JSX runtime: Provider._isProvider === true, Provider._context\n // is the Context object with a _stack array.\n // Preact >=10.27: Provider === Context (same function). `fn.__c` is the\n // context id string (e.g. \"__cC0\").\n // Preact <10.27: Provider._contextRef (mangled `fn.__`) points to the\n // context object which has `__c` (id) and `__` (default value).\n const fnAny = fn as any;\n if (fnAny._isProvider && fnAny._context) {\n const ctx = fnAny._context;\n ctx._stack.push((props as any).value);\n const result = activeChildren(props.children);\n ctx._stack.pop();\n return result;\n }\n let contextId: string | undefined;\n if (typeof fnAny.__c === 'string' && fnAny.__c.startsWith('__cC')) {\n contextId = fnAny.__c;\n } else if (fnAny.__ && typeof fnAny.__ === 'object' && fnAny.__.__c) {\n contextId = fnAny.__.__c;\n }\n if (contextId) {\n pushCtx(contextId, (props as any).value);\n const result = activeChildren(props.children);\n popCtx(contextId);\n return result;\n }\n\n // Detect context Consumer.\n if ((fn as any).contextType) {\n const ctx = (fn as any).contextType;\n const ctxId: string = ctx.__c;\n const stack = contextStacks?.get(ctxId);\n const value =\n stack && stack.length > 0 ? stack[stack.length - 1] : ctx.__;\n if (typeof props.children === 'function') {\n return activeRender(props.children(value));\n }\n return activeChildren(props.children);\n }\n\n // Regular component \u2014 set up a fake component instance so Preact hooks\n // (useContext, useState, useMemo, etc.) work during SSR.\n // Preact's useContext reads from `component.context[context.__c]`.\n const component: any = {\n props,\n context: buildGlobalContext(),\n state: {},\n __v: vnode, // _vnode\n __d: false, // _dirty\n __h: [], // _renderCallbacks\n __s: {}, // _nextState\n __H: null, // _hooks (initialised by hooks addon)\n };\n (vnode as any).__c = component;\n\n // Trigger Preact option hooks so the hooks addon can set currentComponent.\n (preactOptions as any).__b?.(vnode);\n (preactOptions as any).__r?.(vnode);\n\n try {\n // Class component.\n if (fn.prototype && fn.prototype.render) {\n const instance = new (fn as any)(props, component.context);\n instance.__n = component.__n;\n instance.__H = component.__H;\n (vnode as any).__c = instance;\n (preactOptions as any).__r?.(vnode);\n return activeRender(instance.render(instance.props, instance.state));\n }\n\n // Functional component.\n const rendered = fn(props, component.context);\n return activeRender(rendered);\n } finally {\n preactOptions.diffed?.(vnode as any);\n }\n }\n\n function renderElement(\n tag: string,\n props: Record<string, any>,\n inline?: boolean\n ): string {\n // One combined lookup for the static (void / always-block / raw-content /\n // default-block) classifications, instead of separate `Set.has` probes.\n // Inline elements (span/a/em/strong/\u2026) miss the map entirely and resolve\n // to 0.\n const flags = TAG_STATIC_FLAGS.get(tag) || 0;\n // Metadata/resource elements always break onto their own line, even within\n // mixed (text + element) content where the inline heuristic applies, since\n // they render no inline visual output. (`renderElement` is only reached in\n // pretty mode \u2014 minimal mode uses `mElement` \u2014 so the block logic always\n // applies; no `isPretty` guard needed.) `customBlockSet` is consulted only\n // for runtime-configured block elements and is `undefined` (skipped) in the\n // common case.\n const isBlock =\n (flags & TAG_FLAG_ALWAYS_BLOCK) !== 0 ||\n (!inline &&\n ((flags & TAG_FLAG_BLOCK) !== 0 ||\n (customBlockSet !== undefined && customBlockSet.has(tag))));\n const attrs = renderAttrs(tag, props);\n const openTag = '<' + tag + attrs + '>';\n\n if ((flags & TAG_FLAG_VOID) !== 0) {\n if (isBlock) {\n nlFlag = true;\n return openTag + '\\n';\n }\n nlFlag = false;\n return openTag;\n }\n\n let inner = '';\n // Whether `inner` contains a newline. For the children path this is read\n // from `nlFlag` (threaded up from the recursive render, no rescan). For the\n // raw-HTML and textarea leaf paths the string is scanned once here.\n let innerHasNewline = false;\n if (props) {\n const dsih = props.dangerouslySetInnerHTML;\n if (dsih && dsih.__html != null) {\n inner = dsih.__html;\n innerHasNewline = inner.includes('\\n');\n } else if (props.children != null) {\n const children = props.children;\n // Inline the single string child (e.g. `<h3>Title</h3>`) \u2014 the most\n // common element body \u2014 to skip a `renderChildren`/`render` dispatch.\n // Mirrors the string branch of `render`.\n if (typeof children === 'string') {\n inner = escapeHtml(children);\n innerHasNewline = children.indexOf('\\n') >= 0;\n } else {\n inner = renderChildren(children);\n innerHasNewline = nlFlag;\n }\n } else if (tag === 'textarea') {\n // For <textarea>, render value/defaultValue as text content since\n // browsers ignore the value attribute on textarea elements.\n const textVal = props.value ?? props.defaultValue;\n if (textVal != null) {\n inner = escapeHtml(String(textVal));\n innerHasNewline = inner.includes('\\n');\n }\n }\n }\n\n if (isBlock) {\n // Block elements always end with a trailing newline.\n nlFlag = true;\n // When inner content contains block children (indicated by newlines),\n // add a newline after the opening tag so content starts on its own line.\n // Exempt raw-content elements (pre, textarea, script, style) where\n // newlines are literal text, not block-child indicators.\n const hasBlockChildren = (flags & TAG_FLAG_RAW) === 0 && innerHasNewline;\n if (hasBlockChildren) {\n return openTag + '\\n' + inner + '</' + tag + '>\\n';\n }\n return openTag + inner + '</' + tag + '>\\n';\n }\n // Opening/closing tags add no newlines, so the element's newline status is\n // exactly that of its inner content.\n nlFlag = innerHasNewline;\n return openTag + inner + '</' + tag + '>';\n }\n\n function renderAttrs(tag: string, props: Record<string, any>): string {\n if (!props) return '';\n const isTextarea = tag === 'textarea';\n let result = '';\n for (const key in props) {\n const value = props[key];\n // `null`/`undefined` props produce no attribute. Checking this first\n // short-circuits absent optional attributes immediately, before the\n // reserved-key string comparisons.\n if (value == null) continue;\n if (\n key === 'children' ||\n key === 'dangerouslySetInnerHTML' ||\n key === 'key' ||\n key === 'ref' ||\n key === '__self' ||\n key === '__source'\n ) {\n continue;\n }\n // Skip value/defaultValue on textarea \u2014 rendered as text content.\n if (isTextarea && (key === 'value' || key === 'defaultValue')) {\n continue;\n }\n\n const attrName = PROP_TO_ATTR[key] || key;\n const valueType = typeof value;\n\n // Dispatch ordered by frequency: string and numeric attribute values are\n // by far the most common, so they are matched first.\n if (valueType === 'string') {\n result += ' ' + attrName + '=\"' + escapeAttr(value) + '\"';\n } else if (valueType === 'number') {\n // A stringified number never contains characters that require HTML\n // escaping, so skip `escapeAttr` entirely.\n result += ' ' + attrName + '=\"' + value + '\"';\n } else if (value === true) {\n // Boolean HTML attributes minimize to a bare attribute when `true`.\n // Enumerated attributes with no boolean form (e.g. crossorigin) render\n // their spec default rather than the invalid `=\"true\"`. Everything else\n // is stringified (e.g. id=\"true\").\n if (BOOLEAN_ATTRS.has(attrName)) {\n result += ' ' + attrName;\n } else {\n const enumDefault = ENUMERATED_ATTR_TRUE_DEFAULTS[attrName];\n result +=\n enumDefault !== undefined\n ? ' ' + attrName + '=\"' + enumDefault + '\"'\n : ' ' + attrName + '=\"true\"';\n }\n } else if (value === false) {\n // Boolean HTML attributes are removed when `false`; other attributes\n // are stringified (e.g. data-foo=\"false\").\n if (!BOOLEAN_ATTRS.has(attrName)) {\n result += ' ' + attrName + '=\"false\"';\n }\n } else if (valueType === 'function') {\n // Skip function-valued props such as event handlers (e.g.\n // onClick={fn}): client-side handler functions can't be serialized to\n // HTML. String-valued inline handlers (e.g. <select onChange=\"...\">)\n // are preserved by the string branch above.\n continue;\n } else if (key === 'style' && valueType === 'object') {\n // Style objects serialize to a CSS string; an empty result is omitted.\n const styleStr = styleToString(value);\n if (styleStr) {\n result += ' ' + attrName + '=\"' + escapeAttr(styleStr) + '\"';\n }\n } else {\n result += ' ' + attrName + '=\"' + escapeAttr(String(value)) + '\"';\n }\n }\n return result;\n }\n\n /**\n * Checks if an array of children contains a mix of text nodes and elements.\n * When mixed, block elements should render inline to avoid breaking text flow.\n * The per-child type checks are inlined (rather than calling `isTextNode`)\n * because this scans every child of every element in pretty mode.\n */\n function hasMixedContent(children: any[]): boolean {\n let hasText = false;\n let hasElement = false;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n const t = typeof child;\n if (t === 'string' || t === 'number' || t === 'bigint') {\n hasText = true;\n } else if (t === 'object' && child !== null && 'type' in child) {\n hasElement = true;\n }\n if (hasText && hasElement) return true;\n }\n return false;\n }\n\n function renderChildren(children: any): string {\n if (children == null) {\n nlFlag = false;\n return '';\n }\n if (Array.isArray(children)) {\n // `renderChildren` is only reached in pretty mode (minimal uses\n // `mChildren`), so the mixed-content scan always applies.\n const inline = hasMixedContent(children);\n let out = '';\n let anyNewline = false;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n // Inline the string leaf to skip a recursive `render` dispatch (mirrors\n // the string branch of `render`).\n if (typeof child === 'string') {\n out += escapeHtml(child);\n anyNewline = anyNewline || child.indexOf('\\n') >= 0;\n } else {\n out += render(child, inline);\n anyNewline = anyNewline || nlFlag;\n }\n }\n nlFlag = anyNewline;\n return out;\n }\n return render(children);\n }\n\n // ---------------------------------------------------------------------------\n // Minimal-mode fast path.\n //\n // Minimal mode emits compact HTML with no formatting, so it needs none of the\n // pretty-mode bookkeeping that `render`/`renderChildren`/`renderElement`\n // carry: the `nlFlag` newline side-channel, the `inline` parameter,\n // block-element detection, and the mixed-content scan. These dedicated\n // functions drop all of it, which removes those closure reads/writes and\n // branches from the hottest traversal loop. Each accumulates into a local\n // string and returns it (locals beat a shared closure-level buffer, and V8\n // represents the `+` concatenations as cheap rope/cons strings that flatten\n // once at the end). Output is byte-identical to the unified path in minimal\n // mode; the test suite asserts this across all element/attribute shapes.\n //\n // `renderComponent` is shared between modes via the `activeRender` /\n // `activeChildren` indirection assigned below: in minimal mode a component's\n // rendered subtree continues down `mRender`/`mChildren`, in pretty mode down\n // `render`/`renderChildren`.\n // ---------------------------------------------------------------------------\n\n function mRender(node: any): string {\n const t = typeof node;\n if (t === 'string') {\n return escapeHtml(node);\n }\n if (t === 'object') {\n if (node === null) {\n return '';\n }\n if (Array.isArray(node)) {\n let out = '';\n for (let i = 0; i < node.length; i++) {\n const child = node[i];\n // Inline the string leaf (the most common array entry) to skip a\n // recursive `mRender` dispatch; `mRender('...')` is exactly\n // `escapeHtml('...')`.\n out += typeof child === 'string' ? escapeHtml(child) : mRender(child);\n }\n return out;\n }\n if (!('type' in node)) {\n return '';\n }\n const type = node.type;\n if (typeof type === 'string') {\n return mElement(type, node.props);\n }\n if (type === Fragment) {\n return mChildren(node.props ? node.props.children : undefined);\n }\n if (typeof type === 'function') {\n return renderComponent(node);\n }\n return '';\n }\n if (t === 'number' || t === 'bigint') {\n return String(node);\n }\n return '';\n }\n\n function mElement(tag: string, props: Record<string, any>): string {\n const attrs = renderAttrs(tag, props);\n if (VOID_ELEMENTS.has(tag)) {\n return '<' + tag + attrs + '>';\n }\n let inner = '';\n if (props) {\n const dsih = props.dangerouslySetInnerHTML;\n if (dsih && dsih.__html != null) {\n inner = dsih.__html;\n } else {\n const children = props.children;\n if (children != null) {\n // Inline the single string child (e.g. `<h3>Title</h3>`,\n // `<li>Tag</li>`) \u2014 the most common element body \u2014 so it skips a\n // `mChildren` call; `mChildren('...')` is exactly `escapeHtml('...')`.\n inner =\n typeof children === 'string'\n ? escapeHtml(children)\n : mChildren(children);\n } else if (tag === 'textarea') {\n // For <textarea>, render value/defaultValue as text content since\n // browsers ignore the value attribute on textarea elements.\n const textVal = props.value ?? props.defaultValue;\n if (textVal != null) {\n inner = escapeHtml(String(textVal));\n }\n }\n }\n }\n // Single multi-operand concatenation: V8 sizes and fills one flat string\n // rather than allocating a separate `open` intermediate first.\n return '<' + tag + attrs + '>' + inner + '</' + tag + '>';\n }\n\n function mChildren(children: any): string {\n if (children == null) {\n return '';\n }\n if (Array.isArray(children)) {\n let out = '';\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n const t = typeof child;\n // Inline the two most common child shapes (text leaf and host element)\n // so they skip the general `mRender` type-dispatch. These mirror\n // `mRender` exactly: a string renders as `escapeHtml`, and an object\n // whose `type` is a string is a host element rendered via `mElement`.\n if (t === 'string') {\n out += escapeHtml(child);\n } else if (\n t === 'object' &&\n child !== null &&\n typeof child.type === 'string'\n ) {\n out += mElement(child.type, child.props);\n } else {\n out += mRender(child);\n }\n }\n return out;\n }\n // Single (non-array) child. Inline the same two common shapes so a\n // single-child chain (e.g. deeply nested `<div><div>\u2026`) skips a `mRender`\n // dispatch at every level.\n const t = typeof children;\n if (t === 'string') {\n return escapeHtml(children);\n }\n if (\n t === 'object' &&\n children !== null &&\n typeof children.type === 'string'\n ) {\n return mElement(children.type, children.props);\n }\n return mRender(children);\n }\n\n // Select the active recursion functions once per render. Minimal mode uses\n // the lean `mRender`/`mChildren` fast path above; pretty mode uses the\n // newline-tracking `render`/`renderChildren`. `renderComponent` and the\n // context Consumer path call through these so component subtrees stay on the\n // correct path.\n const activeRender = isPretty ? render : mRender;\n const activeChildren = isPretty ? renderChildren : mChildren;\n return activeRender(vnode);\n}\n\nfunction noop() {}\n"],
5
- "mappings": ";;;;;AACA,SAAQ,WAAW,qBAAoB;AAIvC,IAAM,gBAAgB,oBAAI,IAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGD,IAAM,uBAAuB,oBAAI,IAAI,CAAC,OAAO,YAAY,UAAU,OAAO,CAAC;AAO3E,IAAM,yBAAyB,oBAAI,IAAI;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AASD,IAAM,wBAAwB,oBAAI,IAAI;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;A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AAAA,QACtB;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAIA,UAAM,IAAI,OAAO;AACjB,QAAI,MAAM,UAAU;AAClB,aAAO,WAAW,QAAQ;AAAA,IAC5B;AACA,QACE,MAAM,YACN,aAAa,QACb,OAAO,SAAS,SAAS,UACzB;AACA,aAAO,SAAS,SAAS,MAAM,SAAS,KAAK;AAAA,IAC/C;AACA,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAOA,QAAM,eAAe,WAAW,SAAS;AACzC,QAAM,iBAAiB,WAAW,iBAAiB;AACnD,SAAO,aAAa,KAAK;AAC3B;AAEA,SAAS,OAAO;AAAC;",
4
+ "sourcesContent": ["/* eslint-disable n/no-extraneous-import */\nimport {options as preactOptions} from 'preact';\nimport {VNode, Fragment} from './jsx-runtime.js';\n\n/** HTML void elements (self-closing, no end tag). */\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n]);\n\n/** Tags whose text content may contain literal newlines that should not be treated as block-child indicators. */\nconst RAW_CONTENT_ELEMENTS = new Set(['pre', 'textarea', 'script', 'style']);\n\n/**\n * Standard HTML block-level elements. Also includes the `<select>` content\n * model (`select`/`optgroup`/`option`) so that each `<option>` renders on its\n * own line in pretty mode, even though those tags aren't block-level per CSS.\n */\nconst DEFAULT_BLOCK_ELEMENTS = new Set([\n 'address',\n 'article',\n 'aside',\n 'base',\n 'blockquote',\n 'body',\n 'dd',\n 'details',\n 'dialog',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'li',\n 'link',\n 'main',\n 'meta',\n 'nav',\n 'noscript',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'pre',\n 'script',\n 'search',\n 'section',\n 'select',\n 'style',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'ul',\n]);\n\n/**\n * Non-visual metadata and resource elements. These produce no inline rendered\n * content, so in pretty mode they always start on their own line \u2014 even inside\n * a parent with mixed text/element children, where the inline heuristic would\n * otherwise keep all siblings on a single line. (`base`/`link`/`meta` are void;\n * `script`/`style`/`title` render no visible text.)\n */\nconst ALWAYS_BLOCK_ELEMENTS = new Set([\n 'base',\n 'link',\n 'meta',\n 'script',\n 'style',\n 'title',\n]);\n\n// Combined per-tag classification flags for the pretty-mode renderer. Each\n// element in `renderElement` needs to know whether a tag is void, an\n// always-block element, a raw-content element, and a default block-level\n// element. These classifications are static (they never depend on render\n// options), so they are precomputed into a single `Map<tag, bitmask>` lookup \u2014\n// one hash probe per element instead of four separate `Set.has` probes. Tags\n// absent from the map (the common inline elements like `span`/`a`/`em`) return\n// `undefined`, treated as flags 0. Runtime-configured block elements\n// (`options.blockElements`) are handled by a separate, usually-absent set so\n// the common path stays a single lookup.\nconst TAG_FLAG_VOID = 1;\nconst TAG_FLAG_ALWAYS_BLOCK = 2;\nconst TAG_FLAG_RAW = 4;\nconst TAG_FLAG_BLOCK = 8;\nconst TAG_STATIC_FLAGS = new Map<string, number>();\nfor (const t of VOID_ELEMENTS) {\n TAG_STATIC_FLAGS.set(t, (TAG_STATIC_FLAGS.get(t) || 0) | TAG_FLAG_VOID);\n}\nfor (const t of ALWAYS_BLOCK_ELEMENTS) {\n TAG_STATIC_FLAGS.set(\n t,\n (TAG_STATIC_FLAGS.get(t) || 0) | TAG_FLAG_ALWAYS_BLOCK\n );\n}\nfor (const t of RAW_CONTENT_ELEMENTS) {\n TAG_STATIC_FLAGS.set(t, (TAG_STATIC_FLAGS.get(t) || 0) | TAG_FLAG_RAW);\n}\nfor (const t of DEFAULT_BLOCK_ELEMENTS) {\n TAG_STATIC_FLAGS.set(t, (TAG_STATIC_FLAGS.get(t) || 0) | TAG_FLAG_BLOCK);\n}\n\n/**\n * HTML/SVG boolean attributes.\n * When present with a truthy value, render as a minimized attribute.\n */\nconst BOOLEAN_ATTRS = new Set([\n 'allowfullscreen',\n 'async',\n 'autofocus',\n 'autoplay',\n 'capture',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'disablepictureinpicture',\n 'disableremoteplayback',\n 'download',\n 'draggable',\n 'formnovalidate',\n 'hidden',\n 'inert',\n 'ismap',\n 'itemscope',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'popover',\n 'readonly',\n 'required',\n 'reversed',\n 'selected',\n]);\n\n/**\n * Enumerated attributes that have no boolean form. When written as a bare JSX\n * prop (e.g. `<link crossorigin />`, which Preact passes as `true`), rendering\n * `=\"true\"` would be an invalid value, so emit the attribute's spec-defined\n * default instead. For `crossorigin` the missing/invalid-value default is\n * `anonymous`.\n *\n * Keyed by HTML attribute name (post-`PROP_TO_ATTR` remapping). A\n * null-prototype object so the common \"not enumerated\" lookup misses without\n * walking `Object.prototype`.\n */\nconst ENUMERATED_ATTR_TRUE_DEFAULTS: Record<string, string> = Object.assign(\n Object.create(null),\n {\n crossorigin: 'anonymous',\n }\n);\n\n/**\n * JSX prop name -> HTML attribute name.\n *\n * A null-prototype object so that the very common \"no remapping needed\" lookup\n * (`class`, `href`, `id`, `data-*`, `aria-*`, etc., none of which are keys here)\n * misses without walking the `Object.prototype` chain. `renderAttrs` performs\n * one lookup per attribute, so for attribute-heavy trees this is a hot path.\n */\nconst PROP_TO_ATTR: Record<string, string> = Object.assign(\n Object.create(null),\n {\n acceptCharset: 'accept-charset',\n autoCapitalize: 'autocapitalize',\n autoComplete: 'autocomplete',\n autoFocus: 'autofocus',\n autoPlay: 'autoplay',\n charSet: 'charset',\n className: 'class',\n colSpan: 'colspan',\n contentEditable: 'contenteditable',\n crossOrigin: 'crossorigin',\n dateTime: 'datetime',\n disablePictureInPicture: 'disablepictureinpicture',\n disableRemotePlayback: 'disableremoteplayback',\n encType: 'enctype',\n formAction: 'formaction',\n formEncType: 'formenctype',\n formMethod: 'formmethod',\n formNoValidate: 'formnovalidate',\n formTarget: 'formtarget',\n frameBorder: 'frameborder',\n hrefLang: 'hreflang',\n htmlFor: 'for',\n httpEquiv: 'http-equiv',\n inputMode: 'inputmode',\n itemProp: 'itemprop',\n itemRef: 'itemref',\n itemScope: 'itemscope',\n itemType: 'itemtype',\n maxLength: 'maxlength',\n mediaGroup: 'mediagroup',\n minLength: 'minlength',\n noModule: 'nomodule',\n noValidate: 'novalidate',\n playsInline: 'playsinline',\n readOnly: 'readonly',\n referrerPolicy: 'referrerpolicy',\n rowSpan: 'rowspan',\n spellCheck: 'spellcheck',\n srcDoc: 'srcdoc',\n srcLang: 'srclang',\n srcSet: 'srcset',\n tabIndex: 'tabindex',\n useMap: 'usemap',\n\n // SVG presentation attributes (camelCase -> kebab-case).\n clipPath: 'clip-path',\n clipRule: 'clip-rule',\n colorInterpolation: 'color-interpolation',\n colorInterpolationFilters: 'color-interpolation-filters',\n dominantBaseline: 'dominant-baseline',\n fillOpacity: 'fill-opacity',\n fillRule: 'fill-rule',\n floodColor: 'flood-color',\n floodOpacity: 'flood-opacity',\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 paintOrder: 'paint-order',\n pointerEvents: 'pointer-events',\n shapeRendering: 'shape-rendering',\n stopColor: 'stop-color',\n stopOpacity: 'stop-opacity',\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 textAnchor: 'text-anchor',\n textDecoration: 'text-decoration',\n textRendering: 'text-rendering',\n transformOrigin: 'transform-origin',\n vectorEffect: 'vector-effect',\n wordSpacing: 'word-spacing',\n writingMode: 'writing-mode',\n }\n);\n\nconst AMP = '&amp;';\nconst LT = '&lt;';\nconst GT = '&gt;';\nconst QUOT = '&quot;';\n\n// Single-pass native prechecks for the common case where a string needs no\n// escaping (most class names, URLs, and text). `RegExp.test` scans in native\n// code, which is substantially faster than the JS `charCodeAt` loop below, so\n// strings that don't match return immediately without entering the loop.\nconst HTML_ESCAPE_RE = /[&<>]/;\nconst ATTR_ESCAPE_RE = /[&<>\"]/;\n\n// Shared empty object reused as the per-component context map when no contexts\n// have ever been pushed. Components only ever read from this map, so sharing is\n// safe and avoids a per-render allocation in the common case.\nconst EMPTY_GLOBAL_CTX: Record<string, any> = {};\n\n/** Returns `true` when `value` is neither `null` nor `undefined`. */\nfunction isDef<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined;\n}\n\nfunction escapeHtml(str: string): string {\n if (!HTML_ESCAPE_RE.test(str)) return str;\n let result = '';\n let last = 0;\n for (let i = 0; i < str.length; i++) {\n const ch = str.charCodeAt(i);\n let escaped: string | undefined;\n if (ch === 38) escaped = AMP;\n else if (ch === 60) escaped = LT;\n else if (ch === 62) escaped = GT;\n if (escaped) {\n result += str.slice(last, i) + escaped;\n last = i + 1;\n }\n }\n return result + str.slice(last);\n}\n\nfunction escapeAttr(str: string): string {\n if (!ATTR_ESCAPE_RE.test(str)) return str;\n let result = '';\n let last = 0;\n for (let i = 0; i < str.length; i++) {\n const ch = str.charCodeAt(i);\n let escaped: string | undefined;\n if (ch === 38) escaped = AMP;\n else if (ch === 34) escaped = QUOT;\n else if (ch === 60) escaped = LT;\n else if (ch === 62) escaped = GT;\n if (escaped) {\n result += str.slice(last, i) + escaped;\n last = i + 1;\n }\n }\n return result + str.slice(last);\n}\n\nconst STYLE_KEY_CACHE = new Map<string, string>();\nconst UPPERCASE_RE = /[A-Z]/g;\n\nfunction toKebabCase(key: string): string {\n let cached = STYLE_KEY_CACHE.get(key);\n if (cached === undefined) {\n cached = key.replace(UPPERCASE_RE, (m) => '-' + m.toLowerCase());\n STYLE_KEY_CACHE.set(key, cached);\n }\n return cached;\n}\n\nfunction styleToString(style: Record<string, any>): string {\n let result = '';\n let first = true;\n for (const key in style) {\n const value = style[key];\n if (!isDef(value) || value === '') continue;\n if (first) {\n first = false;\n } else {\n result += ';';\n }\n result += `${toKebabCase(key)}:${value}`;\n }\n return result;\n}\n\n/**\n * JSX render mode. `'pretty'` adds newlines around block elements; `'minimal'`\n * outputs compact HTML.\n */\nexport type JsxRenderMode = 'pretty' | 'minimal';\n\nexport interface JsxRenderOptions {\n /** Render mode. `'pretty'` adds newlines around block elements; `'minimal'` outputs compact HTML. Default: `'pretty'`. */\n mode?: JsxRenderMode;\n /** Additional tag names to treat as block-level elements in pretty mode. */\n blockElements?: string[];\n}\n\n/**\n * Renders a Preact VNode tree to an HTML string.\n */\nexport function renderJsxToString(\n vnode: VNode,\n options?: JsxRenderOptions\n): string {\n const mode = options?.mode ?? 'pretty';\n const isPretty = mode === 'pretty';\n // Default block-level elements are baked into the module-level\n // `TAG_STATIC_FLAGS` map (the `TAG_FLAG_BLOCK` bit), so the common case needs\n // no per-render set. Only when the caller supplies extra `blockElements` do we\n // build a small `customBlockSet` of just those additions; `renderElement`\n // consults it via a cheap \"is it defined?\" guard that is `undefined` (and so\n // skipped) in the common case.\n let customBlockSet: Set<string> | undefined;\n if (isPretty && options?.blockElements && options.blockElements.length > 0) {\n customBlockSet = new Set<string>();\n for (const el of options.blockElements) {\n // Only track elements that aren't already default block elements, so the\n // set stays empty (and the guard stays cheap) for redundant config.\n if (!DEFAULT_BLOCK_ELEMENTS.has(el)) {\n customBlockSet.add(el);\n }\n }\n if (customBlockSet.size === 0) {\n customBlockSet = undefined;\n }\n }\n\n // Context stacks: context.__c (id) -> value[]\n let contextStacks: Map<string, any[]> | undefined;\n\n // Version counter that bumps whenever a context value is pushed or popped.\n // `buildGlobalContext` uses it to skip rebuilding when nothing changed\n // between sibling component renders (the common case).\n let ctxVersion = 0;\n let cachedGlobalCtx: Record<string, any> = EMPTY_GLOBAL_CTX;\n let cachedGlobalCtxVersion = 0;\n\n // Side-channel reporting whether the most recently returned render string\n // contains a newline. Pretty mode uses this to decide whether a block\n // element's children start on their own line, instead of re-scanning the\n // element's concatenated inner HTML via `inner.includes('\\n')`. Because block\n // elements nest, that rescan walked the same characters once per enclosing\n // block level (O(html_size * block_depth)); threading the flag up makes it a\n // single pass. This is safe because rendering is fully synchronous and\n // single-pass: every code path assigns `nlFlag` before returning, and each\n // caller reads it immediately after the call, before the next call can\n // overwrite it. It is only meaningful in pretty mode; in minimal mode the\n // leaf scans are skipped and the value is never read.\n let nlFlag = false;\n\n function pushCtx(contextId: string, value: any) {\n if (!contextStacks) {\n contextStacks = new Map<string, any[]>();\n }\n let stack = contextStacks.get(contextId);\n if (!stack) {\n stack = [];\n contextStacks.set(contextId, stack);\n }\n stack.push(value);\n ctxVersion++;\n }\n\n function popCtx(contextId: string) {\n const stack = contextStacks?.get(contextId);\n if (stack) {\n stack.pop();\n if (stack.length === 0) {\n contextStacks?.delete(contextId);\n }\n }\n ctxVersion++;\n }\n\n /** Builds the __n (global context) map for hooks. */\n function buildGlobalContext(): Record<string, any> {\n if (ctxVersion === cachedGlobalCtxVersion) return cachedGlobalCtx;\n if (!contextStacks || contextStacks.size === 0) {\n cachedGlobalCtx = EMPTY_GLOBAL_CTX;\n cachedGlobalCtxVersion = ctxVersion;\n return cachedGlobalCtx;\n }\n const globalCtx: Record<string, any> = {};\n for (const [contextId, stack] of contextStacks) {\n if (stack.length > 0) {\n // useContext expects provider.props.value and provider.sub().\n globalCtx[contextId] = {\n props: {value: stack[stack.length - 1]},\n sub: noop,\n };\n }\n }\n cachedGlobalCtx = globalCtx;\n cachedGlobalCtxVersion = ctxVersion;\n return globalCtx;\n }\n\n function render(node: any, inline?: boolean): string {\n const t = typeof node;\n if (t === 'string') {\n // escapeHtml only replaces &<>, so it never adds or removes newlines; the\n // raw text's newline status is preserved. Each text node is scanned once\n // here, never re-walked by ancestors. (`render` is only reached in pretty\n // mode \u2014 minimal mode uses `mRender` \u2014 so the scan always applies.)\n nlFlag = node.indexOf('\\n') >= 0;\n return escapeHtml(node);\n }\n if (t === 'object') {\n if (node === null) {\n nlFlag = false;\n return '';\n }\n if (Array.isArray(node)) {\n let out = '';\n let anyNewline = false;\n for (let i = 0; i < node.length; i++) {\n const child = node[i];\n // Inline the string leaf (the most common array entry) to skip a\n // recursive `render` dispatch. This mirrors the string branch above\n // exactly: escape the text and record whether it contains a newline.\n if (typeof child === 'string') {\n out += escapeHtml(child);\n anyNewline = anyNewline || child.indexOf('\\n') >= 0;\n } else {\n out += render(child, inline);\n anyNewline = anyNewline || nlFlag;\n }\n }\n nlFlag = anyNewline;\n return out;\n }\n // Must be a VNode-like object.\n if (!('type' in node)) {\n nlFlag = false;\n return '';\n }\n const type = node.type;\n // HTML element (the most common VNode shape).\n if (typeof type === 'string') {\n return renderElement(type, node.props, inline);\n }\n // Fragment.\n if (type === Fragment) {\n return renderChildren(node.props ? node.props.children : undefined);\n }\n // Component (function or class).\n if (typeof type === 'function') {\n return renderComponent(node);\n }\n return '';\n }\n if (t === 'number' || t === 'bigint') {\n nlFlag = false;\n return String(node);\n }\n // boolean, undefined, function, symbol: render to nothing.\n nlFlag = false;\n return '';\n }\n\n function renderComponent(vnode: VNode): string {\n const {type, props} = vnode;\n const fn = type as Function;\n\n // Detect context Provider.\n // Root.js local JSX runtime: Provider._isProvider === true, Provider._context\n // is the Context object with a _stack array.\n // Preact >=10.27: Provider === Context (same function). `fn.__c` is the\n // context id string (e.g. \"__cC0\").\n // Preact <10.27: Provider._contextRef (mangled `fn.__`) points to the\n // context object which has `__c` (id) and `__` (default value).\n const fnAny = fn as any;\n if (fnAny._isProvider && fnAny._context) {\n const ctx = fnAny._context;\n ctx._stack.push((props as any).value);\n const result = activeChildren(props.children);\n ctx._stack.pop();\n return result;\n }\n let contextId: string | undefined;\n if (typeof fnAny.__c === 'string' && fnAny.__c.startsWith('__cC')) {\n contextId = fnAny.__c;\n } else if (fnAny.__ && typeof fnAny.__ === 'object' && fnAny.__.__c) {\n contextId = fnAny.__.__c;\n }\n if (contextId) {\n pushCtx(contextId, (props as any).value);\n const result = activeChildren(props.children);\n popCtx(contextId);\n return result;\n }\n\n // Detect context Consumer.\n if ((fn as any).contextType) {\n const ctx = (fn as any).contextType;\n const ctxId: string = ctx.__c;\n const stack = contextStacks?.get(ctxId);\n const value =\n stack && stack.length > 0 ? stack[stack.length - 1] : ctx.__;\n if (typeof props.children === 'function') {\n return activeRender(props.children(value));\n }\n return activeChildren(props.children);\n }\n\n // Regular component \u2014 set up a fake component instance so Preact hooks\n // (useContext, useState, useMemo, etc.) work during SSR.\n // Preact's useContext reads from `component.context[context.__c]`.\n const component: any = {\n props,\n context: buildGlobalContext(),\n state: {},\n __v: vnode, // _vnode\n __d: false, // _dirty\n __h: [], // _renderCallbacks\n __s: {}, // _nextState\n __H: null, // _hooks (initialised by hooks addon)\n };\n (vnode as any).__c = component;\n\n // Trigger Preact option hooks so the hooks addon can set currentComponent.\n (preactOptions as any).__b?.(vnode);\n (preactOptions as any).__r?.(vnode);\n\n try {\n // Class component.\n if (fn.prototype && fn.prototype.render) {\n const instance = new (fn as any)(props, component.context);\n instance.__n = component.__n;\n instance.__H = component.__H;\n (vnode as any).__c = instance;\n (preactOptions as any).__r?.(vnode);\n return activeRender(instance.render(instance.props, instance.state));\n }\n\n // Functional component.\n const rendered = fn(props, component.context);\n return activeRender(rendered);\n } finally {\n preactOptions.diffed?.(vnode as any);\n }\n }\n\n function renderElement(\n tag: string,\n props: Record<string, any>,\n inline?: boolean\n ): string {\n // One combined lookup for the static (void / always-block / raw-content /\n // default-block) classifications, instead of separate `Set.has` probes.\n // Inline elements (span/a/em/strong/\u2026) miss the map entirely and resolve\n // to 0.\n const flags = TAG_STATIC_FLAGS.get(tag) || 0;\n // Metadata/resource elements always break onto their own line, even within\n // mixed (text + element) content where the inline heuristic applies, since\n // they render no inline visual output. (`renderElement` is only reached in\n // pretty mode \u2014 minimal mode uses `mElement` \u2014 so the block logic always\n // applies; no `isPretty` guard needed.) `customBlockSet` is consulted only\n // for runtime-configured block elements and is `undefined` (skipped) in the\n // common case.\n const isBlock =\n (flags & TAG_FLAG_ALWAYS_BLOCK) !== 0 ||\n (!inline &&\n ((flags & TAG_FLAG_BLOCK) !== 0 ||\n (customBlockSet !== undefined && customBlockSet.has(tag))));\n const attrs = renderAttrs(tag, props);\n const openTag = '<' + tag + attrs + '>';\n\n if ((flags & TAG_FLAG_VOID) !== 0) {\n if (isBlock) {\n nlFlag = true;\n return openTag + '\\n';\n }\n nlFlag = false;\n return openTag;\n }\n\n let inner = '';\n // Whether `inner` contains a newline. For the children path this is read\n // from `nlFlag` (threaded up from the recursive render, no rescan). For the\n // raw-HTML and textarea leaf paths the string is scanned once here.\n let innerHasNewline = false;\n if (props) {\n const dsih = props.dangerouslySetInnerHTML;\n if (dsih && dsih.__html != null) {\n inner = dsih.__html;\n innerHasNewline = inner.includes('\\n');\n } else if (props.children != null) {\n const children = props.children;\n // Inline the single string child (e.g. `<h3>Title</h3>`) \u2014 the most\n // common element body \u2014 to skip a `renderChildren`/`render` dispatch.\n // Mirrors the string branch of `render`.\n if (typeof children === 'string') {\n inner = escapeHtml(children);\n innerHasNewline = children.indexOf('\\n') >= 0;\n } else {\n inner = renderChildren(children);\n innerHasNewline = nlFlag;\n }\n } else if (tag === 'textarea') {\n // For <textarea>, render value/defaultValue as text content since\n // browsers ignore the value attribute on textarea elements.\n const textVal = props.value ?? props.defaultValue;\n if (textVal != null) {\n inner = escapeHtml(String(textVal));\n innerHasNewline = inner.includes('\\n');\n }\n }\n }\n\n if (isBlock) {\n // Block elements always end with a trailing newline.\n nlFlag = true;\n // When inner content contains block children (indicated by newlines),\n // add a newline after the opening tag so content starts on its own line.\n // Exempt raw-content elements (pre, textarea, script, style) where\n // newlines are literal text, not block-child indicators.\n const hasBlockChildren = (flags & TAG_FLAG_RAW) === 0 && innerHasNewline;\n if (hasBlockChildren) {\n return openTag + '\\n' + inner + '</' + tag + '>\\n';\n }\n return openTag + inner + '</' + tag + '>\\n';\n }\n // Opening/closing tags add no newlines, so the element's newline status is\n // exactly that of its inner content.\n nlFlag = innerHasNewline;\n return openTag + inner + '</' + tag + '>';\n }\n\n function renderAttrs(tag: string, props: Record<string, any>): string {\n if (!props) return '';\n const isTextarea = tag === 'textarea';\n let result = '';\n for (const key in props) {\n const value = props[key];\n // `null`/`undefined` props produce no attribute. Checking this first\n // short-circuits absent optional attributes immediately, before the\n // reserved-key string comparisons.\n if (value == null) continue;\n if (\n key === 'children' ||\n key === 'dangerouslySetInnerHTML' ||\n key === 'key' ||\n key === 'ref' ||\n key === '__self' ||\n key === '__source'\n ) {\n continue;\n }\n // Skip value/defaultValue on textarea \u2014 rendered as text content.\n if (isTextarea && (key === 'value' || key === 'defaultValue')) {\n continue;\n }\n\n // Prop aliases (e.g. `className`, `htmlFor`) render as an HTML attribute\n // that may also have been passed directly (e.g. `class`, `for`), usually\n // via a spread. Emitting both would produce a duplicate attribute, which\n // is invalid HTML, so the alias yields to the canonical prop. This\n // matches preact-render-to-string, where `class` wins over `className`\n // regardless of the order the props were declared in.\n let attrName = key;\n const aliasedName = PROP_TO_ATTR[key];\n if (isDef(aliasedName)) {\n if (isDef(props[aliasedName])) {\n continue;\n }\n attrName = aliasedName;\n }\n const valueType = typeof value;\n\n // Dispatch ordered by frequency: string and numeric attribute values are\n // by far the most common, so they are matched first.\n if (valueType === 'string') {\n result += ' ' + attrName + '=\"' + escapeAttr(value) + '\"';\n } else if (valueType === 'number') {\n // A stringified number never contains characters that require HTML\n // escaping, so skip `escapeAttr` entirely.\n result += ' ' + attrName + '=\"' + value + '\"';\n } else if (value === true) {\n // Boolean HTML attributes minimize to a bare attribute when `true`.\n // Enumerated attributes with no boolean form (e.g. crossorigin) render\n // their spec default rather than the invalid `=\"true\"`. Everything else\n // is stringified (e.g. id=\"true\").\n if (BOOLEAN_ATTRS.has(attrName)) {\n result += ' ' + attrName;\n } else {\n const enumDefault = ENUMERATED_ATTR_TRUE_DEFAULTS[attrName];\n result +=\n enumDefault !== undefined\n ? ' ' + attrName + '=\"' + enumDefault + '\"'\n : ' ' + attrName + '=\"true\"';\n }\n } else if (value === false) {\n // Boolean HTML attributes are removed when `false`; other attributes\n // are stringified (e.g. data-foo=\"false\").\n if (!BOOLEAN_ATTRS.has(attrName)) {\n result += ' ' + attrName + '=\"false\"';\n }\n } else if (valueType === 'function') {\n // Skip function-valued props such as event handlers (e.g.\n // onClick={fn}): client-side handler functions can't be serialized to\n // HTML. String-valued inline handlers (e.g. <select onChange=\"...\">)\n // are preserved by the string branch above.\n continue;\n } else if (key === 'style' && valueType === 'object') {\n // Style objects serialize to a CSS string; an empty result is omitted.\n const styleStr = styleToString(value);\n if (styleStr) {\n result += ' ' + attrName + '=\"' + escapeAttr(styleStr) + '\"';\n }\n } else {\n result += ' ' + attrName + '=\"' + escapeAttr(String(value)) + '\"';\n }\n }\n return result;\n }\n\n /**\n * Checks if an array of children contains a mix of text nodes and elements.\n * When mixed, block elements should render inline to avoid breaking text flow.\n * The per-child type checks are inlined (rather than calling `isTextNode`)\n * because this scans every child of every element in pretty mode.\n */\n function hasMixedContent(children: any[]): boolean {\n let hasText = false;\n let hasElement = false;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n const t = typeof child;\n if (t === 'string' || t === 'number' || t === 'bigint') {\n hasText = true;\n } else if (t === 'object' && child !== null && 'type' in child) {\n hasElement = true;\n }\n if (hasText && hasElement) return true;\n }\n return false;\n }\n\n function renderChildren(children: any): string {\n if (children == null) {\n nlFlag = false;\n return '';\n }\n if (Array.isArray(children)) {\n // `renderChildren` is only reached in pretty mode (minimal uses\n // `mChildren`), so the mixed-content scan always applies.\n const inline = hasMixedContent(children);\n let out = '';\n let anyNewline = false;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n // Inline the string leaf to skip a recursive `render` dispatch (mirrors\n // the string branch of `render`).\n if (typeof child === 'string') {\n out += escapeHtml(child);\n anyNewline = anyNewline || child.indexOf('\\n') >= 0;\n } else {\n out += render(child, inline);\n anyNewline = anyNewline || nlFlag;\n }\n }\n nlFlag = anyNewline;\n return out;\n }\n return render(children);\n }\n\n // ---------------------------------------------------------------------------\n // Minimal-mode fast path.\n //\n // Minimal mode emits compact HTML with no formatting, so it needs none of the\n // pretty-mode bookkeeping that `render`/`renderChildren`/`renderElement`\n // carry: the `nlFlag` newline side-channel, the `inline` parameter,\n // block-element detection, and the mixed-content scan. These dedicated\n // functions drop all of it, which removes those closure reads/writes and\n // branches from the hottest traversal loop. Each accumulates into a local\n // string and returns it (locals beat a shared closure-level buffer, and V8\n // represents the `+` concatenations as cheap rope/cons strings that flatten\n // once at the end). Output is byte-identical to the unified path in minimal\n // mode; the test suite asserts this across all element/attribute shapes.\n //\n // `renderComponent` is shared between modes via the `activeRender` /\n // `activeChildren` indirection assigned below: in minimal mode a component's\n // rendered subtree continues down `mRender`/`mChildren`, in pretty mode down\n // `render`/`renderChildren`.\n // ---------------------------------------------------------------------------\n\n function mRender(node: any): string {\n const t = typeof node;\n if (t === 'string') {\n return escapeHtml(node);\n }\n if (t === 'object') {\n if (node === null) {\n return '';\n }\n if (Array.isArray(node)) {\n let out = '';\n for (let i = 0; i < node.length; i++) {\n const child = node[i];\n // Inline the string leaf (the most common array entry) to skip a\n // recursive `mRender` dispatch; `mRender('...')` is exactly\n // `escapeHtml('...')`.\n out += typeof child === 'string' ? escapeHtml(child) : mRender(child);\n }\n return out;\n }\n if (!('type' in node)) {\n return '';\n }\n const type = node.type;\n if (typeof type === 'string') {\n return mElement(type, node.props);\n }\n if (type === Fragment) {\n return mChildren(node.props ? node.props.children : undefined);\n }\n if (typeof type === 'function') {\n return renderComponent(node);\n }\n return '';\n }\n if (t === 'number' || t === 'bigint') {\n return String(node);\n }\n return '';\n }\n\n function mElement(tag: string, props: Record<string, any>): string {\n const attrs = renderAttrs(tag, props);\n if (VOID_ELEMENTS.has(tag)) {\n return '<' + tag + attrs + '>';\n }\n let inner = '';\n if (props) {\n const dsih = props.dangerouslySetInnerHTML;\n if (dsih && dsih.__html != null) {\n inner = dsih.__html;\n } else {\n const children = props.children;\n if (children != null) {\n // Inline the single string child (e.g. `<h3>Title</h3>`,\n // `<li>Tag</li>`) \u2014 the most common element body \u2014 so it skips a\n // `mChildren` call; `mChildren('...')` is exactly `escapeHtml('...')`.\n inner =\n typeof children === 'string'\n ? escapeHtml(children)\n : mChildren(children);\n } else if (tag === 'textarea') {\n // For <textarea>, render value/defaultValue as text content since\n // browsers ignore the value attribute on textarea elements.\n const textVal = props.value ?? props.defaultValue;\n if (textVal != null) {\n inner = escapeHtml(String(textVal));\n }\n }\n }\n }\n // Single multi-operand concatenation: V8 sizes and fills one flat string\n // rather than allocating a separate `open` intermediate first.\n return '<' + tag + attrs + '>' + inner + '</' + tag + '>';\n }\n\n function mChildren(children: any): string {\n if (children == null) {\n return '';\n }\n if (Array.isArray(children)) {\n let out = '';\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n const t = typeof child;\n // Inline the two most common child shapes (text leaf and host element)\n // so they skip the general `mRender` type-dispatch. These mirror\n // `mRender` exactly: a string renders as `escapeHtml`, and an object\n // whose `type` is a string is a host element rendered via `mElement`.\n if (t === 'string') {\n out += escapeHtml(child);\n } else if (\n t === 'object' &&\n child !== null &&\n typeof child.type === 'string'\n ) {\n out += mElement(child.type, child.props);\n } else {\n out += mRender(child);\n }\n }\n return out;\n }\n // Single (non-array) child. Inline the same two common shapes so a\n // single-child chain (e.g. deeply nested `<div><div>\u2026`) skips a `mRender`\n // dispatch at every level.\n const t = typeof children;\n if (t === 'string') {\n return escapeHtml(children);\n }\n if (\n t === 'object' &&\n children !== null &&\n typeof children.type === 'string'\n ) {\n return mElement(children.type, children.props);\n }\n return mRender(children);\n }\n\n // Select the active recursion functions once per render. Minimal mode uses\n // the lean `mRender`/`mChildren` fast path above; pretty mode uses the\n // newline-tracking `render`/`renderChildren`. `renderComponent` and the\n // context Consumer path call through these so component subtrees stay on the\n // correct path.\n const activeRender = isPretty ? render : mRender;\n const activeChildren = isPretty ? renderChildren : mChildren;\n return activeRender(vnode);\n}\n\nfunction noop() {}\n"],
5
+ "mappings": ";;;;;AACA,SAAQ,WAAW,qBAAoB;AAIvC,IAAM,gBAAgB,oBAAI,IAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGD,IAAM,uBAAuB,oBAAI,IAAI,CAAC,OAAO,YAAY,UAAU,OAAO,CAAC;AAO3E,IAAM,yBAAyB,oBAAI,IAAI;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AASD,IAAM,wBAAwB,oBAAI,IAAI;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CA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M,YACN,UAAU,QACV,OAAO,MAAM,SAAS,UACtB;AACA,iBAAO,SAAS,MAAM,MAAM,MAAM,KAAK;AAAA,QACzC,OAAO;AACL,iBAAO,QAAQ,KAAK;AAAA,QACtB;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAIA,UAAM,IAAI,OAAO;AACjB,QAAI,MAAM,UAAU;AAClB,aAAO,WAAW,QAAQ;AAAA,IAC5B;AACA,QACE,MAAM,YACN,aAAa,QACb,OAAO,SAAS,SAAS,UACzB;AACA,aAAO,SAAS,SAAS,MAAM,SAAS,KAAK;AAAA,IAC/C;AACA,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAOA,QAAM,eAAe,WAAW,SAAS;AACzC,QAAM,iBAAiB,WAAW,iBAAiB;AACnD,SAAO,aAAa,KAAK;AAC3B;AAEA,SAAS,OAAO;AAAC;",
6
6
  "names": ["vnode", "t"]
7
7
  }
@@ -4,7 +4,7 @@ import {
4
4
  isJsFile,
5
5
  makeDir,
6
6
  writeFile
7
- } from "./chunk-KHO3HMX6.js";
7
+ } from "./chunk-Y4H75NIO.js";
8
8
  import {
9
9
  isValidTagName,
10
10
  parseTagNames,
@@ -137,7 +137,15 @@ var BuildAssetMap = class _BuildAssetMap {
137
137
  this.rootConfig = rootConfig;
138
138
  this.srcToAsset = /* @__PURE__ */ new Map();
139
139
  }
140
- async get(src) {
140
+ get(src) {
141
+ const asset = this.find(src);
142
+ if (asset) {
143
+ return asset;
144
+ }
145
+ console.log(`could not find build asset: ${src}`);
146
+ return null;
147
+ }
148
+ find(src) {
141
149
  const asset = this.srcToAsset.get(src);
142
150
  if (asset) {
143
151
  return asset;
@@ -149,8 +157,7 @@ var BuildAssetMap = class _BuildAssetMap {
149
157
  return asset2;
150
158
  }
151
159
  }
152
- console.log(`could not find build asset: ${src}`);
153
- return null;
160
+ return void 0;
154
161
  }
155
162
  add(asset) {
156
163
  this.srcToAsset.set(asset.src, asset);
@@ -232,6 +239,9 @@ function realPathRelativeTo(rootDir, src) {
232
239
  const realpath = fs2.realpathSync(path2.resolve(rootDir, src));
233
240
  return path2.relative(rootDir, realpath);
234
241
  }
242
+ function isJsAssetUrl(assetUrl) {
243
+ return assetUrl.endsWith(".js") || assetUrl.endsWith(".mjs");
244
+ }
235
245
  var BuildAsset = class {
236
246
  src;
237
247
  assetUrl;
@@ -259,6 +269,12 @@ var BuildAsset = class {
259
269
  await this.collectJs(this, deps, visited);
260
270
  return Array.from(deps);
261
271
  }
272
+ async getModulePreloadDeps() {
273
+ const visited = /* @__PURE__ */ new Set([this.src]);
274
+ const deps = /* @__PURE__ */ new Set();
275
+ await this.collectModulePreload(this.importedModules, deps, visited);
276
+ return Array.from(deps);
277
+ }
262
278
  async collectJs(asset, urls, visited) {
263
279
  if (!asset) {
264
280
  return;
@@ -280,6 +296,28 @@ var BuildAsset = class {
280
296
  })
281
297
  );
282
298
  }
299
+ /**
300
+ * Walks `srcs` and their transitive imports, collecting the JS chunk URL of
301
+ * every module along the way.
302
+ */
303
+ async collectModulePreload(srcs, urls, visited) {
304
+ await Promise.all(
305
+ srcs.map(async (src) => {
306
+ if (visited.has(src)) {
307
+ return;
308
+ }
309
+ visited.add(src);
310
+ const asset = await this.assetMap.get(src);
311
+ if (!asset || !asset.src) {
312
+ return;
313
+ }
314
+ if (asset.assetUrl && isJsAssetUrl(asset.assetUrl)) {
315
+ urls.add(asset.assetUrl);
316
+ }
317
+ await this.collectModulePreload(asset.importedModules, urls, visited);
318
+ })
319
+ );
320
+ }
283
321
  async collectCss(asset, urls, visited) {
284
322
  if (!asset) {
285
323
  return;
@@ -371,4 +409,4 @@ export {
371
409
  BuildAssetMap,
372
410
  buildPage
373
411
  };
374
- //# sourceMappingURL=chunk-M3E4RKS7.js.map
412
+ //# sourceMappingURL=chunk-DLPHCMFV.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/node/element-graph.ts", "../src/render/asset-map/build-asset-map.ts", "../src/cli/build-page.ts"],
4
+ "sourcesContent": ["import fs from 'node:fs';\nimport path from 'node:path';\nimport glob from 'tiny-glob';\nimport {searchForWorkspaceRoot} from 'vite';\nimport {RootConfig} from '../core/config.js';\nimport {isValidTagName, parseTagNames} from '../utils/elements.js';\nimport {directoryContains, isDirectory, isJsFile} from '../utils/fsutils.js';\nimport type {ResolvedPod} from './pod-collector.js';\n\ninterface ElementSourceFile {\n /** Full file path. */\n filePath: string;\n /** Path relative to the root project directory. */\n relPath: string;\n}\n\n/**\n * Dependency graph for element files to capture which other elements are used\n * by any particular element.\n */\nexport class ElementGraph {\n /**\n * Element tagName => sourceFile.\n */\n readonly sourceFiles: {[tagName: string]: ElementSourceFile} = {};\n\n /**\n * Element tagName => set of element tagName dependencies.\n */\n private deps: Record<string, string[]> = {};\n\n constructor(sourceFiles: {[tagName: string]: ElementSourceFile}) {\n this.sourceFiles = sourceFiles;\n }\n\n toJson() {\n for (const tagName in this.sourceFiles) {\n this.deps[tagName] ??= this.parseDepsFromSource(tagName);\n }\n return {\n sourceFiles: this.sourceFiles,\n deps: this.deps,\n };\n }\n\n static fromJson(data: {deps: any; sourceFiles: any}) {\n const graph = new ElementGraph(data.sourceFiles);\n graph.deps = data.deps;\n return graph;\n }\n\n getDeps(tagName: string, visited?: Set<string>): string[] {\n visited ??= new Set();\n if (visited.has(tagName)) {\n return [];\n }\n\n visited.add(tagName);\n this.deps[tagName] ??= this.parseDepsFromSource(tagName);\n\n const deps = new Set(this.deps[tagName]);\n for (const depTagName of this.deps[tagName]) {\n for (const childDep of this.getDeps(depTagName, visited)) {\n deps.add(childDep);\n }\n }\n return Array.from(deps);\n }\n\n /**\n * Parses an element's source file for usage of other custom elements.\n */\n private parseDepsFromSource(tagName: string): string[] {\n const srcFile = this.sourceFiles[tagName];\n if (!srcFile) {\n throw new Error(`could not find file path for tagName <${tagName}>`);\n }\n const src = fs.readFileSync(srcFile.filePath, 'utf-8');\n const tagNames = parseTagNames(src);\n const deps = new Set<string>();\n for (const depTagName of tagNames) {\n if (depTagName !== tagName && depTagName in this.sourceFiles) {\n deps.add(depTagName);\n }\n }\n return Array.from(deps);\n }\n}\n\n/**\n * Returns a map of all the element file definitions in the project.\n */\nexport async function getElements(\n rootConfig: RootConfig,\n pods?: ResolvedPod[]\n): Promise<ElementGraph> {\n const rootDir = rootConfig.rootDir;\n\n const elementsDirs = getElementsDirs(rootConfig, pods);\n const excludePatterns = rootConfig.elements?.exclude || [];\n const excludeElement = (moduleId: string) => {\n return excludePatterns.some((pattern) => Boolean(moduleId.match(pattern)));\n };\n\n const elementFilePaths: {[tagName: string]: ElementSourceFile} = {};\n for (const dirPath of elementsDirs) {\n if (await isDirectory(dirPath)) {\n const files = await glob('**/*', {cwd: dirPath});\n files.forEach((file) => {\n const parts = path.parse(file);\n if (isJsFile(parts.base) && isValidTagName(parts.name)) {\n const tagName = parts.name;\n const filePath = path.join(dirPath, file);\n const relPath = path.relative(rootDir, filePath);\n if (!excludeElement(relPath)) {\n elementFilePaths[tagName] = {filePath, relPath};\n }\n }\n });\n }\n }\n\n const graph = new ElementGraph(elementFilePaths);\n return graph;\n}\n\n/**\n * Get all element dirs.\n */\nexport function getElementsDirs(rootConfig: RootConfig, pods?: ResolvedPod[]) {\n const rootDir = rootConfig.rootDir;\n const workspaceRoot = searchForWorkspaceRoot(rootDir);\n\n const elementsDirs = [path.join(rootDir, 'elements')];\n const elementsInclude = rootConfig.elements?.include || [];\n\n for (const dirPath of elementsInclude) {\n const elementsDir = path.resolve(rootDir, dirPath);\n if (!directoryContains(rootDir, elementsDir)) {\n throw new Error(\n `the elements dir (${dirPath}) should be within the project's workspace (${workspaceRoot})`\n );\n }\n elementsDirs.push(elementsDir);\n }\n\n // Pod-contributed element dirs bypass the workspace containment check\n // because they are trusted (registered by plugins, not user input).\n if (pods) {\n for (const pod of pods) {\n for (const dir of pod.elementsDirs) {\n elementsDirs.push(dir);\n }\n }\n }\n\n return elementsDirs;\n}\n", "import fs from 'node:fs';\nimport path from 'node:path';\nimport {Manifest} from 'vite';\nimport {RootConfig} from '../../core/config.js';\nimport {ElementGraph} from '../../node/element-graph.js';\nimport {isJsFile} from '../../utils/fsutils.js';\nimport {Asset, AssetMap} from './asset-map.js';\n\nexport type BuildAssetManifest = Record<\n string,\n {\n src: string;\n assetUrl: string;\n importedModules: string[];\n importedCss: string[];\n isElement: boolean;\n }\n>;\n\n/**\n * A pod route, used to alias the route's virtual `pod/<name>/...` src to the\n * real asset built from the route's file. See `fromViteManifest()`.\n */\nexport interface PodRouteAsset {\n /** Virtual src, e.g. `pod/<name>/<relPath>`. */\n src: string;\n /** Absolute path to the pod route file. */\n filePath: string;\n}\n\nexport class BuildAssetMap implements AssetMap {\n private rootConfig: RootConfig;\n private srcToAsset: Map<string, BuildAsset>;\n\n constructor(rootConfig: RootConfig) {\n this.rootConfig = rootConfig;\n this.srcToAsset = new Map();\n }\n\n get(src: string): Asset | null {\n const asset = this.find(src);\n if (asset) {\n return asset;\n }\n console.log(`could not find build asset: ${src}`);\n return null;\n }\n\n private find(src: string): BuildAsset | undefined {\n const asset = this.srcToAsset.get(src);\n if (asset) {\n return asset;\n }\n // Try resolving the realpath of the asset, following symlinks.\n const realSrc = realPathRelativeTo(this.rootConfig.rootDir, src);\n if (realSrc !== src) {\n const asset = this.srcToAsset.get(realSrc);\n if (asset) {\n return asset;\n }\n }\n return undefined;\n }\n\n private add(asset: BuildAsset) {\n this.srcToAsset.set(asset.src, asset);\n }\n\n toJson(): BuildAssetManifest {\n const result: BuildAssetManifest = {};\n for (const src of this.srcToAsset.keys()) {\n result[src] = this.srcToAsset.get(src)!.toJson();\n }\n return result;\n }\n\n static fromViteManifest(\n rootConfig: RootConfig,\n clientManifest: Manifest,\n elementsGraph: ElementGraph,\n podRoutes: PodRouteAsset[] = []\n ) {\n const assetMap = new BuildAssetMap(rootConfig);\n\n const elementFiles = new Set();\n Object.values(elementsGraph.sourceFiles).forEach((elementSource) => {\n elementFiles.add(elementSource.relPath);\n // Vite will resolve symlinks, so we need to follow the src and add the\n // realpath to the element files.\n const realSrc = realPathRelativeTo(\n rootConfig.rootDir,\n elementSource.relPath\n );\n if (realSrc !== elementSource.filePath) {\n elementFiles.add(realSrc);\n }\n });\n\n Object.keys(clientManifest).forEach((manifestKey) => {\n const src = manifestKey;\n const manifestChunk = clientManifest[manifestKey];\n const isElement = elementFiles.has(src);\n // NOTES(stevenle): routes/ files are included in the manifest for\n // their CSS deps, but do not have an asset URL.\n const assetUrl =\n src.startsWith('routes/') && isJsFile(src)\n ? ''\n : `/${manifestChunk.file}`;\n const assetData = {\n src: src,\n assetUrl: assetUrl,\n importedModules: manifestChunk.imports || [],\n importedCss: (manifestChunk.css || []).map((relPath) => `/${relPath}`),\n isElement: isElement,\n };\n assetMap.add(new BuildAsset(assetMap, assetData));\n });\n\n // Pod routes are looked up by their virtual `pod/<name>/...` src at render\n // time, but the manifest keys them by their real file path. Register an\n // alias for each pod route so `get(route.src)` resolves to the built asset\n // (and the route's CSS deps are collected) instead of logging\n // \"could not find build asset\". Like user `routes/`, the alias has no asset\n // URL of its own (the route's client JS is injected via elements/bundles).\n podRoutes.forEach((podRoute) => {\n if (assetMap.srcToAsset.has(podRoute.src)) {\n return;\n }\n const relPath = path\n .relative(rootConfig.rootDir, podRoute.filePath)\n .replace(/\\\\/g, '/');\n // `realPathRelativeTo()` returns a `path.relative()` result with\n // OS-specific separators; normalize to forward slashes to match the\n // manifest keys (and `relPath` above) on Windows/symlinked setups.\n const realPath = realPathRelativeTo(rootConfig.rootDir, relPath).replace(\n /\\\\/g,\n '/'\n );\n const candidateKeys = [relPath, realPath];\n for (const key of candidateKeys) {\n const asset = assetMap.srcToAsset.get(key);\n if (asset) {\n assetMap.add(\n new BuildAsset(assetMap, {\n ...asset.toJson(),\n src: podRoute.src,\n assetUrl: '',\n })\n );\n break;\n }\n }\n });\n\n return assetMap;\n }\n\n static fromRootManifest(\n rootConfig: RootConfig,\n rootManifest: BuildAssetManifest\n ) {\n const assetMap = new BuildAssetMap(rootConfig);\n Object.keys(rootManifest).forEach((moduleId) => {\n const assetData = rootManifest[moduleId];\n assetMap.add(new BuildAsset(assetMap, assetData));\n });\n return assetMap;\n }\n}\n\n/**\n * Returns the realpath of a src file, relative to the rootDir.\n */\nfunction realPathRelativeTo(rootDir: string, src: string) {\n const fullPath = path.resolve(rootDir, src);\n if (!fs.existsSync(fullPath)) {\n return src;\n }\n const realpath = fs.realpathSync(path.resolve(rootDir, src));\n return path.relative(rootDir, realpath);\n}\n\n/**\n * Returns true if a serving URL points to a JS module.\n */\nfunction isJsAssetUrl(assetUrl: string) {\n return assetUrl.endsWith('.js') || assetUrl.endsWith('.mjs');\n}\n\nexport class BuildAsset {\n src: string;\n assetUrl: string;\n private assetMap: BuildAssetMap;\n private importedModules: string[];\n private importedCss: string[];\n isElement: boolean;\n\n constructor(\n assetMap: BuildAssetMap,\n assetData: {\n src: string;\n assetUrl: string;\n importedModules: string[];\n importedCss: string[];\n isElement: boolean;\n }\n ) {\n this.assetMap = assetMap;\n this.src = assetData.src;\n this.assetUrl = assetData.assetUrl;\n this.importedModules = assetData.importedModules;\n this.importedCss = assetData.importedCss;\n this.isElement = assetData.isElement;\n }\n\n async getCssDeps(): Promise<string[]> {\n const visited = new Set<string>();\n const deps = new Set<string>();\n await this.collectCss(this, deps, visited);\n return Array.from(deps);\n }\n\n async getJsDeps(): Promise<string[]> {\n const visited = new Set<string>();\n const deps = new Set<string>();\n await this.collectJs(this, deps, visited);\n return Array.from(deps);\n }\n\n async getModulePreloadDeps(): Promise<string[]> {\n // Seed `visited` with this asset so that the walk starts at the imported\n // modules and this asset's own URL is left out of the results.\n const visited = new Set<string>([this.src]);\n const deps = new Set<string>();\n await this.collectModulePreload(this.importedModules, deps, visited);\n return Array.from(deps);\n }\n\n private async collectJs(\n asset: BuildAsset | null,\n urls: Set<string>,\n visited: Set<string>\n ) {\n if (!asset) {\n return;\n }\n if (!asset.src) {\n return;\n }\n if (visited.has(asset.src)) {\n return;\n }\n visited.add(asset.src);\n if (asset.isElement) {\n urls.add(asset.assetUrl);\n }\n await Promise.all(\n asset.importedModules.map(async (src) => {\n const importedAsset = (await this.assetMap.get(src)) as BuildAsset;\n this.collectJs(importedAsset, urls, visited);\n })\n );\n }\n\n /**\n * Walks `srcs` and their transitive imports, collecting the JS chunk URL of\n * every module along the way.\n */\n private async collectModulePreload(\n srcs: string[],\n urls: Set<string>,\n visited: Set<string>\n ) {\n await Promise.all(\n srcs.map(async (src) => {\n if (visited.has(src)) {\n return;\n }\n visited.add(src);\n const asset = (await this.assetMap.get(src)) as BuildAsset | null;\n if (!asset || !asset.src) {\n return;\n }\n // Route files have no asset URL of their own, and CSS deps are\n // injected as stylesheets rather than preloaded.\n if (asset.assetUrl && isJsAssetUrl(asset.assetUrl)) {\n urls.add(asset.assetUrl);\n }\n await this.collectModulePreload(asset.importedModules, urls, visited);\n })\n );\n }\n\n private async collectCss(\n asset: BuildAsset | null,\n urls: Set<string>,\n visited: Set<string>\n ) {\n if (!asset) {\n return;\n }\n if (!asset.src) {\n return;\n }\n if (visited.has(asset.src)) {\n return;\n }\n visited.add(asset.src);\n if (asset.importedCss) {\n asset.importedCss.forEach((cssUrl) => urls.add(cssUrl));\n }\n await Promise.all(\n asset.importedModules.map(async (moduleId) => {\n const importedAsset = (await this.assetMap.get(moduleId)) as BuildAsset;\n this.collectCss(importedAsset, urls, visited);\n })\n );\n }\n\n toJson() {\n return {\n src: this.src,\n assetUrl: this.assetUrl,\n importedModules: this.importedModules,\n importedCss: this.importedCss,\n isElement: this.isElement,\n };\n }\n}\n", "import path from 'node:path';\n\nimport {RootConfig} from '../core/config.js';\nimport {Route} from '../core/types.js';\nimport {transformHtml} from '../render/html-transform.js';\nimport {makeDir, writeFile} from '../utils/fsutils.js';\n\ntype Renderer = import('../render/render.js').Renderer;\n\n/** A single page to build during the SSG phase of `root build`. */\nexport interface BuildPageTask {\n /** The url path to build, e.g. `/intl/de/about/`. */\n urlPath: string;\n /** Route params used to build the page. */\n params: Record<string, string>;\n /**\n * The route's src file (e.g. `routes/blog/[slug].tsx`). Used by worker\n * threads to disambiguate overlapping routes that match the same url path.\n */\n routeSrc?: string;\n /** The route's locale, used with `routeSrc` to disambiguate routes. */\n locale?: string;\n}\n\n/** The result of building a single page. */\nexport interface BuildPageResult {\n urlPath: string;\n /** Output file path relative to the build dir. Unset when `notFound`. */\n outFilePath?: string;\n notFound?: boolean;\n /** Whether the output was generated via `getStaticContent()`. */\n staticContent?: boolean;\n}\n\n/** Message sent from the build worker to the main thread. */\nexport type BuildWorkerResponse =\n | {type: 'ready'}\n | {type: 'result'; id: number; result: BuildPageResult}\n | {\n type: 'error';\n id: number;\n urlPath: string;\n params: Record<string, string>;\n routeSrc?: string;\n error: string;\n }\n | {type: 'fatal'; error: string};\n\n/** Message sent from the main thread to the build worker. */\nexport type BuildWorkerRequest = {\n type: 'render';\n id: number;\n task: BuildPageTask;\n};\n\n/**\n * Builds a single page (or static content file) to the build dir. Shared by\n * the in-process SSG build loop and the `--threads` build worker.\n */\nexport async function buildPage(\n renderer: Renderer,\n rootConfig: RootConfig,\n buildDir: string,\n route: Route,\n task: BuildPageTask\n): Promise<BuildPageResult> {\n const {urlPath, params} = task;\n const routeModule = route.module;\n if (routeModule.getStaticContent) {\n let props: any;\n if (routeModule.getStaticProps) {\n props = await routeModule.getStaticProps({\n rootConfig,\n params,\n });\n if (props?.notFound) {\n return {urlPath, notFound: true};\n }\n } else {\n props = {rootConfig, params};\n }\n const result = await routeModule.getStaticContent(props);\n let body: string;\n if (typeof result === 'string') {\n body = result;\n } else if (result && typeof result === 'object') {\n body = result.body;\n } else {\n body = '';\n }\n const outFilePath = urlPath.slice(1);\n const outPath = path.join(buildDir, outFilePath);\n await makeDir(path.dirname(outPath));\n await writeFile(outPath, normalizeLineEndings(body));\n return {urlPath, outFilePath, staticContent: true};\n }\n\n const data = await renderer.renderRoute(route, {\n routeParams: params,\n });\n if (data.notFound) {\n return {urlPath, notFound: true};\n }\n\n let outFilePath = path.join(urlPath.slice(1), 'index.html');\n if (outFilePath.endsWith('404/index.html')) {\n outFilePath = outFilePath.replace('404/index.html', '404.html');\n }\n const outPath = path.join(buildDir, outFilePath);\n\n const html = await transformHtml(data.html || '', rootConfig);\n await writeFile(outPath, normalizeLineEndings(html));\n return {urlPath, outFilePath};\n}\n\nexport function normalizeLineEndings(str: string): string {\n return str.replace(/\\r\\n?/g, '\\n');\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,SAAQ,8BAA6B;AAiB9B,IAAM,eAAN,MAAM,cAAa;AAAA;AAAA;AAAA;AAAA,EAIf,cAAsD,CAAC;AAAA;AAAA;AAAA;AAAA,EAKxD,OAAiC,CAAC;AAAA,EAE1C,YAAY,aAAqD;AAC/D,SAAK,cAAc;AAAA,EACrB;AAAA,EAEA,SAAS;AACP,eAAW,WAAW,KAAK,aAAa;AACtC,WAAK,KAAK,OAAO,MAAM,KAAK,oBAAoB,OAAO;AAAA,IACzD;AACA,WAAO;AAAA,MACL,aAAa,KAAK;AAAA,MAClB,MAAM,KAAK;AAAA,IACb;AAAA,EACF;AAAA,EAEA,OAAO,SAAS,MAAqC;AACnD,UAAM,QAAQ,IAAI,cAAa,KAAK,WAAW;AAC/C,UAAM,OAAO,KAAK;AAClB,WAAO;AAAA,EACT;AAAA,EAEA,QAAQ,SAAiB,SAAiC;AACxD,gBAAY,oBAAI,IAAI;AACpB,QAAI,QAAQ,IAAI,OAAO,GAAG;AACxB,aAAO,CAAC;AAAA,IACV;AAEA,YAAQ,IAAI,OAAO;AACnB,SAAK,KAAK,OAAO,MAAM,KAAK,oBAAoB,OAAO;AAEvD,UAAM,OAAO,IAAI,IAAI,KAAK,KAAK,OAAO,CAAC;AACvC,eAAW,cAAc,KAAK,KAAK,OAAO,GAAG;AAC3C,iBAAW,YAAY,KAAK,QAAQ,YAAY,OAAO,GAAG;AACxD,aAAK,IAAI,QAAQ;AAAA,MACnB;AA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SAAO,EAAC,SAAS,YAAW;AAC9B;AAEO,SAAS,qBAAqB,KAAqB;AACxD,SAAO,IAAI,QAAQ,UAAU,IAAI;AACnC;",
6
+ "names": ["fs", "path", "asset", "path", "fs", "path", "outFilePath", "outPath", "path"]
7
+ }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  isDirectory,
3
3
  isJsFile
4
- } from "./chunk-KHO3HMX6.js";
4
+ } from "./chunk-Y4H75NIO.js";
5
5
  import {
6
6
  getVitePlugins
7
7
  } from "./chunk-XSNCF7WU.js";
@@ -565,4 +565,4 @@ export {
565
565
  createViteServer,
566
566
  viteSsrLoadModule
567
567
  };
568
- //# sourceMappingURL=chunk-YU22SAIG.js.map
568
+ //# sourceMappingURL=chunk-QJ4F45DC.js.map