@verajs/renderer 0.1.4 → 0.2.0

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 (42) hide show
  1. package/README.md +1000 -12
  2. package/dist/development/vera-renderer-hydrate.d.ts +32 -13
  3. package/dist/development/vera-renderer-hydrate.d.ts.map +1 -1
  4. package/dist/development/vera-renderer-hydrate.js +1812 -234
  5. package/dist/development/vera-renderer-hydrate.js.map +1 -1
  6. package/dist/development/vera-renderer-keyed.d.ts +17 -0
  7. package/dist/development/vera-renderer-keyed.d.ts.map +1 -0
  8. package/dist/development/vera-renderer-keyed.js +322 -0
  9. package/dist/development/vera-renderer-keyed.js.map +1 -0
  10. package/dist/development/vera-renderer-profiler.d.ts +57 -17
  11. package/dist/development/vera-renderer-profiler.d.ts.map +1 -1
  12. package/dist/development/vera-renderer-profiler.js +1445 -209
  13. package/dist/development/vera-renderer-profiler.js.map +1 -1
  14. package/dist/development/vera-renderer-slots.d.ts +103 -0
  15. package/dist/development/vera-renderer-slots.d.ts.map +1 -0
  16. package/dist/development/vera-renderer-slots.js +1387 -0
  17. package/dist/development/vera-renderer-slots.js.map +1 -0
  18. package/dist/development/vera-renderer-spread.d.ts +51 -0
  19. package/dist/development/vera-renderer-spread.d.ts.map +1 -0
  20. package/dist/development/vera-renderer-spread.js +499 -0
  21. package/dist/development/vera-renderer-spread.js.map +1 -0
  22. package/dist/development/vera-renderer-tag.d.ts +61 -0
  23. package/dist/development/vera-renderer-tag.d.ts.map +1 -0
  24. package/dist/development/vera-renderer-tag.js +727 -0
  25. package/dist/development/vera-renderer-tag.js.map +1 -0
  26. package/dist/development/vera-renderer.d.ts +41 -16
  27. package/dist/development/vera-renderer.d.ts.map +1 -1
  28. package/dist/development/vera-renderer.js +1375 -200
  29. package/dist/development/vera-renderer.js.map +1 -1
  30. package/dist/vera-renderer-hydrate.min.js +1 -1
  31. package/dist/vera-renderer-hydrate.min.js.map +1 -1
  32. package/dist/vera-renderer-keyed.min.js +2 -0
  33. package/dist/vera-renderer-keyed.min.js.map +1 -0
  34. package/dist/vera-renderer-slots.min.js +2 -0
  35. package/dist/vera-renderer-slots.min.js.map +1 -0
  36. package/dist/vera-renderer-spread.min.js +2 -0
  37. package/dist/vera-renderer-spread.min.js.map +1 -0
  38. package/dist/vera-renderer-tag.min.js +2 -0
  39. package/dist/vera-renderer-tag.min.js.map +1 -0
  40. package/dist/vera-renderer.min.js +1 -1
  41. package/dist/vera-renderer.min.js.map +1 -1
  42. package/package.json +24 -1
@@ -1 +1 @@
1
- {"version":3,"file":"vera-renderer-profiler.js","sources":["../../../../../../src/renderer.ts","../../../../../../src/overlay.ts","../../../../../../src/profiler.ts"],"sourcesContent":["/**\n * @verajs/renderer — a ground-up, keyed, template-identity renderer.\n *\n * Replaces the Reef-derived renderer, which flattened every template to an HTML string and\n * re-parsed it on each change — O(whole template) work for a one-row edit, measured at 85 ms for a\n * two-row swap that lit-html does in 3.5 ms.\n *\n * The architecture here is the one that wins that benchmark:\n *\n * 1. A tagged template literal's `strings` array is frozen and IDENTICAL for every call from the\n * same call site, so it is a cache key for the template's static shape. The shape is parsed\n * ONCE into a `<template>` element with markers where the expressions go.\n * 2. Rendering clones that template and binds \"parts\" to the marker positions. Every later render\n * of the same shape only compares and commits the dynamic values — static content is never\n * touched again.\n * 3. Arrays reconcile KEYED (see `keyed()`), with head/tail fast paths and map-based moves, so a\n * reorder moves nodes instead of rebuilding them.\n *\n * Built in, where lit-html requires directive imports: keyed list reconciliation (`keyed`),\n * element refs (element-position expressions), toggled-DOM preservation (`hold`), and a\n * whole-range fast clear — one `textContent = ''` where lit removes thousands of nodes one at a\n * time. Like-for-like (lit-html + repeat + ref + cache: 5 021 B gzip), this file is ~28% smaller.\n *\n * What it deliberately does NOT have, which is why it is smaller than lit-html: no directive\n * protocol, no `noChange`/`nothing` sentinels (in a single-expression attribute, `null`/`undefined`\n * REMOVE the attribute; in a child, they clear it), no sanitizer indirection, no async parts, no\n * dev-mode branches.\n *\n * Known limits, deliberate and shared with lit-html's envelope: no bindings inside comments (the\n * value is consumed and ignored), no dynamic tag names, and nested `<template>` elements' contents\n * are not traversed.\n *\n * CONTRACTS THE SPEED PAYS FOR — these are the trade, documented rather than discovered:\n *\n * - **The renderer owns its container below the mount point.** The whole-range fast clear wipes\n * everything in a parent the part fully owns, including nodes user code appended there by hand\n * (lit-html would preserve them). Same contract as mounting Vue or React into a container.\n * - **Do not call `Node.normalize()` on rendered content.** Child anchors are text nodes, and\n * normalize merges adjacent text — lit-html's comment anchors are immune to this; ours are not.\n * - **A plain string renders as text, never as HTML.** The Reef renderer parsed strings as markup;\n * this one has no innerHTML sink at all (an XSS class removed). The deliberate escape hatch for\n * trusted markup is a property binding: `.innerHTML=${trusted}`.\n * - **Hydration is automatic and markerless.** The first render into a container that already has\n * children adopts them as server output of the same template (statics matched byte-for-byte,\n * anchors installed by splitting live text at known value positions), falling back to a clean\n * render on any mismatch. Requires the initial client render to match server state — same\n * contract as React/Vue hydration.\n * - **No directive protocol.** The template language itself is closed to extension — Vera extends\n * at the framework layer (inserts) and through element refs, not inside the renderer's value\n * handling.\n * - Event handlers are invoked with `this` bound to the ELEMENT (lit binds its host).\n *\n * NAMING NOTE: internal class fields and methods are `_`-prefixed because the production build\n * mangles properties matching /^_[a-z]/ (see defaultRollupConfig). That is what lets this file use\n * full descriptive names while still shipping one-letter properties — locals and top-level names\n * are mangled by default anyway, but property names are not. `_$litType$` and `handleEvent`\n * deliberately do not match the pattern: the first is an interop wire format, the second is called\n * by the DOM itself.\n */\n\nexport type TemplateResult = {\n /** 1 = html, 2 = svg, 3 = mathml — the markers core's built-in tags produce. */\n _$litType$?: number;\n strings: TemplateStringsArray;\n values: unknown[];\n /** Set by `keyed()`; drives keyed list reconciliation. */\n key?: unknown;\n};\n\n/**\n * Marks a template result with a stable key so list reconciliation moves it instead of rewriting\n * it. Key all items in a list or none — mixing is undefined behaviour, as are duplicate keys.\n *\n * ```js\n * rows.map((r) => keyed(r.id, html`<tr>...</tr>`))\n * ```\n */\nexport const keyed = <T>(key: unknown, result: T): T => {\n (result as TemplateResult).key = key;\n return result;\n};\n\n/**\n * Preserves the DOM of templates a child position toggles away from, instead of destroying it —\n * form values, scroll positions and media playback survive the round trip (lit-html calls this\n * `cache`). Stashed DOM is parked in its instance's own fragment and re-adopted on return.\n *\n * ```js\n * html`<div>${hold(editing ? editor() : viewer())}</div>`\n * ```\n */\nexport const hold = (result: TemplateResult): { $h: TemplateResult } => ({ $h: result });\n\n/**\n * Unique per module load, so user text can never collide with it. Randomness here cannot break\n * template caching — the marker only ever pairs a scan with its own Template construction.\n */\nconst MARKER = '$v' + ((Math.random() * 1e9) >>> 0).toString(36) + '$';\n/** `<?xyz>` parses as a bogus comment whose data is `?xyz`. */\nconst MARKER_COMMENT_DATA = '?' + MARKER;\n\nconst doc = document;\nconst comment = (data = '') => doc.createComment(data);\n\n/**\n * One walker for every template construction, re-aimed by assigning `currentNode`. Traversal of a\n * detached fragment cannot escape it — ascent stops at a null parent — and no walk is ever\n * re-entered mid-flight: an inner instantiation only begins after the outer walk has finished\n * collecting its parts.\n */\nconst markerWalker = doc.createTreeWalker(doc, 129 /* ELEMENT | COMMENT */);\n/**\n * Second shared walker for indexing and instantiation. Templates ship with NO marker comments —\n * every child slot's anchor is its primed text node — so instances index over elements and texts.\n * Marker comments exist only transiently during template construction, and are created lazily at\n * runtime only if a slot upgrades from text to template/array content. Sharing the walker saves a\n * TreeWalker allocation per instance, which is 10 000 allocations in a 10 000-row create.\n */\nconst instanceWalker = doc.createTreeWalker(doc, 5 /* ELEMENT | TEXT */);\n\nconst RAW_TEXT_TAGS = /^(?:script|style|textarea|title)$/i;\nconst ATTR_NAME_DELIMITER = /[\\s\"'>=/]/;\n\n/** What an expression position turned out to be. */\nconst CHILD = 0;\nconst ATTRIBUTE = 1;\nconst IGNORED = 2; // value consumed, nothing rendered (bindings inside comments, junk positions)\n\ntype Spec = { _type: 0 } | { _type: 1; _name: string } | { _type: 2 };\n\n/** Scanner states. */\nconst IN_TEXT = 0;\nconst IN_TAG = 1;\nconst IN_QUOTED_VALUE = 2; // a static quoted attribute value (no binding seen yet)\nconst IN_COMMENT = 3;\nconst IN_RAW_TEXT = 4; // inside <script>/<style>/<textarea>/<title>\nconst IN_BOUND_VALUE = 5; // collecting a bound attribute's statics\n\n/**\n * One pass over the template strings, producing parseable HTML with markers plus an ordered spec\n * list. Runs once per template shape, so clarity beats micro-optimisation here.\n *\n * A small state machine rather than tail regexes, because `>` inside quoted attribute values and\n * inside comments must not terminate a tag, and raw-text elements swallow markup.\n */\nconst scan = (strings: TemplateStringsArray) => {\n const specs: Spec[] = [];\n let markup = '';\n let state = IN_TEXT;\n let quote = '';\n let quoteStart = 0; // markup index of the opening quote while IN_QUOTED_VALUE\n let rawTag = ''; // which raw-text element we are inside\n let tagNameStart = 0; // markup index where the current tag's name begins\n let isClosing = false;\n let attrName = '';\n let statics: string[] = [];\n let pending = ''; // the static chunk currently being collected IN_BOUND_VALUE\n\n /** Backscan an attribute name that ends at `end` (exclusive); '' when malformed. */\n const attrNameBefore = (end: number) => {\n let at = end;\n while (at > 0 && !ATTR_NAME_DELIMITER.test(markup[at - 1])) at--;\n return markup.slice(at, end);\n };\n\n for (let i = 0; i < strings.length; i++) {\n const segment = strings[i];\n let pos = 0;\n while (pos < segment.length) {\n const ch = segment[pos];\n if (state === IN_BOUND_VALUE) {\n if (\n ch === quote ||\n (quote === '' && (ch === ' ' || ch === '\\t' || ch === '\\n' || ch === '\\r' || ch === '>' || ch === '/'))\n ) {\n /**\n * The bound attribute closes. Emit a marker attribute whose VALUE carries the statics\n * joined by the marker — reading them back from the parsed attribute means entities\n * arrive decoded, exactly as a static attribute would.\n */\n statics.push(pending);\n const quoteChar = quote || '\"';\n markup += ` ${specs.length}${MARKER}=${quoteChar}${statics.join(MARKER)}${quoteChar}`;\n specs.push({ _type: ATTRIBUTE, _name: attrName });\n state = IN_TAG;\n if (quote !== '') pos++; // consume the closing quote; unquoted terminators reprocess IN_TAG\n continue;\n }\n pending += ch;\n pos++;\n } else if (state === IN_TEXT) {\n if (ch === '<') {\n if (segment.startsWith('!--', pos + 1)) {\n state = IN_COMMENT;\n markup += '<!--';\n pos += 4;\n continue;\n }\n isClosing = segment[pos + 1] === '/';\n tagNameStart = markup.length + (isClosing ? 2 : 1);\n state = IN_TAG;\n }\n markup += ch;\n pos++;\n } else if (state === IN_TAG) {\n if (ch === '\"' || ch === \"'\") {\n quote = ch;\n quoteStart = markup.length;\n state = IN_QUOTED_VALUE;\n } else if (ch === '>') {\n const tagName = markup.slice(tagNameStart).match(/^[a-zA-Z][^\\s/>]*/)?.[0] ?? '';\n if (!isClosing && RAW_TEXT_TAGS.test(tagName) && !markup.endsWith('/')) {\n rawTag = tagName.toLowerCase();\n state = IN_RAW_TEXT;\n } else {\n state = IN_TEXT;\n }\n }\n markup += ch;\n pos++;\n } else if (state === IN_QUOTED_VALUE) {\n if (ch === quote) state = IN_TAG;\n markup += ch;\n pos++;\n } else if (state === IN_COMMENT) {\n if (ch === '-' && segment.startsWith('->', pos + 1)) {\n markup += '-->';\n pos += 3;\n state = IN_TEXT;\n continue;\n }\n markup += ch;\n pos++;\n } else {\n // IN_RAW_TEXT\n if (\n ch === '<' &&\n segment.slice(pos + 1, pos + 2 + rawTag.length).toLowerCase() === '/' + rawTag &&\n (pos + 2 + rawTag.length >= segment.length || /[\\s/>]/.test(segment[pos + 2 + rawTag.length]))\n ) {\n isClosing = true;\n tagNameStart = markup.length + 2;\n state = IN_TAG;\n }\n markup += ch;\n pos++;\n }\n }\n\n // ── expression boundary ──────────────────────────────────────────────────\n if (i === strings.length - 1) break;\n if (state === IN_TEXT) {\n markup += `<?${MARKER}>`;\n specs.push({ _type: CHILD });\n } else if (state === IN_RAW_TEXT) {\n markup += MARKER; // a text marker; comments cannot be parsed inside raw-text elements\n specs.push({ _type: CHILD });\n } else if (state === IN_COMMENT) {\n specs.push({ _type: IGNORED }); // binding inside a comment: consumed, ignored\n } else if (state === IN_BOUND_VALUE) {\n statics.push(pending); // this attribute spans another expression\n pending = '';\n } else if (state === IN_QUOTED_VALUE) {\n // expression inside a quoted attribute value -> becomes a bound attribute\n const name = markup[quoteStart - 1] === '=' ? attrNameBefore(quoteStart - 1) : '';\n if (name) {\n attrName = name;\n statics = [markup.slice(quoteStart + 1)]; // the static prefix already inside the quotes\n pending = '';\n markup = markup.slice(0, quoteStart - 1 - name.length); // cut `name=\"` back out\n state = IN_BOUND_VALUE;\n } else {\n specs.push({ _type: IGNORED });\n }\n } else {\n // IN_TAG: `name=${x}` unquoted, or an element-position expression\n const name = markup.endsWith('=') ? attrNameBefore(markup.length - 1) : '';\n if (name) {\n attrName = name;\n statics = [''];\n pending = '';\n quote = '';\n markup = markup.slice(0, markup.length - 1 - name.length);\n state = IN_BOUND_VALUE;\n } else {\n /**\n * Element-position expression — an element REF, not a no-op. Marked exactly like a bound\n * attribute ('&' cannot begin a real attribute binding), so no new machinery exists for it.\n */\n markup += ` ${specs.length}${MARKER}=\"${MARKER}\"`;\n specs.push({ _type: ATTRIBUTE, _name: '&' });\n }\n }\n }\n return { markup, specs };\n};\n\n/** A part's position and shape inside a Template, resolved to a node index for instantiation. */\ntype TemplatePart = {\n _type: 0 | 1 | 2;\n _index: number;\n _name?: string;\n _statics?: string[];\n _node?: Node; // only during construction, carrying identity between the two passes\n};\n\nconst templateCache = new WeakMap<TemplateStringsArray, Template>();\n\nclass Template {\n _element: HTMLTemplateElement;\n _parts: TemplatePart[] = [];\n\n constructor(result: TemplateResult) {\n const type = result._$litType$ ?? 1;\n const { markup, specs } = scan(result.strings);\n this._element = doc.createElement('template');\n /** svg/mathml fragments only parse inside their root; wrap, then unwrap below. */\n this._element.innerHTML = type === 2 ? `<svg>${markup}</svg>` : type === 3 ? `<math>${markup}</math>` : markup;\n const content = this._element.content;\n if (type !== 1) {\n const wrapper = content.firstChild!;\n while (wrapper.firstChild) content.insertBefore(wrapper.firstChild, wrapper);\n content.removeChild(wrapper);\n }\n\n /**\n * Pass 1 — DISCOVER over ELEMENT | COMMENT: pair scan specs with parsed nodes in document\n * order (which is expression order), and swap every marker comment for a primed empty text\n * node. The shipped template then contains no comments at all: each clone is three nodes\n * lighter per typical row, and the primed text doubles as both anchor and first-commit target.\n */\n markerWalker.currentNode = content;\n let specIndex = 0;\n let node: Node | null;\n const parts = this._parts;\n const consumeIgnored = () => {\n while (specIndex < specs.length && specs[specIndex]._type === IGNORED) {\n parts.push({ _type: IGNORED, _index: -1 });\n specIndex++;\n }\n };\n consumeIgnored();\n while (specIndex < specs.length && (node = markerWalker.nextNode()) !== null) {\n if (node.nodeType === 1) {\n const element = node as Element;\n if (element.hasAttributes()) {\n for (const attributeName of element.getAttributeNames()) {\n if (attributeName.endsWith(MARKER)) {\n /**\n * The marker attribute's value carries the statics; the REAL (case-preserved) name\n * comes from the spec — the HTML parser lowercases attribute names, which would\n * corrupt `.someProp`.\n */\n const spec = specs[specIndex++] as { _type: 1; _name: string };\n parts.push({\n _type: ATTRIBUTE,\n _index: -1,\n _name: spec._name,\n _statics: element.getAttribute(attributeName)!.split(MARKER),\n _node: element,\n });\n element.removeAttribute(attributeName);\n consumeIgnored();\n }\n }\n }\n if (RAW_TEXT_TAGS.test(element.tagName) && element.textContent!.includes(MARKER)) {\n /**\n * Comments cannot be PARSED inside raw-text elements, but they are legal DOM once\n * created — so the scan left text markers, and here they become real marker comments.\n * The walker visits them next and they pair as ordinary child parts.\n */\n const pieces = element.textContent!.split(MARKER);\n element.textContent = '';\n for (let p = 0; p < pieces.length - 1; p++) {\n if (pieces[p]) element.append(pieces[p]);\n element.append(comment(MARKER_COMMENT_DATA));\n }\n if (pieces[pieces.length - 1]) element.append(pieces[pieces.length - 1]);\n }\n } else if ((node as Comment).data === MARKER_COMMENT_DATA) {\n specIndex++;\n const primedText = doc.createTextNode('');\n node.parentNode!.insertBefore(primedText, node);\n /** Re-aim the walker before removing the node it stands on. */\n markerWalker.currentNode = primedText;\n (node as Comment).remove();\n parts.push({ _type: CHILD, _index: -1, _node: primedText });\n consumeIgnored();\n }\n }\n\n /** Pass 2 — INDEX over ELEMENT | TEXT, the mask instances walk with. */\n instanceWalker.currentNode = content;\n let nodeIndex = -1;\n let partIndex = 0;\n while (partIndex < parts.length && parts[partIndex]._type === IGNORED) partIndex++;\n while (partIndex < parts.length && (node = instanceWalker.nextNode()) !== null) {\n nodeIndex++;\n while (partIndex < parts.length && parts[partIndex]._node === node) {\n parts[partIndex]._index = nodeIndex;\n partIndex++;\n while (partIndex < parts.length && parts[partIndex]._type === IGNORED) partIndex++;\n }\n }\n for (const part of parts) part._node = undefined;\n }\n}\n\nconst getTemplate = (result: TemplateResult) => {\n let template = templateCache.get(result.strings);\n if (template === undefined) templateCache.set(result.strings, (template = new Template(result)));\n return template;\n};\n\n/** Anything bound to a live position: commits values[index..], returns the next value index. */\ninterface Part {\n _commit(values: unknown[], index: number): number;\n}\n\nconst IGNORED_PART: Part = { _commit: (_values, index) => index + 1 };\n\n/** Never equal to any user value, so the first commit always runs. */\nconst UNSET = {};\n\n/** Removal target: nodes moved here are dropped when it is emptied. */\nconst SCRATCH = doc.createDocumentFragment();\n\n/** A fresh markered part: two comments inserted before `ref` in `parent`. */\nconst createMarkeredPart = (parent: Node, ref: Node | null) => {\n const start = comment();\n const end = comment();\n parent.insertBefore(start, ref);\n parent.insertBefore(end, ref);\n return new ChildPart(start, end);\n};\n\nconst toText = (value: unknown) => (value == null ? '' : String(value));\n\n/** Binding kinds, resolved once from the attribute name's first character. */\nconst ATTR = 0; // plain attribute\nconst PROPERTY = 1; // .name\nconst BOOLEAN = 2; // ?name\nconst EVENT = 3; // @name\nconst REF = 4; // element-position expression\n\nclass AttrPart implements Part {\n _element: Element;\n _name: string;\n _statics: string[];\n _slots: number; // how many expression values this binding consumes\n _kind: number;\n _isFullValue: boolean; // exactly one expression with no static text around it\n _committed: unknown = UNSET;\n _handler: EventListener | null = null;\n\n constructor(element: Element, name: string, statics: string[]) {\n const first = name[0];\n let kind = first === '.' ? PROPERTY : first === '?' ? BOOLEAN : first === '@' ? EVENT : first === '&' ? REF : ATTR;\n let realName = kind ? name.slice(1) : name;\n /** React muscle-memory, buildless: `onClick=${fn}` ≡ `@click=${fn}`. Strictly `on` + a\n * capital — all-lowercase `onclick` stays a plain attribute (legal inline-handler HTML). */\n if (kind === ATTR && first === 'o' && name.charCodeAt(1) === 110 && name.charCodeAt(2) > 64 && name.charCodeAt(2) < 91) {\n kind = EVENT;\n realName = name.slice(2).toLowerCase();\n }\n this._kind = kind;\n this._name = realName;\n this._element = element;\n this._statics = statics;\n this._slots = statics.length - 1;\n this._isFullValue = this._slots === 1 && statics[0] === '' && statics[1] === '';\n }\n\n /** Stable listener registered once; swapping the handler never touches the DOM. */\n handleEvent(event: Event) {\n if (this._handler) this._handler.call(this._element as never, event);\n }\n\n _commit(values: unknown[], index: number): number {\n const kind = this._kind;\n let value: unknown;\n if (this._isFullValue || kind >= EVENT) {\n value = values[index]; // raw and uncoerced — events and refs receive the actual value\n } else {\n const statics = this._statics;\n let joined = statics[0];\n for (let i = 0; i < this._slots; i++) joined += toText(values[index + i]) + statics[i + 1];\n value = joined;\n }\n if (value !== this._committed) {\n /** On the very first commit the attribute does not exist, so a null needs no DOM call. */\n const isFirst = this._committed === UNSET;\n this._committed = value;\n if (kind === ATTR) {\n if (value == null) {\n if (!isFirst) this._element.removeAttribute(this._name);\n } else this._element.setAttribute(this._name, value as string);\n } else if (kind === PROPERTY) {\n const target = this._element as unknown as Record<string, unknown>;\n const name = this._name;\n target[name] = value;\n /**\n * Detection only, and deliberately not repair.\n *\n * A property set on a custom element that has not upgraded yet lands as an own property on\n * the instance. When the definition arrives — lazily imported, code-split, or a module that\n * simply had not run — `customElements.define` upgrades synchronously and the class's field\n * initializers execute. At target ES2022 a field declaration is a `[[Define]]`, so\n * `item?: T` emits `item;` and overwrites the bound value with `undefined`. Nothing throws;\n * it reads as broken reactivity.\n *\n * Repairing it was tried and removed. Re-applying when the slot came back `undefined`\n * covered `item?: T` but not `item = someDefault`, which overwrites with the default and\n * never looks clobbered — so the repair was silently partial, and made the bug intermittent\n * across two spellings of the same mistake. It also cost 74 B in every app while leaving\n * `declare` mandatory anyway, because a property assigned imperatively is unrecoverable:\n * the renderer never saw it, and by the time `init()` runs the value is already gone.\n *\n * So this is `__DEV__`-only and production pays nothing — no check, no message, no\n * `whenDefined` subscription. Lit reached the same place from the other direction and\n * throws (`lit.dev/msg/class-field-shadowing`); a warning suffices here because Vera has no\n * prototype accessors to shadow permanently — the damage is one lost value, not a property\n * that never updates again.\n */\n if (__DEV__) {\n const tag = this._element.localName;\n if (tag.indexOf('-') > 0 && !customElements.get(tag)) {\n customElements.whenDefined(tag).then(() => {\n /**\n * States what was observed rather than diagnosing it. A class field is the usual\n * cause by a wide margin, but a component that assigns the property itself during\n * upgrade produces the same observation, and that is a legitimate — if confusing —\n * thing to do, since the renderer's dirty check will not re-apply the bound value on\n * the next render either.\n */\n if (target[name] !== value)\n console.warn(\n `@verajs/renderer: the value bound by \\`.${name}=\\${…}\\` on <${tag}> was replaced ` +\n `while the element upgraded. A class field is the usual cause: at ES2022 ` +\n `\\`${name}?: …\\` emits \\`${name};\\`, which runs during upgrade and overwrites ` +\n `whatever was set beforehand — write it \\`declare ${name}?: …\\` instead, which ` +\n `emits nothing. A plain field also wipes properties assigned imperatively, ` +\n `which cannot be detected at all. Ignore this if the component replaced the ` +\n `value on purpose.`\n );\n });\n }\n }\n } else if (kind === BOOLEAN) {\n if (!isFirst || (value as boolean)) this._element.toggleAttribute(this._name, !!value);\n } else if (kind === EVENT) {\n if (this._handler === null && value != null) this._element.addEventListener(this._name, this);\n this._handler = (value as EventListener) ?? null;\n } else if (value != null) {\n /**\n * Element ref: `<input ${myRef} />`. A function is called with the element; an object gets\n * the element assigned to `.value` — which makes core's own `ref()` double as an element\n * ref, reactively. Runs once per distinct value, not once per render.\n */\n if (typeof value === 'function') (value as (el: Element) => void)(this._element);\n else if (typeof value === 'object') (value as { value: unknown }).value = this._element;\n // any other value type at element position is consumed and ignored\n }\n }\n return index + this._slots;\n }\n}\n\n/**\n * A list item is either ELEMENT-MODE — a single-root template instance whose one element IS the\n * item's boundary (`_element`/`_instance`/`_shape` set, `_part` null) — or a general markered\n * ChildPart. Rows are single-root in virtually every real list, and element mode drops both marker\n * comments and both marker inserts per item, which is exactly the per-row overhead a vdom does not\n * pay on create.\n */\ntype Item = {\n _key: unknown;\n _element: Element | null;\n _instance: Instance | null;\n _shape: TemplateStringsArray | null;\n _part: ChildPart | null;\n};\n\nclass Instance {\n _parts: Part[] = [];\n _fragment: DocumentFragment;\n\n constructor(template: Template) {\n /** cloneNode over importNode: same document, and it measures slightly cheaper. */\n this._fragment = template._element.content.cloneNode(true) as DocumentFragment;\n const templateParts = template._parts;\n /** Shared walker, ELEMENT | TEXT — child anchors are the primed text nodes themselves. */\n instanceWalker.currentNode = this._fragment;\n let nodeIndex = -1;\n let node: Node | null = null;\n for (let i = 0; i < templateParts.length; i++) {\n const templatePart = templateParts[i];\n if (templatePart._type === IGNORED) {\n this._parts.push(IGNORED_PART);\n continue;\n }\n while (nodeIndex < templatePart._index) {\n node = instanceWalker.nextNode();\n nodeIndex++;\n }\n this._parts.push(\n templatePart._type === CHILD\n ? new TextPart(node as Text)\n : new AttrPart(node as Element, templatePart._name!, templatePart._statics!)\n );\n }\n }\n\n _update(values: unknown[]) {\n let valueIndex = 0;\n const parts = this._parts;\n for (let i = 0; i < parts.length; i++) valueIndex = parts[i]._commit(values, valueIndex);\n }\n}\n\n/** A single property read — this runs once per list item per render, so it must be minimal. */\nconst isTemplateResult = (value: object): value is TemplateResult =>\n (value as TemplateResult).strings !== undefined;\n\n/**\n * The common case of a child expression is plain text, and the template primes every child slot\n * with a text node — so the steady state is compare-and-assign on `.data`. This part carries only\n * that, upgrading itself to a full ChildPart the first time it sees null, a template, or an array.\n */\nclass TextPart implements Part {\n _text: Text;\n _value: unknown = '';\n _upgraded: ChildPart | null = null;\n\n constructor(text: Text) {\n this._text = text;\n }\n\n _commit(values: unknown[], index: number): number {\n const value = values[index];\n if (this._upgraded !== null) {\n this._upgraded._set(value);\n return index + 1;\n }\n if (value == null || typeof value === 'object') {\n /**\n * Upgrade in place: marker comments come into existence only now, anchored around the text\n * node, and the full part inherits the committed text state and delegates forever.\n *\n * BOTH markers are ours. Borrowing `this._text.nextSibling` as the end instead would hand\n * this part a boundary owned by the NEXT part — and the next part removes that very node\n * when it upgrades and clears its own text. The stale reference then makes `_clear()` walk\n * past the end of the child list. Owning both anchors also makes `_end === null` mean\n * exactly one thing: the root part, which really does own its container.\n */\n const start = comment();\n const end = comment();\n const parent = this._text.parentNode!;\n parent.insertBefore(start, this._text);\n parent.insertBefore(end, this._text.nextSibling);\n const part = new ChildPart(start, end);\n part._mode = TEXT;\n part._text = this._text;\n part._value = this._value;\n this._upgraded = part;\n part._set(value);\n return index + 1;\n }\n if (value !== this._value) {\n this._value = value;\n this._text.data = value as string;\n }\n return index + 1;\n }\n}\n\n/** What a ChildPart currently contains. */\nconst EMPTY = 0;\nconst TEXT = 1;\nconst TEMPLATE = 2;\nconst LIST = 3;\n\n/**\n * Development-only profiling hook, armed by `@verajs/renderer/profiler`. Null until something\n * arms it, so an unprofiled development render pays one null check per template commit.\n *\n * Every reference sits behind `__DEV__`, which `defineDev()` folds to `false` before terser runs —\n * so the declaration, the constants and every call site are removed from the production bundle.\n * Verified by byte comparison, not assumed.\n */\nconst PROFILE_UPDATE = 0; // same template identity — values committed in place\nconst PROFILE_CREATE = 1; // first template into an empty part\nconst PROFILE_REBUILD = 2; // template identity CHANGED — subtree torn down and rebuilt\nconst PROFILE_FRAME_START = 3;\nconst PROFILE_FRAME_END = 4;\n\ntype ProfileHook = (kind: number, subject: unknown, shape: TemplateStringsArray | null) => void;\nlet _profileHook: ProfileHook | null = null;\n/** @internal */\nconst _setProfileHook = (fn: ProfileHook | null) => {\n _profileHook = fn;\n};\n\nclass ChildPart implements Part {\n _start: Comment;\n /** Exclusive end of this part's range; null means \"to the end of the parent\". */\n _end: Node | null;\n _mode = EMPTY;\n _value: unknown;\n _text: Text | null = null;\n _instance: Instance | null = null;\n /** The committed template's strings identity — the same-template fast path in `_set`. */\n _shape: TemplateStringsArray | null = null;\n _items: Item[] | null = null;\n _keyedList = false;\n /** Held instances by template identity; survives clears so state outlives interim content. */\n _held: Map<TemplateStringsArray, Instance> | null = null;\n\n constructor(start: Comment, end: Node | null) {\n this._start = start;\n this._end = end;\n }\n\n _commit(values: unknown[], index: number): number {\n this._set(values[index]);\n return index + 1;\n }\n\n _insert(node: Node) {\n this._start.parentNode!.insertBefore(node, this._end);\n }\n\n _clear() {\n const parent = this._start.parentNode!;\n const end = this._end;\n /**\n * When this part owns its parent's entire contents, one `textContent = ''` replaces removing\n * every node individually. For a 1 000-row table body that is the difference between ~22 ms\n * (lit-html's per-node teardown) and ~5 ms.\n *\n * A part owns the whole parent when nothing precedes its start AND nothing follows its end —\n * `_end === null` (a root part, which runs to the end by definition) or `_end` is the last\n * child. The second case is the common one and used to miss this path entirely: every list\n * written as `<tbody>${rows}</tbody>` sits inside a template, and since 0.1.2 a nested part\n * always owns an end marker, so `_end === null` alone never held for it.\n *\n * Re-appending both anchors in order restores the part's boundary exactly as it was.\n */\n if (this._start.previousSibling === null && (end === null || end.nextSibling === null)) {\n parent.textContent = '';\n parent.appendChild(this._start);\n if (end !== null) parent.appendChild(end);\n } else {\n let node = this._start.nextSibling;\n /**\n * `node !== null` is a backstop, not an expected exit. Reaching the end of the child list\n * without meeting `_end` means something detached this part's boundary; stopping leaves\n * nodes behind, which beats throwing out of the middle of a render pass.\n */\n while (node !== null && node !== this._end) {\n const next = node.nextSibling;\n parent.removeChild(node);\n node = next;\n }\n }\n this._mode = EMPTY;\n this._text = null;\n this._instance = null;\n this._items = null;\n this._shape = null;\n }\n\n _set(value: unknown) {\n if (value == null) {\n if (this._mode !== EMPTY) this._clear();\n return;\n }\n if (typeof value !== 'object') {\n if (this._mode === TEXT) {\n if (this._value !== value) {\n this._value = value;\n this._text!.data = value as string; // the DOM coerces numbers etc.\n }\n } else {\n if (this._mode !== EMPTY) this._clear();\n this._text = doc.createTextNode(value as string);\n this._insert(this._text);\n this._value = value;\n this._mode = TEXT;\n }\n return;\n }\n const heldResult = (value as { $h?: TemplateResult }).$h;\n if (heldResult !== undefined) {\n this._commitHeld(heldResult);\n return;\n }\n if (isTemplateResult(value)) {\n /**\n * Same-shape fast path on `strings` identity alone — no template-cache lookup. This is the\n * hottest line in a keyed list update: for every row whose shape did not change (all of\n * them, in practice), commit costs one identity compare before touching the values.\n */\n if (this._shape === value.strings) {\n if (__DEV__ && _profileHook) _profileHook(PROFILE_UPDATE, this, value.strings);\n this._instance!._update(value.values);\n return;\n }\n /**\n * Reaching here with a template already committed means the identity changed, so the\n * subtree below is about to be destroyed and rebuilt rather than updated. That is what\n * `?hidden=${…}` over a swapped subtree exists to avoid, and it is otherwise invisible.\n */\n if (__DEV__ && _profileHook) {\n _profileHook(this._mode === TEMPLATE ? PROFILE_REBUILD : PROFILE_CREATE, this, value.strings);\n }\n const template = getTemplate(value);\n if (this._mode !== EMPTY) this._clear();\n const instance = new Instance(template);\n instance._update(value.values);\n this._insert(instance._fragment);\n this._instance = instance;\n this._shape = value.strings;\n this._mode = TEMPLATE;\n return;\n }\n if (Array.isArray(value)) {\n this._commitList(value);\n return;\n }\n if (typeof (value as Iterable<unknown>)[Symbol.iterator] === 'function') {\n this._commitList([...(value as Iterable<unknown>)]);\n return;\n }\n // any other object: render as text\n this._set(String(value));\n }\n\n /** Commits a template while stashing whatever it replaces — see the `hold()` export. */\n _commitHeld(result: TemplateResult) {\n if (this._mode === TEMPLATE && this._shape === result.strings) {\n this._instance!._update(result.values);\n return;\n }\n const held = (this._held ??= new Map());\n if (this._mode === TEMPLATE) {\n /** Park the live nodes back in their instance's own (empty) fragment. */\n const fragment = this._instance!._fragment;\n let node = this._start.nextSibling;\n while (node !== this._end) {\n const next = node!.nextSibling;\n fragment.appendChild(node!);\n node = next;\n }\n held.set(this._shape!, this._instance!);\n } else if (this._mode !== EMPTY) {\n this._clear();\n }\n const instance = held.get(result.strings) ?? new Instance(getTemplate(result));\n instance._update(result.values);\n this._insert(instance._fragment);\n this._instance = instance;\n this._shape = result.strings;\n this._mode = TEMPLATE;\n }\n\n /**\n * Creates one list item. A single-root template instance becomes an element-mode item with no\n * markers at all; anything else gets its own start/end marker pair so moves can never dangle.\n */\n _createItem(value: unknown, parent: Node, ref: Node | null): Item {\n if (value !== null && typeof value === 'object' && (value as TemplateResult).strings !== undefined) {\n const result = value as TemplateResult;\n const template = getTemplate(result);\n const instance = new Instance(template);\n instance._update(result.values);\n const rootNode = instance._fragment.firstChild;\n if (rootNode !== null && rootNode.nodeType === 1 && rootNode.nextSibling === null) {\n parent.insertBefore(rootNode, ref);\n return {\n _key: result.key,\n _element: rootNode as Element,\n _instance: instance,\n _shape: result.strings,\n _part: null,\n };\n }\n /** Multi-root template: markered part, content already instantiated. */\n const part = createMarkeredPart(parent, ref);\n part._instance = instance;\n part._shape = result.strings;\n part._mode = TEMPLATE;\n part._start.parentNode!.insertBefore(instance._fragment, part._end);\n return { _key: result.key, _element: null, _instance: null, _shape: null, _part: part };\n }\n const part = createMarkeredPart(parent, ref);\n part._set(value);\n return { _key: (value as TemplateResult)?.key, _element: null, _instance: null, _shape: null, _part: part };\n }\n\n /** Commits a new value into an existing item, demoting element mode if the shape changed. */\n _updateItem(item: Item, value: unknown) {\n if (item._element !== null) {\n if (value !== null && typeof value === 'object' && (value as TemplateResult).strings === item._shape) {\n item._instance!._update((value as TemplateResult).values);\n return;\n }\n /** Shape changed: swap the bare element for a markered part in its place. */\n const part = createMarkeredPart(item._element.parentNode!, item._element);\n item._element.remove();\n item._element = null;\n item._instance = null;\n item._shape = null;\n (item._part = part)._set(value);\n return;\n }\n item._part!._set(value);\n }\n\n /** The item's first node — its move/removal handle and the insertion reference before it. */\n _firstNode(item: Item): Node {\n return item._element ?? item._part!._start;\n }\n\n _moveItem(item: Item, ref: Node | null, parent: Node = this._start.parentNode!) {\n if (item._element !== null) {\n parent.insertBefore(item._element, ref);\n return;\n }\n let node: Node | null = item._part!._start;\n const stop = item._part!._end!.nextSibling;\n while (node !== stop) {\n const next: Node | null = node!.nextSibling;\n parent.insertBefore(node!, ref);\n node = next;\n }\n }\n\n /** Removal is a move into a scratch fragment that is immediately emptied. */\n _dropItem(item: Item) {\n this._moveItem(item, null, SCRATCH);\n SCRATCH.textContent = '';\n }\n\n _commitList(newValues: unknown[]) {\n if (this._mode !== LIST) {\n if (this._mode !== EMPTY) this._clear();\n this._items = [];\n this._keyedList = false;\n this._mode = LIST;\n }\n const count = newValues.length;\n if (count === 0) {\n if (this._items!.length) {\n this._clear();\n this._items = [];\n this._mode = LIST;\n }\n return;\n }\n const isKeyed = newValues[0] != null && (newValues[0] as TemplateResult).key !== undefined;\n if (isKeyed !== this._keyedList && this._items!.length) {\n this._clear();\n this._items = [];\n this._mode = LIST;\n }\n this._keyedList = isKeyed;\n const items = this._items!;\n const parent = this._start.parentNode!;\n\n if (items.length === 0) {\n /** Initial fill builds off-document and lands in one insert. */\n const fragment = doc.createDocumentFragment();\n for (let i = 0; i < count; i++) items.push(this._createItem(newValues[i], fragment, null));\n this._insert(fragment);\n return;\n }\n\n if (!isKeyed) {\n // index mode: update in place, grow at the end, shrink from the end\n const shared = items.length < count ? items.length : count;\n for (let i = 0; i < shared; i++) this._updateItem(items[i], newValues[i]);\n if (count > items.length) {\n const fragment = doc.createDocumentFragment();\n for (let i = items.length; i < count; i++) items.push(this._createItem(newValues[i], fragment, null));\n this._insert(fragment);\n } else if (count < items.length) {\n const last = items[items.length - 1];\n let node: Node | null = this._firstNode(items[count]);\n const stop = last._element !== null ? last._element.nextSibling : last._part!._end!.nextSibling;\n while (node !== stop) {\n const next: Node | null = node!.nextSibling;\n parent.removeChild(node!);\n node = next;\n }\n items.length = count;\n }\n return;\n }\n\n /**\n * Zero-allocation fast path for the dominant case: same length, same key order — a pure\n * in-place update (a selection change, a field edit). No key array, no output array, no null\n * checks. Falls through to the full algorithm on the first mismatch; the items already updated\n * re-verify there as cheap no-op compares.\n */\n if (items.length === count) {\n let i = 0;\n while (i < count && items[i]._key === (newValues[i] as TemplateResult).key) {\n this._updateItem(items[i], newValues[i]);\n i++;\n }\n if (i === count) return;\n }\n\n /**\n * Keyed reconciliation — the standard head/tail algorithm (as in lit's `repeat` and Vue):\n * skip matching prefixes and suffixes, detect the two swap shapes directly, and fall back to\n * key maps for arbitrary moves, removals and insertions.\n */\n const oldItems: (Item | null)[] = items;\n const newKeys: unknown[] = new Array(count);\n for (let i = 0; i < count; i++) newKeys[i] = (newValues[i] as TemplateResult).key;\n const newItems: Item[] = new Array(count);\n let oldHead = 0;\n let oldTail = oldItems.length - 1;\n let newHead = 0;\n let newTail = count - 1;\n let newKeyToIndex: Map<unknown, number> | undefined;\n let oldKeyToIndex: Map<unknown, number> | undefined;\n const refAt = (i: number): Node | null =>\n i < count && newItems[i] !== undefined ? this._firstNode(newItems[i]) : this._end;\n\n while (oldHead <= oldTail && newHead <= newTail) {\n if (oldItems[oldHead] === null) oldHead++;\n else if (oldItems[oldTail] === null) oldTail--;\n else if (oldItems[oldHead]!._key === newKeys[newHead]) {\n this._updateItem((newItems[newHead] = oldItems[oldHead]!), newValues[newHead]);\n oldHead++;\n newHead++;\n } else if (oldItems[oldTail]!._key === newKeys[newTail]) {\n this._updateItem((newItems[newTail] = oldItems[oldTail]!), newValues[newTail]);\n oldTail--;\n newTail--;\n } else if (oldItems[oldHead]!._key === newKeys[newTail]) {\n const item = oldItems[oldHead]!;\n this._moveItem(item, refAt(newTail + 1));\n this._updateItem(item, newValues[newTail]);\n newItems[newTail] = item;\n oldHead++;\n newTail--;\n } else if (oldItems[oldTail]!._key === newKeys[newHead]) {\n const item = oldItems[oldTail]!;\n this._moveItem(item, this._firstNode(oldItems[oldHead]!));\n this._updateItem(item, newValues[newHead]);\n newItems[newHead] = item;\n oldTail--;\n newHead++;\n } else {\n if (newKeyToIndex === undefined) {\n newKeyToIndex = new Map();\n for (let i = newHead; i <= newTail; i++) newKeyToIndex.set(newKeys[i], i);\n oldKeyToIndex = new Map();\n for (let i = oldHead; i <= oldTail; i++) {\n if (oldItems[i] !== null) oldKeyToIndex.set(oldItems[i]!._key, i);\n }\n }\n if (!newKeyToIndex.has(oldItems[oldHead]!._key)) {\n this._dropItem(oldItems[oldHead]!);\n oldHead++;\n } else if (!newKeyToIndex.has(oldItems[oldTail]!._key)) {\n this._dropItem(oldItems[oldTail]!);\n oldTail--;\n } else {\n const oldIndex = oldKeyToIndex!.get(newKeys[newHead]);\n if (oldIndex === undefined) {\n newItems[newHead] = this._createItem(newValues[newHead], parent, this._firstNode(oldItems[oldHead]!));\n } else {\n const item = oldItems[oldIndex]!;\n this._moveItem(item, this._firstNode(oldItems[oldHead]!));\n this._updateItem(item, newValues[newHead]);\n newItems[newHead] = item;\n oldItems[oldIndex] = null;\n }\n newHead++;\n }\n }\n }\n while (newHead <= newTail) {\n newItems[newHead] = this._createItem(newValues[newHead], parent, refAt(newTail + 1));\n newHead++;\n }\n while (oldHead <= oldTail) {\n const item = oldItems[oldHead++];\n if (item !== null) this._dropItem(item);\n }\n this._items = newItems;\n }\n}\n\nconst rootParts = new WeakMap<Node, ChildPart>();\n\n/**\n * Renders a template result into a container. Slots into Vera via `setRenderer(render)`; core's\n * built-in `html` tag already produces the accepted shape, so no `setHtml` call is required —\n * though lit-html's `html` also works, its results being structurally identical.\n *\n * HYDRATION lives in `@verajs/renderer/hydrate` — a drop-in superset entry whose `render` adopts\n * existing server-rendered children on first render. SSR apps import from there instead of here;\n * this entry carries zero hydration code.\n */\nexport const render = (result: unknown, container: Node) => {\n if (__DEV__ && _profileHook) _profileHook(PROFILE_FRAME_START, container, null);\n let part = rootParts.get(container);\n if (part === undefined) {\n const marker = comment();\n container.appendChild(marker);\n rootParts.set(container, (part = new ChildPart(marker, null)));\n }\n part._set(result);\n if (__DEV__ && _profileHook) _profileHook(PROFILE_FRAME_END, container, null);\n};\n\n// ── INTERNAL SURFACE — imported by ./hydrate.ts, never re-exported by src/index.ts ─────────────\n// The public d.ts comes from src/index.ts, and the base bundles tree-shake all of this away, so\n// nothing here reaches consumers of the base entry. The hydrate entry compiles against this exact\n// source into its own self-contained bundle, so mangled property names always agree within it.\n\n/** @internal */\nexport {\n getTemplate,\n Template,\n Instance,\n TextPart,\n ChildPart,\n AttrPart,\n IGNORED_PART,\n IGNORED,\n TEMPLATE,\n LIST,\n comment,\n doc,\n toText,\n isTemplateResult,\n instanceWalker,\n rootParts,\n _setProfileHook,\n PROFILE_UPDATE,\n PROFILE_CREATE,\n PROFILE_REBUILD,\n PROFILE_FRAME_START,\n PROFILE_FRAME_END,\n};\n/** @internal */\nexport type { Part, Item, TemplatePart };\n","/**\n * The profiler's in-page panel — live counts and the current churn list, in the corner of the app\n * you are already clicking through.\n *\n * Three constraints shaped this:\n *\n * 1. **It must not render itself with the renderer.** Doing so would fold the overlay's own\n * commits into the numbers it reports. Everything here is plain DOM, updated in place.\n * 2. **It must not restyle the app.** It lives in a closed shadow root and sets every property it\n * depends on, so neither direction leaks.\n * 3. **It must work with no toolchain**, like everything else here — no CSS file, no framework,\n * one import.\n */\nimport type { ProfileReport } from './profiler.js';\n\nexport interface OverlayOptions {\n /** Corner to pin to. Default `bottom-right`. */\n corner?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';\n /** How often to repaint, in milliseconds. Default 400. */\n interval?: number;\n /** Churn rows to show before collapsing the rest into a count. Default 4. */\n rows?: number;\n}\n\nconst CSS = `\n:host { all: initial; }\n.panel {\n position: fixed; z-index: 2147483647;\n font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n color: #e6edf3; background: #0d1117ee; border: 1px solid #30363d; border-radius: 6px;\n box-shadow: 0 8px 24px #0008; width: 340px; max-width: calc(100vw - 24px);\n backdrop-filter: blur(6px);\n}\n.bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: default; }\n.dot { width: 7px; height: 7px; border-radius: 50%; background: #3fb950; flex: none; }\n.dot.idle { background: #6e7681; }\n.title { font-weight: 600; letter-spacing: .02em; flex: 1; }\nbutton {\n font: inherit; color: #e6edf3; background: #21262d; border: 1px solid #30363d;\n border-radius: 4px; padding: 1px 7px; cursor: pointer;\n}\nbutton:hover { background: #30363d; }\n.body { padding: 0 8px 8px; }\n.stats { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; margin-bottom: 6px; }\n.stats b { font-weight: 600; }\n.warn { color: #f0883e; }\n.good { color: #3fb950; }\n.churn { border-top: 1px solid #30363d; padding-top: 6px; }\n.churn h4 { margin: 0 0 4px; font-size: 11px; font-weight: 600; color: #f0883e; }\n.row { margin-bottom: 5px; }\n.where { color: #8b949e; }\n.tpl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.from { color: #ff7b72; }\n.to { color: #7ee787; }\n.hint { color: #8b949e; border-top: 1px solid #30363d; padding-top: 5px; margin-top: 2px; }\n.empty { color: #8b949e; }\n.collapsed .body { display: none; }\n`;\n\nconst CORNERS: Record<string, string> = {\n 'top-left': 'top:12px;left:12px;',\n 'top-right': 'top:12px;right:12px;',\n 'bottom-left': 'bottom:12px;left:12px;',\n 'bottom-right': 'bottom:12px;right:12px;',\n};\n\n/**\n * Mounts the panel and returns a function that removes it. Requires a DOM, so it is a no-op\n * (returning a no-op) anywhere without one.\n */\nexport const mountOverlay = (\n read: () => ProfileReport,\n isActive: () => boolean,\n control: { start: () => void; stop: () => void },\n options: OverlayOptions = {}\n): (() => void) => {\n if (typeof document === 'undefined' || document.body === null) return () => {};\n\n const { corner = 'bottom-right', interval = 400, rows = 4 } = options;\n\n const host = document.createElement('div');\n /**\n * Open, not closed. Style isolation is the same either way; closed only blocks script access,\n * which for a development tool costs more than it buys — you want to inspect this in devtools,\n * and it is what makes the panel testable.\n */\n const root = host.attachShadow({ mode: 'open' });\n const style = document.createElement('style');\n style.textContent = CSS;\n\n const panel = document.createElement('div');\n panel.className = 'panel';\n panel.setAttribute('style', CORNERS[corner] ?? CORNERS['bottom-right']);\n panel.innerHTML =\n '<div class=\"bar\">' +\n '<span class=\"dot\"></span><span class=\"title\">renderer profiler</span>' +\n '<button data-act=\"toggle\">stop</button>' +\n '<button data-act=\"reset\">reset</button>' +\n '<button data-act=\"fold\">–</button>' +\n '</div>' +\n '<div class=\"body\"><div class=\"stats\"></div><div class=\"churn\"></div></div>';\n\n root.append(style, panel);\n document.body.appendChild(host);\n\n const dot = panel.querySelector('.dot') as HTMLElement;\n const stats = panel.querySelector('.stats') as HTMLElement;\n const churn = panel.querySelector('.churn') as HTMLElement;\n const toggle = panel.querySelector('[data-act=\"toggle\"]') as HTMLButtonElement;\n const fold = panel.querySelector('[data-act=\"fold\"]') as HTMLButtonElement;\n\n const escape = (text: string) =>\n text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n\n const paint = () => {\n const report = read();\n const running = isActive();\n dot.className = running ? 'dot' : 'dot idle';\n toggle.textContent = running ? 'stop' : 'start';\n\n const commits = report.updates + report.creates + report.rebuilds;\n const share = commits === 0 ? 0 : Math.round((report.rebuilds / commits) * 100);\n stats.innerHTML =\n `<span>frames</span><b>${report.frames}</b>` +\n `<span>time in render</span><b>${report.ms.toFixed(1)}ms</b>` +\n `<span>slowest frame</span><b>${report.slowestFrameMs.toFixed(1)}ms</b>` +\n `<span>updated in place</span><b class=\"good\">${report.updates}</b>` +\n `<span>created</span><b>${report.creates}</b>` +\n `<span>rebuilt</span><b class=\"${report.rebuilds > 0 ? 'warn' : ''}\">` +\n `${report.rebuilds}${commits > 0 ? ` (${share}%)` : ''}</b>`;\n\n if (report.churn.length === 0) {\n churn.innerHTML =\n commits === 0\n ? '<div class=\"empty\">No renders recorded yet.</div>'\n : '<div class=\"empty good\">No template churn — every commit updated in place.</div>';\n return;\n }\n const shown = report.churn.slice(0, rows);\n const hidden = report.churn.length - shown.length;\n churn.innerHTML =\n '<h4>Torn down, not updated</h4>' +\n shown\n .map(\n (entry) =>\n `<div class=\"row\"><div class=\"where\">${entry.count}× at ${escape(entry.where)}</div>` +\n `<div class=\"tpl from\">${escape(entry.from)}</div>` +\n `<div class=\"tpl to\">→ ${escape(entry.to)}</div></div>`\n )\n .join('') +\n (hidden > 0 ? `<div class=\"where\">+${hidden} more</div>` : '') +\n '<div class=\"hint\">Prefer one stable template with <b>?hidden=${…}</b> over swapping subtrees.</div>';\n };\n\n panel.addEventListener('click', (event) => {\n const act = (event.target as HTMLElement)?.dataset?.act;\n if (act === 'toggle') {\n if (isActive()) control.stop();\n else control.start();\n } else if (act === 'reset') control.start();\n else if (act === 'fold') {\n const folded = panel.classList.toggle('collapsed');\n fold.textContent = folded ? '+' : '–';\n }\n paint();\n });\n\n paint();\n const timer = setInterval(paint, interval);\n\n return () => {\n clearInterval(timer);\n host.remove();\n };\n};\n","/**\n * `@verajs/renderer/profiler` — a development-only render profiler.\n *\n * **What it is for.** The renderer commits a template by identity: if `strings` is the same array\n * as last time, values are written in place; if it is a different array, the subtree is destroyed\n * and rebuilt. Writing `${cond ? html`<a/>` : html`<b/>`}` swaps identity on every toggle, so what\n * looks like an update is a teardown — which is why the house guidance is a stable shape with\n * `?hidden=${…}`. Nothing surfaces that today. This does: it counts in-place updates against\n * rebuilds and names the template pairs that churn.\n *\n * **How to use it.** This entry re-exports the renderer's whole public API, so point your importmap\n * (or bundler alias) at it instead of `@verajs/renderer` and nothing else changes:\n *\n * ```js\n * import { render, startProfiling, stopProfiling, formatReport } from '@verajs/renderer/profiler';\n * startProfiling();\n * // …drive the app…\n * console.log(formatReport(stopProfiling()));\n * ```\n *\n * **Development only, by construction.** The instrumentation in `renderer.ts` sits behind\n * `__DEV__`, which the build folds to `false` before terser runs — so a production renderer carries\n * no hook, no call sites and no cost, and this entry is not built for production at all. Profiling\n * minified, property-mangled output would not be meaningful anyway.\n *\n * Like `./hydrate.ts`, this bundle contains its own copy of the renderer. Import the app's renderer\n * *through* this entry; importing both side by side gives you two renderer modules with two\n * template caches, and the profiler would observe an instance nothing renders into.\n */\nimport {\n _setProfileHook,\n PROFILE_UPDATE,\n PROFILE_CREATE,\n PROFILE_REBUILD,\n PROFILE_FRAME_START,\n PROFILE_FRAME_END,\n} from './renderer.js';\nimport type { ChildPart } from './renderer.js';\nimport { mountOverlay } from './overlay.js';\nimport type { OverlayOptions } from './overlay.js';\n\nexport type { OverlayOptions } from './overlay.js';\n\nexport { render, keyed, hold } from './renderer.js';\nexport type { TemplateResult } from './renderer.js';\n\n/** One template identity replacing another at the same position, and how often. */\nexport interface Churn {\n /** The template that was torn down, rendered readably. */\n from: string;\n /** The template that replaced it. */\n to: string;\n /** How many times this exact swap happened while profiling. */\n count: number;\n /** Where in the DOM it happened, e.g. `main#app > ul.list`. First occurrence only. */\n where: string;\n}\n\nexport interface ProfileReport {\n /** Completed top-level `render()` calls. Nested renders are folded into their outermost frame. */\n frames: number;\n /** Total milliseconds spent inside `render()`. */\n ms: number;\n /** The slowest single frame, in milliseconds. */\n slowestFrameMs: number;\n /** Templates committed in place — the good path. */\n updates: number;\n /** Templates rendered into a slot that held nothing. Unavoidable and not a problem. */\n creates: number;\n /** Templates that replaced a *different* template — a teardown, not an update. */\n rebuilds: number;\n /** Rebuilds grouped by template pair, worst first. */\n churn: Churn[];\n}\n\nlet active = false;\nlet frames = 0;\nlet updates = 0;\nlet creates = 0;\nlet rebuilds = 0;\nlet totalMs = 0;\nlet slowestMs = 0;\nlet depth = 0;\nlet frameStart = 0;\nlet churn = new Map<string, Churn>();\n\n/** Stable ids for template identities, so grouping a rebuild costs two lookups and a concat. */\nlet nextId = 1;\nconst ids = new WeakMap<TemplateStringsArray, number>();\nconst idOf = (strings: TemplateStringsArray) => {\n let id = ids.get(strings);\n if (id === undefined) ids.set(strings, (id = nextId++));\n return id;\n};\n\n/** Readable one-line form of a template, cached — a rebuild loop would otherwise rebuild it too. */\nconst described = new WeakMap<TemplateStringsArray, string>();\nconst describe = (strings: TemplateStringsArray) => {\n let text = described.get(strings);\n if (text === undefined) {\n text = strings.join('${…}').replace(/\\s+/g, ' ').trim();\n if (text.length > 72) text = text.slice(0, 71) + '…';\n described.set(strings, text);\n }\n return text;\n};\n\n/**\n * `parentElement` is null across a shadow boundary, which is exactly where components live — so\n * step to the host rather than reporting `(detached)` for every shadow root.\n */\nconst up = (node: Node): Element | null => {\n const parent = (node as Element).parentElement;\n if (parent !== null) return parent;\n const root = node.getRootNode();\n return root !== node && (root as ShadowRoot).host !== undefined ? (root as ShadowRoot).host : null;\n};\n\n/** Three levels of ancestry is enough to locate a slot without printing a whole path. */\nconst label = (node: Node | null): string => {\n const path: string[] = [];\n let el = node === null ? null : node.nodeType === 1 ? (node as Element) : up(node);\n for (let i = 0; i < 3 && el !== null; i++) {\n let part = el.localName;\n if (el.id) part += '#' + el.id;\n else {\n const cls = el.getAttribute('class');\n if (cls) part += '.' + cls.trim().split(/\\s+/)[0];\n }\n path.unshift(part);\n el = up(el);\n }\n return path.length === 0 ? '(detached)' : path.join(' > ');\n};\n\nconst hook = (kind: number, subject: unknown, shape: TemplateStringsArray | null) => {\n if (kind === PROFILE_UPDATE) {\n updates++;\n return;\n }\n if (kind === PROFILE_FRAME_START) {\n if (depth++ === 0) frameStart = performance.now();\n return;\n }\n if (kind === PROFILE_FRAME_END) {\n if (--depth === 0) {\n const elapsed = performance.now() - frameStart;\n totalMs += elapsed;\n if (elapsed > slowestMs) slowestMs = elapsed;\n frames++;\n }\n return;\n }\n if (kind === PROFILE_CREATE) {\n creates++;\n return;\n }\n if (kind !== PROFILE_REBUILD) return;\n\n rebuilds++;\n const part = subject as ChildPart;\n const from = part._shape;\n if (from === null || shape === null) return;\n const key = idOf(from) + '>' + idOf(shape);\n let record = churn.get(key);\n if (record === undefined) {\n churn.set(\n key,\n (record = { from: describe(from), to: describe(shape), count: 0, where: label(part._start) })\n );\n }\n record.count++;\n};\n\nconst reset = () => {\n frames = updates = creates = rebuilds = depth = 0;\n totalMs = slowestMs = frameStart = 0;\n churn = new Map();\n};\n\n/** Begin collecting. Calling this while already profiling restarts the collection. */\nexport const startProfiling = () => {\n reset();\n active = true;\n _setProfileHook(hook);\n};\n\n/** What has been measured so far, without ending the session. Drives the live overlay. */\nexport const getReport = (): ProfileReport => ({\n frames,\n ms: totalMs,\n slowestFrameMs: slowestMs,\n updates,\n creates,\n rebuilds,\n churn: [...churn.values()].sort((a, b) => b.count - a.count),\n});\n\n/** Stop collecting and return what was measured. Safe to call when not profiling. */\nexport const stopProfiling = (): ProfileReport => {\n _setProfileHook(null);\n active = false;\n return getReport();\n};\n\nexport const isProfiling = () => active;\n\n/** Profile one synchronous stretch of work. */\nexport const profile = <T>(fn: () => T): { result: T; report: ProfileReport } => {\n startProfiling();\n try {\n return { result: fn(), report: stopProfiling() };\n } catch (error) {\n stopProfiling();\n throw error;\n }\n};\n\n/**\n * Mounts a live panel in the corner of the page and starts profiling. Returns a function that\n * removes it and stops. Plain DOM in a closed shadow root — it never renders itself through the\n * renderer, which would fold its own commits into the numbers it reports.\n */\nexport const showProfiler = (options?: OverlayOptions): (() => void) => {\n startProfiling();\n const unmount = mountOverlay(getReport, isProfiling, { start: startProfiling, stop: stopProfiling }, options);\n return () => {\n unmount();\n stopProfiling();\n };\n};\n\n/** Human-readable summary. The overlay renders the same data; this is for a console or a log. */\nexport const formatReport = (report: ProfileReport): string => {\n const committed = report.updates + report.creates + report.rebuilds;\n const share = committed === 0 ? 0 : Math.round((report.rebuilds / committed) * 100);\n const lines = [\n `${report.frames} frame(s), ${report.ms.toFixed(1)}ms total, slowest ${report.slowestFrameMs.toFixed(1)}ms`,\n `${report.updates} updated in place, ${report.creates} created, ${report.rebuilds} rebuilt (${share}% of commits)`,\n ];\n if (report.churn.length > 0) {\n lines.push('', 'Template identity churn — these were torn down, not updated:');\n for (const entry of report.churn) {\n lines.push(` ${entry.count}x at ${entry.where}`, ` ${entry.from}`, ` -> ${entry.to}`);\n }\n lines.push('', 'Prefer one stable template with ?hidden=${…} over swap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MAAM,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE;YAChC,KAAK,CAAC,IAAI,CAAC,CAAA,EAAA,EAAK,KAAK,CAAC,KAAK,CAAA,MAAA,EAAS,KAAK,CAAC,KAAK,CAAA,CAAE,EAAE,CAAA,MAAA,EAAS,KAAK,CAAC,IAAI,CAAA,CAAE,EAAE,CAAA,MAAA,EAAS,KAAK,CAAC,EAAE,CAAA,CAAE,CAAC;QAChG;AACA,QAAA,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,sEAAsE,CAAC;IACxF;AACA,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AACzB;;;;"}
1
+ {"version":3,"file":"vera-renderer-profiler.js","sources":["../../src/dev-values.ts","../../src/renderer.ts","../../src/overlay.ts","../../src/profiler.ts"],"sourcesContent":["/**\n * `__DEV__` only: the one home for *\"is this value something an attribute can carry?\"*\n *\n * **Why it is a closed vocabulary and not a predicate.** The first design asked whether a value\n * stringifies meaningfully — `String(v) === '[object Object]'` means it lost its data. Driven\n * through 16 value shapes rather than reasoned about, that broke four ways, and the first is\n * disqualifying: `String()` THROWS on `Object.create(null)`, on `{ toString: null }`, and on any\n * object whose `toString` throws — so a diagnostic would have killed the page for an author using\n * the recommended dictionary idiom. It also passed `[\"a\",\"b\"]` as `\"a,b\"` (one junk class, if that\n * was a `class` binding) and `new Date()` as a timezone-bearing string, which is an SSR/CSR\n * divergence manufactured out of correct-looking code. And it passed `Symbol('s')` while\n * `` `${sym}` `` throws — a guard and its sink disagreeing about a single expression.\n *\n * \"Does it stringify meaningfully\" is an OPEN predicate over an unbounded, environment-dependent\n * space, and open predicates cannot be audited. So the test is inverted and closed: **primitives\n * pass; everything else is reported; anything else that should pass is a named row added on\n * evidence.** The list has exactly one member so far.\n *\n * Credit where it is due: the four breaks were found by the omni engine's session, which drove the\n * shapes rather than arguing about them, and the closed-vocabulary form is theirs.\n */\n\n/**\n * Blessed non-primitives — types whose `toString` IS the value the author means.\n *\n * Tested by brand rather than `instanceof`, which is false across realms: a `URL` built in an\n * iframe is not `instanceof` the parent's `URL`, and a diagnostic that fires on a correct value in\n * one frame and not another is worse than none.\n */\nconst brand = (value: object) => Object.prototype.toString.call(value);\n\n/** One message per element+name+kind, so a value rebuilt every render does not flood the console. */\nlet reported: Set<string> | undefined;\n\n/**\n * Returns the complaint, or `null` when the value is fine. Never throws — the shapes that break a\n * naive guard are exactly the ones worth reporting, so they reach the `object` arm and are named.\n */\nexport const attributeValueComplaint = (tag: string, name: string, value: unknown): string | null => {\n const type = typeof value;\n if (type === 'string' || type === 'number' || type === 'boolean' || type === 'bigint') return null;\n if (type === 'object' && brand(value as object) === '[object URL]') return null;\n\n /**\n * Keyed by BRAND, not by `typeof` — `Date`, `Array` and a plain object are all `'object'`, so a\n * coarser key reported whichever arrived first and silently swallowed the rest. An author who\n * fixed the Date would never have been told about the array.\n */\n const key = `${tag}|${name}|${type === 'object' ? brand(value as object) : type}`;\n reported ??= new Set();\n if (reported.has(key)) return null;\n reported.add(key);\n\n /**\n * A function into an attribute is never what the author meant, but the REASON matters: on a\n * custom element the Lit-era convention is that complex values are set as properties, so\n * `<my-chart formatter={fn}>` is a coherent intention that this sink simply cannot express. The\n * message names the binding that can, rather than blaming the author.\n */\n const said = type === 'function'\n ? `a function, which becomes its own SOURCE TEXT`\n : type === 'symbol'\n ? `a symbol, which every DOM conversion refuses`\n : Array.isArray(value)\n ? `an array, which becomes its members joined by commas`\n : brand(value as object) === '[object Date]'\n ? `a Date, whose text carries the TIMEZONE of whichever side rendered it`\n : `an ${type}, which cannot survive as text`;\n\n /**\n * Returned WITHOUT the `[vera]` prefix, which each call site writes as a literal.\n * `tests/diagnostics-convention.test.mjs` reads the prefix off the call, so a message handed over\n * as a variable is invisible to it — and its answer to that is an allowance list. Taking the\n * allowance would have excused these two calls rather than checked them, which is the\n * reclassification this audit keeps refusing; the literal at the call site is what every other\n * diagnostic in the repo does anyway.\n */\n return (\n `renderer: the attribute \\`${name}\\` on <${tag}> was given ${said}. ` +\n `An attribute value is a string and nothing else.\\n` +\n `If the element is meant to RECEIVE this value, bind a property instead — \\`.${name}=\\${value}\\` ` +\n `— which is how a custom element takes anything that is not text. If it is meant to be read as ` +\n `text, convert it where you know what it means: \\`date.toISOString()\\`, \\`list.join(' ')\\`. ` +\n `A Date in particular serializes with the SERVER's timezone on one side and the browser's on ` +\n `the other, so it will not survive hydration.`\n );\n};\n","/**\n * @verajs/renderer — a ground-up, keyed, template-identity renderer.\n *\n * Replaces the Reef-derived renderer, which flattened every template to an HTML string and\n * re-parsed it on each change — O(whole template) work for a one-row edit, measured at 85 ms for a\n * two-row swap that lit-html does in 3.5 ms.\n *\n * The architecture here is the one that wins that benchmark:\n *\n * 1. A tagged template literal's `strings` array is frozen and IDENTICAL for every call from the\n * same call site, so it is a cache key for the template's static shape. The shape is parsed\n * ONCE into a `<template>` element with markers where the expressions go.\n * 2. Rendering clones that template and binds \"parts\" to the marker positions. Every later render\n * of the same shape only compares and commits the dynamic values — static content is never\n * touched again.\n * 3. Arrays reconcile KEYED (see `keyed()`), with head/tail fast paths and map-based moves, so a\n * reorder moves nodes instead of rebuilding them.\n *\n * Built in, where lit-html requires directive imports: keyed list reconciliation (`keyed`),\n * element refs (element-position expressions), toggled-DOM preservation (`hold`), and a\n * whole-range fast clear — one `textContent = ''` where lit removes thousands of nodes one at a\n * time. Like-for-like (lit-html + repeat + ref + cache: 5 021 B gzip), this file is ~28% smaller.\n *\n * What it deliberately does NOT have, which is why it is smaller than lit-html: no directive\n * protocol, no `noChange`/`nothing` sentinels (in a single-expression attribute, `null`/`undefined`\n * REMOVE the attribute; in a child, they clear it), no sanitizer indirection, no async parts, no\n * dev-mode branches.\n *\n * Known limits, deliberate and shared with lit-html's envelope: no bindings inside comments (the\n * value is consumed and ignored), no dynamic tag names, and nested `<template>` elements' contents\n * are not traversed.\n *\n * CONTRACTS THE SPEED PAYS FOR — these are the trade, documented rather than discovered:\n *\n * - **The renderer owns its container below the mount point.** The whole-range fast clear wipes\n * everything in a parent the part fully owns, including nodes user code appended there by hand\n * (lit-html would preserve them). Same contract as mounting Vue or React into a container.\n * - **Do not call `Node.normalize()` on rendered content.** Child anchors are text nodes, and\n * normalize merges adjacent text — lit-html's comment anchors are immune to this; ours are not.\n * - **A plain string renders as text, never as HTML.** The Reef renderer parsed strings as markup;\n * this one has no innerHTML sink at all (an XSS class removed). The deliberate escape hatch for\n * trusted markup is a property binding: `.innerHTML=${trusted}`.\n * - **Hydration is automatic and markerless.** The first render into a container that already has\n * children adopts them as server output of the same template (statics matched byte-for-byte,\n * anchors installed by splitting live text at known value positions), falling back to a clean\n * render on any mismatch. Requires the initial client render to match server state — same\n * contract as React/Vue hydration.\n * - **No directive protocol.** The template language itself is closed to extension — Vera extends\n * at the framework layer (inserts) and through element refs, not inside the renderer's value\n * handling.\n * - Event handlers are invoked with `this` bound to the ELEMENT (lit binds its host).\n *\n * NAMING NOTE: internal class fields and methods are `_`-prefixed because the production build\n * mangles properties matching /^_[a-z]/ (see defaultRollupConfig). That is what lets this file use\n * full descriptive names while still shipping one-letter properties — locals and top-level names\n * are mangled by default anyway, but property names are not. `_$litType$` and `handleEvent`\n * deliberately do not match the pattern: the first is an interop wire format, the second is called\n * by the DOM itself.\n */\n\nimport { attributeValueComplaint } from './dev-values.js';\n\nexport type TemplateResult = {\n /** 1 = html, 2 = svg, 3 = mathml — the markers core's built-in tags produce. */\n _$litType$?: number;\n strings: TemplateStringsArray;\n values: unknown[];\n /** Set by `keyed()`; drives keyed list reconciliation. */\n key?: unknown;\n};\n\n\n/**\n * Preserves the DOM of templates a child position toggles away from, instead of destroying it —\n * form values, scroll positions and media playback survive the round trip (lit-html calls this\n * `cache`). Stashed DOM is parked in its instance's own fragment and re-adopted on return.\n *\n * ```js\n * html`<div>${hold(editing ? editor() : viewer())}</div>`\n * ```\n *\n * **Anything that is not a template passes straight through.** There is nothing to park for a\n * string, a list, `null` or `false`, and the branch that produces one is the ordinary shape of the\n * expression this wraps — `hold(editing && editor())`, `hold(row ?? null)`. Wrapping those handed\n * the renderer a `{ $h }` carrying a non-template, which reached the held-commit path and threw on\n * `result.strings`: a whole render lost, from a value the same expression renders happily one\n * character to the left. Decided here rather than in the renderer so the hot path pays nothing.\n */\nexport const hold = <T>(result: T): T | { $h: TemplateResult } =>\n result != null && typeof result === 'object' && isTemplateResult(result)\n ? { $h: result as TemplateResult }\n : result;\n\n/**\n * Unique per module load, so user text can never collide with it. Randomness here cannot break\n * template caching — the marker only ever pairs a scan with its own Template construction.\n */\n// eslint-disable-next-line no-bitwise -- >>> 0 is the integer truncation, not arithmetic\nconst MARKER = '$v' + ((Math.random() * 1e9) >>> 0).toString(36) + '$';\n/** `<?xyz>` parses as a bogus comment whose data is `?xyz`. */\nconst MARKER_COMMENT_DATA = '?' + MARKER;\n\nconst doc = document;\nconst comment = (data = '') => doc.createComment(data);\n\n/**\n * One walker for every template construction, re-aimed by assigning `currentNode`. Traversal of a\n * detached fragment cannot escape it — ascent stops at a null parent — and no walk is ever\n * re-entered mid-flight: an inner instantiation only begins after the outer walk has finished\n * collecting its parts.\n */\nconst markerWalker = doc.createTreeWalker(doc, 129 /* ELEMENT | COMMENT */);\n/**\n * Second shared walker for indexing and instantiation. Templates ship with NO marker comments —\n * every child slot's anchor is its primed text node — so instances index over elements and texts.\n * Marker comments exist only transiently during template construction, and are created lazily at\n * runtime only if a slot upgrades from text to template/array content. Sharing the walker saves a\n * TreeWalker allocation per instance, which is 10 000 allocations in a 10 000-row create.\n */\nconst instanceWalker = doc.createTreeWalker(doc, 5 /* ELEMENT | TEXT */);\n\n/**\n * Elements whose children a parser reads as **text**, so a marker written inside one arrives as\n * characters rather than a comment and the binding never becomes a part.\n *\n * `iframe` and `noscript` were missing, and both were measured broken in a browser rather than\n * reasoned about: `html\\`<iframe>${v}</iframe>\\`` painted the literal marker — `<?$v8hpsho$>` — onto\n * the page in **all three engines** and never updated.\n *\n * **`noscript` is the one worth the comment, because the engines disagree.** A template's contents\n * are parsed with the scripting flag *disabled*, which is what decides whether `noscript` is raw\n * text — and Chromium and WebKit parse it as markup there while Firefox parses it as text. So\n * `html\\`<noscript>${v}</noscript>\\`` worked in two engines and painted the marker in the third: an\n * app developed in Chrome shipping the framework's internals onto the page for Firefox users.\n *\n * Listing it here is safe in both parses. Where the marker became a comment the raw-text branch does\n * not trigger, because it looks for the marker in `textContent` and finds none.\n */\nconst RAW_TEXT_TAGS = /^(?:script|style|textarea|title|iframe|noscript)$/i;\n\n/**\n * The void elements, as a regex rather than the `Set` in `@verajs/shared-utils`, and NOT imported\n * from it — measured: an imported `new Set([...])` survives production because neither rollup nor\n * terser can prove the constructor call is side-effect-free, so it sat at module scope costing\n * **62 B gzipped on the base bundle** for a diagnostic production does not even run. A regex\n * literal read only by `warnTagShape` goes when that dead function goes.\n *\n * So this is a second home for a fact `@verajs/shared-utils` owns, kept deliberately and in a\n * different SHAPE because a hot file's byte budget forbids the shared one. That is only acceptable\n * with an enforcer: `tests/markup-grammar-homes.test.mjs` drives this regex and the canonical set\n * against each other, member by member, in both directions.\n */\nconst VOID_TAGS = /^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/i;\nconst ATTR_NAME_DELIMITER = /[\\s\"'>=/]/;\n\n/** What an expression position turned out to be. */\nconst CHILD = 0;\nconst ATTRIBUTE = 1;\nconst IGNORED = 2; // value consumed, nothing rendered (bindings inside comments, junk positions)\n\n/**\n * `_tag` is `__DEV__` only and exists for one diagnostic: when the HTML parser DROPS the element a\n * binding was written on, the binding's marker never reaches the parsed tree, and the warning below\n * needs to name the element the author actually wrote rather than only the symptom.\n */\ntype Spec = ({ _type: 0 } | { _type: 1; _name: string } | { _type: 2 }) & { _tag?: string };\n\n/** Scanner states. */\nconst IN_TEXT = 0;\nconst IN_TAG = 1;\nconst IN_QUOTED_VALUE = 2; // a static quoted attribute value (no binding seen yet)\nconst IN_COMMENT = 3;\nconst IN_RAW_TEXT = 4; // inside <script>/<style>/<textarea>/<title>\nconst IN_BOUND_VALUE = 5; // collecting a bound attribute's statics\n\n/**\n * One pass over the template strings, producing parseable HTML with markers plus an ordered spec\n * list. Runs once per template shape, so clarity beats micro-optimisation here.\n *\n * A small state machine rather than tail regexes, because `>` inside quoted attribute values and\n * inside comments must not terminate a tag, and raw-text elements swallow markup.\n */\n/**\n * `__DEV__` only: the two ways a hand-written template describes a tree the parser will not build.\n *\n * `@verajs/jsx` normalises both at compile time, so this is the channel for the BUILDLESS path —\n * which is this framework's baseline, not its fallback, and was the surface left broken when the\n * compiler fix landed. It reaches the browser console on the client and during hydration; a\n * server-only render never runs this scanner, so an SSR page that is never hydrated is not covered.\n *\n * The self-close test is `markup` ending in `/`, which is the same approximation the raw-text\n * branch below already makes: an unquoted attribute value ending in a slash (`<div data-x=a/>`)\n * reads the same way. That is not a false positive in any way that matters — measured, such a tag\n * is an OPEN tag too and swallows what follows it exactly as `<div/>` does, so both the warning and\n * the fix it names are correct for it.\n */\nconst warnTagShape = (tag: string, closing: boolean, selfClosed: boolean) => {\n if (!closing && selfClosed && !VOID_TAGS.test(tag))\n console.warn(\n `[vera] renderer: <${tag}> is left OPEN by this template, so everything after it becomes its ` +\n `child rather than its sibling. HTML has no self-closing syntax outside <svg> and <math> — ` +\n `\\`<${tag} />\\` is an open tag, not an empty element. Write \\`<${tag}></${tag}>\\`. ` +\n `(@verajs/jsx rewrites this for you; a hand-written template has to say it.)`\n );\n else if (closing && VOID_TAGS.test(tag))\n console.warn(\n `[vera] renderer: \\`</${tag}>\\` is read by the parser as ANOTHER <${tag}>, so this template ` +\n `renders two where it describes one. A void element has no end tag — write \\`<${tag}>\\` alone.`\n );\n};\n\nconst scan = (strings: TemplateStringsArray, type = 1) => {\n const specs: Spec[] = [];\n let markup = '';\n let state = IN_TEXT;\n let quote = '';\n let quoteStart = 0; // markup index of the opening quote while IN_QUOTED_VALUE\n let rawTag = ''; // which raw-text element we are inside\n let tagNameStart = 0; // markup index where the current tag's name begins\n let isClosing = false;\n /**\n * `__DEV__` only. Depth of `<svg>`/`<math>` nesting, because foreign content is the one place the\n * parser DOES honour XML self-closing, so neither warning applies inside it. An `svg`/`mathml`\n * template is already inside one, hence the seed from `type`.\n *\n * `<foreignObject>` re-enters HTML content and is deliberately not tracked: suppressing a warning\n * there is a missed warning, while tracking it wrongly would be a wrong one, and a diagnostic\n * that cries wolf is worse than one that stays quiet.\n */\n let foreign = type === 1 ? 0 : 1;\n let attrName = '';\n let statics: string[] = [];\n let pending = ''; // the static chunk currently being collected IN_BOUND_VALUE\n\n /** Backscan an attribute name that ends at `end` (exclusive); '' when malformed. */\n const attrNameBefore = (end: number) => {\n let at = end;\n while (at > 0 && !ATTR_NAME_DELIMITER.test(markup[at - 1])) at--;\n return markup.slice(at, end);\n };\n\n for (let i = 0; i < strings.length; i++) {\n const segment = strings[i];\n let pos = 0;\n while (pos < segment.length) {\n const ch = segment[pos];\n if (state === IN_BOUND_VALUE) {\n if (\n ch === quote ||\n (quote === '' && (ch === ' ' || ch === '\\t' || ch === '\\n' || ch === '\\r' || ch === '>' || ch === '/'))\n ) {\n /**\n * The bound attribute closes. Emit a marker attribute whose VALUE carries the statics\n * joined by the marker — reading them back from the parsed attribute means entities\n * arrive decoded, exactly as a static attribute would.\n */\n statics.push(pending);\n const quoteChar = quote || '\"';\n markup += ` ${specs.length}${MARKER}=${quoteChar}${statics.join(MARKER)}${quoteChar}`;\n specs.push(\n __DEV__\n ? { _type: ATTRIBUTE, _name: attrName, _tag: markup.slice(tagNameStart).match(/^[a-zA-Z][^\\s/>]*/)?.[0] }\n : { _type: ATTRIBUTE, _name: attrName }\n );\n state = IN_TAG;\n if (quote !== '') pos++; // consume the closing quote; unquoted terminators reprocess IN_TAG\n continue;\n }\n pending += ch;\n pos++;\n } else if (state === IN_TEXT) {\n if (ch === '<') {\n if (segment.startsWith('!--', pos + 1)) {\n state = IN_COMMENT;\n markup += '<!--';\n pos += 4;\n continue;\n }\n isClosing = segment[pos + 1] === '/';\n tagNameStart = markup.length + (isClosing ? 2 : 1);\n state = IN_TAG;\n }\n markup += ch;\n pos++;\n } else if (state === IN_TAG) {\n if (ch === '\"' || ch === \"'\") {\n quote = ch;\n quoteStart = markup.length;\n state = IN_QUOTED_VALUE;\n } else if (ch === '>') {\n const tagName = markup.slice(tagNameStart).match(/^[a-zA-Z][^\\s/>]*/)?.[0] ?? '';\n if (__DEV__) {\n const lower = tagName.toLowerCase();\n const selfClosed = markup.endsWith('/');\n if (lower === 'svg' || lower === 'math') foreign += isClosing ? -1 : selfClosed ? 0 : 1;\n else if (foreign < 1) warnTagShape(tagName, isClosing, selfClosed);\n }\n if (!isClosing && RAW_TEXT_TAGS.test(tagName) && !markup.endsWith('/')) {\n rawTag = tagName.toLowerCase();\n state = IN_RAW_TEXT;\n } else {\n state = IN_TEXT;\n }\n }\n markup += ch;\n pos++;\n } else if (state === IN_QUOTED_VALUE) {\n if (ch === quote) state = IN_TAG;\n markup += ch;\n pos++;\n } else if (state === IN_COMMENT) {\n if (ch === '-' && segment.startsWith('->', pos + 1)) {\n markup += '-->';\n pos += 3;\n state = IN_TEXT;\n continue;\n }\n markup += ch;\n pos++;\n } else {\n // IN_RAW_TEXT\n if (\n ch === '<' &&\n segment.slice(pos + 1, pos + 2 + rawTag.length).toLowerCase() === '/' + rawTag &&\n (pos + 2 + rawTag.length >= segment.length || /[\\s/>]/.test(segment[pos + 2 + rawTag.length]))\n ) {\n isClosing = true;\n tagNameStart = markup.length + 2;\n state = IN_TAG;\n }\n markup += ch;\n pos++;\n }\n }\n\n // ── expression boundary ──────────────────────────────────────────────────\n if (i === strings.length - 1) break;\n if (state === IN_TEXT) {\n markup += `<?${MARKER}>`;\n specs.push({ _type: CHILD });\n } else if (state === IN_RAW_TEXT) {\n markup += MARKER; // a text marker; comments cannot be parsed inside raw-text elements\n specs.push({ _type: CHILD });\n } else if (state === IN_COMMENT) {\n specs.push({ _type: IGNORED }); // binding inside a comment: consumed, ignored\n } else if (state === IN_BOUND_VALUE) {\n statics.push(pending); // this attribute spans another expression\n pending = '';\n } else if (state === IN_QUOTED_VALUE) {\n // expression inside a quoted attribute value -> becomes a bound attribute\n const name = markup[quoteStart - 1] === '=' ? attrNameBefore(quoteStart - 1) : '';\n if (name) {\n attrName = name;\n statics = [markup.slice(quoteStart + 1)]; // the static prefix already inside the quotes\n pending = '';\n markup = markup.slice(0, quoteStart - 1 - name.length); // cut `name=\"` back out\n state = IN_BOUND_VALUE;\n } else {\n specs.push({ _type: IGNORED });\n }\n } else {\n // IN_TAG: `name=${x}` unquoted, or an element-position expression\n const name = markup.endsWith('=') ? attrNameBefore(markup.length - 1) : '';\n if (name) {\n attrName = name;\n statics = [''];\n pending = '';\n quote = '';\n markup = markup.slice(0, markup.length - 1 - name.length);\n state = IN_BOUND_VALUE;\n } else {\n /**\n * Element-position expression — an element REF, not a no-op. Marked exactly like a bound\n * attribute ('&' cannot begin a real attribute binding), so no new machinery exists for it.\n */\n if (__DEV__ && (markup.endsWith('<') || markup.endsWith('</'))) {\n /**\n * Except in **tag position**, where it is a mistake with no useful reading. `<${name}>`\n * lands here because the tag has no name yet, and what the parser then makes of a ref on\n * a nameless element is escaped punctuation. Naming the entry that does support it is\n * more use than an element ref nobody asked for.\n */\n console.error(\n `[vera] an expression in tag position (\\`<\\${…}>\\`) is not a dynamic tag name — the ` +\n `template has no element there and the markup around it is rendered as text.\\n` +\n `Runtime tag names live in @verajs/renderer/tag:\\n\\n` +\n ` import { html, tag } from '@verajs/renderer/tag';\\n` +\n ` const heading = tag\\`h1\\`;\\n` +\n ` html\\`<\\${heading}>…</\\${heading}>\\`\\n`\n );\n }\n /**\n * **And in attribute-*name* position, which is the same mistake one step along.**\n *\n * `<b ${name}=\"x\">`, `<b data-${name}=\"1\">` and `<b a${name}b=\"1\">` all land here: the\n * marker is not preceded by `=`, so it reads as an element ref, and the `=\"x\"` after it\n * stays literal markup. The browser's parser then makes `<b =\"x\"=\"\">` of it — attributes\n * nobody wrote, silently.\n *\n * **The server already refuses this**, and said so in its README while the client shipped\n * the garbage. A developer rendering only in a browser saw malformed output with no clue,\n * and adding SSR later turned it into a throw with no obvious connection.\n *\n * Told apart from a real element ref by what follows it: a ref is always followed by\n * whitespace, `>` or `/`. Anything else means the marker landed inside a name.\n */\n const after = strings[i + 1] ?? '';\n if (__DEV__ && after !== '' && !/^[\\s>/]/.test(after)) {\n console.error(\n `[vera] an expression in attribute-name position (\\`<b \\${…}=\"x\">\\`) is not a dynamic ` +\n `attribute name — a marker is not a name, and the parser makes attributes nobody ` +\n `wrote out of what follows it.\\n` +\n `Runtime-named bindings live in @verajs/renderer/spread:\\n\\n` +\n ` import { spread } from '@verajs/renderer/spread';\\n` +\n ` html\\`<b \\${spread({ [name]: 'x' })}>…</b>\\`\\n`\n );\n }\n markup += ` ${specs.length}${MARKER}=\"${MARKER}\"`;\n specs.push({ _type: ATTRIBUTE, _name: '&' });\n }\n }\n }\n return { markup, specs };\n};\n\n/** A part's position and shape inside a Template, resolved to a node index for instantiation. */\ntype TemplatePart = {\n _type: 0 | 1 | 2;\n _index: number;\n _name?: string;\n _statics?: string[];\n /** Whether the template statically writes an attribute of the same name — see `AttrPart._commit`. */\n _present?: boolean;\n _node?: Node; // only during construction, carrying identity between the two passes\n};\n\n/**\n * THE LIGHT-SLOTS SEAM. `@verajs/renderer/slots` registers one of these through core's `wire` on\n * the `'slot'` insert point; the renderer reads it from the registry `connect` was handed — the\n * app's single registry, so a CDN page loading separate bundles still meets ONE seam (the same\n * architecture the `'value'` point rides). All member names are `$`-sigiled: the mangle regex\n * cannot match them, so the contract survives production across bundle boundaries (the child-\n * applier precedent). An app that never wires it pays one registry lookup per template\n * CONSTRUCTION (once per shape) and nothing per render.\n */\n/** The state a taken-over slot hands back; `_$park$` (sigiled, mangle-safe) is called before the\n * instance's DOM is bulk-discarded so the USER'S nodes are rescued first. */\nexport type SlotSeamState = { _$park$?: () => void };\n/** The registered `'slot'` insert is a plain function per wire's contract: take over one cloned\n * `<slot>` for the given root, or decline with null/undefined (native slotting proceeds). */\ntype SlotSeamFn = (slot: Element, root: Node, name: string) => SlotSeamState | null | undefined;\n/**\n * The seam function plus the members it carries for callers that are not committing a slot —\n * sigil-named, so they survive property mangling across bundle boundaries (the child-applier\n * precedent). `_$capture$` lifts a light host's children on its first render; `_$rescue$` puts\n * them back when hydration has to discard the server's markup; `_$server$`/`_$adopt$` belong to\n * SSR and the hydrate entry and are reached off the same object.\n */\ntype SlotSeam = SlotSeamFn & {\n _$capture$?: (host: Element, boundary?: Comment) => void;\n _$rescue$?: (host: Element) => Node[] | null;\n /** A captured node's host-side anchor (the light-region sentinel) — see the upgrade below. */\n _$home$?: (node: Node) => Comment | null;\n};\n/**\n * A recorded `<slot>` position — just its node index in the instance walk. Slot records live\n * BESIDE the parts array, not in it, so `_update` never iterates them and non-slot apps pay\n * nothing per render.\n *\n * The NAME is deliberately not recorded. It used to be, read off the template's static markup,\n * which made `<slot name=${…}>` a slot with no name at all: it registered as a second DEFAULT\n * slot and stole the default content while the real default slot showed its fallback. The name is\n * read from the element at mount instead, which is after its own bindings have committed.\n */\ntype SlotRecord = number;\n\n/**\n * The container of the renderInto call currently committing — how a slot part learns its root\n * (light element vs shadow root) at Instance construction. Commits are synchronous per flush, so\n * one module slot suffices (the `currentInstance` pattern); null outside renderInto (hydration's\n * adoption path constructs elsewhere and the seam stays inert there until it learns adoption).\n */\nlet _slotRoot: Node | null = null;\n\n/** See the slotless branch in `Instance`. Once per host tag, so a list cannot flood a console. */\nconst warnedSlotless = new Set<string>();\nconst warnSlotless = (root: Element) => {\n const tag = root.localName;\n if (warnedSlotless.has(tag)) return;\n warnedSlotless.add(tag);\n console.warn(\n `[vera] renderer: <${tag}> renders a \\`<slot>\\` into LIGHT DOM, but no 'slot' insert is wired — ` +\n `nothing can fill it, so it always shows its fallback, and any content the host is given for ` +\n `it sits beside the component as stray markup instead. Wire it at the app entry, BEFORE anything renders: ` +\n `\\`import { slots } from '@verajs/renderer/slots'; wire([renderer, slots])\\`. Wiring it later ` +\n `does not help a template that has already rendered — a template resolves this once, at ` +\n `construction, and is interned per call site for the life of the page.`\n );\n};\n\n/**\n * `__DEV__` only: the HTML parser dropped an element a binding was written on.\n *\n * Named where it is discovered rather than after the walk, because the SKIP knows exactly which\n * spec went missing — `specs[from]` is the casualty by construction. A post-hoc count can only\n * report the LAST unclaimed spec, which positional pairing makes the wrong element every time, and\n * pointing an author at a tag that rendered correctly is the precise failure this message exists\n * to cure.\n */\n/**\n * **A child binding directly inside `<table>` renders one shape and PARSES as another.**\n *\n * `<table>${rows}</table>` is conforming HTML — `<tbody>` is omissible — and it is the one place a\n * legal template does not survive a round trip through the platform:\n *\n * - CLIENT RENDER inserts the rows with DOM calls, which apply no parser rules: `table > tr`.\n * - The SAME markup PARSED — a server render the browser re-parses, `innerHTML`, a static file —\n * gets the implied section: `table > tbody > tr`.\n *\n * Measured, both shapes, same template. So a stylesheet written `table > tr` matches on one path\n * and not the other, and hydration discards the server's markup for that container and rebuilds it\n * (*\"expected `<tr>` and found `<tbody>`\"*) — silently in production, where this call is folded away.\n *\n * **Why this is a warning and not a repair.** Whatever is emitted, the browser re-parses it, and the\n * parser ALWAYS inserts the section — so the only shape all three paths agree on is one where the\n * section is already in the template. The framework could insert it, but that changes the DOM shape\n * of every existing client-rendered table, across the renderer AND `@verajs/ssr`'s serializer, and\n * rests on the SSR shim agreeing with browsers about implied tags. One word from the author reaches\n * the same fixed point with none of that. Owner's call, recorded rather than assumed.\n *\n * Scoped to `<table>` deliberately: `<tbody>` (from rows) and `<colgroup>` (from `<col>`) are the\n * only implied START tags reachable inside a template fragment, and both are children of `<table>`.\n * The omissible END tags — `</li>`, `</p>`, `</td>`, `</option>` and the rest — insert nothing, so\n * they round-trip correctly and are pinned doing so in `tests/dropped-element-bindings.test.mjs`.\n */\nconst warnImplicitSection = (parent: Element | null) => {\n if (parent?.localName !== 'table') return;\n console.warn(\n '[vera] renderer: a binding sits directly inside <table>, where the HTML parser inserts a ' +\n '<tbody> that a client render does not. The same template then renders as `table > tr` and ' +\n 'parses as `table > tbody > tr`, so `table > tr` selectors match on only one path and ' +\n 'hydration rebuilds this container instead of adopting it. Write the section explicitly — ' +\n '`<table><tbody>${rows}</tbody></table>` — and every path agrees.'\n );\n};\n\nconst warnDroppedBinding = (specs: Spec[], from: number, count: number) => {\n const lost = specs[from];\n const where = lost?._tag\n ? `\\`${lost._type === ATTRIBUTE ? `${lost._name}=` : ''}\\` on <${lost._tag}>`\n : 'a binding';\n console.warn(\n `[vera] renderer: ${where} never reached the parsed tree — the HTML parser DROPPED the element ` +\n `it was written on, because its parent's content model forbids it (\\`<select>\\` takes only ` +\n `options, \\`<form>\\` cannot nest, and so on).\\n` +\n `${count} binding(s) lost. The element is gone from the DOM and its binding does nothing; ` +\n `the bindings AFTER it are unaffected, because each marker carries its own index. ` +\n `(Before that they all shifted onto the wrong elements, which is why this kind of mistake ` +\n `used to surface somewhere you had not edited.)\\n` +\n `Move the element out of its parent, or use one the parent can hold.`\n );\n};\n\nconst templateCache = new WeakMap<TemplateStringsArray, Template>();\n\nclass Template {\n _element: HTMLTemplateElement;\n _parts: TemplatePart[] = [];\n /**\n * Present only when a 'slot' insert was wired at construction and the markup contains slots.\n *\n * `declare`, like the two below: under ES2022 class-field semantics a plain optional field is\n * DEFINED on every instance whether or not it is ever assigned, so a CONDITIONALLY assigned one\n * is weight every template pays for a case most of them do not have.\n *\n * Deliberately not applied to the fields the constructors always assign (`_element`, `_name`,\n * `_statics`, `_start`, `_end`, and the rest). Those need to exist, the saving is the same few\n * bytes, and they sit on the hot classes where changing when a property first appears can move\n * V8's hidden class — which is a measurement, not a tidy-up. If anyone takes that on, measure\n * update throughput before and after, three runs, the way the slot-mount deferral was.\n */\n declare _slots?: SlotRecord[];\n declare _seam?: SlotSeamFn;\n /** `__DEV__` only: this markup has `<slot>` and was built with no seam to hand them to.\n * `declare`, so nothing is emitted — a plain optional field is DEFINED on every instance under\n * ES2022 class-field semantics, which is production weight for a development-only check. */\n declare _slotless?: boolean;\n\n constructor(result: TemplateResult) {\n const type = result._$litType$ ?? 1;\n const { markup, specs } = scan(result.strings, type);\n this._element = doc.createElement('template');\n /** svg/mathml fragments only parse inside their root; wrap, then unwrap below. */\n this._element.innerHTML = type === 2 ? `<svg>${markup}</svg>` : type === 3 ? `<math>${markup}</math>` : markup;\n const content = this._element.content;\n if (type !== 1) {\n const wrapper = content.firstChild!;\n while (wrapper.firstChild) content.insertBefore(wrapper.firstChild, wrapper);\n content.removeChild(wrapper);\n }\n\n /**\n * Pass 1 — DISCOVER over ELEMENT | COMMENT: pair scan specs with parsed nodes in document\n * order (which is expression order), and swap every marker comment for a primed empty text\n * node. The shipped template then contains no comments at all: each clone is three nodes\n * lighter per typical row, and the primed text doubles as both anchor and first-commit target.\n */\n markerWalker.currentNode = content;\n let specIndex = 0;\n let node: Node | null;\n const parts = this._parts;\n const consumeIgnored = () => {\n while (specIndex < specs.length && specs[specIndex]._type === IGNORED) {\n parts.push({ _type: IGNORED, _index: -1 });\n specIndex++;\n }\n };\n consumeIgnored();\n while (specIndex < specs.length && (node = markerWalker.nextNode()) !== null) {\n if (node.nodeType === 1) {\n const element = node as Element;\n if (element.hasAttributes()) {\n for (const attributeName of element.getAttributeNames()) {\n if (attributeName.endsWith(MARKER)) {\n /**\n * **Each marker carries its own spec index in its NAME**, so pairing is addressed\n * rather than positional — and a marker that never arrived is visible the moment the\n * next one does. Both halves matter and neither works alone:\n *\n * - REPAIR: an element the parser drops takes its marker with it. Paired by walk\n * order, that shifted every later binding onto the wrong element, silently —\n * `html\\`<select><div title=${'${a}'}>x</div></select><b title=${'${b}'}>\\`` rendered\n * `<b title=\"a\">`. Consuming the gap keeps every surviving binding on its own\n * element; only the dropped one is lost.\n * - REPORT: the repair would otherwise SILENCE the problem, which is a correct\n * refusal with nothing to tell the author — so the skip is where the warning lives.\n */\n const declared = parseInt(attributeName, 10);\n if (declared > specIndex) {\n if (__DEV__) warnDroppedBinding(specs, specIndex, declared - specIndex);\n do parts.push({ _type: IGNORED, _index: -1 });\n while (++specIndex < declared);\n }\n /**\n * The marker attribute's value carries the statics; the REAL (case-preserved) name\n * comes from the spec — the HTML parser lowercases attribute names, which would\n * corrupt `.someProp`.\n */\n const spec = specs[specIndex++] as { _type: 1; _name: string };\n parts.push({\n _type: ATTRIBUTE,\n _index: -1,\n _name: spec._name,\n _statics: element.getAttribute(attributeName)!.split(MARKER),\n /**\n * Computed here — once per template, ever — so the first commit of a nullish\n * binding knows whether a fresh clone even carries the attribute. It usually does\n * not, and the unconditional removal this feeds cost a real DOM call per element\n * per create: 1,000 no-op `removeAttribute`s on the 1,000-row benchmark. The one\n * case that must still remove — `<b title=\"a\" title=${null}>`, where the parser\n * keeps the first duplicate — is exactly what this reads.\n */\n _present: element.hasAttribute(spec._name),\n _node: element,\n });\n element.removeAttribute(attributeName);\n consumeIgnored();\n }\n }\n }\n if (RAW_TEXT_TAGS.test(element.tagName) && element.textContent!.includes(MARKER)) {\n /**\n * Comments cannot be PARSED inside raw-text elements, but they are legal DOM once\n * created — so the scan left text markers, and here they become real marker comments.\n * The walker visits them next and they pair as ordinary child parts.\n */\n const pieces = element.textContent!.split(MARKER);\n element.textContent = '';\n for (let p = 0; p < pieces.length - 1; p++) {\n if (pieces[p]) element.append(pieces[p]);\n element.append(comment(MARKER_COMMENT_DATA));\n }\n if (pieces[pieces.length - 1]) element.append(pieces[pieces.length - 1]);\n }\n } else if ((node as Comment).data === MARKER_COMMENT_DATA) {\n specIndex++;\n const primedText = doc.createTextNode('');\n node.parentNode!.insertBefore(primedText, node);\n /** Re-aim the walker before removing the node it stands on. */\n markerWalker.currentNode = primedText;\n (node as Comment).remove();\n if (__DEV__) warnImplicitSection(primedText.parentNode as Element | null);\n parts.push({ _type: CHILD, _index: -1, _node: primedText });\n consumeIgnored();\n }\n }\n\n /**\n * **CONSERVATION OF MARKERS — the walk must claim every spec the scan emitted.**\n *\n * The loop above pairs specs with markers in document order. If the HTML parser DROPPED the\n * element a binding was written on, that marker never exists, the loop runs out of nodes early,\n * and `specIndex` stops short — and because pairing is POSITIONAL, every binding after the\n * missing one has already been handed the value of its predecessor. Measured:\n *\n * html`<select><div title=${a}>x</div></select><b title=${b}>after</b>`\n *\n * renders `<b title=\"a\">` — the value written for the `<div>`, on an unrelated element, with\n * no error anywhere. `<form>` inside `<form>` does the same. HTML's parser drops elements its\n * content model forbids, which is correct of it and invisible to everything else here.\n *\n * **This is deliberately not a content-model check.** A table of what may contain what is a\n * closed vocabulary over an open space: it catches what somebody enumerated, needs maintenance\n * as HTML evolves, and would cover the compiler only — while this counts what actually\n * happened, in JSX and hand-written templates alike, for every dropping context including the\n * ones nobody listed. The cost of knowing is one integer comparison the construction already\n * had lying around.\n *\n * The gap it cannot close, named rather than implied: a dropped element carrying NO bindings\n * loses nothing to count. That is harmless to the renderer — nothing shifts — and it is the\n * restructuring class, which `tests/jsx-tree-parity.test.mjs` records instead.\n */\n if (__DEV__ && specIndex < specs.length) {\n /** A casualty at the very END has no later marker to reveal it, so the tail is checked too. */\n warnDroppedBinding(specs, specIndex, specs.length - specIndex);\n }\n\n /** Pass 2 — INDEX over ELEMENT | TEXT, the mask instances walk with. */\n instanceWalker.currentNode = content;\n let nodeIndex = -1;\n let partIndex = 0;\n while (partIndex < parts.length && parts[partIndex]._type === IGNORED) partIndex++;\n while (partIndex < parts.length && (node = instanceWalker.nextNode()) !== null) {\n nodeIndex++;\n while (partIndex < parts.length && parts[partIndex]._node === node) {\n parts[partIndex]._index = nodeIndex;\n partIndex++;\n while (partIndex < parts.length && parts[partIndex]._type === IGNORED) partIndex++;\n }\n }\n for (const part of parts) part._node = undefined;\n\n /**\n * THE SLOT WALK — the whole template-side seam, and it runs only when a 'slot' insert is\n * wired at construction. One dedicated pass discovers `<slot>` elements AND indexes them in\n * the same ELEMENT|TEXT numbering the instance walk uses (Text has no localName, so no\n * nodeType check is needed). Passes 1 and 2 above are byte-identical to their pre-seam\n * selves: an unwired app's construction path is untouched, and its only cost is this one\n * registry lookup per template construction.\n *\n * **Resolved per TEMPLATE, and templates are cached per call site for the life of the page** —\n * so a shape first constructed before `wire([slots])` ran never gains slot support, silently.\n * That is the ordinary insert contract (wire at the app entry, beside the renderer, before\n * anything renders) and it is stated in the slots module's own docs; resolving per INSTANCE\n * instead would move a registry lookup onto the hot path for every app, which is the trade\n * this design refuses.\n */\n const seam = slotSeam();\n /**\n * **Dev-only: remember that this markup HAS slots even when nothing can distribute them.**\n * Without it the two ways of getting the wiring wrong are indistinguishable from a component\n * that simply has no slots — see the warning at the instance's slot mount.\n */\n if (__DEV__ && seam === undefined && markup.includes('<slot')) this._slotless = true;\n if (seam !== undefined) {\n instanceWalker.currentNode = content;\n let index = -1;\n while ((node = instanceWalker.nextNode()) !== null) {\n index++;\n if ((node as Element).localName === 'slot') {\n this._seam = seam;\n (this._slots ??= []).push(index);\n }\n }\n }\n }\n}\n\nconst getTemplate = (result: TemplateResult) => {\n let template = templateCache.get(result.strings);\n if (template === undefined) templateCache.set(result.strings, (template = new Template(result)));\n return template;\n};\n\n/** Anything bound to a live position: commits values[index..], returns the next value index. */\ninterface Part {\n _commit(values: unknown[], index: number): number;\n}\n\nconst IGNORED_PART: Part = { _commit: (_values, index) => index + 1 };\n\n/** Never equal to any user value, so the first commit always runs. */\nconst UNSET = {};\n\n\n/** A fresh markered part: two comments inserted before `ref` in `parent`. */\nconst createMarkeredPart = (parent: Node, ref: Node | null) => {\n const start = comment();\n const end = comment();\n parent.insertBefore(start, ref);\n parent.insertBefore(end, ref);\n return new ChildPart(start, end);\n};\n\n/**\n * Text for an attribute built from several expressions.\n *\n * `` `${value}` `` rather than `String(value)`, and the difference is exactly one case. Both are\n * ToString with hint `'string'` for everything else; `String` alone special-cases a **symbol** and\n * returns its description instead of throwing. Every single-expression binding assigns straight to\n * the DOM and gets WebIDL's `DOMString` conversion, which throws on one — so `title=${symbol}` threw\n * and `title=\"a ${symbol} b\"` quietly rendered `a Symbol(s) b`. The same sigil on the same attribute,\n * disagreeing with itself depending on whether static text sat beside it.\n */\nconst toText = (value: unknown) => (value == null ? '' : `${value}`);\n\n/** Binding kinds, resolved once from the attribute name's first character. */\nconst ATTR = 0; // plain attribute\nconst PROPERTY = 1; // .name\nconst BOOLEAN = 2; // ?name\n/**\n * `!name` — a property written from the *live* DOM rather than from what this binding last wrote.\n *\n * Numbered below `EVENT` deliberately: `kind >= EVENT` is what decides a value is passed raw rather\n * than joined from the statics, and a live binding is a property, so `!title=\"a${x}b\"` has to join\n * like every other one.\n */\nconst LIVE = 3;\nconst EVENT = 4; // @name\n/** A binding that must never write — see the `__proto__` refusal in the constructor. */\nconst REFUSED = -1;\n/**\n * Calls an element ref, and survives one that throws.\n *\n * A ref runs in the middle of committing a template's parts, so an unguarded throw left the commit\n * half applied and unwound the render that triggered it — the component's shadow root ended up\n * **empty and stayed that way**, and every later update threw at the same line. The error was\n * reported, so the only symptom was a component that had silently stopped existing.\n *\n * The same judgement `handleEvent` makes a few lines up: a mistake in code the template was handed\n * is named, not raised from inside the framework at a point where the value's origin is long gone.\n * The prefix goes on our own sentence and the error is passed alongside, so it stays filterable\n * without misattributing someone else's `Error`.\n */\nconst applyRef = (callback: (el: Element | null) => void, element: Element | null) => {\n try {\n callback(element);\n } catch (error) {\n /** The sentence is development's; production keeps the prefix and the error carries the rest. */\n if (__DEV__) console.error('[vera] an element ref threw; the render continued without it.', error);\n else console.error('[vera] ref threw', error);\n }\n};\n\nconst REF = 5; // element-position expression\n\nclass AttrPart implements Part {\n _element: Element;\n _name: string;\n _statics: string[];\n _slots: number; // how many expression values this binding consumes\n _kind: number;\n _isFullValue: boolean; // exactly one expression with no static text around it\n _committed: unknown = UNSET;\n _handler: EventListener | null = null;\n /** `<select>.value`, which cannot be applied where it is written — see `pendingSelects`. */\n _select = false;\n /** The template statically wrote this attribute, so a first nullish commit must still remove. */\n _present: boolean;\n\n constructor(element: Element, name: string, statics: string[], present = false) {\n const first = name[0];\n let kind =\n first === '.'\n ? PROPERTY\n : first === '?'\n ? BOOLEAN\n : first === '@'\n ? EVENT\n : first === '&'\n ? REF\n : first === '!'\n ? LIVE\n : ATTR;\n let realName = kind ? name.slice(1) : name;\n /**\n * **`__proto__` is not a property write, so no property binding may make one.**\n *\n * `element.__proto__ = value` hits `Object.prototype`'s `__proto__` ACCESSOR and replaces the\n * element's prototype, stripping every DOM method it has. `.__proto__=${x}` crashed out of the\n * commit with an unreadable internal error; `!__proto__=${x}` bricked the element silently and\n * the wreckage surfaced in a LATER render, naming the renderer rather than the binding. There\n * is no legitimate use, so unlike `.innerHTML` there is no spelling to point at — the binding\n * is refused and never writes.\n *\n * **The deliberate twin of `refusedSink` in `./spread.ts`**, which refuses the same name for\n * the same reason. The two entries are independent bundles and neither imports the other, so\n * the rule is copied on purpose (the repo's standing note: sigil rules live in both AttrPart\n * and spread, and a fix has to visit every copy). `tests/dangerous-binding-matrix.test.mjs`\n * fails if one of them starts refusing something the other allows.\n */\n if ((kind === PROPERTY || kind === LIVE) && realName === '__proto__') {\n kind = REFUSED;\n if (__DEV__)\n console.warn(\n `[vera] <${element.localName}> binds \\`${name}\\`, which would replace the element's own ` +\n `prototype and destroy it — no property write does this, and no use of it is legitimate. ` +\n `The binding is ignored.`\n );\n }\n /**\n * React muscle-memory, buildless: `onClick=${fn}` ≡ `@click=${fn}`. Strictly `on` + a capital —\n * all-lowercase `onclick` stays a plain attribute (legal inline-handler HTML).\n *\n * `@verajs/renderer/spread` repeats these rules rather than importing them. Sharing them through\n * `@verajs/shared-utils` was tried and reverted: the shared form has to return both the kind and\n * the name, and the tuple it allocates cost this bundle 10 B. Principle #5 allows deliberate\n * duplication where two things can legitimately diverge; here #7 decides it — weight is the\n * product, and core and the renderer are the two packages where that is absolute.\n */\n if (kind === ATTR && first === 'o' && name.charCodeAt(1) === 110 && name.charCodeAt(2) > 64 && name.charCodeAt(2) < 91) {\n kind = EVENT;\n realName = name.slice(2).toLowerCase();\n }\n this._kind = kind;\n this._name = realName;\n this._element = element;\n this._statics = statics;\n this._slots = statics.length - 1;\n this._isFullValue = this._slots === 1 && statics[0] === '' && statics[1] === '';\n /** Resolved once, here, so the commit path costs one boolean rather than two comparisons. */\n this._select = kind === PROPERTY && realName === 'value' && element.localName === 'select';\n this._present = present;\n }\n\n /**\n * Releases an element ref, because the element it named is going away.\n *\n * A ref was told about attachment and never about detachment, so it kept a detached node alive and\n * a component reading `myRef.value` after a subtree was replaced got the old element back. Lit\n * passes `undefined` for the same reason.\n *\n * `null` rather than `undefined`, because `.value` is a store property and `null` reads as\n * \"deliberately nothing\" where `undefined` reads as \"never set\".\n *\n * **Reached when a subtree is rendered away, and deliberately not when a component is removed\n * from the document.** The two are the same event to a reader and not to this renderer: a\n * disconnect here is not a destruction, since moving a node between parents fires one and the\n * component renders again on reconnect. Releasing there would blank every ref for the frame a\n * move takes, and `_committed = UNSET` below means the re-apply could only happen on the next\n * pass. Measured in `tests/renderer-ref-lifetime.test.mjs`, which asserts both halves so the\n * asymmetry is a decision rather than something nobody looked at.\n *\n * A **self-applying** value is\n * skipped: `_$apply$` receives the part and owns its own lifecycle, so telling it about detachment\n * here would be a second protocol contradicting the first.\n */\n _release() {\n const value = this._committed;\n if (typeof value === 'function') applyRef(value as (el: Element | null) => void, null);\n else if (value !== null && typeof value === 'object' && (value as { _$apply$?: unknown })._$apply$ === undefined)\n (value as { value: unknown }).value = null;\n this._committed = UNSET;\n }\n\n /**\n * Stable listener; swapping one function for another never touches the DOM.\n *\n * **It is not registered exactly once, and the difference is load-bearing.** A handler set back to\n * `undefined` or `false` nulls `_handler` *without removing the listener* — inert, because\n * `handleEvent` finds nothing callable — so the next non-null value sees `_handler === null` and\n * calls `addEventListener` again. Measured: `function -> undefined -> function` registers twice.\n *\n * That is harmless only because the listener passed is **`this`, the part object itself**. The\n * platform ignores a repeated `(type, listener, capture)` triple, verified with no framework\n * involved — the same listener object added three times fires once. Pass a fresh closure here\n * instead and dedup stops applying: every toggle through null adds another live listener, silently,\n * and only in components that turn a handler off and on again.\n *\n * `tests/event-binding-fuzz.test.mjs` holds that as an invariant — it counts *fires*, not\n * `addEventListener` calls, and making this listener a closure fails it.\n *\n * **Two shapes, because `addEventListener` takes two.** A function is called with the element as\n * `this`; an object with a `handleEvent` method is invoked through it — the platform's own\n * `EventListenerObject` protocol, which every engine accepts and lit supports. This used to call\n * `.call()` unconditionally, so passing the platform's own listener shape bound successfully and\n * then threw `this._handler.call is not a function` on **every** dispatch.\n *\n * Anything else is inert rather than throwing. A truthy non-function is a mistake, and\n * development names it at the binding (see the `EVENT` branch in `_commit`) — where the mistake\n * still is. Throwing here instead would raise from inside the framework on every user click, at a\n * point where the value's origin is long gone.\n */\n handleEvent(event: Event) {\n const handler = this._handler as EventListener | EventListenerObject | null;\n if (typeof handler === 'function') handler.call(this._element as never, event);\n else if (typeof (handler as EventListenerObject)?.handleEvent === 'function')\n (handler as EventListenerObject).handleEvent(event);\n }\n\n /**\n * `adopting` is set only by `@verajs/renderer/hydrate`, and only changes what happens to the\n * three form-value properties the server can express in markup — see the branch below.\n */\n _commit(values: unknown[], index: number, adopting?: boolean): number {\n const kind = this._kind;\n /** Refused in the constructor and never writes — it still has to consume its slots. */\n if (kind === REFUSED) return index + this._slots;\n let value: unknown;\n if (this._isFullValue || kind >= EVENT) {\n value = values[index]; // raw and uncoerced — events and refs receive the actual value\n } else {\n const statics = this._statics;\n let joined = statics[0];\n for (let i = 0; i < this._slots; i++) joined += toText(values[index + i]) + statics[i + 1];\n value = joined;\n }\n /**\n * **A live property asks the element, not its own memory.**\n *\n * Every other kind skips a write when the value matches what it last wrote. That is what keeps\n * a field someone has typed into — and it is wrong for a control whose DOM state changes as a\n * *side effect of interacting with a sibling*. Clicking one radio unchecks the others with no\n * event on them, so their bindings still say `true`, still match `_committed`, and never write\n * again: the model and the page diverge and no amount of re-rendering reconciles them. A\n * `<select>`'s options are the same shape.\n *\n * Deliberately narrow. This is not for text inputs — bind those with `.value` and let a\n * person's typing stand. `?hidden` and plain attributes are not offered either: nothing changes\n * them behind the renderer's back, so there is nothing to re-read.\n */\n if (kind === LIVE) {\n this._committed = value;\n /**\n * **Except while adopting.** Hydration reaches a DOM a person may already have used, and the\n * click that checked a radio happened before any handler existed to tell the store about it —\n * so re-asserting the server's choice here would throw the interaction away and nothing would\n * ever put it back. Recorded, not written, exactly as the other form properties are; the\n * first state-driven render after that applies live semantics normally.\n */\n if (!(__HYDRATING__ && adopting)) {\n const liveTarget = this._element as unknown as Record<string, unknown>;\n if (liveTarget[this._name] !== value) liveTarget[this._name] = value;\n }\n return index + this._slots;\n }\n /**\n * **A `<select>`'s value cannot be applied where it is written.**\n *\n * Assigning it selects an option, and at the moment this part commits the options may not exist:\n * parts commit in document order, so a nested `${items.map(…)}` has not run, and an `<option\n * value=${id}>` has not been given its value either. The assignment then matches nothing, and the\n * select falls back to its first option — silently showing the wrong one. Measured: a nested list\n * selected index 0 instead of 1, and dynamic option values selected nothing at all.\n * **lit-html has the same defect, byte for byte** — it was measured there too. React solves it by\n * special-casing `<select value>` and applying it after children mount, which is what this is.\n *\n * Queued rather than dirty-checked, and that is deliberate: the value can be unchanged while the\n * *options* are replaced, which drops the selection just as thoroughly. Re-asserting once per\n * render pass is what keeps it right, and a select carries one binding, so it is one push.\n */\n if (this._select) {\n this._committed = value;\n /** Adoption never re-asserts a form value — the person may have changed it. See below. */\n if (!(__HYDRATING__ && adopting)) (pendingSelects ??= []).push(this._element as HTMLSelectElement, value);\n return index + this._slots;\n }\n if (value !== this._committed) {\n if (kind === ATTR) {\n /**\n * A nullish value removes the attribute — except on the first commit of a template that\n * never statically wrote it, where a fresh clone has nothing to remove. That skip used to\n * be unconditional-removal instead, for the one case that genuinely needs it:\n * `<b title=\"a\" title=${null}>` parses keeping the first duplicate, so the binding —\n * written last, and authoritative on the server too — must clear it. `_present` is that\n * case, read off the parsed template once ever; without it the removal was a real DOM call\n * per nullish binding per element on create — 1,000 no-ops in the 1,000-row benchmark.\n */\n if (value == null) {\n if (this._present || this._committed !== UNSET) this._element.removeAttribute(this._name);\n }\n else {\n /**\n * The same question `@verajs/renderer/spread` asks at its own sink, from the same home —\n * the two are deliberately separate implementations (see spread's header on why), and a\n * diagnostic that lived in only one of them would be the very defect this audit found.\n * `setAttribute` performs the DOMString conversion itself; nothing is stringified here.\n */\n if (__DEV__) {\n const complaint = attributeValueComplaint(this._element.localName, this._name, value);\n if (complaint !== null) console.warn(`[vera] ${complaint}`);\n }\n this._element.setAttribute(this._name, value as string);\n }\n } else if (kind === PROPERTY) {\n const target = this._element as unknown as Record<string, unknown>;\n const name = this._name;\n /**\n * **Adopting a form value: record it, do not write it.**\n *\n * `value`, `checked` and `selected` are exactly the properties `@verajs/ssr` mirrors into\n * markup, so the element already holds what this binding says — *unless a person changed\n * it*, which is the entire reason to server-render: the page is usable before the bundle\n * lands, and the window between the two is where someone types their name, ticks a box or\n * picks an option. Writing the binding then threw that away, silently, on every hydrating\n * page. The part is told it already committed this value, so it stays live and the next\n * genuine state change still applies.\n *\n * Only these three, and only while adopting. A property the server cannot express — any\n * other `.prop` — is not in the DOM yet and must be written.\n */\n if (__HYDRATING__ && adopting && (name === 'value' || name === 'checked' || name === 'selected')) {\n this._committed = value;\n return index + this._slots;\n }\n target[name] = value;\n /**\n * Detection only, and deliberately not repair.\n *\n * A property set on a custom element that has not upgraded yet lands as an own property on\n * the instance. When the definition arrives — lazily imported, code-split, or a module that\n * simply had not run — `customElements.define` upgrades synchronously and the class's field\n * initializers execute. At target ES2022 a field declaration is a `[[Define]]`, so\n * `item?: T` emits `item;` and overwrites the bound value with `undefined`. Nothing throws;\n * it reads as broken reactivity.\n *\n * Repairing it was tried and removed. Re-applying when the slot came back `undefined`\n * covered `item?: T` but not `item = someDefault`, which overwrites with the default and\n * never looks clobbered — so the repair was silently partial, and made the bug intermittent\n * across two spellings of the same mistake. It also cost 74 B in every app while leaving\n * `declare` mandatory anyway, because a property assigned imperatively is unrecoverable:\n * the renderer never saw it, and by the time `init()` runs the value is already gone.\n *\n * So this is `__DEV__`-only and production pays nothing — no check, no message, no\n * `whenDefined` subscription. Lit reached the same place from the other direction and\n * throws (`lit.dev/msg/class-field-shadowing`); a warning suffices here because Vera has no\n * prototype accessors to shadow permanently — the damage is one lost value, not a property\n * that never updates again.\n */\n if (__DEV__) {\n const tag = this._element.localName;\n if (tag.indexOf('-') > 0 && !customElements.get(tag)) {\n customElements.whenDefined(tag).then(() => {\n /**\n * States what was observed rather than diagnosing it. A class field is the usual\n * cause by a wide margin, but a component that assigns the property itself during\n * upgrade produces the same observation, and that is a legitimate — if confusing —\n * thing to do, since the renderer's dirty check will not re-apply the bound value on\n * the next render either.\n */\n if (target[name] !== value)\n console.warn(\n `[vera] renderer: the value bound by \\`.${name}=\\${…}\\` on <${tag}> was replaced ` +\n `while the element upgraded. A class field is the usual cause: at ES2022 ` +\n `\\`${name}?: …\\` emits \\`${name};\\`, which runs during upgrade and overwrites ` +\n `whatever was set beforehand — write it \\`declare ${name}?: …\\` instead, which ` +\n `emits nothing. A plain field also wipes properties assigned imperatively, ` +\n `which cannot be detected at all. Ignore this if the component replaced the ` +\n `value on purpose.`\n );\n });\n }\n }\n } else if (kind === BOOLEAN) {\n /** Unconditional for the same reason: `<b hidden ?hidden=${false}>` must end up not hidden. */\n this._element.toggleAttribute(this._name, !!value);\n } else if (kind === EVENT) {\n /**\n * A listener is the most deferred call a template makes — it is validated when a *user*\n * clicks, which in development may be never. So it is checked where it is written, the same\n * rule the setters took on: the stack at dispatch no longer contains the binding.\n *\n * `false` is deliberately allowed and silent. `@click=${enabled && onClick}` is the ordinary\n * way to bind conditionally and produces exactly that, and it already behaves correctly —\n * `handleEvent` finds nothing callable and does nothing. `true` is not produced by any\n * idiom, so it is named along with strings, numbers and objects that cannot listen.\n */\n if (__DEV__ && value != null && value !== false && typeof value !== 'function' &&\n typeof (value as EventListenerObject)?.handleEvent !== 'function')\n console.warn(\n `[vera] @${this._name} on <${this._element.localName}> was given ${typeof value === 'object' ? 'an object with no handleEvent method' : `a ${typeof value}`}, ` +\n `which cannot listen — the event will do nothing.\\n` +\n `Pass a function, or an object with a handleEvent method. A missing handler is ` +\n `\\`undefined\\` or \\`false\\`, both of which are fine; this is neither.`\n );\n if (this._handler === null && value != null) this._element.addEventListener(this._name, this);\n this._handler = (value as EventListener) ?? null;\n } else if (value != null) {\n /**\n * Element ref: `<input ${myRef} />`. A function is called with the element; an object gets\n * the element assigned to `.value` — which makes core's own `ref()` double as an element\n * ref, reactively. Runs once per distinct value, not once per render.\n */\n notifyOnRemoval = true;\n if (typeof value === 'function') applyRef(value as (el: Element | null) => void, this._element);\n else if (typeof value === 'object') {\n /**\n * A self-applying value: anything that knows what to do with an element applies itself.\n * `@verajs/renderer/spread` is the first, and the whole protocol is this one property\n * read — the implementation lives in that entry, so an app that never spreads pays for\n * the check and nothing else. `_$…$` is exempt from property mangling, like `_$litType$`.\n *\n * Deliberately confined to the element position, which is rare. A protocol in the text,\n * attribute or property commits would sit in the hot path every benchmark measures.\n */\n const self = value as { _$apply$?: (el: Element, part: object) => void; value: unknown };\n /** The part is passed as the ownership key: one element can carry several spreads. */\n if (self._$apply$) self._$apply$(this._element, this);\n else self.value = this._element;\n }\n // any other value type at element position is consumed and ignored\n }\n this._committed = value;\n }\n return index + this._slots;\n }\n}\n\n/**\n * `<select>.value` assignments held until the whole pass has committed — see the note in `_commit`.\n * Flat pairs rather than tuples: one array, no per-entry allocation.\n */\nlet pendingSelects: unknown[] | null = null;\n\nconst flushSelects = () => {\n const queued = pendingSelects;\n if (queued === null) return;\n /** Cleared first: an assignment can run a `change` handler that renders again. */\n pendingSelects = null;\n for (let i = 0; i < queued.length; i += 2)\n (queued[i] as HTMLSelectElement).value = queued[i + 1] as string;\n};\n\nconst SCRATCH = doc.createDocumentFragment();\n\n/**\n * Marks a node as the render root's OWN output — see `ChildPart._insert`. Sigil-named so property\n * mangling cannot rename it: this is read by `@verajs/renderer/slots`, across a bundle boundary,\n * and a module-scoped Symbol would be minted twice on a CDN page (the `@verajs/styles` lesson).\n *\n * A fragment is stamped through to its children, because inserting one moves the children and the\n * fragment itself never enters the document — the observer reports the children.\n *\n * **Defined rather than assigned, so it is NON-ENUMERABLE.** A plain `node._$own$ = true` is an own\n * enumerable property: measured, it then shows up in `Object.keys(element)` — which is `[]` for\n * every other DOM element — and in `for…in`. Invisibility to everything outside the framework is\n * the whole reason this is a property and not a marker or an attribute, and an enumerable one is\n * not invisible. The descriptor is shared, so this allocates nothing per node, and the path is\n * gated on slots being wired, so no app that does not use them ever reaches it.\n */\nconst OWN_DESCRIPTOR: PropertyDescriptor = { value: true, enumerable: false, configurable: true, writable: true };\n/**\n * The stamp is VALUED, and the value is the discriminator (`docs` in the slots module read it):\n *\n * `true` — the render root's own output: never slot content.\n * a ChildPart — light content PLACED by that part from an outer template. The part identity\n * is the ordering group: a grown row belongs after ITS part's other rows, and\n * `<host>${a}${b}</host>` must not interleave a's refill into b's content —\n * which is exactly what happens if the group is the render root, shared by both.\n * absent — an imperative user mutation; the light region orders it by document position.\n *\n * One shared, mutated descriptor: `defineProperty` reads it synchronously, so this allocates\n * nothing per node while keeping the property non-enumerable (see the invisibility note above).\n */\nconst stampOwn = (node: Node, value: true | object = true) => {\n OWN_DESCRIPTOR.value = value;\n if (node.nodeType === 11) {\n for (let child = node.firstChild; child !== null; child = child.nextSibling)\n Object.defineProperty(child, '_$own$', OWN_DESCRIPTOR);\n return;\n }\n Object.defineProperty(node, '_$own$', OWN_DESCRIPTOR);\n};\n\n/** A row is either an element-mode instance or a markered part; both can hold appliers. */\nconst detachItem = (item: Item) => {\n item._instance?._teardown();\n item._part?._detach();\n};\n\n/**\n * A value that names the strategy able to reconcile a list of its kind. `keyed()` in\n * `@verajs/renderer/keyed` is the only producer today; the shape is deliberately open so a\n * virtualizer or an async list can ship as its own module without this file learning about it.\n *\n * `$r` and the three members it calls are exempt from property mangling — they are the only names\n * that cross a bundle boundary, and they are two characters so crossing costs nothing.\n */\nexport type ListStrategy = (\n part: ChildPart,\n values: unknown[],\n items: Item[],\n parent: Node,\n end: Node | null\n) => Item[];\n\nexport type KeyedResult = TemplateResult & { $r?: ListStrategy };\n\n/**\n * A list item is either ELEMENT-MODE — a single-root template instance whose one element IS the\n * item's boundary (`_element`/`_instance`/`_shape` set, `_part` null) — or a general markered\n * ChildPart. Rows are single-root in virtually every real list, and element mode drops both marker\n * comments and both marker inserts per item, which is exactly the per-row overhead a vdom does not\n * pay on create.\n */\ntype Item = {\n $k: unknown;\n _element: Element | null;\n _instance: Instance | null;\n _shape: TemplateStringsArray | null;\n _part: ChildPart | null;\n};\n\nclass Instance {\n _parts: Part[] = [];\n _fragment: DocumentFragment;\n /**\n * **`declare`, so nothing is emitted and no instance carries these unless it uses them.**\n * Under ES2022 class-field semantics a plain `_x?: T` is DEFINED on every instance, undefined or\n * not — measured, two such declarations cost every row of a 200-row list a property apiece and\n * showed up as a few percent off update throughput. Templates without slots now allocate exactly\n * what they did before this feature existed, and the ones with slots take a shape transition\n * once.\n *\n * `_slotStates` — taken-over slot states, parked at teardown.\n * `_pendingSlots` — resolved `<slot>` clones awaiting mount; cleared by the first `_update`.\n */\n declare _slotStates?: SlotSeamState[];\n declare _pendingSlots?: Element[];\n constructor(template: Template) {\n /**\n * `importNode`, not `cloneNode` — the difference is custom-element upgrade, not the document.\n * Template content lives in the inert template document, so `cloneNode` copies stay\n * un-upgraded until insertion; a `.prop` committed in that window lands as an OWN property\n * that permanently shadows a defined class's setter (the setter never fires — every\n * accessor-based element, Lit's included, receives a dead value) and a bound value on a\n * class-field element is clobbered by the field initializer at insert, silently, because the\n * `whenDefined` detector below only watches definitions that arrive LATE. Hydration commits\n * onto server-parsed, already-upgraded elements, so the two render paths disagreed about the\n * same template. `importNode`'s cloning steps upgrade defined elements at clone time — in\n * every engine and in jsdom — which makes the commit order match hydration and the platform.\n * Undefined elements are untouched: nothing can upgrade them, and the pre-upgrade posture\n * (own property, clobber on define, development warning) stands as pinned in\n * `tests/pre-upgrade-property.test.mjs`. Measured cost of losing `cloneNode`: ~2–7% of the\n * raw clone operation across the three engines — nanoseconds per instance.\n */\n this._fragment = doc.importNode(template._element.content, true);\n const templateParts = template._parts;\n /** Shared walker, ELEMENT | TEXT — child anchors are the primed text nodes themselves. */\n instanceWalker.currentNode = this._fragment;\n let nodeIndex = -1;\n let node: Node | null = null;\n for (let i = 0; i < templateParts.length; i++) {\n const templatePart = templateParts[i];\n if (templatePart._type === IGNORED) {\n this._parts.push(IGNORED_PART);\n continue;\n }\n while (nodeIndex < templatePart._index) {\n node = instanceWalker.nextNode();\n nodeIndex++;\n }\n this._parts.push(\n templatePart._type === CHILD\n ? new TextPart(node as Text)\n : new AttrPart(node as Element, templatePart._name!, templatePart._statics!, templatePart._present)\n );\n }\n /**\n * Slot records mount OUTSIDE the parts array — one extra walk from the top, paid only by\n * templates that HAVE slots, only inside a renderInto commit (null root — hydration's\n * adoption path — stays inert), and only when the 'slot' insert answers. Taking over sets\n * `notifyOnRemoval`: `_$park$` must rescue the USER'S nodes before a bulk `_clear` discards\n * the DOM holding them on a branch-away. `_update` never sees any of this.\n */\n if (template._seam !== undefined && _slotRoot !== null) {\n const slotRecords = template._slots!;\n /**\n * RESOLVE every slot element to its clone in ONE walk, and mount them AFTER the first\n * `_update` — see `_mountSlots`. Collect-then-act, because the seam MUTATES the fragment\n * (it lifts each `<slot>` out and drops in anchors) and a walk that interleaved resolution\n * with those mutations would read shifted indices and miss later slots.\n */\n instanceWalker.currentNode = this._fragment;\n nodeIndex = -1;\n const slotNodes: Element[] = [];\n for (let i = 0; i < slotRecords.length; i++) {\n while (nodeIndex < slotRecords[i]) {\n node = instanceWalker.nextNode();\n nodeIndex++;\n }\n slotNodes.push(node as Element);\n }\n this._pendingSlots = slotNodes;\n }\n /** Standalone rather than an `else` branch: `_slotless` is only ever set when there was no\n * seam, so the condition stands alone — and a lone `if (__DEV__ …)` folds away cleanly. */\n if (__DEV__ && template._slotless === true && _slotRoot !== null && _slotRoot.nodeType === 1) {\n /**\n * **A `<slot>` in a LIGHT render that nothing will distribute.** Both ways of arriving here\n * are silent otherwise, and both leave the same confusing picture. Measured, for a host given\n * `<b slot=\"a\">MINE</b>`:\n *\n * <b slot=\"a\">MINE</b><!----><div class=\"box\"><slot name=\"a\">FB</slot></div>\n *\n * — the content is not destroyed, it is stranded ahead of the render while the slot shows its\n * fallback. The message says \"any content the host is given\" rather than asserting the host\n * HAS some: a component that consumes its own children before rendering and also declares\n * slots — `@verajs/ui`'s select is one — warns with nothing stray on the page, and a reader\n * sent looking for markup that is not there concludes the diagnostic is confused.\n *\n * 1. `@verajs/renderer/slots` was never wired at all.\n * 2. It was wired AFTER this template first rendered. Templates are interned per call site\n * for the life of the page and resolve the seam once, at construction — so a component\n * that rendered before the wiring keeps a slotless template forever, and every later use\n * of it fails the same way. Measured: the same `draw()` distributes at a fresh call site\n * and not at this one.\n *\n * A shadow root never reaches here: the platform slots there, which is why this is gated on\n * an element root.\n */\n warnSlotless(_slotRoot as Element);\n }\n }\n\n /**\n * One walk, both jobs: release the element refs in this instance and tell any child applier\n * under it that it is going away.\n *\n * They were two walks over the same array — `_release` for refs, `_detach` for appliers — which\n * is the same tree traversed twice for two answers that arrive at the same moment. Merged, the\n * per-part cost is one `_kind` compare and one `_upgraded` read.\n *\n * Reached only when this instance's template holds a ref, or some applier somewhere declared\n * teardown. An app with neither never runs it: this is the per-node work the bulk removal exists\n * to skip, and the gate is what keeps it out of the path.\n *\n * Through `_upgraded`, not just `_parts`. A child position is instantiated as a `TextPart` and\n * **upgrades** to a `ChildPart` the first time it takes an object — so the part holding a\n * applier is almost never the one in this array, it is the one that array's entry points at.\n * Walking `_parts` alone found nothing at all.\n */\n _teardown() {\n const parts = this._parts;\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i];\n if ((part as AttrPart)._kind === REF) (part as AttrPart)._release();\n (part as TextPart)._upgraded?._detach();\n }\n /** Taken-over slots park the USER'S nodes before this instance's DOM is discarded. */\n this._slotStates?.forEach((state) => state._$park$?.());\n }\n\n _update(values: unknown[]) {\n let valueIndex = 0;\n const parts = this._parts;\n for (let i = 0; i < parts.length; i++) valueIndex = parts[i]._commit(values, valueIndex);\n if (this._pendingSlots !== undefined) this._mountSlots();\n }\n\n /**\n * **Slots mount after the first `_update`, not during construction, because a `<slot>`'s own\n * bindings are part of its meaning.** `<slot name=${section}>` has no name at all until its\n * `AttrPart` has committed, and mounting first read the static markup and got `''` — the slot\n * registered as a second DEFAULT slot, took the default content, and left the real default slot\n * showing fallback. Committing first also means `@slotchange` and `&ref` are already attached to\n * the element by the time anything is dispatched on it.\n *\n * Once per instance: the fields are cleared here and every later `_update` costs one compare.\n */\n _mountSlots() {\n const slotNodes = this._pendingSlots!;\n this._pendingSlots = undefined;\n /**\n * `_slotRoot` still holds the container: it is set for the whole of one `renderInto` and every\n * instance under it — nested templates included — is constructed and first-updated inside that\n * same synchronous span, so this is the root the constructor saw.\n */\n const root = _slotRoot;\n const seam = slotSeam();\n if (seam === undefined || root === null) return;\n for (let i = 0; i < slotNodes.length; i++) {\n const slot = slotNodes[i];\n const state = seam(slot, root, slot.getAttribute('name') ?? '');\n if (state != null) {\n (this._slotStates ??= []).push(state);\n notifyOnRemoval = true;\n }\n }\n }\n}\n\n/** A single property read — this runs once per list item per render, so it must be minimal. */\nconst isTemplateResult = (value: object): value is TemplateResult =>\n (value as TemplateResult).strings !== undefined;\n\n/**\n * The common case of a child expression is plain text, and the template primes every child slot\n * with a text node — so the steady state is compare-and-assign on `.data`. This part carries only\n * that, upgrading itself to a full ChildPart the first time it sees null, a template, or an array.\n */\nclass TextPart implements Part {\n _text: Text;\n _value: unknown = '';\n _upgraded: ChildPart | null = null;\n\n constructor(text: Text) {\n this._text = text;\n }\n\n _commit(values: unknown[], index: number): number {\n const value = values[index];\n if (this._upgraded !== null) {\n this._upgraded._set(value);\n return index + 1;\n }\n if (value == null || typeof value === 'object') {\n /**\n * Upgrade in place: marker comments come into existence only now, anchored around the text\n * node, and the full part inherits the committed text state and delegates forever.\n *\n * BOTH markers are ours. Borrowing `this._text.nextSibling` as the end instead would hand\n * this part a boundary owned by the NEXT part — and the next part removes that very node\n * when it upgrades and clears its own text. The stale reference then makes `_clear()` walk\n * past the end of the child list. Owning both anchors also makes `_end === null` mean\n * exactly one thing: the root part, which really does own its container.\n */\n const start = comment();\n const end = comment();\n /**\n * **Markers go where the part LIVES, which is not always where its text node is.** In a\n * light host wired for slots, this text node was captured and distributed into the\n * component's tree — planting markers beside it there put them inside the slot's range,\n * the slot's next fill swept them into the holding fragment, and the part spent the rest\n * of the page rendering into detached space (measured: `<host>${text}</host>` toggling\n * through null showed FALLBACK forever). `_$home$` answers with the host's light-region\n * sentinel for a captured node and null for everything else, so every app without light\n * slots takes the second branch untouched.\n */\n const home = slotSeam()?._$home$?.(this._text) ?? null;\n const parent = home !== null ? home.parentNode! : this._text.parentNode!;\n if (home !== null) {\n parent.insertBefore(start, home);\n parent.insertBefore(end, home);\n } else {\n parent.insertBefore(start, this._text);\n parent.insertBefore(end, this._text.nextSibling);\n }\n const part = new ChildPart(start, end);\n part._mode = TEXT;\n part._text = this._text;\n part._value = this._value;\n this._upgraded = part;\n part._set(value);\n return index + 1;\n }\n if (value !== this._value) {\n this._value = value;\n this._text.data = value as string;\n }\n return index + 1;\n }\n}\n\n/**\n * A value at a child position that applies itself — see `ChildPart._set`.\n *\n * `previous` is whatever this applier returned at this part on the last render, which is where a\n * applier keeps its continuity. Returning nothing is fine for one that has none.\n */\nexport type Applier = ((part: { _$commit$(value: unknown): void }, previous: unknown) => unknown) & {\n /**\n * Optional teardown, hung on the **applier** rather than on the value.\n *\n * The applier is already required to be hoisted — a fresh function per render breaks continuity —\n * so it is the one stable object in the protocol and the natural place for a second half. It\n * receives whatever the applier last returned, which is where its state lives.\n */\n _$detach$?: (previous: unknown) => void;\n};\n\n/**\n * A value at a child position the renderer has no built-in answer for. Return `true` to claim it.\n *\n * A handler will also be handed the **operations** it needs to do its job — the shape\n * `'proxy-handler'` uses, where core passes `addCallback` and `runCallbacks` rather than exposing\n * them as members. That object is deliberately *not* here yet: an earlier draft guessed nine\n * methods, nothing used them, they cost 90 B of anticipation, and porting the list algorithm then\n * showed it needs closer to fourteen — including item accessors the guess had no idea about. It\n * gets built in the step that has a caller to shape it.\n *\n * This is how a value *kind* becomes a package rather than a branch: lists, an async value, a\n * portal, a virtualizer. The built-ins below register through it too, so a third party's kind is\n * not second-class to one that shipped in the box.\n */\nexport type ValueHandler = (part: object, value: unknown) => boolean | void;\n\n/**\n * The registry this renderer reads `'value'` handlers from, handed over by {@link renderer}.\n *\n * Not imported. The renderer carries no registry of its own for the same reason the router does\n * not: a production bundle inlines `@verajs/inserts`, so importing it would give this package one\n * registry and core another, and an app would register into whichever it happened to import — the\n * failure `connectInserts` used to repair.\n */\nlet registry: { get(name: 'value' | 'slot'): unknown[] | undefined } | null = null;\n\n/**\n * The ONE lookup for the `'slot'` insert. Three callers want the same thing in the same shape —\n * template construction (are there slots to record?), the first render into a container (capture\n * the host's children), and hydration's rescue (un-distribute before a mismatch discards) — and\n * the seam carries its cross-bundle members as sigil-named keys, which every caller had to spell\n * out again. One accessor, spelled once.\n */\n/**\n * **Whether ANY app on this page wired light slots**, latched the first time the seam answers.\n *\n * The ownership stamp in `_insert`/`$c` exists only for `@verajs/renderer/slots` to read, and its\n * guard has to be free for everyone else — `_slotRoot` is set for every `renderInto`, so without\n * this an app with no slots at all would stamp every top-level node it renders, which for a list\n * at the root is a property write per ROW. One boolean instead, false for the life of a page that\n * never wires them.\n */\nlet slotsWired = false;\nconst slotSeam = (): SlotSeam | undefined => {\n const seam = (registry?.get('slot') as SlotSeam[] | undefined)?.[0];\n if (seam !== undefined) slotsWired = true;\n return seam;\n};\nconst noHandlers: ValueHandler[] = [];\nconst valueHandlers = () => (registry ? ((registry.get('value') as ValueHandler[] | undefined) ?? noHandlers) : noHandlers);\n\n/**\n * Kinds this package still ships. They read from a local list rather than the registry because the\n * renderer cannot register into one it was merely handed — that needs `wire`, which it does not\n * import. The list empties when they move to packages; until then a wired handler is checked first,\n * so a module can pre-empt a built-in exactly as the priority order promises.\n */\nconst builtIns: ValueHandler[] = [];\n\n/**\n * Whether anything in this process has asked to be told when a subtree is removed — an element ref\n * to release, or a child applier that declared `_$detach$`.\n *\n * **One flag for both, and it is process-wide.** Teardown cannot be discovered from the template the\n * way a ref can — a ref is a `&` part the scan sees, while an applier arrives as a *value* and no\n * template shape predicts it — so the coarser gate is the only one that serves both.\n *\n * The finer, per-template gate for refs was measured and dropped: it saved 34 B less than nothing,\n * because the walk it avoided is not the expensive part. With one unrelated ref on the page, a\n * 1 000-row clear walks 1 000 instances and measures 3.98 ms against 4.03 ms with no ref at all —\n * the DOM removal dominates completely. What matters is that an app asking for neither walks\n * **zero**, and that still holds.\n */\nlet notifyOnRemoval = false;\n\n/**\n * The hydrate entry's way to raise the flag. Every CLIENT path that creates removal work sets\n * `notifyOnRemoval` where the work is created (a ref committing, a slot mounting, an applier\n * declaring `_$detach$`) — but hydration ADOPTS its seams through its own walk in `hydrate.ts`,\n * a different module compiled into the same bundle, and a page whose only seams were adopted\n * left the flag down. `_clear` then skipped `_detach` entirely: no `_teardown`, no `_$park$`,\n * and the user's server-adopted slotted content was destroyed on the first branch-away — the\n * exact content-loss class the seam's park exists to prevent, reintroduced one entry over.\n */\nexport const declareRemovalWork = (): void => {\n notifyOnRemoval = true;\n};\n\n/**\n * Dev-only: how many times a part has seen a *different* child applier. See the branch that reads it.\n *\n * `@__PURE__` is load-bearing. Every read sits behind `__DEV__`, but a bare `new WeakMap()` at module\n * scope is a constructor call terser must assume has side effects, so production kept the allocation\n * with its binding dropped — a literal `new WeakMap;` statement building an object nothing could ever\n * reach. The annotation is what lets the dead branch take it along.\n */\nconst _applierSwaps = /* @__PURE__ */ new WeakMap<object, number>();\n\n/** What a ChildPart currently contains. */\nconst EMPTY = 0;\nconst TEXT = 1;\nconst TEMPLATE = 2;\nconst LIST = 3;\nconst NODE = 4;\n\n/**\n * Development-only profiling hook, armed by `@verajs/renderer/profiler`. Null until something\n * arms it, so an unprofiled development render pays one null check per template commit.\n *\n * Every reference sits behind `__DEV__`, which `defineDev()` folds to `false` before terser runs —\n * so the declaration, the constants and every call site are removed from the production bundle.\n * Verified by byte comparison, not assumed.\n */\nconst PROFILE_UPDATE = 0; // same template identity — values committed in place\nconst PROFILE_CREATE = 1; // first template into an empty part\nconst PROFILE_REBUILD = 2; // template identity CHANGED — subtree torn down and rebuilt\nconst PROFILE_FRAME_START = 3;\nconst PROFILE_FRAME_END = 4;\n\ntype ProfileHook = (kind: number, subject: unknown, shape: TemplateStringsArray | null) => void;\nlet _profileHook: ProfileHook | null = null;\n/** @internal */\nconst _setProfileHook = (fn: ProfileHook | null) => {\n _profileHook = fn;\n};\n\nclass ChildPart implements Part {\n _start: Comment;\n /** Exclusive end of this part's range; null means \"to the end of the parent\". */\n _end: Node | null;\n _mode = EMPTY;\n _value: unknown;\n _text: Text | null = null;\n _instance: Instance | null = null;\n /** The committed template's strings identity — the same-template fast path in `_set`. */\n _shape: TemplateStringsArray | null = null;\n _items: Item[] | null = null;\n _keyedList = false;\n /** Held instances by template identity; survives clears so state outlives interim content. */\n _held: Map<TemplateStringsArray, Instance> | null = null;\n /** Whatever the last `_$child$` at this part returned — its continuity across renders. */\n _applierState: unknown = undefined;\n /** Which applier that state belongs to, so two of them at one part cannot read each other's. */\n _applier: unknown = undefined;\n\n constructor(start: Comment, end: Node | null) {\n this._start = start;\n this._end = end;\n }\n\n _commit(values: unknown[], index: number): number {\n this._set(values[index]);\n return index + 1;\n }\n\n /**\n * **A component's own output is STAMPED, so the slot system cannot mistake it for content.**\n *\n * `@verajs/renderer/slots` captures a top-level element carrying a `slot` attribute as the\n * host's content — which a component's own rendered root may legitimately be, when it renders\n * something destined for ITS parent's slot. Measured: with slots wired,\n * `renderInto(html\\`<div slot=\"x\">…</div>\\`, element)` distributed the component's output into\n * its own holding fragment and the component rendered NOTHING, on the first render, with no\n * children involved and nothing thrown.\n *\n * The renderer is the one party that knows: it is inserting at the top level of the container\n * it was asked to render into. `_slotRoot` is that container for the whole of one `renderInto`,\n * so `parent === _slotRoot` is exactly \"this is the component's own output\" and distinguishes it\n * from `<x-card>${value}</x-card>`, where the part's parent is the host but the render root is\n * an ancestor — the user's light content, which must still be captured.\n *\n * Two comparisons on a path that is already touching the DOM, and the stamp is a PROPERTY:\n * invisible to CSS, to serialization and to `children`, unlike any marker or attribute, and it\n * rides on text nodes, which no attribute can. An app without slots wired writes it and nothing\n * ever reads it.\n */\n /**\n * **One property read decides all stamping, and root-part-ness decides the value.**\n *\n * `_$hosted$` is set on the host element itself by `@verajs/renderer/slots` at capture, so\n * \"does anything care about ownership here\" is a single own-property read — no seam call, no\n * registry lookup, and pages that are not captured hosts (every container in most apps) cost\n * exactly that read and write nothing. The mark cannot go stale in the direction that matters:\n * a part's first commit runs in a detached fragment before its host is captured, reads\n * `undefined`, and stamps nothing — and that content is exactly what the initial capture walk\n * lifts anyway. Every later commit sees the mark.\n *\n * The VALUE is structural, not temporal. `_end === null` is true of root parts alone (see\n * `_clear`), and a root part's inserts are by definition the render's own output — a fact that\n * stays true for an applier committing from a microtask hours after `renderInto` returned,\n * where the earlier `parent === _slotRoot` test read null and left ASYNC output unstamped for\n * the flipped capture rule to eat. Everything else inserting into a host is placing content\n * INTO it from outside, stamped with the part — the ordering group.\n */\n _insert(node: Node) {\n const parent = this._start.parentNode!;\n if (slotsWired && (parent as { _$hosted$?: boolean })._$hosted$ === true)\n stampOwn(node, this._end === null ? true : this);\n parent.insertBefore(node, this._end);\n }\n\n /**\n * Tells every child applier under this part that it is going away.\n *\n * Reached only when some applier somewhere declared teardown — see `notifyOnRemoval` — because\n * this is the per-node walk the bulk removal exists to skip. **Every** removal path calls it, not\n * just `_clear`: a keyed row is dropped by moving its nodes to a scratch fragment and an index-mode\n * list shrinks by removing nodes directly, so a version that only hooked `_clear` notified a\n * applier when its container was replaced and stayed silent when its row was deleted — told\n * sometimes, which is a worse contract than never.\n */\n _detach() {\n if (this._applier !== undefined) (this._applier as Applier)._$detach$?.(this._applierState);\n this._instance?._teardown();\n const items = this._items;\n if (items != null) for (let i = 0; i < items.length; i++) detachItem(items[i]);\n }\n\n _clear() {\n /**\n * One gate, two jobs. A template that holds an element ref must release it; a subtree holding a\n * applier that declared teardown must be told. Both are found by the same walk, and an app\n * with neither reads two booleans and walks nothing.\n */\n if (notifyOnRemoval) this._detach();\n const parent = this._start.parentNode!;\n const end = this._end;\n const items = this._items;\n /**\n * **Content that is no longer between the markers.** `@verajs/renderer/slots` distributes a\n * light host's children by MOVING them into the component's tree, so a part rendering those\n * children keeps its markers in the host while its content lives inside the component.\n *\n * Both branches below are wrong for that, and wrong in opposite directions. The walk finds\n * the markers adjacent and removes nothing — the content stays on screen after being cleared\n * (a template swap in a light host showed the OLD template forever). The whole-parent fast\n * path is the dangerous one: it would `textContent = ''` the HOST, component render and all.\n *\n * Every mode knows its content by IDENTITY, which is parent-agnostic and split-proof: items\n * through `$m`, TEXT through `_text`, NODE through `_value`, TEMPLATE through the top-level\n * node array recorded at commit. The one shape that cannot be found this way is a\n * DocumentFragment committed at NODE position (its children scatter and it keeps no record);\n * that falls through to the walk, as before.\n */\n if (this._start.nextSibling === end && this._mode !== EMPTY) {\n if (items !== null) {\n for (const item of items) if (item !== null) this.$m(item, null, SCRATCH);\n SCRATCH.textContent = '';\n } else if (this._mode === TEXT) {\n (this._text as ChildNode | null)?.remove();\n } else if (this._mode === TEMPLATE) {\n if (Array.isArray(this._value)) for (const node of this._value as ChildNode[]) node.remove();\n } else if (this._mode === NODE && typeof (this._value as ChildNode).remove === 'function') {\n (this._value as ChildNode).remove();\n }\n } else /**\n * When this part owns its parent's entire contents, one `textContent = ''` replaces removing\n * every node individually. For a 1 000-row table body that is the difference between ~22 ms\n * (lit-html's per-node teardown) and ~5 ms.\n *\n * A part owns the whole parent when nothing precedes its start AND nothing follows its end —\n * `_end === null` (a root part, which runs to the end by definition) or `_end` is the last\n * child. The second case is the common one and used to miss this path entirely: every list\n * written as `<tbody>${rows}</tbody>` sits inside a template, and since 0.1.2 a nested part\n * always owns an end marker, so `_end === null` alone never held for it.\n *\n * Re-appending both anchors in order restores the part's boundary exactly as it was.\n */\n if (this._start.previousSibling === null && (end === null || end.nextSibling === null)) {\n parent.textContent = '';\n parent.appendChild(this._start);\n if (end !== null) parent.appendChild(end);\n } else {\n let node = this._start.nextSibling;\n /**\n * `node !== null` is a backstop, not an expected exit. Reaching the end of the child list\n * without meeting `_end` means something detached this part's boundary; stopping leaves\n * nodes behind, which beats throwing out of the middle of a render pass.\n */\n while (node !== null && node !== this._end) {\n const next = node.nextSibling;\n parent.removeChild(node);\n node = next;\n }\n }\n this._mode = EMPTY;\n this._text = null;\n this._instance = null;\n this._items = null;\n this._shape = null;\n this._applierState = undefined;\n this._applier = undefined;\n }\n\n /**\n * How a child-position applier renders. Named to survive property mangling — `/^_[a-z]/` is the\n * pattern, and `_$…$` does not match it — because this is the half of the protocol that third\n * parties call.\n */\n _$commit$(value: unknown) {\n /**\n * The applier's own state survives its own rendering. Committing different content usually\n * runs `_clear`, which drops the state so a part that was emptied by *anything else* cannot\n * hand an applier continuity it no longer has — but an applier rendering its own next value\n * has not gone away, and losing continuity there made `until()` fall back to its placeholder on\n * the render after it resolved.\n */\n const applierState = this._applierState;\n const applier = this._applier;\n this._set(value);\n this._applierState = applierState;\n this._applier = applier;\n }\n\n _set(value: unknown) {\n if (value == null) {\n if (this._mode !== EMPTY) this._clear();\n return;\n }\n if (typeof value !== 'object') {\n if (this._mode === TEXT) {\n if (this._value !== value) {\n this._value = value;\n this._text!.data = value as string; // the DOM coerces numbers etc.\n }\n } else {\n if (this._mode !== EMPTY) this._clear();\n this._text = doc.createTextNode(value as string);\n this._insert(this._text);\n this._value = value;\n this._mode = TEXT;\n }\n return;\n }\n const heldResult = (value as { $h?: TemplateResult }).$h;\n if (heldResult !== undefined) {\n this._commitHeld(heldResult);\n return;\n }\n if (isTemplateResult(value)) {\n /**\n * Same-shape fast path on `strings` identity alone — no template-cache lookup. This is the\n * hottest line in a keyed list update: for every row whose shape did not change (all of\n * them, in practice), commit costs one identity compare before touching the values.\n */\n if (this._shape === value.strings) {\n if (__DEV__ && _profileHook) _profileHook(PROFILE_UPDATE, this, value.strings);\n this._instance!._update(value.values);\n return;\n }\n /**\n * Reaching here with a template already committed means the identity changed, so the\n * subtree below is about to be destroyed and rebuilt rather than updated. That is what\n * `?hidden=${…}` over a swapped subtree exists to avoid, and it is otherwise invisible.\n */\n if (__DEV__ && _profileHook) {\n _profileHook(this._mode === TEMPLATE ? PROFILE_REBUILD : PROFILE_CREATE, this, value.strings);\n }\n const template = getTemplate(value);\n if (this._mode !== EMPTY) this._clear();\n const instance = new Instance(template);\n instance._update(value.values);\n /**\n * The instance's top-level nodes, recorded while they are still in the fragment. `_value`\n * is unused in TEMPLATE mode, and this is what lets `_clear` and `hold`'s parking find the\n * content after `@verajs/renderer/slots` has moved it out of the marker range — per node,\n * parent-agnostic, so even content split across two slots comes back. Costs one small array\n * on a path that just built an Instance and cloned a template; same-shape updates never\n * reach here.\n */\n this._value = [...instance._fragment.childNodes];\n this._insert(instance._fragment);\n this._instance = instance;\n this._shape = value.strings;\n this._mode = TEMPLATE;\n return;\n }\n const handlers = valueHandlers();\n for (let i = 0; i < handlers.length; i++) if (handlers[i](this, value)) return;\n for (let i = 0; i < builtIns.length; i++) if (builtIns[i](this, value)) return;\n\n /**\n * **A child-position value that applies itself.** The same idea as `_$apply$` at element\n * position — which is how `@verajs/renderer/spread` ships as a separate package the renderer\n * knows nothing about — at the one other position worth extending.\n *\n * `_$child$(part, previous)` is handed the part and whatever it returned last time at this\n * part, and calls `part._$commit$(value)` to render content. Keeping continuity in the return\n * value rather than in an applier *instance* is what keeps this a protocol rather than a\n * framework: there is no base class, no factory and no lifecycle to learn, and an applier is\n * an object literal.\n *\n * Placed **after** the template check on purpose. A template is overwhelmingly the common\n * object at a child position, and it returns above without ever reading this property — so the\n * check costs the hot path nothing and only arrays, nodes and appliers pay for it. Measured:\n * +22 B gzipped, and no runtime difference distinguishable from noise.\n *\n * There is deliberately no teardown hook. `_clear` bulk-removes DOM and, when the part owns its\n * parent, does `parent.textContent = ''` — the thing that makes clearing a 1 000-row table ~5 ms\n * against lit-html's ~22 ms. Calling teardown on a nested applier would mean walking the part\n * tree on every removal, which is precisely the per-node work that fast path exists to skip. So\n * an applier here can render, and cannot yet be told it has gone away.\n */\n const applyChild = (value as { _$child$?: Applier })._$child$;\n if (applyChild !== undefined) {\n /** `previous` belongs to *this* applier; a different one at the same part starts fresh. */\n const previous = this._applier === applyChild ? this._applierState : undefined;\n /**\n * The un-hoisted applier, named. Writing `_$child$` as an object-literal method makes a new\n * function per render, so the part never recognises it and `previous` is `undefined` forever —\n * the applier silently restarts on every pass. It is the first rule in the README and it\n * fails without a symptom, so development counts the swaps: a genuine applier change at one\n * part happens once or twice, not on every render.\n *\n * The counter is a module-scope `WeakMap` rather than a field, so production carries neither\n * it nor a per-part slot to hold it — but only because it is marked `@__PURE__` at its\n * declaration. Without that it said the same thing and was untrue.\n */\n if (__DEV__ && this._applier !== undefined && this._applier !== applyChild) {\n const swaps = (_applierSwaps.get(this) ?? 0) + 1;\n _applierSwaps.set(this, swaps);\n if (swaps === 3) {\n console.warn(\n `[vera] a child applier changed identity ${swaps} times at one part, so \\`previous\\` ` +\n `is always undefined and it restarts every render.\\n` +\n `Hoist the applier — written as an object-literal method it is a new function per ` +\n `call:\\n\\n` +\n ` function applyThing(part, previous) { … } // once, at module scope\\n` +\n ` const thing = (x) => ({ _$child$: applyThing, x }); // state on the object\\n`\n );\n }\n }\n this._applier = applyChild;\n if (applyChild._$detach$ !== undefined) notifyOnRemoval = true;\n this._applierState = applyChild.call(value, this, previous);\n return;\n }\n if ((value as Node).nodeType !== undefined) {\n /**\n * A DOM node renders as itself — a canvas a charting library owns, a `<template>`'s content,\n * an element built by hand. Placed after the template check and before the list check\n * because `nodeType` is one property read and nothing else that reaches here has one.\n */\n if (this._mode !== NODE || this._value !== value) {\n if (this._mode !== EMPTY) this._clear();\n this._insert(value as Node);\n this._value = value;\n this._mode = NODE;\n }\n return;\n }\n // any other object: render as text\n this._set(String(value));\n }\n\n /** Commits a template while stashing whatever it replaces — see the `hold()` export. */\n _commitHeld(result: TemplateResult) {\n if (this._mode === TEMPLATE && this._shape === result.strings) {\n this._instance!._update(result.values);\n return;\n }\n const held = (this._held ??= new Map());\n if (this._mode === TEMPLATE) {\n /** Park the live nodes back in their instance's own (empty) fragment. When the range is\n * empty but content existed, slots relocated it — the recorded top-level nodes park it\n * from wherever it lives, split slots and holding included. */\n const fragment = this._instance!._fragment;\n if (this._start.nextSibling === this._end && Array.isArray(this._value)) {\n for (const node of this._value as Node[]) fragment.appendChild(node);\n } else {\n let node = this._start.nextSibling;\n while (node !== this._end) {\n const next = node!.nextSibling;\n fragment.appendChild(node!);\n node = next;\n }\n }\n held.set(this._shape!, this._instance!);\n } else if (this._mode !== EMPTY) {\n this._clear();\n }\n const instance = held.get(result.strings) ?? new Instance(getTemplate(result));\n instance._update(result.values);\n this._value = [...instance._fragment.childNodes];\n this._insert(instance._fragment);\n this._instance = instance;\n this._shape = result.strings;\n this._mode = TEMPLATE;\n }\n\n /**\n * Creates one list item. A single-root template instance becomes an element-mode item with no\n * markers at all; anything else gets its own start/end marker pair so moves can never dangle.\n */\n $c(value: unknown, parent: Node, ref: Node | null): Item {\n /** Rows reach the DOM here rather than through `_insert`; same one-read gate, same\n * structural value — a root list's rows are the render's own output, any other part's rows\n * are content it places into the host, stamped with the part as the ordering group. */\n const stamp =\n slotsWired && (parent as { _$hosted$?: boolean })._$hosted$ === true\n ? this._end === null\n ? true\n : this\n : null;\n if (value !== null && typeof value === 'object' && (value as TemplateResult).strings !== undefined) {\n const result = value as TemplateResult;\n const template = getTemplate(result);\n const instance = new Instance(template);\n instance._update(result.values);\n const rootNode = instance._fragment.firstChild;\n if (rootNode !== null && rootNode.nodeType === 1 && rootNode.nextSibling === null) {\n if (stamp !== null) stampOwn(rootNode, stamp);\n parent.insertBefore(rootNode, ref);\n return {\n $k: result.key,\n _element: rootNode as Element,\n _instance: instance,\n _shape: result.strings,\n _part: null,\n };\n }\n /** Multi-root template: markered part, content already instantiated. */\n const part = createMarkeredPart(parent, ref);\n part._instance = instance;\n part._shape = result.strings;\n part._mode = TEMPLATE;\n part._value = [...instance._fragment.childNodes];\n if (stamp !== null) stampOwn(instance._fragment, stamp);\n part._start.parentNode!.insertBefore(instance._fragment, part._end);\n return { $k: result.key, _element: null, _instance: null, _shape: null, _part: part };\n }\n const part = createMarkeredPart(parent, ref);\n part._set(value);\n return { $k: (value as TemplateResult)?.key, _element: null, _instance: null, _shape: null, _part: part };\n }\n\n /** Commits a new value into an existing item, demoting element mode if the shape changed. */\n $u(item: Item, value: unknown) {\n if (item._element !== null) {\n if (value !== null && typeof value === 'object' && (value as TemplateResult).strings === item._shape) {\n item._instance!._update((value as TemplateResult).values);\n return;\n }\n /** Shape changed: swap the bare element for a markered part in its place. */\n const part = createMarkeredPart(item._element.parentNode!, item._element);\n item._element.remove();\n item._element = null;\n item._instance = null;\n item._shape = null;\n (item._part = part)._set(value);\n return;\n }\n item._part!._set(value);\n }\n\n /** The item's first node — its move/removal handle and the insertion reference before it. */\n $f(item: Item): Node {\n return item._element ?? item._part!._start;\n }\n\n /**\n * Moving and removing an item read `_element` and `_part`, which are mangled — so they stay here\n * rather than travelling with the algorithm that calls them. `$m` and `$d` are the price: two\n * cold methods, exempt from mangling, two characters each.\n */\n $m(item: Item, ref: Node | null, parent: Node = this._start.parentNode!) {\n /**\n * **Already where it is going.** A reorder asks for many positions that are already correct,\n * and re-inserting a node that is in place is not free: it detaches and re-attaches, which\n * blurs focus, restarts a CSS transition and wakes every MutationObserver watching. The\n * relocated path below leans on this — it re-places every item rather than computing which\n * ones moved — but the ordinary two-ended diff gets the same saving.\n *\n * The item's LAST node is the one whose `nextSibling` decides this, and reading `_element` /\n * `_part._end` is why the check lives here rather than travelling with the algorithm.\n */\n const last = item._element ?? item._part!._end!;\n if (last.nextSibling === ref && last.parentNode === parent) return;\n if (item._element !== null) {\n parent.insertBefore(item._element, ref);\n return;\n }\n let node: Node | null = item._part!._start;\n const stop = item._part!._end!.nextSibling;\n while (node !== stop) {\n const next: Node | null = node!.nextSibling;\n parent.insertBefore(node!, ref);\n node = next;\n }\n }\n\n /** Removal is a move into a scratch fragment that is immediately emptied. */\n $d(item: Item) {\n if (notifyOnRemoval) detachItem(item);\n this.$m(item, null, SCRATCH);\n SCRATCH.textContent = '';\n }\n\n _commitList(newValues: unknown[]) {\n if (this._mode !== LIST) {\n if (this._mode !== EMPTY) this._clear();\n this._items = [];\n this._keyedList = false;\n this._mode = LIST;\n }\n const count = newValues.length;\n if (count === 0) {\n if (this._items!.length) {\n this._clear();\n this._items = [];\n this._mode = LIST;\n }\n return;\n }\n const isKeyed = newValues[0] != null && (newValues[0] as KeyedResult).$r !== undefined;\n if (isKeyed !== this._keyedList && this._items!.length) {\n this._clear();\n this._items = [];\n this._mode = LIST;\n }\n this._keyedList = isKeyed;\n const items = this._items!;\n const parent = this._start.parentNode!;\n\n if (items.length === 0) {\n /** Initial fill builds off-document and lands in one insert. */\n const fragment = doc.createDocumentFragment();\n for (let i = 0; i < count; i++) items.push(this.$c(newValues[i], fragment, null));\n this._insert(fragment);\n return;\n }\n\n if (!isKeyed) {\n // index mode: update in place, grow at the end, shrink from the end\n const shared = items.length < count ? items.length : count;\n for (let i = 0; i < shared; i++) this.$u(items[i], newValues[i]);\n if (count > items.length) {\n const fragment = doc.createDocumentFragment();\n for (let i = items.length; i < count; i++) items.push(this.$c(newValues[i], fragment, null));\n this._insert(fragment);\n } else if (count < items.length) {\n if (notifyOnRemoval) for (let i = count; i < items.length; i++) detachItem(items[i]);\n /**\n * **Removed through the items, not by walking the range.** The walk this replaced ran from\n * the first doomed item to the last one's end and called `parent.removeChild` on each node,\n * which assumes every one of them is still a child of `parent`. `@verajs/renderer/slots`\n * moves a light host's children into the component's tree, and the walk then threw\n * `NotFoundError` out of the middle of a render — a plain `<x-card>${rows}</x-card>` losing\n * one row was enough, with no keyed list anywhere in it.\n *\n * `$m` into the scratch fragment is indifferent to where a node currently lives, and the\n * batch is dropped by one clear at the end, so the contiguous-run saving the walk was for\n * is kept.\n */\n for (let i = count; i < items.length; i++) this.$m(items[i], null, SCRATCH);\n SCRATCH.textContent = '';\n items.length = count;\n }\n return;\n }\n\n /**\n * Keyed reconciliation is not here. It lives in `@verajs/renderer/keyed`, and it arrives on\n * the values themselves — `keyed()` stamps each result with the strategy that understands it,\n * so importing the marker is what loads the algorithm. Nothing registers, nothing is wired, and\n * two strategies cannot disagree about a list because the list names its own.\n *\n * The protocol is three cold members (`$c`, `$u`, `$f`) plus a returned array. Everything a\n * strategy would otherwise have to reach for — the mode switch, the empty case, the initial\n * fill — is already done above and passed in.\n */\n this._items = (newValues[0] as KeyedResult).$r!(this, newValues, items, parent, this._end);\n }\n}\n\nconst rootParts = new WeakMap<Node, ChildPart>();\n\n/**\n * Writes a template result into a container. The renderer's imperative draw: no reactivity, no\n * lifecycle, no knowledge of components. Slots into Vera via `wire([renderer])`; core's built-in\n * `html` tag already produces the accepted shape, so no `setHtml` call is required — though\n * lit-html's `html` also works, its results being structurally identical.\n *\n * **It owns its own range and nothing else.** The first call appends a marker and anchors a root\n * part there; later calls with the same container reuse that part and walk only the value slots, so\n * nodes are updated in place rather than rebuilt. Content that was already in the container stays.\n *\n * **Named for the relationship, not the act.** It was `render` until 0.2.0, which collided with\n * core's `render` — a different function, with a different arity, that declares a *reactive*\n * template and commits a component's setup. Both were public and both were documented, so a reader\n * who knew one misread the other. `renderElement` and `renderDom` were considered and rejected: this\n * renders *into* a container, and the container is a `Node` — a shadow root and a fragment are both\n * valid, so \"element\" would be a lie in the type. Argument order is lit-html's on purpose.\n *\n * HYDRATION lives in `@verajs/renderer/hydrate` — a drop-in superset entry whose `renderInto` adopts\n * existing server-rendered children on first render. SSR apps import from there instead of here;\n * this entry carries zero hydration code.\n */\nexport const renderInto = (result: unknown, container: Node) => {\n /**\n * The container is the argument people forget, and forgetting it failed with\n * `Cannot read properties of undefined (reading 'appendChild')` — a message about the internals of\n * a function the caller never named. Everything after this line assumes a node.\n */\n if (__DEV__ && (!container || typeof (container as Node).appendChild !== 'function'))\n throw new TypeError(\n `renderInto: expected a container node as the second argument and received ${String(container)}. ` +\n `It renders *into* something — \\`renderInto(html\\`…\\`, document.body)\\`.`\n );\n if (__DEV__ && _profileHook) _profileHook(PROFILE_FRAME_START, container, null);\n let part = rootParts.get(container);\n if (part === undefined) {\n /**\n * FIRST render into this container. If it is a light element host and a 'slot' insert is\n * wired, capture its children NOW — so slot content provided before its (possibly\n * conditional) `<slot>` mounts is held rather than left visible in the host, matching native\n * \"unassigned light children do not render\". Once per container lifetime; shadow roots\n * (nodeType 11) and fragments are excluded.\n */\n /**\n * **The marker goes in FIRST, and capture is handed it as the light region's boundary.**\n *\n * This part's start marker already delimits where the render's output begins, so the boundary\n * slots needs is a node the renderer was creating anyway — the sentinel it used to append for\n * itself landed immediately before this one, two adjacent comments doing the same job. Passing\n * it removes one comment from every light host and keeps the two in step by construction: they\n * cannot drift apart if they are the same node.\n *\n * Appending before capture is safe and necessary. Safe because a comment is never a slottable,\n * so the children walk steps over it; necessary because capture LIFTS the host's children, and\n * a marker appended afterwards would land in the same place either way — this way slots has it.\n */\n const marker = comment();\n container.appendChild(marker);\n if (container.nodeType === 1) slotSeam()?._$capture$?.(container as Element, marker);\n rootParts.set(container, (part = new ChildPart(marker, null)));\n }\n /**\n * **The flush is in a `finally`, and that is not tidiness.** A render that throws after a\n * `<select>.value` has been queued but before the flush left the queue holding the element — which\n * retains it in module state, and, worse, hands the stranded value to the *next* `renderInto` call.\n * An unrelated component's render then silently changed a select it has nothing to do with.\n * Measured: a failed update left the value to be applied by the following render.\n *\n * Flushing on the way out applies it with its own pass, where it belongs, and leaves nothing\n * behind either way. The error still propagates.\n */\n _slotRoot = container;\n try {\n part._set(result);\n } finally {\n _slotRoot = null;\n flushSelects();\n }\n if (__DEV__ && _profileHook) _profileHook(PROFILE_FRAME_END, container, null);\n};\n\n// ── INTERNAL SURFACE — imported by ./hydrate.ts, never re-exported by src/index.ts ─────────────\n// The public d.ts comes from src/index.ts, and the base bundles tree-shake all of this away, so\n// nothing here reaches consumers of the base entry. The hydrate entry compiles against this exact\n// source into its own self-contained bundle, so mangled property names always agree within it.\n\n/** @internal */\nexport {\n flushSelects,\n getTemplate,\n Template,\n Instance,\n TextPart,\n ChildPart,\n AttrPart,\n IGNORED_PART,\n IGNORED,\n TEMPLATE,\n LIST,\n NODE,\n comment,\n doc,\n toText,\n isTemplateResult,\n instanceWalker,\n rootParts,\n slotSeam,\n _setProfileHook,\n PROFILE_UPDATE,\n PROFILE_CREATE,\n PROFILE_REBUILD,\n PROFILE_FRAME_START,\n PROFILE_FRAME_END,\n};\n/** @internal */\nexport type { Part, Item, TemplatePart };\n\n\n/**\n * Lists, as a registered kind rather than a branch — the built-in going through the same door a\n * package will. Moving it to `@verajs/renderer/lists` is step 5; nothing else has to change when\n * it does, which is what this shape is for.\n */\nbuiltIns.push((part, value) => {\n if (Array.isArray(value)) {\n (part as ChildPart)._commitList(value);\n return true;\n }\n if (value !== null && typeof (value as Iterable<unknown>)[Symbol.iterator] === 'function') {\n (part as ChildPart)._commitList([...(value as Iterable<unknown>)]);\n return true;\n }\n return false;\n});\n\n/**\n * Everything this renderer needs, in one entry: `wire([renderer])`.\n *\n * It registers on the `'render'` chain *and* takes the registry, because a package that both\n * provides a capability and reads one should not cost an app two lines. This replaced\n * `setRenderer`, which existed only because there was no general way to say \"this app has a\n * renderer\" — and which resolved the shadow root at registration, so a renderer wired any other\n * way silently rendered into the light DOM. That resolution lives in core's dispatch now.\n */\n/**\n * A `__DEV__`-only hint for `wire`, so the module and the raw function beside it can share a package\n * without wiring the wrong one being silent.\n *\n * A bare function has no `on`, so `wire` reads it as a connector and hands it the registry. Nothing\n * registers, nothing throws, and the page renders nothing. The marker lets `wire` name the export\n * that was meant. This mattered most when the function was called `render` and the mistake was two\n * characters wide; `renderInto` is harder to confuse, and the guard costs nothing in production.\n *\n * `$module` is deliberately generic — any package exporting a raw function next to a module of a\n * similar name can set it. Production carries neither the property nor the check that reads it.\n */\nif (__DEV__) (renderInto as unknown as { $module?: string }).$module = 'renderer';\n\nexport const renderer = {\n name: '@verajs/renderer',\n on: 'render' as const,\n fn: renderInto as never,\n priority: 50,\n /**\n * Typed against the registry `wire` actually hands over, not a narrower shape that happens to\n * describe the one lookup this makes. A structural `{ get(name: 'value'): … }` is **not**\n * assignable from `Inserts`, so `wire([renderer])` failed to compile in a consumer's project while\n * this repo's own typecheck — which reads sources, not the shipped `.d.ts` — saw nothing.\n */\n connect: (given: { get(name: never): unknown }) => {\n registry = given as { get(name: 'value' | 'slot'): unknown[] | undefined };\n },\n};\n","/**\n * The profiler's in-page panel — live counts and the current churn list, in the corner of the app\n * you are already clicking through.\n *\n * Three constraints shaped this:\n *\n * 1. **It must not render itself with the renderer.** Doing so would fold the overlay's own\n * commits into the numbers it reports. Everything here is plain DOM, updated in place.\n * 2. **It must not restyle the app.** It lives in a closed shadow root and sets every property it\n * depends on, so neither direction leaks.\n * 3. **It must work with no toolchain**, like everything else here — no CSS file, no framework,\n * one import.\n */\nimport type { ProfileReport } from './profiler.js';\n\nexport interface OverlayOptions {\n /** Corner to pin to. Default `bottom-right`. */\n corner?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';\n /** How often to repaint, in milliseconds. Default 400. */\n interval?: number;\n /** Churn rows to show before collapsing the rest into a count. Default 4. */\n rows?: number;\n}\n\nconst CSS = `\n:host { all: initial; }\n.panel {\n position: fixed; z-index: 2147483647;\n font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n color: #e6edf3; background: #0d1117ee; border: 1px solid #30363d; border-radius: 6px;\n box-shadow: 0 8px 24px #0008; width: 340px; max-width: calc(100vw - 24px);\n backdrop-filter: blur(6px);\n}\n.bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: default; }\n.dot { width: 7px; height: 7px; border-radius: 50%; background: #3fb950; flex: none; }\n.dot.idle { background: #6e7681; }\n.title { font-weight: 600; letter-spacing: .02em; flex: 1; }\nbutton {\n font: inherit; color: #e6edf3; background: #21262d; border: 1px solid #30363d;\n border-radius: 4px; padding: 1px 7px; cursor: pointer;\n}\nbutton:hover { background: #30363d; }\n.body { padding: 0 8px 8px; }\n.stats { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; margin-bottom: 6px; }\n.stats b { font-weight: 600; }\n.warn { color: #f0883e; }\n.good { color: #3fb950; }\n.churn { border-top: 1px solid #30363d; padding-top: 6px; }\n.churn h4 { margin: 0 0 4px; font-size: 11px; font-weight: 600; color: #f0883e; }\n.row { margin-bottom: 5px; }\n.where { color: #8b949e; }\n.tpl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.from { color: #ff7b72; }\n.to { color: #7ee787; }\n.hint { color: #8b949e; border-top: 1px solid #30363d; padding-top: 5px; margin-top: 2px; }\n.empty { color: #8b949e; }\n.collapsed .body { display: none; }\n`;\n\nconst CORNERS: Record<string, string> = {\n 'top-left': 'top:12px;left:12px;',\n 'top-right': 'top:12px;right:12px;',\n 'bottom-left': 'bottom:12px;left:12px;',\n 'bottom-right': 'bottom:12px;right:12px;',\n};\n\n/**\n * Mounts the panel and returns a function that removes it. Requires a DOM, so it is a no-op\n * (returning a no-op) anywhere without one.\n */\nexport const mountOverlay = (\n read: () => ProfileReport,\n isActive: () => boolean,\n control: { start: () => void; stop: () => void },\n options: OverlayOptions = {}\n): (() => void) => {\n if (typeof document === 'undefined' || document.body === null) return () => {};\n\n const { corner = 'bottom-right', interval = 400, rows = 4 } = options;\n\n const host = document.createElement('div');\n /**\n * Open, not closed. Style isolation is the same either way; closed only blocks script access,\n * which for a development tool costs more than it buys — you want to inspect this in devtools,\n * and it is what makes the panel testable.\n */\n const root = host.attachShadow({ mode: 'open' });\n const style = document.createElement('style');\n style.textContent = CSS;\n\n const panel = document.createElement('div');\n panel.className = 'panel';\n panel.setAttribute('style', CORNERS[corner] ?? CORNERS['bottom-right']);\n panel.innerHTML =\n '<div class=\"bar\">' +\n '<span class=\"dot\"></span><span class=\"title\">renderer profiler</span>' +\n '<button data-act=\"toggle\">stop</button>' +\n '<button data-act=\"reset\">reset</button>' +\n '<button data-act=\"fold\">–</button>' +\n '</div>' +\n '<div class=\"body\"><div class=\"stats\"></div><div class=\"churn\"></div></div>';\n\n root.append(style, panel);\n document.body.appendChild(host);\n\n const dot = panel.querySelector('.dot') as HTMLElement;\n const stats = panel.querySelector('.stats') as HTMLElement;\n const churn = panel.querySelector('.churn') as HTMLElement;\n const toggle = panel.querySelector('[data-act=\"toggle\"]') as HTMLButtonElement;\n const fold = panel.querySelector('[data-act=\"fold\"]') as HTMLButtonElement;\n\n const escape = (text: string) =>\n text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n\n const paint = () => {\n const report = read();\n const running = isActive();\n dot.className = running ? 'dot' : 'dot idle';\n toggle.textContent = running ? 'stop' : 'start';\n\n const commits = report.updates + report.creates + report.rebuilds;\n const share = commits === 0 ? 0 : Math.round((report.rebuilds / commits) * 100);\n stats.innerHTML =\n `<span>frames</span><b>${report.frames}</b>` +\n `<span>time in render</span><b>${report.ms.toFixed(1)}ms</b>` +\n `<span>slowest frame</span><b>${report.slowestFrameMs.toFixed(1)}ms</b>` +\n `<span>updated in place</span><b class=\"good\">${report.updates}</b>` +\n `<span>created</span><b>${report.creates}</b>` +\n `<span>rebuilt</span><b class=\"${report.rebuilds > 0 ? 'warn' : ''}\">` +\n `${report.rebuilds}${commits > 0 ? ` (${share}%)` : ''}</b>`;\n\n if (report.churn.length === 0) {\n churn.innerHTML =\n commits === 0\n ? '<div class=\"empty\">No renders recorded yet.</div>'\n : '<div class=\"empty good\">No template churn — every commit updated in place.</div>';\n return;\n }\n const shown = report.churn.slice(0, rows);\n const hidden = report.churn.length - shown.length;\n churn.innerHTML =\n '<h4>Torn down, not updated</h4>' +\n shown\n .map(\n (entry) =>\n `<div class=\"row\"><div class=\"where\">${entry.count}× at ${escape(entry.where)}</div>` +\n `<div class=\"tpl from\">${escape(entry.from)}</div>` +\n `<div class=\"tpl to\">→ ${escape(entry.to)}</div></div>`\n )\n .join('') +\n (hidden > 0 ? `<div class=\"where\">+${hidden} more</div>` : '') +\n '<div class=\"hint\">Prefer one stable template with <b>?hidden=${…}</b> over swapping subtrees.</div>';\n };\n\n panel.addEventListener('click', (event) => {\n const act = (event.target as HTMLElement)?.dataset?.act;\n if (act === 'toggle') {\n if (isActive()) control.stop();\n else control.start();\n } else if (act === 'reset') control.start();\n else if (act === 'fold') {\n const folded = panel.classList.toggle('collapsed');\n fold.textContent = folded ? '+' : '–';\n }\n paint();\n });\n\n paint();\n const timer = setInterval(paint, interval);\n\n return () => {\n clearInterval(timer);\n host.remove();\n };\n};\n","/**\n * `@verajs/renderer/profiler` — a development-only render profiler.\n *\n * **What it is for.** The renderer commits a template by identity: if `strings` is the same array\n * as last time, values are written in place; if it is a different array, the subtree is destroyed\n * and rebuilt. Writing `${cond ? html`<a/>` : html`<b/>`}` swaps identity on every toggle, so what\n * looks like an update is a teardown — which is why the house guidance is a stable shape with\n * `?hidden=${…}`. Nothing surfaces that today. This does: it counts in-place updates against\n * rebuilds and names the template pairs that churn.\n *\n * **How to use it.** This entry re-exports the renderer's whole public API, so point your importmap\n * (or bundler alias) at it instead of `@verajs/renderer` and nothing else changes:\n *\n * ```js\n * import { renderInto, startProfiling, stopProfiling, formatReport } from '@verajs/renderer/profiler';\n * startProfiling();\n * // …drive the app…\n * console.log(formatReport(stopProfiling()));\n * ```\n *\n * **Development only, by construction.** The instrumentation in `renderer.ts` sits behind\n * `__DEV__`, which the build folds to `false` before terser runs — so a production renderer carries\n * no hook, no call sites and no cost, and this entry is not built for production at all. Profiling\n * minified, property-mangled output would not be meaningful anyway.\n *\n * Like `./hydrate.ts`, this bundle contains its own copy of the renderer. Import the app's renderer\n * *through* this entry; importing both side by side gives you two renderer modules with two\n * template caches, and the profiler would observe an instance nothing renders into.\n *\n * **A hydrating app therefore cannot be profiled**, and that is worth stating rather than leaving to\n * be inferred: `/hydrate` is a drop-in replacement for the same public API, so an app can have this\n * one or that one and not both. Measured — a hydrating app driven through three renders reports zero\n * frames while rendering correctly. `formatReport` says so when it observed nothing, because a zero\n * report is otherwise indistinguishable from an app with nothing to optimise.\n */\nimport {\n _setProfileHook,\n PROFILE_UPDATE,\n PROFILE_CREATE,\n PROFILE_REBUILD,\n PROFILE_FRAME_START,\n PROFILE_FRAME_END,\n} from './renderer.js';\nimport type { ChildPart } from './renderer.js';\nimport { mountOverlay } from './overlay.js';\nimport type { OverlayOptions } from './overlay.js';\n\nexport type { OverlayOptions } from './overlay.js';\n\nexport { renderInto, hold, renderer } from './renderer.js';\nexport type { TemplateResult } from './renderer.js';\n\n/** One template identity replacing another at the same position, and how often. */\nexport interface Churn {\n /** The template that was torn down, rendered readably. */\n from: string;\n /** The template that replaced it. */\n to: string;\n /** How many times this exact swap happened while profiling. */\n count: number;\n /** Where in the DOM it happened, e.g. `main#app > ul.list`. First occurrence only. */\n where: string;\n}\n\nexport interface ProfileReport {\n /** Completed top-level `render()` calls. Nested renders are folded into their outermost frame. */\n frames: number;\n /** Total milliseconds spent inside `render()`. */\n ms: number;\n /** The slowest single frame, in milliseconds. */\n slowestFrameMs: number;\n /** Templates committed in place — the good path. */\n updates: number;\n /** Templates rendered into a slot that held nothing. Unavoidable and not a problem. */\n creates: number;\n /** Templates that replaced a *different* template — a teardown, not an update. */\n rebuilds: number;\n /** Rebuilds grouped by template pair, worst first. */\n churn: Churn[];\n}\n\nlet active = false;\nlet frames = 0;\nlet updates = 0;\nlet creates = 0;\nlet rebuilds = 0;\nlet totalMs = 0;\nlet slowestMs = 0;\nlet depth = 0;\nlet frameStart = 0;\nlet churn = new Map<string, Churn>();\n\n/** Stable ids for template identities, so grouping a rebuild costs two lookups and a concat. */\nlet nextId = 1;\nconst ids = new WeakMap<TemplateStringsArray, number>();\nconst idOf = (strings: TemplateStringsArray) => {\n let id = ids.get(strings);\n if (id === undefined) ids.set(strings, (id = nextId++));\n return id;\n};\n\n/** Readable one-line form of a template, cached — a rebuild loop would otherwise rebuild it too. */\nconst described = new WeakMap<TemplateStringsArray, string>();\nconst describe = (strings: TemplateStringsArray) => {\n let text = described.get(strings);\n if (text === undefined) {\n text = strings.join('${…}').replace(/\\s+/g, ' ').trim();\n if (text.length > 72) text = text.slice(0, 71) + '…';\n described.set(strings, text);\n }\n return text;\n};\n\n/**\n * `parentElement` is null across a shadow boundary, which is exactly where components live — so\n * step to the host rather than reporting `(detached)` for every shadow root.\n */\nconst up = (node: Node): Element | null => {\n const parent = (node as Element).parentElement;\n if (parent !== null) return parent;\n const root = node.getRootNode();\n return root !== node && (root as ShadowRoot).host !== undefined ? (root as ShadowRoot).host : null;\n};\n\n/** Three levels of ancestry is enough to locate a slot without printing a whole path. */\nconst label = (node: Node | null): string => {\n const path: string[] = [];\n let el = node === null ? null : node.nodeType === 1 ? (node as Element) : up(node);\n for (let i = 0; i < 3 && el !== null; i++) {\n let part = el.localName;\n if (el.id) part += '#' + el.id;\n else {\n const cls = el.getAttribute('class');\n if (cls) part += '.' + cls.trim().split(/\\s+/)[0];\n }\n path.unshift(part);\n el = up(el);\n }\n return path.length === 0 ? '(detached)' : path.join(' > ');\n};\n\nconst hook = (kind: number, subject: unknown, shape: TemplateStringsArray | null) => {\n if (kind === PROFILE_UPDATE) {\n updates++;\n return;\n }\n if (kind === PROFILE_FRAME_START) {\n if (depth++ === 0) frameStart = performance.now();\n return;\n }\n if (kind === PROFILE_FRAME_END) {\n if (--depth === 0) {\n const elapsed = performance.now() - frameStart;\n totalMs += elapsed;\n if (elapsed > slowestMs) slowestMs = elapsed;\n frames++;\n }\n return;\n }\n if (kind === PROFILE_CREATE) {\n creates++;\n return;\n }\n if (kind !== PROFILE_REBUILD) return;\n\n rebuilds++;\n const part = subject as ChildPart;\n const from = part._shape;\n if (from === null || shape === null) return;\n const key = idOf(from) + '>' + idOf(shape);\n let record = churn.get(key);\n if (record === undefined) {\n churn.set(\n key,\n (record = { from: describe(from), to: describe(shape), count: 0, where: label(part._start) })\n );\n }\n record.count++;\n};\n\nconst reset = () => {\n frames = updates = creates = rebuilds = depth = 0;\n totalMs = slowestMs = frameStart = 0;\n churn = new Map();\n};\n\n/** Begin collecting. Calling this while already profiling restarts the collection. */\nexport const startProfiling = () => {\n reset();\n active = true;\n _setProfileHook(hook);\n};\n\n/** What has been measured so far, without ending the session. Drives the live overlay. */\nexport const getReport = (): ProfileReport => ({\n frames,\n ms: totalMs,\n slowestFrameMs: slowestMs,\n updates,\n creates,\n rebuilds,\n churn: [...churn.values()].sort((a, b) => b.count - a.count),\n});\n\n/** Stop collecting and return what was measured. Safe to call when not profiling. */\nexport const stopProfiling = (): ProfileReport => {\n _setProfileHook(null);\n active = false;\n return getReport();\n};\n\nexport const isProfiling = () => active;\n\n/** Profile one synchronous stretch of work. */\nexport function profile<T>(fn: () => Promise<T>): Promise<{ result: T; report: ProfileReport }>;\nexport function profile<T>(fn: () => T): { result: T; report: ProfileReport };\nexport function profile<T>(fn: () => T | Promise<T>) {\n startProfiling();\n let result: T | Promise<T>;\n try {\n result = fn();\n } catch (error) {\n stopProfiling();\n throw error;\n }\n /**\n * An **async** driver is awaited before the report is taken.\n *\n * Driving an application means awaiting frames — the render scheduler is `requestAnimationFrame`,\n * so nothing commits within one synchronous turn. Stopping immediately therefore reported zero\n * updates, zero rebuilds and no churn for a page doing plenty of all three: a plausible-looking\n * answer, and the reader's conclusion is \"nothing to fix here\".\n */\n if (result && typeof (result as Promise<T>).then === 'function')\n return (result as Promise<T>).then(\n (value) => ({ result: value, report: stopProfiling() }),\n (error) => {\n stopProfiling();\n throw error;\n }\n );\n return { result: result as T, report: stopProfiling() };\n}\n\n/** The panel currently mounted, so a second `showProfiler()` replaces it rather than stacking. */\nlet mounted: (() => void) | null = null;\n\n/**\n * Mounts a live panel in the corner of the page and starts profiling. Returns a function that\n * removes it and stops. Plain DOM in a closed shadow root — it never renders itself through the\n * renderer, which would fold its own commits into the numbers it reports.\n *\n * **Calling it twice replaces the panel; it does not stack a second one.** Two panels are positioned\n * in the same corner, so they overlap and neither is readable — and the failure went further than\n * cosmetic. Each panel owns a `setInterval`, and each teardown calls `stopProfiling()`, which is\n * global: closing the *second* panel stopped profiling for the *first*, which then repainted a\n * frozen report on its own timer with nothing to say it had stopped. Worse, the natural way to reach\n * this is a console — `showProfiler()`, look, `showProfiler()` again — where the first return value\n * is gone, so that first interval could never be stopped at all.\n *\n * Replacing rather than returning the existing teardown, so a second call with different `options`\n * takes effect instead of being silently ignored.\n */\nexport const showProfiler = (options?: OverlayOptions): (() => void) => {\n mounted?.();\n startProfiling();\n const unmount = mountOverlay(getReport, isProfiling, { start: startProfiling, stop: stopProfiling }, options);\n /**\n * A **stale** teardown — the handle from a panel that has since been replaced — is harmless: its\n * `unmount` removes a host already removed and clears a timer already cleared, and the\n * `stopProfiling()` it also does is visible in the live panel's own toggle rather than silent.\n *\n * There is deliberately no `mounted = null` here. A version of this line existed, commented as\n * stopping a late teardown from orphaning a newer panel; mutation testing showed **nothing** could\n * observe it, and a 50-cycle `WeakRef` probe measured identical retention with and without it. A\n * line whose comment claims a purpose it does not have is the defect this audit keeps finding, so\n * it is not shipped as a precaution.\n */\n return (mounted = () => {\n unmount();\n stopProfiling();\n });\n};\n\n/** Human-readable summary. The overlay renders the same data; this is for a console or a log. */\nexport const formatReport = (report: ProfileReport): string => {\n const committed = report.updates + report.creates + report.rebuilds;\n const share = committed === 0 ? 0 : Math.round((report.rebuilds / committed) * 100);\n /**\n * **Nothing observed is the one result that cannot be read.** It is what a healthy idle app looks\n * like, and it is also what profiling the *wrong renderer* looks like — and this entry, `/hydrate`\n * and `@verajs/renderer` each carry their own copy with their own hook, so an app that renders\n * through any of the others is invisible here no matter how busy it is. Measured: a hydrating app\n * driven through three renders reports `0 frames` while rendering perfectly.\n *\n * A zero report is therefore where the explanation belongs. It costs a production build nothing —\n * this entry is not built for production at all.\n */\n if (report.frames === 0)\n return (\n 'No renders observed.\\n' +\n 'If the app is rendering, it is rendering through a different copy of the renderer: this ' +\n 'entry, @verajs/renderer/hydrate and @verajs/renderer each bundle their own, with their own ' +\n 'hook.\\nImport the app\\'s renderer through this entry — and note that a hydrating app cannot ' +\n 'be profiled, because /hydrate is a drop-in replacement too and only one of them can be it.'\n );\n const lines = [\n `${report.frames} frame(s), ${report.ms.toFixed(1)}ms total, slowest ${report.slowestFrameMs.toFixed(1)}ms`,\n `${report.updates} updated in place, ${report.creates} created, ${report.rebuilds} rebuilt (${share}% of commits)`,\n ];\n if (report.churn.length > 0) {\n lines.push('', 'Template identity churn — these were torn down, not updated:');\n for (const entry of report.churn) {\n lines.push(` ${entry.count}x at ${entry.where}`, ` ${entry.from}`, ` -> ${entry.to}`);\n }\n lines.push('', 'Prefer one stable template with ?hidden=${…} over swapping subtrees.');\n }\n return lines.join('\\n');\n};\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;AAoBG;AAEH;;;;;;AAMG;AACH,MAAM,KAAK,GAAG,CAAC,KAAa,KAAK,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;AAEtE;AACA,IAAI,QAAiC;AAErC;;;AAGG;AACI,MAAM,uBAAuB,GAAG,CAAC,GAAW,EAAE,IAAY,EAAE,KAAc,KAAmB;AAClG,IAAA,MAAM,IAAI,GAAG,OAAO,KAAK;AACzB,IAAA,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,QAAQ;AAAE,QAAA,OAAO,IAAI;IAClG,IAAI,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAe,CAAC,KAAK,cAAc;AAAE,QAAA,OAAO,IAAI;AAE/E;;;;AAIG;IACH,MAAM,GAAG,GAAG,CAAA,EAAG,GAAG,IAAI,IAAI,CAA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