@webjsdev/core 0.7.35 → 0.7.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/webjs-core-browser.js +2 -2
- package/dist/webjs-core-browser.js.map +2 -2
- package/dist/webjs-core-testing.js +16 -16
- package/dist/webjs-core-testing.js.map +2 -2
- package/dist/webjs-core.js +3 -3
- package/dist/webjs-core.js.map +2 -2
- package/package.json +1 -1
- package/src/component.d.ts +8 -0
- package/src/component.js +10 -0
- package/src/render-server.js +38 -0
- package/src/router-client.js +84 -3
- package/src/webjs-config.d.ts +21 -3
package/dist/webjs-core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var ao=Object.defineProperty;var H=(e,t)=>()=>(e&&(t=e(e=0)),t);var ar=(e,t)=>{for(var n in t)ao(e,n,{get:t[n],enumerable:!0})};function Zt(e,...t){return{_$webjs:"template",strings:e,values:t}}function N(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var C,Be=H(()=>{C="wjm-"});function br(e){if(!e||e.nodeType!==8)return!1;let t=e.nodeValue;return t===Io||t===Mo}function Po(e){for(let t of e.addedNodes)if(br(t))return!0;for(let t of e.removedNodes)if(br(t))return!0;return!1}function Sr(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function Fo(){gr||(We=Sr(),We&&(He=HTMLSlotElement.prototype.assignedNodes,fn=HTMLSlotElement.prototype.assignedElements,ht=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(t){return this.hasAttribute(B)&&!yr(this)?dn(this,t):He?He.call(this,t):[]},HTMLSlotElement.prototype.assignedElements=function(t){return this.hasAttribute(B)&&!yr(this)?dn(this,t).filter(n=>n.nodeType===1):fn?fn.call(this,t):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let t=ht&&ht.get?ht.get.call(this):null;return t||Bo(this)}}),gr=!0))}function yr(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 dn(e,t){if(e.getAttribute(z)===Ar)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:pn(n,new Set,0)}function pn(e,t,n){if(n>=$o)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(B)){let i=dn(o,{flatten:!1});if(i.length>0)for(let c of pn(i,t,n+1))r.push(c);else for(let c of pn(Array.from(o.childNodes),t,n+1))r.push(c)}else if(He){let i=He.call(o,{flatten:!0});for(let c of i)r.push(c)}else r.push(s)}else r.push(s);return r}function Bo(e){let t=e.parentElement;for(;t;){if(t.tagName==="SLOT"&&t.hasAttribute(B))return t.getAttribute(z)===le?t:null;t=t.parentElement}return null}function Y(e){let t=e,n=t[W];return n||(n={assignedByName:new Map,pendingByName:new Map,lastSnapshot:new WeakMap,nameObservers:new WeakMap,childObserver:null,scheduled:!1,ownedSlots:new Set},t[W]=n),n}function hn(e){return!!e[W]}function Er(e){let t=Y(e);for(;e.firstChild;){let n=e.firstChild,r=mt(n);bt(t.assignedByName,r,n),e.removeChild(n)}}function Cr(e){let t=Y(e),n=e.querySelectorAll(`slot[${B}]`);for(let r of n){let s=r;if(s.getAttribute(z)!==le)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 mt(e){if(e.nodeType!==1)return null;let n=e.getAttribute("slot");return n||null}function bt(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function vr(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 xr(e){if(!We)return;let t=Y(e);t.childObserver||(t.childObserver=new MutationObserver(n=>{let r=!1;for(let s of n)if(!Po(s)){if(s.type==="childList"){for(let o of s.addedNodes)o.parentElement===e&&(bt(t.assignedByName,mt(o),o),r=!0);for(let o of s.removedNodes)e.contains(o)||wr(t,o)&&(r=!0)}else if(s.type==="attributes"&&s.attributeName==="slot"){let o=s.target;(wr(t,o)||o.parentElement===e)&&(bt(t.assignedByName,mt(o),o),r=!0)}}r&&yt(e)}),t.childObserver.observe(e,{childList:!0,attributes:!0,attributeFilter:["slot"],subtree:!0}))}function kr(e){let t=e[W];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 wr(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 yt(e){let t=Y(e);t.scheduled||(t.scheduled=!0,queueMicrotask(()=>{t.scheduled=!1,Uo(e)}))}function Uo(e){if(!We)return;let t=e[W];if(!t)return;let n=Array.from(e.querySelectorAll(`slot[${B}]`)),r=new Set(n);for(let i of t.ownedSlots)r.has(i)||qo(t,i);for(let i of r)t.ownedSlots.has(i)||Do(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?mn(t,f,a)&&o.push(f):bn(t,f)&&o.push(f)}}for(let i of o)ze(i)}function qo(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;vr(e.pendingByName,s,r)}e.lastSnapshot.delete(t)}function mn(e,t,n){let r=t.getAttribute(z)!==le,s=e.lastSnapshot.get(t)||[];if(!r&&Ho(s,n))return!1;let i=t[gt];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(z,le),e.lastSnapshot.set(t,n.slice()),!0}function bn(e,t){let n=t.getAttribute(z)===le;if(t.setAttribute(z,Ar),!n)return _r(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return _r(t),!0}function _r(e){let t=e[gt];!t||t.childNodes.length===0||e.appendChild(t)}function Do(e,t){if(!We)return;let n=Y(e);if(n.nameObservers.has(t))return;let r=new MutationObserver(()=>yt(e));r.observe(t,{attributes:!0,attributeFilter:["name"]}),n.nameObservers.set(t,r)}function Tr(e,t){if(!hn(e))return;let n=Y(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);vr(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 ze(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function Ho(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 Io,Mo,We,W,B,z,le,Ar,gt,$o,He,fn,ht,gr,wt=H(()=>{Be();Io=`${C}s`,Mo=`${C}e`;We=Sr(),W=Symbol("webjs.slot.state"),B="data-webjs-light",z="data-projection",le="actual",Ar="fallback",gt=Symbol("webjs.slot.fallbackFrag"),$o=64,He=null,fn=null,ht=null,gr=!1;Fo()});function Dr(e,t,n){hi.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function Ye(e){return JSON.stringify(await Hr(e))}function V(e){return Wr(JSON.parse(e))}async function Hr(e){let t=mi();return await bi(e,t),ue(e,t)}function Wr(e){return Z(e,_i())}function mi(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function bi(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!Ai(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(Ei(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 ue(e,t){if(e===null)return null;if(e===void 0)return{[v]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[v]:"NaN"}:e===1/0?{[v]:"Inf"}:e===-1/0?{[v]:"-Inf"}:Object.is(e,-0)?{[v]:"-0"}:e;if(n==="bigint")return{[v]:"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{[v]:"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{[v]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let s;if(e instanceof Date)s={[v]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)s={[v]:"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={[v]:"File",v:Ge(o),n:e.name,t:e.type||"",m:e.lastModified}:s={[v]:"Blob",v:Ge(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,ue(a,t)]);s={[v]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)s=gi(e);else if(e instanceof Map){let o=[];for(let[i,c]of e)o.push([ue(i,t),ue(c,t)]);s={[v]:"Map",v:o}}else if(e instanceof Set){let o=[];for(let i of e)o.push(ue(i,t));s={[v]:"Set",v:o}}else if(Array.isArray(e))s=e.map(o=>ue(o,t));else{s={};for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let i=Ci(o)?"_"+o:o;Dr(s,i,ue(e[o],t))}}if(r!==void 0){if(Array.isArray(s))return{[v]:"Arr",_id:r,v:s};s._id=r}return s}function gi(e){if(e instanceof ArrayBuffer)return{[v]:"buf",v:Ge(new Uint8Array(e))};if(e instanceof DataView)return{[v]:"dv",v:Ge(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=yi[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[v]:n,v:Ge(r)}}function _i(){return{refs:new Map}}function Z(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(Z(e[i],t));return o}let n=e[v];if(typeof n=="string")return Si(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=vi(o)?o.slice(1):o;Dr(r,i,Z(e[o],t))}return r}function Si(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(Z(i,n),Z(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(Z(i,n));return o}case"Arr":{let o=[];typeof r=="number"&&n.refs.set(r,o);for(let i of e.v)o.push(Z(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=Ke(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=Ke(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=Z(c,n);o.append(i,a)}return o}default:{if(t==="buf"){let i=Ke(e.v);return s(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=Ke(e.v);return s(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let o=wi[t];if(o){let i=Ke(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 Ai(e){return e!==null&&typeof e=="object"}function Ei(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ci(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function vi(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function Ge(e){if(zr)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 Ke(e){if(zr){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 v,hi,yi,wi,zr,Te=H(()=>{v="_$wj",hi=new Set(["__proto__","constructor","prototype"]);yi={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},wi={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};zr=typeof Buffer<"u"&&typeof Buffer.from=="function"});var os={};ar(os,{observeLazy:()=>fa,observeViewportOnce:()=>ha});function ss(e){let t=jn.get(e);return t||(t=import(e).finally(()=>jn.delete(e)),jn.set(e,t),t)}function fa(e){for(let[t,n]of Object.entries(e))fe.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of fe.values())ss(t);fe.clear();return}Qe||(Qe=new IntersectionObserver(da,{rootMargin:"200px"})),rs(),typeof MutationObserver<"u"&&new MutationObserver(()=>rs()).observe(document.body,{childList:!0,subtree:!0})}function rs(){if(!(!Qe||!fe.size))for(let e of fe.keys())for(let t of document.querySelectorAll(e))Qe.observe(t)}function da(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=fe.get(n);r&&(ss(r),fe.delete(n),Qe?.unobserve(t.target))}}function pa(e){for(let t of e){if(!t.isIntersecting)continue;let n=Lt.get(t.target);Lt.delete(t.target),Ze?.unobserve(t.target),n&&n()}}function ha(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(Ze||(Ze=new IntersectionObserver(pa,{rootMargin:"200px"})),Lt.set(e,t),Ze.observe(e),()=>{Lt.delete(e),Ze?.unobserve(e)})}var fe,Qe,jn,Ze,Lt,is=H(()=>{fe=new Map,Qe=null,jn=new Map;Ze=null,Lt=new WeakMap});var Rn,Ln=H(()=>{Rn=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(()=>(is(),os)).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(()=>(On(),as)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&Rn&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",Rn)});function ba(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 Mn(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 ma,In,Ot=H(()=>{ma=new Set(["append","prepend","before","after","replace","update"]);In=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=ma.has(t)?this.querySelector("template"):null;try{for(let i of r){let c=o?o.content.cloneNode(!0):null;ba(t,i,c)}}finally{this.remove()}}}:null;typeof customElements<"u"&&In&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",In)});var cs,ls=H(()=>{cs=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&cs&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",cs)});function It(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]'))fs(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))fs(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function fs(e,t,n){if(e)try{let r=V(e);if(r&&typeof r=="object")for(let s in r)et.has(s)||et.set(s,r[s])}catch{}n?n():t.remove?.()}function ga(e,t,n){us||(us=!0,It());let r=`${e}/${t}/${n}`;if(et.has(r)){let s=et.get(r);return et.delete(r),s}return ds}var et,ds,us,Pn=H(()=>{Te();et=new Map,ds=Symbol("webjs.seed.miss"),us=!1});var as={};ar(as,{_FRAME_TOP:()=>Ts,_LIVE_ATTRS:()=>Hn,_activeFrameId:()=>ks,_addNewHeadElements:()=>Wn,_applyStreamedResolve:()=>Qs,_applySwap:()=>Qn,_blurOutgoingFocus:()=>$t,_buildSubmitFormData:()=>vs,_bumpNavToken:()=>Wa,_clearFormBusy:()=>Hs,_clearFrameBusy:()=>qs,_collectChildrenSlots:()=>Pe,_currentPageUrl:()=>za,_diffElementInPlace:()=>Wt,_eligibleAnchorHref:()=>Bt,_findAnchorInPath:()=>xs,_getSubmitAction:()=>Cs,_getSubmitMethod:()=>Es,_isNonHtmlPath:()=>Ga,_keyOf:()=>Me,_longestSharedPath:()=>js,_markFormBusy:()=>Ds,_markFrameBusy:()=>Us,_mergeHead:()=>Js,_navToken:()=>Ha,_onPopState:()=>Vn,_onSubmit:()=>Kn,_prefetch:()=>$e,_prefetchCache:()=>T,_prefetchHasHoverPointer:()=>Ms,_prefetchInflightSize:()=>qa,_prefetchMode:()=>Ut,_prefetchPeek:()=>Ua,_prefetchSaysSaveData:()=>Jn,_prefetchSuppressed:()=>Ps,_prefetchTake:()=>$s,_reactivateScripts:()=>zt,_readStreamedShell:()=>Xs,_reconcileChildren:()=>Gt,_regraftPermanentElements:()=>zs,_regraftPermanentInSlice:()=>Zn,_resetPrefetch:()=>Da,_resetWarnOnce:()=>Ka,_resolveTargetFrameId:()=>Gn,_restoreOptimistic:()=>tt,_runWithTransition:()=>Pt,_setCurrentPageUrl:()=>Va,_snapshotCache:()=>L,_streamBoundariesProgressively:()=>eo,_takeResolveUnit:()=>Zs,_viewTransitionsEnabled:()=>Ws,collectChildrenSlots:()=>Pe,disableClientRouter:()=>ws,enableClientRouter:()=>zn,loadFrame:()=>wa,longestSharedPath:()=>js,navigate:()=>_s,revalidate:()=>Ss});function ys(e){return typeof Document<"u"&&typeof Document.parseHTMLUnsafe=="function"?Document.parseHTMLUnsafe(e):typeof DOMParser<"u"?new DOMParser().parseFromString(e,"text/html"):null}function ya(){$n||typeof MutationObserver>"u"||typeof customElements>"u"||($n=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)}}),$n.observe(document.body,{childList:!0,subtree:!0}))}function zn(){te||typeof document>"u"||(te=!0,document.addEventListener("click",As,!1),document.addEventListener("submit",Kn,!1),window.addEventListener("popstate",Vn),document.addEventListener("pointerover",Ie,!0),document.addEventListener("focusin",Ie,!0),document.addEventListener("touchstart",Ie,{capture:!0,passive:!0}),document.addEventListener("pointerout",Fs,!0),document.addEventListener("webjs:navigate",Dn),ya(),Dn(),typeof history<"u"&&"scrollRestoration"in history&&(Mt=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(D=location.href))}function ws(){te&&(te=!1,document.removeEventListener("click",As,!1),document.removeEventListener("submit",Kn,!1),window.removeEventListener("popstate",Vn),document.removeEventListener("pointerover",Ie,!0),document.removeEventListener("focusin",Ie,!0),document.removeEventListener("touchstart",Ie,{capture:!0}),document.removeEventListener("pointerout",Fs,!0),document.removeEventListener("webjs:navigate",Dn),Kt(),Xn(),ee&&(ee.disconnect(),ee=null),typeof history<"u"&&Mt!==null&&(history.scrollRestoration=Mt,Mt=null),D=null)}async function _s(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){location.href=e;return}await Yn(n.href,t?.replace??!1,null)}async function wa(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};P&&P.abort(),P=new AbortController;let s=P.signal,o=++j;return qt(r.href,n,!1,null,"GET",null,s,o)}function Ss(e){if(!e){L.clear(),T.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;L.delete(n),T.delete(n)}function As(e){if(!te||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=xs(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||Vt.test(r.pathname))return;e.preventDefault();let s=Gn(t);Yn(n,!1,s)}function Vn(e){Yn(location.href,!0,null)}function Kn(e){if(!te||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=Es(t,n);if(s==="dialog")return;let o=Cs(t,n),i;try{i=new URL(o,location.href)}catch{return}if(i.origin!==location.origin||Vt.test(i.pathname))return;let c=vs(t,n);e.preventDefault();let a=Gn(n||t);Aa(i.href,s,c,a,t)}function Es(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function Cs(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function vs(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 xs(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function ks(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===Ts)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Ns(`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 ks(e)}function Ns(e,t){Bn.has(e)||(Bn.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function hs(){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"&&Ns("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 Pe(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 js(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 Rs(e){let t=he(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),L.has(t)&&L.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(L.set(t,n);L.size>_a;){let r=L.keys().next().value;L.delete(r)}}function Sa(e){let t=he(e),n=L.get(t);return n==null?null:(L.delete(t),L.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function he(e){let t=new URL(e,location.href);return t.pathname+t.search}async function Yn(e,t,n){P&&P.abort(),P=new AbortController;let r=P.signal,s=++j;D&&Rs(D);let o=setTimeout(()=>{Ft(!0),o=null},150),i=null;t||(i=Ks());try{if(t){let c=Sa(e);if(c){let a=ys(c.html);if(a){Qn(a,n,!0,null),typeof window<"u"&&window.scrollTo({left:c.scrollX,top:c.scrollY,behavior:"instant"}),qt(e,n,!1,i,"GET",null,r,s).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await qt(e,n,!t,i,"GET",null,r,s)}finally{o&&clearTimeout(o),s===j&&(Ft(!1),typeof location<"u"&&(D=location.href))}}async function Aa(e,t,n,r,s){P&&P.abort(),P=new AbortController;let o=P.signal,i=++j,c=t==="get"||t==="head",a=new URL(e,location.href);if(c){a.search="";for(let[m,g]of n)a.searchParams.append(m,typeof g=="string"?g:g.name)}D&&Rs(D);let l=setTimeout(()=>{Ft(!0),l=null},150),f=Ks(),d=s?Ds(s,i,a.href):null,u=!1;try{let m=await qt(a.href,r,!0,f,c?"GET":t.toUpperCase(),c?null:n,o,i);u=!!(m&&m.ok),!c&&i===j&&(L.clear(),T.clear())}finally{d&&Hs(d,i,a.href,u),l&&clearTimeout(l),i===j&&(Ft(!1),typeof location<"u"&&(D=location.href))}}function Ls(){return[...Pe(document.body).keys()].join(",")}function Jn(){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 Ms(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function ka(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function Bt(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||Vt.test(n.pathname)?null:t}function Ps(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=ka(e);return t.includes("external")||t.includes("no-prefetch")}function Ut(e){if(Ps(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 Ms()?"intent":"viewport"}}function $e(e){if(!te||typeof fetch!="function"||Jn())return;let t=he(e);if(de.has(t)||nt.has(t))return;let n=T.get(t);if(n&&qn()-n.at<Os)return;if(de.size>=Is){for(nt.add(t),Le.push(e);Le.length>Ca;){let o=Le.shift();nt.delete(he(o))}return}de.add(t);let r={"x-webjs-router":"1","x-webjs-prefetch":"1"},s=Ls();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.headers.get("x-webjs-src"),l=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,f=l?l.getAttribute("data-webjs-build"):null,d=l?l.getAttribute("data-webjs-src"):null;(c&&f&&c!==f||a&&d&&a!==d)&&(L.clear(),T.clear());let u=o.redirected&&o.url?o.url:e,m=await o.text();Na(t,{html:m,build:c,src:a,finalUrl:u,at:qn()})}).catch(()=>{}).finally(()=>{de.delete(t),Ta()})}function Ta(){for(;Le.length&&de.size<Is;){let e=Le.shift();nt.delete(he(e)),$e(e)}}function Na(e,t){for(T.has(e)&&T.delete(e),T.set(e,t);T.size>Ea;){let n=T.keys().next().value;T.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function $s(e){let t=he(e),n=T.get(t);return!n||(T.delete(t),qn()-n.at>=Os)?null:n}function qn(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function Ie(e){if(!te)return;let t=Bs(e.target);if(!t)return;let n=Ut(t);if(n==="none"||n==="render")return;let r=Bt(t);if(r){if(e.type==="touchstart"){$e(r);return}n==="intent"&&(rt===t&&Oe||(Kt(),rt=t,Oe=setTimeout(()=>{Oe=null,rt=null,$e(r)},va)))}}function Fs(e){let t=Bs(e.target);t&&t===rt&&Kt()}function Kt(){Oe&&(clearTimeout(Oe),Oe=null),rt=null}function Xn(){for(let e of st)clearTimeout(e);st.clear(),je=new WeakMap}function Bs(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"||Jn())return;let e=typeof IntersectionObserver<"u";e&&(ee?(ee.disconnect(),Xn()):ee=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(je.has(r))continue;let s=setTimeout(()=>{st.delete(s),je.delete(r),ee.unobserve(r);let o=Bt(r);o&&Ut(r)==="viewport"&&$e(o)},xa);je.set(r,s),st.add(s)}else{let s=je.get(r);s&&(clearTimeout(s),st.delete(s),je.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=Ut(t);if(n==="render"){let r=Bt(t);r&&$e(r)}else n==="viewport"&&e&&ee.observe(t)}}function ja(e){if(typeof document>"u"||!document.body)return!1;let t=Pe(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 Fn(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||ja(t)||typeof location<"u"&&(location.href=e)}async function qt(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,m=null,g=!1,p=e,h=t?Us(t,a):null;try{try{let y=s==="GET"&&!o&&!t?$s(e):null;if(y)l=y.html,d=y.build,u=y.src,p=y.finalUrl,m=200,g=!0;else{let w={"x-webjs-router":"1"},E=Ls();E&&(w["x-webjs-have"]=E),t&&(w["x-webjs-frame"]=t),o!=null&&s!=="GET"&&s!=="HEAD"&&(w.accept=ps+", text/html");let R={method:s,headers:w,credentials:"same-origin"};i&&(R.signal=i),o!=null&&s!=="GET"&&s!=="HEAD"&&(R.body=o);let _=await fetch(e,R);m=_.status,g=_.ok;let x=_.headers.get("content-type")||"",M=/^text\/html\b/i.test(x);if(x.toLowerCase().indexOf(ps)===0){let I=await _.text();return a===j&&(tt(r),Mn(I)),{ok:g,status:m,aborted:!1}}if(_.redirected&&_.url&&(p=_.url),_.status===204||_.status===205)return a===j&&n&&history.pushState(null,"",p),{ok:g,status:m,aborted:!1};if(!M)return a===j&&(tt(r),Fn(e,_.status,null)),{ok:!1,status:m,aborted:!1};d=_.headers.get("x-webjs-build"),u=_.headers.get("x-webjs-src");let S=await Xs(_);l=S.shell,S.streaming&&(f=S)}}catch(y){return y&&y.name==="AbortError"?{ok:!1,status:null,aborted:!0}:a!==j?{ok:!1,status:null,aborted:!0}:(tt(r),Fn(e,null,y instanceof Error?y:new Error(String(y))),{ok:!1,status:null,aborted:!1})}if(a!==j){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:!1,status:m,aborted:!0}}let b=ys(l);if(!b)return tt(r),Fn(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:m,aborted:!1};if(Qn(b,t,!1,p,d,u),n&&history.pushState(null,"",p),n){let y=new URL(p);if(y.hash){let w=document.getElementById(y.hash.slice(1));w?w.scrollIntoView():(hs(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else hs(),window.scrollTo({left:0,top:0,behavior:"instant"})}return f&&(f.reader||f.rest)&&eo(f.reader,f.dec,f.rest,()=>a===j),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:p,frameId:t,from:"navigate"}})),{ok:g,status:m,aborted:!1}}finally{h&&qs(h,a)}}function Us(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=Dt.has(n);return Dt.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 qs(e,t){if(Dt.get(e)!==t)return;Dt.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 Ds(e,t,n){let r=Ht.has(e);return Ht.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 Hs(e,t,n,r){if(Ht.get(e)!==t)return;Ht.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 ms(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+=pe(r);return n}function Ws(){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 Pt(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(Ws()&&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 zs(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=Ra(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 Ra(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 La(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&Re(t)}function Qn(e,t,n,r,s,o){try{It(e)}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let d=document.querySelector('script[type="importmap"]'),u=d?d.getAttribute("data-webjs-build"):null,m=!1;if(s&&u&&(m=s!==u),!m&&e.head&&e.head.children.length>0){let g=ms(document),p=ms(e);g!==p&&(m=!0)}if(m&&typeof location<"u"){L.clear(),T.clear();try{let g="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(g))sessionStorage.removeItem(g);else{sessionStorage&&sessionStorage.setItem(g,"1"),location.href=r;return}}catch{location.href=r;return}}else if(!m){let g=d?d.getAttribute("data-webjs-src"):null;o&&g&&o!==g&&(L.clear(),T.clear(),d&&d.setAttribute("data-webjs-src",o));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){let d=document.querySelector(`webjs-frame#${CSS.escape(t)}`),u=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(d&&u){Wn(e.head),Pt(()=>{Ba(d,u),zt(d),Re(d),$t()},()=>Re(d)),gs(e.body);return}let m=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});(d||document).dispatchEvent(m),m.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`);return}let i=Pe(document.body),c=Pe(e.body),a=js(i,c);if(a){Wn(e.head),Pt(()=>{Oa(i.get(a),c.get(a),e),$t()},()=>La(i.get(a))),gs(e.body);return}Js(e.head),zs(document.body,e.body);let l=[...e.body.childNodes];Pt(()=>{document.body.replaceChildren(...l),zt(document.body),Re(document.body),$t()},()=>Re(document.body))}function $t(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function Oa(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),Ia(r,e.start,e.end,s,o);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(zt(i),Re(i))}function Ia(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);Wt(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 Wt(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);if(Ma(e)){Fa(e,t);return}Gt(e,t)}function Ma(e){return e[Symbol.for("webjs.instance")]!=null}function Vs(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function bs(e){let t=new Map,n=`slot[${B}][${z}="${le}"]`;for(let r of e.querySelectorAll(n)){let s=r;if(!Vs(s,e))continue;let o=s.getAttribute("name")||null;t.has(o)||t.set(o,s)}return t}function Pa(e,t){for(let n of e.querySelectorAll(`slot[${B}]`)){let r=n;if(Vs(r,e)&&(r.getAttribute("name")||null)===t)return r}return null}function $a(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Fa(e,t){let n=e[W];if(!n)return;let r=bs(e),s=bs(t);if(r.size===0&&s.size===0)return;let o=new Set([...r.keys(),...s.keys()]);for(let i of o){let c=r.get(i),a=s.get(i);if(c&&a){let l=n.lastSnapshot.get(c)||[];Gt(c,a);let f=[...c.childNodes];n.assignedByName.set(i,f),n.lastSnapshot.set(c,f.slice()),$a(l,f)||ze(c)}else if(c&&!a)n.assignedByName.delete(i),bn(n,c)&&ze(c);else{let l=Pa(e,i);if(!l)continue;let f=[...a.childNodes].map(d=>document.importNode(d,!0));n.assignedByName.set(i,f),mn(n,l,f)&&ze(l)}}}function Gt(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);Wt(d,a),o.push(d),s.delete(l);continue}let f=n[c];if(f&&f.nodeType===1&&!Me(f)&&f.tagName===a.tagName){Wt(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 Ks(){let e=Pe(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 tt(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 Ba(e,t){Gt(e,t)}function Gs(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function er(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=Gs();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Ys(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=Gs();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function pe(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Wn(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(pe(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(n.has(pe(r))||(r.tagName==="SCRIPT"?document.head.appendChild(er(r)):document.head.appendChild(Ys(r))))}function Js(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(pe(o));let s=new Set;for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&s.add(pe(o));for(let o of[...t.children])o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(s.has(pe(o))||o.remove());for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(r.has(pe(o))||(o.tagName==="SCRIPT"?t.appendChild(er(o)):t.appendChild(Ys(o))))}function Re(e){typeof customElements>"u"||tr(e)}function tr(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&&tr(n.shadowRoot))}function gs(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]"))document.body.appendChild(t.cloneNode(!0))}async function Xs(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 Zs(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 Qs(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&&tr(o)}async function eo(e,t,n,r){let s=n,o=()=>{let i;for(;i=Zs(s);){if(!r())return!1;Qs(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 zt(e){for(let t of e.querySelectorAll("script"))t.replaceWith(er(t))}function Ua(e){return T.get(he(e))||null}function qa(){return de.size}function Da(){T.clear(),de.clear(),Le.length=0,nt.clear(),Kt(),Xn()}function Ha(){return j}function Wa(){return++j}function za(){return D}function Va(e){D=e}function Ka(){Bn.clear(),Un=!1}function Ga(e){return Vt.test(e)}var ps,te,P,j,$n,D,Mt,Vt,Ts,Bn,Un,_a,L,Ea,Os,Is,Ca,va,xa,T,de,Le,nt,Oe,rt,ee,je,st,Dt,Ht,Hn,On=H(()=>{Ln();Ot();Ot();ls();Pn();wt();ps="text/vnd.webjs-stream.html";te=!1,P=null,j=0,$n=null;D=null,Mt=null;Vt=/\.(?: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;Ts="_top";Bn=new Set;Un=!1;_a=16,L=new Map;Ea=8,Os=3e4,Is=3,Ca=24,va=100,xa=250,T=new Map,de=new Set,Le=[],nt=new Set,Oe=null,rt=null,ee=null,je=new WeakMap,st=new Set;Dt=new WeakMap;Ht=new WeakMap;Hn=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&zn()});Be();function co(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 be(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function Qt(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(`
|
|
1
|
+
var co=Object.defineProperty;var H=(e,t)=>()=>(e&&(t=e(e=0)),t);var lr=(e,t)=>{for(var n in t)co(e,n,{get:t[n],enumerable:!0})};function Zt(e,...t){return{_$webjs:"template",strings:e,values:t}}function N(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var C,Be=H(()=>{C="wjm-"});function yr(e){if(!e||e.nodeType!==8)return!1;let t=e.nodeValue;return t===Io||t===Po}function $o(e){for(let t of e.addedNodes)if(yr(t))return!0;for(let t of e.removedNodes)if(yr(t))return!0;return!1}function Er(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function Bo(){wr||(We=Er(),We&&(He=HTMLSlotElement.prototype.assignedNodes,fn=HTMLSlotElement.prototype.assignedElements,ht=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(t){return this.hasAttribute(B)&&!_r(this)?dn(this,t):He?He.call(this,t):[]},HTMLSlotElement.prototype.assignedElements=function(t){return this.hasAttribute(B)&&!_r(this)?dn(this,t).filter(n=>n.nodeType===1):fn?fn.call(this,t):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let t=ht&&ht.get?ht.get.call(this):null;return t||Uo(this)}}),wr=!0))}function _r(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 dn(e,t){if(e.getAttribute(z)===Cr)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:pn(n,new Set,0)}function pn(e,t,n){if(n>=Fo)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(B)){let i=dn(o,{flatten:!1});if(i.length>0)for(let c of pn(i,t,n+1))r.push(c);else for(let c of pn(Array.from(o.childNodes),t,n+1))r.push(c)}else if(He){let i=He.call(o,{flatten:!0});for(let c of i)r.push(c)}else r.push(s)}else r.push(s);return r}function Uo(e){let t=e.parentElement;for(;t;){if(t.tagName==="SLOT"&&t.hasAttribute(B))return t.getAttribute(z)===le?t:null;t=t.parentElement}return null}function Y(e){let t=e,n=t[W];return n||(n={assignedByName:new Map,pendingByName:new Map,lastSnapshot:new WeakMap,nameObservers:new WeakMap,childObserver:null,scheduled:!1,ownedSlots:new Set},t[W]=n),n}function hn(e){return!!e[W]}function vr(e){let t=Y(e);for(;e.firstChild;){let n=e.firstChild,r=mt(n);bt(t.assignedByName,r,n),e.removeChild(n)}}function xr(e){let t=Y(e),n=e.querySelectorAll(`slot[${B}]`);for(let r of n){let s=r;if(s.getAttribute(z)!==le)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 mt(e){if(e.nodeType!==1)return null;let n=e.getAttribute("slot");return n||null}function bt(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function kr(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 Tr(e){if(!We)return;let t=Y(e);t.childObserver||(t.childObserver=new MutationObserver(n=>{let r=!1;for(let s of n)if(!$o(s)){if(s.type==="childList"){for(let o of s.addedNodes)o.parentElement===e&&(bt(t.assignedByName,mt(o),o),r=!0);for(let o of s.removedNodes)e.contains(o)||Sr(t,o)&&(r=!0)}else if(s.type==="attributes"&&s.attributeName==="slot"){let o=s.target;(Sr(t,o)||o.parentElement===e)&&(bt(t.assignedByName,mt(o),o),r=!0)}}r&&yt(e)}),t.childObserver.observe(e,{childList:!0,attributes:!0,attributeFilter:["slot"],subtree:!0}))}function Nr(e){let t=e[W];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 Sr(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 yt(e){let t=Y(e);t.scheduled||(t.scheduled=!0,queueMicrotask(()=>{t.scheduled=!1,qo(e)}))}function qo(e){if(!We)return;let t=e[W];if(!t)return;let n=Array.from(e.querySelectorAll(`slot[${B}]`)),r=new Set(n);for(let i of t.ownedSlots)r.has(i)||Do(t,i);for(let i of r)t.ownedSlots.has(i)||Ho(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?mn(t,f,a)&&o.push(f):bn(t,f)&&o.push(f)}}for(let i of o)ze(i)}function Do(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;kr(e.pendingByName,s,r)}e.lastSnapshot.delete(t)}function mn(e,t,n){let r=t.getAttribute(z)!==le,s=e.lastSnapshot.get(t)||[];if(!r&&Wo(s,n))return!1;let i=t[gt];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(z,le),e.lastSnapshot.set(t,n.slice()),!0}function bn(e,t){let n=t.getAttribute(z)===le;if(t.setAttribute(z,Cr),!n)return Ar(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Ar(t),!0}function Ar(e){let t=e[gt];!t||t.childNodes.length===0||e.appendChild(t)}function Ho(e,t){if(!We)return;let n=Y(e);if(n.nameObservers.has(t))return;let r=new MutationObserver(()=>yt(e));r.observe(t,{attributes:!0,attributeFilter:["name"]}),n.nameObservers.set(t,r)}function jr(e,t){if(!hn(e))return;let n=Y(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);kr(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 ze(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function Wo(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 Io,Po,We,W,B,z,le,Cr,gt,Fo,He,fn,ht,wr,wt=H(()=>{Be();Io=`${C}s`,Po=`${C}e`;We=Er(),W=Symbol("webjs.slot.state"),B="data-webjs-light",z="data-projection",le="actual",Cr="fallback",gt=Symbol("webjs.slot.fallbackFrag"),Fo=64,He=null,fn=null,ht=null,wr=!1;Bo()});function Wr(e,t,n){mi.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function Ye(e){return JSON.stringify(await zr(e))}function V(e){return Vr(JSON.parse(e))}async function zr(e){let t=bi();return await gi(e,t),ue(e,t)}function Vr(e){return Z(e,Si())}function bi(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function gi(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!Ei(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(Ci(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 ue(e,t){if(e===null)return null;if(e===void 0)return{[v]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[v]:"NaN"}:e===1/0?{[v]:"Inf"}:e===-1/0?{[v]:"-Inf"}:Object.is(e,-0)?{[v]:"-0"}:e;if(n==="bigint")return{[v]:"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{[v]:"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{[v]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let s;if(e instanceof Date)s={[v]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)s={[v]:"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={[v]:"File",v:Ge(o),n:e.name,t:e.type||"",m:e.lastModified}:s={[v]:"Blob",v:Ge(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,ue(a,t)]);s={[v]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)s=yi(e);else if(e instanceof Map){let o=[];for(let[i,c]of e)o.push([ue(i,t),ue(c,t)]);s={[v]:"Map",v:o}}else if(e instanceof Set){let o=[];for(let i of e)o.push(ue(i,t));s={[v]:"Set",v:o}}else if(Array.isArray(e))s=e.map(o=>ue(o,t));else{s={};for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let i=vi(o)?"_"+o:o;Wr(s,i,ue(e[o],t))}}if(r!==void 0){if(Array.isArray(s))return{[v]:"Arr",_id:r,v:s};s._id=r}return s}function yi(e){if(e instanceof ArrayBuffer)return{[v]:"buf",v:Ge(new Uint8Array(e))};if(e instanceof DataView)return{[v]:"dv",v:Ge(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=wi[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[v]:n,v:Ge(r)}}function Si(){return{refs:new Map}}function Z(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(Z(e[i],t));return o}let n=e[v];if(typeof n=="string")return Ai(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=xi(o)?o.slice(1):o;Wr(r,i,Z(e[o],t))}return r}function Ai(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(Z(i,n),Z(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(Z(i,n));return o}case"Arr":{let o=[];typeof r=="number"&&n.refs.set(r,o);for(let i of e.v)o.push(Z(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=Ke(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=Ke(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=Z(c,n);o.append(i,a)}return o}default:{if(t==="buf"){let i=Ke(e.v);return s(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=Ke(e.v);return s(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let o=_i[t];if(o){let i=Ke(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 Ei(e){return e!==null&&typeof e=="object"}function Ci(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function vi(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function xi(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function Ge(e){if(Kr)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 Ke(e){if(Kr){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 v,mi,wi,_i,Kr,Te=H(()=>{v="_$wj",mi=new Set(["__proto__","constructor","prototype"]);wi={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},_i={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};Kr=typeof Buffer<"u"&&typeof Buffer.from=="function"});var cs={};lr(cs,{observeLazy:()=>da,observeViewportOnce:()=>ma});function as(e){let t=jn.get(e);return t||(t=import(e).finally(()=>jn.delete(e)),jn.set(e,t),t)}function da(e){for(let[t,n]of Object.entries(e))fe.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of fe.values())as(t);fe.clear();return}Qe||(Qe=new IntersectionObserver(pa,{rootMargin:"200px"})),is(),typeof MutationObserver<"u"&&new MutationObserver(()=>is()).observe(document.body,{childList:!0,subtree:!0})}function is(){if(!(!Qe||!fe.size))for(let e of fe.keys())for(let t of document.querySelectorAll(e))Qe.observe(t)}function pa(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=fe.get(n);r&&(as(r),fe.delete(n),Qe?.unobserve(t.target))}}function ha(e){for(let t of e){if(!t.isIntersecting)continue;let n=Lt.get(t.target);Lt.delete(t.target),Ze?.unobserve(t.target),n&&n()}}function ma(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(Ze||(Ze=new IntersectionObserver(ha,{rootMargin:"200px"})),Lt.set(e,t),Ze.observe(e),()=>{Lt.delete(e),Ze?.unobserve(e)})}var fe,Qe,jn,Ze,Lt,ls=H(()=>{fe=new Map,Qe=null,jn=new Map;Ze=null,Lt=new WeakMap});var Rn,Ln=H(()=>{Rn=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(()=>(ls(),cs)).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(()=>(On(),us)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&Rn&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",Rn)});function ga(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 In(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 ba,Mn,Ot=H(()=>{ba=new Set(["append","prepend","before","after","replace","update"]);Mn=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=ba.has(t)?this.querySelector("template"):null;try{for(let i of r){let c=o?o.content.cloneNode(!0):null;ga(t,i,c)}}finally{this.remove()}}}:null;typeof customElements<"u"&&Mn&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",Mn)});var fs,ds=H(()=>{fs=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&fs&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",fs)});function Mt(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]'))hs(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))hs(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function hs(e,t,n){if(e)try{let r=V(e);if(r&&typeof r=="object")for(let s in r)et.has(s)||et.set(s,r[s])}catch{}n?n():t.remove?.()}function ya(e,t,n){ps||(ps=!0,Mt());let r=`${e}/${t}/${n}`;if(et.has(r)){let s=et.get(r);return et.delete(r),s}return ms}var et,ms,ps,Pn=H(()=>{Te();et=new Map,ms=Symbol("webjs.seed.miss"),ps=!1});var us={};lr(us,{_FRAME_TOP:()=>js,_LIVE_ATTRS:()=>Hn,_activeFrameId:()=>Ns,_addNewHeadElements:()=>Wn,_applyStreamedResolve:()=>eo,_applySwap:()=>tr,_blurOutgoingFocus:()=>$t,_buildHaveHeader:()=>Xn,_buildSubmitFormData:()=>ks,_bumpNavToken:()=>Va,_clearFormBusy:()=>Ws,_clearFrameBusy:()=>Ds,_collectChildrenSlots:()=>Pe,_currentPageUrl:()=>Ka,_diffElementInPlace:()=>Wt,_eligibleAnchorHref:()=>Bt,_findAnchorInPath:()=>Ts,_getSubmitAction:()=>xs,_getSubmitMethod:()=>vs,_isNonHtmlPath:()=>Ja,_keyOf:()=>Ie,_longestSharedPath:()=>Ls,_markFormBusy:()=>Hs,_markFrameBusy:()=>qs,_mergeHead:()=>Xs,_navToken:()=>za,_onPopState:()=>Kn,_onSubmit:()=>Gn,_parseHTML:()=>zn,_prefetch:()=>$e,_prefetchCache:()=>T,_prefetchHasHoverPointer:()=>Ps,_prefetchInflightSize:()=>Ha,_prefetchMode:()=>Ut,_prefetchPeek:()=>Da,_prefetchSaysSaveData:()=>Zn,_prefetchSuppressed:()=>$s,_prefetchTake:()=>Fs,_reactivateScripts:()=>zt,_readStreamedShell:()=>Zs,_reconcileChildren:()=>Gt,_regraftPermanentElements:()=>Vs,_regraftPermanentInSlice:()=>er,_resetPrefetch:()=>Wa,_resetWarnOnce:()=>Ya,_resolveTargetFrameId:()=>Yn,_restoreOptimistic:()=>tt,_runWithTransition:()=>Pt,_setCurrentPageUrl:()=>Ga,_snapshotCache:()=>L,_streamBoundariesProgressively:()=>to,_takeResolveUnit:()=>Qs,_viewTransitionsEnabled:()=>zs,collectChildrenSlots:()=>Pe,disableClientRouter:()=>Ss,enableClientRouter:()=>Vn,loadFrame:()=>_a,longestSharedPath:()=>Ls,navigate:()=>As,revalidate:()=>Es});function zn(e){if(!/^\s*(?:<!doctype|<html)/i.test(e)&&typeof document<"u"&&document.implementation)try{let n=document.implementation.createHTMLDocument();if(typeof n.body.setHTMLUnsafe=="function")n.body.setHTMLUnsafe(e);else{let r=n.createElement("template");r.innerHTML=e,n.body.appendChild(r.content)}return n}catch{}return typeof Document<"u"&&typeof Document.parseHTMLUnsafe=="function"?Document.parseHTMLUnsafe(e):typeof DOMParser<"u"?new DOMParser().parseFromString(e,"text/html"):null}function wa(){$n||typeof MutationObserver>"u"||typeof customElements>"u"||($n=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)}}),$n.observe(document.body,{childList:!0,subtree:!0}))}function Vn(){te||typeof document>"u"||(te=!0,document.addEventListener("click",Cs,!1),document.addEventListener("submit",Gn,!1),window.addEventListener("popstate",Kn),document.addEventListener("pointerover",Me,!0),document.addEventListener("focusin",Me,!0),document.addEventListener("touchstart",Me,{capture:!0,passive:!0}),document.addEventListener("pointerout",Bs,!0),document.addEventListener("webjs:navigate",Dn),wa(),Dn(),typeof history<"u"&&"scrollRestoration"in history&&(It=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(D=location.href))}function Ss(){te&&(te=!1,document.removeEventListener("click",Cs,!1),document.removeEventListener("submit",Gn,!1),window.removeEventListener("popstate",Kn),document.removeEventListener("pointerover",Me,!0),document.removeEventListener("focusin",Me,!0),document.removeEventListener("touchstart",Me,{capture:!0}),document.removeEventListener("pointerout",Bs,!0),document.removeEventListener("webjs:navigate",Dn),Kt(),Qn(),ee&&(ee.disconnect(),ee=null),typeof history<"u"&&It!==null&&(history.scrollRestoration=It,It=null),D=null)}async function As(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){location.href=e;return}await Jn(n.href,t?.replace??!1,null)}async function _a(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};P&&P.abort(),P=new AbortController;let s=P.signal,o=++j;return qt(r.href,n,!1,null,"GET",null,s,o)}function Es(e){if(!e){L.clear(),T.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;L.delete(n),T.delete(n)}function Cs(e){if(!te||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Ts(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||Vt.test(r.pathname))return;e.preventDefault();let s=Yn(t);Jn(n,!1,s)}function Kn(e){Jn(location.href,!0,null)}function Gn(e){if(!te||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=vs(t,n);if(s==="dialog")return;let o=xs(t,n),i;try{i=new URL(o,location.href)}catch{return}if(i.origin!==location.origin||Vt.test(i.pathname))return;let c=ks(t,n);e.preventDefault();let a=Yn(n||t);Ea(i.href,s,c,a,t)}function vs(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function xs(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function ks(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 Ts(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Ns(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 Yn(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===js)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Rs(`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 Ns(e)}function Rs(e,t){Bn.has(e)||(Bn.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function gs(){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"&&Rs("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 Pe(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 Ls(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 Os(e){let t=he(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),L.has(t)&&L.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(L.set(t,n);L.size>Sa;){let r=L.keys().next().value;L.delete(r)}}function Aa(e){let t=he(e),n=L.get(t);return n==null?null:(L.delete(t),L.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function he(e){let t=new URL(e,location.href);return t.pathname+t.search}async function Jn(e,t,n){P&&P.abort(),P=new AbortController;let r=P.signal,s=++j;D&&Os(D);let o=setTimeout(()=>{Ft(!0),o=null},150),i=null;t||(i=Gs());try{if(t){let c=Aa(e);if(c){let a=zn(c.html);if(a){tr(a,n,!0,null),typeof window<"u"&&window.scrollTo({left:c.scrollX,top:c.scrollY,behavior:"instant"}),qt(e,n,!1,i,"GET",null,r,s).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await qt(e,n,!t,i,"GET",null,r,s)}finally{o&&clearTimeout(o),s===j&&(Ft(!1),typeof location<"u"&&(D=location.href))}}async function Ea(e,t,n,r,s){P&&P.abort(),P=new AbortController;let o=P.signal,i=++j,c=t==="get"||t==="head",a=new URL(e,location.href);if(c){a.search="";for(let[m,g]of n)a.searchParams.append(m,typeof g=="string"?g:g.name)}D&&Os(D);let l=setTimeout(()=>{Ft(!0),l=null},150),f=Gs(),d=s?Hs(s,i,a.href):null,u=!1;try{let m=await qt(a.href,r,!0,f,c?"GET":t.toUpperCase(),c?null:n,o,i);u=!!(m&&m.ok),!c&&i===j&&(L.clear(),T.clear())}finally{d&&Ws(d,i,a.href,u),l&&clearTimeout(l),i===j&&(Ft(!1),typeof location<"u"&&(D=location.href))}}function Xn(){return[...Pe(document.body).keys()].join(",")}function Zn(){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 Ps(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Ta(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function Bt(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||Vt.test(n.pathname)?null:t}function $s(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Ta(e);return t.includes("external")||t.includes("no-prefetch")}function Ut(e){if($s(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 Ps()?"intent":"viewport"}}function $e(e){if(!te||typeof fetch!="function"||Zn())return;let t=he(e);if(de.has(t)||nt.has(t))return;let n=T.get(t);if(n&&qn()-n.at<Ms)return;if(de.size>=Is){for(nt.add(t),Le.push(e);Le.length>va;){let o=Le.shift();nt.delete(he(o))}return}let r=Xn();if(!r&&typeof document<"u"&&document.readyState==="loading")return;de.add(t);let s={"x-webjs-router":"1","x-webjs-prefetch":"1"};r&&(s["x-webjs-have"]=r),fetch(e,{method:"GET",headers:s,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.headers.get("x-webjs-src"),l=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,f=l?l.getAttribute("data-webjs-build"):null,d=l?l.getAttribute("data-webjs-src"):null;(c&&f&&c!==f||a&&d&&a!==d)&&(L.clear(),T.clear());let u=o.redirected&&o.url?o.url:e,m=await o.text();ja(t,{html:m,build:c,src:a,finalUrl:u,at:qn()})}).catch(()=>{}).finally(()=>{de.delete(t),Na()})}function Na(){for(;Le.length&&de.size<Is;){let e=Le.shift();nt.delete(he(e)),$e(e)}}function ja(e,t){for(T.has(e)&&T.delete(e),T.set(e,t);T.size>Ca;){let n=T.keys().next().value;T.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function Fs(e){let t=he(e),n=T.get(t);return!n||(T.delete(t),qn()-n.at>=Ms)?null:n}function qn(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function Me(e){if(!te)return;let t=Us(e.target);if(!t)return;let n=Ut(t);if(n==="none"||n==="render")return;let r=Bt(t);if(r){if(e.type==="touchstart"){$e(r);return}n==="intent"&&(rt===t&&Oe||(Kt(),rt=t,Oe=setTimeout(()=>{Oe=null,rt=null,$e(r)},xa)))}}function Bs(e){let t=Us(e.target);t&&t===rt&&Kt()}function Kt(){Oe&&(clearTimeout(Oe),Oe=null),rt=null}function Qn(){for(let e of st)clearTimeout(e);st.clear(),je=new WeakMap}function Us(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"||Zn())return;let e=typeof IntersectionObserver<"u";e&&(ee?(ee.disconnect(),Qn()):ee=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(je.has(r))continue;let s=setTimeout(()=>{st.delete(s),je.delete(r),ee.unobserve(r);let o=Bt(r);o&&Ut(r)==="viewport"&&$e(o)},ka);je.set(r,s),st.add(s)}else{let s=je.get(r);s&&(clearTimeout(s),st.delete(s),je.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=Ut(t);if(n==="render"){let r=Bt(t);r&&$e(r)}else n==="viewport"&&e&&ee.observe(t)}}function Ra(e){if(typeof document>"u"||!document.body)return!1;let t=Pe(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 Fn(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||Ra(t)||typeof location<"u"&&(location.href=e)}async function qt(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,m=null,g=!1,p=e,h=t?qs(t,a):null;try{try{let y=s==="GET"&&!o&&!t?Fs(e):null;if(y)l=y.html,d=y.build,u=y.src,p=y.finalUrl,m=200,g=!0;else{let w={"x-webjs-router":"1"},E=Xn();E&&(w["x-webjs-have"]=E),t&&(w["x-webjs-frame"]=t),o!=null&&s!=="GET"&&s!=="HEAD"&&(w.accept=bs+", text/html");let R={method:s,headers:w,credentials:"same-origin"};i&&(R.signal=i),o!=null&&s!=="GET"&&s!=="HEAD"&&(R.body=o);let _=await fetch(e,R);m=_.status,g=_.ok;let x=_.headers.get("content-type")||"",M=/^text\/html\b/i.test(x);if(x.toLowerCase().indexOf(bs)===0){let I=await _.text();return a===j&&(tt(r),In(I)),{ok:g,status:m,aborted:!1}}if(_.redirected&&_.url&&(p=_.url),_.status===204||_.status===205)return a===j&&n&&history.pushState(null,"",p),{ok:g,status:m,aborted:!1};if(!M)return a===j&&(tt(r),Fn(e,_.status,null)),{ok:!1,status:m,aborted:!1};d=_.headers.get("x-webjs-build"),u=_.headers.get("x-webjs-src");let S=await Zs(_);l=S.shell,S.streaming&&(f=S)}}catch(y){return y&&y.name==="AbortError"?{ok:!1,status:null,aborted:!0}:a!==j?{ok:!1,status:null,aborted:!0}:(tt(r),Fn(e,null,y instanceof Error?y:new Error(String(y))),{ok:!1,status:null,aborted:!1})}if(a!==j){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:!1,status:m,aborted:!0}}let b=zn(l);if(!b)return tt(r),Fn(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:m,aborted:!1};if(tr(b,t,!1,p,d,u),n&&history.pushState(null,"",p),n){let y=new URL(p);if(y.hash){let w=document.getElementById(y.hash.slice(1));w?w.scrollIntoView():(gs(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else gs(),window.scrollTo({left:0,top:0,behavior:"instant"})}return f&&(f.reader||f.rest)&&to(f.reader,f.dec,f.rest,()=>a===j),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:p,frameId:t,from:"navigate"}})),{ok:g,status:m,aborted:!1}}finally{h&&Ds(h,a)}}function qs(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=Dt.has(n);return Dt.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 Ds(e,t){if(Dt.get(e)!==t)return;Dt.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 Hs(e,t,n){let r=Ht.has(e);return Ht.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 Ws(e,t,n,r){if(Ht.get(e)!==t)return;Ht.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 ys(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+=pe(r);return n}function zs(){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 Pt(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(zs()&&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 Vs(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 er(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=La(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 La(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 Oa(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&Re(t)}function tr(e,t,n,r,s,o){try{Mt(e)}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let d=document.querySelector('script[type="importmap"]'),u=d?d.getAttribute("data-webjs-build"):null,m=!1;if(s&&u&&(m=s!==u),!m&&e.head&&e.head.children.length>0){let g=ys(document),p=ys(e);g!==p&&(m=!0)}if(m&&typeof location<"u"){L.clear(),T.clear();try{let g="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(g))sessionStorage.removeItem(g);else{sessionStorage&&sessionStorage.setItem(g,"1"),location.href=r;return}}catch{location.href=r;return}}else if(!m){let g=d?d.getAttribute("data-webjs-src"):null;o&&g&&o!==g&&(L.clear(),T.clear(),d&&d.setAttribute("data-webjs-src",o));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){let d=document.querySelector(`webjs-frame#${CSS.escape(t)}`),u=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(d&&u){Wn(e.head),Pt(()=>{Ua(d,u),zt(d),Re(d),$t()},()=>Re(d)),_s(e.body);return}let m=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});(d||document).dispatchEvent(m),m.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`);return}let i=Pe(document.body),c=Pe(e.body),a=Ls(i,c);if(a){Wn(e.head),Pt(()=>{Ma(i.get(a),c.get(a),e),$t()},()=>Oa(i.get(a))),_s(e.body);return}Xs(e.head),Vs(document.body,e.body);let l=[...e.body.childNodes];Pt(()=>{document.body.replaceChildren(...l),zt(document.body),Re(document.body),$t()},()=>Re(document.body))}function $t(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function Ma(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));er(s,o),Ia(r,e.start,e.end,s,o);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(zt(i),Re(i))}function Ia(e,t,n,r,s){let o=new Map;for(let a of r){if(a.nodeType!==1)continue;let l=Ie(a);l&&o.set(l,a)}let i=n,c=[];for(let a of s){if(a.nodeType===1){let l=Ie(a);if(l&&o.has(l)){let f=o.get(l);Wt(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 Wt(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);if(Pa(e)){Ba(e,t);return}Gt(e,t)}function Pa(e){return e[Symbol.for("webjs.instance")]!=null}function Ks(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function ws(e){let t=new Map,n=`slot[${B}][${z}="${le}"]`;for(let r of e.querySelectorAll(n)){let s=r;if(!Ks(s,e))continue;let o=s.getAttribute("name")||null;t.has(o)||t.set(o,s)}return t}function $a(e,t){for(let n of e.querySelectorAll(`slot[${B}]`)){let r=n;if(Ks(r,e)&&(r.getAttribute("name")||null)===t)return r}return null}function Fa(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ba(e,t){let n=e[W];if(!n)return;let r=ws(e),s=ws(t);if(r.size===0&&s.size===0)return;let o=new Set([...r.keys(),...s.keys()]);for(let i of o){let c=r.get(i),a=s.get(i);if(c&&a){let l=n.lastSnapshot.get(c)||[];Gt(c,a);let f=[...c.childNodes];n.assignedByName.set(i,f),n.lastSnapshot.set(c,f.slice()),Fa(l,f)||ze(c)}else if(c&&!a)n.assignedByName.delete(i),bn(n,c)&&ze(c);else{let l=$a(e,i);if(!l)continue;let f=[...a.childNodes].map(d=>document.importNode(d,!0));n.assignedByName.set(i,f),mn(n,l,f)&&ze(l)}}}function Gt(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(c=>document.importNode(c,!0));er(n,r);let s=new Map;for(let c of n){if(c.nodeType!==1)continue;let a=Ie(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=Ie(a);if(l&&s.has(l)){let d=s.get(l);Wt(d,a),o.push(d),s.delete(l);continue}let f=n[c];if(f&&f.nodeType===1&&!Ie(f)&&f.tagName===a.tagName){Wt(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 Ie(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Gs(){let e=Pe(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 tt(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 Ua(e,t){Gt(e,t)}function Ys(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function nr(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=Ys();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Js(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=Ys();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function pe(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Wn(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(pe(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(n.has(pe(r))||(r.tagName==="SCRIPT"?document.head.appendChild(nr(r)):document.head.appendChild(Js(r))))}function qa(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function Xs(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(pe(o));let s=new Set;for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&s.add(pe(o));for(let o of[...t.children])o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(qa(o)||s.has(pe(o))||o.remove());for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(r.has(pe(o))||(o.tagName==="SCRIPT"?t.appendChild(nr(o)):t.appendChild(Js(o))))}function Re(e){typeof customElements>"u"||rr(e)}function rr(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&&rr(n.shadowRoot))}function _s(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]"))document.body.appendChild(t.cloneNode(!0))}async function Zs(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 Qs(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 eo(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&&rr(o)}async function to(e,t,n,r){let s=n,o=()=>{let i;for(;i=Qs(s);){if(!r())return!1;eo(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 zt(e){for(let t of e.querySelectorAll("script"))t.replaceWith(nr(t))}function Da(e){return T.get(he(e))||null}function Ha(){return de.size}function Wa(){T.clear(),de.clear(),Le.length=0,nt.clear(),Kt(),Qn()}function za(){return j}function Va(){return++j}function Ka(){return D}function Ga(e){D=e}function Ya(){Bn.clear(),Un=!1}function Ja(e){return Vt.test(e)}var bs,te,P,j,$n,D,It,Vt,js,Bn,Un,Sa,L,Ca,Ms,Is,va,xa,ka,T,de,Le,nt,Oe,rt,ee,je,st,Dt,Ht,Hn,On=H(()=>{Ln();Ot();Ot();ds();Pn();wt();bs="text/vnd.webjs-stream.html";te=!1,P=null,j=0,$n=null;D=null,It=null;Vt=/\.(?: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;js="_top";Bn=new Set;Un=!1;Sa=16,L=new Map;Ca=8,Ms=3e4,Is=3,va=24,xa=100,ka=250,T=new Map,de=new Set,Le=[],nt=new Set,Oe=null,rt=null,ee=null,je=new WeakMap,st=new Set;Dt=new WeakMap;Ht=new WeakMap;Hn=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&Vn()});Be();function lo(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 be(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function Qt(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 at(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
|
|
3
|
-
`)}</style>`}Be();var ge=Object.freeze({"@":"event",".":"prop","?":"bool"});function cr(e){return Object.prototype.hasOwnProperty.call(ge,e)}function ct(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function $(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}var lr=Symbol.for("webjs.repeat");function ur(e,t,n){return{[lr]:!0,items:[...e],keyFn:t,templateFn:n}}function ne(e){return!!e&&typeof e=="object"&&e[lr]===!0}function en(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function ye(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function lo(e){return{_$webjs:"live",value:e}}function we(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function uo(e,t){return{_$webjs:"keyed",key:e,value:t}}function re(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function fo(e,t){return{_$webjs:"guard",deps:e,fn:t}}function se(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function po(e){return{_$webjs:"template-content",template:e}}function _e(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function ho(e){return{_$webjs:"ref",target:e}}function oe(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function mo(){return{value:void 0}}function bo(e){return{_$webjs:"cache",value:e}}function ie(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function go(...e){return{_$webjs:"until",args:e}}function ae(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function yo(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function Se(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function wo(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Ae(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function _o(e){return{_$webjs:"watch",signal:e}}function ce(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var F=null,G=!1,Ce=0,Ee=null,tn=0,fr=(e,t)=>Object.is(e,t),ut=()=>{},dr=()=>!1;function pr(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)pr(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function Ue(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)Ue(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function cn(e){if(G)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&&sn(t)&&Ue(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,sn(t)&&pr(e,t)),t.producerLastReadVersions[n]=e.version}function sn(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function hr(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=G;G=!0;try{for(let n of e.liveConsumers)n.dirty||So(n)}finally{G=t}}function So(e){e.dirty=!0,hr(e),e.consumerMarkedDirty.call(e.wrapper||e)}function ft(e){if(!(!e.dirty&&e.lastCleanEpoch===Ce)){if(!e.producerMustRecompute()&&!Ao(e)){e.dirty=!1,e.lastCleanEpoch=Ce;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=Ce}}function Ao(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(ft(n),r!==n.version))return!0}return!1}function on(e){e&&(e.nextProducerIndex=0);let t=F;return F=e,t}function an(e,t){if(F=t,!!e){if(sn(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)Ue(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var dt=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=Ce,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=dr,this.producerRecomputeValue=ut,this.consumerMarkedDirty=ut,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||fr,this.watched=n?.[ln],this.unwatched=n?.[un]}get(){return cn(this),this.__value}peek(){return this.__value}set(t){if(G)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,Ce++,Ee!==null?mr(this):hr(this))}};function mr(e){let t=G;G=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?Ee.add(n):mr(n))}finally{G=t}}var nn=Symbol("unset"),rn=Symbol("computing"),lt=Symbol("errored"),qe=class{constructor(t,n){this.__fn=t,this.__value=nn,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||fr,this.watched=n?.[ln],this.unwatched=n?.[un];let r=this;this.producerMustRecompute=function(){return r.__value===nn||r.__value===rn},this.producerRecomputeValue=function(){if(r.__value===rn)throw new Error("Detected cycle in computations.");let s=r.__value;r.__value=rn;let o=on(r),i,c=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=lt,r.__error=l,c=!0}finally{an(r,o)}if(!c&&(s!==nn&&s!==lt)&&r.__equal.call(r.wrapper,s,i)){r.__value=s;return}r.__value=i,r.version++},this.consumerMarkedDirty=ut}get(){if(ft(this),cn(this),this.__value===lt)throw this.__error;return this.__value}peek(){if(ft(this),this.__value===lt)throw this.__error;return this.__value}},pt=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=Ce,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=dr,this.producerRecomputeValue=ut,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=on(this);try{for(let r of t)cn(r),r.__isComputed&&ft(r)}finally{an(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(Ue(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=on(this),r;try{r=t()}finally{an(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)Ue(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},ln=Symbol("watched"),un=Symbol("unwatched");function Eo(e){let t=F;F=null;try{return e()}finally{F=t}}function Co(e){return e.producers.slice()}function vo(e){return e.liveConsumers?[...e.liveConsumers]:[]}function xo(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function ko(e){return e.producers.length>0}function To(){return F&&F.__isComputed?F:null}function No(e){tn++,Ee===null&&(Ee=new Set);try{e()}finally{if(tn--,tn===0){let t=Ee;Ee=null;for(let n of t)n.__fire()}}}var De={State:dt,Computed:qe,subtle:{Watcher:pt,untrack:Eo,introspectSources:Co,introspectSinks:vo,hasSinks:xo,hasSources:ko,currentComputed:To,watched:ln,unwatched:un}};function jo(e,t){return new dt(e,t)}function Ro(e,t){return new qe(e,t)}function Lo(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function Oo(e){let t=!1,n=!1,r=new qe(e),s=new pt(()=>{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())}}wt();var Nr=new WeakMap,gn=Symbol.for("webjs.instance");function ke(e,t){let n=t,r=n[gn];if(N(e)){let s=e;if(r&&r.strings===s.strings){ve(r,s.values);return}r&&jr(r,t);let o=t.firstChild;o&&o.nodeType===8&&o.data==="webjs-hydrate"&&o.remove();let i=Vo(s,t);n[gn]=i;return}if(r&&jr(r,t),n[gn]=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 St(e){let{strings:t}=e,n=Nr.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 p=t[g];for(let h=0;h<p.length;h++){let b=p[h];switch(o){case"text":s+=b,b==="<"&&(o="tag-open");break;case"tag-open":s+=b,b==="!"?o="bang-1":b==="/"?(o="tag-name",d=""):/[a-zA-Z]/.test(b)?(o="tag-name",d=b.toLowerCase()):o="text";break;case"bang-1":s+=b,o=b==="-"?"bang-dash":"tag-name";break;case"bang-dash":s+=b,b==="-"?(o="comment",l=0):o="tag-name";break;case"comment":s+=b,b==="-"?l+=1:(b===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":s+=b,b===">"?(o=d==="script"||d==="style"?"rawtext":"text",o==="rawtext"&&(u="")):/\s/.test(b)?o="in-tag":d+=b.toLowerCase();break;case"in-tag":s+=b,b===">"?(o=d==="script"||d==="style"?"rawtext":"text",o==="rawtext"&&(u="")):!/\s/.test(b)&&b!=="/"&&(o="attr-name",i=b,c=s.length-1);break;case"rawtext":s+=b,u=(u+b.toLowerCase()).slice(-9),(u.endsWith("<\/script>")||u.endsWith("</style>"))&&(o="text",u="",d="");break;case"attr-name":b==="="?(o="after-eq",s+=b):/\s/.test(b)?(o="in-tag",i="",s+=b):b===">"?(o="text",i="",s+=b):(i+=b,s+=b);break;case"after-eq":b==='"'||b==="'"?(o="attr-quoted",a=b,s+=b):/\s/.test(b)?(o="in-tag",i="",s+=b):b===">"?(o="text",i="",s+=b):(o="attr-unquoted",s+=b);break;case"attr-unquoted":/\s/.test(b)?(o="in-tag",i="",s+=b):(b===">"&&(o="text",i=""),s+=b);break;case"attr-quoted":s+=b,b===a&&(o="in-tag",i="");break;case"skip-attr":if(b===a){if(f){let y=f.firstPartIdx,w=[];for(let A=y;A<r.length;A++)(r[A].kind==="noop"||r[A].kind==="attr-mixed")&&w.push(A);let E=[],R=t[w[0]],_=R.lastIndexOf(a);E.push(_>=0?R.slice(_+1):R);for(let A=1;A<w.length;A++)E.push(t[w[A]]);let x=t[w[w.length-1]+1],M=x.indexOf(a);E.push(M>=0?x.slice(0,M):x),r[y]={kind:"attr-mixed",path:[],name:f.name,statics:E,group:w};for(let A=1;A<w.length;A++)r[w[A]]={kind:"noop",path:[],mixedAnchor:y};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+=`<!--${C}${h}-->`,r.push({kind:"child",path:[]});else if(o==="in-tag"){let b=`data-${C}${h}`;s+=`${b}=""`,r.push({kind:"element",path:[]})}else if(o==="after-eq"){let b=i[0],y=i.slice(1);if(cr(b)){s=s.slice(0,c);let w=ge[b],E=`data-${C}${h}`;s+=`${E}=""`,r.push({kind:w,path:[],name:y})}else{s=s.slice(0,c);let w=`data-${C}${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 b=`data-${C}${h}`;s+=`${b}=""`,f={name:i,firstPartIdx:h},r.push({kind:"noop",path:[]}),o="skip-attr"}else o==="skip-attr"&&r.push({kind:"noop",path:[]})}}let m=document.createElement("template");return m.innerHTML=s,Wo(m.content,r),zo(m.content,r),n={templateEl:m,parts:r},Nr.set(t,n),n}function Wo(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(B,"");let s=t.length;r.setAttribute(`data-${C}${s}`,""),t.push({kind:"slot",path:[]})}}function zo(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(C)){let a=Number(c.slice(C.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-${C}`)){let f=Number(l.name.slice(`data-${C}`.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 Vo(e,t){let{templateEl:n,parts:r}=St(e),s=n.content.cloneNode(!0),o=document.createComment(`${C}s`),i=document.createComment(`${C}e`),c=r.map(l=>At(l,s)),a=[];for(let l=0;l<e.values.length;l++)X(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"&&X(l,void 0,void 0,[]);return{strings:e.strings,bound:c,lastValues:a,startNode:o,endNode:i}}function At(e,t){if(e.kind==="noop")return{kind:"noop",mixedAnchor:e.mixedAnchor};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];if(Object.is(r,e.lastValues[n]))continue;let s=e.bound[n],o=s.mixedAnchor;s.kind==="noop"&&o!=null?X(e.bound[o],t[o],e.lastValues[o],t):X(s,r,e.lastValues[n],t),e.lastValues[n]=r}}function jr(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=yn(n.slotEl);r&&Tr(r,n.slotEl)}}t.replaceChildren()}function X(e,t,n,r){if(we(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":Yo(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":Go(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=yn(s);if(!c||Ko(s))return;let a=document.createDocumentFragment();for(;s.firstChild;)a.appendChild(s.firstChild);s[gt]=a,yt(c)};yn(s)?o():queueMicrotask(o);break}case"noop":break}}function yn(e){let t=e.parentElement;for(;t;){if(t[W])return t;t=t.parentElement}return null}function Ko(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 Go(e,t){let n=e,r=oe(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 Yo(e,t){return si(e,t),U(e,t)}function U(e,t){let n=e.marker;if(ye(t)){J(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(re(t)){let s=t,o=e.__keyedKey;o!==void 0&&!Object.is(o,s.key)&&J(e),e.__keyedKey=s.key,U(e,s.value);return}if(se(t)){let s=t,o=e.__guardDeps,i=s.deps;if(o!==void 0&&(Array.isArray(o)&&Array.isArray(i)?ri(o,i):Object.is(o,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,U(e,s.fn());return}if(_e(t)){J(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(oe(t))return;if(ie(t))return oi(e,t.value);if(ae(t))return ii(e,t.args);if(ce(t))return ai(e,t.signal);if(Se(t))return ci(e,t);if(Ae(t))return li(e,t);if(ne(t)){if(e.child&&e.child.kind==="repeat"){Zo(e,t);return}J(e);let s={kind:"repeat",map:new Map};e.child=s,Xo(n,s,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){ti(e,t);return}J(e);let s={kind:"array",items:[]};e.child=s,ei(n,s,t);return}if(e.child){let s=e.child;if(s.kind==="repeat")Rr(s),e.child=void 0;else if(s.kind==="array")Or(s),e.child=void 0;else if(s.kind==="async-stream")$r(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}xe(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}=St(s),c=o.content.cloneNode(!0),a=document.createComment(`${C}s`),l=document.createComment(`${C}e`),f=i.map(m=>At(m,c)),d=[];for(let m=0;m<s.values.length;m++)X(f[m],s.values[m],void 0,s.values),d.push(s.values[m]);let u=[a,...c.childNodes,l];n.parentNode?.insertBefore(Jo(u),n);for(let m of f)m.kind==="slot"&&X(m,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 Jo(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function xe(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 _n(e){let{templateEl:t,parts:n}=St(e),r=t.content.cloneNode(!0),s=document.createComment(`${C}s`),o=document.createComment(`${C}e`),i=n.map(l=>At(l,r)),c=[];for(let l=0;l<e.values.length;l++)X(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 Ve(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 Xo(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}=_n(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),wn(u.startNode,u.endNode,r,n),a.set(f,u),s.map.delete(f);else{u&&(Ve(u),xe(u.startNode,u.endNode),s.map.delete(f));let{inst:m,frag:g}=_n(d);r.insertBefore(g,n),a.set(f,m)}}for(let l of s.map.values())Ve(l),xe(l.startNode,l.endNode);s.map=a}function Rr(e){for(let t of e.map.values())Ve(t),xe(t.startNode,t.endNode);e.map.clear()}function Qo(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function _t(e){e.type==="tpl"?(Ve(e.inst),xe(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Lr(e){if(N(e)){let{inst:t,frag:n}=_n(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 ei(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}=Lr(i);a&&s.appendChild(a),o.push(c)}r.insertBefore(s,e),t.items=o}function ti(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&&_t(l),i.push({type:"empty"});continue}let{item:f,frag:d}=Lr(a);d&&r.insertBefore(d,ni(o,c,n)),l&&_t(l),i.push(f)}for(let c=t.length;c<o.length;c++)_t(o[c]);s.items=i}function ni(e,t,n){for(let r=t;r<e.length;r++){let s=Qo(e[r]);if(s&&s.parentNode)return s}return n}function Or(e){for(let t of e.items)_t(t);e.items=[]}function wn(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 ri(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 J(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Ir(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Rr(n);else if(n.kind==="array")Or(n);else if(n.kind==="async-stream")$r(n);else if("strings"in n){let r=e.child;Ve(r),xe(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function si(e,t){let n=e;n.__untilState&&!ae(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!se(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!ie(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!re(t)&&(n.__keyedKey=void 0),n.__watchSub&&!ce(t)&&Ir(n)}function oi(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();wn(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&&J(e),wn(a.inst.startNode,a.inst.endNode,n.parentNode,n),ve(a.inst,c.values),e.child=a.inst;return}}U(e,t)}function ii(e,t){let n=e,r=n.__untilState,s=n.__untilArgs,o=(u,m)=>!!(Object.is(u,m)||N(u)&&N(m)&&u.strings===m.strings),c=s&&s.length===t.length&&s.every((u,m)=>o(u,t[m]))&&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 m=t[u];if(!m||typeof m.then!="function"){l=u,f=m;break}}l!==-1&&l<=a.highestResolved?(U(e,f),a.highestResolved=l):l===-1&&!n.__untilEverRendered&&U(e,""),n.__untilEverRendered=!0;let d=Math.min(l===-1?t.length:l,a.highestResolved);for(let u=0;u<d;u++){let m=t[u];!m||typeof m.then!="function"||Promise.resolve(m).then(g=>{a.aborted||u>=a.highestResolved||(a.highestResolved=u,U(e,g))},()=>{})}}function ai(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let o;n.__watchSub.observe(()=>{o=t.get()}),U(e,o);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new De.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let o;r.observe(()=>{o=t.get()}),U(e,o)})});n.__watchSub=r;let s;r.observe(()=>{s=t.get()}),U(e,s)}function Ir(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function ci(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;J(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,Mr(s,e,t)}function li(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;J(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,Mr(s,e,t)}async function Mr(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=Pr(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 Pr(e){if(e==null||e===!1||e===!0)return[];if(N(e)){let t=e,{templateEl:n,parts:r}=St(t),s=n.content.cloneNode(!0),o=r.map(i=>At(i,s));for(let i=0;i<t.values.length;i++)X(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(...Pr(n));return t}return[document.createTextNode(String(e))]}function $r(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 Fr=null;function Et(e){Fr=e||null}function ui(){return Fr||void 0}var Br=Symbol.for("webjs:registry"),Ur=Symbol.for("webjs:classToTag"),Ct=globalThis,q=Ct[Br]||(Ct[Br]=new Map),qr=Ct[Ur]||(Ct[Ur]=new WeakMap),vt=typeof window<"u"&&typeof customElements<"u";function Sn(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=q.get(e);r?(r.cls=t,r.lazy=n):q.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),qr.set(t,e)}if(vt){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),Sn(t,n)}}if(!vt){let e=globalThis;e.customElements||(e.customElements={define(t,n){Sn(t,n)},get(t){return q.get(t)?.cls},upgrade(){},whenDefined(t){let n=q.get(t);return Promise.resolve(n?.cls)}})}function An(e,t){vt?customElements.define(e,t):Sn(e,t)}function fi(e,t){if(vt)return;let n=q.get(e);if(n){n.moduleUrl=t;return}q.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function En(e){return q.get(e)?.cls}function di(e){return q.get(e)?.moduleUrl||null}function pi(e){return q.get(e)?.lazy===!0}function xt(e){return qr.get(e)}function Cn(){return[...q.keys()]}Te();wt();var Gr=typeof window<"u"&&typeof HTMLElement<"u";function xi(e,t){return e!==t}function ki(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var kt=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=ki(),this.__internals}},Ti=["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 Ti){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(kt.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var Ni=Gr?HTMLElement:kt,Yr=Symbol("webjs.factoryProps"),Vr=new WeakSet,Ne=class e extends Ni{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){An(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||vn(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(Vr.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,Yr)){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)}Vr.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||xi)(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||vn(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(!Gr)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=Kr(r.slice(16));try{this[o]=V(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:be(r)?[r]:[];if(s.length){if(n){let o=this.shadowRoot.querySelector("style");o&&o.remove()}Qt(this._renderRoot,s)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${xt(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().`),hn(this)||(this.__isHydrating()?(Y(this),Cr(this)):Er(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&&xr(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&&kr(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||vn(f))===t){i=f,c=d;break}if(c===void 0&&(i=Kr(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,Et(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{Et(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 De.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);ke(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&ke(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{n===this.__renderToken&&ke(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==Tt.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${xt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&ke(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 vn(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Kr(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Tt(e){return new.target?Reflect.construct(Ne,arguments,new.target):class extends Ne{static properties=e;static[Yr]=!0}}Object.setPrototypeOf(Tt,Ne);Tt.prototype=Ne.prototype;function ji(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}Be();var Kc=Symbol.for("webjs.suspense");function Ri(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function Nt(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}Te();var xn=null;function Li(e){xn=e}function kn(){if(!xn)return"";try{return xn()||""}catch{return""}}async function Oi(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 Q(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(ye(e))return String(e.value??"");if(we(e))return k(e.value,t);if(ce(e))return k(e.signal.get(),t);if(re(e))return k(e.value,t);if(se(e))return k(e.fn(),t);if(_e(e)){let n=e.template;return String(n?.innerHTML??"")}if(oe(e))return"";if(ie(e))return k(e.value,t);if(ae(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(Se(e)||Ae(e))return"";if(Array.isArray(e))return(await Promise.all(e.map(r=>k(r,t)))).join("");if(ne(e)){let n=e;return(await Promise.all(n.items.map((s,o)=>k(n.templateFn(s,o),t)))).join("")}if(Nt(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)?Ii(e,t):ct(String(e))}async function Ii(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 m=n[u];for(let g=0;g<m.length;g++){let p=m[g];switch(o){case"text":s+=p,p==="<"&&(o="tag-open");break;case"tag-open":s+=p,p==="!"?o="bang-1":p==="/"?(o="tag-name",f=""):/[a-zA-Z]/.test(p)?(o="tag-name",f=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=jt(f)?"rawtext":"text",o==="rawtext"&&(d="")):/\s/.test(p)?o="in-tag":f+=p.toLowerCase();break;case"in-tag":s+=p,p===">"?(o=jt(f)?"rawtext":"text",o==="rawtext"&&(d="")):!/\s/.test(p)&&p!=="/"&&(o="attr-name",i=p,c=s.length-1);break;case"rawtext":s+=p,d=(d+p.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(o="text",d="",f="");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}}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 p=i[0],h=i.slice(1),b=ge[p];if(b==="event")s=s.slice(0,c),o="in-tag",i="";else if(b==="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 Ye(g);s+=`data-webjs-prop-${Yi(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 b==="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 Mi=new Set(["document","window","localStorage","sessionStorage","navigator","matchMedia","requestAnimationFrame","getComputedStyle","IntersectionObserver","MutationObserver","ResizeObserver"]),Pi=new Set(["attachShadow","querySelector","querySelectorAll","getBoundingClientRect","focus","blur","scrollIntoView"]);function $i(e){let t=e&&typeof e.message=="string"?e.message:"",n=/^(\w+) is not defined\b/.exec(t);return e instanceof ReferenceError&&n&&Mi.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&&Pi.has(n[1])?`\`${n[1]}\` is an HTMLElement method that does not exist on the server-side component instance during SSR.`:null)}function Fi(){return typeof process<"u"&&process.env&&!0}function Zr(e,t,n){if(!(n===void 0?!Fi():!!n))return"";let s=t&&t.message?t.message:String(t);return Zt`<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>`}Be();var ge=Object.freeze({"@":"event",".":"prop","?":"bool"});function ur(e){return Object.prototype.hasOwnProperty.call(ge,e)}function ct(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function $(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}var fr=Symbol.for("webjs.repeat");function dr(e,t,n){return{[fr]:!0,items:[...e],keyFn:t,templateFn:n}}function ne(e){return!!e&&typeof e=="object"&&e[fr]===!0}function en(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function ye(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function uo(e){return{_$webjs:"live",value:e}}function we(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function fo(e,t){return{_$webjs:"keyed",key:e,value:t}}function re(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function po(e,t){return{_$webjs:"guard",deps:e,fn:t}}function se(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function ho(e){return{_$webjs:"template-content",template:e}}function _e(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function mo(e){return{_$webjs:"ref",target:e}}function oe(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function bo(){return{value:void 0}}function go(e){return{_$webjs:"cache",value:e}}function ie(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function yo(...e){return{_$webjs:"until",args:e}}function ae(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function wo(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function Se(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function _o(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Ae(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function So(e){return{_$webjs:"watch",signal:e}}function ce(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var F=null,G=!1,Ce=0,Ee=null,tn=0,pr=(e,t)=>Object.is(e,t),ut=()=>{},hr=()=>!1;function mr(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)mr(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function Ue(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)Ue(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function cn(e){if(G)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&&sn(t)&&Ue(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,sn(t)&&mr(e,t)),t.producerLastReadVersions[n]=e.version}function sn(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function br(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=G;G=!0;try{for(let n of e.liveConsumers)n.dirty||Ao(n)}finally{G=t}}function Ao(e){e.dirty=!0,br(e),e.consumerMarkedDirty.call(e.wrapper||e)}function ft(e){if(!(!e.dirty&&e.lastCleanEpoch===Ce)){if(!e.producerMustRecompute()&&!Eo(e)){e.dirty=!1,e.lastCleanEpoch=Ce;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=Ce}}function Eo(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(ft(n),r!==n.version))return!0}return!1}function on(e){e&&(e.nextProducerIndex=0);let t=F;return F=e,t}function an(e,t){if(F=t,!!e){if(sn(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)Ue(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var dt=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=Ce,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=hr,this.producerRecomputeValue=ut,this.consumerMarkedDirty=ut,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||pr,this.watched=n?.[ln],this.unwatched=n?.[un]}get(){return cn(this),this.__value}peek(){return this.__value}set(t){if(G)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,Ce++,Ee!==null?gr(this):br(this))}};function gr(e){let t=G;G=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?Ee.add(n):gr(n))}finally{G=t}}var nn=Symbol("unset"),rn=Symbol("computing"),lt=Symbol("errored"),qe=class{constructor(t,n){this.__fn=t,this.__value=nn,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||pr,this.watched=n?.[ln],this.unwatched=n?.[un];let r=this;this.producerMustRecompute=function(){return r.__value===nn||r.__value===rn},this.producerRecomputeValue=function(){if(r.__value===rn)throw new Error("Detected cycle in computations.");let s=r.__value;r.__value=rn;let o=on(r),i,c=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=lt,r.__error=l,c=!0}finally{an(r,o)}if(!c&&(s!==nn&&s!==lt)&&r.__equal.call(r.wrapper,s,i)){r.__value=s;return}r.__value=i,r.version++},this.consumerMarkedDirty=ut}get(){if(ft(this),cn(this),this.__value===lt)throw this.__error;return this.__value}peek(){if(ft(this),this.__value===lt)throw this.__error;return this.__value}},pt=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=Ce,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=hr,this.producerRecomputeValue=ut,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=on(this);try{for(let r of t)cn(r),r.__isComputed&&ft(r)}finally{an(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(Ue(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=on(this),r;try{r=t()}finally{an(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)Ue(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},ln=Symbol("watched"),un=Symbol("unwatched");function Co(e){let t=F;F=null;try{return e()}finally{F=t}}function vo(e){return e.producers.slice()}function xo(e){return e.liveConsumers?[...e.liveConsumers]:[]}function ko(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function To(e){return e.producers.length>0}function No(){return F&&F.__isComputed?F:null}function jo(e){tn++,Ee===null&&(Ee=new Set);try{e()}finally{if(tn--,tn===0){let t=Ee;Ee=null;for(let n of t)n.__fire()}}}var De={State:dt,Computed:qe,subtle:{Watcher:pt,untrack:Co,introspectSources:vo,introspectSinks:xo,hasSinks:ko,hasSources:To,currentComputed:No,watched:ln,unwatched:un}};function Ro(e,t){return new dt(e,t)}function Lo(e,t){return new qe(e,t)}function Oo(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function Mo(e){let t=!1,n=!1,r=new qe(e),s=new pt(()=>{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())}}wt();var Rr=new WeakMap,gn=Symbol.for("webjs.instance");function ke(e,t){let n=t,r=n[gn];if(N(e)){let s=e;if(r&&r.strings===s.strings){ve(r,s.values);return}r&&Lr(r,t);let o=t.firstChild;o&&o.nodeType===8&&o.data==="webjs-hydrate"&&o.remove();let i=Ko(s,t);n[gn]=i;return}if(r&&Lr(r,t),n[gn]=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 St(e){let{strings:t}=e,n=Rr.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 p=t[g];for(let h=0;h<p.length;h++){let b=p[h];switch(o){case"text":s+=b,b==="<"&&(o="tag-open");break;case"tag-open":s+=b,b==="!"?o="bang-1":b==="/"?(o="tag-name",d=""):/[a-zA-Z]/.test(b)?(o="tag-name",d=b.toLowerCase()):o="text";break;case"bang-1":s+=b,o=b==="-"?"bang-dash":"tag-name";break;case"bang-dash":s+=b,b==="-"?(o="comment",l=0):o="tag-name";break;case"comment":s+=b,b==="-"?l+=1:(b===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":s+=b,b===">"?(o=d==="script"||d==="style"?"rawtext":"text",o==="rawtext"&&(u="")):/\s/.test(b)?o="in-tag":d+=b.toLowerCase();break;case"in-tag":s+=b,b===">"?(o=d==="script"||d==="style"?"rawtext":"text",o==="rawtext"&&(u="")):!/\s/.test(b)&&b!=="/"&&(o="attr-name",i=b,c=s.length-1);break;case"rawtext":s+=b,u=(u+b.toLowerCase()).slice(-9),(u.endsWith("<\/script>")||u.endsWith("</style>"))&&(o="text",u="",d="");break;case"attr-name":b==="="?(o="after-eq",s+=b):/\s/.test(b)?(o="in-tag",i="",s+=b):b===">"?(o="text",i="",s+=b):(i+=b,s+=b);break;case"after-eq":b==='"'||b==="'"?(o="attr-quoted",a=b,s+=b):/\s/.test(b)?(o="in-tag",i="",s+=b):b===">"?(o="text",i="",s+=b):(o="attr-unquoted",s+=b);break;case"attr-unquoted":/\s/.test(b)?(o="in-tag",i="",s+=b):(b===">"&&(o="text",i=""),s+=b);break;case"attr-quoted":s+=b,b===a&&(o="in-tag",i="");break;case"skip-attr":if(b===a){if(f){let y=f.firstPartIdx,w=[];for(let A=y;A<r.length;A++)(r[A].kind==="noop"||r[A].kind==="attr-mixed")&&w.push(A);let E=[],R=t[w[0]],_=R.lastIndexOf(a);E.push(_>=0?R.slice(_+1):R);for(let A=1;A<w.length;A++)E.push(t[w[A]]);let x=t[w[w.length-1]+1],M=x.indexOf(a);E.push(M>=0?x.slice(0,M):x),r[y]={kind:"attr-mixed",path:[],name:f.name,statics:E,group:w};for(let A=1;A<w.length;A++)r[w[A]]={kind:"noop",path:[],mixedAnchor:y};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+=`<!--${C}${h}-->`,r.push({kind:"child",path:[]});else if(o==="in-tag"){let b=`data-${C}${h}`;s+=`${b}=""`,r.push({kind:"element",path:[]})}else if(o==="after-eq"){let b=i[0],y=i.slice(1);if(ur(b)){s=s.slice(0,c);let w=ge[b],E=`data-${C}${h}`;s+=`${E}=""`,r.push({kind:w,path:[],name:y})}else{s=s.slice(0,c);let w=`data-${C}${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 b=`data-${C}${h}`;s+=`${b}=""`,f={name:i,firstPartIdx:h},r.push({kind:"noop",path:[]}),o="skip-attr"}else o==="skip-attr"&&r.push({kind:"noop",path:[]})}}let m=document.createElement("template");return m.innerHTML=s,zo(m.content,r),Vo(m.content,r),n={templateEl:m,parts:r},Rr.set(t,n),n}function zo(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(B,"");let s=t.length;r.setAttribute(`data-${C}${s}`,""),t.push({kind:"slot",path:[]})}}function Vo(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(C)){let a=Number(c.slice(C.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-${C}`)){let f=Number(l.name.slice(`data-${C}`.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 Ko(e,t){let{templateEl:n,parts:r}=St(e),s=n.content.cloneNode(!0),o=document.createComment(`${C}s`),i=document.createComment(`${C}e`),c=r.map(l=>At(l,s)),a=[];for(let l=0;l<e.values.length;l++)X(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"&&X(l,void 0,void 0,[]);return{strings:e.strings,bound:c,lastValues:a,startNode:o,endNode:i}}function At(e,t){if(e.kind==="noop")return{kind:"noop",mixedAnchor:e.mixedAnchor};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];if(Object.is(r,e.lastValues[n]))continue;let s=e.bound[n],o=s.mixedAnchor;s.kind==="noop"&&o!=null?X(e.bound[o],t[o],e.lastValues[o],t):X(s,r,e.lastValues[n],t),e.lastValues[n]=r}}function Lr(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=yn(n.slotEl);r&&jr(r,n.slotEl)}}t.replaceChildren()}function X(e,t,n,r){if(we(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":Jo(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=yn(s);if(!c||Go(s))return;let a=document.createDocumentFragment();for(;s.firstChild;)a.appendChild(s.firstChild);s[gt]=a,yt(c)};yn(s)?o():queueMicrotask(o);break}case"noop":break}}function yn(e){let t=e.parentElement;for(;t;){if(t[W])return t;t=t.parentElement}return null}function Go(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=oe(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 Jo(e,t){return oi(e,t),U(e,t)}function U(e,t){let n=e.marker;if(ye(t)){J(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(re(t)){let s=t,o=e.__keyedKey;o!==void 0&&!Object.is(o,s.key)&&J(e),e.__keyedKey=s.key,U(e,s.value);return}if(se(t)){let s=t,o=e.__guardDeps,i=s.deps;if(o!==void 0&&(Array.isArray(o)&&Array.isArray(i)?si(o,i):Object.is(o,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,U(e,s.fn());return}if(_e(t)){J(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(oe(t))return;if(ie(t))return ii(e,t.value);if(ae(t))return ai(e,t.args);if(ce(t))return ci(e,t.signal);if(Se(t))return li(e,t);if(Ae(t))return ui(e,t);if(ne(t)){if(e.child&&e.child.kind==="repeat"){Qo(e,t);return}J(e);let s={kind:"repeat",map:new Map};e.child=s,Zo(n,s,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){ni(e,t);return}J(e);let s={kind:"array",items:[]};e.child=s,ti(n,s,t);return}if(e.child){let s=e.child;if(s.kind==="repeat")Or(s),e.child=void 0;else if(s.kind==="array")Ir(s),e.child=void 0;else if(s.kind==="async-stream")Br(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}xe(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}=St(s),c=o.content.cloneNode(!0),a=document.createComment(`${C}s`),l=document.createComment(`${C}e`),f=i.map(m=>At(m,c)),d=[];for(let m=0;m<s.values.length;m++)X(f[m],s.values[m],void 0,s.values),d.push(s.values[m]);let u=[a,...c.childNodes,l];n.parentNode?.insertBefore(Xo(u),n);for(let m of f)m.kind==="slot"&&X(m,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 Xo(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function xe(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 _n(e){let{templateEl:t,parts:n}=St(e),r=t.content.cloneNode(!0),s=document.createComment(`${C}s`),o=document.createComment(`${C}e`),i=n.map(l=>At(l,r)),c=[];for(let l=0;l<e.values.length;l++)X(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 Ve(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 Zo(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}=_n(f);t.map.set(l,d),c.appendChild(u)}i.insertBefore(c,e)}function Qo(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),wn(u.startNode,u.endNode,r,n),a.set(f,u),s.map.delete(f);else{u&&(Ve(u),xe(u.startNode,u.endNode),s.map.delete(f));let{inst:m,frag:g}=_n(d);r.insertBefore(g,n),a.set(f,m)}}for(let l of s.map.values())Ve(l),xe(l.startNode,l.endNode);s.map=a}function Or(e){for(let t of e.map.values())Ve(t),xe(t.startNode,t.endNode);e.map.clear()}function ei(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function _t(e){e.type==="tpl"?(Ve(e.inst),xe(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Mr(e){if(N(e)){let{inst:t,frag:n}=_n(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 ti(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}=Mr(i);a&&s.appendChild(a),o.push(c)}r.insertBefore(s,e),t.items=o}function ni(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&&_t(l),i.push({type:"empty"});continue}let{item:f,frag:d}=Mr(a);d&&r.insertBefore(d,ri(o,c,n)),l&&_t(l),i.push(f)}for(let c=t.length;c<o.length;c++)_t(o[c]);s.items=i}function ri(e,t,n){for(let r=t;r<e.length;r++){let s=ei(e[r]);if(s&&s.parentNode)return s}return n}function Ir(e){for(let t of e.items)_t(t);e.items=[]}function wn(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 si(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 J(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Pr(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Or(n);else if(n.kind==="array")Ir(n);else if(n.kind==="async-stream")Br(n);else if("strings"in n){let r=e.child;Ve(r),xe(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function oi(e,t){let n=e;n.__untilState&&!ae(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!se(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!ie(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!re(t)&&(n.__keyedKey=void 0),n.__watchSub&&!ce(t)&&Pr(n)}function ii(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();wn(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&&J(e),wn(a.inst.startNode,a.inst.endNode,n.parentNode,n),ve(a.inst,c.values),e.child=a.inst;return}}U(e,t)}function ai(e,t){let n=e,r=n.__untilState,s=n.__untilArgs,o=(u,m)=>!!(Object.is(u,m)||N(u)&&N(m)&&u.strings===m.strings),c=s&&s.length===t.length&&s.every((u,m)=>o(u,t[m]))&&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 m=t[u];if(!m||typeof m.then!="function"){l=u,f=m;break}}l!==-1&&l<=a.highestResolved?(U(e,f),a.highestResolved=l):l===-1&&!n.__untilEverRendered&&U(e,""),n.__untilEverRendered=!0;let d=Math.min(l===-1?t.length:l,a.highestResolved);for(let u=0;u<d;u++){let m=t[u];!m||typeof m.then!="function"||Promise.resolve(m).then(g=>{a.aborted||u>=a.highestResolved||(a.highestResolved=u,U(e,g))},()=>{})}}function ci(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let o;n.__watchSub.observe(()=>{o=t.get()}),U(e,o);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new De.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let o;r.observe(()=>{o=t.get()}),U(e,o)})});n.__watchSub=r;let s;r.observe(()=>{s=t.get()}),U(e,s)}function Pr(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function li(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;J(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,$r(s,e,t)}function ui(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;J(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,$r(s,e,t)}async function $r(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=Fr(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 Fr(e){if(e==null||e===!1||e===!0)return[];if(N(e)){let t=e,{templateEl:n,parts:r}=St(t),s=n.content.cloneNode(!0),o=r.map(i=>At(i,s));for(let i=0;i<t.values.length;i++)X(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(...Fr(n));return t}return[document.createTextNode(String(e))]}function Br(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 Ur=null;function Et(e){Ur=e||null}function fi(){return Ur||void 0}var qr=Symbol.for("webjs:registry"),Dr=Symbol.for("webjs:classToTag"),Ct=globalThis,q=Ct[qr]||(Ct[qr]=new Map),Hr=Ct[Dr]||(Ct[Dr]=new WeakMap),vt=typeof window<"u"&&typeof customElements<"u";function Sn(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=q.get(e);r?(r.cls=t,r.lazy=n):q.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),Hr.set(t,e)}if(vt){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),Sn(t,n)}}if(!vt){let e=globalThis;e.customElements||(e.customElements={define(t,n){Sn(t,n)},get(t){return q.get(t)?.cls},upgrade(){},whenDefined(t){let n=q.get(t);return Promise.resolve(n?.cls)}})}function An(e,t){vt?customElements.define(e,t):Sn(e,t)}function di(e,t){if(vt)return;let n=q.get(e);if(n){n.moduleUrl=t;return}q.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function En(e){return q.get(e)?.cls}function pi(e){return q.get(e)?.moduleUrl||null}function hi(e){return q.get(e)?.lazy===!0}function xt(e){return Hr.get(e)}function Cn(){return[...q.keys()]}Te();wt();var Jr=typeof window<"u"&&typeof HTMLElement<"u";function ki(e,t){return e!==t}function Ti(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var kt=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=Ti(),this.__internals}},Ni=["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 Ni){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(kt.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var ji=Jr?HTMLElement:kt,Xr=Symbol("webjs.factoryProps"),Gr=new WeakSet,Ne=class e extends ji{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){An(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||vn(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(Gr.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,Xr)){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)}Gr.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||ki)(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||vn(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(!Jr)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=Yr(r.slice(16));try{this[o]=V(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&&!this.hasAttribute("data-wj-host")&&this.setAttribute("data-wj-host",""),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:be(r)?[r]:[];if(s.length){if(n){let o=this.shadowRoot.querySelector("style");o&&o.remove()}Qt(this._renderRoot,s)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${xt(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().`),hn(this)||(this.__isHydrating()?(Y(this),xr(this)):vr(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&&Tr(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&&Nr(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||vn(f))===t){i=f,c=d;break}if(c===void 0&&(i=Yr(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,Et(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{Et(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 De.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);ke(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&ke(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{n===this.__renderToken&&ke(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==Tt.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${xt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&ke(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 vn(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Yr(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Tt(e){return new.target?Reflect.construct(Ne,arguments,new.target):class extends Ne{static properties=e;static[Xr]=!0}}Object.setPrototypeOf(Tt,Ne);Tt.prototype=Ne.prototype;function Ri(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}Be();var Yc=Symbol.for("webjs.suspense");function Li(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function Nt(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}Te();var xn=null;function Oi(e){xn=e}function kn(){if(!xn)return"";try{return xn()||""}catch{return""}}async function Mi(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 Q(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(ye(e))return String(e.value??"");if(we(e))return k(e.value,t);if(ce(e))return k(e.signal.get(),t);if(re(e))return k(e.value,t);if(se(e))return k(e.fn(),t);if(_e(e)){let n=e.template;return String(n?.innerHTML??"")}if(oe(e))return"";if(ie(e))return k(e.value,t);if(ae(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(Se(e)||Ae(e))return"";if(Array.isArray(e))return(await Promise.all(e.map(r=>k(r,t)))).join("");if(ne(e)){let n=e;return(await Promise.all(n.items.map((s,o)=>k(n.templateFn(s,o),t)))).join("")}if(Nt(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)?Ii(e,t):ct(String(e))}async function Ii(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 m=n[u];for(let g=0;g<m.length;g++){let p=m[g];switch(o){case"text":s+=p,p==="<"&&(o="tag-open");break;case"tag-open":s+=p,p==="!"?o="bang-1":p==="/"?(o="tag-name",f=""):/[a-zA-Z]/.test(p)?(o="tag-name",f=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=jt(f)?"rawtext":"text",o==="rawtext"&&(d="")):/\s/.test(p)?o="in-tag":f+=p.toLowerCase();break;case"in-tag":s+=p,p===">"?(o=jt(f)?"rawtext":"text",o==="rawtext"&&(d="")):!/\s/.test(p)&&p!=="/"&&(o="attr-name",i=p,c=s.length-1);break;case"rawtext":s+=p,d=(d+p.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(o="text",d="",f="");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}}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 p=i[0],h=i.slice(1),b=ge[p];if(b==="event")s=s.slice(0,c),o="in-tag",i="";else if(b==="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 Ye(g);s+=`data-webjs-prop-${Ji(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 b==="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 Pi=new Set(["document","window","localStorage","sessionStorage","navigator","matchMedia","requestAnimationFrame","getComputedStyle","IntersectionObserver","MutationObserver","ResizeObserver"]),$i=new Set(["attachShadow","querySelector","querySelectorAll","getBoundingClientRect","focus","blur","scrollIntoView"]);function Fi(e){let t=e&&typeof e.message=="string"?e.message:"",n=/^(\w+) is not defined\b/.exec(t);return e instanceof ReferenceError&&n&&Pi.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&&$i.has(n[1])?`\`${n[1]}\` is an HTMLElement method that does not exist on the server-side component instance during SSR.`:null)}function Bi(){return typeof process<"u"&&process.env&&!0}function ts(e,t,n){if(!(n===void 0?!Bi():!!n))return"";let s=t&&t.message?t.message:String(t);return Zt`<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><${e}> failed to render</strong>
|
|
5
5
|
<div style="margin-top:4px;white-space:pre-wrap">${s}</div>
|
|
6
|
-
</div>`}async function Q(e,t,n=[],r){e=await qi(e,t,n,r);let s=Cn();if(!s.length)return e;let o=[...s].sort((d,u)=>u.length-d.length),i=new RegExp(`<(${o.map(Je).join("|")})(?=[\\s>/])((?:"[^"]*"|'[^']*'|[^>])*?)(/?)>`,"g"),c=[];for(let d of e.matchAll(i)){let[u,m,g,p]=d,h=En(m);if(!h)continue;t&&t.usedComponents&&t.usedComponents.add(m);let b=p?`<${m}${g}>`:u,y=null;try{let w=h.shadow===!0;y=new h,y.__ssrTag=m,y.__ssrAncestors=n;let E=Xr(g),R=Ji(E),_=new Set(Object.keys(Xr(g)).map(A=>A.toLowerCase()));zi(y,E),Ki(y,E,h);for(let[A,S]of Object.entries(R))y[A]=S;typeof y.performServerUpdate=="function"&&y.performServerUpdate();let x=y.render?y.render():"";x&&typeof x.then=="function"&&(x=await x),b=Vi(b,y,_);let M=await k(x,t);if(w){let A=await Q(M,t,[...n,y],r),S=h.styles,I=Array.isArray(S)?S:S&&be(S)?[S]:[],me=at(I);c.push({start:d.index,end:d.index+u.length,text:`${b}<template shadowrootmode="open">${me}${A}</template>`})}else{if(M.trim()===""){c.push({start:d.index,end:d.index+u.length,text:`${b}<!--webjs-hydrate-->`});continue}let S="",I=d.index+u.length;if(!p){let Xt=d.index+u.length,it=Xe(e,Xt,m);if(it!==-1){S=e.slice(Xt,it);let so=new RegExp(`</${Je(m)}\\s*>`,"i"),oo=e.slice(it),ir=so.exec(oo),io=ir?ir[0].length:`</${m}>`.length;I=it+io}else S=e.slice(Xt),I=e.length}let me=Hi(S),ot=Wi(M,me),ro=await Q(ot,t,[...n,y],r);c.push({start:d.index,end:I,text:`${b}<!--webjs-hydrate-->${ro}</${m}>`})}}catch(w){let E=$i(w);console.error(E?`[webjs] SSR failed for <${m}>: ${E} 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 <${m}>:`,w);let R=w instanceof Error?w:new Error(String(w)),_="";try{let S;y&&typeof y.renderError=="function"&&(S=y.renderError(R)),S===void 0&&(S=Zr(m,R,r)),_=await k(S,t),_.trim()&&(_=await Q(_,t,y?[...n,y]:n,r))}catch(S){console.error(`[webjs] renderError() for <${m}> also threw:`,S),_=""}let x=d.index+u.length;if(!p){let S=d.index+u.length,I=Xe(e,S,m);if(I!==-1){let ot=new RegExp(`</${Je(m)}\\s*>`,"i").exec(e.slice(I));x=I+(ot?ot[0].length:`</${m}>`.length)}else x=e.length}let M=h.shadow===!0,A;if(M){let S=h.styles,I=Array.isArray(S)?S:S&&be(S)?[S]:[],me=at(I);A=`${b}<template shadowrootmode="open">${me}${_}</template>`}else A=`${b}<!--webjs-hydrate-->${_}</${m}>`;c.push({start:d.index,end:x,text:A})}}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:m,text:g}=a[d];f=f.slice(0,u)+g+f.slice(m)}return f}var Bi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Ui(e){return Bi.has(e.toLowerCase())}async function qi(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),m=u?Rt(u[1]):"",g=Xe(i,f,"webjs-suspense"),p,h;if(g===-1)p=i.slice(f),h="";else{p=i.slice(f,g);let b=/<\/webjs-suspense\s*>/i.exec(i.slice(g));h=i.slice(g+(b?b[0].length:17))}if(t){let b=`s${t.nextId++}`;t.pending.push({id:b,promise:Promise.resolve(en(p))}),o+=`<webjs-suspense id="${b}">${m}</webjs-suspense>`}else{let b=await Q(p,t,n,r);o+=`<webjs-suspense>${b}</webjs-suspense>`}i=h}return o}function Xe(e,t,n){let r=Je(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 Di(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 Hi(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||Ui(d),m=Di(l),g;if(u)g=s+c.length;else{let h=s+c.length,b=Xe(e,h,d);if(b===-1){let _=e.slice(s);m!==null?Jr(t,m,_):n+=_,r=e.length;continue}let y=new RegExp(`</${Je(d)}\\s*>`,"i"),w=e.slice(b),E=y.exec(w),R=E?E[0].length:`</${d}>`.length;g=b+R}let p=e.slice(s,g);m!==null?Jr(t,m,p):n+=p,r=g}return n.length>0&&t.set(null,n),t}function Jr(e,t,n){let r=e.get(t);r!==void 0?e.set(t,r+n):e.set(t,n)}function Wi(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,m=a.replace(/\bname\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,"").trim(),g="",p;if(f)p=i.index+c.length;else{let w=i.index+c.length,E=Xe(e,w,"slot");if(E===-1)g=e.slice(w),p=e.length;else{g=e.slice(w,E);let R=/<\/slot\s*>/i,_=e.slice(E),x=R.exec(_),M=x?x[0].length:7;p=E+M}}let h=t.get(u),b=u!==null?` name="${$(u)}"`:"",y=m?` ${m}`:"";h!==void 0&&!n.has(u)?(n.add(u),r+=`<slot data-webjs-light data-projection="actual"${b}${y}>${h}</slot>`):r+=`<slot data-webjs-light data-projection="fallback"${b}${y}>${g}</slot>`,s=p,o.lastIndex=p}return r+=e.slice(s),r}function Je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jt(e){return e==="script"||e==="style"}function Xr(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 zi(e,t){if(!(!e||typeof e.setAttribute!="function"))for(let[n,r]of Object.entries(t))e.setAttribute(n,Rt(r))}function Vi(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 Ki(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||Gi(l))===s){i=l,c=f;break}if(c===void 0&&(c=r[s]||r[Tn(s)],i=r[s]?s:Tn(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(Rt(o))}catch{e[i]=o}else e[i]=o}}function Tn(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Gi(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Yi(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Rt(e){return e.replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&")}function Ji(e){let t={};for(let n of Object.keys(e)){if(!n.startsWith("data-webjs-prop-"))continue;let r=Tn(n.slice(16));try{t[r]=V(Rt(e[n]))}catch{}delete e[n]}return t}function Xi(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 O(e,n,s);else{let o=await k(e,n),i=await Q(o,n,[],r);s.enqueue(i)}n&&n.pending.length&&await Qi(n,s,r),s.close()}catch(o){s.error(o)}}})}async function O(e,t,n){if(!(e==null||e===!1||e===!0)){if(e&&typeof e.then=="function")return e=await e,O(e,t,n);if(ye(e)){n.enqueue(String(e.value??""));return}if(we(e))return O(e.value,t,n);if(ce(e))return O(e.signal.get(),t,n);if(re(e))return O(e.value,t,n);if(se(e))return O(e.fn(),t,n);if(_e(e)){let r=e.template;n.enqueue(String(r?.innerHTML??""));return}if(!oe(e)){if(ie(e))return O(e.value,t,n);if(ae(e)){let r=e.args;for(let s of r)if(!s||typeof s.then!="function")return O(s,t,n);if(r.length>0)try{let s=await Promise.race(r.map(o=>Promise.resolve(o).catch(()=>{})));return O(s,t,n)}catch{return}return}if(!(Se(e)||Ae(e))){if(Array.isArray(e)){for(let r of e)await O(r,t,n);return}if(ne(e)){let r=e;for(let s=0;s<r.items.length;s++)await O(r.templateFn(r.items[s],s),t,n);return}if(Nt(e)){let r=e;if(t){let s=`s${t.nextId++}`;n.enqueue(`<webjs-boundary id="${s}">`),await O(r.fallback,t,n),n.enqueue("</webjs-boundary>"),t.pending.push({id:s,promise:Promise.resolve(r.children)})}else await O(r.fallback,t,n);return}if(N(e)){await Zi(e,t,n);return}n.enqueue(ct(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 m=0;m<r.length;m++){let g=r[m];for(let p=0;p<g.length;p++){let h=g[p];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=jt(f)?"rawtext":"text",o==="rawtext"&&(d="")):/\s/.test(h)?o="in-tag":f+=h.toLowerCase();break;case"in-tag":u+=h,h===">"?(o=jt(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(m<s.length){let p=s[m];if(p&&typeof p.then=="function"&&(p=await p),o==="comment")u+=String(p??""),l=0;else if(o==="rawtext")u+=String(p??""),d="";else if(o==="text")u&&(n.enqueue(u),u=""),await O(p,t,n);else if(o==="after-eq"){let h=i[0],b=i.slice(1),y=ge[h];y==="event"||y==="prop"?(u=u.slice(0,c),o="in-tag",i=""):y==="bool"?(u=u.slice(0,c),p&&(u+=`${b}=""`),o="in-tag",i=""):(u+=`"${$(String(p??""))}"`,o="in-tag",i="")}else(o==="attr-quoted"||o==="attr-unquoted")&&(u+=$(String(p??"")))}}u&&n.enqueue(u)}async function Qi(e,t,n){let r=kn(),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 Q(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 Q(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 Qr=Symbol.for("webjs.notFound"),es=Symbol.for("webjs.redirect"),ts=Symbol.for("webjs.forbidden"),ns=Symbol.for("webjs.unauthorized");function ea(){let e=new Error("webjs: notFound()");throw e.__webjs=Qr,e}function ta(){let e=new Error("webjs: forbidden()");throw e.__webjs=ts,e}function na(){let e=new Error("webjs: unauthorized()");throw e.__webjs=ns,e}function ra(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=es,r.url=e,r.status=typeof n=="number"?n:void 0,r}function sa(e){return!!e&&e.__webjs===Qr}function oa(e){return!!e&&e.__webjs===es}function ia(e){return!!e&&e.__webjs===ts}function aa(e){return!!e&&e.__webjs===ns}function ca(e,t={}){let n=t.reconnect!==!1,r=0,s=!1,o=null,i=[];function c(){s||(o=new WebSocket(la(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 la(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}`}Te();var Nn="application/vnd.webjs+json";async function ua(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",Nn);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 Ye(r),n.has("content-type")||n.set("content-type",Nn));let s=await fetch(e,{...t,headers:n,body:r}),o=s.headers.get("content-type")||"",i=await s.text(),c=o.includes(Nn)?i?V(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}Te();On();Ln();Ot();var nr=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 Ya(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 Ja(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Ya(e,t,n):new nr(e,t)}Pn();var Yt=0,to=new Map,Fe=new Map,Xa=1e3;function Za(e){if(!(!Array.isArray(e)||!e.length)){Yt+=1;for(let t of e)t&&to.set(t,Yt)}}function Qa(){return Yt}function ec(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(Fe.delete(e),Fe.set(e,{tags:t.slice(),since:typeof n=="number"?n:Yt}),Fe.size>Xa)){let r=Fe.keys().next().value;r!==void 0&&Fe.delete(r)}}function tc(e){let t=Fe.get(e);if(!t)return!1;for(let n of t.tags)if((to.get(n)||0)>t.since)return!0;return!1}function nc(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var rc="application/vnd.webjs+stream",sc=1,oc=2,ic=3,no=new Uint8Array(0);function ac(e,t){let n=t||no,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 cc(){let e=no;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 lc=Symbol.for("webjs.context");function uc(e){return{__context__:lc,name:e}}var Jt=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},rr=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()}},sr=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 Jt(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 fc(){return typeof window<"u"}var K={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},or=class{constructor(t,{task:n,args:r,autoRun:s=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=s,this._status=K.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=K.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=K.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=K.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 K.INITIAL:return t.initial?.();case K.PENDING:return t.pending?.();case K.COMPLETE:return t.complete?.(this._value);case K.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!fc())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{sr as ContextConsumer,rr as ContextProvider,Jt as ContextRequestEvent,sc as FRAME_CHUNK,oc as FRAME_END,ic as FRAME_ERROR,C as MARKER,ds as SEED_MISS,rc as STREAM_CONTENT_TYPE,De as Signal,Ri as Suspense,or as Task,K as TaskStatus,Tt as WebComponent,Rn as WebjsFrame,In as WebjsStream,ui as activeActionSignal,Qt as adoptStyles,Cn as allTags,yo as asyncAppend,wo as asyncReplace,No as batch,bo as cache,Ro as computed,ca as connectWS,tc as consumeStale,uc as createContext,cc as createFrameDecoder,mo as createRef,kn as cspNonce,co as css,Wr as deserialize,ws as disableClientRouter,Oo as effect,zn as enableClientRouter,ac as encodeFrame,$ as escapeAttr,ct as escapeText,Qa as fetchMark,ta as forbidden,fo as guard,Zt as html,Se as isAsyncAppend,Ae as isAsyncReplace,be as isCSS,ie as isCache,ia as isForbidden,se as isGuard,re as isKeyed,pi as isLazy,we as isLive,sa as isNotFound,oa as isRedirect,oe as isRef,ne as isRepeat,Lo as isSignal,Nt as isSuspense,N as isTemplate,_e as isTemplateContent,aa as isUnauthorized,ye as isUnsafeHTML,ae as isUntil,ce as isWatch,uo as keyed,lo as live,En as lookup,di as lookupModuleUrl,Za as markStale,_s as navigate,ea as notFound,Ja as optimistic,V as parse,nc as parseTagHeader,fi as primeModuleUrl,ji as prop,ra as redirect,ho as ref,An as register,ec as registerKeyTags,ke as render,Mn as renderStream,Xi as renderToStream,Oi as renderToString,ur as repeat,Ss as revalidate,ua as richFetch,It as scanSeeds,Hr as serialize,Et as setActiveActionSignal,Li as setCspNonceProvider,jo as signal,Ye as stringify,at as stylesToString,xt as tagOf,ga as takeSeed,po as templateContent,na as unauthorized,en as unsafeHTML,go as until,_o as watch};
|
|
6
|
+
</div>`}async function Q(e,t,n=[],r){e=await Di(e,t,n,r);let s=Cn();if(!s.length)return e;let o=[...s].sort((d,u)=>u.length-d.length),i=new RegExp(`<(${o.map(Je).join("|")})(?=[\\s>/])((?:"[^"]*"|'[^']*'|[^>])*?)(/?)>`,"g"),c=[];for(let d of e.matchAll(i)){let[u,m,g,p]=d,h=En(m);if(!h)continue;t&&t.usedComponents&&t.usedComponents.add(m);let b=p?`<${m}${g}>`:u,y=null;try{let w=h.shadow===!0;y=new h,y.__ssrTag=m,y.__ssrAncestors=n;let E=Qr(g),R=Xi(E),_=new Set(Object.keys(Qr(g)).map(A=>A.toLowerCase()));Vi(y,E),Gi(y,E,h);for(let[A,S]of Object.entries(R))y[A]=S;typeof y.performServerUpdate=="function"&&y.performServerUpdate();let x=y.render?y.render():"";x&&typeof x.then=="function"&&(x=await x),b=Ki(b,y,_),w||(b=es(b));let M=await k(x,t);if(w){let A=await Q(M,t,[...n,y],r),S=h.styles,I=Array.isArray(S)?S:S&&be(S)?[S]:[],me=at(I);c.push({start:d.index,end:d.index+u.length,text:`${b}<template shadowrootmode="open">${me}${A}</template>`})}else{if(M.trim()===""){c.push({start:d.index,end:d.index+u.length,text:`${b}<!--webjs-hydrate-->`});continue}let S="",I=d.index+u.length;if(!p){let Xt=d.index+u.length,it=Xe(e,Xt,m);if(it!==-1){S=e.slice(Xt,it);let oo=new RegExp(`</${Je(m)}\\s*>`,"i"),io=e.slice(it),cr=oo.exec(io),ao=cr?cr[0].length:`</${m}>`.length;I=it+ao}else S=e.slice(Xt),I=e.length}let me=Wi(S),ot=zi(M,me),so=await Q(ot,t,[...n,y],r);c.push({start:d.index,end:I,text:`${b}<!--webjs-hydrate-->${so}</${m}>`})}}catch(w){let E=Fi(w);console.error(E?`[webjs] SSR failed for <${m}>: ${E} 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 <${m}>:`,w);let R=w instanceof Error?w:new Error(String(w)),_="";try{let S;y&&typeof y.renderError=="function"&&(S=y.renderError(R)),S===void 0&&(S=ts(m,R,r)),_=await k(S,t),_.trim()&&(_=await Q(_,t,y?[...n,y]:n,r))}catch(S){console.error(`[webjs] renderError() for <${m}> also threw:`,S),_=""}let x=d.index+u.length;if(!p){let S=d.index+u.length,I=Xe(e,S,m);if(I!==-1){let ot=new RegExp(`</${Je(m)}\\s*>`,"i").exec(e.slice(I));x=I+(ot?ot[0].length:`</${m}>`.length)}else x=e.length}let M=h.shadow===!0;M||(b=es(b));let A;if(M){let S=h.styles,I=Array.isArray(S)?S:S&&be(S)?[S]:[],me=at(I);A=`${b}<template shadowrootmode="open">${me}${_}</template>`}else A=`${b}<!--webjs-hydrate-->${_}</${m}>`;c.push({start:d.index,end:x,text:A})}}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:m,text:g}=a[d];f=f.slice(0,u)+g+f.slice(m)}return f}var Ui=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function qi(e){return Ui.has(e.toLowerCase())}async function Di(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),m=u?Rt(u[1]):"",g=Xe(i,f,"webjs-suspense"),p,h;if(g===-1)p=i.slice(f),h="";else{p=i.slice(f,g);let b=/<\/webjs-suspense\s*>/i.exec(i.slice(g));h=i.slice(g+(b?b[0].length:17))}if(t){let b=`s${t.nextId++}`;t.pending.push({id:b,promise:Promise.resolve(en(p))}),o+=`<webjs-suspense id="${b}">${m}</webjs-suspense>`}else{let b=await Q(p,t,n,r);o+=`<webjs-suspense>${b}</webjs-suspense>`}i=h}return o}function Xe(e,t,n){let r=Je(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 Hi(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 Wi(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||qi(d),m=Hi(l),g;if(u)g=s+c.length;else{let h=s+c.length,b=Xe(e,h,d);if(b===-1){let _=e.slice(s);m!==null?Zr(t,m,_):n+=_,r=e.length;continue}let y=new RegExp(`</${Je(d)}\\s*>`,"i"),w=e.slice(b),E=y.exec(w),R=E?E[0].length:`</${d}>`.length;g=b+R}let p=e.slice(s,g);m!==null?Zr(t,m,p):n+=p,r=g}return n.length>0&&t.set(null,n),t}function Zr(e,t,n){let r=e.get(t);r!==void 0?e.set(t,r+n):e.set(t,n)}function zi(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,m=a.replace(/\bname\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,"").trim(),g="",p;if(f)p=i.index+c.length;else{let w=i.index+c.length,E=Xe(e,w,"slot");if(E===-1)g=e.slice(w),p=e.length;else{g=e.slice(w,E);let R=/<\/slot\s*>/i,_=e.slice(E),x=R.exec(_),M=x?x[0].length:7;p=E+M}}let h=t.get(u),b=u!==null?` name="${$(u)}"`:"",y=m?` ${m}`:"";h!==void 0&&!n.has(u)?(n.add(u),r+=`<slot data-webjs-light data-projection="actual"${b}${y}>${h}</slot>`):r+=`<slot data-webjs-light data-projection="fallback"${b}${y}>${g}</slot>`,s=p,o.lastIndex=p}return r+=e.slice(s),r}function Je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jt(e){return e==="script"||e==="style"}function Qr(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 Vi(e,t){if(!(!e||typeof e.setAttribute!="function"))for(let[n,r]of Object.entries(t))e.setAttribute(n,Rt(r))}function es(e){return/\sdata-wj-host(?=[\s>=])/i.test(e)?e:`${e.slice(0,-1)} data-wj-host>`}function Ki(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 Gi(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||Yi(l))===s){i=l,c=f;break}if(c===void 0&&(c=r[s]||r[Tn(s)],i=r[s]?s:Tn(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(Rt(o))}catch{e[i]=o}else e[i]=o}}function Tn(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Yi(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Ji(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Rt(e){return e.replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&")}function Xi(e){let t={};for(let n of Object.keys(e)){if(!n.startsWith("data-webjs-prop-"))continue;let r=Tn(n.slice(16));try{t[r]=V(Rt(e[n]))}catch{}delete e[n]}return t}function Zi(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 O(e,n,s);else{let o=await k(e,n),i=await Q(o,n,[],r);s.enqueue(i)}n&&n.pending.length&&await ea(n,s,r),s.close()}catch(o){s.error(o)}}})}async function O(e,t,n){if(!(e==null||e===!1||e===!0)){if(e&&typeof e.then=="function")return e=await e,O(e,t,n);if(ye(e)){n.enqueue(String(e.value??""));return}if(we(e))return O(e.value,t,n);if(ce(e))return O(e.signal.get(),t,n);if(re(e))return O(e.value,t,n);if(se(e))return O(e.fn(),t,n);if(_e(e)){let r=e.template;n.enqueue(String(r?.innerHTML??""));return}if(!oe(e)){if(ie(e))return O(e.value,t,n);if(ae(e)){let r=e.args;for(let s of r)if(!s||typeof s.then!="function")return O(s,t,n);if(r.length>0)try{let s=await Promise.race(r.map(o=>Promise.resolve(o).catch(()=>{})));return O(s,t,n)}catch{return}return}if(!(Se(e)||Ae(e))){if(Array.isArray(e)){for(let r of e)await O(r,t,n);return}if(ne(e)){let r=e;for(let s=0;s<r.items.length;s++)await O(r.templateFn(r.items[s],s),t,n);return}if(Nt(e)){let r=e;if(t){let s=`s${t.nextId++}`;n.enqueue(`<webjs-boundary id="${s}">`),await O(r.fallback,t,n),n.enqueue("</webjs-boundary>"),t.pending.push({id:s,promise:Promise.resolve(r.children)})}else await O(r.fallback,t,n);return}if(N(e)){await Qi(e,t,n);return}n.enqueue(ct(String(e)))}}}}async function Qi(e,t,n){let{strings:r,values:s}=e,o="text",i="",c=0,a="",l=0,f="",d="",u="";for(let m=0;m<r.length;m++){let g=r[m];for(let p=0;p<g.length;p++){let h=g[p];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=jt(f)?"rawtext":"text",o==="rawtext"&&(d="")):/\s/.test(h)?o="in-tag":f+=h.toLowerCase();break;case"in-tag":u+=h,h===">"?(o=jt(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(m<s.length){let p=s[m];if(p&&typeof p.then=="function"&&(p=await p),o==="comment")u+=String(p??""),l=0;else if(o==="rawtext")u+=String(p??""),d="";else if(o==="text")u&&(n.enqueue(u),u=""),await O(p,t,n);else if(o==="after-eq"){let h=i[0],b=i.slice(1),y=ge[h];y==="event"||y==="prop"?(u=u.slice(0,c),o="in-tag",i=""):y==="bool"?(u=u.slice(0,c),p&&(u+=`${b}=""`),o="in-tag",i=""):(u+=`"${$(String(p??""))}"`,o="in-tag",i="")}else(o==="attr-quoted"||o==="attr-unquoted")&&(u+=$(String(p??"")))}}u&&n.enqueue(u)}async function ea(e,t,n){let r=kn(),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 Q(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 Q(await k(ts("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 ns=Symbol.for("webjs.notFound"),rs=Symbol.for("webjs.redirect"),ss=Symbol.for("webjs.forbidden"),os=Symbol.for("webjs.unauthorized");function ta(){let e=new Error("webjs: notFound()");throw e.__webjs=ns,e}function na(){let e=new Error("webjs: forbidden()");throw e.__webjs=ss,e}function ra(){let e=new Error("webjs: unauthorized()");throw e.__webjs=os,e}function sa(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=rs,r.url=e,r.status=typeof n=="number"?n:void 0,r}function oa(e){return!!e&&e.__webjs===ns}function ia(e){return!!e&&e.__webjs===rs}function aa(e){return!!e&&e.__webjs===ss}function ca(e){return!!e&&e.__webjs===os}function la(e,t={}){let n=t.reconnect!==!1,r=0,s=!1,o=null,i=[];function c(){s||(o=new WebSocket(ua(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 ua(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}`}Te();var Nn="application/vnd.webjs+json";async function fa(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",Nn);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 Ye(r),n.has("content-type")||n.set("content-type",Nn));let s=await fetch(e,{...t,headers:n,body:r}),o=s.headers.get("content-type")||"",i=await s.text(),c=o.includes(Nn)?i?V(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}Te();On();Ln();Ot();var sr=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 Xa(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 Za(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Xa(e,t,n):new sr(e,t)}Pn();var Yt=0,no=new Map,Fe=new Map,Qa=1e3;function ec(e){if(!(!Array.isArray(e)||!e.length)){Yt+=1;for(let t of e)t&&no.set(t,Yt)}}function tc(){return Yt}function nc(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(Fe.delete(e),Fe.set(e,{tags:t.slice(),since:typeof n=="number"?n:Yt}),Fe.size>Qa)){let r=Fe.keys().next().value;r!==void 0&&Fe.delete(r)}}function rc(e){let t=Fe.get(e);if(!t)return!1;for(let n of t.tags)if((no.get(n)||0)>t.since)return!0;return!1}function sc(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var oc="application/vnd.webjs+stream",ic=1,ac=2,cc=3,ro=new Uint8Array(0);function lc(e,t){let n=t||ro,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 uc(){let e=ro;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 fc=Symbol.for("webjs.context");function dc(e){return{__context__:fc,name:e}}var Jt=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},or=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()}},ir=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 Jt(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 pc(){return typeof window<"u"}var K={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},ar=class{constructor(t,{task:n,args:r,autoRun:s=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=s,this._status=K.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=K.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=K.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=K.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 K.INITIAL:return t.initial?.();case K.PENDING:return t.pending?.();case K.COMPLETE:return t.complete?.(this._value);case K.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!pc())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{ir as ContextConsumer,or as ContextProvider,Jt as ContextRequestEvent,ic as FRAME_CHUNK,ac as FRAME_END,cc as FRAME_ERROR,C as MARKER,ms as SEED_MISS,oc as STREAM_CONTENT_TYPE,De as Signal,Li as Suspense,ar as Task,K as TaskStatus,Tt as WebComponent,Rn as WebjsFrame,Mn as WebjsStream,fi as activeActionSignal,Qt as adoptStyles,Cn as allTags,wo as asyncAppend,_o as asyncReplace,jo as batch,go as cache,Lo as computed,la as connectWS,rc as consumeStale,dc as createContext,uc as createFrameDecoder,bo as createRef,kn as cspNonce,lo as css,Vr as deserialize,Ss as disableClientRouter,Mo as effect,Vn as enableClientRouter,lc as encodeFrame,$ as escapeAttr,ct as escapeText,tc as fetchMark,na as forbidden,po as guard,Zt as html,Se as isAsyncAppend,Ae as isAsyncReplace,be as isCSS,ie as isCache,aa as isForbidden,se as isGuard,re as isKeyed,hi as isLazy,we as isLive,oa as isNotFound,ia as isRedirect,oe as isRef,ne as isRepeat,Oo as isSignal,Nt as isSuspense,N as isTemplate,_e as isTemplateContent,ca as isUnauthorized,ye as isUnsafeHTML,ae as isUntil,ce as isWatch,fo as keyed,uo as live,En as lookup,pi as lookupModuleUrl,ec as markStale,As as navigate,ta as notFound,Za as optimistic,V as parse,sc as parseTagHeader,di as primeModuleUrl,Ri as prop,sa as redirect,mo as ref,An as register,nc as registerKeyTags,ke as render,In as renderStream,Zi as renderToStream,Mi as renderToString,dr as repeat,Es as revalidate,fa as richFetch,Mt as scanSeeds,zr as serialize,Et as setActiveActionSignal,Oi as setCspNonceProvider,Ro as signal,Ye as stringify,at as stylesToString,xt as tagOf,ya as takeSeed,ho as templateContent,ra as unauthorized,en as unsafeHTML,yo as until,So as watch};
|
|
7
7
|
//# sourceMappingURL=webjs-core.js.map
|