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
package/dist/cdn.full.global.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(()=>{var qo=Object.defineProperty;var It=(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 $n=(e,t)=>{for(var n in t)qo(e,n,{get:t[n],enumerable:!0})};var Mn={};$n(Mn,{DynamicComponent:()=>gl,ErrorBoundary:()=>el,ErrorDisplay:()=>En,Fragment:()=>yl,KeepAlive:()=>xl,Loading:()=>rl,MAX_DRAIN_TEARDOWNS:()=>be,Portal:()=>El,SVG_NS:()=>H,Suspense:()=>Ir,__renderParsedTemplate:()=>ko,__resetIdCounter:()=>go,a:()=>Os,abbr:()=>Ps,action:()=>ol,address:()=>hs,area:()=>ia,array:()=>_l,article:()=>ds,aside:()=>bs,asyncDerived:()=>Al,audio:()=>sa,autoResize:()=>fo,b:()=>Ds,base:()=>eu,batch:()=>W,bdi:()=>$s,bdo:()=>Hs,bindDynamic:()=>Rr,blockquote:()=>Ts,body:()=>us,br:()=>Is,button:()=>ut,canvas:()=>Sa,caption:()=>ka,catchError:()=>il,catchErrorAsync:()=>sl,center:()=>Tu,checkLeaks:()=>Wn,circle:()=>ru,cite:()=>Bs,clickOutside:()=>uo,clipPath:()=>mu,code:()=>pn,col:()=>_a,colgroup:()=>Ca,context:()=>ul,copyOnClick:()=>co,createId:()=>mo,customElement:()=>_u,data:()=>Vs,datalist:()=>Da,dd:()=>Es,deepEqual:()=>et,deepSignal:()=>Nl,defer:()=>Gl,defs:()=>pu,del:()=>Ta,derived:()=>ze,details:()=>Ga,dfn:()=>js,dialog:()=>Ja,disableSSR:()=>qr,dispose:()=>V,div:()=>P,dl:()=>ks,dt:()=>_s,each:()=>hl,effect:()=>Q,ellipse:()=>ou,em:()=>Fs,embed:()=>da,enableSSR:()=>Wr,enhance:()=>Ot,enhanceAll:()=>Bl,enqueueBatchedSignal:()=>je,external:()=>qu,fieldset:()=>$a,figcaption:()=>Cs,figure:()=>As,font:()=>Eu,footer:()=>ps,form:()=>Ha,g:()=>iu,getAction:()=>ao,getRequestScopedCache:()=>zr,getRuntimeErrorHandler:()=>Bn,getSSRStore:()=>Ve,getSlot:()=>kl,h1:()=>ys,h2:()=>vs,h3:()=>dn,h4:()=>Ss,h5:()=>xs,h6:()=>ws,head:()=>as,header:()=>fs,hr:()=>Ns,html:()=>Eo,i:()=>zs,iframe:()=>fa,img:()=>aa,input:()=>Ia,ins:()=>Ea,isBatching:()=>Wu,isSSR:()=>de,kbd:()=>Ws,label:()=>Ba,lazy:()=>Hr,lazyIsland:()=>jl,legend:()=>Va,li:()=>Rs,line:()=>su,linearGradient:()=>hu,link:()=>tu,longPress:()=>lo,main:()=>gs,map:()=>ua,mark:()=>qs,marker:()=>wu,marquee:()=>ku,mask:()=>gu,match:()=>dl,math:()=>va,menu:()=>Ya,meta:()=>nu,meter:()=>ja,mount:()=>wl,mountIslands:()=>ql,nav:()=>ms,nextTick:()=>Xl,noscript:()=>xa,object:()=>pa,ol:()=>Ls,on:()=>Hu,onCleanup:()=>Pu,onMount:()=>At,onUnmount:()=>Ou,optgroup:()=>Fa,option:()=>za,output:()=>Wa,p:()=>cn,param:()=>ma,path:()=>au,pattern:()=>bu,picture:()=>ga,polygon:()=>uu,polyline:()=>lu,portal:()=>ba,pre:()=>fn,progress:()=>qa,q:()=>Us,radialGradient:()=>yu,reactiveArray:()=>Cl,rect:()=>cu,ref:()=>Rl,registerAction:()=>Qe,registerComponent:()=>fl,registerDisposer:()=>_,registerIsland:()=>Fl,replaceChildrenSafely:()=>ee,reportDrainRunaway:()=>we,reportError:()=>L,resolveComponent:()=>ml,retrack:()=>_e,rp:()=>Ks,rt:()=>Gs,ruby:()=>Js,runInSSRContext:()=>Ur,s:()=>Ys,samp:()=>Xs,script:()=>wa,section:()=>cs,select:()=>Ua,setGlobalErrorHandler:()=>al,setMaxDrainIterations:()=>Cr,setRuntimeErrorHandler:()=>In,show:()=>ll,signal:()=>C,slot:()=>Za,small:()=>Zs,source:()=>ha,span:()=>z,stop:()=>vu,store:()=>Ll,strict:()=>Pl,strictEffect:()=>Dl,strong:()=>Qs,style:()=>He,sub:()=>ea,summary:()=>Xa,sup:()=>ta,svg:()=>ya,symbol:()=>xu,table:()=>Aa,tagFactory:()=>p,takePendingError:()=>kt,tbody:()=>Na,td:()=>Ra,template:()=>Qa,text:()=>du,textarea:()=>Ka,tfoot:()=>La,th:()=>Ma,thead:()=>Oa,time:()=>na,title:()=>ls,tr:()=>Pa,track:()=>la,transition:()=>Yl,trapFocus:()=>po,trustHTML:()=>Do,tspan:()=>fu,u:()=>ra,ul:()=>Ms,unregisterComponent:()=>pl,unregisterDisposer:()=>ot,unregisterIsland:()=>zl,untracked:()=>ce,use:()=>Su,var_:()=>oa,video:()=>ca,watch:()=>Ml,when:()=>cl,withSSR:()=>Kr,writable:()=>Ol});var Hn=Symbol.for("sibujs.runtime-errors.v1");function Bt(){let e=globalThis,t=e[Hn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Hn]=n,n}function In(e){let t=Bt(),n=t.handler;return t.handler=e,n}function Bn(){return Bt().handler}function Vt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Uo(e)}`;return new Error(t,{cause:e})}function Uo(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 Ko(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Go=Symbol.for("sibujs.reactive.v1");function Jo(e){let t=globalThis[Go];return t?.untracked?t.untracked(e):e()}var Yo="sibu:error-propagate";function Xo(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Zo(n);if(!r)return!1;try{let o=new CustomEvent(Yo,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Zo(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 Qo(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Ko(t)}: ${e.message}`,e)}function L(e,t){let n=Vt(e);Jo(()=>{if(Xo(n,t))return;let r=Bt(),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--}}Qo(n,t)})}function pe(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var me=new WeakMap,be=1e4;function we(e,t,n){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${t} teardowns with ${n} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:t,remaining:n})}var Ne=0;function pt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var re=[];function Vn(){return pt(re[re.length-1])}function jn(e){return e===null&&re.length===0?!1:(re.push(pt(e)),!0)}function Fn(){re.pop()}function _(e,t){let n=me.get(e);n||(n=[],me.set(e,n)),n.push(t),!1;let r=pt(re[re.length-1]);r&&r.entries.push([e,t])}function zn(e){let t={entries:[],closed:!1},n=t.entries;re.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=be){we("rollback",s,n.length);break}let[a,u]=n.pop();if(ot(a,u)){s++;try{u()}catch(l){L(l,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,re.pop()}throw i}t.closed=!0,re.pop();let o=pt(re[re.length-1]);if(o){for(let i of n)me.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function ot(e,t){let n=me.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),!1,n.length===0&&me.delete(e),!0)}function V(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--)ei(n[r])}function ei(e){if(!me.has(e))return;let t=0,n=!1;for(;!n;){let r=me.get(e);if(!r||r.length===0)break;let o=r.slice();me.delete(e),!1;for(let i=0;i<o.length;i++){if(t>=be){let s=o.slice(i),a=me.get(e);me.set(e,a?s.concat(a):s),!1,we("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){L(s,{phase:"cleanup",name:"disposer"})}}}}function ee(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++)V(n[r]);e.replaceChildren(...t)}function Wn(e=0){return 0}function We(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var ti=/[A-Z]/,ni=/[A-Z]/g;function oe(e){return ti.test(e)?e.replace(ni,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function Te(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 ri=["http:","https:","mailto:","tel:","ftp:"],oi=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function gt(e){let t=We(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)&&ri.indexOf(i)===-1?"":n}var ii=/^\d+(\.\d+)?[wx]$/;function jt(e){return e===" "||e===" "||e===`
|
|
2
|
-
`||e==="\r"||e==="\f"}function
|
|
3
|
-
`||e==="\r"||e==="\f"}function
|
|
1
|
+
"use strict";(()=>{var mi=Object.defineProperty;var Ut=(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 Gn=(e,t)=>{for(var n in t)mi(e,n,{get:t[n],enumerable:!0})};var qn={};Gn(qn,{ClientOnly:()=>Io,DynamicComponent:()=>Vu,ErrorBoundary:()=>Au,ErrorDisplay:()=>Hn,Fragment:()=>qu,KeepAlive:()=>Ju,Loading:()=>Ru,MAX_DRAIN_TEARDOWNS:()=>Se,Portal:()=>Zu,SVG_NS:()=>H,Suspense:()=>mo,__renderParsedTemplate:()=>Jo,__resetIdCounter:()=>jo,a:()=>ia,abbr:()=>sa,action:()=>Lu,address:()=>zs,area:()=>La,array:()=>Qu,article:()=>$s,aside:()=>Fs,asyncDerived:()=>tc,audio:()=>Ma,autoResize:()=>Po,b:()=>aa,base:()=>Cl,batch:()=>W,bdi:()=>la,bdo:()=>ua,bindDynamic:()=>Gr,blockquote:()=>Gs,body:()=>Ps,br:()=>ca,button:()=>pt,canvas:()=>Ua,caption:()=>Za,catchError:()=>Mu,catchErrorAsync:()=>Ou,center:()=>Gl,checkLeaks:()=>ur,circle:()=>Nl,cite:()=>da,clickOutside:()=>Lo,clipPath:()=>jl,code:()=>Tn,col:()=>Xa,colgroup:()=>Qa,context:()=>$u,copyOnClick:()=>Oo,createId:()=>Bo,customElement:()=>Xl,data:()=>fa,datalist:()=>al,dd:()=>Ys,deepEqual:()=>it,deepSignal:()=>nc,defer:()=>xc,defs:()=>Bl,del:()=>Ga,derived:()=>Je,details:()=>vl,dfn:()=>pa,dialog:()=>xl,disableSSR:()=>ao,dispose:()=>I,div:()=>P,dl:()=>Zs,dt:()=>Xs,each:()=>zu,effect:()=>te,ellipse:()=>Rl,em:()=>ma,embed:()=>$a,enableSSR:()=>so,enhance:()=>Bt,enhanceAll:()=>fc,enqueueBatchedSignal:()=>Ue,external:()=>yu,fieldset:()=>ll,figcaption:()=>Qs,figure:()=>ea,font:()=>Yl,footer:()=>Bs,form:()=>ul,g:()=>Ll,getAction:()=>Ro,getRequestScopedCache:()=>oo,getRuntimeErrorHandler:()=>Xn,getSSRStore:()=>Oe,getSlot:()=>Xu,h1:()=>Ws,h2:()=>qs,h3:()=>xn,h4:()=>Us,h5:()=>Ks,h6:()=>Js,head:()=>Os,header:()=>Is,hr:()=>ta,html:()=>Ko,i:()=>ga,iframe:()=>Ia,img:()=>Oa,input:()=>cl,ins:()=>Ya,isBatching:()=>hu,isClient:()=>io,isSSR:()=>ee,isServer:()=>mt,kbd:()=>ba,label:()=>dl,lazy:()=>po,lazyIsland:()=>mc,legend:()=>fl,li:()=>na,line:()=>Ml,linearGradient:()=>zl,link:()=>Al,longPress:()=>Mo,main:()=>Vs,map:()=>Pa,mark:()=>ha,marker:()=>Jl,marquee:()=>Zl,mask:()=>Vl,match:()=>Hu,math:()=>qa,menu:()=>wl,meta:()=>_l,meter:()=>pl,mount:()=>Gu,mountIslands:()=>yc,nav:()=>js,nextTick:()=>Ec,noscript:()=>Ka,object:()=>Ba,ol:()=>ra,on:()=>cu,onCleanup:()=>uu,onMount:()=>Pt,onUnmount:()=>lu,optgroup:()=>ml,option:()=>gl,output:()=>bl,p:()=>vn,param:()=>ja,path:()=>Ol,pattern:()=>Fl,picture:()=>Va,polygon:()=>Pl,polyline:()=>Dl,portal:()=>Fa,pre:()=>wn,progress:()=>hl,q:()=>ya,radialGradient:()=>Wl,reactiveArray:()=>ec,rect:()=>Hl,ref:()=>rc,registerAction:()=>ot,registerComponent:()=>Iu,registerDisposer:()=>C,registerIsland:()=>gc,replaceChildrenSafely:()=>ie,reportDrainRunaway:()=>Ae,reportError:()=>L,resolveComponent:()=>ju,retrack:()=>Le,rp:()=>Sa,rt:()=>va,ruby:()=>xa,runInSSRContext:()=>lo,s:()=>wa,samp:()=>Ta,script:()=>Ja,section:()=>Hs,select:()=>yl,setGlobalErrorHandler:()=>Pu,setMaxDrainIterations:()=>Ur,setRuntimeErrorHandler:()=>Zn,show:()=>Du,signal:()=>A,slot:()=>El,small:()=>Ea,source:()=>za,span:()=>z,stop:()=>ql,store:()=>oc,strict:()=>ac,strictEffect:()=>lc,strong:()=>ka,style:()=>Fe,sub:()=>Ca,summary:()=>Tl,sup:()=>Aa,svg:()=>Wa,symbol:()=>Kl,table:()=>el,tagFactory:()=>m,takePendingError:()=>Lt,tbody:()=>tl,td:()=>nl,template:()=>kl,text:()=>$l,textarea:()=>Sl,tfoot:()=>rl,th:()=>ol,thead:()=>il,time:()=>_a,title:()=>Ds,tr:()=>sl,track:()=>Da,transition:()=>Tc,trapFocus:()=>Do,trustHTML:()=>oi,tspan:()=>Il,u:()=>Na,ul:()=>oa,unregisterComponent:()=>Bu,unregisterDisposer:()=>ut,unregisterIsland:()=>bc,untracked:()=>pe,use:()=>Ul,var_:()=>Ra,video:()=>Ha,watch:()=>ic,when:()=>In,withSSR:()=>co,writable:()=>sc});var Yn=Symbol.for("sibujs.runtime-errors.v1");function Kt(){let e=globalThis,t=e[Yn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Yn]=n,n}function Zn(e){let t=Kt(),n=t.handler;return t.handler=e,n}function Xn(){return Kt().handler}function Jt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${gi(e)}`;return new Error(t,{cause:e})}function gi(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 bi(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var hi=Symbol.for("sibujs.reactive.v1");function yi(e){let t=globalThis[hi];return t?.untracked?t.untracked(e):e()}var Si="sibu:error-propagate";function vi(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=xi(n);if(!r)return!1;try{let o=new CustomEvent(Si,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function xi(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 wi(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${bi(t)}: ${e.message}`,e)}function Ti(){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 L(e,t){let n=Jt(e);yi(()=>{if(vi(n,t))return;let r=Ti();if(r){r.push({error:n,context:t});return}let o=Kt(),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--}}wi(n,t)})}function me(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var Ce=null;function Qn(){return Ce?.s.on===!0}function er(){return Ce?.s.on?Ce.s:null}function lt(e,t){let n=Ce;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 ge(){let e=Ce;return e?.s.on?{p:`${e.p}${(e.n++).toString(36)}.`,n:0,s:e.s}:null}function tr(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 X(e,t){let n=Ce;if(!e&&!n)return t();Ce=e?.s.on?{p:e.p,n:0,s:e.s}:null;try{return t()}finally{Ce=n}}var nr,Gt=globalThis[nr=Symbol.for("sibujs.hydration.v2")]??(globalThis[nr]={a:new Set,c:null});function ye(){return Gt.a.size>0}function Ei(){return er()?.h??Gt.c}function Yt(){let e=Ei();return e?e.open?[e]:[]:Array.from(Gt.a)}function rr(e){let t=Yt(),n=t.length,r=()=>{--n<1&&e()};if(n)for(let o of t)o.done.push(r);else e()}function ki(e){for(let t of Array.from(e.wake))t()}function or(e,t){for(let n of e)n.pending.add(t);return()=>{for(let n of e)n.pending.delete(t)&&ki(n)}}var be=new WeakMap,Se=1e4;function Ae(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 Pe=0;function yt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var oe=[];function ir(){return yt(oe[oe.length-1])}function sr(e){return e===null&&oe.length===0?!1:(oe.push(yt(e)),!0)}function ar(){oe.pop()}function C(e,t){let n=be.get(e);n||(n=[],be.set(e,n)),n.push(t),!1;let r=yt(oe[oe.length-1]);r&&r.entries.push([e,t])}function lr(e){let t={entries:[],closed:!1},n=t.entries;oe.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=Se){Ae("rollback",s,n.length);break}let[a,l]=n.pop();if(ut(a,l)){s++;try{l()}catch(u){L(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,oe.pop()}throw i}t.closed=!0,oe.pop();let o=yt(oe[oe.length-1]);if(o){for(let i of n)be.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function ut(e,t){let n=be.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),!1,n.length===0&&be.delete(e),!0)}function I(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--)Ci(n[r])}function Ci(e){if(!be.has(e))return;let t=0,n=!1;for(;!n;){let r=be.get(e);if(!r||r.length===0)break;let o=r.slice();be.delete(e),!1;for(let i=0;i<o.length;i++){if(t>=Se){let s=o.slice(i),a=be.get(e);be.set(e,a?s.concat(a):s),!1,Ae("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){L(s,{phase:"cleanup",name:"disposer"})}}}}function ie(e,...t){if(ye()&&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;I(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++)I(n[r]);e.replaceChildren(...t)}function ur(e=0){return 0}function Ge(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Ai=/[A-Z]/,_i=/[A-Z]/g;function se(e){return Ai.test(e)?e.replace(_i,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 Ni=["http:","https:","mailto:","tel:","ftp:"],Ri=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function vt(e){let t=Ge(e).trim();if(!t)return"";let n=e.replace(Ri,"");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)&&Ni.indexOf(i)===-1?"":n}var Li=/^\d+(\.\d+)?[wx]$/;function Zt(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function Mi(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(Zt(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!Zt(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(Zt(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&&!Li.test(a[0]))continue;let l=vt(s);l&&(l.startsWith(",")||l.endsWith(",")||n.push(a.length===1?`${l} ${a[0]}`:l))}return n.join(", ")}var Oi=/[(:@\\]/;function Pi(e){return e===" "||e===" "||e===`
|
|
3
|
+
`||e==="\r"||e==="\f"}function cr(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Di(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 yt(e){let t=0,n=e.length;for(;t<n&&Re(e[t]);)t++;for(;n>t&&Re(e[n-1]);)n--;return e.slice(t,n)}var ie=e=>({kind:"forbidden",reason:e});function vi(e){let t=yt(We(e));if(t==="")return ie("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return ie("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return ie("");for(;n<t.length&&Re(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return ie("");for(n++;n<t.length&&Re(t[n]);)n++;let o=n;for(;n<t.length&&!Re(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return ie("");for(;n<t.length&&Re(t[n]);)n++;if(t[n]!=="=")return ie("");for(n++;n<t.length&&Re(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let l=t.indexOf(a,n+1);if(l===-1)return ie("");if(s=t.slice(n+1,l),yt(t.slice(l+1))!=="")return ie("")}else if(s=yt(t.slice(n)),/[;,]/.test(s))return ie("");if(s==="")return ie("");let u=gt(s);return u===""?ie(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:u}}function Ut(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=oe(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?ie(""):typeof t!="string"?{kind:"not-refresh"}:yt(We(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:vi(n)}var Si="http://www.w3.org/1999/xhtml",xi="http://www.w3.org/2000/svg",wi=new Set(["script","iframe","object","embed","frame","frameset"]);function Qn(e){return oe(e)}function er(e){return wi.has(Qn(e))}var Ti=new Set(["script","style"]);function tr(e){return Ti.has(Qn(e))}var I={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Ei=new Set(["src","href","xlink:href","type","language"]),ki=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Kt=new WeakSet;function nr(e){return e.namespaceURI===Si||e.namespaceURI===null}function rr(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 _i(e){Kt.has(e)||(Kt.add(e),e.getAttribute("content")!==null&&Ut(rr(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function Ci(e,t,n,r){if(!nr(e))return I.None;let o=oe(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&_i(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return I.None;let i=Ut(rr(e,o,n));return i.kind==="forbidden"?I.MetaRefreshForbidden:i.kind!=="not-refresh"&&Kt.has(e)?I.MetaRefreshReactive:I.None}function Ai(e,t){if(t===null||oe(e)!=="attributename")return I.None;let n=We(t);return Yn(n)||Te(n)||it(n)?I.AnimationTarget:I.None}var vt=new WeakSet;function Zn(e){if(e===null)return!1;let t=oe(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function Ni(e,t,n,r){if(!nr(e))return I.None;let o=oe(t);return o==="href"?r==="static"||n===null?I.None:Zn(e.getAttribute("rel"))?I.StylesheetSource:(vt.add(e),I.None):o==="rel"&&Zn(n)&&vt.has(e)&&e.hasAttribute("href")?I.StylesheetSource:I.None}function Gt(e,t,n,r){let o=e.localName;return o==="meta"?Ci(e,t,n,r):o==="link"?Ni(e,t,n,r):o==="script"?r==="static"||n===null?I.None:Ei.has(oe(t))?I.ScriptSource:I.None:ki.has(o)&&e.namespaceURI===xi?Ai(t,n):I.None}function Jt(e,t,n){e.localName!=="link"||oe(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?vt.add(e):vt.delete(e))}var Ri="http://www.w3.org/1999/xhtml",Li="http://www.w3.org/2000/svg",Mi="http://www.w3.org/1999/xlink",Oi="http://www.w3.org/XML/1998/namespace",Pi=new Set(["checked","disabled","selected"]);function Di(e){return e.namespaceURI===null||e.namespaceURI===Ri}function ir(e,t,n){}function or(e,t,n){e[t]=n}function $i(e,t){if(e.namespaceURI!==Li)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Mi:n.startsWith("xml:")?Oi:null}function ue(e,t,n,r={}){let o=Hi(e,t,n,r);return e.localName==="link"&&Jt(e,t,r.reactive?"reactive":"runtime"),o}function Hi(e,t,n,r){let o=$i(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(Te(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Gt(e,t,s,r.reactive?"reactive":"runtime");if(a!==I.None)return ir(r.label??"setSafeAttribute",t,a),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;if(n==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0;if(it(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let u=Di(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&&Pi.has(l)&&l in e?or(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 or(e,l,l==="checked"?!!n:c),!0;let m=c===""?"":Xn(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 Yt(e,t,n){if(it(t))return!1,!1;let r=Gt(e,t,n,"static");return r!==I.None?(ir("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Jt(e,t,"static"),!0)}var Ii=4096,Xt=[];function Bi(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Vi(e,t,n){let r=Xt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Bi();return o.sig=e,o.sub=t,o.epoch=n,o}function sr(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Xt.length<Ii&&Xt.push(e)}function ji(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 ar(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 Fi(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function zi(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 le=null,he=null,Ee=0,ke=[],J=new Set,Wi=[];function qi(e){try{e()}catch(t){let n=e;L(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Ui(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 ge=0,ye=!1;function Qt(){ge===0&&(he=le,le=null,ye=!0),ge++}function en(){ge--,ge===0&&(le=he,he=null,ye=!1)}function ur(){return ye}function lr(e){Qt();try{return e()}finally{en()}}var se=null;function tn(){return se}function Tt(e,t){let n=se;se=e;try{return t()}finally{se=n}}function nn(e){let t=se;return t===null?e:(...n)=>Tt(t,()=>e(...n))}var qe=null,Ki=0;function rn(e,t){let n=le,r=0,o=null;ye&&(r=ge,o=he,ge=0,he=null,ye=!1),le=t;let i=t;i._cap===void 0&&(i._cap=Vn());let s=se;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(se=a);let u=qe;u!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=u),i._tok!=null&&(qe=i._tok);let l=++Ki;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{le=n,se=s,qe=u,r!==0&&(ge=r,he=o,ye=!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&&(zi(c),ar(c),sr(c)),c=m}}}function cr(e,t){if(!t)return on(e);Ue(t);let n=le,r=0,o=null;ye&&(r=ge,o=he,ge=0,he=null,ye=!1),le=t;let i=t;i._scope===void 0&&(i._scope=se);let s=se;se=i._scope;try{e()}finally{le=n,se=s,r!==0&&(ge=r,he=o,ye=!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=()=>Ue(t))}function on(e,t,n){return fr(e,t,n===!0)._dispose}function dr(e,t){let n=fr(e,t,!0);return{stop:n._dispose,run:r=>{let o=qe;qe=n._tok??null;try{return r()}finally{qe=o}}}}function fr(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{rn(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),Ue(o),i}return o._dispose=()=>{o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Ue(o)},o}function pr(e){if(!le)return;let t=le,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=Vi(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,Fi(t,i),ji(n,i),t._structDirty=!0}function Ue(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;ar(n),sr(n),n=r}}var St=1e3,xt=1e6,wt=0,Le=new Set;function mr(e){let t=St;return Number.isFinite(e)&&e>0&&(St=Math.floor(e)),t}function gr(e){let t=xt;return Number.isFinite(e)&&e>0&&(xt=Math.floor(e)),t}function Gi(e){let t=e;return t._runEpoch!==wt?(t._runEpoch=wt,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>St)}function Ji(e){let t=e.__name??"<unnamed>";L(new Error(`subscriber "${t}" fired more than ${St} 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 Yi(){L(new Error(`Notification drain exceeded ${xt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function br(){let e=0;for(;e<ke.length;){if(e>=xt){Yi();break}let t=ke[e++];J.delete(t)&&(t._owner!=null&&J.size>0&&(Xi(t),J.has(t))||hr(t))}}function Xi(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;J.has(r)&&(t=r),n=r._owner??null}if(t===null)return;J.delete(t),hr(t)}}function hr(e){if(Le.size>0&&Le.has(e)||e._hasComputedDep===!0&&!Ui(e))return;if(Gi(e)){Ji(e),Le.add(e);return}let t=jn(e._cap??null);try{qi(e)}finally{t&&Fn()}}function yr(){if(!(Ee>0)){Ee++,wt++;try{br()}finally{Ee--,Ee===0&&(ke.length=0,J.clear(),Le.size>0&&Le.clear())}}}function Zt(e){e();let t=e._sig;if(!t)return;let n=Wi,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 J.has(s)||(J.add(s),ke.push(s));i=i.sigNext}}}function vr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Zt(r):J.has(r)||(J.add(r),ke.push(r))),n=n.sigNext}}function Sr(e){let n=e.subsHead;if(n){if(Ee>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Zt(o):J.has(o)||(J.add(o),ke.push(o))),r=r.sigNext}return}Ee++,wt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Zt(o):J.has(o)||(J.add(o),ke.push(o))),r=r.sigNext}br()}finally{Ee--,Ee===0&&(ke.length=0,J.clear(),Le.size>0&&Le.clear())}}}function xr(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 Tr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var Er="4.13.1",kr=Symbol.for("sibujs.reactive.v1");function Qi(){let e=globalThis,t=e[kr];if(t)return!1,t;let n={suspendTracking:Qt,resumeTracking:en,isTrackingSuspended:ur,untracked:lr,retrack:rn,track:cr,reactiveBinding:on,recordDependency:pr,cleanup:Ue,setMaxSubscriberRepeats:mr,setMaxDrainIterations:gr,drainNotificationQueue:yr,queueSignalNotification:vr,notifySubscribers:Sr,getSubscriberCount:xr,getSubscriberDeps:wr,forEachSubscriber:Tr,getOwnerScope:tn,runWithOwnerScope:Tt,bindOwnerScope:nn,structuralBinding:dr,version:Er};return e[kr]=n,n}var j=Qi(),Me=j.suspendTracking,Oe=j.resumeTracking,_r=j.isTrackingSuspended,ce=j.untracked,_e=j.retrack,Ke=j.track,K=j.reactiveBinding,Pe=j.recordDependency,De=j.cleanup,Pc=j.setMaxSubscriberRepeats,Cr=j.setMaxDrainIterations,Ar=j.drainNotificationQueue,Nr=j.queueSignalNotification,Ge=j.notifySubscribers,Dc=j.getSubscriberCount,$c=j.getSubscriberDeps,Hc=j.forEachSubscriber,Je=j.getOwnerScope??tn,Et=j.runWithOwnerScope??Tt,X=j.bindOwnerScope??nn,$e=j.structuralBinding??((e,t)=>({stop:j.reactiveBinding(e,t),run:n=>n()}));function st(e,t,n){if(Te(t))return ue(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){L(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}ue(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return K(r,e)}function Rr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(u){L(u,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(u){L(u,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),ue(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=K(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var sn=["data-focus-key","id","name"],es=new Set(["text","search","url","tel","password",""]);function ts(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&es.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 at(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,...ts(t)}}function ns(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function rs(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 Lr(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 Ye(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){Lr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=rs(t,`[${e.attr}=${ns(e.value)}]`);if(s&&s.tagName===e.tag){Lr(s,e);return}i=a>1}if(r!==void 0&&typeof r=="object"){let s=typeof r.restoreTo=="function"?r.restoreTo():r.restoreTo;if(s?.isConnected&&(s.focus(),document.activeElement===s))return}}function ve(e,t){let n=[];function r(){let o;try{o=t()}catch(c){L(c,{phase:"binding",name:"bindChildNode",node:e});return}let i=at(n);if(o==null||typeof o=="boolean"){for(let c=0;c<n.length;c++){let m=n[c];V(m),m.parentNode&&m.parentNode.removeChild(m)}n.length=0,Ye(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)){!1;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)||(V(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,Ye(i,a,"bindChildNode")}return K(r,e,!0)}function an(){throw new Error("[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first.")}function te(){typeof document>"u"&&an()}var H="http://www.w3.org/2000/svg",os=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var un=new Set,Mr=100,Or=!1,Pr=new Map;function Dr(e){let t=Pr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Pr.set(e,t)),t}function is(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=K(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",ht(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=Dr(c);l.push(h),u.setProperty(h,bt(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",ht(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Dr(r);if(typeof o=="function"){let s=o,a=K(()=>{n.style.setProperty(i,bt(i,String(s()),{element:e}))},e);_(e,a)}else n.style.setProperty(i,bt(i,String(o),{element:e}))}}function ss(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=K(()=>{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=K(()=>{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 ln(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,ve(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,ve(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,ve(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=er(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&an();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),ln(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return ln(i,r),i;let s=r,a=s.class;a!=null&&ss(i,a);let u=s.id;typeof u=="function"?_(i,st(i,"id",u)):u!=null&&(!1,i.id=u);let l=o!==void 0?o:s.nodes;l!=null&&ln(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):!1}let m=s.style;m!=null&&is(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||Te(g))continue;typeof d=="function"?_(i,st(i,g,d)):ue(i,g,d,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var ad=p("html"),as=p("head"),us=p("body"),ls=p("title"),P=p("div"),z=p("span"),cs=p("section"),ds=p("article"),fs=p("header"),ps=p("footer"),ms=p("nav"),gs=p("main"),bs=p("aside"),hs=p("address"),cn=p("p"),ys=p("h1"),vs=p("h2"),dn=p("h3"),Ss=p("h4"),xs=p("h5"),ws=p("h6"),Ts=p("blockquote"),Es=p("dd"),ks=p("dl"),_s=p("dt"),Cs=p("figcaption"),As=p("figure"),Ns=p("hr"),Rs=p("li"),Ls=p("ol"),Ms=p("ul"),fn=p("pre"),Os=p("a"),Ps=p("abbr"),Ds=p("b"),$s=p("bdi"),Hs=p("bdo"),Is=p("br"),Bs=p("cite"),pn=p("code"),Vs=p("data"),js=p("dfn"),Fs=p("em"),zs=p("i"),Ws=p("kbd"),qs=p("mark"),Us=p("q"),Ks=p("rp"),Gs=p("rt"),Js=p("ruby"),Ys=p("s"),Xs=p("samp"),Zs=p("small"),Qs=p("strong"),ea=p("sub"),ta=p("sup"),na=p("time"),ra=p("u"),oa=p("var"),ia=p("area"),sa=p("audio"),aa=p("img"),ua=p("map"),la=p("track"),ca=p("video"),da=p("embed"),fa=p("iframe"),pa=p("object"),ma=p("param"),ga=p("picture"),ba=p("portal"),ha=p("source"),ya=p("svg",H),va=p("math"),Sa=p("canvas"),xa=p("noscript"),wa=p("script"),Ta=p("del"),Ea=p("ins"),ka=p("caption"),_a=p("col"),Ca=p("colgroup"),Aa=p("table"),Na=p("tbody"),Ra=p("td"),La=p("tfoot"),Ma=p("th"),Oa=p("thead"),Pa=p("tr"),ut=p("button"),Da=p("datalist"),$a=p("fieldset"),Ha=p("form"),Ia=p("input"),Ba=p("label"),Va=p("legend"),ja=p("meter"),Fa=p("optgroup"),za=p("option"),Wa=p("output"),qa=p("progress"),Ua=p("select"),Ka=p("textarea"),Ga=p("details"),Ja=p("dialog"),Ya=p("menu"),Xa=p("summary"),Za=p("slot"),Qa=p("template"),eu=p("base"),tu=p("link"),nu=p("meta"),He=p("style"),ru=p("circle",H),ou=p("ellipse",H),iu=p("g",H),su=p("line",H),au=p("path",H),uu=p("polygon",H),lu=p("polyline",H),cu=p("rect",H),du=p("text",H),fu=p("tspan",H),pu=p("defs",H),mu=p("clipPath",H),gu=p("mask",H),bu=p("pattern",H),hu=p("linearGradient",H),yu=p("radialGradient",H),vu=p("stop",H),Su=p("use",H),xu=p("symbol",H),wu=p("marker",H),Tu=p("center"),Eu=p("font"),ku=p("marquee"),_u=e=>p(e);var mn="__sibuPendingError";function $r(e,t){let n=()=>e.parentNode?(L(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[mn]=t)})}function kt(e){let t=e,n=t[mn];if(n instanceof Error)return delete t[mn],n}function Hr(e){let t=null;return function(){if(t)return t();let r=P({class:"sibu-lazy"}),o=!1;return e().then(X(i=>{if(o)return;t=i.default;let s=t();ee(r,s)})).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));ee(r,P({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),$r(r,s)}),r.appendChild(z("sibu-lazy-loading","Loading...")),_(r,()=>{o=!0}),r}}function Ir({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)&&V(s)});let a=X(()=>{if(!o)try{let u=e();if(s=u,u.classList.contains("sibu-lazy")){if(!u.querySelector(".sibu-lazy-loading")){ee(n,u);return}i=new MutationObserver(()=>{if(o)return;u.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,ee(n,u))}),i.observe(u,{childList:!0,subtree:!0})}else ee(n,u)}catch(u){let l=u instanceof Error?u:new Error(String(u));$r(n,l)}});return queueMicrotask(a),n}function yn(e,t){return()=>Je()===e?t():Et(e,t)}function Ct(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";L(n,{phase:r,name:t});return}}function gn(e,t,n,r,o){let i=Ct(e,t);if(typeof i!="function")return;let s=yn(o,i);r()||!n.isConnected?Ct(s,"onUnmount"):Vr(s,n)}var Xe=new WeakMap,Ie=new WeakMap,Se=new Set,xe=new Set,Ze=null,_t=0,Cu=256;function bn(e){let t=Xe.get(e);if(t){Xe.delete(e),Se.delete(e);for(let n of t)try{n()}catch{}}}function hn(e){Ie.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Ie.get(e);if(n){Ie.delete(e),xe.delete(e);for(let r of n)try{r()}catch{}}})}function Au(e){if(Se.size===0||e.nodeType!==1)return;let t=e;if(Se.has(t)&&t.isConnected&&bn(t),t.firstElementChild)for(let n of Array.from(Se))n!==t&&n.isConnected&&t.contains(n)&&bn(n)}function Nu(e){if(xe.size===0||e.nodeType!==1)return;let t=e;if(xe.has(t)&&!t.isConnected&&hn(t),t.firstElementChild)for(let n of Array.from(xe))n!==t&&!n.isConnected&&t.contains(n)&&hn(n)}function Ru(){if(Se.size>0)for(let e of Array.from(Se))e.isConnected&&bn(e);if(xe.size>0)for(let e of Array.from(xe))e.isConnected||hn(e)}function Br(){Ze||typeof document>"u"||(Ze=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++)Au(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)Nu(t.removedNodes[n])}_t+=e.length,_t>=Cu&&(_t=0,Ru()),vn()}),Ze.observe(document.body,{childList:!0,subtree:!0}))}function vn(){Ze&&Se.size===0&&xe.size===0&&(Ze.disconnect(),Ze=null,_t=0)}function Lu(e,t){let n=Xe.get(e);return n||(n=[],Xe.set(e,n)),n.push(t),Se.add(e),Br(),()=>{let r=Xe.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Xe.delete(e),Se.delete(e))}vn()}}function Mu(e,t){let n=Ie.get(e);return n||(n=[],Ie.set(e,n)),n.push(t),xe.add(e),Br(),()=>{let r=Ie.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ie.delete(e),xe.delete(e))}vn()}}function At(e,t){if(typeof document>"u")return;let n=Je();if(e=yn(n,e),t){let r=!1,o=()=>r;if(_(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||gn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){gn(e,"onMount",t,o,n);return}let i=Lu(t,()=>{r||gn(e,"onMount",t,o,n)});_(t,i)})}else queueMicrotask(()=>{Ct(e,"onMount")})}function Ou(e,t){typeof document>"u"||Vr(yn(Je(),e),t)}function Vr(e,t){let n=!1,r=()=>{n||(n=!0,Ct(e,"onUnmount"))};_(t,r);let o=()=>{if(n)return;let i=Mu(t,r);_(t,i)};t.isConnected?o():At(()=>{o()},t)}function Pu(e,t){_(t,e)}function ae(e,t,n){try{e.emit(t,n)}catch{}}var Sn=Symbol.for("sibujs.ssr.v1");function Du(){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 It=="function"&&(t=It("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var Ce=globalThis[Sn]??(globalThis[Sn]=Du()),Be=Ce.als,Z=Ce.fallbackStore;Ce.fallbackDepth??(Ce.fallbackDepth=0);var jr=!1;function $u(){if(jr||Be||!(typeof process<"u"&&!!process.versions?.node))return;jr=!0;let t=process.versions.node;`${t}`}function Ve(){if(Be){let e=Be.getStore();if(e)return e}return Z}function Fr(){return Be?Be.getStore()??null:Ce.fallbackDepth>0?Z:null}function de(){return Ve().ssr}function zr(e){if(!de())return null;let t=Ve(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function Wr(){Ve().ssr=!0}function qr(){Ve().ssr=!1}function Ur(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Be)return Be.run(t,e);$u();let n=Z.ssr,r=Z.suspenseIdCounter,o=Z.idCounter,i=Z.locale;Z.ssr=!0,Z.suspenseIdCounter=0,Z.idCounter=0,Z.locale=void 0,Ce.fallbackDepth++;try{return e()}finally{Ce.fallbackDepth--,Z.ssr=n,Z.suspenseIdCounter=r,Z.idCounter=o,Z.locale=i}}function Kr(e){let t=Ve(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Xr=globalThis;function Hu(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,ce(()=>t(o,void 0));else{let i=n;n=o,ce(()=>t(o,i))}}}var Gr=100;function Nt(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===Je()?Jr(t):Et(n,()=>Jr(t))}function Jr(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){L(n,{phase:"cleanup"})}}function Yr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&Nt(e),_e(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Gr);e.rerunPending&&(e.rerunPending=!1,L(new Error(`effect re-requested itself ${Gr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Iu(e){if(e.disposed)return;e.disposed=!0;let t=Xr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Nt(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{De(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function Q(e,t){if(de())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&&Nt(n),_e(n.bodyFn,o),n.rerunPending&&Yr(n)}finally{n.running=!1,n.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,n.subscriber=o,n.running=!0;try{_e(n.bodyFn,n.subscriber),n.rerunPending&&Yr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&Nt(n),De(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=Xr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&ae(i,"effect:create",{effectFn:e}),()=>Iu(n)}var lt=0,xn=new Set;function Bu(e){lt++;try{return e()}finally{lt--,lt===0&&Fu()}}function Vu(e){return lt===0?!1:(xn.add(e),!0)}function ju(){return lt>0}function Fu(){try{for(let e of xn)Nr(e)}finally{xn.clear()}Ar()}var Zr=Symbol.for("sibujs.reactive.batch.v1");function zu(){let e=globalThis,t=e[Zr];if(t)return t;let n={batch:Bu,enqueueBatchedSignal:Vu,isBatching:ju};return e[Zr]=n,n}var wn=zu(),W=wn.batch,je=wn.enqueueBatchedSignal,Wu=wn.isBatching;var Tn=globalThis;function C(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=t?.equals;r&&(n.__name=r);function i(){return Pe(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++,!1){let c=Tn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&ae(c,"signal:update",{signal:n,name:r,oldValue:u,newValue:l})}je(n)||Ge(n)}}:s=a=>{let u=n.value,l=typeof a=="function"?a(u):a;Object.is(l,u)||(n.value=l,n.__v++,je(n)||Ge(n))},!1){let a=Tn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&ae(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function qu(e){let[t,n]=C(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Uu=`
|
|
5
|
+
`?2:1;continue}if(cr(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&cr(e[s]);)i+=e[s],s++;s<e.length&&Pi(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 dr=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],Hi=4,$i=5,Ii=8;function Bi(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 Xt=new Set,fr=100,pr=!1;function St(e,t,n){}function mr(e){return(e.includes("\\")?Di(e):e).toLowerCase().replace(/\s+/g,"")}function Qt(e){if(!Oi.test(e))return-1;let t=mr(e);for(let n=0;n<dr.length;n++)if(t.includes(dr[n]))return n;return-1}function xt(e,t,n){let r=en(e,t);return r===-1?t:(St(t,r,{property:e,element:n?.element}),"")}function en(e,t){let n=Qt(t);if(n!==-1)return n;let r=se(e);return r==="behavior"?$i:r==="-moz-binding"?Hi:(r==="filter"||r==="-ms-filter")&&mr(t).includes("progid:")?Ii:-1}function ji(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:se(l);i.push([p,u,d!==null])}return i}function Vi(e,t){let n=String(e),r=ji(n);if(r===null)return Qt(n)!==-1&&St(n,Qt(n),t),"";let o=[];for(let[i,s,a]of r){let l=en(i,s);if(l!==-1){St(s,l,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function wt(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return Vi(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=en(s,a);if(l!==-1){St(a,l,{property:s,element:t?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var tn=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),Fi=new Set(["srcdoc"]);function ct(e){return Fi.has(e.toLowerCase())}function gr(e){return tn.has(e.toLowerCase())}function zi(e){let t=e.toLowerCase();return t==="style"||tn.has(t)}function Wi(e,t,n){let r=e.toLowerCase();return r==="srcset"?Mi(t):tn.has(r)?vt(t):r==="style"?wt(t,n):t}function br(e,t,n){if(!zi(e))return t;let r=Wi(e,t,n);return r===""?null:r}function De(e){return e===" "||e===" "||e===`
|
|
7
|
+
`||e==="\r"||e==="\f"}function Tt(e){let t=0,n=e.length;for(;t<n&&De(e[t]);)t++;for(;n>t&&De(e[n-1]);)n--;return e.slice(t,n)}var ae=e=>({kind:"forbidden",reason:e});function qi(e){let t=Tt(Ge(e));if(t==="")return ae("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return ae("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return ae("");for(;n<t.length&&De(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return ae("");for(n++;n<t.length&&De(t[n]);)n++;let o=n;for(;n<t.length&&!De(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return ae("");for(;n<t.length&&De(t[n]);)n++;if(t[n]!=="=")return ae("");for(n++;n<t.length&&De(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return ae("");if(s=t.slice(n+1,u),Tt(t.slice(u+1))!=="")return ae("")}else if(s=Tt(t.slice(n)),/[;,]/.test(s))return ae("");if(s==="")return ae("");let l=vt(s);return l===""?ae(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function nn(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=se(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?ae(""):typeof t!="string"?{kind:"not-refresh"}:Tt(Ge(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:qi(n)}var Ui="http://www.w3.org/1999/xhtml",Ki="http://www.w3.org/2000/svg",Ji=new Set(["script","iframe","object","embed","frame","frameset"]);function yr(e){return se(e)}function Sr(e){return Ji.has(yr(e))}var Gi=new Set(["script","style"]);function vr(e){return Gi.has(yr(e))}var B={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Yi=new Set(["src","href","xlink:href","type","language"]),Zi=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),rn=new WeakSet;function xr(e){return e.namespaceURI===Ui||e.namespaceURI===null}function wr(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 Xi(e){rn.has(e)||(rn.add(e),e.getAttribute("content")!==null&&nn(wr(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function Qi(e,t,n,r){if(!xr(e))return B.None;let o=se(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&Xi(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return B.None;let i=nn(wr(e,o,n));return i.kind==="forbidden"?B.MetaRefreshForbidden:i.kind!=="not-refresh"&&rn.has(e)?B.MetaRefreshReactive:B.None}function es(e,t){if(t===null||se(e)!=="attributename")return B.None;let n=Ge(t);return gr(n)||_e(n)||ct(n)?B.AnimationTarget:B.None}var Et=new WeakSet;function hr(e){if(e===null)return!1;let t=se(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 ts(e,t,n,r){if(!xr(e))return B.None;let o=se(t);return o==="href"?r==="static"||n===null?B.None:hr(e.getAttribute("rel"))?B.StylesheetSource:(Et.add(e),B.None):o==="rel"&&hr(n)&&Et.has(e)&&e.hasAttribute("href")?B.StylesheetSource:B.None}function on(e,t,n,r){let o=e.localName;return o==="meta"?Qi(e,t,n,r):o==="link"?ts(e,t,n,r):o==="script"?r==="static"||n===null?B.None:Yi.has(se(t))?B.ScriptSource:B.None:Zi.has(o)&&e.namespaceURI===Ki?es(t,n):B.None}function sn(e,t,n){e.localName!=="link"||se(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?Et.add(e):Et.delete(e))}var ns="http://www.w3.org/1999/xhtml",rs="http://www.w3.org/2000/svg",os="http://www.w3.org/1999/xlink",is="http://www.w3.org/XML/1998/namespace",ss=new Set(["checked","disabled","selected"]);function as(e){return e.namespaceURI===null||e.namespaceURI===ns}function Er(e,t,n){}function Tr(e,t,n){e[t]=n}function ls(e,t){if(e.namespaceURI!==rs)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?os:n.startsWith("xml:")?is:null}function de(e,t,n,r={}){let o=us(e,t,n,r);return e.localName==="link"&&sn(e,t,r.reactive?"reactive":"runtime"),o}function us(e,t,n,r){let o=ls(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(_e(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=on(e,t,s,r.reactive?"reactive":"runtime");if(a!==B.None)return Er(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(ct(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let l=as(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&&ss.has(u)&&u in e?Tr(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 Tr(e,u,u==="checked"?!!n:d),!0;let p=d===""?"":br(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 an(e,t,n){if(ct(t))return!1,!1;let r=on(e,t,n,"static");return r!==B.None?(Er("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&sn(e,t,"static"),!0)}var cs=4096,ln=[];function ds(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function fs(e,t,n){let r=ln.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=ds();return o.sig=e,o.sub=t,o.epoch=n,o}function kr(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,ln.length<cs&&ln.push(e)}function ps(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 ms(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function gs(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,ve=null,Ne=0,Re=[],Y=new Set,bs=[];function hs(e){try{e()}catch(t){let n=e;L(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function ys(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 he=0,xe=!1;function cn(){he===0&&(ve=fe,fe=null,xe=!0),he++}function dn(){he--,he===0&&(fe=ve,ve=null,xe=!1)}function Ar(){return xe}function _r(e){cn();try{return e()}finally{dn()}}var le=null;function fn(){return le}function _t(e,t){let n=le;le=e;try{return t()}finally{le=n}}function pn(e){let t=le;return t===null?e:(...n)=>_t(t,()=>e(...n))}var Ye=null,Ss=0;function mn(e,t){let n=fe,r=0,o=null;xe&&(r=he,o=ve,he=0,ve=null,xe=!1),fe=t;let i=t;i._cap===void 0&&(i._cap=ir());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 l=Ye;l!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=l),i._tok!=null&&(Ye=i._tok);let u=++Ss;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{fe=n,le=s,Ye=l,r!==0&&(he=r,ve=o,xe=!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&&(gs(d),Cr(d),kr(d)),d=p}}}function Nr(e,t){if(!t)return gn(e);Ze(t);let n=fe,r=0,o=null;xe&&(r=he,o=ve,he=0,ve=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&&(he=r,ve=o,xe=!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=()=>Ze(t))}function gn(e,t,n){return Lr(e,t,n===!0)._dispose}function Rr(e,t){let n=Lr(e,t,!0);return{stop:n._dispose,run:r=>{let o=Ye;Ye=n._tok??null;try{return r()}finally{Ye=o}}}}function Lr(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{mn(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),Ze(o),i}return o._dispose=()=>{o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Ze(o)},o}function Mr(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=fs(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,ms(t,i),ps(n,i),t._structDirty=!0}function Ze(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),kr(n),n=r}}var kt=1e3,Ct=1e6,At=0,He=new Set;function Or(e){let t=kt;return Number.isFinite(e)&&e>0&&(kt=Math.floor(e)),t}function Pr(e){let t=Ct;return Number.isFinite(e)&&e>0&&(Ct=Math.floor(e)),t}function vs(e){let t=e;return t._runEpoch!==At?(t._runEpoch=At,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>kt)}function xs(e){let t=e.__name??"<unnamed>";L(new Error(`subscriber "${t}" fired more than ${kt} 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 ws(){L(new Error(`Notification drain exceeded ${Ct} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Dr(){let e=0;for(;e<Re.length;){if(e>=Ct){ws();break}let t=Re[e++];Y.delete(t)&&(t._owner!=null&&Y.size>0&&(Ts(t),Y.has(t))||Hr(t))}}function Ts(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;Y.has(r)&&(t=r),n=r._owner??null}if(t===null)return;Y.delete(t),Hr(t)}}function Hr(e){if(He.size>0&&He.has(e)||e._hasComputedDep===!0&&!ys(e))return;if(vs(e)){xs(e),He.add(e);return}let t=sr(e._cap??null);try{hs(e)}finally{t&&ar()}}function $r(){if(!(Ne>0)){Ne++,At++;try{Dr()}finally{Ne--,Ne===0&&(Re.length=0,Y.clear(),He.size>0&&He.clear())}}}function un(e){e();let t=e._sig;if(!t)return;let n=bs,r=n.length;for(n.push(t);n.length>r;){let i=n.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,n.push(a)):s()}else Y.has(s)||(Y.add(s),Re.push(s));i=i.sigNext}}}function Ir(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?un(r):Y.has(r)||(Y.add(r),Re.push(r))),n=n.sigNext}}function Br(e){let n=e.subsHead;if(n){if(Ne>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?un(o):Y.has(o)||(Y.add(o),Re.push(o))),r=r.sigNext}return}Ne++,At++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?un(o):Y.has(o)||(Y.add(o),Re.push(o))),r=r.sigNext}Dr()}finally{Ne--,Ne===0&&(Re.length=0,Y.clear(),He.size>0&&He.clear())}}}function jr(e){return e.__sc??0}function Vr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function Fr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var zr="4.14.0",Wr=Symbol.for("sibujs.reactive.v1");function ks(){let e=globalThis,t=e[Wr];if(t)return!1,t;let n={suspendTracking:cn,resumeTracking:dn,isTrackingSuspended:Ar,untracked:_r,retrack:mn,track:Nr,reactiveBinding:gn,recordDependency:Mr,cleanup:Ze,setMaxSubscriberRepeats:Or,setMaxDrainIterations:Pr,drainNotificationQueue:$r,queueSignalNotification:Ir,notifySubscribers:Br,getSubscriberCount:jr,getSubscriberDeps:Vr,forEachSubscriber:Fr,getOwnerScope:fn,runWithOwnerScope:_t,bindOwnerScope:pn,structuralBinding:Rr,version:zr};return e[Wr]=n,n}var V=ks(),$e=V.suspendTracking,Ie=V.resumeTracking,qr=V.isTrackingSuspended,pe=V.untracked,Le=V.retrack,Xe=V.track,K=V.reactiveBinding,Be=V.recordDependency,je=V.cleanup,dd=V.setMaxSubscriberRepeats,Ur=V.setMaxDrainIterations,Kr=V.drainNotificationQueue,Jr=V.queueSignalNotification,Qe=V.notifySubscribers,fd=V.getSubscriberCount,pd=V.getSubscriberDeps,md=V.forEachSubscriber,et=V.getOwnerScope??fn,Nt=V.runWithOwnerScope??_t,Q=V.bindOwnerScope??pn,Ve=V.structuralBinding??((e,t)=>({stop:V.reactiveBinding(e,t),run:n=>n()}));function dt(e,t,n){if(_e(t))return de(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){L(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}de(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return K(r,e)}function Gr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){L(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){L(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),de(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=K(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var bn=["data-focus-key","id","name"],Cs=new Set(["text","search","url","tel","password",""]);function As(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Cs.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 ft(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<bn.length;i++){let s=t.getAttribute(bn[i]);if(s){r=bn[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...As(t)}}function _s(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ns(e,t){let n=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(t)&&(r++,n??(n=s));let a=s.querySelectorAll(t);for(let l=0;l<a.length;l++)r++,n??(n=a[l]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function Yr(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function tt(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){Yr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=Ns(t,`[${e.attr}=${_s(e.value)}]`);if(s&&s.tagName===e.tag){Yr(s,e);return}i=a>1}if(r!==void 0&&typeof r=="object"){let s=typeof r.restoreTo=="function"?r.restoreTo():r.restoreTo;if(s?.isConnected&&(s.focus(),document.activeElement===s))return}}function we(e,t){let n=[],r=ge();function o(){let i;try{i=X(r,t)}catch(p){L(p,{phase:"binding",name:"bindChildNode",node:e});return}let s=ft(n);if(i==null||typeof i=="boolean"){for(let p=0;p<n.length;p++){let g=n[p];I(g),g.parentNode&&g.parentNode.removeChild(g)}n.length=0,tt(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)){!1;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)||(I(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,tt(s,l,"bindChildNode")}return K(o,e,!0)}function hn(){throw new Error("[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first.")}function re(){typeof document>"u"&&hn()}var H="http://www.w3.org/2000/svg",Rs=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var yn=new Set,Zr=100,Xr=!1,Qr=new Map;function eo(e){let t=Qr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Qr.set(e,t)),t}function Ls(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=K(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",wt(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=eo(d);u.push(g),l.setProperty(g,xt(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",wt(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=eo(r);if(typeof o=="function"){let s=o,a=K(()=>{n.style.setProperty(i,xt(i,String(s()),{element:e}))},e);C(e,a)}else n.style.setProperty(i,xt(i,String(o),{element:e}))}}function Ms(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=K(()=>{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=K(()=>{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 Sn(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,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),C(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),C(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 m(e,t){let n=Sr(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&hn();let i=lt(e,t);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Sn(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Sn(i,r),i;let s=r,a=s.class;a!=null&&Ms(i,a);let l=s.id;typeof l=="function"?C(i,dt(i,"id",l)):l!=null&&(!1,i.id=l);let u=o!==void 0?o:s.nodes;u!=null&&Sn(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):!1}let p=s.style;p!=null&&Ls(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||_e(b))continue;typeof c=="function"?C(i,dt(i,b,c)):de(i,b,c,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var jd=m("html"),Os=m("head"),Ps=m("body"),Ds=m("title"),P=m("div"),z=m("span"),Hs=m("section"),$s=m("article"),Is=m("header"),Bs=m("footer"),js=m("nav"),Vs=m("main"),Fs=m("aside"),zs=m("address"),vn=m("p"),Ws=m("h1"),qs=m("h2"),xn=m("h3"),Us=m("h4"),Ks=m("h5"),Js=m("h6"),Gs=m("blockquote"),Ys=m("dd"),Zs=m("dl"),Xs=m("dt"),Qs=m("figcaption"),ea=m("figure"),ta=m("hr"),na=m("li"),ra=m("ol"),oa=m("ul"),wn=m("pre"),ia=m("a"),sa=m("abbr"),aa=m("b"),la=m("bdi"),ua=m("bdo"),ca=m("br"),da=m("cite"),Tn=m("code"),fa=m("data"),pa=m("dfn"),ma=m("em"),ga=m("i"),ba=m("kbd"),ha=m("mark"),ya=m("q"),Sa=m("rp"),va=m("rt"),xa=m("ruby"),wa=m("s"),Ta=m("samp"),Ea=m("small"),ka=m("strong"),Ca=m("sub"),Aa=m("sup"),_a=m("time"),Na=m("u"),Ra=m("var"),La=m("area"),Ma=m("audio"),Oa=m("img"),Pa=m("map"),Da=m("track"),Ha=m("video"),$a=m("embed"),Ia=m("iframe"),Ba=m("object"),ja=m("param"),Va=m("picture"),Fa=m("portal"),za=m("source"),Wa=m("svg",H),qa=m("math"),Ua=m("canvas"),Ka=m("noscript"),Ja=m("script"),Ga=m("del"),Ya=m("ins"),Za=m("caption"),Xa=m("col"),Qa=m("colgroup"),el=m("table"),tl=m("tbody"),nl=m("td"),rl=m("tfoot"),ol=m("th"),il=m("thead"),sl=m("tr"),pt=m("button"),al=m("datalist"),ll=m("fieldset"),ul=m("form"),cl=m("input"),dl=m("label"),fl=m("legend"),pl=m("meter"),ml=m("optgroup"),gl=m("option"),bl=m("output"),hl=m("progress"),yl=m("select"),Sl=m("textarea"),vl=m("details"),xl=m("dialog"),wl=m("menu"),Tl=m("summary"),El=m("slot"),kl=m("template"),Cl=m("base"),Al=m("link"),_l=m("meta"),Fe=m("style"),Nl=m("circle",H),Rl=m("ellipse",H),Ll=m("g",H),Ml=m("line",H),Ol=m("path",H),Pl=m("polygon",H),Dl=m("polyline",H),Hl=m("rect",H),$l=m("text",H),Il=m("tspan",H),Bl=m("defs",H),jl=m("clipPath",H),Vl=m("mask",H),Fl=m("pattern",H),zl=m("linearGradient",H),Wl=m("radialGradient",H),ql=m("stop",H),Ul=m("use",H),Kl=m("symbol",H),Jl=m("marker",H),Gl=m("center"),Yl=m("font"),Zl=m("marquee"),Xl=e=>m(e);var to,En=globalThis[to=Symbol.for("sibujs.streamBoundary.v1")]??(globalThis[to]={hook:null,current:null});function no(e){return En.hook?En.hook(e):null}function Rt(){return En.current}var kn=Symbol.for("sibujs.ssr.v1");function Ql(){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 Ut=="function"&&(n=Ut("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 Me=globalThis[kn]??(globalThis[kn]=Ql()),We=Me.als,ze=Me.fallbackStore;Me.fallbackDepth??(Me.fallbackDepth=0);var ro=!1;function eu(){if(ro||We||!(typeof process<"u"&&!!process.versions?.node))return;ro=!0;let t=process.versions.node;`${t}`}function Oe(){if(We){let e=We.getStore();if(e)return e}return ze}function Cn(){return We?We.getStore()??null:Me.fallbackDepth>0?ze:null}function ee(){return Oe().ssr}function oo(e){if(!ee())return null;let t=Oe(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}var tu=Symbol.for("sibujs.prerender.v1");function mt(){return Oe().ssr||globalThis[tu]!==void 0}function io(){return!mt()}function so(){Oe().ssr=!0}function ao(){Oe().ssr=!1}function lo(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0,pending:new Set,wake:null};if(We)return We.run(t,e);eu();let n={...ze};Object.assign(ze,t),Me.fallbackDepth++;try{return e()}finally{Me.fallbackDepth--;for(let r of Object.keys(ze))r in n||delete ze[r];Object.assign(ze,n)}}function uo(e,t,n=!0){let r=Cn(),o=r?.pending,i=o||!n?[]:Yt();if(!o&&i.length===0)return e;let s={label:t,since:Date.now(),boundary:Rt()??void 0};o?.add(s);let a=or(i,s),l=()=>{o?.delete(s),r?.wake?.(),a()};try{Promise.resolve(e).then(l,l)}catch{l()}return e}function co(e){let t=Oe(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var An="__sibuPendingError";function fo(e,t){let n=()=>e.parentNode?(L(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[An]=t)})}function Lt(e){let t=e,n=t[An];if(n instanceof Error)return delete t[An],n}function po(e){let t=null;return function(){if(t&&!Qn())return t();let r=P({class:"sibu-lazy"}),o=ge(),i=Rt(),s=!1,a=X(null,()=>z("sibu-lazy-loading","Loading..."));if(t){let l=t;return ie(r,X(o,()=>l())),r}return uo(e(),"lazy").then(Q(l=>{if(s)return;t=l.default;let u=t,d=()=>X(o,()=>u()),p=i?i.enter(d):d();ie(r,p)})).catch(l=>{if(s)return;let u=l instanceof Error?l:new Error(String(l));ie(r,P({class:"sibu-lazy-error"},`Failed to load component: ${u.message}`)),fo(r,u)}),ye()&&r.firstChild||r.appendChild(a),C(r,()=>{s=!0}),r}}function mo({nodes:e,fallback:t}){let n=P({class:"sibu-suspense"}),r=ge(),o=no(n),i=p=>{ie(n,p),o?.done()},s=X(null,t);ye()&&n.firstChild?I(s):n.appendChild(s);let a=!1,l=null,u=null;C(n,()=>{a=!0,l&&(l.disconnect(),l=null),u&&!n.contains(u)&&I(u)});let d=Q(()=>{if(!a)try{let p=o?o.enter(()=>X(r,e)):X(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));fo(n,g)}});return queueMicrotask(d),n}function Ln(e,t){return()=>et()===e?t():Nt(e,t)}function Ot(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";L(n,{phase:r,name:t});return}}function _n(e,t,n,r,o){let i=Ot(e,t);if(typeof i!="function")return;let s=Ln(o,i);r()||!n.isConnected?Ot(s,"onUnmount"):bo(s,n)}var nt=new WeakMap,qe=new WeakMap,Te=new Set,Ee=new Set,rt=null,Mt=0,nu=256;function Nn(e){let t=nt.get(e);if(t){nt.delete(e),Te.delete(e);for(let n of t)try{n()}catch{}}}function Rn(e){qe.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=qe.get(e);if(n){qe.delete(e),Ee.delete(e);for(let r of n)try{r()}catch{}}})}function ru(e){if(Te.size===0||e.nodeType!==1)return;let t=e;if(Te.has(t)&&t.isConnected&&Nn(t),t.firstElementChild)for(let n of Array.from(Te))n!==t&&n.isConnected&&t.contains(n)&&Nn(n)}function ou(e){if(Ee.size===0||e.nodeType!==1)return;let t=e;if(Ee.has(t)&&!t.isConnected&&Rn(t),t.firstElementChild)for(let n of Array.from(Ee))n!==t&&!n.isConnected&&t.contains(n)&&Rn(n)}function iu(){if(Te.size>0)for(let e of Array.from(Te))e.isConnected&&Nn(e);if(Ee.size>0)for(let e of Array.from(Ee))e.isConnected||Rn(e)}function go(){rt||typeof document>"u"||(rt=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++)ru(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)ou(t.removedNodes[n])}Mt+=e.length,Mt>=nu&&(Mt=0,iu()),Mn()}),rt.observe(document.body,{childList:!0,subtree:!0}))}function Mn(){rt&&Te.size===0&&Ee.size===0&&(rt.disconnect(),rt=null,Mt=0)}function su(e,t){let n=nt.get(e);return n||(n=[],nt.set(e,n)),n.push(t),Te.add(e),go(),()=>{let r=nt.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(nt.delete(e),Te.delete(e))}Mn()}}function au(e,t){let n=qe.get(e);return n||(n=[],qe.set(e,n)),n.push(t),Ee.add(e),go(),()=>{let r=qe.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(qe.delete(e),Ee.delete(e))}Mn()}}function Pt(e,t){if(typeof document>"u"||ee())return;let n=et();if(e=Ln(n,e),t){let r=!1,o=()=>r;if(C(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||_n(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){_n(e,"onMount",t,o,n);return}let i=su(t,()=>{r||_n(e,"onMount",t,o,n)});C(t,i)})}else queueMicrotask(()=>{Ot(e,"onMount")})}function lu(e,t){typeof document>"u"||ee()||bo(Ln(et(),e),t)}function bo(e,t){let n=!1,r=()=>{n||(n=!0,Ot(e,"onUnmount"))};C(t,r);let o=()=>{if(n)return;let i=au(t,r);C(t,i)};t.isConnected?o():Pt(()=>{o()},t)}function uu(e,t){C(t,e)}function ue(e,t,n){try{e.emit(t,n)}catch{}}var vo=globalThis;function cu(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 ho=100;function Dt(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===et()?yo(t):Nt(n,()=>yo(t))}function yo(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){L(n,{phase:"cleanup"})}}function So(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&Dt(e),Le(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=ho);e.rerunPending&&(e.rerunPending=!1,L(new Error(`effect re-requested itself ${ho}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function du(e){if(e.disposed)return;e.disposed=!0;let t=vo.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Dt(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{je(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function te(e,t){if(ee()&&!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&&Dt(n),Le(n.bodyFn,o),n.rerunPending&&So(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{Le(n.bodyFn,n.subscriber),n.rerunPending&&So(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&Dt(n),je(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=vo.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&ue(i,"effect:create",{effectFn:e}),()=>du(n)}var gt=0,On=new Set;function fu(e){gt++;try{return e()}finally{gt--,gt===0&&gu()}}function pu(e){return gt===0?!1:(On.add(e),!0)}function mu(){return gt>0}function gu(){try{for(let e of On)Jr(e)}finally{On.clear()}Kr()}var xo=Symbol.for("sibujs.reactive.batch.v1");function bu(){let e=globalThis,t=e[xo];if(t)return t;let n={batch:fu,enqueueBatchedSignal:pu,isBatching:mu};return e[xo]=n,n}var Pn=bu(),W=Pn.batch,Ue=Pn.enqueueBatchedSignal,hu=Pn.isBatching;var Dn=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=void 0,o=t?.equals;r&&(n.__name=r);function i(){return Be(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;if(!o(l,u)){if(n.value=u,n.__v++,!1){let d=Dn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&ue(d,"signal:update",{signal:n,name:r,oldValue:l,newValue:u})}Ue(n)||Qe(n)}}:s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;Object.is(u,l)||(n.value=u,n.__v++,Ue(n)||Qe(n))},!1){let a=Dn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&ue(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function yu(e){let[t,n]=A(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Su=`
|
|
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
|
+
`,wo=!1;function vu(){if(wo||typeof document>"u")return;let e=Fe({nodes:Su});document.head.appendChild(e),wo=!0}function xu(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 To(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=xu(r),i=e.cause,s=i!=null?To(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 wu(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 Eo(e){let t=e.map((n,r)=>P({class:"sibu-err-frame",nodes:[z({class:"sibu-err-line",nodes:String(r+1)}),z({class:"sibu-err-fn",nodes:n.fn}),z({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return wn({class:"sibu-err-stack",nodes:t})}function ko(e){return e?[P({class:"sibu-err-cause-label",nodes:"Caused by"}),P({class:"sibu-err-section",nodes:[P({class:"sibu-err-section-head",nodes:[z({nodes:`[${e.code}] ${e.message}`}),z({nodes:""})]}),e.frames.length>0?Eo(e.frames):P({class:"sibu-err-stack",nodes:"(no stack)"})]}),...ko(e.cause)]:[]}function Tu(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 Hn(e){vu();let t=e.severity??"error",n=To(e.error),r=e.alwaysShowDetails??me(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=A("Copy"),l=pt({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let b=wu(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:[Tn({class:"sibu-err-icon",nodes:n.code}),xn({class:"sibu-err-title",nodes:o}),l,z({class:"sibu-err-timestamp",nodes:i})]}),d=[vn({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&d.push(P({class:"sibu-err-section",nodes:[P({class:"sibu-err-section-head",nodes:[z({nodes:"Stack Trace"})]}),Eo(n.frames)]})),r&&d.push(...ko(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(P({class:"sibu-err-section",nodes:[P({class:"sibu-err-section-head",nodes:[z({nodes:"Metadata"})]}),Tu(e.metadata)]}));let p=[];e.onRetry&&p.push(pt({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&p.push(pt({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 Eu=`
|
|
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
|
+
`,ku=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Co=!1;function Cu(){if(!Co&&typeof document<"u"){let e=Fe({nodes:Eu});document.head.appendChild(e),Co=!0}}function Au(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;Cu();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){L(D,{phase:"effect",name:"ErrorBoundary.resetKeys"}),x[E]=ku}return x},b=()=>{let S=s;if(!S||S.length===0)return;p();let x=null;d=te(()=>{let E=g(S);if(x===null){x=E;return}let D=E.length!==x.length;if(!D){for(let $=0;$<E.length;$++)if(!Object.is(E[$],x[$])){D=!0;break}}x=E,D&&u()})},c=S=>{let x=Jt(S);if(l(x),b(),i)try{i(x)}catch(E){L(E,{phase:"render",name:"ErrorBoundary onError callback"})}return x},f=(S,x)=>Hn({error:S,severity:"error",onRetry:x}),h=S=>{let x=o||f;try{return x(S,u)}catch(E){return queueMicrotask(()=>{L(E,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=P({class:"sibu-error-boundary",nodes:()=>{let 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(z({class:"sibu-lazy-loading",nodes:"Loading..."}));let D=!1;return C(E,()=>{D=!0}),x.then($=>{if(D){I($);return}ie(E,$)}).catch(Q($=>{if(D)return;let q=c($);ie(E,h(q))})),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),Pt(()=>{let S=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),x=[],E=S.currentNode;for(;E;){let D=Lt(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($=>$.message).join("; ")))}},y),C(y,()=>{p(),y.removeEventListener("sibu:error-propagate",v)}),y}var _u=`
|
|
347
347
|
@keyframes sibu-spin {
|
|
348
348
|
to { transform: rotate(360deg); }
|
|
349
349
|
}
|
|
@@ -396,5 +396,5 @@
|
|
|
396
396
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
397
397
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
398
398
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
399
|
-
`,
|
|
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=vl.has(f),S=n[r]==="/";if(S&&r++,r<o&&r++,y||S)g.push({t:0,el:{tag:f,svg:wo.has(f),attrs:b,children:[]}});else{let v=h();if(tr(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:wo.has(f),attrs:b,children:v}})}}else m(g);return g}return h()}function An(e,t){let n=e.svg?document.createElementNS(H,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:Yt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?_(n,st(n,i,s)):ue(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]}ue(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):!1;break}case 4:Yt(n,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(An(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),_(n,ve(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 Eo(e,...t){let n=To.get(e);return n||(n=Sl(e),To.set(e,n)),_o(n,t)}function ko(e,t){return _o(e,t)}function _o(e,t){if(te(),e.length===1&&e[0].t===0)return An(e[0].el,t);let n=document.createElement("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(An(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(i instanceof Node)n.appendChild(i);else if(typeof i=="function"){let s=document.createComment("bind:htm");n.appendChild(s),_(n,ve(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 xl(e,t,n){te();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&pe()&&void 0;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&&(V(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(S))}}f.insertBefore(b,r.nextSibling),u=b,l=!0},h=$e(m),g=h.stop;return l||queueMicrotask(X(()=>{!l&&r.parentNode&&h.run(m)})),_(r,()=>{c=!0,g();for(let d of o.values())V(d),d.parentNode&&d.parentNode.removeChild(d);o.clear(),i.length=0,u=null}),r}function wl(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=c=>{if(c instanceof DocumentFragment){let 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=zn(()=>{let c=e();return i(c),c}):(s=e,i(s));let a=n()-r,u=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&ae(u,"app:init",{rootElement:s,container:t,duration:a});let l=o;return{node:s,unmount(){if(u&&ae(u,"app:unmount",{rootElement:s}),l){Tl(l.start,l.end);return}V(s),s.parentNode?.removeChild(s)}}}function Tl(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=be;for(let a=e.nextSibling;a&&a!==t;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==n||t.parentNode!==n?s=!1:(e.previousSibling!==o||t.nextSibling!==i)&&(o=e.previousSibling,i=t.nextSibling,s=!!(e.compareDocumentPosition(t)&4));let a=e.nextSibling;if(!s||a===t)break;if(r--<=0){we("mount",be,1);return}V(a),a.parentNode===n&&n.removeChild(a)}s||L(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function El(e,t){te();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=X(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{L(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),_(n,()=>{i=!0,o&&(V(o),o.remove(),o=null)}),n}function kl(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Co(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function _l(e=[]){let[t,n]=C([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let u=[...a];return s=Co(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 Cl(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,je(r)||Ge(r)}function i(){if(Pe(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=Co(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 Al(e,t){let[n,r]=C(t),[o,i]=C(!1),[s,a]=C(null),[u,l]=C(0),c=0,m=!1,h=null,g=()=>{if(h===null)return;let f=h;h=null;try{f.abort()}catch{}},d=Q(()=>{if(u(),m)return;g();let f=++c,b=typeof AbortController<"u"?new AbortController:null;h=b,W(()=>{i(!0),a(null)});let y=()=>m||f!==c,S;try{S=e({signal:b?b.signal:void 0})}catch(v){if(y())return;W(()=>{a(v),i(!1)});return}S.then(v=>{y()||(h=null,W(()=>{r(v),i(!1)}))},v=>{y()||(h=null,W(()=>{a(v),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{m||l(f=>f+1)},dispose:()=>{m||(m=!0,d(),g())}}}function et(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)||!et(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)=>et(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&&et(e.cause,a.cause,n)&&Ao(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:Ao(r,o,n)}function Ao(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)&&et(e[i],t[i],n))}function Nl(e){return C(e,{equals:(t,n)=>et(t,n)})}function ze(e,t){let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,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{Ke(()=>{o._v=e(),o._d=!1,o._init=!0},u)}catch(d){throw s=!0,De(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{_e(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&&De(u)}c&&!s&&!Object.is(d,o._v)&&ae(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 _r()||s?(o._d&&(m(),a!==void 0&&h()),o._v):(o._d&&(m(),a!==void 0&&(Pe(o),h())),Pe(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,De(u);let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(d)try{d.emit("computed:destroy",{signal:o,getter:g})}catch{}},c&&ae(c,"computed:create",{signal:o,name:n,getter:g}),g}function Rl(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function No(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ll(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(u=>{let[l,c]=C(e[u]);No(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=>{No(u,l,t[l][0]())}),u};return[n,{setState:u=>{let l=r(),c=typeof u=="function"?u(l):u;W(()=>{Object.entries(c).forEach(([m,h])=>{Object.hasOwn(t,m)&&t[m][1](h)})})},reset:()=>{W(()=>{Object.keys(e).forEach(u=>{let l=t[u][1];l(e[u])})})},subscribe:u=>{let l=!0;return Q(()=>{let c=r();if(l){l=!1;return}Me();try{u(c)}finally{Oe()}})},subscribeKey:(u,l)=>{let c,m=!0;return Q(()=>{let h=t[u][0]();if(m){c=h,m=!1;return}if(!Object.is(h,c)){let g=c;c=h,Me();try{l(h,g)}finally{Oe()}}})},getSnapshot:r}]}function Ml(e,t){if(de())return()=>{};let n,r=!0;return Ke(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Me();try{t(s,a)}finally{Oe()}}})}function Ol(e,t,n){return[ze(e,n),i=>{W(()=>t(i))}]}function Pl(e){let t=e();return pe()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function Dl(e){if(!pe())return Q(e);let t=Q(e),n=null;return queueMicrotask(()=>{try{n=Q(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Ro(e,t){return de()?()=>{}:K(e,t)}var Nn="data-sibu-enhanced",Rn=new WeakMap;function Lo(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=be){let i=r.length-o+e.length;e.length=0,we(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var Mo=["text","attr","class","show","on","cleanup"];function Oo(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 dt(e,t){return Ro(t,e)}function $l(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 Hl(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 Il(e,t,n,r){let o=`ctx.each[${r}]`;if(pe())for(let i of Object.keys(n))Mo.includes(i),`${o}${i}${Mo.join(", ")}`;if(n.text!==void 0&&(n.text,`${o}`,e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];`${o}${i}`,e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];`${o}${i}`,e.classed(t,i,s)}if(n.show!==void 0&&(n.show,`${o}`,e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];`${o}${String(i)}`,e.on(t,i,s)}n.cleanup!==void 0&&(n.cleanup,`${o}`,e.cleanup(n.cleanup))}function Ot(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(Nn)==="true")return pe()&&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?!0:!1,u=(h,g,d)=>{if(a(h))return;let f=Oo(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=>Oo(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(dt(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(dt(f,()=>{let b=d(),y=b==null?null:String(b);ue(f,g,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(h,g,d)=>{u("classed",h,f=>{r.push(dt(f,()=>{f.classList.toggle(g,!!d())}))})},show:(h,g)=>{u("show",h,d=>{let f=d.hidden;r.push(dt(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(dt(f,()=>{Hl(b,y())}));let x=()=>S($l(b));b.addEventListener(v,x),r.push(()=>b.removeEventListener(v,x))})},each:(h,g)=>{if(a("each"))return;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&&Il(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=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(h){throw Lo(r,"enhance"),s=!0,h}typeof c=="function"&&r.push(c);let m=()=>{i||(i=!0,Rn.get(n)===o&&(Rn.delete(n),n.removeAttribute(Nn)),ot(n,m),Lo(r,"enhance"),s=!0)};return _(n,m),Rn.set(n,o),n.setAttribute(Nn,"true"),m}function Bl(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Ot(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 Vl=/^[A-Za-z0-9_-]+$/,Po=Symbol.for("sibujs.islands.lazy"),Pt=ct(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function jl(e){return e[Po]=!0,e}function Fl(e,t){if(!Vl.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Pt.set(e,t)}function zl(e){Pt.delete(e)}async function Wl(e){if(typeof e=="function"&&e[Po]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function ql(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(!Pt.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=Pt.get(s);c&&Wl(c).then(m=>{if(!o){if(!m){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let h=Ot(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(Ul(l,i,u,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Ul(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 Kl=new Set(["__proto__","constructor","prototype"]);function Ln(e){return Kl.has(e)}function Dt(e){let t={};for(let n of Object.keys(e))Ln(n)||(t[n]=e[n]);return t}function Do(e){return e}var zp=1024*1024;function Gl(e){let[t,n]=C(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},u=Ke(()=>{i=e(),a()}),l=(()=>t());return l.dispose=()=>{o||(o=!0,u())},l}var $o=16;function Jl(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:$o*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,$o)}function Yl(){let[e,t]=C(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=u=>{s(),L(u,{phase:"async",name:"transition"})};Jl(()=>{try{let u=Rt(o());u?u.then(s,a):s()}catch(u){a(u)}})}return{pending:e,start:r}}function Xl(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var $t={};$n($t,{RenderProp:()=>uc,assertType:()=>bc,compose:()=>ac,createGuard:()=>hc,createSlots:()=>cc,defineComponent:()=>dc,defineSlottedComponent:()=>fc,defineStrictComponent:()=>gc,globalStore:()=>oc,machine:()=>Zl,optimistic:()=>ec,optimisticList:()=>tc,persisted:()=>Ql,timeline:()=>nc,validateProps:()=>Vo,validators:()=>mc,withBoundary:()=>lc,withDefaults:()=>sc,withProps:()=>pc,withWrapper:()=>ic});function tt(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Zl(e){let[t,n]=C(e.initial),[r,o]=C(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=tt(e.states,i);if(!b?.on)return;let y=tt(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 D=T;if(x){let U=x(T);D={...T,...Dt(U)}}i=S,s=D,W(()=>{x&&o(D),n(S)});let B=tt(e.states,S);B?.entry&&B.entry(s)}function m(f){a.push(f),!u&&l()}let h=tt(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=tt(e.states,b);if(!y?.on)return!1;let S=tt(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 Ql(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)=>Ln(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]=C(c),g=!1,d=Q(()=>{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 ec(e){let[t,n]=C(e),[r,o]=C(!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 tc(e){let t=0,n=0,r=0,o=new Map,i=[];for(let A of e){let w={id:t++,key:n++,base:A,claims:[],visible:!0,refs:0};o.set(w.id,w),i.push(w.id)}function s(A){let w=A.claims;return w.length>0?w[w.length-1].value:A.base}function a(A,w){let N=A.claims;for(let R=N.length-1;R>=0;R--)if(N[R].opId<w)return N[R].value;return A.base}function u(A,w,N){let R={opId:w,value:N,settled:!1},O=A.claims,k=O.length;for(;k>0&&O[k-1].opId>w;)k--;return O.splice(k,0,R),R}function l(A,w){let N=A.claims.indexOf(w);N!==-1&&A.claims.splice(N,1)}function c(A){let w=A.claims,N=0;for(;N<w.length&&w[N].settled;)A.base=w[N].value,N++;N>0&&w.splice(0,N)}let[m,h]=C(i.map(A=>s(o.get(A)))),[g,d]=C(!1),f=0,b=new Set;function y(){let A=new Array(i.length);for(let w=0;w<i.length;w++)A[w]=s(o.get(i[w]));return A}function S(A){W(()=>{let w=!1;try{w=A()}finally{d(f>0),w&&h(y())}})}function v(A){let w=o.get(A);return!w||!w.visible?!1:(w.visible=!1,i=i.filter(N=>N!==A),!0)}function x(A){let w=[];for(let $ of A){let F=o.get($);!F||F.visible||b.has($)||w.push($)}if(w.length===0)return!1;let N=new Array(i.length+w.length),R=0,O=0,k=0;for(;R<i.length&&O<w.length;){let $=o.get(i[R]).key,F=o.get(w[O]).key;N[k++]=$<=F?i[R++]:w[O++]}for(;R<i.length;)N[k++]=i[R++];for(;O<w.length;)N[k++]=w[O++];for(let $ of w)o.get($).visible=!0;return i=N,!0}function T(A){for(let w of A){let N=o.get(w);N&&N.refs++}}function D(A){for(let w of A){let N=o.get(w);N&&(N.refs--,N.refs<=0&&!N.visible&&(o.delete(w),b.delete(w)))}}function B(A){if(D(A),f--,f<=0&&(f=0,b.clear(),o.size!==i.length))for(let[w,N]of o)N.visible||o.delete(w)}async function U(A,w){let N=++r,R={id:t++,key:n++,base:A,claims:[],visible:!1,refs:1},O=u(R,N,A);S(()=>(o.set(R.id,R),R.visible=!0,i=[...i,R.id],f++,!0));let k,$=!1;try{k=await w()}catch{$=!0}S(()=>{try{if($)return b.add(R.id),l(R,O),v(R.id);let F=s(R);return O.value=k,O.settled=!0,c(R),R.visible&&!Object.is(F,s(R))}finally{B([R.id])}})}async function fe(A,w){let N=++r,R=[];for(let k of i)A(a(o.get(k),N))&&R.push(k);S(()=>{if(T(R),f++,R.length===0)return!1;let k=new Set(R);for(let $ of R){let F=o.get($);F&&(F.visible=!1)}return i=i.filter($=>!k.has($)),!0});let O=!1;try{await w()}catch{O=!0}S(()=>{try{if(!O){for(let k of R)b.add(k);return!1}return x(R)}finally{B(R)}})}async function ft(A,w,N){let R=++r,O=[];for(let ne of i){let q=o.get(ne),G=a(q,R);A(G)&&O.push({row:q,nextValue:{...G,...w}})}let k=O.map(ne=>ne.row.id),$=[];S(()=>{T(k),f++;let ne=!1;for(let q of O){let G=s(q.row);$.push(u(q.row,R,q.nextValue)),q.row.visible&&!Object.is(G,s(q.row))&&(ne=!0)}return ne});let F,Ae=!1;try{F=await N()}catch{Ae=!0}S(()=>{try{let ne=!1;for(let q=0;q<$.length;q++){let G=O[q].row,nt=$[q],E=s(G);Ae?l(G,nt):(nt.value=F,nt.settled=!0),c(G),G.visible&&!Object.is(E,s(G))&&(ne=!0)}return ne}finally{B(k)}})}return{items:m,pending:g,add:U,remove:fe,update:ft}}function nc(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]=C([e]),[o,i]=C(0),s=ze(()=>n()[o()]),a=ze(()=>o()>0),u=ze(()=>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),W(()=>{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(){W(()=>{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 Io=Promise.prototype.then;function Ho(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(Io,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function Bo(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===Io?(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"?Ho(s,d,f):(i==="rejected"?d:f)()};i==="native"?Ho(s,d,f):i==="invoking"?a.push(b):queueMicrotask(i==="rejected"?d:f)}}}function rc(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 oc(e){let t=rc(e.state),[n,r]=C({...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){L(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):L(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=Dt(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,D=!0,B=()=>{if(T&&!x){!1,x=!0;return}if(x){!1;return}if(x=!0,D){S(v+1);return}let fe=()=>l(()=>S(v+1),!1);if(!U){fe();return}U.probe(()=>{T=!0,!1},fe)},U=null;try{U=Bo(i[v](n(),String(d),f,B))}catch(fe){throw T=!0,fe}finally{D=!1}U&&(U.failedEarly&&(T=!0),U.promise.then(void 0,fe=>{T=!0,L(fe,{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 ic(e,t){return n=>t(e,n)}function sc(e,t){return n=>e({...t,...n})}function ac(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function uc(e){return e.render(e.data())}function lc(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 cc(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 dc(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 pc(e,t){return n=>e(t(n))}var mc={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 Vo(e,t){let n={...e};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 gc(e){return t=>{let n=Vo(t,e.props);return e.setup(n)}}function bc(e,t,n){}function hc(e){return t=>e(t,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={...$t,...Mn,patterns:$t});})();
|
|
399
|
+
`,Ao=!1;function Nu(){!Ao&&typeof document<"u"&&(document.head.appendChild(Fe({nodes:_u})),Ao=!0)}function Ru(e={}){Nu();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?P({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[P({class:"sibu-loading-dots"},[z({class:"sibu-loading-dot"}),z({class:"sibu-loading-dot"}),z({class:"sibu-loading-dot"})]),t?z({class:"sibu-loading-text"},t):null]):P({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[P({class:"sibu-loading-spinner"}),t?z({class:"sibu-loading-text"},t):null])}var $n=Symbol.for("sibujs.actions.v1"),No=globalThis[$n]??(globalThis[$n]=new Map);function ot(e,t){No.set(e,t)}function Ro(e){return No.get(e)}function Lu(e,t,n){let r=typeof t=="string"?Ro(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 Lo=(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)},_o=["pointerup","pointerleave","pointercancel"],Mo=(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 _o)e.addEventListener(l,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let l of _o)e.removeEventListener(l,a)}},Oo=(e,t)=>{let n=o=>L(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},Po=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)},Do=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)};ot("clickOutside",Lo);ot("longPress",Mo);ot("copyOnClick",Oo);ot("autoResize",Po);ot("trapFocus",Do);function Ht(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 Ke=null;function Mu(e,t){try{let n=e(),r=Ht(n);return r&&r.then(void 0,o=>{t?t(o,"async"):Ke?Ke(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):Ke?Ke(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Ou(e,t){try{return await e()}catch(n){return t?t(n,"async"):Ke?Ke(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Pu(e){Ke=e}function Du(e,t){let n=typeof t=="function"?t():t;return C(n,K(()=>{n.style.display=e()?"":"none"},n)),n}function Ho(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}function $o(e,t,n,r,o){let i=typeof n=="function"?n():n;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===n,l=r.has(s),u=!a&&!l;return r.add(s),l&&void 0,t.nextSibling!==s&&e.insertBefore(s,t.nextSibling),{node:s,owned:u}}function $t(e,t){t&&I(e),e.parentNode?.removeChild(e)}function In(e,t,n,r){re(),Ho(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("when"),a=ge(),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?ft([l]):null;l?.parentNode&&($t(l,b),l=null);let S=h?t:o!==void 0?o:null,x=pe(()=>X(a,()=>$o(y,s,S,g,"when")));l=x.node,b=x.owned,tt(v,l?[l]:[],"when",i),d=!0},f=Ve(c,s);return C(s,()=>{p=!0,f.stop(),l&&$t(l,b),l=null}),d||queueMicrotask(Q(()=>{!p&&!d&&s.parentNode&&f.run(c)})),s}function Hu(e,t,n,r){re(),Ho(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("match"),a=ge(),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?ft([l]):null;l?.parentNode&&($t(l,b),l=null);let S=Object.hasOwn(t,h)?t[h]:o,x=pe(()=>X(a,()=>$o(y,s,S??null,g,"match")));l=x.node,b=x.owned,tt(v,l?[l]:[],"match",i),d=!0},f=Ve(c,s);return C(s,()=>{p=!0,f.stop(),l&&$t(l,b),l=null}),d||queueMicrotask(Q(()=>{!p&&!d&&s.parentNode&&f.run(c)})),s}function Io(e,t={}){let n=mt(),[r,o]=A(!n&&!ye());return!n&&!r()&&rr(()=>o(!0)),In(r,e,t.fallback)}function $u(e){let[t,n]=A(e),r=i=>{!!1||!ee()||(`${i}`,void 0)};return{provide(i){r("provide");let s=t();return n(i),()=>n(s)},use(){return t},get(){return t()},set(i){r("set"),n(i)},withContext(i,s){r("withContext");let a=t();n(i);try{let l=s();return!1,l}finally{n(a)}}}}var Bn=Symbol.for("sibujs.createId.v1"),jn=globalThis[Bn]??(globalThis[Bn]={n:0});function Bo(e="sibu"){let t=Cn();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(jn.n++,`${e}-${jn.n}`)}function jo(){jn.n=0}function bt(e,t){let n=globalThis;return n[e]??(n[e]=t())}var It=bt(Symbol.for("sibujs.components.registry.v1"),()=>new Map),Vo=bt(Symbol.for("sibujs.components.registryVersion.v1"),()=>A(0));function Fo(){let[e,t]=Vo;t(pe(e)+1)}function Iu(e,t){It.set(e,t),Fo()}function Bu(e){It.delete(e)&&Fo()}function ju(e){let t=It.get(e);return t?t():P(`[Component "${e}" not found]`)}function Vu(e){let t=P({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(Vo[0](),a=It.get(s));let l=a??`missing:${s}`;if(l===r)return;let u=pe(()=>a?a():P(`[Component "${s}" not found]`));r=l,ie(t,u)}let i=K(o,t,!0);return C(t,i),t}function zo(e){return typeof e=="function"?zo(e()):e instanceof Node?e:document.createTextNode(String(e))}function Fu(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 zu(e,t,n){n&&n.key,re();let r=document.createComment("each:anchor"),o=ge(),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,$=!1,q=!1,ne=!1,zt=n.key,_=()=>{if(ne)return;let O=e(),k=O.length,F=r.parentNode;if(!F)return;if(!q){let T=ye()?Wu(r):null;T?F.replaceChild(i,T):F.insertBefore(i,r.nextSibling),q=!0}y.length<k&&(y=new Array(k));for(let T=0;T<k;T++)y[T]=zt(O[T]);let ce=y;h.length<k&&(h=new Array(k)),p.clear(),D.clear();for(let T=0;T<k;T++)!1,D.set(ce[T],T);f=0;for(let T=0;T<k;T++){let G=ce[T],Un=d.get(G),at;if(Un!==void 0)at=Un,g[f]=at,b[f]=O[T],c[f]=T,f++;else{let[Kn,ci]=A(O[T]),[Jn,di]=A(T),qt;try{$e();try{qt=zo(X(tr(o,G),()=>t(Kn,Jn)))}finally{Ie()}}catch(fi){let pi=ce[T];qt=document.createComment(`each:error:${T}`),queueMicrotask(()=>{L(fi,{phase:"render",name:`each row (key="${String(pi)}")`,node:r.parentNode?r:void 0})})}at={node:qt,item:Kn,setItem:ci,index:Jn,setIndex:di}}p.set(G,at),h[T]=at.node}for(let[T,G]of d)p.has(T)||(I(G.node),G.node.parentNode&&F.removeChild(G.node));if(k===0){u=0;let T=d;d=p,p=T,$=!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 Z=0;for(let T=0;T<k;T++){let G=S.get(ce[T]);G!==void 0&&(x[Z]=T,E[Z]=G,Z++)}let U=Fu(E,Z);v.length<k?v=new Uint8Array(k):v.fill(0,0,k);for(let T=0;T<U.length;T++)v[x[U[T]]]=1;let J=i;for(let T=k-1;T>=0;T--){let G=h[T];v[T]||G.nextSibling!==J&&F.insertBefore(G,J),J=G}let ke=l===s?a:s;ke.length<k&&(ke.length=k);for(let T=0;T<k;T++)ke[T]=ce[T];l=ke,u=k;let Wt=d;d=p,p=Wt,$=!0,w()};function w(){if(f===0)return;let O=f;f=0,W(()=>{for(let k=0;k<O;k++){let F=g[k];F.setItem(b[k]),F.setIndex(c[k]),g[k]=void 0,b[k]=void 0}})}let N=Ve(_),R=N.stop;return C(r,()=>{if(!ne){ne=!0,R();for(let O of d.values())I(O.node),O.node.parentNode?.removeChild(O.node);i.parentNode&&i.parentNode.removeChild(i),q=!1,d.clear(),p.clear(),D.clear(),S.clear(),u=0,g.length=0,b.length=0,c.length=0,f=0}}),$||queueMicrotask(Q(()=>{!$&&!ne&&r.parentNode&&N.run(_)})),r}function Wu(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 qu(e){re();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"||Wo(t,r);else Wo(t,n);return t}function Wo(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),C(n,we(n,t));return}e.appendChild(document.createTextNode(String(t)))}var Uu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),qo=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Uo=new WeakMap;function Ku(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=Uu.has(f),v=n[r]==="/";if(v&&r++,r<o&&r++,y||v)b.push({t:0,el:{tag:f,svg:qo.has(f),attrs:h,children:[]}});else{let S=g();if(vr(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:qo.has(f),attrs:h,children:S}})}}else p(b);return b}return g()}function Vn(e,t){let n=lt(e.tag,e.svg?H:void 0);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:an(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?C(n,dt(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):!1;break}case 4:an(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(Vn(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,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 Ko(e,...t){let n=Uo.get(e);return n||(n=Ku(e),Uo.set(e,n)),Go(n,t)}function Jo(e,t){return Go(e,t)}function Go(e,t){if(re(),e.length===1&&e[0].t===0)return Vn(e[0].el,t);let n=lt("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(Vn(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,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 Ju(e,t,n){re();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&me()&&void 0;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&&(I(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(v))}}f.insertBefore(h,r.nextSibling),l=h,u=!0},g=Ve(p),b=g.stop;return u||queueMicrotask(Q(()=>{!u&&r.parentNode&&g.run(p)})),C(r,()=>{d=!0,b();for(let c of o.values())I(c),c.parentNode&&c.parentNode.removeChild(c);o.clear(),i.length=0,l=null}),r}function Gu(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=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=lr(()=>{let d=e();return i(d),d}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&ue(l,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(l&&ue(l,"app:unmount",{rootElement:s}),u){Yu(u.start,u.end);return}I(s),s.parentNode?.removeChild(s)}}}function Yu(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=Se;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){Ae("mount",Se,1);return}I(a),a.parentNode===n&&n.removeChild(a)}s||L(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function Zu(e,t){re();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(()=>{L(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),C(n,()=>{i=!0,o&&(I(o),o.remove(),o=null)}),n}function Xu(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Yo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function Qu(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=Yo(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 ec(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Ue(r)||Qe(r)}function i(){if(Be(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=Yo(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 tc(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=te(()=>{if(l(),p)return;b();let f=++d,h=typeof AbortController<"u"?new AbortController:null;g=h,W(()=>{i(!0),a(null)});let y=()=>p||f!==d,v;try{v=e({signal:h?h.signal:void 0})}catch(S){if(y())return;W(()=>{a(S),i(!1)});return}v.then(S=>{y()||(g=null,W(()=>{r(S),i(!1)}))},S=>{y()||(g=null,W(()=>{a(S),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{p||u(f=>f+1)},dispose:()=>{p||(p=!0,c(),b())}}}function it(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)||!it(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)=>it(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&&it(e.cause,a.cause,n)&&Zo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:Zo(r,o,n)}function Zo(e,t,n){let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(t,i)&&it(e[i],t[i],n))}function nc(e){return A(e,{equals:(t,n)=>it(t,n)})}function Je(e,t){let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,l=()=>{o._d||s||(o._d=!0)};l._c=1,l._sig=o;let u=()=>{let c=e();o._v=r&&o._init&&r(o._v,c)?o._v:c,o._d=!1,o._init=!0};try{Xe(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(c){throw s=!0,je(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{Le(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&&je(l)}d&&!s&&!Object.is(c,o._v)&&ue(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 qr()||s?(o._d&&(p(),a!==void 0&&g()),o._v):(o._d&&(p(),a!==void 0&&(Be(o),g())),Be(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,je(l);let c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(c)try{c.emit("computed:destroy",{signal:o,getter:b})}catch{}},d&&ue(d,"computed:create",{signal:o,name:n,getter:b}),b}function rc(e){let[t,n]=A(e);return{get current(){return t()},set current(r){n(r)}}}function Xo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function oc(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(l=>{let[u,d]=A(e[l]);Xo(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=>{Xo(l,u,t[u][0]())}),l};return[n,{setState:l=>{let u=r(),d=typeof l=="function"?l(u):l;W(()=>{Object.entries(d).forEach(([p,g])=>{Object.hasOwn(t,p)&&t[p][1](g)})})},reset:()=>{W(()=>{Object.keys(e).forEach(l=>{let u=t[l][1];u(e[l])})})},subscribe:l=>{let u=!0;return te(()=>{let d=r();if(u){u=!1;return}$e();try{l(d)}finally{Ie()}})},subscribeKey:(l,u)=>{let d,p=!0;return te(()=>{let g=t[l][0]();if(p){d=g,p=!1;return}if(!Object.is(g,d)){let b=d;d=g,$e();try{u(g,b)}finally{Ie()}}})},getSnapshot:r}]}function ic(e,t){if(ee())return()=>{};let n,r=!0;return Xe(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,$e();try{t(s,a)}finally{Ie()}}})}function sc(e,t,n){return[Je(e,n),i=>{W(()=>t(i))}]}function ac(e){let t=e();return me()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function lc(e){if(!me())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 Qo(e,t){return ee()?()=>{}:K(e,t)}var Fn="data-sibu-enhanced",zn=new WeakMap;function ei(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=Se){let i=r.length-o+e.length;e.length=0,Ae(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var ti=["text","attr","class","show","on","cleanup"];function ni(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 ht(e,t){return Qo(t,e)}function uc(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 cc(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 dc(e,t,n,r){let o=`ctx.each[${r}]`;if(me())for(let i of Object.keys(n))ti.includes(i),`${o}${i}${ti.join(", ")}`;if(n.text!==void 0&&(n.text,`${o}`,e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];`${o}${i}`,e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];`${o}${i}`,e.classed(t,i,s)}if(n.show!==void 0&&(n.show,`${o}`,e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];`${o}${String(i)}`,e.on(t,i,s)}n.cleanup!==void 0&&(n.cleanup,`${o}`,e.cleanup(n.cleanup))}function Bt(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(Fn)==="true")return me()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=g=>s?!0:!1,l=(g,b,c)=>{if(a(g))return;let f=ni(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=>ni(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(ht(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(ht(f,()=>{let h=c(),y=h==null?null:String(h);de(f,b,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(g,b,c)=>{l("classed",g,f=>{r.push(ht(f,()=>{f.classList.toggle(b,!!c())}))})},show:(g,b)=>{l("show",g,c=>{let f=c.hidden;r.push(ht(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(ht(f,()=>{cc(h,y())}));let x=()=>v(uc(h));h.addEventListener(S,x),r.push(()=>h.removeEventListener(S,x))})},each:(g,b)=>{if(a("each"))return;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&&dc(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=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(g){throw ei(r,"enhance"),s=!0,g}typeof d=="function"&&r.push(d);let p=()=>{i||(i=!0,zn.get(n)===o&&(zn.delete(n),n.removeAttribute(Fn)),ut(n,p),ei(r,"enhance"),s=!0)};return C(n,p),zn.set(n,o),n.setAttribute(Fn,"true"),p}function fc(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Bt(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 pc=/^[A-Za-z0-9_-]+$/,ri=Symbol.for("sibujs.islands.lazy"),jt=bt(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function mc(e){return e[ri]=!0,e}function gc(e,t){if(!pc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);jt.set(e,t)}function bc(e){jt.delete(e)}async function hc(e){if(typeof e=="function"&&e[ri]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function yc(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(!jt.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=jt.get(s);d&&hc(d).then(p=>{if(!o){if(!p){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=Bt(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(Sc(u,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Sc(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 vc=new Set(["__proto__","constructor","prototype"]);function Wn(e){return vc.has(e)}function Vt(e){let t={};for(let n of Object.keys(e))Wn(n)||(t[n]=e[n]);return t}function oi(e){return e}var Bm=1024*1024;function xc(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=Xe(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,l())},u}var ii=16;function wc(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:ii*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,ii)}function Tc(){let[e,t]=A(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=l=>{s(),L(l,{phase:"async",name:"transition"})};wc(()=>{try{let l=Ht(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function Ec(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var Ft={};Gn(Ft,{RenderProp:()=>Dc,assertType:()=>zc,compose:()=>Pc,createGuard:()=>Wc,createSlots:()=>$c,defineComponent:()=>Ic,defineSlottedComponent:()=>Bc,defineStrictComponent:()=>Fc,globalStore:()=>Lc,machine:()=>kc,optimistic:()=>Ac,optimisticList:()=>_c,persisted:()=>Cc,timeline:()=>Nc,validateProps:()=>ui,validators:()=>Vc,withBoundary:()=>Hc,withDefaults:()=>Oc,withProps:()=>jc,withWrapper:()=>Mc});function st(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function kc(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=st(e.states,i);if(!h?.on)return;let y=st(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 q=x(E);D={...E,...Vt(q)}}i=v,s=D,W(()=>{x&&o(D),n(v)});let $=st(e.states,v);$?.entry&&$.entry(s)}function p(f){a.push(f),!l&&u()}let g=st(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=st(e.states,h);if(!y?.on)return!1;let v=st(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 Cc(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)=>Wn(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=te(()=>{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 Ac(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 _c(e){let t=0,n=0,r=0,o=new Map,i=[];for(let _ of e){let w={id:t++,key:n++,base:_,claims:[],visible:!0,refs:0};o.set(w.id,w),i.push(w.id)}function s(_){let w=_.claims;return w.length>0?w[w.length-1].value:_.base}function a(_,w){let N=_.claims;for(let R=N.length-1;R>=0;R--)if(N[R].opId<w)return N[R].value;return _.base}function l(_,w,N){let R={opId:w,value:N,settled:!1},j=_.claims,O=j.length;for(;O>0&&j[O-1].opId>w;)O--;return j.splice(O,0,R),R}function u(_,w){let N=_.claims.indexOf(w);N!==-1&&_.claims.splice(N,1)}function d(_){let w=_.claims,N=0;for(;N<w.length&&w[N].settled;)_.base=w[N].value,N++;N>0&&w.splice(0,N)}let[p,g]=A(i.map(_=>s(o.get(_)))),[b,c]=A(!1),f=0,h=new Set;function y(){let _=new Array(i.length);for(let w=0;w<i.length;w++)_[w]=s(o.get(i[w]));return _}function v(_){W(()=>{let w=!1;try{w=_()}finally{c(f>0),w&&g(y())}})}function S(_){let w=o.get(_);return!w||!w.visible?!1:(w.visible=!1,i=i.filter(N=>N!==_),!0)}function x(_){let w=[];for(let k of _){let F=o.get(k);!F||F.visible||h.has(k)||w.push(k)}if(w.length===0)return!1;let N=new Array(i.length+w.length),R=0,j=0,O=0;for(;R<i.length&&j<w.length;){let k=o.get(i[R]).key,F=o.get(w[j]).key;N[O++]=k<=F?i[R++]:w[j++]}for(;R<i.length;)N[O++]=i[R++];for(;j<w.length;)N[O++]=w[j++];for(let k of w)o.get(k).visible=!0;return i=N,!0}function E(_){for(let w of _){let N=o.get(w);N&&N.refs++}}function D(_){for(let w of _){let N=o.get(w);N&&(N.refs--,N.refs<=0&&!N.visible&&(o.delete(w),h.delete(w)))}}function $(_){if(D(_),f--,f<=0&&(f=0,h.clear(),o.size!==i.length))for(let[w,N]of o)N.visible||o.delete(w)}async function q(_,w){let N=++r,R={id:t++,key:n++,base:_,claims:[],visible:!1,refs:1},j=l(R,N,_);v(()=>(o.set(R.id,R),R.visible=!0,i=[...i,R.id],f++,!0));let O,k=!1;try{O=await w()}catch{k=!0}v(()=>{try{if(k)return h.add(R.id),u(R,j),S(R.id);let F=s(R);return j.value=O,j.settled=!0,d(R),R.visible&&!Object.is(F,s(R))}finally{$([R.id])}})}async function ne(_,w){let N=++r,R=[];for(let O of i)_(a(o.get(O),N))&&R.push(O);v(()=>{if(E(R),f++,R.length===0)return!1;let O=new Set(R);for(let k of R){let F=o.get(k);F&&(F.visible=!1)}return i=i.filter(k=>!O.has(k)),!0});let j=!1;try{await w()}catch{j=!0}v(()=>{try{if(!j){for(let O of R)h.add(O);return!1}return x(R)}finally{$(R)}})}async function zt(_,w,N){let R=++r,j=[];for(let Z of i){let U=o.get(Z),J=a(U,R);_(J)&&j.push({row:U,nextValue:{...J,...w}})}let O=j.map(Z=>Z.row.id),k=[];v(()=>{E(O),f++;let Z=!1;for(let U of j){let J=s(U.row);k.push(l(U.row,R,U.nextValue)),U.row.visible&&!Object.is(J,s(U.row))&&(Z=!0)}return Z});let F,ce=!1;try{F=await N()}catch{ce=!0}v(()=>{try{let Z=!1;for(let U=0;U<k.length;U++){let J=j[U].row,ke=k[U],Wt=s(J);ce?u(J,ke):(ke.value=F,ke.settled=!0),d(J),J.visible&&!Object.is(Wt,s(J))&&(Z=!0)}return Z}finally{$(O)}})}return{items:p,pending:b,add:q,remove:ne,update:zt}}function Nc(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=Je(()=>n()[o()]),a=Je(()=>o()>0),l=Je(()=>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),W(()=>{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(){W(()=>{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 ai=Promise.prototype.then;function si(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(ai,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function li(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===ai?(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"?si(s,c,f):(i==="rejected"?c:f)()};i==="native"?si(s,c,f):i==="invoking"?a.push(h):queueMicrotask(i==="rejected"?c:f)}}}function Rc(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 Lc(e){let t=Rc(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){L(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):L(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=Vt(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,$=()=>{if(E&&!x){!1,x=!0;return}if(x){!1;return}if(x=!0,D){v(S+1);return}let ne=()=>u(()=>v(S+1),!1);if(!q){ne();return}q.probe(()=>{E=!0,!1},ne)},q=null;try{q=li(i[S](n(),String(c),f,$))}catch(ne){throw E=!0,ne}finally{D=!1}q&&(q.failedEarly&&(E=!0),q.promise.then(void 0,ne=>{E=!0,L(ne,{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 Mc(e,t){return n=>t(e,n)}function Oc(e,t){return n=>e({...t,...n})}function Pc(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function Dc(e){return e.render(e.data())}function Hc(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 $c(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 Ic(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function Bc(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function jc(e,t){return n=>e(t(n))}var Vc={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 ui(e,t){let n={...e};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 Fc(e){return t=>{let n=ui(t,e.props);return e.setup(n)}}function zc(e,t,n){}function Wc(e){return t=>e(t,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={...Ft,...qn,patterns:Ft});})();
|