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