sibujs 1.5.0 → 2.1.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/dist/browser.cjs +332 -121
- package/dist/browser.d.cts +5 -0
- package/dist/browser.d.ts +5 -0
- package/dist/browser.js +6 -6
- package/dist/build.cjs +1049 -344
- package/dist/build.js +15 -13
- package/dist/cdn.global.js +17 -16
- package/dist/chunk-2RA7SHDA.js +65 -0
- package/dist/chunk-2UPRY23K.js +80 -0
- package/dist/{chunk-BMPL52BF.js → chunk-3DZP6OIT.js} +118 -66
- package/dist/chunk-3JHCYHWN.js +125 -0
- package/dist/{chunk-CZUGLNJS.js → chunk-45YP72ZQ.js} +3 -3
- package/dist/{chunk-JCDUJN2F.js → chunk-AMK2TYNW.js} +490 -153
- package/dist/{chunk-NHUC2QWH.js → chunk-CWBVQML6.js} +1 -1
- package/dist/{chunk-XHK6BDAJ.js → chunk-DRUZZAK4.js} +25 -8
- package/dist/{chunk-RJ46C3CS.js → chunk-GWWURC5M.js} +71 -20
- package/dist/{chunk-3X2YG6YM.js → chunk-JYD2PWXH.js} +59 -28
- package/dist/{chunk-2BYQDGN3.js → chunk-KGYT6UO6.js} +234 -63
- package/dist/{chunk-5X6PP2UK.js → chunk-LMLD24FC.js} +2 -2
- package/dist/{chunk-M4NLBH4I.js → chunk-LYTCUZ7H.js} +3 -2
- package/dist/{chunk-XUEEGU5O.js → chunk-NASX6ST2.js} +16 -4
- package/dist/{chunk-VQDZK23A.js → chunk-O6EFQ3KT.js} +181 -66
- package/dist/{chunk-BGN5ZMP4.js → chunk-OJ3P4ECI.js} +14 -2
- package/dist/chunk-ON5MMR2J.js +1327 -0
- package/dist/{chunk-SFKNRVCU.js → chunk-P2HSJDDN.js} +135 -79
- package/dist/chunk-QO3WC6FS.js +384 -0
- package/dist/{chunk-WZSPOOER.js → chunk-RDTDJCAB.js} +8 -5
- package/dist/{chunk-7GRNSCFT.js → chunk-TH2ILCYW.js} +312 -185
- package/dist/chunk-UCS6AMJ7.js +79 -0
- package/dist/{chunk-VAPYJN4X.js → chunk-V6C4FADE.js} +93 -23
- package/dist/{chunk-OUZZEE4S.js → chunk-WANSMF2L.js} +17 -11
- package/dist/{chunk-23VV7YD3.js → chunk-WIPZPFBQ.js} +25 -30
- package/dist/chunk-WZA53FXU.js +149 -0
- package/dist/{chunk-BGTHZHJ5.js → chunk-ZAQSMOED.js} +188 -44
- package/dist/{customElement-BL3Uo8dL.d.cts → customElement-CPfIrbvg.d.cts} +14 -10
- package/dist/{customElement-BL3Uo8dL.d.ts → customElement-CPfIrbvg.d.ts} +14 -10
- package/dist/data.cjs +536 -151
- package/dist/data.d.cts +20 -2
- package/dist/data.d.ts +20 -2
- package/dist/data.js +11 -9
- package/dist/devtools.cjs +613 -266
- package/dist/devtools.d.cts +1 -1
- package/dist/devtools.d.ts +1 -1
- package/dist/devtools.js +12 -6
- package/dist/ecosystem.cjs +602 -197
- package/dist/ecosystem.d.cts +9 -7
- package/dist/ecosystem.d.ts +9 -7
- package/dist/ecosystem.js +12 -11
- package/dist/extras.cjs +3500 -1608
- package/dist/extras.d.cts +9 -9
- package/dist/extras.d.ts +9 -9
- package/dist/extras.js +58 -45
- package/dist/index.cjs +1055 -344
- package/dist/index.d.cts +85 -8
- package/dist/index.d.ts +85 -8
- package/dist/index.js +32 -16
- package/dist/{introspect-BumjnBKr.d.cts → introspect-2TOlQ7oa.d.cts} +25 -3
- package/dist/{introspect-CZrlcaYy.d.ts → introspect-DnIpHQQz.d.ts} +25 -3
- package/dist/motion.cjs +122 -63
- package/dist/motion.js +4 -4
- package/dist/patterns.cjs +450 -110
- package/dist/patterns.d.cts +11 -12
- package/dist/patterns.d.ts +11 -12
- package/dist/patterns.js +7 -7
- package/dist/performance.cjs +373 -149
- package/dist/performance.d.cts +23 -16
- package/dist/performance.d.ts +23 -16
- package/dist/performance.js +13 -8
- package/dist/plugin-D30wlGW5.d.cts +71 -0
- package/dist/plugin-D30wlGW5.d.ts +71 -0
- package/dist/plugins.cjs +729 -301
- package/dist/plugins.d.cts +10 -3
- package/dist/plugins.d.ts +10 -3
- package/dist/plugins.js +106 -38
- package/dist/{ssr-Do_SiVoL.d.cts → ssr-CrVNy6Pa.d.cts} +9 -15
- package/dist/{ssr-Do_SiVoL.d.ts → ssr-CrVNy6Pa.d.ts} +9 -15
- package/dist/{ssr-4PBXAOO3.js → ssr-FXD2PPMC.js} +4 -3
- package/dist/ssr.cjs +736 -274
- package/dist/ssr.d.cts +26 -6
- package/dist/ssr.d.ts +26 -6
- package/dist/ssr.js +12 -11
- package/dist/{tagFactory-DaJ0YWX6.d.cts → tagFactory-S17H2qxu.d.cts} +9 -1
- package/dist/{tagFactory-DaJ0YWX6.d.ts → tagFactory-S17H2qxu.d.ts} +9 -1
- package/dist/testing.cjs +303 -76
- package/dist/testing.d.cts +17 -4
- package/dist/testing.d.ts +17 -4
- package/dist/testing.js +100 -44
- package/dist/ui.cjs +589 -178
- package/dist/ui.d.cts +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +20 -17
- package/dist/widgets.cjs +1103 -146
- package/dist/widgets.d.cts +104 -2
- package/dist/widgets.d.ts +104 -2
- package/dist/widgets.js +9 -7
- package/package.json +8 -2
- package/dist/chunk-32DY64NT.js +0 -282
- package/dist/chunk-3AIRKM3B.js +0 -1263
- package/dist/chunk-3ARAQO7B.js +0 -398
- package/dist/chunk-3CRQALYP.js +0 -877
- package/dist/chunk-4EI4AG32.js +0 -482
- package/dist/chunk-4MYMUBRS.js +0 -21
- package/dist/chunk-5ZYQ6KDD.js +0 -154
- package/dist/chunk-6BMPXPUW.js +0 -26
- package/dist/chunk-6HLLIF3K.js +0 -398
- package/dist/chunk-6LSNVCS2.js +0 -937
- package/dist/chunk-6SA3QQES.js +0 -61
- package/dist/chunk-77L6NL3X.js +0 -1097
- package/dist/chunk-7BF6TK55.js +0 -1097
- package/dist/chunk-7TQKR4PP.js +0 -294
- package/dist/chunk-7V26P53V.js +0 -712
- package/dist/chunk-AZ3ISID5.js +0 -298
- package/dist/chunk-B7SWRFUT.js +0 -332
- package/dist/chunk-BTU3TJDS.js +0 -365
- package/dist/chunk-BW3WT46K.js +0 -937
- package/dist/chunk-C6KFWOFV.js +0 -616
- package/dist/chunk-CHF5OHIA.js +0 -61
- package/dist/chunk-CHJ27IGK.js +0 -26
- package/dist/chunk-CMBFNA7L.js +0 -27
- package/dist/chunk-DAHRH4ON.js +0 -331
- package/dist/chunk-DKOHBI74.js +0 -924
- package/dist/chunk-DTCOOBMX.js +0 -725
- package/dist/chunk-EBGIRKQY.js +0 -616
- package/dist/chunk-EUZND3CB.js +0 -27
- package/dist/chunk-EVCZO745.js +0 -365
- package/dist/chunk-EWFVA3TJ.js +0 -282
- package/dist/chunk-F3FA4F32.js +0 -292
- package/dist/chunk-FGOEVHY3.js +0 -60
- package/dist/chunk-G3BOQPVO.js +0 -365
- package/dist/chunk-GCOK2LC3.js +0 -282
- package/dist/chunk-GJPXRJ45.js +0 -37
- package/dist/chunk-HGMJFBC7.js +0 -654
- package/dist/chunk-JAKHTMQU.js +0 -1000
- package/dist/chunk-JCI5M6U6.js +0 -956
- package/dist/chunk-K4G4ZQNR.js +0 -286
- package/dist/chunk-K5ZUMYVS.js +0 -89
- package/dist/chunk-KQPDEVVS.js +0 -398
- package/dist/chunk-L6JRBDNS.js +0 -60
- package/dist/chunk-LA6KQEDU.js +0 -712
- package/dist/chunk-MB6QFH3I.js +0 -2776
- package/dist/chunk-MDVXJWFN.js +0 -304
- package/dist/chunk-MEZVEBPN.js +0 -2008
- package/dist/chunk-MK4ERFYL.js +0 -2249
- package/dist/chunk-MLKGABMK.js +0 -9
- package/dist/chunk-MQ5GOYPH.js +0 -2249
- package/dist/chunk-MYRV7VDM.js +0 -742
- package/dist/chunk-N6IZB6KJ.js +0 -567
- package/dist/chunk-NEKUBFPT.js +0 -60
- package/dist/chunk-NMRUZALC.js +0 -1097
- package/dist/chunk-NYVAC6P5.js +0 -37
- package/dist/chunk-NZIIMDWI.js +0 -84
- package/dist/chunk-OF7UZIVB.js +0 -725
- package/dist/chunk-P3XWXJZU.js +0 -282
- package/dist/chunk-P6W3STU4.js +0 -2249
- package/dist/chunk-PBHF5WKN.js +0 -616
- package/dist/chunk-PDZQY43A.js +0 -616
- package/dist/chunk-PTQJDMRT.js +0 -146
- package/dist/chunk-PZEGYCF5.js +0 -61
- package/dist/chunk-QBMDLBU2.js +0 -975
- package/dist/chunk-QWZG56ET.js +0 -2744
- package/dist/chunk-RQGQSLQK.js +0 -725
- package/dist/chunk-SDLZDHKP.js +0 -107
- package/dist/chunk-TDGZL5CU.js +0 -365
- package/dist/chunk-TNQWPPE6.js +0 -37
- package/dist/chunk-TSOKIX5Z.js +0 -654
- package/dist/chunk-UHNL42EF.js +0 -2730
- package/dist/chunk-UNXCEF6S.js +0 -21
- package/dist/chunk-V2XTI523.js +0 -347
- package/dist/chunk-VAU366PN.js +0 -2241
- package/dist/chunk-VMVDTCXB.js +0 -712
- package/dist/chunk-VQNQZCWJ.js +0 -61
- package/dist/chunk-VRW3FULF.js +0 -725
- package/dist/chunk-WADYRCO2.js +0 -304
- package/dist/chunk-WILQZRO4.js +0 -282
- package/dist/chunk-WR5D4EGH.js +0 -26
- package/dist/chunk-WUHJISPP.js +0 -298
- package/dist/chunk-XYU6TZOW.js +0 -182
- package/dist/chunk-Y6GP4QGG.js +0 -276
- package/dist/chunk-YECR7UIA.js +0 -347
- package/dist/chunk-YUTWTI4B.js +0 -654
- package/dist/chunk-Z65KYU7I.js +0 -26
- package/dist/chunk-Z6POF5YC.js +0 -975
- package/dist/chunk-ZBJP6WFL.js +0 -482
- package/dist/chunk-ZD6OAMTH.js +0 -277
- package/dist/chunk-ZWKZCBO6.js +0 -317
- package/dist/contracts-DDrwxvJ-.d.cts +0 -245
- package/dist/contracts-DDrwxvJ-.d.ts +0 -245
- package/dist/contracts-DOrhwbke.d.cts +0 -245
- package/dist/contracts-DOrhwbke.d.ts +0 -245
- package/dist/contracts-xo5ckdRP.d.cts +0 -240
- package/dist/contracts-xo5ckdRP.d.ts +0 -240
- package/dist/customElement-BKQfbSZQ.d.cts +0 -262
- package/dist/customElement-BKQfbSZQ.d.ts +0 -262
- package/dist/customElement-D2DJp_xn.d.cts +0 -313
- package/dist/customElement-D2DJp_xn.d.ts +0 -313
- package/dist/customElement-yz8uyk-0.d.cts +0 -308
- package/dist/customElement-yz8uyk-0.d.ts +0 -308
- package/dist/introspect-Cb0zgpi2.d.cts +0 -477
- package/dist/introspect-Y2xNXGSf.d.ts +0 -477
- package/dist/plugin-Bek4RhJY.d.cts +0 -43
- package/dist/plugin-Bek4RhJY.d.ts +0 -43
- package/dist/ssr-3RXHP5ES.js +0 -38
- package/dist/ssr-6GIMY5MX.js +0 -38
- package/dist/ssr-BA6sxxUd.d.cts +0 -135
- package/dist/ssr-BA6sxxUd.d.ts +0 -135
- package/dist/ssr-WKUPVSSK.js +0 -36
- package/dist/tagFactory-Dl8QCLga.d.cts +0 -23
- package/dist/tagFactory-Dl8QCLga.d.ts +0 -23
package/dist/build.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AMK2TYNW.js";
|
|
4
4
|
import "./chunk-YT6HQ6AM.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-CWBVQML6.js";
|
|
6
|
+
import "./chunk-45YP72ZQ.js";
|
|
7
|
+
import "./chunk-JYD2PWXH.js";
|
|
8
|
+
import "./chunk-OJ3P4ECI.js";
|
|
9
|
+
import "./chunk-P2HSJDDN.js";
|
|
10
|
+
import "./chunk-WIPZPFBQ.js";
|
|
11
|
+
import "./chunk-DRUZZAK4.js";
|
|
12
|
+
import "./chunk-2UPRY23K.js";
|
|
13
|
+
import "./chunk-UCS6AMJ7.js";
|
|
14
|
+
import "./chunk-WZA53FXU.js";
|
|
15
|
+
import "./chunk-2RA7SHDA.js";
|
|
16
|
+
import "./chunk-RDTDJCAB.js";
|
|
17
|
+
import "./chunk-QO3WC6FS.js";
|
|
18
|
+
import "./chunk-LMLD24FC.js";
|
|
17
19
|
|
|
18
20
|
// src/build/compileTemplates.ts
|
|
19
21
|
var VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
package/dist/cdn.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Sibu=(()=>{var _e=Object.defineProperty;var Po=Object.getOwnPropertyDescriptor;var Do=Object.getOwnPropertyNames;var Fo=Object.prototype.hasOwnProperty;var Ye=(e,t)=>{for(var n in t)_e(e,n,{get:t[n],enumerable:!0})},Ho=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Do(t))!Fo.call(e,o)&&o!==n&&_e(e,o,{get:()=>t[o],enumerable:!(r=Po(t,o))||r.enumerable});return e};var Bo=e=>Ho(_e({},"__esModule",{value:!0}),e);var pi={};Ye(pi,{DynamicComponent:()=>Hr,ErrorBoundary:()=>_o,ErrorDisplay:()=>Ce,Fragment:()=>Or,KeepAlive:()=>$r,Loading:()=>Lo,Portal:()=>Pr,SVG_NS:()=>k,Suspense:()=>Ke,__resetIdCounter:()=>Zr,a:()=>Rt,abbr:()=>Ot,action:()=>qr,address:()=>gt,area:()=>on,array:()=>co,article:()=>ut,aside:()=>bt,asyncDerived:()=>fo,audio:()=>sn,autoResize:()=>Wr,b:()=>Pt,base:()=>er,batch:()=>ke,bdi:()=>Dt,bdo:()=>Ft,bindDynamic:()=>Le,blockquote:()=>kt,body:()=>at,br:()=>Ht,button:()=>X,canvas:()=>vn,caption:()=>Sn,catchError:()=>Jr,catchErrorAsync:()=>Qr,center:()=>Er,checkLeaks:()=>ot,circle:()=>rr,cite:()=>Bt,clickOutside:()=>Kr,clipPath:()=>mr,code:()=>Te,col:()=>Cn,colgroup:()=>An,context:()=>go,copyOnClick:()=>Vr,createId:()=>Yr,customElement:()=>Cr,data:()=>zt,datalist:()=>Dn,dd:()=>Et,deepEqual:()=>ee,deepSignal:()=>uo,defer:()=>To,defs:()=>fr,del:()=>En,derived:()=>we,details:()=>Gn,dfn:()=>It,dialog:()=>Jn,disableSSR:()=>Ie,dispose:()=>R,div:()=>h,dl:()=>wt,dt:()=>St,each:()=>Mr,effect:()=>P,ellipse:()=>or,em:()=>jt,embed:()=>dn,enableSSR:()=>ze,enqueueBatchedSignal:()=>Y,fieldset:()=>Fn,figcaption:()=>Ct,figure:()=>At,font:()=>wr,footer:()=>pt,form:()=>Hn,g:()=>ir,getSlot:()=>Br,h1:()=>ht,h2:()=>yt,h3:()=>xe,h4:()=>xt,h5:()=>vt,h6:()=>Tt,head:()=>st,header:()=>dt,hr:()=>_t,html:()=>Oe,i:()=>$t,iframe:()=>pn,img:()=>an,input:()=>Bn,ins:()=>wn,isBatching:()=>eo,isSSR:()=>Z,kbd:()=>qt,label:()=>zn,lazy:()=>qe,legend:()=>In,li:()=>Nt,line:()=>sr,linearGradient:()=>hr,link:()=>tr,longPress:()=>Ur,main:()=>mt,map:()=>cn,mark:()=>Kt,marker:()=>kr,marquee:()=>Sr,mask:()=>br,match:()=>jr,math:()=>xn,menu:()=>Qn,meta:()=>nr,meter:()=>jn,mount:()=>Nr,nav:()=>ft,nextTick:()=>xo,noscript:()=>Tn,object:()=>fn,ol:()=>Lt,on:()=>oo,onCleanup:()=>bo,onMount:()=>$e,onUnmount:()=>mo,optgroup:()=>$n,option:()=>qn,output:()=>Kn,p:()=>ye,param:()=>mn,path:()=>ar,pattern:()=>gr,picture:()=>bn,polygon:()=>cr,polyline:()=>lr,portal:()=>gn,pre:()=>ve,progress:()=>Un,q:()=>Ut,radialGradient:()=>yr,reactiveArray:()=>lo,rect:()=>ur,ref:()=>ao,registerComponent:()=>Dr,registerDisposer:()=>E,resolveComponent:()=>De,rp:()=>Vt,rt:()=>Wt,ruby:()=>Gt,s:()=>Jt,samp:()=>Qt,script:()=>kn,section:()=>lt,select:()=>Vn,setGlobalErrorHandler:()=>Xr,show:()=>zr,signal:()=>w,slot:()=>Yn,small:()=>Xt,source:()=>hn,span:()=>S,stop:()=>xr,store:()=>so,strict:()=>ho,strictEffect:()=>yo,strong:()=>Yt,style:()=>z,sub:()=>Zt,summary:()=>Xn,sup:()=>en,svg:()=>yn,symbol:()=>Tr,table:()=>_n,tagFactory:()=>c,tbody:()=>Nn,td:()=>Ln,template:()=>Zn,text:()=>dr,textarea:()=>Wn,tfoot:()=>Mn,th:()=>Rn,thead:()=>On,time:()=>tn,title:()=>ct,tr:()=>Pn,track:()=>ln,transition:()=>ko,trapFocus:()=>Gr,tspan:()=>pr,u:()=>nn,ul:()=>Mt,unregisterComponent:()=>Fr,untracked:()=>J,use:()=>vr,var_:()=>rn,video:()=>un,watch:()=>io,when:()=>Ir,withSSR:()=>no,writable:()=>po});var Ve={};Ye(Ve,{DynamicComponent:()=>Hr,ErrorBoundary:()=>_o,ErrorDisplay:()=>Ce,Fragment:()=>Or,KeepAlive:()=>$r,Loading:()=>Lo,Portal:()=>Pr,SVG_NS:()=>k,Suspense:()=>Ke,__resetIdCounter:()=>Zr,a:()=>Rt,abbr:()=>Ot,action:()=>qr,address:()=>gt,area:()=>on,array:()=>co,article:()=>ut,aside:()=>bt,asyncDerived:()=>fo,audio:()=>sn,autoResize:()=>Wr,b:()=>Pt,base:()=>er,batch:()=>ke,bdi:()=>Dt,bdo:()=>Ft,bindDynamic:()=>Le,blockquote:()=>kt,body:()=>at,br:()=>Ht,button:()=>X,canvas:()=>vn,caption:()=>Sn,catchError:()=>Jr,catchErrorAsync:()=>Qr,center:()=>Er,checkLeaks:()=>ot,circle:()=>rr,cite:()=>Bt,clickOutside:()=>Kr,clipPath:()=>mr,code:()=>Te,col:()=>Cn,colgroup:()=>An,context:()=>go,copyOnClick:()=>Vr,createId:()=>Yr,customElement:()=>Cr,data:()=>zt,datalist:()=>Dn,dd:()=>Et,deepEqual:()=>ee,deepSignal:()=>uo,defer:()=>To,defs:()=>fr,del:()=>En,derived:()=>we,details:()=>Gn,dfn:()=>It,dialog:()=>Jn,disableSSR:()=>Ie,dispose:()=>R,div:()=>h,dl:()=>wt,dt:()=>St,each:()=>Mr,effect:()=>P,ellipse:()=>or,em:()=>jt,embed:()=>dn,enableSSR:()=>ze,enqueueBatchedSignal:()=>Y,fieldset:()=>Fn,figcaption:()=>Ct,figure:()=>At,font:()=>wr,footer:()=>pt,form:()=>Hn,g:()=>ir,getSlot:()=>Br,h1:()=>ht,h2:()=>yt,h3:()=>xe,h4:()=>xt,h5:()=>vt,h6:()=>Tt,head:()=>st,header:()=>dt,hr:()=>_t,html:()=>Oe,i:()=>$t,iframe:()=>pn,img:()=>an,input:()=>Bn,ins:()=>wn,isBatching:()=>eo,isSSR:()=>Z,kbd:()=>qt,label:()=>zn,lazy:()=>qe,legend:()=>In,li:()=>Nt,line:()=>sr,linearGradient:()=>hr,link:()=>tr,longPress:()=>Ur,main:()=>mt,map:()=>cn,mark:()=>Kt,marker:()=>kr,marquee:()=>Sr,mask:()=>br,match:()=>jr,math:()=>xn,menu:()=>Qn,meta:()=>nr,meter:()=>jn,mount:()=>Nr,nav:()=>ft,nextTick:()=>xo,noscript:()=>Tn,object:()=>fn,ol:()=>Lt,on:()=>oo,onCleanup:()=>bo,onMount:()=>$e,onUnmount:()=>mo,optgroup:()=>$n,option:()=>qn,output:()=>Kn,p:()=>ye,param:()=>mn,path:()=>ar,pattern:()=>gr,picture:()=>bn,polygon:()=>cr,polyline:()=>lr,portal:()=>gn,pre:()=>ve,progress:()=>Un,q:()=>Ut,radialGradient:()=>yr,reactiveArray:()=>lo,rect:()=>ur,ref:()=>ao,registerComponent:()=>Dr,registerDisposer:()=>E,resolveComponent:()=>De,rp:()=>Vt,rt:()=>Wt,ruby:()=>Gt,s:()=>Jt,samp:()=>Qt,script:()=>kn,section:()=>lt,select:()=>Vn,setGlobalErrorHandler:()=>Xr,show:()=>zr,signal:()=>w,slot:()=>Yn,small:()=>Xt,source:()=>hn,span:()=>S,stop:()=>xr,store:()=>so,strict:()=>ho,strictEffect:()=>yo,strong:()=>Yt,style:()=>z,sub:()=>Zt,summary:()=>Xn,sup:()=>en,svg:()=>yn,symbol:()=>Tr,table:()=>_n,tagFactory:()=>c,tbody:()=>Nn,td:()=>Ln,template:()=>Zn,text:()=>dr,textarea:()=>Wn,tfoot:()=>Mn,th:()=>Rn,thead:()=>On,time:()=>tn,title:()=>ct,tr:()=>Pn,track:()=>ln,transition:()=>ko,trapFocus:()=>Gr,tspan:()=>pr,u:()=>nn,ul:()=>Mt,unregisterComponent:()=>Fr,untracked:()=>J,use:()=>vr,var_:()=>rn,video:()=>un,watch:()=>io,when:()=>Ir,withSSR:()=>no,writable:()=>po});function _(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}var Ze=_();function L(e,t){if(Ze&&!e)throw new Error(`[Sibu] ${t}`)}function M(e){Ze&&console.warn(`[Sibu] ${e}`)}function j(e){let t=e.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!t)return"";let n=t.toLowerCase();return n.startsWith("javascript:")||n.startsWith("data:")||n.startsWith("vbscript:")||n.startsWith("blob:")?"":t}function Ne(e){let t=e.toLowerCase().replace(/\s+/g,"");return t.includes("url(")||t.includes("expression(")||t.includes("javascript:")||t.includes("-moz-binding")?"":e}var zo=new Set(["href","src","action","formaction","cite","poster","background","srcset"]);function $(e){return zo.has(e)}var Io=_(),W=new Array(32),G=32,F=-1,B=null,jo=new WeakMap,q="__s",H=0,A=[],O=new Set;function re(e){try{e()}catch(t){Io&&M(`Subscriber threw during notification: ${t instanceof Error?t.message:String(t)}`)}}var de=0,pe=!1;function x(e,t){t||(t=e),tt(t),++F,F>=G&&(G*=2,W.length=G),W[F]=t,B=t;try{e()}finally{F--,B=F>=0?W[F]:null}return()=>tt(t)}function $o(){de===0&&(++F,F>=G&&(G*=2,W.length=G),W[F]=null,B=null,pe=!0),de++}function qo(){de--,de===0&&(F--,B=F>=0?W[F]:null,pe=!1)}function J(e){$o();try{return e()}finally{qo()}}function Q(e){if(!B)return;let t=B;if(t._dep===e)return;let n=t._deps;if(n){if(n.has(e))return;n.add(e)}else if(t._dep!==void 0){let o=new Set;o.add(t._dep),o.add(e),t._deps=o,t._dep=void 0}else t._dep=e;let r=e[q];r||(r=new Set,jo.set(e,r),e[q]=r),r.add(B),r.size===1?e.__f=B:e.__f!==void 0&&(e.__f=void 0)}function nt(e){let t=e[q];if(t)for(let n of t)n._c?V(n):O.has(n)||(O.add(n),A.push(n))}var et=1e3;function rt(){if(!(H>0)){H++;try{let e=0;for(;e<A.length;){if(e>=et){typeof console<"u"&&console.error(`[SibuJS] Notification queue exceeded ${et} iterations \u2014 likely an effect that writes to a signal it reads. Breaking to prevent infinite loop.`);break}re(A[e]),e++}}finally{A.length=0,O.clear(),H--}}}function V(e){e();let t=e._sig;for(;t;){let n=t.__f;if(n){if(n._c){let i=n._sig;i._d=!0,t=i;continue}O.has(n)||(O.add(n),A.push(n));break}let r=t[q];if(!r)break;let o;for(let i of r)if(i._c){i();let s=i._sig;s&&!o?o=s:s&&V(i)}else O.has(i)||(O.add(i),A.push(i));t=o}}function fe(e){let t=e.__f;if(t){if(H>0){t._c?V(t):O.has(t)||(O.add(t),A.push(t));return}H++;try{t._c?V(t):re(t);let r=0;for(;r<A.length;)re(A[r]),r++}finally{A.length=0,O.clear(),H--}return}let n=e[q];if(!(!n||n.size===0)){if(H>0){for(let r of n)r._c?V(r):O.has(r)||(O.add(r),A.push(r));return}H++;try{let r=0;for(let i of n)A[r++]=i;for(let i=0;i<r;i++)A[i]._c&&V(A[i]);for(let i=0;i<r;i++)A[i]._c||O.has(A[i])||re(A[i]);let o=r;for(;o<A.length;)re(A[o]),o++}finally{A.length=0,O.clear(),H--}}}function tt(e){let t=e,n=t._dep;if(n!==void 0){let o=n[q];o&&(o.delete(e),n.__f===e&&(n.__f=void 0)),t._dep=void 0;return}let r=t._deps;if(!(!r||r.size===0)){for(let o of r){let i=o[q];i&&(i.delete(e),o.__f===e&&(o.__f=void 0))}r.clear()}}var me=_();function Ko(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}function be(e,t,n){if(Ko(t))return me&&M(`bindAttribute: refusing to bind event-handler attribute "${t}". Use on:{ ${t.slice(2)}: fn } instead.`),()=>{};function r(){let i;try{i=n()}catch(a){me&&M(`bindAttribute: getter for "${t}" threw: ${a instanceof Error?a.message:String(a)}`);return}if(typeof i=="boolean"){t in e&&(t==="checked"||t==="disabled"||t==="selected")?e[t]=i:i?e.setAttribute(t,""):e.removeAttribute(t);return}let s=String(i);(t==="value"||t==="checked")&&t in e?e[t]=t==="checked"?!!i:s:e.setAttribute(t,$(t)?j(s):s)}return x(r)}function Le(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){me&&M(`bindDynamic: name getter threw: ${l instanceof Error?l.message:String(l)}`);return}let a;try{a=typeof n=="function"?n():n}catch(l){me&&M(`bindDynamic: value getter threw: ${l instanceof Error?l.message:String(l)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;r!==null&&r!==s&&e.removeAttribute(r);let u=String(a);(s==="value"||s==="checked")&&s in e?e[s]=s==="checked"?!!a:u:e.setAttribute(s,$(s)?j(u):u),r=s}let i=x(o);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Uo=_();function K(e,t){let n=[];function r(){let o;try{o=t()}catch(l){Uo&&M(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}if(o==null||typeof o=="boolean"){for(let l=0;l<n.length;l++){let d=n[l];d.parentNode&&d.parentNode.removeChild(d)}n.length=0;return}let i=e.parentNode;if(!i){n.length=0;return}let s;if(Array.isArray(o)){s=[];for(let l=0;l<o.length;l++){let d=o[l];d==null||typeof d=="boolean"||s.push(d instanceof Node?d:document.createTextNode(String(d)))}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let a=n.length>0&&s.length>0?new Set:void 0;if(a){for(let l=0;l<s.length;l++)for(let d=0;d<n.length;d++)if(s[l]===n[d]){a.add(s[l]);break}}for(let l=0;l<n.length;l++){let d=n[l];a?.has(d)||d.parentNode&&d.parentNode.removeChild(d)}let u=e.nextSibling;for(let l=0;l<s.length;l++){let d=s[l];a?.has(d)&&d.parentNode===i?d.nextSibling!==u&&i.insertBefore(d,u):i.insertBefore(d,u)}n=s}return x(r)}var ge=new WeakMap,he=_(),oe=0;function E(e,t){let n=ge.get(e);n||(n=[],ge.set(e,n)),n.push(t),he&&oe++}function R(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=r.childNodes;for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--){let o=n[r],i=ge.get(o);if(i){he&&(oe-=i.length);for(let s of i)try{s()}catch(a){he&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",a)}ge.delete(o)}}}function ot(e=0){return he?(e>0&&oe>e&&M(`checkLeaks: ${oe} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),oe):0}var k="http://www.w3.org/2000/svg",it=new Map;function Vo(e){let t=it.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),it.set(e,t)),t}function Wo(e,t){if(typeof t=="function"){let r=x(()=>{e.setAttribute("style",t())});E(e,r);return}if(typeof t=="string"){e.setAttribute("style",t);return}let n=e;for(let r in t){let o=t[r],i=Vo(r);if(typeof o=="function"){let s=o,a=x(()=>{n.style.setProperty(i,Ne(String(s())))});E(e,a)}else n.style.setProperty(i,Ne(String(o)))}}function Go(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=x(()=>{e.setAttribute("class",t())});E(e,i);return}let n=t,r=!1,o="";for(let i in n){let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=x(()=>{let a="";for(let u in n){let l=n[u];(typeof l=="function"?l():l)&&(a=a?`${a} ${u}`:u)}e.setAttribute("class",a)});E(e,s)}else e.setAttribute("class",o)}function Me(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),E(e,K(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),E(e,K(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),E(e,K(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 c=(e,t)=>(n,r)=>{let o=t?document.createElementNS(t,e):document.createElement(e);if(n===void 0)return o;if(typeof n=="string")return r!==void 0?(o.setAttribute("class",n),Me(o,r),o):(o.textContent=n,o);if(typeof n=="number")return o.textContent=String(n),o;if(Array.isArray(n)||n instanceof Node||typeof n=="function")return Me(o,n),o;let i=n,s=i.class;s!=null&&Go(o,s);let a=i.id;a!=null&&(o.id=a);let u=r!==void 0?r:i.nodes;u!=null&&Me(o,u);let l=i.on;if(l)for(let m in l)o.addEventListener(m,l[m]);let d=i.style;d!=null&&Wo(o,d);let f=i.ref;f&&(f.current=o);for(let m in i)switch(m){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let p=i[m];if(p==null||m[0]==="o"&&m[1]==="n")continue;if(typeof p=="function")E(o,be(o,m,p));else if(typeof p=="boolean")m in o&&(m==="checked"||m==="disabled"||m==="selected")?o[m]=p:p?o.setAttribute(m,""):o.removeAttribute(m);else{let b=String(p);o.setAttribute(m,$(m)?j(b):b)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var Pi=c("html"),st=c("head"),at=c("body"),ct=c("title"),h=c("div"),S=c("span"),lt=c("section"),ut=c("article"),dt=c("header"),pt=c("footer"),ft=c("nav"),mt=c("main"),bt=c("aside"),gt=c("address"),ye=c("p"),ht=c("h1"),yt=c("h2"),xe=c("h3"),xt=c("h4"),vt=c("h5"),Tt=c("h6"),kt=c("blockquote"),Et=c("dd"),wt=c("dl"),St=c("dt"),Ct=c("figcaption"),At=c("figure"),_t=c("hr"),Nt=c("li"),Lt=c("ol"),Mt=c("ul"),ve=c("pre"),Rt=c("a"),Ot=c("abbr"),Pt=c("b"),Dt=c("bdi"),Ft=c("bdo"),Ht=c("br"),Bt=c("cite"),Te=c("code"),zt=c("data"),It=c("dfn"),jt=c("em"),$t=c("i"),qt=c("kbd"),Kt=c("mark"),Ut=c("q"),Vt=c("rp"),Wt=c("rt"),Gt=c("ruby"),Jt=c("s"),Qt=c("samp"),Xt=c("small"),Yt=c("strong"),Zt=c("sub"),en=c("sup"),tn=c("time"),nn=c("u"),rn=c("var"),on=c("area"),sn=c("audio"),an=c("img"),cn=c("map"),ln=c("track"),un=c("video"),dn=c("embed"),pn=c("iframe"),fn=c("object"),mn=c("param"),bn=c("picture"),gn=c("portal"),hn=c("source"),yn=c("svg",k),xn=c("math"),vn=c("canvas"),Tn=c("noscript"),kn=c("script"),En=c("del"),wn=c("ins"),Sn=c("caption"),Cn=c("col"),An=c("colgroup"),_n=c("table"),Nn=c("tbody"),Ln=c("td"),Mn=c("tfoot"),Rn=c("th"),On=c("thead"),Pn=c("tr"),X=c("button"),Dn=c("datalist"),Fn=c("fieldset"),Hn=c("form"),Bn=c("input"),zn=c("label"),In=c("legend"),jn=c("meter"),$n=c("optgroup"),qn=c("option"),Kn=c("output"),Un=c("progress"),Vn=c("select"),Wn=c("textarea"),Gn=c("details"),Jn=c("dialog"),Qn=c("menu"),Xn=c("summary"),Yn=c("slot"),Zn=c("template"),er=c("base"),tr=c("link"),nr=c("meta"),z=c("style"),rr=c("circle",k),or=c("ellipse",k),ir=c("g",k),sr=c("line",k),ar=c("path",k),cr=c("polygon",k),lr=c("polyline",k),ur=c("rect",k),dr=c("text",k),pr=c("tspan",k),fr=c("defs",k),mr=c("clipPath",k),br=c("mask",k),gr=c("pattern",k),hr=c("linearGradient",k),yr=c("radialGradient",k),xr=c("stop",k),vr=c("use",k),Tr=c("symbol",k),kr=c("marker",k),Er=c("center"),wr=c("font"),Sr=c("marquee"),Cr=e=>c(e);var Jo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ar=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),_r=new WeakMap;function Qo(e){let t=e.length-1,n=e[0];for(let p=0;p<t;p++)n+=`\0${p}\0${e[p+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
2
|
-
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let p=r;r++;let b=0;for(;r<o&&n.charCodeAt(r)!==0;)b=b*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,b<0||b>=t?(r=p,-1):b}function a(){let p=r;for(;r<o;){let b=n.charCodeAt(r);if(b>=97&&b<=122||b>=65&&b<=90||b>=48&&b<=57||b===45)r++;else break}return n.slice(p,r)}function u(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let p=s();if(p>=0)return{kind:"expr",idx:p};let b=n[r];if(b==='"'||b==="'"){r++;let y=[],D=[],I="";for(;r<o&&n[r]!==b;){let se=s();se>=0?(y.push(I),I="",D.push(se)):I+=n[r++]}return r<o&&r++,y.push(I),D.length===0?{kind:"static",value:y[0]}:{kind:"mixed",statics:y,exprs:D}}let T=r;for(;r<o;){let y=n.charCodeAt(r);if(y===32||y===9||y===10||y===13||y===62||y===47)break;r++}return{kind:"static",value:n.slice(T,r)}}function l(){let p=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let b=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let T=n.slice(b,r);if(!T)break;let v=u();T.startsWith("on:")?v.kind==="expr"&&p.push({t:3,name:T.slice(3),idx:v.idx}):v.kind==="bool"?p.push({t:4,name:T}):v.kind==="static"?p.push({t:0,name:T,value:v.value}):v.kind==="expr"?p.push({t:1,name:T,idx:v.idx}):v.kind==="mixed"&&p.push({t:2,name:T,statics:v.statics,exprs:v.exprs})}return p}function d(p){return p.replace(/\s+/g," ")}function f(p){let b="";for(;r<o&&n[r]!=="<";){let v=s();if(v>=0){let y=d(b);y&&p.push({t:1,value:y}),b="",p.push({t:2,idx:v})}else b+=n[r++]}let T=d(b);T&&p.push({t:1,value:T})}function m(){let p=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){r++;let b=a(),T=l();i();let v=Jo.has(b),y=n[r]==="/";if(y&&r++,r<o&&r++,v||y)p.push({t:0,el:{tag:b,svg:Ar.has(b),attrs:T,children:[]}});else{let D=m();n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),p.push({t:0,el:{tag:b,svg:Ar.has(b),attrs:T,children:D}})}}else f(p);return p}return m()}function Re(e,t){let n=e.svg?document.createElementNS(k,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:n.setAttribute(o.name,o.value);break;case 1:{let i=o.name;if(i[0]==="o"&&i[1]==="n")break;let s=t[o.idx];if(typeof s=="function")E(n,be(n,i,s));else if(s!=null){let a=String(s);n.setAttribute(i,$(i)?j(a):a)}break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++)i+=String(t[o.exprs[s]])+o.statics[s+1];n.setAttribute(o.name,i);break}case 3:n.addEventListener(o.name,t[o.idx]);break;case 4:n.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(Re(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),E(n,K(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Oe(e,...t){let n=_r.get(e);if(n||(n=Qo(e),_r.set(e,n)),n.length===1&&n[0].t===0)return Re(n[0].el,t);let r=document.createElement("div");for(let o=0;o<n.length;o++){let i=n[o];switch(i.t){case 0:r.appendChild(Re(i.el,t));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=t[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),E(r,K(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let u=s[a];u instanceof Node?r.appendChild(u):u!=null&&typeof u!="boolean"&&r.appendChild(document.createTextNode(String(u)))}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 Nr(e,t){if(!t)throw new Error("[Sibu] mount: container element not found. Make sure the DOM element exists before calling mount().");L(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-n:0;t.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:t,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),R(r),r.parentNode&&r.parentNode.removeChild(r)}}}var Xo=_();function Lr(e){return typeof e=="function"?Lr(e()):e instanceof Node?e:document.createTextNode(String(e))}function Yo(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let u=e[a],l=0,d=n.length;for(;l<d;){let f=l+d>>1;e[n[f]]<u?l=f+1:d=f}n[l]=a,r[a]=l>0?n[l-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Mr(e,t,n){L(typeof e=="function","each: first argument must be a function that returns an array."),L(typeof t=="function","each: second argument must be a render function."),L(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,u=0,l=new Map,d=new Map,f=[],m=[],p=new Uint8Array(0),b=new Map,T=[],v=[],y=new Map,D=!1,I=!1,se=n.key,We=()=>{let Ge=e(),C=Ge.length,ae=r.parentNode;if(!ae)return;I||(ae.insertBefore(o,r.nextSibling),I=!0),m.length<C&&(m=new Array(C));for(let g=0;g<C;g++)m[g]=se(Ge[g]);let te=m;f.length<C&&(f=new Array(C)),d.clear(),y.clear();for(let g=0;g<C;g++)y.set(te[g],g);for(let g=0;g<C;g++){let N=te[g],Qe=l.get(N),ne;if(Qe!==void 0)ne=Qe;else{let Xe=N,Ro=()=>e()[y.get(Xe)],Oo=()=>y.get(Xe);try{ne=Lr(t(Ro,Oo))}catch(Ae){Xo&&M(`each: render threw for item at index ${g} (key="${te[g]}"): ${Ae instanceof Error?Ae.message:String(Ae)}`),ne=document.createComment(`each:error:${g}`)}}d.set(N,ne),f[g]=ne}for(let[g,N]of l)d.has(g)||(R(N),N.parentNode&&ae.removeChild(N));if(C===0){u=0;let g=l;l=d,d=g;return}b.clear();for(let g=0;g<u;g++)b.set(a[g],g);T.length<C&&(T=new Array(C),v=new Array(C));let ce=0;for(let g=0;g<C;g++){let N=b.get(te[g]);N!==void 0&&(T[ce]=g,v[ce]=N,ce++)}let Je=Yo(v,ce);p.length<C?p=new Uint8Array(C):p.fill(0,0,C);for(let g=0;g<Je.length;g++)p[T[Je[g]]]=1;let le=o;for(let g=C-1;g>=0;g--){let N=f[g];p[g]||N.nextSibling!==le&&ae.insertBefore(N,le),le=N}let ue=a===i?s:i;ue.length<C&&(ue.length=C);for(let g=0;g<C;g++)ue[g]=te[g];a=ue,u=C;let Mo=l;l=d,d=Mo,D=!0};return x(We),D||queueMicrotask(()=>{!D&&r.parentNode&&We()}),r}function Or(e){let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||t.appendChild(Rr(r));else t.appendChild(Rr(n));return t}function Rr(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let t=e();return t instanceof Node?t:document.createTextNode(String(t??""))}return document.createTextNode(String(e))}function Pr(e,t){let n=document.createComment("portal"),r=t||document.body,o=null;return queueMicrotask(()=>{try{o=e(),r.appendChild(o)}catch(i){typeof console<"u"&&console.error("[Portal] Render error:",i)}}),E(n,()=>{o&&(R(o),o.remove(),o=null)}),n}var Pe=new Map;function Dr(e,t){Pe.set(e,t)}function Fr(e){Pe.delete(e)}function De(e){let t=Pe.get(e);return t?t():h({nodes:`[Component "${e}" not found]`})}function Hr(e){let t=h({class:"sibu-dynamic"});function n(){let r=e(),o;typeof r=="function"?o=r():o=De(r);for(let i of Array.from(t.childNodes))R(i);t.replaceChildren(o)}return x(n),t}function Br(e,t="default"){return e?.[t]}function zr(e,t){return x(()=>{t.style.display=e()?"":"none"}),t}function Ir(e,t,n){let r=document.createComment("when"),o=null,i,s=!1,a=()=>{let u=e(),l=r.parentNode;if(!l||s&&u===i)return;i=u,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=u?t():n?n():null;if(d!=null){let f=d instanceof Node?d:document.createTextNode(String(d));l.insertBefore(f,r.nextSibling),o=f}s=!0};return x(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function jr(e,t,n){let r=document.createComment("match"),o=null,i,s=!1,a=()=>{let u=String(e()),l=r.parentNode;if(!l||s&&u===i)return;i=u,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=t[u]||n;if(d){let f=d();if(f!=null){let m=f instanceof Node?f:document.createTextNode(String(f));l.insertBefore(m,r.nextSibling),o=m}}s=!0};return x(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function $r(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??0,a,u=null,l=!1,d=()=>{let f=e(),m=r.parentNode;if(!m||l&&f===a)return;u?.parentNode&&m.removeChild(u),a=f;let p=o.get(f);if(p){let b=i.indexOf(f);b!==-1&&(i.splice(b,1),i.push(f))}else{let b=t[f];if(!b){u=null,l=!0;return}if(p=b(),o.set(f,p),i.push(f),s>0&&i.length>s){let T=i.shift(),v=o.get(T);v&&(R(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(T))}}m.insertBefore(p,r.nextSibling),u=p,l=!0};return x(d),l||queueMicrotask(()=>{!l&&r.parentNode&&d()}),r}function qr(e,t,n){let r=t(e,n);typeof r=="function"&&E(e,r)}var Kr=(e,t)=>{let n=r=>{e.contains(r.target)||t()};return document.addEventListener("pointerdown",n,!0),()=>document.removeEventListener("pointerdown",n,!0)},Ur=(e,t)=>{let n=t.duration??500,r=null,o=()=>{r=setTimeout(()=>{t.callback(),r=null},n)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},Vr=(e,t)=>{let n=()=>{let r=typeof t=="function"?t():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",n),()=>e.removeEventListener("click",n)},Wr=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},Gr=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};var U=null;function Jr(e,t){try{let n=e();return n&&typeof n.then=="function"&&n.catch(r=>{t?t(r,"async"):U?U(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),n}catch(n){return t?t(n,"sync"):U?U(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Qr(e,t){try{return await e()}catch(n){return t?t(n,"async"):U?U(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Xr(e){U=e}var Fe=0;function Yr(e="sibu"){return Fe++,`${e}-${Fe}`}function Zr(){Fe=0}var ie=0,He=new Set;function ke(e){ie++;try{return e()}finally{ie--,ie===0&&Zo()}}function Y(e){return ie===0?!1:(He.add(e),!0)}function eo(){return ie>0}function Zo(){for(let e of He)nt(e);He.clear(),rt()}var to=globalThis,Be=_();function w(e,t){let n={value:e},r=Be?t?.name:void 0,o=t?.equals;r&&(n.__name=r);function i(){return Q(n),n.value}i.__signal=n,r&&(i.__name=r);function s(a){let u=typeof a=="function"?a(n.value):a;if(!(o?o(n.value,u):Object.is(u,n.value))){if(Be){let l=n.value;n.value=u;let d=to.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:n,name:r,oldValue:l,newValue:u})}else n.value=u;Y(n)||fe(n)}}if(Be){let a=to.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}var Ee=!1;function Z(){return Ee}function ze(){Ee=!0}function Ie(){Ee=!1}function no(e){let t=Ee;ze();try{return e()}finally{t||Ie()}}var ro=globalThis;function oo(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,J(()=>t(o,void 0));else{let i=n;n=o,J(()=>t(o,i))}}}function P(e,t){if(L(typeof e=="function","effect: argument must be a function."),Z())return()=>{};let n=t?.onError,r=n?()=>{try{e()}catch(a){n(a)}}:e,o=()=>{},i=()=>{o(),o=x(r,i)};o=x(r,i);let s=ro.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return s&&s.emit("effect:create",{effectFn:e}),()=>{let a=ro.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("effect:destroy",{effectFn:e}),o()}}function we(e,t){L(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r={};r._d=!1,r._g=e;let o=()=>{r._d||(r._d=!0)};o._c=1,o._sig=r,x(()=>{r._d=!1,r._v=e()},o);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,s=!1;function a(){if(s)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);if(pe){if(r._d){s=!0;try{r._d=!1,r._v=e()}finally{s=!1}}return r._v}if(Q(r),r._d){let u=r._v;s=!0;try{x(()=>{r._d=!1,r._v=e()},o)}finally{s=!1}i&&u!==r._v&&i.emit("computed:update",{signal:r,oldValue:u,newValue:r._v})}return r._v}return n&&(a.__name=n,r.__name=n),a.__signal=r,i&&i.emit("computed:create",{signal:r,name:n,getter:a}),a}function io(e,t){if(L(typeof e=="function","watch: first argument must be a getter function."),L(typeof t=="function","watch: second argument must be a callback function."),Z())return()=>{};let n,r=!0;return x(()=>{let s=e();if(r){n=s,r=!1;return}Object.is(s,n)||(t(s,n),n=s)})}function so(e){L(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t={};Object.keys(e).forEach(u=>{let[l,d]=w(e[u]);t[u]=[l,d]});let n=new Proxy({},{get(u,l){if(l in t){let d=t[l][0];return d()}},set(){throw new Error("[Sibu] store: Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let u={};return Object.keys(t).forEach(l=>{u[l]=t[l][0]()}),u};return[n,{setState:u=>{let l=r(),d=typeof u=="function"?u(l):u;Object.entries(d).forEach(([f,m])=>{f in t&&t[f][1](m)})},reset:()=>{Object.keys(e).forEach(u=>{let l=t[u][1];l(e[u])})},subscribe:u=>{let l=!0;return P(()=>{let d=r();if(l){l=!1;return}u(d)})},subscribeKey:(u,l)=>{let d,f=!0;return P(()=>{let m=t[u][0]();if(f){d=m,f=!1;return}if(!Object.is(m,d)){let p=d;d=m,l(m,p)}})},getSnapshot:r}]}function ao(e){let[t,n]=w(e);return{get current(){return t()},set current(r){n(r)}}}function co(e=[]){let[t,n]=w([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return n(u=>{let l=[...u];return a=l.splice(o,i,...s),l}),a},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,u)=>u!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,u)=>u===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function lo(e=[]){let t=[...e],n=null,r={};function o(){n=null,Y(r)||fe(r)}function i(){return Q(r),n===null&&(n=Object.freeze([...t])),n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,u=0,...l){let d=t.splice(a,u,...l);return(d.length>0||l.length>0)&&o(),d},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let u=t.findIndex(a);u!==-1&&(t.splice(u,1),o())},set(a){t=[...a],o()},update(a,u){a<0||a>=t.length||Object.is(t[a],u)||(t[a]=u,o())},updateWhere(a,u){let l=!1;for(let d=0;d<t.length;d++)if(a(t[d])){let f=u(t[d]);Object.is(t[d],f)||(t[d]=f,l=!0)}l&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let u=t.filter(a);u.length!==t.length&&(t=u,o())},map(a){let u=!1;for(let l=0;l<t.length;l++){let d=a(t[l],l);Object.is(t[l],d)||(t[l]=d,u=!0)}u&&o()},clear(){t.length!==0&&(t=[],o())}}]}function ee(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let u=t;return e.source===u.source&&e.flags===u.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let u=t;if(e.size!==u.size)return!1;for(let[l,d]of e)if(!u.has(l)||!ee(d,u.get(l),n))return!1;return!0}if(e instanceof Set){let u=t;if(e.size!==u.size)return!1;for(let l of e)if(!u.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let u=new Uint8Array(e),l=new Uint8Array(t);if(u.length!==l.length)return!1;for(let d=0;d<u.length;d++)if(u[d]!==l[d])return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let u=e,l=t;if(u.length!==l.length)return!1;for(let d=0;d<u.length;d++)if(u[d]!==l[d])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((u,l)=>ee(u,t[l],n));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(u=>ee(r[u],o[u],n))}function uo(e){return w(e,{equals:(t,n)=>ee(t,n)})}function po(e,t,n){return[we(e,n),i=>{ke(()=>t(i))}]}function fo(e,t){let[n,r]=w(t),[o,i]=w(!1),[s,a]=w(null),[u,l]=w(0),d=0;return P(()=>{u();let f=++d;i(!0),a(null);let m;try{m=e()}catch(p){a(p),i(!1);return}m.then(p=>{f===d&&(r(p),i(!1))},p=>{f===d&&(a(p),i(!1))})}),{value:n,loading:o,error:s,refresh:()=>l(f=>f+1)}}function Se(e,t){try{return e()}catch(n){M(`${t}: callback threw: ${n instanceof Error?n.message:String(n)}`);return}}function je(e,t,n){let r=Se(e,t);typeof r=="function"&&n&&E(n,r)}function $e(e,t){if(!(typeof document>"u"))if(t){if(t.isConnected){queueMicrotask(()=>je(e,"onMount",t));return}let n=new MutationObserver(()=>{t.isConnected&&(n.disconnect(),je(e,"onMount",t))});E(t,()=>n.disconnect()),queueMicrotask(()=>{t.isConnected?je(e,"onMount",t):n.observe(document.body,{childList:!0,subtree:!0})})}else queueMicrotask(()=>{Se(e,"onMount")})}function mo(e,t){E(t,()=>Se(e,"onUnmount"));let n=()=>{let r=new MutationObserver(()=>{t.isConnected||(r.disconnect(),Se(e,"onUnmount"))});r.observe(document.body,{childList:!0,subtree:!0}),E(t,()=>r.disconnect())};t.isConnected?n():$e(()=>{n()},t)}function bo(e,t){E(t,e)}function go(e){let[t,n]=w(e);return{provide(r){n(r)},use(){return t},get(){return t()},set(r){n(r)}}}function ho(e){let t=e();return _()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[Sibu strict] second run threw:",n)}}),t}function yo(e){if(!_())return P(e);let t=P(e),n=null;return queueMicrotask(()=>{try{n=P(e)}catch(r){console.warn("[Sibu strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function xo(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}function To(e){let[t,n]=w(e()),r=!1,o=t(),i=()=>{r=!1,n(o)},s=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(i):i()}))};return x(()=>{o=e(),s()}),t}var vo=16;function ei(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:vo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,vo)}function ko(){let[e,t]=w(!1);function n(r){t(!0),ei(()=>{let o;try{o=r()}catch{t(!1);return}o&&typeof o.then=="function"?o.then(()=>t(!1),()=>t(!1)):t(!1)})}return{pending:e,start:n}}function qe(e){let t=null;return function(){if(t)return t();let r=h({class:"sibu-lazy"}),o=!1;e().then(s=>{if(o)return;t=s.default;let a=t();r.replaceChildren(a)}).catch(s=>{if(o)return;let a=s instanceof Error?s:new Error(String(s));r.replaceChildren(h("sibu-lazy-error",`Failed to load component: ${a.message}`))}),r.appendChild(S("sibu-lazy-loading","Loading..."));let i=r.remove.bind(r);return r.remove=()=>{o=!0,i()},r}}function Ke({nodes:e,fallback:t}){let n=h({class:"sibu-suspense"}),r=t();return n.appendChild(r),queueMicrotask(()=>{try{let o=e();if(o.classList.contains("sibu-lazy")){let i=new MutationObserver(()=>{o.querySelector(".sibu-lazy-loading")||(i.disconnect(),n.replaceChildren(o))});i.observe(o,{childList:!0,subtree:!0}),o.querySelector(".sibu-lazy-loading")||n.replaceChildren(o)}else n.replaceChildren(o)}catch{}}),n}var ti=_(),ni=`
|
|
1
|
+
"use strict";var Sibu=(()=>{var je=Object.defineProperty;var mi=Object.getOwnPropertyDescriptor;var gi=Object.getOwnPropertyNames;var bi=Object.prototype.hasOwnProperty;var Tt=(e,t)=>{for(var n in t)je(e,n,{get:t[n],enumerable:!0})},hi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of gi(t))!bi.call(e,o)&&o!==n&&je(e,o,{get:()=>t[o],enumerable:!(r=mi(t,o))||r.enumerable});return e};var yi=e=>hi(je({},"__esModule",{value:!0}),e);var cs={};Tt(cs,{DynamicComponent:()=>po,ErrorBoundary:()=>ai,ErrorDisplay:()=>Ie,Fragment:()=>co,KeepAlive:()=>yo,Loading:()=>li,Portal:()=>lo,SVG_NS:()=>E,Suspense:()=>ut,__resetIdCounter:()=>Lo,a:()=>an,abbr:()=>cn,action:()=>xo,address:()=>Vt,area:()=>$n,array:()=>Bo,article:()=>zt,aside:()=>qt,asyncDerived:()=>Vo,audio:()=>Hn,autoResize:()=>wo,b:()=>ln,base:()=>_r,batch:()=>P,bdi:()=>un,bdo:()=>dn,bindDynamic:()=>Je,blockquote:()=>Zt,body:()=>Ot,br:()=>fn,button:()=>se,canvas:()=>Jn,caption:()=>Yn,catchError:()=>ko,catchErrorAsync:()=>Co,center:()=>Qr,checkLeaks:()=>Mt,circle:()=>Mr,cite:()=>pn,clickOutside:()=>vo,clipPath:()=>jr,code:()=>Pe,col:()=>er,colgroup:()=>tr,context:()=>Jo,copyOnClick:()=>So,createId:()=>_o,customElement:()=>eo,data:()=>mn,datalist:()=>lr,dd:()=>Qt,deepEqual:()=>de,deepSignal:()=>jo,defer:()=>Yo,defs:()=>Ir,del:()=>Qn,derived:()=>Fe,details:()=>Sr,dfn:()=>gn,dialog:()=>wr,disableSSR:()=>$o,dispose:()=>M,div:()=>T,dl:()=>Xt,dt:()=>Yt,each:()=>so,effect:()=>O,ellipse:()=>Rr,em:()=>bn,embed:()=>Fn,enableSSR:()=>Ro,enqueueBatchedSignal:()=>ae,fieldset:()=>ur,figcaption:()=>en,figure:()=>tn,font:()=>Xr,footer:()=>Bt,form:()=>dr,g:()=>$r,getSSRStore:()=>le,getSlot:()=>mo,h1:()=>Kt,h2:()=>Ut,h3:()=>Oe,h4:()=>Wt,h5:()=>Jt,h6:()=>Gt,head:()=>Ht,header:()=>Ft,hr:()=>nn,html:()=>Qe,i:()=>hn,iframe:()=>Bn,img:()=>On,input:()=>fr,ins:()=>Xn,isBatching:()=>No,isSSR:()=>ue,kbd:()=>yn,label:()=>pr,lazy:()=>lt,legend:()=>mr,li:()=>rn,line:()=>Hr,linearGradient:()=>Kr,link:()=>Lr,longPress:()=>To,main:()=>jt,map:()=>Dn,mark:()=>xn,marker:()=>Zr,marquee:()=>Yr,mask:()=>qr,match:()=>ho,math:()=>Wn,menu:()=>Er,meta:()=>Nr,meter:()=>gr,mount:()=>ro,nav:()=>It,nextTick:()=>Qo,noscript:()=>Gn,object:()=>In,ol:()=>on,on:()=>Do,onCleanup:()=>Wo,onMount:()=>ve,onUnmount:()=>Uo,optgroup:()=>br,option:()=>hr,output:()=>yr,p:()=>He,param:()=>jn,path:()=>Or,pattern:()=>Vr,picture:()=>qn,polygon:()=>Dr,polyline:()=>Pr,portal:()=>Vn,pre:()=>De,progress:()=>xr,q:()=>vn,radialGradient:()=>Ur,reactiveArray:()=>Io,rect:()=>zr,ref:()=>Fo,registerComponent:()=>uo,registerDisposer:()=>v,resolveComponent:()=>Ye,retrack:()=>te,rp:()=>Tn,rt:()=>Sn,ruby:()=>wn,runInSSRContext:()=>Ho,s:()=>En,samp:()=>kn,script:()=>Zn,section:()=>Pt,select:()=>vr,setGlobalErrorHandler:()=>Ao,setMaxDrainIterations:()=>Ue,show:()=>go,signal:()=>C,slot:()=>Cr,small:()=>Cn,source:()=>Kn,span:()=>A,stop:()=>Wr,store:()=>zo,strict:()=>Go,strictEffect:()=>Zo,strong:()=>An,style:()=>J,sub:()=>_n,summary:()=>kr,sup:()=>Ln,svg:()=>Un,symbol:()=>Gr,table:()=>nr,tagFactory:()=>u,takePendingError:()=>Te,tbody:()=>rr,td:()=>or,template:()=>Ar,text:()=>Fr,textarea:()=>Tr,tfoot:()=>ir,th:()=>sr,thead:()=>ar,time:()=>Nn,title:()=>Dt,tr:()=>cr,track:()=>Pn,transition:()=>ei,trapFocus:()=>Eo,trustHTML:()=>dt,tspan:()=>Br,u:()=>Mn,ul:()=>sn,unregisterComponent:()=>fo,untracked:()=>W,use:()=>Jr,var_:()=>Rn,video:()=>zn,watch:()=>Po,when:()=>bo,withSSR:()=>Oo,writable:()=>qo});var pt={};Tt(pt,{DynamicComponent:()=>po,ErrorBoundary:()=>ai,ErrorDisplay:()=>Ie,Fragment:()=>co,KeepAlive:()=>yo,Loading:()=>li,Portal:()=>lo,SVG_NS:()=>E,Suspense:()=>ut,__resetIdCounter:()=>Lo,a:()=>an,abbr:()=>cn,action:()=>xo,address:()=>Vt,area:()=>$n,array:()=>Bo,article:()=>zt,aside:()=>qt,asyncDerived:()=>Vo,audio:()=>Hn,autoResize:()=>wo,b:()=>ln,base:()=>_r,batch:()=>P,bdi:()=>un,bdo:()=>dn,bindDynamic:()=>Je,blockquote:()=>Zt,body:()=>Ot,br:()=>fn,button:()=>se,canvas:()=>Jn,caption:()=>Yn,catchError:()=>ko,catchErrorAsync:()=>Co,center:()=>Qr,checkLeaks:()=>Mt,circle:()=>Mr,cite:()=>pn,clickOutside:()=>vo,clipPath:()=>jr,code:()=>Pe,col:()=>er,colgroup:()=>tr,context:()=>Jo,copyOnClick:()=>So,createId:()=>_o,customElement:()=>eo,data:()=>mn,datalist:()=>lr,dd:()=>Qt,deepEqual:()=>de,deepSignal:()=>jo,defer:()=>Yo,defs:()=>Ir,del:()=>Qn,derived:()=>Fe,details:()=>Sr,dfn:()=>gn,dialog:()=>wr,disableSSR:()=>$o,dispose:()=>M,div:()=>T,dl:()=>Xt,dt:()=>Yt,each:()=>so,effect:()=>O,ellipse:()=>Rr,em:()=>bn,embed:()=>Fn,enableSSR:()=>Ro,enqueueBatchedSignal:()=>ae,fieldset:()=>ur,figcaption:()=>en,figure:()=>tn,font:()=>Xr,footer:()=>Bt,form:()=>dr,g:()=>$r,getSSRStore:()=>le,getSlot:()=>mo,h1:()=>Kt,h2:()=>Ut,h3:()=>Oe,h4:()=>Wt,h5:()=>Jt,h6:()=>Gt,head:()=>Ht,header:()=>Ft,hr:()=>nn,html:()=>Qe,i:()=>hn,iframe:()=>Bn,img:()=>On,input:()=>fr,ins:()=>Xn,isBatching:()=>No,isSSR:()=>ue,kbd:()=>yn,label:()=>pr,lazy:()=>lt,legend:()=>mr,li:()=>rn,line:()=>Hr,linearGradient:()=>Kr,link:()=>Lr,longPress:()=>To,main:()=>jt,map:()=>Dn,mark:()=>xn,marker:()=>Zr,marquee:()=>Yr,mask:()=>qr,match:()=>ho,math:()=>Wn,menu:()=>Er,meta:()=>Nr,meter:()=>gr,mount:()=>ro,nav:()=>It,nextTick:()=>Qo,noscript:()=>Gn,object:()=>In,ol:()=>on,on:()=>Do,onCleanup:()=>Wo,onMount:()=>ve,onUnmount:()=>Uo,optgroup:()=>br,option:()=>hr,output:()=>yr,p:()=>He,param:()=>jn,path:()=>Or,pattern:()=>Vr,picture:()=>qn,polygon:()=>Dr,polyline:()=>Pr,portal:()=>Vn,pre:()=>De,progress:()=>xr,q:()=>vn,radialGradient:()=>Ur,reactiveArray:()=>Io,rect:()=>zr,ref:()=>Fo,registerComponent:()=>uo,registerDisposer:()=>v,resolveComponent:()=>Ye,retrack:()=>te,rp:()=>Tn,rt:()=>Sn,ruby:()=>wn,runInSSRContext:()=>Ho,s:()=>En,samp:()=>kn,script:()=>Zn,section:()=>Pt,select:()=>vr,setGlobalErrorHandler:()=>Ao,setMaxDrainIterations:()=>Ue,show:()=>go,signal:()=>C,slot:()=>Cr,small:()=>Cn,source:()=>Kn,span:()=>A,stop:()=>Wr,store:()=>zo,strict:()=>Go,strictEffect:()=>Zo,strong:()=>An,style:()=>J,sub:()=>_n,summary:()=>kr,sup:()=>Ln,svg:()=>Un,symbol:()=>Gr,table:()=>nr,tagFactory:()=>u,takePendingError:()=>Te,tbody:()=>rr,td:()=>or,template:()=>Ar,text:()=>Fr,textarea:()=>Tr,tfoot:()=>ir,th:()=>sr,thead:()=>ar,time:()=>Nn,title:()=>Dt,tr:()=>cr,track:()=>Pn,transition:()=>ei,trapFocus:()=>Eo,trustHTML:()=>dt,tspan:()=>Br,u:()=>Mn,ul:()=>sn,unregisterComponent:()=>fo,untracked:()=>W,use:()=>Jr,var_:()=>Rn,video:()=>zn,watch:()=>Po,when:()=>bo,withSSR:()=>Oo,writable:()=>qo});function k(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}var St=k();function $(e,t){if(St&&!e)throw new Error(`[SibuJS] ${t}`)}function w(e){St&&console.warn(`[SibuJS] ${e}`)}var xi=["http:","https:","mailto:","tel:","ftp:"];function q(e){let t=e.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!t)return"";let n=t.toLowerCase(),r=-1;for(let i=0;i<n.length;i++){let s=n.charCodeAt(i);if(s===58){r=i;break}if(s===47||s===63||s===35)break}if(r===-1)return t;let o=n.slice(0,r+1);return/^[a-z][a-z0-9+.-]*:$/.test(o)&&xi.indexOf(o)===-1?"":t}function be(e){let t=e.split(","),n=[];for(let r=0;r<t.length;r++){let o=t[r].trim();if(!o)continue;let i=o.match(/^(\S+)(\s+.+)?$/);if(!i)continue;let s=q(i[1]);s&&n.push(i[2]?`${s}${i[2]}`:s)}return n.join(", ")}function qe(e){let n=e.replace(/\\([0-9a-fA-F]{1,6})\s?/g,(r,o)=>{let i=Number.parseInt(o,16);if(!Number.isFinite(i)||i<0||i>1114111)return"";try{return String.fromCodePoint(i)}catch{return""}}).toLowerCase().replace(/\s+/g,"");return n.includes("url(")||n.includes("expression(")||n.includes("javascript:")||n.includes("vbscript:")||n.includes("-moz-binding")||n.includes("behavior:")||n.includes("@import")||n.includes("image-set(")||n.includes("filter:progid")?"":e}var vi=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data"]);function U(e){return vi.has(e)}var Ti=k(),Ke=32,Si=128,G=new Array(Ke),I=Ke,H=-1,B=null,j="__s";function Ae(e,t){let n=t.size;n===0?(e.__f=void 0,delete e[j]):n===1?e.__f=t.values().next().value:e.__f=void 0}var D=0,F=[],N=new Set,wi=[];function Et(e){try{e()}catch(t){Ti&&w(`Subscriber threw during notification: ${t instanceof Error?t.message:String(t)}`)}}var _e=0,Ne=!1,Ei=0;function te(e,t){let n=B;B=t;let r=t,o=++Ei;r._epoch=o;try{e()}finally{B=n,ki(r,o)}}function ki(e,t){if(e._dep!==void 0){if(e._depEpoch!==t){let o=e._dep,i=o[j];i?.delete(e)&&Ae(o,i),e._dep=void 0,e._depEpoch=void 0}return}let n=e._deps;if(!n||n.size===0)return;let r;for(let[o,i]of n)i!==t&&(r??(r=[])).push(o);if(r)for(let o of r){n.delete(o);let i=o,s=i[j];s?.delete(e)&&Ae(i,s)}}function S(e,t){t||(t=e),wt(t),++H,H>=I&&(I*=2,G.length=I),G[H]=t,B=t;try{e()}finally{H--,B=H>=0?G[H]:null,H<0&&I>Si&&(I=Math.max(Ke,I>>>1),G.length=I)}return()=>wt(t)}function Ci(){_e===0&&(++H,H>=I&&(I*=2,G.length=I),G[H]=null,B=null,Ne=!0),_e++}function Ai(){_e--,_e===0&&(H--,B=H>=0?G[H]:null,Ne=!1)}function W(e){Ci();try{return e()}finally{Ai()}}function ne(e){if(!B)return;let t=B,n=t._epoch;if(t._dep===e){t._depEpoch=n;return}let r=t._deps;if(r)r.set(e,n);else if(t._dep!==void 0){let a=new Map;a.set(t._dep,t._depEpoch),a.set(e,n),t._deps=a,t._dep=void 0,t._depEpoch=void 0}else t._dep=e,t._depEpoch=n;let o=e,i=o[j];i||(i=new Set,o[j]=i);let s=i.size;i.add(B),i.size!==s&&(i.size===1?o.__f=B:o.__f!==void 0&&(o.__f=void 0))}function kt(e){let t=e[j];if(t)for(let n of t)n._c?he(n):N.has(n)||(N.add(n),F.push(n))}var Ct=50,Le=1e6,ye=0;function Ue(e){let t=Le;return Number.isFinite(e)&&e>0&&(Le=Math.floor(e)),t}function At(e){let t=e;return t._runEpoch!==ye?(t._runEpoch=ye,t._runs=1,!1):++t._runs>Ct}function _t(e){if(typeof console<"u"){let t=e.__name??"<unnamed>";console.error(`[SibuJS] subscriber "${t}" fired more than ${Ct} times \u2014 likely a write-reads-self cycle between effects/signals. Breaking to prevent infinite loop.`)}}function _i(){typeof console<"u"&&console.error(`[SibuJS] Notification drain exceeded ${Le} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`)}function Ve(){let e=0;for(;e<F.length;){if(e>=Le){_i();break}let t=F[e++];if(At(t)){_t(t);break}N.delete(t),Et(t)}}function Lt(){if(!(D>0)){D++,ye++;try{Ve()}finally{D--,D===0&&(F.length=0,N.clear())}}}function he(e){e();let t=e._sig;if(!t)return;let n=wi,r=n.length;for(n.push(t);n.length>r;){let o=n.pop(),i=o.__f;if(i){if(i._c){let a=i._sig;a._d||(a._d=!0,n.push(a))}else N.has(i)||(N.add(i),F.push(i));continue}let s=o[j];if(s)for(let a of s)if(a._c){let c=a._sig;c&&!c._d?(c._d=!0,n.push(c)):c||a()}else N.has(a)||(N.add(a),F.push(a))}}function Me(e){let t=e.__f;if(t){if(D>0){t._c?he(t):N.has(t)||(N.add(t),F.push(t));return}D++,ye++;try{t._c?he(t):At(t)?_t(t):Et(t),Ve()}finally{D--,D===0&&(F.length=0,N.clear())}return}let n=e[j];if(!(!n||n.size===0)){if(D>0){for(let r of n)r._c?he(r):N.has(r)||(N.add(r),F.push(r));return}D++,ye++;try{for(let r of n)r._c?he(r):N.has(r)||(N.add(r),F.push(r));Ve()}finally{D--,D===0&&(F.length=0,N.clear())}}}function wt(e){let t=e,n=t._dep;if(n!==void 0){let o=n,i=o[j];i?.delete(e)&&Ae(o,i),t._dep=void 0,t._depEpoch=void 0;return}let r=t._deps;if(!(!r||r.size===0)){for(let o of r.keys()){let i=o,s=i[j];s?.delete(e)&&Ae(i,s)}r.clear()}}var Re=k();function We(e,t,n){e[t]=n}function Li(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}function $e(e,t,n){if(Li(t))return Re&&w(`bindAttribute: refusing to bind event-handler attribute "${t}". Use on:{ ${t.slice(2)}: fn } instead.`),()=>{};function r(){let i;try{i=n()}catch(a){Re&&w(`bindAttribute: getter for "${t}" threw: ${a instanceof Error?a.message:String(a)}`);return}if(typeof i=="boolean"){t in e&&(t==="checked"||t==="disabled"||t==="selected")?We(e,t,i):i?e.setAttribute(t,""):e.removeAttribute(t);return}let s=String(i);(t==="value"||t==="checked")&&t in e?We(e,t,t==="checked"?!!i:s):e.setAttribute(t,U(t)?q(s):s)}return S(r)}function Je(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){Re&&w(`bindDynamic: name getter threw: ${l instanceof Error?l.message:String(l)}`);return}let a;try{a=typeof n=="function"?n():n}catch(l){Re&&w(`bindDynamic: value getter threw: ${l instanceof Error?l.message:String(l)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;r!==null&&r!==s&&e.removeAttribute(r);let c=String(a);(s==="value"||s==="checked")&&s in e?We(e,s,s==="checked"?!!a:c):e.setAttribute(s,U(s)?q(c):c),r=s}let i=S(o);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Nt=k();function Z(e,t){let n=[];function r(){let o;try{o=t()}catch(l){Nt&&w(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}if(o==null||typeof o=="boolean"){for(let l=0;l<n.length;l++){let d=n[l];d.parentNode&&d.parentNode.removeChild(d)}n.length=0;return}let i=e.parentNode;if(!i){n.length=0;return}let s;if(Array.isArray(o)){s=[];let l=new Set;for(let d=0;d<o.length;d++){let m=o[d];if(m==null||typeof m=="boolean")continue;let b=m instanceof Node?m:document.createTextNode(String(m));if(l.has(b)){Nt&&w("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}l.add(b),s.push(b)}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let a;if(n.length>0&&s.length>0){let l=new Set(n);a=new Set;for(let d=0;d<s.length;d++)l.has(s[d])&&a.add(s[d])}for(let l=0;l<n.length;l++){let d=n[l];a?.has(d)||d.parentNode&&d.parentNode.removeChild(d)}let c=e.nextSibling;for(let l=0;l<s.length;l++){let d=s[l];a?.has(d)&&d.parentNode===i?d.nextSibling!==c&&i.insertBefore(d,c):i.insertBefore(d,c)}n=s}return S(r)}var re=new WeakMap,oe=k(),ie=0;function v(e,t){let n=re.get(e);n||(n=[],re.set(e,n)),n.push(t),oe&&ie++}function M(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--){let o=n[r],i=re.get(o);if(i){let s=i.slice();re.delete(o),oe&&(ie-=s.length);for(let c of s)try{c()}catch(l){oe&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",l)}let a=0;for(;a++<8;){let c=re.get(o);if(!c||c.length===0)break;let l=c.slice();re.delete(o),oe&&(ie-=l.length);for(let d of l)try{d()}catch(m){oe&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",m)}}}}}function Mt(e=0){return oe?(e>0&&ie>e&&w(`checkLeaks: ${ie} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),ie):0}var E="http://www.w3.org/2000/svg",Rt=k(),Ni=new Set(["script","iframe","object","embed","frame","frameset"]);function Mi(e){let t=e.toLowerCase();if(Ni.has(t))throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`)}var Ri=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);function $i(e,t,n){e[t]=n}var $t=new Map;function Hi(e){let t=$t.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),$t.set(e,t)),t}function Oi(e,t){if(typeof t=="function"){let r=S(()=>{e.setAttribute("style",t())});v(e,r);return}if(typeof t=="string"){e.setAttribute("style",t);return}let n=e;for(let r in t){let o=t[r],i=Hi(r);if(typeof o=="function"){let s=o,a=S(()=>{n.style.setProperty(i,qe(String(s())))});v(e,a)}else n.style.setProperty(i,qe(String(o)))}}function Di(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=S(()=>{e.setAttribute("class",t())});v(e,i);return}let n=t,r=!1,o="";for(let i in n){let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=S(()=>{let a="";for(let c in n){let l=n[c];(typeof l=="function"?l():l)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)});v(e,s)}else e.setAttribute("class",o)}function Ge(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),v(e,Z(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),v(e,Z(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),v(e,Z(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,t)=>(n,r)=>{Mi(e);let o=t?document.createElementNS(t,e):document.createElement(e);if(n===void 0)return o;if(typeof n=="string")return r!==void 0?(o.setAttribute("class",n),Ge(o,r),o):(o.textContent=n,o);if(typeof n=="number")return o.textContent=String(n),o;if(Array.isArray(n)||n instanceof Node||typeof n=="function")return Ge(o,n),o;let i=n,s=i.class;s!=null&&Di(o,s);let a=i.id;a!=null&&(Rt&&typeof a=="string"&&Ri.has(a.toLowerCase())&&w(`tagFactory: element id="${a}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),o.id=a);let c=r!==void 0?r:i.nodes;c!=null&&Ge(o,c);let l=i.on;if(l)for(let b in l){let f=l[b];typeof f=="function"?o.addEventListener(b,f):Rt&&w(`tagFactory: on.${b} handler is not a function (got ${typeof f}). Event listener was not attached.`)}let d=i.style;d!=null&&Oi(o,d);let m=i.ref;m&&(m.current=o);for(let b in i)switch(b){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let f=i[b];if(f==null)continue;let p=b.toLowerCase();if(p[0]==="o"&&p[1]==="n")continue;if(typeof f=="function")v(o,$e(o,b,f));else if(typeof f=="boolean")b in o&&(b==="checked"||b==="disabled"||b==="selected")?$i(o,b,f):f?o.setAttribute(b,""):o.removeAttribute(b);else{let g=String(f);p==="srcset"?o.setAttribute(b,be(g)):U(p)?o.setAttribute(b,q(g)):o.setAttribute(b,g)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var Ms=u("html"),Ht=u("head"),Ot=u("body"),Dt=u("title"),T=u("div"),A=u("span"),Pt=u("section"),zt=u("article"),Ft=u("header"),Bt=u("footer"),It=u("nav"),jt=u("main"),qt=u("aside"),Vt=u("address"),He=u("p"),Kt=u("h1"),Ut=u("h2"),Oe=u("h3"),Wt=u("h4"),Jt=u("h5"),Gt=u("h6"),Zt=u("blockquote"),Qt=u("dd"),Xt=u("dl"),Yt=u("dt"),en=u("figcaption"),tn=u("figure"),nn=u("hr"),rn=u("li"),on=u("ol"),sn=u("ul"),De=u("pre"),an=u("a"),cn=u("abbr"),ln=u("b"),un=u("bdi"),dn=u("bdo"),fn=u("br"),pn=u("cite"),Pe=u("code"),mn=u("data"),gn=u("dfn"),bn=u("em"),hn=u("i"),yn=u("kbd"),xn=u("mark"),vn=u("q"),Tn=u("rp"),Sn=u("rt"),wn=u("ruby"),En=u("s"),kn=u("samp"),Cn=u("small"),An=u("strong"),_n=u("sub"),Ln=u("sup"),Nn=u("time"),Mn=u("u"),Rn=u("var"),$n=u("area"),Hn=u("audio"),On=u("img"),Dn=u("map"),Pn=u("track"),zn=u("video"),Fn=u("embed"),Bn=u("iframe"),In=u("object"),jn=u("param"),qn=u("picture"),Vn=u("portal"),Kn=u("source"),Un=u("svg",E),Wn=u("math"),Jn=u("canvas"),Gn=u("noscript"),Zn=u("script"),Qn=u("del"),Xn=u("ins"),Yn=u("caption"),er=u("col"),tr=u("colgroup"),nr=u("table"),rr=u("tbody"),or=u("td"),ir=u("tfoot"),sr=u("th"),ar=u("thead"),cr=u("tr"),se=u("button"),lr=u("datalist"),ur=u("fieldset"),dr=u("form"),fr=u("input"),pr=u("label"),mr=u("legend"),gr=u("meter"),br=u("optgroup"),hr=u("option"),yr=u("output"),xr=u("progress"),vr=u("select"),Tr=u("textarea"),Sr=u("details"),wr=u("dialog"),Er=u("menu"),kr=u("summary"),Cr=u("slot"),Ar=u("template"),_r=u("base"),Lr=u("link"),Nr=u("meta"),J=u("style"),Mr=u("circle",E),Rr=u("ellipse",E),$r=u("g",E),Hr=u("line",E),Or=u("path",E),Dr=u("polygon",E),Pr=u("polyline",E),zr=u("rect",E),Fr=u("text",E),Br=u("tspan",E),Ir=u("defs",E),jr=u("clipPath",E),qr=u("mask",E),Vr=u("pattern",E),Kr=u("linearGradient",E),Ur=u("radialGradient",E),Wr=u("stop",E),Jr=u("use",E),Gr=u("symbol",E),Zr=u("marker",E),Qr=u("center"),Xr=u("font"),Yr=u("marquee"),eo=e=>u(e);var Pi=k(),zi=new Set(["script","style"]),Fi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),to=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),no=new WeakMap;function Bi(e){let t=e.length-1,n=e[0];for(let f=0;f<t;f++)n+=`\0${f}\0${e[f+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
2
|
+
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let f=r;r++;let p=0;for(;r<o&&n.charCodeAt(r)!==0;)p=p*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,p<0||p>=t?(r=f,-1):p}function a(){let f=r;for(;r<o;){let p=n.charCodeAt(r);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45)r++;else break}return n.slice(f,r)}function c(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let f=s();if(f>=0)return{kind:"expr",idx:f};let p=n[r];if(p==='"'||p==="'"){r++;let x=[],L=[],z="";for(;r<o&&n[r]!==p;){let Se=s();Se>=0?(x.push(z),z="",L.push(Se)):z+=n[r++]}return r<o&&r++,x.push(z),L.length===0?{kind:"static",value:x[0]}:{kind:"mixed",statics:x,exprs:L}}let g=r;for(;r<o;){let x=n.charCodeAt(r);if(x===32||x===9||x===10||x===13||x===62||x===47)break;r++}return{kind:"static",value:n.slice(g,r)}}function l(){let f=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let p=r;for(;r<o;){let x=n.charCodeAt(r);if(x>=97&&x<=122||x>=65&&x<=90||x>=48&&x<=57||x===45||x===58||x===95||x===46)r++;else break}let g=n.slice(p,r);if(!g)break;let h=c();g.startsWith("on:")?h.kind==="expr"&&f.push({t:3,name:g.slice(3),idx:h.idx}):h.kind==="bool"?f.push({t:4,name:g}):h.kind==="static"?f.push({t:0,name:g,value:h.value}):h.kind==="expr"?f.push({t:1,name:g,idx:h.idx}):h.kind==="mixed"&&f.push({t:2,name:g,statics:h.statics,exprs:h.exprs})}return f}function d(f){return f.replace(/\s+/g," ")}function m(f){let p="";for(;r<o&&n[r]!=="<";){let h=s();if(h>=0){let x=d(p);x&&f.push({t:1,value:x}),p="",f.push({t:2,idx:h})}else p+=n[r++]}let g=d(p);g&&f.push({t:1,value:g})}function b(){let f=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){r++;let p=a(),g=l();i();let h=Fi.has(p),x=n[r]==="/";if(x&&r++,r<o&&r++,h||x)f.push({t:0,el:{tag:p,svg:to.has(p),attrs:g,children:[]}});else{let L=b();if(zi.has(p.toLowerCase())){for(let z=0;z<L.length;z++)if(L[z].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${p}> (raw-text context). Build the content separately and append it as a Node.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),f.push({t:0,el:{tag:p,svg:to.has(p),attrs:g,children:L}})}}else m(f);return f}return b()}function Ze(e,t){let n=e.svg?document.createElementNS(E,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:n.setAttribute(o.name,o.value);break;case 1:{let i=o.name,s=i.toLowerCase();if(s[0]==="o"&&s[1]==="n")break;let a=t[o.idx];if(typeof a=="function")v(n,$e(n,i,a));else if(a!=null){let c=String(a);s==="srcset"?n.setAttribute(i,be(c)):U(s)?n.setAttribute(i,q(c)):n.setAttribute(i,c)}break}case 2:{let i=o.statics[0];for(let a=0;a<o.exprs.length;a++){let c=t[o.exprs[a]];i+=(c==null?"":String(c))+o.statics[a+1]}let s=o.name.toLowerCase();s==="srcset"?n.setAttribute(o.name,be(i)):U(s)?n.setAttribute(o.name,q(i)):n.setAttribute(o.name,i);break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):Pi&&w(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:n.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(Ze(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),v(n,Z(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Qe(e,...t){let n=no.get(e);if(n||(n=Bi(e),no.set(e,n)),n.length===1&&n[0].t===0)return Ze(n[0].el,t);let r=document.createElement("div");for(let o=0;o<n.length;o++){let i=n[o];switch(i.t){case 0:r.appendChild(Ze(i.el,t));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=t[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),v(r,Z(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 ro(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");$(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-n:0;t.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:t,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),M(r),r.parentNode&&r.parentNode.removeChild(r)}}}var oo=k();function io(e){return typeof e=="function"?io(e()):e instanceof Node?e:document.createTextNode(String(e))}function Ii(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let c=e[a],l=0,d=n.length;for(;l<d;){let m=l+d>>1;e[n[m]]<c?l=m+1:d=m}n[l]=a,r[a]=l>0?n[l-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function so(e,t,n){$(typeof e=="function","each: first argument must be a function that returns an array."),$(typeof t=="function","each: second argument must be a render function."),$(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,l=new Map,d=new Map,m=[],b=[],f=new Uint8Array(0),p=new Map,g=[],h=[],x=new Map,L=!1,z=!1,Se=n.key,mt=()=>{let gt=e(),_=gt.length,we=r.parentNode;if(!we)return;z||(we.insertBefore(o,r.nextSibling),z=!0),b.length<_&&(b=new Array(_));for(let y=0;y<_;y++)b[y]=Se(gt[y]);let me=b;m.length<_&&(m=new Array(_)),d.clear(),x.clear();for(let y=0;y<_;y++)x.set(me[y],y);for(let y=0;y<_;y++){let R=me[y],ht=l.get(R),ge;if(ht!==void 0)ge=ht;else{let yt=R,fi=()=>W(()=>e()[x.get(yt)]),pi=()=>x.get(yt);try{ge=io(t(fi,pi))}catch(ee){oo&&w(`each: render threw for item at index ${y} (key="${me[y]}"): ${ee instanceof Error?ee.message:String(ee)}`),ge=document.createComment(`each:error:${y}`);let xt=ee instanceof Error?ee:new Error(String(ee));queueMicrotask(()=>{try{let vt=r.parentNode;vt?.dispatchEvent?vt.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:xt}})):oo&&w(`each: error not surfaced \u2014 anchor detached: ${xt.message}`)}catch{}})}}d.set(R,ge),m[y]=ge}for(let[y,R]of l)d.has(y)||(M(R),R.parentNode&&we.removeChild(R));if(_===0){c=0;let y=l;l=d,d=y;return}p.clear();for(let y=0;y<c;y++)p.set(a[y],y);g.length<_&&(g=new Array(_),h=new Array(_));let Ee=0;for(let y=0;y<_;y++){let R=p.get(me[y]);R!==void 0&&(g[Ee]=y,h[Ee]=R,Ee++)}let bt=Ii(h,Ee);f.length<_?f=new Uint8Array(_):f.fill(0,0,_);for(let y=0;y<bt.length;y++)f[g[bt[y]]]=1;let ke=o;for(let y=_-1;y>=0;y--){let R=m[y];f[y]||R.nextSibling!==ke&&we.insertBefore(R,ke),ke=R}let Ce=a===i?s:i;Ce.length<_&&(Ce.length=_);for(let y=0;y<_;y++)Ce[y]=me[y];a=Ce,c=_;let di=l;l=d,d=di,L=!0},ui=S(mt);return v(r,ui),L||queueMicrotask(()=>{!L&&r.parentNode&&mt()}),r}function co(e){let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||t.appendChild(ao(r));else t.appendChild(ao(n));return t}function ao(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let t=e();return t instanceof Node?t:document.createTextNode(String(t??""))}return document.createTextNode(String(e))}function lo(e,t){let n=document.createComment("portal"),r=t||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){typeof console<"u"&&console.error("[Portal] Render error:",s);let a=s instanceof Error?s:new Error(String(s));queueMicrotask(()=>{try{let c=n.parentNode;c?.dispatchEvent&&c.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:a}}))}catch{}})}}),v(n,()=>{i=!0,o&&(M(o),o.remove(),o=null)}),n}var Xe=new Map;function uo(e,t){Xe.set(e,t)}function fo(e){Xe.delete(e)}function Ye(e){let t=Xe.get(e);return t?t():T({nodes:`[Component "${e}" not found]`})}function po(e){let t=T({class:"sibu-dynamic"});function n(){let o=e(),i;typeof o=="function"?i=o():i=Ye(o);for(let s of Array.from(t.childNodes))M(s);t.replaceChildren(i)}let r=S(n);return v(t,r),t}function mo(e,t="default"){return e?.[t]}function go(e,t){return S(()=>{t.style.display=e()?"":"none"}),t}function bo(e,t,n){let r=document.createComment("when"),o=null,i,s=!1,a=()=>{let c=e(),l=r.parentNode;if(!l||s&&c===i)return;i=c,o?.parentNode&&(M(o),o.parentNode.removeChild(o),o=null);let d=c?t():n?n():null;if(d!=null){let m=d instanceof Node?d:document.createTextNode(String(d));l.insertBefore(m,r.nextSibling),o=m}s=!0};return S(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function ho(e,t,n){let r=document.createComment("match"),o=null,i,s=!1,a=()=>{let c=String(e()),l=r.parentNode;if(!l||s&&c===i)return;i=c,o?.parentNode&&(M(o),o.parentNode.removeChild(o),o=null);let d=t[c]||n;if(d){let m=d();if(m!=null){let b=m instanceof Node?m:document.createTextNode(String(m));l.insertBefore(b,r.nextSibling),o=b}}s=!0};return S(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function yo(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&k()&&w("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,m=()=>{if(d)return;let f=e(),p=r.parentNode;if(!p||l&&f===a)return;c?.parentNode&&p.removeChild(c),a=f;let g=o.get(f);if(g){let h=i.indexOf(f);h!==-1&&(i.splice(h,1),i.push(f))}else{let h=t[f];if(!h){c=null,l=!0;return}if(g=h(),o.set(f,g),i.push(f),s>0&&i.length>s){let x=i.shift(),L=o.get(x);L&&(M(L),L.parentNode&&L.parentNode.removeChild(L),o.delete(x))}}p.insertBefore(g,r.nextSibling),c=g,l=!0},b=S(m);return l||queueMicrotask(()=>{!l&&r.parentNode&&m()}),v(r,()=>{d=!0,b();for(let f of o.values())M(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function xo(e,t,n){let r=t(e,n);typeof r=="function"&&v(e,r)}var vo=(e,t)=>{let n=r=>{e.contains(r.target)||t()};return document.addEventListener("pointerdown",n,!0),()=>document.removeEventListener("pointerdown",n,!0)},To=(e,t)=>{let n=t.duration??500,r=null,o=()=>{r=setTimeout(()=>{t.callback(),r=null},n)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},So=(e,t)=>{let n=()=>{let r=typeof t=="function"?t():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",n),()=>e.removeEventListener("click",n)},wo=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},Eo=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};var Q=null;function ko(e,t){try{let n=e();return n&&typeof n.then=="function"&&n.catch(r=>{t?t(r,"async"):Q?Q(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),n}catch(n){return t?t(n,"sync"):Q?Q(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Co(e,t){try{return await e()}catch(n){return t?t(n,"async"):Q?Q(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Ao(e){Q=e}var et=0;function _o(e="sibu"){return et++,`${e}-${et}`}function Lo(){et=0}var xe=0,tt=new Set;function P(e){xe++;try{return e()}finally{xe--,xe===0&&ji()}}function ae(e){return xe===0?!1:(tt.add(e),!0)}function No(){return xe>0}function ji(){try{for(let e of tt)kt(e)}finally{tt.clear()}Lt()}var Mo=globalThis,nt=k();function C(e,t){let n={value:e},r=nt?t?.name:void 0,o=t?.equals;r&&(n.__name=r);function i(){return ne(n),n.value}i.__signal=n,r&&(i.__name=r);function s(a){let c=typeof a=="function"?a(n.value):a;if(!(o?o(n.value,c):Object.is(c,n.value))){if(nt){let l=n.value;n.value=c;let d=Mo.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:n,name:r,oldValue:l,newValue:c})}else n.value=c;ae(n)||Me(n)}}if(nt){let a=Mo.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}var ce=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let e=Function("return typeof require==='function'?require:null")();if(e){let t=e("node:async_hooks");ce=new t.AsyncLocalStorage}}}catch{ce=null}var X={ssr:!1,suspenseIdCounter:0};function le(){if(ce){let e=ce.getStore();if(e)return e}return X}function ue(){return le().ssr}function Ro(){le().ssr=!0}function $o(){le().ssr=!1}function Ho(e){let t={ssr:!0,suspenseIdCounter:0};if(ce)return ce.run(t,e);let n=X.ssr,r=X.suspenseIdCounter;X.ssr=!0,X.suspenseIdCounter=0;try{return e()}finally{X.ssr=n,X.suspenseIdCounter=r}}function Oo(e){let t=le(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var ze=globalThis;function Do(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,W(()=>t(o,void 0));else{let i=n;n=o,W(()=>t(o,i))}}}function O(e,t){if($(typeof e=="function","effect: argument must be a function."),ue())return()=>{};let n=t?.onError,r=[],o=g=>{r.push(g)},i=()=>{if(r.length===0)return;let g=r;r=[];for(let h=g.length-1;h>=0;h--)try{g[h]()}catch(x){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw:",x)}},s=()=>e(o),a=n?()=>{try{s()}catch(g){n(g)}}:s,c=()=>{},l=!1,d=!1,m=100,b=()=>{if(l){d=!0;return}l=!0;try{let g=0;do if(d=!1,i(),c(),c=S(a,b),++g>m){ze.__SIBU_DEV_WARN__!==!1&&typeof console<"u"&&console.error(`[SibuJS] effect re-requested itself ${m}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),d=!1;break}while(d)}finally{l=!1,d=!1}};l=!0;try{let g=0;do if(d=!1,i(),c(),c=S(a,b),++g>m){ze.__SIBU_DEV_WARN__!==!1&&typeof console<"u"&&console.error(`[SibuJS] effect re-requested itself ${m}+ times on initial run \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),d=!1;break}while(d)}finally{l=!1,d=!1}let f=ze.__SIBU_DEVTOOLS_GLOBAL_HOOK__;f&&f.emit("effect:create",{effectFn:e});let p=!1;return()=>{if(p)return;p=!0;let g=ze.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(g)try{g.emit("effect:destroy",{effectFn:e})}catch{}try{i()}catch(h){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",h)}try{c()}catch(h){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",h)}}}function Fe(e,t){$(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r=t?.equals,o={};o._d=!1,o._g=e;let i=()=>{o._d||(o._d=!0)};i._c=1,i._sig=o,S(()=>{let l=!0;try{o._v=e(),o._d=!1,l=!1}finally{l&&(o._d=!0)}},i);let s=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,a=!1;function c(){if(a)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);if(Ne){if(o._d){a=!0;let l=!0;try{te(()=>{o._v=e(),o._d=!1,l=!1},i)}finally{a=!1,l&&(o._d=!0)}}return o._v}if(ne(o),o._d){let l=o._v;a=!0;let d=!0;try{te(()=>{let m=e();o._v=r&&o._v!==void 0&&r(o._v,m)?o._v:m,o._d=!1,d=!1},i)}finally{a=!1,d&&(o._d=!0)}s&&l!==o._v&&s.emit("computed:update",{signal:o,oldValue:l,newValue:o._v})}return o._v}return n&&(c.__name=n,o.__name=n),c.__signal=o,s&&s.emit("computed:create",{signal:o,name:n,getter:c}),c}function Po(e,t){if($(typeof e=="function","watch: first argument must be a getter function."),$(typeof t=="function","watch: second argument must be a callback function."),ue())return()=>{};let n,r=!0;return S(()=>{let s=e();if(r){n=s,r=!1;return}Object.is(s,n)||(t(s,n),n=s)})}function zo(e){$(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t={};Object.keys(e).forEach(c=>{let[l,d]=C(e[c]);t[c]=[l,d]});let n=new Proxy({},{get(c,l){if(l in t){let d=t[l][0];return d()}},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(t).forEach(l=>{c[l]=t[l][0]()}),c};return[n,{setState:c=>{let l=r(),d=typeof c=="function"?c(l):c;P(()=>{Object.entries(d).forEach(([m,b])=>{m in t&&t[m][1](b)})})},reset:()=>{P(()=>{Object.keys(e).forEach(c=>{let l=t[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return O(()=>{let d=r();if(l){l=!1;return}c(d)})},subscribeKey:(c,l)=>{let d,m=!0;return O(()=>{let b=t[c][0]();if(m){d=b,m=!1;return}if(!Object.is(b,d)){let f=d;d=b,l(b,f)}})},getSnapshot:r}]}function Fo(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function Bo(e=[]){let[t,n]=C([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return n(c=>{let l=[...c];return a=l.splice(o,i,...s),l}),a},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function Io(e=[]){let t=[...e],n=null,r={};function o(){n=null,ae(r)||Me(r)}function i(){if(ne(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,c=0,...l){let d=t.splice(a,c,...l);return(d.length>0||l.length>0)&&o(),d},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let c=t.findIndex(a);c!==-1&&(t.splice(c,1),o())},set(a){t=[...a],o()},update(a,c){a<0||a>=t.length||Object.is(t[a],c)||(t[a]=c,o())},updateWhere(a,c){let l=!1;for(let d=0;d<t.length;d++)if(a(t[d])){let m=c(t[d]);Object.is(t[d],m)||(t[d]=m,l=!0)}l&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let c=t.filter(a);c.length!==t.length&&(t=c,o())},map(a){let c=!1;for(let l=0;l<t.length;l++){let d=a(t[l],l);Object.is(t[l],d)||(t[l]=d,c=!0)}c&&o()},clear(){t.length!==0&&(t=[],o())}}]}function de(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let c=t;return e.source===c.source&&e.flags===c.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let c=t;if(e.size!==c.size)return!1;for(let[l,d]of e)if(!c.has(l)||!de(d,c.get(l),n))return!1;return!0}if(e instanceof Set){let c=t;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(t);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(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let c=e,l=t;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(t)||e.length!==t.length?!1:e.every((c,l)=>de(c,t[l],n));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(c=>de(r[c],o[c],n))}function jo(e){return C(e,{equals:(t,n)=>de(t,n)})}function qo(e,t,n){return[Fe(e,n),i=>{P(()=>t(i))}]}function Vo(e,t){let[n,r]=C(t),[o,i]=C(!1),[s,a]=C(null),[c,l]=C(0),d=0;return O(()=>{c();let m=++d;P(()=>{i(!0),a(null)});let b;try{b=e()}catch(f){P(()=>{a(f),i(!1)});return}b.then(f=>{m===d&&P(()=>{r(f),i(!1)})},f=>{m===d&&P(()=>{a(f),i(!1)})})}),{value:n,loading:o,error:s,refresh:()=>l(m=>m+1)}}function st(e,t){try{return e()}catch(n){w(`${t}: callback threw: ${n instanceof Error?n.message:String(n)}`);return}}function rt(e,t,n){let r=st(e,t);typeof r=="function"&&n&&v(n,r)}var fe=new WeakMap,Y=new WeakMap,V=new Set,K=new Set,pe=null,Be=0,qi=256;function ot(e){let t=fe.get(e);if(t){fe.delete(e),V.delete(e);for(let n of t)try{n()}catch{}}}function it(e){Y.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Y.get(e);if(n){Y.delete(e),K.delete(e);for(let r of n)try{r()}catch{}}})}function Vi(e){if(V.size===0||e.nodeType!==1)return;let t=e;if(V.has(t)&&t.isConnected&&ot(t),t.firstElementChild)for(let n of Array.from(V))n!==t&&n.isConnected&&t.contains(n)&&ot(n)}function Ki(e){if(K.size===0||e.nodeType!==1)return;let t=e;if(K.has(t)&&!t.isConnected&&it(t),t.firstElementChild)for(let n of Array.from(K))n!==t&&!n.isConnected&&t.contains(n)&&it(n)}function Ui(){if(V.size>0)for(let e of Array.from(V))e.isConnected&&ot(e);if(K.size>0)for(let e of Array.from(K))e.isConnected||it(e)}function Ko(){pe||typeof document>"u"||(pe=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)Vi(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)Ki(t.removedNodes[n])}Be+=e.length,Be>=qi&&(Be=0,Ui()),at()}),pe.observe(document.body,{childList:!0,subtree:!0}))}function at(){pe&&V.size===0&&K.size===0&&(pe.disconnect(),pe=null,Be=0)}function Wi(e,t){let n=fe.get(e);return n||(n=[],fe.set(e,n)),n.push(t),V.add(e),Ko(),()=>{let r=fe.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(fe.delete(e),V.delete(e))}at()}}function Ji(e,t){let n=Y.get(e);return n||(n=[],Y.set(e,n)),n.push(t),K.add(e),Ko(),()=>{let r=Y.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Y.delete(e),K.delete(e))}at()}}function ve(e,t){if(!(typeof document>"u"))if(t){let n=!1;if(v(t,()=>{n=!0}),t.isConnected){queueMicrotask(()=>{n||rt(e,"onMount",t)});return}queueMicrotask(()=>{if(n)return;if(t.isConnected){rt(e,"onMount",t);return}let r=Wi(t,()=>{n||rt(e,"onMount",t)});v(t,r)})}else queueMicrotask(()=>{st(e,"onMount")})}function Uo(e,t){if(typeof document>"u")return;let n=!1,r=()=>{n||(n=!0,st(e,"onUnmount"))};v(t,r);let o=()=>{if(n)return;let i=Ji(t,r);v(t,i)};t.isConnected?o():ve(()=>{o()},t)}function Wo(e,t){v(t,e)}function Jo(e){let[t,n]=C(e);return{provide(o){let i=t();return n(o),()=>n(i)},use(){return t},get(){return t()},set(o){n(o)},withContext(o,i){let s=t();n(o);try{return i()}finally{n(s)}}}}function Go(e){let t=e();return k()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function Zo(e){if(!k())return O(e);let t=O(e),n=null;return queueMicrotask(()=>{try{n=O(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Qo(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}function Yo(e){let[t,n]=C(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=S(()=>{i=e(),a()}),l=(()=>t());return l.dispose=()=>{o||(o=!0,c())},l}var Xo=16;function Gi(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:Xo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Xo)}function ei(){let[e,t]=C(!1);function n(r){t(!0),Gi(()=>{let o;try{o=r()}catch{t(!1);return}o&&typeof o.then=="function"?o.then(()=>t(!1),()=>t(!1)):t(!1)})}return{pending:e,start:n}}var ct="__sibuPendingError";function ti(e,t){let n=()=>{try{return e.parentNode?(e.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:t}})),!0):!1}catch{return!1}};e.parentNode&&n()||queueMicrotask(()=>{n()||(e[ct]=t)})}function Te(e){let t=e,n=t[ct];if(n instanceof Error)return delete t[ct],n}function lt(e){let t=null;return function(){if(t)return t();let r=T({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;t=i.default;let s=t();r.replaceChildren(s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));w(`[SibuJS] lazy() failed to load component: ${s.message}`),r.replaceChildren(T({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),ti(r,s)}),r.appendChild(A("sibu-lazy-loading","Loading...")),v(r,()=>{o=!0}),r}}function ut({nodes:e,fallback:t}){let n=T({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null;return v(n,()=>{o=!0,i&&(i.disconnect(),i=null)}),queueMicrotask(()=>{if(!o)try{let s=e();if(s.classList.contains("sibu-lazy")){if(!s.querySelector(".sibu-lazy-loading")){n.replaceChildren(s);return}i=new MutationObserver(()=>{if(o)return;s.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,n.replaceChildren(s))}),i.observe(s,{childList:!0,subtree:!0})}else n.replaceChildren(s)}catch(s){let a=s instanceof Error?s:new Error(String(s));w(`[SibuJS] Suspense nodes() threw: ${a.message}`),ti(n,a)}}),n}var pc=k();function dt(e){return e}var mc=1024*1024;var Zi=k(),Qi=`
|
|
3
3
|
.sibu-error-display {
|
|
4
4
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
5
5
|
border-radius: 10px;
|
|
@@ -84,20 +84,21 @@
|
|
|
84
84
|
font-weight: 600;
|
|
85
85
|
}
|
|
86
86
|
.sibu-error-display .sibu-err-copy-btn {
|
|
87
|
-
background:
|
|
88
|
-
border: 1px solid
|
|
87
|
+
background: rgba(0, 0, 0, 0.22);
|
|
88
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
89
89
|
border-radius: 4px;
|
|
90
|
-
color:
|
|
90
|
+
color: rgba(255, 255, 255, 0.85);
|
|
91
91
|
cursor: pointer;
|
|
92
92
|
padding: 2px 10px;
|
|
93
|
-
font-size: 0.
|
|
93
|
+
font-size: 0.78em;
|
|
94
94
|
font-family: inherit;
|
|
95
95
|
transition: all 0.12s ease;
|
|
96
|
+
flex-shrink: 0;
|
|
96
97
|
}
|
|
97
98
|
.sibu-error-display .sibu-err-copy-btn:hover {
|
|
98
|
-
background:
|
|
99
|
-
color:
|
|
100
|
-
border-color:
|
|
99
|
+
background: rgba(0, 0, 0, 0.35);
|
|
100
|
+
color: white;
|
|
101
|
+
border-color: rgba(255, 255, 255, 0.3);
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
.sibu-error-display .sibu-err-stack {
|
|
@@ -179,11 +180,11 @@
|
|
|
179
180
|
border: 1px solid #3a3a4e;
|
|
180
181
|
}
|
|
181
182
|
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
182
|
-
`,
|
|
183
|
-
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function
|
|
184
|
-
`).map(
|
|
185
|
-
`);
|
|
186
|
-
`)}function
|
|
183
|
+
`,ni=!1;function Xi(){if(ni||typeof document>"u")return;let e=J({nodes:Qi});document.head.appendChild(e),ni=!0}function Yi(e){let t=[],n=e.split(`
|
|
184
|
+
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function ri(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=Yi(r),i=e.cause,s=i!=null?ri(i):null;return{code:t,message:n,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function es(e,t,n){let r=[];r.push(n),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
|
|
185
|
+
`).map(s=>` ${s}`).join(`
|
|
186
|
+
`);r.push(i)}o=o.cause}if(t&&Object.keys(t).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(t))r.push(` ${i}: ${String(s)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
|
|
187
|
+
`)}function oi(e){let t=e.map((n,r)=>T({class:"sibu-err-frame",nodes:[A({class:"sibu-err-line",nodes:String(r+1)}),A({class:"sibu-err-fn",nodes:n.fn}),A({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return De({class:"sibu-err-stack",nodes:t})}function ii(e){return e?[T({class:"sibu-err-cause-label",nodes:"Caused by"}),T({class:"sibu-err-section",nodes:[T({class:"sibu-err-section-head",nodes:[A({nodes:`[${e.code}] ${e.message}`}),A({nodes:""})]}),e.frames.length>0?oi(e.frames):T({class:"sibu-err-stack",nodes:"(no stack)"})]}),...ii(e.cause)]:[]}function ts(e){let t=[];for(let[r,o]of Object.entries(e)){t.push(document.createElement("dt")),t[t.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),t.push(i)}let n=document.createElement("dl");n.className="sibu-err-meta";for(let r of t)n.appendChild(r);return n}function Ie(e){Xi();let t=e.severity??"error",n=ri(e.error),r=e.alwaysShowDetails??Zi,o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),c=se({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let f=es(n,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=T({class:"sibu-err-header",nodes:[Pe({class:"sibu-err-icon",nodes:n.code}),Oe({class:"sibu-err-title",nodes:o}),c,A({class:"sibu-err-timestamp",nodes:i})]}),d=[He({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&d.push(T({class:"sibu-err-section",nodes:[T({class:"sibu-err-section-head",nodes:[A({nodes:"Stack Trace"})]}),oi(n.frames)]})),r&&d.push(...ii(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(T({class:"sibu-err-section",nodes:[T({class:"sibu-err-section-head",nodes:[A({nodes:"Metadata"})]}),ts(e.metadata)]}));let m=[];e.onRetry&&m.push(se({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&m.push(se({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),m.length>0&&d.push(T({class:"sibu-err-actions",nodes:m}));let b=T({class:"sibu-err-body",nodes:d});return T({class:"sibu-error-display","data-severity":t,nodes:[l,b]})}var ns=`
|
|
187
188
|
.sibu-error-boundary {
|
|
188
189
|
position: relative;
|
|
189
190
|
}
|
|
@@ -337,7 +338,7 @@
|
|
|
337
338
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
338
339
|
background: #3a3a4e;
|
|
339
340
|
}
|
|
340
|
-
`,
|
|
341
|
+
`,si=!1;function rs(){if(!si&&typeof document<"u"){let e=J({nodes:ns});document.head.appendChild(e),si=!0}}var os=50,ft=new WeakMap;function is(e,t,n){let r=ft.get(e);r||(r=new Map,ft.set(e,r));let o=t.message,i=r.get(o);if(i)r.delete(o),r.set(o,i);else if(i=()=>e(t,n),r.set(o,i),r.size>os){let s=r.keys().next().value;s!==void 0&&r.delete(s)}return i()}function ai({nodes:e,fallback:t,onError:n,resetKeys:r}){rs();let[o,i]=C(null),s=()=>{if(t){let f=o(),p=ft.get(t);f&&p&&p.delete(f.message)}i(null)},a=null;if(r&&r.length>0){let f=!1;a=O(()=>{for(let p of r)try{p()}catch(g){typeof console<"u"&&console.warn("[SibuJS ErrorBoundary] resetKeys getter threw:",g)}if(!f){f=!0;return}o()!==null&&s()})}let c=f=>{let p=f instanceof Error?f:new Error(String(f));if(i(p),n)try{n(p)}catch(g){typeof console<"u"&&console.error("[SibuJS ErrorBoundary] onError callback threw:",g)}return p},l=(f,p)=>Ie({error:f,severity:"error",onRetry:p}),d=f=>{let p=t||l;try{return is(p,f,s)}catch(g){let h=g instanceof Error?g:new Error(String(g));return queueMicrotask(()=>{m.parentNode&&m.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:h}}))}),document.createComment("error-boundary-failed")}},m=T({class:"sibu-error-boundary",nodes:()=>{let f=o();if(f)return d(f);try{let p=e();if(p&&typeof p.then=="function"){let g=T({class:"sibu-error-async"});return g.appendChild(A({class:"sibu-lazy-loading",nodes:"Loading..."})),p.then(h=>{g.replaceChildren(h)}).catch(h=>{let x=c(h);g.replaceChildren(d(x))}),g}return p}catch(p){let g=c(p);return d(g)}}}),b=f=>{if(o())return;f.stopPropagation();let g=f.detail?.error;g&&c(g)};return m.addEventListener("sibu:error-propagate",b),ve(()=>{let f=document.createTreeWalker(m,NodeFilter.SHOW_ELEMENT),p=[],g=f.currentNode;for(;g;){let h=Te(g);h&&p.push(h),g=f.nextNode()}if(p.length===1)c(p[0]);else if(p.length>1){let h=globalThis.AggregateError;c(h?new h(p,`${p.length} pre-mount errors caught by ErrorBoundary`):new Error(p.map(x=>x.message).join("; ")))}},m),v(m,()=>{a&&a(),m.removeEventListener("sibu:error-propagate",b)}),m}var ss=`
|
|
341
342
|
@keyframes sibu-spin {
|
|
342
343
|
to { transform: rotate(360deg); }
|
|
343
344
|
}
|
|
@@ -390,4 +391,4 @@
|
|
|
390
391
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
391
392
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
392
393
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
393
|
-
`,
|
|
394
|
+
`,ci=!1;function as(){!ci&&typeof document<"u"&&(document.head.appendChild(J({nodes:ss})),ci=!0)}function li(e={}){as();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?T({class:`sibu-loading${o}`,nodes:[T({class:"sibu-loading-dots",nodes:[A({class:"sibu-loading-dot"}),A({class:"sibu-loading-dot"}),A({class:"sibu-loading-dot"})]}),t?A({class:"sibu-loading-text",nodes:t}):null].filter(Boolean)}):T({class:`sibu-loading${o}`,nodes:[T({class:"sibu-loading-spinner"}),t?A({class:"sibu-loading-text",nodes:t}):null].filter(Boolean)})}typeof window<"u"&&(window.Sibu=pt);return yi(cs);})();
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// src/core/ssr-context.ts
|
|
2
|
+
var als = null;
|
|
3
|
+
try {
|
|
4
|
+
if (typeof process !== "undefined" && process.versions && process.versions.node) {
|
|
5
|
+
const req = Function("return typeof require==='function'?require:null")();
|
|
6
|
+
if (req) {
|
|
7
|
+
const mod = req("node:async_hooks");
|
|
8
|
+
als = new mod.AsyncLocalStorage();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
} catch {
|
|
12
|
+
als = null;
|
|
13
|
+
}
|
|
14
|
+
var fallbackStore = { ssr: false, suspenseIdCounter: 0 };
|
|
15
|
+
function getSSRStore() {
|
|
16
|
+
if (als) {
|
|
17
|
+
const s = als.getStore();
|
|
18
|
+
if (s) return s;
|
|
19
|
+
}
|
|
20
|
+
return fallbackStore;
|
|
21
|
+
}
|
|
22
|
+
function isSSR() {
|
|
23
|
+
return getSSRStore().ssr;
|
|
24
|
+
}
|
|
25
|
+
function enableSSR() {
|
|
26
|
+
getSSRStore().ssr = true;
|
|
27
|
+
}
|
|
28
|
+
function disableSSR() {
|
|
29
|
+
getSSRStore().ssr = false;
|
|
30
|
+
}
|
|
31
|
+
function runInSSRContext(fn) {
|
|
32
|
+
const store = { ssr: true, suspenseIdCounter: 0 };
|
|
33
|
+
if (als) {
|
|
34
|
+
return als.run(store, fn);
|
|
35
|
+
}
|
|
36
|
+
const prevSSR = fallbackStore.ssr;
|
|
37
|
+
const prevCounter = fallbackStore.suspenseIdCounter;
|
|
38
|
+
fallbackStore.ssr = true;
|
|
39
|
+
fallbackStore.suspenseIdCounter = 0;
|
|
40
|
+
try {
|
|
41
|
+
return fn();
|
|
42
|
+
} finally {
|
|
43
|
+
fallbackStore.ssr = prevSSR;
|
|
44
|
+
fallbackStore.suspenseIdCounter = prevCounter;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function withSSR(fn) {
|
|
48
|
+
const store = getSSRStore();
|
|
49
|
+
const wasSSR = store.ssr;
|
|
50
|
+
store.ssr = true;
|
|
51
|
+
try {
|
|
52
|
+
return fn();
|
|
53
|
+
} finally {
|
|
54
|
+
if (!wasSSR) store.ssr = false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
getSSRStore,
|
|
60
|
+
isSSR,
|
|
61
|
+
enableSSR,
|
|
62
|
+
disableSSR,
|
|
63
|
+
runInSSRContext,
|
|
64
|
+
withSSR
|
|
65
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import {
|
|
2
|
+
devWarn,
|
|
3
|
+
isDev
|
|
4
|
+
} from "./chunk-LMLD24FC.js";
|
|
5
|
+
|
|
6
|
+
// src/core/rendering/dispose.ts
|
|
7
|
+
var elementDisposers = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
var _isDev = isDev();
|
|
9
|
+
var activeBindingCount = 0;
|
|
10
|
+
function registerDisposer(node, teardown) {
|
|
11
|
+
let disposers = elementDisposers.get(node);
|
|
12
|
+
if (!disposers) {
|
|
13
|
+
disposers = [];
|
|
14
|
+
elementDisposers.set(node, disposers);
|
|
15
|
+
}
|
|
16
|
+
disposers.push(teardown);
|
|
17
|
+
if (_isDev) activeBindingCount++;
|
|
18
|
+
}
|
|
19
|
+
function dispose(node) {
|
|
20
|
+
const stack = [node];
|
|
21
|
+
const order = [];
|
|
22
|
+
while (stack.length > 0) {
|
|
23
|
+
const current = stack.pop();
|
|
24
|
+
order.push(current);
|
|
25
|
+
const children = Array.from(current.childNodes);
|
|
26
|
+
for (let i = 0; i < children.length; i++) {
|
|
27
|
+
stack.push(children[i]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
for (let i = order.length - 1; i >= 0; i--) {
|
|
31
|
+
const current = order[i];
|
|
32
|
+
const disposers = elementDisposers.get(current);
|
|
33
|
+
if (disposers) {
|
|
34
|
+
const snapshot = disposers.slice();
|
|
35
|
+
elementDisposers.delete(current);
|
|
36
|
+
if (_isDev) activeBindingCount -= snapshot.length;
|
|
37
|
+
for (const d of snapshot) {
|
|
38
|
+
try {
|
|
39
|
+
d();
|
|
40
|
+
} catch (err) {
|
|
41
|
+
if (_isDev && typeof console !== "undefined") {
|
|
42
|
+
console.warn("[SibuJS] Disposer threw during cleanup:", err);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
let extraPasses = 0;
|
|
47
|
+
while (extraPasses++ < 8) {
|
|
48
|
+
const added = elementDisposers.get(current);
|
|
49
|
+
if (!added || added.length === 0) break;
|
|
50
|
+
const moreSnapshot = added.slice();
|
|
51
|
+
elementDisposers.delete(current);
|
|
52
|
+
if (_isDev) activeBindingCount -= moreSnapshot.length;
|
|
53
|
+
for (const d of moreSnapshot) {
|
|
54
|
+
try {
|
|
55
|
+
d();
|
|
56
|
+
} catch (err) {
|
|
57
|
+
if (_isDev && typeof console !== "undefined") {
|
|
58
|
+
console.warn("[SibuJS] Disposer threw during cleanup:", err);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function checkLeaks(warnThreshold = 0) {
|
|
67
|
+
if (!_isDev) return 0;
|
|
68
|
+
if (warnThreshold > 0 && activeBindingCount > warnThreshold) {
|
|
69
|
+
devWarn(
|
|
70
|
+
`checkLeaks: ${activeBindingCount} active DOM bindings detected. Expected \u2264${warnThreshold}. This may indicate a component was removed from the DOM without calling dispose().`
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
return activeBindingCount;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export {
|
|
77
|
+
registerDisposer,
|
|
78
|
+
dispose,
|
|
79
|
+
checkLeaks
|
|
80
|
+
};
|