@b9g/crank 0.7.1 → 0.7.2

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/umd.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"umd.js","sources":["../src/event-target.ts","../src/_utils.ts","../src/crank.ts","../src/_css.ts","../src/dom.ts","../src/html.ts"],"sourcesContent":["// EVENT PHASE CONSTANTS\n// https://developer.mozilla.org/en-US/docs/Web/API/Event/eventPhase\nconst NONE = 0;\nconst CAPTURING_PHASE = 1;\nconst AT_TARGET = 2;\nconst BUBBLING_PHASE = 3;\n\nexport function isEventTarget(value: any): value is EventTarget {\n\treturn (\n\t\tvalue != null &&\n\t\ttypeof value.addEventListener === \"function\" &&\n\t\ttypeof value.removeEventListener === \"function\" &&\n\t\ttypeof value.dispatchEvent === \"function\"\n\t);\n}\n\nfunction setEventProperty<T extends keyof Event>(\n\tev: Event,\n\tkey: T,\n\tvalue: Event[T],\n): void {\n\tObject.defineProperty(ev, key, {value, writable: false, configurable: true});\n}\n\nfunction isListenerOrListenerObject(\n\tvalue: unknown,\n): value is EventListenerOrEventListenerObject {\n\treturn (\n\t\ttypeof value === \"function\" ||\n\t\t(value !== null &&\n\t\t\ttypeof value === \"object\" &&\n\t\t\ttypeof (value as any).handleEvent === \"function\")\n\t);\n}\n\nfunction normalizeListenerOptions(\n\toptions: AddEventListenerOptions | boolean | null | undefined,\n): AddEventListenerOptions {\n\tif (typeof options === \"boolean\") {\n\t\treturn {capture: options};\n\t} else if (options == null) {\n\t\treturn {};\n\t}\n\n\treturn options;\n}\n\nconst _parent = Symbol.for(\"CustomEventTarget.parent\");\nconst _listeners = Symbol.for(\"CustomEventTarget.listeners\");\nconst _delegates = Symbol.for(\"CustomEventTarget.delegates\");\nconst _dispatchEventOnSelf = Symbol.for(\"CustomEventTarget.dispatchSelf\");\n\ninterface EventListenerRecord {\n\ttype: string;\n\t// listener is the original value passed to addEventListener, callback is the\n\t// actual function we call\n\tlistener: EventListenerOrEventListenerObject;\n\tcallback: EventListener;\n\toptions: AddEventListenerOptions;\n}\n\nexport class CustomEventTarget<TParent extends CustomEventTarget<TParent> = any>\n\timplements EventTarget\n{\n\tdeclare static dispatchEventOnSelf: typeof _dispatchEventOnSelf;\n\tdeclare [_parent]: TParent | null;\n\tdeclare [_listeners]: Array<EventListenerRecord>;\n\tdeclare [_delegates]: Set<EventTarget>;\n\tconstructor(parent: TParent | null = null) {\n\t\tthis[_parent] = parent;\n\t\tthis[_listeners] = [];\n\t\tthis[_delegates] = new Set<EventTarget>();\n\t}\n\n\taddEventListener(\n\t\ttype: string,\n\t\tlistener: EventListenerOrEventListenerObject | null,\n\t\toptions?: boolean | AddEventListenerOptions,\n\t): void {\n\t\tif (!isListenerOrListenerObject(listener)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst listeners = this[_listeners];\n\t\toptions = normalizeListenerOptions(options);\n\t\tlet callback: EventListener;\n\t\tif (typeof listener === \"function\") {\n\t\t\tcallback = listener;\n\t\t} else {\n\t\t\tcallback = (ev: Event) => listener.handleEvent(ev);\n\t\t}\n\t\tconst record: EventListenerRecord = {type, listener, callback, options};\n\n\t\tif (options.once) {\n\t\t\trecord.callback = function (this: any) {\n\t\t\t\tconst i = listeners.indexOf(record);\n\t\t\t\tif (i !== -1) {\n\t\t\t\t\tlisteners.splice(i, 1);\n\t\t\t\t}\n\n\t\t\t\treturn callback.apply(this, arguments as any);\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\tlisteners.some(\n\t\t\t\t(record1) =>\n\t\t\t\t\trecord.type === record1.type &&\n\t\t\t\t\trecord.listener === record1.listener &&\n\t\t\t\t\t!record.options.capture === !record1.options.capture,\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tlisteners.push(record);\n\n\t\tfor (const delegate of this[_delegates]) {\n\t\t\tdelegate.addEventListener(type, record.callback, record.options);\n\t\t}\n\t}\n\n\tremoveEventListener(\n\t\ttype: string,\n\t\tlistener: EventListenerOrEventListenerObject | null,\n\t\toptions?: EventListenerOptions | boolean,\n\t): void {\n\t\tconst listeners = this[_listeners];\n\t\tif (listeners == null || !isListenerOrListenerObject(listener)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst options1 = normalizeListenerOptions(options);\n\t\tconst i = listeners.findIndex(\n\t\t\t(record) =>\n\t\t\t\trecord.type === type &&\n\t\t\t\trecord.listener === listener &&\n\t\t\t\t!record.options.capture === !options1.capture,\n\t\t);\n\n\t\tif (i === -1) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst record = listeners[i];\n\t\tlisteners.splice(i, 1);\n\n\t\tfor (const delegate of this[_delegates]) {\n\t\t\tdelegate.removeEventListener(\n\t\t\t\trecord.type,\n\t\t\t\trecord.callback,\n\t\t\t\trecord.options,\n\t\t\t);\n\t\t}\n\t}\n\n\tdispatchEvent(ev: Event): boolean {\n\t\tconst path: Array<CustomEventTarget> = [];\n\t\tfor (let parent = this[_parent]; parent; parent = parent[_parent]) {\n\t\t\tpath.push(parent);\n\t\t}\n\n\t\tlet cancelBubble = false;\n\t\tlet immediateCancelBubble = false;\n\t\tconst stopPropagation = ev.stopPropagation;\n\t\tsetEventProperty(ev, \"stopPropagation\", () => {\n\t\t\tcancelBubble = true;\n\t\t\treturn stopPropagation.call(ev);\n\t\t});\n\n\t\tconst stopImmediatePropagation = ev.stopImmediatePropagation;\n\t\tsetEventProperty(ev, \"stopImmediatePropagation\", () => {\n\t\t\timmediateCancelBubble = true;\n\t\t\treturn stopImmediatePropagation.call(ev);\n\t\t});\n\t\tsetEventProperty(ev, \"target\", this);\n\n\t\t// The only possible errors in this block are errors thrown by callbacks,\n\t\t// and dispatchEvent will only log these errors rather than throwing them.\n\t\t// Therefore, we place all code in a try block, log errors in the catch\n\t\t// block, and use an unsafe return statement in the finally block.\n\t\t//\n\t\t// Each early return within the try block returns true because while the\n\t\t// return value is overridden in the finally block, TypeScript\n\t\t// (justifiably) does not recognize the unsafe return statement.\n\t\ttry {\n\t\t\tsetEventProperty(ev, \"eventPhase\", CAPTURING_PHASE);\n\t\t\tfor (let i = path.length - 1; i >= 0; i--) {\n\t\t\t\tconst target = path[i];\n\t\t\t\tconst listeners = target[_listeners];\n\t\t\t\tsetEventProperty(ev, \"currentTarget\", target);\n\t\t\t\tfor (let i = 0; i < listeners.length; i++) {\n\t\t\t\t\tconst record = listeners[i];\n\t\t\t\t\tif (record.type === ev.type && record.options.capture) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\trecord.callback.call(target, ev);\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (immediateCancelBubble) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (cancelBubble) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t{\n\t\t\t\tsetEventProperty(ev, \"eventPhase\", AT_TARGET);\n\t\t\t\tsetEventProperty(ev, \"currentTarget\", this);\n\n\t\t\t\tthis[_dispatchEventOnSelf](ev);\n\t\t\t\tif (immediateCancelBubble) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tconst listeners = this[_listeners];\n\t\t\t\tfor (let i = 0; i < listeners.length; i++) {\n\t\t\t\t\tconst record = listeners[i];\n\t\t\t\t\tif (record.type === ev.type) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\trecord.callback.call(this, ev);\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (immediateCancelBubble) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (cancelBubble) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (ev.bubbles) {\n\t\t\t\tsetEventProperty(ev, \"eventPhase\", BUBBLING_PHASE);\n\t\t\t\tfor (let i = 0; i < path.length; i++) {\n\t\t\t\t\tconst target = path[i];\n\t\t\t\t\tsetEventProperty(ev, \"currentTarget\", target);\n\t\t\t\t\tconst listeners = target[_listeners];\n\t\t\t\t\tfor (let i = 0; i < listeners.length; i++) {\n\t\t\t\t\t\tconst record = listeners[i];\n\t\t\t\t\t\tif (record.type === ev.type && !record.options.capture) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\trecord.callback.call(target, ev);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (immediateCancelBubble) {\n\t\t\t\t\t\t\t\treturn true;\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\tif (cancelBubble) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tsetEventProperty(ev, \"eventPhase\", NONE);\n\t\t\tsetEventProperty(ev, \"currentTarget\", null);\n\t\t\t// eslint-disable-next-line no-unsafe-finally\n\t\t\treturn !ev.defaultPrevented;\n\t\t}\n\t}\n\n\t[_dispatchEventOnSelf](_ev: Event): void {}\n}\n\nCustomEventTarget.dispatchEventOnSelf = _dispatchEventOnSelf;\n\nexport function addEventTargetDelegates<T extends CustomEventTarget>(\n\ttarget: T,\n\tdelegates: Array<unknown>,\n\tinclude: (target1: T) => boolean = (target1) => target === target1,\n): void {\n\tconst delegates1 = delegates.filter(isEventTarget);\n\tfor (\n\t\tlet target1: T | null = target;\n\t\ttarget1 && include(target1);\n\t\ttarget1 = target1[_parent]\n\t) {\n\t\tfor (let i = 0; i < delegates1.length; i++) {\n\t\t\tconst delegate = delegates1[i];\n\t\t\tif (target1[_delegates].has(delegate)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\ttarget1[_delegates].add(delegate);\n\t\t\tfor (const record of target1[_listeners]) {\n\t\t\t\tdelegate.addEventListener(record.type, record.callback, record.options);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function removeEventTargetDelegates<T extends CustomEventTarget>(\n\ttarget: T,\n\tdelegates: Array<unknown>,\n\tinclude: (target1: T) => boolean = (target1) => target === target1,\n): void {\n\tconst delegates1 = delegates.filter(isEventTarget);\n\tfor (\n\t\tlet target1: T | null = target;\n\t\ttarget1 && include(target1);\n\t\ttarget1 = target1[_parent]\n\t) {\n\t\tfor (let i = 0; i < delegates1.length; i++) {\n\t\t\tconst delegate = delegates1[i];\n\t\t\tif (!target1[_delegates].has(delegate)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\ttarget1[_delegates].delete(delegate);\n\t\t\tfor (const record of target1[_listeners]) {\n\t\t\t\tdelegate.removeEventListener(\n\t\t\t\t\trecord.type,\n\t\t\t\t\trecord.callback,\n\t\t\t\t\trecord.options,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function clearEventListeners(target: CustomEventTarget): void {\n\tconst listeners = target[_listeners];\n\tconst delegates = target[_delegates];\n\tfor (let i = 0; i < listeners.length; i++) {\n\t\tconst record = listeners[i];\n\t\tfor (const delegate of delegates) {\n\t\t\tdelegate.removeEventListener(\n\t\t\t\trecord.type,\n\t\t\t\trecord.callback,\n\t\t\t\trecord.options,\n\t\t\t);\n\t\t}\n\t}\n\n\tlisteners.length = 0;\n\tdelegates.clear();\n}\n","export function wrap<T>(value: Array<T> | T | undefined): Array<T> {\n\treturn value === undefined ? [] : Array.isArray(value) ? value : [value];\n}\n\nexport function unwrap<T>(arr: Array<T>): Array<T> | T | undefined {\n\treturn arr.length === 0 ? undefined : arr.length === 1 ? arr[0] : arr;\n}\n\nexport type NonStringIterable<T> = Iterable<T> & object;\n\n/**\n * Ensures a value is an array.\n *\n * This function does the same thing as wrap() above except it handles nulls\n * and iterables, so it is appropriate for wrapping user-provided element\n * children.\n */\nexport function arrayify<T>(\n\tvalue: NonStringIterable<T> | T | null | undefined,\n): Array<T> {\n\treturn value == null\n\t\t? []\n\t\t: Array.isArray(value)\n\t\t\t? value\n\t\t\t: typeof value === \"string\" ||\n\t\t\t\t typeof (value as any)[Symbol.iterator] !== \"function\"\n\t\t\t\t? [value as T]\n\t\t\t\t: [...(value as NonStringIterable<T>)];\n}\n\nexport function isIteratorLike(\n\tvalue: any,\n): value is Iterator<unknown> | AsyncIterator<unknown> {\n\treturn value != null && typeof value.next === \"function\";\n}\n\nexport function isPromiseLike(value: any): value is PromiseLike<unknown> {\n\treturn value != null && typeof value.then === \"function\";\n}\n\ntype Deferred<T = unknown> = {\n\tresolve: (value: T | PromiseLike<T>) => void;\n\treject: (reason?: unknown) => void;\n};\n\ntype RaceRecord = {\n\tdeferreds: Set<Deferred>;\n\tsettled: boolean;\n};\n\nfunction createRaceRecord(contender: PromiseLike<unknown>): RaceRecord {\n\tconst deferreds = new Set<Deferred>();\n\tconst record = {deferreds, settled: false};\n\n\t// This call to `then` happens once for the lifetime of the value.\n\tPromise.resolve(contender).then(\n\t\t(value) => {\n\t\t\tfor (const {resolve} of deferreds) {\n\t\t\t\tresolve(value);\n\t\t\t}\n\n\t\t\tdeferreds.clear();\n\t\t\trecord.settled = true;\n\t\t},\n\t\t(err) => {\n\t\t\tfor (const {reject} of deferreds) {\n\t\t\t\treject(err);\n\t\t\t}\n\n\t\t\tdeferreds.clear();\n\t\t\trecord.settled = true;\n\t\t},\n\t);\n\treturn record;\n}\n\n// Promise.race is memory unsafe. This is alternative which is. See:\n// https://github.com/nodejs/node/issues/17469#issuecomment-685235106\n// Keys are the values passed to race.\n// Values are a record of data containing a set of deferreds and whether the\n// value has settled.\nconst wm = new WeakMap<object, RaceRecord>();\nexport function safeRace<T>(\n\tcontenders: Iterable<T | PromiseLike<T>>,\n): Promise<Awaited<T>> {\n\tlet deferred: Deferred;\n\tconst result = new Promise((resolve, reject) => {\n\t\tdeferred = {resolve, reject};\n\t\tfor (const contender of contenders) {\n\t\t\tif (!isPromiseLike(contender)) {\n\t\t\t\t// If the contender is a not a then-able, attempting to use it as a key\n\t\t\t\t// in the weakmap would throw an error. Luckily, it is safe to call\n\t\t\t\t// `Promise.resolve(contender).then` on regular values multiple\n\t\t\t\t// times because the promise fulfills immediately.\n\t\t\t\tPromise.resolve(contender).then(resolve, reject);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet record = wm.get(contender);\n\t\t\tif (record === undefined) {\n\t\t\t\trecord = createRaceRecord(contender);\n\t\t\t\trecord.deferreds.add(deferred);\n\t\t\t\twm.set(contender, record);\n\t\t\t} else if (record.settled) {\n\t\t\t\t// If the value has settled, it is safe to call\n\t\t\t\t// `Promise.resolve(contender).then` on it.\n\t\t\t\tPromise.resolve(contender).then(resolve, reject);\n\t\t\t} else {\n\t\t\t\trecord.deferreds.add(deferred);\n\t\t\t}\n\t\t}\n\t});\n\n\t// The finally callback executes when any value settles, preventing any of\n\t// the unresolved values from retaining a reference to the resolved value.\n\treturn result.finally(() => {\n\t\tfor (const contender of contenders) {\n\t\t\tif (isPromiseLike(contender)) {\n\t\t\t\tconst record = wm.get(contender);\n\t\t\t\tif (record) {\n\t\t\t\t\trecord.deferreds.delete(deferred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}) as Promise<Awaited<T>>;\n}\n","import {\n\tCustomEventTarget,\n\taddEventTargetDelegates,\n\tclearEventListeners,\n\tremoveEventTargetDelegates,\n} from \"./event-target.js\";\nimport {\n\tarrayify,\n\tisIteratorLike,\n\tisPromiseLike,\n\tsafeRace,\n\tunwrap,\n\twrap,\n} from \"./_utils.js\";\n\nconst NOOP = (): undefined => {};\n\n/**\n * A type which represents all valid values for an element tag.\n */\nexport type Tag = string | symbol | Component;\n\nfunction getTagName(tag: Tag): string {\n\treturn typeof tag === \"function\"\n\t\t? tag.name || \"Anonymous\"\n\t\t: typeof tag === \"string\"\n\t\t\t? tag\n\t\t\t: // tag is symbol, using else branch to avoid typeof tag === \"symbol\"\n\t\t\t\ttag.description || \"Anonymous\";\n}\n\n/**\n * A helper type to map the tag of an element to its expected props.\n *\n * @template TTag - The tag associated with the props. Can be a string, symbol\n * or a component function.\n */\nexport type TagProps<TTag extends Tag> = TTag extends string\n\t? JSX.IntrinsicElements[TTag]\n\t: TTag extends Component<infer TProps>\n\t\t? TProps & JSX.IntrinsicAttributes\n\t\t: Record<string, unknown> & JSX.IntrinsicAttributes;\n\n/**\n * Describes all valid values of an element tree, excluding iterables.\n *\n * Arbitrary objects can also be safely rendered, but will be converted to a\n * string using the toString() method. We exclude them from this type to catch\n * potential mistakes.\n */\nexport type Child = Element | string | number | boolean | null | undefined;\n\n/**\n * An arbitrarily nested iterable of Child values.\n *\n * We use a recursive interface here rather than making the Children type\n * directly recursive because recursive type aliases were added in TypeScript\n * 3.7.\n *\n * You should avoid referencing this type directly, as it is mainly exported to\n * prevent TypeScript errors.\n */\nexport interface ChildIterable extends Iterable<Child | ChildIterable> {}\n\n/**\n * Describes all valid values for an element tree, including arbitrarily nested\n * iterables of such values.\n *\n * This type can be used to represent the type of the children prop for an\n * element or the return/yield type of a component.\n */\nexport type Children = Child | ChildIterable;\n\n/**\n * Represents all functions which can be used as a component.\n *\n * @template [TProps=*] - The expected props for the component.\n */\nexport type Component<TProps extends Record<string, unknown> = any> = (\n\tthis: Context<TProps>,\n\tprops: TProps,\n\tctx: Context<TProps>,\n) =>\n\t| Children\n\t| PromiseLike<Children>\n\t// The return type of iterators must include void because TypeScript will\n\t// infer generators which return implicitly as having a void return type.\n\t| Iterator<Children, Children | void, any>\n\t| AsyncIterator<Children, Children | void, any>;\n\n/*** SPECIAL TAGS ***/\n/**\n * A special tag for grouping multiple children within the same parent.\n *\n * All non-string iterables which appear in the element tree are implicitly\n * wrapped in a fragment element.\n *\n * This tag is just the empty string, and you can use the empty string in\n * createElement calls or transpiler options directly to avoid having to\n * reference this export.\n */\nexport const Fragment = \"\";\nexport type Fragment = typeof Fragment;\n\n// TODO: We assert the following symbol tags as Components because TypeScript\n// support for symbol tags in JSX doesn't exist yet.\n// https://github.com/microsoft/TypeScript/issues/38367\n\n/**\n * A special tag for rendering into a new root node via a root prop.\n *\n * This tag is useful for creating element trees with multiple roots, for\n * things like modals or tooltips.\n *\n * Renderer.prototype.render() implicitly wraps top-level in a Portal element\n * with the root set to the second argument passed in.\n */\nexport const Portal = Symbol.for(\"crank.Portal\") as unknown as Component<{\n\troot?: object;\n}> &\n\tsymbol;\nexport type Portal = typeof Portal;\n\n/**\n * A special tag which preserves whatever was previously rendered in the\n * element's position.\n *\n * Copy elements are useful for when you want to prevent a subtree from\n * rerendering as a performance optimization. Copy elements can also be keyed,\n * in which case the previously rendered keyed element will be copied.\n */\nexport const Copy = Symbol.for(\"crank.Copy\") as unknown as Component<{}> &\n\tsymbol;\nexport type Copy = typeof Copy;\n\n/**\n * A special tag for rendering text nodes.\n *\n * Strings in the element tree are implicitly wrapped in a Text element with\n * value set to the string.\n */\nexport const Text = Symbol.for(\"crank.Text\") as unknown as Component<{\n\tvalue: string;\n}> &\n\tsymbol;\nexport type Text = typeof Text;\n\n/** A special tag for injecting raw nodes or strings via a value prop. */\nexport const Raw = Symbol.for(\"crank.Raw\") as unknown as Component<{\n\tvalue: string | object;\n}> &\n\tsymbol;\nexport type Raw = typeof Raw;\n\n/**\n * A type to keep track of keys. Any value can be a key, though null and\n * undefined are ignored.\n */\ntype Key = unknown;\n\ntype ChildrenIteratorResult = IteratorResult<Children, Children | void>;\n\nconst ElementSymbol = Symbol.for(\"crank.Element\");\n\n// To maximize compatibility between Crank versions, starting with 0.2.0, any\n// changes to the Element properties will be considered a breaking change.\nexport interface Element<TTag extends Tag = Tag> {\n\t/**\n\t * @internal\n\t * A unique symbol to identify elements as elements across versions and\n\t * realms, and to protect against basic injection attacks.\n\t * https://overreacted.io/why-do-react-elements-have-typeof-property/\n\t *\n\t * This property is defined on the element prototype rather than per\n\t * instance, because it is the same for every Element.\n\t */\n\t$$typeof: typeof ElementSymbol;\n\n\t/**\n\t * The tag of the element. Can be a string, symbol or function.\n\t */\n\ttag: TTag;\n\n\t/**\n\t * An object containing the \"properties\" of an element. These correspond to\n\t * the attribute syntax from JSX.\n\t */\n\tprops: TagProps<TTag>;\n}\n\n/**\n * Elements are the basic building blocks of Crank applications. They are\n * JavaScript objects which are interpreted by special classes called renderers\n * to produce and manage stateful nodes.\n *\n * @template {Tag} [TTag=Tag] - The type of the tag of the element.\n *\n * @example\n * // specific element types\n * let div: Element<\"div\">;\n * let portal: Element<Portal>;\n * let myEl: Element<MyComponent>;\n *\n * // general element types\n * let host: Element<string | symbol>;\n * let component: Element<Component>;\n *\n * Typically, you use a helper function like createElement to create elements\n * rather than instatiating this class directly.\n */\nexport class Element<TTag extends Tag = Tag> {\n\tconstructor(tag: TTag, props: TagProps<TTag>) {\n\t\tthis.tag = tag;\n\t\tthis.props = props;\n\t}\n}\n\n// See Element interface\nElement.prototype.$$typeof = ElementSymbol;\n\nexport function isElement(value: any): value is Element {\n\treturn value != null && value.$$typeof === ElementSymbol;\n}\n\nconst DEPRECATED_PROP_PREFIXES = [\"crank-\", \"c-\", \"$\"];\n\nconst DEPRECATED_SPECIAL_PROP_BASES = [\"key\", \"ref\", \"static\", \"copy\"];\n/**\n * Creates an element with the specified tag, props and children.\n *\n * This function is usually used as a transpilation target for JSX transpilers,\n * but it can also be called directly. It additionally extracts special props so\n * they aren't accessible to renderer methods or components, and assigns the\n * children prop according to any additional arguments passed to the function.\n */\nexport function createElement<TTag extends Tag>(\n\ttag: TTag,\n\tprops?: TagProps<TTag> | null | undefined,\n\t...children: Array<unknown>\n): Element<TTag> {\n\tif (props == null) {\n\t\tprops = {} as TagProps<TTag>;\n\t}\n\n\tif (\"static\" in (props as TagProps<TTag>)) {\n\t\tconsole.error(`The \\`static\\` prop is deprecated. Use \\`copy\\` instead.`);\n\t\t(props as TagProps<TTag>)[\"copy\"] = (props as TagProps<TTag>)[\"static\"];\n\t\tdelete (props as any)[\"static\"];\n\t}\n\n\tfor (let i = 0; i < DEPRECATED_PROP_PREFIXES.length; i++) {\n\t\tconst propPrefix = DEPRECATED_PROP_PREFIXES[i];\n\t\tfor (let j = 0; j < DEPRECATED_SPECIAL_PROP_BASES.length; j++) {\n\t\t\tconst propBase = DEPRECATED_SPECIAL_PROP_BASES[j];\n\t\t\tconst deprecatedPropName = propPrefix + propBase;\n\t\t\tif (deprecatedPropName in (props as TagProps<TTag>)) {\n\t\t\t\tconst targetPropBase = propBase === \"static\" ? \"copy\" : propBase;\n\t\t\t\tconsole.error(\n\t\t\t\t\t`The \\`${deprecatedPropName}\\` prop is deprecated. Use \\`${targetPropBase}\\` instead.`,\n\t\t\t\t);\n\t\t\t\t(props as TagProps<TTag>)[targetPropBase] = (props as TagProps<TTag>)[\n\t\t\t\t\tdeprecatedPropName\n\t\t\t\t];\n\t\t\t\tdelete (props as any)[deprecatedPropName];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (children.length > 1) {\n\t\t(props as TagProps<TTag>).children = children;\n\t} else if (children.length === 1) {\n\t\t(props as TagProps<TTag>).children = children[0];\n\t}\n\n\treturn new Element(tag, props as TagProps<TTag>);\n}\n\n/** Clones a given element, shallowly copying the props object. */\nexport function cloneElement<TTag extends Tag>(\n\tel: Element<TTag>,\n): Element<TTag> {\n\tif (!isElement(el)) {\n\t\tthrow new TypeError(`Cannot clone non-element: ${String(el)}`);\n\t}\n\n\treturn new Element(el.tag, {...el.props});\n}\n\n/*** ELEMENT UTILITIES ***/\n\n// WHAT ARE WE DOING TO THE CHILDREN???\n/**\n * All values in the element tree are narrowed from the union in Child to\n * NarrowedChild during rendering, to simplify element diffing.\n */\ntype NarrowedChild = Element | string | undefined;\n\nfunction narrow(value: Children): NarrowedChild {\n\tif (typeof value === \"boolean\" || value == null) {\n\t\treturn;\n\t} else if (typeof value === \"string\" || isElement(value)) {\n\t\treturn value;\n\t} else if (typeof (value as any)[Symbol.iterator] === \"function\") {\n\t\treturn createElement(Fragment, null, value);\n\t}\n\n\treturn value.toString();\n}\n\n/**\n * A helper type which repesents all possible rendered values of an element.\n *\n * @template TNode - The type of node produced by the associated renderer.\n *\n * When asking the question, what is the \"value\" of a specific element, the\n * answer varies depending on the tag:\n *\n * For intrinsic elements, the value is the node created for the element, e.g.\n * the DOM node in the case of the DOMRenderer.\n *\n * For portals, the value is undefined, because a Portal element's root and\n * children are opaque to its parent.\n *\n * For component or fragment elements the value can be a node or an array of\n * nodes, depending on how many children they have.\n */\nexport type ElementValue<TNode> = Array<TNode> | TNode | undefined;\n\n/*** RETAINER FLAGS ***/\nconst DidDiff = 1 << 0;\nconst DidCommit = 1 << 1;\nconst IsCopied = 1 << 2;\nconst IsUpdating = 1 << 3;\nconst IsExecuting = 1 << 4;\nconst IsRefreshing = 1 << 5;\nconst IsScheduling = 1 << 6;\nconst IsSchedulingFallback = 1 << 7;\nconst IsUnmounted = 1 << 8;\n// TODO: Is this flag still necessary or can we use IsUnmounted?\nconst IsErrored = 1 << 9;\nconst IsResurrecting = 1 << 10;\n// TODO: Maybe we can get rid of IsSyncGen and IsAsyncGen\nconst IsSyncGen = 1 << 11;\nconst IsAsyncGen = 1 << 12;\nconst IsInForOfLoop = 1 << 13;\nconst IsInForAwaitOfLoop = 1 << 14;\nconst NeedsToYield = 1 << 15;\nconst PropsAvailable = 1 << 16;\n\nfunction getFlag(ret: Retainer<unknown>, flag: number): boolean {\n\treturn !!(ret.f & flag);\n}\n\nfunction setFlag(ret: Retainer<unknown>, flag: number, value = true): void {\n\tif (value) {\n\t\tret.f |= flag;\n\t} else {\n\t\tret.f &= ~flag;\n\t}\n}\n\n/**\n * @internal\n * Retainers are objects which act as the internal representation of elements,\n * mirroring the element tree.\n */\nclass Retainer<TNode, TScope = unknown> {\n\t/** A bitmask. See RETAINER FLAGS above. */\n\tdeclare f: number;\n\tdeclare el: Element;\n\tdeclare ctx: ContextState<TNode, TScope, any> | undefined;\n\tdeclare children:\n\t\t| Array<Retainer<TNode, TScope> | undefined>\n\t\t| Retainer<TNode, TScope>\n\t\t| undefined;\n\tdeclare fallback: Retainer<TNode, TScope> | undefined;\n\t// This is only assigned for host, text and raw elements.\n\tdeclare value: ElementValue<TNode> | undefined;\n\tdeclare scope: TScope | undefined;\n\t// This is only assigned for host and raw elements.\n\tdeclare oldProps: Record<string, any> | undefined;\n\tdeclare pendingDiff: Promise<undefined> | undefined;\n\tdeclare onNextDiff: Function | undefined;\n\tdeclare graveyard: Array<Retainer<TNode, TScope>> | undefined;\n\tdeclare lingerers:\n\t\t| Array<Set<Retainer<TNode, TScope>> | undefined>\n\t\t| undefined;\n\n\tconstructor(el: Element) {\n\t\tthis.f = 0;\n\t\tthis.el = el;\n\t\tthis.ctx = undefined;\n\t\tthis.children = undefined;\n\t\tthis.fallback = undefined;\n\t\tthis.value = undefined;\n\t\tthis.oldProps = undefined;\n\t\tthis.pendingDiff = undefined;\n\t\tthis.onNextDiff = undefined;\n\t\tthis.graveyard = undefined;\n\t\tthis.lingerers = undefined;\n\t}\n}\n\nfunction cloneRetainer<TNode, TScope>(\n\tret: Retainer<TNode, TScope>,\n): Retainer<TNode, TScope> {\n\tconst clone = new Retainer<TNode, TScope>(ret.el);\n\tclone.f = ret.f;\n\tclone.ctx = ret.ctx;\n\tclone.children = ret.children;\n\tclone.fallback = ret.fallback;\n\tclone.value = ret.value;\n\tclone.scope = ret.scope;\n\tclone.oldProps = ret.oldProps;\n\tclone.pendingDiff = ret.pendingDiff;\n\tclone.onNextDiff = ret.onNextDiff;\n\tclone.graveyard = ret.graveyard;\n\tclone.lingerers = ret.lingerers;\n\n\treturn clone;\n}\n\n/**\n * Finds the value of the element according to its type.\n *\n * @returns A node, an array of nodes or undefined.\n */\nfunction getValue<TNode>(\n\tret: Retainer<TNode>,\n\tisNested = false,\n\tindex?: number,\n): ElementValue<TNode> {\n\tif (getFlag(ret, IsScheduling) && isNested) {\n\t\treturn ret.fallback ? getValue(ret.fallback, isNested, index) : undefined;\n\t} else if (ret.fallback && !getFlag(ret, DidDiff)) {\n\t\treturn ret.fallback\n\t\t\t? getValue(ret.fallback, isNested, index)\n\t\t\t: ret.fallback;\n\t} else if (ret.el.tag === Portal) {\n\t\treturn;\n\t} else if (ret.el.tag === Fragment || typeof ret.el.tag === \"function\") {\n\t\tif (index != null && ret.ctx) {\n\t\t\tret.ctx.index = index;\n\t\t}\n\t\treturn unwrap(getChildValues(ret, index));\n\t}\n\n\treturn ret.value;\n}\n\n/**\n * Walks an element's children to find its child values.\n *\n * @param ret - The retainer whose child values we are reading.\n * @param startIndex - Starting index to thread through for context index updates.\n *\n * @returns An array of nodes.\n */\nfunction getChildValues<TNode>(\n\tret: Retainer<TNode>,\n\tstartIndex?: number,\n): Array<TNode> {\n\tconst values: Array<TNode> = [];\n\tconst lingerers = ret.lingerers;\n\tconst children = wrap(ret.children);\n\tlet currentIndex = startIndex;\n\n\tfor (let i = 0; i < children.length; i++) {\n\t\tif (lingerers != null && lingerers[i] != null) {\n\t\t\tconst rets = lingerers[i]!;\n\t\t\tfor (const ret of rets) {\n\t\t\t\tconst value = getValue(ret, true, currentIndex);\n\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\tfor (let j = 0; j < value.length; j++) {\n\t\t\t\t\t\tvalues.push(value[j]);\n\t\t\t\t\t}\n\t\t\t\t\tif (currentIndex != null) {\n\t\t\t\t\t\tcurrentIndex += value.length;\n\t\t\t\t\t}\n\t\t\t\t} else if (value) {\n\t\t\t\t\tvalues.push(value);\n\t\t\t\t\tif (currentIndex != null) {\n\t\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst child = children[i];\n\t\tif (child) {\n\t\t\tconst value = getValue(child, true, currentIndex);\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (let j = 0; j < value.length; j++) {\n\t\t\t\t\tvalues.push(value[j]);\n\t\t\t\t}\n\t\t\t\tif (currentIndex != null) {\n\t\t\t\t\tcurrentIndex += value.length;\n\t\t\t\t}\n\t\t\t} else if (value) {\n\t\t\t\tvalues.push(value);\n\t\t\t\tif (currentIndex != null) {\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (lingerers != null && lingerers.length > children.length) {\n\t\tfor (let i = children.length; i < lingerers.length; i++) {\n\t\t\tconst rets = lingerers[i];\n\t\t\tif (rets != null) {\n\t\t\t\tfor (const ret of rets) {\n\t\t\t\t\tconst value = getValue(ret, true, currentIndex);\n\t\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\t\tfor (let j = 0; j < value.length; j++) {\n\t\t\t\t\t\t\tvalues.push(value[j]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (currentIndex != null) {\n\t\t\t\t\t\t\tcurrentIndex += value.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (value) {\n\t\t\t\t\t\tvalues.push(value);\n\t\t\t\t\t\tif (currentIndex != null) {\n\t\t\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn values;\n}\n\nfunction stripSpecialProps(props: Record<string, any>): Record<string, any> {\n\tlet _: unknown;\n\tlet result: Record<string, any>;\n\t({key: _, ref: _, copy: _, hydrate: _, children: _, ...result} = props);\n\treturn result;\n}\n\n/**\n * Interface for adapting the rendering process to a specific target environment.\n *\n * The RenderAdapter defines how Crank elements are mapped to nodes in your target\n * rendering environment (DOM, Canvas, WebGL, Terminal, etc.). Each method handles\n * a specific part of the element lifecycle, from creation to removal.\n *\n * @template TNode - The type representing a node in your target environment\n * @template TScope - Additional context data passed down the component tree\n * @template TRoot - The type of the root container (defaults to TNode)\n * @template TResult - The type returned when reading element values (defaults to ElementValue<TNode>)\n *\n * @example\n * ```typescript\n * const adapter: RenderAdapter<MyNode, MyScope> = {\n * create: ({ tag, props }) => new MyNode(tag, props),\n * patch: ({ node, props }) => node.update(props),\n * arrange: ({ node, children }) => node.replaceChildren(children),\n * // ... other methods\n * };\n * ```\n */\nexport interface RenderAdapter<\n\tTNode,\n\tTScope,\n\tTRoot extends TNode | undefined = TNode,\n\tTResult = ElementValue<TNode>,\n> {\n\t/**\n\t * Creates a new node for the given element tag and props.\n\t *\n\t * This method is called when Crank encounters a new element that needs to be\n\t * rendered for the first time. You should create and return a node appropriate\n\t * for your target environment.\n\t *\n\t * @param data.tag - The element tag (e.g., \"div\", \"sprite\", or a symbol)\n\t * @param data.tagName - String representation of the tag for debugging\n\t * @param data.props - The element's props object\n\t * @param data.scope - Current scope context (can be undefined)\n\t * @returns A new node instance\n\t *\n\t * @example\n\t * ```typescript\n\t * create: ({ tag, props, scope }) => {\n\t * if (tag === \"sprite\") {\n\t * return new PIXI.Sprite(props.texture);\n\t * }\n\t * throw new Error(`Unknown tag: ${tag}`);\n\t * }\n\t * ```\n\t */\n\tcreate(data: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tprops: Record<string, any>;\n\t\tscope: TScope | undefined;\n\t}): TNode;\n\n\t/**\n\t * Adopts existing nodes during hydration.\n\t *\n\t * Called when hydrating server-rendered content or reusing existing nodes.\n\t * Should return an array of child nodes if the provided node matches the\n\t * expected tag, or undefined if hydration should fail.\n\t *\n\t * @param data.tag - The element tag being hydrated\n\t * @param data.tagName - String representation of the tag\n\t * @param data.props - The element's props\n\t * @param data.node - The existing node to potentially adopt\n\t * @param data.scope - Current scope context\n\t * @returns Array of child nodes to hydrate, or undefined if adoption fails\n\t *\n\t * @example\n\t * ```typescript\n\t * adopt: ({ tag, node }) => {\n\t * if (node && node.tagName.toLowerCase() === tag) {\n\t * return Array.from(node.children);\n\t * }\n\t * return undefined; // Hydration mismatch\n\t * }\n\t * ```\n\t */\n\tadopt(data: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tprops: Record<string, any>;\n\t\tnode: TNode | undefined;\n\t\tscope: TScope | undefined;\n\t}): Array<TNode> | undefined;\n\n\t/**\n\t * Creates or updates a text node.\n\t *\n\t * Called when rendering text content. Should create a new text node or\n\t * update an existing one with the provided value.\n\t *\n\t * @param data.value - The text content to render\n\t * @param data.scope - Current scope context\n\t * @param data.oldNode - Previous text node to potentially reuse\n\t * @param data.hydrationNodes - Nodes available during hydration\n\t * @returns A text node containing the given value\n\t *\n\t * @example\n\t * ```typescript\n\t * text: ({ value, oldNode }) => {\n\t * if (oldNode && oldNode.text !== value) {\n\t * oldNode.text = value;\n\t * return oldNode;\n\t * }\n\t * return new TextNode(value);\n\t * }\n\t * ```\n\t */\n\ttext(data: {\n\t\tvalue: string;\n\t\tscope: TScope | undefined;\n\t\toldNode: TNode | undefined;\n\t\thydrationNodes: Array<TNode> | undefined;\n\t}): TNode;\n\n\t/**\n\t * Computes scope context for child elements.\n\t *\n\t * Called to determine what scope context should be passed to child elements.\n\t * The scope can be used to pass rendering context like theme, coordinate systems,\n\t * or namespaces down the component tree.\n\t *\n\t * @param data.tag - The element tag\n\t * @param data.tagName - String representation of the tag\n\t * @param data.props - The element's props\n\t * @param data.scope - Current scope context\n\t * @returns New scope for children, or undefined to inherit current scope\n\t *\n\t * @example\n\t * ```typescript\n\t * scope: ({ tag, props, scope }) => {\n\t * if (tag === \"svg\") {\n\t * return { ...scope, namespace: \"http://www.w3.org/2000/svg\" };\n\t * }\n\t * return scope;\n\t * }\n\t * ```\n\t */\n\tscope(data: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tprops: Record<string, any>;\n\t\tscope: TScope | undefined;\n\t}): TScope | undefined;\n\n\t/**\n\t * Handles raw values (strings or nodes) that bypass normal element processing.\n\t *\n\t * Called when rendering Raw elements or other direct node insertions.\n\t * Should convert string values to appropriate nodes for your environment.\n\t *\n\t * @param data.value - Raw string or node value to render\n\t * @param data.scope - Current scope context\n\t * @param data.hydrationNodes - Nodes available during hydration\n\t * @returns ElementValue that can be handled by arrange()\n\t *\n\t * @example\n\t * ```typescript\n\t * raw: ({ value, scope }) => {\n\t * if (typeof value === \"string\") {\n\t * const container = new Container();\n\t * container.innerHTML = value;\n\t * return Array.from(container.children);\n\t * }\n\t * return value;\n\t * }\n\t * ```\n\t */\n\traw(data: {\n\t\tvalue: string | TNode;\n\t\tscope: TScope | undefined;\n\t\thydrationNodes: Array<TNode> | undefined;\n\t}): ElementValue<TNode>;\n\n\t/**\n\t * Updates a node's properties.\n\t *\n\t * Called when element props change. Should efficiently update only the\n\t * properties that have changed. This is where you implement prop-to-attribute\n\t * mapping, event listener binding, and other property synchronization.\n\t *\n\t * @param data.tag - The element tag\n\t * @param data.tagName - String representation of the tag\n\t * @param data.node - The node to update\n\t * @param data.props - New props object\n\t * @param data.oldProps - Previous props object (undefined for initial render)\n\t * @param data.scope - Current scope context\n\t * @param data.copyProps - Props to skip (used for copying between renderers)\n\t * @param data.isHydrating - Whether currently hydrating\n\t * @param data.quietProps - Props to not warn about during hydration\n\t *\n\t * @example\n\t * ```typescript\n\t * patch: ({ node, props, oldProps }) => {\n\t * for (const [key, value] of Object.entries(props)) {\n\t * if (oldProps?.[key] !== value) {\n\t * if (key.startsWith(\"on\")) {\n\t * node.addEventListener(key.slice(2), value);\n\t * } else {\n\t * node[key] = value;\n\t * }\n\t * }\n\t * }\n\t * }\n\t * ```\n\t */\n\tpatch(data: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tnode: TNode;\n\t\tprops: Record<string, any>;\n\t\toldProps: Record<string, any> | undefined;\n\t\tscope: TScope | undefined;\n\t\tcopyProps: Set<string> | undefined;\n\t\tisHydrating: boolean;\n\t\tquietProps: Set<string> | undefined;\n\t}): void;\n\n\t/**\n\t * Arranges child nodes within their parent.\n\t *\n\t * Called after child elements are rendered to organize them within their\n\t * parent node. Should efficiently insert, move, or remove child nodes to\n\t * match the provided children array.\n\t *\n\t * @param data.tag - The parent element tag\n\t * @param data.tagName - String representation of the tag\n\t * @param data.node - The parent node\n\t * @param data.props - The parent element's props\n\t * @param data.children - Array of child nodes in correct order\n\t * @param data.oldProps - Previous props (for reference)\n\t *\n\t * @example\n\t * ```typescript\n\t * arrange: ({ node, children }) => {\n\t * // Remove existing children\n\t * node.removeChildren();\n\t * // Add new children in order\n\t * for (const child of children) {\n\t * node.addChild(child);\n\t * }\n\t * }\n\t * ```\n\t */\n\tarrange(data: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tnode: TNode;\n\t\tprops: Record<string, any>;\n\t\tchildren: Array<TNode>;\n\t\toldProps: Record<string, any> | undefined;\n\t}): void;\n\n\t/**\n\t * Removes a node from its parent.\n\t *\n\t * Called when an element is being unmounted. Should clean up the node\n\t * and remove it from its parent if appropriate.\n\t *\n\t * @param data.node - The node to remove\n\t * @param data.parentNode - The parent node\n\t * @param data.isNested - Whether this is a nested removal (child of removed element)\n\t *\n\t * @example\n\t * ```typescript\n\t * remove: ({ node, parentNode, isNested }) => {\n\t * // Clean up event listeners, resources, etc.\n\t * node.cleanup?.();\n\t * // Remove from parent unless it's a nested removal\n\t * if (!isNested && parentNode.contains(node)) {\n\t * parentNode.removeChild(node);\n\t * }\n\t * }\n\t * ```\n\t */\n\tremove(data: {node: TNode; parentNode: TNode; isNested: boolean}): void;\n\n\t/**\n\t * Reads the final rendered value from an ElementValue.\n\t *\n\t * Called to extract the final result from rendered elements. This allows\n\t * you to transform the internal node representation into the public API\n\t * that users of your renderer will see.\n\t *\n\t * @param value - The ElementValue to read (array, single node, or undefined)\n\t * @returns The public representation of the rendered value\n\t *\n\t * @example\n\t * ```typescript\n\t * read: (value) => {\n\t * if (Array.isArray(value)) {\n\t * return value.map(node => node.publicAPI);\n\t * }\n\t * return value?.publicAPI;\n\t * }\n\t * ```\n\t */\n\tread(value: ElementValue<TNode>): TResult;\n\n\t/**\n\t * Performs final rendering to the root container.\n\t *\n\t * Called after the entire render cycle is complete. This is where you\n\t * trigger the actual rendering/presentation in your target environment\n\t * (e.g., calling render() on a canvas, flushing to the screen, etc.).\n\t *\n\t * @param root - The root container\n\t *\n\t * @example\n\t * ```typescript\n\t * finalize: (root) => {\n\t * // Trigger actual rendering\n\t * if (root instanceof PIXIApplication) {\n\t * root.render();\n\t * }\n\t * }\n\t * ```\n\t */\n\tfinalize(root: TRoot): void;\n}\n\nconst defaultAdapter: RenderAdapter<any, any, any, any> = {\n\tcreate() {\n\t\tthrow new Error(\"adapter must implement create\");\n\t},\n\tadopt() {\n\t\tthrow new Error(\"adapter must implement adopt() for hydration\");\n\t},\n\tscope: ({scope}) => scope,\n\tread: (value) => value,\n\ttext: ({value}) => value,\n\traw: ({value}) => value,\n\tpatch: NOOP,\n\tarrange: NOOP,\n\tremove: NOOP,\n\tfinalize: NOOP,\n};\n\n/**\n * An abstract class which is subclassed to render to different target\n * environments. Subclasses call super() with a custom RenderAdapter object.\n * This class is responsible for kicking off the rendering process and caching\n * previous trees by root.\n *\n * @template TNode - The type of the node for a rendering environment.\n * @template TScope - Data which is passed down the tree.\n * @template TRoot - The type of the root for a rendering environment.\n * @template TResult - The type of exposed values.\n */\nexport class Renderer<\n\tTNode extends object,\n\tTScope,\n\tTRoot extends TNode | undefined = TNode,\n\tTResult = ElementValue<TNode>,\n> {\n\t/**\n\t * @internal\n\t * A weakmap which stores element trees by root.\n\t */\n\tdeclare cache: WeakMap<object, Retainer<TNode, TScope>>;\n\tdeclare adapter: RenderAdapter<TNode, TScope, TRoot, TResult>;\n\tconstructor(adapter: Partial<RenderAdapter<TNode, TScope, TRoot, TResult>>) {\n\t\tthis.cache = new WeakMap();\n\t\tthis.adapter = {...defaultAdapter, ...adapter};\n\t}\n\n\t/**\n\t * Renders an element tree into a specific root.\n\t *\n\t * @param children - An element tree. Rendering null deletes cached renders.\n\t * @param root - The root to be rendered into. The renderer caches renders\n\t * per root.\n\t * @param bridge - An optional context that will be the ancestor context of\n\t * all elements in the tree. Useful for connecting different renderers so\n\t * that events/provisions/errors properly propagate. The context for a given\n\t * root must be the same between renders.\n\t *\n\t * @returns The result of rendering the children, or a possible promise of\n\t * the result if the element tree renders asynchronously.\n\t */\n\trender(\n\t\tchildren: Children,\n\t\troot?: TRoot | undefined,\n\t\tbridge?: Context | undefined,\n\t): Promise<TResult> | TResult {\n\t\tconst ret = getRootRetainer(this, bridge, {children, root});\n\t\treturn renderRoot(this.adapter, root, ret, children) as\n\t\t\t| Promise<TResult>\n\t\t\t| TResult;\n\t}\n\n\thydrate(\n\t\tchildren: Children,\n\t\troot: TRoot,\n\t\tbridge?: Context | undefined,\n\t): Promise<TResult> | TResult {\n\t\tconst ret = getRootRetainer(this, bridge, {\n\t\t\tchildren,\n\t\t\troot,\n\t\t\thydrate: true,\n\t\t});\n\t\treturn renderRoot(this.adapter, root, ret, children) as\n\t\t\t| Promise<TResult>\n\t\t\t| TResult;\n\t}\n}\n\n/*** PRIVATE RENDERER FUNCTIONS ***/\nfunction getRootRetainer<\n\tTNode extends object,\n\tTScope,\n\tTRoot extends TNode | undefined,\n>(\n\trenderer: Renderer<TNode, TScope, TRoot, unknown>,\n\tbridge: Context | undefined,\n\t{\n\t\tchildren,\n\t\troot,\n\t\thydrate,\n\t}: {\n\t\tchildren: Children;\n\t\troot: TRoot | undefined;\n\t\thydrate?: boolean;\n\t},\n): Retainer<TNode, TScope> {\n\tlet ret: Retainer<TNode, TScope> | undefined;\n\tconst bridgeCtx = bridge && bridge[_ContextState];\n\tif (typeof root === \"object\" && root !== null) {\n\t\tret = renderer.cache.get(root);\n\t}\n\n\tconst adapter = renderer.adapter;\n\tif (ret === undefined) {\n\t\tret = new Retainer(createElement(Portal, {children, root, hydrate}));\n\t\tret.value = root;\n\t\tret.ctx = bridgeCtx as ContextState<any, any> | undefined;\n\t\tret.scope = adapter.scope({\n\t\t\ttag: Portal,\n\t\t\ttagName: getTagName(Portal),\n\t\t\tprops: stripSpecialProps(ret.el.props),\n\t\t\tscope: undefined,\n\t\t});\n\t\t// remember that typeof null === \"object\"\n\t\tif (typeof root === \"object\" && root !== null && children != null) {\n\t\t\trenderer.cache.set(root, ret);\n\t\t}\n\t} else if (ret.ctx !== bridgeCtx) {\n\t\tthrow new Error(\n\t\t\t\"A previous call to render() was passed a different context\",\n\t\t);\n\t} else {\n\t\tret.el = createElement(Portal, {children, root, hydrate});\n\t\tif (typeof root === \"object\" && root !== null && children == null) {\n\t\t\trenderer.cache.delete(root);\n\t\t}\n\t}\n\n\treturn ret;\n}\n\nfunction renderRoot<TNode, TScope, TRoot extends TNode | undefined, TResult>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, TResult>,\n\troot: TRoot | undefined,\n\tret: Retainer<TNode, TScope>,\n\tchildren: Children,\n): Promise<TResult> | TResult {\n\tconst diff = diffChildren(\n\t\tadapter,\n\t\troot,\n\t\tret,\n\t\tret.ctx,\n\t\tret.scope,\n\t\tret,\n\t\tchildren,\n\t);\n\n\tconst schedulePromises: Array<PromiseLike<unknown>> = [];\n\tif (isPromiseLike(diff)) {\n\t\treturn diff.then(() => {\n\t\t\tcommit(\n\t\t\t\tadapter,\n\t\t\t\tret,\n\t\t\t\tret,\n\t\t\t\tret.ctx,\n\t\t\t\tret.scope,\n\t\t\t\t0,\n\t\t\t\tschedulePromises,\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\tif (schedulePromises.length > 0) {\n\t\t\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\t\t\tif (typeof root !== \"object\" || root === null) {\n\t\t\t\t\t\tunmount(adapter, ret, ret.ctx, ret, false);\n\t\t\t\t\t}\n\t\t\t\t\treturn adapter.read(unwrap(getChildValues(ret)));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (typeof root !== \"object\" || root === null) {\n\t\t\t\tunmount(adapter, ret, ret.ctx, ret, false);\n\t\t\t}\n\t\t\treturn adapter.read(unwrap(getChildValues(ret)));\n\t\t});\n\t}\n\n\tcommit(adapter, ret, ret, ret.ctx, ret.scope, 0, schedulePromises, undefined);\n\tif (schedulePromises.length > 0) {\n\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\tif (typeof root !== \"object\" || root === null) {\n\t\t\t\tunmount(adapter, ret, ret.ctx, ret, false);\n\t\t\t}\n\t\t\treturn adapter.read(unwrap(getChildValues(ret)));\n\t\t});\n\t}\n\n\tif (typeof root !== \"object\" || root === null) {\n\t\tunmount(adapter, ret, ret.ctx, ret, false);\n\t}\n\treturn adapter.read(unwrap(getChildValues(ret)));\n}\n\nfunction diffChildren<TNode, TScope, TRoot extends TNode | undefined, TResult>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, TResult>,\n\troot: TRoot | undefined,\n\thost: Retainer<TNode, TScope>,\n\tctx: ContextState<TNode, TScope, TRoot, TResult> | undefined,\n\tscope: TScope | undefined,\n\tparent: Retainer<TNode, TScope>,\n\tnewChildren: Children,\n): Promise<undefined> | undefined {\n\tconst oldRetained = wrap(parent.children);\n\tconst newRetained: typeof oldRetained = [];\n\tconst newChildren1 = arrayify(newChildren);\n\tconst diffs: Array<Promise<undefined> | undefined> = [];\n\tlet childrenByKey: Map<Key, Retainer<TNode, TScope>> | undefined;\n\tlet seenKeys: Set<Key> | undefined;\n\tlet isAsync = false;\n\tlet oi = 0;\n\tlet oldLength = oldRetained.length;\n\tlet graveyard: Array<Retainer<TNode, TScope>> | undefined;\n\tfor (let ni = 0, newLength = newChildren1.length; ni < newLength; ni++) {\n\t\t// length checks to prevent index out of bounds deoptimizations.\n\t\tlet ret = oi >= oldLength ? undefined : oldRetained[oi];\n\t\tlet child = narrow(newChildren1[ni]);\n\t\t{\n\t\t\t// aligning new children with old retainers\n\t\t\tlet oldKey = typeof ret === \"object\" ? ret.el.props.key : undefined;\n\t\t\tlet newKey = typeof child === \"object\" ? child.props.key : undefined;\n\t\t\tif (newKey !== undefined && seenKeys && seenKeys.has(newKey)) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`Duplicate key found in <${getTagName(parent.el.tag)}>`,\n\t\t\t\t\tnewKey,\n\t\t\t\t);\n\t\t\t\tchild = cloneElement(child as Element);\n\t\t\t\tnewKey = child.props.key = undefined;\n\t\t\t}\n\n\t\t\tif (oldKey === newKey) {\n\t\t\t\tif (childrenByKey !== undefined && newKey !== undefined) {\n\t\t\t\t\tchildrenByKey.delete(newKey);\n\t\t\t\t}\n\n\t\t\t\toi++;\n\t\t\t} else {\n\t\t\t\tchildrenByKey = childrenByKey || createChildrenByKey(oldRetained, oi);\n\t\t\t\tif (newKey === undefined) {\n\t\t\t\t\twhile (ret !== undefined && oldKey !== undefined) {\n\t\t\t\t\t\toi++;\n\t\t\t\t\t\tret = oldRetained[oi];\n\t\t\t\t\t\toldKey = typeof ret === \"object\" ? ret.el.props.key : undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\toi++;\n\t\t\t\t} else {\n\t\t\t\t\tret = childrenByKey.get(newKey);\n\t\t\t\t\tif (ret !== undefined) {\n\t\t\t\t\t\tchildrenByKey.delete(newKey);\n\t\t\t\t\t}\n\n\t\t\t\t\t(seenKeys = seenKeys || new Set()).add(newKey);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet diff: Promise<undefined> | undefined = undefined;\n\t\tif (typeof child === \"object\") {\n\t\t\tlet childCopied = false;\n\t\t\tif (child.tag === Copy) {\n\t\t\t\tchildCopied = true;\n\t\t\t} else if (\n\t\t\t\ttypeof ret === \"object\" &&\n\t\t\t\tret.el === child &&\n\t\t\t\tgetFlag(ret, DidCommit)\n\t\t\t) {\n\t\t\t\t// If the child is the same as the retained element, we skip\n\t\t\t\t// re-rendering.\n\t\t\t\tchildCopied = true;\n\t\t\t} else {\n\t\t\t\tif (ret && ret.el.tag === child.tag) {\n\t\t\t\t\tret.el = child;\n\t\t\t\t\tif (child.props.copy && typeof child.props.copy !== \"string\") {\n\t\t\t\t\t\tchildCopied = true;\n\t\t\t\t\t}\n\t\t\t\t} else if (ret) {\n\t\t\t\t\t// we do not need to add the retainer to the graveyard if it is the\n\t\t\t\t\t// fallback of another retainer\n\t\t\t\t\t// search for the tag in fallback chain\n\t\t\t\t\tlet candidateFound = false;\n\t\t\t\t\tfor (\n\t\t\t\t\t\tlet predecessor = ret, candidate = ret.fallback;\n\t\t\t\t\t\tcandidate;\n\t\t\t\t\t\tpredecessor = candidate, candidate = candidate.fallback\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (candidate.el.tag === child.tag) {\n\t\t\t\t\t\t\t// If we find a retainer in the fallback chain with the same tag,\n\t\t\t\t\t\t\t// we reuse it rather than creating a new retainer to preserve\n\t\t\t\t\t\t\t// state. This behavior is useful for when a Suspense component\n\t\t\t\t\t\t\t// re-renders and the children are re-rendered quickly.\n\t\t\t\t\t\t\tconst clone = cloneRetainer(candidate);\n\t\t\t\t\t\t\tsetFlag(clone, IsResurrecting);\n\t\t\t\t\t\t\tpredecessor.fallback = clone;\n\t\t\t\t\t\t\tconst fallback = ret;\n\t\t\t\t\t\t\tret = candidate;\n\t\t\t\t\t\t\tret.el = child;\n\t\t\t\t\t\t\tret.fallback = fallback;\n\t\t\t\t\t\t\tsetFlag(ret, DidDiff, false);\n\t\t\t\t\t\t\tcandidateFound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!candidateFound) {\n\t\t\t\t\t\tconst fallback = ret;\n\t\t\t\t\t\tret = new Retainer<TNode, TScope>(child);\n\t\t\t\t\t\tret.fallback = fallback;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tret = new Retainer<TNode, TScope>(child);\n\t\t\t\t}\n\n\t\t\t\tif (childCopied && getFlag(ret, DidCommit)) {\n\t\t\t\t\t// pass\n\t\t\t\t} else if (child.tag === Raw || child.tag === Text) {\n\t\t\t\t\t// pass\n\t\t\t\t} else if (child.tag === Fragment) {\n\t\t\t\t\tdiff = diffChildren(\n\t\t\t\t\t\tadapter,\n\t\t\t\t\t\troot,\n\t\t\t\t\t\thost,\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tscope,\n\t\t\t\t\t\tret,\n\t\t\t\t\t\tret.el.props.children as Children,\n\t\t\t\t\t);\n\t\t\t\t} else if (typeof child.tag === \"function\") {\n\t\t\t\t\tdiff = diffComponent(adapter, root, host, ctx, scope, ret);\n\t\t\t\t} else {\n\t\t\t\t\tdiff = diffHost(adapter, root, ctx, scope, ret);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof ret === \"object\") {\n\t\t\t\tif (childCopied) {\n\t\t\t\t\tsetFlag(ret, IsCopied);\n\t\t\t\t\tdiff = getInflightDiff(ret);\n\t\t\t\t} else {\n\t\t\t\t\tsetFlag(ret, IsCopied, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isPromiseLike(diff)) {\n\t\t\t\tisAsync = true;\n\t\t\t}\n\t\t} else if (typeof child === \"string\") {\n\t\t\tif (typeof ret === \"object\" && ret.el.tag === Text) {\n\t\t\t\tret.el.props.value = child;\n\t\t\t} else {\n\t\t\t\tif (typeof ret === \"object\") {\n\t\t\t\t\t(graveyard = graveyard || []).push(ret);\n\t\t\t\t}\n\n\t\t\t\tret = new Retainer<TNode, TScope>(createElement(Text, {value: child}));\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof ret === \"object\") {\n\t\t\t\t(graveyard = graveyard || []).push(ret);\n\t\t\t}\n\n\t\t\tret = undefined;\n\t\t}\n\n\t\tdiffs[ni] = diff;\n\t\tnewRetained[ni] = ret;\n\t}\n\n\t// cleanup remaining retainers\n\tfor (; oi < oldLength; oi++) {\n\t\tconst ret = oldRetained[oi];\n\t\tif (\n\t\t\ttypeof ret === \"object\" &&\n\t\t\t(typeof ret.el.props.key === \"undefined\" ||\n\t\t\t\t!seenKeys ||\n\t\t\t\t!seenKeys.has(ret.el.props.key))\n\t\t) {\n\t\t\t(graveyard = graveyard || []).push(ret);\n\t\t}\n\t}\n\n\tif (childrenByKey !== undefined && childrenByKey.size > 0) {\n\t\tgraveyard = graveyard || [];\n\t\tfor (const ret of childrenByKey.values()) {\n\t\t\tgraveyard.push(ret);\n\t\t}\n\t}\n\n\tparent.children = unwrap(newRetained);\n\tif (isAsync) {\n\t\tconst diffs1 = Promise.all(diffs)\n\t\t\t.then(() => undefined)\n\t\t\t.finally(() => {\n\t\t\t\tsetFlag(parent, DidDiff);\n\t\t\t\tif (graveyard) {\n\t\t\t\t\tif (parent.graveyard) {\n\t\t\t\t\t\tfor (let i = 0; i < graveyard.length; i++) {\n\t\t\t\t\t\t\tparent.graveyard.push(graveyard[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tparent.graveyard = graveyard;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\tlet onNextDiffs!: Function;\n\t\tconst diffs2 = (parent.pendingDiff = safeRace([\n\t\t\tdiffs1,\n\t\t\tnew Promise<any>((resolve) => (onNextDiffs = resolve)),\n\t\t]));\n\n\t\tif (parent.onNextDiff) {\n\t\t\tparent.onNextDiff(diffs2);\n\t\t}\n\n\t\tparent.onNextDiff = onNextDiffs;\n\t\treturn diffs2;\n\t} else {\n\t\tsetFlag(parent, DidDiff);\n\t\tif (graveyard) {\n\t\t\tif (parent.graveyard) {\n\t\t\t\tfor (let i = 0; i < graveyard.length; i++) {\n\t\t\t\t\tparent.graveyard.push(graveyard[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tparent.graveyard = graveyard;\n\t\t\t}\n\t\t}\n\n\t\tif (parent.onNextDiff) {\n\t\t\tparent.onNextDiff(diffs);\n\t\t\tparent.onNextDiff = undefined;\n\t\t}\n\n\t\tparent.pendingDiff = undefined;\n\t}\n}\n\nfunction getInflightDiff(\n\tret: Retainer<unknown>,\n): Promise<undefined> | undefined {\n\t// It is not enough to check pendingDiff because pendingDiff is the diff for\n\t// children, but not the diff of an async component retainer's current run.\n\t// For the latter we check ctx.inflight.\n\tif (ret.ctx && ret.ctx.inflight) {\n\t\treturn ret.ctx.inflight[1];\n\t} else if (ret.pendingDiff) {\n\t\treturn ret.pendingDiff;\n\t}\n}\n\nfunction createChildrenByKey<TNode, TScope>(\n\tchildren: Array<Retainer<TNode, TScope> | undefined>,\n\toffset: number,\n): Map<Key, Retainer<TNode, TScope>> {\n\tconst childrenByKey = new Map<Key, Retainer<TNode, TScope>>();\n\tfor (let i = offset; i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tif (\n\t\t\ttypeof child === \"object\" &&\n\t\t\ttypeof child.el.props.key !== \"undefined\"\n\t\t) {\n\t\t\tchildrenByKey.set(child.el.props.key, child);\n\t\t}\n\t}\n\n\treturn childrenByKey;\n}\n\nfunction diffHost<TNode, TScope, TRoot extends TNode | undefined>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, unknown>,\n\troot: TRoot,\n\tctx: ContextState<TNode, TScope, TRoot> | undefined,\n\tscope: TScope | undefined,\n\tret: Retainer<TNode, TScope>,\n): Promise<undefined> | undefined {\n\tconst el = ret.el;\n\tconst tag = el.tag as string | symbol;\n\tif (el.tag === Portal) {\n\t\troot = ret.value = el.props.root;\n\t}\n\n\tif (getFlag(ret, DidCommit)) {\n\t\tscope = ret.scope;\n\t} else {\n\t\tscope = ret.scope = adapter.scope({\n\t\t\ttag,\n\t\t\ttagName: getTagName(tag),\n\t\t\tprops: el.props,\n\t\t\tscope,\n\t\t});\n\t}\n\n\treturn diffChildren(\n\t\tadapter,\n\t\troot,\n\t\tret,\n\t\tctx,\n\t\tscope,\n\t\tret,\n\t\tret.el.props.children,\n\t);\n}\n\nfunction commit<TNode, TScope, TRoot extends TNode | undefined, TResult>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, TResult>,\n\thost: Retainer<TNode, TScope>,\n\tret: Retainer<TNode, TScope>,\n\tctx: ContextState<TNode, TScope, TRoot, TResult> | undefined,\n\tscope: TScope | undefined,\n\tindex: number,\n\tschedulePromises: Array<PromiseLike<unknown>>,\n\thydrationNodes: Array<TNode> | undefined,\n): ElementValue<TNode> {\n\tif (getFlag(ret, IsCopied) && getFlag(ret, DidCommit)) {\n\t\treturn getValue(ret);\n\t}\n\n\tconst el = ret.el;\n\tconst tag = el.tag;\n\tif (\n\t\ttypeof tag === \"function\" ||\n\t\ttag === Fragment ||\n\t\ttag === Portal ||\n\t\ttag === Raw ||\n\t\ttag === Text\n\t) {\n\t\tif (typeof el.props.copy === \"string\") {\n\t\t\tconsole.error(\n\t\t\t\t`String copy prop ignored for <${getTagName(tag)}>. Use booleans instead.`,\n\t\t\t);\n\t\t}\n\t\tif (typeof el.props.hydrate === \"string\") {\n\t\t\tconsole.error(\n\t\t\t\t`String hydrate prop ignored for <${getTagName(tag)}>. Use booleans instead.`,\n\t\t\t);\n\t\t}\n\t}\n\n\tlet value: ElementValue<TNode>;\n\tlet skippedHydrationNodes: Array<TNode> | undefined;\n\tif (\n\t\thydrationNodes &&\n\t\tel.props.hydrate != null &&\n\t\t!el.props.hydrate &&\n\t\ttypeof el.props.hydrate !== \"string\"\n\t) {\n\t\tskippedHydrationNodes = hydrationNodes;\n\t\thydrationNodes = undefined;\n\t}\n\n\tif (typeof tag === \"function\") {\n\t\tret.ctx!.index = index;\n\t\tvalue = commitComponent(ret.ctx!, schedulePromises, hydrationNodes);\n\t} else {\n\t\tif (tag === Fragment) {\n\t\t\tvalue = commitChildren(\n\t\t\t\tadapter,\n\t\t\t\thost,\n\t\t\t\tctx,\n\t\t\t\tscope,\n\t\t\t\tret,\n\t\t\t\tindex,\n\t\t\t\tschedulePromises,\n\t\t\t\thydrationNodes,\n\t\t\t);\n\t\t} else if (tag === Text) {\n\t\t\tvalue = commitText(\n\t\t\t\tadapter,\n\t\t\t\tret,\n\t\t\t\tel as Element<Text>,\n\t\t\t\tscope,\n\t\t\t\thydrationNodes,\n\t\t\t);\n\t\t} else if (tag === Raw) {\n\t\t\tvalue = commitRaw(adapter, host, ret, scope, hydrationNodes);\n\t\t} else {\n\t\t\tvalue = commitHost(adapter, ret, ctx, schedulePromises, hydrationNodes);\n\t\t}\n\n\t\tif (ret.fallback) {\n\t\t\tunmount(adapter, host, ctx, ret.fallback, false);\n\t\t\tret.fallback = undefined;\n\t\t}\n\t}\n\n\tif (skippedHydrationNodes) {\n\t\tskippedHydrationNodes.splice(0, wrap(value).length);\n\t}\n\n\tif (!getFlag(ret, DidCommit)) {\n\t\tsetFlag(ret, DidCommit);\n\t\tif (\n\t\t\ttypeof tag !== \"function\" &&\n\t\t\ttag !== Fragment &&\n\t\t\ttag !== Portal &&\n\t\t\ttypeof el.props.ref === \"function\"\n\t\t) {\n\t\t\tel.props.ref(adapter.read(value));\n\t\t}\n\t}\n\n\treturn value;\n}\n\nfunction commitChildren<\n\tTNode,\n\tTScope,\n\tTRoot extends TNode | undefined,\n\tTResult,\n>(\n\tadapter: RenderAdapter<TNode, unknown, TRoot, TResult>,\n\thost: Retainer<TNode, TScope>,\n\tctx: ContextState<TNode, TScope, TRoot, TResult> | undefined,\n\tscope: TScope | undefined,\n\tparent: Retainer<TNode, TScope>,\n\tindex: number,\n\tschedulePromises: Array<PromiseLike<unknown>>,\n\thydrationNodes: Array<TNode> | undefined,\n): Array<TNode> {\n\tlet values: Array<TNode> = [];\n\tfor (let i = 0, children = wrap(parent.children); i < children.length; i++) {\n\t\tlet child = children[i];\n\t\tlet schedulePromises1: Array<unknown> | undefined;\n\t\tlet isSchedulingFallback = false;\n\t\twhile (\n\t\t\tchild &&\n\t\t\t((!getFlag(child, DidDiff) && child.fallback) ||\n\t\t\t\tgetFlag(child, IsScheduling))\n\t\t) {\n\t\t\t// If the child is scheduling, it is a component retainer so ctx will be\n\t\t\t// defined.\n\t\t\tif (getFlag(child, IsScheduling) && child.ctx!.schedule) {\n\t\t\t\t(schedulePromises1 = schedulePromises1 || []).push(\n\t\t\t\t\tchild.ctx!.schedule.promise,\n\t\t\t\t);\n\t\t\t\tisSchedulingFallback = true;\n\t\t\t}\n\n\t\t\tif (!getFlag(child, DidDiff) && getFlag(child, DidCommit)) {\n\t\t\t\t// If this child has not diffed but has committed, it means it is a\n\t\t\t\t// fallback that is being resurrected.\n\t\t\t\tfor (const node of getChildValues(child)) {\n\t\t\t\t\tadapter.remove({\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tparentNode: host.value as TNode,\n\t\t\t\t\t\tisNested: false,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchild = child.fallback;\n\t\t\t// When a scheduling component is mounting asynchronously but diffs\n\t\t\t// immediately, it will cause previous async diffs to settle due to the\n\t\t\t// chasing mechanism. This would cause earlier renders to resolve sooner\n\t\t\t// than expected, because the render would be missing both its usual\n\t\t\t// children and the children of the scheduling render. Therefore, we need\n\t\t\t// to defer the settling of previous renders until either that render\n\t\t\t// settles, or the scheduling component finally finishes scheduling.\n\t\t\t//\n\t\t\t// To do this, we take advantage of the fact that commits for aborted\n\t\t\t// renders will still fire and walk the tree. During that commit walk,\n\t\t\t// when we encounter a scheduling element, we push a race of the\n\t\t\t// scheduling promise with the inflight diff of the async fallback\n\t\t\t// fallback to schedulePromises to delay the initiator.\n\t\t\t//\n\t\t\t// However, we need to make sure we only use the inflight diffs for the\n\t\t\t// fallback which we are trying to delay, in the case of multiple renders\n\t\t\t// and fallbacks. To do this, we take advantage of the fact that when\n\t\t\t// multiple renders race (e.g., render1->render2->render3->scheduling\n\t\t\t// component), the chasing mechanism will call stale commits in reverse\n\t\t\t// order.\n\t\t\t//\n\t\t\t// We can use this ordering to delay to find which fallbacks we need to\n\t\t\t// add to the race. Each commit call progressively marks an additional\n\t\t\t// fallback as a scheduling fallback, and does not contribute to the\n\t\t\t// scheduling promises if it is further than the last seen level.\n\t\t\t//\n\t\t\t// This prevents promise contamination where newer renders settle early\n\t\t\t// due to diffs from older renders.\n\t\t\tif (schedulePromises1 && isSchedulingFallback && child) {\n\t\t\t\tif (!getFlag(child, DidDiff)) {\n\t\t\t\t\tconst inflightDiff = getInflightDiff(child);\n\t\t\t\t\tschedulePromises1.push(inflightDiff);\n\t\t\t\t} else {\n\t\t\t\t\t// If a scheduling component's fallback has already diffed, we do not\n\t\t\t\t\t// need delay the render.\n\t\t\t\t\tschedulePromises1 = undefined;\n\t\t\t\t}\n\n\t\t\t\tif (getFlag(child, IsSchedulingFallback)) {\n\t\t\t\t\t// This fallback was marked by a more recent commit - keep processing\n\t\t\t\t\t// deeper levels\n\t\t\t\t\tisSchedulingFallback = true;\n\t\t\t\t} else {\n\t\t\t\t\t// First unmarked fallback we've encountered - mark it and stop\n\t\t\t\t\t// contributing to schedulePromises1 for deeper levels.\n\t\t\t\t\tsetFlag(child, IsSchedulingFallback, true);\n\t\t\t\t\tisSchedulingFallback = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (schedulePromises1 && schedulePromises1.length > 1) {\n\t\t\tschedulePromises.push(safeRace(schedulePromises1));\n\t\t}\n\n\t\tif (child) {\n\t\t\tconst value = commit(\n\t\t\t\tadapter,\n\t\t\t\thost,\n\t\t\t\tchild,\n\t\t\t\tctx,\n\t\t\t\tscope,\n\t\t\t\tindex,\n\t\t\t\tschedulePromises,\n\t\t\t\thydrationNodes,\n\t\t\t);\n\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (let j = 0; j < value.length; j++) {\n\t\t\t\t\tvalues.push(value[j]);\n\t\t\t\t}\n\t\t\t\tindex += value.length;\n\t\t\t} else if (value) {\n\t\t\t\tvalues.push(value);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (parent.graveyard) {\n\t\tfor (let i = 0; i < parent.graveyard.length; i++) {\n\t\t\tconst child = parent.graveyard[i];\n\t\t\tunmount(adapter, host, ctx, child, false);\n\t\t}\n\n\t\tparent.graveyard = undefined;\n\t}\n\n\tif (parent.lingerers) {\n\t\t// if parent.lingerers is set, a descendant component is unmounting\n\t\t// asynchronously, so we overwrite values to include lingerering DOM nodes.\n\t\tvalues = getChildValues(parent);\n\t}\n\n\treturn values;\n}\n\nfunction commitText<TNode, TScope>(\n\tadapter: RenderAdapter<TNode, TScope, TNode | undefined, unknown>,\n\tret: Retainer<TNode, TScope>,\n\tel: Element<Text>,\n\tscope: TScope | undefined,\n\thydrationNodes: Array<TNode> | undefined,\n): TNode {\n\tconst value = adapter.text({\n\t\tvalue: el.props.value,\n\t\tscope,\n\t\toldNode: ret.value as TNode,\n\t\thydrationNodes,\n\t});\n\n\tret.value = value;\n\treturn value;\n}\n\nfunction commitRaw<TNode, TScope>(\n\tadapter: RenderAdapter<TNode, TScope, TNode | undefined, unknown>,\n\thost: Retainer<TNode>,\n\tret: Retainer<TNode>,\n\tscope: TScope | undefined,\n\thydrationNodes: Array<TNode> | undefined,\n): ElementValue<TNode> {\n\tif (!ret.oldProps || ret.oldProps.value !== ret.el.props.value) {\n\t\tconst oldNodes = wrap(ret.value);\n\t\tfor (let i = 0; i < oldNodes.length; i++) {\n\t\t\tconst oldNode = oldNodes[i];\n\t\t\tadapter.remove({\n\t\t\t\tnode: oldNode,\n\t\t\t\tparentNode: host.value as TNode,\n\t\t\t\tisNested: false,\n\t\t\t});\n\t\t}\n\t\tret.value = adapter.raw({\n\t\t\tvalue: ret.el.props.value as any,\n\t\t\tscope,\n\t\t\thydrationNodes,\n\t\t});\n\t}\n\n\tret.oldProps = stripSpecialProps(ret.el.props);\n\treturn ret.value;\n}\n\nfunction commitHost<TNode, TScope, TRoot extends TNode | undefined>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, unknown>,\n\tret: Retainer<TNode, TScope>,\n\tctx: ContextState<TNode, TScope, TRoot, unknown> | undefined,\n\tschedulePromises: Array<PromiseLike<unknown>>,\n\thydrationNodes: Array<TNode> | undefined,\n): ElementValue<TNode> {\n\tif (getFlag(ret, IsCopied) && getFlag(ret, DidCommit)) {\n\t\treturn getValue(ret);\n\t}\n\n\tconst tag = ret.el.tag as string | symbol;\n\tconst props = stripSpecialProps(ret.el.props);\n\tconst oldProps = ret.oldProps;\n\tlet node = ret.value as TNode;\n\n\tlet copyProps: Set<string> | undefined;\n\tlet copyChildren = false;\n\tif (oldProps) {\n\t\tfor (const propName in props) {\n\t\t\tif (props[propName] === Copy) {\n\t\t\t\t// The Copy tag can be used to skip the patching of a prop.\n\t\t\t\t// <div class={shouldPatchClass ? \"class-name\" : Copy} />\n\t\t\t\tprops[propName] = oldProps[propName];\n\t\t\t\t(copyProps = copyProps || new Set()).add(propName);\n\t\t\t}\n\t\t}\n\n\t\tif (typeof ret.el.props.copy === \"string\") {\n\t\t\tconst copyMetaProp = new MetaProp(\"copy\", ret.el.props.copy);\n\t\t\tif (copyMetaProp.include) {\n\t\t\t\tfor (const propName of copyMetaProp.props) {\n\t\t\t\t\tif (propName in oldProps) {\n\t\t\t\t\t\tprops[propName] = oldProps[propName];\n\t\t\t\t\t\t(copyProps = copyProps || new Set()).add(propName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const propName in oldProps) {\n\t\t\t\t\tif (!copyMetaProp.props.has(propName)) {\n\t\t\t\t\t\tprops[propName] = oldProps[propName];\n\t\t\t\t\t\t(copyProps = copyProps || new Set()).add(propName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcopyChildren = copyMetaProp.includes(\"children\");\n\t\t}\n\t}\n\n\tconst scope = ret.scope;\n\tlet childHydrationNodes: Array<TNode> | undefined;\n\tlet quietProps: Set<string> | undefined;\n\tlet hydrationMetaProp: MetaProp | undefined;\n\tif (!getFlag(ret, DidCommit)) {\n\t\tif (tag === Portal) {\n\t\t\tif (ret.el.props.hydrate && typeof ret.el.props.hydrate !== \"string\") {\n\t\t\t\tchildHydrationNodes = adapter.adopt({\n\t\t\t\t\ttag,\n\t\t\t\t\ttagName: getTagName(tag),\n\t\t\t\t\tnode,\n\t\t\t\t\tprops,\n\t\t\t\t\tscope,\n\t\t\t\t});\n\n\t\t\t\tif (childHydrationNodes) {\n\t\t\t\t\tfor (let i = 0; i < childHydrationNodes.length; i++) {\n\t\t\t\t\t\tadapter.remove({\n\t\t\t\t\t\t\tnode: childHydrationNodes[i],\n\t\t\t\t\t\t\tparentNode: node,\n\t\t\t\t\t\t\tisNested: false,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!node && hydrationNodes) {\n\t\t\t\tconst nextChild = hydrationNodes.shift();\n\t\t\t\tif (typeof ret.el.props.hydrate === \"string\") {\n\t\t\t\t\thydrationMetaProp = new MetaProp(\"hydration\", ret.el.props.hydrate);\n\t\t\t\t\tif (hydrationMetaProp.include) {\n\t\t\t\t\t\t// if we're in inclusive mode, we add all props to quietProps and\n\t\t\t\t\t\t// remove props specified in the metaprop\n\t\t\t\t\t\tquietProps = new Set(Object.keys(props));\n\t\t\t\t\t\tfor (const propName of hydrationMetaProp.props) {\n\t\t\t\t\t\t\tquietProps.delete(propName);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquietProps = hydrationMetaProp.props;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tchildHydrationNodes = adapter.adopt({\n\t\t\t\t\ttag,\n\t\t\t\t\ttagName: getTagName(tag),\n\t\t\t\t\tnode: nextChild!,\n\t\t\t\t\tprops,\n\t\t\t\t\tscope,\n\t\t\t\t});\n\n\t\t\t\tif (childHydrationNodes) {\n\t\t\t\t\tnode = nextChild!;\n\t\t\t\t\tfor (let i = 0; i < childHydrationNodes.length; i++) {\n\t\t\t\t\t\tadapter.remove({\n\t\t\t\t\t\t\tnode: childHydrationNodes[i],\n\t\t\t\t\t\t\tparentNode: node,\n\t\t\t\t\t\t\tisNested: false,\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\t// TODO: For some reason, there are cases where the node is already set\n\t\t\t// and the DidCommit flag is false. Not checking for node fails a test\n\t\t\t// where a child dispatches an event in a schedule callback, the parent\n\t\t\t// listens for this event and refreshes.\n\t\t\tif (!node) {\n\t\t\t\tnode = adapter.create({\n\t\t\t\t\ttag,\n\t\t\t\t\ttagName: getTagName(tag),\n\t\t\t\t\tprops,\n\t\t\t\t\tscope,\n\t\t\t\t});\n\t\t\t}\n\t\t\tret.value = node;\n\t\t}\n\t}\n\n\tif (tag !== Portal) {\n\t\tadapter.patch({\n\t\t\ttag,\n\t\t\ttagName: getTagName(tag),\n\t\t\tnode,\n\t\t\tprops,\n\t\t\toldProps,\n\t\t\tscope,\n\t\t\tcopyProps,\n\t\t\tisHydrating: !!childHydrationNodes,\n\t\t\tquietProps,\n\t\t});\n\t}\n\n\tif (!copyChildren) {\n\t\tconst children = commitChildren(\n\t\t\tadapter,\n\t\t\tret,\n\t\t\tctx,\n\t\t\tscope,\n\t\t\tret,\n\t\t\t0,\n\t\t\tschedulePromises,\n\t\t\thydrationMetaProp && !hydrationMetaProp.includes(\"children\")\n\t\t\t\t? undefined\n\t\t\t\t: childHydrationNodes,\n\t\t);\n\n\t\tadapter.arrange({\n\t\t\ttag,\n\t\t\ttagName: getTagName(tag),\n\t\t\tnode: node,\n\t\t\tprops,\n\t\t\tchildren,\n\t\t\toldProps,\n\t\t});\n\t}\n\n\tret.oldProps = props;\n\tif (tag === Portal) {\n\t\tflush(adapter, ret.value as TRoot);\n\t\t// The root passed to Portal elements are opaque to parents so we return\n\t\t// undefined here.\n\t\treturn;\n\t}\n\n\treturn node;\n}\n\nclass MetaProp {\n\tdeclare include: boolean;\n\tdeclare props: Set<string>;\n\n\tconstructor(propName: string, propValue: string) {\n\t\tthis.include = true;\n\t\tthis.props = new Set<string>();\n\t\tlet noBangs = true;\n\t\tlet allBangs = true;\n\t\tconst tokens = propValue.split(/[,\\s]+/);\n\t\tfor (let i = 0; i < tokens.length; i++) {\n\t\t\tconst token = tokens[i].trim();\n\t\t\tif (!token) {\n\t\t\t\tcontinue;\n\t\t\t} else if (token.startsWith(\"!\")) {\n\t\t\t\tnoBangs = false;\n\t\t\t\tthis.props.add(token.slice(1));\n\t\t\t} else {\n\t\t\t\tallBangs = false;\n\t\t\t\tthis.props.add(token);\n\t\t\t}\n\t\t}\n\n\t\tif (!allBangs && !noBangs) {\n\t\t\tconsole.error(\n\t\t\t\t`Invalid ${propName} prop \"${propValue}\".\\nUse prop or !prop but not both.`,\n\t\t\t);\n\t\t\tthis.include = true;\n\t\t\tthis.props.clear();\n\t\t} else {\n\t\t\tthis.include = noBangs;\n\t\t}\n\t}\n\n\tincludes(propName: string): boolean {\n\t\tif (this.include) {\n\t\t\treturn this.props.has(propName);\n\t\t} else {\n\t\t\treturn !this.props.has(propName);\n\t\t}\n\t}\n}\n\nfunction contextContains(parent: ContextState, child: ContextState): boolean {\n\tfor (\n\t\tlet current: ContextState | undefined = child;\n\t\tcurrent !== undefined;\n\t\tcurrent = current.parent\n\t) {\n\t\tif (current === parent) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n// When rendering is done without a root, we use this special anonymous root to\n// make sure after callbacks are still called.\nconst ANONYMOUS_ROOT: any = {};\nfunction flush<TRoot>(\n\tadapter: RenderAdapter<unknown, unknown, TRoot>,\n\troot: TRoot | undefined,\n\tinitiator?: ContextState,\n) {\n\tif (root != null) {\n\t\tadapter.finalize(root);\n\t}\n\n\tif (typeof root !== \"object\" || root === null) {\n\t\troot = ANONYMOUS_ROOT;\n\t}\n\n\t// The initiator is the context which initiated the rendering process. If\n\t// initiator is defined we call and clear all flush callbacks which are\n\t// registered with the initiator or with a child context of the initiator,\n\t// because they are fully rendered.\n\t//\n\t// If no initiator is provided, we can call and clear all flush callbacks\n\t// which are not scheduling.\n\tconst afterMap = afterMapByRoot.get(root as any);\n\tif (afterMap) {\n\t\tconst afterMap1 = new Map<ContextState, Set<Function>>();\n\t\tfor (const [ctx, callbacks] of afterMap) {\n\t\t\tif (\n\t\t\t\tgetFlag(ctx.ret, IsScheduling) ||\n\t\t\t\t(initiator && !contextContains(initiator, ctx))\n\t\t\t) {\n\t\t\t\t// copy over callbacks to the new map (defer them)\n\t\t\t\tafterMap.delete(ctx);\n\t\t\t\tafterMap1.set(ctx, callbacks);\n\t\t\t}\n\t\t}\n\n\t\tif (afterMap1.size) {\n\t\t\tafterMapByRoot.set(root as any, afterMap1);\n\t\t} else {\n\t\t\tafterMapByRoot.delete(root as any);\n\t\t}\n\n\t\tfor (const [ctx, callbacks] of afterMap) {\n\t\t\tconst value = adapter.read(getValue(ctx.ret));\n\t\t\tfor (const callback of callbacks) {\n\t\t\t\tcallback(value);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction unmount<TNode, TScope, TRoot extends TNode | undefined, TResult>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, TResult>,\n\thost: Retainer<TNode>,\n\tctx: ContextState<TNode, TScope, TRoot, TResult> | undefined,\n\tret: Retainer<TNode>,\n\tisNested: boolean,\n): void {\n\t// TODO: set the IsUnmounted flag consistently for all retainers\n\tif (ret.fallback) {\n\t\tunmount(adapter, host, ctx, ret.fallback, isNested);\n\t\tret.fallback = undefined;\n\t}\n\n\tif (getFlag(ret, IsResurrecting)) {\n\t\treturn;\n\t}\n\n\tif (ret.lingerers) {\n\t\tfor (let i = 0; i < ret.lingerers.length; i++) {\n\t\t\tconst lingerers = ret.lingerers[i];\n\t\t\tif (lingerers) {\n\t\t\t\tfor (const lingerer of lingerers) {\n\t\t\t\t\tunmount(adapter, host, ctx, lingerer, isNested);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tret.lingerers = undefined;\n\t}\n\n\tif (typeof ret.el.tag === \"function\") {\n\t\tunmountComponent(ret.ctx!, isNested);\n\t} else if (ret.el.tag === Fragment) {\n\t\tunmountChildren(adapter, host, ctx, ret, isNested);\n\t} else if (ret.el.tag === Portal) {\n\t\tunmountChildren(adapter, ret, ctx, ret, false);\n\t\tif (ret.value != null) {\n\t\t\tadapter.finalize(ret.value as TRoot);\n\t\t}\n\t} else {\n\t\tunmountChildren(adapter, ret, ctx, ret, true);\n\n\t\tif (getFlag(ret, DidCommit)) {\n\t\t\tif (ctx) {\n\t\t\t\t// Remove the value from every context which shares the same host.\n\t\t\t\tremoveEventTargetDelegates(\n\t\t\t\t\tctx.ctx,\n\t\t\t\t\t[ret.value],\n\t\t\t\t\t(ctx1) => ctx1[_ContextState].host === host,\n\t\t\t\t);\n\t\t\t}\n\t\t\tadapter.remove({\n\t\t\t\tnode: ret.value as TNode,\n\t\t\t\tparentNode: host.value as TNode,\n\t\t\t\tisNested,\n\t\t\t});\n\t\t}\n\t}\n}\n\nfunction unmountChildren<\n\tTNode,\n\tTScope,\n\tTRoot extends TNode | undefined,\n\tTResult,\n>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, TResult>,\n\thost: Retainer<TNode>,\n\tctx: ContextState<TNode, TScope, TRoot, TResult> | undefined,\n\tret: Retainer<TNode>,\n\tisNested: boolean,\n): void {\n\tif (ret.graveyard) {\n\t\tfor (let i = 0; i < ret.graveyard.length; i++) {\n\t\t\tconst child = ret.graveyard[i];\n\t\t\tunmount(adapter, host, ctx, child, isNested);\n\t\t}\n\n\t\tret.graveyard = undefined;\n\t}\n\n\tfor (let i = 0, children = wrap(ret.children); i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tif (typeof child === \"object\") {\n\t\t\tunmount(adapter, host, ctx, child, isNested);\n\t\t}\n\t}\n}\nconst provisionMaps = new WeakMap<ContextState, Map<unknown, unknown>>();\n\nconst scheduleMap = new WeakMap<ContextState, Set<Function>>();\n\nconst cleanupMap = new WeakMap<ContextState, Set<Function>>();\n\n// keys are roots\nconst afterMapByRoot = new WeakMap<object, Map<ContextState, Set<Function>>>();\n\ninterface PullController {\n\titerationP: Promise<ChildrenIteratorResult> | undefined;\n\tdiff: Promise<undefined> | undefined;\n\tonChildError: ((err: unknown) => void) | undefined;\n}\n\ninterface ScheduleController {\n\tpromise: Promise<unknown>;\n\tonAbort: () => void;\n}\n\n// TODO: allow ContextState to be initialized for testing purposes\n/**\n * @internal\n * The internal class which holds context data.\n */\nclass ContextState<\n\tTNode = unknown,\n\tTScope = unknown,\n\tTRoot extends TNode | undefined = TNode | undefined,\n\tTResult = unknown,\n> {\n\t/** The adapter of the renderer which created this context. */\n\tdeclare adapter: RenderAdapter<TNode, TScope, TRoot, TResult>;\n\n\t/** The root node as set by the nearest ancestor portal. */\n\tdeclare root: TRoot | undefined;\n\n\t/**\n\t * The nearest ancestor host or portal retainer.\n\t *\n\t * When refresh is called, the host element will be arranged as the last step\n\t * of the commit, to make sure the parent's children properly reflects the\n\t * components's childrenk\n\t */\n\tdeclare host: Retainer<TNode>;\n\n\t/** The parent context state. */\n\tdeclare parent: ContextState | undefined;\n\n\t/** The actual context associated with this state. */\n\tdeclare ctx: Context<unknown, TResult>;\n\n\t/** The value of the scope at the point of element's creation. */\n\tdeclare scope: TScope | undefined;\n\n\t/** The internal node associated with this context. */\n\tdeclare ret: Retainer<TNode>;\n\n\t/**\n\t * Any iterator returned by a component function.\n\t *\n\t * Existence of this property implies that the component is a generator\n\t * component. It is deleted when a component is returned.\n\t */\n\tdeclare iterator:\n\t\t| Iterator<Children, Children | void, unknown>\n\t\t| AsyncIterator<Children, Children | void, unknown>\n\t\t| undefined;\n\n\t// See runComponent() for a description of these properties.\n\tdeclare inflight: [Promise<undefined>, Promise<undefined>] | undefined;\n\tdeclare enqueued: [Promise<undefined>, Promise<undefined>] | undefined;\n\n\tdeclare pull: PullController | undefined;\n\n\t// The onPropsProvided callback is set when a component requests props via\n\t// the for await...of loop and props are not available. It is called when\n\t// the component is updated or refreshed.\n\tdeclare onPropsProvided: ((props: unknown) => unknown) | undefined;\n\t// The onPropsRequested callback is set when a component is updated or\n\t// refreshed but the new props are not consumed. It is called when the new\n\t// props are requested.\n\tdeclare onPropsRequested: (() => unknown) | undefined;\n\n\t// The last known index of the component's children, relative to its nearest\n\t// ancestor host or portal.\n\tdeclare index: number;\n\n\tdeclare schedule: ScheduleController | undefined;\n\n\tconstructor(\n\t\tadapter: RenderAdapter<TNode, TScope, TRoot, TResult>,\n\t\troot: TRoot,\n\t\thost: Retainer<TNode>,\n\t\tparent: ContextState | undefined,\n\t\tscope: TScope | undefined,\n\t\tret: Retainer<TNode>,\n\t) {\n\t\tthis.adapter = adapter;\n\t\tthis.root = root;\n\t\tthis.host = host;\n\t\tthis.parent = parent;\n\t\t// This property must be set after this.parent is set because the Context\n\t\t// constructor reads this.parent.\n\t\tthis.ctx = new Context(this);\n\t\tthis.scope = scope;\n\t\tthis.ret = ret;\n\n\t\tthis.iterator = undefined;\n\t\tthis.inflight = undefined;\n\t\tthis.enqueued = undefined;\n\n\t\tthis.onPropsProvided = undefined;\n\t\tthis.onPropsRequested = undefined;\n\n\t\tthis.pull = undefined;\n\t\tthis.index = 0;\n\t\tthis.schedule = undefined;\n\t}\n}\n\n// Public type that only extracts props from component functions\nexport type ComponentProps<T> = T extends () => unknown\n\t? {}\n\t: T extends (props: infer U) => unknown\n\t\t? U\n\t\t: never;\n\n// Public helper type that handles both component functions and regular objects\nexport type ComponentPropsOrProps<T> = T extends Function\n\t? ComponentProps<T>\n\t: T;\n\nconst _ContextState = Symbol.for(\"crank.ContextState\");\n\n/**\n * A class which is instantiated and passed to every component as its this\n * value/second parameter. Contexts form a tree just like elements and all\n * components in the element tree are connected via contexts. Components can\n * use this tree to communicate data upwards via events and downwards via\n * provisions.\n *\n * @template [T=*] - The expected shape of the props passed to the component,\n * or a component function. Used to strongly type the Context iterator methods.\n * @template [TResult=*] - The readable element value type. It is used in\n * places such as the return value of refresh and the argument passed to\n * schedule and cleanup callbacks.\n */\nexport class Context<\n\tT = any,\n\tTResult = any,\n> extends CustomEventTarget<Context> {\n\t/**\n\t * @internal\n\t * DO NOT USE READ THIS PROPERTY.\n\t */\n\tdeclare [_ContextState]: ContextState<unknown, unknown, unknown, TResult>;\n\n\t// TODO: If we could make the constructor function take a nicer value, it\n\t// would be useful for testing purposes.\n\tconstructor(state: ContextState<unknown, unknown, unknown, TResult>) {\n\t\tsuper(state.parent ? state.parent.ctx : null);\n\t\tthis[_ContextState] = state;\n\t}\n\n\t/**\n\t * The current props of the associated element.\n\t */\n\tget props(): ComponentPropsOrProps<T> {\n\t\treturn this[_ContextState].ret.el.props as ComponentPropsOrProps<T>;\n\t}\n\n\t/**\n\t * The current value of the associated element.\n\t *\n\t * @deprecated\n\t */\n\tget value(): TResult {\n\t\tconsole.warn(\"Context.value is deprecated.\");\n\t\treturn this[_ContextState].adapter.read(getValue(this[_ContextState].ret));\n\t}\n\n\tget isExecuting(): boolean {\n\t\treturn getFlag(this[_ContextState].ret, IsExecuting);\n\t}\n\n\tget isUnmounted(): boolean {\n\t\treturn getFlag(this[_ContextState].ret, IsUnmounted);\n\t}\n\n\t*[Symbol.iterator](): Generator<ComponentPropsOrProps<T>, undefined> {\n\t\tconst ctx = this[_ContextState];\n\t\tsetFlag(ctx.ret, IsInForOfLoop);\n\t\ttry {\n\t\t\twhile (!getFlag(ctx.ret, IsUnmounted) && !getFlag(ctx.ret, IsErrored)) {\n\t\t\t\tif (getFlag(ctx.ret, NeedsToYield)) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`<${getTagName(ctx.ret.el.tag)}> context iterated twice without a yield`,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tsetFlag(ctx.ret, NeedsToYield);\n\t\t\t\t}\n\n\t\t\t\tyield ctx.ret.el.props as ComponentPropsOrProps<T>;\n\t\t\t}\n\t\t} finally {\n\t\t\tsetFlag(ctx.ret, IsInForOfLoop, false);\n\t\t}\n\t}\n\n\tasync *[Symbol.asyncIterator](): AsyncGenerator<\n\t\tComponentPropsOrProps<T>,\n\t\tundefined\n\t> {\n\t\tconst ctx = this[_ContextState];\n\t\tsetFlag(ctx.ret, IsInForAwaitOfLoop);\n\t\ttry {\n\t\t\twhile (!getFlag(ctx.ret, IsUnmounted) && !getFlag(ctx.ret, IsErrored)) {\n\t\t\t\tif (getFlag(ctx.ret, NeedsToYield)) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`<${getTagName(ctx.ret.el.tag)}> context iterated twice without a yield`,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tsetFlag(ctx.ret, NeedsToYield);\n\t\t\t\t}\n\n\t\t\t\tif (getFlag(ctx.ret, PropsAvailable)) {\n\t\t\t\t\tsetFlag(ctx.ret, PropsAvailable, false);\n\t\t\t\t\tyield ctx.ret.el.props;\n\t\t\t\t} else {\n\t\t\t\t\tconst props = await new Promise<ComponentPropsOrProps<T>>(\n\t\t\t\t\t\t(resolve) =>\n\t\t\t\t\t\t\t(ctx.onPropsProvided = resolve as (props: unknown) => unknown),\n\t\t\t\t\t);\n\t\t\t\t\tif (getFlag(ctx.ret, IsUnmounted) || getFlag(ctx.ret, IsErrored)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tyield props;\n\t\t\t\t}\n\n\t\t\t\tif (ctx.onPropsRequested) {\n\t\t\t\t\tctx.onPropsRequested();\n\t\t\t\t\tctx.onPropsRequested = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tsetFlag(ctx.ret, IsInForAwaitOfLoop, false);\n\t\t\tif (ctx.onPropsRequested) {\n\t\t\t\tctx.onPropsRequested();\n\t\t\t\tctx.onPropsRequested = undefined;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Re-executes a component.\n\t *\n\t * @param callback - Optional callback to execute before refresh\n\t * @returns The rendered result of the component or a promise thereof if the\n\t * component or its children execute asynchronously.\n\t */\n\trefresh(callback?: () => unknown): Promise<TResult> | TResult {\n\t\tconst ctx = this[_ContextState];\n\t\tif (getFlag(ctx.ret, IsUnmounted)) {\n\t\t\tconsole.error(\n\t\t\t\t`Component <${getTagName(ctx.ret.el.tag)}> is unmounted. Check the isUnmounted property if necessary.`,\n\t\t\t);\n\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t} else if (getFlag(ctx.ret, IsExecuting)) {\n\t\t\tconsole.error(\n\t\t\t\t`Component <${getTagName(ctx.ret.el.tag)}> is already executing Check the isExecuting property if necessary.`,\n\t\t\t);\n\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t}\n\n\t\tif (callback) {\n\t\t\tconst result = callback();\n\t\t\tif (isPromiseLike(result)) {\n\t\t\t\treturn Promise.resolve(result).then(() => {\n\t\t\t\t\tif (!getFlag(ctx.ret, IsUnmounted)) {\n\t\t\t\t\t\treturn this.refresh();\n\t\t\t\t\t}\n\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tlet diff: Promise<undefined> | undefined;\n\t\tconst schedulePromises: Array<PromiseLike<unknown>> = [];\n\t\ttry {\n\t\t\tsetFlag(ctx.ret, IsRefreshing);\n\t\t\tdiff = enqueueComponent(ctx);\n\t\t\tif (isPromiseLike(diff)) {\n\t\t\t\treturn diff\n\t\t\t\t\t.then(() => ctx.adapter.read(commitComponent(ctx, schedulePromises)))\n\t\t\t\t\t.then((result) => {\n\t\t\t\t\t\tif (schedulePromises.length) {\n\t\t\t\t\t\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\t\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t})\n\t\t\t\t\t.catch((err) => {\n\t\t\t\t\t\tconst diff = propagateError(ctx, err, schedulePromises);\n\t\t\t\t\t\tif (diff) {\n\t\t\t\t\t\t\treturn diff.then(() => {\n\t\t\t\t\t\t\t\tif (schedulePromises.length) {\n\t\t\t\t\t\t\t\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\t\t\t\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (schedulePromises.length) {\n\t\t\t\t\t\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\t\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t\t})\n\t\t\t\t\t.finally(() => setFlag(ctx.ret, IsRefreshing, false));\n\t\t\t}\n\n\t\t\tconst result = ctx.adapter.read(commitComponent(ctx, schedulePromises));\n\t\t\tif (schedulePromises.length) {\n\t\t\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\t// TODO: await schedulePromises\n\t\t\tconst diff = propagateError(ctx, err, schedulePromises);\n\t\t\tif (diff) {\n\t\t\t\treturn diff\n\t\t\t\t\t.then(() => {\n\t\t\t\t\t\tif (schedulePromises.length) {\n\t\t\t\t\t\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\t\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\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\t.then(() => ctx.adapter.read(getValue(ctx.ret)));\n\t\t\t}\n\n\t\t\tif (schedulePromises.length) {\n\t\t\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t} finally {\n\t\t\tif (!isPromiseLike(diff)) {\n\t\t\t\tsetFlag(ctx.ret, IsRefreshing, false);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Registers a callback which fires when the component's children are\n\t * created. Will only fire once per callback and update.\n\t */\n\tschedule(): Promise<TResult>;\n\tschedule(callback: (value: TResult) => unknown): void;\n\tschedule(callback?: (value: TResult) => unknown): Promise<TResult> | void {\n\t\tif (!callback) {\n\t\t\treturn new Promise<TResult>((resolve) => this.schedule(resolve));\n\t\t}\n\n\t\tconst ctx = this[_ContextState];\n\t\tlet callbacks = scheduleMap.get(ctx);\n\t\tif (!callbacks) {\n\t\t\tcallbacks = new Set<Function>();\n\t\t\tscheduleMap.set(ctx, callbacks);\n\t\t}\n\n\t\tcallbacks.add(callback);\n\t}\n\n\t/**\n\t * Registers a callback which fires when the component's children are fully\n\t * rendered. Will only fire once per callback and update.\n\t */\n\tafter(): Promise<TResult>;\n\tafter(callback: (value: TResult) => unknown): void;\n\tafter(callback?: (value: TResult) => unknown): Promise<TResult> | void {\n\t\tif (!callback) {\n\t\t\treturn new Promise<TResult>((resolve) => this.after(resolve));\n\t\t}\n\t\tconst ctx = this[_ContextState];\n\t\tconst root = ctx.root || ANONYMOUS_ROOT;\n\t\tlet afterMap = afterMapByRoot.get(root);\n\t\tif (!afterMap) {\n\t\t\tafterMap = new Map<ContextState, Set<Function>>();\n\t\t\tafterMapByRoot.set(root, afterMap);\n\t\t}\n\n\t\tlet callbacks = afterMap.get(ctx);\n\t\tif (!callbacks) {\n\t\t\tcallbacks = new Set<Function>();\n\t\t\tafterMap.set(ctx, callbacks);\n\t\t}\n\n\t\tcallbacks.add(callback);\n\t}\n\n\t/**\n\t * @deprecated the flush() method has been renamed to after().\n\t */\n\tflush(): Promise<TResult>;\n\tflush(callback: (value: TResult) => unknown): void;\n\tflush(callback?: (value: TResult) => unknown): Promise<TResult> | void {\n\t\tconsole.error(\"Context.flush() method has been renamed to after()\");\n\t\tthis.after(callback!);\n\t}\n\n\t/**\n\t * Registers a callback which fires when the component unmounts.\n\t *\n\t * The callback can be async to defer the unmounting of a component's children.\n\t */\n\tcleanup(): Promise<TResult>;\n\tcleanup(callback: (value: TResult) => unknown): void;\n\tcleanup(callback?: (value: TResult) => unknown): Promise<TResult> | void {\n\t\tif (!callback) {\n\t\t\treturn new Promise<TResult>((resolve) => this.cleanup(resolve));\n\t\t}\n\t\tconst ctx = this[_ContextState];\n\n\t\tif (getFlag(ctx.ret, IsUnmounted)) {\n\t\t\tconst value = ctx.adapter.read(getValue(ctx.ret));\n\t\t\tcallback(value);\n\t\t\treturn;\n\t\t}\n\n\t\tlet callbacks = cleanupMap.get(ctx);\n\t\tif (!callbacks) {\n\t\t\tcallbacks = new Set<Function>();\n\t\t\tcleanupMap.set(ctx, callbacks);\n\t\t}\n\n\t\tcallbacks.add(callback);\n\t}\n\n\tconsume<TKey extends keyof ProvisionMap>(key: TKey): ProvisionMap[TKey];\n\tconsume(key: unknown): any;\n\tconsume(key: unknown): any {\n\t\tfor (\n\t\t\tlet ctx = this[_ContextState].parent;\n\t\t\tctx !== undefined;\n\t\t\tctx = ctx.parent\n\t\t) {\n\t\t\tconst provisions = provisionMaps.get(ctx);\n\t\t\tif (provisions && provisions.has(key)) {\n\t\t\t\treturn provisions.get(key)!;\n\t\t\t}\n\t\t}\n\t}\n\n\tprovide<TKey extends keyof ProvisionMap>(\n\t\tkey: TKey,\n\t\tvalue: ProvisionMap[TKey],\n\t): void;\n\tprovide(key: unknown, value: any): void;\n\tprovide(key: unknown, value: any): void {\n\t\tconst ctx = this[_ContextState];\n\t\tlet provisions = provisionMaps.get(ctx);\n\t\tif (!provisions) {\n\t\t\tprovisions = new Map();\n\t\t\tprovisionMaps.set(ctx, provisions);\n\t\t}\n\n\t\tprovisions.set(key, value);\n\t}\n\n\t[CustomEventTarget.dispatchEventOnSelf](ev: Event): void {\n\t\tconst ctx = this[_ContextState];\n\t\t// dispatchEvent calls the prop callback if it exists\n\t\tlet propCallback = ctx.ret.el.props[\"on\" + ev.type] as unknown;\n\t\tif (typeof propCallback === \"function\") {\n\t\t\tpropCallback(ev);\n\t\t} else {\n\t\t\tfor (const propName in ctx.ret.el.props) {\n\t\t\t\tif (propName.toLowerCase() === \"on\" + ev.type.toLowerCase()) {\n\t\t\t\t\tpropCallback = ctx.ret.el.props[propName] as unknown;\n\t\t\t\t\tif (typeof propCallback === \"function\") {\n\t\t\t\t\t\tpropCallback(ev);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction diffComponent<TNode, TScope, TRoot extends TNode | undefined, TResult>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, TResult>,\n\troot: TRoot | undefined,\n\thost: Retainer<TNode, TScope>,\n\tparent: ContextState | undefined,\n\tscope: TScope | undefined,\n\tret: Retainer<TNode>,\n): Promise<undefined> | undefined {\n\tlet ctx: ContextState<TNode>;\n\tif (ret.ctx) {\n\t\tctx = ret.ctx;\n\t\tif (getFlag(ctx.ret, IsExecuting)) {\n\t\t\tconsole.error(\n\t\t\t\t`Component <${getTagName(ctx.ret.el.tag)}> is already executing`,\n\t\t\t);\n\t\t\treturn;\n\t\t} else if (ctx.schedule) {\n\t\t\treturn ctx.schedule.promise.then(() => {\n\t\t\t\treturn diffComponent(adapter, root, host, parent, scope, ret);\n\t\t\t});\n\t\t}\n\t} else {\n\t\tctx = ret.ctx = new ContextState(adapter, root, host, parent, scope, ret);\n\t}\n\n\tsetFlag(ctx.ret, IsUpdating);\n\treturn enqueueComponent(ctx);\n}\n\nfunction diffComponentChildren<TNode, TResult>(\n\tctx: ContextState<TNode, unknown, TNode | undefined, TResult>,\n\tchildren: Children,\n\tisYield: boolean,\n): Promise<undefined> | undefined {\n\tif (getFlag(ctx.ret, IsUnmounted) || getFlag(ctx.ret, IsErrored)) {\n\t\treturn;\n\t} else if (children === undefined) {\n\t\tconsole.error(\n\t\t\t`Component <${getTagName(ctx.ret.el.tag)}> has ${isYield ? \"yielded\" : \"returned\"} undefined. If this was intentional, ${isYield ? \"yield\" : \"return\"} null instead.`,\n\t\t);\n\t}\n\n\tlet diff: Promise<undefined> | undefined;\n\ttry {\n\t\t// TODO: Use a different flag here to indicate the component is\n\t\t// synchronously rendering children\n\n\t\t// We set the isExecuting flag in case a child component dispatches an event\n\t\t// which bubbles to this component and causes a synchronous refresh().\n\t\tsetFlag(ctx.ret, IsExecuting);\n\t\tdiff = diffChildren(\n\t\t\tctx.adapter,\n\t\t\tctx.root,\n\t\t\tctx.host,\n\t\t\tctx,\n\t\t\tctx.scope,\n\t\t\tctx.ret,\n\t\t\tnarrow(children),\n\t\t);\n\t\tif (diff) {\n\t\t\tdiff = diff.catch((err) => handleChildError(ctx, err));\n\t\t}\n\t} catch (err) {\n\t\tdiff = handleChildError(ctx, err);\n\t} finally {\n\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t}\n\n\treturn diff;\n}\n\n/** Enqueues and executes the component associated with the context. */\nfunction enqueueComponent<TNode, TResult>(\n\tctx: ContextState<TNode, unknown, TNode | undefined, TResult>,\n): Promise<undefined> | undefined {\n\tif (!ctx.inflight) {\n\t\tconst [block, diff] = runComponent<TNode, TResult>(ctx);\n\t\tif (block) {\n\t\t\t// if block is a promise, diff is a promise\n\t\t\tctx.inflight = [block.finally(() => advanceComponent(ctx)), diff!];\n\t\t}\n\n\t\treturn diff;\n\t} else if (!ctx.enqueued) {\n\t\t// The enqueuedBlock and enqueuedDiff properties must be set\n\t\t// simultaneously, hence the usage of the Promise constructor.\n\t\tlet resolve: Function;\n\t\tctx.enqueued = [\n\t\t\tnew Promise<undefined>((resolve1) => (resolve = resolve1)).finally(() =>\n\t\t\t\tadvanceComponent(ctx),\n\t\t\t),\n\t\t\tctx.inflight[0]!.finally(() => {\n\t\t\t\tconst [block, diff] = runComponent<TNode, TResult>(ctx);\n\t\t\t\tresolve(block);\n\t\t\t\treturn diff;\n\t\t\t}),\n\t\t];\n\t}\n\n\treturn ctx.enqueued[1];\n}\n\n/** Called when the inflight block promise settles. */\nfunction advanceComponent(ctx: ContextState): void {\n\tctx.inflight = ctx.enqueued;\n\tctx.enqueued = undefined;\n}\n\n/**\n * This function is responsible for executing components, and handling the\n * different component types.\n *\n * @returns {[block, diff]} A tuple where:\n * - block is a promise or undefined which represents the duration during which\n * the component is blocked.\n * - diff is a promise or undefined which represents the duration for diffing\n * of children.\n *\n * While a component is blocked, further updates to the component are enqueued.\n *\n * Each component type blocks according to its implementation:\n * - Sync function components never block; when props or state change,\n * updates are immediately passed to children.\n * - Async function components block only while awaiting their own async work\n * (e.g., during an await), but do not block while their async children are rendering.\n * - Sync generator components block while their children are rendering;\n * they only resume once their children have finished.\n * - Async generator components can block in two different ways:\n * - By default, they behave like sync generator components, blocking while\n * the component or its children are rendering.\n * - Within a for await...of loop, they block only while waiting for new\n * props to be requested, and not while children are rendering.\n */\nfunction runComponent<TNode, TResult>(\n\tctx: ContextState<TNode, unknown, TNode | undefined, TResult>,\n): [Promise<undefined> | undefined, Promise<undefined> | undefined] {\n\tif (getFlag(ctx.ret, IsUnmounted)) {\n\t\treturn [undefined, undefined];\n\t}\n\n\tconst ret = ctx.ret;\n\tconst initial = !ctx.iterator;\n\tif (initial) {\n\t\tsetFlag(ctx.ret, IsExecuting);\n\t\tclearEventListeners(ctx.ctx);\n\t\tlet returned: ReturnType<Component>;\n\t\ttry {\n\t\t\treturned = (ret.el.tag as Component).call(ctx.ctx, ret.el.props, ctx.ctx);\n\t\t} catch (err) {\n\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t}\n\n\t\tif (isIteratorLike(returned)) {\n\t\t\tctx.iterator = returned;\n\t\t} else if (!isPromiseLike(returned)) {\n\t\t\t// sync function component\n\t\t\treturn [\n\t\t\t\tundefined,\n\t\t\t\tdiffComponentChildren<TNode, TResult>(ctx, returned, false),\n\t\t\t];\n\t\t} else {\n\t\t\t// async function component\n\t\t\tconst returned1 =\n\t\t\t\treturned instanceof Promise ? returned : Promise.resolve(returned);\n\t\t\treturn [\n\t\t\t\treturned1.catch(NOOP),\n\t\t\t\treturned1.then(\n\t\t\t\t\t(returned) =>\n\t\t\t\t\t\tdiffComponentChildren<TNode, TResult>(ctx, returned, false),\n\t\t\t\t\t(err) => {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t];\n\t\t}\n\t}\n\n\tlet iteration!: Promise<ChildrenIteratorResult> | ChildrenIteratorResult;\n\tif (initial) {\n\t\ttry {\n\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\titeration = ctx.iterator!.next();\n\t\t} catch (err) {\n\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t}\n\n\t\tif (isPromiseLike(iteration)) {\n\t\t\tsetFlag(ctx.ret, IsAsyncGen);\n\t\t} else {\n\t\t\tsetFlag(ctx.ret, IsSyncGen);\n\t\t}\n\t}\n\n\tif (getFlag(ctx.ret, IsSyncGen)) {\n\t\t// sync generator component\n\t\tif (!initial) {\n\t\t\ttry {\n\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\tconst oldResult = ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\titeration = ctx.iterator!.next(oldResult);\n\t\t\t} catch (err) {\n\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\tthrow err;\n\t\t\t} finally {\n\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t}\n\t\t}\n\n\t\tif (isPromiseLike(iteration)) {\n\t\t\tthrow new Error(\"Mixed generator component\");\n\t\t}\n\n\t\tif (\n\t\t\tgetFlag(ctx.ret, IsInForOfLoop) &&\n\t\t\t!getFlag(ctx.ret, NeedsToYield) &&\n\t\t\t!getFlag(ctx.ret, IsUnmounted) &&\n\t\t\t!getFlag(ctx.ret, IsScheduling)\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t`Component <${getTagName(ctx.ret.el.tag)}> yielded/returned more than once in for...of loop`,\n\t\t\t);\n\t\t}\n\n\t\tsetFlag(ctx.ret, NeedsToYield, false);\n\t\tif (iteration.done) {\n\t\t\tsetFlag(ctx.ret, IsSyncGen, false);\n\t\t\tctx.iterator = undefined;\n\t\t}\n\n\t\tconst diff = diffComponentChildren<TNode, TResult>(\n\t\t\tctx,\n\t\t\titeration.value as Children,\n\t\t\t!iteration.done,\n\t\t);\n\t\tconst block = isPromiseLike(diff) ? diff.catch(NOOP) : undefined;\n\t\treturn [block, diff];\n\t} else {\n\t\tif (getFlag(ctx.ret, IsInForAwaitOfLoop)) {\n\t\t\t// initializes the async generator loop\n\t\t\tpullComponent(ctx, iteration);\n\t\t\tconst block = resumePropsAsyncIterator(ctx);\n\t\t\treturn [block, ctx.pull && ctx.pull.diff];\n\t\t} else {\n\t\t\t// We call resumePropsAsyncIterator in case the component exits the\n\t\t\t// for...of loop\n\t\t\tresumePropsAsyncIterator(ctx);\n\t\t\tif (!initial) {\n\t\t\t\ttry {\n\t\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\t\tconst oldResult = ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t\titeration = ctx.iterator!.next(oldResult);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\t\tthrow err;\n\t\t\t\t} finally {\n\t\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!isPromiseLike(iteration)) {\n\t\t\t\tthrow new Error(\"Mixed generator component\");\n\t\t\t}\n\n\t\t\tconst diff = iteration.then(\n\t\t\t\t(iteration) => {\n\t\t\t\t\tif (getFlag(ctx.ret, IsInForAwaitOfLoop)) {\n\t\t\t\t\t\t// We have entered a for await...of loop, so we start pulling\n\t\t\t\t\t\tpullComponent(ctx, iteration);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tgetFlag(ctx.ret, IsInForOfLoop) &&\n\t\t\t\t\t\t\t!getFlag(ctx.ret, NeedsToYield) &&\n\t\t\t\t\t\t\t!getFlag(ctx.ret, IsUnmounted) &&\n\t\t\t\t\t\t\t!getFlag(ctx.ret, IsScheduling)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\t`Component <${getTagName(ctx.ret.el.tag)}> yielded/returned more than once in for...of loop`,\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\tsetFlag(ctx.ret, NeedsToYield, false);\n\t\t\t\t\tif (iteration.done) {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsAsyncGen, false);\n\t\t\t\t\t\tctx.iterator = undefined;\n\t\t\t\t\t}\n\t\t\t\t\treturn diffComponentChildren<TNode, TResult>(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\t// Children can be void so we eliminate that here\n\t\t\t\t\t\titeration.value as Children,\n\t\t\t\t\t\t!iteration.done,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t(err) => {\n\t\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\t\tthrow err;\n\t\t\t\t},\n\t\t\t);\n\n\t\t\treturn [diff.catch(NOOP), diff];\n\t\t}\n\t}\n}\n\n/**\n * Called to resume the props async iterator for async generator components.\n *\n * @returns {Promise<undefined> | undefined} A possible promise which\n * represents the duration during which the component is blocked.\n */\nfunction resumePropsAsyncIterator(\n\tctx: ContextState,\n): Promise<undefined> | undefined {\n\tif (ctx.onPropsProvided) {\n\t\tctx.onPropsProvided(ctx.ret.el.props);\n\t\tctx.onPropsProvided = undefined;\n\t\tsetFlag(ctx.ret, PropsAvailable, false);\n\t} else {\n\t\tsetFlag(ctx.ret, PropsAvailable);\n\t\tif (getFlag(ctx.ret, IsInForAwaitOfLoop)) {\n\t\t\treturn new Promise<undefined>(\n\t\t\t\t(resolve) => (ctx.onPropsRequested = resolve as () => unknown),\n\t\t\t);\n\t\t}\n\t}\n\n\treturn (\n\t\tctx.pull && ctx.pull.iterationP && ctx.pull.iterationP.then(NOOP, NOOP)\n\t);\n}\n\n/**\n * The logic for pulling from async generator components when they are in a for\n * await...of loop is implemented here.\n *\n * It makes sense to group this logic in a single async loop to prevent race\n * conditions caused by calling next(), throw() and return() concurrently.\n */\nasync function pullComponent<TNode, TResult>(\n\tctx: ContextState<TNode, unknown, TNode, TResult>,\n\titerationP:\n\t\t| Promise<ChildrenIteratorResult>\n\t\t| ChildrenIteratorResult\n\t\t| undefined,\n): Promise<void> {\n\tif (!iterationP || ctx.pull) {\n\t\treturn;\n\t}\n\n\tctx.pull = {iterationP: undefined, diff: undefined, onChildError: undefined};\n\n\t// TODO: replace done with iteration\n\t//let iteration: ChildrenIteratorResult | undefined;\n\tlet done = false;\n\ttry {\n\t\tlet childError: any;\n\t\twhile (!done) {\n\t\t\tif (isPromiseLike(iterationP)) {\n\t\t\t\tctx.pull.iterationP = iterationP;\n\t\t\t}\n\n\t\t\tlet onDiff!: Function;\n\t\t\tctx.pull.diff = new Promise((resolve) => (onDiff = resolve)).then(\n\t\t\t\t(): undefined => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t!(getFlag(ctx.ret, IsUpdating) || getFlag(ctx.ret, IsRefreshing))\n\t\t\t\t\t) {\n\t\t\t\t\t\tcommitComponent(ctx, []);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t(err) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t!(getFlag(ctx.ret, IsUpdating) || getFlag(ctx.ret, IsRefreshing)) ||\n\t\t\t\t\t\t// TODO: is this flag necessary?\n\t\t\t\t\t\t!getFlag(ctx.ret, NeedsToYield)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn propagateError(ctx, err, []);\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow err;\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tlet iteration: ChildrenIteratorResult;\n\t\t\ttry {\n\t\t\t\titeration = await iterationP;\n\t\t\t} catch (err) {\n\t\t\t\tdone = true;\n\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\tsetFlag(ctx.ret, NeedsToYield, false);\n\t\t\t\tonDiff(Promise.reject(err));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// this must be set after iterationP is awaited\n\t\t\tlet oldResult: Promise<TResult>;\n\t\t\t{\n\t\t\t\t// The 'floating' flag tracks whether the promise passed to the generator\n\t\t\t\t// is handled (via await, then, or catch). If handled, we reject the\n\t\t\t\t// promise so the user can catch errors. If not, we inject the error back\n\t\t\t\t// into the generator using throw, like for sync generator components.\n\t\t\t\tlet floating = true;\n\t\t\t\tconst oldResult1 = new Promise<TResult>((resolve, reject) => {\n\t\t\t\t\tctx.ctx.schedule(resolve);\n\t\t\t\t\tctx.pull!.onChildError = (err: any) => {\n\t\t\t\t\t\treject(err);\n\t\t\t\t\t\tif (floating) {\n\t\t\t\t\t\t\tchildError = err;\n\t\t\t\t\t\t\tresumePropsAsyncIterator(ctx);\n\t\t\t\t\t\t\treturn ctx.pull!.diff;\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\toldResult1.catch(NOOP);\n\t\t\t\t// We use Object.create() to clone the promise for float detection\n\t\t\t\t// because modern JS engines skip calling .then() on promises awaited\n\t\t\t\t// with await.\n\t\t\t\toldResult = Object.create(oldResult1);\n\t\t\t\toldResult.then = function (\n\t\t\t\t\tonfulfilled?: ((value: TResult) => any) | null,\n\t\t\t\t\tonrejected?: ((reason: any) => any) | null,\n\t\t\t\t): Promise<any> {\n\t\t\t\t\tfloating = false;\n\t\t\t\t\treturn oldResult1.then(onfulfilled, onrejected);\n\t\t\t\t};\n\n\t\t\t\toldResult.catch = function (\n\t\t\t\t\tonrejected?: ((reason: any) => any) | null,\n\t\t\t\t): Promise<any> {\n\t\t\t\t\tfloating = false;\n\t\t\t\t\treturn oldResult1.catch(onrejected);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (childError != null) {\n\t\t\t\ttry {\n\t\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\t\tif (typeof ctx.iterator!.throw !== \"function\") {\n\t\t\t\t\t\tthrow childError;\n\t\t\t\t\t}\n\t\t\t\t\titeration = await ctx.iterator!.throw(childError);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tdone = true;\n\t\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\t\tsetFlag(ctx.ret, NeedsToYield, false);\n\t\t\t\t\tonDiff(Promise.reject(err));\n\t\t\t\t\tbreak;\n\t\t\t\t} finally {\n\t\t\t\t\tchildError = undefined;\n\t\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// this makes sure we pause before entering a loop if we yield before it\n\t\t\tif (!getFlag(ctx.ret, IsInForAwaitOfLoop)) {\n\t\t\t\tsetFlag(ctx.ret, PropsAvailable, false);\n\t\t\t}\n\n\t\t\tdone = !!iteration.done;\n\n\t\t\tlet diff: Promise<undefined> | undefined;\n\t\t\ttry {\n\t\t\t\tif (!isPromiseLike(iterationP)) {\n\t\t\t\t\t// if iterationP is an iteration and not a promise, the component was\n\t\t\t\t\t// not in a for await...of loop when the iteration started, so we can\n\t\t\t\t\t// skip the diffing of children as it is handled elsewhere.\n\t\t\t\t\tdiff = undefined;\n\t\t\t\t} else if (\n\t\t\t\t\t!getFlag(ctx.ret, NeedsToYield) &&\n\t\t\t\t\tgetFlag(ctx.ret, PropsAvailable) &&\n\t\t\t\t\tgetFlag(ctx.ret, IsInForAwaitOfLoop)\n\t\t\t\t) {\n\t\t\t\t\t// logic to skip yielded children in a stale for await of iteration.\n\t\t\t\t\tdiff = undefined;\n\t\t\t\t} else {\n\t\t\t\t\tdiff = diffComponentChildren<TNode, TResult>(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\titeration.value!,\n\t\t\t\t\t\t!iteration.done,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tonDiff(Promise.reject(err));\n\t\t\t} finally {\n\t\t\t\tonDiff(diff);\n\t\t\t\tsetFlag(ctx.ret, NeedsToYield, false);\n\t\t\t}\n\n\t\t\tif (getFlag(ctx.ret, IsUnmounted)) {\n\t\t\t\t// TODO: move this unmounted branch outside the loop\n\t\t\t\twhile (\n\t\t\t\t\t(!iteration || !iteration.done) &&\n\t\t\t\t\tctx.iterator &&\n\t\t\t\t\tgetFlag(ctx.ret, IsInForAwaitOfLoop)\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\t\t\titeration = await ctx.iterator.next(oldResult);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\t\t\t// we throw the error here to cause an unhandled rejection because\n\t\t\t\t\t\t// the promise returned from pullComponent is never awaited\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(!iteration || !iteration.done) &&\n\t\t\t\t\tctx.iterator &&\n\t\t\t\t\ttypeof ctx.iterator.return === \"function\"\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\t\t\tawait ctx.iterator.return();\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t} else if (!getFlag(ctx.ret, IsInForAwaitOfLoop)) {\n\t\t\t\t// we have exited the for...await of, so updates will be handled by the\n\t\t\t\t// regular runComponent/enqueueComponent logic.\n\t\t\t\tbreak;\n\t\t\t} else if (!iteration.done) {\n\t\t\t\ttry {\n\t\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\t\titerationP = ctx.iterator!.next(\n\t\t\t\t\t\toldResult,\n\t\t\t\t\t) as Promise<ChildrenIteratorResult>;\n\t\t\t\t} finally {\n\t\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tif (done) {\n\t\t\tsetFlag(ctx.ret, IsAsyncGen, false);\n\t\t\tctx.iterator = undefined;\n\t\t}\n\n\t\tctx.pull = undefined;\n\t}\n}\n\nfunction commitComponent<TNode>(\n\tctx: ContextState<TNode>,\n\tschedulePromises: Array<PromiseLike<unknown>>,\n\thydrationNodes?: Array<TNode> | undefined,\n): ElementValue<TNode> {\n\tif (ctx.schedule) {\n\t\tctx.schedule.promise.then(() => {\n\t\t\tcommitComponent(ctx, []);\n\t\t\tpropagateComponent(ctx);\n\t\t});\n\t\treturn getValue(ctx.ret);\n\t}\n\n\tconst wasScheduling = getFlag(ctx.ret, IsScheduling);\n\tconst values = commitChildren(\n\t\tctx.adapter,\n\t\tctx.host,\n\t\tctx,\n\t\tctx.scope,\n\t\tctx.ret,\n\t\tctx.index,\n\t\tschedulePromises,\n\t\thydrationNodes,\n\t);\n\n\tif (getFlag(ctx.ret, IsUnmounted)) {\n\t\treturn;\n\t}\n\n\taddEventTargetDelegates(ctx.ctx, values);\n\t// Execute schedule callbacks early to check for async deferral\n\tconst callbacks = scheduleMap.get(ctx);\n\tlet schedulePromises1: Array<PromiseLike<unknown>> | undefined;\n\tif (callbacks) {\n\t\tscheduleMap.delete(ctx);\n\t\t// TODO: think about error handling for schedule callbacks\n\t\tsetFlag(ctx.ret, IsScheduling);\n\t\tconst result = ctx.adapter.read(unwrap(values));\n\t\tfor (const callback of callbacks) {\n\t\t\tconst scheduleResult = callback(result);\n\t\t\tif (isPromiseLike(scheduleResult)) {\n\t\t\t\t(schedulePromises1 = schedulePromises1 || []).push(scheduleResult);\n\t\t\t}\n\t\t}\n\n\t\tif (schedulePromises1 && !getFlag(ctx.ret, DidCommit)) {\n\t\t\tconst scheduleCallbacksP = Promise.all(schedulePromises1).then(() => {\n\t\t\t\tsetFlag(ctx.ret, IsScheduling, false);\n\t\t\t\tpropagateComponent(ctx);\n\t\t\t\tif (ctx.ret.fallback) {\n\t\t\t\t\tunmount(ctx.adapter, ctx.host, ctx.parent, ctx.ret.fallback, false);\n\t\t\t\t}\n\n\t\t\t\tctx.ret.fallback = undefined;\n\t\t\t});\n\n\t\t\tlet onAbort!: () => void;\n\t\t\tconst scheduleP = safeRace([\n\t\t\t\tscheduleCallbacksP,\n\t\t\t\tnew Promise<void>((resolve) => (onAbort = resolve)),\n\t\t\t]).finally(() => {\n\t\t\t\tctx.schedule = undefined;\n\t\t\t});\n\n\t\t\tctx.schedule = {promise: scheduleP, onAbort};\n\t\t\tschedulePromises.push(scheduleP);\n\t\t} else {\n\t\t\tsetFlag(ctx.ret, IsScheduling, wasScheduling);\n\t\t}\n\t} else {\n\t\tsetFlag(ctx.ret, IsScheduling, wasScheduling);\n\t}\n\n\tif (!getFlag(ctx.ret, IsScheduling)) {\n\t\tif (!getFlag(ctx.ret, IsUpdating)) {\n\t\t\tpropagateComponent(ctx);\n\t\t}\n\n\t\tif (ctx.ret.fallback) {\n\t\t\tunmount(ctx.adapter, ctx.host, ctx.parent, ctx.ret.fallback, false);\n\t\t}\n\n\t\tctx.ret.fallback = undefined;\n\t\tsetFlag(ctx.ret, IsUpdating, false);\n\t}\n\n\tsetFlag(ctx.ret, DidCommit);\n\t// We always use getValue() instead of the unwrapping values because there\n\t// are various ways in which the values could have been updated, especially\n\t// if schedule callbacks call refresh() or async mounting is happening.\n\treturn getValue(ctx.ret, true);\n}\n\n/**\n * Propagates component changes up to ancestors when rendering starts from a\n * component via refresh() or multiple for await...of renders. This handles\n * event listeners and DOM arrangement that would normally happen during\n * top-down rendering.\n */\nfunction propagateComponent<TNode>(ctx: ContextState<TNode>): void {\n\tconst values = getChildValues(ctx.ret, ctx.index);\n\taddEventTargetDelegates(\n\t\tctx.ctx,\n\t\tvalues,\n\t\t(ctx1) => ctx1[_ContextState].host === ctx.host,\n\t);\n\tconst host = ctx.host;\n\tconst props = stripSpecialProps(host.el.props);\n\tctx.adapter.arrange({\n\t\ttag: host.el.tag as string | symbol,\n\t\ttagName: getTagName(host.el.tag),\n\t\tnode: host.value as TNode,\n\t\tprops,\n\t\toldProps: props,\n\t\tchildren: getChildValues(host, 0),\n\t});\n\n\tflush(ctx.adapter, ctx.root, ctx);\n}\n\nasync function unmountComponent(\n\tctx: ContextState,\n\tisNested: boolean,\n): Promise<undefined> {\n\tif (getFlag(ctx.ret, IsUnmounted)) {\n\t\treturn;\n\t}\n\n\tlet cleanupPromises: Array<PromiseLike<unknown>> | undefined;\n\t// TODO: think about errror handling for callbacks\n\tconst callbacks = cleanupMap.get(ctx);\n\tif (callbacks) {\n\t\tconst oldResult = ctx.adapter.read(getValue(ctx.ret));\n\t\tcleanupMap.delete(ctx);\n\t\tfor (const callback of callbacks) {\n\t\t\tconst cleanup = callback(oldResult);\n\t\t\tif (isPromiseLike(cleanup)) {\n\t\t\t\t(cleanupPromises = cleanupPromises || []).push(cleanup);\n\t\t\t}\n\t\t}\n\t}\n\n\tlet didLinger = false;\n\tif (!isNested && cleanupPromises && getChildValues(ctx.ret).length > 0) {\n\t\tdidLinger = true;\n\t\tconst index = ctx.index;\n\t\tconst lingerers = ctx.host.lingerers || (ctx.host.lingerers = []);\n\t\tlet set = lingerers[index];\n\t\tif (set == null) {\n\t\t\tset = new Set<Retainer<unknown>>();\n\t\t\tlingerers[index] = set;\n\t\t}\n\n\t\tset.add(ctx.ret);\n\t\tawait Promise.all(cleanupPromises);\n\t\tset!.delete(ctx.ret);\n\t\tif (set!.size === 0) {\n\t\t\tlingerers[index] = undefined;\n\t\t}\n\n\t\tif (!lingerers.some(Boolean)) {\n\t\t\t// If there are no lingerers remaining, we can remove the lingerers array\n\t\t\tctx.host.lingerers = undefined;\n\t\t}\n\t}\n\n\tif (getFlag(ctx.ret, IsUnmounted)) {\n\t\t// If the component was unmounted while awaiting the cleanup callbacks,\n\t\t// we do not need to continue unmounting.\n\t\treturn;\n\t}\n\n\tsetFlag(ctx.ret, IsUnmounted);\n\n\t// If component has pending schedule promises, resolve them since component\n\t// is unmounting\n\tif (ctx.schedule) {\n\t\tctx.schedule.onAbort();\n\t\tctx.schedule = undefined;\n\t}\n\n\tclearEventListeners(ctx.ctx);\n\tunmountChildren(ctx.adapter, ctx.host, ctx, ctx.ret, isNested);\n\tif (didLinger) {\n\t\t// If we lingered, we call finalize to ensure rendering is finalized\n\t\tif (ctx.root != null) {\n\t\t\tctx.adapter.finalize(ctx.root);\n\t\t}\n\t}\n\n\tif (ctx.iterator) {\n\t\tif (ctx.pull) {\n\t\t\t// we let pullComponent handle unmounting\n\t\t\tresumePropsAsyncIterator(ctx);\n\t\t\treturn;\n\t\t}\n\n\t\t// we wait for inflight value so yields resume with the most up to date\n\t\t// props\n\t\tif (ctx.inflight) {\n\t\t\tawait ctx.inflight[1];\n\t\t}\n\n\t\tlet iteration: ChildrenIteratorResult | undefined;\n\t\tif (getFlag(ctx.ret, IsInForOfLoop)) {\n\t\t\ttry {\n\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\tconst oldResult = ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\tconst iterationP = ctx.iterator!.next(oldResult);\n\t\t\t\tif (isPromiseLike(iterationP)) {\n\t\t\t\t\tif (!getFlag(ctx.ret, IsAsyncGen)) {\n\t\t\t\t\t\tthrow new Error(\"Mixed generator component\");\n\t\t\t\t\t}\n\n\t\t\t\t\titeration = await iterationP;\n\t\t\t\t} else {\n\t\t\t\t\tif (!getFlag(ctx.ret, IsSyncGen)) {\n\t\t\t\t\t\tthrow new Error(\"Mixed generator component\");\n\t\t\t\t\t}\n\n\t\t\t\t\titeration = iterationP;\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\tthrow err;\n\t\t\t} finally {\n\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t(!iteration || !iteration.done) &&\n\t\t\tctx.iterator &&\n\t\t\ttypeof ctx.iterator.return === \"function\"\n\t\t) {\n\t\t\ttry {\n\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\tconst iterationP = ctx.iterator.return();\n\t\t\t\tif (isPromiseLike(iterationP)) {\n\t\t\t\t\tif (!getFlag(ctx.ret, IsAsyncGen)) {\n\t\t\t\t\t\tthrow new Error(\"Mixed generator component\");\n\t\t\t\t\t}\n\n\t\t\t\t\titeration = await iterationP;\n\t\t\t\t} else {\n\t\t\t\t\tif (!getFlag(ctx.ret, IsSyncGen)) {\n\t\t\t\t\t\tthrow new Error(\"Mixed generator component\");\n\t\t\t\t\t}\n\n\t\t\t\t\titeration = iterationP;\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\tthrow err;\n\t\t\t} finally {\n\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/*** ERROR HANDLING UTILITIES ***/\nfunction handleChildError<TNode>(\n\tctx: ContextState<TNode, unknown, TNode>,\n\terr: unknown,\n): Promise<undefined> | undefined {\n\tif (!ctx.iterator) {\n\t\tthrow err;\n\t}\n\n\tif (ctx.pull) {\n\t\t// we let pullComponent handle child errors\n\t\tctx.pull.onChildError!(err);\n\t\treturn ctx.pull.diff;\n\t}\n\n\tif (!ctx.iterator.throw) {\n\t\tthrow err;\n\t}\n\n\tresumePropsAsyncIterator(ctx);\n\tlet iteration: ChildrenIteratorResult | Promise<ChildrenIteratorResult>;\n\ttry {\n\t\tsetFlag(ctx.ret, IsExecuting);\n\t\titeration = ctx.iterator.throw(err);\n\t} catch (err) {\n\t\tsetFlag(ctx.ret, IsErrored);\n\t\tthrow err;\n\t} finally {\n\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t}\n\n\tif (isPromiseLike(iteration)) {\n\t\treturn iteration.then(\n\t\t\t(iteration) => {\n\t\t\t\tif (iteration.done) {\n\t\t\t\t\tsetFlag(ctx.ret, IsSyncGen, false);\n\t\t\t\t\tsetFlag(ctx.ret, IsAsyncGen, false);\n\t\t\t\t\tctx.iterator = undefined;\n\t\t\t\t}\n\n\t\t\t\treturn diffComponentChildren(\n\t\t\t\t\tctx,\n\t\t\t\t\titeration.value as Children,\n\t\t\t\t\t!iteration.done,\n\t\t\t\t);\n\t\t\t},\n\t\t\t(err) => {\n\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\tthrow err;\n\t\t\t},\n\t\t);\n\t}\n\n\tif (iteration.done) {\n\t\tsetFlag(ctx.ret, IsSyncGen, false);\n\t\tsetFlag(ctx.ret, IsAsyncGen, false);\n\t\tctx.iterator = undefined;\n\t}\n\n\treturn diffComponentChildren(\n\t\tctx,\n\t\titeration.value as Children,\n\t\t!iteration.done,\n\t);\n}\n\n/**\n * Propagates an error up the context tree by calling handleChildError with\n * each parent.\n *\n * @returns A promise which resolves to undefined when the error has been\n * handled, or undefined if the error was handled synchronously.\n */\nfunction propagateError<TNode>(\n\tctx: ContextState<TNode>,\n\terr: unknown,\n\tschedulePromises: Array<PromiseLike<unknown>>,\n): Promise<undefined> | undefined {\n\tconst parent = ctx.parent;\n\tif (!parent) {\n\t\tthrow err;\n\t}\n\n\tlet diff: Promise<undefined> | undefined;\n\ttry {\n\t\tdiff = handleChildError(parent, err);\n\t} catch (err) {\n\t\treturn propagateError(parent, err, schedulePromises);\n\t}\n\n\tif (isPromiseLike(diff)) {\n\t\treturn diff.then(\n\t\t\t() => void commitComponent(parent, schedulePromises),\n\t\t\t(err) => propagateError(parent, err, schedulePromises),\n\t\t);\n\t}\n\n\tcommitComponent(parent, schedulePromises);\n}\n\n/**\n * An interface which can be extended to provide strongly typed provisions.\n * See Context.prototype.consume and Context.prototype.provide.\n */\nexport interface ProvisionMap extends Crank.ProvisionMap {}\n\nexport interface EventMap extends Crank.EventMap {}\n\ntype MappedEventListener<T extends string> = (ev: Crank.EventMap[T]) => unknown;\n\ntype MappedEventListenerOrEventListenerObject<T extends string> =\n\t| MappedEventListener<T>\n\t| {handleEvent: MappedEventListener<T>};\n\nexport interface Context extends Crank.Context {\n\taddEventListener<T extends string>(\n\t\ttype: T,\n\t\tlistener: MappedEventListenerOrEventListenerObject<T> | null,\n\t\toptions?: boolean | AddEventListenerOptions,\n\t): void;\n\n\tremoveEventListener<T extends string>(\n\t\ttype: T,\n\t\tlistener: MappedEventListenerOrEventListenerObject<T> | null,\n\t\toptions?: EventListenerOptions | boolean,\n\t): void;\n\n\tdispatchEvent<T extends string>(ev: EventMap[T] | Event): boolean;\n}\n\n// TODO: uncomment and use in the Element interface below\n// type CrankElement = Element;\ndeclare global {\n\tnamespace Crank {\n\t\texport interface EventMap {\n\t\t\t[tag: string]: Event;\n\t\t}\n\n\t\texport interface ProvisionMap {}\n\n\t\texport interface Context {}\n\t}\n\n\tnamespace JSX {\n\t\t// TODO: JSX Element type (the result of JSX expressions) don't work\n\t\t// because TypeScript demands that all Components return JSX elements for\n\t\t// some reason.\n\t\t// interface Element extends CrankElement {}\n\n\t\texport interface IntrinsicElements {\n\t\t\t[tag: string]: any;\n\t\t}\n\n\t\texport interface IntrinsicAttributes {\n\t\t\tchildren?: unknown;\n\t\t\tkey?: unknown;\n\t\t\tref?: unknown;\n\t\t\tcopy?: unknown;\n\t\t\thydrate?: unknown;\n\t\t}\n\n\t\texport interface ElementChildrenAttribute {\n\t\t\tchildren: {};\n\t\t}\n\t}\n}\n\n/**\n * A re-export of some Crank exports as the default export.\n *\n * Some JSX tools expect things like createElement/Fragment to be defined on\n * the default export. Prefer using the named exports directly.\n */\nexport default {createElement, Fragment};\n","/**\n * CSS utility functions for style property transformation.\n *\n * This module handles camelCase to kebab-case conversion and automatic\n * px unit conversion for numeric CSS values, making Crank more React-compatible.\n */\n\n/**\n * Converts camelCase CSS property names to kebab-case.\n * Handles vendor prefixes correctly (WebkitTransform -> -webkit-transform).\n */\nexport function camelToKebabCase(str: string): string {\n\t// Handle vendor prefixes that start with capital letters (WebkitTransform -> -webkit-transform)\n\tif (/^[A-Z]/.test(str)) {\n\t\treturn `-${str.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`).slice(1)}`;\n\t}\n\t// Handle normal camelCase (fontSize -> font-size)\n\treturn str.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n}\n\n/**\n * CSS properties that should remain unitless when given numeric values.\n * Based on React's list of unitless properties.\n */\nexport const UNITLESS_PROPERTIES = new Set([\n\t\"animation-iteration-count\",\n\t\"aspect-ratio\",\n\t\"border-image-outset\",\n\t\"border-image-slice\",\n\t\"border-image-width\",\n\t\"box-flex\",\n\t\"box-flex-group\",\n\t\"box-ordinal-group\",\n\t\"column-count\",\n\t\"columns\",\n\t\"flex\",\n\t\"flex-grow\",\n\t\"flex-positive\",\n\t\"flex-shrink\",\n\t\"flex-negative\",\n\t\"flex-order\",\n\t\"font-weight\",\n\t\"grid-area\",\n\t\"grid-column\",\n\t\"grid-column-end\",\n\t\"grid-column-span\",\n\t\"grid-column-start\",\n\t\"grid-row\",\n\t\"grid-row-end\",\n\t\"grid-row-span\",\n\t\"grid-row-start\",\n\t\"line-height\",\n\t\"opacity\",\n\t\"order\",\n\t\"orphans\",\n\t\"tab-size\",\n\t\"widows\",\n\t\"z-index\",\n\t\"zoom\",\n]);\n\n/**\n * Formats CSS property values, automatically adding \"px\" to numeric values\n * for properties that are not unitless.\n */\nexport function formatStyleValue(name: string, value: unknown): string {\n\tif (typeof value === \"number\") {\n\t\t// If the property should remain unitless, keep the number as-is\n\t\tif (UNITLESS_PROPERTIES.has(name)) {\n\t\t\treturn String(value);\n\t\t}\n\t\t// Otherwise, append \"px\" for numeric values\n\t\treturn `${value}px`;\n\t}\n\treturn String(value);\n}\n","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 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 if (\n\t\t\ttypeof window !== \"undefined\" &&\n\t\t\twindow.location &&\n\t\t\tnew URL(expectedValue, window.location.origin).href ===\n\t\t\t\tnew URL(actualValue, window.location.origin).href\n\t\t) {\n\t\t\t// attrs which are URLs will often be resolved to their full\n\t\t\t// href in the DOM, so we squash these errors\n\t\t} else {\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, Element>> = {\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}): 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}: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tscope: string | 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\treturn xmlns\n\t\t\t? document.createElementNS(xmlns, tag)\n\t\t\t: document.createElement(tag);\n\t},\n\n\tadopt({\n\t\ttag,\n\t\ttagName,\n\t\tnode,\n\t}: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tnode: 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\tif (\n\t\t\tnode === document.body ||\n\t\t\tnode === document.head ||\n\t\t\tnode === document.documentElement ||\n\t\t\tnode === document\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\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\tfor (const className in {...oldValue, ...value}) {\n\t\t\t\t\t\t\tconst classValue = value && value[className];\n\t\t\t\t\t\t\tif (classValue) {\n\t\t\t\t\t\t\t\telement.classList.add(className);\n\t\t\t\t\t\t\t\tif (hydratingClasses && hydratingClasses.has(className)) {\n\t\t\t\t\t\t\t\t\thydratingClasses.delete(className);\n\t\t\t\t\t\t\t\t} else if (isHydrating) {\n\t\t\t\t\t\t\t\t\tshouldIssueWarning = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\telement.classList.remove(className);\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\tif ((element as any)[name] !== value || 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}): 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}): 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}: {\n\t\tvalue: string;\n\t\thydrationNodes: Array<Node> | undefined;\n\t\toldNode: Node | undefined;\n\t}): Node {\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\tdocument.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 document.createTextNode(value);\n\t},\n\n\traw({\n\t\tvalue,\n\t\tscope: xmlns,\n\t\thydrationNodes,\n\t}: {\n\t\tvalue: string | Node;\n\t\tscope: string | undefined;\n\t\thydrationNodes: Array<Node> | undefined;\n\t}): ElementValue<Node> {\n\t\tlet nodes: Array<Node>;\n\t\tif (typeof value === \"string\") {\n\t\t\tconst el =\n\t\t\t\txmlns == null\n\t\t\t\t\t? document.createElement(\"div\")\n\t\t\t\t\t: xmlns === SVG_NAMESPACE\n\t\t\t\t\t\t? document.createElementNS(xmlns, \"svg\")\n\t\t\t\t\t\t: document.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","import {Portal, Renderer} from \"./crank.js\";\nimport type {ElementValue, RenderAdapter} from \"./crank.js\";\nimport {camelToKebabCase, formatStyleValue} from \"./_css.js\";\n\nconst voidTags = new Set([\n\t\"area\",\n\t\"base\",\n\t\"br\",\n\t\"col\",\n\t\"command\",\n\t\"embed\",\n\t\"hr\",\n\t\"img\",\n\t\"input\",\n\t\"keygen\",\n\t\"link\",\n\t\"meta\",\n\t\"param\",\n\t\"source\",\n\t\"track\",\n\t\"wbr\",\n]);\n\nfunction escape(text: string): string {\n\treturn text.replace(/[&<>\"']/g, (match) => {\n\t\tswitch (match) {\n\t\t\tcase \"&\":\n\t\t\t\treturn \"&amp;\";\n\t\t\tcase \"<\":\n\t\t\t\treturn \"&lt;\";\n\t\t\tcase \">\":\n\t\t\t\treturn \"&gt;\";\n\t\t\tcase '\"':\n\t\t\t\treturn \"&quot;\";\n\t\t\tcase \"'\":\n\t\t\t\treturn \"&#039;\";\n\t\t\tdefault:\n\t\t\t\treturn \"\";\n\t\t}\n\t});\n}\n\nfunction printStyleObject(style: Record<string, any>): string {\n\tconst cssStrings = [];\n\tfor (const [name, value] of Object.entries(style)) {\n\t\tif (value != null) {\n\t\t\tconst cssName = camelToKebabCase(name);\n\t\t\tconst cssValue = formatStyleValue(cssName, value);\n\t\t\tcssStrings.push(`${cssName}:${cssValue};`);\n\t\t}\n\t}\n\n\treturn cssStrings.join(\"\");\n}\n\nfunction printAttrs(props: Record<string, any>): string {\n\tconst attrs: string[] = [];\n\tfor (let [name, value] of Object.entries(props)) {\n\t\tif (name === \"innerHTML\" || name.startsWith(\"prop:\")) {\n\t\t\tcontinue;\n\t\t} else if (name === \"style\") {\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tattrs.push(`style=\"${escape(value)}\"`);\n\t\t\t} else if (typeof value === \"object\" && value !== null) {\n\t\t\t\tattrs.push(`style=\"${escape(printStyleObject(value))}\"`);\n\t\t\t}\n\t\t} else if (name === \"className\") {\n\t\t\tif (\"class\" in props || typeof value !== \"string\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tattrs.push(`class=\"${escape(value)}\"`);\n\t\t} else {\n\t\t\tif (name.startsWith(\"attr:\")) {\n\t\t\t\tname = name.slice(\"attr:\".length);\n\t\t\t}\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tattrs.push(`${escape(name)}=\"${escape(value)}\"`);\n\t\t\t} else if (typeof value === \"number\") {\n\t\t\t\tattrs.push(`${escape(name)}=\"${value}\"`);\n\t\t\t} else if (value === true) {\n\t\t\t\tattrs.push(`${escape(name)}`);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn attrs.join(\" \");\n}\n\ninterface Node {\n\tvalue?: string;\n}\n\nfunction join(children: Array<Node | string>): string {\n\tlet result = \"\";\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tresult += typeof child === \"string\" ? child : child.value;\n\t}\n\n\treturn result;\n}\n\nexport const impl: Partial<RenderAdapter<Node, undefined, Node, string>> = {\n\tcreate(): Node {\n\t\treturn {value: \"\"};\n\t},\n\n\ttext({value}: {value: string}): Node {\n\t\treturn {value: escape(value)};\n\t},\n\n\tread(value: ElementValue<Node>): string {\n\t\tif (Array.isArray(value)) {\n\t\t\treturn join(value);\n\t\t} else if (typeof value === \"undefined\") {\n\t\t\treturn \"\";\n\t\t} else if (typeof value === \"string\") {\n\t\t\treturn value;\n\t\t} else {\n\t\t\treturn value.value || \"\";\n\t\t}\n\t},\n\n\tarrange({\n\t\ttag,\n\t\ttagName,\n\t\tnode,\n\t\tprops,\n\t\tchildren,\n\t}: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tnode: Node;\n\t\tprops: Record<string, any>;\n\t\tchildren: Array<Node | string>;\n\t}): void {\n\t\tif (tag === Portal) {\n\t\t\treturn;\n\t\t} else if (typeof tag !== \"string\") {\n\t\t\tthrow new Error(`Unknown tag: ${tagName}`);\n\t\t}\n\n\t\tconst attrs = printAttrs(props);\n\t\tconst open = `<${tag}${attrs.length ? \" \" : \"\"}${attrs}>`;\n\t\tlet result: string;\n\t\tif (voidTags.has(tag)) {\n\t\t\tresult = open;\n\t\t} else {\n\t\t\tconst close = `</${tag}>`;\n\t\t\tconst contents =\n\t\t\t\t\"innerHTML\" in props ? props[\"innerHTML\"] : join(children);\n\t\t\tresult = `${open}${contents}${close}`;\n\t\t}\n\n\t\tnode.value = result;\n\t},\n};\n\nexport class HTMLRenderer extends Renderer<Node, undefined, any, string> {\n\tconstructor() {\n\t\tsuper(impl);\n\t}\n}\n\nexport const renderer = new HTMLRenderer();\n\ndeclare global {\n\tmodule Crank {\n\t\tinterface EventMap extends GlobalEventHandlersEventMap {}\n\t}\n}\n"],"names":["renderer"],"mappings":";;;;;;CAAA;CACA;CACA,MAAM,IAAI,GAAG,CAAC;CACd,MAAM,eAAe,GAAG,CAAC;CACzB,MAAM,SAAS,GAAG,CAAC;CACnB,MAAM,cAAc,GAAG,CAAC;CAElB,SAAU,aAAa,CAAC,KAAU,EAAA;KACvC,QACC,KAAK,IAAI,IAAI;CACb,QAAA,OAAO,KAAK,CAAC,gBAAgB,KAAK,UAAU;CAC5C,QAAA,OAAO,KAAK,CAAC,mBAAmB,KAAK,UAAU;CAC/C,QAAA,OAAO,KAAK,CAAC,aAAa,KAAK,UAAU;CAE3C;CAEA,SAAS,gBAAgB,CACxB,EAAS,EACT,GAAM,EACN,KAAe,EAAA;CAEf,IAAA,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,GAAG,EAAE,EAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC;CAC7E;CAEA,SAAS,0BAA0B,CAClC,KAAc,EAAA;CAEd,IAAA,QACC,OAAO,KAAK,KAAK,UAAU;UAC1B,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AAK,QAAQ,EAAE;CACnC,YAAA,MAAM,IAAI,KAAK,CAAC,gBAAgB,OAAO,CAAA,CAAE,CAAC;;CAG3C,QAAA,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;CAC/B,QAAA,MAAM,IAAI,GAAG,CAAA,CAAA,EAAI,GAAG,CAAG,EAAA,KAAK,CAAC,MAAM,GAAG,GAAG,GAAG,EAAE,CAAG,EAAA,KAAK,GAAG;CACzD,QAAA,IAAI,MAAc;CAClB,QAAA,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;aACtB,MAAM,GAAG,IAAI;;cACP;CACN,YAAA,MAAM,KAAK,GAAG,CAAK,EAAA,EAAA,GAAG,GAAG;CACzB,YAAA,MAAM,QAAQ,GACb,WAAW,IAAI,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;aAC3D,MAAM,GAAG,GAAG,IAAI,CAAA,EAAG,QAAQ,CAAG,EAAA,KAAK,EAAE;;CAGtC,QAAA,IAAI,CAAC,KAAK,GAAG,MAAM;MACnB;EACD;CAEK,MAAO,YAAa,SAAQ,QAAsC,CAAA;CACvE,IAAA,WAAA,GAAA;SACC,KAAK,CAAC,IAAI,CAAC;;CAEZ;CAEM,MAAM,QAAQ,GAAG,IAAI,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"umd.js","sources":["../src/event-target.ts","../src/_utils.ts","../src/crank.ts","../src/_css.ts","../src/dom.ts","../src/html.ts"],"sourcesContent":["// EVENT PHASE CONSTANTS\n// https://developer.mozilla.org/en-US/docs/Web/API/Event/eventPhase\nconst NONE = 0;\nconst CAPTURING_PHASE = 1;\nconst AT_TARGET = 2;\nconst BUBBLING_PHASE = 3;\n\nexport function isEventTarget(value: any): value is EventTarget {\n\treturn (\n\t\tvalue != null &&\n\t\ttypeof value.addEventListener === \"function\" &&\n\t\ttypeof value.removeEventListener === \"function\" &&\n\t\ttypeof value.dispatchEvent === \"function\"\n\t);\n}\n\nfunction setEventProperty<T extends keyof Event>(\n\tev: Event,\n\tkey: T,\n\tvalue: Event[T],\n): void {\n\tObject.defineProperty(ev, key, {value, writable: false, configurable: true});\n}\n\nfunction isListenerOrListenerObject(\n\tvalue: unknown,\n): value is EventListenerOrEventListenerObject {\n\treturn (\n\t\ttypeof value === \"function\" ||\n\t\t(value !== null &&\n\t\t\ttypeof value === \"object\" &&\n\t\t\ttypeof (value as any).handleEvent === \"function\")\n\t);\n}\n\nfunction normalizeListenerOptions(\n\toptions: AddEventListenerOptions | boolean | null | undefined,\n): AddEventListenerOptions {\n\tif (typeof options === \"boolean\") {\n\t\treturn {capture: options};\n\t} else if (options == null) {\n\t\treturn {};\n\t}\n\n\treturn options;\n}\n\nconst _parent = Symbol.for(\"CustomEventTarget.parent\");\nconst _listeners = Symbol.for(\"CustomEventTarget.listeners\");\nconst _delegates = Symbol.for(\"CustomEventTarget.delegates\");\nconst _dispatchEventOnSelf = Symbol.for(\"CustomEventTarget.dispatchSelf\");\n\ninterface EventListenerRecord {\n\ttype: string;\n\t// listener is the original value passed to addEventListener, callback is the\n\t// actual function we call\n\tlistener: EventListenerOrEventListenerObject;\n\tcallback: EventListener;\n\toptions: AddEventListenerOptions;\n}\n\nexport class CustomEventTarget<TParent extends CustomEventTarget<TParent> = any>\n\timplements EventTarget\n{\n\tdeclare static dispatchEventOnSelf: typeof _dispatchEventOnSelf;\n\tdeclare [_parent]: TParent | null;\n\tdeclare [_listeners]: Array<EventListenerRecord>;\n\tdeclare [_delegates]: Set<EventTarget>;\n\tconstructor(parent: TParent | null = null) {\n\t\tthis[_parent] = parent;\n\t\tthis[_listeners] = [];\n\t\tthis[_delegates] = new Set<EventTarget>();\n\t}\n\n\taddEventListener(\n\t\ttype: string,\n\t\tlistener: EventListenerOrEventListenerObject | null,\n\t\toptions?: boolean | AddEventListenerOptions,\n\t): void {\n\t\tif (!isListenerOrListenerObject(listener)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst listeners = this[_listeners];\n\t\toptions = normalizeListenerOptions(options);\n\t\tlet callback: EventListener;\n\t\tif (typeof listener === \"function\") {\n\t\t\tcallback = listener;\n\t\t} else {\n\t\t\tcallback = (ev: Event) => listener.handleEvent(ev);\n\t\t}\n\t\tconst record: EventListenerRecord = {type, listener, callback, options};\n\n\t\tif (options.once) {\n\t\t\trecord.callback = function (this: any) {\n\t\t\t\tconst i = listeners.indexOf(record);\n\t\t\t\tif (i !== -1) {\n\t\t\t\t\tlisteners.splice(i, 1);\n\t\t\t\t}\n\n\t\t\t\treturn callback.apply(this, arguments as any);\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\tlisteners.some(\n\t\t\t\t(record1) =>\n\t\t\t\t\trecord.type === record1.type &&\n\t\t\t\t\trecord.listener === record1.listener &&\n\t\t\t\t\t!record.options.capture === !record1.options.capture,\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tlisteners.push(record);\n\n\t\tfor (const delegate of this[_delegates]) {\n\t\t\tdelegate.addEventListener(type, record.callback, record.options);\n\t\t}\n\t}\n\n\tremoveEventListener(\n\t\ttype: string,\n\t\tlistener: EventListenerOrEventListenerObject | null,\n\t\toptions?: EventListenerOptions | boolean,\n\t): void {\n\t\tconst listeners = this[_listeners];\n\t\tif (listeners == null || !isListenerOrListenerObject(listener)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst options1 = normalizeListenerOptions(options);\n\t\tconst i = listeners.findIndex(\n\t\t\t(record) =>\n\t\t\t\trecord.type === type &&\n\t\t\t\trecord.listener === listener &&\n\t\t\t\t!record.options.capture === !options1.capture,\n\t\t);\n\n\t\tif (i === -1) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst record = listeners[i];\n\t\tlisteners.splice(i, 1);\n\n\t\tfor (const delegate of this[_delegates]) {\n\t\t\tdelegate.removeEventListener(\n\t\t\t\trecord.type,\n\t\t\t\trecord.callback,\n\t\t\t\trecord.options,\n\t\t\t);\n\t\t}\n\t}\n\n\tdispatchEvent(ev: Event): boolean {\n\t\tconst path: Array<CustomEventTarget> = [];\n\t\tfor (let parent = this[_parent]; parent; parent = parent[_parent]) {\n\t\t\tpath.push(parent);\n\t\t}\n\n\t\tlet cancelBubble = false;\n\t\tlet immediateCancelBubble = false;\n\t\tconst stopPropagation = ev.stopPropagation;\n\t\tsetEventProperty(ev, \"stopPropagation\", () => {\n\t\t\tcancelBubble = true;\n\t\t\treturn stopPropagation.call(ev);\n\t\t});\n\n\t\tconst stopImmediatePropagation = ev.stopImmediatePropagation;\n\t\tsetEventProperty(ev, \"stopImmediatePropagation\", () => {\n\t\t\timmediateCancelBubble = true;\n\t\t\treturn stopImmediatePropagation.call(ev);\n\t\t});\n\t\tsetEventProperty(ev, \"target\", this);\n\n\t\t// The only possible errors in this block are errors thrown by callbacks,\n\t\t// and dispatchEvent will only log these errors rather than throwing them.\n\t\t// Therefore, we place all code in a try block, log errors in the catch\n\t\t// block, and use an unsafe return statement in the finally block.\n\t\t//\n\t\t// Each early return within the try block returns true because while the\n\t\t// return value is overridden in the finally block, TypeScript\n\t\t// (justifiably) does not recognize the unsafe return statement.\n\t\ttry {\n\t\t\tsetEventProperty(ev, \"eventPhase\", CAPTURING_PHASE);\n\t\t\tfor (let i = path.length - 1; i >= 0; i--) {\n\t\t\t\tconst target = path[i];\n\t\t\t\tconst listeners = target[_listeners];\n\t\t\t\tsetEventProperty(ev, \"currentTarget\", target);\n\t\t\t\tfor (let i = 0; i < listeners.length; i++) {\n\t\t\t\t\tconst record = listeners[i];\n\t\t\t\t\tif (record.type === ev.type && record.options.capture) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\trecord.callback.call(target, ev);\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (immediateCancelBubble) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (cancelBubble) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t{\n\t\t\t\tsetEventProperty(ev, \"eventPhase\", AT_TARGET);\n\t\t\t\tsetEventProperty(ev, \"currentTarget\", this);\n\n\t\t\t\tthis[_dispatchEventOnSelf](ev);\n\t\t\t\tif (immediateCancelBubble) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tconst listeners = this[_listeners];\n\t\t\t\tfor (let i = 0; i < listeners.length; i++) {\n\t\t\t\t\tconst record = listeners[i];\n\t\t\t\t\tif (record.type === ev.type) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\trecord.callback.call(this, ev);\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (immediateCancelBubble) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (cancelBubble) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (ev.bubbles) {\n\t\t\t\tsetEventProperty(ev, \"eventPhase\", BUBBLING_PHASE);\n\t\t\t\tfor (let i = 0; i < path.length; i++) {\n\t\t\t\t\tconst target = path[i];\n\t\t\t\t\tsetEventProperty(ev, \"currentTarget\", target);\n\t\t\t\t\tconst listeners = target[_listeners];\n\t\t\t\t\tfor (let i = 0; i < listeners.length; i++) {\n\t\t\t\t\t\tconst record = listeners[i];\n\t\t\t\t\t\tif (record.type === ev.type && !record.options.capture) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\trecord.callback.call(target, ev);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (immediateCancelBubble) {\n\t\t\t\t\t\t\t\treturn true;\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\tif (cancelBubble) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tsetEventProperty(ev, \"eventPhase\", NONE);\n\t\t\tsetEventProperty(ev, \"currentTarget\", null);\n\t\t\t// eslint-disable-next-line no-unsafe-finally\n\t\t\treturn !ev.defaultPrevented;\n\t\t}\n\t}\n\n\t[_dispatchEventOnSelf](_ev: Event): void {}\n}\n\nCustomEventTarget.dispatchEventOnSelf = _dispatchEventOnSelf;\n\nexport function addEventTargetDelegates<T extends CustomEventTarget>(\n\ttarget: T,\n\tdelegates: Array<unknown>,\n\tinclude: (target1: T) => boolean = (target1) => target === target1,\n): void {\n\tconst delegates1 = delegates.filter(isEventTarget);\n\tfor (\n\t\tlet target1: T | null = target;\n\t\ttarget1 && include(target1);\n\t\ttarget1 = target1[_parent]\n\t) {\n\t\tfor (let i = 0; i < delegates1.length; i++) {\n\t\t\tconst delegate = delegates1[i];\n\t\t\tif (target1[_delegates].has(delegate)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\ttarget1[_delegates].add(delegate);\n\t\t\tfor (const record of target1[_listeners]) {\n\t\t\t\tdelegate.addEventListener(record.type, record.callback, record.options);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function removeEventTargetDelegates<T extends CustomEventTarget>(\n\ttarget: T,\n\tdelegates: Array<unknown>,\n\tinclude: (target1: T) => boolean = (target1) => target === target1,\n): void {\n\tconst delegates1 = delegates.filter(isEventTarget);\n\tfor (\n\t\tlet target1: T | null = target;\n\t\ttarget1 && include(target1);\n\t\ttarget1 = target1[_parent]\n\t) {\n\t\tfor (let i = 0; i < delegates1.length; i++) {\n\t\t\tconst delegate = delegates1[i];\n\t\t\tif (!target1[_delegates].has(delegate)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\ttarget1[_delegates].delete(delegate);\n\t\t\tfor (const record of target1[_listeners]) {\n\t\t\t\tdelegate.removeEventListener(\n\t\t\t\t\trecord.type,\n\t\t\t\t\trecord.callback,\n\t\t\t\t\trecord.options,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function clearEventListeners(target: CustomEventTarget): void {\n\tconst listeners = target[_listeners];\n\tconst delegates = target[_delegates];\n\tfor (let i = 0; i < listeners.length; i++) {\n\t\tconst record = listeners[i];\n\t\tfor (const delegate of delegates) {\n\t\t\tdelegate.removeEventListener(\n\t\t\t\trecord.type,\n\t\t\t\trecord.callback,\n\t\t\t\trecord.options,\n\t\t\t);\n\t\t}\n\t}\n\n\tlisteners.length = 0;\n\tdelegates.clear();\n}\n","export function wrap<T>(value: Array<T> | T | undefined): Array<T> {\n\treturn value === undefined ? [] : Array.isArray(value) ? value : [value];\n}\n\nexport function unwrap<T>(arr: Array<T>): Array<T> | T | undefined {\n\treturn arr.length === 0 ? undefined : arr.length === 1 ? arr[0] : arr;\n}\n\nexport type NonStringIterable<T> = Iterable<T> & object;\n\n/**\n * Ensures a value is an array.\n *\n * This function does the same thing as wrap() above except it handles nulls\n * and iterables, so it is appropriate for wrapping user-provided element\n * children.\n */\nexport function arrayify<T>(\n\tvalue: NonStringIterable<T> | T | null | undefined,\n): Array<T> {\n\treturn value == null\n\t\t? []\n\t\t: Array.isArray(value)\n\t\t\t? value\n\t\t\t: typeof value === \"string\" ||\n\t\t\t\t typeof (value as any)[Symbol.iterator] !== \"function\"\n\t\t\t\t? [value as T]\n\t\t\t\t: [...(value as NonStringIterable<T>)];\n}\n\nexport function isIteratorLike(\n\tvalue: any,\n): value is Iterator<unknown> | AsyncIterator<unknown> {\n\treturn value != null && typeof value.next === \"function\";\n}\n\nexport function isPromiseLike(value: any): value is PromiseLike<unknown> {\n\treturn value != null && typeof value.then === \"function\";\n}\n\ntype Deferred<T = unknown> = {\n\tresolve: (value: T | PromiseLike<T>) => void;\n\treject: (reason?: unknown) => void;\n};\n\ntype RaceRecord = {\n\tdeferreds: Set<Deferred>;\n\tsettled: boolean;\n};\n\nfunction createRaceRecord(contender: PromiseLike<unknown>): RaceRecord {\n\tconst deferreds = new Set<Deferred>();\n\tconst record = {deferreds, settled: false};\n\n\t// This call to `then` happens once for the lifetime of the value.\n\tPromise.resolve(contender).then(\n\t\t(value) => {\n\t\t\tfor (const {resolve} of deferreds) {\n\t\t\t\tresolve(value);\n\t\t\t}\n\n\t\t\tdeferreds.clear();\n\t\t\trecord.settled = true;\n\t\t},\n\t\t(err) => {\n\t\t\tfor (const {reject} of deferreds) {\n\t\t\t\treject(err);\n\t\t\t}\n\n\t\t\tdeferreds.clear();\n\t\t\trecord.settled = true;\n\t\t},\n\t);\n\treturn record;\n}\n\n// Promise.race is memory unsafe. This is alternative which is. See:\n// https://github.com/nodejs/node/issues/17469#issuecomment-685235106\n// Keys are the values passed to race.\n// Values are a record of data containing a set of deferreds and whether the\n// value has settled.\nconst wm = new WeakMap<object, RaceRecord>();\nexport function safeRace<T>(\n\tcontenders: Iterable<T | PromiseLike<T>>,\n): Promise<Awaited<T>> {\n\tlet deferred: Deferred;\n\tconst result = new Promise((resolve, reject) => {\n\t\tdeferred = {resolve, reject};\n\t\tfor (const contender of contenders) {\n\t\t\tif (!isPromiseLike(contender)) {\n\t\t\t\t// If the contender is a not a then-able, attempting to use it as a key\n\t\t\t\t// in the weakmap would throw an error. Luckily, it is safe to call\n\t\t\t\t// `Promise.resolve(contender).then` on regular values multiple\n\t\t\t\t// times because the promise fulfills immediately.\n\t\t\t\tPromise.resolve(contender).then(resolve, reject);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet record = wm.get(contender);\n\t\t\tif (record === undefined) {\n\t\t\t\trecord = createRaceRecord(contender);\n\t\t\t\trecord.deferreds.add(deferred);\n\t\t\t\twm.set(contender, record);\n\t\t\t} else if (record.settled) {\n\t\t\t\t// If the value has settled, it is safe to call\n\t\t\t\t// `Promise.resolve(contender).then` on it.\n\t\t\t\tPromise.resolve(contender).then(resolve, reject);\n\t\t\t} else {\n\t\t\t\trecord.deferreds.add(deferred);\n\t\t\t}\n\t\t}\n\t});\n\n\t// The finally callback executes when any value settles, preventing any of\n\t// the unresolved values from retaining a reference to the resolved value.\n\treturn result.finally(() => {\n\t\tfor (const contender of contenders) {\n\t\t\tif (isPromiseLike(contender)) {\n\t\t\t\tconst record = wm.get(contender);\n\t\t\t\tif (record) {\n\t\t\t\t\trecord.deferreds.delete(deferred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}) as Promise<Awaited<T>>;\n}\n","import {\n\tCustomEventTarget,\n\taddEventTargetDelegates,\n\tclearEventListeners,\n\tremoveEventTargetDelegates,\n} from \"./event-target.js\";\nimport {\n\tarrayify,\n\tisIteratorLike,\n\tisPromiseLike,\n\tsafeRace,\n\tunwrap,\n\twrap,\n} from \"./_utils.js\";\n\nconst NOOP = (): undefined => {};\n\n/**\n * A type which represents all valid values for an element tag.\n */\nexport type Tag = string | symbol | Component;\n\nfunction getTagName(tag: Tag): string {\n\treturn typeof tag === \"function\"\n\t\t? tag.name || \"Anonymous\"\n\t\t: typeof tag === \"string\"\n\t\t\t? tag\n\t\t\t: // tag is symbol, using else branch to avoid typeof tag === \"symbol\"\n\t\t\t\ttag.description || \"Anonymous\";\n}\n\n/**\n * A helper type to map the tag of an element to its expected props.\n *\n * @template TTag - The tag associated with the props. Can be a string, symbol\n * or a component function.\n */\nexport type TagProps<TTag extends Tag> = TTag extends string\n\t? JSX.IntrinsicElements[TTag]\n\t: TTag extends Component<infer TProps>\n\t\t? TProps & JSX.IntrinsicAttributes\n\t\t: Record<string, unknown> & JSX.IntrinsicAttributes;\n\n/**\n * Describes all valid values of an element tree, excluding iterables.\n *\n * Arbitrary objects can also be safely rendered, but will be converted to a\n * string using the toString() method. We exclude them from this type to catch\n * potential mistakes.\n */\nexport type Child = Element | string | number | boolean | null | undefined;\n\n/**\n * An arbitrarily nested iterable of Child values.\n *\n * We use a recursive interface here rather than making the Children type\n * directly recursive because recursive type aliases were added in TypeScript\n * 3.7.\n *\n * You should avoid referencing this type directly, as it is mainly exported to\n * prevent TypeScript errors.\n */\nexport interface ChildIterable extends Iterable<Child | ChildIterable> {}\n\n/**\n * Describes all valid values for an element tree, including arbitrarily nested\n * iterables of such values.\n *\n * This type can be used to represent the type of the children prop for an\n * element or the return/yield type of a component.\n */\nexport type Children = Child | ChildIterable;\n\n/**\n * Represents all functions which can be used as a component.\n *\n * @template [TProps=*] - The expected props for the component.\n */\nexport type Component<TProps extends Record<string, unknown> = any> = (\n\tthis: Context<TProps>,\n\tprops: TProps,\n\tctx: Context<TProps>,\n) =>\n\t| Children\n\t| PromiseLike<Children>\n\t// The return type of iterators must include void because TypeScript will\n\t// infer generators which return implicitly as having a void return type.\n\t| Iterator<Children, Children | void, any>\n\t| AsyncIterator<Children, Children | void, any>;\n\n/*** SPECIAL TAGS ***/\n/**\n * A special tag for grouping multiple children within the same parent.\n *\n * All non-string iterables which appear in the element tree are implicitly\n * wrapped in a fragment element.\n *\n * This tag is just the empty string, and you can use the empty string in\n * createElement calls or transpiler options directly to avoid having to\n * reference this export.\n */\nexport const Fragment = \"\";\nexport type Fragment = typeof Fragment;\n\n// TODO: We assert the following symbol tags as Components because TypeScript\n// support for symbol tags in JSX doesn't exist yet.\n// https://github.com/microsoft/TypeScript/issues/38367\n\n/**\n * A special tag for rendering into a new root node via a root prop.\n *\n * This tag is useful for creating element trees with multiple roots, for\n * things like modals or tooltips.\n *\n * Renderer.prototype.render() implicitly wraps top-level in a Portal element\n * with the root set to the second argument passed in.\n */\nexport const Portal = Symbol.for(\"crank.Portal\") as unknown as Component<{\n\troot?: object;\n}> &\n\tsymbol;\nexport type Portal = typeof Portal;\n\n/**\n * A special tag which preserves whatever was previously rendered in the\n * element's position.\n *\n * Copy elements are useful for when you want to prevent a subtree from\n * rerendering as a performance optimization. Copy elements can also be keyed,\n * in which case the previously rendered keyed element will be copied.\n */\nexport const Copy = Symbol.for(\"crank.Copy\") as unknown as Component<{}> &\n\tsymbol;\nexport type Copy = typeof Copy;\n\n/**\n * A special tag for rendering text nodes.\n *\n * Strings in the element tree are implicitly wrapped in a Text element with\n * value set to the string.\n */\nexport const Text = Symbol.for(\"crank.Text\") as unknown as Component<{\n\tvalue: string;\n}> &\n\tsymbol;\nexport type Text = typeof Text;\n\n/** A special tag for injecting raw nodes or strings via a value prop. */\nexport const Raw = Symbol.for(\"crank.Raw\") as unknown as Component<{\n\tvalue: string | object;\n}> &\n\tsymbol;\nexport type Raw = typeof Raw;\n\n/**\n * A type to keep track of keys. Any value can be a key, though null and\n * undefined are ignored.\n */\ntype Key = unknown;\n\ntype ChildrenIteratorResult = IteratorResult<Children, Children | void>;\n\nconst ElementSymbol = Symbol.for(\"crank.Element\");\n\n// To maximize compatibility between Crank versions, starting with 0.2.0, any\n// changes to the Element properties will be considered a breaking change.\nexport interface Element<TTag extends Tag = Tag> {\n\t/**\n\t * @internal\n\t * A unique symbol to identify elements as elements across versions and\n\t * realms, and to protect against basic injection attacks.\n\t * https://overreacted.io/why-do-react-elements-have-typeof-property/\n\t *\n\t * This property is defined on the element prototype rather than per\n\t * instance, because it is the same for every Element.\n\t */\n\t$$typeof: typeof ElementSymbol;\n\n\t/**\n\t * The tag of the element. Can be a string, symbol or function.\n\t */\n\ttag: TTag;\n\n\t/**\n\t * An object containing the \"properties\" of an element. These correspond to\n\t * the attribute syntax from JSX.\n\t */\n\tprops: TagProps<TTag>;\n}\n\n/**\n * Elements are the basic building blocks of Crank applications. They are\n * JavaScript objects which are interpreted by special classes called renderers\n * to produce and manage stateful nodes.\n *\n * @template {Tag} [TTag=Tag] - The type of the tag of the element.\n *\n * @example\n * // specific element types\n * let div: Element<\"div\">;\n * let portal: Element<Portal>;\n * let myEl: Element<MyComponent>;\n *\n * // general element types\n * let host: Element<string | symbol>;\n * let component: Element<Component>;\n *\n * Typically, you use a helper function like createElement to create elements\n * rather than instatiating this class directly.\n */\nexport class Element<TTag extends Tag = Tag> {\n\tconstructor(tag: TTag, props: TagProps<TTag>) {\n\t\tthis.tag = tag;\n\t\tthis.props = props;\n\t}\n}\n\n// See Element interface\nElement.prototype.$$typeof = ElementSymbol;\n\nexport function isElement(value: any): value is Element {\n\treturn value != null && value.$$typeof === ElementSymbol;\n}\n\nconst DEPRECATED_PROP_PREFIXES = [\"crank-\", \"c-\", \"$\"];\n\nconst DEPRECATED_SPECIAL_PROP_BASES = [\"key\", \"ref\", \"static\", \"copy\"];\n/**\n * Creates an element with the specified tag, props and children.\n *\n * This function is usually used as a transpilation target for JSX transpilers,\n * but it can also be called directly. It additionally extracts special props so\n * they aren't accessible to renderer methods or components, and assigns the\n * children prop according to any additional arguments passed to the function.\n */\nexport function createElement<TTag extends Tag>(\n\ttag: TTag,\n\tprops?: TagProps<TTag> | null | undefined,\n\t...children: Array<unknown>\n): Element<TTag> {\n\tif (props == null) {\n\t\tprops = {} as TagProps<TTag>;\n\t}\n\n\tif (\"static\" in (props as TagProps<TTag>)) {\n\t\tconsole.error(`The \\`static\\` prop is deprecated. Use \\`copy\\` instead.`);\n\t\t(props as TagProps<TTag>)[\"copy\"] = (props as TagProps<TTag>)[\"static\"];\n\t\tdelete (props as any)[\"static\"];\n\t}\n\n\tfor (let i = 0; i < DEPRECATED_PROP_PREFIXES.length; i++) {\n\t\tconst propPrefix = DEPRECATED_PROP_PREFIXES[i];\n\t\tfor (let j = 0; j < DEPRECATED_SPECIAL_PROP_BASES.length; j++) {\n\t\t\tconst propBase = DEPRECATED_SPECIAL_PROP_BASES[j];\n\t\t\tconst deprecatedPropName = propPrefix + propBase;\n\t\t\tif (deprecatedPropName in (props as TagProps<TTag>)) {\n\t\t\t\tconst targetPropBase = propBase === \"static\" ? \"copy\" : propBase;\n\t\t\t\tconsole.error(\n\t\t\t\t\t`The \\`${deprecatedPropName}\\` prop is deprecated. Use \\`${targetPropBase}\\` instead.`,\n\t\t\t\t);\n\t\t\t\t(props as TagProps<TTag>)[targetPropBase] = (props as TagProps<TTag>)[\n\t\t\t\t\tdeprecatedPropName\n\t\t\t\t];\n\t\t\t\tdelete (props as any)[deprecatedPropName];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (children.length > 1) {\n\t\t(props as TagProps<TTag>).children = children;\n\t} else if (children.length === 1) {\n\t\t(props as TagProps<TTag>).children = children[0];\n\t}\n\n\treturn new Element(tag, props as TagProps<TTag>);\n}\n\n/** Clones a given element, shallowly copying the props object. */\nexport function cloneElement<TTag extends Tag>(\n\tel: Element<TTag>,\n): Element<TTag> {\n\tif (!isElement(el)) {\n\t\tthrow new TypeError(`Cannot clone non-element: ${String(el)}`);\n\t}\n\n\treturn new Element(el.tag, {...el.props});\n}\n\n/*** ELEMENT UTILITIES ***/\n\n// WHAT ARE WE DOING TO THE CHILDREN???\n/**\n * All values in the element tree are narrowed from the union in Child to\n * NarrowedChild during rendering, to simplify element diffing.\n */\ntype NarrowedChild = Element | string | undefined;\n\nfunction narrow(value: Children): NarrowedChild {\n\tif (typeof value === \"boolean\" || value == null) {\n\t\treturn;\n\t} else if (typeof value === \"string\" || isElement(value)) {\n\t\treturn value;\n\t} else if (typeof (value as any)[Symbol.iterator] === \"function\") {\n\t\treturn createElement(Fragment, null, value);\n\t}\n\n\treturn value.toString();\n}\n\n/**\n * A helper type which repesents all possible rendered values of an element.\n *\n * @template TNode - The type of node produced by the associated renderer.\n *\n * When asking the question, what is the \"value\" of a specific element, the\n * answer varies depending on the tag:\n *\n * For intrinsic elements, the value is the node created for the element, e.g.\n * the DOM node in the case of the DOMRenderer.\n *\n * For portals, the value is undefined, because a Portal element's root and\n * children are opaque to its parent.\n *\n * For component or fragment elements the value can be a node or an array of\n * nodes, depending on how many children they have.\n */\nexport type ElementValue<TNode> = Array<TNode> | TNode | undefined;\n\n/*** RETAINER FLAGS ***/\nconst DidDiff = 1 << 0;\nconst DidCommit = 1 << 1;\nconst IsCopied = 1 << 2;\nconst IsUpdating = 1 << 3;\nconst IsExecuting = 1 << 4;\nconst IsRefreshing = 1 << 5;\nconst IsScheduling = 1 << 6;\nconst IsSchedulingFallback = 1 << 7;\nconst IsUnmounted = 1 << 8;\n// TODO: Is this flag still necessary or can we use IsUnmounted?\nconst IsErrored = 1 << 9;\nconst IsResurrecting = 1 << 10;\n// TODO: Maybe we can get rid of IsSyncGen and IsAsyncGen\nconst IsSyncGen = 1 << 11;\nconst IsAsyncGen = 1 << 12;\nconst IsInForOfLoop = 1 << 13;\nconst IsInForAwaitOfLoop = 1 << 14;\nconst NeedsToYield = 1 << 15;\nconst PropsAvailable = 1 << 16;\nconst IsSchedulingRefresh = 1 << 17;\n\nfunction getFlag(ret: Retainer<unknown>, flag: number): boolean {\n\treturn !!(ret.f & flag);\n}\n\nfunction setFlag(ret: Retainer<unknown>, flag: number, value = true): void {\n\tif (value) {\n\t\tret.f |= flag;\n\t} else {\n\t\tret.f &= ~flag;\n\t}\n}\n\n/**\n * @internal\n * Retainers are objects which act as the internal representation of elements,\n * mirroring the element tree.\n */\nclass Retainer<TNode, TScope = unknown> {\n\t/** A bitmask. See RETAINER FLAGS above. */\n\tdeclare f: number;\n\tdeclare el: Element;\n\tdeclare ctx: ContextState<TNode, TScope, any> | undefined;\n\tdeclare children:\n\t\t| Array<Retainer<TNode, TScope> | undefined>\n\t\t| Retainer<TNode, TScope>\n\t\t| undefined;\n\tdeclare fallback: Retainer<TNode, TScope> | undefined;\n\t// This is only assigned for host, text and raw elements.\n\tdeclare value: ElementValue<TNode> | undefined;\n\tdeclare scope: TScope | undefined;\n\t// This is only assigned for host and raw elements.\n\tdeclare oldProps: Record<string, any> | undefined;\n\tdeclare pendingDiff: Promise<undefined> | undefined;\n\tdeclare onNextDiff: Function | undefined;\n\tdeclare graveyard: Array<Retainer<TNode, TScope>> | undefined;\n\tdeclare lingerers:\n\t\t| Array<Set<Retainer<TNode, TScope>> | undefined>\n\t\t| undefined;\n\n\tconstructor(el: Element) {\n\t\tthis.f = 0;\n\t\tthis.el = el;\n\t\tthis.ctx = undefined;\n\t\tthis.children = undefined;\n\t\tthis.fallback = undefined;\n\t\tthis.value = undefined;\n\t\tthis.oldProps = undefined;\n\t\tthis.pendingDiff = undefined;\n\t\tthis.onNextDiff = undefined;\n\t\tthis.graveyard = undefined;\n\t\tthis.lingerers = undefined;\n\t}\n}\n\nfunction cloneRetainer<TNode, TScope>(\n\tret: Retainer<TNode, TScope>,\n): Retainer<TNode, TScope> {\n\tconst clone = new Retainer<TNode, TScope>(ret.el);\n\tclone.f = ret.f;\n\tclone.ctx = ret.ctx;\n\tclone.children = ret.children;\n\tclone.fallback = ret.fallback;\n\tclone.value = ret.value;\n\tclone.scope = ret.scope;\n\tclone.oldProps = ret.oldProps;\n\tclone.pendingDiff = ret.pendingDiff;\n\tclone.onNextDiff = ret.onNextDiff;\n\tclone.graveyard = ret.graveyard;\n\tclone.lingerers = ret.lingerers;\n\n\treturn clone;\n}\n\n/**\n * Finds the value of the element according to its type.\n *\n * @returns A node, an array of nodes or undefined.\n */\nfunction getValue<TNode>(\n\tret: Retainer<TNode>,\n\tisNested = false,\n\tindex?: number,\n): ElementValue<TNode> {\n\tif (getFlag(ret, IsScheduling) && isNested) {\n\t\treturn ret.fallback ? getValue(ret.fallback, isNested, index) : undefined;\n\t} else if (ret.fallback && !getFlag(ret, DidDiff)) {\n\t\treturn ret.fallback\n\t\t\t? getValue(ret.fallback, isNested, index)\n\t\t\t: ret.fallback;\n\t} else if (ret.el.tag === Portal) {\n\t\treturn;\n\t} else if (ret.el.tag === Fragment || typeof ret.el.tag === \"function\") {\n\t\tif (index != null && ret.ctx) {\n\t\t\tret.ctx.index = index;\n\t\t}\n\t\treturn unwrap(getChildValues(ret, index));\n\t}\n\n\treturn ret.value;\n}\n\n/**\n * Walks an element's children to find its child values.\n *\n * @param ret - The retainer whose child values we are reading.\n * @param startIndex - Starting index to thread through for context index updates.\n *\n * @returns An array of nodes.\n */\nfunction getChildValues<TNode>(\n\tret: Retainer<TNode>,\n\tstartIndex?: number,\n): Array<TNode> {\n\tconst values: Array<TNode> = [];\n\tconst lingerers = ret.lingerers;\n\tconst children = wrap(ret.children);\n\tlet currentIndex = startIndex;\n\n\tfor (let i = 0; i < children.length; i++) {\n\t\tif (lingerers != null && lingerers[i] != null) {\n\t\t\tconst rets = lingerers[i]!;\n\t\t\tfor (const ret of rets) {\n\t\t\t\tconst value = getValue(ret, true, currentIndex);\n\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\tfor (let j = 0; j < value.length; j++) {\n\t\t\t\t\t\tvalues.push(value[j]);\n\t\t\t\t\t}\n\t\t\t\t\tif (currentIndex != null) {\n\t\t\t\t\t\tcurrentIndex += value.length;\n\t\t\t\t\t}\n\t\t\t\t} else if (value) {\n\t\t\t\t\tvalues.push(value);\n\t\t\t\t\tif (currentIndex != null) {\n\t\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst child = children[i];\n\t\tif (child) {\n\t\t\tconst value = getValue(child, true, currentIndex);\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (let j = 0; j < value.length; j++) {\n\t\t\t\t\tvalues.push(value[j]);\n\t\t\t\t}\n\t\t\t\tif (currentIndex != null) {\n\t\t\t\t\tcurrentIndex += value.length;\n\t\t\t\t}\n\t\t\t} else if (value) {\n\t\t\t\tvalues.push(value);\n\t\t\t\tif (currentIndex != null) {\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (lingerers != null && lingerers.length > children.length) {\n\t\tfor (let i = children.length; i < lingerers.length; i++) {\n\t\t\tconst rets = lingerers[i];\n\t\t\tif (rets != null) {\n\t\t\t\tfor (const ret of rets) {\n\t\t\t\t\tconst value = getValue(ret, true, currentIndex);\n\t\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\t\tfor (let j = 0; j < value.length; j++) {\n\t\t\t\t\t\t\tvalues.push(value[j]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (currentIndex != null) {\n\t\t\t\t\t\t\tcurrentIndex += value.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (value) {\n\t\t\t\t\t\tvalues.push(value);\n\t\t\t\t\t\tif (currentIndex != null) {\n\t\t\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn values;\n}\n\nfunction stripSpecialProps(props: Record<string, any>): Record<string, any> {\n\tlet _: unknown;\n\tlet result: Record<string, any>;\n\t({key: _, ref: _, copy: _, hydrate: _, children: _, ...result} = props);\n\treturn result;\n}\n\n/**\n * Interface for adapting the rendering process to a specific target environment.\n *\n * The RenderAdapter defines how Crank elements are mapped to nodes in your target\n * rendering environment (DOM, Canvas, WebGL, Terminal, etc.). Each method handles\n * a specific part of the element lifecycle, from creation to removal.\n *\n * @template TNode - The type representing a node in your target environment\n * @template TScope - Additional context data passed down the component tree\n * @template TRoot - The type of the root container (defaults to TNode)\n * @template TResult - The type returned when reading element values (defaults to ElementValue<TNode>)\n *\n * @example\n * ```typescript\n * const adapter: RenderAdapter<MyNode, MyScope> = {\n * create: ({ tag, props }) => new MyNode(tag, props),\n * patch: ({ node, props }) => node.update(props),\n * arrange: ({ node, children }) => node.replaceChildren(children),\n * // ... other methods\n * };\n * ```\n */\nexport interface RenderAdapter<\n\tTNode,\n\tTScope,\n\tTRoot extends TNode | undefined = TNode,\n\tTResult = ElementValue<TNode>,\n> {\n\t/**\n\t * Creates a new node for the given element tag and props.\n\t *\n\t * This method is called when Crank encounters a new element that needs to be\n\t * rendered for the first time. You should create and return a node appropriate\n\t * for your target environment.\n\t *\n\t * @param data.tag - The element tag (e.g., \"div\", \"sprite\", or a symbol)\n\t * @param data.tagName - String representation of the tag for debugging\n\t * @param data.props - The element's props object\n\t * @param data.scope - Current scope context (can be undefined)\n\t * @returns A new node instance\n\t *\n\t * @example\n\t * ```typescript\n\t * create: ({ tag, props, scope }) => {\n\t * if (tag === \"sprite\") {\n\t * return new PIXI.Sprite(props.texture);\n\t * }\n\t * throw new Error(`Unknown tag: ${tag}`);\n\t * }\n\t * ```\n\t */\n\tcreate(data: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tprops: Record<string, any>;\n\t\tscope: TScope | undefined;\n\t}): TNode;\n\n\t/**\n\t * Adopts existing nodes during hydration.\n\t *\n\t * Called when hydrating server-rendered content or reusing existing nodes.\n\t * Should return an array of child nodes if the provided node matches the\n\t * expected tag, or undefined if hydration should fail.\n\t *\n\t * @param data.tag - The element tag being hydrated\n\t * @param data.tagName - String representation of the tag\n\t * @param data.props - The element's props\n\t * @param data.node - The existing node to potentially adopt\n\t * @param data.scope - Current scope context\n\t * @returns Array of child nodes to hydrate, or undefined if adoption fails\n\t *\n\t * @example\n\t * ```typescript\n\t * adopt: ({ tag, node }) => {\n\t * if (node && node.tagName.toLowerCase() === tag) {\n\t * return Array.from(node.children);\n\t * }\n\t * return undefined; // Hydration mismatch\n\t * }\n\t * ```\n\t */\n\tadopt(data: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tprops: Record<string, any>;\n\t\tnode: TNode | undefined;\n\t\tscope: TScope | undefined;\n\t}): Array<TNode> | undefined;\n\n\t/**\n\t * Creates or updates a text node.\n\t *\n\t * Called when rendering text content. Should create a new text node or\n\t * update an existing one with the provided value.\n\t *\n\t * @param data.value - The text content to render\n\t * @param data.scope - Current scope context\n\t * @param data.oldNode - Previous text node to potentially reuse\n\t * @param data.hydrationNodes - Nodes available during hydration\n\t * @returns A text node containing the given value\n\t *\n\t * @example\n\t * ```typescript\n\t * text: ({ value, oldNode }) => {\n\t * if (oldNode && oldNode.text !== value) {\n\t * oldNode.text = value;\n\t * return oldNode;\n\t * }\n\t * return new TextNode(value);\n\t * }\n\t * ```\n\t */\n\ttext(data: {\n\t\tvalue: string;\n\t\tscope: TScope | undefined;\n\t\toldNode: TNode | undefined;\n\t\thydrationNodes: Array<TNode> | undefined;\n\t}): TNode;\n\n\t/**\n\t * Computes scope context for child elements.\n\t *\n\t * Called to determine what scope context should be passed to child elements.\n\t * The scope can be used to pass rendering context like theme, coordinate systems,\n\t * or namespaces down the component tree.\n\t *\n\t * @param data.tag - The element tag\n\t * @param data.tagName - String representation of the tag\n\t * @param data.props - The element's props\n\t * @param data.scope - Current scope context\n\t * @returns New scope for children, or undefined to inherit current scope\n\t *\n\t * @example\n\t * ```typescript\n\t * scope: ({ tag, props, scope }) => {\n\t * if (tag === \"svg\") {\n\t * return { ...scope, namespace: \"http://www.w3.org/2000/svg\" };\n\t * }\n\t * return scope;\n\t * }\n\t * ```\n\t */\n\tscope(data: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tprops: Record<string, any>;\n\t\tscope: TScope | undefined;\n\t}): TScope | undefined;\n\n\t/**\n\t * Handles raw values (strings or nodes) that bypass normal element processing.\n\t *\n\t * Called when rendering Raw elements or other direct node insertions.\n\t * Should convert string values to appropriate nodes for your environment.\n\t *\n\t * @param data.value - Raw string or node value to render\n\t * @param data.scope - Current scope context\n\t * @param data.hydrationNodes - Nodes available during hydration\n\t * @returns ElementValue that can be handled by arrange()\n\t *\n\t * @example\n\t * ```typescript\n\t * raw: ({ value, scope }) => {\n\t * if (typeof value === \"string\") {\n\t * const container = new Container();\n\t * container.innerHTML = value;\n\t * return Array.from(container.children);\n\t * }\n\t * return value;\n\t * }\n\t * ```\n\t */\n\traw(data: {\n\t\tvalue: string | TNode;\n\t\tscope: TScope | undefined;\n\t\thydrationNodes: Array<TNode> | undefined;\n\t}): ElementValue<TNode>;\n\n\t/**\n\t * Updates a node's properties.\n\t *\n\t * Called when element props change. Should efficiently update only the\n\t * properties that have changed. This is where you implement prop-to-attribute\n\t * mapping, event listener binding, and other property synchronization.\n\t *\n\t * @param data.tag - The element tag\n\t * @param data.tagName - String representation of the tag\n\t * @param data.node - The node to update\n\t * @param data.props - New props object\n\t * @param data.oldProps - Previous props object (undefined for initial render)\n\t * @param data.scope - Current scope context\n\t * @param data.copyProps - Props to skip (used for copying between renderers)\n\t * @param data.isHydrating - Whether currently hydrating\n\t * @param data.quietProps - Props to not warn about during hydration\n\t *\n\t * @example\n\t * ```typescript\n\t * patch: ({ node, props, oldProps }) => {\n\t * for (const [key, value] of Object.entries(props)) {\n\t * if (oldProps?.[key] !== value) {\n\t * if (key.startsWith(\"on\")) {\n\t * node.addEventListener(key.slice(2), value);\n\t * } else {\n\t * node[key] = value;\n\t * }\n\t * }\n\t * }\n\t * }\n\t * ```\n\t */\n\tpatch(data: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tnode: TNode;\n\t\tprops: Record<string, any>;\n\t\toldProps: Record<string, any> | undefined;\n\t\tscope: TScope | undefined;\n\t\tcopyProps: Set<string> | undefined;\n\t\tisHydrating: boolean;\n\t\tquietProps: Set<string> | undefined;\n\t}): void;\n\n\t/**\n\t * Arranges child nodes within their parent.\n\t *\n\t * Called after child elements are rendered to organize them within their\n\t * parent node. Should efficiently insert, move, or remove child nodes to\n\t * match the provided children array.\n\t *\n\t * @param data.tag - The parent element tag\n\t * @param data.tagName - String representation of the tag\n\t * @param data.node - The parent node\n\t * @param data.props - The parent element's props\n\t * @param data.children - Array of child nodes in correct order\n\t * @param data.oldProps - Previous props (for reference)\n\t *\n\t * @example\n\t * ```typescript\n\t * arrange: ({ node, children }) => {\n\t * // Remove existing children\n\t * node.removeChildren();\n\t * // Add new children in order\n\t * for (const child of children) {\n\t * node.addChild(child);\n\t * }\n\t * }\n\t * ```\n\t */\n\tarrange(data: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tnode: TNode;\n\t\tprops: Record<string, any>;\n\t\tchildren: Array<TNode>;\n\t\toldProps: Record<string, any> | undefined;\n\t}): void;\n\n\t/**\n\t * Removes a node from its parent.\n\t *\n\t * Called when an element is being unmounted. Should clean up the node\n\t * and remove it from its parent if appropriate.\n\t *\n\t * @param data.node - The node to remove\n\t * @param data.parentNode - The parent node\n\t * @param data.isNested - Whether this is a nested removal (child of removed element)\n\t *\n\t * @example\n\t * ```typescript\n\t * remove: ({ node, parentNode, isNested }) => {\n\t * // Clean up event listeners, resources, etc.\n\t * node.cleanup?.();\n\t * // Remove from parent unless it's a nested removal\n\t * if (!isNested && parentNode.contains(node)) {\n\t * parentNode.removeChild(node);\n\t * }\n\t * }\n\t * ```\n\t */\n\tremove(data: {node: TNode; parentNode: TNode; isNested: boolean}): void;\n\n\t/**\n\t * Reads the final rendered value from an ElementValue.\n\t *\n\t * Called to extract the final result from rendered elements. This allows\n\t * you to transform the internal node representation into the public API\n\t * that users of your renderer will see.\n\t *\n\t * @param value - The ElementValue to read (array, single node, or undefined)\n\t * @returns The public representation of the rendered value\n\t *\n\t * @example\n\t * ```typescript\n\t * read: (value) => {\n\t * if (Array.isArray(value)) {\n\t * return value.map(node => node.publicAPI);\n\t * }\n\t * return value?.publicAPI;\n\t * }\n\t * ```\n\t */\n\tread(value: ElementValue<TNode>): TResult;\n\n\t/**\n\t * Performs final rendering to the root container.\n\t *\n\t * Called after the entire render cycle is complete. This is where you\n\t * trigger the actual rendering/presentation in your target environment\n\t * (e.g., calling render() on a canvas, flushing to the screen, etc.).\n\t *\n\t * @param root - The root container\n\t *\n\t * @example\n\t * ```typescript\n\t * finalize: (root) => {\n\t * // Trigger actual rendering\n\t * if (root instanceof PIXIApplication) {\n\t * root.render();\n\t * }\n\t * }\n\t * ```\n\t */\n\tfinalize(root: TRoot): void;\n}\n\nconst defaultAdapter: RenderAdapter<any, any, any, any> = {\n\tcreate() {\n\t\tthrow new Error(\"adapter must implement create\");\n\t},\n\tadopt() {\n\t\tthrow new Error(\"adapter must implement adopt() for hydration\");\n\t},\n\tscope: ({scope}) => scope,\n\tread: (value) => value,\n\ttext: ({value}) => value,\n\traw: ({value}) => value,\n\tpatch: NOOP,\n\tarrange: NOOP,\n\tremove: NOOP,\n\tfinalize: NOOP,\n};\n\n/**\n * An abstract class which is subclassed to render to different target\n * environments. Subclasses call super() with a custom RenderAdapter object.\n * This class is responsible for kicking off the rendering process and caching\n * previous trees by root.\n *\n * @template TNode - The type of the node for a rendering environment.\n * @template TScope - Data which is passed down the tree.\n * @template TRoot - The type of the root for a rendering environment.\n * @template TResult - The type of exposed values.\n */\nexport class Renderer<\n\tTNode extends object,\n\tTScope,\n\tTRoot extends TNode | undefined = TNode,\n\tTResult = ElementValue<TNode>,\n> {\n\t/**\n\t * @internal\n\t * A weakmap which stores element trees by root.\n\t */\n\tdeclare cache: WeakMap<object, Retainer<TNode, TScope>>;\n\tdeclare adapter: RenderAdapter<TNode, TScope, TRoot, TResult>;\n\tconstructor(adapter: Partial<RenderAdapter<TNode, TScope, TRoot, TResult>>) {\n\t\tthis.cache = new WeakMap();\n\t\tthis.adapter = {...defaultAdapter, ...adapter};\n\t}\n\n\t/**\n\t * Renders an element tree into a specific root.\n\t *\n\t * @param children - An element tree. Rendering null deletes cached renders.\n\t * @param root - The root to be rendered into. The renderer caches renders\n\t * per root.\n\t * @param bridge - An optional context that will be the ancestor context of\n\t * all elements in the tree. Useful for connecting different renderers so\n\t * that events/provisions/errors properly propagate. The context for a given\n\t * root must be the same between renders.\n\t *\n\t * @returns The result of rendering the children, or a possible promise of\n\t * the result if the element tree renders asynchronously.\n\t */\n\trender(\n\t\tchildren: Children,\n\t\troot?: TRoot | undefined,\n\t\tbridge?: Context | undefined,\n\t): Promise<TResult> | TResult {\n\t\tconst ret = getRootRetainer(this, bridge, {children, root});\n\t\treturn renderRoot(this.adapter, root, ret, children) as\n\t\t\t| Promise<TResult>\n\t\t\t| TResult;\n\t}\n\n\thydrate(\n\t\tchildren: Children,\n\t\troot: TRoot,\n\t\tbridge?: Context | undefined,\n\t): Promise<TResult> | TResult {\n\t\tconst ret = getRootRetainer(this, bridge, {\n\t\t\tchildren,\n\t\t\troot,\n\t\t\thydrate: true,\n\t\t});\n\t\treturn renderRoot(this.adapter, root, ret, children) as\n\t\t\t| Promise<TResult>\n\t\t\t| TResult;\n\t}\n}\n\n/*** PRIVATE RENDERER FUNCTIONS ***/\nfunction getRootRetainer<\n\tTNode extends object,\n\tTScope,\n\tTRoot extends TNode | undefined,\n>(\n\trenderer: Renderer<TNode, TScope, TRoot, unknown>,\n\tbridge: Context | undefined,\n\t{\n\t\tchildren,\n\t\troot,\n\t\thydrate,\n\t}: {\n\t\tchildren: Children;\n\t\troot: TRoot | undefined;\n\t\thydrate?: boolean;\n\t},\n): Retainer<TNode, TScope> {\n\tlet ret: Retainer<TNode, TScope> | undefined;\n\tconst bridgeCtx = bridge && bridge[_ContextState];\n\tif (typeof root === \"object\" && root !== null) {\n\t\tret = renderer.cache.get(root);\n\t}\n\n\tconst adapter = renderer.adapter;\n\tif (ret === undefined) {\n\t\tret = new Retainer(createElement(Portal, {children, root, hydrate}));\n\t\tret.value = root;\n\t\tret.ctx = bridgeCtx as ContextState<any, any> | undefined;\n\t\tret.scope = adapter.scope({\n\t\t\ttag: Portal,\n\t\t\ttagName: getTagName(Portal),\n\t\t\tprops: stripSpecialProps(ret.el.props),\n\t\t\tscope: undefined,\n\t\t});\n\t\t// remember that typeof null === \"object\"\n\t\tif (typeof root === \"object\" && root !== null && children != null) {\n\t\t\trenderer.cache.set(root, ret);\n\t\t}\n\t} else if (ret.ctx !== bridgeCtx) {\n\t\tthrow new Error(\n\t\t\t\"A previous call to render() was passed a different context\",\n\t\t);\n\t} else {\n\t\tret.el = createElement(Portal, {children, root, hydrate});\n\t\tif (typeof root === \"object\" && root !== null && children == null) {\n\t\t\trenderer.cache.delete(root);\n\t\t}\n\t}\n\n\treturn ret;\n}\n\nfunction renderRoot<TNode, TScope, TRoot extends TNode | undefined, TResult>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, TResult>,\n\troot: TRoot | undefined,\n\tret: Retainer<TNode, TScope>,\n\tchildren: Children,\n): Promise<TResult> | TResult {\n\tconst diff = diffChildren(\n\t\tadapter,\n\t\troot,\n\t\tret,\n\t\tret.ctx,\n\t\tret.scope,\n\t\tret,\n\t\tchildren,\n\t);\n\n\tconst schedulePromises: Array<PromiseLike<unknown>> = [];\n\tif (isPromiseLike(diff)) {\n\t\treturn diff.then(() => {\n\t\t\tcommit(\n\t\t\t\tadapter,\n\t\t\t\tret,\n\t\t\t\tret,\n\t\t\t\tret.ctx,\n\t\t\t\tret.scope,\n\t\t\t\t0,\n\t\t\t\tschedulePromises,\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\tif (schedulePromises.length > 0) {\n\t\t\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\t\t\tif (typeof root !== \"object\" || root === null) {\n\t\t\t\t\t\tunmount(adapter, ret, ret.ctx, ret, false);\n\t\t\t\t\t}\n\t\t\t\t\treturn adapter.read(unwrap(getChildValues(ret)));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (typeof root !== \"object\" || root === null) {\n\t\t\t\tunmount(adapter, ret, ret.ctx, ret, false);\n\t\t\t}\n\t\t\treturn adapter.read(unwrap(getChildValues(ret)));\n\t\t});\n\t}\n\n\tcommit(adapter, ret, ret, ret.ctx, ret.scope, 0, schedulePromises, undefined);\n\tif (schedulePromises.length > 0) {\n\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\tif (typeof root !== \"object\" || root === null) {\n\t\t\t\tunmount(adapter, ret, ret.ctx, ret, false);\n\t\t\t}\n\t\t\treturn adapter.read(unwrap(getChildValues(ret)));\n\t\t});\n\t}\n\n\tif (typeof root !== \"object\" || root === null) {\n\t\tunmount(adapter, ret, ret.ctx, ret, false);\n\t}\n\treturn adapter.read(unwrap(getChildValues(ret)));\n}\n\nfunction diffChildren<TNode, TScope, TRoot extends TNode | undefined, TResult>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, TResult>,\n\troot: TRoot | undefined,\n\thost: Retainer<TNode, TScope>,\n\tctx: ContextState<TNode, TScope, TRoot, TResult> | undefined,\n\tscope: TScope | undefined,\n\tparent: Retainer<TNode, TScope>,\n\tnewChildren: Children,\n): Promise<undefined> | undefined {\n\tconst oldRetained = wrap(parent.children);\n\tconst newRetained: typeof oldRetained = [];\n\tconst newChildren1 = arrayify(newChildren);\n\tconst diffs: Array<Promise<undefined> | undefined> = [];\n\tlet childrenByKey: Map<Key, Retainer<TNode, TScope>> | undefined;\n\tlet seenKeys: Set<Key> | undefined;\n\tlet isAsync = false;\n\tlet oi = 0;\n\tlet oldLength = oldRetained.length;\n\tlet graveyard: Array<Retainer<TNode, TScope>> | undefined;\n\tfor (let ni = 0, newLength = newChildren1.length; ni < newLength; ni++) {\n\t\t// length checks to prevent index out of bounds deoptimizations.\n\t\tlet ret = oi >= oldLength ? undefined : oldRetained[oi];\n\t\tlet child = narrow(newChildren1[ni]);\n\t\t{\n\t\t\t// aligning new children with old retainers\n\t\t\tlet oldKey = typeof ret === \"object\" ? ret.el.props.key : undefined;\n\t\t\tlet newKey = typeof child === \"object\" ? child.props.key : undefined;\n\t\t\tif (newKey !== undefined && seenKeys && seenKeys.has(newKey)) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`Duplicate key found in <${getTagName(parent.el.tag)}>`,\n\t\t\t\t\tnewKey,\n\t\t\t\t);\n\t\t\t\tchild = cloneElement(child as Element);\n\t\t\t\tnewKey = child.props.key = undefined;\n\t\t\t}\n\n\t\t\tif (oldKey === newKey) {\n\t\t\t\tif (childrenByKey !== undefined && newKey !== undefined) {\n\t\t\t\t\tchildrenByKey.delete(newKey);\n\t\t\t\t}\n\n\t\t\t\toi++;\n\t\t\t} else {\n\t\t\t\tchildrenByKey = childrenByKey || createChildrenByKey(oldRetained, oi);\n\t\t\t\tif (newKey === undefined) {\n\t\t\t\t\twhile (ret !== undefined && oldKey !== undefined) {\n\t\t\t\t\t\toi++;\n\t\t\t\t\t\tret = oldRetained[oi];\n\t\t\t\t\t\toldKey = typeof ret === \"object\" ? ret.el.props.key : undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\toi++;\n\t\t\t\t} else {\n\t\t\t\t\tret = childrenByKey.get(newKey);\n\t\t\t\t\tif (ret !== undefined) {\n\t\t\t\t\t\tchildrenByKey.delete(newKey);\n\t\t\t\t\t}\n\n\t\t\t\t\t(seenKeys = seenKeys || new Set()).add(newKey);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet diff: Promise<undefined> | undefined = undefined;\n\t\tif (typeof child === \"object\") {\n\t\t\tlet childCopied = false;\n\t\t\tif (child.tag === Copy) {\n\t\t\t\tchildCopied = true;\n\t\t\t} else if (\n\t\t\t\ttypeof ret === \"object\" &&\n\t\t\t\tret.el === child &&\n\t\t\t\tgetFlag(ret, DidCommit)\n\t\t\t) {\n\t\t\t\t// If the child is the same as the retained element, we skip\n\t\t\t\t// re-rendering.\n\t\t\t\tchildCopied = true;\n\t\t\t} else {\n\t\t\t\tif (ret && ret.el.tag === child.tag) {\n\t\t\t\t\tret.el = child;\n\t\t\t\t\tif (child.props.copy && typeof child.props.copy !== \"string\") {\n\t\t\t\t\t\tchildCopied = true;\n\t\t\t\t\t}\n\t\t\t\t} else if (ret) {\n\t\t\t\t\tlet candidateFound = false;\n\t\t\t\t\t// we do not need to add the retainer to the graveyard if it is the\n\t\t\t\t\t// fallback of another retainer\n\t\t\t\t\t// search for the tag in fallback chain\n\t\t\t\t\tfor (\n\t\t\t\t\t\tlet predecessor = ret, candidate = ret.fallback;\n\t\t\t\t\t\tcandidate;\n\t\t\t\t\t\tpredecessor = candidate, candidate = candidate.fallback\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (candidate.el.tag === child.tag) {\n\t\t\t\t\t\t\t// If we find a retainer in the fallback chain with the same tag,\n\t\t\t\t\t\t\t// we reuse it rather than creating a new retainer to preserve\n\t\t\t\t\t\t\t// state. This behavior is useful for when a Suspense component\n\t\t\t\t\t\t\t// re-renders and the children are re-rendered quickly.\n\t\t\t\t\t\t\tconst clone = cloneRetainer(candidate);\n\t\t\t\t\t\t\tsetFlag(clone, IsResurrecting);\n\t\t\t\t\t\t\tpredecessor.fallback = clone;\n\t\t\t\t\t\t\tconst fallback = ret;\n\t\t\t\t\t\t\tret = candidate;\n\t\t\t\t\t\t\tret.el = child;\n\t\t\t\t\t\t\tret.fallback = fallback;\n\t\t\t\t\t\t\tsetFlag(ret, DidDiff, false);\n\t\t\t\t\t\t\tcandidateFound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!candidateFound) {\n\t\t\t\t\t\tconst fallback = ret;\n\t\t\t\t\t\tret = new Retainer<TNode, TScope>(child);\n\t\t\t\t\t\tret.fallback = fallback;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tret = new Retainer<TNode, TScope>(child);\n\t\t\t\t}\n\n\t\t\t\tif (childCopied && getFlag(ret, DidCommit)) {\n\t\t\t\t\t// pass\n\t\t\t\t} else if (child.tag === Raw || child.tag === Text) {\n\t\t\t\t\t// pass\n\t\t\t\t} else if (child.tag === Fragment) {\n\t\t\t\t\tdiff = diffChildren(\n\t\t\t\t\t\tadapter,\n\t\t\t\t\t\troot,\n\t\t\t\t\t\thost,\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tscope,\n\t\t\t\t\t\tret,\n\t\t\t\t\t\tret.el.props.children as Children,\n\t\t\t\t\t);\n\t\t\t\t} else if (typeof child.tag === \"function\") {\n\t\t\t\t\tdiff = diffComponent(adapter, root, host, ctx, scope, ret);\n\t\t\t\t} else {\n\t\t\t\t\tdiff = diffHost(adapter, root, ctx, scope, ret);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof ret === \"object\") {\n\t\t\t\tif (childCopied) {\n\t\t\t\t\tsetFlag(ret, IsCopied);\n\t\t\t\t\tdiff = getInflightDiff(ret);\n\t\t\t\t} else {\n\t\t\t\t\tsetFlag(ret, IsCopied, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isPromiseLike(diff)) {\n\t\t\t\tisAsync = true;\n\t\t\t}\n\t\t} else if (typeof child === \"string\") {\n\t\t\tif (typeof ret === \"object\" && ret.el.tag === Text) {\n\t\t\t\tret.el.props.value = child;\n\t\t\t} else {\n\t\t\t\tif (typeof ret === \"object\") {\n\t\t\t\t\t(graveyard = graveyard || []).push(ret);\n\t\t\t\t}\n\n\t\t\t\tret = new Retainer<TNode, TScope>(createElement(Text, {value: child}));\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof ret === \"object\") {\n\t\t\t\t(graveyard = graveyard || []).push(ret);\n\t\t\t}\n\n\t\t\tret = undefined;\n\t\t}\n\n\t\tdiffs[ni] = diff;\n\t\tnewRetained[ni] = ret;\n\t}\n\n\t// cleanup remaining retainers\n\tfor (; oi < oldLength; oi++) {\n\t\tconst ret = oldRetained[oi];\n\t\tif (\n\t\t\ttypeof ret === \"object\" &&\n\t\t\t(typeof ret.el.props.key === \"undefined\" ||\n\t\t\t\t!seenKeys ||\n\t\t\t\t!seenKeys.has(ret.el.props.key))\n\t\t) {\n\t\t\t(graveyard = graveyard || []).push(ret);\n\t\t}\n\t}\n\n\tif (childrenByKey !== undefined && childrenByKey.size > 0) {\n\t\tgraveyard = graveyard || [];\n\t\tfor (const ret of childrenByKey.values()) {\n\t\t\tgraveyard.push(ret);\n\t\t}\n\t}\n\n\tparent.children = unwrap(newRetained);\n\tif (isAsync) {\n\t\tconst diffs1 = Promise.all(diffs)\n\t\t\t.then(() => undefined)\n\t\t\t.finally(() => {\n\t\t\t\tsetFlag(parent, DidDiff);\n\t\t\t\tif (graveyard) {\n\t\t\t\t\tif (parent.graveyard) {\n\t\t\t\t\t\tfor (let i = 0; i < graveyard.length; i++) {\n\t\t\t\t\t\t\tparent.graveyard.push(graveyard[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tparent.graveyard = graveyard;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\tlet onNextDiffs!: Function;\n\t\tconst diffs2 = (parent.pendingDiff = safeRace([\n\t\t\tdiffs1,\n\t\t\tnew Promise<any>((resolve) => (onNextDiffs = resolve)),\n\t\t]));\n\n\t\tif (parent.onNextDiff) {\n\t\t\tparent.onNextDiff(diffs2);\n\t\t}\n\n\t\tparent.onNextDiff = onNextDiffs;\n\t\treturn diffs2;\n\t} else {\n\t\tsetFlag(parent, DidDiff);\n\t\tif (graveyard) {\n\t\t\tif (parent.graveyard) {\n\t\t\t\tfor (let i = 0; i < graveyard.length; i++) {\n\t\t\t\t\tparent.graveyard.push(graveyard[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tparent.graveyard = graveyard;\n\t\t\t}\n\t\t}\n\n\t\tif (parent.onNextDiff) {\n\t\t\tparent.onNextDiff(diffs);\n\t\t\tparent.onNextDiff = undefined;\n\t\t}\n\n\t\tparent.pendingDiff = undefined;\n\t}\n}\n\nfunction getInflightDiff(\n\tret: Retainer<unknown>,\n): Promise<undefined> | undefined {\n\t// It is not enough to check pendingDiff because pendingDiff is the diff for\n\t// children, but not the diff of an async component retainer's current run.\n\t// For the latter we check ctx.inflight.\n\tif (ret.ctx && ret.ctx.inflight) {\n\t\treturn ret.ctx.inflight[1];\n\t} else if (ret.pendingDiff) {\n\t\treturn ret.pendingDiff;\n\t}\n}\n\nfunction createChildrenByKey<TNode, TScope>(\n\tchildren: Array<Retainer<TNode, TScope> | undefined>,\n\toffset: number,\n): Map<Key, Retainer<TNode, TScope>> {\n\tconst childrenByKey = new Map<Key, Retainer<TNode, TScope>>();\n\tfor (let i = offset; i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tif (\n\t\t\ttypeof child === \"object\" &&\n\t\t\ttypeof child.el.props.key !== \"undefined\"\n\t\t) {\n\t\t\tchildrenByKey.set(child.el.props.key, child);\n\t\t}\n\t}\n\n\treturn childrenByKey;\n}\n\nfunction diffHost<TNode, TScope, TRoot extends TNode | undefined>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, unknown>,\n\troot: TRoot,\n\tctx: ContextState<TNode, TScope, TRoot> | undefined,\n\tscope: TScope | undefined,\n\tret: Retainer<TNode, TScope>,\n): Promise<undefined> | undefined {\n\tconst el = ret.el;\n\tconst tag = el.tag as string | symbol;\n\tif (el.tag === Portal) {\n\t\troot = ret.value = el.props.root;\n\t}\n\n\tif (getFlag(ret, DidCommit)) {\n\t\tscope = ret.scope;\n\t} else {\n\t\tscope = ret.scope = adapter.scope({\n\t\t\ttag,\n\t\t\ttagName: getTagName(tag),\n\t\t\tprops: el.props,\n\t\t\tscope,\n\t\t});\n\t}\n\n\treturn diffChildren(\n\t\tadapter,\n\t\troot,\n\t\tret,\n\t\tctx,\n\t\tscope,\n\t\tret,\n\t\tret.el.props.children,\n\t);\n}\n\nfunction commit<TNode, TScope, TRoot extends TNode | undefined, TResult>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, TResult>,\n\thost: Retainer<TNode, TScope>,\n\tret: Retainer<TNode, TScope>,\n\tctx: ContextState<TNode, TScope, TRoot, TResult> | undefined,\n\tscope: TScope | undefined,\n\tindex: number,\n\tschedulePromises: Array<PromiseLike<unknown>>,\n\thydrationNodes: Array<TNode> | undefined,\n): ElementValue<TNode> {\n\tif (getFlag(ret, IsCopied) && getFlag(ret, DidCommit)) {\n\t\treturn getValue(ret);\n\t}\n\n\tconst el = ret.el;\n\tconst tag = el.tag;\n\tif (\n\t\ttypeof tag === \"function\" ||\n\t\ttag === Fragment ||\n\t\ttag === Portal ||\n\t\ttag === Raw ||\n\t\ttag === Text\n\t) {\n\t\tif (typeof el.props.copy === \"string\") {\n\t\t\tconsole.error(\n\t\t\t\t`String copy prop ignored for <${getTagName(tag)}>. Use booleans instead.`,\n\t\t\t);\n\t\t}\n\t\tif (typeof el.props.hydrate === \"string\") {\n\t\t\tconsole.error(\n\t\t\t\t`String hydrate prop ignored for <${getTagName(tag)}>. Use booleans instead.`,\n\t\t\t);\n\t\t}\n\t}\n\n\tlet value: ElementValue<TNode>;\n\tlet skippedHydrationNodes: Array<TNode> | undefined;\n\tif (\n\t\thydrationNodes &&\n\t\tel.props.hydrate != null &&\n\t\t!el.props.hydrate &&\n\t\ttypeof el.props.hydrate !== \"string\"\n\t) {\n\t\tskippedHydrationNodes = hydrationNodes;\n\t\thydrationNodes = undefined;\n\t}\n\n\tif (typeof tag === \"function\") {\n\t\tret.ctx!.index = index;\n\t\tvalue = commitComponent(ret.ctx!, schedulePromises, hydrationNodes);\n\t} else {\n\t\tif (tag === Fragment) {\n\t\t\tvalue = commitChildren(\n\t\t\t\tadapter,\n\t\t\t\thost,\n\t\t\t\tctx,\n\t\t\t\tscope,\n\t\t\t\tret,\n\t\t\t\tindex,\n\t\t\t\tschedulePromises,\n\t\t\t\thydrationNodes,\n\t\t\t);\n\t\t} else if (tag === Text) {\n\t\t\tvalue = commitText(\n\t\t\t\tadapter,\n\t\t\t\tret,\n\t\t\t\tel as Element<Text>,\n\t\t\t\tscope,\n\t\t\t\thydrationNodes,\n\t\t\t);\n\t\t} else if (tag === Raw) {\n\t\t\tvalue = commitRaw(adapter, host, ret, scope, hydrationNodes);\n\t\t} else {\n\t\t\tvalue = commitHost(adapter, ret, ctx, schedulePromises, hydrationNodes);\n\t\t}\n\n\t\tif (ret.fallback) {\n\t\t\tunmount(adapter, host, ctx, ret.fallback, false);\n\t\t\tret.fallback = undefined;\n\t\t}\n\t}\n\n\tif (skippedHydrationNodes) {\n\t\tskippedHydrationNodes.splice(0, wrap(value).length);\n\t}\n\n\tif (!getFlag(ret, DidCommit)) {\n\t\tsetFlag(ret, DidCommit);\n\t\tif (\n\t\t\ttypeof tag !== \"function\" &&\n\t\t\ttag !== Fragment &&\n\t\t\ttag !== Portal &&\n\t\t\ttypeof el.props.ref === \"function\"\n\t\t) {\n\t\t\tel.props.ref(adapter.read(value));\n\t\t}\n\t}\n\n\treturn value;\n}\n\nfunction commitChildren<\n\tTNode,\n\tTScope,\n\tTRoot extends TNode | undefined,\n\tTResult,\n>(\n\tadapter: RenderAdapter<TNode, unknown, TRoot, TResult>,\n\thost: Retainer<TNode, TScope>,\n\tctx: ContextState<TNode, TScope, TRoot, TResult> | undefined,\n\tscope: TScope | undefined,\n\tparent: Retainer<TNode, TScope>,\n\tindex: number,\n\tschedulePromises: Array<PromiseLike<unknown>>,\n\thydrationNodes: Array<TNode> | undefined,\n): Array<TNode> {\n\tlet values: Array<TNode> = [];\n\tfor (let i = 0, children = wrap(parent.children); i < children.length; i++) {\n\t\tlet child = children[i];\n\t\tlet schedulePromises1: Array<unknown> | undefined;\n\t\tlet isSchedulingFallback = false;\n\t\twhile (\n\t\t\tchild &&\n\t\t\t((!getFlag(child, DidDiff) && child.fallback) ||\n\t\t\t\tgetFlag(child, IsScheduling))\n\t\t) {\n\t\t\t// If the child is scheduling, it is a component retainer so ctx will be\n\t\t\t// defined.\n\t\t\tif (getFlag(child, IsScheduling) && child.ctx!.schedule) {\n\t\t\t\t(schedulePromises1 = schedulePromises1 || []).push(\n\t\t\t\t\tchild.ctx!.schedule.promise,\n\t\t\t\t);\n\t\t\t\tisSchedulingFallback = true;\n\t\t\t}\n\n\t\t\tif (!getFlag(child, DidDiff) && getFlag(child, DidCommit)) {\n\t\t\t\t// If this child has not diffed but has committed, it means it is a\n\t\t\t\t// fallback that is being resurrected.\n\t\t\t\tfor (const node of getChildValues(child)) {\n\t\t\t\t\tadapter.remove({\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tparentNode: host.value as TNode,\n\t\t\t\t\t\tisNested: false,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchild = child.fallback;\n\t\t\t// When a scheduling component is mounting asynchronously but diffs\n\t\t\t// immediately, it will cause previous async diffs to settle due to the\n\t\t\t// chasing mechanism. This would cause earlier renders to resolve sooner\n\t\t\t// than expected, because the render would be missing both its usual\n\t\t\t// children and the children of the scheduling render. Therefore, we need\n\t\t\t// to defer the settling of previous renders until either that render\n\t\t\t// settles, or the scheduling component finally finishes scheduling.\n\t\t\t//\n\t\t\t// To do this, we take advantage of the fact that commits for aborted\n\t\t\t// renders will still fire and walk the tree. During that commit walk,\n\t\t\t// when we encounter a scheduling element, we push a race of the\n\t\t\t// scheduling promise with the inflight diff of the async fallback\n\t\t\t// fallback to schedulePromises to delay the initiator.\n\t\t\t//\n\t\t\t// However, we need to make sure we only use the inflight diffs for the\n\t\t\t// fallback which we are trying to delay, in the case of multiple renders\n\t\t\t// and fallbacks. To do this, we take advantage of the fact that when\n\t\t\t// multiple renders race (e.g., render1->render2->render3->scheduling\n\t\t\t// component), the chasing mechanism will call stale commits in reverse\n\t\t\t// order.\n\t\t\t//\n\t\t\t// We can use this ordering to delay to find which fallbacks we need to\n\t\t\t// add to the race. Each commit call progressively marks an additional\n\t\t\t// fallback as a scheduling fallback, and does not contribute to the\n\t\t\t// scheduling promises if it is further than the last seen level.\n\t\t\t//\n\t\t\t// This prevents promise contamination where newer renders settle early\n\t\t\t// due to diffs from older renders.\n\t\t\tif (schedulePromises1 && isSchedulingFallback && child) {\n\t\t\t\tif (!getFlag(child, DidDiff)) {\n\t\t\t\t\tconst inflightDiff = getInflightDiff(child);\n\t\t\t\t\tschedulePromises1.push(inflightDiff);\n\t\t\t\t} else {\n\t\t\t\t\t// If a scheduling component's fallback has already diffed, we do not\n\t\t\t\t\t// need delay the render.\n\t\t\t\t\tschedulePromises1 = undefined;\n\t\t\t\t}\n\n\t\t\t\tif (getFlag(child, IsSchedulingFallback)) {\n\t\t\t\t\t// This fallback was marked by a more recent commit - keep processing\n\t\t\t\t\t// deeper levels\n\t\t\t\t\tisSchedulingFallback = true;\n\t\t\t\t} else {\n\t\t\t\t\t// First unmarked fallback we've encountered - mark it and stop\n\t\t\t\t\t// contributing to schedulePromises1 for deeper levels.\n\t\t\t\t\tsetFlag(child, IsSchedulingFallback, true);\n\t\t\t\t\tisSchedulingFallback = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (schedulePromises1 && schedulePromises1.length > 1) {\n\t\t\tschedulePromises.push(safeRace(schedulePromises1));\n\t\t}\n\n\t\tif (child) {\n\t\t\tconst value = commit(\n\t\t\t\tadapter,\n\t\t\t\thost,\n\t\t\t\tchild,\n\t\t\t\tctx,\n\t\t\t\tscope,\n\t\t\t\tindex,\n\t\t\t\tschedulePromises,\n\t\t\t\thydrationNodes,\n\t\t\t);\n\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (let j = 0; j < value.length; j++) {\n\t\t\t\t\tvalues.push(value[j]);\n\t\t\t\t}\n\t\t\t\tindex += value.length;\n\t\t\t} else if (value) {\n\t\t\t\tvalues.push(value);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (parent.graveyard) {\n\t\tfor (let i = 0; i < parent.graveyard.length; i++) {\n\t\t\tconst child = parent.graveyard[i];\n\t\t\tunmount(adapter, host, ctx, child, false);\n\t\t}\n\n\t\tparent.graveyard = undefined;\n\t}\n\n\tif (parent.lingerers) {\n\t\t// if parent.lingerers is set, a descendant component is unmounting\n\t\t// asynchronously, so we overwrite values to include lingerering DOM nodes.\n\t\tvalues = getChildValues(parent);\n\t}\n\n\treturn values;\n}\n\nfunction commitText<TNode, TScope>(\n\tadapter: RenderAdapter<TNode, TScope, TNode | undefined, unknown>,\n\tret: Retainer<TNode, TScope>,\n\tel: Element<Text>,\n\tscope: TScope | undefined,\n\thydrationNodes: Array<TNode> | undefined,\n): TNode {\n\tconst value = adapter.text({\n\t\tvalue: el.props.value,\n\t\tscope,\n\t\toldNode: ret.value as TNode,\n\t\thydrationNodes,\n\t});\n\n\tret.value = value;\n\treturn value;\n}\n\nfunction commitRaw<TNode, TScope>(\n\tadapter: RenderAdapter<TNode, TScope, TNode | undefined, unknown>,\n\thost: Retainer<TNode>,\n\tret: Retainer<TNode>,\n\tscope: TScope | undefined,\n\thydrationNodes: Array<TNode> | undefined,\n): ElementValue<TNode> {\n\tif (!ret.oldProps || ret.oldProps.value !== ret.el.props.value) {\n\t\tconst oldNodes = wrap(ret.value);\n\t\tfor (let i = 0; i < oldNodes.length; i++) {\n\t\t\tconst oldNode = oldNodes[i];\n\t\t\tadapter.remove({\n\t\t\t\tnode: oldNode,\n\t\t\t\tparentNode: host.value as TNode,\n\t\t\t\tisNested: false,\n\t\t\t});\n\t\t}\n\t\tret.value = adapter.raw({\n\t\t\tvalue: ret.el.props.value as any,\n\t\t\tscope,\n\t\t\thydrationNodes,\n\t\t});\n\t}\n\n\tret.oldProps = stripSpecialProps(ret.el.props);\n\treturn ret.value;\n}\n\nfunction commitHost<TNode, TScope, TRoot extends TNode | undefined>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, unknown>,\n\tret: Retainer<TNode, TScope>,\n\tctx: ContextState<TNode, TScope, TRoot, unknown> | undefined,\n\tschedulePromises: Array<PromiseLike<unknown>>,\n\thydrationNodes: Array<TNode> | undefined,\n): ElementValue<TNode> {\n\tif (getFlag(ret, IsCopied) && getFlag(ret, DidCommit)) {\n\t\treturn getValue(ret);\n\t}\n\n\tconst tag = ret.el.tag as string | symbol;\n\tconst props = stripSpecialProps(ret.el.props);\n\tconst oldProps = ret.oldProps;\n\tlet node = ret.value as TNode;\n\n\tlet copyProps: Set<string> | undefined;\n\tlet copyChildren = false;\n\tif (oldProps) {\n\t\tfor (const propName in props) {\n\t\t\tif (props[propName] === Copy) {\n\t\t\t\t// The Copy tag can be used to skip the patching of a prop.\n\t\t\t\t// <div class={shouldPatchClass ? \"class-name\" : Copy} />\n\t\t\t\tprops[propName] = oldProps[propName];\n\t\t\t\t(copyProps = copyProps || new Set()).add(propName);\n\t\t\t}\n\t\t}\n\n\t\tif (typeof ret.el.props.copy === \"string\") {\n\t\t\tconst copyMetaProp = new MetaProp(\"copy\", ret.el.props.copy);\n\t\t\tif (copyMetaProp.include) {\n\t\t\t\tfor (const propName of copyMetaProp.props) {\n\t\t\t\t\tif (propName in oldProps) {\n\t\t\t\t\t\tprops[propName] = oldProps[propName];\n\t\t\t\t\t\t(copyProps = copyProps || new Set()).add(propName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const propName in oldProps) {\n\t\t\t\t\tif (!copyMetaProp.props.has(propName)) {\n\t\t\t\t\t\tprops[propName] = oldProps[propName];\n\t\t\t\t\t\t(copyProps = copyProps || new Set()).add(propName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcopyChildren = copyMetaProp.includes(\"children\");\n\t\t}\n\t}\n\n\tconst scope = ret.scope;\n\tlet childHydrationNodes: Array<TNode> | undefined;\n\tlet quietProps: Set<string> | undefined;\n\tlet hydrationMetaProp: MetaProp | undefined;\n\tif (!getFlag(ret, DidCommit)) {\n\t\tif (tag === Portal) {\n\t\t\tif (ret.el.props.hydrate && typeof ret.el.props.hydrate !== \"string\") {\n\t\t\t\tchildHydrationNodes = adapter.adopt({\n\t\t\t\t\ttag,\n\t\t\t\t\ttagName: getTagName(tag),\n\t\t\t\t\tnode,\n\t\t\t\t\tprops,\n\t\t\t\t\tscope,\n\t\t\t\t});\n\n\t\t\t\tif (childHydrationNodes) {\n\t\t\t\t\tfor (let i = 0; i < childHydrationNodes.length; i++) {\n\t\t\t\t\t\tadapter.remove({\n\t\t\t\t\t\t\tnode: childHydrationNodes[i],\n\t\t\t\t\t\t\tparentNode: node,\n\t\t\t\t\t\t\tisNested: false,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!node && hydrationNodes) {\n\t\t\t\tconst nextChild = hydrationNodes.shift();\n\t\t\t\tif (typeof ret.el.props.hydrate === \"string\") {\n\t\t\t\t\thydrationMetaProp = new MetaProp(\"hydration\", ret.el.props.hydrate);\n\t\t\t\t\tif (hydrationMetaProp.include) {\n\t\t\t\t\t\t// if we're in inclusive mode, we add all props to quietProps and\n\t\t\t\t\t\t// remove props specified in the metaprop\n\t\t\t\t\t\tquietProps = new Set(Object.keys(props));\n\t\t\t\t\t\tfor (const propName of hydrationMetaProp.props) {\n\t\t\t\t\t\t\tquietProps.delete(propName);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquietProps = hydrationMetaProp.props;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tchildHydrationNodes = adapter.adopt({\n\t\t\t\t\ttag,\n\t\t\t\t\ttagName: getTagName(tag),\n\t\t\t\t\tnode: nextChild!,\n\t\t\t\t\tprops,\n\t\t\t\t\tscope,\n\t\t\t\t});\n\n\t\t\t\tif (childHydrationNodes) {\n\t\t\t\t\tnode = nextChild!;\n\t\t\t\t\tfor (let i = 0; i < childHydrationNodes.length; i++) {\n\t\t\t\t\t\tadapter.remove({\n\t\t\t\t\t\t\tnode: childHydrationNodes[i],\n\t\t\t\t\t\t\tparentNode: node,\n\t\t\t\t\t\t\tisNested: false,\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\t// TODO: For some reason, there are cases where the node is already set\n\t\t\t// and the DidCommit flag is false. Not checking for node fails a test\n\t\t\t// where a child dispatches an event in a schedule callback, the parent\n\t\t\t// listens for this event and refreshes.\n\t\t\tif (!node) {\n\t\t\t\tnode = adapter.create({\n\t\t\t\t\ttag,\n\t\t\t\t\ttagName: getTagName(tag),\n\t\t\t\t\tprops,\n\t\t\t\t\tscope,\n\t\t\t\t});\n\t\t\t}\n\t\t\tret.value = node;\n\t\t}\n\t}\n\n\tif (tag !== Portal) {\n\t\tadapter.patch({\n\t\t\ttag,\n\t\t\ttagName: getTagName(tag),\n\t\t\tnode,\n\t\t\tprops,\n\t\t\toldProps,\n\t\t\tscope,\n\t\t\tcopyProps,\n\t\t\tisHydrating: !!childHydrationNodes,\n\t\t\tquietProps,\n\t\t});\n\t}\n\n\tif (!copyChildren) {\n\t\tconst children = commitChildren(\n\t\t\tadapter,\n\t\t\tret,\n\t\t\tctx,\n\t\t\tscope,\n\t\t\tret,\n\t\t\t0,\n\t\t\tschedulePromises,\n\t\t\thydrationMetaProp && !hydrationMetaProp.includes(\"children\")\n\t\t\t\t? undefined\n\t\t\t\t: childHydrationNodes,\n\t\t);\n\n\t\tadapter.arrange({\n\t\t\ttag,\n\t\t\ttagName: getTagName(tag),\n\t\t\tnode: node,\n\t\t\tprops,\n\t\t\tchildren,\n\t\t\toldProps,\n\t\t});\n\t}\n\n\tret.oldProps = props;\n\tif (tag === Portal) {\n\t\tflush(adapter, ret.value as TRoot);\n\t\t// The root passed to Portal elements are opaque to parents so we return\n\t\t// undefined here.\n\t\treturn;\n\t}\n\n\treturn node;\n}\n\nclass MetaProp {\n\tdeclare include: boolean;\n\tdeclare props: Set<string>;\n\n\tconstructor(propName: string, propValue: string) {\n\t\tthis.include = true;\n\t\tthis.props = new Set<string>();\n\t\tlet noBangs = true;\n\t\tlet allBangs = true;\n\t\tconst tokens = propValue.split(/[,\\s]+/);\n\t\tfor (let i = 0; i < tokens.length; i++) {\n\t\t\tconst token = tokens[i].trim();\n\t\t\tif (!token) {\n\t\t\t\tcontinue;\n\t\t\t} else if (token.startsWith(\"!\")) {\n\t\t\t\tnoBangs = false;\n\t\t\t\tthis.props.add(token.slice(1));\n\t\t\t} else {\n\t\t\t\tallBangs = false;\n\t\t\t\tthis.props.add(token);\n\t\t\t}\n\t\t}\n\n\t\tif (!allBangs && !noBangs) {\n\t\t\tconsole.error(\n\t\t\t\t`Invalid ${propName} prop \"${propValue}\".\\nUse prop or !prop but not both.`,\n\t\t\t);\n\t\t\tthis.include = true;\n\t\t\tthis.props.clear();\n\t\t} else {\n\t\t\tthis.include = noBangs;\n\t\t}\n\t}\n\n\tincludes(propName: string): boolean {\n\t\tif (this.include) {\n\t\t\treturn this.props.has(propName);\n\t\t} else {\n\t\t\treturn !this.props.has(propName);\n\t\t}\n\t}\n}\n\nfunction contextContains(parent: ContextState, child: ContextState): boolean {\n\tfor (\n\t\tlet current: ContextState | undefined = child;\n\t\tcurrent !== undefined;\n\t\tcurrent = current.parent\n\t) {\n\t\tif (current === parent) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n// When rendering is done without a root, we use this special anonymous root to\n// make sure after callbacks are still called.\nconst ANONYMOUS_ROOT: any = {};\nfunction flush<TRoot>(\n\tadapter: RenderAdapter<unknown, unknown, TRoot>,\n\troot: TRoot | undefined,\n\tinitiator?: ContextState,\n) {\n\tif (root != null) {\n\t\tadapter.finalize(root);\n\t}\n\n\tif (typeof root !== \"object\" || root === null) {\n\t\troot = ANONYMOUS_ROOT;\n\t}\n\n\t// The initiator is the context which initiated the rendering process. If\n\t// initiator is defined we call and clear all flush callbacks which are\n\t// registered with the initiator or with a child context of the initiator,\n\t// because they are fully rendered.\n\t//\n\t// If no initiator is provided, we can call and clear all flush callbacks\n\t// which are not scheduling.\n\tconst afterMap = afterMapByRoot.get(root as any);\n\tif (afterMap) {\n\t\tconst afterMap1 = new Map<ContextState, Set<Function>>();\n\t\tfor (const [ctx, callbacks] of afterMap) {\n\t\t\tif (\n\t\t\t\tgetFlag(ctx.ret, IsScheduling) ||\n\t\t\t\t(initiator && !contextContains(initiator, ctx))\n\t\t\t) {\n\t\t\t\t// copy over callbacks to the new map (defer them)\n\t\t\t\tafterMap.delete(ctx);\n\t\t\t\tafterMap1.set(ctx, callbacks);\n\t\t\t}\n\t\t}\n\n\t\tif (afterMap1.size) {\n\t\t\tafterMapByRoot.set(root as any, afterMap1);\n\t\t} else {\n\t\t\tafterMapByRoot.delete(root as any);\n\t\t}\n\n\t\tfor (const [ctx, callbacks] of afterMap) {\n\t\t\tconst value = adapter.read(getValue(ctx.ret));\n\t\t\tfor (const callback of callbacks) {\n\t\t\t\tcallback(value);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction unmount<TNode, TScope, TRoot extends TNode | undefined, TResult>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, TResult>,\n\thost: Retainer<TNode>,\n\tctx: ContextState<TNode, TScope, TRoot, TResult> | undefined,\n\tret: Retainer<TNode>,\n\tisNested: boolean,\n): void {\n\t// TODO: set the IsUnmounted flag consistently for all retainers\n\tif (ret.fallback) {\n\t\tunmount(adapter, host, ctx, ret.fallback, isNested);\n\t\tret.fallback = undefined;\n\t}\n\n\tif (getFlag(ret, IsResurrecting)) {\n\t\treturn;\n\t}\n\n\tif (ret.lingerers) {\n\t\tfor (let i = 0; i < ret.lingerers.length; i++) {\n\t\t\tconst lingerers = ret.lingerers[i];\n\t\t\tif (lingerers) {\n\t\t\t\tfor (const lingerer of lingerers) {\n\t\t\t\t\tunmount(adapter, host, ctx, lingerer, isNested);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tret.lingerers = undefined;\n\t}\n\n\tif (typeof ret.el.tag === \"function\") {\n\t\tunmountComponent(ret.ctx!, isNested);\n\t} else if (ret.el.tag === Fragment) {\n\t\tunmountChildren(adapter, host, ctx, ret, isNested);\n\t} else if (ret.el.tag === Portal) {\n\t\tunmountChildren(adapter, ret, ctx, ret, false);\n\t\tif (ret.value != null) {\n\t\t\tadapter.finalize(ret.value as TRoot);\n\t\t}\n\t} else {\n\t\tunmountChildren(adapter, ret, ctx, ret, true);\n\n\t\tif (getFlag(ret, DidCommit)) {\n\t\t\tif (ctx) {\n\t\t\t\t// Remove the value from every context which shares the same host.\n\t\t\t\tremoveEventTargetDelegates(\n\t\t\t\t\tctx.ctx,\n\t\t\t\t\t[ret.value],\n\t\t\t\t\t(ctx1) => ctx1[_ContextState].host === host,\n\t\t\t\t);\n\t\t\t}\n\t\t\tadapter.remove({\n\t\t\t\tnode: ret.value as TNode,\n\t\t\t\tparentNode: host.value as TNode,\n\t\t\t\tisNested,\n\t\t\t});\n\t\t}\n\t}\n}\n\nfunction unmountChildren<\n\tTNode,\n\tTScope,\n\tTRoot extends TNode | undefined,\n\tTResult,\n>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, TResult>,\n\thost: Retainer<TNode>,\n\tctx: ContextState<TNode, TScope, TRoot, TResult> | undefined,\n\tret: Retainer<TNode>,\n\tisNested: boolean,\n): void {\n\tif (ret.graveyard) {\n\t\tfor (let i = 0; i < ret.graveyard.length; i++) {\n\t\t\tconst child = ret.graveyard[i];\n\t\t\tunmount(adapter, host, ctx, child, isNested);\n\t\t}\n\n\t\tret.graveyard = undefined;\n\t}\n\n\tfor (let i = 0, children = wrap(ret.children); i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tif (typeof child === \"object\") {\n\t\t\tunmount(adapter, host, ctx, child, isNested);\n\t\t}\n\t}\n}\nconst provisionMaps = new WeakMap<ContextState, Map<unknown, unknown>>();\n\nconst scheduleMap = new WeakMap<ContextState, Set<Function>>();\n\nconst cleanupMap = new WeakMap<ContextState, Set<Function>>();\n\n// keys are roots\nconst afterMapByRoot = new WeakMap<object, Map<ContextState, Set<Function>>>();\n\ninterface PullController {\n\titerationP: Promise<ChildrenIteratorResult> | undefined;\n\tdiff: Promise<undefined> | undefined;\n\tonChildError: ((err: unknown) => void) | undefined;\n}\n\ninterface ScheduleController {\n\tpromise: Promise<unknown>;\n\tonAbort: () => void;\n}\n\n// TODO: allow ContextState to be initialized for testing purposes\n/**\n * @internal\n * The internal class which holds context data.\n */\nclass ContextState<\n\tTNode = unknown,\n\tTScope = unknown,\n\tTRoot extends TNode | undefined = TNode | undefined,\n\tTResult = unknown,\n> {\n\t/** The adapter of the renderer which created this context. */\n\tdeclare adapter: RenderAdapter<TNode, TScope, TRoot, TResult>;\n\n\t/** The root node as set by the nearest ancestor portal. */\n\tdeclare root: TRoot | undefined;\n\n\t/**\n\t * The nearest ancestor host or portal retainer.\n\t *\n\t * When refresh is called, the host element will be arranged as the last step\n\t * of the commit, to make sure the parent's children properly reflects the\n\t * components's childrenk\n\t */\n\tdeclare host: Retainer<TNode>;\n\n\t/** The parent context state. */\n\tdeclare parent: ContextState | undefined;\n\n\t/** The actual context associated with this state. */\n\tdeclare ctx: Context<unknown, TResult>;\n\n\t/** The value of the scope at the point of element's creation. */\n\tdeclare scope: TScope | undefined;\n\n\t/** The internal node associated with this context. */\n\tdeclare ret: Retainer<TNode>;\n\n\t/**\n\t * Any iterator returned by a component function.\n\t *\n\t * Existence of this property implies that the component is a generator\n\t * component. It is deleted when a component is returned.\n\t */\n\tdeclare iterator:\n\t\t| Iterator<Children, Children | void, unknown>\n\t\t| AsyncIterator<Children, Children | void, unknown>\n\t\t| undefined;\n\n\t// See runComponent() for a description of these properties.\n\tdeclare inflight: [Promise<undefined>, Promise<undefined>] | undefined;\n\tdeclare enqueued: [Promise<undefined>, Promise<undefined>] | undefined;\n\n\tdeclare pull: PullController | undefined;\n\n\t// The onPropsProvided callback is set when a component requests props via\n\t// the for await...of loop and props are not available. It is called when\n\t// the component is updated or refreshed.\n\tdeclare onPropsProvided: ((props: unknown) => unknown) | undefined;\n\t// The onPropsRequested callback is set when a component is updated or\n\t// refreshed but the new props are not consumed. It is called when the new\n\t// props are requested.\n\tdeclare onPropsRequested: (() => unknown) | undefined;\n\n\t// The last known index of the component's children, relative to its nearest\n\t// ancestor host or portal.\n\tdeclare index: number;\n\n\tdeclare schedule: ScheduleController | undefined;\n\n\tconstructor(\n\t\tadapter: RenderAdapter<TNode, TScope, TRoot, TResult>,\n\t\troot: TRoot,\n\t\thost: Retainer<TNode>,\n\t\tparent: ContextState | undefined,\n\t\tscope: TScope | undefined,\n\t\tret: Retainer<TNode>,\n\t) {\n\t\tthis.adapter = adapter;\n\t\tthis.root = root;\n\t\tthis.host = host;\n\t\tthis.parent = parent;\n\t\t// This property must be set after this.parent is set because the Context\n\t\t// constructor reads this.parent.\n\t\tthis.ctx = new Context(this);\n\t\tthis.scope = scope;\n\t\tthis.ret = ret;\n\n\t\tthis.iterator = undefined;\n\t\tthis.inflight = undefined;\n\t\tthis.enqueued = undefined;\n\n\t\tthis.onPropsProvided = undefined;\n\t\tthis.onPropsRequested = undefined;\n\n\t\tthis.pull = undefined;\n\t\tthis.index = 0;\n\t\tthis.schedule = undefined;\n\t}\n}\n\n// Public type that only extracts props from component functions\nexport type ComponentProps<T> = T extends () => unknown\n\t? {}\n\t: T extends (props: infer U) => unknown\n\t\t? U\n\t\t: never;\n\n// Public helper type that handles both component functions and regular objects\nexport type ComponentPropsOrProps<T> = T extends Function\n\t? ComponentProps<T>\n\t: T;\n\nconst _ContextState = Symbol.for(\"crank.ContextState\");\n\n/**\n * A class which is instantiated and passed to every component as its this\n * value/second parameter. Contexts form a tree just like elements and all\n * components in the element tree are connected via contexts. Components can\n * use this tree to communicate data upwards via events and downwards via\n * provisions.\n *\n * @template [T=*] - The expected shape of the props passed to the component,\n * or a component function. Used to strongly type the Context iterator methods.\n * @template [TResult=*] - The readable element value type. It is used in\n * places such as the return value of refresh and the argument passed to\n * schedule and cleanup callbacks.\n */\nexport class Context<\n\tT = any,\n\tTResult = any,\n> extends CustomEventTarget<Context> {\n\t/**\n\t * @internal\n\t * DO NOT USE READ THIS PROPERTY.\n\t */\n\tdeclare [_ContextState]: ContextState<unknown, unknown, unknown, TResult>;\n\n\t// TODO: If we could make the constructor function take a nicer value, it\n\t// would be useful for testing purposes.\n\tconstructor(state: ContextState<unknown, unknown, unknown, TResult>) {\n\t\tsuper(state.parent ? state.parent.ctx : null);\n\t\tthis[_ContextState] = state;\n\t}\n\n\t/**\n\t * The current props of the associated element.\n\t */\n\tget props(): ComponentPropsOrProps<T> {\n\t\treturn this[_ContextState].ret.el.props as ComponentPropsOrProps<T>;\n\t}\n\n\t/**\n\t * The current value of the associated element.\n\t *\n\t * @deprecated\n\t */\n\tget value(): TResult {\n\t\tconsole.warn(\"Context.value is deprecated.\");\n\t\treturn this[_ContextState].adapter.read(getValue(this[_ContextState].ret));\n\t}\n\n\tget isExecuting(): boolean {\n\t\treturn getFlag(this[_ContextState].ret, IsExecuting);\n\t}\n\n\tget isUnmounted(): boolean {\n\t\treturn getFlag(this[_ContextState].ret, IsUnmounted);\n\t}\n\n\t*[Symbol.iterator](): Generator<ComponentPropsOrProps<T>, undefined> {\n\t\tconst ctx = this[_ContextState];\n\t\tsetFlag(ctx.ret, IsInForOfLoop);\n\t\ttry {\n\t\t\twhile (!getFlag(ctx.ret, IsUnmounted) && !getFlag(ctx.ret, IsErrored)) {\n\t\t\t\tif (getFlag(ctx.ret, NeedsToYield)) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`<${getTagName(ctx.ret.el.tag)}> context iterated twice without a yield`,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tsetFlag(ctx.ret, NeedsToYield);\n\t\t\t\t}\n\n\t\t\t\tyield ctx.ret.el.props as ComponentPropsOrProps<T>;\n\t\t\t}\n\t\t} finally {\n\t\t\tsetFlag(ctx.ret, IsInForOfLoop, false);\n\t\t}\n\t}\n\n\tasync *[Symbol.asyncIterator](): AsyncGenerator<\n\t\tComponentPropsOrProps<T>,\n\t\tundefined\n\t> {\n\t\tconst ctx = this[_ContextState];\n\t\tsetFlag(ctx.ret, IsInForAwaitOfLoop);\n\t\ttry {\n\t\t\twhile (!getFlag(ctx.ret, IsUnmounted) && !getFlag(ctx.ret, IsErrored)) {\n\t\t\t\tif (getFlag(ctx.ret, NeedsToYield)) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`<${getTagName(ctx.ret.el.tag)}> context iterated twice without a yield`,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tsetFlag(ctx.ret, NeedsToYield);\n\t\t\t\t}\n\n\t\t\t\tif (getFlag(ctx.ret, PropsAvailable)) {\n\t\t\t\t\tsetFlag(ctx.ret, PropsAvailable, false);\n\t\t\t\t\tyield ctx.ret.el.props;\n\t\t\t\t} else {\n\t\t\t\t\tconst props = await new Promise<ComponentPropsOrProps<T>>(\n\t\t\t\t\t\t(resolve) =>\n\t\t\t\t\t\t\t(ctx.onPropsProvided = resolve as (props: unknown) => unknown),\n\t\t\t\t\t);\n\t\t\t\t\tif (getFlag(ctx.ret, IsUnmounted) || getFlag(ctx.ret, IsErrored)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tyield props;\n\t\t\t\t}\n\n\t\t\t\tif (ctx.onPropsRequested) {\n\t\t\t\t\tctx.onPropsRequested();\n\t\t\t\t\tctx.onPropsRequested = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tsetFlag(ctx.ret, IsInForAwaitOfLoop, false);\n\t\t\tif (ctx.onPropsRequested) {\n\t\t\t\tctx.onPropsRequested();\n\t\t\t\tctx.onPropsRequested = undefined;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Re-executes a component.\n\t *\n\t * @param callback - Optional callback to execute before refresh\n\t * @returns The rendered result of the component or a promise thereof if the\n\t * component or its children execute asynchronously.\n\t */\n\trefresh(callback?: () => unknown): Promise<TResult> | TResult {\n\t\tconst ctx = this[_ContextState];\n\t\tif (getFlag(ctx.ret, IsUnmounted)) {\n\t\t\tconsole.error(\n\t\t\t\t`Component <${getTagName(ctx.ret.el.tag)}> is unmounted. Check the isUnmounted property if necessary.`,\n\t\t\t);\n\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t} else if (getFlag(ctx.ret, IsExecuting)) {\n\t\t\tconsole.error(\n\t\t\t\t`Component <${getTagName(ctx.ret.el.tag)}> is already executing Check the isExecuting property if necessary.`,\n\t\t\t);\n\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t}\n\n\t\tif (callback) {\n\t\t\tconst result = callback();\n\t\t\tif (isPromiseLike(result)) {\n\t\t\t\treturn Promise.resolve(result).then(() => {\n\t\t\t\t\tif (!getFlag(ctx.ret, IsUnmounted)) {\n\t\t\t\t\t\treturn this.refresh();\n\t\t\t\t\t}\n\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (getFlag(ctx.ret, IsScheduling)) {\n\t\t\tsetFlag(ctx.ret, IsSchedulingRefresh);\n\t\t}\n\n\t\tlet diff: Promise<undefined> | undefined;\n\t\tconst schedulePromises: Array<PromiseLike<unknown>> = [];\n\t\ttry {\n\t\t\tsetFlag(ctx.ret, IsRefreshing);\n\t\t\tdiff = enqueueComponent(ctx);\n\t\t\tif (isPromiseLike(diff)) {\n\t\t\t\treturn diff\n\t\t\t\t\t.then(() => ctx.adapter.read(commitComponent(ctx, schedulePromises)))\n\t\t\t\t\t.then((result) => {\n\t\t\t\t\t\tif (schedulePromises.length) {\n\t\t\t\t\t\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\t\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t})\n\t\t\t\t\t.catch((err) => {\n\t\t\t\t\t\tconst diff = propagateError(ctx, err, schedulePromises);\n\t\t\t\t\t\tif (diff) {\n\t\t\t\t\t\t\treturn diff.then(() => {\n\t\t\t\t\t\t\t\tif (schedulePromises.length) {\n\t\t\t\t\t\t\t\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\t\t\t\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (schedulePromises.length) {\n\t\t\t\t\t\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\t\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t\t})\n\t\t\t\t\t.finally(() => setFlag(ctx.ret, IsRefreshing, false));\n\t\t\t}\n\n\t\t\tconst result = ctx.adapter.read(commitComponent(ctx, schedulePromises));\n\t\t\tif (schedulePromises.length) {\n\t\t\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\t// TODO: await schedulePromises\n\t\t\tconst diff = propagateError(ctx, err, schedulePromises);\n\t\t\tif (diff) {\n\t\t\t\treturn diff\n\t\t\t\t\t.then(() => {\n\t\t\t\t\t\tif (schedulePromises.length) {\n\t\t\t\t\t\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\t\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\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\t.then(() => ctx.adapter.read(getValue(ctx.ret)));\n\t\t\t}\n\n\t\t\tif (schedulePromises.length) {\n\t\t\t\treturn Promise.all(schedulePromises).then(() => {\n\t\t\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn ctx.adapter.read(getValue(ctx.ret));\n\t\t} finally {\n\t\t\tif (!isPromiseLike(diff)) {\n\t\t\t\tsetFlag(ctx.ret, IsRefreshing, false);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Registers a callback which fires when the component's children are\n\t * created. Will only fire once per callback and update.\n\t */\n\tschedule(): Promise<TResult>;\n\tschedule(callback: (value: TResult) => unknown): void;\n\tschedule(callback?: (value: TResult) => unknown): Promise<TResult> | void {\n\t\tif (!callback) {\n\t\t\treturn new Promise<TResult>((resolve) => this.schedule(resolve));\n\t\t}\n\n\t\tconst ctx = this[_ContextState];\n\t\tlet callbacks = scheduleMap.get(ctx);\n\t\tif (!callbacks) {\n\t\t\tcallbacks = new Set<Function>();\n\t\t\tscheduleMap.set(ctx, callbacks);\n\t\t}\n\n\t\tcallbacks.add(callback);\n\t}\n\n\t/**\n\t * Registers a callback which fires when the component's children are fully\n\t * rendered. Will only fire once per callback and update.\n\t */\n\tafter(): Promise<TResult>;\n\tafter(callback: (value: TResult) => unknown): void;\n\tafter(callback?: (value: TResult) => unknown): Promise<TResult> | void {\n\t\tif (!callback) {\n\t\t\treturn new Promise<TResult>((resolve) => this.after(resolve));\n\t\t}\n\t\tconst ctx = this[_ContextState];\n\t\tconst root = ctx.root || ANONYMOUS_ROOT;\n\t\tlet afterMap = afterMapByRoot.get(root);\n\t\tif (!afterMap) {\n\t\t\tafterMap = new Map<ContextState, Set<Function>>();\n\t\t\tafterMapByRoot.set(root, afterMap);\n\t\t}\n\n\t\tlet callbacks = afterMap.get(ctx);\n\t\tif (!callbacks) {\n\t\t\tcallbacks = new Set<Function>();\n\t\t\tafterMap.set(ctx, callbacks);\n\t\t}\n\n\t\tcallbacks.add(callback);\n\t}\n\n\t/**\n\t * @deprecated the flush() method has been renamed to after().\n\t */\n\tflush(): Promise<TResult>;\n\tflush(callback: (value: TResult) => unknown): void;\n\tflush(callback?: (value: TResult) => unknown): Promise<TResult> | void {\n\t\tconsole.error(\"Context.flush() method has been renamed to after()\");\n\t\tthis.after(callback!);\n\t}\n\n\t/**\n\t * Registers a callback which fires when the component unmounts.\n\t *\n\t * The callback can be async to defer the unmounting of a component's children.\n\t */\n\tcleanup(): Promise<TResult>;\n\tcleanup(callback: (value: TResult) => unknown): void;\n\tcleanup(callback?: (value: TResult) => unknown): Promise<TResult> | void {\n\t\tif (!callback) {\n\t\t\treturn new Promise<TResult>((resolve) => this.cleanup(resolve));\n\t\t}\n\t\tconst ctx = this[_ContextState];\n\n\t\tif (getFlag(ctx.ret, IsUnmounted)) {\n\t\t\tconst value = ctx.adapter.read(getValue(ctx.ret));\n\t\t\tcallback(value);\n\t\t\treturn;\n\t\t}\n\n\t\tlet callbacks = cleanupMap.get(ctx);\n\t\tif (!callbacks) {\n\t\t\tcallbacks = new Set<Function>();\n\t\t\tcleanupMap.set(ctx, callbacks);\n\t\t}\n\n\t\tcallbacks.add(callback);\n\t}\n\n\tconsume<TKey extends keyof ProvisionMap>(key: TKey): ProvisionMap[TKey];\n\tconsume(key: unknown): any;\n\tconsume(key: unknown): any {\n\t\tfor (\n\t\t\tlet ctx = this[_ContextState].parent;\n\t\t\tctx !== undefined;\n\t\t\tctx = ctx.parent\n\t\t) {\n\t\t\tconst provisions = provisionMaps.get(ctx);\n\t\t\tif (provisions && provisions.has(key)) {\n\t\t\t\treturn provisions.get(key)!;\n\t\t\t}\n\t\t}\n\t}\n\n\tprovide<TKey extends keyof ProvisionMap>(\n\t\tkey: TKey,\n\t\tvalue: ProvisionMap[TKey],\n\t): void;\n\tprovide(key: unknown, value: any): void;\n\tprovide(key: unknown, value: any): void {\n\t\tconst ctx = this[_ContextState];\n\t\tlet provisions = provisionMaps.get(ctx);\n\t\tif (!provisions) {\n\t\t\tprovisions = new Map();\n\t\t\tprovisionMaps.set(ctx, provisions);\n\t\t}\n\n\t\tprovisions.set(key, value);\n\t}\n\n\t[CustomEventTarget.dispatchEventOnSelf](ev: Event): void {\n\t\tconst ctx = this[_ContextState];\n\t\t// dispatchEvent calls the prop callback if it exists\n\t\tlet propCallback = ctx.ret.el.props[\"on\" + ev.type] as unknown;\n\t\tif (typeof propCallback === \"function\") {\n\t\t\tpropCallback(ev);\n\t\t} else {\n\t\t\tfor (const propName in ctx.ret.el.props) {\n\t\t\t\tif (propName.toLowerCase() === \"on\" + ev.type.toLowerCase()) {\n\t\t\t\t\tpropCallback = ctx.ret.el.props[propName] as unknown;\n\t\t\t\t\tif (typeof propCallback === \"function\") {\n\t\t\t\t\t\tpropCallback(ev);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction diffComponent<TNode, TScope, TRoot extends TNode | undefined, TResult>(\n\tadapter: RenderAdapter<TNode, TScope, TRoot, TResult>,\n\troot: TRoot | undefined,\n\thost: Retainer<TNode, TScope>,\n\tparent: ContextState | undefined,\n\tscope: TScope | undefined,\n\tret: Retainer<TNode>,\n): Promise<undefined> | undefined {\n\tlet ctx: ContextState<TNode>;\n\tif (ret.ctx) {\n\t\tctx = ret.ctx;\n\t\tif (getFlag(ctx.ret, IsExecuting)) {\n\t\t\tconsole.error(\n\t\t\t\t`Component <${getTagName(ctx.ret.el.tag)}> is already executing`,\n\t\t\t);\n\t\t\treturn;\n\t\t} else if (ctx.schedule) {\n\t\t\treturn ctx.schedule.promise.then(() => {\n\t\t\t\treturn diffComponent(adapter, root, host, parent, scope, ret);\n\t\t\t});\n\t\t}\n\t} else {\n\t\tctx = ret.ctx = new ContextState(adapter, root, host, parent, scope, ret);\n\t}\n\n\tsetFlag(ctx.ret, IsUpdating);\n\treturn enqueueComponent(ctx);\n}\n\nfunction diffComponentChildren<TNode, TResult>(\n\tctx: ContextState<TNode, unknown, TNode | undefined, TResult>,\n\tchildren: Children,\n\tisYield: boolean,\n): Promise<undefined> | undefined {\n\tif (getFlag(ctx.ret, IsUnmounted) || getFlag(ctx.ret, IsErrored)) {\n\t\treturn;\n\t} else if (children === undefined) {\n\t\tconsole.error(\n\t\t\t`Component <${getTagName(ctx.ret.el.tag)}> has ${isYield ? \"yielded\" : \"returned\"} undefined. If this was intentional, ${isYield ? \"yield\" : \"return\"} null instead.`,\n\t\t);\n\t}\n\n\tlet diff: Promise<undefined> | undefined;\n\ttry {\n\t\t// TODO: Use a different flag here to indicate the component is\n\t\t// synchronously rendering children\n\n\t\t// We set the isExecuting flag in case a child component dispatches an event\n\t\t// which bubbles to this component and causes a synchronous refresh().\n\t\tsetFlag(ctx.ret, IsExecuting);\n\t\tdiff = diffChildren(\n\t\t\tctx.adapter,\n\t\t\tctx.root,\n\t\t\tctx.host,\n\t\t\tctx,\n\t\t\tctx.scope,\n\t\t\tctx.ret,\n\t\t\tnarrow(children),\n\t\t);\n\t\tif (diff) {\n\t\t\tdiff = diff.catch((err) => handleChildError(ctx, err));\n\t\t}\n\t} catch (err) {\n\t\tdiff = handleChildError(ctx, err);\n\t} finally {\n\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t}\n\n\treturn diff;\n}\n\n/** Enqueues and executes the component associated with the context. */\nfunction enqueueComponent<TNode, TResult>(\n\tctx: ContextState<TNode, unknown, TNode | undefined, TResult>,\n): Promise<undefined> | undefined {\n\tif (!ctx.inflight) {\n\t\tconst [block, diff] = runComponent<TNode, TResult>(ctx);\n\t\tif (block) {\n\t\t\t// if block is a promise, diff is a promise\n\t\t\tctx.inflight = [block.finally(() => advanceComponent(ctx)), diff!];\n\t\t}\n\n\t\treturn diff;\n\t} else if (!ctx.enqueued) {\n\t\t// The enqueuedBlock and enqueuedDiff properties must be set\n\t\t// simultaneously, hence the usage of the Promise constructor.\n\t\tlet resolve: Function;\n\t\tctx.enqueued = [\n\t\t\tnew Promise<undefined>((resolve1) => (resolve = resolve1)).finally(() =>\n\t\t\t\tadvanceComponent(ctx),\n\t\t\t),\n\t\t\tctx.inflight[0]!.finally(() => {\n\t\t\t\tconst [block, diff] = runComponent<TNode, TResult>(ctx);\n\t\t\t\tresolve(block);\n\t\t\t\treturn diff;\n\t\t\t}),\n\t\t];\n\t}\n\n\treturn ctx.enqueued[1];\n}\n\n/** Called when the inflight block promise settles. */\nfunction advanceComponent(ctx: ContextState): void {\n\tctx.inflight = ctx.enqueued;\n\tctx.enqueued = undefined;\n}\n\n/**\n * This function is responsible for executing components, and handling the\n * different component types.\n *\n * @returns {[block, diff]} A tuple where:\n * - block is a promise or undefined which represents the duration during which\n * the component is blocked.\n * - diff is a promise or undefined which represents the duration for diffing\n * of children.\n *\n * While a component is blocked, further updates to the component are enqueued.\n *\n * Each component type blocks according to its implementation:\n * - Sync function components never block; when props or state change,\n * updates are immediately passed to children.\n * - Async function components block only while awaiting their own async work\n * (e.g., during an await), but do not block while their async children are rendering.\n * - Sync generator components block while their children are rendering;\n * they only resume once their children have finished.\n * - Async generator components can block in two different ways:\n * - By default, they behave like sync generator components, blocking while\n * the component or its children are rendering.\n * - Within a for await...of loop, they block only while waiting for new\n * props to be requested, and not while children are rendering.\n */\nfunction runComponent<TNode, TResult>(\n\tctx: ContextState<TNode, unknown, TNode | undefined, TResult>,\n): [Promise<undefined> | undefined, Promise<undefined> | undefined] {\n\tif (getFlag(ctx.ret, IsUnmounted)) {\n\t\treturn [undefined, undefined];\n\t}\n\n\tconst ret = ctx.ret;\n\tconst initial = !ctx.iterator;\n\tif (initial) {\n\t\tsetFlag(ctx.ret, IsExecuting);\n\t\tclearEventListeners(ctx.ctx);\n\t\tlet returned: ReturnType<Component>;\n\t\ttry {\n\t\t\treturned = (ret.el.tag as Component).call(ctx.ctx, ret.el.props, ctx.ctx);\n\t\t} catch (err) {\n\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t}\n\n\t\tif (isIteratorLike(returned)) {\n\t\t\tctx.iterator = returned;\n\t\t} else if (!isPromiseLike(returned)) {\n\t\t\t// sync function component\n\t\t\treturn [\n\t\t\t\tundefined,\n\t\t\t\tdiffComponentChildren<TNode, TResult>(ctx, returned, false),\n\t\t\t];\n\t\t} else {\n\t\t\t// async function component\n\t\t\tconst returned1 =\n\t\t\t\treturned instanceof Promise ? returned : Promise.resolve(returned);\n\t\t\treturn [\n\t\t\t\treturned1.catch(NOOP),\n\t\t\t\treturned1.then(\n\t\t\t\t\t(returned) =>\n\t\t\t\t\t\tdiffComponentChildren<TNode, TResult>(ctx, returned, false),\n\t\t\t\t\t(err) => {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t];\n\t\t}\n\t}\n\n\tlet iteration!: Promise<ChildrenIteratorResult> | ChildrenIteratorResult;\n\tif (initial) {\n\t\ttry {\n\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\titeration = ctx.iterator!.next();\n\t\t} catch (err) {\n\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t}\n\n\t\tif (isPromiseLike(iteration)) {\n\t\t\tsetFlag(ctx.ret, IsAsyncGen);\n\t\t} else {\n\t\t\tsetFlag(ctx.ret, IsSyncGen);\n\t\t}\n\t}\n\n\tif (getFlag(ctx.ret, IsSyncGen)) {\n\t\t// sync generator component\n\t\tif (!initial) {\n\t\t\ttry {\n\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\tconst oldResult = ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\titeration = ctx.iterator!.next(oldResult);\n\t\t\t} catch (err) {\n\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\tthrow err;\n\t\t\t} finally {\n\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t}\n\t\t}\n\n\t\tif (isPromiseLike(iteration)) {\n\t\t\tthrow new Error(\"Mixed generator component\");\n\t\t}\n\n\t\tif (\n\t\t\tgetFlag(ctx.ret, IsInForOfLoop) &&\n\t\t\t!getFlag(ctx.ret, NeedsToYield) &&\n\t\t\t!getFlag(ctx.ret, IsUnmounted) &&\n\t\t\t!getFlag(ctx.ret, IsSchedulingRefresh)\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t`Component <${getTagName(ctx.ret.el.tag)}> yielded/returned more than once in for...of loop`,\n\t\t\t);\n\t\t}\n\n\t\tsetFlag(ctx.ret, NeedsToYield, false);\n\t\tsetFlag(ctx.ret, IsSchedulingRefresh, false);\n\t\tif (iteration.done) {\n\t\t\tsetFlag(ctx.ret, IsSyncGen, false);\n\t\t\tctx.iterator = undefined;\n\t\t}\n\n\t\tconst diff = diffComponentChildren<TNode, TResult>(\n\t\t\tctx,\n\t\t\titeration.value as Children,\n\t\t\t!iteration.done,\n\t\t);\n\t\tconst block = isPromiseLike(diff) ? diff.catch(NOOP) : undefined;\n\t\treturn [block, diff];\n\t} else {\n\t\tif (getFlag(ctx.ret, IsInForAwaitOfLoop)) {\n\t\t\t// initializes the async generator loop\n\t\t\tpullComponent(ctx, iteration);\n\t\t\tconst block = resumePropsAsyncIterator(ctx);\n\t\t\treturn [block, ctx.pull && ctx.pull.diff];\n\t\t} else {\n\t\t\t// We call resumePropsAsyncIterator in case the component exits the\n\t\t\t// for...of loop\n\t\t\tresumePropsAsyncIterator(ctx);\n\t\t\tif (!initial) {\n\t\t\t\ttry {\n\t\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\t\tconst oldResult = ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\t\titeration = ctx.iterator!.next(oldResult);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\t\tthrow err;\n\t\t\t\t} finally {\n\t\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!isPromiseLike(iteration)) {\n\t\t\t\tthrow new Error(\"Mixed generator component\");\n\t\t\t}\n\n\t\t\tconst diff = iteration.then(\n\t\t\t\t(iteration) => {\n\t\t\t\t\tif (getFlag(ctx.ret, IsInForAwaitOfLoop)) {\n\t\t\t\t\t\t// We have entered a for await...of loop, so we start pulling\n\t\t\t\t\t\tpullComponent(ctx, iteration);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tgetFlag(ctx.ret, IsInForOfLoop) &&\n\t\t\t\t\t\t\t!getFlag(ctx.ret, NeedsToYield) &&\n\t\t\t\t\t\t\t!getFlag(ctx.ret, IsUnmounted) &&\n\t\t\t\t\t\t\t!getFlag(ctx.ret, IsSchedulingRefresh)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\t`Component <${getTagName(ctx.ret.el.tag)}> yielded/returned more than once in for...of loop`,\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\tsetFlag(ctx.ret, NeedsToYield, false);\n\t\t\t\t\tsetFlag(ctx.ret, IsSchedulingRefresh, false);\n\t\t\t\t\tif (iteration.done) {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsAsyncGen, false);\n\t\t\t\t\t\tctx.iterator = undefined;\n\t\t\t\t\t}\n\t\t\t\t\treturn diffComponentChildren<TNode, TResult>(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\t// Children can be void so we eliminate that here\n\t\t\t\t\t\titeration.value as Children,\n\t\t\t\t\t\t!iteration.done,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t(err) => {\n\t\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\t\tthrow err;\n\t\t\t\t},\n\t\t\t);\n\n\t\t\treturn [diff.catch(NOOP), diff];\n\t\t}\n\t}\n}\n\n/**\n * Called to resume the props async iterator for async generator components.\n *\n * @returns {Promise<undefined> | undefined} A possible promise which\n * represents the duration during which the component is blocked.\n */\nfunction resumePropsAsyncIterator(\n\tctx: ContextState,\n): Promise<undefined> | undefined {\n\tif (ctx.onPropsProvided) {\n\t\tctx.onPropsProvided(ctx.ret.el.props);\n\t\tctx.onPropsProvided = undefined;\n\t\tsetFlag(ctx.ret, PropsAvailable, false);\n\t} else {\n\t\tsetFlag(ctx.ret, PropsAvailable);\n\t\tif (getFlag(ctx.ret, IsInForAwaitOfLoop)) {\n\t\t\treturn new Promise<undefined>(\n\t\t\t\t(resolve) => (ctx.onPropsRequested = resolve as () => unknown),\n\t\t\t);\n\t\t}\n\t}\n\n\treturn (\n\t\tctx.pull && ctx.pull.iterationP && ctx.pull.iterationP.then(NOOP, NOOP)\n\t);\n}\n\n/**\n * The logic for pulling from async generator components when they are in a for\n * await...of loop is implemented here.\n *\n * It makes sense to group this logic in a single async loop to prevent race\n * conditions caused by calling next(), throw() and return() concurrently.\n */\nasync function pullComponent<TNode, TResult>(\n\tctx: ContextState<TNode, unknown, TNode, TResult>,\n\titerationP:\n\t\t| Promise<ChildrenIteratorResult>\n\t\t| ChildrenIteratorResult\n\t\t| undefined,\n): Promise<void> {\n\tif (!iterationP || ctx.pull) {\n\t\treturn;\n\t}\n\n\tctx.pull = {iterationP: undefined, diff: undefined, onChildError: undefined};\n\n\t// TODO: replace done with iteration\n\t//let iteration: ChildrenIteratorResult | undefined;\n\tlet done = false;\n\ttry {\n\t\tlet childError: any;\n\t\twhile (!done) {\n\t\t\tif (isPromiseLike(iterationP)) {\n\t\t\t\tctx.pull.iterationP = iterationP;\n\t\t\t}\n\n\t\t\tlet onDiff!: Function;\n\t\t\tctx.pull.diff = new Promise((resolve) => (onDiff = resolve)).then(\n\t\t\t\t(): undefined => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t!(getFlag(ctx.ret, IsUpdating) || getFlag(ctx.ret, IsRefreshing))\n\t\t\t\t\t) {\n\t\t\t\t\t\tcommitComponent(ctx, []);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t(err) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t!(getFlag(ctx.ret, IsUpdating) || getFlag(ctx.ret, IsRefreshing)) ||\n\t\t\t\t\t\t// TODO: is this flag necessary?\n\t\t\t\t\t\t!getFlag(ctx.ret, NeedsToYield)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn propagateError(ctx, err, []);\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow err;\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tlet iteration: ChildrenIteratorResult;\n\t\t\ttry {\n\t\t\t\titeration = await iterationP;\n\t\t\t} catch (err) {\n\t\t\t\tdone = true;\n\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\tsetFlag(ctx.ret, NeedsToYield, false);\n\t\t\t\tonDiff(Promise.reject(err));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// this must be set after iterationP is awaited\n\t\t\tlet oldResult: Promise<TResult>;\n\t\t\t{\n\t\t\t\t// The 'floating' flag tracks whether the promise passed to the generator\n\t\t\t\t// is handled (via await, then, or catch). If handled, we reject the\n\t\t\t\t// promise so the user can catch errors. If not, we inject the error back\n\t\t\t\t// into the generator using throw, like for sync generator components.\n\t\t\t\tlet floating = true;\n\t\t\t\tconst oldResult1 = new Promise<TResult>((resolve, reject) => {\n\t\t\t\t\tctx.ctx.schedule(resolve);\n\t\t\t\t\tctx.pull!.onChildError = (err: any) => {\n\t\t\t\t\t\treject(err);\n\t\t\t\t\t\tif (floating) {\n\t\t\t\t\t\t\tchildError = err;\n\t\t\t\t\t\t\tresumePropsAsyncIterator(ctx);\n\t\t\t\t\t\t\treturn ctx.pull!.diff;\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\toldResult1.catch(NOOP);\n\t\t\t\t// We use Object.create() to clone the promise for float detection\n\t\t\t\t// because modern JS engines skip calling .then() on promises awaited\n\t\t\t\t// with await.\n\t\t\t\toldResult = Object.create(oldResult1);\n\t\t\t\toldResult.then = function (\n\t\t\t\t\tonfulfilled?: ((value: TResult) => any) | null,\n\t\t\t\t\tonrejected?: ((reason: any) => any) | null,\n\t\t\t\t): Promise<any> {\n\t\t\t\t\tfloating = false;\n\t\t\t\t\treturn oldResult1.then(onfulfilled, onrejected);\n\t\t\t\t};\n\n\t\t\t\toldResult.catch = function (\n\t\t\t\t\tonrejected?: ((reason: any) => any) | null,\n\t\t\t\t): Promise<any> {\n\t\t\t\t\tfloating = false;\n\t\t\t\t\treturn oldResult1.catch(onrejected);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (childError != null) {\n\t\t\t\ttry {\n\t\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\t\tif (typeof ctx.iterator!.throw !== \"function\") {\n\t\t\t\t\t\tthrow childError;\n\t\t\t\t\t}\n\t\t\t\t\titeration = await ctx.iterator!.throw(childError);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tdone = true;\n\t\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\t\tsetFlag(ctx.ret, NeedsToYield, false);\n\t\t\t\t\tonDiff(Promise.reject(err));\n\t\t\t\t\tbreak;\n\t\t\t\t} finally {\n\t\t\t\t\tchildError = undefined;\n\t\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// this makes sure we pause before entering a loop if we yield before it\n\t\t\tif (!getFlag(ctx.ret, IsInForAwaitOfLoop)) {\n\t\t\t\tsetFlag(ctx.ret, PropsAvailable, false);\n\t\t\t}\n\n\t\t\tdone = !!iteration.done;\n\n\t\t\tlet diff: Promise<undefined> | undefined;\n\t\t\ttry {\n\t\t\t\tif (!isPromiseLike(iterationP)) {\n\t\t\t\t\t// if iterationP is an iteration and not a promise, the component was\n\t\t\t\t\t// not in a for await...of loop when the iteration started, so we can\n\t\t\t\t\t// skip the diffing of children as it is handled elsewhere.\n\t\t\t\t\tdiff = undefined;\n\t\t\t\t} else if (\n\t\t\t\t\t!getFlag(ctx.ret, NeedsToYield) &&\n\t\t\t\t\tgetFlag(ctx.ret, PropsAvailable) &&\n\t\t\t\t\tgetFlag(ctx.ret, IsInForAwaitOfLoop)\n\t\t\t\t) {\n\t\t\t\t\t// logic to skip yielded children in a stale for await of iteration.\n\t\t\t\t\tdiff = undefined;\n\t\t\t\t} else {\n\t\t\t\t\tdiff = diffComponentChildren<TNode, TResult>(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\titeration.value!,\n\t\t\t\t\t\t!iteration.done,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tonDiff(Promise.reject(err));\n\t\t\t} finally {\n\t\t\t\tonDiff(diff);\n\t\t\t\tsetFlag(ctx.ret, NeedsToYield, false);\n\t\t\t}\n\n\t\t\tif (getFlag(ctx.ret, IsUnmounted)) {\n\t\t\t\t// TODO: move this unmounted branch outside the loop\n\t\t\t\twhile (\n\t\t\t\t\t(!iteration || !iteration.done) &&\n\t\t\t\t\tctx.iterator &&\n\t\t\t\t\tgetFlag(ctx.ret, IsInForAwaitOfLoop)\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\t\t\titeration = await ctx.iterator.next(oldResult);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\t\t\t// we throw the error here to cause an unhandled rejection because\n\t\t\t\t\t\t// the promise returned from pullComponent is never awaited\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(!iteration || !iteration.done) &&\n\t\t\t\t\tctx.iterator &&\n\t\t\t\t\ttypeof ctx.iterator.return === \"function\"\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\t\t\tawait ctx.iterator.return();\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t} else if (!getFlag(ctx.ret, IsInForAwaitOfLoop)) {\n\t\t\t\t// we have exited the for...await of, so updates will be handled by the\n\t\t\t\t// regular runComponent/enqueueComponent logic.\n\t\t\t\tbreak;\n\t\t\t} else if (!iteration.done) {\n\t\t\t\ttry {\n\t\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\t\titerationP = ctx.iterator!.next(\n\t\t\t\t\t\toldResult,\n\t\t\t\t\t) as Promise<ChildrenIteratorResult>;\n\t\t\t\t} finally {\n\t\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tif (done) {\n\t\t\tsetFlag(ctx.ret, IsAsyncGen, false);\n\t\t\tctx.iterator = undefined;\n\t\t}\n\n\t\tctx.pull = undefined;\n\t}\n}\n\nfunction commitComponent<TNode>(\n\tctx: ContextState<TNode>,\n\tschedulePromises: Array<PromiseLike<unknown>>,\n\thydrationNodes?: Array<TNode> | undefined,\n): ElementValue<TNode> {\n\tif (ctx.schedule) {\n\t\tctx.schedule.promise.then(() => {\n\t\t\tcommitComponent(ctx, []);\n\t\t\tpropagateComponent(ctx);\n\t\t});\n\t\treturn getValue(ctx.ret);\n\t}\n\n\tconst values = commitChildren(\n\t\tctx.adapter,\n\t\tctx.host,\n\t\tctx,\n\t\tctx.scope,\n\t\tctx.ret,\n\t\tctx.index,\n\t\tschedulePromises,\n\t\thydrationNodes,\n\t);\n\n\tif (getFlag(ctx.ret, IsUnmounted)) {\n\t\treturn;\n\t}\n\n\taddEventTargetDelegates(ctx.ctx, values);\n\n\t// Execute schedule callbacks early to check for async deferral\n\tconst wasScheduling = getFlag(ctx.ret, IsScheduling);\n\tlet schedulePromises1: Array<PromiseLike<unknown>> | undefined;\n\tconst callbacks = scheduleMap.get(ctx);\n\tif (callbacks) {\n\t\tscheduleMap.delete(ctx);\n\t\tsetFlag(ctx.ret, IsScheduling);\n\t\tconst result = ctx.adapter.read(unwrap(values));\n\t\tfor (const callback of callbacks) {\n\t\t\tconst scheduleResult = callback(result);\n\t\t\tif (isPromiseLike(scheduleResult)) {\n\t\t\t\t(schedulePromises1 = schedulePromises1 || []).push(scheduleResult);\n\t\t\t}\n\t\t}\n\n\t\tif (schedulePromises1 && !getFlag(ctx.ret, DidCommit)) {\n\t\t\tconst scheduleCallbacksP = Promise.all(schedulePromises1).then(() => {\n\t\t\t\tsetFlag(ctx.ret, IsScheduling, wasScheduling);\n\t\t\t\tpropagateComponent(ctx);\n\t\t\t\tif (ctx.ret.fallback) {\n\t\t\t\t\tunmount(ctx.adapter, ctx.host, ctx.parent, ctx.ret.fallback, false);\n\t\t\t\t}\n\n\t\t\t\tctx.ret.fallback = undefined;\n\t\t\t});\n\n\t\t\tlet onAbort!: () => void;\n\t\t\tconst scheduleP = safeRace([\n\t\t\t\tscheduleCallbacksP,\n\t\t\t\tnew Promise<void>((resolve) => (onAbort = resolve)),\n\t\t\t]).finally(() => {\n\t\t\t\tctx.schedule = undefined;\n\t\t\t});\n\n\t\t\tctx.schedule = {promise: scheduleP, onAbort};\n\t\t\tschedulePromises.push(scheduleP);\n\t\t} else {\n\t\t\tsetFlag(ctx.ret, IsScheduling, wasScheduling);\n\t\t}\n\t} else {\n\t\tsetFlag(ctx.ret, IsScheduling, wasScheduling);\n\t}\n\n\tif (!getFlag(ctx.ret, IsScheduling)) {\n\t\tif (!getFlag(ctx.ret, IsUpdating)) {\n\t\t\tpropagateComponent(ctx);\n\t\t}\n\n\t\tif (ctx.ret.fallback) {\n\t\t\tunmount(ctx.adapter, ctx.host, ctx.parent, ctx.ret.fallback, false);\n\t\t}\n\n\t\tctx.ret.fallback = undefined;\n\t\tsetFlag(ctx.ret, IsUpdating, false);\n\t}\n\n\tsetFlag(ctx.ret, DidCommit);\n\t// We always use getValue() instead of the unwrapping values because there\n\t// are various ways in which the values could have been updated, especially\n\t// if schedule callbacks call refresh() or async mounting is happening.\n\treturn getValue(ctx.ret, true);\n}\n\n/**\n * Checks if a target retainer is active (contributing) in the host's retainer tree.\n * Performs a downward traversal from host to find if target is in the active path.\n */\nfunction isRetainerActive<TNode>(\n\ttarget: Retainer<TNode>,\n\thost: Retainer<TNode>,\n): boolean {\n\tconst stack: Retainer<TNode>[] = [host];\n\n\twhile (stack.length > 0) {\n\t\tconst current = stack.pop()!;\n\n\t\tif (current === target) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Add direct children to stack (skip if this is a host boundary)\n\t\t// Host boundaries are: DOM elements (string tags) or Portal, but NOT Fragment\n\t\tconst isHostBoundary =\n\t\t\tcurrent !== host &&\n\t\t\t((typeof current.el.tag === \"string\" && current.el.tag !== Fragment) ||\n\t\t\t\tcurrent.el.tag === Portal);\n\t\tif (current.children && !isHostBoundary) {\n\t\t\tconst children = wrap(current.children);\n\t\t\tfor (const child of children) {\n\t\t\t\tif (child) {\n\t\t\t\t\tstack.push(child);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add fallback chains (only if current retainer is using fallback)\n\t\tif (current.fallback && !getFlag(current, DidDiff)) {\n\t\t\tstack.push(current.fallback);\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Propagates component changes up to ancestors when rendering starts from a\n * component via refresh() or multiple for await...of renders. This handles\n * event listeners and DOM arrangement that would normally happen during\n * top-down rendering.\n */\nfunction propagateComponent<TNode>(ctx: ContextState<TNode>): void {\n\tconst values = getChildValues(ctx.ret, ctx.index);\n\taddEventTargetDelegates(\n\t\tctx.ctx,\n\t\tvalues,\n\t\t(ctx1) => ctx1[_ContextState].host === ctx.host,\n\t);\n\tconst host = ctx.host;\n\tconst initiator = ctx.ret;\n\n\t// Check if initiator is active in the host's tree\n\tif (!isRetainerActive(initiator, host)) {\n\t\treturn;\n\t}\n\n\tconst props = stripSpecialProps(host.el.props);\n\tconst hostChildren = getChildValues(host, 0);\n\n\tctx.adapter.arrange({\n\t\ttag: host.el.tag as string | symbol,\n\t\ttagName: getTagName(host.el.tag),\n\t\tnode: host.value as TNode,\n\t\tprops,\n\t\toldProps: props,\n\t\tchildren: hostChildren,\n\t});\n\n\tflush(ctx.adapter, ctx.root, ctx);\n}\n\nasync function unmountComponent(\n\tctx: ContextState,\n\tisNested: boolean,\n): Promise<undefined> {\n\tif (getFlag(ctx.ret, IsUnmounted)) {\n\t\treturn;\n\t}\n\n\tlet cleanupPromises: Array<PromiseLike<unknown>> | undefined;\n\t// TODO: think about errror handling for callbacks\n\tconst callbacks = cleanupMap.get(ctx);\n\tif (callbacks) {\n\t\tconst oldResult = ctx.adapter.read(getValue(ctx.ret));\n\t\tcleanupMap.delete(ctx);\n\t\tfor (const callback of callbacks) {\n\t\t\tconst cleanup = callback(oldResult);\n\t\t\tif (isPromiseLike(cleanup)) {\n\t\t\t\t(cleanupPromises = cleanupPromises || []).push(cleanup);\n\t\t\t}\n\t\t}\n\t}\n\n\tlet didLinger = false;\n\tif (!isNested && cleanupPromises && getChildValues(ctx.ret).length > 0) {\n\t\tdidLinger = true;\n\t\tconst index = ctx.index;\n\t\tconst lingerers = ctx.host.lingerers || (ctx.host.lingerers = []);\n\t\tlet set = lingerers[index];\n\t\tif (set == null) {\n\t\t\tset = new Set<Retainer<unknown>>();\n\t\t\tlingerers[index] = set;\n\t\t}\n\n\t\tset.add(ctx.ret);\n\t\tawait Promise.all(cleanupPromises);\n\t\tset!.delete(ctx.ret);\n\t\tif (set!.size === 0) {\n\t\t\tlingerers[index] = undefined;\n\t\t}\n\n\t\tif (!lingerers.some(Boolean)) {\n\t\t\t// If there are no lingerers remaining, we can remove the lingerers array\n\t\t\tctx.host.lingerers = undefined;\n\t\t}\n\t}\n\n\tif (getFlag(ctx.ret, IsUnmounted)) {\n\t\t// If the component was unmounted while awaiting the cleanup callbacks,\n\t\t// we do not need to continue unmounting.\n\t\treturn;\n\t}\n\n\tsetFlag(ctx.ret, IsUnmounted);\n\n\t// If component has pending schedule promises, resolve them since component\n\t// is unmounting\n\tif (ctx.schedule) {\n\t\tctx.schedule.onAbort();\n\t\tctx.schedule = undefined;\n\t}\n\n\tclearEventListeners(ctx.ctx);\n\tunmountChildren(ctx.adapter, ctx.host, ctx, ctx.ret, isNested);\n\tif (didLinger) {\n\t\t// If we lingered, we call finalize to ensure rendering is finalized\n\t\tif (ctx.root != null) {\n\t\t\tctx.adapter.finalize(ctx.root);\n\t\t}\n\t}\n\n\tif (ctx.iterator) {\n\t\tif (ctx.pull) {\n\t\t\t// we let pullComponent handle unmounting\n\t\t\tresumePropsAsyncIterator(ctx);\n\t\t\treturn;\n\t\t}\n\n\t\t// we wait for inflight value so yields resume with the most up to date\n\t\t// props\n\t\tif (ctx.inflight) {\n\t\t\tawait ctx.inflight[1];\n\t\t}\n\n\t\tlet iteration: ChildrenIteratorResult | undefined;\n\t\tif (getFlag(ctx.ret, IsInForOfLoop)) {\n\t\t\ttry {\n\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\tconst oldResult = ctx.adapter.read(getValue(ctx.ret));\n\t\t\t\tconst iterationP = ctx.iterator!.next(oldResult);\n\t\t\t\tif (isPromiseLike(iterationP)) {\n\t\t\t\t\tif (!getFlag(ctx.ret, IsAsyncGen)) {\n\t\t\t\t\t\tthrow new Error(\"Mixed generator component\");\n\t\t\t\t\t}\n\n\t\t\t\t\titeration = await iterationP;\n\t\t\t\t} else {\n\t\t\t\t\tif (!getFlag(ctx.ret, IsSyncGen)) {\n\t\t\t\t\t\tthrow new Error(\"Mixed generator component\");\n\t\t\t\t\t}\n\n\t\t\t\t\titeration = iterationP;\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\tthrow err;\n\t\t\t} finally {\n\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t(!iteration || !iteration.done) &&\n\t\t\tctx.iterator &&\n\t\t\ttypeof ctx.iterator.return === \"function\"\n\t\t) {\n\t\t\ttry {\n\t\t\t\tsetFlag(ctx.ret, IsExecuting);\n\t\t\t\tconst iterationP = ctx.iterator.return();\n\t\t\t\tif (isPromiseLike(iterationP)) {\n\t\t\t\t\tif (!getFlag(ctx.ret, IsAsyncGen)) {\n\t\t\t\t\t\tthrow new Error(\"Mixed generator component\");\n\t\t\t\t\t}\n\n\t\t\t\t\titeration = await iterationP;\n\t\t\t\t} else {\n\t\t\t\t\tif (!getFlag(ctx.ret, IsSyncGen)) {\n\t\t\t\t\t\tthrow new Error(\"Mixed generator component\");\n\t\t\t\t\t}\n\n\t\t\t\t\titeration = iterationP;\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\tthrow err;\n\t\t\t} finally {\n\t\t\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/*** ERROR HANDLING UTILITIES ***/\nfunction handleChildError<TNode>(\n\tctx: ContextState<TNode, unknown, TNode>,\n\terr: unknown,\n): Promise<undefined> | undefined {\n\tif (!ctx.iterator) {\n\t\tthrow err;\n\t}\n\n\tif (ctx.pull) {\n\t\t// we let pullComponent handle child errors\n\t\tctx.pull.onChildError!(err);\n\t\treturn ctx.pull.diff;\n\t}\n\n\tif (!ctx.iterator.throw) {\n\t\tthrow err;\n\t}\n\n\tresumePropsAsyncIterator(ctx);\n\tlet iteration: ChildrenIteratorResult | Promise<ChildrenIteratorResult>;\n\ttry {\n\t\tsetFlag(ctx.ret, IsExecuting);\n\t\titeration = ctx.iterator.throw(err);\n\t} catch (err) {\n\t\tsetFlag(ctx.ret, IsErrored);\n\t\tthrow err;\n\t} finally {\n\t\tsetFlag(ctx.ret, IsExecuting, false);\n\t}\n\n\tif (isPromiseLike(iteration)) {\n\t\treturn iteration.then(\n\t\t\t(iteration) => {\n\t\t\t\tif (iteration.done) {\n\t\t\t\t\tsetFlag(ctx.ret, IsSyncGen, false);\n\t\t\t\t\tsetFlag(ctx.ret, IsAsyncGen, false);\n\t\t\t\t\tctx.iterator = undefined;\n\t\t\t\t}\n\n\t\t\t\treturn diffComponentChildren(\n\t\t\t\t\tctx,\n\t\t\t\t\titeration.value as Children,\n\t\t\t\t\t!iteration.done,\n\t\t\t\t);\n\t\t\t},\n\t\t\t(err) => {\n\t\t\t\tsetFlag(ctx.ret, IsErrored);\n\t\t\t\tthrow err;\n\t\t\t},\n\t\t);\n\t}\n\n\tif (iteration.done) {\n\t\tsetFlag(ctx.ret, IsSyncGen, false);\n\t\tsetFlag(ctx.ret, IsAsyncGen, false);\n\t\tctx.iterator = undefined;\n\t}\n\n\treturn diffComponentChildren(\n\t\tctx,\n\t\titeration.value as Children,\n\t\t!iteration.done,\n\t);\n}\n\n/**\n * Propagates an error up the context tree by calling handleChildError with\n * each parent.\n *\n * @returns A promise which resolves to undefined when the error has been\n * handled, or undefined if the error was handled synchronously.\n */\nfunction propagateError<TNode>(\n\tctx: ContextState<TNode>,\n\terr: unknown,\n\tschedulePromises: Array<PromiseLike<unknown>>,\n): Promise<undefined> | undefined {\n\tconst parent = ctx.parent;\n\tif (!parent) {\n\t\tthrow err;\n\t}\n\n\tlet diff: Promise<undefined> | undefined;\n\ttry {\n\t\tdiff = handleChildError(parent, err);\n\t} catch (err) {\n\t\treturn propagateError(parent, err, schedulePromises);\n\t}\n\n\tif (isPromiseLike(diff)) {\n\t\treturn diff.then(\n\t\t\t() => void commitComponent(parent, schedulePromises),\n\t\t\t(err) => propagateError(parent, err, schedulePromises),\n\t\t);\n\t}\n\n\tcommitComponent(parent, schedulePromises);\n}\n\n/**\n * An interface which can be extended to provide strongly typed provisions.\n * See Context.prototype.consume and Context.prototype.provide.\n */\nexport interface ProvisionMap extends Crank.ProvisionMap {}\n\nexport interface EventMap extends Crank.EventMap {}\n\ntype MappedEventListener<T extends string> = (ev: Crank.EventMap[T]) => unknown;\n\ntype MappedEventListenerOrEventListenerObject<T extends string> =\n\t| MappedEventListener<T>\n\t| {handleEvent: MappedEventListener<T>};\n\nexport interface Context extends Crank.Context {\n\taddEventListener<T extends string>(\n\t\ttype: T,\n\t\tlistener: MappedEventListenerOrEventListenerObject<T> | null,\n\t\toptions?: boolean | AddEventListenerOptions,\n\t): void;\n\n\tremoveEventListener<T extends string>(\n\t\ttype: T,\n\t\tlistener: MappedEventListenerOrEventListenerObject<T> | null,\n\t\toptions?: EventListenerOptions | boolean,\n\t): void;\n\n\tdispatchEvent<T extends string>(ev: EventMap[T] | Event): boolean;\n}\n\n// TODO: uncomment and use in the Element interface below\n// type CrankElement = Element;\ndeclare global {\n\tnamespace Crank {\n\t\texport interface EventMap {\n\t\t\t[tag: string]: Event;\n\t\t}\n\n\t\texport interface ProvisionMap {}\n\n\t\texport interface Context {}\n\t}\n\n\tnamespace JSX {\n\t\t// TODO: JSX Element type (the result of JSX expressions) don't work\n\t\t// because TypeScript demands that all Components return JSX elements for\n\t\t// some reason.\n\t\t// interface Element extends CrankElement {}\n\n\t\texport interface IntrinsicElements {\n\t\t\t[tag: string]: any;\n\t\t}\n\n\t\texport interface IntrinsicAttributes {\n\t\t\tchildren?: unknown;\n\t\t\tkey?: unknown;\n\t\t\tref?: unknown;\n\t\t\tcopy?: unknown;\n\t\t\thydrate?: unknown;\n\t\t}\n\n\t\texport interface ElementChildrenAttribute {\n\t\t\tchildren: {};\n\t\t}\n\t}\n}\n\n/**\n * A re-export of some Crank exports as the default export.\n *\n * Some JSX tools expect things like createElement/Fragment to be defined on\n * the default export. Prefer using the named exports directly.\n */\nexport default {createElement, Fragment};\n","/**\n * CSS utility functions for style property transformation.\n *\n * This module handles camelCase to kebab-case conversion and automatic\n * px unit conversion for numeric CSS values, making Crank more React-compatible.\n */\n\n/**\n * Converts camelCase CSS property names to kebab-case.\n * Handles vendor prefixes correctly (WebkitTransform -> -webkit-transform).\n */\nexport function camelToKebabCase(str: string): string {\n\t// Handle vendor prefixes that start with capital letters (WebkitTransform -> -webkit-transform)\n\tif (/^[A-Z]/.test(str)) {\n\t\treturn `-${str.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`).slice(1)}`;\n\t}\n\t// Handle normal camelCase (fontSize -> font-size)\n\treturn str.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n}\n\n/**\n * CSS properties that should remain unitless when given numeric values.\n * Based on React's list of unitless properties.\n */\nexport const UNITLESS_PROPERTIES = new Set([\n\t\"animation-iteration-count\",\n\t\"aspect-ratio\",\n\t\"border-image-outset\",\n\t\"border-image-slice\",\n\t\"border-image-width\",\n\t\"box-flex\",\n\t\"box-flex-group\",\n\t\"box-ordinal-group\",\n\t\"column-count\",\n\t\"columns\",\n\t\"flex\",\n\t\"flex-grow\",\n\t\"flex-positive\",\n\t\"flex-shrink\",\n\t\"flex-negative\",\n\t\"flex-order\",\n\t\"font-weight\",\n\t\"grid-area\",\n\t\"grid-column\",\n\t\"grid-column-end\",\n\t\"grid-column-span\",\n\t\"grid-column-start\",\n\t\"grid-row\",\n\t\"grid-row-end\",\n\t\"grid-row-span\",\n\t\"grid-row-start\",\n\t\"line-height\",\n\t\"opacity\",\n\t\"order\",\n\t\"orphans\",\n\t\"tab-size\",\n\t\"widows\",\n\t\"z-index\",\n\t\"zoom\",\n]);\n\n/**\n * Formats CSS property values, automatically adding \"px\" to numeric values\n * for properties that are not unitless.\n */\nexport function formatStyleValue(name: string, value: unknown): string {\n\tif (typeof value === \"number\") {\n\t\t// If the property should remain unitless, keep the number as-is\n\t\tif (UNITLESS_PROPERTIES.has(name)) {\n\t\t\treturn String(value);\n\t\t}\n\t\t// Otherwise, append \"px\" for numeric values\n\t\treturn `${value}px`;\n\t}\n\treturn String(value);\n}\n","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 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 if (\n\t\t\ttypeof window !== \"undefined\" &&\n\t\t\twindow.location &&\n\t\t\tnew URL(expectedValue, window.location.origin).href ===\n\t\t\t\tnew URL(actualValue, window.location.origin).href\n\t\t) {\n\t\t\t// attrs which are URLs will often be resolved to their full\n\t\t\t// href in the DOM, so we squash these errors\n\t\t} else {\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, Element>> = {\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}): 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}: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tscope: string | 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\treturn xmlns\n\t\t\t? document.createElementNS(xmlns, tag)\n\t\t\t: document.createElement(tag);\n\t},\n\n\tadopt({\n\t\ttag,\n\t\ttagName,\n\t\tnode,\n\t}: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tnode: 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\tif (\n\t\t\tnode === document.body ||\n\t\t\tnode === document.head ||\n\t\t\tnode === document.documentElement ||\n\t\t\tnode === document\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\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\tfor (const className in {...oldValue, ...value}) {\n\t\t\t\t\t\t\tconst classValue = value && value[className];\n\t\t\t\t\t\t\tif (classValue) {\n\t\t\t\t\t\t\t\telement.classList.add(className);\n\t\t\t\t\t\t\t\tif (hydratingClasses && hydratingClasses.has(className)) {\n\t\t\t\t\t\t\t\t\thydratingClasses.delete(className);\n\t\t\t\t\t\t\t\t} else if (isHydrating) {\n\t\t\t\t\t\t\t\t\tshouldIssueWarning = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\telement.classList.remove(className);\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\tif ((element as any)[name] !== value || 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}): 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}): 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}: {\n\t\tvalue: string;\n\t\thydrationNodes: Array<Node> | undefined;\n\t\toldNode: Node | undefined;\n\t}): Node {\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\tdocument.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 document.createTextNode(value);\n\t},\n\n\traw({\n\t\tvalue,\n\t\tscope: xmlns,\n\t\thydrationNodes,\n\t}: {\n\t\tvalue: string | Node;\n\t\tscope: string | undefined;\n\t\thydrationNodes: Array<Node> | undefined;\n\t}): ElementValue<Node> {\n\t\tlet nodes: Array<Node>;\n\t\tif (typeof value === \"string\") {\n\t\t\tconst el =\n\t\t\t\txmlns == null\n\t\t\t\t\t? document.createElement(\"div\")\n\t\t\t\t\t: xmlns === SVG_NAMESPACE\n\t\t\t\t\t\t? document.createElementNS(xmlns, \"svg\")\n\t\t\t\t\t\t: document.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","import {Portal, Renderer} from \"./crank.js\";\nimport type {ElementValue, RenderAdapter} from \"./crank.js\";\nimport {camelToKebabCase, formatStyleValue} from \"./_css.js\";\n\nconst voidTags = new Set([\n\t\"area\",\n\t\"base\",\n\t\"br\",\n\t\"col\",\n\t\"command\",\n\t\"embed\",\n\t\"hr\",\n\t\"img\",\n\t\"input\",\n\t\"keygen\",\n\t\"link\",\n\t\"meta\",\n\t\"param\",\n\t\"source\",\n\t\"track\",\n\t\"wbr\",\n]);\n\nfunction escape(text: string): string {\n\treturn text.replace(/[&<>\"']/g, (match) => {\n\t\tswitch (match) {\n\t\t\tcase \"&\":\n\t\t\t\treturn \"&amp;\";\n\t\t\tcase \"<\":\n\t\t\t\treturn \"&lt;\";\n\t\t\tcase \">\":\n\t\t\t\treturn \"&gt;\";\n\t\t\tcase '\"':\n\t\t\t\treturn \"&quot;\";\n\t\t\tcase \"'\":\n\t\t\t\treturn \"&#039;\";\n\t\t\tdefault:\n\t\t\t\treturn \"\";\n\t\t}\n\t});\n}\n\nfunction printStyleObject(style: Record<string, any>): string {\n\tconst cssStrings = [];\n\tfor (const [name, value] of Object.entries(style)) {\n\t\tif (value != null) {\n\t\t\tconst cssName = camelToKebabCase(name);\n\t\t\tconst cssValue = formatStyleValue(cssName, value);\n\t\t\tcssStrings.push(`${cssName}:${cssValue};`);\n\t\t}\n\t}\n\n\treturn cssStrings.join(\"\");\n}\n\nfunction printAttrs(props: Record<string, any>): string {\n\tconst attrs: string[] = [];\n\tfor (let [name, value] of Object.entries(props)) {\n\t\tif (name === \"innerHTML\" || name.startsWith(\"prop:\")) {\n\t\t\tcontinue;\n\t\t} else if (name === \"style\") {\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tattrs.push(`style=\"${escape(value)}\"`);\n\t\t\t} else if (typeof value === \"object\" && value !== null) {\n\t\t\t\tattrs.push(`style=\"${escape(printStyleObject(value))}\"`);\n\t\t\t}\n\t\t} else if (name === \"className\") {\n\t\t\tif (\"class\" in props || typeof value !== \"string\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tattrs.push(`class=\"${escape(value)}\"`);\n\t\t} else {\n\t\t\tif (name.startsWith(\"attr:\")) {\n\t\t\t\tname = name.slice(\"attr:\".length);\n\t\t\t}\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tattrs.push(`${escape(name)}=\"${escape(value)}\"`);\n\t\t\t} else if (typeof value === \"number\") {\n\t\t\t\tattrs.push(`${escape(name)}=\"${value}\"`);\n\t\t\t} else if (value === true) {\n\t\t\t\tattrs.push(`${escape(name)}`);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn attrs.join(\" \");\n}\n\ninterface Node {\n\tvalue?: string;\n}\n\nfunction join(children: Array<Node | string>): string {\n\tlet result = \"\";\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tresult += typeof child === \"string\" ? child : child.value;\n\t}\n\n\treturn result;\n}\n\nexport const impl: Partial<RenderAdapter<Node, undefined, Node, string>> = {\n\tcreate(): Node {\n\t\treturn {value: \"\"};\n\t},\n\n\ttext({value}: {value: string}): Node {\n\t\treturn {value: escape(value)};\n\t},\n\n\tread(value: ElementValue<Node>): string {\n\t\tif (Array.isArray(value)) {\n\t\t\treturn join(value);\n\t\t} else if (typeof value === \"undefined\") {\n\t\t\treturn \"\";\n\t\t} else if (typeof value === \"string\") {\n\t\t\treturn value;\n\t\t} else {\n\t\t\treturn value.value || \"\";\n\t\t}\n\t},\n\n\tarrange({\n\t\ttag,\n\t\ttagName,\n\t\tnode,\n\t\tprops,\n\t\tchildren,\n\t}: {\n\t\ttag: string | symbol;\n\t\ttagName: string;\n\t\tnode: Node;\n\t\tprops: Record<string, any>;\n\t\tchildren: Array<Node | string>;\n\t}): void {\n\t\tif (tag === Portal) {\n\t\t\treturn;\n\t\t} else if (typeof tag !== \"string\") {\n\t\t\tthrow new Error(`Unknown tag: ${tagName}`);\n\t\t}\n\n\t\tconst attrs = printAttrs(props);\n\t\tconst open = `<${tag}${attrs.length ? \" \" : \"\"}${attrs}>`;\n\t\tlet result: string;\n\t\tif (voidTags.has(tag)) {\n\t\t\tresult = open;\n\t\t} else {\n\t\t\tconst close = `</${tag}>`;\n\t\t\tconst contents =\n\t\t\t\t\"innerHTML\" in props ? props[\"innerHTML\"] : join(children);\n\t\t\tresult = `${open}${contents}${close}`;\n\t\t}\n\n\t\tnode.value = result;\n\t},\n};\n\nexport class HTMLRenderer extends Renderer<Node, undefined, any, string> {\n\tconstructor() {\n\t\tsuper(impl);\n\t}\n}\n\nexport const renderer = new HTMLRenderer();\n\ndeclare global {\n\tmodule Crank {\n\t\tinterface EventMap extends GlobalEventHandlersEventMap {}\n\t}\n}\n"],"names":["renderer"],"mappings":";;;;;;CAAA;CACA;CACA,MAAM,IAAI,GAAG,CAAC;CACd,MAAM,eAAe,GAAG,CAAC;CACzB,MAAM,SAAS,GAAG,CAAC;CACnB,MAAM,c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