sibujs 4.6.0 → 4.8.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 +1 -1
- package/dist/browser.cjs +62 -8
- package/dist/browser.d.cts +23 -0
- package/dist/browser.d.ts +23 -0
- package/dist/browser.js +6 -5
- package/dist/build.cjs +2388 -1004
- package/dist/build.d.cts +147 -44
- package/dist/build.d.ts +147 -44
- package/dist/build.js +1410 -564
- package/dist/cdn.dev.global.js +14 -12
- package/dist/cdn.full.dev.global.js +15 -13
- package/dist/cdn.full.global.js +14 -12
- package/dist/cdn.global.js +12 -10
- package/dist/chunk-3ACAAQIN.js +224 -0
- package/dist/{chunk-7NCARGJW.js → chunk-44MTL7ED.js} +6 -6
- package/dist/{chunk-BAAG6ZTI.js → chunk-4WMSTZ7J.js} +8 -5
- package/dist/{chunk-H3SRKIYX.js → chunk-62BDYGAG.js} +8 -0
- package/dist/{chunk-DKGBBKOF.js → chunk-C5PEWEGH.js} +20 -5
- package/dist/{chunk-3ISI6ACU.js → chunk-C7AA2CZX.js} +1 -1
- package/dist/{chunk-UZQ6ALFS.js → chunk-CZPRSWSS.js} +1 -1
- package/dist/{chunk-D33YTSX5.js → chunk-DSID757X.js} +5 -4
- package/dist/{chunk-OXUY2A6L.js → chunk-EGUQLBHE.js} +22 -8
- package/dist/{chunk-2INLLLMZ.js → chunk-EXXSN3BW.js} +202 -26
- package/dist/{chunk-HURREPU2.js → chunk-FC6KCJSA.js} +87 -150
- package/dist/{chunk-HYXDKS4N.js → chunk-GSGNX35Q.js} +5 -5
- package/dist/{chunk-7GQCWFOE.js → chunk-J3YQ457H.js} +171 -85
- package/dist/{chunk-ORMZXBKQ.js → chunk-JUTFX2RM.js} +18 -10
- package/dist/{chunk-QE4TTDU3.js → chunk-KJ3UKABJ.js} +12 -11
- package/dist/{chunk-XRRZKZYX.js → chunk-LI4W3U6C.js} +1 -1
- package/dist/{chunk-47M47FOM.js → chunk-O6TRVMJI.js} +58 -6
- package/dist/{chunk-JSXPZCET.js → chunk-Q5J2LVKH.js} +1 -1
- package/dist/{chunk-5MT6SJ3P.js → chunk-QGMSESDD.js} +10 -5
- package/dist/{chunk-AIF3Z2T7.js → chunk-RGLPEBDE.js} +13 -10
- package/dist/{chunk-5Q4R7HCL.js → chunk-TQQUN4WR.js} +11 -2
- package/dist/{chunk-PK6FK2G2.js → chunk-UCNP3HVM.js} +183 -30
- package/dist/{chunk-XC4MEKGA.js → chunk-V3LHZSU5.js} +8 -2
- package/dist/{chunk-VVWPJ543.js → chunk-VWT3VXPL.js} +55 -20
- package/dist/{chunk-SXXVZMKZ.js → chunk-ZVLHNEEL.js} +17 -35
- package/dist/{contracts-DRIuclVT.d.cts → contracts-CLqzJnOV.d.ts} +28 -17
- package/dist/{contracts-DRIuclVT.d.ts → contracts-CTOJXu-x.d.cts} +28 -17
- package/dist/{customElement-MmInOW1U.d.ts → customElement-pYDKUzWl.d.cts} +11 -3
- package/dist/{customElement-MmInOW1U.d.cts → customElement-pYDKUzWl.d.ts} +11 -3
- package/dist/data.cjs +205 -39
- package/dist/data.d.cts +119 -3
- package/dist/data.d.ts +119 -3
- package/dist/data.js +6 -6
- package/dist/devtools.cjs +18 -5
- package/dist/devtools.js +5 -5
- package/dist/ecosystem.cjs +462 -58
- package/dist/ecosystem.d.cts +2 -1
- package/dist/ecosystem.d.ts +2 -1
- package/dist/ecosystem.js +9 -8
- package/dist/extras.cjs +852 -296
- package/dist/extras.d.cts +5 -4
- package/dist/extras.d.ts +5 -4
- package/dist/extras.js +24 -23
- package/dist/index.cjs +721 -176
- package/dist/index.d.cts +220 -169
- package/dist/index.d.ts +220 -169
- package/dist/index.js +16 -12
- package/dist/motion.cjs +12 -4
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +37 -21
- package/dist/patterns.d.cts +2 -1
- package/dist/patterns.d.ts +2 -1
- package/dist/patterns.js +6 -6
- package/dist/performance.cjs +48 -6
- package/dist/performance.d.cts +12 -2
- package/dist/performance.d.ts +12 -2
- package/dist/performance.js +8 -6
- package/dist/plugins.cjs +672 -261
- package/dist/plugins.d.cts +131 -13
- package/dist/plugins.d.ts +131 -13
- package/dist/plugins.js +83 -47
- package/dist/{ssr-XOTUASDO.js → ssr-5OWAH3U2.js} +4 -2
- package/dist/{ssr-Bli9XRW5.d.cts → ssr-C8hgIAw7.d.cts} +6 -0
- package/dist/{ssr-Bli9XRW5.d.ts → ssr-C8hgIAw7.d.ts} +6 -0
- package/dist/ssr.cjs +509 -142
- package/dist/ssr.d.cts +55 -5
- package/dist/ssr.d.ts +55 -5
- package/dist/ssr.js +11 -9
- package/dist/{tagFactory-DFstCLQV.d.cts → tagFactory-8qL9LCIx.d.cts} +58 -19
- package/dist/{tagFactory-DkaNVUNV.d.ts → tagFactory-BL2fymez.d.ts} +58 -19
- package/dist/testing.cjs +17 -4
- package/dist/testing.js +4 -4
- package/dist/types-CJFViL6Q.d.cts +26 -0
- package/dist/types-CJFViL6Q.d.ts +26 -0
- package/dist/ui.cjs +635 -254
- package/dist/ui.d.cts +3 -2
- package/dist/ui.d.ts +3 -2
- package/dist/ui.js +9 -8
- package/dist/widgets.cjs +22 -14
- package/dist/widgets.js +7 -7
- package/package.json +8 -5
package/dist/cdn.global.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`||e==="\r"||e==="\f"}function
|
|
1
|
+
"use strict";(()=>{var ho=Object.defineProperty;var yt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var bo=(e,n)=>{for(var t in n)ho(e,t,{get:n[t],enumerable:!0})};var cn={};bo(cn,{DynamicComponent:()=>Bc,ErrorBoundary:()=>wc,ErrorDisplay:()=>Qt,Fragment:()=>Vc,KeepAlive:()=>Wc,Loading:()=>Ac,MAX_DRAIN_TEARDOWNS:()=>re,Portal:()=>Jc,SVG_NS:()=>R,Suspense:()=>fr,__renderParsedTemplate:()=>Gr,__resetIdCounter:()=>Fr,a:()=>os,abbr:()=>is,action:()=>Cc,address:()=>Vi,area:()=>Rs,array:()=>Yc,article:()=>Hi,aside:()=>zi,asyncDerived:()=>Xc,audio:()=>Ls,autoResize:()=>Ir,b:()=>ss,base:()=>ka,batch:()=>z,bdi:()=>as,bdo:()=>cs,bindDynamic:()=>or,blockquote:()=>Ji,body:()=>Di,br:()=>ls,button:()=>qe,canvas:()=>Ws,caption:()=>Ys,catchError:()=>Nc,catchErrorAsync:()=>Rc,center:()=>Ja,checkLeaks:()=>xn,circle:()=>Ca,cite:()=>us,clickOutside:()=>Or,clipPath:()=>Ba,code:()=>jt,col:()=>Zs,colgroup:()=>Xs,context:()=>Mc,copyOnClick:()=>Hr,createId:()=>Br,customElement:()=>Za,data:()=>ds,datalist:()=>sa,dd:()=>Gi,deepEqual:()=>Pe,deepSignal:()=>Qc,defer:()=>bl,defs:()=>Pa,del:()=>Js,derived:()=>on,details:()=>va,dfn:()=>fs,dialog:()=>Sa,disableSSR:()=>vr,dispose:()=>M,div:()=>A,dl:()=>Yi,dt:()=>Zi,each:()=>zc,effect:()=>K,ellipse:()=>Na,em:()=>ps,embed:()=>Hs,enableSSR:()=>yr,enhance:()=>gt,enhanceAll:()=>ll,enqueueBatchedSignal:()=>Ce,external:()=>gc,fieldset:()=>aa,figcaption:()=>Xi,figure:()=>Qi,font:()=>Ga,footer:()=>Pi,form:()=>ca,g:()=>Ra,getAction:()=>Dr,getRequestScopedCache:()=>br,getRuntimeErrorHandler:()=>hn,getSSRStore:()=>Ae,getSlot:()=>Gc,h1:()=>ji,h2:()=>qi,h3:()=>zt,h4:()=>Wi,h5:()=>Ui,h6:()=>Ki,head:()=>Mi,header:()=>Ii,hr:()=>es,html:()=>Jr,i:()=>ms,iframe:()=>Is,img:()=>Ms,input:()=>la,ins:()=>Gs,isBatching:()=>mc,isSSR:()=>X,kbd:()=>gs,label:()=>ua,lazy:()=>dr,lazyIsland:()=>dl,legend:()=>da,li:()=>ts,line:()=>La,linearGradient:()=>Va,link:()=>_a,longPress:()=>$r,main:()=>Fi,map:()=>Ds,mark:()=>hs,marker:()=>Ka,marquee:()=>Ya,mask:()=>Fa,match:()=>$c,math:()=>qs,menu:()=>xa,meta:()=>Aa,meter:()=>fa,mount:()=>Uc,mountIslands:()=>gl,nav:()=>Bi,nextTick:()=>Sl,noscript:()=>Us,object:()=>Ps,ol:()=>ns,on:()=>ac,onCleanup:()=>oc,onMount:()=>ut,onUnmount:()=>mr,optgroup:()=>pa,option:()=>ma,output:()=>ga,p:()=>Ft,param:()=>Bs,path:()=>Ma,pattern:()=>za,picture:()=>Fs,polygon:()=>Da,polyline:()=>Oa,portal:()=>zs,pre:()=>Vt,progress:()=>ha,q:()=>bs,radialGradient:()=>ja,reactiveArray:()=>Zc,rect:()=>$a,ref:()=>el,registerAction:()=>Ie,registerComponent:()=>Hc,registerDisposer:()=>x,registerIsland:()=>fl,replaceChildrenSafely:()=>F,reportDrainRunaway:()=>ue,reportError:()=>w,resolveComponent:()=>Pc,retrack:()=>me,rp:()=>ys,rt:()=>vs,ruby:()=>Ss,runInSSRContext:()=>Sr,s:()=>xs,samp:()=>Es,script:()=>Ks,section:()=>$i,select:()=>ba,setGlobalErrorHandler:()=>Lc,setMaxDrainIterations:()=>tr,setRuntimeErrorHandler:()=>gn,show:()=>Dc,signal:()=>C,slot:()=>Ta,small:()=>Ts,source:()=>Vs,span:()=>O,stop:()=>qa,store:()=>tl,strict:()=>ol,strictEffect:()=>il,strong:()=>ws,style:()=>we,sub:()=>ks,summary:()=>Ea,sup:()=>_s,svg:()=>js,symbol:()=>Ua,table:()=>Qs,tagFactory:()=>u,takePendingError:()=>at,tbody:()=>ea,td:()=>ta,template:()=>wa,text:()=>Ha,textarea:()=>ya,tfoot:()=>na,th:()=>ra,thead:()=>oa,time:()=>As,title:()=>Oi,tr:()=>ia,track:()=>Os,transition:()=>vl,trapFocus:()=>Pr,trustHTML:()=>io,tspan:()=>Ia,u:()=>Cs,ul:()=>rs,unregisterComponent:()=>Ic,unregisterDisposer:()=>Fe,unregisterIsland:()=>pl,untracked:()=>Z,use:()=>Wa,var_:()=>Ns,video:()=>$s,watch:()=>nl,when:()=>Oc,withSSR:()=>xr,writable:()=>rl});var mn=Symbol.for("sibujs.runtime-errors.v1");function vt(){let e=globalThis,n=e[mn];if(n)return n;let t={handler:null,handlerDepth:0};return e[mn]=t,t}function gn(e){let n=vt(),t=n.handler;return n.handler=e,t}function hn(){return vt().handler}function St(e){if(e instanceof Error)return e;let n=typeof e=="string"?e:`Non-Error value thrown: ${yo(e)}`;return new Error(n,{cause:e})}function yo(e){if(typeof e=="symbol")return e.toString();try{return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}catch{return Object.prototype.toString.call(e)}}function vo(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var So=Symbol.for("sibujs.reactive.v1");function xo(e){let n=globalThis[So];return n?.untracked?n.untracked(e):e()}var Eo="sibu:error-propagate";function To(e,n){let t=n.node;if(!t||typeof CustomEvent>"u")return!1;let r=wo(t);if(!r)return!1;try{let o=new CustomEvent(Eo,{bubbles:!0,cancelable:!0,detail:{error:e,context:n}});return r.dispatchEvent(o)===!1}catch{return!1}}function wo(e){let t=e;for(;t;){if(t.nodeType===1&&typeof t.dispatchEvent=="function")return t;t=t.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function ko(e,n){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${vo(n)}: ${e.message}`,e)}function w(e,n){let t=St(e);xo(()=>{if(To(t,n))return;let r=vt(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:t,n);return}catch(i){if(typeof console<"u"){let a=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${a}`,i)}}finally{r.handlerDepth--}}ko(t,n)})}function ee(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var te=new WeakMap,re=1e4;function ue(e,n,t){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${n} teardowns with ${t} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:n,remaining:t})}var be=0;function Ze(e){let n=e;for(;n?.closed;)n=n.forwardTo;return n??null}var V=[];function bn(){return Ze(V[V.length-1])}function yn(e){return e===null&&V.length===0?!1:(V.push(Ze(e)),!0)}function vn(){V.pop()}function x(e,n){let t=te.get(e);t||(t=[],te.set(e,t)),t.push(n),!1;let r=Ze(V[V.length-1]);r&&r.entries.push([e,n])}function Sn(e){let n={entries:[],closed:!1},t=n.entries;V.push(n);let r;try{r=e()}catch(i){let a=0;try{for(;t.length>0;){if(a>=re){ue("rollback",a,t.length);break}let[s,c]=t.pop();if(Fe(s,c)){a++;try{c()}catch(l){w(l,{phase:"cleanup",name:"disposer"})}}}}finally{n.closed=!0,t.length=0,V.pop()}throw i}n.closed=!0,V.pop();let o=Ze(V[V.length-1]);if(o){for(let i of t)te.get(i[0])?.includes(i[1])&&o.entries.push(i);n.forwardTo=o}return t.length=0,r}function Fe(e,n){let t=te.get(e);if(!t)return!1;let r=t.indexOf(n);return r===-1?!1:(t.splice(r,1),!1,t.length===0&&te.delete(e),!0)}function M(e){let n=[e],t=[];for(;n.length>0;){let r=n.pop();t.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}for(let r=t.length-1;r>=0;r--)_o(t[r])}function _o(e){if(!te.has(e))return;let n=0,t=!1;for(;!t;){let r=te.get(e);if(!r||r.length===0)break;let o=r.slice();te.delete(e),!1;for(let i=0;i<o.length;i++){if(n>=re){let a=o.slice(i),s=te.get(e);te.set(e,s?a.concat(s):a),!1,ue("dispose",n,a.length+(s?.length??0)),t=!0;break}n++;try{o[i]()}catch(a){w(a,{phase:"cleanup",name:"disposer"})}}}}function F(e,...n){for(let r=0;r<n.length;r++){let o=n[r];o.parentNode?.removeChild(o)}let t=Array.from(e.childNodes);for(let r=0;r<t.length;r++)M(t[r]);e.replaceChildren(...n)}function xn(e=0){return 0}function Le(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Ao=/[A-Z]/,Co=/[A-Z]/g;function j(e){return Ao.test(e)?e.replace(Co,n=>String.fromCharCode(n.charCodeAt(0)+32)):e}function de(e){if(e.length<3)return!1;let n=e.toLowerCase();return n[0]==="o"&&n[1]==="n"&&n.charCodeAt(2)>=97&&n.charCodeAt(2)<=122}var No=["http:","https:","mailto:","tel:","ftp:"],Ro=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function Qe(e){let n=Le(e).trim();if(!n)return"";let t=e.replace(Ro,"");if(n.length>=2&&(n[0]==="\\"||n[0]==="/")&&(n[1]==="\\"||n[1]==="/")&&(n[0]==="\\"||n[1]==="\\"))return"";let r=n.toLowerCase(),o=-1;for(let a=0;a<r.length;a++){let s=r.charCodeAt(a);if(s===58){o=a;break}if(s===47||s===63||s===35)break}if(o===-1)return t;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&No.indexOf(i)===-1?"":t}var Lo=/^\d+(\.\d+)?[wx]$/;function xt(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function Mo(e){let n=String(e),t=[],r=0,o=n.length;for(;r<o;){for(;r<o&&(xt(n[r])||n[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!xt(n[r]);)r++;let a=n.slice(i,r),s=[];if(a.endsWith(","))a=a.replace(/,+$/,"");else{let l="",d=!1;for(;r<o;){let m=n[r];if(d){l+=m,m===")"&&(d=!1),r++;continue}if(xt(m)){l&&s.push(l),l="",r++;continue}if(m===","){r++;break}m==="("&&(d=!0),l+=m,r++}l&&s.push(l)}if(a===""||s.length>1||s.length===1&&!Lo.test(s[0]))continue;let c=Qe(a);c&&(c.startsWith(",")||c.endsWith(",")||t.push(s.length===1?`${c} ${s[0]}`:c))}return t.join(", ")}var Do=/[(:@\\]/;function Oo(e){return e===" "||e===" "||e===`
|
|
3
|
+
`||e==="\r"||e==="\f"}function En(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function $o(e){let n="";for(let t=0;t<e.length;t++){let r=e[t];if(r!=="\\"){n+=r;continue}if(t+1>=e.length)break;let o=e[t+1];if(o===`
|
|
3
4
|
`||o==="\f"){t+=1;continue}if(o==="\r"){t+=e[t+2]===`
|
|
4
|
-
`?2:1;continue}if(
|
|
5
|
-
`?2:1);let s=Number.parseInt(i,16),c=s===0||s>1114111||s>=55296&&s<=57343;n+=c?"\uFFFD":String.fromCodePoint(s),t=a-1;continue}n+=o,t+=1}return n}var en=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid"];function no(e){if(!e)return"an element";let n=e.tagName.toLowerCase(),t=e.getAttribute("id");t&&(n+=`#${t}`);let r=e.getAttribute("class");return r&&(n+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${n}>`}var it=new Set,tn=100,nn=!1;function on(e,n,t){}function st(e){if(!Qr.test(e))return-1;let t=(e.includes("\\")?to(e):e).toLowerCase().replace(/\s+/g,"");for(let r=0;r<en.length;r++)if(t.includes(en[r]))return r;return-1}function Ve(e,n){let t=st(e);return t===-1?e:(on(e,t,n),"")}function qe(e,n){let t=String(e);if(t.trim()==="")return"";if(typeof document>"u")return Ve(t,n)===""?"":t;let r=document.createElement("div");try{r.style.cssText=t}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let a=r.style[i],s=r.style.getPropertyValue(a),c=st(s);if(c===-1&&(c=st(`${a}:${s}`)),c!==-1){on(s,c,{property:a,element:n?.element});continue}let l=r.style.getPropertyPriority(a);o.push(`${a}: ${s}${l?` !${l}`:""}`)}return o.join("; ")}var ro=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),oo=new Set(["srcdoc"]);function sn(e){return oo.has(e.toLowerCase())}function an(e,n,t){let r=e.toLowerCase();return r==="srcset"?Xr(n):ro.has(r)?rn(n):r==="style"?qe(n,t):n}var io="http://www.w3.org/1999/xhtml",so="http://www.w3.org/2000/svg",ao="http://www.w3.org/1999/xlink",co="http://www.w3.org/XML/1998/namespace",uo=new Set(["checked","disabled","selected"]);function lo(e){return e.namespaceURI===null||e.namespaceURI===io}function cn(e,n,t){e[n]=t}function fo(e,n){if(e.namespaceURI!==so)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?ao:t.startsWith("xml:")?co:null}function q(e,n,t,r={}){let o=fo(e,n),i=o?n.slice(n.indexOf(":")+1):n;if(Se(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;if(t==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;if(sn(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let a=lo(e),s=a?n.toLowerCase():n;if(typeof t=="boolean"){if(n.length>5&&n.slice(0,5).toLowerCase()==="aria-"){let g=t?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(n))!==g&&(o?e.setAttributeNS(o,n,g):e.setAttribute(n,g)),!0}return a&&uo.has(s)&&s in e?cn(e,s,t):t?o?e.setAttributeNS(o,n,""):e.setAttribute(n,""):o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0}let c=String(t);if(r.syncValueProperty!==!1&&a&&(s==="value"||s==="checked")&&s in e)return cn(e,s,s==="checked"?!!t:c),!0;let l=an(n,c,{element:e});return(o?e.getAttributeNS(o,i):e.getAttribute(n))===l||(o?e.setAttributeNS(o,n,l):e.setAttribute(n,l)),!0}var po=4096,at=[];function mo(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function go(e,n,t){let r=at.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=mo();return o.sig=e,o.sub=n,o.epoch=t,o}function un(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,at.length<po&&at.push(e)}function bo(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function ln(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function ho(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function yo(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var W=null,Z=null,ne=0,re=[],j=new Set,vo=[];function xo(e){try{e()}catch(n){let t=e;w(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function So(e){let n=e.depsHead??null;if(n===null)return!0;for(;n!==null;){let t=n.sig;if(t===null)return!0;if(t._d===!0&&t._validate!==void 0)try{t._validate()}catch{return!0}if(n.depVersion!==t.__v)return!0;n=n.subNext}return!1}var G=0,X=!1;function ut(){G===0&&(Z=W,W=null,X=!0),G++}function lt(){G--,G===0&&(W=Z,Z=null,X=!1)}function dn(){return X}function fn(e){ut();try{return e()}finally{lt()}}var To=0;function dt(e,n){let t=W,r=0,o=null;X&&(r=G,o=Z,G=0,Z=null,X=!1),W=n;let i=n;i._cap===void 0&&(i._cap=Gt());let a=++To;i._epoch=a,i._structDirty=!1;for(let s=i.depsHead??null;s!==null;s=s.subNext){let c=s.sig;s.prevActive=c.__activeNode??null,c.__activeNode=s}try{e()}finally{W=t,r!==0&&(G=r,Z=o,X=!0);let s=i.depsHead??null;for(;s!==null;){let c=s.subNext,l=s.sig;l.__activeNode=s.prevActive,s.prevActive=null,s.epoch!==a&&(yo(s),ln(s),un(s)),s=c}}}function pn(e,n){if(!n)return ft(e);Te(n);let t=W,r=0,o=null;X&&(r=G,o=Z,G=0,Z=null,X=!1),W=n;try{e()}finally{W=t,r!==0&&(G=r,Z=o,X=!0);let a=n;for(let s=a.depsHead??null;s!==null;s=s.subNext){let c=s.sig;c.__activeNode=s.prevActive,s.prevActive=null}}let i=n;return i._dispose??(i._dispose=()=>Te(n))}function ft(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{dt(e,r)}finally{o._reentrant=!1}}},r=t;r.depsHead=null,r.depsTail=null,r._epoch=0,r._structDirty=!1,r._hasComputedDep=!1,r._runEpoch=0,r._runs=0,r._reentrant=!1,r._disposed=!1,r._errorPhase="binding",r._errorNode=n;try{t()}catch(o){throw r._disposed=!0,r._errorNode=void 0,Te(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,Te(r)})}function mn(e){if(!W)return;let n=W,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r,o.depVersion=t.__v??Number.NaN;return}t._validate!==void 0&&(n._hasComputedDep=!0);let i=go(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,ho(n,i),bo(t,i),n._structDirty=!0}function Te(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;ln(t),un(t),t=r}}var je=1e3,We=1e6,Ue=0,ue=new Set;function gn(e){let n=je;return Number.isFinite(e)&&e>0&&(je=Math.floor(e)),n}function bn(e){let n=We;return Number.isFinite(e)&&e>0&&(We=Math.floor(e)),n}function Eo(e){let n=e;return n._runEpoch!==Ue?(n._runEpoch=Ue,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>je)}function wo(e){let n=e.__name??"<unnamed>";w(new Error(`subscriber "${n}" fired more than ${je} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:n})}function ko(){w(new Error(`Notification drain exceeded ${We} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function hn(){let e=0;for(;e<re.length;){if(e>=We){ko();break}let n=re[e++];if(j.delete(n),ue.size>0&&ue.has(n)||n._hasComputedDep===!0&&!So(n))continue;if(Eo(n)){wo(n),ue.add(n);continue}let t=Yt(n._cap??null);try{xo(n)}finally{t&&Zt()}}}function yn(){if(!(ne>0)){ne++,Ue++;try{hn()}finally{ne--,ne===0&&(re.length=0,j.clear(),ue.size>0&&ue.clear())}}}function ct(e){e();let n=e._sig;if(!n)return;let t=vo,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let a=i.sub;if(a)if(a._c){let s=a._sig;s?(!s._d||s._f===!0)&&(s._d=!0,s._f=!1,t.push(s)):a()}else j.has(a)||(j.add(a),re.push(a));i=i.sigNext}}}function vn(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?ct(r):j.has(r)||(j.add(r),re.push(r))),t=t.sigNext}}function xn(e){let t=e.subsHead;if(t){if(ne>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?ct(o):j.has(o)||(j.add(o),re.push(o))),r=r.sigNext}return}ne++,Ue++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?ct(o):j.has(o)||(j.add(o),re.push(o))),r=r.sigNext}hn()}finally{ne--,ne===0&&(re.length=0,j.clear(),ue.size>0&&ue.clear())}}}function Sn(e){return e.__sc??0}function Tn(e){let n=e,t=[],r=n.depsHead??null;for(;r;)r.sig&&t.push(r.sig),r=r.subNext;return t}function En(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var wn="4.6.0",kn=Symbol.for("sibujs.reactive.v1");function Ao(){let e=globalThis,n=e[kn];if(n)return!1,n;let t={suspendTracking:ut,resumeTracking:lt,isTrackingSuspended:dn,untracked:fn,retrack:dt,track:pn,reactiveBinding:ft,recordDependency:mn,cleanup:Te,setMaxSubscriberRepeats:gn,setMaxDrainIterations:bn,drainNotificationQueue:yn,queueSignalNotification:vn,notifySubscribers:xn,getSubscriberCount:Sn,getSubscriberDeps:Tn,forEachSubscriber:En,version:wn};return e[kn]=t,t}var H=Ao(),le=H.suspendTracking,de=H.resumeTracking,_n=H.isTrackingSuspended,Me=H.untracked,oe=H.retrack,z=H.track,O=H.reactiveBinding,fe=H.recordDependency,De=H.cleanup,Pc=H.setMaxSubscriberRepeats,An=H.setMaxDrainIterations,Cn=H.drainNotificationQueue,Nn=H.queueSignalNotification,Ee=H.notifySubscribers,Bc=H.getSubscriberCount,Fc=H.getSubscriberDeps,zc=H.forEachSubscriber;function Ke(e,n,t){if(Se(n))return q(e,n,"",{label:`bindAttribute("${n}")`}),()=>{};function r(){let o;try{o=t()}catch(i){w(i,{phase:"binding",name:`bindAttribute("${n}")`,node:e});return}q(e,n,o,{label:`bindAttribute("${n}")`})}return O(r,e)}function Ln(e,n,t){let r=null;function o(){let a;try{a=typeof n=="function"?n():n}catch(c){w(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let s;try{s=typeof t=="function"?t():t}catch(c){w(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==a&&(e.removeAttribute(r),r=null),q(e,a,s,{label:"bindDynamic"})&&(r=a)}let i=O(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var pt=["data-focus-key","id","name"],Co=new Set(["text","search","url","tel","password",""]);function No(e){let n=e.tagName;if(!(n==="TEXTAREA"||n==="INPUT"&&Co.has(e.type.toLowerCase())))return{start:null,end:null,direction:null};let r=e;return{start:r.selectionStart,end:r.selectionEnd,direction:r.selectionDirection}}function He(e){if(e.length===0||typeof document>"u")return null;let n=document.activeElement;if(!n||n===document.body)return null;let t=!1;for(let i=0;i<e.length;i++){let a=e[i];if(a===n||a.nodeType===1&&a.contains(n)){t=!0;break}}if(!t)return null;let r=null,o=null;for(let i=0;i<pt.length;i++){let a=n.getAttribute(pt[i]);if(a){r=pt[i],o=a;break}}return{el:n,attr:r,value:o,tag:n.tagName,...No(n)}}function Lo(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ro(e,n){let t=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let a=i;a.matches(n)&&(r++,t??(t=a));let s=a.querySelectorAll(n);for(let c=0;c<s.length;c++)r++,t??(t=s[c]);if(r>1)return{el:null,count:r}}return r===1?{el:t,count:r}:{el:null,count:r}}function Rn(e,n){if(e.focus(),n.start!==null&&typeof e.setSelectionRange=="function"){let t=e,r=t.value.length,o=Math.min(n.start,r),i=Math.min(n.end??o,r);t.setSelectionRange(o,i,n.direction??"none")}}function we(e,n,t){if(!e||typeof document>"u")return;let r=document.activeElement;if(r===e.el||r&&r!==document.body&&r!==document.documentElement)return;if(e.el.isConnected){Rn(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:a}=Ro(n,`[${e.attr}=${Lo(e.value)}]`);if(i&&i.tagName===e.tag){Rn(i,e);return}o=a>1}}function pe(e,n){let t=[];function r(){let o;try{o=n()}catch(p){w(p,{phase:"binding",name:"bindChildNode",node:e});return}let i=He(t);if(o==null||typeof o=="boolean"){for(let p=0;p<t.length;p++){let g=t[p];L(g),g.parentNode&&g.parentNode.removeChild(g)}t.length=0,we(i,t,"bindChildNode");return}let a=e.parentNode;if(!a){t.length=0;return}let s;if(Array.isArray(o)){s=[];let p=new Set;for(let g=0;g<o.length;g++){let m=o[g];if(m==null||typeof m=="boolean")continue;let d=m instanceof Node?m:document.createTextNode(String(m));if(p.has(d)){!1;continue}p.add(d),s.push(d)}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(t.length>0&&s.length>0){let p=new Set(t);c=new Set;for(let g=0;g<s.length;g++)p.has(s[g])&&c.add(s[g])}for(let p=0;p<t.length;p++){let g=t[p];c?.has(g)||(L(g),g.parentNode&&g.parentNode.removeChild(g))}let l=e;for(let p=0;p<s.length;p++){let g=s[p];l.nextSibling!==g&&a.insertBefore(g,l.nextSibling),l=g}t=s,we(i,s,"bindChildNode")}return O(r,e)}var N="http://www.w3.org/2000/svg",Mo=new Set(["script","iframe","object","embed","frame","frameset"]);function Do(e){return Mo.has(e.toLowerCase())}var Ho=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var mt=new Set,Mn=100,Dn=!1,Hn=new Map;function Oo(e){let n=Hn.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Hn.set(e,n)),n}function $o(e,n){if(typeof n=="function"){let r=O(()=>{e.setAttribute("style",qe(String(n()),{element:e}))},e);T(e,r);return}if(typeof n=="string"){e.setAttribute("style",qe(n,{element:e}));return}let t=e;for(let r in n){let o=n[r],i=Oo(r);if(typeof o=="function"){let a=o,s=O(()=>{t.style.setProperty(i,Ve(String(a()),{property:i,element:e}))},e);T(e,s)}else t.style.setProperty(i,Ve(String(o),{property:i,element:e}))}}function Io(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=O(()=>{e.setAttribute("class",n())},e);T(e,i);return}let t=n,r=!1,o="";for(let i in t){let a=t[i];if(typeof a=="function"){r=!0;break}a&&(o=o?`${o} ${i}`:i)}if(r){let a=O(()=>{let s="";for(let c in t){let l=t[c];(typeof l=="function"?l():l)&&(s=s?`${s} ${c}`:c)}e.setAttribute("class",s)},e);T(e,a)}else e.setAttribute("class",o)}function gt(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),T(e,pe(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),T(e,pe(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 a=document.createComment("");e.appendChild(a),T(e,pe(a,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}var u=(e,n)=>{let t=Do(e);return(r,o)=>{if(t)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=n?document.createElementNS(n,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),gt(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return gt(i,r),i;let a=r,s=a.class;s!=null&&Io(i,s);let c=a.id;c!=null&&(!1,i.id=c);let l=o!==void 0?o:a.nodes;l!=null&>(i,l);let p=a.on;if(p)for(let d in p){let f=p[d];typeof f=="function"?i.addEventListener(d,f):!1}let g=a.style;g!=null&&$o(i,g);let m=a.ref;m&&(m.current=i);for(let d in a)switch(d){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let f=a[d];if(f==null||Se(d))continue;typeof f=="function"?T(i,Ke(i,d,f)):q(i,d,f,{syncValueProperty:!1,label:"tagFactory"})}}return a.onElement&&typeof a.onElement=="function"&&a.onElement(i),i}};var cu=u("html"),Po=u("head"),Bo=u("body"),Fo=u("title"),_=u("div"),M=u("span"),zo=u("section"),Vo=u("article"),qo=u("header"),jo=u("footer"),Wo=u("nav"),Uo=u("main"),Ko=u("aside"),Jo=u("address"),bt=u("p"),Go=u("h1"),Yo=u("h2"),ht=u("h3"),Zo=u("h4"),Xo=u("h5"),Qo=u("h6"),ei=u("blockquote"),ti=u("dd"),ni=u("dl"),ri=u("dt"),oi=u("figcaption"),ii=u("figure"),si=u("hr"),ai=u("li"),ci=u("ol"),ui=u("ul"),yt=u("pre"),li=u("a"),di=u("abbr"),fi=u("b"),pi=u("bdi"),mi=u("bdo"),gi=u("br"),bi=u("cite"),vt=u("code"),hi=u("data"),yi=u("dfn"),vi=u("em"),xi=u("i"),Si=u("kbd"),Ti=u("mark"),Ei=u("q"),wi=u("rp"),ki=u("rt"),_i=u("ruby"),Ai=u("s"),Ci=u("samp"),Ni=u("small"),Li=u("strong"),Ri=u("sub"),Mi=u("sup"),Di=u("time"),Hi=u("u"),Oi=u("var"),$i=u("area"),Ii=u("audio"),Pi=u("img"),Bi=u("map"),Fi=u("track"),zi=u("video"),Vi=u("embed"),qi=u("iframe"),ji=u("object"),Wi=u("param"),Ui=u("picture"),Ki=u("portal"),Ji=u("source"),Gi=u("svg",N),Yi=u("math"),Zi=u("canvas"),Xi=u("noscript"),Qi=u("script"),es=u("del"),ts=u("ins"),ns=u("caption"),rs=u("col"),os=u("colgroup"),is=u("table"),ss=u("tbody"),as=u("td"),cs=u("tfoot"),us=u("th"),ls=u("thead"),ds=u("tr"),Oe=u("button"),fs=u("datalist"),ps=u("fieldset"),ms=u("form"),gs=u("input"),bs=u("label"),hs=u("legend"),ys=u("meter"),vs=u("optgroup"),xs=u("option"),Ss=u("output"),Ts=u("progress"),Es=u("select"),ws=u("textarea"),ks=u("details"),_s=u("dialog"),As=u("menu"),Cs=u("summary"),Ns=u("slot"),Ls=u("template"),Rs=u("base"),Ms=u("link"),Ds=u("meta"),me=u("style"),Hs=u("circle",N),Os=u("ellipse",N),$s=u("g",N),Is=u("line",N),Ps=u("path",N),Bs=u("polygon",N),Fs=u("polyline",N),zs=u("rect",N),Vs=u("text",N),qs=u("tspan",N),js=u("defs",N),Ws=u("clipPath",N),Us=u("mask",N),Ks=u("pattern",N),Js=u("linearGradient",N),Gs=u("radialGradient",N),Ys=u("stop",N),Zs=u("use",N),Xs=u("symbol",N),Qs=u("marker",N),ea=u("center"),ta=u("font"),na=u("marquee"),ra=e=>u(e);var xt="__sibuPendingError";function On(e,n){let t=()=>e.parentNode?(w(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[xt]=n)})}function Je(e){let n=e,t=n[xt];if(t instanceof Error)return delete n[xt],t}function $n(e){let n=null;return function(){if(n)return n();let r=_({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let a=n();B(r,a)}).catch(i=>{if(o)return;let a=i instanceof Error?i:new Error(String(i));B(r,_({class:"sibu-lazy-error"},`Failed to load component: ${a.message}`)),On(r,a)}),r.appendChild(M("sibu-lazy-loading","Loading...")),T(r,()=>{o=!0}),r}}function In({nodes:e,fallback:n}){let t=_({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,a=null;return T(t,()=>{o=!0,i&&(i.disconnect(),i=null),a&&!t.contains(a)&&L(a)}),queueMicrotask(()=>{if(!o)try{let s=e();if(a=s,s.classList.contains("sibu-lazy")){if(!s.querySelector(".sibu-lazy-loading")){B(t,s);return}i=new MutationObserver(()=>{if(o)return;s.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,B(t,s))}),i.observe(s,{childList:!0,subtree:!0})}else B(t,s)}catch(s){let c=s instanceof Error?s:new Error(String(s));On(t,c)}}),t}function wt(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";w(t,{phase:r,name:n});return}}function St(e,n,t){let r=wt(e,n);typeof r=="function"&&t&&T(t,r)}var ke=new WeakMap,ge=new WeakMap,Q=new Set,ee=new Set,_e=null,Ge=0,oa=256;function Tt(e){let n=ke.get(e);if(n){ke.delete(e),Q.delete(e);for(let t of n)try{t()}catch{}}}function Et(e){ge.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=ge.get(e);if(t){ge.delete(e),ee.delete(e);for(let r of t)try{r()}catch{}}})}function ia(e){if(Q.size===0||e.nodeType!==1)return;let n=e;if(Q.has(n)&&n.isConnected&&Tt(n),n.firstElementChild)for(let t of Array.from(Q))t!==n&&t.isConnected&&n.contains(t)&&Tt(t)}function sa(e){if(ee.size===0||e.nodeType!==1)return;let n=e;if(ee.has(n)&&!n.isConnected&&Et(n),n.firstElementChild)for(let t of Array.from(ee))t!==n&&!t.isConnected&&n.contains(t)&&Et(t)}function aa(){if(Q.size>0)for(let e of Array.from(Q))e.isConnected&&Tt(e);if(ee.size>0)for(let e of Array.from(ee))e.isConnected||Et(e)}function Pn(){_e||typeof document>"u"||(_e=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)ia(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)sa(n.removedNodes[t])}Ge+=e.length,Ge>=oa&&(Ge=0,aa()),kt()}),_e.observe(document.body,{childList:!0,subtree:!0}))}function kt(){_e&&Q.size===0&&ee.size===0&&(_e.disconnect(),_e=null,Ge=0)}function ca(e,n){let t=ke.get(e);return t||(t=[],ke.set(e,t)),t.push(n),Q.add(e),Pn(),()=>{let r=ke.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(ke.delete(e),Q.delete(e))}kt()}}function ua(e,n){let t=ge.get(e);return t||(t=[],ge.set(e,t)),t.push(n),ee.add(e),Pn(),()=>{let r=ge.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(ge.delete(e),ee.delete(e))}kt()}}function Ye(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(T(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||St(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){St(e,"onMount",n);return}let r=ca(n,()=>{t||St(e,"onMount",n)});T(n,r)})}else queueMicrotask(()=>{wt(e,"onMount")})}function la(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,wt(e,"onUnmount"))};T(n,r);let o=()=>{if(t)return;let i=ua(n,r);T(n,i)};n.isConnected?o():Ye(()=>{o()},n)}function da(e,n){T(n,e)}var _t=Symbol.for("sibujs.ssr.v1");function fa(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,t=process.getBuiltinModule;typeof t=="function"?n=t("node:async_hooks"):typeof tt=="function"&&(n=tt("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var ie=globalThis[_t]??(globalThis[_t]=fa()),be=ie.als,P=ie.fallbackStore;ie.fallbackDepth??(ie.fallbackDepth=0);var Bn=!1;function pa(){if(Bn||be||!(typeof process<"u"&&!!process.versions?.node))return;Bn=!0;let n=process.versions.node;`${n}`}function he(){if(be){let e=be.getStore();if(e)return e}return P}function Fn(){return be?be.getStore()??null:ie.fallbackDepth>0?P:null}function U(){return he().ssr}function zn(e){if(!U())return null;let n=he(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function Vn(){he().ssr=!0}function qn(){he().ssr=!1}function jn(e){let n={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(be)return be.run(n,e);pa();let t=P.ssr,r=P.suspenseIdCounter,o=P.idCounter,i=P.locale;P.ssr=!0,P.suspenseIdCounter=0,P.idCounter=0,P.locale=void 0,ie.fallbackDepth++;try{return e()}finally{ie.fallbackDepth--,P.ssr=t,P.suspenseIdCounter=r,P.idCounter=o,P.locale=i}}function Wn(e){let n=he(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var Jn=globalThis;function ma(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,Me(()=>n(o,void 0));else{let i=t;t=o,Me(()=>n(o,i))}}}var Un=100;function At(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){w(r,{phase:"cleanup"})}}}function Kn(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&At(e),oe(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=Un);e.rerunPending&&(e.rerunPending=!1,w(new Error(`effect re-requested itself ${Un}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function ga(e){if(e.disposed)return;e.disposed=!0;let n=Jn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&At(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{De(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function V(e,n){if(U())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=a=>{t.userCleanups.push(a)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(a){r(a)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(!t.disposed){if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&At(t),oe(t.bodyFn,o),t.rerunPending&&Kn(t)}finally{t.running=!1,t.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,t.subscriber=o,t.running=!0;try{oe(t.bodyFn,t.subscriber),t.rerunPending&&Kn(t)}finally{t.running=!1,t.rerunPending=!1}let i=Jn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>ga(t)}var $e=0,Ct=new Set;function ba(e){$e++;try{return e()}finally{$e--,$e===0&&va()}}function ha(e){return $e===0?!1:(Ct.add(e),!0)}function ya(){return $e>0}function va(){try{for(let e of Ct)Nn(e)}finally{Ct.clear()}Cn()}var Gn=Symbol.for("sibujs.reactive.batch.v1");function xa(){let e=globalThis,n=e[Gn];if(n)return n;let t={batch:ba,enqueueBatchedSignal:ha,isBatching:ya};return e[Gn]=t,t}var Nt=xa(),F=Nt.batch,ye=Nt.enqueueBatchedSignal,Sa=Nt.isBatching;var Lt=globalThis;function C(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=n?.equals;r&&(t.__name=r);function i(){return fe(t),t.value}i.__signal=t,r&&(i.__name=r);let a;if(o?a=s=>{let c=t.value,l=typeof s=="function"?s(c):s;if(!o(c,l)){if(t.value=l,t.__v++,!1){let p=Lt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;p&&p.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l})}ye(t)||Ee(t)}}:a=s=>{let c=t.value,l=typeof s=="function"?s(c):s;Object.is(l,c)||(t.value=l,t.__v++,ye(t)||Ee(t))},!1){let s=Lt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;s&&s.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,a]}function Ta(e){let[n,t]=C(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var Ea=`
|
|
5
|
+
`?2:1;continue}if(En(o)){let i="",a=t+1;for(;a<e.length&&i.length<6&&En(e[a]);)i+=e[a],a++;a<e.length&&Oo(e[a])&&(a+=e[a]==="\r"&&e[a+1]===`
|
|
6
|
+
`?2:1);let s=Number.parseInt(i,16),c=s===0||s>1114111||s>=55296&&s<=57343;n+=c?"\uFFFD":String.fromCodePoint(s),t=a-1;continue}n+=o,t+=1}return n}var Tn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],Ho=4,Io=5,Po=8;function Bo(e){if(!e)return"an element";let n=e.tagName.toLowerCase(),t=e.getAttribute("id");t&&(n+=`#${t}`);let r=e.getAttribute("class");return r&&(n+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${n}>`}var Et=new Set,wn=100,kn=!1;function Xe(e,n,t){}function _n(e){return(e.includes("\\")?$o(e):e).toLowerCase().replace(/\s+/g,"")}function Tt(e){if(!Do.test(e))return-1;let n=_n(e);for(let t=0;t<Tn.length;t++)if(n.includes(Tn[t]))return t;return-1}function et(e,n,t){let r=wt(e,n);return r===-1?n:(Xe(n,r,{property:e,element:t?.element}),"")}function wt(e,n){let t=Tt(n);if(t!==-1)return t;let r=j(e);return r==="behavior"?Io:r==="-moz-binding"?Ho:(r==="filter"||r==="-ms-filter")&&_n(n).includes("progid:")?Po:-1}function Fo(e){let n=[],t="",r=0,o="";for(let a=0;a<e.length;a++){let s=e[a];if(o){t+=s,s==="\\"&&a+1<e.length?t+=e[++a]:s===o&&(o="");continue}if(s==="\\"){t+=s,a+1<e.length&&(t+=e[++a]);continue}if(s==="/"&&e[a+1]==="*"){let c=e.indexOf("*/",a+2);if(c===-1)return null;a=c+1;continue}if(s==='"'||s==="'")o=s;else if(s==="("||s==="[")r++;else if(s===")"||s==="]"){if(--r<0)return null}else{if(s==="{"||s==="}")return null;if(s===";"&&r===0){n.push(t),t="";continue}}t+=s}if(o||r!==0)return null;n.push(t);let i=[];for(let a of n){let s=a.indexOf(":");if(s===-1)continue;let c=a.slice(0,s).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(c))continue;let l=a.slice(s+1).trim(),d=/!\s*important\s*$/i.exec(l);if(d&&(l=l.slice(0,d.index).trim()),l==="")continue;let m=c.startsWith("--")?c:j(c);i.push([m,l,d!==null])}return i}function zo(e,n){let t=String(e),r=Fo(t);if(r===null)return Tt(t)!==-1&&Xe(t,Tt(t),n),"";let o=[];for(let[i,a,s]of r){let c=wt(i,a);if(c!==-1){Xe(a,c,{property:i,element:n?.element});continue}o.push(`${i}: ${a}${s?" !important":""}`)}return o.join("; ")}function tt(e,n){let t=String(e);if(t.trim()==="")return"";if(typeof document>"u")return zo(t,n);let r=document.createElement("div");try{r.style.cssText=t}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let a=r.style[i],s=r.style.getPropertyValue(a),c=wt(a,s);if(c!==-1){Xe(s,c,{property:a,element:n?.element});continue}let l=r.style.getPropertyPriority(a);o.push(`${a}: ${s}${l?` !${l}`:""}`)}return o.join("; ")}var kt=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),Vo=new Set(["srcdoc"]);function ze(e){return Vo.has(e.toLowerCase())}function An(e){return kt.has(e.toLowerCase())}function jo(e){let n=e.toLowerCase();return n==="style"||kt.has(n)}function qo(e,n,t){let r=e.toLowerCase();return r==="srcset"?Mo(n):kt.has(r)?Qe(n):r==="style"?tt(n,t):n}function Cn(e,n,t){if(!jo(e))return n;let r=qo(e,n,t);return r===""?null:r}function ye(e){return e===" "||e===" "||e===`
|
|
7
|
+
`||e==="\r"||e==="\f"}function nt(e){let n=0,t=e.length;for(;n<t&&ye(e[n]);)n++;for(;t>n&&ye(e[t-1]);)t--;return e.slice(n,t)}var q=e=>({kind:"forbidden",reason:e});function Wo(e){let n=nt(Le(e));if(n==="")return q("");let t=0;for(;t<n.length&&n[t]>="0"&&n[t]<="9";)t++;if(t===0)return q("");let r=Number.parseInt(n.slice(0,t),10);if(!Number.isFinite(r))return q("");for(;t<n.length&&ye(n[t]);)t++;if(t===n.length)return{kind:"delay-only",delay:r};if(n[t]!==";"&&n[t]!==",")return q("");for(t++;t<n.length&&ye(n[t]);)t++;let o=t;for(;t<n.length&&!ye(n[t])&&n[t]!=="=";)t++;let i=n.slice(o,t).toLowerCase();if(i!=="url")return q("");for(;t<n.length&&ye(n[t]);)t++;if(n[t]!=="=")return q("");for(t++;t<n.length&&ye(n[t]);)t++;let a,s=n[t];if(s==='"'||s==="'"){let l=n.indexOf(s,t+1);if(l===-1)return q("");if(a=n.slice(t+1,l),nt(n.slice(l+1))!=="")return q("")}else if(a=nt(n.slice(t)),/[;,]/.test(a))return q("");if(a==="")return q("");let c=Qe(a);return c===""?q(""):{kind:"allowed",delay:r,destination:a,sanitizedDestination:c}}function _t(e){let n,t,r,o=new Set;for(let[i,a]of e){let s=j(i);o.has(s)&&(r=s),o.add(s),s==="http-equiv"?n=a:s==="content"&&(t=a)}return r!==void 0?q(""):typeof n!="string"?{kind:"not-refresh"}:nt(Le(n)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof t!="string"?{kind:"not-refresh"}:Wo(t)}var Uo="http://www.w3.org/1999/xhtml",Ko="http://www.w3.org/2000/svg",Jo=new Set(["script","iframe","object","embed","frame","frameset"]);function Rn(e){return j(e)}function Ln(e){return Jo.has(Rn(e))}var Go=new Set(["script","style"]);function Mn(e){return Go.has(Rn(e))}var L={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Yo=new Set(["src","href","xlink:href","type","language"]),Zo=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),At=new WeakSet;function Dn(e){return e.namespaceURI===Uo||e.namespaceURI===null}function On(e,n,t){let r=new Map,o=e.attributes;for(let i=0;i<o.length;i++){let a=o[i];a.name!==n&&r.set(a.name,a.value)}return n!==null&&t!==null&&r.set(n,t),r}function Xo(e){At.has(e)||(At.add(e),e.getAttribute("content")!==null&&_t(On(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function Qo(e,n,t,r){if(!Dn(e))return L.None;let o=j(n);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&Xo(e),t===null)||o==="content"&&!e.hasAttribute("http-equiv"))return L.None;let i=_t(On(e,o,t));return i.kind==="forbidden"?L.MetaRefreshForbidden:i.kind!=="not-refresh"&&At.has(e)?L.MetaRefreshReactive:L.None}function ei(e,n){if(n===null||j(e)!=="attributename")return L.None;let t=Le(n);return An(t)||de(t)||ze(t)?L.AnimationTarget:L.None}var rt=new WeakSet;function Nn(e){if(e===null)return!1;let n=j(e);if(!n.includes("stylesheet"))return!1;let t=n.split(/[\t\n\f\r ]+/);for(let r=0;r<t.length;r++)if(t[r]==="stylesheet")return!0;return!1}function ti(e,n,t,r){if(!Dn(e))return L.None;let o=j(n);return o==="href"?r==="static"||t===null?L.None:Nn(e.getAttribute("rel"))?L.StylesheetSource:(rt.add(e),L.None):o==="rel"&&Nn(t)&&rt.has(e)&&e.hasAttribute("href")?L.StylesheetSource:L.None}function Ct(e,n,t,r){let o=e.localName;return o==="meta"?Qo(e,n,t,r):o==="link"?ti(e,n,t,r):o==="script"?r==="static"||t===null?L.None:Yo.has(j(n))?L.ScriptSource:L.None:Zo.has(o)&&e.namespaceURI===Ko?ei(n,t):L.None}function Nt(e,n,t){e.localName!=="link"||j(n)!=="href"||(t!=="static"&&e.hasAttribute("href")?rt.add(e):rt.delete(e))}var ni="http://www.w3.org/1999/xhtml",ri="http://www.w3.org/2000/svg",oi="http://www.w3.org/1999/xlink",ii="http://www.w3.org/XML/1998/namespace",si=new Set(["checked","disabled","selected"]);function ai(e){return e.namespaceURI===null||e.namespaceURI===ni}function Hn(e,n,t){}function $n(e,n,t){e[n]=t}function ci(e,n){if(e.namespaceURI!==ri)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?oi:t.startsWith("xml:")?ii:null}function J(e,n,t,r={}){let o=li(e,n,t,r);return e.localName==="link"&&Nt(e,n,r.reactive?"reactive":"runtime"),o}function li(e,n,t,r){let o=ci(e,n),i=o?n.slice(n.indexOf(":")+1):n;if(de(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let a=t==null||t===!1?null:t===!0?"":String(t),s=Ct(e,n,a,r.reactive?"reactive":"runtime");if(s!==L.None)return Hn(r.label??"setSafeAttribute",n,s),o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;if(t==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;if(ze(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let c=ai(e),l=c?n.toLowerCase():n;if(typeof t=="boolean"){if(n.length>5&&n.slice(0,5).toLowerCase()==="aria-"){let f=t?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(n))!==f&&(o?e.setAttributeNS(o,n,f):e.setAttribute(n,f)),!0}return c&&si.has(l)&&l in e?$n(e,l,t):t?o?e.setAttributeNS(o,n,""):e.setAttribute(n,""):o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0}let d=String(t);if(r.syncValueProperty!==!1&&c&&(l==="value"||l==="checked")&&l in e)return $n(e,l,l==="checked"?!!t:d),!0;let m=d===""?"":Cn(n,d,{element:e});return m===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0):((o?e.getAttributeNS(o,i):e.getAttribute(n))===m||(o?e.setAttributeNS(o,n,m):e.setAttribute(n,m)),!0)}function Rt(e,n,t){if(ze(n))return!1,!1;let r=Ct(e,n,t,"static");return r!==L.None?(Hn("html (static attribute)",n,r),!1):(e.setAttribute(n,t),e.localName==="link"&&Nt(e,n,"static"),!0)}var ui=4096,Lt=[];function di(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function fi(e,n,t){let r=Lt.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=di();return o.sig=e,o.sub=n,o.epoch=t,o}function In(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Lt.length<ui&&Lt.push(e)}function pi(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function Pn(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function mi(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function gi(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var Y=null,oe=null,fe=0,pe=[],G=new Set,hi=[];function bi(e){try{e()}catch(n){let t=e;w(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function yi(e){let n=e.depsHead??null;if(n===null)return!0;for(;n!==null;){let t=n.sig;if(t===null)return!0;if(t._d===!0&&t._validate!==void 0)try{t._validate()}catch{return!0}if(n.depVersion!==t.__v)return!0;n=n.subNext}return!1}var ne=0,ie=!1;function Dt(){ne===0&&(oe=Y,Y=null,ie=!0),ne++}function Ot(){ne--,ne===0&&(Y=oe,oe=null,ie=!1)}function Bn(){return ie}function Fn(e){Dt();try{return e()}finally{Ot()}}var vi=0;function $t(e,n){let t=Y,r=0,o=null;ie&&(r=ne,o=oe,ne=0,oe=null,ie=!1),Y=n;let i=n;i._cap===void 0&&(i._cap=bn());let a=++vi;i._epoch=a,i._structDirty=!1;for(let s=i.depsHead??null;s!==null;s=s.subNext){let c=s.sig;s.prevActive=c.__activeNode??null,c.__activeNode=s}try{e()}finally{Y=t,r!==0&&(ne=r,oe=o,ie=!0);let s=i.depsHead??null;for(;s!==null;){let c=s.subNext,l=s.sig;l.__activeNode=s.prevActive,s.prevActive=null,s.epoch!==a&&(gi(s),Pn(s),In(s)),s=c}}}function zn(e,n){if(!n)return Ht(e);Me(n);let t=Y,r=0,o=null;ie&&(r=ne,o=oe,ne=0,oe=null,ie=!1),Y=n;try{e()}finally{Y=t,r!==0&&(ne=r,oe=o,ie=!0);let a=n;for(let s=a.depsHead??null;s!==null;s=s.subNext){let c=s.sig;c.__activeNode=s.prevActive,s.prevActive=null}}let i=n;return i._dispose??(i._dispose=()=>Me(n))}function Ht(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{$t(e,r)}finally{o._reentrant=!1}}},r=t;r.depsHead=null,r.depsTail=null,r._epoch=0,r._structDirty=!1,r._hasComputedDep=!1,r._runEpoch=0,r._runs=0,r._reentrant=!1,r._disposed=!1,r._errorPhase="binding",r._errorNode=n;try{t()}catch(o){throw r._disposed=!0,r._errorNode=void 0,Me(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,Me(r)})}function Vn(e){if(!Y)return;let n=Y,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r,o.depVersion=t.__v??Number.NaN;return}t._validate!==void 0&&(n._hasComputedDep=!0);let i=fi(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,mi(n,i),pi(t,i),n._structDirty=!0}function Me(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;Pn(t),In(t),t=r}}var ot=1e3,it=1e6,st=0,ve=new Set;function jn(e){let n=ot;return Number.isFinite(e)&&e>0&&(ot=Math.floor(e)),n}function qn(e){let n=it;return Number.isFinite(e)&&e>0&&(it=Math.floor(e)),n}function Si(e){let n=e;return n._runEpoch!==st?(n._runEpoch=st,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>ot)}function xi(e){let n=e.__name??"<unnamed>";w(new Error(`subscriber "${n}" fired more than ${ot} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:n})}function Ei(){w(new Error(`Notification drain exceeded ${it} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Wn(){let e=0;for(;e<pe.length;){if(e>=it){Ei();break}let n=pe[e++];if(G.delete(n),ve.size>0&&ve.has(n)||n._hasComputedDep===!0&&!yi(n))continue;if(Si(n)){xi(n),ve.add(n);continue}let t=yn(n._cap??null);try{bi(n)}finally{t&&vn()}}}function Un(){if(!(fe>0)){fe++,st++;try{Wn()}finally{fe--,fe===0&&(pe.length=0,G.clear(),ve.size>0&&ve.clear())}}}function Mt(e){e();let n=e._sig;if(!n)return;let t=hi,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let a=i.sub;if(a)if(a._c){let s=a._sig;s?(!s._d||s._f===!0)&&(s._d=!0,s._f=!1,t.push(s)):a()}else G.has(a)||(G.add(a),pe.push(a));i=i.sigNext}}}function Kn(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?Mt(r):G.has(r)||(G.add(r),pe.push(r))),t=t.sigNext}}function Jn(e){let t=e.subsHead;if(t){if(fe>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?Mt(o):G.has(o)||(G.add(o),pe.push(o))),r=r.sigNext}return}fe++,st++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?Mt(o):G.has(o)||(G.add(o),pe.push(o))),r=r.sigNext}Wn()}finally{fe--,fe===0&&(pe.length=0,G.clear(),ve.size>0&&ve.clear())}}}function Gn(e){return e.__sc??0}function Yn(e){let n=e,t=[],r=n.depsHead??null;for(;r;)r.sig&&t.push(r.sig),r=r.subNext;return t}function Zn(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var Xn="4.8.0",Qn=Symbol.for("sibujs.reactive.v1");function wi(){let e=globalThis,n=e[Qn];if(n)return!1,n;let t={suspendTracking:Dt,resumeTracking:Ot,isTrackingSuspended:Bn,untracked:Fn,retrack:$t,track:zn,reactiveBinding:Ht,recordDependency:Vn,cleanup:Me,setMaxSubscriberRepeats:jn,setMaxDrainIterations:qn,drainNotificationQueue:Un,queueSignalNotification:Kn,notifySubscribers:Jn,getSubscriberCount:Gn,getSubscriberDeps:Yn,forEachSubscriber:Zn,version:Xn};return e[Qn]=t,t}var $=wi(),Se=$.suspendTracking,xe=$.resumeTracking,er=$.isTrackingSuspended,Z=$.untracked,me=$.retrack,W=$.track,H=$.reactiveBinding,Ee=$.recordDependency,Te=$.cleanup,Pl=$.setMaxSubscriberRepeats,tr=$.setMaxDrainIterations,nr=$.drainNotificationQueue,rr=$.queueSignalNotification,De=$.notifySubscribers,Bl=$.getSubscriberCount,Fl=$.getSubscriberDeps,zl=$.forEachSubscriber;function Ve(e,n,t){if(de(n))return J(e,n,"",{label:`bindAttribute("${n}")`}),()=>{};function r(){let o;try{o=t()}catch(i){w(i,{phase:"binding",name:`bindAttribute("${n}")`,node:e});return}J(e,n,o,{label:`bindAttribute("${n}")`,reactive:!0})}return H(r,e)}function or(e,n,t){let r=null;function o(){let a;try{a=typeof n=="function"?n():n}catch(c){w(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let s;try{s=typeof t=="function"?t():t}catch(c){w(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==a&&(e.removeAttribute(r),r=null),J(e,a,s,{label:"bindDynamic",reactive:!0})&&(r=a)}let i=H(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var It=["data-focus-key","id","name"],ki=new Set(["text","search","url","tel","password",""]);function _i(e){let n=e.tagName;if(!(n==="TEXTAREA"||n==="INPUT"&&ki.has(e.type.toLowerCase())))return{start:null,end:null,direction:null};let r=e;return{start:r.selectionStart,end:r.selectionEnd,direction:r.selectionDirection}}function je(e){if(e.length===0||typeof document>"u")return null;let n=document.activeElement;if(!n||n===document.body)return null;let t=!1;for(let i=0;i<e.length;i++){let a=e[i];if(a===n||a.nodeType===1&&a.contains(n)){t=!0;break}}if(!t)return null;let r=null,o=null;for(let i=0;i<It.length;i++){let a=n.getAttribute(It[i]);if(a){r=It[i],o=a;break}}return{el:n,attr:r,value:o,tag:n.tagName,..._i(n)}}function Ai(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ci(e,n){let t=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let a=i;a.matches(n)&&(r++,t??(t=a));let s=a.querySelectorAll(n);for(let c=0;c<s.length;c++)r++,t??(t=s[c]);if(r>1)return{el:null,count:r}}return r===1?{el:t,count:r}:{el:null,count:r}}function ir(e,n){if(e.focus(),n.start!==null&&typeof e.setSelectionRange=="function"){let t=e,r=t.value.length,o=Math.min(n.start,r),i=Math.min(n.end??o,r);t.setSelectionRange(o,i,n.direction??"none")}}function Oe(e,n,t){if(!e||typeof document>"u")return;let r=document.activeElement;if(r===e.el||r&&r!==document.body&&r!==document.documentElement)return;if(e.el.isConnected){ir(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:a}=Ci(n,`[${e.attr}=${Ai(e.value)}]`);if(i&&i.tagName===e.tag){ir(i,e);return}o=a>1}}function se(e,n){let t=[];function r(){let o;try{o=n()}catch(d){w(d,{phase:"binding",name:"bindChildNode",node:e});return}let i=je(t);if(o==null||typeof o=="boolean"){for(let d=0;d<t.length;d++){let m=t[d];M(m),m.parentNode&&m.parentNode.removeChild(m)}t.length=0,Oe(i,t,"bindChildNode");return}let a=e.parentNode;if(!a){t.length=0;return}let s;if(Array.isArray(o)){s=[];let d=new Set;for(let m=0;m<o.length;m++){let g=o[m];if(g==null||typeof g=="boolean")continue;let f=g instanceof Node?g:document.createTextNode(String(g));if(d.has(f)){!1;continue}d.add(f),s.push(f)}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(t.length>0&&s.length>0){let d=new Set(t);c=new Set;for(let m=0;m<s.length;m++)d.has(s[m])&&c.add(s[m])}for(let d=0;d<t.length;d++){let m=t[d];c?.has(m)||(M(m),m.parentNode&&m.parentNode.removeChild(m))}let l=e;for(let d=0;d<s.length;d++){let m=s[d];l.nextSibling!==m&&a.insertBefore(m,l.nextSibling),l=m}t=s,Oe(i,s,"bindChildNode")}return H(r,e)}var R="http://www.w3.org/2000/svg",Ni=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Pt=new Set,sr=100,ar=!1,cr=new Map;function lr(e){let n=cr.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),cr.set(e,n)),n}function Ri(e,n){if(typeof n=="function"){let r=n,o=[],i=!1,a=H(()=>{let s=r();if(s===null||typeof s!="object"){o=[],i=!0,e.setAttribute("style",tt(String(s),{element:e}));return}let c=e.style;i&&(e.removeAttribute("style"),i=!1);let l=[];for(let d in s){if(!Object.hasOwn(s,d))continue;let m=s[d];if(m==null)continue;let g=lr(d);l.push(g),c.setProperty(g,et(g,String(m),{element:e}))}for(let d=0;d<o.length;d++)l.indexOf(o[d])===-1&&c.removeProperty(o[d]);o=l},e);x(e,a);return}if(typeof n=="string"){e.setAttribute("style",tt(n,{element:e}));return}let t=e;for(let r in n){if(!Object.hasOwn(n,r))continue;let o=n[r],i=lr(r);if(typeof o=="function"){let a=o,s=H(()=>{t.style.setProperty(i,et(i,String(a()),{element:e}))},e);x(e,s)}else t.style.setProperty(i,et(i,String(o),{element:e}))}}function Li(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=H(()=>{let a=n();a==null||a===!1?e.removeAttribute("class"):e.setAttribute("class",a)},e);x(e,i);return}let t=n,r=!1,o="";for(let i in t){if(!Object.hasOwn(t,i))continue;let a=t[i];if(typeof a=="function"){r=!0;break}a&&(o=o?`${o} ${i}`:i)}if(r){let a=H(()=>{let s="";for(let c in t){if(!Object.hasOwn(t,c))continue;let l=t[c];(typeof l=="function"?l():l)&&(s=s?`${s} ${c}`:c)}e.setAttribute("class",s)},e);x(e,a)}else e.setAttribute("class",o)}function Bt(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),x(e,se(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),x(e,se(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 a=document.createComment("");e.appendChild(a),x(e,se(a,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)))}}}function u(e,n){let t=Ln(e);return(r,o)=>{if(t)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=n?document.createElementNS(n,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Bt(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Bt(i,r),i;let a=r,s=a.class;s!=null&&Li(i,s);let c=a.id;typeof c=="function"?x(i,Ve(i,"id",c)):c!=null&&(!1,i.id=c);let l=o!==void 0?o:a.nodes;l!=null&&Bt(i,l);let d=a.on;if(d)for(let f in d){if(!Object.hasOwn(d,f))continue;let p=d[f];typeof p=="function"?i.addEventListener(f,p):!1}let m=a.style;m!=null&&Ri(i,m);let g=a.ref;g&&(g.current=i);for(let f in a)switch(f){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(a,f))continue;let p=a[f];if(p==null||de(f))continue;typeof p=="function"?x(i,Ve(i,f,p)):J(i,f,p,{syncValueProperty:!1,label:"tagFactory"})}}return typeof a.onElement=="function"&&a.onElement(i),i}}var lu=u("html"),Mi=u("head"),Di=u("body"),Oi=u("title"),A=u("div"),O=u("span"),$i=u("section"),Hi=u("article"),Ii=u("header"),Pi=u("footer"),Bi=u("nav"),Fi=u("main"),zi=u("aside"),Vi=u("address"),Ft=u("p"),ji=u("h1"),qi=u("h2"),zt=u("h3"),Wi=u("h4"),Ui=u("h5"),Ki=u("h6"),Ji=u("blockquote"),Gi=u("dd"),Yi=u("dl"),Zi=u("dt"),Xi=u("figcaption"),Qi=u("figure"),es=u("hr"),ts=u("li"),ns=u("ol"),rs=u("ul"),Vt=u("pre"),os=u("a"),is=u("abbr"),ss=u("b"),as=u("bdi"),cs=u("bdo"),ls=u("br"),us=u("cite"),jt=u("code"),ds=u("data"),fs=u("dfn"),ps=u("em"),ms=u("i"),gs=u("kbd"),hs=u("mark"),bs=u("q"),ys=u("rp"),vs=u("rt"),Ss=u("ruby"),xs=u("s"),Es=u("samp"),Ts=u("small"),ws=u("strong"),ks=u("sub"),_s=u("sup"),As=u("time"),Cs=u("u"),Ns=u("var"),Rs=u("area"),Ls=u("audio"),Ms=u("img"),Ds=u("map"),Os=u("track"),$s=u("video"),Hs=u("embed"),Is=u("iframe"),Ps=u("object"),Bs=u("param"),Fs=u("picture"),zs=u("portal"),Vs=u("source"),js=u("svg",R),qs=u("math"),Ws=u("canvas"),Us=u("noscript"),Ks=u("script"),Js=u("del"),Gs=u("ins"),Ys=u("caption"),Zs=u("col"),Xs=u("colgroup"),Qs=u("table"),ea=u("tbody"),ta=u("td"),na=u("tfoot"),ra=u("th"),oa=u("thead"),ia=u("tr"),qe=u("button"),sa=u("datalist"),aa=u("fieldset"),ca=u("form"),la=u("input"),ua=u("label"),da=u("legend"),fa=u("meter"),pa=u("optgroup"),ma=u("option"),ga=u("output"),ha=u("progress"),ba=u("select"),ya=u("textarea"),va=u("details"),Sa=u("dialog"),xa=u("menu"),Ea=u("summary"),Ta=u("slot"),wa=u("template"),ka=u("base"),_a=u("link"),Aa=u("meta"),we=u("style"),Ca=u("circle",R),Na=u("ellipse",R),Ra=u("g",R),La=u("line",R),Ma=u("path",R),Da=u("polygon",R),Oa=u("polyline",R),$a=u("rect",R),Ha=u("text",R),Ia=u("tspan",R),Pa=u("defs",R),Ba=u("clipPath",R),Fa=u("mask",R),za=u("pattern",R),Va=u("linearGradient",R),ja=u("radialGradient",R),qa=u("stop",R),Wa=u("use",R),Ua=u("symbol",R),Ka=u("marker",R),Ja=u("center"),Ga=u("font"),Ya=u("marquee"),Za=e=>u(e);var qt="__sibuPendingError";function ur(e,n){let t=()=>e.parentNode?(w(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[qt]=n)})}function at(e){let n=e,t=n[qt];if(t instanceof Error)return delete n[qt],t}function dr(e){let n=null;return function(){if(n)return n();let r=A({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let a=n();F(r,a)}).catch(i=>{if(o)return;let a=i instanceof Error?i:new Error(String(i));F(r,A({class:"sibu-lazy-error"},`Failed to load component: ${a.message}`)),ur(r,a)}),r.appendChild(O("sibu-lazy-loading","Loading...")),x(r,()=>{o=!0}),r}}function fr({nodes:e,fallback:n}){let t=A({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,a=null;return x(t,()=>{o=!0,i&&(i.disconnect(),i=null),a&&!t.contains(a)&&M(a)}),queueMicrotask(()=>{if(!o)try{let s=e();if(a=s,s.classList.contains("sibu-lazy")){if(!s.querySelector(".sibu-lazy-loading")){F(t,s);return}i=new MutationObserver(()=>{if(o)return;s.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,F(t,s))}),i.observe(s,{childList:!0,subtree:!0})}else F(t,s)}catch(s){let c=s instanceof Error?s:new Error(String(s));ur(t,c)}}),t}function lt(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";w(t,{phase:r,name:n});return}}function Wt(e,n,t,r){let o=lt(e,n);typeof o=="function"&&(r()||!t.isConnected?lt(o,"onUnmount"):mr(o,t))}var $e=new WeakMap,ke=new WeakMap,ae=new Set,ce=new Set,He=null,ct=0,Xa=256;function Ut(e){let n=$e.get(e);if(n){$e.delete(e),ae.delete(e);for(let t of n)try{t()}catch{}}}function Kt(e){ke.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=ke.get(e);if(t){ke.delete(e),ce.delete(e);for(let r of t)try{r()}catch{}}})}function Qa(e){if(ae.size===0||e.nodeType!==1)return;let n=e;if(ae.has(n)&&n.isConnected&&Ut(n),n.firstElementChild)for(let t of Array.from(ae))t!==n&&t.isConnected&&n.contains(t)&&Ut(t)}function ec(e){if(ce.size===0||e.nodeType!==1)return;let n=e;if(ce.has(n)&&!n.isConnected&&Kt(n),n.firstElementChild)for(let t of Array.from(ce))t!==n&&!t.isConnected&&n.contains(t)&&Kt(t)}function tc(){if(ae.size>0)for(let e of Array.from(ae))e.isConnected&&Ut(e);if(ce.size>0)for(let e of Array.from(ce))e.isConnected||Kt(e)}function pr(){He||typeof document>"u"||(He=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)Qa(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)ec(n.removedNodes[t])}ct+=e.length,ct>=Xa&&(ct=0,tc()),Jt()}),He.observe(document.body,{childList:!0,subtree:!0}))}function Jt(){He&&ae.size===0&&ce.size===0&&(He.disconnect(),He=null,ct=0)}function nc(e,n){let t=$e.get(e);return t||(t=[],$e.set(e,t)),t.push(n),ae.add(e),pr(),()=>{let r=$e.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&($e.delete(e),ae.delete(e))}Jt()}}function rc(e,n){let t=ke.get(e);return t||(t=[],ke.set(e,t)),t.push(n),ce.add(e),pr(),()=>{let r=ke.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(ke.delete(e),ce.delete(e))}Jt()}}function ut(e,n){if(!(typeof document>"u"))if(n){let t=!1,r=()=>t;if(x(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||Wt(e,"onMount",n,r)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){Wt(e,"onMount",n,r);return}let o=nc(n,()=>{t||Wt(e,"onMount",n,r)});x(n,o)})}else queueMicrotask(()=>{lt(e,"onMount")})}function mr(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,lt(e,"onUnmount"))};x(n,r);let o=()=>{if(t)return;let i=rc(n,r);x(n,i)};n.isConnected?o():ut(()=>{o()},n)}function oc(e,n){x(n,e)}function U(e,n,t){try{e.emit(n,t)}catch{}}var Gt=Symbol.for("sibujs.ssr.v1");function ic(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,t=process.getBuiltinModule;typeof t=="function"?n=t("node:async_hooks"):typeof yt=="function"&&(n=yt("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var ge=globalThis[Gt]??(globalThis[Gt]=ic()),_e=ge.als,B=ge.fallbackStore;ge.fallbackDepth??(ge.fallbackDepth=0);var gr=!1;function sc(){if(gr||_e||!(typeof process<"u"&&!!process.versions?.node))return;gr=!0;let n=process.versions.node;`${n}`}function Ae(){if(_e){let e=_e.getStore();if(e)return e}return B}function hr(){return _e?_e.getStore()??null:ge.fallbackDepth>0?B:null}function X(){return Ae().ssr}function br(e){if(!X())return null;let n=Ae(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function yr(){Ae().ssr=!0}function vr(){Ae().ssr=!1}function Sr(e){let n={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(_e)return _e.run(n,e);sc();let t=B.ssr,r=B.suspenseIdCounter,o=B.idCounter,i=B.locale;B.ssr=!0,B.suspenseIdCounter=0,B.idCounter=0,B.locale=void 0,ge.fallbackDepth++;try{return e()}finally{ge.fallbackDepth--,B.ssr=t,B.suspenseIdCounter=r,B.idCounter=o,B.locale=i}}function xr(e){let n=Ae(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var wr=globalThis;function ac(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,Z(()=>n(o,void 0));else{let i=t;t=o,Z(()=>n(o,i))}}}var Er=100;function dt(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){w(r,{phase:"cleanup"})}}}function Tr(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&dt(e),me(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=Er);e.rerunPending&&(e.rerunPending=!1,w(new Error(`effect re-requested itself ${Er}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function cc(e){if(e.disposed)return;e.disposed=!0;let n=wr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&dt(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{Te(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function K(e,n){if(X())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=a=>{t.userCleanups.push(a)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(a){r(a)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(!t.disposed){if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&dt(t),me(t.bodyFn,o),t.rerunPending&&Tr(t)}finally{t.running=!1,t.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,t.subscriber=o,t.running=!0;try{me(t.bodyFn,t.subscriber),t.rerunPending&&Tr(t)}catch(a){throw t.disposed=!0,t.userCleanups.length>0&&dt(t),Te(t.subscriber),a}finally{t.running=!1,t.rerunPending=!1}let i=wr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&U(i,"effect:create",{effectFn:e}),()=>cc(t)}var We=0,Yt=new Set;function lc(e){We++;try{return e()}finally{We--,We===0&&fc()}}function uc(e){return We===0?!1:(Yt.add(e),!0)}function dc(){return We>0}function fc(){try{for(let e of Yt)rr(e)}finally{Yt.clear()}nr()}var kr=Symbol.for("sibujs.reactive.batch.v1");function pc(){let e=globalThis,n=e[kr];if(n)return n;let t={batch:lc,enqueueBatchedSignal:uc,isBatching:dc};return e[kr]=t,t}var Zt=pc(),z=Zt.batch,Ce=Zt.enqueueBatchedSignal,mc=Zt.isBatching;var Xt=globalThis;function C(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=n?.equals;r&&(t.__name=r);function i(){return Ee(t),t.value}i.__signal=t,r&&(i.__name=r);let a;if(o?a=s=>{let c=t.value,l=typeof s=="function"?s(c):s;if(!o(c,l)){if(t.value=l,t.__v++,!1){let d=Xt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&U(d,"signal:update",{signal:t,name:r,oldValue:c,newValue:l})}Ce(t)||De(t)}}:a=s=>{let c=t.value,l=typeof s=="function"?s(c):s;Object.is(l,c)||(t.value=l,t.__v++,Ce(t)||De(t))},!1){let s=Xt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;s&&U(s,"signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,a]}function gc(e){let[n,t]=C(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var hc=`
|
|
6
8
|
.sibu-error-display {
|
|
7
9
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
8
10
|
border-radius: 10px;
|
|
@@ -183,11 +185,11 @@
|
|
|
183
185
|
border: 1px solid #3a3a4e;
|
|
184
186
|
}
|
|
185
187
|
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
186
|
-
`,
|
|
187
|
-
`);for(let r of t){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){n.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let a=o.match(/^(.+?)@(.+)$/);a&&n.push({fn:a[1]||"(anonymous)",loc:a[2]||""})}return n}function
|
|
188
|
+
`,_r=!1;function bc(){if(_r||typeof document>"u")return;let e=we({nodes:hc});document.head.appendChild(e),_r=!0}function yc(e){let n=[],t=e.split(`
|
|
189
|
+
`);for(let r of t){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){n.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let a=o.match(/^(.+?)@(.+)$/);a&&n.push({fn:a[1]||"(anonymous)",loc:a[2]||""})}return n}function Ar(e){if(e instanceof Error){let n=e.code??e.name??"ERROR",t=e.message||"Unknown error",r=e.stack??"",o=yc(r),i=e.cause,a=i!=null?Ar(i):null;return{code:n,message:t,stack:r,frames:o,cause:a}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function vc(e,n,t){let r=[];r.push(t),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
|
|
188
190
|
`).map(a=>` ${a}`).join(`
|
|
189
191
|
`);r.push(i)}o=o.cause}if(n&&Object.keys(n).length>0){r.push(""),r.push("Metadata:");for(let[i,a]of Object.entries(n))r.push(` ${i}: ${String(a)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
|
|
190
|
-
`)}function
|
|
192
|
+
`)}function Cr(e){let n=e.map((t,r)=>A({class:"sibu-err-frame",nodes:[O({class:"sibu-err-line",nodes:String(r+1)}),O({class:"sibu-err-fn",nodes:t.fn}),O({class:"sibu-err-loc",nodes:` \u2014 ${t.loc}`})]}));return Vt({class:"sibu-err-stack",nodes:n})}function Nr(e){return e?[A({class:"sibu-err-cause-label",nodes:"Caused by"}),A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[O({nodes:`[${e.code}] ${e.message}`}),O({nodes:""})]}),e.frames.length>0?Cr(e.frames):A({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Nr(e.cause)]:[]}function Sc(e){let n=[];for(let[r,o]of Object.entries(e)){n.push(document.createElement("dt")),n[n.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),n.push(i)}let t=document.createElement("dl");t.className="sibu-err-meta";for(let r of n)t.appendChild(r);return t}function Qt(e){bc();let n=e.severity??"error",t=Ar(e.error),r=e.alwaysShowDetails??ee(),o=e.title??t.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[a,s]=C("Copy"),c=qe({class:"sibu-err-copy-btn",nodes:()=>a(),on:{click:()=>{let f=vc(t,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(f).then(()=>{s("Copied!"),setTimeout(()=>s("Copy"),1500)},()=>{s("Copy failed"),setTimeout(()=>s("Copy"),1500)})}}}),l=A({class:"sibu-err-header",nodes:[jt({class:"sibu-err-icon",nodes:t.code}),zt({class:"sibu-err-title",nodes:o}),c,O({class:"sibu-err-timestamp",nodes:i})]}),d=[Ft({class:"sibu-err-message",nodes:t.message})];r&&t.frames.length>0&&d.push(A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[O({nodes:"Stack Trace"})]}),Cr(t.frames)]})),r&&d.push(...Nr(t.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[O({nodes:"Metadata"})]}),Sc(e.metadata)]}));let m=[];e.onRetry&&m.push(qe({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&m.push(qe({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),m.length>0&&d.push(A({class:"sibu-err-actions",nodes:m}));let g=A({class:"sibu-err-body",nodes:d});return A({class:"sibu-error-display","data-severity":n,nodes:[l,g]})}var xc=`
|
|
191
193
|
.sibu-error-boundary {
|
|
192
194
|
position: relative;
|
|
193
195
|
}
|
|
@@ -341,7 +343,7 @@
|
|
|
341
343
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
342
344
|
background: #3a3a4e;
|
|
343
345
|
}
|
|
344
|
-
`,
|
|
346
|
+
`,Ec=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Rr=!1;function Tc(){if(!Rr&&typeof document<"u"){let e=we({nodes:xc});document.head.appendChild(e),Rr=!0}}function wc(e,n){let t=typeof e=="function"?e:n,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:a}=r;Tc();let[s,c]=C(null),l=()=>{m(),c(null)},d=null,m=()=>{if(!d)return;let v=d;d=null,v()},g=v=>{let E=new Array(v.length);for(let T=0;T<v.length;T++)try{E[T]=v[T]()}catch(D){w(D,{phase:"effect",name:"ErrorBoundary.resetKeys"}),E[T]=Ec}return E},f=()=>{let v=a;if(!v||v.length===0)return;m();let E=null;d=K(()=>{let T=g(v);if(E===null){E=T;return}let D=T.length!==E.length;if(!D){for(let I=0;I<T.length;I++)if(!Object.is(T[I],E[I])){D=!0;break}}E=T,D&&l()})},p=v=>{let E=St(v);if(c(E),f(),i)try{i(E)}catch(T){w(T,{phase:"render",name:"ErrorBoundary onError callback"})}return E},h=(v,E)=>Qt({error:v,severity:"error",onRetry:E}),b=v=>{let E=o||h;try{return E(v,l)}catch(T){return queueMicrotask(()=>{w(T,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=A({class:"sibu-error-boundary",nodes:()=>{let v=s();if(v)return b(v);try{let E=t();if(E&&typeof E.then=="function"){let T=A({class:"sibu-error-async"});T.appendChild(O({class:"sibu-lazy-loading",nodes:"Loading..."}));let D=!1;return x(T,()=>{D=!0}),E.then(I=>{if(D){M(I);return}F(T,I)}).catch(I=>{if(D)return;let Re=p(I);F(T,b(Re))}),T}return E}catch(E){let T=p(E);return b(T)}}}),k=v=>{if(s())return;let T=v.detail?.error;T&&(v.preventDefault(),v.stopPropagation(),p(T))};return y.addEventListener("sibu:error-propagate",k),ut(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),E=[],T=v.currentNode;for(;T;){let D=at(T);D&&E.push(D),T=v.nextNode()}if(E.length===1)p(E[0]);else if(E.length>1){let D=globalThis.AggregateError;p(D?new D(E,`${E.length} pre-mount errors caught by ErrorBoundary`):new Error(E.map(I=>I.message).join("; ")))}},y),x(y,()=>{m(),y.removeEventListener("sibu:error-propagate",k)}),y}var kc=`
|
|
345
347
|
@keyframes sibu-spin {
|
|
346
348
|
to { transform: rotate(360deg); }
|
|
347
349
|
}
|
|
@@ -394,5 +396,5 @@
|
|
|
394
396
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
395
397
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
396
398
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
397
|
-
`,
|
|
398
|
-
`||t[r]==="\r");)r++}function a(){if(t.charCodeAt(r)!==0)return-1;let d=r;r++;let f=0;for(;r<o&&t.charCodeAt(r)!==0;)f=f*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,f<0||f>=n?(r=d,-1):f}function s(){let d=r;for(;r<o;){let f=t.charCodeAt(r);if(f>=97&&f<=122||f>=65&&f<=90||f>=48&&f<=57||f===45)r++;else break}return t.slice(d,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let d=a();if(d>=0)return{kind:"expr",idx:d};let f=t[r];if(f==='"'||f==="'"){r++;let b=[],h=[],y="";for(;r<o&&t[r]!==f;){let k=a();k>=0?(b.push(y),y="",h.push(k)):y+=t[r++]}return r<o&&r++,b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}{let b=[],h=[],y="";for(;r<o;){let k=t.charCodeAt(r);if(k===32||k===9||k===10||k===13||k===62)break;let v=a();v>=0?(b.push(y),y="",h.push(v)):y+=t[r++]}return b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function l(){let d=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let f=r;for(;r<o;){let y=t.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let b=t.slice(f,r);if(!b)break;let h=c();b.startsWith("on:")?h.kind==="expr"&&d.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?d.push({t:4,name:b}):h.kind==="static"?d.push({t:0,name:b,value:h.value}):h.kind==="expr"?d.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&d.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return d}function p(d){return d.replace(/\s+/g," ")}function g(d){let f="";for(;r<o&&t[r]!=="<";){let h=a();if(h>=0){let y=p(f);y&&d.push({t:1,value:y}),f="",d.push({t:2,idx:h})}else f+=t[r++]}let b=p(f);b&&d.push({t:1,value:b})}function m(){let d=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let f=t[r+1];if(f==="!"){if(t.startsWith("<!--",r)){let v=t.indexOf("-->",r+4);r=v===-1?o:v+3}else if(t.startsWith("<![CDATA[",r)){let v=t.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=t.indexOf(">",r);r=v===-1?o:v+1}continue}if(f==="?"){let v=t.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(f>="a"&&f<="z")&&!(f>="A"&&f<="Z")){d.push({t:1,value:"<"}),r++;continue}r++;let b=s(),h=l();i();let y=Ya.has(b),k=t[r]==="/";if(k&&r++,r<o&&r++,y||k)d.push({t:0,el:{tag:b,svg:gr.has(b),attrs:h,children:[]}});else{let v=m();if(Ga.has(b.toLowerCase())){for(let S=0;S<v.length;S++)if(v[S].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,s(),i(),r<o&&t[r]===">"&&r++),d.push({t:0,el:{tag:b,svg:gr.has(b),attrs:h,children:v}})}}else g(d);return d}return m()}function $t(e,n){let t=e.svg?document.createElementNS(N,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:t.setAttribute(o.name,o.value);break;case 1:{let i=o.name,a=n[o.idx];typeof a=="function"?T(t,Ke(t,i,a)):q(t,i,a,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let a=0;a<o.exprs.length;a++){let s=n[o.exprs[a]];i+=(s==null?"":String(s))+o.statics[a+1]}q(t,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):!1;break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild($t(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let a=document.createComment("");t.appendChild(a),T(t,pe(a,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let a=0;a<i.length;a++){let s=i[a];s instanceof Node?t.appendChild(s):s!=null&&typeof s!="boolean"&&t.appendChild(document.createTextNode(String(s)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function hr(e,...n){let t=br.get(e);if(t||(t=Za(e),br.set(e,t)),t.length===1&&t[0].t===0)return $t(t[0].el,n);let r=document.createElement("div");for(let o=0;o<t.length;o++){let i=t[o];switch(i.t){case 0:r.appendChild($t(i.el,n));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let a=n[i.idx];if(a instanceof Node)r.appendChild(a);else if(typeof a=="function"){let s=document.createComment("bind:htm");r.appendChild(s),T(r,pe(s,a))}else if(Array.isArray(a))for(let s=0;s<a.length;s++){let c=a[s];c instanceof Node?r.appendChild(c):c!=null&&typeof c!="boolean"&&r.appendChild(document.createTextNode(String(c)))}else a!=null&&typeof a!="boolean"&&r.appendChild(document.createTextNode(String(a)));break}}}return r.childNodes.length===1&&r.firstChild instanceof Element?r.firstChild:r}function Xa(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],a=t?.max??10;a===0&&J()&&void 0;let s,c=null,l=!1,p=!1,g=()=>{if(p)return;let d=e(),f=r.parentNode;if(!f||l&&d===s)return;c?.parentNode&&f.removeChild(c),s=d;let b=o.get(d);if(b){let h=i.indexOf(d);h!==-1&&(i.splice(h,1),i.push(d))}else{let h=n[d];if(!h){c=null,l=!0;return}if(b=h(),b instanceof DocumentFragment){let y=document.createElement("div");y.style.display="contents",y.appendChild(b),b=y}if(o.set(d,b),i.push(d),a>0&&i.length>a){let y=i.shift(),k=o.get(y);k&&(L(k),k.parentNode&&k.parentNode.removeChild(k),o.delete(y))}}f.insertBefore(b,r.nextSibling),c=b,l=!0},m=z(g);return l||queueMicrotask(()=>{!l&&r.parentNode&&g()}),T(r,()=>{p=!0,m();for(let d of o.values())L(d),d.parentNode&&d.parentNode.removeChild(d);o.clear(),i.length=0,c=null}),r}function Qa(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let t=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-t:0;n.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:n,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),L(r),r.parentNode&&r.parentNode.removeChild(r)}}}function ec(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{w(a,{phase:"render",name:"Portal",node:t.parentNode?t:void 0})})}}),T(t,()=>{i=!0,o&&(L(o),o.remove(),o=null)}),t}function tc(e,n="default"){if(e==null||!Object.hasOwn(e,n))return;let t=e[n];return typeof t=="function"?t:void 0}function yr(e,n,t){return t.length===0?e.splice(n):e.splice(n,...t)}function nc(e=[]){let[n,t]=C([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let a=[...i];return o=a.pop(),a}),o},shift(){let o;return t(i=>{let a=[...i];return o=a.shift(),a}),o},unshift(...o){t(i=>[...o,...i])},splice(o,...i){let a=[];return t(s=>{let c=[...s];return a=yr(c,o,i),a.length===0&&i.length<=1?s:c}),a},remove(o){t(i=>i.filter((a,s)=>s!==o))},removeWhere(o){t(i=>{let a=i.findIndex(o);return a===-1?i:i.filter((s,c)=>c!==a)})},set(o){t([...o])},update(o,i){t(a=>a.map((s,c)=>c===o?i:s))},updateWhere(o,i){t(a=>a.map(s=>o(s)?i(s):s))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function rc(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,ye(r)||Ee(r)}function i(){if(fe(r),t===null){let s=n.slice();t=Object.freeze(s)}return t}return[i,{push(...s){s.length!==0&&(n.push(...s),o())},pop(){if(n.length===0)return;let s=n.pop();return o(),s},shift(){if(n.length===0)return;let s=n.shift();return o(),s},unshift(...s){s.length!==0&&(n.unshift(...s),o())},splice(s,...c){let l=yr(n,s,c);return(l.length>0||c.length>1)&&o(),l},remove(s){s<0||s>=n.length||(n.splice(s,1),o())},removeWhere(s){let c=n.findIndex(s);c!==-1&&(n.splice(c,1),o())},set(s){n=[...s],o()},update(s,c){s<0||s>=n.length||Object.is(n[s],c)||(n[s]=c,o())},updateWhere(s,c){let l=!1;for(let p=0;p<n.length;p++)if(s(n[p])){let g=c(n[p]);Object.is(n[p],g)||(n[p]=g,l=!0)}l&&o()},sort(s){n.length<=1||(n.sort(s),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(s){let c=n.filter(s);c.length!==n.length&&(n=c,o())},map(s){let c=!1;for(let l=0;l<n.length;l++){let p=s(n[l],l);Object.is(n[l],p)||(n[l]=p,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function oc(e,n){let[t,r]=C(n),[o,i]=C(!1),[a,s]=C(null),[c,l]=C(0),p=0,g=!1,m=null,d=()=>{if(m===null)return;let b=m;m=null;try{b.abort()}catch{}},f=V(()=>{if(c(),g)return;d();let b=++p,h=typeof AbortController<"u"?new AbortController:null;m=h,F(()=>{i(!0),s(null)});let y=()=>g||b!==p,k;try{k=e({signal:h?h.signal:void 0})}catch(v){if(y())return;F(()=>{s(v),i(!1)});return}k.then(v=>{y()||(m=null,F(()=>{r(v),i(!1)}))},v=>{y()||(m=null,F(()=>{s(v),i(!1)}))})});return{value:t,loading:o,error:a,refresh:()=>{g||l(b=>b+1)},dispose:()=>{g||(g=!0,f(),d())}}}function Ce(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let s=n;return e.source===s.source&&e.flags===s.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let s=n;if(e.size!==s.size)return!1;for(let[c,l]of e)if(!s.has(c)||!Ce(l,s.get(c),t))return!1;return!0}if(e instanceof Set){let s=n;if(e.size!==s.size)return!1;for(let c of e)if(!s.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let s=new Uint8Array(e),c=new Uint8Array(n);if(s.length!==c.length)return!1;for(let l=0;l<s.length;l++)if(s[l]!==c[l])return!1;return!0}if(e instanceof DataView){if(!(n instanceof DataView)||e.byteLength!==n.byteLength)return!1;for(let s=0;s<e.byteLength;s++)if(e.getUint8(s)!==n.getUint8(s))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let s=e,c=n;if(s.length!==c.length)return!1;for(let l=0;l<s.length;l++)if(s[l]!==c[l])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((s,c)=>Ce(s,n[c],t));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),n.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===n.href;if(e instanceof Error){let s=n;return e.name===s.name&&e.message===s.message&&Ce(e.cause,s.cause,t)&&vr(r,o,t)}let a=Object.getPrototypeOf(r);return a!==Object.prototype&&a!==null?!1:vr(r,o,t)}function vr(e,n,t){let r=Object.keys(e),o=Object.keys(n);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(n,i)&&Ce(e[i],n[i],t))}function ic(e){return C(e,{equals:(n,t)=>Ce(n,t)})}function It(e,n){let t=n?.name,r=n?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,a=!1,s,c=()=>{o._d||a||(o._d=!0)};c._c=1,c._sig=o;let l=()=>{let f=e();o._v=r&&o._init&&r(o._v,f)?o._v:f,o._d=!1,o._init=!0};z(()=>{let f=!0;try{o._v=e(),o._d=!1,o._init=!0,f=!1}finally{f&&(o._d=!0)}},c);let p=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,g=()=>{if(!o._d||a||s!==void 0)return;let f=o._v;i=!0;try{oe(l,c),Object.is(f,o._v)||o.__v++}catch(b){s={error:b},o.__v++,a?o._d=!0:o._f=!0}finally{i=!1,a&&De(c)}p&&!a&&!Object.is(f,o._v)&&p.emit("computed:update",{signal:o,oldValue:f,newValue:o._v})};o._validate=g;let m=()=>{let{error:f}=s;throw s=void 0,a&&(o._d=!1),f};function d(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return _n()||a?(o._d&&(g(),s!==void 0&&m()),o._v):(o._d&&(g(),s!==void 0&&(fe(o),m())),fe(o),o._v)}return t&&(d.__name=t,o.__name=t),d.__signal=o,d.dispose=()=>{if(a)return;a=!0,o._d=s!==void 0,De(c);let f=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(f)try{f.emit("computed:destroy",{signal:o,getter:d})}catch{}},p&&p.emit("computed:create",{signal:o,name:t,getter:d}),d}function sc(e){let[n,t]=C(e);return{get current(){return n()},set current(r){t(r)}}}function xr(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function ac(e){e!==null&&typeof e=="object"&&Array.isArray(e);let n=Object.create(null);Object.keys(e).forEach(c=>{let[l,p]=C(e[c]);xr(n,c,[l,p])});let t=new Proxy({},{get(c,l){if(typeof l=="string"&&Object.hasOwn(n,l)){let p=n[l][0];return p()}return Reflect.get(c,l)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(n).forEach(l=>{xr(c,l,n[l][0]())}),c};return[t,{setState:c=>{let l=r(),p=typeof c=="function"?c(l):c;F(()=>{Object.entries(p).forEach(([g,m])=>{Object.hasOwn(n,g)&&n[g][1](m)})})},reset:()=>{F(()=>{Object.keys(e).forEach(c=>{let l=n[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return V(()=>{let p=r();if(l){l=!1;return}le();try{c(p)}finally{de()}})},subscribeKey:(c,l)=>{let p,g=!0;return V(()=>{let m=n[c][0]();if(g){p=m,g=!1;return}if(!Object.is(m,p)){let d=p;p=m,le();try{l(m,d)}finally{de()}}})},getSnapshot:r}]}function cc(e,n){if(U())return()=>{};let t,r=!0;return z(()=>{let a=e();if(r){t=a,r=!1;return}if(!Object.is(a,t)){let s=t;t=a,le();try{n(a,s)}finally{de()}}})}function uc(e,n,t){return[It(e,t),i=>{F(()=>n(i))}]}function lc(e){let n=e();return J()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function dc(e){if(!J())return V(e);let n=V(e),t=null;return queueMicrotask(()=>{try{t=V(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}function Sr(e,n){return U()?()=>{}:O(e,n)}var Pt="data-sibu-enhanced",Bt=new WeakMap;function Tr(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=Le){let i=r.length-o+e.length;e.length=0,Re(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var Er=["text","attr","class","show","on","cleanup"];function wr(e,n){if(n==null)return e;if(typeof n!="string")return n;let t=n.startsWith("@")?`[data-ref="${n.slice(1)}"]`:n;try{return e.querySelector(t)}catch{return null}}function Ie(e,n){return Sr(n,e)}function fc(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,n=>n.value):e.value}function pc(e,n){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!n;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(n)?n.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let t=n==null?"":String(n);e.value!==t&&(e.value=t)}function mc(e,n,t,r){let o=`ctx.each[${r}]`;if(J())for(let i of Object.keys(t))Er.includes(i),`${o}${i}${Er.join(", ")}`;if(t.text!==void 0&&(t.text,`${o}`,e.text(n,t.text)),t.attr!==void 0)for(let i of Object.keys(t.attr)){let a=t.attr[i];`${o}${i}`,e.attr(n,i,a)}if(t.class!==void 0)for(let i of Object.keys(t.class)){let a=t.class[i];`${o}${i}`,e.classed(n,i,a)}if(t.show!==void 0&&(t.show,`${o}`,e.show(n,t.show)),t.on!==void 0)for(let i of Object.keys(t.on)){let a=t.on[i];`${o}${String(i)}`,e.on(n,i,a)}t.cleanup!==void 0&&(t.cleanup,`${o}`,e.cleanup(t.cleanup))}function Xe(e,n){let t=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!t)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(t.getAttribute(Pt)==="true")return J()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,a=!1,s=m=>a?!0:!1,c=(m,d,f)=>{if(s(m))return;let b=wr(t,d);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(d)} not found under`,t);return}f(b)},l={root:t,ref:m=>wr(t,m),refs:m=>{let d=m.startsWith("@")?`[data-ref="${m.slice(1)}"]`:m;try{return Array.from(t.querySelectorAll(d))}catch{return[]}},on:(m,d,f,b)=>{c("on",m,h=>{let y=k=>f(k,h);h.addEventListener(d,y,b),r.push(()=>h.removeEventListener(d,y,b))})},text:(m,d)=>{c("text",m,f=>{r.push(Ie(f,()=>{let b=d(),h=b==null?"":String(b);f.textContent!==h&&(f.textContent=h)}))})},attr:(m,d,f)=>{c("attr",m,b=>{r.push(Ie(b,()=>{let h=f(),y=h==null?null:String(h);q(b,d,y,{syncValueProperty:!1,label:"enhance attr()"})}))})},classed:(m,d,f)=>{c("classed",m,b=>{r.push(Ie(b,()=>{b.classList.toggle(d,!!f())}))})},show:(m,d)=>{c("show",m,f=>{let b=f.hidden;r.push(Ie(f,()=>{f.hidden=!d()})),r.push(()=>{f.hidden=b})})},model:(m,d,f)=>{c("model",m,b=>{let h=b,[y,k]=d,v=f?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(Ie(b,()=>{pc(h,y())}));let S=()=>k(fc(h));h.addEventListener(v,S),r.push(()=>h.removeEventListener(v,S))})},each:(m,d)=>{if(s("each"))return;let f=typeof m=="string"?l.refs(m):Array.from(m);for(let b=0;b<f.length;b++){let h=f[b],y=d(h,b);y!=null&&mc(l,h,y,b)}},cleanup:m=>{s("cleanup")||r.push(m)}},p;try{p=n(l);let m=p;if(m&&typeof m.then=="function")throw m.then(void 0,d=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(m){throw Tr(r,"enhance"),a=!0,m}typeof p=="function"&&r.push(p);let g=()=>{i||(i=!0,Bt.get(t)===o&&(Bt.delete(t),t.removeAttribute(Pt)),ze(t,g),Tr(r,"enhance"),a=!0)};return T(t,g),Bt.set(t,o),t.setAttribute(Pt,"true"),g}function gc(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push(Xe(r,n))}catch(r){for(let o=t.length-1;o>=0;o--)try{t[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw t.length=0,r}return()=>{for(let r of t.splice(0))r()}}var bc=/^[A-Za-z0-9_-]+$/,kr=Symbol.for("sibujs.islands.lazy"),Qe=Ze(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function hc(e){return e[kr]=!0,e}function yc(e,n){if(!bc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Qe.set(e,n)}function vc(e){Qe.delete(e)}async function xc(e){if(typeof e=="function"&&e[kr]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function Sc(e=typeof document<"u"?document:null,n={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let t=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let a=i.getAttribute("data-sibu-island")??"";if(!Qe.has(a)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${a}" \u2014 skipping. Call registerIsland("${a}", ...).`);continue}let s=!1,c=()=>{if(s||o)return;s=!0;let p=Qe.get(a);p&&xc(p).then(g=>{if(!o){if(!g){typeof console<"u"&&console.warn(`[SibuJS islands] "${a}" loader produced no setup.`);return}try{let m=Xe(i,g);if(o){m();return}r.push(m),i.setAttribute("data-sibu-hydrated","true")}catch(m){typeof console<"u"&&console.error(`[SibuJS islands] "${a}" failed to mount:`,m)}}}).catch(g=>{typeof console<"u"&&console.error(`[SibuJS islands] "${a}" failed to load:`,g)})},l=i.getAttribute("data-sibu-load")||"load";t.push(Tc(l,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function Tc(e,n,t,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(t);return()=>cancelIdleCallback(i)}let o=setTimeout(t,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(t),()=>{};let o=new IntersectionObserver(i=>{for(let a of i)a.isIntersecting&&(o.disconnect(),t())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(n),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{a(),t()},a=()=>{for(let s of o)n.removeEventListener(s,i)};for(let s of o)n.addEventListener(s,i,{passive:!0});return a}case"media":{let o=n.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(t),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(t),()=>{};let a=()=>{i.matches&&(i.removeEventListener("change",a),t())};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)}default:return queueMicrotask(t),()=>{}}}function _r(e){return e}var xd=1024*1024;function Ar(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let n;try{n=e.then}catch(t){return Promise.reject(t)}return typeof n!="function"?null:new Promise((t,r)=>{queueMicrotask(()=>{try{Reflect.apply(n,e,[t,r])}catch(o){r(o)}})})}function Ec(e){let[n,t]=C(e()),r=!1,o=!1,i=n(),a=()=>{r=!1,!o&&t(i)},s=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(a):a()}))},c=z(()=>{i=e(),s()}),l=(()=>n());return l.dispose=()=>{o||(o=!0,c())},l}var Cr=16;function wc(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:Cr*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Cr)}function kc(){let[e,n]=C(!1),t=0;function r(o){t++,n(!0);let i=!1,a=()=>{i||(i=!0,t--,t===0&&n(!1))},s=c=>{a(),w(c,{phase:"async",name:"transition"})};wc(()=>{try{let c=Ar(o());c?c.then(a,s):a()}catch(c){s(c)}})}return{pending:e,start:r}}function _c(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...Ft});})();
|
|
399
|
+
`,Lr=!1;function _c(){!Lr&&typeof document<"u"&&(document.head.appendChild(we({nodes:kc})),Lr=!0)}function Ac(e={}){_c();let{text:n,variant:t="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return t==="dots"?A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading"},[A({class:"sibu-loading-dots"},[O({class:"sibu-loading-dot"}),O({class:"sibu-loading-dot"}),O({class:"sibu-loading-dot"})]),n?O({class:"sibu-loading-text"},n):null]):A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading"},[A({class:"sibu-loading-spinner"}),n?O({class:"sibu-loading-text"},n):null])}var en=Symbol.for("sibujs.actions.v1"),Mr=globalThis[en]??(globalThis[en]=new Map);function Ie(e,n){Mr.set(e,n)}function Dr(e){return Mr.get(e)}function Cc(e,n,t){let r=typeof n=="string"?Dr(n):n;if(!r)throw new Error(`[SibuJS] No action registered under the name "${n}". Register it with registerAction() before applying it by name.`);let o=r(e,t);typeof o=="function"&&x(e,o)}var Or=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},$r=(e,n)=>{let t=n.duration??500,r=null,o=()=>{r=setTimeout(()=>{n.callback(),r=null},t)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},Hr=(e,n)=>{let t=o=>w(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof n=="function"?n():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(t)}catch(o){t(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},Ir=e=>{let n=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return n(),e.addEventListener("input",n),()=>e.removeEventListener("input",n)},Pr=e=>{let n='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',t=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(n));if(o.length===0)return;let i=o[0],a=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),a.focus()):!r.shiftKey&&document.activeElement===a&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)};Ie("clickOutside",Or);Ie("longPress",$r);Ie("copyOnClick",Hr);Ie("autoResize",Ir);Ie("trapFocus",Pr);function ft(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let n;try{n=e.then}catch(t){return Promise.reject(t)}return typeof n!="function"?null:new Promise((t,r)=>{queueMicrotask(()=>{try{Reflect.apply(n,e,[t,r])}catch(o){r(o)}})})}var Ne=null;function Nc(e,n){try{let t=e(),r=ft(t);return r&&r.then(void 0,o=>{n?n(o,"async"):Ne?Ne(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),t}catch(t){return n?n(t,"sync"):Ne?Ne(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function Rc(e,n){try{return await e()}catch(t){return n?n(t,"async"):Ne?Ne(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function Lc(e){Ne=e}function Mc(e){let[n,t]=C(e),r=i=>{!!1||!X()||(`${i}`,void 0)};return{provide(i){r("provide");let a=n();return t(i),()=>t(a)},use(){return n},get(){return n()},set(i){r("set"),t(i)},withContext(i,a){r("withContext");let s=n();t(i);try{let c=a();return!1,c}finally{t(s)}}}}var tn=Symbol.for("sibujs.createId.v1"),nn=globalThis[tn]??(globalThis[tn]={n:0});function Br(e="sibu"){let n=hr();return n?(n.idCounter=(n.idCounter??0)+1,`${e}-${n.idCounter}`):(nn.n++,`${e}-${nn.n}`)}function Fr(){nn.n=0}function Dc(e,n){let t=typeof n=="function"?n():n;return x(t,H(()=>{t.style.display=e()?"":"none"},t)),t}function zr(e,n,t,r,o){let i=typeof t=="function"?t():t;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let a=i instanceof Node?i:document.createTextNode(String(i)),s=a===t,c=r.has(a),l=!s&&!c;return r.add(a),c&&void 0,e.insertBefore(a,n.nextSibling),{node:a,owned:l}}function pt(e,n){n&&M(e),e.parentNode?.removeChild(e)}function Oc(e,n,t){let r=document.createComment("when"),o=null,i,a=!1,s=!1,c=new WeakSet,l=!1,d=()=>{if(s)return;let g=e(),f=r.parentNode;if(!f||a&&Object.is(g,i))return;i=g;let p=o?je([o]):null;o?.parentNode&&(pt(o,l),o=null);let h=g?n:t!==void 0?t:null,b=Z(()=>zr(f,r,h,c,"when"));o=b.node,l=b.owned,Oe(p,o?[o]:[],"when"),a=!0},m=H(d,r);return x(r,()=>{s=!0,m(),o&&pt(o,l),o=null}),a||queueMicrotask(()=>{!s&&!a&&r.parentNode&&d()}),r}function $c(e,n,t){let r=document.createComment("match"),o=null,i,a=!1,s=!1,c=new WeakSet,l=!1,d=()=>{if(s)return;let g=String(e()),f=r.parentNode;if(!f||a&&g===i)return;i=g;let p=o?je([o]):null;o?.parentNode&&(pt(o,l),o=null);let h=Object.hasOwn(n,g)?n[g]:t,b=Z(()=>zr(f,r,h??null,c,"match"));o=b.node,l=b.owned,Oe(p,o?[o]:[],"match"),a=!0},m=H(d,r);return x(r,()=>{s=!0,m(),o&&pt(o,l),o=null}),a||queueMicrotask(()=>{!s&&!a&&r.parentNode&&d()}),r}function Ue(e,n){let t=globalThis;return t[e]??(t[e]=n())}var mt=Ue(Symbol.for("sibujs.components.registry.v1"),()=>new Map),Vr=Ue(Symbol.for("sibujs.components.registryVersion.v1"),()=>C(0));function jr(){let[e,n]=Vr;n(Z(e)+1)}function Hc(e,n){mt.set(e,n),jr()}function Ic(e){mt.delete(e)&&jr()}function Pc(e){let n=mt.get(e);return n?n():A(`[Component "${e}" not found]`)}function Bc(e){let n=A({class:"sibu-dynamic"}),r={};function o(){let a=e(),s;typeof a=="function"?s=a:(Vr[0](),s=mt.get(a));let c=s??`missing:${a}`;if(c===r)return;let l=Z(()=>s?s():A(`[Component "${a}" not found]`));r=c,F(n,l)}let i=W(o);return x(n,i),n}function qr(e){return typeof e=="function"?qr(e()):e instanceof Node?e:document.createTextNode(String(e))}function Fc(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let s=0;s<n;s++){let c=e[s],l=0,d=t.length;for(;l<d;){let m=l+d>>1;e[t[m]]<c?l=m+1:d=m}t[l]=s,r[s]=l>0?t[l-1]:-1}let o=t.length,i=new Array(o),a=t[o-1];for(let s=o-1;s>=0;s--)i[s]=a,a=r[a];return i}function zc(e,n,t){t&&t.key;let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],a=[],s=i,c=0,l=new Map,d=new Map,m=[],g=[],f=[],p=0,h=[],b=[],y=new Uint8Array(0),k=new Map,v=[],E=[],T=new Map,D=!1,I=!1,Re=!1,ao=t.key,ln=()=>{if(Re)return;let Q=e(),N=Q.length,he=r.parentNode;if(!he)return;I||(he.insertBefore(o,r.nextSibling),I=!0),b.length<N&&(b=new Array(N));for(let S=0;S<N;S++)b[S]=ao(Q[S]);let le=b;h.length<N&&(h=new Array(N)),d.clear(),T.clear();for(let S=0;S<N;S++)!1,T.set(le[S],S);p=0;for(let S=0;S<N;S++){let P=le[S],dn=l.get(P),Be;if(dn!==void 0)Be=dn,m[p]=Be,g[p]=Q[S],f[p]=S,p++;else{let[fn,fo]=C(Q[S]),[pn,po]=C(S),bt;try{Se();try{bt=qr(n(fn,pn))}finally{xe()}}catch(mo){let go=le[S];bt=document.createComment(`each:error:${S}`),queueMicrotask(()=>{w(mo,{phase:"render",name:`each row (key="${String(go)}")`,node:r.parentNode?r:void 0})})}Be={node:bt,item:fn,setItem:fo,index:pn,setIndex:po}}d.set(P,Be),h[S]=Be.node}for(let[S,P]of l)d.has(S)||(M(P.node),P.node.parentNode&&he.removeChild(P.node));if(N===0){c=0;let S=l;l=d,d=S,D=!0,p=0;return}k.clear();for(let S=0;S<c;S++)k.set(s[S],S);v.length<N&&(v=new Array(N),E=new Array(N));let Je=0;for(let S=0;S<N;S++){let P=k.get(le[S]);P!==void 0&&(v[Je]=S,E[Je]=P,Je++)}let un=Fc(E,Je);y.length<N?y=new Uint8Array(N):y.fill(0,0,N);for(let S=0;S<un.length;S++)y[v[un[S]]]=1;let Ge=o;for(let S=N-1;S>=0;S--){let P=h[S];y[S]||P.nextSibling!==Ge&&he.insertBefore(P,Ge),Ge=P}let Ye=s===i?a:i;Ye.length<N&&(Ye.length=N);for(let S=0;S<N;S++)Ye[S]=le[S];s=Ye,c=N;let uo=l;l=d,d=uo,D=!0,co()};function co(){if(p===0)return;let Q=p;p=0,z(()=>{for(let N=0;N<Q;N++){let he=m[N];he.setItem(g[N]),he.setIndex(f[N]),m[N]=void 0,g[N]=void 0}})}let lo=W(ln);return x(r,()=>{if(!Re){Re=!0,lo();for(let Q of l.values())M(Q.node),Q.node.parentNode?.removeChild(Q.node);o.parentNode&&o.parentNode.removeChild(o),I=!1,l.clear(),d.clear(),T.clear(),k.clear(),c=0,m.length=0,g.length=0,f.length=0,p=0}}),D||queueMicrotask(()=>{!D&&!Re&&r.parentNode&&ln()}),r}function Vc(e){let n=document.createDocumentFragment();for(let t of e)if(!(t==null||typeof t=="boolean"))if(Array.isArray(t))for(let r of t)r==null||typeof r=="boolean"||Wr(n,r);else Wr(n,t);return n}function Wr(e,n){if(n instanceof Node){e.appendChild(n);return}if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),x(t,se(t,n));return}e.appendChild(document.createTextNode(String(n)))}var jc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ur=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Kr=new WeakMap;function qc(e){let n=e.length-1,t=e[0];for(let f=0;f<n;f++)t+=`\0${f}\0${e[f+1]}`;let r=0,o=t.length;function i(){for(;r<o&&(t[r]===" "||t[r]===" "||t[r]===`
|
|
400
|
+
`||t[r]==="\r");)r++}function a(){if(t.charCodeAt(r)!==0)return-1;let f=r;r++;let p=0;for(;r<o&&t.charCodeAt(r)!==0;)p=p*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,p<0||p>=n?(r=f,-1):p}function s(){let f=r;for(;r<o;){let p=t.charCodeAt(r);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45)r++;else break}return t.slice(f,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let f=a();if(f>=0)return{kind:"expr",idx:f};let p=t[r];if(p==='"'||p==="'"){r++;let h=[],b=[],y="";for(;r<o&&t[r]!==p;){let k=a();k>=0?(h.push(y),y="",b.push(k)):y+=t[r++]}return r<o&&r++,h.push(y),b.length===0?{kind:"static",value:h[0]}:{kind:"mixed",statics:h,exprs:b}}{let h=[],b=[],y="";for(;r<o;){let k=t.charCodeAt(r);if(k===32||k===9||k===10||k===13||k===62)break;let v=a();v>=0?(h.push(y),y="",b.push(v)):y+=t[r++]}return h.push(y),b.length===0?{kind:"static",value:h[0]}:{kind:"mixed",statics:h,exprs:b}}}function l(){let f=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let p=r;for(;r<o;){let y=t.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let h=t.slice(p,r);if(!h)break;let b=c();h.startsWith("on:")?b.kind==="expr"&&f.push({t:3,name:h.slice(3),idx:b.idx}):b.kind==="bool"?f.push({t:4,name:h}):b.kind==="static"?f.push({t:0,name:h,value:b.value}):b.kind==="expr"?f.push({t:1,name:h,idx:b.idx}):b.kind==="mixed"&&f.push({t:2,name:h,statics:b.statics,exprs:b.exprs})}return f}function d(f){return f.replace(/\s+/g," ")}function m(f){let p="";for(;r<o&&t[r]!=="<";){let b=a();if(b>=0){let y=d(p);y&&f.push({t:1,value:y}),p="",f.push({t:2,idx:b})}else p+=t[r++]}let h=d(p);h&&f.push({t:1,value:h})}function g(){let f=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let p=t[r+1];if(p==="!"){if(t.startsWith("<!--",r)){let v=t.indexOf("-->",r+4);r=v===-1?o:v+3}else if(t.startsWith("<![CDATA[",r)){let v=t.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=t.indexOf(">",r);r=v===-1?o:v+1}continue}if(p==="?"){let v=t.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(p>="a"&&p<="z")&&!(p>="A"&&p<="Z")){f.push({t:1,value:"<"}),r++;continue}r++;let h=s(),b=l();i();let y=jc.has(h),k=t[r]==="/";if(k&&r++,r<o&&r++,y||k)f.push({t:0,el:{tag:h,svg:Ur.has(h),attrs:b,children:[]}});else{let v=g();if(Mn(h)){for(let E=0;E<v.length;E++)if(v[E].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${h}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,s(),i(),r<o&&t[r]===">"&&r++),f.push({t:0,el:{tag:h,svg:Ur.has(h),attrs:b,children:v}})}}else m(f);return f}return g()}function rn(e,n){let t=e.svg?document.createElementNS(R,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:Rt(t,o.name,o.value);break;case 1:{let i=o.name,a=n[o.idx];typeof a=="function"?x(t,Ve(t,i,a)):J(t,i,a,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let a=0;a<o.exprs.length;a++){let s=n[o.exprs[a]];i+=(s==null?"":String(s))+o.statics[a+1]}J(t,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):!1;break}case 4:Rt(t,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(rn(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let a=document.createComment("");t.appendChild(a),x(t,se(a,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let a=0;a<i.length;a++){let s=i[a];s instanceof Node?t.appendChild(s):s!=null&&typeof s!="boolean"&&t.appendChild(document.createTextNode(String(s)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function Jr(e,...n){let t=Kr.get(e);return t||(t=qc(e),Kr.set(e,t)),Yr(t,n)}function Gr(e,n){return Yr(e,n)}function Yr(e,n){if(e.length===1&&e[0].t===0)return rn(e[0].el,n);let t=document.createElement("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:t.appendChild(rn(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(i instanceof Node)t.appendChild(i);else if(typeof i=="function"){let a=document.createComment("bind:htm");t.appendChild(a),x(t,se(a,i))}else if(Array.isArray(i))for(let a=0;a<i.length;a++){let s=i[a];s instanceof Node?t.appendChild(s):s!=null&&typeof s!="boolean"&&t.appendChild(document.createTextNode(String(s)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t.childNodes.length===1&&t.firstChild instanceof Element?t.firstChild:t}function Wc(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],a=t?.max??10;a===0&&ee()&&void 0;let s,c=null,l=!1,d=!1,m=()=>{if(d)return;let f=e(),p=r.parentNode;if(!p||l&&f===s)return;c?.parentNode&&p.removeChild(c),s=f;let h=o.get(f);if(h){let b=i.indexOf(f);b!==-1&&(i.splice(b,1),i.push(f))}else{let b=n[f];if(!b){c=null,l=!0;return}if(h=b(),h instanceof DocumentFragment){let y=document.createElement("div");y.style.display="contents",y.appendChild(h),h=y}if(o.set(f,h),i.push(f),a>0&&i.length>a){let y=i.shift(),k=o.get(y);k&&(M(k),k.parentNode&&k.parentNode.removeChild(k),o.delete(y))}}p.insertBefore(h,r.nextSibling),c=h,l=!0},g=W(m);return l||queueMicrotask(()=>{!l&&r.parentNode&&m()}),x(r,()=>{d=!0,g();for(let f of o.values())M(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function Uc(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let t=()=>typeof performance<"u"?performance.now():0,r=t(),o=null,i=d=>{if(d instanceof DocumentFragment){let m=document.createComment(""),g=document.createComment("");d.insertBefore(m,d.firstChild),d.appendChild(g),o={start:m,end:g}}n.appendChild(d)},a;typeof e=="function"?a=Sn(()=>{let d=e();return i(d),d}):(a=e,i(a));let s=t()-r,c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&U(c,"app:init",{rootElement:a,container:n,duration:s});let l=o;return{node:a,unmount(){if(c&&U(c,"app:unmount",{rootElement:a}),l){Kc(l.start,l.end);return}M(a),a.parentNode?.removeChild(a)}}}function Kc(e,n){let t=e.parentNode;if(!t&&!n.parentNode)return;let r=re;for(let s=e.nextSibling;s&&s!==n;s=s.nextSibling)r++;let o=e,i=null,a=!0;for(;;){e.parentNode!==t||n.parentNode!==t?a=!1:(e.previousSibling!==o||n.nextSibling!==i)&&(o=e.previousSibling,i=n.nextSibling,a=!!(e.compareDocumentPosition(n)&4));let s=e.nextSibling;if(!a||s===n)break;if(r--<=0){ue("mount",re,1);return}M(s),s.parentNode===t&&t.removeChild(s)}a||w(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),n.parentNode?.removeChild(n)}function Jc(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{w(a,{phase:"render",name:"Portal",node:t.parentNode?t:void 0})})}}),x(t,()=>{i=!0,o&&(M(o),o.remove(),o=null)}),t}function Gc(e,n="default"){if(e==null||!Object.hasOwn(e,n))return;let t=e[n];return typeof t=="function"?t:void 0}function Zr(e,n,t){return t.length===0?e.splice(n):e.splice(n,...t)}function Yc(e=[]){let[n,t]=C([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let a=[...i];return o=a.pop(),a}),o},shift(){let o;return t(i=>{let a=[...i];return o=a.shift(),a}),o},unshift(...o){t(i=>[...o,...i])},splice(o,...i){let a=[];return t(s=>{let c=[...s];return a=Zr(c,o,i),a.length===0&&i.length<=1?s:c}),a},remove(o){t(i=>i.filter((a,s)=>s!==o))},removeWhere(o){t(i=>{let a=i.findIndex(o);return a===-1?i:i.filter((s,c)=>c!==a)})},set(o){t([...o])},update(o,i){t(a=>a.map((s,c)=>c===o?i:s))},updateWhere(o,i){t(a=>a.map(s=>o(s)?i(s):s))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function Zc(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,Ce(r)||De(r)}function i(){if(Ee(r),t===null){let s=n.slice();t=Object.freeze(s)}return t}return[i,{push(...s){s.length!==0&&(n.push(...s),o())},pop(){if(n.length===0)return;let s=n.pop();return o(),s},shift(){if(n.length===0)return;let s=n.shift();return o(),s},unshift(...s){s.length!==0&&(n.unshift(...s),o())},splice(s,...c){let l=Zr(n,s,c);return(l.length>0||c.length>1)&&o(),l},remove(s){s<0||s>=n.length||(n.splice(s,1),o())},removeWhere(s){let c=n.findIndex(s);c!==-1&&(n.splice(c,1),o())},set(s){n=[...s],o()},update(s,c){s<0||s>=n.length||Object.is(n[s],c)||(n[s]=c,o())},updateWhere(s,c){let l=!1;for(let d=0;d<n.length;d++)if(s(n[d])){let m=c(n[d]);Object.is(n[d],m)||(n[d]=m,l=!0)}l&&o()},sort(s){n.length<=1||(n.sort(s),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(s){let c=n.filter(s);c.length!==n.length&&(n=c,o())},map(s){let c=!1;for(let l=0;l<n.length;l++){let d=s(n[l],l);Object.is(n[l],d)||(n[l]=d,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function Xc(e,n){let[t,r]=C(n),[o,i]=C(!1),[a,s]=C(null),[c,l]=C(0),d=0,m=!1,g=null,f=()=>{if(g===null)return;let h=g;g=null;try{h.abort()}catch{}},p=K(()=>{if(c(),m)return;f();let h=++d,b=typeof AbortController<"u"?new AbortController:null;g=b,z(()=>{i(!0),s(null)});let y=()=>m||h!==d,k;try{k=e({signal:b?b.signal:void 0})}catch(v){if(y())return;z(()=>{s(v),i(!1)});return}k.then(v=>{y()||(g=null,z(()=>{r(v),i(!1)}))},v=>{y()||(g=null,z(()=>{s(v),i(!1)}))})});return{value:t,loading:o,error:a,refresh:()=>{m||l(h=>h+1)},dispose:()=>{m||(m=!0,p(),f())}}}function Pe(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let s=n;return e.source===s.source&&e.flags===s.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let s=n;if(e.size!==s.size)return!1;for(let[c,l]of e)if(!s.has(c)||!Pe(l,s.get(c),t))return!1;return!0}if(e instanceof Set){let s=n;if(e.size!==s.size)return!1;for(let c of e)if(!s.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let s=new Uint8Array(e),c=new Uint8Array(n);if(s.length!==c.length)return!1;for(let l=0;l<s.length;l++)if(s[l]!==c[l])return!1;return!0}if(e instanceof DataView){if(!(n instanceof DataView)||e.byteLength!==n.byteLength)return!1;for(let s=0;s<e.byteLength;s++)if(e.getUint8(s)!==n.getUint8(s))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let s=e,c=n;if(s.length!==c.length)return!1;for(let l=0;l<s.length;l++)if(s[l]!==c[l])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((s,c)=>Pe(s,n[c],t));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),n.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===n.href;if(e instanceof Error){let s=n;return e.name===s.name&&e.message===s.message&&Pe(e.cause,s.cause,t)&&Xr(r,o,t)}let a=Object.getPrototypeOf(r);return a!==Object.prototype&&a!==null?!1:Xr(r,o,t)}function Xr(e,n,t){let r=Object.keys(e),o=Object.keys(n);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(n,i)&&Pe(e[i],n[i],t))}function Qc(e){return C(e,{equals:(n,t)=>Pe(n,t)})}function on(e,n){let t=n?.name,r=n?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,a=!1,s,c=()=>{o._d||a||(o._d=!0)};c._c=1,c._sig=o;let l=()=>{let p=e();o._v=r&&o._init&&r(o._v,p)?o._v:p,o._d=!1,o._init=!0};try{W(()=>{o._v=e(),o._d=!1,o._init=!0},c)}catch(p){throw a=!0,Te(c),p}let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,m=()=>{if(!o._d||a||s!==void 0)return;let p=o._v;i=!0;try{me(l,c),Object.is(p,o._v)||o.__v++}catch(h){s={error:h},o.__v++,a?o._d=!0:o._f=!0}finally{i=!1,a&&Te(c)}d&&!a&&!Object.is(p,o._v)&&U(d,"computed:update",{signal:o,oldValue:p,newValue:o._v})};o._validate=m;let g=()=>{let{error:p}=s;throw s=void 0,a&&(o._d=!1),p};function f(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return er()||a?(o._d&&(m(),s!==void 0&&g()),o._v):(o._d&&(m(),s!==void 0&&(Ee(o),g())),Ee(o),o._v)}return t&&(f.__name=t,o.__name=t),f.__signal=o,f.dispose=()=>{if(a)return;a=!0,o._d=s!==void 0,Te(c);let p=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(p)try{p.emit("computed:destroy",{signal:o,getter:f})}catch{}},d&&U(d,"computed:create",{signal:o,name:t,getter:f}),f}function el(e){let[n,t]=C(e);return{get current(){return n()},set current(r){t(r)}}}function Qr(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function tl(e){e!==null&&typeof e=="object"&&Array.isArray(e);let n=Object.create(null);Object.keys(e).forEach(c=>{let[l,d]=C(e[c]);Qr(n,c,[l,d])});let t=new Proxy({},{get(c,l){if(typeof l=="string"&&Object.hasOwn(n,l)){let d=n[l][0];return d()}return Reflect.get(c,l)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(n).forEach(l=>{Qr(c,l,n[l][0]())}),c};return[t,{setState:c=>{let l=r(),d=typeof c=="function"?c(l):c;z(()=>{Object.entries(d).forEach(([m,g])=>{Object.hasOwn(n,m)&&n[m][1](g)})})},reset:()=>{z(()=>{Object.keys(e).forEach(c=>{let l=n[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return K(()=>{let d=r();if(l){l=!1;return}Se();try{c(d)}finally{xe()}})},subscribeKey:(c,l)=>{let d,m=!0;return K(()=>{let g=n[c][0]();if(m){d=g,m=!1;return}if(!Object.is(g,d)){let f=d;d=g,Se();try{l(g,f)}finally{xe()}}})},getSnapshot:r}]}function nl(e,n){if(X())return()=>{};let t,r=!0;return W(()=>{let a=e();if(r){t=a,r=!1;return}if(!Object.is(a,t)){let s=t;t=a,Se();try{n(a,s)}finally{xe()}}})}function rl(e,n,t){return[on(e,t),i=>{z(()=>n(i))}]}function ol(e){let n=e();return ee()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function il(e){if(!ee())return K(e);let n=K(e),t=null;return queueMicrotask(()=>{try{t=K(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}function eo(e,n){return X()?()=>{}:H(e,n)}var sn="data-sibu-enhanced",an=new WeakMap;function to(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=re){let i=r.length-o+e.length;e.length=0,ue(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var no=["text","attr","class","show","on","cleanup"];function ro(e,n){if(n==null)return e;if(typeof n!="string")return n;let t=n.startsWith("@")?`[data-ref="${n.slice(1)}"]`:n;try{return e.querySelector(t)}catch{return null}}function Ke(e,n){return eo(n,e)}function sl(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,n=>n.value):e.value}function al(e,n){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!n;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(n)?n.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let t=n==null?"":String(n);e.value!==t&&(e.value=t)}function cl(e,n,t,r){let o=`ctx.each[${r}]`;if(ee())for(let i of Object.keys(t))no.includes(i),`${o}${i}${no.join(", ")}`;if(t.text!==void 0&&(t.text,`${o}`,e.text(n,t.text)),t.attr!==void 0)for(let i of Object.keys(t.attr)){let a=t.attr[i];`${o}${i}`,e.attr(n,i,a)}if(t.class!==void 0)for(let i of Object.keys(t.class)){let a=t.class[i];`${o}${i}`,e.classed(n,i,a)}if(t.show!==void 0&&(t.show,`${o}`,e.show(n,t.show)),t.on!==void 0)for(let i of Object.keys(t.on)){let a=t.on[i];`${o}${String(i)}`,e.on(n,i,a)}t.cleanup!==void 0&&(t.cleanup,`${o}`,e.cleanup(t.cleanup))}function gt(e,n){let t=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!t)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(t.getAttribute(sn)==="true")return ee()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,a=!1,s=g=>a?!0:!1,c=(g,f,p)=>{if(s(g))return;let h=ro(t,f);if(!h){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(f)} not found under`,t);return}p(h)},l={root:t,ref:g=>ro(t,g),refs:g=>{let f=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(t.querySelectorAll(f))}catch{return[]}},on:(g,f,p,h)=>{c("on",g,b=>{let y=k=>p(k,b);b.addEventListener(f,y,h),r.push(()=>b.removeEventListener(f,y,h))})},text:(g,f)=>{c("text",g,p=>{r.push(Ke(p,()=>{let h=f(),b=h==null?"":String(h);p.textContent!==b&&(p.textContent=b)}))})},attr:(g,f,p)=>{c("attr",g,h=>{r.push(Ke(h,()=>{let b=p(),y=b==null?null:String(b);J(h,f,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(g,f,p)=>{c("classed",g,h=>{r.push(Ke(h,()=>{h.classList.toggle(f,!!p())}))})},show:(g,f)=>{c("show",g,p=>{let h=p.hidden;r.push(Ke(p,()=>{p.hidden=!f()})),r.push(()=>{p.hidden=h})})},model:(g,f,p)=>{c("model",g,h=>{let b=h,[y,k]=f,v=p?.event??(b instanceof HTMLSelectElement||b instanceof HTMLInputElement&&(b.type==="checkbox"||b.type==="radio")?"change":"input");r.push(Ke(h,()=>{al(b,y())}));let E=()=>k(sl(b));b.addEventListener(v,E),r.push(()=>b.removeEventListener(v,E))})},each:(g,f)=>{if(s("each"))return;let p=typeof g=="string"?l.refs(g):Array.from(g);for(let h=0;h<p.length;h++){let b=p[h],y=f(b,h);y!=null&&cl(l,b,y,h)}},cleanup:g=>{s("cleanup")||r.push(g)}},d;try{d=n(l);let g=d;if(g&&typeof g.then=="function")throw g.then(void 0,f=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(g){throw to(r,"enhance"),a=!0,g}typeof d=="function"&&r.push(d);let m=()=>{i||(i=!0,an.get(t)===o&&(an.delete(t),t.removeAttribute(sn)),Fe(t,m),to(r,"enhance"),a=!0)};return x(t,m),an.set(t,o),t.setAttribute(sn,"true"),m}function ll(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push(gt(r,n))}catch(r){for(let o=t.length-1;o>=0;o--)try{t[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw t.length=0,r}return()=>{for(let r of t.splice(0))r()}}var ul=/^[A-Za-z0-9_-]+$/,oo=Symbol.for("sibujs.islands.lazy"),ht=Ue(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function dl(e){return e[oo]=!0,e}function fl(e,n){if(!ul.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);ht.set(e,n)}function pl(e){ht.delete(e)}async function ml(e){if(typeof e=="function"&&e[oo]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function gl(e=typeof document<"u"?document:null,n={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let t=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let a=i.getAttribute("data-sibu-island")??"";if(!ht.has(a)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${a}" \u2014 skipping. Call registerIsland("${a}", ...).`);continue}let s=!1,c=()=>{if(s||o)return;s=!0;let d=ht.get(a);d&&ml(d).then(m=>{if(!o){if(!m){typeof console<"u"&&console.warn(`[SibuJS islands] "${a}" loader produced no setup.`);return}try{let g=gt(i,m);if(o){g();return}r.push(g),i.setAttribute("data-sibu-hydrated","true")}catch(g){typeof console<"u"&&console.error(`[SibuJS islands] "${a}" failed to mount:`,g)}}}).catch(m=>{typeof console<"u"&&console.error(`[SibuJS islands] "${a}" failed to load:`,m)})},l=i.getAttribute("data-sibu-load")||"load";t.push(hl(l,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function hl(e,n,t,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(t);return()=>cancelIdleCallback(i)}let o=setTimeout(t,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(t),()=>{};let o=new IntersectionObserver(i=>{for(let a of i)a.isIntersecting&&(o.disconnect(),t())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(n),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{a(),t()},a=()=>{for(let s of o)n.removeEventListener(s,i)};for(let s of o)n.addEventListener(s,i,{passive:!0});return a}case"media":{let o=n.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(t),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(t),()=>{};let a=()=>{i.matches&&(i.removeEventListener("change",a),t())};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)}default:return queueMicrotask(t),()=>{}}}function io(e){return e}var Of=1024*1024;function bl(e){let[n,t]=C(e()),r=!1,o=!1,i=n(),a=()=>{r=!1,!o&&t(i)},s=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(a):a()}))},c=W(()=>{i=e(),s()}),l=(()=>n());return l.dispose=()=>{o||(o=!0,c())},l}var so=16;function yl(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:so*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,so)}function vl(){let[e,n]=C(!1),t=0;function r(o){t++,n(!0);let i=!1,a=()=>{i||(i=!0,t--,t===0&&n(!1))},s=c=>{a(),w(c,{phase:"async",name:"transition"})};yl(()=>{try{let c=ft(o());c?c.then(a,s):a()}catch(c){s(c)}})}return{pending:e,start:r}}function Sl(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...cn});})();
|