@b9g/crank 0.7.5 → 0.7.7

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.
package/dom.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"dom.cjs","sources":["../src/dom.ts"],"sourcesContent":["import {\n\tChildren,\n\tContext,\n\tElementValue,\n\tPortal,\n\tRenderer,\n\tRenderAdapter,\n} from \"./crank.js\";\nimport {camelToKebabCase, formatStyleValue} from \"./_css.js\";\n\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nconst MATHML_NAMESPACE = \"http://www.w3.org/1998/Math/MathML\";\n\nfunction getRootDocument(root: Node | undefined): Document {\n\tif (root && root.ownerDocument) {\n\t\treturn root.ownerDocument;\n\t}\n\n\tif (root && root.nodeType === Node.DOCUMENT_NODE) {\n\t\treturn root as unknown as Document;\n\t}\n\n\treturn document;\n}\n\nfunction isWritableProperty(element: Element, name: string): boolean {\n\t// walk up the object's prototype chain to find the owner\n\tlet propOwner = element;\n\tdo {\n\t\tif (Object.prototype.hasOwnProperty.call(propOwner, name)) {\n\t\t\tbreak;\n\t\t}\n\t} while ((propOwner = Object.getPrototypeOf(propOwner)));\n\n\tif (propOwner === null) {\n\t\treturn false;\n\t}\n\n\t// get the descriptor for the named property and check whether it implies\n\t// that the property is writable\n\tconst descriptor = Object.getOwnPropertyDescriptor(propOwner, name);\n\tif (\n\t\tdescriptor != null &&\n\t\t(descriptor.writable === true || descriptor.set !== undefined)\n\t) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction emitHydrationWarning(\n\tpropName: string,\n\tquietProps: Set<string> | undefined,\n\texpectedValue: any,\n\tactualValue: any,\n\telement: Element,\n\tdisplayName?: string,\n) {\n\tconst checkName = propName;\n\tconst showName = displayName || propName;\n\tif (!quietProps || !quietProps.has(checkName)) {\n\t\tif (expectedValue === null || expectedValue === false) {\n\t\t\tconsole.warn(\n\t\t\t\t`Expected \"${showName}\" to be missing but found ${String(actualValue)} while hydrating:`,\n\t\t\t\telement,\n\t\t\t);\n\t\t} else if (expectedValue === true || expectedValue === \"\") {\n\t\t\tconsole.warn(\n\t\t\t\t`Expected \"${showName}\" to be ${expectedValue === true ? \"present\" : '\"\"'} but found ${String(actualValue)} while hydrating:`,\n\t\t\t\telement,\n\t\t\t);\n\t\t} else {\n\t\t\t// Check if this is a URL mismatch that's actually just resolution\n\t\t\tconst win = element.ownerDocument.defaultView;\n\t\t\tif (win && win.location) {\n\t\t\t\tconst origin = win.location.origin;\n\t\t\t\tif (\n\t\t\t\t\tnew URL(expectedValue, origin).href ===\n\t\t\t\t\tnew URL(actualValue, origin).href\n\t\t\t\t) {\n\t\t\t\t\t// attrs which are URLs will often be resolved to their full\n\t\t\t\t\t// href in the DOM, so we squash these errors\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconsole.warn(\n\t\t\t\t`Expected \"${showName}\" to be \"${String(expectedValue)}\" but found ${String(actualValue)} while hydrating:`,\n\t\t\t\telement,\n\t\t\t);\n\t\t}\n\t}\n}\n\nexport const adapter: Partial<RenderAdapter<Node, string, Node>> = {\n\tscope({\n\t\tscope: xmlns,\n\t\ttag,\n\t\tprops,\n\t}: {\n\t\tscope: string | undefined;\n\t\ttag: string | symbol;\n\t\tprops: Record<string, any>;\n\t\troot: Node | undefined;\n\t}): string | undefined {\n\t\tswitch (tag) {\n\t\t\tcase Portal:\n\t\t\t\t// TODO: read the namespace from the portal root element\n\t\t\t\txmlns = undefined;\n\t\t\t\tbreak;\n\t\t\tcase \"svg\":\n\t\t\t\txmlns = SVG_NAMESPACE;\n\t\t\t\tbreak;\n\t\t\tcase \"math\":\n\t\t\t\txmlns = MATHML_NAMESPACE;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn props.xmlns || xmlns;\n\t},\n\n\tcreate({\n\t\ttag,\n\t\ttagName,\n\t\tscope: xmlns,\n\t\troot,\n\t}: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tscope: string | undefined;\n\t\troot: Node | undefined;\n\t}): Node {\n\t\tif (typeof tag !== \"string\") {\n\t\t\tthrow new Error(`Unknown tag: ${tagName}`);\n\t\t} else if (tag.toLowerCase() === \"svg\") {\n\t\t\txmlns = SVG_NAMESPACE;\n\t\t} else if (tag.toLowerCase() === \"math\") {\n\t\t\txmlns = MATHML_NAMESPACE;\n\t\t}\n\n\t\tconst doc = getRootDocument(root);\n\t\treturn xmlns ? doc.createElementNS(xmlns, tag) : doc.createElement(tag);\n\t},\n\n\tadopt({\n\t\ttag,\n\t\ttagName,\n\t\tnode,\n\t\troot,\n\t}: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tnode: Node | undefined;\n\t\troot: Node | undefined;\n\t}): Array<Node> | undefined {\n\t\tif (typeof tag !== \"string\" && tag !== Portal) {\n\t\t\tthrow new Error(`Unknown tag: ${tagName}`);\n\t\t}\n\n\t\tconst doc = getRootDocument(root);\n\t\tif (\n\t\t\tnode === doc.body ||\n\t\t\tnode === doc.head ||\n\t\t\tnode === doc.documentElement ||\n\t\t\tnode === doc\n\t\t) {\n\t\t\tconsole.warn(\n\t\t\t\t`Hydrating ${node.nodeName.toLowerCase()} is discouraged as it is destructive and may remove unknown nodes.`,\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tnode == null ||\n\t\t\t(typeof tag === \"string\" &&\n\t\t\t\t(node.nodeType !== Node.ELEMENT_NODE ||\n\t\t\t\t\ttag.toLowerCase() !== (node as Element).tagName.toLowerCase()))\n\t\t) {\n\t\t\tconsole.warn(`Expected <${tagName}> while hydrating but found: `, node);\n\t\t\treturn;\n\t\t}\n\n\t\treturn Array.from(node.childNodes);\n\t},\n\n\tpatch({\n\t\ttagName,\n\t\tnode,\n\t\tprops,\n\t\toldProps,\n\t\tscope: xmlns,\n\t\tcopyProps,\n\t\tquietProps,\n\t\tisHydrating,\n\t}: {\n\t\tnode: Node;\n\t\ttagName: string;\n\t\tprops: Record<string, any>;\n\t\toldProps: Record<string, any> | undefined;\n\t\tscope: string | undefined;\n\t\troot: Node | undefined;\n\t\tcopyProps: Set<string> | undefined;\n\t\tquietProps: Set<string> | undefined;\n\t\tisHydrating: boolean;\n\t}): void {\n\t\tif (node.nodeType !== Node.ELEMENT_NODE) {\n\t\t\tthrow new TypeError(`Cannot patch node: ${String(node)}`);\n\t\t} else if (props.class && props.className) {\n\t\t\tconsole.error(\n\t\t\t\t`Both \"class\" and \"className\" set in props for <${tagName}>. Use one or the other.`,\n\t\t\t);\n\t\t}\n\n\t\tconst element = node as Element;\n\t\tconst isSVG = xmlns === SVG_NAMESPACE;\n\t\tconst isMathML = xmlns === MATHML_NAMESPACE;\n\t\tfor (let name in {...oldProps, ...props}) {\n\t\t\tlet value = props[name];\n\t\t\tconst oldValue = oldProps ? oldProps[name] : undefined;\n\t\t\t{\n\t\t\t\tif (copyProps != null && copyProps.has(name)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// handle prop:name or attr:name properties\n\t\t\t\tconst colonIndex = name.indexOf(\":\");\n\t\t\t\tif (colonIndex !== -1) {\n\t\t\t\t\tconst [ns, name1] = [\n\t\t\t\t\t\tname.slice(0, colonIndex),\n\t\t\t\t\t\tname.slice(colonIndex + 1),\n\t\t\t\t\t];\n\t\t\t\t\tswitch (ns) {\n\t\t\t\t\t\tcase \"prop\":\n\t\t\t\t\t\t\t(node as any)[name1] = value;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tcase \"attr\":\n\t\t\t\t\t\t\tif (value == null || value === false) {\n\t\t\t\t\t\t\t\tif (isHydrating && element.hasAttribute(name1)) {\n\t\t\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t\telement.getAttribute(name1),\n\t\t\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telement.removeAttribute(name1);\n\t\t\t\t\t\t\t} else if (value === true) {\n\t\t\t\t\t\t\t\tif (isHydrating && !element.hasAttribute(name1)) {\n\t\t\t\t\t\t\t\t\temitHydrationWarning(name, quietProps, value, null, element);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telement.setAttribute(name1, \"\");\n\t\t\t\t\t\t\t} else if (typeof value !== \"string\") {\n\t\t\t\t\t\t\t\tvalue = String(value);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (isHydrating && element.getAttribute(name1) !== value) {\n\t\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\telement.getAttribute(name1),\n\t\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telement.setAttribute(name1, String(value));\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch (name) {\n\t\t\t\t// TODO: fix hydration warnings for the style prop\n\t\t\t\tcase \"style\": {\n\t\t\t\t\tconst style = (element as HTMLElement | SVGElement).style;\n\t\t\t\t\tif (value == null || value === false) {\n\t\t\t\t\t\tif (isHydrating && style.cssText !== \"\") {\n\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\tstyle.cssText,\n\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telement.removeAttribute(\"style\");\n\t\t\t\t\t} else if (value === true) {\n\t\t\t\t\t\tif (isHydrating && style.cssText !== \"\") {\n\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\t\"\",\n\t\t\t\t\t\t\t\tstyle.cssText,\n\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telement.setAttribute(\"style\", \"\");\n\t\t\t\t\t} else if (typeof value === \"string\") {\n\t\t\t\t\t\tif (style.cssText !== value) {\n\t\t\t\t\t\t\t// TODO: Fix hydration warnings for styles\n\t\t\t\t\t\t\t//if (isHydrating) {\n\t\t\t\t\t\t\t//\temitHydrationWarning(\n\t\t\t\t\t\t\t//\t\tname,\n\t\t\t\t\t\t\t//\t\tquietProps,\n\t\t\t\t\t\t\t//\t\tvalue,\n\t\t\t\t\t\t\t//\t\tstyle.cssText,\n\t\t\t\t\t\t\t//\t\telement,\n\t\t\t\t\t\t\t//\t);\n\t\t\t\t\t\t\t//}\n\n\t\t\t\t\t\t\tstyle.cssText = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (typeof oldValue === \"string\") {\n\t\t\t\t\t\t\t// if the old value was a string, we need to clear the style\n\t\t\t\t\t\t\t// TODO: only clear the styles enumerated in the old value\n\t\t\t\t\t\t\tstyle.cssText = \"\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const styleName in {...oldValue, ...value}) {\n\t\t\t\t\t\t\tconst cssName = camelToKebabCase(styleName);\n\t\t\t\t\t\t\tconst styleValue = value && (value as any)[styleName];\n\t\t\t\t\t\t\tif (styleValue == null) {\n\t\t\t\t\t\t\t\tif (isHydrating && style.getPropertyValue(cssName) !== \"\") {\n\t\t\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\t\tstyle.getPropertyValue(cssName),\n\t\t\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t\t\t\t`style.${styleName}`,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tstyle.removeProperty(cssName);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst formattedValue = formatStyleValue(cssName, styleValue);\n\t\t\t\t\t\t\t\tif (style.getPropertyValue(cssName) !== formattedValue) {\n\t\t\t\t\t\t\t\t\t// TODO: hydration warnings for style props\n\t\t\t\t\t\t\t\t\t//if (isHydrating) {\n\t\t\t\t\t\t\t\t\t//\temitHydrationWarning(\n\t\t\t\t\t\t\t\t\t//\t\tname,\n\t\t\t\t\t\t\t\t\t//\t\tquietProps,\n\t\t\t\t\t\t\t\t\t//\t\tformattedValue,\n\t\t\t\t\t\t\t\t\t//\t\tstyle.getPropertyValue(cssName),\n\t\t\t\t\t\t\t\t\t//\t\telement,\n\t\t\t\t\t\t\t\t\t//\t\t`style.${styleName}`,\n\t\t\t\t\t\t\t\t\t//\t);\n\t\t\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\t\t\tstyle.setProperty(cssName, formattedValue);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"class\":\n\t\t\t\tcase \"className\":\n\t\t\t\t\tif (value === true) {\n\t\t\t\t\t\tif (isHydrating && element.getAttribute(\"class\") !== \"\") {\n\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\t\"\",\n\t\t\t\t\t\t\t\telement.getAttribute(\"class\"),\n\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telement.setAttribute(\"class\", \"\");\n\t\t\t\t\t} else if (value == null) {\n\t\t\t\t\t\tif (isHydrating && element.hasAttribute(\"class\")) {\n\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\telement.getAttribute(\"class\"),\n\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telement.removeAttribute(\"class\");\n\t\t\t\t\t} else if (typeof value === \"object\") {\n\t\t\t\t\t\t// class={{\"included-class\": true, \"excluded-class\": false}} syntax\n\t\t\t\t\t\tif (typeof oldValue === \"string\") {\n\t\t\t\t\t\t\t// if the old value was a string, we need to clear all classes\n\t\t\t\t\t\t\telement.setAttribute(\"class\", \"\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet shouldIssueWarning = false;\n\t\t\t\t\t\tconst hydratingClasses = isHydrating\n\t\t\t\t\t\t\t? new Set(Array.from(element.classList))\n\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\tconst hydratingClassName = isHydrating\n\t\t\t\t\t\t\t? element.getAttribute(\"class\")\n\t\t\t\t\t\t\t: undefined;\n\n\t\t\t\t\t\tconst allClassNames = {...oldValue, ...value};\n\t\t\t\t\t\t// Two passes: removes first, then adds. This ensures that\n\t\t\t\t\t\t// overlapping classes in different keys are handled correctly.\n\t\t\t\t\t\t// e.g. {\"a b\": false, \"b c\": true} should result in \"b c\"\n\t\t\t\t\t\tfor (const classNames in allClassNames) {\n\t\t\t\t\t\t\tif (!(value && value[classNames])) {\n\t\t\t\t\t\t\t\tconst classes = classNames.split(/\\s+/).filter(Boolean);\n\t\t\t\t\t\t\t\telement.classList.remove(...classes);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const classNames in allClassNames) {\n\t\t\t\t\t\t\tif (value && value[classNames]) {\n\t\t\t\t\t\t\t\tconst classes = classNames.split(/\\s+/).filter(Boolean);\n\t\t\t\t\t\t\t\telement.classList.add(...classes);\n\t\t\t\t\t\t\t\tfor (const className of classes) {\n\t\t\t\t\t\t\t\t\tif (hydratingClasses && hydratingClasses.has(className)) {\n\t\t\t\t\t\t\t\t\t\thydratingClasses.delete(className);\n\t\t\t\t\t\t\t\t\t} else if (isHydrating) {\n\t\t\t\t\t\t\t\t\t\tshouldIssueWarning = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tshouldIssueWarning ||\n\t\t\t\t\t\t\t(hydratingClasses && hydratingClasses.size > 0)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\tObject.keys(value)\n\t\t\t\t\t\t\t\t\t.filter((k) => value[k])\n\t\t\t\t\t\t\t\t\t.join(\" \"),\n\t\t\t\t\t\t\t\thydratingClassName || \"\",\n\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (!isSVG && !isMathML) {\n\t\t\t\t\t\tif (element.className !== value) {\n\t\t\t\t\t\t\tif (isHydrating) {\n\t\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\telement.className,\n\t\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telement.className = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (element.getAttribute(\"class\") !== value) {\n\t\t\t\t\t\tif (isHydrating) {\n\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\telement.getAttribute(\"class\"),\n\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telement.setAttribute(\"class\", value as string);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"innerHTML\":\n\t\t\t\t\tif (value !== oldValue) {\n\t\t\t\t\t\tif (isHydrating) {\n\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\telement.innerHTML,\n\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telement.innerHTML = value as any;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: {\n\t\t\t\t\tif (\n\t\t\t\t\t\tname[0] === \"o\" &&\n\t\t\t\t\t\tname[1] === \"n\" &&\n\t\t\t\t\t\tname[2] === name[2].toUpperCase() &&\n\t\t\t\t\t\ttypeof value === \"function\"\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Support React-style event names (onClick, onChange, etc.)\n\t\t\t\t\t\tname = name.toLowerCase();\n\t\t\t\t\t}\n\n\t\t\t\t\t// try to set the property directly\n\t\t\t\t\tif (\n\t\t\t\t\t\tname in element &&\n\t\t\t\t\t\t// boolean properties will coerce strings, but sometimes they map to\n\t\t\t\t\t\t// enumerated attributes, where truthy strings (\"false\", \"no\") map to\n\t\t\t\t\t\t// falsy properties, so we force using setAttribute.\n\t\t\t\t\t\t!(\n\t\t\t\t\t\t\ttypeof value === \"string\" &&\n\t\t\t\t\t\t\ttypeof (element as any)[name] === \"boolean\"\n\t\t\t\t\t\t) &&\n\t\t\t\t\t\tisWritableProperty(element, name)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// For URL properties like src and href, the DOM property returns the\n\t\t\t\t\t\t// resolved absolute URL. We need to resolve the prop value the same way\n\t\t\t\t\t\t// to compare correctly.\n\t\t\t\t\t\tlet domValue = (element as any)[name];\n\t\t\t\t\t\tlet propValue = value;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(name === \"src\" || name === \"href\") &&\n\t\t\t\t\t\t\ttypeof value === \"string\" &&\n\t\t\t\t\t\t\ttypeof domValue === \"string\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tpropValue = new URL(value, element.baseURI).href;\n\t\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t\t// Invalid URL, use original value for comparison\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (propValue !== domValue || oldValue === undefined) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tisHydrating &&\n\t\t\t\t\t\t\t\ttypeof (element as any)[name] === \"string\" &&\n\t\t\t\t\t\t\t\t(element as any)[name] !== value\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t(element as any)[name],\n\t\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// if the property is writable, assign it directly\n\t\t\t\t\t\t\t(element as any)[name] = value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (value === true) {\n\t\t\t\t\t\tvalue = \"\";\n\t\t\t\t\t} else if (value == null || value === false) {\n\t\t\t\t\t\tif (isHydrating && element.hasAttribute(name)) {\n\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\telement.getAttribute(name),\n\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telement.removeAttribute(name);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if (typeof value !== \"string\") {\n\t\t\t\t\t\tvalue = String(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (element.getAttribute(name) !== value) {\n\t\t\t\t\t\tif (isHydrating) {\n\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\telement.getAttribute(name),\n\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telement.setAttribute(name, value as any);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tarrange({\n\t\ttag,\n\t\tnode,\n\t\tprops,\n\t\tchildren,\n\t}: {\n\t\ttag: string | symbol;\n\t\tnode: Node;\n\t\tprops: Record<string, any>;\n\t\tchildren: Array<Node>;\n\t\troot: Node | undefined;\n\t}): void {\n\t\tif (tag === Portal && (node == null || typeof node.nodeType !== \"number\")) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`<Portal> root is not a node. Received: ${String(node)}`,\n\t\t\t);\n\t\t}\n\n\t\tif (!(\"innerHTML\" in props)) {\n\t\t\tlet oldChild = node.firstChild;\n\t\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\t\tconst newChild = children[i];\n\t\t\t\tif (oldChild === newChild) {\n\t\t\t\t\t// the child is already in the right place, so we can skip it\n\t\t\t\t\toldChild = oldChild.nextSibling;\n\t\t\t\t} else {\n\t\t\t\t\tnode.insertBefore(newChild, oldChild);\n\t\t\t\t\tif (\n\t\t\t\t\t\ttag !== Portal &&\n\t\t\t\t\t\toldChild &&\n\t\t\t\t\t\ti + 1 < children.length &&\n\t\t\t\t\t\toldChild !== children[i + 1]\n\t\t\t\t\t) {\n\t\t\t\t\t\toldChild = oldChild.nextSibling;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremove({\n\t\tnode,\n\t\tparentNode,\n\t\tisNested,\n\t}: {\n\t\tnode: Node;\n\t\tparentNode: Node;\n\t\tisNested: boolean;\n\t\troot: Node | undefined;\n\t}): void {\n\t\tif (!isNested && node.parentNode === parentNode) {\n\t\t\tparentNode.removeChild(node);\n\t\t}\n\t},\n\n\ttext({\n\t\tvalue,\n\t\toldNode,\n\t\thydrationNodes,\n\t\troot,\n\t}: {\n\t\tvalue: string;\n\t\thydrationNodes: Array<Node> | undefined;\n\t\toldNode: Node | undefined;\n\t\troot: Node | undefined;\n\t}): Node {\n\t\tconst doc = getRootDocument(root);\n\t\tif (hydrationNodes != null) {\n\t\t\tlet node = hydrationNodes.shift();\n\t\t\tif (!node || node.nodeType !== Node.TEXT_NODE) {\n\t\t\t\tconsole.warn(`Expected \"${value}\" while hydrating but found:`, node);\n\t\t\t} else {\n\t\t\t\t// value is a text node, check if it matches the expected text\n\t\t\t\tconst textData = (node as Text).data;\n\t\t\t\tif (textData.length > value.length) {\n\t\t\t\t\tif (textData.startsWith(value)) {\n\t\t\t\t\t\t// the text node is longer than the expected text, so we\n\t\t\t\t\t\t// reuse the existing text node, but truncate it and unshift the rest\n\t\t\t\t\t\t(node as Text).data = value;\n\t\t\t\t\t\thydrationNodes.unshift(\n\t\t\t\t\t\t\tdoc.createTextNode(textData.slice(value.length)),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\treturn node;\n\t\t\t\t\t}\n\t\t\t\t} else if (textData === value) {\n\t\t\t\t\treturn node;\n\t\t\t\t}\n\n\t\t\t\t// We log textData and not node because node will be mutated\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`Expected \"${value}\" while hydrating but found:`,\n\t\t\t\t\ttextData,\n\t\t\t\t);\n\t\t\t\toldNode = node;\n\t\t\t}\n\t\t}\n\n\t\tif (oldNode != null) {\n\t\t\tif ((oldNode as Text).data !== value) {\n\t\t\t\t(oldNode as Text).data = value;\n\t\t\t}\n\n\t\t\treturn oldNode;\n\t\t}\n\n\t\treturn doc.createTextNode(value);\n\t},\n\n\traw({\n\t\tvalue,\n\t\tscope: xmlns,\n\t\thydrationNodes,\n\t\troot,\n\t}: {\n\t\tvalue: string | Node;\n\t\tscope: string | undefined;\n\t\thydrationNodes: Array<Node> | undefined;\n\t\troot: Node | undefined;\n\t}): ElementValue<Node> {\n\t\tlet nodes: Array<Node>;\n\t\tif (typeof value === \"string\") {\n\t\t\tconst doc = getRootDocument(root);\n\t\t\tconst el =\n\t\t\t\txmlns == null\n\t\t\t\t\t? doc.createElement(\"div\")\n\t\t\t\t\t: xmlns === SVG_NAMESPACE\n\t\t\t\t\t\t? doc.createElementNS(xmlns, \"svg\")\n\t\t\t\t\t\t: doc.createElementNS(xmlns, \"math\");\n\t\t\tel.innerHTML = value;\n\t\t\tnodes = Array.from(el.childNodes);\n\t\t} else {\n\t\t\tnodes = value == null ? [] : Array.isArray(value) ? [...value] : [value];\n\t\t}\n\n\t\tif (hydrationNodes != null) {\n\t\t\tfor (let i = 0; i < nodes.length; i++) {\n\t\t\t\tconst node = nodes[i];\n\t\t\t\t// check if node is equal to the next node in the hydration array\n\t\t\t\tconst hydrationNode = hydrationNodes.shift();\n\t\t\t\tif (\n\t\t\t\t\thydrationNode &&\n\t\t\t\t\ttypeof hydrationNode === \"object\" &&\n\t\t\t\t\ttypeof hydrationNode.nodeType === \"number\" &&\n\t\t\t\t\tnode.isEqualNode(hydrationNode as Node)\n\t\t\t\t) {\n\t\t\t\t\tnodes[i] = hydrationNode as Node;\n\t\t\t\t} else {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`Expected <Raw value=\"${String(value)}\"> while hydrating but found:`,\n\t\t\t\t\t\thydrationNode,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nodes.length === 0\n\t\t\t? undefined\n\t\t\t: nodes.length === 1\n\t\t\t\t? nodes[0]\n\t\t\t\t: nodes;\n\t},\n};\n\nexport class DOMRenderer extends Renderer<Node, string, Element> {\n\tconstructor() {\n\t\tsuper(adapter);\n\t}\n\n\trender(\n\t\tchildren: Children,\n\t\troot: Element,\n\t\tctx?: Context,\n\t): Promise<ElementValue<Node>> | ElementValue<Node> {\n\t\tvalidateRoot(root);\n\t\treturn super.render(children, root, ctx);\n\t}\n\n\thydrate(\n\t\tchildren: Children,\n\t\troot: Element,\n\t\tctx?: Context,\n\t): Promise<ElementValue<Node>> | ElementValue<Node> {\n\t\tvalidateRoot(root);\n\t\treturn super.hydrate(children, root, ctx);\n\t}\n}\n\nfunction validateRoot(root: unknown): asserts root is Element {\n\tif (\n\t\troot == null ||\n\t\t(typeof root === \"object\" && typeof (root as any).nodeType !== \"number\")\n\t) {\n\t\tthrow new TypeError(`Render root is not a node. Received: ${String(root)}`);\n\t} else if ((root as Node).nodeType !== Node.ELEMENT_NODE) {\n\t\tthrow new TypeError(\n\t\t\t`Render root must be an element node. Received: ${String(root)}`,\n\t\t);\n\t}\n}\n\nexport const renderer = new DOMRenderer();\n\ndeclare global {\n\tmodule Crank {\n\t\tinterface EventMap extends GlobalEventHandlersEventMap {}\n\t}\n}\n"],"names":["Portal","camelToKebabCase","formatStyleValue","Renderer"],"mappings":";;;;;AAUA,MAAM,aAAa,GAAG,4BAA4B;AAClD,MAAM,gBAAgB,GAAG,oCAAoC;AAE7D,SAAS,eAAe,CAAC,IAAsB,EAAA;AAC9C,IAAA,IAAI,IAAI,IAAI,IAAI,CAAC,aAAa,EAAE;QAC/B,OAAO,IAAI,CAAC,aAAa;IAC1B;IAEA,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,aAAa,EAAE;AACjD,QAAA,OAAO,IAA2B;IACnC;AAEA,IAAA,OAAO,QAAQ;AAChB;AAEA,SAAS,kBAAkB,CAAC,OAAgB,EAAE,IA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OAAO,IAAI,KAAK,QAAQ,IAAI,OAAQ,IAAY,CAAC,QAAQ,KAAK,QAAQ,CAAC,EACvE;QACD,MAAM,IAAI,SAAS,CAAC,CAAA,qCAAA,EAAwC,MAAM,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC;IAC5E;SAAO,IAAK,IAAa,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY,EAAE;QACzD,MAAM,IAAI,SAAS,CAClB,CAAA,+CAAA,EAAkD,MAAM,CAAC,IAAI,CAAC,CAAA,CAAE,CAChE;IACF;AACD;AAEO,MAAM,QAAQ,GAAG,IAAI,WAAW;;;;;;"}
1
+ {"version":3,"file":"dom.cjs","sources":["../src/dom.ts"],"sourcesContent":["import {\n\tChildren,\n\tContext,\n\tElementValue,\n\tPortal,\n\tRenderer,\n\tRenderAdapter,\n} from \"./crank.js\";\nimport {camelToKebabCase, formatStyleValue} from \"./_css.js\";\nimport {REACT_SVG_PROPS} from \"./_svg.js\";\n\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nconst MATHML_NAMESPACE = \"http://www.w3.org/1998/Math/MathML\";\n\nfunction getRootDocument(root: Node | undefined): Document {\n\tif (root && root.ownerDocument) {\n\t\treturn root.ownerDocument;\n\t}\n\n\tif (root && root.nodeType === Node.DOCUMENT_NODE) {\n\t\treturn root as unknown as Document;\n\t}\n\n\treturn document;\n}\n\nfunction isWritableProperty(element: Element, name: string): boolean {\n\t// walk up the object's prototype chain to find the owner\n\tlet propOwner = element;\n\tdo {\n\t\tif (Object.prototype.hasOwnProperty.call(propOwner, name)) {\n\t\t\tbreak;\n\t\t}\n\t} while ((propOwner = Object.getPrototypeOf(propOwner)));\n\n\tif (propOwner === null) {\n\t\treturn false;\n\t}\n\n\t// get the descriptor for the named property and check whether it implies\n\t// that the property is writable\n\tconst descriptor = Object.getOwnPropertyDescriptor(propOwner, name);\n\tif (\n\t\tdescriptor != null &&\n\t\t(descriptor.writable === true || descriptor.set !== undefined)\n\t) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction emitHydrationWarning(\n\tpropName: string,\n\tquietProps: Set<string> | undefined,\n\texpectedValue: any,\n\tactualValue: any,\n\telement: Element,\n\tdisplayName?: string,\n) {\n\tconst checkName = propName;\n\tconst showName = displayName || propName;\n\tif (!quietProps || !quietProps.has(checkName)) {\n\t\tif (expectedValue === null || expectedValue === false) {\n\t\t\tconsole.warn(\n\t\t\t\t`Expected \"${showName}\" to be missing but found ${String(actualValue)} while hydrating:`,\n\t\t\t\telement,\n\t\t\t);\n\t\t} else if (expectedValue === true || expectedValue === \"\") {\n\t\t\tconsole.warn(\n\t\t\t\t`Expected \"${showName}\" to be ${expectedValue === true ? \"present\" : '\"\"'} but found ${String(actualValue)} while hydrating:`,\n\t\t\t\telement,\n\t\t\t);\n\t\t} else {\n\t\t\t// Check if this is a URL mismatch that's actually just resolution\n\t\t\tconst win = element.ownerDocument.defaultView;\n\t\t\tif (win && win.location) {\n\t\t\t\tconst origin = win.location.origin;\n\t\t\t\tif (\n\t\t\t\t\tnew URL(expectedValue, origin).href ===\n\t\t\t\t\tnew URL(actualValue, origin).href\n\t\t\t\t) {\n\t\t\t\t\t// attrs which are URLs will often be resolved to their full\n\t\t\t\t\t// href in the DOM, so we squash these errors\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconsole.warn(\n\t\t\t\t`Expected \"${showName}\" to be \"${String(expectedValue)}\" but found ${String(actualValue)} while hydrating:`,\n\t\t\t\telement,\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction patchProp(\n\telement: Element,\n\tname: string,\n\tvalue: any,\n\toldValue: any,\n\tprops: Record<string, any>,\n\tisSVG: boolean,\n\tisMathML: boolean,\n\tcopyProps: Set<string> | undefined,\n\tquietProps: Set<string> | undefined,\n\tisHydrating: boolean,\n): void {\n\tif (copyProps != null && copyProps.has(name)) {\n\t\treturn;\n\t}\n\t// handle prop:name or attr:name properties\n\tconst colonIndex = name.indexOf(\":\");\n\tif (colonIndex !== -1) {\n\t\tconst [ns, name1] = [name.slice(0, colonIndex), name.slice(colonIndex + 1)];\n\t\tswitch (ns) {\n\t\t\tcase \"prop\":\n\t\t\t\t(element as any)[name1] = value;\n\t\t\t\treturn;\n\t\t\tcase \"attr\":\n\t\t\t\tif (value == null || value === false) {\n\t\t\t\t\tif (isHydrating && element.hasAttribute(name1)) {\n\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\telement.getAttribute(name1),\n\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telement.removeAttribute(name1);\n\t\t\t\t\treturn;\n\t\t\t\t} else if (value === true) {\n\t\t\t\t\tif (isHydrating && !element.hasAttribute(name1)) {\n\t\t\t\t\t\temitHydrationWarning(name, quietProps, value, null, element);\n\t\t\t\t\t}\n\t\t\t\t\telement.setAttribute(name1, \"\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (typeof value !== \"string\") {\n\t\t\t\t\tvalue = String(value);\n\t\t\t\t}\n\n\t\t\t\tif (isHydrating && element.getAttribute(name1) !== value) {\n\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\telement.getAttribute(name1),\n\t\t\t\t\t\telement,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\telement.setAttribute(name1, value);\n\t\t\t\treturn;\n\t\t}\n\t}\n\n\tswitch (name) {\n\t\t// TODO: fix hydration warnings for the style prop\n\t\tcase \"style\": {\n\t\t\tconst style = (element as HTMLElement | SVGElement).style;\n\t\t\tif (value == null || value === false) {\n\t\t\t\tif (isHydrating && style.cssText !== \"\") {\n\t\t\t\t\temitHydrationWarning(name, quietProps, value, style.cssText, element);\n\t\t\t\t}\n\t\t\t\telement.removeAttribute(\"style\");\n\t\t\t} else if (value === true) {\n\t\t\t\tif (isHydrating && style.cssText !== \"\") {\n\t\t\t\t\temitHydrationWarning(name, quietProps, \"\", style.cssText, element);\n\t\t\t\t}\n\t\t\t\telement.setAttribute(\"style\", \"\");\n\t\t\t} else if (typeof value === \"string\") {\n\t\t\t\tif (style.cssText !== value) {\n\t\t\t\t\t// TODO: Fix hydration warnings for styles\n\t\t\t\t\t//if (isHydrating) {\n\t\t\t\t\t//\temitHydrationWarning(\n\t\t\t\t\t//\t\tname,\n\t\t\t\t\t//\t\tquietProps,\n\t\t\t\t\t//\t\tvalue,\n\t\t\t\t\t//\t\tstyle.cssText,\n\t\t\t\t\t//\t\telement,\n\t\t\t\t\t//\t);\n\t\t\t\t\t//}\n\n\t\t\t\t\tstyle.cssText = value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (typeof oldValue === \"string\") {\n\t\t\t\t\t// if the old value was a string, we need to clear the style\n\t\t\t\t\t// TODO: only clear the styles enumerated in the old value\n\t\t\t\t\tstyle.cssText = \"\";\n\t\t\t\t}\n\n\t\t\t\t// First pass: remove styles present in oldValue but not in value\n\t\t\t\tif (oldValue) {\n\t\t\t\t\tfor (const styleName in oldValue) {\n\t\t\t\t\t\tif (value && styleName in value) continue;\n\t\t\t\t\t\tconst cssName = camelToKebabCase(styleName);\n\t\t\t\t\t\tif (isHydrating && style.getPropertyValue(cssName) !== \"\") {\n\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\tstyle.getPropertyValue(cssName),\n\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t\t`style.${styleName}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstyle.removeProperty(cssName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Second pass: apply all styles from value\n\t\t\t\tif (value) {\n\t\t\t\t\tfor (const styleName in value) {\n\t\t\t\t\t\tconst cssName = camelToKebabCase(styleName);\n\t\t\t\t\t\tconst styleValue = (value as any)[styleName];\n\t\t\t\t\t\tif (styleValue == null) {\n\t\t\t\t\t\t\tif (isHydrating && style.getPropertyValue(cssName) !== \"\") {\n\t\t\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\tstyle.getPropertyValue(cssName),\n\t\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t\t\t`style.${styleName}`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstyle.removeProperty(cssName);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst formattedValue = formatStyleValue(cssName, styleValue);\n\t\t\t\t\t\t\tif (style.getPropertyValue(cssName) !== formattedValue) {\n\t\t\t\t\t\t\t\t// TODO: hydration warnings for style props\n\t\t\t\t\t\t\t\t//if (isHydrating) {\n\t\t\t\t\t\t\t\t//\temitHydrationWarning(\n\t\t\t\t\t\t\t\t//\t\tname,\n\t\t\t\t\t\t\t\t//\t\tquietProps,\n\t\t\t\t\t\t\t\t//\t\tformattedValue,\n\t\t\t\t\t\t\t\t//\t\tstyle.getPropertyValue(cssName),\n\t\t\t\t\t\t\t\t//\t\telement,\n\t\t\t\t\t\t\t\t//\t\t`style.${styleName}`,\n\t\t\t\t\t\t\t\t//\t);\n\t\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\t\tstyle.setProperty(cssName, formattedValue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t\tcase \"class\":\n\t\tcase \"className\":\n\t\t\tif (name === \"className\" && \"class\" in props) break;\n\t\t\tif (value === true) {\n\t\t\t\tif (isHydrating && element.getAttribute(\"class\") !== \"\") {\n\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\"\",\n\t\t\t\t\t\telement.getAttribute(\"class\"),\n\t\t\t\t\t\telement,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telement.setAttribute(\"class\", \"\");\n\t\t\t} else if (value == null) {\n\t\t\t\tif (isHydrating && element.hasAttribute(\"class\")) {\n\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\telement.getAttribute(\"class\"),\n\t\t\t\t\t\telement,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\telement.removeAttribute(\"class\");\n\t\t\t} else if (typeof value === \"object\") {\n\t\t\t\t// class={{\"included-class\": true, \"excluded-class\": false}} syntax\n\t\t\t\tif (typeof oldValue === \"string\") {\n\t\t\t\t\t// if the old value was a string, we need to clear all classes\n\t\t\t\t\telement.setAttribute(\"class\", \"\");\n\t\t\t\t}\n\n\t\t\t\tlet shouldIssueWarning = false;\n\t\t\t\tconst hydratingClasses = isHydrating\n\t\t\t\t\t? new Set(Array.from(element.classList))\n\t\t\t\t\t: undefined;\n\t\t\t\tconst hydratingClassName = isHydrating\n\t\t\t\t\t? element.getAttribute(\"class\")\n\t\t\t\t\t: undefined;\n\n\t\t\t\t// Two passes: removes first, then adds. This ensures that\n\t\t\t\t// overlapping classes in different keys are handled correctly.\n\t\t\t\t// e.g. {\"a b\": false, \"b c\": true} should result in \"b c\"\n\t\t\t\t// Remove pass: iterate oldValue for classes to remove\n\t\t\t\tif (oldValue) {\n\t\t\t\t\tfor (const classNames in oldValue) {\n\t\t\t\t\t\tif (value && value[classNames]) continue;\n\t\t\t\t\t\tconst classes = classNames.split(/\\s+/).filter(Boolean);\n\t\t\t\t\t\telement.classList.remove(...classes);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Add pass: iterate value for classes to add\n\t\t\t\tif (value) {\n\t\t\t\t\tfor (const classNames in value) {\n\t\t\t\t\t\tif (!value[classNames]) continue;\n\t\t\t\t\t\tconst classes = classNames.split(/\\s+/).filter(Boolean);\n\t\t\t\t\t\telement.classList.add(...classes);\n\t\t\t\t\t\tfor (const className of classes) {\n\t\t\t\t\t\t\tif (hydratingClasses && hydratingClasses.has(className)) {\n\t\t\t\t\t\t\t\thydratingClasses.delete(className);\n\t\t\t\t\t\t\t} else if (isHydrating) {\n\t\t\t\t\t\t\t\tshouldIssueWarning = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tshouldIssueWarning ||\n\t\t\t\t\t(hydratingClasses && hydratingClasses.size > 0)\n\t\t\t\t) {\n\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\tObject.keys(value)\n\t\t\t\t\t\t\t.filter((k) => value[k])\n\t\t\t\t\t\t\t.join(\" \"),\n\t\t\t\t\t\thydratingClassName || \"\",\n\t\t\t\t\t\telement,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if (!isSVG && !isMathML) {\n\t\t\t\tif (element.className !== value) {\n\t\t\t\t\tif (isHydrating) {\n\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\telement.className,\n\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telement.className = value;\n\t\t\t\t}\n\t\t\t} else if (element.getAttribute(\"class\") !== value) {\n\t\t\t\tif (isHydrating) {\n\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\telement.getAttribute(\"class\"),\n\t\t\t\t\t\telement,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telement.setAttribute(\"class\", value as string);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"innerHTML\":\n\t\t\tif (value !== oldValue) {\n\t\t\t\tif (isHydrating) {\n\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\telement.innerHTML,\n\t\t\t\t\t\telement,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telement.innerHTML = value as any;\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase \"dangerouslySetInnerHTML\": {\n\t\t\tconst htmlValue =\n\t\t\t\tvalue && typeof value === \"object\" && \"__html\" in value\n\t\t\t\t\t? (value.__html ?? \"\")\n\t\t\t\t\t: \"\";\n\t\t\tconst oldHtmlValue =\n\t\t\t\toldValue && typeof oldValue === \"object\" && \"__html\" in oldValue\n\t\t\t\t\t? (oldValue.__html ?? \"\")\n\t\t\t\t\t: \"\";\n\t\t\tif (htmlValue !== oldHtmlValue) {\n\t\t\t\telement.innerHTML = htmlValue as any;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"htmlFor\":\n\t\t\tif (\"for\" in props) break;\n\t\t\tif (value == null || value === false) {\n\t\t\t\telement.removeAttribute(\"for\");\n\t\t\t} else {\n\t\t\t\telement.setAttribute(\"for\", String(value === true ? \"\" : value));\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault: {\n\t\t\tif (\n\t\t\t\tname[0] === \"o\" &&\n\t\t\t\tname[1] === \"n\" &&\n\t\t\t\tname[2] === name[2].toUpperCase() &&\n\t\t\t\ttypeof value === \"function\"\n\t\t\t) {\n\t\t\t\t// Support React-style event names (onClick, onChange, etc.)\n\t\t\t\tname = name.toLowerCase();\n\t\t\t}\n\n\t\t\t// Support React-style SVG attribute names (strokeWidth, etc.)\n\t\t\tif (isSVG && name in REACT_SVG_PROPS) {\n\t\t\t\tname = REACT_SVG_PROPS[name];\n\t\t\t}\n\n\t\t\t// try to set the property directly\n\t\t\tif (\n\t\t\t\tname in element &&\n\t\t\t\t// boolean properties will coerce strings, but sometimes they map to\n\t\t\t\t// enumerated attributes, where truthy strings (\"false\", \"no\") map to\n\t\t\t\t// falsy properties, so we force using setAttribute.\n\t\t\t\t!(\n\t\t\t\t\ttypeof value === \"string\" &&\n\t\t\t\t\ttypeof (element as any)[name] === \"boolean\"\n\t\t\t\t) &&\n\t\t\t\tisWritableProperty(element, name)\n\t\t\t) {\n\t\t\t\t// For URL properties like src and href, the DOM property returns the\n\t\t\t\t// resolved absolute URL. We need to resolve the prop value the same way\n\t\t\t\t// to compare correctly.\n\t\t\t\tlet domValue = (element as any)[name];\n\t\t\t\tlet propValue = value;\n\t\t\t\tif (\n\t\t\t\t\t(name === \"src\" || name === \"href\") &&\n\t\t\t\t\ttypeof value === \"string\" &&\n\t\t\t\t\ttypeof domValue === \"string\"\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpropValue = new URL(value, element.baseURI).href;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// Invalid URL, use original value for comparison\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (propValue !== domValue || oldValue === undefined) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tisHydrating &&\n\t\t\t\t\t\ttypeof (element as any)[name] === \"string\" &&\n\t\t\t\t\t\t(element as any)[name] !== value\n\t\t\t\t\t) {\n\t\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t(element as any)[name],\n\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// if the property is writable, assign it directly\n\t\t\t\t\t(element as any)[name] = value;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (value === true) {\n\t\t\t\tvalue = \"\";\n\t\t\t} else if (value == null || value === false) {\n\t\t\t\tif (isHydrating && element.hasAttribute(name)) {\n\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\telement.getAttribute(name),\n\t\t\t\t\t\telement,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\telement.removeAttribute(name);\n\t\t\t\treturn;\n\t\t\t} else if (typeof value !== \"string\") {\n\t\t\t\tvalue = String(value);\n\t\t\t}\n\n\t\t\tif (element.getAttribute(name) !== value) {\n\t\t\t\tif (isHydrating) {\n\t\t\t\t\temitHydrationWarning(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tquietProps,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\telement.getAttribute(name),\n\t\t\t\t\t\telement,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\telement.setAttribute(name, value as any);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport const adapter: Partial<RenderAdapter<Node, string, Node>> = {\n\tscope({\n\t\tscope: xmlns,\n\t\ttag,\n\t\tprops,\n\t\troot,\n\t}: {\n\t\tscope: string | undefined;\n\t\ttag: string | symbol;\n\t\tprops: Record<string, any>;\n\t\troot: Node | undefined;\n\t}): string | undefined {\n\t\tswitch (tag) {\n\t\t\tcase Portal: {\n\t\t\t\tconst ns = root instanceof Element ? root.namespaceURI : null;\n\t\t\t\txmlns =\n\t\t\t\t\tns === SVG_NAMESPACE\n\t\t\t\t\t\t? SVG_NAMESPACE\n\t\t\t\t\t\t: ns === MATHML_NAMESPACE\n\t\t\t\t\t\t\t? MATHML_NAMESPACE\n\t\t\t\t\t\t\t: undefined;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"svg\":\n\t\t\t\txmlns = SVG_NAMESPACE;\n\t\t\t\tbreak;\n\t\t\tcase \"math\":\n\t\t\t\txmlns = MATHML_NAMESPACE;\n\t\t\t\tbreak;\n\t\t\tcase \"foreignObject\":\n\t\t\t\txmlns = undefined;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn props.xmlns || xmlns;\n\t},\n\n\tcreate({\n\t\ttag,\n\t\ttagName,\n\t\tscope: xmlns,\n\t\troot,\n\t}: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tscope: string | undefined;\n\t\troot: Node | undefined;\n\t}): Node {\n\t\tif (typeof tag !== \"string\") {\n\t\t\tthrow new Error(`Unknown tag: ${tagName}`);\n\t\t} else if (tag.toLowerCase() === \"svg\") {\n\t\t\txmlns = SVG_NAMESPACE;\n\t\t} else if (tag.toLowerCase() === \"math\") {\n\t\t\txmlns = MATHML_NAMESPACE;\n\t\t} else if (tag === \"foreignObject\") {\n\t\t\txmlns = SVG_NAMESPACE;\n\t\t}\n\n\t\tconst doc = getRootDocument(root);\n\t\treturn xmlns ? doc.createElementNS(xmlns, tag) : doc.createElement(tag);\n\t},\n\n\tadopt({\n\t\ttag,\n\t\ttagName,\n\t\tnode,\n\t\troot,\n\t}: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tnode: Node | undefined;\n\t\troot: Node | undefined;\n\t}): Array<Node> | undefined {\n\t\tif (typeof tag !== \"string\" && tag !== Portal) {\n\t\t\tthrow new Error(`Unknown tag: ${tagName}`);\n\t\t}\n\n\t\tconst doc = getRootDocument(root);\n\t\tif (\n\t\t\tnode === doc.body ||\n\t\t\tnode === doc.head ||\n\t\t\tnode === doc.documentElement ||\n\t\t\tnode === doc\n\t\t) {\n\t\t\tconsole.warn(\n\t\t\t\t`Hydrating ${node.nodeName.toLowerCase()} is discouraged as it is destructive and may remove unknown nodes.`,\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tnode == null ||\n\t\t\t(typeof tag === \"string\" &&\n\t\t\t\t(node.nodeType !== Node.ELEMENT_NODE ||\n\t\t\t\t\ttag.toLowerCase() !== (node as Element).tagName.toLowerCase()))\n\t\t) {\n\t\t\tconsole.warn(`Expected <${tagName}> while hydrating but found: `, node);\n\t\t\treturn;\n\t\t}\n\n\t\treturn Array.from(node.childNodes);\n\t},\n\n\tpatch({\n\t\ttag,\n\t\ttagName,\n\t\tnode,\n\t\tprops,\n\t\toldProps,\n\t\tscope: xmlns,\n\t\tcopyProps,\n\t\tquietProps,\n\t\tisHydrating,\n\t}: {\n\t\ttag: string | symbol;\n\t\tnode: Node;\n\t\ttagName: string;\n\t\tprops: Record<string, any>;\n\t\toldProps: Record<string, any> | undefined;\n\t\tscope: string | undefined;\n\t\troot: Node | undefined;\n\t\tcopyProps: Set<string> | undefined;\n\t\tquietProps: Set<string> | undefined;\n\t\tisHydrating: boolean;\n\t}): void {\n\t\tif (node.nodeType !== Node.ELEMENT_NODE) {\n\t\t\tthrow new TypeError(`Cannot patch node: ${String(node)}`);\n\t\t} else if (props.class && props.className) {\n\t\t\tconsole.error(\n\t\t\t\t`Both \"class\" and \"className\" set in props for <${tagName}>. Use one or the other.`,\n\t\t\t);\n\t\t}\n\n\t\tconst element = node as Element;\n\t\tconst isSVG = xmlns === SVG_NAMESPACE || tag === \"foreignObject\";\n\t\tconst isMathML = xmlns === MATHML_NAMESPACE;\n\t\t// First pass: iterate oldProps to handle removals\n\t\tif (oldProps) {\n\t\t\tfor (let name in oldProps) {\n\t\t\t\tif (name in props) continue;\n\t\t\t\tpatchProp(\n\t\t\t\t\telement,\n\t\t\t\t\tname,\n\t\t\t\t\tundefined,\n\t\t\t\t\toldProps[name],\n\t\t\t\t\tprops,\n\t\t\t\t\tisSVG,\n\t\t\t\t\tisMathML,\n\t\t\t\t\tcopyProps,\n\t\t\t\t\tquietProps,\n\t\t\t\t\tisHydrating,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t// Second pass: iterate props to handle additions and updates\n\t\tfor (let name in props) {\n\t\t\tpatchProp(\n\t\t\t\telement,\n\t\t\t\tname,\n\t\t\t\tprops[name],\n\t\t\t\toldProps ? oldProps[name] : undefined,\n\t\t\t\tprops,\n\t\t\t\tisSVG,\n\t\t\t\tisMathML,\n\t\t\t\tcopyProps,\n\t\t\t\tquietProps,\n\t\t\t\tisHydrating,\n\t\t\t);\n\t\t}\n\t},\n\n\tarrange({\n\t\ttag,\n\t\tnode,\n\t\tprops,\n\t\tchildren,\n\t}: {\n\t\ttag: string | symbol;\n\t\tnode: Node;\n\t\tprops: Record<string, any>;\n\t\tchildren: Array<Node>;\n\t\troot: Node | undefined;\n\t}): void {\n\t\tif (tag === Portal && (node == null || typeof node.nodeType !== \"number\")) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`<Portal> root is not a node. Received: ${String(node)}`,\n\t\t\t);\n\t\t}\n\n\t\tif (!(\"innerHTML\" in props) && !(\"dangerouslySetInnerHTML\" in props)) {\n\t\t\tlet oldChild = node.firstChild;\n\t\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\t\tconst newChild = children[i];\n\t\t\t\tif (oldChild === newChild) {\n\t\t\t\t\t// the child is already in the right place, so we can skip it\n\t\t\t\t\toldChild = oldChild.nextSibling;\n\t\t\t\t} else {\n\t\t\t\t\tnode.insertBefore(newChild, oldChild);\n\t\t\t\t\tif (\n\t\t\t\t\t\ttag !== Portal &&\n\t\t\t\t\t\toldChild &&\n\t\t\t\t\t\ti + 1 < children.length &&\n\t\t\t\t\t\toldChild !== children[i + 1]\n\t\t\t\t\t) {\n\t\t\t\t\t\toldChild = oldChild.nextSibling;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremove({\n\t\tnode,\n\t\tparentNode,\n\t\tisNested,\n\t}: {\n\t\tnode: Node;\n\t\tparentNode: Node;\n\t\tisNested: boolean;\n\t\troot: Node | undefined;\n\t}): void {\n\t\tif (!isNested && node.parentNode === parentNode) {\n\t\t\tparentNode.removeChild(node);\n\t\t}\n\t},\n\n\ttext({\n\t\tvalue,\n\t\toldNode,\n\t\thydrationNodes,\n\t\troot,\n\t}: {\n\t\tvalue: string;\n\t\thydrationNodes: Array<Node> | undefined;\n\t\toldNode: Node | undefined;\n\t\troot: Node | undefined;\n\t}): Node {\n\t\tconst doc = getRootDocument(root);\n\t\tif (hydrationNodes != null) {\n\t\t\tlet node = hydrationNodes.shift();\n\t\t\tif (!node || node.nodeType !== Node.TEXT_NODE) {\n\t\t\t\tconsole.warn(`Expected \"${value}\" while hydrating but found:`, node);\n\t\t\t} else {\n\t\t\t\t// value is a text node, check if it matches the expected text\n\t\t\t\tconst textData = (node as Text).data;\n\t\t\t\tif (textData.length > value.length) {\n\t\t\t\t\tif (textData.startsWith(value)) {\n\t\t\t\t\t\t// the text node is longer than the expected text, so we\n\t\t\t\t\t\t// reuse the existing text node, but truncate it and unshift the rest\n\t\t\t\t\t\t(node as Text).data = value;\n\t\t\t\t\t\thydrationNodes.unshift(\n\t\t\t\t\t\t\tdoc.createTextNode(textData.slice(value.length)),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\treturn node;\n\t\t\t\t\t}\n\t\t\t\t} else if (textData === value) {\n\t\t\t\t\treturn node;\n\t\t\t\t}\n\n\t\t\t\t// We log textData and not node because node will be mutated\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`Expected \"${value}\" while hydrating but found:`,\n\t\t\t\t\ttextData,\n\t\t\t\t);\n\t\t\t\toldNode = node;\n\t\t\t}\n\t\t}\n\n\t\tif (oldNode != null) {\n\t\t\tif ((oldNode as Text).data !== value) {\n\t\t\t\t(oldNode as Text).data = value;\n\t\t\t}\n\n\t\t\treturn oldNode;\n\t\t}\n\n\t\treturn doc.createTextNode(value);\n\t},\n\n\traw({\n\t\tvalue,\n\t\tscope: xmlns,\n\t\thydrationNodes,\n\t\troot,\n\t}: {\n\t\tvalue: string | Node;\n\t\tscope: string | undefined;\n\t\thydrationNodes: Array<Node> | undefined;\n\t\troot: Node | undefined;\n\t}): ElementValue<Node> {\n\t\tlet nodes: Array<Node>;\n\t\tif (typeof value === \"string\") {\n\t\t\tconst doc = getRootDocument(root);\n\t\t\tconst el =\n\t\t\t\txmlns == null\n\t\t\t\t\t? doc.createElement(\"div\")\n\t\t\t\t\t: xmlns === SVG_NAMESPACE\n\t\t\t\t\t\t? doc.createElementNS(xmlns, \"svg\")\n\t\t\t\t\t\t: doc.createElementNS(xmlns, \"math\");\n\t\t\tel.innerHTML = value;\n\t\t\tnodes = Array.from(el.childNodes);\n\t\t} else {\n\t\t\tnodes = value == null ? [] : Array.isArray(value) ? [...value] : [value];\n\t\t}\n\n\t\tif (hydrationNodes != null) {\n\t\t\tfor (let i = 0; i < nodes.length; i++) {\n\t\t\t\tconst node = nodes[i];\n\t\t\t\t// check if node is equal to the next node in the hydration array\n\t\t\t\tconst hydrationNode = hydrationNodes.shift();\n\t\t\t\tif (\n\t\t\t\t\thydrationNode &&\n\t\t\t\t\ttypeof hydrationNode === \"object\" &&\n\t\t\t\t\ttypeof hydrationNode.nodeType === \"number\" &&\n\t\t\t\t\tnode.isEqualNode(hydrationNode as Node)\n\t\t\t\t) {\n\t\t\t\t\tnodes[i] = hydrationNode as Node;\n\t\t\t\t} else {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`Expected <Raw value=\"${String(value)}\"> while hydrating but found:`,\n\t\t\t\t\t\thydrationNode,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nodes.length === 0\n\t\t\t? undefined\n\t\t\t: nodes.length === 1\n\t\t\t\t? nodes[0]\n\t\t\t\t: nodes;\n\t},\n};\n\nexport class DOMRenderer extends Renderer<Node, string, Element> {\n\tconstructor() {\n\t\tsuper(adapter);\n\t}\n\n\trender(\n\t\tchildren: Children,\n\t\troot: Element,\n\t\tctx?: Context,\n\t): Promise<ElementValue<Node>> | ElementValue<Node> {\n\t\tvalidateRoot(root);\n\t\treturn super.render(children, root, ctx);\n\t}\n\n\thydrate(\n\t\tchildren: Children,\n\t\troot: Element,\n\t\tctx?: Context,\n\t): Promise<ElementValue<Node>> | ElementValue<Node> {\n\t\tvalidateRoot(root);\n\t\treturn super.hydrate(children, root, ctx);\n\t}\n}\n\nfunction validateRoot(root: unknown): asserts root is Element {\n\tif (\n\t\troot == null ||\n\t\t(typeof root === \"object\" && typeof (root as any).nodeType !== \"number\")\n\t) {\n\t\tthrow new TypeError(`Render root is not a node. Received: ${String(root)}`);\n\t} else if ((root as Node).nodeType !== Node.ELEMENT_NODE) {\n\t\tthrow new TypeError(\n\t\t\t`Render root must be an element node. Received: ${String(root)}`,\n\t\t);\n\t}\n}\n\nexport const renderer = new DOMRenderer();\n\ndeclare global {\n\tmodule Crank {\n\t\tinterface EventMap extends GlobalEventHandlersEventMap {}\n\t}\n}\n"],"names":["camelToKebabCase","formatStyleValue","REACT_SVG_PROPS","Portal","Renderer"],"mappings":";;;;;;AAWA,MAAM,aAAa,GAAG,4BAA4B;AAClD,MAAM,gBAAgB,GAAG,oCAAoC;AAE7D,SAAS,eAAe,CAAC,IAAsB,EAAA;AAC9C,IAAA,IAAI,IAAI,IAAI,IAAI,CAAC,aAAa,EAAE;QAC/B,OAAO,IAAI,CAAC,aAAa;IAC1B;IAEA,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,aAAa,EAAE;AACjD,QAAA,OAAO,IAA2B;IACnC;AAEA,IAAA,OAAO,QAAQ;AAChB;AAEA,SAAS,kBAAkB,CAAC,OAAgB,EAAE,IAAY,EAAA;;IAEzD,IAAI,SAAS,GAAG,OAAO;AACvB,IAAA,GAAG;AACF,QAAA,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE;YAC1D;QACD;IACD,CAAC,SAAS,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC;AAEtD,IAAA,IAAI,SAAS,KAAK,IAAI,EAAE;AACvB,QAAA,OAAO,KAAK;IACb;;;IAIA,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,SAAS,EAAE,I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