@symbo.ls/element 3.14.794 → 3.14.795

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.
@@ -1,6 +1,6 @@
1
- "use strict";var Vo=Object.create;var xt=Object.defineProperty;var Wo=Object.getOwnPropertyDescriptor;var zo=Object.getOwnPropertyNames;var Yo=Object.getPrototypeOf,qo=Object.prototype.hasOwnProperty;var Zo=(t,s)=>{for(var o in s)xt(t,o,{get:s[o],enumerable:!0})},Jt=(t,s,o,e)=>{if(s&&typeof s=="object"||typeof s=="function")for(let n of zo(s))!qo.call(t,n)&&n!==o&&xt(t,n,{get:()=>s[n],enumerable:!(e=Wo(s,n))||e.enumerable});return t};var Qo=(t,s,o)=>(o=t!=null?Vo(Yo(t)):{},Jt(s||!t||!t.__esModule?xt(o,"default",{value:t,enumerable:!0}):o,t)),Xo=t=>Jt(xt({},"__esModule",{value:!0}),t);var $s={};Zo($s,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>Dt,acquireBeforeUpdateGuard:()=>Bo,create:()=>Q,default:()=>Fs,flushMounts:()=>Ot,isStaticCssProp:()=>Ts,recompileStaticCss:()=>Ps,reconcileAttrProp:()=>Ls,releaseBeforeUpdateGuard:()=>gt,writeElementText:()=>_t});module.exports=Xo($s);var N=require("@symbo.ls/signal"),E=require("@symbo.ls/signal"),ot=require("./cache.js"),G=require("./registry.js"),ct=require("./delegate.js"),Fo=require("./extends.js"),$o=require("./methods.js"),Gs=require("./dispose.js"),tt=require("./devRuntime.js"),H=require("./mountScheduler.js"),D=require("@symbo.ls/utils"),wt=Qo(require("@symbo.ls/utils"),1),W=require("@symbo.ls/utils/function.js"),it=require("@symbo.ls/state"),w=require("css-in-props"),q=require("@symbo.ls/css"),v=require("@symbo.ls/scratch"),S=require("attrs-in-props"),Io=require("./engineRegistry.js"),Zt=require("./cssLonghands.js"),Z=require("./attributeFirst.js"),Uo=require("./version.js");const mt=(0,Io.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},Uo.VERSION),ut=[],J=new Set;let Ft=!1,to=0,et=null,lt=null;function nt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function oo(){return typeof document<"u"&&document.visibilityState==="hidden"}const Jo=250,mo=1e3;function ts(){return lt&&(lt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||oo())?!0:nt()-to>=mo}function os(){if(Ft=!0,to=nt(),lt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Ot,0);et=t?()=>t(s):null;return}if(oo()){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Ot,Jo);et=t?()=>t(s):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;lt=requestAnimationFrame;const s=requestAnimationFrame(Ot);et=t?()=>t(s):null}}function Ct(){if(Ft){if(!ts())return;const t=et;if(et=null,t)try{t()}catch{}}os()}const so=300,eo=15e4;function Ot(){if(Ft=!1,et=null,lt=null,J.size&&Ds(),!ut.length)return;const t=ut.splice(0,ut.length);for(let s=0;s<t.length;s++){const o=t[s];if(o.node){if(!o.node.isConnected){const e=o.__ref||(o.__ref={});e.__mountAttempts=(e.__mountAttempts||0)+1,e.__mountFirstAttemptAt==null&&(e.__mountFirstAttemptAt=nt());const n=nt()-e.__mountFirstAttemptAt;e.__mountAttempts<=so&&n<eo?(ut.push(o),Ct()):console.warn("[DOMQL] onMounted dropped after",e.__mountAttempts,"attempts /",n,"ms \u2014 node never connected:",o.key||o.tag||o);continue}$("Mounted",o,o.__ref?.__mountOptions||{})}}}function $t(t,s){const o=t.__ref?.__autoGrow;o&&o.active&&ht(t,!0),typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,ut.push(t),Ct())}function no(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,W.runPluginHook)("contentUpdate",t,s);const o=t.context?.designSystem;o&&(0,v.pushConfig)(o);try{t.onContentUpdate(t,t.state,t.context,s)}catch(e){if(t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onContentUpdate",error:e})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',e),t.context?.strictMode)throw e}finally{o&&(0,v.popConfig)()}}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function ss(t){return t.charAt(2).toLowerCase()+t.slice(3)}function es(t){return t.toLowerCase()}function It(t){const s=t.charCodeAt(0);return s===58||s===64||s===38||s===91}function dt(t,s){const o={...t};for(const e in s){const n=o[e],c=s[e];n&&c&&typeof n=="object"&&typeof c=="object"&&!Array.isArray(n)&&!Array.isArray(c)&&typeof n!="function"&&typeof c!="function"?o[e]=dt(n,c):o[e]=c}return o}function St(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function ro(t,s,o){return St(t)||(s&&typeof s=="object"?St(s.key):void 0)||String(o)}function Q(t,s,o,e={},n){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t}),o=St(o);const c=St(t.key),r=Object.create(null);r.key=o||c||`_${mt.uniqId++}`,r.parent=s||null,r.context=t.context||s?.context||e.context||{},r.context.__create||(r.context.__create=Q);const d=r.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||r,path:s?.__ref?.path?[...s.__ref.path,r.key]:[r.key],origin:t};if(o&&!t.extends&&!t.extend){const u=o.indexOf("_"),l=o.indexOf(".");let b=u>0?u:-1;if(l>0&&(b<0||l<b)&&(b=l),b>0){const A=o.substring(0,b),k=r.context?.components;k&&(k[A]||k["smbls."+A])?t={...t,extends:A}:k&&(0,tt.isLoudDevRuntime)()&&(/^[A-Z]\w*_\d+$/.test(o)||/^[A-Z]\w*\.\w+$/.test(o))&&console.warn(`[smbls] auto-extend: key "${o}" looks like an instance of "${A}" but neither "${A}" nor "smbls.${A}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}(0,Fo.applyExtends)(r,t,e);const i=new Set(["childProps","attr","style","scope","data"]),_=r.props&&typeof r.props=="object"?r.props:null;for(const u in t){if(u==="parent"||u==="node"||u==="__ref"||u==="extends"||u==="context"||u==="props")continue;if(u==="key"){c&&(r.key=c);continue}const l=t[u],b=r[u],A=b&&l&&typeof b=="object"&&typeof l=="object"&&!Array.isArray(b)&&!Array.isArray(l)&&typeof b!="function"&&typeof l!="function";A&&u.charCodeAt(0)>=65&&u.charCodeAt(0)<=90?r[u]=dt(b,l):A&&i.has(u)?r[u]={...b,...l}:A&&It(u)?r[u]=dt(b,l):r[u]=l}function g(u){for(const l in u){const b=u[l],A=r[l],k=A&&b&&typeof A=="object"&&typeof b=="object"&&!Array.isArray(A)&&!Array.isArray(b)&&typeof A!="function"&&typeof b!="function";k&&l.charCodeAt(0)>=65&&l.charCodeAt(0)<=90?r[l]=dt(A,b):k&&i.has(l)?r[l]={...A,...b}:k&&It(l)?r[l]=dt(A,b):r[l]=b}}_&&g(_),t.props&&typeof t.props=="object"&&g(t.props),t.classlist!==void 0&&(r.classlist=t.classlist),t.text!==void 0&&(r.text=t.text),t.html!==void 0&&(r.html=t.html);const f=r.scope&&typeof r.scope=="object"?r.scope:null,p=s?.scope,y=r.context&&typeof r.context.globalScope=="object"&&r.context.globalScope||null,a=p||y||null;if(t.scope!==void 0||f){const u={};f&&Object.assign(u,f),t.scope!==void 0&&Object.assign(u,t.scope),r.scope=(0,N.createScopeStore)(u,a)}else a&&(r.scope=a);if(t.if!==void 0&&(r.if=t.if),(0,$o.addMethods)(r),ns(r,s,t),r.if!=null){let u;if(typeof r.if=="function")try{u=r.if(r,r.state,r.context)}catch(l){if(u=!1,d.__ifError=l,typeof console<"u"&&console.warn){const b=r.key||r.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${b} \u2014 treating as false:`,l?.message||l)}}else u=r.if;d.__if=!!u}if(d.__if)typeof r.if=="function"&&(d.__ifInitialized=!0);else return s&&(s[r.key]=r),typeof r.if=="function"&&po(r,d,r.if),r;r.tag||(r.tag=(0,ot.detectTag)(r)),$("Init",r,e);const h=r.node=(0,ot.cacheNode)(r);if(!h)return r;if(r.tag==="fragment"){const l=(r.context?.document||globalThis.document).createComment("");h.appendChild(l),d.__fragmentAnchor=l}$("AttachNode",r,e),h.setAttribute&&r.key&&h.setAttribute("data-key",r.key),s&&(s[r.key]=r,s.__ref?.__children&&(s.__ref.__children.includes(r.key)||s.__ref.__children.push(r.key))),h.setAttribute&&r.context?.scopeSelector&&r.context.scopeSelector!==":root"&&r.context.key&&r.key===r.context.key&&h.setAttribute("data-smbls-app",r.context.key),r.id&&h.setAttribute&&(h.id=r.id),Ro(r,e),uo(r),Bt(r),Eo(r),Oo(r);try{No(r,e)}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(`
1
+ "use strict";var Wo=Object.create;var xt=Object.defineProperty;var zo=Object.getOwnPropertyDescriptor;var Yo=Object.getOwnPropertyNames;var qo=Object.getPrototypeOf,Zo=Object.prototype.hasOwnProperty;var Qo=(t,s)=>{for(var o in s)xt(t,o,{get:s[o],enumerable:!0})},Jt=(t,s,o,n)=>{if(s&&typeof s=="object"||typeof s=="function")for(let e of Yo(s))!Zo.call(t,e)&&e!==o&&xt(t,e,{get:()=>s[e],enumerable:!(n=zo(s,e))||n.enumerable});return t};var Xo=(t,s,o)=>(o=t!=null?Wo(qo(t)):{},Jt(s||!t||!t.__esModule?xt(o,"default",{value:t,enumerable:!0}):o,t)),Jo=t=>Jt(xt({},"__esModule",{value:!0}),t);var Bs={};Qo(Bs,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>Dt,acquireBeforeUpdateGuard:()=>Go,create:()=>q,default:()=>Us,flushMounts:()=>Ot,isStaticCssProp:()=>Ps,recompileStaticCss:()=>Ls,reconcileAttrProp:()=>Os,releaseBeforeUpdateGuard:()=>gt,writeElementText:()=>_t});module.exports=Jo(Bs);var N=require("@symbo.ls/signal"),k=require("@symbo.ls/signal"),ot=require("./cache.js"),G=require("./registry.js"),ct=require("./delegate.js"),$o=require("./extends.js"),Io=require("./methods.js"),Ks=require("./dispose.js"),tt=require("./devRuntime.js"),H=require("./mountScheduler.js"),D=require("@symbo.ls/utils"),wt=Xo(require("@symbo.ls/utils"),1),W=require("@symbo.ls/utils/function.js"),it=require("@symbo.ls/state"),S=require("css-in-props"),Z=require("@symbo.ls/css"),j=require("@symbo.ls/scratch"),v=require("attrs-in-props"),Uo=require("./engineRegistry.js"),Zt=require("./cssLonghands.js"),Q=require("./attributeFirst.js"),Bo=require("./version.js");const mt=(0,Uo.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},Bo.VERSION),ut=[],J=new Set;let Ft=!1,to=0,et=null,lt=null;function nt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function oo(){return typeof document<"u"&&document.visibilityState==="hidden"}const mo=250,ts=1e3;function os(){return lt&&(lt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||oo())?!0:nt()-to>=ts}function ss(){if(Ft=!0,to=nt(),lt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Ot,0);et=t?()=>t(s):null;return}if(oo()){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Ot,mo);et=t?()=>t(s):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;lt=requestAnimationFrame;const s=requestAnimationFrame(Ot);et=t?()=>t(s):null}}function Ct(){if(Ft){if(!os())return;const t=et;if(et=null,t)try{t()}catch{}}ss()}const so=300,eo=15e4;function Ot(){if(Ft=!1,et=null,lt=null,J.size&&Rs(),!ut.length)return;const t=ut.splice(0,ut.length);for(let s=0;s<t.length;s++){const o=t[s];if(o.node){if(!o.node.isConnected){const n=o.__ref||(o.__ref={});n.__mountAttempts=(n.__mountAttempts||0)+1,n.__mountFirstAttemptAt==null&&(n.__mountFirstAttemptAt=nt());const e=nt()-n.__mountFirstAttemptAt;n.__mountAttempts<=so&&e<eo?(ut.push(o),Ct()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",e,"ms \u2014 node never connected:",o.key||o.tag||o);continue}I("Mounted",o,o.__ref?.__mountOptions||{})}}}function $t(t,s){const o=t.__ref?.__autoGrow;o&&o.active&&ht(t,!0),typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,ut.push(t),Ct())}function no(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,W.runPluginHook)("contentUpdate",t,s);const o=t.context?.designSystem;o&&(0,j.pushConfig)(o);try{t.onContentUpdate(t,t.state,t.context,s)}catch(n){if(t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{o&&(0,j.popConfig)()}}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function es(t){return t.charAt(2).toLowerCase()+t.slice(3)}function ns(t){return t.toLowerCase()}function It(t){const s=t.charCodeAt(0);return s===58||s===64||s===38||s===91}function dt(t,s){const o={...t};for(const n in s){const e=o[n],c=s[n];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?o[n]=dt(e,c):o[n]=c}return o}function St(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function ro(t,s,o){return St(t)||(s&&typeof s=="object"?St(s.key):void 0)||String(o)}function q(t,s,o,n={},e){const c=(0,k.getObserver)();if(c){(0,k.setObserver)(null);try{return q(t,s,o,n,e)}finally{(0,k.setObserver)(c)}}if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t}),o=St(o);const a=St(t.key),r=Object.create(null);r.key=o||a||`_${mt.uniqId++}`,r.parent=s||null,r.context=t.context||s?.context||n.context||{},r.context.__create||(r.context.__create=q);const i=r.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||r,path:s?.__ref?.path?[...s.__ref.path,r.key]:[r.key],origin:t};if(o&&!t.extends&&!t.extend){const l=o.indexOf("_"),b=o.indexOf(".");let A=l>0?l:-1;if(b>0&&(A<0||b<A)&&(A=b),A>0){const w=o.substring(0,A),x=r.context?.components;x&&(x[w]||x["smbls."+w])?t={...t,extends:w}:x&&(0,tt.isLoudDevRuntime)()&&(/^[A-Z]\w*_\d+$/.test(o)||/^[A-Z]\w*\.\w+$/.test(o))&&console.warn(`[smbls] auto-extend: key "${o}" 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.`)}}(0,$o.applyExtends)(r,t,n);const h=new Set(["childProps","attr","style","scope","data"]),g=r.props&&typeof r.props=="object"?r.props:null;for(const l in t){if(l==="parent"||l==="node"||l==="__ref"||l==="extends"||l==="context"||l==="props")continue;if(l==="key"){a&&(r.key=a);continue}const b=t[l],A=r[l],w=A&&b&&typeof A=="object"&&typeof b=="object"&&!Array.isArray(A)&&!Array.isArray(b)&&typeof A!="function"&&typeof b!="function";w&&l.charCodeAt(0)>=65&&l.charCodeAt(0)<=90?r[l]=dt(A,b):w&&h.has(l)?r[l]={...A,...b}:w&&It(l)?r[l]=dt(A,b):r[l]=b}function f(l){for(const b in l){const A=l[b],w=r[b],x=w&&A&&typeof w=="object"&&typeof A=="object"&&!Array.isArray(w)&&!Array.isArray(A)&&typeof w!="function"&&typeof A!="function";x&&b.charCodeAt(0)>=65&&b.charCodeAt(0)<=90?r[b]=dt(w,A):x&&h.has(b)?r[b]={...w,...A}:x&&It(b)?r[b]=dt(w,A):r[b]=A}}g&&f(g),t.props&&typeof t.props=="object"&&f(t.props),t.classlist!==void 0&&(r.classlist=t.classlist),t.text!==void 0&&(r.text=t.text),t.html!==void 0&&(r.html=t.html);const d=r.scope&&typeof r.scope=="object"?r.scope:null,p=s?.scope,u=r.context&&typeof r.context.globalScope=="object"&&r.context.globalScope||null,y=p||u||null;if(t.scope!==void 0||d){const l={};d&&Object.assign(l,d),t.scope!==void 0&&Object.assign(l,t.scope),r.scope=(0,N.createScopeStore)(l,y)}else y&&(r.scope=y);if(t.if!==void 0&&(r.if=t.if),(0,Io.addMethods)(r),rs(r,s,t),r.if!=null){let l;if(typeof r.if=="function")try{l=r.if(r,r.state,r.context)}catch(b){if(l=!1,i.__ifError=b,typeof console<"u"&&console.warn){const A=r.key||r.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${A} \u2014 treating as false:`,b?.message||b)}}else l=r.if;i.__if=!!l}if(i.__if)typeof r.if=="function"&&(i.__ifInitialized=!0);else return s&&(s[r.key]=r),typeof r.if=="function"&&po(r,i,r.if),r;r.tag||(r.tag=(0,ot.detectTag)(r)),I("Init",r,n);const _=r.node=(0,ot.cacheNode)(r);if(!_)return r;if(r.tag==="fragment"){const b=(r.context?.document||globalThis.document).createComment("");_.appendChild(b),i.__fragmentAnchor=b}I("AttachNode",r,n),_.setAttribute&&r.key&&_.setAttribute("data-key",r.key),s&&(s[r.key]=r,s.__ref?.__children&&(s.__ref.__children.includes(r.key)||s.__ref.__children.push(r.key))),_.setAttribute&&r.context?.scopeSelector&&r.context.scopeSelector!==":root"&&r.context.key&&r.key===r.context.key&&_.setAttribute("data-smbls-app",r.context.key),r.id&&_.setAttribute&&(_.id=r.id),Mo(r,n),uo(r),Bt(r),Eo(r),Do(r),$s(r);try{No(r,n)}catch(l){if(typeof console<"u"&&console.error){const b=r.__ref?.path?.join(".")||r.key||"<root>";console.error(`[smbls] createChildren failed at ${b}:`,l?.message||l,l?.stack?`
2
+ `+l.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(Lt(r,!0),Mo(r,s,n),typeof r.html=="function"&&r.node&&!r.node.innerHTML){const u=r.context?.designSystem;u&&(0,v.pushConfig)(u);try{const l=r.html(r,r.state,r.context);l!=null&&typeof l!="function"&&(r.node.innerHTML=l)}catch{}finally{u&&(0,v.popConfig)()}}if($("Create",r,e),$("Complete",r,e),$("Render",r,e),$("RenderRouter",r,e),$t(r,e),typeof r.onFrame=="function"){const u=r.onFrame,l=r.context?.designSystem,b=()=>{if(r.node){if(r.node.isConnected){l&&(0,v.pushConfig)(l);try{u(r,r.state,r.context)}catch(A){console.error("[DOMQL] onFrame error:",A)}finally{l&&(0,v.popConfig)()}}requestAnimationFrame(b)}};requestAnimationFrame(b)}return r}function ns(t,s,o){const e=!s,n=o.state&&typeof o.state=="object"&&!Array.isArray(o.state)&&Object.keys(o.state).length===0,c=e&&n&&t.context?.state,r=o.state!==void 0&&!c?o.state:t.state&&!(0,N.isStore)(t.state)?t.state:void 0;if(r==null){if(s?.state)t.state=s.state,(0,it.applyStateMethods)(t,t.state);else if(t.context?.state){const d=t.context.state,i={...d},_=t.context?.polyglot;if(_?.translations){const g=t.context,f=d.lang||_.defaultLang||"en",p=new Set,y=(u,l)=>{p.has(u)||(0,D.isPolyglotWritableKey)(g,u,i)&&(i[u]=l,p.add(u),(0,D.markPolyglotSeeded)(g,u,l))},a=_.translations[f];if(a&&typeof a=="object")for(const u in a)y(u,a[u]);const h=new Set(_.languages||[]);for(const u in _.translations)h.has(u)||y(u,_.translations[u])}t.state=(0,N.isStore)(i)?i:(0,N.createStore)(i),t.state.__element=t,t.state.root=t.state,(0,it.applyStateMethods)(t,t.state),wt.promoteActiveRootState?.(d,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,it.applyStateMethods)(t,t.state);return}if(typeof r=="string"){if(t.state=io(r,s),t.state&&typeof t.state=="object"&&!(0,N.isStore)(t.state)){const d=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:d,enumerable:!1,configurable:!0,writable:!0})}(0,it.applyStateMethods)(t,t.state);return}if(typeof r=="function"){const d=r(t,s?.state);t.state=(0,N.isStore)(d)?d:(0,N.createStore)(d||{})}else(0,N.isStore)(r)?t.state=r:t.state=(0,N.createStore)({...r});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,(0,it.applyStateMethods)(t,t.state),wt.promoteActiveRootState?.(r,t.state)}function Ut(t,s){if(!s)return t;const o=s.split("/");let e=t;for(const n of o){if(e==null)return{};e=e[n]}return e??{}}function io(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const n=t.slice(3);return n?Ut(s.state,n):s.state??{}}if(t.startsWith("~/")){const n=s.state?.root||s.state,c=t.slice(2);return c?Ut(n,c):n??{}}if(s.state?.[t]!==void 0)return s.state[t];const o=Ut(s.state,t);if(o!=null&&Object.keys(o).length>0)return o;const e=s.context?.polyglot;if(e?.translations){const n=s.state?.root?.lang||e.defaultLang||"en",c=e.translations[n];if(c?.[t]!==void 0)return c[t];if(e.translations[t]!==void 0)return e.translations[t]}return{}}const rs=new Set(["s","state","ctx","context"]);function is(t){try{const o=(typeof wt.getFunctionSource=="function"?wt.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return o?o[1].split(",").map(e=>e.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function cs(t){if(typeof t!="function"||t.length!==2)return!1;const s=is(t);if(s.length<2)return!1;const o=s[1].replace(/[{}[\]]/g,"").trim();return o.length>0&&!rs.has(o)}function fs(t){const s=t.__ref,o=t.tag||"div",e=t.context?.designSystem,n=[],c=Object.keys(t);for(let r=0;r<c.length;r++){const d=c[r];if(typeof t[d]!="function"||G.REGISTRY.has(d))continue;const i=d.charCodeAt(0);i>=65&&i<=90||Y(d)||w.CSS_PROPS_REGISTRY[d]||w.DEFAULT_CSS_PROPERTIES_LIST&&w.DEFAULT_CSS_PROPERTIES_LIST.has(d)||(0,S.checkAttributeByTagName)(o,d)||((0,tt.isLoudDevRuntime)()&&cs(t[d])&&console.warn(`[smbls] custom prop "${d}"${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('${d}', \u2026) instead of reading el.${d}(\u2026) directly (see RULES.md Rule 8).`),n.push({prop:d,fn:t[d]}))}for(let r=0;r<n.length;r++){const{prop:d,fn:i}=n[r];s.__exec[d]=i,Object.defineProperty(t,d,{get(){e&&(0,v.pushConfig)(e);try{return i(t,t.state,t.context)}catch{return}finally{e&&(0,v.popConfig)()}},set(_){delete s.__exec[d],Object.defineProperty(t,d,{value:_,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function as(t,s){if(!(!Array.isArray(s)||s.length===0))for(let o=0;o<s.length;o++){const e=s[o];try{typeof e=="function"?e(t,t.state,t.context):typeof e=="string"&&t.state?.[e]}catch{}}}function R(t,s,o){return!Array.isArray(s)||s.length===0?o:function(...e){return as(t,s),o.apply(this,e)}}function pt(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function j(t,s){return()=>t.path.join(".")+"::"+s}const co=new Set;function I(t,s,o){if(!(0,tt.isLoudDevRuntime)())return;const e=j(t,s)();co.has(e)||(co.add(e),console.warn(`[smbls] "${s}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,o?.message||o))}const fo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,us=(t,s)=>{let o;try{o=String(t)}catch{return}if(!o.includes("{{"))return;fo.lastIndex=0;let e;for(;(e=fo.exec(o))!==null;)e[2].includes("{{")&&s.add(e[2])},ls=(t,s)=>!Y(t)&&!(0,Z.isCssProp)(s,t),ao=(t,s,o,e)=>{if(typeof s=="string"){s.includes("{{")&&o.add(s);return}typeof s=="function"&&ls(t,e)&&us(s,o)},ds=["attr","aria","data"],ps=t=>{if(ds.includes(t))return!0;const s=t.charCodeAt(0);return s===46||s===33||s===64},hs=t=>{const s=new Set,o=t.tag||"div";for(const e of Object.keys(t)){const n=Object.getOwnPropertyDescriptor(t,e),c=n&&n.value;if(c&&typeof c=="object"&&!Array.isArray(c)){if(!ps(e))continue;for(const r in c)ao(r,c[r],s,o);continue}ao(e,c,s,o)}return s};function uo(t,s){const o=t.__ref,e=!!(s&&s.skipIfEffect),n=hs(t);if(o.__authoredTemplates)for(const i of n)o.__authoredTemplates.add(i);else o.__authoredTemplates=n;if(fs(t),typeof t.text=="function"){const i=t.text,_=R(t,t.textDeps,i),g=(0,E.createEffect)(()=>{if(!o.contentManaged)try{let f=_(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&typeof f!="object"&&(typeof f=="string"&&f.includes("{{")&&(f=D.replaceLiteralsWithObjectFields.call(t,f,t.state)),_t(t,f))}catch(f){I(o,"text",f)}},{depth:o.path.length,label:j(o,"text")});o.__effects.push(g),o.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,_=(0,E.createEffect)(()=>{if(o.contentManaged)return;const g=D.replaceLiteralsWithObjectFields.call(t,i,t.state);g!=null&&(t.text=g),t.node&&_t(t,g??"")},{depth:o.path.length,label:j(o,"text")});o.__effects.push(_),o.__exec.text=i}const c=t.tag||"div";for(const i of Object.keys(t))if(typeof t[i]=="function"&&!G.REGISTRY.has(i)&&!Y(i)&&!o.__exec[i]&&!(0,Z.isAttributeFirst)(c,i)){if(w.CSS_PROPS_REGISTRY[i]){const _=t[i],g=R(t,t[i+"Deps"],_),f=i;let p,y=null,a=null,h;const u=(0,E.createEffect)(()=>{const l=t.context?.designSystem;l&&(0,v.pushConfig)(l);try{const b=g(t,t.state,t.context);(0,w.pushStaticCssPass)();let A;try{A=w.CSS_PROPS_REGISTRY[f](b,t,t.state,t.context)}finally{(0,w.popStaticCssPass)()}if(Array.isArray(A)){const C={};for(const x of A)if(x)for(const L in x)C[L]=x[L];A=C}const k=f==="show"||f==="hide";if(A&&t.node&&ys(A)){const C=vt(A);if(C===null||C!==h){h=C;const x=(0,q.css)(A,null,t.context?.cssPrefix),L=x?x.split(" ").filter(Boolean):null;if(t.node.classList){if(a)for(const U of a)t.node.classList.remove(U);if(L&&L.length)for(const U of L)t.node.classList.add(U);a=L}}p=void 0,y=null}else if(A&&t.node){if(a){for(const x of a)t.node.classList.remove(x);a=null,h=void 0}const C=vt(A);if(C===null||C!==p||!Et(t.node,y)){p=C;const x=go(t,A);y=kt(t.node,x)}}else t.node&&k&&(p=void 0,y=null,t.node.style.display="")}finally{l&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,f)});o.__effects.push(u),o.__exec[i]=_}else if(w.DEFAULT_CSS_PROPERTIES_LIST&&w.DEFAULT_CSS_PROPERTIES_LIST.has(i)){const _=t[i],g=R(t,t[i+"Deps"],_),f=i;let p,y=null;const a=(0,E.createEffect)(()=>{const h=t.context?.designSystem;h&&(0,v.pushConfig)(h);try{const u=g(t,t.state,t.context);if(t.node)if(u!=null){const l=f+":"+String(u);if(l!==p||!Et(t.node,y)){p=l;const b={[f]:u},A=go(t,b);y=kt(t.node,A)}}else p=void 0,y=null,t.node.style[f]=""}finally{h&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,f)});o.__effects.push(a),o.__exec[i]=_}}if(typeof t.html=="function"){const i=t.html,_=R(t,t.htmlDeps,i),g=(0,E.createEffect)(()=>{const f=t.context?.designSystem;f&&(0,v.pushConfig)(f);try{const p=_(t,t.state,t.context);t.node&&p!=null&&typeof p!="function"&&(t.node.innerHTML=p)}finally{f&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,"html")});o.__effects.push(g),o.__exec.html=i}if(typeof t.value=="function"){const i=t.value,_=R(t,t.valueDeps,i),g=(0,E.createEffect)(()=>{try{let f=_(t,t.state,t.context);typeof f=="string"&&f.includes("{{")&&(f=D.replaceLiteralsWithObjectFields.call(t,f,t.state)),ho(t,f)}catch(f){I(o,"value",f)}},{depth:o.path.length,label:j(o,"value")});o.__effects.push(g),o.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,_=(0,E.createEffect)(()=>{try{ho(t,D.replaceLiteralsWithObjectFields.call(t,i,t.state))}catch(g){I(o,"value",g)}},{depth:o.path.length,label:j(o,"value")});o.__effects.push(_),o.__exec.value=i}if(typeof t.style=="function"){const i=t.style,_=R(t,t.styleDeps,i);let g,f=null;const p=(0,E.createEffect)(()=>{const y=_(t,t.state,t.context),a=vt(y);(a===null||a!==g||!Et(t.node,f))&&(g=a,_s(t.node,f,y),m(t.node,y),f=kt(t.node,y))},{depth:o.path.length,label:j(o,"style")});o.__effects.push(p),o.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const _=t.style[i];if(typeof _!="function")continue;const g=R(t,pt(t.styleDeps,i),_);let f,p=null;const y=(0,E.createEffect)(()=>{try{const a=g(t,t.state,t.context);if(t.node){const h=i+":"+String(a);if(h!==f||!Et(t.node,p)){f=h;const u={[i]:a};m(t.node,u),p=kt(t.node,u)}}}catch(a){I(o,"style."+i,a)}},{depth:o.path.length,label:j(o,"style."+i)});o.__effects.push(y)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const _=R(t,pt(t.attrDeps,i),t.attr[i]),g=i,f=(0,E.createEffect)(()=>{try{let p=_(t,t.state,t.context);typeof p=="string"&&p.includes("{{")&&(p=D.replaceLiteralsWithObjectFields.call(t,p,t.state)),t.node?.setAttribute&&(p==null||p===!1&&!(0,S.isEnumeratedTrueFalseAttr)(g)?t.node.removeAttribute(g):typeof p!="function"&&typeof p!="object"&&t.node.setAttribute(g,(0,S.serializeAttrValue)(g,p)))}catch(p){I(o,"attr."+g,p)}},{depth:o.path.length,label:j(o,"attr."+g)});f._attrName=g.toLowerCase(),o.__effects.push(f)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const _=t.attr[i],g=i,f=(0,E.createEffect)(()=>{try{const p=D.replaceLiteralsWithObjectFields.call(t,_,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(g,(0,S.serializeAttrValue)(g,p??""))}catch(p){I(o,"attr."+g,p)}},{depth:o.path.length,label:j(o,"attr."+g)});f._attrName=g.toLowerCase(),o.__effects.push(f)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const _=t.aria[i];if(typeof _=="string"&&_.includes("{{")){const y=_,a="aria-"+i.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),h=(0,E.createEffect)(()=>{try{const u=D.replaceLiteralsWithObjectFields.call(t,y,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(a,(0,S.serializeAttrValue)(a,u??""))}catch(u){I(o,"aria."+i,u)}},{depth:o.path.length,label:j(o,"aria."+i)});h._attrName=a,o.__effects.push(h);continue}if(typeof _!="function")continue;const g=R(t,pt(t.ariaDeps,i),t.aria[i]),f="aria-"+i.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),p=(0,E.createEffect)(()=>{try{const y=g(t,t.state,t.context);if(!t.node?.setAttribute)return;y==null?t.node.removeAttribute(f):typeof y!="function"&&typeof y!="object"&&t.node.setAttribute(f,(0,S.serializeAttrValue)(f,y))}catch(y){I(o,"aria."+i,y)}},{depth:o.path.length,label:j(o,"aria."+i)});p._attrName=f,o.__effects.push(p)}if(t.data&&typeof t.data=="object")for(const i in t.data){const _=t.data[i];if(typeof _=="string"&&_.includes("{{")){const a=_,h="data-"+i.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),u=(0,E.createEffect)(()=>{try{const l=D.replaceLiteralsWithObjectFields.call(t,a,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(h,l??"")}catch(l){I(o,"data."+i,l)}},{depth:o.path.length,label:j(o,"data."+i)});u._attrName=h,o.__effects.push(u);continue}if(typeof _!="function")continue;const g=R(t,pt(t.dataDeps,i),t.data[i]),p="data-"+i.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),y=(0,E.createEffect)(()=>{try{const a=g(t,t.state,t.context);if(!t.node?.setAttribute)return;a==null||a===!1?t.node.removeAttribute(p):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(p,a===!0?"":a)}catch(a){I(o,"data."+i,a)}},{depth:o.path.length,label:j(o,"data."+i)});y._attrName=p,o.__effects.push(y)}const r=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(r)for(const i in r){if(typeof r[i]!="function")continue;const _=R(t,pt(t.classDeps,i),r[i]),g=(0,E.createEffect)(()=>{try{const f=_(t,t.state,t.context);if(!t.node?.classList)return;typeof f=="string"?t.node.classList.add(f):f?t.node.classList.add(i):t.node.classList.remove(i)}catch(f){I(o,"class."+i,f)}},{depth:o.path.length,label:j(o,"class."+i)});o.__effects.push(g)}!e&&typeof t.if=="function"&&po(t,o,t.if);for(const i of Object.keys(t)){if(G.REGISTRY.has(i)||typeof t[i]!="function")continue;const _=i.charCodeAt(0);if(_>=65&&_<=90||Y(i))continue;const g=t[i];o.__exec[i]=g;const f=t.tag||"div";if((0,S.checkAttributeByTagName)(f,i)&&!(0,Z.isCssProp)(f,i)){const p=(0,S.camelToAttr)(i)||i,y=R(t,t[i+"Deps"],g),a=(0,E.createEffect)(()=>{try{let h=y(t,t.state,t.context);typeof h=="string"&&h.includes("{{")&&(h=D.replaceLiteralsWithObjectFields.call(t,h,t.state)),t.node?.setAttribute&&(h==null||h===!1&&!(0,S.isEnumeratedTrueFalseAttr)(p)?t.node.removeAttribute(p):typeof h!="function"&&typeof h!="object"&&(p==="src"&&"src"in t.node?t.node.src=h:t.node.setAttribute(p,(0,S.serializeAttrValue)(p,h))))}catch(h){I(o,i,h)}},{depth:o.path.length,label:j(o,i)});a._attrName=p.toLowerCase(),o.__effects.push(a)}}const d=t.tag||"div";for(const i of Object.keys(t)){if(G.REGISTRY.has(i))continue;const _=t[i];if(typeof _!="string"||!_.includes("{{"))continue;const g=i.charCodeAt(0);if(g>=65&&g<=90||Y(i)||(0,Z.isCssProp)(d,i)||S.ATTR_TRANSFORMS[i]||!(0,S.checkAttributeByTagName)(d,i))continue;const f=(0,S.camelToAttr)(i)||i,p=(0,E.createEffect)(()=>{try{const y=D.replaceLiteralsWithObjectFields.call(t,_,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(f,(0,S.serializeAttrValue)(f,y??""))}catch(y){I(o,i,y)}},{depth:o.path.length,label:j(o,i)});p._attrName=f.toLowerCase(),o.__effects.push(p)}if(Cs(t),js(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,_=t.stateDeps;let g=!1,f=[];const p=(0,E.createEffect)(()=>{const y=[];for(let l=0;l<_.length;l++){const b=_[l];try{y[l]=typeof b=="function"?b(t,t.state,t.context):t.state?.[b]}catch{y[l]=void 0}}if(!g){g=!0,f=y;return}let a=y.length!==f.length;for(let l=0;!a&&l<y.length;l++)y[l]!==f[l]&&(a=!0);const h=f;if(f=y,!a)return;const u=t.context?.designSystem;u&&(0,v.pushConfig)(u);try{i(t,t.state,t.context,{prev:h,next:y})}catch(l){if(t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onStateUpdate",error:l})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',l),t.context?.strictMode)throw l}finally{u&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,"onStateUpdate")});o.__effects.push(p)}ks(t)}function lo(t){const s=t.parent,o=s?.node;if(!o||!t.node){Mo(t,t.parent);return}let e=null;const n=Object.keys(s),c=n.indexOf(t.key);for(let r=c+1;r<n.length;r++){const d=s[n[r]];if(d?.node?.parentNode===o){e=d.node;break}}e?o.insertBefore(t.node,e):o.appendChild(t.node)}function po(t,s,o){const e=R(t,t.ifDeps,o),n=(0,E.createEffect)(()=>{let c;try{c=e(t,t.state,t.context)}catch(d){if(c=!1,s.__ifError=d,typeof console<"u"&&console.warn){const i=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${i} \u2014 treating as false:`,d?.message||d)}return}const r=s.__if;if(s.__if=!!c,r&&!s.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(d){console.error("[smbls] onRemove error:",d)}}else if(!r&&s.__if)if(s.__ifInitialized)t.node||(t.node=(0,ot.cacheNode)(t)),t.node&&(t.node.ref=t),lo(t),Bt(t),$("Render",t,{}),$t(t,{});else{if(s.__ifInitialized=!0,t.tag||(t.tag=(0,ot.detectTag)(t)),$("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"&&!s.__fragmentAnchor){const i=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(i),s.__fragmentAnchor=i}$("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Ro(t,{}),uo(t,{skipIfEffect:!0}),Bt(t),Eo(t),Oo(t),No(t,{}),lo(t),$("Create",t,{}),$("Complete",t,{}),$("Render",t,{}),$("RenderRouter",t,{}),$t(t,{})}},{depth:s.path.length,label:j(s,"if")});s.__effects.push(n)}function _t(t,s){const o=t.node;if(!o)return;const e=s==null||typeof s=="object"?"":String(s);if(t.tag==="string"){o.nodeValue!==e&&(o.nodeValue=e);return}const n=t.__ref;let c=n?n.__textNode:null;if(c&&c.parentNode!==o&&(c=null),!c){const r=o.firstChild;r&&r.nodeType===3&&(c=r)}c?c.nodeValue!==e&&(c.nodeValue=e):o.firstChild?(c=(o.ownerDocument||t.context?.document||globalThis.document).createTextNode(e),o.insertBefore(c,o.firstChild)):(o.textContent=e,c=o.firstChild&&o.firstChild.nodeType===3?o.firstChild:null),n&&(n.__textNode=c||null)}function ho(t,s){const o=t.node;if(!o||!("value"in o))return;const e=s==null?"":String(s);if(o.value===e)return;const n=typeof document<"u"&&document.activeElement===o,c=n&&typeof o.selectionStart=="number"?o.selectionStart:null,r=n&&typeof o.selectionEnd=="number"?o.selectionEnd:null;if(o.value=e,n&&c!=null&&r!=null)try{o.setSelectionRange(c,r)}catch{}const d=t.__ref&&t.__ref.__autoGrow;d&&d.active&&d.resize()}function Bt(t){const{node:s}=t;if(s){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&_t(t,t.text),jo(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in s){const o=String(t.value);s.value!==o&&(s.value=o)}if(t.style&&typeof t.style=="object"){let o=t.style;for(const e in t.style)if(typeof t.style[e]=="function"){o={};for(const n in t.style)typeof t.style[n]!="function"&&(o[n]=t.style[n]);break}m(s,o)}if(t.attr&&typeof t.attr=="object")for(const o in t.attr){const e=t.attr[o];typeof e=="function"||typeof e=="object"||e!=null&&(typeof e=="string"&&e.includes("{{")||e===!1&&!(0,S.isEnumeratedTrueFalseAttr)(o)||s.setAttribute&&s.setAttribute(o,(0,S.serializeAttrValue)(o,e)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&s.setAttribute&&s.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const o in t.data){const e=t.data[o];typeof e=="function"||typeof e=="object"||e==null||e===!1||typeof e=="string"&&e.includes("{{")||s.dataset&&(s.dataset[o]=e===!0?"":e)}if(t.classlist||t.class){const o=t.classlist||t.class;if(typeof o=="string")o.split(" ").forEach(e=>e&&s.classList.add(e));else if(typeof o=="object")for(const e in o){const n=typeof o[e]=="function"?o[e](t,t.state,t.context):o[e];n&&s.classList.add(typeof n=="string"?n:e)}}}}function vt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function ys(t){if(!t||typeof t!="object")return!1;for(const s in t){const o=t[s];if(o&&typeof o=="object"&&!Array.isArray(o))return!0}return!1}function kt(t,s){if(!t||!t.style||!s)return null;const o=t.style,e=[];for(const n in s){if(s[n]==null||n.charAt(0)==="&")continue;const r=jt(n);e.push(r,Gt(o,r),yo(o,r))}return e}function Gt(t,s){return typeof t.getPropertyValue=="function"?t.getPropertyValue(s):""}function yo(t,s){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(s):""}function jt(t){return Tt(t)?t:t.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())}function _s(t,s,o){if(!t||!t.style||!s||!s.length)return;const e=t.style,n=new Set;if(o&&typeof o=="object")for(const c in o)o[c]==null||c.charAt(0)==="&"||n.add(jt(c));for(let c=0;c<s.length;c+=3){const r=s[c];n.has(r)||Gt(e,r)===s[c+1]&&typeof e.removeProperty=="function"&&e.removeProperty(r)}}function Et(t,s){if(!s||!t||!t.style)return!1;const o=t.style;for(let e=0;e<s.length;e+=3)if(Gt(o,s[e])!==s[e+1]||yo(o,s[e])!==s[e+2])return!1;return!0}const Tt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function gs(t){let s=null;for(const o in t)t[o]!=null&&o.charAt(0)!=="&"&&(s||(s=new Set),s.add(jt(o)));return s}function bs(t,s,o,e){const n=t.__ref;if(!n)return;let c=null;if(o)for(const r of o){if(e&&e.has(r))continue;const d=s[r];if(d==null||typeof d=="object")continue;const i=jt(r);Zt.CSS_LONGHAND_SHORTHANDS[i]&&(c||(c={}),c[i]=d)}n.__declaredLonghands=c}function _o(t,s){const o=t.__ref,e=o&&o.__declaredLonghands;if(!e||!s)return null;let n=null;for(const c in e){if(s.has(c))continue;const r=Zt.CSS_LONGHAND_SHORTHANDS[c];let d=!1;for(let i=0;i<r.length;i++)if(s.has(r[i])){d=!0;break}d&&(n||(n={}),n[c]=e[c])}return n}function go(t,s){const o=t.node;m(o,s);const e=gs(s);if(!e)return s;const n=t.__ref;if(n)if(n.__inlineCssKeys)for(const r of e)n.__inlineCssKeys.add(r);else n.__inlineCssKeys=new Set(e);const c=_o(t,e);return c?(m(o,c),Object.assign({},s,c)):s}function As(t){const s=t.__ref;if(!s||!s.__inlineCssKeys||!s.__declaredLonghands)return;const o=_o(t,s.__inlineCssKeys);o&&m(t.node,o)}function m(t,s){if(!t||!s||!t.style)return;let o=null;for(const e in s){const n=s[e];if(n!=null){if(e.charAt(0)==="&"&&typeof n=="object"){o||(o={}),o[e]=n;continue}try{const c=String(n),r=Tt(e)?e:e.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),d=c.trim(),i=/\s*!important\s*$/.test(d),_=d.replace(/\s*!important\s*$/,"");t.style.setProperty(r,_,i?"important":"")}catch{}}}o&&xs(t,o)}function xs(t,s){const o=`_ds${mt.scopedStyleId++}`;t.classList.add(o);const e=t.ownerDocument;let n=e.querySelector("style[data-smbls-scoped]");n||(n=e.createElement("style"),n.setAttribute("data-smbls-scoped",""),e.head.appendChild(n));let c="";for(const r in s){const d="."+o,i=r.replace(/&/g,d).split(",").map(g=>{const f=g.trim();return f.includes(d)?f:d+f}).join(", "),_=s[r];if(typeof _=="object"){let g="",f="";for(const p in _){const y=_[p];if(typeof y=="object"){const a=p.includes("&")?i.split(", ").map(u=>p.replace(/&/g,u)).join(", "):i.split(", ").map(u=>`${u} ${p}`).join(", ");let h="";for(const u in y)h+=`${u.replace(/[A-Z]/g,l=>"-"+l.toLowerCase())}: ${y[u]};`;f+=(0,q.wrapHoverRule)(`${a} { ${h} }`,a)+`
5
- `}else g+=`${p.replace(/[A-Z]/g,a=>"-"+a.toLowerCase())}: ${y};`}g&&(c+=(0,q.wrapHoverRule)(`${i} { ${g} }`,i)+`
6
- `),f&&(c+=f)}}c&&(n.textContent+=c)}const bo=new Set;function Ao(t){if(!Array.isArray(t))return"";const s=[];for(let o=0;o<t.length;o++)typeof t[o]=="string"&&t[o].length&&s.push(t[o]);return s.sort(),s.join("|")}function ws(t,s,o){const e=Ao(o);queueMicrotask(()=>{if(!t.__ref)return;let n;try{n=s(t,t.state,t.context)}catch{return}if(Ao(n)===e)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";bo.has(c)||(bo.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${o.join(", ")||"(none)"}], probed [${Array.isArray(n)?n.join(", "):String(n)}]. 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 Cs(t){const s=t.subscribeTo,o=typeof s=="function";let e=s;if(o)try{e=s(t,t.state,t.context)}catch{e=null}if(o&&(0,tt.isLoudDevRuntime)()&&ws(t,s,Array.isArray(e)?e:[]),!Array.isArray(e)||e.length===0)return;const n=t.__ref;for(let c=0;c<e.length;c++){const r=e[c];if(typeof r!="string"||r.length===0)continue;const d=r.split("."),i=d[0],_=d.slice(1),g={value:!1},f=(0,E.createEffect)(()=>{const p=t.state&&((0,N.isStore)(t.state)?t.state.root:null);if(!p||!(0,N.isStore)(p))return;let y=p;y=y[i];for(let h=0;h<_.length&&!(y==null||typeof y!="object");h++)if((0,N.isStore)(y))y=y[_[h]];else break;if(!g.value)return;let a=!1;if(typeof t.onBeforeUpdate=="function"){const h=t.context?.designSystem;h&&(0,v.pushConfig)(h);try{if(Bo(n)){const u=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});u&&typeof u.then=="function"?u.then(()=>gt(n,!1),l=>{gt(n,!0),t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:l})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",l)}):(gt(n,!1),u===!1&&(a=!0))}}catch(u){gt(n,!0),t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:u})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",u)}finally{h&&(0,v.popConfig)()}}if(!a&&t.node&&n.__effects)for(let h=0;h<n.__effects.length;h++){const u=n.__effects[h];u&&u!==f&&!u._disposed&&!u._isSubscribeToEffect&&typeof u._execute=="function"&&u._execute()}if(!a&&typeof t.onUpdate=="function"){const h=t.context?.designSystem;h&&(0,v.pushConfig)(h);try{t.onUpdate(t,t.state,t.context)}catch(u){t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onUpdate",error:u})||console.error("[DOMQL] subscribeTo onUpdate error:",u)}finally{h&&(0,v.popConfig)()}}},{depth:n.path.length,label:j(n,"subscribeTo("+r+")")});g.value=!0,f._isSubscribeToEffect=!0,n.__effects.push(f)}}function Ht(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}function Kt(t,s){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const o=s.context?.designSystem?.media?.[t.slice(1)];return o?/^@(media|supports|container)\b/.test(o)?o:`@media ${o}`:t}const xo=new Set;function Ss(t,s){const o=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",e=o+"::"+t;xo.has(e)||(xo.add(e),console.warn(`[smbls/css] "${t}" at ${o} 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.`))}function rt(t,s,o,e){const n={},c=new Set,r=(d,i,_)=>{const g=_?new Set(Object.keys(n)):null;if(w.CSS_PROPS_REGISTRY[d]){const f=w.CSS_PROPS_REGISTRY[d](i,s,s.state,s.context);if(f){const p=Array.isArray(f)?f:[f];for(const y of p)y&&Object.assign(n,y)}}else n[d]=i;if(_)for(const f in n)g.has(f)||c.add(f)};for(const d in t){if(!Object.prototype.hasOwnProperty.call(t,d))continue;let i=t[d];if(typeof i=="function"&&(i=i(s,s.state,s.context)),i==null||typeof i=="function")continue;if(typeof i=="object"&&!Array.isArray(i)){if(d==="style"){for(const y in i){let a=i[y];if(typeof a=="function"&&(a=a(s,s.state,s.context)),a==null||typeof a=="function")continue;const h=typeof s[y]=="function"&&(w.CSS_PROPS_REGISTRY[y]||w.DEFAULT_CSS_PROPERTIES_LIST&&w.DEFAULT_CSS_PROPERTIES_LIST.has(y))||!!(e&&e.has(y));r(y,a,h)}continue}if(Ht(d,s)){const y=rt(i,s,!1,e);Object.keys(y).length&&(n[`[data-theme="${d.slice(1)}"] &`]=y);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(d)){(0,tt.isLoudDevRuntime)()&&Ss(d,s);continue}const f=Kt(d,s),p=rt(i,s,!1,e);Object.keys(p).length&&(n[f]=p);continue}const _=typeof s[d]=="function"&&(w.CSS_PROPS_REGISTRY[d]||w.DEFAULT_CSS_PROPERTIES_LIST&&w.DEFAULT_CSS_PROPERTIES_LIST.has(d)),g=!!(e&&e.has(d));r(d,i,_||g)}if(o)for(const d in n)c.add(d);for(const d of c){const i=n[d];typeof i=="string"&&!i.includes("!important")&&(n[d]=i+" !important")}return n}const Pt=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function wo(t,s){for(const o in s){const e=s[o];t[o]=Pt(e)?wo(Pt(t[o])?t[o]:{},e):e}return t}function vs(t,s){if(!Pt(s))return;let o;for(const e of t.split(" ")){const n=e?s[e]:null;Pt(n)&&(o=wo(o||{},n))}return o}function Vt(t,s){if(s===void 0&&(s=0),s>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&Vt(t[o],s+1))return!0}return!1}function Co(t,s,o){if(!s||typeof s!="object"||Array.isArray(s))return null;if(Ht(t,o)){const c=rt(s,o,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const e=Kt(t,o),n=rt(s,o,!1);return Object.keys(n).length?{cssProp:e,block:n}:null}function ks(t){const s=t.__ref;for(const o of Object.keys(t)){if(!It(o))continue;const e=t[o];if(!e||typeof e!="object"||Array.isArray(e)||!Vt(e))continue;let n=null,c;const r=(0,E.createEffect)(()=>{if(!t.node)return;const d=t.context?.designSystem;d&&(0,v.pushConfig)(d);let i,_=!1;try{const g=Co(o,e,t),f=g?vt(g.block)+"::"+g.cssProp:null;if(f!==null&&f===c)_=!0;else if(c=f,g){const p=(0,q.css)({[g.cssProp]:g.block},null,t.context?.cssPrefix);i=p?p.split(" ").filter(Boolean):null}else i=null}finally{d&&(0,v.popConfig)()}if(!(_||!t.node.classList)){if(n)for(const g of n)t.node.classList.remove(g);if(i&&i.length)for(const g of i)t.node.classList.add(g);n=i}},{depth:s.path.length,label:j(s,"cssBlock("+o+")")});s.__effects.push(r)}}function js(t){const s=t.__ref;s.__conditionalRunners=[];const o=new Map;for(const e of Object.keys(t)){const n=e.charAt(0);if(n!=="."&&n!=="!")continue;const c=e.slice(1);if(!c)continue;if(/[:@\s>~+[\]]/.test(c)){if(typeof console<"u"&&console.warn){const a=c.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${n}\` is read as one prop name. Nest the selector inside instead: \`${n}${a}: { '${c.slice(a.length)}': {...} }\`.`)}continue}const r=t[e];if(!r||typeof r!="object")continue;const d=n==="!",i={lastMatch:!1,appliedKeys:null,appliedClasses:null},_=new Set;for(const a in r){if(!Object.prototype.hasOwnProperty.call(r,a))continue;const h=a.charAt(0),u=r[a];(h===":"||h==="@"||h==="&"||h==="[")&&u&&typeof u=="object"&&!Array.isArray(u)||_.add(a)}const g=()=>{let a;const h=t[c];if(h===void 0){const b=!!t.state&&c in t.state,A=t.state?t.state[c]:void 0;if(b||A!==void 0)a=A;else{const k=t.context?.cases?.[c];if(k===void 0)return;try{a=typeof k=="function"?k.call(t,t):k}catch(C){a=!1,s.__conditionalError=C,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,C?.message||C)}}}else if(typeof h=="function")try{a=h(t,t.state,t.context)}catch(b){a=!1,s.__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 a=h;const u=d?!a:!!a;if(!t.node||u===i.lastMatch)return;i.lastMatch=u;const l=t.context?.designSystem;l&&(0,v.pushConfig)(l);try{if(u){const b={},A={};let k=!1;for(const x in r){if(!Object.prototype.hasOwnProperty.call(r,x))continue;const L=r[x],U=x.charAt(0);if((U===":"||U==="@"||U==="&"||U==="[")&&L&&typeof L=="object"&&!Array.isArray(L)){if(Ht(x,t)){const O=rt(L,t,!1,_);Object.keys(O).length&&(A[`[data-theme="${x.slice(1)}"] &`]=O,k=!0)}else{const O=Kt(x,t),X=rt(L,t,!1,_);Object.keys(X).length&&(A[O]=X,k=!0)}continue}const M=typeof L=="function"?L(t,t.state,t.context):L;if(M!=null)if(w.CSS_PROPS_REGISTRY[x]){const O=w.CSS_PROPS_REGISTRY[x](M,t,t.state,t.context);if(O){const X=Array.isArray(O)?O:[O];for(const bt of X)bt&&Object.assign(b,bt)}}else(w.DEFAULT_CSS_PROPERTIES_LIST&&w.DEFAULT_CSS_PROPERTIES_LIST.has(x)||Tt(x))&&(b[x]=M)}const C=Object.keys(b);if(C.length){m(t.node,b);for(const x of C)o.set(x,e);i.appliedKeys=C}else i.appliedKeys=null;if(k){const x=(0,q.css)(A,null,t.context?.cssPrefix,{state:!0}),L=x?x.split(" ").filter(Boolean):[];if(L.length&&t.node.classList){for(const U of L)t.node.classList.add(U);i.appliedClasses=L}else i.appliedClasses=null}else if(i.appliedClasses){for(const x of i.appliedClasses)t.node.classList.remove(x);i.appliedClasses=null}}else{if(i.appliedKeys){for(const b of i.appliedKeys)o.get(b)===e&&(Tt(b)?t.node.style.removeProperty(b):t.node.style[b]="",o.delete(b));i.appliedKeys=null}if(i.appliedClasses){for(const b of i.appliedClasses)t.node.classList.remove(b);i.appliedClasses=null}}}finally{l&&(0,v.popConfig)()}};s.__conditionalRunners.push(g);const f=R(t,t[c+"Deps"],g),p=(0,E.createEffect)(f,{depth:s.path.length,label:j(s,"conditional("+e+")")}),y=s.__exec&&s.__exec[c]||t[c];p._sources.size===0&&typeof y=="function"&&(0,tt.isLoudDevRuntime)()&&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 \`${c}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),s.__effects.push(p)}}const Wt=new WeakSet;function Es(t){const s=t.ownerDocument;!s||Wt.has(s)||(Wt.add(s),queueMicrotask(()=>{Wt.delete(s);const o=s.body||s.documentElement;o&&o.offsetWidth}))}const zt=new WeakSet;let So=!1;function vo(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Yt(t,s){const o={...t};for(const e in s){const n=s[e],c=o[e];o[e]=n&&typeof n=="object"&&c&&typeof c=="object"?Yt(c,n):n}return o}function ko(t,s){const o={};for(const e in t){const n=t[e];if(n&&typeof n=="object"){const c=ko(n,s);Object.keys(c).length&&(o[e]=c)}else s.has(e)||(o[e]=n)}return o}function jo(t){const{node:s}=t;if(!s)return;if(So||(So=!0,(0,q.css)({display:"none"})),zt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}zt.add(t);const o=t.context?.designSystem;o&&(0,v.pushConfig)(o),(0,w.pushStaticCssPass)();try{const e={};let n=!1,c=[],r=null,d=null,i=null;const _=(a,h)=>{if(h&&typeof h=="object"&&vo(a)){d||(d={});const u=d[a];u&&(h=Yt(u,h)),d[a]=h}else(h===null||typeof h!="object")&&(i||(i=new Set),i.add(a));e[a]=h};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&w.CSS_PROPS_REGISTRY.theme){const a=w.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(a){const h=u=>{for(const l in u){const b=u[l];b&&typeof b=="object"&&vo(l)&&(r||(r={}),r[l]=b),e[l]=b}};if(Array.isArray(a))for(const u of a)u&&h(u);else h(a);n=!0}}const g=(a,h)=>{if(w.CSS_PROPS_REGISTRY[a]){const u=w.CSS_PROPS_REGISTRY[a](h,t,t.state,t.context);if(u){if(Array.isArray(u)){for(const l of u)if(l)for(const b in l)_(b,l[b])}else for(const l in u)_(l,u[l]);n=!0}}else if(w.DEFAULT_CSS_PROPERTIES_LIST&&w.DEFAULT_CSS_PROPERTIES_LIST.has(a))h!=null&&typeof h!="object"&&(_(a,h),n=!0);else if(a.charCodeAt(0)===45)h!=null&&typeof h!="object"&&(_(a,h),n=!0);else if((a.charAt(0)==="&"||a.charAt(0)==="@"||a.charAt(0)===":"||a.charAt(0)==="[")&&h&&typeof h=="object"&&!Array.isArray(h)){if(Vt(h))return;const u=Co(a,h,t);u&&(_(u.cssProp,u.block),n=!0)}};if(typeof t.class=="string"){const a=vs(t.class,t.context?.designSystem?.class);if(a)for(const h in a)g(h,a[h])}const f=i?new Set(i):null,p=t.tag||"div";for(const a of Object.keys(t)){if(typeof t[a]=="function"||G.REGISTRY.has(a)||a==="theme")continue;const h=a.charCodeAt(0);h>=65&&h<=90||Y(a)||(0,Z.isAttributeFirst)(p,a)||g(a,t[a])}if(r)for(const a in r){let h=i?ko(r[a],i):r[a];d&&d[a]&&(h=Yt(h,d[a])),Object.keys(h).length?e[a]=h:delete e[a]}if(bs(t,e,i,f),n){e.display&&String(e.display).includes("!important")&&(s.style.setProperty("display",String(e.display).replace(/\s*!important\s*$/,""),"important"),delete e.display);const a=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof a=="string"&&a!==""&&e.display&&e.display!==a&&(e.display=a);const h=(0,q.css)(e,null,t.context?.cssPrefix);if(c=h?h.split(" ").filter(Boolean):[],h&&s.classList){const u=c;let l=!1;for(const b of u)s.classList.add(b),l||(b.charCodeAt(0)===95&&b.charCodeAt(1)===99||b.charCodeAt(0)===95&&b.indexOf("_c",1)!==-1)&&(l=!0);l&&Es(s)}}const y=t.__ref;if(y){const a=y.__staticCssClasses;if(a&&s.classList){const h=new Set(c);for(const u of a)h.has(u)||s.classList.remove(u)}y.__staticCssClasses=c}As(t)}finally{(0,w.popStaticCssPass)(),o&&(0,v.popConfig)(),zt.delete(t)}}const Ts=t=>!!w.CSS_PROPS_REGISTRY[t]||!!(w.DEFAULT_CSS_PROPERTIES_LIST&&w.DEFAULT_CSS_PROPERTIES_LIST.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function Ps(t){t&&t.node&&jo(t)}function Eo(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const n in t.aria){const c=t.aria[n];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const r="aria-"+n.replace(/[A-Z]/g,d=>"-"+d.toLowerCase());s.setAttribute(r,(0,S.serializeAttrValue)(r,c))}const o=(0,S.applyAttrTransforms)(t);for(const n in o){const c=o[n];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&s.setAttribute(n,c===!0?"":c)}const e=t.tag||"div";for(const n of Object.keys(t)){if(typeof t[n]=="function"||G.REGISTRY.has(n)||n==="on"||o[n]!==void 0)continue;const c=n.charCodeAt(0);if(!(c>=65&&c<=90)&&!Y(n)&&!(0,Z.isCssProp)(e,n)&&(0,S.checkAttributeByTagName)(e,n)){let r=t[n];if(r==null)continue;if(typeof r=="string"&&r.includes("{{")){if(!S.ATTR_TRANSFORMS[n])continue;r=D.replaceLiteralsWithObjectFields.call(t,r,t.state)}if(r==null||typeof r=="function"||typeof r=="object"||r===!1&&!(0,S.isEnumeratedTrueFalseAttr)((0,S.camelToAttr)(n)||n))continue;const d=(0,S.camelToAttr)(n)||n;s.setAttribute(d,(0,S.serializeAttrValue)(d,r))}}}function Ls(t,s){const{node:o}=t;if(!o||!o.setAttribute)return;const e=s.charCodeAt(0);if(e>=65&&e<=90||Y(s))return;const n=t.tag||"div";if((0,Z.isCssProp)(n,s)||!(0,S.checkAttributeByTagName)(n,s))return;const c=(0,S.camelToAttr)(s)||s,r=c.toLowerCase(),d=t.__ref&&t.__ref.__effects;let i=!1;if(d)for(let f=0;f<d.length;f++){const p=d[f];p&&p._attrName===r&&!p._disposed&&typeof p._execute=="function"&&(i=!0,p._execute())}if(i)return;let _=t[s];const g=S.ATTR_TRANSFORMS[s];if(g&&_!=null){const f=g(t);f!==void 0&&(_=f)}typeof _=="string"&&_.includes("{{")&&(_=D.replaceLiteralsWithObjectFields.call(t,_,t.state)),_==null||_===!1&&!(0,S.isEnumeratedTrueFalseAttr)(c)?o.removeAttribute(c):typeof _!="function"&&typeof _!="object"&&o.setAttribute(c,(0,S.serializeAttrValue)(c,_))}function Os(t,s){const o=t.node,e=t.__ref;let n=e.__autoGrow;if(!s){if(n&&n.active){try{o.removeEventListener("input",n.resize)}catch{}Po(n),J.delete(t),o.style.height="",n.appliedMax!=null&&o.style.maxHeight===n.appliedMax&&(o.style.maxHeight=""),Lo(o,n,!1),n.active=!1,n.appliedMax=null,n.lastMeasure=0}return}n||(n=e.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,lastWidth:null,watch:null,awaitingLayout:!1,appliedScroll:!1,fontsHooked:!1,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!o.isConnected){ht(t,!0);return}if(!(o.scrollHeight>0)){n.awaitingLayout=!0,To(t,n);return}n.awaitingLayout=!1;const r=o.style.height;o.style.height="0px";const d=o.scrollHeight;if(!(d>0)){o.style.height=r;return}const i=Ns(o),_=i!=null&&d>i;o.style.height=(_?i:d)+"px",Lo(o,n,_),n.lastMeasure=d,n.lastWidth=o.clientWidth,To(t,n)}},e.__eventCleanup||(e.__eventCleanup=[]),e.__eventCleanup.push(()=>{try{o.removeEventListener("input",n.resize)}catch{}Po(n),J.delete(t)})),n.active||(o.addEventListener("input",n.resize),n.active=!0,Rs(t,n));const c=typeof s=="object"&&s.max!=null?String(s.max):null;c!==n.appliedMax&&(c==null?n.appliedMax!=null&&o.style.maxHeight===n.appliedMax&&(o.style.maxHeight=""):o.style.maxHeight=c,n.appliedMax=c),n.resize()}function ht(t,s){const o=t.__ref?.__autoGrow;o&&(s&&(o.attachAttempts=0,o.firstAttemptAt=null),J.add(t),Ct())}function Ds(){const t=Array.from(J);J.clear();for(let s=0;s<t.length;s++){const o=t[s],e=o.node,n=o.__ref?.__autoGrow;if(!(!e||!n||!n.active)){if(!e.isConnected){n.firstAttemptAt==null&&(n.firstAttemptAt=nt()),n.attachAttempts+=1,n.attachAttempts<=so&&nt()-n.firstAttemptAt<eo&&(J.add(o),Ct());continue}n.attachAttempts=0,n.firstAttemptAt=null,n.resize()}}}function To(t,s){if(s.watch)return;const o=t.node;if(!o)return;const e=o.ownerDocument&&o.ownerDocument.defaultView,n=e&&e.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof n!="function")return;const c=()=>{if(!s.active||!o.isConnected||!(o.scrollHeight>0))return;if(s.awaitingLayout){s.awaitingLayout=!1,ht(t,!0);return}const d=o.clientWidth;s.lastWidth!=null&&Math.abs(d-s.lastWidth)<.5||(s.lastWidth=d,ht(t,!0))};let r;try{r=new n(c),r.observe(o)}catch{return}s.watch=r}function Po(t){const s=t.watch;if(s){t.watch=null;try{s.disconnect()}catch{}}}function Rs(t,s){if(s.fontsHooked)return;s.fontsHooked=!0;const o=t.node&&t.node.ownerDocument,e=o&&o.fonts&&o.fonts.ready;!e||typeof e.then!="function"||e.then(()=>{s.active&&t.node&&ht(t,!0)},()=>{})}function Ns(t){const s=t.ownerDocument&&t.ownerDocument.defaultView;let o;try{o=s&&s.getComputedStyle?s.getComputedStyle(t):null}catch{o=null}if(!o)return null;const e=g=>typeof g=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(g)?parseFloat(g):null,n=e(o.maxHeight);if(n==null||!(n>0))return null;const c=(e(o.paddingTop)||0)+(e(o.paddingBottom)||0),r=(e(o.borderTopWidth)||0)+(e(o.borderBottomWidth)||0),d=o.boxSizing==="border-box"?n-r:n+c,i=e(o.lineHeight);if(!(i>0))return d;const _=Math.floor((d-c)/i+1e-6);return _>=1?_*i+c:d}function Lo(t,s,o){o?s.appliedScroll||(t.style.overflowY="auto",s.appliedScroll=!0):s.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),s.appliedScroll=!1)}function Oo(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const o=t.__ref,e=t.autoGrow,n=typeof e=="function"?R(t,t.autoGrowDeps,e):null,c=(0,E.createEffect)(()=>{const r=t.autoGrow;let d=r;if(typeof r=="function")try{d=(r===e&&n?n:r)(t,t.state,t.context)}catch{d=null}Os(t,d)},{depth:o.path.length,label:j(o,"autoGrow")});o.__effects||(o.__effects=[]),o.__effects.push(c),n&&(o.__exec.autoGrow=e)}const Do=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Ro(t,s){for(const o of Object.keys(t)){if(!Y(o)||Do.has(o))continue;const e=(0,ct.globalEventKeyInfo)(o);if(e){(0,ct.registerGlobalEvent)(e,t,t[o]);continue}let n=t[o];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){const r=n;n=function(i){return t.call(r,i)}}if(typeof n!="function")continue;const c=ss(o);G.LIFECYCLE_EVENTS.has(c)||(0,ct.registerEvent)(es(c),t,n)}Ms(t)}function Ms(t){const s=t.node;if(!s||!s.addEventListener)return;const o={};let e=!1;for(const p of Do){const y=t[p];typeof y=="function"&&(o[p]=y,e=!0)}if(!e)return;const n=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let r=0,d=0,i=0,_=!1;const g=p=>{const y=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];y&&(r=y.clientX,d=y.clientY,i=Date.now(),_=!0)},f=p=>{if(!_)return;_=!1;const y=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!y)return;const a=y.clientX-r,h=y.clientY-d,u=Date.now()-i;if(u>c)return;const l=Math.abs(a),b=Math.abs(h);if(Math.max(l,b)<n)return;let A;if(l>b*1.2)A=a<0?"left":"right";else if(b>l*1.2)A=h<0?"up":"down";else return;const k="onSwipe"+A.charAt(0).toUpperCase()+A.slice(1),C=o[k],x=o.onSwipe;C&&C.call(t,p,t,t.state,t.context),x&&x.call(t,{direction:A,dx:a,dy:h,dt:u,event:p},t,t.state,t.context)};s.addEventListener("touchstart",g,{passive:!0}),s.addEventListener("touchend",f,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",g)}catch{}try{s.removeEventListener("touchend",f)}catch{}})}function yt(t,s){const o={...t};for(const e in s){const n=o[e],c=s[e];n&&c&&typeof n=="object"&&typeof c=="object"&&!Array.isArray(n)&&!Array.isArray(c)&&typeof n!="function"&&typeof c!="function"?o[e]=yt(n,c):o[e]=c}return o}function qt(t,s,o,e){if(!s||!t.node)return;const n=t.childExtends;if(Array.isArray(s)){const c=t.tag==="fragment",r=t.context?.document||globalThis.document,d=c?null:r?.createDocumentFragment();if(!c&&!d)return;const i=t.childProps,_=t.childrenAs,g=u=>{let l=s[u];const b=l;(typeof l=="string"||typeof l=="number")&&(l={text:l});let A=i;if(typeof i=="function")try{A=i(t,l)}catch{A=null}if(_==="state"){let C=b;(typeof b=="string"||typeof b=="number")&&(C={value:b,text:b}),l=A?{...A,state:C}:{state:C}}else A&&(l=yt(A,l));if(n&&!l.ignoreChildExtends)if(l.extends){const C=Array.isArray(l.extends)?l.extends:[l.extends],x=Array.isArray(n)?n:[n];l={...l,extends:[...x,...C]}}else l={...l,extends:n};const k=ro(l?.key,b,u);try{return Q(l,t,k,o)}catch(C){if(typeof console<"u"&&console.error){const x=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${x} (initial render, skipping this row):`,C?.message||C)}return null}},f=t.__ref;if(!(e===!0&&!c&&!!f&&(o?.mountYield===!0||t.yieldChildren===!0))){for(let u=0;u<s.length;u++){const l=g(u);!c&&l?.node&&d.appendChild(l.node)}return c||t.node.appendChild(d),!0}const y=f.__childrenChunkGen=(f.__childrenChunkGen||0)+1;(0,H.openMountBudget)();let a=null;const h=u=>{if(f.__disposed||f.__childrenChunkGen!==y){a&&a.parentNode&&a.remove();return}for(let l=u;l<s.length;l++){const b=g(l);if(b?.node&&(a?t.node.insertBefore(b.node,a):d.appendChild(b.node)),l+1<s.length&&(0,H.mountBudgetExhausted)()){a||(a=r.createComment("smbls-mount"),d.appendChild(a),t.node.appendChild(d));const A=l+1;(0,H.enqueueMountWork)(()=>h(A));return}}a?(a.remove(),t.node.tagName==="SELECT"&&Lt(t,!0)):t.node.appendChild(d)};return h(0),(0,H.closeMountBudget)(),!0}if(typeof s=="string"){const c=io(s,t);if(Array.isArray(c))return qt(t,c,o,e)}if(typeof s=="object")for(const c in s){if(G.REGISTRY.has(c))continue;let r=s[c];if(!(r==null||r===!1)){if((typeof r=="string"||typeof r=="number")&&(r={text:r}),t.childProps&&(r=yt(t.childProps,r)),n&&!r.ignoreChildExtends)if(r.extends){const d=Array.isArray(r.extends)?r.extends:[r.extends],i=Array.isArray(n)?n:[n];r={...r,extends:[...i,...d]}}else r={...r,extends:n};Q(r,t,c,o)}}}function Lt(t,s){const o=t.node;if(!o||o.tagName!=="SELECT")return;const e=o.options;if(!e||!e.length)return;const n=t.__ref,c=n&&n.__exec&&n.__exec.value,r=typeof c=="function",d=t.value!=null&&typeof t.value!="function";if(r||d){let g;if(r)try{g=c(t,t.state,t.context)}catch{return}else g=t.value,typeof g=="string"&&g.includes("{{")&&(g=D.replaceLiteralsWithObjectFields.call(t,g,t.state));const f=g==null?"":String(g);o.value!==f&&(o.value=f);return}const i=s||!(n&&n.__selectSynced);if(n&&(n.__selectSynced=!0),!i)return;let _=-1;for(let g=0;g<e.length;g++)e[g].defaultSelected&&(_=g);_>=0&&o.selectedIndex!==_&&(o.selectedIndex=_)}function No(t,s){let{children:o,content:e}=t;const n=t.childExtends;if(typeof o=="function"){const f=o;try{o=f(t,t.state,t.context)}catch(u){if(o=void 0,typeof console<"u"&&console.error){const l=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${l} (initial run, treating as empty):`,u?.message||u)}}t.children=o;const p=t.__ref;let y=!1;const a=R(t,t.childrenDeps,f),h=(0,E.createEffect)(()=>{const u=y;y=!0;let l;try{l=a(t,t.state,t.context)}catch(M){if(typeof console<"u"&&console.error){const O=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${O}${u?"":" (initial tracking run)"}:`,M?.message||M)}return}if(!u||l===t.children)return;t.children=l,p.__childrenChunkGen!=null&&p.__childrenChunkGen++;const b=typeof t.onContentUpdate=="function",A=b?[]:null,k=b?[]:null,C=b?[]:null;if(Array.isArray(l)&&t.childrenAs==="state"){const M=t.childProps,O=[],X=new Map;for(let T=0;T<l.length;T++){const K=l[T];let P=M;if(typeof M=="function")try{P=M(t,K)}catch{P=null}const z=ro(P&&P.key,K,T);O.push(z),X.set(z,{rawChild:K,childProps:P})}const bt=new Set(O),Go=p.__children.slice();for(const T of Go)if(!bt.has(T)){const K=t[T];K?.remove&&K.remove(),delete t[T],k&&k.push(T)}const ft=t.childExtends,At=t.tag==="fragment",Ho=t.context?.document||globalThis.document,at=At?null:Ho?.createDocumentFragment(),Rt=new Set;for(const T of O){const K=X.get(T),P=K.rawChild,z=t[T];if(z&&z.state){if(P&&typeof P=="object"){const F=z.state,st=F.$replace||F.replace,Xt=F.$update||F.update;try{if(typeof st=="function")st.call(F,P);else if(typeof Xt=="function"){for(const B in F)if(!(B==="__element"||B==="root"||B==="parent"||B==="update")&&!Object.prototype.hasOwnProperty.call(P,B))try{F[B]=void 0}catch{}Xt.call(F,P)}else for(const B in P)F[B]=P[B]}catch(B){if(typeof console<"u"&&console.error){const Ko=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to patch at ${Ko} (reconcile, keeping its previous data for this pass):`,B?.message||B)}}}C&&C.push(T);continue}let Nt=P;(typeof P=="string"||typeof P=="number")&&(Nt={value:P,text:P});const Qt=K.childProps;let V=Qt?{...Qt,state:Nt}:{state:Nt};if(ft&&!V.ignoreChildExtends)if(V.extends){const F=Array.isArray(V.extends)?V.extends:[V.extends],st=Array.isArray(ft)?ft:[ft];V={...V,extends:[...st,...F]}}else V={...V,extends:ft};let Mt;try{Mt=Q(V,t,T,s)}catch(F){if(typeof console<"u"&&console.error){const st=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to construct at ${st} (reconcile, skipping this row):`,F?.message||F)}Rt.add(T);continue}!At&&Mt?.node&&at&&at.appendChild(Mt.node),A&&A.push(T)}if(!At&&at&&at.childNodes.length&&t.node&&t.node.appendChild(at),!At&&t.node){let T=null;for(const K of O){const P=t[K]?.node;if(!P)continue;const z=T?T.nextSibling:t.node.firstChild;P!==z&&t.node.insertBefore(P,z),T=P}}p.__children=Rt.size?O.filter(T=>!Rt.has(T)):O,b&&(A.length||k.length)&&no(t,{added:A,removed:k,kept:C}),Lt(t,!1);return}const U=b?[...p.__children]:null;for(const M of[...p.__children]){const O=t[M];O?.remove&&O.remove(),delete t[M]}p.__children=[],qt(t,l,s),Lt(t,!1),b&&no(t,{added:[...p.__children],removed:U,kept:[]})},{depth:p.path.length,label:j(p,"children")});p.__effects.push(h)}const c=qt(t,o,s,!0);if(e!=null&&!(e&&e.__ref)){let f=e;if(typeof f=="string"||typeof f=="number"?f={text:f}:typeof f!="object"&&(f={}),t.childProps&&(f=yt(t.childProps,f)),n&&!f.ignoreChildExtends)if(f.extends){const p=Array.isArray(f.extends)?f.extends:[f.extends],y=Array.isArray(n)?n:[n];f={...f,extends:[...y,...p]}}else f={...f,extends:n};Q(f,t,"content",s)}if(o&&!c)return;const r=t.context?.components||{};{const f=Object.keys(t);for(let p=0;p<f.length;p++){const y=f[p];if(!y.endsWith("Extends")||typeof t[y]!="string")continue;const a=y.slice(0,-7);if(!a||a.charCodeAt(0)<65||a.charCodeAt(0)>90)continue;const h={extends:t[y]};delete t[y];for(let u=p+1;u<f.length;u++){const l=f[u],b=l.charCodeAt(0);if(b>=65&&b<=90||G.REGISTRY.has(l)||typeof t[l]=="function"&&(l.startsWith("on")||l.startsWith(".")))break;const A=t[l];A!==void 0&&(h[l]=A,delete t[l])}t[a]&&typeof t[a]=="object"?t[a]={...h,...t[a]}:t[a]=h}}const d=s?.mountYield===!0||t.yieldChildren===!0,i=Object.keys(t),_=f=>{if(G.REGISTRY.has(f)||typeof t[f]!="object"||t[f]===null)return;const p=f.charCodeAt(0);if(p<65||p>90)return;let y=t[f];if(!y.__ref){if(!y.extends&&!y.extend){const a=r[f]||r[`smbls.${f}`];a&&(y={...y,extends:a})}if(t.childProps&&(y=yt(t.childProps,y)),n&&!y.ignoreChildExtends)if(y.extends){const a=Array.isArray(y.extends)?y.extends:[y.extends],h=Array.isArray(n)?n:[n];y={...y,extends:[...h,...a]}}else y={...y,extends:n};Q(y,t,f,s)}};if(!d){for(const f of i)_(f);return}(0,H.openMountBudget)();const g=f=>{for(let p=f;p<i.length;p++)if(_(i[p]),p+1<i.length&&(0,H.mountBudgetExhausted)()){const y=p+1;(0,H.enqueueMountWork)(()=>g(y));return}};g(0),(0,H.closeMountBudget)()}function Mo(t,s,o){const{node:e}=t;if(!e)return;e.ref=t;const n=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(n){const r=n.parentNode;if(r){if(o?.position==="before"&&o.node)r.insertBefore(e,o.node);else if(o?.position==="after"&&o.node){const d=o.node.nextSibling;r.insertBefore(e,d||n)}else r.insertBefore(e,n);return}}const c=s?.node||(s?.nodeType?s:null);if(c)if(o?.position==="before"&&o.node)c.insertBefore(e,o.node);else if(o?.position==="after"&&o.node){const r=o.node.nextSibling;r?c.insertBefore(e,r):c.appendChild(e)}else c.appendChild(e)}const Dt=3;function Bo(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Dt?!1:(t.__inBeforeUpdate=!0,!0)}function gt(t,s){t&&(t.__inBeforeUpdate=!1,s?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Dt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Dt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function $(t,s,o){const e=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&(0,W.runPluginHook)(e,s,o);const n="on"+t,c=s[n];if(typeof c=="function"){const i=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(i){if(s.__ref[i])return!0;s.__ref[i]=!0}const _=s.context?.designSystem;_&&(0,v.pushConfig)(_);let g=!!i;try{const f=c(s,s.state,s.context,o);if(f&&typeof f.then=="function"){const p=s.__ref;return f.catch(y=>{s.context?.plugins?.length&&(0,W.runPluginHook)("error",s,{hook:n,error:y})||console.error(`[DOMQL] Lifecycle "${n}" error:`,y)}).finally(()=>{i&&p&&(p[i]=!1)}),g=!1,!0}if(f===!1)return!1}catch(f){if(s.context?.plugins?.length&&(0,W.runPluginHook)("error",s,{hook:n,error:f})||console.error(`[DOMQL] Lifecycle "${n}" error:`,f),s.context?.strictMode)throw f}finally{_&&(0,v.popConfig)(),g&&s.__ref&&(s.__ref[i]=!1)}}return!0}var Fs=Q;
4
+ `):"")}}if(Lt(r,!0),Fo(r,s,e),typeof r.html=="function"&&r.node&&!r.node.innerHTML){const l=r.context?.designSystem;l&&(0,j.pushConfig)(l);try{const b=r.html(r,r.state,r.context);b!=null&&typeof b!="function"&&(r.node.innerHTML=b)}catch{}finally{l&&(0,j.popConfig)()}}if(I("Create",r,n),I("Complete",r,n),I("Render",r,n),I("RenderRouter",r,n),$t(r,n),typeof r.onFrame=="function"){const l=r.onFrame,b=r.context?.designSystem,A=()=>{if(r.node){if(r.node.isConnected){b&&(0,j.pushConfig)(b);try{l(r,r.state,r.context)}catch(w){console.error("[DOMQL] onFrame error:",w)}finally{b&&(0,j.popConfig)()}}requestAnimationFrame(A)}};requestAnimationFrame(A)}return r}function rs(t,s,o){const n=!s,e=o.state&&typeof o.state=="object"&&!Array.isArray(o.state)&&Object.keys(o.state).length===0,c=n&&e&&t.context?.state,a=o.state!==void 0&&!c?o.state:t.state&&!(0,N.isStore)(t.state)?t.state:void 0;if(a==null){if(s?.state)t.state=s.state,(0,it.applyStateMethods)(t,t.state);else if(t.context?.state){const r=t.context.state,i={...r},h=t.context?.polyglot;if(h?.translations){const g=t.context,f=r.lang||h.defaultLang||"en",d=new Set,p=(_,l)=>{d.has(_)||(0,D.isPolyglotWritableKey)(g,_,i)&&(i[_]=l,d.add(_),(0,D.markPolyglotSeeded)(g,_,l))},u=h.translations[f];if(u&&typeof u=="object")for(const _ in u)p(_,u[_]);const y=new Set(h.languages||[]);for(const _ in h.translations)y.has(_)||p(_,h.translations[_])}t.state=(0,N.isStore)(i)?i:(0,N.createStore)(i),t.state.__element=t,t.state.root=t.state,(0,it.applyStateMethods)(t,t.state),wt.promoteActiveRootState?.(r,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,it.applyStateMethods)(t,t.state);return}if(typeof a=="string"){if(t.state=io(a,s),t.state&&typeof t.state=="object"&&!(0,N.isStore)(t.state)){const r=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:r,enumerable:!1,configurable:!0,writable:!0})}(0,it.applyStateMethods)(t,t.state);return}if(typeof a=="function"){const r=a(t,s?.state);t.state=(0,N.isStore)(r)?r:(0,N.createStore)(r||{})}else(0,N.isStore)(a)?t.state=a:t.state=(0,N.createStore)({...a});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,(0,it.applyStateMethods)(t,t.state),wt.promoteActiveRootState?.(a,t.state)}function Ut(t,s){if(!s)return t;const o=s.split("/");let n=t;for(const e of o){if(n==null)return{};n=n[e]}return n??{}}function io(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const e=t.slice(3);return e?Ut(s.state,e):s.state??{}}if(t.startsWith("~/")){const e=s.state?.root||s.state,c=t.slice(2);return c?Ut(e,c):e??{}}if(s.state?.[t]!==void 0)return s.state[t];const o=Ut(s.state,t);if(o!=null&&Object.keys(o).length>0)return o;const n=s.context?.polyglot;if(n?.translations){const e=s.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{}}const is=new Set(["s","state","ctx","context"]);function cs(t){try{const o=(typeof wt.getFunctionSource=="function"?wt.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return o?o[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function fs(t){if(typeof t!="function"||t.length!==2)return!1;const s=cs(t);if(s.length<2)return!1;const o=s[1].replace(/[{}[\]]/g,"").trim();return o.length>0&&!is.has(o)}function as(t){const s=t.__ref,o=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"||G.REGISTRY.has(r))continue;const i=r.charCodeAt(0);i>=65&&i<=90||Y(r)||S.CSS_PROPS_REGISTRY[r]||S.DEFAULT_CSS_PROPERTIES_LIST&&S.DEFAULT_CSS_PROPERTIES_LIST.has(r)||(0,v.checkAttributeByTagName)(o,r)||((0,tt.isLoudDevRuntime)()&&fs(t[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];s.__exec[r]=i,Object.defineProperty(t,r,{get(){n&&(0,j.pushConfig)(n);try{return i(t,t.state,t.context)}catch{return}finally{n&&(0,j.popConfig)()}},set(h){delete s.__exec[r],Object.defineProperty(t,r,{value:h,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function us(t,s){if(!(!Array.isArray(s)||s.length===0))for(let o=0;o<s.length;o++){const n=s[o];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function R(t,s,o){return!Array.isArray(s)||s.length===0?o:function(...n){return us(t,s),o.apply(this,n)}}function pt(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function E(t,s){return()=>t.path.join(".")+"::"+s}const co=new Set;function M(t,s,o){if(!(0,tt.isLoudDevRuntime)())return;const n=E(t,s)();co.has(n)||(co.add(n),console.warn(`[smbls] "${s}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,o?.message||o))}const fo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,ls=(t,s)=>{let o;try{o=String(t)}catch{return}if(!o.includes("{{"))return;fo.lastIndex=0;let n;for(;(n=fo.exec(o))!==null;)n[2].includes("{{")&&s.add(n[2])},ds=(t,s)=>!Y(t)&&!(0,Q.isCssProp)(s,t),ao=(t,s,o,n)=>{if(typeof s=="string"){s.includes("{{")&&o.add(s);return}typeof s=="function"&&ds(t,n)&&ls(s,o)},ps=["attr","aria","data"],hs=t=>{if(ps.includes(t))return!0;const s=t.charCodeAt(0);return s===46||s===33||s===64},ys=t=>{const s=new Set,o=t.tag||"div";for(const n of Object.keys(t)){const e=Object.getOwnPropertyDescriptor(t,n),c=e&&e.value;if(c&&typeof c=="object"&&!Array.isArray(c)){if(!hs(n))continue;for(const a in c)ao(a,c[a],s,o);continue}ao(n,c,s,o)}return s};function uo(t,s){const o=t.__ref,n=!!(s&&s.skipIfEffect),e=ys(t);if(o.__authoredTemplates)for(const i of e)o.__authoredTemplates.add(i);else o.__authoredTemplates=e;if(as(t),typeof t.text=="function"){const i=t.text,h=R(t,t.textDeps,i),g=(0,k.createEffect)(()=>{if(!o.contentManaged)try{let f=h(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&typeof f!="object"&&(typeof f=="string"&&f.includes("{{")&&(f=D.replaceLiteralsWithObjectFields.call(t,f,t.state)),_t(t,f))}catch(f){M(o,"text",f)}},{depth:o.path.length,label:E(o,"text")});o.__effects.push(g),o.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,h=(0,k.createEffect)(()=>{if(o.contentManaged)return;const g=D.replaceLiteralsWithObjectFields.call(t,i,t.state);g!=null&&(t.text=g),t.node&&_t(t,g??"")},{depth:o.path.length,label:E(o,"text")});o.__effects.push(h),o.__exec.text=i}const c=t.tag||"div";for(const i of Object.keys(t))if(typeof t[i]=="function"&&!G.REGISTRY.has(i)&&!Y(i)&&!o.__exec[i]&&!(0,Q.isAttributeFirst)(c,i)){if(S.CSS_PROPS_REGISTRY[i]){const h=t[i],g=R(t,t[i+"Deps"],h),f=i;let d,p=null,u=null,y;const _=(0,k.createEffect)(()=>{const l=t.context?.designSystem;l&&(0,j.pushConfig)(l);try{const b=g(t,t.state,t.context);(0,S.pushStaticCssPass)();let A;try{A=S.CSS_PROPS_REGISTRY[f](b,t,t.state,t.context)}finally{(0,S.popStaticCssPass)()}if(Array.isArray(A)){const x={};for(const C of A)if(C)for(const L in C)x[L]=C[L];A=x}const w=f==="show"||f==="hide";if(A&&t.node&&_s(A)){const x=vt(A);if(x===null||x!==y){y=x;const C=(0,Z.css)(A,null,t.context?.cssPrefix),L=C?C.split(" ").filter(Boolean):null;if(t.node.classList){if(u)for(const U of u)t.node.classList.remove(U);if(L&&L.length)for(const U of L)t.node.classList.add(U);u=L}}d=void 0,p=null}else if(A&&t.node){if(u){for(const C of u)t.node.classList.remove(C);u=null,y=void 0}const x=vt(A);if(x===null||x!==d||!Et(t.node,p)){d=x;const C=go(t,A);p=kt(t.node,C)}}else t.node&&w&&(d=void 0,p=null,t.node.style.display="")}finally{l&&(0,j.popConfig)()}},{depth:o.path.length,label:E(o,f)});o.__effects.push(_),o.__exec[i]=h}else if(S.DEFAULT_CSS_PROPERTIES_LIST&&S.DEFAULT_CSS_PROPERTIES_LIST.has(i)){const h=t[i],g=R(t,t[i+"Deps"],h),f=i;let d,p=null;const u=(0,k.createEffect)(()=>{const y=t.context?.designSystem;y&&(0,j.pushConfig)(y);try{const _=g(t,t.state,t.context);if(t.node)if(_!=null){const l=f+":"+String(_);if(l!==d||!Et(t.node,p)){d=l;const b={[f]:_},A=go(t,b);p=kt(t.node,A)}}else d=void 0,p=null,t.node.style[f]=""}finally{y&&(0,j.popConfig)()}},{depth:o.path.length,label:E(o,f)});o.__effects.push(u),o.__exec[i]=h}}if(typeof t.html=="function"){const i=t.html,h=R(t,t.htmlDeps,i),g=(0,k.createEffect)(()=>{const f=t.context?.designSystem;f&&(0,j.pushConfig)(f);try{const d=h(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{f&&(0,j.popConfig)()}},{depth:o.path.length,label:E(o,"html")});o.__effects.push(g),o.__exec.html=i}if(typeof t.value=="function"){const i=t.value,h=R(t,t.valueDeps,i),g=(0,k.createEffect)(()=>{try{let f=h(t,t.state,t.context);typeof f=="string"&&f.includes("{{")&&(f=D.replaceLiteralsWithObjectFields.call(t,f,t.state)),ho(t,f)}catch(f){M(o,"value",f)}},{depth:o.path.length,label:E(o,"value")});o.__effects.push(g),o.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,h=(0,k.createEffect)(()=>{try{ho(t,D.replaceLiteralsWithObjectFields.call(t,i,t.state))}catch(g){M(o,"value",g)}},{depth:o.path.length,label:E(o,"value")});o.__effects.push(h),o.__exec.value=i}if(typeof t.style=="function"){const i=t.style,h=R(t,t.styleDeps,i);let g,f=null;const d=(0,k.createEffect)(()=>{const p=h(t,t.state,t.context),u=vt(p);(u===null||u!==g||!Et(t.node,f))&&(g=u,gs(t.node,f,p),m(t.node,p),f=kt(t.node,p))},{depth:o.path.length,label:E(o,"style")});o.__effects.push(d),o.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const h=t.style[i];if(typeof h!="function")continue;const g=R(t,pt(t.styleDeps,i),h);let f,d=null;const p=(0,k.createEffect)(()=>{try{const u=g(t,t.state,t.context);if(t.node){const y=i+":"+String(u);if(y!==f||!Et(t.node,d)){f=y;const _={[i]:u};m(t.node,_),d=kt(t.node,_)}}}catch(u){M(o,"style."+i,u)}},{depth:o.path.length,label:E(o,"style."+i)});o.__effects.push(p)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const h=R(t,pt(t.attrDeps,i),t.attr[i]),g=i,f=(0,k.createEffect)(()=>{try{let d=h(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=D.replaceLiteralsWithObjectFields.call(t,d,t.state)),t.node?.setAttribute&&(d==null||d===!1&&!(0,v.isEnumeratedTrueFalseAttr)(g)?t.node.removeAttribute(g):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(g,(0,v.serializeAttrValue)(g,d)))}catch(d){M(o,"attr."+g,d)}},{depth:o.path.length,label:E(o,"attr."+g)});f._attrName=g.toLowerCase(),o.__effects.push(f)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const h=t.attr[i],g=i,f=(0,k.createEffect)(()=>{try{const d=D.replaceLiteralsWithObjectFields.call(t,h,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(g,(0,v.serializeAttrValue)(g,d??""))}catch(d){M(o,"attr."+g,d)}},{depth:o.path.length,label:E(o,"attr."+g)});f._attrName=g.toLowerCase(),o.__effects.push(f)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const h=t.aria[i];if(typeof h=="string"&&h.includes("{{")){const p=h,u="aria-"+i.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),y=(0,k.createEffect)(()=>{try{const _=D.replaceLiteralsWithObjectFields.call(t,p,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,(0,v.serializeAttrValue)(u,_??""))}catch(_){M(o,"aria."+i,_)}},{depth:o.path.length,label:E(o,"aria."+i)});y._attrName=u,o.__effects.push(y);continue}if(typeof h!="function")continue;const g=R(t,pt(t.ariaDeps,i),t.aria[i]),f="aria-"+i.replace(/[A-Z]/g,p=>"-"+p.toLowerCase()),d=(0,k.createEffect)(()=>{try{const p=g(t,t.state,t.context);if(!t.node?.setAttribute)return;p==null?t.node.removeAttribute(f):typeof p!="function"&&typeof p!="object"&&t.node.setAttribute(f,(0,v.serializeAttrValue)(f,p))}catch(p){M(o,"aria."+i,p)}},{depth:o.path.length,label:E(o,"aria."+i)});d._attrName=f,o.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const i in t.data){const h=t.data[i];if(typeof h=="string"&&h.includes("{{")){const u=h,y="data-"+i.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),_=(0,k.createEffect)(()=>{try{const l=D.replaceLiteralsWithObjectFields.call(t,u,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,l??"")}catch(l){M(o,"data."+i,l)}},{depth:o.path.length,label:E(o,"data."+i)});_._attrName=y,o.__effects.push(_);continue}if(typeof h!="function")continue;const g=R(t,pt(t.dataDeps,i),t.data[i]),d="data-"+i.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),p=(0,k.createEffect)(()=>{try{const u=g(t,t.state,t.context);if(!t.node?.setAttribute)return;u==null||u===!1?t.node.removeAttribute(d):typeof u!="function"&&typeof u!="object"&&t.node.setAttribute(d,u===!0?"":u)}catch(u){M(o,"data."+i,u)}},{depth:o.path.length,label:E(o,"data."+i)});p._attrName=d,o.__effects.push(p)}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 h=R(t,pt(t.classDeps,i),a[i]),g=(0,k.createEffect)(()=>{try{const f=h(t,t.state,t.context);if(!t.node?.classList)return;typeof f=="string"?t.node.classList.add(f):f?t.node.classList.add(i):t.node.classList.remove(i)}catch(f){M(o,"class."+i,f)}},{depth:o.path.length,label:E(o,"class."+i)});o.__effects.push(g)}!n&&typeof t.if=="function"&&po(t,o,t.if);for(const i of Object.keys(t)){if(G.REGISTRY.has(i)||typeof t[i]!="function")continue;const h=i.charCodeAt(0);if(h>=65&&h<=90||Y(i))continue;const g=t[i];o.__exec[i]=g;const f=t.tag||"div";if((0,v.checkAttributeByTagName)(f,i)&&!(0,Q.isCssProp)(f,i)){const d=(0,v.camelToAttr)(i)||i,p=R(t,t[i+"Deps"],g),u=(0,k.createEffect)(()=>{try{let y=p(t,t.state,t.context);typeof y=="string"&&y.includes("{{")&&(y=D.replaceLiteralsWithObjectFields.call(t,y,t.state)),t.node?.setAttribute&&(y==null||y===!1&&!(0,v.isEnumeratedTrueFalseAttr)(d)?t.node.removeAttribute(d):typeof y!="function"&&typeof y!="object"&&(d==="src"&&"src"in t.node?t.node.src=y:t.node.setAttribute(d,(0,v.serializeAttrValue)(d,y))))}catch(y){M(o,i,y)}},{depth:o.path.length,label:E(o,i)});u._attrName=d.toLowerCase(),o.__effects.push(u)}}const r=t.tag||"div";for(const i of Object.keys(t)){if(G.REGISTRY.has(i))continue;const h=t[i];if(typeof h!="string"||!h.includes("{{"))continue;const g=i.charCodeAt(0);if(g>=65&&g<=90||Y(i)||(0,Q.isCssProp)(r,i)||v.ATTR_TRANSFORMS[i]||!(0,v.checkAttributeByTagName)(r,i))continue;const f=(0,v.camelToAttr)(i)||i,d=(0,k.createEffect)(()=>{try{const p=D.replaceLiteralsWithObjectFields.call(t,h,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(f,(0,v.serializeAttrValue)(f,p??""))}catch(p){M(o,i,p)}},{depth:o.path.length,label:E(o,i)});d._attrName=f.toLowerCase(),o.__effects.push(d)}if(Ss(t),Es(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,h=t.stateDeps;let g=!1,f=[];const d=(0,k.createEffect)(()=>{const p=[];for(let l=0;l<h.length;l++){const b=h[l];try{p[l]=typeof b=="function"?b(t,t.state,t.context):t.state?.[b]}catch{p[l]=void 0}}if(!g){g=!0,f=p;return}let u=p.length!==f.length;for(let l=0;!u&&l<p.length;l++)p[l]!==f[l]&&(u=!0);const y=f;if(f=p,!u)return;const _=t.context?.designSystem;_&&(0,j.pushConfig)(_);try{i(t,t.state,t.context,{prev:y,next:p})}catch(l){if(t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onStateUpdate",error:l})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',l),t.context?.strictMode)throw l}finally{_&&(0,j.popConfig)()}},{depth:o.path.length,label:E(o,"onStateUpdate")});o.__effects.push(d)}js(t)}function lo(t){const s=t.parent,o=s?.node;if(!o||!t.node){Fo(t,t.parent);return}let n=null;const e=Object.keys(s),c=e.indexOf(t.key);for(let a=c+1;a<e.length;a++){const r=s[e[a]];if(r?.node?.parentNode===o){n=r.node;break}}n?o.insertBefore(t.node,n):o.appendChild(t.node)}function po(t,s,o){const n=R(t,t.ifDeps,o),e=(0,k.createEffect)(()=>{let c;try{c=n(t,t.state,t.context)}catch(r){if(c=!1,s.__ifError=r,typeof console<"u"&&console.warn){const i=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${i} \u2014 treating as false:`,r?.message||r)}return}const a=s.__if;if(s.__if=!!c,a&&!s.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(r){console.error("[smbls] onRemove error:",r)}}else if(!a&&s.__if)if(s.__ifInitialized)t.node||(t.node=(0,ot.cacheNode)(t)),t.node&&(t.node.ref=t),lo(t),Bt(t),I("Render",t,{}),$t(t,{});else{if(s.__ifInitialized=!0,t.tag||(t.tag=(0,ot.detectTag)(t)),I("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"&&!s.__fragmentAnchor){const i=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(i),s.__fragmentAnchor=i}I("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Mo(t,{}),uo(t,{skipIfEffect:!0}),Bt(t),Eo(t),Do(t),No(t,{}),lo(t),I("Create",t,{}),I("Complete",t,{}),I("Render",t,{}),I("RenderRouter",t,{}),$t(t,{})}},{depth:s.path.length,label:E(s,"if")});s.__effects.push(e)}function _t(t,s){const o=t.node;if(!o)return;const n=s==null||typeof s=="object"?"":String(s);if(t.tag==="string"){o.nodeValue!==n&&(o.nodeValue=n);return}const e=t.__ref;let c=e?e.__textNode:null;if(c&&c.parentNode!==o&&(c=null),!c){const a=o.firstChild;a&&a.nodeType===3&&(c=a)}c?c.nodeValue!==n&&(c.nodeValue=n):o.firstChild?(c=(o.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),o.insertBefore(c,o.firstChild)):(o.textContent=n,c=o.firstChild&&o.firstChild.nodeType===3?o.firstChild:null),e&&(e.__textNode=c||null)}function ho(t,s){const o=t.node;if(!o||!("value"in o))return;const n=s==null?"":String(s);if(o.value===n)return;const e=typeof document<"u"&&document.activeElement===o,c=e&&typeof o.selectionStart=="number"?o.selectionStart:null,a=e&&typeof o.selectionEnd=="number"?o.selectionEnd:null;if(o.value=n,e&&c!=null&&a!=null)try{o.setSelectionRange(c,a)}catch{}const r=t.__ref&&t.__ref.__autoGrow;r&&r.active&&r.resize()}function Bt(t){const{node:s}=t;if(s){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&_t(t,t.text),jo(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in s){const o=String(t.value);s.value!==o&&(s.value=o)}if(t.style&&typeof t.style=="object"){let o=t.style;for(const n in t.style)if(typeof t.style[n]=="function"){o={};for(const e in t.style)typeof t.style[e]!="function"&&(o[e]=t.style[e]);break}m(s,o)}if(t.attr&&typeof t.attr=="object")for(const o in t.attr){const n=t.attr[o];typeof n=="function"||typeof n=="object"||n!=null&&(typeof n=="string"&&n.includes("{{")||n===!1&&!(0,v.isEnumeratedTrueFalseAttr)(o)||s.setAttribute&&s.setAttribute(o,(0,v.serializeAttrValue)(o,n)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&s.setAttribute&&s.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const o in t.data){const n=t.data[o];typeof n=="function"||typeof n=="object"||n==null||n===!1||typeof n=="string"&&n.includes("{{")||s.dataset&&(s.dataset[o]=n===!0?"":n)}if(t.classlist||t.class){const o=t.classlist||t.class;if(typeof o=="string")o.split(" ").forEach(n=>n&&s.classList.add(n));else if(typeof o=="object")for(const n in o){const e=typeof o[n]=="function"?o[n](t,t.state,t.context):o[n];e&&s.classList.add(typeof e=="string"?e:n)}}}}function vt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function _s(t){if(!t||typeof t!="object")return!1;for(const s in t){const o=t[s];if(o&&typeof o=="object"&&!Array.isArray(o))return!0}return!1}function kt(t,s){if(!t||!t.style||!s)return null;const o=t.style,n=[];for(const e in s){if(s[e]==null||e.charAt(0)==="&")continue;const a=jt(e);n.push(a,Gt(o,a),yo(o,a))}return n}function Gt(t,s){return typeof t.getPropertyValue=="function"?t.getPropertyValue(s):""}function yo(t,s){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(s):""}function jt(t){return Tt(t)?t:t.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())}function gs(t,s,o){if(!t||!t.style||!s||!s.length)return;const n=t.style,e=new Set;if(o&&typeof o=="object")for(const c in o)o[c]==null||c.charAt(0)==="&"||e.add(jt(c));for(let c=0;c<s.length;c+=3){const a=s[c];e.has(a)||Gt(n,a)===s[c+1]&&typeof n.removeProperty=="function"&&n.removeProperty(a)}}function Et(t,s){if(!s||!t||!t.style)return!1;const o=t.style;for(let n=0;n<s.length;n+=3)if(Gt(o,s[n])!==s[n+1]||yo(o,s[n])!==s[n+2])return!1;return!0}const Tt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function bs(t){let s=null;for(const o in t)t[o]!=null&&o.charAt(0)!=="&"&&(s||(s=new Set),s.add(jt(o)));return s}function As(t,s,o,n){const e=t.__ref;if(!e)return;let c=null;if(o)for(const a of o){if(n&&n.has(a))continue;const r=s[a];if(r==null||typeof r=="object")continue;const i=jt(a);Zt.CSS_LONGHAND_SHORTHANDS[i]&&(c||(c={}),c[i]=r)}e.__declaredLonghands=c}function _o(t,s){const o=t.__ref,n=o&&o.__declaredLonghands;if(!n||!s)return null;let e=null;for(const c in n){if(s.has(c))continue;const a=Zt.CSS_LONGHAND_SHORTHANDS[c];let r=!1;for(let i=0;i<a.length;i++)if(s.has(a[i])){r=!0;break}r&&(e||(e={}),e[c]=n[c])}return e}function go(t,s){const o=t.node;m(o,s);const n=bs(s);if(!n)return s;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=_o(t,n);return c?(m(o,c),Object.assign({},s,c)):s}function xs(t){const s=t.__ref;if(!s||!s.__inlineCssKeys||!s.__declaredLonghands)return;const o=_o(t,s.__inlineCssKeys);o&&m(t.node,o)}function m(t,s){if(!t||!s||!t.style)return;let o=null;for(const n in s){const e=s[n];if(e!=null){if(n.charAt(0)==="&"&&typeof e=="object"){o||(o={}),o[n]=e;continue}try{const c=String(e),a=Tt(n)?n:n.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),r=c.trim(),i=/\s*!important\s*$/.test(r),h=r.replace(/\s*!important\s*$/,"");t.style.setProperty(a,h,i?"important":"")}catch{}}}o&&ws(t,o)}function ws(t,s){const o=`_ds${mt.scopedStyleId++}`;t.classList.add(o);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 s){const r="."+o,i=a.replace(/&/g,r).split(",").map(g=>{const f=g.trim();return f.includes(r)?f:r+f}).join(", "),h=s[a];if(typeof h=="object"){let g="",f="";for(const d in h){const p=h[d];if(typeof p=="object"){const u=d.includes("&")?i.split(", ").map(_=>d.replace(/&/g,_)).join(", "):i.split(", ").map(_=>`${_} ${d}`).join(", ");let y="";for(const _ in p)y+=`${_.replace(/[A-Z]/g,l=>"-"+l.toLowerCase())}: ${p[_]};`;f+=(0,Z.wrapHoverRule)(`${u} { ${y} }`,u)+`
5
+ `}else g+=`${d.replace(/[A-Z]/g,u=>"-"+u.toLowerCase())}: ${p};`}g&&(c+=(0,Z.wrapHoverRule)(`${i} { ${g} }`,i)+`
6
+ `),f&&(c+=f)}}c&&(e.textContent+=c)}const bo=new Set;function Ao(t){if(!Array.isArray(t))return"";const s=[];for(let o=0;o<t.length;o++)typeof t[o]=="string"&&t[o].length&&s.push(t[o]);return s.sort(),s.join("|")}function Cs(t,s,o){const n=Ao(o);queueMicrotask(()=>{if(!t.__ref)return;let e;try{e=s(t,t.state,t.context)}catch{return}if(Ao(e)===n)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";bo.has(c)||(bo.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${o.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 Ss(t){const s=t.subscribeTo,o=typeof s=="function";let n=s;if(o)try{n=s(t,t.state,t.context)}catch{n=null}if(o&&(0,tt.isLoudDevRuntime)()&&Cs(t,s,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],h=r.slice(1),g={value:!1},f=(0,k.createEffect)(()=>{const d=t.state&&((0,N.isStore)(t.state)?t.state.root:null);if(!d||!(0,N.isStore)(d))return;let p=d;p=p[i];for(let y=0;y<h.length&&!(p==null||typeof p!="object");y++)if((0,N.isStore)(p))p=p[h[y]];else break;if(!g.value)return;let u=!1;if(typeof t.onBeforeUpdate=="function"){const y=t.context?.designSystem;y&&(0,j.pushConfig)(y);try{if(Go(e)){const _=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});_&&typeof _.then=="function"?_.then(()=>gt(e,!1),l=>{gt(e,!0),t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:l})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",l)}):(gt(e,!1),_===!1&&(u=!0))}}catch(_){gt(e,!0),t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:_})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",_)}finally{y&&(0,j.popConfig)()}}if(!u&&t.node&&e.__effects)for(let y=0;y<e.__effects.length;y++){const _=e.__effects[y];_&&_!==f&&!_._disposed&&!_._isSubscribeToEffect&&typeof _._execute=="function"&&_._execute()}if(!u&&typeof t.onUpdate=="function"){const y=t.context?.designSystem;y&&(0,j.pushConfig)(y);try{t.onUpdate(t,t.state,t.context)}catch(_){t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onUpdate",error:_})||console.error("[DOMQL] subscribeTo onUpdate error:",_)}finally{y&&(0,j.popConfig)()}}},{depth:e.path.length,label:E(e,"subscribeTo("+a+")")});g.value=!0,f._isSubscribeToEffect=!0,e.__effects.push(f)}}function Ht(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}function Vt(t,s){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const o=s.context?.designSystem?.media?.[t.slice(1)];return o?/^@(media|supports|container)\b/.test(o)?o:`@media ${o}`:t}const xo=new Set;function vs(t,s){const o=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",n=o+"::"+t;xo.has(n)||(xo.add(n),console.warn(`[smbls/css] "${t}" at ${o} 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.`))}function rt(t,s,o,n){const e={},c=new Set,a=(r,i,h)=>{const g=h?new Set(Object.keys(e)):null;if(S.CSS_PROPS_REGISTRY[r]){const f=S.CSS_PROPS_REGISTRY[r](i,s,s.state,s.context);if(f){const d=Array.isArray(f)?f:[f];for(const p of d)p&&Object.assign(e,p)}}else e[r]=i;if(h)for(const f in e)g.has(f)||c.add(f)};for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let i=t[r];if(typeof i=="function"&&(i=i(s,s.state,s.context)),i==null||typeof i=="function")continue;if(typeof i=="object"&&!Array.isArray(i)){if(r==="style"){for(const p in i){let u=i[p];if(typeof u=="function"&&(u=u(s,s.state,s.context)),u==null||typeof u=="function")continue;const y=typeof s[p]=="function"&&(S.CSS_PROPS_REGISTRY[p]||S.DEFAULT_CSS_PROPERTIES_LIST&&S.DEFAULT_CSS_PROPERTIES_LIST.has(p))||!!(n&&n.has(p));a(p,u,y)}continue}if(Ht(r,s)){const p=rt(i,s,!1,n);Object.keys(p).length&&(e[`[data-theme="${r.slice(1)}"] &`]=p);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(r)){(0,tt.isLoudDevRuntime)()&&vs(r,s);continue}const f=Vt(r,s),d=rt(i,s,!1,n);Object.keys(d).length&&(e[f]=d);continue}const h=typeof s[r]=="function"&&(S.CSS_PROPS_REGISTRY[r]||S.DEFAULT_CSS_PROPERTIES_LIST&&S.DEFAULT_CSS_PROPERTIES_LIST.has(r)),g=!!(n&&n.has(r));a(r,i,h||g)}if(o)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 Pt=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function wo(t,s){for(const o in s){const n=s[o];t[o]=Pt(n)?wo(Pt(t[o])?t[o]:{},n):n}return t}function ks(t,s){if(!Pt(s))return;let o;for(const n of t.split(" ")){const e=n?s[n]:null;Pt(e)&&(o=wo(o||{},e))}return o}function Kt(t,s){if(s===void 0&&(s=0),s>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&Kt(t[o],s+1))return!0}return!1}function Co(t,s,o){if(!s||typeof s!="object"||Array.isArray(s))return null;if(Ht(t,o)){const c=rt(s,o,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const n=Vt(t,o),e=rt(s,o,!1);return Object.keys(e).length?{cssProp:n,block:e}:null}function js(t){const s=t.__ref;for(const o of Object.keys(t)){if(!It(o))continue;const n=t[o];if(!n||typeof n!="object"||Array.isArray(n)||!Kt(n))continue;let e=null,c;const a=(0,k.createEffect)(()=>{if(!t.node)return;const r=t.context?.designSystem;r&&(0,j.pushConfig)(r);let i,h=!1;try{const g=Co(o,n,t),f=g?vt(g.block)+"::"+g.cssProp:null;if(f!==null&&f===c)h=!0;else if(c=f,g){const d=(0,Z.css)({[g.cssProp]:g.block},null,t.context?.cssPrefix);i=d?d.split(" ").filter(Boolean):null}else i=null}finally{r&&(0,j.popConfig)()}if(!(h||!t.node.classList)){if(e)for(const g of e)t.node.classList.remove(g);if(i&&i.length)for(const g of i)t.node.classList.add(g);e=i}},{depth:s.path.length,label:E(s,"cssBlock("+o+")")});s.__effects.push(a)}}function Es(t){const s=t.__ref;s.__conditionalRunners=[];const o=new Map;for(const n of Object.keys(t)){const e=n.charAt(0);if(e!=="."&&e!=="!")continue;const c=n.slice(1);if(!c)continue;if(/[:@\s>~+[\]]/.test(c)){if(typeof console<"u"&&console.warn){const u=c.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${e}\` is read as one prop name. Nest the selector inside instead: \`${e}${u}: { '${c.slice(u.length)}': {...} }\`.`)}continue}const a=t[n];if(!a||typeof a!="object")continue;const r=e==="!",i={lastMatch:!1,appliedKeys:null,appliedClasses:null},h=new Set;for(const u in a){if(!Object.prototype.hasOwnProperty.call(a,u))continue;const y=u.charAt(0),_=a[u];(y===":"||y==="@"||y==="&"||y==="[")&&_&&typeof _=="object"&&!Array.isArray(_)||h.add(u)}const g=()=>{let u;const y=t[c];if(y===void 0){const b=!!t.state&&c in t.state,A=t.state?t.state[c]:void 0;if(b||A!==void 0)u=A;else{const w=t.context?.cases?.[c];if(w===void 0)return;try{u=typeof w=="function"?w.call(t,t):w}catch(x){u=!1,s.__conditionalError=x,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,x?.message||x)}}}else if(typeof y=="function")try{u=y(t,t.state,t.context)}catch(b){u=!1,s.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}else u=y;const _=r?!u:!!u;if(!t.node||_===i.lastMatch)return;i.lastMatch=_;const l=t.context?.designSystem;l&&(0,j.pushConfig)(l);try{if(_){const b={},A={};let w=!1;for(const C in a){if(!Object.prototype.hasOwnProperty.call(a,C))continue;const L=a[C],U=C.charAt(0);if((U===":"||U==="@"||U==="&"||U==="[")&&L&&typeof L=="object"&&!Array.isArray(L)){if(Ht(C,t)){const O=rt(L,t,!1,h);Object.keys(O).length&&(A[`[data-theme="${C.slice(1)}"] &`]=O,w=!0)}else{const O=Vt(C,t),X=rt(L,t,!1,h);Object.keys(X).length&&(A[O]=X,w=!0)}continue}const F=typeof L=="function"?L(t,t.state,t.context):L;if(F!=null)if(S.CSS_PROPS_REGISTRY[C]){const O=S.CSS_PROPS_REGISTRY[C](F,t,t.state,t.context);if(O){const X=Array.isArray(O)?O:[O];for(const bt of X)bt&&Object.assign(b,bt)}}else(S.DEFAULT_CSS_PROPERTIES_LIST&&S.DEFAULT_CSS_PROPERTIES_LIST.has(C)||Tt(C))&&(b[C]=F)}const x=Object.keys(b);if(x.length){m(t.node,b);for(const C of x)o.set(C,n);i.appliedKeys=x}else i.appliedKeys=null;if(w){const C=(0,Z.css)(A,null,t.context?.cssPrefix,{state:!0}),L=C?C.split(" ").filter(Boolean):[];if(L.length&&t.node.classList){for(const U of L)t.node.classList.add(U);i.appliedClasses=L}else i.appliedClasses=null}else if(i.appliedClasses){for(const C of i.appliedClasses)t.node.classList.remove(C);i.appliedClasses=null}}else{if(i.appliedKeys){for(const b of i.appliedKeys)o.get(b)===n&&(Tt(b)?t.node.style.removeProperty(b):t.node.style[b]="",o.delete(b));i.appliedKeys=null}if(i.appliedClasses){for(const b of i.appliedClasses)t.node.classList.remove(b);i.appliedClasses=null}}}finally{l&&(0,j.popConfig)()}};s.__conditionalRunners.push(g);const f=R(t,t[c+"Deps"],g),d=(0,k.createEffect)(f,{depth:s.path.length,label:E(s,"conditional("+n+")")}),p=s.__exec&&s.__exec[c]||t[c];d._sources.size===0&&typeof p=="function"&&(0,tt.isLoudDevRuntime)()&&console.warn(`[smbls] conditional \`${n}\` 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 \`${c}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),s.__effects.push(d)}}const Wt=new WeakSet;function Ts(t){const s=t.ownerDocument;!s||Wt.has(s)||(Wt.add(s),queueMicrotask(()=>{Wt.delete(s);const o=s.body||s.documentElement;o&&o.offsetWidth}))}const zt=new WeakSet;let So=!1;function vo(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Yt(t,s){const o={...t};for(const n in s){const e=s[n],c=o[n];o[n]=e&&typeof e=="object"&&c&&typeof c=="object"?Yt(c,e):e}return o}function ko(t,s){const o={};for(const n in t){const e=t[n];if(e&&typeof e=="object"){const c=ko(e,s);Object.keys(c).length&&(o[n]=c)}else s.has(n)||(o[n]=e)}return o}function jo(t){const{node:s}=t;if(!s)return;if(So||(So=!0,(0,Z.css)({display:"none"})),zt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}zt.add(t);const o=t.context?.designSystem;o&&(0,j.pushConfig)(o),(0,S.pushStaticCssPass)();try{const n={};let e=!1,c=[],a=null,r=null,i=null;const h=(u,y)=>{if(y&&typeof y=="object"&&vo(u)){r||(r={});const _=r[u];_&&(y=Yt(_,y)),r[u]=y}else(y===null||typeof y!="object")&&(i||(i=new Set),i.add(u));n[u]=y};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&S.CSS_PROPS_REGISTRY.theme){const u=S.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(u){const y=_=>{for(const l in _){const b=_[l];b&&typeof b=="object"&&vo(l)&&(a||(a={}),a[l]=b),n[l]=b}};if(Array.isArray(u))for(const _ of u)_&&y(_);else y(u);e=!0}}const g=(u,y)=>{if(S.CSS_PROPS_REGISTRY[u]){const _=S.CSS_PROPS_REGISTRY[u](y,t,t.state,t.context);if(_){if(Array.isArray(_)){for(const l of _)if(l)for(const b in l)h(b,l[b])}else for(const l in _)h(l,_[l]);e=!0}}else if(S.DEFAULT_CSS_PROPERTIES_LIST&&S.DEFAULT_CSS_PROPERTIES_LIST.has(u))y!=null&&typeof y!="object"&&(h(u,y),e=!0);else if(u.charCodeAt(0)===45)y!=null&&typeof y!="object"&&(h(u,y),e=!0);else if((u.charAt(0)==="&"||u.charAt(0)==="@"||u.charAt(0)===":"||u.charAt(0)==="[")&&y&&typeof y=="object"&&!Array.isArray(y)){if(Kt(y))return;const _=Co(u,y,t);_&&(h(_.cssProp,_.block),e=!0)}};if(typeof t.class=="string"){const u=ks(t.class,t.context?.designSystem?.class);if(u)for(const y in u)g(y,u[y])}const f=i?new Set(i):null,d=t.tag||"div";for(const u of Object.keys(t)){if(typeof t[u]=="function"||G.REGISTRY.has(u)||u==="theme")continue;const y=u.charCodeAt(0);y>=65&&y<=90||Y(u)||(0,Q.isAttributeFirst)(d,u)||g(u,t[u])}if(a)for(const u in a){let y=i?ko(a[u],i):a[u];r&&r[u]&&(y=Yt(y,r[u])),Object.keys(y).length?n[u]=y:delete n[u]}if(As(t,n,i,f),e){n.display&&String(n.display).includes("!important")&&(s.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const u=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof u=="string"&&u!==""&&n.display&&n.display!==u&&(n.display=u);const y=(0,Z.css)(n,null,t.context?.cssPrefix);if(c=y?y.split(" ").filter(Boolean):[],y&&s.classList){const _=c;let l=!1;for(const b of _)s.classList.add(b),l||(b.charCodeAt(0)===95&&b.charCodeAt(1)===99||b.charCodeAt(0)===95&&b.indexOf("_c",1)!==-1)&&(l=!0);l&&Ts(s)}}const p=t.__ref;if(p){const u=p.__staticCssClasses;if(u&&s.classList){const y=new Set(c);for(const _ of u)y.has(_)||s.classList.remove(_)}p.__staticCssClasses=c}xs(t)}finally{(0,S.popStaticCssPass)(),o&&(0,j.popConfig)(),zt.delete(t)}}const Ps=t=>!!S.CSS_PROPS_REGISTRY[t]||!!(S.DEFAULT_CSS_PROPERTIES_LIST&&S.DEFAULT_CSS_PROPERTIES_LIST.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function Ls(t){t&&t.node&&jo(t)}function Eo(t){const{node:s}=t;if(!s||!s.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());s.setAttribute(a,(0,v.serializeAttrValue)(a,c))}const o=(0,v.applyAttrTransforms)(t);for(const e in o){const c=o[e];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&s.setAttribute(e,c===!0?"":c)}const n=t.tag||"div";for(const e of Object.keys(t)){if(typeof t[e]=="function"||G.REGISTRY.has(e)||e==="on"||o[e]!==void 0)continue;const c=e.charCodeAt(0);if(!(c>=65&&c<=90)&&!Y(e)&&!(0,Q.isCssProp)(n,e)&&(0,v.checkAttributeByTagName)(n,e)){let a=t[e];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!v.ATTR_TRANSFORMS[e])continue;a=D.replaceLiteralsWithObjectFields.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!(0,v.isEnumeratedTrueFalseAttr)((0,v.camelToAttr)(e)||e))continue;const r=(0,v.camelToAttr)(e)||e;s.setAttribute(r,(0,v.serializeAttrValue)(r,a))}}}function Os(t,s){const{node:o}=t;if(!o||!o.setAttribute)return;const n=s.charCodeAt(0);if(n>=65&&n<=90||Y(s))return;const e=t.tag||"div";if((0,Q.isCssProp)(e,s)||!(0,v.checkAttributeByTagName)(e,s))return;const c=(0,v.camelToAttr)(s)||s,a=c.toLowerCase(),r=t.__ref&&t.__ref.__effects;let i=!1;if(r)for(let f=0;f<r.length;f++){const d=r[f];d&&d._attrName===a&&!d._disposed&&typeof d._execute=="function"&&(i=!0,d._execute())}if(i)return;let h=t[s];const g=v.ATTR_TRANSFORMS[s];if(g&&h!=null){const f=g(t);f!==void 0&&(h=f)}typeof h=="string"&&h.includes("{{")&&(h=D.replaceLiteralsWithObjectFields.call(t,h,t.state)),h==null||h===!1&&!(0,v.isEnumeratedTrueFalseAttr)(c)?o.removeAttribute(c):typeof h!="function"&&typeof h!="object"&&o.setAttribute(c,(0,v.serializeAttrValue)(c,h))}function Ds(t,s){const o=t.node,n=t.__ref;let e=n.__autoGrow;if(!s){if(e&&e.active){try{o.removeEventListener("input",e.resize)}catch{}Po(e),J.delete(t),o.style.height="",e.appliedMax!=null&&o.style.maxHeight===e.appliedMax&&(o.style.maxHeight=""),Lo(o,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(!o.isConnected){ht(t,!0);return}if(!(o.scrollHeight>0)){e.awaitingLayout=!0,To(t,e);return}e.awaitingLayout=!1;const a=o.style.height;o.style.height="0px";const r=o.scrollHeight;if(!(r>0)){o.style.height=a;return}const i=Ns(o),h=i!=null&&r>i;o.style.height=(h?i:r)+"px",Lo(o,e,h),e.lastMeasure=r,e.lastWidth=o.clientWidth,To(t,e)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{o.removeEventListener("input",e.resize)}catch{}Po(e),J.delete(t)})),e.active||(o.addEventListener("input",e.resize),e.active=!0,Ms(t,e));const c=typeof s=="object"&&s.max!=null?String(s.max):null;c!==e.appliedMax&&(c==null?e.appliedMax!=null&&o.style.maxHeight===e.appliedMax&&(o.style.maxHeight=""):o.style.maxHeight=c,e.appliedMax=c),e.resize()}function ht(t,s){const o=t.__ref?.__autoGrow;o&&(s&&(o.attachAttempts=0,o.firstAttemptAt=null),J.add(t),Ct())}function Rs(){const t=Array.from(J);J.clear();for(let s=0;s<t.length;s++){const o=t[s],n=o.node,e=o.__ref?.__autoGrow;if(!(!n||!e||!e.active)){if(!n.isConnected){e.firstAttemptAt==null&&(e.firstAttemptAt=nt()),e.attachAttempts+=1,e.attachAttempts<=so&&nt()-e.firstAttemptAt<eo&&(J.add(o),Ct());continue}e.attachAttempts=0,e.firstAttemptAt=null,e.resize()}}}function To(t,s){if(s.watch)return;const o=t.node;if(!o)return;const n=o.ownerDocument&&o.ownerDocument.defaultView,e=n&&n.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof e!="function")return;const c=()=>{if(!s.active||!o.isConnected||!(o.scrollHeight>0))return;if(s.awaitingLayout){s.awaitingLayout=!1,ht(t,!0);return}const r=o.clientWidth;s.lastWidth!=null&&Math.abs(r-s.lastWidth)<.5||(s.lastWidth=r,ht(t,!0))};let a;try{a=new e(c),a.observe(o)}catch{return}s.watch=a}function Po(t){const s=t.watch;if(s){t.watch=null;try{s.disconnect()}catch{}}}function Ms(t,s){if(s.fontsHooked)return;s.fontsHooked=!0;const o=t.node&&t.node.ownerDocument,n=o&&o.fonts&&o.fonts.ready;!n||typeof n.then!="function"||n.then(()=>{s.active&&t.node&&ht(t,!0)},()=>{})}function Ns(t){const s=t.ownerDocument&&t.ownerDocument.defaultView;let o;try{o=s&&s.getComputedStyle?s.getComputedStyle(t):null}catch{o=null}if(!o)return null;const n=g=>typeof g=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(g)?parseFloat(g):null,e=n(o.maxHeight);if(e==null||!(e>0))return null;const c=(n(o.paddingTop)||0)+(n(o.paddingBottom)||0),a=(n(o.borderTopWidth)||0)+(n(o.borderBottomWidth)||0),r=o.boxSizing==="border-box"?e-a:e+c,i=n(o.lineHeight);if(!(i>0))return r;const h=Math.floor((r-c)/i+1e-6);return h>=1?h*i+c:r}function Lo(t,s,o){o?s.appliedScroll||(t.style.overflowY="auto",s.appliedScroll=!0):s.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),s.appliedScroll=!1)}const Oo=["srcObject","muted"],Fs=(t,s)=>t==="muted"?s===!0||s===""||s==="true"||s==="muted":s??null;function $s(t){const s=t.node,o=t.__ref;if(!(!s||!o))for(let n=0;n<Oo.length;n++){const e=Oo[n],c=t[e];if(c===void 0||!(e in s))continue;const a=r=>{const i=Fs(e,r);if(s[e]!==i)try{s[e]=i}catch(h){M(o,e,h)}};if(typeof c=="function"){const r=R(t,t[e+"Deps"],c),i=(0,k.createEffect)(()=>{try{a(r(t,t.state,t.context))}catch(h){M(o,e,h)}},{depth:o.path.length,label:E(o,e)});o.__effects.push(i),o.__exec[e]=c}else a(c);e==="srcObject"&&(o.__releaseMedia=()=>{try{s.srcObject!=null&&(s.srcObject=null)}catch{}})}}function Do(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const o=t.__ref,n=t.autoGrow,e=typeof n=="function"?R(t,t.autoGrowDeps,n):null,c=(0,k.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}Ds(t,r)},{depth:o.path.length,label:E(o,"autoGrow")});o.__effects||(o.__effects=[]),o.__effects.push(c),e&&(o.__exec.autoGrow=n)}const Ro=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Mo(t,s){for(const o of Object.keys(t)){if(!Y(o)||Ro.has(o))continue;const n=(0,ct.globalEventKeyInfo)(o);if(n){(0,ct.registerGlobalEvent)(n,t,t[o]);continue}let e=t[o];if(typeof e=="string"&&/^[A-Za-z_$][\w$]*$/.test(e)){const a=e;e=function(i){return t.call(a,i)}}if(typeof e!="function")continue;const c=es(o);G.LIFECYCLE_EVENTS.has(c)||(0,ct.registerEvent)(ns(c),t,e)}Is(t)}function Is(t){const s=t.node;if(!s||!s.addEventListener)return;const o={};let n=!1;for(const d of Ro){const p=t[d];typeof p=="function"&&(o[d]=p,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,h=!1;const g=d=>{const p=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];p&&(a=p.clientX,r=p.clientY,i=Date.now(),h=!0)},f=d=>{if(!h)return;h=!1;const p=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!p)return;const u=p.clientX-a,y=p.clientY-r,_=Date.now()-i;if(_>c)return;const l=Math.abs(u),b=Math.abs(y);if(Math.max(l,b)<e)return;let A;if(l>b*1.2)A=u<0?"left":"right";else if(b>l*1.2)A=y<0?"up":"down";else return;const w="onSwipe"+A.charAt(0).toUpperCase()+A.slice(1),x=o[w],C=o.onSwipe;x&&x.call(t,d,t,t.state,t.context),C&&C.call(t,{direction:A,dx:u,dy:y,dt:_,event:d},t,t.state,t.context)};s.addEventListener("touchstart",g,{passive:!0}),s.addEventListener("touchend",f,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",g)}catch{}try{s.removeEventListener("touchend",f)}catch{}})}function yt(t,s){const o={...t};for(const n in s){const e=o[n],c=s[n];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?o[n]=yt(e,c):o[n]=c}return o}function qt(t,s,o,n){if(!s||!t.node)return;const e=t.childExtends;if(Array.isArray(s)){const c=t.tag==="fragment",a=t.context?.document||globalThis.document,r=c?null:a?.createDocumentFragment();if(!c&&!r)return;const i=t.childProps,h=t.childrenAs,g=_=>{let l=s[_];const b=l;(typeof l=="string"||typeof l=="number")&&(l={text:l});let A=i;if(typeof i=="function")try{A=i(t,l)}catch{A=null}if(h==="state"){let x=b;(typeof b=="string"||typeof b=="number")&&(x={value:b,text:b}),l=A?{...A,state:x}:{state:x}}else A&&(l=yt(A,l));if(e&&!l.ignoreChildExtends)if(l.extends){const x=Array.isArray(l.extends)?l.extends:[l.extends],C=Array.isArray(e)?e:[e];l={...l,extends:[...C,...x]}}else l={...l,extends:e};const w=ro(l?.key,b,_);try{return q(l,t,w,o)}catch(x){if(typeof console<"u"&&console.error){const C=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${w}" failed to construct at ${C} (initial render, skipping this row):`,x?.message||x)}return null}},f=t.__ref;if(!(n===!0&&!c&&!!f&&(o?.mountYield===!0||t.yieldChildren===!0))){for(let _=0;_<s.length;_++){const l=g(_);!c&&l?.node&&r.appendChild(l.node)}return c||t.node.appendChild(r),!0}const p=f.__childrenChunkGen=(f.__childrenChunkGen||0)+1;(0,H.openMountBudget)();let u=null;const y=_=>{if(f.__disposed||f.__childrenChunkGen!==p){u&&u.parentNode&&u.remove();return}for(let l=_;l<s.length;l++){const b=g(l);if(b?.node&&(u?t.node.insertBefore(b.node,u):r.appendChild(b.node)),l+1<s.length&&(0,H.mountBudgetExhausted)()){u||(u=a.createComment("smbls-mount"),r.appendChild(u),t.node.appendChild(r));const A=l+1;(0,H.enqueueMountWork)(()=>y(A));return}}u?(u.remove(),t.node.tagName==="SELECT"&&Lt(t,!0)):t.node.appendChild(r)};return y(0),(0,H.closeMountBudget)(),!0}if(typeof s=="string"){const c=io(s,t);if(Array.isArray(c))return qt(t,c,o,n)}if(typeof s=="object")for(const c in s){if(G.REGISTRY.has(c))continue;let a=s[c];if(!(a==null||a===!1)){if((typeof a=="string"||typeof a=="number")&&(a={text:a}),t.childProps&&(a=yt(t.childProps,a)),e&&!a.ignoreChildExtends)if(a.extends){const r=Array.isArray(a.extends)?a.extends:[a.extends],i=Array.isArray(e)?e:[e];a={...a,extends:[...i,...r]}}else a={...a,extends:e};q(a,t,c,o)}}}function Lt(t,s){const o=t.node;if(!o||o.tagName!=="SELECT")return;const n=o.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 g;if(a)try{g=c(t,t.state,t.context)}catch{return}else g=t.value,typeof g=="string"&&g.includes("{{")&&(g=D.replaceLiteralsWithObjectFields.call(t,g,t.state));const f=g==null?"":String(g);o.value!==f&&(o.value=f);return}const i=s||!(e&&e.__selectSynced);if(e&&(e.__selectSynced=!0),!i)return;let h=-1;for(let g=0;g<n.length;g++)n[g].defaultSelected&&(h=g);h>=0&&o.selectedIndex!==h&&(o.selectedIndex=h)}function No(t,s){let{children:o,content:n}=t;const e=t.childExtends;if(typeof o=="function"){const f=o;try{o=f(t,t.state,t.context)}catch(_){if(o=void 0,typeof console<"u"&&console.error){const l=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${l} (initial run, treating as empty):`,_?.message||_)}}t.children=o;const d=t.__ref;let p=!1;const u=R(t,t.childrenDeps,f),y=(0,k.createEffect)(()=>{const _=p;p=!0;let l;try{l=u(t,t.state,t.context)}catch(F){if(typeof console<"u"&&console.error){const O=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${O}${_?"":" (initial tracking run)"}:`,F?.message||F)}return}if(!_||l===t.children)return;t.children=l,d.__childrenChunkGen!=null&&d.__childrenChunkGen++;const b=typeof t.onContentUpdate=="function",A=b?[]:null,w=b?[]:null,x=b?[]:null;if(Array.isArray(l)&&t.childrenAs==="state"){const F=t.childProps,O=[],X=new Map;for(let T=0;T<l.length;T++){const V=l[T];let P=F;if(typeof F=="function")try{P=F(t,V)}catch{P=null}const z=ro(P&&P.key,V,T);O.push(z),X.set(z,{rawChild:V,childProps:P})}const bt=new Set(O),Ho=d.__children.slice();for(const T of Ho)if(!bt.has(T)){const V=t[T];V?.remove&&V.remove(),delete t[T],w&&w.push(T)}const ft=t.childExtends,At=t.tag==="fragment",Vo=t.context?.document||globalThis.document,at=At?null:Vo?.createDocumentFragment(),Rt=new Set;for(const T of O){const V=X.get(T),P=V.rawChild,z=t[T];if(z&&z.state){if(P&&typeof P=="object"){const $=z.state,st=$.$replace||$.replace,Xt=$.$update||$.update;try{if(typeof st=="function")st.call($,P);else if(typeof Xt=="function"){for(const B in $)if(!(B==="__element"||B==="root"||B==="parent"||B==="update")&&!Object.prototype.hasOwnProperty.call(P,B))try{$[B]=void 0}catch{}Xt.call($,P)}else for(const B in P)$[B]=P[B]}catch(B){if(typeof console<"u"&&console.error){const Ko=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to patch at ${Ko} (reconcile, keeping its previous data for this pass):`,B?.message||B)}}}x&&x.push(T);continue}let Mt=P;(typeof P=="string"||typeof P=="number")&&(Mt={value:P,text:P});const Qt=V.childProps;let K=Qt?{...Qt,state:Mt}:{state:Mt};if(ft&&!K.ignoreChildExtends)if(K.extends){const $=Array.isArray(K.extends)?K.extends:[K.extends],st=Array.isArray(ft)?ft:[ft];K={...K,extends:[...st,...$]}}else K={...K,extends:ft};let Nt;try{Nt=q(K,t,T,s)}catch($){if(typeof console<"u"&&console.error){const st=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to construct at ${st} (reconcile, skipping this row):`,$?.message||$)}Rt.add(T);continue}!At&&Nt?.node&&at&&at.appendChild(Nt.node),A&&A.push(T)}if(!At&&at&&at.childNodes.length&&t.node&&t.node.appendChild(at),!At&&t.node){let T=null;for(const V of O){const P=t[V]?.node;if(!P)continue;const z=T?T.nextSibling:t.node.firstChild;P!==z&&t.node.insertBefore(P,z),T=P}}d.__children=Rt.size?O.filter(T=>!Rt.has(T)):O,b&&(A.length||w.length)&&no(t,{added:A,removed:w,kept:x}),Lt(t,!1);return}const U=b?[...d.__children]:null;for(const F of[...d.__children]){const O=t[F];O?.remove&&O.remove(),delete t[F]}d.__children=[],qt(t,l,s),Lt(t,!1),b&&no(t,{added:[...d.__children],removed:U,kept:[]})},{depth:d.path.length,label:E(d,"children")});d.__effects.push(y)}const c=qt(t,o,s,!0);if(n!=null&&!(n&&n.__ref)){let f=n;if(typeof f=="string"||typeof f=="number"?f={text:f}:typeof f!="object"&&(f={}),t.childProps&&(f=yt(t.childProps,f)),e&&!f.ignoreChildExtends)if(f.extends){const d=Array.isArray(f.extends)?f.extends:[f.extends],p=Array.isArray(e)?e:[e];f={...f,extends:[...p,...d]}}else f={...f,extends:e};q(f,t,"content",s)}if(o&&!c)return;const a=t.context?.components||{};{const f=Object.keys(t);for(let d=0;d<f.length;d++){const p=f[d];if(!p.endsWith("Extends")||typeof t[p]!="string")continue;const u=p.slice(0,-7);if(!u||u.charCodeAt(0)<65||u.charCodeAt(0)>90)continue;const y={extends:t[p]};delete t[p];for(let _=d+1;_<f.length;_++){const l=f[_],b=l.charCodeAt(0);if(b>=65&&b<=90||G.REGISTRY.has(l)||typeof t[l]=="function"&&(l.startsWith("on")||l.startsWith(".")))break;const A=t[l];A!==void 0&&(y[l]=A,delete t[l])}t[u]&&typeof t[u]=="object"?t[u]={...y,...t[u]}:t[u]=y}}const r=s?.mountYield===!0||t.yieldChildren===!0,i=Object.keys(t),h=f=>{if(G.REGISTRY.has(f)||typeof t[f]!="object"||t[f]===null)return;const d=f.charCodeAt(0);if(d<65||d>90)return;let p=t[f];if(!p.__ref){if(!p.extends&&!p.extend){const u=a[f]||a[`smbls.${f}`];u&&(p={...p,extends:u})}if(t.childProps&&(p=yt(t.childProps,p)),e&&!p.ignoreChildExtends)if(p.extends){const u=Array.isArray(p.extends)?p.extends:[p.extends],y=Array.isArray(e)?e:[e];p={...p,extends:[...y,...u]}}else p={...p,extends:e};q(p,t,f,s)}};if(!r){for(const f of i)h(f);return}(0,H.openMountBudget)();const g=f=>{for(let d=f;d<i.length;d++)if(h(i[d]),d+1<i.length&&(0,H.mountBudgetExhausted)()){const p=d+1;(0,H.enqueueMountWork)(()=>g(p));return}};g(0),(0,H.closeMountBudget)()}function Fo(t,s,o){const{node:n}=t;if(!n)return;n.ref=t;const e=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(e){const a=e.parentNode;if(a){if(o?.position==="before"&&o.node)a.insertBefore(n,o.node);else if(o?.position==="after"&&o.node){const r=o.node.nextSibling;a.insertBefore(n,r||e)}else a.insertBefore(n,e);return}}const c=s?.node||(s?.nodeType?s:null);if(c)if(o?.position==="before"&&o.node)c.insertBefore(n,o.node);else if(o?.position==="after"&&o.node){const a=o.node.nextSibling;a?c.insertBefore(n,a):c.appendChild(n)}else c.appendChild(n)}const Dt=3;function Go(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Dt?!1:(t.__inBeforeUpdate=!0,!0)}function gt(t,s){t&&(t.__inBeforeUpdate=!1,s?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Dt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Dt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function I(t,s,o){const n=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&(0,W.runPluginHook)(n,s,o);const e="on"+t,c=s[e];if(typeof c=="function"){const i=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(i){if(s.__ref[i])return!0;s.__ref[i]=!0}const h=s.context?.designSystem;h&&(0,j.pushConfig)(h);let g=!!i;try{const f=c(s,s.state,s.context,o);if(f&&typeof f.then=="function"){const d=s.__ref;return f.catch(p=>{s.context?.plugins?.length&&(0,W.runPluginHook)("error",s,{hook:e,error:p})||console.error(`[DOMQL] Lifecycle "${e}" error:`,p)}).finally(()=>{i&&d&&(d[i]=!1)}),g=!1,!0}if(f===!1)return!1}catch(f){if(s.context?.plugins?.length&&(0,W.runPluginHook)("error",s,{hook:e,error:f})||console.error(`[DOMQL] Lifecycle "${e}" error:`,f),s.context?.strictMode)throw f}finally{h&&(0,j.popConfig)(),g&&s.__ref&&(s.__ref[i]=!1)}}return!0}var Us=q;
@@ -1 +1 @@
1
- "use strict";var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var d=(r,o)=>{for(var t in o)n(r,t,{get:o[t],enumerable:!0})},p=(r,o,t,_)=>{if(o&&typeof o=="object"||typeof o=="function")for(let f of c(o))!a.call(r,f)&&f!==t&&n(r,f,{get:()=>o[f],enumerable:!(_=s(o,f))||_.enumerable});return r};var h=r=>p(n({},"__esModule",{value:!0}),r);var v={};d(v,{dispose:()=>i,remove:()=>u});module.exports=h(v);function i(r){if(!r)return;const o=r.__ref;if(!o)return;o.__disposed=!0;try{typeof r.onBeforeRemove=="function"&&r.onBeforeRemove(r,r.state,r.context)}catch(_){console.error("[smbls] onBeforeRemove error:",_)}if(o.__effects){for(let _=0;_<o.__effects.length;_++)o.__effects[_].dispose();o.__effects.length=0}if(o.__eventCleanup){for(let _=0;_<o.__eventCleanup.length;_++)o.__eventCleanup[_]();o.__eventCleanup.length=0}if(o.__children){const _=o.__children.slice();o.__children.length=0;for(let f=0;f<_.length;f++){const e=r[_[f]];e&&e.__ref&&i(e)}}r.node?.parentNode?r.node.remove():r.tag==="fragment"&&o.__fragmentAnchor?.parentNode&&o.__fragmentAnchor.remove();const t=r.state?.$destroy||r.state?.destroy;if(typeof t=="function"&&r.state.__element===r&&t.call(r.state),r.parent?.__ref?.__children){const _=r.parent.__ref.__children.indexOf(r.key);_!==-1&&r.parent.__ref.__children.splice(_,1),delete r.parent[r.key]}try{typeof r.onRemove=="function"&&r.onRemove(r)}catch(_){console.error("[smbls] onRemove error:",_)}r.node=null,r.parent=null,r.__ref=null}function u(){i(this)}
1
+ "use strict";var c=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var l=(r,o)=>{for(var _ in o)c(r,_,{get:o[_],enumerable:!0})},u=(r,o,_,f)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of d(o))!p.call(r,e)&&e!==_&&c(r,e,{get:()=>o[e],enumerable:!(f=a(o,e))||f.enumerable});return r};var h=r=>u(c({},"__esModule",{value:!0}),r);var y={};l(y,{dispose:()=>i,remove:()=>v});module.exports=h(y);var t=require("@symbo.ls/signal");function i(r){if(!r)return;const o=r.__ref;if(!o)return;const _=(0,t.getObserver)();if(_){(0,t.setObserver)(null);try{return i(r)}finally{(0,t.setObserver)(_)}}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.__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 n=0;n<e.length;n++){const s=r[e[n]];s&&s.__ref&&i(s)}}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 v(){i(this)}
@@ -1 +1 @@
1
- "use strict";var r=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var a in e)r(t,a,{get:e[a],enumerable:!0})},p=(t,e,a,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of d(e))!c.call(t,o)&&o!==a&&r(t,o,{get:()=>e[o],enumerable:!(n=s(e,o))||n.enumerable});return t};var u=t=>p(r({},"__esModule",{value:!0}),t);var x={};l(x,{DELEGATED_EVENTS:()=>E,LIFECYCLE_EVENTS:()=>h,MIXINS:()=>m,NON_BUBBLING_EVENTS:()=>v,PASSIVE_EVENTS:()=>g,REGISTRY:()=>i});module.exports=u(x);const i=new Set(["extends","children","content","childrenAs","childExtends","childExtendsRecursive","childProps","inheritParentProps","state","if","define","deps","tag","attr","style","text","html","value","data","classlist","class","scope","root","context","$router","routes","fetch","variables","query","key","component","preventContentUpdate","preventContentRecreate","subscribeTo","autoGrow","allowRuntimeTemplates","__name","__ref","__hash","__text","parent","node"]),m={text:"text",html:"html",style:"style",attr:"attr",data:"data",classlist:"classlist",state:"state",scope:"scope"},h=new Set(["start","init","complete","attachNode","stateInit","stateCreated","beforeUpdate","update","afterUpdate","beforeClassAssign","lazyLoad","render","renderRouter","done","create","frame","mounted","contentUpdate","startUpdate","stateUpdate","beforeStateUpdate","initInspect","initSync","beforeRemove","remove"]),v=new Set(["load","error","abort","scroll","canplay","canplaythrough","ended","pause","play","playing","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","durationchange","loadeddata","loadedmetadata","progress","emptied","resize"]),g=new Set(["wheel","mousewheel","touchstart","touchmove","touchend","touchcancel"]),E=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout","touchstart","touchend","touchmove","keydown","keyup","keypress","input","change","submit","reset","focus","blur","focusin","focusout","wheel","contextmenu","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]);
1
+ "use strict";var r=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var a in e)r(t,a,{get:e[a],enumerable:!0})},p=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of c(e))!d.call(t,o)&&o!==a&&r(t,o,{get:()=>e[o],enumerable:!(s=n(e,o))||s.enumerable});return t};var u=t=>p(r({},"__esModule",{value:!0}),t);var x={};l(x,{DELEGATED_EVENTS:()=>E,LIFECYCLE_EVENTS:()=>h,MIXINS:()=>m,NON_BUBBLING_EVENTS:()=>v,PASSIVE_EVENTS:()=>g,REGISTRY:()=>i});module.exports=u(x);const i=new Set(["extends","children","content","childrenAs","childExtends","childExtendsRecursive","childProps","inheritParentProps","state","if","define","deps","tag","attr","style","text","html","value","data","classlist","class","scope","root","context","$router","routes","fetch","variables","query","key","component","preventContentUpdate","preventContentRecreate","subscribeTo","autoGrow","srcObject","allowRuntimeTemplates","__name","__ref","__hash","__text","parent","node"]),m={text:"text",html:"html",style:"style",attr:"attr",data:"data",classlist:"classlist",state:"state",scope:"scope"},h=new Set(["start","init","complete","attachNode","stateInit","stateCreated","beforeUpdate","update","afterUpdate","beforeClassAssign","lazyLoad","render","renderRouter","done","create","frame","mounted","contentUpdate","startUpdate","stateUpdate","beforeStateUpdate","initInspect","initSync","beforeRemove","remove"]),v=new Set(["load","error","abort","scroll","canplay","canplaythrough","ended","pause","play","playing","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","durationchange","loadeddata","loadedmetadata","progress","emptied","resize"]),g=new Set(["wheel","mousewheel","touchstart","touchmove","touchend","touchcancel"]),E=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout","touchstart","touchend","touchmove","keydown","keyup","keypress","input","change","submit","reset","focus","blur","focusin","focusout","wheel","contextmenu","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]);
@@ -1 +1 @@
1
- var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var E=(t,o)=>{for(var e in o)n(t,e,{get:o[e],enumerable:!0})},I=(t,o,e,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of s(o))!x.call(t,c)&&c!==e&&n(t,c,{get:()=>o[c],enumerable:!(p=r(o,c))||p.enumerable});return t};var N=t=>I(n({},"__esModule",{value:!0}),t);var R={};E(R,{VERSION:()=>O});module.exports=N(R);const O="3.14.794";
1
+ var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var E=(t,o)=>{for(var e in o)n(t,e,{get:o[e],enumerable:!0})},I=(t,o,e,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of s(o))!x.call(t,c)&&c!==e&&n(t,c,{get:()=>o[c],enumerable:!(p=r(o,c))||p.enumerable});return t};var N=t=>I(n({},"__esModule",{value:!0}),t);var R={};E(R,{VERSION:()=>O});module.exports=N(R);const O="3.14.795";
@@ -1,6 +1,6 @@
1
- import{createStore as Mt,createScopeStore as Xo,isStore as q}from"@symbo.ls/signal";import{createEffect as v}from"@symbo.ls/signal";import{cacheNode as Ft,detectTag as oo}from"./cache.js";import{REGISTRY as W,LIFECYCLE_EVENTS as Jo}from"./registry.js";import{registerEvent as mo,registerGlobalEvent as ts,globalEventKeyInfo as os}from"./delegate.js";import{applyExtends as ss}from"./extends.js";import{addMethods as es}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as tt}from"./devRuntime.js";import{mountBudgetExhausted as so,openMountBudget as eo,closeMountBudget as no,enqueueMountWork as ro}from"./mountScheduler.js";import{replaceLiteralsWithObjectFields as $,isPolyglotWritableKey as ns,markPolyglotSeeded as rs}from"@symbo.ls/utils";import*as xt from"@symbo.ls/utils";import{runPluginHook as z}from"@symbo.ls/utils/function.js";import{applyStateMethods as it}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as D,DEFAULT_CSS_PROPERTIES_LIST as R,pushStaticCssPass as io,popStaticCssPass as co}from"css-in-props";import{css as ct,wrapHoverRule as fo}from"@symbo.ls/css";import{pushConfig as N,popConfig as M}from"@symbo.ls/scratch";import{checkAttributeByTagName as ft,applyAttrTransforms as is,ATTR_TRANSFORMS as $t,camelToAttr as at,serializeAttrValue as K,isEnumeratedTrueFalseAttr as ut}from"attrs-in-props";import{resolveElementIdEngine as cs}from"./engineRegistry.js";import{CSS_LONGHAND_SHORTHANDS as ao}from"./cssLonghands.js";import{isAttributeFirst as uo,isCssProp as lt}from"./attributeFirst.js";import{VERSION as fs}from"./version.js";const lo=cs({uniqId:1,scopedStyleId:0},fs),dt=[],Q=new Set;let It=!1,po=0,ot=null,pt=null;function st(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function ho(){return typeof document<"u"&&document.visibilityState==="hidden"}const as=250,us=1e3;function ls(){return pt&&(pt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||ho())?!0:st()-po>=us}function ds(){if(It=!0,po=st(),pt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Ut,0);ot=t?()=>t(s):null;return}if(ho()){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Ut,as);ot=t?()=>t(s):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;pt=requestAnimationFrame;const s=requestAnimationFrame(Ut);ot=t?()=>t(s):null}}function wt(){if(It){if(!ls())return;const t=ot;if(ot=null,t)try{t()}catch{}}ds()}const yo=300,_o=15e4;function Ut(){if(It=!1,ot=null,pt=null,Q.size&&Bs(),!dt.length)return;const t=dt.splice(0,dt.length);for(let s=0;s<t.length;s++){const o=t[s];if(o.node){if(!o.node.isConnected){const e=o.__ref||(o.__ref={});e.__mountAttempts=(e.__mountAttempts||0)+1,e.__mountFirstAttemptAt==null&&(e.__mountFirstAttemptAt=st());const n=st()-e.__mountFirstAttemptAt;e.__mountAttempts<=yo&&n<_o?(dt.push(o),wt()):console.warn("[DOMQL] onMounted dropped after",e.__mountAttempts,"attempts /",n,"ms \u2014 node never connected:",o.key||o.tag||o);continue}F("Mounted",o,o.__ref?.__mountOptions||{})}}}function Bt(t,s){const o=t.__ref?.__autoGrow;o&&o.active&&_t(t,!0),typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,dt.push(t),wt())}function go(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&z("contentUpdate",t,s);const o=t.context?.designSystem;o&&N(o);try{t.onContentUpdate(t,t.state,t.context,s)}catch(e){if(t.context?.plugins?.length&&z("error",t,{hook:"onContentUpdate",error:e})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',e),t.context?.strictMode)throw e}finally{o&&M()}}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function ps(t){return t.charAt(2).toLowerCase()+t.slice(3)}function hs(t){return t.toLowerCase()}function Gt(t){const s=t.charCodeAt(0);return s===58||s===64||s===38||s===91}function ht(t,s){const o={...t};for(const e in s){const n=o[e],c=s[e];n&&c&&typeof n=="object"&&typeof c=="object"&&!Array.isArray(n)&&!Array.isArray(c)&&typeof n!="function"&&typeof c!="function"?o[e]=ht(n,c):o[e]=c}return o}function Ct(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function bo(t,s,o){return Ct(t)||(s&&typeof s=="object"?Ct(s.key):void 0)||String(o)}function X(t,s,o,e={},n){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t}),o=Ct(o);const c=Ct(t.key),r=Object.create(null);r.key=o||c||`_${lo.uniqId++}`,r.parent=s||null,r.context=t.context||s?.context||e.context||{},r.context.__create||(r.context.__create=X);const d=r.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||r,path:s?.__ref?.path?[...s.__ref.path,r.key]:[r.key],origin:t};if(o&&!t.extends&&!t.extend){const u=o.indexOf("_"),l=o.indexOf(".");let b=u>0?u:-1;if(l>0&&(b<0||l<b)&&(b=l),b>0){const A=o.substring(0,b),C=r.context?.components;C&&(C[A]||C["smbls."+A])?t={...t,extends:A}:C&&tt()&&(/^[A-Z]\w*_\d+$/.test(o)||/^[A-Z]\w*\.\w+$/.test(o))&&console.warn(`[smbls] auto-extend: key "${o}" looks like an instance of "${A}" but neither "${A}" nor "smbls.${A}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}ss(r,t,e);const i=new Set(["childProps","attr","style","scope","data"]),_=r.props&&typeof r.props=="object"?r.props:null;for(const u in t){if(u==="parent"||u==="node"||u==="__ref"||u==="extends"||u==="context"||u==="props")continue;if(u==="key"){c&&(r.key=c);continue}const l=t[u],b=r[u],A=b&&l&&typeof b=="object"&&typeof l=="object"&&!Array.isArray(b)&&!Array.isArray(l)&&typeof b!="function"&&typeof l!="function";A&&u.charCodeAt(0)>=65&&u.charCodeAt(0)<=90?r[u]=ht(b,l):A&&i.has(u)?r[u]={...b,...l}:A&&Gt(u)?r[u]=ht(b,l):r[u]=l}function g(u){for(const l in u){const b=u[l],A=r[l],C=A&&b&&typeof A=="object"&&typeof b=="object"&&!Array.isArray(A)&&!Array.isArray(b)&&typeof A!="function"&&typeof b!="function";C&&l.charCodeAt(0)>=65&&l.charCodeAt(0)<=90?r[l]=ht(A,b):C&&i.has(l)?r[l]={...A,...b}:C&&Gt(l)?r[l]=ht(A,b):r[l]=b}}_&&g(_),t.props&&typeof t.props=="object"&&g(t.props),t.classlist!==void 0&&(r.classlist=t.classlist),t.text!==void 0&&(r.text=t.text),t.html!==void 0&&(r.html=t.html);const f=r.scope&&typeof r.scope=="object"?r.scope:null,p=s?.scope,y=r.context&&typeof r.context.globalScope=="object"&&r.context.globalScope||null,a=p||y||null;if(t.scope!==void 0||f){const u={};f&&Object.assign(u,f),t.scope!==void 0&&Object.assign(u,t.scope),r.scope=Xo(u,a)}else a&&(r.scope=a);if(t.if!==void 0&&(r.if=t.if),es(r),ys(r,s,t),r.if!=null){let u;if(typeof r.if=="function")try{u=r.if(r,r.state,r.context)}catch(l){if(u=!1,d.__ifError=l,typeof console<"u"&&console.warn){const b=r.key||r.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${b} \u2014 treating as false:`,l?.message||l)}}else u=r.if;d.__if=!!u}if(d.__if)typeof r.if=="function"&&(d.__ifInitialized=!0);else return s&&(s[r.key]=r),typeof r.if=="function"&&ko(r,d,r.if),r;r.tag||(r.tag=oo(r)),F("Init",r,e);const h=r.node=Ft(r);if(!h)return r;if(r.tag==="fragment"){const l=(r.context?.document||globalThis.document).createComment("");h.appendChild(l),d.__fragmentAnchor=l}F("AttachNode",r,e),h.setAttribute&&r.key&&h.setAttribute("data-key",r.key),s&&(s[r.key]=r,s.__ref?.__children&&(s.__ref.__children.includes(r.key)||s.__ref.__children.push(r.key))),h.setAttribute&&r.context?.scopeSelector&&r.context.scopeSelector!==":root"&&r.context.key&&r.key===r.context.key&&h.setAttribute("data-smbls-app",r.context.key),r.id&&h.setAttribute&&(h.id=r.id),Wo(r,e),So(r),Kt(r),Uo(r),Ko(r);try{zo(r,e)}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(`
1
+ import{createStore as Nt,createScopeStore as mo,isStore as q}from"@symbo.ls/signal";import{createEffect as v,getObserver as ts,setObserver as oo}from"@symbo.ls/signal";import{cacheNode as Ft,detectTag as so}from"./cache.js";import{REGISTRY as W,LIFECYCLE_EVENTS as os}from"./registry.js";import{registerEvent as ss,registerGlobalEvent as es,globalEventKeyInfo as ns}from"./delegate.js";import{applyExtends as rs}from"./extends.js";import{addMethods as is}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as tt}from"./devRuntime.js";import{mountBudgetExhausted as eo,openMountBudget as no,closeMountBudget as ro,enqueueMountWork as io}from"./mountScheduler.js";import{replaceLiteralsWithObjectFields as I,isPolyglotWritableKey as cs,markPolyglotSeeded as fs}from"@symbo.ls/utils";import*as xt from"@symbo.ls/utils";import{runPluginHook as z}from"@symbo.ls/utils/function.js";import{applyStateMethods as it}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as R,DEFAULT_CSS_PROPERTIES_LIST as M,pushStaticCssPass as co,popStaticCssPass as fo}from"css-in-props";import{css as ct,wrapHoverRule as ao}from"@symbo.ls/css";import{pushConfig as N,popConfig as F}from"@symbo.ls/scratch";import{checkAttributeByTagName as ft,applyAttrTransforms as as,ATTR_TRANSFORMS as $t,camelToAttr as at,serializeAttrValue as V,isEnumeratedTrueFalseAttr as ut}from"attrs-in-props";import{resolveElementIdEngine as us}from"./engineRegistry.js";import{CSS_LONGHAND_SHORTHANDS as uo}from"./cssLonghands.js";import{isAttributeFirst as lo,isCssProp as lt}from"./attributeFirst.js";import{VERSION as ls}from"./version.js";const po=us({uniqId:1,scopedStyleId:0},ls),dt=[],X=new Set;let It=!1,ho=0,ot=null,pt=null;function st(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function yo(){return typeof document<"u"&&document.visibilityState==="hidden"}const ds=250,ps=1e3;function hs(){return pt&&(pt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||yo())?!0:st()-ho>=ps}function ys(){if(It=!0,ho=st(),pt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Ut,0);ot=t?()=>t(s):null;return}if(yo()){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Ut,ds);ot=t?()=>t(s):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;pt=requestAnimationFrame;const s=requestAnimationFrame(Ut);ot=t?()=>t(s):null}}function wt(){if(It){if(!hs())return;const t=ot;if(ot=null,t)try{t()}catch{}}ys()}const _o=300,go=15e4;function Ut(){if(It=!1,ot=null,pt=null,X.size&&Vs(),!dt.length)return;const t=dt.splice(0,dt.length);for(let s=0;s<t.length;s++){const o=t[s];if(o.node){if(!o.node.isConnected){const n=o.__ref||(o.__ref={});n.__mountAttempts=(n.__mountAttempts||0)+1,n.__mountFirstAttemptAt==null&&(n.__mountFirstAttemptAt=st());const e=st()-n.__mountFirstAttemptAt;n.__mountAttempts<=_o&&e<go?(dt.push(o),wt()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",e,"ms \u2014 node never connected:",o.key||o.tag||o);continue}$("Mounted",o,o.__ref?.__mountOptions||{})}}}function Bt(t,s){const o=t.__ref?.__autoGrow;o&&o.active&&_t(t,!0),typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,dt.push(t),wt())}function bo(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&z("contentUpdate",t,s);const o=t.context?.designSystem;o&&N(o);try{t.onContentUpdate(t,t.state,t.context,s)}catch(n){if(t.context?.plugins?.length&&z("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{o&&F()}}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function _s(t){return t.charAt(2).toLowerCase()+t.slice(3)}function gs(t){return t.toLowerCase()}function Gt(t){const s=t.charCodeAt(0);return s===58||s===64||s===38||s===91}function ht(t,s){const o={...t};for(const n in s){const e=o[n],c=s[n];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?o[n]=ht(e,c):o[n]=c}return o}function Ct(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Ao(t,s,o){return Ct(t)||(s&&typeof s=="object"?Ct(s.key):void 0)||String(o)}function Z(t,s,o,n={},e){const c=ts();if(c){oo(null);try{return Z(t,s,o,n,e)}finally{oo(c)}}if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t}),o=Ct(o);const a=Ct(t.key),r=Object.create(null);r.key=o||a||`_${po.uniqId++}`,r.parent=s||null,r.context=t.context||s?.context||n.context||{},r.context.__create||(r.context.__create=Z);const i=r.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||r,path:s?.__ref?.path?[...s.__ref.path,r.key]:[r.key],origin:t};if(o&&!t.extends&&!t.extend){const l=o.indexOf("_"),b=o.indexOf(".");let A=l>0?l:-1;if(b>0&&(A<0||b<A)&&(A=b),A>0){const w=o.substring(0,A),x=r.context?.components;x&&(x[w]||x["smbls."+w])?t={...t,extends:w}:x&&tt()&&(/^[A-Z]\w*_\d+$/.test(o)||/^[A-Z]\w*\.\w+$/.test(o))&&console.warn(`[smbls] auto-extend: key "${o}" 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.`)}}rs(r,t,n);const h=new Set(["childProps","attr","style","scope","data"]),g=r.props&&typeof r.props=="object"?r.props:null;for(const l in t){if(l==="parent"||l==="node"||l==="__ref"||l==="extends"||l==="context"||l==="props")continue;if(l==="key"){a&&(r.key=a);continue}const b=t[l],A=r[l],w=A&&b&&typeof A=="object"&&typeof b=="object"&&!Array.isArray(A)&&!Array.isArray(b)&&typeof A!="function"&&typeof b!="function";w&&l.charCodeAt(0)>=65&&l.charCodeAt(0)<=90?r[l]=ht(A,b):w&&h.has(l)?r[l]={...A,...b}:w&&Gt(l)?r[l]=ht(A,b):r[l]=b}function f(l){for(const b in l){const A=l[b],w=r[b],x=w&&A&&typeof w=="object"&&typeof A=="object"&&!Array.isArray(w)&&!Array.isArray(A)&&typeof w!="function"&&typeof A!="function";x&&b.charCodeAt(0)>=65&&b.charCodeAt(0)<=90?r[b]=ht(w,A):x&&h.has(b)?r[b]={...w,...A}:x&&Gt(b)?r[b]=ht(w,A):r[b]=A}}g&&f(g),t.props&&typeof t.props=="object"&&f(t.props),t.classlist!==void 0&&(r.classlist=t.classlist),t.text!==void 0&&(r.text=t.text),t.html!==void 0&&(r.html=t.html);const d=r.scope&&typeof r.scope=="object"?r.scope:null,p=s?.scope,u=r.context&&typeof r.context.globalScope=="object"&&r.context.globalScope||null,y=p||u||null;if(t.scope!==void 0||d){const l={};d&&Object.assign(l,d),t.scope!==void 0&&Object.assign(l,t.scope),r.scope=mo(l,y)}else y&&(r.scope=y);if(t.if!==void 0&&(r.if=t.if),is(r),bs(r,s,t),r.if!=null){let l;if(typeof r.if=="function")try{l=r.if(r,r.state,r.context)}catch(b){if(l=!1,i.__ifError=b,typeof console<"u"&&console.warn){const A=r.key||r.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${A} \u2014 treating as false:`,b?.message||b)}}else l=r.if;i.__if=!!l}if(i.__if)typeof r.if=="function"&&(i.__ifInitialized=!0);else return s&&(s[r.key]=r),typeof r.if=="function"&&jo(r,i,r.if),r;r.tag||(r.tag=so(r)),$("Init",r,n);const _=r.node=Ft(r);if(!_)return r;if(r.tag==="fragment"){const b=(r.context?.document||globalThis.document).createComment("");_.appendChild(b),i.__fragmentAnchor=b}$("AttachNode",r,n),_.setAttribute&&r.key&&_.setAttribute("data-key",r.key),s&&(s[r.key]=r,s.__ref?.__children&&(s.__ref.__children.includes(r.key)||s.__ref.__children.push(r.key))),_.setAttribute&&r.context?.scopeSelector&&r.context.scopeSelector!==":root"&&r.context.key&&r.key===r.context.key&&_.setAttribute("data-smbls-app",r.context.key),r.id&&_.setAttribute&&(_.id=r.id),Yo(r,n),vo(r),Vt(r),Bo(r),Wo(r),Ys(r);try{qo(r,n)}catch(l){if(typeof console<"u"&&console.error){const b=r.__ref?.path?.join(".")||r.key||"<root>";console.error(`[smbls] createChildren failed at ${b}:`,l?.message||l,l?.stack?`
2
+ `+l.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(Lt(r,!0),Yo(r,s,n),typeof r.html=="function"&&r.node&&!r.node.innerHTML){const u=r.context?.designSystem;u&&N(u);try{const l=r.html(r,r.state,r.context);l!=null&&typeof l!="function"&&(r.node.innerHTML=l)}catch{}finally{u&&M()}}if(F("Create",r,e),F("Complete",r,e),F("Render",r,e),F("RenderRouter",r,e),Bt(r,e),typeof r.onFrame=="function"){const u=r.onFrame,l=r.context?.designSystem,b=()=>{if(r.node){if(r.node.isConnected){l&&N(l);try{u(r,r.state,r.context)}catch(A){console.error("[DOMQL] onFrame error:",A)}finally{l&&M()}}requestAnimationFrame(b)}};requestAnimationFrame(b)}return r}function ys(t,s,o){const e=!s,n=o.state&&typeof o.state=="object"&&!Array.isArray(o.state)&&Object.keys(o.state).length===0,c=e&&n&&t.context?.state,r=o.state!==void 0&&!c?o.state:t.state&&!q(t.state)?t.state:void 0;if(r==null){if(s?.state)t.state=s.state,it(t,t.state);else if(t.context?.state){const d=t.context.state,i={...d},_=t.context?.polyglot;if(_?.translations){const g=t.context,f=d.lang||_.defaultLang||"en",p=new Set,y=(u,l)=>{p.has(u)||ns(g,u,i)&&(i[u]=l,p.add(u),rs(g,u,l))},a=_.translations[f];if(a&&typeof a=="object")for(const u in a)y(u,a[u]);const h=new Set(_.languages||[]);for(const u in _.translations)h.has(u)||y(u,_.translations[u])}t.state=q(i)?i:Mt(i),t.state.__element=t,t.state.root=t.state,it(t,t.state),xt.promoteActiveRootState?.(d,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),it(t,t.state);return}if(typeof r=="string"){if(t.state=Ao(r,s),t.state&&typeof t.state=="object"&&!q(t.state)){const d=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:d,enumerable:!1,configurable:!0,writable:!0})}it(t,t.state);return}if(typeof r=="function"){const d=r(t,s?.state);t.state=q(d)?d:Mt(d||{})}else q(r)?t.state=r:t.state=Mt({...r});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,it(t,t.state),xt.promoteActiveRootState?.(r,t.state)}function Ht(t,s){if(!s)return t;const o=s.split("/");let e=t;for(const n of o){if(e==null)return{};e=e[n]}return e??{}}function Ao(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const n=t.slice(3);return n?Ht(s.state,n):s.state??{}}if(t.startsWith("~/")){const n=s.state?.root||s.state,c=t.slice(2);return c?Ht(n,c):n??{}}if(s.state?.[t]!==void 0)return s.state[t];const o=Ht(s.state,t);if(o!=null&&Object.keys(o).length>0)return o;const e=s.context?.polyglot;if(e?.translations){const n=s.state?.root?.lang||e.defaultLang||"en",c=e.translations[n];if(c?.[t]!==void 0)return c[t];if(e.translations[t]!==void 0)return e.translations[t]}return{}}const _s=new Set(["s","state","ctx","context"]);function gs(t){try{const o=(typeof xt.getFunctionSource=="function"?xt.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return o?o[1].split(",").map(e=>e.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function bs(t){if(typeof t!="function"||t.length!==2)return!1;const s=gs(t);if(s.length<2)return!1;const o=s[1].replace(/[{}[\]]/g,"").trim();return o.length>0&&!_s.has(o)}function As(t){const s=t.__ref,o=t.tag||"div",e=t.context?.designSystem,n=[],c=Object.keys(t);for(let r=0;r<c.length;r++){const d=c[r];if(typeof t[d]!="function"||W.has(d))continue;const i=d.charCodeAt(0);i>=65&&i<=90||Y(d)||D[d]||R&&R.has(d)||ft(o,d)||(tt()&&bs(t[d])&&console.warn(`[smbls] custom prop "${d}"${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('${d}', \u2026) instead of reading el.${d}(\u2026) directly (see RULES.md Rule 8).`),n.push({prop:d,fn:t[d]}))}for(let r=0;r<n.length;r++){const{prop:d,fn:i}=n[r];s.__exec[d]=i,Object.defineProperty(t,d,{get(){e&&N(e);try{return i(t,t.state,t.context)}catch{return}finally{e&&M()}},set(_){delete s.__exec[d],Object.defineProperty(t,d,{value:_,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function xs(t,s){if(!(!Array.isArray(s)||s.length===0))for(let o=0;o<s.length;o++){const e=s[o];try{typeof e=="function"?e(t,t.state,t.context):typeof e=="string"&&t.state?.[e]}catch{}}}function P(t,s,o){return!Array.isArray(s)||s.length===0?o:function(...e){return xs(t,s),o.apply(this,e)}}function yt(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function S(t,s){return()=>t.path.join(".")+"::"+s}const xo=new Set;function I(t,s,o){if(!tt())return;const e=S(t,s)();xo.has(e)||(xo.add(e),console.warn(`[smbls] "${s}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,o?.message||o))}const wo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,ws=(t,s)=>{let o;try{o=String(t)}catch{return}if(!o.includes("{{"))return;wo.lastIndex=0;let e;for(;(e=wo.exec(o))!==null;)e[2].includes("{{")&&s.add(e[2])},Cs=(t,s)=>!Y(t)&&!lt(s,t),Co=(t,s,o,e)=>{if(typeof s=="string"){s.includes("{{")&&o.add(s);return}typeof s=="function"&&Cs(t,e)&&ws(s,o)},Ss=["attr","aria","data"],vs=t=>{if(Ss.includes(t))return!0;const s=t.charCodeAt(0);return s===46||s===33||s===64},ks=t=>{const s=new Set,o=t.tag||"div";for(const e of Object.keys(t)){const n=Object.getOwnPropertyDescriptor(t,e),c=n&&n.value;if(c&&typeof c=="object"&&!Array.isArray(c)){if(!vs(e))continue;for(const r in c)Co(r,c[r],s,o);continue}Co(e,c,s,o)}return s};function So(t,s){const o=t.__ref,e=!!(s&&s.skipIfEffect),n=ks(t);if(o.__authoredTemplates)for(const i of n)o.__authoredTemplates.add(i);else o.__authoredTemplates=n;if(As(t),typeof t.text=="function"){const i=t.text,_=P(t,t.textDeps,i),g=v(()=>{if(!o.contentManaged)try{let f=_(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&typeof f!="object"&&(typeof f=="string"&&f.includes("{{")&&(f=$.call(t,f,t.state)),St(t,f))}catch(f){I(o,"text",f)}},{depth:o.path.length,label:S(o,"text")});o.__effects.push(g),o.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,_=v(()=>{if(o.contentManaged)return;const g=$.call(t,i,t.state);g!=null&&(t.text=g),t.node&&St(t,g??"")},{depth:o.path.length,label:S(o,"text")});o.__effects.push(_),o.__exec.text=i}const c=t.tag||"div";for(const i of Object.keys(t))if(typeof t[i]=="function"&&!W.has(i)&&!Y(i)&&!o.__exec[i]&&!uo(c,i)){if(D[i]){const _=t[i],g=P(t,t[i+"Deps"],_),f=i;let p,y=null,a=null,h;const u=v(()=>{const l=t.context?.designSystem;l&&N(l);try{const b=g(t,t.state,t.context);io();let A;try{A=D[f](b,t,t.state,t.context)}finally{co()}if(Array.isArray(A)){const w={};for(const x of A)if(x)for(const E in x)w[E]=x[E];A=w}const C=f==="show"||f==="hide";if(A&&t.node&&js(A)){const w=vt(A);if(w===null||w!==h){h=w;const x=ct(A,null,t.context?.cssPrefix),E=x?x.split(" ").filter(Boolean):null;if(t.node.classList){if(a)for(const U of a)t.node.classList.remove(U);if(E&&E.length)for(const U of E)t.node.classList.add(U);a=E}}p=void 0,y=null}else if(A&&t.node){if(a){for(const x of a)t.node.classList.remove(x);a=null,h=void 0}const w=vt(A);if(w===null||w!==p||!Et(t.node,y)){p=w;const x=Po(t,A);y=kt(t.node,x)}}else t.node&&C&&(p=void 0,y=null,t.node.style.display="")}finally{l&&M()}},{depth:o.path.length,label:S(o,f)});o.__effects.push(u),o.__exec[i]=_}else if(R&&R.has(i)){const _=t[i],g=P(t,t[i+"Deps"],_),f=i;let p,y=null;const a=v(()=>{const h=t.context?.designSystem;h&&N(h);try{const u=g(t,t.state,t.context);if(t.node)if(u!=null){const l=f+":"+String(u);if(l!==p||!Et(t.node,y)){p=l;const b={[f]:u},A=Po(t,b);y=kt(t.node,A)}}else p=void 0,y=null,t.node.style[f]=""}finally{h&&M()}},{depth:o.path.length,label:S(o,f)});o.__effects.push(a),o.__exec[i]=_}}if(typeof t.html=="function"){const i=t.html,_=P(t,t.htmlDeps,i),g=v(()=>{const f=t.context?.designSystem;f&&N(f);try{const p=_(t,t.state,t.context);t.node&&p!=null&&typeof p!="function"&&(t.node.innerHTML=p)}finally{f&&M()}},{depth:o.path.length,label:S(o,"html")});o.__effects.push(g),o.__exec.html=i}if(typeof t.value=="function"){const i=t.value,_=P(t,t.valueDeps,i),g=v(()=>{try{let f=_(t,t.state,t.context);typeof f=="string"&&f.includes("{{")&&(f=$.call(t,f,t.state)),jo(t,f)}catch(f){I(o,"value",f)}},{depth:o.path.length,label:S(o,"value")});o.__effects.push(g),o.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,_=v(()=>{try{jo(t,$.call(t,i,t.state))}catch(g){I(o,"value",g)}},{depth:o.path.length,label:S(o,"value")});o.__effects.push(_),o.__exec.value=i}if(typeof t.style=="function"){const i=t.style,_=P(t,t.styleDeps,i);let g,f=null;const p=v(()=>{const y=_(t,t.state,t.context),a=vt(y);(a===null||a!==g||!Et(t.node,f))&&(g=a,Es(t.node,f,y),J(t.node,y),f=kt(t.node,y))},{depth:o.path.length,label:S(o,"style")});o.__effects.push(p),o.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const _=t.style[i];if(typeof _!="function")continue;const g=P(t,yt(t.styleDeps,i),_);let f,p=null;const y=v(()=>{try{const a=g(t,t.state,t.context);if(t.node){const h=i+":"+String(a);if(h!==f||!Et(t.node,p)){f=h;const u={[i]:a};J(t.node,u),p=kt(t.node,u)}}}catch(a){I(o,"style."+i,a)}},{depth:o.path.length,label:S(o,"style."+i)});o.__effects.push(y)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const _=P(t,yt(t.attrDeps,i),t.attr[i]),g=i,f=v(()=>{try{let p=_(t,t.state,t.context);typeof p=="string"&&p.includes("{{")&&(p=$.call(t,p,t.state)),t.node?.setAttribute&&(p==null||p===!1&&!ut(g)?t.node.removeAttribute(g):typeof p!="function"&&typeof p!="object"&&t.node.setAttribute(g,K(g,p)))}catch(p){I(o,"attr."+g,p)}},{depth:o.path.length,label:S(o,"attr."+g)});f._attrName=g.toLowerCase(),o.__effects.push(f)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const _=t.attr[i],g=i,f=v(()=>{try{const p=$.call(t,_,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(g,K(g,p??""))}catch(p){I(o,"attr."+g,p)}},{depth:o.path.length,label:S(o,"attr."+g)});f._attrName=g.toLowerCase(),o.__effects.push(f)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const _=t.aria[i];if(typeof _=="string"&&_.includes("{{")){const y=_,a="aria-"+i.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),h=v(()=>{try{const u=$.call(t,y,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(a,K(a,u??""))}catch(u){I(o,"aria."+i,u)}},{depth:o.path.length,label:S(o,"aria."+i)});h._attrName=a,o.__effects.push(h);continue}if(typeof _!="function")continue;const g=P(t,yt(t.ariaDeps,i),t.aria[i]),f="aria-"+i.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),p=v(()=>{try{const y=g(t,t.state,t.context);if(!t.node?.setAttribute)return;y==null?t.node.removeAttribute(f):typeof y!="function"&&typeof y!="object"&&t.node.setAttribute(f,K(f,y))}catch(y){I(o,"aria."+i,y)}},{depth:o.path.length,label:S(o,"aria."+i)});p._attrName=f,o.__effects.push(p)}if(t.data&&typeof t.data=="object")for(const i in t.data){const _=t.data[i];if(typeof _=="string"&&_.includes("{{")){const a=_,h="data-"+i.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),u=v(()=>{try{const l=$.call(t,a,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(h,l??"")}catch(l){I(o,"data."+i,l)}},{depth:o.path.length,label:S(o,"data."+i)});u._attrName=h,o.__effects.push(u);continue}if(typeof _!="function")continue;const g=P(t,yt(t.dataDeps,i),t.data[i]),p="data-"+i.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),y=v(()=>{try{const a=g(t,t.state,t.context);if(!t.node?.setAttribute)return;a==null||a===!1?t.node.removeAttribute(p):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(p,a===!0?"":a)}catch(a){I(o,"data."+i,a)}},{depth:o.path.length,label:S(o,"data."+i)});y._attrName=p,o.__effects.push(y)}const r=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(r)for(const i in r){if(typeof r[i]!="function")continue;const _=P(t,yt(t.classDeps,i),r[i]),g=v(()=>{try{const f=_(t,t.state,t.context);if(!t.node?.classList)return;typeof f=="string"?t.node.classList.add(f):f?t.node.classList.add(i):t.node.classList.remove(i)}catch(f){I(o,"class."+i,f)}},{depth:o.path.length,label:S(o,"class."+i)});o.__effects.push(g)}!e&&typeof t.if=="function"&&ko(t,o,t.if);for(const i of Object.keys(t)){if(W.has(i)||typeof t[i]!="function")continue;const _=i.charCodeAt(0);if(_>=65&&_<=90||Y(i))continue;const g=t[i];o.__exec[i]=g;const f=t.tag||"div";if(ft(f,i)&&!lt(f,i)){const p=at(i)||i,y=P(t,t[i+"Deps"],g),a=v(()=>{try{let h=y(t,t.state,t.context);typeof h=="string"&&h.includes("{{")&&(h=$.call(t,h,t.state)),t.node?.setAttribute&&(h==null||h===!1&&!ut(p)?t.node.removeAttribute(p):typeof h!="function"&&typeof h!="object"&&(p==="src"&&"src"in t.node?t.node.src=h:t.node.setAttribute(p,K(p,h))))}catch(h){I(o,i,h)}},{depth:o.path.length,label:S(o,i)});a._attrName=p.toLowerCase(),o.__effects.push(a)}}const d=t.tag||"div";for(const i of Object.keys(t)){if(W.has(i))continue;const _=t[i];if(typeof _!="string"||!_.includes("{{"))continue;const g=i.charCodeAt(0);if(g>=65&&g<=90||Y(i)||lt(d,i)||$t[i]||!ft(d,i))continue;const f=at(i)||i,p=v(()=>{try{const y=$.call(t,_,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(f,K(f,y??""))}catch(y){I(o,i,y)}},{depth:o.path.length,label:S(o,i)});p._attrName=f.toLowerCase(),o.__effects.push(p)}if(Rs(t),$s(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,_=t.stateDeps;let g=!1,f=[];const p=v(()=>{const y=[];for(let l=0;l<_.length;l++){const b=_[l];try{y[l]=typeof b=="function"?b(t,t.state,t.context):t.state?.[b]}catch{y[l]=void 0}}if(!g){g=!0,f=y;return}let a=y.length!==f.length;for(let l=0;!a&&l<y.length;l++)y[l]!==f[l]&&(a=!0);const h=f;if(f=y,!a)return;const u=t.context?.designSystem;u&&N(u);try{i(t,t.state,t.context,{prev:h,next:y})}catch(l){if(t.context?.plugins?.length&&z("error",t,{hook:"onStateUpdate",error:l})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',l),t.context?.strictMode)throw l}finally{u&&M()}},{depth:o.path.length,label:S(o,"onStateUpdate")});o.__effects.push(p)}Fs(t)}function vo(t){const s=t.parent,o=s?.node;if(!o||!t.node){Yo(t,t.parent);return}let e=null;const n=Object.keys(s),c=n.indexOf(t.key);for(let r=c+1;r<n.length;r++){const d=s[n[r]];if(d?.node?.parentNode===o){e=d.node;break}}e?o.insertBefore(t.node,e):o.appendChild(t.node)}function ko(t,s,o){const e=P(t,t.ifDeps,o),n=v(()=>{let c;try{c=e(t,t.state,t.context)}catch(d){if(c=!1,s.__ifError=d,typeof console<"u"&&console.warn){const i=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${i} \u2014 treating as false:`,d?.message||d)}return}const r=s.__if;if(s.__if=!!c,r&&!s.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(d){console.error("[smbls] onRemove error:",d)}}else if(!r&&s.__if)if(s.__ifInitialized)t.node||(t.node=Ft(t)),t.node&&(t.node.ref=t),vo(t),Kt(t),F("Render",t,{}),Bt(t,{});else{if(s.__ifInitialized=!0,t.tag||(t.tag=oo(t)),F("Init",t,{}),t.node||(t.node=Ft(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"&&!s.__fragmentAnchor){const i=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(i),s.__fragmentAnchor=i}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),Wo(t,{}),So(t,{skipIfEffect:!0}),Kt(t),Uo(t),Ko(t),zo(t,{}),vo(t),F("Create",t,{}),F("Complete",t,{}),F("Render",t,{}),F("RenderRouter",t,{}),Bt(t,{})}},{depth:s.path.length,label:S(s,"if")});s.__effects.push(n)}function St(t,s){const o=t.node;if(!o)return;const e=s==null||typeof s=="object"?"":String(s);if(t.tag==="string"){o.nodeValue!==e&&(o.nodeValue=e);return}const n=t.__ref;let c=n?n.__textNode:null;if(c&&c.parentNode!==o&&(c=null),!c){const r=o.firstChild;r&&r.nodeType===3&&(c=r)}c?c.nodeValue!==e&&(c.nodeValue=e):o.firstChild?(c=(o.ownerDocument||t.context?.document||globalThis.document).createTextNode(e),o.insertBefore(c,o.firstChild)):(o.textContent=e,c=o.firstChild&&o.firstChild.nodeType===3?o.firstChild:null),n&&(n.__textNode=c||null)}function jo(t,s){const o=t.node;if(!o||!("value"in o))return;const e=s==null?"":String(s);if(o.value===e)return;const n=typeof document<"u"&&document.activeElement===o,c=n&&typeof o.selectionStart=="number"?o.selectionStart:null,r=n&&typeof o.selectionEnd=="number"?o.selectionEnd:null;if(o.value=e,n&&c!=null&&r!=null)try{o.setSelectionRange(c,r)}catch{}const d=t.__ref&&t.__ref.__autoGrow;d&&d.active&&d.resize()}function Kt(t){const{node:s}=t;if(s){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&St(t,t.text),Io(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in s){const o=String(t.value);s.value!==o&&(s.value=o)}if(t.style&&typeof t.style=="object"){let o=t.style;for(const e in t.style)if(typeof t.style[e]=="function"){o={};for(const n in t.style)typeof t.style[n]!="function"&&(o[n]=t.style[n]);break}J(s,o)}if(t.attr&&typeof t.attr=="object")for(const o in t.attr){const e=t.attr[o];typeof e=="function"||typeof e=="object"||e!=null&&(typeof e=="string"&&e.includes("{{")||e===!1&&!ut(o)||s.setAttribute&&s.setAttribute(o,K(o,e)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&s.setAttribute&&s.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const o in t.data){const e=t.data[o];typeof e=="function"||typeof e=="object"||e==null||e===!1||typeof e=="string"&&e.includes("{{")||s.dataset&&(s.dataset[o]=e===!0?"":e)}if(t.classlist||t.class){const o=t.classlist||t.class;if(typeof o=="string")o.split(" ").forEach(e=>e&&s.classList.add(e));else if(typeof o=="object")for(const e in o){const n=typeof o[e]=="function"?o[e](t,t.state,t.context):o[e];n&&s.classList.add(typeof n=="string"?n:e)}}}}function vt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function js(t){if(!t||typeof t!="object")return!1;for(const s in t){const o=t[s];if(o&&typeof o=="object"&&!Array.isArray(o))return!0}return!1}function kt(t,s){if(!t||!t.style||!s)return null;const o=t.style,e=[];for(const n in s){if(s[n]==null||n.charAt(0)==="&")continue;const r=jt(n);e.push(r,Vt(o,r),Eo(o,r))}return e}function Vt(t,s){return typeof t.getPropertyValue=="function"?t.getPropertyValue(s):""}function Eo(t,s){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(s):""}function jt(t){return Tt(t)?t:t.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())}function Es(t,s,o){if(!t||!t.style||!s||!s.length)return;const e=t.style,n=new Set;if(o&&typeof o=="object")for(const c in o)o[c]==null||c.charAt(0)==="&"||n.add(jt(c));for(let c=0;c<s.length;c+=3){const r=s[c];n.has(r)||Vt(e,r)===s[c+1]&&typeof e.removeProperty=="function"&&e.removeProperty(r)}}function Et(t,s){if(!s||!t||!t.style)return!1;const o=t.style;for(let e=0;e<s.length;e+=3)if(Vt(o,s[e])!==s[e+1]||Eo(o,s[e])!==s[e+2])return!1;return!0}const Tt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function Ts(t){let s=null;for(const o in t)t[o]!=null&&o.charAt(0)!=="&"&&(s||(s=new Set),s.add(jt(o)));return s}function Ps(t,s,o,e){const n=t.__ref;if(!n)return;let c=null;if(o)for(const r of o){if(e&&e.has(r))continue;const d=s[r];if(d==null||typeof d=="object")continue;const i=jt(r);ao[i]&&(c||(c={}),c[i]=d)}n.__declaredLonghands=c}function To(t,s){const o=t.__ref,e=o&&o.__declaredLonghands;if(!e||!s)return null;let n=null;for(const c in e){if(s.has(c))continue;const r=ao[c];let d=!1;for(let i=0;i<r.length;i++)if(s.has(r[i])){d=!0;break}d&&(n||(n={}),n[c]=e[c])}return n}function Po(t,s){const o=t.node;J(o,s);const e=Ts(s);if(!e)return s;const n=t.__ref;if(n)if(n.__inlineCssKeys)for(const r of e)n.__inlineCssKeys.add(r);else n.__inlineCssKeys=new Set(e);const c=To(t,e);return c?(J(o,c),Object.assign({},s,c)):s}function Ls(t){const s=t.__ref;if(!s||!s.__inlineCssKeys||!s.__declaredLonghands)return;const o=To(t,s.__inlineCssKeys);o&&J(t.node,o)}function J(t,s){if(!t||!s||!t.style)return;let o=null;for(const e in s){const n=s[e];if(n!=null){if(e.charAt(0)==="&"&&typeof n=="object"){o||(o={}),o[e]=n;continue}try{const c=String(n),r=Tt(e)?e:e.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),d=c.trim(),i=/\s*!important\s*$/.test(d),_=d.replace(/\s*!important\s*$/,"");t.style.setProperty(r,_,i?"important":"")}catch{}}}o&&Os(t,o)}function Os(t,s){const o=`_ds${lo.scopedStyleId++}`;t.classList.add(o);const e=t.ownerDocument;let n=e.querySelector("style[data-smbls-scoped]");n||(n=e.createElement("style"),n.setAttribute("data-smbls-scoped",""),e.head.appendChild(n));let c="";for(const r in s){const d="."+o,i=r.replace(/&/g,d).split(",").map(g=>{const f=g.trim();return f.includes(d)?f:d+f}).join(", "),_=s[r];if(typeof _=="object"){let g="",f="";for(const p in _){const y=_[p];if(typeof y=="object"){const a=p.includes("&")?i.split(", ").map(u=>p.replace(/&/g,u)).join(", "):i.split(", ").map(u=>`${u} ${p}`).join(", ");let h="";for(const u in y)h+=`${u.replace(/[A-Z]/g,l=>"-"+l.toLowerCase())}: ${y[u]};`;f+=fo(`${a} { ${h} }`,a)+`
5
- `}else g+=`${p.replace(/[A-Z]/g,a=>"-"+a.toLowerCase())}: ${y};`}g&&(c+=fo(`${i} { ${g} }`,i)+`
6
- `),f&&(c+=f)}}c&&(n.textContent+=c)}const Lo=new Set;function Oo(t){if(!Array.isArray(t))return"";const s=[];for(let o=0;o<t.length;o++)typeof t[o]=="string"&&t[o].length&&s.push(t[o]);return s.sort(),s.join("|")}function Ds(t,s,o){const e=Oo(o);queueMicrotask(()=>{if(!t.__ref)return;let n;try{n=s(t,t.state,t.context)}catch{return}if(Oo(n)===e)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";Lo.has(c)||(Lo.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${o.join(", ")||"(none)"}], probed [${Array.isArray(n)?n.join(", "):String(n)}]. 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 Rs(t){const s=t.subscribeTo,o=typeof s=="function";let e=s;if(o)try{e=s(t,t.state,t.context)}catch{e=null}if(o&&tt()&&Ds(t,s,Array.isArray(e)?e:[]),!Array.isArray(e)||e.length===0)return;const n=t.__ref;for(let c=0;c<e.length;c++){const r=e[c];if(typeof r!="string"||r.length===0)continue;const d=r.split("."),i=d[0],_=d.slice(1),g={value:!1},f=v(()=>{const p=t.state&&(q(t.state)?t.state.root:null);if(!p||!q(p))return;let y=p;y=y[i];for(let h=0;h<_.length&&!(y==null||typeof y!="object");h++)if(q(y))y=y[_[h]];else break;if(!g.value)return;let a=!1;if(typeof t.onBeforeUpdate=="function"){const h=t.context?.designSystem;h&&N(h);try{if(Vs(n)){const u=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});u&&typeof u.then=="function"?u.then(()=>Ot(n,!1),l=>{Ot(n,!0),t.context?.plugins?.length&&z("error",t,{hook:"onBeforeUpdate",error:l})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",l)}):(Ot(n,!1),u===!1&&(a=!0))}}catch(u){Ot(n,!0),t.context?.plugins?.length&&z("error",t,{hook:"onBeforeUpdate",error:u})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",u)}finally{h&&M()}}if(!a&&t.node&&n.__effects)for(let h=0;h<n.__effects.length;h++){const u=n.__effects[h];u&&u!==f&&!u._disposed&&!u._isSubscribeToEffect&&typeof u._execute=="function"&&u._execute()}if(!a&&typeof t.onUpdate=="function"){const h=t.context?.designSystem;h&&N(h);try{t.onUpdate(t,t.state,t.context)}catch(u){t.context?.plugins?.length&&z("error",t,{hook:"onUpdate",error:u})||console.error("[DOMQL] subscribeTo onUpdate error:",u)}finally{h&&M()}}},{depth:n.path.length,label:S(n,"subscribeTo("+r+")")});g.value=!0,f._isSubscribeToEffect=!0,n.__effects.push(f)}}function Wt(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}function zt(t,s){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const o=s.context?.designSystem?.media?.[t.slice(1)];return o?/^@(media|supports|container)\b/.test(o)?o:`@media ${o}`:t}const Do=new Set;function Ns(t,s){const o=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",e=o+"::"+t;Do.has(e)||(Do.add(e),console.warn(`[smbls/css] "${t}" at ${o} 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.`))}function et(t,s,o,e){const n={},c=new Set,r=(d,i,_)=>{const g=_?new Set(Object.keys(n)):null;if(D[d]){const f=D[d](i,s,s.state,s.context);if(f){const p=Array.isArray(f)?f:[f];for(const y of p)y&&Object.assign(n,y)}}else n[d]=i;if(_)for(const f in n)g.has(f)||c.add(f)};for(const d in t){if(!Object.prototype.hasOwnProperty.call(t,d))continue;let i=t[d];if(typeof i=="function"&&(i=i(s,s.state,s.context)),i==null||typeof i=="function")continue;if(typeof i=="object"&&!Array.isArray(i)){if(d==="style"){for(const y in i){let a=i[y];if(typeof a=="function"&&(a=a(s,s.state,s.context)),a==null||typeof a=="function")continue;const h=typeof s[y]=="function"&&(D[y]||R&&R.has(y))||!!(e&&e.has(y));r(y,a,h)}continue}if(Wt(d,s)){const y=et(i,s,!1,e);Object.keys(y).length&&(n[`[data-theme="${d.slice(1)}"] &`]=y);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(d)){tt()&&Ns(d,s);continue}const f=zt(d,s),p=et(i,s,!1,e);Object.keys(p).length&&(n[f]=p);continue}const _=typeof s[d]=="function"&&(D[d]||R&&R.has(d)),g=!!(e&&e.has(d));r(d,i,_||g)}if(o)for(const d in n)c.add(d);for(const d of c){const i=n[d];typeof i=="string"&&!i.includes("!important")&&(n[d]=i+" !important")}return n}const Pt=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function Ro(t,s){for(const o in s){const e=s[o];t[o]=Pt(e)?Ro(Pt(t[o])?t[o]:{},e):e}return t}function Ms(t,s){if(!Pt(s))return;let o;for(const e of t.split(" ")){const n=e?s[e]:null;Pt(n)&&(o=Ro(o||{},n))}return o}function Yt(t,s){if(s===void 0&&(s=0),s>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&Yt(t[o],s+1))return!0}return!1}function No(t,s,o){if(!s||typeof s!="object"||Array.isArray(s))return null;if(Wt(t,o)){const c=et(s,o,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const e=zt(t,o),n=et(s,o,!1);return Object.keys(n).length?{cssProp:e,block:n}:null}function Fs(t){const s=t.__ref;for(const o of Object.keys(t)){if(!Gt(o))continue;const e=t[o];if(!e||typeof e!="object"||Array.isArray(e)||!Yt(e))continue;let n=null,c;const r=v(()=>{if(!t.node)return;const d=t.context?.designSystem;d&&N(d);let i,_=!1;try{const g=No(o,e,t),f=g?vt(g.block)+"::"+g.cssProp:null;if(f!==null&&f===c)_=!0;else if(c=f,g){const p=ct({[g.cssProp]:g.block},null,t.context?.cssPrefix);i=p?p.split(" ").filter(Boolean):null}else i=null}finally{d&&M()}if(!(_||!t.node.classList)){if(n)for(const g of n)t.node.classList.remove(g);if(i&&i.length)for(const g of i)t.node.classList.add(g);n=i}},{depth:s.path.length,label:S(s,"cssBlock("+o+")")});s.__effects.push(r)}}function $s(t){const s=t.__ref;s.__conditionalRunners=[];const o=new Map;for(const e of Object.keys(t)){const n=e.charAt(0);if(n!=="."&&n!=="!")continue;const c=e.slice(1);if(!c)continue;if(/[:@\s>~+[\]]/.test(c)){if(typeof console<"u"&&console.warn){const a=c.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${n}\` is read as one prop name. Nest the selector inside instead: \`${n}${a}: { '${c.slice(a.length)}': {...} }\`.`)}continue}const r=t[e];if(!r||typeof r!="object")continue;const d=n==="!",i={lastMatch:!1,appliedKeys:null,appliedClasses:null},_=new Set;for(const a in r){if(!Object.prototype.hasOwnProperty.call(r,a))continue;const h=a.charAt(0),u=r[a];(h===":"||h==="@"||h==="&"||h==="[")&&u&&typeof u=="object"&&!Array.isArray(u)||_.add(a)}const g=()=>{let a;const h=t[c];if(h===void 0){const b=!!t.state&&c in t.state,A=t.state?t.state[c]:void 0;if(b||A!==void 0)a=A;else{const C=t.context?.cases?.[c];if(C===void 0)return;try{a=typeof C=="function"?C.call(t,t):C}catch(w){a=!1,s.__conditionalError=w,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,w?.message||w)}}}else if(typeof h=="function")try{a=h(t,t.state,t.context)}catch(b){a=!1,s.__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 a=h;const u=d?!a:!!a;if(!t.node||u===i.lastMatch)return;i.lastMatch=u;const l=t.context?.designSystem;l&&N(l);try{if(u){const b={},A={};let C=!1;for(const x in r){if(!Object.prototype.hasOwnProperty.call(r,x))continue;const E=r[x],U=x.charAt(0);if((U===":"||U==="@"||U==="&"||U==="[")&&E&&typeof E=="object"&&!Array.isArray(E)){if(Wt(x,t)){const T=et(E,t,!1,_);Object.keys(T).length&&(A[`[data-theme="${x.slice(1)}"] &`]=T,C=!0)}else{const T=zt(x,t),Z=et(E,t,!1,_);Object.keys(Z).length&&(A[T]=Z,C=!0)}continue}const L=typeof E=="function"?E(t,t.state,t.context):E;if(L!=null)if(D[x]){const T=D[x](L,t,t.state,t.context);if(T){const Z=Array.isArray(T)?T:[T];for(const bt of Z)bt&&Object.assign(b,bt)}}else(R&&R.has(x)||Tt(x))&&(b[x]=L)}const w=Object.keys(b);if(w.length){J(t.node,b);for(const x of w)o.set(x,e);i.appliedKeys=w}else i.appliedKeys=null;if(C){const x=ct(A,null,t.context?.cssPrefix,{state:!0}),E=x?x.split(" ").filter(Boolean):[];if(E.length&&t.node.classList){for(const U of E)t.node.classList.add(U);i.appliedClasses=E}else i.appliedClasses=null}else if(i.appliedClasses){for(const x of i.appliedClasses)t.node.classList.remove(x);i.appliedClasses=null}}else{if(i.appliedKeys){for(const b of i.appliedKeys)o.get(b)===e&&(Tt(b)?t.node.style.removeProperty(b):t.node.style[b]="",o.delete(b));i.appliedKeys=null}if(i.appliedClasses){for(const b of i.appliedClasses)t.node.classList.remove(b);i.appliedClasses=null}}}finally{l&&M()}};s.__conditionalRunners.push(g);const f=P(t,t[c+"Deps"],g),p=v(f,{depth:s.path.length,label:S(s,"conditional("+e+")")}),y=s.__exec&&s.__exec[c]||t[c];p._sources.size===0&&typeof y=="function"&&tt()&&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 \`${c}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),s.__effects.push(p)}}const qt=new WeakSet;function Is(t){const s=t.ownerDocument;!s||qt.has(s)||(qt.add(s),queueMicrotask(()=>{qt.delete(s);const o=s.body||s.documentElement;o&&o.offsetWidth}))}const Zt=new WeakSet;let Mo=!1;function Fo(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Qt(t,s){const o={...t};for(const e in s){const n=s[e],c=o[e];o[e]=n&&typeof n=="object"&&c&&typeof c=="object"?Qt(c,n):n}return o}function $o(t,s){const o={};for(const e in t){const n=t[e];if(n&&typeof n=="object"){const c=$o(n,s);Object.keys(c).length&&(o[e]=c)}else s.has(e)||(o[e]=n)}return o}function Io(t){const{node:s}=t;if(!s)return;if(Mo||(Mo=!0,ct({display:"none"})),Zt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Zt.add(t);const o=t.context?.designSystem;o&&N(o),io();try{const e={};let n=!1,c=[],r=null,d=null,i=null;const _=(a,h)=>{if(h&&typeof h=="object"&&Fo(a)){d||(d={});const u=d[a];u&&(h=Qt(u,h)),d[a]=h}else(h===null||typeof h!="object")&&(i||(i=new Set),i.add(a));e[a]=h};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&D.theme){const a=D.theme(t.theme,t,t.state,t.context);if(a){const h=u=>{for(const l in u){const b=u[l];b&&typeof b=="object"&&Fo(l)&&(r||(r={}),r[l]=b),e[l]=b}};if(Array.isArray(a))for(const u of a)u&&h(u);else h(a);n=!0}}const g=(a,h)=>{if(D[a]){const u=D[a](h,t,t.state,t.context);if(u){if(Array.isArray(u)){for(const l of u)if(l)for(const b in l)_(b,l[b])}else for(const l in u)_(l,u[l]);n=!0}}else if(R&&R.has(a))h!=null&&typeof h!="object"&&(_(a,h),n=!0);else if(a.charCodeAt(0)===45)h!=null&&typeof h!="object"&&(_(a,h),n=!0);else if((a.charAt(0)==="&"||a.charAt(0)==="@"||a.charAt(0)===":"||a.charAt(0)==="[")&&h&&typeof h=="object"&&!Array.isArray(h)){if(Yt(h))return;const u=No(a,h,t);u&&(_(u.cssProp,u.block),n=!0)}};if(typeof t.class=="string"){const a=Ms(t.class,t.context?.designSystem?.class);if(a)for(const h in a)g(h,a[h])}const f=i?new Set(i):null,p=t.tag||"div";for(const a of Object.keys(t)){if(typeof t[a]=="function"||W.has(a)||a==="theme")continue;const h=a.charCodeAt(0);h>=65&&h<=90||Y(a)||uo(p,a)||g(a,t[a])}if(r)for(const a in r){let h=i?$o(r[a],i):r[a];d&&d[a]&&(h=Qt(h,d[a])),Object.keys(h).length?e[a]=h:delete e[a]}if(Ps(t,e,i,f),n){e.display&&String(e.display).includes("!important")&&(s.style.setProperty("display",String(e.display).replace(/\s*!important\s*$/,""),"important"),delete e.display);const a=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof a=="string"&&a!==""&&e.display&&e.display!==a&&(e.display=a);const h=ct(e,null,t.context?.cssPrefix);if(c=h?h.split(" ").filter(Boolean):[],h&&s.classList){const u=c;let l=!1;for(const b of u)s.classList.add(b),l||(b.charCodeAt(0)===95&&b.charCodeAt(1)===99||b.charCodeAt(0)===95&&b.indexOf("_c",1)!==-1)&&(l=!0);l&&Is(s)}}const y=t.__ref;if(y){const a=y.__staticCssClasses;if(a&&s.classList){const h=new Set(c);for(const u of a)h.has(u)||s.classList.remove(u)}y.__staticCssClasses=c}Ls(t)}finally{co(),o&&M(),Zt.delete(t)}}const _e=t=>!!D[t]||!!(R&&R.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function ge(t){t&&t.node&&Io(t)}function Uo(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const n in t.aria){const c=t.aria[n];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const r="aria-"+n.replace(/[A-Z]/g,d=>"-"+d.toLowerCase());s.setAttribute(r,K(r,c))}const o=is(t);for(const n in o){const c=o[n];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&s.setAttribute(n,c===!0?"":c)}const e=t.tag||"div";for(const n of Object.keys(t)){if(typeof t[n]=="function"||W.has(n)||n==="on"||o[n]!==void 0)continue;const c=n.charCodeAt(0);if(!(c>=65&&c<=90)&&!Y(n)&&!lt(e,n)&&ft(e,n)){let r=t[n];if(r==null)continue;if(typeof r=="string"&&r.includes("{{")){if(!$t[n])continue;r=$.call(t,r,t.state)}if(r==null||typeof r=="function"||typeof r=="object"||r===!1&&!ut(at(n)||n))continue;const d=at(n)||n;s.setAttribute(d,K(d,r))}}}function be(t,s){const{node:o}=t;if(!o||!o.setAttribute)return;const e=s.charCodeAt(0);if(e>=65&&e<=90||Y(s))return;const n=t.tag||"div";if(lt(n,s)||!ft(n,s))return;const c=at(s)||s,r=c.toLowerCase(),d=t.__ref&&t.__ref.__effects;let i=!1;if(d)for(let f=0;f<d.length;f++){const p=d[f];p&&p._attrName===r&&!p._disposed&&typeof p._execute=="function"&&(i=!0,p._execute())}if(i)return;let _=t[s];const g=$t[s];if(g&&_!=null){const f=g(t);f!==void 0&&(_=f)}typeof _=="string"&&_.includes("{{")&&(_=$.call(t,_,t.state)),_==null||_===!1&&!ut(c)?o.removeAttribute(c):typeof _!="function"&&typeof _!="object"&&o.setAttribute(c,K(c,_))}function Us(t,s){const o=t.node,e=t.__ref;let n=e.__autoGrow;if(!s){if(n&&n.active){try{o.removeEventListener("input",n.resize)}catch{}Go(n),Q.delete(t),o.style.height="",n.appliedMax!=null&&o.style.maxHeight===n.appliedMax&&(o.style.maxHeight=""),Ho(o,n,!1),n.active=!1,n.appliedMax=null,n.lastMeasure=0}return}n||(n=e.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,lastWidth:null,watch:null,awaitingLayout:!1,appliedScroll:!1,fontsHooked:!1,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!o.isConnected){_t(t,!0);return}if(!(o.scrollHeight>0)){n.awaitingLayout=!0,Bo(t,n);return}n.awaitingLayout=!1;const r=o.style.height;o.style.height="0px";const d=o.scrollHeight;if(!(d>0)){o.style.height=r;return}const i=Hs(o),_=i!=null&&d>i;o.style.height=(_?i:d)+"px",Ho(o,n,_),n.lastMeasure=d,n.lastWidth=o.clientWidth,Bo(t,n)}},e.__eventCleanup||(e.__eventCleanup=[]),e.__eventCleanup.push(()=>{try{o.removeEventListener("input",n.resize)}catch{}Go(n),Q.delete(t)})),n.active||(o.addEventListener("input",n.resize),n.active=!0,Gs(t,n));const c=typeof s=="object"&&s.max!=null?String(s.max):null;c!==n.appliedMax&&(c==null?n.appliedMax!=null&&o.style.maxHeight===n.appliedMax&&(o.style.maxHeight=""):o.style.maxHeight=c,n.appliedMax=c),n.resize()}function _t(t,s){const o=t.__ref?.__autoGrow;o&&(s&&(o.attachAttempts=0,o.firstAttemptAt=null),Q.add(t),wt())}function Bs(){const t=Array.from(Q);Q.clear();for(let s=0;s<t.length;s++){const o=t[s],e=o.node,n=o.__ref?.__autoGrow;if(!(!e||!n||!n.active)){if(!e.isConnected){n.firstAttemptAt==null&&(n.firstAttemptAt=st()),n.attachAttempts+=1,n.attachAttempts<=yo&&st()-n.firstAttemptAt<_o&&(Q.add(o),wt());continue}n.attachAttempts=0,n.firstAttemptAt=null,n.resize()}}}function Bo(t,s){if(s.watch)return;const o=t.node;if(!o)return;const e=o.ownerDocument&&o.ownerDocument.defaultView,n=e&&e.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof n!="function")return;const c=()=>{if(!s.active||!o.isConnected||!(o.scrollHeight>0))return;if(s.awaitingLayout){s.awaitingLayout=!1,_t(t,!0);return}const d=o.clientWidth;s.lastWidth!=null&&Math.abs(d-s.lastWidth)<.5||(s.lastWidth=d,_t(t,!0))};let r;try{r=new n(c),r.observe(o)}catch{return}s.watch=r}function Go(t){const s=t.watch;if(s){t.watch=null;try{s.disconnect()}catch{}}}function Gs(t,s){if(s.fontsHooked)return;s.fontsHooked=!0;const o=t.node&&t.node.ownerDocument,e=o&&o.fonts&&o.fonts.ready;!e||typeof e.then!="function"||e.then(()=>{s.active&&t.node&&_t(t,!0)},()=>{})}function Hs(t){const s=t.ownerDocument&&t.ownerDocument.defaultView;let o;try{o=s&&s.getComputedStyle?s.getComputedStyle(t):null}catch{o=null}if(!o)return null;const e=g=>typeof g=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(g)?parseFloat(g):null,n=e(o.maxHeight);if(n==null||!(n>0))return null;const c=(e(o.paddingTop)||0)+(e(o.paddingBottom)||0),r=(e(o.borderTopWidth)||0)+(e(o.borderBottomWidth)||0),d=o.boxSizing==="border-box"?n-r:n+c,i=e(o.lineHeight);if(!(i>0))return d;const _=Math.floor((d-c)/i+1e-6);return _>=1?_*i+c:d}function Ho(t,s,o){o?s.appliedScroll||(t.style.overflowY="auto",s.appliedScroll=!0):s.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),s.appliedScroll=!1)}function Ko(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const o=t.__ref,e=t.autoGrow,n=typeof e=="function"?P(t,t.autoGrowDeps,e):null,c=v(()=>{const r=t.autoGrow;let d=r;if(typeof r=="function")try{d=(r===e&&n?n:r)(t,t.state,t.context)}catch{d=null}Us(t,d)},{depth:o.path.length,label:S(o,"autoGrow")});o.__effects||(o.__effects=[]),o.__effects.push(c),n&&(o.__exec.autoGrow=e)}const Vo=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Wo(t,s){for(const o of Object.keys(t)){if(!Y(o)||Vo.has(o))continue;const e=os(o);if(e){ts(e,t,t[o]);continue}let n=t[o];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){const r=n;n=function(i){return t.call(r,i)}}if(typeof n!="function")continue;const c=ps(o);Jo.has(c)||mo(hs(c),t,n)}Ks(t)}function Ks(t){const s=t.node;if(!s||!s.addEventListener)return;const o={};let e=!1;for(const p of Vo){const y=t[p];typeof y=="function"&&(o[p]=y,e=!0)}if(!e)return;const n=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let r=0,d=0,i=0,_=!1;const g=p=>{const y=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];y&&(r=y.clientX,d=y.clientY,i=Date.now(),_=!0)},f=p=>{if(!_)return;_=!1;const y=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!y)return;const a=y.clientX-r,h=y.clientY-d,u=Date.now()-i;if(u>c)return;const l=Math.abs(a),b=Math.abs(h);if(Math.max(l,b)<n)return;let A;if(l>b*1.2)A=a<0?"left":"right";else if(b>l*1.2)A=h<0?"up":"down";else return;const C="onSwipe"+A.charAt(0).toUpperCase()+A.slice(1),w=o[C],x=o.onSwipe;w&&w.call(t,p,t,t.state,t.context),x&&x.call(t,{direction:A,dx:a,dy:h,dt:u,event:p},t,t.state,t.context)};s.addEventListener("touchstart",g,{passive:!0}),s.addEventListener("touchend",f,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",g)}catch{}try{s.removeEventListener("touchend",f)}catch{}})}function gt(t,s){const o={...t};for(const e in s){const n=o[e],c=s[e];n&&c&&typeof n=="object"&&typeof c=="object"&&!Array.isArray(n)&&!Array.isArray(c)&&typeof n!="function"&&typeof c!="function"?o[e]=gt(n,c):o[e]=c}return o}function Xt(t,s,o,e){if(!s||!t.node)return;const n=t.childExtends;if(Array.isArray(s)){const c=t.tag==="fragment",r=t.context?.document||globalThis.document,d=c?null:r?.createDocumentFragment();if(!c&&!d)return;const i=t.childProps,_=t.childrenAs,g=u=>{let l=s[u];const b=l;(typeof l=="string"||typeof l=="number")&&(l={text:l});let A=i;if(typeof i=="function")try{A=i(t,l)}catch{A=null}if(_==="state"){let w=b;(typeof b=="string"||typeof b=="number")&&(w={value:b,text:b}),l=A?{...A,state:w}:{state:w}}else A&&(l=gt(A,l));if(n&&!l.ignoreChildExtends)if(l.extends){const w=Array.isArray(l.extends)?l.extends:[l.extends],x=Array.isArray(n)?n:[n];l={...l,extends:[...x,...w]}}else l={...l,extends:n};const C=bo(l?.key,b,u);try{return X(l,t,C,o)}catch(w){if(typeof console<"u"&&console.error){const x=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${C}" failed to construct at ${x} (initial render, skipping this row):`,w?.message||w)}return null}},f=t.__ref;if(!(e===!0&&!c&&!!f&&(o?.mountYield===!0||t.yieldChildren===!0))){for(let u=0;u<s.length;u++){const l=g(u);!c&&l?.node&&d.appendChild(l.node)}return c||t.node.appendChild(d),!0}const y=f.__childrenChunkGen=(f.__childrenChunkGen||0)+1;eo();let a=null;const h=u=>{if(f.__disposed||f.__childrenChunkGen!==y){a&&a.parentNode&&a.remove();return}for(let l=u;l<s.length;l++){const b=g(l);if(b?.node&&(a?t.node.insertBefore(b.node,a):d.appendChild(b.node)),l+1<s.length&&so()){a||(a=r.createComment("smbls-mount"),d.appendChild(a),t.node.appendChild(d));const A=l+1;ro(()=>h(A));return}}a?(a.remove(),t.node.tagName==="SELECT"&&Lt(t,!0)):t.node.appendChild(d)};return h(0),no(),!0}if(typeof s=="string"){const c=Ao(s,t);if(Array.isArray(c))return Xt(t,c,o,e)}if(typeof s=="object")for(const c in s){if(W.has(c))continue;let r=s[c];if(!(r==null||r===!1)){if((typeof r=="string"||typeof r=="number")&&(r={text:r}),t.childProps&&(r=gt(t.childProps,r)),n&&!r.ignoreChildExtends)if(r.extends){const d=Array.isArray(r.extends)?r.extends:[r.extends],i=Array.isArray(n)?n:[n];r={...r,extends:[...i,...d]}}else r={...r,extends:n};X(r,t,c,o)}}}function Lt(t,s){const o=t.node;if(!o||o.tagName!=="SELECT")return;const e=o.options;if(!e||!e.length)return;const n=t.__ref,c=n&&n.__exec&&n.__exec.value,r=typeof c=="function",d=t.value!=null&&typeof t.value!="function";if(r||d){let g;if(r)try{g=c(t,t.state,t.context)}catch{return}else g=t.value,typeof g=="string"&&g.includes("{{")&&(g=$.call(t,g,t.state));const f=g==null?"":String(g);o.value!==f&&(o.value=f);return}const i=s||!(n&&n.__selectSynced);if(n&&(n.__selectSynced=!0),!i)return;let _=-1;for(let g=0;g<e.length;g++)e[g].defaultSelected&&(_=g);_>=0&&o.selectedIndex!==_&&(o.selectedIndex=_)}function zo(t,s){let{children:o,content:e}=t;const n=t.childExtends;if(typeof o=="function"){const f=o;try{o=f(t,t.state,t.context)}catch(u){if(o=void 0,typeof console<"u"&&console.error){const l=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${l} (initial run, treating as empty):`,u?.message||u)}}t.children=o;const p=t.__ref;let y=!1;const a=P(t,t.childrenDeps,f),h=v(()=>{const u=y;y=!0;let l;try{l=a(t,t.state,t.context)}catch(L){if(typeof console<"u"&&console.error){const T=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${T}${u?"":" (initial tracking run)"}:`,L?.message||L)}return}if(!u||l===t.children)return;t.children=l,p.__childrenChunkGen!=null&&p.__childrenChunkGen++;const b=typeof t.onContentUpdate=="function",A=b?[]:null,C=b?[]:null,w=b?[]:null;if(Array.isArray(l)&&t.childrenAs==="state"){const L=t.childProps,T=[],Z=new Map;for(let k=0;k<l.length;k++){const G=l[k];let j=L;if(typeof L=="function")try{j=L(t,G)}catch{j=null}const V=bo(j&&j.key,G,k);T.push(V),Z.set(V,{rawChild:G,childProps:j})}const bt=new Set(T),qo=p.__children.slice();for(const k of qo)if(!bt.has(k)){const G=t[k];G?.remove&&G.remove(),delete t[k],C&&C.push(k)}const nt=t.childExtends,At=t.tag==="fragment",Zo=t.context?.document||globalThis.document,rt=At?null:Zo?.createDocumentFragment(),Dt=new Set;for(const k of T){const G=Z.get(k),j=G.rawChild,V=t[k];if(V&&V.state){if(j&&typeof j=="object"){const O=V.state,m=O.$replace||O.replace,to=O.$update||O.update;try{if(typeof m=="function")m.call(O,j);else if(typeof to=="function"){for(const B in O)if(!(B==="__element"||B==="root"||B==="parent"||B==="update")&&!Object.prototype.hasOwnProperty.call(j,B))try{O[B]=void 0}catch{}to.call(O,j)}else for(const B in j)O[B]=j[B]}catch(B){if(typeof console<"u"&&console.error){const Qo=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to patch at ${Qo} (reconcile, keeping its previous data for this pass):`,B?.message||B)}}}w&&w.push(k);continue}let Rt=j;(typeof j=="string"||typeof j=="number")&&(Rt={value:j,text:j});const mt=G.childProps;let H=mt?{...mt,state:Rt}:{state:Rt};if(nt&&!H.ignoreChildExtends)if(H.extends){const O=Array.isArray(H.extends)?H.extends:[H.extends],m=Array.isArray(nt)?nt:[nt];H={...H,extends:[...m,...O]}}else H={...H,extends:nt};let Nt;try{Nt=X(H,t,k,s)}catch(O){if(typeof console<"u"&&console.error){const m=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${m} (reconcile, skipping this row):`,O?.message||O)}Dt.add(k);continue}!At&&Nt?.node&&rt&&rt.appendChild(Nt.node),A&&A.push(k)}if(!At&&rt&&rt.childNodes.length&&t.node&&t.node.appendChild(rt),!At&&t.node){let k=null;for(const G of T){const j=t[G]?.node;if(!j)continue;const V=k?k.nextSibling:t.node.firstChild;j!==V&&t.node.insertBefore(j,V),k=j}}p.__children=Dt.size?T.filter(k=>!Dt.has(k)):T,b&&(A.length||C.length)&&go(t,{added:A,removed:C,kept:w}),Lt(t,!1);return}const U=b?[...p.__children]:null;for(const L of[...p.__children]){const T=t[L];T?.remove&&T.remove(),delete t[L]}p.__children=[],Xt(t,l,s),Lt(t,!1),b&&go(t,{added:[...p.__children],removed:U,kept:[]})},{depth:p.path.length,label:S(p,"children")});p.__effects.push(h)}const c=Xt(t,o,s,!0);if(e!=null&&!(e&&e.__ref)){let f=e;if(typeof f=="string"||typeof f=="number"?f={text:f}:typeof f!="object"&&(f={}),t.childProps&&(f=gt(t.childProps,f)),n&&!f.ignoreChildExtends)if(f.extends){const p=Array.isArray(f.extends)?f.extends:[f.extends],y=Array.isArray(n)?n:[n];f={...f,extends:[...y,...p]}}else f={...f,extends:n};X(f,t,"content",s)}if(o&&!c)return;const r=t.context?.components||{};{const f=Object.keys(t);for(let p=0;p<f.length;p++){const y=f[p];if(!y.endsWith("Extends")||typeof t[y]!="string")continue;const a=y.slice(0,-7);if(!a||a.charCodeAt(0)<65||a.charCodeAt(0)>90)continue;const h={extends:t[y]};delete t[y];for(let u=p+1;u<f.length;u++){const l=f[u],b=l.charCodeAt(0);if(b>=65&&b<=90||W.has(l)||typeof t[l]=="function"&&(l.startsWith("on")||l.startsWith(".")))break;const A=t[l];A!==void 0&&(h[l]=A,delete t[l])}t[a]&&typeof t[a]=="object"?t[a]={...h,...t[a]}:t[a]=h}}const d=s?.mountYield===!0||t.yieldChildren===!0,i=Object.keys(t),_=f=>{if(W.has(f)||typeof t[f]!="object"||t[f]===null)return;const p=f.charCodeAt(0);if(p<65||p>90)return;let y=t[f];if(!y.__ref){if(!y.extends&&!y.extend){const a=r[f]||r[`smbls.${f}`];a&&(y={...y,extends:a})}if(t.childProps&&(y=gt(t.childProps,y)),n&&!y.ignoreChildExtends)if(y.extends){const a=Array.isArray(y.extends)?y.extends:[y.extends],h=Array.isArray(n)?n:[n];y={...y,extends:[...h,...a]}}else y={...y,extends:n};X(y,t,f,s)}};if(!d){for(const f of i)_(f);return}eo();const g=f=>{for(let p=f;p<i.length;p++)if(_(i[p]),p+1<i.length&&so()){const y=p+1;ro(()=>g(y));return}};g(0),no()}function Yo(t,s,o){const{node:e}=t;if(!e)return;e.ref=t;const n=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(n){const r=n.parentNode;if(r){if(o?.position==="before"&&o.node)r.insertBefore(e,o.node);else if(o?.position==="after"&&o.node){const d=o.node.nextSibling;r.insertBefore(e,d||n)}else r.insertBefore(e,n);return}}const c=s?.node||(s?.nodeType?s:null);if(c)if(o?.position==="before"&&o.node)c.insertBefore(e,o.node);else if(o?.position==="after"&&o.node){const r=o.node.nextSibling;r?c.insertBefore(e,r):c.appendChild(e)}else c.appendChild(e)}const Jt=3;function Vs(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Jt?!1:(t.__inBeforeUpdate=!0,!0)}function Ot(t,s){t&&(t.__inBeforeUpdate=!1,s?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Jt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Jt}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,s,o){const e=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&z(e,s,o);const n="on"+t,c=s[n];if(typeof c=="function"){const i=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(i){if(s.__ref[i])return!0;s.__ref[i]=!0}const _=s.context?.designSystem;_&&N(_);let g=!!i;try{const f=c(s,s.state,s.context,o);if(f&&typeof f.then=="function"){const p=s.__ref;return f.catch(y=>{s.context?.plugins?.length&&z("error",s,{hook:n,error:y})||console.error(`[DOMQL] Lifecycle "${n}" error:`,y)}).finally(()=>{i&&p&&(p[i]=!1)}),g=!1,!0}if(f===!1)return!1}catch(f){if(s.context?.plugins?.length&&z("error",s,{hook:n,error:f})||console.error(`[DOMQL] Lifecycle "${n}" error:`,f),s.context?.strictMode)throw f}finally{_&&M(),g&&s.__ref&&(s.__ref[i]=!1)}}return!0}var Ae=X;export{Jt as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,Vs as acquireBeforeUpdateGuard,X as create,Ae as default,Ut as flushMounts,_e as isStaticCssProp,ge as recompileStaticCss,be as reconcileAttrProp,Ot as releaseBeforeUpdateGuard,St as writeElementText};
4
+ `):"")}}if(Lt(r,!0),Zo(r,s,e),typeof r.html=="function"&&r.node&&!r.node.innerHTML){const l=r.context?.designSystem;l&&N(l);try{const b=r.html(r,r.state,r.context);b!=null&&typeof b!="function"&&(r.node.innerHTML=b)}catch{}finally{l&&F()}}if($("Create",r,n),$("Complete",r,n),$("Render",r,n),$("RenderRouter",r,n),Bt(r,n),typeof r.onFrame=="function"){const l=r.onFrame,b=r.context?.designSystem,A=()=>{if(r.node){if(r.node.isConnected){b&&N(b);try{l(r,r.state,r.context)}catch(w){console.error("[DOMQL] onFrame error:",w)}finally{b&&F()}}requestAnimationFrame(A)}};requestAnimationFrame(A)}return r}function bs(t,s,o){const n=!s,e=o.state&&typeof o.state=="object"&&!Array.isArray(o.state)&&Object.keys(o.state).length===0,c=n&&e&&t.context?.state,a=o.state!==void 0&&!c?o.state:t.state&&!q(t.state)?t.state:void 0;if(a==null){if(s?.state)t.state=s.state,it(t,t.state);else if(t.context?.state){const r=t.context.state,i={...r},h=t.context?.polyglot;if(h?.translations){const g=t.context,f=r.lang||h.defaultLang||"en",d=new Set,p=(_,l)=>{d.has(_)||cs(g,_,i)&&(i[_]=l,d.add(_),fs(g,_,l))},u=h.translations[f];if(u&&typeof u=="object")for(const _ in u)p(_,u[_]);const y=new Set(h.languages||[]);for(const _ in h.translations)y.has(_)||p(_,h.translations[_])}t.state=q(i)?i:Nt(i),t.state.__element=t,t.state.root=t.state,it(t,t.state),xt.promoteActiveRootState?.(r,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),it(t,t.state);return}if(typeof a=="string"){if(t.state=xo(a,s),t.state&&typeof t.state=="object"&&!q(t.state)){const r=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:r,enumerable:!1,configurable:!0,writable:!0})}it(t,t.state);return}if(typeof a=="function"){const r=a(t,s?.state);t.state=q(r)?r:Nt(r||{})}else q(a)?t.state=a:t.state=Nt({...a});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,it(t,t.state),xt.promoteActiveRootState?.(a,t.state)}function Ht(t,s){if(!s)return t;const o=s.split("/");let n=t;for(const e of o){if(n==null)return{};n=n[e]}return n??{}}function xo(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const e=t.slice(3);return e?Ht(s.state,e):s.state??{}}if(t.startsWith("~/")){const e=s.state?.root||s.state,c=t.slice(2);return c?Ht(e,c):e??{}}if(s.state?.[t]!==void 0)return s.state[t];const o=Ht(s.state,t);if(o!=null&&Object.keys(o).length>0)return o;const n=s.context?.polyglot;if(n?.translations){const e=s.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{}}const As=new Set(["s","state","ctx","context"]);function xs(t){try{const o=(typeof xt.getFunctionSource=="function"?xt.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return o?o[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function ws(t){if(typeof t!="function"||t.length!==2)return!1;const s=xs(t);if(s.length<2)return!1;const o=s[1].replace(/[{}[\]]/g,"").trim();return o.length>0&&!As.has(o)}function Cs(t){const s=t.__ref,o=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"||W.has(r))continue;const i=r.charCodeAt(0);i>=65&&i<=90||Y(r)||R[r]||M&&M.has(r)||ft(o,r)||(tt()&&ws(t[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];s.__exec[r]=i,Object.defineProperty(t,r,{get(){n&&N(n);try{return i(t,t.state,t.context)}catch{return}finally{n&&F()}},set(h){delete s.__exec[r],Object.defineProperty(t,r,{value:h,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Ss(t,s){if(!(!Array.isArray(s)||s.length===0))for(let o=0;o<s.length;o++){const n=s[o];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function P(t,s,o){return!Array.isArray(s)||s.length===0?o:function(...n){return Ss(t,s),o.apply(this,n)}}function yt(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function S(t,s){return()=>t.path.join(".")+"::"+s}const wo=new Set;function L(t,s,o){if(!tt())return;const n=S(t,s)();wo.has(n)||(wo.add(n),console.warn(`[smbls] "${s}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,o?.message||o))}const Co=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,vs=(t,s)=>{let o;try{o=String(t)}catch{return}if(!o.includes("{{"))return;Co.lastIndex=0;let n;for(;(n=Co.exec(o))!==null;)n[2].includes("{{")&&s.add(n[2])},ks=(t,s)=>!Y(t)&&!lt(s,t),So=(t,s,o,n)=>{if(typeof s=="string"){s.includes("{{")&&o.add(s);return}typeof s=="function"&&ks(t,n)&&vs(s,o)},js=["attr","aria","data"],Es=t=>{if(js.includes(t))return!0;const s=t.charCodeAt(0);return s===46||s===33||s===64},Ts=t=>{const s=new Set,o=t.tag||"div";for(const n of Object.keys(t)){const e=Object.getOwnPropertyDescriptor(t,n),c=e&&e.value;if(c&&typeof c=="object"&&!Array.isArray(c)){if(!Es(n))continue;for(const a in c)So(a,c[a],s,o);continue}So(n,c,s,o)}return s};function vo(t,s){const o=t.__ref,n=!!(s&&s.skipIfEffect),e=Ts(t);if(o.__authoredTemplates)for(const i of e)o.__authoredTemplates.add(i);else o.__authoredTemplates=e;if(Cs(t),typeof t.text=="function"){const i=t.text,h=P(t,t.textDeps,i),g=v(()=>{if(!o.contentManaged)try{let f=h(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&typeof f!="object"&&(typeof f=="string"&&f.includes("{{")&&(f=I.call(t,f,t.state)),St(t,f))}catch(f){L(o,"text",f)}},{depth:o.path.length,label:S(o,"text")});o.__effects.push(g),o.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,h=v(()=>{if(o.contentManaged)return;const g=I.call(t,i,t.state);g!=null&&(t.text=g),t.node&&St(t,g??"")},{depth:o.path.length,label:S(o,"text")});o.__effects.push(h),o.__exec.text=i}const c=t.tag||"div";for(const i of Object.keys(t))if(typeof t[i]=="function"&&!W.has(i)&&!Y(i)&&!o.__exec[i]&&!lo(c,i)){if(R[i]){const h=t[i],g=P(t,t[i+"Deps"],h),f=i;let d,p=null,u=null,y;const _=v(()=>{const l=t.context?.designSystem;l&&N(l);try{const b=g(t,t.state,t.context);co();let A;try{A=R[f](b,t,t.state,t.context)}finally{fo()}if(Array.isArray(A)){const x={};for(const C of A)if(C)for(const E in C)x[E]=C[E];A=x}const w=f==="show"||f==="hide";if(A&&t.node&&Ps(A)){const x=vt(A);if(x===null||x!==y){y=x;const C=ct(A,null,t.context?.cssPrefix),E=C?C.split(" ").filter(Boolean):null;if(t.node.classList){if(u)for(const U of u)t.node.classList.remove(U);if(E&&E.length)for(const U of E)t.node.classList.add(U);u=E}}d=void 0,p=null}else if(A&&t.node){if(u){for(const C of u)t.node.classList.remove(C);u=null,y=void 0}const x=vt(A);if(x===null||x!==d||!Et(t.node,p)){d=x;const C=Lo(t,A);p=kt(t.node,C)}}else t.node&&w&&(d=void 0,p=null,t.node.style.display="")}finally{l&&F()}},{depth:o.path.length,label:S(o,f)});o.__effects.push(_),o.__exec[i]=h}else if(M&&M.has(i)){const h=t[i],g=P(t,t[i+"Deps"],h),f=i;let d,p=null;const u=v(()=>{const y=t.context?.designSystem;y&&N(y);try{const _=g(t,t.state,t.context);if(t.node)if(_!=null){const l=f+":"+String(_);if(l!==d||!Et(t.node,p)){d=l;const b={[f]:_},A=Lo(t,b);p=kt(t.node,A)}}else d=void 0,p=null,t.node.style[f]=""}finally{y&&F()}},{depth:o.path.length,label:S(o,f)});o.__effects.push(u),o.__exec[i]=h}}if(typeof t.html=="function"){const i=t.html,h=P(t,t.htmlDeps,i),g=v(()=>{const f=t.context?.designSystem;f&&N(f);try{const d=h(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{f&&F()}},{depth:o.path.length,label:S(o,"html")});o.__effects.push(g),o.__exec.html=i}if(typeof t.value=="function"){const i=t.value,h=P(t,t.valueDeps,i),g=v(()=>{try{let f=h(t,t.state,t.context);typeof f=="string"&&f.includes("{{")&&(f=I.call(t,f,t.state)),Eo(t,f)}catch(f){L(o,"value",f)}},{depth:o.path.length,label:S(o,"value")});o.__effects.push(g),o.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,h=v(()=>{try{Eo(t,I.call(t,i,t.state))}catch(g){L(o,"value",g)}},{depth:o.path.length,label:S(o,"value")});o.__effects.push(h),o.__exec.value=i}if(typeof t.style=="function"){const i=t.style,h=P(t,t.styleDeps,i);let g,f=null;const d=v(()=>{const p=h(t,t.state,t.context),u=vt(p);(u===null||u!==g||!Et(t.node,f))&&(g=u,Ls(t.node,f,p),J(t.node,p),f=kt(t.node,p))},{depth:o.path.length,label:S(o,"style")});o.__effects.push(d),o.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const h=t.style[i];if(typeof h!="function")continue;const g=P(t,yt(t.styleDeps,i),h);let f,d=null;const p=v(()=>{try{const u=g(t,t.state,t.context);if(t.node){const y=i+":"+String(u);if(y!==f||!Et(t.node,d)){f=y;const _={[i]:u};J(t.node,_),d=kt(t.node,_)}}}catch(u){L(o,"style."+i,u)}},{depth:o.path.length,label:S(o,"style."+i)});o.__effects.push(p)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const h=P(t,yt(t.attrDeps,i),t.attr[i]),g=i,f=v(()=>{try{let d=h(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=I.call(t,d,t.state)),t.node?.setAttribute&&(d==null||d===!1&&!ut(g)?t.node.removeAttribute(g):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(g,V(g,d)))}catch(d){L(o,"attr."+g,d)}},{depth:o.path.length,label:S(o,"attr."+g)});f._attrName=g.toLowerCase(),o.__effects.push(f)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const h=t.attr[i],g=i,f=v(()=>{try{const d=I.call(t,h,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(g,V(g,d??""))}catch(d){L(o,"attr."+g,d)}},{depth:o.path.length,label:S(o,"attr."+g)});f._attrName=g.toLowerCase(),o.__effects.push(f)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const h=t.aria[i];if(typeof h=="string"&&h.includes("{{")){const p=h,u="aria-"+i.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),y=v(()=>{try{const _=I.call(t,p,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,V(u,_??""))}catch(_){L(o,"aria."+i,_)}},{depth:o.path.length,label:S(o,"aria."+i)});y._attrName=u,o.__effects.push(y);continue}if(typeof h!="function")continue;const g=P(t,yt(t.ariaDeps,i),t.aria[i]),f="aria-"+i.replace(/[A-Z]/g,p=>"-"+p.toLowerCase()),d=v(()=>{try{const p=g(t,t.state,t.context);if(!t.node?.setAttribute)return;p==null?t.node.removeAttribute(f):typeof p!="function"&&typeof p!="object"&&t.node.setAttribute(f,V(f,p))}catch(p){L(o,"aria."+i,p)}},{depth:o.path.length,label:S(o,"aria."+i)});d._attrName=f,o.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const i in t.data){const h=t.data[i];if(typeof h=="string"&&h.includes("{{")){const u=h,y="data-"+i.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),_=v(()=>{try{const l=I.call(t,u,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,l??"")}catch(l){L(o,"data."+i,l)}},{depth:o.path.length,label:S(o,"data."+i)});_._attrName=y,o.__effects.push(_);continue}if(typeof h!="function")continue;const g=P(t,yt(t.dataDeps,i),t.data[i]),d="data-"+i.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),p=v(()=>{try{const u=g(t,t.state,t.context);if(!t.node?.setAttribute)return;u==null||u===!1?t.node.removeAttribute(d):typeof u!="function"&&typeof u!="object"&&t.node.setAttribute(d,u===!0?"":u)}catch(u){L(o,"data."+i,u)}},{depth:o.path.length,label:S(o,"data."+i)});p._attrName=d,o.__effects.push(p)}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 h=P(t,yt(t.classDeps,i),a[i]),g=v(()=>{try{const f=h(t,t.state,t.context);if(!t.node?.classList)return;typeof f=="string"?t.node.classList.add(f):f?t.node.classList.add(i):t.node.classList.remove(i)}catch(f){L(o,"class."+i,f)}},{depth:o.path.length,label:S(o,"class."+i)});o.__effects.push(g)}!n&&typeof t.if=="function"&&jo(t,o,t.if);for(const i of Object.keys(t)){if(W.has(i)||typeof t[i]!="function")continue;const h=i.charCodeAt(0);if(h>=65&&h<=90||Y(i))continue;const g=t[i];o.__exec[i]=g;const f=t.tag||"div";if(ft(f,i)&&!lt(f,i)){const d=at(i)||i,p=P(t,t[i+"Deps"],g),u=v(()=>{try{let y=p(t,t.state,t.context);typeof y=="string"&&y.includes("{{")&&(y=I.call(t,y,t.state)),t.node?.setAttribute&&(y==null||y===!1&&!ut(d)?t.node.removeAttribute(d):typeof y!="function"&&typeof y!="object"&&(d==="src"&&"src"in t.node?t.node.src=y:t.node.setAttribute(d,V(d,y))))}catch(y){L(o,i,y)}},{depth:o.path.length,label:S(o,i)});u._attrName=d.toLowerCase(),o.__effects.push(u)}}const r=t.tag||"div";for(const i of Object.keys(t)){if(W.has(i))continue;const h=t[i];if(typeof h!="string"||!h.includes("{{"))continue;const g=i.charCodeAt(0);if(g>=65&&g<=90||Y(i)||lt(r,i)||$t[i]||!ft(r,i))continue;const f=at(i)||i,d=v(()=>{try{const p=I.call(t,h,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(f,V(f,p??""))}catch(p){L(o,i,p)}},{depth:o.path.length,label:S(o,i)});d._attrName=f.toLowerCase(),o.__effects.push(d)}if(Fs(t),Bs(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,h=t.stateDeps;let g=!1,f=[];const d=v(()=>{const p=[];for(let l=0;l<h.length;l++){const b=h[l];try{p[l]=typeof b=="function"?b(t,t.state,t.context):t.state?.[b]}catch{p[l]=void 0}}if(!g){g=!0,f=p;return}let u=p.length!==f.length;for(let l=0;!u&&l<p.length;l++)p[l]!==f[l]&&(u=!0);const y=f;if(f=p,!u)return;const _=t.context?.designSystem;_&&N(_);try{i(t,t.state,t.context,{prev:y,next:p})}catch(l){if(t.context?.plugins?.length&&z("error",t,{hook:"onStateUpdate",error:l})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',l),t.context?.strictMode)throw l}finally{_&&F()}},{depth:o.path.length,label:S(o,"onStateUpdate")});o.__effects.push(d)}Us(t)}function ko(t){const s=t.parent,o=s?.node;if(!o||!t.node){Zo(t,t.parent);return}let n=null;const e=Object.keys(s),c=e.indexOf(t.key);for(let a=c+1;a<e.length;a++){const r=s[e[a]];if(r?.node?.parentNode===o){n=r.node;break}}n?o.insertBefore(t.node,n):o.appendChild(t.node)}function jo(t,s,o){const n=P(t,t.ifDeps,o),e=v(()=>{let c;try{c=n(t,t.state,t.context)}catch(r){if(c=!1,s.__ifError=r,typeof console<"u"&&console.warn){const i=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${i} \u2014 treating as false:`,r?.message||r)}return}const a=s.__if;if(s.__if=!!c,a&&!s.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(r){console.error("[smbls] onRemove error:",r)}}else if(!a&&s.__if)if(s.__ifInitialized)t.node||(t.node=Ft(t)),t.node&&(t.node.ref=t),ko(t),Vt(t),$("Render",t,{}),Bt(t,{});else{if(s.__ifInitialized=!0,t.tag||(t.tag=so(t)),$("Init",t,{}),t.node||(t.node=Ft(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"&&!s.__fragmentAnchor){const i=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(i),s.__fragmentAnchor=i}$("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Yo(t,{}),vo(t,{skipIfEffect:!0}),Vt(t),Bo(t),Wo(t),qo(t,{}),ko(t),$("Create",t,{}),$("Complete",t,{}),$("Render",t,{}),$("RenderRouter",t,{}),Bt(t,{})}},{depth:s.path.length,label:S(s,"if")});s.__effects.push(e)}function St(t,s){const o=t.node;if(!o)return;const n=s==null||typeof s=="object"?"":String(s);if(t.tag==="string"){o.nodeValue!==n&&(o.nodeValue=n);return}const e=t.__ref;let c=e?e.__textNode:null;if(c&&c.parentNode!==o&&(c=null),!c){const a=o.firstChild;a&&a.nodeType===3&&(c=a)}c?c.nodeValue!==n&&(c.nodeValue=n):o.firstChild?(c=(o.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),o.insertBefore(c,o.firstChild)):(o.textContent=n,c=o.firstChild&&o.firstChild.nodeType===3?o.firstChild:null),e&&(e.__textNode=c||null)}function Eo(t,s){const o=t.node;if(!o||!("value"in o))return;const n=s==null?"":String(s);if(o.value===n)return;const e=typeof document<"u"&&document.activeElement===o,c=e&&typeof o.selectionStart=="number"?o.selectionStart:null,a=e&&typeof o.selectionEnd=="number"?o.selectionEnd:null;if(o.value=n,e&&c!=null&&a!=null)try{o.setSelectionRange(c,a)}catch{}const r=t.__ref&&t.__ref.__autoGrow;r&&r.active&&r.resize()}function Vt(t){const{node:s}=t;if(s){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&St(t,t.text),Uo(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in s){const o=String(t.value);s.value!==o&&(s.value=o)}if(t.style&&typeof t.style=="object"){let o=t.style;for(const n in t.style)if(typeof t.style[n]=="function"){o={};for(const e in t.style)typeof t.style[e]!="function"&&(o[e]=t.style[e]);break}J(s,o)}if(t.attr&&typeof t.attr=="object")for(const o in t.attr){const n=t.attr[o];typeof n=="function"||typeof n=="object"||n!=null&&(typeof n=="string"&&n.includes("{{")||n===!1&&!ut(o)||s.setAttribute&&s.setAttribute(o,V(o,n)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&s.setAttribute&&s.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const o in t.data){const n=t.data[o];typeof n=="function"||typeof n=="object"||n==null||n===!1||typeof n=="string"&&n.includes("{{")||s.dataset&&(s.dataset[o]=n===!0?"":n)}if(t.classlist||t.class){const o=t.classlist||t.class;if(typeof o=="string")o.split(" ").forEach(n=>n&&s.classList.add(n));else if(typeof o=="object")for(const n in o){const e=typeof o[n]=="function"?o[n](t,t.state,t.context):o[n];e&&s.classList.add(typeof e=="string"?e:n)}}}}function vt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Ps(t){if(!t||typeof t!="object")return!1;for(const s in t){const o=t[s];if(o&&typeof o=="object"&&!Array.isArray(o))return!0}return!1}function kt(t,s){if(!t||!t.style||!s)return null;const o=t.style,n=[];for(const e in s){if(s[e]==null||e.charAt(0)==="&")continue;const a=jt(e);n.push(a,Kt(o,a),To(o,a))}return n}function Kt(t,s){return typeof t.getPropertyValue=="function"?t.getPropertyValue(s):""}function To(t,s){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(s):""}function jt(t){return Tt(t)?t:t.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())}function Ls(t,s,o){if(!t||!t.style||!s||!s.length)return;const n=t.style,e=new Set;if(o&&typeof o=="object")for(const c in o)o[c]==null||c.charAt(0)==="&"||e.add(jt(c));for(let c=0;c<s.length;c+=3){const a=s[c];e.has(a)||Kt(n,a)===s[c+1]&&typeof n.removeProperty=="function"&&n.removeProperty(a)}}function Et(t,s){if(!s||!t||!t.style)return!1;const o=t.style;for(let n=0;n<s.length;n+=3)if(Kt(o,s[n])!==s[n+1]||To(o,s[n])!==s[n+2])return!1;return!0}const Tt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function Os(t){let s=null;for(const o in t)t[o]!=null&&o.charAt(0)!=="&"&&(s||(s=new Set),s.add(jt(o)));return s}function Ds(t,s,o,n){const e=t.__ref;if(!e)return;let c=null;if(o)for(const a of o){if(n&&n.has(a))continue;const r=s[a];if(r==null||typeof r=="object")continue;const i=jt(a);uo[i]&&(c||(c={}),c[i]=r)}e.__declaredLonghands=c}function Po(t,s){const o=t.__ref,n=o&&o.__declaredLonghands;if(!n||!s)return null;let e=null;for(const c in n){if(s.has(c))continue;const a=uo[c];let r=!1;for(let i=0;i<a.length;i++)if(s.has(a[i])){r=!0;break}r&&(e||(e={}),e[c]=n[c])}return e}function Lo(t,s){const o=t.node;J(o,s);const n=Os(s);if(!n)return s;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=Po(t,n);return c?(J(o,c),Object.assign({},s,c)):s}function Rs(t){const s=t.__ref;if(!s||!s.__inlineCssKeys||!s.__declaredLonghands)return;const o=Po(t,s.__inlineCssKeys);o&&J(t.node,o)}function J(t,s){if(!t||!s||!t.style)return;let o=null;for(const n in s){const e=s[n];if(e!=null){if(n.charAt(0)==="&"&&typeof e=="object"){o||(o={}),o[n]=e;continue}try{const c=String(e),a=Tt(n)?n:n.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),r=c.trim(),i=/\s*!important\s*$/.test(r),h=r.replace(/\s*!important\s*$/,"");t.style.setProperty(a,h,i?"important":"")}catch{}}}o&&Ms(t,o)}function Ms(t,s){const o=`_ds${po.scopedStyleId++}`;t.classList.add(o);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 s){const r="."+o,i=a.replace(/&/g,r).split(",").map(g=>{const f=g.trim();return f.includes(r)?f:r+f}).join(", "),h=s[a];if(typeof h=="object"){let g="",f="";for(const d in h){const p=h[d];if(typeof p=="object"){const u=d.includes("&")?i.split(", ").map(_=>d.replace(/&/g,_)).join(", "):i.split(", ").map(_=>`${_} ${d}`).join(", ");let y="";for(const _ in p)y+=`${_.replace(/[A-Z]/g,l=>"-"+l.toLowerCase())}: ${p[_]};`;f+=ao(`${u} { ${y} }`,u)+`
5
+ `}else g+=`${d.replace(/[A-Z]/g,u=>"-"+u.toLowerCase())}: ${p};`}g&&(c+=ao(`${i} { ${g} }`,i)+`
6
+ `),f&&(c+=f)}}c&&(e.textContent+=c)}const Oo=new Set;function Do(t){if(!Array.isArray(t))return"";const s=[];for(let o=0;o<t.length;o++)typeof t[o]=="string"&&t[o].length&&s.push(t[o]);return s.sort(),s.join("|")}function Ns(t,s,o){const n=Do(o);queueMicrotask(()=>{if(!t.__ref)return;let e;try{e=s(t,t.state,t.context)}catch{return}if(Do(e)===n)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";Oo.has(c)||(Oo.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${o.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 Fs(t){const s=t.subscribeTo,o=typeof s=="function";let n=s;if(o)try{n=s(t,t.state,t.context)}catch{n=null}if(o&&tt()&&Ns(t,s,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],h=r.slice(1),g={value:!1},f=v(()=>{const d=t.state&&(q(t.state)?t.state.root:null);if(!d||!q(d))return;let p=d;p=p[i];for(let y=0;y<h.length&&!(p==null||typeof p!="object");y++)if(q(p))p=p[h[y]];else break;if(!g.value)return;let u=!1;if(typeof t.onBeforeUpdate=="function"){const y=t.context?.designSystem;y&&N(y);try{if(Zs(e)){const _=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});_&&typeof _.then=="function"?_.then(()=>Ot(e,!1),l=>{Ot(e,!0),t.context?.plugins?.length&&z("error",t,{hook:"onBeforeUpdate",error:l})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",l)}):(Ot(e,!1),_===!1&&(u=!0))}}catch(_){Ot(e,!0),t.context?.plugins?.length&&z("error",t,{hook:"onBeforeUpdate",error:_})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",_)}finally{y&&F()}}if(!u&&t.node&&e.__effects)for(let y=0;y<e.__effects.length;y++){const _=e.__effects[y];_&&_!==f&&!_._disposed&&!_._isSubscribeToEffect&&typeof _._execute=="function"&&_._execute()}if(!u&&typeof t.onUpdate=="function"){const y=t.context?.designSystem;y&&N(y);try{t.onUpdate(t,t.state,t.context)}catch(_){t.context?.plugins?.length&&z("error",t,{hook:"onUpdate",error:_})||console.error("[DOMQL] subscribeTo onUpdate error:",_)}finally{y&&F()}}},{depth:e.path.length,label:S(e,"subscribeTo("+a+")")});g.value=!0,f._isSubscribeToEffect=!0,e.__effects.push(f)}}function Wt(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}function zt(t,s){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const o=s.context?.designSystem?.media?.[t.slice(1)];return o?/^@(media|supports|container)\b/.test(o)?o:`@media ${o}`:t}const Ro=new Set;function $s(t,s){const o=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",n=o+"::"+t;Ro.has(n)||(Ro.add(n),console.warn(`[smbls/css] "${t}" at ${o} 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.`))}function et(t,s,o,n){const e={},c=new Set,a=(r,i,h)=>{const g=h?new Set(Object.keys(e)):null;if(R[r]){const f=R[r](i,s,s.state,s.context);if(f){const d=Array.isArray(f)?f:[f];for(const p of d)p&&Object.assign(e,p)}}else e[r]=i;if(h)for(const f in e)g.has(f)||c.add(f)};for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let i=t[r];if(typeof i=="function"&&(i=i(s,s.state,s.context)),i==null||typeof i=="function")continue;if(typeof i=="object"&&!Array.isArray(i)){if(r==="style"){for(const p in i){let u=i[p];if(typeof u=="function"&&(u=u(s,s.state,s.context)),u==null||typeof u=="function")continue;const y=typeof s[p]=="function"&&(R[p]||M&&M.has(p))||!!(n&&n.has(p));a(p,u,y)}continue}if(Wt(r,s)){const p=et(i,s,!1,n);Object.keys(p).length&&(e[`[data-theme="${r.slice(1)}"] &`]=p);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(r)){tt()&&$s(r,s);continue}const f=zt(r,s),d=et(i,s,!1,n);Object.keys(d).length&&(e[f]=d);continue}const h=typeof s[r]=="function"&&(R[r]||M&&M.has(r)),g=!!(n&&n.has(r));a(r,i,h||g)}if(o)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 Pt=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function Mo(t,s){for(const o in s){const n=s[o];t[o]=Pt(n)?Mo(Pt(t[o])?t[o]:{},n):n}return t}function Is(t,s){if(!Pt(s))return;let o;for(const n of t.split(" ")){const e=n?s[n]:null;Pt(e)&&(o=Mo(o||{},e))}return o}function Yt(t,s){if(s===void 0&&(s=0),s>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&Yt(t[o],s+1))return!0}return!1}function No(t,s,o){if(!s||typeof s!="object"||Array.isArray(s))return null;if(Wt(t,o)){const c=et(s,o,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const n=zt(t,o),e=et(s,o,!1);return Object.keys(e).length?{cssProp:n,block:e}:null}function Us(t){const s=t.__ref;for(const o of Object.keys(t)){if(!Gt(o))continue;const n=t[o];if(!n||typeof n!="object"||Array.isArray(n)||!Yt(n))continue;let e=null,c;const a=v(()=>{if(!t.node)return;const r=t.context?.designSystem;r&&N(r);let i,h=!1;try{const g=No(o,n,t),f=g?vt(g.block)+"::"+g.cssProp:null;if(f!==null&&f===c)h=!0;else if(c=f,g){const d=ct({[g.cssProp]:g.block},null,t.context?.cssPrefix);i=d?d.split(" ").filter(Boolean):null}else i=null}finally{r&&F()}if(!(h||!t.node.classList)){if(e)for(const g of e)t.node.classList.remove(g);if(i&&i.length)for(const g of i)t.node.classList.add(g);e=i}},{depth:s.path.length,label:S(s,"cssBlock("+o+")")});s.__effects.push(a)}}function Bs(t){const s=t.__ref;s.__conditionalRunners=[];const o=new Map;for(const n of Object.keys(t)){const e=n.charAt(0);if(e!=="."&&e!=="!")continue;const c=n.slice(1);if(!c)continue;if(/[:@\s>~+[\]]/.test(c)){if(typeof console<"u"&&console.warn){const u=c.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${e}\` is read as one prop name. Nest the selector inside instead: \`${e}${u}: { '${c.slice(u.length)}': {...} }\`.`)}continue}const a=t[n];if(!a||typeof a!="object")continue;const r=e==="!",i={lastMatch:!1,appliedKeys:null,appliedClasses:null},h=new Set;for(const u in a){if(!Object.prototype.hasOwnProperty.call(a,u))continue;const y=u.charAt(0),_=a[u];(y===":"||y==="@"||y==="&"||y==="[")&&_&&typeof _=="object"&&!Array.isArray(_)||h.add(u)}const g=()=>{let u;const y=t[c];if(y===void 0){const b=!!t.state&&c in t.state,A=t.state?t.state[c]:void 0;if(b||A!==void 0)u=A;else{const w=t.context?.cases?.[c];if(w===void 0)return;try{u=typeof w=="function"?w.call(t,t):w}catch(x){u=!1,s.__conditionalError=x,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,x?.message||x)}}}else if(typeof y=="function")try{u=y(t,t.state,t.context)}catch(b){u=!1,s.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}else u=y;const _=r?!u:!!u;if(!t.node||_===i.lastMatch)return;i.lastMatch=_;const l=t.context?.designSystem;l&&N(l);try{if(_){const b={},A={};let w=!1;for(const C in a){if(!Object.prototype.hasOwnProperty.call(a,C))continue;const E=a[C],U=C.charAt(0);if((U===":"||U==="@"||U==="&"||U==="[")&&E&&typeof E=="object"&&!Array.isArray(E)){if(Wt(C,t)){const T=et(E,t,!1,h);Object.keys(T).length&&(A[`[data-theme="${C.slice(1)}"] &`]=T,w=!0)}else{const T=zt(C,t),Q=et(E,t,!1,h);Object.keys(Q).length&&(A[T]=Q,w=!0)}continue}const O=typeof E=="function"?E(t,t.state,t.context):E;if(O!=null)if(R[C]){const T=R[C](O,t,t.state,t.context);if(T){const Q=Array.isArray(T)?T:[T];for(const bt of Q)bt&&Object.assign(b,bt)}}else(M&&M.has(C)||Tt(C))&&(b[C]=O)}const x=Object.keys(b);if(x.length){J(t.node,b);for(const C of x)o.set(C,n);i.appliedKeys=x}else i.appliedKeys=null;if(w){const C=ct(A,null,t.context?.cssPrefix,{state:!0}),E=C?C.split(" ").filter(Boolean):[];if(E.length&&t.node.classList){for(const U of E)t.node.classList.add(U);i.appliedClasses=E}else i.appliedClasses=null}else if(i.appliedClasses){for(const C of i.appliedClasses)t.node.classList.remove(C);i.appliedClasses=null}}else{if(i.appliedKeys){for(const b of i.appliedKeys)o.get(b)===n&&(Tt(b)?t.node.style.removeProperty(b):t.node.style[b]="",o.delete(b));i.appliedKeys=null}if(i.appliedClasses){for(const b of i.appliedClasses)t.node.classList.remove(b);i.appliedClasses=null}}}finally{l&&F()}};s.__conditionalRunners.push(g);const f=P(t,t[c+"Deps"],g),d=v(f,{depth:s.path.length,label:S(s,"conditional("+n+")")}),p=s.__exec&&s.__exec[c]||t[c];d._sources.size===0&&typeof p=="function"&&tt()&&console.warn(`[smbls] conditional \`${n}\` 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 \`${c}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),s.__effects.push(d)}}const qt=new WeakSet;function Gs(t){const s=t.ownerDocument;!s||qt.has(s)||(qt.add(s),queueMicrotask(()=>{qt.delete(s);const o=s.body||s.documentElement;o&&o.offsetWidth}))}const Zt=new WeakSet;let Fo=!1;function $o(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Qt(t,s){const o={...t};for(const n in s){const e=s[n],c=o[n];o[n]=e&&typeof e=="object"&&c&&typeof c=="object"?Qt(c,e):e}return o}function Io(t,s){const o={};for(const n in t){const e=t[n];if(e&&typeof e=="object"){const c=Io(e,s);Object.keys(c).length&&(o[n]=c)}else s.has(n)||(o[n]=e)}return o}function Uo(t){const{node:s}=t;if(!s)return;if(Fo||(Fo=!0,ct({display:"none"})),Zt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Zt.add(t);const o=t.context?.designSystem;o&&N(o),co();try{const n={};let e=!1,c=[],a=null,r=null,i=null;const h=(u,y)=>{if(y&&typeof y=="object"&&$o(u)){r||(r={});const _=r[u];_&&(y=Qt(_,y)),r[u]=y}else(y===null||typeof y!="object")&&(i||(i=new Set),i.add(u));n[u]=y};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&R.theme){const u=R.theme(t.theme,t,t.state,t.context);if(u){const y=_=>{for(const l in _){const b=_[l];b&&typeof b=="object"&&$o(l)&&(a||(a={}),a[l]=b),n[l]=b}};if(Array.isArray(u))for(const _ of u)_&&y(_);else y(u);e=!0}}const g=(u,y)=>{if(R[u]){const _=R[u](y,t,t.state,t.context);if(_){if(Array.isArray(_)){for(const l of _)if(l)for(const b in l)h(b,l[b])}else for(const l in _)h(l,_[l]);e=!0}}else if(M&&M.has(u))y!=null&&typeof y!="object"&&(h(u,y),e=!0);else if(u.charCodeAt(0)===45)y!=null&&typeof y!="object"&&(h(u,y),e=!0);else if((u.charAt(0)==="&"||u.charAt(0)==="@"||u.charAt(0)===":"||u.charAt(0)==="[")&&y&&typeof y=="object"&&!Array.isArray(y)){if(Yt(y))return;const _=No(u,y,t);_&&(h(_.cssProp,_.block),e=!0)}};if(typeof t.class=="string"){const u=Is(t.class,t.context?.designSystem?.class);if(u)for(const y in u)g(y,u[y])}const f=i?new Set(i):null,d=t.tag||"div";for(const u of Object.keys(t)){if(typeof t[u]=="function"||W.has(u)||u==="theme")continue;const y=u.charCodeAt(0);y>=65&&y<=90||Y(u)||lo(d,u)||g(u,t[u])}if(a)for(const u in a){let y=i?Io(a[u],i):a[u];r&&r[u]&&(y=Qt(y,r[u])),Object.keys(y).length?n[u]=y:delete n[u]}if(Ds(t,n,i,f),e){n.display&&String(n.display).includes("!important")&&(s.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const u=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof u=="string"&&u!==""&&n.display&&n.display!==u&&(n.display=u);const y=ct(n,null,t.context?.cssPrefix);if(c=y?y.split(" ").filter(Boolean):[],y&&s.classList){const _=c;let l=!1;for(const b of _)s.classList.add(b),l||(b.charCodeAt(0)===95&&b.charCodeAt(1)===99||b.charCodeAt(0)===95&&b.indexOf("_c",1)!==-1)&&(l=!0);l&&Gs(s)}}const p=t.__ref;if(p){const u=p.__staticCssClasses;if(u&&s.classList){const y=new Set(c);for(const _ of u)y.has(_)||s.classList.remove(_)}p.__staticCssClasses=c}Rs(t)}finally{fo(),o&&F(),Zt.delete(t)}}const we=t=>!!R[t]||!!(M&&M.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function Ce(t){t&&t.node&&Uo(t)}function Bo(t){const{node:s}=t;if(!s||!s.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());s.setAttribute(a,V(a,c))}const o=as(t);for(const e in o){const c=o[e];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&s.setAttribute(e,c===!0?"":c)}const n=t.tag||"div";for(const e of Object.keys(t)){if(typeof t[e]=="function"||W.has(e)||e==="on"||o[e]!==void 0)continue;const c=e.charCodeAt(0);if(!(c>=65&&c<=90)&&!Y(e)&&!lt(n,e)&&ft(n,e)){let a=t[e];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!$t[e])continue;a=I.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!ut(at(e)||e))continue;const r=at(e)||e;s.setAttribute(r,V(r,a))}}}function Se(t,s){const{node:o}=t;if(!o||!o.setAttribute)return;const n=s.charCodeAt(0);if(n>=65&&n<=90||Y(s))return;const e=t.tag||"div";if(lt(e,s)||!ft(e,s))return;const c=at(s)||s,a=c.toLowerCase(),r=t.__ref&&t.__ref.__effects;let i=!1;if(r)for(let f=0;f<r.length;f++){const d=r[f];d&&d._attrName===a&&!d._disposed&&typeof d._execute=="function"&&(i=!0,d._execute())}if(i)return;let h=t[s];const g=$t[s];if(g&&h!=null){const f=g(t);f!==void 0&&(h=f)}typeof h=="string"&&h.includes("{{")&&(h=I.call(t,h,t.state)),h==null||h===!1&&!ut(c)?o.removeAttribute(c):typeof h!="function"&&typeof h!="object"&&o.setAttribute(c,V(c,h))}function Hs(t,s){const o=t.node,n=t.__ref;let e=n.__autoGrow;if(!s){if(e&&e.active){try{o.removeEventListener("input",e.resize)}catch{}Ho(e),X.delete(t),o.style.height="",e.appliedMax!=null&&o.style.maxHeight===e.appliedMax&&(o.style.maxHeight=""),Vo(o,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(!o.isConnected){_t(t,!0);return}if(!(o.scrollHeight>0)){e.awaitingLayout=!0,Go(t,e);return}e.awaitingLayout=!1;const a=o.style.height;o.style.height="0px";const r=o.scrollHeight;if(!(r>0)){o.style.height=a;return}const i=Ws(o),h=i!=null&&r>i;o.style.height=(h?i:r)+"px",Vo(o,e,h),e.lastMeasure=r,e.lastWidth=o.clientWidth,Go(t,e)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{o.removeEventListener("input",e.resize)}catch{}Ho(e),X.delete(t)})),e.active||(o.addEventListener("input",e.resize),e.active=!0,Ks(t,e));const c=typeof s=="object"&&s.max!=null?String(s.max):null;c!==e.appliedMax&&(c==null?e.appliedMax!=null&&o.style.maxHeight===e.appliedMax&&(o.style.maxHeight=""):o.style.maxHeight=c,e.appliedMax=c),e.resize()}function _t(t,s){const o=t.__ref?.__autoGrow;o&&(s&&(o.attachAttempts=0,o.firstAttemptAt=null),X.add(t),wt())}function Vs(){const t=Array.from(X);X.clear();for(let s=0;s<t.length;s++){const o=t[s],n=o.node,e=o.__ref?.__autoGrow;if(!(!n||!e||!e.active)){if(!n.isConnected){e.firstAttemptAt==null&&(e.firstAttemptAt=st()),e.attachAttempts+=1,e.attachAttempts<=_o&&st()-e.firstAttemptAt<go&&(X.add(o),wt());continue}e.attachAttempts=0,e.firstAttemptAt=null,e.resize()}}}function Go(t,s){if(s.watch)return;const o=t.node;if(!o)return;const n=o.ownerDocument&&o.ownerDocument.defaultView,e=n&&n.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof e!="function")return;const c=()=>{if(!s.active||!o.isConnected||!(o.scrollHeight>0))return;if(s.awaitingLayout){s.awaitingLayout=!1,_t(t,!0);return}const r=o.clientWidth;s.lastWidth!=null&&Math.abs(r-s.lastWidth)<.5||(s.lastWidth=r,_t(t,!0))};let a;try{a=new e(c),a.observe(o)}catch{return}s.watch=a}function Ho(t){const s=t.watch;if(s){t.watch=null;try{s.disconnect()}catch{}}}function Ks(t,s){if(s.fontsHooked)return;s.fontsHooked=!0;const o=t.node&&t.node.ownerDocument,n=o&&o.fonts&&o.fonts.ready;!n||typeof n.then!="function"||n.then(()=>{s.active&&t.node&&_t(t,!0)},()=>{})}function Ws(t){const s=t.ownerDocument&&t.ownerDocument.defaultView;let o;try{o=s&&s.getComputedStyle?s.getComputedStyle(t):null}catch{o=null}if(!o)return null;const n=g=>typeof g=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(g)?parseFloat(g):null,e=n(o.maxHeight);if(e==null||!(e>0))return null;const c=(n(o.paddingTop)||0)+(n(o.paddingBottom)||0),a=(n(o.borderTopWidth)||0)+(n(o.borderBottomWidth)||0),r=o.boxSizing==="border-box"?e-a:e+c,i=n(o.lineHeight);if(!(i>0))return r;const h=Math.floor((r-c)/i+1e-6);return h>=1?h*i+c:r}function Vo(t,s,o){o?s.appliedScroll||(t.style.overflowY="auto",s.appliedScroll=!0):s.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),s.appliedScroll=!1)}const Ko=["srcObject","muted"],zs=(t,s)=>t==="muted"?s===!0||s===""||s==="true"||s==="muted":s??null;function Ys(t){const s=t.node,o=t.__ref;if(!(!s||!o))for(let n=0;n<Ko.length;n++){const e=Ko[n],c=t[e];if(c===void 0||!(e in s))continue;const a=r=>{const i=zs(e,r);if(s[e]!==i)try{s[e]=i}catch(h){L(o,e,h)}};if(typeof c=="function"){const r=P(t,t[e+"Deps"],c),i=v(()=>{try{a(r(t,t.state,t.context))}catch(h){L(o,e,h)}},{depth:o.path.length,label:S(o,e)});o.__effects.push(i),o.__exec[e]=c}else a(c);e==="srcObject"&&(o.__releaseMedia=()=>{try{s.srcObject!=null&&(s.srcObject=null)}catch{}})}}function Wo(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const o=t.__ref,n=t.autoGrow,e=typeof n=="function"?P(t,t.autoGrowDeps,n):null,c=v(()=>{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}Hs(t,r)},{depth:o.path.length,label:S(o,"autoGrow")});o.__effects||(o.__effects=[]),o.__effects.push(c),e&&(o.__exec.autoGrow=n)}const zo=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Yo(t,s){for(const o of Object.keys(t)){if(!Y(o)||zo.has(o))continue;const n=ns(o);if(n){es(n,t,t[o]);continue}let e=t[o];if(typeof e=="string"&&/^[A-Za-z_$][\w$]*$/.test(e)){const a=e;e=function(i){return t.call(a,i)}}if(typeof e!="function")continue;const c=_s(o);os.has(c)||ss(gs(c),t,e)}qs(t)}function qs(t){const s=t.node;if(!s||!s.addEventListener)return;const o={};let n=!1;for(const d of zo){const p=t[d];typeof p=="function"&&(o[d]=p,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,h=!1;const g=d=>{const p=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];p&&(a=p.clientX,r=p.clientY,i=Date.now(),h=!0)},f=d=>{if(!h)return;h=!1;const p=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!p)return;const u=p.clientX-a,y=p.clientY-r,_=Date.now()-i;if(_>c)return;const l=Math.abs(u),b=Math.abs(y);if(Math.max(l,b)<e)return;let A;if(l>b*1.2)A=u<0?"left":"right";else if(b>l*1.2)A=y<0?"up":"down";else return;const w="onSwipe"+A.charAt(0).toUpperCase()+A.slice(1),x=o[w],C=o.onSwipe;x&&x.call(t,d,t,t.state,t.context),C&&C.call(t,{direction:A,dx:u,dy:y,dt:_,event:d},t,t.state,t.context)};s.addEventListener("touchstart",g,{passive:!0}),s.addEventListener("touchend",f,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",g)}catch{}try{s.removeEventListener("touchend",f)}catch{}})}function gt(t,s){const o={...t};for(const n in s){const e=o[n],c=s[n];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?o[n]=gt(e,c):o[n]=c}return o}function Xt(t,s,o,n){if(!s||!t.node)return;const e=t.childExtends;if(Array.isArray(s)){const c=t.tag==="fragment",a=t.context?.document||globalThis.document,r=c?null:a?.createDocumentFragment();if(!c&&!r)return;const i=t.childProps,h=t.childrenAs,g=_=>{let l=s[_];const b=l;(typeof l=="string"||typeof l=="number")&&(l={text:l});let A=i;if(typeof i=="function")try{A=i(t,l)}catch{A=null}if(h==="state"){let x=b;(typeof b=="string"||typeof b=="number")&&(x={value:b,text:b}),l=A?{...A,state:x}:{state:x}}else A&&(l=gt(A,l));if(e&&!l.ignoreChildExtends)if(l.extends){const x=Array.isArray(l.extends)?l.extends:[l.extends],C=Array.isArray(e)?e:[e];l={...l,extends:[...C,...x]}}else l={...l,extends:e};const w=Ao(l?.key,b,_);try{return Z(l,t,w,o)}catch(x){if(typeof console<"u"&&console.error){const C=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${w}" failed to construct at ${C} (initial render, skipping this row):`,x?.message||x)}return null}},f=t.__ref;if(!(n===!0&&!c&&!!f&&(o?.mountYield===!0||t.yieldChildren===!0))){for(let _=0;_<s.length;_++){const l=g(_);!c&&l?.node&&r.appendChild(l.node)}return c||t.node.appendChild(r),!0}const p=f.__childrenChunkGen=(f.__childrenChunkGen||0)+1;no();let u=null;const y=_=>{if(f.__disposed||f.__childrenChunkGen!==p){u&&u.parentNode&&u.remove();return}for(let l=_;l<s.length;l++){const b=g(l);if(b?.node&&(u?t.node.insertBefore(b.node,u):r.appendChild(b.node)),l+1<s.length&&eo()){u||(u=a.createComment("smbls-mount"),r.appendChild(u),t.node.appendChild(r));const A=l+1;io(()=>y(A));return}}u?(u.remove(),t.node.tagName==="SELECT"&&Lt(t,!0)):t.node.appendChild(r)};return y(0),ro(),!0}if(typeof s=="string"){const c=xo(s,t);if(Array.isArray(c))return Xt(t,c,o,n)}if(typeof s=="object")for(const c in s){if(W.has(c))continue;let a=s[c];if(!(a==null||a===!1)){if((typeof a=="string"||typeof a=="number")&&(a={text:a}),t.childProps&&(a=gt(t.childProps,a)),e&&!a.ignoreChildExtends)if(a.extends){const r=Array.isArray(a.extends)?a.extends:[a.extends],i=Array.isArray(e)?e:[e];a={...a,extends:[...i,...r]}}else a={...a,extends:e};Z(a,t,c,o)}}}function Lt(t,s){const o=t.node;if(!o||o.tagName!=="SELECT")return;const n=o.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 g;if(a)try{g=c(t,t.state,t.context)}catch{return}else g=t.value,typeof g=="string"&&g.includes("{{")&&(g=I.call(t,g,t.state));const f=g==null?"":String(g);o.value!==f&&(o.value=f);return}const i=s||!(e&&e.__selectSynced);if(e&&(e.__selectSynced=!0),!i)return;let h=-1;for(let g=0;g<n.length;g++)n[g].defaultSelected&&(h=g);h>=0&&o.selectedIndex!==h&&(o.selectedIndex=h)}function qo(t,s){let{children:o,content:n}=t;const e=t.childExtends;if(typeof o=="function"){const f=o;try{o=f(t,t.state,t.context)}catch(_){if(o=void 0,typeof console<"u"&&console.error){const l=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${l} (initial run, treating as empty):`,_?.message||_)}}t.children=o;const d=t.__ref;let p=!1;const u=P(t,t.childrenDeps,f),y=v(()=>{const _=p;p=!0;let l;try{l=u(t,t.state,t.context)}catch(O){if(typeof console<"u"&&console.error){const T=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${T}${_?"":" (initial tracking run)"}:`,O?.message||O)}return}if(!_||l===t.children)return;t.children=l,d.__childrenChunkGen!=null&&d.__childrenChunkGen++;const b=typeof t.onContentUpdate=="function",A=b?[]:null,w=b?[]:null,x=b?[]:null;if(Array.isArray(l)&&t.childrenAs==="state"){const O=t.childProps,T=[],Q=new Map;for(let k=0;k<l.length;k++){const G=l[k];let j=O;if(typeof O=="function")try{j=O(t,G)}catch{j=null}const K=Ao(j&&j.key,G,k);T.push(K),Q.set(K,{rawChild:G,childProps:j})}const bt=new Set(T),Qo=d.__children.slice();for(const k of Qo)if(!bt.has(k)){const G=t[k];G?.remove&&G.remove(),delete t[k],w&&w.push(k)}const nt=t.childExtends,At=t.tag==="fragment",Xo=t.context?.document||globalThis.document,rt=At?null:Xo?.createDocumentFragment(),Dt=new Set;for(const k of T){const G=Q.get(k),j=G.rawChild,K=t[k];if(K&&K.state){if(j&&typeof j=="object"){const D=K.state,m=D.$replace||D.replace,to=D.$update||D.update;try{if(typeof m=="function")m.call(D,j);else if(typeof to=="function"){for(const B in D)if(!(B==="__element"||B==="root"||B==="parent"||B==="update")&&!Object.prototype.hasOwnProperty.call(j,B))try{D[B]=void 0}catch{}to.call(D,j)}else for(const B in j)D[B]=j[B]}catch(B){if(typeof console<"u"&&console.error){const Jo=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to patch at ${Jo} (reconcile, keeping its previous data for this pass):`,B?.message||B)}}}x&&x.push(k);continue}let Rt=j;(typeof j=="string"||typeof j=="number")&&(Rt={value:j,text:j});const mt=G.childProps;let H=mt?{...mt,state:Rt}:{state:Rt};if(nt&&!H.ignoreChildExtends)if(H.extends){const D=Array.isArray(H.extends)?H.extends:[H.extends],m=Array.isArray(nt)?nt:[nt];H={...H,extends:[...m,...D]}}else H={...H,extends:nt};let Mt;try{Mt=Z(H,t,k,s)}catch(D){if(typeof console<"u"&&console.error){const m=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${m} (reconcile, skipping this row):`,D?.message||D)}Dt.add(k);continue}!At&&Mt?.node&&rt&&rt.appendChild(Mt.node),A&&A.push(k)}if(!At&&rt&&rt.childNodes.length&&t.node&&t.node.appendChild(rt),!At&&t.node){let k=null;for(const G of T){const j=t[G]?.node;if(!j)continue;const K=k?k.nextSibling:t.node.firstChild;j!==K&&t.node.insertBefore(j,K),k=j}}d.__children=Dt.size?T.filter(k=>!Dt.has(k)):T,b&&(A.length||w.length)&&bo(t,{added:A,removed:w,kept:x}),Lt(t,!1);return}const U=b?[...d.__children]:null;for(const O of[...d.__children]){const T=t[O];T?.remove&&T.remove(),delete t[O]}d.__children=[],Xt(t,l,s),Lt(t,!1),b&&bo(t,{added:[...d.__children],removed:U,kept:[]})},{depth:d.path.length,label:S(d,"children")});d.__effects.push(y)}const c=Xt(t,o,s,!0);if(n!=null&&!(n&&n.__ref)){let f=n;if(typeof f=="string"||typeof f=="number"?f={text:f}:typeof f!="object"&&(f={}),t.childProps&&(f=gt(t.childProps,f)),e&&!f.ignoreChildExtends)if(f.extends){const d=Array.isArray(f.extends)?f.extends:[f.extends],p=Array.isArray(e)?e:[e];f={...f,extends:[...p,...d]}}else f={...f,extends:e};Z(f,t,"content",s)}if(o&&!c)return;const a=t.context?.components||{};{const f=Object.keys(t);for(let d=0;d<f.length;d++){const p=f[d];if(!p.endsWith("Extends")||typeof t[p]!="string")continue;const u=p.slice(0,-7);if(!u||u.charCodeAt(0)<65||u.charCodeAt(0)>90)continue;const y={extends:t[p]};delete t[p];for(let _=d+1;_<f.length;_++){const l=f[_],b=l.charCodeAt(0);if(b>=65&&b<=90||W.has(l)||typeof t[l]=="function"&&(l.startsWith("on")||l.startsWith(".")))break;const A=t[l];A!==void 0&&(y[l]=A,delete t[l])}t[u]&&typeof t[u]=="object"?t[u]={...y,...t[u]}:t[u]=y}}const r=s?.mountYield===!0||t.yieldChildren===!0,i=Object.keys(t),h=f=>{if(W.has(f)||typeof t[f]!="object"||t[f]===null)return;const d=f.charCodeAt(0);if(d<65||d>90)return;let p=t[f];if(!p.__ref){if(!p.extends&&!p.extend){const u=a[f]||a[`smbls.${f}`];u&&(p={...p,extends:u})}if(t.childProps&&(p=gt(t.childProps,p)),e&&!p.ignoreChildExtends)if(p.extends){const u=Array.isArray(p.extends)?p.extends:[p.extends],y=Array.isArray(e)?e:[e];p={...p,extends:[...y,...u]}}else p={...p,extends:e};Z(p,t,f,s)}};if(!r){for(const f of i)h(f);return}no();const g=f=>{for(let d=f;d<i.length;d++)if(h(i[d]),d+1<i.length&&eo()){const p=d+1;io(()=>g(p));return}};g(0),ro()}function Zo(t,s,o){const{node:n}=t;if(!n)return;n.ref=t;const e=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(e){const a=e.parentNode;if(a){if(o?.position==="before"&&o.node)a.insertBefore(n,o.node);else if(o?.position==="after"&&o.node){const r=o.node.nextSibling;a.insertBefore(n,r||e)}else a.insertBefore(n,e);return}}const c=s?.node||(s?.nodeType?s:null);if(c)if(o?.position==="before"&&o.node)c.insertBefore(n,o.node);else if(o?.position==="after"&&o.node){const a=o.node.nextSibling;a?c.insertBefore(n,a):c.appendChild(n)}else c.appendChild(n)}const Jt=3;function Zs(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Jt?!1:(t.__inBeforeUpdate=!0,!0)}function Ot(t,s){t&&(t.__inBeforeUpdate=!1,s?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Jt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Jt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function $(t,s,o){const n=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&z(n,s,o);const e="on"+t,c=s[e];if(typeof c=="function"){const i=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(i){if(s.__ref[i])return!0;s.__ref[i]=!0}const h=s.context?.designSystem;h&&N(h);let g=!!i;try{const f=c(s,s.state,s.context,o);if(f&&typeof f.then=="function"){const d=s.__ref;return f.catch(p=>{s.context?.plugins?.length&&z("error",s,{hook:e,error:p})||console.error(`[DOMQL] Lifecycle "${e}" error:`,p)}).finally(()=>{i&&d&&(d[i]=!1)}),g=!1,!0}if(f===!1)return!1}catch(f){if(s.context?.plugins?.length&&z("error",s,{hook:e,error:f})||console.error(`[DOMQL] Lifecycle "${e}" error:`,f),s.context?.strictMode)throw f}finally{h&&F(),g&&s.__ref&&(s.__ref[i]=!1)}}return!0}var ve=Z;export{Jt as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,Zs as acquireBeforeUpdateGuard,Z as create,ve as default,Ut as flushMounts,we as isStaticCssProp,Ce as recompileStaticCss,Se as reconcileAttrProp,Ot as releaseBeforeUpdateGuard,St as writeElementText};
@@ -1 +1 @@
1
- function n(r){if(!r)return;const _=r.__ref;if(!_)return;_.__disposed=!0;try{typeof r.onBeforeRemove=="function"&&r.onBeforeRemove(r,r.state,r.context)}catch(o){console.error("[smbls] onBeforeRemove error:",o)}if(_.__effects){for(let o=0;o<_.__effects.length;o++)_.__effects[o].dispose();_.__effects.length=0}if(_.__eventCleanup){for(let o=0;o<_.__eventCleanup.length;o++)_.__eventCleanup[o]();_.__eventCleanup.length=0}if(_.__children){const o=_.__children.slice();_.__children.length=0;for(let f=0;f<o.length;f++){const t=r[o[f]];t&&t.__ref&&n(t)}}r.node?.parentNode?r.node.remove():r.tag==="fragment"&&_.__fragmentAnchor?.parentNode&&_.__fragmentAnchor.remove();const e=r.state?.$destroy||r.state?.destroy;if(typeof e=="function"&&r.state.__element===r&&e.call(r.state),r.parent?.__ref?.__children){const o=r.parent.__ref.__children.indexOf(r.key);o!==-1&&r.parent.__ref.__children.splice(o,1),delete r.parent[r.key]}try{typeof r.onRemove=="function"&&r.onRemove(r)}catch(o){console.error("[smbls] onRemove error:",o)}r.node=null,r.parent=null,r.__ref=null}function i(){n(this)}export{n as dispose,i as remove};
1
+ import{getObserver as c,setObserver as s}from"@symbo.ls/signal";function t(r){if(!r)return;const o=r.__ref;if(!o)return;const i=c();if(i){s(null);try{return t(r)}finally{s(i)}}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.__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 f=r[e[_]];f&&f.__ref&&t(f)}}r.node?.parentNode?r.node.remove():r.tag==="fragment"&&o.__fragmentAnchor?.parentNode&&o.__fragmentAnchor.remove();const n=r.state?.$destroy||r.state?.destroy;if(typeof n=="function"&&r.state.__element===r&&n.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 d(){t(this)}export{t as dispose,d as remove};
@@ -1 +1 @@
1
- const e=new Set(["extends","children","content","childrenAs","childExtends","childExtendsRecursive","childProps","inheritParentProps","state","if","define","deps","tag","attr","style","text","html","value","data","classlist","class","scope","root","context","$router","routes","fetch","variables","query","key","component","preventContentUpdate","preventContentRecreate","subscribeTo","autoGrow","allowRuntimeTemplates","__name","__ref","__hash","__text","parent","node"]),t={text:"text",html:"html",style:"style",attr:"attr",data:"data",classlist:"classlist",state:"state",scope:"scope"},o=new Set(["start","init","complete","attachNode","stateInit","stateCreated","beforeUpdate","update","afterUpdate","beforeClassAssign","lazyLoad","render","renderRouter","done","create","frame","mounted","contentUpdate","startUpdate","stateUpdate","beforeStateUpdate","initInspect","initSync","beforeRemove","remove"]),a=new Set(["load","error","abort","scroll","canplay","canplaythrough","ended","pause","play","playing","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","durationchange","loadeddata","loadedmetadata","progress","emptied","resize"]),r=new Set(["wheel","mousewheel","touchstart","touchmove","touchend","touchcancel"]),n=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout","touchstart","touchend","touchmove","keydown","keyup","keypress","input","change","submit","reset","focus","blur","focusin","focusout","wheel","contextmenu","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]);export{n as DELEGATED_EVENTS,o as LIFECYCLE_EVENTS,t as MIXINS,a as NON_BUBBLING_EVENTS,r as PASSIVE_EVENTS,e as REGISTRY};
1
+ const e=new Set(["extends","children","content","childrenAs","childExtends","childExtendsRecursive","childProps","inheritParentProps","state","if","define","deps","tag","attr","style","text","html","value","data","classlist","class","scope","root","context","$router","routes","fetch","variables","query","key","component","preventContentUpdate","preventContentRecreate","subscribeTo","autoGrow","srcObject","allowRuntimeTemplates","__name","__ref","__hash","__text","parent","node"]),t={text:"text",html:"html",style:"style",attr:"attr",data:"data",classlist:"classlist",state:"state",scope:"scope"},o=new Set(["start","init","complete","attachNode","stateInit","stateCreated","beforeUpdate","update","afterUpdate","beforeClassAssign","lazyLoad","render","renderRouter","done","create","frame","mounted","contentUpdate","startUpdate","stateUpdate","beforeStateUpdate","initInspect","initSync","beforeRemove","remove"]),a=new Set(["load","error","abort","scroll","canplay","canplaythrough","ended","pause","play","playing","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","durationchange","loadeddata","loadedmetadata","progress","emptied","resize"]),r=new Set(["wheel","mousewheel","touchstart","touchmove","touchend","touchcancel"]),s=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout","touchstart","touchend","touchmove","keydown","keyup","keypress","input","change","submit","reset","focus","blur","focusin","focusout","wheel","contextmenu","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]);export{s as DELEGATED_EVENTS,o as LIFECYCLE_EVENTS,t as MIXINS,a as NON_BUBBLING_EVENTS,r as PASSIVE_EVENTS,e as REGISTRY};
@@ -1 +1 @@
1
- const o="3.14.794";export{o as VERSION};
1
+ const o="3.14.795";export{o as VERSION};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/element",
3
- "version": "3.14.794",
3
+ "version": "3.14.795",
4
4
  "description": "Core element creation, update, and disposal engine for smbls v3.14",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",