@bgub/fig-dom 0.1.0-alpha.6 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,556 @@
1
+ ## @bgub/fig-dom@0.1.0
2
+
3
+ ### Publish stable pre-1.0 releases
4
+
5
+ Fig's runtime, tooling, and TanStack adapter packages now publish without an
6
+ `alpha` prerelease suffix. Patch releases preserve compatibility within their
7
+ current `0.x` minor line; minor releases may make breaking changes before 1.0.
8
+
9
+ ### Asset descriptors use native names and preserve native ordering
10
+
11
+ Client-inserted and host-rendered stylesheets now form precedence buckets in
12
+ the order each distinct precedence value is first discovered. A stylesheet
13
+ discovered later for an existing bucket is inserted before the following
14
+ bucket, keeping lazy and payload-delivered CSS in its intended cascade order.
15
+
16
+ Raw `<script>` elements now enter the asset registry only when explicitly
17
+ marked `async`. Non-async scripts retain their native document position and
18
+ execution semantics; explicit `script()` descriptors continue to support all
19
+ asset-delivery modes.
20
+
21
+ Asset descriptor options and serialized payload asset rows now use native HTML
22
+ attribute names: `crossorigin`, `fetchpriority`, and `http-equiv`. The previous
23
+ React-style `crossOrigin`, `fetchPriority`, and `httpEquiv` spellings are
24
+ removed.
25
+
26
+ Host resource resolution now receives the actual host parent and fixes
27
+ out-of-band placement once per fiber. SVG and MathML titles consequently stay
28
+ in their native namespace, while HTML titles carrying `itemprop` stay in-tree;
29
+ ordinary document titles continue to use the shared head registry.
30
+
31
+ ### Restore shadowed document metadata when its winner leaves
32
+
33
+ Client title and meta entries now keep stable per-fiber ownership claims. The
34
+ latest acquired live claim controls the single canonical DOM element; updates
35
+ to shadowed claims stay dormant, and removing the winner immediately restores
36
+ the latest remaining value.
37
+
38
+ Hoisted host and declarative asset lifecycle callbacks receive an opaque,
39
+ stable `AssetResourceOwner`. Hoisted updates own the complete canonical host
40
+ update, including text, so a shadowed fiber cannot overwrite registry state.
41
+
42
+ ### Stable client-reference identity across decodes
43
+
44
+ `@bgub/fig/payload` exposes `createPayloadClientReferenceResolver(resolve)`:
45
+ a caller-owned stateful resolver passed as the `resolveClientReference`
46
+ decode option. With one, every resolvable client reference decodes to one
47
+ resolver-owned wrapper per reference id across all decodes sharing the
48
+ resolver — gated, ungated, or asynchronously resolved — so re-decoding a
49
+ payload updates islands in place instead of remounting them. Reveal gates
50
+ ride the decoded element instances rather than the wrapper: each decode
51
+ gates exactly its own content, so a newer decode's pending assets never
52
+ re-suspend an island already on screen, while its new island instances
53
+ still wait for the stylesheets they declared. The caller owns the
54
+ resolver's lifetime; under fast refresh no manual invalidation is needed
55
+ (hot edits remap the latched resolution through component families, and
56
+ unaccepted updates full-reload), while `delete`/`clear` cover manifest
57
+ swaps without a reload. With a plain resolve function, gated and async
58
+ references keep their per-decode wrapper identity, now with the same
59
+ per-element gating.
60
+
61
+ `@bgub/fig-dom`'s `payloadDataLoader` accepts the stateful resolver through
62
+ its existing `resolveClientReference` option.
63
+
64
+ Framework adapters can retain one resolver across refreshes and navigations,
65
+ preventing asset-gated islands from remounting on every re-decode.
66
+
67
+ ### Publish metadata only with its visible owner
68
+
69
+ Title and meta resources now travel through Payload as owner-bound
70
+ declarations and update the document only when their decoded tree commits.
71
+ Pending or superseded refreshes keep the previous metadata visible.
72
+
73
+ Streaming HTML now treats Suspense fallbacks as metadata owners and reconciles
74
+ the completed visible metadata snapshot in the boundary reveal operation.
75
+ Partial segments and failed or abandoned primary work cannot mutate the head.
76
+
77
+ The obsolete `onAssetError` option and its asset-diagnostic types are removed:
78
+ late metadata is delivered with its owner instead of being dropped.
79
+
80
+ ### Keep styles active during document hydration recovery
81
+
82
+ Full-document hydration recovery now reuses the existing `html`, `head`, and
83
+ `body` singletons and clears their contents sparingly. Loaded stylesheet links,
84
+ style elements, and scripts stay connected while mismatched content is rebuilt,
85
+ preventing a flash of unstyled content.
86
+
87
+ Recoverable errors now report to the console when a root does not provide an
88
+ `onRecoverableError` handler, so hydration mismatches are no longer silent.
89
+
90
+ ### Recover full-document Suspense hydration mismatches
91
+
92
+ Full-document hydration now escalates a mismatch inside the document-level
93
+ Suspense boundary to root recovery, preserves the document doctype, and
94
+ rebuilds the document without reusing cleared insertion anchors.
95
+
96
+ ### Make `configureDomRefreshScheduler` internal
97
+
98
+ The `@bgub/fig-dom/refresh` subpath now exports only `scheduleRefresh`
99
+ and the `RefreshFamily`/`RefreshUpdate` types. The wiring setter was
100
+ called by exactly one place — fig-dom's own renderer, as a module side
101
+ effect — and HMR runtimes only ever needed `scheduleRefresh`. The
102
+ before-main-entry update buffering is unchanged and keeps living in a
103
+ single shared module, so pre-evaluation refreshes still replay once the
104
+ renderer configures itself.
105
+
106
+ ### Attach beforetoggle listeners directly
107
+
108
+ `beforetoggle` does not bubble, so `on("beforetoggle", ...)` was attached as a
109
+ delegated root listener and never fired for a popover or a dialog. It now
110
+ attaches to its element like the other non-bubbling events, `toggle` included.
111
+
112
+ ### Preserve stopped propagation on read-only DOM events
113
+
114
+ Logical propagation stops now call the restored native `stopPropagation()`
115
+ method instead of assigning `cancelBubble`, which can be read-only in DOM
116
+ implementations.
117
+
118
+ ### Split fig-dom's oversized modules into focused ones
119
+
120
+ Internal restructuring with no API or behavior change. The host config and
121
+ renderer wiring move out of the package entry into `renderer.ts`; form
122
+ control value/checked/select handling, style application, the `on()` event
123
+ descriptor, and the propagation-state patching each get their own module.
124
+ Event slot attachment state is now a discriminated union instead of four
125
+ nullable fields.
126
+
127
+ ### Serialized components move to the data-resource model
128
+
129
+ Serialized trees are now ordinary data resources: servers return plain
130
+ Payload streams, and clients consume them through keyed `dataResource`
131
+ instances with `payloadDataLoader`. Refresh is `refreshData`, navigation can
132
+ select a new key, and back/forward navigations reuse cached entries. Commits
133
+ wait for the incoming Payload, island modules, and stylesheet gates.
134
+
135
+ Supporting API additions: `payloadDataLoader` accepts a `prepareAssets`
136
+ override (defaults to `insertAssetResources`), and `decodePayloadStream`
137
+ accepts an `onClientReference` observer for reference metadata.
138
+
139
+ ### Diagnose hoisted resource declassification
140
+
141
+ Development now throws when an update would turn a permanently hoisted host
142
+ fiber into an ordinary in-tree element, naming the affected asset and
143
+ explaining that changing placement requires a different Fig element key.
144
+ Production ignores the update instead of mutating a shared delivery asset or
145
+ overwriting the owner's last valid title or metadata claim.
146
+
147
+ ### Compose host behavior with mixins
148
+
149
+ Core now exports `createMixin()` and resolves render-time host behavior through
150
+ the `mix` prop. Mixins may contribute host props or nested mixins while keeping
151
+ the host type and subtree fixed. Explicit host props form the baseline; mixins
152
+ run in authoring order, and later results win.
153
+
154
+ DOM event listeners now use `mix={on(type, callback)}`. Migrate
155
+ `events={[on(type, callback)]}` to `mix={on(type, callback)}`; multiple or
156
+ conditional descriptors move into `mix={[...]}` and preserve positional
157
+ listener identity.
158
+
159
+ ### Keep empty children and document assets hydration-safe
160
+
161
+ Empty string children now normalize away on both the server and client, so a
162
+ rendered empty token cannot force hydration to recover the root.
163
+
164
+ When full-document hydration does recover, declarative stylesheets, titles,
165
+ and metadata now acquire against the replacement head instead of disappearing
166
+ with the server document.
167
+
168
+ ### Keep `useId` stable through selective hydration
169
+
170
+ `useId` now follows one canonical server/hydration tree path through Suspense
171
+ and Activity. Dehydrated boundaries snapshot that path when they claim their
172
+ server marker, then restore it when hydration resumes, so client updates that
173
+ insert or move surrounding siblings cannot renumber ids already present in the
174
+ server HTML. Suspense's private Activity wrapper is transparent to the path.
175
+
176
+ Components mounted only on the client now receive ids from a separate
177
+ `fig-C-*` namespace. Those ids remain stable for the component lifetime and
178
+ cannot collide with ids reserved by server-rendered content that has not
179
+ hydrated yet.
180
+
181
+ ### Initial alpha release
182
+
183
+ First public alpha release of Fig.
184
+
185
+ ### Allow interactive transitions to interrupt native animations
186
+
187
+ `transition()` and the function returned by `useTransition()` now accept
188
+ `viewTransition: "interrupt"`. When another native View Transition is already
189
+ animating, Fig skips it, waits for its cleanup to settle, and immediately
190
+ commits the latest rendered state, starting a new transition when that commit
191
+ has participating boundaries. The default remains serialized so navigations
192
+ and streamed reveals retain uninterrupted motion. Interruptible DOM
193
+ transitions also drop the implicit full-page snapshot so controls outside
194
+ explicit transition surfaces stay live and can express the next intent by
195
+ pointer before the current animation finishes.
196
+
197
+ ### Trim DOM renderer hot-path work
198
+
199
+ The DOM renderer now avoids transient collections while diffing host props,
200
+ updating event descriptors, and scanning document assets. Event routing keeps
201
+ root state in one container record, stores less per-listener metadata, and
202
+ builds dispatch paths in place. Host configuration callbacks whose signatures
203
+ already match now connect directly instead of paying forwarding closures.
204
+
205
+ Controlled single-select elements also keep their scalar value without
206
+ allocating a one-entry `Set`; multi-select values retain set lookup behavior.
207
+ These changes preserve the public API while reducing the production entry
208
+ bundle and allocation pressure during mount, update, dispatch, and teardown.
209
+
210
+ ### Payload exposes rendering and decoding, not its implementation
211
+
212
+ The payload packages now present two primary operations:
213
+ `renderToPayloadStream` on the server and `decodePayloadStream` in the
214
+ browser-safe core entry. Row/model types, value encoding, codec machinery,
215
+ content-type negotiation helpers, and framework document transports are
216
+ internal implementation details.
217
+
218
+ Client references use one `resolveClientReference(reference)` seam that may
219
+ return a component synchronously or asynchronously. It replaces the separate
220
+ load, resolve, and observation callbacks; reference metadata now includes its
221
+ stream-safe assets. The unused `load` field is also removed from
222
+ `clientReference(...)` declarations.
223
+
224
+ `payloadDataLoader` keeps only `request`, `resolveClientReference`, and the
225
+ optional `prepareAssets` override. Payload encoding is fixed internally rather
226
+ than exposed as a speculative custom-codec interface.
227
+
228
+ ### Make DOM View Transitions explicitly optional
229
+
230
+ `enableViewTransitions()` from `@bgub/fig-dom/view-transitions` explicitly
231
+ activates native DOM View Transitions, including after roots exist. Applications
232
+ that omit the optional entry exclude both the reconciler planner and browser
233
+ adapter from their bundles.
234
+
235
+ Renderer authors can install the optional View Transition planner through the
236
+ new single-owner commit-coordinator seam. Coordinator types preserve the host's
237
+ container and instance identities, while a private type-only contract keeps the
238
+ planner's fiber and root views aligned with the reconciler.
239
+
240
+ ### Make Payload trees directly renderable
241
+
242
+ `createPayloadComponent` now creates a props-typed component backed by Fig's
243
+ ordinary data store. Complete props form its cache identity by default through
244
+ a canonical encoding of Payload-compatible values, and the component works
245
+ with route loaders and the existing data-resource freshness APIs and explicit
246
+ store handles.
247
+
248
+ The lower-level `payloadDataLoader` and `PayloadDataLoaderOptions` exports have
249
+ been removed. Use `createPayloadComponent`, or `decodePayloadStream` when
250
+ managing the transport and data integration directly.
251
+
252
+ TanStack Start replaces `payloadResource({ key, render })` with
253
+ `createPayloadComponent({ key, load: serverPayload(render) })`. Its compiler
254
+ can extract a component imported from `.server.tsx`, while initial companion
255
+ streams, client references, and compiled asset dependencies keep their existing
256
+ transport behavior.
257
+
258
+ Payload component loaders receive the resolved resource `key` alongside
259
+ `signal`, so framework transports can register responses under the exact cache
260
+ entry without changing ordinary data loaders.
261
+
262
+ Default keys are canonical across plain-object property order, and Payload
263
+ components use their namespace as their DevTools label. TanStack Start renders
264
+ the supplied component inside the Payload renderer so root-level reads and
265
+ suspension work, and rejects uncompiled `serverPayload` calls before invoking
266
+ application code.
267
+
268
+ Payload rendering also rejects nesting one Payload component inside another in
269
+ development. Payload components are client-visible delivery boundaries;
270
+ compose ordinary server components inside them or mount separate Payload
271
+ components from the client tree to preserve independent refresh keys.
272
+
273
+ ### Generation-lifetime loader signals and `payloadDataLoader`
274
+
275
+ Data-resource loader signals now live as long as their load's generation,
276
+ not just the pending promise: the `{ signal }` a loader receives stays
277
+ unaborted after the value lands and aborts when the generation loses
278
+ authority — a newer load supersedes it, a server push hydrates over it, the
279
+ entry evicts, or the store is disposed. A rejected load's own signal aborts
280
+ on settlement, and `invalidateData` never aborts (marking stale does not
281
+ revoke authority). Loaders that stream into their value in the background —
282
+ payload decodes filling holes — tie that work to the signal; plain fetch
283
+ loaders are unaffected.
284
+
285
+ The load context also carries an internal, generation-guarded hydration
286
+ capability (symbol-keyed; read through `@bgub/fig/internal`) that hydrates
287
+ server-pushed `data` rows through the calling store only while the load is
288
+ authoritative, skipping rows that target the loading entry's own key.
289
+
290
+ New in `@bgub/fig-dom`: `payloadDataLoader({ request,
291
+ resolveClientReference?, prepareAssets? })` adapts a payload-stream
292
+ endpoint into an ordinary data-resource loader. It validates the response
293
+ (status, body, payload codec content-type; unusable bodies are cancelled),
294
+ wires `decodePayloadStream` to the generation-lifetime signal, hydrates
295
+ `data` rows through the store capability, inserts stream-discovered assets
296
+ with `insertAssetResources` (stylesheet gates delay only dependent reveal),
297
+ and resolves with the decoded root value — so `readData(postResource, slug)`
298
+ suspends like any read and returns renderable elements while streamed holes
299
+ keep filling in the background.
300
+
301
+ ### Move `createPortalNode` to `@bgub/fig/internal`
302
+
303
+ `createPortalNode` is the cross-package seam renderers wrap in their
304
+ container-typed `createPortal`; apps never call it directly. It now lives
305
+ on the internal entry with the other renderer protocol exports instead of
306
+ the app-facing main entry. Portal-creating apps keep using
307
+ `createPortal(children, container, key?)` from `@bgub/fig-dom`; the
308
+ `FigPortal` type stays on the main entry because it appears in public
309
+ signatures.
310
+
311
+ ### Promise-shaped payload decoder
312
+
313
+ `decodePayloadStream` now returns `Promise<FigNode>` directly — the root
314
+ value promise — instead of a `PayloadDecode` handle. Cancellation is
315
+ signal-only (`options.signal`, unchanged); the redundant `abort()` method is
316
+ gone. The `completion` promise is replaced by an `onStreamDone(result)`
317
+ decode option, called exactly once when ingestion settles as `complete`,
318
+ `failed`, or `aborted` — post-root failures that strand no pending hole
319
+ remain observable there. The callback is never awaited and its exceptions
320
+ and rejections are swallowed, so an observer — sync or async — cannot break
321
+ decode teardown or leak an unhandled rejection. The
322
+ `PayloadDecode` interface and its non-thenable caveat are deleted;
323
+ `PayloadDecodeCompletion` remains as the callback's result type.
324
+
325
+ `@bgub/fig-dom`'s `payloadDataLoader` migrates internally; its public API is
326
+ unchanged.
327
+
328
+ Also considered and declined: narrowing `ResolveClientReference` to an
329
+ opaque id. The reference's `exportName`/`ssr`/`assets` mirror the `client`
330
+ row's wire fields and are all load-bearing in framework document pipelines;
331
+ the rationale is recorded in `docs/concepts/payload.md`.
332
+
333
+ ### Promise-valued children render through Suspense
334
+
335
+ `FigNode` now accepts promises of nodes. Promise children occupy distinct,
336
+ host-transparent child slots, suspend through the nearest `Suspense`, and route
337
+ rejections or invalid resolved children through normal error handling.
338
+
339
+ HTML rendering retains exact promise children as independent streaming tasks,
340
+ while Payload uses node-validated promise rows that decode to the same child
341
+ shape. Payload-rendered async components are invoked once and retain their
342
+ component-scoped assets on the outlined row.
343
+
344
+ ### Tighten public component, loader, asset, and bind signatures
345
+
346
+ `@bgub/fig` now names the shared data loader contract as
347
+ `DataResourceLoader`, constrains lazy loaders to components, and exposes
348
+ `ComponentProps` so lazy wrappers preserve the loaded component's props
349
+ without exposing its implementation statics. Client-reference SSR
350
+ implementations stay aligned with the reference's props. Stable-event typing
351
+ now models the trailing lifecycle signal separately from caller arguments.
352
+
353
+ `meta()` descriptors now require exactly one valid metadata identity:
354
+ `charset`, `name` plus `content`, `property` plus `content`, or `http-equiv`
355
+ plus `content`. Raw meta elements that do not satisfy the same shape remain
356
+ ordinary host elements instead of entering the asset registry.
357
+
358
+ `@bgub/fig-dom` payload requests now receive the standard
359
+ `DataResourceLoadContext`, portals retain their DOM container type in the
360
+ returned `FigPortal`, and bind callbacks must return `undefined`; cleanup is
361
+ exclusively driven by their `AbortSignal`.
362
+
363
+ ### Move `act` to `@bgub/fig-reconciler/test-utils`
364
+
365
+ `act` is testing infrastructure, not renderer construction, so it moves
366
+ off the main entry onto a `./test-utils` subpath — the same shape as
367
+ `@bgub/fig-dom/test-utils`. DOM tests keep importing `act` from
368
+ `@bgub/fig-dom/test-utils`; renderer tests now import it from
369
+ `@bgub/fig-reconciler/test-utils`. Behavior is unchanged; the subpath
370
+ shares the scheduler instance with the main entry.
371
+
372
+ ### Reduce asset serialization allocations
373
+
374
+ Asset resources now build their canonical host props directly. Server rendering
375
+ fills its owned props object in place instead of creating attribute tuples,
376
+ filtering them, converting them with `Object.fromEntries`, and cloning again to
377
+ append a nonce. Client insertion uses the same canonical props without changing
378
+ the generated elements or server HTML.
379
+
380
+ ### Attribute rejected payload holes to their data resource
381
+
382
+ Payload hole errors are attributed to the authoritative owning data-resource
383
+ generation. Error boundaries receive `dataResourceKeys`, and
384
+ `invalidateDataError` retires the broken fulfilled value before retrying so a
385
+ remounted boundary suspends on fresh content instead of immediately catching
386
+ the same rejected hole. `decodePayloadStream` also exposes an observational
387
+ `onHoleError` callback.
388
+
389
+ The load context's hydration capability now shares the same authority window:
390
+ a still-visible generation's `data` rows keep hydrating through a superseding
391
+ refresh's window instead of being dropped the moment the refresh starts.
392
+
393
+ ### Renderers now install their reconciler implementation
394
+
395
+ Fig DOM and Fast Refresh now depend on their exact reconciler version directly.
396
+ Applications no longer need to install `@bgub/fig-reconciler` alongside Fig DOM;
397
+ the reconciler remains a direct dependency only for custom-renderer authors.
398
+
399
+ Fast Refresh connects to Fig DOM through a renderer-owned adapter, ensuring its
400
+ family resolver and scheduled updates always reach the same reconciler instance
401
+ even when development tooling resolves through a separate package graph.
402
+
403
+ ### Avoid false selected-option hydration warnings
404
+
405
+ Hydrating a select now recognizes the `selected` attributes synthesized by
406
+ server rendering from the select's value. Genuine mismatched selected options
407
+ still produce a development warning, and uncontrolled selects continue to
408
+ preserve user changes made before hydration.
409
+
410
+ ### Fix first-load styling and development client navigation
411
+
412
+ Keep TanStack Start's compiler-sensitive client modules out of Vite dependency
413
+ prebundling so client navigation uses the client server-function transport
414
+ instead of executing server-only context access in the browser. Preserve
415
+ browser-extension roots appended to document singletons during hydration so a
416
+ third-party node cannot trigger document replacement and remove stylesheets.
417
+
418
+ ### Preserve framework-managed asset placement
419
+
420
+ Framework adapters can now keep externally managed head and body tags in their
421
+ declared positions without exposing a DOM prop. TanStack Router uses this for
422
+ route-managed links, styles, and scripts while continuing to map title and meta
423
+ entries through Fig asset resources. Full-document hydration now ignores the
424
+ doctype and one shared marker identifies every server-owned node without a
425
+ client fiber. Declarative asset lists also gain a client commit lifecycle, so
426
+ route titles and metadata update during navigation.
427
+
428
+ ### Add Payload routes to the TanStack Start adapter
429
+
430
+ `@bgub/fig-tanstack-start/payload` now exposes `payloadResource`, which compiles
431
+ an inline render callback into a private server function and Fig-owned route
432
+ data resource. Applications supply the cache key and component tree without
433
+ authoring transport plumbing. The shared declaration can stay in one
434
+ `.payload.tsx` module; its render callback and render-only imports are omitted
435
+ from the browser build. The initial SSR response is embedded into the document
436
+ and adopted without refetching; client navigation and refresh use the same
437
+ resource request path. Payload data rows
438
+ hydrate the shared store, asset resources are retained on their owning server
439
+ segments or inserted through the browser registry, and client references retain
440
+ their resolver-defined identity. `decodePayloadStream` and `payloadDataLoader`
441
+ now expose `retainAssets` for server document renderers that need this delivery
442
+ path.
443
+
444
+ `@bgub/fig-tanstack-start/server` exposes the lower-level
445
+ `renderPayloadResponse` used by the generated TanStack server function; it
446
+ defaults its render abort signal to the incoming request, so a disconnected
447
+ client cancels the Payload render. Shell
448
+ HTML streams while outlined Suspense holes settle, and the completed initial
449
+ responses are embedded before TanStack starts full-document hydration. The Vite
450
+ adapter also publishes assets imported only by server modules into the client
451
+ build output. Fig Router links also consume TanStack's `viewTransition`
452
+ navigation option without forwarding it as an invalid attribute to the rendered
453
+ anchor, and derive active state from the resolved route instead of an in-flight
454
+ location.
455
+
456
+ ### Add the TanStack Start runtime adapter
457
+
458
+ `createDataStore` now creates a root-neutral Fig store that route loaders can
459
+ populate before a renderer exists. Server and client renderers adopt that exact
460
+ store, preserving one cache while attaching their lifecycle and scheduling.
461
+
462
+ The new TanStack Start runtime uses the store for route loading, server
463
+ rendering, Fig-owned document serialization, client deserialization, and
464
+ hydration. Route-managed head and script output maps through the Router adapter,
465
+ including Fig asset resources. The end-to-end contract verifies no initial
466
+ client refetch and exactly one reload after invalidation.
467
+
468
+ ### Share the text-separator protocol constant; small DOM cleanups
469
+
470
+ The `<!--,-->` text-separator comment the server writes between adjacent text
471
+ fibers was hardcoded independently by the server renderer and fig-dom's
472
+ hydration cursor. The comment data now lives in `@bgub/fig/internal` as
473
+ `TEXT_SEPARATOR_DATA`, next to the other streaming protocol constants, so the
474
+ two sides cannot drift. No wire change — the emitted markup is identical.
475
+
476
+ fig-dom also drops an unused internal `rootFor` helper, routes style clearing
477
+ through the shared `isEmptyPropValue` predicate, and simplifies a redundant
478
+ branch in select-value syncing. No behavior change.
479
+
480
+ ### Add typed View Transition scopes and abortable lifecycle events
481
+
482
+ `transition` and the `useTransition` starter now accept explicit transition
483
+ types, which Fig carries with the updates that reach each root and forwards to
484
+ the browser without leaking into unrelated commits.
485
+
486
+ `ViewTransition` adds one `onTransition(event, signal)` lifecycle callback for
487
+ enter, exit, share, and update phases. Events expose all participating surfaces
488
+ and the commit's transition types. Fig DOM's optional View Transition entry can
489
+ resolve those opaque surfaces into group, image-pair, old, and new pseudo
490
+ handles for animation and inspection; the signal aborts when the native
491
+ transition finishes.
492
+
493
+ ### Bound stalled view-transition waits
494
+
495
+ Transition-eligible commits and annotated streaming reveals now wait at most 60
496
+ seconds for a previous browser View Transition. If its completion promise never
497
+ settles, Fig releases the document mutex and proceeds with the latest work
498
+ instead of parking it forever.
499
+
500
+ ### Let Fig's Vite integration own runtime configuration
501
+
502
+ The new `fig()` Vite integration defines Fig's development gate and installs
503
+ Fast Refresh. TanStack Start composes it automatically, so applications no
504
+ longer need to configure Fig's compile-time mode or SSR package bundling
505
+ themselves.
506
+
507
+ `@bgub/fig-vite` now uses the application's Fig DOM renderer as a peer instead
508
+ of installing a private renderer copy.
509
+
510
+ The development gate follows Vite's command rather than its mode: serving
511
+ enables development behavior, while builds—including `--mode development`—strip
512
+ it from production output.
513
+
514
+ Published npm packages now expose development artifacts through a Fig-owned
515
+ condition, allowing the Vite integration to enable diagnostics and Fast Refresh
516
+ for ordinary installs while explicit static overrides remain authoritative and
517
+ default production imports retain their previous dead-code elimination. A
518
+ static `false` override also disables Fast Refresh instrumentation.
519
+
520
+ ## @bgub/fig-dom@0.1.0-alpha.7
521
+
522
+ ### Attach beforetoggle listeners directly
523
+
524
+ `beforetoggle` does not bubble, so `on("beforetoggle", ...)` was attached as a
525
+ delegated root listener and never fired for a popover or a dialog. It now
526
+ attaches to its element like the other non-bubbling events, `toggle` included.
527
+
528
+ ### Preserve stopped propagation on read-only DOM events
529
+
530
+ Logical propagation stops now call the restored native `stopPropagation()`
531
+ method instead of assigning `cancelBubble`, which can be read-only in DOM
532
+ implementations.
533
+
534
+ ### Allow interactive transitions to interrupt native animations
535
+
536
+ `transition()` and the function returned by `useTransition()` now accept
537
+ `viewTransition: "interrupt"`. When another native View Transition is already
538
+ animating, Fig skips it, waits for its cleanup to settle, and immediately
539
+ commits the latest rendered state, starting a new transition when that commit
540
+ has participating boundaries. The default remains serialized so navigations
541
+ and streamed reveals retain uninterrupted motion. Interruptible DOM
542
+ transitions also drop the implicit full-page snapshot so controls outside
543
+ explicit transition surfaces stay live and can express the next intent by
544
+ pointer before the current animation finishes.
545
+
546
+ ### Reduce asset serialization allocations
547
+
548
+ Asset resources now build their canonical host props directly. Server rendering
549
+ fills its owned props object in place instead of creating attribute tuples,
550
+ filtering them, converting them with `Object.fromEntries`, and cloning again to
551
+ append a nonce. Client insertion uses the same canonical props without changing
552
+ the generated elements or server HTML.
553
+
1
554
  ## @bgub/fig-dom@0.1.0-alpha.5
2
555
 
3
556
  ### Avoid false selected-option hydration warnings
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as e,i as t,n,o as r,r as i,t as a}from"./renderer-eduO0rfo.js";import{assertPayloadCodecMatches as o,createPortalNode as s,jsonPayloadCodec as c,loadContextCapabilities as l}from"@bgub/fig/internal";import{dataResource as u,readData as d}from"@bgub/fig";import{decodePayloadStream as f}from"@bgub/fig/payload";const p=()=>void 0;async function m(e,t,r={}){let{signal:i}=t;if(i.aborted)throw await e.body?.cancel().catch(p),h(i);if(!e.ok)throw await e.body?.cancel().catch(p),Error(`Payload request failed with status ${e.status}.`);let a=e.body;if(a===null)throw Error(`Payload response did not include a body.`);try{o(c,e.headers.get(`content-type`))}catch(e){throw await a.cancel().catch(p),e}let s=l(t);return f(a,{hydrate:s?.hydrate,onHoleError:s?.attributeError,onStreamDone:e=>{},prepareAssets:r.prepareAssets??(e=>n(e)),retainAssets:r.retainAssets,resolveClientReference:r.resolveClientReference,signal:i})}function h(e){return e.reason??Error(`Payload request aborted.`)}function g(e){let t=new WeakMap,n=1;function r(e){if(e===null)return null;if(e===void 0)return[`undefined`];if(typeof e==`string`||typeof e==`boolean`)return e;if(typeof e==`number`)return Number.isNaN(e)?[`number`,`NaN`]:e===1/0?[`number`,`Infinity`]:e===-1/0?[`number`,`-Infinity`]:Object.is(e,-0)?[`number`,`-0`]:e;if(typeof e==`bigint`)return[`bigint`,e.toString()];if(typeof e==`symbol`){let t=Symbol.keyFor(e);if(t===void 0)throw Error(`Only global Symbol.for symbols can be serialized.`);return[`symbol`,t]}if(typeof e==`function`)throw Error(`Functions cannot be serialized into the payload.`);if(e instanceof Date){let t=e.toJSON();if(t===null)throw Error(`Invalid Date values cannot be serialized.`);return[`date`,t]}let i=t.get(e);if(i!==void 0)return[`ref`,i];let a=n++;if(t.set(e,a),Array.isArray(e))return[`array`,a,e.map(r)];if(e instanceof Map)return[`map`,a,Array.from(e,([e,t])=>[r(e),r(t)])];if(e instanceof Set)return[`set`,a,Array.from(e,r)];let o=Object.getPrototypeOf(e);if(o!==Object.prototype&&o!==null)throw Error(`Cannot serialize ${o?.constructor?.name??`object`} into the payload.`);let s=e;return[`object`,a,Object.keys(s).sort().map(e=>[e,r(s[e])])]}return r(e)}function _(e){let t=t=>{let n=v(t);return[...e.key,e.cacheKey===void 0?n:e.cacheKey(t)]},n=u({debugArgs:e.cacheKey===void 0?void 0:v,key:t,load:async(n,r)=>{let i=await e.load(n,{key:l(r)?.key??t(n),signal:r.signal});return m(i instanceof Response?i:new Response(i.stream,{headers:{"content-type":i.contentType}}),r,{prepareAssets:e.prepareAssets??e.load.prepareAssets,resolveClientReference:e.resolveClientReference??e.load.resolveClientReference,retainAssets:e.retainAssets??e.load.retainAssets})}}),r=Object.assign(function(e){return y(e),d(r,e)},n);return Object.defineProperty(r,"displayName",{configurable:!0,value:`Payload(${e.key[0]})`}),r}function v(e){return y(e),g(e)}function y(e){if(Object.hasOwn(e,`children`))throw Error(`Payload components do not accept children.`)}const b=a.flushSync;function x(e,t){let n=a.createRoot(e,t);return i(e,{run:e=>n.data.run(e)}),w(n,e)}function S(e,t,n){let r=a.hydrateRoot(e,t,n);return i(e,{hydrate:(t,n)=>a.hydrateTarget(e,t,n),run:e=>r.data.run(e)}),w(r,e)}function C(e,t,n=null){return s(e,t,n)}function w(e,n){return{...e,unmount:()=>{e.unmount(),t(n)}}}export{r as composeBind,_ as createPayloadComponent,C as createPortal,x as createRoot,b as flushSync,S as hydrateRoot,n as insertAssetResources,e as on};
1
+ import{a as e,i as t,n,o as r,r as i,t as a}from"./renderer-jfUYsG5x.js";import{assertPayloadCodecMatches as o,createPortalNode as s,jsonPayloadCodec as c,loadContextCapabilities as l}from"@bgub/fig/internal";import{dataResource as u,readData as d}from"@bgub/fig";import{decodePayloadStream as f}from"@bgub/fig/payload";const p=()=>void 0;async function m(e,t,r={}){let{signal:i}=t;if(i.aborted)throw await e.body?.cancel().catch(p),h(i);if(!e.ok)throw await e.body?.cancel().catch(p),Error(`Payload request failed with status ${e.status}.`);let a=e.body;if(a===null)throw Error(`Payload response did not include a body.`);try{o(c,e.headers.get(`content-type`))}catch(e){throw await a.cancel().catch(p),e}let s=l(t);return f(a,{hydrate:s?.hydrate,onHoleError:s?.attributeError,onStreamDone:e=>{},prepareAssets:r.prepareAssets??(e=>n(e)),retainAssets:r.retainAssets,resolveClientReference:r.resolveClientReference,signal:i})}function h(e){return e.reason??Error(`Payload request aborted.`)}function g(e){let t=new WeakMap,n=1;function r(e){if(e===null)return null;if(e===void 0)return[`undefined`];if(typeof e==`string`||typeof e==`boolean`)return e;if(typeof e==`number`)return Number.isNaN(e)?[`number`,`NaN`]:e===1/0?[`number`,`Infinity`]:e===-1/0?[`number`,`-Infinity`]:Object.is(e,-0)?[`number`,`-0`]:e;if(typeof e==`bigint`)return[`bigint`,e.toString()];if(typeof e==`symbol`){let t=Symbol.keyFor(e);if(t===void 0)throw Error(`Only global Symbol.for symbols can be serialized.`);return[`symbol`,t]}if(typeof e==`function`)throw Error(`Functions cannot be serialized into the payload.`);if(e instanceof Date){let t=e.toJSON();if(t===null)throw Error(`Invalid Date values cannot be serialized.`);return[`date`,t]}let i=t.get(e);if(i!==void 0)return[`ref`,i];let a=n++;if(t.set(e,a),Array.isArray(e))return[`array`,a,e.map(r)];if(e instanceof Map)return[`map`,a,Array.from(e,([e,t])=>[r(e),r(t)])];if(e instanceof Set)return[`set`,a,Array.from(e,r)];let o=Object.getPrototypeOf(e);if(o!==Object.prototype&&o!==null)throw Error(`Cannot serialize ${o?.constructor?.name??`object`} into the payload.`);let s=e;return[`object`,a,Object.keys(s).sort().map(e=>[e,r(s[e])])]}return r(e)}function _(e){let t=t=>{let n=v(t);return[...e.key,e.cacheKey===void 0?n:e.cacheKey(t)]},n=u({debugArgs:e.cacheKey===void 0?void 0:v,key:t,load:async(n,r)=>{let i=await e.load(n,{key:l(r)?.key??t(n),signal:r.signal});return m(i instanceof Response?i:new Response(i.stream,{headers:{"content-type":i.contentType}}),r,{prepareAssets:e.prepareAssets??e.load.prepareAssets,resolveClientReference:e.resolveClientReference??e.load.resolveClientReference,retainAssets:e.retainAssets??e.load.retainAssets})}}),r=Object.assign(function(e){return y(e),d(r,e)},n);return Object.defineProperty(r,"displayName",{configurable:!0,value:`Payload(${e.key[0]})`}),r}function v(e){return y(e),g(e)}function y(e){if(Object.hasOwn(e,`children`))throw Error(`Payload components do not accept children.`)}const b=a.flushSync;function x(e,t){let n=a.createRoot(e,t);return i(e,{run:e=>n.data.run(e)}),w(n,e)}function S(e,t,n){let r=a.hydrateRoot(e,t,n);return i(e,{hydrate:(t,n)=>a.hydrateTarget(e,t,n),run:e=>r.data.run(e)}),w(r,e)}function C(e,t,n=null){return s(e,t,n)}function w(e,n){return{...e,unmount:()=>{e.unmount(),t(n)}}}export{r as composeBind,_ as createPayloadComponent,C as createPortal,x as createRoot,b as flushSync,S as hydrateRoot,n as insertAssetResources,e as on};
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./refresh-internal-B05aFp_T.js";import{ACTIVITY_TEMPLATE_ATTRIBUTE as t,EARLY_EVENT_HANDLER_PROPERTY as n,EARLY_EVENT_QUEUE_PROPERTY as r,HYDRATION_SKIP_ATTRIBUTE as i,REPLAYABLE_EVENT_TYPES as a,SUSPENSE_CLIENT_MARKER as o,SUSPENSE_COMPLETED_MARKER as s,SUSPENSE_END_MARKER as c,SUSPENSE_PENDING_PREFIX as l,TEXT_SEPARATOR_DATA as u,assetResourceFromHostAttributes as ee,assetResourceFromHostProps as d,assetResourceHostProps as f,assetResourceKey as p,isFigAssetResource as te,markClientOnlyHostBehavior as ne,mixinSlot as re}from"@bgub/fig/internal";import{createMixin as ie}from"@bgub/fig";import{createRenderer as ae,runWithEventPriority as m}from"@bgub/fig-reconciler";function oe(e,t){if(!h(e))return;let n=[];se(e,n);for(let e of n)t(e)}function se(e,t){t.push(e);for(let n=e.firstChild;n!==null;n=n.nextSibling)h(n)&&se(n,t)}function h(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===1}function g(e){return h(e)?`localName`in e&&typeof e.localName==`string`?e.localName.toLowerCase():`tagName`in e&&typeof e.tagName==`string`?e.tagName.toLowerCase():``:``}function ce(e){return e.namespaceURI===null||e.namespaceURI===`http://www.w3.org/1999/xhtml`}function _(e){return typeof e==`object`&&e&&`parentNode`in e?e.parentNode:null}function v(e){return e==null||e===!1}const y=new WeakMap,le=new WeakSet;function ue(...e){let t=e.filter(e=>typeof e==`function`);return(e,n)=>{for(let r of t)r(e,n)}}function de(e,t){let n=ge(t),r=y.get(e);if(n===null){r!==void 0&&x(r),y.delete(e);return}if(r===void 0){let t={callback:n,controller:null,strictRan:!1};y.set(e,t),b(e,t)}else r.callback!==n&&(x(r),r.callback=n,b(e,r))}function fe(e){let t=y.get(e);t!==void 0&&b(e,t)}function pe(e){le.add(e);let t=y.get(e);t!==void 0&&x(t)}function me(e){le.delete(e);let t=y.get(e);t!==void 0&&b(e,t)}function he(e){let t=y.get(e);t!==void 0&&(x(t),y.delete(e))}function b(e,t){t.controller!==null||e.parentNode===null||le.has(e)||(t.controller=new AbortController,t.callback(e,t.controller.signal))}function x(e){e.controller?.abort(),e.controller=null}function ge(e){if(v(e))return null;if(typeof e==`function`)return e;throw Error(`The bind prop must be a function.`)}const S=Symbol.for(`fig.native-event-descriptors`),_e=ie((e,t,n,r)=>{ne(e,`on()`);let i=e.props,a=i[S];a===void 0&&(a=[],Object.defineProperty(i,S,{configurable:!0,value:a})),a.push({callback:n,options:r,slot:re(e),type:t})});function ve(e,t,n){return _e(e,t,n)}const ye=[];function be(e){return e[S]??ye}function xe(e,t,n){let r=C(e,`currentTarget`,{value:t});try{return n(e)}finally{r()}}function Se(e,t,n){let r={immediateStopped:!1,stopped:!t&&e.cancelBubble===!0},i=Ce(e,`stopPropagation`,()=>{r.stopped=!0}),a=Ce(e,`stopImmediatePropagation`,()=>{r.stopped=!0,r.immediateStopped=!0}),o=C(e,`cancelBubble`,{get:()=>r.stopped,set(e){e===!0&&(r.stopped=!0)}});try{return n(r)}finally{o(),a(),i(),r.stopped&&e.stopPropagation()}}function Ce(e,t,n){let r=Reflect.get(e,t);return typeof r==`function`?C(e,t,{value(){n(),r.call(e)}}):we}function C(e,t,n){let r=Object.getOwnPropertyDescriptor(e,t);return Reflect.defineProperty(e,t,{configurable:!0,...n})?r===void 0?()=>{Reflect.deleteProperty(e,t)}:()=>{Reflect.defineProperty(e,t,r)}:we}function we(){}const w=new WeakMap,T=new WeakMap,Te=new WeakMap,E=[],Ee=new Set(a),De=new Set([`beforeinput`,`blur`,`change`,`click`,`contextmenu`,`dblclick`,`focus`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mouseup`,`pointerdown`,`pointerup`,`submit`,`touchend`,`touchstart`]),D=new Set([`drag`,`dragover`,`mousemove`,`pointermove`,`scroll`,`touchmove`,`wheel`]),Oe=new Set([...De,...D,`mouseenter`,`mouseleave`]),ke=new Set(`abort.beforetoggle.blur.cancel.canplay.canplaythrough.close.durationchange.emptied.encrypted.ended.error.focus.invalid.load.loadeddata.loadedmetadata.loadstart.mouseenter.mouseleave.pause.play.playing.pointerenter.pointerleave.progress.ratechange.resize.scroll.scrollend.seeked.seeking.stalled.suspend.timeupdate.toggle.volumechange.waiting`.split(`.`));let Ae=e=>e();function je(e){Ae=e}function Me(e,t){let n=O(e);n.run=t.run,t.hydrate!==void 0&&(n.hydrate=t.hydrate,Ge(e,n),Pe(e))}const Ne=new WeakMap;function Pe(e){let t=e.ownerDocument??e,i=Ne.get(t);if(i===void 0){let e=t[r];if(!Array.isArray(e))return;let o=t[n];if(typeof o==`function`&&typeof t.removeEventListener==`function`)for(let e of a)t.removeEventListener(e,o,!0);delete t[r],delete t[n],i=e,Ne.set(t,i)}let o=!1;for(let t=0;t<i.length;){let n=i[t];if(Ee.has(n.type)&&I(e,n.target)){i.splice(t,1),qe(e,n.type,n),o=!0;continue}t+=1}o&&queueMicrotask(A)}function Fe(e){let t=T.get(e);if(t!==void 0){Ie(e);for(let n of t.listeners.values())e.removeEventListener(n.type,n.listener,n.capture);Le(e),T.delete(e);for(let t=E.length-1;t>=0;--t)E[t].root===e&&E.splice(t,1)}}function Ie(e){let t=T.get(e);if(t!==void 0&&t.run!==null){t.hydrate=null;for(let[n,r]of t.hydrationListeners??[])e.removeEventListener(n,r,!0);t.hydrationListeners=null}}function Le(e){for(let t of T.get(e)?.portals??[])Le(t),k(t)}function O(e){let t=T.get(e);return t===void 0&&(t={hydrate:null,hydrationListeners:null,listeners:new Map,portalOwner:null,portals:null,run:null},T.set(e,t)),t}function Re(e,t){let n=w.get(e)??[];if(n.length===0&&t.length===0)return;let r=new Map;for(let e of n)r.set(e.slot,e);let i=[],a=null;for(let n of t){let t=n.options?.capture===!0,o=n.options?.passive===!0,s=r.get(n.slot);r.delete(n.slot),s===void 0||s.type!==n.type||s.capture!==t||s.passive!==o?(a??=Ve(e),s!==void 0&&j(s),s=Ue(e,a.root,a.listenerTarget,n,t,o)):s.callback!==n.callback&&(s.callback=n.callback),i.push(s)}for(let e of r.values())j(e);i.length===0?w.delete(e):w.set(e,i)}function ze(e){let t=w.get(e);if(t===void 0)return;let{listenerTarget:n,root:r}=Ve(e);for(let i of t)Qe(e,r,n,i)}function Be(e){let t=w.get(e);if(t!==void 0){for(let e of t)j(e);w.delete(e)}}function Ve(e){let t=L(e);if(t===null)return{listenerTarget:null,root:null};let n=T.get(t);return n===void 0?{listenerTarget:null,root:null}:{listenerTarget:t,root:n.portalOwner?.root??(n.run===null?null:t)}}function He(e,t,n){let r=O(e),i=L(n)??t;if(r.portalOwner!==null){if(r.portalOwner.root===t&&r.portalOwner.parentTarget===i){r.portalOwner={logicalParent:n,parentTarget:i,root:t};return}k(e)}r.portalOwner={logicalParent:n,parentTarget:i,root:t};let a=O(i);(a.portals??=new Set).add(e);for(let n of a.listeners.values())tt(t,e,n.type,n.capture,n.passive)}function k(e){let t=T.get(e);if(!t?.portalOwner)return;let n=t.portalOwner;t.portalOwner=null;let r=T.get(n.parentTarget);if(r!==void 0){r.portals?.delete(e);for(let t of r.listeners.keys())nt(e,t)}}function A(){let e=new Set;for(let t=0;t<E.length;){let n=E[t];if(!I(n.listenerTarget??n.root,n.event.target)){E.splice(t,1);continue}if(Je(n)===`blocked`){e.add(n.root),t+=1;continue}if(e.has(n.root)){t+=1;continue}E.splice(t,1),Ye(n)}}function Ue(e,t,n,r,i,a){let o={attachment:null,capture:i,callback:r.callback,controller:null,passive:a,slot:r.slot,type:r.type};return Qe(e,t,n,o),o}function j(e){F(e),P(e)}function We(e,t,n,r,i,a){let o=L(a.target);if(o!==t&&((o===null?null:T.get(o)??null)?.portalOwner?.root===e||!I(t,a.target))||Ke(e,n,a)===`blocked`)return;let s=M(e,t,n,r,i,a);s.length!==0&&Se(a,!1,e=>N(s,a,e))}function Ge(e,t){if(t.hydrationListeners===null){t.hydrationListeners=[];for(let n of Oe){let r=t=>Ke(e,n,t);t.hydrationListeners.push([n,r]),e.addEventListener(n,r,{capture:!0,passive:ot(n)})}}}function Ke(e,t,n){let r=T.get(e)?.hydrate??null;if(r===null)return`none`;let i=Te.get(n),a=i?.get(e);if(a!==void 0)return a;let o=R(t),s=m(o,()=>r(n.target,o));return i===void 0&&(i=new WeakMap,Te.set(n,i)),i.set(e,s),s===`blocked`&&Ee.has(t)&&qe(e,t,n),s}function qe(e,t,n){E.push({event:n,listenerTarget:L(n.target),root:e,type:t})}function Je(e){let t=T.get(e.root)?.hydrate??null;if(t===null)return`none`;let n=R(e.type);return m(n,()=>t(e.event.target,n))}function Ye(e){let{event:t,root:n,type:r}=e,i=e.listenerTarget??e.root;Se(t,!0,e=>{N(M(n,i,r,!0,null,t),t,e),!(e.immediateStopped||e.stopped)&&N(M(n,i,r,!1,null,t),t,e)})}function M(e,t,n,r,i,a){let o=it(e,t,a),s=[],c=r?-1:1;for(let t=r?o.length-1:0;t>=0&&t<o.length;t+=c){let a=o[t],c=w.get(a);if(c!==void 0)for(let t of c){let o=rt(t);o!==e||t.type!==n||t.capture!==r||i!==null&&t.passive!==i||s.push({callback:t.callback,element:a,root:o,slot:t})}}return s}function N(e,t,n){let r=null;for(let i of e){if(n.immediateStopped)return;if(i.element!==r){if(r!==null&&n.stopped)return;r=i.element}try{Xe(i,t)}finally{let e=i.slot;e.attachment===null&&P(e)}}}function Xe(e,t){let n=e.slot;P(n),n.controller=new AbortController;let r=n.controller.signal;Ae(()=>{Ze(e.root,()=>m(R(n.type),()=>{xe(t,e.element,t=>{e.callback(t,r)})}))})}function Ze(e,t){let n=e===null?null:T.get(e)?.run??null;return n===null?t():n(t)}function P(e){e.controller?.abort(),e.controller=null}function Qe(e,t,n,r){ke.has(r.type)?$e(e,t,r):et(t,n,r)}function $e(e,t,n){let r=n.attachment;if(r!==null){if(`element`in r&&r.element===e){t!==null&&(r.root=t);return}F(n)}let i=t=>{try{Xe({callback:n.callback,element:e,root:rt(n),slot:n},t)}finally{n.attachment===null&&P(n)}};n.attachment={element:e,listener:i,root:t},e.addEventListener(n.type,i,{capture:n.capture,passive:n.passive})}function et(e,t,n){if(e===null||t===null)return;let r=n.attachment;r!==null&&`listenerTarget`in r&&r.root===e&&r.listenerTarget===t||(F(n),n.attachment={listenerTarget:t,root:e},tt(e,t,n.type,n.capture,n.passive))}function tt(e,t,n,r,i){let a=O(t).listeners,o=`${n}:${r}:${i}`,s=a.get(o);if(s===void 0){s={capture:r,count:0,listener:a=>We(e,t,n,r,i,a),passive:i,type:n},t.addEventListener(n,s.listener,{capture:r,passive:i}),a.set(o,s);for(let a of T.get(t)?.portals??[])tt(e,a,n,r,i)}s.count+=1}function nt(e,t){let n=T.get(e)?.listeners,r=n?.get(t);if(n!==void 0&&r!==void 0&&(--r.count,!(r.count>0))){e.removeEventListener(r.type,r.listener,r.capture),n.delete(t);for(let n of T.get(e)?.portals??[])nt(n,t)}}function F(e){let t=e.attachment;t!==null&&(e.attachment=null,`element`in t?t.element.removeEventListener(e.type,t.listener,e.capture):nt(t.listenerTarget,`${e.type}:${e.capture}:${e.passive}`))}function rt(e){return e.attachment?.root??null}function it(e,t,n){let r=[],i=n.composedPath?.();if(i!==void 0){let n=i.indexOf(t);if(n!==-1){for(let e=0;e<n;e+=1){let t=i[e];h(t)&&r.push(t)}return at(r,e,t),r}}for(let e=n.target;e!==t&&(h(e)&&r.push(e),e=_(e),e!==null););return at(r,e,t),r}function at(e,t,n){let r=T.get(n)?.portalOwner??null;if(r===null||r.root!==t)return;let i=r.logicalParent;for(;i!==null&&i!==t;){if(st(i)){let e=T.get(i)?.portalOwner??null;if(e!==null&&e.root===t){i=e.logicalParent;continue}}h(i)&&e.push(i),i=_(i)}}function I(e,t){for(let n=t;n!==null;){if(n===e)return!0;n=_(n)}return!1}function L(e){for(let t=e;t!==null;){if(st(t)){let e=T.get(t);if(e!==void 0&&(e.portalOwner!==null||e.run!==null))return t}t=_(t)}return null}function R(e){return De.has(e)?`discrete`:D.has(e)?`continuous`:`default`}function ot(e){return D.has(e)||e===`touchstart`||e===`touchend`}function st(e){return typeof e==`object`&&!!e&&`addEventListener`in e&&`childNodes`in e}function ct(e){oe(e,e=>{fe(e),ze(e)})}function z(e){oe(e,e=>{he(e),Be(e)})}const B=new WeakMap;function lt(e){return Ct(e)||e===`checked`||e===`defaultChecked`}function ut(e,t,n,r,i,a){if(t===`select`&&Ct(n))return;if(t===`option`&&n===`value`){U(e,`value`,H(r));return}let o=a.initial===!0&&a.hydrating!==!0;n===`value`?v(r)||mt(e,r):n===`defaultValue`?pt(e,r,t,o&&i.value===void 0):n===`checked`?r!==void 0&&_t(e,r):n===`defaultChecked`&&gt(e,r,o&&i.checked===void 0)}function dt(e,t,n,r){if(t!==`select`)return;let i=n.value!==void 0,a=i?n.value:n.defaultValue;if(v(a)){B.delete(e);return}let o=!i&&r.hydrating===!0,s={appliedDefault:B.get(e)?.appliedDefault===!0||!i,applyDefaultToInsertedOptions:!o&&!i&&r.initial===!0,controlled:i,selectedValues:Array.isArray(a)?new Set(a.map(String)):String(a)};B.set(e,s),!o&&(i||r.initial===!0)&&vt(e,s.selectedValues)}function V(e,t=!1){let n=xt(e);if(n===null)return;let r=B.get(n);r!==void 0&&(!r.controlled&&r.appliedDefault&&!t||!r.controlled&&t&&!r.applyDefaultToInsertedOptions||(vt(e,r.selectedValues),r.controlled||(r.appliedDefault=!0)))}function ft(e,t){return(e===`input`||e===`textarea`||e===`select`)&&(t.value!==void 0||t.checked!==void 0)}function pt(e,t,n,r){let i=H(t),a=i??``;`defaultValue`in e&&(e.defaultValue=a),n===`textarea`?e.textContent=a:U(e,`value`,i),r&&`value`in e&&ht(e,a)}function mt(e,t){let n=H(t);n!==null&&(`value`in e?ht(e,n):U(e,`value`,n))}function ht(e,t){let n=e;n.value!==t&&(n.value=t)}function gt(e,t,n){let r=t===!0;`defaultChecked`in e&&(e.defaultChecked=r),U(e,`checked`,r),n&&_t(e,t)}function _t(e,t){let n=t===!0;`checked`in e?e.checked=n:U(e,`checked`,n)}function H(e){return v(e)?null:String(e)}function vt(e,t){if(g(e)===`option`){yt(e,t);return}St(e,e=>{yt(e,t)})}function yt(e,t){e.selected=bt(e,t)}function bt(e,t){let n=e.getAttribute(`value`)??(e.textContent??``).replace(/\s+/g,` `).trim();return typeof t==`string`?n===t:t.has(n)}function xt(e){let t=e.parentNode;for(;t!==null;){if(h(t)&&g(t)===`select`)return t;t=t.parentNode}return null}function St(e,t){for(let n=e.firstChild;n!==null;){let e=n.nextSibling;h(n)&&(g(n)===`option`?t(n):St(n,t)),n=e}}function Ct(e){return e===`value`||e===`defaultValue`}function U(e,t,n){v(n)?e.removeAttribute(t):e.setAttribute(t,String(n))}function wt(e,t,n){let r=e.style;if(r===void 0)return;let i=Tt(t),a=Tt(n);for(let e of Object.keys(i))e in a||Dt(r,e);for(let[e,t]of Object.entries(a))v(t)?Dt(r,e):Et(r,e,t)}function Tt(e){return typeof e==`object`&&e?e:{}}function Et(e,t,n){typeof n!=`number`&&typeof n!=`bigint`&&(t.startsWith(`--`)&&typeof e.setProperty==`function`?e.setProperty(t,String(n)):e[t]=n)}function Dt(e,t){t.startsWith(`--`)&&typeof e.removeProperty==`function`?e.removeProperty(t):e[t]=``}const Ot=`http://www.w3.org/1999/xlink`;function W(e,t,n,r={}){(`mix`in t||`mix`in n)&&Re(e,be(n));let i=g(e),a=ce(e),o=Object.keys(t);for(let e in n)Object.hasOwn(n,e)&&!Object.hasOwn(t,e)&&o.push(e);for(let s of o){let o=t[s],c=n[s];if(s!==`mix`){if(s===`bind`){o!==c&&de(e,c);continue}if(s===`unsafeHTML`){r.hydrating===!0?jt(c):o!==c&&At(e,c);continue}if(!Ft(s)){if(lt(s)){ut(e,i,s,c,n,r);continue}o!==c&&(s===`style`?wt(e,o,c):Nt(e,Mt(s,a),c))}}}dt(e,i,n,r),(i===`option`||i===`optgroup`)&&V(e)}function kt(e,t){W(e,{},t,{hydrating:!0})}function At(e,t){let n=jt(t);`innerHTML`in e&&(e.innerHTML=n??``)}function jt(e){if(v(e))return null;if(typeof e==`string`)return e;throw Error(`The unsafeHTML prop must be a string.`)}function Mt(e,t){return t?e.toLowerCase():e}function Nt(e,t,n){if(v(n)){Pt(e,t);return}if(t===`xlink:href`){e.setAttributeNS(Ot,t,String(n));return}e.setAttribute(t,String(n))}function Pt(e,t){if(t===`xlink:href`){e.removeAttributeNS(Ot,`href`);return}e.removeAttribute(t)}function Ft(e){return e===`children`||e===`key`||e===`mix`||e===`suppressHydrationWarning`||e===`unsafeHTML`||It(e)}function It(e){return/^on[A-Z]/.test(e)}var Lt=class{element;resourceKind;kind=`metadata`;byOwner=new Map;rendered=null;winner;constructor(e,t,n,r){this.element=e,this.resourceKind=t,this.winner=n,this.byOwner.set(n,r),this.applyWinner()}acquire(e,t){let n=!this.byOwner.has(e);this.byOwner.set(e,t),n&&(this.winner=e),this.winner===e&&this.applyWinner()}update(e,t){if(!this.byOwner.has(e))throw Error(`Expected a live metadata claim.`);this.byOwner.set(e,t),this.winner===e&&this.applyWinner()}release(e){if(!this.byOwner.delete(e))return`retained`;if(this.byOwner.size===0)return`empty`;if(this.winner!==e)return`retained`;let t=null;for(let e of this.byOwner.keys())t=e;if(t===null)throw Error(`Expected a live metadata claim.`);return this.winner=t,this.applyWinner(),`retained`}applyWinner(){let e=this.byOwner.get(this.winner);if(e===void 0)throw Error(`Expected a live metadata claim.`);W(this.element,this.rendered??{},e),this.resourceKind===`title`&&(this.element.textContent=Rt(e.children)),this.rendered=e}};function Rt(e){return e==null||typeof e==`boolean`?``:typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(Rt).join(``):``}const zt=new WeakMap,G=new WeakMap;function Bt(e,t,n){let r=q();if(r===null)return;let i=qt(e),a=qt(t);for(let[e]of i)a.has(e)||Xt(r,e,n);for(let[e,t]of a)i.has(e)?(t.kind===`title`||t.kind===`meta`)&&Yt(r,e,t,n):Jt(r,t,n)}function Vt(e,t){let n=q(),r=d(e,t);if(n===null||r===null)return null;let i=p(r);if(Y(r)){let t=document.createElement(e);return G.set(t,{key:i,kind:r.kind}),t}let a=n.entries.get(i);if(a?.kind===`metadata`)throw Error(`Expected a persistent resource entry.`);let o=a?.element??Z(n,i)??document.createElement(e);return a===void 0&&(n.entries.set(i,{count:0,element:o,kind:`persistent`,ready:null}),G.set(o,{key:i,kind:r.kind})),o}function Ht(e,t,n){let r=q();if(r===null)return e;let i=d(g(e),t);return i!==null&&Y(i)?J(r,i,t,n,e):Ut(r,e)}function Ut(e,t){let n=G.get(t);if(n===void 0){let e=rn(t);if(e===null)return t;n={key:p(e),kind:e.kind},G.set(t,n)}let r=e.entries.get(n.key);if(r?.kind===`metadata`)throw Error(`Expected a persistent resource entry.`);return r!==void 0&&r.element!==t?(r.count+=1,X(e,r.element)):(r===void 0?e.entries.set(n.key,{count:1,element:t,kind:`persistent`,ready:null}):r.count+=1,X(e,t))}function K(e,t){let n=q(),r=G.get(e);if(n===null||r===void 0)return;let i=n.entries.get(r.key);if(i?.kind===`metadata`){Zt(n,r.key,i,t);return}if(r.kind===`title`||r.kind===`meta`){G.delete(e),an(e);return}Wt(n,e)}function Wt(e,t){let n=G.get(t);if(n===void 0)return;let r=e.entries.get(n.key);if(r===void 0||r.element!==t){if(tn(e,t))return;G.delete(t);return}if(r.kind!==`persistent`)throw Error(`Expected a persistent resource entry.`);r.count>0&&--r.count}function Gt(e,t,n,r){let i=g(e),a=d(i,n),o=G.get(e);if(a===null)return e;let s=p(a),c=q();if(c===null)return W(e,t,n),e;let l=o===void 0?void 0:c.entries.get(o.key);if(l?.kind===`metadata`){if(!Y(a)||s===o?.key)return l.update(r,Y(a)?$t(a,n):n),l.element;K(e,r);let t=document.createElement(i);return W(t,{},n),a.kind===`title`&&(t.textContent=a.value),G.set(t,{key:p(a),kind:a.kind}),J(c,a,n,r,t)}if(o===void 0||s===o.key)return W(e,t,n),e;K(e,r);let u=c.entries.get(s),ee=u?.kind===`persistent`&&u.count>0?u.element:void 0,f=Vt(i,n)??e;return f===e?(W(e,t,n),e):(ee!==f&&W(f,{},n),Ht(f,n,r))}function Kt(e){let t=q();if(t===null)return Promise.resolve();let n=[];for(let r of e){if(!te(r)||r.kind===`title`||r.kind===`meta`)continue;let e=sn(r),i=p(e),a=t.entries.get(i)?.element,o=(a?.parentNode===t.head?a:null)??Z(t,i);if(o!==null){let r=t.entries.get(i);if(r?.kind===`metadata`)throw Error(`Expected a persistent resource entry.`);r?.element!==o&&(r={count:1,element:o,kind:`persistent`,ready:null},t.entries.set(i,r),G.set(o,{key:i,kind:e.kind}));let a=nn(t,e,i,r);a!==null&&n.push(a);continue}let s=dn(e),c={count:1,element:s,kind:`persistent`,ready:null};c.ready=cn(e)?un(s).then(()=>{t.entries.get(i)===c&&(c.ready=null)}):null,t.entries.set(i,c),G.set(s,{key:i,kind:e.kind}),en(t,s),c.ready!==null&&n.push(c.ready)}return n.length===0?Promise.resolve():Promise.all(n).then(()=>void 0)}function q(){if(typeof document>`u`||document.head==null)return null;let e=zt.get(document.head);return e===void 0&&(e={entries:new Map,head:document.head},zt.set(document.head,e)),e}function qt(e){let t=new Map;if(e===null)return t;let n=Array.isArray(e)?e:[e];for(let e of n){if(!te(e))continue;let n=sn(e),r=p(n);(!t.has(r)||Y(n))&&t.set(r,n)}return t}function Jt(e,t,n){if(Y(t)){J(e,t,Qt(t),n);return}let r=p(t),i=e.entries.get(r);if(i?.kind===`metadata`)throw Error(`Expected a persistent resource entry.`);let a=i?.element,o=a??Z(e,r)??dn(t);a===void 0&&(e.entries.set(r,{count:0,element:o,kind:`persistent`,ready:null}),G.set(o,{key:r,kind:t.kind})),Ut(e,o)}function Yt(e,t,n,r){let i=e.entries.get(t);if(i===void 0){Jt(e,n,r);return}if(i.kind!==`metadata`)throw Error(`Expected a metadata resource entry.`);i.update(r,Qt(n))}function Xt(e,t,n){let r=e.entries.get(t);r!==void 0&&(r.kind===`metadata`?Zt(e,t,r,n):Wt(e,r.element))}function J(e,t,n,r,i){let a=p(t),o=$t(t,n),s=e.entries.get(a);if(s?.kind===`persistent`)throw Error(`Expected a metadata resource entry.`);if(s===void 0){let n=Z(e,a)??i??document.createElement(t.kind);s=new Lt(n,t.kind,r,o),e.entries.set(a,s),G.set(n,{key:a,kind:t.kind})}else s.acquire(r,o);return X(e,s.element)}function Zt(e,t,n,r){n.release(r)!==`retained`&&(e.entries.delete(t),G.delete(n.element),an(n.element))}function Qt(e){return e.kind===`title`?{children:e.value}:{charset:e.charset,content:e.content,"data-fig-resource-key":e.key,"http-equiv":e[`http-equiv`],name:e.name,property:e.property}}function $t(e,t){return e.kind===`title`?{...t,children:e.value}:t}function Y(e){return e.kind===`title`||e.kind===`meta`}function X(e,t){return t.parentNode!==e.head&&en(e,t),ct(t),t}function en(e,t){let n=on(t);if(n===null){e.head.appendChild(t);return}let r=!1;for(let i=e.head.firstChild;i!==null;i=i.nextSibling){let a=h(i)?on(i):null;if(a!==null){if(a===n)r=!0;else if(r){e.head.insertBefore(t,i);return}}}e.head.appendChild(t)}function Z(e,t){for(let n=e.head.firstChild;n!==null;n=n.nextSibling)if(h(n)){let e=rn(n);if(e!==null&&p(e)===t)return n}return null}function tn(e,t){for(let n of e.entries.values())if(n.element===t)return!0;return!1}function nn(e,t,n,r){if(!cn(t))return null;if(r.ready!==null)return r.ready;if(!ln(r.element))return null;let i=un(r.element).then(()=>{e.entries.get(n)===r&&(r.ready=null)});return r.ready=i,i}function rn(e){return ee(g(e),t=>e.getAttribute(t))}function an(e){z(e),e.parentNode?.removeChild(e)}function on(e){if(g(e)!==`link`)return null;let t=rn(e);return t?.kind===`stylesheet`?t.precedence??``:null}function sn(e){return e.kind===`font`?{as:`font`,crossorigin:e.crossorigin??`anonymous`,fetchpriority:e.fetchpriority,href:e.href,key:e.key,kind:`preload`,type:e.type}:e}function cn(e){return e.kind!==`stylesheet`||e.blocking===`none`?!1:e.media===void 0||e.media===``||typeof matchMedia!=`function`||matchMedia(e.media).matches}function ln(e){return g(e)===`link`&&e.getAttribute(`rel`)===`stylesheet`&&`sheet`in e&&e.sheet===null}function un(e){return new Promise(t=>{let n=()=>{e.removeEventListener(`load`,n),e.removeEventListener(`error`,n),t()};e.addEventListener(`load`,n),e.addEventListener(`error`,n)})}function dn(e){let t=document.createElement(e.kind===`script`?`script`:`link`),n=f(e);for(let e of Object.keys(n)){let r=n[e];t.setAttribute(e,r===!0?``:r)}return t}function fn(e){if(!$(e))return null;let t=Q(e);return t===null?null:pn(e,t)}function pn(e,t){let n=mn(e);return n===null?null:{end:n,forceClientRender:!1,id:t.id,start:e,get error(){return hn(e)},get status(){return Q(e)?.status??t.status}}}function Q(e){if(!$(e))return null;if(e.data===s)return{id:null,status:`completed`};if(e.data===o)return{id:null,status:`client-rendered`};let t=e.data.startsWith(l)?e.data.slice(l.length):null;return t!==null&&t!==``?{id:t,status:`pending`}:null}function mn(e){let t=0;for(let n=e.nextSibling;n!==null;n=n.nextSibling)if($(n)){if(Q(n)!==null){t+=1;continue}if(n.data===c){if(t===0)return n;--t}}return null}function hn(e){let t=e.nextSibling;return Sn(t)?{digest:t.dataset.dgst,message:t.dataset.msg}:null}function gn(e){if(!Cn(e))return null;for(let t=e;t!==null;t=t.parentNode){let e=0;for(let n=t.previousSibling;n!==null;n=n.previousSibling)if($(n)){if(n.data===c){e+=1;continue}if(Q(n)!==null){if(e===0)return n;--e}}}return null}function _n(e,t){if(!Cn(e))return!1;let n=t.start.parentNode,r=t.end.parentNode;if(n===null&&r===null)return!1;for(let i=e;i!==null;i=i.parentNode){if(i===t.start||i===t.end)return!1;if(n!==null&&i.parentNode===n)return vn(i,t.start,t.end);if(r!==null&&r!==n&&i.parentNode===r)return yn(i,t.end)}return!1}function vn(e,t,n){for(let r=e;r!==null;r=r.previousSibling){if(r===t)return!0;if(r===n)return!1}return!1}function yn(e,t){for(let n=e;n!==null;n=n.nextSibling)if(n===t)return!0;return!1}function bn(e){for(let t=e.start;t!==null;){let n=t.nextSibling;if(xn(t),t===e.end)return;t=n}}function xn(e){e.parentNode?.removeChild(e)}function $(e){return typeof e==`object`&&!!e&&`data`in e&&`nodeType`in e&&e.nodeType===8}function Sn(e){return typeof e==`object`&&!!e&&`dataset`in e}function Cn(e){return typeof e==`object`&&!!e&&`parentNode`in e}function wn(e){return e.nodeType===9}const Tn=ae({createInstance:kn,createTextInstance:e=>document.createTextNode(e),validateInstanceNesting:(e,t,n)=>{},validateTextNesting:(e,t)=>{},containerType:e=>h(e)?g(e):null,appendInitialChild:(e,t)=>{e.appendChild(t),h(t)&&Hn(t)&&V(t,!0)},finalizeInitialInstance:(e,t)=>W(e,{},t,{initial:!0}),setTextContent:(e,t)=>{e.textContent!==t&&(e.textContent=t)},getFirstHydratableChild:Pn,getNextHydratableSibling:e=>Fn(e.nextSibling),canHydrateInstance:On,canHydrateTextInstance:(e,t,n)=>Vn(e)&&(n===!0||e.nodeValue===t),canRetainHydrationTail:e=>{let t=g(e);return t===`html`||t===`head`||t===`body`},resolveSingletonInstance:An,acquireSingletonInstance:(e,t)=>{jn(e),W(e,{},t,{initial:!0})},releaseSingletonInstance:(e,t)=>{W(e,t,{}),jn(e)},resolveHoistedInstance:(e,t,n)=>Nn(e,n)===`http://www.w3.org/1999/xhtml`?Vt(e,t):null,commitHoistedInstance:Ht,commitAssetResources:Bt,removeHoistedInstance:K,updateHoistedInstance:Gt,shouldCommitUpdate:(e,t,n)=>ft(e,n),clearContainer:e=>{Mn(e,wn(e)),queueMicrotask(A)},insertBefore:(e,t,n)=>{e.insertBefore(t,n),h(t)&&Hn(t)&&V(t),ct(t)},removeChild:(e,t)=>{z(t),e.removeChild(t)},commitTextUpdate:(e,t)=>{e.nodeValue!==t&&(e.nodeValue=t)},commitUpdate:W,commitHydratedInstance:kt,getActivityBoundary:Dn,getFirstActivityHydratable:e=>Fn(En(e).firstChild??null),commitHydratedActivityBoundary:e=>{let t=e.parentNode;if(t===null)return;let n=En(e);for(;n.firstChild!==null;)t.insertBefore(n.firstChild,e);t.removeChild(e)},hideInstance:e=>{pe(e),e.style.setProperty(`display`,`none`,`important`)},unhideInstance:(e,t)=>{let n=t.style?.display;e.style.setProperty(`display`,typeof n==`string`?n:``),me(e)},hideTextInstance:e=>{e.nodeValue=``},unhideTextInstance:(e,t)=>{e.nodeValue!==t&&(e.nodeValue=t)},getSuspenseBoundary:fn,getEnclosingSuspenseBoundaryStart:gn,isTargetWithinSuspenseBoundary:_n,shouldRecoverSuspenseMismatchAtRoot:(e,t)=>wn(e)&&_n(e.documentElement,t),registerSuspenseBoundaryRetry:(e,t)=>{e.start.__figRetry=t},commitHydratedSuspenseBoundary:e=>{e.status===`completed`&&!e.forceClientRender?(xn(e.start),xn(e.end)):bn(e),queueMicrotask(A)},removeDehydratedSuspenseBoundary:e=>{bn(e),queueMicrotask(A)},completeRootHydration:e=>{Ie(e),queueMicrotask(A)},preparePortalContainer:He,removePortalContainer:k});je(Tn.batchedUpdates),e(Tn.scheduleRefresh);function En(e){return`content`in e?e.content:e}function Dn(e){return h(e)&&g(e)===`template`&&e.getAttribute(t)!==null?e:null}function On(e,t,n){return!h(e)||!(`setAttribute`in e)||g(e)!==t.toLowerCase()?!1:Bn(e,n)}function kn(e,t,n){let r=Nn(e,n);return r===`http://www.w3.org/1999/xhtml`?document.createElement(e):document.createElementNS(r,e)}function An(e,t){if(wn(t))return e.toLowerCase()===`html`?t.documentElement:null;let n=t.ownerDocument;if(n==null||t!==n.documentElement)return null;switch(e.toLowerCase()){case`head`:return n.head;case`body`:return n.body;default:return null}}function jn(e){for(;e.attributes.length>0;)e.removeAttributeNode(e.attributes[0])}function Mn(e,t){let n=e.firstChild;for(;n!==null;){let r=n.nextSibling;if(n.nodeType===10){n=r;continue}if(t&&h(n)){let e=g(n);if(e===`html`||e===`head`||e===`body`){Mn(n,!0),n=r;continue}if(e===`script`||e===`style`||e===`link`&&n.getAttribute(`rel`)?.toLowerCase()===`stylesheet`){n=r;continue}}z(n),e.removeChild(n),n=r}}function Nn(e,t){let n=e.toLowerCase();return n===`svg`?`http://www.w3.org/2000/svg`:n===`math`?`http://www.w3.org/1998/Math/MathML`:`namespaceURI`in t&&g(t)!==`foreignobject`?t.namespaceURI??`http://www.w3.org/1999/xhtml`:`http://www.w3.org/1999/xhtml`}function Pn(e,t){return t!==void 0&&zn(t)!==null||g(e)===`textarea`&&t!==void 0&&Rn(t)?null:Fn(e.firstChild)}function Fn(e){let t=e;for(;t!==null&&(Ln(t)||t.nodeType===10||In(t));)t=t.nextSibling;return t}function In(e){return h(e)&&e.getAttribute(i)!==null}function Ln(e){return e.nodeType===8&&e.nodeValue===u}function Rn(e){return e.value!==void 0||e.defaultValue!==void 0}function zn(e){return v(e.unsafeHTML)?null:e.unsafeHTML}function Bn(e,t){let n=zn(t);return n===null||typeof n!=`string`||`innerHTML`in e}function Vn(e){return e.nodeType===3}function Hn(e){let t=g(e);return t===`option`||t===`optgroup`}export{ve as a,Fe as i,Kt as n,ue as o,Me as r,Tn as t};
2
+ //# sourceMappingURL=renderer-jfUYsG5x.js.map