sibujs 4.3.0 → 4.4.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 +23 -4
- package/dist/browser.cjs +1 -1
- package/dist/browser.js +4 -4
- package/dist/build.cjs +1 -1
- package/dist/build.js +10 -10
- package/dist/cdn.dev.global.js +10 -10
- package/dist/cdn.full.dev.global.js +400 -0
- package/dist/cdn.full.global.js +398 -0
- package/dist/cdn.global.js +10 -10
- package/dist/{chunk-7UK6BSAT.js → chunk-36S2YPP4.js} +1 -1
- package/dist/{chunk-TSL64O5L.js → chunk-3BTTCZ5J.js} +1 -1
- package/dist/{chunk-ZVYNIUOG.js → chunk-4Z3SPQ67.js} +3 -3
- package/dist/{chunk-7BPN4MXR.js → chunk-6GSIXTWX.js} +4 -4
- package/dist/{chunk-7BJLKDBI.js → chunk-7GIHSAWB.js} +1 -1
- package/dist/{chunk-L4B3Y3OM.js → chunk-7NBDXVHS.js} +1 -1
- package/dist/{chunk-2LSY4WDM.js → chunk-ADM46X22.js} +9 -9
- package/dist/{chunk-G7GPNB6N.js → chunk-HFCOH2GN.js} +4 -4
- package/dist/{chunk-7GQIRV27.js → chunk-HQSEH5F6.js} +3 -3
- package/dist/{chunk-USS5ENJ2.js → chunk-LQFGQNMV.js} +3 -3
- package/dist/{chunk-UD6YE2GW.js → chunk-LYVUX7NT.js} +2 -2
- package/dist/{chunk-AAHT6AKT.js → chunk-M2F7TZHH.js} +2 -2
- package/dist/{chunk-MYA5HEK5.js → chunk-NVNJH22U.js} +1 -1
- package/dist/{chunk-XGCZ45NH.js → chunk-PNIRUQ4C.js} +2 -2
- package/dist/{chunk-VJE6DDYM.js → chunk-R25EFXXC.js} +40 -26
- package/dist/{chunk-IYHM4FWD.js → chunk-RR7M3FHM.js} +1 -1
- package/dist/{chunk-RE6KLGMV.js → chunk-SKPTERHP.js} +1 -1
- package/dist/{chunk-R4EF7V3K.js → chunk-UCALUKB5.js} +4 -4
- package/dist/{chunk-7UBG6LDP.js → chunk-VCTAEPSB.js} +1 -1
- package/dist/{chunk-3E5YNK2F.js → chunk-W2EQ7X2L.js} +1 -1
- package/dist/{chunk-GZYQNIPS.js → chunk-XLO7SLIX.js} +5 -5
- package/dist/{contracts-Hg6ITAEF.d.cts → contracts-DBdg9J_a.d.cts} +25 -4
- package/dist/{contracts-Hg6ITAEF.d.ts → contracts-DBdg9J_a.d.ts} +25 -4
- package/dist/data.cjs +1 -1
- package/dist/data.js +6 -6
- package/dist/devtools.cjs +1 -1
- package/dist/devtools.js +4 -4
- package/dist/ecosystem.cjs +1 -1
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +36 -27
- package/dist/extras.d.cts +1 -1
- package/dist/extras.d.ts +1 -1
- package/dist/extras.js +20 -20
- package/dist/index.cjs +1 -1
- package/dist/index.js +10 -10
- package/dist/motion.cjs +1 -1
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +36 -27
- package/dist/patterns.d.cts +1 -1
- package/dist/patterns.d.ts +1 -1
- package/dist/patterns.js +6 -6
- package/dist/performance.cjs +1 -1
- package/dist/performance.js +4 -4
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.js +6 -6
- package/dist/ssr.cjs +1 -1
- package/dist/ssr.js +7 -7
- package/dist/testing.cjs +1 -1
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +36 -27
- package/dist/ui.d.cts +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +7 -7
- package/dist/widgets.cjs +1 -1
- package/dist/widgets.js +6 -6
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -226,10 +226,29 @@ Either way, the API is on `window.Sibu`:
|
|
|
226
226
|
Develop against `cdn.dev.global.js` and swap the one line to ship. The runtime
|
|
227
227
|
behaviour is identical; only the warnings differ.
|
|
228
228
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
229
|
+
### Patterns on the CDN
|
|
230
|
+
|
|
231
|
+
A `<script>` tag resolves no specifiers, so a no-build page cannot reach
|
|
232
|
+
`sibujs/patterns` — `machine` and its siblings were simply unavailable. They
|
|
233
|
+
ship in a second bundle, which is a superset of the one above:
|
|
234
|
+
|
|
235
|
+
```html
|
|
236
|
+
<script src="https://unpkg.com/sibujs@latest/dist/cdn.full.global.js"></script>
|
|
237
|
+
<script>
|
|
238
|
+
const { signal, machine } = window.Sibu; // Sibu.patterns is also there
|
|
239
|
+
</script>
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Load **one or the other**, never both. It is a separate file rather than a
|
|
243
|
+
merge so the default bundle keeps its byte budget: patterns costs ~13% gzip,
|
|
244
|
+
and most pages never call any of it. `cdn.full.dev.global.js` is the
|
|
245
|
+
development counterpart, and both are reachable as `sibujs/cdn-full` and
|
|
246
|
+
`sibujs/cdn-full-dev`.
|
|
247
|
+
|
|
248
|
+
A bundled app needs neither file — import from `"sibujs"` and let your
|
|
249
|
+
bundler define `__SIBU_DEV__` per build (the Vite and webpack plugins in
|
|
250
|
+
`sibujs/build` do this for you). The two CDN files exist because a `<script>`
|
|
251
|
+
tag has no bundler to make that choice.
|
|
233
252
|
|
|
234
253
|
---
|
|
235
254
|
|
package/dist/browser.cjs
CHANGED
|
@@ -619,7 +619,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
619
619
|
}
|
|
620
620
|
|
|
621
621
|
// src/reactivity/track.ts
|
|
622
|
-
var _runtimeVersion = true ? "4.
|
|
622
|
+
var _runtimeVersion = true ? "4.4.0" : "dev";
|
|
623
623
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
624
624
|
function resolveReactiveApi() {
|
|
625
625
|
const g = globalThis;
|
package/dist/browser.js
CHANGED
|
@@ -35,14 +35,14 @@ import {
|
|
|
35
35
|
visibility,
|
|
36
36
|
wakeLock,
|
|
37
37
|
windowSize
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-LYVUX7NT.js";
|
|
39
39
|
import "./chunk-H3SRKIYX.js";
|
|
40
40
|
import "./chunk-52XFPGSN.js";
|
|
41
41
|
import "./chunk-7ZHH77QA.js";
|
|
42
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-7GIHSAWB.js";
|
|
43
43
|
import "./chunk-5DXA2J44.js";
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-NVNJH22U.js";
|
|
45
|
+
import "./chunk-3BTTCZ5J.js";
|
|
46
46
|
import "./chunk-2WLZ6757.js";
|
|
47
47
|
export {
|
|
48
48
|
animationFrame,
|
package/dist/build.cjs
CHANGED
|
@@ -2246,7 +2246,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
2246
2246
|
}
|
|
2247
2247
|
|
|
2248
2248
|
// src/reactivity/track.ts
|
|
2249
|
-
var _runtimeVersion = true ? "4.
|
|
2249
|
+
var _runtimeVersion = true ? "4.4.0" : "dev";
|
|
2250
2250
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
2251
2251
|
function resolveReactiveApi() {
|
|
2252
2252
|
const g2 = globalThis;
|
package/dist/build.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_exports
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ADM46X22.js";
|
|
4
|
+
import "./chunk-36S2YPP4.js";
|
|
5
5
|
import "./chunk-NIOYEGBQ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-RR7M3FHM.js";
|
|
7
7
|
import "./chunk-CCSJMTRN.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-7NBDXVHS.js";
|
|
9
|
+
import "./chunk-PNIRUQ4C.js";
|
|
10
|
+
import "./chunk-VCTAEPSB.js";
|
|
11
|
+
import "./chunk-W2EQ7X2L.js";
|
|
12
12
|
import "./chunk-IXKSNWV5.js";
|
|
13
13
|
import "./chunk-7ZHH77QA.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-7GIHSAWB.js";
|
|
15
15
|
import "./chunk-5DXA2J44.js";
|
|
16
16
|
import "./chunk-QKRPLZ2V.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-NVNJH22U.js";
|
|
18
|
+
import "./chunk-3BTTCZ5J.js";
|
|
19
19
|
import "./chunk-2WLZ6757.js";
|
|
20
20
|
|
|
21
21
|
// src/build/compileTemplates.ts
|
package/dist/cdn.dev.global.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";var Sibu=(()=>{var it=Object.defineProperty;var Fs=Object.getOwnPropertyDescriptor;var zs=Object.getOwnPropertyNames;var Vs=Object.prototype.hasOwnProperty;var st=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var pn=(e,n)=>{for(var t in n)it(e,t,{get:n[t],enumerable:!0})},qs=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of zs(n))!Vs.call(e,o)&&o!==t&&it(e,o,{get:()=>n[o],enumerable:!(r=Fs(n,o))||r.enumerable});return e};var Ws=e=>qs(it({},"__esModule",{value:!0}),e);var Ec={};pn(Ec,{DynamicComponent:()=>Zi,ErrorBoundary:()=>$i,ErrorDisplay:()=>tt,Fragment:()=>ts,KeepAlive:()=>os,Loading:()=>Ii,MAX_DRAIN_TEARDOWNS:()=>Ce,Portal:()=>ss,SVG_NS:()=>N,Suspense:()=>Ct,__resetIdCounter:()=>Wi,a:()=>Tr,abbr:()=>Er,action:()=>Pi,address:()=>sr,area:()=>Jr,array:()=>cs,article:()=>er,aside:()=>ir,asyncDerived:()=>ls,audio:()=>Gr,autoResize:()=>Gt,b:()=>wr,base:()=>Wo,batch:()=>F,bdi:()=>kr,bdo:()=>_r,bindDynamic:()=>Tt,blockquote:()=>fr,body:()=>Zn,br:()=>Ar,button:()=>Ee,canvas:()=>uo,caption:()=>go,catchError:()=>Bi,catchErrorAsync:()=>Fi,center:()=>pi,checkLeaks:()=>gn,circle:()=>Uo,cite:()=>Cr,clickOutside:()=>Kt,clipPath:()=>oi,code:()=>Qe,col:()=>bo,colgroup:()=>ho,context:()=>Vi,copyOnClick:()=>Jt,createId:()=>qi,customElement:()=>bi,data:()=>Nr,datalist:()=>ko,dd:()=>pr,deepEqual:()=>_e,deepSignal:()=>ds,defer:()=>Ns,defs:()=>ri,del:()=>po,derived:()=>nt,details:()=>Po,dfn:()=>Lr,dialog:()=>Bo,disableSSR:()=>Ot,dispose:()=>H,div:()=>k,dl:()=>mr,dt:()=>gr,each:()=>Qi,effect:()=>V,ellipse:()=>Jo,em:()=>Rr,embed:()=>eo,enableSSR:()=>It,enhance:()=>Pe,enhanceAll:()=>Ss,enqueueBatchedSignal:()=>ae,external:()=>Ci,fieldset:()=>_o,figcaption:()=>br,figure:()=>hr,font:()=>mi,footer:()=>nr,form:()=>Ao,g:()=>Go,getAction:()=>jt,getRequestScopedCache:()=>Dt,getRuntimeErrorHandler:()=>ut,getSSRStore:()=>se,getSlot:()=>as,h1:()=>ar,h2:()=>cr,h3:()=>Ze,h4:()=>ur,h5:()=>lr,h6:()=>dr,head:()=>Yn,header:()=>tr,hr:()=>yr,html:()=>nn,i:()=>Mr,iframe:()=>to,img:()=>Yr,input:()=>Co,ins:()=>mo,isBatching:()=>Ai,isSSR:()=>W,kbd:()=>Hr,label:()=>No,lazy:()=>At,lazyIsland:()=>ws,legend:()=>Lo,li:()=>vr,line:()=>Yo,linearGradient:()=>ai,link:()=>jo,longPress:()=>Ut,main:()=>or,map:()=>Zr,mark:()=>$r,marker:()=>fi,marquee:()=>gi,mask:()=>ii,match:()=>Ji,math:()=>co,menu:()=>Fo,meta:()=>Ko,meter:()=>Ro,mount:()=>is,mountIslands:()=>As,nav:()=>rr,nextTick:()=>Rs,noscript:()=>lo,object:()=>no,ol:()=>xr,on:()=>ki,onCleanup:()=>xi,onMount:()=>$e,onUnmount:()=>vi,optgroup:()=>Mo,option:()=>Ho,output:()=>$o,p:()=>Ye,param:()=>ro,path:()=>Zo,pattern:()=>si,picture:()=>oo,polygon:()=>Xo,polyline:()=>Qo,portal:()=>io,pre:()=>Xe,progress:()=>Do,q:()=>Dr,radialGradient:()=>ci,reactiveArray:()=>us,rect:()=>ei,ref:()=>fs,registerAction:()=>me,registerComponent:()=>Gi,registerDisposer:()=>T,registerIsland:()=>ks,replaceChildrenSafely:()=>z,reportDrainRunaway:()=>Ne,reportError:()=>_,resolveComponent:()=>en,retrack:()=>Q,rp:()=>Ir,rt:()=>Or,ruby:()=>Pr,runInSSRContext:()=>Pt,s:()=>Br,samp:()=>Fr,script:()=>fo,section:()=>Qn,select:()=>Io,setGlobalErrorHandler:()=>zi,setMaxDrainIterations:()=>St,setRuntimeErrorHandler:()=>ct,show:()=>ji,signal:()=>C,slot:()=>Vo,small:()=>zr,source:()=>so,span:()=>$,stop:()=>ui,store:()=>ps,strict:()=>bs,strictEffect:()=>hs,strong:()=>Vr,style:()=>ie,sub:()=>qr,summary:()=>zo,sup:()=>Wr,svg:()=>ao,symbol:()=>di,table:()=>yo,tagFactory:()=>u,takePendingError:()=>He,tbody:()=>vo,td:()=>xo,template:()=>qo,text:()=>ti,textarea:()=>Oo,tfoot:()=>So,th:()=>To,thead:()=>Eo,time:()=>jr,title:()=>Xn,tr:()=>wo,track:()=>Xr,transition:()=>Ls,trapFocus:()=>Yt,trustHTML:()=>sn,tspan:()=>ni,u:()=>Kr,ul:()=>Sr,unregisterComponent:()=>Yi,unregisterDisposer:()=>Ve,unregisterIsland:()=>_s,untracked:()=>ve,use:()=>li,var_:()=>Ur,video:()=>Qr,watch:()=>ms,when:()=>Ui,withSSR:()=>Bt,writable:()=>gs});var an={};pn(an,{DynamicComponent:()=>Zi,ErrorBoundary:()=>$i,ErrorDisplay:()=>tt,Fragment:()=>ts,KeepAlive:()=>os,Loading:()=>Ii,MAX_DRAIN_TEARDOWNS:()=>Ce,Portal:()=>ss,SVG_NS:()=>N,Suspense:()=>Ct,__resetIdCounter:()=>Wi,a:()=>Tr,abbr:()=>Er,action:()=>Pi,address:()=>sr,area:()=>Jr,array:()=>cs,article:()=>er,aside:()=>ir,asyncDerived:()=>ls,audio:()=>Gr,autoResize:()=>Gt,b:()=>wr,base:()=>Wo,batch:()=>F,bdi:()=>kr,bdo:()=>_r,bindDynamic:()=>Tt,blockquote:()=>fr,body:()=>Zn,br:()=>Ar,button:()=>Ee,canvas:()=>uo,caption:()=>go,catchError:()=>Bi,catchErrorAsync:()=>Fi,center:()=>pi,checkLeaks:()=>gn,circle:()=>Uo,cite:()=>Cr,clickOutside:()=>Kt,clipPath:()=>oi,code:()=>Qe,col:()=>bo,colgroup:()=>ho,context:()=>Vi,copyOnClick:()=>Jt,createId:()=>qi,customElement:()=>bi,data:()=>Nr,datalist:()=>ko,dd:()=>pr,deepEqual:()=>_e,deepSignal:()=>ds,defer:()=>Ns,defs:()=>ri,del:()=>po,derived:()=>nt,details:()=>Po,dfn:()=>Lr,dialog:()=>Bo,disableSSR:()=>Ot,dispose:()=>H,div:()=>k,dl:()=>mr,dt:()=>gr,each:()=>Qi,effect:()=>V,ellipse:()=>Jo,em:()=>Rr,embed:()=>eo,enableSSR:()=>It,enhance:()=>Pe,enhanceAll:()=>Ss,enqueueBatchedSignal:()=>ae,external:()=>Ci,fieldset:()=>_o,figcaption:()=>br,figure:()=>hr,font:()=>mi,footer:()=>nr,form:()=>Ao,g:()=>Go,getAction:()=>jt,getRequestScopedCache:()=>Dt,getRuntimeErrorHandler:()=>ut,getSSRStore:()=>se,getSlot:()=>as,h1:()=>ar,h2:()=>cr,h3:()=>Ze,h4:()=>ur,h5:()=>lr,h6:()=>dr,head:()=>Yn,header:()=>tr,hr:()=>yr,html:()=>nn,i:()=>Mr,iframe:()=>to,img:()=>Yr,input:()=>Co,ins:()=>mo,isBatching:()=>Ai,isSSR:()=>W,kbd:()=>Hr,label:()=>No,lazy:()=>At,lazyIsland:()=>ws,legend:()=>Lo,li:()=>vr,line:()=>Yo,linearGradient:()=>ai,link:()=>jo,longPress:()=>Ut,main:()=>or,map:()=>Zr,mark:()=>$r,marker:()=>fi,marquee:()=>gi,mask:()=>ii,match:()=>Ji,math:()=>co,menu:()=>Fo,meta:()=>Ko,meter:()=>Ro,mount:()=>is,mountIslands:()=>As,nav:()=>rr,nextTick:()=>Rs,noscript:()=>lo,object:()=>no,ol:()=>xr,on:()=>ki,onCleanup:()=>xi,onMount:()=>$e,onUnmount:()=>vi,optgroup:()=>Mo,option:()=>Ho,output:()=>$o,p:()=>Ye,param:()=>ro,path:()=>Zo,pattern:()=>si,picture:()=>oo,polygon:()=>Xo,polyline:()=>Qo,portal:()=>io,pre:()=>Xe,progress:()=>Do,q:()=>Dr,radialGradient:()=>ci,reactiveArray:()=>us,rect:()=>ei,ref:()=>fs,registerAction:()=>me,registerComponent:()=>Gi,registerDisposer:()=>T,registerIsland:()=>ks,replaceChildrenSafely:()=>z,reportDrainRunaway:()=>Ne,reportError:()=>_,resolveComponent:()=>en,retrack:()=>Q,rp:()=>Ir,rt:()=>Or,ruby:()=>Pr,runInSSRContext:()=>Pt,s:()=>Br,samp:()=>Fr,script:()=>fo,section:()=>Qn,select:()=>Io,setGlobalErrorHandler:()=>zi,setMaxDrainIterations:()=>St,setRuntimeErrorHandler:()=>ct,show:()=>ji,signal:()=>C,slot:()=>Vo,small:()=>zr,source:()=>so,span:()=>$,stop:()=>ui,store:()=>ps,strict:()=>bs,strictEffect:()=>hs,strong:()=>Vr,style:()=>ie,sub:()=>qr,summary:()=>zo,sup:()=>Wr,svg:()=>ao,symbol:()=>di,table:()=>yo,tagFactory:()=>u,takePendingError:()=>He,tbody:()=>vo,td:()=>xo,template:()=>qo,text:()=>ti,textarea:()=>Oo,tfoot:()=>So,th:()=>To,thead:()=>Eo,time:()=>jr,title:()=>Xn,tr:()=>wo,track:()=>Xr,transition:()=>Ls,trapFocus:()=>Yt,trustHTML:()=>sn,tspan:()=>ni,u:()=>Kr,ul:()=>Sr,unregisterComponent:()=>Yi,unregisterDisposer:()=>Ve,unregisterIsland:()=>_s,untracked:()=>ve,use:()=>li,var_:()=>Ur,video:()=>Qr,watch:()=>ms,when:()=>Ui,withSSR:()=>Bt,writable:()=>gs});var mn=Symbol.for("sibujs.runtime-errors.v1");function at(){let e=globalThis,n=e[mn];if(n)return n;let t={handler:null,handlerDepth:0};return e[mn]=t,t}function ct(e){let n=at(),t=n.handler;return n.handler=e,t}function ut(){return at().handler}function lt(e){if(e instanceof Error)return e;let n=typeof e=="string"?e:`Non-Error value thrown: ${js(e)}`;return new Error(n,{cause:e})}function js(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 Ks(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Us=Symbol.for("sibujs.reactive.v1");function Js(e){let n=globalThis[Us];return n?.untracked?n.untracked(e):e()}var Gs="sibu:error-propagate";function Ys(e,n){let t=n.node;if(!t||typeof CustomEvent>"u")return!1;let r=Zs(t);if(!r)return!1;try{let o=new CustomEvent(Gs,{bubbles:!0,cancelable:!0,detail:{error:e,context:n}});return r.dispatchEvent(o)===!1}catch{return!1}}function Zs(e){let t=e;for(;t;){if(t.nodeType===1&&typeof t.dispatchEvent=="function")return t;t=t.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function Xs(e,n){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Ks(n)}: ${e.message}`,e)}function _(e,n){let t=lt(e);Js(()=>{if(Ys(t,n))return;let r=at(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:t,n);return}catch(i){if(typeof console<"u"){let s=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${s}`,i)}}finally{r.handlerDepth--}}Xs(t,n)})}function Y(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function R(e,n){if(!e)throw new Error(`[SibuJS] ${n}`)}function j(e){{let n=e();n&&console.warn(`[SibuJS] ${n}`)}}function M(e){console.warn(`[SibuJS] ${e}`)}var X=new WeakMap,Ce=1e4;function Ne(e,n,t){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${n} teardowns with ${t} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:n,remaining:t})}var ue=0;function T(e,n){let t=X.get(e);t||(t=[],X.set(e,t)),t.push(n),ue++}function Ve(e,n){let t=X.get(e);if(!t)return;let r=t.indexOf(n);r!==-1&&(t.splice(r,1),ue--,t.length===0&&X.delete(e))}function H(e){let n=[e],t=[];for(;n.length>0;){let r=n.pop();t.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}for(let r=t.length-1;r>=0;r--){let o=t[r];if(X.has(o)){let i=0,s=!1;for(;!s;){let a=X.get(o);if(!a||a.length===0)break;let c=a.slice();X.delete(o),ue-=c.length;for(let l=0;l<c.length;l++){if(i>=Ce){let d=c.slice(l),p=X.get(o);X.set(o,p?d.concat(p):d),ue+=d.length,Ne("dispose",i,d.length+(p?.length??0)),s=!0;break}i++;try{c[l]()}catch(d){_(d,{phase:"cleanup",name:"disposer"})}}}}}}function z(e,...n){for(let r=0;r<n.length;r++){let o=n[r];o.parentNode?.removeChild(o)}let t=Array.from(e.childNodes);for(let r=0;r<t.length;r++)H(t[r]);e.replaceChildren(...n)}function gn(e=0){return e>0&&ue>e&&M(`checkLeaks: ${ue} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),ue}function Qs(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}function he(e){if(e.length<3)return!1;let n=e.toLowerCase();return n[0]==="o"&&n[1]==="n"&&n.charCodeAt(2)>=97&&n.charCodeAt(2)<=122}var ea=["http:","https:","mailto:","tel:","ftp:"],ta=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function xn(e){let n=Qs(e).trim();if(!n)return"";let t=e.replace(ta,""),r=n.toLowerCase(),o=-1;for(let s=0;s<r.length;s++){let a=r.charCodeAt(s);if(a===58){o=s;break}if(a===47||a===63||a===35)break}if(o===-1)return t;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&ea.indexOf(i)===-1?"":t}var na=/^\s+\d+(\.\d+)?[wx]$/;function ra(e){let n=e.split(","),t=[];for(let r=0;r<n.length;r++){let o=n[r].trim();if(!o)continue;let i=o.match(/^(\S+)(\s+.+)?$/);if(!i||i[2]!==void 0&&!na.test(i[2]))continue;let s=xn(i[1]);s&&t.push(i[2]?`${s}${i[2]}`:s)}return t.join(", ")}var oa=/[(:@\\]/;function ia(e){return e===" "||e===" "||e===`
|
|
2
|
-
`||e==="\r"||e==="\f"}function
|
|
1
|
+
"use strict";(()=>{var _r=Object.defineProperty;var Xe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ar=(e,n)=>{for(var t in n)_r(e,t,{get:n[t],enumerable:!0})};var Bt={};Ar(Bt,{DynamicComponent:()=>Ia,ErrorBoundary:()=>xa,ErrorDisplay:()=>Lt,Fragment:()=>Ba,KeepAlive:()=>qa,Loading:()=>Ea,MAX_DRAIN_TEARDOWNS:()=>Oe,Portal:()=>ja,SVG_NS:()=>L,Suspense:()=>Hn,__resetIdCounter:()=>La,a:()=>Qo,abbr:()=>ei,action:()=>wa,address:()=>Oo,area:()=>ki,array:()=>Ua,article:()=>Ro,aside:()=>Io,asyncDerived:()=>Ga,audio:()=>_i,autoResize:()=>nr,b:()=>ti,base:()=>xs,batch:()=>F,bdi:()=>ni,bdo:()=>ri,bindDynamic:()=>_n,blockquote:()=>qo,body:()=>Co,br:()=>oi,button:()=>Ne,canvas:()=>Fi,caption:()=>ji,catchError:()=>ka,catchErrorAsync:()=>_a,center:()=>qs,checkLeaks:()=>Ir,circle:()=>Es,cite:()=>ii,clickOutside:()=>Qn,clipPath:()=>$s,code:()=>yt,col:()=>Ki,colgroup:()=>Ui,context:()=>Ca,copyOnClick:()=>tr,createId:()=>Na,customElement:()=>Ks,data:()=>si,datalist:()=>ts,dd:()=>Wo,deepEqual:()=>Me,deepSignal:()=>Ya,defer:()=>mc,defs:()=>Hs,del:()=>qi,derived:()=>It,details:()=>ms,dfn:()=>ai,dialog:()=>gs,disableSSR:()=>Pn,dispose:()=>H,div:()=>k,dl:()=>jo,dt:()=>Ko,each:()=>Pa,effect:()=>q,ellipse:()=>ws,em:()=>ci,embed:()=>Ri,enableSSR:()=>On,enhance:()=>Ge,enhanceAll:()=>sc,enqueueBatchedSignal:()=>pe,external:()=>da,fieldset:()=>ns,figcaption:()=>Uo,figure:()=>Jo,font:()=>Ws,footer:()=>Ho,form:()=>rs,g:()=>ks,getAction:()=>Xn,getRequestScopedCache:()=>In,getRuntimeErrorHandler:()=>Ut,getSSRStore:()=>fe,getSlot:()=>Ka,h1:()=>Po,h2:()=>Bo,h3:()=>bt,h4:()=>Fo,h5:()=>zo,h6:()=>Vo,head:()=>Ao,header:()=>Mo,hr:()=>Go,html:()=>lr,i:()=>ui,iframe:()=>Mi,img:()=>Ai,input:()=>os,ins:()=>Wi,isBatching:()=>la,isSSR:()=>J,kbd:()=>li,label:()=>is,lazy:()=>Mn,lazyIsland:()=>cc,legend:()=>ss,li:()=>Yo,line:()=>_s,linearGradient:()=>Os,link:()=>Ss,longPress:()=>er,main:()=>Do,map:()=>Ci,mark:()=>di,marker:()=>Vs,marquee:()=>js,mask:()=>Ds,match:()=>Ha,math:()=>Bi,menu:()=>bs,meta:()=>Ts,meter:()=>as,mount:()=>Wa,mountIslands:()=>fc,nav:()=>$o,nextTick:()=>hc,noscript:()=>zi,object:()=>Hi,ol:()=>Zo,on:()=>ra,onCleanup:()=>ea,onMount:()=>Je,onUnmount:()=>Qs,optgroup:()=>cs,option:()=>us,output:()=>ls,p:()=>gt,param:()=>$i,path:()=>As,pattern:()=>Is,picture:()=>Di,polygon:()=>Cs,polyline:()=>Ns,portal:()=>Ii,pre:()=>ht,progress:()=>ds,q:()=>fi,radialGradient:()=>Ps,reactiveArray:()=>Ja,rect:()=>Ls,ref:()=>Za,registerAction:()=>Ee,registerComponent:()=>$a,registerDisposer:()=>T,registerIsland:()=>uc,replaceChildrenSafely:()=>z,reportDrainRunaway:()=>Pe,reportError:()=>_,resolveComponent:()=>ir,retrack:()=>oe,rp:()=>pi,rt:()=>mi,ruby:()=>gi,runInSSRContext:()=>Bn,s:()=>bi,samp:()=>hi,script:()=>Vi,section:()=>Lo,select:()=>fs,setGlobalErrorHandler:()=>Aa,setMaxDrainIterations:()=>En,setRuntimeErrorHandler:()=>Kt,show:()=>Ra,signal:()=>C,slot:()=>ys,small:()=>yi,source:()=>Oi,span:()=>D,stop:()=>Bs,store:()=>Xa,strict:()=>tc,strictEffect:()=>nc,strong:()=>vi,style:()=>ue,sub:()=>xi,summary:()=>hs,sup:()=>Si,svg:()=>Pi,symbol:()=>zs,table:()=>Ji,tagFactory:()=>u,takePendingError:()=>Ke,tbody:()=>Gi,td:()=>Yi,template:()=>vs,text:()=>Rs,textarea:()=>ps,tfoot:()=>Zi,th:()=>Xi,thead:()=>Qi,time:()=>Ti,title:()=>No,tr:()=>es,track:()=>Ni,transition:()=>bc,trapFocus:()=>rr,trustHTML:()=>br,tspan:()=>Ms,u:()=>Ei,ul:()=>Xo,unregisterComponent:()=>Da,unregisterDisposer:()=>tt,unregisterIsland:()=>lc,untracked:()=>Ae,use:()=>Fs,var_:()=>wi,video:()=>Li,watch:()=>Qa,when:()=>Ma,withSSR:()=>Fn,writable:()=>ec});var jt=Symbol.for("sibujs.runtime-errors.v1");function Qe(){let e=globalThis,n=e[jt];if(n)return n;let t={handler:null,handlerDepth:0};return e[jt]=t,t}function Kt(e){let n=Qe(),t=n.handler;return n.handler=e,t}function Ut(){return Qe().handler}function et(e){if(e instanceof Error)return e;let n=typeof e=="string"?e:`Non-Error value thrown: ${Cr(e)}`;return new Error(n,{cause:e})}function Cr(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 Nr(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Lr=Symbol.for("sibujs.reactive.v1");function Rr(e){let n=globalThis[Lr];return n?.untracked?n.untracked(e):e()}var Mr="sibu:error-propagate";function Hr(e,n){let t=n.node;if(!t||typeof CustomEvent>"u")return!1;let r=$r(t);if(!r)return!1;try{let o=new CustomEvent(Mr,{bubbles:!0,cancelable:!0,detail:{error:e,context:n}});return r.dispatchEvent(o)===!1}catch{return!1}}function $r(e){let t=e;for(;t;){if(t.nodeType===1&&typeof t.dispatchEvent=="function")return t;t=t.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function Dr(e,n){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Nr(n)}: ${e.message}`,e)}function _(e,n){let t=et(e);Rr(()=>{if(Hr(t,n))return;let r=Qe(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:t,n);return}catch(i){if(typeof console<"u"){let s=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${s}`,i)}}finally{r.handlerDepth--}}Dr(t,n)})}function Y(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function R(e,n){if(!e)throw new Error(`[SibuJS] ${n}`)}function W(e){{let n=e();n&&console.warn(`[SibuJS] ${n}`)}}function M(e){console.warn(`[SibuJS] ${e}`)}var X=new WeakMap,Oe=1e4;function Pe(e,n,t){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${n} teardowns with ${t} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:n,remaining:t})}var se=0;function T(e,n){let t=X.get(e);t||(t=[],X.set(e,t)),t.push(n),se++}function tt(e,n){let t=X.get(e);if(!t)return;let r=t.indexOf(n);r!==-1&&(t.splice(r,1),se--,t.length===0&&X.delete(e))}function H(e){let n=[e],t=[];for(;n.length>0;){let r=n.pop();t.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}for(let r=t.length-1;r>=0;r--){let o=t[r];if(X.has(o)){let i=0,s=!1;for(;!s;){let a=X.get(o);if(!a||a.length===0)break;let c=a.slice();X.delete(o),se-=c.length;for(let l=0;l<c.length;l++){if(i>=Oe){let d=c.slice(l),p=X.get(o);X.set(o,p?d.concat(p):d),se+=d.length,Pe("dispose",i,d.length+(p?.length??0)),s=!0;break}i++;try{c[l]()}catch(d){_(d,{phase:"cleanup",name:"disposer"})}}}}}}function z(e,...n){for(let r=0;r<n.length;r++){let o=n[r];o.parentNode?.removeChild(o)}let t=Array.from(e.childNodes);for(let r=0;r<t.length;r++)H(t[r]);e.replaceChildren(...n)}function Ir(e=0){return e>0&&se>e&&M(`checkLeaks: ${se} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),se}function Or(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}function be(e){if(e.length<3)return!1;let n=e.toLowerCase();return n[0]==="o"&&n[1]==="n"&&n.charCodeAt(2)>=97&&n.charCodeAt(2)<=122}var Pr=["http:","https:","mailto:","tel:","ftp:"],Br=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function Xt(e){let n=Or(e).trim();if(!n)return"";let t=e.replace(Br,""),r=n.toLowerCase(),o=-1;for(let s=0;s<r.length;s++){let a=r.charCodeAt(s);if(a===58){o=s;break}if(a===47||a===63||a===35)break}if(o===-1)return t;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&Pr.indexOf(i)===-1?"":t}var Fr=/^\s+\d+(\.\d+)?[wx]$/;function zr(e){let n=e.split(","),t=[];for(let r=0;r<n.length;r++){let o=n[r].trim();if(!o)continue;let i=o.match(/^(\S+)(\s+.+)?$/);if(!i||i[2]!==void 0&&!Fr.test(i[2]))continue;let s=Xt(i[1]);s&&t.push(i[2]?`${s}${i[2]}`:s)}return t.join(", ")}var Vr=/[(:@\\]/;function qr(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function Jt(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Wr(e){let n="";for(let t=0;t<e.length;t++){let r=e[t];if(r!=="\\"){n+=r;continue}if(t+1>=e.length)break;let o=e[t+1];if(o===`
|
|
3
3
|
`||o==="\f"){t+=1;continue}if(o==="\r"){t+=e[t+2]===`
|
|
4
|
-
`?2:1;continue}if(
|
|
5
|
-
`?2:1);let a=Number.parseInt(i,16),c=a===0||a>1114111||a>=55296&&a<=57343;n+=c?"\uFFFD":String.fromCodePoint(a),t=s-1;continue}n+=o,t+=1}return n}var hn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid"];function aa(e){if(!e)return"an element";let n=e.tagName.toLowerCase(),t=e.getAttribute("id");t&&(n+=`#${t}`);let r=e.getAttribute("class");return r&&(n+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${n}>`}var dt=new Set,yn=100,vn=!1;function Sn(e,n,t){j(()=>{let r=["url() in an inline style is an exfiltration channel: the browser fetches it immediately and the URL's path or query can carry page data off-origin","expression() executes arbitrary script in legacy engines","the javascript: scheme executes script","the vbscript: scheme executes script","-moz-binding loads and runs remote XBL","behavior: loads and runs a remote HTC script","@import pulls in a remote stylesheet","image-set() fetches remote images, the same exfiltration channel as url()","filter:progid activates legacy scriptable filters"],o=t?.property?`${t.property}: ${e}`:e,i=aa(t?.element),s=`${i}|${o}`;return dt.has(s)?"":dt.size>=yn?vn?"":(vn=!0,`${yn} distinct dropped style declarations have been reported; suppressing further ones for the rest of this session so they cannot flood the console. The declarations are still dropped \u2014 only the reporting stops. Fix the reported ones and reload to see any that remain.`):(dt.add(s),`style declaration "${o}" was dropped by the style sanitizer on ${i} \u2014 ${r[n]}. The element renders without it, which usually looks like a missing image rather than an error. Sanctioned alternatives: for a content image use an <img> element (or a <picture>); for decoration, put the rule in a stylesheet and set a class instead \u2014 stylesheet CSS is not sanitized, only inline style attributes are. If this declaration is not yours, it came from untrusted data and the drop just prevented an exfiltration.`)})}function ft(e){if(!oa.test(e))return-1;let t=(e.includes("\\")?sa(e):e).toLowerCase().replace(/\s+/g,"");for(let r=0;r<hn.length;r++)if(t.includes(hn[r]))return r;return-1}function qe(e,n){let t=ft(e);return t===-1?e:(Sn(e,t,n),"")}function We(e,n){let t=String(e);if(t.trim()==="")return"";if(typeof document>"u")return qe(t,n)===""?"":t;let r=document.createElement("div");try{r.style.cssText=t}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),c=ft(a);if(c===-1&&(c=ft(`${s}:${a}`)),c!==-1){Sn(a,c,{property:s,element:n?.element});continue}let l=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${l?` !${l}`:""}`)}return o.join("; ")}var ca=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),ua=new Set(["srcdoc"]);function Tn(e){return ua.has(e.toLowerCase())}function En(e,n,t){let r=e.toLowerCase();return r==="srcset"?ra(n):ca.has(r)?xn(n):r==="style"?We(n,t):n}var la="http://www.w3.org/1999/xhtml",da="http://www.w3.org/2000/svg",fa="http://www.w3.org/1999/xlink",pa="http://www.w3.org/XML/1998/namespace",ma=new Set(["checked","disabled","selected"]);function ga(e){return e.namespaceURI===null||e.namespaceURI===la}function wn(e,n,t){e[n]=t}function ba(e,n){if(e.namespaceURI!==da)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?fa:t.startsWith("xml:")?pa:null}function K(e,n,t,r={}){let o=ba(e,n),i=o?n.slice(n.indexOf(":")+1):n;if(he(n))return M(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${n}". Its value would be evaluated as JavaScript. Use on:{ ${n.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;if(t==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;if(Tn(n))return M(`${r.label??"setSafeAttribute"}: refusing to set "${n}". The browser parses this attribute as a nested HTML document, so a generic string value cannot be made safe \u2014 attribute escaping is undone before the parse. Build the frame's content another way.`),o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let s=ga(e),a=s?n.toLowerCase():n;if(typeof t=="boolean")return s&&ma.has(a)&&a in e?wn(e,a,t):t?o?e.setAttributeNS(o,n,""):e.setAttribute(n,""):o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;let c=String(t);if(r.syncValueProperty!==!1&&s&&(a==="value"||a==="checked")&&a in e)return wn(e,a,a==="checked"?!!t:c),!0;let l=En(n,c,{element:e});return(o?e.getAttributeNS(o,i):e.getAttribute(n))===l||(o?e.setAttributeNS(o,n,l):e.setAttribute(n,l)),!0}var ha=4096,pt=[];function ya(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function va(e,n,t){let r=pt.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=ya();return o.sig=e,o.sub=n,o.epoch=t,o}function kn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,pt.length<ha&&pt.push(e)}function xa(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function _n(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function Sa(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function Ta(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var J=null,mt=null,re=0,oe=[],U=new Set,Ea=[];function wa(e){try{e()}catch(n){let t=e;_(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function ka(e){let n=e.depsHead??null;if(n===null)return!0;for(;n!==null;){let t=n.sig;if(t===null)return!0;if(t._d===!0&&t._validate!==void 0)try{t._validate()}catch{return!0}if(n.depVersion!==t.__v)return!0;n=n.subNext}return!1}var je=0,bt=!1;function ht(){je===0&&(mt=J,J=null,bt=!0),je++}function yt(){je--,je===0&&(J=mt,mt=null,bt=!1)}function An(){return bt}function Cn(e){ht();try{return e()}finally{yt()}}var _a=0;function vt(e,n){let t=J;J=n;let r=n,o=++_a;r._epoch=o,r._structDirty=!1;for(let i=r.depsHead??null;i!==null;i=i.subNext){let s=i.sig;i.prevActive=s.__activeNode??null,s.__activeNode=i}try{e()}finally{J=t;let i=r.depsHead??null;for(;i!==null;){let s=i.subNext,a=i.sig;a.__activeNode=i.prevActive,i.prevActive=null,i.epoch!==o&&(Ta(i),_n(i),kn(i)),i=s}}}function Nn(e,n){if(!n)return xt(e);ye(n);let t=J;J=n;try{e()}finally{J=t;let o=n;for(let i=o.depsHead??null;i!==null;i=i.subNext){let s=i.sig;s.__activeNode=i.prevActive,i.prevActive=null}}let r=n;return r._dispose??(r._dispose=()=>ye(n))}function xt(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{vt(e,r)}finally{o._reentrant=!1}}},r=t;r.depsHead=null,r.depsTail=null,r._epoch=0,r._structDirty=!1,r._hasComputedDep=!1,r._runEpoch=0,r._runs=0,r._reentrant=!1,r._disposed=!1,r._errorPhase="binding",r._errorNode=n;try{t()}catch(o){throw r._disposed=!0,r._errorNode=void 0,ye(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,ye(r)})}function Ln(e){if(!J)return;let n=J,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r,o.depVersion=t.__v??Number.NaN;return}t._validate!==void 0&&(n._hasComputedDep=!0);let i=va(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,Sa(n,i),xa(t,i),n._structDirty=!0}function ye(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;_n(t),kn(t),t=r}}var Ke=1e3,Ue=1e6,Je=0,le=new Set;function Rn(e){let n=Ke;return Number.isFinite(e)&&e>0&&(Ke=Math.floor(e)),n}function Mn(e){let n=Ue;return Number.isFinite(e)&&e>0&&(Ue=Math.floor(e)),n}function Aa(e){let n=e;return n._runEpoch!==Je?(n._runEpoch=Je,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>Ke)}function Ca(e){let n=e.__name??"<unnamed>";_(new Error(`subscriber "${n}" fired more than ${Ke} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:n})}function Na(){_(new Error(`Notification drain exceeded ${Ue} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Hn(){let e=0;for(;e<oe.length;){if(e>=Ue){Na();break}let n=oe[e++];if(U.delete(n),!(le.size>0&&le.has(n))&&!(n._hasComputedDep===!0&&!ka(n))){if(Aa(n)){Ca(n),le.add(n);continue}wa(n)}}}function $n(){if(!(re>0)){re++,Je++;try{Hn()}finally{re--,re===0&&(oe.length=0,U.clear(),le.size>0&&le.clear())}}}function gt(e){e();let n=e._sig;if(!n)return;let t=Ea,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?a._d||(a._d=!0,t.push(a)):s()}else U.has(s)||(U.add(s),oe.push(s));i=i.sigNext}}}function Dn(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?gt(r):U.has(r)||(U.add(r),oe.push(r))),t=t.sigNext}}function In(e){let t=e.subsHead;if(t){if(re>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?gt(o):U.has(o)||(U.add(o),oe.push(o))),r=r.sigNext}return}re++,Je++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?gt(o):U.has(o)||(U.add(o),oe.push(o))),r=r.sigNext}Hn()}finally{re--,re===0&&(oe.length=0,U.clear(),le.size>0&&le.clear())}}}function On(e){return e.__sc??0}function Pn(e){let n=e,t=[],r=n.depsHead??null;for(;r;)r.sig&&t.push(r.sig),r=r.subNext;return t}function Bn(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var Fn="4.3.0",zn=Symbol.for("sibujs.reactive.v1");function Ra(){let e=globalThis,n=e[zn];if(n)return!n.__dupWarned&&(n.__dupWarned=!0,M(`Multiple instances of the reactive runtime detected on this page (active: ${n.version}, duplicate: ${Fn}). Reactivity is NOT broken and no bundler configuration is required: every copy routes through the first one via a global registry, so signal writes still reach subscribers registered by any copy. This is only a SIZE issue \u2014 the duplicate copy's bytes are downloaded and parsed for nothing. If you want them back, de-duplicate sibujs in your bundler (Vite: resolve.dedupe: ['sibujs']). Mismatched VERSIONS above are worth fixing regardless, since only the first one loaded is used.`)),n;let t={suspendTracking:ht,resumeTracking:yt,isTrackingSuspended:An,untracked:Cn,retrack:vt,track:Nn,reactiveBinding:xt,recordDependency:Ln,cleanup:ye,setMaxSubscriberRepeats:Rn,setMaxDrainIterations:Mn,drainNotificationQueue:$n,queueSignalNotification:Dn,notifySubscribers:In,getSubscriberCount:On,getSubscriberDeps:Pn,forEachSubscriber:Bn,version:Fn};return e[zn]=t,t}var I=Ra(),Le=I.suspendTracking,Re=I.resumeTracking,Vn=I.isTrackingSuspended,ve=I.untracked,Q=I.retrack,O=I.track,q=I.reactiveBinding,xe=I.recordDependency,qn=I.cleanup,Pc=I.setMaxSubscriberRepeats,St=I.setMaxDrainIterations,Wn=I.drainNotificationQueue,jn=I.queueSignalNotification,Se=I.notifySubscribers,Bc=I.getSubscriberCount,Fc=I.getSubscriberDeps,zc=I.forEachSubscriber;function Ge(e,n,t){if(he(n))return K(e,n,"",{label:`bindAttribute("${n}")`}),()=>{};function r(){let o;try{o=t()}catch(i){_(i,{phase:"binding",name:`bindAttribute("${n}")`,node:e});return}K(e,n,o,{label:`bindAttribute("${n}")`})}return q(r,e)}function Tt(e,n,t){let r=null;function o(){let s;try{s=typeof n=="function"?n():n}catch(c){_(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof t=="function"?t():t}catch(c){_(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),K(e,s,a,{label:"bindDynamic"})&&(r=s)}let i=q(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Et=["data-focus-key","id","name"],Ma=new Set(["text","search","url","tel","password",""]);function Ha(e){let n=e.tagName;if(!(n==="TEXTAREA"||n==="INPUT"&&Ma.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 Me(e){if(e.length===0||typeof document>"u")return null;let n=document.activeElement;if(!n||n===document.body)return null;let t=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===n||s.nodeType===1&&s.contains(n)){t=!0;break}}if(!t)return null;let r=null,o=null;for(let i=0;i<Et.length;i++){let s=n.getAttribute(Et[i]);if(s){r=Et[i],o=s;break}}return{el:n,attr:r,value:o,tag:n.tagName,...Ha(n)}}function $a(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Da(e,n){let t=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(n)&&(r++,t??(t=s));let a=s.querySelectorAll(n);for(let c=0;c<a.length;c++)r++,t??(t=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:t,count:r}:{el:null,count:r}}function Kn(e,n){if(e.focus(),n.start!==null&&typeof e.setSelectionRange=="function"){let t=e,r=t.value.length,o=Math.min(n.start,r),i=Math.min(n.end??o,r);t.setSelectionRange(o,i,n.direction??"none")}}function Te(e,n,t){if(!e||typeof document>"u")return;let r=document.activeElement;if(r===e.el||r&&r!==document.body&&r!==document.documentElement)return;if(e.el.isConnected){Kn(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=Da(n,`[${e.attr}=${$a(e.value)}]`);if(i&&i.tagName===e.tag){Kn(i,e);return}o=s>1}j(()=>{let i=e.attr?` (${e.attr}="${e.value}")`:"",s=o?`several elements in the rebuilt subtree share ${e.attr}="${e.value}", so there is no way to tell which one the user was in \u2014 a shared name (a radio group) identifies a GROUP, not a control. Add a unique id or data-focus-key to each`:"no element in the rebuilt subtree carries the same identity. Give it a stable id, name, or data-focus-key that the rebuild reproduces";return`${t}: a reactive rebuild discarded the focused element <${e.tag.toLowerCase()}>${i} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${s}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them.`})}function de(e,n){let t=[];function r(){let o;try{o=n()}catch(d){_(d,{phase:"binding",name:"bindChildNode",node:e});return}let i=Me(t);if(o==null||typeof o=="boolean"){for(let d=0;d<t.length;d++){let p=t[d];H(p),p.parentNode&&p.parentNode.removeChild(p)}t.length=0,Te(i,t,"bindChildNode");return}let s=e.parentNode;if(!s){t.length=0;return}let a;if(Array.isArray(o)){a=[];let d=new Set;for(let p=0;p<o.length;p++){let g=o[p];if(g==null||typeof g=="boolean")continue;let f=g instanceof Node?g:document.createTextNode(String(g));if(d.has(f)){M("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}d.add(f),a.push(f)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(t.length>0&&a.length>0){let d=new Set(t);c=new Set;for(let p=0;p<a.length;p++)d.has(a[p])&&c.add(a[p])}for(let d=0;d<t.length;d++){let p=t[d];c?.has(p)||(H(p),p.parentNode&&p.parentNode.removeChild(p))}let l=e;for(let d=0;d<a.length;d++){let p=a[d];l.nextSibling!==p&&s.insertBefore(p,l.nextSibling),l=p}t=a,Te(i,a,"bindChildNode")}return q(r,e)}var N="http://www.w3.org/2000/svg",Ia=new Set(["script","iframe","object","embed","frame","frameset"]);function Oa(e){return Ia.has(e.toLowerCase())}var Pa=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var wt=new Set,Un=100,Jn=!1,Gn=new Map;function Ba(e){let n=Gn.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Gn.set(e,n)),n}function Fa(e,n){if(typeof n=="function"){let r=q(()=>{e.setAttribute("style",We(String(n()),{element:e}))},e);T(e,r);return}if(typeof n=="string"){e.setAttribute("style",We(n,{element:e}));return}let t=e;for(let r in n){let o=n[r],i=Ba(r);if(typeof o=="function"){let s=o,a=q(()=>{t.style.setProperty(i,qe(String(s()),{property:i,element:e}))},e);T(e,a)}else t.style.setProperty(i,qe(String(o),{property:i,element:e}))}}function za(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=q(()=>{e.setAttribute("class",n())},e);T(e,i);return}let t=n,r=!1,o="";for(let i in t){let s=t[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=q(()=>{let a="";for(let c in t){let l=t[c];(typeof l=="function"?l():l)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);T(e,s)}else e.setAttribute("class",o)}function kt(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),T(e,de(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),T(e,de(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),T(e,de(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}var u=(e,n)=>{let t=Oa(e);return(r,o)=>{if(t)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=n?document.createElementNS(n,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),kt(i,o),i):(j(()=>{let f=r.trim().split(/\s+/);if(f.length<2)return"";let m=0;for(let h=0;h<f.length;h++){let y=f[h];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&m++}if(m<2)return"";let b=`${e}|${r}`;return wt.has(b)?"":wt.size>=Un?Jn?"":(Jn=!0,`tagFactory: ${Un} distinct lone-string class warnings have been reported; suppressing further ones for the rest of this session so they cannot flood the console. Fix the reported ones and reload to see any that remain.`):(wt.add(b),`tagFactory: lone string "${r}" looks like a class list but is being rendered as TEXT. For a class, use ${e}({ class: "${r}" }) \u2014 or ${e}("${r}", children) to set the class AND add children.`)}),i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return kt(i,r),i;let s=r,a=s.class;a!=null&&za(i,a);let c=s.id;c!=null&&(typeof c=="string"&&Pa.has(c.toLowerCase())&&M(`tagFactory: element id="${c}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=c);let l=o!==void 0?o:s.nodes;l!=null&&kt(i,l);let d=s.on;if(d)for(let f in d){let m=d[f];typeof m=="function"?i.addEventListener(f,m):M(`tagFactory: on.${f} handler is not a function (got ${typeof m}). Event listener was not attached.`)}let p=s.style;p!=null&&Fa(i,p);let g=s.ref;g&&(g.current=i);for(let f in s)switch(f){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let m=s[f];if(m==null||he(f))continue;typeof m=="function"?T(i,Ge(i,f,m)):K(i,f,m,{syncValueProperty:!1,label:"tagFactory"})}}return s.onElement&&typeof s.onElement=="function"&&s.onElement(i),i}};var du=u("html"),Yn=u("head"),Zn=u("body"),Xn=u("title"),k=u("div"),$=u("span"),Qn=u("section"),er=u("article"),tr=u("header"),nr=u("footer"),rr=u("nav"),or=u("main"),ir=u("aside"),sr=u("address"),Ye=u("p"),ar=u("h1"),cr=u("h2"),Ze=u("h3"),ur=u("h4"),lr=u("h5"),dr=u("h6"),fr=u("blockquote"),pr=u("dd"),mr=u("dl"),gr=u("dt"),br=u("figcaption"),hr=u("figure"),yr=u("hr"),vr=u("li"),xr=u("ol"),Sr=u("ul"),Xe=u("pre"),Tr=u("a"),Er=u("abbr"),wr=u("b"),kr=u("bdi"),_r=u("bdo"),Ar=u("br"),Cr=u("cite"),Qe=u("code"),Nr=u("data"),Lr=u("dfn"),Rr=u("em"),Mr=u("i"),Hr=u("kbd"),$r=u("mark"),Dr=u("q"),Ir=u("rp"),Or=u("rt"),Pr=u("ruby"),Br=u("s"),Fr=u("samp"),zr=u("small"),Vr=u("strong"),qr=u("sub"),Wr=u("sup"),jr=u("time"),Kr=u("u"),Ur=u("var"),Jr=u("area"),Gr=u("audio"),Yr=u("img"),Zr=u("map"),Xr=u("track"),Qr=u("video"),eo=u("embed"),to=u("iframe"),no=u("object"),ro=u("param"),oo=u("picture"),io=u("portal"),so=u("source"),ao=u("svg",N),co=u("math"),uo=u("canvas"),lo=u("noscript"),fo=u("script"),po=u("del"),mo=u("ins"),go=u("caption"),bo=u("col"),ho=u("colgroup"),yo=u("table"),vo=u("tbody"),xo=u("td"),So=u("tfoot"),To=u("th"),Eo=u("thead"),wo=u("tr"),Ee=u("button"),ko=u("datalist"),_o=u("fieldset"),Ao=u("form"),Co=u("input"),No=u("label"),Lo=u("legend"),Ro=u("meter"),Mo=u("optgroup"),Ho=u("option"),$o=u("output"),Do=u("progress"),Io=u("select"),Oo=u("textarea"),Po=u("details"),Bo=u("dialog"),Fo=u("menu"),zo=u("summary"),Vo=u("slot"),qo=u("template"),Wo=u("base"),jo=u("link"),Ko=u("meta"),ie=u("style"),Uo=u("circle",N),Jo=u("ellipse",N),Go=u("g",N),Yo=u("line",N),Zo=u("path",N),Xo=u("polygon",N),Qo=u("polyline",N),ei=u("rect",N),ti=u("text",N),ni=u("tspan",N),ri=u("defs",N),oi=u("clipPath",N),ii=u("mask",N),si=u("pattern",N),ai=u("linearGradient",N),ci=u("radialGradient",N),ui=u("stop",N),li=u("use",N),di=u("symbol",N),fi=u("marker",N),pi=u("center"),mi=u("font"),gi=u("marquee"),bi=e=>u(e);var _t="__sibuPendingError";function hi(e,n){let t=()=>e.parentNode?(_(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[_t]=n)})}function He(e){let n=e,t=n[_t];if(t instanceof Error)return delete n[_t],t}function At(e){let n=null;return function(){if(n)return n();let r=k({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let s=n();z(r,s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));z(r,k({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),hi(r,s)}),r.appendChild($("sibu-lazy-loading","Loading...")),T(r,()=>{o=!0}),r}}function Ct({nodes:e,fallback:n}){let t=k({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,s=null;return T(t,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!t.contains(s)&&H(s)}),queueMicrotask(()=>{if(!o)try{let a=e();if(s=a,a.classList.contains("sibu-lazy")){if(!a.querySelector(".sibu-lazy-loading")){z(t,a);return}i=new MutationObserver(()=>{if(o)return;a.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,z(t,a))}),i.observe(a,{childList:!0,subtree:!0})}else z(t,a)}catch(a){let c=a instanceof Error?a:new Error(String(a));hi(t,c)}}),t}function Mt(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";_(t,{phase:r,name:n});return}}function Nt(e,n,t){let r=Mt(e,n);typeof r=="function"&&t&&T(t,r)}var we=new WeakMap,fe=new WeakMap,ee=new Set,te=new Set,ke=null,et=0,Va=256;function Lt(e){let n=we.get(e);if(n){we.delete(e),ee.delete(e);for(let t of n)try{t()}catch{}}}function Rt(e){fe.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=fe.get(e);if(t){fe.delete(e),te.delete(e);for(let r of t)try{r()}catch{}}})}function qa(e){if(ee.size===0||e.nodeType!==1)return;let n=e;if(ee.has(n)&&n.isConnected&&Lt(n),n.firstElementChild)for(let t of Array.from(ee))t!==n&&t.isConnected&&n.contains(t)&&Lt(t)}function Wa(e){if(te.size===0||e.nodeType!==1)return;let n=e;if(te.has(n)&&!n.isConnected&&Rt(n),n.firstElementChild)for(let t of Array.from(te))t!==n&&!t.isConnected&&n.contains(t)&&Rt(t)}function ja(){if(ee.size>0)for(let e of Array.from(ee))e.isConnected&&Lt(e);if(te.size>0)for(let e of Array.from(te))e.isConnected||Rt(e)}function yi(){ke||typeof document>"u"||(ke=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)qa(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)Wa(n.removedNodes[t])}et+=e.length,et>=Va&&(et=0,ja()),Ht()}),ke.observe(document.body,{childList:!0,subtree:!0}))}function Ht(){ke&&ee.size===0&&te.size===0&&(ke.disconnect(),ke=null,et=0)}function Ka(e,n){let t=we.get(e);return t||(t=[],we.set(e,t)),t.push(n),ee.add(e),yi(),()=>{let r=we.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(we.delete(e),ee.delete(e))}Ht()}}function Ua(e,n){let t=fe.get(e);return t||(t=[],fe.set(e,t)),t.push(n),te.add(e),yi(),()=>{let r=fe.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(fe.delete(e),te.delete(e))}Ht()}}function $e(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(T(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||Nt(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){Nt(e,"onMount",n);return}let r=Ka(n,()=>{t||Nt(e,"onMount",n)});T(n,r)})}else queueMicrotask(()=>{Mt(e,"onMount")})}function vi(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,Mt(e,"onUnmount"))};T(n,r);let o=()=>{if(t)return;let i=Ua(n,r);T(n,i)};n.isConnected?o():$e(()=>{o()},n)}function xi(e,n){T(n,e)}var $t=Symbol.for("sibujs.ssr.v1");function Ja(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,t=process.getBuiltinModule;typeof t=="function"?n=t("node:async_hooks"):typeof st=="function"&&(n=st("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var pe=globalThis[$t]??(globalThis[$t]=Ja()),De=pe.als,Z=pe.fallbackStore;pe.fallbackDepth??(pe.fallbackDepth=0);var Si=!1;function Ga(){if(Si||De||!(typeof process<"u"&&!!process.versions?.node))return;Si=!0;let n=process.versions.node;M(`SSR request isolation is UNAVAILABLE on this runtime (Node ${n}). AsyncLocalStorage could not be loaded, so concurrent requests share one SSR store: request state and the query cache can bleed between them. Node >= 22.3 is required for isolated SSR under ESM; the CommonJS build works on older versions. A fully synchronous render is unaffected.`)}function se(){if(De){let e=De.getStore();if(e)return e}return Z}function W(){return se().ssr}function Dt(e){if(!W())return null;let n=se(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function It(){se().ssr=!0}function Ot(){se().ssr=!1}function Pt(e){let n={ssr:!0,suspenseIdCounter:0,locale:void 0};if(De)return De.run(n,e);Ga();let t=Z.ssr,r=Z.suspenseIdCounter,o=Z.locale;Z.ssr=!0,Z.suspenseIdCounter=0,Z.locale=void 0,pe.fallbackDepth++;try{return e()}finally{pe.fallbackDepth--,Z.ssr=t,Z.suspenseIdCounter=r,Z.locale=o}}function Bt(e){let n=se(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var wi=globalThis;function ki(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,ve(()=>n(o,void 0));else{let i=t;t=o,ve(()=>n(o,i))}}}var Ti=100;function Ft(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){_(r,{phase:"cleanup"})}}}function Ei(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&Ft(e),Q(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=Ti);e.rerunPending&&(e.rerunPending=!1,_(new Error(`effect re-requested itself ${Ti}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Ya(e){if(e.disposed)return;e.disposed=!0;let n=wi.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Ft(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{qn(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function V(e,n){if(R(typeof e=="function","effect: argument must be a function."),W())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=s=>{t.userCleanups.push(s)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(s){r(s)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(!t.disposed){if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&Ft(t),Q(t.bodyFn,o),t.rerunPending&&Ei(t)}finally{t.running=!1,t.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,t.subscriber=o,t.running=!0;try{Q(t.bodyFn,t.subscriber),t.rerunPending&&Ei(t)}finally{t.running=!1,t.rerunPending=!1}let i=wi.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>Ya(t)}var Ie=0,zt=new Set;function Za(e){Ie++;try{return e()}finally{Ie--,Ie===0&&ec()}}function Xa(e){return Ie===0?!1:(zt.add(e),!0)}function Qa(){return Ie>0}function ec(){try{for(let e of zt)jn(e)}finally{zt.clear()}Wn()}var _i=Symbol.for("sibujs.reactive.batch.v1");function tc(){let e=globalThis,n=e[_i];if(n)return n;let t={batch:Za,enqueueBatchedSignal:Xa,isBatching:Qa};return e[_i]=t,t}var Vt=tc(),F=Vt.batch,ae=Vt.enqueueBatchedSignal,Ai=Vt.isBatching;var qt=globalThis;function C(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=n?.name,o=n?.equals;r&&(t.__name=r);function i(){return xe(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;if(!o(c,l)){if(t.value=l,t.__v++,!0){let d=qt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l})}ae(t)||Se(t)}}:s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;if(Object.is(l,c))return;t.value=l,t.__v++;let d=qt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l}),ae(t)||Se(t)},!0){let a=qt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}function Ci(e){let[n,t]=C(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var nc=`
|
|
4
|
+
`?2:1;continue}if(Jt(o)){let i="",s=t+1;for(;s<e.length&&i.length<6&&Jt(e[s]);)i+=e[s],s++;s<e.length&&qr(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
|
|
5
|
+
`?2:1);let a=Number.parseInt(i,16),c=a===0||a>1114111||a>=55296&&a<=57343;n+=c?"\uFFFD":String.fromCodePoint(a),t=s-1;continue}n+=o,t+=1}return n}var Gt=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid"];function jr(e){if(!e)return"an element";let n=e.tagName.toLowerCase(),t=e.getAttribute("id");t&&(n+=`#${t}`);let r=e.getAttribute("class");return r&&(n+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${n}>`}var nt=new Set,Yt=100,Zt=!1;function Qt(e,n,t){W(()=>{let r=["url() in an inline style is an exfiltration channel: the browser fetches it immediately and the URL's path or query can carry page data off-origin","expression() executes arbitrary script in legacy engines","the javascript: scheme executes script","the vbscript: scheme executes script","-moz-binding loads and runs remote XBL","behavior: loads and runs a remote HTC script","@import pulls in a remote stylesheet","image-set() fetches remote images, the same exfiltration channel as url()","filter:progid activates legacy scriptable filters"],o=t?.property?`${t.property}: ${e}`:e,i=jr(t?.element),s=`${i}|${o}`;return nt.has(s)?"":nt.size>=Yt?Zt?"":(Zt=!0,`${Yt} distinct dropped style declarations have been reported; suppressing further ones for the rest of this session so they cannot flood the console. The declarations are still dropped \u2014 only the reporting stops. Fix the reported ones and reload to see any that remain.`):(nt.add(s),`style declaration "${o}" was dropped by the style sanitizer on ${i} \u2014 ${r[n]}. The element renders without it, which usually looks like a missing image rather than an error. Sanctioned alternatives: for a content image use an <img> element (or a <picture>); for decoration, put the rule in a stylesheet and set a class instead \u2014 stylesheet CSS is not sanitized, only inline style attributes are. If this declaration is not yours, it came from untrusted data and the drop just prevented an exfiltration.`)})}function rt(e){if(!Vr.test(e))return-1;let t=(e.includes("\\")?Wr(e):e).toLowerCase().replace(/\s+/g,"");for(let r=0;r<Gt.length;r++)if(t.includes(Gt[r]))return r;return-1}function Be(e,n){let t=rt(e);return t===-1?e:(Qt(e,t,n),"")}function Fe(e,n){let t=String(e);if(t.trim()==="")return"";if(typeof document>"u")return Be(t,n)===""?"":t;let r=document.createElement("div");try{r.style.cssText=t}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),c=rt(a);if(c===-1&&(c=rt(`${s}:${a}`)),c!==-1){Qt(a,c,{property:s,element:n?.element});continue}let l=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${l?` !${l}`:""}`)}return o.join("; ")}var Kr=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),Ur=new Set(["srcdoc"]);function en(e){return Ur.has(e.toLowerCase())}function tn(e,n,t){let r=e.toLowerCase();return r==="srcset"?zr(n):Kr.has(r)?Xt(n):r==="style"?Fe(n,t):n}var Jr="http://www.w3.org/1999/xhtml",Gr="http://www.w3.org/2000/svg",Yr="http://www.w3.org/1999/xlink",Zr="http://www.w3.org/XML/1998/namespace",Xr=new Set(["checked","disabled","selected"]);function Qr(e){return e.namespaceURI===null||e.namespaceURI===Jr}function nn(e,n,t){e[n]=t}function eo(e,n){if(e.namespaceURI!==Gr)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?Yr:t.startsWith("xml:")?Zr:null}function j(e,n,t,r={}){let o=eo(e,n),i=o?n.slice(n.indexOf(":")+1):n;if(be(n))return M(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${n}". Its value would be evaluated as JavaScript. Use on:{ ${n.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;if(t==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;if(en(n))return M(`${r.label??"setSafeAttribute"}: refusing to set "${n}". The browser parses this attribute as a nested HTML document, so a generic string value cannot be made safe \u2014 attribute escaping is undone before the parse. Build the frame's content another way.`),o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let s=Qr(e),a=s?n.toLowerCase():n;if(typeof t=="boolean")return s&&Xr.has(a)&&a in e?nn(e,a,t):t?o?e.setAttributeNS(o,n,""):e.setAttribute(n,""):o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;let c=String(t);if(r.syncValueProperty!==!1&&s&&(a==="value"||a==="checked")&&a in e)return nn(e,a,a==="checked"?!!t:c),!0;let l=tn(n,c,{element:e});return(o?e.getAttributeNS(o,i):e.getAttribute(n))===l||(o?e.setAttributeNS(o,n,l):e.setAttribute(n,l)),!0}var to=4096,ot=[];function no(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function ro(e,n,t){let r=ot.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=no();return o.sig=e,o.sub=n,o.epoch=t,o}function rn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,ot.length<to&&ot.push(e)}function oo(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function on(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function io(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function so(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var U=null,it=null,ne=0,re=[],K=new Set,ao=[];function co(e){try{e()}catch(n){let t=e;_(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function uo(e){let n=e.depsHead??null;if(n===null)return!0;for(;n!==null;){let t=n.sig;if(t===null)return!0;if(t._d===!0&&t._validate!==void 0)try{t._validate()}catch{return!0}if(n.depVersion!==t.__v)return!0;n=n.subNext}return!1}var ze=0,at=!1;function ct(){ze===0&&(it=U,U=null,at=!0),ze++}function ut(){ze--,ze===0&&(U=it,it=null,at=!1)}function sn(){return at}function an(e){ct();try{return e()}finally{ut()}}var lo=0;function lt(e,n){let t=U;U=n;let r=n,o=++lo;r._epoch=o,r._structDirty=!1;for(let i=r.depsHead??null;i!==null;i=i.subNext){let s=i.sig;i.prevActive=s.__activeNode??null,s.__activeNode=i}try{e()}finally{U=t;let i=r.depsHead??null;for(;i!==null;){let s=i.subNext,a=i.sig;a.__activeNode=i.prevActive,i.prevActive=null,i.epoch!==o&&(so(i),on(i),rn(i)),i=s}}}function cn(e,n){if(!n)return dt(e);he(n);let t=U;U=n;try{e()}finally{U=t;let o=n;for(let i=o.depsHead??null;i!==null;i=i.subNext){let s=i.sig;s.__activeNode=i.prevActive,i.prevActive=null}}let r=n;return r._dispose??(r._dispose=()=>he(n))}function dt(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{lt(e,r)}finally{o._reentrant=!1}}},r=t;r.depsHead=null,r.depsTail=null,r._epoch=0,r._structDirty=!1,r._hasComputedDep=!1,r._runEpoch=0,r._runs=0,r._reentrant=!1,r._disposed=!1,r._errorPhase="binding",r._errorNode=n;try{t()}catch(o){throw r._disposed=!0,r._errorNode=void 0,he(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,he(r)})}function un(e){if(!U)return;let n=U,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r,o.depVersion=t.__v??Number.NaN;return}t._validate!==void 0&&(n._hasComputedDep=!0);let i=ro(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,io(n,i),oo(t,i),n._structDirty=!0}function he(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;on(t),rn(t),t=r}}var Ve=1e3,qe=1e6,We=0,ae=new Set;function ln(e){let n=Ve;return Number.isFinite(e)&&e>0&&(Ve=Math.floor(e)),n}function dn(e){let n=qe;return Number.isFinite(e)&&e>0&&(qe=Math.floor(e)),n}function fo(e){let n=e;return n._runEpoch!==We?(n._runEpoch=We,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>Ve)}function po(e){let n=e.__name??"<unnamed>";_(new Error(`subscriber "${n}" fired more than ${Ve} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:n})}function mo(){_(new Error(`Notification drain exceeded ${qe} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function fn(){let e=0;for(;e<re.length;){if(e>=qe){mo();break}let n=re[e++];if(K.delete(n),!(ae.size>0&&ae.has(n))&&!(n._hasComputedDep===!0&&!uo(n))){if(fo(n)){po(n),ae.add(n);continue}co(n)}}}function pn(){if(!(ne>0)){ne++,We++;try{fn()}finally{ne--,ne===0&&(re.length=0,K.clear(),ae.size>0&&ae.clear())}}}function st(e){e();let n=e._sig;if(!n)return;let t=ao,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?a._d||(a._d=!0,t.push(a)):s()}else K.has(s)||(K.add(s),re.push(s));i=i.sigNext}}}function mn(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?st(r):K.has(r)||(K.add(r),re.push(r))),t=t.sigNext}}function gn(e){let t=e.subsHead;if(t){if(ne>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?st(o):K.has(o)||(K.add(o),re.push(o))),r=r.sigNext}return}ne++,We++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?st(o):K.has(o)||(K.add(o),re.push(o))),r=r.sigNext}fn()}finally{ne--,ne===0&&(re.length=0,K.clear(),ae.size>0&&ae.clear())}}}function bn(e){return e.__sc??0}function hn(e){let n=e,t=[],r=n.depsHead??null;for(;r;)r.sig&&t.push(r.sig),r=r.subNext;return t}function yn(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var vn="4.4.0",xn=Symbol.for("sibujs.reactive.v1");function bo(){let e=globalThis,n=e[xn];if(n)return!n.__dupWarned&&(n.__dupWarned=!0,M(`Multiple instances of the reactive runtime detected on this page (active: ${n.version}, duplicate: ${vn}). Reactivity is NOT broken and no bundler configuration is required: every copy routes through the first one via a global registry, so signal writes still reach subscribers registered by any copy. This is only a SIZE issue \u2014 the duplicate copy's bytes are downloaded and parsed for nothing. If you want them back, de-duplicate sibujs in your bundler (Vite: resolve.dedupe: ['sibujs']). Mismatched VERSIONS above are worth fixing regardless, since only the first one loaded is used.`)),n;let t={suspendTracking:ct,resumeTracking:ut,isTrackingSuspended:sn,untracked:an,retrack:lt,track:cn,reactiveBinding:dt,recordDependency:un,cleanup:he,setMaxSubscriberRepeats:ln,setMaxDrainIterations:dn,drainNotificationQueue:pn,queueSignalNotification:mn,notifySubscribers:gn,getSubscriberCount:bn,getSubscriberDeps:hn,forEachSubscriber:yn,version:vn};return e[xn]=t,t}var I=bo(),ke=I.suspendTracking,_e=I.resumeTracking,Sn=I.isTrackingSuspended,Ae=I.untracked,oe=I.retrack,O=I.track,V=I.reactiveBinding,ye=I.recordDependency,Tn=I.cleanup,Mc=I.setMaxSubscriberRepeats,En=I.setMaxDrainIterations,wn=I.drainNotificationQueue,kn=I.queueSignalNotification,ve=I.notifySubscribers,Hc=I.getSubscriberCount,$c=I.getSubscriberDeps,Dc=I.forEachSubscriber;function je(e,n,t){if(be(n))return j(e,n,"",{label:`bindAttribute("${n}")`}),()=>{};function r(){let o;try{o=t()}catch(i){_(i,{phase:"binding",name:`bindAttribute("${n}")`,node:e});return}j(e,n,o,{label:`bindAttribute("${n}")`})}return V(r,e)}function _n(e,n,t){let r=null;function o(){let s;try{s=typeof n=="function"?n():n}catch(c){_(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof t=="function"?t():t}catch(c){_(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),j(e,s,a,{label:"bindDynamic"})&&(r=s)}let i=V(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var ft=["data-focus-key","id","name"],ho=new Set(["text","search","url","tel","password",""]);function yo(e){let n=e.tagName;if(!(n==="TEXTAREA"||n==="INPUT"&&ho.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 Ce(e){if(e.length===0||typeof document>"u")return null;let n=document.activeElement;if(!n||n===document.body)return null;let t=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===n||s.nodeType===1&&s.contains(n)){t=!0;break}}if(!t)return null;let r=null,o=null;for(let i=0;i<ft.length;i++){let s=n.getAttribute(ft[i]);if(s){r=ft[i],o=s;break}}return{el:n,attr:r,value:o,tag:n.tagName,...yo(n)}}function vo(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function xo(e,n){let t=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(n)&&(r++,t??(t=s));let a=s.querySelectorAll(n);for(let c=0;c<a.length;c++)r++,t??(t=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:t,count:r}:{el:null,count:r}}function An(e,n){if(e.focus(),n.start!==null&&typeof e.setSelectionRange=="function"){let t=e,r=t.value.length,o=Math.min(n.start,r),i=Math.min(n.end??o,r);t.setSelectionRange(o,i,n.direction??"none")}}function xe(e,n,t){if(!e||typeof document>"u")return;let r=document.activeElement;if(r===e.el||r&&r!==document.body&&r!==document.documentElement)return;if(e.el.isConnected){An(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=xo(n,`[${e.attr}=${vo(e.value)}]`);if(i&&i.tagName===e.tag){An(i,e);return}o=s>1}W(()=>{let i=e.attr?` (${e.attr}="${e.value}")`:"",s=o?`several elements in the rebuilt subtree share ${e.attr}="${e.value}", so there is no way to tell which one the user was in \u2014 a shared name (a radio group) identifies a GROUP, not a control. Add a unique id or data-focus-key to each`:"no element in the rebuilt subtree carries the same identity. Give it a stable id, name, or data-focus-key that the rebuild reproduces";return`${t}: a reactive rebuild discarded the focused element <${e.tag.toLowerCase()}>${i} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${s}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them.`})}function ce(e,n){let t=[];function r(){let o;try{o=n()}catch(d){_(d,{phase:"binding",name:"bindChildNode",node:e});return}let i=Ce(t);if(o==null||typeof o=="boolean"){for(let d=0;d<t.length;d++){let p=t[d];H(p),p.parentNode&&p.parentNode.removeChild(p)}t.length=0,xe(i,t,"bindChildNode");return}let s=e.parentNode;if(!s){t.length=0;return}let a;if(Array.isArray(o)){a=[];let d=new Set;for(let p=0;p<o.length;p++){let g=o[p];if(g==null||typeof g=="boolean")continue;let f=g instanceof Node?g:document.createTextNode(String(g));if(d.has(f)){M("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}d.add(f),a.push(f)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(t.length>0&&a.length>0){let d=new Set(t);c=new Set;for(let p=0;p<a.length;p++)d.has(a[p])&&c.add(a[p])}for(let d=0;d<t.length;d++){let p=t[d];c?.has(p)||(H(p),p.parentNode&&p.parentNode.removeChild(p))}let l=e;for(let d=0;d<a.length;d++){let p=a[d];l.nextSibling!==p&&s.insertBefore(p,l.nextSibling),l=p}t=a,xe(i,a,"bindChildNode")}return V(r,e)}var L="http://www.w3.org/2000/svg",So=new Set(["script","iframe","object","embed","frame","frameset"]);function To(e){return So.has(e.toLowerCase())}var Eo=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var pt=new Set,Cn=100,Nn=!1,Ln=new Map;function wo(e){let n=Ln.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Ln.set(e,n)),n}function ko(e,n){if(typeof n=="function"){let r=V(()=>{e.setAttribute("style",Fe(String(n()),{element:e}))},e);T(e,r);return}if(typeof n=="string"){e.setAttribute("style",Fe(n,{element:e}));return}let t=e;for(let r in n){let o=n[r],i=wo(r);if(typeof o=="function"){let s=o,a=V(()=>{t.style.setProperty(i,Be(String(s()),{property:i,element:e}))},e);T(e,a)}else t.style.setProperty(i,Be(String(o),{property:i,element:e}))}}function _o(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=V(()=>{e.setAttribute("class",n())},e);T(e,i);return}let t=n,r=!1,o="";for(let i in t){let s=t[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=V(()=>{let a="";for(let c in t){let l=t[c];(typeof l=="function"?l():l)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);T(e,s)}else e.setAttribute("class",o)}function mt(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),T(e,ce(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),T(e,ce(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),T(e,ce(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}var u=(e,n)=>{let t=To(e);return(r,o)=>{if(t)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=n?document.createElementNS(n,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),mt(i,o),i):(W(()=>{let f=r.trim().split(/\s+/);if(f.length<2)return"";let m=0;for(let h=0;h<f.length;h++){let y=f[h];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&m++}if(m<2)return"";let b=`${e}|${r}`;return pt.has(b)?"":pt.size>=Cn?Nn?"":(Nn=!0,`tagFactory: ${Cn} distinct lone-string class warnings have been reported; suppressing further ones for the rest of this session so they cannot flood the console. Fix the reported ones and reload to see any that remain.`):(pt.add(b),`tagFactory: lone string "${r}" looks like a class list but is being rendered as TEXT. For a class, use ${e}({ class: "${r}" }) \u2014 or ${e}("${r}", children) to set the class AND add children.`)}),i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return mt(i,r),i;let s=r,a=s.class;a!=null&&_o(i,a);let c=s.id;c!=null&&(typeof c=="string"&&Eo.has(c.toLowerCase())&&M(`tagFactory: element id="${c}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=c);let l=o!==void 0?o:s.nodes;l!=null&&mt(i,l);let d=s.on;if(d)for(let f in d){let m=d[f];typeof m=="function"?i.addEventListener(f,m):M(`tagFactory: on.${f} handler is not a function (got ${typeof m}). Event listener was not attached.`)}let p=s.style;p!=null&&ko(i,p);let g=s.ref;g&&(g.current=i);for(let f in s)switch(f){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let m=s[f];if(m==null||be(f))continue;typeof m=="function"?T(i,je(i,f,m)):j(i,f,m,{syncValueProperty:!1,label:"tagFactory"})}}return s.onElement&&typeof s.onElement=="function"&&s.onElement(i),i}};var iu=u("html"),Ao=u("head"),Co=u("body"),No=u("title"),k=u("div"),D=u("span"),Lo=u("section"),Ro=u("article"),Mo=u("header"),Ho=u("footer"),$o=u("nav"),Do=u("main"),Io=u("aside"),Oo=u("address"),gt=u("p"),Po=u("h1"),Bo=u("h2"),bt=u("h3"),Fo=u("h4"),zo=u("h5"),Vo=u("h6"),qo=u("blockquote"),Wo=u("dd"),jo=u("dl"),Ko=u("dt"),Uo=u("figcaption"),Jo=u("figure"),Go=u("hr"),Yo=u("li"),Zo=u("ol"),Xo=u("ul"),ht=u("pre"),Qo=u("a"),ei=u("abbr"),ti=u("b"),ni=u("bdi"),ri=u("bdo"),oi=u("br"),ii=u("cite"),yt=u("code"),si=u("data"),ai=u("dfn"),ci=u("em"),ui=u("i"),li=u("kbd"),di=u("mark"),fi=u("q"),pi=u("rp"),mi=u("rt"),gi=u("ruby"),bi=u("s"),hi=u("samp"),yi=u("small"),vi=u("strong"),xi=u("sub"),Si=u("sup"),Ti=u("time"),Ei=u("u"),wi=u("var"),ki=u("area"),_i=u("audio"),Ai=u("img"),Ci=u("map"),Ni=u("track"),Li=u("video"),Ri=u("embed"),Mi=u("iframe"),Hi=u("object"),$i=u("param"),Di=u("picture"),Ii=u("portal"),Oi=u("source"),Pi=u("svg",L),Bi=u("math"),Fi=u("canvas"),zi=u("noscript"),Vi=u("script"),qi=u("del"),Wi=u("ins"),ji=u("caption"),Ki=u("col"),Ui=u("colgroup"),Ji=u("table"),Gi=u("tbody"),Yi=u("td"),Zi=u("tfoot"),Xi=u("th"),Qi=u("thead"),es=u("tr"),Ne=u("button"),ts=u("datalist"),ns=u("fieldset"),rs=u("form"),os=u("input"),is=u("label"),ss=u("legend"),as=u("meter"),cs=u("optgroup"),us=u("option"),ls=u("output"),ds=u("progress"),fs=u("select"),ps=u("textarea"),ms=u("details"),gs=u("dialog"),bs=u("menu"),hs=u("summary"),ys=u("slot"),vs=u("template"),xs=u("base"),Ss=u("link"),Ts=u("meta"),ue=u("style"),Es=u("circle",L),ws=u("ellipse",L),ks=u("g",L),_s=u("line",L),As=u("path",L),Cs=u("polygon",L),Ns=u("polyline",L),Ls=u("rect",L),Rs=u("text",L),Ms=u("tspan",L),Hs=u("defs",L),$s=u("clipPath",L),Ds=u("mask",L),Is=u("pattern",L),Os=u("linearGradient",L),Ps=u("radialGradient",L),Bs=u("stop",L),Fs=u("use",L),zs=u("symbol",L),Vs=u("marker",L),qs=u("center"),Ws=u("font"),js=u("marquee"),Ks=e=>u(e);var vt="__sibuPendingError";function Rn(e,n){let t=()=>e.parentNode?(_(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[vt]=n)})}function Ke(e){let n=e,t=n[vt];if(t instanceof Error)return delete n[vt],t}function Mn(e){let n=null;return function(){if(n)return n();let r=k({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let s=n();z(r,s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));z(r,k({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Rn(r,s)}),r.appendChild(D("sibu-lazy-loading","Loading...")),T(r,()=>{o=!0}),r}}function Hn({nodes:e,fallback:n}){let t=k({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,s=null;return T(t,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!t.contains(s)&&H(s)}),queueMicrotask(()=>{if(!o)try{let a=e();if(s=a,a.classList.contains("sibu-lazy")){if(!a.querySelector(".sibu-lazy-loading")){z(t,a);return}i=new MutationObserver(()=>{if(o)return;a.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,z(t,a))}),i.observe(a,{childList:!0,subtree:!0})}else z(t,a)}catch(a){let c=a instanceof Error?a:new Error(String(a));Rn(t,c)}}),t}function Et(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";_(t,{phase:r,name:n});return}}function xt(e,n,t){let r=Et(e,n);typeof r=="function"&&t&&T(t,r)}var Se=new WeakMap,le=new WeakMap,Q=new Set,ee=new Set,Te=null,Ue=0,Us=256;function St(e){let n=Se.get(e);if(n){Se.delete(e),Q.delete(e);for(let t of n)try{t()}catch{}}}function Tt(e){le.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=le.get(e);if(t){le.delete(e),ee.delete(e);for(let r of t)try{r()}catch{}}})}function Js(e){if(Q.size===0||e.nodeType!==1)return;let n=e;if(Q.has(n)&&n.isConnected&&St(n),n.firstElementChild)for(let t of Array.from(Q))t!==n&&t.isConnected&&n.contains(t)&&St(t)}function Gs(e){if(ee.size===0||e.nodeType!==1)return;let n=e;if(ee.has(n)&&!n.isConnected&&Tt(n),n.firstElementChild)for(let t of Array.from(ee))t!==n&&!t.isConnected&&n.contains(t)&&Tt(t)}function Ys(){if(Q.size>0)for(let e of Array.from(Q))e.isConnected&&St(e);if(ee.size>0)for(let e of Array.from(ee))e.isConnected||Tt(e)}function $n(){Te||typeof document>"u"||(Te=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)Js(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)Gs(n.removedNodes[t])}Ue+=e.length,Ue>=Us&&(Ue=0,Ys()),wt()}),Te.observe(document.body,{childList:!0,subtree:!0}))}function wt(){Te&&Q.size===0&&ee.size===0&&(Te.disconnect(),Te=null,Ue=0)}function Zs(e,n){let t=Se.get(e);return t||(t=[],Se.set(e,t)),t.push(n),Q.add(e),$n(),()=>{let r=Se.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(Se.delete(e),Q.delete(e))}wt()}}function Xs(e,n){let t=le.get(e);return t||(t=[],le.set(e,t)),t.push(n),ee.add(e),$n(),()=>{let r=le.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(le.delete(e),ee.delete(e))}wt()}}function Je(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(T(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||xt(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){xt(e,"onMount",n);return}let r=Zs(n,()=>{t||xt(e,"onMount",n)});T(n,r)})}else queueMicrotask(()=>{Et(e,"onMount")})}function Qs(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,Et(e,"onUnmount"))};T(n,r);let o=()=>{if(t)return;let i=Xs(n,r);T(n,i)};n.isConnected?o():Je(()=>{o()},n)}function ea(e,n){T(n,e)}var kt=Symbol.for("sibujs.ssr.v1");function ta(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,t=process.getBuiltinModule;typeof t=="function"?n=t("node:async_hooks"):typeof Xe=="function"&&(n=Xe("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var de=globalThis[kt]??(globalThis[kt]=ta()),Le=de.als,Z=de.fallbackStore;de.fallbackDepth??(de.fallbackDepth=0);var Dn=!1;function na(){if(Dn||Le||!(typeof process<"u"&&!!process.versions?.node))return;Dn=!0;let n=process.versions.node;M(`SSR request isolation is UNAVAILABLE on this runtime (Node ${n}). AsyncLocalStorage could not be loaded, so concurrent requests share one SSR store: request state and the query cache can bleed between them. Node >= 22.3 is required for isolated SSR under ESM; the CommonJS build works on older versions. A fully synchronous render is unaffected.`)}function fe(){if(Le){let e=Le.getStore();if(e)return e}return Z}function J(){return fe().ssr}function In(e){if(!J())return null;let n=fe(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function On(){fe().ssr=!0}function Pn(){fe().ssr=!1}function Bn(e){let n={ssr:!0,suspenseIdCounter:0,locale:void 0};if(Le)return Le.run(n,e);na();let t=Z.ssr,r=Z.suspenseIdCounter,o=Z.locale;Z.ssr=!0,Z.suspenseIdCounter=0,Z.locale=void 0,de.fallbackDepth++;try{return e()}finally{de.fallbackDepth--,Z.ssr=t,Z.suspenseIdCounter=r,Z.locale=o}}function Fn(e){let n=fe(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var qn=globalThis;function ra(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,Ae(()=>n(o,void 0));else{let i=t;t=o,Ae(()=>n(o,i))}}}var zn=100;function _t(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){_(r,{phase:"cleanup"})}}}function Vn(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&_t(e),oe(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=zn);e.rerunPending&&(e.rerunPending=!1,_(new Error(`effect re-requested itself ${zn}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function oa(e){if(e.disposed)return;e.disposed=!0;let n=qn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&_t(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{Tn(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function q(e,n){if(R(typeof e=="function","effect: argument must be a function."),J())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=s=>{t.userCleanups.push(s)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(s){r(s)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(!t.disposed){if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&_t(t),oe(t.bodyFn,o),t.rerunPending&&Vn(t)}finally{t.running=!1,t.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,t.subscriber=o,t.running=!0;try{oe(t.bodyFn,t.subscriber),t.rerunPending&&Vn(t)}finally{t.running=!1,t.rerunPending=!1}let i=qn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>oa(t)}var Re=0,At=new Set;function ia(e){Re++;try{return e()}finally{Re--,Re===0&&ca()}}function sa(e){return Re===0?!1:(At.add(e),!0)}function aa(){return Re>0}function ca(){try{for(let e of At)kn(e)}finally{At.clear()}wn()}var Wn=Symbol.for("sibujs.reactive.batch.v1");function ua(){let e=globalThis,n=e[Wn];if(n)return n;let t={batch:ia,enqueueBatchedSignal:sa,isBatching:aa};return e[Wn]=t,t}var Ct=ua(),F=Ct.batch,pe=Ct.enqueueBatchedSignal,la=Ct.isBatching;var Nt=globalThis;function C(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=n?.name,o=n?.equals;r&&(t.__name=r);function i(){return ye(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;if(!o(c,l)){if(t.value=l,t.__v++,!0){let d=Nt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l})}pe(t)||ve(t)}}:s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;if(Object.is(l,c))return;t.value=l,t.__v++;let d=Nt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l}),pe(t)||ve(t)},!0){let a=Nt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}function da(e){let[n,t]=C(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var fa=`
|
|
6
6
|
.sibu-error-display {
|
|
7
7
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
8
8
|
border-radius: 10px;
|
|
@@ -183,11 +183,11 @@
|
|
|
183
183
|
border: 1px solid #3a3a4e;
|
|
184
184
|
}
|
|
185
185
|
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
186
|
-
`,
|
|
187
|
-
`);for(let r of t){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){n.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&n.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return n}function
|
|
186
|
+
`,jn=!1;function pa(){if(jn||typeof document>"u")return;let e=ue({nodes:fa});document.head.appendChild(e),jn=!0}function ma(e){let n=[],t=e.split(`
|
|
187
|
+
`);for(let r of t){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){n.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&n.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return n}function Kn(e){if(e instanceof Error){let n=e.code??e.name??"ERROR",t=e.message||"Unknown error",r=e.stack??"",o=ma(r),i=e.cause,s=i!=null?Kn(i):null;return{code:n,message:t,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function ga(e,n,t){let r=[];r.push(t),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
|
|
188
188
|
`).map(s=>` ${s}`).join(`
|
|
189
189
|
`);r.push(i)}o=o.cause}if(n&&Object.keys(n).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(n))r.push(` ${i}: ${String(s)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
|
|
190
|
-
`)}function
|
|
190
|
+
`)}function Un(e){let n=e.map((t,r)=>k({class:"sibu-err-frame",nodes:[D({class:"sibu-err-line",nodes:String(r+1)}),D({class:"sibu-err-fn",nodes:t.fn}),D({class:"sibu-err-loc",nodes:` \u2014 ${t.loc}`})]}));return ht({class:"sibu-err-stack",nodes:n})}function Jn(e){return e?[k({class:"sibu-err-cause-label",nodes:"Caused by"}),k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[D({nodes:`[${e.code}] ${e.message}`}),D({nodes:""})]}),e.frames.length>0?Un(e.frames):k({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Jn(e.cause)]:[]}function ba(e){let n=[];for(let[r,o]of Object.entries(e)){n.push(document.createElement("dt")),n[n.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),n.push(i)}let t=document.createElement("dl");t.className="sibu-err-meta";for(let r of n)t.appendChild(r);return t}function Lt(e){pa();let n=e.severity??"error",t=Kn(e.error),r=e.alwaysShowDetails??Y(),o=e.title??t.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),c=Ne({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let f=ga(t,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(f).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),l=k({class:"sibu-err-header",nodes:[yt({class:"sibu-err-icon",nodes:t.code}),bt({class:"sibu-err-title",nodes:o}),c,D({class:"sibu-err-timestamp",nodes:i})]}),d=[gt({class:"sibu-err-message",nodes:t.message})];r&&t.frames.length>0&&d.push(k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[D({nodes:"Stack Trace"})]}),Un(t.frames)]})),r&&d.push(...Jn(t.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[D({nodes:"Metadata"})]}),ba(e.metadata)]}));let p=[];e.onRetry&&p.push(Ne({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&p.push(Ne({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),p.length>0&&d.push(k({class:"sibu-err-actions",nodes:p}));let g=k({class:"sibu-err-body",nodes:d});return k({class:"sibu-error-display","data-severity":n,nodes:[l,g]})}var ha=`
|
|
191
191
|
.sibu-error-boundary {
|
|
192
192
|
position: relative;
|
|
193
193
|
}
|
|
@@ -341,7 +341,7 @@
|
|
|
341
341
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
342
342
|
background: #3a3a4e;
|
|
343
343
|
}
|
|
344
|
-
`,
|
|
344
|
+
`,ya=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Gn=!1;function va(){if(!Gn&&typeof document<"u"){let e=ue({nodes:ha});document.head.appendChild(e),Gn=!0}}function xa(e,n){let t=typeof e=="function"?e:n,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;va();let[a,c]=C(null),l=()=>{p(),c(null)},d=null,p=()=>{if(!d)return;let v=d;d=null,v()},g=v=>{let S=new Array(v.length);for(let E=0;E<v.length;E++)try{S[E]=v[E]()}catch($){_($,{phase:"effect",name:"ErrorBoundary.resetKeys"}),S[E]=ya}return S},f=()=>{let v=s;if(!v||v.length===0)return;p();let S=null;d=q(()=>{let E=g(v);if(S===null){S=E;return}let $=E.length!==S.length;if(!$){for(let P=0;P<E.length;P++)if(!Object.is(E[P],S[P])){$=!0;break}}S=E,$&&l()})},m=v=>{let S=et(v);if(c(S),f(),i)try{i(S)}catch(E){_(E,{phase:"render",name:"ErrorBoundary onError callback"})}return S},b=(v,S)=>Lt({error:v,severity:"error",onRetry:S}),h=v=>{let S=o||b;try{return S(v,l)}catch(E){return queueMicrotask(()=>{_(E,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=k({class:"sibu-error-boundary",nodes:()=>{let v=a();if(v)return h(v);try{let S=t();if(S&&typeof S.then=="function"){let E=k({class:"sibu-error-async"});E.appendChild(D({class:"sibu-lazy-loading",nodes:"Loading..."}));let $=!1;return T(E,()=>{$=!0}),S.then(P=>{if($){H(P);return}z(E,P)}).catch(P=>{if($)return;let ge=m(P);z(E,h(ge))}),E}return S}catch(S){let E=m(S);return h(E)}}}),w=v=>{if(a())return;let E=v.detail?.error;E&&(v.preventDefault(),v.stopPropagation(),m(E))};return y.addEventListener("sibu:error-propagate",w),Je(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),S=[],E=v.currentNode;for(;E;){let $=Ke(E);$&&S.push($),E=v.nextNode()}if(S.length===1)m(S[0]);else if(S.length>1){let $=globalThis.AggregateError;m($?new $(S,`${S.length} pre-mount errors caught by ErrorBoundary`):new Error(S.map(P=>P.message).join("; ")))}},y),T(y,()=>{p(),y.removeEventListener("sibu:error-propagate",w)}),y}var Sa=`
|
|
345
345
|
@keyframes sibu-spin {
|
|
346
346
|
to { transform: rotate(360deg); }
|
|
347
347
|
}
|
|
@@ -394,5 +394,5 @@
|
|
|
394
394
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
395
395
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
396
396
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
397
|
-
`,
|
|
398
|
-
`||t[r]==="\r");)r++}function s(){if(t.charCodeAt(r)!==0)return-1;let f=r;r++;let m=0;for(;r<o&&t.charCodeAt(r)!==0;)m=m*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,m<0||m>=n?(r=f,-1):m}function a(){let f=r;for(;r<o;){let m=t.charCodeAt(r);if(m>=97&&m<=122||m>=65&&m<=90||m>=48&&m<=57||m===45)r++;else break}return t.slice(f,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let f=s();if(f>=0)return{kind:"expr",idx:f};let m=t[r];if(m==='"'||m==="'"){r++;let b=[],h=[],y="";for(;r<o&&t[r]!==m;){let w=s();w>=0?(b.push(y),y="",h.push(w)):y+=t[r++]}return r<o&&r++,b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}{let b=[],h=[],y="";for(;r<o;){let w=t.charCodeAt(r);if(w===32||w===9||w===10||w===13||w===62)break;let v=s();v>=0?(b.push(y),y="",h.push(v)):y+=t[r++]}return b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function l(){let f=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let m=r;for(;r<o;){let y=t.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let b=t.slice(m,r);if(!b)break;let h=c();b.startsWith("on:")?h.kind==="expr"&&f.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?f.push({t:4,name:b}):h.kind==="static"?f.push({t:0,name:b,value:h.value}):h.kind==="expr"?f.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&f.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return f}function d(f){return f.replace(/\s+/g," ")}function p(f){let m="";for(;r<o&&t[r]!=="<";){let h=s();if(h>=0){let y=d(m);y&&f.push({t:1,value:y}),m="",f.push({t:2,idx:h})}else m+=t[r++]}let b=d(m);b&&f.push({t:1,value:b})}function g(){let f=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let m=t[r+1];if(m==="!"){if(t.startsWith("<!--",r)){let v=t.indexOf("-->",r+4);r=v===-1?o:v+3}else if(t.startsWith("<![CDATA[",r)){let v=t.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=t.indexOf(">",r);r=v===-1?o:v+1}continue}if(m==="?"){let v=t.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(m>="a"&&m<="z")&&!(m>="A"&&m<="Z")){f.push({t:1,value:"<"}),r++;continue}r++;let b=a(),h=l();i();let y=mc.has(b),w=t[r]==="/";if(w&&r++,r<o&&r++,y||w)f.push({t:0,el:{tag:b,svg:ns.has(b),attrs:h,children:[]}});else{let v=g();if(pc.has(b.toLowerCase())){for(let S=0;S<v.length;S++)if(v[S].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,a(),i(),r<o&&t[r]===">"&&r++),f.push({t:0,el:{tag:b,svg:ns.has(b),attrs:h,children:v}})}}else p(f);return f}return g()}function tn(e,n){let t=e.svg?document.createElementNS(N,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:t.setAttribute(o.name,o.value);break;case 1:{let i=o.name,s=n[o.idx];typeof s=="function"?T(t,Ge(t,i,s)):K(t,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=n[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}K(t,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):M(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(tn(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),T(t,de(s,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?t.appendChild(a):a!=null&&typeof a!="boolean"&&t.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function nn(e,...n){let t=rs.get(e);if(t||(t=gc(e),rs.set(e,t)),t.length===1&&t[0].t===0)return tn(t[0].el,n);let r=document.createElement("div");for(let o=0;o<t.length;o++){let i=t[o];switch(i.t){case 0:r.appendChild(tn(i.el,n));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=n[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),T(r,de(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let c=s[a];c instanceof Node?r.appendChild(c):c!=null&&typeof c!="boolean"&&r.appendChild(document.createTextNode(String(c)))}else s!=null&&typeof s!="boolean"&&r.appendChild(document.createTextNode(String(s)));break}}}return r.childNodes.length===1&&r.firstChild instanceof Element?r.firstChild:r}function os(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&Y()&&M("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,c=null,l=!1,d=!1,p=()=>{if(d)return;let f=e(),m=r.parentNode;if(!m||l&&f===a)return;c?.parentNode&&m.removeChild(c),a=f;let b=o.get(f);if(b){let h=i.indexOf(f);h!==-1&&(i.splice(h,1),i.push(f))}else{let h=n[f];if(!h){c=null,l=!0;return}if(b=h(),b instanceof DocumentFragment){let y=document.createElement("div");y.style.display="contents",y.appendChild(b),b=y}if(o.set(f,b),i.push(f),s>0&&i.length>s){let y=i.shift(),w=o.get(y);w&&(H(w),w.parentNode&&w.parentNode.removeChild(w),o.delete(y))}}m.insertBefore(b,r.nextSibling),c=b,l=!0},g=O(p);return l||queueMicrotask(()=>{!l&&r.parentNode&&p()}),T(r,()=>{d=!0,g();for(let f of o.values())H(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function is(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");R(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let t=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-t:0;n.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:n,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),H(r),r.parentNode&&r.parentNode.removeChild(r)}}}function ss(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){queueMicrotask(()=>{_(s,{phase:"render",name:"Portal",node:t.parentNode?t:void 0})})}}),T(t,()=>{i=!0,o&&(H(o),o.remove(),o=null)}),t}function as(e,n="default"){return e?.[n]}function cs(e=[]){let[n,t]=C([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return t(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){t(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return t(c=>{let l=[...c];return a=l.splice(o,i,...s),l}),a},remove(o){t(i=>i.filter((s,a)=>a!==o))},removeWhere(o){t(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){t([...o])},update(o,i){t(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){t(s=>s.map(a=>o(a)?i(a):a))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function us(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,ae(r)||Se(r)}function i(){if(xe(r),t===null){let a=n.slice();t=Object.freeze(a)}return t}return[i,{push(...a){a.length!==0&&(n.push(...a),o())},pop(){if(n.length===0)return;let a=n.pop();return o(),a},shift(){if(n.length===0)return;let a=n.shift();return o(),a},unshift(...a){a.length!==0&&(n.unshift(...a),o())},splice(a,c=0,...l){let d=n.splice(a,c,...l);return(d.length>0||l.length>0)&&o(),d},remove(a){a<0||a>=n.length||(n.splice(a,1),o())},removeWhere(a){let c=n.findIndex(a);c!==-1&&(n.splice(c,1),o())},set(a){n=[...a],o()},update(a,c){a<0||a>=n.length||Object.is(n[a],c)||(n[a]=c,o())},updateWhere(a,c){let l=!1;for(let d=0;d<n.length;d++)if(a(n[d])){let p=c(n[d]);Object.is(n[d],p)||(n[d]=p,l=!0)}l&&o()},sort(a){n.length<=1||(n.sort(a),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(a){let c=n.filter(a);c.length!==n.length&&(n=c,o())},map(a){let c=!1;for(let l=0;l<n.length;l++){let d=a(n[l],l);Object.is(n[l],d)||(n[l]=d,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function ls(e,n){let[t,r]=C(n),[o,i]=C(!1),[s,a]=C(null),[c,l]=C(0),d=0,p=!1,g=null,f=()=>{if(g===null)return;let b=g;g=null;try{b.abort()}catch{}},m=V(()=>{if(c(),p)return;f();let b=++d,h=typeof AbortController<"u"?new AbortController:null;g=h,F(()=>{i(!0),a(null)});let y=()=>p||b!==d,w;try{w=e({signal:h?h.signal:void 0})}catch(v){if(y())return;F(()=>{a(v),i(!1)});return}w.then(v=>{y()||(g=null,F(()=>{r(v),i(!1)}))},v=>{y()||(g=null,F(()=>{a(v),i(!1)}))})});return{value:t,loading:o,error:s,refresh:()=>{p||l(b=>b+1)},dispose:()=>{p||(p=!0,m(),f())}}}function _e(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let c=n;return e.source===c.source&&e.flags===c.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let c=n;if(e.size!==c.size)return!1;for(let[l,d]of e)if(!c.has(l)||!_e(d,c.get(l),t))return!1;return!0}if(e instanceof Set){let c=n;if(e.size!==c.size)return!1;for(let l of e)if(!c.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let c=new Uint8Array(e),l=new Uint8Array(n);if(c.length!==l.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==l[d])return!1;return!0}if(e instanceof DataView){if(!(n instanceof DataView)||e.byteLength!==n.byteLength)return!1;for(let c=0;c<e.byteLength;c++)if(e.getUint8(c)!==n.getUint8(c))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let c=e,l=n;if(c.length!==l.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==l[d])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((c,l)=>_e(c,n[l],t));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(c=>Object.hasOwn(o,c)&&_e(r[c],o[c],t))}function ds(e){return C(e,{equals:(n,t)=>_e(n,t)})}function nt(e,n){R(typeof e=="function","derived: argument must be a getter function.");let t=n?.name,r=n?.equals,o={};o._d=!1,o._init=!1,o._g=e,o.__v=0;let i=()=>{o._d||(o._d=!0)};i._c=1,i._sig=o;let s=()=>{let p=e();o._v=r&&o._init&&r(o._v,p)?o._v:p,o._d=!1,o._init=!0};O(()=>{let p=!0;try{o._v=e(),o._d=!1,o._init=!0,p=!1}finally{p&&(o._d=!0)}},i);let a=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,c=!1,l=()=>{if(!o._d)return;let p=o._v;c=!0;try{Q(s,i),Object.is(p,o._v)||o.__v++}finally{c=!1}a&&!Object.is(p,o._v)&&a.emit("computed:update",{signal:o,oldValue:p,newValue:o._v})};o._validate=l;function d(){if(c)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Vn()?(o._d&&l(),o._v):(o._d&&l(),xe(o),o._v)}return t&&(d.__name=t,o.__name=t),d.__signal=o,a&&a.emit("computed:create",{signal:o,name:t,getter:d}),d}function fs(e){let[n,t]=C(e);return{get current(){return n()},set current(r){t(r)}}}function ps(e){R(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let n={};Object.keys(e).forEach(c=>{let[l,d]=C(e[c]);n[c]=[l,d]});let t=new Proxy({},{get(c,l){if(typeof l=="string"&&Object.hasOwn(n,l)){let d=n[l][0];return d()}return Reflect.get(c,l)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(n).forEach(l=>{c[l]=n[l][0]()}),c};return[t,{setState:c=>{let l=r(),d=typeof c=="function"?c(l):c;F(()=>{Object.entries(d).forEach(([p,g])=>{Object.hasOwn(n,p)&&n[p][1](g)})})},reset:()=>{F(()=>{Object.keys(e).forEach(c=>{let l=n[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return V(()=>{let d=r();if(l){l=!1;return}Le();try{c(d)}finally{Re()}})},subscribeKey:(c,l)=>{let d,p=!0;return V(()=>{let g=n[c][0]();if(p){d=g,p=!1;return}if(!Object.is(g,d)){let f=d;d=g,Le();try{l(g,f)}finally{Re()}}})},getSnapshot:r}]}function ms(e,n){if(R(typeof e=="function","watch: first argument must be a getter function."),R(typeof n=="function","watch: second argument must be a callback function."),W())return()=>{};let t,r=!0;return O(()=>{let s=e();if(r){t=s,r=!1;return}if(!Object.is(s,t)){let a=t;t=s,Le();try{n(s,a)}finally{Re()}}})}function gs(e,n,t){return[nt(e,t),i=>{F(()=>n(i))}]}function bs(e){let n=e();return Y()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function hs(e){if(!Y())return V(e);let n=V(e),t=null;return queueMicrotask(()=>{try{t=V(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}var rn="data-sibu-enhanced",on=new WeakMap;function ys(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=Ce){let i=r.length-o+e.length;e.length=0,Ne(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var vs=["text","attr","class","show","on","cleanup"];function xs(e,n){if(n==null)return e;if(typeof n!="string")return n;let t=n.startsWith("@")?`[data-ref="${n.slice(1)}"]`:n;try{return e.querySelector(t)}catch{return null}}function Oe(e,n){return W()?()=>{}:q(n,e)}function bc(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,n=>n.value):e.value}function hc(e,n){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!n;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(n)?n.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let t=n==null?"":String(n);e.value!==t&&(e.value=t)}function yc(e,n,t,r){let o=`ctx.each[${r}]`;if(Y())for(let i of Object.keys(t))R(vs.includes(i),`${o}: unknown binding "${i}". Expected one of: ${vs.join(", ")}.`);if(t.text!==void 0&&(R(typeof t.text=="function",`${o}: "text" must be a function returning the value.`),e.text(n,t.text)),t.attr!==void 0)for(let i of Object.keys(t.attr)){let s=t.attr[i];R(typeof s=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(n,i,s)}if(t.class!==void 0)for(let i of Object.keys(t.class)){let s=t.class[i];R(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(n,i,s)}if(t.show!==void 0&&(R(typeof t.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(n,t.show)),t.on!==void 0)for(let i of Object.keys(t.on)){let s=t.on[i];R(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(n,i,s)}t.cleanup!==void 0&&(R(typeof t.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(t.cleanup))}function Pe(e,n){let t=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!t)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(t.getAttribute(rn)==="true")return Y()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=g=>s?(j(()=>`enhance: ctx.${g}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`),!0):!1,c=(g,f,m)=>{if(a(g))return;let b=xs(t,f);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(f)} not found under`,t);return}m(b)},l={root:t,ref:g=>xs(t,g),refs:g=>{let f=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(t.querySelectorAll(f))}catch{return[]}},on:(g,f,m,b)=>{c("on",g,h=>{let y=w=>m(w,h);h.addEventListener(f,y,b),r.push(()=>h.removeEventListener(f,y,b))})},text:(g,f)=>{c("text",g,m=>{r.push(Oe(m,()=>{let b=f(),h=b==null?"":String(b);m.textContent!==h&&(m.textContent=h)}))})},attr:(g,f,m)=>{c("attr",g,b=>{r.push(Oe(b,()=>{let h=m(),y=h==null?null:String(h);K(b,f,y,{syncValueProperty:!1,label:"enhance attr()"})}))})},classed:(g,f,m)=>{c("classed",g,b=>{r.push(Oe(b,()=>{b.classList.toggle(f,!!m())}))})},show:(g,f)=>{c("show",g,m=>{let b=m.hidden;r.push(Oe(m,()=>{m.hidden=!f()})),r.push(()=>{m.hidden=b})})},model:(g,f,m)=>{c("model",g,b=>{let h=b,[y,w]=f,v=m?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(Oe(b,()=>{hc(h,y())}));let S=()=>w(bc(h));h.addEventListener(v,S),r.push(()=>h.removeEventListener(v,S))})},each:(g,f)=>{if(a("each"))return;R(typeof f=="function","ctx.each: second argument must be a function.");let m=typeof g=="string"?l.refs(g):Array.from(g);for(let b=0;b<m.length;b++){let h=m[b],y=f(h,b);y!=null&&yc(l,h,y,b)}},cleanup:g=>{a("cleanup")||r.push(g)}},d;try{d=n(l);let g=d;if(g&&typeof g.then=="function")throw g.then(void 0,f=>{j(()=>`enhance: the promise returned by the setup also rejected: ${String(f)}`)}),new Error("[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored.")}catch(g){throw ys(r,"enhance"),s=!0,g}typeof d=="function"&&r.push(d);let p=()=>{i||(i=!0,on.get(t)===o&&(on.delete(t),t.removeAttribute(rn)),Ve(t,p),ys(r,"enhance"),s=!0)};return T(t,p),on.set(t,o),t.setAttribute(rn,"true"),p}function Ss(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push(Pe(r,n))}catch(r){for(let o=t.length-1;o>=0;o--)try{t[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw t.length=0,r}return()=>{for(let r of t.splice(0))r()}}function Ts(e,n){let t=globalThis;return t[e]??(t[e]=n())}var vc=/^[A-Za-z0-9_-]+$/,Es=Symbol.for("sibujs.islands.lazy"),rt=Ts(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function ws(e){return e[Es]=!0,e}function ks(e,n){if(!vc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);rt.set(e,n)}function _s(e){rt.delete(e)}async function xc(e){if(typeof e=="function"&&e[Es]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function As(e=typeof document<"u"?document:null,n={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let t=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!rt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,c=()=>{if(a||o)return;a=!0;let d=rt.get(s);d&&xc(d).then(p=>{if(!o){if(!p){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=Pe(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)})},l=i.getAttribute("data-sibu-load")||"load";t.push(Sc(l,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function Sc(e,n,t,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(t);return()=>cancelIdleCallback(i)}let o=setTimeout(t,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(t),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),t())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(n),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),t()},s=()=>{for(let a of o)n.removeEventListener(a,i)};for(let a of o)n.addEventListener(a,i,{passive:!0});return s}case"media":{let o=n.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(t),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(t),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),t())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(t),()=>{}}}function sn(e){return e}var kd=1024*1024;function Ns(e){let[n,t]=C(e()),r=!1,o=!1,i=n(),s=()=>{r=!1,!o&&t(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=O(()=>{i=e(),a()}),l=(()=>n());return l.dispose=()=>{o||(o=!0,c())},l}var Cs=16;function Tc(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:Cs*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Cs)}function Ls(){let[e,n]=C(!1);function t(r){n(!0),Tc(()=>{let o;try{o=r()}catch{n(!1);return}o&&typeof o.then=="function"?o.then(()=>n(!1),()=>n(!1)):n(!1)})}return{pending:e,start:t}}function Rs(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof window<"u"&&(window.Sibu=an);return Ws(Ec);})();
|
|
397
|
+
`,Yn=!1;function Ta(){!Yn&&typeof document<"u"&&(document.head.appendChild(ue({nodes:Sa})),Yn=!0)}function Ea(e={}){Ta();let{text:n,variant:t="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return t==="dots"?k({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[k({class:"sibu-loading-dots",nodes:[D({class:"sibu-loading-dot"}),D({class:"sibu-loading-dot"}),D({class:"sibu-loading-dot"})]}),n?D({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)}):k({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[k({class:"sibu-loading-spinner"}),n?D({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)})}var Rt=Symbol.for("sibujs.actions.v1"),Zn=globalThis[Rt]??(globalThis[Rt]=new Map);function Ee(e,n){Zn.set(e,n)}function Xn(e){return Zn.get(e)}function wa(e,n,t){let r=typeof n=="string"?Xn(n):n;if(!r)throw new Error(`[SibuJS] No action registered under the name "${n}". Register it with registerAction() before applying it by name.`);let o=r(e,t);typeof o=="function"&&T(e,o)}var Qn=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},er=(e,n)=>{let t=n.duration??500,r=null,o=()=>{r=setTimeout(()=>{n.callback(),r=null},t)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},tr=(e,n)=>{let t=()=>{let r=typeof n=="function"?n():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},nr=e=>{let n=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return n(),e.addEventListener("input",n),()=>e.removeEventListener("input",n)},rr=e=>{let n='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',t=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(n));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)};Ee("clickOutside",Qn);Ee("longPress",er);Ee("copyOnClick",tr);Ee("autoResize",nr);Ee("trapFocus",rr);var me=null;function ka(e,n){try{let t=e();return t&&typeof t.then=="function"&&t.catch(r=>{n?n(r,"async"):me?me(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),t}catch(t){return n?n(t,"sync"):me?me(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function _a(e,n){try{return await e()}catch(t){return n?n(t,"async"):me?me(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function Aa(e){me=e}function Ca(e){let[n,t]=C(e),r=i=>{!!0||!J()||M(`context.${i}() called during SSR. SibuJS context() is application-global \u2014 it is NOT isolated per request, so a concurrent request can observe this value. Do not use context() for request-specific SSR data; pass it explicitly or use request-scoped storage instead.`)};return{provide(i){r("provide");let s=n();return t(i),()=>t(s)},use(){return n},get(){return n()},set(i){r("set"),t(i)},withContext(i,s){r("withContext");let a=n();t(i);try{let c=s();return c!==null&&typeof c?.then=="function"&&M("context.withContext() received an async callback. Scoping is synchronous only \u2014 the previous value is restored as soon as the callback returns its promise, so anything after an `await` runs outside the scope."),c}finally{t(a)}}}}var Mt=Symbol.for("sibujs.createId.v1"),Ht=globalThis[Mt]??(globalThis[Mt]={n:0});function Na(e="sibu"){return Ht.n++,`${e}-${Ht.n}`}function La(){Ht.n=0}function Ra(e,n){let t=typeof n=="function"?n():n;return T(t,O(()=>{t.style.display=e()?"":"none"})),t}function or(e,n,t,r,o){let i=typeof t=="function"?t():t;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===t,c=r.has(s),l=!a&&!c;return r.add(s),c&&W(()=>`${o}: ${a?"a branch was given as an element rather than a function":"a branch factory returned a node it had already returned"}, so the SAME node is being re-attached \u2014 any state it accumulated while detached (input value, scroll position, classes set imperatively) comes back with it. Its reactive bindings are left intact rather than disposed, because the node is not this directive's to tear down. Return a FRESH node per call (\`() => div(\u2026)\`) for rebuild semantics, or keep this form deliberately when the reuse is what you want.`),e.insertBefore(s,n.nextSibling),{node:s,owned:l}}function Ma(e,n,t){let r=document.createComment("when"),o=null,i,s=!1,a=new WeakSet,c=!1,l=()=>{let d=e(),p=r.parentNode;if(!p||s&&d===i)return;i=d;let g=o?Ce([o]):null;o?.parentNode&&(c&&H(o),o.parentNode.removeChild(o),o=null);let m=or(p,r,d?n:t!==void 0?t:null,a,"when");o=m.node,c=m.owned,xe(g,o?[o]:[],"when"),s=!0};return T(r,O(l)),s||queueMicrotask(()=>{!s&&r.parentNode&&l()}),r}function Ha(e,n,t){let r=document.createComment("match"),o=null,i,s=!1,a=new WeakSet,c=!1,l=()=>{let d=String(e()),p=r.parentNode;if(!p||s&&d===i)return;i=d;let g=o?Ce([o]):null;o?.parentNode&&(c&&H(o),o.parentNode.removeChild(o),o=null);let f=Object.hasOwn(n,d)?n[d]:t,m=or(p,r,f??null,a,"match");o=m.node,c=m.owned,xe(g,o?[o]:[],"match"),s=!0};return T(r,O(l)),s||queueMicrotask(()=>{!s&&r.parentNode&&l()}),r}var $t=new Map;function $a(e,n){$t.set(e,n)}function Da(e){$t.delete(e)}function ir(e){let n=$t.get(e);return n?n():k({nodes:`[Component "${e}" not found]`})}function Ia(e){let n=k({class:"sibu-dynamic"});function t(){let o=e(),i;typeof o=="function"?i=o():i=ir(o),z(n,i)}let r=O(t);return T(n,r),n}function sr(e){return typeof e=="function"?sr(e()):e instanceof Node?e:document.createTextNode(String(e))}function Oa(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let a=0;a<n;a++){let c=e[a],l=0,d=t.length;for(;l<d;){let p=l+d>>1;e[t[p]]<c?l=p+1:d=p}t[l]=a,r[a]=l>0?t[l-1]:-1}let o=t.length,i=new Array(o),s=t[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Pa(e,n,t){R(typeof e=="function","each: first argument must be a function that returns an array."),R(typeof n=="function","each: second argument must be a render function."),R(t&&typeof t.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,l=new Map,d=new Map,p=[],g=[],f=[],m=0,b=[],h=[],y=new Uint8Array(0),w=new Map,v=[],S=[],E=new Map,$=!1,P=!1,ge=!1,yr=t.key,Ft=()=>{if(ge)return;let G=e(),A=G.length,ie=r.parentNode;if(!ie)return;P||(ie.insertBefore(o,r.nextSibling),P=!0),h.length<A&&(h=new Array(A));for(let x=0;x<A;x++)h[x]=yr(G[x]);let te=h;b.length<A&&(b=new Array(A)),d.clear(),E.clear();for(let x=0;x<A;x++)E.has(te[x])&&M(`each: duplicate key "${String(te[x])}" at index ${x} (first seen at ${E.get(te[x])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),E.set(te[x],x);m=0;for(let x=0;x<A;x++){let B=te[x],Vt=l.get(B),we;if(Vt!==void 0)we=Vt,p[m]=we,g[m]=G[x],f[m]=x,m++;else{let[qt,Tr]=C(G[x]),[Wt,Er]=C(x),Ze;try{Ze=sr(n(qt,Wt))}catch(wr){let kr=te[x];Ze=document.createComment(`each:error:${x}`),queueMicrotask(()=>{_(wr,{phase:"render",name:`each row (key="${String(kr)}")`,node:r.parentNode?r:void 0})})}we={node:Ze,item:qt,setItem:Tr,index:Wt,setIndex:Er}}d.set(B,we),b[x]=we.node}for(let[x,B]of l)d.has(x)||(H(B.node),B.node.parentNode&&ie.removeChild(B.node));if(A===0){c=0;let x=l;l=d,d=x,$=!0,m=0;return}w.clear();for(let x=0;x<c;x++)w.set(a[x],x);v.length<A&&(v=new Array(A),S=new Array(A));let $e=0;for(let x=0;x<A;x++){let B=w.get(te[x]);B!==void 0&&(v[$e]=x,S[$e]=B,$e++)}let zt=Oa(S,$e);y.length<A?y=new Uint8Array(A):y.fill(0,0,A);for(let x=0;x<zt.length;x++)y[v[zt[x]]]=1;let De=o;for(let x=A-1;x>=0;x--){let B=b[x];y[x]||B.nextSibling!==De&&ie.insertBefore(B,De),De=B}let Ie=a===i?s:i;Ie.length<A&&(Ie.length=A);for(let x=0;x<A;x++)Ie[x]=te[x];a=Ie,c=A;let Sr=l;l=d,d=Sr,$=!0,vr()};function vr(){if(m===0)return;let G=m;m=0,F(()=>{for(let A=0;A<G;A++){let ie=p[A];ie.setItem(g[A]),ie.setIndex(f[A]),p[A]=void 0,g[A]=void 0}})}let xr=O(Ft);return T(r,()=>{if(!ge){ge=!0,xr();for(let G of l.values())H(G.node),G.node.parentNode?.removeChild(G.node);o.parentNode&&o.parentNode.removeChild(o),P=!1,l.clear(),d.clear(),E.clear(),w.clear(),c=0,p.length=0,g.length=0,f.length=0,m=0}}),$||queueMicrotask(()=>{!$&&!ge&&r.parentNode&&Ft()}),r}function Ba(e){let n=document.createDocumentFragment();for(let t of e)if(!(t==null||typeof t=="boolean"))if(Array.isArray(t))for(let r of t)r==null||typeof r=="boolean"||n.appendChild(ar(r));else n.appendChild(ar(t));return n}function ar(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let n=e();return n instanceof Node?n:document.createTextNode(String(n??""))}return document.createTextNode(String(e))}var Fa=new Set(["script","style"]),za=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),cr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),ur=new WeakMap;function Va(e){let n=e.length-1,t=e[0];for(let f=0;f<n;f++)t+=`\0${f}\0${e[f+1]}`;let r=0,o=t.length;function i(){for(;r<o&&(t[r]===" "||t[r]===" "||t[r]===`
|
|
398
|
+
`||t[r]==="\r");)r++}function s(){if(t.charCodeAt(r)!==0)return-1;let f=r;r++;let m=0;for(;r<o&&t.charCodeAt(r)!==0;)m=m*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,m<0||m>=n?(r=f,-1):m}function a(){let f=r;for(;r<o;){let m=t.charCodeAt(r);if(m>=97&&m<=122||m>=65&&m<=90||m>=48&&m<=57||m===45)r++;else break}return t.slice(f,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let f=s();if(f>=0)return{kind:"expr",idx:f};let m=t[r];if(m==='"'||m==="'"){r++;let b=[],h=[],y="";for(;r<o&&t[r]!==m;){let w=s();w>=0?(b.push(y),y="",h.push(w)):y+=t[r++]}return r<o&&r++,b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}{let b=[],h=[],y="";for(;r<o;){let w=t.charCodeAt(r);if(w===32||w===9||w===10||w===13||w===62)break;let v=s();v>=0?(b.push(y),y="",h.push(v)):y+=t[r++]}return b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function l(){let f=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let m=r;for(;r<o;){let y=t.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let b=t.slice(m,r);if(!b)break;let h=c();b.startsWith("on:")?h.kind==="expr"&&f.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?f.push({t:4,name:b}):h.kind==="static"?f.push({t:0,name:b,value:h.value}):h.kind==="expr"?f.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&f.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return f}function d(f){return f.replace(/\s+/g," ")}function p(f){let m="";for(;r<o&&t[r]!=="<";){let h=s();if(h>=0){let y=d(m);y&&f.push({t:1,value:y}),m="",f.push({t:2,idx:h})}else m+=t[r++]}let b=d(m);b&&f.push({t:1,value:b})}function g(){let f=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let m=t[r+1];if(m==="!"){if(t.startsWith("<!--",r)){let v=t.indexOf("-->",r+4);r=v===-1?o:v+3}else if(t.startsWith("<![CDATA[",r)){let v=t.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=t.indexOf(">",r);r=v===-1?o:v+1}continue}if(m==="?"){let v=t.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(m>="a"&&m<="z")&&!(m>="A"&&m<="Z")){f.push({t:1,value:"<"}),r++;continue}r++;let b=a(),h=l();i();let y=za.has(b),w=t[r]==="/";if(w&&r++,r<o&&r++,y||w)f.push({t:0,el:{tag:b,svg:cr.has(b),attrs:h,children:[]}});else{let v=g();if(Fa.has(b.toLowerCase())){for(let S=0;S<v.length;S++)if(v[S].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,a(),i(),r<o&&t[r]===">"&&r++),f.push({t:0,el:{tag:b,svg:cr.has(b),attrs:h,children:v}})}}else p(f);return f}return g()}function Dt(e,n){let t=e.svg?document.createElementNS(L,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:t.setAttribute(o.name,o.value);break;case 1:{let i=o.name,s=n[o.idx];typeof s=="function"?T(t,je(t,i,s)):j(t,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=n[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}j(t,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):M(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(Dt(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),T(t,ce(s,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?t.appendChild(a):a!=null&&typeof a!="boolean"&&t.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function lr(e,...n){let t=ur.get(e);if(t||(t=Va(e),ur.set(e,t)),t.length===1&&t[0].t===0)return Dt(t[0].el,n);let r=document.createElement("div");for(let o=0;o<t.length;o++){let i=t[o];switch(i.t){case 0:r.appendChild(Dt(i.el,n));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=n[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),T(r,ce(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let c=s[a];c instanceof Node?r.appendChild(c):c!=null&&typeof c!="boolean"&&r.appendChild(document.createTextNode(String(c)))}else s!=null&&typeof s!="boolean"&&r.appendChild(document.createTextNode(String(s)));break}}}return r.childNodes.length===1&&r.firstChild instanceof Element?r.firstChild:r}function qa(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&Y()&&M("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,c=null,l=!1,d=!1,p=()=>{if(d)return;let f=e(),m=r.parentNode;if(!m||l&&f===a)return;c?.parentNode&&m.removeChild(c),a=f;let b=o.get(f);if(b){let h=i.indexOf(f);h!==-1&&(i.splice(h,1),i.push(f))}else{let h=n[f];if(!h){c=null,l=!0;return}if(b=h(),b instanceof DocumentFragment){let y=document.createElement("div");y.style.display="contents",y.appendChild(b),b=y}if(o.set(f,b),i.push(f),s>0&&i.length>s){let y=i.shift(),w=o.get(y);w&&(H(w),w.parentNode&&w.parentNode.removeChild(w),o.delete(y))}}m.insertBefore(b,r.nextSibling),c=b,l=!0},g=O(p);return l||queueMicrotask(()=>{!l&&r.parentNode&&p()}),T(r,()=>{d=!0,g();for(let f of o.values())H(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function Wa(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");R(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let t=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-t:0;n.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:n,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),H(r),r.parentNode&&r.parentNode.removeChild(r)}}}function ja(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){queueMicrotask(()=>{_(s,{phase:"render",name:"Portal",node:t.parentNode?t:void 0})})}}),T(t,()=>{i=!0,o&&(H(o),o.remove(),o=null)}),t}function Ka(e,n="default"){return e?.[n]}function Ua(e=[]){let[n,t]=C([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return t(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){t(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return t(c=>{let l=[...c];return a=l.splice(o,i,...s),l}),a},remove(o){t(i=>i.filter((s,a)=>a!==o))},removeWhere(o){t(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){t([...o])},update(o,i){t(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){t(s=>s.map(a=>o(a)?i(a):a))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function Ja(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,pe(r)||ve(r)}function i(){if(ye(r),t===null){let a=n.slice();t=Object.freeze(a)}return t}return[i,{push(...a){a.length!==0&&(n.push(...a),o())},pop(){if(n.length===0)return;let a=n.pop();return o(),a},shift(){if(n.length===0)return;let a=n.shift();return o(),a},unshift(...a){a.length!==0&&(n.unshift(...a),o())},splice(a,c=0,...l){let d=n.splice(a,c,...l);return(d.length>0||l.length>0)&&o(),d},remove(a){a<0||a>=n.length||(n.splice(a,1),o())},removeWhere(a){let c=n.findIndex(a);c!==-1&&(n.splice(c,1),o())},set(a){n=[...a],o()},update(a,c){a<0||a>=n.length||Object.is(n[a],c)||(n[a]=c,o())},updateWhere(a,c){let l=!1;for(let d=0;d<n.length;d++)if(a(n[d])){let p=c(n[d]);Object.is(n[d],p)||(n[d]=p,l=!0)}l&&o()},sort(a){n.length<=1||(n.sort(a),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(a){let c=n.filter(a);c.length!==n.length&&(n=c,o())},map(a){let c=!1;for(let l=0;l<n.length;l++){let d=a(n[l],l);Object.is(n[l],d)||(n[l]=d,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function Ga(e,n){let[t,r]=C(n),[o,i]=C(!1),[s,a]=C(null),[c,l]=C(0),d=0,p=!1,g=null,f=()=>{if(g===null)return;let b=g;g=null;try{b.abort()}catch{}},m=q(()=>{if(c(),p)return;f();let b=++d,h=typeof AbortController<"u"?new AbortController:null;g=h,F(()=>{i(!0),a(null)});let y=()=>p||b!==d,w;try{w=e({signal:h?h.signal:void 0})}catch(v){if(y())return;F(()=>{a(v),i(!1)});return}w.then(v=>{y()||(g=null,F(()=>{r(v),i(!1)}))},v=>{y()||(g=null,F(()=>{a(v),i(!1)}))})});return{value:t,loading:o,error:s,refresh:()=>{p||l(b=>b+1)},dispose:()=>{p||(p=!0,m(),f())}}}function Me(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let c=n;return e.source===c.source&&e.flags===c.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let c=n;if(e.size!==c.size)return!1;for(let[l,d]of e)if(!c.has(l)||!Me(d,c.get(l),t))return!1;return!0}if(e instanceof Set){let c=n;if(e.size!==c.size)return!1;for(let l of e)if(!c.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let c=new Uint8Array(e),l=new Uint8Array(n);if(c.length!==l.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==l[d])return!1;return!0}if(e instanceof DataView){if(!(n instanceof DataView)||e.byteLength!==n.byteLength)return!1;for(let c=0;c<e.byteLength;c++)if(e.getUint8(c)!==n.getUint8(c))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let c=e,l=n;if(c.length!==l.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==l[d])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((c,l)=>Me(c,n[l],t));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(c=>Object.hasOwn(o,c)&&Me(r[c],o[c],t))}function Ya(e){return C(e,{equals:(n,t)=>Me(n,t)})}function It(e,n){R(typeof e=="function","derived: argument must be a getter function.");let t=n?.name,r=n?.equals,o={};o._d=!1,o._init=!1,o._g=e,o.__v=0;let i=()=>{o._d||(o._d=!0)};i._c=1,i._sig=o;let s=()=>{let p=e();o._v=r&&o._init&&r(o._v,p)?o._v:p,o._d=!1,o._init=!0};O(()=>{let p=!0;try{o._v=e(),o._d=!1,o._init=!0,p=!1}finally{p&&(o._d=!0)}},i);let a=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,c=!1,l=()=>{if(!o._d)return;let p=o._v;c=!0;try{oe(s,i),Object.is(p,o._v)||o.__v++}finally{c=!1}a&&!Object.is(p,o._v)&&a.emit("computed:update",{signal:o,oldValue:p,newValue:o._v})};o._validate=l;function d(){if(c)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Sn()?(o._d&&l(),o._v):(o._d&&l(),ye(o),o._v)}return t&&(d.__name=t,o.__name=t),d.__signal=o,a&&a.emit("computed:create",{signal:o,name:t,getter:d}),d}function Za(e){let[n,t]=C(e);return{get current(){return n()},set current(r){t(r)}}}function Xa(e){R(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let n={};Object.keys(e).forEach(c=>{let[l,d]=C(e[c]);n[c]=[l,d]});let t=new Proxy({},{get(c,l){if(typeof l=="string"&&Object.hasOwn(n,l)){let d=n[l][0];return d()}return Reflect.get(c,l)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(n).forEach(l=>{c[l]=n[l][0]()}),c};return[t,{setState:c=>{let l=r(),d=typeof c=="function"?c(l):c;F(()=>{Object.entries(d).forEach(([p,g])=>{Object.hasOwn(n,p)&&n[p][1](g)})})},reset:()=>{F(()=>{Object.keys(e).forEach(c=>{let l=n[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return q(()=>{let d=r();if(l){l=!1;return}ke();try{c(d)}finally{_e()}})},subscribeKey:(c,l)=>{let d,p=!0;return q(()=>{let g=n[c][0]();if(p){d=g,p=!1;return}if(!Object.is(g,d)){let f=d;d=g,ke();try{l(g,f)}finally{_e()}}})},getSnapshot:r}]}function Qa(e,n){if(R(typeof e=="function","watch: first argument must be a getter function."),R(typeof n=="function","watch: second argument must be a callback function."),J())return()=>{};let t,r=!0;return O(()=>{let s=e();if(r){t=s,r=!1;return}if(!Object.is(s,t)){let a=t;t=s,ke();try{n(s,a)}finally{_e()}}})}function ec(e,n,t){return[It(e,t),i=>{F(()=>n(i))}]}function tc(e){let n=e();return Y()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function nc(e){if(!Y())return q(e);let n=q(e),t=null;return queueMicrotask(()=>{try{t=q(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}var Ot="data-sibu-enhanced",Pt=new WeakMap;function dr(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=Oe){let i=r.length-o+e.length;e.length=0,Pe(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var fr=["text","attr","class","show","on","cleanup"];function pr(e,n){if(n==null)return e;if(typeof n!="string")return n;let t=n.startsWith("@")?`[data-ref="${n.slice(1)}"]`:n;try{return e.querySelector(t)}catch{return null}}function He(e,n){return J()?()=>{}:V(n,e)}function rc(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,n=>n.value):e.value}function oc(e,n){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!n;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(n)?n.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let t=n==null?"":String(n);e.value!==t&&(e.value=t)}function ic(e,n,t,r){let o=`ctx.each[${r}]`;if(Y())for(let i of Object.keys(t))R(fr.includes(i),`${o}: unknown binding "${i}". Expected one of: ${fr.join(", ")}.`);if(t.text!==void 0&&(R(typeof t.text=="function",`${o}: "text" must be a function returning the value.`),e.text(n,t.text)),t.attr!==void 0)for(let i of Object.keys(t.attr)){let s=t.attr[i];R(typeof s=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(n,i,s)}if(t.class!==void 0)for(let i of Object.keys(t.class)){let s=t.class[i];R(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(n,i,s)}if(t.show!==void 0&&(R(typeof t.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(n,t.show)),t.on!==void 0)for(let i of Object.keys(t.on)){let s=t.on[i];R(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(n,i,s)}t.cleanup!==void 0&&(R(typeof t.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(t.cleanup))}function Ge(e,n){let t=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!t)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(t.getAttribute(Ot)==="true")return Y()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=g=>s?(W(()=>`enhance: ctx.${g}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`),!0):!1,c=(g,f,m)=>{if(a(g))return;let b=pr(t,f);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(f)} not found under`,t);return}m(b)},l={root:t,ref:g=>pr(t,g),refs:g=>{let f=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(t.querySelectorAll(f))}catch{return[]}},on:(g,f,m,b)=>{c("on",g,h=>{let y=w=>m(w,h);h.addEventListener(f,y,b),r.push(()=>h.removeEventListener(f,y,b))})},text:(g,f)=>{c("text",g,m=>{r.push(He(m,()=>{let b=f(),h=b==null?"":String(b);m.textContent!==h&&(m.textContent=h)}))})},attr:(g,f,m)=>{c("attr",g,b=>{r.push(He(b,()=>{let h=m(),y=h==null?null:String(h);j(b,f,y,{syncValueProperty:!1,label:"enhance attr()"})}))})},classed:(g,f,m)=>{c("classed",g,b=>{r.push(He(b,()=>{b.classList.toggle(f,!!m())}))})},show:(g,f)=>{c("show",g,m=>{let b=m.hidden;r.push(He(m,()=>{m.hidden=!f()})),r.push(()=>{m.hidden=b})})},model:(g,f,m)=>{c("model",g,b=>{let h=b,[y,w]=f,v=m?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(He(b,()=>{oc(h,y())}));let S=()=>w(rc(h));h.addEventListener(v,S),r.push(()=>h.removeEventListener(v,S))})},each:(g,f)=>{if(a("each"))return;R(typeof f=="function","ctx.each: second argument must be a function.");let m=typeof g=="string"?l.refs(g):Array.from(g);for(let b=0;b<m.length;b++){let h=m[b],y=f(h,b);y!=null&&ic(l,h,y,b)}},cleanup:g=>{a("cleanup")||r.push(g)}},d;try{d=n(l);let g=d;if(g&&typeof g.then=="function")throw g.then(void 0,f=>{W(()=>`enhance: the promise returned by the setup also rejected: ${String(f)}`)}),new Error("[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored.")}catch(g){throw dr(r,"enhance"),s=!0,g}typeof d=="function"&&r.push(d);let p=()=>{i||(i=!0,Pt.get(t)===o&&(Pt.delete(t),t.removeAttribute(Ot)),tt(t,p),dr(r,"enhance"),s=!0)};return T(t,p),Pt.set(t,o),t.setAttribute(Ot,"true"),p}function sc(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push(Ge(r,n))}catch(r){for(let o=t.length-1;o>=0;o--)try{t[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw t.length=0,r}return()=>{for(let r of t.splice(0))r()}}function mr(e,n){let t=globalThis;return t[e]??(t[e]=n())}var ac=/^[A-Za-z0-9_-]+$/,gr=Symbol.for("sibujs.islands.lazy"),Ye=mr(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function cc(e){return e[gr]=!0,e}function uc(e,n){if(!ac.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Ye.set(e,n)}function lc(e){Ye.delete(e)}async function dc(e){if(typeof e=="function"&&e[gr]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function fc(e=typeof document<"u"?document:null,n={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let t=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!Ye.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,c=()=>{if(a||o)return;a=!0;let d=Ye.get(s);d&&dc(d).then(p=>{if(!o){if(!p){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=Ge(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)})},l=i.getAttribute("data-sibu-load")||"load";t.push(pc(l,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function pc(e,n,t,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(t);return()=>cancelIdleCallback(i)}let o=setTimeout(t,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(t),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),t())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(n),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),t()},s=()=>{for(let a of o)n.removeEventListener(a,i)};for(let a of o)n.addEventListener(a,i,{passive:!0});return s}case"media":{let o=n.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(t),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(t),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),t())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(t),()=>{}}}function br(e){return e}var vd=1024*1024;function mc(e){let[n,t]=C(e()),r=!1,o=!1,i=n(),s=()=>{r=!1,!o&&t(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=O(()=>{i=e(),a()}),l=(()=>n());return l.dispose=()=>{o||(o=!0,c())},l}var hr=16;function gc(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:hr*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,hr)}function bc(){let[e,n]=C(!1);function t(r){n(!0),gc(()=>{let o;try{o=r()}catch{n(!1);return}o&&typeof o.then=="function"?o.then(()=>n(!1),()=>n(!1)):n(!1)})}return{pending:e,start:t}}function hc(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...Bt});})();
|