@symbo.ls/element 3.14.803 → 3.14.805
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 +28 -0
- package/README.md +189 -0
- package/dist/cjs/src/cache.js +1 -1
- package/dist/cjs/src/connected.js +1 -0
- package/dist/cjs/src/core.js +6 -0
- package/dist/cjs/src/create.js +1 -6
- package/dist/cjs/src/cssLonghands.js +1 -1
- package/dist/cjs/src/delegate.js +1 -1
- package/dist/cjs/src/dispose.js +1 -1
- package/dist/cjs/src/extends.js +1 -1
- package/dist/cjs/src/features.js +1 -0
- package/dist/cjs/src/handlerChain.js +1 -0
- package/dist/cjs/src/hydration.js +1 -0
- package/dist/cjs/src/index.js +1 -1
- package/dist/cjs/src/install.js +1 -0
- package/dist/cjs/src/lean.js +1 -0
- package/dist/cjs/src/methods.js +1 -1
- package/dist/cjs/src/mountRecord.js +1 -0
- package/dist/cjs/src/mountScheduler.js +1 -1
- package/dist/cjs/src/mountYield.js +1 -0
- package/dist/cjs/src/plainRows.js +1 -0
- package/dist/cjs/src/update.js +1 -1
- package/dist/cjs/src/version.js +1 -1
- package/dist/cjs/src/viewEvents.js +1 -0
- package/dist/esm/src/cache.js +1 -1
- package/dist/esm/src/connected.js +1 -0
- package/dist/esm/src/core.js +6 -0
- package/dist/esm/src/create.js +1 -6
- package/dist/esm/src/cssLonghands.js +1 -1
- package/dist/esm/src/delegate.js +1 -1
- package/dist/esm/src/dispose.js +1 -1
- package/dist/esm/src/extends.js +1 -1
- package/dist/esm/src/features.js +1 -0
- package/dist/esm/src/handlerChain.js +1 -0
- package/dist/esm/src/hydration.js +1 -0
- package/dist/esm/src/index.js +1 -1
- package/dist/esm/src/install.js +1 -0
- package/dist/esm/src/lean.js +1 -0
- package/dist/esm/src/methods.js +1 -1
- package/dist/esm/src/mountRecord.js +1 -0
- package/dist/esm/src/mountScheduler.js +1 -1
- package/dist/esm/src/mountYield.js +1 -0
- package/dist/esm/src/plainRows.js +1 -0
- package/dist/esm/src/update.js +1 -1
- package/dist/esm/src/version.js +1 -1
- package/dist/esm/src/viewEvents.js +1 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @symbo.ls/element
|
|
2
2
|
|
|
3
|
+
## 3.14.805
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- xma.info report round (FW-XMA-EXCEPTIONS-UPSTREAM-1), its /simplify pass and the follow-ups.
|
|
8
|
+
|
|
9
|
+
- element: optional features (view events, `always` handler chains, plain-row diff, hydration, yielding mount) are feature slots — `create.js` installs all of them, `src/lean.js` none (the smbls embed); one chunked mount driver and one meter per task; the chunked first render costs about a third of what it did (a resumed row goes after the previous row, one `__ref` shape, the budget is read once); `whenConnected`; `onWindowLoad` after load reaches an element built off-document; a null/false row item under `childExtends` builds nothing; building an n-row list no longer scans the parent's keys per row.
|
|
10
|
+
- smbls: the embed is back under its 72 KiB cap and the iife is 2.6 % smaller (terser renames locals after esbuild in the two classic-script builds; maps chained); kits stay lazy in `smbls/core`, fetch is one chunk; live sync loads only when `wantsLiveSync`; a URL-loaded dependency registers in parcel builds.
|
|
11
|
+
- router: the newest navigation wins over one waiting on an async guard; no lazy chunk rides along a resumed route.
|
|
12
|
+
- default-config: accessible Dropdown writes its attributes straight to the nodes, one tab stop per list, an `active` write re-runs only the rows that change, a key-opened menu focuses its item during the reveal; Dialog and Icon clean-ups.
|
|
13
|
+
- styling (scratch, css, css-in-props): one compound-value resolver; CSS colour functions (`oklch()`, `color()`, `color-mix()`, `light-dark()`, `lab()`, `lch()`, `hwb()`) pass through compound values; border props read the scheme only in literal mode.
|
|
14
|
+
- fetch / brender: every server render starts from an empty query cache (seeds carry every request a page makes); the local adapter stays lazy; shared route loop for `smbls build` and `smbls brender`, `smbls brender --strict`.
|
|
15
|
+
- cli: every command that writes to the platform prints its target and needs a typed "production" or `--yes` for production; `smbls deploy --save` saves the provider, `-y/--yes` is consent; `deploy --dry-run` no longer pushes.
|
|
16
|
+
- frank-audit: FA205 reports only factory calls that run at module load.
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
- @symbo.ls/css@3.14.779
|
|
20
|
+
- css-in-props@3.14.763
|
|
21
|
+
- @symbo.ls/scratch@3.14.789
|
|
22
|
+
- @symbo.ls/signal@3.14.789
|
|
23
|
+
- @symbo.ls/utils@3.14.787
|
|
24
|
+
|
|
25
|
+
## 3.14.804
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- A navigation skips the router's scroll-to-top when the scroll node is already at the origin (no forced layout after the swap; the first render keeps it). A yielding mount chunk ends before the next child would cross the 50 ms budget, so chunks are no longer long tasks. `el.update({ style })` keeps a custom property's name as written.
|
|
30
|
+
|
|
3
31
|
## 3.14.803
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/README.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# @symbo.ls/element
|
|
2
|
+
|
|
3
|
+
The DOMQL v3.14 element engine: `create()`, `el.update()`, `dispose()`, the
|
|
4
|
+
reactive effects, events and lifecycle hooks. Apps reach it through `smbls`;
|
|
5
|
+
the authoring guide is `USAGE.md` at the repository root. This file covers the
|
|
6
|
+
contracts of the engine's hooks and events.
|
|
7
|
+
|
|
8
|
+
## Lifecycle hooks
|
|
9
|
+
|
|
10
|
+
Every lifecycle handler takes the element first: `(el, s, ctx, options?)`.
|
|
11
|
+
|
|
12
|
+
| Hook | Runs |
|
|
13
|
+
| -- | -- |
|
|
14
|
+
| `onStateInit`, `onStateCreated` | while the element builds its own state, before `onInit` |
|
|
15
|
+
| `onInit` | before the DOM node exists |
|
|
16
|
+
| `onAttachNode` | the node exists, not attached yet |
|
|
17
|
+
| `onCreate`, `onComplete`, `onRender`, `onRenderRouter` | in that order, once the subtree is built and attached to its parent |
|
|
18
|
+
| `onMounted` | next frame, once the element is connected to its document |
|
|
19
|
+
| `onFrame` | every animation frame while connected |
|
|
20
|
+
| `onBeforeUpdate` / `onUpdate` | around `el.update()` (`false` from `onBeforeUpdate` cancels) |
|
|
21
|
+
| `onBeforeRemove` / `onRemove` | around `dispose()` |
|
|
22
|
+
|
|
23
|
+
## Yielding mounts
|
|
24
|
+
|
|
25
|
+
`create()` builds a subtree in one synchronous run unless the mount is allowed
|
|
26
|
+
to yield: `mountYield` in the create options (the whole tree) or
|
|
27
|
+
`yieldChildren` on an element (its own children). `true` means a 50 ms budget;
|
|
28
|
+
a number is the budget in ms. A children loop that runs out of budget stops,
|
|
29
|
+
queues the rest, and continues in a later task (`scheduler.yield()`, else a
|
|
30
|
+
MessageChannel, else `setTimeout`). smbls turns this on for an app's first
|
|
31
|
+
render with a 10 ms budget (its `firstRender` option).
|
|
32
|
+
|
|
33
|
+
An element whose children were deferred is incomplete until the last of them
|
|
34
|
+
is built. It is attached in its place at once, so later chunks land in DOM
|
|
35
|
+
order, but `onCreate`, `onComplete`, `onRender`, `onRenderRouter` and the
|
|
36
|
+
`onMounted` queueing run after its last deferred child. Inside a yielding
|
|
37
|
+
mount an incomplete child holds its parent the same way, so every `onRender`
|
|
38
|
+
sees all of its children. The queue runs depth-first: a subtree finishes
|
|
39
|
+
before the siblings declared after it are built, so elements are built, and
|
|
40
|
+
their hooks fire, in exactly the order of a synchronous build — only spread
|
|
41
|
+
over several tasks — and nothing is placed below content that is still
|
|
42
|
+
growing. A child that comes back incomplete holds back what its parent builds
|
|
43
|
+
after it, like the budget does: the next row or named child, `content` and
|
|
44
|
+
the named children after the last row, the named children after `content`.
|
|
45
|
+
Rows from an array and from an object `children` are built in chunks alike.
|
|
46
|
+
A rebuild, a reconcile, an `if:` coming back and a create without the options
|
|
47
|
+
stay synchronous.
|
|
48
|
+
|
|
49
|
+
The budget is checked after each child, never inside one, by one meter per
|
|
50
|
+
task: it counts the children built and reads the clock only when its estimate
|
|
51
|
+
says the budget may be near (with uniform costs, the same decisions as a read
|
|
52
|
+
per child).
|
|
53
|
+
|
|
54
|
+
`el.set(content, options, attachOptions)` passes the attach options to the
|
|
55
|
+
content's create() and returns the content it created. smbls builds an app's
|
|
56
|
+
first view with `deferAttach` (the root) and `holdTail` (the first page).
|
|
57
|
+
|
|
58
|
+
| Export | Use |
|
|
59
|
+
| -- | -- |
|
|
60
|
+
| `whenMounted(el)` | promise: resolves once `el`'s create() has finished (at once when nothing was deferred) |
|
|
61
|
+
| `attachElement(el)` | attaches an element created with `{ deferAttach: true }` (create()'s attach options) — one insertion of its whole subtree |
|
|
62
|
+
| `releaseMount(el)` | releases an element created with `{ holdTail: true }`: its `onCreate` … `onRender` run once nothing else holds them |
|
|
63
|
+
| `mountPending(el)` | `true` while `el` waits for deferred children |
|
|
64
|
+
| `whenMountIdle()` | promise: resolves when no deferred mount work is queued |
|
|
65
|
+
| `yieldToMain()` | promise: resolves in a later task, through the same `scheduler.yield()` ladder |
|
|
66
|
+
| `holdMountFlush()` | holds the `onMounted` flush until the returned `release()` is called |
|
|
67
|
+
| `mountYieldBudget(value)` | the budget in ms a `mountYield` / `yieldChildren` value means (0 = no yielding) |
|
|
68
|
+
|
|
69
|
+
## A base that owns a lifecycle step: `always`
|
|
70
|
+
|
|
71
|
+
A merge gives every key one value, so an element's own `onRender` replaces the
|
|
72
|
+
one its base declares. That default does not change. A base marks a handler
|
|
73
|
+
`always` when every component that extends it must run it:
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
export const Tracked = {
|
|
77
|
+
onRender: { always: true, handler: (el) => el.call('trackImpression', el.key) }
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const Card = {
|
|
81
|
+
extends: 'Tracked',
|
|
82
|
+
onRender: (el, s) => {} // runs after Tracked's handler, never instead of it
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
- An `always` handler survives every merge that would replace it: an `extends`
|
|
87
|
+
chain or array, `childExtends`, the key auto-extend, a nested child
|
|
88
|
+
override, `childProps`, `props`. It runs before the handler that replaced it.
|
|
89
|
+
- Down a chain, `always` handlers accumulate (the deepest base first, an
|
|
90
|
+
`extends` array in order). One plain handler, the last one merged, runs
|
|
91
|
+
after them; a plain handler between them is still replaced:
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
Rise: { onRender: { always: true, handler: r } }
|
|
95
|
+
Card: { extends: 'Rise', onRender: c } // r, c
|
|
96
|
+
el: { extends: 'Card', onRender: o } // r, o (c replaced, as before)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
- The merged `el.onRender` is one function (shared by every instance of the
|
|
100
|
+
component). Calling it runs every handler with the caller's `this` and
|
|
101
|
+
arguments. A handler that throws does not stop the rest; the first error is
|
|
102
|
+
rethrown after them and reported like any hook error. `false` from any
|
|
103
|
+
handler is returned (a veto, e.g. `onBeforeUpdate`). A pending promise is
|
|
104
|
+
returned while any handler is async, so the hook stays guarded until it
|
|
105
|
+
settles.
|
|
106
|
+
- It composes the lifecycle hooks above, `onStateUpdate`, `onContentUpdate`
|
|
107
|
+
and the view events below (each entry with its own options). The bridge
|
|
108
|
+
hooks do not compose (`onBridgeMount` returns the host's one library
|
|
109
|
+
instance), nor do DOM events (their delegated listener holds one handler per
|
|
110
|
+
node). `always` on any other key warns in development and the default merge
|
|
111
|
+
applies.
|
|
112
|
+
|
|
113
|
+
## View events: `onInView` / `onLeaveView`
|
|
114
|
+
|
|
115
|
+
```js
|
|
116
|
+
export const Rise = {
|
|
117
|
+
data: { rise: 'wait' },
|
|
118
|
+
onInView: {
|
|
119
|
+
always: true, // every component that extends Rise keeps this step
|
|
120
|
+
once: true, // run the first time only, then stop watching
|
|
121
|
+
threshold: 0.1, // the share of the element that must be visible (0–1, default 0)
|
|
122
|
+
rootMargin: '0px', // grow or shrink the viewport, as IntersectionObserver's
|
|
123
|
+
handler: (entry, el, s, ctx) => el.update({ data: { rise: 'in' } })
|
|
124
|
+
},
|
|
125
|
+
onLeaveView: (entry, el, s, ctx) => {}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
- `onInView` runs when the element crosses into its threshold; `onLeaveView`
|
|
130
|
+
runs on the way out, never for an element that starts out of view. An
|
|
131
|
+
element that leaves its document while alive (`if:` hiding it) leaves the
|
|
132
|
+
view.
|
|
133
|
+
- `entry` is the `IntersectionObserverEntry`. `this` is the element and its
|
|
134
|
+
design system is active, as in every `onXxx` handler. A string handler calls
|
|
135
|
+
a project function: `onInView: 'reveal'` → `el.call('reveal', entry)`.
|
|
136
|
+
- One shared IntersectionObserver per document, threshold and `rootMargin`.
|
|
137
|
+
The first element that declares one of the events creates it; the last one
|
|
138
|
+
removed disconnects it. An app that declares neither creates no observer.
|
|
139
|
+
- The element is observed when it gets its node (create, or an `if:`
|
|
140
|
+
element's first appearance), unobserved on removal and once its `once`
|
|
141
|
+
handlers have run.
|
|
142
|
+
- Entries the browser delivers together run in delivery order and share
|
|
143
|
+
`entry.time`, so a stagger can count them.
|
|
144
|
+
- The element's own document is observed (an iframe app observes in the
|
|
145
|
+
frame). Without an IntersectionObserver (SSR, jsdom) nothing is observed and
|
|
146
|
+
nothing runs.
|
|
147
|
+
|
|
148
|
+
## Conditional blocks and their dependencies
|
|
149
|
+
|
|
150
|
+
A `'.isX'` / `'!isX'` block follows what its `isX` predicate reads. A state
|
|
151
|
+
read re-applies the block on the next state change. A predicate that reads
|
|
152
|
+
only the element (`isQuiet: (el) => !!el.quiet`, directly or through
|
|
153
|
+
`el.call`) re-runs on `el.update()`.
|
|
154
|
+
|
|
155
|
+
In development, a predicate whose first run read state WITHOUT subscribing to
|
|
156
|
+
it — the `in` operator, `Object.keys` / spread / JSON, a `__` key,
|
|
157
|
+
`s.parse()` / `keys()` / `values()` — and so tracked nothing warns once: no
|
|
158
|
+
state write will ever re-run it. The decision is made at run time
|
|
159
|
+
(`countUntrackedReads` in `@symbo.ls/signal`); the predicate's source is never
|
|
160
|
+
read.
|
|
161
|
+
|
|
162
|
+
```js
|
|
163
|
+
isShown: (el, s) => ('openId' in s.root) && s.root.openId === el.tipId,
|
|
164
|
+
isShownDeps: [(el, s) => s.root.openId], // read first, always: subscribed while undeclared
|
|
165
|
+
'.isShown': { opacity: '1' }
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
`isXDeps: []` declares the predicate static on purpose: it is never warned
|
|
169
|
+
about.
|
|
170
|
+
|
|
171
|
+
## Optional features and the lean entry
|
|
172
|
+
|
|
173
|
+
Five features are slots of the engine, each consulted with one null test:
|
|
174
|
+
view events (`onInView` / `onLeaveView`), `always` handler chains, the
|
|
175
|
+
plain-row re-run diff of a `children` factory, hydration adoption, and the
|
|
176
|
+
yielding mount (`mountYield`, `yieldChildren`, `holdTail`, the deferred
|
|
177
|
+
create() tail). `@symbo.ls/element` installs all of them when it is loaded
|
|
178
|
+
(`src/create.js`), so an app — and every module that imports `create.js` —
|
|
179
|
+
behaves the same with them.
|
|
180
|
+
|
|
181
|
+
`@symbo.ls/element/src/lean` is the engine without them (`create`,
|
|
182
|
+
`applyExtends`, `registerEvent`, `REGISTRY`). The smbls embed
|
|
183
|
+
(`smbls/embed`, `SymbolsEmbed`, whose IIFE has a byte budget —
|
|
184
|
+
`packages/smbls/__tests__/embed-bundle.contract.test.js`) builds on it.
|
|
185
|
+
There, an `{ always: true, handler }` value is not a handler (an extender's
|
|
186
|
+
plain handler replaces the base's, as before `always`), the view events never
|
|
187
|
+
fire, a plain `children` factory rebuilds its rows on every re-run, nodes are
|
|
188
|
+
never adopted from a pre-rendered page, and every children loop builds in one
|
|
189
|
+
go (`mountYield` and `holdTail` are ignored).
|
package/dist/cjs/src/cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var c=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var x=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:!0})},y=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of h(t))!b.call(e,o)&&o!==r&&c(e,o,{get:()=>t[o],enumerable:!(n=m(t,o))||n.enumerable});return e};var v=e=>y(c({},"__esModule",{value:!0}),e);var w={};x(w,{SVG_NS:()=>i,SVG_TAGS:()=>s,cacheNode:()=>T,createHTMLNode:()=>f,detectTag:()=>g,firstSlotAfterText:()=>k,isSvgTag:()=>d,isValidTag:()=>l});module.exports=v(w);const i="http://www.w3.org/2000/svg",s=new Set(["svg","path","circle","ellipse","line","polyline","polygon","rect","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","animate","animateMotion","animateTransform","set","foreignObject","desc","title","metadata"]),S=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","string","fragment","shadow"]);function l(e){return S.has(e)||s.has(e)}function d(e){return s.has(e)}function g(e){let{tag:t,key:r}=e;if(typeof t=="function")try{t=t(e,e.state,e.context)}catch(a){t=void 0,typeof console<"u"&&console.error&&console.error(`[smbls] \`tag:\` factory threw on "${r||"<anon>"}" \u2014 falling back to key-based tag detection:`,a?.message||a)}if(t===!0&&(t=r),typeof t=="string"&&l(t))return t;if(!r||typeof r!="string")return"div";const n=new Set(["html","head","body","meta","link","script","style","title","base","noscript","template","th","tr","td","thead","tbody","tfoot","caption","col","colgroup"]);let o=r.toLowerCase();return o.includes(".")&&(o=o.split(".")[0]),o.includes("_")&&(o=o.split("_")[0]),l(o)&&!n.has(o)?o:"div"}const p={};function f(e,t){const r=t?.context?.document||globalThis.document;if(!r)return null;if(e==="string")return r.createTextNode(t?.text||"");if(e==="fragment")return r.createDocumentFragment();if(d(e)){const n=t?.parent;if(e==="svg"||n?.node?.namespaceURI===i)return r.createElementNS(i,e);if(e!=="svg")return r.createElement("div")}return r.createElement(e)}function T(e){const t=e.tag=g(e),n=d(t)&&(t==="svg"||e.parent?.node?.namespaceURI===i)?"svg:"+t:t,o=e?.context?.document||globalThis.document;let a=p[n];if(a||(a=p[n]=f(t,e)),!a)return null;const u=o&&a.ownerDocument!==o?f(t,e):a.cloneNode(!0);return t==="string"&&(u.nodeValue=e.text||""),u}function k(e,t){return t&&t.parentNode===e?t.nextSibling:e.firstChild}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var f=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var a=(n,e)=>{for(var o in e)f(n,o,{get:e[o],enumerable:!0})},l=(n,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of _(e))!u.call(n,r)&&r!==o&&f(n,r,{get:()=>e[r],enumerable:!(t=d(e,r))||t.enumerable});return n};var C=n=>l(f({},"__esModule",{value:!0}),n);var w={};a(w,{flushConnected:()=>h,forgetConnected:()=>g,isElementConnected:()=>i,whenConnected:()=>p});module.exports=C(w);const c=new Set;function i(n){const e=n&&n.node;if(!e)return!1;const o=e.nodeType===11?n.__ref?.__fragmentAnchor:e;return o?o.isConnected!==!1:!1}function p(n,e){const o=n&&n.node,t=n&&n.__ref;if(!(!o||!t||typeof e!="function")){if(i(n)){e(n);return}(t.__onConnected||(t.__onConnected=[])).push(e),c.add(n)}}function h(){if(c.size)for(const n of c){const e=n.__ref,o=n.node;if(!e||!o){c.delete(n);continue}if(!i(n))continue;c.delete(n);const t=e.__onConnected;if(e.__onConnected=null,!!t)for(let r=0;r<t.length;r++)try{t[r](n)}catch(s){typeof console<"u"&&console.error&&console.error("[smbls] whenConnected callback failed:",s?.message||s)}}}function g(n){c.size&&c.delete(n)&&n.__ref&&(n.__ref.__onConnected=null)}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";var nn=Object.create;var Bt=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var en=Object.getOwnPropertyNames;var cn=Object.getPrototypeOf,fn=Object.prototype.hasOwnProperty;var an=(t,o)=>{for(var s in o)Bt(t,s,{get:o[s],enumerable:!0})},Do=(t,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of en(o))!fn.call(t,r)&&r!==s&&Bt(t,r,{get:()=>o[r],enumerable:!(n=rn(o,r))||n.enumerable});return t};var Lo=(t,o,s)=>(s=t!=null?nn(cn(t)):{},Do(o||!t||!t.__esModule?Bt(s,"default",{value:t,enumerable:!0}):s,t)),un=t=>Do(Bt({},"__esModule",{value:!0}),t);var Dr={};an(Dr,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>mt,acquireBeforeUpdateGuard:()=>ms,arrayRowDefinition:()=>Qs,attachElement:()=>xn,completeCreate:()=>Zs,create:()=>m,default:()=>Rr,flushMounts:()=>Xt,holdMountFlush:()=>_n,isStaticCssProp:()=>hr,markRuntimeSupplied:()=>At,placeAfter:()=>To,placeRows:()=>Js,placedRowNode:()=>Jt,recompileStaticCss:()=>yr,reconcileAttrProp:()=>gr,releaseBeforeUpdateGuard:()=>Ft,reportCreateChildrenError:()=>Ys,resolveStyleBlock:()=>Nt,rowAttach:()=>Xs,runtimeViewOf:()=>ut,syncSelectValue:()=>Mt,triggerContentUpdate:()=>Eo,writeAttr:()=>Lt,writeElementText:()=>Dt});module.exports=un(Dr);var K=require("@symbo.ls/signal"),j=require("@symbo.ls/signal"),dn=Lo(require("@symbo.ls/signal"),1),q=require("./runContext.js"),ot=require("./cache.js"),G=require("./registry.js"),N=require("./delegate.js"),H=require("./features.js"),Gs=require("./bridge.js"),W=require("./extends.js"),Qt=require("./connected.js"),dt=require("./mountRecord.js"),Ws=require("./methods.js"),Ir=require("./dispose.js"),it=require("./devRuntime.js"),R=require("@symbo.ls/utils"),Vt=Lo(require("@symbo.ls/utils"),1),Y=require("./pluginHooks.js"),at=require("@symbo.ls/state"),C=require("css-in-props"),tt=require("@symbo.ls/css"),M=require("@symbo.ls/scratch"),v=require("attrs-in-props"),zs=require("./engineRegistry.js"),B=require("./cssLonghands.js"),Q=require("./attributeFirst.js"),qs=require("./version.js");const No=(0,zs.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},qs.VERSION),pt=[],nt=new Set;let so=!1,Mo=0,ht=null,wt=null;function yt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function Fo(){return typeof document<"u"&&document.visibilityState==="hidden"}const ln=250,pn=1e3;function hn(){return wt&&(wt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||Fo())?!0:yt()-Mo>=pn}function yn(){if(so=!0,Mo=yt(),wt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(Xt,0);ht=t?()=>t(o):null;return}if(Fo()){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(Xt,ln);ht=t?()=>t(o):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;wt=requestAnimationFrame;const o=requestAnimationFrame(Xt);ht=t?()=>t(o):null}}function St(){if(so){if(!hn())return;const t=ht;if(ht=null,t)try{t()}catch{}}yn()}const Io=300,$o=15e4;let no=0;function _n(){no++;let t=!1;return()=>{t||(t=!0,!(--no>0)&&(pt.length||nt.size)&&St())}}function Xt(){if(so=!1,ht=null,wt=null,no>0||(nt.size&&Ar(),!pt.length))return;const t=pt.splice(0,pt.length);for(let o=0;o<t.length;o++){const s=t[o];if(s.node){if(!s.node.isConnected){const n=s.__ref||(s.__ref={});n.__mountAttempts=(n.__mountAttempts||0)+1,n.__mountFirstAttemptAt==null&&(n.__mountFirstAttemptAt=yt());const r=yt()-n.__mountFirstAttemptAt;n.__mountAttempts<=Io&&r<$o?(pt.push(s),St()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",s.key||s.tag||s);continue}typeof s.onBridgeMount=="function"&&(0,Gs.mountBridge)(s),typeof s.onMounted=="function"&&U("Mounted",s,s.__ref?.__mountOptions||{})}}}function ro(t,o){const s=t.__ref?.__autoGrow;s&&s.active&&Tt(t,!0),!(typeof t.onMounted!="function"&&typeof t.onBridgeMount!="function")&&(t.__ref.__mountOptions=o,pt.push(t),St())}function Eo(t,o){typeof t.onContentUpdate=="function"&&((0,Y.dispatchPluginHook)("contentUpdate",t,o),(0,q.withDesignSystem)(t,()=>{try{t.onContentUpdate(t,t.state,t.context,o)}catch(s){if((0,Y.reportLifecycleError)(t,"onContentUpdate",s),t.context?.strictMode)throw s}}))}function gn(t){return t.toLowerCase()}function Uo(t){const o=t.charCodeAt(0);return o===58||o===64||o===38||o===91}function Kt(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Ho(t,o,s,n){return Gt(n,Kt(t)||(o&&typeof o=="object"?Kt(o.key):void 0)||String(s))}function Gt(t,o){if(!t||typeof o!="string")return o;let s=o;for(;bn(t,s);)s="$"+s;return s!==o&&An(t,o,s),s}function bn(t,o){if(G.REGISTRY.has(o)&&o!=="content")return!0;if(!(o in t))return!1;const s=t[o];return!(s&&typeof s=="object"&&s.__ref&&s.parent===t)}const Bo=new Set;function An(t,o,s){if(!(0,it.isLoudDevRuntime)())return;const n=t.__ref&&t.__ref.path&&t.__ref.path.join(".")||t.key||"<root>",r=n+"::"+o;Bo.has(r)||(Bo.add(r),console.warn(`[smbls] a child keyed "${o}" at ${n} names a property of its parent; it lives at el["${s}"] (data-key="${s}") so the parent keeps its own "${o}". Prefix the data keys to keep plain el.<key> access.`))}function m(t,o,s,n={},r){if((0,j.getObserver)())return(0,q.untrack)(()=>m(t,o,s,n,r));if(t==null||t===!1)return null;const c=Hn(t);(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=Kt(s);const a=Kt(t.key),i=Object.create(null);i.key=s||(a&&o?Gt(o,a):a)||`_${No.uniqId++}`,i.parent=o||null,i.context=t.context||o?.context||n.context||{},i.context.__create||(i.context.__create=m);const e=i.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:o?.__ref?.root||i,path:o?.__ref?.path?[...o.__ref.path,i.key]:[i.key],origin:t,__mount:null,__plainRows:null,__ifParked:null};c&&(e.__runtimeSource=c);let f=r;r&&(r.holdTail||r.deferAttach)&&(r.holdTail&&H.FEATURES.mount!==null&&H.FEATURES.mount.hold(i),r.deferAttach&&((0,dt.mountRecord)(e).attachLater=!0),f=void 0);const l=t;if(t=Vo(i,t,s,a,o,n),i.if!=null){let _;if(typeof i.if=="function")try{_=i.if(i,i.state,i.context)}catch(p){if(_=!1,e.__ifError=p,typeof console<"u"&&console.warn){const y=i.key||i.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${y} \u2014 treating as false:`,p?.message||p)}}else _=i.if;e.__if=!!_}if(e.__if)typeof i.if=="function"&&(e.__ifInitialized=!0);else{if(o){o[i.key]=i;const p=o.__ref;p&&(p.__ifParked||(p.__ifParked=new Set)).add(i.key)}const _=Cn(t,s,i.context?.components);return _.length&&(e.__ifLateMerge={definition:l,key:s,ownKey:a,names:_,options:n}),typeof i.if=="function"&&es(i,e,i.if),i}i.tag||(i.tag=(0,ot.detectTag)(i)),U("Init",i,n);const u=H.FEATURES.hydration,d=i.node=u!==null&&u.adopt(i)||(0,ot.cacheNode)(i);if(!d)return i;if(i.tag==="fragment"){const p=(i.context?.document||globalThis.document).createComment("");d.appendChild(p),e.__fragmentAnchor=p}if(U("AttachNode",i,n),d.setAttribute&&i.key&&d.setAttribute("data-key",i.key),o){const _=o[i.key];o[i.key]=i;const p=o.__ref?.__children;p&&(_===void 0||!p.includes(i.key))&&p.push(i.key)}d.setAttribute&&i.context?.scopeSelector&&i.context.scopeSelector!==":root"&&i.context.key&&i.key===i.context.key&&d.setAttribute("data-smbls-app",i.context.key),i.id&&d.setAttribute&&(d.id=i.id),$s(i,n),ss(i),rs(i);try{Bs(i,n)}catch(_){Ys(i,_)}const h=e.__mount;return h!==null&&h.pending>0?(h.attachLater||Zt(i,o,f),h.tail=()=>H.FEATURES.mount.finish(i,n),i):(Mt(i,!0),(h===null||!h.attachLater)&&Zt(i,o,f),Zs(i,n),i)}function xn(t){const o=t&&t.__ref&&t.__ref.__mount;return!o||!o.attachLater||(o.attachLater=!1,!t.node)?!1:(Zt(t,t.parent),!0)}function Ys(t,o){if(typeof console<"u"&&console.error){const s=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] createChildren failed at ${s}:`,o?.message||o,o?.stack?`
|
|
2
|
+
`+o.stack.split(`
|
|
3
|
+
`).slice(0,6).join(`
|
|
4
|
+
`):"")}}function Zs(t,o){if(typeof t.html=="function"&&t.node&&!t.node.innerHTML&&(0,q.withDesignSystem)(t,()=>{try{const s=t.html(t,t.state,t.context);s!=null&&typeof s!="function"&&(t.node.innerHTML=s)}catch{}}),U("Create",t,o),U("Complete",t,o),U("Render",t,o),U("RenderRouter",t,o),ro(t,o),typeof t.onFrame=="function"){const s=t.onFrame,n=t.context?.designSystem,r=()=>{if(t.node){if(t.node.isConnected){n&&(0,M.pushConfig)(n);try{s(t,t.state,t.context)}catch(c){console.error("[DOMQL] onFrame error:",c)}finally{n&&(0,M.popConfig)()}}requestAnimationFrame(r)}};requestAnimationFrame(r)}}function Wt(t,o){const s=o&&o.__ref&&o.__ref.__mount;!s||!s.tail||s.holder||(s.holder=t,H.FEATURES.mount.hold(t))}const wn=new Set(["childProps","attr","style","scope","data","vars"]);function Vo(t,o,s,n,r,c){if(s&&!o.extends&&!o.extend){const p=s.indexOf("_"),y=s.indexOf(".");let A=p>0?p:-1;if(y>0&&(A<0||y<A)&&(A=y),A>0){const S=s.substring(0,A),w=t.context?.components;w&&(w[S]||w["smbls."+S])?o={...o,extends:S}:w&&(0,it.isLoudDevRuntime)()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${S}" but neither "${S}" nor "smbls.${S}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}t.__ref&&(t.__ref.__mergeLayer=null),(0,W.applyExtends)(t,o,c);const a=(0,W.openMergeLayer)(t),i=t.props&&typeof t.props=="object"?t.props:null;for(const p in o)if(!(p==="parent"||p==="node"||p==="__ref"||p==="extends"||p==="context"||p==="props")){if(p==="key"){n&&(t.key=r?Gt(r,n):n);continue}a&&a.mark(p),eo(t,p,o[p])}if(i)for(const p in i)eo(t,p,i[p]);const e=o.props;if(e&&typeof e=="object"){for(const p in e)eo(t,p,e[p]);if(a)for(const p in e)a.mark(p)}(0,W.closeMergeLayer)(t),o.classlist!==void 0&&(t.classlist=o.classlist),o.text!==void 0&&(t.text=o.text),o.html!==void 0&&(t.html=o.html);const f=t.scope&&typeof t.scope=="object"?t.scope:null,l=r?.scope,u=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,d=l||u||null;if(o.scope!==void 0||f){const p={};f&&Object.assign(p,f),o.scope!==void 0&&Object.assign(p,o.scope),t.scope=(0,K.createScopeStore)(p,d)}else d&&(t.scope=d);o.if!==void 0&&(t.if=o.if);const h=t.__ref,_=Bn(t,h&&h.__runtimeSource);return h&&(h.__declaredArrays=_||void 0),(0,Ws.addMethods)(t),vn(t,r,o,c),o}function eo(t,o,s){const n=t[o],r=H.FEATURES.chains;if(r!==null&&r(t,o,n,s))return;const c=n&&s&&typeof n=="object"&&typeof s=="object"&&!Array.isArray(n)&&!Array.isArray(s);c&&o.charCodeAt(0)>=65&&o.charCodeAt(0)<=90?t[o]=(0,W.deepMergeChild)(n,s):c&&wn.has(o)?t[o]={...n,...s}:c&&Uo(o)?t[o]=(0,W.deepMergeChild)(n,s):t[o]=s}const Sn=new Set(["key","parent","context","__ref"]);function kn(t,o){for(const n of Object.keys(t))Sn.has(n)||delete t[n];let s=o.definition;if(!s.extends&&!s.extend&&typeof o.key=="string"){const n=t.context?.components||{},r=n[o.key]||n["smbls."+o.key];r&&(s={...s,extends:r})}(0,q.untrack)(()=>Vo(t,s,o.key,o.ownKey,t.parent,o.options))}function Cn(t,o,s){const n=s||{},r=i=>!!(n[i]||n["smbls."+i]),c=[],a=[];if(t.extends&&a.push(...Array.isArray(t.extends)?t.extends:[t.extends]),t.extend&&a.push(...Array.isArray(t.extend)?t.extend:[t.extend]),a.length){for(const i of a){if(typeof i!="string")continue;const e=i.includes(">")?i.split(">")[0].trim():i;r(e)||c.push(e)}return c}if(typeof o=="string"&&/^[A-Z]/.test(o)){let i=-1;const e=o.indexOf("_"),f=o.indexOf(".");e>0&&(i=e),f>0&&(i<0||f<i)&&(i=f);const l=i>0?o.substring(0,i):o;r(l)||c.push(l)}return c}function io(t,o,s){if(typeof t.onStateInit!="function"&&!(0,Y.hasPluginHook)(t,"stateInit"))return;const n=t.state;t.state=o;try{U("StateInit",t,s)}finally{t.state=n}}const co=t=>({isDataOnlyKey:o=>(0,R.polyglotSeededKeys)(t).has(o)});function vn(t,o,s,n){const r=!o,c=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=r&&c&&t.context?.state,i=s.state!==void 0&&!a?s.state:t.state&&!(0,K.isStore)(t.state)?t.state:void 0;if(i==null){if(o?.state)t.state=o.state,(0,at.applyStateMethods)(t,t.state);else if(t.context?.state){const e=t.context.state,f={...e},l=t.context?.polyglot;if(l?.translations){const u=t.context,d=e.lang||l.defaultLang||"en",h=new Set,_=(A,S)=>{h.has(A)||(0,R.isPolyglotWritableKey)(u,A,f)&&(f[A]=S,h.add(A),(0,R.markPolyglotSeeded)(u,A,S))},p=l.translations[d];if(p&&typeof p=="object")for(const A in p)_(A,p[A]);const y=new Set(l.languages||[]);for(const A in l.translations)y.has(A)||_(A,l.translations[A])}(0,K.isStore)(f)||io(t,f,n),t.state=(0,K.isStore)(f)?f:(0,K.createStore)(f,co(t.context)),t.state.__element=t,t.state.root=t.state,(0,at.applyStateMethods)(t,t.state),Vt.promoteActiveRootState?.(e,t.state),U("StateCreated",t,n)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,at.applyStateMethods)(t,t.state);return}if(typeof i=="string"){if(t.state=Wo(i,o),t.state&&typeof t.state=="object"&&!(0,K.isStore)(t.state)){const e=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:e,enumerable:!1,configurable:!0,writable:!0})}(0,at.applyStateMethods)(t,t.state),Pn(t,i,o),U("StateCreated",t,n);return}if(typeof i=="function"){const e=i(t,o?.state);if((0,K.isStore)(e))t.state=e;else{const f=e||{};io(t,f,n),t.state=(0,K.createStore)(f,o?.state?void 0:co(t.context))}}else if((0,K.isStore)(i))t.state=i;else{const e={...i};io(t,e,n),t.state=(0,K.createStore)(e,o?.state?void 0:co(t.context))}t.state.__element=t,o?.state?(t.state.parent=o.state,t.state.root=o.state.root||o.state):t.state.root=t.state,(0,at.applyStateMethods)(t,t.state),Vt.promoteActiveRootState?.(i,t.state),U("StateCreated",t,n)}function Ko(t,o){if(!o)return t;const s=o.split("/");let n=t;for(const r of s){if(n==null)return{};n=n[r]}return n??{}}function Go(t,o){const s=o.state;return t.startsWith("~/")?[s&&(s.root||s),t.slice(2)]:t.startsWith("../")?[s,t.slice(3)]:[s,t]}function Wo(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")||t.startsWith("~/")){const[r,c]=Go(t,o);return c?Ko(r,c):r??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=Ko(o.state,t);if(s!=null&&Object.keys(s).length>0)return s;const n=o.context?.polyglot;if(n?.translations){const r=o.state?.root?.lang||n.defaultLang||"en",c=n.translations[r];if(c?.[t]!==void 0)return c[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function jn(t,o){const[s,n]=Go(t,o);if(!n||!s||typeof s!="object")return;const r=s[n];if(r!==void 0||n.indexOf("/")===-1)return r;let c=s;for(const a of n.split("/")){if(c==null||typeof c!="object")return;c=c[a]}return c}function Pn(t,o,s){const n=t.__ref;if(!n||!s||o==="."||!(0,K.isStore)(s.state))return;n.__stateBinding&&n.__stateBinding.dispose();const r=(0,q.untrack)(()=>(0,j.createEffect)(()=>{const c=jn(o,s);!c||typeof c!="object"||c===t.state||(0,q.untrack)(()=>zo(t,t.state,c,!0))},{depth:n.path?n.path.length:0,label:P(n,"state")}));r._isStateBinding=!0,n.__stateBinding=r,n.__effects&&n.__effects.push(r)}function zo(t,o,s,n){const r=t.__ref;if(!r)return;if(n||t.state===o){t.state=s,n&&(0,at.applyStateMethods)(t,s),Yo(r);const a=r.__children;if(a)for(let i=0;i<a.length;i++){const e=t[a[i]];e&&e.__ref&&e.parent===t&&zo(e,o,s,!1)}return}if(r.__stateBinding){r.__stateBinding._notify();return}const c=t.state;c&&typeof c=="object"&&c.parent===o&&(c.parent=s,Yo(r))}function qo(t,o){const s=t.__ifParked;if(!s||!s.size)return o;for(const n of s)o.includes(n)||o.push(n);return o}function Yo(t){const o=t.__effects;if(o)for(let s=0;s<o.length;s++){const n=o[s];n&&!n._disposed&&!n._isStateBinding&&!n._isSubscribeToEffect&&typeof n._notify=="function"&&n._notify()}}const En=new Set(["s","state","ctx","context"]),fo=new WeakMap;function Tn(t){if(fo.has(t))return fo.get(t);let o=null;try{const s=typeof Vt.getFunctionSource=="function"?Vt.getFunctionSource(t):Function.prototype.toString.call(t);if(typeof s=="string"){const n=s.match(/^\s*(?:async\s+)?([A-Za-z_$][\w$]*)\s*=>/)||s.match(/^[^(]*\(([^)]*)\)/);n&&(o={params:n[1].split(",").map(r=>r.trim())})}}catch{}return fo.set(t,o),o}function On(t){const o=Tn(t);return o?o.params.map(s=>s.split("=")[0].trim()).filter(Boolean):[]}const Rn=3,Dn=/^(is|has)[A-Z0-9_$]/,Ln=new Set(["routerOptions"]),Zo=new WeakSet;function Nn(t,o){if(typeof t!="function"||t.length!==2||o&&(Dn.test(o)||Ln.has(o))||Zo.has(t))return!1;const s=On(t);if(s.length<2)return!1;const n=s[1].replace(/[{}[\]]/g,"").trim();return n.length<Rn||En.has(n)?!1:(Zo.add(t),!0)}function Mn(t){const o=t.__ref,s=t.tag||"div",n=t.context?.designSystem,r=[],c=Object.keys(t);for(let a=0;a<c.length;a++){const i=c[a];if(typeof t[i]!="function"||G.REGISTRY.has(i))continue;const e=i.charCodeAt(0);e>=65&&e<=90||(0,N.isHandlerKey)(i)||C.CSS_PROPS_REGISTRY[i]||C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(i)||e!==45&&((0,v.checkAttributeByTagName)(s,i)||((0,it.isLoudDevRuntime)()&&Nn(t[i],i)&&console.warn(`[smbls] custom prop "${i}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${i}', \u2026) instead of reading el.${i}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:i,fn:t[i]})))}for(let a=0;a<r.length;a++){const{prop:i,fn:e}=r[a];o.__exec[i]=e,Object.defineProperty(t,i,{get(){n&&(0,M.pushConfig)(n);try{return e(t,t.state,t.context)}catch{return}finally{n&&(0,M.popConfig)()}},set(f){delete o.__exec[i],Object.defineProperty(t,i,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Fn(t,o){if(!(!Array.isArray(o)||o.length===0))for(let s=0;s<o.length;s++){const n=o[s];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function L(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...n){return Fn(t,o),s.apply(this,n)}}function _t(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function P(t,o){return()=>t.path.join(".")+"::"+o}const Qo=new Set;function V(t,o,s){if(!(0,it.isLoudDevRuntime)())return;const n=P(t,o)();Qo.has(n)||(Qo.add(n),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const Xo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,Jo=new WeakMap,In=t=>{let o=Jo.get(t);if(o!==void 0)return o;o=null;let s;try{s=String(t)}catch{s=""}if(s.includes("{{")){Xo.lastIndex=0;let n;for(;(n=Xo.exec(s))!==null;)n[2].includes("{{")&&(o||(o=[])).push(n[2])}return Jo.set(t,o),o},$n=(t,o)=>{const s=In(t);if(s)for(let n=0;n<s.length;n++)o.add(s[n])},Un=(t,o)=>!(0,N.isHandlerKey)(t)&&!(0,Q.isCssProp)(o,t),ao=(t,o,s,n,r)=>{if(typeof o=="string"){!r&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&Un(t,n)&&$n(o,s)},uo=new WeakMap,kt=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),Ct=t=>{if(typeof t=="string"||typeof t=="number")return{text:t};if(!t||typeof t!="object"||Array.isArray(t))return null;const o=t.props;return o&&typeof o=="object"&&!Array.isArray(o)?(0,W.deepMergeChild)(t,o):t},vt=(t,o)=>t&&o?(0,W.deepMergeChild)(t,o):t||o||null,mo=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&kt(s,o)},ut=(t,o)=>mo(t,o)?Ct(t.__ref.__runtimeSource[o]):null,At=(t,o)=>(o&&t&&typeof t=="object"&&uo.set(t,o),t),Hn=t=>{if(!t||typeof t!="object")return;const o=uo.get(t);return o&&uo.delete(t),o},lo=(t,o,s)=>{if(typeof t=="string"){t.includes("{{")&&o.add(t);return}if(!(!t||typeof t!="object"||s.has(t))){if(s.add(t),Array.isArray(t)){for(let n=0;n<t.length;n++)lo(t[n],o,s);return}if(!t.__ref)for(const n of Object.keys(t)){if(n==="state")continue;const r=Object.getOwnPropertyDescriptor(t,n);r&&"value"in r&&lo(r.value,o,s)}}},Bn=(t,o)=>{let s=null;for(const n of Object.keys(t)){if(G.REGISTRY.has(n)||o&&kt(o,n))continue;const r=Object.getOwnPropertyDescriptor(t,n),c=r&&r.value;if(!Array.isArray(c))continue;const a=new Set;lo(c,a,new Set),a.size&&(s||(s=new Map),s.set(c,a))}return s},ts=(t,o)=>{if(Array.isArray(o))for(let s=t;s;s=s.parent){const n=s.__ref&&s.__ref.__declaredArrays,r=n&&n.get(o);if(!r)continue;const c=t.__ref;c.__authoredTemplates||(c.__authoredTemplates=new Set);for(const a of r)c.__authoredTemplates.add(a);return}},os=["attr","aria","data","metadata"],Vn=t=>{if(os.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},Kn=(t,o)=>{const s=new Set,n=t.tag||"div";for(const r of Object.keys(t)){const c=Object.getOwnPropertyDescriptor(t,r),a=c&&c.value,i=!!o&&kt(o,r);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!Vn(r))continue;const e=i?o[r]:null,f=e&&typeof e=="object"?e:null,l=r.charCodeAt(0)===46||r.charCodeAt(0)===33;for(const u in a){const d=i&&(!f||kt(f,u)),h=a[u];if(l&&h&&typeof h=="object"&&!Array.isArray(h)&&os.includes(u)){for(const _ in h)ao(_,h[_],s,n,d);continue}ao(u,h,s,n,d)}continue}ao(r,a,s,n,i)}return s};function ss(t,o){const s=t.__ref,n=!!(o&&o.skipIfEffect),r=Kn(t,s.__runtimeSource);if(s.__authoredTemplates)for(const e of r)s.__authoredTemplates.add(e);else s.__authoredTemplates=r;if(Mn(t),typeof t.text=="function"){const e=t.text,f=L(t,t.textDeps,e),l=(0,j.createEffect)(()=>{if(!s.contentManaged)try{let u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&typeof u!="object"&&(typeof u=="string"&&u.includes("{{")&&(u=R.replaceLiteralsWithObjectFields.call(t,u,t.state)),Dt(t,u))}catch(u){V(s,"text",u)}},{depth:s.path.length,label:P(s,"text")});s.__effects.push(l),s.__exec.text=e}else if(typeof t.text=="string"&&t.text.includes("{{")){const e=t.text,f=(0,j.createEffect)(()=>{if(s.contentManaged)return;const l=R.replaceLiteralsWithObjectFields.call(t,e,t.state);l!=null&&(t.text=l),t.node&&Dt(t,l??"")},{depth:s.path.length,label:P(s,"text")});s.__effects.push(f),s.__exec.text=e}const c=t.tag||"div";for(const e of Object.keys(t))if(typeof t[e]=="function"&&!G.REGISTRY.has(e)&&!(0,N.isHandlerKey)(e)&&!s.__exec[e]&&!(0,Q.isAttributeFirst)(c,e)){if(C.CSS_PROPS_REGISTRY[e]){const f=t[e],l=L(t,t[e+"Deps"],f),u=e;let d,h=null,_=null,p;const y=(0,j.createEffect)(()=>{const A=t.context?.designSystem;A&&(0,M.pushConfig)(A);try{const S=l(t,t.state,t.context);(0,C.pushStaticCssPass)();let w;try{w=C.CSS_PROPS_REGISTRY[u](S,t,t.state,t.context)}finally{(0,C.popStaticCssPass)()}if(Array.isArray(w)){const g={};for(const x of w)if(x)for(const k in x)g[k]=x[k];w=g}const b=u==="show"||u==="hide";if(w&&t.node&&zn(w)){const g=gt(w);if(g===null||g!==p){p=g;const x=(0,tt.css)(w,null,t.context?.cssPrefix),k=x?x.split(" ").filter(Boolean):null;if(t.node.classList){if(_)for(const E of _)t.node.classList.remove(E);if(k&&k.length)for(const E of k)t.node.classList.add(E);_=k}}d=void 0,h=null}else if(w&&t.node){if(_){for(const x of _)t.node.classList.remove(x);_=null,p=void 0}const g=gt(w);if(g===null||g!==d||!Pt(t.node,h)){d=g;const x=ps(t,w);h=jt(t.node,x)}}else t.node&&b&&(d=void 0,h=null,t.node.style.display="")}finally{A&&(0,M.popConfig)()}},{depth:s.path.length,label:P(s,u)});s.__effects.push(y),s.__exec[e]=f}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(e)){const f=t[e],l=L(t,t[e+"Deps"],f),u=e;let d,h=null;const _=(0,j.createEffect)(()=>{const p=t.context?.designSystem;p&&(0,M.pushConfig)(p);try{const y=l(t,t.state,t.context);if(t.node)if(y!=null){const A=u+":"+String(y);if(A!==d||!Pt(t.node,h)){d=A;const S={[u]:y},w=ps(t,S);h=jt(t.node,w)}}else d=void 0,h=null,t.node.style[u]=""}finally{p&&(0,M.popConfig)()}},{depth:s.path.length,label:P(s,u)});s.__effects.push(_),s.__exec[e]=f}else if(e.charCodeAt(0)===45){const f=t[e];us(t,e,f,t[e+"Deps"],e),s.__exec[e]=f}}if(qn(t),typeof t.html=="function"){const e=t.html,f=L(t,t.htmlDeps,e),l=(0,j.createEffect)(()=>{(0,q.withDesignSystem)(t,()=>{const u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&(t.node.innerHTML=u)})},{depth:s.path.length,label:P(s,"html")});s.__effects.push(l),s.__exec.html=e}if(typeof t.value=="function"){const e=t.value,f=L(t,t.valueDeps,e),l=(0,j.createEffect)(()=>{try{let u=f(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=R.replaceLiteralsWithObjectFields.call(t,u,t.state)),is(t,u)}catch(u){V(s,"value",u)}},{depth:s.path.length,label:P(s,"value")});s.__effects.push(l),s.__exec.value=e}else if(typeof t.value=="string"&&t.value.includes("{{")){const e=t.value,f=(0,j.createEffect)(()=>{try{is(t,R.replaceLiteralsWithObjectFields.call(t,e,t.state))}catch(l){V(s,"value",l)}},{depth:s.path.length,label:P(s,"value")});s.__effects.push(f),s.__exec.value=e}if(typeof t.style=="function"){const e=t.style,f=L(t,t.styleDeps,e);let l,u=null,d,h,_,p;const y=(0,j.createEffect)(()=>{const A=f(t,t.state,t.context),S=t.context&&t.context.designSystem;let w;if(A&&typeof A=="object"&&A===d&&S===_){const g=gt(A);w=g!==null&&g===h?p:Nt(t,A),h=g}else w=Nt(t,A),h=void 0;d=A,_=S,p=w;const b=gt(w);(b===null||b!==l||!Pt(t.node,u))&&(l=b,ho(t.node,u,w),rt(t.node,w),u=jt(t.node,w))},{depth:s.path.length,label:P(s,"style")});s.__effects.push(y),s.__exec.style=e}else if(t.style&&typeof t.style=="object")for(const e in t.style){const f=t.style[e];if(typeof f!="function")continue;const l=L(t,_t(t.styleDeps,e),f);let u,d=null;const h=(0,j.createEffect)(()=>{try{const _=l(t,t.state,t.context);if(t.node){const p=e+":"+String(_);if(p!==u||!Pt(t.node,d)){u=p;const y=Nt(t,{[e]:_});ho(t.node,d,Object.assign({},y,{[e]:""})),rt(t.node,y),d=jt(t.node,y)}}}catch(_){V(s,"style."+e,_)}},{depth:s.path.length,label:P(s,"style."+e)});s.__effects.push(h)}if(t.attr&&typeof t.attr=="object"){for(const e in t.attr)if(typeof t.attr[e]=="function"){const f=L(t,_t(t.attrDeps,e),t.attr[e]),l=e,u=(0,j.createEffect)(()=>{try{let d=f(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=R.replaceLiteralsWithObjectFields.call(t,d,t.state)),t.node?.setAttribute&&Lt(t.node,l,d)}catch(d){V(s,"attr."+l,d)}},{depth:s.path.length,label:P(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[e]=="string"&&t.attr[e].includes("{{")){const f=t.attr[e],l=e,u=(0,j.createEffect)(()=>{try{const d=R.replaceLiteralsWithObjectFields.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(l,(0,v.serializeAttrValue)(l,d??""))}catch(d){V(s,"attr."+l,d)}},{depth:s.path.length,label:P(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const e in t.aria){const f=t.aria[e];if(typeof f=="string"&&f.includes("{{")){const h=f,_="aria-"+e.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),p=(0,j.createEffect)(()=>{try{const y=R.replaceLiteralsWithObjectFields.call(t,h,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(_,(0,v.serializeAttrValue)(_,y??""))}catch(y){V(s,"aria."+e,y)}},{depth:s.path.length,label:P(s,"aria."+e)});p._attrName=_,s.__effects.push(p);continue}if(typeof f!="function")continue;const l=L(t,_t(t.ariaDeps,e),t.aria[e]),u="aria-"+e.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),d=(0,j.createEffect)(()=>{try{const h=l(t,t.state,t.context);if(!t.node?.setAttribute)return;Lt(t.node,u,h)}catch(h){V(s,"aria."+e,h)}},{depth:s.path.length,label:P(s,"aria."+e)});d._attrName=u,s.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const e in t.data){const f=t.data[e];if(typeof f=="string"&&f.includes("{{")){const _=f,p="data-"+e.replace(/[A-Z]/g,A=>"-"+A.toLowerCase()),y=(0,j.createEffect)(()=>{try{const A=R.replaceLiteralsWithObjectFields.call(t,_,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(p,A??"")}catch(A){V(s,"data."+e,A)}},{depth:s.path.length,label:P(s,"data."+e)});y._attrName=p,s.__effects.push(y);continue}if(typeof f!="function")continue;const l=L(t,_t(t.dataDeps,e),t.data[e]),d="data-"+e.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),h=(0,j.createEffect)(()=>{try{const _=l(t,t.state,t.context);if(!t.node?.setAttribute)return;_==null||_===!1?t.node.removeAttribute(d):typeof _!="function"&&typeof _!="object"&&t.node.setAttribute(d,_===!0?"":_)}catch(_){V(s,"data."+e,_)}},{depth:s.path.length,label:P(s,"data."+e)});h._attrName=d,s.__effects.push(h)}const a=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(a)for(const e in a){if(typeof a[e]!="function")continue;const f=L(t,_t(t.classDeps,e),a[e]),l=(0,j.createEffect)(()=>{try{const u=f(t,t.state,t.context);if(!t.node?.classList)return;typeof u=="string"?t.node.classList.add(u):u?t.node.classList.add(e):t.node.classList.remove(e)}catch(u){V(s,"class."+e,u)}},{depth:s.path.length,label:P(s,"class."+e)});s.__effects.push(l)}!n&&typeof t.if=="function"&&es(t,s,t.if);for(const e of Object.keys(t)){if(G.REGISTRY.has(e)||typeof t[e]!="function")continue;const f=e.charCodeAt(0);if(f>=65&&f<=90||(0,N.isHandlerKey)(e))continue;const l=t[e];s.__exec[e]=l;const u=t.tag||"div";if((0,v.checkAttributeByTagName)(u,e)&&!(0,Q.isCssProp)(u,e)){const d=(0,v.camelToAttr)(e)||e,h=L(t,t[e+"Deps"],l),_=(0,j.createEffect)(()=>{try{let p=h(t,t.state,t.context);typeof p=="string"&&p.includes("{{")&&(p=R.replaceLiteralsWithObjectFields.call(t,p,t.state)),t.node?.setAttribute&&Lt(t.node,d,p,!0)}catch(p){V(s,e,p)}},{depth:s.path.length,label:P(s,e)});_._attrName=d.toLowerCase(),s.__effects.push(_)}}const i=t.tag||"div";for(const e of Object.keys(t)){if(G.REGISTRY.has(e))continue;const f=t[e];if(typeof f!="string"||!f.includes("{{"))continue;const l=e.charCodeAt(0);if(l>=65&&l<=90||(0,N.isHandlerKey)(e)||(0,Q.isCssProp)(i,e)||v.ATTR_TRANSFORMS[e]||!(0,v.checkAttributeByTagName)(i,e))continue;const u=(0,v.camelToAttr)(e)||e,d=(0,j.createEffect)(()=>{try{const h=R.replaceLiteralsWithObjectFields.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,(0,v.serializeAttrValue)(u,h??""))}catch(h){V(s,e,h)}},{depth:s.path.length,label:P(s,e)});d._attrName=u.toLowerCase(),s.__effects.push(d)}if(tr(t),ur(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const e=t.onStateUpdate,f=t.stateDeps;let l=!1,u=[];const d=(0,j.createEffect)(()=>{const h=[];for(let y=0;y<f.length;y++){const A=f[y];try{h[y]=typeof A=="function"?A(t,t.state,t.context):t.state?.[A]}catch{h[y]=void 0}}if(!l){l=!0,u=h;return}let _=h.length!==u.length;for(let y=0;!_&&y<h.length;y++)h[y]!==u[y]&&(_=!0);const p=u;u=h,_&&(0,q.withDesignSystem)(t,()=>{try{e(t,t.state,t.context,{prev:p,next:h})}catch(y){if((0,Y.reportLifecycleError)(t,"onStateUpdate",y),t.context?.strictMode)throw y}})},{depth:s.path.length,label:P(s,"onStateUpdate")});s.__effects.push(d)}rr(t)}function ns(t){const o=t.parent,s=o?.node;if(!s||!t.node){Zt(t,t.parent);return}let n=null;const r=Object.keys(o),c=r.indexOf(t.key);for(let a=c+1;a<r.length;a++){const i=o[r[a]];if(i?.node?.parentNode===s){n=i.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node),(0,Qt.flushConnected)()}function rs(t){cs(t),_r(t),ks(t),Tr(t),Er(t)}function es(t,o,s){let n=L(t,t.ifDeps,s);const r=(0,j.createEffect)(()=>{const c=!o.__ifInitialized&&o.__ifLateMerge;if(c){const e=t.context?.components||{};c.names.some(f=>e[f]||e["smbls."+f])&&(o.__ifLateMerge=null,kn(t,c),n=L(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=n(t,t.state,t.context)}catch(e){if(a=!1,o.__ifError=e,typeof console<"u"&&console.warn){const f=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${f} \u2014 treating as false:`,e?.message||e)}return}const i=o.__if;if(o.__if=!!a,i&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(e){console.error("[smbls] onRemove error:",e)}}else if(!i&&o.__if)if(o.__ifInitialized)t.node||(t.node=(0,ot.cacheNode)(t)),t.node&&(t.node.ref=t),ns(t),cs(t),ks(t),U("Render",t,{}),ro(t,{});else{o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=(0,ot.detectTag)(t)),U("Init",t,{});const e=H.FEATURES.hydration;if(t.node||(t.node=e!==null&&e.adopt(t)||(0,ot.cacheNode)(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.parent?.__ref?.__ifParked&&t.parent.__ref.__ifParked.delete(t.key),t.tag==="fragment"&&!o.__fragmentAnchor){const l=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(l),o.__fragmentAnchor=l}U("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),$s(t,{}),ss(t,{skipIfEffect:!0}),rs(t),Bs(t,{}),ns(t),U("Create",t,{}),U("Complete",t,{}),U("Render",t,{}),U("RenderRouter",t,{}),ro(t,{})}},{depth:o.path.length,label:P(o,"if")});o.__effects.push(r)}function Dt(t,o){const s=t.node;if(!s)return;const n=o==null||typeof o=="object"?"":String(o);if(t.tag==="string"){s.nodeValue!==n&&(s.nodeValue=n);return}const r=t.__ref;let c=r?r.__textNode:null;if(c&&c.parentNode!==s&&(c=null),!c){const a=s.firstChild;a&&a.nodeType===3&&(c=a)}c?c.nodeValue!==n&&(c.nodeValue=n):s.firstChild?(c=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(c,s.firstChild)):(s.textContent=n,c=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=c||null)}function Gn(t,o){return o!=="checked"||!t||t.tagName!=="INPUT"?null:t.hasAttribute("checked")}function Wn(t,o){if(o===null)return;const s=t.hasAttribute("checked");s!==o&&t.checked!==s&&(t.checked=s)}function Lt(t,o,s,n){s==null||s===!1&&!(0,v.isEnumeratedTrueFalseAttr)(o)?zt(t,o,null):typeof s=="function"||typeof s=="object"||(n&&o==="src"&&"src"in t?t.src=s:zt(t,o,(0,v.serializeAttrValue)(o,s)))}function zt(t,o,s){const n=Gn(t,o);s==null?t.removeAttribute(o):t.setAttribute(o,s),Wn(t,n)}function is(t,o){const s=t.node;if(!s||!("value"in s))return;const n=o==null?"":String(o);if(s.value===n)return;const r=typeof document<"u"&&document.activeElement===s,c=r&&typeof s.selectionStart=="number"?s.selectionStart:null,a=r&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,r&&c!=null&&a!=null)try{s.setSelectionRange(c,a)}catch{}const i=t.__ref&&t.__ref.__autoGrow;i&&i.active&&i.resize()}function cs(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Dt(t,t.text),Os(t),typeof t.html=="string"&&(o.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in o){const s=String(t.value);o.value!==s&&(o.value=s)}if(t.style&&typeof t.style=="object"){let s=t.style;for(const n in t.style)if(typeof t.style[n]=="function"){s={};for(const r in t.style)typeof t.style[r]!="function"&&(s[r]=t.style[r]);break}rt(o,Nt(t,s))}if(t.attr&&typeof t.attr=="object")for(const s in t.attr){const n=t.attr[s];typeof n=="function"||typeof n=="object"||n!=null&&(typeof n=="string"&&n.includes("{{")||n===!1&&!(0,v.isEnumeratedTrueFalseAttr)(s)||o.setAttribute&&o.setAttribute(s,(0,v.serializeAttrValue)(s,n)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&o.setAttribute&&o.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const s in t.data){const n=t.data[s];typeof n=="function"||typeof n=="object"||n==null||n===!1||typeof n=="string"&&n.includes("{{")||o.dataset&&(o.dataset[s]=n===!0?"":n)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(n=>n&&o.classList.add(n));else if(typeof s=="object")for(const n in s){const r=typeof s[n]=="function"?s[n](t,t.state,t.context):s[n];r&&o.classList.add(typeof r=="string"?r:n)}}}}function gt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function zn(t){if(!t||typeof t!="object")return!1;for(const o in t){const s=t[o];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function jt(t,o){if(!t||!t.style||!o)return null;const s=t.style,n=[];for(const r in o){if(o[r]==null||r.charAt(0)==="&")continue;const a=J(r);n.push(a,po(s,a),fs(s,a))}return n}function po(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function fs(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function J(t){return(0,B.cssPropName)(t)}function ho(t,o,s){if(!t||!t.style||!o||!o.length)return;const n=t.style,r=new Set;if(s&&typeof s=="object")for(const c in s)s[c]==null||c.charAt(0)==="&"||r.add(J(c));for(let c=0;c<o.length;c+=3){const a=o[c];r.has(a)||po(n,a)===o[c+1]&&typeof n.removeProperty=="function"&&n.removeProperty(a)}}function Pt(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let n=0;n<o.length;n+=3)if(po(s,o[n])!==o[n+1]||fs(s,o[n])!==o[n+2])return!1;return!0}const Et=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,as=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",qt=t=>Et(t)?t:"--"+t;function Yt(t,o){if(!et(t))return null;let s=null;for(const n of Object.keys(t)){if(!n)continue;let r=t[n];if(typeof r=="function"){if(!o)continue;r=r(o,o.state,o.context)}as(r)&&(s||(s={}),s[qt(n)]=r)}return s}function us(t,o,s,n,r){ds(t,r,L(t,n,s),c=>as(c)?{[o]:c}:null)}function ds(t,o,s,n,r){const c=t.__ref;let a,i=null;const e=(0,j.createEffect)(()=>{(0,q.withDesignSystem)(t,()=>{try{const f=n(s(t,t.state,t.context)),l=t.node;if(!l||!l.style)return;const u=gt(f);(u===null||u!==a||!Pt(l,i))&&(a=u,ho(l,i,f),f&&rt(l,f),i=f?jt(l,f):null,r&&r(f))}catch(f){V(c,o,f)}})},{depth:c.path.length,label:P(c,o)});c.__effects.push(e)}function qn(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){Yn(t,s),o.__exec.vars=s;return}if(et(s))for(const n of Object.keys(s)){const r=s[n];!n||typeof r!="function"||us(t,qt(n),r,_t(t.varsDeps,n),"vars."+n)}}function Yn(t,o){const s=t.__ref;ds(t,"vars",L(t,t.varsDeps,o),n=>Yt(n),n=>{s.__varsInline=n?new Set(Object.keys(n)):null})}function yo(t,o){if(typeof t[o]=="function"&&((0,Q.isCssProp)(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!Et(o))return!1;const s=t.vars;if(typeof s=="function"){const n=t.__ref&&t.__ref.__varsInline;return!!(n&&n.has(o))}if(!et(s))return!1;for(const n of Object.keys(s))if(typeof s[n]=="function"&&qt(n)===o)return!0;return!1}function Zn(t){let o=null;for(const s in t)t[s]!=null&&s.charAt(0)!=="&"&&(o||(o=new Set),o.add(J(s)));return o}function Qn(t,o,s,n){const r=t.__ref;if(!r)return;let c=null;if(s)for(const a of s){if(n&&n.has(a))continue;const i=o[a];if(i==null||typeof i=="object")continue;const e=J(a);B.CSS_LONGHAND_SHORTHANDS[e]&&(c||(c={}),c[e]=i)}r.__declaredLonghands=c}function ls(t,o){const s=t.__ref,n=s&&s.__declaredLonghands;if(!n||!o)return null;let r=null;for(const c in n){if(o.has(c))continue;const a=B.CSS_LONGHAND_SHORTHANDS[c];let i=!1;for(let e=0;e<a.length;e++)if(o.has(a[e])){i=!0;break}i&&(r||(r={}),r[c]=n[c])}return r}function ps(t,o){const s=t.node;rt(s,o);const n=Zn(o);if(!n)return o;const r=t.__ref;if(r)if(r.__inlineCssKeys)for(const a of n)r.__inlineCssKeys.add(a);else r.__inlineCssKeys=new Set(n);const c=ls(t,n);return c?(rt(s,c),Object.assign({},o,c)):o}function Xn(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=ls(t,o.__inlineCssKeys);s&&rt(t.node,s)}function Nt(t,o){return!o||typeof o!="object"?o:(0,q.withDesignSystem)(t,()=>{try{return(0,C.resolveStyleBlockTokens)(o,t)}catch{return o}})}function rt(t,o){if(!t||!o||!t.style)return;let s=null;for(const n in o){const r=o[n];if(r!=null){if(n.charAt(0)==="&"&&typeof r=="object"){s||(s={}),s[n]=r;continue}try{const c=String(r);if(typeof r=="object"&&c==="[object Object]")continue;const a=(0,B.cssPropName)(n),i=c.trim(),e=/\s*!important\s*$/.test(i),f=i.replace(/\s*!important\s*$/,"");t.style.setProperty(a,f,e?"important":"")}catch{}}}s&&Jn(t,s)}function Jn(t,o){const s=`_ds${No.scopedStyleId++}`;t.classList.add(s);const n=t.ownerDocument;let r=n.querySelector("style[data-smbls-scoped]");r||(r=n.createElement("style"),r.setAttribute("data-smbls-scoped",""),n.head.appendChild(r));let c="";for(const a in o){const i="."+s,e=a.replace(/&/g,i).split(",").map(l=>{const u=l.trim();return u.includes(i)?u:i+u}).join(", "),f=o[a];if(typeof f=="object"){let l="",u="";for(const d in f){const h=f[d];if(typeof h=="object"){const _=d.includes("&")?e.split(", ").map(y=>d.replace(/&/g,y)).join(", "):e.split(", ").map(y=>`${y} ${d}`).join(", ");let p="";for(const y in h)p+=`${J(y)}: ${h[y]};`;u+=(0,tt.wrapHoverRule)(`${_} { ${p} }`,_)+`
|
|
5
|
+
`}else l+=`${J(d)}: ${h};`}l&&(c+=(0,tt.wrapHoverRule)(`${e} { ${l} }`,e)+`
|
|
6
|
+
`),u&&(c+=u)}}c&&(r.textContent+=c)}const hs=new Set;function ys(t){if(!Array.isArray(t))return"";const o=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&o.push(t[s]);return o.sort(),o.join("|")}function mn(t,o,s){const n=ys(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=o(t,t.state,t.context)}catch{return}if(ys(r)===n)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";hs.has(c)||(hs.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(r)?r.join(", "):String(r)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element core.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function tr(t){const o=t.subscribeTo,s=typeof o=="function";let n=o;if(s)try{n=o(t,t.state,t.context)}catch{n=null}if(s&&(0,it.isLoudDevRuntime)()&&mn(t,o,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const r=t.__ref;for(let c=0;c<n.length;c++){const a=n[c];if(typeof a!="string"||a.length===0)continue;const i=a.split("."),e=i[0],f=i.slice(1),l={value:!1},u=(0,j.createEffect)(()=>{const d=t.state&&((0,K.isStore)(t.state)?t.state.root:null);if(!d||!(0,K.isStore)(d))return;let h=d;h=h[e];for(let p=0;p<f.length&&!(h==null||typeof h!="object");p++)if((0,K.isStore)(h))h=h[f[p]];else break;if(!l.value)return;let _=!1;if(typeof t.onBeforeUpdate=="function"&&(0,q.withDesignSystem)(t,()=>{try{if(ms(r)){const p=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});p&&typeof p.then=="function"?p.then(()=>Ft(r,!1),y=>{Ft(r,!0),(0,Y.dispatchPluginHook)("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}):(Ft(r,!1),p===!1&&(_=!0))}}catch(p){Ft(r,!0),(0,Y.dispatchPluginHook)("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}}),!_&&t.node&&r.__effects)for(let p=0;p<r.__effects.length;p++){const y=r.__effects[p];y&&y!==u&&!y._disposed&&!y._isSubscribeToEffect&&typeof y._execute=="function"&&y._execute()}!_&&typeof t.onUpdate=="function"&&(0,q.withDesignSystem)(t,()=>{try{t.onUpdate(t,t.state,t.context)}catch(p){(0,Y.dispatchPluginHook)("error",t,{hook:"onUpdate",error:p})||console.error("[DOMQL] subscribeTo onUpdate error:",p)}})},{depth:r.path.length,label:P(r,"subscribeTo("+a+")")});l.value=!0,u._isSubscribeToEffect=!0,r.__effects.push(u)}}function _o(t,o){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!o.context?.designSystem?.media?.[t.slice(1)])}function go(t,o){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=o.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const _s=new Set;function or(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",n=s+"::"+t;_s.has(n)||(_s.add(n),console.warn(`[smbls/css] "${t}" at ${s} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}const gs=new Map;function sr(t){let o=gs.get(t);if(o)return o;o=[];const s=n=>{if(n)for(const r of n)o.push((0,B.cssCamelName)(r))};return s(B.CSS_LONGHAND_SHORTHANDS[t]),s(B.CSS_SHORTHAND_LONGHANDS[t]),gs.set(t,o),o}function bs(t,o,s){if(yo(t,o)||s&&s.has(o))return!0;const n=sr(J(o));for(let r=0;r<n.length;r++){const c=n[r];if(yo(t,c)||s&&s.has(c))return!0}return!1}function bt(t,o,s,n){const r={},c=new Set,a=(i,e,f)=>{const l=f?new Set(Object.keys(r)):null;if(C.CSS_PROPS_REGISTRY[i]){const u=C.CSS_PROPS_REGISTRY[i](e,o,o.state,o.context);if(u){const d=Array.isArray(u)?u:[u];for(const h of d)h&&Object.assign(r,h)}}else r[i]=e;if(f)for(const u in r)l.has(u)||c.add(u)};for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let e=t[i];if(typeof e=="function"&&(e=e(o,o.state,o.context)),!(e==null||typeof e=="function")){if(typeof e=="object"&&!Array.isArray(e)){if(i==="style"){for(const u in e){let d=e[u];typeof d=="function"&&(d=d(o,o.state,o.context)),!(d==null||typeof d=="function")&&a(u,d,bs(o,u,n))}continue}if(i==="vars"){const u=Yt(e,o);if(u)for(const d in u)a(d,u[d],yo(o,d)||!!(n&&n.has(d)));continue}if(_o(i,o)){const u=bt(e,o,!1,n);Object.keys(u).length&&(r[`[data-theme="${i.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){(0,it.isLoudDevRuntime)()&&or(i,o);continue}const f=go(i,o),l=bt(e,o,!1,n);Object.keys(l).length&&(r[f]=l);continue}a(i,e,bs(o,i,n))}}if(s)for(const i in r)c.add(i);for(const i of c){const e=r[i];typeof e=="string"&&!e.includes("!important")&&(r[i]=e+" !important")}return r}const et=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function As(t,o){for(const s in o){const n=o[s];t[s]=et(n)?As(et(t[s])?t[s]:{},n):n}return t}function nr(t,o){if(!et(o))return;let s;for(const n of t.split(" ")){const r=n?o[n]:null;et(r)&&(s=As(s||{},r))}return s}function bo(t,o){if(o===void 0&&(o=0),o>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&bo(t[s],o+1))return!0}return!1}function xs(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(_o(t,s)){const c=bt(o,s,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const n=go(t,s),r=bt(o,s,!1);return Object.keys(r).length?{cssProp:n,block:r}:null}function rr(t){const o=t.__ref;for(const s of Object.keys(t)){if(!Uo(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!bo(n))continue;let r=null,c;const a=(0,j.createEffect)(()=>{if(!t.node)return;const i=t.context?.designSystem;i&&(0,M.pushConfig)(i);let e,f=!1;try{const l=xs(s,n,t),u=l?gt(l.block)+"::"+l.cssProp:null;if(u!==null&&u===c)f=!0;else if(c=u,l){const d=(0,tt.css)({[l.cssProp]:l.block},null,t.context?.cssPrefix);e=d?d.split(" ").filter(Boolean):null}else e=null}finally{i&&(0,M.popConfig)()}if(!(f||!t.node.classList)){if(r)for(const l of r)t.node.classList.remove(l);if(e&&e.length)for(const l of e)t.node.classList.add(l);r=e}},{depth:o.path.length,label:P(o,"cssBlock("+s+")")});o.__effects.push(a)}}const er=()=>!0,ir=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!C.CSS_PROPS_REGISTRY[t]||!!(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(t))||Et(t)||t==="vars"};function cr(t,o,s){const n={};let r=!1;for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(i!=="data"&&i!=="aria"&&(ir(i,s[i])||G.REGISTRY.has(i))?n[i]=!0:r=!0);if(!r)return null;const c=(0,v.extractConditionalAttrs)({[o]:s},t.tag||"div",n,er);let a=null;for(const i in c)/^on/i.test(i)||(a||(a={}),a[i]=c[i]);return a}function ws(t,o,s,n,r,c){const a=t.node;let i=null;const e=f=>{(i||(i=[])).push(f)};for(const f in n){const l=o.owners.get(f),u=l===s;if(!c&&l!==void 0&&!u)continue;let d;try{d=n[f](t)}catch(_){V(t.__ref,"conditional("+s+")."+f,_),u&&e(f);continue}if(typeof d=="string"&&d.includes("{{")&&(d=R.replaceLiteralsWithObjectFields.call(t,d,t.state)),u&&a.getAttribute(f)!==o.written.get(f)){e(f);continue}if(d==null||typeof d=="object"||typeof d=="function"){u&&Ss(a,o,f);continue}const h=d===!1&&!(0,v.isEnumeratedTrueFalseAttr)(f)?null:String((0,v.serializeAttrValue)(f,d));e(f),!(u&&h===o.written.get(f))&&(l===void 0&&o.base.set(f,a.getAttribute(f)),zt(a,f,h),o.owners.set(f,s),o.written.set(f,h))}r.appliedAttrs=i}function Ss(t,o,s){t.getAttribute(s)===o.written.get(s)&&zt(t,s,o.base.get(s)),o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function fr(t,o,s,n){const r=n.appliedAttrs;if(n.appliedAttrs=null,!!r)for(const c of r)o.owners.get(c)===s&&Ss(t.node,o,c)}function ks(t){const o=t.__ref&&t.__ref.__conditionalAttrs,s=t.node;if(!(!o||!o.owners.size||!s||!s.getAttribute))for(const n of o.owners.keys()){const r=o.written.get(n),c=s.getAttribute(n);c!==r&&(o.base.set(n,c),r==null?s.removeAttribute(n):s.setAttribute(n,r))}}let Ao;const ar=()=>Ao===void 0?Ao=(0,it.isLoudDevRuntime)():Ao;function Cs(t,o){const s=dn.countUntrackedReads;typeof s=="function"?t.untrackedReads+=s(o):o()}function ur(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const n=new Map;for(const r of Object.keys(t)){const c=r.charAt(0);if(c!=="."&&c!=="!")continue;const a=r.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const y=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${c}\` is read as one prop name. Nest the selector inside instead: \`${c}${y}: { '${a.slice(y.length)}': {...} }\`.`)}continue}const i=t[r];if(!i||typeof i!="object")continue;const e=c==="!",f={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null,probe:!1,untrackedReads:0},l=cr(t,r,i);l&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const y in i){if(!Object.prototype.hasOwnProperty.call(i,y))continue;const A=y.charAt(0),S=i[y];if(!((A===":"||A==="@"||A==="&"||A==="[")&&S&&typeof S=="object"&&!Array.isArray(S))){if(y==="vars"&&et(S)){for(const w of Object.keys(S))w&&u.add(qt(w));continue}u.add(y)}}const d=()=>{let y;const A=f.probe;let S;if(A?Cs(f,()=>{S=t[a]}):S=t[a],S===void 0){const g=!!t.state&&a in t.state,x=t.state?t.state[a]:void 0;if(g||x!==void 0)y=x;else{const k=t.context?.cases?.[a];if(k===void 0)return;try{y=typeof k=="function"?k.call(t,t):k}catch(E){y=!1,o.__conditionalError=E,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,E?.message||E)}}}else if(typeof S=="function")try{A?Cs(f,()=>{y=S(t,t.state,t.context)}):y=S(t,t.state,t.context)}catch(g){y=!1,o.__conditionalError=g,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,g?.message||g)}else y=S;A&&(f.probe=!1);const w=e?!y:!!y;if(!t.node)return;const b=t.context?.designSystem;if(w===f.lastMatch){if(w&&l&&t.node.setAttribute){b&&(0,M.pushConfig)(b);try{ws(t,s,r,l,f,!1)}finally{b&&(0,M.popConfig)()}}return}f.lastMatch=w,b&&(0,M.pushConfig)(b);try{if(w){const g={},x={};let k=!1;for(const O in i){if(!Object.prototype.hasOwnProperty.call(i,O))continue;const T=i[O],F=O.charAt(0);if((F===":"||F==="@"||F==="&"||F==="[")&&T&&typeof T=="object"&&!Array.isArray(T)){if(_o(O,t)){const z=bt(T,t,!1,u);Object.keys(z).length&&(x[`[data-theme="${O.slice(1)}"] &`]=z,k=!0)}else{const z=go(O,t),lt=bt(T,t,!1,u);Object.keys(lt).length&&(x[z]=lt,k=!0)}continue}const st=typeof T=="function"?T(t,t.state,t.context):T;if(st!=null){if(C.CSS_PROPS_REGISTRY[O]){const z=C.CSS_PROPS_REGISTRY[O](st,t,t.state,t.context);if(z){const lt=Array.isArray(z)?z:[z];for(const It of lt)It&&Object.assign(g,It)}}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(O))g[O]=st;else if(Et(O))g[O]=st;else if(O==="vars"){const z=Yt(st,t);z&&Object.assign(g,z)}}}const E=Object.keys(g);if(E.length){rt(t.node,g);for(const O of E)n.set(O,r);f.appliedKeys=E}else f.appliedKeys=null;if(k){const O=(0,tt.css)(x,null,t.context?.cssPrefix,{state:!0}),T=O?O.split(" ").filter(Boolean):[];if(T.length&&t.node.classList){for(const F of T)t.node.classList.add(F);f.appliedClasses=T}else f.appliedClasses=null}else if(f.appliedClasses){for(const O of f.appliedClasses)t.node.classList.remove(O);f.appliedClasses=null}l&&t.node.setAttribute&&ws(t,s,r,l,f,!0)}else{if(f.appliedAttrs&&fr(t,s,r,f),f.appliedKeys){for(const g of f.appliedKeys)n.get(g)===r&&(Et(g)?t.node.style.removeProperty(g):t.node.style[g]="",n.delete(g));f.appliedKeys=null}if(f.appliedClasses){for(const g of f.appliedClasses)t.node.classList.remove(g);f.appliedClasses=null}}}finally{b&&(0,M.popConfig)()}};o.__conditionalRunners.push(d);const h=t[a+"Deps"],_=L(t,h,d);ar()&&typeof(o.__exec&&o.__exec[a]||t[a])=="function"&&!(Array.isArray(h)&&h.length===0)&&(f.probe=!0);const p=(0,j.createEffect)(_,{depth:o.path.length,label:P(o,"conditional("+r+")")});f.probe&&(f.probe=!1),f.untrackedReads>0&&p._sources.size===0&&console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate read state on its first run without subscribing to it (\`in\`, Object.keys, a \`__\` key, parse()), so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). Declare \`${a}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally, or \`${a}Deps: []\` when it is static on purpose.`),o.__effects.push(p)}}const xo=new WeakSet,wo=new WeakMap;function dr(t){const o=wo.get(t);if(o==="painted")return!1;if(o===void 0){wo.set(t,"open");const s=t.defaultView,n=()=>{wo.set(t,"painted")};s&&typeof s.requestAnimationFrame=="function"?s.requestAnimationFrame(n):setTimeout(n,0)}return!0}function lr(t){const o=t.ownerDocument;!o||xo.has(o)||dr(o)||(xo.add(o),queueMicrotask(()=>{xo.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const So=new WeakSet;let vs=!1;function js(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function ko(t,o){const s={...t};for(const n in o){const r=o[n],c=s[n];s[n]=r&&typeof r=="object"&&c&&typeof c=="object"?ko(c,r):r}return s}function Ps(t,o){const s={};for(const n in t){const r=t[n];if(r&&typeof r=="object"){const c=Ps(r,o);Object.keys(c).length&&(s[n]=c)}else o(n)||(s[n]=r)}return s}function Es(t,o,s){const n=Co(t);if(!n)return!1;for(let r=0;r<n.length;r+=3){const c=n[r+1];if(!s.has(c))continue;const a=o[c];if(!(a==null||typeof a=="object")&&(0,B.cssShorthandStatesThemeLonghand)(n[r],a,n[r+2]))return!0}return!1}function pr(t,o,s){let n=1/0,r=-1/0;for(const a of o.values())a<n&&(n=a),a>r&&(r=a);if(s)for(const a of s.values())a>r&&(r=a);if(r<=n)return null;let c=null;for(const[a,i]of o){if(i===r)continue;const e=Co(a);if(e)for(let f=0;f<e.length;f+=3){const l=e[f],u=e[f+1],d=e[f+2],h=t[u]!=null?o.get(u):void 0,_=s&&s.get(l),p=h!==void 0&&h>i&&(0,B.cssShorthandStatesLonghand)(l,t[u],d),y=!p&&_!==void 0&&_>i&&(0,B.cssShorthandStatesLonghand)(l,void 0,d);if(p||y){p&&delete t[a],c||(c=new Set),c.add(a);break}}}return c}const Ts=new Map;function Co(t){let o=Ts.get(t);if(o!==void 0)return o;const s=J(t),n=B.CSS_LONGHAND_SHORTHANDS[s];if(o=null,Array.isArray(n)){o=[];for(const r of n)o.push(r,(0,B.cssCamelName)(r),s)}return Ts.set(t,o),o}function Os(t){const{node:o}=t;if(!o)return;if(vs||(vs=!0,(0,tt.css)({display:"none"})),So.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}So.add(t);const s=t.context?.designSystem;s&&(0,M.pushConfig)(s),(0,C.pushStaticCssPass)();try{const n={};let r=!1,c=[],a=null,i=null,e=null,f=null;const l=t.__ref&&t.__ref.__mergeLayer;let u,d=null,h=null;const _=(b,g)=>{if(g&&typeof g=="object"&&js(b)){e||(e={});const x=e[b];x&&(g=ko(x,g)),e[b]=g}else(g===null||typeof g!="object")&&(f||(f=new Set),f.add(b),u!==void 0&&(d||(d=new Map),d.set(b,u)));n[b]=g};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&C.CSS_PROPS_REGISTRY.theme){const b=C.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(b){const g=x=>{for(const k in x){const E=x[k];E&&typeof E=="object"?js(k)&&(a||(a={}),a[k]=E):Co(k)&&(i||(i=[])).push(k),n[k]=E}};if(Array.isArray(b))for(const x of b)x&&g(x);else g(b);r=!0}}const p=(b,g)=>{if(b==="vars"){const x=Yt(g);if(x){for(const k in x)_(k,x[k]);r=!0}return}if(C.CSS_PROPS_REGISTRY[b]){const x=C.CSS_PROPS_REGISTRY[b](g,t,t.state,t.context);if(x){if(Array.isArray(x)){for(const k of x)if(k)for(const E in k)_(E,k[E])}else for(const k in x)_(k,x[k]);r=!0}}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(b))g!=null&&typeof g!="object"&&(_(b,g),r=!0);else if(b.charCodeAt(0)===45)g!=null&&typeof g!="object"&&(_(b,g),r=!0);else if((b.charAt(0)==="&"||b.charAt(0)==="@"||b.charAt(0)===":"||b.charAt(0)==="[")&&g&&typeof g=="object"&&!Array.isArray(g)){if(bo(g))return;const x=xs(b,g,t);x&&(_(x.cssProp,x.block),r=!0)}};if(typeof t.class=="string"){const b=nr(t.class,t.context?.designSystem?.class);if(b)for(const g in b)p(g,b[g])}const y=f?new Set(f):null,A=t.tag||"div";for(const b of Object.keys(t)){if(typeof t[b]=="function"){const x=l&&l.get(b);x!==void 0&&(0,Q.isCssProp)(A,b)&&(h||(h=new Map),h.set(J(b),x));continue}if(u=l?l.get(b):void 0,b==="vars"){p(b,t[b]);continue}if(G.REGISTRY.has(b)||b==="theme")continue;const g=b.charCodeAt(0);g>=65&&g<=90||(0,N.isHandlerKey)(b)||(0,Q.isAttributeFirst)(A,b)||p(b,t[b])}u=void 0;const S=d?pr(n,d,h):null;if(i&&f)for(const b of i)f.has(b)||!(b in n)||Es(b,n,f)&&delete n[b];if(a){const b=f?g=>f.has(g)||Es(g,n,f):null;for(const g in a){let x=b?Ps(a[g],b):a[g];e&&e[g]&&(x=ko(x,e[g])),Object.keys(x).length?n[g]=x:delete n[g]}}if(Qn(t,n,f,S?new Set([...y||[],...S]):y),r){n.display&&String(n.display).includes("!important")&&(o.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const b=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof b=="string"&&b!==""&&n.display&&n.display!==b&&(n.display=b);const g=(0,tt.css)(n,null,t.context?.cssPrefix);if(c=g?g.split(" ").filter(Boolean):[],g&&o.classList){const x=c;let k=!1;for(const E of x)o.classList.add(E),k||(E.charCodeAt(0)===95&&E.charCodeAt(1)===99||E.charCodeAt(0)===95&&E.indexOf("_c",1)!==-1)&&(k=!0);k&&lr(o)}}const w=t.__ref;if(w){const b=w.__staticCssClasses;if(b&&o.classList){const g=new Set(c);for(const x of b)g.has(x)||o.classList.remove(x)}w.__staticCssClasses=c}Xn(t)}finally{(0,C.popStaticCssPass)(),s&&(0,M.popConfig)(),So.delete(t)}}const hr=t=>!!C.CSS_PROPS_REGISTRY[t]||!!(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function yr(t){t&&t.node&&Os(t)}function _r(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const c=t.aria[r];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const a="aria-"+r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase());o.setAttribute(a,(0,v.serializeAttrValue)(a,c))}const s=(0,v.applyAttrTransforms)(t);for(const r in s){const c=s[r];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&o.setAttribute(r,c===!0?"":c)}const n=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||G.REGISTRY.has(r)||r==="on"||s[r]!==void 0)continue;const c=r.charCodeAt(0);if(!(c>=65&&c<=90)&&!(0,N.isHandlerKey)(r)&&!(0,Q.isCssProp)(n,r)&&(0,v.checkAttributeByTagName)(n,r)){let a=t[r];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!v.ATTR_TRANSFORMS[r])continue;a=R.replaceLiteralsWithObjectFields.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!(0,v.isEnumeratedTrueFalseAttr)((0,v.camelToAttr)(r)||r))continue;const i=(0,v.camelToAttr)(r)||r;o.setAttribute(i,(0,v.serializeAttrValue)(i,a))}}}function gr(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const n=o.charCodeAt(0);if(n>=65&&n<=90||(0,N.isHandlerKey)(o))return;const r=t.tag||"div";if((0,Q.isCssProp)(r,o)||!(0,v.checkAttributeByTagName)(r,o))return;const c=(0,v.camelToAttr)(o)||o,a=c.toLowerCase(),i=t.__ref&&t.__ref.__effects;let e=!1;if(i)for(let u=0;u<i.length;u++){const d=i[u];d&&d._attrName===a&&!d._disposed&&typeof d._execute=="function"&&(e=!0,d._execute())}if(e)return;let f=t[o];const l=v.ATTR_TRANSFORMS[o];if(l&&f!=null){const u=l(t);u!==void 0&&(f=u)}typeof f=="string"&&f.includes("{{")&&(f=R.replaceLiteralsWithObjectFields.call(t,f,t.state)),Lt(s,c,f)}function br(t,o){const s=t.node,n=t.__ref;let r=n.__autoGrow;if(!o){if(r&&r.active){try{s.removeEventListener("input",r.resize)}catch{}Ds(r),nt.delete(t),s.style.height="",r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""),Ms(s,r,!1),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,lastWidth:null,watch:null,awaitingLayout:!1,appliedScroll:!1,fontsHooked:!1,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!s.isConnected){Tt(t,!0);return}if(!(s.scrollHeight>0)){r.awaitingLayout=!0,Rs(t,r);return}r.awaitingLayout=!1;const a=wr(s),i=Sr(a),e=s.style.height;s.style.height="0px",i&&jo(s);const f=s.scrollHeight;if(!(f>0)){s.style.height=e,i&&jo(s);return}const l=kr(s,a),u=l!=null&&f<l?l:f,d=jr(a),h=d!=null&&u>d;s.style.height=vr(h?d:u,a)+"px",i&&jo(s),Ms(s,r,h),r.lastMeasure=f,r.lastWidth=s.clientWidth,Rs(t,r)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",r.resize)}catch{}Ds(r),nt.delete(t)})),r.active||(s.addEventListener("input",r.resize),r.active=!0,xr(t,r));const c=typeof o=="object"&&o.max!=null?String(o.max):null;c!==r.appliedMax&&(c==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=c,r.appliedMax=c),r.resize()}function Tt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),nt.add(t),St())}function Ar(){const t=Array.from(nt);nt.clear();for(let o=0;o<t.length;o++){const s=t[o],n=s.node,r=s.__ref?.__autoGrow;if(!(!n||!r||!r.active)){if(!n.isConnected){r.firstAttemptAt==null&&(r.firstAttemptAt=yt()),r.attachAttempts+=1,r.attachAttempts<=Io&&yt()-r.firstAttemptAt<$o&&(nt.add(s),St());continue}r.attachAttempts=0,r.firstAttemptAt=null,r.resize()}}}function Rs(t,o){if(o.watch)return;const s=t.node;if(!s)return;const n=s.ownerDocument&&s.ownerDocument.defaultView,r=n&&n.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof r!="function")return;const c=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Tt(t,!0);return}const i=s.clientWidth;o.lastWidth!=null&&Math.abs(i-o.lastWidth)<.5||(o.lastWidth=i,Tt(t,!0))};let a;try{a=new r(c),a.observe(s)}catch{return}o.watch=a}function Ds(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function xr(t,o){if(o.fontsHooked)return;o.fontsHooked=!0;const s=t.node&&t.node.ownerDocument,n=s&&s.fonts&&s.fonts.ready;!n||typeof n.then!="function"||n.then(()=>{o.active&&t.node&&Tt(t,!0)},()=>{})}function wr(t){const o=t.ownerDocument&&t.ownerDocument.defaultView;try{return o&&o.getComputedStyle?o.getComputedStyle(t):null}catch{return null}}const ft=t=>typeof t=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(t)?parseFloat(t):null,vo=t=>(ft(t.paddingTop)||0)+(ft(t.paddingBottom)||0),Ls=t=>(ft(t.borderTopWidth)||0)+(ft(t.borderBottomWidth)||0);function Sr(t){if(!t)return!1;const o=String(t.transitionProperty||"").split(","),s=String(t.transitionDuration||"0s").split(",");for(let n=0;n<o.length;n++){const r=o[n].trim();if(!(r!=="all"&&r!=="height")&&parseFloat(s[n%s.length])>0)return!0}return!1}function jo(t){if(typeof t.getAnimations!="function")return;let o;try{o=t.getAnimations()}catch{return}for(let s=0;s<o.length;s++){const n=o[s];if(n&&n.transitionProperty==="height")try{n.cancel()}catch{}}}function kr(t,o){if(!o||!t.hasAttribute||!t.hasAttribute("rows"))return null;const s=parseInt(t.getAttribute("rows"),10);if(!(s>0))return null;const n=ft(o.lineHeight)||Cr(t,o);return n>0?s*n+vo(o):null}const Ot=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],Ns=new WeakMap;function Cr(t,o){const s=t.ownerDocument,n=s&&(s.body||s.documentElement);if(!n||!s.createElement)return null;let r=Ns.get(s);r||(r=new Map,Ns.set(s,r));const c=Ot.map(f=>o[f]||"").join("|");if(r.has(c))return r.get(c);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const i=a.style;i.position="absolute",i.visibility="hidden",i.top="0",i.left="-9999px",i.height="auto",i.minHeight="0",i.maxHeight="none",i.padding="0",i.border="0",i.boxSizing="content-box",i.overflow="hidden";for(let f=0;f<Ot.length;f++)o[Ot[f]]&&(i[Ot[f]]=o[Ot[f]]);let e=0;try{n.appendChild(a),e=a.clientHeight}catch{e=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return e>0?(r.set(c,e),e):null}function vr(t,o){return o?o.boxSizing==="border-box"?t+Ls(o):o.boxSizing==="content-box"?Math.max(0,t-vo(o)):t:t}function jr(t){if(!t)return null;const o=ft(t.maxHeight);if(o==null||!(o>0))return null;const s=vo(t),n=Ls(t),r=t.boxSizing==="border-box"?o-n:o+s,c=ft(t.lineHeight);if(!(c>0))return r;const a=Math.floor((r-s)/c+1e-6);return a>=1?a*c+s:r}function Ms(t,o,s){s?o.appliedScroll||(t.style.overflowY="auto",o.appliedScroll=!0):o.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),o.appliedScroll=!1)}const Fs=["srcObject","muted"],Pr=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function Er(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let n=0;n<Fs.length;n++){const r=Fs[n],c=t[r];if(c===void 0||!(r in o))continue;const a=i=>{const e=Pr(r,i);if(o[r]!==e)try{o[r]=e}catch(f){V(s,r,f)}};if(typeof c=="function"){const i=L(t,t[r+"Deps"],c),e=(0,j.createEffect)(()=>{try{a(i(t,t.state,t.context))}catch(f){V(s,r,f)}},{depth:s.path.length,label:P(s,r)});s.__effects.push(e),s.__exec[r]=c}else a(c);r==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function Tr(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const s=t.__ref,n=t.autoGrow,r=typeof n=="function"?L(t,t.autoGrowDeps,n):null,c=(0,j.createEffect)(()=>{const a=t.autoGrow;let i=a;if(typeof a=="function")try{i=(a===n&&r?r:a)(t,t.state,t.context)}catch{i=null}br(t,i)},{depth:s.path.length,label:P(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(c),r&&(s.__exec.autoGrow=n)}const Is=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function $s(t,o){let s=!1;for(const n of Object.keys(t)){if(!(0,N.isHandlerKey)(n)||Is.has(n))continue;if(n==="onInView"||n==="onLeaveView"){s=!0;continue}const r=(0,N.globalEventKeyInfo)(n);if(r){(0,N.registerGlobalEvent)(r,t,t[n]);continue}let c=t[n],a=null;if(c&&typeof c=="object"&&!Array.isArray(c)&&(a=c,c=a.handler),c=(0,N.stringHandler)(t,c),typeof c!="function")continue;const i=(0,N.eventNameFrom)(n);G.LIFECYCLE_EVENTS.has(i)||(0,N.registerEvent)(gn(i),t,c,a)}Or(t),s&&H.FEATURES.viewEvents&&H.FEATURES.viewEvents(t)}function Or(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let n=!1;for(const d of Is){const h=t[d];typeof h=="function"&&(s[d]=h,n=!0)}if(!n)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,i=0,e=0,f=!1;const l=d=>{const h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(a=h.clientX,i=h.clientY,e=Date.now(),f=!0)},u=d=>{if(!f)return;f=!1;const h=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!h)return;const _=h.clientX-a,p=h.clientY-i,y=Date.now()-e;if(y>c)return;const A=Math.abs(_),S=Math.abs(p);if(Math.max(A,S)<r)return;let w;if(A>S*1.2)w=_<0?"left":"right";else if(S>A*1.2)w=p<0?"up":"down";else return;const b="onSwipe"+w.charAt(0).toUpperCase()+w.slice(1),g=s[b],x=s.onSwipe;g&&g.call(t,d,t,t.state,t.context),x&&x.call(t,{direction:w,dx:_,dy:p,dt:y,event:d},t,t.state,t.context)};o.addEventListener("touchstart",l,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",l)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function Qs(t,o,s,n,r,c,a,i){let e=o;(typeof e=="string"||typeof e=="number")&&(e={text:e});let f=n;if(typeof n=="function")try{f=n(t,e)}catch{f=null}let l=typeof n=="function"?Ct(f):r;if(i&&!a&&(l=vt(l,Ct(o))),a){let u=o;(typeof o=="string"||typeof o=="number")&&(u={value:o,text:o}),e=f?{...f,state:u}:{state:u}}else f&&(e=(0,W.deepMergeChild)(f,e));return e=Rt(e,c),{def:e,key:Ho(e?.key,o,s,t),supplied:l,props:f}}function Rt(t,o){if(!o||!t||t.ignoreChildExtends)return t;if(!t.extends)return{...t,extends:o};const s=Array.isArray(t.extends)?t.extends:[t.extends],n=Array.isArray(o)?o:[o];return{...t,extends:[...n,...s]}}const Jt=t=>{const o=t&&t.__ref;if(!o||o.__if===!1)return null;const s=t.node;return s&&s.nodeType!==11?s:null},Us=(t,o)=>o?o.nextSibling:(0,ot.firstSlotAfterText)(t.node,t.__ref.__textNode),To=(t,o,s)=>{const n=Us(t,s);return o!==n&&t.node.insertBefore(o,n),o},Xs=(t,o)=>{const s=Us(t,o);return s?{position:"before",node:s}:void 0};function Js(t,o,s){let n=null;for(let r=0;r<o.length;r++){if(s&&s.has(o[r]))continue;const c=Jt(t[o[r]]);c&&(n=To(t,c,n))}}function Hs(t,o,s,n){const r=H.FEATURES.rows,c=r!==null&&t.childrenAs!=="state"&&t.tag!=="fragment"?r.track(t):null,a=Po(t,o,s,n,!0,c);return t.__ref.__plainRows=c&&(a||o==null||o===!1)?c:null,a}function Po(t,o,s,n,r,c){if(!o||!t.node)return;const a=t.childExtends,i=ut(t,"childProps"),e=t.__ref,f=H.FEATURES.mount,l=n>0&&t.tag!=="fragment"&&e?n:0;if(Array.isArray(o)){const u=t.childProps,d=t.childrenAs==="state",h=(_,p)=>{const y=Qs(t,o[_],_,u,i,a,d,r);c&&c.add(y.key,o[_],y,u,a);try{const A=m(At(y.def,y.supplied),t,y.key,s,p);return!A&&c&&c.none(y.key),Wt(t,A),A}catch(A){if(c&&c.failed(y.key),typeof console<"u"&&console.error){const S=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${y.key}" failed to construct at ${S} (initial render, skipping this row):`,A?.message||A)}return null}};if(!l){for(let _=0;_<o.length&&!(e&&e.__disposed);_++)h(_);return!0}return f.rows(t,o.length,h,l),!0}if(typeof o=="string"){const u=Wo(o,t);if(Array.isArray(u))return Po(t,u,s,n,!0,c)}if(typeof o=="object"){const u=(h,_)=>{if(G.REGISTRY.has(h))return!1;let p=o[h];if(p==null||p===!1)return!1;const y=r?vt(i,Ct(p)):i;(typeof p=="string"||typeof p=="number")&&(p={text:p}),t.childProps&&(p=(0,W.deepMergeChild)(t.childProps,p)),p=Rt(p,a);const A=m(At(p,y),t,Gt(t,h),s,_);return Wt(t,A),A};if(!l){for(const h in o)u(h);return}const d=[];for(const h in o)d.push(h);f.rows(t,d.length,(h,_)=>u(d[h],_),l)}}function Mt(t,o){const s=t.node;if(!s||s.tagName!=="SELECT")return;const n=s.options;if(!n||!n.length)return;const r=t.__ref,c=r&&r.__exec&&r.__exec.value,a=typeof c=="function",i=t.value!=null&&typeof t.value!="function";if(a||i){let l;if(a)try{l=c(t,t.state,t.context)}catch{return}else l=t.value,typeof l=="string"&&l.includes("{{")&&(l=R.replaceLiteralsWithObjectFields.call(t,l,t.state));const u=l==null?"":String(l);s.value!==u&&(s.value=u);return}const e=o||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!e)return;let f=-1;for(let l=0;l<n.length;l++)n[l].defaultSelected&&(f=l);f>=0&&s.selectedIndex!==f&&(s.selectedIndex=f)}function Bs(t,o){let{children:s,content:n}=t;const r=t.childExtends,c=typeof s=="function",a=c||mo(t,"children");if(typeof s=="function"){const u=s,d=t.__ref;let h=!1,_;const p=L(t,t.childrenDeps,u),y=(0,j.createEffect)(()=>{const A=h;h=!0;let S;try{S=p(t,t.state,t.context)}catch(T){if(typeof console<"u"&&console.error){const F=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${F}${A?"":" (initial run, treating as empty)"}:`,T?.message||T)}return}if(!A){_=S;return}if(S===t.children)return;ts(t,S),t.children=S,d.__mount&&d.__mount.chunkGen++;const w=typeof t.onContentUpdate=="function",b=w?[]:null,g=w?[]:null,x=w?[]:null;if(Array.isArray(S)&&t.childrenAs==="state"){const T=t.childProps,F=[],st=new Map;for(let D=0;D<S.length;D++){const X=S[D];let I=T;if(typeof T=="function")try{I=T(t,X)}catch{I=null}const ct=Ho(I&&I.key,X,D,t);F.push(ct),st.set(ct,{rawChild:X,childProps:I})}const z=new Set(F),lt=qo(d,d.__children.slice());for(const D of lt)if(!z.has(D)){const X=t[D];X?.remove&&X.remove(),delete t[D],g&&g.push(D)}const It=t.childExtends,$t=!(t.tag==="fragment")&&!!t.node;let Ut=null;const xt=new Set;for(const D of F){const X=st.get(D),I=X.rawChild,ct=t[D];if(ct&&ct.state){if(I&&typeof I=="object"){const $=ct.state,Ht=$.$replace||$.replace,Ro=$.$update||$.update;try{if(typeof Ht=="function")Ht.call($,I);else if(typeof Ro=="function"){for(const Z in $)if(!(Z==="__element"||Z==="root"||Z==="parent"||Z==="update")&&!Object.prototype.hasOwnProperty.call(I,Z))try{$[Z]=void 0}catch{}Ro.call($,I)}else for(const Z in I)$[Z]=I[Z]}catch(Z){if(typeof console<"u"&&console.error){const sn=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${D}" failed to patch at ${sn} (reconcile, keeping its previous data for this pass):`,Z?.message||Z)}}}if(x&&x.push(D),$t){const $=Jt(ct);$&&(Ut=To(t,$,Ut))}continue}let to=I;(typeof I=="string"||typeof I=="number")&&(to={value:I,text:I});const oo=X.childProps,tn=Rt(oo?{...oo,state:to}:{state:to},It),on=typeof T=="function"?Ct(oo):ut(t,"childProps");let Oo;try{Oo=m(At(tn,on),t,D,o,$t?Xs(t,Ut):void 0)}catch($){if(typeof console<"u"&&console.error){const Ht=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${D}" failed to construct at ${Ht} (reconcile, skipping this row):`,$?.message||$)}xt.add(D);continue}if(d.__disposed)return;if($t){const $=Jt(Oo);$&&(Ut=$)}b&&b.push(D)}$t&&Js(t,F,xt.size?xt:null),d.__children=xt.size?F.filter(D=>!xt.has(D)):F,w&&(b.length||g.length)&&Eo(t,{added:b,removed:g,kept:x}),Mt(t,!1);return}if(t.childrenAs!=="state"&&d.__plainRows&&H.FEATURES.rows.reconcile(t,d,S,o,w)){Mt(t,!1);return}const O=w?[...d.__children]:null;for(const T of qo(d,[...d.__children])){const F=t[T];F?.remove&&F.remove(),delete t[T]}d.__children=[],Hs(t,S,o,0),Mt(t,!1),w&&Eo(t,{added:[...d.__children],removed:O,kept:[]})},{depth:d.path.length,label:P(d,"children")});d.__effects.push(y),s=_,ts(t,s),t.children=s}const i=H.FEATURES.mount,e=i!==null?i.budgetOf(t,o):0,f=(0,dt.mountPendingOf)(t.__ref),l=c?Hs(t,s,o,e):Po(t,s,o,e,a);if(e&&(0,dt.mountPendingOf)(t.__ref)>f){i.defer(t,e,()=>Vs(t,o,s,n,r,l,e));return}Vs(t,o,s,n,r,l,e)}function Vs(t,o,s,n,r,c,a){const i=(0,dt.mountPendingOf)(t.__ref);if(n!=null&&!(n&&n.__ref)){let e=n;typeof e=="string"||typeof e=="number"?e={text:e}:typeof e!="object"&&(e={}),t.childProps&&(e=(0,W.deepMergeChild)(t.childProps,e)),e=Rt(e,r);const f=vt(ut(t,"childProps"),ut(t,"content"));Wt(t,m(At(e,f),t,"content",o))}if(!(s&&!c)){if(a&&(0,dt.mountPendingOf)(t.__ref)>i){H.FEATURES.mount.defer(t,a,()=>Ks(t,o,r,a));return}Ks(t,o,r,a)}}function Ks(t,o,s,n){const r=t.context?.components||{},c=t.__ref&&t.__ref.__runtimeSource,a=c?{}:null;{const f=Object.keys(t);for(let l=0;l<f.length;l++){const u=f[l];if(!u.endsWith("Extends")||typeof t[u]!="string")continue;const d=u.slice(0,-7);if(!d||d.charCodeAt(0)<65||d.charCodeAt(0)>90)continue;const h={extends:t[u]};delete t[u];for(let _=l+1;_<f.length;_++){const p=f[_],y=p.charCodeAt(0);if(y>=65&&y<=90||G.REGISTRY.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const A=t[p];A!==void 0&&(h[p]=A,delete t[p],a&&kt(c,p)&&(a[d]||(a[d]={}),a[d][p]=c[p]))}t[d]&&typeof t[d]=="object"?t[d]={...h,...t[d]}:t[d]=h}}const i=Object.keys(t),e=f=>{if(G.REGISTRY.has(f)||typeof t[f]!="object"||t[f]===null)return!1;const l=f.charCodeAt(0);if(l<65||l>90)return!1;let u=t[f];if(u.__ref)return!1;if(!u.extends&&!u.extend){const h=r[f]||r[`smbls.${f}`];h&&(u={...u,extends:h})}t.childProps&&(u=(0,W.deepMergeChild)(t.childProps,u)),u=Rt(u,s);const d=c?vt(ut(t,"childProps"),vt(a[f]||null,ut(t,f))):null;Wt(t,m(At(u,d),t,f,o))};if(!n){for(const f of i)e(f);return}H.FEATURES.mount.run(t,i.length,f=>e(i[f]),n)}function Zt(t,o,s){const{node:n}=t;if(!n)return;n.ref=t;const r=o?.tag==="fragment"?o.__ref?.__fragmentAnchor:null;if(r){const i=r.parentNode;if(i){if(s?.position==="before"&&s.node)i.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const e=s.node.nextSibling;i.insertBefore(n,e||r)}else i.insertBefore(n,r);(0,Qt.flushConnected)();return}}const c=o?.node||(o?.nodeType?o:null);if(!c)return;if(!s&&H.FEATURES.hydration!==null){const i=t.context&&t.context.__hydration;if(i&&H.FEATURES.hydration.place(i,t,o,c,n))return}const a=s?.node;if(a&&a.parentNode!==c)c.appendChild(n);else if(s?.position==="before"&&a)c.insertBefore(n,a);else if(s?.position==="after"&&s.node){const i=s.node.nextSibling;i?c.insertBefore(n,i):c.appendChild(n)}else c.appendChild(n);(0,Qt.flushConnected)()}const mt=3;function ms(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=mt?!1:(t.__inBeforeUpdate=!0,!0)}function Ft(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===mt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${mt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function U(t,o,s){const n=t.charAt(0).toLowerCase()+t.slice(1);(0,Y.dispatchPluginHook)(n,o,s);const r="on"+t,c=o[r];if(typeof c=="function"){const e=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(e){if(o.__ref[e])return!0;o.__ref[e]=!0}const f=o.context?.designSystem;f&&(0,M.pushConfig)(f);let l=!!e;try{const u=c(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const d=o.__ref;return u.catch(h=>{(0,Y.reportLifecycleError)(o,r,h)}).finally(()=>{e&&d&&(d[e]=!1)}),l=!1,!0}if(u===!1)return!1}catch(u){if((0,Y.reportLifecycleError)(o,r,u),o.context?.strictMode)throw u}finally{f&&(0,M.popConfig)(),l&&o.__ref&&(o.__ref[e]=!1)}}return!0}var Rr=m;
|