sibujs 4.2.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/browser.cjs +1 -1
  2. package/dist/browser.js +4 -4
  3. package/dist/build.cjs +30 -8
  4. package/dist/build.js +10 -10
  5. package/dist/cdn.dev.global.js +6 -6
  6. package/dist/cdn.global.js +6 -6
  7. package/dist/{chunk-HZEBO22J.js → chunk-2LSY4WDM.js} +38 -16
  8. package/dist/{chunk-2LOYNGBY.js → chunk-3E5YNK2F.js} +1 -1
  9. package/dist/{chunk-7VEC3UD2.js → chunk-7BJLKDBI.js} +1 -1
  10. package/dist/{chunk-XZ2N525U.js → chunk-7BPN4MXR.js} +4 -4
  11. package/dist/{chunk-NEYWS4EX.js → chunk-7GQIRV27.js} +3 -3
  12. package/dist/{chunk-HJEPKZ2O.js → chunk-7UBG6LDP.js} +1 -1
  13. package/dist/{chunk-P3DHXBR6.js → chunk-7UK6BSAT.js} +1 -1
  14. package/dist/{chunk-BNKV4REK.js → chunk-AAHT6AKT.js} +2 -2
  15. package/dist/{chunk-QCFLDD7C.js → chunk-G7GPNB6N.js} +4 -4
  16. package/dist/{chunk-SF3TB4K6.js → chunk-GZYQNIPS.js} +5 -5
  17. package/dist/{chunk-BMYYZWHX.js → chunk-IYHM4FWD.js} +1 -1
  18. package/dist/{chunk-FOWBJZDL.js → chunk-L4B3Y3OM.js} +1 -1
  19. package/dist/{chunk-HECVW343.js → chunk-MYA5HEK5.js} +1 -1
  20. package/dist/{chunk-GDUNQCCW.js → chunk-R4EF7V3K.js} +4 -4
  21. package/dist/{chunk-3VTSPNC5.js → chunk-RE6KLGMV.js} +1 -1
  22. package/dist/{chunk-7ALC7KGE.js → chunk-TSL64O5L.js} +1 -1
  23. package/dist/{chunk-KE4KWRDY.js → chunk-UD6YE2GW.js} +2 -2
  24. package/dist/{chunk-OUWAIXIK.js → chunk-USS5ENJ2.js} +3 -3
  25. package/dist/{chunk-6ZGI3RBE.js → chunk-XGCZ45NH.js} +2 -2
  26. package/dist/{chunk-QL4UREZO.js → chunk-ZVYNIUOG.js} +3 -3
  27. package/dist/data.cjs +1 -1
  28. package/dist/data.js +6 -6
  29. package/dist/devtools.cjs +1 -1
  30. package/dist/devtools.js +4 -4
  31. package/dist/ecosystem.cjs +1 -1
  32. package/dist/ecosystem.js +7 -7
  33. package/dist/extras.cjs +1 -1
  34. package/dist/extras.js +19 -19
  35. package/dist/index.cjs +30 -8
  36. package/dist/index.d.cts +36 -4
  37. package/dist/index.d.ts +36 -4
  38. package/dist/index.js +10 -10
  39. package/dist/motion.cjs +1 -1
  40. package/dist/motion.js +3 -3
  41. package/dist/patterns.cjs +1 -1
  42. package/dist/patterns.js +5 -5
  43. package/dist/performance.cjs +1 -1
  44. package/dist/performance.js +4 -4
  45. package/dist/plugins.cjs +4 -3
  46. package/dist/plugins.d.cts +10 -2
  47. package/dist/plugins.d.ts +10 -2
  48. package/dist/plugins.js +9 -8
  49. package/dist/ssr.cjs +1 -1
  50. package/dist/ssr.js +7 -7
  51. package/dist/testing.cjs +1 -1
  52. package/dist/testing.js +2 -2
  53. package/dist/ui.cjs +1 -1
  54. package/dist/ui.js +6 -6
  55. package/dist/widgets.cjs +1 -1
  56. package/dist/widgets.js +6 -6
  57. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
- "use strict";var Sibu=(()=>{var nt=Object.defineProperty;var Is=Object.getOwnPropertyDescriptor;var Ps=Object.getOwnPropertyNames;var Bs=Object.prototype.hasOwnProperty;var rt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var ln=(e,n)=>{for(var t in n)nt(e,t,{get:n[t],enumerable:!0})},Fs=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of Ps(n))!Bs.call(e,o)&&o!==t&&nt(e,o,{get:()=>n[o],enumerable:!(r=Is(n,o))||r.enumerable});return e};var zs=e=>Fs(nt({},"__esModule",{value:!0}),e);var xc={};ln(xc,{DynamicComponent:()=>Ji,ErrorBoundary:()=>Ri,ErrorDisplay:()=>Xe,Fragment:()=>Xi,KeepAlive:()=>ts,Loading:()=>Hi,MAX_DRAIN_TEARDOWNS:()=>ke,Portal:()=>rs,SVG_NS:()=>N,Suspense:()=>kt,__resetIdCounter:()=>zi,a:()=>vr,abbr:()=>xr,action:()=>Di,address:()=>rr,area:()=>jr,array:()=>is,article:()=>Zn,aside:()=>nr,asyncDerived:()=>as,audio:()=>Kr,autoResize:()=>Kt,b:()=>Sr,base:()=>zo,batch:()=>P,bdi:()=>Tr,bdo:()=>Er,bindDynamic:()=>vt,blockquote:()=>ur,body:()=>Jn,br:()=>wr,button:()=>xe,canvas:()=>so,caption:()=>fo,catchError:()=>Oi,catchErrorAsync:()=>Ii,center:()=>li,checkLeaks:()=>fn,circle:()=>Wo,cite:()=>kr,clickOutside:()=>qt,clipPath:()=>ti,code:()=>Ye,col:()=>po,colgroup:()=>mo,context:()=>Bi,copyOnClick:()=>jt,createId:()=>Fi,customElement:()=>pi,data:()=>_r,datalist:()=>To,dd:()=>lr,deepEqual:()=>Ee,deepSignal:()=>cs,defer:()=>_s,defs:()=>ei,del:()=>uo,derived:()=>Qe,details:()=>Do,dfn:()=>Ar,dialog:()=>Oo,disableSSR:()=>$t,dispose:()=>L,div:()=>k,dl:()=>dr,dt:()=>fr,each:()=>Yi,effect:()=>F,ellipse:()=>jo,em:()=>Cr,embed:()=>Zr,enableSSR:()=>Ht,enhance:()=>De,enhanceAll:()=>ys,enqueueBatchedSignal:()=>oe,external:()=>ki,fieldset:()=>Eo,figcaption:()=>pr,figure:()=>mr,font:()=>di,footer:()=>Qn,form:()=>wo,g:()=>Ko,getAction:()=>Vt,getRequestScopedCache:()=>Mt,getRuntimeErrorHandler:()=>st,getSSRStore:()=>re,getSlot:()=>os,h1:()=>or,h2:()=>ir,h3:()=>Je,h4:()=>sr,h5:()=>ar,h6:()=>cr,head:()=>Un,header:()=>Xn,hr:()=>gr,html:()=>Qt,i:()=>Nr,iframe:()=>Xr,img:()=>Ur,input:()=>ko,ins:()=>lo,isBatching:()=>wi,isSSR:()=>V,kbd:()=>Lr,label:()=>_o,lazy:()=>wt,lazyIsland:()=>Ss,legend:()=>Ao,li:()=>br,line:()=>Uo,linearGradient:()=>oi,link:()=>Vo,longPress:()=>Wt,main:()=>tr,map:()=>Jr,mark:()=>Rr,marker:()=>ui,marquee:()=>fi,mask:()=>ni,match:()=>ji,math:()=>io,menu:()=>Io,meta:()=>qo,meter:()=>Co,mount:()=>ns,mountIslands:()=>ws,nav:()=>er,nextTick:()=>Cs,noscript:()=>ao,object:()=>Qr,ol:()=>hr,on:()=>Ti,onCleanup:()=>hi,onMount:()=>Re,onUnmount:()=>bi,optgroup:()=>No,option:()=>Lo,output:()=>Ro,p:()=>Ue,param:()=>eo,path:()=>Jo,pattern:()=>ri,picture:()=>to,polygon:()=>Go,polyline:()=>Yo,portal:()=>no,pre:()=>Ge,progress:()=>Mo,q:()=>Mr,radialGradient:()=>ii,reactiveArray:()=>ss,rect:()=>Zo,ref:()=>us,registerAction:()=>de,registerComponent:()=>Ki,registerDisposer:()=>S,registerIsland:()=>Ts,replaceChildrenSafely:()=>B,reportDrainRunaway:()=>_e,reportError:()=>_,resolveComponent:()=>Zt,retrack:()=>Y,rp:()=>Hr,rt:()=>$r,ruby:()=>Dr,runInSSRContext:()=>Dt,s:()=>Or,samp:()=>Ir,script:()=>co,section:()=>Yn,select:()=>Ho,setGlobalErrorHandler:()=>Pi,setMaxDrainIterations:()=>yt,setRuntimeErrorHandler:()=>it,show:()=>Vi,signal:()=>C,slot:()=>Bo,small:()=>Pr,source:()=>ro,span:()=>R,stop:()=>si,store:()=>ls,strict:()=>ps,strictEffect:()=>ms,strong:()=>Br,style:()=>ne,sub:()=>Fr,summary:()=>Po,sup:()=>zr,svg:()=>oo,symbol:()=>ci,table:()=>go,tagFactory:()=>l,takePendingError:()=>Le,tbody:()=>bo,td:()=>ho,template:()=>Fo,text:()=>Xo,textarea:()=>$o,tfoot:()=>yo,th:()=>vo,thead:()=>xo,time:()=>Vr,title:()=>Gn,tr:()=>So,track:()=>Gr,transition:()=>As,trapFocus:()=>Ut,trustHTML:()=>nn,tspan:()=>Qo,u:()=>qr,ul:()=>yr,unregisterComponent:()=>Ui,unregisterDisposer:()=>Be,unregisterIsland:()=>Es,untracked:()=>be,use:()=>ai,var_:()=>Wr,video:()=>Yr,watch:()=>ds,when:()=>Wi,withSSR:()=>Ot,writable:()=>fs});var rn={};ln(rn,{DynamicComponent:()=>Ji,ErrorBoundary:()=>Ri,ErrorDisplay:()=>Xe,Fragment:()=>Xi,KeepAlive:()=>ts,Loading:()=>Hi,MAX_DRAIN_TEARDOWNS:()=>ke,Portal:()=>rs,SVG_NS:()=>N,Suspense:()=>kt,__resetIdCounter:()=>zi,a:()=>vr,abbr:()=>xr,action:()=>Di,address:()=>rr,area:()=>jr,array:()=>is,article:()=>Zn,aside:()=>nr,asyncDerived:()=>as,audio:()=>Kr,autoResize:()=>Kt,b:()=>Sr,base:()=>zo,batch:()=>P,bdi:()=>Tr,bdo:()=>Er,bindDynamic:()=>vt,blockquote:()=>ur,body:()=>Jn,br:()=>wr,button:()=>xe,canvas:()=>so,caption:()=>fo,catchError:()=>Oi,catchErrorAsync:()=>Ii,center:()=>li,checkLeaks:()=>fn,circle:()=>Wo,cite:()=>kr,clickOutside:()=>qt,clipPath:()=>ti,code:()=>Ye,col:()=>po,colgroup:()=>mo,context:()=>Bi,copyOnClick:()=>jt,createId:()=>Fi,customElement:()=>pi,data:()=>_r,datalist:()=>To,dd:()=>lr,deepEqual:()=>Ee,deepSignal:()=>cs,defer:()=>_s,defs:()=>ei,del:()=>uo,derived:()=>Qe,details:()=>Do,dfn:()=>Ar,dialog:()=>Oo,disableSSR:()=>$t,dispose:()=>L,div:()=>k,dl:()=>dr,dt:()=>fr,each:()=>Yi,effect:()=>F,ellipse:()=>jo,em:()=>Cr,embed:()=>Zr,enableSSR:()=>Ht,enhance:()=>De,enhanceAll:()=>ys,enqueueBatchedSignal:()=>oe,external:()=>ki,fieldset:()=>Eo,figcaption:()=>pr,figure:()=>mr,font:()=>di,footer:()=>Qn,form:()=>wo,g:()=>Ko,getAction:()=>Vt,getRequestScopedCache:()=>Mt,getRuntimeErrorHandler:()=>st,getSSRStore:()=>re,getSlot:()=>os,h1:()=>or,h2:()=>ir,h3:()=>Je,h4:()=>sr,h5:()=>ar,h6:()=>cr,head:()=>Un,header:()=>Xn,hr:()=>gr,html:()=>Qt,i:()=>Nr,iframe:()=>Xr,img:()=>Ur,input:()=>ko,ins:()=>lo,isBatching:()=>wi,isSSR:()=>V,kbd:()=>Lr,label:()=>_o,lazy:()=>wt,lazyIsland:()=>Ss,legend:()=>Ao,li:()=>br,line:()=>Uo,linearGradient:()=>oi,link:()=>Vo,longPress:()=>Wt,main:()=>tr,map:()=>Jr,mark:()=>Rr,marker:()=>ui,marquee:()=>fi,mask:()=>ni,match:()=>ji,math:()=>io,menu:()=>Io,meta:()=>qo,meter:()=>Co,mount:()=>ns,mountIslands:()=>ws,nav:()=>er,nextTick:()=>Cs,noscript:()=>ao,object:()=>Qr,ol:()=>hr,on:()=>Ti,onCleanup:()=>hi,onMount:()=>Re,onUnmount:()=>bi,optgroup:()=>No,option:()=>Lo,output:()=>Ro,p:()=>Ue,param:()=>eo,path:()=>Jo,pattern:()=>ri,picture:()=>to,polygon:()=>Go,polyline:()=>Yo,portal:()=>no,pre:()=>Ge,progress:()=>Mo,q:()=>Mr,radialGradient:()=>ii,reactiveArray:()=>ss,rect:()=>Zo,ref:()=>us,registerAction:()=>de,registerComponent:()=>Ki,registerDisposer:()=>S,registerIsland:()=>Ts,replaceChildrenSafely:()=>B,reportDrainRunaway:()=>_e,reportError:()=>_,resolveComponent:()=>Zt,retrack:()=>Y,rp:()=>Hr,rt:()=>$r,ruby:()=>Dr,runInSSRContext:()=>Dt,s:()=>Or,samp:()=>Ir,script:()=>co,section:()=>Yn,select:()=>Ho,setGlobalErrorHandler:()=>Pi,setMaxDrainIterations:()=>yt,setRuntimeErrorHandler:()=>it,show:()=>Vi,signal:()=>C,slot:()=>Bo,small:()=>Pr,source:()=>ro,span:()=>R,stop:()=>si,store:()=>ls,strict:()=>ps,strictEffect:()=>ms,strong:()=>Br,style:()=>ne,sub:()=>Fr,summary:()=>Po,sup:()=>zr,svg:()=>oo,symbol:()=>ci,table:()=>go,tagFactory:()=>l,takePendingError:()=>Le,tbody:()=>bo,td:()=>ho,template:()=>Fo,text:()=>Xo,textarea:()=>$o,tfoot:()=>yo,th:()=>vo,thead:()=>xo,time:()=>Vr,title:()=>Gn,tr:()=>So,track:()=>Gr,transition:()=>As,trapFocus:()=>Ut,trustHTML:()=>nn,tspan:()=>Qo,u:()=>qr,ul:()=>yr,unregisterComponent:()=>Ui,unregisterDisposer:()=>Be,unregisterIsland:()=>Es,untracked:()=>be,use:()=>ai,var_:()=>Wr,video:()=>Yr,watch:()=>ds,when:()=>Wi,withSSR:()=>Ot,writable:()=>fs});var dn=Symbol.for("sibujs.runtime-errors.v1");function ot(){let e=globalThis,n=e[dn];if(n)return n;let t={handler:null,handlerDepth:0};return e[dn]=t,t}function it(e){let n=ot(),t=n.handler;return n.handler=e,t}function st(){return ot().handler}function at(e){if(e instanceof Error)return e;let n=typeof e=="string"?e:`Non-Error value thrown: ${Vs(e)}`;return new Error(n,{cause:e})}function Vs(e){if(typeof e=="symbol")return e.toString();try{return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}catch{return Object.prototype.toString.call(e)}}function qs(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Ws=Symbol.for("sibujs.reactive.v1");function js(e){let n=globalThis[Ws];return n?.untracked?n.untracked(e):e()}var Ks="sibu:error-propagate";function Us(e,n){let t=n.node;if(!t||typeof CustomEvent>"u")return!1;let r=Js(t);if(!r)return!1;try{let o=new CustomEvent(Ks,{bubbles:!0,cancelable:!0,detail:{error:e,context:n}});return r.dispatchEvent(o)===!1}catch{return!1}}function Js(e){let t=e;for(;t;){if(t.nodeType===1&&typeof t.dispatchEvent=="function")return t;t=t.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function Gs(e,n){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${qs(n)}: ${e.message}`,e)}function _(e,n){let t=at(e);js(()=>{if(Us(t,n))return;let r=ot(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:t,n);return}catch(i){if(typeof console<"u"){let s=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${s}`,i)}}finally{r.handlerDepth--}}Gs(t,n)})}function U(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var G=new WeakMap,ke=1e4;function _e(e,n,t){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${n} teardowns with ${t} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:n,remaining:t})}var se=0;function S(e,n){let t=G.get(e);t||(t=[],G.set(e,t)),t.push(n),!1}function Be(e,n){let t=G.get(e);if(!t)return;let r=t.indexOf(n);r!==-1&&(t.splice(r,1),!1,t.length===0&&G.delete(e))}function L(e){let n=[e],t=[];for(;n.length>0;){let r=n.pop();t.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}for(let r=t.length-1;r>=0;r--){let o=t[r];if(G.has(o)){let i=0,s=!1;for(;!s;){let a=G.get(o);if(!a||a.length===0)break;let c=a.slice();G.delete(o),!1;for(let d=0;d<c.length;d++){if(i>=ke){let u=c.slice(d),f=G.get(o);G.set(o,f?u.concat(f):u),!1,_e("dispose",i,u.length+(f?.length??0)),s=!0;break}i++;try{c[d]()}catch(u){_(u,{phase:"cleanup",name:"disposer"})}}}}}}function B(e,...n){for(let r=0;r<n.length;r++){let o=n[r];o.parentNode?.removeChild(o)}let t=Array.from(e.childNodes);for(let r=0;r<t.length;r++)L(t[r]);e.replaceChildren(...n)}function fn(e=0){return 0}function Ys(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}function me(e){if(e.length<3)return!1;let n=e.toLowerCase();return n[0]==="o"&&n[1]==="n"&&n.charCodeAt(2)>=97&&n.charCodeAt(2)<=122}var Zs=["http:","https:","mailto:","tel:","ftp:"],Xs=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function hn(e){let n=Ys(e).trim();if(!n)return"";let t=e.replace(Xs,""),r=n.toLowerCase(),o=-1;for(let s=0;s<r.length;s++){let a=r.charCodeAt(s);if(a===58){o=s;break}if(a===47||a===63||a===35)break}if(o===-1)return t;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&Zs.indexOf(i)===-1?"":t}var Qs=/^\s+\d+(\.\d+)?[wx]$/;function ea(e){let n=e.split(","),t=[];for(let r=0;r<n.length;r++){let o=n[r].trim();if(!o)continue;let i=o.match(/^(\S+)(\s+.+)?$/);if(!i||i[2]!==void 0&&!Qs.test(i[2]))continue;let s=hn(i[1]);s&&t.push(i[2]?`${s}${i[2]}`:s)}return t.join(", ")}var ta=/[(:@\\]/;function na(e){return e===" "||e===" "||e===`
1
+ "use strict";var Sibu=(()=>{var nt=Object.defineProperty;var Os=Object.getOwnPropertyDescriptor;var Ps=Object.getOwnPropertyNames;var Bs=Object.prototype.hasOwnProperty;var rt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var ln=(e,n)=>{for(var t in n)nt(e,t,{get:n[t],enumerable:!0})},Fs=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of Ps(n))!Bs.call(e,o)&&o!==t&&nt(e,o,{get:()=>n[o],enumerable:!(r=Os(n,o))||r.enumerable});return e};var zs=e=>Fs(nt({},"__esModule",{value:!0}),e);var xc={};ln(xc,{DynamicComponent:()=>Ji,ErrorBoundary:()=>Ri,ErrorDisplay:()=>Xe,Fragment:()=>Xi,KeepAlive:()=>ts,Loading:()=>Hi,MAX_DRAIN_TEARDOWNS:()=>ke,Portal:()=>rs,SVG_NS:()=>N,Suspense:()=>kt,__resetIdCounter:()=>zi,a:()=>vr,abbr:()=>xr,action:()=>Di,address:()=>rr,area:()=>jr,array:()=>is,article:()=>Zn,aside:()=>nr,asyncDerived:()=>as,audio:()=>Kr,autoResize:()=>Kt,b:()=>Sr,base:()=>zo,batch:()=>P,bdi:()=>Tr,bdo:()=>Er,bindDynamic:()=>vt,blockquote:()=>ur,body:()=>Jn,br:()=>wr,button:()=>xe,canvas:()=>so,caption:()=>fo,catchError:()=>Ii,catchErrorAsync:()=>Oi,center:()=>li,checkLeaks:()=>fn,circle:()=>Wo,cite:()=>kr,clickOutside:()=>qt,clipPath:()=>ti,code:()=>Ye,col:()=>po,colgroup:()=>mo,context:()=>Bi,copyOnClick:()=>jt,createId:()=>Fi,customElement:()=>pi,data:()=>_r,datalist:()=>To,dd:()=>lr,deepEqual:()=>Ee,deepSignal:()=>cs,defer:()=>_s,defs:()=>ei,del:()=>uo,derived:()=>Qe,details:()=>Do,dfn:()=>Ar,dialog:()=>Io,disableSSR:()=>$t,dispose:()=>L,div:()=>k,dl:()=>dr,dt:()=>fr,each:()=>Yi,effect:()=>F,ellipse:()=>jo,em:()=>Cr,embed:()=>Zr,enableSSR:()=>Ht,enhance:()=>De,enhanceAll:()=>ys,enqueueBatchedSignal:()=>oe,external:()=>ki,fieldset:()=>Eo,figcaption:()=>pr,figure:()=>mr,font:()=>di,footer:()=>Qn,form:()=>wo,g:()=>Ko,getAction:()=>Vt,getRequestScopedCache:()=>Mt,getRuntimeErrorHandler:()=>st,getSSRStore:()=>re,getSlot:()=>os,h1:()=>or,h2:()=>ir,h3:()=>Je,h4:()=>sr,h5:()=>ar,h6:()=>cr,head:()=>Un,header:()=>Xn,hr:()=>gr,html:()=>Qt,i:()=>Nr,iframe:()=>Xr,img:()=>Ur,input:()=>ko,ins:()=>lo,isBatching:()=>wi,isSSR:()=>V,kbd:()=>Lr,label:()=>_o,lazy:()=>wt,lazyIsland:()=>Ss,legend:()=>Ao,li:()=>br,line:()=>Uo,linearGradient:()=>oi,link:()=>Vo,longPress:()=>Wt,main:()=>tr,map:()=>Jr,mark:()=>Rr,marker:()=>ui,marquee:()=>fi,mask:()=>ni,match:()=>ji,math:()=>io,menu:()=>Oo,meta:()=>qo,meter:()=>Co,mount:()=>ns,mountIslands:()=>ws,nav:()=>er,nextTick:()=>Cs,noscript:()=>ao,object:()=>Qr,ol:()=>hr,on:()=>Ti,onCleanup:()=>hi,onMount:()=>Re,onUnmount:()=>bi,optgroup:()=>No,option:()=>Lo,output:()=>Ro,p:()=>Ue,param:()=>eo,path:()=>Jo,pattern:()=>ri,picture:()=>to,polygon:()=>Go,polyline:()=>Yo,portal:()=>no,pre:()=>Ge,progress:()=>Mo,q:()=>Mr,radialGradient:()=>ii,reactiveArray:()=>ss,rect:()=>Zo,ref:()=>us,registerAction:()=>de,registerComponent:()=>Ki,registerDisposer:()=>T,registerIsland:()=>Ts,replaceChildrenSafely:()=>B,reportDrainRunaway:()=>_e,reportError:()=>_,resolveComponent:()=>Zt,retrack:()=>Y,rp:()=>Hr,rt:()=>$r,ruby:()=>Dr,runInSSRContext:()=>Dt,s:()=>Ir,samp:()=>Or,script:()=>co,section:()=>Yn,select:()=>Ho,setGlobalErrorHandler:()=>Pi,setMaxDrainIterations:()=>yt,setRuntimeErrorHandler:()=>it,show:()=>Vi,signal:()=>C,slot:()=>Bo,small:()=>Pr,source:()=>ro,span:()=>R,stop:()=>si,store:()=>ls,strict:()=>ps,strictEffect:()=>ms,strong:()=>Br,style:()=>ne,sub:()=>Fr,summary:()=>Po,sup:()=>zr,svg:()=>oo,symbol:()=>ci,table:()=>go,tagFactory:()=>u,takePendingError:()=>Le,tbody:()=>bo,td:()=>ho,template:()=>Fo,text:()=>Xo,textarea:()=>$o,tfoot:()=>yo,th:()=>vo,thead:()=>xo,time:()=>Vr,title:()=>Gn,tr:()=>So,track:()=>Gr,transition:()=>As,trapFocus:()=>Ut,trustHTML:()=>nn,tspan:()=>Qo,u:()=>qr,ul:()=>yr,unregisterComponent:()=>Ui,unregisterDisposer:()=>Be,unregisterIsland:()=>Es,untracked:()=>be,use:()=>ai,var_:()=>Wr,video:()=>Yr,watch:()=>ds,when:()=>Wi,withSSR:()=>It,writable:()=>fs});var rn={};ln(rn,{DynamicComponent:()=>Ji,ErrorBoundary:()=>Ri,ErrorDisplay:()=>Xe,Fragment:()=>Xi,KeepAlive:()=>ts,Loading:()=>Hi,MAX_DRAIN_TEARDOWNS:()=>ke,Portal:()=>rs,SVG_NS:()=>N,Suspense:()=>kt,__resetIdCounter:()=>zi,a:()=>vr,abbr:()=>xr,action:()=>Di,address:()=>rr,area:()=>jr,array:()=>is,article:()=>Zn,aside:()=>nr,asyncDerived:()=>as,audio:()=>Kr,autoResize:()=>Kt,b:()=>Sr,base:()=>zo,batch:()=>P,bdi:()=>Tr,bdo:()=>Er,bindDynamic:()=>vt,blockquote:()=>ur,body:()=>Jn,br:()=>wr,button:()=>xe,canvas:()=>so,caption:()=>fo,catchError:()=>Ii,catchErrorAsync:()=>Oi,center:()=>li,checkLeaks:()=>fn,circle:()=>Wo,cite:()=>kr,clickOutside:()=>qt,clipPath:()=>ti,code:()=>Ye,col:()=>po,colgroup:()=>mo,context:()=>Bi,copyOnClick:()=>jt,createId:()=>Fi,customElement:()=>pi,data:()=>_r,datalist:()=>To,dd:()=>lr,deepEqual:()=>Ee,deepSignal:()=>cs,defer:()=>_s,defs:()=>ei,del:()=>uo,derived:()=>Qe,details:()=>Do,dfn:()=>Ar,dialog:()=>Io,disableSSR:()=>$t,dispose:()=>L,div:()=>k,dl:()=>dr,dt:()=>fr,each:()=>Yi,effect:()=>F,ellipse:()=>jo,em:()=>Cr,embed:()=>Zr,enableSSR:()=>Ht,enhance:()=>De,enhanceAll:()=>ys,enqueueBatchedSignal:()=>oe,external:()=>ki,fieldset:()=>Eo,figcaption:()=>pr,figure:()=>mr,font:()=>di,footer:()=>Qn,form:()=>wo,g:()=>Ko,getAction:()=>Vt,getRequestScopedCache:()=>Mt,getRuntimeErrorHandler:()=>st,getSSRStore:()=>re,getSlot:()=>os,h1:()=>or,h2:()=>ir,h3:()=>Je,h4:()=>sr,h5:()=>ar,h6:()=>cr,head:()=>Un,header:()=>Xn,hr:()=>gr,html:()=>Qt,i:()=>Nr,iframe:()=>Xr,img:()=>Ur,input:()=>ko,ins:()=>lo,isBatching:()=>wi,isSSR:()=>V,kbd:()=>Lr,label:()=>_o,lazy:()=>wt,lazyIsland:()=>Ss,legend:()=>Ao,li:()=>br,line:()=>Uo,linearGradient:()=>oi,link:()=>Vo,longPress:()=>Wt,main:()=>tr,map:()=>Jr,mark:()=>Rr,marker:()=>ui,marquee:()=>fi,mask:()=>ni,match:()=>ji,math:()=>io,menu:()=>Oo,meta:()=>qo,meter:()=>Co,mount:()=>ns,mountIslands:()=>ws,nav:()=>er,nextTick:()=>Cs,noscript:()=>ao,object:()=>Qr,ol:()=>hr,on:()=>Ti,onCleanup:()=>hi,onMount:()=>Re,onUnmount:()=>bi,optgroup:()=>No,option:()=>Lo,output:()=>Ro,p:()=>Ue,param:()=>eo,path:()=>Jo,pattern:()=>ri,picture:()=>to,polygon:()=>Go,polyline:()=>Yo,portal:()=>no,pre:()=>Ge,progress:()=>Mo,q:()=>Mr,radialGradient:()=>ii,reactiveArray:()=>ss,rect:()=>Zo,ref:()=>us,registerAction:()=>de,registerComponent:()=>Ki,registerDisposer:()=>T,registerIsland:()=>Ts,replaceChildrenSafely:()=>B,reportDrainRunaway:()=>_e,reportError:()=>_,resolveComponent:()=>Zt,retrack:()=>Y,rp:()=>Hr,rt:()=>$r,ruby:()=>Dr,runInSSRContext:()=>Dt,s:()=>Ir,samp:()=>Or,script:()=>co,section:()=>Yn,select:()=>Ho,setGlobalErrorHandler:()=>Pi,setMaxDrainIterations:()=>yt,setRuntimeErrorHandler:()=>it,show:()=>Vi,signal:()=>C,slot:()=>Bo,small:()=>Pr,source:()=>ro,span:()=>R,stop:()=>si,store:()=>ls,strict:()=>ps,strictEffect:()=>ms,strong:()=>Br,style:()=>ne,sub:()=>Fr,summary:()=>Po,sup:()=>zr,svg:()=>oo,symbol:()=>ci,table:()=>go,tagFactory:()=>u,takePendingError:()=>Le,tbody:()=>bo,td:()=>ho,template:()=>Fo,text:()=>Xo,textarea:()=>$o,tfoot:()=>yo,th:()=>vo,thead:()=>xo,time:()=>Vr,title:()=>Gn,tr:()=>So,track:()=>Gr,transition:()=>As,trapFocus:()=>Ut,trustHTML:()=>nn,tspan:()=>Qo,u:()=>qr,ul:()=>yr,unregisterComponent:()=>Ui,unregisterDisposer:()=>Be,unregisterIsland:()=>Es,untracked:()=>be,use:()=>ai,var_:()=>Wr,video:()=>Yr,watch:()=>ds,when:()=>Wi,withSSR:()=>It,writable:()=>fs});var dn=Symbol.for("sibujs.runtime-errors.v1");function ot(){let e=globalThis,n=e[dn];if(n)return n;let t={handler:null,handlerDepth:0};return e[dn]=t,t}function it(e){let n=ot(),t=n.handler;return n.handler=e,t}function st(){return ot().handler}function at(e){if(e instanceof Error)return e;let n=typeof e=="string"?e:`Non-Error value thrown: ${Vs(e)}`;return new Error(n,{cause:e})}function Vs(e){if(typeof e=="symbol")return e.toString();try{return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}catch{return Object.prototype.toString.call(e)}}function qs(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Ws=Symbol.for("sibujs.reactive.v1");function js(e){let n=globalThis[Ws];return n?.untracked?n.untracked(e):e()}var Ks="sibu:error-propagate";function Us(e,n){let t=n.node;if(!t||typeof CustomEvent>"u")return!1;let r=Js(t);if(!r)return!1;try{let o=new CustomEvent(Ks,{bubbles:!0,cancelable:!0,detail:{error:e,context:n}});return r.dispatchEvent(o)===!1}catch{return!1}}function Js(e){let t=e;for(;t;){if(t.nodeType===1&&typeof t.dispatchEvent=="function")return t;t=t.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function Gs(e,n){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${qs(n)}: ${e.message}`,e)}function _(e,n){let t=at(e);js(()=>{if(Us(t,n))return;let r=ot(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:t,n);return}catch(i){if(typeof console<"u"){let s=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${s}`,i)}}finally{r.handlerDepth--}}Gs(t,n)})}function U(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var G=new WeakMap,ke=1e4;function _e(e,n,t){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${n} teardowns with ${t} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:n,remaining:t})}var se=0;function T(e,n){let t=G.get(e);t||(t=[],G.set(e,t)),t.push(n),!1}function Be(e,n){let t=G.get(e);if(!t)return;let r=t.indexOf(n);r!==-1&&(t.splice(r,1),!1,t.length===0&&G.delete(e))}function L(e){let n=[e],t=[];for(;n.length>0;){let r=n.pop();t.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}for(let r=t.length-1;r>=0;r--){let o=t[r];if(G.has(o)){let i=0,s=!1;for(;!s;){let a=G.get(o);if(!a||a.length===0)break;let c=a.slice();G.delete(o),!1;for(let l=0;l<c.length;l++){if(i>=ke){let d=c.slice(l),p=G.get(o);G.set(o,p?d.concat(p):d),!1,_e("dispose",i,d.length+(p?.length??0)),s=!0;break}i++;try{c[l]()}catch(d){_(d,{phase:"cleanup",name:"disposer"})}}}}}}function B(e,...n){for(let r=0;r<n.length;r++){let o=n[r];o.parentNode?.removeChild(o)}let t=Array.from(e.childNodes);for(let r=0;r<t.length;r++)L(t[r]);e.replaceChildren(...n)}function fn(e=0){return 0}function Ys(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}function me(e){if(e.length<3)return!1;let n=e.toLowerCase();return n[0]==="o"&&n[1]==="n"&&n.charCodeAt(2)>=97&&n.charCodeAt(2)<=122}var Zs=["http:","https:","mailto:","tel:","ftp:"],Xs=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function hn(e){let n=Ys(e).trim();if(!n)return"";let t=e.replace(Xs,""),r=n.toLowerCase(),o=-1;for(let s=0;s<r.length;s++){let a=r.charCodeAt(s);if(a===58){o=s;break}if(a===47||a===63||a===35)break}if(o===-1)return t;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&Zs.indexOf(i)===-1?"":t}var Qs=/^\s+\d+(\.\d+)?[wx]$/;function ea(e){let n=e.split(","),t=[];for(let r=0;r<n.length;r++){let o=n[r].trim();if(!o)continue;let i=o.match(/^(\S+)(\s+.+)?$/);if(!i||i[2]!==void 0&&!Qs.test(i[2]))continue;let s=hn(i[1]);s&&t.push(i[2]?`${s}${i[2]}`:s)}return t.join(", ")}var ta=/[(:@\\]/;function na(e){return e===" "||e===" "||e===`
2
2
  `||e==="\r"||e==="\f"}function pn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function ra(e){let n="";for(let t=0;t<e.length;t++){let r=e[t];if(r!=="\\"){n+=r;continue}if(t+1>=e.length)break;let o=e[t+1];if(o===`
3
3
  `||o==="\f"){t+=1;continue}if(o==="\r"){t+=e[t+2]===`
4
4
  `?2:1;continue}if(pn(o)){let i="",s=t+1;for(;s<e.length&&i.length<6&&pn(e[s]);)i+=e[s],s++;s<e.length&&na(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
5
- `?2:1);let a=Number.parseInt(i,16),c=a===0||a>1114111||a>=55296&&a<=57343;n+=c?"\uFFFD":String.fromCodePoint(a),t=s-1;continue}n+=o,t+=1}return n}var mn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid"];function oa(e){if(!e)return"an element";let n=e.tagName.toLowerCase(),t=e.getAttribute("id");t&&(n+=`#${t}`);let r=e.getAttribute("class");return r&&(n+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${n}>`}var ct=new Set,gn=100,bn=!1;function yn(e,n,t){}function ut(e){if(!ta.test(e))return-1;let t=(e.includes("\\")?ra(e):e).toLowerCase().replace(/\s+/g,"");for(let r=0;r<mn.length;r++)if(t.includes(mn[r]))return r;return-1}function Fe(e,n){let t=ut(e);return t===-1?e:(yn(e,t,n),"")}function ze(e,n){let t=String(e);if(t.trim()==="")return"";if(typeof document>"u")return Fe(t,n)===""?"":t;let r=document.createElement("div");try{r.style.cssText=t}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),c=ut(a);if(c===-1&&(c=ut(`${s}:${a}`)),c!==-1){yn(a,c,{property:s,element:n?.element});continue}let d=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${d?` !${d}`:""}`)}return o.join("; ")}var ia=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),sa=new Set(["srcdoc"]);function vn(e){return sa.has(e.toLowerCase())}function xn(e,n,t){let r=e.toLowerCase();return r==="srcset"?ea(n):ia.has(r)?hn(n):r==="style"?ze(n,t):n}var aa="http://www.w3.org/1999/xhtml",ca="http://www.w3.org/2000/svg",ua="http://www.w3.org/1999/xlink",la="http://www.w3.org/XML/1998/namespace",da=new Set(["checked","disabled","selected"]);function fa(e){return e.namespaceURI===null||e.namespaceURI===aa}function Sn(e,n,t){e[n]=t}function pa(e,n){if(e.namespaceURI!==ca)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?ua:t.startsWith("xml:")?la:null}function q(e,n,t,r={}){let o=pa(e,n),i=o?n.slice(n.indexOf(":")+1):n;if(me(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;if(t==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;if(vn(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let s=fa(e),a=s?n.toLowerCase():n;if(typeof t=="boolean")return s&&da.has(a)&&a in e?Sn(e,a,t):t?o?e.setAttributeNS(o,n,""):e.setAttribute(n,""):o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;let c=String(t);if(r.syncValueProperty!==!1&&s&&(a==="value"||a==="checked")&&a in e)return Sn(e,a,a==="checked"?!!t:c),!0;let d=xn(n,c,{element:e});return(o?e.getAttributeNS(o,i):e.getAttribute(n))===d||(o?e.setAttributeNS(o,n,d):e.setAttribute(n,d)),!0}var ma=4096,lt=[];function ga(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function ba(e,n,t){let r=lt.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=ga();return o.sig=e,o.sub=n,o.epoch=t,o}function Tn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,lt.length<ma&&lt.push(e)}function ha(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function En(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function ya(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function va(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var j=null,dt=null,ee=0,te=[],W=new Set,xa=[];function Sa(e){try{e()}catch(n){let t=e;_(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function Ta(e){let n=e.depsHead??null;if(n===null)return!0;for(;n!==null;){let t=n.sig;if(t===null)return!0;if(t._d===!0&&t._validate!==void 0)try{t._validate()}catch{return!0}if(n.depVersion!==t.__v)return!0;n=n.subNext}return!1}var Ve=0,pt=!1;function mt(){Ve===0&&(dt=j,j=null,pt=!0),Ve++}function gt(){Ve--,Ve===0&&(j=dt,dt=null,pt=!1)}function wn(){return pt}function kn(e){mt();try{return e()}finally{gt()}}var Ea=0;function bt(e,n){let t=j;j=n;let r=n,o=++Ea;r._epoch=o,r._structDirty=!1;for(let i=r.depsHead??null;i!==null;i=i.subNext){let s=i.sig;i.prevActive=s.__activeNode??null,s.__activeNode=i}try{e()}finally{j=t;let i=r.depsHead??null;for(;i!==null;){let s=i.subNext,a=i.sig;a.__activeNode=i.prevActive,i.prevActive=null,i.epoch!==o&&(va(i),En(i),Tn(i)),i=s}}}function _n(e,n){if(!n)return ht(e);ge(n);let t=j;j=n;try{e()}finally{j=t;let o=n;for(let i=o.depsHead??null;i!==null;i=i.subNext){let s=i.sig;s.__activeNode=i.prevActive,i.prevActive=null}}let r=n;return r._dispose??(r._dispose=()=>ge(n))}function ht(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{bt(e,r)}finally{o._reentrant=!1}}},r=t;r.depsHead=null,r.depsTail=null,r._epoch=0,r._structDirty=!1,r._hasComputedDep=!1,r._runEpoch=0,r._runs=0,r._reentrant=!1,r._disposed=!1,r._errorPhase="binding",r._errorNode=n;try{t()}catch(o){throw r._disposed=!0,r._errorNode=void 0,ge(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,ge(r)})}function An(e){if(!j)return;let n=j,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r,o.depVersion=t.__v??Number.NaN;return}t._validate!==void 0&&(n._hasComputedDep=!0);let i=ba(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,ya(n,i),ha(t,i),n._structDirty=!0}function ge(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;En(t),Tn(t),t=r}}var qe=1e3,We=1e6,je=0,ae=new Set;function Cn(e){let n=qe;return Number.isFinite(e)&&e>0&&(qe=Math.floor(e)),n}function Nn(e){let n=We;return Number.isFinite(e)&&e>0&&(We=Math.floor(e)),n}function wa(e){let n=e;return n._runEpoch!==je?(n._runEpoch=je,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>qe)}function ka(e){let n=e.__name??"<unnamed>";_(new Error(`subscriber "${n}" fired more than ${qe} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:n})}function _a(){_(new Error(`Notification drain exceeded ${We} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Ln(){let e=0;for(;e<te.length;){if(e>=We){_a();break}let n=te[e++];if(W.delete(n),!(ae.size>0&&ae.has(n))&&!(n._hasComputedDep===!0&&!Ta(n))){if(wa(n)){ka(n),ae.add(n);continue}Sa(n)}}}function Rn(){if(!(ee>0)){ee++,je++;try{Ln()}finally{ee--,ee===0&&(te.length=0,W.clear(),ae.size>0&&ae.clear())}}}function ft(e){e();let n=e._sig;if(!n)return;let t=xa,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?a._d||(a._d=!0,t.push(a)):s()}else W.has(s)||(W.add(s),te.push(s));i=i.sigNext}}}function Mn(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?ft(r):W.has(r)||(W.add(r),te.push(r))),t=t.sigNext}}function Hn(e){let t=e.subsHead;if(t){if(ee>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?ft(o):W.has(o)||(W.add(o),te.push(o))),r=r.sigNext}return}ee++,je++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?ft(o):W.has(o)||(W.add(o),te.push(o))),r=r.sigNext}Ln()}finally{ee--,ee===0&&(te.length=0,W.clear(),ae.size>0&&ae.clear())}}}function $n(e){return e.__sc??0}function Dn(e){let n=e,t=[],r=n.depsHead??null;for(;r;)r.sig&&t.push(r.sig),r=r.subNext;return t}function On(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var In="4.2.0",Pn=Symbol.for("sibujs.reactive.v1");function Ca(){let e=globalThis,n=e[Pn];if(n)return!1,n;let t={suspendTracking:mt,resumeTracking:gt,isTrackingSuspended:wn,untracked:kn,retrack:bt,track:_n,reactiveBinding:ht,recordDependency:An,cleanup:ge,setMaxSubscriberRepeats:Cn,setMaxDrainIterations:Nn,drainNotificationQueue:Rn,queueSignalNotification:Mn,notifySubscribers:Hn,getSubscriberCount:$n,getSubscriberDeps:Dn,forEachSubscriber:On,version:In};return e[Pn]=t,t}var $=Ca(),Ae=$.suspendTracking,Ce=$.resumeTracking,Bn=$.isTrackingSuspended,be=$.untracked,Y=$.retrack,D=$.track,z=$.reactiveBinding,he=$.recordDependency,Fn=$.cleanup,Rc=$.setMaxSubscriberRepeats,yt=$.setMaxDrainIterations,zn=$.drainNotificationQueue,Vn=$.queueSignalNotification,ye=$.notifySubscribers,Mc=$.getSubscriberCount,Hc=$.getSubscriberDeps,$c=$.forEachSubscriber;function Ke(e,n,t){if(me(n))return q(e,n,"",{label:`bindAttribute("${n}")`}),()=>{};function r(){let o;try{o=t()}catch(i){_(i,{phase:"binding",name:`bindAttribute("${n}")`,node:e});return}q(e,n,o,{label:`bindAttribute("${n}")`})}return z(r,e)}function vt(e,n,t){let r=null;function o(){let s;try{s=typeof n=="function"?n():n}catch(c){_(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof t=="function"?t():t}catch(c){_(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),q(e,s,a,{label:"bindDynamic"})&&(r=s)}let i=z(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var xt=["data-focus-key","id","name"],Na=new Set(["text","search","url","tel","password",""]);function La(e){let n=e.tagName;if(!(n==="TEXTAREA"||n==="INPUT"&&Na.has(e.type.toLowerCase())))return{start:null,end:null,direction:null};let r=e;return{start:r.selectionStart,end:r.selectionEnd,direction:r.selectionDirection}}function Ne(e){if(e.length===0||typeof document>"u")return null;let n=document.activeElement;if(!n||n===document.body)return null;let t=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===n||s.nodeType===1&&s.contains(n)){t=!0;break}}if(!t)return null;let r=null,o=null;for(let i=0;i<xt.length;i++){let s=n.getAttribute(xt[i]);if(s){r=xt[i],o=s;break}}return{el:n,attr:r,value:o,tag:n.tagName,...La(n)}}function Ra(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ma(e,n){let t=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(n)&&(r++,t??(t=s));let a=s.querySelectorAll(n);for(let c=0;c<a.length;c++)r++,t??(t=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:t,count:r}:{el:null,count:r}}function qn(e,n){if(e.focus(),n.start!==null&&typeof e.setSelectionRange=="function"){let t=e,r=t.value.length,o=Math.min(n.start,r),i=Math.min(n.end??o,r);t.setSelectionRange(o,i,n.direction??"none")}}function ve(e,n,t){if(!e||typeof document>"u")return;let r=document.activeElement;if(r===e.el||r&&r!==document.body&&r!==document.documentElement)return;if(e.el.isConnected){qn(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=Ma(n,`[${e.attr}=${Ra(e.value)}]`);if(i&&i.tagName===e.tag){qn(i,e);return}o=s>1}}function ce(e,n){let t=[];function r(){let o;try{o=n()}catch(u){_(u,{phase:"binding",name:"bindChildNode",node:e});return}let i=Ne(t);if(o==null||typeof o=="boolean"){for(let u=0;u<t.length;u++){let f=t[u];L(f),f.parentNode&&f.parentNode.removeChild(f)}t.length=0,ve(i,t,"bindChildNode");return}let s=e.parentNode;if(!s){t.length=0;return}let a;if(Array.isArray(o)){a=[];let u=new Set;for(let f=0;f<o.length;f++){let g=o[f];if(g==null||typeof g=="boolean")continue;let p=g instanceof Node?g:document.createTextNode(String(g));if(u.has(p)){!1;continue}u.add(p),a.push(p)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(t.length>0&&a.length>0){let u=new Set(t);c=new Set;for(let f=0;f<a.length;f++)u.has(a[f])&&c.add(a[f])}for(let u=0;u<t.length;u++){let f=t[u];c?.has(f)||(L(f),f.parentNode&&f.parentNode.removeChild(f))}let d=e;for(let u=0;u<a.length;u++){let f=a[u];d.nextSibling!==f&&s.insertBefore(f,d.nextSibling),d=f}t=a,ve(i,a,"bindChildNode")}return z(r,e)}var N="http://www.w3.org/2000/svg",Ha=new Set(["script","iframe","object","embed","frame","frameset"]);function $a(e){return Ha.has(e.toLowerCase())}var Da=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var St=new Set,Wn=100,jn=!1,Kn=new Map;function Oa(e){let n=Kn.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Kn.set(e,n)),n}function Ia(e,n){if(typeof n=="function"){let r=z(()=>{e.setAttribute("style",ze(String(n()),{element:e}))},e);S(e,r);return}if(typeof n=="string"){e.setAttribute("style",ze(n,{element:e}));return}let t=e;for(let r in n){let o=n[r],i=Oa(r);if(typeof o=="function"){let s=o,a=z(()=>{t.style.setProperty(i,Fe(String(s()),{property:i,element:e}))},e);S(e,a)}else t.style.setProperty(i,Fe(String(o),{property:i,element:e}))}}function Pa(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=z(()=>{e.setAttribute("class",n())},e);S(e,i);return}let t=n,r=!1,o="";for(let i in t){let s=t[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=z(()=>{let a="";for(let c in t){let d=t[c];(typeof d=="function"?d():d)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);S(e,s)}else e.setAttribute("class",o)}function Tt(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),S(e,ce(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),S(e,ce(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),S(e,ce(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}var l=(e,n)=>{let t=$a(e);return(r,o)=>{if(t)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=n?document.createElementNS(n,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Tt(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Tt(i,r),i;let s=r,a=s.class;a!=null&&Pa(i,a);let c=s.id;c!=null&&(!1,i.id=c);let d=o!==void 0?o:s.nodes;d!=null&&Tt(i,d);let u=s.on;if(u)for(let p in u){let m=u[p];typeof m=="function"?i.addEventListener(p,m):!1}let f=s.style;f!=null&&Ia(i,f);let g=s.ref;g&&(g.current=i);for(let p in s)switch(p){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let m=s[p];if(m==null||me(p))continue;typeof m=="function"?S(i,Ke(i,p,m)):q(i,p,m,{syncValueProperty:!1,label:"tagFactory"})}}return s.onElement&&typeof s.onElement=="function"&&s.onElement(i),i}};var tu=l("html"),Un=l("head"),Jn=l("body"),Gn=l("title"),k=l("div"),R=l("span"),Yn=l("section"),Zn=l("article"),Xn=l("header"),Qn=l("footer"),er=l("nav"),tr=l("main"),nr=l("aside"),rr=l("address"),Ue=l("p"),or=l("h1"),ir=l("h2"),Je=l("h3"),sr=l("h4"),ar=l("h5"),cr=l("h6"),ur=l("blockquote"),lr=l("dd"),dr=l("dl"),fr=l("dt"),pr=l("figcaption"),mr=l("figure"),gr=l("hr"),br=l("li"),hr=l("ol"),yr=l("ul"),Ge=l("pre"),vr=l("a"),xr=l("abbr"),Sr=l("b"),Tr=l("bdi"),Er=l("bdo"),wr=l("br"),kr=l("cite"),Ye=l("code"),_r=l("data"),Ar=l("dfn"),Cr=l("em"),Nr=l("i"),Lr=l("kbd"),Rr=l("mark"),Mr=l("q"),Hr=l("rp"),$r=l("rt"),Dr=l("ruby"),Or=l("s"),Ir=l("samp"),Pr=l("small"),Br=l("strong"),Fr=l("sub"),zr=l("sup"),Vr=l("time"),qr=l("u"),Wr=l("var"),jr=l("area"),Kr=l("audio"),Ur=l("img"),Jr=l("map"),Gr=l("track"),Yr=l("video"),Zr=l("embed"),Xr=l("iframe"),Qr=l("object"),eo=l("param"),to=l("picture"),no=l("portal"),ro=l("source"),oo=l("svg",N),io=l("math"),so=l("canvas"),ao=l("noscript"),co=l("script"),uo=l("del"),lo=l("ins"),fo=l("caption"),po=l("col"),mo=l("colgroup"),go=l("table"),bo=l("tbody"),ho=l("td"),yo=l("tfoot"),vo=l("th"),xo=l("thead"),So=l("tr"),xe=l("button"),To=l("datalist"),Eo=l("fieldset"),wo=l("form"),ko=l("input"),_o=l("label"),Ao=l("legend"),Co=l("meter"),No=l("optgroup"),Lo=l("option"),Ro=l("output"),Mo=l("progress"),Ho=l("select"),$o=l("textarea"),Do=l("details"),Oo=l("dialog"),Io=l("menu"),Po=l("summary"),Bo=l("slot"),Fo=l("template"),zo=l("base"),Vo=l("link"),qo=l("meta"),ne=l("style"),Wo=l("circle",N),jo=l("ellipse",N),Ko=l("g",N),Uo=l("line",N),Jo=l("path",N),Go=l("polygon",N),Yo=l("polyline",N),Zo=l("rect",N),Xo=l("text",N),Qo=l("tspan",N),ei=l("defs",N),ti=l("clipPath",N),ni=l("mask",N),ri=l("pattern",N),oi=l("linearGradient",N),ii=l("radialGradient",N),si=l("stop",N),ai=l("use",N),ci=l("symbol",N),ui=l("marker",N),li=l("center"),di=l("font"),fi=l("marquee"),pi=e=>l(e);var Et="__sibuPendingError";function mi(e,n){let t=()=>e.parentNode?(_(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[Et]=n)})}function Le(e){let n=e,t=n[Et];if(t instanceof Error)return delete n[Et],t}function wt(e){let n=null;return function(){if(n)return n();let r=k({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let s=n();B(r,s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));B(r,k({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),mi(r,s)}),r.appendChild(R("sibu-lazy-loading","Loading...")),S(r,()=>{o=!0}),r}}function kt({nodes:e,fallback:n}){let t=k({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,s=null;return S(t,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!t.contains(s)&&L(s)}),queueMicrotask(()=>{if(!o)try{let a=e();if(s=a,a.classList.contains("sibu-lazy")){if(!a.querySelector(".sibu-lazy-loading")){B(t,a);return}i=new MutationObserver(()=>{if(o)return;a.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,B(t,a))}),i.observe(a,{childList:!0,subtree:!0})}else B(t,a)}catch(a){let c=a instanceof Error?a:new Error(String(a));mi(t,c)}}),t}function Nt(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";_(t,{phase:r,name:n});return}}function _t(e,n,t){let r=Nt(e,n);typeof r=="function"&&t&&S(t,r)}var Se=new WeakMap,ue=new WeakMap,Z=new Set,X=new Set,Te=null,Ze=0,Ba=256;function At(e){let n=Se.get(e);if(n){Se.delete(e),Z.delete(e);for(let t of n)try{t()}catch{}}}function Ct(e){ue.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=ue.get(e);if(t){ue.delete(e),X.delete(e);for(let r of t)try{r()}catch{}}})}function Fa(e){if(Z.size===0||e.nodeType!==1)return;let n=e;if(Z.has(n)&&n.isConnected&&At(n),n.firstElementChild)for(let t of Array.from(Z))t!==n&&t.isConnected&&n.contains(t)&&At(t)}function za(e){if(X.size===0||e.nodeType!==1)return;let n=e;if(X.has(n)&&!n.isConnected&&Ct(n),n.firstElementChild)for(let t of Array.from(X))t!==n&&!t.isConnected&&n.contains(t)&&Ct(t)}function Va(){if(Z.size>0)for(let e of Array.from(Z))e.isConnected&&At(e);if(X.size>0)for(let e of Array.from(X))e.isConnected||Ct(e)}function gi(){Te||typeof document>"u"||(Te=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)Fa(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)za(n.removedNodes[t])}Ze+=e.length,Ze>=Ba&&(Ze=0,Va()),Lt()}),Te.observe(document.body,{childList:!0,subtree:!0}))}function Lt(){Te&&Z.size===0&&X.size===0&&(Te.disconnect(),Te=null,Ze=0)}function qa(e,n){let t=Se.get(e);return t||(t=[],Se.set(e,t)),t.push(n),Z.add(e),gi(),()=>{let r=Se.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(Se.delete(e),Z.delete(e))}Lt()}}function Wa(e,n){let t=ue.get(e);return t||(t=[],ue.set(e,t)),t.push(n),X.add(e),gi(),()=>{let r=ue.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(ue.delete(e),X.delete(e))}Lt()}}function Re(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(S(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||_t(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){_t(e,"onMount",n);return}let r=qa(n,()=>{t||_t(e,"onMount",n)});S(n,r)})}else queueMicrotask(()=>{Nt(e,"onMount")})}function bi(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,Nt(e,"onUnmount"))};S(n,r);let o=()=>{if(t)return;let i=Wa(n,r);S(n,i)};n.isConnected?o():Re(()=>{o()},n)}function hi(e,n){S(n,e)}var Rt=Symbol.for("sibujs.ssr.v1");function ja(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,t=process.getBuiltinModule;typeof t=="function"?n=t("node:async_hooks"):typeof rt=="function"&&(n=rt("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var le=globalThis[Rt]??(globalThis[Rt]=ja()),Me=le.als,J=le.fallbackStore;le.fallbackDepth??(le.fallbackDepth=0);var yi=!1;function Ka(){if(yi||Me||!(typeof process<"u"&&!!process.versions?.node))return;yi=!0;let n=process.versions.node;`${n}`}function re(){if(Me){let e=Me.getStore();if(e)return e}return J}function V(){return re().ssr}function Mt(e){if(!V())return null;let n=re(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function Ht(){re().ssr=!0}function $t(){re().ssr=!1}function Dt(e){let n={ssr:!0,suspenseIdCounter:0,locale:void 0};if(Me)return Me.run(n,e);Ka();let t=J.ssr,r=J.suspenseIdCounter,o=J.locale;J.ssr=!0,J.suspenseIdCounter=0,J.locale=void 0,le.fallbackDepth++;try{return e()}finally{le.fallbackDepth--,J.ssr=t,J.suspenseIdCounter=r,J.locale=o}}function Ot(e){let n=re(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var Si=globalThis;function Ti(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,be(()=>n(o,void 0));else{let i=t;t=o,be(()=>n(o,i))}}}var vi=100;function It(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){_(r,{phase:"cleanup"})}}}function xi(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&It(e),Y(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=vi);e.rerunPending&&(e.rerunPending=!1,_(new Error(`effect re-requested itself ${vi}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Ua(e){if(e.disposed)return;e.disposed=!0;let n=Si.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&It(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{Fn(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function F(e,n){if(V())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=s=>{t.userCleanups.push(s)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(s){r(s)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(!t.disposed){if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&It(t),Y(t.bodyFn,o),t.rerunPending&&xi(t)}finally{t.running=!1,t.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,t.subscriber=o,t.running=!0;try{Y(t.bodyFn,t.subscriber),t.rerunPending&&xi(t)}finally{t.running=!1,t.rerunPending=!1}let i=Si.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>Ua(t)}var He=0,Pt=new Set;function Ja(e){He++;try{return e()}finally{He--,He===0&&Za()}}function Ga(e){return He===0?!1:(Pt.add(e),!0)}function Ya(){return He>0}function Za(){try{for(let e of Pt)Vn(e)}finally{Pt.clear()}zn()}var Ei=Symbol.for("sibujs.reactive.batch.v1");function Xa(){let e=globalThis,n=e[Ei];if(n)return n;let t={batch:Ja,enqueueBatchedSignal:Ga,isBatching:Ya};return e[Ei]=t,t}var Bt=Xa(),P=Bt.batch,oe=Bt.enqueueBatchedSignal,wi=Bt.isBatching;var Ft=globalThis;function C(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=n?.equals;r&&(t.__name=r);function i(){return he(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let c=t.value,d=typeof a=="function"?a(c):a;if(!o(c,d)){if(t.value=d,t.__v++,!1){let u=Ft.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&u.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:d})}oe(t)||ye(t)}}:s=a=>{let c=t.value,d=typeof a=="function"?a(c):a;Object.is(d,c)||(t.value=d,t.__v++,oe(t)||ye(t))},!1){let a=Ft.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}function ki(e){let[n,t]=C(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var Qa=`
5
+ `?2:1);let a=Number.parseInt(i,16),c=a===0||a>1114111||a>=55296&&a<=57343;n+=c?"\uFFFD":String.fromCodePoint(a),t=s-1;continue}n+=o,t+=1}return n}var mn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid"];function oa(e){if(!e)return"an element";let n=e.tagName.toLowerCase(),t=e.getAttribute("id");t&&(n+=`#${t}`);let r=e.getAttribute("class");return r&&(n+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${n}>`}var ct=new Set,gn=100,bn=!1;function yn(e,n,t){}function ut(e){if(!ta.test(e))return-1;let t=(e.includes("\\")?ra(e):e).toLowerCase().replace(/\s+/g,"");for(let r=0;r<mn.length;r++)if(t.includes(mn[r]))return r;return-1}function Fe(e,n){let t=ut(e);return t===-1?e:(yn(e,t,n),"")}function ze(e,n){let t=String(e);if(t.trim()==="")return"";if(typeof document>"u")return Fe(t,n)===""?"":t;let r=document.createElement("div");try{r.style.cssText=t}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),c=ut(a);if(c===-1&&(c=ut(`${s}:${a}`)),c!==-1){yn(a,c,{property:s,element:n?.element});continue}let l=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${l?` !${l}`:""}`)}return o.join("; ")}var ia=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),sa=new Set(["srcdoc"]);function vn(e){return sa.has(e.toLowerCase())}function xn(e,n,t){let r=e.toLowerCase();return r==="srcset"?ea(n):ia.has(r)?hn(n):r==="style"?ze(n,t):n}var aa="http://www.w3.org/1999/xhtml",ca="http://www.w3.org/2000/svg",ua="http://www.w3.org/1999/xlink",la="http://www.w3.org/XML/1998/namespace",da=new Set(["checked","disabled","selected"]);function fa(e){return e.namespaceURI===null||e.namespaceURI===aa}function Sn(e,n,t){e[n]=t}function pa(e,n){if(e.namespaceURI!==ca)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?ua:t.startsWith("xml:")?la:null}function q(e,n,t,r={}){let o=pa(e,n),i=o?n.slice(n.indexOf(":")+1):n;if(me(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;if(t==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;if(vn(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let s=fa(e),a=s?n.toLowerCase():n;if(typeof t=="boolean")return s&&da.has(a)&&a in e?Sn(e,a,t):t?o?e.setAttributeNS(o,n,""):e.setAttribute(n,""):o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;let c=String(t);if(r.syncValueProperty!==!1&&s&&(a==="value"||a==="checked")&&a in e)return Sn(e,a,a==="checked"?!!t:c),!0;let l=xn(n,c,{element:e});return(o?e.getAttributeNS(o,i):e.getAttribute(n))===l||(o?e.setAttributeNS(o,n,l):e.setAttribute(n,l)),!0}var ma=4096,lt=[];function ga(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function ba(e,n,t){let r=lt.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=ga();return o.sig=e,o.sub=n,o.epoch=t,o}function Tn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,lt.length<ma&&lt.push(e)}function ha(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function En(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function ya(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function va(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var j=null,dt=null,ee=0,te=[],W=new Set,xa=[];function Sa(e){try{e()}catch(n){let t=e;_(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function Ta(e){let n=e.depsHead??null;if(n===null)return!0;for(;n!==null;){let t=n.sig;if(t===null)return!0;if(t._d===!0&&t._validate!==void 0)try{t._validate()}catch{return!0}if(n.depVersion!==t.__v)return!0;n=n.subNext}return!1}var Ve=0,pt=!1;function mt(){Ve===0&&(dt=j,j=null,pt=!0),Ve++}function gt(){Ve--,Ve===0&&(j=dt,dt=null,pt=!1)}function wn(){return pt}function kn(e){mt();try{return e()}finally{gt()}}var Ea=0;function bt(e,n){let t=j;j=n;let r=n,o=++Ea;r._epoch=o,r._structDirty=!1;for(let i=r.depsHead??null;i!==null;i=i.subNext){let s=i.sig;i.prevActive=s.__activeNode??null,s.__activeNode=i}try{e()}finally{j=t;let i=r.depsHead??null;for(;i!==null;){let s=i.subNext,a=i.sig;a.__activeNode=i.prevActive,i.prevActive=null,i.epoch!==o&&(va(i),En(i),Tn(i)),i=s}}}function _n(e,n){if(!n)return ht(e);ge(n);let t=j;j=n;try{e()}finally{j=t;let o=n;for(let i=o.depsHead??null;i!==null;i=i.subNext){let s=i.sig;s.__activeNode=i.prevActive,i.prevActive=null}}let r=n;return r._dispose??(r._dispose=()=>ge(n))}function ht(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{bt(e,r)}finally{o._reentrant=!1}}},r=t;r.depsHead=null,r.depsTail=null,r._epoch=0,r._structDirty=!1,r._hasComputedDep=!1,r._runEpoch=0,r._runs=0,r._reentrant=!1,r._disposed=!1,r._errorPhase="binding",r._errorNode=n;try{t()}catch(o){throw r._disposed=!0,r._errorNode=void 0,ge(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,ge(r)})}function An(e){if(!j)return;let n=j,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r,o.depVersion=t.__v??Number.NaN;return}t._validate!==void 0&&(n._hasComputedDep=!0);let i=ba(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,ya(n,i),ha(t,i),n._structDirty=!0}function ge(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;En(t),Tn(t),t=r}}var qe=1e3,We=1e6,je=0,ae=new Set;function Cn(e){let n=qe;return Number.isFinite(e)&&e>0&&(qe=Math.floor(e)),n}function Nn(e){let n=We;return Number.isFinite(e)&&e>0&&(We=Math.floor(e)),n}function wa(e){let n=e;return n._runEpoch!==je?(n._runEpoch=je,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>qe)}function ka(e){let n=e.__name??"<unnamed>";_(new Error(`subscriber "${n}" fired more than ${qe} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:n})}function _a(){_(new Error(`Notification drain exceeded ${We} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Ln(){let e=0;for(;e<te.length;){if(e>=We){_a();break}let n=te[e++];if(W.delete(n),!(ae.size>0&&ae.has(n))&&!(n._hasComputedDep===!0&&!Ta(n))){if(wa(n)){ka(n),ae.add(n);continue}Sa(n)}}}function Rn(){if(!(ee>0)){ee++,je++;try{Ln()}finally{ee--,ee===0&&(te.length=0,W.clear(),ae.size>0&&ae.clear())}}}function ft(e){e();let n=e._sig;if(!n)return;let t=xa,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?a._d||(a._d=!0,t.push(a)):s()}else W.has(s)||(W.add(s),te.push(s));i=i.sigNext}}}function Mn(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?ft(r):W.has(r)||(W.add(r),te.push(r))),t=t.sigNext}}function Hn(e){let t=e.subsHead;if(t){if(ee>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?ft(o):W.has(o)||(W.add(o),te.push(o))),r=r.sigNext}return}ee++,je++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?ft(o):W.has(o)||(W.add(o),te.push(o))),r=r.sigNext}Ln()}finally{ee--,ee===0&&(te.length=0,W.clear(),ae.size>0&&ae.clear())}}}function $n(e){return e.__sc??0}function Dn(e){let n=e,t=[],r=n.depsHead??null;for(;r;)r.sig&&t.push(r.sig),r=r.subNext;return t}function In(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var On="4.3.0",Pn=Symbol.for("sibujs.reactive.v1");function Ca(){let e=globalThis,n=e[Pn];if(n)return!1,n;let t={suspendTracking:mt,resumeTracking:gt,isTrackingSuspended:wn,untracked:kn,retrack:bt,track:_n,reactiveBinding:ht,recordDependency:An,cleanup:ge,setMaxSubscriberRepeats:Cn,setMaxDrainIterations:Nn,drainNotificationQueue:Rn,queueSignalNotification:Mn,notifySubscribers:Hn,getSubscriberCount:$n,getSubscriberDeps:Dn,forEachSubscriber:In,version:On};return e[Pn]=t,t}var $=Ca(),Ae=$.suspendTracking,Ce=$.resumeTracking,Bn=$.isTrackingSuspended,be=$.untracked,Y=$.retrack,D=$.track,z=$.reactiveBinding,he=$.recordDependency,Fn=$.cleanup,Rc=$.setMaxSubscriberRepeats,yt=$.setMaxDrainIterations,zn=$.drainNotificationQueue,Vn=$.queueSignalNotification,ye=$.notifySubscribers,Mc=$.getSubscriberCount,Hc=$.getSubscriberDeps,$c=$.forEachSubscriber;function Ke(e,n,t){if(me(n))return q(e,n,"",{label:`bindAttribute("${n}")`}),()=>{};function r(){let o;try{o=t()}catch(i){_(i,{phase:"binding",name:`bindAttribute("${n}")`,node:e});return}q(e,n,o,{label:`bindAttribute("${n}")`})}return z(r,e)}function vt(e,n,t){let r=null;function o(){let s;try{s=typeof n=="function"?n():n}catch(c){_(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof t=="function"?t():t}catch(c){_(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),q(e,s,a,{label:"bindDynamic"})&&(r=s)}let i=z(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var xt=["data-focus-key","id","name"],Na=new Set(["text","search","url","tel","password",""]);function La(e){let n=e.tagName;if(!(n==="TEXTAREA"||n==="INPUT"&&Na.has(e.type.toLowerCase())))return{start:null,end:null,direction:null};let r=e;return{start:r.selectionStart,end:r.selectionEnd,direction:r.selectionDirection}}function Ne(e){if(e.length===0||typeof document>"u")return null;let n=document.activeElement;if(!n||n===document.body)return null;let t=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===n||s.nodeType===1&&s.contains(n)){t=!0;break}}if(!t)return null;let r=null,o=null;for(let i=0;i<xt.length;i++){let s=n.getAttribute(xt[i]);if(s){r=xt[i],o=s;break}}return{el:n,attr:r,value:o,tag:n.tagName,...La(n)}}function Ra(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ma(e,n){let t=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(n)&&(r++,t??(t=s));let a=s.querySelectorAll(n);for(let c=0;c<a.length;c++)r++,t??(t=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:t,count:r}:{el:null,count:r}}function qn(e,n){if(e.focus(),n.start!==null&&typeof e.setSelectionRange=="function"){let t=e,r=t.value.length,o=Math.min(n.start,r),i=Math.min(n.end??o,r);t.setSelectionRange(o,i,n.direction??"none")}}function ve(e,n,t){if(!e||typeof document>"u")return;let r=document.activeElement;if(r===e.el||r&&r!==document.body&&r!==document.documentElement)return;if(e.el.isConnected){qn(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=Ma(n,`[${e.attr}=${Ra(e.value)}]`);if(i&&i.tagName===e.tag){qn(i,e);return}o=s>1}}function ce(e,n){let t=[];function r(){let o;try{o=n()}catch(d){_(d,{phase:"binding",name:"bindChildNode",node:e});return}let i=Ne(t);if(o==null||typeof o=="boolean"){for(let d=0;d<t.length;d++){let p=t[d];L(p),p.parentNode&&p.parentNode.removeChild(p)}t.length=0,ve(i,t,"bindChildNode");return}let s=e.parentNode;if(!s){t.length=0;return}let a;if(Array.isArray(o)){a=[];let d=new Set;for(let p=0;p<o.length;p++){let g=o[p];if(g==null||typeof g=="boolean")continue;let f=g instanceof Node?g:document.createTextNode(String(g));if(d.has(f)){!1;continue}d.add(f),a.push(f)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(t.length>0&&a.length>0){let d=new Set(t);c=new Set;for(let p=0;p<a.length;p++)d.has(a[p])&&c.add(a[p])}for(let d=0;d<t.length;d++){let p=t[d];c?.has(p)||(L(p),p.parentNode&&p.parentNode.removeChild(p))}let l=e;for(let d=0;d<a.length;d++){let p=a[d];l.nextSibling!==p&&s.insertBefore(p,l.nextSibling),l=p}t=a,ve(i,a,"bindChildNode")}return z(r,e)}var N="http://www.w3.org/2000/svg",Ha=new Set(["script","iframe","object","embed","frame","frameset"]);function $a(e){return Ha.has(e.toLowerCase())}var Da=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var St=new Set,Wn=100,jn=!1,Kn=new Map;function Ia(e){let n=Kn.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Kn.set(e,n)),n}function Oa(e,n){if(typeof n=="function"){let r=z(()=>{e.setAttribute("style",ze(String(n()),{element:e}))},e);T(e,r);return}if(typeof n=="string"){e.setAttribute("style",ze(n,{element:e}));return}let t=e;for(let r in n){let o=n[r],i=Ia(r);if(typeof o=="function"){let s=o,a=z(()=>{t.style.setProperty(i,Fe(String(s()),{property:i,element:e}))},e);T(e,a)}else t.style.setProperty(i,Fe(String(o),{property:i,element:e}))}}function Pa(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=z(()=>{e.setAttribute("class",n())},e);T(e,i);return}let t=n,r=!1,o="";for(let i in t){let s=t[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=z(()=>{let a="";for(let c in t){let l=t[c];(typeof l=="function"?l():l)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);T(e,s)}else e.setAttribute("class",o)}function Tt(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),T(e,ce(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),T(e,ce(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),T(e,ce(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}var u=(e,n)=>{let t=$a(e);return(r,o)=>{if(t)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=n?document.createElementNS(n,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Tt(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Tt(i,r),i;let s=r,a=s.class;a!=null&&Pa(i,a);let c=s.id;c!=null&&(!1,i.id=c);let l=o!==void 0?o:s.nodes;l!=null&&Tt(i,l);let d=s.on;if(d)for(let f in d){let m=d[f];typeof m=="function"?i.addEventListener(f,m):!1}let p=s.style;p!=null&&Oa(i,p);let g=s.ref;g&&(g.current=i);for(let f in s)switch(f){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let m=s[f];if(m==null||me(f))continue;typeof m=="function"?T(i,Ke(i,f,m)):q(i,f,m,{syncValueProperty:!1,label:"tagFactory"})}}return s.onElement&&typeof s.onElement=="function"&&s.onElement(i),i}};var tu=u("html"),Un=u("head"),Jn=u("body"),Gn=u("title"),k=u("div"),R=u("span"),Yn=u("section"),Zn=u("article"),Xn=u("header"),Qn=u("footer"),er=u("nav"),tr=u("main"),nr=u("aside"),rr=u("address"),Ue=u("p"),or=u("h1"),ir=u("h2"),Je=u("h3"),sr=u("h4"),ar=u("h5"),cr=u("h6"),ur=u("blockquote"),lr=u("dd"),dr=u("dl"),fr=u("dt"),pr=u("figcaption"),mr=u("figure"),gr=u("hr"),br=u("li"),hr=u("ol"),yr=u("ul"),Ge=u("pre"),vr=u("a"),xr=u("abbr"),Sr=u("b"),Tr=u("bdi"),Er=u("bdo"),wr=u("br"),kr=u("cite"),Ye=u("code"),_r=u("data"),Ar=u("dfn"),Cr=u("em"),Nr=u("i"),Lr=u("kbd"),Rr=u("mark"),Mr=u("q"),Hr=u("rp"),$r=u("rt"),Dr=u("ruby"),Ir=u("s"),Or=u("samp"),Pr=u("small"),Br=u("strong"),Fr=u("sub"),zr=u("sup"),Vr=u("time"),qr=u("u"),Wr=u("var"),jr=u("area"),Kr=u("audio"),Ur=u("img"),Jr=u("map"),Gr=u("track"),Yr=u("video"),Zr=u("embed"),Xr=u("iframe"),Qr=u("object"),eo=u("param"),to=u("picture"),no=u("portal"),ro=u("source"),oo=u("svg",N),io=u("math"),so=u("canvas"),ao=u("noscript"),co=u("script"),uo=u("del"),lo=u("ins"),fo=u("caption"),po=u("col"),mo=u("colgroup"),go=u("table"),bo=u("tbody"),ho=u("td"),yo=u("tfoot"),vo=u("th"),xo=u("thead"),So=u("tr"),xe=u("button"),To=u("datalist"),Eo=u("fieldset"),wo=u("form"),ko=u("input"),_o=u("label"),Ao=u("legend"),Co=u("meter"),No=u("optgroup"),Lo=u("option"),Ro=u("output"),Mo=u("progress"),Ho=u("select"),$o=u("textarea"),Do=u("details"),Io=u("dialog"),Oo=u("menu"),Po=u("summary"),Bo=u("slot"),Fo=u("template"),zo=u("base"),Vo=u("link"),qo=u("meta"),ne=u("style"),Wo=u("circle",N),jo=u("ellipse",N),Ko=u("g",N),Uo=u("line",N),Jo=u("path",N),Go=u("polygon",N),Yo=u("polyline",N),Zo=u("rect",N),Xo=u("text",N),Qo=u("tspan",N),ei=u("defs",N),ti=u("clipPath",N),ni=u("mask",N),ri=u("pattern",N),oi=u("linearGradient",N),ii=u("radialGradient",N),si=u("stop",N),ai=u("use",N),ci=u("symbol",N),ui=u("marker",N),li=u("center"),di=u("font"),fi=u("marquee"),pi=e=>u(e);var Et="__sibuPendingError";function mi(e,n){let t=()=>e.parentNode?(_(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[Et]=n)})}function Le(e){let n=e,t=n[Et];if(t instanceof Error)return delete n[Et],t}function wt(e){let n=null;return function(){if(n)return n();let r=k({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let s=n();B(r,s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));B(r,k({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),mi(r,s)}),r.appendChild(R("sibu-lazy-loading","Loading...")),T(r,()=>{o=!0}),r}}function kt({nodes:e,fallback:n}){let t=k({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,s=null;return T(t,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!t.contains(s)&&L(s)}),queueMicrotask(()=>{if(!o)try{let a=e();if(s=a,a.classList.contains("sibu-lazy")){if(!a.querySelector(".sibu-lazy-loading")){B(t,a);return}i=new MutationObserver(()=>{if(o)return;a.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,B(t,a))}),i.observe(a,{childList:!0,subtree:!0})}else B(t,a)}catch(a){let c=a instanceof Error?a:new Error(String(a));mi(t,c)}}),t}function Nt(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";_(t,{phase:r,name:n});return}}function _t(e,n,t){let r=Nt(e,n);typeof r=="function"&&t&&T(t,r)}var Se=new WeakMap,ue=new WeakMap,Z=new Set,X=new Set,Te=null,Ze=0,Ba=256;function At(e){let n=Se.get(e);if(n){Se.delete(e),Z.delete(e);for(let t of n)try{t()}catch{}}}function Ct(e){ue.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=ue.get(e);if(t){ue.delete(e),X.delete(e);for(let r of t)try{r()}catch{}}})}function Fa(e){if(Z.size===0||e.nodeType!==1)return;let n=e;if(Z.has(n)&&n.isConnected&&At(n),n.firstElementChild)for(let t of Array.from(Z))t!==n&&t.isConnected&&n.contains(t)&&At(t)}function za(e){if(X.size===0||e.nodeType!==1)return;let n=e;if(X.has(n)&&!n.isConnected&&Ct(n),n.firstElementChild)for(let t of Array.from(X))t!==n&&!t.isConnected&&n.contains(t)&&Ct(t)}function Va(){if(Z.size>0)for(let e of Array.from(Z))e.isConnected&&At(e);if(X.size>0)for(let e of Array.from(X))e.isConnected||Ct(e)}function gi(){Te||typeof document>"u"||(Te=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)Fa(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)za(n.removedNodes[t])}Ze+=e.length,Ze>=Ba&&(Ze=0,Va()),Lt()}),Te.observe(document.body,{childList:!0,subtree:!0}))}function Lt(){Te&&Z.size===0&&X.size===0&&(Te.disconnect(),Te=null,Ze=0)}function qa(e,n){let t=Se.get(e);return t||(t=[],Se.set(e,t)),t.push(n),Z.add(e),gi(),()=>{let r=Se.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(Se.delete(e),Z.delete(e))}Lt()}}function Wa(e,n){let t=ue.get(e);return t||(t=[],ue.set(e,t)),t.push(n),X.add(e),gi(),()=>{let r=ue.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(ue.delete(e),X.delete(e))}Lt()}}function Re(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(T(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||_t(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){_t(e,"onMount",n);return}let r=qa(n,()=>{t||_t(e,"onMount",n)});T(n,r)})}else queueMicrotask(()=>{Nt(e,"onMount")})}function bi(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,Nt(e,"onUnmount"))};T(n,r);let o=()=>{if(t)return;let i=Wa(n,r);T(n,i)};n.isConnected?o():Re(()=>{o()},n)}function hi(e,n){T(n,e)}var Rt=Symbol.for("sibujs.ssr.v1");function ja(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,t=process.getBuiltinModule;typeof t=="function"?n=t("node:async_hooks"):typeof rt=="function"&&(n=rt("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var le=globalThis[Rt]??(globalThis[Rt]=ja()),Me=le.als,J=le.fallbackStore;le.fallbackDepth??(le.fallbackDepth=0);var yi=!1;function Ka(){if(yi||Me||!(typeof process<"u"&&!!process.versions?.node))return;yi=!0;let n=process.versions.node;`${n}`}function re(){if(Me){let e=Me.getStore();if(e)return e}return J}function V(){return re().ssr}function Mt(e){if(!V())return null;let n=re(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function Ht(){re().ssr=!0}function $t(){re().ssr=!1}function Dt(e){let n={ssr:!0,suspenseIdCounter:0,locale:void 0};if(Me)return Me.run(n,e);Ka();let t=J.ssr,r=J.suspenseIdCounter,o=J.locale;J.ssr=!0,J.suspenseIdCounter=0,J.locale=void 0,le.fallbackDepth++;try{return e()}finally{le.fallbackDepth--,J.ssr=t,J.suspenseIdCounter=r,J.locale=o}}function It(e){let n=re(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var Si=globalThis;function Ti(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,be(()=>n(o,void 0));else{let i=t;t=o,be(()=>n(o,i))}}}var vi=100;function Ot(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){_(r,{phase:"cleanup"})}}}function xi(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&Ot(e),Y(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=vi);e.rerunPending&&(e.rerunPending=!1,_(new Error(`effect re-requested itself ${vi}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Ua(e){if(e.disposed)return;e.disposed=!0;let n=Si.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Ot(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{Fn(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function F(e,n){if(V())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=s=>{t.userCleanups.push(s)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(s){r(s)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(!t.disposed){if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&Ot(t),Y(t.bodyFn,o),t.rerunPending&&xi(t)}finally{t.running=!1,t.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,t.subscriber=o,t.running=!0;try{Y(t.bodyFn,t.subscriber),t.rerunPending&&xi(t)}finally{t.running=!1,t.rerunPending=!1}let i=Si.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>Ua(t)}var He=0,Pt=new Set;function Ja(e){He++;try{return e()}finally{He--,He===0&&Za()}}function Ga(e){return He===0?!1:(Pt.add(e),!0)}function Ya(){return He>0}function Za(){try{for(let e of Pt)Vn(e)}finally{Pt.clear()}zn()}var Ei=Symbol.for("sibujs.reactive.batch.v1");function Xa(){let e=globalThis,n=e[Ei];if(n)return n;let t={batch:Ja,enqueueBatchedSignal:Ga,isBatching:Ya};return e[Ei]=t,t}var Bt=Xa(),P=Bt.batch,oe=Bt.enqueueBatchedSignal,wi=Bt.isBatching;var Ft=globalThis;function C(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=n?.equals;r&&(t.__name=r);function i(){return he(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;if(!o(c,l)){if(t.value=l,t.__v++,!1){let d=Ft.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l})}oe(t)||ye(t)}}:s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;Object.is(l,c)||(t.value=l,t.__v++,oe(t)||ye(t))},!1){let a=Ft.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}function ki(e){let[n,t]=C(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var Qa=`
6
6
  .sibu-error-display {
7
7
  border: 1px solid var(--sibu-err-border, #e5484d);
8
8
  border-radius: 10px;
@@ -187,7 +187,7 @@
187
187
  `);for(let r of t){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){n.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&n.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return n}function Ai(e){if(e instanceof Error){let n=e.code??e.name??"ERROR",t=e.message||"Unknown error",r=e.stack??"",o=tc(r),i=e.cause,s=i!=null?Ai(i):null;return{code:n,message:t,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function nc(e,n,t){let r=[];r.push(t),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
188
188
  `).map(s=>` ${s}`).join(`
189
189
  `);r.push(i)}o=o.cause}if(n&&Object.keys(n).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(n))r.push(` ${i}: ${String(s)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
190
- `)}function Ci(e){let n=e.map((t,r)=>k({class:"sibu-err-frame",nodes:[R({class:"sibu-err-line",nodes:String(r+1)}),R({class:"sibu-err-fn",nodes:t.fn}),R({class:"sibu-err-loc",nodes:` \u2014 ${t.loc}`})]}));return Ge({class:"sibu-err-stack",nodes:n})}function Ni(e){return e?[k({class:"sibu-err-cause-label",nodes:"Caused by"}),k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[R({nodes:`[${e.code}] ${e.message}`}),R({nodes:""})]}),e.frames.length>0?Ci(e.frames):k({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Ni(e.cause)]:[]}function rc(e){let n=[];for(let[r,o]of Object.entries(e)){n.push(document.createElement("dt")),n[n.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),n.push(i)}let t=document.createElement("dl");t.className="sibu-err-meta";for(let r of n)t.appendChild(r);return t}function Xe(e){ec();let n=e.severity??"error",t=Ai(e.error),r=e.alwaysShowDetails??U(),o=e.title??t.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),c=xe({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let p=nc(t,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(p).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),d=k({class:"sibu-err-header",nodes:[Ye({class:"sibu-err-icon",nodes:t.code}),Je({class:"sibu-err-title",nodes:o}),c,R({class:"sibu-err-timestamp",nodes:i})]}),u=[Ue({class:"sibu-err-message",nodes:t.message})];r&&t.frames.length>0&&u.push(k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[R({nodes:"Stack Trace"})]}),Ci(t.frames)]})),r&&u.push(...Ni(t.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&u.push(k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[R({nodes:"Metadata"})]}),rc(e.metadata)]}));let f=[];e.onRetry&&f.push(xe({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&f.push(xe({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),f.length>0&&u.push(k({class:"sibu-err-actions",nodes:f}));let g=k({class:"sibu-err-body",nodes:u});return k({class:"sibu-error-display","data-severity":n,nodes:[d,g]})}var oc=`
190
+ `)}function Ci(e){let n=e.map((t,r)=>k({class:"sibu-err-frame",nodes:[R({class:"sibu-err-line",nodes:String(r+1)}),R({class:"sibu-err-fn",nodes:t.fn}),R({class:"sibu-err-loc",nodes:` \u2014 ${t.loc}`})]}));return Ge({class:"sibu-err-stack",nodes:n})}function Ni(e){return e?[k({class:"sibu-err-cause-label",nodes:"Caused by"}),k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[R({nodes:`[${e.code}] ${e.message}`}),R({nodes:""})]}),e.frames.length>0?Ci(e.frames):k({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Ni(e.cause)]:[]}function rc(e){let n=[];for(let[r,o]of Object.entries(e)){n.push(document.createElement("dt")),n[n.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),n.push(i)}let t=document.createElement("dl");t.className="sibu-err-meta";for(let r of n)t.appendChild(r);return t}function Xe(e){ec();let n=e.severity??"error",t=Ai(e.error),r=e.alwaysShowDetails??U(),o=e.title??t.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),c=xe({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let f=nc(t,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(f).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),l=k({class:"sibu-err-header",nodes:[Ye({class:"sibu-err-icon",nodes:t.code}),Je({class:"sibu-err-title",nodes:o}),c,R({class:"sibu-err-timestamp",nodes:i})]}),d=[Ue({class:"sibu-err-message",nodes:t.message})];r&&t.frames.length>0&&d.push(k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[R({nodes:"Stack Trace"})]}),Ci(t.frames)]})),r&&d.push(...Ni(t.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[R({nodes:"Metadata"})]}),rc(e.metadata)]}));let p=[];e.onRetry&&p.push(xe({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&p.push(xe({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),p.length>0&&d.push(k({class:"sibu-err-actions",nodes:p}));let g=k({class:"sibu-err-body",nodes:d});return k({class:"sibu-error-display","data-severity":n,nodes:[l,g]})}var oc=`
191
191
  .sibu-error-boundary {
192
192
  position: relative;
193
193
  }
@@ -341,7 +341,7 @@
341
341
  .sibu-error-fallback .sibu-error-btn-reload:hover {
342
342
  background: #3a3a4e;
343
343
  }
344
- `,ic=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Li=!1;function sc(){if(!Li&&typeof document<"u"){let e=ne({nodes:oc});document.head.appendChild(e),Li=!0}}function Ri(e,n){let t=typeof e=="function"?e:n,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;sc();let[a,c]=C(null),d=()=>{f(),c(null)},u=null,f=()=>{if(!u)return;let y=u;u=null,y()},g=y=>{let T=new Array(y.length);for(let E=0;E<y.length;E++)try{T[E]=y[E]()}catch(M){_(M,{phase:"effect",name:"ErrorBoundary.resetKeys"}),T[E]=ic}return T},p=()=>{let y=s;if(!y||y.length===0)return;f();let T=null;u=F(()=>{let E=g(y);if(T===null){T=E;return}let M=E.length!==T.length;if(!M){for(let O=0;O<E.length;O++)if(!Object.is(E[O],T[O])){M=!0;break}}T=E,M&&d()})},m=y=>{let T=at(y);if(c(T),p(),i)try{i(T)}catch(E){_(E,{phase:"render",name:"ErrorBoundary onError callback"})}return T},b=(y,T)=>Xe({error:y,severity:"error",onRetry:T}),x=y=>{let T=o||b;try{return T(y,d)}catch(E){return queueMicrotask(()=>{_(E,{phase:"render",name:"ErrorBoundary fallback",node:h.parentNode?h:void 0})}),document.createComment("error-boundary-failed")}},h=k({class:"sibu-error-boundary",nodes:()=>{let y=a();if(y)return x(y);try{let T=t();if(T&&typeof T.then=="function"){let E=k({class:"sibu-error-async"});E.appendChild(R({class:"sibu-lazy-loading",nodes:"Loading..."}));let M=!1;return S(E,()=>{M=!0}),T.then(O=>{if(M){L(O);return}B(E,O)}).catch(O=>{if(M)return;let pe=m(O);B(E,x(pe))}),E}return T}catch(T){let E=m(T);return x(E)}}}),w=y=>{if(a())return;let E=y.detail?.error;E&&(y.preventDefault(),y.stopPropagation(),m(E))};return h.addEventListener("sibu:error-propagate",w),Re(()=>{let y=document.createTreeWalker(h,NodeFilter.SHOW_ELEMENT),T=[],E=y.currentNode;for(;E;){let M=Le(E);M&&T.push(M),E=y.nextNode()}if(T.length===1)m(T[0]);else if(T.length>1){let M=globalThis.AggregateError;m(M?new M(T,`${T.length} pre-mount errors caught by ErrorBoundary`):new Error(T.map(O=>O.message).join("; ")))}},h),S(h,()=>{f(),h.removeEventListener("sibu:error-propagate",w)}),h}var ac=`
344
+ `,ic=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Li=!1;function sc(){if(!Li&&typeof document<"u"){let e=ne({nodes:oc});document.head.appendChild(e),Li=!0}}function Ri(e,n){let t=typeof e=="function"?e:n,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;sc();let[a,c]=C(null),l=()=>{p(),c(null)},d=null,p=()=>{if(!d)return;let v=d;d=null,v()},g=v=>{let S=new Array(v.length);for(let E=0;E<v.length;E++)try{S[E]=v[E]()}catch(M){_(M,{phase:"effect",name:"ErrorBoundary.resetKeys"}),S[E]=ic}return S},f=()=>{let v=s;if(!v||v.length===0)return;p();let S=null;d=F(()=>{let E=g(v);if(S===null){S=E;return}let M=E.length!==S.length;if(!M){for(let I=0;I<E.length;I++)if(!Object.is(E[I],S[I])){M=!0;break}}S=E,M&&l()})},m=v=>{let S=at(v);if(c(S),f(),i)try{i(S)}catch(E){_(E,{phase:"render",name:"ErrorBoundary onError callback"})}return S},b=(v,S)=>Xe({error:v,severity:"error",onRetry:S}),h=v=>{let S=o||b;try{return S(v,l)}catch(E){return queueMicrotask(()=>{_(E,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=k({class:"sibu-error-boundary",nodes:()=>{let v=a();if(v)return h(v);try{let S=t();if(S&&typeof S.then=="function"){let E=k({class:"sibu-error-async"});E.appendChild(R({class:"sibu-lazy-loading",nodes:"Loading..."}));let M=!1;return T(E,()=>{M=!0}),S.then(I=>{if(M){L(I);return}B(E,I)}).catch(I=>{if(M)return;let pe=m(I);B(E,h(pe))}),E}return S}catch(S){let E=m(S);return h(E)}}}),w=v=>{if(a())return;let E=v.detail?.error;E&&(v.preventDefault(),v.stopPropagation(),m(E))};return y.addEventListener("sibu:error-propagate",w),Re(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),S=[],E=v.currentNode;for(;E;){let M=Le(E);M&&S.push(M),E=v.nextNode()}if(S.length===1)m(S[0]);else if(S.length>1){let M=globalThis.AggregateError;m(M?new M(S,`${S.length} pre-mount errors caught by ErrorBoundary`):new Error(S.map(I=>I.message).join("; ")))}},y),T(y,()=>{p(),y.removeEventListener("sibu:error-propagate",w)}),y}var ac=`
345
345
  @keyframes sibu-spin {
346
346
  to { transform: rotate(360deg); }
347
347
  }
@@ -394,5 +394,5 @@
394
394
  .sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
395
395
  .sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
396
396
  .sibu-loading-lg .sibu-loading-dots { gap: 6px; }
397
- `,Mi=!1;function cc(){!Mi&&typeof document<"u"&&(document.head.appendChild(ne({nodes:ac})),Mi=!0)}function Hi(e={}){cc();let{text:n,variant:t="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return t==="dots"?k({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[k({class:"sibu-loading-dots",nodes:[R({class:"sibu-loading-dot"}),R({class:"sibu-loading-dot"}),R({class:"sibu-loading-dot"})]}),n?R({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)}):k({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[k({class:"sibu-loading-spinner"}),n?R({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)})}var zt=Symbol.for("sibujs.actions.v1"),$i=globalThis[zt]??(globalThis[zt]=new Map);function de(e,n){$i.set(e,n)}function Vt(e){return $i.get(e)}function Di(e,n,t){let r=typeof n=="string"?Vt(n):n;if(!r)throw new Error(`[SibuJS] No action registered under the name "${n}". Register it with registerAction() before applying it by name.`);let o=r(e,t);typeof o=="function"&&S(e,o)}var qt=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},Wt=(e,n)=>{let t=n.duration??500,r=null,o=()=>{r=setTimeout(()=>{n.callback(),r=null},t)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},jt=(e,n)=>{let t=()=>{let r=typeof n=="function"?n():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},Kt=e=>{let n=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return n(),e.addEventListener("input",n),()=>e.removeEventListener("input",n)},Ut=e=>{let n='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',t=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(n));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)};de("clickOutside",qt);de("longPress",Wt);de("copyOnClick",jt);de("autoResize",Kt);de("trapFocus",Ut);var fe=null;function Oi(e,n){try{let t=e();return t&&typeof t.then=="function"&&t.catch(r=>{n?n(r,"async"):fe?fe(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),t}catch(t){return n?n(t,"sync"):fe?fe(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function Ii(e,n){try{return await e()}catch(t){return n?n(t,"async"):fe?fe(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function Pi(e){fe=e}function Bi(e){let[n,t]=C(e),r=i=>{!!1||!V()||(`${i}`,void 0)};return{provide(i){r("provide");let s=n();return t(i),()=>t(s)},use(){return n},get(){return n()},set(i){r("set"),t(i)},withContext(i,s){r("withContext");let a=n();t(i);try{let c=s();return!1,c}finally{t(a)}}}}var Jt=Symbol.for("sibujs.createId.v1"),Gt=globalThis[Jt]??(globalThis[Jt]={n:0});function Fi(e="sibu"){return Gt.n++,`${e}-${Gt.n}`}function zi(){Gt.n=0}function Vi(e,n){let t=typeof n=="function"?n():n;return S(t,D(()=>{t.style.display=e()?"":"none"})),t}function qi(e,n,t,r,o){let i=typeof t=="function"?t():t;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===t,c=r.has(s),d=!a&&!c;return r.add(s),c&&void 0,e.insertBefore(s,n.nextSibling),{node:s,owned:d}}function Wi(e,n,t){let r=document.createComment("when"),o=null,i,s=!1,a=new WeakSet,c=!1,d=()=>{let u=e(),f=r.parentNode;if(!f||s&&u===i)return;i=u;let g=o?Ne([o]):null;o?.parentNode&&(c&&L(o),o.parentNode.removeChild(o),o=null);let m=qi(f,r,u?n:t!==void 0?t:null,a,"when");o=m.node,c=m.owned,ve(g,o?[o]:[],"when"),s=!0};return S(r,D(d)),s||queueMicrotask(()=>{!s&&r.parentNode&&d()}),r}function ji(e,n,t){let r=document.createComment("match"),o=null,i,s=!1,a=new WeakSet,c=!1,d=()=>{let u=String(e()),f=r.parentNode;if(!f||s&&u===i)return;i=u;let g=o?Ne([o]):null;o?.parentNode&&(c&&L(o),o.parentNode.removeChild(o),o=null);let p=Object.hasOwn(n,u)?n[u]:t,m=qi(f,r,p??null,a,"match");o=m.node,c=m.owned,ve(g,o?[o]:[],"match"),s=!0};return S(r,D(d)),s||queueMicrotask(()=>{!s&&r.parentNode&&d()}),r}var Yt=new Map;function Ki(e,n){Yt.set(e,n)}function Ui(e){Yt.delete(e)}function Zt(e){let n=Yt.get(e);return n?n():k({nodes:`[Component "${e}" not found]`})}function Ji(e){let n=k({class:"sibu-dynamic"});function t(){let o=e(),i;typeof o=="function"?i=o():i=Zt(o),B(n,i)}let r=D(t);return S(n,r),n}function Gi(e){return typeof e=="function"?Gi(e()):e instanceof Node?e:document.createTextNode(String(e))}function uc(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let a=0;a<n;a++){let c=e[a],d=0,u=t.length;for(;d<u;){let f=d+u>>1;e[t[f]]<c?d=f+1:u=f}t[d]=a,r[a]=d>0?t[d-1]:-1}let o=t.length,i=new Array(o),s=t[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Yi(e,n,t){t&&t.key;let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,d=new Map,u=new Map,f=[],g=[],p=[],m=0,b=[],x=[],h=new Uint8Array(0),w=new Map,y=[],T=[],E=new Map,M=!1,O=!1,pe=!1,Ns=t.key,on=()=>{if(pe)return;let K=e(),A=K.length,ie=r.parentNode;if(!ie)return;O||(ie.insertBefore(o,r.nextSibling),O=!0),x.length<A&&(x=new Array(A));for(let v=0;v<A;v++)x[v]=Ns(K[v]);let Q=x;b.length<A&&(b=new Array(A)),u.clear(),E.clear();for(let v=0;v<A;v++)!1,E.set(Q[v],v);m=0;for(let v=0;v<A;v++){let I=Q[v],an=d.get(I),we;if(an!==void 0)we=an,f[m]=we,g[m]=K[v],p[m]=v,m++;else{let[cn,Hs]=C(K[v]),[un,$s]=C(v),tt;try{tt=Gi(n(cn,un))}catch(Ds){let Os=Q[v];tt=document.createComment(`each:error:${v}`),queueMicrotask(()=>{_(Ds,{phase:"render",name:`each row (key="${String(Os)}")`,node:r.parentNode?r:void 0})})}we={node:tt,item:cn,setItem:Hs,index:un,setIndex:$s}}u.set(I,we),b[v]=we.node}for(let[v,I]of d)u.has(v)||(L(I.node),I.node.parentNode&&ie.removeChild(I.node));if(A===0){c=0;let v=d;d=u,u=v,M=!0,m=0;return}w.clear();for(let v=0;v<c;v++)w.set(a[v],v);y.length<A&&(y=new Array(A),T=new Array(A));let Oe=0;for(let v=0;v<A;v++){let I=w.get(Q[v]);I!==void 0&&(y[Oe]=v,T[Oe]=I,Oe++)}let sn=uc(T,Oe);h.length<A?h=new Uint8Array(A):h.fill(0,0,A);for(let v=0;v<sn.length;v++)h[y[sn[v]]]=1;let Ie=o;for(let v=A-1;v>=0;v--){let I=b[v];h[v]||I.nextSibling!==Ie&&ie.insertBefore(I,Ie),Ie=I}let Pe=a===i?s:i;Pe.length<A&&(Pe.length=A);for(let v=0;v<A;v++)Pe[v]=Q[v];a=Pe,c=A;let Ms=d;d=u,u=Ms,M=!0,Ls()};function Ls(){if(m===0)return;let K=m;m=0,P(()=>{for(let A=0;A<K;A++){let ie=f[A];ie.setItem(g[A]),ie.setIndex(p[A]),f[A]=void 0,g[A]=void 0}})}let Rs=D(on);return S(r,()=>{if(!pe){pe=!0,Rs();for(let K of d.values())L(K.node),K.node.parentNode?.removeChild(K.node);o.parentNode&&o.parentNode.removeChild(o),O=!1,d.clear(),u.clear(),E.clear(),w.clear(),c=0,f.length=0,g.length=0,p.length=0,m=0}}),M||queueMicrotask(()=>{!M&&!pe&&r.parentNode&&on()}),r}function Xi(e){let n=document.createDocumentFragment();for(let t of e)if(!(t==null||typeof t=="boolean"))if(Array.isArray(t))for(let r of t)r==null||typeof r=="boolean"||n.appendChild(Zi(r));else n.appendChild(Zi(t));return n}function Zi(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let n=e();return n instanceof Node?n:document.createTextNode(String(n??""))}return document.createTextNode(String(e))}var lc=new Set(["script","style"]),dc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Qi=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),es=new WeakMap;function fc(e){let n=e.length-1,t=e[0];for(let p=0;p<n;p++)t+=`\0${p}\0${e[p+1]}`;let r=0,o=t.length;function i(){for(;r<o&&(t[r]===" "||t[r]===" "||t[r]===`
398
- `||t[r]==="\r");)r++}function s(){if(t.charCodeAt(r)!==0)return-1;let p=r;r++;let m=0;for(;r<o&&t.charCodeAt(r)!==0;)m=m*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,m<0||m>=n?(r=p,-1):m}function a(){let p=r;for(;r<o;){let m=t.charCodeAt(r);if(m>=97&&m<=122||m>=65&&m<=90||m>=48&&m<=57||m===45)r++;else break}return t.slice(p,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let p=s();if(p>=0)return{kind:"expr",idx:p};let m=t[r];if(m==='"'||m==="'"){r++;let b=[],x=[],h="";for(;r<o&&t[r]!==m;){let w=s();w>=0?(b.push(h),h="",x.push(w)):h+=t[r++]}return r<o&&r++,b.push(h),x.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:x}}{let b=[],x=[],h="";for(;r<o;){let w=t.charCodeAt(r);if(w===32||w===9||w===10||w===13||w===62)break;let y=s();y>=0?(b.push(h),h="",x.push(y)):h+=t[r++]}return b.push(h),x.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:x}}}function d(){let p=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let m=r;for(;r<o;){let h=t.charCodeAt(r);if(h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57||h===45||h===58||h===95||h===46)r++;else break}let b=t.slice(m,r);if(!b)break;let x=c();b.startsWith("on:")?x.kind==="expr"&&p.push({t:3,name:b.slice(3),idx:x.idx}):x.kind==="bool"?p.push({t:4,name:b}):x.kind==="static"?p.push({t:0,name:b,value:x.value}):x.kind==="expr"?p.push({t:1,name:b,idx:x.idx}):x.kind==="mixed"&&p.push({t:2,name:b,statics:x.statics,exprs:x.exprs})}return p}function u(p){return p.replace(/\s+/g," ")}function f(p){let m="";for(;r<o&&t[r]!=="<";){let x=s();if(x>=0){let h=u(m);h&&p.push({t:1,value:h}),m="",p.push({t:2,idx:x})}else m+=t[r++]}let b=u(m);b&&p.push({t:1,value:b})}function g(){let p=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let m=t[r+1];if(m==="!"){if(t.startsWith("<!--",r)){let y=t.indexOf("-->",r+4);r=y===-1?o:y+3}else if(t.startsWith("<![CDATA[",r)){let y=t.indexOf("]]>",r+9);r=y===-1?o:y+3}else{let y=t.indexOf(">",r);r=y===-1?o:y+1}continue}if(m==="?"){let y=t.indexOf(">",r);r=y===-1?o:y+1;continue}if(!(m>="a"&&m<="z")&&!(m>="A"&&m<="Z")){p.push({t:1,value:"<"}),r++;continue}r++;let b=a(),x=d();i();let h=dc.has(b),w=t[r]==="/";if(w&&r++,r<o&&r++,h||w)p.push({t:0,el:{tag:b,svg:Qi.has(b),attrs:x,children:[]}});else{let y=g();if(lc.has(b.toLowerCase())){for(let T=0;T<y.length;T++)if(y[T].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,a(),i(),r<o&&t[r]===">"&&r++),p.push({t:0,el:{tag:b,svg:Qi.has(b),attrs:x,children:y}})}}else f(p);return p}return g()}function Xt(e,n){let t=e.svg?document.createElementNS(N,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:t.setAttribute(o.name,o.value);break;case 1:{let i=o.name,s=n[o.idx];typeof s=="function"?S(t,Ke(t,i,s)):q(t,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=n[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}q(t,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):!1;break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(Xt(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),S(t,ce(s,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?t.appendChild(a):a!=null&&typeof a!="boolean"&&t.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function Qt(e,...n){let t=es.get(e);if(t||(t=fc(e),es.set(e,t)),t.length===1&&t[0].t===0)return Xt(t[0].el,n);let r=document.createElement("div");for(let o=0;o<t.length;o++){let i=t[o];switch(i.t){case 0:r.appendChild(Xt(i.el,n));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=n[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),S(r,ce(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let c=s[a];c instanceof Node?r.appendChild(c):c!=null&&typeof c!="boolean"&&r.appendChild(document.createTextNode(String(c)))}else s!=null&&typeof s!="boolean"&&r.appendChild(document.createTextNode(String(s)));break}}}return r.childNodes.length===1&&r.firstChild instanceof Element?r.firstChild:r}function ts(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&U()&&void 0;let a,c=null,d=!1,u=!1,f=()=>{if(u)return;let p=e(),m=r.parentNode;if(!m||d&&p===a)return;c?.parentNode&&m.removeChild(c),a=p;let b=o.get(p);if(b){let x=i.indexOf(p);x!==-1&&(i.splice(x,1),i.push(p))}else{let x=n[p];if(!x){c=null,d=!0;return}if(b=x(),b instanceof DocumentFragment){let h=document.createElement("div");h.style.display="contents",h.appendChild(b),b=h}if(o.set(p,b),i.push(p),s>0&&i.length>s){let h=i.shift(),w=o.get(h);w&&(L(w),w.parentNode&&w.parentNode.removeChild(w),o.delete(h))}}m.insertBefore(b,r.nextSibling),c=b,d=!0},g=D(f);return d||queueMicrotask(()=>{!d&&r.parentNode&&f()}),S(r,()=>{u=!0,g();for(let p of o.values())L(p),p.parentNode&&p.parentNode.removeChild(p);o.clear(),i.length=0,c=null}),r}function ns(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let t=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-t:0;n.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:n,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),L(r),r.parentNode&&r.parentNode.removeChild(r)}}}function rs(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){queueMicrotask(()=>{_(s,{phase:"render",name:"Portal",node:t.parentNode?t:void 0})})}}),S(t,()=>{i=!0,o&&(L(o),o.remove(),o=null)}),t}function os(e,n="default"){return e?.[n]}function is(e=[]){let[n,t]=C([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return t(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){t(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return t(c=>{let d=[...c];return a=d.splice(o,i,...s),d}),a},remove(o){t(i=>i.filter((s,a)=>a!==o))},removeWhere(o){t(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){t([...o])},update(o,i){t(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){t(s=>s.map(a=>o(a)?i(a):a))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function ss(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,oe(r)||ye(r)}function i(){if(he(r),t===null){let a=n.slice();t=Object.freeze(a)}return t}return[i,{push(...a){a.length!==0&&(n.push(...a),o())},pop(){if(n.length===0)return;let a=n.pop();return o(),a},shift(){if(n.length===0)return;let a=n.shift();return o(),a},unshift(...a){a.length!==0&&(n.unshift(...a),o())},splice(a,c=0,...d){let u=n.splice(a,c,...d);return(u.length>0||d.length>0)&&o(),u},remove(a){a<0||a>=n.length||(n.splice(a,1),o())},removeWhere(a){let c=n.findIndex(a);c!==-1&&(n.splice(c,1),o())},set(a){n=[...a],o()},update(a,c){a<0||a>=n.length||Object.is(n[a],c)||(n[a]=c,o())},updateWhere(a,c){let d=!1;for(let u=0;u<n.length;u++)if(a(n[u])){let f=c(n[u]);Object.is(n[u],f)||(n[u]=f,d=!0)}d&&o()},sort(a){n.length<=1||(n.sort(a),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(a){let c=n.filter(a);c.length!==n.length&&(n=c,o())},map(a){let c=!1;for(let d=0;d<n.length;d++){let u=a(n[d],d);Object.is(n[d],u)||(n[d]=u,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function as(e,n){let[t,r]=C(n),[o,i]=C(!1),[s,a]=C(null),[c,d]=C(0),u=0,f=!1,g=null,p=()=>{if(g===null)return;let b=g;g=null;try{b.abort()}catch{}},m=F(()=>{if(c(),f)return;p();let b=++u,x=typeof AbortController<"u"?new AbortController:null;g=x,P(()=>{i(!0),a(null)});let h=()=>f||b!==u,w;try{w=e({signal:x?x.signal:void 0})}catch(y){if(h())return;P(()=>{a(y),i(!1)});return}w.then(y=>{h()||(g=null,P(()=>{r(y),i(!1)}))},y=>{h()||(g=null,P(()=>{a(y),i(!1)}))})});return{value:t,loading:o,error:s,refresh:()=>{f||d(b=>b+1)},dispose:()=>{f||(f=!0,m(),p())}}}function Ee(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let c=n;return e.source===c.source&&e.flags===c.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let c=n;if(e.size!==c.size)return!1;for(let[d,u]of e)if(!c.has(d)||!Ee(u,c.get(d),t))return!1;return!0}if(e instanceof Set){let c=n;if(e.size!==c.size)return!1;for(let d of e)if(!c.has(d))return!1;return!0}if(e instanceof ArrayBuffer){let c=new Uint8Array(e),d=new Uint8Array(n);if(c.length!==d.length)return!1;for(let u=0;u<c.length;u++)if(c[u]!==d[u])return!1;return!0}if(e instanceof DataView){if(!(n instanceof DataView)||e.byteLength!==n.byteLength)return!1;for(let c=0;c<e.byteLength;c++)if(e.getUint8(c)!==n.getUint8(c))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let c=e,d=n;if(c.length!==d.length)return!1;for(let u=0;u<c.length;u++)if(c[u]!==d[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((c,d)=>Ee(c,n[d],t));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(c=>Object.hasOwn(o,c)&&Ee(r[c],o[c],t))}function cs(e){return C(e,{equals:(n,t)=>Ee(n,t)})}function Qe(e,n){let t=n?.name,r=n?.equals,o={};o._d=!1,o._init=!1,o._g=e,o.__v=0;let i=()=>{o._d||(o._d=!0)};i._c=1,i._sig=o;let s=()=>{let f=e();o._v=r&&o._init&&r(o._v,f)?o._v:f,o._d=!1,o._init=!0};D(()=>{let f=!0;try{o._v=e(),o._d=!1,o._init=!0,f=!1}finally{f&&(o._d=!0)}},i);let a=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,c=!1,d=()=>{if(!o._d)return;let f=o._v;c=!0;try{Y(s,i),Object.is(f,o._v)||o.__v++}finally{c=!1}a&&!Object.is(f,o._v)&&a.emit("computed:update",{signal:o,oldValue:f,newValue:o._v})};o._validate=d;function u(){if(c)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Bn()?(o._d&&d(),o._v):(o._d&&d(),he(o),o._v)}return t&&(u.__name=t,o.__name=t),u.__signal=o,a&&a.emit("computed:create",{signal:o,name:t,getter:u}),u}function us(e){let[n,t]=C(e);return{get current(){return n()},set current(r){t(r)}}}function ls(e){e!==null&&typeof e=="object"&&Array.isArray(e);let n={};Object.keys(e).forEach(c=>{let[d,u]=C(e[c]);n[c]=[d,u]});let t=new Proxy({},{get(c,d){if(typeof d=="string"&&Object.hasOwn(n,d)){let u=n[d][0];return u()}return Reflect.get(c,d)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(n).forEach(d=>{c[d]=n[d][0]()}),c};return[t,{setState:c=>{let d=r(),u=typeof c=="function"?c(d):c;P(()=>{Object.entries(u).forEach(([f,g])=>{Object.hasOwn(n,f)&&n[f][1](g)})})},reset:()=>{P(()=>{Object.keys(e).forEach(c=>{let d=n[c][1];d(e[c])})})},subscribe:c=>{let d=!0;return F(()=>{let u=r();if(d){d=!1;return}Ae();try{c(u)}finally{Ce()}})},subscribeKey:(c,d)=>{let u,f=!0;return F(()=>{let g=n[c][0]();if(f){u=g,f=!1;return}if(!Object.is(g,u)){let p=u;u=g,Ae();try{d(g,p)}finally{Ce()}}})},getSnapshot:r}]}function ds(e,n){if(V())return()=>{};let t,r=!0;return D(()=>{let s=e();if(r){t=s,r=!1;return}if(!Object.is(s,t)){let a=t;t=s,Ae();try{n(s,a)}finally{Ce()}}})}function fs(e,n,t){return[Qe(e,t),i=>{P(()=>n(i))}]}function ps(e){let n=e();return U()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function ms(e){if(!U())return F(e);let n=F(e),t=null;return queueMicrotask(()=>{try{t=F(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}var en="data-sibu-enhanced",tn=new WeakMap;function gs(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=ke){let i=r.length-o+e.length;e.length=0,_e(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var bs=["text","attr","class","show","on","cleanup"];function hs(e,n){if(n==null)return e;if(typeof n!="string")return n;let t=n.startsWith("@")?`[data-ref="${n.slice(1)}"]`:n;try{return e.querySelector(t)}catch{return null}}function $e(e,n){return V()?()=>{}:z(n,e)}function pc(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,n=>n.value):e.value}function mc(e,n){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!n;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(n)?n.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let t=n==null?"":String(n);e.value!==t&&(e.value=t)}function gc(e,n,t,r){let o=`ctx.each[${r}]`;if(U())for(let i of Object.keys(t))bs.includes(i),`${o}${i}${bs.join(", ")}`;if(t.text!==void 0&&(t.text,`${o}`,e.text(n,t.text)),t.attr!==void 0)for(let i of Object.keys(t.attr)){let s=t.attr[i];`${o}${i}`,e.attr(n,i,s)}if(t.class!==void 0)for(let i of Object.keys(t.class)){let s=t.class[i];`${o}${i}`,e.classed(n,i,s)}if(t.show!==void 0&&(t.show,`${o}`,e.show(n,t.show)),t.on!==void 0)for(let i of Object.keys(t.on)){let s=t.on[i];`${o}${String(i)}`,e.on(n,i,s)}t.cleanup!==void 0&&(t.cleanup,`${o}`,e.cleanup(t.cleanup))}function De(e,n){let t=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!t)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(t.getAttribute(en)==="true")return U()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=(u,f)=>{let g=hs(t,u);if(!g){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(u)} not found under`,t);return}f(g)},a={root:t,ref:u=>hs(t,u),refs:u=>{let f=u.startsWith("@")?`[data-ref="${u.slice(1)}"]`:u;try{return Array.from(t.querySelectorAll(f))}catch{return[]}},on:(u,f,g,p)=>{s(u,m=>{let b=x=>g(x,m);m.addEventListener(f,b,p),r.push(()=>m.removeEventListener(f,b,p))})},text:(u,f)=>{s(u,g=>{r.push($e(g,()=>{let p=f(),m=p==null?"":String(p);g.textContent!==m&&(g.textContent=m)}))})},attr:(u,f,g)=>{s(u,p=>{r.push($e(p,()=>{let m=g(),b=m==null?null:String(m);q(p,f,b,{syncValueProperty:!1,label:"enhance attr()"})}))})},classed:(u,f,g)=>{s(u,p=>{r.push($e(p,()=>{p.classList.toggle(f,!!g())}))})},show:(u,f)=>{s(u,g=>{let p=g.hidden;r.push($e(g,()=>{g.hidden=!f()})),r.push(()=>{g.hidden=p})})},model:(u,f,g)=>{s(u,p=>{let m=p,[b,x]=f,h=g?.event??(m instanceof HTMLSelectElement||m instanceof HTMLInputElement&&(m.type==="checkbox"||m.type==="radio")?"change":"input");r.push($e(p,()=>{mc(m,b())}));let w=()=>x(pc(m));m.addEventListener(h,w),r.push(()=>m.removeEventListener(h,w))})},each:(u,f)=>{let g=typeof u=="string"?a.refs(u):Array.from(u);for(let p=0;p<g.length;p++){let m=g[p],b=f(m,p);b!=null&&gc(a,m,b,p)}},cleanup:u=>{r.push(u)}},c;try{c=n(a)}catch(u){throw gs(r,"enhance"),u}typeof c=="function"&&r.push(c);let d=()=>{i||(i=!0,tn.get(t)===o&&(tn.delete(t),t.removeAttribute(en)),Be(t,d),gs(r,"enhance"))};return S(t,d),tn.set(t,o),t.setAttribute(en,"true"),d}function ys(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push(De(r,n))}catch(r){for(let o=t.length-1;o>=0;o--)try{t[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw t.length=0,r}return()=>{for(let r of t.splice(0))r()}}function vs(e,n){let t=globalThis;return t[e]??(t[e]=n())}var bc=/^[A-Za-z0-9_-]+$/,xs=Symbol.for("sibujs.islands.lazy"),et=vs(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Ss(e){return e[xs]=!0,e}function Ts(e,n){if(!bc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);et.set(e,n)}function Es(e){et.delete(e)}async function hc(e){if(typeof e=="function"&&e[xs]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function ws(e=typeof document<"u"?document:null,n={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let t=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!et.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,c=()=>{if(a||o)return;a=!0;let u=et.get(s);u&&hc(u).then(f=>{if(!o){if(!f){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=De(i,f);if(o){g();return}r.push(g),i.setAttribute("data-sibu-hydrated","true")}catch(g){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,g)}}}).catch(f=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,f)})},d=i.getAttribute("data-sibu-load")||"load";t.push(yc(d,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function yc(e,n,t,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(t);return()=>cancelIdleCallback(i)}let o=setTimeout(t,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(t),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),t())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(n),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),t()},s=()=>{for(let a of o)n.removeEventListener(a,i)};for(let a of o)n.addEventListener(a,i,{passive:!0});return s}case"media":{let o=n.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(t),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(t),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),t())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(t),()=>{}}}function nn(e){return e}var sd=1024*1024;function _s(e){let[n,t]=C(e()),r=!1,o=!1,i=n(),s=()=>{r=!1,!o&&t(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=D(()=>{i=e(),a()}),d=(()=>n());return d.dispose=()=>{o||(o=!0,c())},d}var ks=16;function vc(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:ks*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,ks)}function As(){let[e,n]=C(!1);function t(r){n(!0),vc(()=>{let o;try{o=r()}catch{n(!1);return}o&&typeof o.then=="function"?o.then(()=>n(!1),()=>n(!1)):n(!1)})}return{pending:e,start:t}}function Cs(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof window<"u"&&(window.Sibu=rn);return zs(xc);})();
397
+ `,Mi=!1;function cc(){!Mi&&typeof document<"u"&&(document.head.appendChild(ne({nodes:ac})),Mi=!0)}function Hi(e={}){cc();let{text:n,variant:t="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return t==="dots"?k({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[k({class:"sibu-loading-dots",nodes:[R({class:"sibu-loading-dot"}),R({class:"sibu-loading-dot"}),R({class:"sibu-loading-dot"})]}),n?R({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)}):k({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[k({class:"sibu-loading-spinner"}),n?R({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)})}var zt=Symbol.for("sibujs.actions.v1"),$i=globalThis[zt]??(globalThis[zt]=new Map);function de(e,n){$i.set(e,n)}function Vt(e){return $i.get(e)}function Di(e,n,t){let r=typeof n=="string"?Vt(n):n;if(!r)throw new Error(`[SibuJS] No action registered under the name "${n}". Register it with registerAction() before applying it by name.`);let o=r(e,t);typeof o=="function"&&T(e,o)}var qt=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},Wt=(e,n)=>{let t=n.duration??500,r=null,o=()=>{r=setTimeout(()=>{n.callback(),r=null},t)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},jt=(e,n)=>{let t=()=>{let r=typeof n=="function"?n():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},Kt=e=>{let n=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return n(),e.addEventListener("input",n),()=>e.removeEventListener("input",n)},Ut=e=>{let n='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',t=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(n));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)};de("clickOutside",qt);de("longPress",Wt);de("copyOnClick",jt);de("autoResize",Kt);de("trapFocus",Ut);var fe=null;function Ii(e,n){try{let t=e();return t&&typeof t.then=="function"&&t.catch(r=>{n?n(r,"async"):fe?fe(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),t}catch(t){return n?n(t,"sync"):fe?fe(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function Oi(e,n){try{return await e()}catch(t){return n?n(t,"async"):fe?fe(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function Pi(e){fe=e}function Bi(e){let[n,t]=C(e),r=i=>{!!1||!V()||(`${i}`,void 0)};return{provide(i){r("provide");let s=n();return t(i),()=>t(s)},use(){return n},get(){return n()},set(i){r("set"),t(i)},withContext(i,s){r("withContext");let a=n();t(i);try{let c=s();return!1,c}finally{t(a)}}}}var Jt=Symbol.for("sibujs.createId.v1"),Gt=globalThis[Jt]??(globalThis[Jt]={n:0});function Fi(e="sibu"){return Gt.n++,`${e}-${Gt.n}`}function zi(){Gt.n=0}function Vi(e,n){let t=typeof n=="function"?n():n;return T(t,D(()=>{t.style.display=e()?"":"none"})),t}function qi(e,n,t,r,o){let i=typeof t=="function"?t():t;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===t,c=r.has(s),l=!a&&!c;return r.add(s),c&&void 0,e.insertBefore(s,n.nextSibling),{node:s,owned:l}}function Wi(e,n,t){let r=document.createComment("when"),o=null,i,s=!1,a=new WeakSet,c=!1,l=()=>{let d=e(),p=r.parentNode;if(!p||s&&d===i)return;i=d;let g=o?Ne([o]):null;o?.parentNode&&(c&&L(o),o.parentNode.removeChild(o),o=null);let m=qi(p,r,d?n:t!==void 0?t:null,a,"when");o=m.node,c=m.owned,ve(g,o?[o]:[],"when"),s=!0};return T(r,D(l)),s||queueMicrotask(()=>{!s&&r.parentNode&&l()}),r}function ji(e,n,t){let r=document.createComment("match"),o=null,i,s=!1,a=new WeakSet,c=!1,l=()=>{let d=String(e()),p=r.parentNode;if(!p||s&&d===i)return;i=d;let g=o?Ne([o]):null;o?.parentNode&&(c&&L(o),o.parentNode.removeChild(o),o=null);let f=Object.hasOwn(n,d)?n[d]:t,m=qi(p,r,f??null,a,"match");o=m.node,c=m.owned,ve(g,o?[o]:[],"match"),s=!0};return T(r,D(l)),s||queueMicrotask(()=>{!s&&r.parentNode&&l()}),r}var Yt=new Map;function Ki(e,n){Yt.set(e,n)}function Ui(e){Yt.delete(e)}function Zt(e){let n=Yt.get(e);return n?n():k({nodes:`[Component "${e}" not found]`})}function Ji(e){let n=k({class:"sibu-dynamic"});function t(){let o=e(),i;typeof o=="function"?i=o():i=Zt(o),B(n,i)}let r=D(t);return T(n,r),n}function Gi(e){return typeof e=="function"?Gi(e()):e instanceof Node?e:document.createTextNode(String(e))}function uc(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let a=0;a<n;a++){let c=e[a],l=0,d=t.length;for(;l<d;){let p=l+d>>1;e[t[p]]<c?l=p+1:d=p}t[l]=a,r[a]=l>0?t[l-1]:-1}let o=t.length,i=new Array(o),s=t[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Yi(e,n,t){t&&t.key;let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,l=new Map,d=new Map,p=[],g=[],f=[],m=0,b=[],h=[],y=new Uint8Array(0),w=new Map,v=[],S=[],E=new Map,M=!1,I=!1,pe=!1,Ns=t.key,on=()=>{if(pe)return;let K=e(),A=K.length,ie=r.parentNode;if(!ie)return;I||(ie.insertBefore(o,r.nextSibling),I=!0),h.length<A&&(h=new Array(A));for(let x=0;x<A;x++)h[x]=Ns(K[x]);let Q=h;b.length<A&&(b=new Array(A)),d.clear(),E.clear();for(let x=0;x<A;x++)!1,E.set(Q[x],x);m=0;for(let x=0;x<A;x++){let O=Q[x],an=l.get(O),we;if(an!==void 0)we=an,p[m]=we,g[m]=K[x],f[m]=x,m++;else{let[cn,Hs]=C(K[x]),[un,$s]=C(x),tt;try{tt=Gi(n(cn,un))}catch(Ds){let Is=Q[x];tt=document.createComment(`each:error:${x}`),queueMicrotask(()=>{_(Ds,{phase:"render",name:`each row (key="${String(Is)}")`,node:r.parentNode?r:void 0})})}we={node:tt,item:cn,setItem:Hs,index:un,setIndex:$s}}d.set(O,we),b[x]=we.node}for(let[x,O]of l)d.has(x)||(L(O.node),O.node.parentNode&&ie.removeChild(O.node));if(A===0){c=0;let x=l;l=d,d=x,M=!0,m=0;return}w.clear();for(let x=0;x<c;x++)w.set(a[x],x);v.length<A&&(v=new Array(A),S=new Array(A));let Ie=0;for(let x=0;x<A;x++){let O=w.get(Q[x]);O!==void 0&&(v[Ie]=x,S[Ie]=O,Ie++)}let sn=uc(S,Ie);y.length<A?y=new Uint8Array(A):y.fill(0,0,A);for(let x=0;x<sn.length;x++)y[v[sn[x]]]=1;let Oe=o;for(let x=A-1;x>=0;x--){let O=b[x];y[x]||O.nextSibling!==Oe&&ie.insertBefore(O,Oe),Oe=O}let Pe=a===i?s:i;Pe.length<A&&(Pe.length=A);for(let x=0;x<A;x++)Pe[x]=Q[x];a=Pe,c=A;let Ms=l;l=d,d=Ms,M=!0,Ls()};function Ls(){if(m===0)return;let K=m;m=0,P(()=>{for(let A=0;A<K;A++){let ie=p[A];ie.setItem(g[A]),ie.setIndex(f[A]),p[A]=void 0,g[A]=void 0}})}let Rs=D(on);return T(r,()=>{if(!pe){pe=!0,Rs();for(let K of l.values())L(K.node),K.node.parentNode?.removeChild(K.node);o.parentNode&&o.parentNode.removeChild(o),I=!1,l.clear(),d.clear(),E.clear(),w.clear(),c=0,p.length=0,g.length=0,f.length=0,m=0}}),M||queueMicrotask(()=>{!M&&!pe&&r.parentNode&&on()}),r}function Xi(e){let n=document.createDocumentFragment();for(let t of e)if(!(t==null||typeof t=="boolean"))if(Array.isArray(t))for(let r of t)r==null||typeof r=="boolean"||n.appendChild(Zi(r));else n.appendChild(Zi(t));return n}function Zi(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let n=e();return n instanceof Node?n:document.createTextNode(String(n??""))}return document.createTextNode(String(e))}var lc=new Set(["script","style"]),dc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Qi=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),es=new WeakMap;function fc(e){let n=e.length-1,t=e[0];for(let f=0;f<n;f++)t+=`\0${f}\0${e[f+1]}`;let r=0,o=t.length;function i(){for(;r<o&&(t[r]===" "||t[r]===" "||t[r]===`
398
+ `||t[r]==="\r");)r++}function s(){if(t.charCodeAt(r)!==0)return-1;let f=r;r++;let m=0;for(;r<o&&t.charCodeAt(r)!==0;)m=m*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,m<0||m>=n?(r=f,-1):m}function a(){let f=r;for(;r<o;){let m=t.charCodeAt(r);if(m>=97&&m<=122||m>=65&&m<=90||m>=48&&m<=57||m===45)r++;else break}return t.slice(f,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let f=s();if(f>=0)return{kind:"expr",idx:f};let m=t[r];if(m==='"'||m==="'"){r++;let b=[],h=[],y="";for(;r<o&&t[r]!==m;){let w=s();w>=0?(b.push(y),y="",h.push(w)):y+=t[r++]}return r<o&&r++,b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}{let b=[],h=[],y="";for(;r<o;){let w=t.charCodeAt(r);if(w===32||w===9||w===10||w===13||w===62)break;let v=s();v>=0?(b.push(y),y="",h.push(v)):y+=t[r++]}return b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function l(){let f=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let m=r;for(;r<o;){let y=t.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let b=t.slice(m,r);if(!b)break;let h=c();b.startsWith("on:")?h.kind==="expr"&&f.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?f.push({t:4,name:b}):h.kind==="static"?f.push({t:0,name:b,value:h.value}):h.kind==="expr"?f.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&f.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return f}function d(f){return f.replace(/\s+/g," ")}function p(f){let m="";for(;r<o&&t[r]!=="<";){let h=s();if(h>=0){let y=d(m);y&&f.push({t:1,value:y}),m="",f.push({t:2,idx:h})}else m+=t[r++]}let b=d(m);b&&f.push({t:1,value:b})}function g(){let f=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let m=t[r+1];if(m==="!"){if(t.startsWith("<!--",r)){let v=t.indexOf("-->",r+4);r=v===-1?o:v+3}else if(t.startsWith("<![CDATA[",r)){let v=t.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=t.indexOf(">",r);r=v===-1?o:v+1}continue}if(m==="?"){let v=t.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(m>="a"&&m<="z")&&!(m>="A"&&m<="Z")){f.push({t:1,value:"<"}),r++;continue}r++;let b=a(),h=l();i();let y=dc.has(b),w=t[r]==="/";if(w&&r++,r<o&&r++,y||w)f.push({t:0,el:{tag:b,svg:Qi.has(b),attrs:h,children:[]}});else{let v=g();if(lc.has(b.toLowerCase())){for(let S=0;S<v.length;S++)if(v[S].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,a(),i(),r<o&&t[r]===">"&&r++),f.push({t:0,el:{tag:b,svg:Qi.has(b),attrs:h,children:v}})}}else p(f);return f}return g()}function Xt(e,n){let t=e.svg?document.createElementNS(N,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:t.setAttribute(o.name,o.value);break;case 1:{let i=o.name,s=n[o.idx];typeof s=="function"?T(t,Ke(t,i,s)):q(t,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=n[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}q(t,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):!1;break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(Xt(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),T(t,ce(s,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?t.appendChild(a):a!=null&&typeof a!="boolean"&&t.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function Qt(e,...n){let t=es.get(e);if(t||(t=fc(e),es.set(e,t)),t.length===1&&t[0].t===0)return Xt(t[0].el,n);let r=document.createElement("div");for(let o=0;o<t.length;o++){let i=t[o];switch(i.t){case 0:r.appendChild(Xt(i.el,n));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=n[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),T(r,ce(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let c=s[a];c instanceof Node?r.appendChild(c):c!=null&&typeof c!="boolean"&&r.appendChild(document.createTextNode(String(c)))}else s!=null&&typeof s!="boolean"&&r.appendChild(document.createTextNode(String(s)));break}}}return r.childNodes.length===1&&r.firstChild instanceof Element?r.firstChild:r}function ts(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&U()&&void 0;let a,c=null,l=!1,d=!1,p=()=>{if(d)return;let f=e(),m=r.parentNode;if(!m||l&&f===a)return;c?.parentNode&&m.removeChild(c),a=f;let b=o.get(f);if(b){let h=i.indexOf(f);h!==-1&&(i.splice(h,1),i.push(f))}else{let h=n[f];if(!h){c=null,l=!0;return}if(b=h(),b instanceof DocumentFragment){let y=document.createElement("div");y.style.display="contents",y.appendChild(b),b=y}if(o.set(f,b),i.push(f),s>0&&i.length>s){let y=i.shift(),w=o.get(y);w&&(L(w),w.parentNode&&w.parentNode.removeChild(w),o.delete(y))}}m.insertBefore(b,r.nextSibling),c=b,l=!0},g=D(p);return l||queueMicrotask(()=>{!l&&r.parentNode&&p()}),T(r,()=>{d=!0,g();for(let f of o.values())L(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function ns(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let t=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-t:0;n.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:n,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),L(r),r.parentNode&&r.parentNode.removeChild(r)}}}function rs(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){queueMicrotask(()=>{_(s,{phase:"render",name:"Portal",node:t.parentNode?t:void 0})})}}),T(t,()=>{i=!0,o&&(L(o),o.remove(),o=null)}),t}function os(e,n="default"){return e?.[n]}function is(e=[]){let[n,t]=C([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return t(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){t(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return t(c=>{let l=[...c];return a=l.splice(o,i,...s),l}),a},remove(o){t(i=>i.filter((s,a)=>a!==o))},removeWhere(o){t(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){t([...o])},update(o,i){t(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){t(s=>s.map(a=>o(a)?i(a):a))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function ss(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,oe(r)||ye(r)}function i(){if(he(r),t===null){let a=n.slice();t=Object.freeze(a)}return t}return[i,{push(...a){a.length!==0&&(n.push(...a),o())},pop(){if(n.length===0)return;let a=n.pop();return o(),a},shift(){if(n.length===0)return;let a=n.shift();return o(),a},unshift(...a){a.length!==0&&(n.unshift(...a),o())},splice(a,c=0,...l){let d=n.splice(a,c,...l);return(d.length>0||l.length>0)&&o(),d},remove(a){a<0||a>=n.length||(n.splice(a,1),o())},removeWhere(a){let c=n.findIndex(a);c!==-1&&(n.splice(c,1),o())},set(a){n=[...a],o()},update(a,c){a<0||a>=n.length||Object.is(n[a],c)||(n[a]=c,o())},updateWhere(a,c){let l=!1;for(let d=0;d<n.length;d++)if(a(n[d])){let p=c(n[d]);Object.is(n[d],p)||(n[d]=p,l=!0)}l&&o()},sort(a){n.length<=1||(n.sort(a),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(a){let c=n.filter(a);c.length!==n.length&&(n=c,o())},map(a){let c=!1;for(let l=0;l<n.length;l++){let d=a(n[l],l);Object.is(n[l],d)||(n[l]=d,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function as(e,n){let[t,r]=C(n),[o,i]=C(!1),[s,a]=C(null),[c,l]=C(0),d=0,p=!1,g=null,f=()=>{if(g===null)return;let b=g;g=null;try{b.abort()}catch{}},m=F(()=>{if(c(),p)return;f();let b=++d,h=typeof AbortController<"u"?new AbortController:null;g=h,P(()=>{i(!0),a(null)});let y=()=>p||b!==d,w;try{w=e({signal:h?h.signal:void 0})}catch(v){if(y())return;P(()=>{a(v),i(!1)});return}w.then(v=>{y()||(g=null,P(()=>{r(v),i(!1)}))},v=>{y()||(g=null,P(()=>{a(v),i(!1)}))})});return{value:t,loading:o,error:s,refresh:()=>{p||l(b=>b+1)},dispose:()=>{p||(p=!0,m(),f())}}}function Ee(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let c=n;return e.source===c.source&&e.flags===c.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let c=n;if(e.size!==c.size)return!1;for(let[l,d]of e)if(!c.has(l)||!Ee(d,c.get(l),t))return!1;return!0}if(e instanceof Set){let c=n;if(e.size!==c.size)return!1;for(let l of e)if(!c.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let c=new Uint8Array(e),l=new Uint8Array(n);if(c.length!==l.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==l[d])return!1;return!0}if(e instanceof DataView){if(!(n instanceof DataView)||e.byteLength!==n.byteLength)return!1;for(let c=0;c<e.byteLength;c++)if(e.getUint8(c)!==n.getUint8(c))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let c=e,l=n;if(c.length!==l.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==l[d])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((c,l)=>Ee(c,n[l],t));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(c=>Object.hasOwn(o,c)&&Ee(r[c],o[c],t))}function cs(e){return C(e,{equals:(n,t)=>Ee(n,t)})}function Qe(e,n){let t=n?.name,r=n?.equals,o={};o._d=!1,o._init=!1,o._g=e,o.__v=0;let i=()=>{o._d||(o._d=!0)};i._c=1,i._sig=o;let s=()=>{let p=e();o._v=r&&o._init&&r(o._v,p)?o._v:p,o._d=!1,o._init=!0};D(()=>{let p=!0;try{o._v=e(),o._d=!1,o._init=!0,p=!1}finally{p&&(o._d=!0)}},i);let a=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,c=!1,l=()=>{if(!o._d)return;let p=o._v;c=!0;try{Y(s,i),Object.is(p,o._v)||o.__v++}finally{c=!1}a&&!Object.is(p,o._v)&&a.emit("computed:update",{signal:o,oldValue:p,newValue:o._v})};o._validate=l;function d(){if(c)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Bn()?(o._d&&l(),o._v):(o._d&&l(),he(o),o._v)}return t&&(d.__name=t,o.__name=t),d.__signal=o,a&&a.emit("computed:create",{signal:o,name:t,getter:d}),d}function us(e){let[n,t]=C(e);return{get current(){return n()},set current(r){t(r)}}}function ls(e){e!==null&&typeof e=="object"&&Array.isArray(e);let n={};Object.keys(e).forEach(c=>{let[l,d]=C(e[c]);n[c]=[l,d]});let t=new Proxy({},{get(c,l){if(typeof l=="string"&&Object.hasOwn(n,l)){let d=n[l][0];return d()}return Reflect.get(c,l)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(n).forEach(l=>{c[l]=n[l][0]()}),c};return[t,{setState:c=>{let l=r(),d=typeof c=="function"?c(l):c;P(()=>{Object.entries(d).forEach(([p,g])=>{Object.hasOwn(n,p)&&n[p][1](g)})})},reset:()=>{P(()=>{Object.keys(e).forEach(c=>{let l=n[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return F(()=>{let d=r();if(l){l=!1;return}Ae();try{c(d)}finally{Ce()}})},subscribeKey:(c,l)=>{let d,p=!0;return F(()=>{let g=n[c][0]();if(p){d=g,p=!1;return}if(!Object.is(g,d)){let f=d;d=g,Ae();try{l(g,f)}finally{Ce()}}})},getSnapshot:r}]}function ds(e,n){if(V())return()=>{};let t,r=!0;return D(()=>{let s=e();if(r){t=s,r=!1;return}if(!Object.is(s,t)){let a=t;t=s,Ae();try{n(s,a)}finally{Ce()}}})}function fs(e,n,t){return[Qe(e,t),i=>{P(()=>n(i))}]}function ps(e){let n=e();return U()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function ms(e){if(!U())return F(e);let n=F(e),t=null;return queueMicrotask(()=>{try{t=F(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}var en="data-sibu-enhanced",tn=new WeakMap;function gs(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=ke){let i=r.length-o+e.length;e.length=0,_e(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var bs=["text","attr","class","show","on","cleanup"];function hs(e,n){if(n==null)return e;if(typeof n!="string")return n;let t=n.startsWith("@")?`[data-ref="${n.slice(1)}"]`:n;try{return e.querySelector(t)}catch{return null}}function $e(e,n){return V()?()=>{}:z(n,e)}function pc(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,n=>n.value):e.value}function mc(e,n){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!n;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(n)?n.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let t=n==null?"":String(n);e.value!==t&&(e.value=t)}function gc(e,n,t,r){let o=`ctx.each[${r}]`;if(U())for(let i of Object.keys(t))bs.includes(i),`${o}${i}${bs.join(", ")}`;if(t.text!==void 0&&(t.text,`${o}`,e.text(n,t.text)),t.attr!==void 0)for(let i of Object.keys(t.attr)){let s=t.attr[i];`${o}${i}`,e.attr(n,i,s)}if(t.class!==void 0)for(let i of Object.keys(t.class)){let s=t.class[i];`${o}${i}`,e.classed(n,i,s)}if(t.show!==void 0&&(t.show,`${o}`,e.show(n,t.show)),t.on!==void 0)for(let i of Object.keys(t.on)){let s=t.on[i];`${o}${String(i)}`,e.on(n,i,s)}t.cleanup!==void 0&&(t.cleanup,`${o}`,e.cleanup(t.cleanup))}function De(e,n){let t=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!t)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(t.getAttribute(en)==="true")return U()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=g=>s?!0:!1,c=(g,f,m)=>{if(a(g))return;let b=hs(t,f);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(f)} not found under`,t);return}m(b)},l={root:t,ref:g=>hs(t,g),refs:g=>{let f=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(t.querySelectorAll(f))}catch{return[]}},on:(g,f,m,b)=>{c("on",g,h=>{let y=w=>m(w,h);h.addEventListener(f,y,b),r.push(()=>h.removeEventListener(f,y,b))})},text:(g,f)=>{c("text",g,m=>{r.push($e(m,()=>{let b=f(),h=b==null?"":String(b);m.textContent!==h&&(m.textContent=h)}))})},attr:(g,f,m)=>{c("attr",g,b=>{r.push($e(b,()=>{let h=m(),y=h==null?null:String(h);q(b,f,y,{syncValueProperty:!1,label:"enhance attr()"})}))})},classed:(g,f,m)=>{c("classed",g,b=>{r.push($e(b,()=>{b.classList.toggle(f,!!m())}))})},show:(g,f)=>{c("show",g,m=>{let b=m.hidden;r.push($e(m,()=>{m.hidden=!f()})),r.push(()=>{m.hidden=b})})},model:(g,f,m)=>{c("model",g,b=>{let h=b,[y,w]=f,v=m?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push($e(b,()=>{mc(h,y())}));let S=()=>w(pc(h));h.addEventListener(v,S),r.push(()=>h.removeEventListener(v,S))})},each:(g,f)=>{if(a("each"))return;let m=typeof g=="string"?l.refs(g):Array.from(g);for(let b=0;b<m.length;b++){let h=m[b],y=f(h,b);y!=null&&gc(l,h,y,b)}},cleanup:g=>{a("cleanup")||r.push(g)}},d;try{d=n(l);let g=d;if(g&&typeof g.then=="function")throw g.then(void 0,f=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(g){throw gs(r,"enhance"),s=!0,g}typeof d=="function"&&r.push(d);let p=()=>{i||(i=!0,tn.get(t)===o&&(tn.delete(t),t.removeAttribute(en)),Be(t,p),gs(r,"enhance"),s=!0)};return T(t,p),tn.set(t,o),t.setAttribute(en,"true"),p}function ys(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push(De(r,n))}catch(r){for(let o=t.length-1;o>=0;o--)try{t[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw t.length=0,r}return()=>{for(let r of t.splice(0))r()}}function vs(e,n){let t=globalThis;return t[e]??(t[e]=n())}var bc=/^[A-Za-z0-9_-]+$/,xs=Symbol.for("sibujs.islands.lazy"),et=vs(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Ss(e){return e[xs]=!0,e}function Ts(e,n){if(!bc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);et.set(e,n)}function Es(e){et.delete(e)}async function hc(e){if(typeof e=="function"&&e[xs]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function ws(e=typeof document<"u"?document:null,n={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let t=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!et.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,c=()=>{if(a||o)return;a=!0;let d=et.get(s);d&&hc(d).then(p=>{if(!o){if(!p){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=De(i,p);if(o){g();return}r.push(g),i.setAttribute("data-sibu-hydrated","true")}catch(g){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,g)}}}).catch(p=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,p)})},l=i.getAttribute("data-sibu-load")||"load";t.push(yc(l,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function yc(e,n,t,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(t);return()=>cancelIdleCallback(i)}let o=setTimeout(t,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(t),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),t())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(n),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),t()},s=()=>{for(let a of o)n.removeEventListener(a,i)};for(let a of o)n.addEventListener(a,i,{passive:!0});return s}case"media":{let o=n.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(t),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(t),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),t())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(t),()=>{}}}function nn(e){return e}var cd=1024*1024;function _s(e){let[n,t]=C(e()),r=!1,o=!1,i=n(),s=()=>{r=!1,!o&&t(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=D(()=>{i=e(),a()}),l=(()=>n());return l.dispose=()=>{o||(o=!0,c())},l}var ks=16;function vc(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:ks*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,ks)}function As(){let[e,n]=C(!1);function t(r){n(!0),vc(()=>{let o;try{o=r()}catch{n(!1);return}o&&typeof o.then=="function"?o.then(()=>n(!1),()=>n(!1)):n(!1)})}return{pending:e,start:t}}function Cs(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof window<"u"&&(window.Sibu=rn);return zs(xc);})();
@@ -135,42 +135,42 @@ import {
135
135
  use,
136
136
  var_,
137
137
  video
138
- } from "./chunk-P3DHXBR6.js";
138
+ } from "./chunk-7UK6BSAT.js";
139
139
  import {
140
140
  trustHTML
141
141
  } from "./chunk-NIOYEGBQ.js";
142
142
  import {
143
143
  watch
144
- } from "./chunk-BMYYZWHX.js";
144
+ } from "./chunk-IYHM4FWD.js";
145
145
  import {
146
146
  __resetIdCounter,
147
147
  createId
148
148
  } from "./chunk-CCSJMTRN.js";
149
149
  import {
150
150
  context
151
- } from "./chunk-FOWBJZDL.js";
151
+ } from "./chunk-L4B3Y3OM.js";
152
152
  import {
153
153
  SVG_NS,
154
154
  bindChildNode,
155
155
  captureFocusWithin,
156
156
  restoreFocusWithin,
157
157
  tagFactory
158
- } from "./chunk-6ZGI3RBE.js";
158
+ } from "./chunk-XGCZ45NH.js";
159
159
  import {
160
160
  bindAttribute,
161
161
  bindDynamic,
162
162
  setSafeAttribute
163
- } from "./chunk-HJEPKZ2O.js";
163
+ } from "./chunk-7UBG6LDP.js";
164
164
  import {
165
165
  derived
166
- } from "./chunk-2LOYNGBY.js";
166
+ } from "./chunk-3E5YNK2F.js";
167
167
  import {
168
168
  globalSingleton
169
169
  } from "./chunk-7ZHH77QA.js";
170
170
  import {
171
171
  effect,
172
172
  on
173
- } from "./chunk-7VEC3UD2.js";
173
+ } from "./chunk-7BJLKDBI.js";
174
174
  import {
175
175
  disableSSR,
176
176
  enableSSR,
@@ -195,7 +195,7 @@ import {
195
195
  external,
196
196
  isBatching,
197
197
  signal
198
- } from "./chunk-HECVW343.js";
198
+ } from "./chunk-MYA5HEK5.js";
199
199
  import {
200
200
  notifySubscribers,
201
201
  reactiveBinding,
@@ -206,7 +206,7 @@ import {
206
206
  suspendTracking,
207
207
  track,
208
208
  untracked
209
- } from "./chunk-7ALC7KGE.js";
209
+ } from "./chunk-TSL64O5L.js";
210
210
  import {
211
211
  DEV,
212
212
  __export,
@@ -3298,7 +3298,16 @@ function enhance(target, setup) {
3298
3298
  const teardowns = [];
3299
3299
  const owner = /* @__PURE__ */ Symbol("sibujs.enhance");
3300
3300
  let disposed = false;
3301
- const bind = (target_, fn) => {
3301
+ let closed = false;
3302
+ const isClosed = (method) => {
3303
+ if (!closed) return false;
3304
+ devWarnLazy(
3305
+ () => `enhance: ctx.${method}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`
3306
+ );
3307
+ return true;
3308
+ };
3309
+ const bind = (method, target_, fn) => {
3310
+ if (isClosed(method)) return;
3302
3311
  const el = resolveTarget(root, target_);
3303
3312
  if (!el) {
3304
3313
  if (typeof console !== "undefined") {
@@ -3320,14 +3329,14 @@ function enhance(target, setup) {
3320
3329
  }
3321
3330
  },
3322
3331
  on: (t, event, handler, options) => {
3323
- bind(t, (el) => {
3332
+ bind("on", t, (el) => {
3324
3333
  const wrapped = (e) => handler(e, el);
3325
3334
  el.addEventListener(event, wrapped, options);
3326
3335
  teardowns.push(() => el.removeEventListener(event, wrapped, options));
3327
3336
  });
3328
3337
  },
3329
3338
  text: (t, value) => {
3330
- bind(t, (el) => {
3339
+ bind("text", t, (el) => {
3331
3340
  teardowns.push(
3332
3341
  bindNode(el, () => {
3333
3342
  const v = value();
@@ -3338,7 +3347,7 @@ function enhance(target, setup) {
3338
3347
  });
3339
3348
  },
3340
3349
  attr: (t, name, value) => {
3341
- bind(t, (el) => {
3350
+ bind("attr", t, (el) => {
3342
3351
  teardowns.push(
3343
3352
  bindNode(el, () => {
3344
3353
  const v = value();
@@ -3349,7 +3358,7 @@ function enhance(target, setup) {
3349
3358
  });
3350
3359
  },
3351
3360
  classed: (t, name, on2) => {
3352
- bind(t, (el) => {
3361
+ bind("classed", t, (el) => {
3353
3362
  teardowns.push(
3354
3363
  bindNode(el, () => {
3355
3364
  el.classList.toggle(name, Boolean(on2()));
@@ -3358,7 +3367,7 @@ function enhance(target, setup) {
3358
3367
  });
3359
3368
  },
3360
3369
  show: (t, when2) => {
3361
- bind(t, (el) => {
3370
+ bind("show", t, (el) => {
3362
3371
  const prevHidden = el.hidden;
3363
3372
  teardowns.push(
3364
3373
  bindNode(el, () => {
@@ -3371,7 +3380,7 @@ function enhance(target, setup) {
3371
3380
  });
3372
3381
  },
3373
3382
  model: (t, state, options) => {
3374
- bind(t, (el) => {
3383
+ bind("model", t, (el) => {
3375
3384
  const control = el;
3376
3385
  const [get, set] = state;
3377
3386
  const evt = options?.event ?? (control instanceof HTMLSelectElement || control instanceof HTMLInputElement && (control.type === "checkbox" || control.type === "radio") ? "change" : "input");
@@ -3386,6 +3395,7 @@ function enhance(target, setup) {
3386
3395
  });
3387
3396
  },
3388
3397
  each: (target_, describe) => {
3398
+ if (isClosed("each")) return;
3389
3399
  devAssert(typeof describe === "function", "ctx.each: second argument must be a function.");
3390
3400
  const elements = typeof target_ === "string" ? ctx.refs(target_) : Array.from(target_);
3391
3401
  for (let i2 = 0; i2 < elements.length; i2++) {
@@ -3396,14 +3406,25 @@ function enhance(target, setup) {
3396
3406
  }
3397
3407
  },
3398
3408
  cleanup: (fn) => {
3409
+ if (isClosed("cleanup")) return;
3399
3410
  teardowns.push(fn);
3400
3411
  }
3401
3412
  };
3402
3413
  let extra;
3403
3414
  try {
3404
3415
  extra = setup(ctx);
3416
+ const returned = extra;
3417
+ if (returned && typeof returned.then === "function") {
3418
+ returned.then(void 0, (reason) => {
3419
+ devWarnLazy(() => `enhance: the promise returned by the setup also rejected: ${String(reason)}`);
3420
+ });
3421
+ throw new Error(
3422
+ (typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : DEV) ? "[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored." : "[SibuJS enhance] setup returned a promise"
3423
+ );
3424
+ }
3405
3425
  } catch (err) {
3406
3426
  drainTeardowns(teardowns, "enhance");
3427
+ closed = true;
3407
3428
  throw err;
3408
3429
  }
3409
3430
  if (typeof extra === "function") teardowns.push(extra);
@@ -3416,6 +3437,7 @@ function enhance(target, setup) {
3416
3437
  }
3417
3438
  unregisterDisposer(root, dispose2);
3418
3439
  drainTeardowns(teardowns, "enhance");
3440
+ closed = true;
3419
3441
  };
3420
3442
  registerDisposer(root, dispose2);
3421
3443
  enhancementOwner.set(root, owner);
@@ -3,7 +3,7 @@ import {
3
3
  recordDependency,
4
4
  retrack,
5
5
  track
6
- } from "./chunk-7ALC7KGE.js";
6
+ } from "./chunk-TSL64O5L.js";
7
7
  import {
8
8
  devAssert
9
9
  } from "./chunk-2WLZ6757.js";
@@ -5,7 +5,7 @@ import {
5
5
  cleanup,
6
6
  retrack,
7
7
  untracked
8
- } from "./chunk-7ALC7KGE.js";
8
+ } from "./chunk-TSL64O5L.js";
9
9
  import {
10
10
  devAssert,
11
11
  reportError