sibujs 4.9.0 → 4.10.1

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 (62) hide show
  1. package/dist/browser.cjs +41 -4
  2. package/dist/browser.js +4 -4
  3. package/dist/build.cjs +102 -38
  4. package/dist/build.js +10 -10
  5. package/dist/cdn.dev.global.js +14 -14
  6. package/dist/cdn.full.dev.global.js +13 -13
  7. package/dist/cdn.full.global.js +12 -12
  8. package/dist/cdn.global.js +15 -15
  9. package/dist/{chunk-7OV5Q2UU.js → chunk-2D47RVVK.js} +4 -4
  10. package/dist/{chunk-5MLWTIQE.js → chunk-2T73SWKF.js} +2 -2
  11. package/dist/{chunk-YW6HQKGO.js → chunk-42REZXE4.js} +2 -2
  12. package/dist/{chunk-SBTZEYNI.js → chunk-6DYRY2NF.js} +8 -1
  13. package/dist/{chunk-562UVHMM.js → chunk-ADJEMTRC.js} +11 -6
  14. package/dist/{chunk-SYHGGDNW.js → chunk-BNZDDNBR.js} +1 -1
  15. package/dist/{chunk-K6K5ACO6.js → chunk-CID4BYBF.js} +3 -3
  16. package/dist/{chunk-TV464N2M.js → chunk-CYUU3XXG.js} +3 -3
  17. package/dist/{chunk-FNOK662L.js → chunk-CZINTERN.js} +73 -43
  18. package/dist/{chunk-CDBKFGXN.js → chunk-DA2LJXK3.js} +1 -1
  19. package/dist/{chunk-MPWDSTYK.js → chunk-DS6PFIZK.js} +1 -1
  20. package/dist/{chunk-XJVTQUIV.js → chunk-GEQNWNYS.js} +5 -5
  21. package/dist/{chunk-FHCZMHHE.js → chunk-GVVZPMA5.js} +1 -1
  22. package/dist/{chunk-NQMKWBKU.js → chunk-HZQEL575.js} +1 -1
  23. package/dist/{chunk-CF2KCWRE.js → chunk-JZMLRF2G.js} +2 -2
  24. package/dist/{chunk-X7NRHFZR.js → chunk-LK3VK47W.js} +1 -1
  25. package/dist/{chunk-2K3Z3XO4.js → chunk-LYM6TT2R.js} +4 -4
  26. package/dist/{chunk-KG25XMGP.js → chunk-MJZUXQHR.js} +15 -8
  27. package/dist/{chunk-G2WHYEL7.js → chunk-NROLUUCO.js} +39 -4
  28. package/dist/{chunk-DRMLIF6M.js → chunk-WHZKRSHQ.js} +19 -12
  29. package/dist/{chunk-QBKCK6MJ.js → chunk-YNE4FSVX.js} +1 -1
  30. package/dist/data.cjs +48 -6
  31. package/dist/data.d.cts +9 -1
  32. package/dist/data.d.ts +9 -1
  33. package/dist/data.js +5 -5
  34. package/dist/devtools.cjs +41 -4
  35. package/dist/devtools.js +4 -4
  36. package/dist/ecosystem.cjs +41 -4
  37. package/dist/ecosystem.js +7 -7
  38. package/dist/extras.cjs +75 -25
  39. package/dist/extras.js +20 -20
  40. package/dist/index.cjs +102 -38
  41. package/dist/index.d.cts +32 -4
  42. package/dist/index.d.ts +32 -4
  43. package/dist/index.js +10 -10
  44. package/dist/motion.cjs +36 -4
  45. package/dist/motion.js +3 -3
  46. package/dist/patterns.cjs +41 -4
  47. package/dist/patterns.js +5 -5
  48. package/dist/performance.cjs +55 -14
  49. package/dist/performance.js +4 -4
  50. package/dist/plugins.cjs +163 -51
  51. package/dist/plugins.d.cts +56 -2
  52. package/dist/plugins.d.ts +56 -2
  53. package/dist/plugins.js +130 -52
  54. package/dist/ssr.cjs +50 -9
  55. package/dist/ssr.js +7 -7
  56. package/dist/testing.cjs +41 -4
  57. package/dist/testing.js +2 -2
  58. package/dist/ui.cjs +41 -4
  59. package/dist/ui.js +7 -7
  60. package/dist/widgets.cjs +36 -4
  61. package/dist/widgets.js +6 -6
  62. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- "use strict";(()=>{var So=Object.defineProperty;var xt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var xo=(e,t)=>{for(var n in t)So(e,n,{get:t[n],enumerable:!0})};var dn={};xo(dn,{DynamicComponent:()=>jc,ErrorBoundary:()=>Cc,ErrorDisplay:()=>nn,Fragment:()=>Uc,KeepAlive:()=>Gc,Loading:()=>Lc,MAX_DRAIN_TEARDOWNS:()=>se,Portal:()=>Xc,SVG_NS:()=>R,Suspense:()=>gr,__renderParsedTemplate:()=>Qr,__resetIdCounter:()=>qr,a:()=>cs,abbr:()=>ls,action:()=>Mc,address:()=>Ui,area:()=>Os,array:()=>el,article:()=>Fi,aside:()=>Wi,asyncDerived:()=>nl,audio:()=>$s,autoResize:()=>zr,b:()=>us,base:()=>Na,batch:()=>q,bdi:()=>ds,bdo:()=>fs,bindDynamic:()=>ar,blockquote:()=>Xi,body:()=>Ii,br:()=>ps,button:()=>Ke,canvas:()=>Gs,caption:()=>ea,catchError:()=>Dc,catchErrorAsync:()=>Oc,center:()=>Xa,checkLeaks:()=>wn,circle:()=>Ma,cite:()=>ms,clickOutside:()=>Pr,clipPath:()=>ja,code:()=>Ut,col:()=>ta,colgroup:()=>na,context:()=>Hc,copyOnClick:()=>Fr,createId:()=>jr,customElement:()=>tc,data:()=>gs,datalist:()=>ua,dd:()=>Qi,deepEqual:()=>ze,deepSignal:()=>rl,defer:()=>xl,defs:()=>Va,del:()=>Xs,derived:()=>cn,details:()=>Ta,dfn:()=>hs,dialog:()=>wa,disableSSR:()=>Er,dispose:()=>O,div:()=>A,dl:()=>es,dt:()=>ts,each:()=>Wc,effect:()=>Y,ellipse:()=>Da,em:()=>bs,embed:()=>Fs,enableSSR:()=>xr,enhance:()=>yt,enhanceAll:()=>pl,enqueueBatchedSignal:()=>Le,external:()=>vc,fieldset:()=>da,figcaption:()=>ns,figure:()=>rs,font:()=>Qa,footer:()=>Vi,form:()=>fa,g:()=>Oa,getAction:()=>Ir,getRequestScopedCache:()=>Sr,getRuntimeErrorHandler:()=>vn,getSSRStore:()=>Re,getSlot:()=>Qc,h1:()=>Ki,h2:()=>Ji,h3:()=>qt,h4:()=>Gi,h5:()=>Yi,h6:()=>Zi,head:()=>Hi,header:()=>zi,hr:()=>os,html:()=>Xr,i:()=>ys,iframe:()=>zs,img:()=>Hs,input:()=>pa,ins:()=>Qs,isBatching:()=>yc,isSSR:()=>te,kbd:()=>vs,label:()=>ma,lazy:()=>mr,lazyIsland:()=>gl,legend:()=>ga,li:()=>is,line:()=>$a,linearGradient:()=>Ua,link:()=>Ra,longPress:()=>Br,main:()=>qi,map:()=>Is,mark:()=>Ss,marker:()=>Za,marquee:()=>ec,mask:()=>qa,match:()=>Bc,math:()=>Js,menu:()=>ka,meta:()=>La,meter:()=>ha,mount:()=>Yc,mountIslands:()=>vl,nav:()=>ji,nextTick:()=>wl,noscript:()=>Ys,object:()=>Vs,ol:()=>ss,on:()=>dc,onCleanup:()=>cc,onMount:()=>pt,onUnmount:()=>br,optgroup:()=>ba,option:()=>ya,output:()=>va,p:()=>jt,param:()=>js,path:()=>Ha,pattern:()=>Wa,picture:()=>qs,polygon:()=>Ia,polyline:()=>Pa,portal:()=>Ws,pre:()=>Wt,progress:()=>Sa,q:()=>xs,radialGradient:()=>Ka,reactiveArray:()=>tl,rect:()=>Ba,ref:()=>ol,registerAction:()=>Fe,registerComponent:()=>Fc,registerDisposer:()=>x,registerIsland:()=>hl,replaceChildrenSafely:()=>j,reportDrainRunaway:()=>pe,reportError:()=>k,resolveComponent:()=>Vc,retrack:()=>be,rp:()=>Es,rt:()=>Ts,ruby:()=>ws,runInSSRContext:()=>Tr,s:()=>ks,samp:()=>_s,script:()=>Zs,section:()=>Bi,select:()=>xa,setGlobalErrorHandler:()=>$c,setMaxDrainIterations:()=>or,setRuntimeErrorHandler:()=>yn,show:()=>Ic,signal:()=>C,slot:()=>Aa,small:()=>As,source:()=>Us,span:()=>H,stop:()=>Ja,store:()=>il,strict:()=>cl,strictEffect:()=>ll,strong:()=>Cs,style:()=>Ae,sub:()=>Ns,summary:()=>_a,sup:()=>Rs,svg:()=>Ks,symbol:()=>Ya,table:()=>ra,tagFactory:()=>u,takePendingError:()=>ut,tbody:()=>oa,td:()=>ia,template:()=>Ca,text:()=>Fa,textarea:()=>Ea,tfoot:()=>sa,th:()=>aa,thead:()=>ca,time:()=>Ls,title:()=>Pi,tr:()=>la,track:()=>Ps,transition:()=>Tl,trapFocus:()=>Vr,trustHTML:()=>lo,tspan:()=>za,u:()=>Ms,ul:()=>as,unregisterComponent:()=>zc,unregisterDisposer:()=>je,unregisterIsland:()=>bl,untracked:()=>ee,use:()=>Ga,var_:()=>Ds,video:()=>Bs,watch:()=>sl,when:()=>Pc,withSSR:()=>wr,writable:()=>al});var bn=Symbol.for("sibujs.runtime-errors.v1");function Et(){let e=globalThis,t=e[bn];if(t)return t;let n={handler:null,handlerDepth:0};return e[bn]=n,n}function yn(e){let t=Et(),n=t.handler;return t.handler=e,n}function vn(){return Et().handler}function Tt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Eo(e)}`;return new Error(t,{cause:e})}function Eo(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 To(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var wo=Symbol.for("sibujs.reactive.v1");function ko(e){let t=globalThis[wo];return t?.untracked?t.untracked(e):e()}var _o="sibu:error-propagate";function Ao(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Co(n);if(!r)return!1;try{let o=new CustomEvent(_o,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Co(e){let n=e;for(;n;){if(n.nodeType===1&&typeof n.dispatchEvent=="function")return n;n=n.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function No(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${To(t)}: ${e.message}`,e)}function k(e,t){let n=Tt(e);ko(()=>{if(Ao(n,t))return;let r=Et(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:n,t);return}catch(i){if(typeof console<"u"){let a=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${a}`,i)}}finally{r.handlerDepth--}}No(n,t)})}function re(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function M(e,t){if(!e)throw new Error(`[SibuJS] ${t}`)}function V(e){{let t=e();t&&console.warn(`[SibuJS] ${t}`)}}function D(e){console.warn(`[SibuJS] ${e}`)}var oe=new WeakMap,se=1e4;function pe(e,t,n){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${t} teardowns with ${n} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:t,remaining:n})}var Se=0;function et(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var W=[];function Sn(){return et(W[W.length-1])}function xn(e){return e===null&&W.length===0?!1:(W.push(et(e)),!0)}function En(){W.pop()}function x(e,t){let n=oe.get(e);n||(n=[],oe.set(e,n)),n.push(t),Se++;let r=et(W[W.length-1]);r&&r.entries.push([e,t])}function Tn(e){let t={entries:[],closed:!1},n=t.entries;W.push(t);let r;try{r=e()}catch(i){let a=0;try{for(;n.length>0;){if(a>=se){pe("rollback",a,n.length);break}let[s,c]=n.pop();if(je(s,c)){a++;try{c()}catch(l){k(l,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,W.pop()}throw i}t.closed=!0,W.pop();let o=et(W[W.length-1]);if(o){for(let i of n)oe.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function je(e,t){let n=oe.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),Se--,n.length===0&&oe.delete(e),!0)}function O(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--)Ro(n[r])}function Ro(e){if(!oe.has(e))return;let t=0,n=!1;for(;!n;){let r=oe.get(e);if(!r||r.length===0)break;let o=r.slice();oe.delete(e),Se-=o.length;for(let i=0;i<o.length;i++){if(t>=se){let a=o.slice(i),s=oe.get(e);oe.set(e,s?a.concat(s):a),Se+=a.length,pe("dispose",t,a.length+(s?.length??0)),n=!0;break}t++;try{o[i]()}catch(a){k(a,{phase:"cleanup",name:"disposer"})}}}}function j(e,...t){for(let r=0;r<t.length;r++){let o=t[r];o.parentNode?.removeChild(o)}let n=Array.from(e.childNodes);for(let r=0;r<n.length;r++)O(n[r]);e.replaceChildren(...t)}function wn(e=0){return e>0&&Se>e&&D(`checkLeaks: ${Se} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),Se}function Oe(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Lo=/[A-Z]/,Mo=/[A-Z]/g;function U(e){return Lo.test(e)?e.replace(Mo,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function me(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}var Do=["http:","https:","mailto:","tel:","ftp:"],Oo=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function nt(e){let t=Oe(e).trim();if(!t)return"";let n=e.replace(Oo,"");if(t.length>=2&&(t[0]==="\\"||t[0]==="/")&&(t[1]==="\\"||t[1]==="/")&&(t[0]==="\\"||t[1]==="\\"))return"";let r=t.toLowerCase(),o=-1;for(let a=0;a<r.length;a++){let s=r.charCodeAt(a);if(s===58){o=a;break}if(s===47||s===63||s===35)break}if(o===-1)return n;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&Do.indexOf(i)===-1?"":n}var $o=/^\d+(\.\d+)?[wx]$/;function wt(e){return e===" "||e===" "||e===`
2
- `||e==="\r"||e==="\f"}function Ho(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(wt(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!wt(t[r]);)r++;let a=t.slice(i,r),s=[];if(a.endsWith(","))a=a.replace(/,+$/,"");else{let l="",d=!1;for(;r<o;){let m=t[r];if(d){l+=m,m===")"&&(d=!1),r++;continue}if(wt(m)){l&&s.push(l),l="",r++;continue}if(m===","){r++;break}m==="("&&(d=!0),l+=m,r++}l&&s.push(l)}if(a===""||s.length>1||s.length===1&&!$o.test(s[0]))continue;let c=nt(a);c&&(c.startsWith(",")||c.endsWith(",")||n.push(s.length===1?`${c} ${s[0]}`:c))}return n.join(", ")}var Io=/[(:@\\]/;function Po(e){return e===" "||e===" "||e===`
3
- `||e==="\r"||e==="\f"}function kn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Bo(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r!=="\\"){t+=r;continue}if(n+1>=e.length)break;let o=e[n+1];if(o===`
1
+ "use strict";(()=>{var No=Object.defineProperty;var _t=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ro=(e,t)=>{for(var n in t)No(e,n,{get:t[n],enumerable:!0})};var vn={};Ro(vn,{DynamicComponent:()=>Qc,ErrorBoundary:()=>Pc,ErrorDisplay:()=>dn,Fragment:()=>nu,KeepAlive:()=>iu,Loading:()=>zc,MAX_DRAIN_TEARDOWNS:()=>ce,Portal:()=>cu,SVG_NS:()=>R,Suspense:()=>Tr,__renderParsedTemplate:()=>co,__resetIdCounter:()=>Qr,a:()=>hs,abbr:()=>ys,action:()=>Vc,address:()=>ts,area:()=>js,array:()=>lu,article:()=>Gi,aside:()=>es,asyncDerived:()=>fu,audio:()=>Ws,autoResize:()=>Yr,b:()=>vs,base:()=>Pa,batch:()=>q,bdi:()=>Ss,bdo:()=>xs,bindDynamic:()=>gr,blockquote:()=>as,body:()=>Ui,br:()=>Es,button:()=>Ye,canvas:()=>oa,caption:()=>ua,catchError:()=>jc,catchErrorAsync:()=>Wc,center:()=>ac,checkLeaks:()=>Mn,circle:()=>za,cite:()=>Ts,clickOutside:()=>Kr,clipPath:()=>Xa,code:()=>Qt,col:()=>la,colgroup:()=>da,context:()=>Uc,copyOnClick:()=>Gr,createId:()=>Xr,customElement:()=>lc,data:()=>ws,datalist:()=>va,dd:()=>cs,deepEqual:()=>We,deepSignal:()=>pu,defer:()=>Lu,defs:()=>Za,del:()=>aa,derived:()=>bn,details:()=>Ma,dfn:()=>ks,dialog:()=>Oa,disableSSR:()=>Rr,dispose:()=>D,div:()=>A,dl:()=>us,dt:()=>ls,each:()=>tu,effect:()=>X,ellipse:()=>Va,em:()=>_s,embed:()=>Gs,enableSSR:()=>Nr,enhance:()=>Tt,enhanceAll:()=>Tu,enqueueBatchedSignal:()=>Oe,external:()=>Nc,fieldset:()=>Sa,figcaption:()=>ds,figure:()=>fs,font:()=>cc,footer:()=>Zi,form:()=>xa,g:()=>ja,getAction:()=>Ur,getRequestScopedCache:()=>Cr,getRuntimeErrorHandler:()=>An,getSSRStore:()=>Me,getSlot:()=>uu,h1:()=>ns,h2:()=>rs,h3:()=>Zt,h4:()=>os,h5:()=>is,h6:()=>ss,head:()=>qi,header:()=>Yi,hr:()=>ps,html:()=>ao,i:()=>As,iframe:()=>Ys,img:()=>qs,input:()=>Ea,ins:()=>ca,isBatching:()=>Cc,isSSR:()=>re,kbd:()=>Cs,label:()=>Ta,lazy:()=>Er,lazyIsland:()=>ku,legend:()=>wa,li:()=>ms,line:()=>Wa,linearGradient:()=>tc,link:()=>Ba,longPress:()=>Jr,main:()=>Qi,map:()=>Us,mark:()=>Ns,marker:()=>sc,marquee:()=>uc,mask:()=>Qa,match:()=>Gc,math:()=>ra,menu:()=>Da,meta:()=>Fa,meter:()=>ka,mount:()=>su,mountIslands:()=>Nu,nav:()=>Xi,nextTick:()=>Du,noscript:()=>ia,object:()=>Zs,ol:()=>gs,on:()=>xc,onCleanup:()=>yc,onMount:()=>yt,onUnmount:()=>hc,optgroup:()=>_a,option:()=>Aa,output:()=>Ca,p:()=>Yt,param:()=>Xs,path:()=>qa,pattern:()=>ec,picture:()=>Qs,polygon:()=>Ua,polyline:()=>Ka,portal:()=>ea,pre:()=>Xt,progress:()=>Na,q:()=>Rs,radialGradient:()=>nc,reactiveArray:()=>du,rect:()=>Ja,ref:()=>mu,registerAction:()=>je,registerComponent:()=>Yc,registerDisposer:()=>x,registerIsland:()=>_u,replaceChildrenSafely:()=>W,reportDrainRunaway:()=>ge,reportError:()=>k,resolveComponent:()=>Xc,retrack:()=>ve,rp:()=>Ls,rt:()=>Ms,ruby:()=>Os,runInSSRContext:()=>Lr,s:()=>Ds,samp:()=>$s,script:()=>sa,section:()=>Ji,select:()=>Ra,setGlobalErrorHandler:()=>qc,setMaxDrainIterations:()=>fr,setRuntimeErrorHandler:()=>_n,show:()=>Kc,signal:()=>C,slot:()=>Ha,small:()=>Hs,source:()=>ta,span:()=>I,stop:()=>rc,store:()=>gu,strict:()=>yu,strictEffect:()=>vu,strong:()=>Is,style:()=>Ne,sub:()=>Ps,summary:()=>$a,sup:()=>Bs,svg:()=>na,symbol:()=>ic,table:()=>fa,tagFactory:()=>d,takePendingError:()=>gt,tbody:()=>pa,td:()=>ma,template:()=>Ia,text:()=>Ga,textarea:()=>La,tfoot:()=>ga,th:()=>ba,thead:()=>ha,time:()=>Fs,title:()=>Ki,tr:()=>ya,track:()=>Ks,transition:()=>Ou,trapFocus:()=>Zr,trustHTML:()=>vo,tspan:()=>Ya,u:()=>zs,ul:()=>bs,unregisterComponent:()=>Zc,unregisterDisposer:()=>Ue,unregisterIsland:()=>Au,untracked:()=>ne,use:()=>oc,var_:()=>Vs,video:()=>Js,watch:()=>bu,when:()=>Jc,withSSR:()=>Mr,writable:()=>hu});var kn=Symbol.for("sibujs.runtime-errors.v1");function At(){let e=globalThis,t=e[kn];if(t)return t;let n={handler:null,handlerDepth:0};return e[kn]=n,n}function _n(e){let t=At(),n=t.handler;return t.handler=e,n}function An(){return At().handler}function Ct(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Lo(e)}`;return new Error(t,{cause:e})}function Lo(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 Mo(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Oo=Symbol.for("sibujs.reactive.v1");function Do(e){let t=globalThis[Oo];return t?.untracked?t.untracked(e):e()}var $o="sibu:error-propagate";function Ho(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Io(n);if(!r)return!1;try{let o=new CustomEvent($o,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Io(e){let n=e;for(;n;){if(n.nodeType===1&&typeof n.dispatchEvent=="function")return n;n=n.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function Po(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Mo(t)}: ${e.message}`,e)}function k(e,t){let n=Ct(e);Do(()=>{if(Ho(n,t))return;let r=At(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:n,t);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--}}Po(n,t)})}function ie(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function M(e,t){if(!e)throw new Error(`[SibuJS] ${t}`)}function j(e){{let t=e();t&&console.warn(`[SibuJS] ${t}`)}}function O(e){console.warn(`[SibuJS] ${e}`)}var se=new WeakMap,ce=1e4;function ge(e,t,n){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${t} teardowns with ${n} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:t,remaining:n})}var Ee=0;function rt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var U=[];function Cn(){return rt(U[U.length-1])}function Nn(e){return e===null&&U.length===0?!1:(U.push(rt(e)),!0)}function Rn(){U.pop()}function x(e,t){let n=se.get(e);n||(n=[],se.set(e,n)),n.push(t),Ee++;let r=rt(U[U.length-1]);r&&r.entries.push([e,t])}function Ln(e){let t={entries:[],closed:!1},n=t.entries;U.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=ce){ge("rollback",s,n.length);break}let[a,c]=n.pop();if(Ue(a,c)){s++;try{c()}catch(u){k(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,U.pop()}throw i}t.closed=!0,U.pop();let o=rt(U[U.length-1]);if(o){for(let i of n)se.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function Ue(e,t){let n=se.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),Ee--,n.length===0&&se.delete(e),!0)}function D(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--)Bo(n[r])}function Bo(e){if(!se.has(e))return;let t=0,n=!1;for(;!n;){let r=se.get(e);if(!r||r.length===0)break;let o=r.slice();se.delete(e),Ee-=o.length;for(let i=0;i<o.length;i++){if(t>=ce){let s=o.slice(i),a=se.get(e);se.set(e,a?s.concat(a):s),Ee+=s.length,ge("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){k(s,{phase:"cleanup",name:"disposer"})}}}}function W(e,...t){for(let r=0;r<t.length;r++){let o=t[r];o.parentNode?.removeChild(o)}let n=Array.from(e.childNodes);for(let r=0;r<n.length;r++)D(n[r]);e.replaceChildren(...t)}function Mn(e=0){return e>0&&Ee>e&&O(`checkLeaks: ${Ee} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),Ee}function He(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Fo=/[A-Z]/,zo=/[A-Z]/g;function K(e){return Fo.test(e)?e.replace(zo,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function be(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}var Vo=["http:","https:","mailto:","tel:","ftp:"],jo=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function it(e){let t=He(e).trim();if(!t)return"";let n=e.replace(jo,"");if(t.length>=2&&(t[0]==="\\"||t[0]==="/")&&(t[1]==="\\"||t[1]==="/")&&(t[0]==="\\"||t[1]==="\\"))return"";let r=t.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 n;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&Vo.indexOf(i)===-1?"":n}var Wo=/^\d+(\.\d+)?[wx]$/;function Nt(e){return e===" "||e===" "||e===`
2
+ `||e==="\r"||e==="\f"}function qo(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(Nt(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!Nt(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let u="",l=!1;for(;r<o;){let m=t[r];if(l){u+=m,m===")"&&(l=!1),r++;continue}if(Nt(m)){u&&a.push(u),u="",r++;continue}if(m===","){r++;break}m==="("&&(l=!0),u+=m,r++}u&&a.push(u)}if(s===""||a.length>1||a.length===1&&!Wo.test(a[0]))continue;let c=it(s);c&&(c.startsWith(",")||c.endsWith(",")||n.push(a.length===1?`${c} ${a[0]}`:c))}return n.join(", ")}var Uo=/[(:@\\]/;function Ko(e){return e===" "||e===" "||e===`
3
+ `||e==="\r"||e==="\f"}function On(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Jo(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r!=="\\"){t+=r;continue}if(n+1>=e.length)break;let o=e[n+1];if(o===`
4
4
  `||o==="\f"){n+=1;continue}if(o==="\r"){n+=e[n+2]===`
5
- `?2:1;continue}if(kn(o)){let i="",a=n+1;for(;a<e.length&&i.length<6&&kn(e[a]);)i+=e[a],a++;a<e.length&&Po(e[a])&&(a+=e[a]==="\r"&&e[a+1]===`
6
- `?2:1);let s=Number.parseInt(i,16),c=s===0||s>1114111||s>=55296&&s<=57343;t+=c?"\uFFFD":String.fromCodePoint(s),n=a-1;continue}t+=o,n+=1}return t}var _n=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],Fo=4,zo=5,Vo=8;function jo(e){if(!e)return"an element";let t=e.tagName.toLowerCase(),n=e.getAttribute("id");n&&(t+=`#${n}`);let r=e.getAttribute("class");return r&&(t+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${t}>`}var kt=new Set,An=100,Cn=!1;function tt(e,t,n){V(()=>{let r=["url() in an inline style is an exfiltration channel: the browser fetches it immediately and the URL's path or query can carry page data off-origin","expression() executes arbitrary script in legacy engines","the javascript: scheme executes script","the vbscript: scheme executes script","-moz-binding loads and runs remote XBL","behavior: loads and runs a remote HTC script","@import pulls in a remote stylesheet","image-set() fetches remote images, the same exfiltration channel as url()","filter:progid activates legacy scriptable filters","image() fetches its string argument as a URL, the same exfiltration channel as url()","src() fetches its string argument as a URL, the same exfiltration channel as url()"],o=n?.property?`${n.property}: ${e}`:e,i=jo(n?.element),a=`${i}|${o}`;return kt.has(a)?"":kt.size>=An?Cn?"":(Cn=!0,`${An} distinct dropped style declarations have been reported; suppressing further ones for the rest of this session so they cannot flood the console. The declarations are still dropped \u2014 only the reporting stops. Fix the reported ones and reload to see any that remain.`):(kt.add(a),`style declaration "${o}" was dropped by the style sanitizer on ${i} \u2014 ${r[t]}. The element renders without it, which usually looks like a missing image rather than an error. Sanctioned alternatives: for a content image use an <img> element (or a <picture>); for decoration, put the rule in a stylesheet and set a class instead \u2014 stylesheet CSS is not sanitized, only inline style attributes are. If this declaration is not yours, it came from untrusted data and the drop just prevented an exfiltration.`)})}function Nn(e){return(e.includes("\\")?Bo(e):e).toLowerCase().replace(/\s+/g,"")}function _t(e){if(!Io.test(e))return-1;let t=Nn(e);for(let n=0;n<_n.length;n++)if(t.includes(_n[n]))return n;return-1}function rt(e,t,n){let r=At(e,t);return r===-1?t:(tt(t,r,{property:e,element:n?.element}),"")}function At(e,t){let n=_t(t);if(n!==-1)return n;let r=U(e);return r==="behavior"?zo:r==="-moz-binding"?Fo:(r==="filter"||r==="-ms-filter")&&Nn(t).includes("progid:")?Vo:-1}function qo(e){let t=[],n="",r=0,o="";for(let a=0;a<e.length;a++){let s=e[a];if(o){n+=s,s==="\\"&&a+1<e.length?n+=e[++a]:s===o&&(o="");continue}if(s==="\\"){n+=s,a+1<e.length&&(n+=e[++a]);continue}if(s==="/"&&e[a+1]==="*"){let c=e.indexOf("*/",a+2);if(c===-1)return null;a=c+1;continue}if(s==='"'||s==="'")o=s;else if(s==="("||s==="[")r++;else if(s===")"||s==="]"){if(--r<0)return null}else{if(s==="{"||s==="}")return null;if(s===";"&&r===0){t.push(n),n="";continue}}n+=s}if(o||r!==0)return null;t.push(n);let i=[];for(let a of t){let s=a.indexOf(":");if(s===-1)continue;let c=a.slice(0,s).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(c))continue;let l=a.slice(s+1).trim(),d=/!\s*important\s*$/i.exec(l);if(d&&(l=l.slice(0,d.index).trim()),l==="")continue;let m=c.startsWith("--")?c:U(c);i.push([m,l,d!==null])}return i}function Wo(e,t){let n=String(e),r=qo(n);if(r===null)return _t(n)!==-1&&tt(n,_t(n),t),"";let o=[];for(let[i,a,s]of r){let c=At(i,a);if(c!==-1){tt(a,c,{property:i,element:t?.element});continue}o.push(`${i}: ${a}${s?" !important":""}`)}return o.join("; ")}function ot(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return Wo(n,t);let r=document.createElement("div");try{r.style.cssText=n}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let a=r.style[i],s=r.style.getPropertyValue(a),c=At(a,s);if(c!==-1){tt(s,c,{property:a,element:t?.element});continue}let l=r.style.getPropertyPriority(a);o.push(`${a}: ${s}${l?` !${l}`:""}`)}return o.join("; ")}var Ct=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),Uo=new Set(["srcdoc"]);function qe(e){return Uo.has(e.toLowerCase())}function Rn(e){return Ct.has(e.toLowerCase())}function Ko(e){let t=e.toLowerCase();return t==="style"||Ct.has(t)}function Jo(e,t,n){let r=e.toLowerCase();return r==="srcset"?Ho(t):Ct.has(r)?nt(t):r==="style"?ot(t,n):t}function Ln(e,t,n){if(!Ko(e))return t;let r=Jo(e,t,n);return r===""?null:r}function xe(e){return e===" "||e===" "||e===`
7
- `||e==="\r"||e==="\f"}function it(e){let t=0,n=e.length;for(;t<n&&xe(e[t]);)t++;for(;n>t&&xe(e[n-1]);)n--;return e.slice(t,n)}var K=e=>({kind:"forbidden",reason:e});function Go(e){let t=it(Oe(e));if(t==="")return K("empty content");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return K("missing or non-numeric delay");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return K("unparseable delay");for(;n<t.length&&xe(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return K("unexpected text after delay");for(n++;n<t.length&&xe(t[n]);)n++;let o=n;for(;n<t.length&&!xe(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return K(`unsupported refresh key ${JSON.stringify(i)}`);for(;n<t.length&&xe(t[n]);)n++;if(t[n]!=="=")return K("missing '=' after url");for(n++;n<t.length&&xe(t[n]);)n++;let a,s=t[n];if(s==='"'||s==="'"){let l=t.indexOf(s,n+1);if(l===-1)return K("unterminated quoted destination");if(a=t.slice(n+1,l),it(t.slice(l+1))!=="")return K("trailing text after quoted destination")}else if(a=it(t.slice(n)),/[;,]/.test(a))return K("multiple refresh assignments");if(a==="")return K("empty destination");let c=nt(a);return c===""?K("destination uses a disallowed protocol"):{kind:"allowed",delay:r,destination:a,sanitizedDestination:c}}function Nt(e){let t,n,r,o=new Set;for(let[i,a]of e){let s=U(i);o.has(s)&&(r=s),o.add(s),s==="http-equiv"?t=a:s==="content"&&(n=a)}return r!==void 0?K(`duplicate case-insensitive attribute ${JSON.stringify(r)}`):typeof t!="string"?{kind:"not-refresh"}:it(Oe(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:Go(n)}var Yo="http://www.w3.org/1999/xhtml",Zo="http://www.w3.org/2000/svg",Xo=new Set(["script","iframe","object","embed","frame","frameset"]);function Dn(e){return U(e)}function On(e){return Xo.has(Dn(e))}var Qo=new Set(["script","style"]);function $n(e){return Qo.has(Dn(e))}var L={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},ei=new Set(["src","href","xlink:href","type","language"]),ti=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Rt=new WeakSet;function Hn(e){return e.namespaceURI===Yo||e.namespaceURI===null}function In(e,t,n){let r=new Map,o=e.attributes;for(let i=0;i<o.length;i++){let a=o[i];a.name!==t&&r.set(a.name,a.value)}return t!==null&&n!==null&&r.set(t,n),r}function ni(e){Rt.has(e)||(Rt.add(e),e.getAttribute("content")!==null&&Nt(In(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function ri(e,t,n,r){if(!Hn(e))return L.None;let o=U(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&ni(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return L.None;let i=Nt(In(e,o,n));return i.kind==="forbidden"?L.MetaRefreshForbidden:i.kind!=="not-refresh"&&Rt.has(e)?L.MetaRefreshReactive:L.None}function oi(e,t){if(t===null||U(e)!=="attributename")return L.None;let n=Oe(t);return Rn(n)||me(n)||qe(n)?L.AnimationTarget:L.None}var st=new WeakSet;function Mn(e){if(e===null)return!1;let t=U(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function ii(e,t,n,r){if(!Hn(e))return L.None;let o=U(t);return o==="href"?r==="static"||n===null?L.None:Mn(e.getAttribute("rel"))?L.StylesheetSource:(st.add(e),L.None):o==="rel"&&Mn(n)&&st.has(e)&&e.hasAttribute("href")?L.StylesheetSource:L.None}function Lt(e,t,n,r){let o=e.localName;return o==="meta"?ri(e,t,n,r):o==="link"?ii(e,t,n,r):o==="script"?r==="static"||n===null?L.None:ei.has(U(t))?L.ScriptSource:L.None:ti.has(o)&&e.namespaceURI===Zo?oi(t,n):L.None}function Mt(e,t,n){e.localName!=="link"||U(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?st.add(e):st.delete(e))}var si="http://www.w3.org/1999/xhtml",ai="http://www.w3.org/2000/svg",ci="http://www.w3.org/1999/xlink",li="http://www.w3.org/XML/1998/namespace",ui=new Set(["checked","disabled","selected"]);function di(e){return e.namespaceURI===null||e.namespaceURI===si}function Bn(e,t,n){V(()=>`${e}: refusing "${t}" in this element's context \u2014 ${["",'the element would become a <meta http-equiv="refresh"> directive the shared refresh policy forbids (a destination outside the URL allowlist, or a directive too malformed to read unambiguously)',"a <meta> whose http-equiv or content is reactive may never carry a refresh directive: a browser schedules the navigation as soon as the directive is valid, and nothing can withdraw it when the state changes back","a runtime value may not choose the program a <script> runs; name the script in static template source, or load it through Head({ script }) as an explicit trust decision","an SVG animation may not target a URL, event-handler or nested-document attribute; its to / values would be written into that attribute without passing the URL policy",'a runtime-chosen href may not become an applied <link rel="stylesheet">: a well-formed URL is not a trusted stylesheet. Name the stylesheet in static template source, or load a runtime-chosen one through Head({ link }) as an explicit trust decision'][n]}. The write was not performed.`)}function Pn(e,t,n){e[t]=n}function fi(e,t){if(e.namespaceURI!==ai)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?ci:n.startsWith("xml:")?li:null}function Z(e,t,n,r={}){let o=pi(e,t,n,r);return e.localName==="link"&&Mt(e,t,r.reactive?"reactive":"runtime"),o}function pi(e,t,n,r){let o=fi(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(me(t))return D(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${t}". Its value would be evaluated as JavaScript. Use on:{ ${t.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let a=n==null||n===!1?null:n===!0?"":String(n),s=Lt(e,t,a,r.reactive?"reactive":"runtime");if(s!==L.None)return Bn(r.label??"setSafeAttribute",t,s),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;if(n==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0;if(qe(t))return D(`${r.label??"setSafeAttribute"}: refusing to set "${t}". The browser parses this attribute as a nested HTML document, so a generic string value cannot be made safe \u2014 attribute escaping is undone before the parse. Build the frame's content another way.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let c=di(e),l=c?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let f=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==f&&(o?e.setAttributeNS(o,t,f):e.setAttribute(t,f)),!0}return c&&ui.has(l)&&l in e?Pn(e,l,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let d=String(n);if(r.syncValueProperty!==!1&&c&&(l==="value"||l==="checked")&&l in e)return Pn(e,l,l==="checked"?!!n:d),!0;let m=d===""?"":Ln(t,d,{element:e});return m===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===m||(o?e.setAttributeNS(o,t,m):e.setAttribute(t,m)),!0)}function Dt(e,t,n){if(qe(t))return D(`html: refusing static attribute "${t}" \u2014 the browser parses it as a nested document.`),!1;let r=Lt(e,t,n,"static");return r!==L.None?(Bn("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Mt(e,t,"static"),!0)}var mi=4096,Ot=[];function gi(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function hi(e,t,n){let r=Ot.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=gi();return o.sig=e,o.sub=t,o.epoch=n,o}function Fn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Ot.length<mi&&Ot.push(e)}function bi(e,t){let n=e.subsHead??null;t.sigPrev=null,t.sigNext=n,n?n.sigPrev=t:e.subsTail=t,e.subsHead=t,e.__sc=(e.__sc??0)+1}function zn(e){let t=e.sig;if(!t)return;let n=e.sigPrev,r=e.sigNext;n?n.sigNext=r:t.subsHead=r,r?r.sigPrev=n:t.subsTail=n,t.__sc=(t.__sc??1)-1,t.__activeNode===e&&(t.__activeNode=e.prevActive),t.__sc===0&&(t.subsHead=null,t.subsTail=null)}function yi(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function vi(e){let t=e.sub;if(!t)return;let n=e.subPrev,r=e.subNext;n?n.subNext=r:t.depsHead=r,r?r.subPrev=n:t.depsTail=n}var Q=null,ae=null,ge=0,he=[],X=new Set,Si=[];function xi(e){try{e()}catch(t){let n=e;k(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Ei(e){let t=e.depsHead??null;if(t===null)return!0;for(;t!==null;){let n=t.sig;if(n===null)return!0;if(n._d===!0&&n._validate!==void 0)try{n._validate()}catch{return!0}if(t.depVersion!==n.__v)return!0;t=t.subNext}return!1}var ie=0,ce=!1;function Ht(){ie===0&&(ae=Q,Q=null,ce=!0),ie++}function It(){ie--,ie===0&&(Q=ae,ae=null,ce=!1)}function Vn(){return ce}function jn(e){Ht();try{return e()}finally{It()}}var Ti=0;function Pt(e,t){let n=Q,r=0,o=null;ce&&(r=ie,o=ae,ie=0,ae=null,ce=!1),Q=t;let i=t;i._cap===void 0&&(i._cap=Sn());let a=++Ti;i._epoch=a,i._structDirty=!1;for(let s=i.depsHead??null;s!==null;s=s.subNext){let c=s.sig;s.prevActive=c.__activeNode??null,c.__activeNode=s}try{e()}finally{Q=n,r!==0&&(ie=r,ae=o,ce=!0);let s=i.depsHead??null;for(;s!==null;){let c=s.subNext,l=s.sig;l.__activeNode=s.prevActive,s.prevActive=null,s.epoch!==a&&(vi(s),zn(s),Fn(s)),s=c}}}function qn(e,t){if(!t)return Bt(e);$e(t);let n=Q,r=0,o=null;ce&&(r=ie,o=ae,ie=0,ae=null,ce=!1),Q=t;try{e()}finally{Q=n,r!==0&&(ie=r,ae=o,ce=!0);let a=t;for(let s=a.depsHead??null;s!==null;s=s.subNext){let c=s.sig;c.__activeNode=s.prevActive,s.prevActive=null}}let i=t;return i._dispose??(i._dispose=()=>$e(t))}function Bt(e,t){let n=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{Pt(e,r)}finally{o._reentrant=!1}}},r=n;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=t;try{n()}catch(o){throw r._disposed=!0,r._errorNode=void 0,$e(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,$e(r)})}function Wn(e){if(!Q)return;let t=Q,n=e,r=t._epoch??0,o=n.__activeNode??null;if(o!==null&&o.sub===t){o.epoch=r,o.depVersion=n.__v??Number.NaN;return}n._validate!==void 0&&(t._hasComputedDep=!0);let i=hi(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,yi(t,i),bi(n,i),t._structDirty=!0}function $e(e){let t=e,n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;zn(n),Fn(n),n=r}}var at=1e3,ct=1e6,lt=0,Ee=new Set;function Un(e){let t=at;return Number.isFinite(e)&&e>0&&(at=Math.floor(e)),t}function Kn(e){let t=ct;return Number.isFinite(e)&&e>0&&(ct=Math.floor(e)),t}function wi(e){let t=e;return t._runEpoch!==lt?(t._runEpoch=lt,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>at)}function ki(e){let t=e.__name??"<unnamed>";k(new Error(`subscriber "${t}" fired more than ${at} 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:t})}function _i(){k(new Error(`Notification drain exceeded ${ct} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Jn(){let e=0;for(;e<he.length;){if(e>=ct){_i();break}let t=he[e++];if(X.delete(t),Ee.size>0&&Ee.has(t)||t._hasComputedDep===!0&&!Ei(t))continue;if(wi(t)){ki(t),Ee.add(t);continue}let n=xn(t._cap??null);try{xi(t)}finally{n&&En()}}}function Gn(){if(!(ge>0)){ge++,lt++;try{Jn()}finally{ge--,ge===0&&(he.length=0,X.clear(),Ee.size>0&&Ee.clear())}}}function $t(e){e();let t=e._sig;if(!t)return;let n=Si,r=n.length;for(n.push(t);n.length>r;){let i=n.pop().subsHead??null;for(;i;){let a=i.sub;if(a)if(a._c){let s=a._sig;s?(!s._d||s._f===!0)&&(s._d=!0,s._f=!1,n.push(s)):a()}else X.has(a)||(X.add(a),he.push(a));i=i.sigNext}}}function Yn(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?$t(r):X.has(r)||(X.add(r),he.push(r))),n=n.sigNext}}function Zn(e){let n=e.subsHead;if(n){if(ge>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?$t(o):X.has(o)||(X.add(o),he.push(o))),r=r.sigNext}return}ge++,lt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?$t(o):X.has(o)||(X.add(o),he.push(o))),r=r.sigNext}Jn()}finally{ge--,ge===0&&(he.length=0,X.clear(),Ee.size>0&&Ee.clear())}}}function Xn(e){return e.__sc??0}function Qn(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function er(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var tr="4.9.0",nr=Symbol.for("sibujs.reactive.v1");function Ci(){let e=globalThis,t=e[nr];if(t)return!t.__dupWarned&&(t.__dupWarned=!0,D(`Multiple instances of the reactive runtime detected on this page (active: ${t.version}, duplicate: ${tr}). Reactivity is NOT broken and no bundler configuration is required: every copy routes through the first one via a global registry, so signal writes still reach subscribers registered by any copy. This is only a SIZE issue \u2014 the duplicate copy's bytes are downloaded and parsed for nothing. If you want them back, de-duplicate sibujs in your bundler (Vite: resolve.dedupe: ['sibujs']). Mismatched VERSIONS above are worth fixing regardless, since only the first one loaded is used.`)),t;let n={suspendTracking:Ht,resumeTracking:It,isTrackingSuspended:Vn,untracked:jn,retrack:Pt,track:qn,reactiveBinding:Bt,recordDependency:Wn,cleanup:$e,setMaxSubscriberRepeats:Un,setMaxDrainIterations:Kn,drainNotificationQueue:Gn,queueSignalNotification:Yn,notifySubscribers:Zn,getSubscriberCount:Xn,getSubscriberDeps:Qn,forEachSubscriber:er,version:tr};return e[nr]=n,n}var I=Ci(),Te=I.suspendTracking,we=I.resumeTracking,rr=I.isTrackingSuspended,ee=I.untracked,be=I.retrack,J=I.track,P=I.reactiveBinding,ke=I.recordDependency,_e=I.cleanup,Ul=I.setMaxSubscriberRepeats,or=I.setMaxDrainIterations,ir=I.drainNotificationQueue,sr=I.queueSignalNotification,He=I.notifySubscribers,Kl=I.getSubscriberCount,Jl=I.getSubscriberDeps,Gl=I.forEachSubscriber;function We(e,t,n){if(me(t))return Z(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){k(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}Z(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return P(r,e)}function ar(e,t,n){let r=null;function o(){let a;try{a=typeof t=="function"?t():t}catch(c){k(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let s;try{s=typeof n=="function"?n():n}catch(c){k(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==a&&(e.removeAttribute(r),r=null),Z(e,a,s,{label:"bindDynamic",reactive:!0})&&(r=a)}let i=P(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Ft=["data-focus-key","id","name"],Ni=new Set(["text","search","url","tel","password",""]);function Ri(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Ni.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 Ue(e){if(e.length===0||typeof document>"u")return null;let t=document.activeElement;if(!t||t===document.body)return null;let n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(a===t||a.nodeType===1&&a.contains(t)){n=!0;break}}if(!n)return null;let r=null,o=null;for(let i=0;i<Ft.length;i++){let a=t.getAttribute(Ft[i]);if(a){r=Ft[i],o=a;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Ri(t)}}function Li(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Mi(e,t){let n=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let a=i;a.matches(t)&&(r++,n??(n=a));let s=a.querySelectorAll(t);for(let c=0;c<s.length;c++)r++,n??(n=s[c]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function cr(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function Ie(e,t,n){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){cr(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:a}=Mi(t,`[${e.attr}=${Li(e.value)}]`);if(i&&i.tagName===e.tag){cr(i,e);return}o=a>1}V(()=>{let i=e.attr?` (${e.attr}="${e.value}")`:"",a=o?`several elements in the rebuilt subtree share ${e.attr}="${e.value}", so there is no way to tell which one the user was in \u2014 a shared name (a radio group) identifies a GROUP, not a control. Add a unique id or data-focus-key to each`:"no element in the rebuilt subtree carries the same identity. Give it a stable id, name, or data-focus-key that the rebuild reproduces";return`${n}: a reactive rebuild discarded the focused element <${e.tag.toLowerCase()}>${i} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${a}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them.`})}function le(e,t){let n=[];function r(){let o;try{o=t()}catch(d){k(d,{phase:"binding",name:"bindChildNode",node:e});return}let i=Ue(n);if(o==null||typeof o=="boolean"){for(let d=0;d<n.length;d++){let m=n[d];O(m),m.parentNode&&m.parentNode.removeChild(m)}n.length=0,Ie(i,n,"bindChildNode");return}let a=e.parentNode;if(!a){n.length=0;return}let s;if(Array.isArray(o)){s=[];let d=new Set;for(let m=0;m<o.length;m++){let g=o[m];if(g==null||typeof g=="boolean")continue;let f=g instanceof Node?g:document.createTextNode(String(g));if(d.has(f)){D("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}d.add(f),s.push(f)}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(n.length>0&&s.length>0){let d=new Set(n);c=new Set;for(let m=0;m<s.length;m++)d.has(s[m])&&c.add(s[m])}for(let d=0;d<n.length;d++){let m=n[d];c?.has(m)||(O(m),m.parentNode&&m.parentNode.removeChild(m))}let l=e;for(let d=0;d<s.length;d++){let m=s[d];l.nextSibling!==m&&a.insertBefore(m,l.nextSibling),l=m}n=s,Ie(i,s,"bindChildNode")}return P(r,e)}var R="http://www.w3.org/2000/svg",Di=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var zt=new Set,lr=100,ur=!1,dr=new Map;function fr(e){let t=dr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),dr.set(e,t)),t}function Oi(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,a=P(()=>{let s=r();if(s===null||typeof s!="object"){o=[],i=!0,e.setAttribute("style",ot(String(s),{element:e}));return}let c=e.style;i&&(e.removeAttribute("style"),i=!1);let l=[];for(let d in s){if(!Object.hasOwn(s,d))continue;let m=s[d];if(m==null)continue;let g=fr(d);l.push(g),c.setProperty(g,rt(g,String(m),{element:e}))}for(let d=0;d<o.length;d++)l.indexOf(o[d])===-1&&c.removeProperty(o[d]);o=l},e);x(e,a);return}if(typeof t=="string"){e.setAttribute("style",ot(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=fr(r);if(typeof o=="function"){let a=o,s=P(()=>{n.style.setProperty(i,rt(i,String(a()),{element:e}))},e);x(e,s)}else n.style.setProperty(i,rt(i,String(o),{element:e}))}}function $i(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=P(()=>{let a=t();a==null||a===!1?e.removeAttribute("class"):e.setAttribute("class",a)},e);x(e,i);return}let n=t,r=!1,o="";for(let i in n){if(!Object.hasOwn(n,i))continue;let a=n[i];if(typeof a=="function"){r=!0;break}a&&(o=o?`${o} ${i}`:i)}if(r){let a=P(()=>{let s="";for(let c in n){if(!Object.hasOwn(n,c))continue;let l=n[c];(typeof l=="function"?l():l)&&(s=s?`${s} ${c}`:c)}e.setAttribute("class",s)},e);x(e,a)}else e.setAttribute("class",o)}function Vt(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),x(e,le(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),x(e,le(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 a=document.createComment("");e.appendChild(a),x(e,le(a,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)))}}}function u(e,t){let n=On(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=t?document.createElementNS(t,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Vt(i,o),i):(V(()=>{let f=r.trim().split(/\s+/);if(f.length<2)return"";let p=0;for(let b=0;b<f.length;b++){let y=f[b];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&p++}if(p<2)return"";let h=`${e}|${r}`;return zt.has(h)?"":zt.size>=lr?ur?"":(ur=!0,`tagFactory: ${lr} distinct lone-string class warnings have been reported; suppressing further ones for the rest of this session so they cannot flood the console. Fix the reported ones and reload to see any that remain.`):(zt.add(h),`tagFactory: lone string "${r}" looks like a class list but is being rendered as TEXT. For a class, use ${e}({ class: "${r}" }) \u2014 or ${e}("${r}", children) to set the class AND add children.`)}),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 Vt(i,r),i;let a=r,s=a.class;s!=null&&$i(i,s);let c=a.id;typeof c=="function"?x(i,We(i,"id",c)):c!=null&&(typeof c=="string"&&Di.has(c.toLowerCase())&&D(`tagFactory: element id="${c}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=c);let l=o!==void 0?o:a.nodes;l!=null&&Vt(i,l);let d=a.on;if(d)for(let f in d){if(!Object.hasOwn(d,f))continue;let p=d[f];typeof p=="function"?i.addEventListener(f,p):D(`tagFactory: on.${f} handler is not a function (got ${typeof p}). Event listener was not attached.`)}let m=a.style;m!=null&&Oi(i,m);let g=a.ref;g&&(g.current=i);for(let f in a)switch(f){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(a,f))continue;let p=a[f];if(p==null||me(f))continue;typeof p=="function"?x(i,We(i,f,p)):Z(i,f,p,{syncValueProperty:!1,label:"tagFactory"})}}return typeof a.onElement=="function"&&a.onElement(i),i}}var Su=u("html"),Hi=u("head"),Ii=u("body"),Pi=u("title"),A=u("div"),H=u("span"),Bi=u("section"),Fi=u("article"),zi=u("header"),Vi=u("footer"),ji=u("nav"),qi=u("main"),Wi=u("aside"),Ui=u("address"),jt=u("p"),Ki=u("h1"),Ji=u("h2"),qt=u("h3"),Gi=u("h4"),Yi=u("h5"),Zi=u("h6"),Xi=u("blockquote"),Qi=u("dd"),es=u("dl"),ts=u("dt"),ns=u("figcaption"),rs=u("figure"),os=u("hr"),is=u("li"),ss=u("ol"),as=u("ul"),Wt=u("pre"),cs=u("a"),ls=u("abbr"),us=u("b"),ds=u("bdi"),fs=u("bdo"),ps=u("br"),ms=u("cite"),Ut=u("code"),gs=u("data"),hs=u("dfn"),bs=u("em"),ys=u("i"),vs=u("kbd"),Ss=u("mark"),xs=u("q"),Es=u("rp"),Ts=u("rt"),ws=u("ruby"),ks=u("s"),_s=u("samp"),As=u("small"),Cs=u("strong"),Ns=u("sub"),Rs=u("sup"),Ls=u("time"),Ms=u("u"),Ds=u("var"),Os=u("area"),$s=u("audio"),Hs=u("img"),Is=u("map"),Ps=u("track"),Bs=u("video"),Fs=u("embed"),zs=u("iframe"),Vs=u("object"),js=u("param"),qs=u("picture"),Ws=u("portal"),Us=u("source"),Ks=u("svg",R),Js=u("math"),Gs=u("canvas"),Ys=u("noscript"),Zs=u("script"),Xs=u("del"),Qs=u("ins"),ea=u("caption"),ta=u("col"),na=u("colgroup"),ra=u("table"),oa=u("tbody"),ia=u("td"),sa=u("tfoot"),aa=u("th"),ca=u("thead"),la=u("tr"),Ke=u("button"),ua=u("datalist"),da=u("fieldset"),fa=u("form"),pa=u("input"),ma=u("label"),ga=u("legend"),ha=u("meter"),ba=u("optgroup"),ya=u("option"),va=u("output"),Sa=u("progress"),xa=u("select"),Ea=u("textarea"),Ta=u("details"),wa=u("dialog"),ka=u("menu"),_a=u("summary"),Aa=u("slot"),Ca=u("template"),Na=u("base"),Ra=u("link"),La=u("meta"),Ae=u("style"),Ma=u("circle",R),Da=u("ellipse",R),Oa=u("g",R),$a=u("line",R),Ha=u("path",R),Ia=u("polygon",R),Pa=u("polyline",R),Ba=u("rect",R),Fa=u("text",R),za=u("tspan",R),Va=u("defs",R),ja=u("clipPath",R),qa=u("mask",R),Wa=u("pattern",R),Ua=u("linearGradient",R),Ka=u("radialGradient",R),Ja=u("stop",R),Ga=u("use",R),Ya=u("symbol",R),Za=u("marker",R),Xa=u("center"),Qa=u("font"),ec=u("marquee"),tc=e=>u(e);var Kt="__sibuPendingError";function pr(e,t){let n=()=>e.parentNode?(k(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[Kt]=t)})}function ut(e){let t=e,n=t[Kt];if(n instanceof Error)return delete t[Kt],n}function mr(e){let t=null;return function(){if(t)return t();let r=A({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;t=i.default;let a=t();j(r,a)}).catch(i=>{if(o)return;let a=i instanceof Error?i:new Error(String(i));j(r,A({class:"sibu-lazy-error"},`Failed to load component: ${a.message}`)),pr(r,a)}),r.appendChild(H("sibu-lazy-loading","Loading...")),x(r,()=>{o=!0}),r}}function gr({nodes:e,fallback:t}){let n=A({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null,a=null;return x(n,()=>{o=!0,i&&(i.disconnect(),i=null),a&&!n.contains(a)&&O(a)}),queueMicrotask(()=>{if(!o)try{let s=e();if(a=s,s.classList.contains("sibu-lazy")){if(!s.querySelector(".sibu-lazy-loading")){j(n,s);return}i=new MutationObserver(()=>{if(o)return;s.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,j(n,s))}),i.observe(s,{childList:!0,subtree:!0})}else j(n,s)}catch(s){let c=s instanceof Error?s:new Error(String(s));pr(n,c)}}),n}function ft(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";k(n,{phase:r,name:t});return}}function Jt(e,t,n,r){let o=ft(e,t);typeof o=="function"&&(r()||!n.isConnected?ft(o,"onUnmount"):br(o,n))}var Pe=new WeakMap,Ce=new WeakMap,ue=new Set,de=new Set,Be=null,dt=0,nc=256;function Gt(e){let t=Pe.get(e);if(t){Pe.delete(e),ue.delete(e);for(let n of t)try{n()}catch{}}}function Yt(e){Ce.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Ce.get(e);if(n){Ce.delete(e),de.delete(e);for(let r of n)try{r()}catch{}}})}function rc(e){if(ue.size===0||e.nodeType!==1)return;let t=e;if(ue.has(t)&&t.isConnected&&Gt(t),t.firstElementChild)for(let n of Array.from(ue))n!==t&&n.isConnected&&t.contains(n)&&Gt(n)}function oc(e){if(de.size===0||e.nodeType!==1)return;let t=e;if(de.has(t)&&!t.isConnected&&Yt(t),t.firstElementChild)for(let n of Array.from(de))n!==t&&!n.isConnected&&t.contains(n)&&Yt(n)}function ic(){if(ue.size>0)for(let e of Array.from(ue))e.isConnected&&Gt(e);if(de.size>0)for(let e of Array.from(de))e.isConnected||Yt(e)}function hr(){Be||typeof document>"u"||(Be=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)rc(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)oc(t.removedNodes[n])}dt+=e.length,dt>=nc&&(dt=0,ic()),Zt()}),Be.observe(document.body,{childList:!0,subtree:!0}))}function Zt(){Be&&ue.size===0&&de.size===0&&(Be.disconnect(),Be=null,dt=0)}function sc(e,t){let n=Pe.get(e);return n||(n=[],Pe.set(e,n)),n.push(t),ue.add(e),hr(),()=>{let r=Pe.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Pe.delete(e),ue.delete(e))}Zt()}}function ac(e,t){let n=Ce.get(e);return n||(n=[],Ce.set(e,n)),n.push(t),de.add(e),hr(),()=>{let r=Ce.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ce.delete(e),de.delete(e))}Zt()}}function pt(e,t){if(!(typeof document>"u"))if(t){let n=!1,r=()=>n;if(x(t,()=>{n=!0}),t.isConnected){queueMicrotask(()=>{n||Jt(e,"onMount",t,r)});return}queueMicrotask(()=>{if(n)return;if(t.isConnected){Jt(e,"onMount",t,r);return}let o=sc(t,()=>{n||Jt(e,"onMount",t,r)});x(t,o)})}else queueMicrotask(()=>{ft(e,"onMount")})}function br(e,t){if(typeof document>"u")return;let n=!1,r=()=>{n||(n=!0,ft(e,"onUnmount"))};x(t,r);let o=()=>{if(n)return;let i=ac(t,r);x(t,i)};t.isConnected?o():pt(()=>{o()},t)}function cc(e,t){x(t,e)}function G(e,t,n){try{e.emit(t,n)}catch{}}var Xt=Symbol.for("sibujs.ssr.v1");function lc(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let t=null,n=process.getBuiltinModule;typeof n=="function"?t=n("node:async_hooks"):typeof xt=="function"&&(t=xt("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var ye=globalThis[Xt]??(globalThis[Xt]=lc()),Ne=ye.als,z=ye.fallbackStore;ye.fallbackDepth??(ye.fallbackDepth=0);var yr=!1;function uc(){if(yr||Ne||!(typeof process<"u"&&!!process.versions?.node))return;yr=!0;let t=process.versions.node;D(`SSR request isolation is UNAVAILABLE on this runtime (Node ${t}). AsyncLocalStorage could not be loaded, so concurrent requests share one SSR store: request state and the query cache can bleed between them. Node >= 22.3 is required for isolated SSR under ESM; the CommonJS build works on older versions. A fully synchronous render is unaffected.`)}function Re(){if(Ne){let e=Ne.getStore();if(e)return e}return z}function vr(){return Ne?Ne.getStore()??null:ye.fallbackDepth>0?z:null}function te(){return Re().ssr}function Sr(e){if(!te())return null;let t=Re(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function xr(){Re().ssr=!0}function Er(){Re().ssr=!1}function Tr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Ne)return Ne.run(t,e);uc();let n=z.ssr,r=z.suspenseIdCounter,o=z.idCounter,i=z.locale;z.ssr=!0,z.suspenseIdCounter=0,z.idCounter=0,z.locale=void 0,ye.fallbackDepth++;try{return e()}finally{ye.fallbackDepth--,z.ssr=n,z.suspenseIdCounter=r,z.idCounter=o,z.locale=i}}function wr(e){let t=Re(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Ar=globalThis;function dc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,ee(()=>t(o,void 0));else{let i=n;n=o,ee(()=>t(o,i))}}}var kr=100;function mt(e){let t=e.userCleanups;if(t.length!==0){e.userCleanups=[];for(let n=t.length-1;n>=0;n--)try{t[n]()}catch(r){k(r,{phase:"cleanup"})}}}function _r(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&mt(e),be(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=kr);e.rerunPending&&(e.rerunPending=!1,k(new Error(`effect re-requested itself ${kr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function fc(e){if(e.disposed)return;e.disposed=!0;let t=Ar.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&mt(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{_e(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function Y(e,t){if(M(typeof e=="function","effect: argument must be a function."),te())return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=a=>{n.userCleanups.push(a)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(a){r(a)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&mt(n),be(n.bodyFn,o),n.rerunPending&&_r(n)}finally{n.running=!1,n.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,n.subscriber=o,n.running=!0;try{be(n.bodyFn,n.subscriber),n.rerunPending&&_r(n)}catch(a){throw n.disposed=!0,n.userCleanups.length>0&&mt(n),_e(n.subscriber),a}finally{n.running=!1,n.rerunPending=!1}let i=Ar.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&G(i,"effect:create",{effectFn:e}),()=>fc(n)}var Je=0,Qt=new Set;function pc(e){Je++;try{return e()}finally{Je--,Je===0&&hc()}}function mc(e){return Je===0?!1:(Qt.add(e),!0)}function gc(){return Je>0}function hc(){try{for(let e of Qt)sr(e)}finally{Qt.clear()}ir()}var Cr=Symbol.for("sibujs.reactive.batch.v1");function bc(){let e=globalThis,t=e[Cr];if(t)return t;let n={batch:pc,enqueueBatchedSignal:mc,isBatching:gc};return e[Cr]=n,n}var en=bc(),q=en.batch,Le=en.enqueueBatchedSignal,yc=en.isBatching;var tn=globalThis;function C(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=t?.name,o=t?.equals;r&&(n.__name=r);function i(){return ke(n),n.value}i.__signal=n,r&&(i.__name=r);let a;if(o?a=s=>{let c=n.value,l=typeof s=="function"?s(c):s;if(!o(c,l)){if(n.value=l,n.__v++,!0){let d=tn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&G(d,"signal:update",{signal:n,name:r,oldValue:c,newValue:l})}Le(n)||He(n)}}:a=s=>{let c=n.value,l=typeof s=="function"?s(c):s;if(Object.is(l,c))return;n.value=l,n.__v++;let d=tn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&G(d,"signal:update",{signal:n,name:r,oldValue:c,newValue:l}),Le(n)||He(n)},!0){let s=tn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;s&&G(s,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,a]}function vc(e){let[t,n]=C(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Sc=`
5
+ `?2:1;continue}if(On(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&On(e[s]);)i+=e[s],s++;s<e.length&&Ko(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
6
+ `?2:1);let a=Number.parseInt(i,16),c=a===0||a>1114111||a>=55296&&a<=57343;t+=c?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var Dn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],Go=4,Yo=5,Zo=8;function Xo(e){if(!e)return"an element";let t=e.tagName.toLowerCase(),n=e.getAttribute("id");n&&(t+=`#${n}`);let r=e.getAttribute("class");return r&&(t+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${t}>`}var Rt=new Set,$n=100,Hn=!1;function ot(e,t,n){j(()=>{let r=["url() in an inline style is an exfiltration channel: the browser fetches it immediately and the URL's path or query can carry page data off-origin","expression() executes arbitrary script in legacy engines","the javascript: scheme executes script","the vbscript: scheme executes script","-moz-binding loads and runs remote XBL","behavior: loads and runs a remote HTC script","@import pulls in a remote stylesheet","image-set() fetches remote images, the same exfiltration channel as url()","filter:progid activates legacy scriptable filters","image() fetches its string argument as a URL, the same exfiltration channel as url()","src() fetches its string argument as a URL, the same exfiltration channel as url()"],o=n?.property?`${n.property}: ${e}`:e,i=Xo(n?.element),s=`${i}|${o}`;return Rt.has(s)?"":Rt.size>=$n?Hn?"":(Hn=!0,`${$n} distinct dropped style declarations have been reported; suppressing further ones for the rest of this session so they cannot flood the console. The declarations are still dropped \u2014 only the reporting stops. Fix the reported ones and reload to see any that remain.`):(Rt.add(s),`style declaration "${o}" was dropped by the style sanitizer on ${i} \u2014 ${r[t]}. The element renders without it, which usually looks like a missing image rather than an error. Sanctioned alternatives: for a content image use an <img> element (or a <picture>); for decoration, put the rule in a stylesheet and set a class instead \u2014 stylesheet CSS is not sanitized, only inline style attributes are. If this declaration is not yours, it came from untrusted data and the drop just prevented an exfiltration.`)})}function In(e){return(e.includes("\\")?Jo(e):e).toLowerCase().replace(/\s+/g,"")}function Lt(e){if(!Uo.test(e))return-1;let t=In(e);for(let n=0;n<Dn.length;n++)if(t.includes(Dn[n]))return n;return-1}function st(e,t,n){let r=Mt(e,t);return r===-1?t:(ot(t,r,{property:e,element:n?.element}),"")}function Mt(e,t){let n=Lt(t);if(n!==-1)return n;let r=K(e);return r==="behavior"?Yo:r==="-moz-binding"?Go:(r==="filter"||r==="-ms-filter")&&In(t).includes("progid:")?Zo:-1}function Qo(e){let t=[],n="",r=0,o="";for(let s=0;s<e.length;s++){let a=e[s];if(o){n+=a,a==="\\"&&s+1<e.length?n+=e[++s]:a===o&&(o="");continue}if(a==="\\"){n+=a,s+1<e.length&&(n+=e[++s]);continue}if(a==="/"&&e[s+1]==="*"){let c=e.indexOf("*/",s+2);if(c===-1)return null;s=c+1;continue}if(a==='"'||a==="'")o=a;else if(a==="("||a==="[")r++;else if(a===")"||a==="]"){if(--r<0)return null}else{if(a==="{"||a==="}")return null;if(a===";"&&r===0){t.push(n),n="";continue}}n+=a}if(o||r!==0)return null;t.push(n);let i=[];for(let s of t){let a=s.indexOf(":");if(a===-1)continue;let c=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(c))continue;let u=s.slice(a+1).trim(),l=/!\s*important\s*$/i.exec(u);if(l&&(u=u.slice(0,l.index).trim()),u==="")continue;let m=c.startsWith("--")?c:K(c);i.push([m,u,l!==null])}return i}function ei(e,t){let n=String(e),r=Qo(n);if(r===null)return Lt(n)!==-1&&ot(n,Lt(n),t),"";let o=[];for(let[i,s,a]of r){let c=Mt(i,s);if(c!==-1){ot(s,c,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function at(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return ei(n,t);let r=document.createElement("div");try{r.style.cssText=n}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),c=Mt(s,a);if(c!==-1){ot(a,c,{property:s,element:t?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var Ot=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),ti=new Set(["srcdoc"]);function Ke(e){return ti.has(e.toLowerCase())}function Pn(e){return Ot.has(e.toLowerCase())}function ni(e){let t=e.toLowerCase();return t==="style"||Ot.has(t)}function ri(e,t,n){let r=e.toLowerCase();return r==="srcset"?qo(t):Ot.has(r)?it(t):r==="style"?at(t,n):t}function Bn(e,t,n){if(!ni(e))return t;let r=ri(e,t,n);return r===""?null:r}function Te(e){return e===" "||e===" "||e===`
7
+ `||e==="\r"||e==="\f"}function ct(e){let t=0,n=e.length;for(;t<n&&Te(e[t]);)t++;for(;n>t&&Te(e[n-1]);)n--;return e.slice(t,n)}var J=e=>({kind:"forbidden",reason:e});function oi(e){let t=ct(He(e));if(t==="")return J("empty content");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return J("missing or non-numeric delay");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return J("unparseable delay");for(;n<t.length&&Te(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return J("unexpected text after delay");for(n++;n<t.length&&Te(t[n]);)n++;let o=n;for(;n<t.length&&!Te(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return J(`unsupported refresh key ${JSON.stringify(i)}`);for(;n<t.length&&Te(t[n]);)n++;if(t[n]!=="=")return J("missing '=' after url");for(n++;n<t.length&&Te(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return J("unterminated quoted destination");if(s=t.slice(n+1,u),ct(t.slice(u+1))!=="")return J("trailing text after quoted destination")}else if(s=ct(t.slice(n)),/[;,]/.test(s))return J("multiple refresh assignments");if(s==="")return J("empty destination");let c=it(s);return c===""?J("destination uses a disallowed protocol"):{kind:"allowed",delay:r,destination:s,sanitizedDestination:c}}function Dt(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=K(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?J(`duplicate case-insensitive attribute ${JSON.stringify(r)}`):typeof t!="string"?{kind:"not-refresh"}:ct(He(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:oi(n)}var ii="http://www.w3.org/1999/xhtml",si="http://www.w3.org/2000/svg",ai=new Set(["script","iframe","object","embed","frame","frameset"]);function zn(e){return K(e)}function Vn(e){return ai.has(zn(e))}var ci=new Set(["script","style"]);function jn(e){return ci.has(zn(e))}var L={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},ui=new Set(["src","href","xlink:href","type","language"]),li=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),$t=new WeakSet;function Wn(e){return e.namespaceURI===ii||e.namespaceURI===null}function qn(e,t,n){let r=new Map,o=e.attributes;for(let i=0;i<o.length;i++){let s=o[i];s.name!==t&&r.set(s.name,s.value)}return t!==null&&n!==null&&r.set(t,n),r}function di(e){$t.has(e)||($t.add(e),e.getAttribute("content")!==null&&Dt(qn(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function fi(e,t,n,r){if(!Wn(e))return L.None;let o=K(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&di(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return L.None;let i=Dt(qn(e,o,n));return i.kind==="forbidden"?L.MetaRefreshForbidden:i.kind!=="not-refresh"&&$t.has(e)?L.MetaRefreshReactive:L.None}function pi(e,t){if(t===null||K(e)!=="attributename")return L.None;let n=He(t);return Pn(n)||be(n)||Ke(n)?L.AnimationTarget:L.None}var ut=new WeakSet;function Fn(e){if(e===null)return!1;let t=K(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function mi(e,t,n,r){if(!Wn(e))return L.None;let o=K(t);return o==="href"?r==="static"||n===null?L.None:Fn(e.getAttribute("rel"))?L.StylesheetSource:(ut.add(e),L.None):o==="rel"&&Fn(n)&&ut.has(e)&&e.hasAttribute("href")?L.StylesheetSource:L.None}function Ht(e,t,n,r){let o=e.localName;return o==="meta"?fi(e,t,n,r):o==="link"?mi(e,t,n,r):o==="script"?r==="static"||n===null?L.None:ui.has(K(t))?L.ScriptSource:L.None:li.has(o)&&e.namespaceURI===si?pi(t,n):L.None}function It(e,t,n){e.localName!=="link"||K(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?ut.add(e):ut.delete(e))}var gi="http://www.w3.org/1999/xhtml",bi="http://www.w3.org/2000/svg",hi="http://www.w3.org/1999/xlink",yi="http://www.w3.org/XML/1998/namespace",vi=new Set(["checked","disabled","selected"]);function Si(e){return e.namespaceURI===null||e.namespaceURI===gi}function Kn(e,t,n){j(()=>`${e}: refusing "${t}" in this element's context \u2014 ${["",'the element would become a <meta http-equiv="refresh"> directive the shared refresh policy forbids (a destination outside the URL allowlist, or a directive too malformed to read unambiguously)',"a <meta> whose http-equiv or content is reactive may never carry a refresh directive: a browser schedules the navigation as soon as the directive is valid, and nothing can withdraw it when the state changes back","a runtime value may not choose the program a <script> runs; name the script in static template source, or load it through Head({ script }) as an explicit trust decision","an SVG animation may not target a URL, event-handler or nested-document attribute; its to / values would be written into that attribute without passing the URL policy",'a runtime-chosen href may not become an applied <link rel="stylesheet">: a well-formed URL is not a trusted stylesheet. Name the stylesheet in static template source, or load a runtime-chosen one through Head({ link }) as an explicit trust decision'][n]}. The write was not performed.`)}function Un(e,t,n){e[t]=n}function xi(e,t){if(e.namespaceURI!==bi)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?hi:n.startsWith("xml:")?yi:null}function Q(e,t,n,r={}){let o=Ei(e,t,n,r);return e.localName==="link"&&It(e,t,r.reactive?"reactive":"runtime"),o}function Ei(e,t,n,r){let o=xi(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(be(t))return O(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${t}". Its value would be evaluated as JavaScript. Use on:{ ${t.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Ht(e,t,s,r.reactive?"reactive":"runtime");if(a!==L.None)return Kn(r.label??"setSafeAttribute",t,a),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;if(n==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0;if(Ke(t))return O(`${r.label??"setSafeAttribute"}: refusing to set "${t}". The browser parses this attribute as a nested HTML document, so a generic string value cannot be made safe \u2014 attribute escaping is undone before the parse. Build the frame's content another way.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let c=Si(e),u=c?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let f=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==f&&(o?e.setAttributeNS(o,t,f):e.setAttribute(t,f)),!0}return c&&vi.has(u)&&u in e?Un(e,u,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let l=String(n);if(r.syncValueProperty!==!1&&c&&(u==="value"||u==="checked")&&u in e)return Un(e,u,u==="checked"?!!n:l),!0;let m=l===""?"":Bn(t,l,{element:e});return m===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===m||(o?e.setAttributeNS(o,t,m):e.setAttribute(t,m)),!0)}function Pt(e,t,n){if(Ke(t))return O(`html: refusing static attribute "${t}" \u2014 the browser parses it as a nested document.`),!1;let r=Ht(e,t,n,"static");return r!==L.None?(Kn("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&It(e,t,"static"),!0)}var Ti=4096,Bt=[];function wi(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function ki(e,t,n){let r=Bt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=wi();return o.sig=e,o.sub=t,o.epoch=n,o}function Jn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Bt.length<Ti&&Bt.push(e)}function _i(e,t){let n=e.subsHead??null;t.sigPrev=null,t.sigNext=n,n?n.sigPrev=t:e.subsTail=t,e.subsHead=t,e.__sc=(e.__sc??0)+1}function Gn(e){let t=e.sig;if(!t)return;let n=e.sigPrev,r=e.sigNext;n?n.sigNext=r:t.subsHead=r,r?r.sigPrev=n:t.subsTail=n,t.__sc=(t.__sc??1)-1,t.__activeNode===e&&(t.__activeNode=e.prevActive),t.__sc===0&&(t.subsHead=null,t.subsTail=null)}function Ai(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function Ci(e){let t=e.sub;if(!t)return;let n=e.subPrev,r=e.subNext;n?n.subNext=r:t.depsHead=r,r?r.subPrev=n:t.depsTail=n}var te=null,ue=null,he=0,ye=[],ee=new Set,Ni=[];function Ri(e){try{e()}catch(t){let n=e;k(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Li(e){let t=e.depsHead??null;if(t===null)return!0;for(;t!==null;){let n=t.sig;if(n===null)return!0;if(n._d===!0&&n._validate!==void 0)try{n._validate()}catch{return!0}if(t.depVersion!==n.__v)return!0;t=t.subNext}return!1}var ae=0,le=!1;function zt(){ae===0&&(ue=te,te=null,le=!0),ae++}function Vt(){ae--,ae===0&&(te=ue,ue=null,le=!1)}function Yn(){return le}function Zn(e){zt();try{return e()}finally{Vt()}}var G=null;function jt(){return G}function pt(e,t){let n=G;G=e;try{return t()}finally{G=n}}function Wt(e){let t=G;return t===null?e:(...n)=>pt(t,()=>e(...n))}var Mi=0;function qt(e,t){let n=te,r=0,o=null;le&&(r=ae,o=ue,ae=0,ue=null,le=!1),te=t;let i=t;i._cap===void 0&&(i._cap=Cn());let s=G;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(G=a);let c=++Mi;i._epoch=c,i._structDirty=!1;for(let u=i.depsHead??null;u!==null;u=u.subNext){let l=u.sig;u.prevActive=l.__activeNode??null,l.__activeNode=u}try{e()}finally{te=n,G=s,r!==0&&(ae=r,ue=o,le=!0);let u=i.depsHead??null;for(;u!==null;){let l=u.subNext,m=u.sig;m.__activeNode=u.prevActive,u.prevActive=null,u.epoch!==c&&(Ci(u),Gn(u),Jn(u)),u=l}}}function Xn(e,t){if(!t)return Ut(e);Ie(t);let n=te,r=0,o=null;le&&(r=ae,o=ue,ae=0,ue=null,le=!1),te=t;let i=t;i._scope===void 0&&(i._scope=G);let s=G;G=i._scope;try{e()}finally{te=n,G=s,r!==0&&(ae=r,ue=o,le=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let c=a.sig;c.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>Ie(t))}function Ut(e,t){let n=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{qt(e,r)}finally{o._reentrant=!1}}},r=n;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=t;try{n()}catch(o){throw r._disposed=!0,r._errorNode=void 0,Ie(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,Ie(r)})}function Qn(e){if(!te)return;let t=te,n=e,r=t._epoch??0,o=n.__activeNode??null;if(o!==null&&o.sub===t){o.epoch=r,o.depVersion=n.__v??Number.NaN;return}n._validate!==void 0&&(t._hasComputedDep=!0);let i=ki(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,Ai(t,i),_i(n,i),t._structDirty=!0}function Ie(e){let t=e,n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;Gn(n),Jn(n),n=r}}var lt=1e3,dt=1e6,ft=0,we=new Set;function er(e){let t=lt;return Number.isFinite(e)&&e>0&&(lt=Math.floor(e)),t}function tr(e){let t=dt;return Number.isFinite(e)&&e>0&&(dt=Math.floor(e)),t}function Oi(e){let t=e;return t._runEpoch!==ft?(t._runEpoch=ft,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>lt)}function Di(e){let t=e.__name??"<unnamed>";k(new Error(`subscriber "${t}" fired more than ${lt} 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:t})}function $i(){k(new Error(`Notification drain exceeded ${dt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function nr(){let e=0;for(;e<ye.length;){if(e>=dt){$i();break}let t=ye[e++];if(ee.delete(t),we.size>0&&we.has(t)||t._hasComputedDep===!0&&!Li(t))continue;if(Oi(t)){Di(t),we.add(t);continue}let n=Nn(t._cap??null);try{Ri(t)}finally{n&&Rn()}}}function rr(){if(!(he>0)){he++,ft++;try{nr()}finally{he--,he===0&&(ye.length=0,ee.clear(),we.size>0&&we.clear())}}}function Ft(e){e();let t=e._sig;if(!t)return;let n=Ni,r=n.length;for(n.push(t);n.length>r;){let i=n.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,n.push(a)):s()}else ee.has(s)||(ee.add(s),ye.push(s));i=i.sigNext}}}function or(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Ft(r):ee.has(r)||(ee.add(r),ye.push(r))),n=n.sigNext}}function ir(e){let n=e.subsHead;if(n){if(he>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Ft(o):ee.has(o)||(ee.add(o),ye.push(o))),r=r.sigNext}return}he++,ft++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Ft(o):ee.has(o)||(ee.add(o),ye.push(o))),r=r.sigNext}nr()}finally{he--,he===0&&(ye.length=0,ee.clear(),we.size>0&&we.clear())}}}function sr(e){return e.__sc??0}function ar(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function cr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var ur="4.10.1",lr=Symbol.for("sibujs.reactive.v1");function Ii(){let e=globalThis,t=e[lr];if(t)return!t.__dupWarned&&(t.__dupWarned=!0,O(`Multiple instances of the reactive runtime detected on this page (active: ${t.version}, duplicate: ${ur}). Reactivity is NOT broken and no bundler configuration is required: every copy routes through the first one via a global registry, so signal writes still reach subscribers registered by any copy. This is only a SIZE issue \u2014 the duplicate copy's bytes are downloaded and parsed for nothing. If you want them back, de-duplicate sibujs in your bundler (Vite: resolve.dedupe: ['sibujs']). Mismatched VERSIONS above are worth fixing regardless, since only the first one loaded is used.`)),t;let n={suspendTracking:zt,resumeTracking:Vt,isTrackingSuspended:Yn,untracked:Zn,retrack:qt,track:Xn,reactiveBinding:Ut,recordDependency:Qn,cleanup:Ie,setMaxSubscriberRepeats:er,setMaxDrainIterations:tr,drainNotificationQueue:rr,queueSignalNotification:or,notifySubscribers:ir,getSubscriberCount:sr,getSubscriberDeps:ar,forEachSubscriber:cr,getOwnerScope:jt,runWithOwnerScope:pt,bindOwnerScope:Wt,version:ur};return e[lr]=n,n}var H=Ii(),ke=H.suspendTracking,_e=H.resumeTracking,dr=H.isTrackingSuspended,ne=H.untracked,ve=H.retrack,Y=H.track,P=H.reactiveBinding,Ae=H.recordDependency,Ce=H.cleanup,nl=H.setMaxSubscriberRepeats,fr=H.setMaxDrainIterations,pr=H.drainNotificationQueue,mr=H.queueSignalNotification,Pe=H.notifySubscribers,rl=H.getSubscriberCount,ol=H.getSubscriberDeps,il=H.forEachSubscriber,Be=H.getOwnerScope??jt,mt=H.runWithOwnerScope??pt,z=H.bindOwnerScope??Wt;function Je(e,t,n){if(be(t))return Q(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){k(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}Q(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return P(r,e)}function gr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(c){k(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(c){k(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",reactive:!0})&&(r=s)}let i=P(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Kt=["data-focus-key","id","name"],Pi=new Set(["text","search","url","tel","password",""]);function Bi(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Pi.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 Ge(e){if(e.length===0||typeof document>"u")return null;let t=document.activeElement;if(!t||t===document.body)return null;let n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===t||s.nodeType===1&&s.contains(t)){n=!0;break}}if(!n)return null;let r=null,o=null;for(let i=0;i<Kt.length;i++){let s=t.getAttribute(Kt[i]);if(s){r=Kt[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Bi(t)}}function Fi(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function zi(e,t){let n=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(t)&&(r++,n??(n=s));let a=s.querySelectorAll(t);for(let c=0;c<a.length;c++)r++,n??(n=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function br(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function Fe(e,t,n){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){br(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=zi(t,`[${e.attr}=${Fi(e.value)}]`);if(i&&i.tagName===e.tag){br(i,e);return}o=s>1}j(()=>{let i=e.attr?` (${e.attr}="${e.value}")`:"",s=o?`several elements in the rebuilt subtree share ${e.attr}="${e.value}", so there is no way to tell which one the user was in \u2014 a shared name (a radio group) identifies a GROUP, not a control. Add a unique id or data-focus-key to each`:"no element in the rebuilt subtree carries the same identity. Give it a stable id, name, or data-focus-key that the rebuild reproduces";return`${n}: a reactive rebuild discarded the focused element <${e.tag.toLowerCase()}>${i} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${s}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them.`})}function de(e,t){let n=[];function r(){let o;try{o=t()}catch(l){k(l,{phase:"binding",name:"bindChildNode",node:e});return}let i=Ge(n);if(o==null||typeof o=="boolean"){for(let l=0;l<n.length;l++){let m=n[l];D(m),m.parentNode&&m.parentNode.removeChild(m)}n.length=0,Fe(i,n,"bindChildNode");return}let s=e.parentNode;if(!s){n.length=0;return}let a;if(Array.isArray(o)){a=[];let l=new Set;for(let m=0;m<o.length;m++){let g=o[m];if(g==null||typeof g=="boolean")continue;let f=g instanceof Node?g:document.createTextNode(String(g));if(l.has(f)){O("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}l.add(f),a.push(f)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(n.length>0&&a.length>0){let l=new Set(n);c=new Set;for(let m=0;m<a.length;m++)l.has(a[m])&&c.add(a[m])}for(let l=0;l<n.length;l++){let m=n[l];c?.has(m)||(D(m),m.parentNode&&m.parentNode.removeChild(m))}let u=e;for(let l=0;l<a.length;l++){let m=a[l];u.nextSibling!==m&&s.insertBefore(m,u.nextSibling),u=m}n=a,Fe(i,a,"bindChildNode")}return P(r,e)}var R="http://www.w3.org/2000/svg",Vi=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Jt=new Set,hr=100,yr=!1,vr=new Map;function Sr(e){let t=vr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),vr.set(e,t)),t}function ji(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=P(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",at(String(a),{element:e}));return}let c=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let l in a){if(!Object.hasOwn(a,l))continue;let m=a[l];if(m==null)continue;let g=Sr(l);u.push(g),c.setProperty(g,st(g,String(m),{element:e}))}for(let l=0;l<o.length;l++)u.indexOf(o[l])===-1&&c.removeProperty(o[l]);o=u},e);x(e,s);return}if(typeof t=="string"){e.setAttribute("style",at(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Sr(r);if(typeof o=="function"){let s=o,a=P(()=>{n.style.setProperty(i,st(i,String(s()),{element:e}))},e);x(e,a)}else n.style.setProperty(i,st(i,String(o),{element:e}))}}function Wi(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=P(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);x(e,i);return}let n=t,r=!1,o="";for(let i in n){if(!Object.hasOwn(n,i))continue;let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=P(()=>{let a="";for(let c in n){if(!Object.hasOwn(n,c))continue;let u=n[c];(typeof u=="function"?u():u)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);x(e,s)}else e.setAttribute("class",o)}function Gt(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),x(e,de(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),x(e,de(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),x(e,de(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)))}}}function d(e,t){let n=Vn(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=t?document.createElementNS(t,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Gt(i,o),i):(j(()=>{let f=r.trim().split(/\s+/);if(f.length<2)return"";let p=0;for(let h=0;h<f.length;h++){let y=f[h];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&p++}if(p<2)return"";let b=`${e}|${r}`;return Jt.has(b)?"":Jt.size>=hr?yr?"":(yr=!0,`tagFactory: ${hr} distinct lone-string class warnings have been reported; suppressing further ones for the rest of this session so they cannot flood the console. Fix the reported ones and reload to see any that remain.`):(Jt.add(b),`tagFactory: lone string "${r}" looks like a class list but is being rendered as TEXT. For a class, use ${e}({ class: "${r}" }) \u2014 or ${e}("${r}", children) to set the class AND add children.`)}),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 Gt(i,r),i;let s=r,a=s.class;a!=null&&Wi(i,a);let c=s.id;typeof c=="function"?x(i,Je(i,"id",c)):c!=null&&(typeof c=="string"&&Vi.has(c.toLowerCase())&&O(`tagFactory: element id="${c}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=c);let u=o!==void 0?o:s.nodes;u!=null&&Gt(i,u);let l=s.on;if(l)for(let f in l){if(!Object.hasOwn(l,f))continue;let p=l[f];typeof p=="function"?i.addEventListener(f,p):O(`tagFactory: on.${f} handler is not a function (got ${typeof p}). Event listener was not attached.`)}let m=s.style;m!=null&&ji(i,m);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:{if(!Object.hasOwn(s,f))continue;let p=s[f];if(p==null||be(f))continue;typeof p=="function"?x(i,Je(i,f,p)):Q(i,f,p,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var Rl=d("html"),qi=d("head"),Ui=d("body"),Ki=d("title"),A=d("div"),I=d("span"),Ji=d("section"),Gi=d("article"),Yi=d("header"),Zi=d("footer"),Xi=d("nav"),Qi=d("main"),es=d("aside"),ts=d("address"),Yt=d("p"),ns=d("h1"),rs=d("h2"),Zt=d("h3"),os=d("h4"),is=d("h5"),ss=d("h6"),as=d("blockquote"),cs=d("dd"),us=d("dl"),ls=d("dt"),ds=d("figcaption"),fs=d("figure"),ps=d("hr"),ms=d("li"),gs=d("ol"),bs=d("ul"),Xt=d("pre"),hs=d("a"),ys=d("abbr"),vs=d("b"),Ss=d("bdi"),xs=d("bdo"),Es=d("br"),Ts=d("cite"),Qt=d("code"),ws=d("data"),ks=d("dfn"),_s=d("em"),As=d("i"),Cs=d("kbd"),Ns=d("mark"),Rs=d("q"),Ls=d("rp"),Ms=d("rt"),Os=d("ruby"),Ds=d("s"),$s=d("samp"),Hs=d("small"),Is=d("strong"),Ps=d("sub"),Bs=d("sup"),Fs=d("time"),zs=d("u"),Vs=d("var"),js=d("area"),Ws=d("audio"),qs=d("img"),Us=d("map"),Ks=d("track"),Js=d("video"),Gs=d("embed"),Ys=d("iframe"),Zs=d("object"),Xs=d("param"),Qs=d("picture"),ea=d("portal"),ta=d("source"),na=d("svg",R),ra=d("math"),oa=d("canvas"),ia=d("noscript"),sa=d("script"),aa=d("del"),ca=d("ins"),ua=d("caption"),la=d("col"),da=d("colgroup"),fa=d("table"),pa=d("tbody"),ma=d("td"),ga=d("tfoot"),ba=d("th"),ha=d("thead"),ya=d("tr"),Ye=d("button"),va=d("datalist"),Sa=d("fieldset"),xa=d("form"),Ea=d("input"),Ta=d("label"),wa=d("legend"),ka=d("meter"),_a=d("optgroup"),Aa=d("option"),Ca=d("output"),Na=d("progress"),Ra=d("select"),La=d("textarea"),Ma=d("details"),Oa=d("dialog"),Da=d("menu"),$a=d("summary"),Ha=d("slot"),Ia=d("template"),Pa=d("base"),Ba=d("link"),Fa=d("meta"),Ne=d("style"),za=d("circle",R),Va=d("ellipse",R),ja=d("g",R),Wa=d("line",R),qa=d("path",R),Ua=d("polygon",R),Ka=d("polyline",R),Ja=d("rect",R),Ga=d("text",R),Ya=d("tspan",R),Za=d("defs",R),Xa=d("clipPath",R),Qa=d("mask",R),ec=d("pattern",R),tc=d("linearGradient",R),nc=d("radialGradient",R),rc=d("stop",R),oc=d("use",R),ic=d("symbol",R),sc=d("marker",R),ac=d("center"),cc=d("font"),uc=d("marquee"),lc=e=>d(e);var en="__sibuPendingError";function xr(e,t){let n=()=>e.parentNode?(k(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[en]=t)})}function gt(e){let t=e,n=t[en];if(n instanceof Error)return delete t[en],n}function Er(e){let t=null;return function(){if(t)return t();let r=A({class:"sibu-lazy"}),o=!1;return e().then(z(i=>{if(o)return;t=i.default;let s=t();W(r,s)})).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));W(r,A({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),xr(r,s)}),r.appendChild(I("sibu-lazy-loading","Loading...")),x(r,()=>{o=!0}),r}}function Tr({nodes:e,fallback:t}){let n=A({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null,s=null;x(n,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!n.contains(s)&&D(s)});let a=z(()=>{if(!o)try{let c=e();if(s=c,c.classList.contains("sibu-lazy")){if(!c.querySelector(".sibu-lazy-loading")){W(n,c);return}i=new MutationObserver(()=>{if(o)return;c.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,W(n,c))}),i.observe(c,{childList:!0,subtree:!0})}else W(n,c)}catch(c){let u=c instanceof Error?c:new Error(String(c));xr(n,u)}});return queueMicrotask(a),n}function on(e,t){return()=>Be()===e?t():mt(e,t)}function ht(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";k(n,{phase:r,name:t});return}}function tn(e,t,n,r,o){let i=ht(e,t);if(typeof i!="function")return;let s=on(o,i);r()||!n.isConnected?ht(s,"onUnmount"):kr(s,n)}var ze=new WeakMap,Re=new WeakMap,fe=new Set,pe=new Set,Ve=null,bt=0,dc=256;function nn(e){let t=ze.get(e);if(t){ze.delete(e),fe.delete(e);for(let n of t)try{n()}catch{}}}function rn(e){Re.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Re.get(e);if(n){Re.delete(e),pe.delete(e);for(let r of n)try{r()}catch{}}})}function fc(e){if(fe.size===0||e.nodeType!==1)return;let t=e;if(fe.has(t)&&t.isConnected&&nn(t),t.firstElementChild)for(let n of Array.from(fe))n!==t&&n.isConnected&&t.contains(n)&&nn(n)}function pc(e){if(pe.size===0||e.nodeType!==1)return;let t=e;if(pe.has(t)&&!t.isConnected&&rn(t),t.firstElementChild)for(let n of Array.from(pe))n!==t&&!n.isConnected&&t.contains(n)&&rn(n)}function mc(){if(fe.size>0)for(let e of Array.from(fe))e.isConnected&&nn(e);if(pe.size>0)for(let e of Array.from(pe))e.isConnected||rn(e)}function wr(){Ve||typeof document>"u"||(Ve=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)fc(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)pc(t.removedNodes[n])}bt+=e.length,bt>=dc&&(bt=0,mc()),sn()}),Ve.observe(document.body,{childList:!0,subtree:!0}))}function sn(){Ve&&fe.size===0&&pe.size===0&&(Ve.disconnect(),Ve=null,bt=0)}function gc(e,t){let n=ze.get(e);return n||(n=[],ze.set(e,n)),n.push(t),fe.add(e),wr(),()=>{let r=ze.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(ze.delete(e),fe.delete(e))}sn()}}function bc(e,t){let n=Re.get(e);return n||(n=[],Re.set(e,n)),n.push(t),pe.add(e),wr(),()=>{let r=Re.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Re.delete(e),pe.delete(e))}sn()}}function yt(e,t){if(typeof document>"u")return;let n=Be();if(e=on(n,e),t){let r=!1,o=()=>r;if(x(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||tn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){tn(e,"onMount",t,o,n);return}let i=gc(t,()=>{r||tn(e,"onMount",t,o,n)});x(t,i)})}else queueMicrotask(()=>{ht(e,"onMount")})}function hc(e,t){typeof document>"u"||kr(on(Be(),e),t)}function kr(e,t){let n=!1,r=()=>{n||(n=!0,ht(e,"onUnmount"))};x(t,r);let o=()=>{if(n)return;let i=bc(t,r);x(t,i)};t.isConnected?o():yt(()=>{o()},t)}function yc(e,t){x(t,e)}function Z(e,t,n){try{e.emit(t,n)}catch{}}var an=Symbol.for("sibujs.ssr.v1");function vc(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let t=null,n=process.getBuiltinModule;typeof n=="function"?t=n("node:async_hooks"):typeof _t=="function"&&(t=_t("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var Se=globalThis[an]??(globalThis[an]=vc()),Le=Se.als,V=Se.fallbackStore;Se.fallbackDepth??(Se.fallbackDepth=0);var _r=!1;function Sc(){if(_r||Le||!(typeof process<"u"&&!!process.versions?.node))return;_r=!0;let t=process.versions.node;O(`SSR request isolation is UNAVAILABLE on this runtime (Node ${t}). AsyncLocalStorage could not be loaded, so concurrent requests share one SSR store: request state and the query cache can bleed between them. Node >= 22.3 is required for isolated SSR under ESM; the CommonJS build works on older versions. A fully synchronous render is unaffected.`)}function Me(){if(Le){let e=Le.getStore();if(e)return e}return V}function Ar(){return Le?Le.getStore()??null:Se.fallbackDepth>0?V:null}function re(){return Me().ssr}function Cr(e){if(!re())return null;let t=Me(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function Nr(){Me().ssr=!0}function Rr(){Me().ssr=!1}function Lr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Le)return Le.run(t,e);Sc();let n=V.ssr,r=V.suspenseIdCounter,o=V.idCounter,i=V.locale;V.ssr=!0,V.suspenseIdCounter=0,V.idCounter=0,V.locale=void 0,Se.fallbackDepth++;try{return e()}finally{Se.fallbackDepth--,V.ssr=n,V.suspenseIdCounter=r,V.idCounter=o,V.locale=i}}function Mr(e){let t=Me(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Hr=globalThis;function xc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,ne(()=>t(o,void 0));else{let i=n;n=o,ne(()=>t(o,i))}}}var Or=100;function vt(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===Be()?Dr(t):mt(n,()=>Dr(t))}function Dr(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){k(n,{phase:"cleanup"})}}function $r(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&vt(e),ve(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Or);e.rerunPending&&(e.rerunPending=!1,k(new Error(`effect re-requested itself ${Or}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Ec(e){if(e.disposed)return;e.disposed=!0;let t=Hr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&vt(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Ce(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function X(e,t){if(M(typeof e=="function","effect: argument must be a function."),re())return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=s=>{n.userCleanups.push(s)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(s){r(s)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&vt(n),ve(n.bodyFn,o),n.rerunPending&&$r(n)}finally{n.running=!1,n.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,n.subscriber=o,n.running=!0;try{ve(n.bodyFn,n.subscriber),n.rerunPending&&$r(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&vt(n),Ce(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=Hr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&Z(i,"effect:create",{effectFn:e}),()=>Ec(n)}var Ze=0,cn=new Set;function Tc(e){Ze++;try{return e()}finally{Ze--,Ze===0&&_c()}}function wc(e){return Ze===0?!1:(cn.add(e),!0)}function kc(){return Ze>0}function _c(){try{for(let e of cn)mr(e)}finally{cn.clear()}pr()}var Ir=Symbol.for("sibujs.reactive.batch.v1");function Ac(){let e=globalThis,t=e[Ir];if(t)return t;let n={batch:Tc,enqueueBatchedSignal:wc,isBatching:kc};return e[Ir]=n,n}var un=Ac(),q=un.batch,Oe=un.enqueueBatchedSignal,Cc=un.isBatching;var ln=globalThis;function C(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=t?.name,o=t?.equals;r&&(n.__name=r);function i(){return Ae(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let c=n.value,u=typeof a=="function"?a(c):a;if(!o(c,u)){if(n.value=u,n.__v++,!0){let l=ln.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&Z(l,"signal:update",{signal:n,name:r,oldValue:c,newValue:u})}Oe(n)||Pe(n)}}:s=a=>{let c=n.value,u=typeof a=="function"?a(c):a;if(Object.is(u,c))return;n.value=u,n.__v++;let l=ln.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&Z(l,"signal:update",{signal:n,name:r,oldValue:c,newValue:u}),Oe(n)||Pe(n)},!0){let a=ln.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&Z(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function Nc(e){let[t,n]=C(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Rc=`
8
8
  .sibu-error-display {
9
9
  border: 1px solid var(--sibu-err-border, #e5484d);
10
10
  border-radius: 10px;
@@ -185,11 +185,11 @@
185
185
  border: 1px solid #3a3a4e;
186
186
  }
187
187
  .sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
188
- `,Nr=!1;function xc(){if(Nr||typeof document>"u")return;let e=Ae({nodes:Sc});document.head.appendChild(e),Nr=!0}function Ec(e){let t=[],n=e.split(`
189
- `);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let a=o.match(/^(.+?)@(.+)$/);a&&t.push({fn:a[1]||"(anonymous)",loc:a[2]||""})}return t}function Rr(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=Ec(r),i=e.cause,a=i!=null?Rr(i):null;return{code:t,message:n,stack:r,frames:o,cause:a}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function Tc(e,t,n){let r=[];r.push(n),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(`
190
- `).map(a=>` ${a}`).join(`
191
- `);r.push(i)}o=o.cause}if(t&&Object.keys(t).length>0){r.push(""),r.push("Metadata:");for(let[i,a]of Object.entries(t))r.push(` ${i}: ${String(a)}`)}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(`
192
- `)}function Lr(e){let t=e.map((n,r)=>A({class:"sibu-err-frame",nodes:[H({class:"sibu-err-line",nodes:String(r+1)}),H({class:"sibu-err-fn",nodes:n.fn}),H({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return Wt({class:"sibu-err-stack",nodes:t})}function Mr(e){return e?[A({class:"sibu-err-cause-label",nodes:"Caused by"}),A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[H({nodes:`[${e.code}] ${e.message}`}),H({nodes:""})]}),e.frames.length>0?Lr(e.frames):A({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Mr(e.cause)]:[]}function wc(e){let t=[];for(let[r,o]of Object.entries(e)){t.push(document.createElement("dt")),t[t.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),t.push(i)}let n=document.createElement("dl");n.className="sibu-err-meta";for(let r of t)n.appendChild(r);return n}function nn(e){xc();let t=e.severity??"error",n=Rr(e.error),r=e.alwaysShowDetails??re(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[a,s]=C("Copy"),c=Ke({class:"sibu-err-copy-btn",nodes:()=>a(),on:{click:()=>{let f=Tc(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(f).then(()=>{s("Copied!"),setTimeout(()=>s("Copy"),1500)},()=>{s("Copy failed"),setTimeout(()=>s("Copy"),1500)})}}}),l=A({class:"sibu-err-header",nodes:[Ut({class:"sibu-err-icon",nodes:n.code}),qt({class:"sibu-err-title",nodes:o}),c,H({class:"sibu-err-timestamp",nodes:i})]}),d=[jt({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&d.push(A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[H({nodes:"Stack Trace"})]}),Lr(n.frames)]})),r&&d.push(...Mr(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[H({nodes:"Metadata"})]}),wc(e.metadata)]}));let m=[];e.onRetry&&m.push(Ke({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&m.push(Ke({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),m.length>0&&d.push(A({class:"sibu-err-actions",nodes:m}));let g=A({class:"sibu-err-body",nodes:d});return A({class:"sibu-error-display","data-severity":t,nodes:[l,g]})}var kc=`
188
+ `,Pr=!1;function Lc(){if(Pr||typeof document>"u")return;let e=Ne({nodes:Rc});document.head.appendChild(e),Pr=!0}function Mc(e){let t=[],n=e.split(`
189
+ `);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function Br(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=Mc(r),i=e.cause,s=i!=null?Br(i):null;return{code:t,message:n,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function Oc(e,t,n){let r=[];r.push(n),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(`
190
+ `).map(s=>` ${s}`).join(`
191
+ `);r.push(i)}o=o.cause}if(t&&Object.keys(t).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(t))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(`
192
+ `)}function Fr(e){let t=e.map((n,r)=>A({class:"sibu-err-frame",nodes:[I({class:"sibu-err-line",nodes:String(r+1)}),I({class:"sibu-err-fn",nodes:n.fn}),I({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return Xt({class:"sibu-err-stack",nodes:t})}function zr(e){return e?[A({class:"sibu-err-cause-label",nodes:"Caused by"}),A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[I({nodes:`[${e.code}] ${e.message}`}),I({nodes:""})]}),e.frames.length>0?Fr(e.frames):A({class:"sibu-err-stack",nodes:"(no stack)"})]}),...zr(e.cause)]:[]}function Dc(e){let t=[];for(let[r,o]of Object.entries(e)){t.push(document.createElement("dt")),t[t.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),t.push(i)}let n=document.createElement("dl");n.className="sibu-err-meta";for(let r of t)n.appendChild(r);return n}function dn(e){Lc();let t=e.severity??"error",n=Br(e.error),r=e.alwaysShowDetails??ie(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),c=Ye({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let f=Oc(n,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)})}}}),u=A({class:"sibu-err-header",nodes:[Qt({class:"sibu-err-icon",nodes:n.code}),Zt({class:"sibu-err-title",nodes:o}),c,I({class:"sibu-err-timestamp",nodes:i})]}),l=[Yt({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&l.push(A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[I({nodes:"Stack Trace"})]}),Fr(n.frames)]})),r&&l.push(...zr(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&l.push(A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[I({nodes:"Metadata"})]}),Dc(e.metadata)]}));let m=[];e.onRetry&&m.push(Ye({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&m.push(Ye({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),m.length>0&&l.push(A({class:"sibu-err-actions",nodes:m}));let g=A({class:"sibu-err-body",nodes:l});return A({class:"sibu-error-display","data-severity":t,nodes:[u,g]})}var $c=`
193
193
  .sibu-error-boundary {
194
194
  position: relative;
195
195
  }
@@ -343,7 +343,7 @@
343
343
  .sibu-error-fallback .sibu-error-btn-reload:hover {
344
344
  background: #3a3a4e;
345
345
  }
346
- `,_c=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Dr=!1;function Ac(){if(!Dr&&typeof document<"u"){let e=Ae({nodes:kc});document.head.appendChild(e),Dr=!0}}function Cc(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:a}=r;Ac();let[s,c]=C(null),l=()=>{m(),c(null)},d=null,m=()=>{if(!d)return;let v=d;d=null,v()},g=v=>{let E=new Array(v.length);for(let w=0;w<v.length;w++)try{E[w]=v[w]()}catch($){k($,{phase:"effect",name:"ErrorBoundary.resetKeys"}),E[w]=_c}return E},f=()=>{let v=a;if(!v||v.length===0)return;m();let E=null;d=Y(()=>{let w=g(v);if(E===null){E=w;return}let $=w.length!==E.length;if(!$){for(let B=0;B<w.length;B++)if(!Object.is(w[B],E[B])){$=!0;break}}E=w,$&&l()})},p=v=>{let E=Tt(v);if(c(E),f(),i)try{i(E)}catch(w){k(w,{phase:"render",name:"ErrorBoundary onError callback"})}return E},h=(v,E)=>nn({error:v,severity:"error",onRetry:E}),b=v=>{let E=o||h;try{return E(v,l)}catch(w){return queueMicrotask(()=>{k(w,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=A({class:"sibu-error-boundary",nodes:()=>{let v=s();if(v)return b(v);try{let E=n();if(E&&typeof E.then=="function"){let w=A({class:"sibu-error-async"});w.appendChild(H({class:"sibu-lazy-loading",nodes:"Loading..."}));let $=!1;return x(w,()=>{$=!0}),E.then(B=>{if($){O(B);return}j(w,B)}).catch(B=>{if($)return;let De=p(B);j(w,b(De))}),w}return E}catch(E){let w=p(E);return b(w)}}}),_=v=>{if(s())return;let w=v.detail?.error;w&&(v.preventDefault(),v.stopPropagation(),p(w))};return y.addEventListener("sibu:error-propagate",_),pt(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),E=[],w=v.currentNode;for(;w;){let $=ut(w);$&&E.push($),w=v.nextNode()}if(E.length===1)p(E[0]);else if(E.length>1){let $=globalThis.AggregateError;p($?new $(E,`${E.length} pre-mount errors caught by ErrorBoundary`):new Error(E.map(B=>B.message).join("; ")))}},y),x(y,()=>{m(),y.removeEventListener("sibu:error-propagate",_)}),y}var Nc=`
346
+ `,Hc=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Vr=!1;function Ic(){if(!Vr&&typeof document<"u"){let e=Ne({nodes:$c});document.head.appendChild(e),Vr=!0}}function Pc(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;Ic();let[a,c]=C(null),u=()=>{m(),c(null)},l=null,m=()=>{if(!l)return;let v=l;l=null,v()},g=v=>{let E=new Array(v.length);for(let w=0;w<v.length;w++)try{E[w]=v[w]()}catch($){k($,{phase:"effect",name:"ErrorBoundary.resetKeys"}),E[w]=Hc}return E},f=()=>{let v=s;if(!v||v.length===0)return;m();let E=null;l=X(()=>{let w=g(v);if(E===null){E=w;return}let $=w.length!==E.length;if(!$){for(let B=0;B<w.length;B++)if(!Object.is(w[B],E[B])){$=!0;break}}E=w,$&&u()})},p=v=>{let E=Ct(v);if(c(E),f(),i)try{i(E)}catch(w){k(w,{phase:"render",name:"ErrorBoundary onError callback"})}return E},b=(v,E)=>dn({error:v,severity:"error",onRetry:E}),h=v=>{let E=o||b;try{return E(v,u)}catch(w){return queueMicrotask(()=>{k(w,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=A({class:"sibu-error-boundary",nodes:()=>{let v=a();if(v)return h(v);try{let E=n();if(E&&typeof E.then=="function"){let w=A({class:"sibu-error-async"});w.appendChild(I({class:"sibu-lazy-loading",nodes:"Loading..."}));let $=!1;return x(w,()=>{$=!0}),E.then(B=>{if($){D(B);return}W(w,B)}).catch(z(B=>{if($)return;let $e=p(B);W(w,h($e))})),w}return E}catch(E){let w=p(E);return h(w)}}}),_=v=>{if(a())return;let w=v.detail?.error;w&&(v.preventDefault(),v.stopPropagation(),p(w))};return y.addEventListener("sibu:error-propagate",_),yt(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),E=[],w=v.currentNode;for(;w;){let $=gt(w);$&&E.push($),w=v.nextNode()}if(E.length===1)p(E[0]);else if(E.length>1){let $=globalThis.AggregateError;p($?new $(E,`${E.length} pre-mount errors caught by ErrorBoundary`):new Error(E.map(B=>B.message).join("; ")))}},y),x(y,()=>{m(),y.removeEventListener("sibu:error-propagate",_)}),y}var Bc=`
347
347
  @keyframes sibu-spin {
348
348
  to { transform: rotate(360deg); }
349
349
  }
@@ -396,5 +396,5 @@
396
396
  .sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
397
397
  .sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
398
398
  .sibu-loading-lg .sibu-loading-dots { gap: 6px; }
399
- `,Or=!1;function Rc(){!Or&&typeof document<"u"&&(document.head.appendChild(Ae({nodes:Nc})),Or=!0)}function Lc(e={}){Rc();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[A({class:"sibu-loading-dots"},[H({class:"sibu-loading-dot"}),H({class:"sibu-loading-dot"}),H({class:"sibu-loading-dot"})]),t?H({class:"sibu-loading-text"},t):null]):A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[A({class:"sibu-loading-spinner"}),t?H({class:"sibu-loading-text"},t):null])}var rn=Symbol.for("sibujs.actions.v1"),Hr=globalThis[rn]??(globalThis[rn]=new Map);function Fe(e,t){Hr.set(e,t)}function Ir(e){return Hr.get(e)}function Mc(e,t,n){let r=typeof t=="string"?Ir(t):t;if(!r)throw new Error(`[SibuJS] No action registered under the name "${t}". Register it with registerAction() before applying it by name.`);let o=r(e,n);typeof o=="function"&&x(e,o)}var Pr=(e,t)=>{let n=e.ownerDocument,r=o=>{let i=o.target;typeof i?.nodeType=="number"&&e.contains(i)||t()};return n.addEventListener("pointerdown",r,!0),()=>n.removeEventListener("pointerdown",r,!0)},$r=["pointerup","pointerleave","pointercancel"],Br=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},a=c=>{let l=c.pointerId;r!==null&&l!==o||(i(),o=l,r=setTimeout(()=>{r=null,t.callback()},n))},s=c=>{r!==null&&c.pointerId===o&&i()};e.addEventListener("pointerdown",a);for(let c of $r)e.addEventListener(c,s);return()=>{i(),e.removeEventListener("pointerdown",a);for(let c of $r)e.removeEventListener(c,s)}},Fr=(e,t)=>{let n=o=>k(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},zr=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},Vr=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],a=o[o.length-1],s=e.ownerDocument.activeElement;r.shiftKey&&s===i?(r.preventDefault(),a.focus()):!r.shiftKey&&s===a&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};Fe("clickOutside",Pr);Fe("longPress",Br);Fe("copyOnClick",Fr);Fe("autoResize",zr);Fe("trapFocus",Vr);function gt(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(n){return Promise.reject(n)}return typeof t!="function"?null:new Promise((n,r)=>{queueMicrotask(()=>{try{Reflect.apply(t,e,[n,r])}catch(o){r(o)}})})}var Me=null;function Dc(e,t){try{let n=e(),r=gt(n);return r&&r.then(void 0,o=>{t?t(o,"async"):Me?Me(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):Me?Me(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Oc(e,t){try{return await e()}catch(n){return t?t(n,"async"):Me?Me(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function $c(e){Me=e}function Hc(e){let[t,n]=C(e),r=i=>{!!0||!te()||D(`context.${i}() called during SSR. SibuJS context() is application-global \u2014 it is NOT isolated per request, so a concurrent request can observe this value. Do not use context() for request-specific SSR data; pass it explicitly or use request-scoped storage instead.`)};return{provide(i){r("provide");let a=t();return n(i),()=>n(a)},use(){return t},get(){return t()},set(i){r("set"),n(i)},withContext(i,a){r("withContext");let s=t();n(i);try{let c=a();return c!==null&&typeof c?.then=="function"&&D("context.withContext() received an async callback. Scoping is synchronous only \u2014 the previous value is restored as soon as the callback returns its promise, so anything after an `await` runs outside the scope."),c}finally{n(s)}}}}var on=Symbol.for("sibujs.createId.v1"),sn=globalThis[on]??(globalThis[on]={n:0});function jr(e="sibu"){let t=vr();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(sn.n++,`${e}-${sn.n}`)}function qr(){sn.n=0}function Ic(e,t){let n=typeof t=="function"?t():t;return x(n,P(()=>{n.style.display=e()?"":"none"},n)),n}function Wr(e,t,n,r,o){let i=typeof n=="function"?n():n;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let a=i instanceof Node?i:document.createTextNode(String(i)),s=a===n,c=r.has(a),l=!s&&!c;return r.add(a),c&&V(()=>`${o}: ${s?"a branch was given as an element rather than a function":"a branch factory returned a node it had already returned"}, so the SAME node is being re-attached \u2014 any state it accumulated while detached (input value, scroll position, classes set imperatively) comes back with it. Its reactive bindings are left intact rather than disposed, because the node is not this directive's to tear down. Return a FRESH node per call (\`() => div(\u2026)\`) for rebuild semantics, or keep this form deliberately when the reuse is what you want.`),e.insertBefore(a,t.nextSibling),{node:a,owned:l}}function ht(e,t){t&&O(e),e.parentNode?.removeChild(e)}function Pc(e,t,n){let r=document.createComment("when"),o=null,i,a=!1,s=!1,c=new WeakSet,l=!1,d=()=>{if(s)return;let g=e(),f=r.parentNode;if(!f||a&&Object.is(g,i))return;i=g;let p=o?Ue([o]):null;o?.parentNode&&(ht(o,l),o=null);let h=g?t:n!==void 0?n:null,b=ee(()=>Wr(f,r,h,c,"when"));o=b.node,l=b.owned,Ie(p,o?[o]:[],"when"),a=!0},m=P(d,r);return x(r,()=>{s=!0,m(),o&&ht(o,l),o=null}),a||queueMicrotask(()=>{!s&&!a&&r.parentNode&&d()}),r}function Bc(e,t,n){let r=document.createComment("match"),o=null,i,a=!1,s=!1,c=new WeakSet,l=!1,d=()=>{if(s)return;let g=String(e()),f=r.parentNode;if(!f||a&&g===i)return;i=g;let p=o?Ue([o]):null;o?.parentNode&&(ht(o,l),o=null);let h=Object.hasOwn(t,g)?t[g]:n,b=ee(()=>Wr(f,r,h??null,c,"match"));o=b.node,l=b.owned,Ie(p,o?[o]:[],"match"),a=!0},m=P(d,r);return x(r,()=>{s=!0,m(),o&&ht(o,l),o=null}),a||queueMicrotask(()=>{!s&&!a&&r.parentNode&&d()}),r}function Ge(e,t){let n=globalThis;return n[e]??(n[e]=t())}var bt=Ge(Symbol.for("sibujs.components.registry.v1"),()=>new Map),Ur=Ge(Symbol.for("sibujs.components.registryVersion.v1"),()=>C(0));function Kr(){let[e,t]=Ur;t(ee(e)+1)}function Fc(e,t){bt.set(e,t),Kr()}function zc(e){bt.delete(e)&&Kr()}function Vc(e){let t=bt.get(e);return t?t():A(`[Component "${e}" not found]`)}function jc(e){let t=A({class:"sibu-dynamic"}),r={};function o(){let a=e(),s;typeof a=="function"?s=a:(Ur[0](),s=bt.get(a));let c=s??`missing:${a}`;if(c===r)return;let l=ee(()=>s?s():A(`[Component "${a}" not found]`));r=c,j(t,l)}let i=J(o);return x(t,i),t}function Jr(e){return typeof e=="function"?Jr(e()):e instanceof Node?e:document.createTextNode(String(e))}function qc(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let s=0;s<t;s++){let c=e[s],l=0,d=n.length;for(;l<d;){let m=l+d>>1;e[n[m]]<c?l=m+1:d=m}n[l]=s,r[s]=l>0?n[l-1]:-1}let o=n.length,i=new Array(o),a=n[o-1];for(let s=o-1;s>=0;s--)i[s]=a,a=r[a];return i}function Wc(e,t,n){M(typeof e=="function","each: first argument must be a function that returns an array."),M(typeof t=="function","each: second argument must be a render function."),M(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],a=[],s=i,c=0,l=new Map,d=new Map,m=[],g=[],f=[],p=0,h=[],b=[],y=new Uint8Array(0),_=new Map,v=[],E=[],w=new Map,$=!1,B=!1,De=!1,fo=n.key,fn=()=>{if(De)return;let ne=e(),N=ne.length,ve=r.parentNode;if(!ve)return;B||(ve.insertBefore(o,r.nextSibling),B=!0),b.length<N&&(b=new Array(N));for(let S=0;S<N;S++)b[S]=fo(ne[S]);let fe=b;h.length<N&&(h=new Array(N)),d.clear(),w.clear();for(let S=0;S<N;S++)w.has(fe[S])&&D(`each: duplicate key "${String(fe[S])}" at index ${S} (first seen at ${w.get(fe[S])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),w.set(fe[S],S);p=0;for(let S=0;S<N;S++){let F=fe[S],mn=l.get(F),Ve;if(mn!==void 0)Ve=mn,m[p]=Ve,g[p]=ne[S],f[p]=S,p++;else{let[gn,ho]=C(ne[S]),[hn,bo]=C(S),St;try{Te();try{St=Jr(t(gn,hn))}finally{we()}}catch(yo){let vo=fe[S];St=document.createComment(`each:error:${S}`),queueMicrotask(()=>{k(yo,{phase:"render",name:`each row (key="${String(vo)}")`,node:r.parentNode?r:void 0})})}Ve={node:St,item:gn,setItem:ho,index:hn,setIndex:bo}}d.set(F,Ve),h[S]=Ve.node}for(let[S,F]of l)d.has(S)||(O(F.node),F.node.parentNode&&ve.removeChild(F.node));if(N===0){c=0;let S=l;l=d,d=S,$=!0,p=0;return}_.clear();for(let S=0;S<c;S++)_.set(s[S],S);v.length<N&&(v=new Array(N),E=new Array(N));let Ze=0;for(let S=0;S<N;S++){let F=_.get(fe[S]);F!==void 0&&(v[Ze]=S,E[Ze]=F,Ze++)}let pn=qc(E,Ze);y.length<N?y=new Uint8Array(N):y.fill(0,0,N);for(let S=0;S<pn.length;S++)y[v[pn[S]]]=1;let Xe=o;for(let S=N-1;S>=0;S--){let F=h[S];y[S]||F.nextSibling!==Xe&&ve.insertBefore(F,Xe),Xe=F}let Qe=s===i?a:i;Qe.length<N&&(Qe.length=N);for(let S=0;S<N;S++)Qe[S]=fe[S];s=Qe,c=N;let go=l;l=d,d=go,$=!0,po()};function po(){if(p===0)return;let ne=p;p=0,q(()=>{for(let N=0;N<ne;N++){let ve=m[N];ve.setItem(g[N]),ve.setIndex(f[N]),m[N]=void 0,g[N]=void 0}})}let mo=J(fn);return x(r,()=>{if(!De){De=!0,mo();for(let ne of l.values())O(ne.node),ne.node.parentNode?.removeChild(ne.node);o.parentNode&&o.parentNode.removeChild(o),B=!1,l.clear(),d.clear(),w.clear(),_.clear(),c=0,m.length=0,g.length=0,f.length=0,p=0}}),$||queueMicrotask(()=>{!$&&!De&&r.parentNode&&fn()}),r}function Uc(e){let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||Gr(t,r);else Gr(t,n);return t}function Gr(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),x(n,le(n,t));return}e.appendChild(document.createTextNode(String(t)))}var Kc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Yr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Zr=new WeakMap;function Jc(e){let t=e.length-1,n=e[0];for(let f=0;f<t;f++)n+=`\0${f}\0${e[f+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
400
- `||n[r]==="\r");)r++}function a(){if(n.charCodeAt(r)!==0)return-1;let f=r;r++;let p=0;for(;r<o&&n.charCodeAt(r)!==0;)p=p*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,p<0||p>=t?(r=f,-1):p}function s(){let f=r;for(;r<o;){let p=n.charCodeAt(r);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45)r++;else break}return n.slice(f,r)}function c(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let f=a();if(f>=0)return{kind:"expr",idx:f};let p=n[r];if(p==='"'||p==="'"){r++;let h=[],b=[],y="";for(;r<o&&n[r]!==p;){let _=a();_>=0?(h.push(y),y="",b.push(_)):y+=n[r++]}return r<o&&r++,h.push(y),b.length===0?{kind:"static",value:h[0]}:{kind:"mixed",statics:h,exprs:b}}{let h=[],b=[],y="";for(;r<o;){let _=n.charCodeAt(r);if(_===32||_===9||_===10||_===13||_===62)break;let v=a();v>=0?(h.push(y),y="",b.push(v)):y+=n[r++]}return h.push(y),b.length===0?{kind:"static",value:h[0]}:{kind:"mixed",statics:h,exprs:b}}}function l(){let f=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let p=r;for(;r<o;){let y=n.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 h=n.slice(p,r);if(!h)break;let b=c();h.startsWith("on:")?b.kind==="expr"&&f.push({t:3,name:h.slice(3),idx:b.idx}):b.kind==="bool"?f.push({t:4,name:h}):b.kind==="static"?f.push({t:0,name:h,value:b.value}):b.kind==="expr"?f.push({t:1,name:h,idx:b.idx}):b.kind==="mixed"&&f.push({t:2,name:h,statics:b.statics,exprs:b.exprs})}return f}function d(f){return f.replace(/\s+/g," ")}function m(f){let p="";for(;r<o&&n[r]!=="<";){let b=a();if(b>=0){let y=d(p);y&&f.push({t:1,value:y}),p="",f.push({t:2,idx:b})}else p+=n[r++]}let h=d(p);h&&f.push({t:1,value:h})}function g(){let f=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let p=n[r+1];if(p==="!"){if(n.startsWith("<!--",r)){let v=n.indexOf("-->",r+4);r=v===-1?o:v+3}else if(n.startsWith("<![CDATA[",r)){let v=n.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=n.indexOf(">",r);r=v===-1?o:v+1}continue}if(p==="?"){let v=n.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(p>="a"&&p<="z")&&!(p>="A"&&p<="Z")){f.push({t:1,value:"<"}),r++;continue}r++;let h=s(),b=l();i();let y=Kc.has(h),_=n[r]==="/";if(_&&r++,r<o&&r++,y||_)f.push({t:0,el:{tag:h,svg:Yr.has(h),attrs:b,children:[]}});else{let v=g();if($n(h)){for(let E=0;E<v.length;E++)if(v[E].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${h}> (raw-text context). Build the content separately and append it as a Node.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,s(),i(),r<o&&n[r]===">"&&r++),f.push({t:0,el:{tag:h,svg:Yr.has(h),attrs:b,children:v}})}}else m(f);return f}return g()}function an(e,t){let n=e.svg?document.createElementNS(R,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:Dt(n,o.name,o.value);break;case 1:{let i=o.name,a=t[o.idx];typeof a=="function"?x(n,We(n,i,a)):Z(n,i,a,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let a=0;a<o.exprs.length;a++){let s=t[o.exprs[a]];i+=(s==null?"":String(s))+o.statics[a+1]}Z(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):D(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:Dt(n,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(an(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let a=document.createComment("");n.appendChild(a),x(n,le(a,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let a=0;a<i.length;a++){let s=i[a];s instanceof Node?n.appendChild(s):s!=null&&typeof s!="boolean"&&n.appendChild(document.createTextNode(String(s)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Xr(e,...t){let n=Zr.get(e);return n||(n=Jc(e),Zr.set(e,n)),eo(n,t)}function Qr(e,t){return eo(e,t)}function eo(e,t){if(e.length===1&&e[0].t===0)return an(e[0].el,t);let n=document.createElement("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(an(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(i instanceof Node)n.appendChild(i);else if(typeof i=="function"){let a=document.createComment("bind:htm");n.appendChild(a),x(n,le(a,i))}else if(Array.isArray(i))for(let a=0;a<i.length;a++){let s=i[a];s instanceof Node?n.appendChild(s):s!=null&&typeof s!="boolean"&&n.appendChild(document.createTextNode(String(s)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function Gc(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],a=n?.max??10;a===0&&re()&&D("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let s,c=null,l=!1,d=!1,m=()=>{if(d)return;let f=e(),p=r.parentNode;if(!p||l&&f===s)return;c?.parentNode&&p.removeChild(c),s=f;let h=o.get(f);if(h){let b=i.indexOf(f);b!==-1&&(i.splice(b,1),i.push(f))}else{let b=t[f];if(!b){c=null,l=!0;return}if(h=b(),h.nodeType===11){let y=document.createElement("div");y.style.display="contents",y.appendChild(h),h=y}if(o.set(f,h),i.push(f),a>0&&i.length>a){let y=i.shift(),_=o.get(y);_&&(O(_),_.parentNode&&_.parentNode.removeChild(_),o.delete(y))}}p.insertBefore(h,r.nextSibling),c=h,l=!0},g=J(m);return l||queueMicrotask(()=>{!l&&r.parentNode&&m()}),x(r,()=>{d=!0,g();for(let f of o.values())O(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function Yc(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");M(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=d=>{if(d instanceof DocumentFragment){let m=document.createComment(""),g=document.createComment("");d.insertBefore(m,d.firstChild),d.appendChild(g),o={start:m,end:g}}t.appendChild(d)},a;typeof e=="function"?a=Tn(()=>{let d=e();return i(d),d}):(a=e,i(a));let s=n()-r,c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&G(c,"app:init",{rootElement:a,container:t,duration:s});let l=o;return{node:a,unmount(){if(c&&G(c,"app:unmount",{rootElement:a}),l){Zc(l.start,l.end);return}O(a),a.parentNode?.removeChild(a)}}}function Zc(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=se;for(let s=e.nextSibling;s&&s!==t;s=s.nextSibling)r++;let o=e,i=null,a=!0;for(;;){e.parentNode!==n||t.parentNode!==n?a=!1:(e.previousSibling!==o||t.nextSibling!==i)&&(o=e.previousSibling,i=t.nextSibling,a=!!(e.compareDocumentPosition(t)&4));let s=e.nextSibling;if(!a||s===t)break;if(r--<=0){pe("mount",se,1);return}O(s),s.parentNode===n&&n.removeChild(s)}a||k(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function Xc(e,t){let n=document.createComment("portal"),r=t||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{k(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}}),x(n,()=>{i=!0,o&&(O(o),o.remove(),o=null)}),n}function Qc(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function to(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function el(e=[]){let[t,n]=C([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let a=[...i];return o=a.pop(),a}),o},shift(){let o;return n(i=>{let a=[...i];return o=a.shift(),a}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let a=[];return n(s=>{let c=[...s];return a=to(c,o,i),a.length===0&&i.length<=1?s:c}),a},remove(o){n(i=>i.filter((a,s)=>s!==o))},removeWhere(o){n(i=>{let a=i.findIndex(o);return a===-1?i:i.filter((s,c)=>c!==a)})},set(o){n([...o])},update(o,i){n(a=>a.map((s,c)=>c===o?i:s))},updateWhere(o,i){n(a=>a.map(s=>o(s)?i(s):s))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function tl(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Le(r)||He(r)}function i(){if(ke(r),n===null){let s=t.slice();n=Object.freeze(s)}return n}return[i,{push(...s){s.length!==0&&(t.push(...s),o())},pop(){if(t.length===0)return;let s=t.pop();return o(),s},shift(){if(t.length===0)return;let s=t.shift();return o(),s},unshift(...s){s.length!==0&&(t.unshift(...s),o())},splice(s,...c){let l=to(t,s,c);return(l.length>0||c.length>1)&&o(),l},remove(s){s<0||s>=t.length||(t.splice(s,1),o())},removeWhere(s){let c=t.findIndex(s);c!==-1&&(t.splice(c,1),o())},set(s){t=[...s],o()},update(s,c){s<0||s>=t.length||Object.is(t[s],c)||(t[s]=c,o())},updateWhere(s,c){let l=!1;for(let d=0;d<t.length;d++)if(s(t[d])){let m=c(t[d]);Object.is(t[d],m)||(t[d]=m,l=!0)}l&&o()},sort(s){t.length<=1||(t.sort(s),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(s){let c=t.filter(s);c.length!==t.length&&(t=c,o())},map(s){let c=!1;for(let l=0;l<t.length;l++){let d=s(t[l],l);Object.is(t[l],d)||(t[l]=d,c=!0)}c&&o()},clear(){t.length!==0&&(t=[],o())}}]}function nl(e,t){let[n,r]=C(t),[o,i]=C(!1),[a,s]=C(null),[c,l]=C(0),d=0,m=!1,g=null,f=()=>{if(g===null)return;let h=g;g=null;try{h.abort()}catch{}},p=Y(()=>{if(c(),m)return;f();let h=++d,b=typeof AbortController<"u"?new AbortController:null;g=b,q(()=>{i(!0),s(null)});let y=()=>m||h!==d,_;try{_=e({signal:b?b.signal:void 0})}catch(v){if(y())return;q(()=>{s(v),i(!1)});return}_.then(v=>{y()||(g=null,q(()=>{r(v),i(!1)}))},v=>{y()||(g=null,q(()=>{s(v),i(!1)}))})});return{value:n,loading:o,error:a,refresh:()=>{m||l(h=>h+1)},dispose:()=>{m||(m=!0,p(),f())}}}function ze(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let s=t;return e.source===s.source&&e.flags===s.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let s=t;if(e.size!==s.size)return!1;for(let[c,l]of e)if(!s.has(c)||!ze(l,s.get(c),n))return!1;return!0}if(e instanceof Set){let s=t;if(e.size!==s.size)return!1;for(let c of e)if(!s.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let s=new Uint8Array(e),c=new Uint8Array(t);if(s.length!==c.length)return!1;for(let l=0;l<s.length;l++)if(s[l]!==c[l])return!1;return!0}if(e instanceof DataView){if(!(t instanceof DataView)||e.byteLength!==t.byteLength)return!1;for(let s=0;s<e.byteLength;s++)if(e.getUint8(s)!==t.getUint8(s))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let s=e,c=t;if(s.length!==c.length)return!1;for(let l=0;l<s.length;l++)if(s[l]!==c[l])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((s,c)=>ze(s,t[c],n));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),t.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===t.href;if(e instanceof Error){let s=t;return e.name===s.name&&e.message===s.message&&ze(e.cause,s.cause,n)&&no(r,o,n)}let a=Object.getPrototypeOf(r);return a!==Object.prototype&&a!==null?!1:no(r,o,n)}function no(e,t,n){let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(t,i)&&ze(e[i],t[i],n))}function rl(e){return C(e,{equals:(t,n)=>ze(t,n)})}function cn(e,t){M(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,a=!1,s,c=()=>{o._d||a||(o._d=!0)};c._c=1,c._sig=o;let l=()=>{let p=e();o._v=r&&o._init&&r(o._v,p)?o._v:p,o._d=!1,o._init=!0};try{J(()=>{o._v=e(),o._d=!1,o._init=!0},c)}catch(p){throw a=!0,_e(c),p}let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,m=()=>{if(!o._d||a||s!==void 0)return;let p=o._v;i=!0;try{be(l,c),Object.is(p,o._v)||o.__v++}catch(h){s={error:h},o.__v++,a?o._d=!0:o._f=!0}finally{i=!1,a&&_e(c)}d&&!a&&!Object.is(p,o._v)&&G(d,"computed:update",{signal:o,oldValue:p,newValue:o._v})};o._validate=m;let g=()=>{let{error:p}=s;throw s=void 0,a&&(o._d=!1),p};function f(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return rr()||a?(o._d&&(m(),s!==void 0&&g()),o._v):(o._d&&(m(),s!==void 0&&(ke(o),g())),ke(o),o._v)}return n&&(f.__name=n,o.__name=n),f.__signal=o,f.dispose=()=>{if(a)return;a=!0,o._d=s!==void 0,_e(c);let p=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(p)try{p.emit("computed:destroy",{signal:o,getter:f})}catch{}},d&&G(d,"computed:create",{signal:o,name:n,getter:f}),f}function ol(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function ro(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function il(e){M(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t=Object.create(null);Object.keys(e).forEach(c=>{let[l,d]=C(e[c]);ro(t,c,[l,d])});let n=new Proxy({},{get(c,l){if(typeof l=="string"&&Object.hasOwn(t,l)){let d=t[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(t).forEach(l=>{ro(c,l,t[l][0]())}),c};return[n,{setState:c=>{let l=r(),d=typeof c=="function"?c(l):c;q(()=>{Object.entries(d).forEach(([m,g])=>{Object.hasOwn(t,m)&&t[m][1](g)})})},reset:()=>{q(()=>{Object.keys(e).forEach(c=>{let l=t[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return Y(()=>{let d=r();if(l){l=!1;return}Te();try{c(d)}finally{we()}})},subscribeKey:(c,l)=>{let d,m=!0;return Y(()=>{let g=t[c][0]();if(m){d=g,m=!1;return}if(!Object.is(g,d)){let f=d;d=g,Te();try{l(g,f)}finally{we()}}})},getSnapshot:r}]}function sl(e,t){if(M(typeof e=="function","watch: first argument must be a getter function."),M(typeof t=="function","watch: second argument must be a callback function."),te())return()=>{};let n,r=!0;return J(()=>{let a=e();if(r){n=a,r=!1;return}if(!Object.is(a,n)){let s=n;n=a,Te();try{t(a,s)}finally{we()}}})}function al(e,t,n){return[cn(e,n),i=>{q(()=>t(i))}]}function cl(e){let t=e();return re()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function ll(e){if(!re())return Y(e);let t=Y(e),n=null;return queueMicrotask(()=>{try{n=Y(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function oo(e,t){return te()?()=>{}:P(e,t)}var ln="data-sibu-enhanced",un=new WeakMap;function io(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=se){let i=r.length-o+e.length;e.length=0,pe(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var so=["text","attr","class","show","on","cleanup"];function ao(e,t){if(t==null)return e;if(typeof t!="string")return t;let n=t.startsWith("@")?`[data-ref="${t.slice(1)}"]`:t;try{return e.querySelector(n)}catch{return null}}function Ye(e,t){return oo(t,e)}function ul(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,t=>t.value):e.value}function dl(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!t;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(t)?t.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let n=t==null?"":String(t);e.value!==n&&(e.value=n)}function fl(e,t,n,r){let o=`ctx.each[${r}]`;if(re())for(let i of Object.keys(n))M(so.includes(i),`${o}: unknown binding "${i}". Expected one of: ${so.join(", ")}.`);if(n.text!==void 0&&(M(typeof n.text=="function",`${o}: "text" must be a function returning the value.`),e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let a=n.attr[i];M(typeof a=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(t,i,a)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let a=n.class[i];M(typeof a=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(t,i,a)}if(n.show!==void 0&&(M(typeof n.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let a=n.on[i];M(typeof a=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(t,i,a)}n.cleanup!==void 0&&(M(typeof n.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(n.cleanup))}function yt(e,t){let n=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!n)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(n.getAttribute(ln)==="true")return re()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,a=!1,s=g=>a?(V(()=>`enhance: ctx.${g}() 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.`),!0):!1,c=(g,f,p)=>{if(s(g))return;let h=ao(n,f);if(!h){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(f)} not found under`,n);return}p(h)},l={root:n,ref:g=>ao(n,g),refs:g=>{let f=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(n.querySelectorAll(f))}catch{return[]}},on:(g,f,p,h)=>{c("on",g,b=>{let y=_=>p(_,b);b.addEventListener(f,y,h),r.push(()=>b.removeEventListener(f,y,h))})},text:(g,f)=>{c("text",g,p=>{r.push(Ye(p,()=>{let h=f(),b=h==null?"":String(h);p.textContent!==b&&(p.textContent=b)}))})},attr:(g,f,p)=>{c("attr",g,h=>{r.push(Ye(h,()=>{let b=p(),y=b==null?null:String(b);Z(h,f,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(g,f,p)=>{c("classed",g,h=>{r.push(Ye(h,()=>{h.classList.toggle(f,!!p())}))})},show:(g,f)=>{c("show",g,p=>{let h=p.hidden;r.push(Ye(p,()=>{p.hidden=!f()})),r.push(()=>{p.hidden=h})})},model:(g,f,p)=>{c("model",g,h=>{let b=h,[y,_]=f,v=p?.event??(b instanceof HTMLSelectElement||b instanceof HTMLInputElement&&(b.type==="checkbox"||b.type==="radio")?"change":"input");r.push(Ye(h,()=>{dl(b,y())}));let E=()=>_(ul(b));b.addEventListener(v,E),r.push(()=>b.removeEventListener(v,E))})},each:(g,f)=>{if(s("each"))return;M(typeof f=="function","ctx.each: second argument must be a function.");let p=typeof g=="string"?l.refs(g):Array.from(g);for(let h=0;h<p.length;h++){let b=p[h],y=f(b,h);y!=null&&fl(l,b,y,h)}},cleanup:g=>{s("cleanup")||r.push(g)}},d;try{d=t(l);let g=d;if(g&&typeof g.then=="function")throw g.then(void 0,f=>{V(()=>`enhance: the promise returned by the setup also rejected: ${String(f)}`)}),new Error("[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.")}catch(g){throw io(r,"enhance"),a=!0,g}typeof d=="function"&&r.push(d);let m=()=>{i||(i=!0,un.get(n)===o&&(un.delete(n),n.removeAttribute(ln)),je(n,m),io(r,"enhance"),a=!0)};return x(n,m),un.set(n,o),n.setAttribute(ln,"true"),m}function pl(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(yt(r,t))}catch(r){for(let o=n.length-1;o>=0;o--)try{n[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw n.length=0,r}return()=>{for(let r of n.splice(0))r()}}var ml=/^[A-Za-z0-9_-]+$/,co=Symbol.for("sibujs.islands.lazy"),vt=Ge(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function gl(e){return e[co]=!0,e}function hl(e,t){if(!ml.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);vt.set(e,t)}function bl(e){vt.delete(e)}async function yl(e){if(typeof e=="function"&&e[co]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function vl(e=typeof document<"u"?document:null,t={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let n=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let a=i.getAttribute("data-sibu-island")??"";if(!vt.has(a)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${a}" \u2014 skipping. Call registerIsland("${a}", ...).`);continue}let s=!1,c=()=>{if(s||o)return;s=!0;let d=vt.get(a);d&&yl(d).then(m=>{if(!o){if(!m){typeof console<"u"&&console.warn(`[SibuJS islands] "${a}" loader produced no setup.`);return}try{let g=yt(i,m);if(o){g();return}r.push(g),i.setAttribute("data-sibu-hydrated","true")}catch(g){typeof console<"u"&&console.error(`[SibuJS islands] "${a}" failed to mount:`,g)}}}).catch(m=>{typeof console<"u"&&console.error(`[SibuJS islands] "${a}" failed to load:`,m)})},l=i.getAttribute("data-sibu-load")||"load";n.push(Sl(l,i,c,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Sl(e,t,n,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(n);return()=>cancelIdleCallback(i)}let o=setTimeout(n,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(n),()=>{};let o=new IntersectionObserver(i=>{for(let a of i)a.isIntersecting&&(o.disconnect(),n())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(t),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{a(),n()},a=()=>{for(let s of o)t.removeEventListener(s,i)};for(let s of o)t.addEventListener(s,i,{passive:!0});return a}case"media":{let o=t.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(n),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(n),()=>{};let a=()=>{i.matches&&(i.removeEventListener("change",a),n())};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)}default:return queueMicrotask(n),()=>{}}}function lo(e){return e}var Xf=1024*1024;function xl(e){let[t,n]=C(e()),r=!1,o=!1,i=t(),a=()=>{r=!1,!o&&n(i)},s=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(a):a()}))},c=J(()=>{i=e(),s()}),l=(()=>t());return l.dispose=()=>{o||(o=!0,c())},l}var uo=16;function El(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:uo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,uo)}function Tl(){let[e,t]=C(!1),n=0;function r(o){n++,t(!0);let i=!1,a=()=>{i||(i=!0,n--,n===0&&t(!1))},s=c=>{a(),k(c,{phase:"async",name:"transition"})};El(()=>{try{let c=gt(o());c?c.then(a,s):a()}catch(c){s(c)}})}return{pending:e,start:r}}function wl(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...dn});})();
399
+ `,jr=!1;function Fc(){!jr&&typeof document<"u"&&(document.head.appendChild(Ne({nodes:Bc})),jr=!0)}function zc(e={}){Fc();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[A({class:"sibu-loading-dots"},[I({class:"sibu-loading-dot"}),I({class:"sibu-loading-dot"}),I({class:"sibu-loading-dot"})]),t?I({class:"sibu-loading-text"},t):null]):A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[A({class:"sibu-loading-spinner"}),t?I({class:"sibu-loading-text"},t):null])}var fn=Symbol.for("sibujs.actions.v1"),qr=globalThis[fn]??(globalThis[fn]=new Map);function je(e,t){qr.set(e,t)}function Ur(e){return qr.get(e)}function Vc(e,t,n){let r=typeof t=="string"?Ur(t):t;if(!r)throw new Error(`[SibuJS] No action registered under the name "${t}". Register it with registerAction() before applying it by name.`);let o=r(e,n);typeof o=="function"&&x(e,o)}var Kr=(e,t)=>{let n=e.ownerDocument,r=o=>{let i=o.target;typeof i?.nodeType=="number"&&e.contains(i)||t()};return n.addEventListener("pointerdown",r,!0),()=>n.removeEventListener("pointerdown",r,!0)},Wr=["pointerup","pointerleave","pointercancel"],Jr=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=c=>{let u=c.pointerId;r!==null&&u!==o||(i(),o=u,r=setTimeout(()=>{r=null,t.callback()},n))},a=c=>{r!==null&&c.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let c of Wr)e.addEventListener(c,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let c of Wr)e.removeEventListener(c,a)}},Gr=(e,t)=>{let n=o=>k(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},Yr=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},Zr=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1],a=e.ownerDocument.activeElement;r.shiftKey&&a===i?(r.preventDefault(),s.focus()):!r.shiftKey&&a===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};je("clickOutside",Kr);je("longPress",Jr);je("copyOnClick",Gr);je("autoResize",Yr);je("trapFocus",Zr);function St(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(n){return Promise.reject(n)}return typeof t!="function"?null:new Promise((n,r)=>{queueMicrotask(()=>{try{Reflect.apply(t,e,[n,r])}catch(o){r(o)}})})}var De=null;function jc(e,t){try{let n=e(),r=St(n);return r&&r.then(void 0,o=>{t?t(o,"async"):De?De(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):De?De(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Wc(e,t){try{return await e()}catch(n){return t?t(n,"async"):De?De(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function qc(e){De=e}function Uc(e){let[t,n]=C(e),r=i=>{!!0||!re()||O(`context.${i}() called during SSR. SibuJS context() is application-global \u2014 it is NOT isolated per request, so a concurrent request can observe this value. Do not use context() for request-specific SSR data; pass it explicitly or use request-scoped storage instead.`)};return{provide(i){r("provide");let s=t();return n(i),()=>n(s)},use(){return t},get(){return t()},set(i){r("set"),n(i)},withContext(i,s){r("withContext");let a=t();n(i);try{let c=s();return c!==null&&typeof c?.then=="function"&&O("context.withContext() received an async callback. Scoping is synchronous only \u2014 the previous value is restored as soon as the callback returns its promise, so anything after an `await` runs outside the scope."),c}finally{n(a)}}}}var pn=Symbol.for("sibujs.createId.v1"),mn=globalThis[pn]??(globalThis[pn]={n:0});function Xr(e="sibu"){let t=Ar();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(mn.n++,`${e}-${mn.n}`)}function Qr(){mn.n=0}function Kc(e,t){let n=typeof t=="function"?t():t;return x(n,P(()=>{n.style.display=e()?"":"none"},n)),n}function eo(e,t,n,r,o){let i=typeof n=="function"?n():n;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===n,c=r.has(s),u=!a&&!c;return r.add(s),c&&j(()=>`${o}: ${a?"a branch was given as an element rather than a function":"a branch factory returned a node it had already returned"}, so the SAME node is being re-attached \u2014 any state it accumulated while detached (input value, scroll position, classes set imperatively) comes back with it. Its reactive bindings are left intact rather than disposed, because the node is not this directive's to tear down. Return a FRESH node per call (\`() => div(\u2026)\`) for rebuild semantics, or keep this form deliberately when the reuse is what you want.`),e.insertBefore(s,t.nextSibling),{node:s,owned:u}}function xt(e,t){t&&D(e),e.parentNode?.removeChild(e)}function Jc(e,t,n){let r=document.createComment("when"),o=null,i,s=!1,a=!1,c=new WeakSet,u=!1,l=()=>{if(a)return;let g=e(),f=r.parentNode;if(!f||s&&Object.is(g,i))return;i=g;let p=o?Ge([o]):null;o?.parentNode&&(xt(o,u),o=null);let b=g?t:n!==void 0?n:null,h=ne(()=>eo(f,r,b,c,"when"));o=h.node,u=h.owned,Fe(p,o?[o]:[],"when"),s=!0},m=P(l,r);return x(r,()=>{a=!0,m(),o&&xt(o,u),o=null}),s||queueMicrotask(z(()=>{!a&&!s&&r.parentNode&&l()})),r}function Gc(e,t,n){let r=document.createComment("match"),o=null,i,s=!1,a=!1,c=new WeakSet,u=!1,l=()=>{if(a)return;let g=String(e()),f=r.parentNode;if(!f||s&&g===i)return;i=g;let p=o?Ge([o]):null;o?.parentNode&&(xt(o,u),o=null);let b=Object.hasOwn(t,g)?t[g]:n,h=ne(()=>eo(f,r,b??null,c,"match"));o=h.node,u=h.owned,Fe(p,o?[o]:[],"match"),s=!0},m=P(l,r);return x(r,()=>{a=!0,m(),o&&xt(o,u),o=null}),s||queueMicrotask(z(()=>{!a&&!s&&r.parentNode&&l()})),r}function Xe(e,t){let n=globalThis;return n[e]??(n[e]=t())}var Et=Xe(Symbol.for("sibujs.components.registry.v1"),()=>new Map),to=Xe(Symbol.for("sibujs.components.registryVersion.v1"),()=>C(0));function no(){let[e,t]=to;t(ne(e)+1)}function Yc(e,t){Et.set(e,t),no()}function Zc(e){Et.delete(e)&&no()}function Xc(e){let t=Et.get(e);return t?t():A(`[Component "${e}" not found]`)}function Qc(e){let t=A({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(to[0](),a=Et.get(s));let c=a??`missing:${s}`;if(c===r)return;let u=ne(()=>a?a():A(`[Component "${s}" not found]`));r=c,W(t,u)}let i=Y(o);return x(t,i),t}function ro(e){return typeof e=="function"?ro(e()):e instanceof Node?e:document.createTextNode(String(e))}function eu(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let c=e[a],u=0,l=n.length;for(;u<l;){let m=u+l>>1;e[n[m]]<c?u=m+1:l=m}n[u]=a,r[a]=u>0?n[u-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function tu(e,t,n){M(typeof e=="function","each: first argument must be a function that returns an array."),M(typeof t=="function","each: second argument must be a render function."),M(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,u=new Map,l=new Map,m=[],g=[],f=[],p=0,b=[],h=[],y=new Uint8Array(0),_=new Map,v=[],E=[],w=new Map,$=!1,B=!1,$e=!1,xo=n.key,Sn=()=>{if($e)return;let oe=e(),N=oe.length,xe=r.parentNode;if(!xe)return;B||(xe.insertBefore(o,r.nextSibling),B=!0),h.length<N&&(h=new Array(N));for(let S=0;S<N;S++)h[S]=xo(oe[S]);let me=h;b.length<N&&(b=new Array(N)),l.clear(),w.clear();for(let S=0;S<N;S++)w.has(me[S])&&O(`each: duplicate key "${String(me[S])}" at index ${S} (first seen at ${w.get(me[S])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),w.set(me[S],S);p=0;for(let S=0;S<N;S++){let F=me[S],En=u.get(F),qe;if(En!==void 0)qe=En,m[p]=qe,g[p]=oe[S],f[p]=S,p++;else{let[Tn,ko]=C(oe[S]),[wn,_o]=C(S),kt;try{ke();try{kt=ro(t(Tn,wn))}finally{_e()}}catch(Ao){let Co=me[S];kt=document.createComment(`each:error:${S}`),queueMicrotask(()=>{k(Ao,{phase:"render",name:`each row (key="${String(Co)}")`,node:r.parentNode?r:void 0})})}qe={node:kt,item:Tn,setItem:ko,index:wn,setIndex:_o}}l.set(F,qe),b[S]=qe.node}for(let[S,F]of u)l.has(S)||(D(F.node),F.node.parentNode&&xe.removeChild(F.node));if(N===0){c=0;let S=u;u=l,l=S,$=!0,p=0;return}_.clear();for(let S=0;S<c;S++)_.set(a[S],S);v.length<N&&(v=new Array(N),E=new Array(N));let et=0;for(let S=0;S<N;S++){let F=_.get(me[S]);F!==void 0&&(v[et]=S,E[et]=F,et++)}let xn=eu(E,et);y.length<N?y=new Uint8Array(N):y.fill(0,0,N);for(let S=0;S<xn.length;S++)y[v[xn[S]]]=1;let tt=o;for(let S=N-1;S>=0;S--){let F=b[S];y[S]||F.nextSibling!==tt&&xe.insertBefore(F,tt),tt=F}let nt=a===i?s:i;nt.length<N&&(nt.length=N);for(let S=0;S<N;S++)nt[S]=me[S];a=nt,c=N;let wo=u;u=l,l=wo,$=!0,Eo()};function Eo(){if(p===0)return;let oe=p;p=0,q(()=>{for(let N=0;N<oe;N++){let xe=m[N];xe.setItem(g[N]),xe.setIndex(f[N]),m[N]=void 0,g[N]=void 0}})}let To=Y(Sn);return x(r,()=>{if(!$e){$e=!0,To();for(let oe of u.values())D(oe.node),oe.node.parentNode?.removeChild(oe.node);o.parentNode&&o.parentNode.removeChild(o),B=!1,u.clear(),l.clear(),w.clear(),_.clear(),c=0,m.length=0,g.length=0,f.length=0,p=0}}),$||queueMicrotask(z(()=>{!$&&!$e&&r.parentNode&&Sn()})),r}function nu(e){let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||oo(t,r);else oo(t,n);return t}function oo(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),x(n,de(n,t));return}e.appendChild(document.createTextNode(String(t)))}var ru=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),io=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),so=new WeakMap;function ou(e){let t=e.length-1,n=e[0];for(let f=0;f<t;f++)n+=`\0${f}\0${e[f+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
400
+ `||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let f=r;r++;let p=0;for(;r<o&&n.charCodeAt(r)!==0;)p=p*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,p<0||p>=t?(r=f,-1):p}function a(){let f=r;for(;r<o;){let p=n.charCodeAt(r);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45)r++;else break}return n.slice(f,r)}function c(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let f=s();if(f>=0)return{kind:"expr",idx:f};let p=n[r];if(p==='"'||p==="'"){r++;let b=[],h=[],y="";for(;r<o&&n[r]!==p;){let _=s();_>=0?(b.push(y),y="",h.push(_)):y+=n[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 _=n.charCodeAt(r);if(_===32||_===9||_===10||_===13||_===62)break;let v=s();v>=0?(b.push(y),y="",h.push(v)):y+=n[r++]}return b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function u(){let f=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let p=r;for(;r<o;){let y=n.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=n.slice(p,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 l(f){return f.replace(/\s+/g," ")}function m(f){let p="";for(;r<o&&n[r]!=="<";){let h=s();if(h>=0){let y=l(p);y&&f.push({t:1,value:y}),p="",f.push({t:2,idx:h})}else p+=n[r++]}let b=l(p);b&&f.push({t:1,value:b})}function g(){let f=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let p=n[r+1];if(p==="!"){if(n.startsWith("<!--",r)){let v=n.indexOf("-->",r+4);r=v===-1?o:v+3}else if(n.startsWith("<![CDATA[",r)){let v=n.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=n.indexOf(">",r);r=v===-1?o:v+1}continue}if(p==="?"){let v=n.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(p>="a"&&p<="z")&&!(p>="A"&&p<="Z")){f.push({t:1,value:"<"}),r++;continue}r++;let b=a(),h=u();i();let y=ru.has(b),_=n[r]==="/";if(_&&r++,r<o&&r++,y||_)f.push({t:0,el:{tag:b,svg:io.has(b),attrs:h,children:[]}});else{let v=g();if(jn(b)){for(let E=0;E<v.length;E++)if(v[E].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.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),f.push({t:0,el:{tag:b,svg:io.has(b),attrs:h,children:v}})}}else m(f);return f}return g()}function gn(e,t){let n=e.svg?document.createElementNS(R,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:Pt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?x(n,Je(n,i,s)):Q(n,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=t[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}Q(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):O(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:Pt(n,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(gn(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),x(n,de(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function ao(e,...t){let n=so.get(e);return n||(n=ou(e),so.set(e,n)),uo(n,t)}function co(e,t){return uo(e,t)}function uo(e,t){if(e.length===1&&e[0].t===0)return gn(e[0].el,t);let n=document.createElement("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(gn(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(i instanceof Node)n.appendChild(i);else if(typeof i=="function"){let s=document.createComment("bind:htm");n.appendChild(s),x(n,de(s,i))}else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function iu(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&ie()&&O("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,c=null,u=!1,l=!1,m=()=>{if(l)return;let f=e(),p=r.parentNode;if(!p||u&&f===a)return;c?.parentNode&&p.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=t[f];if(!h){c=null,u=!0;return}if(b=h(),b.nodeType===11){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(),_=o.get(y);_&&(D(_),_.parentNode&&_.parentNode.removeChild(_),o.delete(y))}}p.insertBefore(b,r.nextSibling),c=b,u=!0},g=Y(m);return u||queueMicrotask(z(()=>{!u&&r.parentNode&&m()})),x(r,()=>{l=!0,g();for(let f of o.values())D(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function su(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");M(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=l=>{if(l instanceof DocumentFragment){let m=document.createComment(""),g=document.createComment("");l.insertBefore(m,l.firstChild),l.appendChild(g),o={start:m,end:g}}t.appendChild(l)},s;typeof e=="function"?s=Ln(()=>{let l=e();return i(l),l}):(s=e,i(s));let a=n()-r,c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&Z(c,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(c&&Z(c,"app:unmount",{rootElement:s}),u){au(u.start,u.end);return}D(s),s.parentNode?.removeChild(s)}}}function au(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=ce;for(let a=e.nextSibling;a&&a!==t;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==n||t.parentNode!==n?s=!1:(e.previousSibling!==o||t.nextSibling!==i)&&(o=e.previousSibling,i=t.nextSibling,s=!!(e.compareDocumentPosition(t)&4));let a=e.nextSibling;if(!s||a===t)break;if(r--<=0){ge("mount",ce,1);return}D(a),a.parentNode===n&&n.removeChild(a)}s||k(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function cu(e,t){let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=z(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{k(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),x(n,()=>{i=!0,o&&(D(o),o.remove(),o=null)}),n}function uu(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function lo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function lu(e=[]){let[t,n]=C([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let c=[...a];return s=lo(c,o,i),s.length===0&&i.length<=1?a:c}),s},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function du(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Oe(r)||Pe(r)}function i(){if(Ae(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,...c){let u=lo(t,a,c);return(u.length>0||c.length>1)&&o(),u},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let c=t.findIndex(a);c!==-1&&(t.splice(c,1),o())},set(a){t=[...a],o()},update(a,c){a<0||a>=t.length||Object.is(t[a],c)||(t[a]=c,o())},updateWhere(a,c){let u=!1;for(let l=0;l<t.length;l++)if(a(t[l])){let m=c(t[l]);Object.is(t[l],m)||(t[l]=m,u=!0)}u&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let c=t.filter(a);c.length!==t.length&&(t=c,o())},map(a){let c=!1;for(let u=0;u<t.length;u++){let l=a(t[u],u);Object.is(t[u],l)||(t[u]=l,c=!0)}c&&o()},clear(){t.length!==0&&(t=[],o())}}]}function fu(e,t){let[n,r]=C(t),[o,i]=C(!1),[s,a]=C(null),[c,u]=C(0),l=0,m=!1,g=null,f=()=>{if(g===null)return;let b=g;g=null;try{b.abort()}catch{}},p=X(()=>{if(c(),m)return;f();let b=++l,h=typeof AbortController<"u"?new AbortController:null;g=h,q(()=>{i(!0),a(null)});let y=()=>m||b!==l,_;try{_=e({signal:h?h.signal:void 0})}catch(v){if(y())return;q(()=>{a(v),i(!1)});return}_.then(v=>{y()||(g=null,q(()=>{r(v),i(!1)}))},v=>{y()||(g=null,q(()=>{a(v),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{m||u(b=>b+1)},dispose:()=>{m||(m=!0,p(),f())}}}function We(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let a=t;return e.source===a.source&&e.flags===a.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let a=t;if(e.size!==a.size)return!1;for(let[c,u]of e)if(!a.has(c)||!We(u,a.get(c),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let c of e)if(!a.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),c=new Uint8Array(t);if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==c[u])return!1;return!0}if(e instanceof DataView){if(!(t instanceof DataView)||e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==t.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let a=e,c=t;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==c[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,c)=>We(a,t[c],n));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),t.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===t.href;if(e instanceof Error){let a=t;return e.name===a.name&&e.message===a.message&&We(e.cause,a.cause,n)&&fo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:fo(r,o,n)}function fo(e,t,n){let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(t,i)&&We(e[i],t[i],n))}function pu(e){return C(e,{equals:(t,n)=>We(t,n)})}function bn(e,t){M(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,c=()=>{o._d||s||(o._d=!0)};c._c=1,c._sig=o;let u=()=>{let p=e();o._v=r&&o._init&&r(o._v,p)?o._v:p,o._d=!1,o._init=!0};try{Y(()=>{o._v=e(),o._d=!1,o._init=!0},c)}catch(p){throw s=!0,Ce(c),p}let l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,m=()=>{if(!o._d||s||a!==void 0)return;let p=o._v;i=!0;try{ve(u,c),Object.is(p,o._v)||o.__v++}catch(b){a={error:b},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&Ce(c)}l&&!s&&!Object.is(p,o._v)&&Z(l,"computed:update",{signal:o,oldValue:p,newValue:o._v})};o._validate=m;let g=()=>{let{error:p}=a;throw a=void 0,s&&(o._d=!1),p};function f(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return dr()||s?(o._d&&(m(),a!==void 0&&g()),o._v):(o._d&&(m(),a!==void 0&&(Ae(o),g())),Ae(o),o._v)}return n&&(f.__name=n,o.__name=n),f.__signal=o,f.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,Ce(c);let p=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(p)try{p.emit("computed:destroy",{signal:o,getter:f})}catch{}},l&&Z(l,"computed:create",{signal:o,name:n,getter:f}),f}function mu(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function po(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function gu(e){M(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t=Object.create(null);Object.keys(e).forEach(c=>{let[u,l]=C(e[c]);po(t,c,[u,l])});let n=new Proxy({},{get(c,u){if(typeof u=="string"&&Object.hasOwn(t,u)){let l=t[u][0];return l()}return Reflect.get(c,u)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(t).forEach(u=>{po(c,u,t[u][0]())}),c};return[n,{setState:c=>{let u=r(),l=typeof c=="function"?c(u):c;q(()=>{Object.entries(l).forEach(([m,g])=>{Object.hasOwn(t,m)&&t[m][1](g)})})},reset:()=>{q(()=>{Object.keys(e).forEach(c=>{let u=t[c][1];u(e[c])})})},subscribe:c=>{let u=!0;return X(()=>{let l=r();if(u){u=!1;return}ke();try{c(l)}finally{_e()}})},subscribeKey:(c,u)=>{let l,m=!0;return X(()=>{let g=t[c][0]();if(m){l=g,m=!1;return}if(!Object.is(g,l)){let f=l;l=g,ke();try{u(g,f)}finally{_e()}}})},getSnapshot:r}]}function bu(e,t){if(M(typeof e=="function","watch: first argument must be a getter function."),M(typeof t=="function","watch: second argument must be a callback function."),re())return()=>{};let n,r=!0;return Y(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,ke();try{t(s,a)}finally{_e()}}})}function hu(e,t,n){return[bn(e,n),i=>{q(()=>t(i))}]}function yu(e){let t=e();return ie()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function vu(e){if(!ie())return X(e);let t=X(e),n=null;return queueMicrotask(()=>{try{n=X(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function mo(e,t){return re()?()=>{}:P(e,t)}var hn="data-sibu-enhanced",yn=new WeakMap;function go(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=ce){let i=r.length-o+e.length;e.length=0,ge(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var bo=["text","attr","class","show","on","cleanup"];function ho(e,t){if(t==null)return e;if(typeof t!="string")return t;let n=t.startsWith("@")?`[data-ref="${t.slice(1)}"]`:t;try{return e.querySelector(n)}catch{return null}}function Qe(e,t){return mo(t,e)}function Su(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,t=>t.value):e.value}function xu(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!t;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(t)?t.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let n=t==null?"":String(t);e.value!==n&&(e.value=n)}function Eu(e,t,n,r){let o=`ctx.each[${r}]`;if(ie())for(let i of Object.keys(n))M(bo.includes(i),`${o}: unknown binding "${i}". Expected one of: ${bo.join(", ")}.`);if(n.text!==void 0&&(M(typeof n.text=="function",`${o}: "text" must be a function returning the value.`),e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];M(typeof s=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];M(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(t,i,s)}if(n.show!==void 0&&(M(typeof n.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];M(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(t,i,s)}n.cleanup!==void 0&&(M(typeof n.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(n.cleanup))}function Tt(e,t){let n=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!n)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(n.getAttribute(hn)==="true")return ie()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=g=>s?(j(()=>`enhance: ctx.${g}() 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.`),!0):!1,c=(g,f,p)=>{if(a(g))return;let b=ho(n,f);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(f)} not found under`,n);return}p(b)},u={root:n,ref:g=>ho(n,g),refs:g=>{let f=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(n.querySelectorAll(f))}catch{return[]}},on:(g,f,p,b)=>{c("on",g,h=>{let y=_=>p(_,h);h.addEventListener(f,y,b),r.push(()=>h.removeEventListener(f,y,b))})},text:(g,f)=>{c("text",g,p=>{r.push(Qe(p,()=>{let b=f(),h=b==null?"":String(b);p.textContent!==h&&(p.textContent=h)}))})},attr:(g,f,p)=>{c("attr",g,b=>{r.push(Qe(b,()=>{let h=p(),y=h==null?null:String(h);Q(b,f,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(g,f,p)=>{c("classed",g,b=>{r.push(Qe(b,()=>{b.classList.toggle(f,!!p())}))})},show:(g,f)=>{c("show",g,p=>{let b=p.hidden;r.push(Qe(p,()=>{p.hidden=!f()})),r.push(()=>{p.hidden=b})})},model:(g,f,p)=>{c("model",g,b=>{let h=b,[y,_]=f,v=p?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(Qe(b,()=>{xu(h,y())}));let E=()=>_(Su(h));h.addEventListener(v,E),r.push(()=>h.removeEventListener(v,E))})},each:(g,f)=>{if(a("each"))return;M(typeof f=="function","ctx.each: second argument must be a function.");let p=typeof g=="string"?u.refs(g):Array.from(g);for(let b=0;b<p.length;b++){let h=p[b],y=f(h,b);y!=null&&Eu(u,h,y,b)}},cleanup:g=>{a("cleanup")||r.push(g)}},l;try{l=t(u);let g=l;if(g&&typeof g.then=="function")throw g.then(void 0,f=>{j(()=>`enhance: the promise returned by the setup also rejected: ${String(f)}`)}),new Error("[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.")}catch(g){throw go(r,"enhance"),s=!0,g}typeof l=="function"&&r.push(l);let m=()=>{i||(i=!0,yn.get(n)===o&&(yn.delete(n),n.removeAttribute(hn)),Ue(n,m),go(r,"enhance"),s=!0)};return x(n,m),yn.set(n,o),n.setAttribute(hn,"true"),m}function Tu(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Tt(r,t))}catch(r){for(let o=n.length-1;o>=0;o--)try{n[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw n.length=0,r}return()=>{for(let r of n.splice(0))r()}}var wu=/^[A-Za-z0-9_-]+$/,yo=Symbol.for("sibujs.islands.lazy"),wt=Xe(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function ku(e){return e[yo]=!0,e}function _u(e,t){if(!wu.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);wt.set(e,t)}function Au(e){wt.delete(e)}async function Cu(e){if(typeof e=="function"&&e[yo]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function Nu(e=typeof document<"u"?document:null,t={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let n=[],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(!wt.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 l=wt.get(s);l&&Cu(l).then(m=>{if(!o){if(!m){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=Tt(i,m);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(m=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,m)})},u=i.getAttribute("data-sibu-load")||"load";n.push(Ru(u,i,c,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Ru(e,t,n,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(n);return()=>cancelIdleCallback(i)}let o=setTimeout(n,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(n),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),n())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(t),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),n()},s=()=>{for(let a of o)t.removeEventListener(a,i)};for(let a of o)t.addEventListener(a,i,{passive:!0});return s}case"media":{let o=t.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(n),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(n),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),n())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(n),()=>{}}}function vo(e){return e}var fp=1024*1024;function Lu(e){let[t,n]=C(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=Y(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,c())},u}var So=16;function Mu(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:So*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,So)}function Ou(){let[e,t]=C(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=c=>{s(),k(c,{phase:"async",name:"transition"})};Mu(()=>{try{let c=St(o());c?c.then(s,a):s()}catch(c){a(c)}})}return{pending:e,start:r}}function Du(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...vn});})();