sibujs 4.9.0 → 4.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +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-7OV5Q2UU.js → chunk-2D47RVVK.js} +4 -4
- package/dist/{chunk-5MLWTIQE.js → chunk-2T73SWKF.js} +2 -2
- package/dist/{chunk-YW6HQKGO.js → chunk-42REZXE4.js} +2 -2
- package/dist/{chunk-SBTZEYNI.js → chunk-6DYRY2NF.js} +8 -1
- package/dist/{chunk-562UVHMM.js → chunk-ADJEMTRC.js} +11 -6
- package/dist/{chunk-SYHGGDNW.js → chunk-BNZDDNBR.js} +1 -1
- package/dist/{chunk-K6K5ACO6.js → chunk-CID4BYBF.js} +3 -3
- package/dist/{chunk-TV464N2M.js → chunk-CYUU3XXG.js} +3 -3
- package/dist/{chunk-FNOK662L.js → chunk-CZINTERN.js} +73 -43
- package/dist/{chunk-CDBKFGXN.js → chunk-DA2LJXK3.js} +1 -1
- package/dist/{chunk-MPWDSTYK.js → chunk-DS6PFIZK.js} +1 -1
- package/dist/{chunk-XJVTQUIV.js → chunk-GEQNWNYS.js} +5 -5
- package/dist/{chunk-FHCZMHHE.js → chunk-GVVZPMA5.js} +1 -1
- package/dist/{chunk-NQMKWBKU.js → chunk-HZQEL575.js} +1 -1
- package/dist/{chunk-CF2KCWRE.js → chunk-JZMLRF2G.js} +2 -2
- package/dist/{chunk-X7NRHFZR.js → chunk-LK3VK47W.js} +1 -1
- package/dist/{chunk-2K3Z3XO4.js → chunk-LYM6TT2R.js} +4 -4
- package/dist/{chunk-KG25XMGP.js → chunk-MJZUXQHR.js} +15 -8
- package/dist/{chunk-G2WHYEL7.js → chunk-NROLUUCO.js} +39 -4
- package/dist/{chunk-DRMLIF6M.js → chunk-WHZKRSHQ.js} +19 -12
- package/dist/{chunk-QBKCK6MJ.js → chunk-YNE4FSVX.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 +32 -4
- package/dist/index.d.ts +32 -4
- 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
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`||e==="\r"||e==="\f"}function
|
|
3
|
-
`||e==="\r"||e==="\f"}function
|
|
1
|
+
"use strict";(()=>{var Bo=Object.defineProperty;var It=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Pn=(e,t)=>{for(var n in t)Bo(e,n,{get:t[n],enumerable:!0})};var Rn={};Pn(Rn,{DynamicComponent:()=>cu,ErrorBoundary:()=>Kc,ErrorDisplay:()=>wn,Fragment:()=>du,KeepAlive:()=>mu,Loading:()=>Yc,MAX_DRAIN_TEARDOWNS:()=>ve,Portal:()=>hu,SVG_NS:()=>H,Suspense:()=>Or,__renderParsedTemplate:()=>vo,__resetIdCounter:()=>uo,a:()=>Cs,abbr:()=>_s,action:()=>Zc,address:()=>ls,area:()=>Xs,array:()=>vu,article:()=>os,aside:()=>us,asyncDerived:()=>xu,audio:()=>Qs,autoResize:()=>so,b:()=>As,base:()=>Ka,batch:()=>q,bdi:()=>Ns,bdo:()=>Rs,bindDynamic:()=>kr,blockquote:()=>bs,body:()=>ts,br:()=>Ls,button:()=>at,canvas:()=>pa,caption:()=>ya,catchError:()=>Xc,catchErrorAsync:()=>Qc,center:()=>bc,checkLeaks:()=>Fn,circle:()=>Ya,cite:()=>Ms,clickOutside:()=>ro,clipPath:()=>ac,code:()=>dn,col:()=>va,colgroup:()=>Sa,context:()=>tu,copyOnClick:()=>io,createId:()=>co,customElement:()=>vc,data:()=>Os,datalist:()=>Aa,dd:()=>hs,deepEqual:()=>Qe,deepSignal:()=>wu,defer:()=>ju,defs:()=>sc,del:()=>ba,derived:()=>We,details:()=>ja,dfn:()=>Ps,dialog:()=>Fa,disableSSR:()=>Vr,dispose:()=>F,div:()=>O,dl:()=>ys,dt:()=>vs,each:()=>lu,effect:()=>ee,ellipse:()=>Za,em:()=>Ds,embed:()=>oa,enableSSR:()=>Br,enhance:()=>Mt,enhanceAll:()=>Mu,enqueueBatchedSignal:()=>Fe,external:()=>Hc,fieldset:()=>Na,figcaption:()=>Ss,figure:()=>xs,font:()=>hc,footer:()=>ss,form:()=>Ra,g:()=>Xa,getAction:()=>no,getRequestScopedCache:()=>Hr,getRuntimeErrorHandler:()=>In,getSSRStore:()=>je,getSlot:()=>yu,h1:()=>ds,h2:()=>fs,h3:()=>un,h4:()=>ps,h5:()=>ms,h6:()=>gs,head:()=>es,header:()=>is,hr:()=>ws,html:()=>yo,i:()=>$s,iframe:()=>ia,img:()=>ea,input:()=>La,ins:()=>ha,isBatching:()=>Ic,isSSR:()=>me,kbd:()=>Is,label:()=>Ma,lazy:()=>Mr,lazyIsland:()=>Pu,legend:()=>Oa,li:()=>Ts,line:()=>Qa,linearGradient:()=>lc,link:()=>Ja,longPress:()=>oo,main:()=>cs,map:()=>ta,mark:()=>Hs,marker:()=>gc,marquee:()=>yc,mask:()=>cc,match:()=>ou,math:()=>fa,menu:()=>za,meta:()=>Ga,meter:()=>Pa,mount:()=>gu,mountIslands:()=>Hu,nav:()=>as,nextTick:()=>Wu,noscript:()=>ma,object:()=>sa,ol:()=>Es,on:()=>Rc,onCleanup:()=>_c,onMount:()=>_t,onUnmount:()=>Cc,optgroup:()=>Da,option:()=>$a,output:()=>Ia,p:()=>cn,param:()=>aa,path:()=>ec,pattern:()=>uc,picture:()=>ca,polygon:()=>tc,polyline:()=>nc,portal:()=>ua,pre:()=>ln,progress:()=>Ha,q:()=>Bs,radialGradient:()=>dc,reactiveArray:()=>Su,rect:()=>rc,ref:()=>Tu,registerAction:()=>Xe,registerComponent:()=>iu,registerDisposer:()=>_,registerIsland:()=>Du,replaceChildrenSafely:()=>ne,reportDrainRunaway:()=>ke,reportError:()=>L,resolveComponent:()=>au,retrack:()=>Ne,rp:()=>Vs,rt:()=>js,ruby:()=>Fs,runInSSRContext:()=>jr,s:()=>zs,samp:()=>Ws,script:()=>ga,section:()=>rs,select:()=>Ba,setGlobalErrorHandler:()=>eu,setMaxDrainIterations:()=>wr,setRuntimeErrorHandler:()=>$n,show:()=>nu,signal:()=>A,slot:()=>qa,small:()=>qs,source:()=>la,span:()=>W,stop:()=>fc,store:()=>Eu,strict:()=>_u,strictEffect:()=>Au,strong:()=>Us,style:()=>He,sub:()=>Ks,summary:()=>Wa,sup:()=>Js,svg:()=>da,symbol:()=>mc,table:()=>xa,tagFactory:()=>p,takePendingError:()=>Et,tbody:()=>wa,td:()=>Ta,template:()=>Ua,text:()=>oc,textarea:()=>Va,tfoot:()=>Ea,th:()=>ka,thead:()=>Ca,time:()=>Gs,title:()=>ns,tr:()=>_a,track:()=>na,transition:()=>zu,trapFocus:()=>ao,trustHTML:()=>No,tspan:()=>ic,u:()=>Ys,ul:()=>ks,unregisterComponent:()=>su,unregisterDisposer:()=>rt,unregisterIsland:()=>$u,untracked:()=>pe,use:()=>pc,var_:()=>Zs,video:()=>ra,watch:()=>ku,when:()=>ru,withSSR:()=>Fr,writable:()=>Cu});var Dn=Symbol.for("sibujs.runtime-errors.v1");function Ht(){let e=globalThis,t=e[Dn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Dn]=n,n}function $n(e){let t=Ht(),n=t.handler;return t.handler=e,n}function In(){return Ht().handler}function Bt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Vo(e)}`;return new Error(t,{cause:e})}function Vo(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 jo(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Fo=Symbol.for("sibujs.reactive.v1");function zo(e){let t=globalThis[Fo];return t?.untracked?t.untracked(e):e()}var Wo="sibu:error-propagate";function qo(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Uo(n);if(!r)return!1;try{let o=new CustomEvent(Wo,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Uo(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 Ko(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${jo(t)}: ${e.message}`,e)}function L(e,t){let n=Bt(e);zo(()=>{if(qo(n,t))return;let r=Ht(),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--}}Ko(n,t)})}function be(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function j(e,t){if(!e)throw new Error(`[SibuJS] ${t}`)}function te(e){{let t=e();t&&console.warn(`[SibuJS] ${t}`)}}function P(e){console.warn(`[SibuJS] ${e}`)}var he=new WeakMap,ve=1e4;function ke(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 Le=0;function ft(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var oe=[];function Hn(){return ft(oe[oe.length-1])}function Bn(e){return e===null&&oe.length===0?!1:(oe.push(ft(e)),!0)}function Vn(){oe.pop()}function _(e,t){let n=he.get(e);n||(n=[],he.set(e,n)),n.push(t),Le++;let r=ft(oe[oe.length-1]);r&&r.entries.push([e,t])}function jn(e){let t={entries:[],closed:!1},n=t.entries;oe.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=ve){ke("rollback",s,n.length);break}let[a,c]=n.pop();if(rt(a,c)){s++;try{c()}catch(u){L(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,oe.pop()}throw i}t.closed=!0,oe.pop();let o=ft(oe[oe.length-1]);if(o){for(let i of n)he.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function rt(e,t){let n=he.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),Le--,n.length===0&&he.delete(e),!0)}function F(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--)Jo(n[r])}function Jo(e){if(!he.has(e))return;let t=0,n=!1;for(;!n;){let r=he.get(e);if(!r||r.length===0)break;let o=r.slice();he.delete(e),Le-=o.length;for(let i=0;i<o.length;i++){if(t>=ve){let s=o.slice(i),a=he.get(e);he.set(e,a?s.concat(a):s),Le+=s.length,ke("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){L(s,{phase:"cleanup",name:"disposer"})}}}}function ne(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++)F(n[r]);e.replaceChildren(...t)}function Fn(e=0){return e>0&&Le>e&&P(`checkLeaks: ${Le} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),Le}function qe(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Go=/[A-Z]/,Yo=/[A-Z]/g;function ie(e){return Go.test(e)?e.replace(Yo,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function Ce(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 Zo=["http:","https:","mailto:","tel:","ftp:"],Xo=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function mt(e){let t=qe(e).trim();if(!t)return"";let n=e.replace(Xo,"");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)&&Zo.indexOf(i)===-1?"":n}var Qo=/^\d+(\.\d+)?[wx]$/;function Vt(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function ei(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(Vt(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!Vt(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(Vt(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&&!Qo.test(a[0]))continue;let c=mt(s);c&&(c.startsWith(",")||c.endsWith(",")||n.push(a.length===1?`${c} ${a[0]}`:c))}return n.join(", ")}var ti=/[(:@\\]/;function ni(e){return e===" "||e===" "||e===`
|
|
3
|
+
`||e==="\r"||e==="\f"}function zn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function ri(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 mt(e){let t=0,n=e.length;for(;t<n&&Re(e[t]);)t++;for(;n>t&&Re(e[n-1]);)n--;return e.slice(t,n)}var ie=e=>({kind:"forbidden",reason:e});function oi(e){let t=mt(ze(e));if(t==="")return ie("empty content");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return ie("missing or non-numeric delay");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return ie("unparseable delay");for(;n<t.length&&Re(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return ie("unexpected text after delay");for(n++;n<t.length&&Re(t[n]);)n++;let o=n;for(;n<t.length&&!Re(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return ie(`unsupported refresh key ${JSON.stringify(i)}`);for(;n<t.length&&Re(t[n]);)n++;if(t[n]!=="=")return ie("missing '=' after url");for(n++;n<t.length&&Re(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return ie("unterminated quoted destination");if(s=t.slice(n+1,u),mt(t.slice(u+1))!=="")return ie("trailing text after quoted destination")}else if(s=mt(t.slice(n)),/[;,]/.test(s))return ie("multiple refresh assignments");if(s==="")return ie("empty destination");let l=dt(s);return l===""?ie("destination uses a disallowed protocol"):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function Vt(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=oe(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?ie(`duplicate case-insensitive attribute ${JSON.stringify(r)}`):typeof t!="string"?{kind:"not-refresh"}:mt(ze(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:oi(n)}var ii="http://www.w3.org/1999/xhtml",si="http://www.w3.org/2000/svg",ai=new Set(["script","iframe","object","embed","frame","frameset"]);function zn(e){return oe(e)}function qn(e){return ai.has(zn(e))}var li=new Set(["script","style"]);function Wn(e){return li.has(zn(e))}var B={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},ui=new Set(["src","href","xlink:href","type","language"]),ci=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),jt=new WeakSet;function Un(e){return e.namespaceURI===ii||e.namespaceURI===null}function Kn(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 di(e){jt.has(e)||(jt.add(e),e.getAttribute("content")!==null&&Vt(Kn(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function fi(e,t,n,r){if(!Un(e))return B.None;let o=oe(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&di(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return B.None;let i=Vt(Kn(e,o,n));return i.kind==="forbidden"?B.MetaRefreshForbidden:i.kind!=="not-refresh"&&jt.has(e)?B.MetaRefreshReactive:B.None}function pi(e,t){if(t===null||oe(e)!=="attributename")return B.None;let n=ze(t);return Vn(n)||Ee(n)||tt(n)?B.AnimationTarget:B.None}var gt=new WeakSet;function Fn(e){if(e===null)return!1;let t=oe(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function mi(e,t,n,r){if(!Un(e))return B.None;let o=oe(t);return o==="href"?r==="static"||n===null?B.None:Fn(e.getAttribute("rel"))?B.StylesheetSource:(gt.add(e),B.None):o==="rel"&&Fn(n)&>.has(e)&&e.hasAttribute("href")?B.StylesheetSource:B.None}function Ft(e,t,n,r){let o=e.localName;return o==="meta"?fi(e,t,n,r):o==="link"?mi(e,t,n,r):o==="script"?r==="static"||n===null?B.None:ui.has(oe(t))?B.ScriptSource:B.None:ci.has(o)&&e.namespaceURI===si?pi(t,n):B.None}function zt(e,t,n){e.localName!=="link"||oe(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?gt.add(e):gt.delete(e))}var gi="http://www.w3.org/1999/xhtml",bi="http://www.w3.org/2000/svg",hi="http://www.w3.org/1999/xlink",yi="http://www.w3.org/XML/1998/namespace",vi=new Set(["checked","disabled","selected"]);function Si(e){return e.namespaceURI===null||e.namespaceURI===gi}function Gn(e,t,n){ee(()=>`${e}: refusing "${t}" in this element's context \u2014 ${["",'the element would become a <meta http-equiv="refresh"> directive the shared refresh policy forbids (a destination outside the URL allowlist, or a directive too malformed to read unambiguously)',"a <meta> whose http-equiv or content is reactive may never carry a refresh directive: a browser schedules the navigation as soon as the directive is valid, and nothing can withdraw it when the state changes back","a runtime value may not choose the program a <script> runs; name the script in static template source, or load it through Head({ script }) as an explicit trust decision","an SVG animation may not target a URL, event-handler or nested-document attribute; its to / values would be written into that attribute without passing the URL policy",'a runtime-chosen href may not become an applied <link rel="stylesheet">: a well-formed URL is not a trusted stylesheet. Name the stylesheet in static template source, or load a runtime-chosen one through Head({ link }) as an explicit trust decision'][n]}. The write was not performed.`)}function Jn(e,t,n){e[t]=n}function xi(e,t){if(e.namespaceURI!==bi)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?hi:n.startsWith("xml:")?yi:null}function le(e,t,n,r={}){let o=Ti(e,t,n,r);return e.localName==="link"&&zt(e,t,r.reactive?"reactive":"runtime"),o}function Ti(e,t,n,r){let o=xi(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(Ee(t))return D(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${t}". Its value would be evaluated as JavaScript. Use on:{ ${t.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Ft(e,t,s,r.reactive?"reactive":"runtime");if(a!==B.None)return Gn(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 D(`${r.label??"setSafeAttribute"}: refusing to set "${t}". The browser parses this attribute as a nested HTML document, so a generic string value cannot be made safe \u2014 attribute escaping is undone before the parse. Build the frame's content another way.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let l=Si(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&&vi.has(u)&&u in e?Jn(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 Jn(e,u,u==="checked"?!!n:d),!0;let g=d===""?"":jn(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 qt(e,t,n){if(tt(t))return D(`html: refusing static attribute "${t}" \u2014 the browser parses it as a nested document.`),!1;let r=Ft(e,t,n,"static");return r!==B.None?(Gn("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&zt(e,t,"static"),!0)}var wi=4096,Wt=[];function Ei(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function ki(e,t,n){let r=Wt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Ei();return o.sig=e,o.sub=t,o.epoch=n,o}function Yn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Wt.length<wi&&Wt.push(e)}function Ci(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 Zn(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 _i(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function Ai(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 ce=null,ye=null,ke=0,Ce=[],ue=new Set,Ni=[];function Ri(e){try{e()}catch(t){let n=e;L(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Li(e){let t=e.depsHead??null;if(t===null)return!0;for(;t!==null;){let n=t.sig;if(n===null)return!0;if(n._d===!0&&n._validate!==void 0)try{n._validate()}catch{return!0}if(t.depVersion!==n.__v)return!0;t=t.subNext}return!1}var be=0,ve=!1;function Kt(){be===0&&(ye=ce,ce=null,ve=!0),be++}function Jt(){be--,be===0&&(ce=ye,ye=null,ve=!1)}function Xn(){return ve}function Qn(e){Kt();try{return e()}finally{Jt()}}var Mi=0;function Gt(e,t){let n=ce,r=0,o=null;ve&&(r=be,o=ye,be=0,ye=null,ve=!1),ce=t;let i=t;i._cap===void 0&&(i._cap=Rn());let s=++Mi;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{ce=n,r!==0&&(be=r,ye=o,ve=!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&&(Ai(a),Zn(a),Yn(a)),a=l}}}function er(e,t){if(!t)return Yt(e);qe(t);let n=ce,r=0,o=null;ve&&(r=be,o=ye,be=0,ye=null,ve=!1),ce=t;try{e()}finally{ce=n,r!==0&&(be=r,ye=o,ve=!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=()=>qe(t))}function Yt(e,t){let n=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{Gt(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,qe(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,qe(r)})}function tr(e){if(!ce)return;let t=ce,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=ki(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,_i(t,i),Ci(n,i),t._structDirty=!0}function qe(e){let t=e,n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;Zn(n),Yn(n),n=r}}var bt=1e3,ht=1e6,yt=0,Le=new Set;function nr(e){let t=bt;return Number.isFinite(e)&&e>0&&(bt=Math.floor(e)),t}function rr(e){let t=ht;return Number.isFinite(e)&&e>0&&(ht=Math.floor(e)),t}function Pi(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 Di(e){let t=e.__name??"<unnamed>";L(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 Oi(){L(new Error(`Notification drain exceeded ${ht} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function or(){let e=0;for(;e<Ce.length;){if(e>=ht){Oi();break}let t=Ce[e++];if(ue.delete(t),Le.size>0&&Le.has(t)||t._hasComputedDep===!0&&!Li(t))continue;if(Pi(t)){Di(t),Le.add(t);continue}let n=Ln(t._cap??null);try{Ri(t)}finally{n&&Mn()}}}function ir(){if(!(ke>0)){ke++,yt++;try{or()}finally{ke--,ke===0&&(Ce.length=0,ue.clear(),Le.size>0&&Le.clear())}}}function Ut(e){e();let t=e._sig;if(!t)return;let n=Ni,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 ue.has(s)||(ue.add(s),Ce.push(s));i=i.sigNext}}}function sr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Ut(r):ue.has(r)||(ue.add(r),Ce.push(r))),n=n.sigNext}}function ar(e){let n=e.subsHead;if(n){if(ke>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Ut(o):ue.has(o)||(ue.add(o),Ce.push(o))),r=r.sigNext}return}ke++,yt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Ut(o):ue.has(o)||(ue.add(o),Ce.push(o))),r=r.sigNext}or()}finally{ke--,ke===0&&(Ce.length=0,ue.clear(),Le.size>0&&Le.clear())}}}function lr(e){return e.__sc??0}function ur(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function cr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var dr="4.9.0",fr=Symbol.for("sibujs.reactive.v1");function Ii(){let e=globalThis,t=e[fr];if(t)return!t.__dupWarned&&(t.__dupWarned=!0,D(`Multiple instances of the reactive runtime detected on this page (active: ${t.version}, duplicate: ${dr}). Reactivity is NOT broken and no bundler configuration is required: every copy routes through the first one via a global registry, so signal writes still reach subscribers registered by any copy. This is only a SIZE issue \u2014 the duplicate copy's bytes are downloaded and parsed for nothing. If you want them back, de-duplicate sibujs in your bundler (Vite: resolve.dedupe: ['sibujs']). Mismatched VERSIONS above are worth fixing regardless, since only the first one loaded is used.`)),t;let n={suspendTracking:Kt,resumeTracking:Jt,isTrackingSuspended:Xn,untracked:Qn,retrack:Gt,track:er,reactiveBinding:Yt,recordDependency:tr,cleanup:qe,setMaxSubscriberRepeats:nr,setMaxDrainIterations:rr,drainNotificationQueue:ir,queueSignalNotification:sr,notifySubscribers:ar,getSubscriberCount:lr,getSubscriberDeps:ur,forEachSubscriber:cr,version:dr};return e[fr]=n,n}var J=Ii(),Me=J.suspendTracking,Pe=J.resumeTracking,pr=J.isTrackingSuspended,de=J.untracked,_e=J.retrack,se=J.track,Y=J.reactiveBinding,De=J.recordDependency,Oe=J.cleanup,xc=J.setMaxSubscriberRepeats,mr=J.setMaxDrainIterations,gr=J.drainNotificationQueue,br=J.queueSignalNotification,We=J.notifySubscribers,Tc=J.getSubscriberCount,wc=J.getSubscriberDeps,Ec=J.forEachSubscriber;function nt(e,t,n){if(Ee(t))return le(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){L(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}le(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return Y(r,e)}function hr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){L(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){L(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),le(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=Y(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Zt=["data-focus-key","id","name"],Hi=new Set(["text","search","url","tel","password",""]);function Bi(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Hi.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<Zt.length;i++){let s=t.getAttribute(Zt[i]);if(s){r=Zt[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Bi(t)}}function Vi(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function ji(e,t){let n=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(t)&&(r++,n??(n=s));let a=s.querySelectorAll(t);for(let l=0;l<a.length;l++)r++,n??(n=a[l]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function yr(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){yr(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=ji(t,`[${e.attr}=${Vi(e.value)}]`);if(i&&i.tagName===e.tag){yr(i,e);return}o=s>1}ee(()=>{let i=e.attr?` (${e.attr}="${e.value}")`:"",s=o?`several elements in the rebuilt subtree share ${e.attr}="${e.value}", so there is no way to tell which one the user was in \u2014 a shared name (a radio group) identifies a GROUP, not a control. Add a unique id or data-focus-key to each`:"no element in the rebuilt subtree carries the same identity. Give it a stable id, name, or data-focus-key that the rebuild reproduces";return`${n}: a reactive rebuild discarded the focused element <${e.tag.toLowerCase()}>${i} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${s}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them.`})}function Se(e,t){let n=[];function r(){let o;try{o=t()}catch(d){L(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];F(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)){D("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");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)||(F(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 Y(r,e)}var H="http://www.w3.org/2000/svg",Fi=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Xt=new Set,vr=100,Sr=!1,xr=new Map;function Tr(e){let t=xr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),xr.set(e,t)),t}function zi(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=Y(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",pt(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=Tr(d);u.push(h),l.setProperty(h,ft(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",pt(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Tr(r);if(typeof o=="function"){let s=o,a=Y(()=>{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 qi(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=Y(()=>{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=Y(()=>{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 Qt(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,Se(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),_(e,Se(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),_(e,Se(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function p(e,t){let n=qn(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),Qt(i,o),i):(ee(()=>{let m=r.trim().split(/\s+/);if(m.length<2)return"";let c=0;for(let b=0;b<m.length;b++){let y=m[b];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&c++}if(c<2)return"";let f=`${e}|${r}`;return Xt.has(f)?"":Xt.size>=vr?Sr?"":(Sr=!0,`tagFactory: ${vr} distinct lone-string class warnings have been reported; suppressing further ones for the rest of this session so they cannot flood the console. Fix the reported ones and reload to see any that remain.`):(Xt.add(f),`tagFactory: lone string "${r}" looks like a class list but is being rendered as TEXT. For a class, use ${e}({ class: "${r}" }) \u2014 or ${e}("${r}", children) to set the class AND add children.`)}),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 Qt(i,r),i;let s=r,a=s.class;a!=null&&qi(i,a);let l=s.id;typeof l=="function"?_(i,nt(i,"id",l)):l!=null&&(typeof l=="string"&&Fi.has(l.toLowerCase())&&D(`tagFactory: element id="${l}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=l);let u=o!==void 0?o:s.nodes;u!=null&&Qt(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):D(`tagFactory: on.${m} handler is not a function (got ${typeof c}). Event listener was not attached.`)}let g=s.style;g!=null&&zi(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||Ee(m))continue;typeof c=="function"?_(i,nt(i,m,c)):le(i,m,c,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var Gc=p("html"),Wi=p("head"),Ui=p("body"),Ki=p("title"),P=p("div"),z=p("span"),Ji=p("section"),Gi=p("article"),Yi=p("header"),Zi=p("footer"),Xi=p("nav"),Qi=p("main"),es=p("aside"),ts=p("address"),en=p("p"),ns=p("h1"),rs=p("h2"),tn=p("h3"),os=p("h4"),is=p("h5"),ss=p("h6"),as=p("blockquote"),ls=p("dd"),us=p("dl"),cs=p("dt"),ds=p("figcaption"),fs=p("figure"),ps=p("hr"),ms=p("li"),gs=p("ol"),bs=p("ul"),nn=p("pre"),hs=p("a"),ys=p("abbr"),vs=p("b"),Ss=p("bdi"),xs=p("bdo"),Ts=p("br"),ws=p("cite"),rn=p("code"),Es=p("data"),ks=p("dfn"),Cs=p("em"),_s=p("i"),As=p("kbd"),Ns=p("mark"),Rs=p("q"),Ls=p("rp"),Ms=p("rt"),Ps=p("ruby"),Ds=p("s"),Os=p("samp"),$s=p("small"),Is=p("strong"),Hs=p("sub"),Bs=p("sup"),Vs=p("time"),js=p("u"),Fs=p("var"),zs=p("area"),qs=p("audio"),Ws=p("img"),Us=p("map"),Ks=p("track"),Js=p("video"),Gs=p("embed"),Ys=p("iframe"),Zs=p("object"),Xs=p("param"),Qs=p("picture"),ea=p("portal"),ta=p("source"),na=p("svg",H),ra=p("math"),oa=p("canvas"),ia=p("noscript"),sa=p("script"),aa=p("del"),la=p("ins"),ua=p("caption"),ca=p("col"),da=p("colgroup"),fa=p("table"),pa=p("tbody"),ma=p("td"),ga=p("tfoot"),ba=p("th"),ha=p("thead"),ya=p("tr"),ot=p("button"),va=p("datalist"),Sa=p("fieldset"),xa=p("form"),Ta=p("input"),wa=p("label"),Ea=p("legend"),ka=p("meter"),Ca=p("optgroup"),_a=p("option"),Aa=p("output"),Na=p("progress"),Ra=p("select"),La=p("textarea"),Ma=p("details"),Pa=p("dialog"),Da=p("menu"),Oa=p("summary"),$a=p("slot"),Ia=p("template"),Ha=p("base"),Ba=p("link"),Va=p("meta"),$e=p("style"),ja=p("circle",H),Fa=p("ellipse",H),za=p("g",H),qa=p("line",H),Wa=p("path",H),Ua=p("polygon",H),Ka=p("polyline",H),Ja=p("rect",H),Ga=p("text",H),Ya=p("tspan",H),Za=p("defs",H),Xa=p("clipPath",H),Qa=p("mask",H),el=p("pattern",H),tl=p("linearGradient",H),nl=p("radialGradient",H),rl=p("stop",H),ol=p("use",H),il=p("symbol",H),sl=p("marker",H),al=p("center"),ll=p("font"),ul=p("marquee"),cl=e=>p(e);var on="__sibuPendingError";function wr(e,t){let n=()=>e.parentNode?(L(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[on]=t)})}function vt(e){let t=e,n=t[on];if(n instanceof Error)return delete t[on],n}function Er(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();te(r,s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));te(r,P({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),wr(r,s)}),r.appendChild(z("sibu-lazy-loading","Loading...")),_(r,()=>{o=!0}),r}}function kr({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)&&F(s)}),queueMicrotask(()=>{if(!o)try{let a=e();if(s=a,a.classList.contains("sibu-lazy")){if(!a.querySelector(".sibu-lazy-loading")){te(n,a);return}i=new MutationObserver(()=>{if(o)return;a.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,te(n,a))}),i.observe(a,{childList:!0,subtree:!0})}else te(n,a)}catch(a){let l=a instanceof Error?a:new Error(String(a));wr(n,l)}}),n}function xt(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";L(n,{phase:r,name:t});return}}function sn(e,t,n,r){let o=xt(e,t);typeof o=="function"&&(r()||!n.isConnected?xt(o,"onUnmount"):_r(o,n))}var Ke=new WeakMap,Ie=new WeakMap,xe=new Set,Te=new Set,Je=null,St=0,dl=256;function an(e){let t=Ke.get(e);if(t){Ke.delete(e),xe.delete(e);for(let n of t)try{n()}catch{}}}function ln(e){Ie.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Ie.get(e);if(n){Ie.delete(e),Te.delete(e);for(let r of n)try{r()}catch{}}})}function fl(e){if(xe.size===0||e.nodeType!==1)return;let t=e;if(xe.has(t)&&t.isConnected&&an(t),t.firstElementChild)for(let n of Array.from(xe))n!==t&&n.isConnected&&t.contains(n)&&an(n)}function pl(e){if(Te.size===0||e.nodeType!==1)return;let t=e;if(Te.has(t)&&!t.isConnected&&ln(t),t.firstElementChild)for(let n of Array.from(Te))n!==t&&!n.isConnected&&t.contains(n)&&ln(n)}function ml(){if(xe.size>0)for(let e of Array.from(xe))e.isConnected&&an(e);if(Te.size>0)for(let e of Array.from(Te))e.isConnected||ln(e)}function Cr(){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++)fl(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)pl(t.removedNodes[n])}St+=e.length,St>=dl&&(St=0,ml()),un()}),Je.observe(document.body,{childList:!0,subtree:!0}))}function un(){Je&&xe.size===0&&Te.size===0&&(Je.disconnect(),Je=null,St=0)}function gl(e,t){let n=Ke.get(e);return n||(n=[],Ke.set(e,n)),n.push(t),xe.add(e),Cr(),()=>{let r=Ke.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ke.delete(e),xe.delete(e))}un()}}function bl(e,t){let n=Ie.get(e);return n||(n=[],Ie.set(e,n)),n.push(t),Te.add(e),Cr(),()=>{let r=Ie.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ie.delete(e),Te.delete(e))}un()}}function Tt(e,t){if(!(typeof document>"u"))if(t){let n=!1,r=()=>n;if(_(t,()=>{n=!0}),t.isConnected){queueMicrotask(()=>{n||sn(e,"onMount",t,r)});return}queueMicrotask(()=>{if(n)return;if(t.isConnected){sn(e,"onMount",t,r);return}let o=gl(t,()=>{n||sn(e,"onMount",t,r)});_(t,o)})}else queueMicrotask(()=>{xt(e,"onMount")})}function _r(e,t){if(typeof document>"u")return;let n=!1,r=()=>{n||(n=!0,xt(e,"onUnmount"))};_(t,r);let o=()=>{if(n)return;let i=bl(t,r);_(t,i)};t.isConnected?o():Tt(()=>{o()},t)}function hl(e,t){_(t,e)}function ae(e,t,n){try{e.emit(t,n)}catch{}}var cn=Symbol.for("sibujs.ssr.v1");function yl(){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 Mt=="function"&&(t=Mt("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var Ae=globalThis[cn]??(globalThis[cn]=yl()),He=Ae.als,X=Ae.fallbackStore;Ae.fallbackDepth??(Ae.fallbackDepth=0);var Ar=!1;function vl(){if(Ar||He||!(typeof process<"u"&&!!process.versions?.node))return;Ar=!0;let t=process.versions.node;D(`SSR request isolation is UNAVAILABLE on this runtime (Node ${t}). AsyncLocalStorage could not be loaded, so concurrent requests share one SSR store: request state and the query cache can bleed between them. Node >= 22.3 is required for isolated SSR under ESM; the CommonJS build works on older versions. A fully synchronous render is unaffected.`)}function Be(){if(He){let e=He.getStore();if(e)return e}return X}function Nr(){return He?He.getStore()??null:Ae.fallbackDepth>0?X:null}function fe(){return Be().ssr}function Rr(e){if(!fe())return null;let t=Be(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function Lr(){Be().ssr=!0}function Mr(){Be().ssr=!1}function Pr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(He)return He.run(t,e);vl();let n=X.ssr,r=X.suspenseIdCounter,o=X.idCounter,i=X.locale;X.ssr=!0,X.suspenseIdCounter=0,X.idCounter=0,X.locale=void 0,Ae.fallbackDepth++;try{return e()}finally{Ae.fallbackDepth--,X.ssr=n,X.suspenseIdCounter=r,X.idCounter=o,X.locale=i}}function Dr(e){let t=Be(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Ir=globalThis;function Sl(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,de(()=>t(o,void 0));else{let i=n;n=o,de(()=>t(o,i))}}}var Or=100;function wt(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){L(r,{phase:"cleanup"})}}}function $r(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&wt(e),_e(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Or);e.rerunPending&&(e.rerunPending=!1,L(new Error(`effect re-requested itself ${Or}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function xl(e){if(e.disposed)return;e.disposed=!0;let t=Ir.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&wt(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Oe(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function Q(e,t){if(j(typeof e=="function","effect: argument must be a function."),fe())return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=s=>{n.userCleanups.push(s)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(s){r(s)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&wt(n),_e(n.bodyFn,o),n.rerunPending&&$r(n)}finally{n.running=!1,n.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,n.subscriber=o,n.running=!0;try{_e(n.bodyFn,n.subscriber),n.rerunPending&&$r(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&wt(n),Oe(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=Ir.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&ae(i,"effect:create",{effectFn:e}),()=>xl(n)}var it=0,dn=new Set;function Tl(e){it++;try{return e()}finally{it--,it===0&&kl()}}function wl(e){return it===0?!1:(dn.add(e),!0)}function El(){return it>0}function kl(){try{for(let e of dn)br(e)}finally{dn.clear()}gr()}var Hr=Symbol.for("sibujs.reactive.batch.v1");function Cl(){let e=globalThis,t=e[Hr];if(t)return t;let n={batch:Tl,enqueueBatchedSignal:wl,isBatching:El};return e[Hr]=n,n}var fn=Cl(),q=fn.batch,Ve=fn.enqueueBatchedSignal,_l=fn.isBatching;var pn=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=t?.name,o=t?.equals;r&&(n.__name=r);function i(){return De(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++,!0){let d=pn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&ae(d,"signal:update",{signal:n,name:r,oldValue:l,newValue:u})}Ve(n)||We(n)}}:s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;if(Object.is(u,l))return;n.value=u,n.__v++;let d=pn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&ae(d,"signal:update",{signal:n,name:r,oldValue:l,newValue:u}),Ve(n)||We(n)},!0){let a=pn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&ae(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function Al(e){let[t,n]=A(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Nl=`
|
|
5
|
+
`?2:1;continue}if(zn(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&zn(e[s]);)i+=e[s],s++;s<e.length&&ni(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 Wn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],oi=4,ii=5,si=8;function ai(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 jt=new Set,qn=100,Un=!1;function pt(e,t,n){te(()=>{let r=["url() in an inline style is an exfiltration channel: the browser fetches it immediately and the URL's path or query can carry page data off-origin","expression() executes arbitrary script in legacy engines","the javascript: scheme executes script","the vbscript: scheme executes script","-moz-binding loads and runs remote XBL","behavior: loads and runs a remote HTC script","@import pulls in a remote stylesheet","image-set() fetches remote images, the same exfiltration channel as url()","filter:progid activates legacy scriptable filters","image() fetches its string argument as a URL, the same exfiltration channel as url()","src() fetches its string argument as a URL, the same exfiltration channel as url()"],o=n?.property?`${n.property}: ${e}`:e,i=ai(n?.element),s=`${i}|${o}`;return jt.has(s)?"":jt.size>=qn?Un?"":(Un=!0,`${qn} distinct dropped style declarations have been reported; suppressing further ones for the rest of this session so they cannot flood the console. The declarations are still dropped \u2014 only the reporting stops. Fix the reported ones and reload to see any that remain.`):(jt.add(s),`style declaration "${o}" was dropped by the style sanitizer on ${i} \u2014 ${r[t]}. The element renders without it, which usually looks like a missing image rather than an error. Sanctioned alternatives: for a content image use an <img> element (or a <picture>); for decoration, put the rule in a stylesheet and set a class instead \u2014 stylesheet CSS is not sanitized, only inline style attributes are. If this declaration is not yours, it came from untrusted data and the drop just prevented an exfiltration.`)})}function Kn(e){return(e.includes("\\")?ri(e):e).toLowerCase().replace(/\s+/g,"")}function Ft(e){if(!ti.test(e))return-1;let t=Kn(e);for(let n=0;n<Wn.length;n++)if(t.includes(Wn[n]))return n;return-1}function gt(e,t,n){let r=zt(e,t);return r===-1?t:(pt(t,r,{property:e,element:n?.element}),"")}function zt(e,t){let n=Ft(t);if(n!==-1)return n;let r=ie(e);return r==="behavior"?ii:r==="-moz-binding"?oi:(r==="filter"||r==="-ms-filter")&&Kn(t).includes("progid:")?si:-1}function ci(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:ie(c);i.push([g,u,d!==null])}return i}function ui(e,t){let n=String(e),r=ci(n);if(r===null)return Ft(n)!==-1&&pt(n,Ft(n),t),"";let o=[];for(let[i,s,a]of r){let c=zt(i,s);if(c!==-1){pt(s,c,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function bt(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return ui(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=zt(s,a);if(c!==-1){pt(a,c,{property:s,element:t?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var Wt=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),li=new Set(["srcdoc"]);function ot(e){return li.has(e.toLowerCase())}function Jn(e){return Wt.has(e.toLowerCase())}function di(e){let t=e.toLowerCase();return t==="style"||Wt.has(t)}function fi(e,t,n){let r=e.toLowerCase();return r==="srcset"?ei(t):Wt.has(r)?mt(t):r==="style"?bt(t,n):t}function Gn(e,t,n){if(!di(e))return t;let r=fi(e,t,n);return r===""?null:r}function Me(e){return e===" "||e===" "||e===`
|
|
7
|
+
`||e==="\r"||e==="\f"}function ht(e){let t=0,n=e.length;for(;t<n&&Me(e[t]);)t++;for(;n>t&&Me(e[n-1]);)n--;return e.slice(t,n)}var se=e=>({kind:"forbidden",reason:e});function pi(e){let t=ht(qe(e));if(t==="")return se("empty content");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return se("missing or non-numeric delay");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return se("unparseable delay");for(;n<t.length&&Me(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return se("unexpected text after delay");for(n++;n<t.length&&Me(t[n]);)n++;let o=n;for(;n<t.length&&!Me(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return se(`unsupported refresh key ${JSON.stringify(i)}`);for(;n<t.length&&Me(t[n]);)n++;if(t[n]!=="=")return se("missing '=' after url");for(n++;n<t.length&&Me(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return se("unterminated quoted destination");if(s=t.slice(n+1,u),ht(t.slice(u+1))!=="")return se("trailing text after quoted destination")}else if(s=ht(t.slice(n)),/[;,]/.test(s))return se("multiple refresh assignments");if(s==="")return se("empty destination");let c=mt(s);return c===""?se("destination uses a disallowed protocol"):{kind:"allowed",delay:r,destination:s,sanitizedDestination:c}}function qt(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=ie(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?se(`duplicate case-insensitive attribute ${JSON.stringify(r)}`):typeof t!="string"?{kind:"not-refresh"}:ht(qe(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:pi(n)}var mi="http://www.w3.org/1999/xhtml",gi="http://www.w3.org/2000/svg",bi=new Set(["script","iframe","object","embed","frame","frameset"]);function Zn(e){return ie(e)}function Xn(e){return bi.has(Zn(e))}var hi=new Set(["script","style"]);function Qn(e){return hi.has(Zn(e))}var B={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},yi=new Set(["src","href","xlink:href","type","language"]),vi=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Ut=new WeakSet;function er(e){return e.namespaceURI===mi||e.namespaceURI===null}function tr(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 Si(e){Ut.has(e)||(Ut.add(e),e.getAttribute("content")!==null&&qt(tr(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function xi(e,t,n,r){if(!er(e))return B.None;let o=ie(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&Si(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return B.None;let i=qt(tr(e,o,n));return i.kind==="forbidden"?B.MetaRefreshForbidden:i.kind!=="not-refresh"&&Ut.has(e)?B.MetaRefreshReactive:B.None}function wi(e,t){if(t===null||ie(e)!=="attributename")return B.None;let n=qe(t);return Jn(n)||Ce(n)||ot(n)?B.AnimationTarget:B.None}var yt=new WeakSet;function Yn(e){if(e===null)return!1;let t=ie(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 Ti(e,t,n,r){if(!er(e))return B.None;let o=ie(t);return o==="href"?r==="static"||n===null?B.None:Yn(e.getAttribute("rel"))?B.StylesheetSource:(yt.add(e),B.None):o==="rel"&&Yn(n)&&yt.has(e)&&e.hasAttribute("href")?B.StylesheetSource:B.None}function Kt(e,t,n,r){let o=e.localName;return o==="meta"?xi(e,t,n,r):o==="link"?Ti(e,t,n,r):o==="script"?r==="static"||n===null?B.None:yi.has(ie(t))?B.ScriptSource:B.None:vi.has(o)&&e.namespaceURI===gi?wi(t,n):B.None}function Jt(e,t,n){e.localName!=="link"||ie(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?yt.add(e):yt.delete(e))}var Ei="http://www.w3.org/1999/xhtml",ki="http://www.w3.org/2000/svg",Ci="http://www.w3.org/1999/xlink",_i="http://www.w3.org/XML/1998/namespace",Ai=new Set(["checked","disabled","selected"]);function Ni(e){return e.namespaceURI===null||e.namespaceURI===Ei}function rr(e,t,n){te(()=>`${e}: refusing "${t}" in this element's context \u2014 ${["",'the element would become a <meta http-equiv="refresh"> directive the shared refresh policy forbids (a destination outside the URL allowlist, or a directive too malformed to read unambiguously)',"a <meta> whose http-equiv or content is reactive may never carry a refresh directive: a browser schedules the navigation as soon as the directive is valid, and nothing can withdraw it when the state changes back","a runtime value may not choose the program a <script> runs; name the script in static template source, or load it through Head({ script }) as an explicit trust decision","an SVG animation may not target a URL, event-handler or nested-document attribute; its to / values would be written into that attribute without passing the URL policy",'a runtime-chosen href may not become an applied <link rel="stylesheet">: a well-formed URL is not a trusted stylesheet. Name the stylesheet in static template source, or load a runtime-chosen one through Head({ link }) as an explicit trust decision'][n]}. The write was not performed.`)}function nr(e,t,n){e[t]=n}function Ri(e,t){if(e.namespaceURI!==ki)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Ci:n.startsWith("xml:")?_i:null}function le(e,t,n,r={}){let o=Li(e,t,n,r);return e.localName==="link"&&Jt(e,t,r.reactive?"reactive":"runtime"),o}function Li(e,t,n,r){let o=Ri(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(Ce(t))return P(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${t}". Its value would be evaluated as JavaScript. Use on:{ ${t.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Kt(e,t,s,r.reactive?"reactive":"runtime");if(a!==B.None)return rr(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(ot(t))return P(`${r.label??"setSafeAttribute"}: refusing to set "${t}". The browser parses this attribute as a nested HTML document, so a generic string value cannot be made safe \u2014 attribute escaping is undone before the parse. Build the frame's content another way.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let c=Ni(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&&Ai.has(u)&&u in e?nr(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 nr(e,u,u==="checked"?!!n:d),!0;let g=d===""?"":Gn(t,d,{element:e});return g===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===g||(o?e.setAttributeNS(o,t,g):e.setAttribute(t,g)),!0)}function Gt(e,t,n){if(ot(t))return P(`html: refusing static attribute "${t}" \u2014 the browser parses it as a nested document.`),!1;let r=Kt(e,t,n,"static");return r!==B.None?(rr("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Jt(e,t,"static"),!0)}var Mi=4096,Yt=[];function Oi(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Pi(e,t,n){let r=Yt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Oi();return o.sig=e,o.sub=t,o.epoch=n,o}function or(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Yt.length<Mi&&Yt.push(e)}function Di(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 ir(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 $i(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function Ii(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 fe=null,Se=null,_e=0,Ae=[],de=new Set,Hi=[];function Bi(e){try{e()}catch(t){let n=e;L(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Vi(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 ye=0,xe=!1;function Xt(){ye===0&&(Se=fe,fe=null,xe=!0),ye++}function Qt(){ye--,ye===0&&(fe=Se,Se=null,xe=!1)}function sr(){return xe}function ar(e){Xt();try{return e()}finally{Qt()}}var ae=null;function en(){return ae}function wt(e,t){let n=ae;ae=e;try{return t()}finally{ae=n}}function tn(e){let t=ae;return t===null?e:(...n)=>wt(t,()=>e(...n))}var ji=0;function nn(e,t){let n=fe,r=0,o=null;xe&&(r=ye,o=Se,ye=0,Se=null,xe=!1),fe=t;let i=t;i._cap===void 0&&(i._cap=Hn());let s=ae;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(ae=a);let c=++ji;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{fe=n,ae=s,r!==0&&(ye=r,Se=o,xe=!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&&(Ii(u),ir(u),or(u)),u=d}}}function cr(e,t){if(!t)return rn(e);Ue(t);let n=fe,r=0,o=null;xe&&(r=ye,o=Se,ye=0,Se=null,xe=!1),fe=t;let i=t;i._scope===void 0&&(i._scope=ae);let s=ae;ae=i._scope;try{e()}finally{fe=n,ae=s,r!==0&&(ye=r,Se=o,xe=!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=()=>Ue(t))}function rn(e,t){let n=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{nn(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,Ue(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,Ue(r)})}function ur(e){if(!fe)return;let t=fe,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=Pi(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,$i(t,i),Di(n,i),t._structDirty=!0}function Ue(e){let t=e,n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;ir(n),or(n),n=r}}var vt=1e3,St=1e6,xt=0,Oe=new Set;function lr(e){let t=vt;return Number.isFinite(e)&&e>0&&(vt=Math.floor(e)),t}function dr(e){let t=St;return Number.isFinite(e)&&e>0&&(St=Math.floor(e)),t}function Fi(e){let t=e;return t._runEpoch!==xt?(t._runEpoch=xt,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>vt)}function zi(e){let t=e.__name??"<unnamed>";L(new Error(`subscriber "${t}" fired more than ${vt} 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 Wi(){L(new Error(`Notification drain exceeded ${St} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function fr(){let e=0;for(;e<Ae.length;){if(e>=St){Wi();break}let t=Ae[e++];if(de.delete(t),Oe.size>0&&Oe.has(t)||t._hasComputedDep===!0&&!Vi(t))continue;if(Fi(t)){zi(t),Oe.add(t);continue}let n=Bn(t._cap??null);try{Bi(t)}finally{n&&Vn()}}}function pr(){if(!(_e>0)){_e++,xt++;try{fr()}finally{_e--,_e===0&&(Ae.length=0,de.clear(),Oe.size>0&&Oe.clear())}}}function Zt(e){e();let t=e._sig;if(!t)return;let n=Hi,r=n.length;for(n.push(t);n.length>r;){let i=n.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,n.push(a)):s()}else de.has(s)||(de.add(s),Ae.push(s));i=i.sigNext}}}function mr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Zt(r):de.has(r)||(de.add(r),Ae.push(r))),n=n.sigNext}}function gr(e){let n=e.subsHead;if(n){if(_e>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Zt(o):de.has(o)||(de.add(o),Ae.push(o))),r=r.sigNext}return}_e++,xt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Zt(o):de.has(o)||(de.add(o),Ae.push(o))),r=r.sigNext}fr()}finally{_e--,_e===0&&(Ae.length=0,de.clear(),Oe.size>0&&Oe.clear())}}}function br(e){return e.__sc??0}function hr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function yr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var vr="4.10.1",Sr=Symbol.for("sibujs.reactive.v1");function Ui(){let e=globalThis,t=e[Sr];if(t)return!t.__dupWarned&&(t.__dupWarned=!0,P(`Multiple instances of the reactive runtime detected on this page (active: ${t.version}, duplicate: ${vr}). Reactivity is NOT broken and no bundler configuration is required: every copy routes through the first one via a global registry, so signal writes still reach subscribers registered by any copy. This is only a SIZE issue \u2014 the duplicate copy's bytes are downloaded and parsed for nothing. If you want them back, de-duplicate sibujs in your bundler (Vite: resolve.dedupe: ['sibujs']). Mismatched VERSIONS above are worth fixing regardless, since only the first one loaded is used.`)),t;let n={suspendTracking:Xt,resumeTracking:Qt,isTrackingSuspended:sr,untracked:ar,retrack:nn,track:cr,reactiveBinding:rn,recordDependency:ur,cleanup:Ue,setMaxSubscriberRepeats:lr,setMaxDrainIterations:dr,drainNotificationQueue:pr,queueSignalNotification:mr,notifySubscribers:gr,getSubscriberCount:br,getSubscriberDeps:hr,forEachSubscriber:yr,getOwnerScope:en,runWithOwnerScope:wt,bindOwnerScope:tn,version:vr};return e[Sr]=n,n}var z=Ui(),Pe=z.suspendTracking,De=z.resumeTracking,xr=z.isTrackingSuspended,pe=z.untracked,Ne=z.retrack,ce=z.track,Y=z.reactiveBinding,$e=z.recordDependency,Ie=z.cleanup,Ll=z.setMaxSubscriberRepeats,wr=z.setMaxDrainIterations,Tr=z.drainNotificationQueue,Er=z.queueSignalNotification,Ke=z.notifySubscribers,Ml=z.getSubscriberCount,Ol=z.getSubscriberDeps,Pl=z.forEachSubscriber,Je=z.getOwnerScope??en,Tt=z.runWithOwnerScope??wt,X=z.bindOwnerScope??tn;function it(e,t,n){if(Ce(t))return le(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){L(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}le(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return Y(r,e)}function kr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(c){L(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(c){L(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),le(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=Y(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var on=["data-focus-key","id","name"],Ki=new Set(["text","search","url","tel","password",""]);function Ji(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Ki.has(e.type.toLowerCase())))return{start:null,end:null,direction:null};let r=e;return{start:r.selectionStart,end:r.selectionEnd,direction:r.selectionDirection}}function st(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<on.length;i++){let s=t.getAttribute(on[i]);if(s){r=on[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Ji(t)}}function Gi(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Yi(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 Cr(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 Ge(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){Cr(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=Yi(t,`[${e.attr}=${Gi(e.value)}]`);if(i&&i.tagName===e.tag){Cr(i,e);return}o=s>1}te(()=>{let i=e.attr?` (${e.attr}="${e.value}")`:"",s=o?`several elements in the rebuilt subtree share ${e.attr}="${e.value}", so there is no way to tell which one the user was in \u2014 a shared name (a radio group) identifies a GROUP, not a control. Add a unique id or data-focus-key to each`:"no element in the rebuilt subtree carries the same identity. Give it a stable id, name, or data-focus-key that the rebuild reproduces";return`${n}: a reactive rebuild discarded the focused element <${e.tag.toLowerCase()}>${i} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${s}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them.`})}function we(e,t){let n=[];function r(){let o;try{o=t()}catch(d){L(d,{phase:"binding",name:"bindChildNode",node:e});return}let i=st(n);if(o==null||typeof o=="boolean"){for(let d=0;d<n.length;d++){let g=n[d];F(g),g.parentNode&&g.parentNode.removeChild(g)}n.length=0,Ge(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)){P("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");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)||(F(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,Ge(i,a,"bindChildNode")}return Y(r,e)}var H="http://www.w3.org/2000/svg",Zi=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var sn=new Set,_r=100,Ar=!1,Nr=new Map;function Rr(e){let t=Nr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Nr.set(e,t)),t}function Xi(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=Y(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",bt(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=Rr(d);u.push(h),c.setProperty(h,gt(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",bt(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Rr(r);if(typeof o=="function"){let s=o,a=Y(()=>{n.style.setProperty(i,gt(i,String(s()),{element:e}))},e);_(e,a)}else n.style.setProperty(i,gt(i,String(o),{element:e}))}}function Qi(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=Y(()=>{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=Y(()=>{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 an(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,we(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,we(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,we(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function p(e,t){let n=Xn(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);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),an(i,o),i):(te(()=>{let m=r.trim().split(/\s+/);if(m.length<2)return"";let l=0;for(let b=0;b<m.length;b++){let y=m[b];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&l++}if(l<2)return"";let f=`${e}|${r}`;return sn.has(f)?"":sn.size>=_r?Ar?"":(Ar=!0,`tagFactory: ${_r} distinct lone-string class warnings have been reported; suppressing further ones for the rest of this session so they cannot flood the console. Fix the reported ones and reload to see any that remain.`):(sn.add(f),`tagFactory: lone string "${r}" looks like a class list but is being rendered as TEXT. For a class, use ${e}({ class: "${r}" }) \u2014 or ${e}("${r}", children) to set the class AND add children.`)}),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 an(i,r),i;let s=r,a=s.class;a!=null&&Qi(i,a);let c=s.id;typeof c=="function"?_(i,it(i,"id",c)):c!=null&&(typeof c=="string"&&Zi.has(c.toLowerCase())&&P(`tagFactory: element id="${c}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=c);let u=o!==void 0?o:s.nodes;u!=null&&an(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):P(`tagFactory: on.${m} handler is not a function (got ${typeof l}). Event listener was not attached.`)}let g=s.style;g!=null&&Xi(i,g);let h=s.ref;h&&(h.current=i);for(let m in s)switch(m){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,m))continue;let l=s[m];if(l==null||Ce(m))continue;typeof l=="function"?_(i,it(i,m,l)):le(i,m,l,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var id=p("html"),es=p("head"),ts=p("body"),ns=p("title"),O=p("div"),W=p("span"),rs=p("section"),os=p("article"),is=p("header"),ss=p("footer"),as=p("nav"),cs=p("main"),us=p("aside"),ls=p("address"),cn=p("p"),ds=p("h1"),fs=p("h2"),un=p("h3"),ps=p("h4"),ms=p("h5"),gs=p("h6"),bs=p("blockquote"),hs=p("dd"),ys=p("dl"),vs=p("dt"),Ss=p("figcaption"),xs=p("figure"),ws=p("hr"),Ts=p("li"),Es=p("ol"),ks=p("ul"),ln=p("pre"),Cs=p("a"),_s=p("abbr"),As=p("b"),Ns=p("bdi"),Rs=p("bdo"),Ls=p("br"),Ms=p("cite"),dn=p("code"),Os=p("data"),Ps=p("dfn"),Ds=p("em"),$s=p("i"),Is=p("kbd"),Hs=p("mark"),Bs=p("q"),Vs=p("rp"),js=p("rt"),Fs=p("ruby"),zs=p("s"),Ws=p("samp"),qs=p("small"),Us=p("strong"),Ks=p("sub"),Js=p("sup"),Gs=p("time"),Ys=p("u"),Zs=p("var"),Xs=p("area"),Qs=p("audio"),ea=p("img"),ta=p("map"),na=p("track"),ra=p("video"),oa=p("embed"),ia=p("iframe"),sa=p("object"),aa=p("param"),ca=p("picture"),ua=p("portal"),la=p("source"),da=p("svg",H),fa=p("math"),pa=p("canvas"),ma=p("noscript"),ga=p("script"),ba=p("del"),ha=p("ins"),ya=p("caption"),va=p("col"),Sa=p("colgroup"),xa=p("table"),wa=p("tbody"),Ta=p("td"),Ea=p("tfoot"),ka=p("th"),Ca=p("thead"),_a=p("tr"),at=p("button"),Aa=p("datalist"),Na=p("fieldset"),Ra=p("form"),La=p("input"),Ma=p("label"),Oa=p("legend"),Pa=p("meter"),Da=p("optgroup"),$a=p("option"),Ia=p("output"),Ha=p("progress"),Ba=p("select"),Va=p("textarea"),ja=p("details"),Fa=p("dialog"),za=p("menu"),Wa=p("summary"),qa=p("slot"),Ua=p("template"),Ka=p("base"),Ja=p("link"),Ga=p("meta"),He=p("style"),Ya=p("circle",H),Za=p("ellipse",H),Xa=p("g",H),Qa=p("line",H),ec=p("path",H),tc=p("polygon",H),nc=p("polyline",H),rc=p("rect",H),oc=p("text",H),ic=p("tspan",H),sc=p("defs",H),ac=p("clipPath",H),cc=p("mask",H),uc=p("pattern",H),lc=p("linearGradient",H),dc=p("radialGradient",H),fc=p("stop",H),pc=p("use",H),mc=p("symbol",H),gc=p("marker",H),bc=p("center"),hc=p("font"),yc=p("marquee"),vc=e=>p(e);var fn="__sibuPendingError";function Lr(e,t){let n=()=>e.parentNode?(L(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[fn]=t)})}function Et(e){let t=e,n=t[fn];if(n instanceof Error)return delete t[fn],n}function Mr(e){let t=null;return function(){if(t)return t();let r=O({class:"sibu-lazy"}),o=!1;return e().then(X(i=>{if(o)return;t=i.default;let s=t();ne(r,s)})).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));ne(r,O({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Lr(r,s)}),r.appendChild(W("sibu-lazy-loading","Loading...")),_(r,()=>{o=!0}),r}}function Or({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)&&F(s)});let a=X(()=>{if(!o)try{let c=e();if(s=c,c.classList.contains("sibu-lazy")){if(!c.querySelector(".sibu-lazy-loading")){ne(n,c);return}i=new MutationObserver(()=>{if(o)return;c.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,ne(n,c))}),i.observe(c,{childList:!0,subtree:!0})}else ne(n,c)}catch(c){let u=c instanceof Error?c:new Error(String(c));Lr(n,u)}});return queueMicrotask(a),n}function bn(e,t){return()=>Je()===e?t():Tt(e,t)}function Ct(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";L(n,{phase:r,name:t});return}}function pn(e,t,n,r,o){let i=Ct(e,t);if(typeof i!="function")return;let s=bn(o,i);r()||!n.isConnected?Ct(s,"onUnmount"):Dr(s,n)}var Ye=new WeakMap,Be=new WeakMap,Te=new Set,Ee=new Set,Ze=null,kt=0,Sc=256;function mn(e){let t=Ye.get(e);if(t){Ye.delete(e),Te.delete(e);for(let n of t)try{n()}catch{}}}function gn(e){Be.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Be.get(e);if(n){Be.delete(e),Ee.delete(e);for(let r of n)try{r()}catch{}}})}function xc(e){if(Te.size===0||e.nodeType!==1)return;let t=e;if(Te.has(t)&&t.isConnected&&mn(t),t.firstElementChild)for(let n of Array.from(Te))n!==t&&n.isConnected&&t.contains(n)&&mn(n)}function wc(e){if(Ee.size===0||e.nodeType!==1)return;let t=e;if(Ee.has(t)&&!t.isConnected&&gn(t),t.firstElementChild)for(let n of Array.from(Ee))n!==t&&!n.isConnected&&t.contains(n)&&gn(n)}function Tc(){if(Te.size>0)for(let e of Array.from(Te))e.isConnected&&mn(e);if(Ee.size>0)for(let e of Array.from(Ee))e.isConnected||gn(e)}function Pr(){Ze||typeof document>"u"||(Ze=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)xc(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)wc(t.removedNodes[n])}kt+=e.length,kt>=Sc&&(kt=0,Tc()),hn()}),Ze.observe(document.body,{childList:!0,subtree:!0}))}function hn(){Ze&&Te.size===0&&Ee.size===0&&(Ze.disconnect(),Ze=null,kt=0)}function Ec(e,t){let n=Ye.get(e);return n||(n=[],Ye.set(e,n)),n.push(t),Te.add(e),Pr(),()=>{let r=Ye.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ye.delete(e),Te.delete(e))}hn()}}function kc(e,t){let n=Be.get(e);return n||(n=[],Be.set(e,n)),n.push(t),Ee.add(e),Pr(),()=>{let r=Be.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Be.delete(e),Ee.delete(e))}hn()}}function _t(e,t){if(typeof document>"u")return;let n=Je();if(e=bn(n,e),t){let r=!1,o=()=>r;if(_(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||pn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){pn(e,"onMount",t,o,n);return}let i=Ec(t,()=>{r||pn(e,"onMount",t,o,n)});_(t,i)})}else queueMicrotask(()=>{Ct(e,"onMount")})}function Cc(e,t){typeof document>"u"||Dr(bn(Je(),e),t)}function Dr(e,t){let n=!1,r=()=>{n||(n=!0,Ct(e,"onUnmount"))};_(t,r);let o=()=>{if(n)return;let i=kc(t,r);_(t,i)};t.isConnected?o():_t(()=>{o()},t)}function _c(e,t){_(t,e)}function ue(e,t,n){try{e.emit(t,n)}catch{}}var yn=Symbol.for("sibujs.ssr.v1");function Ac(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let t=null,n=process.getBuiltinModule;typeof n=="function"?t=n("node:async_hooks"):typeof It=="function"&&(t=It("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var Re=globalThis[yn]??(globalThis[yn]=Ac()),Ve=Re.als,Q=Re.fallbackStore;Re.fallbackDepth??(Re.fallbackDepth=0);var $r=!1;function Nc(){if($r||Ve||!(typeof process<"u"&&!!process.versions?.node))return;$r=!0;let t=process.versions.node;P(`SSR request isolation is UNAVAILABLE on this runtime (Node ${t}). AsyncLocalStorage could not be loaded, so concurrent requests share one SSR store: request state and the query cache can bleed between them. Node >= 22.3 is required for isolated SSR under ESM; the CommonJS build works on older versions. A fully synchronous render is unaffected.`)}function je(){if(Ve){let e=Ve.getStore();if(e)return e}return Q}function Ir(){return Ve?Ve.getStore()??null:Re.fallbackDepth>0?Q:null}function me(){return je().ssr}function Hr(e){if(!me())return null;let t=je(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function Br(){je().ssr=!0}function Vr(){je().ssr=!1}function jr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Ve)return Ve.run(t,e);Nc();let n=Q.ssr,r=Q.suspenseIdCounter,o=Q.idCounter,i=Q.locale;Q.ssr=!0,Q.suspenseIdCounter=0,Q.idCounter=0,Q.locale=void 0,Re.fallbackDepth++;try{return e()}finally{Re.fallbackDepth--,Q.ssr=n,Q.suspenseIdCounter=r,Q.idCounter=o,Q.locale=i}}function Fr(e){let t=je(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Ur=globalThis;function Rc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,pe(()=>t(o,void 0));else{let i=n;n=o,pe(()=>t(o,i))}}}var zr=100;function At(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===Je()?Wr(t):Tt(n,()=>Wr(t))}function Wr(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){L(n,{phase:"cleanup"})}}function qr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&At(e),Ne(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=zr);e.rerunPending&&(e.rerunPending=!1,L(new Error(`effect re-requested itself ${zr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Lc(e){if(e.disposed)return;e.disposed=!0;let t=Ur.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&At(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Ie(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function ee(e,t){if(j(typeof e=="function","effect: argument must be a function."),me())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&&At(n),Ne(n.bodyFn,o),n.rerunPending&&qr(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{Ne(n.bodyFn,n.subscriber),n.rerunPending&&qr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&At(n),Ie(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=Ur.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&ue(i,"effect:create",{effectFn:e}),()=>Lc(n)}var ct=0,vn=new Set;function Mc(e){ct++;try{return e()}finally{ct--,ct===0&&Dc()}}function Oc(e){return ct===0?!1:(vn.add(e),!0)}function Pc(){return ct>0}function Dc(){try{for(let e of vn)Er(e)}finally{vn.clear()}Tr()}var Kr=Symbol.for("sibujs.reactive.batch.v1");function $c(){let e=globalThis,t=e[Kr];if(t)return t;let n={batch:Mc,enqueueBatchedSignal:Oc,isBatching:Pc};return e[Kr]=n,n}var Sn=$c(),q=Sn.batch,Fe=Sn.enqueueBatchedSignal,Ic=Sn.isBatching;var xn=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=t?.name,o=t?.equals;r&&(n.__name=r);function i(){return $e(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++,!0){let d=xn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&ue(d,"signal:update",{signal:n,name:r,oldValue:c,newValue:u})}Fe(n)||Ke(n)}}:s=a=>{let c=n.value,u=typeof a=="function"?a(c):a;if(Object.is(u,c))return;n.value=u,n.__v++;let d=xn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&ue(d,"signal:update",{signal:n,name:r,oldValue:c,newValue:u}),Fe(n)||Ke(n)},!0){let a=xn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&ue(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function Hc(e){let[t,n]=A(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Bc=`
|
|
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
|
+
`,Jr=!1;function Vc(){if(Jr||typeof document>"u")return;let e=He({nodes:Bc});document.head.appendChild(e),Jr=!0}function jc(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 Gr(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=jc(r),i=e.cause,s=i!=null?Gr(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 Fc(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 Yr(e){let t=e.map((n,r)=>O({class:"sibu-err-frame",nodes:[W({class:"sibu-err-line",nodes:String(r+1)}),W({class:"sibu-err-fn",nodes:n.fn}),W({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return ln({class:"sibu-err-stack",nodes:t})}function Zr(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:[W({nodes:`[${e.code}] ${e.message}`}),W({nodes:""})]}),e.frames.length>0?Yr(e.frames):O({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Zr(e.cause)]:[]}function zc(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 wn(e){Vc();let t=e.severity??"error",n=Gr(e.error),r=e.alwaysShowDetails??be(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=A("Copy"),c=at({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let m=Fc(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:[dn({class:"sibu-err-icon",nodes:n.code}),un({class:"sibu-err-title",nodes:o}),c,W({class:"sibu-err-timestamp",nodes:i})]}),d=[cn({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:[W({nodes:"Stack Trace"})]}),Yr(n.frames)]})),r&&d.push(...Zr(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:[W({nodes:"Metadata"})]}),zc(e.metadata)]}));let g=[];e.onRetry&&g.push(at({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&g.push(at({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 Wc=`
|
|
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
|
+
`,qc=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Xr=!1;function Uc(){if(!Xr&&typeof document<"u"){let e=He({nodes:Wc});document.head.appendChild(e),Xr=!0}}function Kc(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;Uc();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(D){L(D,{phase:"effect",name:"ErrorBoundary.resetKeys"}),x[E]=qc}return x},m=()=>{let v=s;if(!v||v.length===0)return;g();let x=null;d=ee(()=>{let E=h(v);if(x===null){x=E;return}let D=E.length!==x.length;if(!D){for(let V=0;V<E.length;V++)if(!Object.is(E[V],x[V])){D=!0;break}}x=E,D&&u()})},l=v=>{let x=Bt(v);if(c(x),m(),i)try{i(x)}catch(E){L(E,{phase:"render",name:"ErrorBoundary onError callback"})}return x},f=(v,x)=>wn({error:v,severity:"error",onRetry:x}),b=v=>{let x=o||f;try{return x(v,u)}catch(E){return queueMicrotask(()=>{L(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(W({class:"sibu-lazy-loading",nodes:"Loading..."}));let D=!1;return _(E,()=>{D=!0}),x.then(V=>{if(D){F(V);return}ne(E,V)}).catch(X(V=>{if(D)return;let K=l(V);ne(E,b(K))})),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),_t(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),x=[],E=v.currentNode;for(;E;){let D=Et(E);D&&x.push(D),E=v.nextNode()}if(x.length===1)l(x[0]);else if(x.length>1){let D=globalThis.AggregateError;l(D?new D(x,`${x.length} pre-mount errors caught by ErrorBoundary`):new Error(x.map(V=>V.message).join("; ")))}},y),_(y,()=>{g(),y.removeEventListener("sibu:error-propagate",S)}),y}var Jc=`
|
|
347
347
|
@keyframes sibu-spin {
|
|
348
348
|
to { transform: rotate(360deg); }
|
|
349
349
|
}
|
|
@@ -396,7 +396,7 @@
|
|
|
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
|
-
`,qr=!1;function Bl(){!qr&&typeof document<"u"&&(document.head.appendChild($e({nodes:Hl})),qr=!0)}function Vl(e={}){Bl();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?P({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[P({class:"sibu-loading-dots"},[z({class:"sibu-loading-dot"}),z({class:"sibu-loading-dot"}),z({class:"sibu-loading-dot"})]),t?z({class:"sibu-loading-text"},t):null]):P({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[P({class:"sibu-loading-spinner"}),t?z({class:"sibu-loading-text"},t):null])}var gn=Symbol.for("sibujs.actions.v1"),Ur=globalThis[gn]??(globalThis[gn]=new Map);function Ge(e,t){Ur.set(e,t)}function Kr(e){return Ur.get(e)}function jl(e,t,n){let r=typeof t=="string"?Kr(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 Jr=(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)},Wr=["pointerup","pointerleave","pointercancel"],Gr=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=l=>{let u=l.pointerId;r!==null&&u!==o||(i(),o=u,r=setTimeout(()=>{r=null,t.callback()},n))},a=l=>{r!==null&&l.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let l of Wr)e.addEventListener(l,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let l of Wr)e.removeEventListener(l,a)}},Yr=(e,t)=>{let n=o=>L(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},Zr=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)},Xr=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",Jr);Ge("longPress",Gr);Ge("copyOnClick",Yr);Ge("autoResize",Zr);Ge("trapFocus",Xr);function Et(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 je=null;function Fl(e,t){try{let n=e(),r=Et(n);return r&&r.then(void 0,o=>{t?t(o,"async"):je?je(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):je?je(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function zl(e,t){try{return await e()}catch(n){return t?t(n,"async"):je?je(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function ql(e){je=e}function Wl(e){let[t,n]=A(e),r=i=>{!!0||!fe()||D(`context.${i}() called during SSR. SibuJS context() is application-global \u2014 it is NOT isolated per request, so a concurrent request can observe this value. Do not use context() for request-specific SSR data; pass it explicitly or use request-scoped storage instead.`)};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 l=s();return l!==null&&typeof l?.then=="function"&&D("context.withContext() received an async callback. Scoping is synchronous only \u2014 the previous value is restored as soon as the callback returns its promise, so anything after an `await` runs outside the scope."),l}finally{n(a)}}}}var bn=Symbol.for("sibujs.createId.v1"),hn=globalThis[bn]??(globalThis[bn]={n:0});function Qr(e="sibu"){let t=Nr();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(hn.n++,`${e}-${hn.n}`)}function eo(){hn.n=0}function Ul(e,t){let n=typeof t=="function"?t():t;return _(n,Y(()=>{n.style.display=e()?"":"none"},n)),n}function to(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,l=r.has(s),u=!a&&!l;return r.add(s),l&&ee(()=>`${o}: ${a?"a branch was given as an element rather than a function":"a branch factory returned a node it had already returned"}, so the SAME node is being re-attached \u2014 any state it accumulated while detached (input value, scroll position, classes set imperatively) comes back with it. Its reactive bindings are left intact rather than disposed, because the node is not this directive's to tear down. Return a FRESH node per call (\`() => div(\u2026)\`) for rebuild semantics, or keep this form deliberately when the reuse is what you want.`),e.insertBefore(s,t.nextSibling),{node:s,owned:u}}function kt(e,t){t&&F(e),e.parentNode?.removeChild(e)}function Kl(e,t,n){let r=document.createComment("when"),o=null,i,s=!1,a=!1,l=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 c=o?rt([o]):null;o?.parentNode&&(kt(o,u),o=null);let f=h?t:n!==void 0?n:null,b=de(()=>to(m,r,f,l,"when"));o=b.node,u=b.owned,Ue(c,o?[o]:[],"when"),s=!0},g=Y(d,r);return _(r,()=>{a=!0,g(),o&&kt(o,u),o=null}),s||queueMicrotask(()=>{!a&&!s&&r.parentNode&&d()}),r}function Jl(e,t,n){let r=document.createComment("match"),o=null,i,s=!1,a=!1,l=new WeakSet,u=!1,d=()=>{if(a)return;let h=String(e()),m=r.parentNode;if(!m||s&&h===i)return;i=h;let c=o?rt([o]):null;o?.parentNode&&(kt(o,u),o=null);let f=Object.hasOwn(t,h)?t[h]:n,b=de(()=>to(m,r,f??null,l,"match"));o=b.node,u=b.owned,Ue(c,o?[o]:[],"match"),s=!0},g=Y(d,r);return _(r,()=>{a=!0,g(),o&&kt(o,u),o=null}),s||queueMicrotask(()=>{!a&&!s&&r.parentNode&&d()}),r}function st(e,t){let n=globalThis;return n[e]??(n[e]=t())}var Ct=st(Symbol.for("sibujs.components.registry.v1"),()=>new Map),no=st(Symbol.for("sibujs.components.registryVersion.v1"),()=>A(0));function ro(){let[e,t]=no;t(de(e)+1)}function Gl(e,t){Ct.set(e,t),ro()}function Yl(e){Ct.delete(e)&&ro()}function Zl(e){let t=Ct.get(e);return t?t():P(`[Component "${e}" not found]`)}function Xl(e){let t=P({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(no[0](),a=Ct.get(s));let l=a??`missing:${s}`;if(l===r)return;let u=de(()=>a?a():P(`[Component "${s}" not found]`));r=l,te(t,u)}let i=se(o);return _(t,i),t}function oo(e){return typeof e=="function"?oo(e()):e instanceof Node?e:document.createTextNode(String(e))}function Ql(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let l=e[a],u=0,d=n.length;for(;u<d;){let g=u+d>>1;e[n[g]]<l?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 eu(e,t,n){j(typeof e=="function","each: first argument must be a function that returns an array."),j(typeof t=="function","each: second argument must be a render function."),j(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,l=0,u=new Map,d=new Map,g=[],h=[],m=[],c=0,f=[],b=[],y=new Uint8Array(0),S=new Map,v=[],x=[],E=new Map,O=!1,V=!1,U=!1,pe=n.key,lt=()=>{if(U)return;let k=e(),C=k.length,$=r.parentNode;if(!$)return;V||($.insertBefore(o,r.nextSibling),V=!0),b.length<C&&(b=new Array(C));for(let w=0;w<C;w++)b[w]=pe(k[w]);let I=b;f.length<C&&(f=new Array(C)),d.clear(),E.clear();for(let w=0;w<C;w++)E.has(I[w])&&D(`each: duplicate key "${String(I[w])}" at index ${w} (first seen at ${E.get(I[w])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),E.set(I[w],w);c=0;for(let w=0;w<C;w++){let G=I[w],wn=u.get(G),Qe;if(wn!==void 0)Qe=wn,g[c]=Qe,h[c]=k[w],m[c]=w,c++;else{let[En,Co]=A(k[w]),[kn,_o]=A(w),Lt;try{Me();try{Lt=oo(t(En,kn))}finally{Pe()}}catch(Ao){let No=I[w];Lt=document.createComment(`each:error:${w}`),queueMicrotask(()=>{L(Ao,{phase:"render",name:`each row (key="${String(No)}")`,node:r.parentNode?r:void 0})})}Qe={node:Lt,item:En,setItem:Co,index:kn,setIndex:_o}}d.set(G,Qe),f[w]=Qe.node}for(let[w,G]of u)d.has(w)||(F(G.node),G.node.parentNode&&$.removeChild(G.node));if(C===0){l=0;let w=u;u=d,d=w,O=!0,c=0;return}S.clear();for(let w=0;w<l;w++)S.set(a[w],w);v.length<C&&(v=new Array(C),x=new Array(C));let K=0;for(let w=0;w<C;w++){let G=S.get(I[w]);G!==void 0&&(v[K]=w,x[K]=G,K++)}let Xe=Ql(x,K);y.length<C?y=new Uint8Array(C):y.fill(0,0,C);for(let w=0;w<Xe.length;w++)y[v[Xe[w]]]=1;let Z=o;for(let w=C-1;w>=0;w--){let G=f[w];y[w]||G.nextSibling!==Z&&$.insertBefore(G,Z),Z=G}let W=a===i?s:i;W.length<C&&(W.length=C);for(let w=0;w<C;w++)W[w]=I[w];a=W,l=C;let ne=u;u=d,d=ne,O=!0,R()};function R(){if(c===0)return;let k=c;c=0,q(()=>{for(let C=0;C<k;C++){let $=g[C];$.setItem(h[C]),$.setIndex(m[C]),g[C]=void 0,h[C]=void 0}})}let T=se(lt);return _(r,()=>{if(!U){U=!0,T();for(let k of u.values())F(k.node),k.node.parentNode?.removeChild(k.node);o.parentNode&&o.parentNode.removeChild(o),V=!1,u.clear(),d.clear(),E.clear(),S.clear(),l=0,g.length=0,h.length=0,m.length=0,c=0}}),O||queueMicrotask(()=>{!O&&!U&&r.parentNode&<()}),r}function tu(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"||io(t,r);else io(t,n);return t}function io(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),_(n,Se(n,t));return}e.appendChild(document.createTextNode(String(t)))}var nu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),so=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),ao=new WeakMap;function ru(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 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=nu.has(f),S=n[r]==="/";if(S&&r++,r<o&&r++,y||S)m.push({t:0,el:{tag:f,svg:so.has(f),attrs:b,children:[]}});else{let v=h();if(Wn(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:so.has(f),attrs:b,children:v}})}}else g(m);return m}return h()}function yn(e,t){let n=e.svg?document.createElementNS(H,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:qt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?_(n,nt(n,i,s)):le(n,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=t[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}le(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):D(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:qt(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(yn(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,Se(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function lo(e,...t){let n=ao.get(e);return n||(n=ru(e),ao.set(e,n)),co(n,t)}function uo(e,t){return co(e,t)}function co(e,t){if(e.length===1&&e[0].t===0)return yn(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(yn(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,Se(s,i))}else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function ou(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&me()&&D("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");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&&(F(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(y))}}c.insertBefore(f,r.nextSibling),l=f,u=!0},h=se(g);return u||queueMicrotask(()=>{!u&&r.parentNode&&g()}),_(r,()=>{d=!0,h();for(let m of o.values())F(m),m.parentNode&&m.parentNode.removeChild(m);o.clear(),i.length=0,l=null}),r}function iu(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");j(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=()=>typeof performance<"u"?performance.now():0,r=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=Pn(()=>{let d=e();return i(d),d}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&ae(l,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(l&&ae(l,"app:unmount",{rootElement:s}),u){su(u.start,u.end);return}F(s),s.parentNode?.removeChild(s)}}}function su(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=he;for(let a=e.nextSibling;a&&a!==t;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==n||t.parentNode!==n?s=!1:(e.previousSibling!==o||t.nextSibling!==i)&&(o=e.previousSibling,i=t.nextSibling,s=!!(e.compareDocumentPosition(t)&4));let a=e.nextSibling;if(!s||a===t)break;if(r--<=0){we("mount",he,1);return}F(a),a.parentNode===n&&n.removeChild(a)}s||L(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function au(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(()=>{L(s,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}}),_(n,()=>{i=!0,o&&(F(o),o.remove(),o=null)}),n}function lu(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function fo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function uu(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=fo(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 cu(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Ve(r)||We(r)}function i(){if(De(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=fo(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 du(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=Q(()=>{if(l(),g)return;m();let f=++d,b=typeof AbortController<"u"?new AbortController:null;h=b,q(()=>{i(!0),a(null)});let y=()=>g||f!==d,S;try{S=e({signal:b?b.signal:void 0})}catch(v){if(y())return;q(()=>{a(v),i(!1)});return}S.then(v=>{y()||(h=null,q(()=>{r(v),i(!1)}))},v=>{y()||(h=null,q(()=>{a(v),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{g||u(f=>f+1)},dispose:()=>{g||(g=!0,c(),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[l,u]of e)if(!a.has(l)||!Ye(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)=>Ye(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&&Ye(e.cause,a.cause,n)&&po(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:po(r,o,n)}function po(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 fu(e){return A(e,{equals:(t,n)=>Ye(t,n)})}function Fe(e,t){j(typeof e=="function","derived: argument must be a getter function.");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{se(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(c){throw s=!0,Oe(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{_e(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&&Oe(l)}d&&!s&&!Object.is(c,o._v)&&ae(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 pr()||s?(o._d&&(g(),a!==void 0&&h()),o._v):(o._d&&(g(),a!==void 0&&(De(o),h())),De(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,Oe(l);let c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(c)try{c.emit("computed:destroy",{signal:o,getter:m})}catch{}},d&&ae(d,"computed:create",{signal:o,name:n,getter:m}),m}function pu(e){let[t,n]=A(e);return{get current(){return t()},set current(r){n(r)}}}function mo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function mu(e){j(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t=Object.create(null);Object.keys(e).forEach(l=>{let[u,d]=A(e[l]);mo(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=>{mo(l,u,t[u][0]())}),l};return[n,{setState:l=>{let u=r(),d=typeof l=="function"?l(u):l;q(()=>{Object.entries(d).forEach(([g,h])=>{Object.hasOwn(t,g)&&t[g][1](h)})})},reset:()=>{q(()=>{Object.keys(e).forEach(l=>{let u=t[l][1];u(e[l])})})},subscribe:l=>{let u=!0;return Q(()=>{let d=r();if(u){u=!1;return}Me();try{l(d)}finally{Pe()}})},subscribeKey:(l,u)=>{let d,g=!0;return Q(()=>{let h=t[l][0]();if(g){d=h,g=!1;return}if(!Object.is(h,d)){let m=d;d=h,Me();try{u(h,m)}finally{Pe()}}})},getSnapshot:r}]}function gu(e,t){if(j(typeof e=="function","watch: first argument must be a getter function."),j(typeof t=="function","watch: second argument must be a callback function."),fe())return()=>{};let n,r=!0;return se(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Me();try{t(s,a)}finally{Pe()}}})}function bu(e,t,n){return[Fe(e,n),i=>{q(()=>t(i))}]}function hu(e){let t=e();return me()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function yu(e){if(!me())return Q(e);let t=Q(e),n=null;return queueMicrotask(()=>{try{n=Q(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function go(e,t){return fe()?()=>{}:Y(e,t)}var vn="data-sibu-enhanced",Sn=new WeakMap;function bo(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=he){let i=r.length-o+e.length;e.length=0,we(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var ho=["text","attr","class","show","on","cleanup"];function yo(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 go(t,e)}function vu(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 Su(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 xu(e,t,n,r){let o=`ctx.each[${r}]`;if(me())for(let i of Object.keys(n))j(ho.includes(i),`${o}: unknown binding "${i}". Expected one of: ${ho.join(", ")}.`);if(n.text!==void 0&&(j(typeof n.text=="function",`${o}: "text" must be a function returning the value.`),e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];j(typeof s=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];j(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(t,i,s)}if(n.show!==void 0&&(j(typeof n.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];j(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(t,i,s)}n.cleanup!==void 0&&(j(typeof n.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(n.cleanup))}function _t(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(vn)==="true")return me()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=h=>s?(ee(()=>`enhance: ctx.${h}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`),!0):!1,l=(h,m,c)=>{if(a(h))return;let f=yo(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=>yo(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(at(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(at(f,()=>{let b=c(),y=b==null?null:String(b);le(f,m,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(h,m,c)=>{l("classed",h,f=>{r.push(at(f,()=>{f.classList.toggle(m,!!c())}))})},show:(h,m)=>{l("show",h,c=>{let f=c.hidden;r.push(at(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(at(f,()=>{Su(b,y())}));let x=()=>S(vu(b));b.addEventListener(v,x),r.push(()=>b.removeEventListener(v,x))})},each:(h,m)=>{if(a("each"))return;j(typeof m=="function","ctx.each: second argument must be a function.");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&&xu(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=>{ee(()=>`enhance: the promise returned by the setup also rejected: ${String(m)}`)}),new Error("[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored.")}catch(h){throw bo(r,"enhance"),s=!0,h}typeof d=="function"&&r.push(d);let g=()=>{i||(i=!0,Sn.get(n)===o&&(Sn.delete(n),n.removeAttribute(vn)),et(n,g),bo(r,"enhance"),s=!0)};return _(n,g),Sn.set(n,o),n.setAttribute(vn,"true"),g}function Tu(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(_t(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 wu=/^[A-Za-z0-9_-]+$/,vo=Symbol.for("sibujs.islands.lazy"),At=st(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Eu(e){return e[vo]=!0,e}function ku(e,t){if(!wu.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);At.set(e,t)}function Cu(e){At.delete(e)}async function _u(e){if(typeof e=="function"&&e[vo]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function Au(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(!At.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=At.get(s);d&&_u(d).then(g=>{if(!o){if(!g){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let h=_t(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(Nu(u,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Nu(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 Ru=new Set(["__proto__","constructor","prototype"]);function xn(e){return Ru.has(e)}function Nt(e){let t={};for(let n of Object.keys(e))xn(n)||(t[n]=e[n]);return t}function So(e){return e}var Ap=1024*1024;function Lu(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=se(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,l())},u}var xo=16;function Mu(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:xo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,xo)}function Pu(){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(),L(l,{phase:"async",name:"transition"})};Mu(()=>{try{let l=Et(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function Du(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var Rt={};Cn(Rt,{RenderProp:()=>Wu,assertType:()=>Qu,compose:()=>qu,createGuard:()=>ec,createSlots:()=>Ku,defineComponent:()=>Ju,defineSlottedComponent:()=>Gu,defineStrictComponent:()=>Xu,globalStore:()=>ju,machine:()=>Ou,optimistic:()=>Iu,optimisticList:()=>Hu,persisted:()=>$u,timeline:()=>Bu,validateProps:()=>ko,validators:()=>Zu,withBoundary:()=>Uu,withDefaults:()=>zu,withProps:()=>Yu,withWrapper:()=>Fu});function Ze(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Ou(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=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 O=E;if(x){let U=x(E);O={...E,...Nt(U)}}i=S,s=O,q(()=>{x&&o(O),n(S)});let V=Ze(e.states,S);V?.entry&&V.entry(s)}function g(f){a.push(f),!l&&u()}let h=Ze(e.states,e.initial);if(h?.entry){l=!0;try{h.entry(s)}catch(f){throw a.length=0,f}finally{l=!1}a.length>0&&u()}function m(f){return t()===f}function c(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:c}}function $u(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)=>xn(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=Q(()=>{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 Iu(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 Hu(e){let t=0,n=0,r=0,o=new Map,i=[];for(let R of e){let T={id:t++,key:n++,base:R,claims:[],visible:!0,refs:0};o.set(T.id,T),i.push(T.id)}function s(R){let T=R.claims;return T.length>0?T[T.length-1].value:R.base}function a(R,T){let M=R.claims;for(let k=M.length-1;k>=0;k--)if(M[k].opId<T)return M[k].value;return R.base}function l(R,T,M){let k={opId:T,value:M,settled:!1},C=R.claims,$=C.length;for(;$>0&&C[$-1].opId>T;)$--;return C.splice($,0,k),k}function u(R,T){let M=R.claims.indexOf(T);M!==-1&&R.claims.splice(M,1)}function d(R){let T=R.claims,M=0;for(;M<T.length&&T[M].settled;)R.base=T[M].value,M++;M>0&&T.splice(0,M)}let[g,h]=A(i.map(R=>s(o.get(R)))),[m,c]=A(!1),f=0,b=new Set;function y(){let R=new Array(i.length);for(let T=0;T<i.length;T++)R[T]=s(o.get(i[T]));return R}function S(R){q(()=>{let T=!1;try{T=R()}finally{c(f>0),T&&h(y())}})}function v(R){let T=o.get(R);return!T||!T.visible?!1:(T.visible=!1,i=i.filter(M=>M!==R),!0)}function x(R){let T=[];for(let I of R){let K=o.get(I);!K||K.visible||b.has(I)||T.push(I)}if(T.length===0)return!1;let M=new Array(i.length+T.length),k=0,C=0,$=0;for(;k<i.length&&C<T.length;){let I=o.get(i[k]).key,K=o.get(T[C]).key;M[$++]=I<=K?i[k++]:T[C++]}for(;k<i.length;)M[$++]=i[k++];for(;C<T.length;)M[$++]=T[C++];for(let I of T)o.get(I).visible=!0;return i=M,!0}function E(R){for(let T of R){let M=o.get(T);M&&M.refs++}}function O(R){for(let T of R){let M=o.get(T);M&&(M.refs--,M.refs<=0&&!M.visible&&(o.delete(T),b.delete(T)))}}function V(R){if(O(R),f--,f<=0&&(f=0,b.clear(),o.size!==i.length))for(let[T,M]of o)M.visible||o.delete(T)}async function U(R,T){let M=++r,k={id:t++,key:n++,base:R,claims:[],visible:!1,refs:1},C=l(k,M,R);S(()=>(o.set(k.id,k),k.visible=!0,i=[...i,k.id],f++,!0));let $,I=!1;try{$=await T()}catch{I=!0}S(()=>{try{if(I)return b.add(k.id),u(k,C),v(k.id);let K=s(k);return C.value=$,C.settled=!0,d(k),k.visible&&!Object.is(K,s(k))}finally{V([k.id])}})}async function pe(R,T){let M=++r,k=[];for(let $ of i)R(a(o.get($),M))&&k.push($);S(()=>{if(E(k),f++,k.length===0)return!1;let $=new Set(k);for(let I of k){let K=o.get(I);K&&(K.visible=!1)}return i=i.filter(I=>!$.has(I)),!0});let C=!1;try{await T()}catch{C=!0}S(()=>{try{if(!C){for(let $ of k)b.add($);return!1}return x(k)}finally{V(k)}})}async function lt(R,T,M){let k=++r,C=[];for(let Z of i){let W=o.get(Z),ne=a(W,k);R(ne)&&C.push({row:W,nextValue:{...ne,...T}})}let $=C.map(Z=>Z.row.id),I=[];S(()=>{E($),f++;let Z=!1;for(let W of C){let ne=s(W.row);I.push(l(W.row,k,W.nextValue)),W.row.visible&&!Object.is(ne,s(W.row))&&(Z=!0)}return Z});let K,Xe=!1;try{K=await M()}catch{Xe=!0}S(()=>{try{let Z=!1;for(let W=0;W<I.length;W++){let ne=C[W].row,w=I[W],G=s(ne);Xe?u(ne,w):(w.value=K,w.settled=!0),d(ne),ne.visible&&!Object.is(G,s(ne))&&(Z=!0)}return Z}finally{V($)}})}return{items:g,pending:m,add:U,remove:pe,update:lt}}function Bu(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=Fe(()=>n()[o()]),a=Fe(()=>o()>0),l=Fe(()=>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),q(()=>{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(){q(()=>{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 wo=Promise.prototype.then;function To(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(wo,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function Eo(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===wo?(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"?To(s,c,f):(i==="rejected"?c:f)()};i==="native"?To(s,c,f):i==="invoking"?a.push(b):queueMicrotask(i==="rejected"?c:f)}}}function Vu(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=Vu(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){L(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):L(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=Nt(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,O=!0,V=()=>{if(E&&!x){D(`globalStore: middleware ${v} next() called after it failed for "${String(c)}"; ignored.`),x=!0;return}if(x){D(`globalStore: middleware ${v} next() called more than once for "${String(c)}"; ignored.`);return}if(x=!0,O){S(v+1);return}let pe=()=>u(()=>S(v+1),!1);if(!U){pe();return}U.probe(()=>{E=!0,D(`globalStore: middleware ${v} next() called after it failed for "${String(c)}"; ignored.`)},pe)},U=null;try{U=Eo(i[v](n(),String(c),f,V))}catch(pe){throw E=!0,pe}finally{O=!1}U&&(U.failedEarly&&(E=!0),U.promise.then(void 0,pe=>{E=!0,L(pe,{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 Fu(e,t){return n=>t(e,n)}function zu(e,t){return n=>e({...t,...n})}function qu(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function Wu(e){return e.render(e.data())}function Uu(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 Ku(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 Ju(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function Gu(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function Yu(e,t){return n=>e(t(n))}var Zu={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 ko(e,t){let n={...e};{let r=[];for(let[o,i]of Object.entries(t)){let s=typeof i=="function"?{type:i}:i;if(n[o]===void 0&&s.default!==void 0&&(n[o]=typeof s.default=="function"?s.default():s.default),s.required&&n[o]==null){r.push(`Prop '${o}' is required`);continue}if(n[o]!=null){if(s.type){let a=s.type(n[o],o);a!==!0&&r.push(a)}if(s.validator){let a=s.validator(n[o],o);a!==!0&&r.push(a)}}}return r.length>0&&D(`Prop validation errors:
|
|
399
|
+
`,Qr=!1;function Gc(){!Qr&&typeof document<"u"&&(document.head.appendChild(He({nodes:Jc})),Qr=!0)}function Yc(e={}){Gc();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"},[W({class:"sibu-loading-dot"}),W({class:"sibu-loading-dot"}),W({class:"sibu-loading-dot"})]),t?W({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?W({class:"sibu-loading-text"},t):null])}var Tn=Symbol.for("sibujs.actions.v1"),to=globalThis[Tn]??(globalThis[Tn]=new Map);function Xe(e,t){to.set(e,t)}function no(e){return to.get(e)}function Zc(e,t,n){let r=typeof t=="string"?no(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 ro=(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)},eo=["pointerup","pointerleave","pointercancel"],oo=(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 eo)e.addEventListener(c,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let c of eo)e.removeEventListener(c,a)}},io=(e,t)=>{let n=o=>L(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},so=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)},ao=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)};Xe("clickOutside",ro);Xe("longPress",oo);Xe("copyOnClick",io);Xe("autoResize",so);Xe("trapFocus",ao);function Nt(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 ze=null;function Xc(e,t){try{let n=e(),r=Nt(n);return r&&r.then(void 0,o=>{t?t(o,"async"):ze?ze(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):ze?ze(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Qc(e,t){try{return await e()}catch(n){return t?t(n,"async"):ze?ze(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function eu(e){ze=e}function tu(e){let[t,n]=A(e),r=i=>{!!0||!me()||P(`context.${i}() called during SSR. SibuJS context() is application-global \u2014 it is NOT isolated per request, so a concurrent request can observe this value. Do not use context() for request-specific SSR data; pass it explicitly or use request-scoped storage instead.`)};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 c!==null&&typeof c?.then=="function"&&P("context.withContext() received an async callback. Scoping is synchronous only \u2014 the previous value is restored as soon as the callback returns its promise, so anything after an `await` runs outside the scope."),c}finally{n(a)}}}}var En=Symbol.for("sibujs.createId.v1"),kn=globalThis[En]??(globalThis[En]={n:0});function co(e="sibu"){let t=Ir();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(kn.n++,`${e}-${kn.n}`)}function uo(){kn.n=0}function nu(e,t){let n=typeof t=="function"?t():t;return _(n,Y(()=>{n.style.display=e()?"":"none"},n)),n}function lo(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&&te(()=>`${o}: ${a?"a branch was given as an element rather than a function":"a branch factory returned a node it had already returned"}, so the SAME node is being re-attached \u2014 any state it accumulated while detached (input value, scroll position, classes set imperatively) comes back with it. Its reactive bindings are left intact rather than disposed, because the node is not this directive's to tear down. Return a FRESH node per call (\`() => div(\u2026)\`) for rebuild semantics, or keep this form deliberately when the reuse is what you want.`),e.insertBefore(s,t.nextSibling),{node:s,owned:u}}function Rt(e,t){t&&F(e),e.parentNode?.removeChild(e)}function ru(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?st([o]):null;o?.parentNode&&(Rt(o,u),o=null);let f=h?t:n!==void 0?n:null,b=pe(()=>lo(m,r,f,c,"when"));o=b.node,u=b.owned,Ge(l,o?[o]:[],"when"),s=!0},g=Y(d,r);return _(r,()=>{a=!0,g(),o&&Rt(o,u),o=null}),s||queueMicrotask(X(()=>{!a&&!s&&r.parentNode&&d()})),r}function ou(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?st([o]):null;o?.parentNode&&(Rt(o,u),o=null);let f=Object.hasOwn(t,h)?t[h]:n,b=pe(()=>lo(m,r,f??null,c,"match"));o=b.node,u=b.owned,Ge(l,o?[o]:[],"match"),s=!0},g=Y(d,r);return _(r,()=>{a=!0,g(),o&&Rt(o,u),o=null}),s||queueMicrotask(X(()=>{!a&&!s&&r.parentNode&&d()})),r}function ut(e,t){let n=globalThis;return n[e]??(n[e]=t())}var Lt=ut(Symbol.for("sibujs.components.registry.v1"),()=>new Map),fo=ut(Symbol.for("sibujs.components.registryVersion.v1"),()=>A(0));function po(){let[e,t]=fo;t(pe(e)+1)}function iu(e,t){Lt.set(e,t),po()}function su(e){Lt.delete(e)&&po()}function au(e){let t=Lt.get(e);return t?t():O(`[Component "${e}" not found]`)}function cu(e){let t=O({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(fo[0](),a=Lt.get(s));let c=a??`missing:${s}`;if(c===r)return;let u=pe(()=>a?a():O(`[Component "${s}" not found]`));r=c,ne(t,u)}let i=ce(o);return _(t,i),t}function mo(e){return typeof e=="function"?mo(e()):e instanceof Node?e:document.createTextNode(String(e))}function uu(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 lu(e,t,n){j(typeof e=="function","each: first argument must be a function that returns an array."),j(typeof t=="function","each: second argument must be a render function."),j(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,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,D=!1,V=!1,K=!1,ge=n.key,dt=()=>{if(K)return;let k=e(),C=k.length,$=r.parentNode;if(!$)return;V||($.insertBefore(o,r.nextSibling),V=!0),b.length<C&&(b=new Array(C));for(let T=0;T<C;T++)b[T]=ge(k[T]);let I=b;f.length<C&&(f=new Array(C)),d.clear(),E.clear();for(let T=0;T<C;T++)E.has(I[T])&&P(`each: duplicate key "${String(I[T])}" at index ${T} (first seen at ${E.get(I[T])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),E.set(I[T],T);l=0;for(let T=0;T<C;T++){let G=I[T],Ln=u.get(G),nt;if(Ln!==void 0)nt=Ln,g[l]=nt,h[l]=k[T],m[l]=T,l++;else{let[Mn,Do]=A(k[T]),[On,$o]=A(T),$t;try{Pe();try{$t=mo(t(Mn,On))}finally{De()}}catch(Io){let Ho=I[T];$t=document.createComment(`each:error:${T}`),queueMicrotask(()=>{L(Io,{phase:"render",name:`each row (key="${String(Ho)}")`,node:r.parentNode?r:void 0})})}nt={node:$t,item:Mn,setItem:Do,index:On,setIndex:$o}}d.set(G,nt),f[T]=nt.node}for(let[T,G]of u)d.has(T)||(F(G.node),G.node.parentNode&&$.removeChild(G.node));if(C===0){c=0;let T=u;u=d,d=T,D=!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 J=0;for(let T=0;T<C;T++){let G=S.get(I[T]);G!==void 0&&(v[J]=T,x[J]=G,J++)}let tt=uu(x,J);y.length<C?y=new Uint8Array(C):y.fill(0,0,C);for(let T=0;T<tt.length;T++)y[v[tt[T]]]=1;let Z=o;for(let T=C-1;T>=0;T--){let G=f[T];y[T]||G.nextSibling!==Z&&$.insertBefore(G,Z),Z=G}let U=a===i?s:i;U.length<C&&(U.length=C);for(let T=0;T<C;T++)U[T]=I[T];a=U,c=C;let re=u;u=d,d=re,D=!0,R()};function R(){if(l===0)return;let k=l;l=0,q(()=>{for(let C=0;C<k;C++){let $=g[C];$.setItem(h[C]),$.setIndex(m[C]),g[C]=void 0,h[C]=void 0}})}let w=ce(dt);return _(r,()=>{if(!K){K=!0,w();for(let k of u.values())F(k.node),k.node.parentNode?.removeChild(k.node);o.parentNode&&o.parentNode.removeChild(o),V=!1,u.clear(),d.clear(),E.clear(),S.clear(),c=0,g.length=0,h.length=0,m.length=0,l=0}}),D||queueMicrotask(X(()=>{!D&&!K&&r.parentNode&&dt()})),r}function du(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"||go(t,r);else go(t,n);return t}function go(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),_(n,we(n,t));return}e.appendChild(document.createTextNode(String(t)))}var fu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),bo=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),ho=new WeakMap;function pu(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=fu.has(f),S=n[r]==="/";if(S&&r++,r<o&&r++,y||S)m.push({t:0,el:{tag:f,svg:bo.has(f),attrs:b,children:[]}});else{let v=h();if(Qn(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:bo.has(f),attrs:b,children:v}})}}else g(m);return m}return h()}function Cn(e,t){let n=e.svg?document.createElementNS(H,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:Gt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?_(n,it(n,i,s)):le(n,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=t[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}le(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):P(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:Gt(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(Cn(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,we(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 yo(e,...t){let n=ho.get(e);return n||(n=pu(e),ho.set(e,n)),So(n,t)}function vo(e,t){return So(e,t)}function So(e,t){if(e.length===1&&e[0].t===0)return Cn(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(Cn(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,we(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 mu(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&be()&&P("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");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&&(F(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(y))}}l.insertBefore(f,r.nextSibling),c=f,u=!0},h=ce(g);return u||queueMicrotask(X(()=>{!u&&r.parentNode&&g()})),_(r,()=>{d=!0,h();for(let m of o.values())F(m),m.parentNode&&m.parentNode.removeChild(m);o.clear(),i.length=0,c=null}),r}function gu(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");j(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=()=>typeof performance<"u"?performance.now():0,r=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=jn(()=>{let d=e();return i(d),d}):(s=e,i(s));let a=n()-r,c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&ue(c,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(c&&ue(c,"app:unmount",{rootElement:s}),u){bu(u.start,u.end);return}F(s),s.parentNode?.removeChild(s)}}}function bu(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=ve;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){ke("mount",ve,1);return}F(a),a.parentNode===n&&n.removeChild(a)}s||L(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function hu(e,t){let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=X(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{L(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),_(n,()=>{i=!0,o&&(F(o),o.remove(),o=null)}),n}function yu(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function xo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function vu(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=xo(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 Su(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Fe(r)||Ke(r)}function i(){if($e(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=xo(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 xu(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=ee(()=>{if(c(),g)return;m();let f=++d,b=typeof AbortController<"u"?new AbortController:null;h=b,q(()=>{i(!0),a(null)});let y=()=>g||f!==d,S;try{S=e({signal:b?b.signal:void 0})}catch(v){if(y())return;q(()=>{a(v),i(!1)});return}S.then(v=>{y()||(h=null,q(()=>{r(v),i(!1)}))},v=>{y()||(h=null,q(()=>{a(v),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{g||u(f=>f+1)},dispose:()=>{g||(g=!0,l(),m())}}}function Qe(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)||!Qe(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)=>Qe(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&&Qe(e.cause,a.cause,n)&&wo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:wo(r,o,n)}function wo(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)&&Qe(e[i],t[i],n))}function wu(e){return A(e,{equals:(t,n)=>Qe(t,n)})}function We(e,t){j(typeof e=="function","derived: argument must be a getter function.");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{ce(()=>{o._v=e(),o._d=!1,o._init=!0},c)}catch(l){throw s=!0,Ie(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{Ne(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&&Ie(c)}d&&!s&&!Object.is(l,o._v)&&ue(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 xr()||s?(o._d&&(g(),a!==void 0&&h()),o._v):(o._d&&(g(),a!==void 0&&($e(o),h())),$e(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,Ie(c);let l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(l)try{l.emit("computed:destroy",{signal:o,getter:m})}catch{}},d&&ue(d,"computed:create",{signal:o,name:n,getter:m}),m}function Tu(e){let[t,n]=A(e);return{get current(){return t()},set current(r){n(r)}}}function To(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Eu(e){j(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t=Object.create(null);Object.keys(e).forEach(c=>{let[u,d]=A(e[c]);To(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=>{To(c,u,t[u][0]())}),c};return[n,{setState:c=>{let u=r(),d=typeof c=="function"?c(u):c;q(()=>{Object.entries(d).forEach(([g,h])=>{Object.hasOwn(t,g)&&t[g][1](h)})})},reset:()=>{q(()=>{Object.keys(e).forEach(c=>{let u=t[c][1];u(e[c])})})},subscribe:c=>{let u=!0;return ee(()=>{let d=r();if(u){u=!1;return}Pe();try{c(d)}finally{De()}})},subscribeKey:(c,u)=>{let d,g=!0;return ee(()=>{let h=t[c][0]();if(g){d=h,g=!1;return}if(!Object.is(h,d)){let m=d;d=h,Pe();try{u(h,m)}finally{De()}}})},getSnapshot:r}]}function ku(e,t){if(j(typeof e=="function","watch: first argument must be a getter function."),j(typeof t=="function","watch: second argument must be a callback function."),me())return()=>{};let n,r=!0;return ce(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Pe();try{t(s,a)}finally{De()}}})}function Cu(e,t,n){return[We(e,n),i=>{q(()=>t(i))}]}function _u(e){let t=e();return be()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function Au(e){if(!be())return ee(e);let t=ee(e),n=null;return queueMicrotask(()=>{try{n=ee(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Eo(e,t){return me()?()=>{}:Y(e,t)}var _n="data-sibu-enhanced",An=new WeakMap;function ko(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=ve){let i=r.length-o+e.length;e.length=0,ke(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var Co=["text","attr","class","show","on","cleanup"];function _o(e,t){if(t==null)return e;if(typeof t!="string")return t;let n=t.startsWith("@")?`[data-ref="${t.slice(1)}"]`:t;try{return e.querySelector(n)}catch{return null}}function lt(e,t){return Eo(t,e)}function Nu(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 Ru(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 Lu(e,t,n,r){let o=`ctx.each[${r}]`;if(be())for(let i of Object.keys(n))j(Co.includes(i),`${o}: unknown binding "${i}". Expected one of: ${Co.join(", ")}.`);if(n.text!==void 0&&(j(typeof n.text=="function",`${o}: "text" must be a function returning the value.`),e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];j(typeof s=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];j(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(t,i,s)}if(n.show!==void 0&&(j(typeof n.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];j(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(t,i,s)}n.cleanup!==void 0&&(j(typeof n.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(n.cleanup))}function Mt(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(_n)==="true")return be()&&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?(te(()=>`enhance: ctx.${h}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`),!0):!1,c=(h,m,l)=>{if(a(h))return;let f=_o(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=>_o(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(lt(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(lt(f,()=>{let b=l(),y=b==null?null:String(b);le(f,m,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(h,m,l)=>{c("classed",h,f=>{r.push(lt(f,()=>{f.classList.toggle(m,!!l())}))})},show:(h,m)=>{c("show",h,l=>{let f=l.hidden;r.push(lt(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(lt(f,()=>{Ru(b,y())}));let x=()=>S(Nu(b));b.addEventListener(v,x),r.push(()=>b.removeEventListener(v,x))})},each:(h,m)=>{if(a("each"))return;j(typeof m=="function","ctx.each: second argument must be a function.");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&&Lu(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=>{te(()=>`enhance: the promise returned by the setup also rejected: ${String(m)}`)}),new Error("[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored.")}catch(h){throw ko(r,"enhance"),s=!0,h}typeof d=="function"&&r.push(d);let g=()=>{i||(i=!0,An.get(n)===o&&(An.delete(n),n.removeAttribute(_n)),rt(n,g),ko(r,"enhance"),s=!0)};return _(n,g),An.set(n,o),n.setAttribute(_n,"true"),g}function Mu(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Mt(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 Ou=/^[A-Za-z0-9_-]+$/,Ao=Symbol.for("sibujs.islands.lazy"),Ot=ut(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Pu(e){return e[Ao]=!0,e}function Du(e,t){if(!Ou.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Ot.set(e,t)}function $u(e){Ot.delete(e)}async function Iu(e){if(typeof e=="function"&&e[Ao]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function Hu(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(!Ot.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=Ot.get(s);d&&Iu(d).then(g=>{if(!o){if(!g){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let h=Mt(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(Bu(u,i,c,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Bu(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 Vu=new Set(["__proto__","constructor","prototype"]);function Nn(e){return Vu.has(e)}function Pt(e){let t={};for(let n of Object.keys(e))Nn(n)||(t[n]=e[n]);return t}function No(e){return e}var Fp=1024*1024;function ju(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=ce(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,c())},u}var Ro=16;function Fu(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:Ro*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Ro)}function zu(){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(),L(c,{phase:"async",name:"transition"})};Fu(()=>{try{let c=Nt(o());c?c.then(s,a):s()}catch(c){a(c)}})}return{pending:e,start:r}}function Wu(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var Dt={};Pn(Dt,{RenderProp:()=>tl,assertType:()=>ul,compose:()=>el,createGuard:()=>ll,createSlots:()=>rl,defineComponent:()=>ol,defineSlottedComponent:()=>il,defineStrictComponent:()=>cl,globalStore:()=>Zu,machine:()=>qu,optimistic:()=>Ku,optimisticList:()=>Ju,persisted:()=>Uu,timeline:()=>Gu,validateProps:()=>Po,validators:()=>al,withBoundary:()=>nl,withDefaults:()=>Qu,withProps:()=>sl,withWrapper:()=>Xu});function et(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function qu(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=et(e.states,i);if(!b?.on)return;let y=et(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 K=x(E);D={...E,...Pt(K)}}i=S,s=D,q(()=>{x&&o(D),n(S)});let V=et(e.states,S);V?.entry&&V.entry(s)}function g(f){a.push(f),!c&&u()}let h=et(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=et(e.states,b);if(!y?.on)return!1;let S=et(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 Uu(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)=>Nn(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=ee(()=>{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 Ku(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 Ju(e){let t=0,n=0,r=0,o=new Map,i=[];for(let R of e){let w={id:t++,key:n++,base:R,claims:[],visible:!0,refs:0};o.set(w.id,w),i.push(w.id)}function s(R){let w=R.claims;return w.length>0?w[w.length-1].value:R.base}function a(R,w){let M=R.claims;for(let k=M.length-1;k>=0;k--)if(M[k].opId<w)return M[k].value;return R.base}function c(R,w,M){let k={opId:w,value:M,settled:!1},C=R.claims,$=C.length;for(;$>0&&C[$-1].opId>w;)$--;return C.splice($,0,k),k}function u(R,w){let M=R.claims.indexOf(w);M!==-1&&R.claims.splice(M,1)}function d(R){let w=R.claims,M=0;for(;M<w.length&&w[M].settled;)R.base=w[M].value,M++;M>0&&w.splice(0,M)}let[g,h]=A(i.map(R=>s(o.get(R)))),[m,l]=A(!1),f=0,b=new Set;function y(){let R=new Array(i.length);for(let w=0;w<i.length;w++)R[w]=s(o.get(i[w]));return R}function S(R){q(()=>{let w=!1;try{w=R()}finally{l(f>0),w&&h(y())}})}function v(R){let w=o.get(R);return!w||!w.visible?!1:(w.visible=!1,i=i.filter(M=>M!==R),!0)}function x(R){let w=[];for(let I of R){let J=o.get(I);!J||J.visible||b.has(I)||w.push(I)}if(w.length===0)return!1;let M=new Array(i.length+w.length),k=0,C=0,$=0;for(;k<i.length&&C<w.length;){let I=o.get(i[k]).key,J=o.get(w[C]).key;M[$++]=I<=J?i[k++]:w[C++]}for(;k<i.length;)M[$++]=i[k++];for(;C<w.length;)M[$++]=w[C++];for(let I of w)o.get(I).visible=!0;return i=M,!0}function E(R){for(let w of R){let M=o.get(w);M&&M.refs++}}function D(R){for(let w of R){let M=o.get(w);M&&(M.refs--,M.refs<=0&&!M.visible&&(o.delete(w),b.delete(w)))}}function V(R){if(D(R),f--,f<=0&&(f=0,b.clear(),o.size!==i.length))for(let[w,M]of o)M.visible||o.delete(w)}async function K(R,w){let M=++r,k={id:t++,key:n++,base:R,claims:[],visible:!1,refs:1},C=c(k,M,R);S(()=>(o.set(k.id,k),k.visible=!0,i=[...i,k.id],f++,!0));let $,I=!1;try{$=await w()}catch{I=!0}S(()=>{try{if(I)return b.add(k.id),u(k,C),v(k.id);let J=s(k);return C.value=$,C.settled=!0,d(k),k.visible&&!Object.is(J,s(k))}finally{V([k.id])}})}async function ge(R,w){let M=++r,k=[];for(let $ of i)R(a(o.get($),M))&&k.push($);S(()=>{if(E(k),f++,k.length===0)return!1;let $=new Set(k);for(let I of k){let J=o.get(I);J&&(J.visible=!1)}return i=i.filter(I=>!$.has(I)),!0});let C=!1;try{await w()}catch{C=!0}S(()=>{try{if(!C){for(let $ of k)b.add($);return!1}return x(k)}finally{V(k)}})}async function dt(R,w,M){let k=++r,C=[];for(let Z of i){let U=o.get(Z),re=a(U,k);R(re)&&C.push({row:U,nextValue:{...re,...w}})}let $=C.map(Z=>Z.row.id),I=[];S(()=>{E($),f++;let Z=!1;for(let U of C){let re=s(U.row);I.push(c(U.row,k,U.nextValue)),U.row.visible&&!Object.is(re,s(U.row))&&(Z=!0)}return Z});let J,tt=!1;try{J=await M()}catch{tt=!0}S(()=>{try{let Z=!1;for(let U=0;U<I.length;U++){let re=C[U].row,T=I[U],G=s(re);tt?u(re,T):(T.value=J,T.settled=!0),d(re),re.visible&&!Object.is(G,s(re))&&(Z=!0)}return Z}finally{V($)}})}return{items:g,pending:m,add:K,remove:ge,update:dt}}function Gu(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=We(()=>n()[o()]),a=We(()=>o()>0),c=We(()=>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),q(()=>{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(){q(()=>{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 Mo=Promise.prototype.then;function Lo(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(Mo,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function Oo(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===Mo?(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"?Lo(s,l,f):(i==="rejected"?l:f)()};i==="native"?Lo(s,l,f):i==="invoking"?a.push(b):queueMicrotask(i==="rejected"?l:f)}}}function Yu(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 Zu(e){let t=Yu(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){L(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):L(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=Pt(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,V=()=>{if(E&&!x){P(`globalStore: middleware ${v} next() called after it failed for "${String(l)}"; ignored.`),x=!0;return}if(x){P(`globalStore: middleware ${v} next() called more than once for "${String(l)}"; ignored.`);return}if(x=!0,D){S(v+1);return}let ge=()=>u(()=>S(v+1),!1);if(!K){ge();return}K.probe(()=>{E=!0,P(`globalStore: middleware ${v} next() called after it failed for "${String(l)}"; ignored.`)},ge)},K=null;try{K=Oo(i[v](n(),String(l),f,V))}catch(ge){throw E=!0,ge}finally{D=!1}K&&(K.failedEarly&&(E=!0),K.promise.then(void 0,ge=>{E=!0,L(ge,{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 Xu(e,t){return n=>t(e,n)}function Qu(e,t){return n=>e({...t,...n})}function el(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function tl(e){return e.render(e.data())}function nl(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 rl(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 ol(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function il(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function sl(e,t){return n=>e(t(n))}var al={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 Po(e,t){let n={...e};{let r=[];for(let[o,i]of Object.entries(t)){let s=typeof i=="function"?{type:i}:i;if(n[o]===void 0&&s.default!==void 0&&(n[o]=typeof s.default=="function"?s.default():s.default),s.required&&n[o]==null){r.push(`Prop '${o}' is required`);continue}if(n[o]!=null){if(s.type){let a=s.type(n[o],o);a!==!0&&r.push(a)}if(s.validator){let a=s.validator(n[o],o);a!==!0&&r.push(a)}}}return r.length>0&&P(`Prop validation errors:
|
|
401
401
|
${r.map(o=>` - ${o}`).join(`
|
|
402
|
-
`)}`),n}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
|
|
402
|
+
`)}`),n}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 cl(e){return t=>{let n=Po(t,e.props);return e.setup(n)}}function ul(e,t,n){{let r=t(e,n||"value");if(r!==!0)throw new TypeError(`[SibuJS Contract] ${r}`)}}function ll(e){return t=>e(t,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={...Dt,...Rn,patterns:Dt});})();
|