@webjsdev/core 0.7.29 → 0.7.30

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.
@@ -1,4 +1,4 @@
1
1
  var As=Object.defineProperty;var $=(e,t)=>()=>(e&&(t=e(e=0)),t);var jn=(e,t)=>{for(var n in t)As(e,n,{get:t[n],enumerable:!0})};function fr(e,t,n){Uo.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function Xt(e){return JSON.stringify(await dr(e))}function z(e){return hr(JSON.parse(e))}async function dr(e){let t=Do();return await $o(e,t),W(e,t)}function hr(e){return B(e,Wo())}function Do(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function $o(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!Ko(r))continue;let s=t.refCount.get(r)||0;if(t.refCount.set(r,s+1),!(s>0)){if(typeof Blob<"u"&&r instanceof Blob){let o=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,o);continue}if(typeof FormData<"u"&&r instanceof FormData){let o=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,o);for(let[,i]of o)typeof i!="string"&&n.push(i);continue}if(Array.isArray(r))for(let o=0;o<r.length;o++)n.push(r[o]);else if(r instanceof Map)for(let[o,i]of r)n.push(o),n.push(i);else if(r instanceof Set)for(let o of r)n.push(o);else if(Go(r))for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.push(r[o])}}for(let[r,s]of t.refCount)s>1&&t.idOf.set(r,t.nextId++)}function W(e,t){if(e===null)return null;if(e===void 0)return{[y]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[y]:"NaN"}:e===1/0?{[y]:"Inf"}:e===-1/0?{[y]:"-Inf"}:Object.is(e,-0)?{[y]:"-0"}:e;if(n==="bigint")return{[y]:"BigInt",v:e.toString()};if(n==="symbol"){let o=Symbol.keyFor(e);if(o===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[y]:"Sym",v:o}}if(n==="function")throw new TypeError("Cannot serialize a function.");let r=t.idOf.get(e);if(r!==void 0&&t.emitted.has(r))return{[y]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let s;if(e instanceof Date)s={[y]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)s={[y]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let o=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?s={[y]:"File",v:ve(o),n:e.name,t:e.type||"",m:e.lastModified}:s={[y]:"Blob",v:ve(o),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let o=t.fdEntries.get(e)||[...e.entries()],i=[];for(let[c,a]of o)i.push([c,W(a,t)]);s={[y]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)s=qo(e);else if(e instanceof Map){let o=[];for(let[i,c]of e)o.push([W(i,t),W(c,t)]);s={[y]:"Map",v:o}}else if(e instanceof Set){let o=[];for(let i of e)o.push(W(i,t));s={[y]:"Set",v:o}}else if(Array.isArray(e))s=e.map(o=>W(o,t));else{s={};for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let i=Yo(o)?"_"+o:o;fr(s,i,W(e[o],t))}}if(r!==void 0){if(Array.isArray(s))return{[y]:"Arr",_id:r,v:s};s._id=r}return s}function qo(e){if(e instanceof ArrayBuffer)return{[y]:"buf",v:ve(new Uint8Array(e))};if(e instanceof DataView)return{[y]:"dv",v:ve(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=Ho[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[y]:n,v:ve(r)}}function Wo(){return{refs:new Map}}function B(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let o=[];for(let i=0;i<e.length;i++)o.push(B(e[i],t));return o}let n=e[y];if(typeof n=="string")return zo(e,n,t);let r={},s=e._id;typeof s=="number"&&t.refs.set(s,r);for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o)||o==="_id")continue;let i=Jo(o)?o.slice(1):o;fr(r,i,B(e[o],t))}return r}function zo(e,t,n){let r=e._id,s=o=>(typeof r=="number"&&n.refs.set(r,o),o);switch(t){case"undef":return;case"NaN":return NaN;case"Inf":return 1/0;case"-Inf":return-1/0;case"-0":return-0;case"BigInt":return s(BigInt(e.v));case"Sym":return s(Symbol.for(e.v));case"Date":return s(e.v==null?new Date(NaN):new Date(e.v));case"Error":{let o=new Error(e.v.message);return o.name=e.v.name,e.v.stack&&(o.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,o),o}case"Map":{let o=new Map;typeof r=="number"&&n.refs.set(r,o);for(let[i,c]of e.v)o.set(B(i,n),B(c,n));return o}case"Set":{let o=new Set;typeof r=="number"&&n.refs.set(r,o);for(let i of e.v)o.add(B(i,n));return o}case"Arr":{let o=[];typeof r=="number"&&n.refs.set(r,o);for(let i of e.v)o.push(B(i,n));return o}case"Ref":{let o=n.refs.get(e.v);if(o===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return o}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let o=Ae(e.v);return s(new Blob([o],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let o=Ae(e.v);return s(new File([o],e.n,{type:e.t||"",lastModified:e.m}))}case"FD":{if(typeof FormData>"u")throw new TypeError("FormData is not available in this environment.");let o=new FormData;s(o);for(let[i,c]of e.v){let a=B(c,n);o.append(i,a)}return o}default:{if(t==="buf"){let i=Ae(e.v);return s(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=Ae(e.v);return s(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let o=Vo[t];if(o){let i=Ae(e.v),c=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength);return s(new o(c))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function Ko(e){return e!==null&&typeof e=="object"}function Go(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Yo(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function Jo(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function ve(e){if(pr)return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64");let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Ae(e){if(pr){let r=Buffer.from(e,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}var y,Uo,Ho,Vo,pr,Ee=$(()=>{y="_$wj",Uo=new Set(["__proto__","constructor","prototype"]);Ho={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},Vo={i8:Int8Array,u8:Uint8Array,u8c:Uint8ClampedArray,i16:Int16Array,u16:Uint16Array,i32:Int32Array,u32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:typeof BigInt64Array<"u"?BigInt64Array:null,bu64:typeof BigUint64Array<"u"?BigUint64Array:null};pr=typeof Buffer<"u"&&typeof Buffer.from=="function"});var Er={};jn(Er,{observeLazy:()=>di,observeViewportOnce:()=>mi});function vr(e){let t=en.get(e);return t||(t=import(e).finally(()=>en.delete(e)),en.set(e,t),t)}function di(e){for(let[t,n]of Object.entries(e))K.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of K.values())vr(t);K.clear();return}Te||(Te=new IntersectionObserver(hi,{rootMargin:"200px"})),Ar(),typeof MutationObserver<"u"&&new MutationObserver(()=>Ar()).observe(document.body,{childList:!0,subtree:!0})}function Ar(){if(!(!Te||!K.size))for(let e of K.keys())for(let t of document.querySelectorAll(e))Te.observe(t)}function hi(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=K.get(n);r&&(vr(r),K.delete(n),Te?.unobserve(t.target))}}function pi(e){for(let t of e){if(!t.isIntersecting)continue;let n=st.get(t.target);st.delete(t.target),Ce?.unobserve(t.target),n&&n()}}function mi(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(Ce||(Ce=new IntersectionObserver(pi,{rootMargin:"200px"})),st.set(e,t),Ce.observe(e),()=>{st.delete(e),Ce?.unobserve(e)})}var K,Te,en,Ce,st,Cr=$(()=>{K=new Map,Te=null,en=new Map;Ce=null,st=new WeakMap});var tn,nn=$(()=>{tn=typeof HTMLElement<"u"?class extends HTMLElement{constructor(){super(),this._webjsLoadedSrc=null,this._webjsLazyTeardown=null}static get observedAttributes(){return["src"]}connectedCallback(){this._webjsScheduleLoad()}disconnectedCallback(){this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null)}attributeChangedCallback(t,n,r){t==="src"&&this.isConnected&&this._webjsScheduleLoad()}_webjsScheduleLoad(){let t=this.getAttribute("src");if(!t){this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null),this._webjsLoadedSrc=null;return}let n=t;try{n=new URL(t,location.href).href}catch{}if(n===this._webjsLoadedSrc)return;this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null),(this.getAttribute("loading")||"eager").toLowerCase()==="lazy"?(this._webjsLoadedSrc=n,Promise.resolve().then(()=>(Cr(),Er)).then(({observeViewportOnce:s})=>{this._webjsLoadedSrc!==n||!this.isConnected||(this._webjsLazyTeardown=s(this,()=>{this._webjsLazyTeardown=null,this._webjsLoad(n)}))})):(this._webjsLoadedSrc=n,this._webjsLoad(n))}_webjsLoad(t){Promise.resolve().then(()=>(ot(),Tr)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&tn&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",tn)});function yi(e,t,n){switch(e){case"append":n&&t.append(n);break;case"prepend":n&&t.prepend(n);break;case"before":n&&t.before(n);break;case"after":n&&t.after(n);break;case"replace":n&&t.replaceWith(n);break;case"update":n&&t.replaceChildren(n);break;case"remove":t.remove();break;default:break}}function sn(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let o=n.createElement("template");o.innerHTML=e,r=o.content}else if(e&&e.nodeType)r=e;else return;let s=r.querySelectorAll?Array.from(r.querySelectorAll("webjs-stream")):[];if(s.length)for(let o of s)n.body.append(o);else n.body.append(r)}var bi,rn,it=$(()=>{bi=new Set(["append","prepend","before","after","replace","update"]);rn=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this._webjsApplied||(this._webjsApplied=!0,this._webjsApply())}_webjsApply(){let t=(this.getAttribute("action")||"").toLowerCase(),n=this.ownerDocument||document,r=[],s=this.getAttribute("target");if(s){let i=n.getElementById(s);i&&(r=[i])}else{let i=this.getAttribute("targets");if(i)try{r=Array.from(n.querySelectorAll(i))}catch{r=[]}}let o=bi.has(t)?this.querySelector("template"):null;try{for(let i of r){let c=o?o.content.cloneNode(!0):null;yi(t,i,c)}}finally{this.remove()}}}:null;typeof customElements<"u"&&rn&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",rn)});var kr,xr=$(()=>{kr=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&kr&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",kr)});function at(e){let t=e||(typeof document<"u"?document:null);if(!(!t||typeof t.querySelectorAll!="function")){for(let n of t.querySelectorAll('script[type="application/json"]#__webjs-seeds, script[type="application/json"][data-webjs-seeds]'))jr(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))jr(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function jr(e,t,n){if(e)try{let r=z(e);if(r&&typeof r=="object")for(let s in r)ke.has(s)||ke.set(s,r[s])}catch{}n?n():t.remove?.()}function gi(e,t,n){Nr||(Nr=!0,at());let r=`${e}/${t}/${n}`;if(ke.has(r)){let s=ke.get(r);return ke.delete(r),s}return Rr}var ke,Rr,Nr,on=$(()=>{Ee();ke=new Map,Rr=Symbol("webjs.seed.miss"),Nr=!1});var Tr={};jn(Tr,{_FRAME_TOP:()=>zr,_LIVE_ATTRS:()=>hn,_activeFrameId:()=>Wr,_addNewHeadElements:()=>pn,_applyStreamedResolve:()=>ys,_blurOutgoingFocus:()=>ut,_buildSubmitFormData:()=>Hr,_bumpNavToken:()=>$i,_clearFormBusy:()=>as,_clearFrameBusy:()=>os,_collectChildrenSlots:()=>le,_currentPageUrl:()=>qi,_diffElementInPlace:()=>yt,_eligibleAnchorHref:()=>dt,_findAnchorInPath:()=>Vr,_getSubmitAction:()=>qr,_getSubmitMethod:()=>$r,_isNonHtmlPath:()=>Wi,_keyOf:()=>ce,_longestSharedPath:()=>Gr,_markFormBusy:()=>is,_markFrameBusy:()=>ss,_mergeHead:()=>ps,_navToken:()=>Di,_onPopState:()=>bn,_onSubmit:()=>yn,_prefetch:()=>ue,_prefetchHasHoverPointer:()=>Zr,_prefetchInflightSize:()=>Bi,_prefetchMode:()=>ht,_prefetchPeek:()=>Fi,_prefetchSaysSaveData:()=>wn,_prefetchSuppressed:()=>es,_prefetchTake:()=>ts,_reactivateScripts:()=>gt,_readStreamedShell:()=>ms,_reconcileChildren:()=>vn,_regraftPermanentElements:()=>ls,_regraftPermanentInSlice:()=>An,_resetPrefetch:()=>Ui,_resetWarnOnce:()=>Vi,_resolveTargetFrameId:()=>gn,_restoreOptimistic:()=>xe,_runWithTransition:()=>lt,_setCurrentPageUrl:()=>Hi,_snapshotCache:()=>C,_streamBoundariesProgressively:()=>gs,_takeResolveUnit:()=>bs,_viewTransitionsEnabled:()=>cs,collectChildrenSlots:()=>le,disableClientRouter:()=>Fr,enableClientRouter:()=>mn,loadFrame:()=>wi,longestSharedPath:()=>Gr,navigate:()=>Br,revalidate:()=>Ur});function Ir(e){return typeof Document<"u"&&typeof Document.parseHTMLUnsafe=="function"?Document.parseHTMLUnsafe(e):typeof DOMParser<"u"?new DOMParser().parseFromString(e,"text/html"):null}function _i(){an||typeof MutationObserver>"u"||typeof customElements>"u"||(an=new MutationObserver(e=>{for(let t of e)for(let n of t.addedNodes){if(n.nodeType!==1)continue;let r=n;r.tagName?.includes("-")&&customElements.upgrade(r);for(let s of r.querySelectorAll("*"))s.tagName?.includes("-")&&customElements.upgrade(s)}}),an.observe(document.body,{childList:!0,subtree:!0}))}function mn(){D||typeof document>"u"||(D=!0,document.addEventListener("click",Dr,!1),document.addEventListener("submit",yn,!1),window.addEventListener("popstate",bn),document.addEventListener("pointerover",ae,!0),document.addEventListener("focusin",ae,!0),document.addEventListener("touchstart",ae,{capture:!0,passive:!0}),document.addEventListener("pointerout",ns,!0),document.addEventListener("webjs:navigate",dn),_i(),dn(),typeof history<"u"&&"scrollRestoration"in history&&(ct=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(O=location.href))}function Fr(){D&&(D=!1,document.removeEventListener("click",Dr,!1),document.removeEventListener("submit",yn,!1),window.removeEventListener("popstate",bn),document.removeEventListener("pointerover",ae,!0),document.removeEventListener("focusin",ae,!0),document.removeEventListener("touchstart",ae,{capture:!0}),document.removeEventListener("pointerout",ns,!0),document.removeEventListener("webjs:navigate",dn),wt(),Sn(),U&&(U.disconnect(),U=null),typeof history<"u"&&ct!==null&&(history.scrollRestoration=ct,ct=null),O=null)}async function Br(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){location.href=e;return}await _n(n.href,t?.replace??!1,null)}async function wi(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1};k&&k.abort(),k=new AbortController;let s=k.signal,o=++g;return pt(r.href,n,!1,null,"GET",null,s,o)}function Ur(e){if(!e){C.clear(),A.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;C.delete(n),A.delete(n)}function Dr(e){if(!D||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Vr(e);if(!t||t.hasAttribute("download")||t.hasAttribute("data-no-router")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin||r.pathname===location.pathname&&r.search===location.search&&r.hash||_t.test(r.pathname))return;e.preventDefault();let s=gn(t);_n(n,!1,s)}function bn(e){_n(location.href,!0,null)}function yn(e){if(!D||e.defaultPrevented)return;let t=e.target;if(!t||t.nodeType!==1||t.tagName!=="FORM"||t.hasAttribute("data-no-router"))return;let n=e.submitter??null;if(n&&n.hasAttribute("data-no-router"))return;let r=n&&n.getAttribute("formtarget")||t.getAttribute("target")||"";if(r&&r!=="_self")return;let s=$r(t,n);if(s==="dialog")return;let o=qr(t,n),i;try{i=new URL(o,location.href)}catch{return}if(i.origin!==location.origin||_t.test(i.pathname))return;let c=Hr(t,n);e.preventDefault();let a=gn(n||t);vi(i.href,s,c,a,t)}function $r(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function qr(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function Hr(e,t){try{return new FormData(e,t||void 0)}catch{let n=new FormData(e);return t&&t.getAttribute("name")&&n.append(t.getAttribute("name"),t.getAttribute("value")||""),n}}function Vr(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Wr(e){let t=e;for(;t;){let n=t.closest("webjs-frame");if(n&&n.id)return n.id;let r=t.getRootNode();if(r&&r.host)t=r.host;else break}return null}function gn(e){if(!e)return null;let t=e.closest&&e.closest("[data-webjs-frame]"),n=t?t.dataset?t.dataset.webjsFrame:t.getAttribute("data-webjs-frame"):null;if(n!=null&&n!==""){if(n===zr)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Kr(`webjs:frame-unresolved:${n}`,`[webjs] data-webjs-frame="${n}" did not match a live <webjs-frame id="${n}">; performing a normal navigation instead.`),null)}return Wr(e)}function Kr(e,t){ln.has(e)||(ln.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function Lr(){if(typeof process<"u"&&process.env||un||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;un=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&Kr("scroll-behavior-smooth-html","[webjs] Detected `scroll-behavior: smooth` on <html>. The client router scrolls to the top instantly on navigation (like a native page load), so route transitions are not affected by it. It still applies to in-page #anchor links. Pairing it with a sticky `backdrop-filter` header can also flash on iOS during navigation.")}function ft(e){if(typeof document>"u")return;let t=document.documentElement;if(!(!t||!t.hasAttribute("data-webjs-nav-progress")))try{e?t.setAttribute("data-navigating",""):t.removeAttribute("data-navigating")}catch{}}function le(e){let t=new Map,n=[];function r(s){if(s.nodeType===8){let o=s,i=o.data,c=/^wj:children:(.+)$/.exec(i);if(c){n.push({path:c[1],start:o});return}if(i.trim()==="/wj:children"){let a=n.pop();a&&!t.has(a.path)&&t.set(a.path,{start:a.start,end:o});return}return}if(s.hasChildNodes&&s.hasChildNodes())for(let o=s.firstChild;o;o=o.nextSibling)r(o)}return r(e),t}function Gr(e,t){let n=null;for(let r of e.keys())t.has(r)&&(n===null||r.length>n.length)&&(n=r);return n}function Yr(e){let t=J(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),C.has(t)&&C.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(C.set(t,n);C.size>Si;){let r=C.keys().next().value;C.delete(r)}}function Ai(e){let t=J(e),n=C.get(t);return n==null?null:(C.delete(t),C.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function J(e){let t=new URL(e,location.href);return t.pathname+t.search}async function _n(e,t,n){k&&k.abort(),k=new AbortController;let r=k.signal,s=++g;O&&Yr(O);let o=setTimeout(()=>{ft(!0),o=null},150),i=null;t||(i=fs());try{if(t){let c=Ai(e);if(c){let a=Ir(c.html);if(a){us(a,n,!0,null),typeof window<"u"&&window.scrollTo({left:c.scrollX,top:c.scrollY,behavior:"instant"}),pt(e,n,!1,i,"GET",null,r,s).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await pt(e,n,!t,i,"GET",null,r,s)}finally{o&&clearTimeout(o),s===g&&(ft(!1),typeof location<"u"&&(O=location.href))}}async function vi(e,t,n,r,s){k&&k.abort(),k=new AbortController;let o=k.signal,i=++g,c=t==="get"||t==="head",a=new URL(e,location.href);if(c){a.search="";for(let[p,m]of n)a.searchParams.append(p,typeof m=="string"?m:m.name)}O&&Yr(O);let l=setTimeout(()=>{ft(!0),l=null},150),u=fs(),h=s?is(s,i,a.href):null,f=!1;try{let p=await pt(a.href,r,!0,u,c?"GET":t.toUpperCase(),c?null:n,o,i);f=!!(p&&p.ok),!c&&i===g&&(C.clear(),A.clear())}finally{h&&as(h,i,a.href,f),l&&clearTimeout(l),i===g&&(ft(!1),typeof location<"u"&&(O=location.href))}}function Jr(){return[...le(document.body).keys()].join(",")}function wn(){try{let e=typeof navigator<"u"?navigator.connection:null;if(e&&(e.saveData===!0||typeof e.effectiveType=="string"&&/2g$/.test(e.effectiveType))||typeof matchMedia=="function"&&matchMedia("(prefers-reduced-data: reduce)").matches)return!0}catch{}return!1}function Zr(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function xi(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function dt(e){if(!e||!(e instanceof HTMLAnchorElement)||e.hasAttribute("download")||e.hasAttribute("data-no-router")||e.target&&e.target!=="_self")return null;let t=e.href;if(!t)return null;let n;try{n=new URL(t)}catch{return null}return n.origin!==location.origin||n.pathname===location.pathname&&n.search===location.search&&n.hash||_t.test(n.pathname)?null:t}function es(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=xi(e);return t.includes("external")||t.includes("no-prefetch")}function ht(e){if(es(e))return"none";switch((e.getAttribute("data-prefetch")||"").toLowerCase().trim()){case"false":case"none":return"none";case"true":case"render":return"render";case"auto":case"viewport":return"viewport";case"intent":return"intent";default:return Zr()?"intent":"viewport"}}function ue(e){if(!D||typeof fetch!="function"||wn())return;let t=J(e);if(G.has(t)||Ne.has(t))return;let n=A.get(t);if(n&&fn()-n.at<Xr)return;if(G.size>=Qr){for(Ne.add(t),oe.push(e);oe.length>Ci;){let o=oe.shift();Ne.delete(J(o))}return}G.add(t);let r={"x-webjs-router":"1","x-webjs-prefetch":"1"},s=Jr();s&&(r["x-webjs-have"]=s),fetch(e,{method:"GET",headers:r,credentials:"same-origin"}).then(async o=>{let i=o.headers.get("content-type")||"";if(!/^text\/html\b/i.test(i)||o.status>=400)return;let c=o.headers.get("x-webjs-build"),a=o.redirected&&o.url?o.url:e,l=await o.text();ji(t,{html:l,build:c,finalUrl:a,at:fn()})}).catch(()=>{}).finally(()=>{G.delete(t),Ni()})}function Ni(){for(;oe.length&&G.size<Qr;){let e=oe.shift();Ne.delete(J(e)),ue(e)}}function ji(e,t){for(A.has(e)&&A.delete(e),A.set(e,t);A.size>Ei;){let n=A.keys().next().value;A.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function ts(e){let t=J(e),n=A.get(t);return!n||(A.delete(t),fn()-n.at>=Xr)?null:n}function fn(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function ae(e){if(!D)return;let t=rs(e.target);if(!t)return;let n=ht(t);if(n==="none"||n==="render")return;let r=dt(t);if(r){if(e.type==="touchstart"){ue(r);return}n==="intent"&&(je===t&&ie||(wt(),je=t,ie=setTimeout(()=>{ie=null,je=null,ue(r)},Ti)))}}function ns(e){let t=rs(e.target);t&&t===je&&wt()}function wt(){ie&&(clearTimeout(ie),ie=null),je=null}function Sn(){for(let e of Re)clearTimeout(e);Re.clear(),re=new WeakMap}function rs(e){let t=e;for(;t;){if(t instanceof HTMLAnchorElement)return t;let n=t.nodeType===1?t:null;if(n){let s=n.closest&&n.closest("a");if(s instanceof HTMLAnchorElement)return s}let r=t.getRootNode?t.getRootNode():null;t=r&&r.host?r.host:null}return null}function dn(){if(typeof document>"u"||wn())return;let e=typeof IntersectionObserver<"u";e&&(U?(U.disconnect(),Sn()):U=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(re.has(r))continue;let s=setTimeout(()=>{Re.delete(s),re.delete(r),U.unobserve(r);let o=dt(r);o&&ht(r)==="viewport"&&ue(o)},ki);re.set(r,s),Re.add(s)}else{let s=re.get(r);s&&(clearTimeout(s),Re.delete(s),re.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=ht(t);if(n==="render"){let r=dt(t);r&&ue(r)}else n==="viewport"&&e&&U.observe(t)}}function Ri(e){if(typeof document>"u"||!document.body)return!1;let t=le(document.body),n,r=-1;for(let[a,l]of t)a.length>r&&(r=a.length,n=l);if(!n)return!1;let s=n.start.parentNode;if(!s||n.start.parentNode!==n.end.parentNode)return!1;let o=document.createElement("div");o.setAttribute("role","alert"),o.setAttribute("data-webjs-nav-error","");let i=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";o.textContent=i;let c=document.createRange();return c.setStartAfter(n.start),c.setEndBefore(n.end),c.deleteContents(),s.insertBefore(o,n.end),!0}function cn(e,t,n){let r=new CustomEvent("webjs:navigation-error",{bubbles:!0,cancelable:!0,detail:{url:e,status:t??null,error:n||null}});if(typeof document<"u")try{document.dispatchEvent(r)}catch{}r.defaultPrevented||Ri(t)||typeof location<"u"&&(location.href=e)}async function pt(e,t,n,r,s,o,i,c){s=s||"GET";let a=typeof c=="number"?c:g,l,u=null,h=null,f=null,p=!1,m=e,de=t?ss(t,a):null;try{try{let d=s==="GET"&&!o&&!t?ts(e):null;if(d)l=d.html,h=d.build,m=d.finalUrl,f=200,p=!0;else{let T={"x-webjs-router":"1"},w=Jr();w&&(T["x-webjs-have"]=w),t&&(T["x-webjs-frame"]=t),o!=null&&s!=="GET"&&s!=="HEAD"&&(T.accept=Or+", text/html");let N={method:s,headers:T,credentials:"same-origin"};i&&(N.signal=i),o!=null&&s!=="GET"&&s!=="HEAD"&&(N.body=o);let _=await fetch(e,N);f=_.status,p=_.ok;let he=_.headers.get("content-type")||"",pe=/^text\/html\b/i.test(he);if(he.toLowerCase().indexOf(Or)===0){let Ss=await _.text();return a===g&&(xe(r),sn(Ss)),{ok:p,status:f,aborted:!1}}if(_.redirected&&_.url&&(m=_.url),_.status===204||_.status===205)return a===g&&n&&history.pushState(null,"",m),{ok:p,status:f,aborted:!1};if(!pe)return a===g&&(xe(r),cn(e,_.status,null)),{ok:!1,status:f,aborted:!1};h=_.headers.get("x-webjs-build");let E=await ms(_);l=E.shell,E.streaming&&(u=E)}}catch(d){return d&&d.name==="AbortError"?{ok:!1,status:null,aborted:!0}:a!==g?{ok:!1,status:null,aborted:!0}:(xe(r),cn(e,null,d instanceof Error?d:new Error(String(d))),{ok:!1,status:null,aborted:!1})}if(a!==g){if(u&&u.reader)try{u.reader.cancel()}catch{}return{ok:!1,status:f,aborted:!0}}let v=Ir(l);if(!v)return xe(r),cn(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:f,aborted:!1};if(us(v,t,!1,m,h),n&&history.pushState(null,"",m),n){let d=new URL(m);if(d.hash){let T=document.getElementById(d.hash.slice(1));T?T.scrollIntoView():(Lr(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else Lr(),window.scrollTo({left:0,top:0,behavior:"instant"})}return u&&(u.reader||u.rest)&&gs(u.reader,u.dec,u.rest,()=>a===g),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:m,frameId:t,from:"navigate"}})),{ok:p,status:f,aborted:!1}}finally{de&&os(de,a)}}function ss(e,t){if(typeof document>"u")return null;let n=null;try{n=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{n=document.getElementById(e)}if(!n)return null;let r=mt.has(n);return mt.set(n,t),n.setAttribute("aria-busy","true"),r||n.dispatchEvent(new CustomEvent("webjs:frame-busy",{bubbles:!0,detail:{frameId:e,busy:!0}})),n}function os(e,t){if(mt.get(e)!==t)return;mt.delete(e),e.setAttribute("aria-busy","false");let n=e.id||null;e.dispatchEvent(new CustomEvent("webjs:frame-busy",{bubbles:!0,detail:{frameId:n,busy:!1}}))}function is(e,t,n){let r=bt.has(e);return bt.set(e,t),e.setAttribute("aria-busy","true"),r||e.dispatchEvent(new CustomEvent("webjs:submit-start",{bubbles:!0,detail:{form:e,url:n}})),e}function as(e,t,n,r){if(bt.get(e)!==t)return;bt.delete(e),e.setAttribute("aria-busy","false");let s=new CustomEvent("webjs:submit-end",{bubbles:!0,detail:{form:e,url:n,ok:!!r}});e.isConnected?e.dispatchEvent(s):typeof document<"u"?document.dispatchEvent(s):e.dispatchEvent(s)}function Mr(e){if(!e||!e.head)return"";let t=e.head.querySelectorAll('[data-webjs-track="reload"]');if(!t.length)return"";let n="";for(let r of t)n+=Y(r);return n}function cs(){if(typeof document>"u")return!1;let e=document.querySelector('meta[name="view-transition"]');return e?(e.getAttribute("content")||"").trim().toLowerCase()==="same-origin":!1}function lt(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(cs()&&typeof n=="function"){let r=n.call(document,e);r&&r.finished&&typeof r.finished.then=="function"?r.finished.then(()=>{t&&t()}).catch(()=>{}):t&&t();return}e(),t&&t()}function ls(e,t){if(!e||!t||typeof e.querySelectorAll!="function")return;let n=e.querySelectorAll("[data-webjs-permanent][id]");for(let r of n){let s=r.id;if(!s)continue;let o=null;try{o=t.querySelector(`#${CSS.escape(s)}`)}catch{o=null}if(!o||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let i=o.parentNode;i&&o!==r&&i.replaceChild(r,o)}}function An(e,t){let n=[];for(let r of e){if(r.nodeType!==1)continue;let s=r;if(s.hasAttribute&&s.hasAttribute("data-webjs-permanent")&&s.id&&n.push(s),typeof s.querySelectorAll=="function")for(let o of s.querySelectorAll("[data-webjs-permanent][id]"))n.push(o)}if(n.length)for(let r of n){let s=r.id;if(!s)continue;let o=Oi(t,s);if(!o||o===r)continue;let i=o.parentNode;if(i)i.replaceChild(r,o);else{let c=t.indexOf(o);c!==-1&&(t[c]=r)}}}function Oi(e,t){for(let n of e){if(n.nodeType!==1)continue;let r=n;if(r.id===t)return r;if(typeof r.querySelector=="function"){let s=null;try{s=r.querySelector(`#${CSS.escape(t)}`)}catch{s=null}if(s)return s}}return null}function Li(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&se(t)}function us(e,t,n,r,s){try{at(e)}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let u=document.querySelector('script[type="importmap"]'),h=u?u.getAttribute("data-webjs-build"):null,f=!1;if(s&&h&&(f=s!==h),!f&&e.head&&e.head.children.length>0){let p=Mr(document),m=Mr(e);p!==m&&(f=!0)}if(f&&typeof location<"u")try{let p="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(p))sessionStorage.removeItem(p);else{sessionStorage&&sessionStorage.setItem(p,"1"),location.href=r;return}}catch{location.href=r;return}else if(!f)try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}if(t){let u=document.querySelector(`webjs-frame#${CSS.escape(t)}`),h=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(u&&h){pn(e.head),lt(()=>{Ii(u,h),gt(u),se(u),ut()},()=>se(u)),Pr(e.body);return}let f=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});(u||document).dispatchEvent(f),f.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`);return}let o=le(document.body),i=le(e.body),c=Gr(o,i);if(c){pn(e.head),lt(()=>{Mi(o.get(c),i.get(c),e),ut()},()=>Li(o.get(c))),Pr(e.body);return}ps(e.head),ls(document.body,e.body);let a=[...e.body.childNodes];lt(()=>{document.body.replaceChildren(...a),gt(document.body),se(document.body),ut()},()=>se(document.body))}function ut(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function Mi(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let s=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)s.push(i);let o=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)o.push(document.importNode(i,!0));An(s,o),Pi(r,e.start,e.end,s,o);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(gt(i),se(i))}function Pi(e,t,n,r,s){let o=new Map;for(let a of r){if(a.nodeType!==1)continue;let l=ce(a);l&&o.set(l,a)}let i=n,c=[];for(let a of s){if(a.nodeType===1){let l=ce(a);if(l&&o.has(l)){let u=o.get(l);yt(u,a),c.push(u),o.delete(l);continue}}c.push(a)}for(let a of r)if(a.parentNode===e){if(a.nodeType===1&&c.includes(a))continue;e.removeChild(a)}for(let a of c)e.insertBefore(a,i)}function yt(e,t){if(e===t)return;if(e.tagName!==t.tagName){e.replaceWith(t);return}let n=new Set;for(let r of t.attributes)n.add(r.name),!hn.has(r.name)&&e.getAttribute(r.name)!==r.value&&e.setAttribute(r.name,r.value);for(let r of[...e.attributes])hn.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);vn(e,t)}function vn(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(c=>document.importNode(c,!0));An(n,r);let s=new Map;for(let c of n){if(c.nodeType!==1)continue;let a=ce(c);a&&s.set(a,c)}let o=[];for(let c=0;c<r.length;c++){let a=r[c];if(a.nodeType===1){let l=ce(a);if(l&&s.has(l)){let h=s.get(l);yt(h,a),o.push(h),s.delete(l);continue}let u=n[c];if(u&&u.nodeType===1&&!ce(u)&&u.tagName===a.tagName){yt(u,a),o.push(u);continue}}else if(a.nodeType===3){let l=n[c];if(l&&l.nodeType===3){l.nodeValue!==a.nodeValue&&(l.nodeValue=a.nodeValue),o.push(l);continue}}else if(a.nodeType===8){let l=n[c];if(l&&l.nodeType===8){l.nodeValue!==a.nodeValue&&(l.nodeValue=a.nodeValue),o.push(l);continue}}o.push(a)}let i=new Set(o);for(let c of n)!i.has(c)&&c.parentNode===e&&e.removeChild(c);for(let c=0;c<o.length;c++){let a=o[c];(a.parentNode!==e||e.childNodes[c]!==a)&&e.insertBefore(a,e.childNodes[c]||null)}}function ce(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function fs(){let e=le(document.body);if(e.size===0)return null;let t=null;for(let i of e.keys())(t===null||i.length>t.length)&&(t=i);if(t===null)return null;let n=document.getElementById(`wj-loading:${t}`);if(!(n instanceof HTMLTemplateElement))return null;let r=e.get(t),s=[];for(let i=r.start.nextSibling;i&&i!==r.end;i=i.nextSibling)s.push(i);let o=document.createRange();return o.setStartAfter(r.start),o.setEndBefore(r.end),o.deleteContents(),r.start.parentNode.insertBefore(n.content.cloneNode(!0),r.end),{slot:r,oldChildren:s,token:g}}function xe(e){if(!e||e.token!==g)return;let{slot:t,oldChildren:n}=e;if(t.start.parentNode!==t.end.parentNode)return;let r=document.createRange();r.setStartAfter(t.start),r.setEndBefore(t.end),r.deleteContents();for(let s of n)t.start.parentNode.insertBefore(s,t.end)}function Ii(e,t){vn(e,t)}function ds(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function En(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=ds();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function hs(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=ds();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function Y(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function pn(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(Y(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(n.has(Y(r))||(r.tagName==="SCRIPT"?document.head.appendChild(En(r)):document.head.appendChild(hs(r))))}function ps(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let o of t.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&r.add(Y(o));let s=new Set;for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&s.add(Y(o));for(let o of[...t.children])o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(s.has(Y(o))||o.remove());for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(r.has(Y(o))||(o.tagName==="SCRIPT"?t.appendChild(En(o)):t.appendChild(hs(o))))}function se(e){typeof customElements>"u"||Cn(e)}function Cn(e){let t=e instanceof Element?[e,...e.querySelectorAll("*")]:[...e.querySelectorAll("*")];for(let n of t)n.tagName&&n.tagName.includes("-")&&(customElements.upgrade(n),n.shadowRoot&&Cn(n.shadowRoot))}function Pr(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]"))document.body.appendChild(t.cloneNode(!0))}async function ms(e){if(!e.body||typeof e.body.getReader!="function")return{shell:await e.text(),streaming:!1};let t=e.body.getReader(),n=new TextDecoder,r="",s="<template data-webjs-resolve",o="<!--wj-stream-shell-->",i=/<\/html\s*>/i;for(;;){let{value:c,done:a}=await t.read();c&&(r+=n.decode(c,{stream:!0})),a&&(r+=n.decode());let l=r.indexOf(o);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:a?null:t,dec:n,rest:r.slice(l+o.length)};let u=r.indexOf(s);if(u!==-1)return{shell:r.slice(0,u),streaming:!0,reader:a?null:t,dec:n,rest:r.slice(u)};if(a)return{shell:r,streaming:!1};let h=i.exec(r);if(h){let f=h.index+h[0].length;return{shell:r.slice(0,f),streaming:!0,reader:t,dec:n,rest:r.slice(f)}}}}function bs(e){let t=/<template\s+data-webjs-resolve="([^"]+)"\s*>/i.exec(e);if(!t)return null;let n=t[1],r=t.index+t[0].length,s=/<(\/?)template\b[^>]*>/gi;s.lastIndex=r;let o=1,i;for(;i=s.exec(e);)if(i[1]==="/"){if(o--,o===0)return{id:n,content:e.slice(r,i.index),rest:e.slice(i.index+i[0].length)}}else o++;return null}function ys(e,t){let n=document.getElementById(e);if(!n)return;let r=document.createElement("template");r.innerHTML=t;let s=[...r.content.childNodes];n.replaceWith(r.content);for(let o of s)o.nodeType===1&&Cn(o)}async function gs(e,t,n,r){let s=n,o=()=>{let i;for(;i=bs(s);){if(!r())return!1;ys(i.id,i.content),s=i.rest}return!0};if(!e){o();return}try{for(;;){if(!o()){try{await e.cancel()}catch{}return}let{value:i,done:c}=await e.read();if(i&&(s+=t.decode(i,{stream:!0})),c){s+=t.decode(),o();return}}}catch{}}function gt(e){for(let t of e.querySelectorAll("script"))t.replaceWith(En(t))}function Fi(e){return A.get(J(e))||null}function Bi(){return G.size}function Ui(){A.clear(),G.clear(),oe.length=0,Ne.clear(),wt(),Sn()}function Di(){return g}function $i(){return++g}function qi(){return O}function Hi(e){O=e}function Vi(){ln.clear(),un=!1}function Wi(e){return _t.test(e)}var Or,D,k,g,an,O,ct,_t,zr,ln,un,Si,C,Ei,Xr,Qr,Ci,Ti,ki,A,G,oe,Ne,ie,je,U,re,Re,mt,bt,hn,ot=$(()=>{nn();it();it();xr();on();Or="text/vnd.webjs-stream.html";D=!1,k=null,g=0,an=null;O=null,ct=null;_t=/\.(?:pdf|zip|tar|gz|7z|rar|dmg|exe|msi|deb|rpm|apk|ipa|xlsx?|docx?|pptx?|csv|odt|ods|odp|rtf|epub|mobi|xml|json|rss|atom|txt|md|wasm|mp3|mp4|mov|avi|webm|ogg|flac|wav|m4a|m4v|mkv|png|jpe?g|gif|webp|avif|bmp|ico|svg|tiff?|heic)$/i;zr="_top";ln=new Set;un=!1;Si=16,C=new Map;Ei=8,Xr=3e4,Qr=3,Ci=24,Ti=100,ki=250,A=new Map,G=new Set,oe=[],Ne=new Set,ie=null,je=null,U=null,re=new WeakMap,Re=new Set;mt=new WeakMap;bt=new WeakMap;hn=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&mn()});function vs(e,...t){return{_$webjs:"template",strings:e,values:t}}function S(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var b="wjm-";function Es(e,...t){let n=e[0];for(let r=1;r<e.length;r++)n+=String(t[r-1]??"")+e[r];return{_$webjsCss:!0,text:n}}function Et(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function Ct(e,t){if(!(!t||!t.length))if("adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"){let n=t.map(r=>{let s=new CSSStyleSheet;return s.replaceSync(r.text),s});e.adoptedStyleSheets=n}else{let n=e,r=document.createElement("style");r.textContent=t.map(s=>s.text).join(`
2
2
  `),n.appendChild(r)}}function Cs(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
3
- `)}</style>`}var Tt=Object.freeze({"@":"event",".":"prop","?":"bool"});function Rn(e){return Object.prototype.hasOwnProperty.call(Tt,e)}function Ts(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ks(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var On=Symbol.for("webjs.repeat");function Ln(e,t,n){return{[On]:!0,items:[...e],keyFn:t,templateFn:n}}function Oe(e){return!!e&&typeof e=="object"&&e[On]===!0}function xs(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function kt(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Ns(e){return{_$webjs:"live",value:e}}function xt(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function js(e,t){return{_$webjs:"keyed",key:e,value:t}}function Le(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function Rs(e,t){return{_$webjs:"guard",deps:e,fn:t}}function Me(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Os(e){return{_$webjs:"template-content",template:e}}function Nt(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function Ls(e){return{_$webjs:"ref",target:e}}function Pe(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Ms(){return{value:void 0}}function Ps(e){return{_$webjs:"cache",value:e}}function Ie(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function Is(...e){return{_$webjs:"until",args:e}}function Fe(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function Fs(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function jt(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function Bs(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Rt(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Us(e){return{_$webjs:"watch",signal:e}}function Be(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var x=null,M=!1,Q=0,X=null,Ot=0,Mn=(e,t)=>Object.is(e,t),De=()=>{},Pn=()=>!1;function In(e,t){e.liveConsumers||(e.liveConsumers=new Set);let n=e.liveConsumers.size===0;if(e.liveConsumers.add(t),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)In(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function me(e,t){if(e.liveConsumers&&(e.liveConsumers.delete(t),e.liveConsumers.size===0)){if(e.producers&&e.producers.length>0)for(let n of e.producers)me(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function Bt(e){if(M)throw new Error("Signal read during notification phase");if(x===null)return;let t=x,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&Pt(t)&&me(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,Pt(t)&&In(e,t)),t.producerLastReadVersions[n]=e.version}function Pt(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Fn(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=M;M=!0;try{for(let n of e.liveConsumers)n.dirty||Ds(n)}finally{M=t}}function Ds(e){e.dirty=!0,Fn(e),e.consumerMarkedDirty.call(e.wrapper||e)}function $e(e){if(!(!e.dirty&&e.lastCleanEpoch===Q)){if(!e.producerMustRecompute()&&!$s(e)){e.dirty=!1,e.lastCleanEpoch=Q;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=Q}}function $s(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||($e(n),r!==n.version))return!0}return!1}function It(e){e&&(e.nextProducerIndex=0);let t=x;return x=e,t}function Ft(e,t){if(x=t,!!e){if(Pt(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)me(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var qe=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=Q,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=Pn,this.producerRecomputeValue=De,this.consumerMarkedDirty=De,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||Mn,this.watched=n?.[Ut],this.unwatched=n?.[Dt]}get(){return Bt(this),this.__value}peek(){return this.__value}set(t){if(M)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,Q++,X!==null?Bn(this):Fn(this))}};function Bn(e){let t=M;M=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?X.add(n):Bn(n))}finally{M=t}}var Lt=Symbol("unset"),Mt=Symbol("computing"),Ue=Symbol("errored"),be=class{constructor(t,n){this.__fn=t,this.__value=Lt,this.__error=null,this.version=0,this.lastCleanEpoch=-1,this.dirty=!0,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!1,this.wrapper=this,this.__isSignal=!0,this.__isComputed=!0,this.__equal=n?.equals||Mn,this.watched=n?.[Ut],this.unwatched=n?.[Dt];let r=this;this.producerMustRecompute=function(){return r.__value===Lt||r.__value===Mt},this.producerRecomputeValue=function(){if(r.__value===Mt)throw new Error("Detected cycle in computations.");let s=r.__value;r.__value=Mt;let o=It(r),i,c=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=Ue,r.__error=l,c=!0}finally{Ft(r,o)}if(!c&&(s!==Lt&&s!==Ue)&&r.__equal.call(r.wrapper,s,i)){r.__value=s;return}r.__value=i,r.version++},this.consumerMarkedDirty=De}get(){if($e(this),Bt(this),this.__value===Ue)throw this.__error;return this.__value}peek(){if($e(this),this.__value===Ue)throw this.__error;return this.__value}},He=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=Q,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=Pn,this.producerRecomputeValue=De,this.wrapper=this,this.__isWatcher=!0;let n=this;this.consumerMarkedDirty=function(){n.__fire()}}__fire(){this.__notify&&this.__notify.call(this)}watch(...t){if(t.length===0){this.dirty=!1;return}let n=It(this);try{for(let r of t)Bt(r),r.__isComputed&&$e(r)}finally{Ft(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(me(this.producers[n],this),this.producers.splice(n,1),this.producerLastReadVersions.splice(n,1),this.nextProducerIndex=Math.min(this.nextProducerIndex,this.producers.length))}getPending(){return this.producers.filter(t=>t.__isComputed&&t.dirty)}observe(t){let n=It(this),r;try{r=t()}finally{Ft(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)me(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},Ut=Symbol("watched"),Dt=Symbol("unwatched");function qs(e){let t=x;x=null;try{return e()}finally{x=t}}function Hs(e){return e.producers.slice()}function Vs(e){return e.liveConsumers?[...e.liveConsumers]:[]}function Ws(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function zs(e){return e.producers.length>0}function Ks(){return x&&x.__isComputed?x:null}function Gs(e){Ot++,X===null&&(X=new Set);try{e()}finally{if(Ot--,Ot===0){let t=X;X=null;for(let n of t)n.__fire()}}}var ye={State:qe,Computed:be,subtle:{Watcher:He,untrack:qs,introspectSources:Hs,introspectSinks:Vs,hasSinks:Ws,hasSources:zs,currentComputed:Ks,watched:Ut,unwatched:Dt}};function Ys(e,t){return new qe(e,t)}function Js(e,t){return new be(e,t)}function Xs(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function Qs(e){let t=!1,n=!1,r=new be(e),s=new He(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(o){console.error(o)}s.watch()}}))});s.watch(r);try{r.get()}catch(o){console.error(o)}return()=>{n||(n=!0,s.dispose())}}var Zs=`${b}s`,eo=`${b}e`;function Un(e){if(!e||e.nodeType!==8)return!1;let t=e.nodeValue;return t===Zs||t===eo}function to(e){for(let t of e.addedNodes)if(Un(t))return!0;for(let t of e.removedNodes)if(Un(t))return!0;return!1}function Vn(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}var _e=Vn(),q=Symbol("webjs.slot.state"),P="data-webjs-light",H="data-projection",we="actual",Wn="fallback",Ke=Symbol("webjs.slot.fallbackFrag"),no=64,ge=null,$t=null,Ve=null,Dn=!1;function ro(){Dn||(_e=Vn(),_e&&(ge=HTMLSlotElement.prototype.assignedNodes,$t=HTMLSlotElement.prototype.assignedElements,Ve=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(t){return this.hasAttribute(P)&&!$n(this)?qt(this,t):ge?ge.call(this,t):[]},HTMLSlotElement.prototype.assignedElements=function(t){return this.hasAttribute(P)&&!$n(this)?qt(this,t).filter(n=>n.nodeType===1):$t?$t.call(this,t):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let t=Ve&&Ve.get?Ve.get.call(this):null;return t||so(this)}}),Dn=!0))}ro();function $n(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.host)return!0;t=r}return!1}function qt(e,t){if(e.getAttribute(H)===Wn)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Ht(n,new Set,0)}function Ht(e,t,n){if(n>=no)return e.slice();let r=[];for(let s of e)if(s.nodeType===1&&s.tagName==="SLOT"){let o=s;if(t.has(o))continue;if(t.add(o),o.hasAttribute(P)){let i=qt(o,{flatten:!1});if(i.length>0)for(let c of Ht(i,t,n+1))r.push(c);else for(let c of Ht(Array.from(o.childNodes),t,n+1))r.push(c)}else if(ge){let i=ge.call(o,{flatten:!0});for(let c of i)r.push(c)}else r.push(s)}else r.push(s);return r}function so(e){let t=e.parentElement;for(;t;){if(t.tagName==="SLOT"&&t.hasAttribute(P))return t.getAttribute(H)===we?t:null;t=t.parentElement}return null}function I(e){let t=e,n=t[q];return n||(n={assignedByName:new Map,pendingByName:new Map,lastSnapshot:new WeakMap,nameObservers:new WeakMap,childObserver:null,scheduled:!1,ownedSlots:new Set},t[q]=n),n}function Vt(e){return!!e[q]}function zn(e){let t=I(e);for(;e.firstChild;){let n=e.firstChild,r=We(n);ze(t.assignedByName,r,n),e.removeChild(n)}}function Kn(e){let t=I(e),n=e.querySelectorAll(`slot[${P}]`);for(let r of n){let s=r;if(s.getAttribute(H)!==we)continue;let o=s.getAttribute("name")||null;if(!t.assignedByName.has(o)){let i=Array.from(s.childNodes);t.assignedByName.set(o,i),t.lastSnapshot.set(s,i.slice())}}}function We(e){if(e.nodeType!==1)return null;let n=e.getAttribute("slot");return n||null}function ze(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function Gn(e,t,n){if(!n.length)return;let r=e.get(t);r||(r=[],e.set(t,r));for(let s of n)r.push(s)}function Yn(e){if(!_e)return;let t=I(e);t.childObserver||(t.childObserver=new MutationObserver(n=>{let r=!1;for(let s of n)if(!to(s)){if(s.type==="childList"){for(let o of s.addedNodes)o.parentElement===e&&(ze(t.assignedByName,We(o),o),r=!0);for(let o of s.removedNodes)e.contains(o)||qn(t,o)&&(r=!0)}else if(s.type==="attributes"&&s.attributeName==="slot"){let o=s.target;(qn(t,o)||o.parentElement===e)&&(ze(t.assignedByName,We(o),o),r=!0)}}r&&Ge(e)}),t.childObserver.observe(e,{childList:!0,attributes:!0,attributeFilter:["slot"],subtree:!0}))}function Jn(e){let t=e[q];if(t){t.childObserver&&(t.childObserver.disconnect(),t.childObserver=null);for(let n of t.ownedSlots){let r=t.nameObservers.get(n);r&&(r.disconnect(),t.nameObservers.delete(n))}}}function qn(e,t){for(let[n,r]of e.assignedByName){let s=r.indexOf(t);if(s!==-1)return r.splice(s,1),r.length===0&&e.assignedByName.delete(n),!0}return!1}function Ge(e){let t=I(e);t.scheduled||(t.scheduled=!0,queueMicrotask(()=>{t.scheduled=!1,oo(e)}))}function oo(e){if(!_e)return;let t=e[q];if(!t)return;let n=Array.from(e.querySelectorAll(`slot[${P}]`)),r=new Set(n);for(let i of t.ownedSlots)r.has(i)||io(t,i);for(let i of r)t.ownedSlots.has(i)||lo(e,i);t.ownedSlots=r;let s=new Map;for(let i of n){let c=i.getAttribute("name")||null,a=s.get(c);a||(a=[],s.set(c,a)),a.push(i)}for(let i of s.keys()){let c=t.pendingByName.get(i);if(c&&c.length){let a=t.assignedByName.get(i)||[],l=[];for(let u of c)l.push(u);for(let u of a)l.indexOf(u)===-1&&l.push(u);t.assignedByName.set(i,l),t.pendingByName.delete(i)}}let o=[];for(let[i,c]of s){let a=t.assignedByName.get(i)||[];for(let l=0;l<c.length;l++){let u=c[l];l===0&&a.length>0?ao(t,u,a)&&o.push(u):co(t,u)&&o.push(u)}}for(let i of o)uo(i)}function io(e,t){let n=e.nameObservers.get(t);n&&(n.disconnect(),e.nameObservers.delete(t));let r=e.lastSnapshot.get(t);if(r&&r.length>0){let s=t.getAttribute("name")||null;Gn(e.pendingByName,s,r)}e.lastSnapshot.delete(t)}function ao(e,t,n){let r=t.getAttribute(H)!==we,s=e.lastSnapshot.get(t)||[];if(!r&&fo(s,n))return!1;let i=t[Ke];if(r&&i)for(;t.firstChild;)i.appendChild(t.firstChild);else for(;t.firstChild;)t.removeChild(t.firstChild);for(let c of n)t.appendChild(c);return t.setAttribute(H,we),e.lastSnapshot.set(t,n.slice()),!0}function co(e,t){let n=t.getAttribute(H)===we;if(t.setAttribute(H,Wn),!n)return Hn(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Hn(t),!0}function Hn(e){let t=e[Ke];!t||t.childNodes.length===0||e.appendChild(t)}function lo(e,t){if(!_e)return;let n=I(e);if(n.nameObservers.has(t))return;let r=new MutationObserver(()=>Ge(e));r.observe(t,{attributes:!0,attributeFilter:["name"]}),n.nameObservers.set(t,r)}function Xn(e,t){if(!Vt(e))return;let n=I(e),r=n.lastSnapshot.get(t);if(!r||r.length===0)return;let s=t.getAttribute("name")||null;for(let i of r)i.parentNode===t&&t.removeChild(i);Gn(n.pendingByName,s,r),n.lastSnapshot.delete(t);let o=n.nameObservers.get(t);o&&(o.disconnect(),n.nameObservers.delete(t)),n.ownedSlots.delete(t)}function uo(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function fo(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var Qn=new WeakMap,Wt=Symbol.for("webjs.instance");function te(e,t){let n=t,r=n[Wt];if(S(e)){let s=e;if(r&&r.strings===s.strings){Z(r,s.values);return}r&&Zn(r,t);let o=t.firstChild;o&&o.nodeType===8&&o.data==="webjs-hydrate"&&o.remove();let i=mo(s,t);n[Wt]=i;return}if(r&&Zn(r,t),n[Wt]=null,t.replaceChildren(),!(e==null||e===!1||e===!0)){if(Array.isArray(e)){for(let s of e){let o=document.createTextNode(String(s??""));t.appendChild(o)}return}t.appendChild(document.createTextNode(String(e)))}}function Je(e){let{strings:t}=e,n=Qn.get(t);if(n)return n;let r=[],s="",o="text",i="",c=0,a="",l=0,u=null,h="",f="";for(let m=0;m<t.length;m++){let de=t[m];for(let v=0;v<de.length;v++){let d=de[v];switch(o){case"text":s+=d,d==="<"&&(o="tag-open");break;case"tag-open":s+=d,d==="!"?o="bang-1":d==="/"?(o="tag-name",h=""):/[a-zA-Z]/.test(d)?(o="tag-name",h=d.toLowerCase()):o="text";break;case"bang-1":s+=d,o=d==="-"?"bang-dash":"tag-name";break;case"bang-dash":s+=d,d==="-"?(o="comment",l=0):o="tag-name";break;case"comment":s+=d,d==="-"?l+=1:(d===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":s+=d,d===">"?(o=h==="script"||h==="style"?"rawtext":"text",o==="rawtext"&&(f="")):/\s/.test(d)?o="in-tag":h+=d.toLowerCase();break;case"in-tag":s+=d,d===">"?(o=h==="script"||h==="style"?"rawtext":"text",o==="rawtext"&&(f="")):!/\s/.test(d)&&d!=="/"&&(o="attr-name",i=d,c=s.length-1);break;case"rawtext":s+=d,f=(f+d.toLowerCase()).slice(-9),(f.endsWith("<\/script>")||f.endsWith("</style>"))&&(o="text",f="",h="");break;case"attr-name":d==="="?(o="after-eq",s+=d):/\s/.test(d)?(o="in-tag",i="",s+=d):d===">"?(o="text",i="",s+=d):(i+=d,s+=d);break;case"after-eq":d==='"'||d==="'"?(o="attr-quoted",a=d,s+=d):/\s/.test(d)?(o="in-tag",i="",s+=d):d===">"?(o="text",i="",s+=d):(o="attr-unquoted",s+=d);break;case"attr-unquoted":/\s/.test(d)?(o="in-tag",i="",s+=d):(d===">"&&(o="text",i=""),s+=d);break;case"attr-quoted":s+=d,d===a&&(o="in-tag",i="");break;case"skip-attr":if(d===a){if(u){let T=u.firstPartIdx,w=[];for(let E=T;E<r.length;E++)(r[E].kind==="noop"||r[E].kind==="attr-mixed")&&w.push(E);let N=[],_=t[w[0]],he=_.lastIndexOf(a);N.push(he>=0?_.slice(he+1):_);for(let E=1;E<w.length;E++)N.push(t[w[E]]);let pe=t[w[w.length-1]+1],vt=pe.indexOf(a);N.push(vt>=0?pe.slice(0,vt):pe),r[T]={kind:"attr-mixed",path:[],name:u.name,statics:N,group:w},u=null}o="in-tag",i=""}break}}if(m<t.length-1){let v=r.length;if(o==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(o==="rawtext"){f="",r.push({kind:"noop",path:[]});continue}if(o==="text")s+=`<!--${b}${v}-->`,r.push({kind:"child",path:[]});else if(o==="in-tag"){let d=`data-${b}${v}`;s+=`${d}=""`,r.push({kind:"element",path:[]})}else if(o==="after-eq"){let d=i[0],T=i.slice(1);if(Rn(d)){s=s.slice(0,c);let w=Tt[d],N=`data-${b}${v}`;s+=`${N}=""`,r.push({kind:w,path:[],name:T})}else{s=s.slice(0,c);let w=`data-${b}${v}`;s+=`${w}=""`,r.push({kind:"attr",path:[],name:i})}o="in-tag",i=""}else if(o==="attr-quoted"||o==="attr-unquoted"){s=s.slice(0,c);let d=`data-${b}${v}`;s+=`${d}=""`,u={name:i,firstPartIdx:v},r.push({kind:"noop",path:[]}),o="skip-attr"}else o==="skip-attr"&&r.push({kind:"noop",path:[]})}}let p=document.createElement("template");return p.innerHTML=s,ho(p.content,r),po(p.content,r),n={templateEl:p,parts:r},Qn.set(t,n),n}function ho(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(P,"");let s=t.length;r.setAttribute(`data-${b}${s}`,""),t.push({kind:"slot",path:[]})}}function po(e,t){let n=[];function r(s){for(let o=0;o<s.childNodes.length;o++){let i=s.childNodes[o];if(n.push(o),i.nodeType===8){let c=i.data;if(c.startsWith(b)){let a=Number(c.slice(b.length));t[a]&&t[a].kind==="child"&&(t[a].path=n.slice())}}else if(i.nodeType===1){let c=i,a=[];for(let l of c.attributes)if(l.name.startsWith(`data-${b}`)){let u=Number(l.name.slice(`data-${b}`.length));t[u]&&t[u].kind!=="child"&&(t[u].path=n.slice()),a.push(l.name)}for(let l of a)c.removeAttribute(l);r(i)}n.pop()}}r(e)}function mo(e,t){let{templateEl:n,parts:r}=Je(e),s=n.content.cloneNode(!0),o=document.createComment(`${b}s`),i=document.createComment(`${b}e`),c=r.map(l=>Xe(l,s)),a=[];for(let l=0;l<e.values.length;l++)V(c[l],e.values[l],void 0,e.values),a.push(e.values[l]);t.replaceChildren(o,...s.childNodes,i);for(let l of c)l.kind==="slot"&&V(l,void 0,void 0,[]);return{strings:e.strings,bound:c,lastValues:a,startNode:o,endNode:i}}function Xe(e,t){if(e.kind==="noop")return{kind:"noop"};let n=t;for(let s of e.path)n=n.childNodes[s];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let s={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(o){s.handler?.(o)}};return r.addEventListener(s.name,s.dispatcher),s}if(e.kind==="attr")return{kind:"attr",el:r,name:e.name||""};if(e.kind==="attr-mixed")return{kind:"attr-mixed",el:r,name:e.name||"",statics:e.statics||[],group:e.group||[]};if(e.kind==="prop")return{kind:"prop",el:r,name:e.name||""};if(e.kind==="bool")return{kind:"bool",el:r,name:e.name||""};if(e.kind==="element")return{kind:"element",el:r};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}function Z(e,t){for(let n=0;n<t.length;n++){let r=t[n];Object.is(r,e.lastValues[n])||(V(e.bound[n],r,e.lastValues[n],t),e.lastValues[n]=r)}}function Zn(e,t){for(let n of e.bound){if(n.kind==="event"&&n.el.removeEventListener(n.name,n.dispatcher),n.kind==="element"){let r=n.lastTarget;if(r){if(typeof r=="function")try{r(void 0)}catch{}else typeof r=="object"&&(r.value=void 0);n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=zt(n.slotEl);r&&Xn(r,n.slotEl)}}t.replaceChildren()}function V(e,t,n,r){if(xt(t)){let s=t.value;if(e.kind==="prop"&&e.el[e.name]===s||e.kind==="attr"&&e.el.getAttribute(e.name)===String(s)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!s)return;t=s}switch(e.kind){case"child":go(e,t);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):e.el.setAttribute(e.name,String(t));break}case"prop":e.el[e.name]=t;break;case"bool":t?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":e.handler=typeof t=="function"?t:null;break;case"element":yo(e,t);break;case"attr-mixed":{let s=e,o=s.statics[0];for(let i=0;i<s.group.length;i++)o+=String((r?r[s.group[i]]:t)??""),o+=s.statics[i+1]||"";e.el.setAttribute(e.name,o);break}case"slot":{if(e.applied)break;let s=e.slotEl,o=()=>{e.applied=!0;let c=zt(s);if(!c||bo(s))return;let a=document.createDocumentFragment();for(;s.firstChild;)a.appendChild(s.firstChild);s[Ke]=a,Ge(c)};zt(s)?o():queueMicrotask(o);break}case"noop":break}}function zt(e){let t=e.parentElement;for(;t;){if(t[q])return t;t=t.parentElement}return null}function bo(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.host)return!0;t=r}return!1}function yo(e,t){let n=e,r=Pe(t)?t.target:void 0,s=n.__refTarget,o=r!==s;if(o&&s)if(typeof s=="function")try{s(void 0)}catch{}else typeof s=="object"&&(s.value=void 0);if(o||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!o&&n.__refElement!==void 0)try{r(void 0)}catch{}try{r(e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function go(e,t){return ko(e,t),j(e,t)}function j(e,t){let n=e.marker;if(kt(t)){F(e);let s=String(t.value??""),o=document.createElement("template");o.innerHTML=s;let i=[...o.content.childNodes],c=document.createDocumentFragment();for(let a of i)c.appendChild(a);n.parentNode?.insertBefore(c,n),e.child=i;return}if(Le(t)){let s=t,o=e.__keyedKey;o!==void 0&&!Object.is(o,s.key)&&F(e),e.__keyedKey=s.key,j(e,s.value);return}if(Me(t)){let s=t,o=e.__guardDeps,i=s.deps;if(o!==void 0&&(Array.isArray(o)&&Array.isArray(i)?To(o,i):Object.is(o,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,j(e,s.fn());return}if(Nt(t)){F(e);let s=t.template;if(s&&s.content){let o=s.content.cloneNode(!0),i=[...o.childNodes];n.parentNode?.insertBefore(o,n),e.child=i}return}if(Pe(t))return;if(Ie(t))return xo(e,t.value);if(Fe(t))return No(e,t.args);if(Be(t))return jo(e,t.signal);if(jt(t))return Ro(e,t);if(Rt(t))return Oo(e,t);if(Oe(t)){if(e.child&&e.child.kind==="repeat"){So(e,t);return}F(e);let s={kind:"repeat",map:new Map};e.child=s,wo(n,s,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){Eo(e,t);return}F(e);let s={kind:"array",items:[]};e.child=s,vo(n,s,t);return}if(e.child){let s=e.child;if(s.kind==="repeat")er(s),e.child=void 0;else if(s.kind==="array")nr(s),e.child=void 0;else if(s.kind==="async-stream")ir(s),e.child=void 0;else if("strings"in e.child){let o=e.child;if(S(t)&&o.strings===t.strings){Z(o,t.values);return}ee(o.startNode,o.endNode),e.child=void 0}else{for(let o of e.child)o.parentNode&&o.parentNode.removeChild(o);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(S(t)){let s=t,{templateEl:o,parts:i}=Je(s),c=o.content.cloneNode(!0),a=document.createComment(`${b}s`),l=document.createComment(`${b}e`),u=i.map(p=>Xe(p,c)),h=[];for(let p=0;p<s.values.length;p++)V(u[p],s.values[p],void 0,s.values),h.push(s.values[p]);let f=[a,...c.childNodes,l];n.parentNode?.insertBefore(_o(f),n);for(let p of u)p.kind==="slot"&&V(p,void 0,void 0,[]);e.child={strings:s.strings,bound:u,lastValues:h,startNode:a,endNode:l};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function _o(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function ee(e,t){if(!e.parentNode)return;let n=e;for(;n&&n!==t;){let r=n.nextSibling;n.parentNode?.removeChild(n),n=r}t.parentNode===e.parentNode&&t.parentNode?.removeChild(t)}function Gt(e){let{templateEl:t,parts:n}=Je(e),r=t.content.cloneNode(!0),s=document.createComment(`${b}s`),o=document.createComment(`${b}e`),i=n.map(l=>Xe(l,r)),c=[];for(let l=0;l<e.values.length;l++)V(i[l],e.values[l],void 0,e.values),c.push(e.values[l]);let a=document.createDocumentFragment();for(a.appendChild(s);r.firstChild;)a.appendChild(r.firstChild);return a.appendChild(o),{inst:{strings:e.strings,bound:i,lastValues:c,startNode:s,endNode:o},frag:a}}function Se(e){for(let t of e.bound)if(t.kind==="event"&&t.el.removeEventListener(t.name,t.dispatcher),t.kind==="element"){let n=t.lastTarget;if(n){if(typeof n=="function")try{n(void 0)}catch{}else typeof n=="object"&&(n.value=void 0);t.lastTarget=void 0,t.__lastEl=void 0}}}function wo(e,t,n){let{items:r,keyFn:s,templateFn:o}=n,i=e.parentNode;if(!i)return;let c=document.createDocumentFragment();for(let a=0;a<r.length;a++){let l=s(r[a],a),u=o(r[a],a);if(!S(u))continue;let{inst:h,frag:f}=Gt(u);t.map.set(l,h),c.appendChild(f)}i.insertBefore(c,e)}function So(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let s=e.child,{items:o,keyFn:i,templateFn:c}=t,a=new Map;for(let l=0;l<o.length;l++){let u=i(o[l],l),h=c(o[l],l);if(!S(h))continue;let f=s.map.get(u);if(f&&f.strings===h.strings)Z(f,h.values),Kt(f.startNode,f.endNode,r,n),a.set(u,f),s.map.delete(u);else{f&&(Se(f),ee(f.startNode,f.endNode),s.map.delete(u));let{inst:p,frag:m}=Gt(h);r.insertBefore(m,n),a.set(u,p)}}for(let l of s.map.values())Se(l),ee(l.startNode,l.endNode);s.map=a}function er(e){for(let t of e.map.values())Se(t),ee(t.startNode,t.endNode);e.map.clear()}function Ao(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function Ye(e){e.type==="tpl"?(Se(e.inst),ee(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function tr(e){if(S(e)){let{inst:t,frag:n}=Gt(e);return{item:{type:"tpl",inst:t},frag:n}}if(e!=null&&e!==!1&&e!==!0){let t=document.createTextNode(String(e));return{item:{type:"text",node:t},frag:t}}return{item:{type:"empty"},frag:null}}function vo(e,t,n){let r=e.parentNode;if(!r)return;let s=document.createDocumentFragment(),o=[];for(let i of n){let{item:c,frag:a}=tr(i);a&&s.appendChild(a),o.push(c)}r.insertBefore(s,e),t.items=o}function Eo(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let s=e.child,o=s.items,i=[];for(let c=0;c<t.length;c++){let a=t[c],l=o[c];if(S(a)){let f=a;if(l&&l.type==="tpl"&&l.inst.strings===f.strings){Z(l.inst,f.values),i.push(l);continue}}else if(a!=null&&a!==!1&&a!==!0){if(l&&l.type==="text"){let f=String(a);l.node.data!==f&&(l.node.data=f),i.push(l);continue}}else{l&&Ye(l),i.push({type:"empty"});continue}let{item:u,frag:h}=tr(a);h&&r.insertBefore(h,Co(o,c,n)),l&&Ye(l),i.push(u)}for(let c=t.length;c<o.length;c++)Ye(o[c]);s.items=i}function Co(e,t,n){for(let r=t;r<e.length;r++){let s=Ao(e[r]);if(s&&s.parentNode)return s}return n}function nr(e){for(let t of e.items)Ye(t);e.items=[]}function Kt(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let s=document.createDocumentFragment(),o=e;for(;o;){let i=o.nextSibling;if(s.appendChild(o),o===t)break;o=i}n.insertBefore(s,r)}function To(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function F(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&rr(t),!e.child)return;let n=e.child;if(n.kind==="repeat")er(n);else if(n.kind==="array")nr(n);else if(n.kind==="async-stream")ir(n);else if("strings"in n){let r=e.child;Se(r),ee(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function ko(e,t){let n=e;n.__untilState&&!Fe(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!Me(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!Ie(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!Le(t)&&(n.__keyedKey=void 0),n.__watchSub&&!Be(t)&&rr(n)}function xo(e,t){let n=e.marker,r=e,s=r.__cacheMap;s||(s=new Map,r.__cacheMap=s);let o=e.child;if(o&&"strings"in o){let c=o;if(S(t)&&c.strings===t.strings){Z(c,t.values);return}let a=document.createDocumentFragment();Kt(c.startNode,c.endNode,a,null),s.set(c.strings,{inst:c,holder:a}),e.child=void 0}if(S(t)){let c=t,a=s.get(c.strings);if(a){s.delete(c.strings),e.child&&F(e),Kt(a.inst.startNode,a.inst.endNode,n.parentNode,n),Z(a.inst,c.values),e.child=a.inst;return}}j(e,t)}function No(e,t){let n=e,r=n.__untilState,s=n.__untilArgs,o=(f,p)=>!!(Object.is(f,p)||S(f)&&S(p)&&f.strings===p.strings),c=s&&s.length===t.length&&s.every((f,p)=>o(f,t[p]))&&r?r.highestResolved:1/0;r&&(r.aborted=!0),n.__untilArgs=t.slice();let a={aborted:!1,highestResolved:c};n.__untilState=a;let l=-1,u;for(let f=0;f<t.length;f++){let p=t[f];if(!p||typeof p.then!="function"){l=f,u=p;break}}l!==-1&&l<=a.highestResolved?(j(e,u),a.highestResolved=l):l===-1&&!n.__untilEverRendered&&j(e,""),n.__untilEverRendered=!0;let h=Math.min(l===-1?t.length:l,a.highestResolved);for(let f=0;f<h;f++){let p=t[f];!p||typeof p.then!="function"||Promise.resolve(p).then(m=>{a.aborted||f>=a.highestResolved||(a.highestResolved=f,j(e,m))},()=>{})}}function jo(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let o;n.__watchSub.observe(()=>{o=t.get()}),j(e,o);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new ye.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let o;r.observe(()=>{o=t.get()}),j(e,o)})});n.__watchSub=r;let s;r.observe(()=>{s=t.get()}),j(e,s)}function rr(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Ro(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;F(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,sr(s,e,t)}function Oo(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;F(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,sr(s,e,t)}async function sr(e,t,n){let r=t.marker,s=0;try{for(;!e.aborted;){let o=await e.iterator.next();if(e.aborted||o.done)break;let i=n.mapper?n.mapper(o.value,s):o.value,c=or(i);if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let a=document.createDocumentFragment();for(let l of c)a.appendChild(l);r.parentNode?.insertBefore(a,r),e.nodes.push(...c),s++}}catch(o){typeof console<"u"&&console.error("[webjs] asyncStream error:",o)}}function or(e){if(e==null||e===!1||e===!0)return[];if(S(e)){let t=e,{templateEl:n,parts:r}=Je(t),s=n.content.cloneNode(!0),o=r.map(i=>Xe(i,s));for(let i=0;i<t.values.length;i++)V(o[i],t.values[i],void 0,t.values);return[...s.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...or(n));return t}return[document.createTextNode(String(e))]}function ir(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}var ar=null;function Qe(e){ar=e||null}function Lo(){return ar||void 0}var cr=Symbol.for("webjs:registry"),lr=Symbol.for("webjs:classToTag"),Ze=globalThis,R=Ze[cr]||(Ze[cr]=new Map),ur=Ze[lr]||(Ze[lr]=new WeakMap),et=typeof window<"u"&&typeof customElements<"u";function Yt(e,t){if(!e||typeof e!="string"||!e.includes("-"))throw new Error(`customElements.define: tag "${e}" must contain a hyphen (HTML spec)`);let n=t.lazy===!0,r=R.get(e);r?(r.cls=t,r.lazy=n):R.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),ur.set(t,e)}if(et){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),Yt(t,n)}}if(!et){let e=globalThis;e.customElements||(e.customElements={define(t,n){Yt(t,n)},get(t){return R.get(t)?.cls},upgrade(){},whenDefined(t){let n=R.get(t);return Promise.resolve(n?.cls)}})}function Jt(e,t){et?customElements.define(e,t):Yt(e,t)}function Mo(e,t){if(et)return;let n=R.get(e);if(n){n.moduleUrl=t;return}R.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Po(e){return R.get(e)?.cls}function Io(e){return R.get(e)?.moduleUrl||null}function Fo(e){return R.get(e)?.lazy===!0}function tt(e){return ur.get(e)}function Bo(){return[...R.keys()]}Ee();var yr=typeof window<"u"&&typeof HTMLElement<"u";function Xo(e,t){return e!==t}function Qo(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var nt=class{constructor(){this.__ssrAttrs=new Map,this.__internals=null}get attributes(){return[...this.__ssrAttrs].map(([t,n])=>({name:t,value:n}))}getAttribute(t){let n=this.__ssrAttrs.get(String(t).toLowerCase());return n===void 0?null:n}setAttribute(t,n){this.__ssrAttrs.set(String(t).toLowerCase(),String(n))}removeAttribute(t){this.__ssrAttrs.delete(String(t).toLowerCase())}hasAttribute(t){return this.__ssrAttrs.has(String(t).toLowerCase())}toggleAttribute(t,n){let r=String(t).toLowerCase(),s=this.__ssrAttrs.has(r);return(n===void 0?!s:n)?(this.__ssrAttrs.set(r,""),!0):(this.__ssrAttrs.delete(r),!1)}getAttributeNames(){return[...this.__ssrAttrs.keys()]}closest(t){let n=String(t).trim().toLowerCase();if(!/^[a-z][a-z0-9-]*$/.test(n))return null;if(this.__ssrTag===n)return this;let r=this.__ssrAncestors;if(!Array.isArray(r))return null;for(let s=r.length-1;s>=0;s--)if(r[s]&&r[s].__ssrTag===n)return r[s];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,s=>"-"+s.toLowerCase());return this.__dataset=new Proxy({},{get(r,s){if(typeof s!="string")return;let o=t.getAttribute(n(s));return o===null?void 0:o},set(r,s,o){return typeof s=="string"&&t.setAttribute(n(s),o),!0},has(r,s){return typeof s=="string"&&t.hasAttribute(n(s))},deleteProperty(r,s){return typeof s=="string"&&t.removeAttribute(n(s)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(s,o)=>o.toUpperCase()))},getOwnPropertyDescriptor(r,s){if(typeof s=="string"&&t.hasAttribute(n(s)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(s))}}}),this.__dataset}get className(){return this.getAttribute("class")??""}set className(t){this.setAttribute("class",t)}get hidden(){return this.hasAttribute("hidden")}set hidden(t){this.toggleAttribute("hidden",!!t)}get id(){return this.getAttribute("id")??""}set id(t){this.setAttribute("id",t)}get title(){return this.getAttribute("title")??""}set title(t){this.setAttribute("title",t)}get slot(){return this.getAttribute("slot")??""}set slot(t){this.setAttribute("slot",t)}get role(){return this.getAttribute("role")}set role(t){t==null?this.removeAttribute("role"):this.setAttribute("role",t)}get tabIndex(){let t=this.getAttribute("tabindex");return t===null?-1:Number.parseInt(t,10)||0}set tabIndex(t){this.setAttribute("tabindex",String(t))}addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return this.__internals=Qo(),this.__internals}},Zo=["ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDescription","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"];for(let e of Zo){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(nt.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var ei=yr?HTMLElement:nt,gr=Symbol("webjs.factoryProps"),mr=new WeakSet,ne=class e extends ei{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){Jt(t,this)}static get observedAttributes(){let t=this.properties||{};return Object.keys(t).filter(n=>!(typeof t[n]=="object"&&t[n].state)).map(n=>typeof t[n]=="object"&&t[n].attribute||Qt(n))}constructor(){super(),this._renderRoot=null,this._scheduled=!1,this._connected=!1,this.__controllers=new Set,this.__firstRendered=!1,this._changedProperties=new Map,this._updateResolve=null,this._updatePromise=Promise.resolve(!0),this._isUpdating=!1,this._assertFactoryProperties(),this._initializeProperties()}_assertFactoryProperties(){let t=this.constructor;if(mr.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,gr)){let r=n.name||"a component";throw new Error(`${r}: \`static properties\` is no longer supported. Declare reactive properties via the factory instead: \`class ${r} extends WebComponent({ count: Number })\`. Use the \`prop()\` helper for options (\`prop(Number, { reflect: true })\`) and set defaults in the constructor after \`super()\`. See https://docs.webjs.com/docs/components.`)}n=Object.getPrototypeOf(n)}mr.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,s]of Object.entries(n)){let o=typeof s=="object"?s:{type:s},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:c=>{let a=this.__propValues[r];(o.hasChanged||Xo)(c,a)&&(this.__propValues[r]=c,o.reflect&&!o.state&&this._connected&&this._reflectAttribute(r,c,o),this.requestUpdate(r,a))}}),i!==void 0?this.__propValues[r]=i:o.default!==void 0&&(this.__propValues[r]=typeof o.default=="function"?o.default():o.default)}}}_reflectAttribute(t,n,r){let s=r.attribute||Qt(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let o=r.converter.toAttribute(n,r.type);o==null?this.removeAttribute(s):this.setAttribute(s,o)}else r.type===Boolean?n?this.setAttribute(s,""):this.removeAttribute(s):n==null?this.removeAttribute(s):r.type===Object||r.type===Array?this.setAttribute(s,JSON.stringify(n)):this.setAttribute(s,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!yr)return;if(this.__webjsPropsHydrated||(this.__webjsPropsHydrated=!0,this._hydratePropAttrs()),this.constructor.hydrate==="visible"&&typeof IntersectionObserver<"u"&&!this.__hydrationActivated){this.__hydrationActivated=!1,this.__hydrationObserver=new IntersectionObserver(n=>{for(let r of n)if(r.isIntersecting){this.__hydrationObserver.unobserve(this),this.__hydrationObserver.disconnect(),this.__hydrationObserver=null,this.__hydrationActivated=!0,this._activate();return}},{rootMargin:"200px"}),this.__hydrationObserver.observe(this);return}this._activate()}_hydratePropAttrs(){let t=[],n=this.attributes;for(let r=0;r<n.length;r++){let s=n[r].name;s.startsWith("data-webjs-prop-")&&t.push(s)}for(let r of t){let s=this.getAttribute(r);if(this.removeAttribute(r),s==null)continue;let o=br(r.slice(16));try{this[o]=z(s)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,s=Array.isArray(r)?r:Et(r)?[r]:[];if(s.length){if(n){let o=this.shadowRoot.querySelector("style");o&&o.remove()}Ct(this._renderRoot,s)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${tt(t)||this.tagName?.toLowerCase()}> has static shadow = false AND static styles. static styles only works with shadow DOM (adoptedStyleSheets). For light DOM, use global CSS or <style> in render().`),Vt(this)||(this.__isHydrating()?(I(this),Kn(this)):zn(this));for(let n of this.__controllers)n.hostConnected&&n.hostConnected();this._updateResolve===null&&(this._updatePromise=new Promise(n=>{this._updateResolve=n})),this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(n){console.error("[webjs] lifecycle hook threw during initial render:",n)}this._renderRoot===this&&Yn(this)})}__isHydrating(){let t=this.firstChild,n=t!=null&&t.nodeType===8&&t.data==="webjs-hydrate";return n&&(this.__hydratedAtActivate=!0),n}disconnectedCallback(){this._connected=!1,this.__hydrationObserver&&(this.__hydrationObserver.disconnect(),this.__hydrationObserver=null),this._renderRoot===this&&Jn(this),this.__signalWatcher&&(this.__signalWatcher.dispose(),this.__signalWatcher=void 0);for(let t of this.__controllers)t.hostDisconnected&&t.hostDisconnected()}attributeChangedCallback(t,n,r){if(this.__reflectingAttribute)return;let o=this.constructor.properties||{},i,c;for(let[u,h]of Object.entries(o))if(((typeof h=="object"?h:{type:h}).attribute||Qt(u))===t){i=u,c=h;break}if(c===void 0&&(i=br(t),c=o[i]||o[t]),c===void 0)return;let a=typeof c=="object"?c:{type:c},l;if(a.converter&&a.converter.fromAttribute)l=a.converter.fromAttribute(r,a.type);else if(a.type===Number)l=r==null?null:Number(r);else if(a.type===Boolean)l=r!=null&&r!=="false";else if(a.type===Object||a.type===Array)try{l=r==null?null:JSON.parse(r)}catch{l=r}else l=r;this[i]!==l&&(this[i]=l,this._connected&&this.requestUpdate())}requestUpdate(t,n){t!==void 0&&!this._changedProperties.has(t)&&this._changedProperties.set(t,n),this._scheduleUpdate()}_scheduleUpdate(){this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),!this._isUpdating&&(this._scheduled||!this._connected||(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(t){console.error("[webjs] lifecycle hook threw during update cycle:",t)}})))}_performRender(){if(!this._renderRoot)return;let t=this._changedProperties;this._isUpdating=!0;let n=!1,r=null;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let s of this.__controllers)s.hostUpdate&&s.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,Qe(this.__renderAbort?this.__renderAbort.signal:null);try{let s=this.update(t);s&&typeof s.then=="function"&&(r=s)}catch(s){this._handleRenderError(s)}finally{Qe(null)}if(!r){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();n=!0}}}catch(s){console.error("[webjs] lifecycle hook threw during update phase:",s)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let s=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1,r.then(()=>{if(this.__pendingAsyncCommits--,s===this.__renderToken){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();this._postCommit(t)}});return}n?this._postCommit(t):this.__pendingAsyncCommits||this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers)n.hostUpdate&&n.hostUpdate();this._reflectDeclaredAttributes()}finally{this._isUpdating=!1}}_reflectDeclaredAttributes(){let t=this.constructor.properties||{};for(let n of Object.keys(t)){let r=t[n];!r||!r.reflect||r.state||this._reflectAttribute(n,this[n],r)}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new ye.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);te(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&te(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{n===this.__renderToken&&te(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==rt.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${tt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&te(n,this._renderRoot)}catch(n){console.error("[webjs] renderError() also threw:",n)}}_postCommit(t){try{this.__firstRendered||(this.__firstRendered=!0,this.firstUpdated(t)),this.updated(t)}catch(n){console.error("[webjs] lifecycle hook threw during post-commit phase:",n)}finally{this._resolveUpdate()}}updated(t){}firstUpdated(t){}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}addController(t){this.__controllers.add(t),this._connected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers.delete(t)}render(){return""}renderError(t){}renderFallback(){}};function Qt(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function br(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function rt(e){return new.target?Reflect.construct(ne,arguments,new.target):class extends ne{static properties=e;static[gr]=!0}}Object.setPrototypeOf(rt,ne);rt.prototype=ne.prototype;function ti(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var _r=Symbol.for("webjs.notFound"),wr=Symbol.for("webjs.redirect");function ni(){let e=new Error("webjs: notFound()");throw e.__webjs=_r,e}function ri(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=wr,r.url=e,r.status=typeof n=="number"?n:void 0,r}function si(e){return!!e&&e.__webjs===_r}function oi(e){return!!e&&e.__webjs===wr}var Sr=null;function ii(){if(!Sr)return"";try{return Sr()||""}catch{return""}}var za=Symbol.for("webjs.suspense");function ai(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function ci(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function li(e,t={}){let n=t.reconnect!==!1,r=0,s=!1,o=null,i=[];function c(){s||(o=new WebSocket(ui(e),t.protocols),o.onopen=a=>{for(r=0;i.length&&o&&o.readyState===WebSocket.OPEN;)o.send(i.shift());t.onOpen?.(a)},o.onmessage=a=>{let l=a.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,a)},o.onerror=a=>{t.onError?.(a)},o.onclose=a=>{if(t.onClose?.(a),!s&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(c,l)}})}return c(),{send(a){let l=typeof a=="string"||a instanceof ArrayBuffer||ArrayBuffer.isView(a)?a:JSON.stringify(a);o&&o.readyState===WebSocket.OPEN?o.send(l):i.push(l)},close(a,l){s=!0;try{o?.close(a,l)}catch{}},get socket(){return o},get readyState(){return o?.readyState??3}}}function ui(e){if(/^wss?:\/\//i.test(e))return e;let t=typeof location<"u"&&location.protocol==="https:"?"wss:":"ws:",n=typeof location<"u"?location.host:"";return`${t}//${n}${e.startsWith("/")?e:"/"+e}`}Ee();var Zt="application/vnd.webjs+json";async function fi(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",Zt);let r=t.body;r!=null&&typeof r=="object"&&!(r instanceof FormData)&&!(r instanceof Blob)&&!(r instanceof ArrayBuffer)&&!(r instanceof URLSearchParams)&&!(typeof ReadableStream<"u"&&r instanceof ReadableStream)&&!ArrayBuffer.isView(r)&&(r=await Xt(r),n.has("content-type")||n.set("content-type",Zt));let s=await fetch(e,{...t,headers:n,body:r}),o=s.headers.get("content-type")||"",i=await s.text(),c=o.includes(Zt)?i?z(i):null:o.includes("application/json")?i?JSON.parse(i):null:i;if(!s.ok){let a=c&&c.error||`richFetch ${e} -> ${s.status}`,l=new Error(a);throw l.status=s.status,l.body=c,l}return c}Ee();ot();ot();nn();it();var Tn=class{constructor(t,n){this.host=t,this.options=n,this.updates=[],this._nextId=0}get value(){let t=this.options.source();if(!this.options.update)return this.updates.length>0?this.updates[this.updates.length-1].payload:t;for(let n of this.updates)t=this.options.update(t,n.payload);return t}add(t,n){let r=`opt-${++this._nextId}`;this.updates.push({id:r,payload:t}),this.host?.requestUpdate?.();let s=()=>{let o=this.updates.findIndex(i=>i.id===r);o!==-1&&(this.updates.splice(o,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>s()).catch(()=>{}):n.then(()=>s(),()=>s())),s}};async function zi(e,t,n){let r=e.get();e.set(t);let s;try{s=await n()}catch(o){throw e.set(r),o}return s&&s.success===!1&&e.set(r),s}function Ki(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?zi(e,t,n):new Tn(e,t)}on();var St=0,_s=new Map,fe=new Map,Gi=1e3;function Yi(e){if(!(!Array.isArray(e)||!e.length)){St+=1;for(let t of e)t&&_s.set(t,St)}}function Ji(){return St}function Xi(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(fe.delete(e),fe.set(e,{tags:t.slice(),since:typeof n=="number"?n:St}),fe.size>Gi)){let r=fe.keys().next().value;r!==void 0&&fe.delete(r)}}function Qi(e){let t=fe.get(e);if(!t)return!1;for(let n of t.tags)if((_s.get(n)||0)>t.since)return!0;return!1}function Zi(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var ea="application/vnd.webjs+stream",ta=1,na=2,ra=3,ws=new Uint8Array(0);function sa(e,t){let n=t||ws,r=n.length,s=new Uint8Array(5+r);return s[0]=e&255,s[1]=r>>>24&255,s[2]=r>>>16&255,s[3]=r>>>8&255,s[4]=r&255,r&&s.set(n,5),s}function oa(){let e=ws;return{push(t){if(t&&t.length){let r=new Uint8Array(e.length+t.length);r.set(e,0),r.set(t,e.length),e=r}let n=[];for(;e.length>=5;){let r=e[0],s=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+s)break;let o=e.slice(5,5+s);n.push({type:r,payload:o}),e=e.slice(5+s)}return n}}}var ia=Symbol.for("webjs.context");function aa(e){return{__context__:ia,name:e}}var At=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},kn=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=s=>{let o=s;if(o.context===this._context)if(s.stopPropagation(),o.subscribe){let i={callback:o.callback},c=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),o.callback(this._value,c)}else o.callback(this._value)},typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}setValue(t){if(!Object.is(this._value,t)){this._value=t;for(let n of this._subscriptions){let r=()=>{this._subscriptions.delete(n)};n.callback(t,r)}}}hostConnected(){this._host.addEventListener("context-request",this._onRequest)}hostDisconnected(){this._host.removeEventListener("context-request",this._onRequest),this._subscriptions.clear()}},xn=class{constructor(t,{context:n,subscribe:r=!0}){this._host=t,this._context=n,this._subscribe=r,this._value=void 0,this._unsubscribe=void 0,typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}hostConnected(){this._dispatchRequest()}hostDisconnected(){this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=void 0)}_dispatchRequest(){let t=new At(this._context,(n,r)=>{let s=this._value;this._value=n,r&&(this._unsubscribe=r),!Object.is(s,n)&&typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()},this._subscribe);this._host.dispatchEvent(t)}};function ca(){return typeof window<"u"}var L={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},Nn=class{constructor(t,{task:n,args:r,autoRun:s=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=s,this._status=L.INITIAL,this._value=void 0,this._error=void 0,this._abortController=null,this._prevArgs=null,typeof t.addController=="function"&&t.addController(this)}get status(){return this._status}get value(){return this._value}get error(){return this._error}async run(){this.abort();let t=new AbortController;this._abortController=t;let n=this._argsFn();this._prevArgs=n,this._status=L.PENDING,this._error=void 0,this._requestHostUpdate();try{let r=await this._taskFn(...n,{signal:t.signal});if(t.signal.aborted)return;this._value=r,this._status=L.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=L.ERROR,this._value=void 0}finally{this._abortController===t&&(this._abortController=null)}this._requestHostUpdate()}abort(){this._abortController&&(this._abortController.abort(),this._abortController=null)}render(t={}){switch(this._status){case L.INITIAL:return t.initial?.();case L.PENDING:return t.pending?.();case L.COMPLETE:return t.complete?.(this._value);case L.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!ca())return;let t=this._argsFn();this._argsEqual(this._prevArgs,t)||this.run()}hostUpdated(){}hostConnected(){}hostDisconnected(){this.abort()}_requestHostUpdate(){typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()}_argsEqual(t,n){if(t===null||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}};export{xn as ContextConsumer,kn as ContextProvider,At as ContextRequestEvent,ta as FRAME_CHUNK,na as FRAME_END,ra as FRAME_ERROR,b as MARKER,Rr as SEED_MISS,ea as STREAM_CONTENT_TYPE,ye as Signal,ai as Suspense,Nn as Task,L as TaskStatus,rt as WebComponent,tn as WebjsFrame,rn as WebjsStream,Lo as activeActionSignal,Ct as adoptStyles,Bo as allTags,Fs as asyncAppend,Bs as asyncReplace,Gs as batch,Ps as cache,Js as computed,li as connectWS,Qi as consumeStale,aa as createContext,oa as createFrameDecoder,Ms as createRef,ii as cspNonce,Es as css,hr as deserialize,Fr as disableClientRouter,Qs as effect,mn as enableClientRouter,sa as encodeFrame,ks as escapeAttr,Ts as escapeText,Ji as fetchMark,Rs as guard,vs as html,jt as isAsyncAppend,Rt as isAsyncReplace,Et as isCSS,Ie as isCache,Me as isGuard,Le as isKeyed,Fo as isLazy,xt as isLive,si as isNotFound,oi as isRedirect,Pe as isRef,Oe as isRepeat,Xs as isSignal,ci as isSuspense,S as isTemplate,Nt as isTemplateContent,kt as isUnsafeHTML,Fe as isUntil,Be as isWatch,js as keyed,Ns as live,Po as lookup,Io as lookupModuleUrl,Yi as markStale,Br as navigate,ni as notFound,Ki as optimistic,z as parse,Zi as parseTagHeader,Mo as primeModuleUrl,ti as prop,ri as redirect,Ls as ref,Jt as register,Xi as registerKeyTags,te as render,sn as renderStream,Ln as repeat,Ur as revalidate,fi as richFetch,at as scanSeeds,dr as serialize,Qe as setActiveActionSignal,Ys as signal,Xt as stringify,Cs as stylesToString,tt as tagOf,gi as takeSeed,Os as templateContent,xs as unsafeHTML,Is as until,Us as watch};
3
+ `)}</style>`}var Tt=Object.freeze({"@":"event",".":"prop","?":"bool"});function Rn(e){return Object.prototype.hasOwnProperty.call(Tt,e)}function Ts(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ks(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var On=Symbol.for("webjs.repeat");function Ln(e,t,n){return{[On]:!0,items:[...e],keyFn:t,templateFn:n}}function Oe(e){return!!e&&typeof e=="object"&&e[On]===!0}function xs(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function kt(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Ns(e){return{_$webjs:"live",value:e}}function xt(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function js(e,t){return{_$webjs:"keyed",key:e,value:t}}function Le(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function Rs(e,t){return{_$webjs:"guard",deps:e,fn:t}}function Me(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Os(e){return{_$webjs:"template-content",template:e}}function Nt(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function Ls(e){return{_$webjs:"ref",target:e}}function Pe(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Ms(){return{value:void 0}}function Ps(e){return{_$webjs:"cache",value:e}}function Ie(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function Is(...e){return{_$webjs:"until",args:e}}function Fe(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function Fs(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function jt(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function Bs(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Rt(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Us(e){return{_$webjs:"watch",signal:e}}function Be(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var x=null,M=!1,Q=0,X=null,Ot=0,Mn=(e,t)=>Object.is(e,t),De=()=>{},Pn=()=>!1;function In(e,t){e.liveConsumers||(e.liveConsumers=new Set);let n=e.liveConsumers.size===0;if(e.liveConsumers.add(t),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)In(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function me(e,t){if(e.liveConsumers&&(e.liveConsumers.delete(t),e.liveConsumers.size===0)){if(e.producers&&e.producers.length>0)for(let n of e.producers)me(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function Bt(e){if(M)throw new Error("Signal read during notification phase");if(x===null)return;let t=x,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&Pt(t)&&me(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,Pt(t)&&In(e,t)),t.producerLastReadVersions[n]=e.version}function Pt(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Fn(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=M;M=!0;try{for(let n of e.liveConsumers)n.dirty||Ds(n)}finally{M=t}}function Ds(e){e.dirty=!0,Fn(e),e.consumerMarkedDirty.call(e.wrapper||e)}function $e(e){if(!(!e.dirty&&e.lastCleanEpoch===Q)){if(!e.producerMustRecompute()&&!$s(e)){e.dirty=!1,e.lastCleanEpoch=Q;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=Q}}function $s(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||($e(n),r!==n.version))return!0}return!1}function It(e){e&&(e.nextProducerIndex=0);let t=x;return x=e,t}function Ft(e,t){if(x=t,!!e){if(Pt(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)me(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var qe=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=Q,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=Pn,this.producerRecomputeValue=De,this.consumerMarkedDirty=De,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||Mn,this.watched=n?.[Ut],this.unwatched=n?.[Dt]}get(){return Bt(this),this.__value}peek(){return this.__value}set(t){if(M)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,Q++,X!==null?Bn(this):Fn(this))}};function Bn(e){let t=M;M=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?X.add(n):Bn(n))}finally{M=t}}var Lt=Symbol("unset"),Mt=Symbol("computing"),Ue=Symbol("errored"),be=class{constructor(t,n){this.__fn=t,this.__value=Lt,this.__error=null,this.version=0,this.lastCleanEpoch=-1,this.dirty=!0,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!1,this.wrapper=this,this.__isSignal=!0,this.__isComputed=!0,this.__equal=n?.equals||Mn,this.watched=n?.[Ut],this.unwatched=n?.[Dt];let r=this;this.producerMustRecompute=function(){return r.__value===Lt||r.__value===Mt},this.producerRecomputeValue=function(){if(r.__value===Mt)throw new Error("Detected cycle in computations.");let s=r.__value;r.__value=Mt;let o=It(r),i,c=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=Ue,r.__error=l,c=!0}finally{Ft(r,o)}if(!c&&(s!==Lt&&s!==Ue)&&r.__equal.call(r.wrapper,s,i)){r.__value=s;return}r.__value=i,r.version++},this.consumerMarkedDirty=De}get(){if($e(this),Bt(this),this.__value===Ue)throw this.__error;return this.__value}peek(){if($e(this),this.__value===Ue)throw this.__error;return this.__value}},He=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=Q,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=Pn,this.producerRecomputeValue=De,this.wrapper=this,this.__isWatcher=!0;let n=this;this.consumerMarkedDirty=function(){n.__fire()}}__fire(){this.__notify&&this.__notify.call(this)}watch(...t){if(t.length===0){this.dirty=!1;return}let n=It(this);try{for(let r of t)Bt(r),r.__isComputed&&$e(r)}finally{Ft(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(me(this.producers[n],this),this.producers.splice(n,1),this.producerLastReadVersions.splice(n,1),this.nextProducerIndex=Math.min(this.nextProducerIndex,this.producers.length))}getPending(){return this.producers.filter(t=>t.__isComputed&&t.dirty)}observe(t){let n=It(this),r;try{r=t()}finally{Ft(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)me(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},Ut=Symbol("watched"),Dt=Symbol("unwatched");function qs(e){let t=x;x=null;try{return e()}finally{x=t}}function Hs(e){return e.producers.slice()}function Vs(e){return e.liveConsumers?[...e.liveConsumers]:[]}function Ws(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function zs(e){return e.producers.length>0}function Ks(){return x&&x.__isComputed?x:null}function Gs(e){Ot++,X===null&&(X=new Set);try{e()}finally{if(Ot--,Ot===0){let t=X;X=null;for(let n of t)n.__fire()}}}var ye={State:qe,Computed:be,subtle:{Watcher:He,untrack:qs,introspectSources:Hs,introspectSinks:Vs,hasSinks:Ws,hasSources:zs,currentComputed:Ks,watched:Ut,unwatched:Dt}};function Ys(e,t){return new qe(e,t)}function Js(e,t){return new be(e,t)}function Xs(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function Qs(e){let t=!1,n=!1,r=new be(e),s=new He(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(o){console.error(o)}s.watch()}}))});s.watch(r);try{r.get()}catch(o){console.error(o)}return()=>{n||(n=!0,s.dispose())}}var Zs=`${b}s`,eo=`${b}e`;function Un(e){if(!e||e.nodeType!==8)return!1;let t=e.nodeValue;return t===Zs||t===eo}function to(e){for(let t of e.addedNodes)if(Un(t))return!0;for(let t of e.removedNodes)if(Un(t))return!0;return!1}function Vn(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}var _e=Vn(),q=Symbol("webjs.slot.state"),P="data-webjs-light",H="data-projection",we="actual",Wn="fallback",Ke=Symbol("webjs.slot.fallbackFrag"),no=64,ge=null,$t=null,Ve=null,Dn=!1;function ro(){Dn||(_e=Vn(),_e&&(ge=HTMLSlotElement.prototype.assignedNodes,$t=HTMLSlotElement.prototype.assignedElements,Ve=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(t){return this.hasAttribute(P)&&!$n(this)?qt(this,t):ge?ge.call(this,t):[]},HTMLSlotElement.prototype.assignedElements=function(t){return this.hasAttribute(P)&&!$n(this)?qt(this,t).filter(n=>n.nodeType===1):$t?$t.call(this,t):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let t=Ve&&Ve.get?Ve.get.call(this):null;return t||so(this)}}),Dn=!0))}ro();function $n(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.host)return!0;t=r}return!1}function qt(e,t){if(e.getAttribute(H)===Wn)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Ht(n,new Set,0)}function Ht(e,t,n){if(n>=no)return e.slice();let r=[];for(let s of e)if(s.nodeType===1&&s.tagName==="SLOT"){let o=s;if(t.has(o))continue;if(t.add(o),o.hasAttribute(P)){let i=qt(o,{flatten:!1});if(i.length>0)for(let c of Ht(i,t,n+1))r.push(c);else for(let c of Ht(Array.from(o.childNodes),t,n+1))r.push(c)}else if(ge){let i=ge.call(o,{flatten:!0});for(let c of i)r.push(c)}else r.push(s)}else r.push(s);return r}function so(e){let t=e.parentElement;for(;t;){if(t.tagName==="SLOT"&&t.hasAttribute(P))return t.getAttribute(H)===we?t:null;t=t.parentElement}return null}function I(e){let t=e,n=t[q];return n||(n={assignedByName:new Map,pendingByName:new Map,lastSnapshot:new WeakMap,nameObservers:new WeakMap,childObserver:null,scheduled:!1,ownedSlots:new Set},t[q]=n),n}function Vt(e){return!!e[q]}function zn(e){let t=I(e);for(;e.firstChild;){let n=e.firstChild,r=We(n);ze(t.assignedByName,r,n),e.removeChild(n)}}function Kn(e){let t=I(e),n=e.querySelectorAll(`slot[${P}]`);for(let r of n){let s=r;if(s.getAttribute(H)!==we)continue;let o=s.getAttribute("name")||null;if(!t.assignedByName.has(o)){let i=Array.from(s.childNodes);t.assignedByName.set(o,i),t.lastSnapshot.set(s,i.slice())}}}function We(e){if(e.nodeType!==1)return null;let n=e.getAttribute("slot");return n||null}function ze(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function Gn(e,t,n){if(!n.length)return;let r=e.get(t);r||(r=[],e.set(t,r));for(let s of n)r.push(s)}function Yn(e){if(!_e)return;let t=I(e);t.childObserver||(t.childObserver=new MutationObserver(n=>{let r=!1;for(let s of n)if(!to(s)){if(s.type==="childList"){for(let o of s.addedNodes)o.parentElement===e&&(ze(t.assignedByName,We(o),o),r=!0);for(let o of s.removedNodes)e.contains(o)||qn(t,o)&&(r=!0)}else if(s.type==="attributes"&&s.attributeName==="slot"){let o=s.target;(qn(t,o)||o.parentElement===e)&&(ze(t.assignedByName,We(o),o),r=!0)}}r&&Ge(e)}),t.childObserver.observe(e,{childList:!0,attributes:!0,attributeFilter:["slot"],subtree:!0}))}function Jn(e){let t=e[q];if(t){t.childObserver&&(t.childObserver.disconnect(),t.childObserver=null);for(let n of t.ownedSlots){let r=t.nameObservers.get(n);r&&(r.disconnect(),t.nameObservers.delete(n))}}}function qn(e,t){for(let[n,r]of e.assignedByName){let s=r.indexOf(t);if(s!==-1)return r.splice(s,1),r.length===0&&e.assignedByName.delete(n),!0}return!1}function Ge(e){let t=I(e);t.scheduled||(t.scheduled=!0,queueMicrotask(()=>{t.scheduled=!1,oo(e)}))}function oo(e){if(!_e)return;let t=e[q];if(!t)return;let n=Array.from(e.querySelectorAll(`slot[${P}]`)),r=new Set(n);for(let i of t.ownedSlots)r.has(i)||io(t,i);for(let i of r)t.ownedSlots.has(i)||lo(e,i);t.ownedSlots=r;let s=new Map;for(let i of n){let c=i.getAttribute("name")||null,a=s.get(c);a||(a=[],s.set(c,a)),a.push(i)}for(let i of s.keys()){let c=t.pendingByName.get(i);if(c&&c.length){let a=t.assignedByName.get(i)||[],l=[];for(let u of c)l.push(u);for(let u of a)l.indexOf(u)===-1&&l.push(u);t.assignedByName.set(i,l),t.pendingByName.delete(i)}}let o=[];for(let[i,c]of s){let a=t.assignedByName.get(i)||[];for(let l=0;l<c.length;l++){let u=c[l];l===0&&a.length>0?ao(t,u,a)&&o.push(u):co(t,u)&&o.push(u)}}for(let i of o)uo(i)}function io(e,t){let n=e.nameObservers.get(t);n&&(n.disconnect(),e.nameObservers.delete(t));let r=e.lastSnapshot.get(t);if(r&&r.length>0){let s=t.getAttribute("name")||null;Gn(e.pendingByName,s,r)}e.lastSnapshot.delete(t)}function ao(e,t,n){let r=t.getAttribute(H)!==we,s=e.lastSnapshot.get(t)||[];if(!r&&fo(s,n))return!1;let i=t[Ke];if(r&&i)for(;t.firstChild;)i.appendChild(t.firstChild);else for(;t.firstChild;)t.removeChild(t.firstChild);for(let c of n)t.appendChild(c);return t.setAttribute(H,we),e.lastSnapshot.set(t,n.slice()),!0}function co(e,t){let n=t.getAttribute(H)===we;if(t.setAttribute(H,Wn),!n)return Hn(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Hn(t),!0}function Hn(e){let t=e[Ke];!t||t.childNodes.length===0||e.appendChild(t)}function lo(e,t){if(!_e)return;let n=I(e);if(n.nameObservers.has(t))return;let r=new MutationObserver(()=>Ge(e));r.observe(t,{attributes:!0,attributeFilter:["name"]}),n.nameObservers.set(t,r)}function Xn(e,t){if(!Vt(e))return;let n=I(e),r=n.lastSnapshot.get(t);if(!r||r.length===0)return;let s=t.getAttribute("name")||null;for(let i of r)i.parentNode===t&&t.removeChild(i);Gn(n.pendingByName,s,r),n.lastSnapshot.delete(t);let o=n.nameObservers.get(t);o&&(o.disconnect(),n.nameObservers.delete(t)),n.ownedSlots.delete(t)}function uo(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function fo(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var Qn=new WeakMap,Wt=Symbol.for("webjs.instance");function te(e,t){let n=t,r=n[Wt];if(S(e)){let s=e;if(r&&r.strings===s.strings){Z(r,s.values);return}r&&Zn(r,t);let o=t.firstChild;o&&o.nodeType===8&&o.data==="webjs-hydrate"&&o.remove();let i=mo(s,t);n[Wt]=i;return}if(r&&Zn(r,t),n[Wt]=null,t.replaceChildren(),!(e==null||e===!1||e===!0)){if(Array.isArray(e)){for(let s of e){let o=document.createTextNode(String(s??""));t.appendChild(o)}return}t.appendChild(document.createTextNode(String(e)))}}function Je(e){let{strings:t}=e,n=Qn.get(t);if(n)return n;let r=[],s="",o="text",i="",c=0,a="",l=0,u=null,h="",f="";for(let m=0;m<t.length;m++){let de=t[m];for(let v=0;v<de.length;v++){let d=de[v];switch(o){case"text":s+=d,d==="<"&&(o="tag-open");break;case"tag-open":s+=d,d==="!"?o="bang-1":d==="/"?(o="tag-name",h=""):/[a-zA-Z]/.test(d)?(o="tag-name",h=d.toLowerCase()):o="text";break;case"bang-1":s+=d,o=d==="-"?"bang-dash":"tag-name";break;case"bang-dash":s+=d,d==="-"?(o="comment",l=0):o="tag-name";break;case"comment":s+=d,d==="-"?l+=1:(d===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":s+=d,d===">"?(o=h==="script"||h==="style"?"rawtext":"text",o==="rawtext"&&(f="")):/\s/.test(d)?o="in-tag":h+=d.toLowerCase();break;case"in-tag":s+=d,d===">"?(o=h==="script"||h==="style"?"rawtext":"text",o==="rawtext"&&(f="")):!/\s/.test(d)&&d!=="/"&&(o="attr-name",i=d,c=s.length-1);break;case"rawtext":s+=d,f=(f+d.toLowerCase()).slice(-9),(f.endsWith("<\/script>")||f.endsWith("</style>"))&&(o="text",f="",h="");break;case"attr-name":d==="="?(o="after-eq",s+=d):/\s/.test(d)?(o="in-tag",i="",s+=d):d===">"?(o="text",i="",s+=d):(i+=d,s+=d);break;case"after-eq":d==='"'||d==="'"?(o="attr-quoted",a=d,s+=d):/\s/.test(d)?(o="in-tag",i="",s+=d):d===">"?(o="text",i="",s+=d):(o="attr-unquoted",s+=d);break;case"attr-unquoted":/\s/.test(d)?(o="in-tag",i="",s+=d):(d===">"&&(o="text",i=""),s+=d);break;case"attr-quoted":s+=d,d===a&&(o="in-tag",i="");break;case"skip-attr":if(d===a){if(u){let T=u.firstPartIdx,w=[];for(let E=T;E<r.length;E++)(r[E].kind==="noop"||r[E].kind==="attr-mixed")&&w.push(E);let N=[],_=t[w[0]],he=_.lastIndexOf(a);N.push(he>=0?_.slice(he+1):_);for(let E=1;E<w.length;E++)N.push(t[w[E]]);let pe=t[w[w.length-1]+1],vt=pe.indexOf(a);N.push(vt>=0?pe.slice(0,vt):pe),r[T]={kind:"attr-mixed",path:[],name:u.name,statics:N,group:w},u=null}o="in-tag",i=""}break}}if(m<t.length-1){let v=r.length;if(o==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(o==="rawtext"){f="",r.push({kind:"noop",path:[]});continue}if(o==="text")s+=`<!--${b}${v}-->`,r.push({kind:"child",path:[]});else if(o==="in-tag"){let d=`data-${b}${v}`;s+=`${d}=""`,r.push({kind:"element",path:[]})}else if(o==="after-eq"){let d=i[0],T=i.slice(1);if(Rn(d)){s=s.slice(0,c);let w=Tt[d],N=`data-${b}${v}`;s+=`${N}=""`,r.push({kind:w,path:[],name:T})}else{s=s.slice(0,c);let w=`data-${b}${v}`;s+=`${w}=""`,r.push({kind:"attr",path:[],name:i})}o="in-tag",i=""}else if(o==="attr-quoted"||o==="attr-unquoted"){s=s.slice(0,c);let d=`data-${b}${v}`;s+=`${d}=""`,u={name:i,firstPartIdx:v},r.push({kind:"noop",path:[]}),o="skip-attr"}else o==="skip-attr"&&r.push({kind:"noop",path:[]})}}let p=document.createElement("template");return p.innerHTML=s,ho(p.content,r),po(p.content,r),n={templateEl:p,parts:r},Qn.set(t,n),n}function ho(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(P,"");let s=t.length;r.setAttribute(`data-${b}${s}`,""),t.push({kind:"slot",path:[]})}}function po(e,t){let n=[];function r(s){for(let o=0;o<s.childNodes.length;o++){let i=s.childNodes[o];if(n.push(o),i.nodeType===8){let c=i.data;if(c.startsWith(b)){let a=Number(c.slice(b.length));t[a]&&t[a].kind==="child"&&(t[a].path=n.slice())}}else if(i.nodeType===1){let c=i,a=[];for(let l of c.attributes)if(l.name.startsWith(`data-${b}`)){let u=Number(l.name.slice(`data-${b}`.length));t[u]&&t[u].kind!=="child"&&(t[u].path=n.slice()),a.push(l.name)}for(let l of a)c.removeAttribute(l);r(i)}n.pop()}}r(e)}function mo(e,t){let{templateEl:n,parts:r}=Je(e),s=n.content.cloneNode(!0),o=document.createComment(`${b}s`),i=document.createComment(`${b}e`),c=r.map(l=>Xe(l,s)),a=[];for(let l=0;l<e.values.length;l++)V(c[l],e.values[l],void 0,e.values),a.push(e.values[l]);t.replaceChildren(o,...s.childNodes,i);for(let l of c)l.kind==="slot"&&V(l,void 0,void 0,[]);return{strings:e.strings,bound:c,lastValues:a,startNode:o,endNode:i}}function Xe(e,t){if(e.kind==="noop")return{kind:"noop"};let n=t;for(let s of e.path)n=n.childNodes[s];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let s={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(o){s.handler?.(o)}};return r.addEventListener(s.name,s.dispatcher),s}if(e.kind==="attr")return{kind:"attr",el:r,name:e.name||""};if(e.kind==="attr-mixed")return{kind:"attr-mixed",el:r,name:e.name||"",statics:e.statics||[],group:e.group||[]};if(e.kind==="prop")return{kind:"prop",el:r,name:e.name||""};if(e.kind==="bool")return{kind:"bool",el:r,name:e.name||""};if(e.kind==="element")return{kind:"element",el:r};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}function Z(e,t){for(let n=0;n<t.length;n++){let r=t[n];Object.is(r,e.lastValues[n])||(V(e.bound[n],r,e.lastValues[n],t),e.lastValues[n]=r)}}function Zn(e,t){for(let n of e.bound){if(n.kind==="event"&&n.el.removeEventListener(n.name,n.dispatcher),n.kind==="element"){let r=n.lastTarget;if(r){if(typeof r=="function")try{r(void 0)}catch{}else typeof r=="object"&&(r.value=void 0);n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=zt(n.slotEl);r&&Xn(r,n.slotEl)}}t.replaceChildren()}function V(e,t,n,r){if(xt(t)){let s=t.value;if(e.kind==="prop"&&e.el[e.name]===s||e.kind==="attr"&&e.el.getAttribute(e.name)===String(s)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!s)return;t=s}switch(e.kind){case"child":go(e,t);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):e.el.setAttribute(e.name,String(t));break}case"prop":e.el[e.name]=t;break;case"bool":t?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":e.handler=typeof t=="function"?t:null;break;case"element":yo(e,t);break;case"attr-mixed":{let s=e,o=s.statics[0];for(let i=0;i<s.group.length;i++)o+=String((r?r[s.group[i]]:t)??""),o+=s.statics[i+1]||"";e.el.setAttribute(e.name,o);break}case"slot":{if(e.applied)break;let s=e.slotEl,o=()=>{e.applied=!0;let c=zt(s);if(!c||bo(s))return;let a=document.createDocumentFragment();for(;s.firstChild;)a.appendChild(s.firstChild);s[Ke]=a,Ge(c)};zt(s)?o():queueMicrotask(o);break}case"noop":break}}function zt(e){let t=e.parentElement;for(;t;){if(t[q])return t;t=t.parentElement}return null}function bo(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.host)return!0;t=r}return!1}function yo(e,t){let n=e,r=Pe(t)?t.target:void 0,s=n.__refTarget,o=r!==s;if(o&&s)if(typeof s=="function")try{s(void 0)}catch{}else typeof s=="object"&&(s.value=void 0);if(o||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!o&&n.__refElement!==void 0)try{r(void 0)}catch{}try{r(e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function go(e,t){return ko(e,t),j(e,t)}function j(e,t){let n=e.marker;if(kt(t)){F(e);let s=String(t.value??""),o=document.createElement("template");o.innerHTML=s;let i=[...o.content.childNodes],c=document.createDocumentFragment();for(let a of i)c.appendChild(a);n.parentNode?.insertBefore(c,n),e.child=i;return}if(Le(t)){let s=t,o=e.__keyedKey;o!==void 0&&!Object.is(o,s.key)&&F(e),e.__keyedKey=s.key,j(e,s.value);return}if(Me(t)){let s=t,o=e.__guardDeps,i=s.deps;if(o!==void 0&&(Array.isArray(o)&&Array.isArray(i)?To(o,i):Object.is(o,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,j(e,s.fn());return}if(Nt(t)){F(e);let s=t.template;if(s&&s.content){let o=s.content.cloneNode(!0),i=[...o.childNodes];n.parentNode?.insertBefore(o,n),e.child=i}return}if(Pe(t))return;if(Ie(t))return xo(e,t.value);if(Fe(t))return No(e,t.args);if(Be(t))return jo(e,t.signal);if(jt(t))return Ro(e,t);if(Rt(t))return Oo(e,t);if(Oe(t)){if(e.child&&e.child.kind==="repeat"){So(e,t);return}F(e);let s={kind:"repeat",map:new Map};e.child=s,wo(n,s,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){Eo(e,t);return}F(e);let s={kind:"array",items:[]};e.child=s,vo(n,s,t);return}if(e.child){let s=e.child;if(s.kind==="repeat")er(s),e.child=void 0;else if(s.kind==="array")nr(s),e.child=void 0;else if(s.kind==="async-stream")ir(s),e.child=void 0;else if("strings"in e.child){let o=e.child;if(S(t)&&o.strings===t.strings){Z(o,t.values);return}ee(o.startNode,o.endNode),e.child=void 0}else{for(let o of e.child)o.parentNode&&o.parentNode.removeChild(o);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(S(t)){let s=t,{templateEl:o,parts:i}=Je(s),c=o.content.cloneNode(!0),a=document.createComment(`${b}s`),l=document.createComment(`${b}e`),u=i.map(p=>Xe(p,c)),h=[];for(let p=0;p<s.values.length;p++)V(u[p],s.values[p],void 0,s.values),h.push(s.values[p]);let f=[a,...c.childNodes,l];n.parentNode?.insertBefore(_o(f),n);for(let p of u)p.kind==="slot"&&V(p,void 0,void 0,[]);e.child={strings:s.strings,bound:u,lastValues:h,startNode:a,endNode:l};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function _o(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function ee(e,t){if(!e.parentNode)return;let n=e;for(;n&&n!==t;){let r=n.nextSibling;n.parentNode?.removeChild(n),n=r}t.parentNode===e.parentNode&&t.parentNode?.removeChild(t)}function Gt(e){let{templateEl:t,parts:n}=Je(e),r=t.content.cloneNode(!0),s=document.createComment(`${b}s`),o=document.createComment(`${b}e`),i=n.map(l=>Xe(l,r)),c=[];for(let l=0;l<e.values.length;l++)V(i[l],e.values[l],void 0,e.values),c.push(e.values[l]);let a=document.createDocumentFragment();for(a.appendChild(s);r.firstChild;)a.appendChild(r.firstChild);return a.appendChild(o),{inst:{strings:e.strings,bound:i,lastValues:c,startNode:s,endNode:o},frag:a}}function Se(e){for(let t of e.bound)if(t.kind==="event"&&t.el.removeEventListener(t.name,t.dispatcher),t.kind==="element"){let n=t.lastTarget;if(n){if(typeof n=="function")try{n(void 0)}catch{}else typeof n=="object"&&(n.value=void 0);t.lastTarget=void 0,t.__lastEl=void 0}}}function wo(e,t,n){let{items:r,keyFn:s,templateFn:o}=n,i=e.parentNode;if(!i)return;let c=document.createDocumentFragment();for(let a=0;a<r.length;a++){let l=s(r[a],a),u=o(r[a],a);if(!S(u))continue;let{inst:h,frag:f}=Gt(u);t.map.set(l,h),c.appendChild(f)}i.insertBefore(c,e)}function So(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let s=e.child,{items:o,keyFn:i,templateFn:c}=t,a=new Map;for(let l=0;l<o.length;l++){let u=i(o[l],l),h=c(o[l],l);if(!S(h))continue;let f=s.map.get(u);if(f&&f.strings===h.strings)Z(f,h.values),Kt(f.startNode,f.endNode,r,n),a.set(u,f),s.map.delete(u);else{f&&(Se(f),ee(f.startNode,f.endNode),s.map.delete(u));let{inst:p,frag:m}=Gt(h);r.insertBefore(m,n),a.set(u,p)}}for(let l of s.map.values())Se(l),ee(l.startNode,l.endNode);s.map=a}function er(e){for(let t of e.map.values())Se(t),ee(t.startNode,t.endNode);e.map.clear()}function Ao(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function Ye(e){e.type==="tpl"?(Se(e.inst),ee(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function tr(e){if(S(e)){let{inst:t,frag:n}=Gt(e);return{item:{type:"tpl",inst:t},frag:n}}if(e!=null&&e!==!1&&e!==!0){let t=document.createTextNode(String(e));return{item:{type:"text",node:t},frag:t}}return{item:{type:"empty"},frag:null}}function vo(e,t,n){let r=e.parentNode;if(!r)return;let s=document.createDocumentFragment(),o=[];for(let i of n){let{item:c,frag:a}=tr(i);a&&s.appendChild(a),o.push(c)}r.insertBefore(s,e),t.items=o}function Eo(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let s=e.child,o=s.items,i=[];for(let c=0;c<t.length;c++){let a=t[c],l=o[c];if(S(a)){let f=a;if(l&&l.type==="tpl"&&l.inst.strings===f.strings){Z(l.inst,f.values),i.push(l);continue}}else if(a!=null&&a!==!1&&a!==!0){if(l&&l.type==="text"){let f=String(a);l.node.data!==f&&(l.node.data=f),i.push(l);continue}}else{l&&Ye(l),i.push({type:"empty"});continue}let{item:u,frag:h}=tr(a);h&&r.insertBefore(h,Co(o,c,n)),l&&Ye(l),i.push(u)}for(let c=t.length;c<o.length;c++)Ye(o[c]);s.items=i}function Co(e,t,n){for(let r=t;r<e.length;r++){let s=Ao(e[r]);if(s&&s.parentNode)return s}return n}function nr(e){for(let t of e.items)Ye(t);e.items=[]}function Kt(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let s=document.createDocumentFragment(),o=e;for(;o;){let i=o.nextSibling;if(s.appendChild(o),o===t)break;o=i}n.insertBefore(s,r)}function To(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function F(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&rr(t),!e.child)return;let n=e.child;if(n.kind==="repeat")er(n);else if(n.kind==="array")nr(n);else if(n.kind==="async-stream")ir(n);else if("strings"in n){let r=e.child;Se(r),ee(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function ko(e,t){let n=e;n.__untilState&&!Fe(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!Me(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!Ie(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!Le(t)&&(n.__keyedKey=void 0),n.__watchSub&&!Be(t)&&rr(n)}function xo(e,t){let n=e.marker,r=e,s=r.__cacheMap;s||(s=new Map,r.__cacheMap=s);let o=e.child;if(o&&"strings"in o){let c=o;if(S(t)&&c.strings===t.strings){Z(c,t.values);return}let a=document.createDocumentFragment();Kt(c.startNode,c.endNode,a,null),s.set(c.strings,{inst:c,holder:a}),e.child=void 0}if(S(t)){let c=t,a=s.get(c.strings);if(a){s.delete(c.strings),e.child&&F(e),Kt(a.inst.startNode,a.inst.endNode,n.parentNode,n),Z(a.inst,c.values),e.child=a.inst;return}}j(e,t)}function No(e,t){let n=e,r=n.__untilState,s=n.__untilArgs,o=(f,p)=>!!(Object.is(f,p)||S(f)&&S(p)&&f.strings===p.strings),c=s&&s.length===t.length&&s.every((f,p)=>o(f,t[p]))&&r?r.highestResolved:1/0;r&&(r.aborted=!0),n.__untilArgs=t.slice();let a={aborted:!1,highestResolved:c};n.__untilState=a;let l=-1,u;for(let f=0;f<t.length;f++){let p=t[f];if(!p||typeof p.then!="function"){l=f,u=p;break}}l!==-1&&l<=a.highestResolved?(j(e,u),a.highestResolved=l):l===-1&&!n.__untilEverRendered&&j(e,""),n.__untilEverRendered=!0;let h=Math.min(l===-1?t.length:l,a.highestResolved);for(let f=0;f<h;f++){let p=t[f];!p||typeof p.then!="function"||Promise.resolve(p).then(m=>{a.aborted||f>=a.highestResolved||(a.highestResolved=f,j(e,m))},()=>{})}}function jo(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let o;n.__watchSub.observe(()=>{o=t.get()}),j(e,o);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new ye.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let o;r.observe(()=>{o=t.get()}),j(e,o)})});n.__watchSub=r;let s;r.observe(()=>{s=t.get()}),j(e,s)}function rr(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Ro(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;F(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,sr(s,e,t)}function Oo(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;F(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,sr(s,e,t)}async function sr(e,t,n){let r=t.marker,s=0;try{for(;!e.aborted;){let o=await e.iterator.next();if(e.aborted||o.done)break;let i=n.mapper?n.mapper(o.value,s):o.value,c=or(i);if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let a=document.createDocumentFragment();for(let l of c)a.appendChild(l);r.parentNode?.insertBefore(a,r),e.nodes.push(...c),s++}}catch(o){typeof console<"u"&&console.error("[webjs] asyncStream error:",o)}}function or(e){if(e==null||e===!1||e===!0)return[];if(S(e)){let t=e,{templateEl:n,parts:r}=Je(t),s=n.content.cloneNode(!0),o=r.map(i=>Xe(i,s));for(let i=0;i<t.values.length;i++)V(o[i],t.values[i],void 0,t.values);return[...s.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...or(n));return t}return[document.createTextNode(String(e))]}function ir(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}var ar=null;function Qe(e){ar=e||null}function Lo(){return ar||void 0}var cr=Symbol.for("webjs:registry"),lr=Symbol.for("webjs:classToTag"),Ze=globalThis,R=Ze[cr]||(Ze[cr]=new Map),ur=Ze[lr]||(Ze[lr]=new WeakMap),et=typeof window<"u"&&typeof customElements<"u";function Yt(e,t){if(!e||typeof e!="string"||!e.includes("-"))throw new Error(`customElements.define: tag "${e}" must contain a hyphen (HTML spec)`);let n=t.lazy===!0,r=R.get(e);r?(r.cls=t,r.lazy=n):R.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),ur.set(t,e)}if(et){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),Yt(t,n)}}if(!et){let e=globalThis;e.customElements||(e.customElements={define(t,n){Yt(t,n)},get(t){return R.get(t)?.cls},upgrade(){},whenDefined(t){let n=R.get(t);return Promise.resolve(n?.cls)}})}function Jt(e,t){et?customElements.define(e,t):Yt(e,t)}function Mo(e,t){if(et)return;let n=R.get(e);if(n){n.moduleUrl=t;return}R.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Po(e){return R.get(e)?.cls}function Io(e){return R.get(e)?.moduleUrl||null}function Fo(e){return R.get(e)?.lazy===!0}function tt(e){return ur.get(e)}function Bo(){return[...R.keys()]}Ee();var yr=typeof window<"u"&&typeof HTMLElement<"u";function Xo(e,t){return e!==t}function Qo(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var nt=class{constructor(){this.__ssrAttrs=new Map,this.__internals=null}get attributes(){return[...this.__ssrAttrs].map(([t,n])=>({name:t,value:n}))}getAttribute(t){let n=this.__ssrAttrs.get(String(t).toLowerCase());return n===void 0?null:n}setAttribute(t,n){this.__ssrAttrs.set(String(t).toLowerCase(),String(n))}removeAttribute(t){this.__ssrAttrs.delete(String(t).toLowerCase())}hasAttribute(t){return this.__ssrAttrs.has(String(t).toLowerCase())}toggleAttribute(t,n){let r=String(t).toLowerCase(),s=this.__ssrAttrs.has(r);return(n===void 0?!s:n)?(this.__ssrAttrs.set(r,""),!0):(this.__ssrAttrs.delete(r),!1)}getAttributeNames(){return[...this.__ssrAttrs.keys()]}closest(t){let n=String(t).trim().toLowerCase();if(!/^[a-z][a-z0-9-]*$/.test(n))return null;if(this.__ssrTag===n)return this;let r=this.__ssrAncestors;if(!Array.isArray(r))return null;for(let s=r.length-1;s>=0;s--)if(r[s]&&r[s].__ssrTag===n)return r[s];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,s=>"-"+s.toLowerCase());return this.__dataset=new Proxy({},{get(r,s){if(typeof s!="string")return;let o=t.getAttribute(n(s));return o===null?void 0:o},set(r,s,o){return typeof s=="string"&&t.setAttribute(n(s),o),!0},has(r,s){return typeof s=="string"&&t.hasAttribute(n(s))},deleteProperty(r,s){return typeof s=="string"&&t.removeAttribute(n(s)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(s,o)=>o.toUpperCase()))},getOwnPropertyDescriptor(r,s){if(typeof s=="string"&&t.hasAttribute(n(s)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(s))}}}),this.__dataset}get className(){return this.getAttribute("class")??""}set className(t){this.setAttribute("class",t)}get hidden(){return this.hasAttribute("hidden")}set hidden(t){this.toggleAttribute("hidden",!!t)}get id(){return this.getAttribute("id")??""}set id(t){this.setAttribute("id",t)}get title(){return this.getAttribute("title")??""}set title(t){this.setAttribute("title",t)}get slot(){return this.getAttribute("slot")??""}set slot(t){this.setAttribute("slot",t)}get role(){return this.getAttribute("role")}set role(t){t==null?this.removeAttribute("role"):this.setAttribute("role",t)}get tabIndex(){let t=this.getAttribute("tabindex");return t===null?-1:Number.parseInt(t,10)||0}set tabIndex(t){this.setAttribute("tabindex",String(t))}addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return this.__internals=Qo(),this.__internals}},Zo=["ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDescription","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"];for(let e of Zo){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(nt.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var ei=yr?HTMLElement:nt,gr=Symbol("webjs.factoryProps"),mr=new WeakSet,ne=class e extends ei{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){Jt(t,this)}static get observedAttributes(){let t=this.properties||{};return Object.keys(t).filter(n=>!(typeof t[n]=="object"&&t[n].state)).map(n=>typeof t[n]=="object"&&t[n].attribute||Qt(n))}constructor(){super(),this._renderRoot=null,this._scheduled=!1,this._connected=!1,this.__controllers=new Set,this.__firstRendered=!1,this._changedProperties=new Map,this._updateResolve=null,this._updatePromise=Promise.resolve(!0),this._isUpdating=!1,this._assertFactoryProperties(),this._initializeProperties()}_assertFactoryProperties(){let t=this.constructor;if(mr.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,gr)){let r=n.name||"a component";throw new Error(`${r}: \`static properties\` is no longer supported. Declare reactive properties via the factory instead: \`class ${r} extends WebComponent({ count: Number })\`. Use the \`prop()\` helper for options (\`prop(Number, { reflect: true })\`) and set defaults in the constructor after \`super()\`. See https://docs.webjs.dev/docs/components.`)}n=Object.getPrototypeOf(n)}mr.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,s]of Object.entries(n)){let o=typeof s=="object"?s:{type:s},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:c=>{let a=this.__propValues[r];(o.hasChanged||Xo)(c,a)&&(this.__propValues[r]=c,o.reflect&&!o.state&&this._connected&&this._reflectAttribute(r,c,o),this.requestUpdate(r,a))}}),i!==void 0?this.__propValues[r]=i:o.default!==void 0&&(this.__propValues[r]=typeof o.default=="function"?o.default():o.default)}}}_reflectAttribute(t,n,r){let s=r.attribute||Qt(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let o=r.converter.toAttribute(n,r.type);o==null?this.removeAttribute(s):this.setAttribute(s,o)}else r.type===Boolean?n?this.setAttribute(s,""):this.removeAttribute(s):n==null?this.removeAttribute(s):r.type===Object||r.type===Array?this.setAttribute(s,JSON.stringify(n)):this.setAttribute(s,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!yr)return;if(this.__webjsPropsHydrated||(this.__webjsPropsHydrated=!0,this._hydratePropAttrs()),this.constructor.hydrate==="visible"&&typeof IntersectionObserver<"u"&&!this.__hydrationActivated){this.__hydrationActivated=!1,this.__hydrationObserver=new IntersectionObserver(n=>{for(let r of n)if(r.isIntersecting){this.__hydrationObserver.unobserve(this),this.__hydrationObserver.disconnect(),this.__hydrationObserver=null,this.__hydrationActivated=!0,this._activate();return}},{rootMargin:"200px"}),this.__hydrationObserver.observe(this);return}this._activate()}_hydratePropAttrs(){let t=[],n=this.attributes;for(let r=0;r<n.length;r++){let s=n[r].name;s.startsWith("data-webjs-prop-")&&t.push(s)}for(let r of t){let s=this.getAttribute(r);if(this.removeAttribute(r),s==null)continue;let o=br(r.slice(16));try{this[o]=z(s)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,s=Array.isArray(r)?r:Et(r)?[r]:[];if(s.length){if(n){let o=this.shadowRoot.querySelector("style");o&&o.remove()}Ct(this._renderRoot,s)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${tt(t)||this.tagName?.toLowerCase()}> has static shadow = false AND static styles. static styles only works with shadow DOM (adoptedStyleSheets). For light DOM, use global CSS or <style> in render().`),Vt(this)||(this.__isHydrating()?(I(this),Kn(this)):zn(this));for(let n of this.__controllers)n.hostConnected&&n.hostConnected();this._updateResolve===null&&(this._updatePromise=new Promise(n=>{this._updateResolve=n})),this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(n){console.error("[webjs] lifecycle hook threw during initial render:",n)}this._renderRoot===this&&Yn(this)})}__isHydrating(){let t=this.firstChild,n=t!=null&&t.nodeType===8&&t.data==="webjs-hydrate";return n&&(this.__hydratedAtActivate=!0),n}disconnectedCallback(){this._connected=!1,this.__hydrationObserver&&(this.__hydrationObserver.disconnect(),this.__hydrationObserver=null),this._renderRoot===this&&Jn(this),this.__signalWatcher&&(this.__signalWatcher.dispose(),this.__signalWatcher=void 0);for(let t of this.__controllers)t.hostDisconnected&&t.hostDisconnected()}attributeChangedCallback(t,n,r){if(this.__reflectingAttribute)return;let o=this.constructor.properties||{},i,c;for(let[u,h]of Object.entries(o))if(((typeof h=="object"?h:{type:h}).attribute||Qt(u))===t){i=u,c=h;break}if(c===void 0&&(i=br(t),c=o[i]||o[t]),c===void 0)return;let a=typeof c=="object"?c:{type:c},l;if(a.converter&&a.converter.fromAttribute)l=a.converter.fromAttribute(r,a.type);else if(a.type===Number)l=r==null?null:Number(r);else if(a.type===Boolean)l=r!=null&&r!=="false";else if(a.type===Object||a.type===Array)try{l=r==null?null:JSON.parse(r)}catch{l=r}else l=r;this[i]!==l&&(this[i]=l,this._connected&&this.requestUpdate())}requestUpdate(t,n){t!==void 0&&!this._changedProperties.has(t)&&this._changedProperties.set(t,n),this._scheduleUpdate()}_scheduleUpdate(){this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),!this._isUpdating&&(this._scheduled||!this._connected||(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(t){console.error("[webjs] lifecycle hook threw during update cycle:",t)}})))}_performRender(){if(!this._renderRoot)return;let t=this._changedProperties;this._isUpdating=!0;let n=!1,r=null;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let s of this.__controllers)s.hostUpdate&&s.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,Qe(this.__renderAbort?this.__renderAbort.signal:null);try{let s=this.update(t);s&&typeof s.then=="function"&&(r=s)}catch(s){this._handleRenderError(s)}finally{Qe(null)}if(!r){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();n=!0}}}catch(s){console.error("[webjs] lifecycle hook threw during update phase:",s)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let s=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1,r.then(()=>{if(this.__pendingAsyncCommits--,s===this.__renderToken){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();this._postCommit(t)}});return}n?this._postCommit(t):this.__pendingAsyncCommits||this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers)n.hostUpdate&&n.hostUpdate();this._reflectDeclaredAttributes()}finally{this._isUpdating=!1}}_reflectDeclaredAttributes(){let t=this.constructor.properties||{};for(let n of Object.keys(t)){let r=t[n];!r||!r.reflect||r.state||this._reflectAttribute(n,this[n],r)}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new ye.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);te(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&te(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{n===this.__renderToken&&te(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==rt.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${tt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&te(n,this._renderRoot)}catch(n){console.error("[webjs] renderError() also threw:",n)}}_postCommit(t){try{this.__firstRendered||(this.__firstRendered=!0,this.firstUpdated(t)),this.updated(t)}catch(n){console.error("[webjs] lifecycle hook threw during post-commit phase:",n)}finally{this._resolveUpdate()}}updated(t){}firstUpdated(t){}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}addController(t){this.__controllers.add(t),this._connected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers.delete(t)}render(){return""}renderError(t){}renderFallback(){}};function Qt(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function br(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function rt(e){return new.target?Reflect.construct(ne,arguments,new.target):class extends ne{static properties=e;static[gr]=!0}}Object.setPrototypeOf(rt,ne);rt.prototype=ne.prototype;function ti(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var _r=Symbol.for("webjs.notFound"),wr=Symbol.for("webjs.redirect");function ni(){let e=new Error("webjs: notFound()");throw e.__webjs=_r,e}function ri(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=wr,r.url=e,r.status=typeof n=="number"?n:void 0,r}function si(e){return!!e&&e.__webjs===_r}function oi(e){return!!e&&e.__webjs===wr}var Sr=null;function ii(){if(!Sr)return"";try{return Sr()||""}catch{return""}}var za=Symbol.for("webjs.suspense");function ai(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function ci(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function li(e,t={}){let n=t.reconnect!==!1,r=0,s=!1,o=null,i=[];function c(){s||(o=new WebSocket(ui(e),t.protocols),o.onopen=a=>{for(r=0;i.length&&o&&o.readyState===WebSocket.OPEN;)o.send(i.shift());t.onOpen?.(a)},o.onmessage=a=>{let l=a.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,a)},o.onerror=a=>{t.onError?.(a)},o.onclose=a=>{if(t.onClose?.(a),!s&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(c,l)}})}return c(),{send(a){let l=typeof a=="string"||a instanceof ArrayBuffer||ArrayBuffer.isView(a)?a:JSON.stringify(a);o&&o.readyState===WebSocket.OPEN?o.send(l):i.push(l)},close(a,l){s=!0;try{o?.close(a,l)}catch{}},get socket(){return o},get readyState(){return o?.readyState??3}}}function ui(e){if(/^wss?:\/\//i.test(e))return e;let t=typeof location<"u"&&location.protocol==="https:"?"wss:":"ws:",n=typeof location<"u"?location.host:"";return`${t}//${n}${e.startsWith("/")?e:"/"+e}`}Ee();var Zt="application/vnd.webjs+json";async function fi(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",Zt);let r=t.body;r!=null&&typeof r=="object"&&!(r instanceof FormData)&&!(r instanceof Blob)&&!(r instanceof ArrayBuffer)&&!(r instanceof URLSearchParams)&&!(typeof ReadableStream<"u"&&r instanceof ReadableStream)&&!ArrayBuffer.isView(r)&&(r=await Xt(r),n.has("content-type")||n.set("content-type",Zt));let s=await fetch(e,{...t,headers:n,body:r}),o=s.headers.get("content-type")||"",i=await s.text(),c=o.includes(Zt)?i?z(i):null:o.includes("application/json")?i?JSON.parse(i):null:i;if(!s.ok){let a=c&&c.error||`richFetch ${e} -> ${s.status}`,l=new Error(a);throw l.status=s.status,l.body=c,l}return c}Ee();ot();ot();nn();it();var Tn=class{constructor(t,n){this.host=t,this.options=n,this.updates=[],this._nextId=0}get value(){let t=this.options.source();if(!this.options.update)return this.updates.length>0?this.updates[this.updates.length-1].payload:t;for(let n of this.updates)t=this.options.update(t,n.payload);return t}add(t,n){let r=`opt-${++this._nextId}`;this.updates.push({id:r,payload:t}),this.host?.requestUpdate?.();let s=()=>{let o=this.updates.findIndex(i=>i.id===r);o!==-1&&(this.updates.splice(o,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>s()).catch(()=>{}):n.then(()=>s(),()=>s())),s}};async function zi(e,t,n){let r=e.get();e.set(t);let s;try{s=await n()}catch(o){throw e.set(r),o}return s&&s.success===!1&&e.set(r),s}function Ki(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?zi(e,t,n):new Tn(e,t)}on();var St=0,_s=new Map,fe=new Map,Gi=1e3;function Yi(e){if(!(!Array.isArray(e)||!e.length)){St+=1;for(let t of e)t&&_s.set(t,St)}}function Ji(){return St}function Xi(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(fe.delete(e),fe.set(e,{tags:t.slice(),since:typeof n=="number"?n:St}),fe.size>Gi)){let r=fe.keys().next().value;r!==void 0&&fe.delete(r)}}function Qi(e){let t=fe.get(e);if(!t)return!1;for(let n of t.tags)if((_s.get(n)||0)>t.since)return!0;return!1}function Zi(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var ea="application/vnd.webjs+stream",ta=1,na=2,ra=3,ws=new Uint8Array(0);function sa(e,t){let n=t||ws,r=n.length,s=new Uint8Array(5+r);return s[0]=e&255,s[1]=r>>>24&255,s[2]=r>>>16&255,s[3]=r>>>8&255,s[4]=r&255,r&&s.set(n,5),s}function oa(){let e=ws;return{push(t){if(t&&t.length){let r=new Uint8Array(e.length+t.length);r.set(e,0),r.set(t,e.length),e=r}let n=[];for(;e.length>=5;){let r=e[0],s=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+s)break;let o=e.slice(5,5+s);n.push({type:r,payload:o}),e=e.slice(5+s)}return n}}}var ia=Symbol.for("webjs.context");function aa(e){return{__context__:ia,name:e}}var At=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},kn=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=s=>{let o=s;if(o.context===this._context)if(s.stopPropagation(),o.subscribe){let i={callback:o.callback},c=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),o.callback(this._value,c)}else o.callback(this._value)},typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}setValue(t){if(!Object.is(this._value,t)){this._value=t;for(let n of this._subscriptions){let r=()=>{this._subscriptions.delete(n)};n.callback(t,r)}}}hostConnected(){this._host.addEventListener("context-request",this._onRequest)}hostDisconnected(){this._host.removeEventListener("context-request",this._onRequest),this._subscriptions.clear()}},xn=class{constructor(t,{context:n,subscribe:r=!0}){this._host=t,this._context=n,this._subscribe=r,this._value=void 0,this._unsubscribe=void 0,typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}hostConnected(){this._dispatchRequest()}hostDisconnected(){this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=void 0)}_dispatchRequest(){let t=new At(this._context,(n,r)=>{let s=this._value;this._value=n,r&&(this._unsubscribe=r),!Object.is(s,n)&&typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()},this._subscribe);this._host.dispatchEvent(t)}};function ca(){return typeof window<"u"}var L={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},Nn=class{constructor(t,{task:n,args:r,autoRun:s=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=s,this._status=L.INITIAL,this._value=void 0,this._error=void 0,this._abortController=null,this._prevArgs=null,typeof t.addController=="function"&&t.addController(this)}get status(){return this._status}get value(){return this._value}get error(){return this._error}async run(){this.abort();let t=new AbortController;this._abortController=t;let n=this._argsFn();this._prevArgs=n,this._status=L.PENDING,this._error=void 0,this._requestHostUpdate();try{let r=await this._taskFn(...n,{signal:t.signal});if(t.signal.aborted)return;this._value=r,this._status=L.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=L.ERROR,this._value=void 0}finally{this._abortController===t&&(this._abortController=null)}this._requestHostUpdate()}abort(){this._abortController&&(this._abortController.abort(),this._abortController=null)}render(t={}){switch(this._status){case L.INITIAL:return t.initial?.();case L.PENDING:return t.pending?.();case L.COMPLETE:return t.complete?.(this._value);case L.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!ca())return;let t=this._argsFn();this._argsEqual(this._prevArgs,t)||this.run()}hostUpdated(){}hostConnected(){}hostDisconnected(){this.abort()}_requestHostUpdate(){typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()}_argsEqual(t,n){if(t===null||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}};export{xn as ContextConsumer,kn as ContextProvider,At as ContextRequestEvent,ta as FRAME_CHUNK,na as FRAME_END,ra as FRAME_ERROR,b as MARKER,Rr as SEED_MISS,ea as STREAM_CONTENT_TYPE,ye as Signal,ai as Suspense,Nn as Task,L as TaskStatus,rt as WebComponent,tn as WebjsFrame,rn as WebjsStream,Lo as activeActionSignal,Ct as adoptStyles,Bo as allTags,Fs as asyncAppend,Bs as asyncReplace,Gs as batch,Ps as cache,Js as computed,li as connectWS,Qi as consumeStale,aa as createContext,oa as createFrameDecoder,Ms as createRef,ii as cspNonce,Es as css,hr as deserialize,Fr as disableClientRouter,Qs as effect,mn as enableClientRouter,sa as encodeFrame,ks as escapeAttr,Ts as escapeText,Ji as fetchMark,Rs as guard,vs as html,jt as isAsyncAppend,Rt as isAsyncReplace,Et as isCSS,Ie as isCache,Me as isGuard,Le as isKeyed,Fo as isLazy,xt as isLive,si as isNotFound,oi as isRedirect,Pe as isRef,Oe as isRepeat,Xs as isSignal,ci as isSuspense,S as isTemplate,Nt as isTemplateContent,kt as isUnsafeHTML,Fe as isUntil,Be as isWatch,js as keyed,Ns as live,Po as lookup,Io as lookupModuleUrl,Yi as markStale,Br as navigate,ni as notFound,Ki as optimistic,z as parse,Zi as parseTagHeader,Mo as primeModuleUrl,ti as prop,ri as redirect,Ls as ref,Jt as register,Xi as registerKeyTags,te as render,sn as renderStream,Ln as repeat,Ur as revalidate,fi as richFetch,at as scanSeeds,dr as serialize,Qe as setActiveActionSignal,Ys as signal,Xt as stringify,Cs as stylesToString,tt as tagOf,gi as takeSeed,Os as templateContent,xs as unsafeHTML,Is as until,Us as watch};
4
4
  //# sourceMappingURL=webjs-core-browser.js.map
@@ -1,6 +1,6 @@
1
1
  var Zs=Object.defineProperty;var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var tr=(e,t)=>{for(var n in t)Zs(e,n,{get:t[n],enumerable:!0})};function Pr(e,t,n){ci.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function Ke(e){return JSON.stringify(await $r(e))}function D(e){return Fr(JSON.parse(e))}async function $r(e){let t=li();return await ui(e,t),le(e,t)}function Fr(e){return G(e,hi())}function li(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function ui(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!bi(r))continue;let s=t.refCount.get(r)||0;if(t.refCount.set(r,s+1),!(s>0)){if(typeof Blob<"u"&&r instanceof Blob){let o=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,o);continue}if(typeof FormData<"u"&&r instanceof FormData){let o=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,o);for(let[,i]of o)typeof i!="string"&&n.push(i);continue}if(Array.isArray(r))for(let o=0;o<r.length;o++)n.push(r[o]);else if(r instanceof Map)for(let[o,i]of r)n.push(o),n.push(i);else if(r instanceof Set)for(let o of r)n.push(o);else if(gi(r))for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.push(r[o])}}for(let[r,s]of t.refCount)s>1&&t.idOf.set(r,t.nextId++)}function le(e,t){if(e===null)return null;if(e===void 0)return{[x]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[x]:"NaN"}:e===1/0?{[x]:"Inf"}:e===-1/0?{[x]:"-Inf"}:Object.is(e,-0)?{[x]:"-0"}:e;if(n==="bigint")return{[x]:"BigInt",v:e.toString()};if(n==="symbol"){let o=Symbol.keyFor(e);if(o===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[x]:"Sym",v:o}}if(n==="function")throw new TypeError("Cannot serialize a function.");let r=t.idOf.get(e);if(r!==void 0&&t.emitted.has(r))return{[x]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let s;if(e instanceof Date)s={[x]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)s={[x]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let o=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?s={[x]:"File",v:ze(o),n:e.name,t:e.type||"",m:e.lastModified}:s={[x]:"Blob",v:ze(o),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let o=t.fdEntries.get(e)||[...e.entries()],i=[];for(let[c,a]of o)i.push([c,le(a,t)]);s={[x]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)s=fi(e);else if(e instanceof Map){let o=[];for(let[i,c]of e)o.push([le(i,t),le(c,t)]);s={[x]:"Map",v:o}}else if(e instanceof Set){let o=[];for(let i of e)o.push(le(i,t));s={[x]:"Set",v:o}}else if(Array.isArray(e))s=e.map(o=>le(o,t));else{s={};for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let i=yi(o)?"_"+o:o;Pr(s,i,le(e[o],t))}}if(r!==void 0){if(Array.isArray(s))return{[x]:"Arr",_id:r,v:s};s._id=r}return s}function fi(e){if(e instanceof ArrayBuffer)return{[x]:"buf",v:ze(new Uint8Array(e))};if(e instanceof DataView)return{[x]:"dv",v:ze(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=di[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[x]:n,v:ze(r)}}function hi(){return{refs:new Map}}function G(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let o=[];for(let i=0;i<e.length;i++)o.push(G(e[i],t));return o}let n=e[x];if(typeof n=="string")return mi(e,n,t);let r={},s=e._id;typeof s=="number"&&t.refs.set(s,r);for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o)||o==="_id")continue;let i=wi(o)?o.slice(1):o;Pr(r,i,G(e[o],t))}return r}function mi(e,t,n){let r=e._id,s=o=>(typeof r=="number"&&n.refs.set(r,o),o);switch(t){case"undef":return;case"NaN":return NaN;case"Inf":return 1/0;case"-Inf":return-1/0;case"-0":return-0;case"BigInt":return s(BigInt(e.v));case"Sym":return s(Symbol.for(e.v));case"Date":return s(e.v==null?new Date(NaN):new Date(e.v));case"Error":{let o=new Error(e.v.message);return o.name=e.v.name,e.v.stack&&(o.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,o),o}case"Map":{let o=new Map;typeof r=="number"&&n.refs.set(r,o);for(let[i,c]of e.v)o.set(G(i,n),G(c,n));return o}case"Set":{let o=new Set;typeof r=="number"&&n.refs.set(r,o);for(let i of e.v)o.add(G(i,n));return o}case"Arr":{let o=[];typeof r=="number"&&n.refs.set(r,o);for(let i of e.v)o.push(G(i,n));return o}case"Ref":{let o=n.refs.get(e.v);if(o===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return o}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let o=Ve(e.v);return s(new Blob([o],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let o=Ve(e.v);return s(new File([o],e.n,{type:e.t||"",lastModified:e.m}))}case"FD":{if(typeof FormData>"u")throw new TypeError("FormData is not available in this environment.");let o=new FormData;s(o);for(let[i,c]of e.v){let a=G(c,n);o.append(i,a)}return o}default:{if(t==="buf"){let i=Ve(e.v);return s(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=Ve(e.v);return s(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let o=pi[t];if(o){let i=Ve(e.v),c=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength);return s(new o(c))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function bi(e){return e!==null&&typeof e=="object"}function gi(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function yi(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function wi(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function ze(e){if(Br)return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64");let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Ve(e){if(Br){let r=Buffer.from(e,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}var x,ci,di,pi,Br,ke=Z(()=>{x="_$wj",ci=new Set(["__proto__","constructor","prototype"]);di={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},pi={i8:Int8Array,u8:Uint8Array,u8c:Uint8ClampedArray,i16:Int16Array,u16:Uint16Array,i32:Int32Array,u32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:typeof BigInt64Array<"u"?BigInt64Array:null,bu64:typeof BigUint64Array<"u"?BigUint64Array:null};Br=typeof Buffer<"u"&&typeof Buffer.from=="function"});var Xr={};tr(Xr,{observeLazy:()=>ta,observeViewportOnce:()=>sa});function Jr(e){let t=vn.get(e);return t||(t=import(e).finally(()=>vn.delete(e)),vn.set(e,t),t)}function ta(e){for(let[t,n]of Object.entries(e))ue.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of ue.values())Jr(t);ue.clear();return}Xe||(Xe=new IntersectionObserver(na,{rootMargin:"200px"})),Yr(),typeof MutationObserver<"u"&&new MutationObserver(()=>Yr()).observe(document.body,{childList:!0,subtree:!0})}function Yr(){if(!(!Xe||!ue.size))for(let e of ue.keys())for(let t of document.querySelectorAll(e))Xe.observe(t)}function na(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=ue.get(n);r&&(Jr(r),ue.delete(n),Xe?.unobserve(t.target))}}function ra(e){for(let t of e){if(!t.isIntersecting)continue;let n=Nt.get(t.target);Nt.delete(t.target),Je?.unobserve(t.target),n&&n()}}function sa(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(Je||(Je=new IntersectionObserver(ra,{rootMargin:"200px"})),Nt.set(e,t),Je.observe(e),()=>{Nt.delete(e),Je?.unobserve(e)})}var ue,Xe,vn,Je,Nt,Zr=Z(()=>{ue=new Map,Xe=null,vn=new Map;Je=null,Nt=new WeakMap});var Cn,xn=Z(()=>{Cn=typeof HTMLElement<"u"?class extends HTMLElement{constructor(){super(),this._webjsLoadedSrc=null,this._webjsLazyTeardown=null}static get observedAttributes(){return["src"]}connectedCallback(){this._webjsScheduleLoad()}disconnectedCallback(){this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null)}attributeChangedCallback(t,n,r){t==="src"&&this.isConnected&&this._webjsScheduleLoad()}_webjsScheduleLoad(){let t=this.getAttribute("src");if(!t){this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null),this._webjsLoadedSrc=null;return}let n=t;try{n=new URL(t,location.href).href}catch{}if(n===this._webjsLoadedSrc)return;this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null),(this.getAttribute("loading")||"eager").toLowerCase()==="lazy"?(this._webjsLoadedSrc=n,Promise.resolve().then(()=>(Zr(),Xr)).then(({observeViewportOnce:s})=>{this._webjsLoadedSrc!==n||!this.isConnected||(this._webjsLazyTeardown=s(this,()=>{this._webjsLazyTeardown=null,this._webjsLoad(n)}))})):(this._webjsLoadedSrc=n,this._webjsLoad(n))}_webjsLoad(t){Promise.resolve().then(()=>(kn(),Qr)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&Cn&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",Cn)});function ia(e,t,n){switch(e){case"append":n&&t.append(n);break;case"prepend":n&&t.prepend(n);break;case"before":n&&t.before(n);break;case"after":n&&t.after(n);break;case"replace":n&&t.replaceWith(n);break;case"update":n&&t.replaceChildren(n);break;case"remove":t.remove();break;default:break}}function Nn(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let o=n.createElement("template");o.innerHTML=e,r=o.content}else if(e&&e.nodeType)r=e;else return;let s=r.querySelectorAll?Array.from(r.querySelectorAll("webjs-stream")):[];if(s.length)for(let o of s)n.body.append(o);else n.body.append(r)}var oa,Tn,jt=Z(()=>{oa=new Set(["append","prepend","before","after","replace","update"]);Tn=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this._webjsApplied||(this._webjsApplied=!0,this._webjsApply())}_webjsApply(){let t=(this.getAttribute("action")||"").toLowerCase(),n=this.ownerDocument||document,r=[],s=this.getAttribute("target");if(s){let i=n.getElementById(s);i&&(r=[i])}else{let i=this.getAttribute("targets");if(i)try{r=Array.from(n.querySelectorAll(i))}catch{r=[]}}let o=oa.has(t)?this.querySelector("template"):null;try{for(let i of r){let c=o?o.content.cloneNode(!0):null;ia(t,i,c)}}finally{this.remove()}}}:null;typeof customElements<"u"&&Tn&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",Tn)});var es,ts=Z(()=>{es=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&es&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",es)});function Rt(e){let t=e||(typeof document<"u"?document:null);if(!(!t||typeof t.querySelectorAll!="function")){for(let n of t.querySelectorAll('script[type="application/json"]#__webjs-seeds, script[type="application/json"][data-webjs-seeds]'))rs(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))rs(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function rs(e,t,n){if(e)try{let r=D(e);if(r&&typeof r=="object")for(let s in r)Ze.has(s)||Ze.set(s,r[s])}catch{}n?n():t.remove?.()}function aa(e,t,n){ns||(ns=!0,Rt());let r=`${e}/${t}/${n}`;if(Ze.has(r)){let s=Ze.get(r);return Ze.delete(r),s}return ss}var Ze,ss,ns,jn=Z(()=>{ke();Ze=new Map,ss=Symbol("webjs.seed.miss"),ns=!1});var Qr={};tr(Qr,{_FRAME_TOP:()=>ws,_LIVE_ATTRS:()=>$n,_activeFrameId:()=>ys,_addNewHeadElements:()=>Fn,_applyStreamedResolve:()=>Ws,_blurOutgoingFocus:()=>Mt,_buildSubmitFormData:()=>bs,_bumpNavToken:()=>ja,_clearFormBusy:()=>Ms,_clearFrameBusy:()=>Ls,_collectChildrenSlots:()=>Ie,_currentPageUrl:()=>Ra,_diffElementInPlace:()=>qt,_eligibleAnchorHref:()=>Pt,_findAnchorInPath:()=>gs,_getSubmitAction:()=>ms,_getSubmitMethod:()=>hs,_isNonHtmlPath:()=>Ma,_keyOf:()=>Me,_longestSharedPath:()=>Ss,_markFormBusy:()=>Os,_markFrameBusy:()=>Rs,_mergeHead:()=>qs,_navToken:()=>Na,_onPopState:()=>Un,_onSubmit:()=>qn,_prefetch:()=>Pe,_prefetchHasHoverPointer:()=>xs,_prefetchInflightSize:()=>ka,_prefetchMode:()=>$t,_prefetchPeek:()=>xa,_prefetchSaysSaveData:()=>Wn,_prefetchSuppressed:()=>ks,_prefetchTake:()=>Ts,_reactivateScripts:()=>Dt,_readStreamedShell:()=>Ds,_reconcileChildren:()=>Kn,_regraftPermanentElements:()=>Ps,_regraftPermanentInSlice:()=>zn,_resetPrefetch:()=>Ta,_resetWarnOnce:()=>Oa,_resolveTargetFrameId:()=>Dn,_restoreOptimistic:()=>Qe,_runWithTransition:()=>Ot,_setCurrentPageUrl:()=>La,_snapshotCache:()=>O,_streamBoundariesProgressively:()=>Vs,_takeResolveUnit:()=>Hs,_viewTransitionsEnabled:()=>Is,collectChildrenSlots:()=>Ie,disableClientRouter:()=>us,enableClientRouter:()=>Bn,loadFrame:()=>la,longestSharedPath:()=>Ss,navigate:()=>fs,revalidate:()=>ds});function ls(e){return typeof Document<"u"&&typeof Document.parseHTMLUnsafe=="function"?Document.parseHTMLUnsafe(e):typeof DOMParser<"u"?new DOMParser().parseFromString(e,"text/html"):null}function ca(){Rn||typeof MutationObserver>"u"||typeof customElements>"u"||(Rn=new MutationObserver(e=>{for(let t of e)for(let n of t.addedNodes){if(n.nodeType!==1)continue;let r=n;r.tagName?.includes("-")&&customElements.upgrade(r);for(let s of r.querySelectorAll("*"))s.tagName?.includes("-")&&customElements.upgrade(s)}}),Rn.observe(document.body,{childList:!0,subtree:!0}))}function Bn(){X||typeof document>"u"||(X=!0,document.addEventListener("click",ps,!1),document.addEventListener("submit",qn,!1),window.addEventListener("popstate",Un),document.addEventListener("pointerover",Oe,!0),document.addEventListener("focusin",Oe,!0),document.addEventListener("touchstart",Oe,{capture:!0,passive:!0}),document.addEventListener("pointerout",Ns,!0),document.addEventListener("webjs:navigate",Pn),ca(),Pn(),typeof history<"u"&&"scrollRestoration"in history&&(Lt=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(q=location.href))}function us(){X&&(X=!1,document.removeEventListener("click",ps,!1),document.removeEventListener("submit",qn,!1),window.removeEventListener("popstate",Un),document.removeEventListener("pointerover",Oe,!0),document.removeEventListener("focusin",Oe,!0),document.removeEventListener("touchstart",Oe,{capture:!0}),document.removeEventListener("pointerout",Ns,!0),document.removeEventListener("webjs:navigate",Pn),Wt(),Vn(),J&&(J.disconnect(),J=null),typeof history<"u"&&Lt!==null&&(history.scrollRestoration=Lt,Lt=null),q=null)}async function fs(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){location.href=e;return}await Hn(n.href,t?.replace??!1,null)}async function la(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1};M&&M.abort(),M=new AbortController;let s=M.signal,o=++j;return Ft(r.href,n,!1,null,"GET",null,s,o)}function ds(e){if(!e){O.clear(),L.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;O.delete(n),L.delete(n)}function ps(e){if(!X||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=gs(e);if(!t||t.hasAttribute("download")||t.hasAttribute("data-no-router")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin||r.pathname===location.pathname&&r.search===location.search&&r.hash||Ht.test(r.pathname))return;e.preventDefault();let s=Dn(t);Hn(n,!1,s)}function Un(e){Hn(location.href,!0,null)}function qn(e){if(!X||e.defaultPrevented)return;let t=e.target;if(!t||t.nodeType!==1||t.tagName!=="FORM"||t.hasAttribute("data-no-router"))return;let n=e.submitter??null;if(n&&n.hasAttribute("data-no-router"))return;let r=n&&n.getAttribute("formtarget")||t.getAttribute("target")||"";if(r&&r!=="_self")return;let s=hs(t,n);if(s==="dialog")return;let o=ms(t,n),i;try{i=new URL(o,location.href)}catch{return}if(i.origin!==location.origin||Ht.test(i.pathname))return;let c=bs(t,n);e.preventDefault();let a=Dn(n||t);da(i.href,s,c,a,t)}function hs(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function ms(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function bs(e,t){try{return new FormData(e,t||void 0)}catch{let n=new FormData(e);return t&&t.getAttribute("name")&&n.append(t.getAttribute("name"),t.getAttribute("value")||""),n}}function gs(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function ys(e){let t=e;for(;t;){let n=t.closest("webjs-frame");if(n&&n.id)return n.id;let r=t.getRootNode();if(r&&r.host)t=r.host;else break}return null}function Dn(e){if(!e)return null;let t=e.closest&&e.closest("[data-webjs-frame]"),n=t?t.dataset?t.dataset.webjsFrame:t.getAttribute("data-webjs-frame"):null;if(n!=null&&n!==""){if(n===ws)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(_s(`webjs:frame-unresolved:${n}`,`[webjs] data-webjs-frame="${n}" did not match a live <webjs-frame id="${n}">; performing a normal navigation instead.`),null)}return ys(e)}function _s(e,t){On.has(e)||(On.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function is(){if(typeof process<"u"&&process.env||Mn||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;Mn=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&_s("scroll-behavior-smooth-html","[webjs] Detected `scroll-behavior: smooth` on <html>. The client router scrolls to the top instantly on navigation (like a native page load), so route transitions are not affected by it. It still applies to in-page #anchor links. Pairing it with a sticky `backdrop-filter` header can also flash on iOS during navigation.")}function It(e){if(typeof document>"u")return;let t=document.documentElement;if(!(!t||!t.hasAttribute("data-webjs-nav-progress")))try{e?t.setAttribute("data-navigating",""):t.removeAttribute("data-navigating")}catch{}}function Ie(e){let t=new Map,n=[];function r(s){if(s.nodeType===8){let o=s,i=o.data,c=/^wj:children:(.+)$/.exec(i);if(c){n.push({path:c[1],start:o});return}if(i.trim()==="/wj:children"){let a=n.pop();a&&!t.has(a.path)&&t.set(a.path,{start:a.start,end:o});return}return}if(s.hasChildNodes&&s.hasChildNodes())for(let o=s.firstChild;o;o=o.nextSibling)r(o)}return r(e),t}function Ss(e,t){let n=null;for(let r of e.keys())t.has(r)&&(n===null||r.length>n.length)&&(n=r);return n}function As(e){let t=pe(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),O.has(t)&&O.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(O.set(t,n);O.size>ua;){let r=O.keys().next().value;O.delete(r)}}function fa(e){let t=pe(e),n=O.get(t);return n==null?null:(O.delete(t),O.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function pe(e){let t=new URL(e,location.href);return t.pathname+t.search}async function Hn(e,t,n){M&&M.abort(),M=new AbortController;let r=M.signal,s=++j;q&&As(q);let o=setTimeout(()=>{It(!0),o=null},150),i=null;t||(i=Fs());try{if(t){let c=fa(e);if(c){let a=ls(c.html);if(a){$s(a,n,!0,null),typeof window<"u"&&window.scrollTo({left:c.scrollX,top:c.scrollY,behavior:"instant"}),Ft(e,n,!1,i,"GET",null,r,s).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await Ft(e,n,!t,i,"GET",null,r,s)}finally{o&&clearTimeout(o),s===j&&(It(!1),typeof location<"u"&&(q=location.href))}}async function da(e,t,n,r,s){M&&M.abort(),M=new AbortController;let o=M.signal,i=++j,c=t==="get"||t==="head",a=new URL(e,location.href);if(c){a.search="";for(let[b,g]of n)a.searchParams.append(b,typeof g=="string"?g:g.name)}q&&As(q);let l=setTimeout(()=>{It(!0),l=null},150),f=Fs(),d=s?Os(s,i,a.href):null,u=!1;try{let b=await Ft(a.href,r,!0,f,c?"GET":t.toUpperCase(),c?null:n,o,i);u=!!(b&&b.ok),!c&&i===j&&(O.clear(),L.clear())}finally{d&&Ms(d,i,a.href,u),l&&clearTimeout(l),i===j&&(It(!1),typeof location<"u"&&(q=location.href))}}function Es(){return[...Ie(document.body).keys()].join(",")}function Wn(){try{let e=typeof navigator<"u"?navigator.connection:null;if(e&&(e.saveData===!0||typeof e.effectiveType=="string"&&/2g$/.test(e.effectiveType))||typeof matchMedia=="function"&&matchMedia("(prefers-reduced-data: reduce)").matches)return!0}catch{}return!1}function xs(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function ga(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function Pt(e){if(!e||!(e instanceof HTMLAnchorElement)||e.hasAttribute("download")||e.hasAttribute("data-no-router")||e.target&&e.target!=="_self")return null;let t=e.href;if(!t)return null;let n;try{n=new URL(t)}catch{return null}return n.origin!==location.origin||n.pathname===location.pathname&&n.search===location.search&&n.hash||Ht.test(n.pathname)?null:t}function ks(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=ga(e);return t.includes("external")||t.includes("no-prefetch")}function $t(e){if(ks(e))return"none";switch((e.getAttribute("data-prefetch")||"").toLowerCase().trim()){case"false":case"none":return"none";case"true":case"render":return"render";case"auto":case"viewport":return"viewport";case"intent":return"intent";default:return xs()?"intent":"viewport"}}function Pe(e){if(!X||typeof fetch!="function"||Wn())return;let t=pe(e);if(fe.has(t)||et.has(t))return;let n=L.get(t);if(n&&In()-n.at<vs)return;if(fe.size>=Cs){for(et.add(t),Re.push(e);Re.length>ha;){let o=Re.shift();et.delete(pe(o))}return}fe.add(t);let r={"x-webjs-router":"1","x-webjs-prefetch":"1"},s=Es();s&&(r["x-webjs-have"]=s),fetch(e,{method:"GET",headers:r,credentials:"same-origin"}).then(async o=>{let i=o.headers.get("content-type")||"";if(!/^text\/html\b/i.test(i)||o.status>=400)return;let c=o.headers.get("x-webjs-build"),a=o.redirected&&o.url?o.url:e,l=await o.text();wa(t,{html:l,build:c,finalUrl:a,at:In()})}).catch(()=>{}).finally(()=>{fe.delete(t),ya()})}function ya(){for(;Re.length&&fe.size<Cs;){let e=Re.shift();et.delete(pe(e)),Pe(e)}}function wa(e,t){for(L.has(e)&&L.delete(e),L.set(e,t);L.size>pa;){let n=L.keys().next().value;L.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function Ts(e){let t=pe(e),n=L.get(t);return!n||(L.delete(t),In()-n.at>=vs)?null:n}function In(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function Oe(e){if(!X)return;let t=js(e.target);if(!t)return;let n=$t(t);if(n==="none"||n==="render")return;let r=Pt(t);if(r){if(e.type==="touchstart"){Pe(r);return}n==="intent"&&(tt===t&&Le||(Wt(),tt=t,Le=setTimeout(()=>{Le=null,tt=null,Pe(r)},ma)))}}function Ns(e){let t=js(e.target);t&&t===tt&&Wt()}function Wt(){Le&&(clearTimeout(Le),Le=null),tt=null}function Vn(){for(let e of nt)clearTimeout(e);nt.clear(),Ne=new WeakMap}function js(e){let t=e;for(;t;){if(t instanceof HTMLAnchorElement)return t;let n=t.nodeType===1?t:null;if(n){let s=n.closest&&n.closest("a");if(s instanceof HTMLAnchorElement)return s}let r=t.getRootNode?t.getRootNode():null;t=r&&r.host?r.host:null}return null}function Pn(){if(typeof document>"u"||Wn())return;let e=typeof IntersectionObserver<"u";e&&(J?(J.disconnect(),Vn()):J=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(Ne.has(r))continue;let s=setTimeout(()=>{nt.delete(s),Ne.delete(r),J.unobserve(r);let o=Pt(r);o&&$t(r)==="viewport"&&Pe(o)},ba);Ne.set(r,s),nt.add(s)}else{let s=Ne.get(r);s&&(clearTimeout(s),nt.delete(s),Ne.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=$t(t);if(n==="render"){let r=Pt(t);r&&Pe(r)}else n==="viewport"&&e&&J.observe(t)}}function _a(e){if(typeof document>"u"||!document.body)return!1;let t=Ie(document.body),n,r=-1;for(let[a,l]of t)a.length>r&&(r=a.length,n=l);if(!n)return!1;let s=n.start.parentNode;if(!s||n.start.parentNode!==n.end.parentNode)return!1;let o=document.createElement("div");o.setAttribute("role","alert"),o.setAttribute("data-webjs-nav-error","");let i=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";o.textContent=i;let c=document.createRange();return c.setStartAfter(n.start),c.setEndBefore(n.end),c.deleteContents(),s.insertBefore(o,n.end),!0}function Ln(e,t,n){let r=new CustomEvent("webjs:navigation-error",{bubbles:!0,cancelable:!0,detail:{url:e,status:t??null,error:n||null}});if(typeof document<"u")try{document.dispatchEvent(r)}catch{}r.defaultPrevented||_a(t)||typeof location<"u"&&(location.href=e)}async function Ft(e,t,n,r,s,o,i,c){s=s||"GET";let a=typeof c=="number"?c:j,l,f=null,d=null,u=null,b=!1,g=e,m=t?Rs(t,a):null;try{try{let p=s==="GET"&&!o&&!t?Ts(e):null;if(p)l=p.html,d=p.build,g=p.finalUrl,u=200,b=!0;else{let y={"x-webjs-router":"1"},w=Es();w&&(y["x-webjs-have"]=w),t&&(y["x-webjs-frame"]=t),o!=null&&s!=="GET"&&s!=="HEAD"&&(y.accept=os+", text/html");let S={method:s,headers:y,credentials:"same-origin"};i&&(S.signal=i),o!=null&&s!=="GET"&&s!=="HEAD"&&(S.body=o);let A=await fetch(e,S);u=A.status,b=A.ok;let C=A.headers.get("content-type")||"",T=/^text\/html\b/i.test(C);if(C.toLowerCase().indexOf(os)===0){let _=await A.text();return a===j&&(Qe(r),Nn(_)),{ok:b,status:u,aborted:!1}}if(A.redirected&&A.url&&(g=A.url),A.status===204||A.status===205)return a===j&&n&&history.pushState(null,"",g),{ok:b,status:u,aborted:!1};if(!T)return a===j&&(Qe(r),Ln(e,A.status,null)),{ok:!1,status:u,aborted:!1};d=A.headers.get("x-webjs-build");let E=await Ds(A);l=E.shell,E.streaming&&(f=E)}}catch(p){return p&&p.name==="AbortError"?{ok:!1,status:null,aborted:!0}:a!==j?{ok:!1,status:null,aborted:!0}:(Qe(r),Ln(e,null,p instanceof Error?p:new Error(String(p))),{ok:!1,status:null,aborted:!1})}if(a!==j){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:!1,status:u,aborted:!0}}let h=ls(l);if(!h)return Qe(r),Ln(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:u,aborted:!1};if($s(h,t,!1,g,d),n&&history.pushState(null,"",g),n){let p=new URL(g);if(p.hash){let y=document.getElementById(p.hash.slice(1));y?y.scrollIntoView():(is(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else is(),window.scrollTo({left:0,top:0,behavior:"instant"})}return f&&(f.reader||f.rest)&&Vs(f.reader,f.dec,f.rest,()=>a===j),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:g,frameId:t,from:"navigate"}})),{ok:b,status:u,aborted:!1}}finally{m&&Ls(m,a)}}function Rs(e,t){if(typeof document>"u")return null;let n=null;try{n=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{n=document.getElementById(e)}if(!n)return null;let r=Bt.has(n);return Bt.set(n,t),n.setAttribute("aria-busy","true"),r||n.dispatchEvent(new CustomEvent("webjs:frame-busy",{bubbles:!0,detail:{frameId:e,busy:!0}})),n}function Ls(e,t){if(Bt.get(e)!==t)return;Bt.delete(e),e.setAttribute("aria-busy","false");let n=e.id||null;e.dispatchEvent(new CustomEvent("webjs:frame-busy",{bubbles:!0,detail:{frameId:n,busy:!1}}))}function Os(e,t,n){let r=Ut.has(e);return Ut.set(e,t),e.setAttribute("aria-busy","true"),r||e.dispatchEvent(new CustomEvent("webjs:submit-start",{bubbles:!0,detail:{form:e,url:n}})),e}function Ms(e,t,n,r){if(Ut.get(e)!==t)return;Ut.delete(e),e.setAttribute("aria-busy","false");let s=new CustomEvent("webjs:submit-end",{bubbles:!0,detail:{form:e,url:n,ok:!!r}});e.isConnected?e.dispatchEvent(s):typeof document<"u"?document.dispatchEvent(s):e.dispatchEvent(s)}function as(e){if(!e||!e.head)return"";let t=e.head.querySelectorAll('[data-webjs-track="reload"]');if(!t.length)return"";let n="";for(let r of t)n+=de(r);return n}function Is(){if(typeof document>"u")return!1;let e=document.querySelector('meta[name="view-transition"]');return e?(e.getAttribute("content")||"").trim().toLowerCase()==="same-origin":!1}function Ot(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(Is()&&typeof n=="function"){let r=n.call(document,e);r&&r.finished&&typeof r.finished.then=="function"?r.finished.then(()=>{t&&t()}).catch(()=>{}):t&&t();return}e(),t&&t()}function Ps(e,t){if(!e||!t||typeof e.querySelectorAll!="function")return;let n=e.querySelectorAll("[data-webjs-permanent][id]");for(let r of n){let s=r.id;if(!s)continue;let o=null;try{o=t.querySelector(`#${CSS.escape(s)}`)}catch{o=null}if(!o||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let i=o.parentNode;i&&o!==r&&i.replaceChild(r,o)}}function zn(e,t){let n=[];for(let r of e){if(r.nodeType!==1)continue;let s=r;if(s.hasAttribute&&s.hasAttribute("data-webjs-permanent")&&s.id&&n.push(s),typeof s.querySelectorAll=="function")for(let o of s.querySelectorAll("[data-webjs-permanent][id]"))n.push(o)}if(n.length)for(let r of n){let s=r.id;if(!s)continue;let o=Sa(t,s);if(!o||o===r)continue;let i=o.parentNode;if(i)i.replaceChild(r,o);else{let c=t.indexOf(o);c!==-1&&(t[c]=r)}}}function Sa(e,t){for(let n of e){if(n.nodeType!==1)continue;let r=n;if(r.id===t)return r;if(typeof r.querySelector=="function"){let s=null;try{s=r.querySelector(`#${CSS.escape(t)}`)}catch{s=null}if(s)return s}}return null}function Aa(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&je(t)}function $s(e,t,n,r,s){try{Rt(e)}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let f=document.querySelector('script[type="importmap"]'),d=f?f.getAttribute("data-webjs-build"):null,u=!1;if(s&&d&&(u=s!==d),!u&&e.head&&e.head.children.length>0){let b=as(document),g=as(e);b!==g&&(u=!0)}if(u&&typeof location<"u")try{let b="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(b))sessionStorage.removeItem(b);else{sessionStorage&&sessionStorage.setItem(b,"1"),location.href=r;return}}catch{location.href=r;return}else if(!u)try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}if(t){let f=document.querySelector(`webjs-frame#${CSS.escape(t)}`),d=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(f&&d){Fn(e.head),Ot(()=>{Ca(f,d),Dt(f),je(f),Mt()},()=>je(f)),cs(e.body);return}let u=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});(f||document).dispatchEvent(u),u.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`);return}let o=Ie(document.body),i=Ie(e.body),c=Ss(o,i);if(c){Fn(e.head),Ot(()=>{Ea(o.get(c),i.get(c),e),Mt()},()=>Aa(o.get(c))),cs(e.body);return}qs(e.head),Ps(document.body,e.body);let a=[...e.body.childNodes];Ot(()=>{document.body.replaceChildren(...a),Dt(document.body),je(document.body),Mt()},()=>je(document.body))}function Mt(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function Ea(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let s=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)s.push(i);let o=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)o.push(document.importNode(i,!0));zn(s,o),va(r,e.start,e.end,s,o);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(Dt(i),je(i))}function va(e,t,n,r,s){let o=new Map;for(let a of r){if(a.nodeType!==1)continue;let l=Me(a);l&&o.set(l,a)}let i=n,c=[];for(let a of s){if(a.nodeType===1){let l=Me(a);if(l&&o.has(l)){let f=o.get(l);qt(f,a),c.push(f),o.delete(l);continue}}c.push(a)}for(let a of r)if(a.parentNode===e){if(a.nodeType===1&&c.includes(a))continue;e.removeChild(a)}for(let a of c)e.insertBefore(a,i)}function qt(e,t){if(e===t)return;if(e.tagName!==t.tagName){e.replaceWith(t);return}let n=new Set;for(let r of t.attributes)n.add(r.name),!$n.has(r.name)&&e.getAttribute(r.name)!==r.value&&e.setAttribute(r.name,r.value);for(let r of[...e.attributes])$n.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);Kn(e,t)}function Kn(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(c=>document.importNode(c,!0));zn(n,r);let s=new Map;for(let c of n){if(c.nodeType!==1)continue;let a=Me(c);a&&s.set(a,c)}let o=[];for(let c=0;c<r.length;c++){let a=r[c];if(a.nodeType===1){let l=Me(a);if(l&&s.has(l)){let d=s.get(l);qt(d,a),o.push(d),s.delete(l);continue}let f=n[c];if(f&&f.nodeType===1&&!Me(f)&&f.tagName===a.tagName){qt(f,a),o.push(f);continue}}else if(a.nodeType===3){let l=n[c];if(l&&l.nodeType===3){l.nodeValue!==a.nodeValue&&(l.nodeValue=a.nodeValue),o.push(l);continue}}else if(a.nodeType===8){let l=n[c];if(l&&l.nodeType===8){l.nodeValue!==a.nodeValue&&(l.nodeValue=a.nodeValue),o.push(l);continue}}o.push(a)}let i=new Set(o);for(let c of n)!i.has(c)&&c.parentNode===e&&e.removeChild(c);for(let c=0;c<o.length;c++){let a=o[c];(a.parentNode!==e||e.childNodes[c]!==a)&&e.insertBefore(a,e.childNodes[c]||null)}}function Me(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Fs(){let e=Ie(document.body);if(e.size===0)return null;let t=null;for(let i of e.keys())(t===null||i.length>t.length)&&(t=i);if(t===null)return null;let n=document.getElementById(`wj-loading:${t}`);if(!(n instanceof HTMLTemplateElement))return null;let r=e.get(t),s=[];for(let i=r.start.nextSibling;i&&i!==r.end;i=i.nextSibling)s.push(i);let o=document.createRange();return o.setStartAfter(r.start),o.setEndBefore(r.end),o.deleteContents(),r.start.parentNode.insertBefore(n.content.cloneNode(!0),r.end),{slot:r,oldChildren:s,token:j}}function Qe(e){if(!e||e.token!==j)return;let{slot:t,oldChildren:n}=e;if(t.start.parentNode!==t.end.parentNode)return;let r=document.createRange();r.setStartAfter(t.start),r.setEndBefore(t.end),r.deleteContents();for(let s of n)t.start.parentNode.insertBefore(s,t.end)}function Ca(e,t){Kn(e,t)}function Bs(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function Gn(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=Bs();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Us(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=Bs();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function de(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Fn(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(de(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(n.has(de(r))||(r.tagName==="SCRIPT"?document.head.appendChild(Gn(r)):document.head.appendChild(Us(r))))}function qs(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let o of t.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&r.add(de(o));let s=new Set;for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&s.add(de(o));for(let o of[...t.children])o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(s.has(de(o))||o.remove());for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(r.has(de(o))||(o.tagName==="SCRIPT"?t.appendChild(Gn(o)):t.appendChild(Us(o))))}function je(e){typeof customElements>"u"||Yn(e)}function Yn(e){let t=e instanceof Element?[e,...e.querySelectorAll("*")]:[...e.querySelectorAll("*")];for(let n of t)n.tagName&&n.tagName.includes("-")&&(customElements.upgrade(n),n.shadowRoot&&Yn(n.shadowRoot))}function cs(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]"))document.body.appendChild(t.cloneNode(!0))}async function Ds(e){if(!e.body||typeof e.body.getReader!="function")return{shell:await e.text(),streaming:!1};let t=e.body.getReader(),n=new TextDecoder,r="",s="<template data-webjs-resolve",o="<!--wj-stream-shell-->",i=/<\/html\s*>/i;for(;;){let{value:c,done:a}=await t.read();c&&(r+=n.decode(c,{stream:!0})),a&&(r+=n.decode());let l=r.indexOf(o);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:a?null:t,dec:n,rest:r.slice(l+o.length)};let f=r.indexOf(s);if(f!==-1)return{shell:r.slice(0,f),streaming:!0,reader:a?null:t,dec:n,rest:r.slice(f)};if(a)return{shell:r,streaming:!1};let d=i.exec(r);if(d){let u=d.index+d[0].length;return{shell:r.slice(0,u),streaming:!0,reader:t,dec:n,rest:r.slice(u)}}}}function Hs(e){let t=/<template\s+data-webjs-resolve="([^"]+)"\s*>/i.exec(e);if(!t)return null;let n=t[1],r=t.index+t[0].length,s=/<(\/?)template\b[^>]*>/gi;s.lastIndex=r;let o=1,i;for(;i=s.exec(e);)if(i[1]==="/"){if(o--,o===0)return{id:n,content:e.slice(r,i.index),rest:e.slice(i.index+i[0].length)}}else o++;return null}function Ws(e,t){let n=document.getElementById(e);if(!n)return;let r=document.createElement("template");r.innerHTML=t;let s=[...r.content.childNodes];n.replaceWith(r.content);for(let o of s)o.nodeType===1&&Yn(o)}async function Vs(e,t,n,r){let s=n,o=()=>{let i;for(;i=Hs(s);){if(!r())return!1;Ws(i.id,i.content),s=i.rest}return!0};if(!e){o();return}try{for(;;){if(!o()){try{await e.cancel()}catch{}return}let{value:i,done:c}=await e.read();if(i&&(s+=t.decode(i,{stream:!0})),c){s+=t.decode(),o();return}}}catch{}}function Dt(e){for(let t of e.querySelectorAll("script"))t.replaceWith(Gn(t))}function xa(e){return L.get(pe(e))||null}function ka(){return fe.size}function Ta(){L.clear(),fe.clear(),Re.length=0,et.clear(),Wt(),Vn()}function Na(){return j}function ja(){return++j}function Ra(){return q}function La(e){q=e}function Oa(){On.clear(),Mn=!1}function Ma(e){return Ht.test(e)}var os,X,M,j,Rn,q,Lt,Ht,ws,On,Mn,ua,O,pa,vs,Cs,ha,ma,ba,L,fe,Re,et,Le,tt,J,Ne,nt,Bt,Ut,$n,kn=Z(()=>{xn();jt();jt();ts();jn();os="text/vnd.webjs-stream.html";X=!1,M=null,j=0,Rn=null;q=null,Lt=null;Ht=/\.(?:pdf|zip|tar|gz|7z|rar|dmg|exe|msi|deb|rpm|apk|ipa|xlsx?|docx?|pptx?|csv|odt|ods|odp|rtf|epub|mobi|xml|json|rss|atom|txt|md|wasm|mp3|mp4|mov|avi|webm|ogg|flac|wav|m4a|m4v|mkv|png|jpe?g|gif|webp|avif|bmp|ico|svg|tiff?|heic)$/i;ws="_top";On=new Set;Mn=!1;ua=16,O=new Map;pa=8,vs=3e4,Cs=3,ha=24,ma=100,ba=250,L=new Map,fe=new Set,Re=[],et=new Set,Le=null,tt=null,J=null,Ne=new WeakMap,nt=new Set;Bt=new WeakMap;Ut=new WeakMap;$n=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&Bn()});function Gt(e,...t){return{_$webjs:"template",strings:e,values:t}}function N(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var v="wjm-";function Qs(e,...t){let n=e[0];for(let r=1;r<e.length;r++)n+=String(t[r-1]??"")+e[r];return{_$webjsCss:!0,text:n}}function me(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function Yt(e,t){if(!(!t||!t.length))if("adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"){let n=t.map(r=>{let s=new CSSStyleSheet;return s.replaceSync(r.text),s});e.adoptedStyleSheets=n}else{let n=e,r=document.createElement("style");r.textContent=t.map(s=>s.text).join(`
2
2
  `),n.appendChild(r)}}function ot(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
3
- `)}</style>`}var be=Object.freeze({"@":"event",".":"prop","?":"bool"});function nr(e){return Object.prototype.hasOwnProperty.call(be,e)}function it(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function $(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var rr=Symbol.for("webjs.repeat");function sr(e,t,n){return{[rr]:!0,items:[...e],keyFn:t,templateFn:n}}function Q(e){return!!e&&typeof e=="object"&&e[rr]===!0}function Jt(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function ge(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function eo(e){return{_$webjs:"live",value:e}}function ye(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function to(e,t){return{_$webjs:"keyed",key:e,value:t}}function ee(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function no(e,t){return{_$webjs:"guard",deps:e,fn:t}}function te(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function ro(e){return{_$webjs:"template-content",template:e}}function we(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function so(e){return{_$webjs:"ref",target:e}}function ne(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function oo(){return{value:void 0}}function io(e){return{_$webjs:"cache",value:e}}function re(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function ao(...e){return{_$webjs:"until",args:e}}function se(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function co(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function _e(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function lo(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Se(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function uo(e){return{_$webjs:"watch",signal:e}}function oe(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var F=null,W=!1,Ee=0,Ae=null,Xt=0,or=(e,t)=>Object.is(e,t),ct=()=>{},ir=()=>!1;function ar(e,t){e.liveConsumers||(e.liveConsumers=new Set);let n=e.liveConsumers.size===0;if(e.liveConsumers.add(t),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)ar(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function Fe(e,t){if(e.liveConsumers&&(e.liveConsumers.delete(t),e.liveConsumers.size===0)){if(e.producers&&e.producers.length>0)for(let n of e.producers)Fe(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function rn(e){if(W)throw new Error("Signal read during notification phase");if(F===null)return;let t=F,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&en(t)&&Fe(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,en(t)&&ar(e,t)),t.producerLastReadVersions[n]=e.version}function en(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function cr(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=W;W=!0;try{for(let n of e.liveConsumers)n.dirty||fo(n)}finally{W=t}}function fo(e){e.dirty=!0,cr(e),e.consumerMarkedDirty.call(e.wrapper||e)}function lt(e){if(!(!e.dirty&&e.lastCleanEpoch===Ee)){if(!e.producerMustRecompute()&&!po(e)){e.dirty=!1,e.lastCleanEpoch=Ee;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=Ee}}function po(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(lt(n),r!==n.version))return!0}return!1}function tn(e){e&&(e.nextProducerIndex=0);let t=F;return F=e,t}function nn(e,t){if(F=t,!!e){if(en(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)Fe(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var ut=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=Ee,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=ir,this.producerRecomputeValue=ct,this.consumerMarkedDirty=ct,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||or,this.watched=n?.[sn],this.unwatched=n?.[on]}get(){return rn(this),this.__value}peek(){return this.__value}set(t){if(W)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,Ee++,Ae!==null?lr(this):cr(this))}};function lr(e){let t=W;W=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?Ae.add(n):lr(n))}finally{W=t}}var Zt=Symbol("unset"),Qt=Symbol("computing"),at=Symbol("errored"),Be=class{constructor(t,n){this.__fn=t,this.__value=Zt,this.__error=null,this.version=0,this.lastCleanEpoch=-1,this.dirty=!0,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!1,this.wrapper=this,this.__isSignal=!0,this.__isComputed=!0,this.__equal=n?.equals||or,this.watched=n?.[sn],this.unwatched=n?.[on];let r=this;this.producerMustRecompute=function(){return r.__value===Zt||r.__value===Qt},this.producerRecomputeValue=function(){if(r.__value===Qt)throw new Error("Detected cycle in computations.");let s=r.__value;r.__value=Qt;let o=tn(r),i,c=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=at,r.__error=l,c=!0}finally{nn(r,o)}if(!c&&(s!==Zt&&s!==at)&&r.__equal.call(r.wrapper,s,i)){r.__value=s;return}r.__value=i,r.version++},this.consumerMarkedDirty=ct}get(){if(lt(this),rn(this),this.__value===at)throw this.__error;return this.__value}peek(){if(lt(this),this.__value===at)throw this.__error;return this.__value}},ft=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=Ee,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=ir,this.producerRecomputeValue=ct,this.wrapper=this,this.__isWatcher=!0;let n=this;this.consumerMarkedDirty=function(){n.__fire()}}__fire(){this.__notify&&this.__notify.call(this)}watch(...t){if(t.length===0){this.dirty=!1;return}let n=tn(this);try{for(let r of t)rn(r),r.__isComputed&&lt(r)}finally{nn(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(Fe(this.producers[n],this),this.producers.splice(n,1),this.producerLastReadVersions.splice(n,1),this.nextProducerIndex=Math.min(this.nextProducerIndex,this.producers.length))}getPending(){return this.producers.filter(t=>t.__isComputed&&t.dirty)}observe(t){let n=tn(this),r;try{r=t()}finally{nn(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)Fe(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},sn=Symbol("watched"),on=Symbol("unwatched");function ho(e){let t=F;F=null;try{return e()}finally{F=t}}function mo(e){return e.producers.slice()}function bo(e){return e.liveConsumers?[...e.liveConsumers]:[]}function go(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function yo(e){return e.producers.length>0}function wo(){return F&&F.__isComputed?F:null}function _o(e){Xt++,Ae===null&&(Ae=new Set);try{e()}finally{if(Xt--,Xt===0){let t=Ae;Ae=null;for(let n of t)n.__fire()}}}var Ue={State:ut,Computed:Be,subtle:{Watcher:ft,untrack:ho,introspectSources:mo,introspectSinks:bo,hasSinks:go,hasSources:yo,currentComputed:wo,watched:sn,unwatched:on}};function So(e,t){return new ut(e,t)}function Ao(e,t){return new Be(e,t)}function Eo(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function vo(e){let t=!1,n=!1,r=new Be(e),s=new ft(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(o){console.error(o)}s.watch()}}))});s.watch(r);try{r.get()}catch(o){console.error(o)}return()=>{n||(n=!0,s.dispose())}}var Co=`${v}s`,xo=`${v}e`;function ur(e){if(!e||e.nodeType!==8)return!1;let t=e.nodeValue;return t===Co||t===xo}function ko(e){for(let t of e.addedNodes)if(ur(t))return!0;for(let t of e.removedNodes)if(ur(t))return!0;return!1}function mr(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}var De=mr(),ie=Symbol("webjs.slot.state"),V="data-webjs-light",ae="data-projection",He="actual",br="fallback",mt=Symbol("webjs.slot.fallbackFrag"),To=64,qe=null,an=null,dt=null,fr=!1;function No(){fr||(De=mr(),De&&(qe=HTMLSlotElement.prototype.assignedNodes,an=HTMLSlotElement.prototype.assignedElements,dt=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(t){return this.hasAttribute(V)&&!dr(this)?cn(this,t):qe?qe.call(this,t):[]},HTMLSlotElement.prototype.assignedElements=function(t){return this.hasAttribute(V)&&!dr(this)?cn(this,t).filter(n=>n.nodeType===1):an?an.call(this,t):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let t=dt&&dt.get?dt.get.call(this):null;return t||jo(this)}}),fr=!0))}No();function dr(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.host)return!0;t=r}return!1}function cn(e,t){if(e.getAttribute(ae)===br)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:ln(n,new Set,0)}function ln(e,t,n){if(n>=To)return e.slice();let r=[];for(let s of e)if(s.nodeType===1&&s.tagName==="SLOT"){let o=s;if(t.has(o))continue;if(t.add(o),o.hasAttribute(V)){let i=cn(o,{flatten:!1});if(i.length>0)for(let c of ln(i,t,n+1))r.push(c);else for(let c of ln(Array.from(o.childNodes),t,n+1))r.push(c)}else if(qe){let i=qe.call(o,{flatten:!0});for(let c of i)r.push(c)}else r.push(s)}else r.push(s);return r}function jo(e){let t=e.parentElement;for(;t;){if(t.tagName==="SLOT"&&t.hasAttribute(V))return t.getAttribute(ae)===He?t:null;t=t.parentElement}return null}function z(e){let t=e,n=t[ie];return n||(n={assignedByName:new Map,pendingByName:new Map,lastSnapshot:new WeakMap,nameObservers:new WeakMap,childObserver:null,scheduled:!1,ownedSlots:new Set},t[ie]=n),n}function un(e){return!!e[ie]}function gr(e){let t=z(e);for(;e.firstChild;){let n=e.firstChild,r=pt(n);ht(t.assignedByName,r,n),e.removeChild(n)}}function yr(e){let t=z(e),n=e.querySelectorAll(`slot[${V}]`);for(let r of n){let s=r;if(s.getAttribute(ae)!==He)continue;let o=s.getAttribute("name")||null;if(!t.assignedByName.has(o)){let i=Array.from(s.childNodes);t.assignedByName.set(o,i),t.lastSnapshot.set(s,i.slice())}}}function pt(e){if(e.nodeType!==1)return null;let n=e.getAttribute("slot");return n||null}function ht(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function wr(e,t,n){if(!n.length)return;let r=e.get(t);r||(r=[],e.set(t,r));for(let s of n)r.push(s)}function _r(e){if(!De)return;let t=z(e);t.childObserver||(t.childObserver=new MutationObserver(n=>{let r=!1;for(let s of n)if(!ko(s)){if(s.type==="childList"){for(let o of s.addedNodes)o.parentElement===e&&(ht(t.assignedByName,pt(o),o),r=!0);for(let o of s.removedNodes)e.contains(o)||pr(t,o)&&(r=!0)}else if(s.type==="attributes"&&s.attributeName==="slot"){let o=s.target;(pr(t,o)||o.parentElement===e)&&(ht(t.assignedByName,pt(o),o),r=!0)}}r&&bt(e)}),t.childObserver.observe(e,{childList:!0,attributes:!0,attributeFilter:["slot"],subtree:!0}))}function Sr(e){let t=e[ie];if(t){t.childObserver&&(t.childObserver.disconnect(),t.childObserver=null);for(let n of t.ownedSlots){let r=t.nameObservers.get(n);r&&(r.disconnect(),t.nameObservers.delete(n))}}}function pr(e,t){for(let[n,r]of e.assignedByName){let s=r.indexOf(t);if(s!==-1)return r.splice(s,1),r.length===0&&e.assignedByName.delete(n),!0}return!1}function bt(e){let t=z(e);t.scheduled||(t.scheduled=!0,queueMicrotask(()=>{t.scheduled=!1,Ro(e)}))}function Ro(e){if(!De)return;let t=e[ie];if(!t)return;let n=Array.from(e.querySelectorAll(`slot[${V}]`)),r=new Set(n);for(let i of t.ownedSlots)r.has(i)||Lo(t,i);for(let i of r)t.ownedSlots.has(i)||Io(e,i);t.ownedSlots=r;let s=new Map;for(let i of n){let c=i.getAttribute("name")||null,a=s.get(c);a||(a=[],s.set(c,a)),a.push(i)}for(let i of s.keys()){let c=t.pendingByName.get(i);if(c&&c.length){let a=t.assignedByName.get(i)||[],l=[];for(let f of c)l.push(f);for(let f of a)l.indexOf(f)===-1&&l.push(f);t.assignedByName.set(i,l),t.pendingByName.delete(i)}}let o=[];for(let[i,c]of s){let a=t.assignedByName.get(i)||[];for(let l=0;l<c.length;l++){let f=c[l];l===0&&a.length>0?Oo(t,f,a)&&o.push(f):Mo(t,f)&&o.push(f)}}for(let i of o)Po(i)}function Lo(e,t){let n=e.nameObservers.get(t);n&&(n.disconnect(),e.nameObservers.delete(t));let r=e.lastSnapshot.get(t);if(r&&r.length>0){let s=t.getAttribute("name")||null;wr(e.pendingByName,s,r)}e.lastSnapshot.delete(t)}function Oo(e,t,n){let r=t.getAttribute(ae)!==He,s=e.lastSnapshot.get(t)||[];if(!r&&$o(s,n))return!1;let i=t[mt];if(r&&i)for(;t.firstChild;)i.appendChild(t.firstChild);else for(;t.firstChild;)t.removeChild(t.firstChild);for(let c of n)t.appendChild(c);return t.setAttribute(ae,He),e.lastSnapshot.set(t,n.slice()),!0}function Mo(e,t){let n=t.getAttribute(ae)===He;if(t.setAttribute(ae,br),!n)return hr(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return hr(t),!0}function hr(e){let t=e[mt];!t||t.childNodes.length===0||e.appendChild(t)}function Io(e,t){if(!De)return;let n=z(e);if(n.nameObservers.has(t))return;let r=new MutationObserver(()=>bt(e));r.observe(t,{attributes:!0,attributeFilter:["name"]}),n.nameObservers.set(t,r)}function Ar(e,t){if(!un(e))return;let n=z(e),r=n.lastSnapshot.get(t);if(!r||r.length===0)return;let s=t.getAttribute("name")||null;for(let i of r)i.parentNode===t&&t.removeChild(i);wr(n.pendingByName,s,r),n.lastSnapshot.delete(t);let o=n.nameObservers.get(t);o&&(o.disconnect(),n.nameObservers.delete(t)),n.ownedSlots.delete(t)}function Po(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function $o(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var Er=new WeakMap,fn=Symbol.for("webjs.instance");function xe(e,t){let n=t,r=n[fn];if(N(e)){let s=e;if(r&&r.strings===s.strings){ve(r,s.values);return}r&&vr(r,t);let o=t.firstChild;o&&o.nodeType===8&&o.data==="webjs-hydrate"&&o.remove();let i=Uo(s,t);n[fn]=i;return}if(r&&vr(r,t),n[fn]=null,t.replaceChildren(),!(e==null||e===!1||e===!0)){if(Array.isArray(e)){for(let s of e){let o=document.createTextNode(String(s??""));t.appendChild(o)}return}t.appendChild(document.createTextNode(String(e)))}}function yt(e){let{strings:t}=e,n=Er.get(t);if(n)return n;let r=[],s="",o="text",i="",c=0,a="",l=0,f=null,d="",u="";for(let g=0;g<t.length;g++){let m=t[g];for(let h=0;h<m.length;h++){let p=m[h];switch(o){case"text":s+=p,p==="<"&&(o="tag-open");break;case"tag-open":s+=p,p==="!"?o="bang-1":p==="/"?(o="tag-name",d=""):/[a-zA-Z]/.test(p)?(o="tag-name",d=p.toLowerCase()):o="text";break;case"bang-1":s+=p,o=p==="-"?"bang-dash":"tag-name";break;case"bang-dash":s+=p,p==="-"?(o="comment",l=0):o="tag-name";break;case"comment":s+=p,p==="-"?l+=1:(p===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":s+=p,p===">"?(o=d==="script"||d==="style"?"rawtext":"text",o==="rawtext"&&(u="")):/\s/.test(p)?o="in-tag":d+=p.toLowerCase();break;case"in-tag":s+=p,p===">"?(o=d==="script"||d==="style"?"rawtext":"text",o==="rawtext"&&(u="")):!/\s/.test(p)&&p!=="/"&&(o="attr-name",i=p,c=s.length-1);break;case"rawtext":s+=p,u=(u+p.toLowerCase()).slice(-9),(u.endsWith("<\/script>")||u.endsWith("</style>"))&&(o="text",u="",d="");break;case"attr-name":p==="="?(o="after-eq",s+=p):/\s/.test(p)?(o="in-tag",i="",s+=p):p===">"?(o="text",i="",s+=p):(i+=p,s+=p);break;case"after-eq":p==='"'||p==="'"?(o="attr-quoted",a=p,s+=p):/\s/.test(p)?(o="in-tag",i="",s+=p):p===">"?(o="text",i="",s+=p):(o="attr-unquoted",s+=p);break;case"attr-unquoted":/\s/.test(p)?(o="in-tag",i="",s+=p):(p===">"&&(o="text",i=""),s+=p);break;case"attr-quoted":s+=p,p===a&&(o="in-tag",i="");break;case"skip-attr":if(p===a){if(f){let y=f.firstPartIdx,w=[];for(let E=y;E<r.length;E++)(r[E].kind==="noop"||r[E].kind==="attr-mixed")&&w.push(E);let S=[],A=t[w[0]],C=A.lastIndexOf(a);S.push(C>=0?A.slice(C+1):A);for(let E=1;E<w.length;E++)S.push(t[w[E]]);let T=t[w[w.length-1]+1],I=T.indexOf(a);S.push(I>=0?T.slice(0,I):T),r[y]={kind:"attr-mixed",path:[],name:f.name,statics:S,group:w},f=null}o="in-tag",i=""}break}}if(g<t.length-1){let h=r.length;if(o==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(o==="rawtext"){u="",r.push({kind:"noop",path:[]});continue}if(o==="text")s+=`<!--${v}${h}-->`,r.push({kind:"child",path:[]});else if(o==="in-tag"){let p=`data-${v}${h}`;s+=`${p}=""`,r.push({kind:"element",path:[]})}else if(o==="after-eq"){let p=i[0],y=i.slice(1);if(nr(p)){s=s.slice(0,c);let w=be[p],S=`data-${v}${h}`;s+=`${S}=""`,r.push({kind:w,path:[],name:y})}else{s=s.slice(0,c);let w=`data-${v}${h}`;s+=`${w}=""`,r.push({kind:"attr",path:[],name:i})}o="in-tag",i=""}else if(o==="attr-quoted"||o==="attr-unquoted"){s=s.slice(0,c);let p=`data-${v}${h}`;s+=`${p}=""`,f={name:i,firstPartIdx:h},r.push({kind:"noop",path:[]}),o="skip-attr"}else o==="skip-attr"&&r.push({kind:"noop",path:[]})}}let b=document.createElement("template");return b.innerHTML=s,Fo(b.content,r),Bo(b.content,r),n={templateEl:b,parts:r},Er.set(t,n),n}function Fo(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(V,"");let s=t.length;r.setAttribute(`data-${v}${s}`,""),t.push({kind:"slot",path:[]})}}function Bo(e,t){let n=[];function r(s){for(let o=0;o<s.childNodes.length;o++){let i=s.childNodes[o];if(n.push(o),i.nodeType===8){let c=i.data;if(c.startsWith(v)){let a=Number(c.slice(v.length));t[a]&&t[a].kind==="child"&&(t[a].path=n.slice())}}else if(i.nodeType===1){let c=i,a=[];for(let l of c.attributes)if(l.name.startsWith(`data-${v}`)){let f=Number(l.name.slice(`data-${v}`.length));t[f]&&t[f].kind!=="child"&&(t[f].path=n.slice()),a.push(l.name)}for(let l of a)c.removeAttribute(l);r(i)}n.pop()}}r(e)}function Uo(e,t){let{templateEl:n,parts:r}=yt(e),s=n.content.cloneNode(!0),o=document.createComment(`${v}s`),i=document.createComment(`${v}e`),c=r.map(l=>wt(l,s)),a=[];for(let l=0;l<e.values.length;l++)ce(c[l],e.values[l],void 0,e.values),a.push(e.values[l]);t.replaceChildren(o,...s.childNodes,i);for(let l of c)l.kind==="slot"&&ce(l,void 0,void 0,[]);return{strings:e.strings,bound:c,lastValues:a,startNode:o,endNode:i}}function wt(e,t){if(e.kind==="noop")return{kind:"noop"};let n=t;for(let s of e.path)n=n.childNodes[s];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let s={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(o){s.handler?.(o)}};return r.addEventListener(s.name,s.dispatcher),s}if(e.kind==="attr")return{kind:"attr",el:r,name:e.name||""};if(e.kind==="attr-mixed")return{kind:"attr-mixed",el:r,name:e.name||"",statics:e.statics||[],group:e.group||[]};if(e.kind==="prop")return{kind:"prop",el:r,name:e.name||""};if(e.kind==="bool")return{kind:"bool",el:r,name:e.name||""};if(e.kind==="element")return{kind:"element",el:r};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}function ve(e,t){for(let n=0;n<t.length;n++){let r=t[n];Object.is(r,e.lastValues[n])||(ce(e.bound[n],r,e.lastValues[n],t),e.lastValues[n]=r)}}function vr(e,t){for(let n of e.bound){if(n.kind==="event"&&n.el.removeEventListener(n.name,n.dispatcher),n.kind==="element"){let r=n.lastTarget;if(r){if(typeof r=="function")try{r(void 0)}catch{}else typeof r=="object"&&(r.value=void 0);n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=dn(n.slotEl);r&&Ar(r,n.slotEl)}}t.replaceChildren()}function ce(e,t,n,r){if(ye(t)){let s=t.value;if(e.kind==="prop"&&e.el[e.name]===s||e.kind==="attr"&&e.el.getAttribute(e.name)===String(s)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!s)return;t=s}switch(e.kind){case"child":Ho(e,t);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):e.el.setAttribute(e.name,String(t));break}case"prop":e.el[e.name]=t;break;case"bool":t?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":e.handler=typeof t=="function"?t:null;break;case"element":Do(e,t);break;case"attr-mixed":{let s=e,o=s.statics[0];for(let i=0;i<s.group.length;i++)o+=String((r?r[s.group[i]]:t)??""),o+=s.statics[i+1]||"";e.el.setAttribute(e.name,o);break}case"slot":{if(e.applied)break;let s=e.slotEl,o=()=>{e.applied=!0;let c=dn(s);if(!c||qo(s))return;let a=document.createDocumentFragment();for(;s.firstChild;)a.appendChild(s.firstChild);s[mt]=a,bt(c)};dn(s)?o():queueMicrotask(o);break}case"noop":break}}function dn(e){let t=e.parentElement;for(;t;){if(t[ie])return t;t=t.parentElement}return null}function qo(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.host)return!0;t=r}return!1}function Do(e,t){let n=e,r=ne(t)?t.target:void 0,s=n.__refTarget,o=r!==s;if(o&&s)if(typeof s=="function")try{s(void 0)}catch{}else typeof s=="object"&&(s.value=void 0);if(o||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!o&&n.__refElement!==void 0)try{r(void 0)}catch{}try{r(e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function Ho(e,t){return Zo(e,t),B(e,t)}function B(e,t){let n=e.marker;if(ge(t)){K(e);let s=String(t.value??""),o=document.createElement("template");o.innerHTML=s;let i=[...o.content.childNodes],c=document.createDocumentFragment();for(let a of i)c.appendChild(a);n.parentNode?.insertBefore(c,n),e.child=i;return}if(ee(t)){let s=t,o=e.__keyedKey;o!==void 0&&!Object.is(o,s.key)&&K(e),e.__keyedKey=s.key,B(e,s.value);return}if(te(t)){let s=t,o=e.__guardDeps,i=s.deps;if(o!==void 0&&(Array.isArray(o)&&Array.isArray(i)?Xo(o,i):Object.is(o,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,B(e,s.fn());return}if(we(t)){K(e);let s=t.template;if(s&&s.content){let o=s.content.cloneNode(!0),i=[...o.childNodes];n.parentNode?.insertBefore(o,n),e.child=i}return}if(ne(t))return;if(re(t))return Qo(e,t.value);if(se(t))return ei(e,t.args);if(oe(t))return ti(e,t.signal);if(_e(t))return ni(e,t);if(Se(t))return ri(e,t);if(Q(t)){if(e.child&&e.child.kind==="repeat"){zo(e,t);return}K(e);let s={kind:"repeat",map:new Map};e.child=s,Vo(n,s,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){Yo(e,t);return}K(e);let s={kind:"array",items:[]};e.child=s,Go(n,s,t);return}if(e.child){let s=e.child;if(s.kind==="repeat")Cr(s),e.child=void 0;else if(s.kind==="array")kr(s),e.child=void 0;else if(s.kind==="async-stream")Rr(s),e.child=void 0;else if("strings"in e.child){let o=e.child;if(N(t)&&o.strings===t.strings){ve(o,t.values);return}Ce(o.startNode,o.endNode),e.child=void 0}else{for(let o of e.child)o.parentNode&&o.parentNode.removeChild(o);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(N(t)){let s=t,{templateEl:o,parts:i}=yt(s),c=o.content.cloneNode(!0),a=document.createComment(`${v}s`),l=document.createComment(`${v}e`),f=i.map(b=>wt(b,c)),d=[];for(let b=0;b<s.values.length;b++)ce(f[b],s.values[b],void 0,s.values),d.push(s.values[b]);let u=[a,...c.childNodes,l];n.parentNode?.insertBefore(Wo(u),n);for(let b of f)b.kind==="slot"&&ce(b,void 0,void 0,[]);e.child={strings:s.strings,bound:f,lastValues:d,startNode:a,endNode:l};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function Wo(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function Ce(e,t){if(!e.parentNode)return;let n=e;for(;n&&n!==t;){let r=n.nextSibling;n.parentNode?.removeChild(n),n=r}t.parentNode===e.parentNode&&t.parentNode?.removeChild(t)}function hn(e){let{templateEl:t,parts:n}=yt(e),r=t.content.cloneNode(!0),s=document.createComment(`${v}s`),o=document.createComment(`${v}e`),i=n.map(l=>wt(l,r)),c=[];for(let l=0;l<e.values.length;l++)ce(i[l],e.values[l],void 0,e.values),c.push(e.values[l]);let a=document.createDocumentFragment();for(a.appendChild(s);r.firstChild;)a.appendChild(r.firstChild);return a.appendChild(o),{inst:{strings:e.strings,bound:i,lastValues:c,startNode:s,endNode:o},frag:a}}function We(e){for(let t of e.bound)if(t.kind==="event"&&t.el.removeEventListener(t.name,t.dispatcher),t.kind==="element"){let n=t.lastTarget;if(n){if(typeof n=="function")try{n(void 0)}catch{}else typeof n=="object"&&(n.value=void 0);t.lastTarget=void 0,t.__lastEl=void 0}}}function Vo(e,t,n){let{items:r,keyFn:s,templateFn:o}=n,i=e.parentNode;if(!i)return;let c=document.createDocumentFragment();for(let a=0;a<r.length;a++){let l=s(r[a],a),f=o(r[a],a);if(!N(f))continue;let{inst:d,frag:u}=hn(f);t.map.set(l,d),c.appendChild(u)}i.insertBefore(c,e)}function zo(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let s=e.child,{items:o,keyFn:i,templateFn:c}=t,a=new Map;for(let l=0;l<o.length;l++){let f=i(o[l],l),d=c(o[l],l);if(!N(d))continue;let u=s.map.get(f);if(u&&u.strings===d.strings)ve(u,d.values),pn(u.startNode,u.endNode,r,n),a.set(f,u),s.map.delete(f);else{u&&(We(u),Ce(u.startNode,u.endNode),s.map.delete(f));let{inst:b,frag:g}=hn(d);r.insertBefore(g,n),a.set(f,b)}}for(let l of s.map.values())We(l),Ce(l.startNode,l.endNode);s.map=a}function Cr(e){for(let t of e.map.values())We(t),Ce(t.startNode,t.endNode);e.map.clear()}function Ko(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function gt(e){e.type==="tpl"?(We(e.inst),Ce(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function xr(e){if(N(e)){let{inst:t,frag:n}=hn(e);return{item:{type:"tpl",inst:t},frag:n}}if(e!=null&&e!==!1&&e!==!0){let t=document.createTextNode(String(e));return{item:{type:"text",node:t},frag:t}}return{item:{type:"empty"},frag:null}}function Go(e,t,n){let r=e.parentNode;if(!r)return;let s=document.createDocumentFragment(),o=[];for(let i of n){let{item:c,frag:a}=xr(i);a&&s.appendChild(a),o.push(c)}r.insertBefore(s,e),t.items=o}function Yo(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let s=e.child,o=s.items,i=[];for(let c=0;c<t.length;c++){let a=t[c],l=o[c];if(N(a)){let u=a;if(l&&l.type==="tpl"&&l.inst.strings===u.strings){ve(l.inst,u.values),i.push(l);continue}}else if(a!=null&&a!==!1&&a!==!0){if(l&&l.type==="text"){let u=String(a);l.node.data!==u&&(l.node.data=u),i.push(l);continue}}else{l&&gt(l),i.push({type:"empty"});continue}let{item:f,frag:d}=xr(a);d&&r.insertBefore(d,Jo(o,c,n)),l&&gt(l),i.push(f)}for(let c=t.length;c<o.length;c++)gt(o[c]);s.items=i}function Jo(e,t,n){for(let r=t;r<e.length;r++){let s=Ko(e[r]);if(s&&s.parentNode)return s}return n}function kr(e){for(let t of e.items)gt(t);e.items=[]}function pn(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let s=document.createDocumentFragment(),o=e;for(;o;){let i=o.nextSibling;if(s.appendChild(o),o===t)break;o=i}n.insertBefore(s,r)}function Xo(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function K(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Tr(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Cr(n);else if(n.kind==="array")kr(n);else if(n.kind==="async-stream")Rr(n);else if("strings"in n){let r=e.child;We(r),Ce(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Zo(e,t){let n=e;n.__untilState&&!se(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!te(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!re(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!ee(t)&&(n.__keyedKey=void 0),n.__watchSub&&!oe(t)&&Tr(n)}function Qo(e,t){let n=e.marker,r=e,s=r.__cacheMap;s||(s=new Map,r.__cacheMap=s);let o=e.child;if(o&&"strings"in o){let c=o;if(N(t)&&c.strings===t.strings){ve(c,t.values);return}let a=document.createDocumentFragment();pn(c.startNode,c.endNode,a,null),s.set(c.strings,{inst:c,holder:a}),e.child=void 0}if(N(t)){let c=t,a=s.get(c.strings);if(a){s.delete(c.strings),e.child&&K(e),pn(a.inst.startNode,a.inst.endNode,n.parentNode,n),ve(a.inst,c.values),e.child=a.inst;return}}B(e,t)}function ei(e,t){let n=e,r=n.__untilState,s=n.__untilArgs,o=(u,b)=>!!(Object.is(u,b)||N(u)&&N(b)&&u.strings===b.strings),c=s&&s.length===t.length&&s.every((u,b)=>o(u,t[b]))&&r?r.highestResolved:1/0;r&&(r.aborted=!0),n.__untilArgs=t.slice();let a={aborted:!1,highestResolved:c};n.__untilState=a;let l=-1,f;for(let u=0;u<t.length;u++){let b=t[u];if(!b||typeof b.then!="function"){l=u,f=b;break}}l!==-1&&l<=a.highestResolved?(B(e,f),a.highestResolved=l):l===-1&&!n.__untilEverRendered&&B(e,""),n.__untilEverRendered=!0;let d=Math.min(l===-1?t.length:l,a.highestResolved);for(let u=0;u<d;u++){let b=t[u];!b||typeof b.then!="function"||Promise.resolve(b).then(g=>{a.aborted||u>=a.highestResolved||(a.highestResolved=u,B(e,g))},()=>{})}}function ti(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let o;n.__watchSub.observe(()=>{o=t.get()}),B(e,o);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new Ue.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let o;r.observe(()=>{o=t.get()}),B(e,o)})});n.__watchSub=r;let s;r.observe(()=>{s=t.get()}),B(e,s)}function Tr(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function ni(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;K(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,Nr(s,e,t)}function ri(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;K(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,Nr(s,e,t)}async function Nr(e,t,n){let r=t.marker,s=0;try{for(;!e.aborted;){let o=await e.iterator.next();if(e.aborted||o.done)break;let i=n.mapper?n.mapper(o.value,s):o.value,c=jr(i);if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let a=document.createDocumentFragment();for(let l of c)a.appendChild(l);r.parentNode?.insertBefore(a,r),e.nodes.push(...c),s++}}catch(o){typeof console<"u"&&console.error("[webjs] asyncStream error:",o)}}function jr(e){if(e==null||e===!1||e===!0)return[];if(N(e)){let t=e,{templateEl:n,parts:r}=yt(t),s=n.content.cloneNode(!0),o=r.map(i=>wt(i,s));for(let i=0;i<t.values.length;i++)ce(o[i],t.values[i],void 0,t.values);return[...s.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...jr(n));return t}return[document.createTextNode(String(e))]}function Rr(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}var Lr=null;function _t(e){Lr=e||null}function si(){return Lr||void 0}var Or=Symbol.for("webjs:registry"),Mr=Symbol.for("webjs:classToTag"),St=globalThis,U=St[Or]||(St[Or]=new Map),Ir=St[Mr]||(St[Mr]=new WeakMap),At=typeof window<"u"&&typeof customElements<"u";function mn(e,t){if(!e||typeof e!="string"||!e.includes("-"))throw new Error(`customElements.define: tag "${e}" must contain a hyphen (HTML spec)`);let n=t.lazy===!0,r=U.get(e);r?(r.cls=t,r.lazy=n):U.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),Ir.set(t,e)}if(At){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),mn(t,n)}}if(!At){let e=globalThis;e.customElements||(e.customElements={define(t,n){mn(t,n)},get(t){return U.get(t)?.cls},upgrade(){},whenDefined(t){let n=U.get(t);return Promise.resolve(n?.cls)}})}function bn(e,t){At?customElements.define(e,t):mn(e,t)}function oi(e,t){if(At)return;let n=U.get(e);if(n){n.moduleUrl=t;return}U.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function gn(e){return U.get(e)?.cls}function ii(e){return U.get(e)?.moduleUrl||null}function ai(e){return U.get(e)?.lazy===!0}function Et(e){return Ir.get(e)}function yn(){return[...U.keys()]}ke();var Dr=typeof window<"u"&&typeof HTMLElement<"u";function _i(e,t){return e!==t}function Si(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var vt=class{constructor(){this.__ssrAttrs=new Map,this.__internals=null}get attributes(){return[...this.__ssrAttrs].map(([t,n])=>({name:t,value:n}))}getAttribute(t){let n=this.__ssrAttrs.get(String(t).toLowerCase());return n===void 0?null:n}setAttribute(t,n){this.__ssrAttrs.set(String(t).toLowerCase(),String(n))}removeAttribute(t){this.__ssrAttrs.delete(String(t).toLowerCase())}hasAttribute(t){return this.__ssrAttrs.has(String(t).toLowerCase())}toggleAttribute(t,n){let r=String(t).toLowerCase(),s=this.__ssrAttrs.has(r);return(n===void 0?!s:n)?(this.__ssrAttrs.set(r,""),!0):(this.__ssrAttrs.delete(r),!1)}getAttributeNames(){return[...this.__ssrAttrs.keys()]}closest(t){let n=String(t).trim().toLowerCase();if(!/^[a-z][a-z0-9-]*$/.test(n))return null;if(this.__ssrTag===n)return this;let r=this.__ssrAncestors;if(!Array.isArray(r))return null;for(let s=r.length-1;s>=0;s--)if(r[s]&&r[s].__ssrTag===n)return r[s];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,s=>"-"+s.toLowerCase());return this.__dataset=new Proxy({},{get(r,s){if(typeof s!="string")return;let o=t.getAttribute(n(s));return o===null?void 0:o},set(r,s,o){return typeof s=="string"&&t.setAttribute(n(s),o),!0},has(r,s){return typeof s=="string"&&t.hasAttribute(n(s))},deleteProperty(r,s){return typeof s=="string"&&t.removeAttribute(n(s)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(s,o)=>o.toUpperCase()))},getOwnPropertyDescriptor(r,s){if(typeof s=="string"&&t.hasAttribute(n(s)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(s))}}}),this.__dataset}get className(){return this.getAttribute("class")??""}set className(t){this.setAttribute("class",t)}get hidden(){return this.hasAttribute("hidden")}set hidden(t){this.toggleAttribute("hidden",!!t)}get id(){return this.getAttribute("id")??""}set id(t){this.setAttribute("id",t)}get title(){return this.getAttribute("title")??""}set title(t){this.setAttribute("title",t)}get slot(){return this.getAttribute("slot")??""}set slot(t){this.setAttribute("slot",t)}get role(){return this.getAttribute("role")}set role(t){t==null?this.removeAttribute("role"):this.setAttribute("role",t)}get tabIndex(){let t=this.getAttribute("tabindex");return t===null?-1:Number.parseInt(t,10)||0}set tabIndex(t){this.setAttribute("tabindex",String(t))}addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return this.__internals=Si(),this.__internals}},Ai=["ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDescription","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"];for(let e of Ai){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(vt.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var Ei=Dr?HTMLElement:vt,Hr=Symbol("webjs.factoryProps"),Ur=new WeakSet,Te=class e extends Ei{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){bn(t,this)}static get observedAttributes(){let t=this.properties||{};return Object.keys(t).filter(n=>!(typeof t[n]=="object"&&t[n].state)).map(n=>typeof t[n]=="object"&&t[n].attribute||wn(n))}constructor(){super(),this._renderRoot=null,this._scheduled=!1,this._connected=!1,this.__controllers=new Set,this.__firstRendered=!1,this._changedProperties=new Map,this._updateResolve=null,this._updatePromise=Promise.resolve(!0),this._isUpdating=!1,this._assertFactoryProperties(),this._initializeProperties()}_assertFactoryProperties(){let t=this.constructor;if(Ur.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,Hr)){let r=n.name||"a component";throw new Error(`${r}: \`static properties\` is no longer supported. Declare reactive properties via the factory instead: \`class ${r} extends WebComponent({ count: Number })\`. Use the \`prop()\` helper for options (\`prop(Number, { reflect: true })\`) and set defaults in the constructor after \`super()\`. See https://docs.webjs.com/docs/components.`)}n=Object.getPrototypeOf(n)}Ur.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,s]of Object.entries(n)){let o=typeof s=="object"?s:{type:s},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:c=>{let a=this.__propValues[r];(o.hasChanged||_i)(c,a)&&(this.__propValues[r]=c,o.reflect&&!o.state&&this._connected&&this._reflectAttribute(r,c,o),this.requestUpdate(r,a))}}),i!==void 0?this.__propValues[r]=i:o.default!==void 0&&(this.__propValues[r]=typeof o.default=="function"?o.default():o.default)}}}_reflectAttribute(t,n,r){let s=r.attribute||wn(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let o=r.converter.toAttribute(n,r.type);o==null?this.removeAttribute(s):this.setAttribute(s,o)}else r.type===Boolean?n?this.setAttribute(s,""):this.removeAttribute(s):n==null?this.removeAttribute(s):r.type===Object||r.type===Array?this.setAttribute(s,JSON.stringify(n)):this.setAttribute(s,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!Dr)return;if(this.__webjsPropsHydrated||(this.__webjsPropsHydrated=!0,this._hydratePropAttrs()),this.constructor.hydrate==="visible"&&typeof IntersectionObserver<"u"&&!this.__hydrationActivated){this.__hydrationActivated=!1,this.__hydrationObserver=new IntersectionObserver(n=>{for(let r of n)if(r.isIntersecting){this.__hydrationObserver.unobserve(this),this.__hydrationObserver.disconnect(),this.__hydrationObserver=null,this.__hydrationActivated=!0,this._activate();return}},{rootMargin:"200px"}),this.__hydrationObserver.observe(this);return}this._activate()}_hydratePropAttrs(){let t=[],n=this.attributes;for(let r=0;r<n.length;r++){let s=n[r].name;s.startsWith("data-webjs-prop-")&&t.push(s)}for(let r of t){let s=this.getAttribute(r);if(this.removeAttribute(r),s==null)continue;let o=qr(r.slice(16));try{this[o]=D(s)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,s=Array.isArray(r)?r:me(r)?[r]:[];if(s.length){if(n){let o=this.shadowRoot.querySelector("style");o&&o.remove()}Yt(this._renderRoot,s)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${Et(t)||this.tagName?.toLowerCase()}> has static shadow = false AND static styles. static styles only works with shadow DOM (adoptedStyleSheets). For light DOM, use global CSS or <style> in render().`),un(this)||(this.__isHydrating()?(z(this),yr(this)):gr(this));for(let n of this.__controllers)n.hostConnected&&n.hostConnected();this._updateResolve===null&&(this._updatePromise=new Promise(n=>{this._updateResolve=n})),this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(n){console.error("[webjs] lifecycle hook threw during initial render:",n)}this._renderRoot===this&&_r(this)})}__isHydrating(){let t=this.firstChild,n=t!=null&&t.nodeType===8&&t.data==="webjs-hydrate";return n&&(this.__hydratedAtActivate=!0),n}disconnectedCallback(){this._connected=!1,this.__hydrationObserver&&(this.__hydrationObserver.disconnect(),this.__hydrationObserver=null),this._renderRoot===this&&Sr(this),this.__signalWatcher&&(this.__signalWatcher.dispose(),this.__signalWatcher=void 0);for(let t of this.__controllers)t.hostDisconnected&&t.hostDisconnected()}attributeChangedCallback(t,n,r){if(this.__reflectingAttribute)return;let o=this.constructor.properties||{},i,c;for(let[f,d]of Object.entries(o))if(((typeof d=="object"?d:{type:d}).attribute||wn(f))===t){i=f,c=d;break}if(c===void 0&&(i=qr(t),c=o[i]||o[t]),c===void 0)return;let a=typeof c=="object"?c:{type:c},l;if(a.converter&&a.converter.fromAttribute)l=a.converter.fromAttribute(r,a.type);else if(a.type===Number)l=r==null?null:Number(r);else if(a.type===Boolean)l=r!=null&&r!=="false";else if(a.type===Object||a.type===Array)try{l=r==null?null:JSON.parse(r)}catch{l=r}else l=r;this[i]!==l&&(this[i]=l,this._connected&&this.requestUpdate())}requestUpdate(t,n){t!==void 0&&!this._changedProperties.has(t)&&this._changedProperties.set(t,n),this._scheduleUpdate()}_scheduleUpdate(){this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),!this._isUpdating&&(this._scheduled||!this._connected||(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(t){console.error("[webjs] lifecycle hook threw during update cycle:",t)}})))}_performRender(){if(!this._renderRoot)return;let t=this._changedProperties;this._isUpdating=!0;let n=!1,r=null;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let s of this.__controllers)s.hostUpdate&&s.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,_t(this.__renderAbort?this.__renderAbort.signal:null);try{let s=this.update(t);s&&typeof s.then=="function"&&(r=s)}catch(s){this._handleRenderError(s)}finally{_t(null)}if(!r){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();n=!0}}}catch(s){console.error("[webjs] lifecycle hook threw during update phase:",s)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let s=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1,r.then(()=>{if(this.__pendingAsyncCommits--,s===this.__renderToken){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();this._postCommit(t)}});return}n?this._postCommit(t):this.__pendingAsyncCommits||this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers)n.hostUpdate&&n.hostUpdate();this._reflectDeclaredAttributes()}finally{this._isUpdating=!1}}_reflectDeclaredAttributes(){let t=this.constructor.properties||{};for(let n of Object.keys(t)){let r=t[n];!r||!r.reflect||r.state||this._reflectAttribute(n,this[n],r)}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new Ue.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);xe(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&xe(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{n===this.__renderToken&&xe(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==Ct.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${Et(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&xe(n,this._renderRoot)}catch(n){console.error("[webjs] renderError() also threw:",n)}}_postCommit(t){try{this.__firstRendered||(this.__firstRendered=!0,this.firstUpdated(t)),this.updated(t)}catch(n){console.error("[webjs] lifecycle hook threw during post-commit phase:",n)}finally{this._resolveUpdate()}}updated(t){}firstUpdated(t){}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}addController(t){this.__controllers.add(t),this._connected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers.delete(t)}render(){return""}renderError(t){}renderFallback(){}};function wn(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function qr(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Ct(e){return new.target?Reflect.construct(Te,arguments,new.target):class extends Te{static properties=e;static[Hr]=!0}}Object.setPrototypeOf(Ct,Te);Ct.prototype=Te.prototype;function vi(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var Oc=Symbol.for("webjs.suspense");function Ci(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function xt(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}ke();var _n=null;function xi(e){_n=e}function Sn(){if(!_n)return"";try{return _n()||""}catch{return""}}async function ki(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;n&&n.dev===void 0&&r!==void 0&&(n.dev=r);let s=await k(e,n);return t&&t.ssr===!1?s:await Y(s,n,[],r)}async function k(e,t){if(e==null||e===!1||e===!0)return"";if(e&&typeof e.then=="function")return e=await e,k(e,t);if(ge(e))return String(e.value??"");if(ye(e))return k(e.value,t);if(oe(e))return k(e.signal.get(),t);if(ee(e))return k(e.value,t);if(te(e))return k(e.fn(),t);if(we(e)){let n=e.template;return String(n?.innerHTML??"")}if(ne(e))return"";if(re(e))return k(e.value,t);if(se(e)){let n=e.args;for(let r of n)if(!r||typeof r.then!="function")return k(r,t);if(n.length>0)try{let r=await Promise.race(n.map(s=>Promise.resolve(s).catch(()=>{})));return k(r,t)}catch{return""}return""}if(_e(e)||Se(e))return"";if(Array.isArray(e))return(await Promise.all(e.map(r=>k(r,t)))).join("");if(Q(e)){let n=e;return(await Promise.all(n.items.map((s,o)=>k(n.templateFn(s,o),t)))).join("")}if(xt(e)){let n=e,r=await k(n.fallback,t);if(t){let s=`s${t.nextId++}`;return t.pending.push({id:s,promise:Promise.resolve(n.children)}),`<webjs-boundary id="${s}">${r}</webjs-boundary>`}return r}return N(e)?Ti(e,t):it(String(e))}async function Ti(e,t){let{strings:n,values:r}=e,s="",o="text",i="",c=0,a="",l=0,f="",d="";for(let u=0;u<n.length;u++){let b=n[u];for(let g=0;g<b.length;g++){let m=b[g];switch(o){case"text":s+=m,m==="<"&&(o="tag-open");break;case"tag-open":s+=m,m==="!"?o="bang-1":m==="/"?(o="tag-name",f=""):/[a-zA-Z]/.test(m)?(o="tag-name",f=m.toLowerCase()):o="text";break;case"bang-1":s+=m,o=m==="-"?"bang-dash":"tag-name";break;case"bang-dash":s+=m,m==="-"?(o="comment",l=0):o="tag-name";break;case"comment":s+=m,m==="-"?l+=1:(m===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":s+=m,m===">"?(o=kt(f)?"rawtext":"text",o==="rawtext"&&(d="")):/\s/.test(m)?o="in-tag":f+=m.toLowerCase();break;case"in-tag":s+=m,m===">"?(o=kt(f)?"rawtext":"text",o==="rawtext"&&(d="")):!/\s/.test(m)&&m!=="/"&&(o="attr-name",i=m,c=s.length-1);break;case"rawtext":s+=m,d=(d+m.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(o="text",d="",f="");break;case"attr-name":m==="="?(o="after-eq",s+=m):/\s/.test(m)?(o="in-tag",i="",s+=m):m===">"?(o="text",i="",s+=m):(i+=m,s+=m);break;case"after-eq":m==='"'||m==="'"?(o="attr-quoted",a=m,s+=m):/\s/.test(m)?(o="in-tag",i="",s+=m):m===">"?(o="text",i="",s+=m):(o="attr-unquoted",s+=m);break;case"attr-unquoted":/\s/.test(m)?(o="in-tag",i="",s+=m):(m===">"&&(o="text",i=""),s+=m);break;case"attr-quoted":s+=m,m===a&&(o="in-tag",i="");break}}if(u<r.length){let g=r[u];if(g&&typeof g.then=="function"&&(g=await g),o==="comment")s+=String(g??""),l=0;else if(o==="rawtext")s+=String(g??""),d="";else if(o==="text")s+=await k(g,t);else if(o==="after-eq"){let m=i[0],h=i.slice(1),p=be[m];if(p==="event")s=s.slice(0,c),o="in-tag",i="";else if(p==="prop"){if(s=s.slice(0,c),f==="webjs-suspense"&&h==="fallback"){let y=await k(g,t);s+=`data-webjs-fallback="${$(y)}"`,o="in-tag",i="";continue}if(!f.includes("-")){o="in-tag",i="";continue}if(g===void 0){o="in-tag",i="";continue}try{let y=await Ke(g);s+=`data-webjs-prop-${Hi(h)}="${$(y)}"`}catch(y){console.warn(`[webjs] property binding .${h} has an unserializable value during SSR. Dropping. The browser will see the property as undefined. Detail: ${y&&y.message}`)}o="in-tag",i=""}else p==="bool"?(s=s.slice(0,c),g&&(s+=`${h}=""`),o="in-tag",i=""):(s+=`"${$(String(g??""))}"`,o="in-tag",i="")}else(o==="attr-quoted"||o==="attr-unquoted")&&(s+=$(String(g??"")))}}return s}var Ni=new Set(["document","window","localStorage","sessionStorage","navigator","matchMedia","requestAnimationFrame","getComputedStyle","IntersectionObserver","MutationObserver","ResizeObserver"]),ji=new Set(["attachShadow","querySelector","querySelectorAll","getBoundingClientRect","focus","blur","scrollIntoView"]);function Ri(e){let t=e&&typeof e.message=="string"?e.message:"",n=/^(\w+) is not defined\b/.exec(t);return e instanceof ReferenceError&&n&&Ni.has(n[1])?`\`${n[1]}\` is a browser-only global and is undefined during SSR.`:(n=/\.(\w+) is not a function\b/.exec(t),e instanceof TypeError&&n&&ji.has(n[1])?`\`${n[1]}\` is an HTMLElement method that does not exist on the server-side component instance during SSR.`:null)}function Li(){return typeof process<"u"&&process.env&&!0}function zr(e,t,n){if(!(n===void 0?!Li():!!n))return"";let s=t&&t.message?t.message:String(t);return Gt`<div data-webjs-error="${e}" style="border:1px solid #f5c2c7;background:#f8d7da;color:#842029;padding:8px 12px;border-radius:6px;font:13px/1.4 system-ui,sans-serif">
3
+ `)}</style>`}var be=Object.freeze({"@":"event",".":"prop","?":"bool"});function nr(e){return Object.prototype.hasOwnProperty.call(be,e)}function it(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function $(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var rr=Symbol.for("webjs.repeat");function sr(e,t,n){return{[rr]:!0,items:[...e],keyFn:t,templateFn:n}}function Q(e){return!!e&&typeof e=="object"&&e[rr]===!0}function Jt(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function ge(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function eo(e){return{_$webjs:"live",value:e}}function ye(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function to(e,t){return{_$webjs:"keyed",key:e,value:t}}function ee(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function no(e,t){return{_$webjs:"guard",deps:e,fn:t}}function te(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function ro(e){return{_$webjs:"template-content",template:e}}function we(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function so(e){return{_$webjs:"ref",target:e}}function ne(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function oo(){return{value:void 0}}function io(e){return{_$webjs:"cache",value:e}}function re(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function ao(...e){return{_$webjs:"until",args:e}}function se(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function co(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function _e(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function lo(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Se(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function uo(e){return{_$webjs:"watch",signal:e}}function oe(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var F=null,W=!1,Ee=0,Ae=null,Xt=0,or=(e,t)=>Object.is(e,t),ct=()=>{},ir=()=>!1;function ar(e,t){e.liveConsumers||(e.liveConsumers=new Set);let n=e.liveConsumers.size===0;if(e.liveConsumers.add(t),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)ar(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function Fe(e,t){if(e.liveConsumers&&(e.liveConsumers.delete(t),e.liveConsumers.size===0)){if(e.producers&&e.producers.length>0)for(let n of e.producers)Fe(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function rn(e){if(W)throw new Error("Signal read during notification phase");if(F===null)return;let t=F,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&en(t)&&Fe(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,en(t)&&ar(e,t)),t.producerLastReadVersions[n]=e.version}function en(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function cr(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=W;W=!0;try{for(let n of e.liveConsumers)n.dirty||fo(n)}finally{W=t}}function fo(e){e.dirty=!0,cr(e),e.consumerMarkedDirty.call(e.wrapper||e)}function lt(e){if(!(!e.dirty&&e.lastCleanEpoch===Ee)){if(!e.producerMustRecompute()&&!po(e)){e.dirty=!1,e.lastCleanEpoch=Ee;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=Ee}}function po(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(lt(n),r!==n.version))return!0}return!1}function tn(e){e&&(e.nextProducerIndex=0);let t=F;return F=e,t}function nn(e,t){if(F=t,!!e){if(en(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)Fe(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var ut=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=Ee,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=ir,this.producerRecomputeValue=ct,this.consumerMarkedDirty=ct,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||or,this.watched=n?.[sn],this.unwatched=n?.[on]}get(){return rn(this),this.__value}peek(){return this.__value}set(t){if(W)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,Ee++,Ae!==null?lr(this):cr(this))}};function lr(e){let t=W;W=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?Ae.add(n):lr(n))}finally{W=t}}var Zt=Symbol("unset"),Qt=Symbol("computing"),at=Symbol("errored"),Be=class{constructor(t,n){this.__fn=t,this.__value=Zt,this.__error=null,this.version=0,this.lastCleanEpoch=-1,this.dirty=!0,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!1,this.wrapper=this,this.__isSignal=!0,this.__isComputed=!0,this.__equal=n?.equals||or,this.watched=n?.[sn],this.unwatched=n?.[on];let r=this;this.producerMustRecompute=function(){return r.__value===Zt||r.__value===Qt},this.producerRecomputeValue=function(){if(r.__value===Qt)throw new Error("Detected cycle in computations.");let s=r.__value;r.__value=Qt;let o=tn(r),i,c=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=at,r.__error=l,c=!0}finally{nn(r,o)}if(!c&&(s!==Zt&&s!==at)&&r.__equal.call(r.wrapper,s,i)){r.__value=s;return}r.__value=i,r.version++},this.consumerMarkedDirty=ct}get(){if(lt(this),rn(this),this.__value===at)throw this.__error;return this.__value}peek(){if(lt(this),this.__value===at)throw this.__error;return this.__value}},ft=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=Ee,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=ir,this.producerRecomputeValue=ct,this.wrapper=this,this.__isWatcher=!0;let n=this;this.consumerMarkedDirty=function(){n.__fire()}}__fire(){this.__notify&&this.__notify.call(this)}watch(...t){if(t.length===0){this.dirty=!1;return}let n=tn(this);try{for(let r of t)rn(r),r.__isComputed&&lt(r)}finally{nn(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(Fe(this.producers[n],this),this.producers.splice(n,1),this.producerLastReadVersions.splice(n,1),this.nextProducerIndex=Math.min(this.nextProducerIndex,this.producers.length))}getPending(){return this.producers.filter(t=>t.__isComputed&&t.dirty)}observe(t){let n=tn(this),r;try{r=t()}finally{nn(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)Fe(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},sn=Symbol("watched"),on=Symbol("unwatched");function ho(e){let t=F;F=null;try{return e()}finally{F=t}}function mo(e){return e.producers.slice()}function bo(e){return e.liveConsumers?[...e.liveConsumers]:[]}function go(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function yo(e){return e.producers.length>0}function wo(){return F&&F.__isComputed?F:null}function _o(e){Xt++,Ae===null&&(Ae=new Set);try{e()}finally{if(Xt--,Xt===0){let t=Ae;Ae=null;for(let n of t)n.__fire()}}}var Ue={State:ut,Computed:Be,subtle:{Watcher:ft,untrack:ho,introspectSources:mo,introspectSinks:bo,hasSinks:go,hasSources:yo,currentComputed:wo,watched:sn,unwatched:on}};function So(e,t){return new ut(e,t)}function Ao(e,t){return new Be(e,t)}function Eo(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function vo(e){let t=!1,n=!1,r=new Be(e),s=new ft(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(o){console.error(o)}s.watch()}}))});s.watch(r);try{r.get()}catch(o){console.error(o)}return()=>{n||(n=!0,s.dispose())}}var Co=`${v}s`,xo=`${v}e`;function ur(e){if(!e||e.nodeType!==8)return!1;let t=e.nodeValue;return t===Co||t===xo}function ko(e){for(let t of e.addedNodes)if(ur(t))return!0;for(let t of e.removedNodes)if(ur(t))return!0;return!1}function mr(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}var De=mr(),ie=Symbol("webjs.slot.state"),V="data-webjs-light",ae="data-projection",He="actual",br="fallback",mt=Symbol("webjs.slot.fallbackFrag"),To=64,qe=null,an=null,dt=null,fr=!1;function No(){fr||(De=mr(),De&&(qe=HTMLSlotElement.prototype.assignedNodes,an=HTMLSlotElement.prototype.assignedElements,dt=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(t){return this.hasAttribute(V)&&!dr(this)?cn(this,t):qe?qe.call(this,t):[]},HTMLSlotElement.prototype.assignedElements=function(t){return this.hasAttribute(V)&&!dr(this)?cn(this,t).filter(n=>n.nodeType===1):an?an.call(this,t):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let t=dt&&dt.get?dt.get.call(this):null;return t||jo(this)}}),fr=!0))}No();function dr(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.host)return!0;t=r}return!1}function cn(e,t){if(e.getAttribute(ae)===br)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:ln(n,new Set,0)}function ln(e,t,n){if(n>=To)return e.slice();let r=[];for(let s of e)if(s.nodeType===1&&s.tagName==="SLOT"){let o=s;if(t.has(o))continue;if(t.add(o),o.hasAttribute(V)){let i=cn(o,{flatten:!1});if(i.length>0)for(let c of ln(i,t,n+1))r.push(c);else for(let c of ln(Array.from(o.childNodes),t,n+1))r.push(c)}else if(qe){let i=qe.call(o,{flatten:!0});for(let c of i)r.push(c)}else r.push(s)}else r.push(s);return r}function jo(e){let t=e.parentElement;for(;t;){if(t.tagName==="SLOT"&&t.hasAttribute(V))return t.getAttribute(ae)===He?t:null;t=t.parentElement}return null}function z(e){let t=e,n=t[ie];return n||(n={assignedByName:new Map,pendingByName:new Map,lastSnapshot:new WeakMap,nameObservers:new WeakMap,childObserver:null,scheduled:!1,ownedSlots:new Set},t[ie]=n),n}function un(e){return!!e[ie]}function gr(e){let t=z(e);for(;e.firstChild;){let n=e.firstChild,r=pt(n);ht(t.assignedByName,r,n),e.removeChild(n)}}function yr(e){let t=z(e),n=e.querySelectorAll(`slot[${V}]`);for(let r of n){let s=r;if(s.getAttribute(ae)!==He)continue;let o=s.getAttribute("name")||null;if(!t.assignedByName.has(o)){let i=Array.from(s.childNodes);t.assignedByName.set(o,i),t.lastSnapshot.set(s,i.slice())}}}function pt(e){if(e.nodeType!==1)return null;let n=e.getAttribute("slot");return n||null}function ht(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function wr(e,t,n){if(!n.length)return;let r=e.get(t);r||(r=[],e.set(t,r));for(let s of n)r.push(s)}function _r(e){if(!De)return;let t=z(e);t.childObserver||(t.childObserver=new MutationObserver(n=>{let r=!1;for(let s of n)if(!ko(s)){if(s.type==="childList"){for(let o of s.addedNodes)o.parentElement===e&&(ht(t.assignedByName,pt(o),o),r=!0);for(let o of s.removedNodes)e.contains(o)||pr(t,o)&&(r=!0)}else if(s.type==="attributes"&&s.attributeName==="slot"){let o=s.target;(pr(t,o)||o.parentElement===e)&&(ht(t.assignedByName,pt(o),o),r=!0)}}r&&bt(e)}),t.childObserver.observe(e,{childList:!0,attributes:!0,attributeFilter:["slot"],subtree:!0}))}function Sr(e){let t=e[ie];if(t){t.childObserver&&(t.childObserver.disconnect(),t.childObserver=null);for(let n of t.ownedSlots){let r=t.nameObservers.get(n);r&&(r.disconnect(),t.nameObservers.delete(n))}}}function pr(e,t){for(let[n,r]of e.assignedByName){let s=r.indexOf(t);if(s!==-1)return r.splice(s,1),r.length===0&&e.assignedByName.delete(n),!0}return!1}function bt(e){let t=z(e);t.scheduled||(t.scheduled=!0,queueMicrotask(()=>{t.scheduled=!1,Ro(e)}))}function Ro(e){if(!De)return;let t=e[ie];if(!t)return;let n=Array.from(e.querySelectorAll(`slot[${V}]`)),r=new Set(n);for(let i of t.ownedSlots)r.has(i)||Lo(t,i);for(let i of r)t.ownedSlots.has(i)||Io(e,i);t.ownedSlots=r;let s=new Map;for(let i of n){let c=i.getAttribute("name")||null,a=s.get(c);a||(a=[],s.set(c,a)),a.push(i)}for(let i of s.keys()){let c=t.pendingByName.get(i);if(c&&c.length){let a=t.assignedByName.get(i)||[],l=[];for(let f of c)l.push(f);for(let f of a)l.indexOf(f)===-1&&l.push(f);t.assignedByName.set(i,l),t.pendingByName.delete(i)}}let o=[];for(let[i,c]of s){let a=t.assignedByName.get(i)||[];for(let l=0;l<c.length;l++){let f=c[l];l===0&&a.length>0?Oo(t,f,a)&&o.push(f):Mo(t,f)&&o.push(f)}}for(let i of o)Po(i)}function Lo(e,t){let n=e.nameObservers.get(t);n&&(n.disconnect(),e.nameObservers.delete(t));let r=e.lastSnapshot.get(t);if(r&&r.length>0){let s=t.getAttribute("name")||null;wr(e.pendingByName,s,r)}e.lastSnapshot.delete(t)}function Oo(e,t,n){let r=t.getAttribute(ae)!==He,s=e.lastSnapshot.get(t)||[];if(!r&&$o(s,n))return!1;let i=t[mt];if(r&&i)for(;t.firstChild;)i.appendChild(t.firstChild);else for(;t.firstChild;)t.removeChild(t.firstChild);for(let c of n)t.appendChild(c);return t.setAttribute(ae,He),e.lastSnapshot.set(t,n.slice()),!0}function Mo(e,t){let n=t.getAttribute(ae)===He;if(t.setAttribute(ae,br),!n)return hr(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return hr(t),!0}function hr(e){let t=e[mt];!t||t.childNodes.length===0||e.appendChild(t)}function Io(e,t){if(!De)return;let n=z(e);if(n.nameObservers.has(t))return;let r=new MutationObserver(()=>bt(e));r.observe(t,{attributes:!0,attributeFilter:["name"]}),n.nameObservers.set(t,r)}function Ar(e,t){if(!un(e))return;let n=z(e),r=n.lastSnapshot.get(t);if(!r||r.length===0)return;let s=t.getAttribute("name")||null;for(let i of r)i.parentNode===t&&t.removeChild(i);wr(n.pendingByName,s,r),n.lastSnapshot.delete(t);let o=n.nameObservers.get(t);o&&(o.disconnect(),n.nameObservers.delete(t)),n.ownedSlots.delete(t)}function Po(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function $o(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var Er=new WeakMap,fn=Symbol.for("webjs.instance");function xe(e,t){let n=t,r=n[fn];if(N(e)){let s=e;if(r&&r.strings===s.strings){ve(r,s.values);return}r&&vr(r,t);let o=t.firstChild;o&&o.nodeType===8&&o.data==="webjs-hydrate"&&o.remove();let i=Uo(s,t);n[fn]=i;return}if(r&&vr(r,t),n[fn]=null,t.replaceChildren(),!(e==null||e===!1||e===!0)){if(Array.isArray(e)){for(let s of e){let o=document.createTextNode(String(s??""));t.appendChild(o)}return}t.appendChild(document.createTextNode(String(e)))}}function yt(e){let{strings:t}=e,n=Er.get(t);if(n)return n;let r=[],s="",o="text",i="",c=0,a="",l=0,f=null,d="",u="";for(let g=0;g<t.length;g++){let m=t[g];for(let h=0;h<m.length;h++){let p=m[h];switch(o){case"text":s+=p,p==="<"&&(o="tag-open");break;case"tag-open":s+=p,p==="!"?o="bang-1":p==="/"?(o="tag-name",d=""):/[a-zA-Z]/.test(p)?(o="tag-name",d=p.toLowerCase()):o="text";break;case"bang-1":s+=p,o=p==="-"?"bang-dash":"tag-name";break;case"bang-dash":s+=p,p==="-"?(o="comment",l=0):o="tag-name";break;case"comment":s+=p,p==="-"?l+=1:(p===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":s+=p,p===">"?(o=d==="script"||d==="style"?"rawtext":"text",o==="rawtext"&&(u="")):/\s/.test(p)?o="in-tag":d+=p.toLowerCase();break;case"in-tag":s+=p,p===">"?(o=d==="script"||d==="style"?"rawtext":"text",o==="rawtext"&&(u="")):!/\s/.test(p)&&p!=="/"&&(o="attr-name",i=p,c=s.length-1);break;case"rawtext":s+=p,u=(u+p.toLowerCase()).slice(-9),(u.endsWith("<\/script>")||u.endsWith("</style>"))&&(o="text",u="",d="");break;case"attr-name":p==="="?(o="after-eq",s+=p):/\s/.test(p)?(o="in-tag",i="",s+=p):p===">"?(o="text",i="",s+=p):(i+=p,s+=p);break;case"after-eq":p==='"'||p==="'"?(o="attr-quoted",a=p,s+=p):/\s/.test(p)?(o="in-tag",i="",s+=p):p===">"?(o="text",i="",s+=p):(o="attr-unquoted",s+=p);break;case"attr-unquoted":/\s/.test(p)?(o="in-tag",i="",s+=p):(p===">"&&(o="text",i=""),s+=p);break;case"attr-quoted":s+=p,p===a&&(o="in-tag",i="");break;case"skip-attr":if(p===a){if(f){let y=f.firstPartIdx,w=[];for(let E=y;E<r.length;E++)(r[E].kind==="noop"||r[E].kind==="attr-mixed")&&w.push(E);let S=[],A=t[w[0]],C=A.lastIndexOf(a);S.push(C>=0?A.slice(C+1):A);for(let E=1;E<w.length;E++)S.push(t[w[E]]);let T=t[w[w.length-1]+1],I=T.indexOf(a);S.push(I>=0?T.slice(0,I):T),r[y]={kind:"attr-mixed",path:[],name:f.name,statics:S,group:w},f=null}o="in-tag",i=""}break}}if(g<t.length-1){let h=r.length;if(o==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(o==="rawtext"){u="",r.push({kind:"noop",path:[]});continue}if(o==="text")s+=`<!--${v}${h}-->`,r.push({kind:"child",path:[]});else if(o==="in-tag"){let p=`data-${v}${h}`;s+=`${p}=""`,r.push({kind:"element",path:[]})}else if(o==="after-eq"){let p=i[0],y=i.slice(1);if(nr(p)){s=s.slice(0,c);let w=be[p],S=`data-${v}${h}`;s+=`${S}=""`,r.push({kind:w,path:[],name:y})}else{s=s.slice(0,c);let w=`data-${v}${h}`;s+=`${w}=""`,r.push({kind:"attr",path:[],name:i})}o="in-tag",i=""}else if(o==="attr-quoted"||o==="attr-unquoted"){s=s.slice(0,c);let p=`data-${v}${h}`;s+=`${p}=""`,f={name:i,firstPartIdx:h},r.push({kind:"noop",path:[]}),o="skip-attr"}else o==="skip-attr"&&r.push({kind:"noop",path:[]})}}let b=document.createElement("template");return b.innerHTML=s,Fo(b.content,r),Bo(b.content,r),n={templateEl:b,parts:r},Er.set(t,n),n}function Fo(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(V,"");let s=t.length;r.setAttribute(`data-${v}${s}`,""),t.push({kind:"slot",path:[]})}}function Bo(e,t){let n=[];function r(s){for(let o=0;o<s.childNodes.length;o++){let i=s.childNodes[o];if(n.push(o),i.nodeType===8){let c=i.data;if(c.startsWith(v)){let a=Number(c.slice(v.length));t[a]&&t[a].kind==="child"&&(t[a].path=n.slice())}}else if(i.nodeType===1){let c=i,a=[];for(let l of c.attributes)if(l.name.startsWith(`data-${v}`)){let f=Number(l.name.slice(`data-${v}`.length));t[f]&&t[f].kind!=="child"&&(t[f].path=n.slice()),a.push(l.name)}for(let l of a)c.removeAttribute(l);r(i)}n.pop()}}r(e)}function Uo(e,t){let{templateEl:n,parts:r}=yt(e),s=n.content.cloneNode(!0),o=document.createComment(`${v}s`),i=document.createComment(`${v}e`),c=r.map(l=>wt(l,s)),a=[];for(let l=0;l<e.values.length;l++)ce(c[l],e.values[l],void 0,e.values),a.push(e.values[l]);t.replaceChildren(o,...s.childNodes,i);for(let l of c)l.kind==="slot"&&ce(l,void 0,void 0,[]);return{strings:e.strings,bound:c,lastValues:a,startNode:o,endNode:i}}function wt(e,t){if(e.kind==="noop")return{kind:"noop"};let n=t;for(let s of e.path)n=n.childNodes[s];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let s={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(o){s.handler?.(o)}};return r.addEventListener(s.name,s.dispatcher),s}if(e.kind==="attr")return{kind:"attr",el:r,name:e.name||""};if(e.kind==="attr-mixed")return{kind:"attr-mixed",el:r,name:e.name||"",statics:e.statics||[],group:e.group||[]};if(e.kind==="prop")return{kind:"prop",el:r,name:e.name||""};if(e.kind==="bool")return{kind:"bool",el:r,name:e.name||""};if(e.kind==="element")return{kind:"element",el:r};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}function ve(e,t){for(let n=0;n<t.length;n++){let r=t[n];Object.is(r,e.lastValues[n])||(ce(e.bound[n],r,e.lastValues[n],t),e.lastValues[n]=r)}}function vr(e,t){for(let n of e.bound){if(n.kind==="event"&&n.el.removeEventListener(n.name,n.dispatcher),n.kind==="element"){let r=n.lastTarget;if(r){if(typeof r=="function")try{r(void 0)}catch{}else typeof r=="object"&&(r.value=void 0);n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=dn(n.slotEl);r&&Ar(r,n.slotEl)}}t.replaceChildren()}function ce(e,t,n,r){if(ye(t)){let s=t.value;if(e.kind==="prop"&&e.el[e.name]===s||e.kind==="attr"&&e.el.getAttribute(e.name)===String(s)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!s)return;t=s}switch(e.kind){case"child":Ho(e,t);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):e.el.setAttribute(e.name,String(t));break}case"prop":e.el[e.name]=t;break;case"bool":t?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":e.handler=typeof t=="function"?t:null;break;case"element":Do(e,t);break;case"attr-mixed":{let s=e,o=s.statics[0];for(let i=0;i<s.group.length;i++)o+=String((r?r[s.group[i]]:t)??""),o+=s.statics[i+1]||"";e.el.setAttribute(e.name,o);break}case"slot":{if(e.applied)break;let s=e.slotEl,o=()=>{e.applied=!0;let c=dn(s);if(!c||qo(s))return;let a=document.createDocumentFragment();for(;s.firstChild;)a.appendChild(s.firstChild);s[mt]=a,bt(c)};dn(s)?o():queueMicrotask(o);break}case"noop":break}}function dn(e){let t=e.parentElement;for(;t;){if(t[ie])return t;t=t.parentElement}return null}function qo(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.host)return!0;t=r}return!1}function Do(e,t){let n=e,r=ne(t)?t.target:void 0,s=n.__refTarget,o=r!==s;if(o&&s)if(typeof s=="function")try{s(void 0)}catch{}else typeof s=="object"&&(s.value=void 0);if(o||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!o&&n.__refElement!==void 0)try{r(void 0)}catch{}try{r(e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function Ho(e,t){return Zo(e,t),B(e,t)}function B(e,t){let n=e.marker;if(ge(t)){K(e);let s=String(t.value??""),o=document.createElement("template");o.innerHTML=s;let i=[...o.content.childNodes],c=document.createDocumentFragment();for(let a of i)c.appendChild(a);n.parentNode?.insertBefore(c,n),e.child=i;return}if(ee(t)){let s=t,o=e.__keyedKey;o!==void 0&&!Object.is(o,s.key)&&K(e),e.__keyedKey=s.key,B(e,s.value);return}if(te(t)){let s=t,o=e.__guardDeps,i=s.deps;if(o!==void 0&&(Array.isArray(o)&&Array.isArray(i)?Xo(o,i):Object.is(o,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,B(e,s.fn());return}if(we(t)){K(e);let s=t.template;if(s&&s.content){let o=s.content.cloneNode(!0),i=[...o.childNodes];n.parentNode?.insertBefore(o,n),e.child=i}return}if(ne(t))return;if(re(t))return Qo(e,t.value);if(se(t))return ei(e,t.args);if(oe(t))return ti(e,t.signal);if(_e(t))return ni(e,t);if(Se(t))return ri(e,t);if(Q(t)){if(e.child&&e.child.kind==="repeat"){zo(e,t);return}K(e);let s={kind:"repeat",map:new Map};e.child=s,Vo(n,s,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){Yo(e,t);return}K(e);let s={kind:"array",items:[]};e.child=s,Go(n,s,t);return}if(e.child){let s=e.child;if(s.kind==="repeat")Cr(s),e.child=void 0;else if(s.kind==="array")kr(s),e.child=void 0;else if(s.kind==="async-stream")Rr(s),e.child=void 0;else if("strings"in e.child){let o=e.child;if(N(t)&&o.strings===t.strings){ve(o,t.values);return}Ce(o.startNode,o.endNode),e.child=void 0}else{for(let o of e.child)o.parentNode&&o.parentNode.removeChild(o);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(N(t)){let s=t,{templateEl:o,parts:i}=yt(s),c=o.content.cloneNode(!0),a=document.createComment(`${v}s`),l=document.createComment(`${v}e`),f=i.map(b=>wt(b,c)),d=[];for(let b=0;b<s.values.length;b++)ce(f[b],s.values[b],void 0,s.values),d.push(s.values[b]);let u=[a,...c.childNodes,l];n.parentNode?.insertBefore(Wo(u),n);for(let b of f)b.kind==="slot"&&ce(b,void 0,void 0,[]);e.child={strings:s.strings,bound:f,lastValues:d,startNode:a,endNode:l};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function Wo(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function Ce(e,t){if(!e.parentNode)return;let n=e;for(;n&&n!==t;){let r=n.nextSibling;n.parentNode?.removeChild(n),n=r}t.parentNode===e.parentNode&&t.parentNode?.removeChild(t)}function hn(e){let{templateEl:t,parts:n}=yt(e),r=t.content.cloneNode(!0),s=document.createComment(`${v}s`),o=document.createComment(`${v}e`),i=n.map(l=>wt(l,r)),c=[];for(let l=0;l<e.values.length;l++)ce(i[l],e.values[l],void 0,e.values),c.push(e.values[l]);let a=document.createDocumentFragment();for(a.appendChild(s);r.firstChild;)a.appendChild(r.firstChild);return a.appendChild(o),{inst:{strings:e.strings,bound:i,lastValues:c,startNode:s,endNode:o},frag:a}}function We(e){for(let t of e.bound)if(t.kind==="event"&&t.el.removeEventListener(t.name,t.dispatcher),t.kind==="element"){let n=t.lastTarget;if(n){if(typeof n=="function")try{n(void 0)}catch{}else typeof n=="object"&&(n.value=void 0);t.lastTarget=void 0,t.__lastEl=void 0}}}function Vo(e,t,n){let{items:r,keyFn:s,templateFn:o}=n,i=e.parentNode;if(!i)return;let c=document.createDocumentFragment();for(let a=0;a<r.length;a++){let l=s(r[a],a),f=o(r[a],a);if(!N(f))continue;let{inst:d,frag:u}=hn(f);t.map.set(l,d),c.appendChild(u)}i.insertBefore(c,e)}function zo(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let s=e.child,{items:o,keyFn:i,templateFn:c}=t,a=new Map;for(let l=0;l<o.length;l++){let f=i(o[l],l),d=c(o[l],l);if(!N(d))continue;let u=s.map.get(f);if(u&&u.strings===d.strings)ve(u,d.values),pn(u.startNode,u.endNode,r,n),a.set(f,u),s.map.delete(f);else{u&&(We(u),Ce(u.startNode,u.endNode),s.map.delete(f));let{inst:b,frag:g}=hn(d);r.insertBefore(g,n),a.set(f,b)}}for(let l of s.map.values())We(l),Ce(l.startNode,l.endNode);s.map=a}function Cr(e){for(let t of e.map.values())We(t),Ce(t.startNode,t.endNode);e.map.clear()}function Ko(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function gt(e){e.type==="tpl"?(We(e.inst),Ce(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function xr(e){if(N(e)){let{inst:t,frag:n}=hn(e);return{item:{type:"tpl",inst:t},frag:n}}if(e!=null&&e!==!1&&e!==!0){let t=document.createTextNode(String(e));return{item:{type:"text",node:t},frag:t}}return{item:{type:"empty"},frag:null}}function Go(e,t,n){let r=e.parentNode;if(!r)return;let s=document.createDocumentFragment(),o=[];for(let i of n){let{item:c,frag:a}=xr(i);a&&s.appendChild(a),o.push(c)}r.insertBefore(s,e),t.items=o}function Yo(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let s=e.child,o=s.items,i=[];for(let c=0;c<t.length;c++){let a=t[c],l=o[c];if(N(a)){let u=a;if(l&&l.type==="tpl"&&l.inst.strings===u.strings){ve(l.inst,u.values),i.push(l);continue}}else if(a!=null&&a!==!1&&a!==!0){if(l&&l.type==="text"){let u=String(a);l.node.data!==u&&(l.node.data=u),i.push(l);continue}}else{l&&gt(l),i.push({type:"empty"});continue}let{item:f,frag:d}=xr(a);d&&r.insertBefore(d,Jo(o,c,n)),l&&gt(l),i.push(f)}for(let c=t.length;c<o.length;c++)gt(o[c]);s.items=i}function Jo(e,t,n){for(let r=t;r<e.length;r++){let s=Ko(e[r]);if(s&&s.parentNode)return s}return n}function kr(e){for(let t of e.items)gt(t);e.items=[]}function pn(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let s=document.createDocumentFragment(),o=e;for(;o;){let i=o.nextSibling;if(s.appendChild(o),o===t)break;o=i}n.insertBefore(s,r)}function Xo(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function K(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Tr(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Cr(n);else if(n.kind==="array")kr(n);else if(n.kind==="async-stream")Rr(n);else if("strings"in n){let r=e.child;We(r),Ce(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Zo(e,t){let n=e;n.__untilState&&!se(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!te(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!re(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!ee(t)&&(n.__keyedKey=void 0),n.__watchSub&&!oe(t)&&Tr(n)}function Qo(e,t){let n=e.marker,r=e,s=r.__cacheMap;s||(s=new Map,r.__cacheMap=s);let o=e.child;if(o&&"strings"in o){let c=o;if(N(t)&&c.strings===t.strings){ve(c,t.values);return}let a=document.createDocumentFragment();pn(c.startNode,c.endNode,a,null),s.set(c.strings,{inst:c,holder:a}),e.child=void 0}if(N(t)){let c=t,a=s.get(c.strings);if(a){s.delete(c.strings),e.child&&K(e),pn(a.inst.startNode,a.inst.endNode,n.parentNode,n),ve(a.inst,c.values),e.child=a.inst;return}}B(e,t)}function ei(e,t){let n=e,r=n.__untilState,s=n.__untilArgs,o=(u,b)=>!!(Object.is(u,b)||N(u)&&N(b)&&u.strings===b.strings),c=s&&s.length===t.length&&s.every((u,b)=>o(u,t[b]))&&r?r.highestResolved:1/0;r&&(r.aborted=!0),n.__untilArgs=t.slice();let a={aborted:!1,highestResolved:c};n.__untilState=a;let l=-1,f;for(let u=0;u<t.length;u++){let b=t[u];if(!b||typeof b.then!="function"){l=u,f=b;break}}l!==-1&&l<=a.highestResolved?(B(e,f),a.highestResolved=l):l===-1&&!n.__untilEverRendered&&B(e,""),n.__untilEverRendered=!0;let d=Math.min(l===-1?t.length:l,a.highestResolved);for(let u=0;u<d;u++){let b=t[u];!b||typeof b.then!="function"||Promise.resolve(b).then(g=>{a.aborted||u>=a.highestResolved||(a.highestResolved=u,B(e,g))},()=>{})}}function ti(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let o;n.__watchSub.observe(()=>{o=t.get()}),B(e,o);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new Ue.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let o;r.observe(()=>{o=t.get()}),B(e,o)})});n.__watchSub=r;let s;r.observe(()=>{s=t.get()}),B(e,s)}function Tr(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function ni(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;K(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,Nr(s,e,t)}function ri(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;K(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,Nr(s,e,t)}async function Nr(e,t,n){let r=t.marker,s=0;try{for(;!e.aborted;){let o=await e.iterator.next();if(e.aborted||o.done)break;let i=n.mapper?n.mapper(o.value,s):o.value,c=jr(i);if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let a=document.createDocumentFragment();for(let l of c)a.appendChild(l);r.parentNode?.insertBefore(a,r),e.nodes.push(...c),s++}}catch(o){typeof console<"u"&&console.error("[webjs] asyncStream error:",o)}}function jr(e){if(e==null||e===!1||e===!0)return[];if(N(e)){let t=e,{templateEl:n,parts:r}=yt(t),s=n.content.cloneNode(!0),o=r.map(i=>wt(i,s));for(let i=0;i<t.values.length;i++)ce(o[i],t.values[i],void 0,t.values);return[...s.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...jr(n));return t}return[document.createTextNode(String(e))]}function Rr(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}var Lr=null;function _t(e){Lr=e||null}function si(){return Lr||void 0}var Or=Symbol.for("webjs:registry"),Mr=Symbol.for("webjs:classToTag"),St=globalThis,U=St[Or]||(St[Or]=new Map),Ir=St[Mr]||(St[Mr]=new WeakMap),At=typeof window<"u"&&typeof customElements<"u";function mn(e,t){if(!e||typeof e!="string"||!e.includes("-"))throw new Error(`customElements.define: tag "${e}" must contain a hyphen (HTML spec)`);let n=t.lazy===!0,r=U.get(e);r?(r.cls=t,r.lazy=n):U.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),Ir.set(t,e)}if(At){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),mn(t,n)}}if(!At){let e=globalThis;e.customElements||(e.customElements={define(t,n){mn(t,n)},get(t){return U.get(t)?.cls},upgrade(){},whenDefined(t){let n=U.get(t);return Promise.resolve(n?.cls)}})}function bn(e,t){At?customElements.define(e,t):mn(e,t)}function oi(e,t){if(At)return;let n=U.get(e);if(n){n.moduleUrl=t;return}U.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function gn(e){return U.get(e)?.cls}function ii(e){return U.get(e)?.moduleUrl||null}function ai(e){return U.get(e)?.lazy===!0}function Et(e){return Ir.get(e)}function yn(){return[...U.keys()]}ke();var Dr=typeof window<"u"&&typeof HTMLElement<"u";function _i(e,t){return e!==t}function Si(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var vt=class{constructor(){this.__ssrAttrs=new Map,this.__internals=null}get attributes(){return[...this.__ssrAttrs].map(([t,n])=>({name:t,value:n}))}getAttribute(t){let n=this.__ssrAttrs.get(String(t).toLowerCase());return n===void 0?null:n}setAttribute(t,n){this.__ssrAttrs.set(String(t).toLowerCase(),String(n))}removeAttribute(t){this.__ssrAttrs.delete(String(t).toLowerCase())}hasAttribute(t){return this.__ssrAttrs.has(String(t).toLowerCase())}toggleAttribute(t,n){let r=String(t).toLowerCase(),s=this.__ssrAttrs.has(r);return(n===void 0?!s:n)?(this.__ssrAttrs.set(r,""),!0):(this.__ssrAttrs.delete(r),!1)}getAttributeNames(){return[...this.__ssrAttrs.keys()]}closest(t){let n=String(t).trim().toLowerCase();if(!/^[a-z][a-z0-9-]*$/.test(n))return null;if(this.__ssrTag===n)return this;let r=this.__ssrAncestors;if(!Array.isArray(r))return null;for(let s=r.length-1;s>=0;s--)if(r[s]&&r[s].__ssrTag===n)return r[s];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,s=>"-"+s.toLowerCase());return this.__dataset=new Proxy({},{get(r,s){if(typeof s!="string")return;let o=t.getAttribute(n(s));return o===null?void 0:o},set(r,s,o){return typeof s=="string"&&t.setAttribute(n(s),o),!0},has(r,s){return typeof s=="string"&&t.hasAttribute(n(s))},deleteProperty(r,s){return typeof s=="string"&&t.removeAttribute(n(s)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(s,o)=>o.toUpperCase()))},getOwnPropertyDescriptor(r,s){if(typeof s=="string"&&t.hasAttribute(n(s)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(s))}}}),this.__dataset}get className(){return this.getAttribute("class")??""}set className(t){this.setAttribute("class",t)}get hidden(){return this.hasAttribute("hidden")}set hidden(t){this.toggleAttribute("hidden",!!t)}get id(){return this.getAttribute("id")??""}set id(t){this.setAttribute("id",t)}get title(){return this.getAttribute("title")??""}set title(t){this.setAttribute("title",t)}get slot(){return this.getAttribute("slot")??""}set slot(t){this.setAttribute("slot",t)}get role(){return this.getAttribute("role")}set role(t){t==null?this.removeAttribute("role"):this.setAttribute("role",t)}get tabIndex(){let t=this.getAttribute("tabindex");return t===null?-1:Number.parseInt(t,10)||0}set tabIndex(t){this.setAttribute("tabindex",String(t))}addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return this.__internals=Si(),this.__internals}},Ai=["ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDescription","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"];for(let e of Ai){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(vt.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var Ei=Dr?HTMLElement:vt,Hr=Symbol("webjs.factoryProps"),Ur=new WeakSet,Te=class e extends Ei{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){bn(t,this)}static get observedAttributes(){let t=this.properties||{};return Object.keys(t).filter(n=>!(typeof t[n]=="object"&&t[n].state)).map(n=>typeof t[n]=="object"&&t[n].attribute||wn(n))}constructor(){super(),this._renderRoot=null,this._scheduled=!1,this._connected=!1,this.__controllers=new Set,this.__firstRendered=!1,this._changedProperties=new Map,this._updateResolve=null,this._updatePromise=Promise.resolve(!0),this._isUpdating=!1,this._assertFactoryProperties(),this._initializeProperties()}_assertFactoryProperties(){let t=this.constructor;if(Ur.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,Hr)){let r=n.name||"a component";throw new Error(`${r}: \`static properties\` is no longer supported. Declare reactive properties via the factory instead: \`class ${r} extends WebComponent({ count: Number })\`. Use the \`prop()\` helper for options (\`prop(Number, { reflect: true })\`) and set defaults in the constructor after \`super()\`. See https://docs.webjs.dev/docs/components.`)}n=Object.getPrototypeOf(n)}Ur.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,s]of Object.entries(n)){let o=typeof s=="object"?s:{type:s},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:c=>{let a=this.__propValues[r];(o.hasChanged||_i)(c,a)&&(this.__propValues[r]=c,o.reflect&&!o.state&&this._connected&&this._reflectAttribute(r,c,o),this.requestUpdate(r,a))}}),i!==void 0?this.__propValues[r]=i:o.default!==void 0&&(this.__propValues[r]=typeof o.default=="function"?o.default():o.default)}}}_reflectAttribute(t,n,r){let s=r.attribute||wn(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let o=r.converter.toAttribute(n,r.type);o==null?this.removeAttribute(s):this.setAttribute(s,o)}else r.type===Boolean?n?this.setAttribute(s,""):this.removeAttribute(s):n==null?this.removeAttribute(s):r.type===Object||r.type===Array?this.setAttribute(s,JSON.stringify(n)):this.setAttribute(s,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!Dr)return;if(this.__webjsPropsHydrated||(this.__webjsPropsHydrated=!0,this._hydratePropAttrs()),this.constructor.hydrate==="visible"&&typeof IntersectionObserver<"u"&&!this.__hydrationActivated){this.__hydrationActivated=!1,this.__hydrationObserver=new IntersectionObserver(n=>{for(let r of n)if(r.isIntersecting){this.__hydrationObserver.unobserve(this),this.__hydrationObserver.disconnect(),this.__hydrationObserver=null,this.__hydrationActivated=!0,this._activate();return}},{rootMargin:"200px"}),this.__hydrationObserver.observe(this);return}this._activate()}_hydratePropAttrs(){let t=[],n=this.attributes;for(let r=0;r<n.length;r++){let s=n[r].name;s.startsWith("data-webjs-prop-")&&t.push(s)}for(let r of t){let s=this.getAttribute(r);if(this.removeAttribute(r),s==null)continue;let o=qr(r.slice(16));try{this[o]=D(s)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,s=Array.isArray(r)?r:me(r)?[r]:[];if(s.length){if(n){let o=this.shadowRoot.querySelector("style");o&&o.remove()}Yt(this._renderRoot,s)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${Et(t)||this.tagName?.toLowerCase()}> has static shadow = false AND static styles. static styles only works with shadow DOM (adoptedStyleSheets). For light DOM, use global CSS or <style> in render().`),un(this)||(this.__isHydrating()?(z(this),yr(this)):gr(this));for(let n of this.__controllers)n.hostConnected&&n.hostConnected();this._updateResolve===null&&(this._updatePromise=new Promise(n=>{this._updateResolve=n})),this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(n){console.error("[webjs] lifecycle hook threw during initial render:",n)}this._renderRoot===this&&_r(this)})}__isHydrating(){let t=this.firstChild,n=t!=null&&t.nodeType===8&&t.data==="webjs-hydrate";return n&&(this.__hydratedAtActivate=!0),n}disconnectedCallback(){this._connected=!1,this.__hydrationObserver&&(this.__hydrationObserver.disconnect(),this.__hydrationObserver=null),this._renderRoot===this&&Sr(this),this.__signalWatcher&&(this.__signalWatcher.dispose(),this.__signalWatcher=void 0);for(let t of this.__controllers)t.hostDisconnected&&t.hostDisconnected()}attributeChangedCallback(t,n,r){if(this.__reflectingAttribute)return;let o=this.constructor.properties||{},i,c;for(let[f,d]of Object.entries(o))if(((typeof d=="object"?d:{type:d}).attribute||wn(f))===t){i=f,c=d;break}if(c===void 0&&(i=qr(t),c=o[i]||o[t]),c===void 0)return;let a=typeof c=="object"?c:{type:c},l;if(a.converter&&a.converter.fromAttribute)l=a.converter.fromAttribute(r,a.type);else if(a.type===Number)l=r==null?null:Number(r);else if(a.type===Boolean)l=r!=null&&r!=="false";else if(a.type===Object||a.type===Array)try{l=r==null?null:JSON.parse(r)}catch{l=r}else l=r;this[i]!==l&&(this[i]=l,this._connected&&this.requestUpdate())}requestUpdate(t,n){t!==void 0&&!this._changedProperties.has(t)&&this._changedProperties.set(t,n),this._scheduleUpdate()}_scheduleUpdate(){this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),!this._isUpdating&&(this._scheduled||!this._connected||(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(t){console.error("[webjs] lifecycle hook threw during update cycle:",t)}})))}_performRender(){if(!this._renderRoot)return;let t=this._changedProperties;this._isUpdating=!0;let n=!1,r=null;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let s of this.__controllers)s.hostUpdate&&s.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,_t(this.__renderAbort?this.__renderAbort.signal:null);try{let s=this.update(t);s&&typeof s.then=="function"&&(r=s)}catch(s){this._handleRenderError(s)}finally{_t(null)}if(!r){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();n=!0}}}catch(s){console.error("[webjs] lifecycle hook threw during update phase:",s)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let s=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1,r.then(()=>{if(this.__pendingAsyncCommits--,s===this.__renderToken){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();this._postCommit(t)}});return}n?this._postCommit(t):this.__pendingAsyncCommits||this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers)n.hostUpdate&&n.hostUpdate();this._reflectDeclaredAttributes()}finally{this._isUpdating=!1}}_reflectDeclaredAttributes(){let t=this.constructor.properties||{};for(let n of Object.keys(t)){let r=t[n];!r||!r.reflect||r.state||this._reflectAttribute(n,this[n],r)}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new Ue.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);xe(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&xe(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{n===this.__renderToken&&xe(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==Ct.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${Et(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&xe(n,this._renderRoot)}catch(n){console.error("[webjs] renderError() also threw:",n)}}_postCommit(t){try{this.__firstRendered||(this.__firstRendered=!0,this.firstUpdated(t)),this.updated(t)}catch(n){console.error("[webjs] lifecycle hook threw during post-commit phase:",n)}finally{this._resolveUpdate()}}updated(t){}firstUpdated(t){}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}addController(t){this.__controllers.add(t),this._connected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers.delete(t)}render(){return""}renderError(t){}renderFallback(){}};function wn(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function qr(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Ct(e){return new.target?Reflect.construct(Te,arguments,new.target):class extends Te{static properties=e;static[Hr]=!0}}Object.setPrototypeOf(Ct,Te);Ct.prototype=Te.prototype;function vi(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var Oc=Symbol.for("webjs.suspense");function Ci(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function xt(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}ke();var _n=null;function xi(e){_n=e}function Sn(){if(!_n)return"";try{return _n()||""}catch{return""}}async function ki(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;n&&n.dev===void 0&&r!==void 0&&(n.dev=r);let s=await k(e,n);return t&&t.ssr===!1?s:await Y(s,n,[],r)}async function k(e,t){if(e==null||e===!1||e===!0)return"";if(e&&typeof e.then=="function")return e=await e,k(e,t);if(ge(e))return String(e.value??"");if(ye(e))return k(e.value,t);if(oe(e))return k(e.signal.get(),t);if(ee(e))return k(e.value,t);if(te(e))return k(e.fn(),t);if(we(e)){let n=e.template;return String(n?.innerHTML??"")}if(ne(e))return"";if(re(e))return k(e.value,t);if(se(e)){let n=e.args;for(let r of n)if(!r||typeof r.then!="function")return k(r,t);if(n.length>0)try{let r=await Promise.race(n.map(s=>Promise.resolve(s).catch(()=>{})));return k(r,t)}catch{return""}return""}if(_e(e)||Se(e))return"";if(Array.isArray(e))return(await Promise.all(e.map(r=>k(r,t)))).join("");if(Q(e)){let n=e;return(await Promise.all(n.items.map((s,o)=>k(n.templateFn(s,o),t)))).join("")}if(xt(e)){let n=e,r=await k(n.fallback,t);if(t){let s=`s${t.nextId++}`;return t.pending.push({id:s,promise:Promise.resolve(n.children)}),`<webjs-boundary id="${s}">${r}</webjs-boundary>`}return r}return N(e)?Ti(e,t):it(String(e))}async function Ti(e,t){let{strings:n,values:r}=e,s="",o="text",i="",c=0,a="",l=0,f="",d="";for(let u=0;u<n.length;u++){let b=n[u];for(let g=0;g<b.length;g++){let m=b[g];switch(o){case"text":s+=m,m==="<"&&(o="tag-open");break;case"tag-open":s+=m,m==="!"?o="bang-1":m==="/"?(o="tag-name",f=""):/[a-zA-Z]/.test(m)?(o="tag-name",f=m.toLowerCase()):o="text";break;case"bang-1":s+=m,o=m==="-"?"bang-dash":"tag-name";break;case"bang-dash":s+=m,m==="-"?(o="comment",l=0):o="tag-name";break;case"comment":s+=m,m==="-"?l+=1:(m===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":s+=m,m===">"?(o=kt(f)?"rawtext":"text",o==="rawtext"&&(d="")):/\s/.test(m)?o="in-tag":f+=m.toLowerCase();break;case"in-tag":s+=m,m===">"?(o=kt(f)?"rawtext":"text",o==="rawtext"&&(d="")):!/\s/.test(m)&&m!=="/"&&(o="attr-name",i=m,c=s.length-1);break;case"rawtext":s+=m,d=(d+m.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(o="text",d="",f="");break;case"attr-name":m==="="?(o="after-eq",s+=m):/\s/.test(m)?(o="in-tag",i="",s+=m):m===">"?(o="text",i="",s+=m):(i+=m,s+=m);break;case"after-eq":m==='"'||m==="'"?(o="attr-quoted",a=m,s+=m):/\s/.test(m)?(o="in-tag",i="",s+=m):m===">"?(o="text",i="",s+=m):(o="attr-unquoted",s+=m);break;case"attr-unquoted":/\s/.test(m)?(o="in-tag",i="",s+=m):(m===">"&&(o="text",i=""),s+=m);break;case"attr-quoted":s+=m,m===a&&(o="in-tag",i="");break}}if(u<r.length){let g=r[u];if(g&&typeof g.then=="function"&&(g=await g),o==="comment")s+=String(g??""),l=0;else if(o==="rawtext")s+=String(g??""),d="";else if(o==="text")s+=await k(g,t);else if(o==="after-eq"){let m=i[0],h=i.slice(1),p=be[m];if(p==="event")s=s.slice(0,c),o="in-tag",i="";else if(p==="prop"){if(s=s.slice(0,c),f==="webjs-suspense"&&h==="fallback"){let y=await k(g,t);s+=`data-webjs-fallback="${$(y)}"`,o="in-tag",i="";continue}if(!f.includes("-")){o="in-tag",i="";continue}if(g===void 0){o="in-tag",i="";continue}try{let y=await Ke(g);s+=`data-webjs-prop-${Hi(h)}="${$(y)}"`}catch(y){console.warn(`[webjs] property binding .${h} has an unserializable value during SSR. Dropping. The browser will see the property as undefined. Detail: ${y&&y.message}`)}o="in-tag",i=""}else p==="bool"?(s=s.slice(0,c),g&&(s+=`${h}=""`),o="in-tag",i=""):(s+=`"${$(String(g??""))}"`,o="in-tag",i="")}else(o==="attr-quoted"||o==="attr-unquoted")&&(s+=$(String(g??"")))}}return s}var Ni=new Set(["document","window","localStorage","sessionStorage","navigator","matchMedia","requestAnimationFrame","getComputedStyle","IntersectionObserver","MutationObserver","ResizeObserver"]),ji=new Set(["attachShadow","querySelector","querySelectorAll","getBoundingClientRect","focus","blur","scrollIntoView"]);function Ri(e){let t=e&&typeof e.message=="string"?e.message:"",n=/^(\w+) is not defined\b/.exec(t);return e instanceof ReferenceError&&n&&Ni.has(n[1])?`\`${n[1]}\` is a browser-only global and is undefined during SSR.`:(n=/\.(\w+) is not a function\b/.exec(t),e instanceof TypeError&&n&&ji.has(n[1])?`\`${n[1]}\` is an HTMLElement method that does not exist on the server-side component instance during SSR.`:null)}function Li(){return typeof process<"u"&&process.env&&!0}function zr(e,t,n){if(!(n===void 0?!Li():!!n))return"";let s=t&&t.message?t.message:String(t);return Gt`<div data-webjs-error="${e}" style="border:1px solid #f5c2c7;background:#f8d7da;color:#842029;padding:8px 12px;border-radius:6px;font:13px/1.4 system-ui,sans-serif">
4
4
  <strong>&lt;${e}&gt; failed to render</strong>
5
5
  <div style="margin-top:4px;white-space:pre-wrap">${s}</div>
6
6
  </div>`}async function Y(e,t,n=[],r){e=await Ii(e,t,n,r);let s=yn();if(!s.length)return e;let o=[...s].sort((d,u)=>u.length-d.length),i=new RegExp(`<(${o.map(Ge).join("|")})(?=[\\s>/])((?:"[^"]*"|'[^']*'|[^>])*?)(/?)>`,"g"),c=[];for(let d of e.matchAll(i)){let[u,b,g,m]=d,h=gn(b);if(!h)continue;t&&t.usedComponents&&t.usedComponents.add(b);let p=m?`<${b}${g}>`:u,y=null;try{let w=h.shadow===!0;y=new h,y.__ssrTag=b,y.__ssrAncestors=n;let S=Vr(g),A=Wi(S),C=new Set(Object.keys(Vr(g)).map(E=>E.toLowerCase()));Bi(y,S),qi(y,S,h);for(let[E,_]of Object.entries(A))y[E]=_;typeof y.performServerUpdate=="function"&&y.performServerUpdate();let T=y.render?y.render():"";T&&typeof T.then=="function"&&(T=await T),p=Ui(p,y,C);let I=await k(T,t);if(w){let E=await Y(I,t,[...n,y],r),_=h.styles,P=Array.isArray(_)?_:_&&me(_)?[_]:[],he=ot(P);c.push({start:d.index,end:d.index+u.length,text:`${p}<template shadowrootmode="open">${he}${E}</template>`})}else{if(I.trim()===""){c.push({start:d.index,end:d.index+u.length,text:`${p}<!--webjs-hydrate-->`});continue}let _="",P=d.index+u.length;if(!m){let Kt=d.index+u.length,st=Ye(e,Kt,b);if(st!==-1){_=e.slice(Kt,st);let Ys=new RegExp(`</${Ge(b)}\\s*>`,"i"),Js=e.slice(st),er=Ys.exec(Js),Xs=er?er[0].length:`</${b}>`.length;P=st+Xs}else _=e.slice(Kt),P=e.length}let he=$i(_),rt=Fi(I,he),Gs=await Y(rt,t,[...n,y],r);c.push({start:d.index,end:P,text:`${p}<!--webjs-hydrate-->${Gs}</${b}>`})}}catch(w){let S=Ri(w);console.error(S?`[webjs] SSR failed for <${b}>: ${S} It was touched in the component's constructor or render(), which run during SSR. Move browser-only work to connectedCallback() or a lifecycle hook (firstUpdated/updated), which SSR never calls; seed first-paint defaults in the constructor only from server-known inputs (attributes / props).`:`[webjs] SSR failed for <${b}>:`,w);let A=w instanceof Error?w:new Error(String(w)),C="";try{let _;y&&typeof y.renderError=="function"&&(_=y.renderError(A)),_===void 0&&(_=zr(b,A,r)),C=await k(_,t),C.trim()&&(C=await Y(C,t,y?[...n,y]:n,r))}catch(_){console.error(`[webjs] renderError() for <${b}> also threw:`,_),C=""}let T=d.index+u.length;if(!m){let _=d.index+u.length,P=Ye(e,_,b);if(P!==-1){let rt=new RegExp(`</${Ge(b)}\\s*>`,"i").exec(e.slice(P));T=P+(rt?rt[0].length:`</${b}>`.length)}else T=e.length}let I=h.shadow===!0,E;if(I){let _=h.styles,P=Array.isArray(_)?_:_&&me(_)?[_]:[],he=ot(P);E=`${p}<template shadowrootmode="open">${he}${C}</template>`}else E=`${p}<!--webjs-hydrate-->${C}</${b}>`;c.push({start:d.index,end:T,text:E})}}if(!c.length)return e;c.sort((d,u)=>d.start-u.start);let a=[],l=-1;for(let d of c)d.start>=l&&(a.push(d),l=d.end);let f=e;for(let d=a.length-1;d>=0;d--){let{start:u,end:b,text:g}=a[d];f=f.slice(0,u)+g+f.slice(b)}return f}var Oi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Mi(e){return Oi.has(e.toLowerCase())}async function Ii(e,t,n=[],r){if(e.indexOf("<webjs-suspense")===-1)return e;let s=/<webjs-suspense((?:"[^"]*"|'[^']*'|[^>])*?)>/i,o="",i=e;for(let c=0;c<1e4;c++){let a=s.exec(i);if(!a){o+=i;break}let l=a.index,f=a.index+a[0].length;o+=i.slice(0,l);let d=a[1]||"",u=/data-webjs-fallback="([^"]*)"/i.exec(d),b=u?Tt(u[1]):"",g=Ye(i,f,"webjs-suspense"),m,h;if(g===-1)m=i.slice(f),h="";else{m=i.slice(f,g);let p=/<\/webjs-suspense\s*>/i.exec(i.slice(g));h=i.slice(g+(p?p[0].length:17))}if(t){let p=`s${t.nextId++}`;t.pending.push({id:p,promise:Promise.resolve(Jt(m))}),o+=`<webjs-suspense id="${p}">${b}</webjs-suspense>`}else{let p=await Y(m,t,n,r);o+=`<webjs-suspense>${p}</webjs-suspense>`}i=h}return o}function Ye(e,t,n){let r=Ge(n),s=new RegExp(`<${r}(?:[\\s>/])`,"gi"),o=new RegExp(`</${r}\\s*>`,"gi");s.lastIndex=t,o.lastIndex=t;let i=1;for(;i>0;){let c=s.exec(e),a=o.exec(e);if(!a)return-1;if(c&&c.index<a.index)i++,o.lastIndex=c.index+1;else{if(i--,i===0)return a.index;s.lastIndex=a.index+1}}return-1}function Pi(e){let t=/\bslot\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(e);if(!t)return null;let n=t[1]??t[2]??t[3]??"";return n===""?null:n}function $i(e){let t=new Map,n="",r=0;for(;r<e.length;){let s=e.indexOf("<",r);if(s===-1){n+=e.slice(r);break}s>r&&(n+=e.slice(r,s));let o=e.slice(s);if(o.startsWith("<!--")){let h=e.indexOf("-->",s+4);if(h===-1){n+=o,r=e.length;break}n+=e.slice(s,h+3),r=h+3;continue}if(o.startsWith("<!")||o.startsWith("</")){let h=e.indexOf(">",s);if(h===-1){n+=o,r=e.length;break}n+=e.slice(s,h+1),r=h+1;continue}let i=/^<([a-zA-Z][\w-]*)((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/.exec(o);if(!i){n+="<",r=s+1;continue}let[c,a,l,f]=i,d=a.toLowerCase(),u=!!f||Mi(d),b=Pi(l),g;if(u)g=s+c.length;else{let h=s+c.length,p=Ye(e,h,d);if(p===-1){let C=e.slice(s);b!==null?Wr(t,b,C):n+=C,r=e.length;continue}let y=new RegExp(`</${Ge(d)}\\s*>`,"i"),w=e.slice(p),S=y.exec(w),A=S?S[0].length:`</${d}>`.length;g=p+A}let m=e.slice(s,g);b!==null?Wr(t,b,m):n+=m,r=g}return n.length>0&&t.set(null,n),t}function Wr(e,t,n){let r=e.get(t);r!==void 0?e.set(t,r+n):e.set(t,n)}function Fi(e,t){let n=new Set,r="",s=0,o=/<slot((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/gi,i;for(;(i=o.exec(e))!==null;){r+=e.slice(s,i.index);let[c,a,l]=i,f=!!l,d=/\bname\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(a),u=d?d[1]??d[2]??d[3]:null,b=a.replace(/\bname\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,"").trim(),g="",m;if(f)m=i.index+c.length;else{let w=i.index+c.length,S=Ye(e,w,"slot");if(S===-1)g=e.slice(w),m=e.length;else{g=e.slice(w,S);let A=/<\/slot\s*>/i,C=e.slice(S),T=A.exec(C),I=T?T[0].length:7;m=S+I}}let h=t.get(u),p=u!==null?` name="${$(u)}"`:"",y=b?` ${b}`:"";h!==void 0&&!n.has(u)?(n.add(u),r+=`<slot data-webjs-light data-projection="actual"${p}${y}>${h}</slot>`):r+=`<slot data-webjs-light data-projection="fallback"${p}${y}>${g}</slot>`,s=m,o.lastIndex=m}return r+=e.slice(s),r}function Ge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kt(e){return e==="script"||e==="style"}function Vr(e){let t={},n=/([a-zA-Z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g,r;for(;(r=n.exec(e))!==null;)t[r[1]]=r[2]??r[3]??r[4]??"";return t}function Bi(e,t){if(!(!e||typeof e.setAttribute!="function"))for(let[n,r]of Object.entries(t))e.setAttribute(n,Tt(r))}function Ui(e,t,n){if(!t||typeof t.getAttributeNames!="function")return e;let r="";for(let s of t.getAttributeNames()){let o=String(s).toLowerCase();if(n.has(o))continue;let i=t.getAttribute(s);r+=i===""?` ${o}`:` ${o}="${$(String(i))}"`}return r?`${e.slice(0,-1)}${r}>`:e}function qi(e,t,n){let r=n.properties||{};for(let[s,o]of Object.entries(t)){let i,c;for(let[l,f]of Object.entries(r))if(((typeof f=="object"?f:{type:f}).attribute||Di(l))===s){i=l,c=f;break}if(c===void 0&&(c=r[s]||r[An(s)],i=r[s]?s:An(s)),!c){e[i]=o;continue}let a=typeof c=="object"?c:{type:c};if(a.type===Number)e[i]=Number(o);else if(a.type===Boolean)e[i]=o!=="false";else if(a.type===Object||a.type===Array)try{e[i]=JSON.parse(Tt(o))}catch{e[i]=o}else e[i]=o}}function An(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Di(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Hi(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Tt(e){return e.replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function Wi(e){let t={};for(let n of Object.keys(e)){if(!n.startsWith("data-webjs-prop-"))continue;let r=An(n.slice(16));try{t[r]=D(Tt(e[n]))}catch{}delete e[n]}return t}function Vi(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;return n&&n.dev===void 0&&r!==void 0&&(n.dev=r),new ReadableStream({async start(s){try{if(t&&t.ssr===!1)await R(e,n,s);else{let o=await k(e,n),i=await Y(o,n,[],r);s.enqueue(i)}n&&n.pending.length&&await Ki(n,s,r),s.close()}catch(o){s.error(o)}}})}async function R(e,t,n){if(!(e==null||e===!1||e===!0)){if(e&&typeof e.then=="function")return e=await e,R(e,t,n);if(ge(e)){n.enqueue(String(e.value??""));return}if(ye(e))return R(e.value,t,n);if(oe(e))return R(e.signal.get(),t,n);if(ee(e))return R(e.value,t,n);if(te(e))return R(e.fn(),t,n);if(we(e)){let r=e.template;n.enqueue(String(r?.innerHTML??""));return}if(!ne(e)){if(re(e))return R(e.value,t,n);if(se(e)){let r=e.args;for(let s of r)if(!s||typeof s.then!="function")return R(s,t,n);if(r.length>0)try{let s=await Promise.race(r.map(o=>Promise.resolve(o).catch(()=>{})));return R(s,t,n)}catch{return}return}if(!(_e(e)||Se(e))){if(Array.isArray(e)){for(let r of e)await R(r,t,n);return}if(Q(e)){let r=e;for(let s=0;s<r.items.length;s++)await R(r.templateFn(r.items[s],s),t,n);return}if(xt(e)){let r=e;if(t){let s=`s${t.nextId++}`;n.enqueue(`<webjs-boundary id="${s}">`),await R(r.fallback,t,n),n.enqueue("</webjs-boundary>"),t.pending.push({id:s,promise:Promise.resolve(r.children)})}else await R(r.fallback,t,n);return}if(N(e)){await zi(e,t,n);return}n.enqueue(it(String(e)))}}}}async function zi(e,t,n){let{strings:r,values:s}=e,o="text",i="",c=0,a="",l=0,f="",d="",u="";for(let b=0;b<r.length;b++){let g=r[b];for(let m=0;m<g.length;m++){let h=g[m];switch(o){case"text":u+=h,h==="<"&&(o="tag-open");break;case"tag-open":u+=h,h==="!"?o="bang-1":h==="/"?(o="tag-name",f=""):/[a-zA-Z]/.test(h)?(o="tag-name",f=h.toLowerCase()):o="text";break;case"bang-1":u+=h,o=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":u+=h,h==="-"?(o="comment",l=0):o="tag-name";break;case"comment":u+=h,h==="-"?l+=1:(h===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":u+=h,h===">"?(o=kt(f)?"rawtext":"text",o==="rawtext"&&(d="")):/\s/.test(h)?o="in-tag":f+=h.toLowerCase();break;case"in-tag":u+=h,h===">"?(o=kt(f)?"rawtext":"text",o==="rawtext"&&(d="")):!/\s/.test(h)&&h!=="/"&&(o="attr-name",i=h,c=u.length-1);break;case"rawtext":u+=h,d=(d+h.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(o="text",d="",f="");break;case"attr-name":h==="="?(o="after-eq",u+=h):/\s/.test(h)?(o="in-tag",i="",u+=h):h===">"?(o="text",i="",u+=h):(i+=h,u+=h);break;case"after-eq":h==='"'||h==="'"?(o="attr-quoted",a=h,u+=h):/\s/.test(h)?(o="in-tag",i="",u+=h):h===">"?(o="text",i="",u+=h):(o="attr-unquoted",u+=h);break;case"attr-unquoted":/\s/.test(h)?(o="in-tag",i="",u+=h):(h===">"&&(o="text",i=""),u+=h);break;case"attr-quoted":u+=h,h===a&&(o="in-tag",i="");break}}if(b<s.length){let m=s[b];if(m&&typeof m.then=="function"&&(m=await m),o==="comment")u+=String(m??""),l=0;else if(o==="rawtext")u+=String(m??""),d="";else if(o==="text")u&&(n.enqueue(u),u=""),await R(m,t,n);else if(o==="after-eq"){let h=i[0],p=i.slice(1),y=be[h];y==="event"||y==="prop"?(u=u.slice(0,c),o="in-tag",i=""):y==="bool"?(u=u.slice(0,c),m&&(u+=`${p}=""`),o="in-tag",i=""):(u+=`"${$(String(m??""))}"`,o="in-tag",i="")}else(o==="attr-quoted"||o==="attr-unquoted")&&(u+=$(String(m??"")))}}u&&n.enqueue(u)}async function Ki(e,t,n){let r=Sn(),s=r?` nonce="${$(r)}"`:"";for(;e.pending.length;){let o=e.pending.splice(0);await Promise.all(o.map(async({id:i,promise:c})=>{try{let a=await c,l=await k(a,e),f=await Y(l,e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${f}</template><script${s}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(a){console.error(`[webjs] Suspense boundary "${i}" rejected:`,a);try{let l=a instanceof Error?a:new Error(String(a)),f=await Y(await k(zr("webjs-suspense",l,n),e),e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${f}</template><script${s}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(l){console.error(`[webjs] Suspense boundary "${i}" error render also threw:`,l)}}}))}}var Kr=Symbol.for("webjs.notFound"),Gr=Symbol.for("webjs.redirect");function Gi(){let e=new Error("webjs: notFound()");throw e.__webjs=Kr,e}function Yi(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=Gr,r.url=e,r.status=typeof n=="number"?n:void 0,r}function Ji(e){return!!e&&e.__webjs===Kr}function Xi(e){return!!e&&e.__webjs===Gr}function Zi(e,t={}){let n=t.reconnect!==!1,r=0,s=!1,o=null,i=[];function c(){s||(o=new WebSocket(Qi(e),t.protocols),o.onopen=a=>{for(r=0;i.length&&o&&o.readyState===WebSocket.OPEN;)o.send(i.shift());t.onOpen?.(a)},o.onmessage=a=>{let l=a.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,a)},o.onerror=a=>{t.onError?.(a)},o.onclose=a=>{if(t.onClose?.(a),!s&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(c,l)}})}return c(),{send(a){let l=typeof a=="string"||a instanceof ArrayBuffer||ArrayBuffer.isView(a)?a:JSON.stringify(a);o&&o.readyState===WebSocket.OPEN?o.send(l):i.push(l)},close(a,l){s=!0;try{o?.close(a,l)}catch{}},get socket(){return o},get readyState(){return o?.readyState??3}}}function Qi(e){if(/^wss?:\/\//i.test(e))return e;let t=typeof location<"u"&&location.protocol==="https:"?"wss:":"ws:",n=typeof location<"u"?location.host:"";return`${t}//${n}${e.startsWith("/")?e:"/"+e}`}ke();var En="application/vnd.webjs+json";async function ea(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",En);let r=t.body;r!=null&&typeof r=="object"&&!(r instanceof FormData)&&!(r instanceof Blob)&&!(r instanceof ArrayBuffer)&&!(r instanceof URLSearchParams)&&!(typeof ReadableStream<"u"&&r instanceof ReadableStream)&&!ArrayBuffer.isView(r)&&(r=await Ke(r),n.has("content-type")||n.set("content-type",En));let s=await fetch(e,{...t,headers:n,body:r}),o=s.headers.get("content-type")||"",i=await s.text(),c=o.includes(En)?i?D(i):null:o.includes("application/json")?i?JSON.parse(i):null:i;if(!s.ok){let a=c&&c.error||`richFetch ${e} -> ${s.status}`,l=new Error(a);throw l.status=s.status,l.body=c,l}return c}ke();kn();xn();jt();var Jn=class{constructor(t,n){this.host=t,this.options=n,this.updates=[],this._nextId=0}get value(){let t=this.options.source();if(!this.options.update)return this.updates.length>0?this.updates[this.updates.length-1].payload:t;for(let n of this.updates)t=this.options.update(t,n.payload);return t}add(t,n){let r=`opt-${++this._nextId}`;this.updates.push({id:r,payload:t}),this.host?.requestUpdate?.();let s=()=>{let o=this.updates.findIndex(i=>i.id===r);o!==-1&&(this.updates.splice(o,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>s()).catch(()=>{}):n.then(()=>s(),()=>s())),s}};async function Ia(e,t,n){let r=e.get();e.set(t);let s;try{s=await n()}catch(o){throw e.set(r),o}return s&&s.success===!1&&e.set(r),s}function Pa(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Ia(e,t,n):new Jn(e,t)}jn();var Vt=0,zs=new Map,$e=new Map,$a=1e3;function Fa(e){if(!(!Array.isArray(e)||!e.length)){Vt+=1;for(let t of e)t&&zs.set(t,Vt)}}function Ba(){return Vt}function Ua(e,t,n){if(!(!Array.isArray(t)||!t.length)&&($e.delete(e),$e.set(e,{tags:t.slice(),since:typeof n=="number"?n:Vt}),$e.size>$a)){let r=$e.keys().next().value;r!==void 0&&$e.delete(r)}}function qa(e){let t=$e.get(e);if(!t)return!1;for(let n of t.tags)if((zs.get(n)||0)>t.since)return!0;return!1}function Da(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var Ha="application/vnd.webjs+stream",Wa=1,Va=2,za=3,Ks=new Uint8Array(0);function Ka(e,t){let n=t||Ks,r=n.length,s=new Uint8Array(5+r);return s[0]=e&255,s[1]=r>>>24&255,s[2]=r>>>16&255,s[3]=r>>>8&255,s[4]=r&255,r&&s.set(n,5),s}function Ga(){let e=Ks;return{push(t){if(t&&t.length){let r=new Uint8Array(e.length+t.length);r.set(e,0),r.set(t,e.length),e=r}let n=[];for(;e.length>=5;){let r=e[0],s=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+s)break;let o=e.slice(5,5+s);n.push({type:r,payload:o}),e=e.slice(5+s)}return n}}}var Ya=Symbol.for("webjs.context");function Ja(e){return{__context__:Ya,name:e}}var zt=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},Xn=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=s=>{let o=s;if(o.context===this._context)if(s.stopPropagation(),o.subscribe){let i={callback:o.callback},c=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),o.callback(this._value,c)}else o.callback(this._value)},typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}setValue(t){if(!Object.is(this._value,t)){this._value=t;for(let n of this._subscriptions){let r=()=>{this._subscriptions.delete(n)};n.callback(t,r)}}}hostConnected(){this._host.addEventListener("context-request",this._onRequest)}hostDisconnected(){this._host.removeEventListener("context-request",this._onRequest),this._subscriptions.clear()}},Zn=class{constructor(t,{context:n,subscribe:r=!0}){this._host=t,this._context=n,this._subscribe=r,this._value=void 0,this._unsubscribe=void 0,typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}hostConnected(){this._dispatchRequest()}hostDisconnected(){this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=void 0)}_dispatchRequest(){let t=new zt(this._context,(n,r)=>{let s=this._value;this._value=n,r&&(this._unsubscribe=r),!Object.is(s,n)&&typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()},this._subscribe);this._host.dispatchEvent(t)}};function Xa(){return typeof window<"u"}var H={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},Qn=class{constructor(t,{task:n,args:r,autoRun:s=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=s,this._status=H.INITIAL,this._value=void 0,this._error=void 0,this._abortController=null,this._prevArgs=null,typeof t.addController=="function"&&t.addController(this)}get status(){return this._status}get value(){return this._value}get error(){return this._error}async run(){this.abort();let t=new AbortController;this._abortController=t;let n=this._argsFn();this._prevArgs=n,this._status=H.PENDING,this._error=void 0,this._requestHostUpdate();try{let r=await this._taskFn(...n,{signal:t.signal});if(t.signal.aborted)return;this._value=r,this._status=H.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=H.ERROR,this._value=void 0}finally{this._abortController===t&&(this._abortController=null)}this._requestHostUpdate()}abort(){this._abortController&&(this._abortController.abort(),this._abortController=null)}render(t={}){switch(this._status){case H.INITIAL:return t.initial?.();case H.PENDING:return t.pending?.();case H.COMPLETE:return t.complete?.(this._value);case H.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!Xa())return;let t=this._argsFn();this._argsEqual(this._prevArgs,t)||this.run()}hostUpdated(){}hostConnected(){}hostDisconnected(){this.abort()}_requestHostUpdate(){typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()}_argsEqual(t,n){if(t===null||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}};export{Zn as ContextConsumer,Xn as ContextProvider,zt as ContextRequestEvent,Wa as FRAME_CHUNK,Va as FRAME_END,za as FRAME_ERROR,v as MARKER,ss as SEED_MISS,Ha as STREAM_CONTENT_TYPE,Ue as Signal,Ci as Suspense,Qn as Task,H as TaskStatus,Ct as WebComponent,Cn as WebjsFrame,Tn as WebjsStream,si as activeActionSignal,Yt as adoptStyles,yn as allTags,co as asyncAppend,lo as asyncReplace,_o as batch,io as cache,Ao as computed,Zi as connectWS,qa as consumeStale,Ja as createContext,Ga as createFrameDecoder,oo as createRef,Sn as cspNonce,Qs as css,Fr as deserialize,us as disableClientRouter,vo as effect,Bn as enableClientRouter,Ka as encodeFrame,$ as escapeAttr,it as escapeText,Ba as fetchMark,no as guard,Gt as html,_e as isAsyncAppend,Se as isAsyncReplace,me as isCSS,re as isCache,te as isGuard,ee as isKeyed,ai as isLazy,ye as isLive,Ji as isNotFound,Xi as isRedirect,ne as isRef,Q as isRepeat,Eo as isSignal,xt as isSuspense,N as isTemplate,we as isTemplateContent,ge as isUnsafeHTML,se as isUntil,oe as isWatch,to as keyed,eo as live,gn as lookup,ii as lookupModuleUrl,Fa as markStale,fs as navigate,Gi as notFound,Pa as optimistic,D as parse,Da as parseTagHeader,oi as primeModuleUrl,vi as prop,Yi as redirect,so as ref,bn as register,Ua as registerKeyTags,xe as render,Nn as renderStream,Vi as renderToStream,ki as renderToString,sr as repeat,ds as revalidate,ea as richFetch,Rt as scanSeeds,$r as serialize,_t as setActiveActionSignal,xi as setCspNonceProvider,So as signal,Ke as stringify,ot as stylesToString,Et as tagOf,aa as takeSeed,ro as templateContent,Jt as unsafeHTML,ao as until,uo as watch};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webjsdev/core",
3
- "version": "0.7.29",
3
+ "version": "0.7.30",
4
4
  "type": "module",
5
5
  "description": "webjs core runtime - html/css tags, WebComponent base, isomorphic renderers",
6
6
  "types": "./index.d.ts",
package/src/component.js CHANGED
@@ -573,7 +573,7 @@ class WebComponentBase extends Base {
573
573
  `properties via the factory instead: \`class ${name} extends WebComponent({ ` +
574
574
  `count: Number })\`. Use the \`prop()\` helper for options ` +
575
575
  `(\`prop(Number, { reflect: true })\`) and set defaults in the ` +
576
- `constructor after \`super()\`. See https://docs.webjs.com/docs/components.`,
576
+ `constructor after \`super()\`. See https://docs.webjs.dev/docs/components.`,
577
577
  );
578
578
  }
579
579
  C = Object.getPrototypeOf(C);