sibujs 4.9.0 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +41 -4
- package/dist/browser.js +4 -4
- package/dist/build.cjs +102 -38
- package/dist/build.js +10 -10
- package/dist/cdn.dev.global.js +14 -14
- package/dist/cdn.full.dev.global.js +13 -13
- package/dist/cdn.full.global.js +12 -12
- package/dist/cdn.global.js +15 -15
- package/dist/{chunk-FNOK662L.js → chunk-2NWHJ2UJ.js} +73 -43
- package/dist/{chunk-KG25XMGP.js → chunk-4DCVJ4YA.js} +15 -8
- package/dist/{chunk-CF2KCWRE.js → chunk-54F4TPHK.js} +2 -2
- package/dist/{chunk-X7NRHFZR.js → chunk-5PC7OTQW.js} +1 -1
- package/dist/{chunk-SBTZEYNI.js → chunk-7WIHYHWD.js} +8 -1
- package/dist/{chunk-K6K5ACO6.js → chunk-BMCR7TXG.js} +3 -3
- package/dist/{chunk-G2WHYEL7.js → chunk-D6HYFOWR.js} +39 -4
- package/dist/{chunk-5MLWTIQE.js → chunk-EVI4ZQO3.js} +2 -2
- package/dist/{chunk-CDBKFGXN.js → chunk-EVOK663Z.js} +1 -1
- package/dist/{chunk-SYHGGDNW.js → chunk-FYUEL5IW.js} +1 -1
- package/dist/{chunk-562UVHMM.js → chunk-GMMDHJJT.js} +11 -6
- package/dist/{chunk-FHCZMHHE.js → chunk-GOL3FU5Q.js} +1 -1
- package/dist/{chunk-YW6HQKGO.js → chunk-GTS35FLA.js} +2 -2
- package/dist/{chunk-2K3Z3XO4.js → chunk-IFRIBZ4O.js} +4 -4
- package/dist/{chunk-DRMLIF6M.js → chunk-IL5MMSCL.js} +19 -12
- package/dist/{chunk-XJVTQUIV.js → chunk-ITEL5KPL.js} +5 -5
- package/dist/{chunk-TV464N2M.js → chunk-JCKUWWHU.js} +3 -3
- package/dist/{chunk-QBKCK6MJ.js → chunk-N6U4GOIU.js} +1 -1
- package/dist/{chunk-NQMKWBKU.js → chunk-TOPRMXFY.js} +1 -1
- package/dist/{chunk-7OV5Q2UU.js → chunk-VWPMWV7O.js} +4 -4
- package/dist/{chunk-MPWDSTYK.js → chunk-XUQUQJYE.js} +1 -1
- package/dist/data.cjs +48 -6
- package/dist/data.d.cts +9 -1
- package/dist/data.d.ts +9 -1
- package/dist/data.js +5 -5
- package/dist/devtools.cjs +41 -4
- package/dist/devtools.js +4 -4
- package/dist/ecosystem.cjs +41 -4
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +75 -25
- package/dist/extras.js +20 -20
- package/dist/index.cjs +102 -38
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +10 -10
- package/dist/motion.cjs +36 -4
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +41 -4
- package/dist/patterns.js +5 -5
- package/dist/performance.cjs +55 -14
- package/dist/performance.js +4 -4
- package/dist/plugins.cjs +163 -51
- package/dist/plugins.d.cts +56 -2
- package/dist/plugins.d.ts +56 -2
- package/dist/plugins.js +130 -52
- package/dist/ssr.cjs +50 -9
- package/dist/ssr.js +7 -7
- package/dist/testing.cjs +41 -4
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +41 -4
- package/dist/ui.js +7 -7
- package/dist/widgets.cjs +36 -4
- package/dist/widgets.js +6 -6
- package/package.json +1 -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 $o=Object.defineProperty;var Pt=(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 Ln=(e,t)=>{for(var n in t)$o(e,n,{get:t[n],enumerable:!0})};var _n={};Ln(_n,{DynamicComponent:()=>iu,ErrorBoundary:()=>Wc,ErrorDisplay:()=>vn,Fragment:()=>cu,KeepAlive:()=>du,Loading:()=>Kc,MAX_DRAIN_TEARDOWNS:()=>be,Portal:()=>mu,SVG_NS:()=>I,Suspense:()=>Rr,__renderParsedTemplate:()=>bo,__resetIdCounter:()=>so,a:()=>Ts,abbr:()=>Es,action:()=>Jc,address:()=>as,area:()=>Gs,array:()=>bu,article:()=>ts,aside:()=>ss,asyncDerived:()=>yu,audio:()=>Ys,autoResize:()=>ro,b:()=>ks,base:()=>Wa,batch:()=>z,bdi:()=>Cs,bdo:()=>_s,bindDynamic:()=>wr,blockquote:()=>ps,body:()=>Xi,br:()=>As,button:()=>ot,canvas:()=>la,caption:()=>ga,catchError:()=>Gc,catchErrorAsync:()=>Yc,center:()=>pc,checkLeaks:()=>Bn,circle:()=>Ka,cite:()=>Ns,clickOutside:()=>eo,clipPath:()=>oc,code:()=>cn,col:()=>ba,colgroup:()=>ha,context:()=>Xc,copyOnClick:()=>no,createId:()=>io,customElement:()=>bc,data:()=>Rs,datalist:()=>ka,dd:()=>ms,deepEqual:()=>Ye,deepSignal:()=>vu,defer:()=>Hu,defs:()=>rc,del:()=>pa,derived:()=>je,details:()=>Ha,dfn:()=>Ls,dialog:()=>Ba,disableSSR:()=>Ir,dispose:()=>V,div:()=>O,dl:()=>gs,dt:()=>bs,each:()=>au,effect:()=>X,ellipse:()=>Ja,em:()=>Ms,embed:()=>ta,enableSSR:()=>$r,enhance:()=>Nt,enhanceAll:()=>Nu,enqueueBatchedSignal:()=>Be,external:()=>Dc,fieldset:()=>Ca,figcaption:()=>hs,figure:()=>ys,font:()=>mc,footer:()=>rs,form:()=>_a,g:()=>Ga,getAction:()=>Qr,getRequestScopedCache:()=>Dr,getRuntimeErrorHandler:()=>Pn,getSSRStore:()=>He,getSlot:()=>gu,h1:()=>cs,h2:()=>us,h3:()=>sn,h4:()=>ls,h5:()=>ds,h6:()=>fs,head:()=>Zi,header:()=>ns,hr:()=>vs,html:()=>go,i:()=>Os,iframe:()=>na,img:()=>Zs,input:()=>Aa,ins:()=>ma,isBatching:()=>Pc,isSSR:()=>de,kbd:()=>Ps,label:()=>Na,lazy:()=>Nr,lazyIsland:()=>Lu,legend:()=>Ra,li:()=>Ss,line:()=>Ya,linearGradient:()=>ac,link:()=>qa,longPress:()=>to,main:()=>is,map:()=>Xs,mark:()=>Ds,marker:()=>fc,marquee:()=>gc,mask:()=>ic,match:()=>tu,math:()=>ua,menu:()=>Va,meta:()=>Ua,meter:()=>La,mount:()=>fu,mountIslands:()=>Du,nav:()=>os,nextTick:()=>ju,noscript:()=>da,object:()=>ra,ol:()=>xs,on:()=>_c,onCleanup:()=>Ec,onMount:()=>Et,onUnmount:()=>Tc,optgroup:()=>Ma,option:()=>Oa,output:()=>Pa,p:()=>on,param:()=>oa,path:()=>Za,pattern:()=>sc,picture:()=>ia,polygon:()=>Xa,polyline:()=>Qa,portal:()=>sa,pre:()=>an,progress:()=>Da,q:()=>$s,radialGradient:()=>cc,reactiveArray:()=>hu,rect:()=>ec,ref:()=>Su,registerAction:()=>Ge,registerComponent:()=>nu,registerDisposer:()=>_,registerIsland:()=>Mu,replaceChildrenSafely:()=>Q,reportDrainRunaway:()=>we,reportError:()=>R,resolveComponent:()=>ou,retrack:()=>Ce,rp:()=>Is,rt:()=>Hs,ruby:()=>Bs,runInSSRContext:()=>Hr,s:()=>Vs,samp:()=>js,script:()=>fa,section:()=>es,select:()=>$a,setGlobalErrorHandler:()=>Zc,setMaxDrainIterations:()=>vr,setRuntimeErrorHandler:()=>On,show:()=>Qc,signal:()=>A,slot:()=>Fa,small:()=>Fs,source:()=>aa,span:()=>F,stop:()=>uc,store:()=>xu,strict:()=>Eu,strictEffect:()=>ku,strong:()=>zs,style:()=>De,sub:()=>Ws,summary:()=>ja,sup:()=>qs,svg:()=>ca,symbol:()=>dc,table:()=>ya,tagFactory:()=>p,takePendingError:()=>xt,tbody:()=>va,td:()=>Sa,template:()=>za,text:()=>tc,textarea:()=>Ia,tfoot:()=>xa,th:()=>wa,thead:()=>Ta,time:()=>Us,title:()=>Qi,tr:()=>Ea,track:()=>Qs,transition:()=>Vu,trapFocus:()=>oo,trustHTML:()=>Co,tspan:()=>nc,u:()=>Ks,ul:()=>ws,unregisterComponent:()=>ru,unregisterDisposer:()=>et,unregisterIsland:()=>Ou,untracked:()=>le,use:()=>lc,var_:()=>Js,video:()=>ea,watch:()=>wu,when:()=>eu,withSSR:()=>Br,writable:()=>Tu});var Mn=Symbol.for("sibujs.runtime-errors.v1");function Dt(){let e=globalThis,t=e[Mn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Mn]=n,n}function On(e){let t=Dt(),n=t.handler;return t.handler=e,n}function Pn(){return Dt().handler}function $t(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Io(e)}`;return new Error(t,{cause:e})}function Io(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 Ho(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Bo=Symbol.for("sibujs.reactive.v1");function Vo(e){let t=globalThis[Bo];return t?.untracked?t.untracked(e):e()}var jo="sibu:error-propagate";function Fo(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(jo,{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 Wo(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Ho(t)}: ${e.message}`,e)}function R(e,t){let n=$t(e);Vo(()=>{if(Fo(n,t))return;let r=Dt(),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--}}Wo(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 Ae=0;function ut(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var te=[];function Dn(){return ut(te[te.length-1])}function $n(e){return e===null&&te.length===0?!1:(te.push(ut(e)),!0)}function In(){te.pop()}function _(e,t){let n=me.get(e);n||(n=[],me.set(e,n)),n.push(t),!1;let r=ut(te[te.length-1]);r&&r.entries.push([e,t])}function Hn(e){let t={entries:[],closed:!1},n=t.entries;te.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,c]=n.pop();if(et(a,c)){s++;try{c()}catch(u){R(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,te.pop()}throw i}t.closed=!0,te.pop();let o=ut(te[te.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 et(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--)qo(n[r])}function qo(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){R(s,{phase:"cleanup",name:"disposer"})}}}}function Q(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 Bn(e=0){return 0}function Fe(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Uo=/[A-Z]/,Ko=/[A-Z]/g;function ne(e){return Uo.test(e)?e.replace(Ko,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 Jo=["http:","https:","mailto:","tel:","ftp:"],Go=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function dt(e){let t=Fe(e).trim();if(!t)return"";let n=e.replace(Go,"");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)&&Jo.indexOf(i)===-1?"":n}var Yo=/^\d+(\.\d+)?[wx]$/;function It(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function Zo(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(It(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!It(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let u="",d=!1;for(;r<o;){let g=t[r];if(d){u+=g,g===")"&&(d=!1),r++;continue}if(It(g)){u&&a.push(u),u="",r++;continue}if(g===","){r++;break}g==="("&&(d=!0),u+=g,r++}u&&a.push(u)}if(s===""||a.length>1||a.length===1&&!Yo.test(a[0]))continue;let c=dt(s);c&&(c.startsWith(",")||c.endsWith(",")||n.push(a.length===1?`${c} ${a[0]}`:c))}return n.join(", ")}var Xo=/[(:@\\]/;function Qo(e){return e===" "||e===" "||e===`
|
|
3
|
+
`||e==="\r"||e==="\f"}function Vn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function ei(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 dt(e){let t=0,n=e.length;for(;t<n&&_e(e[t]);)t++;for(;n>t&&_e(e[n-1]);)n--;return e.slice(t,n)}var ne=e=>({kind:"forbidden",reason:e});function ti(e){let t=dt(Ve(e));if(t==="")return ne("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return ne("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return ne("");for(;n<t.length&&_e(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return ne("");for(n++;n<t.length&&_e(t[n]);)n++;let o=n;for(;n<t.length&&!_e(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return ne("");for(;n<t.length&&_e(t[n]);)n++;if(t[n]!=="=")return ne("");for(n++;n<t.length&&_e(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return ne("");if(s=t.slice(n+1,u),dt(t.slice(u+1))!=="")return ne("")}else if(s=dt(t.slice(n)),/[;,]/.test(s))return ne("");if(s==="")return ne("");let l=lt(s);return l===""?ne(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function It(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=te(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?ne(""):typeof t!="string"?{kind:"not-refresh"}:dt(Ve(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:ti(n)}var ni="http://www.w3.org/1999/xhtml",ri="http://www.w3.org/2000/svg",oi=new Set(["script","iframe","object","embed","frame","frameset"]);function Vn(e){return te(e)}function jn(e){return oi.has(Vn(e))}var ii=new Set(["script","style"]);function Fn(e){return ii.has(Vn(e))}var H={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},si=new Set(["src","href","xlink:href","type","language"]),ai=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Ht=new WeakSet;function zn(e){return e.namespaceURI===ni||e.namespaceURI===null}function Wn(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 li(e){Ht.has(e)||(Ht.add(e),e.getAttribute("content")!==null&&It(Wn(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function ui(e,t,n,r){if(!zn(e))return H.None;let o=te(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&li(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return H.None;let i=It(Wn(e,o,n));return i.kind==="forbidden"?H.MetaRefreshForbidden:i.kind!=="not-refresh"&&Ht.has(e)?H.MetaRefreshReactive:H.None}function ci(e,t){if(t===null||te(e)!=="attributename")return H.None;let n=Ve(t);return In(n)||xe(n)||Xe(n)?H.AnimationTarget:H.None}var ft=new WeakSet;function Bn(e){if(e===null)return!1;let t=te(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 di(e,t,n,r){if(!zn(e))return H.None;let o=te(t);return o==="href"?r==="static"||n===null?H.None:Bn(e.getAttribute("rel"))?H.StylesheetSource:(ft.add(e),H.None):o==="rel"&&Bn(n)&&ft.has(e)&&e.hasAttribute("href")?H.StylesheetSource:H.None}function Bt(e,t,n,r){let o=e.localName;return o==="meta"?ui(e,t,n,r):o==="link"?di(e,t,n,r):o==="script"?r==="static"||n===null?H.None:si.has(te(t))?H.ScriptSource:H.None:ai.has(o)&&e.namespaceURI===ri?ci(t,n):H.None}function Vt(e,t,n){e.localName!=="link"||te(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?ft.add(e):ft.delete(e))}var fi="http://www.w3.org/1999/xhtml",pi="http://www.w3.org/2000/svg",mi="http://www.w3.org/1999/xlink",gi="http://www.w3.org/XML/1998/namespace",bi=new Set(["checked","disabled","selected"]);function hi(e){return e.namespaceURI===null||e.namespaceURI===fi}function Un(e,t,n){}function qn(e,t,n){e[t]=n}function yi(e,t){if(e.namespaceURI!==pi)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?mi:n.startsWith("xml:")?gi:null}function ie(e,t,n,r={}){let o=vi(e,t,n,r);return e.localName==="link"&&Vt(e,t,r.reactive?"reactive":"runtime"),o}function vi(e,t,n,r){let o=yi(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(xe(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Bt(e,t,s,r.reactive?"reactive":"runtime");if(a!==H.None)return Un(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(Xe(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let l=hi(e),u=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&&bi.has(u)&&u in e?qn(e,u,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&&(u==="value"||u==="checked")&&u in e)return qn(e,u,u==="checked"?!!n:d),!0;let g=d===""?"":Hn(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 jt(e,t,n){if(Xe(t))return!1,!1;let r=Bt(e,t,n,"static");return r!==H.None?(Un("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Vt(e,t,"static"),!0)}var Si=4096,Ft=[];function xi(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Ti(e,t,n){let r=Ft.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=xi();return o.sig=e,o.sub=t,o.epoch=n,o}function Kn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Ft.length<Si&&Ft.push(e)}function wi(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 Jn(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 Ei(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function ki(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 ae=null,ge=null,Te=0,we=[],se=new Set,Ci=[];function _i(e){try{e()}catch(t){let n=e;R(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Ai(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 pe=0,be=!1;function Wt(){pe===0&&(ge=ae,ae=null,be=!0),pe++}function qt(){pe--,pe===0&&(ae=ge,ge=null,be=!1)}function Gn(){return be}function Yn(e){Wt();try{return e()}finally{qt()}}var Ni=0;function Ut(e,t){let n=ae,r=0,o=null;be&&(r=pe,o=ge,pe=0,ge=null,be=!1),ae=t;let i=t;i._cap===void 0&&(i._cap=_n());let s=++Ni;i._epoch=s,i._structDirty=!1;for(let a=i.depsHead??null;a!==null;a=a.subNext){let l=a.sig;a.prevActive=l.__activeNode??null,l.__activeNode=a}try{e()}finally{ae=n,r!==0&&(pe=r,ge=o,be=!0);let a=i.depsHead??null;for(;a!==null;){let l=a.subNext,u=a.sig;u.__activeNode=a.prevActive,a.prevActive=null,a.epoch!==s&&(ki(a),Jn(a),Kn(a)),a=l}}}function Zn(e,t){if(!t)return Kt(e);je(t);let n=ae,r=0,o=null;be&&(r=pe,o=ge,pe=0,ge=null,be=!1),ae=t;try{e()}finally{ae=n,r!==0&&(pe=r,ge=o,be=!0);let s=t;for(let a=s.depsHead??null;a!==null;a=a.subNext){let l=a.sig;l.__activeNode=a.prevActive,a.prevActive=null}}let i=t;return i._dispose??(i._dispose=()=>je(t))}function Kt(e,t){let n=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{Ut(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,je(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,je(r)})}function Xn(e){if(!ae)return;let t=ae,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=Ti(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,Ei(t,i),wi(n,i),t._structDirty=!0}function je(e){let t=e,n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;Jn(n),Kn(n),n=r}}var pt=1e3,mt=1e6,gt=0,Ae=new Set;function Qn(e){let t=pt;return Number.isFinite(e)&&e>0&&(pt=Math.floor(e)),t}function er(e){let t=mt;return Number.isFinite(e)&&e>0&&(mt=Math.floor(e)),t}function Ri(e){let t=e;return t._runEpoch!==gt?(t._runEpoch=gt,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>pt)}function Li(e){let t=e.__name??"<unnamed>";R(new Error(`subscriber "${t}" fired more than ${pt} 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 Mi(){R(new Error(`Notification drain exceeded ${mt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function tr(){let e=0;for(;e<we.length;){if(e>=mt){Mi();break}let t=we[e++];if(se.delete(t),Ae.size>0&&Ae.has(t)||t._hasComputedDep===!0&&!Ai(t))continue;if(Ri(t)){Li(t),Ae.add(t);continue}let n=An(t._cap??null);try{_i(t)}finally{n&&Nn()}}}function nr(){if(!(Te>0)){Te++,gt++;try{tr()}finally{Te--,Te===0&&(we.length=0,se.clear(),Ae.size>0&&Ae.clear())}}}function zt(e){e();let t=e._sig;if(!t)return;let n=Ci,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 se.has(s)||(se.add(s),we.push(s));i=i.sigNext}}}function rr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?zt(r):se.has(r)||(se.add(r),we.push(r))),n=n.sigNext}}function or(e){let n=e.subsHead;if(n){if(Te>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?zt(o):se.has(o)||(se.add(o),we.push(o))),r=r.sigNext}return}Te++,gt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?zt(o):se.has(o)||(se.add(o),we.push(o))),r=r.sigNext}tr()}finally{Te--,Te===0&&(we.length=0,se.clear(),Ae.size>0&&Ae.clear())}}}function ir(e){return e.__sc??0}function sr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function ar(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var lr="4.9.0",ur=Symbol.for("sibujs.reactive.v1");function Di(){let e=globalThis,t=e[ur];if(t)return!1,t;let n={suspendTracking:Wt,resumeTracking:qt,isTrackingSuspended:Gn,untracked:Yn,retrack:Ut,track:Zn,reactiveBinding:Kt,recordDependency:Xn,cleanup:je,setMaxSubscriberRepeats:Qn,setMaxDrainIterations:er,drainNotificationQueue:nr,queueSignalNotification:rr,notifySubscribers:or,getSubscriberCount:ir,getSubscriberDeps:sr,forEachSubscriber:ar,version:lr};return e[ur]=n,n}var U=Di(),Ne=U.suspendTracking,Re=U.resumeTracking,cr=U.isTrackingSuspended,le=U.untracked,Ee=U.retrack,re=U.track,J=U.reactiveBinding,Le=U.recordDependency,Me=U.cleanup,mc=U.setMaxSubscriberRepeats,dr=U.setMaxDrainIterations,fr=U.drainNotificationQueue,pr=U.queueSignalNotification,Fe=U.notifySubscribers,gc=U.getSubscriberCount,bc=U.getSubscriberDeps,hc=U.forEachSubscriber;function Qe(e,t,n){if(xe(t))return ie(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){R(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}ie(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return J(r,e)}function mr(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),ie(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=J(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Jt=["data-focus-key","id","name"],Oi=new Set(["text","search","url","tel","password",""]);function $i(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Oi.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 et(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<Jt.length;i++){let s=t.getAttribute(Jt[i]);if(s){r=Jt[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...$i(t)}}function Ii(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Hi(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 gr(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 ze(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){gr(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=Hi(t,`[${e.attr}=${Ii(e.value)}]`);if(i&&i.tagName===e.tag){gr(i,e);return}o=s>1}}function he(e,t){let n=[];function r(){let o;try{o=t()}catch(d){R(d,{phase:"binding",name:"bindChildNode",node:e});return}let i=et(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,ze(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 u=e;for(let d=0;d<a.length;d++){let g=a[d];u.nextSibling!==g&&s.insertBefore(g,u.nextSibling),u=g}n=a,ze(i,a,"bindChildNode")}return J(r,e)}var I="http://www.w3.org/2000/svg",Bi=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Gt=new Set,br=100,hr=!1,yr=new Map;function vr(e){let t=yr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),yr.set(e,t)),t}function Vi(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=J(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",ct(String(a),{element:e}));return}let l=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let d in a){if(!Object.hasOwn(a,d))continue;let g=a[d];if(g==null)continue;let h=vr(d);u.push(h),l.setProperty(h,ut(h,String(g),{element:e}))}for(let d=0;d<o.length;d++)u.indexOf(o[d])===-1&&l.removeProperty(o[d]);o=u},e);_(e,s);return}if(typeof t=="string"){e.setAttribute("style",ct(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=vr(r);if(typeof o=="function"){let s=o,a=J(()=>{n.style.setProperty(i,ut(i,String(s()),{element:e}))},e);_(e,a)}else n.style.setProperty(i,ut(i,String(o),{element:e}))}}function ji(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=J(()=>{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=J(()=>{let a="";for(let l in n){if(!Object.hasOwn(n,l))continue;let u=n[l];(typeof u=="function"?u():u)&&(a=a?`${a} ${l}`:l)}e.setAttribute("class",a)},e);_(e,s)}else e.setAttribute("class",o)}function Yt(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,he(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,he(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,he(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=jn(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);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),Yt(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 Yt(i,r),i;let s=r,a=s.class;a!=null&&ji(i,a);let l=s.id;typeof l=="function"?_(i,Qe(i,"id",l)):l!=null&&(!1,i.id=l);let u=o!==void 0?o:s.nodes;u!=null&&Yt(i,u);let d=s.on;if(d)for(let m in d){if(!Object.hasOwn(d,m))continue;let c=d[m];typeof c=="function"?i.addEventListener(m,c):!1}let g=s.style;g!=null&&Vi(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 c=s[m];if(c==null||xe(m))continue;typeof c=="function"?_(i,Qe(i,m,c)):ie(i,m,c,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var Bc=p("html"),Fi=p("head"),zi=p("body"),Wi=p("title"),P=p("div"),j=p("span"),qi=p("section"),Ui=p("article"),Ki=p("header"),Ji=p("footer"),Gi=p("nav"),Yi=p("main"),Zi=p("aside"),Xi=p("address"),Zt=p("p"),Qi=p("h1"),es=p("h2"),Xt=p("h3"),ts=p("h4"),ns=p("h5"),rs=p("h6"),os=p("blockquote"),is=p("dd"),ss=p("dl"),as=p("dt"),ls=p("figcaption"),us=p("figure"),cs=p("hr"),ds=p("li"),fs=p("ol"),ps=p("ul"),Qt=p("pre"),ms=p("a"),gs=p("abbr"),bs=p("b"),hs=p("bdi"),ys=p("bdo"),vs=p("br"),Ss=p("cite"),en=p("code"),xs=p("data"),Ts=p("dfn"),ws=p("em"),Es=p("i"),ks=p("kbd"),Cs=p("mark"),_s=p("q"),As=p("rp"),Ns=p("rt"),Rs=p("ruby"),Ls=p("s"),Ms=p("samp"),Ps=p("small"),Ds=p("strong"),Os=p("sub"),$s=p("sup"),Is=p("time"),Hs=p("u"),Bs=p("var"),Vs=p("area"),js=p("audio"),Fs=p("img"),zs=p("map"),Ws=p("track"),qs=p("video"),Us=p("embed"),Ks=p("iframe"),Js=p("object"),Gs=p("param"),Ys=p("picture"),Zs=p("portal"),Xs=p("source"),Qs=p("svg",I),ea=p("math"),ta=p("canvas"),na=p("noscript"),ra=p("script"),oa=p("del"),ia=p("ins"),sa=p("caption"),aa=p("col"),la=p("colgroup"),ua=p("table"),ca=p("tbody"),da=p("td"),fa=p("tfoot"),pa=p("th"),ma=p("thead"),ga=p("tr"),tt=p("button"),ba=p("datalist"),ha=p("fieldset"),ya=p("form"),va=p("input"),Sa=p("label"),xa=p("legend"),Ta=p("meter"),wa=p("optgroup"),Ea=p("option"),ka=p("output"),Ca=p("progress"),_a=p("select"),Aa=p("textarea"),Na=p("details"),Ra=p("dialog"),La=p("menu"),Ma=p("summary"),Pa=p("slot"),Da=p("template"),Oa=p("base"),$a=p("link"),Ia=p("meta"),Pe=p("style"),Ha=p("circle",I),Ba=p("ellipse",I),Va=p("g",I),ja=p("line",I),Fa=p("path",I),za=p("polygon",I),Wa=p("polyline",I),qa=p("rect",I),Ua=p("text",I),Ka=p("tspan",I),Ja=p("defs",I),Ga=p("clipPath",I),Ya=p("mask",I),Za=p("pattern",I),Xa=p("linearGradient",I),Qa=p("radialGradient",I),el=p("stop",I),tl=p("use",I),nl=p("symbol",I),rl=p("marker",I),ol=p("center"),il=p("font"),sl=p("marquee"),al=e=>p(e);var tn="__sibuPendingError";function Sr(e,t){let n=()=>e.parentNode?(R(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[tn]=t)})}function bt(e){let t=e,n=t[tn];if(n instanceof Error)return delete t[tn],n}function xr(e){let t=null;return function(){if(t)return t();let r=P({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;t=i.default;let s=t();X(r,s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));X(r,P({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Sr(r,s)}),r.appendChild(j("sibu-lazy-loading","Loading...")),_(r,()=>{o=!0}),r}}function Tr({nodes:e,fallback:t}){let n=P({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null,s=null;return _(n,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!n.contains(s)&&V(s)}),queueMicrotask(()=>{if(!o)try{let a=e();if(s=a,a.classList.contains("sibu-lazy")){if(!a.querySelector(".sibu-lazy-loading")){X(n,a);return}i=new MutationObserver(()=>{if(o)return;a.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,X(n,a))}),i.observe(a,{childList:!0,subtree:!0})}else X(n,a)}catch(a){let l=a instanceof Error?a:new Error(String(a));Sr(n,l)}}),n}function yt(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";R(n,{phase:r,name:t});return}}function nn(e,t,n,r){let o=yt(e,t);typeof o=="function"&&(r()||!n.isConnected?yt(o,"onUnmount"):Er(o,n))}var We=new WeakMap,De=new WeakMap,ye=new Set,ve=new Set,qe=null,ht=0,ll=256;function rn(e){let t=We.get(e);if(t){We.delete(e),ye.delete(e);for(let n of t)try{n()}catch{}}}function on(e){De.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=De.get(e);if(n){De.delete(e),ve.delete(e);for(let r of n)try{r()}catch{}}})}function ul(e){if(ye.size===0||e.nodeType!==1)return;let t=e;if(ye.has(t)&&t.isConnected&&rn(t),t.firstElementChild)for(let n of Array.from(ye))n!==t&&n.isConnected&&t.contains(n)&&rn(n)}function cl(e){if(ve.size===0||e.nodeType!==1)return;let t=e;if(ve.has(t)&&!t.isConnected&&on(t),t.firstElementChild)for(let n of Array.from(ve))n!==t&&!n.isConnected&&t.contains(n)&&on(n)}function dl(){if(ye.size>0)for(let e of Array.from(ye))e.isConnected&&rn(e);if(ve.size>0)for(let e of Array.from(ve))e.isConnected||on(e)}function wr(){qe||typeof document>"u"||(qe=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++)ul(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)cl(t.removedNodes[n])}ht+=e.length,ht>=ll&&(ht=0,dl()),sn()}),qe.observe(document.body,{childList:!0,subtree:!0}))}function sn(){qe&&ye.size===0&&ve.size===0&&(qe.disconnect(),qe=null,ht=0)}function fl(e,t){let n=We.get(e);return n||(n=[],We.set(e,n)),n.push(t),ye.add(e),wr(),()=>{let r=We.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(We.delete(e),ye.delete(e))}sn()}}function pl(e,t){let n=De.get(e);return n||(n=[],De.set(e,n)),n.push(t),ve.add(e),wr(),()=>{let r=De.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(De.delete(e),ve.delete(e))}sn()}}function vt(e,t){if(!(typeof document>"u"))if(t){let n=!1,r=()=>n;if(_(t,()=>{n=!0}),t.isConnected){queueMicrotask(()=>{n||nn(e,"onMount",t,r)});return}queueMicrotask(()=>{if(n)return;if(t.isConnected){nn(e,"onMount",t,r);return}let o=fl(t,()=>{n||nn(e,"onMount",t,r)});_(t,o)})}else queueMicrotask(()=>{yt(e,"onMount")})}function Er(e,t){if(typeof document>"u")return;let n=!1,r=()=>{n||(n=!0,yt(e,"onUnmount"))};_(t,r);let o=()=>{if(n)return;let i=pl(t,r);_(t,i)};t.isConnected?o():vt(()=>{o()},t)}function ml(e,t){_(t,e)}function oe(e,t,n){try{e.emit(t,n)}catch{}}var an=Symbol.for("sibujs.ssr.v1");function gl(){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 Nt=="function"&&(t=Nt("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var ke=globalThis[an]??(globalThis[an]=gl()),Oe=ke.als,Y=ke.fallbackStore;ke.fallbackDepth??(ke.fallbackDepth=0);var kr=!1;function bl(){if(kr||Oe||!(typeof process<"u"&&!!process.versions?.node))return;kr=!0;let t=process.versions.node;`${t}`}function $e(){if(Oe){let e=Oe.getStore();if(e)return e}return Y}function Cr(){return Oe?Oe.getStore()??null:ke.fallbackDepth>0?Y:null}function ue(){return $e().ssr}function _r(e){if(!ue())return null;let t=$e(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function Ar(){$e().ssr=!0}function Nr(){$e().ssr=!1}function Rr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Oe)return Oe.run(t,e);bl();let n=Y.ssr,r=Y.suspenseIdCounter,o=Y.idCounter,i=Y.locale;Y.ssr=!0,Y.suspenseIdCounter=0,Y.idCounter=0,Y.locale=void 0,ke.fallbackDepth++;try{return e()}finally{ke.fallbackDepth--,Y.ssr=n,Y.suspenseIdCounter=r,Y.idCounter=o,Y.locale=i}}function Lr(e){let t=$e(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Dr=globalThis;function hl(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,le(()=>t(o,void 0));else{let i=n;n=o,le(()=>t(o,i))}}}var Mr=100;function St(e){let t=e.userCleanups;if(t.length!==0){e.userCleanups=[];for(let n=t.length-1;n>=0;n--)try{t[n]()}catch(r){R(r,{phase:"cleanup"})}}}function Pr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&St(e),Ee(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Mr);e.rerunPending&&(e.rerunPending=!1,R(new Error(`effect re-requested itself ${Mr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function yl(e){if(e.disposed)return;e.disposed=!0;let t=Dr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&St(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Me(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function Z(e,t){if(ue())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&&St(n),Ee(n.bodyFn,o),n.rerunPending&&Pr(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{Ee(n.bodyFn,n.subscriber),n.rerunPending&&Pr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&St(n),Me(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=Dr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&oe(i,"effect:create",{effectFn:e}),()=>yl(n)}var nt=0,ln=new Set;function vl(e){nt++;try{return e()}finally{nt--,nt===0&&Tl()}}function Sl(e){return nt===0?!1:(ln.add(e),!0)}function xl(){return nt>0}function Tl(){try{for(let e of ln)pr(e)}finally{ln.clear()}fr()}var Or=Symbol.for("sibujs.reactive.batch.v1");function wl(){let e=globalThis,t=e[Or];if(t)return t;let n={batch:vl,enqueueBatchedSignal:Sl,isBatching:xl};return e[Or]=n,n}var un=wl(),F=un.batch,Ie=un.enqueueBatchedSignal,El=un.isBatching;var cn=globalThis;function A(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 Le(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;if(!o(l,u)){if(n.value=u,n.__v++,!1){let d=cn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&oe(d,"signal:update",{signal:n,name:r,oldValue:l,newValue:u})}Ie(n)||Fe(n)}}:s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;Object.is(u,l)||(n.value=u,n.__v++,Ie(n)||Fe(n))},!1){let a=cn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&oe(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function kl(e){let[t,n]=A(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Cl=`
|
|
5
|
+
`?2:1;continue}if(Vn(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&Vn(e[s]);)i+=e[s],s++;s<e.length&&Qo(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
|
|
6
|
+
`?2:1);let a=Number.parseInt(i,16),c=a===0||a>1114111||a>=55296&&a<=57343;t+=c?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var jn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],ti=4,ni=5,ri=8;function oi(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 Ht=new Set,Fn=100,zn=!1;function lt(e,t,n){}function Wn(e){return(e.includes("\\")?ei(e):e).toLowerCase().replace(/\s+/g,"")}function Bt(e){if(!Xo.test(e))return-1;let t=Wn(e);for(let n=0;n<jn.length;n++)if(t.includes(jn[n]))return n;return-1}function ft(e,t,n){let r=Vt(e,t);return r===-1?t:(lt(t,r,{property:e,element:n?.element}),"")}function Vt(e,t){let n=Bt(t);if(n!==-1)return n;let r=ne(e);return r==="behavior"?ni:r==="-moz-binding"?ti:(r==="filter"||r==="-ms-filter")&&Wn(t).includes("progid:")?ri:-1}function ii(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 c=e.indexOf("*/",s+2);if(c===-1)return null;s=c+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 c=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(c))continue;let u=s.slice(a+1).trim(),d=/!\s*important\s*$/i.exec(u);if(d&&(u=u.slice(0,d.index).trim()),u==="")continue;let g=c.startsWith("--")?c:ne(c);i.push([g,u,d!==null])}return i}function si(e,t){let n=String(e),r=ii(n);if(r===null)return Bt(n)!==-1&<(n,Bt(n),t),"";let o=[];for(let[i,s,a]of r){let c=Vt(i,s);if(c!==-1){lt(s,c,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function pt(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return si(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),c=Vt(s,a);if(c!==-1){lt(a,c,{property:s,element:t?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var jt=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),ai=new Set(["srcdoc"]);function tt(e){return ai.has(e.toLowerCase())}function qn(e){return jt.has(e.toLowerCase())}function ci(e){let t=e.toLowerCase();return t==="style"||jt.has(t)}function ui(e,t,n){let r=e.toLowerCase();return r==="srcset"?Zo(t):jt.has(r)?dt(t):r==="style"?pt(t,n):t}function Un(e,t,n){if(!ci(e))return t;let r=ui(e,t,n);return r===""?null:r}function Ne(e){return e===" "||e===" "||e===`
|
|
7
|
+
`||e==="\r"||e==="\f"}function mt(e){let t=0,n=e.length;for(;t<n&&Ne(e[t]);)t++;for(;n>t&&Ne(e[n-1]);)n--;return e.slice(t,n)}var re=e=>({kind:"forbidden",reason:e});function li(e){let t=mt(Fe(e));if(t==="")return re("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return re("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return re("");for(;n<t.length&&Ne(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return re("");for(n++;n<t.length&&Ne(t[n]);)n++;let o=n;for(;n<t.length&&!Ne(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return re("");for(;n<t.length&&Ne(t[n]);)n++;if(t[n]!=="=")return re("");for(n++;n<t.length&&Ne(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return re("");if(s=t.slice(n+1,u),mt(t.slice(u+1))!=="")return re("")}else if(s=mt(t.slice(n)),/[;,]/.test(s))return re("");if(s==="")return re("");let c=dt(s);return c===""?re(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:c}}function Ft(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=ne(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?re(""):typeof t!="string"?{kind:"not-refresh"}:mt(Fe(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:li(n)}var di="http://www.w3.org/1999/xhtml",fi="http://www.w3.org/2000/svg",pi=new Set(["script","iframe","object","embed","frame","frameset"]);function Jn(e){return ne(e)}function Gn(e){return pi.has(Jn(e))}var mi=new Set(["script","style"]);function Yn(e){return mi.has(Jn(e))}var H={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},gi=new Set(["src","href","xlink:href","type","language"]),bi=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),zt=new WeakSet;function Zn(e){return e.namespaceURI===di||e.namespaceURI===null}function Xn(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 hi(e){zt.has(e)||(zt.add(e),e.getAttribute("content")!==null&&Ft(Xn(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function yi(e,t,n,r){if(!Zn(e))return H.None;let o=ne(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&hi(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return H.None;let i=Ft(Xn(e,o,n));return i.kind==="forbidden"?H.MetaRefreshForbidden:i.kind!=="not-refresh"&&zt.has(e)?H.MetaRefreshReactive:H.None}function vi(e,t){if(t===null||ne(e)!=="attributename")return H.None;let n=Fe(t);return qn(n)||Te(n)||tt(n)?H.AnimationTarget:H.None}var gt=new WeakSet;function Kn(e){if(e===null)return!1;let t=ne(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 Si(e,t,n,r){if(!Zn(e))return H.None;let o=ne(t);return o==="href"?r==="static"||n===null?H.None:Kn(e.getAttribute("rel"))?H.StylesheetSource:(gt.add(e),H.None):o==="rel"&&Kn(n)&>.has(e)&&e.hasAttribute("href")?H.StylesheetSource:H.None}function Wt(e,t,n,r){let o=e.localName;return o==="meta"?yi(e,t,n,r):o==="link"?Si(e,t,n,r):o==="script"?r==="static"||n===null?H.None:gi.has(ne(t))?H.ScriptSource:H.None:bi.has(o)&&e.namespaceURI===fi?vi(t,n):H.None}function qt(e,t,n){e.localName!=="link"||ne(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?gt.add(e):gt.delete(e))}var xi="http://www.w3.org/1999/xhtml",wi="http://www.w3.org/2000/svg",Ti="http://www.w3.org/1999/xlink",Ei="http://www.w3.org/XML/1998/namespace",ki=new Set(["checked","disabled","selected"]);function Ci(e){return e.namespaceURI===null||e.namespaceURI===xi}function er(e,t,n){}function Qn(e,t,n){e[t]=n}function _i(e,t){if(e.namespaceURI!==wi)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Ti:n.startsWith("xml:")?Ei:null}function ae(e,t,n,r={}){let o=Ai(e,t,n,r);return e.localName==="link"&&qt(e,t,r.reactive?"reactive":"runtime"),o}function Ai(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=Wt(e,t,s,r.reactive?"reactive":"runtime");if(a!==H.None)return er(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(tt(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let c=Ci(e),u=c?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 c&&ki.has(u)&&u in e?Qn(e,u,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&&c&&(u==="value"||u==="checked")&&u in e)return Qn(e,u,u==="checked"?!!n:d),!0;let g=d===""?"":Un(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 Ut(e,t,n){if(tt(t))return!1,!1;let r=Wt(e,t,n,"static");return r!==H.None?(er("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&qt(e,t,"static"),!0)}var Ni=4096,Kt=[];function Ri(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Li(e,t,n){let r=Kt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Ri();return o.sig=e,o.sub=t,o.epoch=n,o}function tr(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Kt.length<Ni&&Kt.push(e)}function Mi(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 nr(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 Oi(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function Pi(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,he=null,Ee=0,ke=[],ce=new Set,Di=[];function $i(e){try{e()}catch(t){let n=e;R(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Ii(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 Gt(){ge===0&&(he=ue,ue=null,ye=!0),ge++}function Yt(){ge--,ge===0&&(ue=he,he=null,ye=!1)}function rr(){return ye}function or(e){Gt();try{return e()}finally{Yt()}}var oe=null;function Zt(){return oe}function vt(e,t){let n=oe;oe=e;try{return t()}finally{oe=n}}function Xt(e){let t=oe;return t===null?e:(...n)=>vt(t,()=>e(...n))}var Hi=0;function Qt(e,t){let n=ue,r=0,o=null;ye&&(r=ge,o=he,ge=0,he=null,ye=!1),ue=t;let i=t;i._cap===void 0&&(i._cap=Dn());let s=oe;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(oe=a);let c=++Hi;i._epoch=c,i._structDirty=!1;for(let u=i.depsHead??null;u!==null;u=u.subNext){let d=u.sig;u.prevActive=d.__activeNode??null,d.__activeNode=u}try{e()}finally{ue=n,oe=s,r!==0&&(ge=r,he=o,ye=!0);let u=i.depsHead??null;for(;u!==null;){let d=u.subNext,g=u.sig;g.__activeNode=u.prevActive,u.prevActive=null,u.epoch!==c&&(Pi(u),nr(u),tr(u)),u=d}}}function ir(e,t){if(!t)return en(e);ze(t);let n=ue,r=0,o=null;ye&&(r=ge,o=he,ge=0,he=null,ye=!1),ue=t;let i=t;i._scope===void 0&&(i._scope=oe);let s=oe;oe=i._scope;try{e()}finally{ue=n,oe=s,r!==0&&(ge=r,he=o,ye=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let c=a.sig;c.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>ze(t))}function en(e,t){let n=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{Qt(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,ze(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,ze(r)})}function sr(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=Li(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,Oi(t,i),Mi(n,i),t._structDirty=!0}function ze(e){let t=e,n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;nr(n),tr(n),n=r}}var bt=1e3,ht=1e6,yt=0,Re=new Set;function ar(e){let t=bt;return Number.isFinite(e)&&e>0&&(bt=Math.floor(e)),t}function cr(e){let t=ht;return Number.isFinite(e)&&e>0&&(ht=Math.floor(e)),t}function Bi(e){let t=e;return t._runEpoch!==yt?(t._runEpoch=yt,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>bt)}function Vi(e){let t=e.__name??"<unnamed>";R(new Error(`subscriber "${t}" fired more than ${bt} 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 ji(){R(new Error(`Notification drain exceeded ${ht} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function ur(){let e=0;for(;e<ke.length;){if(e>=ht){ji();break}let t=ke[e++];if(ce.delete(t),Re.size>0&&Re.has(t)||t._hasComputedDep===!0&&!Ii(t))continue;if(Bi(t)){Vi(t),Re.add(t);continue}let n=$n(t._cap??null);try{$i(t)}finally{n&&In()}}}function lr(){if(!(Ee>0)){Ee++,yt++;try{ur()}finally{Ee--,Ee===0&&(ke.length=0,ce.clear(),Re.size>0&&Re.clear())}}}function Jt(e){e();let t=e._sig;if(!t)return;let n=Di,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),ke.push(s));i=i.sigNext}}}function dr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Jt(r):ce.has(r)||(ce.add(r),ke.push(r))),n=n.sigNext}}function fr(e){let n=e.subsHead;if(n){if(Ee>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Jt(o):ce.has(o)||(ce.add(o),ke.push(o))),r=r.sigNext}return}Ee++,yt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Jt(o):ce.has(o)||(ce.add(o),ke.push(o))),r=r.sigNext}ur()}finally{Ee--,Ee===0&&(ke.length=0,ce.clear(),Re.size>0&&Re.clear())}}}function pr(e){return e.__sc??0}function mr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function gr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var br="4.10.0",hr=Symbol.for("sibujs.reactive.v1");function zi(){let e=globalThis,t=e[hr];if(t)return!1,t;let n={suspendTracking:Gt,resumeTracking:Yt,isTrackingSuspended:rr,untracked:or,retrack:Qt,track:ir,reactiveBinding:en,recordDependency:sr,cleanup:ze,setMaxSubscriberRepeats:ar,setMaxDrainIterations:cr,drainNotificationQueue:lr,queueSignalNotification:dr,notifySubscribers:fr,getSubscriberCount:pr,getSubscriberDeps:mr,forEachSubscriber:gr,getOwnerScope:Zt,runWithOwnerScope:vt,bindOwnerScope:Xt,version:br};return e[hr]=n,n}var j=zi(),Le=j.suspendTracking,Me=j.resumeTracking,yr=j.isTrackingSuspended,le=j.untracked,Ce=j.retrack,ie=j.track,J=j.reactiveBinding,Oe=j.recordDependency,Pe=j.cleanup,El=j.setMaxSubscriberRepeats,vr=j.setMaxDrainIterations,Sr=j.drainNotificationQueue,xr=j.queueSignalNotification,We=j.notifySubscribers,kl=j.getSubscriberCount,Cl=j.getSubscriberDeps,_l=j.forEachSubscriber,qe=j.getOwnerScope??Zt,St=j.runWithOwnerScope??vt,Y=j.bindOwnerScope??Xt;function nt(e,t,n){if(Te(t))return ae(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){R(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}ae(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return J(r,e)}function wr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(c){R(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(c){R(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),ae(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=J(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var tn=["data-focus-key","id","name"],Wi=new Set(["text","search","url","tel","password",""]);function qi(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Wi.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 rt(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<tn.length;i++){let s=t.getAttribute(tn[i]);if(s){r=tn[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...qi(t)}}function Ui(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ki(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 c=0;c<a.length;c++)r++,n??(n=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function Tr(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 Ue(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){Tr(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=Ki(t,`[${e.attr}=${Ui(e.value)}]`);if(i&&i.tagName===e.tag){Tr(i,e);return}o=s>1}}function ve(e,t){let n=[];function r(){let o;try{o=t()}catch(d){R(d,{phase:"binding",name:"bindChildNode",node:e});return}let i=rt(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,Ue(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 c;if(n.length>0&&a.length>0){let d=new Set(n);c=new Set;for(let g=0;g<a.length;g++)d.has(a[g])&&c.add(a[g])}for(let d=0;d<n.length;d++){let g=n[d];c?.has(g)||(V(g),g.parentNode&&g.parentNode.removeChild(g))}let u=e;for(let d=0;d<a.length;d++){let g=a[d];u.nextSibling!==g&&s.insertBefore(g,u.nextSibling),u=g}n=a,Ue(i,a,"bindChildNode")}return J(r,e)}var I="http://www.w3.org/2000/svg",Ji=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var nn=new Set,Er=100,kr=!1,Cr=new Map;function _r(e){let t=Cr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Cr.set(e,t)),t}function Gi(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=J(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",pt(String(a),{element:e}));return}let c=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let d in a){if(!Object.hasOwn(a,d))continue;let g=a[d];if(g==null)continue;let h=_r(d);u.push(h),c.setProperty(h,ft(h,String(g),{element:e}))}for(let d=0;d<o.length;d++)u.indexOf(o[d])===-1&&c.removeProperty(o[d]);o=u},e);_(e,s);return}if(typeof t=="string"){e.setAttribute("style",pt(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=_r(r);if(typeof o=="function"){let s=o,a=J(()=>{n.style.setProperty(i,ft(i,String(s()),{element:e}))},e);_(e,a)}else n.style.setProperty(i,ft(i,String(o),{element:e}))}}function Yi(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=J(()=>{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=J(()=>{let a="";for(let c in n){if(!Object.hasOwn(n,c))continue;let u=n[c];(typeof u=="function"?u():u)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);_(e,s)}else e.setAttribute("class",o)}function rn(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=Gn(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);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),rn(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 rn(i,r),i;let s=r,a=s.class;a!=null&&Yi(i,a);let c=s.id;typeof c=="function"?_(i,nt(i,"id",c)):c!=null&&(!1,i.id=c);let u=o!==void 0?o:s.nodes;u!=null&&rn(i,u);let d=s.on;if(d)for(let m in d){if(!Object.hasOwn(d,m))continue;let l=d[m];typeof l=="function"?i.addEventListener(m,l):!1}let g=s.style;g!=null&&Gi(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 l=s[m];if(l==null||Te(m))continue;typeof l=="function"?_(i,nt(i,m,l)):ae(i,m,l,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var Gl=p("html"),Zi=p("head"),Xi=p("body"),Qi=p("title"),O=p("div"),F=p("span"),es=p("section"),ts=p("article"),ns=p("header"),rs=p("footer"),os=p("nav"),is=p("main"),ss=p("aside"),as=p("address"),on=p("p"),cs=p("h1"),us=p("h2"),sn=p("h3"),ls=p("h4"),ds=p("h5"),fs=p("h6"),ps=p("blockquote"),ms=p("dd"),gs=p("dl"),bs=p("dt"),hs=p("figcaption"),ys=p("figure"),vs=p("hr"),Ss=p("li"),xs=p("ol"),ws=p("ul"),an=p("pre"),Ts=p("a"),Es=p("abbr"),ks=p("b"),Cs=p("bdi"),_s=p("bdo"),As=p("br"),Ns=p("cite"),cn=p("code"),Rs=p("data"),Ls=p("dfn"),Ms=p("em"),Os=p("i"),Ps=p("kbd"),Ds=p("mark"),$s=p("q"),Is=p("rp"),Hs=p("rt"),Bs=p("ruby"),Vs=p("s"),js=p("samp"),Fs=p("small"),zs=p("strong"),Ws=p("sub"),qs=p("sup"),Us=p("time"),Ks=p("u"),Js=p("var"),Gs=p("area"),Ys=p("audio"),Zs=p("img"),Xs=p("map"),Qs=p("track"),ea=p("video"),ta=p("embed"),na=p("iframe"),ra=p("object"),oa=p("param"),ia=p("picture"),sa=p("portal"),aa=p("source"),ca=p("svg",I),ua=p("math"),la=p("canvas"),da=p("noscript"),fa=p("script"),pa=p("del"),ma=p("ins"),ga=p("caption"),ba=p("col"),ha=p("colgroup"),ya=p("table"),va=p("tbody"),Sa=p("td"),xa=p("tfoot"),wa=p("th"),Ta=p("thead"),Ea=p("tr"),ot=p("button"),ka=p("datalist"),Ca=p("fieldset"),_a=p("form"),Aa=p("input"),Na=p("label"),Ra=p("legend"),La=p("meter"),Ma=p("optgroup"),Oa=p("option"),Pa=p("output"),Da=p("progress"),$a=p("select"),Ia=p("textarea"),Ha=p("details"),Ba=p("dialog"),Va=p("menu"),ja=p("summary"),Fa=p("slot"),za=p("template"),Wa=p("base"),qa=p("link"),Ua=p("meta"),De=p("style"),Ka=p("circle",I),Ja=p("ellipse",I),Ga=p("g",I),Ya=p("line",I),Za=p("path",I),Xa=p("polygon",I),Qa=p("polyline",I),ec=p("rect",I),tc=p("text",I),nc=p("tspan",I),rc=p("defs",I),oc=p("clipPath",I),ic=p("mask",I),sc=p("pattern",I),ac=p("linearGradient",I),cc=p("radialGradient",I),uc=p("stop",I),lc=p("use",I),dc=p("symbol",I),fc=p("marker",I),pc=p("center"),mc=p("font"),gc=p("marquee"),bc=e=>p(e);var un="__sibuPendingError";function Ar(e,t){let n=()=>e.parentNode?(R(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[un]=t)})}function xt(e){let t=e,n=t[un];if(n instanceof Error)return delete t[un],n}function Nr(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}`)),Ar(r,s)}),r.appendChild(F("sibu-lazy-loading","Loading...")),_(r,()=>{o=!0}),r}}function Rr({nodes:e,fallback:t}){let n=O({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=Y(()=>{if(!o)try{let c=e();if(s=c,c.classList.contains("sibu-lazy")){if(!c.querySelector(".sibu-lazy-loading")){Q(n,c);return}i=new MutationObserver(()=>{if(o)return;c.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,Q(n,c))}),i.observe(c,{childList:!0,subtree:!0})}else Q(n,c)}catch(c){let u=c instanceof Error?c:new Error(String(c));Ar(n,u)}});return queueMicrotask(a),n}function pn(e,t){return()=>qe()===e?t():St(e,t)}function Tt(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";R(n,{phase:r,name:t});return}}function ln(e,t,n,r,o){let i=Tt(e,t);if(typeof i!="function")return;let s=pn(o,i);r()||!n.isConnected?Tt(s,"onUnmount"):Mr(s,n)}var Ke=new WeakMap,$e=new WeakMap,Se=new Set,xe=new Set,Je=null,wt=0,hc=256;function dn(e){let t=Ke.get(e);if(t){Ke.delete(e),Se.delete(e);for(let n of t)try{n()}catch{}}}function fn(e){$e.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=$e.get(e);if(n){$e.delete(e),xe.delete(e);for(let r of n)try{r()}catch{}}})}function yc(e){if(Se.size===0||e.nodeType!==1)return;let t=e;if(Se.has(t)&&t.isConnected&&dn(t),t.firstElementChild)for(let n of Array.from(Se))n!==t&&n.isConnected&&t.contains(n)&&dn(n)}function vc(e){if(xe.size===0||e.nodeType!==1)return;let t=e;if(xe.has(t)&&!t.isConnected&&fn(t),t.firstElementChild)for(let n of Array.from(xe))n!==t&&!n.isConnected&&t.contains(n)&&fn(n)}function Sc(){if(Se.size>0)for(let e of Array.from(Se))e.isConnected&&dn(e);if(xe.size>0)for(let e of Array.from(xe))e.isConnected||fn(e)}function Lr(){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++)yc(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)vc(t.removedNodes[n])}wt+=e.length,wt>=hc&&(wt=0,Sc()),mn()}),Je.observe(document.body,{childList:!0,subtree:!0}))}function mn(){Je&&Se.size===0&&xe.size===0&&(Je.disconnect(),Je=null,wt=0)}function xc(e,t){let n=Ke.get(e);return n||(n=[],Ke.set(e,n)),n.push(t),Se.add(e),Lr(),()=>{let r=Ke.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ke.delete(e),Se.delete(e))}mn()}}function wc(e,t){let n=$e.get(e);return n||(n=[],$e.set(e,n)),n.push(t),xe.add(e),Lr(),()=>{let r=$e.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&($e.delete(e),xe.delete(e))}mn()}}function Et(e,t){if(typeof document>"u")return;let n=qe();if(e=pn(n,e),t){let r=!1,o=()=>r;if(_(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||ln(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){ln(e,"onMount",t,o,n);return}let i=xc(t,()=>{r||ln(e,"onMount",t,o,n)});_(t,i)})}else queueMicrotask(()=>{Tt(e,"onMount")})}function Tc(e,t){typeof document>"u"||Mr(pn(qe(),e),t)}function Mr(e,t){let n=!1,r=()=>{n||(n=!0,Tt(e,"onUnmount"))};_(t,r);let o=()=>{if(n)return;let i=wc(t,r);_(t,i)};t.isConnected?o():Et(()=>{o()},t)}function Ec(e,t){_(t,e)}function se(e,t,n){try{e.emit(t,n)}catch{}}var gn=Symbol.for("sibujs.ssr.v1");function kc(){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 Pt=="function"&&(t=Pt("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[gn]??(globalThis[gn]=kc()),Ie=_e.als,Z=_e.fallbackStore;_e.fallbackDepth??(_e.fallbackDepth=0);var Or=!1;function Cc(){if(Or||Ie||!(typeof process<"u"&&!!process.versions?.node))return;Or=!0;let t=process.versions.node;`${t}`}function He(){if(Ie){let e=Ie.getStore();if(e)return e}return Z}function Pr(){return Ie?Ie.getStore()??null:_e.fallbackDepth>0?Z:null}function de(){return He().ssr}function Dr(e){if(!de())return null;let t=He(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function $r(){He().ssr=!0}function Ir(){He().ssr=!1}function Hr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Ie)return Ie.run(t,e);Cc();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,_e.fallbackDepth++;try{return e()}finally{_e.fallbackDepth--,Z.ssr=n,Z.suspenseIdCounter=r,Z.idCounter=o,Z.locale=i}}function Br(e){let t=He(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var zr=globalThis;function _c(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,le(()=>t(o,void 0));else{let i=n;n=o,le(()=>t(o,i))}}}var Vr=100;function kt(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===qe()?jr(t):St(n,()=>jr(t))}function jr(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){R(n,{phase:"cleanup"})}}function Fr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&kt(e),Ce(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Vr);e.rerunPending&&(e.rerunPending=!1,R(new Error(`effect re-requested itself ${Vr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Ac(e){if(e.disposed)return;e.disposed=!0;let t=zr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&kt(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Pe(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function X(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&&kt(n),Ce(n.bodyFn,o),n.rerunPending&&Fr(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{Ce(n.bodyFn,n.subscriber),n.rerunPending&&Fr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&kt(n),Pe(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=zr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&se(i,"effect:create",{effectFn:e}),()=>Ac(n)}var it=0,bn=new Set;function Nc(e){it++;try{return e()}finally{it--,it===0&&Mc()}}function Rc(e){return it===0?!1:(bn.add(e),!0)}function Lc(){return it>0}function Mc(){try{for(let e of bn)xr(e)}finally{bn.clear()}Sr()}var Wr=Symbol.for("sibujs.reactive.batch.v1");function Oc(){let e=globalThis,t=e[Wr];if(t)return t;let n={batch:Nc,enqueueBatchedSignal:Rc,isBatching:Lc};return e[Wr]=n,n}var hn=Oc(),z=hn.batch,Be=hn.enqueueBatchedSignal,Pc=hn.isBatching;var yn=globalThis;function A(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 Oe(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let c=n.value,u=typeof a=="function"?a(c):a;if(!o(c,u)){if(n.value=u,n.__v++,!1){let d=yn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&se(d,"signal:update",{signal:n,name:r,oldValue:c,newValue:u})}Be(n)||We(n)}}:s=a=>{let c=n.value,u=typeof a=="function"?a(c):a;Object.is(u,c)||(n.value=u,n.__v++,Be(n)||We(n))},!1){let a=yn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&se(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function Dc(e){let[t,n]=A(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var $c=`
|
|
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 Ic(){if(qr||typeof document>"u")return;let e=De({nodes:$c});document.head.appendChild(e),qr=!0}function Hc(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 Ur(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=Hc(r),i=e.cause,s=i!=null?Ur(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 Bc(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 Kr(e){let t=e.map((n,r)=>O({class:"sibu-err-frame",nodes:[F({class:"sibu-err-line",nodes:String(r+1)}),F({class:"sibu-err-fn",nodes:n.fn}),F({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return an({class:"sibu-err-stack",nodes:t})}function Jr(e){return e?[O({class:"sibu-err-cause-label",nodes:"Caused by"}),O({class:"sibu-err-section",nodes:[O({class:"sibu-err-section-head",nodes:[F({nodes:`[${e.code}] ${e.message}`}),F({nodes:""})]}),e.frames.length>0?Kr(e.frames):O({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Jr(e.cause)]:[]}function Vc(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 vn(e){Ic();let t=e.severity??"error",n=Ur(e.error),r=e.alwaysShowDetails??pe(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=A("Copy"),c=ot({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let m=Bc(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(m).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),u=O({class:"sibu-err-header",nodes:[cn({class:"sibu-err-icon",nodes:n.code}),sn({class:"sibu-err-title",nodes:o}),c,F({class:"sibu-err-timestamp",nodes:i})]}),d=[on({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&d.push(O({class:"sibu-err-section",nodes:[O({class:"sibu-err-section-head",nodes:[F({nodes:"Stack Trace"})]}),Kr(n.frames)]})),r&&d.push(...Jr(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(O({class:"sibu-err-section",nodes:[O({class:"sibu-err-section-head",nodes:[F({nodes:"Metadata"})]}),Vc(e.metadata)]}));let g=[];e.onRetry&&g.push(ot({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&g.push(ot({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),g.length>0&&d.push(O({class:"sibu-err-actions",nodes:g}));let h=O({class:"sibu-err-body",nodes:d});return O({class:"sibu-error-display","data-severity":t,nodes:[u,h]})}var jc=`
|
|
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
|
+
`,Fc=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Gr=!1;function zc(){if(!Gr&&typeof document<"u"){let e=De({nodes:jc});document.head.appendChild(e),Gr=!0}}function Wc(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;zc();let[a,c]=A(null),u=()=>{g(),c(null)},d=null,g=()=>{if(!d)return;let v=d;d=null,v()},h=v=>{let x=new Array(v.length);for(let E=0;E<v.length;E++)try{x[E]=v[E]()}catch(P){R(P,{phase:"effect",name:"ErrorBoundary.resetKeys"}),x[E]=Fc}return x},m=()=>{let v=s;if(!v||v.length===0)return;g();let x=null;d=X(()=>{let E=h(v);if(x===null){x=E;return}let P=E.length!==x.length;if(!P){for(let B=0;B<E.length;B++)if(!Object.is(E[B],x[B])){P=!0;break}}x=E,P&&u()})},l=v=>{let x=$t(v);if(c(x),m(),i)try{i(x)}catch(E){R(E,{phase:"render",name:"ErrorBoundary onError callback"})}return x},f=(v,x)=>vn({error:v,severity:"error",onRetry:x}),b=v=>{let x=o||f;try{return x(v,u)}catch(E){return queueMicrotask(()=>{R(E,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=O({class:"sibu-error-boundary",nodes:()=>{let v=a();if(v)return b(v);try{let x=n();if(x&&typeof x.then=="function"){let E=O({class:"sibu-error-async"});E.appendChild(F({class:"sibu-lazy-loading",nodes:"Loading..."}));let P=!1;return _(E,()=>{P=!0}),x.then(B=>{if(P){V(B);return}Q(E,B)}).catch(Y(B=>{if(P)return;let q=l(B);Q(E,b(q))})),E}return x}catch(x){let E=l(x);return b(E)}}}),S=v=>{if(a())return;let E=v.detail?.error;E&&(v.preventDefault(),v.stopPropagation(),l(E))};return y.addEventListener("sibu:error-propagate",S),Et(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),x=[],E=v.currentNode;for(;E;){let P=xt(E);P&&x.push(P),E=v.nextNode()}if(x.length===1)l(x[0]);else if(x.length>1){let P=globalThis.AggregateError;l(P?new P(x,`${x.length} pre-mount errors caught by ErrorBoundary`):new Error(x.map(B=>B.message).join("; ")))}},y),_(y,()=>{g(),y.removeEventListener("sibu:error-propagate",S)}),y}var qc=`
|
|
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 c=0;for(;r<o&&n.charCodeAt(r)!==0;)c=c*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,c<0||c>=t?(r=m,-1):c}function a(){let m=r;for(;r<o;){let c=n.charCodeAt(r);if(c>=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===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 c=n[r];if(c==='"'||c==="'"){r++;let f=[],b=[],y="";for(;r<o&&n[r]!==c;){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 u(){let m=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let c=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(c,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 c="";for(;r<o&&n[r]!=="<";){let b=s();if(b>=0){let y=d(c);y&&m.push({t:1,value:y}),c="",m.push({t:2,idx:b})}else c+=n[r++]}let f=d(c);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 c=n[r+1];if(c==="!"){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(c==="?"){let v=n.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(c>="a"&&c<="z")&&!(c>="A"&&c<="Z")){m.push({t:1,value:"<"}),r++;continue}r++;let f=a(),b=u();i();let y=Ql.has(f),S=n[r]==="/";if(S&&r++,r<o&&r++,y||S)m.push({t:0,el:{tag:f,svg:ro.has(f),attrs:b,children:[]}});else{let v=h();if(Fn(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:ro.has(f),attrs:b,children:v}})}}else g(m);return m}return h()}function gn(e,t){let n=e.svg?document.createElementNS(I,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:jt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?_(n,Qe(n,i,s)):ie(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]}ie(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:jt(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(gn(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,he(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 io(e,...t){let n=oo.get(e);return n||(n=eu(e),oo.set(e,n)),ao(n,t)}function so(e,t){return ao(e,t)}function ao(e,t){if(e.length===1&&e[0].t===0)return gn(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(gn(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,he(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 tu(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&de()&&void 0;let a,l=null,u=!1,d=!1,g=()=>{if(d)return;let m=e(),c=r.parentNode;if(!c||u&&m===a)return;l?.parentNode&&c.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,u=!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))}}c.insertBefore(f,r.nextSibling),l=f,u=!0},h=re(g);return u||queueMicrotask(()=>{!u&&r.parentNode&&g()}),_(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 nu(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=Rn(()=>{let d=e();return i(d),d}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&oe(l,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(l&&oe(l,"app:unmount",{rootElement:s}),u){ru(u.start,u.end);return}V(s),s.parentNode?.removeChild(s)}}}function ru(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=me;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){Se("mount",me,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 ou(e,t){let n=document.createComment("portal"),r=t||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){queueMicrotask(()=>{R(s,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}}),_(n,()=>{i=!0,o&&(V(o),o.remove(),o=null)}),n}function iu(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function lo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function su(e=[]){let[t,n]=A([...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=lo(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 au(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Ie(r)||Fe(r)}function i(){if(Le(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 u=lo(t,a,l);return(u.length>0||l.length>1)&&o(),u},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 u=!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,u=!0)}u&&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 u=0;u<t.length;u++){let d=a(t[u],u);Object.is(t[u],d)||(t[u]=d,l=!0)}l&&o()},clear(){t.length!==0&&(t=[],o())}}]}function lu(e,t){let[n,r]=A(t),[o,i]=A(!1),[s,a]=A(null),[l,u]=A(0),d=0,g=!1,h=null,m=()=>{if(h===null)return;let f=h;h=null;try{f.abort()}catch{}},c=Z(()=>{if(l(),g)return;m();let f=++d,b=typeof AbortController<"u"?new AbortController:null;h=b,F(()=>{i(!0),a(null)});let y=()=>g||f!==d,S;try{S=e({signal:b?b.signal:void 0})}catch(v){if(y())return;F(()=>{a(v),i(!1)});return}S.then(v=>{y()||(h=null,F(()=>{r(v),i(!1)}))},v=>{y()||(h=null,F(()=>{a(v),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{g||u(f=>f+1)},dispose:()=>{g||(g=!0,c(),m())}}}function Ke(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,u]of e)if(!a.has(l)||!Ke(u,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 u=0;u<a.length;u++)if(a[u]!==l[u])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 u=0;u<a.length;u++)if(a[u]!==l[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,l)=>Ke(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&&Ke(e.cause,a.cause,n)&&uo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:uo(r,o,n)}function uo(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)&&Ke(e[i],t[i],n))}function uu(e){return A(e,{equals:(t,n)=>Ke(t,n)})}function Be(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 u=()=>{let c=e();o._v=r&&o._init&&r(o._v,c)?o._v:c,o._d=!1,o._init=!0};try{re(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(c){throw s=!0,Me(l),c}let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,g=()=>{if(!o._d||s||a!==void 0)return;let c=o._v;i=!0;try{Ee(u,l),Object.is(c,o._v)||o.__v++}catch(f){a={error:f},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&Me(l)}d&&!s&&!Object.is(c,o._v)&&oe(d,"computed:update",{signal:o,oldValue:c,newValue:o._v})};o._validate=g;let h=()=>{let{error:c}=a;throw a=void 0,s&&(o._d=!1),c};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 cr()||s?(o._d&&(g(),a!==void 0&&h()),o._v):(o._d&&(g(),a!==void 0&&(Le(o),h())),Le(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,Me(l);let c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(c)try{c.emit("computed:destroy",{signal:o,getter:m})}catch{}},d&&oe(d,"computed:create",{signal:o,name:n,getter:m}),m}function cu(e){let[t,n]=A(e);return{get current(){return t()},set current(r){n(r)}}}function co(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function du(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(l=>{let[u,d]=A(e[l]);co(t,l,[u,d])});let n=new Proxy({},{get(l,u){if(typeof u=="string"&&Object.hasOwn(t,u)){let d=t[u][0];return d()}return Reflect.get(l,u)},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(u=>{co(l,u,t[u][0]())}),l};return[n,{setState:l=>{let u=r(),d=typeof l=="function"?l(u):l;F(()=>{Object.entries(d).forEach(([g,h])=>{Object.hasOwn(t,g)&&t[g][1](h)})})},reset:()=>{F(()=>{Object.keys(e).forEach(l=>{let u=t[l][1];u(e[l])})})},subscribe:l=>{let u=!0;return Z(()=>{let d=r();if(u){u=!1;return}Ne();try{l(d)}finally{Re()}})},subscribeKey:(l,u)=>{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,Ne();try{u(h,m)}finally{Re()}}})},getSnapshot:r}]}function fu(e,t){if(ue())return()=>{};let n,r=!0;return re(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Ne();try{t(s,a)}finally{Re()}}})}function pu(e,t,n){return[Be(e,n),i=>{F(()=>t(i))}]}function mu(e){let t=e();return de()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function gu(e){if(!de())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 fo(e,t){return ue()?()=>{}:J(e,t)}var bn="data-sibu-enhanced",hn=new WeakMap;function po(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=me){let i=r.length-o+e.length;e.length=0,Se(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 go(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 ot(e,t){return fo(t,e)}function bu(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 hu(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 yu(e,t,n,r){let o=`ctx.each[${r}]`;if(de())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 Et(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(bn)==="true")return de()&&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,c)=>{if(a(h))return;let f=go(n,m);if(!f){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(m)} not found under`,n);return}c(f)},u={root:n,ref:h=>go(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,c,f)=>{l("on",h,b=>{let y=S=>c(S,b);b.addEventListener(m,y,f),r.push(()=>b.removeEventListener(m,y,f))})},text:(h,m)=>{l("text",h,c=>{r.push(ot(c,()=>{let f=m(),b=f==null?"":String(f);c.textContent!==b&&(c.textContent=b)}))})},attr:(h,m,c)=>{l("attr",h,f=>{r.push(ot(f,()=>{let b=c(),y=b==null?null:String(b);ie(f,m,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(h,m,c)=>{l("classed",h,f=>{r.push(ot(f,()=>{f.classList.toggle(m,!!c())}))})},show:(h,m)=>{l("show",h,c=>{let f=c.hidden;r.push(ot(c,()=>{c.hidden=!m()})),r.push(()=>{c.hidden=f})})},model:(h,m,c)=>{l("model",h,f=>{let b=f,[y,S]=m,v=c?.event??(b instanceof HTMLSelectElement||b instanceof HTMLInputElement&&(b.type==="checkbox"||b.type==="radio")?"change":"input");r.push(ot(f,()=>{hu(b,y())}));let x=()=>S(bu(b));b.addEventListener(v,x),r.push(()=>b.removeEventListener(v,x))})},each:(h,m)=>{if(a("each"))return;let c=typeof h=="string"?u.refs(h):Array.from(h);for(let f=0;f<c.length;f++){let b=c[f],y=m(b,f);y!=null&&yu(u,b,y,f)}},cleanup:h=>{a("cleanup")||r.push(h)}},d;try{d=t(u);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 po(r,"enhance"),s=!0,h}typeof d=="function"&&r.push(d);let g=()=>{i||(i=!0,hn.get(n)===o&&(hn.delete(n),n.removeAttribute(bn)),Ze(n,g),po(r,"enhance"),s=!0)};return _(n,g),hn.set(n,o),n.setAttribute(bn,"true"),g}function vu(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Et(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 Su=/^[A-Za-z0-9_-]+$/,bo=Symbol.for("sibujs.islands.lazy"),kt=rt(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function xu(e){return e[bo]=!0,e}function Tu(e,t){if(!Su.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);kt.set(e,t)}function wu(e){kt.delete(e)}async function Eu(e){if(typeof e=="function"&&e[bo]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function ku(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(!kt.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=kt.get(s);d&&Eu(d).then(g=>{if(!o){if(!g){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let h=Et(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)})},u=i.getAttribute("data-sibu-load")||"load";n.push(Cu(u,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Cu(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 _u=new Set(["__proto__","constructor","prototype"]);function yn(e){return _u.has(e)}function Ct(e){let t={};for(let n of Object.keys(e))yn(n)||(t[n]=e[n]);return t}function ho(e){return e}var dp=1024*1024;function Au(e){let[t,n]=A(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=re(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,l())},u}var yo=16;function Nu(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:yo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,yo)}function Ru(){let[e,t]=A(!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"})};Nu(()=>{try{let l=xt(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function Lu(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var _t={};wn(_t,{RenderProp:()=>Fu,assertType:()=>Yu,compose:()=>ju,createGuard:()=>Zu,createSlots:()=>Wu,defineComponent:()=>qu,defineSlottedComponent:()=>Uu,defineStrictComponent:()=>Gu,globalStore:()=>Hu,machine:()=>Mu,optimistic:()=>Du,optimisticList:()=>Ou,persisted:()=>Pu,timeline:()=>$u,validateProps:()=>To,validators:()=>Ju,withBoundary:()=>zu,withDefaults:()=>Vu,withProps:()=>Ku,withWrapper:()=>Bu});function Je(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Mu(e){let[t,n]=A(e.initial),[r,o]=A(e.context||{}),i=e.initial,s=r(),a=[],l=!1;function u(){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=Je(e.states,i);if(!b?.on)return;let y=Je(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 D=E;if(x){let W=x(E);D={...E,...Ct(W)}}i=S,s=D,F(()=>{x&&o(D),n(S)});let B=Je(e.states,S);B?.entry&&B.entry(s)}function g(f){a.push(f),!l&&u()}let h=Je(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&&u()}function m(f){return t()===f}function c(f){let b=t(),y=Je(e.states,b);if(!y?.on)return!1;let S=Je(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:c}}function Pu(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)=>yn(y)?void 0:S,s=n.deserialize||(y=>JSON.parse(y,i)),a=n.encrypt,l=n.decrypt,u=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]=A(d),m=!1,c=Z(()=>{let y=g();if(!m)try{let S=o(y);a&&(S=a(S)),r?.setItem(e,S)}catch{}}),f=null;return u&&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:()=>{c(),f&&typeof window<"u"&&(window.removeEventListener("storage",f),f=null)},enumerable:!1,writable:!1,configurable:!1}),[g,h]}function Du(e){let[t,n]=A(e),[r,o]=A(!1),i=0,s=0;async function a(l,u){let d=++s,g=t();n(l),i++,o(!0);try{let h=await u();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 Ou(e){let t=0,n=0,r=0,o=new Map,i=[];for(let N of e){let T={id:t++,key:n++,base:N,claims:[],visible:!0,refs:0};o.set(T.id,T),i.push(T.id)}function s(N){let T=N.claims;return T.length>0?T[T.length-1].value:N.base}function a(N,T){let L=N.claims;for(let k=L.length-1;k>=0;k--)if(L[k].opId<T)return L[k].value;return N.base}function l(N,T,L){let k={opId:T,value:L,settled:!1},C=N.claims,O=C.length;for(;O>0&&C[O-1].opId>T;)O--;return C.splice(O,0,k),k}function u(N,T){let L=N.claims.indexOf(T);L!==-1&&N.claims.splice(L,1)}function d(N){let T=N.claims,L=0;for(;L<T.length&&T[L].settled;)N.base=T[L].value,L++;L>0&&T.splice(0,L)}let[g,h]=A(i.map(N=>s(o.get(N)))),[m,c]=A(!1),f=0,b=new Set;function y(){let N=new Array(i.length);for(let T=0;T<i.length;T++)N[T]=s(o.get(i[T]));return N}function S(N){F(()=>{let T=!1;try{T=N()}finally{c(f>0),T&&h(y())}})}function v(N){let T=o.get(N);return!T||!T.visible?!1:(T.visible=!1,i=i.filter(L=>L!==N),!0)}function x(N){let T=[];for(let $ of N){let q=o.get($);!q||q.visible||b.has($)||T.push($)}if(T.length===0)return!1;let L=new Array(i.length+T.length),k=0,C=0,O=0;for(;k<i.length&&C<T.length;){let $=o.get(i[k]).key,q=o.get(T[C]).key;L[O++]=$<=q?i[k++]:T[C++]}for(;k<i.length;)L[O++]=i[k++];for(;C<T.length;)L[O++]=T[C++];for(let $ of T)o.get($).visible=!0;return i=L,!0}function E(N){for(let T of N){let L=o.get(T);L&&L.refs++}}function D(N){for(let T of N){let L=o.get(T);L&&(L.refs--,L.refs<=0&&!L.visible&&(o.delete(T),b.delete(T)))}}function B(N){if(D(N),f--,f<=0&&(f=0,b.clear(),o.size!==i.length))for(let[T,L]of o)L.visible||o.delete(T)}async function W(N,T){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 O,$=!1;try{O=await T()}catch{$=!0}S(()=>{try{if($)return b.add(k.id),u(k,C),v(k.id);let q=s(k);return C.value=O,C.settled=!0,d(k),k.visible&&!Object.is(q,s(k))}finally{B([k.id])}})}async function ce(N,T){let L=++r,k=[];for(let O of i)N(a(o.get(O),L))&&k.push(O);S(()=>{if(E(k),f++,k.length===0)return!1;let O=new Set(k);for(let $ of k){let q=o.get($);q&&(q.visible=!1)}return i=i.filter($=>!O.has($)),!0});let C=!1;try{await T()}catch{C=!0}S(()=>{try{if(!C){for(let O of k)b.add(O);return!1}return x(k)}finally{B(k)}})}async function it(N,T,L){let k=++r,C=[];for(let G of i){let z=o.get(G),Q=a(z,k);N(Q)&&C.push({row:z,nextValue:{...Q,...T}})}let O=C.map(G=>G.row.id),$=[];S(()=>{E(O),f++;let G=!1;for(let z of C){let Q=s(z.row);$.push(l(z.row,k,z.nextValue)),z.row.visible&&!Object.is(Q,s(z.row))&&(G=!0)}return G});let q,Ge=!1;try{q=await L()}catch{Ge=!0}S(()=>{try{let G=!1;for(let z=0;z<$.length;z++){let Q=C[z].row,w=$[z],K=s(Q);Ge?u(Q,w):(w.value=q,w.settled=!0),d(Q),Q.visible&&!Object.is(K,s(Q))&&(G=!0)}return G}finally{B(O)}})}return{items:g,pending:m,add:W,remove:ce,update:it}}function $u(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]=A([e]),[o,i]=A(0),s=Be(()=>n()[o()]),a=Be(()=>o()>0),l=Be(()=>o()<n().length-1);function u(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),F(()=>{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(){F(()=>{r([e]),i(0)})}function m(f){let b=n();f>=0&&f<b.length&&i(f)}function c(){s.dispose(),a.dispose(),l.dispose()}return{value:s,set:u,undo:d,redo:g,canUndo:a,canRedo:l,history:n,index:o,reset:h,jumpTo:m,dispose:c}}var So=Promise.prototype.then;function vo(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(So,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function xo(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(c){return{promise:Promise.reject(c),failedEarly:!0,probe:f=>queueMicrotask(f)}}if(typeof t!="function")return null;let n,r,o=new Promise((c,f)=>{n=c,r=f}),i="invoking",s,a=[],l=c=>{if(i=c,c!=="invoking")for(let f of a.splice(0))f()},u=c=>{n(c),l("fulfilled")},d=c=>{r(c),l("rejected")},g=c=>{if(c===o){d(new TypeError("adopt: a thenable resolved to its own adoption"));return}if(c===null||typeof c!="object"&&typeof c!="function"){u(c);return}let f;try{f=c.then}catch(b){d(b);return}if(typeof f!="function"){u(c);return}h(c,f)},h=(c,f)=>{f===So?(s=c,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,c,[y,S])}catch(v){S(v)}!b&&i==="invoking"&&l("pending")})};return h(e,t),{promise:o,failedEarly:!1,probe:(c,f)=>{let b=()=>{i==="native"?vo(s,c,f):(i==="rejected"?c:f)()};i==="native"?vo(s,c,f):i==="invoking"?a.push(b):queueMicrotask(i==="rejected"?c:f)}}}function Iu(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 Hu(e){let t=Iu(e.state),[n,r]=A({...t}),o=new Map,i=e.middleware||[];function s(c){if(o.size!==0){for(let f of Array.from(o.values()))if(f.active)try{f.callback(c)}catch(b){R(b,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],l=!1;function u(c,f=!0){if(a.push(c),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(c,f){let b=e.actions[c];if(!b)throw new Error(`Unknown action: ${String(c)}`);let y=()=>{let S=n(),v=b(S,f),x=Ct(v);r({...S,...x}),s(n())};u(()=>{if(i.length===0){y();return}let S=v=>{if(v>=i.length){y();return}let x=!1,E=!1,D=!0,B=()=>{if(E&&!x){!1,x=!0;return}if(x){!1;return}if(x=!0,D){S(v+1);return}let ce=()=>u(()=>S(v+1),!1);if(!W){ce();return}W.probe(()=>{E=!0,!1},ce)},W=null;try{W=xo(i[v](n(),String(c),f,B))}catch(ce){throw E=!0,ce}finally{D=!1}W&&(W.failedEarly&&(E=!0),W.promise.then(void 0,ce=>{E=!0,R(ce,{phase:"async",name:"globalStore(middleware)"})}))};S(0)})}function g(c){return()=>c(n())}function h(c){let f=o.get(c);f||(f={callback:c,active:!0},o.set(c,f));let b=f;return()=>{o.get(c)===b&&(b.active=!1,o.delete(c))}}function m(){u(()=>{r({...t}),s(n())})}return{getState:n,select:g,dispatch:d,subscribe:h,reset:m}}function Bu(e,t){return n=>t(e,n)}function Vu(e,t){return n=>e({...t,...n})}function ju(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function Fu(e){return e.render(e.data())}function zu(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 Wu(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 qu(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function Uu(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function Ku(e,t){return n=>e(t(n))}var Ju={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 To(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 Gu(e){return t=>{let n=To(t,e.props);return e.setup(n)}}function Yu(e,t,n){}function Zu(e){return t=>e(t,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={..._t,...vn,patterns:_t});})();
|
|
399
|
+
`,Yr=!1;function Uc(){!Yr&&typeof document<"u"&&(document.head.appendChild(De({nodes:qc})),Yr=!0)}function Kc(e={}){Uc();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?O({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[O({class:"sibu-loading-dots"},[F({class:"sibu-loading-dot"}),F({class:"sibu-loading-dot"}),F({class:"sibu-loading-dot"})]),t?F({class:"sibu-loading-text"},t):null]):O({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[O({class:"sibu-loading-spinner"}),t?F({class:"sibu-loading-text"},t):null])}var Sn=Symbol.for("sibujs.actions.v1"),Xr=globalThis[Sn]??(globalThis[Sn]=new Map);function Ge(e,t){Xr.set(e,t)}function Qr(e){return Xr.get(e)}function Jc(e,t,n){let r=typeof t=="string"?Qr(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 eo=(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)},Zr=["pointerup","pointerleave","pointercancel"],to=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=c=>{let u=c.pointerId;r!==null&&u!==o||(i(),o=u,r=setTimeout(()=>{r=null,t.callback()},n))},a=c=>{r!==null&&c.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let c of Zr)e.addEventListener(c,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let c of Zr)e.removeEventListener(c,a)}},no=(e,t)=>{let n=o=>R(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)},ro=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)},oo=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)};Ge("clickOutside",eo);Ge("longPress",to);Ge("copyOnClick",no);Ge("autoResize",ro);Ge("trapFocus",oo);function Ct(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 Ve=null;function Gc(e,t){try{let n=e(),r=Ct(n);return r&&r.then(void 0,o=>{t?t(o,"async"):Ve?Ve(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):Ve?Ve(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Yc(e,t){try{return await e()}catch(n){return t?t(n,"async"):Ve?Ve(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Zc(e){Ve=e}function Xc(e){let[t,n]=A(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 c=s();return!1,c}finally{n(a)}}}}var xn=Symbol.for("sibujs.createId.v1"),wn=globalThis[xn]??(globalThis[xn]={n:0});function io(e="sibu"){let t=Pr();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(wn.n++,`${e}-${wn.n}`)}function so(){wn.n=0}function Qc(e,t){let n=typeof t=="function"?t():t;return _(n,J(()=>{n.style.display=e()?"":"none"},n)),n}function ao(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,c=r.has(s),u=!a&&!c;return r.add(s),c&&void 0,e.insertBefore(s,t.nextSibling),{node:s,owned:u}}function _t(e,t){t&&V(e),e.parentNode?.removeChild(e)}function eu(e,t,n){let r=document.createComment("when"),o=null,i,s=!1,a=!1,c=new WeakSet,u=!1,d=()=>{if(a)return;let h=e(),m=r.parentNode;if(!m||s&&Object.is(h,i))return;i=h;let l=o?rt([o]):null;o?.parentNode&&(_t(o,u),o=null);let f=h?t:n!==void 0?n:null,b=le(()=>ao(m,r,f,c,"when"));o=b.node,u=b.owned,Ue(l,o?[o]:[],"when"),s=!0},g=J(d,r);return _(r,()=>{a=!0,g(),o&&_t(o,u),o=null}),s||queueMicrotask(Y(()=>{!a&&!s&&r.parentNode&&d()})),r}function tu(e,t,n){let r=document.createComment("match"),o=null,i,s=!1,a=!1,c=new WeakSet,u=!1,d=()=>{if(a)return;let h=String(e()),m=r.parentNode;if(!m||s&&h===i)return;i=h;let l=o?rt([o]):null;o?.parentNode&&(_t(o,u),o=null);let f=Object.hasOwn(t,h)?t[h]:n,b=le(()=>ao(m,r,f??null,c,"match"));o=b.node,u=b.owned,Ue(l,o?[o]:[],"match"),s=!0},g=J(d,r);return _(r,()=>{a=!0,g(),o&&_t(o,u),o=null}),s||queueMicrotask(Y(()=>{!a&&!s&&r.parentNode&&d()})),r}function st(e,t){let n=globalThis;return n[e]??(n[e]=t())}var At=st(Symbol.for("sibujs.components.registry.v1"),()=>new Map),co=st(Symbol.for("sibujs.components.registryVersion.v1"),()=>A(0));function uo(){let[e,t]=co;t(le(e)+1)}function nu(e,t){At.set(e,t),uo()}function ru(e){At.delete(e)&&uo()}function ou(e){let t=At.get(e);return t?t():O(`[Component "${e}" not found]`)}function iu(e){let t=O({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(co[0](),a=At.get(s));let c=a??`missing:${s}`;if(c===r)return;let u=le(()=>a?a():O(`[Component "${s}" not found]`));r=c,Q(t,u)}let i=ie(o);return _(t,i),t}function lo(e){return typeof e=="function"?lo(e()):e instanceof Node?e:document.createTextNode(String(e))}function su(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let c=e[a],u=0,d=n.length;for(;u<d;){let g=u+d>>1;e[n[g]]<c?u=g+1:d=g}n[u]=a,r[a]=u>0?n[u-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 au(e,t,n){n&&n.key;let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,u=new Map,d=new Map,g=[],h=[],m=[],l=0,f=[],b=[],y=new Uint8Array(0),S=new Map,v=[],x=[],E=new Map,P=!1,B=!1,q=!1,fe=n.key,ct=()=>{if(q)return;let k=e(),C=k.length,D=r.parentNode;if(!D)return;B||(D.insertBefore(o,r.nextSibling),B=!0),b.length<C&&(b=new Array(C));for(let T=0;T<C;T++)b[T]=fe(k[T]);let $=b;f.length<C&&(f=new Array(C)),d.clear(),E.clear();for(let T=0;T<C;T++)!1,E.set($[T],T);l=0;for(let T=0;T<C;T++){let K=$[T],An=u.get(K),Qe;if(An!==void 0)Qe=An,g[l]=Qe,h[l]=k[T],m[l]=T,l++;else{let[Nn,Mo]=A(k[T]),[Rn,Oo]=A(T),Ot;try{Le();try{Ot=lo(t(Nn,Rn))}finally{Me()}}catch(Po){let Do=$[T];Ot=document.createComment(`each:error:${T}`),queueMicrotask(()=>{R(Po,{phase:"render",name:`each row (key="${String(Do)}")`,node:r.parentNode?r:void 0})})}Qe={node:Ot,item:Nn,setItem:Mo,index:Rn,setIndex:Oo}}d.set(K,Qe),f[T]=Qe.node}for(let[T,K]of u)d.has(T)||(V(K.node),K.node.parentNode&&D.removeChild(K.node));if(C===0){c=0;let T=u;u=d,d=T,P=!0,l=0;return}S.clear();for(let T=0;T<c;T++)S.set(a[T],T);v.length<C&&(v=new Array(C),x=new Array(C));let U=0;for(let T=0;T<C;T++){let K=S.get($[T]);K!==void 0&&(v[U]=T,x[U]=K,U++)}let Xe=su(x,U);y.length<C?y=new Uint8Array(C):y.fill(0,0,C);for(let T=0;T<Xe.length;T++)y[v[Xe[T]]]=1;let G=o;for(let T=C-1;T>=0;T--){let K=f[T];y[T]||K.nextSibling!==G&&D.insertBefore(K,G),G=K}let W=a===i?s:i;W.length<C&&(W.length=C);for(let T=0;T<C;T++)W[T]=$[T];a=W,c=C;let ee=u;u=d,d=ee,P=!0,N()};function N(){if(l===0)return;let k=l;l=0,z(()=>{for(let C=0;C<k;C++){let D=g[C];D.setItem(h[C]),D.setIndex(m[C]),g[C]=void 0,h[C]=void 0}})}let w=ie(ct);return _(r,()=>{if(!q){q=!0,w();for(let k of u.values())V(k.node),k.node.parentNode?.removeChild(k.node);o.parentNode&&o.parentNode.removeChild(o),B=!1,u.clear(),d.clear(),E.clear(),S.clear(),c=0,g.length=0,h.length=0,m.length=0,l=0}}),P||queueMicrotask(Y(()=>{!P&&!q&&r.parentNode&&ct()})),r}function cu(e){let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||fo(t,r);else fo(t,n);return t}function fo(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 uu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),po=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),mo=new WeakMap;function lu(e){let t=e.length-1,n=e[0];for(let m=0;m<t;m++)n+=`\0${m}\0${e[m+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 m=r;r++;let l=0;for(;r<o&&n.charCodeAt(r)!==0;)l=l*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,l<0||l>=t?(r=m,-1):l}function a(){let m=r;for(;r<o;){let l=n.charCodeAt(r);if(l>=97&&l<=122||l>=65&&l<=90||l>=48&&l<=57||l===45)r++;else break}return n.slice(m,r)}function c(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let m=s();if(m>=0)return{kind:"expr",idx:m};let l=n[r];if(l==='"'||l==="'"){r++;let f=[],b=[],y="";for(;r<o&&n[r]!==l;){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 u(){let m=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let l=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(l,r);if(!f)break;let b=c();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 l="";for(;r<o&&n[r]!=="<";){let b=s();if(b>=0){let y=d(l);y&&m.push({t:1,value:y}),l="",m.push({t:2,idx:b})}else l+=n[r++]}let f=d(l);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 l=n[r+1];if(l==="!"){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(l==="?"){let v=n.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(l>="a"&&l<="z")&&!(l>="A"&&l<="Z")){m.push({t:1,value:"<"}),r++;continue}r++;let f=a(),b=u();i();let y=uu.has(f),S=n[r]==="/";if(S&&r++,r<o&&r++,y||S)m.push({t:0,el:{tag:f,svg:po.has(f),attrs:b,children:[]}});else{let v=h();if(Yn(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:po.has(f),attrs:b,children:v}})}}else g(m);return m}return h()}function Tn(e,t){let n=e.svg?document.createElementNS(I,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:Ut(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?_(n,nt(n,i,s)):ae(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]}ae(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:Ut(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(Tn(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 go(e,...t){let n=mo.get(e);return n||(n=lu(e),mo.set(e,n)),ho(n,t)}function bo(e,t){return ho(e,t)}function ho(e,t){if(e.length===1&&e[0].t===0)return Tn(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(Tn(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 du(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&pe()&&void 0;let a,c=null,u=!1,d=!1,g=()=>{if(d)return;let m=e(),l=r.parentNode;if(!l||u&&m===a)return;c?.parentNode&&l.removeChild(c),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){c=null,u=!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))}}l.insertBefore(f,r.nextSibling),c=f,u=!0},h=ie(g);return u||queueMicrotask(Y(()=>{!u&&r.parentNode&&g()})),_(r,()=>{d=!0,h();for(let m of o.values())V(m),m.parentNode&&m.parentNode.removeChild(m);o.clear(),i.length=0,c=null}),r}function fu(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=Hn(()=>{let d=e();return i(d),d}):(s=e,i(s));let a=n()-r,c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&se(c,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(c&&se(c,"app:unmount",{rootElement:s}),u){pu(u.start,u.end);return}V(s),s.parentNode?.removeChild(s)}}}function pu(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||R(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function mu(e,t){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),_(n,()=>{i=!0,o&&(V(o),o.remove(),o=null)}),n}function gu(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function yo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function bu(e=[]){let[t,n]=A([...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 c=[...a];return s=yo(c,o,i),s.length===0&&i.length<=1?a:c}),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,c)=>c!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,c)=>c===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 hu(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Be(r)||We(r)}function i(){if(Oe(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,...c){let u=yo(t,a,c);return(u.length>0||c.length>1)&&o(),u},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let c=t.findIndex(a);c!==-1&&(t.splice(c,1),o())},set(a){t=[...a],o()},update(a,c){a<0||a>=t.length||Object.is(t[a],c)||(t[a]=c,o())},updateWhere(a,c){let u=!1;for(let d=0;d<t.length;d++)if(a(t[d])){let g=c(t[d]);Object.is(t[d],g)||(t[d]=g,u=!0)}u&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let c=t.filter(a);c.length!==t.length&&(t=c,o())},map(a){let c=!1;for(let u=0;u<t.length;u++){let d=a(t[u],u);Object.is(t[u],d)||(t[u]=d,c=!0)}c&&o()},clear(){t.length!==0&&(t=[],o())}}]}function yu(e,t){let[n,r]=A(t),[o,i]=A(!1),[s,a]=A(null),[c,u]=A(0),d=0,g=!1,h=null,m=()=>{if(h===null)return;let f=h;h=null;try{f.abort()}catch{}},l=X(()=>{if(c(),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||u(f=>f+1)},dispose:()=>{g||(g=!0,l(),m())}}}function Ye(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[c,u]of e)if(!a.has(c)||!Ye(u,a.get(c),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let c of e)if(!a.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),c=new Uint8Array(t);if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==c[u])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,c=t;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==c[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,c)=>Ye(a,t[c],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&&Ye(e.cause,a.cause,n)&&vo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:vo(r,o,n)}function vo(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)&&Ye(e[i],t[i],n))}function vu(e){return A(e,{equals:(t,n)=>Ye(t,n)})}function je(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,c=()=>{o._d||s||(o._d=!0)};c._c=1,c._sig=o;let u=()=>{let l=e();o._v=r&&o._init&&r(o._v,l)?o._v:l,o._d=!1,o._init=!0};try{ie(()=>{o._v=e(),o._d=!1,o._init=!0},c)}catch(l){throw s=!0,Pe(c),l}let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,g=()=>{if(!o._d||s||a!==void 0)return;let l=o._v;i=!0;try{Ce(u,c),Object.is(l,o._v)||o.__v++}catch(f){a={error:f},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&Pe(c)}d&&!s&&!Object.is(l,o._v)&&se(d,"computed:update",{signal:o,oldValue:l,newValue:o._v})};o._validate=g;let h=()=>{let{error:l}=a;throw a=void 0,s&&(o._d=!1),l};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 yr()||s?(o._d&&(g(),a!==void 0&&h()),o._v):(o._d&&(g(),a!==void 0&&(Oe(o),h())),Oe(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,Pe(c);let l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(l)try{l.emit("computed:destroy",{signal:o,getter:m})}catch{}},d&&se(d,"computed:create",{signal:o,name:n,getter:m}),m}function Su(e){let[t,n]=A(e);return{get current(){return t()},set current(r){n(r)}}}function So(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function xu(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(c=>{let[u,d]=A(e[c]);So(t,c,[u,d])});let n=new Proxy({},{get(c,u){if(typeof u=="string"&&Object.hasOwn(t,u)){let d=t[u][0];return d()}return Reflect.get(c,u)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(t).forEach(u=>{So(c,u,t[u][0]())}),c};return[n,{setState:c=>{let u=r(),d=typeof c=="function"?c(u):c;z(()=>{Object.entries(d).forEach(([g,h])=>{Object.hasOwn(t,g)&&t[g][1](h)})})},reset:()=>{z(()=>{Object.keys(e).forEach(c=>{let u=t[c][1];u(e[c])})})},subscribe:c=>{let u=!0;return X(()=>{let d=r();if(u){u=!1;return}Le();try{c(d)}finally{Me()}})},subscribeKey:(c,u)=>{let d,g=!0;return X(()=>{let h=t[c][0]();if(g){d=h,g=!1;return}if(!Object.is(h,d)){let m=d;d=h,Le();try{u(h,m)}finally{Me()}}})},getSnapshot:r}]}function wu(e,t){if(de())return()=>{};let n,r=!0;return ie(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Le();try{t(s,a)}finally{Me()}}})}function Tu(e,t,n){return[je(e,n),i=>{z(()=>t(i))}]}function Eu(e){let t=e();return pe()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function ku(e){if(!pe())return X(e);let t=X(e),n=null;return queueMicrotask(()=>{try{n=X(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function xo(e,t){return de()?()=>{}:J(e,t)}var En="data-sibu-enhanced",kn=new WeakMap;function wo(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 To=["text","attr","class","show","on","cleanup"];function Eo(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 at(e,t){return xo(t,e)}function Cu(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 _u(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 Au(e,t,n,r){let o=`ctx.each[${r}]`;if(pe())for(let i of Object.keys(n))To.includes(i),`${o}${i}${To.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 Nt(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(En)==="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,c=(h,m,l)=>{if(a(h))return;let f=Eo(n,m);if(!f){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(m)} not found under`,n);return}l(f)},u={root:n,ref:h=>Eo(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,l,f)=>{c("on",h,b=>{let y=S=>l(S,b);b.addEventListener(m,y,f),r.push(()=>b.removeEventListener(m,y,f))})},text:(h,m)=>{c("text",h,l=>{r.push(at(l,()=>{let f=m(),b=f==null?"":String(f);l.textContent!==b&&(l.textContent=b)}))})},attr:(h,m,l)=>{c("attr",h,f=>{r.push(at(f,()=>{let b=l(),y=b==null?null:String(b);ae(f,m,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(h,m,l)=>{c("classed",h,f=>{r.push(at(f,()=>{f.classList.toggle(m,!!l())}))})},show:(h,m)=>{c("show",h,l=>{let f=l.hidden;r.push(at(l,()=>{l.hidden=!m()})),r.push(()=>{l.hidden=f})})},model:(h,m,l)=>{c("model",h,f=>{let b=f,[y,S]=m,v=l?.event??(b instanceof HTMLSelectElement||b instanceof HTMLInputElement&&(b.type==="checkbox"||b.type==="radio")?"change":"input");r.push(at(f,()=>{_u(b,y())}));let x=()=>S(Cu(b));b.addEventListener(v,x),r.push(()=>b.removeEventListener(v,x))})},each:(h,m)=>{if(a("each"))return;let l=typeof h=="string"?u.refs(h):Array.from(h);for(let f=0;f<l.length;f++){let b=l[f],y=m(b,f);y!=null&&Au(u,b,y,f)}},cleanup:h=>{a("cleanup")||r.push(h)}},d;try{d=t(u);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 wo(r,"enhance"),s=!0,h}typeof d=="function"&&r.push(d);let g=()=>{i||(i=!0,kn.get(n)===o&&(kn.delete(n),n.removeAttribute(En)),et(n,g),wo(r,"enhance"),s=!0)};return _(n,g),kn.set(n,o),n.setAttribute(En,"true"),g}function Nu(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Nt(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 Ru=/^[A-Za-z0-9_-]+$/,ko=Symbol.for("sibujs.islands.lazy"),Rt=st(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Lu(e){return e[ko]=!0,e}function Mu(e,t){if(!Ru.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Rt.set(e,t)}function Ou(e){Rt.delete(e)}async function Pu(e){if(typeof e=="function"&&e[ko]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function Du(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(!Rt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,c=()=>{if(a||o)return;a=!0;let d=Rt.get(s);d&&Pu(d).then(g=>{if(!o){if(!g){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let h=Nt(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)})},u=i.getAttribute("data-sibu-load")||"load";n.push($u(u,i,c,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function $u(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 Iu=new Set(["__proto__","constructor","prototype"]);function Cn(e){return Iu.has(e)}function Lt(e){let t={};for(let n of Object.keys(e))Cn(n)||(t[n]=e[n]);return t}function Co(e){return e}var kp=1024*1024;function Hu(e){let[t,n]=A(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=ie(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,c())},u}var _o=16;function Bu(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 Vu(){let[e,t]=A(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=c=>{s(),R(c,{phase:"async",name:"transition"})};Bu(()=>{try{let c=Ct(o());c?c.then(s,a):s()}catch(c){a(c)}})}return{pending:e,start:r}}function ju(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var Mt={};Ln(Mt,{RenderProp:()=>Xu,assertType:()=>sl,compose:()=>Zu,createGuard:()=>al,createSlots:()=>el,defineComponent:()=>tl,defineSlottedComponent:()=>nl,defineStrictComponent:()=>il,globalStore:()=>Ju,machine:()=>Fu,optimistic:()=>Wu,optimisticList:()=>qu,persisted:()=>zu,timeline:()=>Uu,validateProps:()=>Lo,validators:()=>ol,withBoundary:()=>Qu,withDefaults:()=>Yu,withProps:()=>rl,withWrapper:()=>Gu});function Ze(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Fu(e){let[t,n]=A(e.initial),[r,o]=A(e.context||{}),i=e.initial,s=r(),a=[],c=!1;function u(){c=!0;try{for(;a.length>0;)d(a.shift())}catch(f){throw a.length=0,f}finally{c=!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,...Lt(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),!c&&u()}let h=Ze(e.states,e.initial);if(h?.entry){c=!0;try{h.entry(s)}catch(f){throw a.length=0,f}finally{c=!1}a.length>0&&u()}function m(f){return t()===f}function l(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:l}}function zu(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)=>Cn(y)?void 0:S,s=n.deserialize||(y=>JSON.parse(y,i)),a=n.encrypt,c=n.decrypt,u=n.session?!1:n.syncTabs??!0,d=t;try{let y=r?r.getItem(e):null;if(y!==null){c&&(y=c(y));let S=s(y);d=n.validate&&!n.validate(S)?t:S}}catch{}let[g,h]=A(d),m=!1,l=X(()=>{let y=g();if(!m)try{let S=o(y);a&&(S=a(S)),r?.setItem(e,S)}catch{}}),f=null;return u&&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;c&&(S=c(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:()=>{l(),f&&typeof window<"u"&&(window.removeEventListener("storage",f),f=null)},enumerable:!1,writable:!1,configurable:!1}),[g,h]}function Wu(e){let[t,n]=A(e),[r,o]=A(!1),i=0,s=0;async function a(c,u){let d=++s,g=t();n(c),i++,o(!0);try{let h=await u();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 qu(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 c(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 u(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]=A(i.map(N=>s(o.get(N)))),[m,l]=A(!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{l(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=c(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),u(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 fe(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 G of i){let W=o.get(G),ee=a(W,k);N(ee)&&C.push({row:W,nextValue:{...ee,...w}})}let D=C.map(G=>G.row.id),$=[];S(()=>{E(D),f++;let G=!1;for(let W of C){let ee=s(W.row);$.push(c(W.row,k,W.nextValue)),W.row.visible&&!Object.is(ee,s(W.row))&&(G=!0)}return G});let U,Xe=!1;try{U=await L()}catch{Xe=!0}S(()=>{try{let G=!1;for(let W=0;W<$.length;W++){let ee=C[W].row,T=$[W],K=s(ee);Xe?u(ee,T):(T.value=U,T.settled=!0),d(ee),ee.visible&&!Object.is(K,s(ee))&&(G=!0)}return G}finally{B(D)}})}return{items:g,pending:m,add:q,remove:fe,update:ct}}function Uu(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]=A([e]),[o,i]=A(0),s=je(()=>n()[o()]),a=je(()=>o()>0),c=je(()=>o()<n().length-1);function u(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(){c()&&i(o()+1)}function h(){z(()=>{r([e]),i(0)})}function m(f){let b=n();f>=0&&f<b.length&&i(f)}function l(){s.dispose(),a.dispose(),c.dispose()}return{value:s,set:u,undo:d,redo:g,canUndo:a,canRedo:c,history:n,index:o,reset:h,jumpTo:m,dispose:l}}var No=Promise.prototype.then;function Ao(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(No,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function Ro(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(l){return{promise:Promise.reject(l),failedEarly:!0,probe:f=>queueMicrotask(f)}}if(typeof t!="function")return null;let n,r,o=new Promise((l,f)=>{n=l,r=f}),i="invoking",s,a=[],c=l=>{if(i=l,l!=="invoking")for(let f of a.splice(0))f()},u=l=>{n(l),c("fulfilled")},d=l=>{r(l),c("rejected")},g=l=>{if(l===o){d(new TypeError("adopt: a thenable resolved to its own adoption"));return}if(l===null||typeof l!="object"&&typeof l!="function"){u(l);return}let f;try{f=l.then}catch(b){d(b);return}if(typeof f!="function"){u(l);return}h(l,f)},h=(l,f)=>{f===No?(s=l,c("native")):c("invoking"),queueMicrotask(()=>{let b=!1,y=v=>{b||(b=!0,g(v))},S=v=>{b||(b=!0,d(v))};try{Reflect.apply(f,l,[y,S])}catch(v){S(v)}!b&&i==="invoking"&&c("pending")})};return h(e,t),{promise:o,failedEarly:!1,probe:(l,f)=>{let b=()=>{i==="native"?Ao(s,l,f):(i==="rejected"?l:f)()};i==="native"?Ao(s,l,f):i==="invoking"?a.push(b):queueMicrotask(i==="rejected"?l:f)}}}function Ku(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 Ju(e){let t=Ku(e.state),[n,r]=A({...t}),o=new Map,i=e.middleware||[];function s(l){if(o.size!==0){for(let f of Array.from(o.values()))if(f.active)try{f.callback(l)}catch(b){R(b,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],c=!1;function u(l,f=!0){if(a.push(l),c)return;c=!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,c=!1}if(y)throw b}function d(l,f){let b=e.actions[l];if(!b)throw new Error(`Unknown action: ${String(l)}`);let y=()=>{let S=n(),v=b(S,f),x=Lt(v);r({...S,...x}),s(n())};u(()=>{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 fe=()=>u(()=>S(v+1),!1);if(!q){fe();return}q.probe(()=>{E=!0,!1},fe)},q=null;try{q=Ro(i[v](n(),String(l),f,B))}catch(fe){throw E=!0,fe}finally{P=!1}q&&(q.failedEarly&&(E=!0),q.promise.then(void 0,fe=>{E=!0,R(fe,{phase:"async",name:"globalStore(middleware)"})}))};S(0)})}function g(l){return()=>l(n())}function h(l){let f=o.get(l);f||(f={callback:l,active:!0},o.set(l,f));let b=f;return()=>{o.get(l)===b&&(b.active=!1,o.delete(l))}}function m(){u(()=>{r({...t}),s(n())})}return{getState:n,select:g,dispatch:d,subscribe:h,reset:m}}function Gu(e,t){return n=>t(e,n)}function Yu(e,t){return n=>e({...t,...n})}function Zu(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function Xu(e){return e.render(e.data())}function Qu(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 el(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 tl(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function nl(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function rl(e,t){return n=>e(t(n))}var ol={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 Lo(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 il(e){return t=>{let n=Lo(t,e.props);return e.setup(n)}}function sl(e,t,n){}function al(e){return t=>e(t,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={...Mt,..._n,patterns:Mt});})();
|