sibujs 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -119
- package/dist/browser.cjs +53 -14
- package/dist/browser.d.cts +14 -9
- package/dist/browser.d.ts +14 -9
- package/dist/browser.js +4 -4
- package/dist/build.cjs +125 -135
- package/dist/build.d.cts +1 -1
- package/dist/build.d.ts +1 -1
- package/dist/build.js +11 -91
- package/dist/cdn.global.js +6 -6
- package/dist/chunk-5ZYQ6KDD.js +154 -0
- package/dist/chunk-6BMPXPUW.js +26 -0
- package/dist/chunk-7GRNSCFT.js +1097 -0
- package/dist/chunk-BGTHZHJ5.js +1016 -0
- package/dist/chunk-BMPL52BF.js +654 -0
- package/dist/chunk-CNZ35WI2.js +178 -0
- package/dist/chunk-GJPXRJ45.js +37 -0
- package/dist/chunk-JCDUJN2F.js +2779 -0
- package/dist/chunk-K4G4ZQNR.js +286 -0
- package/dist/chunk-M4NLBH4I.js +725 -0
- package/dist/chunk-MB6QFH3I.js +2776 -0
- package/dist/chunk-MYRV7VDM.js +742 -0
- package/dist/chunk-NZIIMDWI.js +84 -0
- package/dist/chunk-P3XWXJZU.js +282 -0
- package/dist/chunk-PDZQY43A.js +616 -0
- package/dist/chunk-RJ46C3CS.js +1293 -0
- package/dist/chunk-SFKNRVCU.js +292 -0
- package/dist/chunk-TDGZL5CU.js +365 -0
- package/dist/chunk-UHNL42EF.js +2730 -0
- package/dist/chunk-VAPYJN4X.js +368 -0
- package/dist/chunk-VQDZK23A.js +1023 -0
- package/dist/chunk-VQNQZCWJ.js +61 -0
- package/dist/chunk-XHK6BDAJ.js +76 -0
- package/dist/chunk-XUEEGU5O.js +409 -0
- package/dist/chunk-ZWKZCBO6.js +317 -0
- package/dist/contracts-ey_Qh8ef.d.cts +239 -0
- package/dist/contracts-ey_Qh8ef.d.ts +239 -0
- package/dist/contracts-xo5ckdRP.d.cts +240 -0
- package/dist/contracts-xo5ckdRP.d.ts +240 -0
- package/dist/customElement-BL3Uo8dL.d.cts +318 -0
- package/dist/customElement-BL3Uo8dL.d.ts +318 -0
- package/dist/data.cjs +52 -11
- package/dist/data.js +6 -6
- package/dist/devtools.cjs +22 -24
- package/dist/devtools.d.cts +1 -1
- package/dist/devtools.d.ts +1 -1
- package/dist/devtools.js +26 -28
- package/dist/ecosystem.cjs +31 -6
- package/dist/ecosystem.d.cts +4 -4
- package/dist/ecosystem.d.ts +4 -4
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +305 -131
- package/dist/extras.d.cts +3 -3
- package/dist/extras.d.ts +3 -3
- package/dist/extras.js +21 -29
- package/dist/index.cjs +124 -56
- package/dist/index.d.cts +60 -72
- package/dist/index.d.ts +60 -72
- package/dist/index.js +10 -14
- package/dist/motion.cjs +13 -2
- package/dist/motion.d.cts +1 -1
- package/dist/motion.d.ts +1 -1
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +91 -46
- package/dist/patterns.d.cts +46 -60
- package/dist/patterns.d.ts +46 -60
- package/dist/patterns.js +6 -14
- package/dist/performance.cjs +97 -12
- package/dist/performance.d.cts +6 -1
- package/dist/performance.d.ts +6 -1
- package/dist/performance.js +5 -3
- package/dist/plugins.cjs +20 -14
- package/dist/plugins.d.cts +3 -3
- package/dist/plugins.d.ts +3 -3
- package/dist/plugins.js +17 -19
- package/dist/ssr.cjs +9 -0
- package/dist/ssr.d.cts +1 -1
- package/dist/ssr.d.ts +1 -1
- package/dist/ssr.js +7 -7
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +130 -53
- package/dist/ui.d.cts +13 -16
- package/dist/ui.d.ts +13 -16
- package/dist/ui.js +7 -9
- package/dist/widgets.cjs +31 -6
- package/dist/widgets.js +5 -5
- package/package.json +1 -1
package/dist/cdn.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Sibu=(()=>{var Ae=Object.defineProperty;var Po=Object.getOwnPropertyDescriptor;var Do=Object.getOwnPropertyNames;var Fo=Object.prototype.hasOwnProperty;var Ye=(e,t)=>{for(var n in t)Ae(e,n,{get:t[n],enumerable:!0})},Ho=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Do(t))!Fo.call(e,o)&&o!==n&&Ae(e,o,{get:()=>t[o],enumerable:!(r=Po(t,o))||r.enumerable});return e};var Bo=e=>Ho(Ae({},"__esModule",{value:!0}),e);var pi={};Ye(pi,{DynamicComponent:()=>Dr,ErrorBoundary:()=>_o,ErrorDisplay:()=>we,Fragment:()=>Mr,KeepAlive:()=>Ir,Loading:()=>Lo,Portal:()=>Rr,SVG_NS:()=>k,Suspense:()=>je,__resetIdCounter:()=>Yr,a:()=>Lt,abbr:()=>Mt,action:()=>qr,address:()=>mt,area:()=>nn,array:()=>co,article:()=>ct,aside:()=>ft,asyncDerived:()=>fo,audio:()=>rn,autoResize:()=>Ur,b:()=>Rt,base:()=>Zn,batch:()=>Ee,bdi:()=>Ot,bdo:()=>Pt,bindDynamic:()=>Ne,blockquote:()=>vt,body:()=>it,br:()=>Dt,button:()=>Z,canvas:()=>yn,caption:()=>En,catchError:()=>Wr,catchErrorAsync:()=>Gr,center:()=>Tr,checkLeaks:()=>nt,circle:()=>tr,cite:()=>Ft,clickOutside:()=>$r,clipPath:()=>pr,code:()=>ke,col:()=>Sn,colgroup:()=>wn,context:()=>go,copyOnClick:()=>Kr,createId:()=>Qr,customElement:()=>Sr,data:()=>Ht,datalist:()=>On,dd:()=>Tt,deepEqual:()=>se,deepSignal:()=>uo,defer:()=>To,defs:()=>ur,del:()=>Tn,derived:()=>I,details:()=>Vn,dfn:()=>Bt,dialog:()=>Wn,disableSSR:()=>Ie,dispose:()=>O,div:()=>h,dl:()=>kt,dt:()=>Et,each:()=>Nr,effect:()=>P,ellipse:()=>nr,em:()=>zt,embed:()=>ln,enableSSR:()=>ze,enqueueBatchedSignal:()=>X,fieldset:()=>Pn,figcaption:()=>St,figure:()=>wt,font:()=>kr,footer:()=>dt,form:()=>Dn,g:()=>rr,getSlot:()=>Fr,h1:()=>bt,h2:()=>gt,h3:()=>ve,h4:()=>ht,h5:()=>yt,h6:()=>xt,head:()=>ot,header:()=>lt,hr:()=>Ct,html:()=>Oe,i:()=>It,iframe:()=>dn,img:()=>on,input:()=>Fn,ins:()=>kn,isBatching:()=>Zr,isSSR:()=>ee,kbd:()=>qt,label:()=>Hn,lazy:()=>$e,legend:()=>Bn,li:()=>At,line:()=>or,linearGradient:()=>br,link:()=>Xn,longPress:()=>jr,main:()=>pt,map:()=>sn,mark:()=>$t,marker:()=>vr,marquee:()=>Er,mask:()=>fr,match:()=>zr,math:()=>hn,memo:()=>so,memoFn:()=>ao,menu:()=>Gn,meta:()=>er,meter:()=>zn,mount:()=>Ar,nav:()=>ut,nextTick:()=>xo,noscript:()=>xn,object:()=>un,ol:()=>_t,on:()=>no,onCleanup:()=>bo,onMount:()=>qe,onUnmount:()=>mo,optgroup:()=>In,option:()=>qn,output:()=>$n,p:()=>xe,param:()=>pn,path:()=>ir,pattern:()=>mr,picture:()=>fn,polygon:()=>sr,polyline:()=>ar,portal:()=>mn,pre:()=>Te,progress:()=>jn,q:()=>jt,radialGradient:()=>gr,reactiveArray:()=>lo,rect:()=>cr,ref:()=>io,registerComponent:()=>Or,registerDisposer:()=>A,resolveComponent:()=>De,rp:()=>Kt,rt:()=>Ut,ruby:()=>Vt,s:()=>Wt,samp:()=>Gt,script:()=>vn,section:()=>at,select:()=>Kn,setGlobalErrorHandler:()=>Jr,show:()=>Hr,signal:()=>E,slot:()=>Qn,small:()=>Jt,source:()=>bn,span:()=>S,stop:()=>hr,store:()=>oo,strict:()=>ho,strictEffect:()=>yo,strong:()=>Qt,style:()=>z,sub:()=>Yt,summary:()=>Jn,sup:()=>Zt,svg:()=>gn,symbol:()=>xr,table:()=>Cn,tagFactory:()=>c,tbody:()=>An,td:()=>_n,template:()=>Yn,text:()=>lr,textarea:()=>Un,tfoot:()=>Nn,th:()=>Ln,thead:()=>Mn,time:()=>Xt,title:()=>st,tr:()=>Rn,track:()=>an,transition:()=>ko,trapFocus:()=>Vr,tspan:()=>dr,u:()=>en,ul:()=>Nt,unregisterComponent:()=>Pr,untracked:()=>Q,use:()=>yr,var_:()=>tn,video:()=>cn,watch:()=>ro,when:()=>Br,withSSR:()=>eo,writable:()=>po});var Ue={};Ye(Ue,{DynamicComponent:()=>Dr,ErrorBoundary:()=>_o,ErrorDisplay:()=>we,Fragment:()=>Mr,KeepAlive:()=>Ir,Loading:()=>Lo,Portal:()=>Rr,SVG_NS:()=>k,Suspense:()=>je,__resetIdCounter:()=>Yr,a:()=>Lt,abbr:()=>Mt,action:()=>qr,address:()=>mt,area:()=>nn,array:()=>co,article:()=>ct,aside:()=>ft,asyncDerived:()=>fo,audio:()=>rn,autoResize:()=>Ur,b:()=>Rt,base:()=>Zn,batch:()=>Ee,bdi:()=>Ot,bdo:()=>Pt,bindDynamic:()=>Ne,blockquote:()=>vt,body:()=>it,br:()=>Dt,button:()=>Z,canvas:()=>yn,caption:()=>En,catchError:()=>Wr,catchErrorAsync:()=>Gr,center:()=>Tr,checkLeaks:()=>nt,circle:()=>tr,cite:()=>Ft,clickOutside:()=>$r,clipPath:()=>pr,code:()=>ke,col:()=>Sn,colgroup:()=>wn,context:()=>go,copyOnClick:()=>Kr,createId:()=>Qr,customElement:()=>Sr,data:()=>Ht,datalist:()=>On,dd:()=>Tt,deepEqual:()=>se,deepSignal:()=>uo,defer:()=>To,defs:()=>ur,del:()=>Tn,derived:()=>I,details:()=>Vn,dfn:()=>Bt,dialog:()=>Wn,disableSSR:()=>Ie,dispose:()=>O,div:()=>h,dl:()=>kt,dt:()=>Et,each:()=>Nr,effect:()=>P,ellipse:()=>nr,em:()=>zt,embed:()=>ln,enableSSR:()=>ze,enqueueBatchedSignal:()=>X,fieldset:()=>Pn,figcaption:()=>St,figure:()=>wt,font:()=>kr,footer:()=>dt,form:()=>Dn,g:()=>rr,getSlot:()=>Fr,h1:()=>bt,h2:()=>gt,h3:()=>ve,h4:()=>ht,h5:()=>yt,h6:()=>xt,head:()=>ot,header:()=>lt,hr:()=>Ct,html:()=>Oe,i:()=>It,iframe:()=>dn,img:()=>on,input:()=>Fn,ins:()=>kn,isBatching:()=>Zr,isSSR:()=>ee,kbd:()=>qt,label:()=>Hn,lazy:()=>$e,legend:()=>Bn,li:()=>At,line:()=>or,linearGradient:()=>br,link:()=>Xn,longPress:()=>jr,main:()=>pt,map:()=>sn,mark:()=>$t,marker:()=>vr,marquee:()=>Er,mask:()=>fr,match:()=>zr,math:()=>hn,memo:()=>so,memoFn:()=>ao,menu:()=>Gn,meta:()=>er,meter:()=>zn,mount:()=>Ar,nav:()=>ut,nextTick:()=>xo,noscript:()=>xn,object:()=>un,ol:()=>_t,on:()=>no,onCleanup:()=>bo,onMount:()=>qe,onUnmount:()=>mo,optgroup:()=>In,option:()=>qn,output:()=>$n,p:()=>xe,param:()=>pn,path:()=>ir,pattern:()=>mr,picture:()=>fn,polygon:()=>sr,polyline:()=>ar,portal:()=>mn,pre:()=>Te,progress:()=>jn,q:()=>jt,radialGradient:()=>gr,reactiveArray:()=>lo,rect:()=>cr,ref:()=>io,registerComponent:()=>Or,registerDisposer:()=>A,resolveComponent:()=>De,rp:()=>Kt,rt:()=>Ut,ruby:()=>Vt,s:()=>Wt,samp:()=>Gt,script:()=>vn,section:()=>at,select:()=>Kn,setGlobalErrorHandler:()=>Jr,show:()=>Hr,signal:()=>E,slot:()=>Qn,small:()=>Jt,source:()=>bn,span:()=>S,stop:()=>hr,store:()=>oo,strict:()=>ho,strictEffect:()=>yo,strong:()=>Qt,style:()=>z,sub:()=>Yt,summary:()=>Jn,sup:()=>Zt,svg:()=>gn,symbol:()=>xr,table:()=>Cn,tagFactory:()=>c,tbody:()=>An,td:()=>_n,template:()=>Yn,text:()=>lr,textarea:()=>Un,tfoot:()=>Nn,th:()=>Ln,thead:()=>Mn,time:()=>Xt,title:()=>st,tr:()=>Rn,track:()=>an,transition:()=>ko,trapFocus:()=>Vr,tspan:()=>dr,u:()=>en,ul:()=>Nt,unregisterComponent:()=>Pr,untracked:()=>Q,use:()=>yr,var_:()=>tn,video:()=>cn,watch:()=>ro,when:()=>Br,withSSR:()=>eo,writable:()=>po});function _(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}var Ze=_();function L(e,t){if(Ze&&!e)throw new Error(`[Sibu] ${t}`)}function M(e){Ze&&console.warn(`[Sibu] ${e}`)}function $(e){let t=e.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!t)return"";let n=t.toLowerCase();return n.startsWith("javascript:")||n.startsWith("data:")||n.startsWith("vbscript:")||n.startsWith("blob:")?"":t}function _e(e){let t=e.toLowerCase().replace(/\s+/g,"");return t.includes("url(")||t.includes("expression(")||t.includes("javascript:")||t.includes("-moz-binding")?"":e}var zo=new Set(["href","src","action","formaction","cite","poster","background","srcset"]);function j(e){return zo.has(e)}var Io=_(),G=new Array(32),J=32,F=-1,B=null,qo=new WeakMap,K="__s",H=0,C=[],R=new Set;function re(e){try{e()}catch(t){Io&&M(`Subscriber threw during notification: ${t instanceof Error?t.message:String(t)}`)}}var fe=0,me=!1;function x(e,t){t||(t=e),Xe(t),++F,F>=J&&(J*=2,G.length=J),G[F]=t,B=t;try{e()}finally{F--,B=F>=0?G[F]:null}return()=>Xe(t)}function $o(){fe===0&&(++F,F>=J&&(J*=2,G.length=J),G[F]=null,B=null,me=!0),fe++}function jo(){fe--,fe===0&&(F--,B=F>=0?G[F]:null,me=!1)}function Q(e){$o();try{return e()}finally{jo()}}function Y(e){if(!B)return;let t=B;if(t._dep===e)return;let n=t._deps;if(n){if(n.has(e))return;n.add(e)}else if(t._dep!==void 0){let o=new Set;o.add(t._dep),o.add(e),t._deps=o,t._dep=void 0}else t._dep=e;let r=e[K];r||(r=new Set,qo.set(e,r),e[K]=r),r.add(B),r.size===1?e.__f=B:e.__f!==void 0&&(e.__f=void 0)}function et(e){let t=e[K];if(t)for(let n of t)n._c?W(n):R.has(n)||(R.add(n),C.push(n))}function tt(){if(!(H>0)){H++;try{let e=0;for(;e<C.length;)re(C[e]),e++}finally{C.length=0,R.clear(),H--}}}function W(e){e();let t=e._sig;for(;t;){let n=t.__f;if(n){if(n._c){let i=n._sig;i._d=!0,t=i;continue}R.has(n)||(R.add(n),C.push(n));break}let r=t[K];if(!r)break;let o;for(let i of r)if(i._c){i();let s=i._sig;s&&!o?o=s:s&&W(i)}else R.has(i)||(R.add(i),C.push(i));t=o}}function be(e){let t=e.__f;if(t){if(H>0){t._c?W(t):R.has(t)||(R.add(t),C.push(t));return}H++;try{t._c?W(t):re(t);let r=0;for(;r<C.length;)re(C[r]),r++}finally{C.length=0,R.clear(),H--}return}let n=e[K];if(!(!n||n.size===0)){if(H>0){for(let r of n)r._c?W(r):R.has(r)||(R.add(r),C.push(r));return}H++;try{let r=0;for(let i of n)C[r++]=i;for(let i=0;i<r;i++)C[i]._c&&W(C[i]);for(let i=0;i<r;i++)C[i]._c||R.has(C[i])||re(C[i]);let o=r;for(;o<C.length;)re(C[o]),o++}finally{C.length=0,R.clear(),H--}}}function Xe(e){let t=e,n=t._dep;if(n!==void 0){let o=n[K];o&&(o.delete(e),n.__f===e&&(n.__f=void 0)),t._dep=void 0;return}let r=t._deps;if(!(!r||r.size===0)){for(let o of r){let i=o[K];i&&(i.delete(e),o.__f===e&&(o.__f=void 0))}r.clear()}}var ge=_();function Ko(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}function he(e,t,n){if(Ko(t))return ge&&M(`bindAttribute: refusing to bind event-handler attribute "${t}". Use on:{ ${t.slice(2)}: fn } instead.`),()=>{};function r(){let i;try{i=n()}catch(a){ge&&M(`bindAttribute: getter for "${t}" threw: ${a instanceof Error?a.message:String(a)}`);return}if(typeof i=="boolean"){t in e&&(t==="checked"||t==="disabled"||t==="selected")?e[t]=i:i?e.setAttribute(t,""):e.removeAttribute(t);return}let s=String(i);(t==="value"||t==="checked")&&t in e?e[t]=t==="checked"?!!i:s:e.setAttribute(t,j(t)?$(s):s)}return x(r)}function Ne(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){ge&&M(`bindDynamic: name getter threw: ${l instanceof Error?l.message:String(l)}`);return}let a;try{a=typeof n=="function"?n():n}catch(l){ge&&M(`bindDynamic: value getter threw: ${l instanceof Error?l.message:String(l)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;r!==null&&r!==s&&e.removeAttribute(r);let d=String(a);(s==="value"||s==="checked")&&s in e?e[s]=s==="checked"?!!a:d:e.setAttribute(s,j(s)?$(d):d),r=s}let i=x(o);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Uo=_();function U(e,t){let n=[];function r(){let o;try{o=t()}catch(l){Uo&&M(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}if(o==null||typeof o=="boolean"){for(let l=0;l<n.length;l++){let u=n[l];u.parentNode&&u.parentNode.removeChild(u)}n.length=0;return}let i=e.parentNode;if(!i){n.length=0;return}let s;if(Array.isArray(o)){s=[];for(let l=0;l<o.length;l++){let u=o[l];u==null||typeof u=="boolean"||s.push(u instanceof Node?u:document.createTextNode(String(u)))}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let a=n.length>0&&s.length>0?new Set:void 0;if(a){for(let l=0;l<s.length;l++)for(let u=0;u<n.length;u++)if(s[l]===n[u]){a.add(s[l]);break}}for(let l=0;l<n.length;l++){let u=n[l];a?.has(u)||u.parentNode&&u.parentNode.removeChild(u)}let d=e.nextSibling;for(let l=0;l<s.length;l++){let u=s[l];a?.has(u)&&u.parentNode===i?u.nextSibling!==d&&i.insertBefore(u,d):i.insertBefore(u,d)}n=s}return x(r)}var ye=new WeakMap,Le=_(),oe=0;function A(e,t){let n=ye.get(e);n||(n=[],ye.set(e,n)),n.push(t),Le&&oe++}function O(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=r.childNodes;for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--){let o=n[r],i=ye.get(o);if(i){Le&&(oe-=i.length);for(let s of i)s();ye.delete(o)}}}function nt(e=0){return Le?(e>0&&oe>e&&M(`checkLeaks: ${oe} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),oe):0}var k="http://www.w3.org/2000/svg",rt=new Map;function Vo(e){let t=rt.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),rt.set(e,t)),t}function Wo(e,t){if(typeof t=="function"){let r=x(()=>{e.setAttribute("style",t())});A(e,r);return}if(typeof t=="string"){e.setAttribute("style",t);return}let n=e;for(let r in t){let o=t[r],i=Vo(r);if(typeof o=="function"){let s=o,a=x(()=>{n.style.setProperty(i,_e(String(s())))});A(e,a)}else n.style.setProperty(i,_e(String(o)))}}function Go(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=x(()=>{e.setAttribute("class",t())});A(e,i);return}let n=t,r=!1,o="";for(let i in n){let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=x(()=>{let a="";for(let d in n){let l=n[d];(typeof l=="function"?l():l)&&(a=a?`${a} ${d}`:d)}e.setAttribute("class",a)});A(e,s)}else e.setAttribute("class",o)}function Me(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),A(e,U(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),A(e,U(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),A(e,U(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}var c=(e,t)=>(n,r)=>{let o=t?document.createElementNS(t,e):document.createElement(e);if(n===void 0)return o;if(typeof n=="string")return r!==void 0?(o.setAttribute("class",n),Me(o,r),o):(o.textContent=n,o);if(typeof n=="number")return o.textContent=String(n),o;if(Array.isArray(n)||n instanceof Node||typeof n=="function")return Me(o,n),o;let i=n,s=i.class;s!=null&&Go(o,s);let a=i.id;a!=null&&(o.id=a);let d=r!==void 0?r:i.nodes;d!=null&&Me(o,d);let l=i.on;if(l)for(let m in l)o.addEventListener(m,l[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||m[0]==="o"&&m[1]==="n")continue;if(typeof p=="function")A(o,he(o,m,p));else if(typeof p=="boolean")m in o&&(m==="checked"||m==="disabled"||m==="selected")?o[m]=p:p?o.setAttribute(m,""):o.removeAttribute(m);else{let b=String(p);o.setAttribute(m,j(m)?$(b):b)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var Pi=c("html"),ot=c("head"),it=c("body"),st=c("title"),h=c("div"),S=c("span"),at=c("section"),ct=c("article"),lt=c("header"),dt=c("footer"),ut=c("nav"),pt=c("main"),ft=c("aside"),mt=c("address"),xe=c("p"),bt=c("h1"),gt=c("h2"),ve=c("h3"),ht=c("h4"),yt=c("h5"),xt=c("h6"),vt=c("blockquote"),Tt=c("dd"),kt=c("dl"),Et=c("dt"),St=c("figcaption"),wt=c("figure"),Ct=c("hr"),At=c("li"),_t=c("ol"),Nt=c("ul"),Te=c("pre"),Lt=c("a"),Mt=c("abbr"),Rt=c("b"),Ot=c("bdi"),Pt=c("bdo"),Dt=c("br"),Ft=c("cite"),ke=c("code"),Ht=c("data"),Bt=c("dfn"),zt=c("em"),It=c("i"),qt=c("kbd"),$t=c("mark"),jt=c("q"),Kt=c("rp"),Ut=c("rt"),Vt=c("ruby"),Wt=c("s"),Gt=c("samp"),Jt=c("small"),Qt=c("strong"),Yt=c("sub"),Zt=c("sup"),Xt=c("time"),en=c("u"),tn=c("var"),nn=c("area"),rn=c("audio"),on=c("img"),sn=c("map"),an=c("track"),cn=c("video"),ln=c("embed"),dn=c("iframe"),un=c("object"),pn=c("param"),fn=c("picture"),mn=c("portal"),bn=c("source"),gn=c("svg",k),hn=c("math"),yn=c("canvas"),xn=c("noscript"),vn=c("script"),Tn=c("del"),kn=c("ins"),En=c("caption"),Sn=c("col"),wn=c("colgroup"),Cn=c("table"),An=c("tbody"),_n=c("td"),Nn=c("tfoot"),Ln=c("th"),Mn=c("thead"),Rn=c("tr"),Z=c("button"),On=c("datalist"),Pn=c("fieldset"),Dn=c("form"),Fn=c("input"),Hn=c("label"),Bn=c("legend"),zn=c("meter"),In=c("optgroup"),qn=c("option"),$n=c("output"),jn=c("progress"),Kn=c("select"),Un=c("textarea"),Vn=c("details"),Wn=c("dialog"),Gn=c("menu"),Jn=c("summary"),Qn=c("slot"),Yn=c("template"),Zn=c("base"),Xn=c("link"),er=c("meta"),z=c("style"),tr=c("circle",k),nr=c("ellipse",k),rr=c("g",k),or=c("line",k),ir=c("path",k),sr=c("polygon",k),ar=c("polyline",k),cr=c("rect",k),lr=c("text",k),dr=c("tspan",k),ur=c("defs",k),pr=c("clipPath",k),fr=c("mask",k),mr=c("pattern",k),br=c("linearGradient",k),gr=c("radialGradient",k),hr=c("stop",k),yr=c("use",k),xr=c("symbol",k),vr=c("marker",k),Tr=c("center"),kr=c("font"),Er=c("marquee"),Sr=e=>c(e);var Jo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),wr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Cr=new WeakMap;function Qo(e){let t=e.length-1,n=e[0];for(let p=0;p<t;p++)n+=`\0${p}\0${e[p+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
2
|
-
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let p=r;r++;let b=0;for(;r<o&&n.charCodeAt(r)!==0;)b=b*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,b<0||b>=t?(r=p,-1):b}function a(){let p=r;for(;r<o;){let b=n.charCodeAt(r);if(b>=97&&b<=122||b>=65&&b<=90||b>=48&&b<=57||b===45)r++;else break}return n.slice(p,r)}function d(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let p=s();if(p>=0)return{kind:"expr",idx:p};let b=n[r];if(b==='"'||b==="'"){r++;let y=[],D=[],q="";for(;r<o&&n[r]!==b;){let ce=s();ce>=0?(y.push(q),q="",D.push(ce)):q+=n[r++]}return r<o&&r++,y.push(q),D.length===0?{kind:"static",value:y[0]}:{kind:"mixed",statics:y,exprs:D}}let T=r;for(;r<o;){let y=n.charCodeAt(r);if(y===32||y===9||y===10||y===13||y===62||y===47)break;r++}return{kind:"static",value:n.slice(T,r)}}function l(){let p=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let b=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let T=n.slice(b,r);if(!T)break;let v=d();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 b="";for(;r<o&&n[r]!=="<";){let v=s();if(v>=0){let y=u(b);y&&p.push({t:1,value:y}),b="",p.push({t:2,idx:v})}else b+=n[r++]}let T=u(b);T&&p.push({t:1,value:T})}function m(){let p=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){r++;let b=a(),T=l();i();let v=Jo.has(b),y=n[r]==="/";if(y&&r++,r<o&&r++,v||y)p.push({t:0,el:{tag:b,svg:wr.has(b),attrs:T,children:[]}});else{let D=m();n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),p.push({t:0,el:{tag:b,svg:wr.has(b),attrs:T,children:D}})}}else f(p);return p}return m()}function Re(e,t){let n=e.svg?document.createElementNS(k,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:n.setAttribute(o.name,o.value);break;case 1:{let i=o.name;if(i[0]==="o"&&i[1]==="n")break;let s=t[o.idx];if(typeof s=="function")A(n,he(n,i,s));else if(s!=null){let a=String(s);n.setAttribute(i,j(i)?$(a):a)}break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++)i+=String(t[o.exprs[s]])+o.statics[s+1];n.setAttribute(o.name,i);break}case 3:n.addEventListener(o.name,t[o.idx]);break;case 4:n.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(Re(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),A(n,U(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Oe(e,...t){let n=Cr.get(e);if(n||(n=Qo(e),Cr.set(e,n)),n.length===1&&n[0].t===0)return Re(n[0].el,t);let r=document.createElement("div");for(let o=0;o<n.length;o++){let i=n[o];switch(i.t){case 0:r.appendChild(Re(i.el,t));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=t[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),A(r,U(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let d=s[a];d instanceof Node?r.appendChild(d):d!=null&&typeof d!="boolean"&&r.appendChild(document.createTextNode(String(d)))}else s!=null&&typeof s!="boolean"&&r.appendChild(document.createTextNode(String(s)));break}}}return r.childNodes.length===1&&r.firstChild instanceof Element?r.firstChild:r}function Ar(e,t){if(!t)throw new Error("[Sibu] mount: container element not found. Make sure the DOM element exists before calling mount().");L(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-n:0;t.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:t,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),O(r),r.parentNode&&r.parentNode.removeChild(r)}}}var Yo=_();function _r(e){return typeof e=="function"?_r(e()):e instanceof Node?e:document.createTextNode(String(e))}function Zo(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let d=e[a],l=0,u=n.length;for(;l<u;){let f=l+u>>1;e[n[f]]<d?l=f+1:u=f}n[l]=a,r[a]=l>0?n[l-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Nr(e,t,n){L(typeof e=="function","each: first argument must be a function that returns an array."),L(typeof t=="function","each: second argument must be a render function."),L(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,d=0,l=new Map,u=new Map,f=[],m=[],p=new Uint8Array(0),b=new Map,T=[],v=[],y=new Map,D=!1,q=!1,ce=n.key,Ve=()=>{let We=e(),w=We.length,le=r.parentNode;if(!le)return;q||(le.insertBefore(o,r.nextSibling),q=!0),m.length<w&&(m=new Array(w));for(let g=0;g<w;g++)m[g]=ce(We[g]);let te=m;f.length<w&&(f=new Array(w)),u.clear(),y.clear();for(let g=0;g<w;g++)y.set(te[g],g);for(let g=0;g<w;g++){let N=te[g],Je=l.get(N),ne;if(Je!==void 0)ne=Je;else{let Qe=N,Ro=()=>e()[y.get(Qe)],Oo=()=>y.get(Qe);try{ne=_r(t(Ro,Oo))}catch(Ce){Yo&&M(`each: render threw for item at index ${g} (key="${te[g]}"): ${Ce instanceof Error?Ce.message:String(Ce)}`),ne=document.createComment(`each:error:${g}`)}}u.set(N,ne),f[g]=ne}for(let[g,N]of l)u.has(g)||(O(N),N.parentNode&&le.removeChild(N));if(w===0){d=0;let g=l;l=u,u=g;return}b.clear();for(let g=0;g<d;g++)b.set(a[g],g);T.length<w&&(T=new Array(w),v=new Array(w));let de=0;for(let g=0;g<w;g++){let N=b.get(te[g]);N!==void 0&&(T[de]=g,v[de]=N,de++)}let Ge=Zo(v,de);p.length<w?p=new Uint8Array(w):p.fill(0,0,w);for(let g=0;g<Ge.length;g++)p[T[Ge[g]]]=1;let ue=o;for(let g=w-1;g>=0;g--){let N=f[g];p[g]||N.nextSibling!==ue&&le.insertBefore(N,ue),ue=N}let pe=a===i?s:i;pe.length<w&&(pe.length=w);for(let g=0;g<w;g++)pe[g]=te[g];a=pe,d=w;let Mo=l;l=u,u=Mo,D=!0};return x(Ve),D||queueMicrotask(()=>{!D&&r.parentNode&&Ve()}),r}function Mr(e){let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||t.appendChild(Lr(r));else t.appendChild(Lr(n));return t}function Lr(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let t=e();return t instanceof Node?t:document.createTextNode(String(t??""))}return document.createTextNode(String(e))}function Rr(e,t){let n=document.createComment("portal"),r=t||document.body,o=null;queueMicrotask(()=>{try{o=e(),r.appendChild(o)}catch(s){console.error("[Portal] Render error:",s)}});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 Pe=new Map;function Or(e,t){Pe.set(e,t)}function Pr(e){Pe.delete(e)}function De(e){let t=Pe.get(e);return t?t():h({nodes:`[Component "${e}" not found]`})}function Dr(e){let t=h({class:"sibu-dynamic"});function n(){let r=e(),o;typeof r=="function"?o=r():o=De(r);for(let i of Array.from(t.childNodes))O(i);t.replaceChildren(o)}return x(n),t}function Fr(e,t="default"){return e?.[t]}function Hr(e,t){return x(()=>{t.style.display=e()?"":"none"}),t}function Br(e,t,n){let r=document.createComment("when"),o=null,i,s=!1,a=()=>{let d=e(),l=r.parentNode;if(!l||s&&d===i)return;i=d,o?.parentNode&&(O(o),o.parentNode.removeChild(o),o=null);let u=d?t():n?n():null;if(u!=null){let f=u instanceof Node?u:document.createTextNode(String(u));l.insertBefore(f,r.nextSibling),o=f}s=!0};return x(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function zr(e,t,n){let r=document.createComment("match"),o=null,i,s=!1,a=()=>{let d=String(e()),l=r.parentNode;if(!l||s&&d===i)return;i=d,o?.parentNode&&(O(o),o.parentNode.removeChild(o),o=null);let u=t[d]||n;if(u){let f=u();if(f!=null){let m=f instanceof Node?f:document.createTextNode(String(f));l.insertBefore(m,r.nextSibling),o=m}}s=!0};return x(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function Ir(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??0,a,d=null,l=!1,u=()=>{let f=e(),m=r.parentNode;if(!m||l&&f===a)return;d?.parentNode&&m.removeChild(d),a=f;let p=o.get(f);if(p){let b=i.indexOf(f);b!==-1&&(i.splice(b,1),i.push(f))}else{let b=t[f];if(!b){d=null,l=!0;return}if(p=b(),o.set(f,p),i.push(f),s>0&&i.length>s){let T=i.shift(),v=o.get(T);v&&(O(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(T))}}m.insertBefore(p,r.nextSibling),d=p,l=!0};return x(u),l||queueMicrotask(()=>{!l&&r.parentNode&&u()}),r}function qr(e,t,n){let r=t(e,n);typeof r=="function"&&A(e,r)}var $r=(e,t)=>{let n=r=>{e.contains(r.target)||t()};return document.addEventListener("pointerdown",n,!0),()=>document.removeEventListener("pointerdown",n,!0)},jr=(e,t)=>{let n=t.duration??500,r=null,o=()=>{r=setTimeout(()=>{t.callback(),r=null},n)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},Kr=(e,t)=>{let n=()=>{let r=typeof t=="function"?t():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",n),()=>e.removeEventListener("click",n)},Ur=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},Vr=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};var V=null;function Wr(e,t){try{let n=e();return n&&typeof n.then=="function"&&n.catch(r=>{t?t(r,"async"):V?V(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),n}catch(n){return t?t(n,"sync"):V?V(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Gr(e,t){try{return await e()}catch(n){return t?t(n,"async"):V?V(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Jr(e){V=e}var Fe=0;function Qr(e="sibu"){return Fe++,`${e}-${Fe}`}function Yr(){Fe=0}var ie=0,He=new Set;function Ee(e){ie++;try{return e()}finally{ie--,ie===0&&Xo()}}function X(e){return ie===0?!1:(He.add(e),!0)}function Zr(){return ie>0}function Xo(){for(let e of He)et(e);He.clear(),tt()}var Xr=globalThis,Be=_();function E(e,t){let n={value:e},r=Be?t?.name:void 0,o=t?.equals;r&&(n.__name=r);function i(){return Y(n),n.value}i.__signal=n,r&&(i.__name=r);function s(a){let d=typeof a=="function"?a(n.value):a;if(!(o?o(n.value,d):Object.is(d,n.value))){if(Be){let l=n.value;n.value=d;let u=Xr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&u.emit("signal:update",{signal:n,name:r,oldValue:l,newValue:d})}else n.value=d;X(n)||be(n)}}if(Be){let a=Xr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}var Se=!1;function ee(){return Se}function ze(){Se=!0}function Ie(){Se=!1}function eo(e){let t=Se;ze();try{return e()}finally{t||Ie()}}var to=globalThis;function no(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,Q(()=>t(o,void 0));else{let i=n;n=o,Q(()=>t(o,i))}}}function P(e,t){if(L(typeof e=="function","effect: argument must be a function."),ee())return()=>{};let n=t?.onError,r=n?()=>{try{e()}catch(a){n(a)}}:e,o=()=>{},i=()=>{o(),o=x(r,i)};o=x(r,i);let s=to.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return s&&s.emit("effect:create",{effectFn:e}),()=>{let a=to.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("effect:destroy",{effectFn:e}),o()}}function I(e,t){L(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r={};r._d=!1,r._g=e;let o=()=>{r._d||(r._d=!0)};o._c=1,o._sig=r,x(()=>{r._d=!1,r._v=e()},o);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;function s(){if(me)return r._d&&(r._d=!1,r._v=e()),r._v;if(Y(r),r._d){let a=r._v;x(()=>{r._d=!1,r._v=e()},o),i&&a!==r._v&&i.emit("computed:update",{signal:r,oldValue:a,newValue:r._v})}return r._v}return n&&(s.__name=n,r.__name=n),s.__signal=r,i&&i.emit("computed:create",{signal:r,name:n,getter:s}),s}function ro(e,t){if(L(typeof e=="function","watch: first argument must be a getter function."),L(typeof t=="function","watch: second argument must be a callback function."),ee())return()=>{};let n,r=!0;return x(()=>{let s=e();if(r){n=s,r=!1;return}Object.is(s,n)||(t(s,n),n=s)})}function oo(e){L(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t={};Object.keys(e).forEach(d=>{let[l,u]=E(e[d]);t[d]=[l,u]});let n=new Proxy({},{get(d,l){if(l in t){let u=t[l][0];return u()}},set(){throw new Error("[Sibu] store: Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let d={};return Object.keys(t).forEach(l=>{d[l]=t[l][0]()}),d};return[n,{setState:d=>{let l=r(),u=typeof d=="function"?d(l):d;Object.entries(u).forEach(([f,m])=>{f in t&&t[f][1](m)})},reset:()=>{Object.keys(e).forEach(d=>{let l=t[d][1];l(e[d])})},subscribe:d=>{let l=!0;return P(()=>{let u=r();if(l){l=!1;return}d(u)})},subscribeKey:(d,l)=>{let u,f=!0;return P(()=>{let m=t[d][0]();if(f){u=m,f=!1;return}if(!Object.is(m,u)){let p=u;u=m,l(m,p)}})},getSnapshot:r}]}function io(e){let[t,n]=E(e);return{get current(){return t()},set current(r){n(r)}}}function so(e){return I(e)}function ao(e){return I(e)}function co(e=[]){let[t,n]=E([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return n(d=>{let l=[...d];return a=l.splice(o,i,...s),l}),a},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,d)=>d!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,d)=>d===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function lo(e=[]){let t=[...e],n=null,r={};function o(){n=null,X(r)||be(r)}function i(){return Y(r),n===null&&(n=Object.freeze([...t])),n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,d=0,...l){let u=t.splice(a,d,...l);return(u.length>0||l.length>0)&&o(),u},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let d=t.findIndex(a);d!==-1&&(t.splice(d,1),o())},set(a){t=[...a],o()},update(a,d){a<0||a>=t.length||Object.is(t[a],d)||(t[a]=d,o())},updateWhere(a,d){let l=!1;for(let u=0;u<t.length;u++)if(a(t[u])){let f=d(t[u]);Object.is(t[u],f)||(t[u]=f,l=!0)}l&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let d=t.filter(a);d.length!==t.length&&(t=d,o())},map(a){let d=!1;for(let l=0;l<t.length;l++){let u=a(t[l],l);Object.is(t[l],u)||(t[l]=u,d=!0)}d&&o()},clear(){t.length!==0&&(t=[],o())}}]}function se(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.toString()===t.toString();if(n||(n=new Set),n.has(e))return!0;if(n.add(e),Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((i,s)=>se(i,t[s],n));let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>se(e[i],t[i],n))}function uo(e){return E(e,{equals:(t,n)=>se(t,n)})}function po(e,t,n){return[I(e,n),i=>{Ee(()=>t(i))}]}function fo(e,t){let[n,r]=E(t),[o,i]=E(!1),[s,a]=E(null),[d,l]=E(0),u=0;return P(()=>{d();let f=++u;i(!0),a(null);let m;try{m=e()}catch(p){a(p),i(!1);return}m.then(p=>{f===u&&(r(p),i(!1))},p=>{f===u&&(a(p),i(!1))})}),{value:n,loading:o,error:s,refresh:()=>l(f=>f+1)}}function ae(e,t){try{e()}catch(n){M(`${t}: callback threw: ${n instanceof Error?n.message:String(n)}`)}}function qe(e,t){if(!(typeof document>"u"))if(t){if(t.isConnected){queueMicrotask(()=>{ae(e,"onMount")});return}let n=new MutationObserver(()=>{t.isConnected&&(n.disconnect(),ae(e,"onMount"))});queueMicrotask(()=>{t.isConnected?ae(e,"onMount"):n.observe(document.body,{childList:!0,subtree:!0})})}else queueMicrotask(()=>{ae(e,"onMount")})}function mo(e,t){let n=()=>{let r=new MutationObserver(()=>{t.isConnected||(r.disconnect(),ae(e,"onUnmount"))});r.observe(document.body,{childList:!0,subtree:!0})};t.isConnected?n():qe(()=>{n()},t)}function bo(e,t){A(t,e)}function go(e){let[t,n]=E(e);return{provide(r){n(r)},use(){return t},get(){return t()},set(r){n(r)}}}function ho(e){let t=e();return _()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[Sibu strict] second run threw:",n)}}),t}function yo(e){if(!_())return P(e);let t=P(e),n=null;return queueMicrotask(()=>{try{n=P(e)}catch(r){console.warn("[Sibu strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function xo(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}function To(e){let[t,n]=E(e()),r=!1,o=t(),i=()=>{r=!1,n(o)},s=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(i):i()}))};return x(()=>{o=e(),s()}),t}var vo=16;function ei(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:vo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,vo)}function ko(){let[e,t]=E(!1);function n(r){t(!0),ei(()=>{let o;try{o=r()}catch{t(!1);return}o&&typeof o.then=="function"?o.then(()=>t(!1),()=>t(!1)):t(!1)})}return{pending:e,start:n}}function $e(e){let t=null;return function(){if(t)return t();let[r,o]=E("loading"),[i,s]=E(null),a=h({class:"sibu-lazy"});return e().then(d=>{t=d.default;let l=t();a.replaceChildren(l),o("loaded")}).catch(d=>{let l=d instanceof Error?d:new Error(String(d));s(l),o("error"),a.replaceChildren(h({class:"sibu-lazy-error",nodes:`Failed to load component: ${l.message}`}))}),a.appendChild(S({class:"sibu-lazy-loading",nodes:"Loading..."})),a}}function je({nodes:e,fallback:t}){let n=h({class:"sibu-suspense"}),r=t();return n.appendChild(r),queueMicrotask(()=>{try{let o=e();if(o.classList.contains("sibu-lazy")){let i=new MutationObserver(()=>{o.querySelector(".sibu-lazy-loading")||(i.disconnect(),n.replaceChildren(o))});i.observe(o,{childList:!0,subtree:!0}),o.querySelector(".sibu-lazy-loading")||n.replaceChildren(o)}else n.replaceChildren(o)}catch{}}),n}var ti=_(),ni=`
|
|
1
|
+
"use strict";var Sibu=(()=>{var _e=Object.defineProperty;var Po=Object.getOwnPropertyDescriptor;var Do=Object.getOwnPropertyNames;var Fo=Object.prototype.hasOwnProperty;var Ye=(e,t)=>{for(var n in t)_e(e,n,{get:t[n],enumerable:!0})},Ho=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Do(t))!Fo.call(e,o)&&o!==n&&_e(e,o,{get:()=>t[o],enumerable:!(r=Po(t,o))||r.enumerable});return e};var Bo=e=>Ho(_e({},"__esModule",{value:!0}),e);var pi={};Ye(pi,{DynamicComponent:()=>Hr,ErrorBoundary:()=>_o,ErrorDisplay:()=>Ce,Fragment:()=>Or,KeepAlive:()=>$r,Loading:()=>Lo,Portal:()=>Pr,SVG_NS:()=>k,Suspense:()=>Ke,__resetIdCounter:()=>Zr,a:()=>Rt,abbr:()=>Ot,action:()=>qr,address:()=>gt,area:()=>on,array:()=>co,article:()=>ut,aside:()=>bt,asyncDerived:()=>fo,audio:()=>sn,autoResize:()=>Wr,b:()=>Pt,base:()=>er,batch:()=>ke,bdi:()=>Dt,bdo:()=>Ft,bindDynamic:()=>Le,blockquote:()=>kt,body:()=>at,br:()=>Ht,button:()=>X,canvas:()=>vn,caption:()=>Sn,catchError:()=>Jr,catchErrorAsync:()=>Qr,center:()=>Er,checkLeaks:()=>ot,circle:()=>rr,cite:()=>Bt,clickOutside:()=>Kr,clipPath:()=>mr,code:()=>Te,col:()=>Cn,colgroup:()=>An,context:()=>go,copyOnClick:()=>Vr,createId:()=>Yr,customElement:()=>Cr,data:()=>zt,datalist:()=>Dn,dd:()=>Et,deepEqual:()=>ee,deepSignal:()=>uo,defer:()=>To,defs:()=>fr,del:()=>En,derived:()=>we,details:()=>Gn,dfn:()=>It,dialog:()=>Jn,disableSSR:()=>Ie,dispose:()=>R,div:()=>h,dl:()=>wt,dt:()=>St,each:()=>Mr,effect:()=>P,ellipse:()=>or,em:()=>jt,embed:()=>dn,enableSSR:()=>ze,enqueueBatchedSignal:()=>Y,fieldset:()=>Fn,figcaption:()=>Ct,figure:()=>At,font:()=>wr,footer:()=>pt,form:()=>Hn,g:()=>ir,getSlot:()=>Br,h1:()=>ht,h2:()=>yt,h3:()=>xe,h4:()=>xt,h5:()=>vt,h6:()=>Tt,head:()=>st,header:()=>dt,hr:()=>_t,html:()=>Oe,i:()=>$t,iframe:()=>pn,img:()=>an,input:()=>Bn,ins:()=>wn,isBatching:()=>eo,isSSR:()=>Z,kbd:()=>qt,label:()=>zn,lazy:()=>qe,legend:()=>In,li:()=>Nt,line:()=>sr,linearGradient:()=>hr,link:()=>tr,longPress:()=>Ur,main:()=>mt,map:()=>cn,mark:()=>Kt,marker:()=>kr,marquee:()=>Sr,mask:()=>br,match:()=>jr,math:()=>xn,menu:()=>Qn,meta:()=>nr,meter:()=>jn,mount:()=>Nr,nav:()=>ft,nextTick:()=>xo,noscript:()=>Tn,object:()=>fn,ol:()=>Lt,on:()=>oo,onCleanup:()=>bo,onMount:()=>$e,onUnmount:()=>mo,optgroup:()=>$n,option:()=>qn,output:()=>Kn,p:()=>ye,param:()=>mn,path:()=>ar,pattern:()=>gr,picture:()=>bn,polygon:()=>cr,polyline:()=>lr,portal:()=>gn,pre:()=>ve,progress:()=>Un,q:()=>Ut,radialGradient:()=>yr,reactiveArray:()=>lo,rect:()=>ur,ref:()=>ao,registerComponent:()=>Dr,registerDisposer:()=>E,resolveComponent:()=>De,rp:()=>Vt,rt:()=>Wt,ruby:()=>Gt,s:()=>Jt,samp:()=>Qt,script:()=>kn,section:()=>lt,select:()=>Vn,setGlobalErrorHandler:()=>Xr,show:()=>zr,signal:()=>w,slot:()=>Yn,small:()=>Xt,source:()=>hn,span:()=>S,stop:()=>xr,store:()=>so,strict:()=>ho,strictEffect:()=>yo,strong:()=>Yt,style:()=>z,sub:()=>Zt,summary:()=>Xn,sup:()=>en,svg:()=>yn,symbol:()=>Tr,table:()=>_n,tagFactory:()=>c,tbody:()=>Nn,td:()=>Ln,template:()=>Zn,text:()=>dr,textarea:()=>Wn,tfoot:()=>Mn,th:()=>Rn,thead:()=>On,time:()=>tn,title:()=>ct,tr:()=>Pn,track:()=>ln,transition:()=>ko,trapFocus:()=>Gr,tspan:()=>pr,u:()=>nn,ul:()=>Mt,unregisterComponent:()=>Fr,untracked:()=>J,use:()=>vr,var_:()=>rn,video:()=>un,watch:()=>io,when:()=>Ir,withSSR:()=>no,writable:()=>po});var Ve={};Ye(Ve,{DynamicComponent:()=>Hr,ErrorBoundary:()=>_o,ErrorDisplay:()=>Ce,Fragment:()=>Or,KeepAlive:()=>$r,Loading:()=>Lo,Portal:()=>Pr,SVG_NS:()=>k,Suspense:()=>Ke,__resetIdCounter:()=>Zr,a:()=>Rt,abbr:()=>Ot,action:()=>qr,address:()=>gt,area:()=>on,array:()=>co,article:()=>ut,aside:()=>bt,asyncDerived:()=>fo,audio:()=>sn,autoResize:()=>Wr,b:()=>Pt,base:()=>er,batch:()=>ke,bdi:()=>Dt,bdo:()=>Ft,bindDynamic:()=>Le,blockquote:()=>kt,body:()=>at,br:()=>Ht,button:()=>X,canvas:()=>vn,caption:()=>Sn,catchError:()=>Jr,catchErrorAsync:()=>Qr,center:()=>Er,checkLeaks:()=>ot,circle:()=>rr,cite:()=>Bt,clickOutside:()=>Kr,clipPath:()=>mr,code:()=>Te,col:()=>Cn,colgroup:()=>An,context:()=>go,copyOnClick:()=>Vr,createId:()=>Yr,customElement:()=>Cr,data:()=>zt,datalist:()=>Dn,dd:()=>Et,deepEqual:()=>ee,deepSignal:()=>uo,defer:()=>To,defs:()=>fr,del:()=>En,derived:()=>we,details:()=>Gn,dfn:()=>It,dialog:()=>Jn,disableSSR:()=>Ie,dispose:()=>R,div:()=>h,dl:()=>wt,dt:()=>St,each:()=>Mr,effect:()=>P,ellipse:()=>or,em:()=>jt,embed:()=>dn,enableSSR:()=>ze,enqueueBatchedSignal:()=>Y,fieldset:()=>Fn,figcaption:()=>Ct,figure:()=>At,font:()=>wr,footer:()=>pt,form:()=>Hn,g:()=>ir,getSlot:()=>Br,h1:()=>ht,h2:()=>yt,h3:()=>xe,h4:()=>xt,h5:()=>vt,h6:()=>Tt,head:()=>st,header:()=>dt,hr:()=>_t,html:()=>Oe,i:()=>$t,iframe:()=>pn,img:()=>an,input:()=>Bn,ins:()=>wn,isBatching:()=>eo,isSSR:()=>Z,kbd:()=>qt,label:()=>zn,lazy:()=>qe,legend:()=>In,li:()=>Nt,line:()=>sr,linearGradient:()=>hr,link:()=>tr,longPress:()=>Ur,main:()=>mt,map:()=>cn,mark:()=>Kt,marker:()=>kr,marquee:()=>Sr,mask:()=>br,match:()=>jr,math:()=>xn,menu:()=>Qn,meta:()=>nr,meter:()=>jn,mount:()=>Nr,nav:()=>ft,nextTick:()=>xo,noscript:()=>Tn,object:()=>fn,ol:()=>Lt,on:()=>oo,onCleanup:()=>bo,onMount:()=>$e,onUnmount:()=>mo,optgroup:()=>$n,option:()=>qn,output:()=>Kn,p:()=>ye,param:()=>mn,path:()=>ar,pattern:()=>gr,picture:()=>bn,polygon:()=>cr,polyline:()=>lr,portal:()=>gn,pre:()=>ve,progress:()=>Un,q:()=>Ut,radialGradient:()=>yr,reactiveArray:()=>lo,rect:()=>ur,ref:()=>ao,registerComponent:()=>Dr,registerDisposer:()=>E,resolveComponent:()=>De,rp:()=>Vt,rt:()=>Wt,ruby:()=>Gt,s:()=>Jt,samp:()=>Qt,script:()=>kn,section:()=>lt,select:()=>Vn,setGlobalErrorHandler:()=>Xr,show:()=>zr,signal:()=>w,slot:()=>Yn,small:()=>Xt,source:()=>hn,span:()=>S,stop:()=>xr,store:()=>so,strict:()=>ho,strictEffect:()=>yo,strong:()=>Yt,style:()=>z,sub:()=>Zt,summary:()=>Xn,sup:()=>en,svg:()=>yn,symbol:()=>Tr,table:()=>_n,tagFactory:()=>c,tbody:()=>Nn,td:()=>Ln,template:()=>Zn,text:()=>dr,textarea:()=>Wn,tfoot:()=>Mn,th:()=>Rn,thead:()=>On,time:()=>tn,title:()=>ct,tr:()=>Pn,track:()=>ln,transition:()=>ko,trapFocus:()=>Gr,tspan:()=>pr,u:()=>nn,ul:()=>Mt,unregisterComponent:()=>Fr,untracked:()=>J,use:()=>vr,var_:()=>rn,video:()=>un,watch:()=>io,when:()=>Ir,withSSR:()=>no,writable:()=>po});function _(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}var Ze=_();function L(e,t){if(Ze&&!e)throw new Error(`[Sibu] ${t}`)}function M(e){Ze&&console.warn(`[Sibu] ${e}`)}function j(e){let t=e.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!t)return"";let n=t.toLowerCase();return n.startsWith("javascript:")||n.startsWith("data:")||n.startsWith("vbscript:")||n.startsWith("blob:")?"":t}function Ne(e){let t=e.toLowerCase().replace(/\s+/g,"");return t.includes("url(")||t.includes("expression(")||t.includes("javascript:")||t.includes("-moz-binding")?"":e}var zo=new Set(["href","src","action","formaction","cite","poster","background","srcset"]);function $(e){return zo.has(e)}var Io=_(),W=new Array(32),G=32,F=-1,B=null,jo=new WeakMap,q="__s",H=0,A=[],O=new Set;function re(e){try{e()}catch(t){Io&&M(`Subscriber threw during notification: ${t instanceof Error?t.message:String(t)}`)}}var de=0,pe=!1;function x(e,t){t||(t=e),tt(t),++F,F>=G&&(G*=2,W.length=G),W[F]=t,B=t;try{e()}finally{F--,B=F>=0?W[F]:null}return()=>tt(t)}function $o(){de===0&&(++F,F>=G&&(G*=2,W.length=G),W[F]=null,B=null,pe=!0),de++}function qo(){de--,de===0&&(F--,B=F>=0?W[F]:null,pe=!1)}function J(e){$o();try{return e()}finally{qo()}}function Q(e){if(!B)return;let t=B;if(t._dep===e)return;let n=t._deps;if(n){if(n.has(e))return;n.add(e)}else if(t._dep!==void 0){let o=new Set;o.add(t._dep),o.add(e),t._deps=o,t._dep=void 0}else t._dep=e;let r=e[q];r||(r=new Set,jo.set(e,r),e[q]=r),r.add(B),r.size===1?e.__f=B:e.__f!==void 0&&(e.__f=void 0)}function nt(e){let t=e[q];if(t)for(let n of t)n._c?V(n):O.has(n)||(O.add(n),A.push(n))}var et=1e3;function rt(){if(!(H>0)){H++;try{let e=0;for(;e<A.length;){if(e>=et){typeof console<"u"&&console.error(`[SibuJS] Notification queue exceeded ${et} iterations \u2014 likely an effect that writes to a signal it reads. Breaking to prevent infinite loop.`);break}re(A[e]),e++}}finally{A.length=0,O.clear(),H--}}}function V(e){e();let t=e._sig;for(;t;){let n=t.__f;if(n){if(n._c){let i=n._sig;i._d=!0,t=i;continue}O.has(n)||(O.add(n),A.push(n));break}let r=t[q];if(!r)break;let o;for(let i of r)if(i._c){i();let s=i._sig;s&&!o?o=s:s&&V(i)}else O.has(i)||(O.add(i),A.push(i));t=o}}function fe(e){let t=e.__f;if(t){if(H>0){t._c?V(t):O.has(t)||(O.add(t),A.push(t));return}H++;try{t._c?V(t):re(t);let r=0;for(;r<A.length;)re(A[r]),r++}finally{A.length=0,O.clear(),H--}return}let n=e[q];if(!(!n||n.size===0)){if(H>0){for(let r of n)r._c?V(r):O.has(r)||(O.add(r),A.push(r));return}H++;try{let r=0;for(let i of n)A[r++]=i;for(let i=0;i<r;i++)A[i]._c&&V(A[i]);for(let i=0;i<r;i++)A[i]._c||O.has(A[i])||re(A[i]);let o=r;for(;o<A.length;)re(A[o]),o++}finally{A.length=0,O.clear(),H--}}}function tt(e){let t=e,n=t._dep;if(n!==void 0){let o=n[q];o&&(o.delete(e),n.__f===e&&(n.__f=void 0)),t._dep=void 0;return}let r=t._deps;if(!(!r||r.size===0)){for(let o of r){let i=o[q];i&&(i.delete(e),o.__f===e&&(o.__f=void 0))}r.clear()}}var me=_();function Ko(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}function be(e,t,n){if(Ko(t))return me&&M(`bindAttribute: refusing to bind event-handler attribute "${t}". Use on:{ ${t.slice(2)}: fn } instead.`),()=>{};function r(){let i;try{i=n()}catch(a){me&&M(`bindAttribute: getter for "${t}" threw: ${a instanceof Error?a.message:String(a)}`);return}if(typeof i=="boolean"){t in e&&(t==="checked"||t==="disabled"||t==="selected")?e[t]=i:i?e.setAttribute(t,""):e.removeAttribute(t);return}let s=String(i);(t==="value"||t==="checked")&&t in e?e[t]=t==="checked"?!!i:s:e.setAttribute(t,$(t)?j(s):s)}return x(r)}function Le(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){me&&M(`bindDynamic: name getter threw: ${l instanceof Error?l.message:String(l)}`);return}let a;try{a=typeof n=="function"?n():n}catch(l){me&&M(`bindDynamic: value getter threw: ${l instanceof Error?l.message:String(l)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;r!==null&&r!==s&&e.removeAttribute(r);let u=String(a);(s==="value"||s==="checked")&&s in e?e[s]=s==="checked"?!!a:u:e.setAttribute(s,$(s)?j(u):u),r=s}let i=x(o);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Uo=_();function K(e,t){let n=[];function r(){let o;try{o=t()}catch(l){Uo&&M(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}if(o==null||typeof o=="boolean"){for(let l=0;l<n.length;l++){let d=n[l];d.parentNode&&d.parentNode.removeChild(d)}n.length=0;return}let i=e.parentNode;if(!i){n.length=0;return}let s;if(Array.isArray(o)){s=[];for(let l=0;l<o.length;l++){let d=o[l];d==null||typeof d=="boolean"||s.push(d instanceof Node?d:document.createTextNode(String(d)))}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let a=n.length>0&&s.length>0?new Set:void 0;if(a){for(let l=0;l<s.length;l++)for(let d=0;d<n.length;d++)if(s[l]===n[d]){a.add(s[l]);break}}for(let l=0;l<n.length;l++){let d=n[l];a?.has(d)||d.parentNode&&d.parentNode.removeChild(d)}let u=e.nextSibling;for(let l=0;l<s.length;l++){let d=s[l];a?.has(d)&&d.parentNode===i?d.nextSibling!==u&&i.insertBefore(d,u):i.insertBefore(d,u)}n=s}return x(r)}var ge=new WeakMap,he=_(),oe=0;function E(e,t){let n=ge.get(e);n||(n=[],ge.set(e,n)),n.push(t),he&&oe++}function R(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=r.childNodes;for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--){let o=n[r],i=ge.get(o);if(i){he&&(oe-=i.length);for(let s of i)try{s()}catch(a){he&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",a)}ge.delete(o)}}}function ot(e=0){return he?(e>0&&oe>e&&M(`checkLeaks: ${oe} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),oe):0}var k="http://www.w3.org/2000/svg",it=new Map;function Vo(e){let t=it.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),it.set(e,t)),t}function Wo(e,t){if(typeof t=="function"){let r=x(()=>{e.setAttribute("style",t())});E(e,r);return}if(typeof t=="string"){e.setAttribute("style",t);return}let n=e;for(let r in t){let o=t[r],i=Vo(r);if(typeof o=="function"){let s=o,a=x(()=>{n.style.setProperty(i,Ne(String(s())))});E(e,a)}else n.style.setProperty(i,Ne(String(o)))}}function Go(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=x(()=>{e.setAttribute("class",t())});E(e,i);return}let n=t,r=!1,o="";for(let i in n){let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=x(()=>{let a="";for(let u in n){let l=n[u];(typeof l=="function"?l():l)&&(a=a?`${a} ${u}`:u)}e.setAttribute("class",a)});E(e,s)}else e.setAttribute("class",o)}function Me(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),E(e,K(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),E(e,K(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),E(e,K(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}var c=(e,t)=>(n,r)=>{let o=t?document.createElementNS(t,e):document.createElement(e);if(n===void 0)return o;if(typeof n=="string")return r!==void 0?(o.setAttribute("class",n),Me(o,r),o):(o.textContent=n,o);if(typeof n=="number")return o.textContent=String(n),o;if(Array.isArray(n)||n instanceof Node||typeof n=="function")return Me(o,n),o;let i=n,s=i.class;s!=null&&Go(o,s);let a=i.id;a!=null&&(o.id=a);let u=r!==void 0?r:i.nodes;u!=null&&Me(o,u);let l=i.on;if(l)for(let m in l)o.addEventListener(m,l[m]);let d=i.style;d!=null&&Wo(o,d);let f=i.ref;f&&(f.current=o);for(let m in i)switch(m){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let p=i[m];if(p==null||m[0]==="o"&&m[1]==="n")continue;if(typeof p=="function")E(o,be(o,m,p));else if(typeof p=="boolean")m in o&&(m==="checked"||m==="disabled"||m==="selected")?o[m]=p:p?o.setAttribute(m,""):o.removeAttribute(m);else{let b=String(p);o.setAttribute(m,$(m)?j(b):b)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var Pi=c("html"),st=c("head"),at=c("body"),ct=c("title"),h=c("div"),S=c("span"),lt=c("section"),ut=c("article"),dt=c("header"),pt=c("footer"),ft=c("nav"),mt=c("main"),bt=c("aside"),gt=c("address"),ye=c("p"),ht=c("h1"),yt=c("h2"),xe=c("h3"),xt=c("h4"),vt=c("h5"),Tt=c("h6"),kt=c("blockquote"),Et=c("dd"),wt=c("dl"),St=c("dt"),Ct=c("figcaption"),At=c("figure"),_t=c("hr"),Nt=c("li"),Lt=c("ol"),Mt=c("ul"),ve=c("pre"),Rt=c("a"),Ot=c("abbr"),Pt=c("b"),Dt=c("bdi"),Ft=c("bdo"),Ht=c("br"),Bt=c("cite"),Te=c("code"),zt=c("data"),It=c("dfn"),jt=c("em"),$t=c("i"),qt=c("kbd"),Kt=c("mark"),Ut=c("q"),Vt=c("rp"),Wt=c("rt"),Gt=c("ruby"),Jt=c("s"),Qt=c("samp"),Xt=c("small"),Yt=c("strong"),Zt=c("sub"),en=c("sup"),tn=c("time"),nn=c("u"),rn=c("var"),on=c("area"),sn=c("audio"),an=c("img"),cn=c("map"),ln=c("track"),un=c("video"),dn=c("embed"),pn=c("iframe"),fn=c("object"),mn=c("param"),bn=c("picture"),gn=c("portal"),hn=c("source"),yn=c("svg",k),xn=c("math"),vn=c("canvas"),Tn=c("noscript"),kn=c("script"),En=c("del"),wn=c("ins"),Sn=c("caption"),Cn=c("col"),An=c("colgroup"),_n=c("table"),Nn=c("tbody"),Ln=c("td"),Mn=c("tfoot"),Rn=c("th"),On=c("thead"),Pn=c("tr"),X=c("button"),Dn=c("datalist"),Fn=c("fieldset"),Hn=c("form"),Bn=c("input"),zn=c("label"),In=c("legend"),jn=c("meter"),$n=c("optgroup"),qn=c("option"),Kn=c("output"),Un=c("progress"),Vn=c("select"),Wn=c("textarea"),Gn=c("details"),Jn=c("dialog"),Qn=c("menu"),Xn=c("summary"),Yn=c("slot"),Zn=c("template"),er=c("base"),tr=c("link"),nr=c("meta"),z=c("style"),rr=c("circle",k),or=c("ellipse",k),ir=c("g",k),sr=c("line",k),ar=c("path",k),cr=c("polygon",k),lr=c("polyline",k),ur=c("rect",k),dr=c("text",k),pr=c("tspan",k),fr=c("defs",k),mr=c("clipPath",k),br=c("mask",k),gr=c("pattern",k),hr=c("linearGradient",k),yr=c("radialGradient",k),xr=c("stop",k),vr=c("use",k),Tr=c("symbol",k),kr=c("marker",k),Er=c("center"),wr=c("font"),Sr=c("marquee"),Cr=e=>c(e);var Jo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ar=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),_r=new WeakMap;function Qo(e){let t=e.length-1,n=e[0];for(let p=0;p<t;p++)n+=`\0${p}\0${e[p+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
2
|
+
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let p=r;r++;let b=0;for(;r<o&&n.charCodeAt(r)!==0;)b=b*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,b<0||b>=t?(r=p,-1):b}function a(){let p=r;for(;r<o;){let b=n.charCodeAt(r);if(b>=97&&b<=122||b>=65&&b<=90||b>=48&&b<=57||b===45)r++;else break}return n.slice(p,r)}function u(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let p=s();if(p>=0)return{kind:"expr",idx:p};let b=n[r];if(b==='"'||b==="'"){r++;let y=[],D=[],I="";for(;r<o&&n[r]!==b;){let se=s();se>=0?(y.push(I),I="",D.push(se)):I+=n[r++]}return r<o&&r++,y.push(I),D.length===0?{kind:"static",value:y[0]}:{kind:"mixed",statics:y,exprs:D}}let T=r;for(;r<o;){let y=n.charCodeAt(r);if(y===32||y===9||y===10||y===13||y===62||y===47)break;r++}return{kind:"static",value:n.slice(T,r)}}function l(){let p=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let b=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let T=n.slice(b,r);if(!T)break;let v=u();T.startsWith("on:")?v.kind==="expr"&&p.push({t:3,name:T.slice(3),idx:v.idx}):v.kind==="bool"?p.push({t:4,name:T}):v.kind==="static"?p.push({t:0,name:T,value:v.value}):v.kind==="expr"?p.push({t:1,name:T,idx:v.idx}):v.kind==="mixed"&&p.push({t:2,name:T,statics:v.statics,exprs:v.exprs})}return p}function d(p){return p.replace(/\s+/g," ")}function f(p){let b="";for(;r<o&&n[r]!=="<";){let v=s();if(v>=0){let y=d(b);y&&p.push({t:1,value:y}),b="",p.push({t:2,idx:v})}else b+=n[r++]}let T=d(b);T&&p.push({t:1,value:T})}function m(){let p=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){r++;let b=a(),T=l();i();let v=Jo.has(b),y=n[r]==="/";if(y&&r++,r<o&&r++,v||y)p.push({t:0,el:{tag:b,svg:Ar.has(b),attrs:T,children:[]}});else{let D=m();n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),p.push({t:0,el:{tag:b,svg:Ar.has(b),attrs:T,children:D}})}}else f(p);return p}return m()}function Re(e,t){let n=e.svg?document.createElementNS(k,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:n.setAttribute(o.name,o.value);break;case 1:{let i=o.name;if(i[0]==="o"&&i[1]==="n")break;let s=t[o.idx];if(typeof s=="function")E(n,be(n,i,s));else if(s!=null){let a=String(s);n.setAttribute(i,$(i)?j(a):a)}break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++)i+=String(t[o.exprs[s]])+o.statics[s+1];n.setAttribute(o.name,i);break}case 3:n.addEventListener(o.name,t[o.idx]);break;case 4:n.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(Re(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),E(n,K(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Oe(e,...t){let n=_r.get(e);if(n||(n=Qo(e),_r.set(e,n)),n.length===1&&n[0].t===0)return Re(n[0].el,t);let r=document.createElement("div");for(let o=0;o<n.length;o++){let i=n[o];switch(i.t){case 0:r.appendChild(Re(i.el,t));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=t[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),E(r,K(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let u=s[a];u instanceof Node?r.appendChild(u):u!=null&&typeof u!="boolean"&&r.appendChild(document.createTextNode(String(u)))}else s!=null&&typeof s!="boolean"&&r.appendChild(document.createTextNode(String(s)));break}}}return r.childNodes.length===1&&r.firstChild instanceof Element?r.firstChild:r}function Nr(e,t){if(!t)throw new Error("[Sibu] mount: container element not found. Make sure the DOM element exists before calling mount().");L(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-n:0;t.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:t,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),R(r),r.parentNode&&r.parentNode.removeChild(r)}}}var Xo=_();function Lr(e){return typeof e=="function"?Lr(e()):e instanceof Node?e:document.createTextNode(String(e))}function Yo(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let u=e[a],l=0,d=n.length;for(;l<d;){let f=l+d>>1;e[n[f]]<u?l=f+1:d=f}n[l]=a,r[a]=l>0?n[l-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Mr(e,t,n){L(typeof e=="function","each: first argument must be a function that returns an array."),L(typeof t=="function","each: second argument must be a render function."),L(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,u=0,l=new Map,d=new Map,f=[],m=[],p=new Uint8Array(0),b=new Map,T=[],v=[],y=new Map,D=!1,I=!1,se=n.key,We=()=>{let Ge=e(),C=Ge.length,ae=r.parentNode;if(!ae)return;I||(ae.insertBefore(o,r.nextSibling),I=!0),m.length<C&&(m=new Array(C));for(let g=0;g<C;g++)m[g]=se(Ge[g]);let te=m;f.length<C&&(f=new Array(C)),d.clear(),y.clear();for(let g=0;g<C;g++)y.set(te[g],g);for(let g=0;g<C;g++){let N=te[g],Qe=l.get(N),ne;if(Qe!==void 0)ne=Qe;else{let Xe=N,Ro=()=>e()[y.get(Xe)],Oo=()=>y.get(Xe);try{ne=Lr(t(Ro,Oo))}catch(Ae){Xo&&M(`each: render threw for item at index ${g} (key="${te[g]}"): ${Ae instanceof Error?Ae.message:String(Ae)}`),ne=document.createComment(`each:error:${g}`)}}d.set(N,ne),f[g]=ne}for(let[g,N]of l)d.has(g)||(R(N),N.parentNode&&ae.removeChild(N));if(C===0){u=0;let g=l;l=d,d=g;return}b.clear();for(let g=0;g<u;g++)b.set(a[g],g);T.length<C&&(T=new Array(C),v=new Array(C));let ce=0;for(let g=0;g<C;g++){let N=b.get(te[g]);N!==void 0&&(T[ce]=g,v[ce]=N,ce++)}let Je=Yo(v,ce);p.length<C?p=new Uint8Array(C):p.fill(0,0,C);for(let g=0;g<Je.length;g++)p[T[Je[g]]]=1;let le=o;for(let g=C-1;g>=0;g--){let N=f[g];p[g]||N.nextSibling!==le&&ae.insertBefore(N,le),le=N}let ue=a===i?s:i;ue.length<C&&(ue.length=C);for(let g=0;g<C;g++)ue[g]=te[g];a=ue,u=C;let Mo=l;l=d,d=Mo,D=!0};return x(We),D||queueMicrotask(()=>{!D&&r.parentNode&&We()}),r}function Or(e){let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||t.appendChild(Rr(r));else t.appendChild(Rr(n));return t}function Rr(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let t=e();return t instanceof Node?t:document.createTextNode(String(t??""))}return document.createTextNode(String(e))}function Pr(e,t){let n=document.createComment("portal"),r=t||document.body,o=null;return queueMicrotask(()=>{try{o=e(),r.appendChild(o)}catch(i){typeof console<"u"&&console.error("[Portal] Render error:",i)}}),E(n,()=>{o&&(R(o),o.remove(),o=null)}),n}var Pe=new Map;function Dr(e,t){Pe.set(e,t)}function Fr(e){Pe.delete(e)}function De(e){let t=Pe.get(e);return t?t():h({nodes:`[Component "${e}" not found]`})}function Hr(e){let t=h({class:"sibu-dynamic"});function n(){let r=e(),o;typeof r=="function"?o=r():o=De(r);for(let i of Array.from(t.childNodes))R(i);t.replaceChildren(o)}return x(n),t}function Br(e,t="default"){return e?.[t]}function zr(e,t){return x(()=>{t.style.display=e()?"":"none"}),t}function Ir(e,t,n){let r=document.createComment("when"),o=null,i,s=!1,a=()=>{let u=e(),l=r.parentNode;if(!l||s&&u===i)return;i=u,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=u?t():n?n():null;if(d!=null){let f=d instanceof Node?d:document.createTextNode(String(d));l.insertBefore(f,r.nextSibling),o=f}s=!0};return x(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function jr(e,t,n){let r=document.createComment("match"),o=null,i,s=!1,a=()=>{let u=String(e()),l=r.parentNode;if(!l||s&&u===i)return;i=u,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=t[u]||n;if(d){let f=d();if(f!=null){let m=f instanceof Node?f:document.createTextNode(String(f));l.insertBefore(m,r.nextSibling),o=m}}s=!0};return x(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function $r(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??0,a,u=null,l=!1,d=()=>{let f=e(),m=r.parentNode;if(!m||l&&f===a)return;u?.parentNode&&m.removeChild(u),a=f;let p=o.get(f);if(p){let b=i.indexOf(f);b!==-1&&(i.splice(b,1),i.push(f))}else{let b=t[f];if(!b){u=null,l=!0;return}if(p=b(),o.set(f,p),i.push(f),s>0&&i.length>s){let T=i.shift(),v=o.get(T);v&&(R(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(T))}}m.insertBefore(p,r.nextSibling),u=p,l=!0};return x(d),l||queueMicrotask(()=>{!l&&r.parentNode&&d()}),r}function qr(e,t,n){let r=t(e,n);typeof r=="function"&&E(e,r)}var Kr=(e,t)=>{let n=r=>{e.contains(r.target)||t()};return document.addEventListener("pointerdown",n,!0),()=>document.removeEventListener("pointerdown",n,!0)},Ur=(e,t)=>{let n=t.duration??500,r=null,o=()=>{r=setTimeout(()=>{t.callback(),r=null},n)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},Vr=(e,t)=>{let n=()=>{let r=typeof t=="function"?t():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",n),()=>e.removeEventListener("click",n)},Wr=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},Gr=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};var U=null;function Jr(e,t){try{let n=e();return n&&typeof n.then=="function"&&n.catch(r=>{t?t(r,"async"):U?U(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),n}catch(n){return t?t(n,"sync"):U?U(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Qr(e,t){try{return await e()}catch(n){return t?t(n,"async"):U?U(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Xr(e){U=e}var Fe=0;function Yr(e="sibu"){return Fe++,`${e}-${Fe}`}function Zr(){Fe=0}var ie=0,He=new Set;function ke(e){ie++;try{return e()}finally{ie--,ie===0&&Zo()}}function Y(e){return ie===0?!1:(He.add(e),!0)}function eo(){return ie>0}function Zo(){for(let e of He)nt(e);He.clear(),rt()}var to=globalThis,Be=_();function w(e,t){let n={value:e},r=Be?t?.name:void 0,o=t?.equals;r&&(n.__name=r);function i(){return Q(n),n.value}i.__signal=n,r&&(i.__name=r);function s(a){let u=typeof a=="function"?a(n.value):a;if(!(o?o(n.value,u):Object.is(u,n.value))){if(Be){let l=n.value;n.value=u;let d=to.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:n,name:r,oldValue:l,newValue:u})}else n.value=u;Y(n)||fe(n)}}if(Be){let a=to.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}var Ee=!1;function Z(){return Ee}function ze(){Ee=!0}function Ie(){Ee=!1}function no(e){let t=Ee;ze();try{return e()}finally{t||Ie()}}var ro=globalThis;function oo(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,J(()=>t(o,void 0));else{let i=n;n=o,J(()=>t(o,i))}}}function P(e,t){if(L(typeof e=="function","effect: argument must be a function."),Z())return()=>{};let n=t?.onError,r=n?()=>{try{e()}catch(a){n(a)}}:e,o=()=>{},i=()=>{o(),o=x(r,i)};o=x(r,i);let s=ro.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return s&&s.emit("effect:create",{effectFn:e}),()=>{let a=ro.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("effect:destroy",{effectFn:e}),o()}}function we(e,t){L(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r={};r._d=!1,r._g=e;let o=()=>{r._d||(r._d=!0)};o._c=1,o._sig=r,x(()=>{r._d=!1,r._v=e()},o);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,s=!1;function a(){if(s)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);if(pe){if(r._d){s=!0;try{r._d=!1,r._v=e()}finally{s=!1}}return r._v}if(Q(r),r._d){let u=r._v;s=!0;try{x(()=>{r._d=!1,r._v=e()},o)}finally{s=!1}i&&u!==r._v&&i.emit("computed:update",{signal:r,oldValue:u,newValue:r._v})}return r._v}return n&&(a.__name=n,r.__name=n),a.__signal=r,i&&i.emit("computed:create",{signal:r,name:n,getter:a}),a}function io(e,t){if(L(typeof e=="function","watch: first argument must be a getter function."),L(typeof t=="function","watch: second argument must be a callback function."),Z())return()=>{};let n,r=!0;return x(()=>{let s=e();if(r){n=s,r=!1;return}Object.is(s,n)||(t(s,n),n=s)})}function so(e){L(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t={};Object.keys(e).forEach(u=>{let[l,d]=w(e[u]);t[u]=[l,d]});let n=new Proxy({},{get(u,l){if(l in t){let d=t[l][0];return d()}},set(){throw new Error("[Sibu] store: Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let u={};return Object.keys(t).forEach(l=>{u[l]=t[l][0]()}),u};return[n,{setState:u=>{let l=r(),d=typeof u=="function"?u(l):u;Object.entries(d).forEach(([f,m])=>{f in t&&t[f][1](m)})},reset:()=>{Object.keys(e).forEach(u=>{let l=t[u][1];l(e[u])})},subscribe:u=>{let l=!0;return P(()=>{let d=r();if(l){l=!1;return}u(d)})},subscribeKey:(u,l)=>{let d,f=!0;return P(()=>{let m=t[u][0]();if(f){d=m,f=!1;return}if(!Object.is(m,d)){let p=d;d=m,l(m,p)}})},getSnapshot:r}]}function ao(e){let[t,n]=w(e);return{get current(){return t()},set current(r){n(r)}}}function co(e=[]){let[t,n]=w([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return n(u=>{let l=[...u];return a=l.splice(o,i,...s),l}),a},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,u)=>u!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,u)=>u===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function lo(e=[]){let t=[...e],n=null,r={};function o(){n=null,Y(r)||fe(r)}function i(){return Q(r),n===null&&(n=Object.freeze([...t])),n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,u=0,...l){let d=t.splice(a,u,...l);return(d.length>0||l.length>0)&&o(),d},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let u=t.findIndex(a);u!==-1&&(t.splice(u,1),o())},set(a){t=[...a],o()},update(a,u){a<0||a>=t.length||Object.is(t[a],u)||(t[a]=u,o())},updateWhere(a,u){let l=!1;for(let d=0;d<t.length;d++)if(a(t[d])){let f=u(t[d]);Object.is(t[d],f)||(t[d]=f,l=!0)}l&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let u=t.filter(a);u.length!==t.length&&(t=u,o())},map(a){let u=!1;for(let l=0;l<t.length;l++){let d=a(t[l],l);Object.is(t[l],d)||(t[l]=d,u=!0)}u&&o()},clear(){t.length!==0&&(t=[],o())}}]}function ee(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let u=t;return e.source===u.source&&e.flags===u.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let u=t;if(e.size!==u.size)return!1;for(let[l,d]of e)if(!u.has(l)||!ee(d,u.get(l),n))return!1;return!0}if(e instanceof Set){let u=t;if(e.size!==u.size)return!1;for(let l of e)if(!u.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let u=new Uint8Array(e),l=new Uint8Array(t);if(u.length!==l.length)return!1;for(let d=0;d<u.length;d++)if(u[d]!==l[d])return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let u=e,l=t;if(u.length!==l.length)return!1;for(let d=0;d<u.length;d++)if(u[d]!==l[d])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((u,l)=>ee(u,t[l],n));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(u=>ee(r[u],o[u],n))}function uo(e){return w(e,{equals:(t,n)=>ee(t,n)})}function po(e,t,n){return[we(e,n),i=>{ke(()=>t(i))}]}function fo(e,t){let[n,r]=w(t),[o,i]=w(!1),[s,a]=w(null),[u,l]=w(0),d=0;return P(()=>{u();let f=++d;i(!0),a(null);let m;try{m=e()}catch(p){a(p),i(!1);return}m.then(p=>{f===d&&(r(p),i(!1))},p=>{f===d&&(a(p),i(!1))})}),{value:n,loading:o,error:s,refresh:()=>l(f=>f+1)}}function Se(e,t){try{return e()}catch(n){M(`${t}: callback threw: ${n instanceof Error?n.message:String(n)}`);return}}function je(e,t,n){let r=Se(e,t);typeof r=="function"&&n&&E(n,r)}function $e(e,t){if(!(typeof document>"u"))if(t){if(t.isConnected){queueMicrotask(()=>je(e,"onMount",t));return}let n=new MutationObserver(()=>{t.isConnected&&(n.disconnect(),je(e,"onMount",t))});E(t,()=>n.disconnect()),queueMicrotask(()=>{t.isConnected?je(e,"onMount",t):n.observe(document.body,{childList:!0,subtree:!0})})}else queueMicrotask(()=>{Se(e,"onMount")})}function mo(e,t){E(t,()=>Se(e,"onUnmount"));let n=()=>{let r=new MutationObserver(()=>{t.isConnected||(r.disconnect(),Se(e,"onUnmount"))});r.observe(document.body,{childList:!0,subtree:!0}),E(t,()=>r.disconnect())};t.isConnected?n():$e(()=>{n()},t)}function bo(e,t){E(t,e)}function go(e){let[t,n]=w(e);return{provide(r){n(r)},use(){return t},get(){return t()},set(r){n(r)}}}function ho(e){let t=e();return _()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[Sibu strict] second run threw:",n)}}),t}function yo(e){if(!_())return P(e);let t=P(e),n=null;return queueMicrotask(()=>{try{n=P(e)}catch(r){console.warn("[Sibu strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function xo(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}function To(e){let[t,n]=w(e()),r=!1,o=t(),i=()=>{r=!1,n(o)},s=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(i):i()}))};return x(()=>{o=e(),s()}),t}var vo=16;function ei(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:vo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,vo)}function ko(){let[e,t]=w(!1);function n(r){t(!0),ei(()=>{let o;try{o=r()}catch{t(!1);return}o&&typeof o.then=="function"?o.then(()=>t(!1),()=>t(!1)):t(!1)})}return{pending:e,start:n}}function qe(e){let t=null;return function(){if(t)return t();let r=h({class:"sibu-lazy"}),o=!1;e().then(s=>{if(o)return;t=s.default;let a=t();r.replaceChildren(a)}).catch(s=>{if(o)return;let a=s instanceof Error?s:new Error(String(s));r.replaceChildren(h("sibu-lazy-error",`Failed to load component: ${a.message}`))}),r.appendChild(S("sibu-lazy-loading","Loading..."));let i=r.remove.bind(r);return r.remove=()=>{o=!0,i()},r}}function Ke({nodes:e,fallback:t}){let n=h({class:"sibu-suspense"}),r=t();return n.appendChild(r),queueMicrotask(()=>{try{let o=e();if(o.classList.contains("sibu-lazy")){let i=new MutationObserver(()=>{o.querySelector(".sibu-lazy-loading")||(i.disconnect(),n.replaceChildren(o))});i.observe(o,{childList:!0,subtree:!0}),o.querySelector(".sibu-lazy-loading")||n.replaceChildren(o)}else n.replaceChildren(o)}catch{}}),n}var ti=_(),ni=`
|
|
3
3
|
.sibu-error-display {
|
|
4
4
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
5
5
|
border-radius: 10px;
|
|
@@ -180,10 +180,10 @@
|
|
|
180
180
|
}
|
|
181
181
|
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
182
182
|
`,Eo=!1;function ri(){if(Eo||typeof document>"u")return;let e=z({nodes:ni});document.head.appendChild(e),Eo=!0}function oi(e){let t=[],n=e.split(`
|
|
183
|
-
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function
|
|
183
|
+
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function wo(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=oi(r),i=e.cause,s=i!=null?wo(i):null;return{code:t,message:n,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function ii(e,t){let n=[];if(n.push(`[${e.code}] ${e.message}`),e.stack&&(n.push(""),n.push(e.stack)),e.cause&&(n.push(""),n.push("Caused by:"),n.push(` [${e.cause.code}] ${e.cause.message}`),e.cause.stack)){let r=e.cause.stack.split(`
|
|
184
184
|
`).map(o=>` ${o}`).join(`
|
|
185
185
|
`);n.push(r)}if(t&&Object.keys(t).length>0){n.push(""),n.push("Metadata:");for(let[r,o]of Object.entries(t))n.push(` ${r}: ${String(o)}`)}return n.push(""),n.push(`At: ${new Date().toISOString()}`),typeof navigator<"u"&&navigator.userAgent&&n.push(`UA: ${navigator.userAgent}`),n.join(`
|
|
186
|
-
`)}function
|
|
186
|
+
`)}function So(e){let t=e.map((n,r)=>h({class:"sibu-err-frame",nodes:[S({class:"sibu-err-line",nodes:String(r+1)}),S({class:"sibu-err-fn",nodes:n.fn}),S({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return ve({class:"sibu-err-stack",nodes:t})}function Co(e){return e?[h({class:"sibu-err-cause-label",nodes:"Caused by"}),h({class:"sibu-err-section",nodes:[h({class:"sibu-err-section-head",nodes:[S({nodes:`[${e.code}] ${e.message}`}),S({nodes:""})]}),e.frames.length>0?So(e.frames):h({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Co(e.cause)]:[]}function si(e){let t=[];for(let[r,o]of Object.entries(e)){t.push(document.createElement("dt")),t[t.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),t.push(i)}let n=document.createElement("dl");n.className="sibu-err-meta";for(let r of t)n.appendChild(r);return n}function Ce(e){ri();let t=e.severity??"error",n=wo(e.error),r=e.alwaysShowDetails??ti,o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=w("Copy"),u=X({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let p=ii(n,e.metadata);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(p).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),l=h({class:"sibu-err-header",nodes:[Te({class:"sibu-err-icon",nodes:n.code}),xe({class:"sibu-err-title",nodes:o}),S({class:"sibu-err-timestamp",nodes:i})]}),d=[ye({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0?d.push(h({class:"sibu-err-section",nodes:[h({class:"sibu-err-section-head",nodes:[S({nodes:"Stack Trace"}),u]}),So(n.frames)]})):r&&d.push(h({class:"sibu-err-section",nodes:[h({class:"sibu-err-section-head",nodes:[S({nodes:"Details"}),u]}),h({class:"sibu-err-stack",nodes:"(no stack available)"})]})),r&&d.push(...Co(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(h({class:"sibu-err-section",nodes:[h({class:"sibu-err-section-head",nodes:[S({nodes:"Metadata"})]}),si(e.metadata)]})),r&&typeof navigator<"u"&&navigator.userAgent&&d.push(h({class:"sibu-err-section",nodes:[h({class:"sibu-err-section-head",nodes:[S({nodes:"Environment"})]}),h({class:"sibu-err-meta",nodes:(()=>{let p=document.createElement("dl");p.className="sibu-err-meta";let b=[["User Agent",navigator.userAgent],["URL",typeof location<"u"?location.href:"(n/a)"],["Timestamp",new Date().toISOString()]];for(let[T,v]of b){let y=document.createElement("dt");y.textContent=T;let D=document.createElement("dd");D.textContent=v,p.appendChild(y),p.appendChild(D)}return p})()})]}));let f=[];e.onRetry&&f.push(X({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&f.push(X({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),f.length>0&&d.push(h({class:"sibu-err-actions",nodes:f}));let m=h({class:"sibu-err-body",nodes:d});return h({class:"sibu-error-display","data-severity":t,nodes:[l,m]})}var ai=`
|
|
187
187
|
.sibu-error-boundary {
|
|
188
188
|
position: relative;
|
|
189
189
|
}
|
|
@@ -337,7 +337,7 @@
|
|
|
337
337
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
338
338
|
background: #3a3a4e;
|
|
339
339
|
}
|
|
340
|
-
`,Ao=!1;function ci(){if(!Ao&&typeof document<"u"){let e=z({nodes:ai});document.head.appendChild(e),Ao=!0}}var
|
|
340
|
+
`,Ao=!1;function ci(){if(!Ao&&typeof document<"u"){let e=z({nodes:ai});document.head.appendChild(e),Ao=!0}}var Ue=new WeakMap;function li(e,t,n){let r=Ue.get(e);r||(r=new Map,Ue.set(e,r));let o=t.message;return r.has(o)||r.set(o,e(t,n)),r.get(o)}function _o({nodes:e,fallback:t,onError:n,resetKeys:r}){ci();let[o,i]=w(null),s=()=>{t&&Ue.delete(t),i(null)};if(r&&r.length>0){let f=!1;P(()=>{for(let m of r)try{m()}catch{}if(!f){f=!0;return}o()!==null&&s()})}let a=f=>{let m=f instanceof Error?f:new Error(String(f));return i(m),n?.(m),m},u=(f,m)=>Ce({error:f,severity:"error",onRetry:m}),l=f=>{let m=t||u;try{return li(m,f,s)}catch(p){let b=p instanceof Error?p:new Error(String(p));return queueMicrotask(()=>{d.parentNode&&d.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:b}}))}),document.createComment("error-boundary-failed")}},d=h({class:"sibu-error-boundary",nodes:()=>{let f=o();if(f)return l(f);try{let m=e();if(m&&typeof m.then=="function"){let p=h({class:"sibu-error-async"});return p.appendChild(S({class:"sibu-lazy-loading",nodes:"Loading..."})),m.then(b=>{p.replaceChildren(b)}).catch(b=>{let T=a(b);p.replaceChildren(l(T))}),p}return m}catch(m){let p=a(m);return l(p)}}});return d.addEventListener("sibu:error-propagate",f=>{if(o())return;f.stopPropagation();let p=f.detail?.error;p&&a(p)}),d}var ui=`
|
|
341
341
|
@keyframes sibu-spin {
|
|
342
342
|
to { transform: rotate(360deg); }
|
|
343
343
|
}
|
|
@@ -390,4 +390,4 @@
|
|
|
390
390
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
391
391
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
392
392
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
393
|
-
`,No=!1;function
|
|
393
|
+
`,No=!1;function di(){!No&&typeof document<"u"&&(document.head.appendChild(z({nodes:ui})),No=!0)}function Lo(e={}){di();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?h({class:`sibu-loading${o}`,nodes:[h({class:"sibu-loading-dots",nodes:[S({class:"sibu-loading-dot"}),S({class:"sibu-loading-dot"}),S({class:"sibu-loading-dot"})]}),t?S({class:"sibu-loading-text",nodes:t}):null].filter(Boolean)}):h({class:`sibu-loading${o}`,nodes:[h({class:"sibu-loading-spinner"}),t?S({class:"sibu-loading-text",nodes:t}):null].filter(Boolean)})}typeof window<"u"&&(window.Sibu=Ve);return Bo(pi);})();
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isUrlAttribute,
|
|
3
|
+
sanitizeUrl
|
|
4
|
+
} from "./chunk-CMBFNA7L.js";
|
|
5
|
+
import {
|
|
6
|
+
track
|
|
7
|
+
} from "./chunk-K4G4ZQNR.js";
|
|
8
|
+
import {
|
|
9
|
+
devWarn,
|
|
10
|
+
isDev
|
|
11
|
+
} from "./chunk-5X6PP2UK.js";
|
|
12
|
+
|
|
13
|
+
// src/reactivity/bindAttribute.ts
|
|
14
|
+
var _isDev = isDev();
|
|
15
|
+
function isEventHandlerAttr(name) {
|
|
16
|
+
if (name.length < 3) return false;
|
|
17
|
+
const lower = name.toLowerCase();
|
|
18
|
+
return lower[0] === "o" && lower[1] === "n" && lower.charCodeAt(2) >= 97 && lower.charCodeAt(2) <= 122;
|
|
19
|
+
}
|
|
20
|
+
function bindAttribute(el, attr, getter) {
|
|
21
|
+
if (isEventHandlerAttr(attr)) {
|
|
22
|
+
if (_isDev)
|
|
23
|
+
devWarn(
|
|
24
|
+
`bindAttribute: refusing to bind event-handler attribute "${attr}". Use on:{ ${attr.slice(2)}: fn } instead.`
|
|
25
|
+
);
|
|
26
|
+
return () => {
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function commit() {
|
|
30
|
+
let value;
|
|
31
|
+
try {
|
|
32
|
+
value = getter();
|
|
33
|
+
} catch (err) {
|
|
34
|
+
if (_isDev)
|
|
35
|
+
devWarn(`bindAttribute: getter for "${attr}" threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (typeof value === "boolean") {
|
|
39
|
+
if (attr in el && (attr === "checked" || attr === "disabled" || attr === "selected")) {
|
|
40
|
+
el[attr] = value;
|
|
41
|
+
} else if (value) {
|
|
42
|
+
el.setAttribute(attr, "");
|
|
43
|
+
} else {
|
|
44
|
+
el.removeAttribute(attr);
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const str = String(value);
|
|
49
|
+
if ((attr === "value" || attr === "checked") && attr in el) {
|
|
50
|
+
el[attr] = attr === "checked" ? Boolean(value) : str;
|
|
51
|
+
} else {
|
|
52
|
+
el.setAttribute(attr, isUrlAttribute(attr) ? sanitizeUrl(str) : str);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const teardown = track(commit);
|
|
56
|
+
return teardown;
|
|
57
|
+
}
|
|
58
|
+
function bindDynamic(el, nameGetter, valueGetter) {
|
|
59
|
+
let prevName = null;
|
|
60
|
+
function commit() {
|
|
61
|
+
let name;
|
|
62
|
+
try {
|
|
63
|
+
name = typeof nameGetter === "function" ? nameGetter() : nameGetter;
|
|
64
|
+
} catch (err) {
|
|
65
|
+
if (_isDev) devWarn(`bindDynamic: name getter threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
let value;
|
|
69
|
+
try {
|
|
70
|
+
value = typeof valueGetter === "function" ? valueGetter() : valueGetter;
|
|
71
|
+
} catch (err) {
|
|
72
|
+
if (_isDev) devWarn(`bindDynamic: value getter threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if ((name[0] === "o" || name[0] === "O") && (name[1] === "n" || name[1] === "N")) return;
|
|
76
|
+
if (prevName !== null && prevName !== name) {
|
|
77
|
+
el.removeAttribute(prevName);
|
|
78
|
+
}
|
|
79
|
+
const str = String(value);
|
|
80
|
+
if ((name === "value" || name === "checked") && name in el) {
|
|
81
|
+
el[name] = name === "checked" ? Boolean(value) : str;
|
|
82
|
+
} else {
|
|
83
|
+
el.setAttribute(name, isUrlAttribute(name) ? sanitizeUrl(str) : str);
|
|
84
|
+
}
|
|
85
|
+
prevName = name;
|
|
86
|
+
}
|
|
87
|
+
const teardown = track(commit);
|
|
88
|
+
return () => {
|
|
89
|
+
teardown();
|
|
90
|
+
if (prevName !== null) {
|
|
91
|
+
el.removeAttribute(prevName);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// src/core/rendering/dispose.ts
|
|
97
|
+
var elementDisposers = /* @__PURE__ */ new WeakMap();
|
|
98
|
+
var _isDev2 = isDev();
|
|
99
|
+
var activeBindingCount = 0;
|
|
100
|
+
function registerDisposer(node, teardown) {
|
|
101
|
+
let disposers = elementDisposers.get(node);
|
|
102
|
+
if (!disposers) {
|
|
103
|
+
disposers = [];
|
|
104
|
+
elementDisposers.set(node, disposers);
|
|
105
|
+
}
|
|
106
|
+
disposers.push(teardown);
|
|
107
|
+
if (_isDev2) activeBindingCount++;
|
|
108
|
+
}
|
|
109
|
+
function dispose(node) {
|
|
110
|
+
const stack = [node];
|
|
111
|
+
const order = [];
|
|
112
|
+
while (stack.length > 0) {
|
|
113
|
+
const current = stack.pop();
|
|
114
|
+
order.push(current);
|
|
115
|
+
const children = current.childNodes;
|
|
116
|
+
for (let i = 0; i < children.length; i++) {
|
|
117
|
+
stack.push(children[i]);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
for (let i = order.length - 1; i >= 0; i--) {
|
|
121
|
+
const current = order[i];
|
|
122
|
+
const disposers = elementDisposers.get(current);
|
|
123
|
+
if (disposers) {
|
|
124
|
+
if (_isDev2) activeBindingCount -= disposers.length;
|
|
125
|
+
for (const d of disposers) {
|
|
126
|
+
try {
|
|
127
|
+
d();
|
|
128
|
+
} catch (err) {
|
|
129
|
+
if (_isDev2 && typeof console !== "undefined") {
|
|
130
|
+
console.warn("[SibuJS] Disposer threw during cleanup:", err);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
elementDisposers.delete(current);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function checkLeaks(warnThreshold = 0) {
|
|
139
|
+
if (!_isDev2) return 0;
|
|
140
|
+
if (warnThreshold > 0 && activeBindingCount > warnThreshold) {
|
|
141
|
+
devWarn(
|
|
142
|
+
`checkLeaks: ${activeBindingCount} active DOM bindings detected. Expected \u2264${warnThreshold}. This may indicate a component was removed from the DOM without calling dispose().`
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
return activeBindingCount;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export {
|
|
149
|
+
bindAttribute,
|
|
150
|
+
bindDynamic,
|
|
151
|
+
registerDisposer,
|
|
152
|
+
dispose,
|
|
153
|
+
checkLeaks
|
|
154
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
signal
|
|
3
|
+
} from "./chunk-NZIIMDWI.js";
|
|
4
|
+
|
|
5
|
+
// src/core/rendering/context.ts
|
|
6
|
+
function context(defaultValue) {
|
|
7
|
+
const [getValue, setValue] = signal(defaultValue);
|
|
8
|
+
return {
|
|
9
|
+
provide(value) {
|
|
10
|
+
setValue(value);
|
|
11
|
+
},
|
|
12
|
+
use() {
|
|
13
|
+
return getValue;
|
|
14
|
+
},
|
|
15
|
+
get() {
|
|
16
|
+
return getValue();
|
|
17
|
+
},
|
|
18
|
+
set(value) {
|
|
19
|
+
setValue(value);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
context
|
|
26
|
+
};
|