@symbo.ls/element 3.14.802 → 3.14.803
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 +21 -0
- package/dist/cjs/src/bridge.js +1 -1
- package/dist/cjs/src/create.js +5 -5
- package/dist/cjs/src/cssLonghands.js +1 -1
- package/dist/cjs/src/dispose.js +1 -1
- package/dist/cjs/src/extends.js +1 -1
- package/dist/cjs/src/inertOutside.js +1 -1
- package/dist/cjs/src/pluginHooks.js +1 -0
- package/dist/cjs/src/runContext.js +1 -0
- package/dist/cjs/src/update.js +1 -1
- package/dist/cjs/src/version.js +1 -1
- package/dist/esm/src/bridge.js +1 -1
- package/dist/esm/src/create.js +5 -5
- package/dist/esm/src/cssLonghands.js +1 -1
- package/dist/esm/src/dispose.js +1 -1
- package/dist/esm/src/extends.js +1 -1
- package/dist/esm/src/inertOutside.js +1 -1
- package/dist/esm/src/pluginHooks.js +1 -0
- package/dist/esm/src/runContext.js +1 -0
- package/dist/esm/src/update.js +1 -1
- package/dist/esm/src/version.js +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @symbo.ls/element
|
|
2
2
|
|
|
3
|
+
## 3.14.803
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Performance pass on the 3.14.827–3.14.832 batch, and opt-in View Transitions.
|
|
8
|
+
|
|
9
|
+
- Element create is faster than 3.14.826 again (kekela-like 4,068-element tree: create CPU min 1,265–1,355 ms vs 1,361–1,532 ms on 3.14.826). Per-definition caching of the extends merge layers (46,330 → 13,600 entries), no per-element source-text reads, one attribute writer.
|
|
10
|
+
- `css()` 3x faster (21 → 7 µs per call), byte-identical CSS output.
|
|
11
|
+
- Helmet renders a head layer only when its values change (20 `root.update({})` → 0 head renders, was 40). One runtime head writer: `applyElementMetadata`.
|
|
12
|
+
- brender/mermaid: registry script is escaped on the ISR and non-adopt paths; head/SSR output byte-identical otherwise.
|
|
13
|
+
- View Transitions for page switches (opt-in), `viewTransitionName` / `viewTransitionClass` flat props, `designSystem.viewTransition` animations.
|
|
14
|
+
- utils exports shared helpers used by helmet, frank, fetch and polyglot (escapeHtml, jsonForScript, alternateLinkKey, faviconLinkKey, bareLibraryKey, librarySpecsFor, polyglotLangStorageKey, ...).
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @symbo.ls/signal@3.14.787
|
|
18
|
+
- @symbo.ls/css@3.14.777
|
|
19
|
+
- css-in-props@3.14.762
|
|
20
|
+
- attrs-in-props@3.14.696
|
|
21
|
+
- @symbo.ls/scratch@3.14.788
|
|
22
|
+
- @symbo.ls/utils@3.14.786
|
|
23
|
+
|
|
3
24
|
## 3.14.802
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/dist/cjs/src/bridge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var c=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var l=(t,r)=>{for(var n in r)c(t,n,{get:r[n],enumerable:!0})},B=(t,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of g(r))!_.call(t,o)&&o!==n&&c(t,o,{get:()=>r[o],enumerable:!(i=y(r,o))||i.enumerable});return t};var b=t=>B(c({},"__esModule",{value:!0}),t);var x={};l(x,{destroyBridge:()=>O,mountBridge:()=>M});module.exports=b(x);var h=require("@symbo.ls/signal"),f=require("./runContext.js"),s=require("./pluginHooks.js"),p=require("./devRuntime.js");const w=(t,r)=>Object.prototype.hasOwnProperty.call(t,r);function d(t,r,n){return(0,f.untrack)(()=>(0,f.withDesignSystem)(t,()=>r.call(t,n,t,t.state,t.context)))}function D(t,r){if(!(0,p.isLoudDevRuntime)())return;const n=r.__children&&r.__children.length>0;!n&&t.html==null||console.warn(`[smbls] bridge host "${r.path.join(".")}" renders DOMQL ${n?"children":"html"} inside the node it hands to its library \u2014 the library owns that subtree and may replace them. Keep DOMQL children beside the host, not in it.`)}function M(t){const r=t.__ref,n=t.node;if(!r||!n||r.__bridge||typeof t.onBridgeMount!="function"||!("scrollHeight"in n))return;const i=r.__bridge={settled:!1,failed:!1,disposed:!1,destroyed:!1,instance:void 0,effect:null};r.contentManaged=!0,D(t,r);let o;try{o=d(t,t.onBridgeMount,n)}catch(e){if(i.failed=!0,(0,s.reportLifecycleError)(t,"onBridgeMount",e),t.context?.strictMode)throw e;return}if(o&&typeof o.then=="function"){o.then(e=>u(t,i,e),e=>{i.failed=!0,(0,s.reportLifecycleError)(t,"onBridgeMount",e)});return}u(t,i,o)}function u(t,r,n){if(r.settled=!0,r.instance=n,r.disposed){a(t,r);return}if(Object.defineProperty(t,"bridge",{value:n,writable:!0,configurable:!0,enumerable:!1}),typeof t.onBridgeUpdate!="function")return;const i=t.__ref;r.effect=(0,h.createEffect)(()=>{r.disposed||(0,f.withDesignSystem)(t,()=>{try{const o=t.onBridgeUpdate.call(t,r.instance,t,t.state,t.context);o&&typeof o.then=="function"&&o.catch(e=>(0,s.reportLifecycleError)(t,"onBridgeUpdate",e))}catch(o){(0,s.reportLifecycleError)(t,"onBridgeUpdate",o)}})},{depth:i.path.length,label:()=>i.path.join(".")+"::onBridgeUpdate"}),i.__effects.push(r.effect)}function O(t){const r=t.__ref?.__bridge;!r||r.disposed||(r.disposed=!0,r.effect&&r.effect.dispose(),r.settled&&a(t,r))}function a(t,r){if(r.destroyed)return;r.destroyed=!0;const n=r.instance;if(r.instance=void 0,w(t,"bridge")&&(t.bridge=void 0),typeof t.onBridgeDestroy=="function")try{const i=d(t,t.onBridgeDestroy,n);i&&typeof i.then=="function"&&i.catch(o=>(0,s.reportLifecycleError)(t,"onBridgeDestroy",o))}catch(i){(0,s.reportLifecycleError)(t,"onBridgeDestroy",i)}}
|
package/dist/cjs/src/create.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`+
|
|
1
|
+
"use strict";var Vs=Object.create;var Ht=Object.defineProperty;var Gs=Object.getOwnPropertyDescriptor;var Ks=Object.getOwnPropertyNames;var Ws=Object.getPrototypeOf,zs=Object.prototype.hasOwnProperty;var Ys=(t,o)=>{for(var s in o)Ht(t,s,{get:o[s],enumerable:!0})},vo=(t,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of Ks(o))!zs.call(t,e)&&e!==s&&Ht(t,e,{get:()=>o[e],enumerable:!(n=Gs(o,e))||n.enumerable});return t};var qs=(t,o,s)=>(s=t!=null?Vs(Ws(t)):{},vo(o||!t||!t.__esModule?Ht(s,"default",{value:t,enumerable:!0}):s,t)),Zs=t=>vo(Ht({},"__esModule",{value:!0}),t);var ye={};Ys(ye,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>Qt,acquireBeforeUpdateGuard:()=>Fs,create:()=>m,default:()=>he,flushMounts:()=>Zt,isStaticCssProp:()=>Xn,recompileStaticCss:()=>Jn,reconcileAttrProp:()=>te,releaseBeforeUpdateGuard:()=>It,resolveStyleBlock:()=>$t,writeAttr:()=>Ft,writeElementText:()=>Nt});module.exports=Zs(ye);var I=require("@symbo.ls/signal"),E=require("@symbo.ls/signal"),G=require("./runContext.js"),ot=require("./cache.js"),U=require("./registry.js"),bt=require("./delegate.js"),Ls=require("./bridge.js"),At=require("./extends.js"),Rs=require("./methods.js"),Ae=require("./dispose.js"),et=require("./devRuntime.js"),z=require("./mountScheduler.js"),L=require("@symbo.ls/utils"),Ut=qs(require("@symbo.ls/utils"),1),K=require("./pluginHooks.js"),ut=require("@symbo.ls/state"),v=require("css-in-props"),tt=require("@symbo.ls/css"),M=require("@symbo.ls/scratch"),j=require("attrs-in-props"),Ms=require("./engineRegistry.js"),H=require("./cssLonghands.js"),q=require("./attributeFirst.js"),Ns=require("./version.js");const jo=(0,Ms.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},Ns.VERSION),Ct=[],ct=new Set;let oo=!1,Eo=0,lt=null,kt=null;function pt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function Po(){return typeof document<"u"&&document.visibilityState==="hidden"}const Qs=250,Xs=1e3;function Js(){return kt&&(kt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||Po())?!0:pt()-Eo>=Xs}function ms(){if(oo=!0,Eo=pt(),kt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(Zt,0);lt=t?()=>t(o):null;return}if(Po()){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(Zt,Qs);lt=t?()=>t(o):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;kt=requestAnimationFrame;const o=requestAnimationFrame(Zt);lt=t?()=>t(o):null}}function Vt(){if(oo){if(!Js())return;const t=lt;if(lt=null,t)try{t()}catch{}}ms()}const Oo=300,To=15e4;function Zt(){if(oo=!1,lt=null,kt=null,ct.size&&se(),!Ct.length)return;const t=Ct.splice(0,Ct.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=pt());const e=pt()-n.__mountFirstAttemptAt;n.__mountAttempts<=Oo&&e<To?(Ct.push(s),Vt()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",e,"ms \u2014 node never connected:",s.key||s.tag||s);continue}typeof s.onBridgeMount=="function"&&(0,Ls.mountBridge)(s),typeof s.onMounted=="function"&&N("Mounted",s,s.__ref?.__mountOptions||{})}}}function so(t,o){const s=t.__ref?.__autoGrow;s&&s.active&&Rt(t,!0),!(typeof t.onMounted!="function"&&typeof t.onBridgeMount!="function")&&(t.__ref.__mountOptions=o,Ct.push(t),Vt())}function Do(t,o){typeof t.onContentUpdate=="function"&&((0,K.dispatchPluginHook)("contentUpdate",t,o),(0,G.withDesignSystem)(t,()=>{try{t.onContentUpdate(t,t.state,t.context,o)}catch(s){if((0,K.reportLifecycleError)(t,"onContentUpdate",s),t.context?.strictMode)throw s}}))}function X(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function tn(t){return t.charAt(2).toLowerCase()+t.slice(3)}function on(t){return t.toLowerCase()}function no(t){const o=t.charCodeAt(0);return o===58||o===64||o===38||o===91}function vt(t,o){const s={...t};for(const n in o){const e=s[n],c=o[n];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?s[n]=vt(e,c):s[n]=c}return s}function Gt(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Lo(t,o,s,n){return Kt(n,Gt(t)||(o&&typeof o=="object"?Gt(o.key):void 0)||String(s))}function Kt(t,o){if(!t||typeof o!="string")return o;let s=o;for(;sn(t,s);)s="$"+s;return s!==o&&nn(t,o,s),s}function sn(t,o){if(U.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 Ro=new Set;function nn(t,o,s){if(!(0,et.isLoudDevRuntime)())return;const n=t.__ref&&t.__ref.path&&t.__ref.path.join(".")||t.key||"<root>",e=n+"::"+o;Ro.has(e)||(Ro.add(e),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={},e){if((0,E.getObserver)())return(0,G.untrack)(()=>m(t,o,s,n,e));if(t==null||t===!1)return null;const c=Cn(t);(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=Gt(s);const a=Gt(t.key),r=Object.create(null);r.key=s||(a&&o?Kt(o,a):a)||`_${jo.uniqId++}`,r.parent=o||null,r.context=t.context||o?.context||n.context||{},r.context.__create||(r.context.__create=m);const i=r.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:o?.__ref?.root||r,path:o?.__ref?.path?[...o.__ref.path,r.key]:[r.key],origin:t};c&&(i.__runtimeSource=c);const f=t;if(t=No(r,t,s,a,o,n),r.if!=null){let u;if(typeof r.if=="function")try{u=r.if(r,r.state,r.context)}catch(l){if(u=!1,i.__ifError=l,typeof console<"u"&&console.warn){const _=r.key||r.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${_} \u2014 treating as false:`,l?.message||l)}}else u=r.if;i.__if=!!u}if(i.__if)typeof r.if=="function"&&(i.__ifInitialized=!0);else{o&&(o[r.key]=r);const u=cn(t,s,r.context?.components);return u.length&&(i.__ifLateMerge={definition:f,key:s,ownKey:a,names:u,options:n}),typeof r.if=="function"&&Jo(r,i,r.if),r}r.tag||(r.tag=(0,ot.detectTag)(r)),N("Init",r,n);const d=r.node=(0,ot.adoptHydrationNode)(r)||(0,ot.cacheNode)(r);if(!d)return r;if(r.tag==="fragment"){const l=(r.context?.document||globalThis.document).createComment("");d.appendChild(l),i.__fragmentAnchor=l}N("AttachNode",r,n),d.setAttribute&&r.key&&d.setAttribute("data-key",r.key),o&&(o[r.key]=r,o.__ref?.__children&&(o.__ref.__children.includes(r.key)||o.__ref.__children.push(r.key))),d.setAttribute&&r.context?.scopeSelector&&r.context.scopeSelector!==":root"&&r.context.key&&r.key===r.context.key&&d.setAttribute("data-smbls-app",r.context.key),r.id&&d.setAttribute&&(d.id=r.id),Os(r,n),Zo(r),Xo(r);try{Ts(r,n)}catch(u){if(typeof console<"u"&&console.error){const l=r.__ref?.path?.join(".")||r.key||"<root>";console.error(`[smbls] createChildren failed at ${l}:`,u?.message||u,u?.stack?`
|
|
2
|
+
`+u.stack.split(`
|
|
3
3
|
`).slice(0,6).join(`
|
|
4
|
-
`):"")}}if(zt(r,!0),ks(r,o,e),typeof r.html=="function"&&r.node&&!r.node.innerHTML){const d=r.context?.designSystem;d&&(0,j.pushConfig)(d);try{const h=r.html(r,r.state,r.context);h!=null&&typeof h!="function"&&(r.node.innerHTML=h)}catch{}finally{d&&(0,j.popConfig)()}}if(F("Create",r,n),F("Complete",r,n),F("Render",r,n),F("RenderRouter",r,n),so(r,n),typeof r.onFrame=="function"){const d=r.onFrame,h=r.context?.designSystem,y=()=>{if(r.node){if(r.node.isConnected){h&&(0,j.pushConfig)(h);try{d(r,r.state,r.context)}catch(A){console.error("[DOMQL] onFrame error:",A)}finally{h&&(0,j.popConfig)()}}requestAnimationFrame(y)}};requestAnimationFrame(y)}return r}function Ro(t,o,s,n,e,i){if(s&&!o.extends&&!o.extend){const b=s.indexOf("_"),w=s.indexOf(".");let p=b>0?b:-1;if(w>0&&(p<0||w<p)&&(p=w),p>0){const _=s.substring(0,p),x=t.context?.components;x&&(x[_]||x["smbls."+_])?o={...o,extends:_}:x&&(0,nt.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 "${_}" but neither "${_}" nor "smbls.${_}" 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,Qt.applyExtends)(t,o,i);const a=(0,Qt.openMergeLayer)(t),c=a?a.rank:0,r=new Set(["childProps","attr","style","scope","data","vars"]),f=t.props&&typeof t.props=="object"?t.props:null;for(const b in o){if(b==="parent"||b==="node"||b==="__ref"||b==="extends"||b==="context"||b==="props")continue;if(b==="key"){n&&(t.key=e?Vt(e,n):n);continue}const w=o[b];a&&a.set(b,c);const p=t[b],_=p&&w&&typeof p=="object"&&typeof w=="object"&&!Array.isArray(p)&&!Array.isArray(w)&&typeof p!="function"&&typeof w!="function";_&&b.charCodeAt(0)>=65&&b.charCodeAt(0)<=90?t[b]=Pt(p,w):_&&r.has(b)?t[b]={...p,...w}:_&&no(b)?t[b]=Pt(p,w):t[b]=w}function l(b){for(const w in b){const p=b[w],_=t[w],x=_&&p&&typeof _=="object"&&typeof p=="object"&&!Array.isArray(_)&&!Array.isArray(p)&&typeof _!="function"&&typeof p!="function";x&&w.charCodeAt(0)>=65&&w.charCodeAt(0)<=90?t[w]=Pt(_,p):x&&r.has(w)?t[w]={..._,...p}:x&&no(w)?t[w]=Pt(_,p):t[w]=p}}if(f&&l(f),o.props&&typeof o.props=="object"&&(l(o.props),a))for(const b in o.props)a.set(b,c);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 u=t.scope&&typeof t.scope=="object"?t.scope:null,d=e?.scope,h=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,y=d||h||null;if(o.scope!==void 0||u){const b={};u&&Object.assign(b,u),o.scope!==void 0&&Object.assign(b,o.scope),t.scope=(0,I.createScopeStore)(b,y)}else y&&(t.scope=y);o.if!==void 0&&(t.if=o.if);const A=t.__ref,g=_n(t,A&&A.__runtimeSource);return A&&(A.__declaredArrays=g||void 0),(0,js.addMethods)(t),tn(t,e,o,i),o}const Xs=new Set(["key","parent","context","__ref"]);function Js(t,o){for(const e of Object.keys(t))Xs.has(e)||delete t[e];const s=(0,C.getObserver)();s&&(0,C.setObserver)(null);let n=o.definition;if(!n.extends&&!n.extend&&typeof o.key=="string"){const e=t.context?.components||{},i=e[o.key]||e["smbls."+o.key];i&&(n={...n,extends:i})}try{Ro(t,n,o.key,o.ownKey,t.parent,o.options)}finally{s&&(0,C.setObserver)(s)}}function ms(t,o,s){const n=s||{},e=c=>!!(n[c]||n["smbls."+c]),i=[],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 c of a){if(typeof c!="string")continue;const r=c.includes(">")?c.split(">")[0].trim():c;e(r)||i.push(r)}return i}if(typeof o=="string"&&/^[A-Z]/.test(o)){let c=-1;const r=o.indexOf("_"),f=o.indexOf(".");r>0&&(c=r),f>0&&(c<0||f<c)&&(c=f);const l=c>0?o.substring(0,c):o;e(l)||i.push(l)}return i}function eo(t,o,s){if(typeof t.onStateInit!="function"&&!t.context?.plugins?.length)return;const n=t.state;t.state=o;try{F("StateInit",t,s)}finally{t.state=n}}function tn(t,o,s,n){const e=!o,i=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=e&&i&&t.context?.state,c=s.state!==void 0&&!a?s.state:t.state&&!(0,I.isStore)(t.state)?t.state:void 0;if(c==null){if(o?.state)t.state=o.state,(0,ut.applyStateMethods)(t,t.state);else if(t.context?.state){const r=t.context.state,f={...r},l=t.context?.polyglot;if(l?.translations){const u=t.context,d=r.lang||l.defaultLang||"en",h=new Set,y=(b,w)=>{h.has(b)||(0,M.isPolyglotWritableKey)(u,b,f)&&(f[b]=w,h.add(b),(0,M.markPolyglotSeeded)(u,b,w))},A=l.translations[d];if(A&&typeof A=="object")for(const b in A)y(b,A[b]);const g=new Set(l.languages||[]);for(const b in l.translations)g.has(b)||y(b,l.translations[b])}(0,I.isStore)(f)||eo(t,f,n),t.state=(0,I.isStore)(f)?f:(0,I.createStore)(f),t.state.__element=t,t.state.root=t.state,(0,ut.applyStateMethods)(t,t.state),lt.promoteActiveRootState?.(r,t.state),F("StateCreated",t,n)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,ut.applyStateMethods)(t,t.state);return}if(typeof c=="string"){if(t.state=Mo(c,o),t.state&&typeof t.state=="object"&&!(0,I.isStore)(t.state)){const r=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:r,enumerable:!1,configurable:!0,writable:!0})}(0,ut.applyStateMethods)(t,t.state),sn(t,c,o),F("StateCreated",t,n);return}if(typeof c=="function"){const r=c(t,o?.state);if((0,I.isStore)(r))t.state=r;else{const f=r||{};eo(t,f,n),t.state=(0,I.createStore)(f)}}else if((0,I.isStore)(c))t.state=c;else{const r={...c};eo(t,r,n),t.state=(0,I.createStore)(r)}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,ut.applyStateMethods)(t,t.state),lt.promoteActiveRootState?.(c,t.state),F("StateCreated",t,n)}function ro(t,o){if(!o)return t;const s=o.split("/");let n=t;for(const e of s){if(n==null)return{};n=n[e]}return n??{}}function Mo(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")){const e=t.slice(3);return e?ro(o.state,e):o.state??{}}if(t.startsWith("~/")){const e=o.state?.root||o.state,i=t.slice(2);return i?ro(e,i):e??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=ro(o.state,t);if(s!=null&&Object.keys(s).length>0)return s;const n=o.context?.polyglot;if(n?.translations){const e=o.state?.root?.lang||n.defaultLang||"en",i=n.translations[e];if(i?.[t]!==void 0)return i[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function on(t,o){let s=o.state,n=t;if(t.startsWith("~/")?(s=o.state&&(o.state.root||o.state),n=t.slice(2)):t.startsWith("../")&&(n=t.slice(3)),!n||!s||typeof s!="object")return;const e=s[n];if(e!==void 0||n.indexOf("/")===-1)return e;let i=s;for(const a of n.split("/")){if(i==null||typeof i!="object")return;i=i[a]}return i}function sn(t,o,s){const n=t.__ref;if(!n||!s||o==="."||!(0,I.isStore)(s.state))return;n.__stateBinding&&n.__stateBinding.dispose();const e=(0,C.getObserver)();e&&(0,C.setObserver)(null);try{const i=(0,C.createEffect)(()=>{const a=on(o,s);if(!a||typeof a!="object"||a===t.state)return;const c=(0,C.getObserver)();(0,C.setObserver)(null);try{No(t,t.state,a,!0)}finally{(0,C.setObserver)(c)}},{depth:n.path?n.path.length:0,label:O(n,"state")});i._isStateBinding=!0,n.__stateBinding=i,n.__effects&&n.__effects.push(i)}finally{e&&(0,C.setObserver)(e)}}function No(t,o,s,n){const e=t.__ref;if(!e)return;if(n||t.state===o){t.state=s,n&&(0,ut.applyStateMethods)(t,s),Fo(e);const a=e.__children;if(a)for(let c=0;c<a.length;c++){const r=t[a[c]];r&&r.__ref&&r.parent===t&&No(r,o,s,!1)}return}if(e.__stateBinding){e.__stateBinding._notify();return}const i=t.state;i&&typeof i=="object"&&i.parent===o&&(i.parent=s,Fo(e))}function Fo(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 nn=new Set(["s","state","ctx","context"]);function en(t){try{const s=(typeof lt.getFunctionSource=="function"?lt.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function rn(t){let o;try{o=typeof lt.getFunctionSource=="function"?lt.getFunctionSource(t):Function.prototype.toString.call(t)}catch{return!0}if(typeof o!="string")return!0;const s=o.match(/^\s*(?:async\s+)?([A-Za-z_$][\w$]*)\s*=>/)||o.match(/^[^(]*\(([^)]*)\)/);if(!s)return!0;const n=o.slice(s.index+s[0].length);if(/\bstate\b|\barguments\b|\bcall\s*\(/.test(n))return!0;const i=s[1].split(",").map(c=>c.trim())[1];if(!i)return!1;if(!/^[A-Za-z_$][\w$]*$/.test(i.split("=")[0].trim()))return!0;const a=i.split("=")[0].trim();return new RegExp("(^|[^\\w$.])"+a.replace(/\$/g,"\\$")+"(?![\\w$])").test(n)}const cn=3,fn=/^(is|has)[A-Z0-9_$]/,an=new Set(["routerOptions"]),$o=new WeakSet;function un(t,o){if(typeof t!="function"||t.length!==2||o&&(fn.test(o)||an.has(o))||$o.has(t))return!1;const s=en(t);if(s.length<2)return!1;const n=s[1].replace(/[{}[\]]/g,"").trim();return n.length<cn||nn.has(n)?!1:($o.add(t),!0)}function dn(t){const o=t.__ref,s=t.tag||"div",n=t.context?.designSystem,e=[],i=Object.keys(t);for(let a=0;a<i.length;a++){const c=i[a];if(typeof t[c]!="function"||B.REGISTRY.has(c))continue;const r=c.charCodeAt(0);r>=65&&r<=90||Q(c)||P.CSS_PROPS_REGISTRY[c]||P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(c)||r!==45&&((0,k.checkAttributeByTagName)(s,c)||((0,nt.isLoudDevRuntime)()&&un(t[c],c)&&console.warn(`[smbls] custom prop "${c}"${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('${c}', \u2026) instead of reading el.${c}(\u2026) directly (see RULES.md Rule 8).`),e.push({prop:c,fn:t[c]})))}for(let a=0;a<e.length;a++){const{prop:c,fn:r}=e[a];o.__exec[c]=r,Object.defineProperty(t,c,{get(){n&&(0,j.pushConfig)(n);try{return r(t,t.state,t.context)}catch{return}finally{n&&(0,j.popConfig)()}},set(f){delete o.__exec[c],Object.defineProperty(t,c,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function ln(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 R(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...n){return ln(t,o),s.apply(this,n)}}function yt(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function O(t,o){return()=>t.path.join(".")+"::"+o}const Io=new Set;function N(t,o,s){if(!(0,nt.isLoudDevRuntime)())return;const n=O(t,o)();Io.has(n)||(Io.add(n),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const Uo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,pn=(t,o)=>{let s;try{s=String(t)}catch{return}if(!s.includes("{{"))return;Uo.lastIndex=0;let n;for(;(n=Uo.exec(s))!==null;)n[2].includes("{{")&&o.add(n[2])},hn=(t,o)=>!Q(t)&&!(0,K.isCssProp)(o,t),io=(t,o,s,n,e)=>{if(typeof o=="string"){!e&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&hn(t,n)&&pn(o,s)},co=new WeakMap,Ot=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),Tt=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)?at(t,o):t},Lt=(t,o)=>t&&o?at(t,o):t||o||null,Bo=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&Ot(s,o)},_t=(t,o)=>Bo(t,o)?Tt(t.__ref.__runtimeSource[o]):null,Dt=(t,o)=>(o&&t&&typeof t=="object"&&co.set(t,o),t),yn=t=>{if(!t||typeof t!="object")return;const o=co.get(t);return o&&co.delete(t),o},fo=(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++)fo(t[n],o,s);return}if(!t.__ref)for(const n of Object.keys(t)){if(n==="state")continue;const e=Object.getOwnPropertyDescriptor(t,n);e&&"value"in e&&fo(e.value,o,s)}}},_n=(t,o)=>{let s=null;for(const n of Object.keys(t)){if(B.REGISTRY.has(n)||o&&Ot(o,n))continue;const e=Object.getOwnPropertyDescriptor(t,n),i=e&&e.value;if(!Array.isArray(i))continue;const a=new Set;fo(i,a,new Set),a.size&&(s||(s=new Map),s.set(i,a))}return s},Ho=(t,o)=>{if(Array.isArray(o))for(let s=t;s;s=s.parent){const n=s.__ref&&s.__ref.__declaredArrays,e=n&&n.get(o);if(!e)continue;const i=t.__ref;i.__authoredTemplates||(i.__authoredTemplates=new Set);for(const a of e)i.__authoredTemplates.add(a);return}},Vo=["attr","aria","data","metadata"],gn=t=>{if(Vo.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},bn=(t,o)=>{const s=new Set,n=t.tag||"div";for(const e of Object.keys(t)){const i=Object.getOwnPropertyDescriptor(t,e),a=i&&i.value,c=!!o&&Ot(o,e);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!gn(e))continue;const r=c?o[e]:null,f=r&&typeof r=="object"?r:null,l=e.charCodeAt(0)===46||e.charCodeAt(0)===33;for(const u in a){const d=c&&(!f||Ot(f,u)),h=a[u];if(l&&h&&typeof h=="object"&&!Array.isArray(h)&&Vo.includes(u)){for(const y in h)io(y,h[y],s,n,d);continue}io(u,h,s,n,d)}continue}io(e,a,s,n,c)}return s};function Go(t,o){const s=t.__ref,n=!!(o&&o.skipIfEffect),e=bn(t,s.__runtimeSource);if(s.__authoredTemplates)for(const r of e)s.__authoredTemplates.add(r);else s.__authoredTemplates=e;if(dn(t),typeof t.text=="function"){const r=t.text,f=R(t,t.textDeps,r),l=(0,C.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=M.replaceLiteralsWithObjectFields.call(t,u,t.state)),Ft(t,u))}catch(u){N(s,"text",u)}},{depth:s.path.length,label:O(s,"text")});s.__effects.push(l),s.__exec.text=r}else if(typeof t.text=="string"&&t.text.includes("{{")){const r=t.text,f=(0,C.createEffect)(()=>{if(s.contentManaged)return;const l=M.replaceLiteralsWithObjectFields.call(t,r,t.state);l!=null&&(t.text=l),t.node&&Ft(t,l??"")},{depth:s.path.length,label:O(s,"text")});s.__effects.push(f),s.__exec.text=r}const i=t.tag||"div";for(const r of Object.keys(t))if(typeof t[r]=="function"&&!B.REGISTRY.has(r)&&!Q(r)&&!s.__exec[r]&&!(0,K.isAttributeFirst)(i,r)){if(P.CSS_PROPS_REGISTRY[r]){const f=t[r],l=R(t,t[r+"Deps"],f),u=r;let d,h=null,y=null,A;const g=(0,C.createEffect)(()=>{const b=t.context?.designSystem;b&&(0,j.pushConfig)(b);try{const w=l(t,t.state,t.context);(0,P.pushStaticCssPass)();let p;try{p=P.CSS_PROPS_REGISTRY[u](w,t,t.state,t.context)}finally{(0,P.popStaticCssPass)()}if(Array.isArray(p)){const x={};for(const S of p)if(S)for(const E in S)x[E]=S[E];p=x}const _=u==="show"||u==="hide";if(p&&t.node&&An(p)){const x=Rt(p);if(x===null||x!==A){A=x;const S=(0,tt.css)(p,null,t.context?.cssPrefix),E=S?S.split(" ").filter(Boolean):null;if(t.node.classList){if(y)for(const v of y)t.node.classList.remove(v);if(E&&E.length)for(const v of E)t.node.classList.add(v);y=E}}d=void 0,h=null}else if(p&&t.node){if(y){for(const S of y)t.node.classList.remove(S);y=null,A=void 0}const x=Rt(p);if(x===null||x!==d||!bt(t.node,h)){d=x;const S=Xo(t,p);h=gt(t.node,S)}}else t.node&&_&&(d=void 0,h=null,t.node.style.display="")}finally{b&&(0,j.popConfig)()}},{depth:s.path.length,label:O(s,u)});s.__effects.push(g),s.__exec[r]=f}else if(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(r)){const f=t[r],l=R(t,t[r+"Deps"],f),u=r;let d,h=null;const y=(0,C.createEffect)(()=>{const A=t.context?.designSystem;A&&(0,j.pushConfig)(A);try{const g=l(t,t.state,t.context);if(t.node)if(g!=null){const b=u+":"+String(g);if(b!==d||!bt(t.node,h)){d=b;const w={[u]:g},p=Xo(t,w);h=gt(t.node,p)}}else d=void 0,h=null,t.node.style[u]=""}finally{A&&(0,j.popConfig)()}},{depth:s.path.length,label:O(s,u)});s.__effects.push(y),s.__exec[r]=f}else if(r.charCodeAt(0)===45){const f=t[r];Zo(t,r,f,t[r+"Deps"],r),s.__exec[r]=f}}if(xn(t),typeof t.html=="function"){const r=t.html,f=R(t,t.htmlDeps,r),l=(0,C.createEffect)(()=>{const u=t.context?.designSystem;u&&(0,j.pushConfig)(u);try{const d=f(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{u&&(0,j.popConfig)()}},{depth:s.path.length,label:O(s,"html")});s.__effects.push(l),s.__exec.html=r}if(typeof t.value=="function"){const r=t.value,f=R(t,t.valueDeps,r),l=(0,C.createEffect)(()=>{try{let u=f(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=M.replaceLiteralsWithObjectFields.call(t,u,t.state)),zo(t,u)}catch(u){N(s,"value",u)}},{depth:s.path.length,label:O(s,"value")});s.__effects.push(l),s.__exec.value=r}else if(typeof t.value=="string"&&t.value.includes("{{")){const r=t.value,f=(0,C.createEffect)(()=>{try{zo(t,M.replaceLiteralsWithObjectFields.call(t,r,t.state))}catch(l){N(s,"value",l)}},{depth:s.path.length,label:O(s,"value")});s.__effects.push(f),s.__exec.value=r}if(typeof t.style=="function"){const r=t.style,f=R(t,t.styleDeps,r);let l,u=null;const d=(0,C.createEffect)(()=>{const h=qt(t,f(t,t.state,t.context)),y=Rt(h);(y===null||y!==l||!bt(t.node,u))&&(l=y,Gt(t.node,u,h),J(t.node,h),u=gt(t.node,h))},{depth:s.path.length,label:O(s,"style")});s.__effects.push(d),s.__exec.style=r}else if(t.style&&typeof t.style=="object")for(const r in t.style){const f=t.style[r];if(typeof f!="function")continue;const l=R(t,yt(t.styleDeps,r),f);let u,d=null;const h=(0,C.createEffect)(()=>{try{const y=l(t,t.state,t.context);if(t.node){const A=r+":"+String(y);if(A!==u||!bt(t.node,d)){u=A;const g=qt(t,{[r]:y});Gt(t.node,d,Object.assign({},g,{[r]:""})),J(t.node,g),d=gt(t.node,g)}}}catch(y){N(s,"style."+r,y)}},{depth:s.path.length,label:O(s,"style."+r)});s.__effects.push(h)}if(t.attr&&typeof t.attr=="object"){for(const r in t.attr)if(typeof t.attr[r]=="function"){const f=R(t,yt(t.attrDeps,r),t.attr[r]),l=r,u=(0,C.createEffect)(()=>{try{let d=f(t,t.state,t.context);if(typeof d=="string"&&d.includes("{{")&&(d=M.replaceLiteralsWithObjectFields.call(t,d,t.state)),t.node?.setAttribute){const h=xt(t.node,l);d==null||d===!1&&!(0,k.isEnumeratedTrueFalseAttr)(l)?t.node.removeAttribute(l):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(l,(0,k.serializeAttrValue)(l,d)),wt(t.node,h)}}catch(d){N(s,"attr."+l,d)}},{depth:s.path.length,label:O(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[r]=="string"&&t.attr[r].includes("{{")){const f=t.attr[r],l=r,u=(0,C.createEffect)(()=>{try{const d=M.replaceLiteralsWithObjectFields.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(l,(0,k.serializeAttrValue)(l,d??""))}catch(d){N(s,"attr."+l,d)}},{depth:s.path.length,label:O(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const f=t.aria[r];if(typeof f=="string"&&f.includes("{{")){const h=f,y="aria-"+r.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),A=(0,C.createEffect)(()=>{try{const g=M.replaceLiteralsWithObjectFields.call(t,h,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,(0,k.serializeAttrValue)(y,g??""))}catch(g){N(s,"aria."+r,g)}},{depth:s.path.length,label:O(s,"aria."+r)});A._attrName=y,s.__effects.push(A);continue}if(typeof f!="function")continue;const l=R(t,yt(t.ariaDeps,r),t.aria[r]),u="aria-"+r.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),d=(0,C.createEffect)(()=>{try{const h=l(t,t.state,t.context);if(!t.node?.setAttribute)return;h==null?t.node.removeAttribute(u):typeof h!="function"&&typeof h!="object"&&t.node.setAttribute(u,(0,k.serializeAttrValue)(u,h))}catch(h){N(s,"aria."+r,h)}},{depth:s.path.length,label:O(s,"aria."+r)});d._attrName=u,s.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const r in t.data){const f=t.data[r];if(typeof f=="string"&&f.includes("{{")){const y=f,A="data-"+r.replace(/[A-Z]/g,b=>"-"+b.toLowerCase()),g=(0,C.createEffect)(()=>{try{const b=M.replaceLiteralsWithObjectFields.call(t,y,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(A,b??"")}catch(b){N(s,"data."+r,b)}},{depth:s.path.length,label:O(s,"data."+r)});g._attrName=A,s.__effects.push(g);continue}if(typeof f!="function")continue;const l=R(t,yt(t.dataDeps,r),t.data[r]),d="data-"+r.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),h=(0,C.createEffect)(()=>{try{const y=l(t,t.state,t.context);if(!t.node?.setAttribute)return;y==null||y===!1?t.node.removeAttribute(d):typeof y!="function"&&typeof y!="object"&&t.node.setAttribute(d,y===!0?"":y)}catch(y){N(s,"data."+r,y)}},{depth:s.path.length,label:O(s,"data."+r)});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 r in a){if(typeof a[r]!="function")continue;const f=R(t,yt(t.classDeps,r),a[r]),l=(0,C.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(r):t.node.classList.remove(r)}catch(u){N(s,"class."+r,u)}},{depth:s.path.length,label:O(s,"class."+r)});s.__effects.push(l)}!n&&typeof t.if=="function"&&Ko(t,s,t.if);for(const r of Object.keys(t)){if(B.REGISTRY.has(r)||typeof t[r]!="function")continue;const f=r.charCodeAt(0);if(f>=65&&f<=90||Q(r))continue;const l=t[r];s.__exec[r]=l;const u=t.tag||"div";if((0,k.checkAttributeByTagName)(u,r)&&!(0,K.isCssProp)(u,r)){const d=(0,k.camelToAttr)(r)||r,h=R(t,t[r+"Deps"],l),y=(0,C.createEffect)(()=>{try{let A=h(t,t.state,t.context);if(typeof A=="string"&&A.includes("{{")&&(A=M.replaceLiteralsWithObjectFields.call(t,A,t.state)),t.node?.setAttribute){const g=xt(t.node,d);A==null||A===!1&&!(0,k.isEnumeratedTrueFalseAttr)(d)?t.node.removeAttribute(d):typeof A!="function"&&typeof A!="object"&&(d==="src"&&"src"in t.node?t.node.src=A:t.node.setAttribute(d,(0,k.serializeAttrValue)(d,A))),wt(t.node,g)}}catch(A){N(s,r,A)}},{depth:s.path.length,label:O(s,r)});y._attrName=d.toLowerCase(),s.__effects.push(y)}}const c=t.tag||"div";for(const r of Object.keys(t)){if(B.REGISTRY.has(r))continue;const f=t[r];if(typeof f!="string"||!f.includes("{{"))continue;const l=r.charCodeAt(0);if(l>=65&&l<=90||Q(r)||(0,K.isCssProp)(c,r)||k.ATTR_TRANSFORMS[r]||!(0,k.checkAttributeByTagName)(c,r))continue;const u=(0,k.camelToAttr)(r)||r,d=(0,C.createEffect)(()=>{try{const h=M.replaceLiteralsWithObjectFields.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,(0,k.serializeAttrValue)(u,h??""))}catch(h){N(s,r,h)}},{depth:s.path.length,label:O(s,r)});d._attrName=u.toLowerCase(),s.__effects.push(d)}if(En(t),Fn(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const r=t.onStateUpdate,f=t.stateDeps;let l=!1,u=[];const d=(0,C.createEffect)(()=>{const h=[];for(let b=0;b<f.length;b++){const w=f[b];try{h[b]=typeof w=="function"?w(t,t.state,t.context):t.state?.[w]}catch{h[b]=void 0}}if(!l){l=!0,u=h;return}let y=h.length!==u.length;for(let b=0;!y&&b<h.length;b++)h[b]!==u[b]&&(y=!0);const A=u;if(u=h,!y)return;const g=t.context?.designSystem;g&&(0,j.pushConfig)(g);try{r(t,t.state,t.context,{prev:A,next:h})}catch(b){if(t.context?.plugins?.length&&(0,Y.runPluginHook)("error",t,{hook:"onStateUpdate",error:b})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',b),t.context?.strictMode)throw b}finally{g&&(0,j.popConfig)()}},{depth:s.path.length,label:O(s,"onStateUpdate")});s.__effects.push(d)}Ln(t)}function Wo(t){const o=t.parent,s=o?.node;if(!s||!t.node){ks(t,t.parent);return}let n=null;const e=Object.keys(o),i=e.indexOf(t.key);for(let a=i+1;a<e.length;a++){const c=o[e[a]];if(c?.node?.parentNode===s){n=c.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function Ko(t,o,s){let n=R(t,t.ifDeps,s);const e=(0,C.createEffect)(()=>{const i=!o.__ifInitialized&&o.__ifLateMerge;if(i){const r=t.context?.components||{};i.names.some(f=>r[f]||r["smbls."+f])&&(o.__ifLateMerge=null,Js(t,i),n=R(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=n(t,t.state,t.context)}catch(r){if(a=!1,o.__ifError=r,typeof console<"u"&&console.warn){const f=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${f} \u2014 treating as false:`,r?.message||r)}return}const c=o.__if;if(o.__if=!!a,c&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(r){console.error("[smbls] onRemove error:",r)}}else if(!c&&o.__if)if(o.__ifInitialized)t.node||(t.node=(0,ot.cacheNode)(t)),t.node&&(t.node.ref=t),Wo(t),ao(t),_o(t),F("Render",t,{}),so(t,{});else{if(o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=(0,ot.detectTag)(t)),F("Init",t,{}),t.node||(t.node=(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.tag==="fragment"&&!o.__fragmentAnchor){const f=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(f),o.__fragmentAnchor=f}F("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Ss(t,{}),Go(t,{skipIfEffect:!0}),ao(t),ps(t),_o(t),xs(t),Cs(t,{}),Wo(t),F("Create",t,{}),F("Complete",t,{}),F("Render",t,{}),F("RenderRouter",t,{}),so(t,{})}},{depth:o.path.length,label:O(o,"if")});o.__effects.push(e)}function Ft(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 e=t.__ref;let i=e?e.__textNode:null;if(i&&i.parentNode!==s&&(i=null),!i){const a=s.firstChild;a&&a.nodeType===3&&(i=a)}i?i.nodeValue!==n&&(i.nodeValue=n):s.firstChild?(i=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(i,s.firstChild)):(s.textContent=n,i=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),e&&(e.__textNode=i||null)}function xt(t,o){return o!=="checked"||!t||t.tagName!=="INPUT"?null:t.hasAttribute("checked")}function wt(t,o){if(o===null)return;const s=t.hasAttribute("checked");s!==o&&t.checked!==s&&(t.checked=s)}function zo(t,o){const s=t.node;if(!s||!("value"in s))return;const n=o==null?"":String(o);if(s.value===n)return;const e=typeof document<"u"&&document.activeElement===s,i=e&&typeof s.selectionStart=="number"?s.selectionStart:null,a=e&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,e&&i!=null&&a!=null)try{s.setSelectionRange(i,a)}catch{}const c=t.__ref&&t.__ref.__autoGrow;c&&c.active&&c.resize()}function ao(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Ft(t,t.text),ls(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 e in t.style)typeof t.style[e]!="function"&&(s[e]=t.style[e]);break}J(o,qt(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,k.isEnumeratedTrueFalseAttr)(s)||o.setAttribute&&o.setAttribute(s,(0,k.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 e=typeof s[n]=="function"?s[n](t,t.state,t.context):s[n];e&&o.classList.add(typeof e=="string"?e:n)}}}}function Rt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function An(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 gt(t,o){if(!t||!t.style||!o)return null;const s=t.style,n=[];for(const e in o){if(o[e]==null||e.charAt(0)==="&")continue;const a=X(e);n.push(a,uo(s,a),Yo(s,a))}return n}function uo(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function Yo(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function X(t){return ct(t)?t:t.replace(/[A-Z]/g,o=>"-"+o.toLowerCase())}function Gt(t,o,s){if(!t||!t.style||!o||!o.length)return;const n=t.style,e=new Set;if(s&&typeof s=="object")for(const i in s)s[i]==null||i.charAt(0)==="&"||e.add(X(i));for(let i=0;i<o.length;i+=3){const a=o[i];e.has(a)||uo(n,a)===o[i+1]&&typeof n.removeProperty=="function"&&n.removeProperty(a)}}function bt(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let n=0;n<o.length;n+=3)if(uo(s,o[n])!==o[n+1]||Yo(s,o[n])!==o[n+2])return!1;return!0}const ct=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,qo=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",Wt=t=>ct(t)?t:"--"+t;function Kt(t,o){if(!st(t))return null;let s=null;for(const n of Object.keys(t)){if(!n)continue;let e=t[n];if(typeof e=="function"){if(!o)continue;e=e(o,o.state,o.context)}qo(e)&&(s||(s={}),s[Wt(n)]=e)}return s}function Zo(t,o,s,n,e){const i=t.__ref,a=R(t,n,s);let c,r=null;const f=(0,C.createEffect)(()=>{const l=t.context?.designSystem;l&&(0,j.pushConfig)(l);try{const u=a(t,t.state,t.context),d=t.node;if(!d||!d.style)return;if(!qo(u)){Gt(d,r,null),c=void 0,r=null;return}const h=String(u);if(h!==c||!bt(d,r)){c=h;const y={[o]:u};J(d,y),r=gt(d,y)}}catch(u){N(i,e,u)}finally{l&&(0,j.popConfig)()}},{depth:i.path.length,label:O(i,e)});i.__effects.push(f)}function xn(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){wn(t,s),o.__exec.vars=s;return}if(st(s))for(const n of Object.keys(s)){const e=s[n];!n||typeof e!="function"||Zo(t,Wt(n),e,yt(t.varsDeps,n),"vars."+n)}}function wn(t,o){const s=t.__ref,n=R(t,t.varsDeps,o);let e,i=null;const a=(0,C.createEffect)(()=>{const c=t.context?.designSystem;c&&(0,j.pushConfig)(c);try{const r=Kt(n(t,t.state,t.context)),f=t.node;if(!f||!f.style)return;const l=Rt(r);(l===null||l!==e||!bt(f,i))&&(e=l,Gt(f,i,r),r&&J(f,r),i=r?gt(f,r):null,s.__varsInline=r?new Set(Object.keys(r)):null)}catch(r){N(s,"vars",r)}finally{c&&(0,j.popConfig)()}},{depth:s.path.length,label:O(s,"vars")});s.__effects.push(a)}function lo(t,o){if(typeof t[o]=="function"&&((0,K.isCssProp)(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!ct(o))return!1;const s=t.vars;if(typeof s=="function"){const n=t.__ref&&t.__ref.__varsInline;return!!(n&&n.has(o))}if(!st(s))return!1;for(const n of Object.keys(s))if(typeof s[n]=="function"&&Wt(n)===o)return!0;return!1}function Sn(t){let o=null;for(const s in t)t[s]!=null&&s.charAt(0)!=="&"&&(o||(o=new Set),o.add(X(s)));return o}function Cn(t,o,s,n){const e=t.__ref;if(!e)return;let i=null;if(s)for(const a of s){if(n&&n.has(a))continue;const c=o[a];if(c==null||typeof c=="object")continue;const r=X(a);q.CSS_LONGHAND_SHORTHANDS[r]&&(i||(i={}),i[r]=c)}e.__declaredLonghands=i}function Qo(t,o){const s=t.__ref,n=s&&s.__declaredLonghands;if(!n||!o)return null;let e=null;for(const i in n){if(o.has(i))continue;const a=q.CSS_LONGHAND_SHORTHANDS[i];let c=!1;for(let r=0;r<a.length;r++)if(o.has(a[r])){c=!0;break}c&&(e||(e={}),e[i]=n[i])}return e}function Xo(t,o){const s=t.node;J(s,o);const n=Sn(o);if(!n)return o;const e=t.__ref;if(e)if(e.__inlineCssKeys)for(const a of n)e.__inlineCssKeys.add(a);else e.__inlineCssKeys=new Set(n);const i=Qo(t,n);return i?(J(s,i),Object.assign({},o,i)):o}function kn(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=Qo(t,o.__inlineCssKeys);s&&J(t.node,s)}function qt(t,o){if(!o||typeof o!="object")return o;const s=t&&t.context&&t.context.designSystem;s&&(0,j.pushConfig)(s);try{return(0,P.resolveStyleBlockTokens)(o,t)}catch{return o}finally{s&&(0,j.popConfig)()}}function J(t,o){if(!t||!o||!t.style)return;let s=null;for(const n in o){const e=o[n];if(e!=null){if(n.charAt(0)==="&"&&typeof e=="object"){s||(s={}),s[n]=e;continue}try{const i=String(e),a=ct(n)?n:n.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),c=i.trim(),r=/\s*!important\s*$/.test(c),f=c.replace(/\s*!important\s*$/,"");t.style.setProperty(a,f,r?"important":"")}catch{}}}s&&vn(t,s)}function vn(t,o){const s=`_ds${vo.scopedStyleId++}`;t.classList.add(s);const n=t.ownerDocument;let e=n.querySelector("style[data-smbls-scoped]");e||(e=n.createElement("style"),e.setAttribute("data-smbls-scoped",""),n.head.appendChild(e));let i="";for(const a in o){const c="."+s,r=a.replace(/&/g,c).split(",").map(l=>{const u=l.trim();return u.includes(c)?u:c+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 y=d.includes("&")?r.split(", ").map(g=>d.replace(/&/g,g)).join(", "):r.split(", ").map(g=>`${g} ${d}`).join(", ");let A="";for(const g in h)A+=`${X(g)}: ${h[g]};`;u+=(0,tt.wrapHoverRule)(`${y} { ${A} }`,y)+`
|
|
5
|
-
`}else
|
|
6
|
-
`),u&&(i+=u)}}i&&(e.textContent+=i)}const Jo=new Set;function mo(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 jn(t,o,s){const n=mo(s);queueMicrotask(()=>{if(!t.__ref)return;let e;try{e=o(t,t.state,t.context)}catch{return}if(mo(e)===n)return;const i=t.__ref.path?t.__ref.path.join("."):t.key||"?";Jo.has(i)||(Jo.add(i),console.warn(`[smbls] subscribeTo function at "${i}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(e)?e.join(", "):String(e)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.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 En(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,nt.isLoudDevRuntime)()&&jn(t,o,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const e=t.__ref;for(let i=0;i<n.length;i++){const a=n[i];if(typeof a!="string"||a.length===0)continue;const c=a.split("."),r=c[0],f=c.slice(1),l={value:!1},u=(0,C.createEffect)(()=>{const d=t.state&&((0,I.isStore)(t.state)?t.state.root:null);if(!d||!(0,I.isStore)(d))return;let h=d;h=h[r];for(let A=0;A<f.length&&!(h==null||typeof h!="object");A++)if((0,I.isStore)(h))h=h[f[A]];else break;if(!l.value)return;let y=!1;if(typeof t.onBeforeUpdate=="function"){const A=t.context?.designSystem;A&&(0,j.pushConfig)(A);try{if(Os(e)){const g=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});g&&typeof g.then=="function"?g.then(()=>$t(e,!1),b=>{$t(e,!0),t.context?.plugins?.length&&(0,Y.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:b})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",b)}):($t(e,!1),g===!1&&(y=!0))}}catch(g){$t(e,!0),t.context?.plugins?.length&&(0,Y.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{A&&(0,j.popConfig)()}}if(!y&&t.node&&e.__effects)for(let A=0;A<e.__effects.length;A++){const g=e.__effects[A];g&&g!==u&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!y&&typeof t.onUpdate=="function"){const A=t.context?.designSystem;A&&(0,j.pushConfig)(A);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&(0,Y.runPluginHook)("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{A&&(0,j.popConfig)()}}},{depth:e.path.length,label:O(e,"subscribeTo("+a+")")});l.value=!0,u._isSubscribeToEffect=!0,e.__effects.push(u)}}function po(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 ho(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 ts=new Set;function Pn(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",n=s+"::"+t;ts.has(n)||(ts.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 os=new Map;function On(t){let o=os.get(t);if(o)return o;o=[];const s=n=>{if(n)for(const e of n)o.push(e.replace(/-([a-z])/g,(i,a)=>a.toUpperCase()))};return s(q.CSS_LONGHAND_SHORTHANDS[t]),s(q.CSS_SHORTHAND_LONGHANDS[t]),os.set(t,o),o}function ss(t,o,s){if(lo(t,o)||s&&s.has(o))return!0;const n=On(X(o));for(let e=0;e<n.length;e++){const i=n[e];if(lo(t,i)||s&&s.has(i))return!0}return!1}function At(t,o,s,n){const e={},i=new Set,a=(c,r,f)=>{const l=f?new Set(Object.keys(e)):null;if(P.CSS_PROPS_REGISTRY[c]){const u=P.CSS_PROPS_REGISTRY[c](r,o,o.state,o.context);if(u){const d=Array.isArray(u)?u:[u];for(const h of d)h&&Object.assign(e,h)}}else e[c]=r;if(f)for(const u in e)l.has(u)||i.add(u)};for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c))continue;let r=t[c];if(typeof r=="function"&&(r=r(o,o.state,o.context)),!(r==null||typeof r=="function")){if(typeof r=="object"&&!Array.isArray(r)){if(c==="style"){for(const u in r){let d=r[u];typeof d=="function"&&(d=d(o,o.state,o.context)),!(d==null||typeof d=="function")&&a(u,d,ss(o,u,n))}continue}if(c==="vars"){const u=Kt(r,o);if(u)for(const d in u)a(d,u[d],lo(o,d)||!!(n&&n.has(d)));continue}if(po(c,o)){const u=At(r,o,!1,n);Object.keys(u).length&&(e[`[data-theme="${c.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(c)){(0,nt.isLoudDevRuntime)()&&Pn(c,o);continue}const f=ho(c,o),l=At(r,o,!1,n);Object.keys(l).length&&(e[f]=l);continue}a(c,r,ss(o,c,n))}}if(s)for(const c in e)i.add(c);for(const c of i){const r=e[c];typeof r=="string"&&!r.includes("!important")&&(e[c]=r+" !important")}return e}const st=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function ns(t,o){for(const s in o){const n=o[s];t[s]=st(n)?ns(st(t[s])?t[s]:{},n):n}return t}function Tn(t,o){if(!st(o))return;let s;for(const n of t.split(" ")){const e=n?o[n]:null;st(e)&&(s=ns(s||{},e))}return s}function yo(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)&&yo(t[s],o+1))return!0}return!1}function es(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(po(t,s)){const i=At(o,s,!1);return Object.keys(i).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:i}:null}const n=ho(t,s),e=At(o,s,!1);return Object.keys(e).length?{cssProp:n,block:e}:null}function Ln(t){const o=t.__ref;for(const s of Object.keys(t)){if(!no(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!yo(n))continue;let e=null,i;const a=(0,C.createEffect)(()=>{if(!t.node)return;const c=t.context?.designSystem;c&&(0,j.pushConfig)(c);let r,f=!1;try{const l=es(s,n,t),u=l?Rt(l.block)+"::"+l.cssProp:null;if(u!==null&&u===i)f=!0;else if(i=u,l){const d=(0,tt.css)({[l.cssProp]:l.block},null,t.context?.cssPrefix);r=d?d.split(" ").filter(Boolean):null}else r=null}finally{c&&(0,j.popConfig)()}if(!(f||!t.node.classList)){if(e)for(const l of e)t.node.classList.remove(l);if(r&&r.length)for(const l of r)t.node.classList.add(l);e=r}},{depth:o.path.length,label:O(o,"cssBlock("+s+")")});o.__effects.push(a)}}const Dn=()=>!0,Rn=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!P.CSS_PROPS_REGISTRY[t]||!!(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(t))||ct(t)||t==="vars"};function Mn(t,o,s){const n={};let e=!1;for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&(c!=="data"&&c!=="aria"&&(Rn(c,s[c])||B.REGISTRY.has(c))?n[c]=!0:e=!0);if(!e)return null;const i=(0,k.extractConditionalAttrs)({[o]:s},t.tag||"div",n,Dn);let a=null;for(const c in i)/^on/i.test(c)||(a||(a={}),a[c]=i[c]);return a}function rs(t,o,s,n,e,i){const a=t.node;let c=null;const r=f=>{(c||(c=[])).push(f)};for(const f in n){const l=o.owners.get(f),u=l===s;if(!i&&l!==void 0&&!u)continue;let d;try{d=n[f](t)}catch(A){N(t.__ref,"conditional("+s+")."+f,A),u&&r(f);continue}if(typeof d=="string"&&d.includes("{{")&&(d=M.replaceLiteralsWithObjectFields.call(t,d,t.state)),u&&a.getAttribute(f)!==o.written.get(f)){r(f);continue}if(d==null||typeof d=="object"||typeof d=="function"){u&&is(a,o,f);continue}const h=d===!1&&!(0,k.isEnumeratedTrueFalseAttr)(f)?null:String((0,k.serializeAttrValue)(f,d));if(r(f),u&&h===o.written.get(f))continue;l===void 0&&o.base.set(f,a.getAttribute(f));const y=xt(a,f);h==null?a.removeAttribute(f):a.setAttribute(f,h),wt(a,y),o.owners.set(f,s),o.written.set(f,h)}e.appliedAttrs=c}function is(t,o,s){if(t.getAttribute(s)===o.written.get(s)){const n=o.base.get(s),e=xt(t,s);n==null?t.removeAttribute(s):t.setAttribute(s,n),wt(t,e)}o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function Nn(t,o,s,n){const e=n.appliedAttrs;if(n.appliedAttrs=null,!!e)for(const i of e)o.owners.get(i)===s&&is(t.node,o,i)}function _o(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 e=o.written.get(n),i=s.getAttribute(n);i!==e&&(o.base.set(n,i),e==null?s.removeAttribute(n):s.setAttribute(n,e))}}function Fn(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const n=new Map;for(const e of Object.keys(t)){const i=e.charAt(0);if(i!=="."&&i!=="!")continue;const a=e.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const g=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${i}\` is read as one prop name. Nest the selector inside instead: \`${i}${g}: { '${a.slice(g.length)}': {...} }\`.`)}continue}const c=t[e];if(!c||typeof c!="object")continue;const r=i==="!",f={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null},l=Mn(t,e,c);l&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const g in c){if(!Object.prototype.hasOwnProperty.call(c,g))continue;const b=g.charAt(0),w=c[g];if(!((b===":"||b==="@"||b==="&"||b==="[")&&w&&typeof w=="object"&&!Array.isArray(w))){if(g==="vars"&&st(w)){for(const p of Object.keys(w))p&&u.add(Wt(p));continue}u.add(g)}}const d=()=>{let g;const b=t[a];if(b===void 0){const _=!!t.state&&a in t.state,x=t.state?t.state[a]:void 0;if(_||x!==void 0)g=x;else{const S=t.context?.cases?.[a];if(S===void 0)return;try{g=typeof S=="function"?S.call(t,t):S}catch(E){g=!1,o.__conditionalError=E,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,E?.message||E)}}}else if(typeof b=="function")try{g=b(t,t.state,t.context)}catch(_){g=!1,o.__conditionalError=_,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,_?.message||_)}else g=b;const w=r?!g:!!g;if(!t.node)return;const p=t.context?.designSystem;if(w===f.lastMatch){if(w&&l&&t.node.setAttribute){p&&(0,j.pushConfig)(p);try{rs(t,s,e,l,f,!1)}finally{p&&(0,j.popConfig)()}}return}f.lastMatch=w,p&&(0,j.pushConfig)(p);try{if(w){const _={},x={};let S=!1;for(const v in c){if(!Object.prototype.hasOwnProperty.call(c,v))continue;const $=c[v],et=v.charAt(0);if((et===":"||et==="@"||et==="&"||et==="[")&&$&&typeof $=="object"&&!Array.isArray($)){if(po(v,t)){const L=At($,t,!1,u);Object.keys(L).length&&(x[`[data-theme="${v.slice(1)}"] &`]=L,S=!0)}else{const L=ho(v,t),U=At($,t,!1,u);Object.keys(U).length&&(x[L]=U,S=!0)}continue}const rt=typeof $=="function"?$(t,t.state,t.context):$;if(rt!=null){if(P.CSS_PROPS_REGISTRY[v]){const L=P.CSS_PROPS_REGISTRY[v](rt,t,t.state,t.context);if(L){const U=Array.isArray(L)?L:[L];for(const Ct of U)Ct&&Object.assign(_,Ct)}}else if(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(v))_[v]=rt;else if(ct(v))_[v]=rt;else if(v==="vars"){const L=Kt(rt,t);L&&Object.assign(_,L)}}}const E=Object.keys(_);if(E.length){J(t.node,_);for(const v of E)n.set(v,e);f.appliedKeys=E}else f.appliedKeys=null;if(S){const v=(0,tt.css)(x,null,t.context?.cssPrefix,{state:!0}),$=v?v.split(" ").filter(Boolean):[];if($.length&&t.node.classList){for(const et of $)t.node.classList.add(et);f.appliedClasses=$}else f.appliedClasses=null}else if(f.appliedClasses){for(const v of f.appliedClasses)t.node.classList.remove(v);f.appliedClasses=null}l&&t.node.setAttribute&&rs(t,s,e,l,f,!0)}else{if(f.appliedAttrs&&Nn(t,s,e,f),f.appliedKeys){for(const _ of f.appliedKeys)n.get(_)===e&&(ct(_)?t.node.style.removeProperty(_):t.node.style[_]="",n.delete(_));f.appliedKeys=null}if(f.appliedClasses){for(const _ of f.appliedClasses)t.node.classList.remove(_);f.appliedClasses=null}}}finally{p&&(0,j.popConfig)()}};o.__conditionalRunners.push(d);const h=R(t,t[a+"Deps"],d),y=(0,C.createEffect)(h,{depth:o.path.length,label:O(o,"conditional("+e+")")}),A=o.__exec&&o.__exec[a]||t[a];y._sources.size===0&&typeof A=="function"&&(0,nt.isLoudDevRuntime)()&&rn(A)&&console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${a}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),o.__effects.push(y)}}const go=new WeakSet,cs=new WeakSet,fs=new WeakSet;function $n(t){if(fs.has(t))return!1;if(!cs.has(t)){cs.add(t);const o=t.defaultView,s=()=>{fs.add(t)};o&&typeof o.requestAnimationFrame=="function"?o.requestAnimationFrame(s):setTimeout(s,0)}return!0}function In(t){const o=t.ownerDocument;!o||go.has(o)||$n(o)||(go.add(o),queueMicrotask(()=>{go.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const bo=new WeakSet;let as=!1;function us(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Ao(t,o){const s={...t};for(const n in o){const e=o[n],i=s[n];s[n]=e&&typeof e=="object"&&i&&typeof i=="object"?Ao(i,e):e}return s}function ds(t,o){const s={};for(const n in t){const e=t[n];if(e&&typeof e=="object"){const i=ds(e,o);Object.keys(i).length&&(s[n]=i)}else o.has(n)||(s[n]=e)}return s}function Un(t,o,s){let n=null;for(const[e,i]of o){const a=X(e),c=q.CSS_LONGHAND_SHORTHANDS[a];if(c)for(let r=0;r<c.length;r++){const f=c[r].replace(/-([a-z])/g,(y,A)=>A.toUpperCase()),l=t[f]!=null?o.get(f):void 0,u=s&&s.get(c[r]),d=l!==void 0&&l>i&&(0,q.cssShorthandStatesLonghand)(c[r],t[f],a),h=!d&&u!==void 0&&u>i&&(0,q.cssShorthandStatesLonghand)(c[r],void 0,a);if(d||h){d&&delete t[e],n||(n=new Set),n.add(e);break}}}return n}function ls(t){const{node:o}=t;if(!o)return;if(as||(as=!0,(0,tt.css)({display:"none"})),bo.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}bo.add(t);const s=t.context?.designSystem;s&&(0,j.pushConfig)(s),(0,P.pushStaticCssPass)();try{const n={};let e=!1,i=[],a=null,c=null,r=null;const f=t.__ref&&t.__ref.__mergeLayer;let l,u=null,d=null;const h=(p,_)=>{if(_&&typeof _=="object"&&us(p)){c||(c={});const x=c[p];x&&(_=Ao(x,_)),c[p]=_}else(_===null||typeof _!="object")&&(r||(r=new Set),r.add(p),l!==void 0&&(u||(u=new Map),u.set(p,l)));n[p]=_};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&P.CSS_PROPS_REGISTRY.theme){const p=P.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(p){const _=x=>{for(const S in x){const E=x[S];E&&typeof E=="object"&&us(S)&&(a||(a={}),a[S]=E),n[S]=E}};if(Array.isArray(p))for(const x of p)x&&_(x);else _(p);e=!0}}const y=(p,_)=>{if(p==="vars"){const x=Kt(_);if(x){for(const S in x)h(S,x[S]);e=!0}return}if(P.CSS_PROPS_REGISTRY[p]){const x=P.CSS_PROPS_REGISTRY[p](_,t,t.state,t.context);if(x){if(Array.isArray(x)){for(const S of x)if(S)for(const E in S)h(E,S[E])}else for(const S in x)h(S,x[S]);e=!0}}else if(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(p))_!=null&&typeof _!="object"&&(h(p,_),e=!0);else if(p.charCodeAt(0)===45)_!=null&&typeof _!="object"&&(h(p,_),e=!0);else if((p.charAt(0)==="&"||p.charAt(0)==="@"||p.charAt(0)===":"||p.charAt(0)==="[")&&_&&typeof _=="object"&&!Array.isArray(_)){if(yo(_))return;const x=es(p,_,t);x&&(h(x.cssProp,x.block),e=!0)}};if(typeof t.class=="string"){const p=Tn(t.class,t.context?.designSystem?.class);if(p)for(const _ in p)y(_,p[_])}const A=r?new Set(r):null,g=t.tag||"div";for(const p of Object.keys(t)){if(typeof t[p]=="function"){const x=f&&f.get(p);x!==void 0&&(0,K.isCssProp)(g,p)&&(d||(d=new Map),d.set(X(p),x));continue}if(l=f?f.get(p):void 0,p==="vars"){y(p,t[p]);continue}if(B.REGISTRY.has(p)||p==="theme")continue;const _=p.charCodeAt(0);_>=65&&_<=90||Q(p)||(0,K.isAttributeFirst)(g,p)||y(p,t[p])}l=void 0;const b=u?Un(n,u,d):null;if(a)for(const p in a){let _=r?ds(a[p],r):a[p];c&&c[p]&&(_=Ao(_,c[p])),Object.keys(_).length?n[p]=_:delete n[p]}if(Cn(t,n,r,b?new Set([...A||[],...b]):A),e){n.display&&String(n.display).includes("!important")&&(o.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const p=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof p=="string"&&p!==""&&n.display&&n.display!==p&&(n.display=p);const _=(0,tt.css)(n,null,t.context?.cssPrefix);if(i=_?_.split(" ").filter(Boolean):[],_&&o.classList){const x=i;let S=!1;for(const E of x)o.classList.add(E),S||(E.charCodeAt(0)===95&&E.charCodeAt(1)===99||E.charCodeAt(0)===95&&E.indexOf("_c",1)!==-1)&&(S=!0);S&&In(o)}}const w=t.__ref;if(w){const p=w.__staticCssClasses;if(p&&o.classList){const _=new Set(i);for(const x of p)_.has(x)||o.classList.remove(x)}w.__staticCssClasses=i}kn(t)}finally{(0,P.popStaticCssPass)(),s&&(0,j.popConfig)(),bo.delete(t)}}const Bn=t=>!!P.CSS_PROPS_REGISTRY[t]||!!(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function Hn(t){t&&t.node&&ls(t)}function ps(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const e in t.aria){const i=t.aria[e];if(typeof i=="function"||typeof i=="object"||i==null||typeof i=="string"&&i.includes("{{"))continue;const a="aria-"+e.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());o.setAttribute(a,(0,k.serializeAttrValue)(a,i))}const s=(0,k.applyAttrTransforms)(t);for(const e in s){const i=s[e];i!=null&&i!==!1&&typeof i!="function"&&typeof i!="object"&&o.setAttribute(e,i===!0?"":i)}const n=t.tag||"div";for(const e of Object.keys(t)){if(typeof t[e]=="function"||B.REGISTRY.has(e)||e==="on"||s[e]!==void 0)continue;const i=e.charCodeAt(0);if(!(i>=65&&i<=90)&&!Q(e)&&!(0,K.isCssProp)(n,e)&&(0,k.checkAttributeByTagName)(n,e)){let a=t[e];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!k.ATTR_TRANSFORMS[e])continue;a=M.replaceLiteralsWithObjectFields.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!(0,k.isEnumeratedTrueFalseAttr)((0,k.camelToAttr)(e)||e))continue;const c=(0,k.camelToAttr)(e)||e;o.setAttribute(c,(0,k.serializeAttrValue)(c,a))}}}function Vn(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const n=o.charCodeAt(0);if(n>=65&&n<=90||Q(o))return;const e=t.tag||"div";if((0,K.isCssProp)(e,o)||!(0,k.checkAttributeByTagName)(e,o))return;const i=(0,k.camelToAttr)(o)||o,a=i.toLowerCase(),c=t.__ref&&t.__ref.__effects;let r=!1;if(c)for(let d=0;d<c.length;d++){const h=c[d];h&&h._attrName===a&&!h._disposed&&typeof h._execute=="function"&&(r=!0,h._execute())}if(r)return;let f=t[o];const l=k.ATTR_TRANSFORMS[o];if(l&&f!=null){const d=l(t);d!==void 0&&(f=d)}typeof f=="string"&&f.includes("{{")&&(f=M.replaceLiteralsWithObjectFields.call(t,f,t.state));const u=xt(s,i);f==null||f===!1&&!(0,k.isEnumeratedTrueFalseAttr)(i)?s.removeAttribute(i):typeof f!="function"&&typeof f!="object"&&s.setAttribute(i,(0,k.serializeAttrValue)(i,f)),wt(s,u)}function Gn(t,o){const s=t.node,n=t.__ref;let e=n.__autoGrow;if(!o){if(e&&e.active){try{s.removeEventListener("input",e.resize)}catch{}ys(e),it.delete(t),s.style.height="",e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""),bs(s,e,!1),e.active=!1,e.appliedMax=null,e.lastMeasure=0}return}e||(e=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){Mt(t,!0);return}if(!(s.scrollHeight>0)){e.awaitingLayout=!0,hs(t,e);return}e.awaitingLayout=!1;const a=zn(s),c=Yn(a),r=s.style.height;s.style.height="0px",c&&wo(s);const f=s.scrollHeight;if(!(f>0)){s.style.height=r,c&&wo(s);return}const l=qn(s,a),u=l!=null&&f<l?l:f,d=Xn(a),h=d!=null&&u>d;s.style.height=Qn(h?d:u,a)+"px",c&&wo(s),bs(s,e,h),e.lastMeasure=f,e.lastWidth=s.clientWidth,hs(t,e)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",e.resize)}catch{}ys(e),it.delete(t)})),e.active||(s.addEventListener("input",e.resize),e.active=!0,Kn(t,e));const i=typeof o=="object"&&o.max!=null?String(o.max):null;i!==e.appliedMax&&(i==null?e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=i,e.appliedMax=i),e.resize()}function Mt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),it.add(t),Bt())}function Wn(){const t=Array.from(it);it.clear();for(let o=0;o<t.length;o++){const s=t[o],n=s.node,e=s.__ref?.__autoGrow;if(!(!n||!e||!e.active)){if(!n.isConnected){e.firstAttemptAt==null&&(e.firstAttemptAt=ht()),e.attachAttempts+=1,e.attachAttempts<=Po&&ht()-e.firstAttemptAt<Oo&&(it.add(s),Bt());continue}e.attachAttempts=0,e.firstAttemptAt=null,e.resize()}}}function hs(t,o){if(o.watch)return;const s=t.node;if(!s)return;const n=s.ownerDocument&&s.ownerDocument.defaultView,e=n&&n.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof e!="function")return;const i=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Mt(t,!0);return}const c=s.clientWidth;o.lastWidth!=null&&Math.abs(c-o.lastWidth)<.5||(o.lastWidth=c,Mt(t,!0))};let a;try{a=new e(i),a.observe(s)}catch{return}o.watch=a}function ys(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function Kn(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&&Mt(t,!0)},()=>{})}function zn(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,xo=t=>(ft(t.paddingTop)||0)+(ft(t.paddingBottom)||0),_s=t=>(ft(t.borderTopWidth)||0)+(ft(t.borderBottomWidth)||0);function Yn(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 e=o[n].trim();if(!(e!=="all"&&e!=="height")&&parseFloat(s[n%s.length])>0)return!0}return!1}function wo(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 qn(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)||Zn(t,o);return n>0?s*n+xo(o):null}const Nt=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],gs=new WeakMap;function Zn(t,o){const s=t.ownerDocument,n=s&&(s.body||s.documentElement);if(!n||!s.createElement)return null;let e=gs.get(s);e||(e=new Map,gs.set(s,e));const i=Nt.map(f=>o[f]||"").join("|");if(e.has(i))return e.get(i);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const c=a.style;c.position="absolute",c.visibility="hidden",c.top="0",c.left="-9999px",c.height="auto",c.minHeight="0",c.maxHeight="none",c.padding="0",c.border="0",c.boxSizing="content-box",c.overflow="hidden";for(let f=0;f<Nt.length;f++)o[Nt[f]]&&(c[Nt[f]]=o[Nt[f]]);let r=0;try{n.appendChild(a),r=a.clientHeight}catch{r=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return r>0?(e.set(i,r),r):null}function Qn(t,o){return o?o.boxSizing==="border-box"?t+_s(o):o.boxSizing==="content-box"?Math.max(0,t-xo(o)):t:t}function Xn(t){if(!t)return null;const o=ft(t.maxHeight);if(o==null||!(o>0))return null;const s=xo(t),n=_s(t),e=t.boxSizing==="border-box"?o-n:o+s,i=ft(t.lineHeight);if(!(i>0))return e;const a=Math.floor((e-s)/i+1e-6);return a>=1?a*i+s:e}function bs(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 As=["srcObject","muted"],Jn=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function mn(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let n=0;n<As.length;n++){const e=As[n],i=t[e];if(i===void 0||!(e in o))continue;const a=c=>{const r=Jn(e,c);if(o[e]!==r)try{o[e]=r}catch(f){N(s,e,f)}};if(typeof i=="function"){const c=R(t,t[e+"Deps"],i),r=(0,C.createEffect)(()=>{try{a(c(t,t.state,t.context))}catch(f){N(s,e,f)}},{depth:s.path.length,label:O(s,e)});s.__effects.push(r),s.__exec[e]=i}else a(i);e==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function xs(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const s=t.__ref,n=t.autoGrow,e=typeof n=="function"?R(t,t.autoGrowDeps,n):null,i=(0,C.createEffect)(()=>{const a=t.autoGrow;let c=a;if(typeof a=="function")try{c=(a===n&&e?e:a)(t,t.state,t.context)}catch{c=null}Gn(t,c)},{depth:s.path.length,label:O(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(i),e&&(s.__exec.autoGrow=n)}const ws=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Ss(t,o){for(const s of Object.keys(t)){if(!Q(s)||ws.has(s))continue;const n=(0,St.globalEventKeyInfo)(s);if(n){(0,St.registerGlobalEvent)(n,t,t[s]);continue}let e=t[s],i=null;if(e&&typeof e=="object"&&!Array.isArray(e)&&(i=e,e=i.handler),typeof e=="string"&&/^[A-Za-z_$][\w$]*$/.test(e)){const c=e;e=function(f){return t.call(c,f)}}if(typeof e!="function")continue;const a=Ys(s);B.LIFECYCLE_EVENTS.has(a)||(0,St.registerEvent)(qs(a),t,e,i)}te(t)}function te(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let n=!1;for(const d of ws){const h=t[d];typeof h=="function"&&(s[d]=h,n=!0)}if(!n)return;const e=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,i=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,c=0,r=0,f=!1;const l=d=>{const h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(a=h.clientX,c=h.clientY,r=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 y=h.clientX-a,A=h.clientY-c,g=Date.now()-r;if(g>i)return;const b=Math.abs(y),w=Math.abs(A);if(Math.max(b,w)<e)return;let p;if(b>w*1.2)p=y<0?"left":"right";else if(w>b*1.2)p=A<0?"up":"down";else return;const _="onSwipe"+p.charAt(0).toUpperCase()+p.slice(1),x=s[_],S=s.onSwipe;x&&x.call(t,d,t,t.state,t.context),S&&S.call(t,{direction:p,dx:y,dy:A,dt:g,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 at(t,o){const s={...t};for(const n in o){const e=s[n],i=o[n];e&&i&&typeof e=="object"&&typeof i=="object"&&!Array.isArray(e)&&!Array.isArray(i)&&typeof e!="function"&&typeof i!="function"?s[n]=at(e,i):s[n]=i}return s}function So(t,o,s,n,e){if(!o||!t.node)return;const i=t.childExtends,a=_t(t,"childProps");if(Array.isArray(o)){const c=t.tag==="fragment",r=t.context?.document||globalThis.document,f=c?null:r?.createDocumentFragment();if(!c&&!f)return;const l=t.childProps,u=t.childrenAs,d=w=>{let p=o[w];const _=p;(typeof p=="string"||typeof p=="number")&&(p={text:p});let x=l;if(typeof l=="function")try{x=l(t,p)}catch{x=null}let S=typeof l=="function"?Tt(x):a;if(e&&u!=="state"&&(S=Lt(S,Tt(_))),u==="state"){let v=_;(typeof _=="string"||typeof _=="number")&&(v={value:_,text:_}),p=x?{...x,state:v}:{state:v}}else x&&(p=at(x,p));if(i&&!p.ignoreChildExtends)if(p.extends){const v=Array.isArray(p.extends)?p.extends:[p.extends],$=Array.isArray(i)?i:[i];p={...p,extends:[...$,...v]}}else p={...p,extends:i};const E=Lo(p?.key,_,w,t);try{return m(Dt(p,S),t,E,s)}catch(v){if(typeof console<"u"&&console.error){const $=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${E}" failed to construct at ${$} (initial render, skipping this row):`,v?.message||v)}return null}},h=t.__ref;if(!(n===!0&&!c&&!!h&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let w=0;w<o.length;w++){const p=d(w);!c&&p?.node&&f.appendChild(p.node)}return c||t.node.appendChild(f),!0}const A=h.__childrenChunkGen=(h.__childrenChunkGen||0)+1;(0,G.openMountBudget)();let g=null;const b=w=>{if(h.__disposed||h.__childrenChunkGen!==A){g&&g.parentNode&&g.remove();return}for(let p=w;p<o.length;p++){const _=d(p);if(_?.node&&(g?t.node.insertBefore(_.node,g):f.appendChild(_.node)),p+1<o.length&&(0,G.mountBudgetExhausted)()){g||(g=r.createComment("smbls-mount"),f.appendChild(g),t.node.appendChild(f));const x=p+1;(0,G.enqueueMountWork)(()=>b(x));return}}g?(g.remove(),t.node.tagName==="SELECT"&&zt(t,!0)):t.node.appendChild(f)};return b(0),(0,G.closeMountBudget)(),!0}if(typeof o=="string"){const c=Mo(o,t);if(Array.isArray(c))return So(t,c,s,n,!0)}if(typeof o=="object")for(const c in o){if(B.REGISTRY.has(c))continue;let r=o[c];if(r==null||r===!1)continue;const f=e?Lt(a,Tt(r)):a;if((typeof r=="string"||typeof r=="number")&&(r={text:r}),t.childProps&&(r=at(t.childProps,r)),i&&!r.ignoreChildExtends)if(r.extends){const l=Array.isArray(r.extends)?r.extends:[r.extends],u=Array.isArray(i)?i:[i];r={...r,extends:[...u,...l]}}else r={...r,extends:i};m(Dt(r,f),t,Vt(t,c),s)}}function zt(t,o){const s=t.node;if(!s||s.tagName!=="SELECT")return;const n=s.options;if(!n||!n.length)return;const e=t.__ref,i=e&&e.__exec&&e.__exec.value,a=typeof i=="function",c=t.value!=null&&typeof t.value!="function";if(a||c){let l;if(a)try{l=i(t,t.state,t.context)}catch{return}else l=t.value,typeof l=="string"&&l.includes("{{")&&(l=M.replaceLiteralsWithObjectFields.call(t,l,t.state));const u=l==null?"":String(l);s.value!==u&&(s.value=u);return}const r=o||!(e&&e.__selectSynced);if(e&&(e.__selectSynced=!0),!r)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 Cs(t,o){let{children:s,content:n}=t;const e=t.childExtends,i=typeof s=="function"||Bo(t,"children");if(typeof s=="function"){const y=s;try{s=y(t,t.state,t.context)}catch(p){if(s=void 0,typeof console<"u"&&console.error){const _=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${_} (initial run, treating as empty):`,p?.message||p)}}Ho(t,s),t.children=s;const A=t.__ref;let g=!1;const b=R(t,t.childrenDeps,y),w=(0,C.createEffect)(()=>{const p=g;g=!0;let _;try{_=b(t,t.state,t.context)}catch(L){if(typeof console<"u"&&console.error){const U=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${U}${p?"":" (initial tracking run)"}:`,L?.message||L)}return}if(!p||_===t.children)return;Ho(t,_),t.children=_,A.__childrenChunkGen!=null&&A.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",S=x?[]:null,E=x?[]:null,v=x?[]:null;if(Array.isArray(_)&&t.childrenAs==="state"){const L=t.childProps,U=[],Ct=new Map;for(let T=0;T<_.length;T++){const W=_[T];let D=L;if(typeof L=="function")try{D=L(t,W)}catch{D=null}const Z=Lo(D&&D.key,W,T,t);U.push(Z),Ct.set(Z,{rawChild:W,childProps:D})}const Ts=new Set(U),Ls=A.__children.slice();for(const T of Ls)if(!Ts.has(T)){const W=t[T];W?.remove&&W.remove(),delete t[T],E&&E.push(T)}const kt=t.childExtends,It=t.tag==="fragment",Ds=t.context?.document||globalThis.document,vt=It?null:Ds?.createDocumentFragment(),Xt=new Set;for(const T of U){const W=Ct.get(T),D=W.rawChild,Z=t[T];if(Z&&Z.state){if(D&&typeof D=="object"){const H=Z.state,dt=H.$replace||H.replace,Co=H.$update||H.update;try{if(typeof dt=="function")dt.call(H,D);else if(typeof Co=="function"){for(const V in H)if(!(V==="__element"||V==="root"||V==="parent"||V==="update")&&!Object.prototype.hasOwnProperty.call(D,V))try{H[V]=void 0}catch{}Co.call(H,D)}else for(const V in D)H[V]=D[V]}catch(V){if(typeof console<"u"&&console.error){const Ms=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to patch at ${Ms} (reconcile, keeping its previous data for this pass):`,V?.message||V)}}}v&&v.push(T);continue}let Jt=D;(typeof D=="string"||typeof D=="number")&&(Jt={value:D,text:D});const mt=W.childProps;let z=mt?{...mt,state:Jt}:{state:Jt};const Rs=typeof L=="function"?Tt(mt):_t(t,"childProps");if(kt&&!z.ignoreChildExtends)if(z.extends){const H=Array.isArray(z.extends)?z.extends:[z.extends],dt=Array.isArray(kt)?kt:[kt];z={...z,extends:[...dt,...H]}}else z={...z,extends:kt};let to;try{to=m(Dt(z,Rs),t,T,o)}catch(H){if(typeof console<"u"&&console.error){const dt=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to construct at ${dt} (reconcile, skipping this row):`,H?.message||H)}Xt.add(T);continue}!It&&to?.node&&vt&&vt.appendChild(to.node),S&&S.push(T)}if(!It&&vt&&vt.childNodes.length&&t.node&&t.node.appendChild(vt),!It&&t.node){let T=null;for(const W of U){const D=t[W]?.node;if(!D)continue;const Z=T?T.nextSibling:t.node.firstChild;D!==Z&&t.node.insertBefore(D,Z),T=D}}A.__children=Xt.size?U.filter(T=>!Xt.has(T)):U,x&&(S.length||E.length)&&To(t,{added:S,removed:E,kept:v}),zt(t,!1);return}const rt=x?[...A.__children]:null;for(const L of[...A.__children]){const U=t[L];U?.remove&&U.remove(),delete t[L]}A.__children=[],So(t,_,o,!1,!0),zt(t,!1),x&&To(t,{added:[...A.__children],removed:rt,kept:[]})},{depth:A.path.length,label:O(A,"children")});A.__effects.push(w)}const a=So(t,s,o,!0,i);if(n!=null&&!(n&&n.__ref)){let y=n;if(typeof y=="string"||typeof y=="number"?y={text:y}:typeof y!="object"&&(y={}),t.childProps&&(y=at(t.childProps,y)),e&&!y.ignoreChildExtends)if(y.extends){const g=Array.isArray(y.extends)?y.extends:[y.extends],b=Array.isArray(e)?e:[e];y={...y,extends:[...b,...g]}}else y={...y,extends:e};const A=Lt(_t(t,"childProps"),_t(t,"content"));m(Dt(y,A),t,"content",o)}if(s&&!a)return;const c=t.context?.components||{},r=t.__ref&&t.__ref.__runtimeSource,f=r?{}:null;{const y=Object.keys(t);for(let A=0;A<y.length;A++){const g=y[A];if(!g.endsWith("Extends")||typeof t[g]!="string")continue;const b=g.slice(0,-7);if(!b||b.charCodeAt(0)<65||b.charCodeAt(0)>90)continue;const w={extends:t[g]};delete t[g];for(let p=A+1;p<y.length;p++){const _=y[p],x=_.charCodeAt(0);if(x>=65&&x<=90||B.REGISTRY.has(_)||typeof t[_]=="function"&&(_.startsWith("on")||_.startsWith(".")))break;const S=t[_];S!==void 0&&(w[_]=S,delete t[_],f&&Ot(r,_)&&(f[b]||(f[b]={}),f[b][_]=r[_]))}t[b]&&typeof t[b]=="object"?t[b]={...w,...t[b]}:t[b]=w}}const l=o?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),d=y=>{if(B.REGISTRY.has(y)||typeof t[y]!="object"||t[y]===null)return;const A=y.charCodeAt(0);if(A<65||A>90)return;let g=t[y];if(g.__ref)return;if(!g.extends&&!g.extend){const w=c[y]||c[`smbls.${y}`];w&&(g={...g,extends:w})}if(t.childProps&&(g=at(t.childProps,g)),e&&!g.ignoreChildExtends)if(g.extends){const w=Array.isArray(g.extends)?g.extends:[g.extends],p=Array.isArray(e)?e:[e];g={...g,extends:[...p,...w]}}else g={...g,extends:e};const b=r?Lt(_t(t,"childProps"),Lt(f[y]||null,_t(t,y))):null;m(Dt(g,b),t,y,o)};if(!l){for(const y of u)d(y);return}(0,G.openMountBudget)();const h=y=>{for(let A=y;A<u.length;A++)if(d(u[A]),A+1<u.length&&(0,G.mountBudgetExhausted)()){const g=A+1;(0,G.enqueueMountWork)(()=>h(g));return}};h(0),(0,G.closeMountBudget)()}function ks(t,o,s){const{node:n}=t;if(!n)return;n.ref=t;const e=o?.tag==="fragment"?o.__ref?.__fragmentAnchor:null;if(e){const a=e.parentNode;if(a){if(s?.position==="before"&&s.node)a.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const c=s.node.nextSibling;a.insertBefore(n,c||e)}else a.insertBefore(n,e);return}}const i=o?.node||(o?.nodeType?o:null);if(i)if(s?.position==="before"&&s.node)i.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;a?i.insertBefore(n,a):i.appendChild(n)}else i.appendChild(n)}const Zt=3;function Os(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Zt?!1:(t.__inBeforeUpdate=!0,!0)}function $t(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Zt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Zt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function F(t,o,s){const n=t.charAt(0).toLowerCase()+t.slice(1);o.context?.plugins?.length&&(0,Y.runPluginHook)(n,o,s);const e="on"+t,i=o[e];if(typeof i=="function"){const r=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(r){if(o.__ref[r])return!0;o.__ref[r]=!0}const f=o.context?.designSystem;f&&(0,j.pushConfig)(f);let l=!!r;try{const u=i(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const d=o.__ref;return u.catch(h=>{o.context?.plugins?.length&&(0,Y.runPluginHook)("error",o,{hook:e,error:h})||console.error(`[DOMQL] Lifecycle "${e}" error:`,h)}).finally(()=>{r&&d&&(d[r]=!1)}),l=!1,!0}if(u===!1)return!1}catch(u){if(o.context?.plugins?.length&&(0,Y.runPluginHook)("error",o,{hook:e,error:u})||console.error(`[DOMQL] Lifecycle "${e}" error:`,u),o.context?.strictMode)throw u}finally{f&&(0,j.popConfig)(),l&&o.__ref&&(o.__ref[r]=!1)}}return!0}var oe=m;
|
|
4
|
+
`):"")}}if(qt(r,!0),Ds(r,o,e),typeof r.html=="function"&&r.node&&!r.node.innerHTML&&(0,G.withDesignSystem)(r,()=>{try{const u=r.html(r,r.state,r.context);u!=null&&typeof u!="function"&&(r.node.innerHTML=u)}catch{}}),N("Create",r,n),N("Complete",r,n),N("Render",r,n),N("RenderRouter",r,n),so(r,n),typeof r.onFrame=="function"){const u=r.onFrame,l=r.context?.designSystem,_=()=>{if(r.node){if(r.node.isConnected){l&&(0,M.pushConfig)(l);try{u(r,r.state,r.context)}catch(g){console.error("[DOMQL] onFrame error:",g)}finally{l&&(0,M.popConfig)()}}requestAnimationFrame(_)}};requestAnimationFrame(_)}return r}const Mo=new Set(["childProps","attr","style","scope","data","vars"]);function No(t,o,s,n,e,c){if(s&&!o.extends&&!o.extend){const y=s.indexOf("_"),p=s.indexOf(".");let A=y>0?y:-1;if(p>0&&(A<0||p<A)&&(A=p),A>0){const w=s.substring(0,A),h=t.context?.components;h&&(h[w]||h["smbls."+w])?o={...o,extends:w}:h&&(0,et.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 "${w}" but neither "${w}" nor "smbls.${w}" 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,At.applyExtends)(t,o,c);const a=(0,At.openMergeLayer)(t),r=t.props&&typeof t.props=="object"?t.props:null;for(const y in o){if(y==="parent"||y==="node"||y==="__ref"||y==="extends"||y==="context"||y==="props")continue;if(y==="key"){n&&(t.key=e?Kt(e,n):n);continue}const p=o[y];a&&a.mark(y);const A=t[y],w=A&&p&&typeof A=="object"&&typeof p=="object"&&!Array.isArray(A)&&!Array.isArray(p)&&typeof A!="function"&&typeof p!="function";w&&y.charCodeAt(0)>=65&&y.charCodeAt(0)<=90?t[y]=vt(A,p):w&&Mo.has(y)?t[y]={...A,...p}:w&&no(y)?t[y]=vt(A,p):t[y]=p}function i(y){for(const p in y){const A=y[p],w=t[p],h=w&&A&&typeof w=="object"&&typeof A=="object"&&!Array.isArray(w)&&!Array.isArray(A)&&typeof w!="function"&&typeof A!="function";h&&p.charCodeAt(0)>=65&&p.charCodeAt(0)<=90?t[p]=vt(w,A):h&&Mo.has(p)?t[p]={...w,...A}:h&&no(p)?t[p]=vt(w,A):t[p]=A}}if(r&&i(r),o.props&&typeof o.props=="object"&&(i(o.props),a))for(const y in o.props)a.mark(y);(0,At.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,d=e?.scope,u=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,l=d||u||null;if(o.scope!==void 0||f){const y={};f&&Object.assign(y,f),o.scope!==void 0&&Object.assign(y,o.scope),t.scope=(0,I.createScopeStore)(y,l)}else l&&(t.scope=l);o.if!==void 0&&(t.if=o.if);const _=t.__ref,g=kn(t,_&&_.__runtimeSource);return _&&(_.__declaredArrays=g||void 0),(0,Rs.addMethods)(t),fn(t,e,o,c),o}const en=new Set(["key","parent","context","__ref"]);function rn(t,o){for(const n of Object.keys(t))en.has(n)||delete t[n];let s=o.definition;if(!s.extends&&!s.extend&&typeof o.key=="string"){const n=t.context?.components||{},e=n[o.key]||n["smbls."+o.key];e&&(s={...s,extends:e})}(0,G.untrack)(()=>No(t,s,o.key,o.ownKey,t.parent,o.options))}function cn(t,o,s){const n=s||{},e=r=>!!(n[r]||n["smbls."+r]),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 r of a){if(typeof r!="string")continue;const i=r.includes(">")?r.split(">")[0].trim():r;e(i)||c.push(i)}return c}if(typeof o=="string"&&/^[A-Z]/.test(o)){let r=-1;const i=o.indexOf("_"),f=o.indexOf(".");i>0&&(r=i),f>0&&(r<0||f<r)&&(r=f);const d=r>0?o.substring(0,r):o;e(d)||c.push(d)}return c}function eo(t,o,s){if(typeof t.onStateInit!="function"&&!(0,K.hasPluginHook)(t,"stateInit"))return;const n=t.state;t.state=o;try{N("StateInit",t,s)}finally{t.state=n}}const ro=t=>({isDataOnlyKey:o=>(0,L.polyglotSeededKeys)(t).has(o)});function fn(t,o,s,n){const e=!o,c=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=e&&c&&t.context?.state,r=s.state!==void 0&&!a?s.state:t.state&&!(0,I.isStore)(t.state)?t.state:void 0;if(r==null){if(o?.state)t.state=o.state,(0,ut.applyStateMethods)(t,t.state);else if(t.context?.state){const i=t.context.state,f={...i},d=t.context?.polyglot;if(d?.translations){const u=t.context,l=i.lang||d.defaultLang||"en",_=new Set,g=(A,w)=>{_.has(A)||(0,L.isPolyglotWritableKey)(u,A,f)&&(f[A]=w,_.add(A),(0,L.markPolyglotSeeded)(u,A,w))},y=d.translations[l];if(y&&typeof y=="object")for(const A in y)g(A,y[A]);const p=new Set(d.languages||[]);for(const A in d.translations)p.has(A)||g(A,d.translations[A])}(0,I.isStore)(f)||eo(t,f,n),t.state=(0,I.isStore)(f)?f:(0,I.createStore)(f,ro(t.context)),t.state.__element=t,t.state.root=t.state,(0,ut.applyStateMethods)(t,t.state),Ut.promoteActiveRootState?.(i,t.state),N("StateCreated",t,n)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,ut.applyStateMethods)(t,t.state);return}if(typeof r=="string"){if(t.state=Io(r,o),t.state&&typeof t.state=="object"&&!(0,I.isStore)(t.state)){const i=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}(0,ut.applyStateMethods)(t,t.state),un(t,r,o),N("StateCreated",t,n);return}if(typeof r=="function"){const i=r(t,o?.state);if((0,I.isStore)(i))t.state=i;else{const f=i||{};eo(t,f,n),t.state=(0,I.createStore)(f,o?.state?void 0:ro(t.context))}}else if((0,I.isStore)(r))t.state=r;else{const i={...r};eo(t,i,n),t.state=(0,I.createStore)(i,o?.state?void 0:ro(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,ut.applyStateMethods)(t,t.state),Ut.promoteActiveRootState?.(r,t.state),N("StateCreated",t,n)}function Fo(t,o){if(!o)return t;const s=o.split("/");let n=t;for(const e of s){if(n==null)return{};n=n[e]}return n??{}}function $o(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 Io(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")||t.startsWith("~/")){const[e,c]=$o(t,o);return c?Fo(e,c):e??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=Fo(o.state,t);if(s!=null&&Object.keys(s).length>0)return s;const n=o.context?.polyglot;if(n?.translations){const e=o.state?.root?.lang||n.defaultLang||"en",c=n.translations[e];if(c?.[t]!==void 0)return c[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function an(t,o){const[s,n]=$o(t,o);if(!n||!s||typeof s!="object")return;const e=s[n];if(e!==void 0||n.indexOf("/")===-1)return e;let c=s;for(const a of n.split("/")){if(c==null||typeof c!="object")return;c=c[a]}return c}function un(t,o,s){const n=t.__ref;if(!n||!s||o==="."||!(0,I.isStore)(s.state))return;n.__stateBinding&&n.__stateBinding.dispose();const e=(0,G.untrack)(()=>(0,E.createEffect)(()=>{const c=an(o,s);!c||typeof c!="object"||c===t.state||(0,G.untrack)(()=>Bo(t,t.state,c,!0))},{depth:n.path?n.path.length:0,label:P(n,"state")}));e._isStateBinding=!0,n.__stateBinding=e,n.__effects&&n.__effects.push(e)}function Bo(t,o,s,n){const e=t.__ref;if(!e)return;if(n||t.state===o){t.state=s,n&&(0,ut.applyStateMethods)(t,s),Ho(e);const a=e.__children;if(a)for(let r=0;r<a.length;r++){const i=t[a[r]];i&&i.__ref&&i.parent===t&&Bo(i,o,s,!1)}return}if(e.__stateBinding){e.__stateBinding._notify();return}const c=t.state;c&&typeof c=="object"&&c.parent===o&&(c.parent=s,Ho(e))}function Ho(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 dn=new Set(["s","state","ctx","context"]),io=new WeakMap;function Uo(t){if(io.has(t))return io.get(t);let o=null;try{const s=typeof Ut.getFunctionSource=="function"?Ut.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(e=>e.trim()),body:s.slice(n.index+n[0].length)})}}catch{}return io.set(t,o),o}function ln(t){const o=Uo(t);return o?o.params.map(s=>s.split("=")[0].trim()).filter(Boolean):[]}const Vo=new WeakMap;function pn(t){let o=Vo.get(t);return o===void 0&&(o=hn(Uo(t)),Vo.set(t,o)),o}function hn(t){if(!t)return!0;const o=t.body;if(/\bstate\b|\barguments\b|\bcall\s*\(/.test(o))return!0;const s=t.params[1];if(!s)return!1;if(!/^[A-Za-z_$][\w$]*$/.test(s.split("=")[0].trim()))return!0;const n=s.split("=")[0].trim();return new RegExp("(^|[^\\w$.])"+n.replace(/\$/g,"\\$")+"(?![\\w$])").test(o)}const yn=3,_n=/^(is|has)[A-Z0-9_$]/,gn=new Set(["routerOptions"]),Go=new WeakSet;function bn(t,o){if(typeof t!="function"||t.length!==2||o&&(_n.test(o)||gn.has(o))||Go.has(t))return!1;const s=ln(t);if(s.length<2)return!1;const n=s[1].replace(/[{}[\]]/g,"").trim();return n.length<yn||dn.has(n)?!1:(Go.add(t),!0)}function An(t){const o=t.__ref,s=t.tag||"div",n=t.context?.designSystem,e=[],c=Object.keys(t);for(let a=0;a<c.length;a++){const r=c[a];if(typeof t[r]!="function"||U.REGISTRY.has(r))continue;const i=r.charCodeAt(0);i>=65&&i<=90||X(r)||v.CSS_PROPS_REGISTRY[r]||v.DEFAULT_CSS_PROPERTIES_LIST&&v.DEFAULT_CSS_PROPERTIES_LIST.has(r)||i!==45&&((0,j.checkAttributeByTagName)(s,r)||((0,et.isLoudDevRuntime)()&&bn(t[r],r)&&console.warn(`[smbls] custom prop "${r}"${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('${r}', \u2026) instead of reading el.${r}(\u2026) directly (see RULES.md Rule 8).`),e.push({prop:r,fn:t[r]})))}for(let a=0;a<e.length;a++){const{prop:r,fn:i}=e[a];o.__exec[r]=i,Object.defineProperty(t,r,{get(){n&&(0,M.pushConfig)(n);try{return i(t,t.state,t.context)}catch{return}finally{n&&(0,M.popConfig)()}},set(f){delete o.__exec[r],Object.defineProperty(t,r,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function xn(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 R(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...n){return xn(t,o),s.apply(this,n)}}function ht(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function P(t,o){return()=>t.path.join(".")+"::"+o}const Ko=new Set;function $(t,o,s){if(!(0,et.isLoudDevRuntime)())return;const n=P(t,o)();Ko.has(n)||(Ko.add(n),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const Wo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,wn=(t,o)=>{let s;try{s=String(t)}catch{return}if(!s.includes("{{"))return;Wo.lastIndex=0;let n;for(;(n=Wo.exec(s))!==null;)n[2].includes("{{")&&o.add(n[2])},Sn=(t,o)=>!X(t)&&!(0,q.isCssProp)(o,t),co=(t,o,s,n,e)=>{if(typeof o=="string"){!e&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&Sn(t,n)&&wn(o,s)},fo=new WeakMap,jt=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),Et=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)?at(t,o):t},Pt=(t,o)=>t&&o?at(t,o):t||o||null,zo=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&jt(s,o)},yt=(t,o)=>zo(t,o)?Et(t.__ref.__runtimeSource[o]):null,Ot=(t,o)=>(o&&t&&typeof t=="object"&&fo.set(t,o),t),Cn=t=>{if(!t||typeof t!="object")return;const o=fo.get(t);return o&&fo.delete(t),o},ao=(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++)ao(t[n],o,s);return}if(!t.__ref)for(const n of Object.keys(t)){if(n==="state")continue;const e=Object.getOwnPropertyDescriptor(t,n);e&&"value"in e&&ao(e.value,o,s)}}},kn=(t,o)=>{let s=null;for(const n of Object.keys(t)){if(U.REGISTRY.has(n)||o&&jt(o,n))continue;const e=Object.getOwnPropertyDescriptor(t,n),c=e&&e.value;if(!Array.isArray(c))continue;const a=new Set;ao(c,a,new Set),a.size&&(s||(s=new Map),s.set(c,a))}return s},Yo=(t,o)=>{if(Array.isArray(o))for(let s=t;s;s=s.parent){const n=s.__ref&&s.__ref.__declaredArrays,e=n&&n.get(o);if(!e)continue;const c=t.__ref;c.__authoredTemplates||(c.__authoredTemplates=new Set);for(const a of e)c.__authoredTemplates.add(a);return}},qo=["attr","aria","data","metadata"],vn=t=>{if(qo.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},jn=(t,o)=>{const s=new Set,n=t.tag||"div";for(const e of Object.keys(t)){const c=Object.getOwnPropertyDescriptor(t,e),a=c&&c.value,r=!!o&&jt(o,e);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!vn(e))continue;const i=r?o[e]:null,f=i&&typeof i=="object"?i:null,d=e.charCodeAt(0)===46||e.charCodeAt(0)===33;for(const u in a){const l=r&&(!f||jt(f,u)),_=a[u];if(d&&_&&typeof _=="object"&&!Array.isArray(_)&&qo.includes(u)){for(const g in _)co(g,_[g],s,n,l);continue}co(u,_,s,n,l)}continue}co(e,a,s,n,r)}return s};function Zo(t,o){const s=t.__ref,n=!!(o&&o.skipIfEffect),e=jn(t,s.__runtimeSource);if(s.__authoredTemplates)for(const i of e)s.__authoredTemplates.add(i);else s.__authoredTemplates=e;if(An(t),typeof t.text=="function"){const i=t.text,f=R(t,t.textDeps,i),d=(0,E.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=L.replaceLiteralsWithObjectFields.call(t,u,t.state)),Nt(t,u))}catch(u){$(s,"text",u)}},{depth:s.path.length,label:P(s,"text")});s.__effects.push(d),s.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,f=(0,E.createEffect)(()=>{if(s.contentManaged)return;const d=L.replaceLiteralsWithObjectFields.call(t,i,t.state);d!=null&&(t.text=d),t.node&&Nt(t,d??"")},{depth:s.path.length,label:P(s,"text")});s.__effects.push(f),s.__exec.text=i}const c=t.tag||"div";for(const i of Object.keys(t))if(typeof t[i]=="function"&&!U.REGISTRY.has(i)&&!X(i)&&!s.__exec[i]&&!(0,q.isAttributeFirst)(c,i)){if(v.CSS_PROPS_REGISTRY[i]){const f=t[i],d=R(t,t[i+"Deps"],f),u=i;let l,_=null,g=null,y;const p=(0,E.createEffect)(()=>{const A=t.context?.designSystem;A&&(0,M.pushConfig)(A);try{const w=d(t,t.state,t.context);(0,v.pushStaticCssPass)();let h;try{h=v.CSS_PROPS_REGISTRY[u](w,t,t.state,t.context)}finally{(0,v.popStaticCssPass)()}if(Array.isArray(h)){const x={};for(const S of h)if(S)for(const k in S)x[k]=S[k];h=x}const b=u==="show"||u==="hide";if(h&&t.node&&On(h)){const x=_t(h);if(x===null||x!==y){y=x;const S=(0,tt.css)(h,null,t.context?.cssPrefix),k=S?S.split(" ").filter(Boolean):null;if(t.node.classList){if(g)for(const C of g)t.node.classList.remove(C);if(k&&k.length)for(const C of k)t.node.classList.add(C);g=k}}l=void 0,_=null}else if(h&&t.node){if(g){for(const S of g)t.node.classList.remove(S);g=null,y=void 0}const x=_t(h);if(x===null||x!==l||!Dt(t.node,_)){l=x;const S=is(t,h);_=Tt(t.node,S)}}else t.node&&b&&(l=void 0,_=null,t.node.style.display="")}finally{A&&(0,M.popConfig)()}},{depth:s.path.length,label:P(s,u)});s.__effects.push(p),s.__exec[i]=f}else if(v.DEFAULT_CSS_PROPERTIES_LIST&&v.DEFAULT_CSS_PROPERTIES_LIST.has(i)){const f=t[i],d=R(t,t[i+"Deps"],f),u=i;let l,_=null;const g=(0,E.createEffect)(()=>{const y=t.context?.designSystem;y&&(0,M.pushConfig)(y);try{const p=d(t,t.state,t.context);if(t.node)if(p!=null){const A=u+":"+String(p);if(A!==l||!Dt(t.node,_)){l=A;const w={[u]:p},h=is(t,w);_=Tt(t.node,h)}}else l=void 0,_=null,t.node.style[u]=""}finally{y&&(0,M.popConfig)()}},{depth:s.path.length,label:P(s,u)});s.__effects.push(g),s.__exec[i]=f}else if(i.charCodeAt(0)===45){const f=t[i];ns(t,i,f,t[i+"Deps"],i),s.__exec[i]=f}}if(Tn(t),typeof t.html=="function"){const i=t.html,f=R(t,t.htmlDeps,i),d=(0,E.createEffect)(()=>{(0,G.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(d),s.__exec.html=i}if(typeof t.value=="function"){const i=t.value,f=R(t,t.valueDeps,i),d=(0,E.createEffect)(()=>{try{let u=f(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=L.replaceLiteralsWithObjectFields.call(t,u,t.state)),mo(t,u)}catch(u){$(s,"value",u)}},{depth:s.path.length,label:P(s,"value")});s.__effects.push(d),s.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,f=(0,E.createEffect)(()=>{try{mo(t,L.replaceLiteralsWithObjectFields.call(t,i,t.state))}catch(d){$(s,"value",d)}},{depth:s.path.length,label:P(s,"value")});s.__effects.push(f),s.__exec.value=i}if(typeof t.style=="function"){const i=t.style,f=R(t,t.styleDeps,i);let d,u=null,l,_,g,y;const p=(0,E.createEffect)(()=>{const A=f(t,t.state,t.context),w=t.context&&t.context.designSystem;let h;if(A&&typeof A=="object"&&A===l&&w===g){const x=_t(A);h=x!==null&&x===_?y:$t(t,A),_=x}else h=$t(t,A),_=void 0;l=A,g=w,y=h;const b=_t(h);(b===null||b!==d||!Dt(t.node,u))&&(d=b,lo(t.node,u,h),st(t.node,h),u=Tt(t.node,h))},{depth:s.path.length,label:P(s,"style")});s.__effects.push(p),s.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const f=t.style[i];if(typeof f!="function")continue;const d=R(t,ht(t.styleDeps,i),f);let u,l=null;const _=(0,E.createEffect)(()=>{try{const g=d(t,t.state,t.context);if(t.node){const y=i+":"+String(g);if(y!==u||!Dt(t.node,l)){u=y;const p=$t(t,{[i]:g});lo(t.node,l,Object.assign({},p,{[i]:""})),st(t.node,p),l=Tt(t.node,p)}}}catch(g){$(s,"style."+i,g)}},{depth:s.path.length,label:P(s,"style."+i)});s.__effects.push(_)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const f=R(t,ht(t.attrDeps,i),t.attr[i]),d=i,u=(0,E.createEffect)(()=>{try{let l=f(t,t.state,t.context);typeof l=="string"&&l.includes("{{")&&(l=L.replaceLiteralsWithObjectFields.call(t,l,t.state)),t.node?.setAttribute&&Ft(t.node,d,l)}catch(l){$(s,"attr."+d,l)}},{depth:s.path.length,label:P(s,"attr."+d)});u._attrName=d.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const f=t.attr[i],d=i,u=(0,E.createEffect)(()=>{try{const l=L.replaceLiteralsWithObjectFields.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(d,(0,j.serializeAttrValue)(d,l??""))}catch(l){$(s,"attr."+d,l)}},{depth:s.path.length,label:P(s,"attr."+d)});u._attrName=d.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const f=t.aria[i];if(typeof f=="string"&&f.includes("{{")){const _=f,g="aria-"+i.replace(/[A-Z]/g,p=>"-"+p.toLowerCase()),y=(0,E.createEffect)(()=>{try{const p=L.replaceLiteralsWithObjectFields.call(t,_,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(g,(0,j.serializeAttrValue)(g,p??""))}catch(p){$(s,"aria."+i,p)}},{depth:s.path.length,label:P(s,"aria."+i)});y._attrName=g,s.__effects.push(y);continue}if(typeof f!="function")continue;const d=R(t,ht(t.ariaDeps,i),t.aria[i]),u="aria-"+i.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),l=(0,E.createEffect)(()=>{try{const _=d(t,t.state,t.context);if(!t.node?.setAttribute)return;Ft(t.node,u,_)}catch(_){$(s,"aria."+i,_)}},{depth:s.path.length,label:P(s,"aria."+i)});l._attrName=u,s.__effects.push(l)}if(t.data&&typeof t.data=="object")for(const i in t.data){const f=t.data[i];if(typeof f=="string"&&f.includes("{{")){const g=f,y="data-"+i.replace(/[A-Z]/g,A=>"-"+A.toLowerCase()),p=(0,E.createEffect)(()=>{try{const A=L.replaceLiteralsWithObjectFields.call(t,g,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,A??"")}catch(A){$(s,"data."+i,A)}},{depth:s.path.length,label:P(s,"data."+i)});p._attrName=y,s.__effects.push(p);continue}if(typeof f!="function")continue;const d=R(t,ht(t.dataDeps,i),t.data[i]),l="data-"+i.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),_=(0,E.createEffect)(()=>{try{const g=d(t,t.state,t.context);if(!t.node?.setAttribute)return;g==null||g===!1?t.node.removeAttribute(l):typeof g!="function"&&typeof g!="object"&&t.node.setAttribute(l,g===!0?"":g)}catch(g){$(s,"data."+i,g)}},{depth:s.path.length,label:P(s,"data."+i)});_._attrName=l,s.__effects.push(_)}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 i in a){if(typeof a[i]!="function")continue;const f=R(t,ht(t.classDeps,i),a[i]),d=(0,E.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(i):t.node.classList.remove(i)}catch(u){$(s,"class."+i,u)}},{depth:s.path.length,label:P(s,"class."+i)});s.__effects.push(d)}!n&&typeof t.if=="function"&&Jo(t,s,t.if);for(const i of Object.keys(t)){if(U.REGISTRY.has(i)||typeof t[i]!="function")continue;const f=i.charCodeAt(0);if(f>=65&&f<=90||X(i))continue;const d=t[i];s.__exec[i]=d;const u=t.tag||"div";if((0,j.checkAttributeByTagName)(u,i)&&!(0,q.isCssProp)(u,i)){const l=(0,j.camelToAttr)(i)||i,_=R(t,t[i+"Deps"],d),g=(0,E.createEffect)(()=>{try{let y=_(t,t.state,t.context);typeof y=="string"&&y.includes("{{")&&(y=L.replaceLiteralsWithObjectFields.call(t,y,t.state)),t.node?.setAttribute&&Ft(t.node,l,y,!0)}catch(y){$(s,i,y)}},{depth:s.path.length,label:P(s,i)});g._attrName=l.toLowerCase(),s.__effects.push(g)}}const r=t.tag||"div";for(const i of Object.keys(t)){if(U.REGISTRY.has(i))continue;const f=t[i];if(typeof f!="string"||!f.includes("{{"))continue;const d=i.charCodeAt(0);if(d>=65&&d<=90||X(i)||(0,q.isCssProp)(r,i)||j.ATTR_TRANSFORMS[i]||!(0,j.checkAttributeByTagName)(r,i))continue;const u=(0,j.camelToAttr)(i)||i,l=(0,E.createEffect)(()=>{try{const _=L.replaceLiteralsWithObjectFields.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,(0,j.serializeAttrValue)(u,_??""))}catch(_){$(s,i,_)}},{depth:s.path.length,label:P(s,i)});l._attrName=u.toLowerCase(),s.__effects.push(l)}if($n(t),zn(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,f=t.stateDeps;let d=!1,u=[];const l=(0,E.createEffect)(()=>{const _=[];for(let p=0;p<f.length;p++){const A=f[p];try{_[p]=typeof A=="function"?A(t,t.state,t.context):t.state?.[A]}catch{_[p]=void 0}}if(!d){d=!0,u=_;return}let g=_.length!==u.length;for(let p=0;!g&&p<_.length;p++)_[p]!==u[p]&&(g=!0);const y=u;u=_,g&&(0,G.withDesignSystem)(t,()=>{try{i(t,t.state,t.context,{prev:y,next:_})}catch(p){if((0,K.reportLifecycleError)(t,"onStateUpdate",p),t.context?.strictMode)throw p}})},{depth:s.path.length,label:P(s,"onStateUpdate")});s.__effects.push(l)}Un(t)}function Qo(t){const o=t.parent,s=o?.node;if(!s||!t.node){Ds(t,t.parent);return}let n=null;const e=Object.keys(o),c=e.indexOf(t.key);for(let a=c+1;a<e.length;a++){const r=o[e[a]];if(r?.node?.parentNode===s){n=r.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function Xo(t){ts(t),mn(t),_s(t),le(t),de(t)}function Jo(t,o,s){let n=R(t,t.ifDeps,s);const e=(0,E.createEffect)(()=>{const c=!o.__ifInitialized&&o.__ifLateMerge;if(c){const i=t.context?.components||{};c.names.some(f=>i[f]||i["smbls."+f])&&(o.__ifLateMerge=null,rn(t,c),n=R(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=n(t,t.state,t.context)}catch(i){if(a=!1,o.__ifError=i,typeof console<"u"&&console.warn){const f=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${f} \u2014 treating as false:`,i?.message||i)}return}const r=o.__if;if(o.__if=!!a,r&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(i){console.error("[smbls] onRemove error:",i)}}else if(!r&&o.__if)if(o.__ifInitialized)t.node||(t.node=(0,ot.cacheNode)(t)),t.node&&(t.node.ref=t),Qo(t),ts(t),_s(t),N("Render",t,{}),so(t,{});else{if(o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=(0,ot.detectTag)(t)),N("Init",t,{}),t.node||(t.node=(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.tag==="fragment"&&!o.__fragmentAnchor){const f=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(f),o.__fragmentAnchor=f}N("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Os(t,{}),Zo(t,{skipIfEffect:!0}),Xo(t),Ts(t,{}),Qo(t),N("Create",t,{}),N("Complete",t,{}),N("Render",t,{}),N("RenderRouter",t,{}),so(t,{})}},{depth:o.path.length,label:P(o,"if")});o.__effects.push(e)}function Nt(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 e=t.__ref;let c=e?e.__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),e&&(e.__textNode=c||null)}function En(t,o){return o!=="checked"||!t||t.tagName!=="INPUT"?null:t.hasAttribute("checked")}function Pn(t,o){if(o===null)return;const s=t.hasAttribute("checked");s!==o&&t.checked!==s&&(t.checked=s)}function Ft(t,o,s,n){s==null||s===!1&&!(0,j.isEnumeratedTrueFalseAttr)(o)?Wt(t,o,null):typeof s=="function"||typeof s=="object"||(n&&o==="src"&&"src"in t?t.src=s:Wt(t,o,(0,j.serializeAttrValue)(o,s)))}function Wt(t,o,s){const n=En(t,o);s==null?t.removeAttribute(o):t.setAttribute(o,s),Pn(t,n)}function mo(t,o){const s=t.node;if(!s||!("value"in s))return;const n=o==null?"":String(o);if(s.value===n)return;const e=typeof document<"u"&&document.activeElement===s,c=e&&typeof s.selectionStart=="number"?s.selectionStart:null,a=e&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,e&&c!=null&&a!=null)try{s.setSelectionRange(c,a)}catch{}const r=t.__ref&&t.__ref.__autoGrow;r&&r.active&&r.resize()}function ts(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Nt(t,t.text),ws(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 e in t.style)typeof t.style[e]!="function"&&(s[e]=t.style[e]);break}st(o,$t(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,j.isEnumeratedTrueFalseAttr)(s)||o.setAttribute&&o.setAttribute(s,(0,j.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 e=typeof s[n]=="function"?s[n](t,t.state,t.context):s[n];e&&o.classList.add(typeof e=="string"?e:n)}}}}function _t(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function On(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 Tt(t,o){if(!t||!t.style||!o)return null;const s=t.style,n=[];for(const e in o){if(o[e]==null||e.charAt(0)==="&")continue;const a=J(e);n.push(a,uo(s,a),os(s,a))}return n}function uo(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function os(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function J(t){return(0,H.cssPropName)(t)}function lo(t,o,s){if(!t||!t.style||!o||!o.length)return;const n=t.style,e=new Set;if(s&&typeof s=="object")for(const c in s)s[c]==null||c.charAt(0)==="&"||e.add(J(c));for(let c=0;c<o.length;c+=3){const a=o[c];e.has(a)||uo(n,a)===o[c+1]&&typeof n.removeProperty=="function"&&n.removeProperty(a)}}function Dt(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let n=0;n<o.length;n+=3)if(uo(s,o[n])!==o[n+1]||os(s,o[n])!==o[n+2])return!1;return!0}const Lt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,ss=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",zt=t=>Lt(t)?t:"--"+t;function Yt(t,o){if(!nt(t))return null;let s=null;for(const n of Object.keys(t)){if(!n)continue;let e=t[n];if(typeof e=="function"){if(!o)continue;e=e(o,o.state,o.context)}ss(e)&&(s||(s={}),s[zt(n)]=e)}return s}function ns(t,o,s,n,e){es(t,e,R(t,n,s),c=>ss(c)?{[o]:c}:null)}function es(t,o,s,n,e){const c=t.__ref;let a,r=null;const i=(0,E.createEffect)(()=>{(0,G.withDesignSystem)(t,()=>{try{const f=n(s(t,t.state,t.context)),d=t.node;if(!d||!d.style)return;const u=_t(f);(u===null||u!==a||!Dt(d,r))&&(a=u,lo(d,r,f),f&&st(d,f),r=f?Tt(d,f):null,e&&e(f))}catch(f){$(c,o,f)}})},{depth:c.path.length,label:P(c,o)});c.__effects.push(i)}function Tn(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){Dn(t,s),o.__exec.vars=s;return}if(nt(s))for(const n of Object.keys(s)){const e=s[n];!n||typeof e!="function"||ns(t,zt(n),e,ht(t.varsDeps,n),"vars."+n)}}function Dn(t,o){const s=t.__ref;es(t,"vars",R(t,t.varsDeps,o),n=>Yt(n),n=>{s.__varsInline=n?new Set(Object.keys(n)):null})}function po(t,o){if(typeof t[o]=="function"&&((0,q.isCssProp)(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!Lt(o))return!1;const s=t.vars;if(typeof s=="function"){const n=t.__ref&&t.__ref.__varsInline;return!!(n&&n.has(o))}if(!nt(s))return!1;for(const n of Object.keys(s))if(typeof s[n]=="function"&&zt(n)===o)return!0;return!1}function Ln(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 Rn(t,o,s,n){const e=t.__ref;if(!e)return;let c=null;if(s)for(const a of s){if(n&&n.has(a))continue;const r=o[a];if(r==null||typeof r=="object")continue;const i=J(a);H.CSS_LONGHAND_SHORTHANDS[i]&&(c||(c={}),c[i]=r)}e.__declaredLonghands=c}function rs(t,o){const s=t.__ref,n=s&&s.__declaredLonghands;if(!n||!o)return null;let e=null;for(const c in n){if(o.has(c))continue;const a=H.CSS_LONGHAND_SHORTHANDS[c];let r=!1;for(let i=0;i<a.length;i++)if(o.has(a[i])){r=!0;break}r&&(e||(e={}),e[c]=n[c])}return e}function is(t,o){const s=t.node;st(s,o);const n=Ln(o);if(!n)return o;const e=t.__ref;if(e)if(e.__inlineCssKeys)for(const a of n)e.__inlineCssKeys.add(a);else e.__inlineCssKeys=new Set(n);const c=rs(t,n);return c?(st(s,c),Object.assign({},o,c)):o}function Mn(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=rs(t,o.__inlineCssKeys);s&&st(t.node,s)}function $t(t,o){return!o||typeof o!="object"?o:(0,G.withDesignSystem)(t,()=>{try{return(0,v.resolveStyleBlockTokens)(o,t)}catch{return o}})}function st(t,o){if(!t||!o||!t.style)return;let s=null;for(const n in o){const e=o[n];if(e!=null){if(n.charAt(0)==="&"&&typeof e=="object"){s||(s={}),s[n]=e;continue}try{const c=String(e),a=(0,H.cssPropName)(n),r=c.trim(),i=/\s*!important\s*$/.test(r),f=r.replace(/\s*!important\s*$/,"");t.style.setProperty(a,f,i?"important":"")}catch{}}}s&&Nn(t,s)}function Nn(t,o){const s=`_ds${jo.scopedStyleId++}`;t.classList.add(s);const n=t.ownerDocument;let e=n.querySelector("style[data-smbls-scoped]");e||(e=n.createElement("style"),e.setAttribute("data-smbls-scoped",""),n.head.appendChild(e));let c="";for(const a in o){const r="."+s,i=a.replace(/&/g,r).split(",").map(d=>{const u=d.trim();return u.includes(r)?u:r+u}).join(", "),f=o[a];if(typeof f=="object"){let d="",u="";for(const l in f){const _=f[l];if(typeof _=="object"){const g=l.includes("&")?i.split(", ").map(p=>l.replace(/&/g,p)).join(", "):i.split(", ").map(p=>`${p} ${l}`).join(", ");let y="";for(const p in _)y+=`${J(p)}: ${_[p]};`;u+=(0,tt.wrapHoverRule)(`${g} { ${y} }`,g)+`
|
|
5
|
+
`}else d+=`${J(l)}: ${_};`}d&&(c+=(0,tt.wrapHoverRule)(`${i} { ${d} }`,i)+`
|
|
6
|
+
`),u&&(c+=u)}}c&&(e.textContent+=c)}const cs=new Set;function fs(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 Fn(t,o,s){const n=fs(s);queueMicrotask(()=>{if(!t.__ref)return;let e;try{e=o(t,t.state,t.context)}catch{return}if(fs(e)===n)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";cs.has(c)||(cs.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(e)?e.join(", "):String(e)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.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 $n(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,et.isLoudDevRuntime)()&&Fn(t,o,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const e=t.__ref;for(let c=0;c<n.length;c++){const a=n[c];if(typeof a!="string"||a.length===0)continue;const r=a.split("."),i=r[0],f=r.slice(1),d={value:!1},u=(0,E.createEffect)(()=>{const l=t.state&&((0,I.isStore)(t.state)?t.state.root:null);if(!l||!(0,I.isStore)(l))return;let _=l;_=_[i];for(let y=0;y<f.length&&!(_==null||typeof _!="object");y++)if((0,I.isStore)(_))_=_[f[y]];else break;if(!d.value)return;let g=!1;if(typeof t.onBeforeUpdate=="function"&&(0,G.withDesignSystem)(t,()=>{try{if(Fs(e)){const y=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});y&&typeof y.then=="function"?y.then(()=>It(e,!1),p=>{It(e,!0),(0,K.dispatchPluginHook)("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}):(It(e,!1),y===!1&&(g=!0))}}catch(y){It(e,!0),(0,K.dispatchPluginHook)("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}}),!g&&t.node&&e.__effects)for(let y=0;y<e.__effects.length;y++){const p=e.__effects[y];p&&p!==u&&!p._disposed&&!p._isSubscribeToEffect&&typeof p._execute=="function"&&p._execute()}!g&&typeof t.onUpdate=="function"&&(0,G.withDesignSystem)(t,()=>{try{t.onUpdate(t,t.state,t.context)}catch(y){(0,K.dispatchPluginHook)("error",t,{hook:"onUpdate",error:y})||console.error("[DOMQL] subscribeTo onUpdate error:",y)}})},{depth:e.path.length,label:P(e,"subscribeTo("+a+")")});d.value=!0,u._isSubscribeToEffect=!0,e.__effects.push(u)}}function ho(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 yo(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 as=new Set;function In(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",n=s+"::"+t;as.has(n)||(as.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 us=new Map;function Bn(t){let o=us.get(t);if(o)return o;o=[];const s=n=>{if(n)for(const e of n)o.push((0,H.cssCamelName)(e))};return s(H.CSS_LONGHAND_SHORTHANDS[t]),s(H.CSS_SHORTHAND_LONGHANDS[t]),us.set(t,o),o}function ds(t,o,s){if(po(t,o)||s&&s.has(o))return!0;const n=Bn(J(o));for(let e=0;e<n.length;e++){const c=n[e];if(po(t,c)||s&&s.has(c))return!0}return!1}function gt(t,o,s,n){const e={},c=new Set,a=(r,i,f)=>{const d=f?new Set(Object.keys(e)):null;if(v.CSS_PROPS_REGISTRY[r]){const u=v.CSS_PROPS_REGISTRY[r](i,o,o.state,o.context);if(u){const l=Array.isArray(u)?u:[u];for(const _ of l)_&&Object.assign(e,_)}}else e[r]=i;if(f)for(const u in e)d.has(u)||c.add(u)};for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let i=t[r];if(typeof i=="function"&&(i=i(o,o.state,o.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(r==="style"){for(const u in i){let l=i[u];typeof l=="function"&&(l=l(o,o.state,o.context)),!(l==null||typeof l=="function")&&a(u,l,ds(o,u,n))}continue}if(r==="vars"){const u=Yt(i,o);if(u)for(const l in u)a(l,u[l],po(o,l)||!!(n&&n.has(l)));continue}if(ho(r,o)){const u=gt(i,o,!1,n);Object.keys(u).length&&(e[`[data-theme="${r.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(r)){(0,et.isLoudDevRuntime)()&&In(r,o);continue}const f=yo(r,o),d=gt(i,o,!1,n);Object.keys(d).length&&(e[f]=d);continue}a(r,i,ds(o,r,n))}}if(s)for(const r in e)c.add(r);for(const r of c){const i=e[r];typeof i=="string"&&!i.includes("!important")&&(e[r]=i+" !important")}return e}const nt=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function ls(t,o){for(const s in o){const n=o[s];t[s]=nt(n)?ls(nt(t[s])?t[s]:{},n):n}return t}function Hn(t,o){if(!nt(o))return;let s;for(const n of t.split(" ")){const e=n?o[n]:null;nt(e)&&(s=ls(s||{},e))}return s}function _o(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)&&_o(t[s],o+1))return!0}return!1}function ps(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(ho(t,s)){const c=gt(o,s,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const n=yo(t,s),e=gt(o,s,!1);return Object.keys(e).length?{cssProp:n,block:e}:null}function Un(t){const o=t.__ref;for(const s of Object.keys(t)){if(!no(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!_o(n))continue;let e=null,c;const a=(0,E.createEffect)(()=>{if(!t.node)return;const r=t.context?.designSystem;r&&(0,M.pushConfig)(r);let i,f=!1;try{const d=ps(s,n,t),u=d?_t(d.block)+"::"+d.cssProp:null;if(u!==null&&u===c)f=!0;else if(c=u,d){const l=(0,tt.css)({[d.cssProp]:d.block},null,t.context?.cssPrefix);i=l?l.split(" ").filter(Boolean):null}else i=null}finally{r&&(0,M.popConfig)()}if(!(f||!t.node.classList)){if(e)for(const d of e)t.node.classList.remove(d);if(i&&i.length)for(const d of i)t.node.classList.add(d);e=i}},{depth:o.path.length,label:P(o,"cssBlock("+s+")")});o.__effects.push(a)}}const Vn=()=>!0,Gn=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!v.CSS_PROPS_REGISTRY[t]||!!(v.DEFAULT_CSS_PROPERTIES_LIST&&v.DEFAULT_CSS_PROPERTIES_LIST.has(t))||Lt(t)||t==="vars"};function Kn(t,o,s){const n={};let e=!1;for(const r in s)Object.prototype.hasOwnProperty.call(s,r)&&(r!=="data"&&r!=="aria"&&(Gn(r,s[r])||U.REGISTRY.has(r))?n[r]=!0:e=!0);if(!e)return null;const c=(0,j.extractConditionalAttrs)({[o]:s},t.tag||"div",n,Vn);let a=null;for(const r in c)/^on/i.test(r)||(a||(a={}),a[r]=c[r]);return a}function hs(t,o,s,n,e,c){const a=t.node;let r=null;const i=f=>{(r||(r=[])).push(f)};for(const f in n){const d=o.owners.get(f),u=d===s;if(!c&&d!==void 0&&!u)continue;let l;try{l=n[f](t)}catch(g){$(t.__ref,"conditional("+s+")."+f,g),u&&i(f);continue}if(typeof l=="string"&&l.includes("{{")&&(l=L.replaceLiteralsWithObjectFields.call(t,l,t.state)),u&&a.getAttribute(f)!==o.written.get(f)){i(f);continue}if(l==null||typeof l=="object"||typeof l=="function"){u&&ys(a,o,f);continue}const _=l===!1&&!(0,j.isEnumeratedTrueFalseAttr)(f)?null:String((0,j.serializeAttrValue)(f,l));i(f),!(u&&_===o.written.get(f))&&(d===void 0&&o.base.set(f,a.getAttribute(f)),Wt(a,f,_),o.owners.set(f,s),o.written.set(f,_))}e.appliedAttrs=r}function ys(t,o,s){t.getAttribute(s)===o.written.get(s)&&Wt(t,s,o.base.get(s)),o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function Wn(t,o,s,n){const e=n.appliedAttrs;if(n.appliedAttrs=null,!!e)for(const c of e)o.owners.get(c)===s&&ys(t.node,o,c)}function _s(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 e=o.written.get(n),c=s.getAttribute(n);c!==e&&(o.base.set(n,c),e==null?s.removeAttribute(n):s.setAttribute(n,e))}}function zn(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const n=new Map;for(const e of Object.keys(t)){const c=e.charAt(0);if(c!=="."&&c!=="!")continue;const a=e.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const p=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${c}\` is read as one prop name. Nest the selector inside instead: \`${c}${p}: { '${a.slice(p.length)}': {...} }\`.`)}continue}const r=t[e];if(!r||typeof r!="object")continue;const i=c==="!",f={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null},d=Kn(t,e,r);d&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const p in r){if(!Object.prototype.hasOwnProperty.call(r,p))continue;const A=p.charAt(0),w=r[p];if(!((A===":"||A==="@"||A==="&"||A==="[")&&w&&typeof w=="object"&&!Array.isArray(w))){if(p==="vars"&&nt(w)){for(const h of Object.keys(w))h&&u.add(zt(h));continue}u.add(p)}}const l=()=>{let p;const A=t[a];if(A===void 0){const b=!!t.state&&a in t.state,x=t.state?t.state[a]:void 0;if(b||x!==void 0)p=x;else{const S=t.context?.cases?.[a];if(S===void 0)return;try{p=typeof S=="function"?S.call(t,t):S}catch(k){p=!1,o.__conditionalError=k,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,k?.message||k)}}}else if(typeof A=="function")try{p=A(t,t.state,t.context)}catch(b){p=!1,o.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}else p=A;const w=i?!p:!!p;if(!t.node)return;const h=t.context?.designSystem;if(w===f.lastMatch){if(w&&d&&t.node.setAttribute){h&&(0,M.pushConfig)(h);try{hs(t,s,e,d,f,!1)}finally{h&&(0,M.popConfig)()}}return}f.lastMatch=w,h&&(0,M.pushConfig)(h);try{if(w){const b={},x={};let S=!1;for(const C in r){if(!Object.prototype.hasOwnProperty.call(r,C))continue;const F=r[C],rt=C.charAt(0);if((rt===":"||rt==="@"||rt==="&"||rt==="[")&&F&&typeof F=="object"&&!Array.isArray(F)){if(ho(C,t)){const T=gt(F,t,!1,u);Object.keys(T).length&&(x[`[data-theme="${C.slice(1)}"] &`]=T,S=!0)}else{const T=yo(C,t),B=gt(F,t,!1,u);Object.keys(B).length&&(x[T]=B,S=!0)}continue}const it=typeof F=="function"?F(t,t.state,t.context):F;if(it!=null){if(v.CSS_PROPS_REGISTRY[C]){const T=v.CSS_PROPS_REGISTRY[C](it,t,t.state,t.context);if(T){const B=Array.isArray(T)?T:[T];for(const xt of B)xt&&Object.assign(b,xt)}}else if(v.DEFAULT_CSS_PROPERTIES_LIST&&v.DEFAULT_CSS_PROPERTIES_LIST.has(C))b[C]=it;else if(Lt(C))b[C]=it;else if(C==="vars"){const T=Yt(it,t);T&&Object.assign(b,T)}}}const k=Object.keys(b);if(k.length){st(t.node,b);for(const C of k)n.set(C,e);f.appliedKeys=k}else f.appliedKeys=null;if(S){const C=(0,tt.css)(x,null,t.context?.cssPrefix,{state:!0}),F=C?C.split(" ").filter(Boolean):[];if(F.length&&t.node.classList){for(const rt of F)t.node.classList.add(rt);f.appliedClasses=F}else f.appliedClasses=null}else if(f.appliedClasses){for(const C of f.appliedClasses)t.node.classList.remove(C);f.appliedClasses=null}d&&t.node.setAttribute&&hs(t,s,e,d,f,!0)}else{if(f.appliedAttrs&&Wn(t,s,e,f),f.appliedKeys){for(const b of f.appliedKeys)n.get(b)===e&&(Lt(b)?t.node.style.removeProperty(b):t.node.style[b]="",n.delete(b));f.appliedKeys=null}if(f.appliedClasses){for(const b of f.appliedClasses)t.node.classList.remove(b);f.appliedClasses=null}}}finally{h&&(0,M.popConfig)()}};o.__conditionalRunners.push(l);const _=R(t,t[a+"Deps"],l),g=(0,E.createEffect)(_,{depth:o.path.length,label:P(o,"conditional("+e+")")}),y=o.__exec&&o.__exec[a]||t[a];g._sources.size===0&&typeof y=="function"&&(0,et.isLoudDevRuntime)()&&pn(y)&&console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${a}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),o.__effects.push(g)}}const go=new WeakSet,bo=new WeakMap;function Yn(t){const o=bo.get(t);if(o==="painted")return!1;if(o===void 0){bo.set(t,"open");const s=t.defaultView,n=()=>{bo.set(t,"painted")};s&&typeof s.requestAnimationFrame=="function"?s.requestAnimationFrame(n):setTimeout(n,0)}return!0}function qn(t){const o=t.ownerDocument;!o||go.has(o)||Yn(o)||(go.add(o),queueMicrotask(()=>{go.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const Ao=new WeakSet;let gs=!1;function bs(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function xo(t,o){const s={...t};for(const n in o){const e=o[n],c=s[n];s[n]=e&&typeof e=="object"&&c&&typeof c=="object"?xo(c,e):e}return s}function As(t,o){const s={};for(const n in t){const e=t[n];if(e&&typeof e=="object"){const c=As(e,o);Object.keys(c).length&&(s[n]=c)}else o.has(n)||(s[n]=e)}return s}function Zn(t,o,s){let n=1/0,e=-1/0;for(const a of o.values())a<n&&(n=a),a>e&&(e=a);if(s)for(const a of s.values())a>e&&(e=a);if(e<=n)return null;let c=null;for(const[a,r]of o){if(r===e)continue;const i=Qn(a);if(i)for(let f=0;f<i.length;f+=3){const d=i[f],u=i[f+1],l=i[f+2],_=t[u]!=null?o.get(u):void 0,g=s&&s.get(d),y=_!==void 0&&_>r&&(0,H.cssShorthandStatesLonghand)(d,t[u],l),p=!y&&g!==void 0&&g>r&&(0,H.cssShorthandStatesLonghand)(d,void 0,l);if(y||p){y&&delete t[a],c||(c=new Set),c.add(a);break}}}return c}const xs=new Map;function Qn(t){let o=xs.get(t);if(o!==void 0)return o;const s=J(t),n=H.CSS_LONGHAND_SHORTHANDS[s];if(o=null,Array.isArray(n)){o=[];for(const e of n)o.push(e,(0,H.cssCamelName)(e),s)}return xs.set(t,o),o}function ws(t){const{node:o}=t;if(!o)return;if(gs||(gs=!0,(0,tt.css)({display:"none"})),Ao.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Ao.add(t);const s=t.context?.designSystem;s&&(0,M.pushConfig)(s),(0,v.pushStaticCssPass)();try{const n={};let e=!1,c=[],a=null,r=null,i=null;const f=t.__ref&&t.__ref.__mergeLayer;let d,u=null,l=null;const _=(h,b)=>{if(b&&typeof b=="object"&&bs(h)){r||(r={});const x=r[h];x&&(b=xo(x,b)),r[h]=b}else(b===null||typeof b!="object")&&(i||(i=new Set),i.add(h),d!==void 0&&(u||(u=new Map),u.set(h,d)));n[h]=b};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&v.CSS_PROPS_REGISTRY.theme){const h=v.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(h){const b=x=>{for(const S in x){const k=x[S];k&&typeof k=="object"&&bs(S)&&(a||(a={}),a[S]=k),n[S]=k}};if(Array.isArray(h))for(const x of h)x&&b(x);else b(h);e=!0}}const g=(h,b)=>{if(h==="vars"){const x=Yt(b);if(x){for(const S in x)_(S,x[S]);e=!0}return}if(v.CSS_PROPS_REGISTRY[h]){const x=v.CSS_PROPS_REGISTRY[h](b,t,t.state,t.context);if(x){if(Array.isArray(x)){for(const S of x)if(S)for(const k in S)_(k,S[k])}else for(const S in x)_(S,x[S]);e=!0}}else if(v.DEFAULT_CSS_PROPERTIES_LIST&&v.DEFAULT_CSS_PROPERTIES_LIST.has(h))b!=null&&typeof b!="object"&&(_(h,b),e=!0);else if(h.charCodeAt(0)===45)b!=null&&typeof b!="object"&&(_(h,b),e=!0);else if((h.charAt(0)==="&"||h.charAt(0)==="@"||h.charAt(0)===":"||h.charAt(0)==="[")&&b&&typeof b=="object"&&!Array.isArray(b)){if(_o(b))return;const x=ps(h,b,t);x&&(_(x.cssProp,x.block),e=!0)}};if(typeof t.class=="string"){const h=Hn(t.class,t.context?.designSystem?.class);if(h)for(const b in h)g(b,h[b])}const y=i?new Set(i):null,p=t.tag||"div";for(const h of Object.keys(t)){if(typeof t[h]=="function"){const x=f&&f.get(h);x!==void 0&&(0,q.isCssProp)(p,h)&&(l||(l=new Map),l.set(J(h),x));continue}if(d=f?f.get(h):void 0,h==="vars"){g(h,t[h]);continue}if(U.REGISTRY.has(h)||h==="theme")continue;const b=h.charCodeAt(0);b>=65&&b<=90||X(h)||(0,q.isAttributeFirst)(p,h)||g(h,t[h])}d=void 0;const A=u?Zn(n,u,l):null;if(a)for(const h in a){let b=i?As(a[h],i):a[h];r&&r[h]&&(b=xo(b,r[h])),Object.keys(b).length?n[h]=b:delete n[h]}if(Rn(t,n,i,A?new Set([...y||[],...A]):y),e){n.display&&String(n.display).includes("!important")&&(o.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const h=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof h=="string"&&h!==""&&n.display&&n.display!==h&&(n.display=h);const b=(0,tt.css)(n,null,t.context?.cssPrefix);if(c=b?b.split(" ").filter(Boolean):[],b&&o.classList){const x=c;let S=!1;for(const k of x)o.classList.add(k),S||(k.charCodeAt(0)===95&&k.charCodeAt(1)===99||k.charCodeAt(0)===95&&k.indexOf("_c",1)!==-1)&&(S=!0);S&&qn(o)}}const w=t.__ref;if(w){const h=w.__staticCssClasses;if(h&&o.classList){const b=new Set(c);for(const x of h)b.has(x)||o.classList.remove(x)}w.__staticCssClasses=c}Mn(t)}finally{(0,v.popStaticCssPass)(),s&&(0,M.popConfig)(),Ao.delete(t)}}const Xn=t=>!!v.CSS_PROPS_REGISTRY[t]||!!(v.DEFAULT_CSS_PROPERTIES_LIST&&v.DEFAULT_CSS_PROPERTIES_LIST.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function Jn(t){t&&t.node&&ws(t)}function mn(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const e in t.aria){const c=t.aria[e];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const a="aria-"+e.replace(/[A-Z]/g,r=>"-"+r.toLowerCase());o.setAttribute(a,(0,j.serializeAttrValue)(a,c))}const s=(0,j.applyAttrTransforms)(t);for(const e in s){const c=s[e];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&o.setAttribute(e,c===!0?"":c)}const n=t.tag||"div";for(const e of Object.keys(t)){if(typeof t[e]=="function"||U.REGISTRY.has(e)||e==="on"||s[e]!==void 0)continue;const c=e.charCodeAt(0);if(!(c>=65&&c<=90)&&!X(e)&&!(0,q.isCssProp)(n,e)&&(0,j.checkAttributeByTagName)(n,e)){let a=t[e];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!j.ATTR_TRANSFORMS[e])continue;a=L.replaceLiteralsWithObjectFields.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!(0,j.isEnumeratedTrueFalseAttr)((0,j.camelToAttr)(e)||e))continue;const r=(0,j.camelToAttr)(e)||e;o.setAttribute(r,(0,j.serializeAttrValue)(r,a))}}}function te(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const n=o.charCodeAt(0);if(n>=65&&n<=90||X(o))return;const e=t.tag||"div";if((0,q.isCssProp)(e,o)||!(0,j.checkAttributeByTagName)(e,o))return;const c=(0,j.camelToAttr)(o)||o,a=c.toLowerCase(),r=t.__ref&&t.__ref.__effects;let i=!1;if(r)for(let u=0;u<r.length;u++){const l=r[u];l&&l._attrName===a&&!l._disposed&&typeof l._execute=="function"&&(i=!0,l._execute())}if(i)return;let f=t[o];const d=j.ATTR_TRANSFORMS[o];if(d&&f!=null){const u=d(t);u!==void 0&&(f=u)}typeof f=="string"&&f.includes("{{")&&(f=L.replaceLiteralsWithObjectFields.call(t,f,t.state)),Ft(s,c,f)}function oe(t,o){const s=t.node,n=t.__ref;let e=n.__autoGrow;if(!o){if(e&&e.active){try{s.removeEventListener("input",e.resize)}catch{}Cs(e),ct.delete(t),s.style.height="",e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""),js(s,e,!1),e.active=!1,e.appliedMax=null,e.lastMeasure=0}return}e||(e=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){Rt(t,!0);return}if(!(s.scrollHeight>0)){e.awaitingLayout=!0,Ss(t,e);return}e.awaitingLayout=!1;const a=ee(s),r=re(a),i=s.style.height;s.style.height="0px",r&&So(s);const f=s.scrollHeight;if(!(f>0)){s.style.height=i,r&&So(s);return}const d=ie(s,a),u=d!=null&&f<d?d:f,l=ae(a),_=l!=null&&u>l;s.style.height=fe(_?l:u,a)+"px",r&&So(s),js(s,e,_),e.lastMeasure=f,e.lastWidth=s.clientWidth,Ss(t,e)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",e.resize)}catch{}Cs(e),ct.delete(t)})),e.active||(s.addEventListener("input",e.resize),e.active=!0,ne(t,e));const c=typeof o=="object"&&o.max!=null?String(o.max):null;c!==e.appliedMax&&(c==null?e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=c,e.appliedMax=c),e.resize()}function Rt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),ct.add(t),Vt())}function se(){const t=Array.from(ct);ct.clear();for(let o=0;o<t.length;o++){const s=t[o],n=s.node,e=s.__ref?.__autoGrow;if(!(!n||!e||!e.active)){if(!n.isConnected){e.firstAttemptAt==null&&(e.firstAttemptAt=pt()),e.attachAttempts+=1,e.attachAttempts<=Oo&&pt()-e.firstAttemptAt<To&&(ct.add(s),Vt());continue}e.attachAttempts=0,e.firstAttemptAt=null,e.resize()}}}function Ss(t,o){if(o.watch)return;const s=t.node;if(!s)return;const n=s.ownerDocument&&s.ownerDocument.defaultView,e=n&&n.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof e!="function")return;const c=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Rt(t,!0);return}const r=s.clientWidth;o.lastWidth!=null&&Math.abs(r-o.lastWidth)<.5||(o.lastWidth=r,Rt(t,!0))};let a;try{a=new e(c),a.observe(s)}catch{return}o.watch=a}function Cs(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function ne(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&&Rt(t,!0)},()=>{})}function ee(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,wo=t=>(ft(t.paddingTop)||0)+(ft(t.paddingBottom)||0),ks=t=>(ft(t.borderTopWidth)||0)+(ft(t.borderBottomWidth)||0);function re(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 e=o[n].trim();if(!(e!=="all"&&e!=="height")&&parseFloat(s[n%s.length])>0)return!0}return!1}function So(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 ie(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)||ce(t,o);return n>0?s*n+wo(o):null}const Mt=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],vs=new WeakMap;function ce(t,o){const s=t.ownerDocument,n=s&&(s.body||s.documentElement);if(!n||!s.createElement)return null;let e=vs.get(s);e||(e=new Map,vs.set(s,e));const c=Mt.map(f=>o[f]||"").join("|");if(e.has(c))return e.get(c);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const r=a.style;r.position="absolute",r.visibility="hidden",r.top="0",r.left="-9999px",r.height="auto",r.minHeight="0",r.maxHeight="none",r.padding="0",r.border="0",r.boxSizing="content-box",r.overflow="hidden";for(let f=0;f<Mt.length;f++)o[Mt[f]]&&(r[Mt[f]]=o[Mt[f]]);let i=0;try{n.appendChild(a),i=a.clientHeight}catch{i=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return i>0?(e.set(c,i),i):null}function fe(t,o){return o?o.boxSizing==="border-box"?t+ks(o):o.boxSizing==="content-box"?Math.max(0,t-wo(o)):t:t}function ae(t){if(!t)return null;const o=ft(t.maxHeight);if(o==null||!(o>0))return null;const s=wo(t),n=ks(t),e=t.boxSizing==="border-box"?o-n:o+s,c=ft(t.lineHeight);if(!(c>0))return e;const a=Math.floor((e-s)/c+1e-6);return a>=1?a*c+s:e}function js(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 Es=["srcObject","muted"],ue=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function de(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let n=0;n<Es.length;n++){const e=Es[n],c=t[e];if(c===void 0||!(e in o))continue;const a=r=>{const i=ue(e,r);if(o[e]!==i)try{o[e]=i}catch(f){$(s,e,f)}};if(typeof c=="function"){const r=R(t,t[e+"Deps"],c),i=(0,E.createEffect)(()=>{try{a(r(t,t.state,t.context))}catch(f){$(s,e,f)}},{depth:s.path.length,label:P(s,e)});s.__effects.push(i),s.__exec[e]=c}else a(c);e==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function le(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const s=t.__ref,n=t.autoGrow,e=typeof n=="function"?R(t,t.autoGrowDeps,n):null,c=(0,E.createEffect)(()=>{const a=t.autoGrow;let r=a;if(typeof a=="function")try{r=(a===n&&e?e:a)(t,t.state,t.context)}catch{r=null}oe(t,r)},{depth:s.path.length,label:P(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(c),e&&(s.__exec.autoGrow=n)}const Ps=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Os(t,o){for(const s of Object.keys(t)){if(!X(s)||Ps.has(s))continue;const n=(0,bt.globalEventKeyInfo)(s);if(n){(0,bt.registerGlobalEvent)(n,t,t[s]);continue}let e=t[s],c=null;if(e&&typeof e=="object"&&!Array.isArray(e)&&(c=e,e=c.handler),typeof e=="string"&&/^[A-Za-z_$][\w$]*$/.test(e)){const r=e;e=function(f){return t.call(r,f)}}if(typeof e!="function")continue;const a=tn(s);U.LIFECYCLE_EVENTS.has(a)||(0,bt.registerEvent)(on(a),t,e,c)}pe(t)}function pe(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let n=!1;for(const l of Ps){const _=t[l];typeof _=="function"&&(s[l]=_,n=!0)}if(!n)return;const e=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,r=0,i=0,f=!1;const d=l=>{const _=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];_&&(a=_.clientX,r=_.clientY,i=Date.now(),f=!0)},u=l=>{if(!f)return;f=!1;const _=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!_)return;const g=_.clientX-a,y=_.clientY-r,p=Date.now()-i;if(p>c)return;const A=Math.abs(g),w=Math.abs(y);if(Math.max(A,w)<e)return;let h;if(A>w*1.2)h=g<0?"left":"right";else if(w>A*1.2)h=y<0?"up":"down";else return;const b="onSwipe"+h.charAt(0).toUpperCase()+h.slice(1),x=s[b],S=s.onSwipe;x&&x.call(t,l,t,t.state,t.context),S&&S.call(t,{direction:h,dx:g,dy:y,dt:p,event:l},t,t.state,t.context)};o.addEventListener("touchstart",d,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",d)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function at(t,o){const s={...t};for(const n in o){const e=s[n],c=o[n];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?s[n]=at(e,c):s[n]=c}return s}function Co(t,o,s,n,e){if(!o||!t.node)return;const c=t.childExtends,a=yt(t,"childProps");if(Array.isArray(o)){const r=t.tag==="fragment",i=t.context?.document||globalThis.document,f=r?null:i?.createDocumentFragment();if(!r&&!f)return;const d=t.childProps,u=t.childrenAs,l=w=>{let h=o[w];const b=h;(typeof h=="string"||typeof h=="number")&&(h={text:h});let x=d;if(typeof d=="function")try{x=d(t,h)}catch{x=null}let S=typeof d=="function"?Et(x):a;if(e&&u!=="state"&&(S=Pt(S,Et(b))),u==="state"){let C=b;(typeof b=="string"||typeof b=="number")&&(C={value:b,text:b}),h=x?{...x,state:C}:{state:C}}else x&&(h=at(x,h));if(c&&!h.ignoreChildExtends)if(h.extends){const C=Array.isArray(h.extends)?h.extends:[h.extends],F=Array.isArray(c)?c:[c];h={...h,extends:[...F,...C]}}else h={...h,extends:c};const k=Lo(h?.key,b,w,t);try{return m(Ot(h,S),t,k,s)}catch(C){if(typeof console<"u"&&console.error){const F=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${F} (initial render, skipping this row):`,C?.message||C)}return null}},_=t.__ref;if(!(n===!0&&!r&&!!_&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let w=0;w<o.length;w++){const h=l(w);!r&&h?.node&&f.appendChild(h.node)}return r||t.node.appendChild(f),!0}const y=_.__childrenChunkGen=(_.__childrenChunkGen||0)+1;(0,z.openMountBudget)();let p=null;const A=w=>{if(_.__disposed||_.__childrenChunkGen!==y){p&&p.parentNode&&p.remove();return}for(let h=w;h<o.length;h++){const b=l(h);if(b?.node&&(p?t.node.insertBefore(b.node,p):f.appendChild(b.node)),h+1<o.length&&(0,z.mountBudgetExhausted)()){p||(p=i.createComment("smbls-mount"),f.appendChild(p),t.node.appendChild(f));const x=h+1;(0,z.enqueueMountWork)(()=>A(x));return}}p?(p.remove(),t.node.tagName==="SELECT"&&qt(t,!0)):t.node.appendChild(f)};return A(0),(0,z.closeMountBudget)(),!0}if(typeof o=="string"){const r=Io(o,t);if(Array.isArray(r))return Co(t,r,s,n,!0)}if(typeof o=="object")for(const r in o){if(U.REGISTRY.has(r))continue;let i=o[r];if(i==null||i===!1)continue;const f=e?Pt(a,Et(i)):a;if((typeof i=="string"||typeof i=="number")&&(i={text:i}),t.childProps&&(i=at(t.childProps,i)),c&&!i.ignoreChildExtends)if(i.extends){const d=Array.isArray(i.extends)?i.extends:[i.extends],u=Array.isArray(c)?c:[c];i={...i,extends:[...u,...d]}}else i={...i,extends:c};m(Ot(i,f),t,Kt(t,r),s)}}function qt(t,o){const s=t.node;if(!s||s.tagName!=="SELECT")return;const n=s.options;if(!n||!n.length)return;const e=t.__ref,c=e&&e.__exec&&e.__exec.value,a=typeof c=="function",r=t.value!=null&&typeof t.value!="function";if(a||r){let d;if(a)try{d=c(t,t.state,t.context)}catch{return}else d=t.value,typeof d=="string"&&d.includes("{{")&&(d=L.replaceLiteralsWithObjectFields.call(t,d,t.state));const u=d==null?"":String(d);s.value!==u&&(s.value=u);return}const i=o||!(e&&e.__selectSynced);if(e&&(e.__selectSynced=!0),!i)return;let f=-1;for(let d=0;d<n.length;d++)n[d].defaultSelected&&(f=d);f>=0&&s.selectedIndex!==f&&(s.selectedIndex=f)}function Ts(t,o){let{children:s,content:n}=t;const e=t.childExtends,c=typeof s=="function"||zo(t,"children");if(typeof s=="function"){const g=s;try{s=g(t,t.state,t.context)}catch(h){if(s=void 0,typeof console<"u"&&console.error){const b=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${b} (initial run, treating as empty):`,h?.message||h)}}Yo(t,s),t.children=s;const y=t.__ref;let p=!1;const A=R(t,t.childrenDeps,g),w=(0,E.createEffect)(()=>{const h=p;p=!0;let b;try{b=A(t,t.state,t.context)}catch(T){if(typeof console<"u"&&console.error){const B=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${B}${h?"":" (initial tracking run)"}:`,T?.message||T)}return}if(!h||b===t.children)return;Yo(t,b),t.children=b,y.__childrenChunkGen!=null&&y.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",S=x?[]:null,k=x?[]:null,C=x?[]:null;if(Array.isArray(b)&&t.childrenAs==="state"){const T=t.childProps,B=[],xt=new Map;for(let O=0;O<b.length;O++){const Y=b[O];let D=T;if(typeof T=="function")try{D=T(t,Y)}catch{D=null}const Q=Lo(D&&D.key,Y,O,t);B.push(Q),xt.set(Q,{rawChild:Y,childProps:D})}const $s=new Set(B),Is=y.__children.slice();for(const O of Is)if(!$s.has(O)){const Y=t[O];Y?.remove&&Y.remove(),delete t[O],k&&k.push(O)}const wt=t.childExtends,Bt=t.tag==="fragment",Bs=t.context?.document||globalThis.document,St=Bt?null:Bs?.createDocumentFragment(),Xt=new Set;for(const O of B){const Y=xt.get(O),D=Y.rawChild,Q=t[O];if(Q&&Q.state){if(D&&typeof D=="object"){const V=Q.state,dt=V.$replace||V.replace,ko=V.$update||V.update;try{if(typeof dt=="function")dt.call(V,D);else if(typeof ko=="function"){for(const W in V)if(!(W==="__element"||W==="root"||W==="parent"||W==="update")&&!Object.prototype.hasOwnProperty.call(D,W))try{V[W]=void 0}catch{}ko.call(V,D)}else for(const W in D)V[W]=D[W]}catch(W){if(typeof console<"u"&&console.error){const Us=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${O}" failed to patch at ${Us} (reconcile, keeping its previous data for this pass):`,W?.message||W)}}}C&&C.push(O);continue}let Jt=D;(typeof D=="string"||typeof D=="number")&&(Jt={value:D,text:D});const mt=Y.childProps;let Z=mt?{...mt,state:Jt}:{state:Jt};const Hs=typeof T=="function"?Et(mt):yt(t,"childProps");if(wt&&!Z.ignoreChildExtends)if(Z.extends){const V=Array.isArray(Z.extends)?Z.extends:[Z.extends],dt=Array.isArray(wt)?wt:[wt];Z={...Z,extends:[...dt,...V]}}else Z={...Z,extends:wt};let to;try{to=m(Ot(Z,Hs),t,O,o)}catch(V){if(typeof console<"u"&&console.error){const dt=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${O}" failed to construct at ${dt} (reconcile, skipping this row):`,V?.message||V)}Xt.add(O);continue}!Bt&&to?.node&&St&&St.appendChild(to.node),S&&S.push(O)}if(!Bt&&St&&St.childNodes.length&&t.node&&t.node.appendChild(St),!Bt&&t.node){let O=null;for(const Y of B){const D=t[Y]?.node;if(!D)continue;const Q=O?O.nextSibling:t.node.firstChild;D!==Q&&t.node.insertBefore(D,Q),O=D}}y.__children=Xt.size?B.filter(O=>!Xt.has(O)):B,x&&(S.length||k.length)&&Do(t,{added:S,removed:k,kept:C}),qt(t,!1);return}const it=x?[...y.__children]:null;for(const T of[...y.__children]){const B=t[T];B?.remove&&B.remove(),delete t[T]}y.__children=[],Co(t,b,o,!1,!0),qt(t,!1),x&&Do(t,{added:[...y.__children],removed:it,kept:[]})},{depth:y.path.length,label:P(y,"children")});y.__effects.push(w)}const a=Co(t,s,o,!0,c);if(n!=null&&!(n&&n.__ref)){let g=n;if(typeof g=="string"||typeof g=="number"?g={text:g}:typeof g!="object"&&(g={}),t.childProps&&(g=at(t.childProps,g)),e&&!g.ignoreChildExtends)if(g.extends){const p=Array.isArray(g.extends)?g.extends:[g.extends],A=Array.isArray(e)?e:[e];g={...g,extends:[...A,...p]}}else g={...g,extends:e};const y=Pt(yt(t,"childProps"),yt(t,"content"));m(Ot(g,y),t,"content",o)}if(s&&!a)return;const r=t.context?.components||{},i=t.__ref&&t.__ref.__runtimeSource,f=i?{}:null;{const g=Object.keys(t);for(let y=0;y<g.length;y++){const p=g[y];if(!p.endsWith("Extends")||typeof t[p]!="string")continue;const A=p.slice(0,-7);if(!A||A.charCodeAt(0)<65||A.charCodeAt(0)>90)continue;const w={extends:t[p]};delete t[p];for(let h=y+1;h<g.length;h++){const b=g[h],x=b.charCodeAt(0);if(x>=65&&x<=90||U.REGISTRY.has(b)||typeof t[b]=="function"&&(b.startsWith("on")||b.startsWith(".")))break;const S=t[b];S!==void 0&&(w[b]=S,delete t[b],f&&jt(i,b)&&(f[A]||(f[A]={}),f[A][b]=i[b]))}t[A]&&typeof t[A]=="object"?t[A]={...w,...t[A]}:t[A]=w}}const d=o?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),l=g=>{if(U.REGISTRY.has(g)||typeof t[g]!="object"||t[g]===null)return;const y=g.charCodeAt(0);if(y<65||y>90)return;let p=t[g];if(p.__ref)return;if(!p.extends&&!p.extend){const w=r[g]||r[`smbls.${g}`];w&&(p={...p,extends:w})}if(t.childProps&&(p=at(t.childProps,p)),e&&!p.ignoreChildExtends)if(p.extends){const w=Array.isArray(p.extends)?p.extends:[p.extends],h=Array.isArray(e)?e:[e];p={...p,extends:[...h,...w]}}else p={...p,extends:e};const A=i?Pt(yt(t,"childProps"),Pt(f[g]||null,yt(t,g))):null;m(Ot(p,A),t,g,o)};if(!d){for(const g of u)l(g);return}(0,z.openMountBudget)();const _=g=>{for(let y=g;y<u.length;y++)if(l(u[y]),y+1<u.length&&(0,z.mountBudgetExhausted)()){const p=y+1;(0,z.enqueueMountWork)(()=>_(p));return}};_(0),(0,z.closeMountBudget)()}function Ds(t,o,s){const{node:n}=t;if(!n)return;n.ref=t;const e=o?.tag==="fragment"?o.__ref?.__fragmentAnchor:null;if(e){const a=e.parentNode;if(a){if(s?.position==="before"&&s.node)a.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const r=s.node.nextSibling;a.insertBefore(n,r||e)}else a.insertBefore(n,e);return}}const c=o?.node||(o?.nodeType?o:null);if(c)if(s?.position==="before"&&s.node)c.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;a?c.insertBefore(n,a):c.appendChild(n)}else c.appendChild(n)}const Qt=3;function Fs(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Qt?!1:(t.__inBeforeUpdate=!0,!0)}function It(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Qt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Qt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function N(t,o,s){const n=t.charAt(0).toLowerCase()+t.slice(1);(0,K.dispatchPluginHook)(n,o,s);const e="on"+t,c=o[e];if(typeof c=="function"){const i=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(i){if(o.__ref[i])return!0;o.__ref[i]=!0}const f=o.context?.designSystem;f&&(0,M.pushConfig)(f);let d=!!i;try{const u=c(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const l=o.__ref;return u.catch(_=>{(0,K.reportLifecycleError)(o,e,_)}).finally(()=>{i&&l&&(l[i]=!1)}),d=!1,!0}if(u===!1)return!1}catch(u){if((0,K.reportLifecycleError)(o,e,u),o.context?.strictMode)throw u}finally{f&&(0,M.popConfig)(),d&&o.__ref&&(o.__ref[i]=!1)}}return!0}var he=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var H=Object.create;var a=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var l=(s,e)=>{for(var t in e)a(s,t,{get:e[t],enumerable:!0})},r=(s,e,t,N)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of A(e))!m.call(s,o)&&o!==t&&a(s,o,{get:()=>e[o],enumerable:!(N=n(e,o))||N.enumerable});return s};var _=(s,e,t)=>(t=s!=null?H(h(s)):{},r(e||!s||!s.__esModule?a(t,"default",{value:s,enumerable:!0}):t,s)),C=s=>r(a({},"__esModule",{value:!0}),s);var i={};l(i,{CSS_LONGHAND_SHORTHANDS:()=>O,CSS_SHORTHAND_LONGHANDS:()=>D,cssCamelName:()=>L,cssPropName:()=>d,cssShorthandStatesLonghand:()=>p});module.exports=C(i);var S=_(require("@symbo.ls/css"),1);if(!S.CSS_SHORTHAND_LONGHANDS||!S.CSS_LONGHAND_SHORTHANDS)throw new Error("@symbo.ls/element: the installed @symbo.ls/css does not export CSS_SHORTHAND_LONGHANDS / CSS_LONGHAND_SHORTHANDS (the CSS shorthand family table, packages/css/src/cssLonghands.js). This element needs the @symbo.ls/css published in the same release \u2014 update @symbo.ls/css.");const D=S.CSS_SHORTHAND_LONGHANDS,O=S.CSS_LONGHAND_SHORTHANDS,p=S.cssShorthandStatesLonghand||(()=>!1),c=s=>s.charCodeAt(0)===45&&s.charCodeAt(1)===45,d=S.cssPropName||(s=>c(s)?s:s.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())),L=S.cssCamelName||(s=>c(s)?s:s.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()));
|
package/dist/cjs/src/dispose.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var n=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var h=(r,o)=>{for(var f in o)n(r,f,{get:o[f],enumerable:!0})},l=(r,o,f,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let _ of p(o))!u.call(r,_)&&_!==f&&n(r,_,{get:()=>o[_],enumerable:!(e=d(o,_))||e.enumerable});return r};var v=r=>l(n({},"__esModule",{value:!0}),r);var y={};h(y,{dispose:()=>t,remove:()=>g});module.exports=v(y);var s=require("@symbo.ls/signal"),c=require("./runContext.js"),a=require("./bridge.js");function t(r){if(!r)return;const o=r.__ref;if(!o)return;if((0,s.getObserver)())return(0,c.untrack)(()=>t(r));o.__disposed=!0;try{typeof r.onBeforeRemove=="function"&&r.onBeforeRemove(r,r.state,r.context)}catch(e){console.error("[smbls] onBeforeRemove error:",e)}if(o.__bridge&&(0,a.destroyBridge)(r),o.__effects){for(let e=0;e<o.__effects.length;e++)o.__effects[e].dispose();o.__effects.length=0}if(typeof o.__releaseMedia=="function"&&(o.__releaseMedia(),o.__releaseMedia=null),o.__eventCleanup){for(let e=0;e<o.__eventCleanup.length;e++)o.__eventCleanup[e]();o.__eventCleanup.length=0}if(o.__children){const e=o.__children.slice();o.__children.length=0;for(let _=0;_<e.length;_++){const i=r[e[_]];i&&i.__ref&&t(i)}}r.node?.parentNode?r.node.remove():r.tag==="fragment"&&o.__fragmentAnchor?.parentNode&&o.__fragmentAnchor.remove();const f=r.state?.$destroy||r.state?.destroy;if(typeof f=="function"&&r.state.__element===r&&f.call(r.state),r.parent?.__ref?.__children){const e=r.parent.__ref.__children.indexOf(r.key);e!==-1&&r.parent.__ref.__children.splice(e,1),delete r.parent[r.key]}try{typeof r.onRemove=="function"&&r.onRemove(r)}catch(e){console.error("[smbls] onRemove error:",e)}r.node=null,r.parent=null,r.__ref=null}function g(){t(this)}
|
package/dist/cjs/src/extends.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var l=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var L=(r,t)=>{for(var e in t)l(r,e,{get:t[e],enumerable:!0})},M=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of k(t))!b.call(r,s)&&s!==e&&l(r,s,{get:()=>t[s],enumerable:!(n=S(t,s))||n.enumerable});return r};var C=r=>M(l({},"__esModule",{value:!0}),r);var H={};L(H,{applyExtends:()=>N,closeMergeLayer:()=>E,openMergeLayer:()=>g});module.exports=C(H);var _=require("css-in-props"),f=require("./cssLonghands.js");const R=new WeakMap;function y(r){const t=[];return r.extends&&(Array.isArray(r.extends)?t.push(...r.extends):t.push(r.extends)),r.extend&&(Array.isArray(r.extend)?t.push(...r.extend):t.push(r.extend)),t}function N(r,t,e){const n=y(t);if(!n.length)return;const c=(r.context||e?.context||{}).components||{};for(let o=0;o<n.length;o++){const a=d(n[o],c);a&&a!==t&&h(r,a,e,new Set([t]))}}function d(r,t){if(typeof r=="string"){if(r.includes(">")){const e=r.split(">").map(s=>s.trim());let n=t[e[0]]||t[`smbls.${e[0]}`];for(let s=1;s<e.length&&n;s++)n=n[e[s]];return n||null}return t[r]||t[`smbls.${r}`]||null}return typeof r=="object"&&r!==null?r:null}function h(r,t,e,n=new Set){if(n.has(t))return;n.add(t);const s=y(t);if(s.length){const a=(r.context||e?.context||{}).components||{};for(let i=0;i<s.length;i++){const p=d(s[i],a);p&&h(r,p,e,n)}}const c=g(r);for(const o in t){if(o==="extends"||o==="extend")continue;const a=t[o];c&&c.mark(o),r[o]===void 0?a&&typeof a=="object"&&!Array.isArray(a)&&typeof a!="function"?r[o]={...a}:r[o]=a:typeof r[o]=="object"&&typeof a=="object"&&!Array.isArray(r[o])&&!Array.isArray(a)&&r[o]!==null&&a!==null?r[o]=x(r[o],a):r[o]=a}}class w{constructor(){this.rank=0,this.ranks=null}mark(t){j(t)&&(this.ranks||(this.ranks=new Map),this.ranks.set(t,this.rank))}get(t){return this.ranks?this.ranks.get(t):void 0}get size(){return this.ranks?this.ranks.size:0}}const u=new Set;for(const r of[f.CSS_LONGHAND_SHORTHANDS,f.CSS_SHORTHAND_LONGHANDS])for(const t in r)u.add(t),u.add((0,f.cssCamelName)(t));const A=new Map;function j(r){const t=r.charCodeAt(0);if(t>=65&&t<=90||t>=48&&t<=57)return!1;let e=A.get(r);return e===void 0&&(e=!!_.CSS_PROPS_REGISTRY[r]||u.has(r)||r.indexOf("-")>=0&&!(r.charCodeAt(0)===45&&r.charCodeAt(1)===45)&&u.has((0,f.cssPropName)(r)),A.set(r,e)),e}function g(r){const t=r&&r.__ref;if(!t)return null;let e=t.__mergeLayer;return e||(e=t.__mergeLayer=new w),e.rank++,e}function E(r){const t=r&&r.__ref&&r.__ref.__mergeLayer;if(!t||!t.ranks)return;let e;for(const n of t.ranks.values())if(e===void 0)e=n;else if(n!==e)return;t.ranks=null}function x(r,t){const e={...r};for(const n in t){const s=e[n],c=t[n];s&&c&&typeof s=="object"&&typeof c=="object"&&!Array.isArray(s)&&!Array.isArray(c)&&typeof s!="function"&&typeof c!="function"?e[n]=x(s,c):e[n]=c}return e}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var h=Object.defineProperty;var
|
|
1
|
+
"use strict";var h=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var P=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0})},k=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of R(t))!x.call(e,o)&&o!==n&&h(e,o,{get:()=>t[o],enumerable:!(r=N(t,o))||r.enumerable});return e};var L=e=>k(h({},"__esModule",{value:!0}),e);var Y={};P(Y,{inertOutsidePlugin:()=>U});module.exports=L(Y);var F=require("@symbo.ls/signal"),M=require("./runContext.js");const a="inertOutside",D=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT","BASE","TITLE"]),q='a[href], button, input:not([type="hidden"]), select, textarea, summary, [tabindex], [contenteditable]:not([contenteditable="false"])',W={attributes:!0,attributeFilter:["inert"]},w=new WeakMap,g=new WeakMap,d=new Set,O=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function f(e){try{return(0,M.untrack)(e)}catch(t){console.error("[smbls] inertOutside:",t)}}function _(e){const t=()=>f(e);typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t)}function B(e){if(!e||!e.defaultView||!("activeElement"in e))return null;let t=w.get(e);if(t)return t;const n=e.defaultView.MutationObserver||globalThis.MutationObserver;return typeof n!="function"?null:(t={doc:e,layers:[],held:new Map,top:null,observer:null},t.observer=new n(r=>f(()=>b(t,r))),w.set(e,t),t)}function S(e,t){const n=e.element.node;return!!n&&n.nodeType===1&&n.isConnected&&n.ownerDocument===t}function V(e){const t=e.activeElement;return t&&t!==e.body&&t!==e.documentElement?t:null}const T=e=>!!(e.closest&&e.closest("[inert]"));function j(e){const t=e.ownerDocument,n=new Set,r=[];for(let o=e;o!==t.body;o=o.parentNode){const c=o.parentNode;if(!c||c.nodeType!==1||c===t.documentElement)break;r.push(c);for(let u=c.firstElementChild;u;u=u.nextElementSibling)u!==o&&!D.has(u.tagName)&&n.add(u)}return{outside:n,parents:r}}function m(e,t){for(let n=0;n<t.length;n++){const{type:r,target:o}=t[n];r==="attributes"&&e.held.has(o)&&e.held.set(o,!o.hasAttribute("inert"))}}function b(e,t){const{doc:n,held:r,observer:o}=e;t&&m(e,t),m(e,o.takeRecords());const c=e.top,u=[];for(const s of e.layers){const y=S(s,n);y&&!s.live&&(u.push(s),s.returnFocus=V(n)),s.live=y}u.length&&(e.layers=e.layers.filter(s=>!u.includes(s)).concat(u));let i=null;for(let s=e.layers.length-1;s>=0&&!i;s--)e.layers[s].live&&(i=e.layers[s]);e.top=i;const{outside:p,parents:v}=i?j(i.element.node):{outside:new Set,parents:[]};for(const[s,y]of r)p.has(s)||(y&&s.removeAttribute("inert"),r.delete(s));for(const s of p)r.has(s)||r.set(s,!1),s.hasAttribute("inert")||(s.setAttribute("inert",""),r.set(s,!0));o.takeRecords(),o.disconnect();for(const s of v)o.observe(s,{childList:!0});for(const s of r.keys())o.observe(s,W);if(e.layers.some(s=>!s.live)?d.add(e):d.delete(e),i===c)return;const l=c&&!(c.declared&&c.live)?c:null;if(i&&u.includes(i))l&&l.returnFocus&&(i.returnFocus=l.returnFocus),_(()=>A(e,i));else if(l){const s=l.returnFocus;_(()=>z(e,l,s))}l&&(l.returnFocus=null)}function A(e,t){const n=t.element.node;if(e.top!==t||!n||!n.isConnected)return;const r=e.doc,o=r.activeElement;if(o&&n.contains(o))return;const c=new Set,u=(i,p)=>{if(c.has(i)||(c.add(i),i.matches(":disabled")))return!1;const v=p&&i.getAttribute("tabindex");return v&&parseInt(v,10)<0?!1:(i.focus(),r.activeElement===i)};for(const i of n.querySelectorAll("[autofocus]"))if(u(i,!1))return;for(const i of n.querySelectorAll(q))if(u(i,!0))return;o&&o!==r.body&&typeof o.blur=="function"&&o.blur()}function z(e,t,n){if(t.declared&&t.live)return;const r=e.doc,o=r.activeElement,c=t.element.node;(!o||o===r.body||c&&c.contains(o)||T(o))&&(n&&n.isConnected&&n.ownerDocument===r&&!T(n)&&(n.focus({preventScroll:!0}),r.activeElement===n)||e.top&&A(e,e.top))}function E(e,t){if(e.declared===t)return;const n=e.manager;if(e.declared=t,e.live=!1,t)n.layers.push(e);else{const r=n.layers.indexOf(e);r!==-1&&n.layers.splice(r,1)}b(n)}function C(e){let t=e[a];if(typeof t=="function")try{t=t(e,e.state,e.context)}catch{t=!1}return!!t}function I(e){let t=g.get(e);if(t)return t;const n=e.__ref,r=e.node;if(!n||!r||r.nodeType!==1)return null;const o=B(r.ownerDocument);if(!o)return null;t={element:e,manager:o,declared:!1,live:!1,returnFocus:null},g.set(e,t);const c=(0,F.createEffect)(()=>{const u=C(e);f(()=>E(t,u))},{depth:n.path.length,label:()=>n.path.join(".")+"::"+a});return n.__effects||(n.__effects=[]),n.__effects.push(c),n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>f(()=>E(t,!1))),t}function K(){for(const e of d){if(!e.doc.defaultView){d.delete(e);continue}e.layers.some(t=>!t.live&&S(t,e.doc))&&b(e)}}const U={name:a,create(e){O(e,a)&&f(()=>I(e))},render(){d.size&&f(K)},update(e){O(e,a)&&f(()=>{const t=I(e);t&&E(t,C(e))})}};
|