sibujs 4.14.1 → 4.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/browser.cjs +297 -45
  2. package/dist/browser.js +6 -7
  3. package/dist/build.cjs +2189 -573
  4. package/dist/build.js +16 -15
  5. package/dist/cdn.dev.global.js +13 -12
  6. package/dist/cdn.full.dev.global.js +14 -13
  7. package/dist/cdn.full.global.js +12 -12
  8. package/dist/cdn.global.js +12 -12
  9. package/dist/{chunk-4XCWNGRY.js → chunk-2VKTFA7C.js} +1 -1
  10. package/dist/{chunk-YPLQQTWS.js → chunk-4AEFGRYW.js} +1 -1
  11. package/dist/{chunk-VIAVYBNQ.js → chunk-6IV5ZRG6.js} +5 -7
  12. package/dist/{chunk-KTJC7QPA.js → chunk-75EAQH3U.js} +2 -2
  13. package/dist/{chunk-LJ2LR5P4.js → chunk-7JO7DPSS.js} +4 -4
  14. package/dist/{chunk-B2NLNZ3E.js → chunk-AQH7WDSE.js} +6 -8
  15. package/dist/{chunk-S37PZD6I.js → chunk-BF3WBJJQ.js} +60 -10
  16. package/dist/{chunk-LJMX4SQ7.js → chunk-BG4BP44S.js} +3 -3
  17. package/dist/{chunk-ZYK4NZZA.js → chunk-D44TAGCT.js} +2 -2
  18. package/dist/{chunk-OPRQW4LI.js → chunk-DAEXQJQA.js} +1 -1
  19. package/dist/chunk-DNCQDFJJ.js +22 -0
  20. package/dist/{chunk-WFMMSMA5.js → chunk-DNCT2UXB.js} +4 -4
  21. package/dist/{chunk-TOV4PN3P.js → chunk-DRWOD7RZ.js} +4 -4
  22. package/dist/chunk-DS5V2PRE.js +64 -0
  23. package/dist/{chunk-L2IPKGUJ.js → chunk-EHSJESRN.js} +595 -123
  24. package/dist/{chunk-LAHX7XFG.js → chunk-GFM5WWPU.js} +252 -5
  25. package/dist/{chunk-52XFPGSN.js → chunk-HTPOIAAL.js} +1 -1
  26. package/dist/{chunk-3HEX6QJQ.js → chunk-I2R5QALY.js} +2 -4
  27. package/dist/{chunk-FCWOMATN.js → chunk-IUBV5WO5.js} +1 -1
  28. package/dist/{chunk-TZNR6E6D.js → chunk-KIDETDMU.js} +5 -7
  29. package/dist/{chunk-TS6JDK7Y.js → chunk-KPAXG5IR.js} +7 -9
  30. package/dist/{chunk-FFXZ6ELZ.js → chunk-LGUXYHTZ.js} +3 -3
  31. package/dist/{chunk-NIHGSXOX.js → chunk-LQWLPQOK.js} +6 -8
  32. package/dist/{chunk-YIXMS546.js → chunk-MINLMJUY.js} +5 -8
  33. package/dist/{chunk-OLMZF4RU.js → chunk-OURTGOJT.js} +8 -10
  34. package/dist/{chunk-55TAOW5M.js → chunk-TQ24Y3IV.js} +2 -2
  35. package/dist/{chunk-LUZXFMKH.js → chunk-UM3M5PXS.js} +8 -8
  36. package/dist/{chunk-ZKI4SDZ2.js → chunk-VSTX3XSX.js} +205 -15
  37. package/dist/{chunk-3T7TWMSD.js → chunk-XPDZ2LDR.js} +2 -2
  38. package/dist/{chunk-RBRITLFL.js → chunk-Y7JM7GY2.js} +5 -7
  39. package/dist/{chunk-LZKKMDQF.js → chunk-YAFITBOK.js} +1269 -162
  40. package/dist/data.cjs +285 -33
  41. package/dist/data.js +6 -7
  42. package/dist/devtools.cjs +289 -39
  43. package/dist/devtools.js +5 -6
  44. package/dist/{dispose-EIHHHDC7.js → dispose-3WDBYJMH.js} +3 -1
  45. package/dist/ecosystem.cjs +345 -61
  46. package/dist/ecosystem.d.cts +1 -1
  47. package/dist/ecosystem.d.ts +1 -1
  48. package/dist/ecosystem.js +10 -10
  49. package/dist/extras.cjs +525 -247
  50. package/dist/extras.d.cts +1 -1
  51. package/dist/extras.d.ts +1 -1
  52. package/dist/extras.js +27 -27
  53. package/dist/index.cjs +2134 -515
  54. package/dist/index.d.cts +628 -211
  55. package/dist/index.d.ts +628 -211
  56. package/dist/index.js +22 -15
  57. package/dist/motion.cjs +286 -30
  58. package/dist/motion.js +4 -4
  59. package/dist/patterns.cjs +301 -43
  60. package/dist/patterns.js +6 -6
  61. package/dist/performance.cjs +286 -36
  62. package/dist/performance.js +9 -9
  63. package/dist/plugins.cjs +1194 -290
  64. package/dist/plugins.d.cts +3 -1
  65. package/dist/plugins.d.ts +3 -1
  66. package/dist/plugins.js +20 -19
  67. package/dist/{renderRoute-fxgsm2Ir.d.ts → renderRoute-B84MONaO.d.cts} +2 -2
  68. package/dist/{renderRoute-DP20XwMS.d.cts → renderRoute-_yxPuEQY.d.ts} +2 -2
  69. package/dist/{routeHead-CE9SV-cH.d.cts → routeHead-DLxlq15W.d.cts} +94 -0
  70. package/dist/{routeHead-DzVxPviY.d.ts → routeHead-w8nANZ3M.d.ts} +94 -0
  71. package/dist/{ssr-HHU3DAD2.js → ssr-EF3IUHTE.js} +6 -6
  72. package/dist/ssr-dom.cjs +21 -8
  73. package/dist/ssr-dom.js +2 -1
  74. package/dist/ssr.cjs +807 -169
  75. package/dist/ssr.d.cts +5 -3
  76. package/dist/ssr.d.ts +5 -3
  77. package/dist/ssr.js +16 -15
  78. package/dist/{tagFactory-DkytnJws.d.cts → tagFactory-BfEh69VF.d.cts} +7 -0
  79. package/dist/{tagFactory-Bnd_Nph9.d.ts → tagFactory-pSYiLYyh.d.ts} +7 -0
  80. package/dist/testing.cjs +774 -131
  81. package/dist/testing.d.cts +4 -2
  82. package/dist/testing.d.ts +4 -2
  83. package/dist/testing.js +18 -17
  84. package/dist/track-core-0edROAF5.d.ts +187 -0
  85. package/dist/track-core-DN5fYLWi.d.cts +187 -0
  86. package/dist/ui.cjs +293 -43
  87. package/dist/ui.js +10 -12
  88. package/dist/widgets.cjs +285 -27
  89. package/dist/widgets.js +7 -7
  90. package/package.json +1 -1
  91. package/dist/chunk-7ZHH77QA.js +0 -9
@@ -1,10 +1,10 @@
1
- "use strict";(()=>{var oi=Object.defineProperty;var Dt=(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 ii=(e,t)=>{for(var n in t)oi(e,n,{get:t[n],enumerable:!0})};var On={};ii(On,{ClientOnly:()=>Co,DynamicComponent:()=>Mc,ErrorBoundary:()=>yc,ErrorDisplay:()=>wn,Fragment:()=>Pc,KeepAlive:()=>Bc,Loading:()=>xc,MAX_DRAIN_TEARDOWNS:()=>ae,Portal:()=>jc,SVG_NS:()=>R,Suspense:()=>ro,__renderParsedTemplate:()=>Io,__resetIdCounter:()=>Ro,a:()=>Ys,abbr:()=>Zs,action:()=>Ec,address:()=>Ds,area:()=>Ea,array:()=>Vc,article:()=>Cs,aside:()=>Os,asyncDerived:()=>Uc,audio:()=>Ta,autoResize:()=>wo,b:()=>Xs,base:()=>hl,batch:()=>V,bdi:()=>Qs,bdo:()=>ea,bindDynamic:()=>Br,blockquote:()=>Fs,body:()=>ks,br:()=>ta,button:()=>tt,canvas:()=>$a,caption:()=>ja,catchError:()=>Tc,catchErrorAsync:()=>wc,center:()=>Fl,checkLeaks:()=>Qn,circle:()=>vl,cite:()=>na,clickOutside:()=>xo,clipPath:()=>Ll,code:()=>dn,col:()=>Wa,colgroup:()=>Va,context:()=>Cc,copyOnClick:()=>To,createId:()=>No,customElement:()=>Wl,data:()=>ra,datalist:()=>Xa,dd:()=>zs,deepEqual:()=>Ke,deepSignal:()=>Kc,defer:()=>du,defs:()=>Rl,del:()=>Fa,derived:()=>Rn,details:()=>dl,dfn:()=>oa,dialog:()=>fl,disableSSR:()=>Zr,dispose:()=>L,div:()=>_,dl:()=>js,dt:()=>Ws,each:()=>Dc,effect:()=>Z,ellipse:()=>xl,em:()=>ia,embed:()=>Ca,enableSSR:()=>Yr,enhance:()=>Lt,enhanceAll:()=>ru,enqueueBatchedSignal:()=>He,external:()=>cc,fieldset:()=>Qa,figcaption:()=>Vs,figure:()=>qs,font:()=>zl,footer:()=>Rs,form:()=>el,g:()=>El,getAction:()=>vo,getRequestScopedCache:()=>Jr,getRuntimeErrorHandler:()=>jn,getSSRStore:()=>Ee,getSlot:()=>Wc,h1:()=>Hs,h2:()=>Ps,h3:()=>cn,h4:()=>$s,h5:()=>Is,h6:()=>Bs,head:()=>ws,header:()=>Ns,hr:()=>Us,html:()=>$o,i:()=>sa,iframe:()=>Na,img:()=>wa,input:()=>tl,ins:()=>za,isBatching:()=>lc,isClient:()=>Gr,isSSR:()=>j,isServer:()=>nt,kbd:()=>aa,label:()=>nl,lazy:()=>no,lazyIsland:()=>iu,legend:()=>rl,li:()=>Ks,line:()=>Tl,linearGradient:()=>Dl,link:()=>yl,longPress:()=>Eo,main:()=>Ms,map:()=>ka,mark:()=>la,marker:()=>Bl,marquee:()=>jl,mask:()=>Ml,match:()=>_c,math:()=>Pa,menu:()=>pl,meta:()=>Sl,meter:()=>ol,mount:()=>Fc,mountIslands:()=>cu,nav:()=>Ls,nextTick:()=>mu,noscript:()=>Ia,object:()=>Ra,ol:()=>Js,on:()=>tc,onCleanup:()=>ec,onMount:()=>At,onUnmount:()=>Ql,optgroup:()=>il,option:()=>sl,output:()=>al,p:()=>ln,param:()=>La,path:()=>wl,pattern:()=>Ol,picture:()=>Ma,polygon:()=>kl,polyline:()=>Al,portal:()=>Oa,pre:()=>un,progress:()=>ll,q:()=>ca,radialGradient:()=>Hl,reactiveArray:()=>qc,rect:()=>_l,ref:()=>Jc,registerAction:()=>Ue,registerComponent:()=>Nc,registerDisposer:()=>E,registerIsland:()=>su,replaceChildrenSafely:()=>U,reportDrainRunaway:()=>be,reportError:()=>w,resolveComponent:()=>Lc,retrack:()=>ve,rp:()=>ua,rt:()=>da,ruby:()=>fa,runInSSRContext:()=>Xr,s:()=>pa,samp:()=>ma,script:()=>Ba,section:()=>_s,select:()=>cl,setGlobalErrorHandler:()=>kc,setMaxDrainIterations:()=>Pr,setRuntimeErrorHandler:()=>zn,show:()=>Ac,signal:()=>C,slot:()=>gl,small:()=>ga,source:()=>Da,span:()=>H,stop:()=>Pl,store:()=>Gc,strict:()=>Xc,strictEffect:()=>Qc,strong:()=>ba,style:()=>Le,sub:()=>ha,summary:()=>ml,sup:()=>ya,svg:()=>Ha,symbol:()=>Il,table:()=>qa,tagFactory:()=>d,takePendingError:()=>Tt,tbody:()=>Ua,td:()=>Ka,template:()=>bl,text:()=>Cl,textarea:()=>ul,tfoot:()=>Ja,th:()=>Ga,thead:()=>Ya,time:()=>Sa,title:()=>As,tr:()=>Za,track:()=>Aa,transition:()=>pu,trapFocus:()=>ko,trustHTML:()=>Jo,tspan:()=>Nl,u:()=>va,ul:()=>Gs,unregisterComponent:()=>Rc,unregisterDisposer:()=>Ze,unregisterIsland:()=>au,untracked:()=>ee,use:()=>$l,var_:()=>xa,video:()=>_a,watch:()=>Yc,when:()=>An,withSSR:()=>eo,writable:()=>Zc});var Fn=Symbol.for("sibujs.runtime-errors.v1");function Ht(){let e=globalThis,t=e[Fn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Fn]=n,n}function zn(e){let t=Ht(),n=t.handler;return t.handler=e,n}function jn(){return Ht().handler}function Pt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${si(e)}`;return new Error(t,{cause:e})}function si(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 ai(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var li=Symbol.for("sibujs.reactive.v1");function ci(e){let t=globalThis[li];return t?.untracked?t.untracked(e):e()}var ui="sibu:error-propagate";function di(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=fi(n);if(!r)return!1;try{let o=new CustomEvent(ui,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function fi(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 pi(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${ai(t)}: ${e.message}`,e)}function mi(){let e=globalThis[Symbol.for("sibujs.ssr.v1")];return e?(e.als?e.als.getStore():e.fallbackDepth>0?e.fallbackStore:void 0)?.errors:void 0}function w(e,t){let n=Pt(e);ci(()=>{if(di(n,t))return;let r=mi();if(r){r.push({error:n,context:t});return}let o=Ht(),i=o.handler;if(i&&o.handlerDepth===0){o.handlerDepth++;try{i(e instanceof Error?e:n,t);return}catch(s){if(typeof console<"u"){let a=s instanceof Error?s.message:String(s);console.error(`[SibuJS] runtime error handler itself threw: ${a}`,s)}}finally{o.handlerDepth--}}pi(n,t)})}function ne(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var ge=null;function Wn(){return ge?.s.on===!0}function Vn(){return ge?.s.on?ge.s:null}function Ye(e,t){let n=ge;if(n?.s.on){let r=n.s.el(e,t,n.p+(n.n++).toString(36));if(r)return r}return t?document.createElementNS(t,e):document.createElement(e)}function re(){let e=ge;return e?.s.on?{p:`${e.p}${(e.n++).toString(36)}.`,n:0,s:e.s}:null}function qn(e,t){if(!e?.s.on)return null;let n=typeof t;if(n!=="string"&&n!=="number")throw new TypeError(`[SibuJS] adopt: a key must be a string or a number, not ${n}`);let r=String(t).replace(/[^\w-]/g,o=>`~${o.charCodeAt(0).toString(16).padStart(4,"0")}`);return{p:`${e.p}${n==="string"?"_":"-"}${r}.`,n:0,s:e.s}}function F(e,t){let n=ge;if(!e&&!n)return t();ge=e?.s.on?{p:e.p,n:0,s:e.s}:null;try{return t()}finally{ge=n}}var Un,$t=globalThis[Un=Symbol.for("sibujs.hydration.v2")]??(globalThis[Un]={a:new Set,c:null});function se(){return $t.a.size>0}function gi(){return Vn()?.h??$t.c}function It(){let e=gi();return e?e.open?[e]:[]:Array.from($t.a)}function Kn(e){let t=It(),n=t.length,r=()=>{--n<1&&e()};if(n)for(let o of t)o.done.push(r);else e()}function bi(e){for(let t of Array.from(e.wake))t()}function Jn(e,t){for(let n of e)n.pending.add(t);return()=>{for(let n of e)n.pending.delete(t)&&bi(n)}}var oe=new WeakMap,ae=1e4;function be(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 Te=0;function ut(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var q=[];function Gn(){return ut(q[q.length-1])}function Yn(e){return e===null&&q.length===0?!1:(q.push(ut(e)),!0)}function Zn(){q.pop()}function E(e,t){let n=oe.get(e);n||(n=[],oe.set(e,n)),n.push(t),!1;let r=ut(q[q.length-1]);r&&r.entries.push([e,t])}function Xn(e){let t={entries:[],closed:!1},n=t.entries;q.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=ae){be("rollback",s,n.length);break}let[a,l]=n.pop();if(Ze(a,l)){s++;try{l()}catch(c){w(c,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,q.pop()}throw i}t.closed=!0,q.pop();let o=ut(q[q.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 Ze(e,t){let n=oe.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),!1,n.length===0&&oe.delete(e),!0)}function L(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--)hi(n[r])}function hi(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),!1;for(let i=0;i<o.length;i++){if(t>=ae){let s=o.slice(i),a=oe.get(e);oe.set(e,a?s.concat(a):s),!1,be("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){w(s,{phase:"cleanup",name:"disposer"})}}}}function U(e,...t){if(se()&&t.length>0&&t[0]===e.firstChild){let r=!0;for(let o=1;o<t.length&&r;o++)r=t[o-1].nextSibling===t[o];if(r){let o=t[t.length-1].nextSibling;for(;o;){let i=o.nextSibling;L(o),e.removeChild(o),o=i}return}}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++)L(n[r]);e.replaceChildren(...t)}function Qn(e=0){return 0}function $e(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var yi=/[A-Z]/,Si=/[A-Z]/g;function K(e){return yi.test(e)?e.replace(Si,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function he(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 vi=["http:","https:","mailto:","tel:","ftp:"],xi=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function ft(e){let t=$e(e).trim();if(!t)return"";let n=e.replace(xi,"");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)&&vi.indexOf(i)===-1?"":n}var Ei=/^\d+(\.\d+)?[wx]$/;function Bt(e){return e===" "||e===" "||e===`
2
- `||e==="\r"||e==="\f"}function Ti(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(Bt(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!Bt(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let c="",u=!1;for(;r<o;){let f=t[r];if(u){c+=f,f===")"&&(u=!1),r++;continue}if(Bt(f)){c&&a.push(c),c="",r++;continue}if(f===","){r++;break}f==="("&&(u=!0),c+=f,r++}c&&a.push(c)}if(s===""||a.length>1||a.length===1&&!Ei.test(a[0]))continue;let l=ft(s);l&&(l.startsWith(",")||l.endsWith(",")||n.push(a.length===1?`${l} ${a[0]}`:l))}return n.join(", ")}var wi=/[(:@\\]/;function ki(e){return e===" "||e===" "||e===`
3
- `||e==="\r"||e==="\f"}function er(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Ai(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 Os=Object.defineProperty;var Bn=(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 Ds=(e,t)=>{for(var n in t)Os(e,n,{get:t[n],enumerable:!0})};var ro={};Ds(ro,{ClientOnly:()=>ss,DynamicComponent:()=>Td,ErrorBoundary:()=>ed,ErrorDisplay:()=>Wr,Fragment:()=>Cd,KeepAlive:()=>Ld,Loading:()=>rd,MAX_DRAIN_TEARDOWNS:()=>Le,Portal:()=>Hd,SVG_NS:()=>V,Suspense:()=>Li,__renderParsedTemplate:()=>bs,__resetIdCounter:()=>ls,a:()=>Pl,abbr:()=>Hl,action:()=>od,address:()=>Sl,area:()=>au,array:()=>$d,article:()=>pl,aside:()=>yl,asyncDerived:()=>zd,audio:()=>lu,autoResize:()=>Xi,b:()=>Il,base:()=>nc,batch:()=>se,bdi:()=>$l,bdo:()=>Bl,bindDynamic:()=>ci,blockquote:()=>kl,body:()=>cl,br:()=>zl,button:()=>Vt,canvas:()=>wu,caption:()=>Au,catchError:()=>id,catchErrorAsync:()=>sd,center:()=>kc,checkLeaks:()=>xo,circle:()=>ic,cite:()=>Fl,clickOutside:()=>Ji,clipPath:()=>hc,code:()=>Lr,col:()=>Cu,colgroup:()=>_u,context:()=>vd,copyOnClick:()=>Yi,createId:()=>as,customElement:()=>Cc,data:()=>Wl,datalist:()=>Iu,dd:()=>Nl,deepEqual:()=>Pt,deepSignal:()=>Fd,defer:()=>of,defs:()=>gc,del:()=>ku,derived:()=>eo,details:()=>Yu,dfn:()=>Vl,dialog:()=>Xu,disableSSR:()=>yi,dispose:()=>D,div:()=>I,dl:()=>Al,dt:()=>Cl,each:()=>Nd,effect:()=>re,ellipse:()=>sc,em:()=>jl,embed:()=>pu,enableSSR:()=>bi,enhance:()=>_n,enhanceAll:()=>Yd,enqueueBatchedSignal:()=>pt,external:()=>qc,fieldset:()=>$u,figcaption:()=>_l,figure:()=>Rl,font:()=>Nc,footer:()=>gl,form:()=>Bu,g:()=>ac,getAction:()=>Ki,getRequestScopedCache:()=>gi,getRuntimeErrorHandler:()=>co,getSSRStore:()=>Ke,getSlot:()=>Id,h1:()=>vl,h2:()=>xl,h3:()=>_r,h4:()=>wl,h5:()=>El,h6:()=>Tl,head:()=>ul,header:()=>ml,hr:()=>Ll,html:()=>hs,i:()=>ql,iframe:()=>mu,img:()=>uu,input:()=>zu,ins:()=>Nu,isBatching:()=>jc,isClient:()=>hi,isSSR:()=>ne,isServer:()=>ve,kbd:()=>Ul,label:()=>Fu,lazy:()=>Ri,lazyIsland:()=>Zd,legend:()=>Wu,li:()=>Ml,lifecycleScope:()=>Pd,line:()=>lc,linearGradient:()=>Sc,link:()=>rc,longPress:()=>Gi,main:()=>bl,map:()=>cu,mark:()=>Kl,marker:()=>Tc,marquee:()=>Ac,mask:()=>bc,match:()=>Sd,math:()=>xu,menu:()=>Zu,meta:()=>oc,meter:()=>Vu,mount:()=>Md,mountIslands:()=>nf,nav:()=>hl,nextTick:()=>lf,noscript:()=>Eu,object:()=>gu,ol:()=>Ol,on:()=>Ic,onCleanup:()=>Hc,onMount:()=>xn,onUnmount:()=>Pc,optgroup:()=>ju,option:()=>qu,output:()=>Uu,p:()=>Cr,param:()=>hu,path:()=>uc,pattern:()=>yc,pendingContent:()=>ws,picture:()=>bu,polygon:()=>cc,polyline:()=>dc,portal:()=>yu,pre:()=>Rr,progress:()=>Ku,q:()=>Jl,radialGradient:()=>vc,reactiveArray:()=>Bd,rect:()=>fc,ref:()=>Wd,registerAction:()=>Mt,registerComponent:()=>xd,registerDisposer:()=>R,registerIsland:()=>Qd,replaceChildrenSafely:()=>Me,reportDrainRunaway:()=>Fe,reportError:()=>O,resolveComponent:()=>Ed,retrack:()=>qe,rp:()=>Gl,rt:()=>Yl,ruby:()=>Xl,runInSSRContext:()=>Si,s:()=>Zl,samp:()=>Ql,scopeOwner:()=>Qr,script:()=>Tu,section:()=>fl,select:()=>Ju,setGlobalErrorHandler:()=>ad,setMaxDrainIterations:()=>ai,setRuntimeErrorHandler:()=>uo,show:()=>fd,signal:()=>z,slot:()=>ec,small:()=>eu,source:()=>Su,span:()=>J,stop:()=>xc,store:()=>Vd,strict:()=>qd,strictEffect:()=>Ud,strong:()=>tu,style:()=>dt,sub:()=>nu,summary:()=>Qu,sup:()=>ru,svg:()=>vu,symbol:()=>Ec,table:()=>Ru,tagFactory:()=>p,takePendingError:()=>yn,tbody:()=>Lu,td:()=>Mu,template:()=>tc,text:()=>pc,textarea:()=>Gu,tfoot:()=>Ou,th:()=>Du,thead:()=>Pu,time:()=>ou,title:()=>dl,tr:()=>Hu,track:()=>du,transition:()=>af,trapFocus:()=>Zi,trustHTML:()=>Ls,tspan:()=>mc,u:()=>iu,ul:()=>Dl,unregisterComponent:()=>wd,unregisterDisposer:()=>Xe,unregisterIsland:()=>ef,untracked:()=>Ce,use:()=>wc,var_:()=>su,video:()=>fu,watch:()=>Zr,when:()=>Kr,withSSR:()=>xi,writable:()=>jd});var lo=Symbol.for("sibujs.runtime-errors.v1");function zn(){let e=globalThis,t=e[lo];if(t)return t;let n={handler:null,handlerDepth:0};return e[lo]=n,n}function uo(e){let t=zn(),n=t.handler;return t.handler=e,n}function co(){return zn().handler}function Fn(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Ps(e)}`;return new Error(t,{cause:e})}function Ps(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 Hs(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Is=Symbol.for("sibujs.reactive.v1");function $s(e){let t=globalThis[Is];return t?.untracked?t.untracked(e):e()}var Bs="sibu:error-propagate";function zs(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Fs(n);if(!r)return!1;try{let o=new CustomEvent(Bs,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Fs(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 Ws(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Hs(t)}: ${e.message}`,e)}function Vs(){let e=globalThis[Symbol.for("sibujs.ssr.v1")];return e?(e.als?e.als.getStore():e.fallbackDepth>0?e.fallbackStore:void 0)?.errors:void 0}function O(e,t){let n=Fn(e);$s(()=>{if(zs(n,t))return;let r=Vs();if(r){r.push({error:n,context:t});return}let o=zn(),i=o.handler;if(i&&o.handlerDepth===0){o.handlerDepth++;try{i(e instanceof Error?e:n,t);return}catch(s){if(typeof console<"u"){let a=s instanceof Error?s.message:String(s);console.error(`[SibuJS] runtime error handler itself threw: ${a}`,s)}}finally{o.handlerDepth--}}Ws(n,t)})}function me(e,t){let n=globalThis;return n[e]??(n[e]=t())}function we(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var ze=null;function fo(){return ze?.s.on===!0}function po(){return ze?.s.on?ze.s:null}function Ht(e,t){let n=ze;if(n?.s.on){let r=n.s.el(e,t,n.p+(n.n++).toString(36));if(r)return r}return t?document.createElementNS(t,e):document.createElement(e)}function Re(){let e=ze;return e?.s.on?{p:`${e.p}${(e.n++).toString(36)}.`,n:0,s:e.s}:null}function mo(e,t){if(!e?.s.on)return null;let n=typeof t;if(n!=="string"&&n!=="number")throw new TypeError(`[SibuJS] adopt: a key must be a string or a number, not ${n}`);let r=String(t).replace(/[^\w-]/g,o=>`~${o.charCodeAt(0).toString(16).padStart(4,"0")}`);return{p:`${e.p}${n==="string"?"_":"-"}${r}.`,n:0,s:e.s}}function ae(e,t){let n=ze;if(!e&&!n)return t();ze=e?.s.on?{p:e.p,n:0,s:e.s}:null;try{return t()}finally{ze=n}}var go,Wn=globalThis[go=Symbol.for("sibujs.hydration.v2")]??(globalThis[go]={a:new Set,c:null});function Ee(){return Wn.a.size>0}function js(){return po()?.h??Wn.c}function Vn(){let e=js();return e?e.open?[e]:[]:Array.from(Wn.a)}function ho(e){let t=Vn(),n=t.length,r=()=>{--n<1&&e()};if(n)for(let o of t)o.done.push(r);else e()}function qs(e){for(let t of Array.from(e.wake))t()}function bo(e,t){for(let n of e)n.pending.add(t);return()=>{for(let n of e)n.pending.delete(t)&&qs(n)}}var jn=me(Symbol.for("sibujs.disposers.v1"),()=>({disposers:new WeakMap,captures:[],bindings:{count:0}})),Te=jn.disposers,Le=1e4;function Fe(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 Ye=jn.bindings;function Jt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var le=jn.captures;function yo(){return Jt(le[le.length-1])}function So(e){return e===null&&le.length===0?!1:(le.push(Jt(e)),!0)}function vo(){le.pop()}function R(e,t){let n=Te.get(e);n||(n=[],Te.set(e,n)),n.push(t),!1;let r=Jt(le[le.length-1]);r&&r.entries.push([e,t])}function bt(e){let t={entries:[],closed:!1},n=t.entries;le.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=Le){Fe("rollback",s,n.length);break}let[a,l]=n.pop();if(Xe(a,l)){s++;try{l()}catch(u){O(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,le.pop()}throw i}t.closed=!0,le.pop();let o=Jt(le[le.length-1]);if(o){for(let i of n)Te.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function Xe(e,t){let n=Te.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),!1,n.length===0&&Te.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--)qn(n[r])}function qn(e){if(!Te.has(e))return;let t=0,n=!1;for(;!n;){let r=Te.get(e);if(!r||r.length===0)break;let o=r.slice();Te.delete(e),!1;for(let i=0;i<o.length;i++){if(t>=Le){let s=o.slice(i),a=Te.get(e);Te.set(e,a?s.concat(a):s),!1,Fe("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){O(s,{phase:"cleanup",name:"disposer"})}}}}function Me(e,...t){if(Ee()&&t.length>0&&t[0]===e.firstChild){let r=!0;for(let o=1;o<t.length&&r;o++)r=t[o-1].nextSibling===t[o];if(r){let o=t[t.length-1].nextSibling;for(;o;){let i=o.nextSibling;D(o),e.removeChild(o),o=i}return}}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 Un(e,t){let n=new Set,r=()=>{if(!Ee()||t.length===0||t[0]!==e.firstChild)return!1;for(let i=1;i<t.length;i++)if(t[i-1].nextSibling!==t[i])return!1;return!0},o=()=>{if(r()){let i=[];for(let s=t[t.length-1].nextSibling;s!==null;s=s.nextSibling)i.push(s);return i}for(let i=0;i<t.length;i++)t[i].parentNode?.removeChild(t[i]);return Array.from(e.childNodes)};return{teardown:()=>{let i=!1;for(let s of o())n.has(s)||(n.add(s),i=!0,D(s));return i},insert:()=>{if(!r()){e.replaceChildren(...t);return}let i=t[t.length-1];for(;i.nextSibling;)e.removeChild(i.nextSibling)}}}function xo(e=0){return 0}function yt(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Us=/[A-Z]/,Ks=/[A-Z]/g;function ue(e){return Us.test(e)?e.replace(Ks,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function We(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 Js=["http:","https:","mailto:","tel:","ftp:"],Gs=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function Yt(e){let t=yt(e).trim();if(!t)return"";let n=e.replace(Gs,"");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)&&Js.indexOf(i)===-1?"":n}var Ys=/^\d+(\.\d+)?[wx]$/;function Kn(e){return e===" "||e===" "||e===`
2
+ `||e==="\r"||e==="\f"}function Xs(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(Kn(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!Kn(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let u="",c=!1;for(;r<o;){let g=t[r];if(c){u+=g,g===")"&&(c=!1),r++;continue}if(Kn(g)){u&&a.push(u),u="",r++;continue}if(g===","){r++;break}g==="("&&(c=!0),u+=g,r++}u&&a.push(u)}if(s===""||a.length>1||a.length===1&&!Ys.test(a[0]))continue;let l=Yt(s);l&&(l.startsWith(",")||l.endsWith(",")||n.push(a.length===1?`${l} ${a[0]}`:l))}return n.join(", ")}var Zs=/[(:@\\]/;function Qs(e){return e===" "||e===" "||e===`
3
+ `||e==="\r"||e==="\f"}function wo(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function ea(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(er(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&er(e[s]);)i+=e[s],s++;s<e.length&&ki(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
6
- `?2:1);let a=Number.parseInt(i,16),l=a===0||a>1114111||a>=55296&&a<=57343;t+=l?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var tr=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],_i=4,Ci=5,Ni=8;function Ri(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 Ft=new Set,nr=100,rr=!1;function dt(e,t,n){}function or(e){return(e.includes("\\")?Ai(e):e).toLowerCase().replace(/\s+/g,"")}function zt(e){if(!wi.test(e))return-1;let t=or(e);for(let n=0;n<tr.length;n++)if(t.includes(tr[n]))return n;return-1}function pt(e,t,n){let r=jt(e,t);return r===-1?t:(dt(t,r,{property:e,element:n?.element}),"")}function jt(e,t){let n=zt(t);if(n!==-1)return n;let r=K(e);return r==="behavior"?Ci:r==="-moz-binding"?_i:(r==="filter"||r==="-ms-filter")&&or(t).includes("progid:")?Ni:-1}function Li(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 l=e.indexOf("*/",s+2);if(l===-1)return null;s=l+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 l=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(l))continue;let c=s.slice(a+1).trim(),u=/!\s*important\s*$/i.exec(c);if(u&&(c=c.slice(0,u.index).trim()),c==="")continue;let f=l.startsWith("--")?l:K(l);i.push([f,c,u!==null])}return i}function Mi(e,t){let n=String(e),r=Li(n);if(r===null)return zt(n)!==-1&&dt(n,zt(n),t),"";let o=[];for(let[i,s,a]of r){let l=jt(i,s);if(l!==-1){dt(s,l,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function mt(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return Mi(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),l=jt(s,a);if(l!==-1){dt(a,l,{property:s,element:t?.element});continue}let c=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${c?` !${c}`:""}`)}return o.join("; ")}var Wt=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),Oi=new Set(["srcdoc"]);function Xe(e){return Oi.has(e.toLowerCase())}function ir(e){return Wt.has(e.toLowerCase())}function Di(e){let t=e.toLowerCase();return t==="style"||Wt.has(t)}function Hi(e,t,n){let r=e.toLowerCase();return r==="srcset"?Ti(t):Wt.has(r)?ft(t):r==="style"?mt(t,n):t}function sr(e,t,n){if(!Di(e))return t;let r=Hi(e,t,n);return r===""?null:r}function we(e){return e===" "||e===" "||e===`
7
- `||e==="\r"||e==="\f"}function gt(e){let t=0,n=e.length;for(;t<n&&we(e[t]);)t++;for(;n>t&&we(e[n-1]);)n--;return e.slice(t,n)}var J=e=>({kind:"forbidden",reason:e});function Pi(e){let t=gt($e(e));if(t==="")return J("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return J("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return J("");for(;n<t.length&&we(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return J("");for(n++;n<t.length&&we(t[n]);)n++;let o=n;for(;n<t.length&&!we(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return J("");for(;n<t.length&&we(t[n]);)n++;if(t[n]!=="=")return J("");for(n++;n<t.length&&we(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let c=t.indexOf(a,n+1);if(c===-1)return J("");if(s=t.slice(n+1,c),gt(t.slice(c+1))!=="")return J("")}else if(s=gt(t.slice(n)),/[;,]/.test(s))return J("");if(s==="")return J("");let l=ft(s);return l===""?J(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function Vt(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(""):typeof t!="string"?{kind:"not-refresh"}:gt($e(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:Pi(n)}var $i="http://www.w3.org/1999/xhtml",Ii="http://www.w3.org/2000/svg",Bi=new Set(["script","iframe","object","embed","frame","frameset"]);function lr(e){return K(e)}function cr(e){return Bi.has(lr(e))}var Fi=new Set(["script","style"]);function ur(e){return Fi.has(lr(e))}var M={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},zi=new Set(["src","href","xlink:href","type","language"]),ji=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),qt=new WeakSet;function dr(e){return e.namespaceURI===$i||e.namespaceURI===null}function fr(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 Wi(e){qt.has(e)||(qt.add(e),e.getAttribute("content")!==null&&Vt(fr(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function Vi(e,t,n,r){if(!dr(e))return M.None;let o=K(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&Wi(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return M.None;let i=Vt(fr(e,o,n));return i.kind==="forbidden"?M.MetaRefreshForbidden:i.kind!=="not-refresh"&&qt.has(e)?M.MetaRefreshReactive:M.None}function qi(e,t){if(t===null||K(e)!=="attributename")return M.None;let n=$e(t);return ir(n)||he(n)||Xe(n)?M.AnimationTarget:M.None}var bt=new WeakSet;function ar(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 Ui(e,t,n,r){if(!dr(e))return M.None;let o=K(t);return o==="href"?r==="static"||n===null?M.None:ar(e.getAttribute("rel"))?M.StylesheetSource:(bt.add(e),M.None):o==="rel"&&ar(n)&&bt.has(e)&&e.hasAttribute("href")?M.StylesheetSource:M.None}function Ut(e,t,n,r){let o=e.localName;return o==="meta"?Vi(e,t,n,r):o==="link"?Ui(e,t,n,r):o==="script"?r==="static"||n===null?M.None:zi.has(K(t))?M.ScriptSource:M.None:ji.has(o)&&e.namespaceURI===Ii?qi(t,n):M.None}function Kt(e,t,n){e.localName!=="link"||K(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?bt.add(e):bt.delete(e))}var Ki="http://www.w3.org/1999/xhtml",Ji="http://www.w3.org/2000/svg",Gi="http://www.w3.org/1999/xlink",Yi="http://www.w3.org/XML/1998/namespace",Zi=new Set(["checked","disabled","selected"]);function Xi(e){return e.namespaceURI===null||e.namespaceURI===Ki}function mr(e,t,n){}function pr(e,t,n){e[t]=n}function Qi(e,t){if(e.namespaceURI!==Ji)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Gi:n.startsWith("xml:")?Yi:null}function X(e,t,n,r={}){let o=es(e,t,n,r);return e.localName==="link"&&Kt(e,t,r.reactive?"reactive":"runtime"),o}function es(e,t,n,r){let o=Qi(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(he(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Ut(e,t,s,r.reactive?"reactive":"runtime");if(a!==M.None)return mr(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(Xe(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let l=Xi(e),c=l?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let g=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==g&&(o?e.setAttributeNS(o,t,g):e.setAttribute(t,g)),!0}return l&&Zi.has(c)&&c in e?pr(e,c,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let u=String(n);if(r.syncValueProperty!==!1&&l&&(c==="value"||c==="checked")&&c in e)return pr(e,c,c==="checked"?!!n:u),!0;let f=u===""?"":sr(t,u,{element:e});return f===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===f||(o?e.setAttributeNS(o,t,f):e.setAttribute(t,f)),!0)}function Jt(e,t,n){if(Xe(t))return!1,!1;let r=Ut(e,t,n,"static");return r!==M.None?(mr("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Kt(e,t,"static"),!0)}var ts=4096,Gt=[];function ns(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function rs(e,t,n){let r=Gt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=ns();return o.sig=e,o.sub=t,o.epoch=n,o}function gr(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Gt.length<ts&&Gt.push(e)}function os(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 br(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 is(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function ss(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,le=null,ye=0,Se=[],B=new Set,as=[];function ls(e){try{e()}catch(t){let n=e;w(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function cs(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 Zt(){ie===0&&(le=Q,Q=null,ce=!0),ie++}function Xt(){ie--,ie===0&&(Q=le,le=null,ce=!1)}function hr(){return ce}function yr(e){Zt();try{return e()}finally{Xt()}}var G=null;function Qt(){return G}function vt(e,t){let n=G;G=e;try{return t()}finally{G=n}}function en(e){let t=G;return t===null?e:(...n)=>vt(t,()=>e(...n))}var Ie=null,us=0;function tn(e,t){let n=Q,r=0,o=null;ce&&(r=ie,o=le,ie=0,le=null,ce=!1),Q=t;let i=t;i._cap===void 0&&(i._cap=Gn());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 l=Ie;l!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=l),i._tok!=null&&(Ie=i._tok);let c=++us;i._epoch=c,i._structDirty=!1;for(let u=i.depsHead??null;u!==null;u=u.subNext){let f=u.sig;u.prevActive=f.__activeNode??null,f.__activeNode=u}try{e()}finally{Q=n,G=s,Ie=l,r!==0&&(ie=r,le=o,ce=!0);let u=i.depsHead??null;for(;u!==null;){let f=u.subNext,m=u.sig;m.__activeNode=u.prevActive,u.prevActive=null,u.epoch!==c&&(ss(u),br(u),gr(u)),u=f}}}function Sr(e,t){if(!t)return nn(e);Be(t);let n=Q,r=0,o=null;ce&&(r=ie,o=le,ie=0,le=null,ce=!1),Q=t;let i=t;i._scope===void 0&&(i._scope=G);let s=G;G=i._scope;try{e()}finally{Q=n,G=s,r!==0&&(ie=r,le=o,ce=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let l=a.sig;l.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>Be(t))}function nn(e,t,n){return xr(e,t,n===!0)._dispose}function vr(e,t){let n=xr(e,t,!0);return{stop:n._dispose,run:r=>{let o=Ie;Ie=n._tok??null;try{return r()}finally{Ie=o}}}}function xr(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{tn(e,o)}finally{i._reentrant=!1}}},o=r;o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._runEpoch=0,o._runs=0,o._reentrant=!1,o._disposed=!1,o._errorPhase="binding",o._errorNode=t,o._tok=null,o._owner=null,n&&(o._tok={sub:o});try{r()}catch(i){throw o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Be(o),i}return o._dispose=()=>{o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Be(o)},o}function Er(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=rs(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,is(t,i),os(n,i),t._structDirty=!0}function Be(e){let t=e;t._owner!=null&&(t._owner=null);let n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;br(n),gr(n),n=r}}var ht=1e3,yt=1e6,St=0,ke=new Set;function Tr(e){let t=ht;return Number.isFinite(e)&&e>0&&(ht=Math.floor(e)),t}function wr(e){let t=yt;return Number.isFinite(e)&&e>0&&(yt=Math.floor(e)),t}function ds(e){let t=e;return t._runEpoch!==St?(t._runEpoch=St,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>ht)}function fs(e){let t=e.__name??"<unnamed>";w(new Error(`subscriber "${t}" fired more than ${ht} 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 ps(){w(new Error(`Notification drain exceeded ${yt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function kr(){let e=0;for(;e<Se.length;){if(e>=yt){ps();break}let t=Se[e++];B.delete(t)&&(t._owner!=null&&B.size>0&&(ms(t),B.has(t))||Ar(t))}}function ms(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;B.has(r)&&(t=r),n=r._owner??null}if(t===null)return;B.delete(t),Ar(t)}}function Ar(e){if(ke.size>0&&ke.has(e)||e._hasComputedDep===!0&&!cs(e))return;if(ds(e)){fs(e),ke.add(e);return}let t=Yn(e._cap??null);try{ls(e)}finally{t&&Zn()}}function _r(){if(!(ye>0)){ye++,St++;try{kr()}finally{ye--,ye===0&&(Se.length=0,B.clear(),ke.size>0&&ke.clear())}}}function Yt(e){e();let t=e._sig;if(!t)return;let n=as,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 B.has(s)||(B.add(s),Se.push(s));i=i.sigNext}}}function Cr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Yt(r):B.has(r)||(B.add(r),Se.push(r))),n=n.sigNext}}function Nr(e){let n=e.subsHead;if(n){if(ye>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Yt(o):B.has(o)||(B.add(o),Se.push(o))),r=r.sigNext}return}ye++,St++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Yt(o):B.has(o)||(B.add(o),Se.push(o))),r=r.sigNext}kr()}finally{ye--,ye===0&&(Se.length=0,B.clear(),ke.size>0&&ke.clear())}}}function Rr(e){return e.__sc??0}function Lr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function Mr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var Or="4.14.1",Dr=Symbol.for("sibujs.reactive.v1");function bs(){let e=globalThis,t=e[Dr];if(t)return!1,t;let n={suspendTracking:Zt,resumeTracking:Xt,isTrackingSuspended:hr,untracked:yr,retrack:tn,track:Sr,reactiveBinding:nn,recordDependency:Er,cleanup:Be,setMaxSubscriberRepeats:Tr,setMaxDrainIterations:wr,drainNotificationQueue:_r,queueSignalNotification:Cr,notifySubscribers:Nr,getSubscriberCount:Rr,getSubscriberDeps:Lr,forEachSubscriber:Mr,getOwnerScope:Qt,runWithOwnerScope:vt,bindOwnerScope:en,structuralBinding:vr,version:Or};return e[Dr]=n,n}var O=bs(),Ae=O.suspendTracking,_e=O.resumeTracking,Hr=O.isTrackingSuspended,ee=O.untracked,ve=O.retrack,Fe=O.track,$=O.reactiveBinding,Ce=O.recordDependency,Ne=O.cleanup,Pu=O.setMaxSubscriberRepeats,Pr=O.setMaxDrainIterations,$r=O.drainNotificationQueue,Ir=O.queueSignalNotification,ze=O.notifySubscribers,$u=O.getSubscriberCount,Iu=O.getSubscriberDeps,Bu=O.forEachSubscriber,je=O.getOwnerScope??Qt,xt=O.runWithOwnerScope??vt,z=O.bindOwnerScope??en,Re=O.structuralBinding??((e,t)=>({stop:O.reactiveBinding(e,t),run:n=>n()}));function Qe(e,t,n){if(he(t))return X(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){w(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}X(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return $(r,e)}function Br(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){w(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){w(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),X(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=$(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var rn=["data-focus-key","id","name"],hs=new Set(["text","search","url","tel","password",""]);function ys(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&hs.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 et(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<rn.length;i++){let s=t.getAttribute(rn[i]);if(s){r=rn[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...ys(t)}}function Ss(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function vs(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 l=0;l<a.length;l++)r++,n??(n=a[l]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function Fr(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 We(e,t,n,r){if(!e||typeof document>"u"||r==="discard")return;let o=document.activeElement;if(o===e.el||o&&o!==document.body&&o!==document.documentElement)return;if(e.el.isConnected){Fr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=vs(t,`[${e.attr}=${Ss(e.value)}]`);if(s&&s.tagName===e.tag){Fr(s,e);return}i=a>1}if(r!==void 0&&typeof r=="object"){let s=typeof r.restoreTo=="function"?r.restoreTo():r.restoreTo;if(s?.isConnected&&(s.focus(),document.activeElement===s))return}}function ue(e,t){let n=[],r=re();function o(){let i;try{i=F(r,t)}catch(f){w(f,{phase:"binding",name:"bindChildNode",node:e});return}let s=et(n);if(i==null||typeof i=="boolean"){for(let f=0;f<n.length;f++){let m=n[f];L(m),m.parentNode&&m.parentNode.removeChild(m)}n.length=0,We(s,n,"bindChildNode");return}let a=e.parentNode;if(!a){n.length=0;return}let l;if(Array.isArray(i)){l=[];let f=new Set;for(let m=0;m<i.length;m++){let g=i[m];if(g==null||typeof g=="boolean")continue;let p=g instanceof Node?g:document.createTextNode(String(g));if(f.has(p)){!1;continue}f.add(p),l.push(p)}}else l=[i instanceof Node?i:document.createTextNode(String(i))];let c;if(n.length>0&&l.length>0){let f=new Set(n);c=new Set;for(let m=0;m<l.length;m++)f.has(l[m])&&c.add(l[m])}for(let f=0;f<n.length;f++){let m=n[f];c?.has(m)||(L(m),m.parentNode&&m.parentNode.removeChild(m))}let u=e;for(let f=0;f<l.length;f++){let m=l[f];u.nextSibling!==m&&a.insertBefore(m,u.nextSibling),u=m}n=l,We(s,l,"bindChildNode")}return $(o,e,!0)}function on(){throw new Error("[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first.")}function W(){typeof document>"u"&&on()}var R="http://www.w3.org/2000/svg",xs=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var sn=new Set,zr=100,jr=!1,Wr=new Map;function Vr(e){let t=Wr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Wr.set(e,t)),t}function Es(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=$(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",mt(String(a),{element:e}));return}let l=e.style;i&&(e.removeAttribute("style"),i=!1);let c=[];for(let u in a){if(!Object.hasOwn(a,u))continue;let f=a[u];if(f==null)continue;let m=Vr(u);c.push(m),l.setProperty(m,pt(m,String(f),{element:e}))}for(let u=0;u<o.length;u++)c.indexOf(o[u])===-1&&l.removeProperty(o[u]);o=c},e);E(e,s);return}if(typeof t=="string"){e.setAttribute("style",mt(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Vr(r);if(typeof o=="function"){let s=o,a=$(()=>{n.style.setProperty(i,pt(i,String(s()),{element:e}))},e);E(e,a)}else n.style.setProperty(i,pt(i,String(o),{element:e}))}}function Ts(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=$(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);E(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=$(()=>{let a="";for(let l in n){if(!Object.hasOwn(n,l))continue;let c=n[l];(typeof c=="function"?c():c)&&(a=a?`${a} ${l}`:l)}e.setAttribute("class",a)},e);E(e,s)}else e.setAttribute("class",o)}function an(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),E(e,ue(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),E(e,ue(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),E(e,ue(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=cr(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&on();let i=Ye(e,t);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),an(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return an(i,r),i;let s=r,a=s.class;a!=null&&Ts(i,a);let l=s.id;typeof l=="function"?E(i,Qe(i,"id",l)):l!=null&&(!1,i.id=l);let c=o!==void 0?o:s.nodes;c!=null&&an(i,c);let u=s.on;if(u)for(let g in u){if(!Object.hasOwn(u,g))continue;let p=u[g];typeof p=="function"?i.addEventListener(g,p):!1}let f=s.style;f!=null&&Es(i,f);let m=s.ref;m&&(m.current=i);for(let g in s)switch(g){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,g))continue;let p=s[g];if(p==null||he(g))continue;typeof p=="function"?E(i,Qe(i,g,p)):X(i,g,p,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var dd=d("html"),ws=d("head"),ks=d("body"),As=d("title"),_=d("div"),H=d("span"),_s=d("section"),Cs=d("article"),Ns=d("header"),Rs=d("footer"),Ls=d("nav"),Ms=d("main"),Os=d("aside"),Ds=d("address"),ln=d("p"),Hs=d("h1"),Ps=d("h2"),cn=d("h3"),$s=d("h4"),Is=d("h5"),Bs=d("h6"),Fs=d("blockquote"),zs=d("dd"),js=d("dl"),Ws=d("dt"),Vs=d("figcaption"),qs=d("figure"),Us=d("hr"),Ks=d("li"),Js=d("ol"),Gs=d("ul"),un=d("pre"),Ys=d("a"),Zs=d("abbr"),Xs=d("b"),Qs=d("bdi"),ea=d("bdo"),ta=d("br"),na=d("cite"),dn=d("code"),ra=d("data"),oa=d("dfn"),ia=d("em"),sa=d("i"),aa=d("kbd"),la=d("mark"),ca=d("q"),ua=d("rp"),da=d("rt"),fa=d("ruby"),pa=d("s"),ma=d("samp"),ga=d("small"),ba=d("strong"),ha=d("sub"),ya=d("sup"),Sa=d("time"),va=d("u"),xa=d("var"),Ea=d("area"),Ta=d("audio"),wa=d("img"),ka=d("map"),Aa=d("track"),_a=d("video"),Ca=d("embed"),Na=d("iframe"),Ra=d("object"),La=d("param"),Ma=d("picture"),Oa=d("portal"),Da=d("source"),Ha=d("svg",R),Pa=d("math"),$a=d("canvas"),Ia=d("noscript"),Ba=d("script"),Fa=d("del"),za=d("ins"),ja=d("caption"),Wa=d("col"),Va=d("colgroup"),qa=d("table"),Ua=d("tbody"),Ka=d("td"),Ja=d("tfoot"),Ga=d("th"),Ya=d("thead"),Za=d("tr"),tt=d("button"),Xa=d("datalist"),Qa=d("fieldset"),el=d("form"),tl=d("input"),nl=d("label"),rl=d("legend"),ol=d("meter"),il=d("optgroup"),sl=d("option"),al=d("output"),ll=d("progress"),cl=d("select"),ul=d("textarea"),dl=d("details"),fl=d("dialog"),pl=d("menu"),ml=d("summary"),gl=d("slot"),bl=d("template"),hl=d("base"),yl=d("link"),Sl=d("meta"),Le=d("style"),vl=d("circle",R),xl=d("ellipse",R),El=d("g",R),Tl=d("line",R),wl=d("path",R),kl=d("polygon",R),Al=d("polyline",R),_l=d("rect",R),Cl=d("text",R),Nl=d("tspan",R),Rl=d("defs",R),Ll=d("clipPath",R),Ml=d("mask",R),Ol=d("pattern",R),Dl=d("linearGradient",R),Hl=d("radialGradient",R),Pl=d("stop",R),$l=d("use",R),Il=d("symbol",R),Bl=d("marker",R),Fl=d("center"),zl=d("font"),jl=d("marquee"),Wl=e=>d(e);var qr,fn=globalThis[qr=Symbol.for("sibujs.streamBoundary.v1")]??(globalThis[qr]={hook:null,current:null});function Ur(e){return fn.hook?fn.hook(e):null}function Et(){return fn.current}var pn=Symbol.for("sibujs.ssr.v1");function Vl(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,r=process.getBuiltinModule;typeof r=="function"?n=r("node:async_hooks"):typeof Dt=="function"&&(n=Dt("async_hooks")),n&&(e=new n.AsyncLocalStorage)}let t=globalThis.AsyncLocalStorage;!e&&typeof t=="function"&&(e=new t)}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var xe=globalThis[pn]??(globalThis[pn]=Vl()),Oe=xe.als,Me=xe.fallbackStore;xe.fallbackDepth??(xe.fallbackDepth=0);var Kr=!1;function ql(){if(Kr||Oe||!(typeof process<"u"&&!!process.versions?.node))return;Kr=!0;let t=process.versions.node;`${t}`}function Ee(){if(Oe){let e=Oe.getStore();if(e)return e}return Me}function mn(){return Oe?Oe.getStore()??null:xe.fallbackDepth>0?Me:null}function j(){return Ee().ssr}function Jr(e){if(!j())return null;let t=Ee(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}var Ul=Symbol.for("sibujs.prerender.v1");function nt(){return Ee().ssr||globalThis[Ul]!==void 0}function Gr(){return!nt()}function Yr(){Ee().ssr=!0}function Zr(){Ee().ssr=!1}function Xr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0,pending:new Set,wake:null};if(Oe)return Oe.run(t,e);ql();let n={...Me};Object.assign(Me,t),xe.fallbackDepth++;try{return e()}finally{xe.fallbackDepth--;for(let r of Object.keys(Me))r in n||delete Me[r];Object.assign(Me,n)}}function Qr(e,t,n=!0){let r=mn(),o=r?.pending,i=o||!n?[]:It();if(!o&&i.length===0)return e;let s={label:t,since:Date.now(),boundary:Et()??void 0};o?.add(s);let a=Jn(i,s),l=()=>{o?.delete(s),r?.wake?.(),a()};try{Promise.resolve(e).then(l,l)}catch{l()}return e}function eo(e){let t=Ee(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var gn="__sibuPendingError";function to(e,t){let n=()=>e.parentNode?(w(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[gn]=t)})}function Tt(e){let t=e,n=t[gn];if(n instanceof Error)return delete t[gn],n}function no(e){let t=null;return function(){if(t&&!Wn())return t();let r=_({class:"sibu-lazy"}),o=re(),i=Et(),s=!1,a=F(null,()=>H("sibu-lazy-loading","Loading..."));if(t){let l=t;return U(r,F(o,()=>l())),r}return Qr(e(),"lazy").then(z(l=>{if(s)return;t=l.default;let c=t,u=()=>F(o,()=>c()),f=i?i.enter(u):u();U(r,f)})).catch(l=>{if(s)return;let c=l instanceof Error?l:new Error(String(l));U(r,_({class:"sibu-lazy-error"},`Failed to load component: ${c.message}`)),to(r,c)}),se()&&r.firstChild||r.appendChild(a),E(r,()=>{s=!0}),r}}function ro({nodes:e,fallback:t}){let n=_({class:"sibu-suspense"}),r=re(),o=Ur(n),i=f=>{U(n,f),o?.done()},s=F(null,t);se()&&n.firstChild?L(s):n.appendChild(s);let a=!1,l=null,c=null;E(n,()=>{a=!0,l&&(l.disconnect(),l=null),c&&!n.contains(c)&&L(c)});let u=z(()=>{if(!a)try{let f=o?o.enter(()=>F(r,e)):F(r,e);if(c=f,f.classList.contains("sibu-lazy")){if(!f.querySelector(".sibu-lazy-loading")){i(f);return}l=new MutationObserver(()=>{if(a)return;f.querySelector(".sibu-lazy-loading")||(l?.disconnect(),l=null,i(f))}),l.observe(f,{childList:!0,subtree:!0})}else i(f)}catch(f){let m=f instanceof Error?f:new Error(String(f));to(n,m)}});return queueMicrotask(u),n}function Sn(e,t){return()=>je()===e?t():xt(e,t)}function kt(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";w(n,{phase:r,name:t});return}}function bn(e,t,n,r,o){let i=kt(e,t);if(typeof i!="function")return;let s=Sn(o,i);r()||!n.isConnected?kt(s,"onUnmount"):io(s,n)}var Ve=new WeakMap,De=new WeakMap,de=new Set,fe=new Set,qe=null,wt=0,Kl=256;function hn(e){let t=Ve.get(e);if(t){Ve.delete(e),de.delete(e);for(let n of t)try{n()}catch{}}}function yn(e){De.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=De.get(e);if(n){De.delete(e),fe.delete(e);for(let r of n)try{r()}catch{}}})}function Jl(e){if(de.size===0||e.nodeType!==1)return;let t=e;if(de.has(t)&&t.isConnected&&hn(t),t.firstElementChild)for(let n of Array.from(de))n!==t&&n.isConnected&&t.contains(n)&&hn(n)}function Gl(e){if(fe.size===0||e.nodeType!==1)return;let t=e;if(fe.has(t)&&!t.isConnected&&yn(t),t.firstElementChild)for(let n of Array.from(fe))n!==t&&!n.isConnected&&t.contains(n)&&yn(n)}function Yl(){if(de.size>0)for(let e of Array.from(de))e.isConnected&&hn(e);if(fe.size>0)for(let e of Array.from(fe))e.isConnected||yn(e)}function oo(){qe||typeof document>"u"||(qe=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++)Jl(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)Gl(t.removedNodes[n])}wt+=e.length,wt>=Kl&&(wt=0,Yl()),vn()}),qe.observe(document.body,{childList:!0,subtree:!0}))}function vn(){qe&&de.size===0&&fe.size===0&&(qe.disconnect(),qe=null,wt=0)}function Zl(e,t){let n=Ve.get(e);return n||(n=[],Ve.set(e,n)),n.push(t),de.add(e),oo(),()=>{let r=Ve.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ve.delete(e),de.delete(e))}vn()}}function Xl(e,t){let n=De.get(e);return n||(n=[],De.set(e,n)),n.push(t),fe.add(e),oo(),()=>{let r=De.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(De.delete(e),fe.delete(e))}vn()}}function At(e,t){if(typeof document>"u"||j())return;let n=je();if(e=Sn(n,e),t){let r=!1,o=()=>r;if(E(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||bn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){bn(e,"onMount",t,o,n);return}let i=Zl(t,()=>{r||bn(e,"onMount",t,o,n)});E(t,i)})}else queueMicrotask(()=>{kt(e,"onMount")})}function Ql(e,t){typeof document>"u"||j()||io(Sn(je(),e),t)}function io(e,t){let n=!1,r=()=>{n||(n=!0,kt(e,"onUnmount"))};E(t,r);let o=()=>{if(n)return;let i=Xl(t,r);E(t,i)};t.isConnected?o():At(()=>{o()},t)}function ec(e,t){E(t,e)}function Y(e,t,n){try{e.emit(t,n)}catch{}}var co=globalThis;function tc(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 so=100;function _t(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===je()?ao(t):xt(n,()=>ao(t))}function ao(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){w(n,{phase:"cleanup"})}}function lo(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&_t(e),ve(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=so);e.rerunPending&&(e.rerunPending=!1,w(new Error(`effect re-requested itself ${so}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function nc(e){if(e.disposed)return;e.disposed=!0;let t=co.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&_t(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Ne(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function Z(e,t){if(j()&&!t?.server)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&&_t(n),ve(n.bodyFn,o),n.rerunPending&&lo(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&&lo(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&_t(n),Ne(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=co.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&Y(i,"effect:create",{effectFn:e}),()=>nc(n)}var rt=0,xn=new Set;function rc(e){rt++;try{return e()}finally{rt--,rt===0&&sc()}}function oc(e){return rt===0?!1:(xn.add(e),!0)}function ic(){return rt>0}function sc(){try{for(let e of xn)Ir(e)}finally{xn.clear()}$r()}var uo=Symbol.for("sibujs.reactive.batch.v1");function ac(){let e=globalThis,t=e[uo];if(t)return t;let n={batch:rc,enqueueBatchedSignal:oc,isBatching:ic};return e[uo]=n,n}var En=ac(),V=En.batch,He=En.enqueueBatchedSignal,lc=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=void 0,o=t?.equals;r&&(n.__name=r);function i(){return Ce(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let l=n.value,c=typeof a=="function"?a(l):a;if(!o(l,c)){if(n.value=c,n.__v++,!1){let u=Tn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&Y(u,"signal:update",{signal:n,name:r,oldValue:l,newValue:c})}He(n)||ze(n)}}:s=a=>{let l=n.value,c=typeof a=="function"?a(l):a;Object.is(c,l)||(n.value=c,n.__v++,He(n)||ze(n))},!1){let a=Tn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&Y(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function cc(e){let[t,n]=C(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var uc=`
5
+ `?2:1;continue}if(wo(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&wo(e[s]);)i+=e[s],s++;s<e.length&&Qs(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
6
+ `?2:1);let a=Number.parseInt(i,16),l=a===0||a>1114111||a>=55296&&a<=57343;t+=l?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var Eo=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],ta=4,na=5,ra=8;function oa(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 Jn=new Set,To=100,ko=!1;function Gt(e,t,n){}function No(e){return(e.includes("\\")?ea(e):e).toLowerCase().replace(/\s+/g,"")}function Gn(e){if(!Zs.test(e))return-1;let t=No(e);for(let n=0;n<Eo.length;n++)if(t.includes(Eo[n]))return n;return-1}function Xt(e,t,n){let r=Yn(e,t);return r===-1?t:(Gt(t,r,{property:e,element:n?.element}),"")}function Yn(e,t){let n=Gn(t);if(n!==-1)return n;let r=ue(e);return r==="behavior"?na:r==="-moz-binding"?ta:(r==="filter"||r==="-ms-filter")&&No(t).includes("progid:")?ra:-1}function ia(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 l=e.indexOf("*/",s+2);if(l===-1)return null;s=l+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 l=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(l))continue;let u=s.slice(a+1).trim(),c=/!\s*important\s*$/i.exec(u);if(c&&(u=u.slice(0,c.index).trim()),u==="")continue;let g=l.startsWith("--")?l:ue(l);i.push([g,u,c!==null])}return i}function sa(e,t){let n=String(e),r=ia(n);if(r===null)return Gn(n)!==-1&&Gt(n,Gn(n),t),"";let o=[];for(let[i,s,a]of r){let l=Yn(i,s);if(l!==-1){Gt(s,l,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function Zt(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return sa(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),l=Yn(s,a);if(l!==-1){Gt(a,l,{property:s,element:t?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var Xn=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),aa=new Set(["srcdoc"]);function It(e){return aa.has(e.toLowerCase())}function Ao(e){return Xn.has(e.toLowerCase())}function la(e){let t=e.toLowerCase();return t==="style"||Xn.has(t)}function ua(e,t,n){let r=e.toLowerCase();return r==="srcset"?Xs(t):Xn.has(r)?Yt(t):r==="style"?Zt(t,n):t}function Co(e,t,n){if(!la(e))return t;let r=ua(e,t,n);return r===""?null:r}function Ze(e){return e===" "||e===" "||e===`
7
+ `||e==="\r"||e==="\f"}function Qt(e){let t=0,n=e.length;for(;t<n&&Ze(e[t]);)t++;for(;n>t&&Ze(e[n-1]);)n--;return e.slice(t,n)}var ce=e=>({kind:"forbidden",reason:e});function ca(e){let t=Qt(yt(e));if(t==="")return ce("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return ce("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return ce("");for(;n<t.length&&Ze(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return ce("");for(n++;n<t.length&&Ze(t[n]);)n++;let o=n;for(;n<t.length&&!Ze(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return ce("");for(;n<t.length&&Ze(t[n]);)n++;if(t[n]!=="=")return ce("");for(n++;n<t.length&&Ze(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return ce("");if(s=t.slice(n+1,u),Qt(t.slice(u+1))!=="")return ce("")}else if(s=Qt(t.slice(n)),/[;,]/.test(s))return ce("");if(s==="")return ce("");let l=Yt(s);return l===""?ce(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function Zn(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=ue(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?ce(""):typeof t!="string"?{kind:"not-refresh"}:Qt(yt(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:ca(n)}var da="http://www.w3.org/1999/xhtml",fa="http://www.w3.org/2000/svg",pa=new Set(["script","iframe","object","embed","frame","frameset"]);function Ro(e){return ue(e)}function Lo(e){return pa.has(Ro(e))}var ma=new Set(["script","style"]);function Mo(e){return ma.has(Ro(e))}var j={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},ga=new Set(["src","href","xlink:href","type","language"]),ha=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Qn=new WeakSet;function Oo(e){return e.namespaceURI===da||e.namespaceURI===null}function Do(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 ba(e){Qn.has(e)||(Qn.add(e),e.getAttribute("content")!==null&&Zn(Do(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function ya(e,t,n,r){if(!Oo(e))return j.None;let o=ue(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&ba(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return j.None;let i=Zn(Do(e,o,n));return i.kind==="forbidden"?j.MetaRefreshForbidden:i.kind!=="not-refresh"&&Qn.has(e)?j.MetaRefreshReactive:j.None}function Sa(e,t){if(t===null||ue(e)!=="attributename")return j.None;let n=yt(t);return Ao(n)||We(n)||It(n)?j.AnimationTarget:j.None}var en=new WeakSet;function _o(e){if(e===null)return!1;let t=ue(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 va(e,t,n,r){if(!Oo(e))return j.None;let o=ue(t);return o==="href"?r==="static"||n===null?j.None:_o(e.getAttribute("rel"))?j.StylesheetSource:(en.add(e),j.None):o==="rel"&&_o(n)&&en.has(e)&&e.hasAttribute("href")?j.StylesheetSource:j.None}function er(e,t,n,r){let o=e.localName;return o==="meta"?ya(e,t,n,r):o==="link"?va(e,t,n,r):o==="script"?r==="static"||n===null?j.None:ga.has(ue(t))?j.ScriptSource:j.None:ha.has(o)&&e.namespaceURI===fa?Sa(t,n):j.None}function tr(e,t,n){e.localName!=="link"||ue(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?en.add(e):en.delete(e))}var xa="http://www.w3.org/1999/xhtml",wa="http://www.w3.org/2000/svg",Ea="http://www.w3.org/1999/xlink",Ta="http://www.w3.org/XML/1998/namespace",ka=new Set(["checked","disabled","selected"]);function Na(e){return e.namespaceURI===null||e.namespaceURI===xa}function Ho(e,t,n){}function Po(e,t,n){e[t]=n}function Aa(e,t){if(e.namespaceURI!==wa)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Ea:n.startsWith("xml:")?Ta:null}function ge(e,t,n,r={}){let o=Ca(e,t,n,r);return e.localName==="link"&&tr(e,t,r.reactive?"reactive":"runtime"),o}function Ca(e,t,n,r){let o=Aa(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(We(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=er(e,t,s,r.reactive?"reactive":"runtime");if(a!==j.None)return Ho(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(It(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let l=Na(e),u=l?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let m=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==m&&(o?e.setAttributeNS(o,t,m):e.setAttribute(t,m)),!0}return l&&ka.has(u)&&u in e?Po(e,u,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let c=String(n);if(r.syncValueProperty!==!1&&l&&(u==="value"||u==="checked")&&u in e)return Po(e,u,u==="checked"?!!n:c),!0;let g=c===""?"":Co(t,c,{element:e});return g===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===g||(o?e.setAttributeNS(o,t,g):e.setAttribute(t,g)),!0)}function nr(e,t,n){if(It(t))return!1,!1;let r=er(e,t,n,"static");return r!==j.None?(Ho("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&tr(e,t,"static"),!0)}var _a=4096,or=[];function Ra(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function La(e,t,n){let r=or.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Ra();return o.sig=e,o.sub=t,o.epoch=n,o}function Bo(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,or.length<_a&&or.push(e)}function Ma(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 zo(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 Oa(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function Da(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 be=null,Oe=null,Ve=0,Ne=[],Y=new Set,Pa=[];function Ha(e){try{e()}catch(t){let n=e;O(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Ia(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,De=!1;function sr(){Ae===0&&(Oe=be,be=null,De=!0),Ae++}function ar(){Ae--,Ae===0&&(be=Oe,Oe=null,De=!1)}function Fo(){return De}function Wo(e){sr();try{return e()}finally{ar()}}var de=null;function lr(){return de}function sn(e,t){let n=de;de=e;try{return t()}finally{de=n}}function ur(e){let t=de;return t===null?e:(...n)=>sn(t,()=>e(...n))}var he=null,vt=0,$t=0,tn=1,tt=2,Qe=()=>{},je=new Set,St=new Set,xt=new Set;function $a(e){let t=$t;for(let n=e;n!==null;){let r=n.sub;if(r===null)return tt;r._frozen===!0&&(t=tn),n=r._owner??null}return t}var wt=new Set,ke=new Set,rr=!1;function Io(){rr||ke.size===0||(rr=!0,queueMicrotask(()=>{rr=!1;for(let e of[...ke]){if(!ke.has(e))continue;let t=e.check.state();if(t===tt&&ke.delete(e),!(t===tt||t===e.last)){e.last=t;try{e.listener(t)}catch(n){O(n,{phase:"effect"})}}}}))}var Ba=Object.assign(()=>!1,{state:()=>$t,wait:e=>(e(),Qe),onEnd:()=>Qe,run:e=>e(),onChange:()=>Qe,within:()=>!1});function Vo(){let e=he;if(e===null)return Ba;let t=()=>$a(e),n=Object.assign(()=>t()!==$t,{state:t,wait:(r,o)=>{let i=t();if(i!==tn)return(i===$t?r:o)(),Qe;let s={check:n,onActive:r,onEnd:o};return St.add(s),()=>{St.delete(s)}},onEnd:r=>{if(t()===tt)return r(),Qe;let o={check:n,onActive:Qe,onEnd:r};return wt.add(o),()=>{wt.delete(o)}},run:r=>{let o=he;he=e.sub===null?null:e;try{return r()}finally{he=o}},onChange:r=>{let o=t();if(o===tt)return Qe;let i={check:n,last:o,listener:r};return ke.add(i),()=>{ke.delete(i)}},within:r=>{let o=r.run(()=>he);if(o===null)return!1;for(let i=e;i!==null;){if(i===o)return!0;let s=i.sub;if(s===null)return!1;i=s._owner??null}return!1}});return n}function jo(e){return xt.add(e),()=>{xt.delete(e)&&cr()}}function qo(e){if(vt!==0&&Fa(e))return!0;if(xt.size!==0){let t=e._errorNode;if(t!=null){for(let n of xt)if(n.contains(t))return!0}}return!1}function $o(){for(let t of ke)t.check.state()===tt&&ke.delete(t);let e=null;for(let t of wt)t.check.state()===tt&&(wt.delete(t),(e??(e=[])).push(t));if(e!==null)for(let t of e)try{t.onEnd()}catch(n){O(n,{phase:"cleanup"})}}function za(){for(let e of je)(e._disposed===!0||e.depsHead==null)&&je.delete(e)}function cr(){for(let t of je)t._disposed===!0?je.delete(t):qo(t)||(je.delete(t),Y.has(t)||(Y.add(t),Ne.push(t)));vt===0&&xt.size===0&&je.clear();let e=null;for(let t of St)t.check.state()!==tn&&(St.delete(t),(e??(e=[])).push(t));if(e!==null){let t=e;queueMicrotask(()=>{for(let n of t){let r=n.check.state();if(r===tn)St.add(n);else try{(r===$t?n.onActive:n.onEnd)()}catch(o){O(o,{phase:"effect"})}}})}Ne.length>0&&pr()}function Fa(e){for(let t=e._owner??null;t!==null;){let n=t.sub;if(n===null)return!1;if(n._frozen===!0)return!0;t=n._owner??null}return!1}var Wa=0;function dr(e,t){let n=be,r=0,o=null;De&&(r=Ae,o=Oe,Ae=0,Oe=null,De=!1),be=t;let i=t;i._cap===void 0&&(i._cap=yo());let s=de;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(de=a);let l=he;l!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=l),i._tok!=null&&(he=i._tok);let u=++Wa;i._epoch=u,i._structDirty=!1;for(let c=i.depsHead??null;c!==null;c=c.subNext){let g=c.sig;c.prevActive=g.__activeNode??null,g.__activeNode=c}try{e()}finally{be=n,de=s,he=l,r!==0&&(Ae=r,Oe=o,De=!0);let c=i.depsHead??null;for(;c!==null;){let g=c.subNext,f=c.sig;f.__activeNode=c.prevActive,c.prevActive=null,c.epoch!==u&&(Da(c),zo(c),Bo(c)),c=g}}}function Uo(e,t){if(!t)return fr(e);Et(t);let n=be,r=0,o=null;De&&(r=Ae,o=Oe,Ae=0,Oe=null,De=!1),be=t;let i=t;i._scope===void 0&&(i._scope=de);let s=de;de=i._scope;try{e()}finally{be=n,de=s,r!==0&&(Ae=r,Oe=o,De=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let l=a.sig;l.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>Et(t))}function fr(e,t,n){return Jo(e,t,n===!0)._dispose}function Ko(e,t){let n=Jo(e,t,!0);return{stop:n._dispose,run:r=>{let o=he;he=n._tok??null;try{return r()}finally{he=o}},freeze:()=>{let r=n;r._disposed||r._frozen||(r._frozen=!0,vt++,Io())},thaw:()=>{n._frozen&&(n._frozen=!1,vt--,Io(),cr())}}}function Jo(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{dr(e,o)}finally{i._reentrant=!1}}},o=r;o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._runEpoch=0,o._runs=0,o._reentrant=!1,o._disposed=!1,o._errorPhase="binding",o._errorNode=t,o._tok=null,o._owner=null,o._frozen=!1,n&&(o._tok={sub:o});try{r()}catch(i){throw o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null,(wt.size!==0||ke.size!==0)&&$o()),Et(o),i}return o._dispose=()=>{o._disposed=!0;let i=o._frozen===!0;i&&(o._frozen=!1,vt--),o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null,(wt.size!==0||ke.size!==0)&&$o(),je.size!==0&&za(),(i||St.size!==0)&&cr()),Et(o)},o}function Go(e){if(!be)return;let t=be,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=La(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,Oa(t,i),Ma(n,i),t._structDirty=!0}function Et(e){let t=e;t._owner!=null&&(t._owner=null);let n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;zo(n),Bo(n),n=r}}var nn=1e3,rn=1e6,on=0,et=new Set;function Yo(e){let t=nn;return Number.isFinite(e)&&e>0&&(nn=Math.floor(e)),t}function Xo(e){let t=rn;return Number.isFinite(e)&&e>0&&(rn=Math.floor(e)),t}function Va(e){let t=e;return t._runEpoch!==on?(t._runEpoch=on,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>nn)}function ja(e){let t=e.__name??"<unnamed>";O(new Error(`subscriber "${t}" fired more than ${nn} 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 qa(){O(new Error(`Notification drain exceeded ${rn} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Zo(){let e=0;for(;e<Ne.length;){if(e>=rn){qa();break}let t=Ne[e++];Y.delete(t)&&(t._owner!=null&&Y.size>0&&(Ua(t),Y.has(t))||Qo(t))}}function Ua(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;Y.has(r)&&(t=r),n=r._owner??null}if(t===null)return;Y.delete(t),Qo(t)}}function Qo(e){if((vt!==0||xt.size!==0)&&qo(e)){je.add(e);return}if(et.size>0&&et.has(e)||e._hasComputedDep===!0&&!Ia(e))return;if(Va(e)){ja(e),et.add(e);return}let t=So(e._cap??null);try{Ha(e)}finally{t&&vo()}}function pr(){if(!(Ve>0)){Ve++,on++;try{Zo()}finally{Ve--,Ve===0&&(Ne.length=0,Y.clear(),et.size>0&&et.clear())}}}function ir(e){e();let t=e._sig;if(!t)return;let n=Pa,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 Y.has(s)||(Y.add(s),Ne.push(s));i=i.sigNext}}}function ei(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?ir(r):Y.has(r)||(Y.add(r),Ne.push(r))),n=n.sigNext}}function ti(e){let n=e.subsHead;if(n){if(Ve>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?ir(o):Y.has(o)||(Y.add(o),Ne.push(o))),r=r.sigNext}return}Ve++,on++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?ir(o):Y.has(o)||(Y.add(o),Ne.push(o))),r=r.sigNext}Zo()}finally{Ve--,Ve===0&&(Ne.length=0,Y.clear(),et.size>0&&et.clear())}}}function ni(e){return e.__sc??0}function ri(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function oi(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var ii="4.15.0",si=Symbol.for("sibujs.reactive.v1");function Ja(){let e=globalThis,t=e[si];if(t)return!1,t;let n={suspendTracking:sr,resumeTracking:ar,isTrackingSuspended:Fo,untracked:Wo,retrack:dr,track:Uo,reactiveBinding:fr,recordDependency:Go,cleanup:Et,setMaxSubscriberRepeats:Yo,setMaxDrainIterations:Xo,drainNotificationQueue:pr,queueSignalNotification:ei,notifySubscribers:ti,getSubscriberCount:ni,getSubscriberDeps:ri,forEachSubscriber:oi,getOwnerScope:lr,runWithOwnerScope:sn,bindOwnerScope:ur,structuralBinding:Ko,captureFrozen:Vo,holdSubtree:jo,version:ii};return e[si]=n,n}var q=Ja(),nt=q.suspendTracking,rt=q.resumeTracking,an=q.isTrackingSuspended,Ce=q.untracked,qe=q.retrack,Tt=q.track,Z=q.reactiveBinding,ot=q.recordDependency,it=q.cleanup,Lf=q.setMaxSubscriberRepeats,ai=q.setMaxDrainIterations,li=q.drainNotificationQueue,ui=q.queueSignalNotification,kt=q.notifySubscribers,Mf=q.getSubscriberCount,Of=q.getSubscriberDeps,Df=q.forEachSubscriber,Nt=q.getOwnerScope??lr,ln=q.runWithOwnerScope??sn,Q=q.bindOwnerScope??ur,ye=q.structuralBinding??((e,t)=>({stop:q.reactiveBinding(e,t),run:n=>n()})),Se=q.captureFrozen??(()=>Object.assign(()=>!1,{state:()=>0,wait:e=>(e(),()=>{}),onEnd:()=>()=>{},run:e=>e(),onChange:()=>()=>{},within:()=>!1})),un=q.holdSubtree??(()=>()=>{});function Bt(e,t,n){if(We(t))return ge(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){O(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}ge(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return Z(r,e)}function ci(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){O(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){O(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),ge(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=Z(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var mr=["data-focus-key","id","name"],Ga=new Set(["text","search","url","tel","password",""]);function Ya(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Ga.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 cn(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<mr.length;i++){let s=t.getAttribute(mr[i]);if(s){r=mr[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Ya(t)}}function Xa(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Za(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 l=0;l<a.length;l++)r++,n??(n=a[l]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function di(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 At(e,t,n,r){if(!e||typeof document>"u"||r==="discard")return;let o=document.activeElement;if(o===e.el||o&&o!==document.body&&o!==document.documentElement)return;if(e.el.isConnected&&!e.el.closest("[inert]")){di(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=Za(t,`[${e.attr}=${Xa(e.value)}]`);if(s&&s.tagName===e.tag){di(s,e);return}i=a>1}if(r!==void 0&&typeof r=="object"){let s=typeof r.restoreTo=="function"?r.restoreTo():r.restoreTo;if(s?.isConnected&&(s.focus(),document.activeElement===s))return}}var fi,gr=globalThis[fi=Symbol.for("sibujs.streamBoundary.v1")]??(globalThis[fi]={hook:null,current:null});function pi(e){return gr.hook?gr.hook(e):null}function dn(){return gr.current}var hr=Symbol.for("sibujs.ssr.v1");function Qa(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,r=process.getBuiltinModule;typeof r=="function"?n=r("node:async_hooks"):typeof Bn=="function"&&(n=Bn("async_hooks")),n&&(e=new n.AsyncLocalStorage)}let t=globalThis.AsyncLocalStorage;!e&&typeof t=="function"&&(e=new t)}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var Ue=globalThis[hr]??(globalThis[hr]=Qa()),at=Ue.als,st=Ue.fallbackStore;Ue.fallbackDepth??(Ue.fallbackDepth=0);var mi=!1;function el(){if(mi||at||!(typeof process<"u"&&!!process.versions?.node))return;mi=!0;let t=process.versions.node;`${t}`}function Ke(){if(at){let e=at.getStore();if(e)return e}return st}function br(){return at?at.getStore()??null:Ue.fallbackDepth>0?st:null}function ne(){return Ke().ssr}function gi(e){if(!ne())return null;let t=Ke(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}var tl=Symbol.for("sibujs.prerender.v1");function ve(){return Ke().ssr||globalThis[tl]!==void 0}function hi(){return!ve()}function bi(){Ke().ssr=!0}function yi(){Ke().ssr=!1}function Si(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0,pending:new Set,wake:null};if(at)return at.run(t,e);el();let n={...st};Object.assign(st,t),Ue.fallbackDepth++;try{return e()}finally{Ue.fallbackDepth--;for(let r of Object.keys(st))r in n||delete st[r];Object.assign(st,n)}}function vi(e,t,n=!0){let r=br(),o=r?.pending,i=o||!n?[]:Vn();if(!o&&i.length===0)return e;let s={label:t,since:Date.now(),boundary:dn()??void 0};o?.add(s);let a=bo(i,s),l=()=>{o?.delete(s),r?.wake?.(),a()};try{Promise.resolve(e).then(l,l)}catch{l()}return e}function xi(e){let t=Ke(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var zt=me(Symbol.for("sibujs.ranges.v1"),()=>({ends:new WeakMap,pending:new WeakMap,registrations:new Set,listeners:new Set,notice:{queued:!1,batch:[]}})),fn=zt.ends;function ct(e,t){fn.set(e,t)}var ut=zt.pending,yr=()=>{};function Ct(e,t,n){if(n){let r=t;t=()=>{n.wait(r,yr)}}ut.set(e,!0),queueMicrotask(()=>{if(ut.get(e)===!0){if(e.parentNode===null){ut.set(e,t);return}ut.delete(e),t()}})}function Ei(e){for(let t of e){let n=ut.get(t);typeof n=="function"&&(ut.delete(t),n())}}function Sr(e){for(let t of e)if(ut.has(t))return!0;return!1}var pn=zt.registrations,mn=zt.listeners,lt=zt.notice;function wi(e){mn.size!==0&&(e!==null&&lt.batch.push(e),!lt.queued&&(lt.queued=!0,queueMicrotask(()=>{lt.queued=!1;let t=lt.batch;lt.batch=[];for(let n of[...mn])n(t)})))}function vr(e,t){let n={at:e,held:t,settled:!1,cancelled:!1,committed:null};pn.add(n),wi(null);let r=(o,i)=>{n.settled||(n.settled=!0,n.cancelled=o,n.committed=i,pn.delete(n),wi(n))};return{entry:n,done:o=>r(!1,o??null),cancel:()=>r(!0,null)}}var nl={done:yr,cancel:yr};function xr(e){if(ve())return nl;let{done:t,cancel:n}=vr(e,null);return{done:()=>t(),cancel:n}}function wr(e,t,n){let r=e.at;if(r!==null){for(let o=0;o<t.length;o++)if(t[o]===r||t[o].contains(r))return!0;return!1}return n!==null&&e.held?.within(n)===!0}function gn(e,t){let n=[];if(pn.size===0)return n;for(let r of pn)wr(r,e,t)&&n.push(r);return n}function Ti(e){if(!e.settled||e.cancelled)return[];let t;if(e.committed!==null)t=e.committed;else{if(e.at===null)return[];e.at.nodeType===1?t=Array.from(e.at.childNodes):t=Wt([e.at])}let n=[];for(let r=0;r<t.length;r++)t[r].nodeType===1&&n.push(t[r]);return n}function Er(e){return mn.add(e),()=>{mn.delete(e)}}function ki(){return lt.batch}function Ft(e){return fn.has(e)}function Ni(e,t){ct(e,()=>{let n=e.parentNode,r=t().filter(s=>s!==null&&s.parentNode===n),o=null,i=r.length;for(let s=e.nextSibling;s!==null&&i>0;s=s.nextSibling)r.includes(s)&&(o=s,i--);return o})}function rl(e){let t=e;for(let n=fn.get(t);n!==void 0;n=fn.get(t)){let r=n();if(r===null||r===t||r.parentNode!==e.parentNode)break;t=r}return t}function Wt(e){let t=[],n=new Set;for(let r of e){if(r.parentNode===null)continue;let o=rl(r),i=r,s=[r];for(;i!==o;){if(i=i.nextSibling,i===null){s=[r];break}s.push(i)}for(let a of s)n.has(a)||(n.add(a),t.push(a))}return t}function Pe(e,t,n){let r=[],o=Re();function i(){let s;try{s=ae(o,t)}catch(f){O(f,{phase:"binding",name:"bindChildNode",node:e});return}let a=cn(r);if(s==null||typeof s=="boolean"){for(let f=0;f<r.length;f++){let m=r[f];D(m),m.parentNode&&m.parentNode.removeChild(m)}r.length=0,At(a,r,"bindChildNode");return}let l=e.parentNode;if(!l){r.length=0;return}let u;if(Array.isArray(s)){u=[];let f=new Set;for(let m=0;m<s.length;m++){let d=s[m];if(d==null||typeof d=="boolean")continue;let h=d instanceof Node?d:document.createTextNode(String(d));if(f.has(h)){!1;continue}f.add(h),u.push(h)}}else u=[s instanceof Node?s:document.createTextNode(String(s))];let c;if(r.length>0&&u.length>0){let f=new Set(r);c=new Set;for(let m=0;m<u.length;m++)f.has(u[m])&&c.add(u[m])}for(let f=0;f<r.length;f++){let m=r[f];c?.has(m)||(D(m),m.parentNode&&m.parentNode.removeChild(m))}let g=e;for(let f=0;f<u.length;f++){let m=u[f];g.nextSibling!==m&&l.insertBefore(m,g.nextSibling),g=m}r=u,At(a,u,"bindChildNode")}return n&&ct(e,()=>{for(let s=r.length-1;s>=0;s--)if(r[s].parentNode!==null)return r[s];return null}),Z(i,e,!0)}var Ai={cssFloat:"float"},ol=/^(webkit|moz|ms|o)-/,hn=new Map,il=1e3;function Tr(e){let t=hn.get(e);return t!==void 0||(e.startsWith("--")?t=e:Object.hasOwn(Ai,e)?t=Ai[e]:(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),ol.test(t)&&(t=`-${t}`)),hn.size>=il&&hn.clear(),hn.set(e,t)),t}function kr(){throw new Error("[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first.")}function ie(){typeof document>"u"&&kr()}var V="http://www.w3.org/2000/svg",sl=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Nr=new Set,Ci=100,_i=!1;function al(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=Z(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",Zt(String(a),{element:e}));return}let l=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let c in a){if(!Object.hasOwn(a,c))continue;let g=a[c];if(g==null)continue;let f=Tr(c);u.push(f),l.setProperty(f,Xt(f,String(g),{element:e}))}for(let c=0;c<o.length;c++)u.indexOf(o[c])===-1&&l.removeProperty(o[c]);o=u},e);R(e,s);return}if(typeof t=="string"){e.setAttribute("style",Zt(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Tr(r);if(typeof o=="function"){let s=o,a=Z(()=>{n.style.setProperty(i,Xt(i,String(s()),{element:e}))},e);R(e,a)}else n.style.setProperty(i,Xt(i,String(o),{element:e}))}}function ll(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=Z(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);R(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=Z(()=>{let a="";for(let l in n){if(!Object.hasOwn(n,l))continue;let u=n[l];(typeof u=="function"?u():u)&&(a=a?`${a} ${l}`:l)}e.setAttribute("class",a)},e);R(e,s)}else e.setAttribute("class",o)}function Ar(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),R(e,Pe(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),R(e,Pe(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),R(e,Pe(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 p(e,t){let n=Lo(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&kr();let i=Ht(e,t);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Ar(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Ar(i,r),i;let s=r,a=s.class;a!=null&&ll(i,a);let l=s.id;typeof l=="function"?R(i,Bt(i,"id",l)):l!=null&&(!1,i.id=l);let u=o!==void 0?o:s.nodes;u!=null&&Ar(i,u);let c=s.on;if(c)for(let m in c){if(!Object.hasOwn(c,m))continue;let d=c[m];typeof d=="function"?i.addEventListener(m,d):!1}let g=s.style;g!=null&&al(i,g);let f=s.ref;f&&(f.current=i);for(let m in s)switch(m){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,m))continue;let d=s[m];if(d==null||We(m))continue;typeof d=="function"?R(i,Bt(i,m,d)):ge(i,m,d,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var bp=p("html"),ul=p("head"),cl=p("body"),dl=p("title"),I=p("div"),J=p("span"),fl=p("section"),pl=p("article"),ml=p("header"),gl=p("footer"),hl=p("nav"),bl=p("main"),yl=p("aside"),Sl=p("address"),Cr=p("p"),vl=p("h1"),xl=p("h2"),_r=p("h3"),wl=p("h4"),El=p("h5"),Tl=p("h6"),kl=p("blockquote"),Nl=p("dd"),Al=p("dl"),Cl=p("dt"),_l=p("figcaption"),Rl=p("figure"),Ll=p("hr"),Ml=p("li"),Ol=p("ol"),Dl=p("ul"),Rr=p("pre"),Pl=p("a"),Hl=p("abbr"),Il=p("b"),$l=p("bdi"),Bl=p("bdo"),zl=p("br"),Fl=p("cite"),Lr=p("code"),Wl=p("data"),Vl=p("dfn"),jl=p("em"),ql=p("i"),Ul=p("kbd"),Kl=p("mark"),Jl=p("q"),Gl=p("rp"),Yl=p("rt"),Xl=p("ruby"),Zl=p("s"),Ql=p("samp"),eu=p("small"),tu=p("strong"),nu=p("sub"),ru=p("sup"),ou=p("time"),iu=p("u"),su=p("var"),au=p("area"),lu=p("audio"),uu=p("img"),cu=p("map"),du=p("track"),fu=p("video"),pu=p("embed"),mu=p("iframe"),gu=p("object"),hu=p("param"),bu=p("picture"),yu=p("portal"),Su=p("source"),vu=p("svg",V),xu=p("math"),wu=p("canvas"),Eu=p("noscript"),Tu=p("script"),ku=p("del"),Nu=p("ins"),Au=p("caption"),Cu=p("col"),_u=p("colgroup"),Ru=p("table"),Lu=p("tbody"),Mu=p("td"),Ou=p("tfoot"),Du=p("th"),Pu=p("thead"),Hu=p("tr"),Vt=p("button"),Iu=p("datalist"),$u=p("fieldset"),Bu=p("form"),zu=p("input"),Fu=p("label"),Wu=p("legend"),Vu=p("meter"),ju=p("optgroup"),qu=p("option"),Uu=p("output"),Ku=p("progress"),Ju=p("select"),Gu=p("textarea"),Yu=p("details"),Xu=p("dialog"),Zu=p("menu"),Qu=p("summary"),ec=p("slot"),tc=p("template"),nc=p("base"),rc=p("link"),oc=p("meta"),dt=p("style"),ic=p("circle",V),sc=p("ellipse",V),ac=p("g",V),lc=p("line",V),uc=p("path",V),cc=p("polygon",V),dc=p("polyline",V),fc=p("rect",V),pc=p("text",V),mc=p("tspan",V),gc=p("defs",V),hc=p("clipPath",V),bc=p("mask",V),yc=p("pattern",V),Sc=p("linearGradient",V),vc=p("radialGradient",V),xc=p("stop",V),wc=p("use",V),Ec=p("symbol",V),Tc=p("marker",V),kc=p("center"),Nc=p("font"),Ac=p("marquee"),Cc=e=>p(e);var bn=()=>{};function jt(e,t){let n=!1,r=null,o=bn,i=()=>{n=!0,e.cancel===s&&(e.cancel=bn),o(),o=bn},s=()=>{if(n)return;i();let l=r;r=null;try{t.discard()}finally{l?.()}},a=()=>{o=bn;let l=!1;for(;!n;){let u=t.held.state();if(u===2||t.owned!==void 0&&!t.owned()){s();return}if(u===1){t.node!==null&&r===null&&(r=un(t.node)),o=t.held.wait(a,a);return}if(r!==null){let c=r;r=null,c();continue}if(!l){l=t.teardown?.()!==!0;continue}i(),t.insert();return}};e.cancel=s,a()}var Mr="__sibuPendingError";function Or(e,t){let n=()=>e.parentNode?(O(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[Mr]=t)})}function yn(e){let t=e,n=t[Mr];if(n instanceof Error)return delete t[Mr],n}var _t=()=>{};function Ri(e){let t=null,n=o=>{let i=ye(_t);try{return[bt(()=>i.run(o)),i]}catch(s){throw i.stop(),s}},r=(o,i)=>o.nodeType===11?()=>{qn(o),i.stop()}:i.stop;return function(){if(t&&!fo()){let[b,A]=n(t),y=b?.nodeType;if(y===11){let L=I({class:"sibu-lazy"});return R(L,r(b,A)),L.appendChild(b),L}return typeof y=="number"&&R(b,A.stop),b}let i=I({class:"sibu-lazy"}),s=Re(),a=dn(),l=ae(null,()=>J("sibu-lazy-loading","Loading..."));if(t){let b=t,A;try{let[y,L]=n(()=>ae(s,()=>b()));R(i,r(y,L)),A=y}catch(y){throw D(i),y}return Me(i,A),i}let u=Se(),c=Q(b=>b()),g=xr(i),f=!1,m=()=>!f,d=null,h={cancel:_t};R(i,()=>{f=!0,h.cancel(),g.cancel();let b=d;d=null,b?.()}),Ee()&&i.firstChild||i.appendChild(l);let v=(b,A,y,L,F)=>{let te=Un(i,[b]);jt(h,{held:u,node:b,owned:m,teardown:te.teardown,insert:()=>{y();try{te.insert()}catch(oe){A(),F(oe);return}f||L()},discard:()=>{A(),g.cancel()}})},x=b=>jt(h,{held:u,node:null,owned:m,insert:()=>c(b),discard:g.cancel}),_=b=>{if(f)return;let A=b instanceof Error?b:new Error(String(b)),y=I({class:"sibu-lazy-error"},`Failed to load component: ${A.message}`);v(y,()=>D(y),_t,()=>{g.done(),Or(i,A)},L=>{g.cancel(),O(L,{phase:"render",name:"lazy"})})},w=b=>{if(f)return;let A,y;try{let F=()=>u.run(()=>n(()=>ae(s,()=>b())));[A,y]=a?a.enter(F):F()}catch(F){_(F);return}let L=r(A,y);v(A,()=>{d===L&&(d=null),y.stop(),D(A)},()=>{d=L},()=>g.done(),_)},C;try{C=e()}catch(b){throw D(i),b}return vi(C,"lazy").then(b=>{if(f)return;t=b.default;let A=t;x(()=>w(A))},b=>{f||x(()=>_(b))}),i}}function Li({nodes:e,fallback:t}){let n=I({class:"sibu-suspense"}),r=Re(),o=Se(),i=Q(b=>b()),s=pi(n),a=xr(n),l=!1,u=()=>!l,c=null,g=null,f=null,m=()=>{let b=f;f=null,b?.stop()},d=ye(_t),h=d,v=()=>{let b=h;h=null,b?.stop()},x={cancel:_t};R(n,()=>{l=!0,x.cancel(),a.cancel(),c&&(c.disconnect(),c=null),g&&!n.contains(g)&&D(g),v(),m()});let _;try{_=ae(null,()=>bt(()=>d.run(t)))}catch(b){throw s?.done(),D(n),b}Ee()&&n.firstChild?(D(_),v()):n.appendChild(_);let w=b=>{let A=Un(n,[b]);jt(x,{held:o,node:b,owned:u,teardown:()=>A.teardown()?!0:h===null?!1:(v(),!0),insert:()=>{try{A.insert()}catch(y){g===b&&(g=null),D(b),m(),a.cancel(),s?.done(),Or(n,y instanceof Error?y:new Error(String(y)));return}s?.done(),a.done()},discard:()=>{g===b&&(g=null),D(b),m(),a.cancel()}})},C=()=>{if(l)return;let b=o.run(()=>ye(_t));f=b;let A;try{let y=()=>bt(()=>b.run(()=>ae(r,e)));A=s?s.enter(y):y()}catch(y){m();let L=y instanceof Error?y:new Error(String(y));a.cancel(),Or(n,L);return}if(g=A,l){g=null,D(A);return}if(A.classList.contains("sibu-lazy")){if(!A.querySelector(".sibu-lazy-loading")){w(A);return}c=new MutationObserver(()=>{if(l)return;A.querySelector(".sibu-lazy-loading")||(c?.disconnect(),c=null,w(A))}),c.observe(A,{childList:!0,subtree:!0})}else w(A)};return queueMicrotask(()=>{jt(x,{held:o,node:null,owned:u,insert:()=>i(C),discard:a.cancel})}),n}function Ir(e,t){return()=>Nt()===e?t():ln(e,t)}function vn(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";O(n,{phase:r,name:t});return}}function Dr(e,t,n,r,o){let i=vn(e,t);if(typeof i!="function")return;let s=Ir(o,i);r()||!n.isConnected?vn(s,"onUnmount"):Oi(s,n)}var Rt=new WeakMap,ft=new WeakMap,He=new Set,Ie=new Set,Lt=null,Sn=0,_c=256;function Pr(e){let t=Rt.get(e);if(t){Rt.delete(e),He.delete(e);for(let n of t)try{n()}catch{}}}function Hr(e){ft.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=ft.get(e);if(n){ft.delete(e),Ie.delete(e);for(let r of n)try{r()}catch{}}})}function Rc(e){if(He.size===0||e.nodeType!==1)return;let t=e;if(He.has(t)&&t.isConnected&&Pr(t),t.firstElementChild)for(let n of Array.from(He))n!==t&&n.isConnected&&t.contains(n)&&Pr(n)}function Lc(e){if(Ie.size===0||e.nodeType!==1)return;let t=e;if(Ie.has(t)&&!t.isConnected&&Hr(t),t.firstElementChild)for(let n of Array.from(Ie))n!==t&&!n.isConnected&&t.contains(n)&&Hr(n)}function Mc(){if(He.size>0)for(let e of Array.from(He))e.isConnected&&Pr(e);if(Ie.size>0)for(let e of Array.from(Ie))e.isConnected||Hr(e)}function Mi(){Lt||typeof document>"u"||(Lt=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++)Lc(t.removedNodes[n])}Sn+=e.length,Sn>=_c&&(Sn=0,Mc()),$r()}),Lt.observe(document.body,{childList:!0,subtree:!0}))}function $r(){Lt&&He.size===0&&Ie.size===0&&(Lt.disconnect(),Lt=null,Sn=0)}function Oc(e,t){let n=Rt.get(e);return n||(n=[],Rt.set(e,n)),n.push(t),He.add(e),Mi(),()=>{let r=Rt.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Rt.delete(e),He.delete(e))}$r()}}function Dc(e,t){let n=ft.get(e);return n||(n=[],ft.set(e,n)),n.push(t),Ie.add(e),Mi(),()=>{let r=ft.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(ft.delete(e),Ie.delete(e))}$r()}}function xn(e,t){if(typeof document>"u"||ne())return;let n=Nt();if(e=Ir(n,e),t){let r=!1,o=()=>r;if(R(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||Dr(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){Dr(e,"onMount",t,o,n);return}let i=Oc(t,()=>{r||Dr(e,"onMount",t,o,n)});R(t,i)})}else queueMicrotask(()=>{vn(e,"onMount")})}function Pc(e,t){typeof document>"u"||ne()||Oi(Ir(Nt(),e),t)}function Oi(e,t){let n=!1,r=()=>{n||(n=!0,vn(e,"onUnmount"))};R(t,r);let o=()=>{if(n)return;let i=Dc(t,r);R(t,i)};t.isConnected?o():xn(()=>{o()},t)}function Hc(e,t){R(t,e)}function fe(e,t,n){try{e.emit(t,n)}catch{}}var Ii=globalThis;function Ic(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,Ce(()=>t(o,void 0));else{let i=n;n=o,Ce(()=>t(o,i))}}}var Di=100;function wn(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===Nt()?Pi(t):ln(n,()=>Pi(t))}function Pi(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){O(n,{phase:"cleanup"})}}function Hi(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&wn(e),qe(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Di);e.rerunPending&&(e.rerunPending=!1,O(new Error(`effect re-requested itself ${Di}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function $c(e){if(e.disposed)return;e.disposed=!0;let t=Ii.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&wn(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{it(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function re(e,t){if(ne()&&!t?.server)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&&wn(n),qe(n.bodyFn,o),n.rerunPending&&Hi(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{qe(n.bodyFn,n.subscriber),n.rerunPending&&Hi(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&wn(n),it(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=Ii.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&fe(i,"effect:create",{effectFn:e}),()=>$c(n)}var qt=0,Br=new Set;function Bc(e){qt++;try{return e()}finally{qt--,qt===0&&Wc()}}function zc(e){return qt===0?!1:(Br.add(e),!0)}function Fc(){return qt>0}function Wc(){try{for(let e of Br)ui(e)}finally{Br.clear()}li()}var $i=Symbol.for("sibujs.reactive.batch.v1");function Vc(){let e=globalThis,t=e[$i];if(t)return t;let n={batch:Bc,enqueueBatchedSignal:zc,isBatching:Fc};return e[$i]=n,n}var zr=Vc(),se=zr.batch,pt=zr.enqueueBatchedSignal,jc=zr.isBatching;var Fr=globalThis;function z(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=void 0,o=t?.equals;r&&(n.__name=r);function i(){return ot(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;if(!o(l,u)){if(n.value=u,n.__v++,!1){let c=Fr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&fe(c,"signal:update",{signal:n,name:r,oldValue:l,newValue:u})}pt(n)||kt(n)}}:s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;Object.is(u,l)||(n.value=u,n.__v++,pt(n)||kt(n))},!1){let a=Fr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&fe(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function qc(e){let[t,n]=z(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Uc=`
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
- `,fo=!1;function dc(){if(fo||typeof document>"u")return;let e=Le({nodes:uc});document.head.appendChild(e),fo=!0}function fc(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 po(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=fc(r),i=e.cause,s=i!=null?po(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 pc(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(`
188
+ `,Bi=!1;function Kc(){if(Bi||typeof document>"u")return;let e=dt({nodes:Uc});document.head.appendChild(e),Bi=!0}function Jc(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 zi(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=Jc(r),i=e.cause,s=i!=null?zi(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 Gc(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
190
  `).map(s=>` ${s}`).join(`
191
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 mo(e){let t=e.map((n,r)=>_({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 un({class:"sibu-err-stack",nodes:t})}function go(e){return e?[_({class:"sibu-err-cause-label",nodes:"Caused by"}),_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[H({nodes:`[${e.code}] ${e.message}`}),H({nodes:""})]}),e.frames.length>0?mo(e.frames):_({class:"sibu-err-stack",nodes:"(no stack)"})]}),...go(e.cause)]:[]}function mc(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 wn(e){dc();let t=e.severity??"error",n=po(e.error),r=e.alwaysShowDetails??ne(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),l=tt({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let g=pc(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(g).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),c=_({class:"sibu-err-header",nodes:[dn({class:"sibu-err-icon",nodes:n.code}),cn({class:"sibu-err-title",nodes:o}),l,H({class:"sibu-err-timestamp",nodes:i})]}),u=[ln({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&u.push(_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[H({nodes:"Stack Trace"})]}),mo(n.frames)]})),r&&u.push(...go(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&u.push(_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[H({nodes:"Metadata"})]}),mc(e.metadata)]}));let f=[];e.onRetry&&f.push(tt({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&f.push(tt({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),f.length>0&&u.push(_({class:"sibu-err-actions",nodes:f}));let m=_({class:"sibu-err-body",nodes:u});return _({class:"sibu-error-display","data-severity":t,nodes:[c,m]})}var gc=`
192
+ `)}function Fi(e){let t=e.map((n,r)=>I({class:"sibu-err-frame",nodes:[J({class:"sibu-err-line",nodes:String(r+1)}),J({class:"sibu-err-fn",nodes:n.fn}),J({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return Rr({class:"sibu-err-stack",nodes:t})}function Wi(e){return e?[I({class:"sibu-err-cause-label",nodes:"Caused by"}),I({class:"sibu-err-section",nodes:[I({class:"sibu-err-section-head",nodes:[J({nodes:`[${e.code}] ${e.message}`}),J({nodes:""})]}),e.frames.length>0?Fi(e.frames):I({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Wi(e.cause)]:[]}function Yc(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 Wr(e){Kc();let t=e.severity??"error",n=zi(e.error),r=e.alwaysShowDetails??we(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=z("Copy"),l=Vt({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let m=Gc(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(m).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),u=I({class:"sibu-err-header",nodes:[Lr({class:"sibu-err-icon",nodes:n.code}),_r({class:"sibu-err-title",nodes:o}),l,J({class:"sibu-err-timestamp",nodes:i})]}),c=[Cr({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&c.push(I({class:"sibu-err-section",nodes:[I({class:"sibu-err-section-head",nodes:[J({nodes:"Stack Trace"})]}),Fi(n.frames)]})),r&&c.push(...Wi(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&c.push(I({class:"sibu-err-section",nodes:[I({class:"sibu-err-section-head",nodes:[J({nodes:"Metadata"})]}),Yc(e.metadata)]}));let g=[];e.onRetry&&g.push(Vt({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&g.push(Vt({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),g.length>0&&c.push(I({class:"sibu-err-actions",nodes:g}));let f=I({class:"sibu-err-body",nodes:c});return I({class:"sibu-error-display","data-severity":t,nodes:[u,f]})}var Xc=`
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
- `,bc=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),bo=!1;function hc(){if(!bo&&typeof document<"u"){let e=Le({nodes:gc});document.head.appendChild(e),bo=!0}}function yc(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;hc();let[a,l]=C(null),c=()=>{f(),l(null)},u=null,f=()=>{if(!u)return;let S=u;u=null,S()},m=S=>{let x=new Array(S.length);for(let k=0;k<S.length;k++)try{x[k]=S[k]()}catch(D){w(D,{phase:"effect",name:"ErrorBoundary.resetKeys"}),x[k]=bc}return x},g=()=>{let S=s;if(!S||S.length===0)return;f();let x=null;u=Z(()=>{let k=m(S);if(x===null){x=k;return}let D=k.length!==x.length;if(!D){for(let P=0;P<k.length;P++)if(!Object.is(k[P],x[P])){D=!0;break}}x=k,D&&c()})},p=S=>{let x=Pt(S);if(l(x),g(),i)try{i(x)}catch(k){w(k,{phase:"render",name:"ErrorBoundary onError callback"})}return x},b=(S,x)=>wn({error:S,severity:"error",onRetry:x}),h=S=>{let x=o||b;try{return x(S,c)}catch(k){return queueMicrotask(()=>{w(k,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=_({class:"sibu-error-boundary",nodes:()=>{let S=a();if(S)return h(S);try{let x=n();if(x&&typeof x.then=="function"){let k=_({class:"sibu-error-async"});k.appendChild(H({class:"sibu-lazy-loading",nodes:"Loading..."}));let D=!1;return E(k,()=>{D=!0}),x.then(P=>{if(D){L(P);return}U(k,P)}).catch(z(P=>{if(D)return;let Je=p(P);U(k,h(Je))})),k}return x}catch(x){let k=p(x);return h(k)}}}),T=S=>{if(a())return;let k=S.detail?.error;k&&(S.preventDefault(),S.stopPropagation(),p(k))};return y.addEventListener("sibu:error-propagate",T),At(()=>{let S=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),x=[],k=S.currentNode;for(;k;){let D=Tt(k);D&&x.push(D),k=S.nextNode()}if(x.length===1)p(x[0]);else if(x.length>1){let D=globalThis.AggregateError;p(D?new D(x,`${x.length} pre-mount errors caught by ErrorBoundary`):new Error(x.map(P=>P.message).join("; ")))}},y),E(y,()=>{f(),y.removeEventListener("sibu:error-propagate",T)}),y}var Sc=`
346
+ `,Zc=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Vi=!1;function Qc(){if(!Vi&&typeof document<"u"){let e=dt({nodes:Xc});document.head.appendChild(e),Vi=!0}}function ed(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;Qc();let[a,l]=z(null),u=()=>{g(),l(null)},c=null,g=()=>{if(!c)return;let w=c;c=null,w()},f=w=>{let C=new Array(w.length);for(let b=0;b<w.length;b++)try{C[b]=w[b]()}catch(A){O(A,{phase:"effect",name:"ErrorBoundary.resetKeys"}),C[b]=Zc}return C},m=()=>{let w=s;if(!w||w.length===0)return;g();let C=null;c=re(()=>{let b=f(w);if(C===null){C=b;return}let A=b.length!==C.length;if(!A){for(let y=0;y<b.length;y++)if(!Object.is(b[y],C[y])){A=!0;break}}C=b,A&&u()})},d=w=>{let C=Fn(w);if(l(C),m(),i)try{i(C)}catch(b){O(b,{phase:"render",name:"ErrorBoundary onError callback"})}return C},h=(w,C)=>Wr({error:w,severity:"error",onRetry:C}),v=w=>{let C=o||h;try{return C(w,u)}catch(b){return queueMicrotask(()=>{O(b,{phase:"render",name:"ErrorBoundary fallback",node:x.parentNode?x:void 0})}),document.createComment("error-boundary-failed")}},x=I({class:"sibu-error-boundary",nodes:()=>{let w=a();if(w)return v(w);try{let C=n();if(C&&typeof C.then=="function"){let b=I({class:"sibu-error-async"});b.appendChild(J({class:"sibu-lazy-loading",nodes:"Loading..."}));let A=!1;return R(b,()=>{A=!0}),C.then(y=>{if(A){D(y);return}Me(b,y)}).catch(Q(y=>{if(A)return;let L=d(y);Me(b,v(L))})),b}return C}catch(C){let b=d(C);return v(b)}}}),_=w=>{if(a())return;let b=w.detail?.error;b&&(w.preventDefault(),w.stopPropagation(),d(b))};return x.addEventListener("sibu:error-propagate",_),xn(()=>{let w=document.createTreeWalker(x,NodeFilter.SHOW_ELEMENT),C=[],b=w.currentNode;for(;b;){let A=yn(b);A&&C.push(A),b=w.nextNode()}if(C.length===1)d(C[0]);else if(C.length>1){let A=globalThis.AggregateError;d(A?new A(C,`${C.length} pre-mount errors caught by ErrorBoundary`):new Error(C.map(y=>y.message).join("; ")))}},x),R(x,()=>{g(),x.removeEventListener("sibu:error-propagate",_)}),x}var td=`
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
- `,ho=!1;function vc(){!ho&&typeof document<"u"&&(document.head.appendChild(Le({nodes:Sc})),ho=!0)}function xc(e={}){vc();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?_({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[_({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]):_({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[_({class:"sibu-loading-spinner"}),t?H({class:"sibu-loading-text"},t):null])}var kn=Symbol.for("sibujs.actions.v1"),So=globalThis[kn]??(globalThis[kn]=new Map);function Ue(e,t){So.set(e,t)}function vo(e){return So.get(e)}function Ec(e,t,n){let r=typeof t=="string"?vo(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"&&E(e,o)}var xo=(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)},yo=["pointerup","pointerleave","pointercancel"],Eo=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=l=>{let c=l.pointerId;r!==null&&c!==o||(i(),o=c,r=setTimeout(()=>{r=null,t.callback()},n))},a=l=>{r!==null&&l.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let l of yo)e.addEventListener(l,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let l of yo)e.removeEventListener(l,a)}},To=(e,t)=>{let n=o=>w(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)},wo=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)},ko=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)};Ue("clickOutside",xo);Ue("longPress",Eo);Ue("copyOnClick",To);Ue("autoResize",wo);Ue("trapFocus",ko);function Ct(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 Pe=null;function Tc(e,t){try{let n=e(),r=Ct(n);return r&&r.then(void 0,o=>{t?t(o,"async"):Pe?Pe(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):Pe?Pe(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"):Pe?Pe(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function kc(e){Pe=e}function Ac(e,t){let n=typeof t=="function"?t():t;return E(n,$(()=>{n.style.display=e()?"":"none"},n)),n}function Ao(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}function _o(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,l=r.has(s),c=!a&&!l;return r.add(s),l&&void 0,t.nextSibling!==s&&e.insertBefore(s,t.nextSibling),{node:s,owned:c}}function Nt(e,t){t&&L(e),e.parentNode?.removeChild(e)}function An(e,t,n,r){W(),Ao(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("when"),a=re(),l=null,c,u=!1,f=!1,m=new WeakSet,g=!1,p=()=>{if(f)return;let h=e(),y=s.parentNode;if(!y||u&&Object.is(h,c))return;c=h;let T=l?et([l]):null;l?.parentNode&&(Nt(l,g),l=null);let S=h?t:o!==void 0?o:null,x=ee(()=>F(a,()=>_o(y,s,S,m,"when")));l=x.node,g=x.owned,We(T,l?[l]:[],"when",i),u=!0},b=Re(p,s);return E(s,()=>{f=!0,b.stop(),l&&Nt(l,g),l=null}),u||queueMicrotask(z(()=>{!f&&!u&&s.parentNode&&b.run(p)})),s}function _c(e,t,n,r){W(),Ao(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("match"),a=re(),l=null,c,u=!1,f=!1,m=new WeakSet,g=!1,p=()=>{if(f)return;let h=String(e()),y=s.parentNode;if(!y||u&&h===c)return;c=h;let T=l?et([l]):null;l?.parentNode&&(Nt(l,g),l=null);let S=Object.hasOwn(t,h)?t[h]:o,x=ee(()=>F(a,()=>_o(y,s,S??null,m,"match")));l=x.node,g=x.owned,We(T,l?[l]:[],"match",i),u=!0},b=Re(p,s);return E(s,()=>{f=!0,b.stop(),l&&Nt(l,g),l=null}),u||queueMicrotask(z(()=>{!f&&!u&&s.parentNode&&b.run(p)})),s}function Co(e,t={}){let n=nt(),[r,o]=C(!n&&!se());return!n&&!r()&&Kn(()=>o(!0)),An(r,e,t.fallback)}function Cc(e){let[t,n]=C(e),r=i=>{!!1||!j()||(`${i}`,void 0)};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 l=s();return!1,l}finally{n(a)}}}}var _n=Symbol.for("sibujs.createId.v1"),Cn=globalThis[_n]??(globalThis[_n]={n:0});function No(e="sibu"){let t=mn();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(Cn.n++,`${e}-${Cn.n}`)}function Ro(){Cn.n=0}function ot(e,t){let n=globalThis;return n[e]??(n[e]=t())}var Rt=ot(Symbol.for("sibujs.components.registry.v1"),()=>new Map),Lo=ot(Symbol.for("sibujs.components.registryVersion.v1"),()=>C(0));function Mo(){let[e,t]=Lo;t(ee(e)+1)}function Nc(e,t){Rt.set(e,t),Mo()}function Rc(e){Rt.delete(e)&&Mo()}function Lc(e){let t=Rt.get(e);return t?t():_(`[Component "${e}" not found]`)}function Mc(e){let t=_({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(Lo[0](),a=Rt.get(s));let l=a??`missing:${s}`;if(l===r)return;let c=ee(()=>a?a():_(`[Component "${s}" not found]`));r=l,U(t,c)}let i=$(o,t,!0);return E(t,i),t}function Oo(e){return typeof e=="function"?Oo(e()):e instanceof Node?e:document.createTextNode(String(e))}function Oc(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let l=e[a],c=0,u=n.length;for(;c<u;){let f=c+u>>1;e[n[f]]<l?c=f+1:u=f}n[c]=a,r[a]=c>0?n[c-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 Dc(e,t,n){n&&n.key,W();let r=document.createComment("each:anchor"),o=re(),i=document.createComment("each:end"),s=[],a=[],l=s,c=0,u=new Map,f=new Map,m=[],g=[],p=[],b=0,h=[],y=[],T=new Uint8Array(0),S=new Map,x=[],k=[],D=new Map,P=!1,Je=!1,st=!1,Yo=n.key,Dn=()=>{if(st)return;let te=e(),N=te.length,pe=r.parentNode;if(!pe)return;if(!Je){let v=se()?Hc(r):null;v?pe.replaceChild(i,v):pe.insertBefore(i,r.nextSibling),Je=!0}y.length<N&&(y=new Array(N));for(let v=0;v<N;v++)y[v]=Yo(te[v]);let me=y;h.length<N&&(h=new Array(N)),f.clear(),D.clear();for(let v=0;v<N;v++)!1,D.set(me[v],v);b=0;for(let v=0;v<N;v++){let I=me[v],$n=u.get(I),Ge;if($n!==void 0)Ge=$n,m[b]=Ge,g[b]=te[v],p[b]=v,b++;else{let[In,ei]=C(te[v]),[Bn,ti]=C(v),Ot;try{Ae();try{Ot=Oo(F(qn(o,I),()=>t(In,Bn)))}finally{_e()}}catch(ni){let ri=me[v];Ot=document.createComment(`each:error:${v}`),queueMicrotask(()=>{w(ni,{phase:"render",name:`each row (key="${String(ri)}")`,node:r.parentNode?r:void 0})})}Ge={node:Ot,item:In,setItem:ei,index:Bn,setIndex:ti}}f.set(I,Ge),h[v]=Ge.node}for(let[v,I]of u)f.has(v)||(L(I.node),I.node.parentNode&&pe.removeChild(I.node));if(N===0){c=0;let v=u;u=f,f=v,P=!0,b=0;return}S.clear();for(let v=0;v<c;v++)S.set(l[v],v);x.length<N&&(x=new Array(N),k=new Array(N));let at=0;for(let v=0;v<N;v++){let I=S.get(me[v]);I!==void 0&&(x[at]=v,k[at]=I,at++)}let Pn=Oc(k,at);T.length<N?T=new Uint8Array(N):T.fill(0,0,N);for(let v=0;v<Pn.length;v++)T[x[Pn[v]]]=1;let lt=i;for(let v=N-1;v>=0;v--){let I=h[v];T[v]||I.nextSibling!==lt&&pe.insertBefore(I,lt),lt=I}let ct=l===s?a:s;ct.length<N&&(ct.length=N);for(let v=0;v<N;v++)ct[v]=me[v];l=ct,c=N;let Qo=u;u=f,f=Qo,P=!0,Zo()};function Zo(){if(b===0)return;let te=b;b=0,V(()=>{for(let N=0;N<te;N++){let pe=m[N];pe.setItem(g[N]),pe.setIndex(p[N]),m[N]=void 0,g[N]=void 0}})}let Hn=Re(Dn),Xo=Hn.stop;return E(r,()=>{if(!st){st=!0,Xo();for(let te of u.values())L(te.node),te.node.parentNode?.removeChild(te.node);i.parentNode&&i.parentNode.removeChild(i),Je=!1,u.clear(),f.clear(),D.clear(),S.clear(),c=0,m.length=0,g.length=0,p.length=0,b=0}}),P||queueMicrotask(z(()=>{!P&&!st&&r.parentNode&&Hn.run(Dn)})),r}function Hc(e){let t=0;for(let n=e.nextSibling;n;n=n.nextSibling){if(n.nodeType!==8)continue;let r=n.data;if(r==="each:anchor")t++;else if(r==="each:end"){if(t===0)return n;t--}}return null}function Pc(e){W();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"||Do(t,r);else Do(t,n);return t}function Do(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),E(n,ue(n,t));return}e.appendChild(document.createTextNode(String(t)))}var $c=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ho=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Po=new WeakMap;function Ic(e){let t=e.length-1,n=e[0];for(let g=0;g<t;g++)n+=`\0${g}\0${e[g+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 g=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=g,-1):p}function a(){let g=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(g,r)}function l(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let g=s();if(g>=0)return{kind:"expr",idx:g};let p=n[r];if(p==='"'||p==="'"){r++;let b=[],h=[],y="";for(;r<o&&n[r]!==p;){let T=s();T>=0?(b.push(y),y="",h.push(T)):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 T=n.charCodeAt(r);if(T===32||T===9||T===10||T===13||T===62)break;let S=s();S>=0?(b.push(y),y="",h.push(S)):y+=n[r++]}return b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function c(){let g=[];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=l();b.startsWith("on:")?h.kind==="expr"&&g.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?g.push({t:4,name:b}):h.kind==="static"?g.push({t:0,name:b,value:h.value}):h.kind==="expr"?g.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&g.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return g}function u(g){return g.replace(/\s+/g," ")}function f(g){let p="";for(;r<o&&n[r]!=="<";){let h=s();if(h>=0){let y=u(p);y&&g.push({t:1,value:y}),p="",g.push({t:2,idx:h})}else p+=n[r++]}let b=u(p);b&&g.push({t:1,value:b})}function m(){let g=[];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 S=n.indexOf("-->",r+4);r=S===-1?o:S+3}else if(n.startsWith("<![CDATA[",r)){let S=n.indexOf("]]>",r+9);r=S===-1?o:S+3}else{let S=n.indexOf(">",r);r=S===-1?o:S+1}continue}if(p==="?"){let S=n.indexOf(">",r);r=S===-1?o:S+1;continue}if(!(p>="a"&&p<="z")&&!(p>="A"&&p<="Z")){g.push({t:1,value:"<"}),r++;continue}r++;let b=a(),h=c();i();let y=$c.has(b),T=n[r]==="/";if(T&&r++,r<o&&r++,y||T)g.push({t:0,el:{tag:b,svg:Ho.has(b),attrs:h,children:[]}});else{let S=m();if(ur(b)){for(let x=0;x<S.length;x++)if(S[x].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++),g.push({t:0,el:{tag:b,svg:Ho.has(b),attrs:h,children:S}})}}else f(g);return g}return m()}function Nn(e,t){let n=Ye(e.tag,e.svg?R:void 0);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:Jt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?E(n,Qe(n,i,s)):X(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]}X(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):!1;break}case 4:Jt(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(Nn(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),E(n,ue(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 $o(e,...t){let n=Po.get(e);return n||(n=Ic(e),Po.set(e,n)),Bo(n,t)}function Io(e,t){return Bo(e,t)}function Bo(e,t){if(W(),e.length===1&&e[0].t===0)return Nn(e[0].el,t);let n=Ye("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(Nn(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),E(n,ue(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 Bc(e,t,n){W();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&ne()&&void 0;let a,l=null,c=!1,u=!1,f=()=>{if(u)return;let p=e(),b=r.parentNode;if(!b||c&&p===a)return;l?.parentNode&&b.removeChild(l),a=p;let h=o.get(p);if(h){let y=i.indexOf(p);y!==-1&&(i.splice(y,1),i.push(p))}else{let y=t[p];if(!y){l=null,c=!0;return}if(h=y(),h.nodeType===11){let T=document.createElement("div");T.style.display="contents",T.appendChild(h),h=T}if(o.set(p,h),i.push(p),s>0&&i.length>s){let T=i.shift(),S=o.get(T);S&&(L(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(T))}}b.insertBefore(h,r.nextSibling),l=h,c=!0},m=Re(f),g=m.stop;return c||queueMicrotask(z(()=>{!c&&r.parentNode&&m.run(f)})),E(r,()=>{u=!0,g();for(let p of o.values())L(p),p.parentNode&&p.parentNode.removeChild(p);o.clear(),i.length=0,l=null}),r}function Fc(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=u=>{if(u instanceof DocumentFragment){let f=document.createComment(""),m=document.createComment("");u.insertBefore(f,u.firstChild),u.appendChild(m),o={start:f,end:m}}t.appendChild(u)},s;typeof e=="function"?s=Xn(()=>{let u=e();return i(u),u}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&Y(l,"app:init",{rootElement:s,container:t,duration:a});let c=o;return{node:s,unmount(){if(l&&Y(l,"app:unmount",{rootElement:s}),c){zc(c.start,c.end);return}L(s),s.parentNode?.removeChild(s)}}}function zc(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=ae;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){be("mount",ae,1);return}L(a),a.parentNode===n&&n.removeChild(a)}s||w(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function jc(e,t){W();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(()=>{w(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),E(n,()=>{i=!0,o&&(L(o),o.remove(),o=null)}),n}function Wc(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Fo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function Vc(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 l=[...a];return s=Fo(l,o,i),s.length===0&&i.length<=1?a:l}),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,l)=>l!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,l)=>l===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 qc(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,He(r)||ze(r)}function i(){if(Ce(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,...l){let c=Fo(t,a,l);return(c.length>0||l.length>1)&&o(),c},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let l=t.findIndex(a);l!==-1&&(t.splice(l,1),o())},set(a){t=[...a],o()},update(a,l){a<0||a>=t.length||Object.is(t[a],l)||(t[a]=l,o())},updateWhere(a,l){let c=!1;for(let u=0;u<t.length;u++)if(a(t[u])){let f=l(t[u]);Object.is(t[u],f)||(t[u]=f,c=!0)}c&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let l=t.filter(a);l.length!==t.length&&(t=l,o())},map(a){let l=!1;for(let c=0;c<t.length;c++){let u=a(t[c],c);Object.is(t[c],u)||(t[c]=u,l=!0)}l&&o()},clear(){t.length!==0&&(t=[],o())}}]}function Uc(e,t){let[n,r]=C(t),[o,i]=C(!1),[s,a]=C(null),[l,c]=C(0),u=0,f=!1,m=null,g=()=>{if(m===null)return;let b=m;m=null;try{b.abort()}catch{}},p=Z(()=>{if(l(),f)return;g();let b=++u,h=typeof AbortController<"u"?new AbortController:null;m=h,V(()=>{i(!0),a(null)});let y=()=>f||b!==u,T;try{T=e({signal:h?h.signal:void 0})}catch(S){if(y())return;V(()=>{a(S),i(!1)});return}T.then(S=>{y()||(m=null,V(()=>{r(S),i(!1)}))},S=>{y()||(m=null,V(()=>{a(S),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{f||c(b=>b+1)},dispose:()=>{f||(f=!0,p(),g())}}}function Ke(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[l,c]of e)if(!a.has(l)||!Ke(c,a.get(l),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let l of e)if(!a.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),l=new Uint8Array(t);if(a.length!==l.length)return!1;for(let c=0;c<a.length;c++)if(a[c]!==l[c])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,l=t;if(a.length!==l.length)return!1;for(let c=0;c<a.length;c++)if(a[c]!==l[c])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,l)=>Ke(a,t[l],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&&Ke(e.cause,a.cause,n)&&zo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:zo(r,o,n)}function zo(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)&&Ke(e[i],t[i],n))}function Kc(e){return C(e,{equals:(t,n)=>Ke(t,n)})}function Rn(e,t){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,l=()=>{o._d||s||(o._d=!0)};l._c=1,l._sig=o;let c=()=>{let p=e();o._v=r&&o._init&&r(o._v,p)?o._v:p,o._d=!1,o._init=!0};try{Fe(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(p){throw s=!0,Ne(l),p}let u=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,f=()=>{if(!o._d||s||a!==void 0)return;let p=o._v;i=!0;try{ve(c,l),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&&Ne(l)}u&&!s&&!Object.is(p,o._v)&&Y(u,"computed:update",{signal:o,oldValue:p,newValue:o._v})};o._validate=f;let m=()=>{let{error:p}=a;throw a=void 0,s&&(o._d=!1),p};function g(){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 Hr()||s?(o._d&&(f(),a!==void 0&&m()),o._v):(o._d&&(f(),a!==void 0&&(Ce(o),m())),Ce(o),o._v)}return n&&(g.__name=n,o.__name=n),g.__signal=o,g.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,Ne(l);let p=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(p)try{p.emit("computed:destroy",{signal:o,getter:g})}catch{}},u&&Y(u,"computed:create",{signal:o,name:n,getter:g}),g}function Jc(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function jo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Gc(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(l=>{let[c,u]=C(e[l]);jo(t,l,[c,u])});let n=new Proxy({},{get(l,c){if(typeof c=="string"&&Object.hasOwn(t,c)){let u=t[c][0];return u()}return Reflect.get(l,c)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let l={};return Object.keys(t).forEach(c=>{jo(l,c,t[c][0]())}),l};return[n,{setState:l=>{let c=r(),u=typeof l=="function"?l(c):l;V(()=>{Object.entries(u).forEach(([f,m])=>{Object.hasOwn(t,f)&&t[f][1](m)})})},reset:()=>{V(()=>{Object.keys(e).forEach(l=>{let c=t[l][1];c(e[l])})})},subscribe:l=>{let c=!0;return Z(()=>{let u=r();if(c){c=!1;return}Ae();try{l(u)}finally{_e()}})},subscribeKey:(l,c)=>{let u,f=!0;return Z(()=>{let m=t[l][0]();if(f){u=m,f=!1;return}if(!Object.is(m,u)){let g=u;u=m,Ae();try{c(m,g)}finally{_e()}}})},getSnapshot:r}]}function Yc(e,t){if(j())return()=>{};let n,r=!0;return Fe(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Ae();try{t(s,a)}finally{_e()}}})}function Zc(e,t,n){return[Rn(e,n),i=>{V(()=>t(i))}]}function Xc(e){let t=e();return ne()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function Qc(e){if(!ne())return Z(e);let t=Z(e),n=null;return queueMicrotask(()=>{try{n=Z(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Wo(e,t){return j()?()=>{}:$(e,t)}var Ln="data-sibu-enhanced",Mn=new WeakMap;function Vo(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=ae){let i=r.length-o+e.length;e.length=0,be(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var qo=["text","attr","class","show","on","cleanup"];function Uo(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 it(e,t){return Wo(t,e)}function eu(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 tu(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 nu(e,t,n,r){let o=`ctx.each[${r}]`;if(ne())for(let i of Object.keys(n))qo.includes(i),`${o}${i}${qo.join(", ")}`;if(n.text!==void 0&&(n.text,`${o}`,e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];`${o}${i}`,e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];`${o}${i}`,e.classed(t,i,s)}if(n.show!==void 0&&(n.show,`${o}`,e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];`${o}${String(i)}`,e.on(t,i,s)}n.cleanup!==void 0&&(n.cleanup,`${o}`,e.cleanup(n.cleanup))}function Lt(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 ne()&&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=m=>s?!0:!1,l=(m,g,p)=>{if(a(m))return;let b=Uo(n,g);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(g)} not found under`,n);return}p(b)},c={root:n,ref:m=>Uo(n,m),refs:m=>{let g=m.startsWith("@")?`[data-ref="${m.slice(1)}"]`:m;try{return Array.from(n.querySelectorAll(g))}catch{return[]}},on:(m,g,p,b)=>{l("on",m,h=>{let y=T=>p(T,h);h.addEventListener(g,y,b),r.push(()=>h.removeEventListener(g,y,b))})},text:(m,g)=>{l("text",m,p=>{r.push(it(p,()=>{let b=g(),h=b==null?"":String(b);p.textContent!==h&&(p.textContent=h)}))})},attr:(m,g,p)=>{l("attr",m,b=>{r.push(it(b,()=>{let h=p(),y=h==null?null:String(h);X(b,g,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(m,g,p)=>{l("classed",m,b=>{r.push(it(b,()=>{b.classList.toggle(g,!!p())}))})},show:(m,g)=>{l("show",m,p=>{let b=p.hidden;r.push(it(p,()=>{p.hidden=!g()})),r.push(()=>{p.hidden=b})})},model:(m,g,p)=>{l("model",m,b=>{let h=b,[y,T]=g,S=p?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(it(b,()=>{tu(h,y())}));let x=()=>T(eu(h));h.addEventListener(S,x),r.push(()=>h.removeEventListener(S,x))})},each:(m,g)=>{if(a("each"))return;let p=typeof m=="string"?c.refs(m):Array.from(m);for(let b=0;b<p.length;b++){let h=p[b],y=g(h,b);y!=null&&nu(c,h,y,b)}},cleanup:m=>{a("cleanup")||r.push(m)}},u;try{u=t(c);let m=u;if(m&&typeof m.then=="function")throw m.then(void 0,g=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(m){throw Vo(r,"enhance"),s=!0,m}typeof u=="function"&&r.push(u);let f=()=>{i||(i=!0,Mn.get(n)===o&&(Mn.delete(n),n.removeAttribute(Ln)),Ze(n,f),Vo(r,"enhance"),s=!0)};return E(n,f),Mn.set(n,o),n.setAttribute(Ln,"true"),f}function ru(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Lt(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 ou=/^[A-Za-z0-9_-]+$/,Ko=Symbol.for("sibujs.islands.lazy"),Mt=ot(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function iu(e){return e[Ko]=!0,e}function su(e,t){if(!ou.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Mt.set(e,t)}function au(e){Mt.delete(e)}async function lu(e){if(typeof e=="function"&&e[Ko]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function cu(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(!Mt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,l=()=>{if(a||o)return;a=!0;let u=Mt.get(s);u&&lu(u).then(f=>{if(!o){if(!f){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let m=Lt(i,f);if(o){m();return}r.push(m),i.setAttribute("data-sibu-hydrated","true")}catch(m){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,m)}}}).catch(f=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,f)})},c=i.getAttribute("data-sibu-load")||"load";n.push(uu(c,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function uu(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 Jo(e){return e}var cm=1024*1024;function du(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()}))},l=Fe(()=>{i=e(),a()}),c=(()=>t());return c.dispose=()=>{o||(o=!0,l())},c}var Go=16;function fu(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:Go*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Go)}function pu(){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=l=>{s(),w(l,{phase:"async",name:"transition"})};fu(()=>{try{let l=Ct(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function mu(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...On});})();
399
+ `,ji=!1;function nd(){!ji&&typeof document<"u"&&(document.head.appendChild(dt({nodes:td})),ji=!0)}function rd(e={}){nd();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?I({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[I({class:"sibu-loading-dots"},[J({class:"sibu-loading-dot"}),J({class:"sibu-loading-dot"}),J({class:"sibu-loading-dot"})]),t?J({class:"sibu-loading-text"},t):null]):I({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[I({class:"sibu-loading-spinner"}),t?J({class:"sibu-loading-text"},t):null])}var Vr=Symbol.for("sibujs.actions.v1"),Ui=globalThis[Vr]??(globalThis[Vr]=new Map);function Mt(e,t){Ui.set(e,t)}function Ki(e){return Ui.get(e)}function od(e,t,n){let r=typeof t=="string"?Ki(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"&&R(e,o)}var Ji=(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)},qi=["pointerup","pointerleave","pointercancel"],Gi=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=l=>{let u=l.pointerId;r!==null&&u!==o||(i(),o=u,r=setTimeout(()=>{r=null,t.callback()},n))},a=l=>{r!==null&&l.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let l of qi)e.addEventListener(l,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let l of qi)e.removeEventListener(l,a)}},Yi=(e,t)=>{let n=o=>O(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)},Xi=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)},Zi=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)};Mt("clickOutside",Ji);Mt("longPress",Gi);Mt("copyOnClick",Yi);Mt("autoResize",Xi);Mt("trapFocus",Zi);function Ot(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 mt=null;function id(e,t){try{let n=e(),r=Ot(n);return r&&r.then(void 0,o=>{t?t(o,"async"):mt?mt(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):mt?mt(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function sd(e,t){try{return await e()}catch(n){return t?t(n,"async"):mt?mt(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function ad(e){mt=e}var kn=5e3;function _e(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}var jr=50,ld=1,Qi=["transitionend","transitioncancel","animationend","animationcancel"];function Tn(e,t){return(e?.trim()?e:t).split(",").map(n=>n.trim())}function En(e){return Tn(e,"0s").map(t=>(Number.parseFloat(t)||0)*(t.endsWith("ms")?1:1e3))}function ud(e){if(typeof getComputedStyle!="function")return null;let t=getComputedStyle(e);if(t.display==="none")return null;let n={total:0,transitions:new Map,animations:new Map,pending:0},r=(o,i,s,a,l)=>{for(let u=0;u<i.length;u++){let c=s[u%s.length];if(i[u]==="none"||c<=0)continue;let g=l[u%l.length],f=g==="infinite"?Number.POSITIVE_INFINITY:Number.parseFloat(g)||1;n.total=Math.max(n.total,a[u%a.length]+c*f),o.set(i[u],(o.get(i[u])??0)+1),n.pending++}};return r(n.transitions,Tn(t.transitionProperty,"all"),En(t.transitionDuration),En(t.transitionDelay),["1"]),r(n.animations,Tn(t.animationName,"none"),En(t.animationDuration),En(t.animationDelay),Tn(t.animationIterationCount,"1")),n.total<=ld?null:n}function cd(e,t){if(typeof t!="string"||t==="")return e.keys().next().value;if(e.has(t))return t;for(let n of e.keys())if(t.startsWith(`${n}-`))return n;return e.has("all")?"all":void 0}function dd(e,t){for(let n of e)if(n!==t&&n.contains(t))return!0;return!1}function qr(e,t,n,r,o,i,s=0){let a=Math.min(typeof r=="number"&&r>=0?r:kn,kn),l=[];for(let y=0;y<e.length;y++)e[y].nodeType===1&&l.push(e[y]);let u=!1,c=null,g=[],f=y=>{if(!u){u=!0,c!==null&&clearTimeout(c);for(let L=0;L<g.length;L++)g[L]();y&&o()}},m=y=>O(y,{phase:"async",name:i,node:l[0]});if(n){let y;try{y=n(e)}catch(F){m(F)}let L=Ot(y);return L===null?(o(),null):(L.then(()=>f(!0),F=>{m(F),f(!0)}),c=setTimeout(()=>f(!0),a),{cancel:()=>f(!1)})}let d=s>0;if(!t||l.length===0&&!d)return o(),null;for(let y=0;y<l.length;y++)l[y].classList.add(t);g.push(()=>{for(let y=0;y<l.length;y++)l[y].classList.remove(t)});let h=_e()+a,v=0,x=y=>{let L=Math.min(y,h);c!==null&&L<=v||(c!==null&&clearTimeout(c),v=L,c=setTimeout(()=>f(!0),Math.max(0,L-_e())))},_=0,w=new Set,C=y=>{let L=ud(y);if(L===null)return-1;let F=typeof y.getAnimations=="function"?y.getAnimations():null;if(F!==null){if(F.length===0)return-1;_++,w.add(y);let G=F.length,pe=()=>{G===0||--G!==0||(w.delete(y),!u&&--_===0&&!d&&f(!0))};for(let S of F)S.finished.then(pe,pe);return L.total}_++,w.add(y);let te=!1,oe=null,$e=()=>{te||(te=!0,oe!==null&&clearTimeout(oe),w.delete(y),!u&&--_===0&&!d&&f(!0))},Je=G=>{if(G.target!==y||te||L.pending===0)return;let pe=G.type==="transitionend"||G.type==="transitioncancel",S=pe?L.transitions:L.animations,k=cd(S,G[pe?"propertyName":"animationName"]);if(k===void 0)return;let E=S.get(k)-1;E>0?S.set(k,E):S.delete(k),--L.pending===0&&$e()};for(let G of Qi)y.addEventListener(G,Je);return Number.isFinite(L.total)&&(oe=setTimeout($e,L.total+jr)),g.push(()=>{oe!==null&&clearTimeout(oe);for(let G of Qi)y.removeEventListener(G,Je)}),L.total},b=-1;for(let y=0;y<l.length;y++)b=Math.max(b,C(l[y]));if(_===0&&!d)return f(!0),null;_>0&&x(_e()+b+jr);let A=()=>{d=!1,!u&&_===0&&f(!0)};if(d){x(_e()+s);let y=setTimeout(A,Math.max(0,Math.min(_e()+s,h)-_e()));g.push(()=>clearTimeout(y))}return{cancel:()=>f(!1),close:A,add:y=>{if(!u)for(let L=0;L<y.length;L++){let F=y[L];if(l.includes(F)||dd(w,F))continue;F.classList.add(t),l.push(F);let te=C(F);te>=0&&x(_e()+te+jr)}}}}function fd(e,t){let n=typeof t=="function"?t():t;return R(n,Z(()=>{n.style.display=e()?"":"none"},n)),n}function ns(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}var es=new WeakMap,rs=new WeakMap,Ur=new WeakMap,pd=8,ee=()=>{};function md(e,t,n){let r=typeof e=="function"?e():e;if(r==null||typeof r=="boolean")return null;let o=r instanceof Node?r:document.createTextNode(String(r)),i=o===e,s=t.has(o),a=!i&&!s;t.add(o),s&&void 0;let l;o.nodeType===11?o.firstChild?(l=Array.from(o.childNodes),es.set(o,l)):l=es.get(o)??[]:l=[o];let u=a?void 0:Ur.get(o),c=u?.firstChild?Array.from(u.childNodes):!a&&l.every(g=>g.parentNode===null)&&rs.get(o)||gd(l);return c.length===0&&!a?null:{source:o,starts:l,nodes:c,owned:a,owner:null,phase:null,restore:null,unhold:null,waiting:!1,released:!1,inserting:!1}}function gd(e){return e.some(Ft)?[...new Set(e.flatMap(t=>t.parentNode===null?[t]:Wt([t])))]:e}function gt(e){let t=e.starts;if(t.length===1&&(!Ft(t[0])||t[0].parentNode===null))return;let n=Wt(t);e.nodes=e.owned&&e.inserting?[...new Set([...e.nodes,...n])]:n,e.owned||rs.set(e.source,e.nodes)}function hd(e,t,n){let r=e;for(let o=0;o<t.length;o++){if(!n())return!1;let i=e.parentNode;if(i===null)return!1;let s=t[o];r.parentNode!==i&&(r=e),r.nextSibling!==s&&i.insertBefore(s,r.nextSibling),r=s}return n()}function Dt(e){if(e.released)return;e.released=!0,gt(e),e.phase!==null&&(e.phase.cancel(),e.phase=null),e.restore!==null&&(e.restore(),e.restore=null);let t=e.nodes,n;!e.owned&&(e.source.nodeType===11||e.starts.some(Ft))&&(n=Ur.get(e.source),n===void 0&&Ur.set(e.source,n=document.createDocumentFragment()));for(let r=0;r<t.length;r++){let o=t[r];e.owned&&D(o),n!==void 0?n.appendChild(o):o.parentNode?.removeChild(o)}e.owned&&e.source.nodeType===11&&D(e.source),e.owner!==null&&(e.owned?e.owner.stop():e.owner.thaw?.(),e.owner=null),e.unhold!==null&&(e.unhold(),e.unhold=null)}function bd(e,t){let n=[],r=new Set,o=l=>{for(let u=0;u<l.length;u++){if(l[u].nodeType!==1||r.has(l[u]))continue;let c=l[u];r.add(c),n.push([c,c.getAttribute("inert"),c.getAttribute("aria-hidden")]),c.setAttribute("inert",""),c.setAttribute("aria-hidden","true")}},i=typeof document<"u"?document.activeElement:null;o(e.nodes);let s=n.length;for(let l=0;l<s;l++){let u=n[l][0];if(i&&(u===i||u.contains(i))){i.blur?.();break}}let a=os(e,l=>{let u=n.length;o(l),n.length>u&&t(n.slice(u).map(c=>c[0]))});return()=>{a();for(let l=0;l<n.length;l++){let[u,c,g]=n[l];c===null?u.removeAttribute("inert"):u.setAttribute("inert",c),g===null?u.removeAttribute("aria-hidden"):u.setAttribute("aria-hidden",g)}}}function os(e,t){let n=e.nodes[0]?.parentNode;if(!n||typeof MutationObserver!="function"||!e.starts.some(Ft))return ee;let r=new Set(e.nodes),o=new MutationObserver(()=>{gt(e);let i=[];for(let s of e.nodes)r.has(s)||(r.add(s),s.nodeType===1&&i.push(s));i.length>0&&t(i)});return o.observe(n,{childList:!0}),()=>o.disconnect()}function yd(e){let t=_e()+e,n={expired:!1,remaining:()=>n.expired?0:Math.max(0,Math.min(e,t-_e())),onExpire:null,stop:()=>{clearTimeout(r),n.onExpire=null}},r=setTimeout(()=>{n.expired=!0;let o=n.onExpire;n.onExpire=null,o?.()},e);return n}function ts(e,t){if(typeof MutationObserver!="function")return null;let n=new MutationObserver(t),r=new Set,o=()=>{let i=e.nodes[0]?.parentNode;i&&!r.has(i)&&(r.add(i),n.observe(i,{childList:!0}));for(let s of e.nodes)s.nodeType!==1||r.has(s)||(r.add(s),n.observe(s,{childList:!0,subtree:!0}))};return o(),{refresh:o,stop:()=>{n.disconnect(),r.clear()}}}function is(e,t,n,r){let o=r?.focus,i=r?.transition!==void 0&&!ve()?r.transition:void 0,s=document.createComment(e),a=Re(),l=Se(),u=null,c,g=!1,f=!1,m=new WeakSet,d=[],h=!1,v=null,x=ee,_=(S,k)=>{let E=ye(ee,s),M=W=>E.run(()=>Ce(()=>ae(a,W))),N;try{N=M(()=>md(S,m,e))}catch(W){throw E.stop(),W}if(N===null)return E.stop(),null;let $=N.owned;if($&&(N.owner=E),f||!k()||u!==null)return Dt(N),$||E.stop(),null;let P=null;if(i){for(let W=0;W<d.length;W++)if(d[W].source===N.source){P=d.splice(W,1)[0],N.owner=P.owner,P.owner=null;break}}u=N,N.inserting=!0;let B=!1;try{if(P!==null){let K=P;K.phase!==null&&K.phase.cancel(),K.phase=null,K.restore!==null&&K.restore(),K.restore=null;let T=K.unhold;K.unhold=null,N.owner?.thaw?.(),T?.(),N.released||gt(N)}let W=()=>!f&&k()&&u===N&&!N.released;B=W()&&M(()=>hd(s,N.nodes,W))}catch(W){throw N.inserting=!1,u===N&&(u=null),Dt(N),$||E.stop(),W}return N.inserting=!1,B&&M(()=>Ei(N.nodes)),$||E.stop(),u===N&&!N.released&&k()?N:null},w=(S,k,E,M=ee)=>{let N=!0,$=null,P=()=>{N&&(N=!1,M())},B={cancel:()=>{P(),$?.cancel()}};return S.phase=B,$=k(()=>{!N||S.phase!==B||(N=!1,S.phase=null,E())}),N&&S.phase===B&&!S.released&&!f&&$!==null?(B.add=$.add,B.close=$.close,B):(P(),S.phase===B&&(S.phase=null),$?.cancel(),null)},C=S=>{if(S.waiting=!1,S.released||f)return;let k=i;w(S,E=>qr(S.nodes,k.leaveClass,k.leave,k.maxDuration,E,`${e}(leave)`),()=>y(S))},b=()=>{for(let S of[...d]){if(f)return;S.waiting&&C(S)}},A=S=>{if(S.released)return;let k=i;S.phase!==null&&(S.phase.cancel(),S.phase=null),gt(S),S.owner!==null&&(S.owner.freeze?.(),S.unhold=un({contains:M=>S.nodes.some(N=>N===M||N.contains(M))}));let E=bd(S,M=>S.phase?.add?.(M));if(S.released){E();return}if(S.restore=E,k.mode==="in-out"){b(),S.waiting=!0,d.push(S);return}d.push(S),C(S)},y=S=>{let k=d.indexOf(S);k!==-1&&d.splice(k,1),Dt(S),h&&d.length===0&&!f&&oe()},L=(S,k)=>{if(k())return;let E=i,M=u;M!==null&&(!S||E.appear===!0)&&(F(M),k()||M.phase!==null)||E.mode==="in-out"&&b()},F=S=>{let k=i,E=typeof k.waitForContent=="number"&&k.waitForContent>0?k.waitForContent:0,M=E>0?yd(Math.min(E,kn)):null,N=()=>k.enter===void 0||M===null||M.expired||gn(S.nodes,S.owner).length===0;if(!l()&&!Sr(S.nodes)&&N()){te(S,M);return}let $=!1,P=!1,B=ee,W=ee,K=null,T=0,U=()=>{B(),B=ee,W(),W=ee,K?.stop(),K=null,M!==null&&(M.onExpire=null)},xe={cancel:()=>{$=!0,U(),M?.stop()}};S.phase=xe;let X=()=>{if(!($||f||u!==S||S.phase!==xe)){if(l()){B(),B=l.wait(X,ee);return}if(gt(S),Sr(S.nodes)&&++T<pd){queueMicrotask(X);return}if(!N()){P?K?.refresh():(P=!0,W=Er(()=>{T=0,X()}),K=ts(S,X),M.onExpire=X);return}U(),S.phase=null,te(S,M)}};l()?X():queueMicrotask(X)},te=(S,k)=>{let E=i,M=E.enter===void 0&&k!==null&&!k.expired?k.remaining():0,N=M>0?gn(S.nodes,S.owner):[];N.length===0&&k?.stop();let $=ee,P=w(S,xe=>qr(S.nodes,E.enterClass,E.enter,E.maxDuration,xe,`${e}(enter)`,N.length>0?M:0),()=>{$(),E.mode==="in-out"&&!f&&b()},()=>$()),B=P?.add;if(P===null||B===void 0){k?.stop();return}let W=os(S,B),K=ee,T=null,U=()=>{K(),K=ee,T?.stop(),T=null,k?.stop()};if(N.length>0){let xe=k,X=Ln=>{if(xe.expired||K===ee){U();return}gt(S);let Mn=Be=>S.nodes.some(Ge=>Ge===Be||Ge.contains(Be));for(let Be of Ln){if(Be.cancelled||!wr(Be,S.nodes,S.owner))continue;let Ge=Ti(Be).filter(Mn);Ge.length>0&&B(Ge)}gn(S.nodes,S.owner).length===0?(U(),P.close?.()):T?.refresh()};K=Er(X),T=ts(S,()=>X(ki())),xe.onExpire=U}$=()=>{W(),U()}},oe=Q(()=>{if(f||!h)return;if(l()){x(),x=l.wait(()=>{x=ee,h&&!f&&oe()},ee);return}h=!1;let S=v;v=null;let k=Je,E=()=>f||k!==$e;if(E()||!s.parentNode||u!==null)return;let M;try{M=pe.run(()=>_(n(c),()=>!E()))}catch(N){O(N,{phase:"render",name:e,node:s});return}E()||(At(S,M!==null?M.nodes:[],e,o),L(!1,E))}),$e=0,Je=0,G=()=>{if(f)return;let S=t();if(!s.parentNode||g&&Object.is(S,c))return;c=S;let k=!g;g=!0;let E=++$e,M=()=>f||E!==$e;u!==null&&gt(u);let N=u!==null?cn(u.nodes):null;if(u!==null){let P=u;if(i?A(P):Dt(P),u===P&&(u=null),M())return}let $=n(S);if(i?.mode==="out-in"&&d.length>0){let P=!1;for(let B=0;B<d.length&&!P;B++)P=d[B].source===$;if(!P){h=!0,Je=E,v??(v=N);return}}h=!1,_($,()=>!M()),!M()&&(At(N,u!==null?u.nodes:[],e,o),i&&L(k,M))},pe=ye(G,s);return ct(s,()=>{for(let S=0;S<=d.length;S++){let k=S<d.length?d[S]:u;if(k===null)break;let E=Wt(k.starts);if(E.length>0)return E[E.length-1]}return null}),R(s,()=>{f=!0,h=!1,v=null,x(),x=ee,pe.stop(),u!==null&&Dt(u),u=null;let S=d.splice(0);for(let k=0;k<S.length;k++)Dt(S[k])}),g||Ct(s,Q(()=>{!f&&!g&&s.parentNode&&pe.run(G)}),l),s}function Kr(e,t,n,r){ie(),ns(n)&&(r=n,n=void 0);let o=n;return is("when",e,i=>i?t:o!==void 0?o:null,r)}function Sd(e,t,n,r){ie(),ns(n)&&(r=n,n=void 0);let o=n;return is("match",()=>String(e()),i=>Object.hasOwn(t,i)?t[i]:o??null,r)}function ss(e,t={}){let n=ve(),[r,o]=z(!n&&!Ee());return!n&&!r()&&ho(()=>o(!0)),Kr(r,e,t.fallback)}function vd(e){let[t,n]=z(e),r=i=>{!!1||!ne()||(`${i}`,void 0)};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 l=s();return!1,l}finally{n(a)}}}}var Jr=Symbol.for("sibujs.createId.v1"),Gr=globalThis[Jr]??(globalThis[Jr]={n:0});function as(e="sibu"){let t=br();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(Gr.n++,`${e}-${Gr.n}`)}function ls(){Gr.n=0}var Nn=me(Symbol.for("sibujs.components.registry.v1"),()=>new Map),us=me(Symbol.for("sibujs.components.registryVersion.v1"),()=>z(0));function cs(){let[e,t]=us;t(Ce(e)+1)}function xd(e,t){Nn.set(e,t),cs()}function wd(e){Nn.delete(e)&&cs()}function Ed(e){let t=Nn.get(e);return t?t():I(`[Component "${e}" not found]`)}function Td(e){let t=I({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(us[0](),a=Nn.get(s));let l=a??`missing:${s}`;if(l===r)return;let u=Ce(()=>a?a():I(`[Component "${s}" not found]`));r=l,Me(t,u)}let i=Z(o,t,!0);return R(t,i),t}function fs(e){return typeof e=="function"?fs(e()):e instanceof Node?e:document.createTextNode(String(e))}function kd(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let l=e[a],u=0,c=n.length;for(;u<c;){let g=u+c>>1;e[n[g]]<l?u=g+1:c=g}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}var An=null,Yr=new Set;function ds(e){let t=e.__signal,n=e;return n.peek=()=>t.value,n}function Nd(e,t,n){n&&n.key,ie();let r=document.createComment("each:anchor"),o=Re(),i=document.createComment("each:end"),s=[],a=[],l=s,u=0,c=new Map,g=new Map,f=[],m=[],d=[],h=0,v=[],x=[],_=new Uint8Array(0),w=new Map,C=[],b=[],A=new Map,y=!1,L=!1,F=!1,te=n.key,oe=()=>{if(F)return;let k=e(),E=k.length,M=r.parentNode;if(!M)return;if(!L){let T=Ee()?Ad(r):null;T?M.replaceChild(i,T):M.insertBefore(i,r.nextSibling),L=!0}x.length<E&&(x=new Array(E));for(let T=0;T<E;T++)x[T]=te(k[T]);let N=x;v.length<E&&(v=new Array(E)),g.clear(),A.clear();for(let T=0;T<E;T++)!1,A.set(N[T],T);h=0;for(let T=0;T<E;T++){let U=N[T],xe=c.get(U),X;if(xe!==void 0)X=xe,f[h]=X,m[h]=k[T],d[h]=T,h++;else{let[Ln,Mn]=z(k[T]),[Be,Ge]=z(T),On=ds(Ln),Dn=ds(Be),Pn=null,oo=On,io=Dn,so=null;let Hn;try{nt(),so=An,An=Pn;try{Hn=fs(ae(mo(o,U),()=>t(oo,io)))}finally{rt(),An=so}}catch(ht){let Kt=N[T];Hn=document.createComment(`each:error:${T}`),queueMicrotask(()=>{O(ht,{phase:"render",name:`each row (key="${String(Kt)}")`,node:r.parentNode?r:void 0})})}X={node:Hn,item:On,setItem:Mn,index:Dn,setIndex:Ge,reads:Pn}}g.set(U,X),v[T]=X.node}for(let[T,U]of c)g.has(T)||(D(U.node),U.node.parentNode&&M.removeChild(U.node));if(E===0){u=0;let T=c;c=g,g=T,y=!0,h=0;return}w.clear();for(let T=0;T<u;T++)w.set(l[T],T);C.length<E&&(C=new Array(E),b=new Array(E));let $=0;for(let T=0;T<E;T++){let U=w.get(N[T]);U!==void 0&&(C[$]=T,b[$]=U,$++)}let P=kd(b,$);_.length<E?_=new Uint8Array(E):_.fill(0,0,E);for(let T=0;T<P.length;T++)_[C[P[T]]]=1;let B=i;for(let T=E-1;T>=0;T--){let U=v[T];_[T]||U.nextSibling!==B&&M.insertBefore(U,B),B=U}let W=l===s?a:s;W.length<E&&(W.length=E);for(let T=0;T<E;T++)W[T]=N[T];l=W,u=E;let K=c;c=g,g=K,y=!0,$e()};function $e(){if(h===0)return;let k=h;h=0,se(()=>{for(let E=0;E<k;E++){let M=f[E];M.reads!==null&&Je(M,m[E],d[E]),M.setItem(m[E]),M.setIndex(d[E]),f[E]=void 0,m[E]=void 0}})}function Je(k,E,M){}let G=ye(oe,r),pe=G.stop;if(R(r,()=>{if(!F){F=!0,pe();for(let k of c.values())D(k.node),k.node.parentNode?.removeChild(k.node);i.parentNode&&i.parentNode.removeChild(i),L=!1,c.clear(),g.clear(),A.clear(),w.clear(),u=0,f.length=0,m.length=0,d.length=0,h=0}}),ct(r,()=>L?i:null),!y){let k=Se();Ct(r,Q(()=>{!y&&!F&&r.parentNode&&G.run(oe)}),k)}return r}function Ad(e){let t=0;for(let n=e.nextSibling;n;n=n.nextSibling){if(n.nodeType!==8)continue;let r=n.data;if(r==="each:anchor")t++;else if(r==="each:end"){if(t===0)return n;t--}}return null}function Cd(e){ie();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"||ps(t,r);else ps(t,n);return t}function ps(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),R(n,Pe(n,t,!0));return}e.appendChild(document.createTextNode(String(t)))}var _d=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ms=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),gs=new WeakMap;function Rd(e){let t=e.length-1,n=e[0];for(let m=0;m<t;m++)n+=`\0${m}\0${e[m+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 m=r;r++;let d=0;for(;r<o&&n.charCodeAt(r)!==0;)d=d*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,d<0||d>=t?(r=m,-1):d}function a(){let m=r;for(;r<o;){let d=n.charCodeAt(r);if(d>=97&&d<=122||d>=65&&d<=90||d>=48&&d<=57||d===45)r++;else break}return n.slice(m,r)}function l(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let m=s();if(m>=0)return{kind:"expr",idx:m};let d=n[r];if(d==='"'||d==="'"){r++;let h=[],v=[],x="";for(;r<o&&n[r]!==d;){let _=s();_>=0?(h.push(x),x="",v.push(_)):x+=n[r++]}return r<o&&r++,h.push(x),v.length===0?{kind:"static",value:h[0]}:{kind:"mixed",statics:h,exprs:v}}{let h=[],v=[],x="";for(;r<o;){let _=n.charCodeAt(r);if(_===32||_===9||_===10||_===13||_===62)break;let w=s();w>=0?(h.push(x),x="",v.push(w)):x+=n[r++]}return h.push(x),v.length===0?{kind:"static",value:h[0]}:{kind:"mixed",statics:h,exprs:v}}}function u(){let m=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let d=r;for(;r<o;){let x=n.charCodeAt(r);if(x>=97&&x<=122||x>=65&&x<=90||x>=48&&x<=57||x===45||x===58||x===95||x===46)r++;else break}let h=n.slice(d,r);if(!h)break;let v=l();h.startsWith("on:")?v.kind==="expr"&&m.push({t:3,name:h.slice(3),idx:v.idx}):v.kind==="bool"?m.push({t:4,name:h}):v.kind==="static"?m.push({t:0,name:h,value:v.value}):v.kind==="expr"?m.push({t:1,name:h,idx:v.idx}):v.kind==="mixed"&&m.push({t:2,name:h,statics:v.statics,exprs:v.exprs})}return m}function c(m){return m.replace(/\s+/g," ")}function g(m){let d="";for(;r<o&&n[r]!=="<";){let v=s();if(v>=0){let x=c(d);x&&m.push({t:1,value:x}),d="",m.push({t:2,idx:v})}else d+=n[r++]}let h=c(d);h&&m.push({t:1,value:h})}function f(){let m=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let d=n[r+1];if(d==="!"){if(n.startsWith("<!--",r)){let w=n.indexOf("-->",r+4);r=w===-1?o:w+3}else if(n.startsWith("<![CDATA[",r)){let w=n.indexOf("]]>",r+9);r=w===-1?o:w+3}else{let w=n.indexOf(">",r);r=w===-1?o:w+1}continue}if(d==="?"){let w=n.indexOf(">",r);r=w===-1?o:w+1;continue}if(!(d>="a"&&d<="z")&&!(d>="A"&&d<="Z")){m.push({t:1,value:"<"}),r++;continue}r++;let h=a(),v=u();i();let x=_d.has(h),_=n[r]==="/";if(_&&r++,r<o&&r++,x||_)m.push({t:0,el:{tag:h,svg:ms.has(h),attrs:v,children:[]}});else{let w=f();if(Mo(h)){for(let C=0;C<w.length;C++)if(w[C].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,a(),i(),r<o&&n[r]===">"&&r++),m.push({t:0,el:{tag:h,svg:ms.has(h),attrs:v,children:w}})}}else g(m);return m}return f()}function Xr(e,t){let n=Ht(e.tag,e.svg?V:void 0);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:nr(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?R(n,Bt(n,i,s)):ge(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]}ge(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):!1;break}case 4:nr(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(Xr(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),R(n,Pe(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 hs(e,...t){let n=gs.get(e);return n||(n=Rd(e),gs.set(e,n)),ys(n,t)}function bs(e,t){return ys(e,t)}function ys(e,t){if(ie(),e.length===1&&e[0].t===0)return Xr(e[0].el,t);let n=Ht("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(Xr(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),R(n,Pe(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 Ld(e,t,n){ie();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&we()&&void 0;let a,l=null,u=!1,c=!1,g=()=>{if(c)return;let d=e(),h=r.parentNode;if(!h||u&&d===a)return;l?.parentNode&&h.removeChild(l),a=d;let v=o.get(d);if(v){let x=i.indexOf(d);x!==-1&&(i.splice(x,1),i.push(d))}else{let x=t[d];if(!x){l=null,u=!0;return}if(v=x(),v.nodeType===11){let _=document.createElement("div");_.style.display="contents",_.appendChild(v),v=_}if(o.set(d,v),i.push(d),s>0&&i.length>s){let _=i.shift(),w=o.get(_);w&&(D(w),w.parentNode&&w.parentNode.removeChild(w),o.delete(_))}}h.insertBefore(v,r.nextSibling),l=v,u=!0},f=ye(g,r);Ni(r,()=>[l]);let m=f.stop;if(!u){let d=Se();Ct(r,Q(()=>{!u&&r.parentNode&&f.run(g)}),d)}return R(r,()=>{c=!0,m();for(let d of o.values())D(d),d.parentNode&&d.parentNode.removeChild(d);o.clear(),i.length=0,l=null}),r}function Md(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=c=>{if(c instanceof DocumentFragment){let g=document.createComment(""),f=document.createComment("");c.insertBefore(g,c.firstChild),c.appendChild(f),o={start:g,end:f}}t.appendChild(c)},s;typeof e=="function"?s=bt(()=>{let c=e();return i(c),c}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&fe(l,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(l&&fe(l,"app:unmount",{rootElement:s}),u){Od(u.start,u.end);return}D(s),s.parentNode?.removeChild(s)}}}function Od(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=Le;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){Fe("mount",Le,1);return}D(a),a.parentNode===n&&n.removeChild(a)}s||O(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function Zr(e,t){if(ne())return()=>{};let n,r=!0;return Tt(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,nt();try{t(s,a)}finally{rt()}}})}var Dd=["active","paused","ended"],Ss=2,Cn=()=>{},vs=me(Symbol.for("sibujs.lifecycleScope.owners.v1"),()=>new WeakMap);function Qr(e){return vs.get(e)}function Pd(){let e=Se(),t=Q(s=>s()),n=()=>e.state()===Ss,r=s=>{let a=!1,l=null,u=Cn,c=Cn,g=()=>{if(a)return;a=!0,u(),c();let d=l;l=null,d?.()},f=()=>{if(u=Cn,a||(c=e.onEnd(g),a))return;let d;try{d=e.run(()=>t(s))}catch(h){throw a=!0,c(),c=Cn,h}a?d():l=d},m=e.state();return m===Ss?a=!0:m===1?u=e.wait(f,g):f(),g},o=(s,a)=>e.onChange(l=>{l===s&&e.run(()=>t(a))}),i={state:()=>Dd[e.state()],own:r,onPause:s=>o(1,s),onResume:s=>o(0,s),effect:(s,a)=>r(()=>re(l=>{n()||s(l)},a)),watch:(s,a)=>r(()=>Zr(s,(l,u)=>{n()||a(l,u)}))};return vs.set(i,e),i}var xs={done:()=>{},cancel:()=>{},settled:!0};function ws(e){if(ve())return xs;let t=typeof e.nodeType=="number",n=t?null:Qr(e)??null;if(!t&&(n===null||n.state()===2))return xs;let{entry:r,done:o,cancel:i}=vr(t?e:null,n),s=()=>{},a=()=>{r.settled||(s(),i())};return t?(R(e,a),s=()=>{Xe(e,a)}):s=n.onEnd(a),{done:l=>{r.settled||(s(),o(l===void 0?null:typeof l.nodeType=="number"?[l]:[...l]))},cancel:a,get settled(){return r.settled}}}function Hd(e,t){ie();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=Q(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{O(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),R(n,()=>{i=!0,o&&(D(o),o.remove(),o=null)}),n}function Id(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Es(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function $d(e=[]){let[t,n]=z([...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 l=[...a];return s=Es(l,o,i),s.length===0&&i.length<=1?a:l}),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,l)=>l!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,l)=>l===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 Bd(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,pt(r)||kt(r)}function i(){if(ot(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,...l){let u=Es(t,a,l);return(u.length>0||l.length>1)&&o(),u},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let l=t.findIndex(a);l!==-1&&(t.splice(l,1),o())},set(a){t=[...a],o()},update(a,l){a<0||a>=t.length||Object.is(t[a],l)||(t[a]=l,o())},updateWhere(a,l){let u=!1;for(let c=0;c<t.length;c++)if(a(t[c])){let g=l(t[c]);Object.is(t[c],g)||(t[c]=g,u=!0)}u&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let l=t.filter(a);l.length!==t.length&&(t=l,o())},map(a){let l=!1;for(let u=0;u<t.length;u++){let c=a(t[u],u);Object.is(t[u],c)||(t[u]=c,l=!0)}l&&o()},clear(){t.length!==0&&(t=[],o())}}]}function zd(e,t){let[n,r]=z(t),[o,i]=z(!1),[s,a]=z(null),[l,u]=z(0),c=0,g=!1,f=null,m=()=>{if(f===null)return;let h=f;f=null;try{h.abort()}catch{}},d=re(()=>{if(l(),g)return;m();let h=++c,v=typeof AbortController<"u"?new AbortController:null;f=v,se(()=>{i(!0),a(null)});let x=()=>g||h!==c,_;try{_=e({signal:v?v.signal:void 0})}catch(w){if(x())return;se(()=>{a(w),i(!1)});return}_.then(w=>{x()||(f=null,se(()=>{r(w),i(!1)}))},w=>{x()||(f=null,se(()=>{a(w),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{g||u(h=>h+1)},dispose:()=>{g||(g=!0,d(),m())}}}function Pt(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[l,u]of e)if(!a.has(l)||!Pt(u,a.get(l),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let l of e)if(!a.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),l=new Uint8Array(t);if(a.length!==l.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==l[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,l=t;if(a.length!==l.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==l[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,l)=>Pt(a,t[l],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&&Pt(e.cause,a.cause,n)&&Ts(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:Ts(r,o,n)}function Ts(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)&&Pt(e[i],t[i],n))}function Fd(e){return z(e,{equals:(t,n)=>Pt(t,n)})}function eo(e,t){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,l=()=>{o._d||s||(o._d=!0)};l._c=1,l._sig=o;let u=()=>{let d=e();o._v=r&&o._init&&r(o._v,d)?o._v:d,o._d=!1,o._init=!0};try{Tt(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(d){throw s=!0,it(l),d}let c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,g=()=>{if(!o._d||s||a!==void 0)return;let d=o._v;i=!0;try{qe(u,l),Object.is(d,o._v)||o.__v++}catch(h){a={error:h},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&it(l)}c&&!s&&!Object.is(d,o._v)&&fe(c,"computed:update",{signal:o,oldValue:d,newValue:o._v})};o._validate=g;let f=()=>{let{error:d}=a;throw a=void 0,s&&(o._d=!1),d};function m(){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 an()||s?(o._d&&(g(),a!==void 0&&f()),o._v):(o._d&&(g(),a!==void 0&&(ot(o),f())),ot(o),o._v)}return n&&(m.__name=n,o.__name=n),m.__signal=o,m.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,it(l);let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(d)try{d.emit("computed:destroy",{signal:o,getter:m})}catch{}},c&&fe(c,"computed:create",{signal:o,name:n,getter:m}),m}function Wd(e){let[t,n]=z(e);return{get current(){return t()},set current(r){n(r)}}}function ks(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Vd(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(l=>{let[u,c]=z(e[l]);ks(t,l,[u,c])});let n=new Proxy({},{get(l,u){if(typeof u=="string"&&Object.hasOwn(t,u)){let c=t[u][0];return c()}return Reflect.get(l,u)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let l={};return Object.keys(t).forEach(u=>{ks(l,u,t[u][0]())}),l};return[n,{setState:l=>{let u=r(),c=typeof l=="function"?l(u):l;se(()=>{Object.entries(c).forEach(([g,f])=>{Object.hasOwn(t,g)&&t[g][1](f)})})},reset:()=>{se(()=>{Object.keys(e).forEach(l=>{let u=t[l][1];u(e[l])})})},subscribe:l=>{let u=!0;return re(()=>{let c=r();if(u){u=!1;return}nt();try{l(c)}finally{rt()}})},subscribeKey:(l,u)=>{let c,g=!0;return re(()=>{let f=t[l][0]();if(g){c=f,g=!1;return}if(!Object.is(f,c)){let m=c;c=f,nt();try{u(f,m)}finally{rt()}}})},getSnapshot:r}]}function jd(e,t,n){return[eo(e,n),i=>{se(()=>t(i))}]}function qd(e){let t=e();return we()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function Ud(e){if(!we())return re(e);let t=re(e),n=null;return queueMicrotask(()=>{try{n=re(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Ns(e,t){return ne()?()=>{}:Z(e,t)}var to="data-sibu-enhanced",no=new WeakMap;function As(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=Le){let i=r.length-o+e.length;e.length=0,Fe(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var Cs=["text","attr","class","show","on","cleanup"];function _s(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 Ut(e,t){return Ns(t,e)}function Kd(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 Jd(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 Gd(e,t,n,r){let o=`ctx.each[${r}]`;if(we())for(let i of Object.keys(n))Cs.includes(i),`${o}${i}${Cs.join(", ")}`;if(n.text!==void 0&&(n.text,`${o}`,e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];`${o}${i}`,e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];`${o}${i}`,e.classed(t,i,s)}if(n.show!==void 0&&(n.show,`${o}`,e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];`${o}${String(i)}`,e.on(t,i,s)}n.cleanup!==void 0&&(n.cleanup,`${o}`,e.cleanup(n.cleanup))}function _n(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(to)==="true")return we()&&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=f=>s?!0:!1,l=(f,m,d)=>{if(a(f))return;let h=_s(n,m);if(!h){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(m)} not found under`,n);return}d(h)},u={root:n,ref:f=>_s(n,f),refs:f=>{let m=f.startsWith("@")?`[data-ref="${f.slice(1)}"]`:f;try{return Array.from(n.querySelectorAll(m))}catch{return[]}},on:(f,m,d,h)=>{l("on",f,v=>{let x=_=>d(_,v);v.addEventListener(m,x,h),r.push(()=>v.removeEventListener(m,x,h))})},text:(f,m)=>{l("text",f,d=>{r.push(Ut(d,()=>{let h=m(),v=h==null?"":String(h);d.textContent!==v&&(d.textContent=v)}))})},attr:(f,m,d)=>{l("attr",f,h=>{r.push(Ut(h,()=>{let v=d(),x=v==null?null:String(v);ge(h,m,x,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(f,m,d)=>{l("classed",f,h=>{r.push(Ut(h,()=>{h.classList.toggle(m,!!d())}))})},show:(f,m)=>{l("show",f,d=>{let h=d.hidden;r.push(Ut(d,()=>{d.hidden=!m()})),r.push(()=>{d.hidden=h})})},model:(f,m,d)=>{l("model",f,h=>{let v=h,[x,_]=m,w=d?.event??(v instanceof HTMLSelectElement||v instanceof HTMLInputElement&&(v.type==="checkbox"||v.type==="radio")?"change":"input");r.push(Ut(h,()=>{Jd(v,x())}));let C=()=>_(Kd(v));v.addEventListener(w,C),r.push(()=>v.removeEventListener(w,C))})},each:(f,m)=>{if(a("each"))return;let d=typeof f=="string"?u.refs(f):Array.from(f);for(let h=0;h<d.length;h++){let v=d[h],x=m(v,h);x!=null&&Gd(u,v,x,h)}},cleanup:f=>{a("cleanup")||r.push(f)}},c;try{c=t(u);let f=c;if(f&&typeof f.then=="function")throw f.then(void 0,m=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(f){throw As(r,"enhance"),s=!0,f}typeof c=="function"&&r.push(c);let g=()=>{i||(i=!0,no.get(n)===o&&(no.delete(n),n.removeAttribute(to)),Xe(n,g),As(r,"enhance"),s=!0)};return R(n,g),no.set(n,o),n.setAttribute(to,"true"),g}function Yd(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(_n(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 Xd=/^[A-Za-z0-9_-]+$/,Rs=Symbol.for("sibujs.islands.lazy"),Rn=me(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Zd(e){return e[Rs]=!0,e}function Qd(e,t){if(!Xd.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Rn.set(e,t)}function ef(e){Rn.delete(e)}async function tf(e){if(typeof e=="function"&&e[Rs]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function nf(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(!Rn.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,l=()=>{if(a||o)return;a=!0;let c=Rn.get(s);c&&tf(c).then(g=>{if(!o){if(!g){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let f=_n(i,g);if(o){f();return}r.push(f),i.setAttribute("data-sibu-hydrated","true")}catch(f){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,f)}}}).catch(g=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,g)})},u=i.getAttribute("data-sibu-load")||"load";n.push(rf(u,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function rf(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 Ls(e){return e}var Lh=1024*1024;function of(e){let[t,n]=z(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},l=Tt(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,l())},u}var Ms=16;function sf(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:Ms*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Ms)}function af(){let[e,t]=z(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=l=>{s(),O(l,{phase:"async",name:"transition"})};sf(()=>{try{let l=Ot(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function lf(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...ro});})();
@@ -5,7 +5,7 @@ import {
5
5
  resumeTracking,
6
6
  suspendTracking,
7
7
  track
8
- } from "./chunk-LAHX7XFG.js";
8
+ } from "./chunk-GFM5WWPU.js";
9
9
  import {
10
10
  devAssert
11
11
  } from "./chunk-NT3ZYB5S.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SVG_NS,
3
3
  tagFactory
4
- } from "./chunk-ZKI4SDZ2.js";
4
+ } from "./chunk-VSTX3XSX.js";
5
5
 
6
6
  // src/core/rendering/html.ts
7
7
  var html = tagFactory("html");