import { n as AttrChangeHandler, t as ATTRIBUTES } from "./attributes-3r7Diua4.mjs"; import { i as PropertiesOf, n as CustomElementRegistry, r as EventsOf } from "./custom-elements-C7oiqw-y.mjs"; import { r as MaybeReactive } from "./index-B1FHAd5T.mjs"; import * as CSS from "csstype"; import { JSX } from "dom-expressions/src/jsx"; //#region src/jsx-runtime/element.d.ts type UnsupportedDomKeys = "ref" | "children" | "classList" | "$ServerOnly" | keyof JSX.CustomEventHandlersCamelCase | keyof JSX.CustomEventHandlersLowerCase | keyof JSX.DirectiveAttributes | keyof JSX.DirectiveFunctionAttributes | keyof JSX.AttrAttributes | keyof JSX.BoolAttributes | keyof JSX.OnCaptureAttributes; type DOMIntrinsicElements = { [K in keyof JSX.IntrinsicElements]: Omit }; type DOMElements = { [K in keyof JSX.IntrinsicElements]: JSX.IntrinsicElements[K] extends { ref?: infer R | undefined; } ? Extract any> extends ((el: infer E) => any) ? E : Element : Element }; declare function createElement(type: JSX$1.ElementType, allProps?: { ref?: (el: Element) => void; } & Record): JSX$1.Element | null; //#endregion //#region src/jsx-runtime/infer.d.ts /** * Promote keys `K` of `P` to required; leave the rest unchanged. * * @template P — the prop object type. * @template K — the keys to make required. * * @example * ```ts * type Optional = { a?: number; b?: string; c?: boolean }; * type AB = Require; * // { a: number; b: string; c?: boolean } * ``` */ type Require = { [X in K]-?: P[X] } & Omit; /** * Caller-facing wrap: each key accepts a plain value OR a reactive getter. * Name it when typing a call-site shape by hand (e.g. a class component's * constructor param, like `For`'s); the JSX checker applies it to intrinsic * and custom-element props. Function-typed props are wrapped too * (`Computed` is zero-arg, so TS still picks the handler signature by * arity for inline arrows). `Signal` must never be added explicitly — its * one-arg `Updater` half would collapse inline arrow params to implicit any. */ type MaybeReactiveProps

= { [K in keyof P]: undefined extends P[K] ? MaybeReactive> | undefined : MaybeReactive }; /** * Props of a function component that accepts reactive values — the same type * as {@link MaybeReactiveProps}, under the name components reach for. Each key * holds a plain value or a reactive source; the runtime hands the prop over * exactly as the caller wrote it. * * Read a key with `resolve(props.x)`, or pass it straight into JSX, which * accepts either form. Omit it and declare the plain value type when a * component takes static props only — callers then cannot pass a signal. * * @example * ```tsx * function Greeting(props: Props<{ name: string; excited?: boolean }>) { * return

Hello, {props.name}{() => (resolve(props.excited) ? "!" : ".")}

; * } * ``` */ type Props

= MaybeReactiveProps

; /** * @internal Call-site prop resolution for `JSX.LibraryManagedAttributes`: * - empty param (instance-field classes, no ctor) → wrap `PropsOf` * - any declared param → pass through verbatim * * Function components land in the pass-through branch: the runtime no longer * transforms their props, so the declared type is the contract on both sides. * A component opts into reactive props by declaring {@link Props} (or a * per-key `MaybeReactive`) itself. * * Emptiness is checked FIRST so a no-ctor class still gets its instance fields * wrapped; without that branch `` would have no prop type * at all, since TS reads class attributes off the constructor parameter. */ type ResolveProps> = [keyof NN] extends [never] ? C extends JSX$1.ElementType | JSX$1.ElementClass ? MaybeReactiveProps> : {} : NN; type PropKeysOf = keyof PropertiesOf & string; type AttrMap = C extends { [ATTRIBUTES]: infer M; } ? M : {}; type HandlerValue = H extends AttrChangeHandler ? string | null : H; type AttrsOf = AttrMap extends infer M ? M extends Record ? string extends keyof M ? {} : { [K in Exclude>]?: HandlerValue } : {} : {}; type PropNamespacedOf = { [K in PropKeysOf as `prop:${K}`]?: NonNullable[K]> }; type JsxEventsOf = { [K in keyof EventsOf & string as `on:${K}`]?: (ev: EventsOf[K]) => void }; type ChildrenOf = C extends { children: never; } ? {} : { children?: Children; }; type BaseDOMAttrs = JSX.DOMAttributes; /** * Full JSX prop type for a custom-element class (extends `HTMLElement`). * * Composes every surface the element can receive from JSX: * - **Attributes** — keys from `static [ATTRIBUTES]` (typed `MaybeReactive`). * Keys also present on the instance are dropped here so the flat key carries the property type. * - **Flat properties** — public instance fields, wrapped in `MaybeReactive`. * - **`prop:*`** — explicit property assignment for every field. * - **Events** — keys from `declare static events: { ... }` produce * `on:${K}` typed handlers (the only event syntax the runtime attaches). * - **Children** — `children?: Child` unless `static children: never`. * - **DOM attrs** — the standard dom-expressions surface (`class`, `style`, `ref`, …). * * @template C — the custom-element class (constructor type). * * @example * ```ts * \@attributes * class XRange extends HTMLElement { * static [ATTRIBUTES]: Attributes = { min(v) { this.min = +v! } }; * declare static events: { commit: CustomEvent }; * #slot = new Slot(); * get label() { return this.#slot.get(); } * set label(value: Node) { this.#slot.set(value) } * \@reactive() min = 0; * } * * type Props = ElementProps; * // { * // min?: MaybeReactive; * // "prop:min"?: number; * // "on:commit"?: (e: CustomEvent) => void; * // label?: Node * // children?: Node; * // // …plus ref, class, class:*, style, style:*, standard DOM events * // } * ``` * * @see {@link PropsOf} for class-components / function components (no attr/event synthesis). */ type ElementProps = BaseDOMAttrs & AttrsOf & PropertiesOf & PropNamespacedOf & JsxEventsOf & ChildrenOf; /** * Props for any component — class or function. * * The combination of the two specialised helpers: * - **Custom-element constructor** (`typeof Cls`, `Cls extends HTMLElement`) * → `ElementProps` — the full JSX surface (attrs, `prop:*`, `on:*`,children). * - **Everything else** (function component, class component ctor or * instance) → `ComponentProps` — the raw prop shape. * * @template T — constructor, function, or instance. * * @example * ```ts * // 1. Class instance (lets a generic flow) * class For { each: T[] = []; render() { return null } } * type ForProps = PropsOf>; * // ↑ { each?: T[] } * * // 2. Function component * const Greeting = (_p: { name: string; excited?: boolean }) => null; * type GreetingProps = PropsOf; * // ↑ { name: string; excited?: boolean } * * // 3. Class constructor * class Counter { count = 0; render() { return null } } * type CounterProps = PropsOf; * // ↑ { count?: number } * ``` */ type PropsOf = T extends AnyElementCtor ? ElementProps : T extends JSX$1.ElementType | JSX$1.ElementClass ? ComponentProps : never; /** * Props of a function or class COMPONENT (not a custom element): function * components use the first parameter as declared; classes use their public * instance fields. The custom-element half of `PropsOf` is `ElementProps`. */ type ComponentProps = T extends ((props: infer P, ...rest: any[]) => any) ? P extends object ? P : {} : PropertiesOf; type AnyElementCtor = abstract new (...args: any[]) => HTMLElement; //#endregion //#region src/jsx-runtime/fragment.d.ts /** Namespaces the HTML parser enters only on seeing an ``/`` tag. */ type ForeignNamespace = "svg" | "mathml"; /** * Used by the JSX transform for `<>...` fragments. * * Each child is routed through `mountChild`, which handles Nodes, strings, * numbers, arrays, and reactive getters — matching the behavior of any other * JSX container. `mountChild` also wires each child's cleanup via its own * `effectScope`, which links to the enclosing `effectScope` created by * `createElement(Fragment, ...)` for disposal propagation. * * **Raw HTML mode** — `{markup}`: the child is a * `MaybeReactive` rendered as markup inside a Slot region (comment * markers), so the server renderer and the hydration claim pass share the * region boundary. Reactive sources re-render the region on change. This is * the library's only raw-HTML sink: the string is NOT escaped — sanitize * untrusted input at the call site. `

= any> = new (props: P) => JSX$1.ElementClass; type ComponentFn

= any> = (props: P) => JSX$1.Element | null; //#endregion //#region src/jsx-runtime/properties.d.ts interface CSSProperties extends CSS.PropertiesHyphen { [key: `-${string}`]: string | number | undefined; } type CssStyleKey = Extract extends infer K ? K extends `-${string}` ? never : K : never; type StyleNamespace = { [K in CssStyleKey as `style:${K}`]?: CSSProperties[K] | null }; type PropNamespace = { [K in keyof E as K extends string ? `prop:${K}` : never]?: E[K] }; type XlinkAttrs = { "xlink:href"?: string | undefined; "xlink:title"?: string | undefined; "xlink:show"?: "new" | "replace" | "embed" | "other" | "none" | undefined; "xlink:role"?: string | undefined; "xlink:type"?: "simple" | "extended" | "locator" | "arc" | "resource" | "title" | undefined; "xlink:arcrole"?: string | undefined; "xlink:actuate"?: "onLoad" | "onRequest" | "other" | "none" | undefined; }; type ClassNamespace = { [K in `class:${string}`]?: boolean }; type XmlAttrs = { "xml:lang"?: string | undefined; "xml:space"?: "default" | "preserve" | undefined; "xml:base"?: string | undefined; }; type SvgNamespaceAttrs = XlinkAttrs & XmlAttrs; interface StyleAttrObject extends CSS.Properties {} type JsxNamespaces = (E extends ElementCSSInlineStyle ? { style?: string | StyleAttrObject; } & StyleNamespace : {}) & PropNamespace> & ClassNamespace; type JsxNamespaceKeys = "style" | `class:${string}` | `style:${string}` | `prop:${string}`; type WithJsxNamespaces = Omit & JsxNamespaces; //#endregion //#region src/jsx-runtime/children.d.ts type PrimitiveNodeType = Node | string | boolean | number | bigint | symbol | Date | RegExp | null | undefined; type AnyFn = (...args: any[]) => Children; type Children = PrimitiveNodeType | AnyFn | Element | DocumentFragment | Children[]; //#endregion export { Fragment as a, PropsOf as c, JSX$1 as i, Require as l, ComponentClass as n, MaybeReactiveProps as o, ComponentFn as r, Props as s, Children as t, createElement as u };