sibujs 1.0.9 → 1.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 +1 -1
- package/dist/browser.js +4 -4
- package/dist/build.cjs +1 -1
- package/dist/build.js +10 -10
- package/dist/cdn.global.js +6 -6
- package/dist/chunk-23VV7YD3.js +107 -0
- package/dist/chunk-3ARAQO7B.js +398 -0
- package/dist/chunk-6SA3QQES.js +61 -0
- package/dist/chunk-7BF6TK55.js +1097 -0
- package/dist/chunk-BW3WT46K.js +937 -0
- package/dist/chunk-C6KFWOFV.js +616 -0
- package/dist/chunk-EVCZO745.js +365 -0
- package/dist/chunk-L6JRBDNS.js +60 -0
- package/dist/chunk-LA6KQEDU.js +712 -0
- package/dist/chunk-MK4ERFYL.js +2249 -0
- package/dist/chunk-NHUC2QWH.js +282 -0
- package/dist/chunk-RQGQSLQK.js +725 -0
- package/dist/chunk-TNQWPPE6.js +37 -0
- package/dist/chunk-UNXCEF6S.js +21 -0
- package/dist/chunk-V2XTI523.js +347 -0
- package/dist/chunk-WADYRCO2.js +304 -0
- package/dist/chunk-WILQZRO4.js +282 -0
- package/dist/chunk-WR5D4EGH.js +26 -0
- package/dist/chunk-WUHJISPP.js +298 -0
- package/dist/chunk-YUTWTI4B.js +654 -0
- package/dist/chunk-Z6POF5YC.js +975 -0
- package/dist/chunk-ZBJP6WFL.js +482 -0
- package/dist/data.cjs +1 -1
- package/dist/data.js +6 -6
- package/dist/devtools.cjs +1 -1
- package/dist/devtools.js +4 -4
- package/dist/ecosystem.cjs +1 -1
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +8 -2
- package/dist/extras.js +21 -21
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +24 -8
- package/dist/index.d.ts +24 -8
- package/dist/index.js +10 -10
- package/dist/motion.cjs +1 -1
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +8 -2
- package/dist/patterns.js +5 -5
- package/dist/performance.cjs +1 -1
- package/dist/performance.js +3 -3
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.js +9 -9
- package/dist/ssr-3RXHP5ES.js +38 -0
- package/dist/ssr.cjs +1 -1
- package/dist/ssr.d.cts +9 -0
- package/dist/ssr.d.ts +9 -0
- package/dist/ssr.js +8 -8
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +6 -6
- package/dist/widgets.cjs +1 -1
- package/dist/widgets.js +5 -5
- package/package.json +1 -1
package/dist/browser.cjs
CHANGED
|
@@ -40,7 +40,7 @@ module.exports = __toCommonJS(browser_exports);
|
|
|
40
40
|
|
|
41
41
|
// src/core/dev.ts
|
|
42
42
|
function isDev() {
|
|
43
|
-
return typeof globalThis.__SIBU_DEV__ !== "undefined" ? !!globalThis.__SIBU_DEV__ : typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ :
|
|
43
|
+
return typeof globalThis.__SIBU_DEV__ !== "undefined" ? !!globalThis.__SIBU_DEV__ : typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : typeof process !== "undefined" && process.env?.NODE_ENV !== "production";
|
|
44
44
|
}
|
|
45
45
|
var _isDev = isDev();
|
|
46
46
|
function devAssert(condition, message) {
|
package/dist/browser.js
CHANGED
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
resize,
|
|
15
15
|
scroll,
|
|
16
16
|
title
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-ZBJP6WFL.js";
|
|
18
|
+
import "./chunk-6SA3QQES.js";
|
|
19
19
|
import "./chunk-CHJ27IGK.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-V2XTI523.js";
|
|
21
|
+
import "./chunk-UNXCEF6S.js";
|
|
22
22
|
import "./chunk-MLKGABMK.js";
|
|
23
23
|
export {
|
|
24
24
|
battery,
|
package/dist/build.cjs
CHANGED
|
@@ -1256,7 +1256,7 @@ __export(index_exports, {
|
|
|
1256
1256
|
|
|
1257
1257
|
// src/core/dev.ts
|
|
1258
1258
|
function isDev() {
|
|
1259
|
-
return typeof globalThis.__SIBU_DEV__ !== "undefined" ? !!globalThis.__SIBU_DEV__ : typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ :
|
|
1259
|
+
return typeof globalThis.__SIBU_DEV__ !== "undefined" ? !!globalThis.__SIBU_DEV__ : typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : typeof process !== "undefined" && process.env?.NODE_ENV !== "production";
|
|
1260
1260
|
}
|
|
1261
1261
|
var _isDev = isDev();
|
|
1262
1262
|
function devAssert(condition, message) {
|
package/dist/build.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_exports
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-MK4ERFYL.js";
|
|
4
|
+
import "./chunk-NHUC2QWH.js";
|
|
5
|
+
import "./chunk-TNQWPPE6.js";
|
|
6
|
+
import "./chunk-WR5D4EGH.js";
|
|
7
|
+
import "./chunk-WADYRCO2.js";
|
|
8
|
+
import "./chunk-23VV7YD3.js";
|
|
9
|
+
import "./chunk-L6JRBDNS.js";
|
|
10
|
+
import "./chunk-6SA3QQES.js";
|
|
11
11
|
import "./chunk-CHJ27IGK.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-V2XTI523.js";
|
|
13
|
+
import "./chunk-UNXCEF6S.js";
|
|
14
14
|
import "./chunk-MLKGABMK.js";
|
|
15
15
|
|
|
16
16
|
// src/build/compileTemplates.ts
|
package/dist/cdn.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Sibu=(()=>{var Se=Object.defineProperty;var yo=Object.getOwnPropertyDescriptor;var vo=Object.getOwnPropertyNames;var To=Object.prototype.hasOwnProperty;var Ge=(t,e)=>{for(var r in e)Se(t,r,{get:e[r],enumerable:!0})},ko=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of vo(e))!To.call(t,o)&&o!==r&&Se(t,o,{get:()=>e[o],enumerable:!(n=yo(e,o))||n.enumerable});return t};var So=t=>ko(Se({},"__esModule",{value:!0}),t);var Uo={};Ge(Uo,{DynamicComponent:()=>Rr,ErrorBoundary:()=>fo,Fragment:()=>Ar,KeepAlive:()=>Kr,Loading:()=>go,Portal:()=>Lr,SVG_NS:()=>k,Suspense:()=>Pe,a:()=>_t,abbr:()=>Nt,action:()=>Fr,address:()=>dt,area:()=>en,array:()=>oo,article:()=>it,aside:()=>ut,audio:()=>tn,autoResize:()=>qr,b:()=>At,base:()=>Zn,batch:()=>Te,bdi:()=>Lt,bdo:()=>Mt,bindDynamic:()=>Ce,blockquote:()=>ht,body:()=>nt,br:()=>Ot,button:()=>K,canvas:()=>bn,caption:()=>Tn,catchError:()=>Ur,catchErrorAsync:()=>Ir,center:()=>yr,checkLeaks:()=>Ye,circle:()=>Yn,cite:()=>Rt,clickOutside:()=>Pr,clipPath:()=>ur,code:()=>Ht,col:()=>kn,colgroup:()=>Sn,context:()=>uo,copyOnClick:()=>Wr,customElement:()=>kr,data:()=>Dt,datalist:()=>Mn,dd:()=>xt,deepEqual:()=>ce,deepSignal:()=>so,defs:()=>lr,del:()=>yn,derived:()=>F,details:()=>$n,dfn:()=>Bt,dialog:()=>Un,disableSSR:()=>ze,dispose:()=>R,div:()=>x,dl:()=>yt,dt:()=>vt,each:()=>_r,effect:()=>ae,ellipse:()=>er,em:()=>zt,embed:()=>an,enableSSR:()=>Be,enqueueBatchedSignal:()=>X,fieldset:()=>On,figcaption:()=>Tt,figure:()=>kt,font:()=>vr,footer:()=>at,form:()=>Rn,g:()=>tr,getSlot:()=>Hr,h1:()=>pt,h2:()=>ft,h3:()=>ie,h4:()=>mt,h5:()=>gt,h6:()=>bt,head:()=>tt,header:()=>st,hr:()=>St,html:()=>Le,i:()=>Kt,iframe:()=>cn,img:()=>nn,input:()=>Hn,ins:()=>vn,isBatching:()=>Gr,isSSR:()=>Y,kbd:()=>Ft,label:()=>Dn,lazy:()=>Fe,legend:()=>Bn,li:()=>Et,line:()=>nr,linearGradient:()=>fr,link:()=>Jn,longPress:()=>jr,main:()=>lt,map:()=>rn,mark:()=>Pt,marker:()=>xr,marquee:()=>Tr,mask:()=>dr,match:()=>zr,math:()=>gn,memo:()=>no,memoFn:()=>ro,menu:()=>In,meta:()=>Xn,meter:()=>zn,mount:()=>wr,nav:()=>ct,noscript:()=>hn,object:()=>ln,ol:()=>wt,on:()=>Xr,onCleanup:()=>lo,onMount:()=>Ke,onUnmount:()=>co,optgroup:()=>Kn,option:()=>Fn,output:()=>Pn,p:()=>oe,param:()=>un,path:()=>rr,pattern:()=>pr,picture:()=>dn,polygon:()=>or,polyline:()=>ir,portal:()=>pn,pre:()=>ve,progress:()=>jn,q:()=>jt,radialGradient:()=>mr,reactiveArray:()=>io,rect:()=>sr,ref:()=>to,registerComponent:()=>Mr,registerDisposer:()=>w,resolveComponent:()=>Oe,rp:()=>Wt,rt:()=>qt,ruby:()=>$t,s:()=>Ut,samp:()=>It,script:()=>xn,section:()=>ot,select:()=>Wn,setGlobalErrorHandler:()=>Vr,show:()=>Dr,signal:()=>_,slot:()=>Gn,small:()=>Vt,source:()=>fn,span:()=>C,stop:()=>gr,store:()=>eo,strong:()=>Gt,style:()=>J,sub:()=>Qt,summary:()=>Vn,sup:()=>Zt,svg:()=>mn,symbol:()=>hr,table:()=>En,tagFactory:()=>a,tbody:()=>wn,td:()=>Cn,template:()=>Qn,text:()=>ar,textarea:()=>qn,tfoot:()=>_n,th:()=>Nn,thead:()=>An,time:()=>Jt,title:()=>rt,tr:()=>Ln,track:()=>on,trapFocus:()=>$r,tspan:()=>cr,u:()=>Xt,ul:()=>Ct,unregisterComponent:()=>Or,untracked:()=>Q,use:()=>br,var_:()=>Yt,video:()=>sn,watch:()=>Yr,when:()=>Br,withSSR:()=>Zr,writable:()=>ao});var We={};Ge(We,{DynamicComponent:()=>Rr,ErrorBoundary:()=>fo,Fragment:()=>Ar,KeepAlive:()=>Kr,Loading:()=>go,Portal:()=>Lr,SVG_NS:()=>k,Suspense:()=>Pe,a:()=>_t,abbr:()=>Nt,action:()=>Fr,address:()=>dt,area:()=>en,array:()=>oo,article:()=>it,aside:()=>ut,audio:()=>tn,autoResize:()=>qr,b:()=>At,base:()=>Zn,batch:()=>Te,bdi:()=>Lt,bdo:()=>Mt,bindDynamic:()=>Ce,blockquote:()=>ht,body:()=>nt,br:()=>Ot,button:()=>K,canvas:()=>bn,caption:()=>Tn,catchError:()=>Ur,catchErrorAsync:()=>Ir,center:()=>yr,checkLeaks:()=>Ye,circle:()=>Yn,cite:()=>Rt,clickOutside:()=>Pr,clipPath:()=>ur,code:()=>Ht,col:()=>kn,colgroup:()=>Sn,context:()=>uo,copyOnClick:()=>Wr,customElement:()=>kr,data:()=>Dt,datalist:()=>Mn,dd:()=>xt,deepEqual:()=>ce,deepSignal:()=>so,defs:()=>lr,del:()=>yn,derived:()=>F,details:()=>$n,dfn:()=>Bt,dialog:()=>Un,disableSSR:()=>ze,dispose:()=>R,div:()=>x,dl:()=>yt,dt:()=>vt,each:()=>_r,effect:()=>ae,ellipse:()=>er,em:()=>zt,embed:()=>an,enableSSR:()=>Be,enqueueBatchedSignal:()=>X,fieldset:()=>On,figcaption:()=>Tt,figure:()=>kt,font:()=>vr,footer:()=>at,form:()=>Rn,g:()=>tr,getSlot:()=>Hr,h1:()=>pt,h2:()=>ft,h3:()=>ie,h4:()=>mt,h5:()=>gt,h6:()=>bt,head:()=>tt,header:()=>st,hr:()=>St,html:()=>Le,i:()=>Kt,iframe:()=>cn,img:()=>nn,input:()=>Hn,ins:()=>vn,isBatching:()=>Gr,isSSR:()=>Y,kbd:()=>Ft,label:()=>Dn,lazy:()=>Fe,legend:()=>Bn,li:()=>Et,line:()=>nr,linearGradient:()=>fr,link:()=>Jn,longPress:()=>jr,main:()=>lt,map:()=>rn,mark:()=>Pt,marker:()=>xr,marquee:()=>Tr,mask:()=>dr,match:()=>zr,math:()=>gn,memo:()=>no,memoFn:()=>ro,menu:()=>In,meta:()=>Xn,meter:()=>zn,mount:()=>wr,nav:()=>ct,noscript:()=>hn,object:()=>ln,ol:()=>wt,on:()=>Xr,onCleanup:()=>lo,onMount:()=>Ke,onUnmount:()=>co,optgroup:()=>Kn,option:()=>Fn,output:()=>Pn,p:()=>oe,param:()=>un,path:()=>rr,pattern:()=>pr,picture:()=>dn,polygon:()=>or,polyline:()=>ir,portal:()=>pn,pre:()=>ve,progress:()=>jn,q:()=>jt,radialGradient:()=>mr,reactiveArray:()=>io,rect:()=>sr,ref:()=>to,registerComponent:()=>Mr,registerDisposer:()=>w,resolveComponent:()=>Oe,rp:()=>Wt,rt:()=>qt,ruby:()=>$t,s:()=>Ut,samp:()=>It,script:()=>xn,section:()=>ot,select:()=>Wn,setGlobalErrorHandler:()=>Vr,show:()=>Dr,signal:()=>_,slot:()=>Gn,small:()=>Vt,source:()=>fn,span:()=>C,stop:()=>gr,store:()=>eo,strong:()=>Gt,style:()=>J,sub:()=>Qt,summary:()=>Vn,sup:()=>Zt,svg:()=>mn,symbol:()=>hr,table:()=>En,tagFactory:()=>a,tbody:()=>wn,td:()=>Cn,template:()=>Qn,text:()=>ar,textarea:()=>qn,tfoot:()=>_n,th:()=>Nn,thead:()=>An,time:()=>Jt,title:()=>rt,tr:()=>Ln,track:()=>on,trapFocus:()=>$r,tspan:()=>cr,u:()=>Xt,ul:()=>Ct,unregisterComponent:()=>Or,untracked:()=>Q,use:()=>br,var_:()=>Yt,video:()=>sn,watch:()=>Yr,when:()=>Br,withSSR:()=>Zr,writable:()=>ao});function A(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:!0}var Qe=A();function L(t,e){if(Qe&&!t)throw new Error(`[Sibu] ${e}`)}function M(t){Qe&&console.warn(`[Sibu] ${t}`)}function j(t){let e=t.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!e)return"";let r=e.toLowerCase();return r.startsWith("javascript:")||r.startsWith("data:")||r.startsWith("vbscript:")||r.startsWith("blob:")?"":e}function Ee(t){let e=t.toLowerCase().replace(/\s+/g,"");return e.includes("url(")||e.includes("expression(")||e.includes("javascript:")||e.includes("-moz-binding")?"":t}var Eo=new Set(["href","src","action","formaction","cite","poster","background","srcset"]);function W(t){return Eo.has(t)}var wo=A(),V=new Array(32),G=32,H=-1,z=null,Co=new WeakMap,q="__s",B=0,E=[],O=new Set;function ne(t){try{t()}catch(e){wo&&M(`Subscriber threw during notification: ${e instanceof Error?e.message:String(e)}`)}}var ge=0,be=!1;function v(t,e){e||(e=t),Ze(e),++H,H>=G&&(G*=2,V.length=G),V[H]=e,z=e;try{t()}finally{H--,z=H>=0?V[H]:null}return()=>Ze(e)}function _o(){ge===0&&(++H,H>=G&&(G*=2,V.length=G),V[H]=null,z=null,be=!0),ge++}function No(){ge--,ge===0&&(H--,z=H>=0?V[H]:null,be=!1)}function Q(t){_o();try{return t()}finally{No()}}function Z(t){if(!z)return;let e=z;if(e._dep===t)return;let r=e._deps;if(r){if(r.has(t))return;r.add(t)}else if(e._dep!==void 0){let o=new Set;o.add(e._dep),o.add(t),e._deps=o,e._dep=void 0}else e._dep=t;let n=t[q];n||(n=new Set,Co.set(t,n),t[q]=n),n.add(z),n.size===1?t.__f=z:t.__f!==void 0&&(t.__f=void 0)}function Je(t){let e=t[q];if(e)for(let r of e)r._c?I(r):O.has(r)||(O.add(r),E.push(r))}function Xe(){if(!(B>0)){B++;try{let t=0;for(;t<E.length;)ne(E[t]),t++}finally{E.length=0,O.clear(),B--}}}function I(t){t();let e=t._sig;for(;e;){let r=e.__f;if(r){if(r._c){let i=r._sig;i._d=!0,e=i;continue}O.has(r)||(O.add(r),E.push(r));break}let n=e[q];if(!n)break;let o;for(let i of n)if(i._c){i();let s=i._sig;s&&!o?o=s:s&&I(i)}else O.has(i)||(O.add(i),E.push(i));e=o}}function he(t){let e=t.__f;if(e){if(B>0){e._c?I(e):O.has(e)||(O.add(e),E.push(e));return}B++;try{e._c?I(e):ne(e);let n=0;for(;n<E.length;)ne(E[n]),n++}finally{E.length=0,O.clear(),B--}return}let r=t[q];if(!(!r||r.size===0)){if(B>0){for(let n of r)n._c?I(n):O.has(n)||(O.add(n),E.push(n));return}B++;try{let n=0;for(let i of r)E[n++]=i;for(let i=0;i<n;i++)E[i]._c&&I(E[i]);for(let i=0;i<n;i++)E[i]._c||O.has(E[i])||ne(E[i]);let o=n;for(;o<E.length;)ne(E[o]),o++}finally{E.length=0,O.clear(),B--}}}function Ze(t){let e=t,r=e._dep;if(r!==void 0){let o=r[q];o&&(o.delete(t),r.__f===t&&(r.__f=void 0)),e._dep=void 0;return}let n=e._deps;if(!(!n||n.size===0)){for(let o of n){let i=o[q];i&&(i.delete(t),o.__f===t&&(o.__f=void 0))}n.clear()}}var we=A();function xe(t,e,r){function n(){let i;try{i=r()}catch(c){we&&M(`bindAttribute: getter for "${e}" threw: ${c instanceof Error?c.message:String(c)}`);return}if(typeof i=="boolean"){e in t&&(e==="checked"||e==="disabled"||e==="selected")?t[e]=i:i?t.setAttribute(e,""):t.removeAttribute(e);return}let s=String(i);(e==="value"||e==="checked")&&e in t?t[e]=e==="checked"?!!i:s:t.setAttribute(e,W(e)?j(s):s)}return v(n)}function Ce(t,e,r){let n=null;function o(){let s;try{s=typeof e=="function"?e():e}catch(u){we&&M(`bindDynamic: name getter threw: ${u instanceof Error?u.message:String(u)}`);return}let c;try{c=typeof r=="function"?r():r}catch(u){we&&M(`bindDynamic: value getter threw: ${u instanceof Error?u.message:String(u)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;n!==null&&n!==s&&t.removeAttribute(n);let l=String(c);(s==="value"||s==="checked")&&s in t?t[s]=s==="checked"?!!c:l:t.setAttribute(s,W(s)?j(l):l),n=s}let i=v(o);return()=>{i(),n!==null&&t.removeAttribute(n)}}var Ao=A();function $(t,e){let r=[];function n(){let o;try{o=e()}catch(l){Ao&&M(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}for(let l=0;l<r.length;l++){let u=r[l];u.parentNode&&u.parentNode.removeChild(u)}if(o==null||typeof o=="boolean"){r.length=0;return}let i=t.parentNode;if(!i){r.length=0;return}let s=t.nextSibling,c=0;if(Array.isArray(o)){r.length<o.length&&(r=new Array(o.length));for(let l=0;l<o.length;l++){let u=o[l];if(u==null||typeof u=="boolean")continue;let d=u instanceof Node?u:document.createTextNode(String(u));i.insertBefore(d,s),r[c++]=d}}else{r.length<1&&(r=[null]);let l=o instanceof Node?o:document.createTextNode(String(o));i.insertBefore(l,s),r[c++]=l}r.length=c}return v(n)}var ye=new WeakMap,_e=A(),re=0;function w(t,e){let r=ye.get(t);r||(r=[],ye.set(t,r)),r.push(e),_e&&re++}function R(t){let e=[t],r=[];for(;e.length>0;){let n=e.pop();r.push(n);let o=n.childNodes;for(let i=0;i<o.length;i++)e.push(o[i])}for(let n=r.length-1;n>=0;n--){let o=r[n],i=ye.get(o);if(i){_e&&(re-=i.length);for(let s of i)s();ye.delete(o)}}}function Ye(t=0){return _e?(t>0&&re>t&&M(`checkLeaks: ${re} active DOM bindings detected. Expected \u2264${t}. This may indicate a component was removed from the DOM without calling dispose().`),re):0}var k="http://www.w3.org/2000/svg",et=new Map;function Lo(t){let e=et.get(t);return e!==void 0||(e=t.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`),et.set(t,e)),e}function Mo(t,e){if(typeof e=="function"){let n=v(()=>{t.setAttribute("style",e())});w(t,n);return}if(typeof e=="string"){t.setAttribute("style",e);return}let r=t;for(let n in e){let o=e[n],i=Lo(n);if(typeof o=="function"){let s=o,c=v(()=>{r.style.setProperty(i,Ee(String(s())))});w(t,c)}else r.style.setProperty(i,Ee(String(o)))}}function Oo(t,e){if(typeof e=="string"){t.setAttribute("class",e);return}if(typeof e=="function"){let i=v(()=>{t.setAttribute("class",e())});w(t,i);return}let r=e,n=!1,o="";for(let i in r){let s=r[i];if(typeof s=="function"){n=!0;break}s&&(o=o?`${o} ${i}`:i)}if(n){let s=v(()=>{let c="";for(let l in r){let u=r[l];(typeof u=="function"?u():u)&&(c=c?`${c} ${l}`:l)}t.setAttribute("class",c)});w(t,s)}else t.setAttribute("class",o)}function Ne(t,e){if(typeof e=="string"){t.textContent=e;return}if(typeof e=="number"){t.textContent=String(e);return}if(!(typeof e=="boolean"||e==null)){if(typeof e=="function"){let r=document.createComment("");t.appendChild(r),w(t,$(r,e));return}if(e instanceof Node){t.appendChild(e);return}if(Array.isArray(e))for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="function"){let o=document.createComment("");t.appendChild(o),w(t,$(o,n))}else if(n instanceof Node)t.appendChild(n);else if(Array.isArray(n))for(let o=0;o<n.length;o++){let i=n[o];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),w(t,$(s,i))}else i instanceof Node?t.appendChild(i):i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)))}else n!=null&&typeof n!="boolean"&&t.appendChild(document.createTextNode(String(n)))}}}var a=(t,e)=>(r,n)=>{let o=e?document.createElementNS(e,t):document.createElement(t);if(r===void 0)return o;if(n===void 0&&typeof r=="string")return o.textContent=r,o;if(n!==void 0)return o.setAttribute("class",r),Ne(o,n),o;if(Array.isArray(r)||r instanceof Node)return Ne(o,r),o;let i=r,s=i.class;s!=null&&Oo(o,s);let c=i.id;c!=null&&(o.id=c);let l=i.nodes;l!=null&&Ne(o,l);let u=i.on;if(u)for(let m in u)o.addEventListener(m,u[m]);let d=i.style;d!=null&&Mo(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||p===!1||m[0]==="o"&&m[1]==="n")continue;if(typeof p=="function")w(o,xe(o,m,p));else if(p===!0)o.setAttribute(m,"");else{let g=String(p);o.setAttribute(m,W(m)?j(g):g)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var fi=a("html"),tt=a("head"),nt=a("body"),rt=a("title"),x=a("div"),C=a("span"),ot=a("section"),it=a("article"),st=a("header"),at=a("footer"),ct=a("nav"),lt=a("main"),ut=a("aside"),dt=a("address"),oe=a("p"),pt=a("h1"),ft=a("h2"),ie=a("h3"),mt=a("h4"),gt=a("h5"),bt=a("h6"),ht=a("blockquote"),xt=a("dd"),yt=a("dl"),vt=a("dt"),Tt=a("figcaption"),kt=a("figure"),St=a("hr"),Et=a("li"),wt=a("ol"),Ct=a("ul"),ve=a("pre"),_t=a("a"),Nt=a("abbr"),At=a("b"),Lt=a("bdi"),Mt=a("bdo"),Ot=a("br"),Rt=a("cite"),Ht=a("code"),Dt=a("data"),Bt=a("dfn"),zt=a("em"),Kt=a("i"),Ft=a("kbd"),Pt=a("mark"),jt=a("q"),Wt=a("rp"),qt=a("rt"),$t=a("ruby"),Ut=a("s"),It=a("samp"),Vt=a("small"),Gt=a("strong"),Qt=a("sub"),Zt=a("sup"),Jt=a("time"),Xt=a("u"),Yt=a("var"),en=a("area"),tn=a("audio"),nn=a("img"),rn=a("map"),on=a("track"),sn=a("video"),an=a("embed"),cn=a("iframe"),ln=a("object"),un=a("param"),dn=a("picture"),pn=a("portal"),fn=a("source"),mn=a("svg",k),gn=a("math"),bn=a("canvas"),hn=a("noscript"),xn=a("script"),yn=a("del"),vn=a("ins"),Tn=a("caption"),kn=a("col"),Sn=a("colgroup"),En=a("table"),wn=a("tbody"),Cn=a("td"),_n=a("tfoot"),Nn=a("th"),An=a("thead"),Ln=a("tr"),K=a("button"),Mn=a("datalist"),On=a("fieldset"),Rn=a("form"),Hn=a("input"),Dn=a("label"),Bn=a("legend"),zn=a("meter"),Kn=a("optgroup"),Fn=a("option"),Pn=a("output"),jn=a("progress"),Wn=a("select"),qn=a("textarea"),$n=a("details"),Un=a("dialog"),In=a("menu"),Vn=a("summary"),Gn=a("slot"),Qn=a("template"),Zn=a("base"),Jn=a("link"),Xn=a("meta"),J=a("style"),Yn=a("circle",k),er=a("ellipse",k),tr=a("g",k),nr=a("line",k),rr=a("path",k),or=a("polygon",k),ir=a("polyline",k),sr=a("rect",k),ar=a("text",k),cr=a("tspan",k),lr=a("defs",k),ur=a("clipPath",k),dr=a("mask",k),pr=a("pattern",k),fr=a("linearGradient",k),mr=a("radialGradient",k),gr=a("stop",k),br=a("use",k),hr=a("symbol",k),xr=a("marker",k),yr=a("center"),vr=a("font"),Tr=a("marquee"),kr=t=>a(t);var Ro=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Sr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Er=new WeakMap;function Ho(t){let e=t.length-1,r=t[0];for(let p=0;p<e;p++)r+=`\0${p}\0${t[p+1]}`;let n=0,o=r.length;function i(){for(;n<o&&(r[n]===" "||r[n]===" "||r[n]===`
|
|
2
|
-
`||r[n]==="\r");)n++}function s(){if(r.charCodeAt(n)!==0)return-1;let p=n;n++;let g=0;for(;n<o&&r.charCodeAt(n)!==0;)g=g*10+(r.charCodeAt(n)-48),n++;return n<o&&n++,g<0||g>=e?(n=p,-1):g}function c(){let p=n;for(;n<o;){let g=r.charCodeAt(n);if(g>=97&&g<=122||g>=65&&g<=90||g>=48&&g<=57||g===45)n++;else break}return r.slice(p,n)}function l(){if(i(),r[n]!=="=")return{kind:"bool"};n++,i();let p=s();if(p>=0)return{kind:"expr",idx:p};let g=r[n];if(g==='"'||g==="'"){n++;let h=[],D=[],P="";for(;n<o&&r[n]!==g;){let ue=s();ue>=0?(h.push(P),P="",D.push(ue)):P+=r[n++]}return n<o&&n++,h.push(P),D.length===0?{kind:"static",value:h[0]}:{kind:"mixed",statics:h,exprs:D}}let T=n;for(;n<o;){let h=r.charCodeAt(n);if(h===32||h===9||h===10||h===13||h===62||h===47)break;n++}return{kind:"static",value:r.slice(T,n)}}function u(){let p=[];for(;n<o&&(i(),!(r[n]===">"||r[n]==="/"));){let g=n;for(;n<o;){let h=r.charCodeAt(n);if(h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57||h===45||h===58||h===95||h===46)n++;else break}let T=r.slice(g,n);if(!T)break;let y=l();T.startsWith("on:")?y.kind==="expr"&&p.push({t:3,name:T.slice(3),idx:y.idx}):y.kind==="bool"?p.push({t:4,name:T}):y.kind==="static"?p.push({t:0,name:T,value:y.value}):y.kind==="expr"?p.push({t:1,name:T,idx:y.idx}):y.kind==="mixed"&&p.push({t:2,name:T,statics:y.statics,exprs:y.exprs})}return p}function d(p){return p.replace(/\s+/g," ")}function f(p){let g="";for(;n<o&&r[n]!=="<";){let y=s();if(y>=0){let h=d(g);h&&p.push({t:1,value:h}),g="",p.push({t:2,idx:y})}else g+=r[n++]}let T=d(g);T&&p.push({t:1,value:T})}function m(){let p=[];for(;n<o&&!(r[n]==="<"&&n+1<o&&r[n+1]==="/");)if(r[n]==="<"){n++;let g=c(),T=u();i();let y=Ro.has(g),h=r[n]==="/";if(h&&n++,n<o&&n++,y||h)p.push({t:0,el:{tag:g,svg:Sr.has(g),attrs:T,children:[]}});else{let D=m();r[n]==="<"&&n+1<o&&r[n+1]==="/"&&(n+=2,c(),i(),n<o&&r[n]===">"&&n++),p.push({t:0,el:{tag:g,svg:Sr.has(g),attrs:T,children:D}})}}else f(p);return p}return m()}function Ae(t,e){let r=t.svg?document.createElementNS(k,t.tag):document.createElement(t.tag);for(let n=0;n<t.attrs.length;n++){let o=t.attrs[n];switch(o.t){case 0:r.setAttribute(o.name,o.value);break;case 1:{let i=o.name;if(i[0]==="o"&&i[1]==="n")break;let s=e[o.idx];if(typeof s=="function")w(r,xe(r,i,s));else if(s!=null){let c=String(s);r.setAttribute(i,W(i)?j(c):c)}break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++)i+=String(e[o.exprs[s]])+o.statics[s+1];r.setAttribute(o.name,i);break}case 3:r.addEventListener(o.name,e[o.idx]);break;case 4:r.setAttribute(o.name,"");break}}for(let n=0;n<t.children.length;n++){let o=t.children[n];switch(o.t){case 0:r.appendChild(Ae(o.el,e));break;case 1:r.appendChild(document.createTextNode(o.value));break;case 2:{let i=e[o.idx];if(typeof i=="function"){let s=document.createComment("");r.appendChild(s),w(r,$(s,i))}else if(i instanceof Node)r.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let c=i[s];c instanceof Node?r.appendChild(c):c!=null&&typeof c!="boolean"&&r.appendChild(document.createTextNode(String(c)))}else i!=null&&typeof i!="boolean"&&r.appendChild(document.createTextNode(String(i)));break}}}return r}function Le(t,...e){let r=Er.get(t);if(r||(r=Ho(t),Er.set(t,r)),r.length===1&&r[0].t===0)return Ae(r[0].el,e);let n=document.createElement("div");for(let o=0;o<r.length;o++){let i=r[o];switch(i.t){case 0:n.appendChild(Ae(i.el,e));break;case 1:n.appendChild(document.createTextNode(i.value));break;case 2:{let s=e[i.idx];if(s instanceof Node)n.appendChild(s);else if(typeof s=="function"){let c=document.createComment("bind:htm");n.appendChild(c),w(n,$(c,s))}else if(Array.isArray(s))for(let c=0;c<s.length;c++){let l=s[c];l instanceof Node?n.appendChild(l):l!=null&&typeof l!="boolean"&&n.appendChild(document.createTextNode(String(l)))}else s!=null&&typeof s!="boolean"&&n.appendChild(document.createTextNode(String(s)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function wr(t,e){if(!e)throw new Error("[Sibu] mount: container element not found. Make sure the DOM element exists before calling mount().");L(typeof t=="function"||t instanceof Node,"mount: first argument must be a component function or a DOM Node.");let r=typeof performance<"u"?performance.now():0,n=typeof t=="function"?t():t,o=typeof performance<"u"?performance.now()-r:0;e.appendChild(n);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:n,container:e,duration:o}),{node:n,unmount(){i&&i.emit("app:unmount",{rootElement:n}),R(n),n.parentNode&&n.parentNode.removeChild(n)}}}var Do=A();function Cr(t){return typeof t=="function"?Cr(t()):t instanceof Node?t:document.createTextNode(String(t))}function Bo(t,e){if(e===0)return[];let r=[],n=new Array(e);for(let c=0;c<e;c++){let l=t[c],u=0,d=r.length;for(;u<d;){let f=u+d>>1;t[r[f]]<l?u=f+1:d=f}r[u]=c,n[c]=u>0?r[u-1]:-1}let o=r.length,i=new Array(o),s=r[o-1];for(let c=o-1;c>=0;c--)i[c]=s,s=n[s];return i}function _r(t,e,r){L(typeof t=="function","each: first argument must be a function that returns an array."),L(typeof e=="function","each: second argument must be a render function."),L(r&&typeof r.key=="function","each: options.key must be a function that returns a unique key per item.");let n=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],c=i,l=0,u=new Map,d=new Map,f=[],m=[],p=new Uint8Array(0),g=new Map,T=[],y=[],h=new Map,D=!1,P=!1,ue=r.key,qe=()=>{let $e=t(),S=$e.length,de=n.parentNode;if(!de)return;P||(de.insertBefore(o,n.nextSibling),P=!0),m.length<S&&(m=new Array(S));for(let b=0;b<S;b++)m[b]=ue($e[b]);let ee=m;f.length<S&&(f=new Array(S)),d.clear(),h.clear();for(let b=0;b<S;b++)h.set(ee[b],b);for(let b=0;b<S;b++){let N=ee[b],Ie=u.get(N),te;if(Ie!==void 0)te=Ie;else{let Ve=N,ho=()=>t()[h.get(Ve)],xo=()=>h.get(Ve);try{te=Cr(e(ho,xo))}catch(ke){Do&&M(`each: render threw for item at index ${b} (key="${ee[b]}"): ${ke instanceof Error?ke.message:String(ke)}`),te=document.createComment(`each:error:${b}`)}}d.set(N,te),f[b]=te}for(let[b,N]of u)d.has(b)||(R(N),N.parentNode&&de.removeChild(N));if(S===0){l=0;let b=u;u=d,d=b;return}g.clear();for(let b=0;b<l;b++)g.set(c[b],b);T.length<S&&(T=new Array(S),y=new Array(S));let pe=0;for(let b=0;b<S;b++){let N=g.get(ee[b]);N!==void 0&&(T[pe]=b,y[pe]=N,pe++)}let Ue=Bo(y,pe);p.length<S?p=new Uint8Array(S):p.fill(0,0,S);for(let b=0;b<Ue.length;b++)p[T[Ue[b]]]=1;let fe=o;for(let b=S-1;b>=0;b--){let N=f[b];p[b]||N.nextSibling!==fe&&de.insertBefore(N,fe),fe=N}let me=c===i?s:i;me.length<S&&(me.length=S);for(let b=0;b<S;b++)me[b]=ee[b];c=me,l=S;let bo=u;u=d,d=bo,D=!0};return v(qe),D||queueMicrotask(()=>{!D&&n.parentNode&&qe()}),n}function Ar(t){let e=document.createDocumentFragment();for(let r of t)if(!(r==null||typeof r=="boolean"))if(Array.isArray(r))for(let n of r)n==null||typeof n=="boolean"||e.appendChild(Nr(n));else e.appendChild(Nr(r));return e}function Nr(t){if(t==null)return document.createTextNode("");if(t instanceof Node)return t;if(typeof t=="function"){let e=t();return e instanceof Node?e:document.createTextNode(String(e??""))}return document.createTextNode(String(t))}function Lr(t,e){let r=document.createComment("portal"),n=e||document.body,o=null;queueMicrotask(()=>{try{o=t(),n.appendChild(o)}catch(s){console.error("[Portal] Render error:",s)}});let i=new MutationObserver(()=>{!r.isConnected&&o&&(o.remove(),o=null,i.disconnect())});return queueMicrotask(()=>{r.parentNode&&i.observe(r.parentNode,{childList:!0})}),r}var Me=new Map;function Mr(t,e){Me.set(t,e)}function Or(t){Me.delete(t)}function Oe(t){let e=Me.get(t);return e?e():x({nodes:`[Component "${t}" not found]`})}function Rr(t){let e=x({class:"sibu-dynamic"});function r(){let n=t(),o;typeof n=="function"?o=n():o=Oe(n);for(let i of Array.from(e.childNodes))R(i);e.replaceChildren(o)}return v(r),e}function Hr(t,e="default"){return t?.[e]}function Dr(t,e){return v(()=>{e.style.display=t()?"":"none"}),e}function Br(t,e,r){let n=document.createComment("when"),o=null,i,s=!1,c=()=>{let l=t(),u=n.parentNode;if(!u||s&&l===i)return;i=l,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=l?e():r?r():null;if(d!=null){let f=d instanceof Node?d:document.createTextNode(String(d));u.insertBefore(f,n.nextSibling),o=f}s=!0};return v(c),s||queueMicrotask(()=>{!s&&n.parentNode&&c()}),n}function zr(t,e,r){let n=document.createComment("match"),o=null,i,s=!1,c=()=>{let l=String(t()),u=n.parentNode;if(!u||s&&l===i)return;i=l,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=e[l]||r;if(d){let f=d();if(f!=null){let m=f instanceof Node?f:document.createTextNode(String(f));u.insertBefore(m,n.nextSibling),o=m}}s=!0};return v(c),s||queueMicrotask(()=>{!s&&n.parentNode&&c()}),n}function Kr(t,e,r){let n=document.createComment("keep-alive"),o=new Map,i=[],s=r?.max??0,c,l=null,u=!1,d=()=>{let f=t(),m=n.parentNode;if(!m||u&&f===c)return;l?.parentNode&&m.removeChild(l),c=f;let p=o.get(f);if(p){let g=i.indexOf(f);g!==-1&&(i.splice(g,1),i.push(f))}else{let g=e[f];if(!g){l=null,u=!0;return}if(p=g(),o.set(f,p),i.push(f),s>0&&i.length>s){let T=i.shift(),y=o.get(T);y&&(R(y),y.parentNode&&y.parentNode.removeChild(y),o.delete(T))}}m.insertBefore(p,n.nextSibling),l=p,u=!0};return v(d),u||queueMicrotask(()=>{!u&&n.parentNode&&d()}),n}function Fr(t,e,r){let n=e(t,r);typeof n=="function"&&w(t,n)}var Pr=(t,e)=>{let r=n=>{t.contains(n.target)||e()};return document.addEventListener("pointerdown",r,!0),()=>document.removeEventListener("pointerdown",r,!0)},jr=(t,e)=>{let r=e.duration??500,n=null,o=()=>{n=setTimeout(()=>{e.callback(),n=null},r)},i=()=>{n!==null&&(clearTimeout(n),n=null)};return t.addEventListener("pointerdown",o),t.addEventListener("pointerup",i),t.addEventListener("pointerleave",i),()=>{i(),t.removeEventListener("pointerdown",o),t.removeEventListener("pointerup",i),t.removeEventListener("pointerleave",i)}},Wr=(t,e)=>{let r=()=>{let n=typeof e=="function"?e():t.textContent??"";navigator.clipboard.writeText(n)};return t.addEventListener("click",r),()=>t.removeEventListener("click",r)},qr=t=>{let e=()=>{t.style.overflow="hidden",t.style.height="auto",t.style.height=`${t.scrollHeight}px`};return e(),t.addEventListener("input",e),()=>t.removeEventListener("input",e)},$r=t=>{let e='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',r=n=>{if(n.key!=="Tab")return;let o=Array.from(t.querySelectorAll(e));if(o.length===0)return;let i=o[0],s=o[o.length-1];n.shiftKey&&document.activeElement===i?(n.preventDefault(),s.focus()):!n.shiftKey&&document.activeElement===s&&(n.preventDefault(),i.focus())};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)};var U=null;function Ur(t,e){try{let r=t();return r&&typeof r.then=="function"&&r.catch(n=>{e?e(n,"async"):U?U(n,"async"):console.error("Unhandled async error in Sibu.catchError:",n)}),r}catch(r){return e?e(r,"sync"):U?U(r,"sync"):console.error("Unhandled error in Sibu.catchError:",r),null}}async function Ir(t,e){try{return await t()}catch(r){return e?e(r,"async"):U?U(r,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",r),null}}function Vr(t){U=t}var se=0,Re=new Set;function Te(t){se++;try{return t()}finally{se--,se===0&&zo()}}function X(t){return se===0?!1:(Re.add(t),!0)}function Gr(){return se>0}function zo(){for(let t of Re)Je(t);Re.clear(),Xe()}var Qr=globalThis,He=A();function _(t,e){let r={value:t},n=He?e?.name:void 0,o=e?.equals;n&&(r.__name=n);function i(){return Z(r),r.value}i.__signal=r,n&&(i.__name=n);function s(c){let l=typeof c=="function"?c(r.value):c;if(!(o?o(r.value,l):Object.is(l,r.value))){if(He){let u=r.value;r.value=l;let d=Qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:r,name:n,oldValue:u,newValue:l})}else r.value=l;X(r)||he(r)}}if(He){let c=Qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&c.emit("signal:create",{signal:r,name:n,getter:i,initial:t})}return[i,s]}var De=!1;function Y(){return De}function Be(){De=!0}function ze(){De=!1}function Zr(t){Be();try{return t()}finally{ze()}}var Jr=globalThis;function Xr(t,e){let r,n=!0;return()=>{let o=t();if(n)n=!1,r=o,Q(()=>e(o,void 0));else{let i=r;r=o,Q(()=>e(o,i))}}}function ae(t,e){if(L(typeof t=="function","effect: argument must be a function."),Y())return()=>{};let r=e?.onError,n=r?()=>{try{t()}catch(c){r(c)}}:t,o=()=>{},i=()=>{o(),o=v(n,i)};o=v(n,i);let s=Jr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return s&&s.emit("effect:create",{effectFn:t}),()=>{let c=Jr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&c.emit("effect:destroy",{effectFn:t}),o()}}function F(t,e){L(typeof t=="function","derived: argument must be a getter function.");let r=e?.name,n={};n._d=!1,n._g=t;let o=()=>{n._d||(n._d=!0)};o._c=1,o._sig=n,v(()=>{n._d=!1,n._v=t()},o);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;function s(){if(be)return n._d&&(n._d=!1,n._v=t()),n._v;if(Z(n),n._d){let c=n._v;v(()=>{n._d=!1,n._v=t()},o),i&&c!==n._v&&i.emit("computed:update",{signal:n,oldValue:c,newValue:n._v})}return n._v}return r&&(s.__name=r,n.__name=r),s.__signal=n,i&&i.emit("computed:create",{signal:n,name:r,getter:s}),s}function Yr(t,e){if(L(typeof t=="function","watch: first argument must be a getter function."),L(typeof e=="function","watch: second argument must be a callback function."),Y())return()=>{};let r,n=!0;return v(()=>{let s=t();if(n){r=s,n=!1;return}Object.is(s,r)||(e(s,r),r=s)})}function eo(t){L(t!==null&&typeof t=="object"&&!Array.isArray(t),"store: argument must be a plain object. For arrays, use array() instead.");let e={};Object.keys(t).forEach(l=>{let[u,d]=_(t[l]);e[l]=[u,d]});let r=new Proxy({},{get(l,u){if(u in e){let d=e[u][0];return d()}},set(){throw new Error("[Sibu] store: Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),n=()=>{let l={};return Object.keys(e).forEach(u=>{l[u]=e[u][0]()}),l};return[r,{setState:l=>{let u=n(),d=typeof l=="function"?l(u):l;Object.entries(d).forEach(([f,m])=>{f in e&&e[f][1](m)})},reset:()=>{Object.keys(t).forEach(l=>{let u=e[l][1];u(t[l])})},subscribe:l=>{let u=!0;return ae(()=>{let d=n();if(u){u=!1;return}l(d)})},subscribeKey:(l,u)=>{let d,f=!0;return ae(()=>{let m=e[l][0]();if(f){d=m,f=!1;return}if(!Object.is(m,d)){let p=d;d=m,u(m,p)}})},getSnapshot:n}]}function to(t){let[e,r]=_(t);return{get current(){return e()},set current(n){r(n)}}}function no(t){return F(t)}function ro(t){return F(t)}function oo(t=[]){let[e,r]=_([...t]);return[e,{push(...o){r(i=>[...i,...o])},pop(){let o;return r(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return r(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){r(i=>[...o,...i])},splice(o,i=0,...s){let c=[];return r(l=>{let u=[...l];return c=u.splice(o,i,...s),u}),c},remove(o){r(i=>i.filter((s,c)=>c!==o))},removeWhere(o){r(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((c,l)=>l!==s)})},set(o){r([...o])},update(o,i){r(s=>s.map((c,l)=>l===o?i:c))},updateWhere(o,i){r(s=>s.map(c=>o(c)?i(c):c))},sort(o){r(i=>[...i].sort(o))},reverse(){r(o=>[...o].reverse())},filter(o){r(i=>i.filter(o))},map(o){r(i=>i.map(o))},clear(){r([])}}]}function io(t=[]){let e=[...t],r=null,n={};function o(){r=null,X(n)||he(n)}function i(){return Z(n),r===null&&(r=Object.freeze([...e])),r}return[i,{push(...c){c.length!==0&&(e.push(...c),o())},pop(){if(e.length===0)return;let c=e.pop();return o(),c},shift(){if(e.length===0)return;let c=e.shift();return o(),c},unshift(...c){c.length!==0&&(e.unshift(...c),o())},splice(c,l=0,...u){let d=e.splice(c,l,...u);return(d.length>0||u.length>0)&&o(),d},remove(c){c<0||c>=e.length||(e.splice(c,1),o())},removeWhere(c){let l=e.findIndex(c);l!==-1&&(e.splice(l,1),o())},set(c){e=[...c],o()},update(c,l){c<0||c>=e.length||Object.is(e[c],l)||(e[c]=l,o())},updateWhere(c,l){let u=!1;for(let d=0;d<e.length;d++)if(c(e[d])){let f=l(e[d]);Object.is(e[d],f)||(e[d]=f,u=!0)}u&&o()},sort(c){e.length<=1||(e.sort(c),o())},reverse(){e.length<=1||(e.reverse(),o())},filter(c){let l=e.filter(c);l.length!==e.length&&(e=l,o())},map(c){let l=!1;for(let u=0;u<e.length;u++){let d=c(e[u],u);Object.is(e[u],d)||(e[u]=d,l=!0)}l&&o()},clear(){e.length!==0&&(e=[],o())}}]}function ce(t,e,r){if(Object.is(t,e))return!0;if(t==null||e==null||typeof t!=typeof e||typeof t!="object")return!1;if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(t instanceof RegExp&&e instanceof RegExp)return t.toString()===e.toString();if(r||(r=new Set),r.has(t))return!0;if(r.add(t),Array.isArray(t))return!Array.isArray(e)||t.length!==e.length?!1:t.every((i,s)=>ce(i,e[s],r));let n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(i=>ce(t[i],e[i],r))}function so(t){return _(t,{equals:(e,r)=>ce(e,r)})}function ao(t,e,r){return[F(t,r),i=>{Te(()=>e(i))}]}function le(t,e){try{t()}catch(r){M(`${e}: callback threw: ${r instanceof Error?r.message:String(r)}`)}}function Ke(t,e){if(!(typeof document>"u"))if(e){if(e.isConnected){queueMicrotask(()=>{le(t,"onMount")});return}let r=new MutationObserver(()=>{e.isConnected&&(r.disconnect(),le(t,"onMount"))});queueMicrotask(()=>{e.isConnected?le(t,"onMount"):r.observe(document.body,{childList:!0,subtree:!0})})}else queueMicrotask(()=>{le(t,"onMount")})}function co(t,e){let r=()=>{let n=new MutationObserver(()=>{e.isConnected||(n.disconnect(),le(t,"onUnmount"))});n.observe(document.body,{childList:!0,subtree:!0})};e.isConnected?r():Ke(()=>{r()},e)}function lo(t,e){w(e,t)}function uo(t){let[e,r]=_(t);return{provide(n){r(n)},use(){return e},get(){return e()},set(n){r(n)}}}function Fe(t){let e=null;return function(){if(e)return e();let[n,o]=_("loading"),[i,s]=_(null),c=x({class:"sibu-lazy"});return t().then(l=>{e=l.default;let u=e();c.replaceChildren(u),o("loaded")}).catch(l=>{let u=l instanceof Error?l:new Error(String(l));s(u),o("error"),c.replaceChildren(x({class:"sibu-lazy-error",nodes:`Failed to load component: ${u.message}`}))}),c.appendChild(C({class:"sibu-lazy-loading",nodes:"Loading..."})),c}}function Pe({nodes:t,fallback:e}){let r=x({class:"sibu-suspense"}),n=e();return r.appendChild(n),queueMicrotask(()=>{try{let o=t();if(o.classList.contains("sibu-lazy")){let i=new MutationObserver(()=>{o.querySelector(".sibu-lazy-loading")||(i.disconnect(),r.replaceChildren(o))});i.observe(o,{childList:!0,subtree:!0}),o.querySelector(".sibu-lazy-loading")||r.replaceChildren(o)}else r.replaceChildren(o)}catch{}}),r}var Ko=A(),Fo=`
|
|
1
|
+
"use strict";var Sibu=(()=>{var Se=Object.defineProperty;var yo=Object.getOwnPropertyDescriptor;var vo=Object.getOwnPropertyNames;var To=Object.prototype.hasOwnProperty;var Ge=(t,e)=>{for(var r in e)Se(t,r,{get:e[r],enumerable:!0})},ko=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of vo(e))!To.call(t,o)&&o!==r&&Se(t,o,{get:()=>e[o],enumerable:!(n=yo(e,o))||n.enumerable});return t};var So=t=>ko(Se({},"__esModule",{value:!0}),t);var Uo={};Ge(Uo,{DynamicComponent:()=>Rr,ErrorBoundary:()=>fo,Fragment:()=>Ar,KeepAlive:()=>Kr,Loading:()=>go,Portal:()=>Lr,SVG_NS:()=>k,Suspense:()=>Pe,a:()=>_t,abbr:()=>Nt,action:()=>Fr,address:()=>dt,area:()=>en,array:()=>oo,article:()=>it,aside:()=>ut,audio:()=>tn,autoResize:()=>Wr,b:()=>At,base:()=>Zn,batch:()=>Te,bdi:()=>Lt,bdo:()=>Mt,bindDynamic:()=>Ce,blockquote:()=>ht,body:()=>nt,br:()=>Ot,button:()=>K,canvas:()=>bn,caption:()=>Tn,catchError:()=>Ur,catchErrorAsync:()=>Ir,center:()=>yr,checkLeaks:()=>Ye,circle:()=>Yn,cite:()=>Rt,clickOutside:()=>Pr,clipPath:()=>ur,code:()=>Ht,col:()=>kn,colgroup:()=>Sn,context:()=>uo,copyOnClick:()=>qr,customElement:()=>kr,data:()=>Dt,datalist:()=>Mn,dd:()=>xt,deepEqual:()=>ce,deepSignal:()=>so,defs:()=>lr,del:()=>yn,derived:()=>F,details:()=>$n,dfn:()=>Bt,dialog:()=>Un,disableSSR:()=>ze,dispose:()=>R,div:()=>x,dl:()=>yt,dt:()=>vt,each:()=>_r,effect:()=>ae,ellipse:()=>er,em:()=>zt,embed:()=>an,enableSSR:()=>Be,enqueueBatchedSignal:()=>X,fieldset:()=>On,figcaption:()=>Tt,figure:()=>kt,font:()=>vr,footer:()=>at,form:()=>Rn,g:()=>tr,getSlot:()=>Hr,h1:()=>pt,h2:()=>ft,h3:()=>ie,h4:()=>mt,h5:()=>gt,h6:()=>bt,head:()=>tt,header:()=>st,hr:()=>St,html:()=>Le,i:()=>Kt,iframe:()=>cn,img:()=>nn,input:()=>Hn,ins:()=>vn,isBatching:()=>Gr,isSSR:()=>Y,kbd:()=>Ft,label:()=>Dn,lazy:()=>Fe,legend:()=>Bn,li:()=>Et,line:()=>nr,linearGradient:()=>fr,link:()=>Jn,longPress:()=>jr,main:()=>lt,map:()=>rn,mark:()=>Pt,marker:()=>xr,marquee:()=>Tr,mask:()=>dr,match:()=>zr,math:()=>gn,memo:()=>no,memoFn:()=>ro,menu:()=>In,meta:()=>Xn,meter:()=>zn,mount:()=>wr,nav:()=>ct,noscript:()=>hn,object:()=>ln,ol:()=>wt,on:()=>Xr,onCleanup:()=>lo,onMount:()=>Ke,onUnmount:()=>co,optgroup:()=>Kn,option:()=>Fn,output:()=>Pn,p:()=>oe,param:()=>un,path:()=>rr,pattern:()=>pr,picture:()=>dn,polygon:()=>or,polyline:()=>ir,portal:()=>pn,pre:()=>ve,progress:()=>jn,q:()=>jt,radialGradient:()=>mr,reactiveArray:()=>io,rect:()=>sr,ref:()=>to,registerComponent:()=>Mr,registerDisposer:()=>w,resolveComponent:()=>Oe,rp:()=>qt,rt:()=>Wt,ruby:()=>$t,s:()=>Ut,samp:()=>It,script:()=>xn,section:()=>ot,select:()=>qn,setGlobalErrorHandler:()=>Vr,show:()=>Dr,signal:()=>_,slot:()=>Gn,small:()=>Vt,source:()=>fn,span:()=>C,stop:()=>gr,store:()=>eo,strong:()=>Gt,style:()=>J,sub:()=>Qt,summary:()=>Vn,sup:()=>Zt,svg:()=>mn,symbol:()=>hr,table:()=>En,tagFactory:()=>a,tbody:()=>wn,td:()=>Cn,template:()=>Qn,text:()=>ar,textarea:()=>Wn,tfoot:()=>_n,th:()=>Nn,thead:()=>An,time:()=>Jt,title:()=>rt,tr:()=>Ln,track:()=>on,trapFocus:()=>$r,tspan:()=>cr,u:()=>Xt,ul:()=>Ct,unregisterComponent:()=>Or,untracked:()=>Q,use:()=>br,var_:()=>Yt,video:()=>sn,watch:()=>Yr,when:()=>Br,withSSR:()=>Zr,writable:()=>ao});var qe={};Ge(qe,{DynamicComponent:()=>Rr,ErrorBoundary:()=>fo,Fragment:()=>Ar,KeepAlive:()=>Kr,Loading:()=>go,Portal:()=>Lr,SVG_NS:()=>k,Suspense:()=>Pe,a:()=>_t,abbr:()=>Nt,action:()=>Fr,address:()=>dt,area:()=>en,array:()=>oo,article:()=>it,aside:()=>ut,audio:()=>tn,autoResize:()=>Wr,b:()=>At,base:()=>Zn,batch:()=>Te,bdi:()=>Lt,bdo:()=>Mt,bindDynamic:()=>Ce,blockquote:()=>ht,body:()=>nt,br:()=>Ot,button:()=>K,canvas:()=>bn,caption:()=>Tn,catchError:()=>Ur,catchErrorAsync:()=>Ir,center:()=>yr,checkLeaks:()=>Ye,circle:()=>Yn,cite:()=>Rt,clickOutside:()=>Pr,clipPath:()=>ur,code:()=>Ht,col:()=>kn,colgroup:()=>Sn,context:()=>uo,copyOnClick:()=>qr,customElement:()=>kr,data:()=>Dt,datalist:()=>Mn,dd:()=>xt,deepEqual:()=>ce,deepSignal:()=>so,defs:()=>lr,del:()=>yn,derived:()=>F,details:()=>$n,dfn:()=>Bt,dialog:()=>Un,disableSSR:()=>ze,dispose:()=>R,div:()=>x,dl:()=>yt,dt:()=>vt,each:()=>_r,effect:()=>ae,ellipse:()=>er,em:()=>zt,embed:()=>an,enableSSR:()=>Be,enqueueBatchedSignal:()=>X,fieldset:()=>On,figcaption:()=>Tt,figure:()=>kt,font:()=>vr,footer:()=>at,form:()=>Rn,g:()=>tr,getSlot:()=>Hr,h1:()=>pt,h2:()=>ft,h3:()=>ie,h4:()=>mt,h5:()=>gt,h6:()=>bt,head:()=>tt,header:()=>st,hr:()=>St,html:()=>Le,i:()=>Kt,iframe:()=>cn,img:()=>nn,input:()=>Hn,ins:()=>vn,isBatching:()=>Gr,isSSR:()=>Y,kbd:()=>Ft,label:()=>Dn,lazy:()=>Fe,legend:()=>Bn,li:()=>Et,line:()=>nr,linearGradient:()=>fr,link:()=>Jn,longPress:()=>jr,main:()=>lt,map:()=>rn,mark:()=>Pt,marker:()=>xr,marquee:()=>Tr,mask:()=>dr,match:()=>zr,math:()=>gn,memo:()=>no,memoFn:()=>ro,menu:()=>In,meta:()=>Xn,meter:()=>zn,mount:()=>wr,nav:()=>ct,noscript:()=>hn,object:()=>ln,ol:()=>wt,on:()=>Xr,onCleanup:()=>lo,onMount:()=>Ke,onUnmount:()=>co,optgroup:()=>Kn,option:()=>Fn,output:()=>Pn,p:()=>oe,param:()=>un,path:()=>rr,pattern:()=>pr,picture:()=>dn,polygon:()=>or,polyline:()=>ir,portal:()=>pn,pre:()=>ve,progress:()=>jn,q:()=>jt,radialGradient:()=>mr,reactiveArray:()=>io,rect:()=>sr,ref:()=>to,registerComponent:()=>Mr,registerDisposer:()=>w,resolveComponent:()=>Oe,rp:()=>qt,rt:()=>Wt,ruby:()=>$t,s:()=>Ut,samp:()=>It,script:()=>xn,section:()=>ot,select:()=>qn,setGlobalErrorHandler:()=>Vr,show:()=>Dr,signal:()=>_,slot:()=>Gn,small:()=>Vt,source:()=>fn,span:()=>C,stop:()=>gr,store:()=>eo,strong:()=>Gt,style:()=>J,sub:()=>Qt,summary:()=>Vn,sup:()=>Zt,svg:()=>mn,symbol:()=>hr,table:()=>En,tagFactory:()=>a,tbody:()=>wn,td:()=>Cn,template:()=>Qn,text:()=>ar,textarea:()=>Wn,tfoot:()=>_n,th:()=>Nn,thead:()=>An,time:()=>Jt,title:()=>rt,tr:()=>Ln,track:()=>on,trapFocus:()=>$r,tspan:()=>cr,u:()=>Xt,ul:()=>Ct,unregisterComponent:()=>Or,untracked:()=>Q,use:()=>br,var_:()=>Yt,video:()=>sn,watch:()=>Yr,when:()=>Br,withSSR:()=>Zr,writable:()=>ao});function A(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}var Qe=A();function L(t,e){if(Qe&&!t)throw new Error(`[Sibu] ${e}`)}function M(t){Qe&&console.warn(`[Sibu] ${t}`)}function j(t){let e=t.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!e)return"";let r=e.toLowerCase();return r.startsWith("javascript:")||r.startsWith("data:")||r.startsWith("vbscript:")||r.startsWith("blob:")?"":e}function Ee(t){let e=t.toLowerCase().replace(/\s+/g,"");return e.includes("url(")||e.includes("expression(")||e.includes("javascript:")||e.includes("-moz-binding")?"":t}var Eo=new Set(["href","src","action","formaction","cite","poster","background","srcset"]);function q(t){return Eo.has(t)}var wo=A(),V=new Array(32),G=32,H=-1,z=null,Co=new WeakMap,W="__s",B=0,E=[],O=new Set;function ne(t){try{t()}catch(e){wo&&M(`Subscriber threw during notification: ${e instanceof Error?e.message:String(e)}`)}}var ge=0,be=!1;function v(t,e){e||(e=t),Ze(e),++H,H>=G&&(G*=2,V.length=G),V[H]=e,z=e;try{t()}finally{H--,z=H>=0?V[H]:null}return()=>Ze(e)}function _o(){ge===0&&(++H,H>=G&&(G*=2,V.length=G),V[H]=null,z=null,be=!0),ge++}function No(){ge--,ge===0&&(H--,z=H>=0?V[H]:null,be=!1)}function Q(t){_o();try{return t()}finally{No()}}function Z(t){if(!z)return;let e=z;if(e._dep===t)return;let r=e._deps;if(r){if(r.has(t))return;r.add(t)}else if(e._dep!==void 0){let o=new Set;o.add(e._dep),o.add(t),e._deps=o,e._dep=void 0}else e._dep=t;let n=t[W];n||(n=new Set,Co.set(t,n),t[W]=n),n.add(z),n.size===1?t.__f=z:t.__f!==void 0&&(t.__f=void 0)}function Je(t){let e=t[W];if(e)for(let r of e)r._c?I(r):O.has(r)||(O.add(r),E.push(r))}function Xe(){if(!(B>0)){B++;try{let t=0;for(;t<E.length;)ne(E[t]),t++}finally{E.length=0,O.clear(),B--}}}function I(t){t();let e=t._sig;for(;e;){let r=e.__f;if(r){if(r._c){let i=r._sig;i._d=!0,e=i;continue}O.has(r)||(O.add(r),E.push(r));break}let n=e[W];if(!n)break;let o;for(let i of n)if(i._c){i();let s=i._sig;s&&!o?o=s:s&&I(i)}else O.has(i)||(O.add(i),E.push(i));e=o}}function he(t){let e=t.__f;if(e){if(B>0){e._c?I(e):O.has(e)||(O.add(e),E.push(e));return}B++;try{e._c?I(e):ne(e);let n=0;for(;n<E.length;)ne(E[n]),n++}finally{E.length=0,O.clear(),B--}return}let r=t[W];if(!(!r||r.size===0)){if(B>0){for(let n of r)n._c?I(n):O.has(n)||(O.add(n),E.push(n));return}B++;try{let n=0;for(let i of r)E[n++]=i;for(let i=0;i<n;i++)E[i]._c&&I(E[i]);for(let i=0;i<n;i++)E[i]._c||O.has(E[i])||ne(E[i]);let o=n;for(;o<E.length;)ne(E[o]),o++}finally{E.length=0,O.clear(),B--}}}function Ze(t){let e=t,r=e._dep;if(r!==void 0){let o=r[W];o&&(o.delete(t),r.__f===t&&(r.__f=void 0)),e._dep=void 0;return}let n=e._deps;if(!(!n||n.size===0)){for(let o of n){let i=o[W];i&&(i.delete(t),o.__f===t&&(o.__f=void 0))}n.clear()}}var we=A();function xe(t,e,r){function n(){let i;try{i=r()}catch(c){we&&M(`bindAttribute: getter for "${e}" threw: ${c instanceof Error?c.message:String(c)}`);return}if(typeof i=="boolean"){e in t&&(e==="checked"||e==="disabled"||e==="selected")?t[e]=i:i?t.setAttribute(e,""):t.removeAttribute(e);return}let s=String(i);(e==="value"||e==="checked")&&e in t?t[e]=e==="checked"?!!i:s:t.setAttribute(e,q(e)?j(s):s)}return v(n)}function Ce(t,e,r){let n=null;function o(){let s;try{s=typeof e=="function"?e():e}catch(u){we&&M(`bindDynamic: name getter threw: ${u instanceof Error?u.message:String(u)}`);return}let c;try{c=typeof r=="function"?r():r}catch(u){we&&M(`bindDynamic: value getter threw: ${u instanceof Error?u.message:String(u)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;n!==null&&n!==s&&t.removeAttribute(n);let l=String(c);(s==="value"||s==="checked")&&s in t?t[s]=s==="checked"?!!c:l:t.setAttribute(s,q(s)?j(l):l),n=s}let i=v(o);return()=>{i(),n!==null&&t.removeAttribute(n)}}var Ao=A();function $(t,e){let r=[];function n(){let o;try{o=e()}catch(l){Ao&&M(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}for(let l=0;l<r.length;l++){let u=r[l];u.parentNode&&u.parentNode.removeChild(u)}if(o==null||typeof o=="boolean"){r.length=0;return}let i=t.parentNode;if(!i){r.length=0;return}let s=t.nextSibling,c=0;if(Array.isArray(o)){r.length<o.length&&(r=new Array(o.length));for(let l=0;l<o.length;l++){let u=o[l];if(u==null||typeof u=="boolean")continue;let d=u instanceof Node?u:document.createTextNode(String(u));i.insertBefore(d,s),r[c++]=d}}else{r.length<1&&(r=[null]);let l=o instanceof Node?o:document.createTextNode(String(o));i.insertBefore(l,s),r[c++]=l}r.length=c}return v(n)}var ye=new WeakMap,_e=A(),re=0;function w(t,e){let r=ye.get(t);r||(r=[],ye.set(t,r)),r.push(e),_e&&re++}function R(t){let e=[t],r=[];for(;e.length>0;){let n=e.pop();r.push(n);let o=n.childNodes;for(let i=0;i<o.length;i++)e.push(o[i])}for(let n=r.length-1;n>=0;n--){let o=r[n],i=ye.get(o);if(i){_e&&(re-=i.length);for(let s of i)s();ye.delete(o)}}}function Ye(t=0){return _e?(t>0&&re>t&&M(`checkLeaks: ${re} active DOM bindings detected. Expected \u2264${t}. This may indicate a component was removed from the DOM without calling dispose().`),re):0}var k="http://www.w3.org/2000/svg",et=new Map;function Lo(t){let e=et.get(t);return e!==void 0||(e=t.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`),et.set(t,e)),e}function Mo(t,e){if(typeof e=="function"){let n=v(()=>{t.setAttribute("style",e())});w(t,n);return}if(typeof e=="string"){t.setAttribute("style",e);return}let r=t;for(let n in e){let o=e[n],i=Lo(n);if(typeof o=="function"){let s=o,c=v(()=>{r.style.setProperty(i,Ee(String(s())))});w(t,c)}else r.style.setProperty(i,Ee(String(o)))}}function Oo(t,e){if(typeof e=="string"){t.setAttribute("class",e);return}if(typeof e=="function"){let i=v(()=>{t.setAttribute("class",e())});w(t,i);return}let r=e,n=!1,o="";for(let i in r){let s=r[i];if(typeof s=="function"){n=!0;break}s&&(o=o?`${o} ${i}`:i)}if(n){let s=v(()=>{let c="";for(let l in r){let u=r[l];(typeof u=="function"?u():u)&&(c=c?`${c} ${l}`:l)}t.setAttribute("class",c)});w(t,s)}else t.setAttribute("class",o)}function Ne(t,e){if(typeof e=="string"){t.textContent=e;return}if(typeof e=="number"){t.textContent=String(e);return}if(!(typeof e=="boolean"||e==null)){if(typeof e=="function"){let r=document.createComment("");t.appendChild(r),w(t,$(r,e));return}if(e instanceof Node){t.appendChild(e);return}if(Array.isArray(e))for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="function"){let o=document.createComment("");t.appendChild(o),w(t,$(o,n))}else if(n instanceof Node)t.appendChild(n);else if(Array.isArray(n))for(let o=0;o<n.length;o++){let i=n[o];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),w(t,$(s,i))}else i instanceof Node?t.appendChild(i):i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)))}else n!=null&&typeof n!="boolean"&&t.appendChild(document.createTextNode(String(n)))}}}var a=(t,e)=>(r,n)=>{let o=e?document.createElementNS(e,t):document.createElement(t);if(r===void 0)return o;if(n===void 0&&typeof r=="string")return o.textContent=r,o;if(n!==void 0)return o.setAttribute("class",r),Ne(o,n),o;if(Array.isArray(r)||r instanceof Node)return Ne(o,r),o;let i=r,s=i.class;s!=null&&Oo(o,s);let c=i.id;c!=null&&(o.id=c);let l=i.nodes;l!=null&&Ne(o,l);let u=i.on;if(u)for(let m in u)o.addEventListener(m,u[m]);let d=i.style;d!=null&&Mo(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||p===!1||m[0]==="o"&&m[1]==="n")continue;if(typeof p=="function")w(o,xe(o,m,p));else if(p===!0)o.setAttribute(m,"");else{let g=String(p);o.setAttribute(m,q(m)?j(g):g)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var fi=a("html"),tt=a("head"),nt=a("body"),rt=a("title"),x=a("div"),C=a("span"),ot=a("section"),it=a("article"),st=a("header"),at=a("footer"),ct=a("nav"),lt=a("main"),ut=a("aside"),dt=a("address"),oe=a("p"),pt=a("h1"),ft=a("h2"),ie=a("h3"),mt=a("h4"),gt=a("h5"),bt=a("h6"),ht=a("blockquote"),xt=a("dd"),yt=a("dl"),vt=a("dt"),Tt=a("figcaption"),kt=a("figure"),St=a("hr"),Et=a("li"),wt=a("ol"),Ct=a("ul"),ve=a("pre"),_t=a("a"),Nt=a("abbr"),At=a("b"),Lt=a("bdi"),Mt=a("bdo"),Ot=a("br"),Rt=a("cite"),Ht=a("code"),Dt=a("data"),Bt=a("dfn"),zt=a("em"),Kt=a("i"),Ft=a("kbd"),Pt=a("mark"),jt=a("q"),qt=a("rp"),Wt=a("rt"),$t=a("ruby"),Ut=a("s"),It=a("samp"),Vt=a("small"),Gt=a("strong"),Qt=a("sub"),Zt=a("sup"),Jt=a("time"),Xt=a("u"),Yt=a("var"),en=a("area"),tn=a("audio"),nn=a("img"),rn=a("map"),on=a("track"),sn=a("video"),an=a("embed"),cn=a("iframe"),ln=a("object"),un=a("param"),dn=a("picture"),pn=a("portal"),fn=a("source"),mn=a("svg",k),gn=a("math"),bn=a("canvas"),hn=a("noscript"),xn=a("script"),yn=a("del"),vn=a("ins"),Tn=a("caption"),kn=a("col"),Sn=a("colgroup"),En=a("table"),wn=a("tbody"),Cn=a("td"),_n=a("tfoot"),Nn=a("th"),An=a("thead"),Ln=a("tr"),K=a("button"),Mn=a("datalist"),On=a("fieldset"),Rn=a("form"),Hn=a("input"),Dn=a("label"),Bn=a("legend"),zn=a("meter"),Kn=a("optgroup"),Fn=a("option"),Pn=a("output"),jn=a("progress"),qn=a("select"),Wn=a("textarea"),$n=a("details"),Un=a("dialog"),In=a("menu"),Vn=a("summary"),Gn=a("slot"),Qn=a("template"),Zn=a("base"),Jn=a("link"),Xn=a("meta"),J=a("style"),Yn=a("circle",k),er=a("ellipse",k),tr=a("g",k),nr=a("line",k),rr=a("path",k),or=a("polygon",k),ir=a("polyline",k),sr=a("rect",k),ar=a("text",k),cr=a("tspan",k),lr=a("defs",k),ur=a("clipPath",k),dr=a("mask",k),pr=a("pattern",k),fr=a("linearGradient",k),mr=a("radialGradient",k),gr=a("stop",k),br=a("use",k),hr=a("symbol",k),xr=a("marker",k),yr=a("center"),vr=a("font"),Tr=a("marquee"),kr=t=>a(t);var Ro=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Sr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Er=new WeakMap;function Ho(t){let e=t.length-1,r=t[0];for(let p=0;p<e;p++)r+=`\0${p}\0${t[p+1]}`;let n=0,o=r.length;function i(){for(;n<o&&(r[n]===" "||r[n]===" "||r[n]===`
|
|
2
|
+
`||r[n]==="\r");)n++}function s(){if(r.charCodeAt(n)!==0)return-1;let p=n;n++;let g=0;for(;n<o&&r.charCodeAt(n)!==0;)g=g*10+(r.charCodeAt(n)-48),n++;return n<o&&n++,g<0||g>=e?(n=p,-1):g}function c(){let p=n;for(;n<o;){let g=r.charCodeAt(n);if(g>=97&&g<=122||g>=65&&g<=90||g>=48&&g<=57||g===45)n++;else break}return r.slice(p,n)}function l(){if(i(),r[n]!=="=")return{kind:"bool"};n++,i();let p=s();if(p>=0)return{kind:"expr",idx:p};let g=r[n];if(g==='"'||g==="'"){n++;let h=[],D=[],P="";for(;n<o&&r[n]!==g;){let ue=s();ue>=0?(h.push(P),P="",D.push(ue)):P+=r[n++]}return n<o&&n++,h.push(P),D.length===0?{kind:"static",value:h[0]}:{kind:"mixed",statics:h,exprs:D}}let T=n;for(;n<o;){let h=r.charCodeAt(n);if(h===32||h===9||h===10||h===13||h===62||h===47)break;n++}return{kind:"static",value:r.slice(T,n)}}function u(){let p=[];for(;n<o&&(i(),!(r[n]===">"||r[n]==="/"));){let g=n;for(;n<o;){let h=r.charCodeAt(n);if(h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57||h===45||h===58||h===95||h===46)n++;else break}let T=r.slice(g,n);if(!T)break;let y=l();T.startsWith("on:")?y.kind==="expr"&&p.push({t:3,name:T.slice(3),idx:y.idx}):y.kind==="bool"?p.push({t:4,name:T}):y.kind==="static"?p.push({t:0,name:T,value:y.value}):y.kind==="expr"?p.push({t:1,name:T,idx:y.idx}):y.kind==="mixed"&&p.push({t:2,name:T,statics:y.statics,exprs:y.exprs})}return p}function d(p){return p.replace(/\s+/g," ")}function f(p){let g="";for(;n<o&&r[n]!=="<";){let y=s();if(y>=0){let h=d(g);h&&p.push({t:1,value:h}),g="",p.push({t:2,idx:y})}else g+=r[n++]}let T=d(g);T&&p.push({t:1,value:T})}function m(){let p=[];for(;n<o&&!(r[n]==="<"&&n+1<o&&r[n+1]==="/");)if(r[n]==="<"){n++;let g=c(),T=u();i();let y=Ro.has(g),h=r[n]==="/";if(h&&n++,n<o&&n++,y||h)p.push({t:0,el:{tag:g,svg:Sr.has(g),attrs:T,children:[]}});else{let D=m();r[n]==="<"&&n+1<o&&r[n+1]==="/"&&(n+=2,c(),i(),n<o&&r[n]===">"&&n++),p.push({t:0,el:{tag:g,svg:Sr.has(g),attrs:T,children:D}})}}else f(p);return p}return m()}function Ae(t,e){let r=t.svg?document.createElementNS(k,t.tag):document.createElement(t.tag);for(let n=0;n<t.attrs.length;n++){let o=t.attrs[n];switch(o.t){case 0:r.setAttribute(o.name,o.value);break;case 1:{let i=o.name;if(i[0]==="o"&&i[1]==="n")break;let s=e[o.idx];if(typeof s=="function")w(r,xe(r,i,s));else if(s!=null){let c=String(s);r.setAttribute(i,q(i)?j(c):c)}break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++)i+=String(e[o.exprs[s]])+o.statics[s+1];r.setAttribute(o.name,i);break}case 3:r.addEventListener(o.name,e[o.idx]);break;case 4:r.setAttribute(o.name,"");break}}for(let n=0;n<t.children.length;n++){let o=t.children[n];switch(o.t){case 0:r.appendChild(Ae(o.el,e));break;case 1:r.appendChild(document.createTextNode(o.value));break;case 2:{let i=e[o.idx];if(typeof i=="function"){let s=document.createComment("");r.appendChild(s),w(r,$(s,i))}else if(i instanceof Node)r.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let c=i[s];c instanceof Node?r.appendChild(c):c!=null&&typeof c!="boolean"&&r.appendChild(document.createTextNode(String(c)))}else i!=null&&typeof i!="boolean"&&r.appendChild(document.createTextNode(String(i)));break}}}return r}function Le(t,...e){let r=Er.get(t);if(r||(r=Ho(t),Er.set(t,r)),r.length===1&&r[0].t===0)return Ae(r[0].el,e);let n=document.createElement("div");for(let o=0;o<r.length;o++){let i=r[o];switch(i.t){case 0:n.appendChild(Ae(i.el,e));break;case 1:n.appendChild(document.createTextNode(i.value));break;case 2:{let s=e[i.idx];if(s instanceof Node)n.appendChild(s);else if(typeof s=="function"){let c=document.createComment("bind:htm");n.appendChild(c),w(n,$(c,s))}else if(Array.isArray(s))for(let c=0;c<s.length;c++){let l=s[c];l instanceof Node?n.appendChild(l):l!=null&&typeof l!="boolean"&&n.appendChild(document.createTextNode(String(l)))}else s!=null&&typeof s!="boolean"&&n.appendChild(document.createTextNode(String(s)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function wr(t,e){if(!e)throw new Error("[Sibu] mount: container element not found. Make sure the DOM element exists before calling mount().");L(typeof t=="function"||t instanceof Node,"mount: first argument must be a component function or a DOM Node.");let r=typeof performance<"u"?performance.now():0,n=typeof t=="function"?t():t,o=typeof performance<"u"?performance.now()-r:0;e.appendChild(n);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:n,container:e,duration:o}),{node:n,unmount(){i&&i.emit("app:unmount",{rootElement:n}),R(n),n.parentNode&&n.parentNode.removeChild(n)}}}var Do=A();function Cr(t){return typeof t=="function"?Cr(t()):t instanceof Node?t:document.createTextNode(String(t))}function Bo(t,e){if(e===0)return[];let r=[],n=new Array(e);for(let c=0;c<e;c++){let l=t[c],u=0,d=r.length;for(;u<d;){let f=u+d>>1;t[r[f]]<l?u=f+1:d=f}r[u]=c,n[c]=u>0?r[u-1]:-1}let o=r.length,i=new Array(o),s=r[o-1];for(let c=o-1;c>=0;c--)i[c]=s,s=n[s];return i}function _r(t,e,r){L(typeof t=="function","each: first argument must be a function that returns an array."),L(typeof e=="function","each: second argument must be a render function."),L(r&&typeof r.key=="function","each: options.key must be a function that returns a unique key per item.");let n=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],c=i,l=0,u=new Map,d=new Map,f=[],m=[],p=new Uint8Array(0),g=new Map,T=[],y=[],h=new Map,D=!1,P=!1,ue=r.key,We=()=>{let $e=t(),S=$e.length,de=n.parentNode;if(!de)return;P||(de.insertBefore(o,n.nextSibling),P=!0),m.length<S&&(m=new Array(S));for(let b=0;b<S;b++)m[b]=ue($e[b]);let ee=m;f.length<S&&(f=new Array(S)),d.clear(),h.clear();for(let b=0;b<S;b++)h.set(ee[b],b);for(let b=0;b<S;b++){let N=ee[b],Ie=u.get(N),te;if(Ie!==void 0)te=Ie;else{let Ve=N,ho=()=>t()[h.get(Ve)],xo=()=>h.get(Ve);try{te=Cr(e(ho,xo))}catch(ke){Do&&M(`each: render threw for item at index ${b} (key="${ee[b]}"): ${ke instanceof Error?ke.message:String(ke)}`),te=document.createComment(`each:error:${b}`)}}d.set(N,te),f[b]=te}for(let[b,N]of u)d.has(b)||(R(N),N.parentNode&&de.removeChild(N));if(S===0){l=0;let b=u;u=d,d=b;return}g.clear();for(let b=0;b<l;b++)g.set(c[b],b);T.length<S&&(T=new Array(S),y=new Array(S));let pe=0;for(let b=0;b<S;b++){let N=g.get(ee[b]);N!==void 0&&(T[pe]=b,y[pe]=N,pe++)}let Ue=Bo(y,pe);p.length<S?p=new Uint8Array(S):p.fill(0,0,S);for(let b=0;b<Ue.length;b++)p[T[Ue[b]]]=1;let fe=o;for(let b=S-1;b>=0;b--){let N=f[b];p[b]||N.nextSibling!==fe&&de.insertBefore(N,fe),fe=N}let me=c===i?s:i;me.length<S&&(me.length=S);for(let b=0;b<S;b++)me[b]=ee[b];c=me,l=S;let bo=u;u=d,d=bo,D=!0};return v(We),D||queueMicrotask(()=>{!D&&n.parentNode&&We()}),n}function Ar(t){let e=document.createDocumentFragment();for(let r of t)if(!(r==null||typeof r=="boolean"))if(Array.isArray(r))for(let n of r)n==null||typeof n=="boolean"||e.appendChild(Nr(n));else e.appendChild(Nr(r));return e}function Nr(t){if(t==null)return document.createTextNode("");if(t instanceof Node)return t;if(typeof t=="function"){let e=t();return e instanceof Node?e:document.createTextNode(String(e??""))}return document.createTextNode(String(t))}function Lr(t,e){let r=document.createComment("portal"),n=e||document.body,o=null;queueMicrotask(()=>{try{o=t(),n.appendChild(o)}catch(s){console.error("[Portal] Render error:",s)}});let i=new MutationObserver(()=>{!r.isConnected&&o&&(o.remove(),o=null,i.disconnect())});return queueMicrotask(()=>{r.parentNode&&i.observe(r.parentNode,{childList:!0})}),r}var Me=new Map;function Mr(t,e){Me.set(t,e)}function Or(t){Me.delete(t)}function Oe(t){let e=Me.get(t);return e?e():x({nodes:`[Component "${t}" not found]`})}function Rr(t){let e=x({class:"sibu-dynamic"});function r(){let n=t(),o;typeof n=="function"?o=n():o=Oe(n);for(let i of Array.from(e.childNodes))R(i);e.replaceChildren(o)}return v(r),e}function Hr(t,e="default"){return t?.[e]}function Dr(t,e){return v(()=>{e.style.display=t()?"":"none"}),e}function Br(t,e,r){let n=document.createComment("when"),o=null,i,s=!1,c=()=>{let l=t(),u=n.parentNode;if(!u||s&&l===i)return;i=l,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=l?e():r?r():null;if(d!=null){let f=d instanceof Node?d:document.createTextNode(String(d));u.insertBefore(f,n.nextSibling),o=f}s=!0};return v(c),s||queueMicrotask(()=>{!s&&n.parentNode&&c()}),n}function zr(t,e,r){let n=document.createComment("match"),o=null,i,s=!1,c=()=>{let l=String(t()),u=n.parentNode;if(!u||s&&l===i)return;i=l,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=e[l]||r;if(d){let f=d();if(f!=null){let m=f instanceof Node?f:document.createTextNode(String(f));u.insertBefore(m,n.nextSibling),o=m}}s=!0};return v(c),s||queueMicrotask(()=>{!s&&n.parentNode&&c()}),n}function Kr(t,e,r){let n=document.createComment("keep-alive"),o=new Map,i=[],s=r?.max??0,c,l=null,u=!1,d=()=>{let f=t(),m=n.parentNode;if(!m||u&&f===c)return;l?.parentNode&&m.removeChild(l),c=f;let p=o.get(f);if(p){let g=i.indexOf(f);g!==-1&&(i.splice(g,1),i.push(f))}else{let g=e[f];if(!g){l=null,u=!0;return}if(p=g(),o.set(f,p),i.push(f),s>0&&i.length>s){let T=i.shift(),y=o.get(T);y&&(R(y),y.parentNode&&y.parentNode.removeChild(y),o.delete(T))}}m.insertBefore(p,n.nextSibling),l=p,u=!0};return v(d),u||queueMicrotask(()=>{!u&&n.parentNode&&d()}),n}function Fr(t,e,r){let n=e(t,r);typeof n=="function"&&w(t,n)}var Pr=(t,e)=>{let r=n=>{t.contains(n.target)||e()};return document.addEventListener("pointerdown",r,!0),()=>document.removeEventListener("pointerdown",r,!0)},jr=(t,e)=>{let r=e.duration??500,n=null,o=()=>{n=setTimeout(()=>{e.callback(),n=null},r)},i=()=>{n!==null&&(clearTimeout(n),n=null)};return t.addEventListener("pointerdown",o),t.addEventListener("pointerup",i),t.addEventListener("pointerleave",i),()=>{i(),t.removeEventListener("pointerdown",o),t.removeEventListener("pointerup",i),t.removeEventListener("pointerleave",i)}},qr=(t,e)=>{let r=()=>{let n=typeof e=="function"?e():t.textContent??"";navigator.clipboard.writeText(n)};return t.addEventListener("click",r),()=>t.removeEventListener("click",r)},Wr=t=>{let e=()=>{t.style.overflow="hidden",t.style.height="auto",t.style.height=`${t.scrollHeight}px`};return e(),t.addEventListener("input",e),()=>t.removeEventListener("input",e)},$r=t=>{let e='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',r=n=>{if(n.key!=="Tab")return;let o=Array.from(t.querySelectorAll(e));if(o.length===0)return;let i=o[0],s=o[o.length-1];n.shiftKey&&document.activeElement===i?(n.preventDefault(),s.focus()):!n.shiftKey&&document.activeElement===s&&(n.preventDefault(),i.focus())};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)};var U=null;function Ur(t,e){try{let r=t();return r&&typeof r.then=="function"&&r.catch(n=>{e?e(n,"async"):U?U(n,"async"):console.error("Unhandled async error in Sibu.catchError:",n)}),r}catch(r){return e?e(r,"sync"):U?U(r,"sync"):console.error("Unhandled error in Sibu.catchError:",r),null}}async function Ir(t,e){try{return await t()}catch(r){return e?e(r,"async"):U?U(r,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",r),null}}function Vr(t){U=t}var se=0,Re=new Set;function Te(t){se++;try{return t()}finally{se--,se===0&&zo()}}function X(t){return se===0?!1:(Re.add(t),!0)}function Gr(){return se>0}function zo(){for(let t of Re)Je(t);Re.clear(),Xe()}var Qr=globalThis,He=A();function _(t,e){let r={value:t},n=He?e?.name:void 0,o=e?.equals;n&&(r.__name=n);function i(){return Z(r),r.value}i.__signal=r,n&&(i.__name=n);function s(c){let l=typeof c=="function"?c(r.value):c;if(!(o?o(r.value,l):Object.is(l,r.value))){if(He){let u=r.value;r.value=l;let d=Qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:r,name:n,oldValue:u,newValue:l})}else r.value=l;X(r)||he(r)}}if(He){let c=Qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&c.emit("signal:create",{signal:r,name:n,getter:i,initial:t})}return[i,s]}var De=!1;function Y(){return De}function Be(){De=!0}function ze(){De=!1}function Zr(t){Be();try{return t()}finally{ze()}}var Jr=globalThis;function Xr(t,e){let r,n=!0;return()=>{let o=t();if(n)n=!1,r=o,Q(()=>e(o,void 0));else{let i=r;r=o,Q(()=>e(o,i))}}}function ae(t,e){if(L(typeof t=="function","effect: argument must be a function."),Y())return()=>{};let r=e?.onError,n=r?()=>{try{t()}catch(c){r(c)}}:t,o=()=>{},i=()=>{o(),o=v(n,i)};o=v(n,i);let s=Jr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return s&&s.emit("effect:create",{effectFn:t}),()=>{let c=Jr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&c.emit("effect:destroy",{effectFn:t}),o()}}function F(t,e){L(typeof t=="function","derived: argument must be a getter function.");let r=e?.name,n={};n._d=!1,n._g=t;let o=()=>{n._d||(n._d=!0)};o._c=1,o._sig=n,v(()=>{n._d=!1,n._v=t()},o);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;function s(){if(be)return n._d&&(n._d=!1,n._v=t()),n._v;if(Z(n),n._d){let c=n._v;v(()=>{n._d=!1,n._v=t()},o),i&&c!==n._v&&i.emit("computed:update",{signal:n,oldValue:c,newValue:n._v})}return n._v}return r&&(s.__name=r,n.__name=r),s.__signal=n,i&&i.emit("computed:create",{signal:n,name:r,getter:s}),s}function Yr(t,e){if(L(typeof t=="function","watch: first argument must be a getter function."),L(typeof e=="function","watch: second argument must be a callback function."),Y())return()=>{};let r,n=!0;return v(()=>{let s=t();if(n){r=s,n=!1;return}Object.is(s,r)||(e(s,r),r=s)})}function eo(t){L(t!==null&&typeof t=="object"&&!Array.isArray(t),"store: argument must be a plain object. For arrays, use array() instead.");let e={};Object.keys(t).forEach(l=>{let[u,d]=_(t[l]);e[l]=[u,d]});let r=new Proxy({},{get(l,u){if(u in e){let d=e[u][0];return d()}},set(){throw new Error("[Sibu] store: Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),n=()=>{let l={};return Object.keys(e).forEach(u=>{l[u]=e[u][0]()}),l};return[r,{setState:l=>{let u=n(),d=typeof l=="function"?l(u):l;Object.entries(d).forEach(([f,m])=>{f in e&&e[f][1](m)})},reset:()=>{Object.keys(t).forEach(l=>{let u=e[l][1];u(t[l])})},subscribe:l=>{let u=!0;return ae(()=>{let d=n();if(u){u=!1;return}l(d)})},subscribeKey:(l,u)=>{let d,f=!0;return ae(()=>{let m=e[l][0]();if(f){d=m,f=!1;return}if(!Object.is(m,d)){let p=d;d=m,u(m,p)}})},getSnapshot:n}]}function to(t){let[e,r]=_(t);return{get current(){return e()},set current(n){r(n)}}}function no(t){return F(t)}function ro(t){return F(t)}function oo(t=[]){let[e,r]=_([...t]);return[e,{push(...o){r(i=>[...i,...o])},pop(){let o;return r(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return r(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){r(i=>[...o,...i])},splice(o,i=0,...s){let c=[];return r(l=>{let u=[...l];return c=u.splice(o,i,...s),u}),c},remove(o){r(i=>i.filter((s,c)=>c!==o))},removeWhere(o){r(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((c,l)=>l!==s)})},set(o){r([...o])},update(o,i){r(s=>s.map((c,l)=>l===o?i:c))},updateWhere(o,i){r(s=>s.map(c=>o(c)?i(c):c))},sort(o){r(i=>[...i].sort(o))},reverse(){r(o=>[...o].reverse())},filter(o){r(i=>i.filter(o))},map(o){r(i=>i.map(o))},clear(){r([])}}]}function io(t=[]){let e=[...t],r=null,n={};function o(){r=null,X(n)||he(n)}function i(){return Z(n),r===null&&(r=Object.freeze([...e])),r}return[i,{push(...c){c.length!==0&&(e.push(...c),o())},pop(){if(e.length===0)return;let c=e.pop();return o(),c},shift(){if(e.length===0)return;let c=e.shift();return o(),c},unshift(...c){c.length!==0&&(e.unshift(...c),o())},splice(c,l=0,...u){let d=e.splice(c,l,...u);return(d.length>0||u.length>0)&&o(),d},remove(c){c<0||c>=e.length||(e.splice(c,1),o())},removeWhere(c){let l=e.findIndex(c);l!==-1&&(e.splice(l,1),o())},set(c){e=[...c],o()},update(c,l){c<0||c>=e.length||Object.is(e[c],l)||(e[c]=l,o())},updateWhere(c,l){let u=!1;for(let d=0;d<e.length;d++)if(c(e[d])){let f=l(e[d]);Object.is(e[d],f)||(e[d]=f,u=!0)}u&&o()},sort(c){e.length<=1||(e.sort(c),o())},reverse(){e.length<=1||(e.reverse(),o())},filter(c){let l=e.filter(c);l.length!==e.length&&(e=l,o())},map(c){let l=!1;for(let u=0;u<e.length;u++){let d=c(e[u],u);Object.is(e[u],d)||(e[u]=d,l=!0)}l&&o()},clear(){e.length!==0&&(e=[],o())}}]}function ce(t,e,r){if(Object.is(t,e))return!0;if(t==null||e==null||typeof t!=typeof e||typeof t!="object")return!1;if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(t instanceof RegExp&&e instanceof RegExp)return t.toString()===e.toString();if(r||(r=new Set),r.has(t))return!0;if(r.add(t),Array.isArray(t))return!Array.isArray(e)||t.length!==e.length?!1:t.every((i,s)=>ce(i,e[s],r));let n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(i=>ce(t[i],e[i],r))}function so(t){return _(t,{equals:(e,r)=>ce(e,r)})}function ao(t,e,r){return[F(t,r),i=>{Te(()=>e(i))}]}function le(t,e){try{t()}catch(r){M(`${e}: callback threw: ${r instanceof Error?r.message:String(r)}`)}}function Ke(t,e){if(!(typeof document>"u"))if(e){if(e.isConnected){queueMicrotask(()=>{le(t,"onMount")});return}let r=new MutationObserver(()=>{e.isConnected&&(r.disconnect(),le(t,"onMount"))});queueMicrotask(()=>{e.isConnected?le(t,"onMount"):r.observe(document.body,{childList:!0,subtree:!0})})}else queueMicrotask(()=>{le(t,"onMount")})}function co(t,e){let r=()=>{let n=new MutationObserver(()=>{e.isConnected||(n.disconnect(),le(t,"onUnmount"))});n.observe(document.body,{childList:!0,subtree:!0})};e.isConnected?r():Ke(()=>{r()},e)}function lo(t,e){w(e,t)}function uo(t){let[e,r]=_(t);return{provide(n){r(n)},use(){return e},get(){return e()},set(n){r(n)}}}function Fe(t){let e=null;return function(){if(e)return e();let[n,o]=_("loading"),[i,s]=_(null),c=x({class:"sibu-lazy"});return t().then(l=>{e=l.default;let u=e();c.replaceChildren(u),o("loaded")}).catch(l=>{let u=l instanceof Error?l:new Error(String(l));s(u),o("error"),c.replaceChildren(x({class:"sibu-lazy-error",nodes:`Failed to load component: ${u.message}`}))}),c.appendChild(C({class:"sibu-lazy-loading",nodes:"Loading..."})),c}}function Pe({nodes:t,fallback:e}){let r=x({class:"sibu-suspense"}),n=e();return r.appendChild(n),queueMicrotask(()=>{try{let o=t();if(o.classList.contains("sibu-lazy")){let i=new MutationObserver(()=>{o.querySelector(".sibu-lazy-loading")||(i.disconnect(),r.replaceChildren(o))});i.observe(o,{childList:!0,subtree:!0}),o.querySelector(".sibu-lazy-loading")||r.replaceChildren(o)}else r.replaceChildren(o)}catch{}}),r}var Ko=A(),Fo=`
|
|
3
3
|
.sibu-error-boundary {
|
|
4
4
|
position: relative;
|
|
5
5
|
}
|
|
@@ -153,10 +153,10 @@
|
|
|
153
153
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
154
154
|
background: #3a3a4e;
|
|
155
155
|
}
|
|
156
|
-
`,po=!1;function Po(){if(!po&&typeof document<"u"){let t=J({nodes:Fo});document.head.appendChild(t),po=!0}}var je=new WeakMap;function jo(t,e,r){let n=je.get(t);n||(n=new Map,je.set(t,n));let o=e.message;return n.has(o)||n.set(o,t(e,r)),n.get(o)}function
|
|
157
|
-
`),n=[],o="";for(let i of r){let s=i.trim(),c=s.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(c){let u=c[1]||"(anonymous)",d=c[2]||c[3]||"";n.push({fn:u,loc:d}),!o&&u!=="(anonymous)"&&!u.startsWith("Object.")&&!u.startsWith("Module.")&&(o=u);continue}let l=s.match(/^(.+?)@(.+)$/);if(l){let u=l[1]||"(anonymous)",d=l[2]||"";n.push({fn:u,loc:d}),!o&&u!=="(anonymous)"&&(o=u)}}return{source:o,frames:n}}function fo({nodes:t,fallback:e,onError:r}){Po();let[n,o]=_(null),i=()=>{e&&je.delete(e),o(null)},s=d=>{let f=d instanceof Error?d:new Error(String(d));return o(f),r?.(f),f},c=(d,f)=>{if(!Ko)return x({class:"sibu-error-fallback",nodes:[x({class:"sibu-error-header",nodes:[ie({nodes:"Something went wrong",class:"sibu-error-title"})]}),x({class:"sibu-error-body",nodes:[oe({nodes:"An unexpected error occurred. Please try again.",class:"sibu-error-message"}),x({class:"sibu-error-actions",nodes:[K({nodes:"Retry",class:"sibu-error-btn sibu-error-btn-retry",on:{click:f}}),K({nodes:"Reload Page",class:"sibu-error-btn sibu-error-btn-reload",on:{click:()=>location.reload()}})]})]})]});let{source:m,frames:p}=
|
|
156
|
+
`,po=!1;function Po(){if(!po&&typeof document<"u"){let t=J({nodes:Fo});document.head.appendChild(t),po=!0}}var je=new WeakMap;function jo(t,e,r){let n=je.get(t);n||(n=new Map,je.set(t,n));let o=e.message;return n.has(o)||n.set(o,t(e,r)),n.get(o)}function qo(t){let r=(t.stack||"").split(`
|
|
157
|
+
`),n=[],o="";for(let i of r){let s=i.trim(),c=s.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(c){let u=c[1]||"(anonymous)",d=c[2]||c[3]||"";n.push({fn:u,loc:d}),!o&&u!=="(anonymous)"&&!u.startsWith("Object.")&&!u.startsWith("Module.")&&(o=u);continue}let l=s.match(/^(.+?)@(.+)$/);if(l){let u=l[1]||"(anonymous)",d=l[2]||"";n.push({fn:u,loc:d}),!o&&u!=="(anonymous)"&&(o=u)}}return{source:o,frames:n}}function fo({nodes:t,fallback:e,onError:r}){Po();let[n,o]=_(null),i=()=>{e&&je.delete(e),o(null)},s=d=>{let f=d instanceof Error?d:new Error(String(d));return o(f),r?.(f),f},c=(d,f)=>{if(!Ko)return x({class:"sibu-error-fallback",nodes:[x({class:"sibu-error-header",nodes:[ie({nodes:"Something went wrong",class:"sibu-error-title"})]}),x({class:"sibu-error-body",nodes:[oe({nodes:"An unexpected error occurred. Please try again.",class:"sibu-error-message"}),x({class:"sibu-error-actions",nodes:[K({nodes:"Retry",class:"sibu-error-btn sibu-error-btn-retry",on:{click:f}}),K({nodes:"Reload Page",class:"sibu-error-btn sibu-error-btn-reload",on:{click:()=>location.reload()}})]})]})]});let{source:m,frames:p}=qo(d),g=`${d.message}
|
|
158
158
|
|
|
159
|
-
${d.stack||""}`,T=K({nodes:"Copy",class:"sibu-error-copy-btn",on:{click:()=>{navigator.clipboard.writeText(g).then(()=>{T.textContent="Copied!",setTimeout(()=>{T.textContent="Copy"},1500)})}}}),y=p.map((h,D)=>x({nodes:[C({class:"sibu-line-num",nodes:String(D+1)}),C({class:"sibu-stack-fn",nodes:h.fn}),C({class:"sibu-stack-loc",nodes:` ${h.loc}`})]}));return x({class:"sibu-error-fallback",nodes:[x({class:"sibu-error-header",nodes:[ie({nodes:m?`Error in ${m}`:"Something went wrong",class:"sibu-error-title"}),...m?[]:[C()]]}),x({class:"sibu-error-body",nodes:[oe({nodes:d.message,class:"sibu-error-message"}),...p.length>0?[x({class:"sibu-error-stack-container",nodes:[x({class:"sibu-error-stack-label",nodes:[C({nodes:"Stack Trace"}),T]}),x({class:"sibu-error-stack",nodes:[ve({nodes:y})]})]})]:[],x({class:"sibu-error-actions",nodes:[K({nodes:"Retry",class:"sibu-error-btn sibu-error-btn-retry",on:{click:f}}),K({nodes:"Reload Page",class:"sibu-error-btn sibu-error-btn-reload",on:{click:()=>location.reload()}})]})]})]})},l=d=>{let f=e||c;try{return jo(f,d,i)}catch(m){let p=m instanceof Error?m:new Error(String(m));return queueMicrotask(()=>{u.parentNode&&u.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:p}}))}),document.createComment("error-boundary-failed")}},u=x({class:"sibu-error-boundary",nodes:()=>{let d=n();if(d)return l(d);try{let f=t();if(f&&typeof f.then=="function"){let m=x({class:"sibu-error-async"});return m.appendChild(C({class:"sibu-lazy-loading",nodes:"Loading..."})),f.then(p=>{m.replaceChildren(p)}).catch(p=>{let g=s(p);m.replaceChildren(l(g))}),m}return f}catch(f){let m=s(f);return l(m)}}});return u.addEventListener("sibu:error-propagate",d=>{if(n())return;d.stopPropagation();let m=d.detail?.error;m&&s(m)}),u}var
|
|
159
|
+
${d.stack||""}`,T=K({nodes:"Copy",class:"sibu-error-copy-btn",on:{click:()=>{navigator.clipboard.writeText(g).then(()=>{T.textContent="Copied!",setTimeout(()=>{T.textContent="Copy"},1500)})}}}),y=p.map((h,D)=>x({nodes:[C({class:"sibu-line-num",nodes:String(D+1)}),C({class:"sibu-stack-fn",nodes:h.fn}),C({class:"sibu-stack-loc",nodes:` ${h.loc}`})]}));return x({class:"sibu-error-fallback",nodes:[x({class:"sibu-error-header",nodes:[ie({nodes:m?`Error in ${m}`:"Something went wrong",class:"sibu-error-title"}),...m?[]:[C()]]}),x({class:"sibu-error-body",nodes:[oe({nodes:d.message,class:"sibu-error-message"}),...p.length>0?[x({class:"sibu-error-stack-container",nodes:[x({class:"sibu-error-stack-label",nodes:[C({nodes:"Stack Trace"}),T]}),x({class:"sibu-error-stack",nodes:[ve({nodes:y})]})]})]:[],x({class:"sibu-error-actions",nodes:[K({nodes:"Retry",class:"sibu-error-btn sibu-error-btn-retry",on:{click:f}}),K({nodes:"Reload Page",class:"sibu-error-btn sibu-error-btn-reload",on:{click:()=>location.reload()}})]})]})]})},l=d=>{let f=e||c;try{return jo(f,d,i)}catch(m){let p=m instanceof Error?m:new Error(String(m));return queueMicrotask(()=>{u.parentNode&&u.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:p}}))}),document.createComment("error-boundary-failed")}},u=x({class:"sibu-error-boundary",nodes:()=>{let d=n();if(d)return l(d);try{let f=t();if(f&&typeof f.then=="function"){let m=x({class:"sibu-error-async"});return m.appendChild(C({class:"sibu-lazy-loading",nodes:"Loading..."})),f.then(p=>{m.replaceChildren(p)}).catch(p=>{let g=s(p);m.replaceChildren(l(g))}),m}return f}catch(f){let m=s(f);return l(m)}}});return u.addEventListener("sibu:error-propagate",d=>{if(n())return;d.stopPropagation();let m=d.detail?.error;m&&s(m)}),u}var Wo=`
|
|
160
160
|
@keyframes sibu-spin {
|
|
161
161
|
to { transform: rotate(360deg); }
|
|
162
162
|
}
|
|
@@ -209,4 +209,4 @@ ${d.stack||""}`,T=K({nodes:"Copy",class:"sibu-error-copy-btn",on:{click:()=>{nav
|
|
|
209
209
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
210
210
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
211
211
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
212
|
-
`,mo=!1;function $o(){!mo&&typeof document<"u"&&(document.head.appendChild(J({nodes:
|
|
212
|
+
`,mo=!1;function $o(){!mo&&typeof document<"u"&&(document.head.appendChild(J({nodes:Wo})),mo=!0)}function go(t={}){$o();let{text:e,variant:r="spinner",size:n="md"}=t,o=n!=="md"?` sibu-loading-${n}`:"";return r==="dots"?x({class:`sibu-loading${o}`,nodes:[x({class:"sibu-loading-dots",nodes:[C({class:"sibu-loading-dot"}),C({class:"sibu-loading-dot"}),C({class:"sibu-loading-dot"})]}),e?C({class:"sibu-loading-text",nodes:e}):null].filter(Boolean)}):x({class:`sibu-loading${o}`,nodes:[x({class:"sibu-loading-spinner"}),e?C({class:"sibu-loading-text",nodes:e}):null].filter(Boolean)})}typeof window<"u"&&(window.Sibu=qe);return So(Uo);})();
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
track
|
|
3
|
+
} from "./chunk-V2XTI523.js";
|
|
4
|
+
import {
|
|
5
|
+
devWarn,
|
|
6
|
+
isDev
|
|
7
|
+
} from "./chunk-UNXCEF6S.js";
|
|
8
|
+
|
|
9
|
+
// src/utils/sanitize.ts
|
|
10
|
+
function sanitizeUrl(url) {
|
|
11
|
+
const trimmed = url.replace(/[\x00-\x20\x7f-\x9f]+/g, "").trim();
|
|
12
|
+
if (!trimmed) return "";
|
|
13
|
+
const lower = trimmed.toLowerCase();
|
|
14
|
+
if (lower.startsWith("javascript:") || lower.startsWith("data:") || lower.startsWith("vbscript:") || lower.startsWith("blob:")) {
|
|
15
|
+
return "";
|
|
16
|
+
}
|
|
17
|
+
return trimmed;
|
|
18
|
+
}
|
|
19
|
+
function sanitizeCSSValue(value) {
|
|
20
|
+
const lower = value.toLowerCase().replace(/\s+/g, "");
|
|
21
|
+
if (lower.includes("url(") || lower.includes("expression(") || lower.includes("javascript:") || lower.includes("-moz-binding")) {
|
|
22
|
+
return "";
|
|
23
|
+
}
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
var URL_ATTRIBUTES = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "cite", "poster", "background", "srcset"]);
|
|
27
|
+
function isUrlAttribute(attr) {
|
|
28
|
+
return URL_ATTRIBUTES.has(attr);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/reactivity/bindAttribute.ts
|
|
32
|
+
var _isDev = isDev();
|
|
33
|
+
function bindAttribute(el, attr, getter) {
|
|
34
|
+
function commit() {
|
|
35
|
+
let value;
|
|
36
|
+
try {
|
|
37
|
+
value = getter();
|
|
38
|
+
} catch (err) {
|
|
39
|
+
if (_isDev)
|
|
40
|
+
devWarn(`bindAttribute: getter for "${attr}" threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (typeof value === "boolean") {
|
|
44
|
+
if (attr in el && (attr === "checked" || attr === "disabled" || attr === "selected")) {
|
|
45
|
+
el[attr] = value;
|
|
46
|
+
} else if (value) {
|
|
47
|
+
el.setAttribute(attr, "");
|
|
48
|
+
} else {
|
|
49
|
+
el.removeAttribute(attr);
|
|
50
|
+
}
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const str = String(value);
|
|
54
|
+
if ((attr === "value" || attr === "checked") && attr in el) {
|
|
55
|
+
el[attr] = attr === "checked" ? Boolean(value) : str;
|
|
56
|
+
} else {
|
|
57
|
+
el.setAttribute(attr, isUrlAttribute(attr) ? sanitizeUrl(str) : str);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const teardown = track(commit);
|
|
61
|
+
return teardown;
|
|
62
|
+
}
|
|
63
|
+
function bindDynamic(el, nameGetter, valueGetter) {
|
|
64
|
+
let prevName = null;
|
|
65
|
+
function commit() {
|
|
66
|
+
let name;
|
|
67
|
+
try {
|
|
68
|
+
name = typeof nameGetter === "function" ? nameGetter() : nameGetter;
|
|
69
|
+
} catch (err) {
|
|
70
|
+
if (_isDev) devWarn(`bindDynamic: name getter threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
let value;
|
|
74
|
+
try {
|
|
75
|
+
value = typeof valueGetter === "function" ? valueGetter() : valueGetter;
|
|
76
|
+
} catch (err) {
|
|
77
|
+
if (_isDev) devWarn(`bindDynamic: value getter threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if ((name[0] === "o" || name[0] === "O") && (name[1] === "n" || name[1] === "N")) return;
|
|
81
|
+
if (prevName !== null && prevName !== name) {
|
|
82
|
+
el.removeAttribute(prevName);
|
|
83
|
+
}
|
|
84
|
+
const str = String(value);
|
|
85
|
+
if ((name === "value" || name === "checked") && name in el) {
|
|
86
|
+
el[name] = name === "checked" ? Boolean(value) : str;
|
|
87
|
+
} else {
|
|
88
|
+
el.setAttribute(name, isUrlAttribute(name) ? sanitizeUrl(str) : str);
|
|
89
|
+
}
|
|
90
|
+
prevName = name;
|
|
91
|
+
}
|
|
92
|
+
const teardown = track(commit);
|
|
93
|
+
return () => {
|
|
94
|
+
teardown();
|
|
95
|
+
if (prevName !== null) {
|
|
96
|
+
el.removeAttribute(prevName);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export {
|
|
102
|
+
sanitizeUrl,
|
|
103
|
+
sanitizeCSSValue,
|
|
104
|
+
isUrlAttribute,
|
|
105
|
+
bindAttribute,
|
|
106
|
+
bindDynamic
|
|
107
|
+
};
|