sibujs 1.0.3 → 1.0.4
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/LICENSE +21 -21
- package/dist/build.cjs +20 -0
- package/dist/build.js +1 -1
- package/dist/cdn.global.js +4 -4
- package/dist/{chunk-MEZVEBPN.js → chunk-32ZISOLJ.js} +22 -0
- package/dist/{chunk-7TQKR4PP.js → chunk-AZ3ISID5.js} +4 -0
- package/dist/{chunk-3CRQALYP.js → chunk-DKOHBI74.js} +49 -2
- package/dist/{chunk-DTCOOBMX.js → chunk-OF7UZIVB.js} +1 -1
- package/dist/{chunk-N6IZB6KJ.js → chunk-PBHF5WKN.js} +56 -7
- package/dist/{customElement-BKQfbSZQ.d.ts → customElement-yz8uyk-0.d.cts} +52 -6
- package/dist/{customElement-BKQfbSZQ.d.cts → customElement-yz8uyk-0.d.ts} +52 -6
- package/dist/extras.cjs +111 -9
- package/dist/extras.d.cts +3 -2
- package/dist/extras.d.ts +3 -2
- package/dist/extras.js +9 -5
- package/dist/index.cjs +22 -0
- package/dist/index.d.cts +27 -2
- package/dist/index.d.ts +27 -2
- package/dist/index.js +5 -1
- package/dist/patterns.d.cts +8 -2
- package/dist/patterns.d.ts +8 -2
- package/dist/plugins.cjs +142 -1
- package/dist/plugins.d.cts +39 -3
- package/dist/plugins.d.ts +39 -3
- package/dist/plugins.js +119 -3
- package/dist/{ssr-WKUPVSSK.js → ssr-6GIMY5MX.js} +5 -3
- package/dist/ssr-BA6sxxUd.d.cts +135 -0
- package/dist/ssr-BA6sxxUd.d.ts +135 -0
- package/dist/ssr.cjs +5 -0
- package/dist/ssr.d.cts +3 -113
- package/dist/ssr.d.ts +3 -113
- package/dist/ssr.js +4 -2
- package/dist/ui.cjs +50 -2
- package/dist/ui.d.cts +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +3 -1
- package/dist/widgets.cjs +56 -7
- package/dist/widgets.d.cts +4 -2
- package/dist/widgets.d.ts +4 -2
- package/dist/widgets.js +1 -1
- package/package.json +139 -139
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Fran Ramírez
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Fran Ramírez
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/build.cjs
CHANGED
|
@@ -1074,6 +1074,7 @@ __export(index_exports, {
|
|
|
1074
1074
|
article: () => article,
|
|
1075
1075
|
aside: () => aside,
|
|
1076
1076
|
audio: () => audio,
|
|
1077
|
+
autoResize: () => autoResize,
|
|
1077
1078
|
b: () => b,
|
|
1078
1079
|
base: () => base,
|
|
1079
1080
|
batch: () => batch,
|
|
@@ -1098,6 +1099,7 @@ __export(index_exports, {
|
|
|
1098
1099
|
col: () => col,
|
|
1099
1100
|
colgroup: () => colgroup,
|
|
1100
1101
|
context: () => context,
|
|
1102
|
+
copyOnClick: () => copyOnClick,
|
|
1101
1103
|
customElement: () => customElement,
|
|
1102
1104
|
data: () => data,
|
|
1103
1105
|
datalist: () => datalist,
|
|
@@ -2847,6 +2849,24 @@ var longPress = (element, options) => {
|
|
|
2847
2849
|
element.removeEventListener("pointerleave", cancel);
|
|
2848
2850
|
};
|
|
2849
2851
|
};
|
|
2852
|
+
var copyOnClick = (element, getText) => {
|
|
2853
|
+
const handler = () => {
|
|
2854
|
+
const text2 = typeof getText === "function" ? getText() : element.textContent ?? "";
|
|
2855
|
+
navigator.clipboard.writeText(text2);
|
|
2856
|
+
};
|
|
2857
|
+
element.addEventListener("click", handler);
|
|
2858
|
+
return () => element.removeEventListener("click", handler);
|
|
2859
|
+
};
|
|
2860
|
+
var autoResize = (element) => {
|
|
2861
|
+
const resize = () => {
|
|
2862
|
+
element.style.overflow = "hidden";
|
|
2863
|
+
element.style.height = "auto";
|
|
2864
|
+
element.style.height = `${element.scrollHeight}px`;
|
|
2865
|
+
};
|
|
2866
|
+
resize();
|
|
2867
|
+
element.addEventListener("input", resize);
|
|
2868
|
+
return () => element.removeEventListener("input", resize);
|
|
2869
|
+
};
|
|
2850
2870
|
var trapFocus = (element) => {
|
|
2851
2871
|
const focusable = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
2852
2872
|
const handler = (e) => {
|
package/dist/build.js
CHANGED
package/dist/cdn.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Sibu=(()=>{var ke=Object.defineProperty;var fo=Object.getOwnPropertyDescriptor;var mo=Object.getOwnPropertyNames;var go=Object.prototype.hasOwnProperty;var Ie=(r,e)=>{for(var n in e)ke(r,n,{get:e[n],enumerable:!0})},ho=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of mo(e))!go.call(r,o)&&o!==n&&ke(r,o,{get:()=>e[o],enumerable:!(t=fo(e,o))||t.enumerable});return r};var bo=r=>ho(ke({},"__esModule",{value:!0}),r);var zo={};Ie(zo,{DynamicComponent:()=>Mr,ErrorBoundary:()=>co,Fragment:()=>_r,KeepAlive:()=>Br,Loading:()=>uo,Portal:()=>Nr,SVG_NS:()=>y,Suspense:()=>je,a:()=>wt,abbr:()=>Ct,action:()=>Kr,address:()=>ct,area:()=>Jt,array:()=>eo,article:()=>nt,aside:()=>at,audio:()=>Xt,b:()=>_t,base:()=>Gn,batch:()=>ve,bdi:()=>Nt,bdo:()=>At,bindDynamic:()=>Ce,blockquote:()=>mt,body:()=>Xe,br:()=>Lt,button:()=>ye,canvas:()=>mn,caption:()=>yn,catchError:()=>qr,catchErrorAsync:()=>Ur,center:()=>br,checkLeaks:()=>Ye,circle:()=>Zn,cite:()=>Mt,clickOutside:()=>zr,clipPath:()=>cr,code:()=>Ot,col:()=>vn,colgroup:()=>Tn,context:()=>so,customElement:()=>vr,data:()=>Rt,datalist:()=>An,dd:()=>gt,deepEqual:()=>ie,deepSignal:()=>no,defs:()=>ar,del:()=>bn,derived:()=>z,details:()=>Un,dfn:()=>Dt,dialog:()=>Wn,disableSSR:()=>Ke,dispose:()=>O,div:()=>w,dl:()=>ht,dt:()=>bt,each:()=>wr,effect:()=>oe,ellipse:()=>Jn,em:()=>Ht,embed:()=>on,enableSSR:()=>Be,enqueueBatchedSignal:()=>Z,fieldset:()=>Ln,figcaption:()=>xt,figure:()=>yt,font:()=>xr,footer:()=>ot,form:()=>Mn,g:()=>Xn,getSlot:()=>Or,h1:()=>lt,h2:()=>dt,h3:()=>xe,h4:()=>ut,h5:()=>pt,h6:()=>ft,head:()=>Je,header:()=>rt,hr:()=>vt,html:()=>Le,i:()=>Bt,iframe:()=>sn,img:()=>en,input:()=>On,ins:()=>xn,isBatching:()=>Fr,isSSR:()=>J,kbd:()=>Kt,label:()=>Rn,lazy:()=>Pe,legend:()=>Dn,li:()=>Tt,line:()=>er,linearGradient:()=>ur,link:()=>Qn,longPress:()=>Pr,main:()=>st,map:()=>tn,mark:()=>zt,marker:()=>hr,marquee:()=>yr,mask:()=>lr,match:()=>Hr,math:()=>fn,memo:()=>Jr,memoFn:()=>Xr,menu:()=>Fn,meta:()=>Yn,meter:()=>Hn,mount:()=>kr,nav:()=>it,noscript:()=>gn,object:()=>an,ol:()=>St,on:()=>Gr,onCleanup:()=>io,onMount:()=>ze,onUnmount:()=>oo,optgroup:()=>Bn,option:()=>Kn,output:()=>zn,p:()=>be,param:()=>cn,path:()=>tr,pattern:()=>dr,picture:()=>ln,polygon:()=>nr,polyline:()=>rr,portal:()=>dn,pre:()=>Et,progress:()=>Pn,q:()=>Pt,radialGradient:()=>pr,reactiveArray:()=>to,rect:()=>or,ref:()=>Zr,registerComponent:()=>Ar,registerDisposer:()=>E,resolveComponent:()=>Oe,rp:()=>jt,rt:()=>qt,ruby:()=>Ut,s:()=>Wt,samp:()=>Ft,script:()=>hn,section:()=>tt,select:()=>jn,setGlobalErrorHandler:()=>Wr,show:()=>Rr,signal:()=>C,slot:()=>Vn,small:()=>It,source:()=>un,span:()=>D,stop:()=>fr,store:()=>Yr,strong:()=>Vt,style:()=>Y,sub:()=>$t,summary:()=>In,sup:()=>Gt,svg:()=>pn,symbol:()=>gr,table:()=>Sn,tagFactory:()=>s,tbody:()=>kn,td:()=>En,template:()=>$n,text:()=>ir,textarea:()=>qn,tfoot:()=>wn,th:()=>Cn,thead:()=>_n,time:()=>Qt,title:()=>et,tr:()=>Nn,track:()=>nn,trapFocus:()=>jr,tspan:()=>sr,u:()=>Yt,ul:()=>kt,unregisterComponent:()=>Lr,untracked:()=>G,use:()=>mr,var_:()=>Zt,video:()=>rn,watch:()=>Qr,when:()=>Dr,withSSR:()=>Vr,writable:()=>ro});var Ue={};Ie(Ue,{DynamicComponent:()=>Mr,ErrorBoundary:()=>co,Fragment:()=>_r,KeepAlive:()=>Br,Loading:()=>uo,Portal:()=>Nr,SVG_NS:()=>y,Suspense:()=>je,a:()=>wt,abbr:()=>Ct,action:()=>Kr,address:()=>ct,area:()=>Jt,array:()=>eo,article:()=>nt,aside:()=>at,audio:()=>Xt,b:()=>_t,base:()=>Gn,batch:()=>ve,bdi:()=>Nt,bdo:()=>At,bindDynamic:()=>Ce,blockquote:()=>mt,body:()=>Xe,br:()=>Lt,button:()=>ye,canvas:()=>mn,caption:()=>yn,catchError:()=>qr,catchErrorAsync:()=>Ur,center:()=>br,checkLeaks:()=>Ye,circle:()=>Zn,cite:()=>Mt,clickOutside:()=>zr,clipPath:()=>cr,code:()=>Ot,col:()=>vn,colgroup:()=>Tn,context:()=>so,customElement:()=>vr,data:()=>Rt,datalist:()=>An,dd:()=>gt,deepEqual:()=>ie,deepSignal:()=>no,defs:()=>ar,del:()=>bn,derived:()=>z,details:()=>Un,dfn:()=>Dt,dialog:()=>Wn,disableSSR:()=>Ke,dispose:()=>O,div:()=>w,dl:()=>ht,dt:()=>bt,each:()=>wr,effect:()=>oe,ellipse:()=>Jn,em:()=>Ht,embed:()=>on,enableSSR:()=>Be,enqueueBatchedSignal:()=>Z,fieldset:()=>Ln,figcaption:()=>xt,figure:()=>yt,font:()=>xr,footer:()=>ot,form:()=>Mn,g:()=>Xn,getSlot:()=>Or,h1:()=>lt,h2:()=>dt,h3:()=>xe,h4:()=>ut,h5:()=>pt,h6:()=>ft,head:()=>Je,header:()=>rt,hr:()=>vt,html:()=>Le,i:()=>Bt,iframe:()=>sn,img:()=>en,input:()=>On,ins:()=>xn,isBatching:()=>Fr,isSSR:()=>J,kbd:()=>Kt,label:()=>Rn,lazy:()=>Pe,legend:()=>Dn,li:()=>Tt,line:()=>er,linearGradient:()=>ur,link:()=>Qn,longPress:()=>Pr,main:()=>st,map:()=>tn,mark:()=>zt,marker:()=>hr,marquee:()=>yr,mask:()=>lr,match:()=>Hr,math:()=>fn,memo:()=>Jr,memoFn:()=>Xr,menu:()=>Fn,meta:()=>Yn,meter:()=>Hn,mount:()=>kr,nav:()=>it,noscript:()=>gn,object:()=>an,ol:()=>St,on:()=>Gr,onCleanup:()=>io,onMount:()=>ze,onUnmount:()=>oo,optgroup:()=>Bn,option:()=>Kn,output:()=>zn,p:()=>be,param:()=>cn,path:()=>tr,pattern:()=>dr,picture:()=>ln,polygon:()=>nr,polyline:()=>rr,portal:()=>dn,pre:()=>Et,progress:()=>Pn,q:()=>Pt,radialGradient:()=>pr,reactiveArray:()=>to,rect:()=>or,ref:()=>Zr,registerComponent:()=>Ar,registerDisposer:()=>E,resolveComponent:()=>Oe,rp:()=>jt,rt:()=>qt,ruby:()=>Ut,s:()=>Wt,samp:()=>Ft,script:()=>hn,section:()=>tt,select:()=>jn,setGlobalErrorHandler:()=>Wr,show:()=>Rr,signal:()=>C,slot:()=>Vn,small:()=>It,source:()=>un,span:()=>D,stop:()=>fr,store:()=>Yr,strong:()=>Vt,style:()=>Y,sub:()=>$t,summary:()=>In,sup:()=>Gt,svg:()=>pn,symbol:()=>gr,table:()=>Sn,tagFactory:()=>s,tbody:()=>kn,td:()=>En,template:()=>$n,text:()=>ir,textarea:()=>qn,tfoot:()=>wn,th:()=>Cn,thead:()=>_n,time:()=>Qt,title:()=>et,tr:()=>Nn,track:()=>nn,trapFocus:()=>jr,tspan:()=>sr,u:()=>Yt,ul:()=>kt,unregisterComponent:()=>Lr,untracked:()=>G,use:()=>mr,var_:()=>Zt,video:()=>rn,watch:()=>Qr,when:()=>Dr,withSSR:()=>Vr,writable:()=>ro});function _(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:!0}var Ve=_();function N(r,e){if(Ve&&!r)throw new Error(`[Sibu] ${e}`)}function L(r){Ve&&console.warn(`[Sibu] ${r}`)}function P(r){let e=r.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!e)return"";let n=e.toLowerCase();return n.startsWith("javascript:")||n.startsWith("data:")||n.startsWith("vbscript:")||n.startsWith("blob:")?"":e}function Ee(r){let e=r.toLowerCase().replace(/\s+/g,"");return e.includes("url(")||e.includes("expression(")||e.includes("javascript:")||e.includes("-moz-binding")?"":r}var xo=new Set(["href","src","action","formaction","cite","poster","background","srcset"]);function j(r){return xo.has(r)}var yo=_(),V=new Array(32),$=32,R=-1,K=null,vo=new WeakMap,q="__s",H=0,S=[],M=new Set;function te(r){try{r()}catch(e){yo&&L(`Subscriber threw during notification: ${e instanceof Error?e.message:String(e)}`)}}var pe=0,fe=!1;function x(r,e){e||(e=r),$e(e),++R,R>=$&&($*=2,V.length=$),V[R]=e,K=e;try{r()}finally{R--,K=R>=0?V[R]:null}return()=>$e(e)}function To(){pe===0&&(++R,R>=$&&($*=2,V.length=$),V[R]=null,K=null,fe=!0),pe++}function So(){pe--,pe===0&&(R--,K=R>=0?V[R]:null,fe=!1)}function G(r){To();try{return r()}finally{So()}}function Q(r){if(!K)return;let e=K;if(e._dep===r)return;let n=e._deps;if(n){if(n.has(r))return;n.add(r)}else if(e._dep!==void 0){let o=new Set;o.add(e._dep),o.add(r),e._deps=o,e._dep=void 0}else e._dep=r;let t=r[q];t||(t=new Set,vo.set(r,t),r[q]=t),t.add(K),t.size===1?r.__f=K:r.__f!==void 0&&(r.__f=void 0)}function Ge(r){let e=r[q];if(e)for(let n of e)n._c?I(n):M.has(n)||(M.add(n),S.push(n))}function Qe(){if(!(H>0)){H++;try{let r=0;for(;r<S.length;)te(S[r]),r++}finally{S.length=0,M.clear(),H--}}}function I(r){r();let e=r._sig;for(;e;){let n=e.__f;if(n){if(n._c){let i=n._sig;i._d=!0,e=i;continue}M.has(n)||(M.add(n),S.push(n));break}let t=e[q];if(!t)break;let o;for(let i of t)if(i._c){i();let a=i._sig;a&&!o?o=a:a&&I(i)}else M.has(i)||(M.add(i),S.push(i));e=o}}function me(r){let e=r.__f;if(e){if(H>0){e._c?I(e):M.has(e)||(M.add(e),S.push(e));return}H++;try{e._c?I(e):te(e);let t=0;for(;t<S.length;)te(S[t]),t++}finally{S.length=0,M.clear(),H--}return}let n=r[q];if(!(!n||n.size===0)){if(H>0){for(let t of n)t._c?I(t):M.has(t)||(M.add(t),S.push(t));return}H++;try{let t=0;for(let i of n)S[t++]=i;for(let i=0;i<t;i++)S[i]._c&&I(S[i]);for(let i=0;i<t;i++)S[i]._c||M.has(S[i])||te(S[i]);let o=t;for(;o<S.length;)te(S[o]),o++}finally{S.length=0,M.clear(),H--}}}function $e(r){let e=r,n=e._dep;if(n!==void 0){let o=n[q];o&&(o.delete(r),n.__f===r&&(n.__f=void 0)),e._dep=void 0;return}let t=e._deps;if(!(!t||t.size===0)){for(let o of t){let i=o[q];i&&(i.delete(r),o.__f===r&&(o.__f=void 0))}t.clear()}}var we=_();function ge(r,e,n){function t(){let i;try{i=n()}catch(c){we&&L(`bindAttribute: getter for "${e}" threw: ${c instanceof Error?c.message:String(c)}`);return}if(typeof i=="boolean"){e in r&&(e==="checked"||e==="disabled"||e==="selected")?r[e]=i:i?r.setAttribute(e,""):r.removeAttribute(e);return}let a=String(i);(e==="value"||e==="checked")&&e in r?r[e]=e==="checked"?!!i:a:r.setAttribute(e,j(e)?P(a):a)}return x(t)}function Ce(r,e,n){let t=null;function o(){let a;try{a=typeof e=="function"?e():e}catch(d){we&&L(`bindDynamic: name getter threw: ${d instanceof Error?d.message:String(d)}`);return}let c;try{c=typeof n=="function"?n():n}catch(d){we&&L(`bindDynamic: value getter threw: ${d instanceof Error?d.message:String(d)}`);return}if((a[0]==="o"||a[0]==="O")&&(a[1]==="n"||a[1]==="N"))return;t!==null&&t!==a&&r.removeAttribute(t);let l=String(c);(a==="value"||a==="checked")&&a in r?r[a]=a==="checked"?!!c:l:r.setAttribute(a,j(a)?P(l):l),t=a}let i=x(o);return()=>{i(),t!==null&&r.removeAttribute(t)}}var ko=_();function U(r,e){let n=[];function t(){let o;try{o=e()}catch(l){ko&&L(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}for(let l=0;l<n.length;l++){let d=n[l];d.parentNode&&d.parentNode.removeChild(d)}if(o==null||typeof o=="boolean"){n.length=0;return}let i=r.parentNode;if(!i){n.length=0;return}let a=r.nextSibling,c=0;if(Array.isArray(o)){n.length<o.length&&(n=new Array(o.length));for(let l=0;l<o.length;l++){let d=o[l];if(d==null||typeof d=="boolean")continue;let u=d instanceof Node?d:document.createTextNode(String(d));i.insertBefore(u,a),n[c++]=u}}else{n.length<1&&(n=[null]);let l=o instanceof Node?o:document.createTextNode(String(o));i.insertBefore(l,a),n[c++]=l}n.length=c}return x(t)}var he=new WeakMap,_e=_(),ne=0;function E(r,e){let n=he.get(r);n||(n=[],he.set(r,n)),n.push(e),_e&&ne++}function O(r){let e=[r],n=[];for(;e.length>0;){let t=e.pop();n.push(t);let o=t.childNodes;for(let i=0;i<o.length;i++)e.push(o[i])}for(let t=n.length-1;t>=0;t--){let o=n[t],i=he.get(o);if(i){_e&&(ne-=i.length);for(let a of i)a();he.delete(o)}}}function Ye(r=0){return _e?(r>0&&ne>r&&L(`checkLeaks: ${ne} active DOM bindings detected. Expected \u2264${r}. This may indicate a component was removed from the DOM without calling dispose().`),ne):0}var y="http://www.w3.org/2000/svg",Ze=new Map;function Eo(r){let e=Ze.get(r);return e!==void 0||(e=r.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Ze.set(r,e)),e}function wo(r,e){if(typeof e=="function"){let t=x(()=>{r.setAttribute("style",e())});E(r,t);return}if(typeof e=="string"){r.setAttribute("style",e);return}let n=r;for(let t in e){let o=e[t],i=Eo(t);if(typeof o=="function"){let a=o,c=x(()=>{n.style.setProperty(i,Ee(String(a())))});E(r,c)}else n.style.setProperty(i,Ee(String(o)))}}function Co(r,e){if(typeof e=="string"){r.setAttribute("class",e);return}if(typeof e=="function"){let i=x(()=>{r.setAttribute("class",e())});E(r,i);return}let n=e,t=!1,o="";for(let i in n){let a=n[i];if(typeof a=="function"){t=!0;break}a&&(o=o?`${o} ${i}`:i)}if(t){let a=x(()=>{let c="";for(let l in n){let d=n[l];(typeof d=="function"?d():d)&&(c=c?`${c} ${l}`:l)}r.setAttribute("class",c)});E(r,a)}else r.setAttribute("class",o)}function Ne(r,e){if(typeof e=="string"){r.textContent=e;return}if(typeof e=="number"){r.textContent=String(e);return}if(!(typeof e=="boolean"||e==null)){if(typeof e=="function"){let n=document.createComment("");r.appendChild(n),E(r,U(n,e));return}if(e instanceof Node){r.appendChild(e);return}if(Array.isArray(e))for(let n=0;n<e.length;n++){let t=e[n];if(typeof t=="function"){let o=document.createComment("");r.appendChild(o),E(r,U(o,t))}else if(t instanceof Node)r.appendChild(t);else if(Array.isArray(t))for(let o=0;o<t.length;o++){let i=t[o];if(typeof i=="function"){let a=document.createComment("");r.appendChild(a),E(r,U(a,i))}else i instanceof Node?r.appendChild(i):i!=null&&typeof i!="boolean"&&r.appendChild(document.createTextNode(String(i)))}else t!=null&&typeof t!="boolean"&&r.appendChild(document.createTextNode(String(t)))}}}var s=(r,e)=>(n,t)=>{let o=e?document.createElementNS(e,r):document.createElement(r);if(n===void 0)return o;if(t===void 0&&typeof n=="string")return o.textContent=n,o;if(t!==void 0)return o.setAttribute("class",n),Ne(o,t),o;if(Array.isArray(n)||n instanceof Node)return Ne(o,n),o;let i=n,a=i.class;a!=null&&Co(o,a);let c=i.id;c!=null&&(o.id=c);let l=i.nodes;l!=null&&Ne(o,l);let d=i.on;if(d)for(let m in d)o.addEventListener(m,d[m]);let u=i.style;u!=null&&wo(o,u);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")E(o,ge(o,m,p));else if(p===!0)o.setAttribute(m,"");else{let g=String(p);o.setAttribute(m,j(m)?P(g):g)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var si=s("html"),Je=s("head"),Xe=s("body"),et=s("title"),w=s("div"),D=s("span"),tt=s("section"),nt=s("article"),rt=s("header"),ot=s("footer"),it=s("nav"),st=s("main"),at=s("aside"),ct=s("address"),be=s("p"),lt=s("h1"),dt=s("h2"),xe=s("h3"),ut=s("h4"),pt=s("h5"),ft=s("h6"),mt=s("blockquote"),gt=s("dd"),ht=s("dl"),bt=s("dt"),xt=s("figcaption"),yt=s("figure"),vt=s("hr"),Tt=s("li"),St=s("ol"),kt=s("ul"),Et=s("pre"),wt=s("a"),Ct=s("abbr"),_t=s("b"),Nt=s("bdi"),At=s("bdo"),Lt=s("br"),Mt=s("cite"),Ot=s("code"),Rt=s("data"),Dt=s("dfn"),Ht=s("em"),Bt=s("i"),Kt=s("kbd"),zt=s("mark"),Pt=s("q"),jt=s("rp"),qt=s("rt"),Ut=s("ruby"),Wt=s("s"),Ft=s("samp"),It=s("small"),Vt=s("strong"),$t=s("sub"),Gt=s("sup"),Qt=s("time"),Yt=s("u"),Zt=s("var"),Jt=s("area"),Xt=s("audio"),en=s("img"),tn=s("map"),nn=s("track"),rn=s("video"),on=s("embed"),sn=s("iframe"),an=s("object"),cn=s("param"),ln=s("picture"),dn=s("portal"),un=s("source"),pn=s("svg",y),fn=s("math"),mn=s("canvas"),gn=s("noscript"),hn=s("script"),bn=s("del"),xn=s("ins"),yn=s("caption"),vn=s("col"),Tn=s("colgroup"),Sn=s("table"),kn=s("tbody"),En=s("td"),wn=s("tfoot"),Cn=s("th"),_n=s("thead"),Nn=s("tr"),ye=s("button"),An=s("datalist"),Ln=s("fieldset"),Mn=s("form"),On=s("input"),Rn=s("label"),Dn=s("legend"),Hn=s("meter"),Bn=s("optgroup"),Kn=s("option"),zn=s("output"),Pn=s("progress"),jn=s("select"),qn=s("textarea"),Un=s("details"),Wn=s("dialog"),Fn=s("menu"),In=s("summary"),Vn=s("slot"),$n=s("template"),Gn=s("base"),Qn=s("link"),Yn=s("meta"),Y=s("style"),Zn=s("circle",y),Jn=s("ellipse",y),Xn=s("g",y),er=s("line",y),tr=s("path",y),nr=s("polygon",y),rr=s("polyline",y),or=s("rect",y),ir=s("text",y),sr=s("tspan",y),ar=s("defs",y),cr=s("clipPath",y),lr=s("mask",y),dr=s("pattern",y),ur=s("linearGradient",y),pr=s("radialGradient",y),fr=s("stop",y),mr=s("use",y),gr=s("symbol",y),hr=s("marker",y),br=s("center"),xr=s("font"),yr=s("marquee"),vr=r=>s(r);var _o=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Tr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Sr=new WeakMap;function No(r){let e=r.length-1,n=r[0];for(let p=0;p<e;p++)n+=`\0${p}\0${r[p+1]}`;let t=0,o=n.length;function i(){for(;t<o&&(n[t]===" "||n[t]===" "||n[t]===`
|
|
2
|
-
`||n[t]==="\r");)t++}function a(){if(n.charCodeAt(t)!==0)return-1;let p=t;t++;let g=0;for(;t<o&&n.charCodeAt(t)!==0;)g=g*10+(n.charCodeAt(t)-48),t++;return t<o&&t++,g<0||g>=e?(t=p,-1):g}function c(){let p=t;for(;t<o;){let g=n.charCodeAt(t);if(g>=97&&g<=122||g>=65&&g<=90||g>=48&&g<=57||g===45)t++;else break}return n.slice(p,t)}function l(){if(i(),n[t]!=="=")return{kind:"bool"};t++,i();let p=a();if(p>=0)return{kind:"expr",idx:p};let g=n[t];if(g==='"'||g==="'"){t++;let b=[],B=[],F="";for(;t<o&&n[t]!==g;){let X=a();X>=0?(b.push(F),F="",B.push(X)):F+=n[t++]}return t<o&&t++,b.push(F),B.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:B}}let T=t;for(;t<o;){let b=n.charCodeAt(t);if(b===32||b===9||b===10||b===13||b===62||b===47)break;t++}return{kind:"static",value:n.slice(T,t)}}function d(){let p=[];for(;t<o&&(i(),!(n[t]===">"||n[t]==="/"));){let g=t;for(;t<o;){let b=n.charCodeAt(t);if(b>=97&&b<=122||b>=65&&b<=90||b>=48&&b<=57||b===45||b===58||b===95||b===46)t++;else break}let T=n.slice(g,t);if(!T)break;let v=l();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 u(p){return p.replace(/\s+/g," ")}function f(p){let g="";for(;t<o&&n[t]!=="<";){let v=a();if(v>=0){let b=u(g);b&&p.push({t:1,value:b}),g="",p.push({t:2,idx:v})}else g+=n[t++]}let T=u(g);T&&p.push({t:1,value:T})}function m(){let p=[];for(;t<o&&!(n[t]==="<"&&t+1<o&&n[t+1]==="/");)if(n[t]==="<"){t++;let g=c(),T=d();i();let v=_o.has(g),b=n[t]==="/";if(b&&t++,t<o&&t++,v||b)p.push({t:0,el:{tag:g,svg:Tr.has(g),attrs:T,children:[]}});else{let B=m();n[t]==="<"&&t+1<o&&n[t+1]==="/"&&(t+=2,c(),i(),t<o&&n[t]===">"&&t++),p.push({t:0,el:{tag:g,svg:Tr.has(g),attrs:T,children:B}})}}else f(p);return p}return m()}function Ae(r,e){let n=r.svg?document.createElementNS(y,r.tag):document.createElement(r.tag);for(let t=0;t<r.attrs.length;t++){let o=r.attrs[t];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 a=e[o.idx];if(typeof a=="function")E(n,ge(n,i,a));else if(a!=null){let c=String(a);n.setAttribute(i,j(i)?P(c):c)}break}case 2:{let i=o.statics[0];for(let a=0;a<o.exprs.length;a++)i+=String(e[o.exprs[a]])+o.statics[a+1];n.setAttribute(o.name,i);break}case 3:n.addEventListener(o.name,e[o.idx]);break;case 4:n.setAttribute(o.name,"");break}}for(let t=0;t<r.children.length;t++){let o=r.children[t];switch(o.t){case 0:n.appendChild(Ae(o.el,e));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=e[o.idx];if(typeof i=="function"){let a=document.createComment("");n.appendChild(a),E(n,U(a,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let a=0;a<i.length;a++){let c=i[a];c instanceof Node?n.appendChild(c):c!=null&&typeof c!="boolean"&&n.appendChild(document.createTextNode(String(c)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Le(r,...e){let n=Sr.get(r);if(n||(n=No(r),Sr.set(r,n)),n.length===1&&n[0].t===0)return Ae(n[0].el,e);let t=document.createElement("div");for(let o=0;o<n.length;o++){let i=n[o];switch(i.t){case 0:t.appendChild(Ae(i.el,e));break;case 1:t.appendChild(document.createTextNode(i.value));break;case 2:{let a=e[i.idx];if(a instanceof Node)t.appendChild(a);else if(typeof a=="function"){let c=document.createComment("bind:htm");t.appendChild(c),E(t,U(c,a))}else if(Array.isArray(a))for(let c=0;c<a.length;c++){let l=a[c];l instanceof Node?t.appendChild(l):l!=null&&typeof l!="boolean"&&t.appendChild(document.createTextNode(String(l)))}else a!=null&&typeof a!="boolean"&&t.appendChild(document.createTextNode(String(a)));break}}}return t.childNodes.length===1&&t.firstChild instanceof Element?t.firstChild:t}function kr(r,e){if(!e)throw new Error("[Sibu] mount: container element not found. Make sure the DOM element exists before calling mount().");N(typeof r=="function"||r instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=typeof performance<"u"?performance.now():0,t=typeof r=="function"?r():r,o=typeof performance<"u"?performance.now()-n:0;e.appendChild(t);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:t,container:e,duration:o}),{node:t,unmount(){i&&i.emit("app:unmount",{rootElement:t}),O(t),t.parentNode&&t.parentNode.removeChild(t)}}}var Ao=_();function Er(r){return typeof r=="function"?Er(r()):r instanceof Node?r:document.createTextNode(String(r))}function Lo(r,e){if(e===0)return[];let n=[],t=new Array(e);for(let c=0;c<e;c++){let l=r[c],d=0,u=n.length;for(;d<u;){let f=d+u>>1;r[n[f]]<l?d=f+1:u=f}n[d]=c,t[c]=d>0?n[d-1]:-1}let o=n.length,i=new Array(o),a=n[o-1];for(let c=o-1;c>=0;c--)i[c]=a,a=t[a];return i}function wr(r,e,n){N(typeof r=="function","each: first argument must be a function that returns an array."),N(typeof e=="function","each: second argument must be a render function."),N(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item.");let t=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],a=[],c=i,l=0,d=new Map,u=new Map,f=[],m=[],p=new Uint8Array(0),g=new Map,T=[],v=[],b=!1,B=!1,F=n.key,X=()=>{let Te=r(),k=Te.length,ae=t.parentNode;if(!ae)return;B||(ae.insertBefore(o,t.nextSibling),B=!0),m.length<k&&(m=new Array(k));for(let h=0;h<k;h++)m[h]=F(Te[h]);let ce=m;f.length<k&&(f=new Array(k)),u.clear();for(let h=0;h<k;h++){let A=ce[h],Fe=d.get(A),ee;if(Fe!==void 0)ee=Fe;else try{ee=Er(e(Te[h],h))}catch(Se){Ao&&L(`each: render threw for item at index ${h} (key="${ce[h]}"): ${Se instanceof Error?Se.message:String(Se)}`),ee=document.createComment(`each:error:${h}`)}u.set(A,ee),f[h]=ee}for(let[h,A]of d)u.has(h)||(O(A),A.parentNode&&ae.removeChild(A));if(k===0){l=0;let h=d;d=u,u=h;return}g.clear();for(let h=0;h<l;h++)g.set(c[h],h);T.length<k&&(T=new Array(k),v=new Array(k));let le=0;for(let h=0;h<k;h++){let A=g.get(ce[h]);A!==void 0&&(T[le]=h,v[le]=A,le++)}let We=Lo(v,le);p.length<k?p=new Uint8Array(k):p.fill(0,0,k);for(let h=0;h<We.length;h++)p[T[We[h]]]=1;let de=o;for(let h=k-1;h>=0;h--){let A=f[h];p[h]||A.nextSibling!==de&&ae.insertBefore(A,de),de=A}let ue=c===i?a:i;ue.length<k&&(ue.length=k);for(let h=0;h<k;h++)ue[h]=ce[h];c=ue,l=k;let po=d;d=u,u=po,b=!0};return x(X),b||queueMicrotask(()=>{!b&&t.parentNode&&X()}),t}function _r(r){let e=document.createDocumentFragment();for(let n of r)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let t of n)t==null||typeof t=="boolean"||e.appendChild(Cr(t));else e.appendChild(Cr(n));return e}function Cr(r){if(r==null)return document.createTextNode("");if(r instanceof Node)return r;if(typeof r=="function"){let e=r();return e instanceof Node?e:document.createTextNode(String(e??""))}return document.createTextNode(String(r))}function Nr(r,e){let n=document.createComment("portal"),t=e||document.body,o=null;queueMicrotask(()=>{try{o=r(),t.appendChild(o)}catch(a){console.error("[Portal] Render error:",a)}});let i=new MutationObserver(()=>{!n.isConnected&&o&&(o.remove(),o=null,i.disconnect())});return queueMicrotask(()=>{n.parentNode&&i.observe(n.parentNode,{childList:!0})}),n}var Me=new Map;function Ar(r,e){Me.set(r,e)}function Lr(r){Me.delete(r)}function Oe(r){let e=Me.get(r);return e?e():w({nodes:`[Component "${r}" not found]`})}function Mr(r){let e=w({class:"sibu-dynamic"});function n(){let t=r(),o;typeof t=="function"?o=t():o=Oe(t);for(let i of Array.from(e.childNodes))O(i);e.replaceChildren(o)}return x(n),e}function Or(r,e="default"){return r?.[e]}function Rr(r,e){return x(()=>{e.style.display=r()?"":"none"}),e}function Dr(r,e,n){let t=document.createComment("when"),o=null,i,a=!1,c=()=>{let l=r(),d=t.parentNode;if(!d||a&&l===i)return;i=l,o?.parentNode&&(O(o),o.parentNode.removeChild(o),o=null);let u=l?e():n?n():null;if(u!=null){let f=u instanceof Node?u:document.createTextNode(String(u));d.insertBefore(f,t.nextSibling),o=f}a=!0};return x(c),a||queueMicrotask(()=>{!a&&t.parentNode&&c()}),t}function Hr(r,e,n){let t=document.createComment("match"),o=null,i,a=!1,c=()=>{let l=String(r()),d=t.parentNode;if(!d||a&&l===i)return;i=l,o?.parentNode&&(O(o),o.parentNode.removeChild(o),o=null);let u=e[l]||n;if(u){let f=u();if(f!=null){let m=f instanceof Node?f:document.createTextNode(String(f));d.insertBefore(m,t.nextSibling),o=m}}a=!0};return x(c),a||queueMicrotask(()=>{!a&&t.parentNode&&c()}),t}function Br(r,e,n){let t=document.createComment("keep-alive"),o=new Map,i=[],a=n?.max??0,c,l=null,d=!1,u=()=>{let f=r(),m=t.parentNode;if(!m||d&&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,d=!0;return}if(p=g(),o.set(f,p),i.push(f),a>0&&i.length>a){let T=i.shift(),v=o.get(T);v&&(O(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(T))}}m.insertBefore(p,t.nextSibling),l=p,d=!0};return x(u),d||queueMicrotask(()=>{!d&&t.parentNode&&u()}),t}function Kr(r,e,n){let t=e(r,n);typeof t=="function"&&E(r,t)}var zr=(r,e)=>{let n=t=>{r.contains(t.target)||e()};return document.addEventListener("pointerdown",n,!0),()=>document.removeEventListener("pointerdown",n,!0)},Pr=(r,e)=>{let n=e.duration??500,t=null,o=()=>{t=setTimeout(()=>{e.callback(),t=null},n)},i=()=>{t!==null&&(clearTimeout(t),t=null)};return r.addEventListener("pointerdown",o),r.addEventListener("pointerup",i),r.addEventListener("pointerleave",i),()=>{i(),r.removeEventListener("pointerdown",o),r.removeEventListener("pointerup",i),r.removeEventListener("pointerleave",i)}},jr=r=>{let e='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=t=>{if(t.key!=="Tab")return;let o=Array.from(r.querySelectorAll(e));if(o.length===0)return;let i=o[0],a=o[o.length-1];t.shiftKey&&document.activeElement===i?(t.preventDefault(),a.focus()):!t.shiftKey&&document.activeElement===a&&(t.preventDefault(),i.focus())};return r.addEventListener("keydown",n),()=>r.removeEventListener("keydown",n)};var W=null;function qr(r,e){try{let n=r();return n&&typeof n.then=="function"&&n.catch(t=>{e?e(t,"async"):W?W(t,"async"):console.error("Unhandled async error in Sibu.catchError:",t)}),n}catch(n){return e?e(n,"sync"):W?W(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Ur(r,e){try{return await r()}catch(n){return e?e(n,"async"):W?W(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Wr(r){W=r}var re=0,Re=new Set;function ve(r){re++;try{return r()}finally{re--,re===0&&Mo()}}function Z(r){return re===0?!1:(Re.add(r),!0)}function Fr(){return re>0}function Mo(){for(let r of Re)Ge(r);Re.clear(),Qe()}var Ir=globalThis,De=_();function C(r,e){let n={value:r},t=De?e?.name:void 0,o=e?.equals;t&&(n.__name=t);function i(){return Q(n),n.value}i.__signal=n,t&&(i.__name=t);function a(c){let l=typeof c=="function"?c(n.value):c;if(!(o?o(n.value,l):Object.is(l,n.value))){if(De){let d=n.value;n.value=l;let u=Ir.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&u.emit("signal:update",{signal:n,name:t,oldValue:d,newValue:l})}else n.value=l;Z(n)||me(n)}}if(De){let c=Ir.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&c.emit("signal:create",{signal:n,name:t,getter:i,initial:r})}return[i,a]}var He=!1;function J(){return He}function Be(){He=!0}function Ke(){He=!1}function Vr(r){Be();try{return r()}finally{Ke()}}var $r=globalThis;function Gr(r,e){let n,t=!0;return()=>{let o=r();if(t)t=!1,n=o,G(()=>e(o,void 0));else{let i=n;n=o,G(()=>e(o,i))}}}function oe(r,e){if(N(typeof r=="function","effect: argument must be a function."),J())return()=>{};let n=e?.onError,t=n?()=>{try{r()}catch(c){n(c)}}:r,o=()=>{},i=()=>{o(),o=x(t,i)};o=x(t,i);let a=$r.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return a&&a.emit("effect:create",{effectFn:r}),()=>{let c=$r.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&c.emit("effect:destroy",{effectFn:r}),o()}}function z(r,e){N(typeof r=="function","derived: argument must be a getter function.");let n=e?.name,t={};t._d=!1,t._g=r;let o=()=>{t._d||(t._d=!0)};o._c=1,o._sig=t,x(()=>{t._d=!1,t._v=r()},o);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;function a(){if(fe)return t._d&&(t._d=!1,t._v=r()),t._v;if(Q(t),t._d){let c=t._v;x(()=>{t._d=!1,t._v=r()},o),i&&c!==t._v&&i.emit("computed:update",{signal:t,oldValue:c,newValue:t._v})}return t._v}return n&&(a.__name=n,t.__name=n),a.__signal=t,i&&i.emit("computed:create",{signal:t,name:n,getter:a}),a}function Qr(r,e){if(N(typeof r=="function","watch: first argument must be a getter function."),N(typeof e=="function","watch: second argument must be a callback function."),J())return()=>{};let n,t=!0;return x(()=>{let a=r();if(t){n=a,t=!1;return}Object.is(a,n)||(e(a,n),n=a)})}function Yr(r){N(r!==null&&typeof r=="object"&&!Array.isArray(r),"store: argument must be a plain object. For arrays, use array() instead.");let e={};Object.keys(r).forEach(l=>{let[d,u]=C(r[l]);e[l]=[d,u]});let n=new Proxy({},{get(l,d){if(d in e){let u=e[d][0];return u()}},set(){throw new Error("[Sibu] store: Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),t=()=>{let l={};return Object.keys(e).forEach(d=>{l[d]=e[d][0]()}),l};return[n,{setState:l=>{let d=t(),u=typeof l=="function"?l(d):l;Object.entries(u).forEach(([f,m])=>{f in e&&e[f][1](m)})},reset:()=>{Object.keys(r).forEach(l=>{let d=e[l][1];d(r[l])})},subscribe:l=>{let d=!0;return oe(()=>{let u=t();if(d){d=!1;return}l(u)})},subscribeKey:(l,d)=>{let u,f=!0;return oe(()=>{let m=e[l][0]();if(f){u=m,f=!1;return}if(!Object.is(m,u)){let p=u;u=m,d(m,p)}})},getSnapshot:t}]}function Zr(r){let[e,n]=C(r);return{get current(){return e()},set current(t){n(t)}}}function Jr(r){return z(r)}function Xr(r){return z(r)}function eo(r=[]){let[e,n]=C([...r]);return[e,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let a=[...i];return o=a.pop(),a}),o},shift(){let o;return n(i=>{let a=[...i];return o=a.shift(),a}),o},unshift(...o){n(i=>[...o,...i])},splice(o,i=0,...a){let c=[];return n(l=>{let d=[...l];return c=d.splice(o,i,...a),d}),c},remove(o){n(i=>i.filter((a,c)=>c!==o))},removeWhere(o){n(i=>{let a=i.findIndex(o);return a===-1?i:i.filter((c,l)=>l!==a)})},set(o){n([...o])},update(o,i){n(a=>a.map((c,l)=>l===o?i:c))},updateWhere(o,i){n(a=>a.map(c=>o(c)?i(c):c))},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 to(r=[]){let e=[...r],n=null,t={};function o(){n=null,Z(t)||me(t)}function i(){return Q(t),n===null&&(n=Object.freeze([...e])),n}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,...d){let u=e.splice(c,l,...d);return(u.length>0||d.length>0)&&o(),u},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 d=!1;for(let u=0;u<e.length;u++)if(c(e[u])){let f=l(e[u]);Object.is(e[u],f)||(e[u]=f,d=!0)}d&&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 d=0;d<e.length;d++){let u=c(e[d],d);Object.is(e[d],u)||(e[d]=u,l=!0)}l&&o()},clear(){e.length!==0&&(e=[],o())}}]}function ie(r,e,n){if(Object.is(r,e))return!0;if(r==null||e==null||typeof r!=typeof e||typeof r!="object")return!1;if(r instanceof Date&&e instanceof Date)return r.getTime()===e.getTime();if(r instanceof RegExp&&e instanceof RegExp)return r.toString()===e.toString();if(n||(n=new Set),n.has(r))return!0;if(n.add(r),Array.isArray(r))return!Array.isArray(e)||r.length!==e.length?!1:r.every((i,a)=>ie(i,e[a],n));let t=Object.keys(r),o=Object.keys(e);return t.length!==o.length?!1:t.every(i=>ie(r[i],e[i],n))}function no(r){return C(r,{equals:(e,n)=>ie(e,n)})}function ro(r,e,n){return[z(r,n),i=>{ve(()=>e(i))}]}function se(r,e){try{r()}catch(n){L(`${e}: callback threw: ${n instanceof Error?n.message:String(n)}`)}}function ze(r,e){if(!(typeof document>"u"))if(e){if(e.isConnected){queueMicrotask(()=>{se(r,"onMount")});return}let n=new MutationObserver(()=>{e.isConnected&&(n.disconnect(),se(r,"onMount"))});queueMicrotask(()=>{e.isConnected?se(r,"onMount"):n.observe(document.body,{childList:!0,subtree:!0})})}else queueMicrotask(()=>{se(r,"onMount")})}function oo(r,e){let n=()=>{let t=new MutationObserver(()=>{e.isConnected||(t.disconnect(),se(r,"onUnmount"))});t.observe(document.body,{childList:!0,subtree:!0})};e.isConnected?n():ze(()=>{n()},e)}function io(r,e){E(e,r)}function so(r){let[e,n]=C(r);return{provide(t){n(t)},use(){return e},get(){return e()},set(t){n(t)}}}function Pe(r){let e=null;return function(){if(e)return e();let[t,o]=C("loading"),[i,a]=C(null),c=w({class:"sibu-lazy"});return r().then(l=>{e=l.default;let d=e();c.replaceChildren(d),o("loaded")}).catch(l=>{let d=l instanceof Error?l:new Error(String(l));a(d),o("error"),c.replaceChildren(w({class:"sibu-lazy-error",nodes:`Failed to load component: ${d.message}`}))}),c.appendChild(D({class:"sibu-lazy-loading",nodes:"Loading..."})),c}}function je({nodes:r,fallback:e}){let n=w({class:"sibu-suspense"}),t=e();return n.appendChild(t),queueMicrotask(()=>{try{let o=r();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 Oo=_(),Ro=`
|
|
1
|
+
"use strict";var Sibu=(()=>{var ke=Object.defineProperty;var go=Object.getOwnPropertyDescriptor;var ho=Object.getOwnPropertyNames;var bo=Object.prototype.hasOwnProperty;var Ie=(t,e)=>{for(var r in e)ke(t,r,{get:e[r],enumerable:!0})},xo=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ho(e))!bo.call(t,o)&&o!==r&&ke(t,o,{get:()=>e[o],enumerable:!(n=go(e,o))||n.enumerable});return t};var yo=t=>xo(ke({},"__esModule",{value:!0}),t);var jo={};Ie(jo,{DynamicComponent:()=>Mr,ErrorBoundary:()=>uo,Fragment:()=>_r,KeepAlive:()=>Br,Loading:()=>fo,Portal:()=>Nr,SVG_NS:()=>y,Suspense:()=>je,a:()=>wt,abbr:()=>Ct,action:()=>Kr,address:()=>ct,area:()=>Jt,array:()=>no,article:()=>nt,aside:()=>at,audio:()=>Xt,autoResize:()=>qr,b:()=>_t,base:()=>Gn,batch:()=>ve,bdi:()=>Nt,bdo:()=>At,bindDynamic:()=>Ce,blockquote:()=>mt,body:()=>Xe,br:()=>Lt,button:()=>ye,canvas:()=>mn,caption:()=>yn,catchError:()=>Ur,catchErrorAsync:()=>Wr,center:()=>br,checkLeaks:()=>Ye,circle:()=>Zn,cite:()=>Mt,clickOutside:()=>zr,clipPath:()=>cr,code:()=>Ot,col:()=>vn,colgroup:()=>Tn,context:()=>co,copyOnClick:()=>jr,customElement:()=>vr,data:()=>Rt,datalist:()=>An,dd:()=>gt,deepEqual:()=>ie,deepSignal:()=>oo,defs:()=>ar,del:()=>bn,derived:()=>z,details:()=>Fn,dfn:()=>Dt,dialog:()=>Un,disableSSR:()=>Ke,dispose:()=>O,div:()=>w,dl:()=>ht,dt:()=>bt,each:()=>wr,effect:()=>oe,ellipse:()=>Jn,em:()=>Ht,embed:()=>on,enableSSR:()=>Be,enqueueBatchedSignal:()=>Z,fieldset:()=>Ln,figcaption:()=>xt,figure:()=>yt,font:()=>xr,footer:()=>ot,form:()=>Mn,g:()=>Xn,getSlot:()=>Or,h1:()=>lt,h2:()=>dt,h3:()=>xe,h4:()=>ut,h5:()=>pt,h6:()=>ft,head:()=>Je,header:()=>rt,hr:()=>vt,html:()=>Le,i:()=>Bt,iframe:()=>sn,img:()=>en,input:()=>On,ins:()=>xn,isBatching:()=>Vr,isSSR:()=>J,kbd:()=>Kt,label:()=>Rn,lazy:()=>Pe,legend:()=>Dn,li:()=>Tt,line:()=>er,linearGradient:()=>ur,link:()=>Qn,longPress:()=>Pr,main:()=>st,map:()=>tn,mark:()=>zt,marker:()=>hr,marquee:()=>yr,mask:()=>lr,match:()=>Hr,math:()=>fn,memo:()=>eo,memoFn:()=>to,menu:()=>Wn,meta:()=>Yn,meter:()=>Hn,mount:()=>kr,nav:()=>it,noscript:()=>gn,object:()=>an,ol:()=>St,on:()=>Yr,onCleanup:()=>ao,onMount:()=>ze,onUnmount:()=>so,optgroup:()=>Bn,option:()=>Kn,output:()=>zn,p:()=>be,param:()=>cn,path:()=>tr,pattern:()=>dr,picture:()=>ln,polygon:()=>nr,polyline:()=>rr,portal:()=>dn,pre:()=>Et,progress:()=>Pn,q:()=>Pt,radialGradient:()=>pr,reactiveArray:()=>ro,rect:()=>or,ref:()=>Xr,registerComponent:()=>Ar,registerDisposer:()=>E,resolveComponent:()=>Oe,rp:()=>jt,rt:()=>qt,ruby:()=>Ft,s:()=>Ut,samp:()=>Wt,script:()=>hn,section:()=>tt,select:()=>jn,setGlobalErrorHandler:()=>Ir,show:()=>Rr,signal:()=>C,slot:()=>Vn,small:()=>It,source:()=>un,span:()=>D,stop:()=>fr,store:()=>Jr,strong:()=>Vt,style:()=>Y,sub:()=>$t,summary:()=>In,sup:()=>Gt,svg:()=>pn,symbol:()=>gr,table:()=>Sn,tagFactory:()=>s,tbody:()=>kn,td:()=>En,template:()=>$n,text:()=>ir,textarea:()=>qn,tfoot:()=>wn,th:()=>Cn,thead:()=>_n,time:()=>Qt,title:()=>et,tr:()=>Nn,track:()=>nn,trapFocus:()=>Fr,tspan:()=>sr,u:()=>Yt,ul:()=>kt,unregisterComponent:()=>Lr,untracked:()=>G,use:()=>mr,var_:()=>Zt,video:()=>rn,watch:()=>Zr,when:()=>Dr,withSSR:()=>Gr,writable:()=>io});var Fe={};Ie(Fe,{DynamicComponent:()=>Mr,ErrorBoundary:()=>uo,Fragment:()=>_r,KeepAlive:()=>Br,Loading:()=>fo,Portal:()=>Nr,SVG_NS:()=>y,Suspense:()=>je,a:()=>wt,abbr:()=>Ct,action:()=>Kr,address:()=>ct,area:()=>Jt,array:()=>no,article:()=>nt,aside:()=>at,audio:()=>Xt,autoResize:()=>qr,b:()=>_t,base:()=>Gn,batch:()=>ve,bdi:()=>Nt,bdo:()=>At,bindDynamic:()=>Ce,blockquote:()=>mt,body:()=>Xe,br:()=>Lt,button:()=>ye,canvas:()=>mn,caption:()=>yn,catchError:()=>Ur,catchErrorAsync:()=>Wr,center:()=>br,checkLeaks:()=>Ye,circle:()=>Zn,cite:()=>Mt,clickOutside:()=>zr,clipPath:()=>cr,code:()=>Ot,col:()=>vn,colgroup:()=>Tn,context:()=>co,copyOnClick:()=>jr,customElement:()=>vr,data:()=>Rt,datalist:()=>An,dd:()=>gt,deepEqual:()=>ie,deepSignal:()=>oo,defs:()=>ar,del:()=>bn,derived:()=>z,details:()=>Fn,dfn:()=>Dt,dialog:()=>Un,disableSSR:()=>Ke,dispose:()=>O,div:()=>w,dl:()=>ht,dt:()=>bt,each:()=>wr,effect:()=>oe,ellipse:()=>Jn,em:()=>Ht,embed:()=>on,enableSSR:()=>Be,enqueueBatchedSignal:()=>Z,fieldset:()=>Ln,figcaption:()=>xt,figure:()=>yt,font:()=>xr,footer:()=>ot,form:()=>Mn,g:()=>Xn,getSlot:()=>Or,h1:()=>lt,h2:()=>dt,h3:()=>xe,h4:()=>ut,h5:()=>pt,h6:()=>ft,head:()=>Je,header:()=>rt,hr:()=>vt,html:()=>Le,i:()=>Bt,iframe:()=>sn,img:()=>en,input:()=>On,ins:()=>xn,isBatching:()=>Vr,isSSR:()=>J,kbd:()=>Kt,label:()=>Rn,lazy:()=>Pe,legend:()=>Dn,li:()=>Tt,line:()=>er,linearGradient:()=>ur,link:()=>Qn,longPress:()=>Pr,main:()=>st,map:()=>tn,mark:()=>zt,marker:()=>hr,marquee:()=>yr,mask:()=>lr,match:()=>Hr,math:()=>fn,memo:()=>eo,memoFn:()=>to,menu:()=>Wn,meta:()=>Yn,meter:()=>Hn,mount:()=>kr,nav:()=>it,noscript:()=>gn,object:()=>an,ol:()=>St,on:()=>Yr,onCleanup:()=>ao,onMount:()=>ze,onUnmount:()=>so,optgroup:()=>Bn,option:()=>Kn,output:()=>zn,p:()=>be,param:()=>cn,path:()=>tr,pattern:()=>dr,picture:()=>ln,polygon:()=>nr,polyline:()=>rr,portal:()=>dn,pre:()=>Et,progress:()=>Pn,q:()=>Pt,radialGradient:()=>pr,reactiveArray:()=>ro,rect:()=>or,ref:()=>Xr,registerComponent:()=>Ar,registerDisposer:()=>E,resolveComponent:()=>Oe,rp:()=>jt,rt:()=>qt,ruby:()=>Ft,s:()=>Ut,samp:()=>Wt,script:()=>hn,section:()=>tt,select:()=>jn,setGlobalErrorHandler:()=>Ir,show:()=>Rr,signal:()=>C,slot:()=>Vn,small:()=>It,source:()=>un,span:()=>D,stop:()=>fr,store:()=>Jr,strong:()=>Vt,style:()=>Y,sub:()=>$t,summary:()=>In,sup:()=>Gt,svg:()=>pn,symbol:()=>gr,table:()=>Sn,tagFactory:()=>s,tbody:()=>kn,td:()=>En,template:()=>$n,text:()=>ir,textarea:()=>qn,tfoot:()=>wn,th:()=>Cn,thead:()=>_n,time:()=>Qt,title:()=>et,tr:()=>Nn,track:()=>nn,trapFocus:()=>Fr,tspan:()=>sr,u:()=>Yt,ul:()=>kt,unregisterComponent:()=>Lr,untracked:()=>G,use:()=>mr,var_:()=>Zt,video:()=>rn,watch:()=>Zr,when:()=>Dr,withSSR:()=>Gr,writable:()=>io});function _(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:!0}var Ve=_();function N(t,e){if(Ve&&!t)throw new Error(`[Sibu] ${e}`)}function L(t){Ve&&console.warn(`[Sibu] ${t}`)}function P(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 vo=new Set(["href","src","action","formaction","cite","poster","background","srcset"]);function j(t){return vo.has(t)}var To=_(),V=new Array(32),$=32,R=-1,K=null,So=new WeakMap,q="__s",H=0,S=[],M=new Set;function te(t){try{t()}catch(e){To&&L(`Subscriber threw during notification: ${e instanceof Error?e.message:String(e)}`)}}var pe=0,fe=!1;function x(t,e){e||(e=t),$e(e),++R,R>=$&&($*=2,V.length=$),V[R]=e,K=e;try{t()}finally{R--,K=R>=0?V[R]:null}return()=>$e(e)}function ko(){pe===0&&(++R,R>=$&&($*=2,V.length=$),V[R]=null,K=null,fe=!0),pe++}function Eo(){pe--,pe===0&&(R--,K=R>=0?V[R]:null,fe=!1)}function G(t){ko();try{return t()}finally{Eo()}}function Q(t){if(!K)return;let e=K;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,So.set(t,n),t[q]=n),n.add(K),n.size===1?t.__f=K:t.__f!==void 0&&(t.__f=void 0)}function Ge(t){let e=t[q];if(e)for(let r of e)r._c?I(r):M.has(r)||(M.add(r),S.push(r))}function Qe(){if(!(H>0)){H++;try{let t=0;for(;t<S.length;)te(S[t]),t++}finally{S.length=0,M.clear(),H--}}}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}M.has(r)||(M.add(r),S.push(r));break}let n=e[q];if(!n)break;let o;for(let i of n)if(i._c){i();let a=i._sig;a&&!o?o=a:a&&I(i)}else M.has(i)||(M.add(i),S.push(i));e=o}}function me(t){let e=t.__f;if(e){if(H>0){e._c?I(e):M.has(e)||(M.add(e),S.push(e));return}H++;try{e._c?I(e):te(e);let n=0;for(;n<S.length;)te(S[n]),n++}finally{S.length=0,M.clear(),H--}return}let r=t[q];if(!(!r||r.size===0)){if(H>0){for(let n of r)n._c?I(n):M.has(n)||(M.add(n),S.push(n));return}H++;try{let n=0;for(let i of r)S[n++]=i;for(let i=0;i<n;i++)S[i]._c&&I(S[i]);for(let i=0;i<n;i++)S[i]._c||M.has(S[i])||te(S[i]);let o=n;for(;o<S.length;)te(S[o]),o++}finally{S.length=0,M.clear(),H--}}}function $e(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=_();function ge(t,e,r){function n(){let i;try{i=r()}catch(c){we&&L(`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 a=String(i);(e==="value"||e==="checked")&&e in t?t[e]=e==="checked"?!!i:a:t.setAttribute(e,j(e)?P(a):a)}return x(n)}function Ce(t,e,r){let n=null;function o(){let a;try{a=typeof e=="function"?e():e}catch(d){we&&L(`bindDynamic: name getter threw: ${d instanceof Error?d.message:String(d)}`);return}let c;try{c=typeof r=="function"?r():r}catch(d){we&&L(`bindDynamic: value getter threw: ${d instanceof Error?d.message:String(d)}`);return}if((a[0]==="o"||a[0]==="O")&&(a[1]==="n"||a[1]==="N"))return;n!==null&&n!==a&&t.removeAttribute(n);let l=String(c);(a==="value"||a==="checked")&&a in t?t[a]=a==="checked"?!!c:l:t.setAttribute(a,j(a)?P(l):l),n=a}let i=x(o);return()=>{i(),n!==null&&t.removeAttribute(n)}}var wo=_();function F(t,e){let r=[];function n(){let o;try{o=e()}catch(l){wo&&L(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}for(let l=0;l<r.length;l++){let d=r[l];d.parentNode&&d.parentNode.removeChild(d)}if(o==null||typeof o=="boolean"){r.length=0;return}let i=t.parentNode;if(!i){r.length=0;return}let a=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 d=o[l];if(d==null||typeof d=="boolean")continue;let u=d instanceof Node?d:document.createTextNode(String(d));i.insertBefore(u,a),r[c++]=u}}else{r.length<1&&(r=[null]);let l=o instanceof Node?o:document.createTextNode(String(o));i.insertBefore(l,a),r[c++]=l}r.length=c}return x(n)}var he=new WeakMap,_e=_(),ne=0;function E(t,e){let r=he.get(t);r||(r=[],he.set(t,r)),r.push(e),_e&&ne++}function O(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=he.get(o);if(i){_e&&(ne-=i.length);for(let a of i)a();he.delete(o)}}}function Ye(t=0){return _e?(t>0&&ne>t&&L(`checkLeaks: ${ne} active DOM bindings detected. Expected \u2264${t}. This may indicate a component was removed from the DOM without calling dispose().`),ne):0}var y="http://www.w3.org/2000/svg",Ze=new Map;function Co(t){let e=Ze.get(t);return e!==void 0||(e=t.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`),Ze.set(t,e)),e}function _o(t,e){if(typeof e=="function"){let n=x(()=>{t.setAttribute("style",e())});E(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=Co(n);if(typeof o=="function"){let a=o,c=x(()=>{r.style.setProperty(i,Ee(String(a())))});E(t,c)}else r.style.setProperty(i,Ee(String(o)))}}function No(t,e){if(typeof e=="string"){t.setAttribute("class",e);return}if(typeof e=="function"){let i=x(()=>{t.setAttribute("class",e())});E(t,i);return}let r=e,n=!1,o="";for(let i in r){let a=r[i];if(typeof a=="function"){n=!0;break}a&&(o=o?`${o} ${i}`:i)}if(n){let a=x(()=>{let c="";for(let l in r){let d=r[l];(typeof d=="function"?d():d)&&(c=c?`${c} ${l}`:l)}t.setAttribute("class",c)});E(t,a)}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),E(t,F(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),E(t,F(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 a=document.createComment("");t.appendChild(a),E(t,F(a,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 s=(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,a=i.class;a!=null&&No(o,a);let c=i.id;c!=null&&(o.id=c);let l=i.nodes;l!=null&&Ne(o,l);let d=i.on;if(d)for(let m in d)o.addEventListener(m,d[m]);let u=i.style;u!=null&&_o(o,u);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")E(o,ge(o,m,p));else if(p===!0)o.setAttribute(m,"");else{let g=String(p);o.setAttribute(m,j(m)?P(g):g)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var ci=s("html"),Je=s("head"),Xe=s("body"),et=s("title"),w=s("div"),D=s("span"),tt=s("section"),nt=s("article"),rt=s("header"),ot=s("footer"),it=s("nav"),st=s("main"),at=s("aside"),ct=s("address"),be=s("p"),lt=s("h1"),dt=s("h2"),xe=s("h3"),ut=s("h4"),pt=s("h5"),ft=s("h6"),mt=s("blockquote"),gt=s("dd"),ht=s("dl"),bt=s("dt"),xt=s("figcaption"),yt=s("figure"),vt=s("hr"),Tt=s("li"),St=s("ol"),kt=s("ul"),Et=s("pre"),wt=s("a"),Ct=s("abbr"),_t=s("b"),Nt=s("bdi"),At=s("bdo"),Lt=s("br"),Mt=s("cite"),Ot=s("code"),Rt=s("data"),Dt=s("dfn"),Ht=s("em"),Bt=s("i"),Kt=s("kbd"),zt=s("mark"),Pt=s("q"),jt=s("rp"),qt=s("rt"),Ft=s("ruby"),Ut=s("s"),Wt=s("samp"),It=s("small"),Vt=s("strong"),$t=s("sub"),Gt=s("sup"),Qt=s("time"),Yt=s("u"),Zt=s("var"),Jt=s("area"),Xt=s("audio"),en=s("img"),tn=s("map"),nn=s("track"),rn=s("video"),on=s("embed"),sn=s("iframe"),an=s("object"),cn=s("param"),ln=s("picture"),dn=s("portal"),un=s("source"),pn=s("svg",y),fn=s("math"),mn=s("canvas"),gn=s("noscript"),hn=s("script"),bn=s("del"),xn=s("ins"),yn=s("caption"),vn=s("col"),Tn=s("colgroup"),Sn=s("table"),kn=s("tbody"),En=s("td"),wn=s("tfoot"),Cn=s("th"),_n=s("thead"),Nn=s("tr"),ye=s("button"),An=s("datalist"),Ln=s("fieldset"),Mn=s("form"),On=s("input"),Rn=s("label"),Dn=s("legend"),Hn=s("meter"),Bn=s("optgroup"),Kn=s("option"),zn=s("output"),Pn=s("progress"),jn=s("select"),qn=s("textarea"),Fn=s("details"),Un=s("dialog"),Wn=s("menu"),In=s("summary"),Vn=s("slot"),$n=s("template"),Gn=s("base"),Qn=s("link"),Yn=s("meta"),Y=s("style"),Zn=s("circle",y),Jn=s("ellipse",y),Xn=s("g",y),er=s("line",y),tr=s("path",y),nr=s("polygon",y),rr=s("polyline",y),or=s("rect",y),ir=s("text",y),sr=s("tspan",y),ar=s("defs",y),cr=s("clipPath",y),lr=s("mask",y),dr=s("pattern",y),ur=s("linearGradient",y),pr=s("radialGradient",y),fr=s("stop",y),mr=s("use",y),gr=s("symbol",y),hr=s("marker",y),br=s("center"),xr=s("font"),yr=s("marquee"),vr=t=>s(t);var Ao=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Tr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Sr=new WeakMap;function Lo(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 a(){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=a();if(p>=0)return{kind:"expr",idx:p};let g=r[n];if(g==='"'||g==="'"){n++;let b=[],B=[],W="";for(;n<o&&r[n]!==g;){let X=a();X>=0?(b.push(W),W="",B.push(X)):W+=r[n++]}return n<o&&n++,b.push(W),B.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:B}}let T=n;for(;n<o;){let b=r.charCodeAt(n);if(b===32||b===9||b===10||b===13||b===62||b===47)break;n++}return{kind:"static",value:r.slice(T,n)}}function d(){let p=[];for(;n<o&&(i(),!(r[n]===">"||r[n]==="/"));){let g=n;for(;n<o;){let b=r.charCodeAt(n);if(b>=97&&b<=122||b>=65&&b<=90||b>=48&&b<=57||b===45||b===58||b===95||b===46)n++;else break}let T=r.slice(g,n);if(!T)break;let v=l();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 u(p){return p.replace(/\s+/g," ")}function f(p){let g="";for(;n<o&&r[n]!=="<";){let v=a();if(v>=0){let b=u(g);b&&p.push({t:1,value:b}),g="",p.push({t:2,idx:v})}else g+=r[n++]}let T=u(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=d();i();let v=Ao.has(g),b=r[n]==="/";if(b&&n++,n<o&&n++,v||b)p.push({t:0,el:{tag:g,svg:Tr.has(g),attrs:T,children:[]}});else{let B=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:Tr.has(g),attrs:T,children:B}})}}else f(p);return p}return m()}function Ae(t,e){let r=t.svg?document.createElementNS(y,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 a=e[o.idx];if(typeof a=="function")E(r,ge(r,i,a));else if(a!=null){let c=String(a);r.setAttribute(i,j(i)?P(c):c)}break}case 2:{let i=o.statics[0];for(let a=0;a<o.exprs.length;a++)i+=String(e[o.exprs[a]])+o.statics[a+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 a=document.createComment("");r.appendChild(a),E(r,F(a,i))}else if(i instanceof Node)r.appendChild(i);else if(Array.isArray(i))for(let a=0;a<i.length;a++){let c=i[a];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=Sr.get(t);if(r||(r=Lo(t),Sr.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 a=e[i.idx];if(a instanceof Node)n.appendChild(a);else if(typeof a=="function"){let c=document.createComment("bind:htm");n.appendChild(c),E(n,F(c,a))}else if(Array.isArray(a))for(let c=0;c<a.length;c++){let l=a[c];l instanceof Node?n.appendChild(l):l!=null&&typeof l!="boolean"&&n.appendChild(document.createTextNode(String(l)))}else a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function kr(t,e){if(!e)throw new Error("[Sibu] mount: container element not found. Make sure the DOM element exists before calling mount().");N(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}),O(n),n.parentNode&&n.parentNode.removeChild(n)}}}var Mo=_();function Er(t){return typeof t=="function"?Er(t()):t instanceof Node?t:document.createTextNode(String(t))}function Oo(t,e){if(e===0)return[];let r=[],n=new Array(e);for(let c=0;c<e;c++){let l=t[c],d=0,u=r.length;for(;d<u;){let f=d+u>>1;t[r[f]]<l?d=f+1:u=f}r[d]=c,n[c]=d>0?r[d-1]:-1}let o=r.length,i=new Array(o),a=r[o-1];for(let c=o-1;c>=0;c--)i[c]=a,a=n[a];return i}function wr(t,e,r){N(typeof t=="function","each: first argument must be a function that returns an array."),N(typeof e=="function","each: second argument must be a render function."),N(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=[],a=[],c=i,l=0,d=new Map,u=new Map,f=[],m=[],p=new Uint8Array(0),g=new Map,T=[],v=[],b=!1,B=!1,W=r.key,X=()=>{let Te=t(),k=Te.length,ae=n.parentNode;if(!ae)return;B||(ae.insertBefore(o,n.nextSibling),B=!0),m.length<k&&(m=new Array(k));for(let h=0;h<k;h++)m[h]=W(Te[h]);let ce=m;f.length<k&&(f=new Array(k)),u.clear();for(let h=0;h<k;h++){let A=ce[h],We=d.get(A),ee;if(We!==void 0)ee=We;else try{ee=Er(e(Te[h],h))}catch(Se){Mo&&L(`each: render threw for item at index ${h} (key="${ce[h]}"): ${Se instanceof Error?Se.message:String(Se)}`),ee=document.createComment(`each:error:${h}`)}u.set(A,ee),f[h]=ee}for(let[h,A]of d)u.has(h)||(O(A),A.parentNode&&ae.removeChild(A));if(k===0){l=0;let h=d;d=u,u=h;return}g.clear();for(let h=0;h<l;h++)g.set(c[h],h);T.length<k&&(T=new Array(k),v=new Array(k));let le=0;for(let h=0;h<k;h++){let A=g.get(ce[h]);A!==void 0&&(T[le]=h,v[le]=A,le++)}let Ue=Oo(v,le);p.length<k?p=new Uint8Array(k):p.fill(0,0,k);for(let h=0;h<Ue.length;h++)p[T[Ue[h]]]=1;let de=o;for(let h=k-1;h>=0;h--){let A=f[h];p[h]||A.nextSibling!==de&&ae.insertBefore(A,de),de=A}let ue=c===i?a:i;ue.length<k&&(ue.length=k);for(let h=0;h<k;h++)ue[h]=ce[h];c=ue,l=k;let mo=d;d=u,u=mo,b=!0};return x(X),b||queueMicrotask(()=>{!b&&n.parentNode&&X()}),n}function _r(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(Cr(n));else e.appendChild(Cr(r));return e}function Cr(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 Nr(t,e){let r=document.createComment("portal"),n=e||document.body,o=null;queueMicrotask(()=>{try{o=t(),n.appendChild(o)}catch(a){console.error("[Portal] Render error:",a)}});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 Ar(t,e){Me.set(t,e)}function Lr(t){Me.delete(t)}function Oe(t){let e=Me.get(t);return e?e():w({nodes:`[Component "${t}" not found]`})}function Mr(t){let e=w({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))O(i);e.replaceChildren(o)}return x(r),e}function Or(t,e="default"){return t?.[e]}function Rr(t,e){return x(()=>{e.style.display=t()?"":"none"}),e}function Dr(t,e,r){let n=document.createComment("when"),o=null,i,a=!1,c=()=>{let l=t(),d=n.parentNode;if(!d||a&&l===i)return;i=l,o?.parentNode&&(O(o),o.parentNode.removeChild(o),o=null);let u=l?e():r?r():null;if(u!=null){let f=u instanceof Node?u:document.createTextNode(String(u));d.insertBefore(f,n.nextSibling),o=f}a=!0};return x(c),a||queueMicrotask(()=>{!a&&n.parentNode&&c()}),n}function Hr(t,e,r){let n=document.createComment("match"),o=null,i,a=!1,c=()=>{let l=String(t()),d=n.parentNode;if(!d||a&&l===i)return;i=l,o?.parentNode&&(O(o),o.parentNode.removeChild(o),o=null);let u=e[l]||r;if(u){let f=u();if(f!=null){let m=f instanceof Node?f:document.createTextNode(String(f));d.insertBefore(m,n.nextSibling),o=m}}a=!0};return x(c),a||queueMicrotask(()=>{!a&&n.parentNode&&c()}),n}function Br(t,e,r){let n=document.createComment("keep-alive"),o=new Map,i=[],a=r?.max??0,c,l=null,d=!1,u=()=>{let f=t(),m=n.parentNode;if(!m||d&&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,d=!0;return}if(p=g(),o.set(f,p),i.push(f),a>0&&i.length>a){let T=i.shift(),v=o.get(T);v&&(O(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(T))}}m.insertBefore(p,n.nextSibling),l=p,d=!0};return x(u),d||queueMicrotask(()=>{!d&&n.parentNode&&u()}),n}function Kr(t,e,r){let n=e(t,r);typeof n=="function"&&E(t,n)}var zr=(t,e)=>{let r=n=>{t.contains(n.target)||e()};return document.addEventListener("pointerdown",r,!0),()=>document.removeEventListener("pointerdown",r,!0)},Pr=(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)}},jr=(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)},Fr=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],a=o[o.length-1];n.shiftKey&&document.activeElement===i?(n.preventDefault(),a.focus()):!n.shiftKey&&document.activeElement===a&&(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 Wr(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 Ir(t){U=t}var re=0,Re=new Set;function ve(t){re++;try{return t()}finally{re--,re===0&&Ro()}}function Z(t){return re===0?!1:(Re.add(t),!0)}function Vr(){return re>0}function Ro(){for(let t of Re)Ge(t);Re.clear(),Qe()}var $r=globalThis,De=_();function C(t,e){let r={value:t},n=De?e?.name:void 0,o=e?.equals;n&&(r.__name=n);function i(){return Q(r),r.value}i.__signal=r,n&&(i.__name=n);function a(c){let l=typeof c=="function"?c(r.value):c;if(!(o?o(r.value,l):Object.is(l,r.value))){if(De){let d=r.value;r.value=l;let u=$r.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&u.emit("signal:update",{signal:r,name:n,oldValue:d,newValue:l})}else r.value=l;Z(r)||me(r)}}if(De){let c=$r.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&c.emit("signal:create",{signal:r,name:n,getter:i,initial:t})}return[i,a]}var He=!1;function J(){return He}function Be(){He=!0}function Ke(){He=!1}function Gr(t){Be();try{return t()}finally{Ke()}}var Qr=globalThis;function Yr(t,e){let r,n=!0;return()=>{let o=t();if(n)n=!1,r=o,G(()=>e(o,void 0));else{let i=r;r=o,G(()=>e(o,i))}}}function oe(t,e){if(N(typeof t=="function","effect: argument must be a function."),J())return()=>{};let r=e?.onError,n=r?()=>{try{t()}catch(c){r(c)}}:t,o=()=>{},i=()=>{o(),o=x(n,i)};o=x(n,i);let a=Qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return a&&a.emit("effect:create",{effectFn:t}),()=>{let c=Qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&c.emit("effect:destroy",{effectFn:t}),o()}}function z(t,e){N(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,x(()=>{n._d=!1,n._v=t()},o);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;function a(){if(fe)return n._d&&(n._d=!1,n._v=t()),n._v;if(Q(n),n._d){let c=n._v;x(()=>{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&&(a.__name=r,n.__name=r),a.__signal=n,i&&i.emit("computed:create",{signal:n,name:r,getter:a}),a}function Zr(t,e){if(N(typeof t=="function","watch: first argument must be a getter function."),N(typeof e=="function","watch: second argument must be a callback function."),J())return()=>{};let r,n=!0;return x(()=>{let a=t();if(n){r=a,n=!1;return}Object.is(a,r)||(e(a,r),r=a)})}function Jr(t){N(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[d,u]=C(t[l]);e[l]=[d,u]});let r=new Proxy({},{get(l,d){if(d in e){let u=e[d][0];return u()}},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(d=>{l[d]=e[d][0]()}),l};return[r,{setState:l=>{let d=n(),u=typeof l=="function"?l(d):l;Object.entries(u).forEach(([f,m])=>{f in e&&e[f][1](m)})},reset:()=>{Object.keys(t).forEach(l=>{let d=e[l][1];d(t[l])})},subscribe:l=>{let d=!0;return oe(()=>{let u=n();if(d){d=!1;return}l(u)})},subscribeKey:(l,d)=>{let u,f=!0;return oe(()=>{let m=e[l][0]();if(f){u=m,f=!1;return}if(!Object.is(m,u)){let p=u;u=m,d(m,p)}})},getSnapshot:n}]}function Xr(t){let[e,r]=C(t);return{get current(){return e()},set current(n){r(n)}}}function eo(t){return z(t)}function to(t){return z(t)}function no(t=[]){let[e,r]=C([...t]);return[e,{push(...o){r(i=>[...i,...o])},pop(){let o;return r(i=>{let a=[...i];return o=a.pop(),a}),o},shift(){let o;return r(i=>{let a=[...i];return o=a.shift(),a}),o},unshift(...o){r(i=>[...o,...i])},splice(o,i=0,...a){let c=[];return r(l=>{let d=[...l];return c=d.splice(o,i,...a),d}),c},remove(o){r(i=>i.filter((a,c)=>c!==o))},removeWhere(o){r(i=>{let a=i.findIndex(o);return a===-1?i:i.filter((c,l)=>l!==a)})},set(o){r([...o])},update(o,i){r(a=>a.map((c,l)=>l===o?i:c))},updateWhere(o,i){r(a=>a.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 ro(t=[]){let e=[...t],r=null,n={};function o(){r=null,Z(n)||me(n)}function i(){return Q(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,...d){let u=e.splice(c,l,...d);return(u.length>0||d.length>0)&&o(),u},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 d=!1;for(let u=0;u<e.length;u++)if(c(e[u])){let f=l(e[u]);Object.is(e[u],f)||(e[u]=f,d=!0)}d&&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 d=0;d<e.length;d++){let u=c(e[d],d);Object.is(e[d],u)||(e[d]=u,l=!0)}l&&o()},clear(){e.length!==0&&(e=[],o())}}]}function ie(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,a)=>ie(i,e[a],r));let n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(i=>ie(t[i],e[i],r))}function oo(t){return C(t,{equals:(e,r)=>ie(e,r)})}function io(t,e,r){return[z(t,r),i=>{ve(()=>e(i))}]}function se(t,e){try{t()}catch(r){L(`${e}: callback threw: ${r instanceof Error?r.message:String(r)}`)}}function ze(t,e){if(!(typeof document>"u"))if(e){if(e.isConnected){queueMicrotask(()=>{se(t,"onMount")});return}let r=new MutationObserver(()=>{e.isConnected&&(r.disconnect(),se(t,"onMount"))});queueMicrotask(()=>{e.isConnected?se(t,"onMount"):r.observe(document.body,{childList:!0,subtree:!0})})}else queueMicrotask(()=>{se(t,"onMount")})}function so(t,e){let r=()=>{let n=new MutationObserver(()=>{e.isConnected||(n.disconnect(),se(t,"onUnmount"))});n.observe(document.body,{childList:!0,subtree:!0})};e.isConnected?r():ze(()=>{r()},e)}function ao(t,e){E(e,t)}function co(t){let[e,r]=C(t);return{provide(n){r(n)},use(){return e},get(){return e()},set(n){r(n)}}}function Pe(t){let e=null;return function(){if(e)return e();let[n,o]=C("loading"),[i,a]=C(null),c=w({class:"sibu-lazy"});return t().then(l=>{e=l.default;let d=e();c.replaceChildren(d),o("loaded")}).catch(l=>{let d=l instanceof Error?l:new Error(String(l));a(d),o("error"),c.replaceChildren(w({class:"sibu-lazy-error",nodes:`Failed to load component: ${d.message}`}))}),c.appendChild(D({class:"sibu-lazy-loading",nodes:"Loading..."})),c}}function je({nodes:t,fallback:e}){let r=w({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 Do=_(),Ho=`
|
|
3
3
|
.sibu-error-boundary {
|
|
4
4
|
position: relative;
|
|
5
5
|
}
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
.sibu-error-fallback .sibu-error-btn:active {
|
|
60
60
|
transform: translateY(0);
|
|
61
61
|
}
|
|
62
|
-
`,
|
|
62
|
+
`,lo=!1;function Bo(){if(!lo&&typeof document<"u"){let t=Y({nodes:Ho});document.head.appendChild(t),lo=!0}}var qe=new WeakMap;function Ko(t,e,r){let n=qe.get(t);n||(n=new Map,qe.set(t,n));let o=e.message;return n.has(o)||n.set(o,t(e,r)),n.get(o)}function uo({nodes:t,fallback:e,onError:r}){Bo();let[n,o]=C(null),i=()=>{e&&qe.delete(e),o(null)},a=u=>{let f=u instanceof Error?u:new Error(String(u));return o(f),r?.(f),f},c=(u,f)=>w({class:"sibu-error-fallback",nodes:[xe({nodes:"Something went wrong",class:"sibu-error-title"}),be({nodes:Do?u.message:"An unexpected error occurred. Please try again.",class:"sibu-error-message"}),ye({nodes:"Retry",class:"sibu-error-btn",on:{click:f}})]}),l=u=>{let f=e||c;try{return Ko(f,u,i)}catch(m){let p=m instanceof Error?m:new Error(String(m));return queueMicrotask(()=>{d.parentNode&&d.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:p}}))}),document.createComment("error-boundary-failed")}},d=w({class:"sibu-error-boundary",nodes:()=>{let u=n();if(u)return l(u);try{let f=t();if(f&&typeof f.then=="function"){let m=w({class:"sibu-error-async"});return m.appendChild(D({class:"sibu-lazy-loading",nodes:"Loading..."})),f.then(p=>{m.replaceChildren(p)}).catch(p=>{let g=a(p);m.replaceChildren(l(g))}),m}return f}catch(f){let m=a(f);return l(m)}}});return d.addEventListener("sibu:error-propagate",u=>{if(n())return;u.stopPropagation();let m=u.detail?.error;m&&a(m)}),d}var zo=`
|
|
63
63
|
@keyframes sibu-spin {
|
|
64
64
|
to { transform: rotate(360deg); }
|
|
65
65
|
}
|
|
@@ -112,4 +112,4 @@
|
|
|
112
112
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
113
113
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
114
114
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
115
|
-
`,
|
|
115
|
+
`,po=!1;function Po(){!po&&typeof document<"u"&&(document.head.appendChild(Y({nodes:zo})),po=!0)}function fo(t={}){Po();let{text:e,variant:r="spinner",size:n="md"}=t,o=n!=="md"?` sibu-loading-${n}`:"";return r==="dots"?w({class:`sibu-loading${o}`,nodes:[w({class:"sibu-loading-dots",nodes:[D({class:"sibu-loading-dot"}),D({class:"sibu-loading-dot"}),D({class:"sibu-loading-dot"})]}),e?D({class:"sibu-loading-text",nodes:e}):null].filter(Boolean)}):w({class:`sibu-loading${o}`,nodes:[w({class:"sibu-loading-spinner"}),e?D({class:"sibu-loading-text",nodes:e}):null].filter(Boolean)})}typeof window<"u"&&(window.Sibu=Fe);return yo(jo);})();
|
|
@@ -208,6 +208,7 @@ __export(index_exports, {
|
|
|
208
208
|
article: () => article,
|
|
209
209
|
aside: () => aside,
|
|
210
210
|
audio: () => audio,
|
|
211
|
+
autoResize: () => autoResize,
|
|
211
212
|
b: () => b,
|
|
212
213
|
base: () => base,
|
|
213
214
|
batch: () => batch,
|
|
@@ -232,6 +233,7 @@ __export(index_exports, {
|
|
|
232
233
|
col: () => col,
|
|
233
234
|
colgroup: () => colgroup,
|
|
234
235
|
context: () => context,
|
|
236
|
+
copyOnClick: () => copyOnClick,
|
|
235
237
|
customElement: () => customElement,
|
|
236
238
|
data: () => data,
|
|
237
239
|
datalist: () => datalist,
|
|
@@ -1189,6 +1191,24 @@ var longPress = (element, options) => {
|
|
|
1189
1191
|
element.removeEventListener("pointerleave", cancel);
|
|
1190
1192
|
};
|
|
1191
1193
|
};
|
|
1194
|
+
var copyOnClick = (element, getText) => {
|
|
1195
|
+
const handler = () => {
|
|
1196
|
+
const text2 = typeof getText === "function" ? getText() : element.textContent ?? "";
|
|
1197
|
+
navigator.clipboard.writeText(text2);
|
|
1198
|
+
};
|
|
1199
|
+
element.addEventListener("click", handler);
|
|
1200
|
+
return () => element.removeEventListener("click", handler);
|
|
1201
|
+
};
|
|
1202
|
+
var autoResize = (element) => {
|
|
1203
|
+
const resize = () => {
|
|
1204
|
+
element.style.overflow = "hidden";
|
|
1205
|
+
element.style.height = "auto";
|
|
1206
|
+
element.style.height = `${element.scrollHeight}px`;
|
|
1207
|
+
};
|
|
1208
|
+
resize();
|
|
1209
|
+
element.addEventListener("input", resize);
|
|
1210
|
+
return () => element.removeEventListener("input", resize);
|
|
1211
|
+
};
|
|
1192
1212
|
var trapFocus = (element) => {
|
|
1193
1213
|
const focusable = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
1194
1214
|
const handler = (e) => {
|
|
@@ -1984,6 +2004,8 @@ export {
|
|
|
1984
2004
|
action,
|
|
1985
2005
|
clickOutside,
|
|
1986
2006
|
longPress,
|
|
2007
|
+
copyOnClick,
|
|
2008
|
+
autoResize,
|
|
1987
2009
|
trapFocus,
|
|
1988
2010
|
catchError,
|
|
1989
2011
|
catchErrorAsync,
|
|
@@ -81,6 +81,9 @@ function hydrateNode(serverNode, clientNode) {
|
|
|
81
81
|
hydrateNode(serverChildren[i], clientChildren[i]);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
+
function trustHTML(html) {
|
|
85
|
+
return html;
|
|
86
|
+
}
|
|
84
87
|
function renderToDocument(component, options = {}) {
|
|
85
88
|
let content;
|
|
86
89
|
try {
|
|
@@ -278,6 +281,7 @@ function escapeAttr(str) {
|
|
|
278
281
|
export {
|
|
279
282
|
renderToString,
|
|
280
283
|
hydrate,
|
|
284
|
+
trustHTML,
|
|
281
285
|
renderToDocument,
|
|
282
286
|
renderToStream,
|
|
283
287
|
collectStream,
|
|
@@ -67,6 +67,34 @@ function max(maxVal, message) {
|
|
|
67
67
|
function custom(fn, message) {
|
|
68
68
|
return (value) => fn(value) ? null : message;
|
|
69
69
|
}
|
|
70
|
+
function bindField(field, extras) {
|
|
71
|
+
const fieldOn = {
|
|
72
|
+
input: (e) => {
|
|
73
|
+
const target = e.target;
|
|
74
|
+
if (target.type === "checkbox") {
|
|
75
|
+
field.set(target.checked);
|
|
76
|
+
} else {
|
|
77
|
+
field.set(target.value);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
change: (e) => {
|
|
81
|
+
const target = e.target;
|
|
82
|
+
if ("checked" in target && target.type === "checkbox") {
|
|
83
|
+
field.set(target.checked);
|
|
84
|
+
} else {
|
|
85
|
+
field.set(target.value);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
blur: () => field.touch()
|
|
89
|
+
};
|
|
90
|
+
const { on: extraOn, value: _ignoreValue, ...restExtras } = extras ?? {};
|
|
91
|
+
const mergedOn = extraOn && typeof extraOn === "object" ? { ...fieldOn, ...extraOn } : fieldOn;
|
|
92
|
+
return {
|
|
93
|
+
value: field.value,
|
|
94
|
+
on: mergedOn,
|
|
95
|
+
...restExtras
|
|
96
|
+
};
|
|
97
|
+
}
|
|
70
98
|
function form(config) {
|
|
71
99
|
const fieldEntries = Object.entries(config);
|
|
72
100
|
const fieldMap = {};
|
|
@@ -445,10 +473,19 @@ function announce(message, priority = "polite") {
|
|
|
445
473
|
|
|
446
474
|
// src/ui/scopedStyle.ts
|
|
447
475
|
var scopeCounter = 0;
|
|
476
|
+
function sanitizeCSS(css) {
|
|
477
|
+
let sanitized = css.replace(/@import\s+[^;]+;/gi, "/* @import removed */");
|
|
478
|
+
sanitized = sanitized.replace(/url\s*\(\s*(?:"[^"]*"|'[^']*'|[^)]*)\s*\)/gi, "/* url() removed */");
|
|
479
|
+
sanitized = sanitized.replace(/expression\s*\(\s*(?:"[^"]*"|'[^']*'|[^)]*)\s*\)/gi, "/* expression() removed */");
|
|
480
|
+
sanitized = sanitized.replace(/-moz-binding\s*:[^;]+;/gi, "/* -moz-binding removed */");
|
|
481
|
+
sanitized = sanitized.replace(/behavior\s*:[^;]+;/gi, "/* behavior removed */");
|
|
482
|
+
return sanitized;
|
|
483
|
+
}
|
|
448
484
|
function scopedStyle(css) {
|
|
449
485
|
const id = `sibu-s${scopeCounter++}`;
|
|
450
486
|
const attr = `data-${id}`;
|
|
451
|
-
const
|
|
487
|
+
const safeCss = sanitizeCSS(css);
|
|
488
|
+
const scopedCSS = safeCss.replace(/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g, (match, selector, delimiter) => {
|
|
452
489
|
const trimmed = selector.trim();
|
|
453
490
|
if (trimmed.startsWith("@") || trimmed.startsWith("from") || trimmed.startsWith("to") || /^\d+%$/.test(trimmed)) {
|
|
454
491
|
return match;
|
|
@@ -626,7 +663,16 @@ function toast(options) {
|
|
|
626
663
|
timers.delete(id);
|
|
627
664
|
}
|
|
628
665
|
}
|
|
629
|
-
return {
|
|
666
|
+
return {
|
|
667
|
+
toasts,
|
|
668
|
+
show,
|
|
669
|
+
info: (message) => show(message, "info"),
|
|
670
|
+
success: (message) => show(message, "success"),
|
|
671
|
+
error: (message) => show(message, "error"),
|
|
672
|
+
warning: (message) => show(message, "warning"),
|
|
673
|
+
dismiss,
|
|
674
|
+
dismissAll
|
|
675
|
+
};
|
|
630
676
|
}
|
|
631
677
|
|
|
632
678
|
// src/ui/infiniteScroll.ts
|
|
@@ -845,6 +891,7 @@ export {
|
|
|
845
891
|
min,
|
|
846
892
|
max,
|
|
847
893
|
custom,
|
|
894
|
+
bindField,
|
|
848
895
|
form,
|
|
849
896
|
VirtualList,
|
|
850
897
|
intersection,
|
|
@@ -409,26 +409,75 @@ function fileUpload(options) {
|
|
|
409
409
|
function contentEditable() {
|
|
410
410
|
const [content, setContent] = signal("");
|
|
411
411
|
const [isFocused, setFocused] = signal(false);
|
|
412
|
-
function
|
|
413
|
-
if (typeof
|
|
414
|
-
|
|
412
|
+
function wrapSelection(tagName) {
|
|
413
|
+
if (typeof window === "undefined") return;
|
|
414
|
+
const selection = window.getSelection();
|
|
415
|
+
if (!selection || selection.rangeCount === 0 || selection.isCollapsed) return;
|
|
416
|
+
const range = selection.getRangeAt(0);
|
|
417
|
+
const ancestor = range.commonAncestorContainer;
|
|
418
|
+
const existingWrap = findAncestorByTag(
|
|
419
|
+
ancestor instanceof HTMLElement ? ancestor : ancestor.parentElement,
|
|
420
|
+
tagName
|
|
421
|
+
);
|
|
422
|
+
let targetNode = null;
|
|
423
|
+
if (existingWrap) {
|
|
424
|
+
const parent = existingWrap.parentNode;
|
|
425
|
+
if (parent) {
|
|
426
|
+
const firstChild = existingWrap.firstChild;
|
|
427
|
+
const lastChild = existingWrap.lastChild;
|
|
428
|
+
while (existingWrap.firstChild) {
|
|
429
|
+
parent.insertBefore(existingWrap.firstChild, existingWrap);
|
|
430
|
+
}
|
|
431
|
+
parent.removeChild(existingWrap);
|
|
432
|
+
if (firstChild && lastChild) {
|
|
433
|
+
const newRange = document.createRange();
|
|
434
|
+
newRange.setStartBefore(firstChild);
|
|
435
|
+
newRange.setEndAfter(lastChild);
|
|
436
|
+
selection.removeAllRanges();
|
|
437
|
+
selection.addRange(newRange);
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
} else {
|
|
442
|
+
const wrapper = document.createElement(tagName);
|
|
443
|
+
try {
|
|
444
|
+
range.surroundContents(wrapper);
|
|
445
|
+
} catch {
|
|
446
|
+
const fragment = range.extractContents();
|
|
447
|
+
wrapper.appendChild(fragment);
|
|
448
|
+
range.insertNode(wrapper);
|
|
449
|
+
}
|
|
450
|
+
targetNode = wrapper;
|
|
451
|
+
}
|
|
452
|
+
if (targetNode) {
|
|
453
|
+
selection.removeAllRanges();
|
|
454
|
+
const newRange = document.createRange();
|
|
455
|
+
newRange.selectNodeContents(targetNode);
|
|
456
|
+
selection.addRange(newRange);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
function findAncestorByTag(el, tagName) {
|
|
460
|
+
const upper = tagName.toUpperCase();
|
|
461
|
+
while (el) {
|
|
462
|
+
if (el.tagName === upper) return el;
|
|
463
|
+
el = el.parentElement;
|
|
415
464
|
}
|
|
465
|
+
return null;
|
|
416
466
|
}
|
|
417
467
|
function bold() {
|
|
418
|
-
|
|
468
|
+
wrapSelection("strong");
|
|
419
469
|
}
|
|
420
470
|
function italic() {
|
|
421
|
-
|
|
471
|
+
wrapSelection("em");
|
|
422
472
|
}
|
|
423
473
|
function underline() {
|
|
424
|
-
|
|
474
|
+
wrapSelection("u");
|
|
425
475
|
}
|
|
426
476
|
return {
|
|
427
477
|
content,
|
|
428
478
|
setContent,
|
|
429
479
|
isFocused,
|
|
430
480
|
setFocused,
|
|
431
|
-
execCommand,
|
|
432
481
|
bold,
|
|
433
482
|
italic,
|
|
434
483
|
underline
|
|
@@ -35,6 +35,39 @@ declare function email(message?: string): ValidatorFn<string>;
|
|
|
35
35
|
declare function min(minVal: number, message?: string): ValidatorFn<number>;
|
|
36
36
|
declare function max(maxVal: number, message?: string): ValidatorFn<number>;
|
|
37
37
|
declare function custom<T>(fn: (value: T) => boolean, message: string): ValidatorFn<T>;
|
|
38
|
+
/**
|
|
39
|
+
* Props returned by bindField, ready to spread into an input tag factory.
|
|
40
|
+
*/
|
|
41
|
+
interface BoundFieldProps {
|
|
42
|
+
value: () => unknown;
|
|
43
|
+
on: {
|
|
44
|
+
input: (e: Event) => void;
|
|
45
|
+
change: (e: Event) => void;
|
|
46
|
+
blur: () => void;
|
|
47
|
+
};
|
|
48
|
+
[attr: string]: unknown;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Bind a FormField to an input element, eliminating the value/input/blur boilerplate.
|
|
52
|
+
*
|
|
53
|
+
* Works with text inputs (`input` event) and selects/checkboxes (`change` event).
|
|
54
|
+
*
|
|
55
|
+
* @param field A FormField from form().fields
|
|
56
|
+
* @param extras Additional props to merge (placeholder, class, disabled, etc.)
|
|
57
|
+
* @returns Props object ready to pass directly to a tag factory
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const f = form({ email: { initial: "", validators: [required(), email()] } });
|
|
62
|
+
*
|
|
63
|
+
* // Before — verbose
|
|
64
|
+
* input({ value: f.fields.email.value(), on: { input: e => f.fields.email.set(e.target.value), blur: () => f.fields.email.touch() } })
|
|
65
|
+
*
|
|
66
|
+
* // After — one-liner
|
|
67
|
+
* input(bindField(f.fields.email, { type: "email", placeholder: "Email" }))
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
declare function bindField<T>(field: FormField<T>, extras?: Record<string, unknown>): BoundFieldProps;
|
|
38
71
|
declare function form<T extends Record<string, unknown>>(config: FormConfig<T>): FormReturn<T>;
|
|
39
72
|
|
|
40
73
|
interface VirtualListProps<T> {
|
|
@@ -135,6 +168,10 @@ declare function announce(message: string, priority?: "polite" | "assertive"): v
|
|
|
135
168
|
* scopedStyle creates component-scoped CSS by generating a unique scope ID
|
|
136
169
|
* and prefixing all selectors.
|
|
137
170
|
* Returns the scope attribute name and injects the CSS into the document.
|
|
171
|
+
*
|
|
172
|
+
* CSS is sanitized to remove dangerous patterns (`url()`, `@import`,
|
|
173
|
+
* `expression()`, `-moz-binding`, `behavior`). If you need `url()` for
|
|
174
|
+
* background images, use inline styles via the `style` prop instead.
|
|
138
175
|
*/
|
|
139
176
|
declare function scopedStyle(css: string): {
|
|
140
177
|
scope: string;
|
|
@@ -188,15 +225,24 @@ interface Toast {
|
|
|
188
225
|
message: string;
|
|
189
226
|
type?: "info" | "success" | "error" | "warning";
|
|
190
227
|
}
|
|
191
|
-
|
|
192
|
-
duration?: number;
|
|
193
|
-
maxToasts?: number;
|
|
194
|
-
}): {
|
|
228
|
+
interface ToastInstance {
|
|
195
229
|
toasts: () => Toast[];
|
|
196
230
|
show: (message: string, type?: Toast["type"]) => string;
|
|
231
|
+
/** Show an info toast. */
|
|
232
|
+
info: (message: string) => string;
|
|
233
|
+
/** Show a success toast. */
|
|
234
|
+
success: (message: string) => string;
|
|
235
|
+
/** Show an error toast. */
|
|
236
|
+
error: (message: string) => string;
|
|
237
|
+
/** Show a warning toast. */
|
|
238
|
+
warning: (message: string) => string;
|
|
197
239
|
dismiss: (id: string) => void;
|
|
198
240
|
dismissAll: () => void;
|
|
199
|
-
}
|
|
241
|
+
}
|
|
242
|
+
declare function toast(options?: {
|
|
243
|
+
duration?: number;
|
|
244
|
+
maxToasts?: number;
|
|
245
|
+
}): ToastInstance;
|
|
200
246
|
|
|
201
247
|
/**
|
|
202
248
|
* infiniteScroll combines IntersectionObserver with a data-fetching trigger
|
|
@@ -259,4 +305,4 @@ declare function defineElement(name: string, component: (props: Record<string, u
|
|
|
259
305
|
*/
|
|
260
306
|
declare function svgElement(tag: string, props?: Record<string, unknown>, ...nodes: (SVGElement | string)[]): SVGElement;
|
|
261
307
|
|
|
262
|
-
export {
|
|
308
|
+
export { lazyLoad as A, type BoundFieldProps as B, type CustomElementOptions as C, matchesPattern as D, max as E, type FieldConfig as F, maxLength as G, min as H, type IntersectionResult as I, minLength as J, pagination as K, phoneMask as L, type MaskOptions as M, removeScopedStyle as N, required as O, scopedStyle as P, ssnMask as Q, svgElement as R, timeMask as S, type Toast as T, toast as U, type ValidatorFn as V, withScopedStyle as W, zipMask as X, FocusTrap as a, type FormConfig as b, type FormField as c, type FormReturn as d, type ToastInstance as e, VirtualList as f, type VirtualListProps as g, announce as h, aria as i, bindAttrs as j, bindBoolAttr as k, bindData as l, bindField as m, creditCardMask as n, custom as o, dateMask as p, defineElement as q, dialog as r, email as s, eventBus as t, focus as u, form as v, hotkey as w, infiniteScroll as x, inputMask as y, intersection as z };
|