sibujs 4.13.1 → 4.14.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.
- package/README.md +1 -1
- package/dist/browser.cjs +15 -2
- package/dist/browser.js +9 -7
- package/dist/build.cjs +880 -281
- package/dist/build.d.cts +68 -3
- package/dist/build.d.ts +68 -3
- package/dist/build.js +88 -30
- package/dist/cdn.dev.global.js +12 -12
- package/dist/cdn.full.dev.global.js +13 -13
- package/dist/cdn.full.global.js +12 -12
- package/dist/cdn.global.js +12 -12
- package/dist/{chunk-5RIBLY2N.js → chunk-2TTRW2TE.js} +6 -6
- package/dist/{chunk-J6FW5TV6.js → chunk-3HEX6QJQ.js} +5 -3
- package/dist/chunk-3HZOSMPX.js +90 -0
- package/dist/{chunk-QKFVMIAV.js → chunk-4FJSAUKB.js} +11 -3
- package/dist/{chunk-OIKD7YDY.js → chunk-4TQDTWWN.js} +6 -5
- package/dist/{chunk-5XUGJM3J.js → chunk-7ILEHTVX.js} +1 -1
- package/dist/{chunk-EU7T7EB3.js → chunk-A454RAEK.js} +4 -4
- package/dist/{chunk-QC3NP47A.js → chunk-AE32RGWX.js} +10 -6
- package/dist/{chunk-EXXSN3BW.js → chunk-B3HOT4TK.js} +1 -1
- package/dist/{chunk-QZ47OZ25.js → chunk-BKZ5N6NK.js} +8 -6
- package/dist/{chunk-2O6JJCUR.js → chunk-BNXRWZZV.js} +49 -8
- package/dist/chunk-BOYKGGVD.js +2015 -0
- package/dist/{chunk-22OPSWMF.js → chunk-CCKUNHVU.js} +2 -2
- package/dist/{chunk-CPQKWCJ2.js → chunk-CJ7KS3DF.js} +16 -10
- package/dist/chunk-CNPT6NKV.js +1859 -0
- package/dist/{chunk-2NC56RGY.js → chunk-F67F77IA.js} +2 -2
- package/dist/{chunk-TUCPL2HB.js → chunk-GIJ33UJZ.js} +1 -1
- package/dist/chunk-GVAMIU6K.js +195 -0
- package/dist/{chunk-K4LNUT5L.js → chunk-HQIAL7F2.js} +8 -6
- package/dist/{chunk-C73VBPEF.js → chunk-JTFQ7IL4.js} +8 -8
- package/dist/{chunk-AM6DZLBM.js → chunk-LJMX4SQ7.js} +2 -2
- package/dist/{chunk-4UTGDVSA.js → chunk-MIRKTVH4.js} +7 -14
- package/dist/{chunk-YFTBCCVH.js → chunk-N7A6FKWW.js} +5 -3
- package/dist/chunk-NT3ZYB5S.js +167 -0
- package/dist/{chunk-VFPLWUT7.js → chunk-QS6GMWDD.js} +151 -86
- package/dist/chunk-R5U7XKVJ.js +16 -0
- package/dist/{chunk-ADZHPN2B.js → chunk-RVR5NPFL.js} +3 -3
- package/dist/{chunk-F2UWOZ6J.js → chunk-RVWJGWCL.js} +2 -2
- package/dist/{chunk-NYNYSPK7.js → chunk-S37PZD6I.js} +30 -45
- package/dist/{chunk-G3Z2FEBR.js → chunk-SVULV7O4.js} +119 -26
- package/dist/{chunk-PBJYCE2Z.js → chunk-TLS4NVIB.js} +5 -5
- package/dist/{chunk-KC62VURU.js → chunk-UUIKJJIK.js} +10 -8
- package/dist/chunk-UYTYNCMZ.js +199 -0
- package/dist/chunk-VM2U5LEL.js +2596 -0
- package/dist/{chunk-J4X7ICH4.js → chunk-Y4LUM2XS.js} +8 -6
- package/dist/data.cjs +265 -35
- package/dist/data.d.cts +31 -1
- package/dist/data.d.ts +31 -1
- package/dist/data.js +16 -10
- package/dist/devtools.cjs +15 -2
- package/dist/devtools.js +9 -7
- package/dist/{dispose-GEIG2KOF.js → dispose-EIHHHDC7.js} +3 -1
- package/dist/ecosystem.cjs +62 -23
- package/dist/ecosystem.js +14 -12
- package/dist/extras.cjs +3520 -270
- package/dist/extras.d.cts +3 -3
- package/dist/extras.d.ts +3 -3
- package/dist/extras.js +39 -29
- package/dist/index.cjs +442 -253
- package/dist/index.d.cts +93 -283
- package/dist/index.d.ts +93 -283
- package/dist/index.js +26 -16
- package/dist/motion.cjs +12 -1
- package/dist/motion.js +6 -4
- package/dist/patterns.cjs +15 -2
- package/dist/patterns.js +10 -8
- package/dist/performance.cjs +36 -2
- package/dist/performance.d.cts +2 -2
- package/dist/performance.d.ts +2 -2
- package/dist/performance.js +14 -10
- package/dist/plugins.cjs +5225 -1807
- package/dist/plugins.d.cts +8 -834
- package/dist/plugins.d.ts +8 -834
- package/dist/plugins.js +64 -2329
- package/dist/prerenderServer-MXJEVWA3.js +350 -0
- package/dist/renderRoute-DP20XwMS.d.cts +86 -0
- package/dist/renderRoute-fxgsm2Ir.d.ts +86 -0
- package/dist/routeHead-CE9SV-cH.d.cts +995 -0
- package/dist/routeHead-DzVxPviY.d.ts +995 -0
- package/dist/{routeMiddleware-B1sp4P7a.d.ts → routeMiddleware-BySbueoE.d.ts} +0 -25
- package/dist/{routeMiddleware-CedQTsLK.d.cts → routeMiddleware-CijZD5eW.d.cts} +0 -25
- package/dist/ssr-JpGpHnpC.d.cts +841 -0
- package/dist/ssr-JpGpHnpC.d.ts +841 -0
- package/dist/{ssr-VBM6J5SJ.js → ssr-NECEU4X4.js} +15 -6
- package/dist/ssr-dom.cjs +1862 -0
- package/dist/ssr-dom.d.cts +341 -0
- package/dist/ssr-dom.d.ts +341 -0
- package/dist/ssr-dom.js +19 -0
- package/dist/ssr.cjs +7630 -2064
- package/dist/ssr.d.cts +63 -5
- package/dist/ssr.d.ts +63 -5
- package/dist/ssr.js +136 -14
- package/dist/testing.cjs +6543 -87
- package/dist/testing.d.cts +80 -1
- package/dist/testing.d.ts +80 -1
- package/dist/testing.js +117 -4
- package/dist/ui.cjs +36 -2
- package/dist/ui.js +17 -14
- package/dist/widgets.cjs +14 -1
- package/dist/widgets.js +11 -9
- package/package.json +9 -2
- package/dist/chunk-2F4PSJ5Z.js +0 -765
- package/dist/chunk-7XHATCIH.js +0 -121
- package/dist/chunk-B36ADEIR.js +0 -21
- package/dist/ssr-Db0Sgdu3.d.cts +0 -245
- package/dist/ssr-Db0Sgdu3.d.ts +0 -245
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(()=>{var Go=Object.defineProperty;var jt=(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 Bn=(e,t)=>{for(var n in t)Go(e,n,{get:t[n],enumerable:!0})};var Dn={};Bn(Dn,{DynamicComponent:()=>yl,ErrorBoundary:()=>rl,ErrorDisplay:()=>Cn,Fragment:()=>xl,KeepAlive:()=>El,Loading:()=>sl,MAX_DRAIN_TEARDOWNS:()=>ve,Portal:()=>Cl,SVG_NS:()=>I,Suspense:()=>jr,__renderParsedTemplate:()=>Ao,__resetIdCounter:()=>yo,a:()=>$s,abbr:()=>Hs,action:()=>al,address:()=>Ss,area:()=>ua,array:()=>Nl,article:()=>ms,aside:()=>vs,asyncDerived:()=>Ll,audio:()=>la,autoResize:()=>go,b:()=>Is,base:()=>ru,batch:()=>U,bdi:()=>Bs,bdo:()=>Vs,bindDynamic:()=>Or,blockquote:()=>_s,body:()=>ds,br:()=>js,button:()=>dt,canvas:()=>Ta,caption:()=>Aa,catchError:()=>ul,catchErrorAsync:()=>ll,center:()=>_u,checkLeaks:()=>Kn,circle:()=>su,cite:()=>Fs,clickOutside:()=>fo,clipPath:()=>hu,code:()=>bn,col:()=>Na,colgroup:()=>Ra,context:()=>dl,copyOnClick:()=>mo,createId:()=>ho,customElement:()=>Nu,data:()=>zs,datalist:()=>Ia,dd:()=>Cs,deepEqual:()=>rt,deepSignal:()=>Ml,defer:()=>Xl,defs:()=>bu,del:()=>_a,derived:()=>Ue,details:()=>Xa,dfn:()=>Ws,dialog:()=>Za,disableSSR:()=>Gr,dispose:()=>F,div:()=>P,dl:()=>As,dt:()=>Ns,each:()=>Sl,effect:()=>te,ellipse:()=>au,em:()=>qs,embed:()=>ma,enableSSR:()=>Kr,enhance:()=>$t,enhanceAll:()=>Fl,enqueueBatchedSignal:()=>We,external:()=>Gu,fieldset:()=>Ba,figcaption:()=>Rs,figure:()=>Ls,font:()=>Cu,footer:()=>bs,form:()=>Va,g:()=>uu,getAction:()=>co,getRequestScopedCache:()=>Ur,getRuntimeErrorHandler:()=>Fn,getSSRStore:()=>ze,getSlot:()=>Al,h1:()=>xs,h2:()=>ws,h3:()=>mn,h4:()=>Ts,h5:()=>Es,h6:()=>ks,head:()=>cs,header:()=>gs,hr:()=>Ms,html:()=>Co,i:()=>Us,iframe:()=>ga,img:()=>ca,input:()=>ja,ins:()=>Ca,isBatching:()=>Ku,isSSR:()=>me,kbd:()=>Ks,label:()=>Fa,lazy:()=>Vr,lazyIsland:()=>Wl,legend:()=>za,li:()=>Os,line:()=>lu,linearGradient:()=>Su,link:()=>ou,longPress:()=>po,main:()=>ys,map:()=>da,mark:()=>Gs,marker:()=>ku,marquee:()=>Au,mask:()=>yu,match:()=>ml,math:()=>wa,menu:()=>Qa,meta:()=>iu,meter:()=>Wa,mount:()=>kl,mountIslands:()=>Gl,nav:()=>hs,nextTick:()=>ec,noscript:()=>Ea,object:()=>ba,ol:()=>Ps,on:()=>Vu,onCleanup:()=>Hu,onMount:()=>Lt,onUnmount:()=>$u,optgroup:()=>qa,option:()=>Ua,output:()=>Ka,p:()=>pn,param:()=>ha,path:()=>cu,pattern:()=>vu,picture:()=>ya,polygon:()=>du,polyline:()=>fu,portal:()=>va,pre:()=>gn,progress:()=>Ga,q:()=>Js,radialGradient:()=>xu,reactiveArray:()=>Rl,rect:()=>pu,ref:()=>Ol,registerAction:()=>nt,registerComponent:()=>gl,registerDisposer:()=>_,registerIsland:()=>ql,replaceChildrenSafely:()=>re,reportDrainRunaway:()=>ke,reportError:()=>M,resolveComponent:()=>hl,retrack:()=>Ne,rp:()=>Ys,rt:()=>Xs,ruby:()=>Zs,runInSSRContext:()=>Jr,s:()=>Qs,samp:()=>ea,script:()=>ka,section:()=>ps,select:()=>Ja,setGlobalErrorHandler:()=>cl,setMaxDrainIterations:()=>Rr,setRuntimeErrorHandler:()=>jn,show:()=>fl,signal:()=>A,slot:()=>tu,small:()=>ta,source:()=>Sa,span:()=>q,stop:()=>wu,store:()=>Pl,strict:()=>Hl,strictEffect:()=>Il,strong:()=>na,style:()=>Ve,sub:()=>ra,summary:()=>eu,sup:()=>oa,svg:()=>xa,symbol:()=>Eu,table:()=>La,tagFactory:()=>p,takePendingError:()=>At,tbody:()=>Ma,td:()=>Oa,template:()=>nu,text:()=>mu,textarea:()=>Ya,tfoot:()=>Pa,th:()=>Da,thead:()=>$a,time:()=>ia,title:()=>fs,tr:()=>Ha,track:()=>fa,transition:()=>Ql,trapFocus:()=>bo,trustHTML:()=>Io,tspan:()=>gu,u:()=>sa,ul:()=>Ds,unregisterComponent:()=>bl,unregisterDisposer:()=>at,unregisterIsland:()=>Ul,untracked:()=>pe,use:()=>Tu,var_:()=>aa,video:()=>pa,watch:()=>Dl,when:()=>pl,withSSR:()=>Yr,writable:()=>$l});var Vn=Symbol.for("sibujs.runtime-errors.v1");function Ft(){let e=globalThis,t=e[Vn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Vn]=n,n}function jn(e){let t=Ft(),n=t.handler;return t.handler=e,n}function Fn(){return Ft().handler}function zt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Jo(e)}`;return new Error(t,{cause:e})}function Jo(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 Yo(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Xo=Symbol.for("sibujs.reactive.v1");function Zo(e){let t=globalThis[Xo];return t?.untracked?t.untracked(e):e()}var Qo="sibu:error-propagate";function ei(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=ti(n);if(!r)return!1;try{let o=new CustomEvent(Qo,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function ti(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 ni(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Yo(t)}: ${e.message}`,e)}function M(e,t){let n=zt(e);Zo(()=>{if(ei(n,t))return;let r=Ft(),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--}}ni(n,t)})}function be(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function j(e,t){if(!e)throw new Error(`[SibuJS] ${t}`)}function ne(e){{let t=e();t&&console.warn(`[SibuJS] ${t}`)}}function D(e){console.warn(`[SibuJS] ${e}`)}var he=new WeakMap,ve=1e4;function ke(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 Me=0;function bt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var se=[];function zn(){return bt(se[se.length-1])}function Wn(e){return e===null&&se.length===0?!1:(se.push(bt(e)),!0)}function qn(){se.pop()}function _(e,t){let n=he.get(e);n||(n=[],he.set(e,n)),n.push(t),Me++;let r=bt(se[se.length-1]);r&&r.entries.push([e,t])}function Un(e){let t={entries:[],closed:!1},n=t.entries;se.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=ve){ke("rollback",s,n.length);break}let[a,u]=n.pop();if(at(a,u)){s++;try{u()}catch(l){M(l,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,se.pop()}throw i}t.closed=!0,se.pop();let o=bt(se[se.length-1]);if(o){for(let i of n)he.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function at(e,t){let n=he.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),Me--,n.length===0&&he.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--)ri(n[r])}function ri(e){if(!he.has(e))return;let t=0,n=!1;for(;!n;){let r=he.get(e);if(!r||r.length===0)break;let o=r.slice();he.delete(e),Me-=o.length;for(let i=0;i<o.length;i++){if(t>=ve){let s=o.slice(i),a=he.get(e);he.set(e,a?s.concat(a):s),Me+=s.length,ke("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){M(s,{phase:"cleanup",name:"disposer"})}}}}function re(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 Kn(e=0){return e>0&&Me>e&&D(`checkLeaks: ${Me} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),Me}function Ke(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var oi=/[A-Z]/,ii=/[A-Z]/g;function ae(e){return oi.test(e)?e.replace(ii,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function _e(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 si=["http:","https:","mailto:","tel:","ftp:"],ai=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function yt(e){let t=Ke(e).trim();if(!t)return"";let n=e.replace(ai,"");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)&&si.indexOf(i)===-1?"":n}var ui=/^\d+(\.\d+)?[wx]$/;function Wt(e){return e===" "||e===" "||e===`
|
|
2
|
-
`||e==="\r"||e==="\f"}function
|
|
3
|
-
`||e==="\r"||e==="\f"}function
|
|
1
|
+
"use strict";(()=>{var hi=Object.defineProperty;var Gt=(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 Xn=(e,t)=>{for(var n in t)hi(e,n,{get:t[n],enumerable:!0})};var Jn={};Xn(Jn,{ClientOnly:()=>Vo,DynamicComponent:()=>Wu,ErrorBoundary:()=>Ru,ErrorDisplay:()=>Bn,Fragment:()=>Ju,KeepAlive:()=>Zu,Loading:()=>Ou,MAX_DRAIN_TEARDOWNS:()=>we,Portal:()=>ec,SVG_NS:()=>$,Suspense:()=>ho,__renderParsedTemplate:()=>Zo,__resetIdCounter:()=>zo,a:()=>la,abbr:()=>ua,action:()=>Pu,address:()=>Us,area:()=>Pa,array:()=>nc,article:()=>js,aside:()=>qs,asyncDerived:()=>oc,audio:()=>Da,autoResize:()=>$o,b:()=>ca,base:()=>Nl,batch:()=>U,bdi:()=>da,bdo:()=>fa,bindDynamic:()=>Xr,blockquote:()=>Xs,body:()=>$s,br:()=>pa,button:()=>bt,canvas:()=>Ga,caption:()=>el,catchError:()=>Du,catchErrorAsync:()=>Hu,center:()=>Xl,checkLeaks:()=>fr,circle:()=>Ml,cite:()=>ma,clickOutside:()=>Po,clipPath:()=>zl,code:()=>Cn,col:()=>tl,colgroup:()=>nl,context:()=>ju,copyOnClick:()=>Ho,createId:()=>Fo,customElement:()=>tu,data:()=>ga,datalist:()=>cl,dd:()=>Qs,deepEqual:()=>lt,deepSignal:()=>ic,defer:()=>Ec,defs:()=>Fl,del:()=>Xa,derived:()=>Ze,details:()=>Tl,dfn:()=>ba,dialog:()=>El,disableSSR:()=>co,dispose:()=>B,div:()=>P,dl:()=>ea,dt:()=>ta,each:()=>Uu,effect:()=>re,ellipse:()=>Ol,em:()=>ha,embed:()=>ja,enableSSR:()=>uo,enhance:()=>Ft,enhanceAll:()=>gc,enqueueBatchedSignal:()=>Ge,external:()=>xu,fieldset:()=>dl,figcaption:()=>na,figure:()=>ra,font:()=>Ql,footer:()=>Fs,form:()=>fl,g:()=>Pl,getAction:()=>Oo,getRequestScopedCache:()=>ao,getRuntimeErrorHandler:()=>tr,getSSRStore:()=>He,getSlot:()=>tc,h1:()=>Ks,h2:()=>Js,h3:()=>En,h4:()=>Gs,h5:()=>Ys,h6:()=>Zs,head:()=>Hs,header:()=>Vs,hr:()=>oa,html:()=>Yo,i:()=>ya,iframe:()=>Va,img:()=>Ha,input:()=>pl,ins:()=>Qa,isBatching:()=>vu,isClient:()=>lo,isSSR:()=>ne,isServer:()=>ht,kbd:()=>Sa,label:()=>ml,lazy:()=>bo,lazyIsland:()=>hc,legend:()=>gl,li:()=>ia,line:()=>Dl,linearGradient:()=>Ul,link:()=>Rl,longPress:()=>Do,main:()=>Ws,map:()=>$a,mark:()=>va,marker:()=>Zl,marquee:()=>eu,mask:()=>Wl,match:()=>Bu,math:()=>Ja,menu:()=>kl,meta:()=>Ll,meter:()=>bl,mount:()=>Xu,mountIslands:()=>xc,nav:()=>zs,nextTick:()=>Ac,noscript:()=>Ya,object:()=>Fa,ol:()=>sa,on:()=>pu,onCleanup:()=>fu,onMount:()=>$t,onUnmount:()=>du,optgroup:()=>hl,option:()=>yl,output:()=>Sl,p:()=>Tn,param:()=>za,path:()=>Hl,pattern:()=>ql,picture:()=>Wa,polygon:()=>$l,polyline:()=>Il,portal:()=>qa,pre:()=>kn,progress:()=>vl,q:()=>xa,radialGradient:()=>Kl,reactiveArray:()=>rc,rect:()=>Bl,ref:()=>sc,registerAction:()=>at,registerComponent:()=>Vu,registerDisposer:()=>C,registerIsland:()=>yc,replaceChildrenSafely:()=>le,reportDrainRunaway:()=>Re,reportError:()=>M,resolveComponent:()=>zu,retrack:()=>Pe,rp:()=>wa,rt:()=>Ta,ruby:()=>Ea,runInSSRContext:()=>fo,s:()=>ka,samp:()=>Ca,script:()=>Za,section:()=>Bs,select:()=>xl,setGlobalErrorHandler:()=>$u,setMaxDrainIterations:()=>Gr,setRuntimeErrorHandler:()=>er,show:()=>Iu,signal:()=>A,slot:()=>Al,small:()=>Aa,source:()=>Ua,span:()=>q,stop:()=>Jl,store:()=>ac,strict:()=>cc,strictEffect:()=>dc,strong:()=>_a,style:()=>qe,sub:()=>Na,summary:()=>Cl,sup:()=>Ra,svg:()=>Ka,symbol:()=>Yl,table:()=>rl,tagFactory:()=>m,takePendingError:()=>Pt,tbody:()=>ol,td:()=>il,template:()=>_l,text:()=>jl,textarea:()=>wl,tfoot:()=>sl,th:()=>al,thead:()=>ll,time:()=>La,title:()=>Is,tr:()=>ul,track:()=>Ia,transition:()=>Cc,trapFocus:()=>Io,trustHTML:()=>ai,tspan:()=>Vl,u:()=>Ma,ul:()=>aa,unregisterComponent:()=>Fu,unregisterDisposer:()=>ft,unregisterIsland:()=>Sc,untracked:()=>be,use:()=>Gl,var_:()=>Oa,video:()=>Ba,watch:()=>lc,when:()=>Vn,withSSR:()=>mo,writable:()=>uc});var Qn=Symbol.for("sibujs.runtime-errors.v1");function Yt(){let e=globalThis,t=e[Qn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Qn]=n,n}function er(e){let t=Yt(),n=t.handler;return t.handler=e,n}function tr(){return Yt().handler}function Zt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${yi(e)}`;return new Error(t,{cause:e})}function yi(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 Si(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var vi=Symbol.for("sibujs.reactive.v1");function xi(e){let t=globalThis[vi];return t?.untracked?t.untracked(e):e()}var wi="sibu:error-propagate";function Ti(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Ei(n);if(!r)return!1;try{let o=new CustomEvent(wi,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Ei(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 ki(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Si(t)}: ${e.message}`,e)}function Ci(){let e=globalThis[Symbol.for("sibujs.ssr.v1")];return e?(e.als?e.als.getStore():e.fallbackDepth>0?e.fallbackStore:void 0)?.errors:void 0}function M(e,t){let n=Zt(e);xi(()=>{if(Ti(n,t))return;let r=Ci();if(r){r.push({error:n,context:t});return}let o=Yt(),i=o.handler;if(i&&o.handlerDepth===0){o.handlerDepth++;try{i(e instanceof Error?e:n,t);return}catch(s){if(typeof console<"u"){let a=s instanceof Error?s.message:String(s);console.error(`[SibuJS] runtime error handler itself threw: ${a}`,s)}}finally{o.handlerDepth--}}ki(n,t)})}function he(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function V(e,t){if(!e)throw new Error(`[SibuJS] ${t}`)}function ie(e){{let t=e();t&&console.warn(`[SibuJS] ${t}`)}}function H(e){console.warn(`[SibuJS] ${e}`)}var Ne=null;function nr(){return Ne?.s.on===!0}function rr(){return Ne?.s.on?Ne.s:null}function dt(e,t){let n=Ne;if(n?.s.on){let r=n.s.el(e,t,n.p+(n.n++).toString(36));if(r)return r}return t?document.createElementNS(t,e):document.createElement(e)}function ye(){let e=Ne;return e?.s.on?{p:`${e.p}${(e.n++).toString(36)}.`,n:0,s:e.s}:null}function or(e,t){if(!e?.s.on)return null;let n=typeof t;if(n!=="string"&&n!=="number")throw new TypeError(`[SibuJS] adopt: a key must be a string or a number, not ${n}`);let r=String(t).replace(/[^\w-]/g,o=>`~${o.charCodeAt(0).toString(16).padStart(4,"0")}`);return{p:`${e.p}${n==="string"?"_":"-"}${r}.`,n:0,s:e.s}}function ee(e,t){let n=Ne;if(!e&&!n)return t();Ne=e?.s.on?{p:e.p,n:0,s:e.s}:null;try{return t()}finally{Ne=n}}var ir,Xt=globalThis[ir=Symbol.for("sibujs.hydration.v2")]??(globalThis[ir]={a:new Set,c:null});function xe(){return Xt.a.size>0}function Ai(){return rr()?.h??Xt.c}function Qt(){let e=Ai();return e?e.open?[e]:[]:Array.from(Xt.a)}function sr(e){let t=Qt(),n=t.length,r=()=>{--n<1&&e()};if(n)for(let o of t)o.done.push(r);else e()}function _i(e){for(let t of Array.from(e.wake))t()}function ar(e,t){for(let n of e)n.pending.add(t);return()=>{for(let n of e)n.pending.delete(t)&&_i(n)}}var Se=new WeakMap,we=1e4;function Re(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 $e=0;function xt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var ae=[];function lr(){return xt(ae[ae.length-1])}function ur(e){return e===null&&ae.length===0?!1:(ae.push(xt(e)),!0)}function cr(){ae.pop()}function C(e,t){let n=Se.get(e);n||(n=[],Se.set(e,n)),n.push(t),$e++;let r=xt(ae[ae.length-1]);r&&r.entries.push([e,t])}function dr(e){let t={entries:[],closed:!1},n=t.entries;ae.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=we){Re("rollback",s,n.length);break}let[a,l]=n.pop();if(ft(a,l)){s++;try{l()}catch(u){M(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,ae.pop()}throw i}t.closed=!0,ae.pop();let o=xt(ae[ae.length-1]);if(o){for(let i of n)Se.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function ft(e,t){let n=Se.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),$e--,n.length===0&&Se.delete(e),!0)}function B(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--)Ni(n[r])}function Ni(e){if(!Se.has(e))return;let t=0,n=!1;for(;!n;){let r=Se.get(e);if(!r||r.length===0)break;let o=r.slice();Se.delete(e),$e-=o.length;for(let i=0;i<o.length;i++){if(t>=we){let s=o.slice(i),a=Se.get(e);Se.set(e,a?s.concat(a):s),$e+=s.length,Re("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){M(s,{phase:"cleanup",name:"disposer"})}}}}function le(e,...t){if(xe()&&t.length>0&&t[0]===e.firstChild){let r=!0;for(let o=1;o<t.length&&r;o++)r=t[o-1].nextSibling===t[o];if(r){let o=t[t.length-1].nextSibling;for(;o;){let i=o.nextSibling;B(o),e.removeChild(o),o=i}return}}for(let r=0;r<t.length;r++){let o=t[r];o.parentNode?.removeChild(o)}let n=Array.from(e.childNodes);for(let r=0;r<n.length;r++)B(n[r]);e.replaceChildren(...t)}function fr(e=0){return e>0&&$e>e&&H(`checkLeaks: ${$e} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),$e}function Xe(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Ri=/[A-Z]/,Li=/[A-Z]/g;function ue(e){return Ri.test(e)?e.replace(Li,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function Le(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 Mi=["http:","https:","mailto:","tel:","ftp:"],Oi=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function Tt(e){let t=Xe(e).trim();if(!t)return"";let n=e.replace(Oi,"");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)&&Mi.indexOf(i)===-1?"":n}var Pi=/^\d+(\.\d+)?[wx]$/;function en(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function Di(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(en(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!en(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 p=t[r];if(d){u+=p,p===")"&&(d=!1),r++;continue}if(en(p)){u&&a.push(u),u="",r++;continue}if(p===","){r++;break}p==="("&&(d=!0),u+=p,r++}u&&a.push(u)}if(s===""||a.length>1||a.length===1&&!Pi.test(a[0]))continue;let l=Tt(s);l&&(l.startsWith(",")||l.endsWith(",")||n.push(a.length===1?`${l} ${a[0]}`:l))}return n.join(", ")}var Hi=/[(:@\\]/;function $i(e){return e===" "||e===" "||e===`
|
|
3
|
+
`||e==="\r"||e==="\f"}function pr(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Ii(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r!=="\\"){t+=r;continue}if(n+1>=e.length)break;let o=e[n+1];if(o===`
|
|
4
4
|
`||o==="\f"){n+=1;continue}if(o==="\r"){n+=e[n+2]===`
|
|
5
|
-
`?2:1;continue}if(
|
|
6
|
-
`?2:1);let a=Number.parseInt(i,16),
|
|
7
|
-
`||e==="\r"||e==="\f"}function xt(e){let t=0,n=e.length;for(;t<n&&Oe(e[t]);)t++;for(;n>t&&Oe(e[n-1]);)n--;return e.slice(t,n)}var ue=e=>({kind:"forbidden",reason:e});function wi(e){let t=xt(Ke(e));if(t==="")return ue("empty content");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return ue("missing or non-numeric delay");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return ue("unparseable delay");for(;n<t.length&&Oe(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return ue("unexpected text after delay");for(n++;n<t.length&&Oe(t[n]);)n++;let o=n;for(;n<t.length&&!Oe(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return ue(`unsupported refresh key ${JSON.stringify(i)}`);for(;n<t.length&&Oe(t[n]);)n++;if(t[n]!=="=")return ue("missing '=' after url");for(n++;n<t.length&&Oe(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let l=t.indexOf(a,n+1);if(l===-1)return ue("unterminated quoted destination");if(s=t.slice(n+1,l),xt(t.slice(l+1))!=="")return ue("trailing text after quoted destination")}else if(s=xt(t.slice(n)),/[;,]/.test(s))return ue("multiple refresh assignments");if(s==="")return ue("empty destination");let u=yt(s);return u===""?ue("destination uses a disallowed protocol"):{kind:"allowed",delay:r,destination:s,sanitizedDestination:u}}function Jt(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=ae(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?ue(`duplicate case-insensitive attribute ${JSON.stringify(r)}`):typeof t!="string"?{kind:"not-refresh"}:xt(Ke(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:wi(n)}var Ti="http://www.w3.org/1999/xhtml",Ei="http://www.w3.org/2000/svg",ki=new Set(["script","iframe","object","embed","frame","frameset"]);function nr(e){return ae(e)}function rr(e){return ki.has(nr(e))}var _i=new Set(["script","style"]);function or(e){return _i.has(nr(e))}var B={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Ci=new Set(["src","href","xlink:href","type","language"]),Ai=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Yt=new WeakSet;function ir(e){return e.namespaceURI===Ti||e.namespaceURI===null}function sr(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 Ni(e){Yt.has(e)||(Yt.add(e),e.getAttribute("content")!==null&&Jt(sr(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function Ri(e,t,n,r){if(!ir(e))return B.None;let o=ae(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&Ni(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return B.None;let i=Jt(sr(e,o,n));return i.kind==="forbidden"?B.MetaRefreshForbidden:i.kind!=="not-refresh"&&Yt.has(e)?B.MetaRefreshReactive:B.None}function Li(e,t){if(t===null||ae(e)!=="attributename")return B.None;let n=Ke(t);return Qn(n)||_e(n)||ut(n)?B.AnimationTarget:B.None}var wt=new WeakSet;function tr(e){if(e===null)return!1;let t=ae(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function Mi(e,t,n,r){if(!ir(e))return B.None;let o=ae(t);return o==="href"?r==="static"||n===null?B.None:tr(e.getAttribute("rel"))?B.StylesheetSource:(wt.add(e),B.None):o==="rel"&&tr(n)&&wt.has(e)&&e.hasAttribute("href")?B.StylesheetSource:B.None}function Xt(e,t,n,r){let o=e.localName;return o==="meta"?Ri(e,t,n,r):o==="link"?Mi(e,t,n,r):o==="script"?r==="static"||n===null?B.None:Ci.has(ae(t))?B.ScriptSource:B.None:Ai.has(o)&&e.namespaceURI===Ei?Li(t,n):B.None}function Zt(e,t,n){e.localName!=="link"||ae(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?wt.add(e):wt.delete(e))}var Oi="http://www.w3.org/1999/xhtml",Pi="http://www.w3.org/2000/svg",Di="http://www.w3.org/1999/xlink",$i="http://www.w3.org/XML/1998/namespace",Hi=new Set(["checked","disabled","selected"]);function Ii(e){return e.namespaceURI===null||e.namespaceURI===Oi}function ur(e,t,n){ne(()=>`${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 ar(e,t,n){e[t]=n}function Bi(e,t){if(e.namespaceURI!==Pi)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Di:n.startsWith("xml:")?$i:null}function de(e,t,n,r={}){let o=Vi(e,t,n,r);return e.localName==="link"&&Zt(e,t,r.reactive?"reactive":"runtime"),o}function Vi(e,t,n,r){let o=Bi(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(_e(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=Xt(e,t,s,r.reactive?"reactive":"runtime");if(a!==B.None)return ur(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(ut(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 u=Ii(e),l=u?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let g=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==g&&(o?e.setAttributeNS(o,t,g):e.setAttribute(t,g)),!0}return u&&Hi.has(l)&&l in e?ar(e,l,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let c=String(n);if(r.syncValueProperty!==!1&&u&&(l==="value"||l==="checked")&&l in e)return ar(e,l,l==="checked"?!!n:c),!0;let m=c===""?"":er(t,c,{element:e});return m===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===m||(o?e.setAttributeNS(o,t,m):e.setAttribute(t,m)),!0)}function Qt(e,t,n){if(ut(t))return D(`html: refusing static attribute "${t}" \u2014 the browser parses it as a nested document.`),!1;let r=Xt(e,t,n,"static");return r!==B.None?(ur("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Zt(e,t,"static"),!0)}var ji=4096,en=[];function Fi(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function zi(e,t,n){let r=en.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Fi();return o.sig=e,o.sub=t,o.epoch=n,o}function lr(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,en.length<ji&&en.push(e)}function Wi(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 cr(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 qi(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function Ui(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 fe=null,Se=null,Ce=0,Ae=[],X=new Set,Ki=[];function Gi(e){try{e()}catch(t){let n=e;M(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Ji(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 ye=0,xe=!1;function nn(){ye===0&&(Se=fe,fe=null,xe=!0),ye++}function rn(){ye--,ye===0&&(fe=Se,Se=null,xe=!1)}function dr(){return xe}function fr(e){nn();try{return e()}finally{rn()}}var le=null;function on(){return le}function _t(e,t){let n=le;le=e;try{return t()}finally{le=n}}function sn(e){let t=le;return t===null?e:(...n)=>_t(t,()=>e(...n))}var Ge=null,Yi=0;function an(e,t){let n=fe,r=0,o=null;xe&&(r=ye,o=Se,ye=0,Se=null,xe=!1),fe=t;let i=t;i._cap===void 0&&(i._cap=zn());let s=le;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(le=a);let u=Ge;u!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=u),i._tok!=null&&(Ge=i._tok);let l=++Yi;i._epoch=l,i._structDirty=!1;for(let c=i.depsHead??null;c!==null;c=c.subNext){let m=c.sig;c.prevActive=m.__activeNode??null,m.__activeNode=c}try{e()}finally{fe=n,le=s,Ge=u,r!==0&&(ye=r,Se=o,xe=!0);let c=i.depsHead??null;for(;c!==null;){let m=c.subNext,h=c.sig;h.__activeNode=c.prevActive,c.prevActive=null,c.epoch!==l&&(Ui(c),cr(c),lr(c)),c=m}}}function pr(e,t){if(!t)return un(e);Je(t);let n=fe,r=0,o=null;xe&&(r=ye,o=Se,ye=0,Se=null,xe=!1),fe=t;let i=t;i._scope===void 0&&(i._scope=le);let s=le;le=i._scope;try{e()}finally{fe=n,le=s,r!==0&&(ye=r,Se=o,xe=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let u=a.sig;u.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>Je(t))}function un(e,t,n){return gr(e,t,n===!0)._dispose}function mr(e,t){let n=gr(e,t,!0);return{stop:n._dispose,run:r=>{let o=Ge;Ge=n._tok??null;try{return r()}finally{Ge=o}}}}function gr(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{an(e,o)}finally{i._reentrant=!1}}},o=r;o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._runEpoch=0,o._runs=0,o._reentrant=!1,o._disposed=!1,o._errorPhase="binding",o._errorNode=t,o._tok=null,o._owner=null,n&&(o._tok={sub:o});try{r()}catch(i){throw o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Je(o),i}return o._dispose=()=>{o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Je(o)},o}function br(e){if(!fe)return;let t=fe,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=zi(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,qi(t,i),Wi(n,i),t._structDirty=!0}function Je(e){let t=e;t._owner!=null&&(t._owner=null);let n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;cr(n),lr(n),n=r}}var Tt=1e3,Et=1e6,kt=0,Pe=new Set;function hr(e){let t=Tt;return Number.isFinite(e)&&e>0&&(Tt=Math.floor(e)),t}function yr(e){let t=Et;return Number.isFinite(e)&&e>0&&(Et=Math.floor(e)),t}function Xi(e){let t=e;return t._runEpoch!==kt?(t._runEpoch=kt,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>Tt)}function Zi(e){let t=e.__name??"<unnamed>";M(new Error(`subscriber "${t}" 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:t})}function Qi(){M(new Error(`Notification drain exceeded ${Et} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function vr(){let e=0;for(;e<Ae.length;){if(e>=Et){Qi();break}let t=Ae[e++];X.delete(t)&&(t._owner!=null&&X.size>0&&(es(t),X.has(t))||Sr(t))}}function es(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;X.has(r)&&(t=r),n=r._owner??null}if(t===null)return;X.delete(t),Sr(t)}}function Sr(e){if(Pe.size>0&&Pe.has(e)||e._hasComputedDep===!0&&!Ji(e))return;if(Xi(e)){Zi(e),Pe.add(e);return}let t=Wn(e._cap??null);try{Gi(e)}finally{t&&qn()}}function xr(){if(!(Ce>0)){Ce++,kt++;try{vr()}finally{Ce--,Ce===0&&(Ae.length=0,X.clear(),Pe.size>0&&Pe.clear())}}}function tn(e){e();let t=e._sig;if(!t)return;let n=Ki,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 X.has(s)||(X.add(s),Ae.push(s));i=i.sigNext}}}function wr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?tn(r):X.has(r)||(X.add(r),Ae.push(r))),n=n.sigNext}}function Tr(e){let n=e.subsHead;if(n){if(Ce>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?tn(o):X.has(o)||(X.add(o),Ae.push(o))),r=r.sigNext}return}Ce++,kt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?tn(o):X.has(o)||(X.add(o),Ae.push(o))),r=r.sigNext}vr()}finally{Ce--,Ce===0&&(Ae.length=0,X.clear(),Pe.size>0&&Pe.clear())}}}function Er(e){return e.__sc??0}function kr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function _r(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var Cr="4.13.1",Ar=Symbol.for("sibujs.reactive.v1");function ns(){let e=globalThis,t=e[Ar];if(t)return!t.__dupWarned&&(t.__dupWarned=!0,D(`Multiple instances of the reactive runtime detected on this page (active: ${t.version}, duplicate: ${Cr}). 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:nn,resumeTracking:rn,isTrackingSuspended:dr,untracked:fr,retrack:an,track:pr,reactiveBinding:un,recordDependency:br,cleanup:Je,setMaxSubscriberRepeats:hr,setMaxDrainIterations:yr,drainNotificationQueue:xr,queueSignalNotification:wr,notifySubscribers:Tr,getSubscriberCount:Er,getSubscriberDeps:kr,forEachSubscriber:_r,getOwnerScope:on,runWithOwnerScope:_t,bindOwnerScope:sn,structuralBinding:mr,version:Cr};return e[Ar]=n,n}var z=ns(),De=z.suspendTracking,$e=z.resumeTracking,Nr=z.isTrackingSuspended,pe=z.untracked,Ne=z.retrack,Ye=z.track,J=z.reactiveBinding,He=z.recordDependency,Ie=z.cleanup,jc=z.setMaxSubscriberRepeats,Rr=z.setMaxDrainIterations,Lr=z.drainNotificationQueue,Mr=z.queueSignalNotification,Xe=z.notifySubscribers,Fc=z.getSubscriberCount,zc=z.getSubscriberDeps,Wc=z.forEachSubscriber,Ze=z.getOwnerScope??on,Ct=z.runWithOwnerScope??_t,Q=z.bindOwnerScope??sn,Be=z.structuralBinding??((e,t)=>({stop:z.reactiveBinding(e,t),run:n=>n()}));function lt(e,t,n){if(_e(t))return de(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){M(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}de(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return J(r,e)}function Or(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(u){M(u,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(u){M(u,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),de(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=J(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var ln=["data-focus-key","id","name"],rs=new Set(["text","search","url","tel","password",""]);function os(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&rs.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 ct(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<ln.length;i++){let s=t.getAttribute(ln[i]);if(s){r=ln[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...os(t)}}function is(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function ss(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 u=0;u<a.length;u++)r++,n??(n=a[u]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function Pr(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 Qe(e,t,n,r){if(!e||typeof document>"u"||r==="discard")return;let o=document.activeElement;if(o===e.el||o&&o!==document.body&&o!==document.documentElement)return;if(e.el.isConnected){Pr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=ss(t,`[${e.attr}=${is(e.value)}]`);if(s&&s.tagName===e.tag){Pr(s,e);return}i=a>1}if(r!==void 0&&typeof r=="object"){let s=typeof r.restoreTo=="function"?r.restoreTo():r.restoreTo;if(s?.isConnected&&(s.focus(),document.activeElement===s))return}ne(()=>{let s=e.attr?` (${e.attr}="${e.value}")`:"",a=i?`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()}>${s} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${a}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them. If dropping focus is INTENDED here (closing a panel, say), pass { focus: "discard" } to when()/match() to silence this, or { focus: { restoreTo: element } } to send focus somewhere other than <body>.`})}function we(e,t){let n=[];function r(){let o;try{o=t()}catch(c){M(c,{phase:"binding",name:"bindChildNode",node:e});return}let i=ct(n);if(o==null||typeof o=="boolean"){for(let c=0;c<n.length;c++){let m=n[c];F(m),m.parentNode&&m.parentNode.removeChild(m)}n.length=0,Qe(i,n,"bindChildNode");return}let s=e.parentNode;if(!s){n.length=0;return}let a;if(Array.isArray(o)){a=[];let c=new Set;for(let m=0;m<o.length;m++){let h=o[m];if(h==null||typeof h=="boolean")continue;let g=h instanceof Node?h:document.createTextNode(String(h));if(c.has(g)){D("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}c.add(g),a.push(g)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let u;if(n.length>0&&a.length>0){let c=new Set(n);u=new Set;for(let m=0;m<a.length;m++)c.has(a[m])&&u.add(a[m])}for(let c=0;c<n.length;c++){let m=n[c];u?.has(m)||(F(m),m.parentNode&&m.parentNode.removeChild(m))}let l=e;for(let c=0;c<a.length;c++){let m=a[c];l.nextSibling!==m&&s.insertBefore(m,l.nextSibling),l=m}n=a,Qe(i,a,"bindChildNode")}return J(r,e,!0)}function cn(){throw new Error('[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first. There is no global `document`, and SibuJS builds live DOM nodes, on the server too. For example: import { GlobalRegistrator } from "@happy-dom/global-registrator"; GlobalRegistrator.register(); See SSR in AGENTS.md \xA710.')}function oe(){typeof document>"u"&&cn()}var I="http://www.w3.org/2000/svg",as=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var dn=new Set,Dr=100,$r=!1,Hr=new Map;function Ir(e){let t=Hr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Hr.set(e,t)),t}function us(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=J(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",St(String(a),{element:e}));return}let u=e.style;i&&(e.removeAttribute("style"),i=!1);let l=[];for(let c in a){if(!Object.hasOwn(a,c))continue;let m=a[c];if(m==null)continue;let h=Ir(c);l.push(h),u.setProperty(h,vt(h,String(m),{element:e}))}for(let c=0;c<o.length;c++)l.indexOf(o[c])===-1&&u.removeProperty(o[c]);o=l},e);_(e,s);return}if(typeof t=="string"){e.setAttribute("style",St(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Ir(r);if(typeof o=="function"){let s=o,a=J(()=>{n.style.setProperty(i,vt(i,String(s()),{element:e}))},e);_(e,a)}else n.style.setProperty(i,vt(i,String(o),{element:e}))}}function ls(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=J(()=>{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=J(()=>{let a="";for(let u in n){if(!Object.hasOwn(n,u))continue;let l=n[u];(typeof l=="function"?l():l)&&(a=a?`${a} ${u}`:u)}e.setAttribute("class",a)},e);_(e,s)}else e.setAttribute("class",o)}function fn(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,we(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,we(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,we(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=rr(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&cn();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),fn(i,o),i):(ne(()=>{let g=r.trim().split(/\s+/);if(g.length<2)return"";let d=0;for(let b=0;b<g.length;b++){let y=g[b];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&d++}if(d<2)return"";let f=`${e}|${r}`;return dn.has(f)?"":dn.size>=Dr?$r?"":($r=!0,`tagFactory: ${Dr} 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.`):(dn.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 fn(i,r),i;let s=r,a=s.class;a!=null&&ls(i,a);let u=s.id;typeof u=="function"?_(i,lt(i,"id",u)):u!=null&&(typeof u=="string"&&as.has(u.toLowerCase())&&D(`tagFactory: element id="${u}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=u);let l=o!==void 0?o:s.nodes;l!=null&&fn(i,l);let c=s.on;if(c)for(let g in c){if(!Object.hasOwn(c,g))continue;let d=c[g];typeof d=="function"?i.addEventListener(g,d):D(`tagFactory: on.${g} handler is not a function (got ${typeof d}). Event listener was not attached.`)}let m=s.style;m!=null&&us(i,m);let h=s.ref;h&&(h.current=i);for(let g in s)switch(g){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,g))continue;let d=s[g];if(d==null||_e(g))continue;typeof d=="function"?_(i,lt(i,g,d)):de(i,g,d,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var hd=p("html"),cs=p("head"),ds=p("body"),fs=p("title"),P=p("div"),q=p("span"),ps=p("section"),ms=p("article"),gs=p("header"),bs=p("footer"),hs=p("nav"),ys=p("main"),vs=p("aside"),Ss=p("address"),pn=p("p"),xs=p("h1"),ws=p("h2"),mn=p("h3"),Ts=p("h4"),Es=p("h5"),ks=p("h6"),_s=p("blockquote"),Cs=p("dd"),As=p("dl"),Ns=p("dt"),Rs=p("figcaption"),Ls=p("figure"),Ms=p("hr"),Os=p("li"),Ps=p("ol"),Ds=p("ul"),gn=p("pre"),$s=p("a"),Hs=p("abbr"),Is=p("b"),Bs=p("bdi"),Vs=p("bdo"),js=p("br"),Fs=p("cite"),bn=p("code"),zs=p("data"),Ws=p("dfn"),qs=p("em"),Us=p("i"),Ks=p("kbd"),Gs=p("mark"),Js=p("q"),Ys=p("rp"),Xs=p("rt"),Zs=p("ruby"),Qs=p("s"),ea=p("samp"),ta=p("small"),na=p("strong"),ra=p("sub"),oa=p("sup"),ia=p("time"),sa=p("u"),aa=p("var"),ua=p("area"),la=p("audio"),ca=p("img"),da=p("map"),fa=p("track"),pa=p("video"),ma=p("embed"),ga=p("iframe"),ba=p("object"),ha=p("param"),ya=p("picture"),va=p("portal"),Sa=p("source"),xa=p("svg",I),wa=p("math"),Ta=p("canvas"),Ea=p("noscript"),ka=p("script"),_a=p("del"),Ca=p("ins"),Aa=p("caption"),Na=p("col"),Ra=p("colgroup"),La=p("table"),Ma=p("tbody"),Oa=p("td"),Pa=p("tfoot"),Da=p("th"),$a=p("thead"),Ha=p("tr"),dt=p("button"),Ia=p("datalist"),Ba=p("fieldset"),Va=p("form"),ja=p("input"),Fa=p("label"),za=p("legend"),Wa=p("meter"),qa=p("optgroup"),Ua=p("option"),Ka=p("output"),Ga=p("progress"),Ja=p("select"),Ya=p("textarea"),Xa=p("details"),Za=p("dialog"),Qa=p("menu"),eu=p("summary"),tu=p("slot"),nu=p("template"),ru=p("base"),ou=p("link"),iu=p("meta"),Ve=p("style"),su=p("circle",I),au=p("ellipse",I),uu=p("g",I),lu=p("line",I),cu=p("path",I),du=p("polygon",I),fu=p("polyline",I),pu=p("rect",I),mu=p("text",I),gu=p("tspan",I),bu=p("defs",I),hu=p("clipPath",I),yu=p("mask",I),vu=p("pattern",I),Su=p("linearGradient",I),xu=p("radialGradient",I),wu=p("stop",I),Tu=p("use",I),Eu=p("symbol",I),ku=p("marker",I),_u=p("center"),Cu=p("font"),Au=p("marquee"),Nu=e=>p(e);var hn="__sibuPendingError";function Br(e,t){let n=()=>e.parentNode?(M(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[hn]=t)})}function At(e){let t=e,n=t[hn];if(n instanceof Error)return delete t[hn],n}function Vr(e){let t=null;return function(){if(t)return t();let r=P({class:"sibu-lazy"}),o=!1;return e().then(Q(i=>{if(o)return;t=i.default;let s=t();re(r,s)})).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));re(r,P({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Br(r,s)}),r.appendChild(q("sibu-lazy-loading","Loading...")),_(r,()=>{o=!0}),r}}function jr({nodes:e,fallback:t}){let n=P({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null,s=null;_(n,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!n.contains(s)&&F(s)});let a=Q(()=>{if(!o)try{let u=e();if(s=u,u.classList.contains("sibu-lazy")){if(!u.querySelector(".sibu-lazy-loading")){re(n,u);return}i=new MutationObserver(()=>{if(o)return;u.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,re(n,u))}),i.observe(u,{childList:!0,subtree:!0})}else re(n,u)}catch(u){let l=u instanceof Error?u:new Error(String(u));Br(n,l)}});return queueMicrotask(a),n}function xn(e,t){return()=>Ze()===e?t():Ct(e,t)}function Rt(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";M(n,{phase:r,name:t});return}}function yn(e,t,n,r,o){let i=Rt(e,t);if(typeof i!="function")return;let s=xn(o,i);r()||!n.isConnected?Rt(s,"onUnmount"):zr(s,n)}var et=new WeakMap,je=new WeakMap,Te=new Set,Ee=new Set,tt=null,Nt=0,Ru=256;function vn(e){let t=et.get(e);if(t){et.delete(e),Te.delete(e);for(let n of t)try{n()}catch{}}}function Sn(e){je.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=je.get(e);if(n){je.delete(e),Ee.delete(e);for(let r of n)try{r()}catch{}}})}function Lu(e){if(Te.size===0||e.nodeType!==1)return;let t=e;if(Te.has(t)&&t.isConnected&&vn(t),t.firstElementChild)for(let n of Array.from(Te))n!==t&&n.isConnected&&t.contains(n)&&vn(n)}function Mu(e){if(Ee.size===0||e.nodeType!==1)return;let t=e;if(Ee.has(t)&&!t.isConnected&&Sn(t),t.firstElementChild)for(let n of Array.from(Ee))n!==t&&!n.isConnected&&t.contains(n)&&Sn(n)}function Ou(){if(Te.size>0)for(let e of Array.from(Te))e.isConnected&&vn(e);if(Ee.size>0)for(let e of Array.from(Ee))e.isConnected||Sn(e)}function Fr(){tt||typeof document>"u"||(tt=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++)Lu(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)Mu(t.removedNodes[n])}Nt+=e.length,Nt>=Ru&&(Nt=0,Ou()),wn()}),tt.observe(document.body,{childList:!0,subtree:!0}))}function wn(){tt&&Te.size===0&&Ee.size===0&&(tt.disconnect(),tt=null,Nt=0)}function Pu(e,t){let n=et.get(e);return n||(n=[],et.set(e,n)),n.push(t),Te.add(e),Fr(),()=>{let r=et.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(et.delete(e),Te.delete(e))}wn()}}function Du(e,t){let n=je.get(e);return n||(n=[],je.set(e,n)),n.push(t),Ee.add(e),Fr(),()=>{let r=je.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(je.delete(e),Ee.delete(e))}wn()}}function Lt(e,t){if(typeof document>"u")return;let n=Ze();if(e=xn(n,e),t){let r=!1,o=()=>r;if(_(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||yn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){yn(e,"onMount",t,o,n);return}let i=Pu(t,()=>{r||yn(e,"onMount",t,o,n)});_(t,i)})}else queueMicrotask(()=>{Rt(e,"onMount")})}function $u(e,t){typeof document>"u"||zr(xn(Ze(),e),t)}function zr(e,t){let n=!1,r=()=>{n||(n=!0,Rt(e,"onUnmount"))};_(t,r);let o=()=>{if(n)return;let i=Du(t,r);_(t,i)};t.isConnected?o():Lt(()=>{o()},t)}function Hu(e,t){_(t,e)}function ce(e,t,n){try{e.emit(t,n)}catch{}}var Tn=Symbol.for("sibujs.ssr.v1");function Iu(){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 jt=="function"&&(t=jt("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var Re=globalThis[Tn]??(globalThis[Tn]=Iu()),Fe=Re.als,ee=Re.fallbackStore;Re.fallbackDepth??(Re.fallbackDepth=0);var Wr=!1;function Bu(){if(Wr||Fe||!(typeof process<"u"&&!!process.versions?.node))return;Wr=!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 ze(){if(Fe){let e=Fe.getStore();if(e)return e}return ee}function qr(){return Fe?Fe.getStore()??null:Re.fallbackDepth>0?ee:null}function me(){return ze().ssr}function Ur(e){if(!me())return null;let t=ze(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function Kr(){ze().ssr=!0}function Gr(){ze().ssr=!1}function Jr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Fe)return Fe.run(t,e);Bu();let n=ee.ssr,r=ee.suspenseIdCounter,o=ee.idCounter,i=ee.locale;ee.ssr=!0,ee.suspenseIdCounter=0,ee.idCounter=0,ee.locale=void 0,Re.fallbackDepth++;try{return e()}finally{Re.fallbackDepth--,ee.ssr=n,ee.suspenseIdCounter=r,ee.idCounter=o,ee.locale=i}}function Yr(e){let t=ze(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var eo=globalThis;function Vu(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,pe(()=>t(o,void 0));else{let i=n;n=o,pe(()=>t(o,i))}}}var Xr=100;function Mt(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===Ze()?Zr(t):Ct(n,()=>Zr(t))}function Zr(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){M(n,{phase:"cleanup"})}}function Qr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&Mt(e),Ne(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Xr);e.rerunPending&&(e.rerunPending=!1,M(new Error(`effect re-requested itself ${Xr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function ju(e){if(e.disposed)return;e.disposed=!0;let t=eo.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Mt(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Ie(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function te(e,t){if(j(typeof e=="function","effect: argument must be a function."),me())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&&Mt(n),Ne(n.bodyFn,o),n.rerunPending&&Qr(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{Ne(n.bodyFn,n.subscriber),n.rerunPending&&Qr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&Mt(n),Ie(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=eo.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&ce(i,"effect:create",{effectFn:e}),()=>ju(n)}var ft=0,En=new Set;function Fu(e){ft++;try{return e()}finally{ft--,ft===0&&qu()}}function zu(e){return ft===0?!1:(En.add(e),!0)}function Wu(){return ft>0}function qu(){try{for(let e of En)Mr(e)}finally{En.clear()}Lr()}var to=Symbol.for("sibujs.reactive.batch.v1");function Uu(){let e=globalThis,t=e[to];if(t)return t;let n={batch:Fu,enqueueBatchedSignal:zu,isBatching:Wu};return e[to]=n,n}var kn=Uu(),U=kn.batch,We=kn.enqueueBatchedSignal,Ku=kn.isBatching;var _n=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 He(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let u=n.value,l=typeof a=="function"?a(u):a;if(!o(u,l)){if(n.value=l,n.__v++,!0){let c=_n.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&ce(c,"signal:update",{signal:n,name:r,oldValue:u,newValue:l})}We(n)||Xe(n)}}:s=a=>{let u=n.value,l=typeof a=="function"?a(u):a;if(Object.is(l,u))return;n.value=l,n.__v++;let c=_n.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&ce(c,"signal:update",{signal:n,name:r,oldValue:u,newValue:l}),We(n)||Xe(n)},!0){let a=_n.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&ce(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function Gu(e){let[t,n]=A(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Ju=`
|
|
5
|
+
`?2:1;continue}if(pr(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&pr(e[s]);)i+=e[s],s++;s<e.length&&$i(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 mr=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],Bi=4,ji=5,Vi=8;function Fi(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 tn=new Set,gr=100,br=!1;function wt(e,t,n){ie(()=>{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=Fi(n?.element),s=`${i}|${o}`;return tn.has(s)?"":tn.size>=gr?br?"":(br=!0,`${gr} 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.`):(tn.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 hr(e){return(e.includes("\\")?Ii(e):e).toLowerCase().replace(/\s+/g,"")}function nn(e){if(!Hi.test(e))return-1;let t=hr(e);for(let n=0;n<mr.length;n++)if(t.includes(mr[n]))return n;return-1}function Et(e,t,n){let r=rn(e,t);return r===-1?t:(wt(t,r,{property:e,element:n?.element}),"")}function rn(e,t){let n=nn(t);if(n!==-1)return n;let r=ue(e);return r==="behavior"?ji:r==="-moz-binding"?Bi:(r==="filter"||r==="-ms-filter")&&hr(t).includes("progid:")?Vi:-1}function zi(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 p=l.startsWith("--")?l:ue(l);i.push([p,u,d!==null])}return i}function Wi(e,t){let n=String(e),r=zi(n);if(r===null)return nn(n)!==-1&&wt(n,nn(n),t),"";let o=[];for(let[i,s,a]of r){let l=rn(i,s);if(l!==-1){wt(s,l,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function kt(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return Wi(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=rn(s,a);if(l!==-1){wt(a,l,{property:s,element:t?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var on=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),qi=new Set(["srcdoc"]);function pt(e){return qi.has(e.toLowerCase())}function yr(e){return on.has(e.toLowerCase())}function Ui(e){let t=e.toLowerCase();return t==="style"||on.has(t)}function Ki(e,t,n){let r=e.toLowerCase();return r==="srcset"?Di(t):on.has(r)?Tt(t):r==="style"?kt(t,n):t}function Sr(e,t,n){if(!Ui(e))return t;let r=Ki(e,t,n);return r===""?null:r}function Ie(e){return e===" "||e===" "||e===`
|
|
7
|
+
`||e==="\r"||e==="\f"}function Ct(e){let t=0,n=e.length;for(;t<n&&Ie(e[t]);)t++;for(;n>t&&Ie(e[n-1]);)n--;return e.slice(t,n)}var ce=e=>({kind:"forbidden",reason:e});function Ji(e){let t=Ct(Xe(e));if(t==="")return ce("empty content");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return ce("missing or non-numeric delay");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return ce("unparseable delay");for(;n<t.length&&Ie(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return ce("unexpected text after delay");for(n++;n<t.length&&Ie(t[n]);)n++;let o=n;for(;n<t.length&&!Ie(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return ce(`unsupported refresh key ${JSON.stringify(i)}`);for(;n<t.length&&Ie(t[n]);)n++;if(t[n]!=="=")return ce("missing '=' after url");for(n++;n<t.length&&Ie(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return ce("unterminated quoted destination");if(s=t.slice(n+1,u),Ct(t.slice(u+1))!=="")return ce("trailing text after quoted destination")}else if(s=Ct(t.slice(n)),/[;,]/.test(s))return ce("multiple refresh assignments");if(s==="")return ce("empty destination");let l=Tt(s);return l===""?ce("destination uses a disallowed protocol"):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function sn(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=ue(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?ce(`duplicate case-insensitive attribute ${JSON.stringify(r)}`):typeof t!="string"?{kind:"not-refresh"}:Ct(Xe(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:Ji(n)}var Gi="http://www.w3.org/1999/xhtml",Yi="http://www.w3.org/2000/svg",Zi=new Set(["script","iframe","object","embed","frame","frameset"]);function xr(e){return ue(e)}function wr(e){return Zi.has(xr(e))}var Xi=new Set(["script","style"]);function Tr(e){return Xi.has(xr(e))}var j={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Qi=new Set(["src","href","xlink:href","type","language"]),es=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),an=new WeakSet;function Er(e){return e.namespaceURI===Gi||e.namespaceURI===null}function kr(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 ts(e){an.has(e)||(an.add(e),e.getAttribute("content")!==null&&sn(kr(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function ns(e,t,n,r){if(!Er(e))return j.None;let o=ue(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&ts(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return j.None;let i=sn(kr(e,o,n));return i.kind==="forbidden"?j.MetaRefreshForbidden:i.kind!=="not-refresh"&&an.has(e)?j.MetaRefreshReactive:j.None}function rs(e,t){if(t===null||ue(e)!=="attributename")return j.None;let n=Xe(t);return yr(n)||Le(n)||pt(n)?j.AnimationTarget:j.None}var At=new WeakSet;function vr(e){if(e===null)return!1;let t=ue(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function os(e,t,n,r){if(!Er(e))return j.None;let o=ue(t);return o==="href"?r==="static"||n===null?j.None:vr(e.getAttribute("rel"))?j.StylesheetSource:(At.add(e),j.None):o==="rel"&&vr(n)&&At.has(e)&&e.hasAttribute("href")?j.StylesheetSource:j.None}function ln(e,t,n,r){let o=e.localName;return o==="meta"?ns(e,t,n,r):o==="link"?os(e,t,n,r):o==="script"?r==="static"||n===null?j.None:Qi.has(ue(t))?j.ScriptSource:j.None:es.has(o)&&e.namespaceURI===Yi?rs(t,n):j.None}function un(e,t,n){e.localName!=="link"||ue(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?At.add(e):At.delete(e))}var is="http://www.w3.org/1999/xhtml",ss="http://www.w3.org/2000/svg",as="http://www.w3.org/1999/xlink",ls="http://www.w3.org/XML/1998/namespace",us=new Set(["checked","disabled","selected"]);function cs(e){return e.namespaceURI===null||e.namespaceURI===is}function Ar(e,t,n){ie(()=>`${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 Cr(e,t,n){e[t]=n}function ds(e,t){if(e.namespaceURI!==ss)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?as:n.startsWith("xml:")?ls:null}function me(e,t,n,r={}){let o=fs(e,t,n,r);return e.localName==="link"&&un(e,t,r.reactive?"reactive":"runtime"),o}function fs(e,t,n,r){let o=ds(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(Le(t))return H(`${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=ln(e,t,s,r.reactive?"reactive":"runtime");if(a!==j.None)return Ar(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(pt(t))return H(`${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=cs(e),u=l?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let b=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==b&&(o?e.setAttributeNS(o,t,b):e.setAttribute(t,b)),!0}return l&&us.has(u)&&u in e?Cr(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 Cr(e,u,u==="checked"?!!n:d),!0;let p=d===""?"":Sr(t,d,{element:e});return p===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===p||(o?e.setAttributeNS(o,t,p):e.setAttribute(t,p)),!0)}function cn(e,t,n){if(pt(t))return H(`html: refusing static attribute "${t}" \u2014 the browser parses it as a nested document.`),!1;let r=ln(e,t,n,"static");return r!==j.None?(Ar("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&un(e,t,"static"),!0)}var ps=4096,dn=[];function ms(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function gs(e,t,n){let r=dn.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=ms();return o.sig=e,o.sub=t,o.epoch=n,o}function _r(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,dn.length<ps&&dn.push(e)}function bs(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 Nr(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 hs(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function ys(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 ge=null,Te=null,Me=0,Oe=[],X=new Set,Ss=[];function vs(e){try{e()}catch(t){let n=e;M(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function xs(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 ve=0,Ee=!1;function pn(){ve===0&&(Te=ge,ge=null,Ee=!0),ve++}function mn(){ve--,ve===0&&(ge=Te,Te=null,Ee=!1)}function Rr(){return Ee}function Lr(e){pn();try{return e()}finally{mn()}}var de=null;function gn(){return de}function Lt(e,t){let n=de;de=e;try{return t()}finally{de=n}}function bn(e){let t=de;return t===null?e:(...n)=>Lt(t,()=>e(...n))}var Qe=null,ws=0;function hn(e,t){let n=ge,r=0,o=null;Ee&&(r=ve,o=Te,ve=0,Te=null,Ee=!1),ge=t;let i=t;i._cap===void 0&&(i._cap=lr());let s=de;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(de=a);let l=Qe;l!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=l),i._tok!=null&&(Qe=i._tok);let u=++ws;i._epoch=u,i._structDirty=!1;for(let d=i.depsHead??null;d!==null;d=d.subNext){let p=d.sig;d.prevActive=p.__activeNode??null,p.__activeNode=d}try{e()}finally{ge=n,de=s,Qe=l,r!==0&&(ve=r,Te=o,Ee=!0);let d=i.depsHead??null;for(;d!==null;){let p=d.subNext,g=d.sig;g.__activeNode=d.prevActive,d.prevActive=null,d.epoch!==u&&(ys(d),Nr(d),_r(d)),d=p}}}function Mr(e,t){if(!t)return yn(e);et(t);let n=ge,r=0,o=null;Ee&&(r=ve,o=Te,ve=0,Te=null,Ee=!1),ge=t;let i=t;i._scope===void 0&&(i._scope=de);let s=de;de=i._scope;try{e()}finally{ge=n,de=s,r!==0&&(ve=r,Te=o,Ee=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let l=a.sig;l.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>et(t))}function yn(e,t,n){return Pr(e,t,n===!0)._dispose}function Or(e,t){let n=Pr(e,t,!0);return{stop:n._dispose,run:r=>{let o=Qe;Qe=n._tok??null;try{return r()}finally{Qe=o}}}}function Pr(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{hn(e,o)}finally{i._reentrant=!1}}},o=r;o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._runEpoch=0,o._runs=0,o._reentrant=!1,o._disposed=!1,o._errorPhase="binding",o._errorNode=t,o._tok=null,o._owner=null,n&&(o._tok={sub:o});try{r()}catch(i){throw o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),et(o),i}return o._dispose=()=>{o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),et(o)},o}function Dr(e){if(!ge)return;let t=ge,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=gs(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,hs(t,i),bs(n,i),t._structDirty=!0}function et(e){let t=e;t._owner!=null&&(t._owner=null);let n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;Nr(n),_r(n),n=r}}var _t=1e3,Nt=1e6,Rt=0,Be=new Set;function Hr(e){let t=_t;return Number.isFinite(e)&&e>0&&(_t=Math.floor(e)),t}function $r(e){let t=Nt;return Number.isFinite(e)&&e>0&&(Nt=Math.floor(e)),t}function Ts(e){let t=e;return t._runEpoch!==Rt?(t._runEpoch=Rt,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>_t)}function Es(e){let t=e.__name??"<unnamed>";M(new Error(`subscriber "${t}" fired more than ${_t} 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 ks(){M(new Error(`Notification drain exceeded ${Nt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Ir(){let e=0;for(;e<Oe.length;){if(e>=Nt){ks();break}let t=Oe[e++];X.delete(t)&&(t._owner!=null&&X.size>0&&(Cs(t),X.has(t))||Br(t))}}function Cs(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;X.has(r)&&(t=r),n=r._owner??null}if(t===null)return;X.delete(t),Br(t)}}function Br(e){if(Be.size>0&&Be.has(e)||e._hasComputedDep===!0&&!xs(e))return;if(Ts(e)){Es(e),Be.add(e);return}let t=ur(e._cap??null);try{vs(e)}finally{t&&cr()}}function jr(){if(!(Me>0)){Me++,Rt++;try{Ir()}finally{Me--,Me===0&&(Oe.length=0,X.clear(),Be.size>0&&Be.clear())}}}function fn(e){e();let t=e._sig;if(!t)return;let n=Ss,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 X.has(s)||(X.add(s),Oe.push(s));i=i.sigNext}}}function Vr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?fn(r):X.has(r)||(X.add(r),Oe.push(r))),n=n.sigNext}}function Fr(e){let n=e.subsHead;if(n){if(Me>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?fn(o):X.has(o)||(X.add(o),Oe.push(o))),r=r.sigNext}return}Me++,Rt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?fn(o):X.has(o)||(X.add(o),Oe.push(o))),r=r.sigNext}Ir()}finally{Me--,Me===0&&(Oe.length=0,X.clear(),Be.size>0&&Be.clear())}}}function zr(e){return e.__sc??0}function Wr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function qr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var Ur="4.14.0",Kr=Symbol.for("sibujs.reactive.v1");function _s(){let e=globalThis,t=e[Kr];if(t)return!t.__dupWarned&&(t.__dupWarned=!0,H(`Multiple instances of the reactive runtime detected on this page (active: ${t.version}, duplicate: ${Ur}). Reactivity is NOT broken and no bundler configuration is required: every copy routes through the first one via a global registry, so signal writes still reach subscribers registered by any copy. This is only a SIZE issue \u2014 the duplicate copy's bytes are downloaded and parsed for nothing. If you want them back, de-duplicate sibujs in your bundler (Vite: resolve.dedupe: ['sibujs']). Mismatched VERSIONS above are worth fixing regardless, since only the first one loaded is used.`)),t;let n={suspendTracking:pn,resumeTracking:mn,isTrackingSuspended:Rr,untracked:Lr,retrack:hn,track:Mr,reactiveBinding:yn,recordDependency:Dr,cleanup:et,setMaxSubscriberRepeats:Hr,setMaxDrainIterations:$r,drainNotificationQueue:jr,queueSignalNotification:Vr,notifySubscribers:Fr,getSubscriberCount:zr,getSubscriberDeps:Wr,forEachSubscriber:qr,getOwnerScope:gn,runWithOwnerScope:Lt,bindOwnerScope:bn,structuralBinding:Or,version:Ur};return e[Kr]=n,n}var z=_s(),je=z.suspendTracking,Ve=z.resumeTracking,Jr=z.isTrackingSuspended,be=z.untracked,Pe=z.retrack,tt=z.track,G=z.reactiveBinding,Fe=z.recordDependency,ze=z.cleanup,yd=z.setMaxSubscriberRepeats,Gr=z.setMaxDrainIterations,Yr=z.drainNotificationQueue,Zr=z.queueSignalNotification,nt=z.notifySubscribers,Sd=z.getSubscriberCount,vd=z.getSubscriberDeps,xd=z.forEachSubscriber,rt=z.getOwnerScope??gn,Mt=z.runWithOwnerScope??Lt,te=z.bindOwnerScope??bn,We=z.structuralBinding??((e,t)=>({stop:z.reactiveBinding(e,t),run:n=>n()}));function mt(e,t,n){if(Le(t))return me(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){M(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}me(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return G(r,e)}function Xr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){M(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){M(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),me(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=G(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Sn=["data-focus-key","id","name"],Ns=new Set(["text","search","url","tel","password",""]);function Rs(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Ns.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 gt(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<Sn.length;i++){let s=t.getAttribute(Sn[i]);if(s){r=Sn[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Rs(t)}}function Ls(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ms(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 Qr(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 ot(e,t,n,r){if(!e||typeof document>"u"||r==="discard")return;let o=document.activeElement;if(o===e.el||o&&o!==document.body&&o!==document.documentElement)return;if(e.el.isConnected){Qr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=Ms(t,`[${e.attr}=${Ls(e.value)}]`);if(s&&s.tagName===e.tag){Qr(s,e);return}i=a>1}if(r!==void 0&&typeof r=="object"){let s=typeof r.restoreTo=="function"?r.restoreTo():r.restoreTo;if(s?.isConnected&&(s.focus(),document.activeElement===s))return}ie(()=>{let s=e.attr?` (${e.attr}="${e.value}")`:"",a=i?`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()}>${s} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${a}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them. If dropping focus is INTENDED here (closing a panel, say), pass { focus: "discard" } to when()/match() to silence this, or { focus: { restoreTo: element } } to send focus somewhere other than <body>.`})}function ke(e,t){let n=[],r=ye();function o(){let i;try{i=ee(r,t)}catch(p){M(p,{phase:"binding",name:"bindChildNode",node:e});return}let s=gt(n);if(i==null||typeof i=="boolean"){for(let p=0;p<n.length;p++){let g=n[p];B(g),g.parentNode&&g.parentNode.removeChild(g)}n.length=0,ot(s,n,"bindChildNode");return}let a=e.parentNode;if(!a){n.length=0;return}let l;if(Array.isArray(i)){l=[];let p=new Set;for(let g=0;g<i.length;g++){let b=i[g];if(b==null||typeof b=="boolean")continue;let c=b instanceof Node?b:document.createTextNode(String(b));if(p.has(c)){H("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}p.add(c),l.push(c)}}else l=[i instanceof Node?i:document.createTextNode(String(i))];let u;if(n.length>0&&l.length>0){let p=new Set(n);u=new Set;for(let g=0;g<l.length;g++)p.has(l[g])&&u.add(l[g])}for(let p=0;p<n.length;p++){let g=n[p];u?.has(g)||(B(g),g.parentNode&&g.parentNode.removeChild(g))}let d=e;for(let p=0;p<l.length;p++){let g=l[p];d.nextSibling!==g&&a.insertBefore(g,d.nextSibling),d=g}n=l,ot(s,l,"bindChildNode")}return G(o,e,!0)}function vn(){throw new Error('[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first. There is no global `document`, and SibuJS builds live DOM nodes, on the server too. For example: import { GlobalRegistrator } from "@happy-dom/global-registrator"; GlobalRegistrator.register(); See SSR in AGENTS.md \xA710.')}function se(){typeof document>"u"&&vn()}var $="http://www.w3.org/2000/svg",Os=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var xn=new Set,eo=100,to=!1,no=new Map;function ro(e){let t=no.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),no.set(e,t)),t}function Ps(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=G(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",kt(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 p=a[d];if(p==null)continue;let g=ro(d);u.push(g),l.setProperty(g,Et(g,String(p),{element:e}))}for(let d=0;d<o.length;d++)u.indexOf(o[d])===-1&&l.removeProperty(o[d]);o=u},e);C(e,s);return}if(typeof t=="string"){e.setAttribute("style",kt(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=ro(r);if(typeof o=="function"){let s=o,a=G(()=>{n.style.setProperty(i,Et(i,String(s()),{element:e}))},e);C(e,a)}else n.style.setProperty(i,Et(i,String(o),{element:e}))}}function Ds(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=G(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);C(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=G(()=>{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);C(e,s)}else e.setAttribute("class",o)}function wn(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),C(e,ke(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),C(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),C(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)))}}}function m(e,t){let n=wr(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&vn();let i=dt(e,t);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),wn(i,o),i):(ie(()=>{let b=r.trim().split(/\s+/);if(b.length<2)return"";let c=0;for(let h=0;h<b.length;h++){let y=b[h];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 xn.has(f)?"":xn.size>=eo?to?"":(to=!0,`tagFactory: ${eo} 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.`):(xn.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 wn(i,r),i;let s=r,a=s.class;a!=null&&Ds(i,a);let l=s.id;typeof l=="function"?C(i,mt(i,"id",l)):l!=null&&(typeof l=="string"&&Os.has(l.toLowerCase())&&H(`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&&wn(i,u);let d=s.on;if(d)for(let b in d){if(!Object.hasOwn(d,b))continue;let c=d[b];typeof c=="function"?i.addEventListener(b,c):H(`tagFactory: on.${b} handler is not a function (got ${typeof c}). Event listener was not attached.`)}let p=s.style;p!=null&&Ps(i,p);let g=s.ref;g&&(g.current=i);for(let b in s)switch(b){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,b))continue;let c=s[b];if(c==null||Le(b))continue;typeof c=="function"?C(i,mt(i,b,c)):me(i,b,c,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var Yd=m("html"),Hs=m("head"),$s=m("body"),Is=m("title"),P=m("div"),q=m("span"),Bs=m("section"),js=m("article"),Vs=m("header"),Fs=m("footer"),zs=m("nav"),Ws=m("main"),qs=m("aside"),Us=m("address"),Tn=m("p"),Ks=m("h1"),Js=m("h2"),En=m("h3"),Gs=m("h4"),Ys=m("h5"),Zs=m("h6"),Xs=m("blockquote"),Qs=m("dd"),ea=m("dl"),ta=m("dt"),na=m("figcaption"),ra=m("figure"),oa=m("hr"),ia=m("li"),sa=m("ol"),aa=m("ul"),kn=m("pre"),la=m("a"),ua=m("abbr"),ca=m("b"),da=m("bdi"),fa=m("bdo"),pa=m("br"),ma=m("cite"),Cn=m("code"),ga=m("data"),ba=m("dfn"),ha=m("em"),ya=m("i"),Sa=m("kbd"),va=m("mark"),xa=m("q"),wa=m("rp"),Ta=m("rt"),Ea=m("ruby"),ka=m("s"),Ca=m("samp"),Aa=m("small"),_a=m("strong"),Na=m("sub"),Ra=m("sup"),La=m("time"),Ma=m("u"),Oa=m("var"),Pa=m("area"),Da=m("audio"),Ha=m("img"),$a=m("map"),Ia=m("track"),Ba=m("video"),ja=m("embed"),Va=m("iframe"),Fa=m("object"),za=m("param"),Wa=m("picture"),qa=m("portal"),Ua=m("source"),Ka=m("svg",$),Ja=m("math"),Ga=m("canvas"),Ya=m("noscript"),Za=m("script"),Xa=m("del"),Qa=m("ins"),el=m("caption"),tl=m("col"),nl=m("colgroup"),rl=m("table"),ol=m("tbody"),il=m("td"),sl=m("tfoot"),al=m("th"),ll=m("thead"),ul=m("tr"),bt=m("button"),cl=m("datalist"),dl=m("fieldset"),fl=m("form"),pl=m("input"),ml=m("label"),gl=m("legend"),bl=m("meter"),hl=m("optgroup"),yl=m("option"),Sl=m("output"),vl=m("progress"),xl=m("select"),wl=m("textarea"),Tl=m("details"),El=m("dialog"),kl=m("menu"),Cl=m("summary"),Al=m("slot"),_l=m("template"),Nl=m("base"),Rl=m("link"),Ll=m("meta"),qe=m("style"),Ml=m("circle",$),Ol=m("ellipse",$),Pl=m("g",$),Dl=m("line",$),Hl=m("path",$),$l=m("polygon",$),Il=m("polyline",$),Bl=m("rect",$),jl=m("text",$),Vl=m("tspan",$),Fl=m("defs",$),zl=m("clipPath",$),Wl=m("mask",$),ql=m("pattern",$),Ul=m("linearGradient",$),Kl=m("radialGradient",$),Jl=m("stop",$),Gl=m("use",$),Yl=m("symbol",$),Zl=m("marker",$),Xl=m("center"),Ql=m("font"),eu=m("marquee"),tu=e=>m(e);var oo,An=globalThis[oo=Symbol.for("sibujs.streamBoundary.v1")]??(globalThis[oo]={hook:null,current:null});function io(e){return An.hook?An.hook(e):null}function Ot(){return An.current}var _n=Symbol.for("sibujs.ssr.v1");function nu(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,r=process.getBuiltinModule;typeof r=="function"?n=r("node:async_hooks"):typeof Gt=="function"&&(n=Gt("async_hooks")),n&&(e=new n.AsyncLocalStorage)}let t=globalThis.AsyncLocalStorage;!e&&typeof t=="function"&&(e=new t)}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var De=globalThis[_n]??(globalThis[_n]=nu()),Ke=De.als,Ue=De.fallbackStore;De.fallbackDepth??(De.fallbackDepth=0);var so=!1;function ru(){if(so||Ke||!(typeof process<"u"&&!!process.versions?.node))return;so=!0;let t=process.versions.node;H(`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 He(){if(Ke){let e=Ke.getStore();if(e)return e}return Ue}function Nn(){return Ke?Ke.getStore()??null:De.fallbackDepth>0?Ue:null}function ne(){return He().ssr}function ao(e){if(!ne())return null;let t=He(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}var ou=Symbol.for("sibujs.prerender.v1");function ht(){return He().ssr||globalThis[ou]!==void 0}function lo(){return!ht()}function uo(){He().ssr=!0}function co(){He().ssr=!1}function fo(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0,pending:new Set,wake:null};if(Ke)return Ke.run(t,e);ru();let n={...Ue};Object.assign(Ue,t),De.fallbackDepth++;try{return e()}finally{De.fallbackDepth--;for(let r of Object.keys(Ue))r in n||delete Ue[r];Object.assign(Ue,n)}}function po(e,t,n=!0){let r=Nn(),o=r?.pending,i=o||!n?[]:Qt();if(!o&&i.length===0)return e;let s={label:t,since:Date.now(),boundary:Ot()??void 0};o?.add(s);let a=ar(i,s),l=()=>{o?.delete(s),r?.wake?.(),a()};try{Promise.resolve(e).then(l,l)}catch{l()}return e}function mo(e){let t=He(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Rn="__sibuPendingError";function go(e,t){let n=()=>e.parentNode?(M(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[Rn]=t)})}function Pt(e){let t=e,n=t[Rn];if(n instanceof Error)return delete t[Rn],n}function bo(e){let t=null;return function(){if(t&&!nr())return t();let r=P({class:"sibu-lazy"}),o=ye(),i=Ot(),s=!1,a=ee(null,()=>q("sibu-lazy-loading","Loading..."));if(t){let l=t;return le(r,ee(o,()=>l())),r}return po(e(),"lazy").then(te(l=>{if(s)return;t=l.default;let u=t,d=()=>ee(o,()=>u()),p=i?i.enter(d):d();le(r,p)})).catch(l=>{if(s)return;let u=l instanceof Error?l:new Error(String(l));le(r,P({class:"sibu-lazy-error"},`Failed to load component: ${u.message}`)),go(r,u)}),xe()&&r.firstChild||r.appendChild(a),C(r,()=>{s=!0}),r}}function ho({nodes:e,fallback:t}){let n=P({class:"sibu-suspense"}),r=ye(),o=io(n),i=p=>{le(n,p),o?.done()},s=ee(null,t);xe()&&n.firstChild?B(s):n.appendChild(s);let a=!1,l=null,u=null;C(n,()=>{a=!0,l&&(l.disconnect(),l=null),u&&!n.contains(u)&&B(u)});let d=te(()=>{if(!a)try{let p=o?o.enter(()=>ee(r,e)):ee(r,e);if(u=p,p.classList.contains("sibu-lazy")){if(!p.querySelector(".sibu-lazy-loading")){i(p);return}l=new MutationObserver(()=>{if(a)return;p.querySelector(".sibu-lazy-loading")||(l?.disconnect(),l=null,i(p))}),l.observe(p,{childList:!0,subtree:!0})}else i(p)}catch(p){let g=p instanceof Error?p:new Error(String(p));go(n,g)}});return queueMicrotask(d),n}function Pn(e,t){return()=>rt()===e?t():Mt(e,t)}function Ht(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";M(n,{phase:r,name:t});return}}function Ln(e,t,n,r,o){let i=Ht(e,t);if(typeof i!="function")return;let s=Pn(o,i);r()||!n.isConnected?Ht(s,"onUnmount"):So(s,n)}var it=new WeakMap,Je=new WeakMap,Ce=new Set,Ae=new Set,st=null,Dt=0,iu=256;function Mn(e){let t=it.get(e);if(t){it.delete(e),Ce.delete(e);for(let n of t)try{n()}catch{}}}function On(e){Je.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Je.get(e);if(n){Je.delete(e),Ae.delete(e);for(let r of n)try{r()}catch{}}})}function su(e){if(Ce.size===0||e.nodeType!==1)return;let t=e;if(Ce.has(t)&&t.isConnected&&Mn(t),t.firstElementChild)for(let n of Array.from(Ce))n!==t&&n.isConnected&&t.contains(n)&&Mn(n)}function au(e){if(Ae.size===0||e.nodeType!==1)return;let t=e;if(Ae.has(t)&&!t.isConnected&&On(t),t.firstElementChild)for(let n of Array.from(Ae))n!==t&&!n.isConnected&&t.contains(n)&&On(n)}function lu(){if(Ce.size>0)for(let e of Array.from(Ce))e.isConnected&&Mn(e);if(Ae.size>0)for(let e of Array.from(Ae))e.isConnected||On(e)}function yo(){st||typeof document>"u"||(st=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++)su(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)au(t.removedNodes[n])}Dt+=e.length,Dt>=iu&&(Dt=0,lu()),Dn()}),st.observe(document.body,{childList:!0,subtree:!0}))}function Dn(){st&&Ce.size===0&&Ae.size===0&&(st.disconnect(),st=null,Dt=0)}function uu(e,t){let n=it.get(e);return n||(n=[],it.set(e,n)),n.push(t),Ce.add(e),yo(),()=>{let r=it.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(it.delete(e),Ce.delete(e))}Dn()}}function cu(e,t){let n=Je.get(e);return n||(n=[],Je.set(e,n)),n.push(t),Ae.add(e),yo(),()=>{let r=Je.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Je.delete(e),Ae.delete(e))}Dn()}}function $t(e,t){if(typeof document>"u"||ne())return;let n=rt();if(e=Pn(n,e),t){let r=!1,o=()=>r;if(C(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||Ln(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){Ln(e,"onMount",t,o,n);return}let i=uu(t,()=>{r||Ln(e,"onMount",t,o,n)});C(t,i)})}else queueMicrotask(()=>{Ht(e,"onMount")})}function du(e,t){typeof document>"u"||ne()||So(Pn(rt(),e),t)}function So(e,t){let n=!1,r=()=>{n||(n=!0,Ht(e,"onUnmount"))};C(t,r);let o=()=>{if(n)return;let i=cu(t,r);C(t,i)};t.isConnected?o():$t(()=>{o()},t)}function fu(e,t){C(t,e)}function fe(e,t,n){try{e.emit(t,n)}catch{}}var To=globalThis;function pu(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,be(()=>t(o,void 0));else{let i=n;n=o,be(()=>t(o,i))}}}var vo=100;function It(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===rt()?xo(t):Mt(n,()=>xo(t))}function xo(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){M(n,{phase:"cleanup"})}}function wo(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&It(e),Pe(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=vo);e.rerunPending&&(e.rerunPending=!1,M(new Error(`effect re-requested itself ${vo}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function mu(e){if(e.disposed)return;e.disposed=!0;let t=To.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&It(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{ze(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function re(e,t){if(V(typeof e=="function","effect: argument must be a function."),ne()&&!t?.server)return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=s=>{n.userCleanups.push(s)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(s){r(s)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&It(n),Pe(n.bodyFn,o),n.rerunPending&&wo(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{Pe(n.bodyFn,n.subscriber),n.rerunPending&&wo(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&It(n),ze(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=To.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&fe(i,"effect:create",{effectFn:e}),()=>mu(n)}var yt=0,Hn=new Set;function gu(e){yt++;try{return e()}finally{yt--,yt===0&&yu()}}function bu(e){return yt===0?!1:(Hn.add(e),!0)}function hu(){return yt>0}function yu(){try{for(let e of Hn)Zr(e)}finally{Hn.clear()}Yr()}var Eo=Symbol.for("sibujs.reactive.batch.v1");function Su(){let e=globalThis,t=e[Eo];if(t)return t;let n={batch:gu,enqueueBatchedSignal:bu,isBatching:hu};return e[Eo]=n,n}var $n=Su(),U=$n.batch,Ge=$n.enqueueBatchedSignal,vu=$n.isBatching;var In=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 Fe(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=In.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&fe(d,"signal:update",{signal:n,name:r,oldValue:l,newValue:u})}Ge(n)||nt(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=In.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&fe(d,"signal:update",{signal:n,name:r,oldValue:l,newValue:u}),Ge(n)||nt(n)},!0){let a=In.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&fe(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function xu(e){let[t,n]=A(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var wu=`
|
|
8
8
|
.sibu-error-display {
|
|
9
9
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
10
10
|
border-radius: 10px;
|
|
@@ -185,11 +185,11 @@
|
|
|
185
185
|
border: 1px solid #3a3a4e;
|
|
186
186
|
}
|
|
187
187
|
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
188
|
-
`,
|
|
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
|
|
188
|
+
`,ko=!1;function Tu(){if(ko||typeof document>"u")return;let e=qe({nodes:wu});document.head.appendChild(e),ko=!0}function Eu(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 Co(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=Eu(r),i=e.cause,s=i!=null?Co(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 ku(e,t,n){let r=[];r.push(n),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
|
|
190
190
|
`).map(s=>` ${s}`).join(`
|
|
191
191
|
`);r.push(i)}o=o.cause}if(t&&Object.keys(t).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(t))r.push(` ${i}: ${String(s)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
|
|
192
|
-
`)}function
|
|
192
|
+
`)}function Ao(e){let t=e.map((n,r)=>P({class:"sibu-err-frame",nodes:[q({class:"sibu-err-line",nodes:String(r+1)}),q({class:"sibu-err-fn",nodes:n.fn}),q({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return kn({class:"sibu-err-stack",nodes:t})}function _o(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:[q({nodes:`[${e.code}] ${e.message}`}),q({nodes:""})]}),e.frames.length>0?Ao(e.frames):P({class:"sibu-err-stack",nodes:"(no stack)"})]}),..._o(e.cause)]:[]}function Cu(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 Bn(e){Tu();let t=e.severity??"error",n=Co(e.error),r=e.alwaysShowDetails??he(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=A("Copy"),l=bt({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let b=ku(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(b).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),u=P({class:"sibu-err-header",nodes:[Cn({class:"sibu-err-icon",nodes:n.code}),En({class:"sibu-err-title",nodes:o}),l,q({class:"sibu-err-timestamp",nodes:i})]}),d=[Tn({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:[q({nodes:"Stack Trace"})]}),Ao(n.frames)]})),r&&d.push(..._o(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:[q({nodes:"Metadata"})]}),Cu(e.metadata)]}));let p=[];e.onRetry&&p.push(bt({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&p.push(bt({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),p.length>0&&d.push(P({class:"sibu-err-actions",nodes:p}));let g=P({class:"sibu-err-body",nodes:d});return P({class:"sibu-error-display","data-severity":t,nodes:[u,g]})}var Au=`
|
|
193
193
|
.sibu-error-boundary {
|
|
194
194
|
position: relative;
|
|
195
195
|
}
|
|
@@ -343,7 +343,7 @@
|
|
|
343
343
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
344
344
|
background: #3a3a4e;
|
|
345
345
|
}
|
|
346
|
-
`,
|
|
346
|
+
`,_u=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),No=!1;function Nu(){if(!No&&typeof document<"u"){let e=qe({nodes:Au});document.head.appendChild(e),No=!0}}function Ru(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;Nu();let[a,l]=A(null),u=()=>{p(),l(null)},d=null,p=()=>{if(!d)return;let S=d;d=null,S()},g=S=>{let x=new Array(S.length);for(let E=0;E<S.length;E++)try{x[E]=S[E]()}catch(D){M(D,{phase:"effect",name:"ErrorBoundary.resetKeys"}),x[E]=_u}return x},b=()=>{let S=s;if(!S||S.length===0)return;p();let x=null;d=re(()=>{let E=g(S);if(x===null){x=E;return}let D=E.length!==x.length;if(!D){for(let I=0;I<E.length;I++)if(!Object.is(E[I],x[I])){D=!0;break}}x=E,D&&u()})},c=S=>{let x=Zt(S);if(l(x),b(),i)try{i(x)}catch(E){M(E,{phase:"render",name:"ErrorBoundary onError callback"})}return x},f=(S,x)=>Bn({error:S,severity:"error",onRetry:x}),h=S=>{let x=o||f;try{return x(S,u)}catch(E){return queueMicrotask(()=>{M(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 S=a();if(S)return h(S);try{let x=n();if(x&&typeof x.then=="function"){let E=P({class:"sibu-error-async"});E.appendChild(q({class:"sibu-lazy-loading",nodes:"Loading..."}));let D=!1;return C(E,()=>{D=!0}),x.then(I=>{if(D){B(I);return}le(E,I)}).catch(te(I=>{if(D)return;let K=c(I);le(E,h(K))})),E}return x}catch(x){let E=c(x);return h(E)}}}),v=S=>{if(a())return;let E=S.detail?.error;E&&(S.preventDefault(),S.stopPropagation(),c(E))};return y.addEventListener("sibu:error-propagate",v),$t(()=>{let S=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),x=[],E=S.currentNode;for(;E;){let D=Pt(E);D&&x.push(D),E=S.nextNode()}if(x.length===1)c(x[0]);else if(x.length>1){let D=globalThis.AggregateError;c(D?new D(x,`${x.length} pre-mount errors caught by ErrorBoundary`):new Error(x.map(I=>I.message).join("; ")))}},y),C(y,()=>{p(),y.removeEventListener("sibu:error-propagate",v)}),y}var Lu=`
|
|
347
347
|
@keyframes sibu-spin {
|
|
348
348
|
to { transform: rotate(360deg); }
|
|
349
349
|
}
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
397
397
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
398
398
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
399
|
-
`,ao=!1;function il(){!ao&&typeof document<"u"&&(document.head.appendChild(Ve({nodes:ol})),ao=!0)}function sl(e={}){il();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"},[q({class:"sibu-loading-dot"}),q({class:"sibu-loading-dot"}),q({class:"sibu-loading-dot"})]),t?q({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?q({class:"sibu-loading-text"},t):null])}var An=Symbol.for("sibujs.actions.v1"),lo=globalThis[An]??(globalThis[An]=new Map);function nt(e,t){lo.set(e,t)}function co(e){return lo.get(e)}function al(e,t,n){let r=typeof t=="string"?co(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 fo=(e,t)=>{let n=e.ownerDocument,r=o=>{let i=o.target;typeof i?.nodeType=="number"&&e.contains(i)||t()};return n.addEventListener("pointerdown",r,!0),()=>n.removeEventListener("pointerdown",r,!0)},uo=["pointerup","pointerleave","pointercancel"],po=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=u=>{let l=u.pointerId;r!==null&&l!==o||(i(),o=l,r=setTimeout(()=>{r=null,t.callback()},n))},a=u=>{r!==null&&u.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let u of uo)e.addEventListener(u,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let u of uo)e.removeEventListener(u,a)}},mo=(e,t)=>{let n=o=>M(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)},go=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)},bo=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1],a=e.ownerDocument.activeElement;r.shiftKey&&a===i?(r.preventDefault(),s.focus()):!r.shiftKey&&a===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};nt("clickOutside",fo);nt("longPress",po);nt("copyOnClick",mo);nt("autoResize",go);nt("trapFocus",bo);function Ot(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(n){return Promise.reject(n)}return typeof t!="function"?null:new Promise((n,r)=>{queueMicrotask(()=>{try{Reflect.apply(t,e,[n,r])}catch(o){r(o)}})})}var qe=null;function ul(e,t){try{let n=e(),r=Ot(n);return r&&r.then(void 0,o=>{t?t(o,"async"):qe?qe(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):qe?qe(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function ll(e,t){try{return await e()}catch(n){return t?t(n,"async"):qe?qe(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function cl(e){qe=e}function dl(e){let[t,n]=A(e),r=i=>{!!0||!me()||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 u=s();return u!==null&&typeof u?.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."),u}finally{n(a)}}}}var Nn=Symbol.for("sibujs.createId.v1"),Rn=globalThis[Nn]??(globalThis[Nn]={n:0});function ho(e="sibu"){let t=qr();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(Rn.n++,`${e}-${Rn.n}`)}function yo(){Rn.n=0}function fl(e,t){let n=typeof t=="function"?t():t;return _(n,J(()=>{n.style.display=e()?"":"none"},n)),n}function vo(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}function So(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,u=r.has(s),l=!a&&!u;return r.add(s),u&&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,t.nextSibling),{node:s,owned:l}}function Pt(e,t){t&&F(e),e.parentNode?.removeChild(e)}function pl(e,t,n,r){oe(),vo(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("when"),a=null,u,l=!1,c=!1,m=new WeakSet,h=!1,g=()=>{if(c)return;let f=e(),b=s.parentNode;if(!b||l&&Object.is(f,u))return;u=f;let y=a?ct([a]):null;a?.parentNode&&(Pt(a,h),a=null);let S=f?t:o!==void 0?o:null,v=pe(()=>So(b,s,S,m,"when"));a=v.node,h=v.owned,Qe(y,a?[a]:[],"when",i),l=!0},d=Be(g,s);return _(s,()=>{c=!0,d.stop(),a&&Pt(a,h),a=null}),l||queueMicrotask(Q(()=>{!c&&!l&&s.parentNode&&d.run(g)})),s}function ml(e,t,n,r){oe(),vo(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("match"),a=null,u,l=!1,c=!1,m=new WeakSet,h=!1,g=()=>{if(c)return;let f=String(e()),b=s.parentNode;if(!b||l&&f===u)return;u=f;let y=a?ct([a]):null;a?.parentNode&&(Pt(a,h),a=null);let S=Object.hasOwn(t,f)?t[f]:o,v=pe(()=>So(b,s,S??null,m,"match"));a=v.node,h=v.owned,Qe(y,a?[a]:[],"match",i),l=!0},d=Be(g,s);return _(s,()=>{c=!0,d.stop(),a&&Pt(a,h),a=null}),l||queueMicrotask(Q(()=>{!c&&!l&&s.parentNode&&d.run(g)})),s}function pt(e,t){let n=globalThis;return n[e]??(n[e]=t())}var Dt=pt(Symbol.for("sibujs.components.registry.v1"),()=>new Map),xo=pt(Symbol.for("sibujs.components.registryVersion.v1"),()=>A(0));function wo(){let[e,t]=xo;t(pe(e)+1)}function gl(e,t){Dt.set(e,t),wo()}function bl(e){Dt.delete(e)&&wo()}function hl(e){let t=Dt.get(e);return t?t():P(`[Component "${e}" not found]`)}function yl(e){let t=P({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(xo[0](),a=Dt.get(s));let u=a??`missing:${s}`;if(u===r)return;let l=pe(()=>a?a():P(`[Component "${s}" not found]`));r=u,re(t,l)}let i=J(o,t,!0);return _(t,i),t}function To(e){return typeof e=="function"?To(e()):e instanceof Node?e:document.createTextNode(String(e))}function vl(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let u=e[a],l=0,c=n.length;for(;l<c;){let m=l+c>>1;e[n[m]]<u?l=m+1:c=m}n[l]=a,r[a]=l>0?n[l-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 Sl(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."),oe();let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,u=0,l=new Map,c=new Map,m=[],h=[],g=[],d=0,f=[],b=[],y=new Uint8Array(0),S=new Map,v=[],x=[],T=new Map,$=!1,V=!1,G=!1,ge=n.key,gt=()=>{if(G)return;let O=e(),k=O.length,H=r.parentNode;if(!H)return;V||(H.insertBefore(o,r.nextSibling),V=!0),b.length<k&&(b=new Array(k));for(let E=0;E<k;E++)b[E]=ge(O[E]);let W=b;f.length<k&&(f=new Array(k)),c.clear(),T.clear();for(let E=0;E<k;E++)T.has(W[E])&&D(`each: duplicate key "${String(W[E])}" at index ${E} (first seen at ${T.get(W[E])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),T.set(W[E],E);d=0;for(let E=0;E<k;E++){let Z=W[E],$n=l.get(Z),st;if($n!==void 0)st=$n,m[d]=st,h[d]=O[E],g[d]=E,d++;else{let[Hn,Wo]=A(O[E]),[In,qo]=A(E),Vt;try{De();try{Vt=To(t(Hn,In))}finally{$e()}}catch(Uo){let Ko=W[E];Vt=document.createComment(`each:error:${E}`),queueMicrotask(()=>{M(Uo,{phase:"render",name:`each row (key="${String(Ko)}")`,node:r.parentNode?r:void 0})})}st={node:Vt,item:Hn,setItem:Wo,index:In,setIndex:qo}}c.set(Z,st),f[E]=st.node}for(let[E,Z]of l)c.has(E)||(F(Z.node),Z.node.parentNode&&H.removeChild(Z.node));if(k===0){u=0;let E=l;l=c,c=E,$=!0,d=0;return}S.clear();for(let E=0;E<u;E++)S.set(a[E],E);v.length<k&&(v=new Array(k),x=new Array(k));let Le=0;for(let E=0;E<k;E++){let Z=S.get(W[E]);Z!==void 0&&(v[Le]=E,x[Le]=Z,Le++)}let ie=vl(x,Le);y.length<k?y=new Uint8Array(k):y.fill(0,0,k);for(let E=0;E<ie.length;E++)y[v[ie[E]]]=1;let K=o;for(let E=k-1;E>=0;E--){let Z=f[E];y[E]||Z.nextSibling!==K&&H.insertBefore(Z,K),K=Z}let Y=a===i?s:i;Y.length<k&&(Y.length=k);for(let E=0;E<k;E++)Y[E]=W[E];a=Y,u=k;let it=l;l=c,c=it,$=!0,N()};function N(){if(d===0)return;let O=d;d=0,U(()=>{for(let k=0;k<O;k++){let H=m[k];H.setItem(h[k]),H.setIndex(g[k]),m[k]=void 0,h[k]=void 0}})}let w=Be(gt),R=w.stop;return _(r,()=>{if(!G){G=!0,R();for(let O of l.values())F(O.node),O.node.parentNode?.removeChild(O.node);o.parentNode&&o.parentNode.removeChild(o),V=!1,l.clear(),c.clear(),T.clear(),S.clear(),u=0,m.length=0,h.length=0,g.length=0,d=0}}),$||queueMicrotask(Q(()=>{!$&&!G&&r.parentNode&&w.run(gt)})),r}function xl(e){oe();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"||Eo(t,r);else Eo(t,n);return t}function Eo(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),_(n,we(n,t));return}e.appendChild(document.createTextNode(String(t)))}var wl=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ko=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),_o=new WeakMap;function Tl(e){let t=e.length-1,n=e[0];for(let g=0;g<t;g++)n+=`\0${g}\0${e[g+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
400
|
-
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let g=r;r++;let d=0;for(;r<o&&n.charCodeAt(r)!==0;)d=d*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,d<0||d>=t?(r=g,-1):d}function a(){let g=r;for(;r<o;){let d=n.charCodeAt(r);if(d>=97&&d<=122||d>=65&&d<=90||d>=48&&d<=57||d===45)r++;else break}return n.slice(g,r)}function u(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let g=s();if(g>=0)return{kind:"expr",idx:g};let d=n[r];if(d==='"'||d==="'"){r++;let f=[],b=[],y="";for(;r<o&&n[r]!==d;){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 l(){let g=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let d=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(d,r);if(!f)break;let b=u();f.startsWith("on:")?b.kind==="expr"&&g.push({t:3,name:f.slice(3),idx:b.idx}):b.kind==="bool"?g.push({t:4,name:f}):b.kind==="static"?g.push({t:0,name:f,value:b.value}):b.kind==="expr"?g.push({t:1,name:f,idx:b.idx}):b.kind==="mixed"&&g.push({t:2,name:f,statics:b.statics,exprs:b.exprs})}return g}function c(g){return g.replace(/\s+/g," ")}function m(g){let d="";for(;r<o&&n[r]!=="<";){let b=s();if(b>=0){let y=c(d);y&&g.push({t:1,value:y}),d="",g.push({t:2,idx:b})}else d+=n[r++]}let f=c(d);f&&g.push({t:1,value:f})}function h(){let g=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let d=n[r+1];if(d==="!"){if(n.startsWith("<!--",r)){let 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(d==="?"){let v=n.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(d>="a"&&d<="z")&&!(d>="A"&&d<="Z")){g.push({t:1,value:"<"}),r++;continue}r++;let f=a(),b=l();i();let y=wl.has(f),S=n[r]==="/";if(S&&r++,r<o&&r++,y||S)g.push({t:0,el:{tag:f,svg:ko.has(f),attrs:b,children:[]}});else{let v=h();if(or(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++),g.push({t:0,el:{tag:f,svg:ko.has(f),attrs:b,children:v}})}}else m(g);return g}return h()}function Ln(e,t){let n=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:Qt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?_(n,lt(n,i,s)):de(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]}de(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(Ln(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,we(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 Co(e,...t){let n=_o.get(e);return n||(n=Tl(e),_o.set(e,n)),No(n,t)}function Ao(e,t){return No(e,t)}function No(e,t){if(oe(),e.length===1&&e[0].t===0)return Ln(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(Ln(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,we(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 El(e,t,n){oe();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&be()&&D("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,u=null,l=!1,c=!1,m=()=>{if(c)return;let d=e(),f=r.parentNode;if(!f||l&&d===a)return;u?.parentNode&&f.removeChild(u),a=d;let b=o.get(d);if(b){let y=i.indexOf(d);y!==-1&&(i.splice(y,1),i.push(d))}else{let y=t[d];if(!y){u=null,l=!0;return}if(b=y(),b.nodeType===11){let S=document.createElement("div");S.style.display="contents",S.appendChild(b),b=S}if(o.set(d,b),i.push(d),s>0&&i.length>s){let S=i.shift(),v=o.get(S);v&&(F(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(S))}}f.insertBefore(b,r.nextSibling),u=b,l=!0},h=Be(m),g=h.stop;return l||queueMicrotask(Q(()=>{!l&&r.parentNode&&h.run(m)})),_(r,()=>{c=!0,g();for(let d of o.values())F(d),d.parentNode&&d.parentNode.removeChild(d);o.clear(),i.length=0,u=null}),r}function kl(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=c=>{if(c instanceof DocumentFragment){let m=document.createComment(""),h=document.createComment("");c.insertBefore(m,c.firstChild),c.appendChild(h),o={start:m,end:h}}t.appendChild(c)},s;typeof e=="function"?s=Un(()=>{let c=e();return i(c),c}):(s=e,i(s));let a=n()-r,u=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&ce(u,"app:init",{rootElement:s,container:t,duration:a});let l=o;return{node:s,unmount(){if(u&&ce(u,"app:unmount",{rootElement:s}),l){_l(l.start,l.end);return}F(s),s.parentNode?.removeChild(s)}}}function _l(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=ve;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){ke("mount",ve,1);return}F(a),a.parentNode===n&&n.removeChild(a)}s||M(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function Cl(e,t){oe();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=Q(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{M(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),_(n,()=>{i=!0,o&&(F(o),o.remove(),o=null)}),n}function Al(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Ro(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function Nl(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 u=[...a];return s=Ro(u,o,i),s.length===0&&i.length<=1?a:u}),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,u)=>u!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,u)=>u===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 Rl(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,We(r)||Xe(r)}function i(){if(He(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,...u){let l=Ro(t,a,u);return(l.length>0||u.length>1)&&o(),l},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let u=t.findIndex(a);u!==-1&&(t.splice(u,1),o())},set(a){t=[...a],o()},update(a,u){a<0||a>=t.length||Object.is(t[a],u)||(t[a]=u,o())},updateWhere(a,u){let l=!1;for(let c=0;c<t.length;c++)if(a(t[c])){let m=u(t[c]);Object.is(t[c],m)||(t[c]=m,l=!0)}l&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let u=t.filter(a);u.length!==t.length&&(t=u,o())},map(a){let u=!1;for(let l=0;l<t.length;l++){let c=a(t[l],l);Object.is(t[l],c)||(t[l]=c,u=!0)}u&&o()},clear(){t.length!==0&&(t=[],o())}}]}function Ll(e,t){let[n,r]=A(t),[o,i]=A(!1),[s,a]=A(null),[u,l]=A(0),c=0,m=!1,h=null,g=()=>{if(h===null)return;let f=h;h=null;try{f.abort()}catch{}},d=te(()=>{if(u(),m)return;g();let f=++c,b=typeof AbortController<"u"?new AbortController:null;h=b,U(()=>{i(!0),a(null)});let y=()=>m||f!==c,S;try{S=e({signal:b?b.signal:void 0})}catch(v){if(y())return;U(()=>{a(v),i(!1)});return}S.then(v=>{y()||(h=null,U(()=>{r(v),i(!1)}))},v=>{y()||(h=null,U(()=>{a(v),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{m||l(f=>f+1)},dispose:()=>{m||(m=!0,d(),g())}}}function rt(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[u,l]of e)if(!a.has(u)||!rt(l,a.get(u),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let u of e)if(!a.has(u))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),u=new Uint8Array(t);if(a.length!==u.length)return!1;for(let l=0;l<a.length;l++)if(a[l]!==u[l])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,u=t;if(a.length!==u.length)return!1;for(let l=0;l<a.length;l++)if(a[l]!==u[l])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,u)=>rt(a,t[u],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&&rt(e.cause,a.cause,n)&&Lo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:Lo(r,o,n)}function Lo(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)&&rt(e[i],t[i],n))}function Ml(e){return A(e,{equals:(t,n)=>rt(t,n)})}function Ue(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,u=()=>{o._d||s||(o._d=!0)};u._c=1,u._sig=o;let l=()=>{let d=e();o._v=r&&o._init&&r(o._v,d)?o._v:d,o._d=!1,o._init=!0};try{Ye(()=>{o._v=e(),o._d=!1,o._init=!0},u)}catch(d){throw s=!0,Ie(u),d}let c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,m=()=>{if(!o._d||s||a!==void 0)return;let d=o._v;i=!0;try{Ne(l,u),Object.is(d,o._v)||o.__v++}catch(f){a={error:f},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&Ie(u)}c&&!s&&!Object.is(d,o._v)&&ce(c,"computed:update",{signal:o,oldValue:d,newValue:o._v})};o._validate=m;let h=()=>{let{error:d}=a;throw a=void 0,s&&(o._d=!1),d};function g(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Nr()||s?(o._d&&(m(),a!==void 0&&h()),o._v):(o._d&&(m(),a!==void 0&&(He(o),h())),He(o),o._v)}return n&&(g.__name=n,o.__name=n),g.__signal=o,g.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,Ie(u);let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(d)try{d.emit("computed:destroy",{signal:o,getter:g})}catch{}},c&&ce(c,"computed:create",{signal:o,name:n,getter:g}),g}function Ol(e){let[t,n]=A(e);return{get current(){return t()},set current(r){n(r)}}}function Mo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Pl(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(u=>{let[l,c]=A(e[u]);Mo(t,u,[l,c])});let n=new Proxy({},{get(u,l){if(typeof l=="string"&&Object.hasOwn(t,l)){let c=t[l][0];return c()}return Reflect.get(u,l)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let u={};return Object.keys(t).forEach(l=>{Mo(u,l,t[l][0]())}),u};return[n,{setState:u=>{let l=r(),c=typeof u=="function"?u(l):u;U(()=>{Object.entries(c).forEach(([m,h])=>{Object.hasOwn(t,m)&&t[m][1](h)})})},reset:()=>{U(()=>{Object.keys(e).forEach(u=>{let l=t[u][1];l(e[u])})})},subscribe:u=>{let l=!0;return te(()=>{let c=r();if(l){l=!1;return}De();try{u(c)}finally{$e()}})},subscribeKey:(u,l)=>{let c,m=!0;return te(()=>{let h=t[u][0]();if(m){c=h,m=!1;return}if(!Object.is(h,c)){let g=c;c=h,De();try{l(h,g)}finally{$e()}}})},getSnapshot:r}]}function Dl(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."),me())return()=>{};let n,r=!0;return Ye(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,De();try{t(s,a)}finally{$e()}}})}function $l(e,t,n){return[Ue(e,n),i=>{U(()=>t(i))}]}function Hl(e){let t=e();return be()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function Il(e){if(!be())return te(e);let t=te(e),n=null;return queueMicrotask(()=>{try{n=te(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Oo(e,t){return me()?()=>{}:J(e,t)}var Mn="data-sibu-enhanced",On=new WeakMap;function Po(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=ve){let i=r.length-o+e.length;e.length=0,ke(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var Do=["text","attr","class","show","on","cleanup"];function $o(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 mt(e,t){return Oo(t,e)}function Bl(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 Vl(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 jl(e,t,n,r){let o=`ctx.each[${r}]`;if(be())for(let i of Object.keys(n))j(Do.includes(i),`${o}: unknown binding "${i}". Expected one of: ${Do.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(Mn)==="true")return be()&&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?(ne(()=>`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,u=(h,g,d)=>{if(a(h))return;let f=$o(n,g);if(!f){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(g)} not found under`,n);return}d(f)},l={root:n,ref:h=>$o(n,h),refs:h=>{let g=h.startsWith("@")?`[data-ref="${h.slice(1)}"]`:h;try{return Array.from(n.querySelectorAll(g))}catch{return[]}},on:(h,g,d,f)=>{u("on",h,b=>{let y=S=>d(S,b);b.addEventListener(g,y,f),r.push(()=>b.removeEventListener(g,y,f))})},text:(h,g)=>{u("text",h,d=>{r.push(mt(d,()=>{let f=g(),b=f==null?"":String(f);d.textContent!==b&&(d.textContent=b)}))})},attr:(h,g,d)=>{u("attr",h,f=>{r.push(mt(f,()=>{let b=d(),y=b==null?null:String(b);de(f,g,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(h,g,d)=>{u("classed",h,f=>{r.push(mt(f,()=>{f.classList.toggle(g,!!d())}))})},show:(h,g)=>{u("show",h,d=>{let f=d.hidden;r.push(mt(d,()=>{d.hidden=!g()})),r.push(()=>{d.hidden=f})})},model:(h,g,d)=>{u("model",h,f=>{let b=f,[y,S]=g,v=d?.event??(b instanceof HTMLSelectElement||b instanceof HTMLInputElement&&(b.type==="checkbox"||b.type==="radio")?"change":"input");r.push(mt(f,()=>{Vl(b,y())}));let x=()=>S(Bl(b));b.addEventListener(v,x),r.push(()=>b.removeEventListener(v,x))})},each:(h,g)=>{if(a("each"))return;j(typeof g=="function","ctx.each: second argument must be a function.");let d=typeof h=="string"?l.refs(h):Array.from(h);for(let f=0;f<d.length;f++){let b=d[f],y=g(b,f);y!=null&&jl(l,b,y,f)}},cleanup:h=>{a("cleanup")||r.push(h)}},c;try{c=t(l);let h=c;if(h&&typeof h.then=="function")throw h.then(void 0,g=>{ne(()=>`enhance: the promise returned by the setup also rejected: ${String(g)}`)}),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 Po(r,"enhance"),s=!0,h}typeof c=="function"&&r.push(c);let m=()=>{i||(i=!0,On.get(n)===o&&(On.delete(n),n.removeAttribute(Mn)),at(n,m),Po(r,"enhance"),s=!0)};return _(n,m),On.set(n,o),n.setAttribute(Mn,"true"),m}function Fl(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 zl=/^[A-Za-z0-9_-]+$/,Ho=Symbol.for("sibujs.islands.lazy"),Ht=pt(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Wl(e){return e[Ho]=!0,e}function ql(e,t){if(!zl.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Ht.set(e,t)}function Ul(e){Ht.delete(e)}async function Kl(e){if(typeof e=="function"&&e[Ho]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function Gl(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(!Ht.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,u=()=>{if(a||o)return;a=!0;let c=Ht.get(s);c&&Kl(c).then(m=>{if(!o){if(!m){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let h=$t(i,m);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(m=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,m)})},l=i.getAttribute("data-sibu-load")||"load";n.push(Jl(l,i,u,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Jl(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 Yl=new Set(["__proto__","constructor","prototype"]);function Pn(e){return Yl.has(e)}function It(e){let t={};for(let n of Object.keys(e))Pn(n)||(t[n]=e[n]);return t}function Io(e){return e}var sm=1024*1024;function Xl(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()}))},u=Ye(()=>{i=e(),a()}),l=(()=>t());return l.dispose=()=>{o||(o=!0,u())},l}var Bo=16;function Zl(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:Bo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Bo)}function Ql(){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=u=>{s(),M(u,{phase:"async",name:"transition"})};Zl(()=>{try{let u=Ot(o());u?u.then(s,a):s()}catch(u){a(u)}})}return{pending:e,start:r}}function ec(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var Bt={};Bn(Bt,{RenderProp:()=>dc,assertType:()=>vc,compose:()=>cc,createGuard:()=>Sc,createSlots:()=>pc,defineComponent:()=>mc,defineSlottedComponent:()=>gc,defineStrictComponent:()=>yc,globalStore:()=>ac,machine:()=>tc,optimistic:()=>rc,optimisticList:()=>oc,persisted:()=>nc,timeline:()=>ic,validateProps:()=>zo,validators:()=>hc,withBoundary:()=>fc,withDefaults:()=>lc,withProps:()=>bc,withWrapper:()=>uc});function ot(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function tc(e){let[t,n]=A(e.initial),[r,o]=A(e.context||{}),i=e.initial,s=r(),a=[],u=!1;function l(){u=!0;try{for(;a.length>0;)c(a.shift())}catch(f){throw a.length=0,f}finally{u=!1}}function c(f){let b=ot(e.states,i);if(!b?.on)return;let y=ot(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 T=s;if(v&&!v(T))return;b.exit&&b.exit(T);let $=T;if(x){let G=x(T);$={...T,...It(G)}}i=S,s=$,U(()=>{x&&o($),n(S)});let V=ot(e.states,S);V?.entry&&V.entry(s)}function m(f){a.push(f),!u&&l()}let h=ot(e.states,e.initial);if(h?.entry){u=!0;try{h.entry(s)}catch(f){throw a.length=0,f}finally{u=!1}a.length>0&&l()}function g(f){return t()===f}function d(f){let b=t(),y=ot(e.states,b);if(!y?.on)return!1;let S=ot(y.on,f);return S?typeof S=="string"?!0:S.guard?S.guard(r()):!0:!1}return{state:t,context:r,send:m,matches:g,can:d}}function nc(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)=>Pn(y)?void 0:S,s=n.deserialize||(y=>JSON.parse(y,i)),a=n.encrypt,u=n.decrypt,l=n.session?!1:n.syncTabs??!0,c=t;try{let y=r?r.getItem(e):null;if(y!==null){u&&(y=u(y));let S=s(y);c=n.validate&&!n.validate(S)?t:S}}catch{}let[m,h]=A(c),g=!1,d=te(()=>{let y=m();if(!g)try{let S=o(y);a&&(S=a(S)),r?.setItem(e,S)}catch{}}),f=null;return l&&r&&typeof window<"u"&&(f=y=>{if(!(y.storageArea!==r||y.key!==e)){if(y.newValue===null){g=!0;try{h(t)}finally{g=!1}return}try{let S=y.newValue;u&&(S=u(S));let v=s(S);if(n.validate&&!n.validate(v))return;g=!0;try{h(v)}finally{g=!1}}catch{}}},window.addEventListener("storage",f)),Object.defineProperty(h,"dispose",{value:()=>{d(),f&&typeof window<"u"&&(window.removeEventListener("storage",f),f=null)},enumerable:!1,writable:!1,configurable:!1}),[m,h]}function rc(e){let[t,n]=A(e),[r,o]=A(!1),i=0,s=0;async function a(u,l){let c=++s,m=t();n(u),i++,o(!0);try{let h=await l();s===c&&n(h)}catch{s===c&&n(m)}finally{i--,i<=0&&(i=0,o(!1))}}return{value:t,pending:r,update:a}}function oc(e){let t=0,n=0,r=0,o=new Map,i=[];for(let N of e){let w={id:t++,key:n++,base:N,claims:[],visible:!0,refs:0};o.set(w.id,w),i.push(w.id)}function s(N){let w=N.claims;return w.length>0?w[w.length-1].value:N.base}function a(N,w){let R=N.claims;for(let L=R.length-1;L>=0;L--)if(R[L].opId<w)return R[L].value;return N.base}function u(N,w,R){let L={opId:w,value:R,settled:!1},O=N.claims,k=O.length;for(;k>0&&O[k-1].opId>w;)k--;return O.splice(k,0,L),L}function l(N,w){let R=N.claims.indexOf(w);R!==-1&&N.claims.splice(R,1)}function c(N){let w=N.claims,R=0;for(;R<w.length&&w[R].settled;)N.base=w[R].value,R++;R>0&&w.splice(0,R)}let[m,h]=A(i.map(N=>s(o.get(N)))),[g,d]=A(!1),f=0,b=new Set;function y(){let N=new Array(i.length);for(let w=0;w<i.length;w++)N[w]=s(o.get(i[w]));return N}function S(N){U(()=>{let w=!1;try{w=N()}finally{d(f>0),w&&h(y())}})}function v(N){let w=o.get(N);return!w||!w.visible?!1:(w.visible=!1,i=i.filter(R=>R!==N),!0)}function x(N){let w=[];for(let H of N){let W=o.get(H);!W||W.visible||b.has(H)||w.push(H)}if(w.length===0)return!1;let R=new Array(i.length+w.length),L=0,O=0,k=0;for(;L<i.length&&O<w.length;){let H=o.get(i[L]).key,W=o.get(w[O]).key;R[k++]=H<=W?i[L++]:w[O++]}for(;L<i.length;)R[k++]=i[L++];for(;O<w.length;)R[k++]=w[O++];for(let H of w)o.get(H).visible=!0;return i=R,!0}function T(N){for(let w of N){let R=o.get(w);R&&R.refs++}}function $(N){for(let w of N){let R=o.get(w);R&&(R.refs--,R.refs<=0&&!R.visible&&(o.delete(w),b.delete(w)))}}function V(N){if($(N),f--,f<=0&&(f=0,b.clear(),o.size!==i.length))for(let[w,R]of o)R.visible||o.delete(w)}async function G(N,w){let R=++r,L={id:t++,key:n++,base:N,claims:[],visible:!1,refs:1},O=u(L,R,N);S(()=>(o.set(L.id,L),L.visible=!0,i=[...i,L.id],f++,!0));let k,H=!1;try{k=await w()}catch{H=!0}S(()=>{try{if(H)return b.add(L.id),l(L,O),v(L.id);let W=s(L);return O.value=k,O.settled=!0,c(L),L.visible&&!Object.is(W,s(L))}finally{V([L.id])}})}async function ge(N,w){let R=++r,L=[];for(let k of i)N(a(o.get(k),R))&&L.push(k);S(()=>{if(T(L),f++,L.length===0)return!1;let k=new Set(L);for(let H of L){let W=o.get(H);W&&(W.visible=!1)}return i=i.filter(H=>!k.has(H)),!0});let O=!1;try{await w()}catch{O=!0}S(()=>{try{if(!O){for(let k of L)b.add(k);return!1}return x(L)}finally{V(L)}})}async function gt(N,w,R){let L=++r,O=[];for(let ie of i){let K=o.get(ie),Y=a(K,L);N(Y)&&O.push({row:K,nextValue:{...Y,...w}})}let k=O.map(ie=>ie.row.id),H=[];S(()=>{T(k),f++;let ie=!1;for(let K of O){let Y=s(K.row);H.push(u(K.row,L,K.nextValue)),K.row.visible&&!Object.is(Y,s(K.row))&&(ie=!0)}return ie});let W,Le=!1;try{W=await R()}catch{Le=!0}S(()=>{try{let ie=!1;for(let K=0;K<H.length;K++){let Y=O[K].row,it=H[K],E=s(Y);Le?l(Y,it):(it.value=W,it.settled=!0),c(Y),Y.visible&&!Object.is(E,s(Y))&&(ie=!0)}return ie}finally{V(k)}})}return{items:m,pending:g,add:G,remove:ge,update:gt}}function ic(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=Ue(()=>n()[o()]),a=Ue(()=>o()>0),u=Ue(()=>o()<n().length-1);function l(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),U(()=>{x.length>t?(x.shift(),r(x),i(x.length-1)):(r(x),i(v+1))})}function c(){a()&&i(o()-1)}function m(){u()&&i(o()+1)}function h(){U(()=>{r([e]),i(0)})}function g(f){let b=n();f>=0&&f<b.length&&i(f)}function d(){s.dispose(),a.dispose(),u.dispose()}return{value:s,set:l,undo:c,redo:m,canUndo:a,canRedo:u,history:n,index:o,reset:h,jumpTo:g,dispose:d}}var jo=Promise.prototype.then;function Vo(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(jo,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function Fo(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(d){return{promise:Promise.reject(d),failedEarly:!0,probe:f=>queueMicrotask(f)}}if(typeof t!="function")return null;let n,r,o=new Promise((d,f)=>{n=d,r=f}),i="invoking",s,a=[],u=d=>{if(i=d,d!=="invoking")for(let f of a.splice(0))f()},l=d=>{n(d),u("fulfilled")},c=d=>{r(d),u("rejected")},m=d=>{if(d===o){c(new TypeError("adopt: a thenable resolved to its own adoption"));return}if(d===null||typeof d!="object"&&typeof d!="function"){l(d);return}let f;try{f=d.then}catch(b){c(b);return}if(typeof f!="function"){l(d);return}h(d,f)},h=(d,f)=>{f===jo?(s=d,u("native")):u("invoking"),queueMicrotask(()=>{let b=!1,y=v=>{b||(b=!0,m(v))},S=v=>{b||(b=!0,c(v))};try{Reflect.apply(f,d,[y,S])}catch(v){S(v)}!b&&i==="invoking"&&u("pending")})};return h(e,t),{promise:o,failedEarly:!1,probe:(d,f)=>{let b=()=>{i==="native"?Vo(s,d,f):(i==="rejected"?d:f)()};i==="native"?Vo(s,d,f):i==="invoking"?a.push(b):queueMicrotask(i==="rejected"?d:f)}}}function sc(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 ac(e){let t=sc(e.state),[n,r]=A({...t}),o=new Map,i=e.middleware||[];function s(d){if(o.size!==0){for(let f of Array.from(o.values()))if(f.active)try{f.callback(d)}catch(b){M(b,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],u=!1;function l(d,f=!0){if(a.push(d),u)return;u=!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(T){S&&f?(y=!0,b=T):M(T,{phase:"event",name:"globalStore(dispatch)"})}S=!1}}finally{a.length=0,u=!1}if(y)throw b}function c(d,f){let b=e.actions[d];if(!b)throw new Error(`Unknown action: ${String(d)}`);let y=()=>{let S=n(),v=b(S,f),x=It(v);r({...S,...x}),s(n())};l(()=>{if(i.length===0){y();return}let S=v=>{if(v>=i.length){y();return}let x=!1,T=!1,$=!0,V=()=>{if(T&&!x){D(`globalStore: middleware ${v} next() called after it failed for "${String(d)}"; ignored.`),x=!0;return}if(x){D(`globalStore: middleware ${v} next() called more than once for "${String(d)}"; ignored.`);return}if(x=!0,$){S(v+1);return}let ge=()=>l(()=>S(v+1),!1);if(!G){ge();return}G.probe(()=>{T=!0,D(`globalStore: middleware ${v} next() called after it failed for "${String(d)}"; ignored.`)},ge)},G=null;try{G=Fo(i[v](n(),String(d),f,V))}catch(ge){throw T=!0,ge}finally{$=!1}G&&(G.failedEarly&&(T=!0),G.promise.then(void 0,ge=>{T=!0,M(ge,{phase:"async",name:"globalStore(middleware)"})}))};S(0)})}function m(d){return()=>d(n())}function h(d){let f=o.get(d);f||(f={callback:d,active:!0},o.set(d,f));let b=f;return()=>{o.get(d)===b&&(b.active=!1,o.delete(d))}}function g(){l(()=>{r({...t}),s(n())})}return{getState:n,select:m,dispatch:c,subscribe:h,reset:g}}function uc(e,t){return n=>t(e,n)}function lc(e,t){return n=>e({...t,...n})}function cc(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function dc(e){return e.render(e.data())}function fc(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 pc(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 mc(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function gc(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function bc(e,t){return n=>e(t(n))}var hc={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 zo(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
|
+
`,Ro=!1;function Mu(){!Ro&&typeof document<"u"&&(document.head.appendChild(qe({nodes:Lu})),Ro=!0)}function Ou(e={}){Mu();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"},[q({class:"sibu-loading-dot"}),q({class:"sibu-loading-dot"}),q({class:"sibu-loading-dot"})]),t?q({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?q({class:"sibu-loading-text"},t):null])}var jn=Symbol.for("sibujs.actions.v1"),Mo=globalThis[jn]??(globalThis[jn]=new Map);function at(e,t){Mo.set(e,t)}function Oo(e){return Mo.get(e)}function Pu(e,t,n){let r=typeof t=="string"?Oo(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"&&C(e,o)}var Po=(e,t)=>{let n=e.ownerDocument,r=o=>{let i=o.target;typeof i?.nodeType=="number"&&e.contains(i)||t()};return n.addEventListener("pointerdown",r,!0),()=>n.removeEventListener("pointerdown",r,!0)},Lo=["pointerup","pointerleave","pointercancel"],Do=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=l=>{let u=l.pointerId;r!==null&&u!==o||(i(),o=u,r=setTimeout(()=>{r=null,t.callback()},n))},a=l=>{r!==null&&l.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let l of Lo)e.addEventListener(l,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let l of Lo)e.removeEventListener(l,a)}},Ho=(e,t)=>{let n=o=>M(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)},$o=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)},Io=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1],a=e.ownerDocument.activeElement;r.shiftKey&&a===i?(r.preventDefault(),s.focus()):!r.shiftKey&&a===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};at("clickOutside",Po);at("longPress",Do);at("copyOnClick",Ho);at("autoResize",$o);at("trapFocus",Io);function Bt(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 Ye=null;function Du(e,t){try{let n=e(),r=Bt(n);return r&&r.then(void 0,o=>{t?t(o,"async"):Ye?Ye(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):Ye?Ye(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Hu(e,t){try{return await e()}catch(n){return t?t(n,"async"):Ye?Ye(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function $u(e){Ye=e}function Iu(e,t){let n=typeof t=="function"?t():t;return C(n,G(()=>{n.style.display=e()?"":"none"},n)),n}function Bo(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}function jo(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&&ie(()=>`${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.`),t.nextSibling!==s&&e.insertBefore(s,t.nextSibling),{node:s,owned:u}}function jt(e,t){t&&B(e),e.parentNode?.removeChild(e)}function Vn(e,t,n,r){se(),Bo(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("when"),a=ye(),l=null,u,d=!1,p=!1,g=new WeakSet,b=!1,c=()=>{if(p)return;let h=e(),y=s.parentNode;if(!y||d&&Object.is(h,u))return;u=h;let v=l?gt([l]):null;l?.parentNode&&(jt(l,b),l=null);let S=h?t:o!==void 0?o:null,x=be(()=>ee(a,()=>jo(y,s,S,g,"when")));l=x.node,b=x.owned,ot(v,l?[l]:[],"when",i),d=!0},f=We(c,s);return C(s,()=>{p=!0,f.stop(),l&&jt(l,b),l=null}),d||queueMicrotask(te(()=>{!p&&!d&&s.parentNode&&f.run(c)})),s}function Bu(e,t,n,r){se(),Bo(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("match"),a=ye(),l=null,u,d=!1,p=!1,g=new WeakSet,b=!1,c=()=>{if(p)return;let h=String(e()),y=s.parentNode;if(!y||d&&h===u)return;u=h;let v=l?gt([l]):null;l?.parentNode&&(jt(l,b),l=null);let S=Object.hasOwn(t,h)?t[h]:o,x=be(()=>ee(a,()=>jo(y,s,S??null,g,"match")));l=x.node,b=x.owned,ot(v,l?[l]:[],"match",i),d=!0},f=We(c,s);return C(s,()=>{p=!0,f.stop(),l&&jt(l,b),l=null}),d||queueMicrotask(te(()=>{!p&&!d&&s.parentNode&&f.run(c)})),s}function Vo(e,t={}){let n=ht(),[r,o]=A(!n&&!xe());return!n&&!r()&&sr(()=>o(!0)),Vn(r,e,t.fallback)}function ju(e){let[t,n]=A(e),r=i=>{!!0||!ne()||H(`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"&&H("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 Fn=Symbol.for("sibujs.createId.v1"),zn=globalThis[Fn]??(globalThis[Fn]={n:0});function Fo(e="sibu"){let t=Nn();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(zn.n++,`${e}-${zn.n}`)}function zo(){zn.n=0}function St(e,t){let n=globalThis;return n[e]??(n[e]=t())}var Vt=St(Symbol.for("sibujs.components.registry.v1"),()=>new Map),Wo=St(Symbol.for("sibujs.components.registryVersion.v1"),()=>A(0));function qo(){let[e,t]=Wo;t(be(e)+1)}function Vu(e,t){Vt.set(e,t),qo()}function Fu(e){Vt.delete(e)&&qo()}function zu(e){let t=Vt.get(e);return t?t():P(`[Component "${e}" not found]`)}function Wu(e){let t=P({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(Wo[0](),a=Vt.get(s));let l=a??`missing:${s}`;if(l===r)return;let u=be(()=>a?a():P(`[Component "${s}" not found]`));r=l,le(t,u)}let i=G(o,t,!0);return C(t,i),t}function Uo(e){return typeof e=="function"?Uo(e()):e instanceof Node?e:document.createTextNode(String(e))}function qu(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 p=u+d>>1;e[n[p]]<l?u=p+1:d=p}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 Uu(e,t,n){V(typeof e=="function","each: first argument must be a function that returns an array."),V(typeof t=="function","each: second argument must be a render function."),V(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item."),se();let r=document.createComment("each:anchor"),o=ye(),i=document.createComment("each:end"),s=[],a=[],l=s,u=0,d=new Map,p=new Map,g=[],b=[],c=[],f=0,h=[],y=[],v=new Uint8Array(0),S=new Map,x=[],E=[],D=new Map,I=!1,K=!1,oe=!1,Ut=n.key,N=()=>{if(oe)return;let O=e(),k=O.length,W=r.parentNode;if(!W)return;if(!K){let T=xe()?Ku(r):null;T?W.replaceChild(i,T):W.insertBefore(i,r.nextSibling),K=!0}y.length<k&&(y=new Array(k));for(let T=0;T<k;T++)y[T]=Ut(O[T]);let pe=y;h.length<k&&(h=new Array(k)),p.clear(),D.clear();for(let T=0;T<k;T++)D.has(pe[T])&&H(`each: duplicate key "${String(pe[T])}" at index ${T} (first seen at ${D.get(pe[T])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),D.set(pe[T],T);f=0;for(let T=0;T<k;T++){let Z=pe[T],Gn=d.get(Z),ct;if(Gn!==void 0)ct=Gn,g[f]=ct,b[f]=O[T],c[f]=T,f++;else{let[Yn,pi]=A(O[T]),[Zn,mi]=A(T),Jt;try{je();try{Jt=Uo(ee(or(o,Z),()=>t(Yn,Zn)))}finally{Ve()}}catch(gi){let bi=pe[T];Jt=document.createComment(`each:error:${T}`),queueMicrotask(()=>{M(gi,{phase:"render",name:`each row (key="${String(bi)}")`,node:r.parentNode?r:void 0})})}ct={node:Jt,item:Yn,setItem:pi,index:Zn,setIndex:mi}}p.set(Z,ct),h[T]=ct.node}for(let[T,Z]of d)p.has(T)||(B(Z.node),Z.node.parentNode&&W.removeChild(Z.node));if(k===0){u=0;let T=d;d=p,p=T,I=!0,f=0;return}S.clear();for(let T=0;T<u;T++)S.set(l[T],T);x.length<k&&(x=new Array(k),E=new Array(k));let Q=0;for(let T=0;T<k;T++){let Z=S.get(pe[T]);Z!==void 0&&(x[Q]=T,E[Q]=Z,Q++)}let J=qu(E,Q);v.length<k?v=new Uint8Array(k):v.fill(0,0,k);for(let T=0;T<J.length;T++)v[x[J[T]]]=1;let Y=i;for(let T=k-1;T>=0;T--){let Z=h[T];v[T]||Z.nextSibling!==Y&&W.insertBefore(Z,Y),Y=Z}let _e=l===s?a:s;_e.length<k&&(_e.length=k);for(let T=0;T<k;T++)_e[T]=pe[T];l=_e,u=k;let Kt=d;d=p,p=Kt,I=!0,w()};function w(){if(f===0)return;let O=f;f=0,U(()=>{for(let k=0;k<O;k++){let W=g[k];W.setItem(b[k]),W.setIndex(c[k]),g[k]=void 0,b[k]=void 0}})}let R=We(N),L=R.stop;return C(r,()=>{if(!oe){oe=!0,L();for(let O of d.values())B(O.node),O.node.parentNode?.removeChild(O.node);i.parentNode&&i.parentNode.removeChild(i),K=!1,d.clear(),p.clear(),D.clear(),S.clear(),u=0,g.length=0,b.length=0,c.length=0,f=0}}),I||queueMicrotask(te(()=>{!I&&!oe&&r.parentNode&&R.run(N)})),r}function Ku(e){let t=0;for(let n=e.nextSibling;n;n=n.nextSibling){if(n.nodeType!==8)continue;let r=n.data;if(r==="each:anchor")t++;else if(r==="each:end"){if(t===0)return n;t--}}return null}function Ju(e){se();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"||Ko(t,r);else Ko(t,n);return t}function Ko(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),C(n,ke(n,t));return}e.appendChild(document.createTextNode(String(t)))}var Gu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Jo=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Go=new WeakMap;function Yu(e){let t=e.length-1,n=e[0];for(let b=0;b<t;b++)n+=`\0${b}\0${e[b+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 b=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=b,-1):c}function a(){let b=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(b,r)}function l(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let b=s();if(b>=0)return{kind:"expr",idx:b};let c=n[r];if(c==='"'||c==="'"){r++;let f=[],h=[],y="";for(;r<o&&n[r]!==c;){let v=s();v>=0?(f.push(y),y="",h.push(v)):y+=n[r++]}return r<o&&r++,f.push(y),h.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:h}}{let f=[],h=[],y="";for(;r<o;){let v=n.charCodeAt(r);if(v===32||v===9||v===10||v===13||v===62)break;let S=s();S>=0?(f.push(y),y="",h.push(S)):y+=n[r++]}return f.push(y),h.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:h}}}function u(){let b=[];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 h=l();f.startsWith("on:")?h.kind==="expr"&&b.push({t:3,name:f.slice(3),idx:h.idx}):h.kind==="bool"?b.push({t:4,name:f}):h.kind==="static"?b.push({t:0,name:f,value:h.value}):h.kind==="expr"?b.push({t:1,name:f,idx:h.idx}):h.kind==="mixed"&&b.push({t:2,name:f,statics:h.statics,exprs:h.exprs})}return b}function d(b){return b.replace(/\s+/g," ")}function p(b){let c="";for(;r<o&&n[r]!=="<";){let h=s();if(h>=0){let y=d(c);y&&b.push({t:1,value:y}),c="",b.push({t:2,idx:h})}else c+=n[r++]}let f=d(c);f&&b.push({t:1,value:f})}function g(){let b=[];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 S=n.indexOf("-->",r+4);r=S===-1?o:S+3}else if(n.startsWith("<![CDATA[",r)){let S=n.indexOf("]]>",r+9);r=S===-1?o:S+3}else{let S=n.indexOf(">",r);r=S===-1?o:S+1}continue}if(c==="?"){let S=n.indexOf(">",r);r=S===-1?o:S+1;continue}if(!(c>="a"&&c<="z")&&!(c>="A"&&c<="Z")){b.push({t:1,value:"<"}),r++;continue}r++;let f=a(),h=u();i();let y=Gu.has(f),v=n[r]==="/";if(v&&r++,r<o&&r++,y||v)b.push({t:0,el:{tag:f,svg:Jo.has(f),attrs:h,children:[]}});else{let S=g();if(Tr(f)){for(let x=0;x<S.length;x++)if(S[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++),b.push({t:0,el:{tag:f,svg:Jo.has(f),attrs:h,children:S}})}}else p(b);return b}return g()}function Wn(e,t){let n=dt(e.tag,e.svg?$:void 0);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:cn(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?C(n,mt(n,i,s)):me(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]}me(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):H(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:cn(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(Wn(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),C(n,ke(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 Yo(e,...t){let n=Go.get(e);return n||(n=Yu(e),Go.set(e,n)),Xo(n,t)}function Zo(e,t){return Xo(e,t)}function Xo(e,t){if(se(),e.length===1&&e[0].t===0)return Wn(e[0].el,t);let n=dt("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(Wn(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),C(n,ke(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 Zu(e,t,n){se();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&he()&&H("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,p=()=>{if(d)return;let c=e(),f=r.parentNode;if(!f||u&&c===a)return;l?.parentNode&&f.removeChild(l),a=c;let h=o.get(c);if(h){let y=i.indexOf(c);y!==-1&&(i.splice(y,1),i.push(c))}else{let y=t[c];if(!y){l=null,u=!0;return}if(h=y(),h.nodeType===11){let v=document.createElement("div");v.style.display="contents",v.appendChild(h),h=v}if(o.set(c,h),i.push(c),s>0&&i.length>s){let v=i.shift(),S=o.get(v);S&&(B(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(v))}}f.insertBefore(h,r.nextSibling),l=h,u=!0},g=We(p),b=g.stop;return u||queueMicrotask(te(()=>{!u&&r.parentNode&&g.run(p)})),C(r,()=>{d=!0,b();for(let c of o.values())B(c),c.parentNode&&c.parentNode.removeChild(c);o.clear(),i.length=0,l=null}),r}function Xu(e,t){if(!t)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 n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=d=>{if(d instanceof DocumentFragment){let p=document.createComment(""),g=document.createComment("");d.insertBefore(p,d.firstChild),d.appendChild(g),o={start:p,end:g}}t.appendChild(d)},s;typeof e=="function"?s=dr(()=>{let d=e();return i(d),d}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&fe(l,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(l&&fe(l,"app:unmount",{rootElement:s}),u){Qu(u.start,u.end);return}B(s),s.parentNode?.removeChild(s)}}}function Qu(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=we;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){Re("mount",we,1);return}B(a),a.parentNode===n&&n.removeChild(a)}s||M(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function ec(e,t){se();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=te(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{M(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),C(n,()=>{i=!0,o&&(B(o),o.remove(),o=null)}),n}function tc(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Qo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function nc(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=Qo(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 rc(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Ge(r)||nt(r)}function i(){if(Fe(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=Qo(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 p=l(t[d]);Object.is(t[d],p)||(t[d]=p,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 oc(e,t){let[n,r]=A(t),[o,i]=A(!1),[s,a]=A(null),[l,u]=A(0),d=0,p=!1,g=null,b=()=>{if(g===null)return;let f=g;g=null;try{f.abort()}catch{}},c=re(()=>{if(l(),p)return;b();let f=++d,h=typeof AbortController<"u"?new AbortController:null;g=h,U(()=>{i(!0),a(null)});let y=()=>p||f!==d,v;try{v=e({signal:h?h.signal:void 0})}catch(S){if(y())return;U(()=>{a(S),i(!1)});return}v.then(S=>{y()||(g=null,U(()=>{r(S),i(!1)}))},S=>{y()||(g=null,U(()=>{a(S),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{p||u(f=>f+1)},dispose:()=>{p||(p=!0,c(),b())}}}function lt(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)||!lt(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)=>lt(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&<(e.cause,a.cause,n)&&ei(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:ei(r,o,n)}function ei(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)&<(e[i],t[i],n))}function ic(e){return A(e,{equals:(t,n)=>lt(t,n)})}function Ze(e,t){V(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{tt(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(c){throw s=!0,ze(l),c}let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,p=()=>{if(!o._d||s||a!==void 0)return;let c=o._v;i=!0;try{Pe(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&&ze(l)}d&&!s&&!Object.is(c,o._v)&&fe(d,"computed:update",{signal:o,oldValue:c,newValue:o._v})};o._validate=p;let g=()=>{let{error:c}=a;throw a=void 0,s&&(o._d=!1),c};function b(){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 Jr()||s?(o._d&&(p(),a!==void 0&&g()),o._v):(o._d&&(p(),a!==void 0&&(Fe(o),g())),Fe(o),o._v)}return n&&(b.__name=n,o.__name=n),b.__signal=o,b.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,ze(l);let c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(c)try{c.emit("computed:destroy",{signal:o,getter:b})}catch{}},d&&fe(d,"computed:create",{signal:o,name:n,getter:b}),b}function sc(e){let[t,n]=A(e);return{get current(){return t()},set current(r){n(r)}}}function ti(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ac(e){V(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]);ti(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=>{ti(l,u,t[u][0]())}),l};return[n,{setState:l=>{let u=r(),d=typeof l=="function"?l(u):l;U(()=>{Object.entries(d).forEach(([p,g])=>{Object.hasOwn(t,p)&&t[p][1](g)})})},reset:()=>{U(()=>{Object.keys(e).forEach(l=>{let u=t[l][1];u(e[l])})})},subscribe:l=>{let u=!0;return re(()=>{let d=r();if(u){u=!1;return}je();try{l(d)}finally{Ve()}})},subscribeKey:(l,u)=>{let d,p=!0;return re(()=>{let g=t[l][0]();if(p){d=g,p=!1;return}if(!Object.is(g,d)){let b=d;d=g,je();try{u(g,b)}finally{Ve()}}})},getSnapshot:r}]}function lc(e,t){if(V(typeof e=="function","watch: first argument must be a getter function."),V(typeof t=="function","watch: second argument must be a callback function."),ne())return()=>{};let n,r=!0;return tt(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,je();try{t(s,a)}finally{Ve()}}})}function uc(e,t,n){return[Ze(e,n),i=>{U(()=>t(i))}]}function cc(e){let t=e();return he()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function dc(e){if(!he())return re(e);let t=re(e),n=null;return queueMicrotask(()=>{try{n=re(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function ni(e,t){return ne()?()=>{}:G(e,t)}var qn="data-sibu-enhanced",Un=new WeakMap;function ri(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=we){let i=r.length-o+e.length;e.length=0,Re(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var oi=["text","attr","class","show","on","cleanup"];function ii(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 vt(e,t){return ni(t,e)}function fc(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 pc(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 mc(e,t,n,r){let o=`ctx.each[${r}]`;if(he())for(let i of Object.keys(n))V(oi.includes(i),`${o}: unknown binding "${i}". Expected one of: ${oi.join(", ")}.`);if(n.text!==void 0&&(V(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];V(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];V(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(t,i,s)}if(n.show!==void 0&&(V(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];V(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(t,i,s)}n.cleanup!==void 0&&(V(typeof n.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(n.cleanup))}function Ft(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(qn)==="true")return he()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=g=>s?(ie(()=>`enhance: ctx.${g}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`),!0):!1,l=(g,b,c)=>{if(a(g))return;let f=ii(n,b);if(!f){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(b)} not found under`,n);return}c(f)},u={root:n,ref:g=>ii(n,g),refs:g=>{let b=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(n.querySelectorAll(b))}catch{return[]}},on:(g,b,c,f)=>{l("on",g,h=>{let y=v=>c(v,h);h.addEventListener(b,y,f),r.push(()=>h.removeEventListener(b,y,f))})},text:(g,b)=>{l("text",g,c=>{r.push(vt(c,()=>{let f=b(),h=f==null?"":String(f);c.textContent!==h&&(c.textContent=h)}))})},attr:(g,b,c)=>{l("attr",g,f=>{r.push(vt(f,()=>{let h=c(),y=h==null?null:String(h);me(f,b,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(g,b,c)=>{l("classed",g,f=>{r.push(vt(f,()=>{f.classList.toggle(b,!!c())}))})},show:(g,b)=>{l("show",g,c=>{let f=c.hidden;r.push(vt(c,()=>{c.hidden=!b()})),r.push(()=>{c.hidden=f})})},model:(g,b,c)=>{l("model",g,f=>{let h=f,[y,v]=b,S=c?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(vt(f,()=>{pc(h,y())}));let x=()=>v(fc(h));h.addEventListener(S,x),r.push(()=>h.removeEventListener(S,x))})},each:(g,b)=>{if(a("each"))return;V(typeof b=="function","ctx.each: second argument must be a function.");let c=typeof g=="string"?u.refs(g):Array.from(g);for(let f=0;f<c.length;f++){let h=c[f],y=b(h,f);y!=null&&mc(u,h,y,f)}},cleanup:g=>{a("cleanup")||r.push(g)}},d;try{d=t(u);let g=d;if(g&&typeof g.then=="function")throw g.then(void 0,b=>{ie(()=>`enhance: the promise returned by the setup also rejected: ${String(b)}`)}),new Error("[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored.")}catch(g){throw ri(r,"enhance"),s=!0,g}typeof d=="function"&&r.push(d);let p=()=>{i||(i=!0,Un.get(n)===o&&(Un.delete(n),n.removeAttribute(qn)),ft(n,p),ri(r,"enhance"),s=!0)};return C(n,p),Un.set(n,o),n.setAttribute(qn,"true"),p}function gc(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Ft(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 bc=/^[A-Za-z0-9_-]+$/,si=Symbol.for("sibujs.islands.lazy"),zt=St(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function hc(e){return e[si]=!0,e}function yc(e,t){if(!bc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);zt.set(e,t)}function Sc(e){zt.delete(e)}async function vc(e){if(typeof e=="function"&&e[si]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function xc(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(!zt.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=zt.get(s);d&&vc(d).then(p=>{if(!o){if(!p){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=Ft(i,p);if(o){g();return}r.push(g),i.setAttribute("data-sibu-hydrated","true")}catch(g){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,g)}}}).catch(p=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,p)})},u=i.getAttribute("data-sibu-load")||"load";n.push(wc(u,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function wc(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 Tc=new Set(["__proto__","constructor","prototype"]);function Kn(e){return Tc.has(e)}function Wt(e){let t={};for(let n of Object.keys(e))Kn(n)||(t[n]=e[n]);return t}function ai(e){return e}var ng=1024*1024;function Ec(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=tt(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,l())},u}var li=16;function kc(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:li*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,li)}function Cc(){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(),M(l,{phase:"async",name:"transition"})};kc(()=>{try{let l=Bt(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function Ac(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var qt={};Xn(qt,{RenderProp:()=>Ic,assertType:()=>Uc,compose:()=>$c,createGuard:()=>Kc,createSlots:()=>jc,defineComponent:()=>Vc,defineSlottedComponent:()=>Fc,defineStrictComponent:()=>qc,globalStore:()=>Pc,machine:()=>_c,optimistic:()=>Rc,optimisticList:()=>Lc,persisted:()=>Nc,timeline:()=>Mc,validateProps:()=>fi,validators:()=>Wc,withBoundary:()=>Bc,withDefaults:()=>Hc,withProps:()=>zc,withWrapper:()=>Dc});function ut(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function _c(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 h=ut(e.states,i);if(!h?.on)return;let y=ut(h.on,f);if(!y)return;let v,S,x;typeof y=="string"?v=y:(v=y.target,S=y.guard,x=y.action);let E=s;if(S&&!S(E))return;h.exit&&h.exit(E);let D=E;if(x){let K=x(E);D={...E,...Wt(K)}}i=v,s=D,U(()=>{x&&o(D),n(v)});let I=ut(e.states,v);I?.entry&&I.entry(s)}function p(f){a.push(f),!l&&u()}let g=ut(e.states,e.initial);if(g?.entry){l=!0;try{g.entry(s)}catch(f){throw a.length=0,f}finally{l=!1}a.length>0&&u()}function b(f){return t()===f}function c(f){let h=t(),y=ut(e.states,h);if(!y?.on)return!1;let v=ut(y.on,f);return v?typeof v=="string"?!0:v.guard?v.guard(r()):!0:!1}return{state:t,context:r,send:p,matches:b,can:c}}function Nc(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,v)=>Kn(y)?void 0:v,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 v=s(y);d=n.validate&&!n.validate(v)?t:v}}catch{}let[p,g]=A(d),b=!1,c=re(()=>{let y=p();if(!b)try{let v=o(y);a&&(v=a(v)),r?.setItem(e,v)}catch{}}),f=null;return u&&r&&typeof window<"u"&&(f=y=>{if(!(y.storageArea!==r||y.key!==e)){if(y.newValue===null){b=!0;try{g(t)}finally{b=!1}return}try{let v=y.newValue;l&&(v=l(v));let S=s(v);if(n.validate&&!n.validate(S))return;b=!0;try{g(S)}finally{b=!1}}catch{}}},window.addEventListener("storage",f)),Object.defineProperty(g,"dispose",{value:()=>{c(),f&&typeof window<"u"&&(window.removeEventListener("storage",f),f=null)},enumerable:!1,writable:!1,configurable:!1}),[p,g]}function Rc(e){let[t,n]=A(e),[r,o]=A(!1),i=0,s=0;async function a(l,u){let d=++s,p=t();n(l),i++,o(!0);try{let g=await u();s===d&&n(g)}catch{s===d&&n(p)}finally{i--,i<=0&&(i=0,o(!1))}}return{value:t,pending:r,update:a}}function Lc(e){let t=0,n=0,r=0,o=new Map,i=[];for(let N of e){let w={id:t++,key:n++,base:N,claims:[],visible:!0,refs:0};o.set(w.id,w),i.push(w.id)}function s(N){let w=N.claims;return w.length>0?w[w.length-1].value:N.base}function a(N,w){let R=N.claims;for(let L=R.length-1;L>=0;L--)if(R[L].opId<w)return R[L].value;return N.base}function l(N,w,R){let L={opId:w,value:R,settled:!1},F=N.claims,O=F.length;for(;O>0&&F[O-1].opId>w;)O--;return F.splice(O,0,L),L}function u(N,w){let R=N.claims.indexOf(w);R!==-1&&N.claims.splice(R,1)}function d(N){let w=N.claims,R=0;for(;R<w.length&&w[R].settled;)N.base=w[R].value,R++;R>0&&w.splice(0,R)}let[p,g]=A(i.map(N=>s(o.get(N)))),[b,c]=A(!1),f=0,h=new Set;function y(){let N=new Array(i.length);for(let w=0;w<i.length;w++)N[w]=s(o.get(i[w]));return N}function v(N){U(()=>{let w=!1;try{w=N()}finally{c(f>0),w&&g(y())}})}function S(N){let w=o.get(N);return!w||!w.visible?!1:(w.visible=!1,i=i.filter(R=>R!==N),!0)}function x(N){let w=[];for(let k of N){let W=o.get(k);!W||W.visible||h.has(k)||w.push(k)}if(w.length===0)return!1;let R=new Array(i.length+w.length),L=0,F=0,O=0;for(;L<i.length&&F<w.length;){let k=o.get(i[L]).key,W=o.get(w[F]).key;R[O++]=k<=W?i[L++]:w[F++]}for(;L<i.length;)R[O++]=i[L++];for(;F<w.length;)R[O++]=w[F++];for(let k of w)o.get(k).visible=!0;return i=R,!0}function E(N){for(let w of N){let R=o.get(w);R&&R.refs++}}function D(N){for(let w of N){let R=o.get(w);R&&(R.refs--,R.refs<=0&&!R.visible&&(o.delete(w),h.delete(w)))}}function I(N){if(D(N),f--,f<=0&&(f=0,h.clear(),o.size!==i.length))for(let[w,R]of o)R.visible||o.delete(w)}async function K(N,w){let R=++r,L={id:t++,key:n++,base:N,claims:[],visible:!1,refs:1},F=l(L,R,N);v(()=>(o.set(L.id,L),L.visible=!0,i=[...i,L.id],f++,!0));let O,k=!1;try{O=await w()}catch{k=!0}v(()=>{try{if(k)return h.add(L.id),u(L,F),S(L.id);let W=s(L);return F.value=O,F.settled=!0,d(L),L.visible&&!Object.is(W,s(L))}finally{I([L.id])}})}async function oe(N,w){let R=++r,L=[];for(let O of i)N(a(o.get(O),R))&&L.push(O);v(()=>{if(E(L),f++,L.length===0)return!1;let O=new Set(L);for(let k of L){let W=o.get(k);W&&(W.visible=!1)}return i=i.filter(k=>!O.has(k)),!0});let F=!1;try{await w()}catch{F=!0}v(()=>{try{if(!F){for(let O of L)h.add(O);return!1}return x(L)}finally{I(L)}})}async function Ut(N,w,R){let L=++r,F=[];for(let Q of i){let J=o.get(Q),Y=a(J,L);N(Y)&&F.push({row:J,nextValue:{...Y,...w}})}let O=F.map(Q=>Q.row.id),k=[];v(()=>{E(O),f++;let Q=!1;for(let J of F){let Y=s(J.row);k.push(l(J.row,L,J.nextValue)),J.row.visible&&!Object.is(Y,s(J.row))&&(Q=!0)}return Q});let W,pe=!1;try{W=await R()}catch{pe=!0}v(()=>{try{let Q=!1;for(let J=0;J<k.length;J++){let Y=F[J].row,_e=k[J],Kt=s(Y);pe?u(Y,_e):(_e.value=W,_e.settled=!0),d(Y),Y.visible&&!Object.is(Kt,s(Y))&&(Q=!0)}return Q}finally{I(O)}})}return{items:p,pending:b,add:K,remove:oe,update:Ut}}function Mc(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=Ze(()=>n()[o()]),a=Ze(()=>o()>0),l=Ze(()=>o()<n().length-1);function u(f){let h=s(),y=typeof f=="function"?f(h):f;if(Object.is(y,h))return;let v=n(),S=o(),x=v.slice(0,S+1);x.push(y),U(()=>{x.length>t?(x.shift(),r(x),i(x.length-1)):(r(x),i(S+1))})}function d(){a()&&i(o()-1)}function p(){l()&&i(o()+1)}function g(){U(()=>{r([e]),i(0)})}function b(f){let h=n();f>=0&&f<h.length&&i(f)}function c(){s.dispose(),a.dispose(),l.dispose()}return{value:s,set:u,undo:d,redo:p,canUndo:a,canRedo:l,history:n,index:o,reset:g,jumpTo:b,dispose:c}}var ci=Promise.prototype.then;function ui(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(ci,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function di(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")},p=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(h){d(h);return}if(typeof f!="function"){u(c);return}g(c,f)},g=(c,f)=>{f===ci?(s=c,l("native")):l("invoking"),queueMicrotask(()=>{let h=!1,y=S=>{h||(h=!0,p(S))},v=S=>{h||(h=!0,d(S))};try{Reflect.apply(f,c,[y,v])}catch(S){v(S)}!h&&i==="invoking"&&l("pending")})};return g(e,t),{promise:o,failedEarly:!1,probe:(c,f)=>{let h=()=>{i==="native"?ui(s,c,f):(i==="rejected"?c:f)()};i==="native"?ui(s,c,f):i==="invoking"?a.push(h):queueMicrotask(i==="rejected"?c:f)}}}function Oc(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 Pc(e){let t=Oc(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(h){M(h,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],l=!1;function u(c,f=!0){if(a.push(c),l)return;l=!0;let h,y=!1;try{let v=!0,S=0;for(;S<a.length;){let x=a[S];a[S++]=void 0;try{x()}catch(E){v&&f?(y=!0,h=E):M(E,{phase:"event",name:"globalStore(dispatch)"})}v=!1}}finally{a.length=0,l=!1}if(y)throw h}function d(c,f){let h=e.actions[c];if(!h)throw new Error(`Unknown action: ${String(c)}`);let y=()=>{let v=n(),S=h(v,f),x=Wt(S);r({...v,...x}),s(n())};u(()=>{if(i.length===0){y();return}let v=S=>{if(S>=i.length){y();return}let x=!1,E=!1,D=!0,I=()=>{if(E&&!x){H(`globalStore: middleware ${S} next() called after it failed for "${String(c)}"; ignored.`),x=!0;return}if(x){H(`globalStore: middleware ${S} next() called more than once for "${String(c)}"; ignored.`);return}if(x=!0,D){v(S+1);return}let oe=()=>u(()=>v(S+1),!1);if(!K){oe();return}K.probe(()=>{E=!0,H(`globalStore: middleware ${S} next() called after it failed for "${String(c)}"; ignored.`)},oe)},K=null;try{K=di(i[S](n(),String(c),f,I))}catch(oe){throw E=!0,oe}finally{D=!1}K&&(K.failedEarly&&(E=!0),K.promise.then(void 0,oe=>{E=!0,M(oe,{phase:"async",name:"globalStore(middleware)"})}))};v(0)})}function p(c){return()=>c(n())}function g(c){let f=o.get(c);f||(f={callback:c,active:!0},o.set(c,f));let h=f;return()=>{o.get(c)===h&&(h.active=!1,o.delete(c))}}function b(){u(()=>{r({...t}),s(n())})}return{getState:n,select:p,dispatch:d,subscribe:g,reset:b}}function Dc(e,t){return n=>t(e,n)}function Hc(e,t){return n=>e({...t,...n})}function $c(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function Ic(e){return e.render(e.data())}function Bc(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 jc(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 Vc(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function Fc(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function zc(e,t){return n=>e(t(n))}var Wc={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 fi(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&&H(`Prop validation errors:
|
|
401
401
|
${r.map(o=>` - ${o}`).join(`
|
|
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
|
|
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 qc(e){return t=>{let n=fi(t,e.props);return e.setup(n)}}function Uc(e,t,n){{let r=t(e,n||"value");if(r!==!0)throw new TypeError(`[SibuJS Contract] ${r}`)}}function Kc(e){return t=>e(t,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={...qt,...Jn,patterns:qt});})();
|