sibujs 4.12.0 → 4.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +71 -18
- package/dist/browser.js +4 -4
- package/dist/build.cjs +6618 -6178
- package/dist/build.d.cts +554 -415
- package/dist/build.d.ts +554 -415
- package/dist/build.js +2091 -1735
- package/dist/cdn.dev.global.js +12 -12
- package/dist/cdn.full.dev.global.js +13 -13
- package/dist/cdn.full.global.js +12 -12
- package/dist/cdn.global.js +12 -12
- package/dist/{chunk-WFRQ6D7H.js → chunk-22OPSWMF.js} +1 -1
- package/dist/{chunk-ZJCHY2IB.js → chunk-2NC56RGY.js} +1 -1
- package/dist/{chunk-NB7TFSJE.js → chunk-2O6JJCUR.js} +4 -4
- package/dist/{chunk-B2Y5BJSP.js → chunk-4UTGDVSA.js} +70 -16
- package/dist/{chunk-NAVLCP4S.js → chunk-5RIBLY2N.js} +4 -4
- package/dist/{chunk-T5O2CUHV.js → chunk-5XUGJM3J.js} +1 -1
- package/dist/{chunk-HXT2RNH5.js → chunk-ADZHPN2B.js} +1 -1
- package/dist/chunk-B36ADEIR.js +21 -0
- package/dist/{chunk-DFZL3AX7.js → chunk-C73VBPEF.js} +9 -5
- package/dist/{chunk-WH4U2VUE.js → chunk-CPQKWCJ2.js} +13 -5
- package/dist/{chunk-LEUEKK4G.js → chunk-EU7T7EB3.js} +2 -2
- package/dist/{chunk-QLG5IK7F.js → chunk-G3Z2FEBR.js} +4 -4
- package/dist/{chunk-ZPY2UAKM.js → chunk-J4X7ICH4.js} +3 -3
- package/dist/{chunk-XX4BRMWF.js → chunk-K4LNUT5L.js} +1 -1
- package/dist/{chunk-CI4W6XAU.js → chunk-KC62VURU.js} +3 -3
- package/dist/chunk-N5TBYXHW.js +17 -0
- package/dist/{chunk-653KGQS2.js → chunk-OIKD7YDY.js} +2 -2
- package/dist/{chunk-LYTUTXQP.js → chunk-PBJYCE2Z.js} +46 -4
- package/dist/{chunk-EMB5PG7V.js → chunk-QC3NP47A.js} +1 -1
- package/dist/{chunk-IHA62NGJ.js → chunk-QKFVMIAV.js} +1 -1
- package/dist/{chunk-LXBMVGVB.js → chunk-QZ47OZ25.js} +3 -3
- package/dist/{chunk-ZTYCCBU3.js → chunk-VFPLWUT7.js} +44 -26
- package/dist/{chunk-RK7EPQPG.js → chunk-YFTBCCVH.js} +1 -1
- package/dist/data.cjs +71 -18
- package/dist/data.js +5 -5
- package/dist/datePicker-DxuxWpgF.d.cts +285 -0
- package/dist/datePicker-DxuxWpgF.d.ts +285 -0
- package/dist/devtools.cjs +71 -18
- package/dist/devtools.js +4 -4
- package/dist/ecosystem.cjs +82 -21
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +131 -23
- package/dist/extras.d.cts +2 -2
- package/dist/extras.d.ts +2 -2
- package/dist/extras.js +21 -20
- package/dist/index.cjs +115 -37
- package/dist/index.d.cts +59 -5
- package/dist/index.d.ts +59 -5
- package/dist/index.js +10 -10
- package/dist/motion.cjs +69 -16
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +71 -18
- package/dist/patterns.js +5 -5
- package/dist/performance.cjs +69 -16
- package/dist/performance.js +4 -4
- package/dist/plugins.cjs +1421 -996
- package/dist/plugins.d.cts +132 -3
- package/dist/plugins.d.ts +132 -3
- package/dist/plugins.js +262 -11
- package/dist/routeMiddleware-B1sp4P7a.d.ts +688 -0
- package/dist/routeMiddleware-CedQTsLK.d.cts +688 -0
- package/dist/ssr.cjs +3607 -3524
- package/dist/ssr.d.cts +20 -671
- package/dist/ssr.d.ts +20 -671
- package/dist/ssr.js +15 -7
- package/dist/testing.cjs +71 -18
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +78 -18
- package/dist/ui.js +8 -7
- package/dist/widgets.cjs +1352 -952
- package/dist/widgets.d.cts +100 -268
- package/dist/widgets.d.ts +100 -268
- package/dist/widgets.js +316 -7
- package/package.json +9 -1
package/dist/cdn.full.global.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`||e==="\r"||e==="\f"}function
|
|
3
|
-
`||e==="\r"||e==="\f"}function
|
|
1
|
+
"use strict";(()=>{var qo=Object.defineProperty;var It=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var $n=(e,t)=>{for(var n in t)qo(e,n,{get:t[n],enumerable:!0})};var Mn={};$n(Mn,{DynamicComponent:()=>gl,ErrorBoundary:()=>el,ErrorDisplay:()=>En,Fragment:()=>yl,KeepAlive:()=>xl,Loading:()=>rl,MAX_DRAIN_TEARDOWNS:()=>be,Portal:()=>El,SVG_NS:()=>H,Suspense:()=>Ir,__renderParsedTemplate:()=>ko,__resetIdCounter:()=>go,a:()=>Os,abbr:()=>Ps,action:()=>ol,address:()=>hs,area:()=>ia,array:()=>_l,article:()=>ds,aside:()=>bs,asyncDerived:()=>Al,audio:()=>sa,autoResize:()=>fo,b:()=>Ds,base:()=>eu,batch:()=>W,bdi:()=>$s,bdo:()=>Hs,bindDynamic:()=>Rr,blockquote:()=>Ts,body:()=>us,br:()=>Is,button:()=>ut,canvas:()=>Sa,caption:()=>ka,catchError:()=>il,catchErrorAsync:()=>sl,center:()=>Tu,checkLeaks:()=>Wn,circle:()=>ru,cite:()=>Bs,clickOutside:()=>uo,clipPath:()=>mu,code:()=>pn,col:()=>_a,colgroup:()=>Ca,context:()=>ul,copyOnClick:()=>co,createId:()=>mo,customElement:()=>_u,data:()=>Vs,datalist:()=>Da,dd:()=>Es,deepEqual:()=>et,deepSignal:()=>Nl,defer:()=>Gl,defs:()=>pu,del:()=>Ta,derived:()=>ze,details:()=>Ga,dfn:()=>js,dialog:()=>Ja,disableSSR:()=>qr,dispose:()=>V,div:()=>P,dl:()=>ks,dt:()=>_s,each:()=>hl,effect:()=>Q,ellipse:()=>ou,em:()=>Fs,embed:()=>da,enableSSR:()=>Wr,enhance:()=>Ot,enhanceAll:()=>Bl,enqueueBatchedSignal:()=>je,external:()=>qu,fieldset:()=>$a,figcaption:()=>Cs,figure:()=>As,font:()=>Eu,footer:()=>ps,form:()=>Ha,g:()=>iu,getAction:()=>ao,getRequestScopedCache:()=>zr,getRuntimeErrorHandler:()=>Bn,getSSRStore:()=>Ve,getSlot:()=>kl,h1:()=>ys,h2:()=>vs,h3:()=>dn,h4:()=>Ss,h5:()=>xs,h6:()=>ws,head:()=>as,header:()=>fs,hr:()=>Ns,html:()=>Eo,i:()=>zs,iframe:()=>fa,img:()=>aa,input:()=>Ia,ins:()=>Ea,isBatching:()=>Wu,isSSR:()=>de,kbd:()=>Ws,label:()=>Ba,lazy:()=>Hr,lazyIsland:()=>jl,legend:()=>Va,li:()=>Rs,line:()=>su,linearGradient:()=>hu,link:()=>tu,longPress:()=>lo,main:()=>gs,map:()=>ua,mark:()=>qs,marker:()=>wu,marquee:()=>ku,mask:()=>gu,match:()=>dl,math:()=>va,menu:()=>Ya,meta:()=>nu,meter:()=>ja,mount:()=>wl,mountIslands:()=>ql,nav:()=>ms,nextTick:()=>Xl,noscript:()=>xa,object:()=>pa,ol:()=>Ls,on:()=>Hu,onCleanup:()=>Pu,onMount:()=>At,onUnmount:()=>Ou,optgroup:()=>Fa,option:()=>za,output:()=>Wa,p:()=>cn,param:()=>ma,path:()=>au,pattern:()=>bu,picture:()=>ga,polygon:()=>uu,polyline:()=>lu,portal:()=>ba,pre:()=>fn,progress:()=>qa,q:()=>Us,radialGradient:()=>yu,reactiveArray:()=>Cl,rect:()=>cu,ref:()=>Rl,registerAction:()=>Qe,registerComponent:()=>fl,registerDisposer:()=>_,registerIsland:()=>Fl,replaceChildrenSafely:()=>ee,reportDrainRunaway:()=>we,reportError:()=>L,resolveComponent:()=>ml,retrack:()=>_e,rp:()=>Ks,rt:()=>Gs,ruby:()=>Js,runInSSRContext:()=>Ur,s:()=>Ys,samp:()=>Xs,script:()=>wa,section:()=>cs,select:()=>Ua,setGlobalErrorHandler:()=>al,setMaxDrainIterations:()=>Cr,setRuntimeErrorHandler:()=>In,show:()=>ll,signal:()=>C,slot:()=>Za,small:()=>Zs,source:()=>ha,span:()=>z,stop:()=>vu,store:()=>Ll,strict:()=>Pl,strictEffect:()=>Dl,strong:()=>Qs,style:()=>He,sub:()=>ea,summary:()=>Xa,sup:()=>ta,svg:()=>ya,symbol:()=>xu,table:()=>Aa,tagFactory:()=>p,takePendingError:()=>kt,tbody:()=>Na,td:()=>Ra,template:()=>Qa,text:()=>du,textarea:()=>Ka,tfoot:()=>La,th:()=>Ma,thead:()=>Oa,time:()=>na,title:()=>ls,tr:()=>Pa,track:()=>la,transition:()=>Yl,trapFocus:()=>po,trustHTML:()=>Do,tspan:()=>fu,u:()=>ra,ul:()=>Ms,unregisterComponent:()=>pl,unregisterDisposer:()=>ot,unregisterIsland:()=>zl,untracked:()=>ce,use:()=>Su,var_:()=>oa,video:()=>ca,watch:()=>Ml,when:()=>cl,withSSR:()=>Kr,writable:()=>Ol});var Hn=Symbol.for("sibujs.runtime-errors.v1");function Bt(){let e=globalThis,t=e[Hn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Hn]=n,n}function In(e){let t=Bt(),n=t.handler;return t.handler=e,n}function Bn(){return Bt().handler}function Vt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Uo(e)}`;return new Error(t,{cause:e})}function Uo(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 Ko(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Go=Symbol.for("sibujs.reactive.v1");function Jo(e){let t=globalThis[Go];return t?.untracked?t.untracked(e):e()}var Yo="sibu:error-propagate";function Xo(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Zo(n);if(!r)return!1;try{let o=new CustomEvent(Yo,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Zo(e){let n=e;for(;n;){if(n.nodeType===1&&typeof n.dispatchEvent=="function")return n;n=n.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function Qo(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Ko(t)}: ${e.message}`,e)}function L(e,t){let n=Vt(e);Jo(()=>{if(Xo(n,t))return;let r=Bt(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:n,t);return}catch(i){if(typeof console<"u"){let s=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${s}`,i)}}finally{r.handlerDepth--}}Qo(n,t)})}function pe(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var me=new WeakMap,be=1e4;function we(e,t,n){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${t} teardowns with ${n} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:t,remaining:n})}var Ne=0;function pt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var re=[];function Vn(){return pt(re[re.length-1])}function jn(e){return e===null&&re.length===0?!1:(re.push(pt(e)),!0)}function Fn(){re.pop()}function _(e,t){let n=me.get(e);n||(n=[],me.set(e,n)),n.push(t),!1;let r=pt(re[re.length-1]);r&&r.entries.push([e,t])}function zn(e){let t={entries:[],closed:!1},n=t.entries;re.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=be){we("rollback",s,n.length);break}let[a,u]=n.pop();if(ot(a,u)){s++;try{u()}catch(l){L(l,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,re.pop()}throw i}t.closed=!0,re.pop();let o=pt(re[re.length-1]);if(o){for(let i of n)me.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function ot(e,t){let n=me.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),!1,n.length===0&&me.delete(e),!0)}function V(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--)ei(n[r])}function ei(e){if(!me.has(e))return;let t=0,n=!1;for(;!n;){let r=me.get(e);if(!r||r.length===0)break;let o=r.slice();me.delete(e),!1;for(let i=0;i<o.length;i++){if(t>=be){let s=o.slice(i),a=me.get(e);me.set(e,a?s.concat(a):s),!1,we("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){L(s,{phase:"cleanup",name:"disposer"})}}}}function ee(e,...t){for(let r=0;r<t.length;r++){let o=t[r];o.parentNode?.removeChild(o)}let n=Array.from(e.childNodes);for(let r=0;r<n.length;r++)V(n[r]);e.replaceChildren(...t)}function Wn(e=0){return 0}function We(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var ti=/[A-Z]/,ni=/[A-Z]/g;function oe(e){return ti.test(e)?e.replace(ni,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function Te(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}var ri=["http:","https:","mailto:","tel:","ftp:"],oi=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function gt(e){let t=We(e).trim();if(!t)return"";let n=e.replace(oi,"");if(t.length>=2&&(t[0]==="\\"||t[0]==="/")&&(t[1]==="\\"||t[1]==="/")&&(t[0]==="\\"||t[1]==="\\"))return"";let r=t.toLowerCase(),o=-1;for(let s=0;s<r.length;s++){let a=r.charCodeAt(s);if(a===58){o=s;break}if(a===47||a===63||a===35)break}if(o===-1)return n;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&ri.indexOf(i)===-1?"":n}var ii=/^\d+(\.\d+)?[wx]$/;function jt(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function si(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(jt(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!jt(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let l="",c=!1;for(;r<o;){let m=t[r];if(c){l+=m,m===")"&&(c=!1),r++;continue}if(jt(m)){l&&a.push(l),l="",r++;continue}if(m===","){r++;break}m==="("&&(c=!0),l+=m,r++}l&&a.push(l)}if(s===""||a.length>1||a.length===1&&!ii.test(a[0]))continue;let u=gt(s);u&&(u.startsWith(",")||u.endsWith(",")||n.push(a.length===1?`${u} ${a[0]}`:u))}return n.join(", ")}var ai=/[(:@\\]/;function ui(e){return e===" "||e===" "||e===`
|
|
3
|
+
`||e==="\r"||e==="\f"}function qn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function li(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r!=="\\"){t+=r;continue}if(n+1>=e.length)break;let o=e[n+1];if(o===`
|
|
4
4
|
`||o==="\f"){n+=1;continue}if(o==="\r"){n+=e[n+2]===`
|
|
5
|
-
`?2:1;continue}if(
|
|
6
|
-
`?2:1);let a=Number.parseInt(i,16),
|
|
7
|
-
`||e==="\r"||e==="\f"}function gt(e){let t=0,n=e.length;for(;t<n&&Re(e[t]);)t++;for(;n>t&&Re(e[n-1]);)n--;return e.slice(t,n)}var oe=e=>({kind:"forbidden",reason:e});function fi(e){let t=gt(ze(e));if(t==="")return oe("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return oe("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return oe("");for(;n<t.length&&Re(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return oe("");for(n++;n<t.length&&Re(t[n]);)n++;let o=n;for(;n<t.length&&!Re(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return oe("");for(;n<t.length&&Re(t[n]);)n++;if(t[n]!=="=")return oe("");for(n++;n<t.length&&Re(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let c=t.indexOf(a,n+1);if(c===-1)return oe("");if(s=t.slice(n+1,c),gt(t.slice(c+1))!=="")return oe("")}else if(s=gt(t.slice(n)),/[;,]/.test(s))return oe("");if(s==="")return oe("");let l=ft(s);return l===""?oe(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function zt(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=re(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?oe(""):typeof t!="string"?{kind:"not-refresh"}:gt(ze(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:fi(n)}var pi="http://www.w3.org/1999/xhtml",mi="http://www.w3.org/2000/svg",gi=new Set(["script","iframe","object","embed","frame","frameset"]);function Yn(e){return re(e)}function Xn(e){return gi.has(Yn(e))}var bi=new Set(["script","style"]);function Zn(e){return bi.has(Yn(e))}var I={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},hi=new Set(["src","href","xlink:href","type","language"]),yi=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Wt=new WeakSet;function Qn(e){return e.namespaceURI===pi||e.namespaceURI===null}function er(e,t,n){let r=new Map,o=e.attributes;for(let i=0;i<o.length;i++){let s=o[i];s.name!==t&&r.set(s.name,s.value)}return t!==null&&n!==null&&r.set(t,n),r}function vi(e){Wt.has(e)||(Wt.add(e),e.getAttribute("content")!==null&&zt(er(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function Si(e,t,n,r){if(!Qn(e))return I.None;let o=re(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&vi(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return I.None;let i=zt(er(e,o,n));return i.kind==="forbidden"?I.MetaRefreshForbidden:i.kind!=="not-refresh"&&Wt.has(e)?I.MetaRefreshReactive:I.None}function xi(e,t){if(t===null||re(e)!=="attributename")return I.None;let n=ze(t);return Kn(n)||Ee(n)||nt(n)?I.AnimationTarget:I.None}var bt=new WeakSet;function Jn(e){if(e===null)return!1;let t=re(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function wi(e,t,n,r){if(!Qn(e))return I.None;let o=re(t);return o==="href"?r==="static"||n===null?I.None:Jn(e.getAttribute("rel"))?I.StylesheetSource:(bt.add(e),I.None):o==="rel"&&Jn(n)&&bt.has(e)&&e.hasAttribute("href")?I.StylesheetSource:I.None}function qt(e,t,n,r){let o=e.localName;return o==="meta"?Si(e,t,n,r):o==="link"?wi(e,t,n,r):o==="script"?r==="static"||n===null?I.None:hi.has(re(t))?I.ScriptSource:I.None:yi.has(o)&&e.namespaceURI===mi?xi(t,n):I.None}function Ut(e,t,n){e.localName!=="link"||re(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?bt.add(e):bt.delete(e))}var Ti="http://www.w3.org/1999/xhtml",Ei="http://www.w3.org/2000/svg",ki="http://www.w3.org/1999/xlink",Ci="http://www.w3.org/XML/1998/namespace",Ai=new Set(["checked","disabled","selected"]);function _i(e){return e.namespaceURI===null||e.namespaceURI===Ti}function nr(e,t,n){}function tr(e,t,n){e[t]=n}function Ni(e,t){if(e.namespaceURI!==Ei)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?ki:n.startsWith("xml:")?Ci:null}function le(e,t,n,r={}){let o=Ri(e,t,n,r);return e.localName==="link"&&Ut(e,t,r.reactive?"reactive":"runtime"),o}function Ri(e,t,n,r){let o=Ni(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(Ee(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=qt(e,t,s,r.reactive?"reactive":"runtime");if(a!==I.None)return nr(r.label??"setSafeAttribute",t,a),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;if(n==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0;if(nt(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let l=_i(e),c=l?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let m=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==m&&(o?e.setAttributeNS(o,t,m):e.setAttribute(t,m)),!0}return l&&Ai.has(c)&&c in e?tr(e,c,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let d=String(n);if(r.syncValueProperty!==!1&&l&&(c==="value"||c==="checked")&&c in e)return tr(e,c,c==="checked"?!!n:d),!0;let g=d===""?"":Gn(t,d,{element:e});return g===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===g||(o?e.setAttributeNS(o,t,g):e.setAttribute(t,g)),!0)}function Kt(e,t,n){if(nt(t))return!1,!1;let r=qt(e,t,n,"static");return r!==I.None?(nr("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Ut(e,t,"static"),!0)}var Li=4096,Gt=[];function Mi(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Oi(e,t,n){let r=Gt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Mi();return o.sig=e,o.sub=t,o.epoch=n,o}function rr(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Gt.length<Li&&Gt.push(e)}function Pi(e,t){let n=e.subsHead??null;t.sigPrev=null,t.sigNext=n,n?n.sigPrev=t:e.subsTail=t,e.subsHead=t,e.__sc=(e.__sc??0)+1}function or(e){let t=e.sig;if(!t)return;let n=e.sigPrev,r=e.sigNext;n?n.sigNext=r:t.subsHead=r,r?r.sigPrev=n:t.subsTail=n,t.__sc=(t.__sc??1)-1,t.__activeNode===e&&(t.__activeNode=e.prevActive),t.__sc===0&&(t.subsHead=null,t.subsTail=null)}function Di(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function $i(e){let t=e.sub;if(!t)return;let n=e.subPrev,r=e.subNext;n?n.subNext=r:t.depsHead=r,r?r.subPrev=n:t.depsTail=n}var ue=null,ye=null,ke=0,Ce=[],ce=new Set,Hi=[];function Ii(e){try{e()}catch(t){let n=e;R(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Bi(e){let t=e.depsHead??null;if(t===null)return!0;for(;t!==null;){let n=t.sig;if(n===null)return!0;if(n._d===!0&&n._validate!==void 0)try{n._validate()}catch{return!0}if(t.depVersion!==n.__v)return!0;t=t.subNext}return!1}var be=0,ve=!1;function Yt(){be===0&&(ye=ue,ue=null,ve=!0),be++}function Xt(){be--,be===0&&(ue=ye,ye=null,ve=!1)}function ir(){return ve}function sr(e){Yt();try{return e()}finally{Xt()}}var ie=null;function Zt(){return ie}function St(e,t){let n=ie;ie=e;try{return t()}finally{ie=n}}function Qt(e){let t=ie;return t===null?e:(...n)=>St(t,()=>e(...n))}var Vi=0;function en(e,t){let n=ue,r=0,o=null;ve&&(r=be,o=ye,be=0,ye=null,ve=!1),ue=t;let i=t;i._cap===void 0&&(i._cap=Hn());let s=ie;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(ie=a);let l=++Vi;i._epoch=l,i._structDirty=!1;for(let c=i.depsHead??null;c!==null;c=c.subNext){let d=c.sig;c.prevActive=d.__activeNode??null,d.__activeNode=c}try{e()}finally{ue=n,ie=s,r!==0&&(be=r,ye=o,ve=!0);let c=i.depsHead??null;for(;c!==null;){let d=c.subNext,g=c.sig;g.__activeNode=c.prevActive,c.prevActive=null,c.epoch!==l&&($i(c),or(c),rr(c)),c=d}}}function ar(e,t){if(!t)return tn(e);We(t);let n=ue,r=0,o=null;ve&&(r=be,o=ye,be=0,ye=null,ve=!1),ue=t;let i=t;i._scope===void 0&&(i._scope=ie);let s=ie;ie=i._scope;try{e()}finally{ue=n,ie=s,r!==0&&(be=r,ye=o,ve=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let l=a.sig;l.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>We(t))}function tn(e,t){let n=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{en(e,r)}finally{o._reentrant=!1}}},r=n;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=t;try{n()}catch(o){throw r._disposed=!0,r._errorNode=void 0,We(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,We(r)})}function lr(e){if(!ue)return;let t=ue,n=e,r=t._epoch??0,o=n.__activeNode??null;if(o!==null&&o.sub===t){o.epoch=r,o.depVersion=n.__v??Number.NaN;return}n._validate!==void 0&&(t._hasComputedDep=!0);let i=Oi(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,Di(t,i),Pi(n,i),t._structDirty=!0}function We(e){let t=e,n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;or(n),rr(n),n=r}}var ht=1e3,yt=1e6,vt=0,Le=new Set;function cr(e){let t=ht;return Number.isFinite(e)&&e>0&&(ht=Math.floor(e)),t}function ur(e){let t=yt;return Number.isFinite(e)&&e>0&&(yt=Math.floor(e)),t}function ji(e){let t=e;return t._runEpoch!==vt?(t._runEpoch=vt,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>ht)}function Fi(e){let t=e.__name??"<unnamed>";R(new Error(`subscriber "${t}" fired more than ${ht} 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:t})}function zi(){R(new Error(`Notification drain exceeded ${yt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function dr(){let e=0;for(;e<Ce.length;){if(e>=yt){zi();break}let t=Ce[e++];if(ce.delete(t),Le.size>0&&Le.has(t)||t._hasComputedDep===!0&&!Bi(t))continue;if(ji(t)){Fi(t),Le.add(t);continue}let n=In(t._cap??null);try{Ii(t)}finally{n&&Bn()}}}function fr(){if(!(ke>0)){ke++,vt++;try{dr()}finally{ke--,ke===0&&(Ce.length=0,ce.clear(),Le.size>0&&Le.clear())}}}function Jt(e){e();let t=e._sig;if(!t)return;let n=Hi,r=n.length;for(n.push(t);n.length>r;){let i=n.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,n.push(a)):s()}else ce.has(s)||(ce.add(s),Ce.push(s));i=i.sigNext}}}function pr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Jt(r):ce.has(r)||(ce.add(r),Ce.push(r))),n=n.sigNext}}function mr(e){let n=e.subsHead;if(n){if(ke>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Jt(o):ce.has(o)||(ce.add(o),Ce.push(o))),r=r.sigNext}return}ke++,vt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Jt(o):ce.has(o)||(ce.add(o),Ce.push(o))),r=r.sigNext}dr()}finally{ke--,ke===0&&(Ce.length=0,ce.clear(),Le.size>0&&Le.clear())}}}function gr(e){return e.__sc??0}function br(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function hr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var yr="4.12.0",vr=Symbol.for("sibujs.reactive.v1");function qi(){let e=globalThis,t=e[vr];if(t)return!1,t;let n={suspendTracking:Yt,resumeTracking:Xt,isTrackingSuspended:ir,untracked:sr,retrack:en,track:ar,reactiveBinding:tn,recordDependency:lr,cleanup:We,setMaxSubscriberRepeats:cr,setMaxDrainIterations:ur,drainNotificationQueue:fr,queueSignalNotification:pr,notifySubscribers:mr,getSubscriberCount:gr,getSubscriberDeps:br,forEachSubscriber:hr,getOwnerScope:Zt,runWithOwnerScope:St,bindOwnerScope:Qt,version:yr};return e[vr]=n,n}var j=qi(),Me=j.suspendTracking,Oe=j.resumeTracking,Sr=j.isTrackingSuspended,de=j.untracked,Ae=j.retrack,se=j.track,G=j.reactiveBinding,Pe=j.recordDependency,De=j.cleanup,Cu=j.setMaxSubscriberRepeats,xr=j.setMaxDrainIterations,wr=j.drainNotificationQueue,Tr=j.queueSignalNotification,qe=j.notifySubscribers,Au=j.getSubscriberCount,_u=j.getSubscriberDeps,Nu=j.forEachSubscriber,Ue=j.getOwnerScope??Zt,xt=j.runWithOwnerScope??St,Y=j.bindOwnerScope??Qt;function rt(e,t,n){if(Ee(t))return le(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){R(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}le(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return G(r,e)}function Er(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){R(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){R(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),le(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=G(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var nn=["data-focus-key","id","name"],Ui=new Set(["text","search","url","tel","password",""]);function Ki(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Ui.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 ot(e){if(e.length===0||typeof document>"u")return null;let t=document.activeElement;if(!t||t===document.body)return null;let n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===t||s.nodeType===1&&s.contains(t)){n=!0;break}}if(!n)return null;let r=null,o=null;for(let i=0;i<nn.length;i++){let s=t.getAttribute(nn[i]);if(s){r=nn[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Ki(t)}}function Gi(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ji(e,t){let n=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(t)&&(r++,n??(n=s));let a=s.querySelectorAll(t);for(let l=0;l<a.length;l++)r++,n??(n=a[l]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function kr(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function Ke(e,t,n){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){kr(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=Ji(t,`[${e.attr}=${Gi(e.value)}]`);if(i&&i.tagName===e.tag){kr(i,e);return}o=s>1}}function Se(e,t){let n=[];function r(){let o;try{o=t()}catch(d){R(d,{phase:"binding",name:"bindChildNode",node:e});return}let i=ot(n);if(o==null||typeof o=="boolean"){for(let d=0;d<n.length;d++){let g=n[d];V(g),g.parentNode&&g.parentNode.removeChild(g)}n.length=0,Ke(i,n,"bindChildNode");return}let s=e.parentNode;if(!s){n.length=0;return}let a;if(Array.isArray(o)){a=[];let d=new Set;for(let g=0;g<o.length;g++){let h=o[g];if(h==null||typeof h=="boolean")continue;let m=h instanceof Node?h:document.createTextNode(String(h));if(d.has(m)){!1;continue}d.add(m),a.push(m)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let l;if(n.length>0&&a.length>0){let d=new Set(n);l=new Set;for(let g=0;g<a.length;g++)d.has(a[g])&&l.add(a[g])}for(let d=0;d<n.length;d++){let g=n[d];l?.has(g)||(V(g),g.parentNode&&g.parentNode.removeChild(g))}let c=e;for(let d=0;d<a.length;d++){let g=a[d];c.nextSibling!==g&&s.insertBefore(g,c.nextSibling),c=g}n=a,Ke(i,a,"bindChildNode")}return G(r,e)}function rn(){throw new Error("[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first.")}function ee(){typeof document>"u"&&rn()}var H="http://www.w3.org/2000/svg",Yi=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var on=new Set,Cr=100,Ar=!1,_r=new Map;function Nr(e){let t=_r.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),_r.set(e,t)),t}function Xi(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=G(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",mt(String(a),{element:e}));return}let l=e.style;i&&(e.removeAttribute("style"),i=!1);let c=[];for(let d in a){if(!Object.hasOwn(a,d))continue;let g=a[d];if(g==null)continue;let h=Nr(d);c.push(h),l.setProperty(h,pt(h,String(g),{element:e}))}for(let d=0;d<o.length;d++)c.indexOf(o[d])===-1&&l.removeProperty(o[d]);o=c},e);A(e,s);return}if(typeof t=="string"){e.setAttribute("style",mt(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Nr(r);if(typeof o=="function"){let s=o,a=G(()=>{n.style.setProperty(i,pt(i,String(s()),{element:e}))},e);A(e,a)}else n.style.setProperty(i,pt(i,String(o),{element:e}))}}function Zi(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=G(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);A(e,i);return}let n=t,r=!1,o="";for(let i in n){if(!Object.hasOwn(n,i))continue;let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=G(()=>{let a="";for(let l in n){if(!Object.hasOwn(n,l))continue;let c=n[l];(typeof c=="function"?c():c)&&(a=a?`${a} ${l}`:l)}e.setAttribute("class",a)},e);A(e,s)}else e.setAttribute("class",o)}function sn(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),A(e,Se(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),A(e,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 s=document.createComment("");e.appendChild(s),A(e,Se(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function p(e,t){let n=Xn(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&rn();let i=t?document.createElementNS(t,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),sn(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 sn(i,r),i;let s=r,a=s.class;a!=null&&Zi(i,a);let l=s.id;typeof l=="function"?A(i,rt(i,"id",l)):l!=null&&(!1,i.id=l);let c=o!==void 0?o:s.nodes;c!=null&&sn(i,c);let d=s.on;if(d)for(let m in d){if(!Object.hasOwn(d,m))continue;let u=d[m];typeof u=="function"?i.addEventListener(m,u):!1}let g=s.style;g!=null&&Xi(i,g);let h=s.ref;h&&(h.current=i);for(let m in s)switch(m){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,m))continue;let u=s[m];if(u==null||Ee(m))continue;typeof u=="function"?A(i,rt(i,m,u)):le(i,m,u,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var Qu=p("html"),Qi=p("head"),es=p("body"),ts=p("title"),O=p("div"),F=p("span"),ns=p("section"),rs=p("article"),os=p("header"),is=p("footer"),ss=p("nav"),as=p("main"),ls=p("aside"),cs=p("address"),an=p("p"),us=p("h1"),ds=p("h2"),ln=p("h3"),fs=p("h4"),ps=p("h5"),ms=p("h6"),gs=p("blockquote"),bs=p("dd"),hs=p("dl"),ys=p("dt"),vs=p("figcaption"),Ss=p("figure"),xs=p("hr"),ws=p("li"),Ts=p("ol"),Es=p("ul"),cn=p("pre"),ks=p("a"),Cs=p("abbr"),As=p("b"),_s=p("bdi"),Ns=p("bdo"),Rs=p("br"),Ls=p("cite"),un=p("code"),Ms=p("data"),Os=p("dfn"),Ps=p("em"),Ds=p("i"),$s=p("kbd"),Hs=p("mark"),Is=p("q"),Bs=p("rp"),Vs=p("rt"),js=p("ruby"),Fs=p("s"),zs=p("samp"),Ws=p("small"),qs=p("strong"),Us=p("sub"),Ks=p("sup"),Gs=p("time"),Js=p("u"),Ys=p("var"),Xs=p("area"),Zs=p("audio"),Qs=p("img"),ea=p("map"),ta=p("track"),na=p("video"),ra=p("embed"),oa=p("iframe"),ia=p("object"),sa=p("param"),aa=p("picture"),la=p("portal"),ca=p("source"),ua=p("svg",H),da=p("math"),fa=p("canvas"),pa=p("noscript"),ma=p("script"),ga=p("del"),ba=p("ins"),ha=p("caption"),ya=p("col"),va=p("colgroup"),Sa=p("table"),xa=p("tbody"),wa=p("td"),Ta=p("tfoot"),Ea=p("th"),ka=p("thead"),Ca=p("tr"),it=p("button"),Aa=p("datalist"),_a=p("fieldset"),Na=p("form"),Ra=p("input"),La=p("label"),Ma=p("legend"),Oa=p("meter"),Pa=p("optgroup"),Da=p("option"),$a=p("output"),Ha=p("progress"),Ia=p("select"),Ba=p("textarea"),Va=p("details"),ja=p("dialog"),Fa=p("menu"),za=p("summary"),Wa=p("slot"),qa=p("template"),Ua=p("base"),Ka=p("link"),Ga=p("meta"),$e=p("style"),Ja=p("circle",H),Ya=p("ellipse",H),Xa=p("g",H),Za=p("line",H),Qa=p("path",H),el=p("polygon",H),tl=p("polyline",H),nl=p("rect",H),rl=p("text",H),ol=p("tspan",H),il=p("defs",H),sl=p("clipPath",H),al=p("mask",H),ll=p("pattern",H),cl=p("linearGradient",H),ul=p("radialGradient",H),dl=p("stop",H),fl=p("use",H),pl=p("symbol",H),ml=p("marker",H),gl=p("center"),bl=p("font"),hl=p("marquee"),yl=e=>p(e);var dn="__sibuPendingError";function Rr(e,t){let n=()=>e.parentNode?(R(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[dn]=t)})}function wt(e){let t=e,n=t[dn];if(n instanceof Error)return delete t[dn],n}function Lr(e){let t=null;return function(){if(t)return t();let r=O({class:"sibu-lazy"}),o=!1;return e().then(Y(i=>{if(o)return;t=i.default;let s=t();Q(r,s)})).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));Q(r,O({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Rr(r,s)}),r.appendChild(F("sibu-lazy-loading","Loading...")),A(r,()=>{o=!0}),r}}function Mr({nodes:e,fallback:t}){let n=O({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null,s=null;A(n,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!n.contains(s)&&V(s)});let a=Y(()=>{if(!o)try{let l=e();if(s=l,l.classList.contains("sibu-lazy")){if(!l.querySelector(".sibu-lazy-loading")){Q(n,l);return}i=new MutationObserver(()=>{if(o)return;l.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,Q(n,l))}),i.observe(l,{childList:!0,subtree:!0})}else Q(n,l)}catch(l){let c=l instanceof Error?l:new Error(String(l));Rr(n,c)}});return queueMicrotask(a),n}function gn(e,t){return()=>Ue()===e?t():xt(e,t)}function Et(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";R(n,{phase:r,name:t});return}}function fn(e,t,n,r,o){let i=Et(e,t);if(typeof i!="function")return;let s=gn(o,i);r()||!n.isConnected?Et(s,"onUnmount"):Pr(s,n)}var Ge=new WeakMap,He=new WeakMap,xe=new Set,we=new Set,Je=null,Tt=0,vl=256;function pn(e){let t=Ge.get(e);if(t){Ge.delete(e),xe.delete(e);for(let n of t)try{n()}catch{}}}function mn(e){He.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=He.get(e);if(n){He.delete(e),we.delete(e);for(let r of n)try{r()}catch{}}})}function Sl(e){if(xe.size===0||e.nodeType!==1)return;let t=e;if(xe.has(t)&&t.isConnected&&pn(t),t.firstElementChild)for(let n of Array.from(xe))n!==t&&n.isConnected&&t.contains(n)&&pn(n)}function xl(e){if(we.size===0||e.nodeType!==1)return;let t=e;if(we.has(t)&&!t.isConnected&&mn(t),t.firstElementChild)for(let n of Array.from(we))n!==t&&!n.isConnected&&t.contains(n)&&mn(n)}function wl(){if(xe.size>0)for(let e of Array.from(xe))e.isConnected&&pn(e);if(we.size>0)for(let e of Array.from(we))e.isConnected||mn(e)}function Or(){Je||typeof document>"u"||(Je=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)Sl(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)xl(t.removedNodes[n])}Tt+=e.length,Tt>=vl&&(Tt=0,wl()),bn()}),Je.observe(document.body,{childList:!0,subtree:!0}))}function bn(){Je&&xe.size===0&&we.size===0&&(Je.disconnect(),Je=null,Tt=0)}function Tl(e,t){let n=Ge.get(e);return n||(n=[],Ge.set(e,n)),n.push(t),xe.add(e),Or(),()=>{let r=Ge.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ge.delete(e),xe.delete(e))}bn()}}function El(e,t){let n=He.get(e);return n||(n=[],He.set(e,n)),n.push(t),we.add(e),Or(),()=>{let r=He.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(He.delete(e),we.delete(e))}bn()}}function kt(e,t){if(typeof document>"u")return;let n=Ue();if(e=gn(n,e),t){let r=!1,o=()=>r;if(A(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||fn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){fn(e,"onMount",t,o,n);return}let i=Tl(t,()=>{r||fn(e,"onMount",t,o,n)});A(t,i)})}else queueMicrotask(()=>{Et(e,"onMount")})}function kl(e,t){typeof document>"u"||Pr(gn(Ue(),e),t)}function Pr(e,t){let n=!1,r=()=>{n||(n=!0,Et(e,"onUnmount"))};A(t,r);let o=()=>{if(n)return;let i=El(t,r);A(t,i)};t.isConnected?o():kt(()=>{o()},t)}function Cl(e,t){A(t,e)}function ae(e,t,n){try{e.emit(t,n)}catch{}}var hn=Symbol.for("sibujs.ssr.v1");function Al(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let t=null,n=process.getBuiltinModule;typeof n=="function"?t=n("node:async_hooks"):typeof Dt=="function"&&(t=Dt("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var _e=globalThis[hn]??(globalThis[hn]=Al()),Ie=_e.als,X=_e.fallbackStore;_e.fallbackDepth??(_e.fallbackDepth=0);var Dr=!1;function _l(){if(Dr||Ie||!(typeof process<"u"&&!!process.versions?.node))return;Dr=!0;let t=process.versions.node;`${t}`}function Be(){if(Ie){let e=Ie.getStore();if(e)return e}return X}function $r(){return Ie?Ie.getStore()??null:_e.fallbackDepth>0?X:null}function fe(){return Be().ssr}function Hr(e){if(!fe())return null;let t=Be(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function Ir(){Be().ssr=!0}function Br(){Be().ssr=!1}function Vr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Ie)return Ie.run(t,e);_l();let n=X.ssr,r=X.suspenseIdCounter,o=X.idCounter,i=X.locale;X.ssr=!0,X.suspenseIdCounter=0,X.idCounter=0,X.locale=void 0,_e.fallbackDepth++;try{return e()}finally{_e.fallbackDepth--,X.ssr=n,X.suspenseIdCounter=r,X.idCounter=o,X.locale=i}}function jr(e){let t=Be(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var qr=globalThis;function Nl(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,de(()=>t(o,void 0));else{let i=n;n=o,de(()=>t(o,i))}}}var Fr=100;function Ct(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===Ue()?zr(t):xt(n,()=>zr(t))}function zr(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){R(n,{phase:"cleanup"})}}function Wr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&Ct(e),Ae(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Fr);e.rerunPending&&(e.rerunPending=!1,R(new Error(`effect re-requested itself ${Fr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Rl(e){if(e.disposed)return;e.disposed=!0;let t=qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Ct(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{De(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function Z(e,t){if(fe())return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=s=>{n.userCleanups.push(s)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(s){r(s)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&Ct(n),Ae(n.bodyFn,o),n.rerunPending&&Wr(n)}finally{n.running=!1,n.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,n.subscriber=o,n.running=!0;try{Ae(n.bodyFn,n.subscriber),n.rerunPending&&Wr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&Ct(n),De(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&ae(i,"effect:create",{effectFn:e}),()=>Rl(n)}var st=0,yn=new Set;function Ll(e){st++;try{return e()}finally{st--,st===0&&Pl()}}function Ml(e){return st===0?!1:(yn.add(e),!0)}function Ol(){return st>0}function Pl(){try{for(let e of yn)Tr(e)}finally{yn.clear()}wr()}var Ur=Symbol.for("sibujs.reactive.batch.v1");function Dl(){let e=globalThis,t=e[Ur];if(t)return t;let n={batch:Ll,enqueueBatchedSignal:Ml,isBatching:Ol};return e[Ur]=n,n}var vn=Dl(),z=vn.batch,Ve=vn.enqueueBatchedSignal,$l=vn.isBatching;var Sn=globalThis;function _(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=t?.equals;r&&(n.__name=r);function i(){return Pe(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let l=n.value,c=typeof a=="function"?a(l):a;if(!o(l,c)){if(n.value=c,n.__v++,!1){let d=Sn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&ae(d,"signal:update",{signal:n,name:r,oldValue:l,newValue:c})}Ve(n)||qe(n)}}:s=a=>{let l=n.value,c=typeof a=="function"?a(l):a;Object.is(c,l)||(n.value=c,n.__v++,Ve(n)||qe(n))},!1){let a=Sn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&ae(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function Hl(e){let[t,n]=_(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Il=`
|
|
5
|
+
`?2:1;continue}if(qn(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&qn(e[s]);)i+=e[s],s++;s<e.length&&ui(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
|
|
6
|
+
`?2:1);let a=Number.parseInt(i,16),u=a===0||a>1114111||a>=55296&&a<=57343;t+=u?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var Un=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],ci=4,di=5,fi=8;function pi(e){if(!e)return"an element";let t=e.tagName.toLowerCase(),n=e.getAttribute("id");n&&(t+=`#${n}`);let r=e.getAttribute("class");return r&&(t+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${t}>`}var Ft=new Set,Kn=100,Gn=!1;function mt(e,t,n){}function Jn(e){return(e.includes("\\")?li(e):e).toLowerCase().replace(/\s+/g,"")}function zt(e){if(!ai.test(e))return-1;let t=Jn(e);for(let n=0;n<Un.length;n++)if(t.includes(Un[n]))return n;return-1}function bt(e,t,n){let r=Wt(e,t);return r===-1?t:(mt(t,r,{property:e,element:n?.element}),"")}function Wt(e,t){let n=zt(t);if(n!==-1)return n;let r=oe(e);return r==="behavior"?di:r==="-moz-binding"?ci:(r==="filter"||r==="-ms-filter")&&Jn(t).includes("progid:")?fi:-1}function mi(e){let t=[],n="",r=0,o="";for(let s=0;s<e.length;s++){let a=e[s];if(o){n+=a,a==="\\"&&s+1<e.length?n+=e[++s]:a===o&&(o="");continue}if(a==="\\"){n+=a,s+1<e.length&&(n+=e[++s]);continue}if(a==="/"&&e[s+1]==="*"){let u=e.indexOf("*/",s+2);if(u===-1)return null;s=u+1;continue}if(a==='"'||a==="'")o=a;else if(a==="("||a==="[")r++;else if(a===")"||a==="]"){if(--r<0)return null}else{if(a==="{"||a==="}")return null;if(a===";"&&r===0){t.push(n),n="";continue}}n+=a}if(o||r!==0)return null;t.push(n);let i=[];for(let s of t){let a=s.indexOf(":");if(a===-1)continue;let u=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(u))continue;let l=s.slice(a+1).trim(),c=/!\s*important\s*$/i.exec(l);if(c&&(l=l.slice(0,c.index).trim()),l==="")continue;let m=u.startsWith("--")?u:oe(u);i.push([m,l,c!==null])}return i}function gi(e,t){let n=String(e),r=mi(n);if(r===null)return zt(n)!==-1&&mt(n,zt(n),t),"";let o=[];for(let[i,s,a]of r){let u=Wt(i,s);if(u!==-1){mt(s,u,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function ht(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return gi(n,t);let r=document.createElement("div");try{r.style.cssText=n}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),u=Wt(s,a);if(u!==-1){mt(a,u,{property:s,element:t?.element});continue}let l=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${l?` !${l}`:""}`)}return o.join("; ")}var qt=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),bi=new Set(["srcdoc"]);function it(e){return bi.has(e.toLowerCase())}function Yn(e){return qt.has(e.toLowerCase())}function hi(e){let t=e.toLowerCase();return t==="style"||qt.has(t)}function yi(e,t,n){let r=e.toLowerCase();return r==="srcset"?si(t):qt.has(r)?gt(t):r==="style"?ht(t,n):t}function Xn(e,t,n){if(!hi(e))return t;let r=yi(e,t,n);return r===""?null:r}function Re(e){return e===" "||e===" "||e===`
|
|
7
|
+
`||e==="\r"||e==="\f"}function yt(e){let t=0,n=e.length;for(;t<n&&Re(e[t]);)t++;for(;n>t&&Re(e[n-1]);)n--;return e.slice(t,n)}var ie=e=>({kind:"forbidden",reason:e});function vi(e){let t=yt(We(e));if(t==="")return ie("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return ie("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return ie("");for(;n<t.length&&Re(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return ie("");for(n++;n<t.length&&Re(t[n]);)n++;let o=n;for(;n<t.length&&!Re(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return ie("");for(;n<t.length&&Re(t[n]);)n++;if(t[n]!=="=")return ie("");for(n++;n<t.length&&Re(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let l=t.indexOf(a,n+1);if(l===-1)return ie("");if(s=t.slice(n+1,l),yt(t.slice(l+1))!=="")return ie("")}else if(s=yt(t.slice(n)),/[;,]/.test(s))return ie("");if(s==="")return ie("");let u=gt(s);return u===""?ie(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:u}}function Ut(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=oe(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?ie(""):typeof t!="string"?{kind:"not-refresh"}:yt(We(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:vi(n)}var Si="http://www.w3.org/1999/xhtml",xi="http://www.w3.org/2000/svg",wi=new Set(["script","iframe","object","embed","frame","frameset"]);function Qn(e){return oe(e)}function er(e){return wi.has(Qn(e))}var Ti=new Set(["script","style"]);function tr(e){return Ti.has(Qn(e))}var I={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Ei=new Set(["src","href","xlink:href","type","language"]),ki=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Kt=new WeakSet;function nr(e){return e.namespaceURI===Si||e.namespaceURI===null}function rr(e,t,n){let r=new Map,o=e.attributes;for(let i=0;i<o.length;i++){let s=o[i];s.name!==t&&r.set(s.name,s.value)}return t!==null&&n!==null&&r.set(t,n),r}function _i(e){Kt.has(e)||(Kt.add(e),e.getAttribute("content")!==null&&Ut(rr(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function Ci(e,t,n,r){if(!nr(e))return I.None;let o=oe(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&_i(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return I.None;let i=Ut(rr(e,o,n));return i.kind==="forbidden"?I.MetaRefreshForbidden:i.kind!=="not-refresh"&&Kt.has(e)?I.MetaRefreshReactive:I.None}function Ai(e,t){if(t===null||oe(e)!=="attributename")return I.None;let n=We(t);return Yn(n)||Te(n)||it(n)?I.AnimationTarget:I.None}var vt=new WeakSet;function Zn(e){if(e===null)return!1;let t=oe(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function Ni(e,t,n,r){if(!nr(e))return I.None;let o=oe(t);return o==="href"?r==="static"||n===null?I.None:Zn(e.getAttribute("rel"))?I.StylesheetSource:(vt.add(e),I.None):o==="rel"&&Zn(n)&&vt.has(e)&&e.hasAttribute("href")?I.StylesheetSource:I.None}function Gt(e,t,n,r){let o=e.localName;return o==="meta"?Ci(e,t,n,r):o==="link"?Ni(e,t,n,r):o==="script"?r==="static"||n===null?I.None:Ei.has(oe(t))?I.ScriptSource:I.None:ki.has(o)&&e.namespaceURI===xi?Ai(t,n):I.None}function Jt(e,t,n){e.localName!=="link"||oe(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?vt.add(e):vt.delete(e))}var Ri="http://www.w3.org/1999/xhtml",Li="http://www.w3.org/2000/svg",Mi="http://www.w3.org/1999/xlink",Oi="http://www.w3.org/XML/1998/namespace",Pi=new Set(["checked","disabled","selected"]);function Di(e){return e.namespaceURI===null||e.namespaceURI===Ri}function ir(e,t,n){}function or(e,t,n){e[t]=n}function $i(e,t){if(e.namespaceURI!==Li)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Mi:n.startsWith("xml:")?Oi:null}function ue(e,t,n,r={}){let o=Hi(e,t,n,r);return e.localName==="link"&&Jt(e,t,r.reactive?"reactive":"runtime"),o}function Hi(e,t,n,r){let o=$i(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(Te(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Gt(e,t,s,r.reactive?"reactive":"runtime");if(a!==I.None)return ir(r.label??"setSafeAttribute",t,a),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;if(n==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0;if(it(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let u=Di(e),l=u?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let g=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==g&&(o?e.setAttributeNS(o,t,g):e.setAttribute(t,g)),!0}return u&&Pi.has(l)&&l in e?or(e,l,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let c=String(n);if(r.syncValueProperty!==!1&&u&&(l==="value"||l==="checked")&&l in e)return or(e,l,l==="checked"?!!n:c),!0;let m=c===""?"":Xn(t,c,{element:e});return m===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===m||(o?e.setAttributeNS(o,t,m):e.setAttribute(t,m)),!0)}function Yt(e,t,n){if(it(t))return!1,!1;let r=Gt(e,t,n,"static");return r!==I.None?(ir("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Jt(e,t,"static"),!0)}var Ii=4096,Xt=[];function Bi(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Vi(e,t,n){let r=Xt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Bi();return o.sig=e,o.sub=t,o.epoch=n,o}function sr(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Xt.length<Ii&&Xt.push(e)}function ji(e,t){let n=e.subsHead??null;t.sigPrev=null,t.sigNext=n,n?n.sigPrev=t:e.subsTail=t,e.subsHead=t,e.__sc=(e.__sc??0)+1}function ar(e){let t=e.sig;if(!t)return;let n=e.sigPrev,r=e.sigNext;n?n.sigNext=r:t.subsHead=r,r?r.sigPrev=n:t.subsTail=n,t.__sc=(t.__sc??1)-1,t.__activeNode===e&&(t.__activeNode=e.prevActive),t.__sc===0&&(t.subsHead=null,t.subsTail=null)}function Fi(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function zi(e){let t=e.sub;if(!t)return;let n=e.subPrev,r=e.subNext;n?n.subNext=r:t.depsHead=r,r?r.subPrev=n:t.depsTail=n}var le=null,he=null,Ee=0,ke=[],J=new Set,Wi=[];function qi(e){try{e()}catch(t){let n=e;L(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Ui(e){let t=e.depsHead??null;if(t===null)return!0;for(;t!==null;){let n=t.sig;if(n===null)return!0;if(n._d===!0&&n._validate!==void 0)try{n._validate()}catch{return!0}if(t.depVersion!==n.__v)return!0;t=t.subNext}return!1}var ge=0,ye=!1;function Qt(){ge===0&&(he=le,le=null,ye=!0),ge++}function en(){ge--,ge===0&&(le=he,he=null,ye=!1)}function ur(){return ye}function lr(e){Qt();try{return e()}finally{en()}}var se=null;function tn(){return se}function Tt(e,t){let n=se;se=e;try{return t()}finally{se=n}}function nn(e){let t=se;return t===null?e:(...n)=>Tt(t,()=>e(...n))}var qe=null,Ki=0;function rn(e,t){let n=le,r=0,o=null;ye&&(r=ge,o=he,ge=0,he=null,ye=!1),le=t;let i=t;i._cap===void 0&&(i._cap=Vn());let s=se;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(se=a);let u=qe;u!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=u),i._tok!=null&&(qe=i._tok);let l=++Ki;i._epoch=l,i._structDirty=!1;for(let c=i.depsHead??null;c!==null;c=c.subNext){let m=c.sig;c.prevActive=m.__activeNode??null,m.__activeNode=c}try{e()}finally{le=n,se=s,qe=u,r!==0&&(ge=r,he=o,ye=!0);let c=i.depsHead??null;for(;c!==null;){let m=c.subNext,h=c.sig;h.__activeNode=c.prevActive,c.prevActive=null,c.epoch!==l&&(zi(c),ar(c),sr(c)),c=m}}}function cr(e,t){if(!t)return on(e);Ue(t);let n=le,r=0,o=null;ye&&(r=ge,o=he,ge=0,he=null,ye=!1),le=t;let i=t;i._scope===void 0&&(i._scope=se);let s=se;se=i._scope;try{e()}finally{le=n,se=s,r!==0&&(ge=r,he=o,ye=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let u=a.sig;u.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>Ue(t))}function on(e,t,n){return fr(e,t,n===!0)._dispose}function dr(e,t){let n=fr(e,t,!0);return{stop:n._dispose,run:r=>{let o=qe;qe=n._tok??null;try{return r()}finally{qe=o}}}}function fr(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{rn(e,o)}finally{i._reentrant=!1}}},o=r;o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._runEpoch=0,o._runs=0,o._reentrant=!1,o._disposed=!1,o._errorPhase="binding",o._errorNode=t,o._tok=null,o._owner=null,n&&(o._tok={sub:o});try{r()}catch(i){throw o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Ue(o),i}return o._dispose=()=>{o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Ue(o)},o}function pr(e){if(!le)return;let t=le,n=e,r=t._epoch??0,o=n.__activeNode??null;if(o!==null&&o.sub===t){o.epoch=r,o.depVersion=n.__v??Number.NaN;return}n._validate!==void 0&&(t._hasComputedDep=!0);let i=Vi(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,Fi(t,i),ji(n,i),t._structDirty=!0}function Ue(e){let t=e;t._owner!=null&&(t._owner=null);let n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;ar(n),sr(n),n=r}}var St=1e3,xt=1e6,wt=0,Le=new Set;function mr(e){let t=St;return Number.isFinite(e)&&e>0&&(St=Math.floor(e)),t}function gr(e){let t=xt;return Number.isFinite(e)&&e>0&&(xt=Math.floor(e)),t}function Gi(e){let t=e;return t._runEpoch!==wt?(t._runEpoch=wt,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>St)}function Ji(e){let t=e.__name??"<unnamed>";L(new Error(`subscriber "${t}" fired more than ${St} 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:t})}function Yi(){L(new Error(`Notification drain exceeded ${xt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function br(){let e=0;for(;e<ke.length;){if(e>=xt){Yi();break}let t=ke[e++];J.delete(t)&&(t._owner!=null&&J.size>0&&(Xi(t),J.has(t))||hr(t))}}function Xi(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;J.has(r)&&(t=r),n=r._owner??null}if(t===null)return;J.delete(t),hr(t)}}function hr(e){if(Le.size>0&&Le.has(e)||e._hasComputedDep===!0&&!Ui(e))return;if(Gi(e)){Ji(e),Le.add(e);return}let t=jn(e._cap??null);try{qi(e)}finally{t&&Fn()}}function yr(){if(!(Ee>0)){Ee++,wt++;try{br()}finally{Ee--,Ee===0&&(ke.length=0,J.clear(),Le.size>0&&Le.clear())}}}function Zt(e){e();let t=e._sig;if(!t)return;let n=Wi,r=n.length;for(n.push(t);n.length>r;){let i=n.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,n.push(a)):s()}else J.has(s)||(J.add(s),ke.push(s));i=i.sigNext}}}function vr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Zt(r):J.has(r)||(J.add(r),ke.push(r))),n=n.sigNext}}function Sr(e){let n=e.subsHead;if(n){if(Ee>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Zt(o):J.has(o)||(J.add(o),ke.push(o))),r=r.sigNext}return}Ee++,wt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Zt(o):J.has(o)||(J.add(o),ke.push(o))),r=r.sigNext}br()}finally{Ee--,Ee===0&&(ke.length=0,J.clear(),Le.size>0&&Le.clear())}}}function xr(e){return e.__sc??0}function wr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function Tr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var Er="4.13.1",kr=Symbol.for("sibujs.reactive.v1");function Qi(){let e=globalThis,t=e[kr];if(t)return!1,t;let n={suspendTracking:Qt,resumeTracking:en,isTrackingSuspended:ur,untracked:lr,retrack:rn,track:cr,reactiveBinding:on,recordDependency:pr,cleanup:Ue,setMaxSubscriberRepeats:mr,setMaxDrainIterations:gr,drainNotificationQueue:yr,queueSignalNotification:vr,notifySubscribers:Sr,getSubscriberCount:xr,getSubscriberDeps:wr,forEachSubscriber:Tr,getOwnerScope:tn,runWithOwnerScope:Tt,bindOwnerScope:nn,structuralBinding:dr,version:Er};return e[kr]=n,n}var j=Qi(),Me=j.suspendTracking,Oe=j.resumeTracking,_r=j.isTrackingSuspended,ce=j.untracked,_e=j.retrack,Ke=j.track,K=j.reactiveBinding,Pe=j.recordDependency,De=j.cleanup,Pc=j.setMaxSubscriberRepeats,Cr=j.setMaxDrainIterations,Ar=j.drainNotificationQueue,Nr=j.queueSignalNotification,Ge=j.notifySubscribers,Dc=j.getSubscriberCount,$c=j.getSubscriberDeps,Hc=j.forEachSubscriber,Je=j.getOwnerScope??tn,Et=j.runWithOwnerScope??Tt,X=j.bindOwnerScope??nn,$e=j.structuralBinding??((e,t)=>({stop:j.reactiveBinding(e,t),run:n=>n()}));function st(e,t,n){if(Te(t))return ue(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){L(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}ue(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return K(r,e)}function Rr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(u){L(u,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(u){L(u,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),ue(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=K(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var sn=["data-focus-key","id","name"],es=new Set(["text","search","url","tel","password",""]);function ts(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&es.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 at(e){if(e.length===0||typeof document>"u")return null;let t=document.activeElement;if(!t||t===document.body)return null;let n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===t||s.nodeType===1&&s.contains(t)){n=!0;break}}if(!n)return null;let r=null,o=null;for(let i=0;i<sn.length;i++){let s=t.getAttribute(sn[i]);if(s){r=sn[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...ts(t)}}function ns(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function rs(e,t){let n=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(t)&&(r++,n??(n=s));let a=s.querySelectorAll(t);for(let u=0;u<a.length;u++)r++,n??(n=a[u]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function Lr(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function Ye(e,t,n,r){if(!e||typeof document>"u"||r==="discard")return;let o=document.activeElement;if(o===e.el||o&&o!==document.body&&o!==document.documentElement)return;if(e.el.isConnected){Lr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=rs(t,`[${e.attr}=${ns(e.value)}]`);if(s&&s.tagName===e.tag){Lr(s,e);return}i=a>1}if(r!==void 0&&typeof r=="object"){let s=typeof r.restoreTo=="function"?r.restoreTo():r.restoreTo;if(s?.isConnected&&(s.focus(),document.activeElement===s))return}}function ve(e,t){let n=[];function r(){let o;try{o=t()}catch(c){L(c,{phase:"binding",name:"bindChildNode",node:e});return}let i=at(n);if(o==null||typeof o=="boolean"){for(let c=0;c<n.length;c++){let m=n[c];V(m),m.parentNode&&m.parentNode.removeChild(m)}n.length=0,Ye(i,n,"bindChildNode");return}let s=e.parentNode;if(!s){n.length=0;return}let a;if(Array.isArray(o)){a=[];let c=new Set;for(let m=0;m<o.length;m++){let h=o[m];if(h==null||typeof h=="boolean")continue;let g=h instanceof Node?h:document.createTextNode(String(h));if(c.has(g)){!1;continue}c.add(g),a.push(g)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let u;if(n.length>0&&a.length>0){let c=new Set(n);u=new Set;for(let m=0;m<a.length;m++)c.has(a[m])&&u.add(a[m])}for(let c=0;c<n.length;c++){let m=n[c];u?.has(m)||(V(m),m.parentNode&&m.parentNode.removeChild(m))}let l=e;for(let c=0;c<a.length;c++){let m=a[c];l.nextSibling!==m&&s.insertBefore(m,l.nextSibling),l=m}n=a,Ye(i,a,"bindChildNode")}return K(r,e,!0)}function an(){throw new Error("[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first.")}function te(){typeof document>"u"&&an()}var H="http://www.w3.org/2000/svg",os=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var un=new Set,Mr=100,Or=!1,Pr=new Map;function Dr(e){let t=Pr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Pr.set(e,t)),t}function is(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=K(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",ht(String(a),{element:e}));return}let u=e.style;i&&(e.removeAttribute("style"),i=!1);let l=[];for(let c in a){if(!Object.hasOwn(a,c))continue;let m=a[c];if(m==null)continue;let h=Dr(c);l.push(h),u.setProperty(h,bt(h,String(m),{element:e}))}for(let c=0;c<o.length;c++)l.indexOf(o[c])===-1&&u.removeProperty(o[c]);o=l},e);_(e,s);return}if(typeof t=="string"){e.setAttribute("style",ht(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Dr(r);if(typeof o=="function"){let s=o,a=K(()=>{n.style.setProperty(i,bt(i,String(s()),{element:e}))},e);_(e,a)}else n.style.setProperty(i,bt(i,String(o),{element:e}))}}function ss(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=K(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);_(e,i);return}let n=t,r=!1,o="";for(let i in n){if(!Object.hasOwn(n,i))continue;let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=K(()=>{let a="";for(let u in n){if(!Object.hasOwn(n,u))continue;let l=n[u];(typeof l=="function"?l():l)&&(a=a?`${a} ${u}`:u)}e.setAttribute("class",a)},e);_(e,s)}else e.setAttribute("class",o)}function ln(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),_(e,ve(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),_(e,ve(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),_(e,ve(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function p(e,t){let n=er(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&an();let i=t?document.createElementNS(t,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),ln(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 ln(i,r),i;let s=r,a=s.class;a!=null&&ss(i,a);let u=s.id;typeof u=="function"?_(i,st(i,"id",u)):u!=null&&(!1,i.id=u);let l=o!==void 0?o:s.nodes;l!=null&&ln(i,l);let c=s.on;if(c)for(let g in c){if(!Object.hasOwn(c,g))continue;let d=c[g];typeof d=="function"?i.addEventListener(g,d):!1}let m=s.style;m!=null&&is(i,m);let h=s.ref;h&&(h.current=i);for(let g in s)switch(g){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,g))continue;let d=s[g];if(d==null||Te(g))continue;typeof d=="function"?_(i,st(i,g,d)):ue(i,g,d,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var ad=p("html"),as=p("head"),us=p("body"),ls=p("title"),P=p("div"),z=p("span"),cs=p("section"),ds=p("article"),fs=p("header"),ps=p("footer"),ms=p("nav"),gs=p("main"),bs=p("aside"),hs=p("address"),cn=p("p"),ys=p("h1"),vs=p("h2"),dn=p("h3"),Ss=p("h4"),xs=p("h5"),ws=p("h6"),Ts=p("blockquote"),Es=p("dd"),ks=p("dl"),_s=p("dt"),Cs=p("figcaption"),As=p("figure"),Ns=p("hr"),Rs=p("li"),Ls=p("ol"),Ms=p("ul"),fn=p("pre"),Os=p("a"),Ps=p("abbr"),Ds=p("b"),$s=p("bdi"),Hs=p("bdo"),Is=p("br"),Bs=p("cite"),pn=p("code"),Vs=p("data"),js=p("dfn"),Fs=p("em"),zs=p("i"),Ws=p("kbd"),qs=p("mark"),Us=p("q"),Ks=p("rp"),Gs=p("rt"),Js=p("ruby"),Ys=p("s"),Xs=p("samp"),Zs=p("small"),Qs=p("strong"),ea=p("sub"),ta=p("sup"),na=p("time"),ra=p("u"),oa=p("var"),ia=p("area"),sa=p("audio"),aa=p("img"),ua=p("map"),la=p("track"),ca=p("video"),da=p("embed"),fa=p("iframe"),pa=p("object"),ma=p("param"),ga=p("picture"),ba=p("portal"),ha=p("source"),ya=p("svg",H),va=p("math"),Sa=p("canvas"),xa=p("noscript"),wa=p("script"),Ta=p("del"),Ea=p("ins"),ka=p("caption"),_a=p("col"),Ca=p("colgroup"),Aa=p("table"),Na=p("tbody"),Ra=p("td"),La=p("tfoot"),Ma=p("th"),Oa=p("thead"),Pa=p("tr"),ut=p("button"),Da=p("datalist"),$a=p("fieldset"),Ha=p("form"),Ia=p("input"),Ba=p("label"),Va=p("legend"),ja=p("meter"),Fa=p("optgroup"),za=p("option"),Wa=p("output"),qa=p("progress"),Ua=p("select"),Ka=p("textarea"),Ga=p("details"),Ja=p("dialog"),Ya=p("menu"),Xa=p("summary"),Za=p("slot"),Qa=p("template"),eu=p("base"),tu=p("link"),nu=p("meta"),He=p("style"),ru=p("circle",H),ou=p("ellipse",H),iu=p("g",H),su=p("line",H),au=p("path",H),uu=p("polygon",H),lu=p("polyline",H),cu=p("rect",H),du=p("text",H),fu=p("tspan",H),pu=p("defs",H),mu=p("clipPath",H),gu=p("mask",H),bu=p("pattern",H),hu=p("linearGradient",H),yu=p("radialGradient",H),vu=p("stop",H),Su=p("use",H),xu=p("symbol",H),wu=p("marker",H),Tu=p("center"),Eu=p("font"),ku=p("marquee"),_u=e=>p(e);var mn="__sibuPendingError";function $r(e,t){let n=()=>e.parentNode?(L(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[mn]=t)})}function kt(e){let t=e,n=t[mn];if(n instanceof Error)return delete t[mn],n}function Hr(e){let t=null;return function(){if(t)return t();let r=P({class:"sibu-lazy"}),o=!1;return e().then(X(i=>{if(o)return;t=i.default;let s=t();ee(r,s)})).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));ee(r,P({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),$r(r,s)}),r.appendChild(z("sibu-lazy-loading","Loading...")),_(r,()=>{o=!0}),r}}function Ir({nodes:e,fallback:t}){let n=P({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null,s=null;_(n,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!n.contains(s)&&V(s)});let a=X(()=>{if(!o)try{let u=e();if(s=u,u.classList.contains("sibu-lazy")){if(!u.querySelector(".sibu-lazy-loading")){ee(n,u);return}i=new MutationObserver(()=>{if(o)return;u.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,ee(n,u))}),i.observe(u,{childList:!0,subtree:!0})}else ee(n,u)}catch(u){let l=u instanceof Error?u:new Error(String(u));$r(n,l)}});return queueMicrotask(a),n}function yn(e,t){return()=>Je()===e?t():Et(e,t)}function Ct(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";L(n,{phase:r,name:t});return}}function gn(e,t,n,r,o){let i=Ct(e,t);if(typeof i!="function")return;let s=yn(o,i);r()||!n.isConnected?Ct(s,"onUnmount"):Vr(s,n)}var Xe=new WeakMap,Ie=new WeakMap,Se=new Set,xe=new Set,Ze=null,_t=0,Cu=256;function bn(e){let t=Xe.get(e);if(t){Xe.delete(e),Se.delete(e);for(let n of t)try{n()}catch{}}}function hn(e){Ie.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Ie.get(e);if(n){Ie.delete(e),xe.delete(e);for(let r of n)try{r()}catch{}}})}function Au(e){if(Se.size===0||e.nodeType!==1)return;let t=e;if(Se.has(t)&&t.isConnected&&bn(t),t.firstElementChild)for(let n of Array.from(Se))n!==t&&n.isConnected&&t.contains(n)&&bn(n)}function Nu(e){if(xe.size===0||e.nodeType!==1)return;let t=e;if(xe.has(t)&&!t.isConnected&&hn(t),t.firstElementChild)for(let n of Array.from(xe))n!==t&&!n.isConnected&&t.contains(n)&&hn(n)}function Ru(){if(Se.size>0)for(let e of Array.from(Se))e.isConnected&&bn(e);if(xe.size>0)for(let e of Array.from(xe))e.isConnected||hn(e)}function Br(){Ze||typeof document>"u"||(Ze=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)Au(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)Nu(t.removedNodes[n])}_t+=e.length,_t>=Cu&&(_t=0,Ru()),vn()}),Ze.observe(document.body,{childList:!0,subtree:!0}))}function vn(){Ze&&Se.size===0&&xe.size===0&&(Ze.disconnect(),Ze=null,_t=0)}function Lu(e,t){let n=Xe.get(e);return n||(n=[],Xe.set(e,n)),n.push(t),Se.add(e),Br(),()=>{let r=Xe.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Xe.delete(e),Se.delete(e))}vn()}}function Mu(e,t){let n=Ie.get(e);return n||(n=[],Ie.set(e,n)),n.push(t),xe.add(e),Br(),()=>{let r=Ie.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ie.delete(e),xe.delete(e))}vn()}}function At(e,t){if(typeof document>"u")return;let n=Je();if(e=yn(n,e),t){let r=!1,o=()=>r;if(_(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||gn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){gn(e,"onMount",t,o,n);return}let i=Lu(t,()=>{r||gn(e,"onMount",t,o,n)});_(t,i)})}else queueMicrotask(()=>{Ct(e,"onMount")})}function Ou(e,t){typeof document>"u"||Vr(yn(Je(),e),t)}function Vr(e,t){let n=!1,r=()=>{n||(n=!0,Ct(e,"onUnmount"))};_(t,r);let o=()=>{if(n)return;let i=Mu(t,r);_(t,i)};t.isConnected?o():At(()=>{o()},t)}function Pu(e,t){_(t,e)}function ae(e,t,n){try{e.emit(t,n)}catch{}}var Sn=Symbol.for("sibujs.ssr.v1");function Du(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let t=null,n=process.getBuiltinModule;typeof n=="function"?t=n("node:async_hooks"):typeof It=="function"&&(t=It("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var Ce=globalThis[Sn]??(globalThis[Sn]=Du()),Be=Ce.als,Z=Ce.fallbackStore;Ce.fallbackDepth??(Ce.fallbackDepth=0);var jr=!1;function $u(){if(jr||Be||!(typeof process<"u"&&!!process.versions?.node))return;jr=!0;let t=process.versions.node;`${t}`}function Ve(){if(Be){let e=Be.getStore();if(e)return e}return Z}function Fr(){return Be?Be.getStore()??null:Ce.fallbackDepth>0?Z:null}function de(){return Ve().ssr}function zr(e){if(!de())return null;let t=Ve(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function Wr(){Ve().ssr=!0}function qr(){Ve().ssr=!1}function Ur(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Be)return Be.run(t,e);$u();let n=Z.ssr,r=Z.suspenseIdCounter,o=Z.idCounter,i=Z.locale;Z.ssr=!0,Z.suspenseIdCounter=0,Z.idCounter=0,Z.locale=void 0,Ce.fallbackDepth++;try{return e()}finally{Ce.fallbackDepth--,Z.ssr=n,Z.suspenseIdCounter=r,Z.idCounter=o,Z.locale=i}}function Kr(e){let t=Ve(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Xr=globalThis;function Hu(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,ce(()=>t(o,void 0));else{let i=n;n=o,ce(()=>t(o,i))}}}var Gr=100;function Nt(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===Je()?Jr(t):Et(n,()=>Jr(t))}function Jr(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){L(n,{phase:"cleanup"})}}function Yr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&Nt(e),_e(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Gr);e.rerunPending&&(e.rerunPending=!1,L(new Error(`effect re-requested itself ${Gr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Iu(e){if(e.disposed)return;e.disposed=!0;let t=Xr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Nt(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{De(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function Q(e,t){if(de())return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=s=>{n.userCleanups.push(s)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(s){r(s)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&Nt(n),_e(n.bodyFn,o),n.rerunPending&&Yr(n)}finally{n.running=!1,n.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,n.subscriber=o,n.running=!0;try{_e(n.bodyFn,n.subscriber),n.rerunPending&&Yr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&Nt(n),De(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=Xr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&ae(i,"effect:create",{effectFn:e}),()=>Iu(n)}var lt=0,xn=new Set;function Bu(e){lt++;try{return e()}finally{lt--,lt===0&&Fu()}}function Vu(e){return lt===0?!1:(xn.add(e),!0)}function ju(){return lt>0}function Fu(){try{for(let e of xn)Nr(e)}finally{xn.clear()}Ar()}var Zr=Symbol.for("sibujs.reactive.batch.v1");function zu(){let e=globalThis,t=e[Zr];if(t)return t;let n={batch:Bu,enqueueBatchedSignal:Vu,isBatching:ju};return e[Zr]=n,n}var wn=zu(),W=wn.batch,je=wn.enqueueBatchedSignal,Wu=wn.isBatching;var Tn=globalThis;function C(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=t?.equals;r&&(n.__name=r);function i(){return Pe(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let u=n.value,l=typeof a=="function"?a(u):a;if(!o(u,l)){if(n.value=l,n.__v++,!1){let c=Tn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&ae(c,"signal:update",{signal:n,name:r,oldValue:u,newValue:l})}je(n)||Ge(n)}}:s=a=>{let u=n.value,l=typeof a=="function"?a(u):a;Object.is(l,u)||(n.value=l,n.__v++,je(n)||Ge(n))},!1){let a=Tn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&ae(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function qu(e){let[t,n]=C(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Uu=`
|
|
8
8
|
.sibu-error-display {
|
|
9
9
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
10
10
|
border-radius: 10px;
|
|
@@ -185,11 +185,11 @@
|
|
|
185
185
|
border: 1px solid #3a3a4e;
|
|
186
186
|
}
|
|
187
187
|
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
188
|
-
`,
|
|
189
|
-
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function
|
|
188
|
+
`,Qr=!1;function Ku(){if(Qr||typeof document>"u")return;let e=He({nodes:Uu});document.head.appendChild(e),Qr=!0}function Gu(e){let t=[],n=e.split(`
|
|
189
|
+
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function eo(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=Gu(r),i=e.cause,s=i!=null?eo(i):null;return{code:t,message:n,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function Ju(e,t,n){let r=[];r.push(n),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
|
|
190
190
|
`).map(s=>` ${s}`).join(`
|
|
191
191
|
`);r.push(i)}o=o.cause}if(t&&Object.keys(t).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(t))r.push(` ${i}: ${String(s)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
|
|
192
|
-
`)}function
|
|
192
|
+
`)}function to(e){let t=e.map((n,r)=>P({class:"sibu-err-frame",nodes:[z({class:"sibu-err-line",nodes:String(r+1)}),z({class:"sibu-err-fn",nodes:n.fn}),z({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return fn({class:"sibu-err-stack",nodes:t})}function no(e){return e?[P({class:"sibu-err-cause-label",nodes:"Caused by"}),P({class:"sibu-err-section",nodes:[P({class:"sibu-err-section-head",nodes:[z({nodes:`[${e.code}] ${e.message}`}),z({nodes:""})]}),e.frames.length>0?to(e.frames):P({class:"sibu-err-stack",nodes:"(no stack)"})]}),...no(e.cause)]:[]}function Yu(e){let t=[];for(let[r,o]of Object.entries(e)){t.push(document.createElement("dt")),t[t.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),t.push(i)}let n=document.createElement("dl");n.className="sibu-err-meta";for(let r of t)n.appendChild(r);return n}function En(e){Ku();let t=e.severity??"error",n=eo(e.error),r=e.alwaysShowDetails??pe(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),u=ut({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let g=Ju(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(g).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),l=P({class:"sibu-err-header",nodes:[pn({class:"sibu-err-icon",nodes:n.code}),dn({class:"sibu-err-title",nodes:o}),u,z({class:"sibu-err-timestamp",nodes:i})]}),c=[cn({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&c.push(P({class:"sibu-err-section",nodes:[P({class:"sibu-err-section-head",nodes:[z({nodes:"Stack Trace"})]}),to(n.frames)]})),r&&c.push(...no(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&c.push(P({class:"sibu-err-section",nodes:[P({class:"sibu-err-section-head",nodes:[z({nodes:"Metadata"})]}),Yu(e.metadata)]}));let m=[];e.onRetry&&m.push(ut({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&m.push(ut({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),m.length>0&&c.push(P({class:"sibu-err-actions",nodes:m}));let h=P({class:"sibu-err-body",nodes:c});return P({class:"sibu-error-display","data-severity":t,nodes:[l,h]})}var Xu=`
|
|
193
193
|
.sibu-error-boundary {
|
|
194
194
|
position: relative;
|
|
195
195
|
}
|
|
@@ -343,7 +343,7 @@
|
|
|
343
343
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
344
344
|
background: #3a3a4e;
|
|
345
345
|
}
|
|
346
|
-
`,
|
|
346
|
+
`,Zu=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),ro=!1;function Qu(){if(!ro&&typeof document<"u"){let e=He({nodes:Xu});document.head.appendChild(e),ro=!0}}function el(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;Qu();let[a,u]=C(null),l=()=>{m(),u(null)},c=null,m=()=>{if(!c)return;let v=c;c=null,v()},h=v=>{let x=new Array(v.length);for(let T=0;T<v.length;T++)try{x[T]=v[T]()}catch(D){L(D,{phase:"effect",name:"ErrorBoundary.resetKeys"}),x[T]=Zu}return x},g=()=>{let v=s;if(!v||v.length===0)return;m();let x=null;c=Q(()=>{let T=h(v);if(x===null){x=T;return}let D=T.length!==x.length;if(!D){for(let B=0;B<T.length;B++)if(!Object.is(T[B],x[B])){D=!0;break}}x=T,D&&l()})},d=v=>{let x=Vt(v);if(u(x),g(),i)try{i(x)}catch(T){L(T,{phase:"render",name:"ErrorBoundary onError callback"})}return x},f=(v,x)=>En({error:v,severity:"error",onRetry:x}),b=v=>{let x=o||f;try{return x(v,l)}catch(T){return queueMicrotask(()=>{L(T,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=P({class:"sibu-error-boundary",nodes:()=>{let v=a();if(v)return b(v);try{let x=n();if(x&&typeof x.then=="function"){let T=P({class:"sibu-error-async"});T.appendChild(z({class:"sibu-lazy-loading",nodes:"Loading..."}));let D=!1;return _(T,()=>{D=!0}),x.then(B=>{if(D){V(B);return}ee(T,B)}).catch(X(B=>{if(D)return;let U=d(B);ee(T,b(U))})),T}return x}catch(x){let T=d(x);return b(T)}}}),S=v=>{if(a())return;let T=v.detail?.error;T&&(v.preventDefault(),v.stopPropagation(),d(T))};return y.addEventListener("sibu:error-propagate",S),At(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),x=[],T=v.currentNode;for(;T;){let D=kt(T);D&&x.push(D),T=v.nextNode()}if(x.length===1)d(x[0]);else if(x.length>1){let D=globalThis.AggregateError;d(D?new D(x,`${x.length} pre-mount errors caught by ErrorBoundary`):new Error(x.map(B=>B.message).join("; ")))}},y),_(y,()=>{m(),y.removeEventListener("sibu:error-propagate",S)}),y}var tl=`
|
|
347
347
|
@keyframes sibu-spin {
|
|
348
348
|
to { transform: rotate(360deg); }
|
|
349
349
|
}
|
|
@@ -396,5 +396,5 @@
|
|
|
396
396
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
397
397
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
398
398
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
399
|
-
`,
|
|
400
|
-
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let m=r;r++;let u=0;for(;r<o&&n.charCodeAt(r)!==0;)u=u*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,u<0||u>=t?(r=m,-1):u}function a(){let m=r;for(;r<o;){let u=n.charCodeAt(r);if(u>=97&&u<=122||u>=65&&u<=90||u>=48&&u<=57||u===45)r++;else break}return n.slice(m,r)}function l(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let m=s();if(m>=0)return{kind:"expr",idx:m};let u=n[r];if(u==='"'||u==="'"){r++;let f=[],b=[],y="";for(;r<o&&n[r]!==u;){let S=s();S>=0?(f.push(y),y="",b.push(S)):y+=n[r++]}return r<o&&r++,f.push(y),b.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:b}}{let f=[],b=[],y="";for(;r<o;){let S=n.charCodeAt(r);if(S===32||S===9||S===10||S===13||S===62)break;let v=s();v>=0?(f.push(y),y="",b.push(v)):y+=n[r++]}return f.push(y),b.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:b}}}function c(){let m=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let u=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let f=n.slice(u,r);if(!f)break;let b=l();f.startsWith("on:")?b.kind==="expr"&&m.push({t:3,name:f.slice(3),idx:b.idx}):b.kind==="bool"?m.push({t:4,name:f}):b.kind==="static"?m.push({t:0,name:f,value:b.value}):b.kind==="expr"?m.push({t:1,name:f,idx:b.idx}):b.kind==="mixed"&&m.push({t:2,name:f,statics:b.statics,exprs:b.exprs})}return m}function d(m){return m.replace(/\s+/g," ")}function g(m){let u="";for(;r<o&&n[r]!=="<";){let b=s();if(b>=0){let y=d(u);y&&m.push({t:1,value:y}),u="",m.push({t:2,idx:b})}else u+=n[r++]}let f=d(u);f&&m.push({t:1,value:f})}function h(){let m=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let u=n[r+1];if(u==="!"){if(n.startsWith("<!--",r)){let v=n.indexOf("-->",r+4);r=v===-1?o:v+3}else if(n.startsWith("<![CDATA[",r)){let v=n.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=n.indexOf(">",r);r=v===-1?o:v+1}continue}if(u==="?"){let v=n.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(u>="a"&&u<="z")&&!(u>="A"&&u<="Z")){m.push({t:1,value:"<"}),r++;continue}r++;let f=a(),b=c();i();let y=dc.has(f),S=n[r]==="/";if(S&&r++,r<o&&r++,y||S)m.push({t:0,el:{tag:f,svg:go.has(f),attrs:b,children:[]}});else{let v=h();if(Zn(f)){for(let x=0;x<v.length;x++)if(v[x].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${f}> (raw-text context). Build the content separately and append it as a Node.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),m.push({t:0,el:{tag:f,svg:go.has(f),attrs:b,children:v}})}}else g(m);return m}return h()}function kn(e,t){let n=e.svg?document.createElementNS(H,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:Kt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?A(n,rt(n,i,s)):le(n,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=t[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}le(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):!1;break}case 4:Kt(n,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(kn(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),A(n,Se(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function ho(e,...t){let n=bo.get(e);return n||(n=fc(e),bo.set(e,n)),vo(n,t)}function yo(e,t){return vo(e,t)}function vo(e,t){if(ee(),e.length===1&&e[0].t===0)return kn(e[0].el,t);let n=document.createElement("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(kn(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(i instanceof Node)n.appendChild(i);else if(typeof i=="function"){let s=document.createComment("bind:htm");n.appendChild(s),A(n,Se(s,i))}else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function pc(e,t,n){ee();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&me()&&void 0;let a,l=null,c=!1,d=!1,g=()=>{if(d)return;let m=e(),u=r.parentNode;if(!u||c&&m===a)return;l?.parentNode&&u.removeChild(l),a=m;let f=o.get(m);if(f){let b=i.indexOf(m);b!==-1&&(i.splice(b,1),i.push(m))}else{let b=t[m];if(!b){l=null,c=!0;return}if(f=b(),f.nodeType===11){let y=document.createElement("div");y.style.display="contents",y.appendChild(f),f=y}if(o.set(m,f),i.push(m),s>0&&i.length>s){let y=i.shift(),S=o.get(y);S&&(V(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(y))}}u.insertBefore(f,r.nextSibling),l=f,c=!0},h=se(g);return c||queueMicrotask(Y(()=>{!c&&r.parentNode&&g()})),A(r,()=>{d=!0,h();for(let m of o.values())V(m),m.parentNode&&m.parentNode.removeChild(m);o.clear(),i.length=0,l=null}),r}function mc(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=d=>{if(d instanceof DocumentFragment){let g=document.createComment(""),h=document.createComment("");d.insertBefore(g,d.firstChild),d.appendChild(h),o={start:g,end:h}}t.appendChild(d)},s;typeof e=="function"?s=Vn(()=>{let d=e();return i(d),d}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&ae(l,"app:init",{rootElement:s,container:t,duration:a});let c=o;return{node:s,unmount(){if(l&&ae(l,"app:unmount",{rootElement:s}),c){gc(c.start,c.end);return}V(s),s.parentNode?.removeChild(s)}}}function gc(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=he;for(let a=e.nextSibling;a&&a!==t;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==n||t.parentNode!==n?s=!1:(e.previousSibling!==o||t.nextSibling!==i)&&(o=e.previousSibling,i=t.nextSibling,s=!!(e.compareDocumentPosition(t)&4));let a=e.nextSibling;if(!s||a===t)break;if(r--<=0){Te("mount",he,1);return}V(a),a.parentNode===n&&n.removeChild(a)}s||R(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function bc(e,t){ee();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=Y(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{R(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),A(n,()=>{i=!0,o&&(V(o),o.remove(),o=null)}),n}function hc(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function So(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function yc(e=[]){let[t,n]=_([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let l=[...a];return s=So(l,o,i),s.length===0&&i.length<=1?a:l}),s},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,l)=>l!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,l)=>l===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function vc(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Ve(r)||qe(r)}function i(){if(Pe(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,...l){let c=So(t,a,l);return(c.length>0||l.length>1)&&o(),c},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let l=t.findIndex(a);l!==-1&&(t.splice(l,1),o())},set(a){t=[...a],o()},update(a,l){a<0||a>=t.length||Object.is(t[a],l)||(t[a]=l,o())},updateWhere(a,l){let c=!1;for(let d=0;d<t.length;d++)if(a(t[d])){let g=l(t[d]);Object.is(t[d],g)||(t[d]=g,c=!0)}c&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let l=t.filter(a);l.length!==t.length&&(t=l,o())},map(a){let l=!1;for(let c=0;c<t.length;c++){let d=a(t[c],c);Object.is(t[c],d)||(t[c]=d,l=!0)}l&&o()},clear(){t.length!==0&&(t=[],o())}}]}function Sc(e,t){let[n,r]=_(t),[o,i]=_(!1),[s,a]=_(null),[l,c]=_(0),d=0,g=!1,h=null,m=()=>{if(h===null)return;let f=h;h=null;try{f.abort()}catch{}},u=Z(()=>{if(l(),g)return;m();let f=++d,b=typeof AbortController<"u"?new AbortController:null;h=b,z(()=>{i(!0),a(null)});let y=()=>g||f!==d,S;try{S=e({signal:b?b.signal:void 0})}catch(v){if(y())return;z(()=>{a(v),i(!1)});return}S.then(v=>{y()||(h=null,z(()=>{r(v),i(!1)}))},v=>{y()||(h=null,z(()=>{a(v),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{g||c(f=>f+1)},dispose:()=>{g||(g=!0,u(),m())}}}function Xe(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let a=t;return e.source===a.source&&e.flags===a.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let a=t;if(e.size!==a.size)return!1;for(let[l,c]of e)if(!a.has(l)||!Xe(c,a.get(l),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let l of e)if(!a.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),l=new Uint8Array(t);if(a.length!==l.length)return!1;for(let c=0;c<a.length;c++)if(a[c]!==l[c])return!1;return!0}if(e instanceof DataView){if(!(t instanceof DataView)||e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==t.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let a=e,l=t;if(a.length!==l.length)return!1;for(let c=0;c<a.length;c++)if(a[c]!==l[c])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,l)=>Xe(a,t[l],n));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),t.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===t.href;if(e instanceof Error){let a=t;return e.name===a.name&&e.message===a.message&&Xe(e.cause,a.cause,n)&&xo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:xo(r,o,n)}function xo(e,t,n){let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(t,i)&&Xe(e[i],t[i],n))}function xc(e){return _(e,{equals:(t,n)=>Xe(t,n)})}function Fe(e,t){let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,l=()=>{o._d||s||(o._d=!0)};l._c=1,l._sig=o;let c=()=>{let u=e();o._v=r&&o._init&&r(o._v,u)?o._v:u,o._d=!1,o._init=!0};try{se(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(u){throw s=!0,De(l),u}let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,g=()=>{if(!o._d||s||a!==void 0)return;let u=o._v;i=!0;try{Ae(c,l),Object.is(u,o._v)||o.__v++}catch(f){a={error:f},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&De(l)}d&&!s&&!Object.is(u,o._v)&&ae(d,"computed:update",{signal:o,oldValue:u,newValue:o._v})};o._validate=g;let h=()=>{let{error:u}=a;throw a=void 0,s&&(o._d=!1),u};function m(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Sr()||s?(o._d&&(g(),a!==void 0&&h()),o._v):(o._d&&(g(),a!==void 0&&(Pe(o),h())),Pe(o),o._v)}return n&&(m.__name=n,o.__name=n),m.__signal=o,m.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,De(l);let u=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(u)try{u.emit("computed:destroy",{signal:o,getter:m})}catch{}},d&&ae(d,"computed:create",{signal:o,name:n,getter:m}),m}function wc(e){let[t,n]=_(e);return{get current(){return t()},set current(r){n(r)}}}function wo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Tc(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(l=>{let[c,d]=_(e[l]);wo(t,l,[c,d])});let n=new Proxy({},{get(l,c){if(typeof c=="string"&&Object.hasOwn(t,c)){let d=t[c][0];return d()}return Reflect.get(l,c)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let l={};return Object.keys(t).forEach(c=>{wo(l,c,t[c][0]())}),l};return[n,{setState:l=>{let c=r(),d=typeof l=="function"?l(c):l;z(()=>{Object.entries(d).forEach(([g,h])=>{Object.hasOwn(t,g)&&t[g][1](h)})})},reset:()=>{z(()=>{Object.keys(e).forEach(l=>{let c=t[l][1];c(e[l])})})},subscribe:l=>{let c=!0;return Z(()=>{let d=r();if(c){c=!1;return}Me();try{l(d)}finally{Oe()}})},subscribeKey:(l,c)=>{let d,g=!0;return Z(()=>{let h=t[l][0]();if(g){d=h,g=!1;return}if(!Object.is(h,d)){let m=d;d=h,Me();try{c(h,m)}finally{Oe()}}})},getSnapshot:r}]}function Ec(e,t){if(fe())return()=>{};let n,r=!0;return se(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Me();try{t(s,a)}finally{Oe()}}})}function kc(e,t,n){return[Fe(e,n),i=>{z(()=>t(i))}]}function Cc(e){let t=e();return me()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function Ac(e){if(!me())return Z(e);let t=Z(e),n=null;return queueMicrotask(()=>{try{n=Z(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function To(e,t){return fe()?()=>{}:G(e,t)}var Cn="data-sibu-enhanced",An=new WeakMap;function Eo(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=he){let i=r.length-o+e.length;e.length=0,Te(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var ko=["text","attr","class","show","on","cleanup"];function Co(e,t){if(t==null)return e;if(typeof t!="string")return t;let n=t.startsWith("@")?`[data-ref="${t.slice(1)}"]`:t;try{return e.querySelector(n)}catch{return null}}function lt(e,t){return To(t,e)}function _c(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,t=>t.value):e.value}function Nc(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!t;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(t)?t.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let n=t==null?"":String(t);e.value!==n&&(e.value=n)}function Rc(e,t,n,r){let o=`ctx.each[${r}]`;if(me())for(let i of Object.keys(n))ko.includes(i),`${o}${i}${ko.join(", ")}`;if(n.text!==void 0&&(n.text,`${o}`,e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];`${o}${i}`,e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];`${o}${i}`,e.classed(t,i,s)}if(n.show!==void 0&&(n.show,`${o}`,e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];`${o}${String(i)}`,e.on(t,i,s)}n.cleanup!==void 0&&(n.cleanup,`${o}`,e.cleanup(n.cleanup))}function Rt(e,t){let n=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!n)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(n.getAttribute(Cn)==="true")return me()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=h=>s?!0:!1,l=(h,m,u)=>{if(a(h))return;let f=Co(n,m);if(!f){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(m)} not found under`,n);return}u(f)},c={root:n,ref:h=>Co(n,h),refs:h=>{let m=h.startsWith("@")?`[data-ref="${h.slice(1)}"]`:h;try{return Array.from(n.querySelectorAll(m))}catch{return[]}},on:(h,m,u,f)=>{l("on",h,b=>{let y=S=>u(S,b);b.addEventListener(m,y,f),r.push(()=>b.removeEventListener(m,y,f))})},text:(h,m)=>{l("text",h,u=>{r.push(lt(u,()=>{let f=m(),b=f==null?"":String(f);u.textContent!==b&&(u.textContent=b)}))})},attr:(h,m,u)=>{l("attr",h,f=>{r.push(lt(f,()=>{let b=u(),y=b==null?null:String(b);le(f,m,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(h,m,u)=>{l("classed",h,f=>{r.push(lt(f,()=>{f.classList.toggle(m,!!u())}))})},show:(h,m)=>{l("show",h,u=>{let f=u.hidden;r.push(lt(u,()=>{u.hidden=!m()})),r.push(()=>{u.hidden=f})})},model:(h,m,u)=>{l("model",h,f=>{let b=f,[y,S]=m,v=u?.event??(b instanceof HTMLSelectElement||b instanceof HTMLInputElement&&(b.type==="checkbox"||b.type==="radio")?"change":"input");r.push(lt(f,()=>{Nc(b,y())}));let x=()=>S(_c(b));b.addEventListener(v,x),r.push(()=>b.removeEventListener(v,x))})},each:(h,m)=>{if(a("each"))return;let u=typeof h=="string"?c.refs(h):Array.from(h);for(let f=0;f<u.length;f++){let b=u[f],y=m(b,f);y!=null&&Rc(c,b,y,f)}},cleanup:h=>{a("cleanup")||r.push(h)}},d;try{d=t(c);let h=d;if(h&&typeof h.then=="function")throw h.then(void 0,m=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(h){throw Eo(r,"enhance"),s=!0,h}typeof d=="function"&&r.push(d);let g=()=>{i||(i=!0,An.get(n)===o&&(An.delete(n),n.removeAttribute(Cn)),tt(n,g),Eo(r,"enhance"),s=!0)};return A(n,g),An.set(n,o),n.setAttribute(Cn,"true"),g}function Lc(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Rt(r,t))}catch(r){for(let o=n.length-1;o>=0;o--)try{n[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw n.length=0,r}return()=>{for(let r of n.splice(0))r()}}var Mc=/^[A-Za-z0-9_-]+$/,Ao=Symbol.for("sibujs.islands.lazy"),Lt=at(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Oc(e){return e[Ao]=!0,e}function Pc(e,t){if(!Mc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Lt.set(e,t)}function Dc(e){Lt.delete(e)}async function $c(e){if(typeof e=="function"&&e[Ao]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function Hc(e=typeof document<"u"?document:null,t={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let n=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!Lt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,l=()=>{if(a||o)return;a=!0;let d=Lt.get(s);d&&$c(d).then(g=>{if(!o){if(!g){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let h=Rt(i,g);if(o){h();return}r.push(h),i.setAttribute("data-sibu-hydrated","true")}catch(h){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,h)}}}).catch(g=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,g)})},c=i.getAttribute("data-sibu-load")||"load";n.push(Ic(c,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Ic(e,t,n,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(n);return()=>cancelIdleCallback(i)}let o=setTimeout(n,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(n),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),n())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(t),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),n()},s=()=>{for(let a of o)t.removeEventListener(a,i)};for(let a of o)t.addEventListener(a,i,{passive:!0});return s}case"media":{let o=t.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(n),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(n),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),n())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(n),()=>{}}}var Bc=new Set(["__proto__","constructor","prototype"]);function _n(e){return Bc.has(e)}function Mt(e){let t={};for(let n of Object.keys(e))_n(n)||(t[n]=e[n]);return t}function _o(e){return e}var Dp=1024*1024;function Vc(e){let[t,n]=_(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},l=se(()=>{i=e(),a()}),c=(()=>t());return c.dispose=()=>{o||(o=!0,l())},c}var No=16;function jc(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:No*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,No)}function Fc(){let[e,t]=_(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=l=>{s(),R(l,{phase:"async",name:"transition"})};jc(()=>{try{let l=At(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function zc(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var Ot={};On(Ot,{RenderProp:()=>eu,assertType:()=>lu,compose:()=>Qc,createGuard:()=>cu,createSlots:()=>nu,defineComponent:()=>ru,defineSlottedComponent:()=>ou,defineStrictComponent:()=>au,globalStore:()=>Yc,machine:()=>Wc,optimistic:()=>Uc,optimisticList:()=>Kc,persisted:()=>qc,timeline:()=>Gc,validateProps:()=>Oo,validators:()=>su,withBoundary:()=>tu,withDefaults:()=>Zc,withProps:()=>iu,withWrapper:()=>Xc});function Ze(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Wc(e){let[t,n]=_(e.initial),[r,o]=_(e.context||{}),i=e.initial,s=r(),a=[],l=!1;function c(){l=!0;try{for(;a.length>0;)d(a.shift())}catch(f){throw a.length=0,f}finally{l=!1}}function d(f){let b=Ze(e.states,i);if(!b?.on)return;let y=Ze(b.on,f);if(!y)return;let S,v,x;typeof y=="string"?S=y:(S=y.target,v=y.guard,x=y.action);let E=s;if(v&&!v(E))return;b.exit&&b.exit(E);let P=E;if(x){let q=x(E);P={...E,...Mt(q)}}i=S,s=P,z(()=>{x&&o(P),n(S)});let B=Ze(e.states,S);B?.entry&&B.entry(s)}function g(f){a.push(f),!l&&c()}let h=Ze(e.states,e.initial);if(h?.entry){l=!0;try{h.entry(s)}catch(f){throw a.length=0,f}finally{l=!1}a.length>0&&c()}function m(f){return t()===f}function u(f){let b=t(),y=Ze(e.states,b);if(!y?.on)return!1;let S=Ze(y.on,f);return S?typeof S=="string"?!0:S.guard?S.guard(r()):!0:!1}return{state:t,context:r,send:g,matches:m,can:u}}function qc(e,t,n={}){let r=(()=>{try{return n.session?typeof sessionStorage<"u"?sessionStorage:null:typeof localStorage<"u"?localStorage:null}catch{return null}})(),o=n.serialize||JSON.stringify,i=(y,S)=>_n(y)?void 0:S,s=n.deserialize||(y=>JSON.parse(y,i)),a=n.encrypt,l=n.decrypt,c=n.session?!1:n.syncTabs??!0,d=t;try{let y=r?r.getItem(e):null;if(y!==null){l&&(y=l(y));let S=s(y);d=n.validate&&!n.validate(S)?t:S}}catch{}let[g,h]=_(d),m=!1,u=Z(()=>{let y=g();if(!m)try{let S=o(y);a&&(S=a(S)),r?.setItem(e,S)}catch{}}),f=null;return c&&r&&typeof window<"u"&&(f=y=>{if(!(y.storageArea!==r||y.key!==e)){if(y.newValue===null){m=!0;try{h(t)}finally{m=!1}return}try{let S=y.newValue;l&&(S=l(S));let v=s(S);if(n.validate&&!n.validate(v))return;m=!0;try{h(v)}finally{m=!1}}catch{}}},window.addEventListener("storage",f)),Object.defineProperty(h,"dispose",{value:()=>{u(),f&&typeof window<"u"&&(window.removeEventListener("storage",f),f=null)},enumerable:!1,writable:!1,configurable:!1}),[g,h]}function Uc(e){let[t,n]=_(e),[r,o]=_(!1),i=0,s=0;async function a(l,c){let d=++s,g=t();n(l),i++,o(!0);try{let h=await c();s===d&&n(h)}catch{s===d&&n(g)}finally{i--,i<=0&&(i=0,o(!1))}}return{value:t,pending:r,update:a}}function Kc(e){let t=0,n=0,r=0,o=new Map,i=[];for(let N of e){let w={id:t++,key:n++,base:N,claims:[],visible:!0,refs:0};o.set(w.id,w),i.push(w.id)}function s(N){let w=N.claims;return w.length>0?w[w.length-1].value:N.base}function a(N,w){let L=N.claims;for(let k=L.length-1;k>=0;k--)if(L[k].opId<w)return L[k].value;return N.base}function l(N,w,L){let k={opId:w,value:L,settled:!1},C=N.claims,D=C.length;for(;D>0&&C[D-1].opId>w;)D--;return C.splice(D,0,k),k}function c(N,w){let L=N.claims.indexOf(w);L!==-1&&N.claims.splice(L,1)}function d(N){let w=N.claims,L=0;for(;L<w.length&&w[L].settled;)N.base=w[L].value,L++;L>0&&w.splice(0,L)}let[g,h]=_(i.map(N=>s(o.get(N)))),[m,u]=_(!1),f=0,b=new Set;function y(){let N=new Array(i.length);for(let w=0;w<i.length;w++)N[w]=s(o.get(i[w]));return N}function S(N){z(()=>{let w=!1;try{w=N()}finally{u(f>0),w&&h(y())}})}function v(N){let w=o.get(N);return!w||!w.visible?!1:(w.visible=!1,i=i.filter(L=>L!==N),!0)}function x(N){let w=[];for(let $ of N){let U=o.get($);!U||U.visible||b.has($)||w.push($)}if(w.length===0)return!1;let L=new Array(i.length+w.length),k=0,C=0,D=0;for(;k<i.length&&C<w.length;){let $=o.get(i[k]).key,U=o.get(w[C]).key;L[D++]=$<=U?i[k++]:w[C++]}for(;k<i.length;)L[D++]=i[k++];for(;C<w.length;)L[D++]=w[C++];for(let $ of w)o.get($).visible=!0;return i=L,!0}function E(N){for(let w of N){let L=o.get(w);L&&L.refs++}}function P(N){for(let w of N){let L=o.get(w);L&&(L.refs--,L.refs<=0&&!L.visible&&(o.delete(w),b.delete(w)))}}function B(N){if(P(N),f--,f<=0&&(f=0,b.clear(),o.size!==i.length))for(let[w,L]of o)L.visible||o.delete(w)}async function q(N,w){let L=++r,k={id:t++,key:n++,base:N,claims:[],visible:!1,refs:1},C=l(k,L,N);S(()=>(o.set(k.id,k),k.visible=!0,i=[...i,k.id],f++,!0));let D,$=!1;try{D=await w()}catch{$=!0}S(()=>{try{if($)return b.add(k.id),c(k,C),v(k.id);let U=s(k);return C.value=D,C.settled=!0,d(k),k.visible&&!Object.is(U,s(k))}finally{B([k.id])}})}async function pe(N,w){let L=++r,k=[];for(let D of i)N(a(o.get(D),L))&&k.push(D);S(()=>{if(E(k),f++,k.length===0)return!1;let D=new Set(k);for(let $ of k){let U=o.get($);U&&(U.visible=!1)}return i=i.filter($=>!D.has($)),!0});let C=!1;try{await w()}catch{C=!0}S(()=>{try{if(!C){for(let D of k)b.add(D);return!1}return x(k)}finally{B(k)}})}async function ct(N,w,L){let k=++r,C=[];for(let J of i){let W=o.get(J),te=a(W,k);N(te)&&C.push({row:W,nextValue:{...te,...w}})}let D=C.map(J=>J.row.id),$=[];S(()=>{E(D),f++;let J=!1;for(let W of C){let te=s(W.row);$.push(l(W.row,k,W.nextValue)),W.row.visible&&!Object.is(te,s(W.row))&&(J=!0)}return J});let U,Qe=!1;try{U=await L()}catch{Qe=!0}S(()=>{try{let J=!1;for(let W=0;W<$.length;W++){let te=C[W].row,T=$[W],K=s(te);Qe?c(te,T):(T.value=U,T.settled=!0),d(te),te.visible&&!Object.is(K,s(te))&&(J=!0)}return J}finally{B(D)}})}return{items:g,pending:m,add:q,remove:pe,update:ct}}function Gc(e,t=100){if(!Number.isSafeInteger(t)||t<1)throw new RangeError(`[timeline] maxHistory must be a positive safe integer, got ${t}`);let[n,r]=_([e]),[o,i]=_(0),s=Fe(()=>n()[o()]),a=Fe(()=>o()>0),l=Fe(()=>o()<n().length-1);function c(f){let b=s(),y=typeof f=="function"?f(b):f;if(Object.is(y,b))return;let S=n(),v=o(),x=S.slice(0,v+1);x.push(y),z(()=>{x.length>t?(x.shift(),r(x),i(x.length-1)):(r(x),i(v+1))})}function d(){a()&&i(o()-1)}function g(){l()&&i(o()+1)}function h(){z(()=>{r([e]),i(0)})}function m(f){let b=n();f>=0&&f<b.length&&i(f)}function u(){s.dispose(),a.dispose(),l.dispose()}return{value:s,set:c,undo:d,redo:g,canUndo:a,canRedo:l,history:n,index:o,reset:h,jumpTo:m,dispose:u}}var Lo=Promise.prototype.then;function Ro(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(Lo,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function Mo(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(u){return{promise:Promise.reject(u),failedEarly:!0,probe:f=>queueMicrotask(f)}}if(typeof t!="function")return null;let n,r,o=new Promise((u,f)=>{n=u,r=f}),i="invoking",s,a=[],l=u=>{if(i=u,u!=="invoking")for(let f of a.splice(0))f()},c=u=>{n(u),l("fulfilled")},d=u=>{r(u),l("rejected")},g=u=>{if(u===o){d(new TypeError("adopt: a thenable resolved to its own adoption"));return}if(u===null||typeof u!="object"&&typeof u!="function"){c(u);return}let f;try{f=u.then}catch(b){d(b);return}if(typeof f!="function"){c(u);return}h(u,f)},h=(u,f)=>{f===Lo?(s=u,l("native")):l("invoking"),queueMicrotask(()=>{let b=!1,y=v=>{b||(b=!0,g(v))},S=v=>{b||(b=!0,d(v))};try{Reflect.apply(f,u,[y,S])}catch(v){S(v)}!b&&i==="invoking"&&l("pending")})};return h(e,t),{promise:o,failedEarly:!1,probe:(u,f)=>{let b=()=>{i==="native"?Ro(s,u,f):(i==="rejected"?u:f)()};i==="native"?Ro(s,u,f):i==="invoking"?a.push(b):queueMicrotask(i==="rejected"?u:f)}}}function Jc(e){if(typeof structuredClone=="function")return structuredClone(e);let t=new WeakSet,n=r=>{if(r===null||typeof r!="object")return r;if(t.has(r))throw new Error("deepClone: circular reference");if(t.add(r),r instanceof Date)return new Date(r.getTime());if(r instanceof Map){let i=new Map;for(let[s,a]of r)i.set(n(s),n(a));return i}if(r instanceof Set){let i=new Set;for(let s of r)i.add(n(s));return i}if(Array.isArray(r))return r.map(n);let o={};for(let i of Object.keys(r))i!=="__proto__"&&(o[i]=n(r[i]));return o};return n(e)}function Yc(e){let t=Jc(e.state),[n,r]=_({...t}),o=new Map,i=e.middleware||[];function s(u){if(o.size!==0){for(let f of Array.from(o.values()))if(f.active)try{f.callback(u)}catch(b){R(b,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],l=!1;function c(u,f=!0){if(a.push(u),l)return;l=!0;let b,y=!1;try{let S=!0,v=0;for(;v<a.length;){let x=a[v];a[v++]=void 0;try{x()}catch(E){S&&f?(y=!0,b=E):R(E,{phase:"event",name:"globalStore(dispatch)"})}S=!1}}finally{a.length=0,l=!1}if(y)throw b}function d(u,f){let b=e.actions[u];if(!b)throw new Error(`Unknown action: ${String(u)}`);let y=()=>{let S=n(),v=b(S,f),x=Mt(v);r({...S,...x}),s(n())};c(()=>{if(i.length===0){y();return}let S=v=>{if(v>=i.length){y();return}let x=!1,E=!1,P=!0,B=()=>{if(E&&!x){!1,x=!0;return}if(x){!1;return}if(x=!0,P){S(v+1);return}let pe=()=>c(()=>S(v+1),!1);if(!q){pe();return}q.probe(()=>{E=!0,!1},pe)},q=null;try{q=Mo(i[v](n(),String(u),f,B))}catch(pe){throw E=!0,pe}finally{P=!1}q&&(q.failedEarly&&(E=!0),q.promise.then(void 0,pe=>{E=!0,R(pe,{phase:"async",name:"globalStore(middleware)"})}))};S(0)})}function g(u){return()=>u(n())}function h(u){let f=o.get(u);f||(f={callback:u,active:!0},o.set(u,f));let b=f;return()=>{o.get(u)===b&&(b.active=!1,o.delete(u))}}function m(){c(()=>{r({...t}),s(n())})}return{getState:n,select:g,dispatch:d,subscribe:h,reset:m}}function Xc(e,t){return n=>t(e,n)}function Zc(e,t){return n=>e({...t,...n})}function Qc(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function eu(e){return e.render(e.data())}function tu(e,t){return n=>{let r=document.createElement("div");r.setAttribute("data-sibu-boundary",e);try{let o=t(n);r.appendChild(o)}catch(o){let i=document.createElement("div");i.setAttribute("data-sibu-boundary-error",e),i.style.cssText="color: red; border: 1px solid red; padding: 8px; margin: 4px;",i.textContent=`[${e}] ${o instanceof Error?o.message:String(o)}`,r.appendChild(i)}return r}}function nu(e){return{renderSlot(t,n){let r=Object.hasOwn(e,t)?e[t]:void 0;if(r){let o=r();if(Array.isArray(o)){let i=document.createElement("div");i.style.display="contents";for(let s of o)i.appendChild(s);return i}return o}return n?n():null},hasSlot(t){return Object.hasOwn(e,t)}}}function ru(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function ou(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function iu(e,t){return n=>e(t(n))}var su={string:((e,t)=>typeof e=="string"||`${t} must be a string, got ${typeof e}`),number:((e,t)=>typeof e=="number"||`${t} must be a number, got ${typeof e}`),boolean:((e,t)=>typeof e=="boolean"||`${t} must be a boolean, got ${typeof e}`),function:((e,t)=>typeof e=="function"||`${t} must be a function, got ${typeof e}`),object:((e,t)=>typeof e=="object"&&e!==null||`${t} must be an object`),array:((e,t)=>Array.isArray(e)||`${t} must be an array`),required:((e,t)=>e!=null||`${t} is required`),oneOf:(...e)=>(t,n)=>e.includes(t)||`${n} must be one of: ${e.join(", ")}`,instanceOf:e=>(t,n)=>t instanceof e||`${n} must be an instance of ${e.name}`,arrayOf:e=>(t,n)=>{if(!Array.isArray(t))return`${n} must be an array`;for(let r=0;r<t.length;r++){let o=e(t[r],`${n}[${r}]`);if(o!==!0)return o}return!0},shape:e=>(t,n)=>{if(typeof t!="object"||t===null)return`${n} must be an object`;for(let[r,o]of Object.entries(e)){let i=o(t[r],`${n}.${r}`);if(i!==!0)return i}return!0},optional:e=>(t,n)=>t==null?!0:e(t,n),range:(e,t)=>(n,r)=>typeof n!="number"?`${r} must be a number`:n>=e&&n<=t||`${r} must be between ${e} and ${t}`,pattern:e=>(t,n)=>typeof t!="string"?`${n} must be a string`:e.test(t)||`${n} must match pattern ${e}`};function Oo(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(typeof o=="function")continue;let i=o.default;n[r]===void 0&&i!==void 0&&(n[r]=typeof i=="function"?i():i)}return n}function au(e){return t=>{let n=Oo(t,e.props);return e.setup(n)}}function lu(e,t,n){}function cu(e){return t=>e(t,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={...Ot,...Nn,patterns:Ot});})();
|
|
399
|
+
`,oo=!1;function nl(){!oo&&typeof document<"u"&&(document.head.appendChild(He({nodes:tl})),oo=!0)}function rl(e={}){nl();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?P({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[P({class:"sibu-loading-dots"},[z({class:"sibu-loading-dot"}),z({class:"sibu-loading-dot"}),z({class:"sibu-loading-dot"})]),t?z({class:"sibu-loading-text"},t):null]):P({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[P({class:"sibu-loading-spinner"}),t?z({class:"sibu-loading-text"},t):null])}var kn=Symbol.for("sibujs.actions.v1"),so=globalThis[kn]??(globalThis[kn]=new Map);function Qe(e,t){so.set(e,t)}function ao(e){return so.get(e)}function ol(e,t,n){let r=typeof t=="string"?ao(t):t;if(!r)throw new Error(`[SibuJS] No action registered under the name "${t}". Register it with registerAction() before applying it by name.`);let o=r(e,n);typeof o=="function"&&_(e,o)}var uo=(e,t)=>{let n=e.ownerDocument,r=o=>{let i=o.target;typeof i?.nodeType=="number"&&e.contains(i)||t()};return n.addEventListener("pointerdown",r,!0),()=>n.removeEventListener("pointerdown",r,!0)},io=["pointerup","pointerleave","pointercancel"],lo=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=u=>{let l=u.pointerId;r!==null&&l!==o||(i(),o=l,r=setTimeout(()=>{r=null,t.callback()},n))},a=u=>{r!==null&&u.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let u of io)e.addEventListener(u,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let u of io)e.removeEventListener(u,a)}},co=(e,t)=>{let n=o=>L(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},fo=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},po=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1],a=e.ownerDocument.activeElement;r.shiftKey&&a===i?(r.preventDefault(),s.focus()):!r.shiftKey&&a===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};Qe("clickOutside",uo);Qe("longPress",lo);Qe("copyOnClick",co);Qe("autoResize",fo);Qe("trapFocus",po);function Rt(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(n){return Promise.reject(n)}return typeof t!="function"?null:new Promise((n,r)=>{queueMicrotask(()=>{try{Reflect.apply(t,e,[n,r])}catch(o){r(o)}})})}var Fe=null;function il(e,t){try{let n=e(),r=Rt(n);return r&&r.then(void 0,o=>{t?t(o,"async"):Fe?Fe(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):Fe?Fe(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function sl(e,t){try{return await e()}catch(n){return t?t(n,"async"):Fe?Fe(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function al(e){Fe=e}function ul(e){let[t,n]=C(e),r=i=>{!!1||!de()||(`${i}`,void 0)};return{provide(i){r("provide");let s=t();return n(i),()=>n(s)},use(){return t},get(){return t()},set(i){r("set"),n(i)},withContext(i,s){r("withContext");let a=t();n(i);try{let u=s();return!1,u}finally{n(a)}}}}var _n=Symbol.for("sibujs.createId.v1"),Cn=globalThis[_n]??(globalThis[_n]={n:0});function mo(e="sibu"){let t=Fr();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(Cn.n++,`${e}-${Cn.n}`)}function go(){Cn.n=0}function ll(e,t){let n=typeof t=="function"?t():t;return _(n,K(()=>{n.style.display=e()?"":"none"},n)),n}function bo(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}function ho(e,t,n,r,o){let i=typeof n=="function"?n():n;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===n,u=r.has(s),l=!a&&!u;return r.add(s),u&&void 0,e.insertBefore(s,t.nextSibling),{node:s,owned:l}}function Lt(e,t){t&&V(e),e.parentNode?.removeChild(e)}function cl(e,t,n,r){te(),bo(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("when"),a=null,u,l=!1,c=!1,m=new WeakSet,h=!1,g=()=>{if(c)return;let f=e(),b=s.parentNode;if(!b||l&&Object.is(f,u))return;u=f;let y=a?at([a]):null;a?.parentNode&&(Lt(a,h),a=null);let S=f?t:o!==void 0?o:null,v=ce(()=>ho(b,s,S,m,"when"));a=v.node,h=v.owned,Ye(y,a?[a]:[],"when",i),l=!0},d=$e(g,s);return _(s,()=>{c=!0,d.stop(),a&&Lt(a,h),a=null}),l||queueMicrotask(X(()=>{!c&&!l&&s.parentNode&&d.run(g)})),s}function dl(e,t,n,r){te(),bo(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("match"),a=null,u,l=!1,c=!1,m=new WeakSet,h=!1,g=()=>{if(c)return;let f=String(e()),b=s.parentNode;if(!b||l&&f===u)return;u=f;let y=a?at([a]):null;a?.parentNode&&(Lt(a,h),a=null);let S=Object.hasOwn(t,f)?t[f]:o,v=ce(()=>ho(b,s,S??null,m,"match"));a=v.node,h=v.owned,Ye(y,a?[a]:[],"match",i),l=!0},d=$e(g,s);return _(s,()=>{c=!0,d.stop(),a&&Lt(a,h),a=null}),l||queueMicrotask(X(()=>{!c&&!l&&s.parentNode&&d.run(g)})),s}function ct(e,t){let n=globalThis;return n[e]??(n[e]=t())}var Mt=ct(Symbol.for("sibujs.components.registry.v1"),()=>new Map),yo=ct(Symbol.for("sibujs.components.registryVersion.v1"),()=>C(0));function vo(){let[e,t]=yo;t(ce(e)+1)}function fl(e,t){Mt.set(e,t),vo()}function pl(e){Mt.delete(e)&&vo()}function ml(e){let t=Mt.get(e);return t?t():P(`[Component "${e}" not found]`)}function gl(e){let t=P({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(yo[0](),a=Mt.get(s));let u=a??`missing:${s}`;if(u===r)return;let l=ce(()=>a?a():P(`[Component "${s}" not found]`));r=u,ee(t,l)}let i=K(o,t,!0);return _(t,i),t}function So(e){return typeof e=="function"?So(e()):e instanceof Node?e:document.createTextNode(String(e))}function bl(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let u=e[a],l=0,c=n.length;for(;l<c;){let m=l+c>>1;e[n[m]]<u?l=m+1:c=m}n[l]=a,r[a]=l>0?n[l-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function hl(e,t,n){n&&n.key,te();let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,u=0,l=new Map,c=new Map,m=[],h=[],g=[],d=0,f=[],b=[],y=new Uint8Array(0),S=new Map,v=[],x=[],T=new Map,D=!1,B=!1,U=!1,fe=n.key,ft=()=>{if(U)return;let O=e(),k=O.length,$=r.parentNode;if(!$)return;B||($.insertBefore(o,r.nextSibling),B=!0),b.length<k&&(b=new Array(k));for(let E=0;E<k;E++)b[E]=fe(O[E]);let F=b;f.length<k&&(f=new Array(k)),c.clear(),T.clear();for(let E=0;E<k;E++)!1,T.set(F[E],E);d=0;for(let E=0;E<k;E++){let Y=F[E],On=l.get(Y),rt;if(On!==void 0)rt=On,m[d]=rt,h[d]=O[E],g[d]=E,d++;else{let[Pn,jo]=C(O[E]),[Dn,Fo]=C(E),Ht;try{Me();try{Ht=So(t(Pn,Dn))}finally{Oe()}}catch(zo){let Wo=F[E];Ht=document.createComment(`each:error:${E}`),queueMicrotask(()=>{L(zo,{phase:"render",name:`each row (key="${String(Wo)}")`,node:r.parentNode?r:void 0})})}rt={node:Ht,item:Pn,setItem:jo,index:Dn,setIndex:Fo}}c.set(Y,rt),f[E]=rt.node}for(let[E,Y]of l)c.has(E)||(V(Y.node),Y.node.parentNode&&$.removeChild(Y.node));if(k===0){u=0;let E=l;l=c,c=E,D=!0,d=0;return}S.clear();for(let E=0;E<u;E++)S.set(a[E],E);v.length<k&&(v=new Array(k),x=new Array(k));let Ae=0;for(let E=0;E<k;E++){let Y=S.get(F[E]);Y!==void 0&&(v[Ae]=E,x[Ae]=Y,Ae++)}let ne=bl(x,Ae);y.length<k?y=new Uint8Array(k):y.fill(0,0,k);for(let E=0;E<ne.length;E++)y[v[ne[E]]]=1;let q=o;for(let E=k-1;E>=0;E--){let Y=f[E];y[E]||Y.nextSibling!==q&&$.insertBefore(Y,q),q=Y}let G=a===i?s:i;G.length<k&&(G.length=k);for(let E=0;E<k;E++)G[E]=F[E];a=G,u=k;let nt=l;l=c,c=nt,D=!0,A()};function A(){if(d===0)return;let O=d;d=0,W(()=>{for(let k=0;k<O;k++){let $=m[k];$.setItem(h[k]),$.setIndex(g[k]),m[k]=void 0,h[k]=void 0}})}let w=$e(ft),N=w.stop;return _(r,()=>{if(!U){U=!0,N();for(let O of l.values())V(O.node),O.node.parentNode?.removeChild(O.node);o.parentNode&&o.parentNode.removeChild(o),B=!1,l.clear(),c.clear(),T.clear(),S.clear(),u=0,m.length=0,h.length=0,g.length=0,d=0}}),D||queueMicrotask(X(()=>{!D&&!U&&r.parentNode&&w.run(ft)})),r}function yl(e){te();let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||xo(t,r);else xo(t,n);return t}function xo(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),_(n,ve(n,t));return}e.appendChild(document.createTextNode(String(t)))}var vl=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),wo=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),To=new WeakMap;function Sl(e){let t=e.length-1,n=e[0];for(let g=0;g<t;g++)n+=`\0${g}\0${e[g+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
400
|
+
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let g=r;r++;let d=0;for(;r<o&&n.charCodeAt(r)!==0;)d=d*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,d<0||d>=t?(r=g,-1):d}function a(){let g=r;for(;r<o;){let d=n.charCodeAt(r);if(d>=97&&d<=122||d>=65&&d<=90||d>=48&&d<=57||d===45)r++;else break}return n.slice(g,r)}function u(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let g=s();if(g>=0)return{kind:"expr",idx:g};let d=n[r];if(d==='"'||d==="'"){r++;let f=[],b=[],y="";for(;r<o&&n[r]!==d;){let S=s();S>=0?(f.push(y),y="",b.push(S)):y+=n[r++]}return r<o&&r++,f.push(y),b.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:b}}{let f=[],b=[],y="";for(;r<o;){let S=n.charCodeAt(r);if(S===32||S===9||S===10||S===13||S===62)break;let v=s();v>=0?(f.push(y),y="",b.push(v)):y+=n[r++]}return f.push(y),b.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:b}}}function l(){let g=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let d=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let f=n.slice(d,r);if(!f)break;let b=u();f.startsWith("on:")?b.kind==="expr"&&g.push({t:3,name:f.slice(3),idx:b.idx}):b.kind==="bool"?g.push({t:4,name:f}):b.kind==="static"?g.push({t:0,name:f,value:b.value}):b.kind==="expr"?g.push({t:1,name:f,idx:b.idx}):b.kind==="mixed"&&g.push({t:2,name:f,statics:b.statics,exprs:b.exprs})}return g}function c(g){return g.replace(/\s+/g," ")}function m(g){let d="";for(;r<o&&n[r]!=="<";){let b=s();if(b>=0){let y=c(d);y&&g.push({t:1,value:y}),d="",g.push({t:2,idx:b})}else d+=n[r++]}let f=c(d);f&&g.push({t:1,value:f})}function h(){let g=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let d=n[r+1];if(d==="!"){if(n.startsWith("<!--",r)){let v=n.indexOf("-->",r+4);r=v===-1?o:v+3}else if(n.startsWith("<![CDATA[",r)){let v=n.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=n.indexOf(">",r);r=v===-1?o:v+1}continue}if(d==="?"){let v=n.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(d>="a"&&d<="z")&&!(d>="A"&&d<="Z")){g.push({t:1,value:"<"}),r++;continue}r++;let f=a(),b=l();i();let y=vl.has(f),S=n[r]==="/";if(S&&r++,r<o&&r++,y||S)g.push({t:0,el:{tag:f,svg:wo.has(f),attrs:b,children:[]}});else{let v=h();if(tr(f)){for(let x=0;x<v.length;x++)if(v[x].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${f}> (raw-text context). Build the content separately and append it as a Node.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),g.push({t:0,el:{tag:f,svg:wo.has(f),attrs:b,children:v}})}}else m(g);return g}return h()}function An(e,t){let n=e.svg?document.createElementNS(H,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:Yt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?_(n,st(n,i,s)):ue(n,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=t[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}ue(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):!1;break}case 4:Yt(n,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(An(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),_(n,ve(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Eo(e,...t){let n=To.get(e);return n||(n=Sl(e),To.set(e,n)),_o(n,t)}function ko(e,t){return _o(e,t)}function _o(e,t){if(te(),e.length===1&&e[0].t===0)return An(e[0].el,t);let n=document.createElement("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(An(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(i instanceof Node)n.appendChild(i);else if(typeof i=="function"){let s=document.createComment("bind:htm");n.appendChild(s),_(n,ve(s,i))}else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function xl(e,t,n){te();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&pe()&&void 0;let a,u=null,l=!1,c=!1,m=()=>{if(c)return;let d=e(),f=r.parentNode;if(!f||l&&d===a)return;u?.parentNode&&f.removeChild(u),a=d;let b=o.get(d);if(b){let y=i.indexOf(d);y!==-1&&(i.splice(y,1),i.push(d))}else{let y=t[d];if(!y){u=null,l=!0;return}if(b=y(),b.nodeType===11){let S=document.createElement("div");S.style.display="contents",S.appendChild(b),b=S}if(o.set(d,b),i.push(d),s>0&&i.length>s){let S=i.shift(),v=o.get(S);v&&(V(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(S))}}f.insertBefore(b,r.nextSibling),u=b,l=!0},h=$e(m),g=h.stop;return l||queueMicrotask(X(()=>{!l&&r.parentNode&&h.run(m)})),_(r,()=>{c=!0,g();for(let d of o.values())V(d),d.parentNode&&d.parentNode.removeChild(d);o.clear(),i.length=0,u=null}),r}function wl(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=c=>{if(c instanceof DocumentFragment){let m=document.createComment(""),h=document.createComment("");c.insertBefore(m,c.firstChild),c.appendChild(h),o={start:m,end:h}}t.appendChild(c)},s;typeof e=="function"?s=zn(()=>{let c=e();return i(c),c}):(s=e,i(s));let a=n()-r,u=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&ae(u,"app:init",{rootElement:s,container:t,duration:a});let l=o;return{node:s,unmount(){if(u&&ae(u,"app:unmount",{rootElement:s}),l){Tl(l.start,l.end);return}V(s),s.parentNode?.removeChild(s)}}}function Tl(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=be;for(let a=e.nextSibling;a&&a!==t;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==n||t.parentNode!==n?s=!1:(e.previousSibling!==o||t.nextSibling!==i)&&(o=e.previousSibling,i=t.nextSibling,s=!!(e.compareDocumentPosition(t)&4));let a=e.nextSibling;if(!s||a===t)break;if(r--<=0){we("mount",be,1);return}V(a),a.parentNode===n&&n.removeChild(a)}s||L(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function El(e,t){te();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=X(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{L(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),_(n,()=>{i=!0,o&&(V(o),o.remove(),o=null)}),n}function kl(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Co(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function _l(e=[]){let[t,n]=C([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let u=[...a];return s=Co(u,o,i),s.length===0&&i.length<=1?a:u}),s},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,u)=>u!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,u)=>u===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function Cl(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,je(r)||Ge(r)}function i(){if(Pe(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,...u){let l=Co(t,a,u);return(l.length>0||u.length>1)&&o(),l},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let u=t.findIndex(a);u!==-1&&(t.splice(u,1),o())},set(a){t=[...a],o()},update(a,u){a<0||a>=t.length||Object.is(t[a],u)||(t[a]=u,o())},updateWhere(a,u){let l=!1;for(let c=0;c<t.length;c++)if(a(t[c])){let m=u(t[c]);Object.is(t[c],m)||(t[c]=m,l=!0)}l&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let u=t.filter(a);u.length!==t.length&&(t=u,o())},map(a){let u=!1;for(let l=0;l<t.length;l++){let c=a(t[l],l);Object.is(t[l],c)||(t[l]=c,u=!0)}u&&o()},clear(){t.length!==0&&(t=[],o())}}]}function Al(e,t){let[n,r]=C(t),[o,i]=C(!1),[s,a]=C(null),[u,l]=C(0),c=0,m=!1,h=null,g=()=>{if(h===null)return;let f=h;h=null;try{f.abort()}catch{}},d=Q(()=>{if(u(),m)return;g();let f=++c,b=typeof AbortController<"u"?new AbortController:null;h=b,W(()=>{i(!0),a(null)});let y=()=>m||f!==c,S;try{S=e({signal:b?b.signal:void 0})}catch(v){if(y())return;W(()=>{a(v),i(!1)});return}S.then(v=>{y()||(h=null,W(()=>{r(v),i(!1)}))},v=>{y()||(h=null,W(()=>{a(v),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{m||l(f=>f+1)},dispose:()=>{m||(m=!0,d(),g())}}}function et(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let a=t;return e.source===a.source&&e.flags===a.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let a=t;if(e.size!==a.size)return!1;for(let[u,l]of e)if(!a.has(u)||!et(l,a.get(u),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let u of e)if(!a.has(u))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),u=new Uint8Array(t);if(a.length!==u.length)return!1;for(let l=0;l<a.length;l++)if(a[l]!==u[l])return!1;return!0}if(e instanceof DataView){if(!(t instanceof DataView)||e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==t.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let a=e,u=t;if(a.length!==u.length)return!1;for(let l=0;l<a.length;l++)if(a[l]!==u[l])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,u)=>et(a,t[u],n));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),t.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===t.href;if(e instanceof Error){let a=t;return e.name===a.name&&e.message===a.message&&et(e.cause,a.cause,n)&&Ao(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:Ao(r,o,n)}function Ao(e,t,n){let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(t,i)&&et(e[i],t[i],n))}function Nl(e){return C(e,{equals:(t,n)=>et(t,n)})}function ze(e,t){let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,u=()=>{o._d||s||(o._d=!0)};u._c=1,u._sig=o;let l=()=>{let d=e();o._v=r&&o._init&&r(o._v,d)?o._v:d,o._d=!1,o._init=!0};try{Ke(()=>{o._v=e(),o._d=!1,o._init=!0},u)}catch(d){throw s=!0,De(u),d}let c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,m=()=>{if(!o._d||s||a!==void 0)return;let d=o._v;i=!0;try{_e(l,u),Object.is(d,o._v)||o.__v++}catch(f){a={error:f},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&De(u)}c&&!s&&!Object.is(d,o._v)&&ae(c,"computed:update",{signal:o,oldValue:d,newValue:o._v})};o._validate=m;let h=()=>{let{error:d}=a;throw a=void 0,s&&(o._d=!1),d};function g(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return _r()||s?(o._d&&(m(),a!==void 0&&h()),o._v):(o._d&&(m(),a!==void 0&&(Pe(o),h())),Pe(o),o._v)}return n&&(g.__name=n,o.__name=n),g.__signal=o,g.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,De(u);let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(d)try{d.emit("computed:destroy",{signal:o,getter:g})}catch{}},c&&ae(c,"computed:create",{signal:o,name:n,getter:g}),g}function Rl(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function No(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ll(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(u=>{let[l,c]=C(e[u]);No(t,u,[l,c])});let n=new Proxy({},{get(u,l){if(typeof l=="string"&&Object.hasOwn(t,l)){let c=t[l][0];return c()}return Reflect.get(u,l)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let u={};return Object.keys(t).forEach(l=>{No(u,l,t[l][0]())}),u};return[n,{setState:u=>{let l=r(),c=typeof u=="function"?u(l):u;W(()=>{Object.entries(c).forEach(([m,h])=>{Object.hasOwn(t,m)&&t[m][1](h)})})},reset:()=>{W(()=>{Object.keys(e).forEach(u=>{let l=t[u][1];l(e[u])})})},subscribe:u=>{let l=!0;return Q(()=>{let c=r();if(l){l=!1;return}Me();try{u(c)}finally{Oe()}})},subscribeKey:(u,l)=>{let c,m=!0;return Q(()=>{let h=t[u][0]();if(m){c=h,m=!1;return}if(!Object.is(h,c)){let g=c;c=h,Me();try{l(h,g)}finally{Oe()}}})},getSnapshot:r}]}function Ml(e,t){if(de())return()=>{};let n,r=!0;return Ke(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Me();try{t(s,a)}finally{Oe()}}})}function Ol(e,t,n){return[ze(e,n),i=>{W(()=>t(i))}]}function Pl(e){let t=e();return pe()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function Dl(e){if(!pe())return Q(e);let t=Q(e),n=null;return queueMicrotask(()=>{try{n=Q(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Ro(e,t){return de()?()=>{}:K(e,t)}var Nn="data-sibu-enhanced",Rn=new WeakMap;function Lo(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=be){let i=r.length-o+e.length;e.length=0,we(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var Mo=["text","attr","class","show","on","cleanup"];function Oo(e,t){if(t==null)return e;if(typeof t!="string")return t;let n=t.startsWith("@")?`[data-ref="${t.slice(1)}"]`:t;try{return e.querySelector(n)}catch{return null}}function dt(e,t){return Ro(t,e)}function $l(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,t=>t.value):e.value}function Hl(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!t;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(t)?t.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let n=t==null?"":String(t);e.value!==n&&(e.value=n)}function Il(e,t,n,r){let o=`ctx.each[${r}]`;if(pe())for(let i of Object.keys(n))Mo.includes(i),`${o}${i}${Mo.join(", ")}`;if(n.text!==void 0&&(n.text,`${o}`,e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];`${o}${i}`,e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];`${o}${i}`,e.classed(t,i,s)}if(n.show!==void 0&&(n.show,`${o}`,e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];`${o}${String(i)}`,e.on(t,i,s)}n.cleanup!==void 0&&(n.cleanup,`${o}`,e.cleanup(n.cleanup))}function Ot(e,t){let n=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!n)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(n.getAttribute(Nn)==="true")return pe()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=h=>s?!0:!1,u=(h,g,d)=>{if(a(h))return;let f=Oo(n,g);if(!f){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(g)} not found under`,n);return}d(f)},l={root:n,ref:h=>Oo(n,h),refs:h=>{let g=h.startsWith("@")?`[data-ref="${h.slice(1)}"]`:h;try{return Array.from(n.querySelectorAll(g))}catch{return[]}},on:(h,g,d,f)=>{u("on",h,b=>{let y=S=>d(S,b);b.addEventListener(g,y,f),r.push(()=>b.removeEventListener(g,y,f))})},text:(h,g)=>{u("text",h,d=>{r.push(dt(d,()=>{let f=g(),b=f==null?"":String(f);d.textContent!==b&&(d.textContent=b)}))})},attr:(h,g,d)=>{u("attr",h,f=>{r.push(dt(f,()=>{let b=d(),y=b==null?null:String(b);ue(f,g,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(h,g,d)=>{u("classed",h,f=>{r.push(dt(f,()=>{f.classList.toggle(g,!!d())}))})},show:(h,g)=>{u("show",h,d=>{let f=d.hidden;r.push(dt(d,()=>{d.hidden=!g()})),r.push(()=>{d.hidden=f})})},model:(h,g,d)=>{u("model",h,f=>{let b=f,[y,S]=g,v=d?.event??(b instanceof HTMLSelectElement||b instanceof HTMLInputElement&&(b.type==="checkbox"||b.type==="radio")?"change":"input");r.push(dt(f,()=>{Hl(b,y())}));let x=()=>S($l(b));b.addEventListener(v,x),r.push(()=>b.removeEventListener(v,x))})},each:(h,g)=>{if(a("each"))return;let d=typeof h=="string"?l.refs(h):Array.from(h);for(let f=0;f<d.length;f++){let b=d[f],y=g(b,f);y!=null&&Il(l,b,y,f)}},cleanup:h=>{a("cleanup")||r.push(h)}},c;try{c=t(l);let h=c;if(h&&typeof h.then=="function")throw h.then(void 0,g=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(h){throw Lo(r,"enhance"),s=!0,h}typeof c=="function"&&r.push(c);let m=()=>{i||(i=!0,Rn.get(n)===o&&(Rn.delete(n),n.removeAttribute(Nn)),ot(n,m),Lo(r,"enhance"),s=!0)};return _(n,m),Rn.set(n,o),n.setAttribute(Nn,"true"),m}function Bl(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Ot(r,t))}catch(r){for(let o=n.length-1;o>=0;o--)try{n[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw n.length=0,r}return()=>{for(let r of n.splice(0))r()}}var Vl=/^[A-Za-z0-9_-]+$/,Po=Symbol.for("sibujs.islands.lazy"),Pt=ct(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function jl(e){return e[Po]=!0,e}function Fl(e,t){if(!Vl.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Pt.set(e,t)}function zl(e){Pt.delete(e)}async function Wl(e){if(typeof e=="function"&&e[Po]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function ql(e=typeof document<"u"?document:null,t={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let n=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!Pt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,u=()=>{if(a||o)return;a=!0;let c=Pt.get(s);c&&Wl(c).then(m=>{if(!o){if(!m){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let h=Ot(i,m);if(o){h();return}r.push(h),i.setAttribute("data-sibu-hydrated","true")}catch(h){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,h)}}}).catch(m=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,m)})},l=i.getAttribute("data-sibu-load")||"load";n.push(Ul(l,i,u,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Ul(e,t,n,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(n);return()=>cancelIdleCallback(i)}let o=setTimeout(n,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(n),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),n())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(t),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),n()},s=()=>{for(let a of o)t.removeEventListener(a,i)};for(let a of o)t.addEventListener(a,i,{passive:!0});return s}case"media":{let o=t.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(n),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(n),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),n())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(n),()=>{}}}var Kl=new Set(["__proto__","constructor","prototype"]);function Ln(e){return Kl.has(e)}function Dt(e){let t={};for(let n of Object.keys(e))Ln(n)||(t[n]=e[n]);return t}function Do(e){return e}var zp=1024*1024;function Gl(e){let[t,n]=C(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},u=Ke(()=>{i=e(),a()}),l=(()=>t());return l.dispose=()=>{o||(o=!0,u())},l}var $o=16;function Jl(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:$o*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,$o)}function Yl(){let[e,t]=C(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=u=>{s(),L(u,{phase:"async",name:"transition"})};Jl(()=>{try{let u=Rt(o());u?u.then(s,a):s()}catch(u){a(u)}})}return{pending:e,start:r}}function Xl(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var $t={};$n($t,{RenderProp:()=>uc,assertType:()=>bc,compose:()=>ac,createGuard:()=>hc,createSlots:()=>cc,defineComponent:()=>dc,defineSlottedComponent:()=>fc,defineStrictComponent:()=>gc,globalStore:()=>oc,machine:()=>Zl,optimistic:()=>ec,optimisticList:()=>tc,persisted:()=>Ql,timeline:()=>nc,validateProps:()=>Vo,validators:()=>mc,withBoundary:()=>lc,withDefaults:()=>sc,withProps:()=>pc,withWrapper:()=>ic});function tt(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Zl(e){let[t,n]=C(e.initial),[r,o]=C(e.context||{}),i=e.initial,s=r(),a=[],u=!1;function l(){u=!0;try{for(;a.length>0;)c(a.shift())}catch(f){throw a.length=0,f}finally{u=!1}}function c(f){let b=tt(e.states,i);if(!b?.on)return;let y=tt(b.on,f);if(!y)return;let S,v,x;typeof y=="string"?S=y:(S=y.target,v=y.guard,x=y.action);let T=s;if(v&&!v(T))return;b.exit&&b.exit(T);let D=T;if(x){let U=x(T);D={...T,...Dt(U)}}i=S,s=D,W(()=>{x&&o(D),n(S)});let B=tt(e.states,S);B?.entry&&B.entry(s)}function m(f){a.push(f),!u&&l()}let h=tt(e.states,e.initial);if(h?.entry){u=!0;try{h.entry(s)}catch(f){throw a.length=0,f}finally{u=!1}a.length>0&&l()}function g(f){return t()===f}function d(f){let b=t(),y=tt(e.states,b);if(!y?.on)return!1;let S=tt(y.on,f);return S?typeof S=="string"?!0:S.guard?S.guard(r()):!0:!1}return{state:t,context:r,send:m,matches:g,can:d}}function Ql(e,t,n={}){let r=(()=>{try{return n.session?typeof sessionStorage<"u"?sessionStorage:null:typeof localStorage<"u"?localStorage:null}catch{return null}})(),o=n.serialize||JSON.stringify,i=(y,S)=>Ln(y)?void 0:S,s=n.deserialize||(y=>JSON.parse(y,i)),a=n.encrypt,u=n.decrypt,l=n.session?!1:n.syncTabs??!0,c=t;try{let y=r?r.getItem(e):null;if(y!==null){u&&(y=u(y));let S=s(y);c=n.validate&&!n.validate(S)?t:S}}catch{}let[m,h]=C(c),g=!1,d=Q(()=>{let y=m();if(!g)try{let S=o(y);a&&(S=a(S)),r?.setItem(e,S)}catch{}}),f=null;return l&&r&&typeof window<"u"&&(f=y=>{if(!(y.storageArea!==r||y.key!==e)){if(y.newValue===null){g=!0;try{h(t)}finally{g=!1}return}try{let S=y.newValue;u&&(S=u(S));let v=s(S);if(n.validate&&!n.validate(v))return;g=!0;try{h(v)}finally{g=!1}}catch{}}},window.addEventListener("storage",f)),Object.defineProperty(h,"dispose",{value:()=>{d(),f&&typeof window<"u"&&(window.removeEventListener("storage",f),f=null)},enumerable:!1,writable:!1,configurable:!1}),[m,h]}function ec(e){let[t,n]=C(e),[r,o]=C(!1),i=0,s=0;async function a(u,l){let c=++s,m=t();n(u),i++,o(!0);try{let h=await l();s===c&&n(h)}catch{s===c&&n(m)}finally{i--,i<=0&&(i=0,o(!1))}}return{value:t,pending:r,update:a}}function tc(e){let t=0,n=0,r=0,o=new Map,i=[];for(let A of e){let w={id:t++,key:n++,base:A,claims:[],visible:!0,refs:0};o.set(w.id,w),i.push(w.id)}function s(A){let w=A.claims;return w.length>0?w[w.length-1].value:A.base}function a(A,w){let N=A.claims;for(let R=N.length-1;R>=0;R--)if(N[R].opId<w)return N[R].value;return A.base}function u(A,w,N){let R={opId:w,value:N,settled:!1},O=A.claims,k=O.length;for(;k>0&&O[k-1].opId>w;)k--;return O.splice(k,0,R),R}function l(A,w){let N=A.claims.indexOf(w);N!==-1&&A.claims.splice(N,1)}function c(A){let w=A.claims,N=0;for(;N<w.length&&w[N].settled;)A.base=w[N].value,N++;N>0&&w.splice(0,N)}let[m,h]=C(i.map(A=>s(o.get(A)))),[g,d]=C(!1),f=0,b=new Set;function y(){let A=new Array(i.length);for(let w=0;w<i.length;w++)A[w]=s(o.get(i[w]));return A}function S(A){W(()=>{let w=!1;try{w=A()}finally{d(f>0),w&&h(y())}})}function v(A){let w=o.get(A);return!w||!w.visible?!1:(w.visible=!1,i=i.filter(N=>N!==A),!0)}function x(A){let w=[];for(let $ of A){let F=o.get($);!F||F.visible||b.has($)||w.push($)}if(w.length===0)return!1;let N=new Array(i.length+w.length),R=0,O=0,k=0;for(;R<i.length&&O<w.length;){let $=o.get(i[R]).key,F=o.get(w[O]).key;N[k++]=$<=F?i[R++]:w[O++]}for(;R<i.length;)N[k++]=i[R++];for(;O<w.length;)N[k++]=w[O++];for(let $ of w)o.get($).visible=!0;return i=N,!0}function T(A){for(let w of A){let N=o.get(w);N&&N.refs++}}function D(A){for(let w of A){let N=o.get(w);N&&(N.refs--,N.refs<=0&&!N.visible&&(o.delete(w),b.delete(w)))}}function B(A){if(D(A),f--,f<=0&&(f=0,b.clear(),o.size!==i.length))for(let[w,N]of o)N.visible||o.delete(w)}async function U(A,w){let N=++r,R={id:t++,key:n++,base:A,claims:[],visible:!1,refs:1},O=u(R,N,A);S(()=>(o.set(R.id,R),R.visible=!0,i=[...i,R.id],f++,!0));let k,$=!1;try{k=await w()}catch{$=!0}S(()=>{try{if($)return b.add(R.id),l(R,O),v(R.id);let F=s(R);return O.value=k,O.settled=!0,c(R),R.visible&&!Object.is(F,s(R))}finally{B([R.id])}})}async function fe(A,w){let N=++r,R=[];for(let k of i)A(a(o.get(k),N))&&R.push(k);S(()=>{if(T(R),f++,R.length===0)return!1;let k=new Set(R);for(let $ of R){let F=o.get($);F&&(F.visible=!1)}return i=i.filter($=>!k.has($)),!0});let O=!1;try{await w()}catch{O=!0}S(()=>{try{if(!O){for(let k of R)b.add(k);return!1}return x(R)}finally{B(R)}})}async function ft(A,w,N){let R=++r,O=[];for(let ne of i){let q=o.get(ne),G=a(q,R);A(G)&&O.push({row:q,nextValue:{...G,...w}})}let k=O.map(ne=>ne.row.id),$=[];S(()=>{T(k),f++;let ne=!1;for(let q of O){let G=s(q.row);$.push(u(q.row,R,q.nextValue)),q.row.visible&&!Object.is(G,s(q.row))&&(ne=!0)}return ne});let F,Ae=!1;try{F=await N()}catch{Ae=!0}S(()=>{try{let ne=!1;for(let q=0;q<$.length;q++){let G=O[q].row,nt=$[q],E=s(G);Ae?l(G,nt):(nt.value=F,nt.settled=!0),c(G),G.visible&&!Object.is(E,s(G))&&(ne=!0)}return ne}finally{B(k)}})}return{items:m,pending:g,add:U,remove:fe,update:ft}}function nc(e,t=100){if(!Number.isSafeInteger(t)||t<1)throw new RangeError(`[timeline] maxHistory must be a positive safe integer, got ${t}`);let[n,r]=C([e]),[o,i]=C(0),s=ze(()=>n()[o()]),a=ze(()=>o()>0),u=ze(()=>o()<n().length-1);function l(f){let b=s(),y=typeof f=="function"?f(b):f;if(Object.is(y,b))return;let S=n(),v=o(),x=S.slice(0,v+1);x.push(y),W(()=>{x.length>t?(x.shift(),r(x),i(x.length-1)):(r(x),i(v+1))})}function c(){a()&&i(o()-1)}function m(){u()&&i(o()+1)}function h(){W(()=>{r([e]),i(0)})}function g(f){let b=n();f>=0&&f<b.length&&i(f)}function d(){s.dispose(),a.dispose(),u.dispose()}return{value:s,set:l,undo:c,redo:m,canUndo:a,canRedo:u,history:n,index:o,reset:h,jumpTo:g,dispose:d}}var Io=Promise.prototype.then;function Ho(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(Io,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function Bo(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(d){return{promise:Promise.reject(d),failedEarly:!0,probe:f=>queueMicrotask(f)}}if(typeof t!="function")return null;let n,r,o=new Promise((d,f)=>{n=d,r=f}),i="invoking",s,a=[],u=d=>{if(i=d,d!=="invoking")for(let f of a.splice(0))f()},l=d=>{n(d),u("fulfilled")},c=d=>{r(d),u("rejected")},m=d=>{if(d===o){c(new TypeError("adopt: a thenable resolved to its own adoption"));return}if(d===null||typeof d!="object"&&typeof d!="function"){l(d);return}let f;try{f=d.then}catch(b){c(b);return}if(typeof f!="function"){l(d);return}h(d,f)},h=(d,f)=>{f===Io?(s=d,u("native")):u("invoking"),queueMicrotask(()=>{let b=!1,y=v=>{b||(b=!0,m(v))},S=v=>{b||(b=!0,c(v))};try{Reflect.apply(f,d,[y,S])}catch(v){S(v)}!b&&i==="invoking"&&u("pending")})};return h(e,t),{promise:o,failedEarly:!1,probe:(d,f)=>{let b=()=>{i==="native"?Ho(s,d,f):(i==="rejected"?d:f)()};i==="native"?Ho(s,d,f):i==="invoking"?a.push(b):queueMicrotask(i==="rejected"?d:f)}}}function rc(e){if(typeof structuredClone=="function")return structuredClone(e);let t=new WeakSet,n=r=>{if(r===null||typeof r!="object")return r;if(t.has(r))throw new Error("deepClone: circular reference");if(t.add(r),r instanceof Date)return new Date(r.getTime());if(r instanceof Map){let i=new Map;for(let[s,a]of r)i.set(n(s),n(a));return i}if(r instanceof Set){let i=new Set;for(let s of r)i.add(n(s));return i}if(Array.isArray(r))return r.map(n);let o={};for(let i of Object.keys(r))i!=="__proto__"&&(o[i]=n(r[i]));return o};return n(e)}function oc(e){let t=rc(e.state),[n,r]=C({...t}),o=new Map,i=e.middleware||[];function s(d){if(o.size!==0){for(let f of Array.from(o.values()))if(f.active)try{f.callback(d)}catch(b){L(b,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],u=!1;function l(d,f=!0){if(a.push(d),u)return;u=!0;let b,y=!1;try{let S=!0,v=0;for(;v<a.length;){let x=a[v];a[v++]=void 0;try{x()}catch(T){S&&f?(y=!0,b=T):L(T,{phase:"event",name:"globalStore(dispatch)"})}S=!1}}finally{a.length=0,u=!1}if(y)throw b}function c(d,f){let b=e.actions[d];if(!b)throw new Error(`Unknown action: ${String(d)}`);let y=()=>{let S=n(),v=b(S,f),x=Dt(v);r({...S,...x}),s(n())};l(()=>{if(i.length===0){y();return}let S=v=>{if(v>=i.length){y();return}let x=!1,T=!1,D=!0,B=()=>{if(T&&!x){!1,x=!0;return}if(x){!1;return}if(x=!0,D){S(v+1);return}let fe=()=>l(()=>S(v+1),!1);if(!U){fe();return}U.probe(()=>{T=!0,!1},fe)},U=null;try{U=Bo(i[v](n(),String(d),f,B))}catch(fe){throw T=!0,fe}finally{D=!1}U&&(U.failedEarly&&(T=!0),U.promise.then(void 0,fe=>{T=!0,L(fe,{phase:"async",name:"globalStore(middleware)"})}))};S(0)})}function m(d){return()=>d(n())}function h(d){let f=o.get(d);f||(f={callback:d,active:!0},o.set(d,f));let b=f;return()=>{o.get(d)===b&&(b.active=!1,o.delete(d))}}function g(){l(()=>{r({...t}),s(n())})}return{getState:n,select:m,dispatch:c,subscribe:h,reset:g}}function ic(e,t){return n=>t(e,n)}function sc(e,t){return n=>e({...t,...n})}function ac(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function uc(e){return e.render(e.data())}function lc(e,t){return n=>{let r=document.createElement("div");r.setAttribute("data-sibu-boundary",e);try{let o=t(n);r.appendChild(o)}catch(o){let i=document.createElement("div");i.setAttribute("data-sibu-boundary-error",e),i.style.cssText="color: red; border: 1px solid red; padding: 8px; margin: 4px;",i.textContent=`[${e}] ${o instanceof Error?o.message:String(o)}`,r.appendChild(i)}return r}}function cc(e){return{renderSlot(t,n){let r=Object.hasOwn(e,t)?e[t]:void 0;if(r){let o=r();if(Array.isArray(o)){let i=document.createElement("div");i.style.display="contents";for(let s of o)i.appendChild(s);return i}return o}return n?n():null},hasSlot(t){return Object.hasOwn(e,t)}}}function dc(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function fc(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function pc(e,t){return n=>e(t(n))}var mc={string:((e,t)=>typeof e=="string"||`${t} must be a string, got ${typeof e}`),number:((e,t)=>typeof e=="number"||`${t} must be a number, got ${typeof e}`),boolean:((e,t)=>typeof e=="boolean"||`${t} must be a boolean, got ${typeof e}`),function:((e,t)=>typeof e=="function"||`${t} must be a function, got ${typeof e}`),object:((e,t)=>typeof e=="object"&&e!==null||`${t} must be an object`),array:((e,t)=>Array.isArray(e)||`${t} must be an array`),required:((e,t)=>e!=null||`${t} is required`),oneOf:(...e)=>(t,n)=>e.includes(t)||`${n} must be one of: ${e.join(", ")}`,instanceOf:e=>(t,n)=>t instanceof e||`${n} must be an instance of ${e.name}`,arrayOf:e=>(t,n)=>{if(!Array.isArray(t))return`${n} must be an array`;for(let r=0;r<t.length;r++){let o=e(t[r],`${n}[${r}]`);if(o!==!0)return o}return!0},shape:e=>(t,n)=>{if(typeof t!="object"||t===null)return`${n} must be an object`;for(let[r,o]of Object.entries(e)){let i=o(t[r],`${n}.${r}`);if(i!==!0)return i}return!0},optional:e=>(t,n)=>t==null?!0:e(t,n),range:(e,t)=>(n,r)=>typeof n!="number"?`${r} must be a number`:n>=e&&n<=t||`${r} must be between ${e} and ${t}`,pattern:e=>(t,n)=>typeof t!="string"?`${n} must be a string`:e.test(t)||`${n} must match pattern ${e}`};function Vo(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(typeof o=="function")continue;let i=o.default;n[r]===void 0&&i!==void 0&&(n[r]=typeof i=="function"?i():i)}return n}function gc(e){return t=>{let n=Vo(t,e.props);return e.setup(n)}}function bc(e,t,n){}function hc(e){return t=>e(t,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={...$t,...Mn,patterns:$t});})();
|