@webjsdev/core 0.7.47 → 0.7.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- var ds=Object.defineProperty;var W=(e,t)=>()=>(e&&(t=e(e=0)),t);var Kr=(e,t)=>{for(var n in t)ds(e,n,{get:t[n],enumerable:!0})};function _o(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function Zs(){if(bo||(ee=_o(),!ee))return;Ke=HTMLSlotElement.prototype.assignedNodes,$n=HTMLSlotElement.prototype.assignedElements,Et=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(N)&&!Bn(this)?Kn(this,n):Ke?Ke.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(N)&&!Bn(this)?Kn(this,n).filter(r=>r.nodeType===1):$n?$n.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=Et&&Et.get?Et.get.call(this):null;return n||yo(this)}});let e=Object.getOwnPropertyDescriptor(Text.prototype,"assignedSlot");Object.defineProperty(Text.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=e&&e.get?e.get.call(this):null;return n||yo(this)}}),Dn=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(N)&&!Bn(this)){let r=ea(this);if(r){let o=z(r);o.manualAssign||(o.manualAssign=new Map);let i=n.filter(Boolean);for(let[s,a]of o.manualAssign){if(s===this)continue;let c=a.filter(l=>{let u=l.deref();return u!==void 0&&i.indexOf(u)===-1});c.length!==a.length&&(c.length?o.manualAssign.set(s,c):o.manualAssign.delete(s))}if(i.length?o.manualAssign.set(this,i.map(s=>new WeakRef(s))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let s of i)o.pendingRecordNodes.add(s);else o.pendingRecordNodes=new Set(i);Ee(o),Y(r)}return}return Dn?Dn.apply(this,n):void 0},bo=!0}function Jn(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let i=!1,s=o.filter(a=>{let c=a.deref();return c===void 0?!1:(c===t&&(i=!0),!0)});if(s.length!==o.length&&(s.length?n.set(r,s):n.delete(r)),i){let a=e.host;return a&&(r===a||a.contains(r))?r:null}}return null}function ea(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[v])return V(t,e)?t:null;return null}function Bn(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.nodeType===11&&r.host)return!0;t=r}return!1}function Kn(e,t){if(e.getAttribute(I)!==D)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Vn(n,new Set,0)}function Vn(e,t,n){if(n>=Qs)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let i=o;if(t.has(i))continue;if(t.add(i),i.hasAttribute(N)){let s=Kn(i,{flatten:!1});if(s.length>0)for(let a of Vn(s,t,n+1))r.push(a);else for(let a of Vn(Array.from(i.childNodes),t,n+1))r.push(a)}else if(Ke){let s=Ke.call(i,{flatten:!0});for(let a of s)r.push(a)}else r.push(o)}else r.push(o);return r}function yo(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(N)&&t.getAttribute(I)===D?t:null}function z(e){let t=e,n=t[v];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[v]=n),n}function Xn(e){return!!e[v]}function Ao(e){let t=z(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),_.add(n),e.removeChild(n)}Ee(t)}function Ee(e){let t=e.assignedByName;t.clear();for(let n of e.authored)ta(t,ae(e,n),n)}function ae(e,t){let n=Jn(e,t);if(n)return $(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return vo(t)}function So(e){let t=z(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${N}]`);for(let o of r){let i=o;if(!V(e,i)||i.getAttribute(I)!==D||jt(t,e,i))continue;let s=$(i.getAttribute("name"));if(!n.has(s)){n.add(s);let a=Array.from(i.childNodes);for(let c of a)t.authored.push(c),vo(c)!==s&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(c,s));t.lastSnapshot.set(i,a.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if(V(e,o)){for(let i of Array.from(o.childNodes))_.add(i),t.authored.push(i);o.remove()}Ee(t)}function $(e){return e==null||e===""||e==="default"?null:e}function vo(e){return e.nodeType!==1?null:$(e.getAttribute("slot"))}function ta(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function ue(e,t,n){let r=z(e),o=$(t),i=Array.isArray(n)?n.filter(Boolean):n?[n]:[],s=r.authored.findIndex(c=>ae(r,c)===o),a=r.authored.filter(c=>ae(r,c)===o);r.authored=r.authored.filter(c=>ae(r,c)!==o),(s===-1||s>r.authored.length)&&(s=r.authored.length);for(let c of i)c.nodeType===1&&!Jn(r,c)&&(o==null?c.removeAttribute("slot"):c.setAttribute("slot",o)),_.add(c);if(r.authored.splice(s,0,...i),r.applying&&r.pendingRecordNodes){for(let c of a)r.pendingRecordNodes.add(c);for(let c of i)r.pendingRecordNodes.add(c)}else r.pendingRecordNodes=new Set([...a,...i]);if(r.adoptedKey){for(let c of a)r.adoptedKey.delete(c);for(let c of i)r.adoptedKey.delete(c)}Ee(r),Y(e)}function na(){Z||!ee||(Z=Node.prototype.appendChild,Eo=Node.prototype.insertBefore,ve=Node.prototype.removeChild,zn=Node.prototype.replaceChild,Co=Element.prototype.append,No=Element.prototype.prepend,xo=Element.prototype.replaceChildren,Ct=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),Yn=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function kt(e,t){let n=e[T];e[T]=!0;try{return t()}finally{e[T]=n,n||Qn(e)}}function ko(e){if(!ee)return;let t=e,n=z(e);n.backstop||(n.backstop=new MutationObserver(r=>Tt(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>To(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function Tt(e,t,n){let r=e,o=r[le],i=r[Symbol.for("webjs.instance")],s=!1,a=new Set;for(let c of n){for(let l of c.addedNodes)if(a.add(l),l!==o&&!(i&&Oo(i,l))){if(t.authored.indexOf(l)!==-1){s=!0;continue}_.add(l),t.authored.push(l),s=!0}for(let l of c.removedNodes){let u=t.authored.indexOf(l);if(u===-1||e.contains(l))continue;_.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(u,1),s=!0)}}s&&Y(e)}function Qn(e){let t=e,n=t[v];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&Tt(e,n,r)}function To(e,t){let n=e[v];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let i=o.target;o.attributeName==="name"?i.tagName==="SLOT"&&i.hasAttribute(N)&&V(e,i)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(i),n.authored.indexOf(i)!==-1&&(r=!0))}r&&Y(e)}function jo(e){let t=e[v];t&&(t.backstop&&(Tt(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(To(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function Ro(e){if(!ee)return;let t=e,n=t[v];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,i=!o&&n.adopted===!0,s=!1;for(let a of Array.from(e.childNodes))if(a!==t[le]){if(n.authored.indexOf(a)!==-1){s=!0;continue}o&&(!r||Oo(r,a))||!o&&i||(_.add(a),n.authored.push(a),s=!0)}s&&Y(e)}function Oo(e,t){if(!e||!e.startNode||!e.endNode)return!1;if(t===e.startNode||t===e.endNode)return!0;for(let n=e.startNode.nextSibling;n&&n!==e.endNode;n=n.nextSibling)if(n===t)return!0;return!1}function ra(e){let t=e,n=t[le];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[le]=n),kt(e,()=>Z.call(e,n))),n}function ce(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function Un(e,t,n){if(n&&!ce(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!ce(t))throw new TypeError("Failed to execute insertion on the host: parameter is not of type Node.");if(t&&t.nodeType===11){let r=Array.from(t.childNodes);Nt(e,r);for(let o of r)ve.call(t,o);return r}return Nt(e,[t]),[t]}function Nt(e,t){Se(e,t);for(let n of t){if(!ce(n))throw new TypeError("Failed to execute insertion on the host: parameter is not of type Node.");let r=n.nodeType;if(r!==1&&r!==3&&r!==4&&r!==7&&r!==8&&r!==11)throw new DOMException("Failed to execute insertion on the host: the node type may not be inserted here.","HierarchyRequestError")}}function Se(e,t){for(let n of t)if(n===e||n.nodeType===1&&n.contains(e))throw new DOMException("Failed to execute insertion on the host: the new child contains the parent.","HierarchyRequestError")}function Hn(e,t,n){let r=e.authored;for(let i of t){let s=r.indexOf(i);s!==-1&&r.splice(s,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function Lo(e,t){let n=e[v];return n?jt(n,e,t):!1}function jt(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function qn(e,t){if(_.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[le])return!0;let r=e[v];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(N)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&V(e,n))}function Wn(e,t){let n=[];for(let i of t)ce(i)?i.nodeType===11?n.push({frag:i}):n.push({node:i}):n.push({text:`${i}`});for(let i of n)i.frag?Se(e,Array.from(i.frag.childNodes)):i.node&&Nt(e,[i.node]);let r=e.ownerDocument.createDocumentFragment();for(let i of n)if(i.text!==void 0)Z.call(r,e.ownerDocument.createTextNode(i.text));else if(i.frag){let s=Array.from(i.frag.childNodes);Nt(e,s);for(let a of s)Z.call(r,a)}else i.node&&(Se(e,[i.node]),Z.call(r,i.node));let o=Array.from(r.childNodes);Se(e,o);for(let i of o)ve.call(r,i);return o}function K(e,t,n){if(t.applying&&t.pendingRecordNodes)for(let r of n||[])t.pendingRecordNodes.add(r);else t.pendingRecordNodes=new Set(n||[]);if(t.adoptedKey&&n)for(let r of n)t.adoptedKey.delete(r);Ee(t),Y(e)}function Po(e){if(!ee)return;let t=e;if(t[go])return;na(),t[go]=!0;let n=z(e);t.appendChild=function(r){if(t[T])return Z.call(this,r);let o=Un(e,r,!1);for(let i of o)_.add(i);return Hn(n,o,null),K(e,n,o),r},t.insertBefore=function(r,o){if(t[T])return Eo.call(this,r,o);if(!ce(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!ce(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(Se(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!qn(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let i=Un(e,r,!1);for(let s of i)_.add(s);return Hn(n,i,o||null),K(e,n,i),r},t.removeChild=function(r){if(t[T])return ve.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return ve.call(this,r);if(!qn(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),K(e,n,[r]),r},t.replaceChild=function(r,o){if(t[T])return zn.call(this,r,o);if(n.authored.indexOf(o)===-1)return zn.call(this,r,o);if(!ce(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(Se(e,r.nodeType===11?Array.from(r.childNodes):[r]),!qn(e,o))throw new DOMException("replaceChild: the node to be replaced is not an assigned child of this host","NotFoundError");if(r===o)return o;let s=Un(e,r,!1);for(let c of s)_.add(c);for(let c of s){if(c===o)continue;let l=n.authored.indexOf(c);l!==-1&&n.authored.splice(l,1)}let a=n.authored.indexOf(o);return n.authored.splice(a,1,...s),K(e,n,[...s,o]),o},t.append=function(...r){if(t[T])return Co.apply(this,r);let o=Wn(e,r);for(let i of o)_.add(i);Hn(n,o,null),K(e,n,o)},t.prepend=function(...r){if(t[T])return No.apply(this,r);let o=Wn(e,r);for(let i of o)_.add(i);for(let i of o){let s=n.authored.indexOf(i);s!==-1&&n.authored.splice(s,1)}n.authored.unshift(...o),K(e,n,o)},t.replaceChildren=function(...r){if(t[T])return xo.apply(this,r);let o=Wn(e,r);for(let s of o)_.add(s);let i=n.authored;n.authored=o.slice(),K(e,n,[...i,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return Ct.get.call(this)},set(r){if(t[T]){Ct.set.call(this,r);return}let o=e.ownerDocument.createElement("div");Ct.set.call(o,r===null?"":`${r}`);let i=Array.from(o.childNodes);for(let a of i)_.add(a);let s=n.authored;n.authored=i,K(e,n,[...s,...i])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return Yn.get.call(this)},set(r){if(t[T]){Yn.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let s of o)_.add(s);let i=n.authored;n.authored=o,K(e,n,[...i,...o])}})}function Y(e){if(!ee)return;let t=e[v];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||oa;t.pendingRecordNodes=void 0,ia(e,t,n),sa(e,t),Ee(t);let r=[],o=new Set;for(let u of e.querySelectorAll(`slot[${N}]`))if(V(e,u)&&!jt(t,e,u)){if(!u.hasAttribute(I)&&!(Ve in u)){o.add($(u.getAttribute("name")));continue}r.push(u)}let i=new Map;for(let u of r){let f=$(u.getAttribute("name")),d=i.get(f);d||(d=[],i.set(f,d)),d.push(u)}let s=[];for(let[u,f]of i){let d=t.assignedByName.get(u)||[];for(let h=0;h<f.length;h++){let p=f[h],y=d.filter(b=>{let m=Jn(t,b);return m?m===p:h===0}),w=y.filter(b=>b===e||b.nodeType===1&&b.contains(e));if(w.length){for(let b of w)_.delete(b);y=y.filter(b=>w.indexOf(b)===-1)}y.length>0?ca(t,p,y)&&s.push(p):la(t,p)&&s.push(p)}}for(let u of s)fa(t,u);let a=new Set(i.keys());for(let u of o)a.add(u);let c=new Set;for(let u of t.authored)a.has(ae(t,u))||c.add(u);let l=e[le];if(l)for(let u of Array.from(l.childNodes))c.has(u)||ve.call(l,u);if(c.size){let u=ra(e);for(let f of c)f.parentNode!==u&&(_.delete(f),kt(e,()=>Z.call(u,f)))}if(t.backstop){let u=t.backstop.takeRecords();u.length&&Tt(e,t,u)}}while(t.reapply)}finally{t.applying=!1}}}function ia(e,t,n){for(let r of e.querySelectorAll(`slot[${N}][${I}="${D}"]`)){if(!V(e,r)||jt(t,e,r))continue;let o=r,i=t.lastSnapshot.get(o);if(!i)continue;let s=Array.from(o.childNodes);if(Gn(s,i))continue;let a=t.authored,c=$(o.getAttribute("name")),l=s.filter(p=>!n.has(p));for(let p of l)a.indexOf(p)===-1&&ae(t,p)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(p,c));for(let p of a){if(l.indexOf(p)!==-1||ae(t,p)!==c)continue;let y=a.indexOf(p),w=0;for(let b=0;b<l.length;b++){let m=a.indexOf(l[b]);m!==-1&&m<y&&(w=b+1)}l.splice(w,0,p)}let u=new Set(l);for(let p of i)u.add(p);let f=-1,d=0;for(let p of a){if(u.has(p)){f===-1&&(f=d);continue}d+=1}let h=a.filter(p=>!u.has(p));(f===-1||f>h.length)&&(f=h.length),h.splice(f,0,...l),t.authored=h}}function sa(e,t){let n=e[le];t.authored=t.authored.filter(r=>{if(_.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(N)&&(t.lastSnapshot.has(o)||e.contains(o)&&V(e,o)))})}function Io(e){if(!ee)return!1;for(let t of e.querySelectorAll(`slot[${N}][${I}]`))if(V(e,t))return!0;return!1}function V(e,t){let n=t[xt];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(Xs):null;if(r){let o=aa(t,r);if(o)return o===e}for(let o=t.parentElement;o&&o!==e;o=o.parentElement)if(o.tagName.includes("-"))return!1;return!0}function aa(e,t){let n=t.toLowerCase();for(let r=e.parentElement;r;r=r.parentElement)if(r.tagName.toLowerCase()===n)return r;return null}function ca(e,t,n){for(let l of n)_.delete(l);let r=t.getAttribute(I)!==D,o=e.lastSnapshot.get(t)||[],i=r||!Gn(o,n);if(!r&&Gn(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),i;let s=t[Ve];if(r&&s)for(;t.firstChild;)s.appendChild(t.firstChild);let a=new Set(n);for(let l of Array.from(t.childNodes))a.has(l)||t.removeChild(l);let c=t.firstChild;for(let l of n){if(l===c){c=c.nextSibling;continue}t.insertBefore(l,c)}return t.setAttribute(I,D),e.lastSnapshot.set(t,n.slice()),i}function la(e,t){let n=t.getAttribute(I)===D;if(t.setAttribute(I,Js),!n)return wo(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return wo(t),!0}function wo(e){let t=e[Ve];!t||t.childNodes.length===0||e.appendChild(t)}function Mo(e,t){if(!Xn(e))return;let n=z(e),r=$(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let i of o)i.parentNode===t&&(_.add(i),t.removeChild(i));n.lastSnapshot.delete(t)}function ua(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function fa(e,t){e.pendingSlotChanges||(e.pendingSlotChanges=new Set),e.pendingSlotChanges.add(t),!e.slotChangeScheduled&&(e.slotChangeScheduled=!0,queueMicrotask(()=>{e.slotChangeScheduled=!1;let n=e.pendingSlotChanges||new Set;e.pendingSlotChanges=new Set;for(let r of n)ua(r)}))}function Gn(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 ee,v,N,I,D,Js,Ve,xt,Xs,Qs,Ke,$n,Et,Dn,bo,T,go,le,_,Z,Eo,ve,zn,Co,No,xo,Ct,Yn,oa,Rt=W(()=>{ee=_o(),v=Symbol("webjs.slot.state"),N="data-webjs-light",I="data-projection",D="actual",Js="fallback",Ve=Symbol("webjs.slot.fallbackFrag"),xt=Symbol("webjs.slot.templateOwner"),Xs="data-wj-slot-owner",Qs=64,Ke=null,$n=null,Et=null,Dn=null,bo=!1;Zs();T=Symbol("webjs.slot.rendering"),go=Symbol("webjs.slot.intercepted"),le=Symbol("webjs.slot.park"),_=new WeakSet,Z=null,Eo=null,ve=null,zn=null,Co=null,No=null,xo=null,Ct=null,Yn=null;oa=new Set});function Qo(e,t,n){qa.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function ar(e){return JSON.stringify(await Zo(e))}function pe(e){return ei(JSON.parse(e))}async function Zo(e){let t=Wa();return await Ka(e,t),de(e,t)}function ei(e){return ne(e,Ga())}function Wa(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function Ka(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!Xa(r))continue;let o=t.refCount.get(r)||0;if(t.refCount.set(r,o+1),!(o>0)){if(typeof Blob<"u"&&r instanceof Blob){let i=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,i);continue}if(typeof FormData<"u"&&r instanceof FormData){let i=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,i);for(let[,s]of i)typeof s!="string"&&n.push(s);continue}if(Array.isArray(r))for(let i=0;i<r.length;i++)n.push(r[i]);else if(r instanceof Map)for(let[i,s]of r)n.push(i),n.push(s);else if(r instanceof Set)for(let i of r)n.push(i);else if(Qa(r))for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&n.push(r[i])}}for(let[r,o]of t.refCount)o>1&&t.idOf.set(r,t.nextId++)}function de(e,t){if(e===null)return null;if(e===void 0)return{[A]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[A]:"NaN"}:e===1/0?{[A]:"Inf"}:e===-1/0?{[A]:"-Inf"}:Object.is(e,-0)?{[A]:"-0"}:e;if(n==="bigint")return{[A]:"BigInt",v:e.toString()};if(n==="symbol"){let i=Symbol.keyFor(e);if(i===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[A]:"Sym",v:i}}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{[A]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[A]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[A]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let i=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[A]:"File",v:Qe(i),n:e.name,t:e.type||"",m:e.lastModified}:o={[A]:"Blob",v:Qe(i),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let i=t.fdEntries.get(e)||[...e.entries()],s=[];for(let[a,c]of i)s.push([a,de(c,t)]);o={[A]:"FD",v:s}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=Va(e);else if(e instanceof Map){let i=[];for(let[s,a]of e)i.push([de(s,t),de(a,t)]);o={[A]:"Map",v:i}}else if(e instanceof Set){let i=[];for(let s of e)i.push(de(s,t));o={[A]:"Set",v:i}}else if(Array.isArray(e))o=e.map(i=>de(i,t));else{o={};for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let s=Za(i)?"_"+i:i;Qo(o,s,de(e[i],t))}}if(r!==void 0){if(Array.isArray(o))return{[A]:"Arr",_id:r,v:o};o._id=r}return o}function Va(e){if(e instanceof ArrayBuffer)return{[A]:"buf",v:Qe(new Uint8Array(e))};if(e instanceof DataView)return{[A]:"dv",v:Qe(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=za[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[A]:n,v:Qe(r)}}function Ga(){return{refs:new Map}}function ne(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let i=[];for(let s=0;s<e.length;s++)i.push(ne(e[s],t));return i}let n=e[A];if(typeof n=="string")return Ja(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i)||i==="_id")continue;let s=ec(i)?i.slice(1):i;Qo(r,s,ne(e[i],t))}return r}function Ja(e,t,n){let r=e._id,o=i=>(typeof r=="number"&&n.refs.set(r,i),i);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 o(BigInt(e.v));case"Sym":return o(Symbol.for(e.v));case"Date":return o(e.v==null?new Date(NaN):new Date(e.v));case"Error":{let i=new Error(e.v.message);return i.name=e.v.name,e.v.stack&&(i.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,i),i}case"Map":{let i=new Map;typeof r=="number"&&n.refs.set(r,i);for(let[s,a]of e.v)i.set(ne(s,n),ne(a,n));return i}case"Set":{let i=new Set;typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.add(ne(s,n));return i}case"Arr":{let i=[];typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.push(ne(s,n));return i}case"Ref":{let i=n.refs.get(e.v);if(i===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return i}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let i=Xe(e.v);return o(new Blob([i],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let i=Xe(e.v);return o(new File([i],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 i=new FormData;o(i);for(let[s,a]of e.v){let c=ne(a,n);i.append(s,c)}return i}default:{if(t==="buf"){let s=Xe(e.v);return o(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength))}if(t==="dv"){let s=Xe(e.v);return o(new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)))}let i=Ya[t];if(i){let s=Xe(e.v),a=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);return o(new i(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function Xa(e){return e!==null&&typeof e=="object"}function Qa(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Za(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function ec(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function Qe(e){if(ti)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 Xe(e){if(ti){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 A,qa,za,Ya,ti,Ze=W(()=>{A="_$wj",qa=new Set(["__proto__","constructor","prototype"]);za={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},Ya={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};ti=typeof Buffer<"u"&&typeof Buffer.from=="function"});var mi={};Kr(mi,{observeLazy:()=>Sc,observeViewportOnce:()=>Cc});function hi(e){let t=ur.get(e);return t||(t=import(e).finally(()=>ur.delete(e)),ur.set(e,t),t)}function Sc(e){for(let[t,n]of Object.entries(e))he.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of he.values())hi(t);he.clear();return}tt||(tt=new IntersectionObserver(vc,{rootMargin:"200px"})),pi(),typeof MutationObserver<"u"&&new MutationObserver(()=>pi()).observe(document.body,{childList:!0,subtree:!0})}function pi(){if(!(!tt||!he.size))for(let e of he.keys())for(let t of document.querySelectorAll(e))tt.observe(t)}function vc(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=he.get(n);r&&(hi(r),he.delete(n),tt?.unobserve(t.target))}}function Ec(e){for(let t of e){if(!t.isIntersecting)continue;let n=qt.get(t.target);qt.delete(t.target),et?.unobserve(t.target),n&&n()}}function Cc(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(et||(et=new IntersectionObserver(Ec,{rootMargin:"200px"})),qt.set(e,t),et.observe(e),()=>{qt.delete(e),et?.unobserve(e)})}var he,tt,ur,et,qt,bi=W(()=>{he=new Map,tt=null,ur=new Map;et=null,qt=new WeakMap});var fr,dr=W(()=>{fr=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(()=>(bi(),mi)).then(({observeViewportOnce:o})=>{this._webjsLoadedSrc!==n||!this.isConnected||(this._webjsLazyTeardown=o(this,()=>{this._webjsLazyTeardown=null,this._webjsLoad(n)}))})):(this._webjsLoadedSrc=n,this._webjsLoad(n))}_webjsLoad(t){Promise.resolve().then(()=>(Wt(),yi)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&fr&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",fr)});function xc(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 hr(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let i=n.createElement("template");i.innerHTML=e,r=i.content}else if(e&&e.nodeType)r=e;else return;let o=r.querySelectorAll?Array.from(r.querySelectorAll("webjs-stream")):[];if(o.length)for(let i of o)n.body.append(i);else n.body.append(r)}var Nc,pr,Kt=W(()=>{Nc=new Set(["append","prepend","before","after","replace","update"]);pr=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=[],o=this.getAttribute("target");if(o){let s=n.getElementById(o);s&&(r=[s])}else{let s=this.getAttribute("targets");if(s)try{r=Array.from(n.querySelectorAll(s))}catch{r=[]}}let i=Nc.has(t)?this.querySelector("template"):null;try{for(let s of r){let a=i?i.content.cloneNode(!0):null;xc(t,s,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&pr&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",pr)});var gi,wi=W(()=>{gi=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&gi&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",gi)});function Vt(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]'))Ai(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))Ai(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function Ai(e,t,n){if(e)try{let r=pe(e);if(r&&typeof r=="object")for(let o in r)nt.has(o)||nt.set(o,r[o])}catch{}n?n():t.remove?.()}function kc(e,t,n){_i||(_i=!0,Vt());let r=`${e}/${t}/${n}`;if(nt.has(r)){let o=nt.get(r);return nt.delete(r),o}return Si}var nt,Si,_i,mr=W(()=>{Ze();nt=new Map,Si=Symbol("webjs.seed.miss"),_i=!1});function br(e){if(!(!Array.isArray(e)||!e.length)){zt+=1;for(let t of e)t&&vi.set(t,zt)}}function jc(){return zt}function Rc(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(Te.delete(e),Te.set(e,{tags:t.slice(),since:typeof n=="number"?n:zt}),Te.size>Tc)){let r=Te.keys().next().value;r!==void 0&&Te.delete(r)}}function Oc(e){let t=Te.get(e);if(!t)return!1;for(let n of t.tags)if((vi.get(n)||0)>t.since)return!0;return!1}function yr(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var zt,vi,Te,Tc,gr=W(()=>{zt=0,vi=new Map,Te=new Map,Tc=1e3});var yi={};Kr(yi,{_FALLBACK_MARKER_KEY:()=>Qt,_FRAME_TOP:()=>$i,_LIVE_ATTRS:()=>Cr,_activateSwappedRange:()=>Br,_activeFrameId:()=>Fi,_addNewHeadElements:()=>xr,_applyOptimisticLoading:()=>Fr,_applyStreamedResolve:()=>as,_applySwap:()=>Mr,_blurOutgoingFocus:()=>Xt,_buildHaveHeader:()=>ct,_buildSubmitFormData:()=>Ii,_bumpNavToken:()=>hl,_clearFormBusy:()=>es,_clearFrameBusy:()=>Qi,_collectBoundaries:()=>Fe,_currentPageUrl:()=>ml,_diffElementInPlace:()=>sn,_eligibleAnchorHref:()=>en,_findAnchorInPath:()=>Mi,_getSubmitAction:()=>Pi,_getSubmitMethod:()=>Li,_isNonHtmlPath:()=>wl,_isPreBootNavigation:()=>Bi,_keyOf:()=>Me,_markFormBusy:()=>Zi,_markFrameBusy:()=>Xi,_mergeHead:()=>os,_navToken:()=>pl,_onPopState:()=>jr,_onSubmit:()=>Rr,_parseHTML:()=>kr,_planBoundarySwap:()=>Ui,_prefetch:()=>$e,_prefetchAnchor:()=>zi,_prefetchCache:()=>S,_prefetchHasHoverPointer:()=>Ki,_prefetchInflightSize:()=>ul,_prefetchMode:()=>tn,_prefetchPeek:()=>ll,_prefetchSaysSaveData:()=>Pr,_prefetchSuppressed:()=>Vi,_prefetchTake:()=>Yi,_reactivateScripts:()=>un,_readStreamedShell:()=>is,_reconcileChildren:()=>mn,_regraftPermanentElements:()=>ns,_regraftPermanentInSlice:()=>hn,_resetParseProbe:()=>Pc,_resetPrefetch:()=>fl,_resetWarnOnce:()=>yl,_resolveTargetFrameId:()=>Or,_restoreOptimistic:()=>rt,_runWithTransition:()=>Gt,_setCurrentPageUrl:()=>bl,_setHardNavigate:()=>dl,_shouldFullLoadDuringParse:()=>gl,_snapshotCache:()=>j,_streamBoundariesProgressively:()=>cs,_takeResolveUnit:()=>ss,_viewTransitionsEnabled:()=>ts,collectBoundaries:()=>Fe,disableClientRouter:()=>Ti,enableClientRouter:()=>Tr,loadFrame:()=>Fc,navigate:()=>ji,planBoundarySwap:()=>Ui,revalidate:()=>Ri});function kr(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"&&Lc()?Document.parseHTMLUnsafe(e):Ic(e)}function Lc(){if(je!==null)return je;try{je=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{je=!1}return je}function Pc(){je=null}function Ic(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}function Mc(){wr||typeof MutationObserver>"u"||typeof customElements>"u"||(wr=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 o of r.querySelectorAll("*"))o.tagName?.includes("-")&&customElements.upgrade(o)}}),wr.observe(document.body,{childList:!0,subtree:!0}))}function Tr(){se||typeof document>"u"||(se=!0,document.addEventListener("click",Oi,!1),document.addEventListener("submit",Rr,!1),window.addEventListener("popstate",jr),document.addEventListener("pointerover",Ie,!0),document.addEventListener("focusin",Ie,!0),document.addEventListener("touchstart",Ie,{capture:!0,passive:!0}),document.addEventListener("pointerout",Gi,!0),document.addEventListener("webjs:navigate",Er),Mc(),Er(),typeof history<"u"&&"scrollRestoration"in history&&(Yt=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(q=location.href),$c())}function Ti(){se&&(se=!1,document.removeEventListener("click",Oi,!1),document.removeEventListener("submit",Rr,!1),window.removeEventListener("popstate",jr),document.removeEventListener("pointerover",Ie,!0),document.removeEventListener("focusin",Ie,!0),document.removeEventListener("touchstart",Ie,{capture:!0}),document.removeEventListener("pointerout",Gi,!0),document.removeEventListener("webjs:navigate",Er),pn(),Ir(),oe&&(oe.disconnect(),oe=null),typeof history<"u"&&Yt!==null&&(history.scrollRestoration=Yt,Yt=null),q=null)}async function ji(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){be(e);return}await Lr(n.href,t?.replace??!1,null)}async function Fc(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1};M&&M.abort(),M=new AbortController;let o=M.signal,i=++x;return nn(r.href,n,!1,null,"GET",null,o,i)}function Ri(e){if(!e){j.clear(),S.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;j.delete(n),S.delete(n)}function Oi(e){if(!se||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Mi(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||fn.test(r.pathname))return;e.preventDefault();let o=Or(t);Lr(n,!1,o)}function jr(e){Lr(location.href,!0,null)}function Rr(e){if(!se||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 o=Li(t,n);if(o==="dialog")return;let i=Pi(t,n),s;try{s=new URL(i,location.href)}catch{return}if(s.origin!==location.origin||fn.test(s.pathname))return;let a=Ii(t,n);e.preventDefault();let c=Or(n||t);Hc(s.href,o,a,c,t)}function Li(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function Pi(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function Ii(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 Mi(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Fi(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 Or(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===$i)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(dn(`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 Fi(e)}function dn(e,t){Ar.has(e)||(Ar.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function Di(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function Bi(e,t,n,r){if(e!=="navigate"||!t||r&&r===n)return!1;try{return new URL(t).origin===new URL(n).origin}catch{return!1}}function $c(){if(typeof location>"u"||Ci)return;Ci=!0;let e=null;try{e=sessionStorage.getItem(Qt),sessionStorage.removeItem(Qt)}catch{}let t="";try{let n=performance.getEntriesByType("navigation")[0];t=n?n.type:""}catch{}Bi(t,document.referrer,location.href,e)&&re("pre-boot-navigation",location.href,!1)}function re(e,t,n=!0){if(n)try{sessionStorage.setItem(Qt,t)}catch{}if(typeof document<"u"&&typeof CustomEvent<"u")try{document.dispatchEvent(new CustomEvent("webjs:navigation-fallback",{detail:{cause:e,href:t,willReload:n}}))}catch{}typeof process<"u"&&process.env||dn(`fallback:${e}`,n?`[webjs] client router fell back to a full page load (${e}) navigating to ${t}. This is correct (no DOM corruption), just not a soft nav.`:`[webjs] client router degraded a soft navigation (${e}) for ${t}, without a full page load.`)}function Dc(e){typeof process<"u"&&process.env||dn(`stream-drop:${e}`,`[webjs] dropped a streamed Suspense resolve for "${e}": no #${e} boundary in the DOM. Benign if this navigation was superseded or degraded. A stuck skeleton here means the shell swap did not place the boundary.`)}function Ni(){if(typeof process<"u"&&process.env||Sr||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;Sr=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&dn("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 Zt(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 Fe(e){let t=new Map,n=[],r=!1;function o(i){if(!r){if(i.nodeType===8){let s=i.data.trim();if(s.startsWith("wj:children:")){let a=s.slice(12),c=a.lastIndexOf(":");if(c<=0||c===a.length-1){r=!0;return}let l=a.slice(0,c),u=a.slice(c+1);if(t.has(l)||n.some(f=>f.segment===l)){r=!0;return}n.push({segment:l,routeKey:u,start:i});return}if(s.startsWith("/wj:children")){let a=s.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==i.parentNode){r=!0;return}{let l=c.start.parentNode.tagName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TFOOT"||l==="TR"){r=!0;return}}t.set(c.segment,{routeKey:c.routeKey,start:c.start,end:i});return}return}if(i.hasChildNodes&&i.hasChildNodes())for(let s=i.firstChild;s&&!r;s=s.nextSibling)o(s)}}return o(e),r||n.length>0?null:t}function Ui(e,t){let n=[...e.keys()].filter(s=>t.has(s)).sort((s,a)=>s.length-a.length);if(n.length===0)return null;for(let s of n)if(e.get(s).routeKey!==t.get(s).routeKey){let a=null;for(let c of n){if(c===s)break;s.startsWith(c==="/"?c:c+"/")&&(a=c)}return a?{mode:"replace",segment:a,live:e.get(a),incoming:t.get(a)}:null}let r=n[n.length-1],o=s=>{let a=null;for(let c of s.keys())(a===null||c.length>a.length)&&(a=c);return a};return{mode:o(e)===r&&o(t)===r?"morph":"replace",segment:r,live:e.get(r),incoming:t.get(r)}}function Hi(e){let t=ie(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),j.has(t)&&j.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(j.set(t,n);j.size>Bc;){let r=j.keys().next().value;j.delete(r)}}function Uc(e){let t=ie(e),n=j.get(t);return n==null?null:(j.delete(t),j.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function ie(e){let t=new URL(e,location.href);return t.pathname+t.search}async function Lr(e,t,n){if(Di(t,n)&&typeof location<"u"){re("readyState-loading",e),be(e);return}M&&M.abort(),M=new AbortController;let r=M.signal,o=++x;q&&Hi(q);let i=setTimeout(()=>{Zt(!0),i=null},150),s=null;t||(s=Fr());try{if(t){let a=Uc(e);if(a){let c=kr(a.html);if(c){Mr(c,n,!0,null),typeof window<"u"&&window.scrollTo({left:a.scrollX,top:a.scrollY,behavior:"instant"}),nn(e,n,!1,s,"GET",null,r,o,!0).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await nn(e,n,!t,s,"GET",null,r,o)}finally{i&&clearTimeout(i),o===x&&(Zt(!1),typeof location<"u"&&(q=location.href))}}async function Hc(e,t,n,r,o){M&&M.abort(),M=new AbortController;let i=M.signal,s=++x,a=t==="get"||t==="head",c=new URL(e,location.href);if(a){c.search="";for(let[h,p]of n)c.searchParams.append(h,typeof p=="string"?p:p.name)}q&&Hi(q);let l=setTimeout(()=>{Zt(!0),l=null},150),u=Fr(),f=o?Zi(o,s,c.href):null,d=!1;try{let h=await nn(c.href,r,!0,u,a?"GET":t.toUpperCase(),a?null:n,i,s);d=!!(h&&h.ok),!a&&s===x&&(j.clear(),S.clear())}finally{f&&es(f,s,c.href,d),l&&clearTimeout(l),s===x&&(Zt(!1),typeof location<"u"&&(q=location.href))}}function ct(){let e=Fe(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}function Pr(){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 Ki(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function zc(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function en(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||fn.test(n.pathname)?null:t}function Vi(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=zc(e);return t.includes("external")||t.includes("no-prefetch")}function tn(e){if(Vi(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 Ki()?"intent":"viewport"}}function $e(e){if(!se||typeof fetch!="function"||Pr())return;let t=ie(e);if(typeof location<"u"&&t===ie(location.href)||me.has(t)||ot.has(t))return;let n=S.get(t);if(n&&vr()-n.at<qi)return;if(me.size>=Wi){for(ot.add(t),Le.push(e);Le.length>Wc;){let i=Le.shift();ot.delete(ie(i))}return}let r=ct();if(!r&&typeof document<"u"&&document.readyState==="loading")return;me.add(t);let o={"x-webjs-router":"1","x-webjs-prefetch":"1"};r&&(o["x-webjs-have"]=r),fetch(e,{method:"GET",headers:o,credentials:"same-origin",cache:"no-cache"}).then(async i=>{let s=i.headers.get("content-type")||"";if(!/^text\/html\b/i.test(s)||i.status>=400)return;let a=i.headers.get("x-webjs-build"),c=i.headers.get("x-webjs-src"),l=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,u=l?l.getAttribute("data-webjs-build"):null,f=l?l.getAttribute("data-webjs-src"):null;(a&&u&&a!==u||c&&f&&c!==f)&&(j.clear(),S.clear());let d=i.redirected&&i.url?i.url:e,h=await i.text();Gc(t,{html:h,build:a,src:c,finalUrl:d,at:vr()})}).catch(()=>{}).finally(()=>{me.delete(t),Yc()})}function Yc(){for(;Le.length&&me.size<Wi;){let e=Le.shift();ot.delete(ie(e)),$e(e)}}function Gc(e,t){for(S.has(e)&&S.delete(e),S.set(e,t);S.size>qc;){let n=S.keys().next().value;S.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function zi(e){let t=/<!--wj:children:([^>]*?)-->/.exec(e||"");return t?t[1]:null}function Yi(e,t){let n=ie(e),r=S.get(n);if(!r)return null;if(vr()-r.at>=qi)return S.delete(n),null;let o=zi(r.html);return o&&!new Set(String(t??(ct()||"")).split(",").filter(Boolean)).has(o)?(S.delete(n),null):(S.delete(n),r)}function vr(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function Ie(e){if(!se)return;let t=Ji(e.target);if(!t)return;let n=tn(t);if(n==="none"||n==="render")return;let r=en(t);if(r){if(e.type==="touchstart"){$e(r);return}n==="intent"&&(it===t&&Pe||(pn(),it=t,Pe=setTimeout(()=>{Pe=null,it=null,$e(r)},Kc)))}}function Gi(e){let t=Ji(e.target);t&&t===it&&pn()}function pn(){Pe&&(clearTimeout(Pe),Pe=null),it=null}function Ir(){for(let e of st)clearTimeout(e);st.clear(),Re=new WeakMap}function Ji(e){let t=e;for(;t;){if(t instanceof HTMLAnchorElement)return t;let n=t.nodeType===1?t:null;if(n){let o=n.closest&&n.closest("a");if(o instanceof HTMLAnchorElement)return o}let r=t.getRootNode?t.getRootNode():null;t=r&&r.host?r.host:null}return null}function Er(){if(typeof document>"u"||Pr())return;let e=typeof IntersectionObserver<"u";e&&(oe?(oe.disconnect(),Ir()):oe=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(Re.has(r))continue;let o=setTimeout(()=>{st.delete(o),Re.delete(r),oe.unobserve(r);let i=en(r);i&&tn(r)==="viewport"&&$e(i)},Vc);Re.set(r,o),st.add(o)}else{let o=Re.get(r);o&&(clearTimeout(o),st.delete(o),Re.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=tn(t);if(n==="render"){let r=en(t);r&&$e(r)}else n==="viewport"&&e&&oe.observe(t)}}function Jc(e){if(typeof document>"u"||!document.body)return!1;let t=Fe(document.body);if(!t)return!1;let n,r=-1;for(let[c,l]of t)c.length>r&&(r=c.length,n=l);if(!n)return!1;let o=n.start.parentNode;if(!o||n.start.parentNode!==n.end.parentNode)return!1;let i=document.createElement("div");i.setAttribute("role","alert"),i.setAttribute("data-webjs-nav-error","");let s=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";i.textContent=s;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),o.insertBefore(i,n.end),!0}function _r(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||Jc(t)||typeof location<"u"&&(re("navigation-error-unrecoverable",e),be(e))}async function nn(e,t,n,r,o,i,s,a,c){o=o||"GET";let l=typeof a=="number"?a:x,u,f=null,d=null,h=null,p=null,y=!1,w=e,b=t?Xi(t,l):null;try{try{let g=o==="GET"&&!i&&!t?Yi(e,r?r.haveKeys:void 0):null;if(g)u=g.html,d=g.build,h=g.src,w=g.finalUrl,p=200,y=!0;else{let O={"x-webjs-router":"1"},ge=ct();ge&&(O["x-webjs-have"]=ge),t&&(O["x-webjs-frame"]=t),i!=null&&o!=="GET"&&o!=="HEAD"&&(O.accept=Ei+", text/html");let we={method:o,headers:O,credentials:"same-origin",cache:"no-cache"};s&&(we.signal=s),i!=null&&o!=="GET"&&o!=="HEAD"&&(we.body=i);let E=await fetch(e,we);p=E.status,y=E.ok;let De=yr(E.headers.get("x-webjs-invalidate"));De.length&&br(De);let k=E.headers.get("content-type")||"",us=/^text\/html\b/i.test(k);if(k.toLowerCase().indexOf(Ei)===0){let fs=await E.text();return l===x&&(rt(r),hr(fs)),{ok:y,status:p,aborted:!1}}if(E.redirected&&E.url&&(w=E.url),E.status===204||E.status===205)return l===x&&n&&history.pushState(null,"",w),{ok:y,status:p,aborted:!1};if(!us)return l===x&&(rt(r),_r(e,E.status,null)),{ok:!1,status:p,aborted:!1};d=E.headers.get("x-webjs-build"),h=E.headers.get("x-webjs-src");let yn=await is(E);u=yn.shell,yn.streaming&&(f=yn)}}catch(g){return g&&g.name==="AbortError"?{ok:!1,status:null,aborted:!0}:l!==x?{ok:!1,status:null,aborted:!0}:(rt(r),_r(e,null,g instanceof Error?g:new Error(String(g))),{ok:!1,status:null,aborted:!1})}if(l!==x){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:!1,status:p,aborted:!0}}let m=kr(u);if(!m)return rt(r),_r(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:p,aborted:!1};if(Mr(m,t,!!c,w,d,h)==="discard"){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:y,status:p,aborted:!1}}if(n&&history.pushState(null,"",w),n){let g=new URL(w);if(g.hash){let O=document.getElementById(g.hash.slice(1));O?O.scrollIntoView():(Ni(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else Ni(),window.scrollTo({left:0,top:0,behavior:"instant"})}return f&&(f.reader||f.rest)&&Jt.then(()=>cs(f.reader,f.dec,f.rest,()=>l===x)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:w,frameId:t,from:"navigate"}})),{ok:y,status:p,aborted:!1}}finally{b&&Qi(b,l)}}function Xi(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=rn.has(n);return rn.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 Qi(e,t){if(rn.get(e)!==t)return;rn.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 Zi(e,t,n){let r=on.has(e);return on.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 es(e,t,n,r){if(on.get(e)!==t)return;on.delete(e),e.setAttribute("aria-busy","false");let o=new CustomEvent("webjs:submit-end",{bubbles:!0,detail:{form:e,url:n,ok:!!r}});e.isConnected?e.dispatchEvent(o):typeof document<"u"?document.dispatchEvent(o):e.dispatchEvent(o)}function xi(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+=G(r);return n}function ts(){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 Gt(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(ts()&&typeof n=="function"){let r=n.call(document,e);return r&&r.finished&&typeof r.finished.then=="function"?r.finished.then(()=>{t&&t()}).catch(()=>{}):t&&t(),r&&r.updateCallbackDone&&typeof r.updateCallbackDone.then=="function"?r.updateCallbackDone.catch(()=>{}):Promise.resolve()}return e(),t&&t(),Promise.resolve()}function ns(e,t){if(!e||!t||typeof e.querySelectorAll!="function")return;let n=e.querySelectorAll("[data-webjs-permanent][id]");for(let r of n){let o=r.id;if(!o)continue;let i=null;try{i=t.querySelector(`#${CSS.escape(o)}`)}catch{i=null}if(!i||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let s=i.parentNode;s&&i!==r&&(s.replaceChild(r,i),at.add(r))}}function hn(e,t){let n=[];for(let r of e){if(r.nodeType!==1)continue;let o=r;if(o.hasAttribute&&o.hasAttribute("data-webjs-permanent")&&o.id&&n.push(o),typeof o.querySelectorAll=="function")for(let i of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(i)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let i=Xc(t,o);if(!i||i===r)continue;let s=i.parentNode;if(s)s.replaceChild(r,i),at.add(r);else{let a=t.indexOf(i);a!==-1&&(t[a]=r,at.add(r))}}}function Xc(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 o=null;try{o=r.querySelector(`#${CSS.escape(t)}`)}catch{o=null}if(o)return o}}return null}function Qc(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&Oe(t)}function Mr(e,t,n,r,o,i){try{Vt(e)}catch{}try{for(let f of e.querySelectorAll("[data-wj-host]"))f.setAttribute("data-wj-serialized","")}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let f=document.querySelector('script[type="importmap"]'),d=f?f.getAttribute("data-webjs-build"):null,h=!1;if(o&&d&&(h=o!==d),!h&&e.head&&e.head.children.length>0){let p=xi(document),y=xi(e);p!==y&&(h=!0)}if(h&&typeof location<"u"){j.clear(),S.clear();try{let p="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(p))sessionStorage.removeItem(p),re("deploy-mismatch-reload-suppressed",r,!1);else{sessionStorage&&sessionStorage.setItem(p,"1"),re("deploy-mismatch",r),be(r);return}}catch{re("deploy-mismatch",r),be(r);return}}else if(!h){let p=f?f.getAttribute("data-webjs-src"):null;i&&p&&i!==p&&(j.clear(),S.clear(),f&&f.setAttribute("data-webjs-src",i));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){let f=document.querySelector(`webjs-frame#${CSS.escape(t)}`),d=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(f&&d){xr(e.head),Jt=Gt(()=>{sl(f,d),un(f),Oe(f),ki(e.body),Xt()},()=>Oe(f));return}let h=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});(f||document).dispatchEvent(h),h.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`);return}let s=Fe(document.body),a=Fe(e.body),c=s&&a?Ui(s,a):null;if(c){let{mode:f,live:d,incoming:h}=c;xr(e.head),Jt=Gt(()=>{f==="replace"?Zc(d,h):el(d,h,e),ol(d.start,h.start),ki(e.body),Xt()},()=>Qc(d));return}if(r&&!n&&typeof location<"u"){re(s?a?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),be(r);return}if(r&&n)return re("revalidation-discarded",r,!1),"discard";os(e.head),ns(document.body,e.body);let l=[...e.body.childNodes];Jt=Gt(()=>{document.body.replaceChildren(...l),un(document.body),Oe(document.body),Xt()},()=>Oe(document.body))}function Xt(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function Zc(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)r.push(i);let o=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)o.push(document.importNode(i,!0));hn(r,o);for(let i of r)i.parentNode===n&&n.removeChild(i);for(let i of o)n.insertBefore(i,e.end);Br(e)}function el(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)o.push(s);let i=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)i.push(document.importNode(s,!0));hn(o,i),tl(r,e.start,e.end,o,i),Br(e)}function tl(e,t,n,r,o){let i=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=Me(c);l&&i.set(l,c)}let s=n,a=[];for(let c of o){if(c.nodeType===1){let l=Me(c);if(l&&i.has(l)){let u=i.get(l);sn(u,c),a.push(u),i.delete(l);continue}}a.push(c)}for(let c of r)if(c.parentNode===e){if(c.nodeType===1&&a.includes(c))continue;e.removeChild(c)}for(let c of a)e.insertBefore(c,s)}function sn(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),!Cr.has(r.name)&&r.name!=="data-wj-serialized"&&e.getAttribute(r.name)!==r.value&&e.setAttribute(r.name,r.value);for(let r of[...e.attributes])Cr.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(nl(e)){il(e,t);return}mn(e,t)}function nl(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[v]!=null}function rl(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function an(e){let t=new Map,n=`slot[${N}][${I}="${D}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!rl(o,e)||Lo(e,o))continue;let i=!1;for(let a=o.parentElement;a&&a!==e;a=a.parentElement)if(a.tagName==="SLOT"&&a.hasAttribute(N)&&a.getAttribute(I)===D){i=!0;break}if(i)continue;let s=$(o.getAttribute("name"));t.has(s)||t.set(s,o)}return t}function ol(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(N))return;let o=null;for(let f=r.parentElement;f;f=f.parentElement){if(f[v]){o=f;break}if(f.tagName.includes("-"))return}if(!o)return;let i=$(r.getAttribute("name"));ue(o,i,[...r.childNodes]);let s=t.parentNode;if(!s||s.nodeType!==1)return;let a=s;if(a.tagName!=="SLOT")return;let c=null;for(let f=a.parentElement;f;f=f.parentElement)if(f.tagName.includes("-")){c=f;break}if(!c||c.tagName!==o.tagName)return;let l=an(o),u=an(c);for(let f of new Set([...l.keys(),...u.keys()])){if(f===i)continue;let d=u.get(f);d?ue(o,f,[...d.childNodes].map(h=>document.importNode(h,!0))):l.get(f)&&ue(o,f,null)}}function il(e,t){if(!e[v])return;let n=an(e),r=an(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let i of o){let s=n.get(i),a=r.get(i);s&&a?(mn(s,a),ue(e,i,[...s.childNodes])):a?ue(e,i,[...a.childNodes].map(c=>document.importNode(c,!0))):ue(e,i,null)}}function mn(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));hn(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=Me(a);c&&o.set(c,a)}let i=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=Me(c);if(l&&o.has(l)){let f=o.get(l);sn(f,c),i.push(f),o.delete(l);continue}let u=n[a];if(u&&u.nodeType===1&&!Me(u)&&u.tagName===c.tagName){sn(u,c),i.push(u);continue}}else if(c.nodeType===3){let l=n[a];if(l&&l.nodeType===3){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),i.push(l);continue}}else if(c.nodeType===8){let l=n[a];if(l&&l.nodeType===8){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),i.push(l);continue}}i.push(c)}let s=new Set(i);for(let a of n)!s.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<i.length;a++){let c=i[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||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 Fr(){let e=Fe(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((c,l)=>l.length-c.length),n=null,r=null;for(let c of t){let l=document.getElementById(`wj-loading:${c}`);if(l instanceof HTMLTemplateElement){n=c,r=l;break}}if(n===null||r===null)return null;let o=e.get(n),i=ct(),s=[];for(let c=o.start.nextSibling;c&&c!==o.end;c=c.nextSibling)s.push(c);let a=document.createRange();return a.setStartAfter(o.start),a.setEndBefore(o.end),a.deleteContents(),o.start.parentNode.insertBefore(r.content.cloneNode(!0),o.end),{slot:o,oldChildren:s,token:x,haveKeys:i}}function rt(e){if(!e||e.token!==x)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 o of n)t.start.parentNode.insertBefore(o,t.end)}function sl(e,t){mn(e,t)}function rs(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function cn(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=rs();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function $r(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=rs();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function G(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function ln(e){let t=e.getAttribute("name");if(t)return"name="+t;let n=e.getAttribute("property");if(n)return"property="+n;let r=e.getAttribute("http-equiv");return r?"http-equiv="+r:e.hasAttribute("charset")?"charset":null}function al(e){if(!e.querySelector("meta"))return;let t=o=>{let i=new Map;for(let s of o.querySelectorAll("meta")){let a=ln(s);if(!a||a===Nr)continue;let c=i.get(a);c?c.push(s):i.set(a,[s])}return i},n=t(e),r=t(document.head);for(let[o,i]of n){let s=r.get(o)||[],a=i.map(G).join(`
2
- `),c=s.map(G).join(`
3
- `);if(a!==c){if(i.length===1&&s.length===1){let l=s[0];for(let u of[...l.attributes])l.removeAttribute(u.name);for(let u of i[0].attributes)l.setAttribute(u.name,u.value);continue}for(let l of s)l.remove();for(let l of i)document.head.appendChild($r(l))}}for(let[o,i]of r)if(!n.has(o))for(let s of i)s.remove()}function xr(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(G(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(r.tagName==="META"&&ln(r)||n.has(G(r))||(r.tagName==="SCRIPT"?document.head.appendChild(cn(r)):document.head.appendChild($r(r))));al(e)}function cl(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function os(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let i of t.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&r.add(G(i));let o=new Set;for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&o.add(G(i));for(let i of[...t.children])i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(cl(i)||i.tagName==="META"&&ln(i)===Nr||o.has(G(i))||i.remove());for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(i.tagName==="META"&&ln(i)===Nr||r.has(G(i))||(i.tagName==="SCRIPT"?t.appendChild(cn(i)):t.appendChild($r(i))))}function Oe(e){typeof customElements>"u"||Dr(e)}function Dr(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&&Dr(n.shadowRoot))}function ki(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]")){let n=t.cloneNode(!0);document.body.appendChild(n);let r=n.getAttribute("data-webjs-resolve"),o=window.__webjsResolve;r&&typeof o=="function"&&o(r)}}async function is(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="",o="<template data-webjs-resolve",i="<!--wj-stream-shell-->",s=/<\/html\s*>/i;for(;;){let{value:a,done:c}=await t.read();a&&(r+=n.decode(a,{stream:!0})),c&&(r+=n.decode());let l=r.indexOf(i);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+i.length)};let u=r.indexOf(o);if(u!==-1)return{shell:r.slice(0,u),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(u)};if(c)return{shell:r,streaming:!1};let f=s.exec(r);if(f){let d=f.index+f[0].length;return{shell:r.slice(0,d),streaming:!0,reader:t,dec:n,rest:r.slice(d)}}}}function ss(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,o=/<(\/?)template\b[^>]*>/gi;o.lastIndex=r;let i=1,s;for(;s=o.exec(e);)if(s[1]==="/"){if(i--,i===0)return{id:n,content:e.slice(r,s.index),rest:e.slice(s.index+s[0].length)}}else i++;return null}function as(e,t){let n=document.getElementById(e);if(!n){Dc(e);return}let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];n.replaceWith(r.content);for(let i of o)i.nodeType===1&&Dr(i)}async function cs(e,t,n,r){let o=n,i=()=>{let s;for(;s=ss(o);){if(!r())return!1;as(s.id,s.content),o=s.rest}return!0};if(!e){i();return}try{for(;;){if(!i()){try{await e.cancel()}catch{}return}let{value:s,done:a}=await e.read();if(s&&(o+=t.decode(s,{stream:!0})),a){o+=t.decode(),i();return}}}catch{}}function un(e){if(e.tagName==="SCRIPT"){let n=cn(e);return e.replaceWith(n),n}let t=[];at.has(e)&&t.push(e);for(let n of e.querySelectorAll("[data-webjs-permanent]"))at.has(n)&&t.push(n);for(let n of e.querySelectorAll("script"))t.length&&t.some(r=>r!==n&&r.contains(n))||n.replaceWith(cn(n));return e}function Br(e){let t=[];for(let n=e.start.nextSibling;n&&n!==e.end;n=n.nextSibling)n.nodeType===1&&t.push(n);for(let n of t){let r=un(n);r.isConnected!==!1&&Oe(r)}}function ll(e){return S.get(ie(e))||null}function ul(){return me.size}function fl(){S.clear(),me.clear(),Le.length=0,ot.clear(),pn(),Ir()}function dl(e){be=e||(t=>{location.href=t})}function pl(){return x}function hl(){return++x}function ml(){return q}function bl(e){q=e}function yl(){Ar.clear(),Sr=!1}function gl(e,t){return Di(e,t)}function wl(e){return fn.test(e)}var Ei,je,se,M,x,wr,q,Yt,fn,be,$i,Ar,Qt,Ci,Sr,Bc,j,qc,qi,Wi,Wc,Kc,Vc,S,me,Le,ot,Pe,it,oe,Re,st,rn,on,at,Jt,Cr,Nr,Wt=W(()=>{dr();Kt();Kt();wi();mr();gr();Rt();Ei="text/vnd.webjs-stream.html";je=null;se=!1,M=null,x=0,wr=null;q=null,Yt=null;fn=/\.(?: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,be=e=>{location.href=e};$i="_top";Ar=new Set;Qt="webjs:nav-fallback",Ci=!1;Sr=!1;Bc=16,j=new Map;qc=8,qi=3e4,Wi=3,Wc=24,Kc=100,Vc=250,S=new Map,me=new Set,Le=[],ot=new Set,Pe=null,it=null,oe=null,Re=new WeakMap,st=new Set;rn=new WeakMap;on=new WeakMap;at=new WeakSet;Jt=Promise.resolve();Cr=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);Nr="name=csp-nonce";(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&Tr()});function ps(e,...t){return{_$webjs:"template",strings:e,values:t}}function L(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var C="wjm-";function hs(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 gn(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function wn(e,t){if(!(!t||!t.length))if("adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"){let n=t.map(r=>{let o=new CSSStyleSheet;return o.replaceSync(r.text),o});e.adoptedStyleSheets=n}else{let n=e,r=document.createElement("style");r.textContent=t.map(o=>o.text).join(`
4
- `),n.appendChild(r)}}function ms(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
5
- `)}</style>`}var _n=Object.freeze({"@":"event",".":"prop","?":"bool"});function Be(e){return Object.prototype.hasOwnProperty.call(_n,e)}function bs(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Vr(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var R="__webjs_action",Yr="$$webjsAction";function lt(e){if(typeof e!="function")return null;let t=e[Yr];return typeof t=="string"&&t?t:null}function An(e,t,n){if(typeof e!="function")return!1;let r=String(t).toLowerCase(),o=String(n||"").toLowerCase();return r==="action"?o==="form":r==="formaction"?o==="button"||o==="input":!1}function Gr(e,t,n=!0){if(!e||e===R&&n)return;let r=e===R?'a second "name" attribute':`name="${e}"`;throw new Error(`[webjs] formaction=\${action} on <${t||"button"}> cannot be used when the element already carries a "name" attribute (found ${r}). The action identity is submitted as the button's own name/value pair, so there is no room for a second one. Move the action to the enclosing <form action=\${action}> or drop the submitter's "name".`)}function Jr(e,t){let n=String(e||"").toLowerCase(),r=t==null?null:String(t).toLowerCase();if(Xr(n,r)){if(n==="input"&&r==="image")throw new Error('[webjs] formaction=${action} is not supported on <input type="image"> because image submitters submit coordinate pairs (name.x/name.y) instead of name=value, so the action identity would never arrive. Use a <button> instead.');if(n==="input")throw new Error('[webjs] formaction=${action} is not supported on <input type="submit"> because the action identity has to occupy the submitter\'s "value", which on this control is also its visible label, so the button would render captioned with the action\'s id and could not be given a real one. Use <button formaction=${action}>Publish</button>, whose label is its children.');return}throw new Error(`[webjs] formaction=\${action} on <${n}>${r?` type="${r}"`:""} requires a submitter control, and formaction is inert on anything else. Use <button formaction=\${action}>.`)}function Xr(e,t){let n=t==null?null:String(t).toLowerCase();return e==="button"?n==null||n===""||n==="submit":e==="input"?n==="submit"||n==="image":!1}function Qr(e){throw new Error(`[webjs] formaction=\${action} on <${e||"button"}> cannot be used when the element already carries a "value" attribute. The action identity is submitted as the button's own name/value pair, so both halves are taken. Drop the "value", or dispatch on it from one form-level action instead.`)}function Zr(e){throw new Error(`[webjs] a bound formaction=\${action} on <${e||"button"}> cannot also carry a plain formaction attribute: the two name different targets and the renderers resolve them differently. Drop the static attribute.`)}function eo(e){throw new Error(`[webjs] formaction=\${action} on <${e||"button"}> cannot be used with a "form" attribute, which re-points the submitter at a form other than the bound one it sits in. Keep the submitter inside its bound <form>.`)}function to(e,t){if(e)throw new Error(`[webjs] two formaction=\${action} holes were found on one <${t||"button"}>. Only one can win, and the two renderers pick differently, so bind exactly one action per submitter.`)}function no(e,t){if(!e)throw new Error(`[webjs] formaction=\${action} on <${t||"button"}> requires the enclosing <form> to also be bound to a server action (e.g. <form action=\${formAction}>). The enclosing <form> must carry an action binding so method="post" and the enctype are set at form start, which is too late to add from the button.`)}function ro(e,t,n){let o=(e||[]).filter(i=>n?Sn(i):/^form(action|method|enctype)$/i.test(String(i)))[0];if(o)throw new Error(`[webjs] a <${t||"button"}> submitter binds .${o}=. That property is a reflected IDL attribute on a submitter, so a property binding is dropped at SSR and written to the attribute in the browser: the page would render on the server and throw on hydration. Write it as a plain attribute.`)}function Sn(e){let t=String(e).toLowerCase();return t==="name"||t==="value"||t==="formaction"||t==="formmethod"||t==="formenctype"}function vn(e,t,n,r){let o=!!(r&&r.bound),i=!!(r&&r.retargeted),s=t==null?null:String(t),a=n==null?null:String(n);if(s!=null&&/^dialog$/i.test(s)){if(!o)return;throw new Error(`[webjs] formaction=\${action} on <${e}> cannot be combined with formmethod="dialog", which dismisses a <dialog> instead of submitting, so the bound action would never run. Drop one of the two.`)}if(!i){if(s!=null&&!/^post$/i.test(s))throw new Error(`[webjs] <${e} formmethod="${s}"> inside a bound <form action=\${action}> cannot work: a bound server action is submitted as a POST body, and a "${s}" submission sends none, so the action would never run. Drop the formmethod attribute, or point the button elsewhere with a plain formaction="/url".`);if(a!=null&&!io.has(a.toLowerCase()))throw new Error(`[webjs] <${e} formenctype="${a}"> inside a bound <form action=\${action}> cannot work: a form submission is parsed as multipart/form-data or application/x-www-form-urlencoded, and a "${a}" body is neither, so the submission would run under JS and 405 without it. Drop the formenctype attribute (WebJs emits multipart/form-data on the form).`)}}function Ue(e,t,n){if(ut(e)&&vs(t))throw new Error(Es(t,n))}function oo(e,t,n){Ss(t,n)&&Ue(e,t,n)}function En(e,t){if(e)return e;let n=t==="button"||t==="input"?"formaction=":"action=";throw new Error(`[webjs] the function in ${n} on <${t||"form"}> is not a server action. Only a function imported from a 'use server' *.server.{js,ts} module can be bound to a form or a submitter, because the identity the browser submits has to resolve back to something the server can run. Move the handler into a server action and import it, or pass a url string.`)}var io=new Set(["multipart/form-data","application/x-www-form-urlencoded"]);function ys(e,t){if(e!=null&&!/^post$/i.test(e))throw new Error(`[webjs] <form method="${e}" action=\${action}> cannot work: a bound server action is submitted as a POST body, and a "${e}" form sends no body. Drop the method attribute (WebJs emits method="post") or remove the bound action.`);if(t!=null&&!io.has(t.toLowerCase()))throw new Error(`[webjs] <form enctype="${t}" action=\${action}> cannot work: a form submission is parsed as multipart/form-data or application/x-www-form-urlencoded, and a "${t}" body is neither, so the submission would run under JS and do nothing without it. Drop the enctype attribute (WebJs emits multipart/form-data).`)}function gs(e){if(e.duplicateAction)throw new Error("[webjs] two action=${...} holes were found on one <form>. A form can carry only one action binding. Move one to a submit button's formaction=${action} or remove the duplicate.");if(e.staticAction)throw new Error('[webjs] a bound <form action=${action}> also carries a plain action="..." attribute. A bound form posts to the page\'s own url, so the two say different things: without JS the browser would post to the written url and with JS it would not. Drop the action attribute, or drop the binding.');let t=e.propAttrs&&e.propAttrs[0];if(t)throw new Error(`[webjs] a bound <form action=\${action}> also binds .${t}=. A property binding on a native element is dropped at SSR and applied in the browser, so the form would submit one way with JS and another way without it. Write it as a plain attribute.`)}var X=Symbol("webjs.attr.absent");function ws(e,t){let n=e!==X&&e!=null,r=t!==X&&t!=null;return ys(n?e:null,r?t:null),{method:n?null:"post",enctype:r?null:"multipart/form-data"}}function so(e,t,n,r,o){let i=typeof t=="function"?lt(t):null;if(!i){typeof t=="function"&&En(null,e.localName),As(e,n,r,o.propAttrs);return}gs(o);let s=ws(n,r);e.removeAttribute("action"),zr(e,"method",n,s.method),zr(e,"enctype",r,s.enctype),_s(e,i)}function zr(e,t,n,r){if(r!==null){e.setAttribute(t,r);return}n!==X&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function _s(e,t){let n=e.firstElementChild,r=n&&n.localName==="input"&&n.getAttribute("name")===R?n:null;if(!r){for(let o of e.children)if(o.localName==="input"&&o.getAttribute("name")===R){r=o;break}}r||(r=e.ownerDocument.createElement("input"),r.setAttribute("type","hidden"),r.setAttribute("name",R),e.insertBefore(r,e.firstChild)),r.getAttribute("value")!==t&&r.setAttribute("value",t)}function ao(e){for(let t of e.querySelectorAll("button, input")){let n=t.localName;if(!Xr(n,t.getAttribute("type")))continue;let r=t.getAttribute("formmethod"),o=t.getAttribute("formenctype");r==null&&o==null||vn(n,r,o,{bound:t.getAttribute("name")===R,retargeted:t.hasAttribute("formaction")})}}function As(e,t,n,r){let o=e.firstElementChild;if(o&&o.localName==="input"&&o.getAttribute("name")===R)o.remove();else for(let s of e.children)if(s.localName==="input"&&s.getAttribute("name")===R){s.remove();break}let i=s=>(r||[]).some(a=>{let c=String(a).toLowerCase();return c===s||s==="enctype"&&c==="encoding"});t===X&&!i("method")&&e.removeAttribute("method"),n===X&&!i("enctype")&&e.removeAttribute("enctype")}function Ss(e,t){let n=String(e).toLowerCase();Be(n[0])&&(n=n.slice(1));let r=String(t||"").toLowerCase();return n==="action"?r==="form":n==="formaction"?r==="button"||r==="input":!1}function ut(e,t){if(typeof e=="function")return!0;if(!Array.isArray(e))return!1;let n=t||new Set;return n.has(e)?!1:(n.add(e),e.some(r=>ut(r,n)))}function vs(e){let t=String(e).toLowerCase();return Be(t[0])&&(t=t.slice(1)),t==="action"||t==="formaction"}function Es(e,t){return`[webjs] a function was interpolated into ${String(e).toLowerCase()}= on <${t||"form"}>. Stringifying a function into HTML would leak its source (a 'use server' action's body included) to every visitor, so this is refused. To run a server action from a form, write an unquoted action=\${action} on the <form> itself or a formaction=\${action} on a <button> inside a bound form. Anywhere else, pass a URL string.`}var co=Symbol.for("webjs.repeat");function lo(e,t,n){return{[co]:!0,items:[...e],keyFn:t,templateFn:n}}function ft(e){return!!e&&typeof e=="object"&&e[co]===!0}function Cs(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function Cn(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Ns(e){return{_$webjs:"live",value:e}}function dt(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function xs(e,t){return{_$webjs:"keyed",key:e,value:t}}function pt(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function ks(e,t){return{_$webjs:"guard",deps:e,fn:t}}function ht(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Ts(e){return{_$webjs:"template-content",template:e}}function Nn(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function js(e){return{_$webjs:"ref",target:e}}function mt(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Rs(){return{value:void 0}}function Os(e){return{_$webjs:"cache",value:e}}function bt(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function Ls(...e){return{_$webjs:"until",args:e}}function yt(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function Ps(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function xn(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function Is(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function kn(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Ms(e){return{_$webjs:"watch",signal:e}}function gt(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var F=null,Q=!1,Ae=0,_e=null,Tn=0,uo=(e,t)=>Object.is(e,t),_t=()=>{},fo=()=>!1;function po(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)po(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function He(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)He(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function In(e){if(Q)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&&On(t)&&He(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,On(t)&&po(e,t)),t.producerLastReadVersions[n]=e.version}function On(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function ho(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=Q;Q=!0;try{for(let n of e.liveConsumers)n.dirty||Fs(n)}finally{Q=t}}function Fs(e){e.dirty=!0,ho(e),e.consumerMarkedDirty.call(e.wrapper||e)}function At(e){if(!(!e.dirty&&e.lastCleanEpoch===Ae)){if(!e.producerMustRecompute()&&!$s(e)){e.dirty=!1,e.lastCleanEpoch=Ae;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=Ae}}function $s(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(At(n),r!==n.version))return!0}return!1}function Ln(e){e&&(e.nextProducerIndex=0);let t=F;return F=e,t}function Pn(e,t){if(F=t,!!e){if(On(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)He(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var St=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=Ae,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=fo,this.producerRecomputeValue=_t,this.consumerMarkedDirty=_t,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||uo,this.watched=n?.[Mn],this.unwatched=n?.[Fn]}get(){return In(this),this.__value}peek(){return this.__value}set(t){if(Q)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,Ae++,_e!==null?mo(this):ho(this))}};function mo(e){let t=Q;Q=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?_e.add(n):mo(n))}finally{Q=t}}var jn=Symbol("unset"),Rn=Symbol("computing"),wt=Symbol("errored"),qe=class{constructor(t,n){this.__fn=t,this.__value=jn,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||uo,this.watched=n?.[Mn],this.unwatched=n?.[Fn];let r=this;this.producerMustRecompute=function(){return r.__value===jn||r.__value===Rn},this.producerRecomputeValue=function(){if(r.__value===Rn)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=Rn;let i=Ln(r),s,a=!1;try{s=r.__fn.call(r.wrapper)}catch(l){s=wt,r.__error=l,a=!0}finally{Pn(r,i)}if(!a&&(o!==jn&&o!==wt)&&r.__equal.call(r.wrapper,o,s)){r.__value=o;return}r.__value=s,r.version++},this.consumerMarkedDirty=_t}get(){if(At(this),In(this),this.__value===wt)throw this.__error;return this.__value}peek(){if(At(this),this.__value===wt)throw this.__error;return this.__value}},vt=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=Ae,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=fo,this.producerRecomputeValue=_t,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=Ln(this);try{for(let r of t)In(r),r.__isComputed&&At(r)}finally{Pn(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(He(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=Ln(this),r;try{r=t()}finally{Pn(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)He(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},Mn=Symbol("watched"),Fn=Symbol("unwatched");function Ds(e){let t=F;F=null;try{return e()}finally{F=t}}function Bs(e){return e.producers.slice()}function Us(e){return e.liveConsumers?[...e.liveConsumers]:[]}function Hs(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function qs(e){return e.producers.length>0}function Ws(){return F&&F.__isComputed?F:null}function Ks(e){Tn++,_e===null&&(_e=new Set);try{e()}finally{if(Tn--,Tn===0){let t=_e;_e=null;for(let n of t)n.__fire()}}}var We={State:St,Computed:qe,subtle:{Watcher:vt,untrack:Ds,introspectSources:Bs,introspectSinks:Us,hasSinks:Hs,hasSources:qs,currentComputed:Ws,watched:Mn,unwatched:Fn}};function Vs(e,t){return new St(e,t)}function zs(e,t){return new qe(e,t)}function Ys(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function Gs(e){let t=!1,n=!1,r=new qe(e),o=new vt(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(i){console.error(i)}o.watch()}}))});o.watch(r);try{r.get()}catch(i){console.error(i)}return()=>{n||(n=!0,o.dispose())}}Rt();function Bo(e,t){let n=e&&e[v]?e:null;return n?kt(n,t):t()}var Zn=new WeakMap,er=new WeakMap,Pt=new WeakMap,Ot=Symbol.for("webjs.instance"),P=null;function It(e){return e?e.nodeType===11&&e.host?e.host:e:null}function nr(e,t){let n=e.__commitOwner,r=P;n&&(P=n);try{t()}finally{P=r}}function xe(e,t){let n=t,r=n[T];n[T]=!0;let o=P;P=t;try{let i=n[Ot];if(L(e)){let s=e;if(i&&i.strings===s.strings){Ce(i,s.values);return}i&&$o(i,t);let a=t.firstChild;a&&a.nodeType===8&&a.data==="webjs-hydrate"&&a.remove(),n[Ot]=null;let c=ga(s,t);n[Ot]=c;return}if(i&&$o(i,t),n[Ot]=null,t.replaceChildren(),e==null||e===!1||e===!0)return;if(Array.isArray(e)){for(let s of e){let a=document.createTextNode(String(s??""));t.appendChild(a)}return}t.appendChild(document.createTextNode(String(e)))}finally{P=o,n[T]=r,r||Qn(n)}}function Mt(e){let{strings:t}=e,n=Zn.get(t);if(n)return n;let r=[],o="",i="text",s="",a=0,c="",l=0,u=null,f="",d="";for(let y=0;y<t.length;y++){let w=t[y];for(let b=0;b<w.length;b++){let m=w[b];switch(i){case"text":o+=m,m==="<"&&(i="tag-open");break;case"tag-open":o+=m,m==="!"?i="bang-1":m==="/"?(i="tag-name",f=""):/[a-zA-Z]/.test(m)?(i="tag-name",f=m.toLowerCase()):i="text";break;case"bang-1":o+=m,i=m==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=m,m==="-"?(i="comment",l=0):i="tag-name";break;case"comment":o+=m,m==="-"?l+=1:(m===">"&&l>=2&&(i="text"),l=0);break;case"tag-name":o+=m,m===">"?(i=f==="script"||f==="style"?"rawtext":"text",i==="rawtext"&&(d="")):/\s/.test(m)?i="in-tag":f+=m.toLowerCase();break;case"in-tag":o+=m,m===">"?(i=f==="script"||f==="style"?"rawtext":"text",i==="rawtext"&&(d="")):!/\s/.test(m)&&m!=="/"&&(i="attr-name",s=m,a=o.length-1);break;case"rawtext":o+=m,d=(d+m.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(i="text",d="",f="");break;case"attr-name":m==="="?(i="after-eq",o+=m):/\s/.test(m)?(i="in-tag",s="",o+=m):m===">"?(i="text",s="",o+=m):(s+=m,o+=m);break;case"after-eq":m==='"'||m==="'"?(i="attr-quoted",c=m,o+=m):/\s/.test(m)?(i="in-tag",s="",o+=m):m===">"?(i="text",s="",o+=m):(i="attr-unquoted",o+=m);break;case"attr-unquoted":/\s/.test(m)?(i="in-tag",s="",o+=m):(m===">"&&(i="text",s=""),o+=m);break;case"attr-quoted":o+=m,m===c&&(i="in-tag",s="");break;case"skip-attr":if(m===c){if(u){let ye=u.firstPartIdx,g=[];for(let k=ye;k<r.length;k++)(r[k].kind==="noop"||r[k].kind==="attr-mixed")&&g.push(k);let O=[],ge=t[g[0]],we=ge.lastIndexOf(c);O.push(we>=0?ge.slice(we+1):ge);for(let k=1;k<g.length;k++)O.push(t[g[k]]);let E=t[g[g.length-1]+1],De=E.indexOf(c);O.push(De>=0?E.slice(0,De):E),r[ye]={kind:"attr-mixed",path:[],name:u.name,statics:O,group:g};for(let k=1;k<g.length;k++)r[g[k]]={kind:"noop",path:[],mixedAnchor:ye};u=null}i="in-tag",s=""}break}}if(y<t.length-1){let b=r.length;if(i==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(i==="rawtext"){d="",r.push({kind:"noop",path:[]});continue}if(i==="text")o+=`<!--${C}${b}-->`,r.push({kind:"child",path:[]});else if(i==="in-tag"){let m=`data-${C}${b}`;o+=`${m}=""`,r.push({kind:"element",path:[]})}else if(i==="after-eq"){let m=s[0],ye=s.slice(1);if(Be(m)){o=o.slice(0,a);let g=_n[m],O=`data-${C}${b}`;o+=`${O}=""`,r.push({kind:g,path:[],name:ye})}else{o=o.slice(0,a);let g=`data-${C}${b}`;o+=`${g}=""`,r.push({kind:"attr",path:[],name:s})}i="in-tag",s=""}else if(i==="attr-quoted"||i==="attr-unquoted"){o=o.slice(0,a);let m=`data-${C}${b}`;o+=`${m}=""`,u={name:s,firstPartIdx:b},r.push({kind:"noop",path:[]}),i="skip-attr"}else i==="skip-attr"&&r.push({kind:"noop",path:[]})}}let h=document.createElement("template");h.innerHTML=o,da(h.content,r);let p=pa(h.content,r);return n={templateEl:h,parts:r,formActions:p},Zn.set(t,n),n}function da(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(N,"");let o=t.length;r.setAttribute(`data-${C}${o}`,""),t.push({kind:"slot",path:[]})}}function pa(e,t){let n=[],r=[];function o(i){for(let s=0;s<i.childNodes.length;s++){let a=i.childNodes[s];if(n.push(s),a.nodeType===8){let c=a.data;if(c.startsWith(C)){let l=Number(c.slice(C.length));t[l]&&t[l].kind==="child"&&(t[l].path=n.slice())}}else if(a.nodeType===1){let c=a,l=[],u=[];for(let f of c.attributes)if(f.name.startsWith(`data-${C}`)){let d=Number(f.name.slice(`data-${C}`.length));t[d]&&t[d].kind!=="child"&&(t[d].path=n.slice(),u.push({idx:d,kind:t[d].kind,name:t[d].name||""})),l.push(f.name)}if(c.localName==="form"||c.localName==="button"||c.localName==="input"){let f=ha(c,u,t);f&&r.push(f)}for(let f of l)c.removeAttribute(f);o(a)}n.pop()}}return o(e),r.length?r:null}function ha(e,t,n){let r=e.localName==="form",o=r?"action":"formaction",i=t.filter(p=>p.kind==="attr"&&p.name.toLowerCase()===o);if(!i.length)return null;let s=[],a=[],c=[],l=r?[]:t.filter(p=>p.name.toLowerCase()==="name"&&(p.kind==="attr"||p.kind==="attr-mixed"||p.kind==="bool")).map(p=>({i:p.idx,kind:p.kind})),u=!r&&e.hasAttribute("name"),f=!r&&e.hasAttribute("form"),d=!r&&e.hasAttribute("value"),h=r?[]:t.filter(p=>p.name.toLowerCase()==="value"&&(p.kind==="attr"||p.kind==="attr-mixed"||p.kind==="bool")).map(p=>({i:p.idx,kind:p.kind}));for(let p of t){let y=String(p.name).toLowerCase();if(p.kind==="prop"){r?(y==="method"||y==="enctype"||y==="encoding")&&c.push(p.name):Sn(y)&&c.push(p.name);continue}if(y!=="method"&&y!=="enctype"||p.kind!=="attr"&&p.kind!=="attr-mixed"&&p.kind!=="bool")continue;let w=n[p.idx],b={i:p.idx,kind:p.kind};p.kind==="attr-mixed"&&(b.statics=w.statics||[],b.group=w.group||[]),(y==="method"?s:a).push(b)}return{isForm:r,tag:e.localName,actionIdxs:i.map(p=>p.idx),duplicateAction:i.length>1,staticAction:e.getAttribute(o)!=null,authoredName:u,authoredValue:d,authoredForm:f,propAttrs:c,nameParts:l,valueParts:h,staticMethod:e.getAttribute("method"),staticEnctype:e.getAttribute("enctype"),methodParts:s,enctypeParts:a}}function Ge(e,t,n){if(!e)return;let r=[];for(let o of[!0,!1])for(let i of e){if(i.isForm!==o)continue;let s=i.actionIdxs[0],a=i.isForm?"action":"formaction";for(let u of i.actionIdxs)if(An(fe(n[u]),a,i.tag)){s=u;break}let c=t[s];if(!c||!c.el)continue;let l=fe(n[s]);if(i.isForm)so(c.el,l,Do(i.methodParts,i.staticMethod,n),Do(i.enctypeParts,i.staticEnctype,n),i),typeof l=="function"&&lt(l)&&r.push(c.el);else{let u=f=>f.some(d=>d.kind==="bool"?!!fe(n[d.i]):!0);ya(c.el,l,i,u(i.nameParts),u(i.valueParts))}}for(let o of r)ao(o)}function ma(e){(Pt.has(e)||e.getAttribute("name")===R)&&(e.getAttribute("name")===R&&e.removeAttribute("name"),e.removeAttribute("value"),Pt.delete(e))}function ba(e){let t=e.parentNode;for(;t;){if(t.nodeType===1&&t.localName==="form")return t;t=t.parentNode}return null}function ya(e,t,n,r,o){let i=typeof t=="function"?lt(t):null;if(!i){typeof t=="function"&&En(null,e.localName),ma(e);return}to(n.duplicateAction,e.localName),ro(n.propAttrs,e.localName,!0),n.staticAction&&Zr(e.localName),(n.authoredValue||o)&&Qr(e.localName),(n.authoredName||r)&&Gr(e.getAttribute("name")||R,e.localName,!1),(n.authoredForm||e.hasAttribute("form"))&&eo(e.localName),Jr(e.localName,e.getAttribute("type"));let s=ba(e);if(s&&!Pt.has(e)){let a=!!(s.querySelector(`input[name="${R}"]`)||er.has(s));no(a,e.localName)}vn(e.localName,e.getAttribute("formmethod"),e.getAttribute("formenctype"),{bound:!0}),e.removeAttribute("formaction"),e.setAttribute("name",R),e.setAttribute("value",i),Pt.set(e,i)}function ga(e,t){let{templateEl:n,parts:r,formActions:o}=Mt(e),i=n.content.cloneNode(!0),s=document.createComment(`${C}s`),a=document.createComment(`${C}e`),c=r.map(f=>Ft(f,i)),l=[];for(let f=0;f<e.values.length;f++)U(c[f],e.values[f],void 0,e.values),l.push(e.values[f]);Ge(o,c,e.values),t.replaceChildren(s,...i.childNodes,a);let u=t.nodeType===1&&t[v]?t:null;for(let f of c)f.kind==="slot"&&(u&&f.slotEl&&(f.slotEl[xt]=u),U(f,void 0,void 0,[]));return{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a}}function Ft(e,t){if(e.kind==="noop")return{kind:"noop",mixedAnchor:e.mixedAnchor};let n=t;for(let o of e.path)n=n.childNodes[o];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let o={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(i){o.handler?.(i)}};return r.addEventListener(o.name,o.dispatcher),o}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}`)}var Fo=Symbol("webjs.commitFailed");function Ce(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(Object.is(r,e.lastValues[n]))continue;let o=e.bound[n],i=o.mixedAnchor;try{o.kind==="noop"&&i!=null?U(e.bound[i],t[i],e.lastValues[i],t):U(o,r,e.lastValues[n],t)}catch(s){throw e.lastValues[n]=Fo,o.kind==="noop"&&i!=null&&(e.lastValues[i]=Fo),s}e.lastValues[n]=r}Ge(Zn.get(e.strings)?.formActions??null,e.bound,t)}function $o(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 if(typeof r=="object")try{r.value=void 0}catch{}n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=ze(n.slotEl);r&&Mo(r,n.slotEl)}}t.replaceChildren()}function Do(e,t,n){for(let r of e){if(r.kind==="bool")return fe(n[r.i])?"":X;if(r.kind==="attr"){let a=fe(n[r.i]);return a==null?"":String(a)}let o=r.statics||[],i=r.group||[],s=o[0]||"";for(let a=0;a<i.length;a++)s+=String(fe(n[i[a]])??""),s+=o[a+1]||"";return s}return t??X}function fe(e){return dt(e)?e.value:e}function U(e,t,n,r){if(dt(t)){let o=t.value;if(e.kind==="prop"&&e.el[e.name]===o||e.kind==="attr"&&e.el.getAttribute(e.name)===String(o)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!o)return;t=o}switch(e.kind){case"child":Aa(e,t);break;case"attr":{if(e.el.localName==="form"&&e.name.toLowerCase()==="action"){let o=fe(t);typeof o=="function"?er.set(e.el,o):er.delete(e.el)}t==null||t===!1?e.el.removeAttribute(e.name):An(t,e.name,e.el.localName)||(Ue(t,e.name,e.el.localName),e.el.setAttribute(e.name,String(t)));break}case"prop":oo(t,e.name,e.el.localName),e.el[e.name]=t;break;case"bool":Ue(t,e.name,e.el.localName),t?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":e.handler=typeof t=="function"?t:null;break;case"element":_a(e,t);break;case"attr-mixed":{let o=e,i=o.statics[0];for(let s=0;s<o.group.length;s++){let a=r?r[o.group[s]]:t;Ue(a,e.name,e.el.localName),i+=String(a??""),i+=o.statics[s+1]||""}e.el.setAttribute(e.name,i);break}case"slot":{if(e.applied)break;let o=e.slotEl,i=()=>{let a=ze(o);if(!a){e.applied=!0;return}if(!a.contains(o)){a.isConnected?queueMicrotask(i):e.applied=!0;return}if(e.applied=!0,wa(o))return;let c=document.createDocumentFragment();for(;o.firstChild;)c.appendChild(o.firstChild);o[Ve]=c,queueMicrotask(()=>Y(a))},s=ze(o);s&&s.contains(o)?i():queueMicrotask(i);break}case"noop":break}}function ze(e){let t=e[xt];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[v])return n;n=n.parentElement}return null}function wa(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.nodeType===11&&r.host)return!0;t=r}return!1}function _a(e,t){let n=e,r=mt(t)?t.target:void 0,o=n.__refTarget,i=r!==o;if(i&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(i||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!i&&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 Aa(e,t){return Ra(e,t),B(e,t)}function B(e,t){return Bo(e.marker&&e.marker.parentNode,()=>Sa(e,t))}function Sa(e,t){let n=e.marker;if(Cn(t)){te(e);let o=String(t.value??""),i=document.createElement("template");i.innerHTML=o;let s=[...i.content.childNodes],a=document.createDocumentFragment();for(let c of s)a.appendChild(c);n.parentNode?.insertBefore(a,n),e.child=s;return}if(pt(t)){let o=t,i=e.__keyedKey;i!==void 0&&!Object.is(i,o.key)&&te(e),e.__keyedKey=o.key,B(e,o.value);return}if(ht(t)){let o=t,i=e.__guardDeps,s=o.deps;if(i!==void 0&&(Array.isArray(i)&&Array.isArray(s)?ja(i,s):Object.is(i,s)))return;let a=Array.isArray(s)?s.slice():s;B(e,o.fn()),e.__guardDeps=a;return}if(Nn(t)){te(e);let o=t.template;if(o&&o.content){let i=o.content.cloneNode(!0),s=[...i.childNodes];n.parentNode?.insertBefore(i,n),e.child=s}return}if(mt(t))return;if(bt(t))return Oa(e,t.value);if(yt(t))return La(e,t.args);if(gt(t))return Pa(e,t.signal);if(xn(t))return Ia(e,t);if(kn(t))return Ma(e,t);if(ft(t)){if(e.child&&e.child.kind==="repeat"){Ca(e,t);return}te(e);let o={kind:"repeat",map:new Map};e.child=o,Ea(n,o,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){ka(e,t);return}te(e);let o={kind:"array",items:[]};e.child=o,xa(n,o,t);return}if(e.child){let o=e.child;if(o.kind==="repeat")Uo(o),e.child=void 0;else if(o.kind==="array")qo(o),e.child=void 0;else if(o.kind==="async-stream")zo(o),e.child=void 0;else if("strings"in e.child){let i=e.child;if(L(t)&&i.strings===t.strings){Ce(i,t.values);return}Ne(i.startNode,i.endNode),e.child=void 0}else{for(let i of e.child)i.parentNode&&i.parentNode.removeChild(i);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(L(t)){let o=t,{templateEl:i,parts:s,formActions:a}=Mt(o),c=i.content.cloneNode(!0),l=document.createComment(`${C}s`),u=document.createComment(`${C}e`),f=s.map(p=>Ft(p,c)),d=[];for(let p=0;p<o.values.length;p++)U(f[p],o.values[p],void 0,o.values),d.push(o.values[p]);Ge(a,f,o.values);let h=[l,...c.childNodes,u];n.parentNode?.insertBefore(va(h),n);for(let p of f)p.kind==="slot"&&U(p,void 0,void 0,[]);e.child={strings:o.strings,bound:f,lastValues:d,startNode:l,endNode:u};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function va(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function Ne(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 rr(e){let{templateEl:t,parts:n,formActions:r}=Mt(e),o=t.content.cloneNode(!0),i=document.createComment(`${C}s`),s=document.createComment(`${C}e`),a=n.map(u=>Ft(u,o)),c=[];for(let u=0;u<e.values.length;u++)U(a[u],e.values[u],void 0,e.values),c.push(e.values[u]);Ge(r,a,e.values);for(let u of a)u.kind==="slot"&&U(u,void 0,void 0,[]);let l=document.createDocumentFragment();for(l.appendChild(i);o.firstChild;)l.appendChild(o.firstChild);return l.appendChild(s),{inst:{strings:e.strings,bound:a,lastValues:c,startNode:i,endNode:s},frag:l}}function Ye(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 if(typeof n=="object")try{n.value=void 0}catch{}t.lastTarget=void 0,t.__lastEl=void 0}}}function Ea(e,t,n){let{items:r,keyFn:o,templateFn:i}=n,s=e.parentNode;if(!s)return;let a=document.createDocumentFragment();for(let c=0;c<r.length;c++){let l=o(r[c],c),u=i(r[c],c);if(!L(u))continue;let{inst:f,frag:d}=rr(u);t.map.set(l,f),a.appendChild(d)}s.insertBefore(a,e)}function Ca(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,{items:i,keyFn:s,templateFn:a}=t,c=new Map;try{for(let l=0;l<i.length;l++){let u=s(i[l],l),f=a(i[l],l);if(!L(f))continue;let d=o.map.get(u);if(d&&d.strings===f.strings)Ce(d,f.values),tr(d.startNode,d.endNode,r,n),c.set(u,d),o.map.delete(u);else{d&&(o.map.delete(u),Ye(d),Ne(d.startNode,d.endNode));let{inst:h,frag:p}=rr(f);r.insertBefore(p,n),c.set(u,h)}}for(let[l,u]of[...o.map]){o.map.delete(l);try{Ye(u)}finally{Ne(u.startNode,u.endNode)}}o.map=c}catch(l){for(let[u,f]of c)o.map.set(u,f);throw l}}function Uo(e){for(let[t,n]of[...e.map]){e.map.delete(t);try{Ye(n)}finally{Ne(n.startNode,n.endNode)}}e.map.clear()}function Na(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function Lt(e){e.type==="tpl"?(Ye(e.inst),Ne(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Ho(e){if(L(e)){let{inst:t,frag:n}=rr(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 xa(e,t,n){let r=e.parentNode;if(!r)return;let o=document.createDocumentFragment(),i=[];for(let s of n){let{item:a,frag:c}=Ho(s);c&&o.appendChild(c),i.push(a)}r.insertBefore(o,e),t.items=i}function ka(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,i=o.items,s=[],a=0;try{for(let c=0;c<t.length;c++){let l=t[c],u=i[c];if(L(l)){let h=l;if(u&&u.type==="tpl"&&u.inst.strings===h.strings){Ce(u.inst,h.values),s.push(u),a=c+1;continue}}else if(l!=null&&l!==!1&&l!==!0){if(u&&u.type==="text"){let h=String(l);u.node.data!==h&&(u.node.data=h),s.push(u),a=c+1;continue}}else{u&&Lt(u),s.push({type:"empty"}),a=c+1;continue}let{item:f,frag:d}=Ho(l);d&&r.insertBefore(d,Ta(i,c,n)),s.push(f),u&&Lt(u),a=c+1}for(let c=t.length;c<i.length;c++)Lt(i[c]),a=c+1;o.items=s}catch(c){throw o.items=s.concat(i.slice(a)),c}}function Ta(e,t,n){for(let r=t;r<e.length;r++){let o=Na(e[r]);if(o&&o.parentNode)return o}return n}function qo(e){for(let t of e.items)Lt(t);e.items=[]}function tr(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),i=e;for(;i;){let s=i.nextSibling;if(o.appendChild(i),i===t)break;i=s}n.insertBefore(o,r)}function ja(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 te(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Wo(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Uo(n);else if(n.kind==="array")qo(n);else if(n.kind==="async-stream")zo(n);else if("strings"in n){let r=e.child;Ye(r),Ne(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Ra(e,t){let n=e;n.__untilState&&!yt(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!ht(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!bt(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!pt(t)&&(n.__keyedKey=void 0),n.__watchSub&&!gt(t)&&Wo(n)}function Oa(e,t){let n=e.marker,r=e,o=r.__cacheMap;o||(o=new Map,r.__cacheMap=o);let i=e.child;if(i&&"strings"in i){let a=i;if(L(t)&&a.strings===t.strings){Ce(a,t.values);return}let c=document.createDocumentFragment();tr(a.startNode,a.endNode,c,null),o.set(a.strings,{inst:a,holder:c}),e.child=void 0}if(L(t)){let a=t,c=o.get(a.strings);if(c){o.delete(a.strings),e.child&&te(e),tr(c.inst.startNode,c.inst.endNode,n.parentNode,n),Ce(c.inst,a.values),e.child=c.inst;let l=new Set;for(let u=c.inst.startNode.nextSibling;u&&u!==c.inst.endNode;u=u.nextSibling){if(u.nodeType!==1)continue;let f=u;if(f.matches("slot[data-webjs-light]")){let d=ze(f);d&&l.add(d)}for(let d of f.querySelectorAll("slot[data-webjs-light]")){let h=ze(d);h&&l.add(h)}}for(let u of l)Y(u);return}}B(e,t)}function La(e,t){let n=e;P&&(n.__commitOwner=It(P));let r=n.__untilState,o=n.__untilArgs,i=(d,h)=>!!(Object.is(d,h)||L(d)&&L(h)&&d.strings===h.strings),a=o&&o.length===t.length&&o.every((d,h)=>i(d,t[h]))&&r?r.highestResolved:1/0;r&&(r.aborted=!0),n.__untilArgs=t.slice();let c={aborted:!1,highestResolved:a};n.__untilState=c;let l=-1,u;for(let d=0;d<t.length;d++){let h=t[d];if(!h||typeof h.then!="function"){l=d,u=h;break}}l!==-1&&l<=c.highestResolved?(B(e,u),c.highestResolved=l):l===-1&&!n.__untilEverRendered&&B(e,""),n.__untilEverRendered=!0;let f=Math.min(l===-1?t.length:l,c.highestResolved);for(let d=0;d<f;d++){let h=t[d];!h||typeof h.then!="function"||Promise.resolve(h).then(p=>{if(!c.aborted&&!(d>=c.highestResolved)){try{nr(e,()=>B(e,p))}catch(y){or(e,y);return}c.highestResolved=d}},()=>{})}}function or(e,t){let n;try{n=t instanceof Error?t:new Error(String(t))}catch{n=new Error("render error (unstringifiable thrown value)")}let r=e.__commitOwner;if(r&&typeof r._handleRenderError=="function"){r._handleRenderError(n);return}throw n}function Pa(e,t){let n=e;if(P&&(n.__commitOwner=It(P)),n.__watchSig===t&&n.__watchSub){let i;n.__watchSub.observe(()=>{i=t.get()}),B(e,i);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new We.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let i;try{r.observe(()=>{i=t.get()}),nr(e,()=>B(e,i))}catch(s){or(e,s)}})});n.__watchSub=r;let o;r.observe(()=>{o=t.get()}),B(e,o)}function Wo(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Ia(e,t){let n=e;P&&(n.__commitOwner=It(P));let r=e.child;if(r&&r.kind==="async-stream"&&r.mode==="append"&&r.iterable===t.iterable)return;te(e);let o=t.iterable[Symbol.asyncIterator](),i={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:o,nodes:[]};e.child=i,Ko(i,e,t)}function Ma(e,t){let n=e;P&&(n.__commitOwner=It(P));let r=e.child;if(r&&r.kind==="async-stream"&&r.mode==="replace"&&r.iterable===t.iterable)return;te(e);let o=t.iterable[Symbol.asyncIterator](),i={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:o,nodes:[]};e.child=i,Ko(i,e,t)}async function Ko(e,t,n){let r=t.marker,o=0;for(;!e.aborted;){let i,s;try{if(i=await e.iterator.next(),e.aborted||i.done)break;s=n.mapper?n.mapper(i.value,o):i.value}catch(a){typeof console<"u"&&console.error("[webjs] asyncStream error:",a);return}try{nr(t,()=>{let a=Vo(s);Bo(r.parentNode,()=>{if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let c=document.createDocumentFragment();for(let l of a)c.appendChild(l);r.parentNode?.insertBefore(c,r),e.nodes.push(...a)})})}catch(a){e.aborted=!0;try{e.iterator.return?.()?.catch?.(()=>{})}catch{}or(t,a);return}o++}}function Vo(e){if(e==null||e===!1||e===!0)return[];if(L(e)){let t=e,{templateEl:n,parts:r,formActions:o}=Mt(t),i=n.content.cloneNode(!0),s=r.map(a=>Ft(a,i));for(let a=0;a<t.values.length;a++)U(s[a],t.values[a],void 0,t.values);Ge(o,s,t.values);for(let a of s)a.kind==="slot"&&U(a,void 0,void 0,[]);return[...i.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...Vo(n));return t}return[document.createTextNode(String(e))]}function zo(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 Yo=null;function $t(e){Yo=e||null}function Fa(){return Yo||void 0}var Go=Symbol.for("webjs:registry"),Jo=Symbol.for("webjs:classToTag"),Dt=globalThis,H=Dt[Go]||(Dt[Go]=new Map),Xo=Dt[Jo]||(Dt[Jo]=new WeakMap),Bt=typeof window<"u"&&typeof customElements<"u";function ir(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=H.get(e);r?(r.cls=t,r.lazy=n):H.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),Xo.set(t,e)}if(Bt){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),ir(t,n)}}if(!Bt){let e=globalThis;e.customElements||(e.customElements={define(t,n){ir(t,n)},get(t){return H.get(t)?.cls},upgrade(){},whenDefined(t){let n=H.get(t);return Promise.resolve(n?.cls)}})}function sr(e,t){Bt?customElements.define(e,t):ir(e,t)}function $a(e,t){if(Bt)return;let n=H.get(e);if(n){n.moduleUrl=t;return}H.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Da(e){return H.get(e)?.cls}function Ba(e){return H.get(e)?.moduleUrl||null}function Ua(e){return H.get(e)?.lazy===!0}function Je(e){return Xo.get(e)}function Ha(){return[...H.keys()]}Ze();Rt();var ii=typeof window<"u"&&typeof HTMLElement<"u";function tc(e,t){return e!==t}function nc(e){try{return String(e)}catch{return Object.prototype.toString.call(e)}}function ni(e,t,n){if(typeof console>"u"||!console.warn)return;let r=Je(e.constructor)||e.tagName?.toLowerCase()||"unknown";console.warn(`[webjs] reflect:true property "${t}" on <${r}> holds a function (or an array carrying one), which has no HTML attribute representation. Removing "${n}" instead of stringifying it (a stringified function writes its source into the page, so a server action's body would ship to the browser). Pass a string, or drop reflect on this property.`)}function rc(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var Ut=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(),o=this.__ssrAttrs.has(r);return(n===void 0?!o: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 o=r.length-1;o>=0;o--)if(r[o]&&r[o].__ssrTag===n)return r[o];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,o=>"-"+o.toLowerCase());return this.__dataset=new Proxy({},{get(r,o){if(typeof o!="string")return;let i=t.getAttribute(n(o));return i===null?void 0:i},set(r,o,i){return typeof o=="string"&&t.setAttribute(n(o),i),!0},has(r,o){return typeof o=="string"&&t.hasAttribute(n(o))},deleteProperty(r,o){return typeof o=="string"&&t.removeAttribute(n(o)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(o,i)=>i.toUpperCase()))},getOwnPropertyDescriptor(r,o){if(typeof o=="string"&&t.hasAttribute(n(o)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(o))}}}),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=rc(),this.__internals}},oc=["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 oc){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(Ut.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var ic=ii?HTMLElement:Ut,si=Symbol("webjs.factoryProps"),ri=new WeakSet,ke=class e extends ic{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){sr(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||cr(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(ri.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,si)){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://webjs.dev/docs/components.`)}n=Object.getPrototypeOf(n)}ri.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,o]of Object.entries(n)){let i=typeof o=="object"?o:{type:o},s=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:a=>{let c=this.__propValues[r];(i.hasChanged||tc)(a,c)&&(this.__propValues[r]=a,i.reflect&&!i.state&&this._connected&&this._reflectAttribute(r,a,i),this.requestUpdate(r,c))}}),s!==void 0?this.__propValues[r]=s:i.default!==void 0&&(this.__propValues[r]=typeof i.default=="function"?i.default():i.default)}}}_reflectAttribute(t,n,r){let o=r.attribute||cr(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let i=r.converter.toAttribute(n,r.type);i==null?this.removeAttribute(o):this.setAttribute(o,i)}else typeof n=="function"?(this.removeAttribute(o),ni(this,t,o)):r.type===Boolean?n?this.setAttribute(o,""):this.removeAttribute(o):n==null?this.removeAttribute(o):r.type===Object||r.type===Array?this.setAttribute(o,JSON.stringify(n)):ut(n)?(this.removeAttribute(o),ni(this,t,o)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!ii)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 o=n[r].name;o.startsWith("data-webjs-prop-")&&t.push(o)}for(let r of t){let o=this.getAttribute(r);if(this.removeAttribute(r),o==null)continue;let i=oi(r.slice(16));try{this[i]=pe(o)}catch(s){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${s&&s.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,o=Array.isArray(r)?r:gn(r)?[r]:[];if(o.length){if(n){let i=this.shadowRoot.querySelector("style");i&&i.remove()}wn(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${Je(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().`),Xn(this)?Ro(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||Io(this)?(this.removeAttribute("data-wj-serialized"),z(this),So(this)):Ao(this),Po(this),ko(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)}})}__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),jo(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 i=this.constructor.properties||{},s,a;for(let[u,f]of Object.entries(i))if(((typeof f=="object"?f:{type:f}).attribute||cr(u))===t){s=u,a=f;break}if(a===void 0&&(s=oi(t),a=i[s]||i[t]),a===void 0)return;let c=typeof a=="object"?a:{type:a},l;if(c.converter&&c.converter.fromAttribute)l=c.converter.fromAttribute(r,c.type);else if(c.type===Number)l=r==null?null:Number(r);else if(c.type===Boolean)l=r!=null&&r!=="false";else if(c.type===Object||c.type===Array)try{l=r==null?null:JSON.parse(r)}catch{l=r}else l=r;this[s]!==l&&(this[s]=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 o of this.__controllers)o.hostUpdate&&o.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,$t(this.__renderAbort?this.__renderAbort.signal:null);try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}finally{$t(null)}if(!r){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();n=!0}}}catch(o){console.error("[webjs] lifecycle hook threw during update phase:",o)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let o=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1;let i=()=>{if(this.__pendingAsyncCommits--,o===this.__renderToken){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();this._postCommit(t)}};r.then(i,s=>{try{o===this.__renderToken&&this._handleRenderError(s instanceof Error?s:new Error(nc(s)))}finally{i()}});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 We.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);xe(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&xe(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{if(n===this.__renderToken)try{xe(r,this._renderRoot)}catch(o){this._handleRenderError(o instanceof Error?o:new Error(String(o)))}},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==Ht.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${Je(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&xe(n,this._renderRoot)}catch(n){console.error("[webjs] renderError() also threw:",n)}}_postCommit(t){try{this.__firstRendered||(this.__firstRendered=!0,this.firstUpdated(t)),this.updated(t)}catch(n){console.error("[webjs] lifecycle hook threw during post-commit phase:",n)}finally{this._resolveUpdate()}}updated(t){}firstUpdated(t){}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}addController(t){this.__controllers.add(t),this._connected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers.delete(t)}render(){return""}renderError(t){}renderFallback(){}};function cr(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function oi(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Ht(e){return new.target?Reflect.construct(ke,arguments,new.target):class extends ke{static properties=e;static[si]=!0}}Object.setPrototypeOf(Ht,ke);Ht.prototype=ke.prototype;function sc(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var ai=Symbol.for("webjs.notFound"),ci=Symbol.for("webjs.redirect"),li=Symbol.for("webjs.forbidden"),ui=Symbol.for("webjs.unauthorized");function ac(){let e=new Error("webjs: notFound()");throw e.__webjs=ai,e}function cc(){let e=new Error("webjs: forbidden()");throw e.__webjs=li,e}function lc(){let e=new Error("webjs: unauthorized()");throw e.__webjs=ui,e}function uc(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=ci,r.url=e,r.status=typeof n=="number"?n:void 0,r}function fc(e){return!!e&&e.__webjs===ai}function dc(e){return!!e&&e.__webjs===ci}function pc(e){return!!e&&e.__webjs===li}function hc(e){return!!e&&e.__webjs===ui}var fi=null;function mc(){if(!fi)return"";try{return fi()||""}catch{return""}}var di=null;function bc(e){if(typeof e!="string"||!e||!di)return e;try{return di(e)||e}catch{return e}}var wu=Symbol.for("webjs.suspense");function yc(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function gc(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function wc(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,i=null,s=[];function a(){o||(i=new WebSocket(_c(e),t.protocols),i.onopen=c=>{for(r=0;s.length&&i&&i.readyState===WebSocket.OPEN;)i.send(s.shift());t.onOpen?.(c)},i.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},i.onerror=c=>{t.onError?.(c)},i.onclose=c=>{if(t.onClose?.(c),!o&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(a,l)}})}return a(),{send(c){let l=typeof c=="string"||c instanceof ArrayBuffer||ArrayBuffer.isView(c)?c:JSON.stringify(c);i&&i.readyState===WebSocket.OPEN?i.send(l):s.push(l)},close(c,l){o=!0;try{i?.close(c,l)}catch{}},get socket(){return i},get readyState(){return i?.readyState??3}}}function _c(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}`}Ze();var lr="application/vnd.webjs+json";async function Ac(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",lr);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 ar(r),n.has("content-type")||n.set("content-type",lr));let o=await fetch(e,{...t,headers:n,body:r}),i=o.headers.get("content-type")||"",s=await o.text(),a=i.includes(lr)?s?pe(s):null:i.includes("application/json")?s?JSON.parse(s):null:s;if(!o.ok){let c=a&&a.error||`richFetch ${e} -> ${o.status}`,l=new Error(c);throw l.status=o.status,l.body=a,l}return a}Ze();Wt();Wt();dr();Kt();var Ur=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 o=()=>{let i=this.updates.findIndex(s=>s.id===r);i!==-1&&(this.updates.splice(i,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>o()).catch(()=>{}):n.then(()=>o(),()=>o())),o}};async function _l(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(i){throw e.set(r),i}return o&&o.success===!1&&e.set(r),o}function Al(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?_l(e,t,n):new Ur(e,t)}mr();gr();var Sl="application/vnd.webjs+stream",vl=1,El=2,Cl=3,ls=new Uint8Array(0);function Nl(e,t){let n=t||ls,r=n.length,o=new Uint8Array(5+r);return o[0]=e&255,o[1]=r>>>24&255,o[2]=r>>>16&255,o[3]=r>>>8&255,o[4]=r&255,r&&o.set(n,5),o}function xl(){let e=ls;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],o=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+o)break;let i=e.slice(5,5+o);n.push({type:r,payload:i}),e=e.slice(5+o)}return n}}}var kl=Symbol.for("webjs.context");function Tl(e){return{__context__:kl,name:e}}var bn=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},Hr=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let i=o;if(i.context===this._context)if(o.stopPropagation(),i.subscribe){let s={callback:i.callback},a=()=>{this._subscriptions.delete(s)};this._subscriptions.add(s),i.callback(this._value,a)}else i.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()}},qr=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 bn(this._context,(n,r)=>{let o=this._value;this._value=n,r&&(this._unsubscribe=r),!Object.is(o,n)&&typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()},this._subscribe);this._host.dispatchEvent(t)}};function jl(){return typeof window<"u"}var J={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},Wr=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=J.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=J.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=J.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=J.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 J.INITIAL:return t.initial?.();case J.PENDING:return t.pending?.();case J.COMPLETE:return t.complete?.(this._value);case J.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!jl())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{qr as ContextConsumer,Hr as ContextProvider,bn as ContextRequestEvent,R as FORM_ACTION_FIELD,Yr as FORM_ACTION_ID_KEY,vl as FRAME_CHUNK,El as FRAME_END,Cl as FRAME_ERROR,C as MARKER,Si as SEED_MISS,Sl as STREAM_CONTENT_TYPE,We as Signal,yc as Suspense,Wr as Task,J as TaskStatus,Ht as WebComponent,fr as WebjsFrame,pr as WebjsStream,Fa as activeActionSignal,wn as adoptStyles,Ha as allTags,bc as asset,Ps as asyncAppend,Is as asyncReplace,Ks as batch,Os as cache,zs as computed,wc as connectWS,Oc as consumeStale,Tl as createContext,xl as createFrameDecoder,Rs as createRef,mc as cspNonce,hs as css,ei as deserialize,Ti as disableClientRouter,Gs as effect,Tr as enableClientRouter,Nl as encodeFrame,Vr as escapeAttr,bs as escapeText,jc as fetchMark,cc as forbidden,ks as guard,ps as html,xn as isAsyncAppend,kn as isAsyncReplace,gn as isCSS,bt as isCache,pc as isForbidden,ht as isGuard,pt as isKeyed,Ua as isLazy,dt as isLive,fc as isNotFound,dc as isRedirect,mt as isRef,ft as isRepeat,Ys as isSignal,gc as isSuspense,L as isTemplate,Nn as isTemplateContent,hc as isUnauthorized,Cn as isUnsafeHTML,yt as isUntil,gt as isWatch,xs as keyed,Ns as live,Da as lookup,Ba as lookupModuleUrl,br as markStale,ji as navigate,ac as notFound,Al as optimistic,pe as parse,yr as parseTagHeader,$a as primeModuleUrl,sc as prop,uc as redirect,js as ref,sr as register,Rc as registerKeyTags,xe as render,hr as renderStream,lo as repeat,Ri as revalidate,Ac as richFetch,Vt as scanSeeds,Zo as serialize,$t as setActiveActionSignal,Vs as signal,ar as stringify,ms as stylesToString,Je as tagOf,kc as takeSeed,Ts as templateContent,lc as unauthorized,Cs as unsafeHTML,Ls as until,Ms as watch};
1
+ var Cs=Object.defineProperty;var F=(e,t)=>()=>(e&&(t=e(e=0)),t);var oo=(e,t)=>{for(var n in t)Cs(e,n,{get:t[n],enumerable:!0})};function Ke(e){return Object.prototype.hasOwnProperty.call(xn,e)}var xn,Tn=F(()=>{xn=Object.freeze({"@":"event",".":"prop","?":"bool"})});function Ts(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function io(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var gt=F(()=>{});function jn(e){if(typeof e!="function")return null;let t=e[so];return typeof t=="string"&&t?t:null}function Rn(e,t,n){if(typeof e!="function")return!1;let r=String(t).toLowerCase(),o=String(n||"").toLowerCase();return r==="action"?o==="form":r==="formaction"?o==="button"||o==="input":!1}function ao(e,t,n=!0){if(!e||e===O&&n)return;let r=e===O?'a second "name" attribute':`name="${e}"`;throw new Error(`[webjs] formaction=\${action} on <${t||"button"}> cannot be used when the element already carries a "name" attribute (found ${r}). The action identity is submitted as the button's own name/value pair, so there is no room for a second one. Move the action to the enclosing <form action=\${action}> or drop the submitter's "name".`)}function co(e,t){let n=String(e||"").toLowerCase(),r=t==null?null:String(t).toLowerCase();if(js(n,r)){if(n==="input"&&r==="image")throw new Error('[webjs] formaction=${action} is not supported on <input type="image"> because image submitters submit coordinate pairs (name.x/name.y) instead of name=value, so the action identity would never arrive. Use a <button> instead.');if(n==="input")throw new Error('[webjs] formaction=${action} is not supported on <input type="submit"> because the action identity has to occupy the submitter\'s "value", which on this control is also its visible label, so the button would render captioned with the action\'s id and could not be given a real one. Use <button formaction=${action}>Publish</button>, whose label is its children.');return}throw new Error(`[webjs] formaction=\${action} on <${n}>${r?` type="${r}"`:""} requires a submitter control, and formaction is inert on anything else. Use <button formaction=\${action}>.`)}function js(e,t){let n=t==null?null:String(t).toLowerCase();return e==="button"?n==null||n===""||n==="submit":e==="input"?n==="submit"||n==="image":!1}function lo(e){throw new Error(`[webjs] formaction=\${action} on <${e||"button"}> cannot be used when the element already carries a "value" attribute. The action identity is submitted as the button's own name/value pair, so both halves are taken. Drop the "value", or dispatch on it from one form-level action instead.`)}function uo(e){throw new Error(`[webjs] a bound formaction=\${action} on <${e||"button"}> cannot also carry a plain formaction attribute: the two name different targets and the renderers resolve them differently. Drop the static attribute.`)}function fo(e){throw new Error(`[webjs] formaction=\${action} on <${e||"button"}> cannot be used with a "form" attribute, which re-points the submitter at a form other than the bound one it sits in. Keep the submitter inside its bound <form>.`)}function po(e,t){if(e)throw new Error(`[webjs] two formaction=\${action} holes were found on one <${t||"button"}>. Only one can win, and the two renderers pick differently, so bind exactly one action per submitter.`)}function ho(e,t){let r=(e||[]).filter(o=>On(o))[0];if(r)throw new Error(`[webjs] a <${t||"button"}> submitter binds .${r}=. That property is a reflected IDL attribute on a submitter, so a property binding is dropped at SSR and written to the attribute in the browser: the page would render on the server and throw on hydration. Write it as a plain attribute.`)}function On(e){let t=String(e).toLowerCase();return t==="name"||t==="value"||t==="formaction"||t==="formmethod"||t==="formenctype"}function Rs(e,t,n){let r=t==null?null:String(t),o=n==null?null:String(n);if(r!=null&&/^dialog$/i.test(r))throw new Error(`[webjs] formaction=\${action} on <${e}> cannot be combined with formmethod="dialog", which dismisses a <dialog> instead of submitting, so the bound action would never run. Drop one of the two.`);if(r!=null&&!/^post$/i.test(r))throw new Error(`[webjs] <${e} formmethod="${r}" formaction=\${action}> cannot work: a bound server action is submitted as a POST body, and a "${r}" submission sends none, so the action would never run. Drop the formmethod attribute (WebJs emits formmethod="post" on a bound submitter), or drop the binding.`);if(o!=null&&!bo.has(o.toLowerCase()))throw new Error(`[webjs] <${e} formenctype="${o}" formaction=\${action}> cannot work: a form submission is parsed as multipart/form-data or application/x-www-form-urlencoded, and a "${o}" body is neither, so the bound action could never read it. Drop the formenctype attribute (WebJs emits multipart/form-data on a bound submitter).`)}function Ye(e,t,n){if(wt(e)&&$s(t))throw new Error(Ds(t,n))}function mo(e,t,n){Fs(t,n)&&Ye(e,t,n)}function Ln(e,t){if(e)return e;let n=t==="button"||t==="input"?"formaction=":"action=";throw new Error(`[webjs] the function in ${n} on <${t||"form"}> is not a server action. Only a function imported from a 'use server' *.server.{js,ts} module can be bound to a form or a submitter, because the identity the browser submits has to resolve back to something the server can run. Move the handler into a server action and import it, or pass a url string.`)}function Os(e,t){if(e!=null&&!/^post$/i.test(e))throw new Error(`[webjs] <form method="${e}" action=\${action}> cannot work: a bound server action is submitted as a POST body, and a "${e}" form sends no body. Drop the method attribute (WebJs emits method="post") or remove the bound action.`);if(t!=null&&!bo.has(t.toLowerCase()))throw new Error(`[webjs] <form enctype="${t}" action=\${action}> cannot work: a form submission is parsed as multipart/form-data or application/x-www-form-urlencoded, and a "${t}" body is neither, so the submission would run under JS and do nothing without it. Drop the enctype attribute (WebJs emits multipart/form-data).`)}function Ls(e){if(e.duplicateAction)throw new Error("[webjs] two action=${...} holes were found on one <form>. A form can carry only one action binding. Move one to a submit button's formaction=${action} or remove the duplicate.");if(e.staticAction)throw new Error('[webjs] a bound <form action=${action}> also carries a plain action="..." attribute. A bound form posts to the page\'s own url, so the two say different things: without JS the browser would post to the written url and with JS it would not. Drop the action attribute, or drop the binding.');let t=e.propAttrs&&e.propAttrs[0];if(t)throw new Error(`[webjs] a bound <form action=\${action}> also binds .${t}=. A property binding on a native element is dropped at SSR and applied in the browser, so the form would submit one way with JS and another way without it. Write it as a plain attribute.`)}function Ps(e,t){let n=e!==$&&e!=null,r=t!==$&&t!=null;return Os(n?e:null,r?t:null),{method:n?null:"post",enctype:r?null:"multipart/form-data"}}function yo(e,t,n){let r=t!==$&&t!=null,o=n!==$&&n!=null;return Rs(e,r?t:null,o?n:null),{formMethod:r?null:"post",formEnctype:o?null:"multipart/form-data"}}function go(e,t,n,r,o){let i=typeof t=="function"?jn(t):null;if(!i){typeof t=="function"&&Ln(null,e.localName),Is(e,n,r,o.propAttrs);return}Ls(o);let s=Ps(n,r);e.removeAttribute("action"),ze(e,"method",n,s.method),ze(e,"enctype",r,s.enctype),Ms(e,i)}function ze(e,t,n,r){if(r!==null){e.setAttribute(t,r);return}n!==$&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Ms(e,t){let n=e.firstElementChild,r=n&&n.localName==="input"&&n.getAttribute("name")===O?n:null;if(!r){for(let o of e.children)if(o.localName==="input"&&o.getAttribute("name")===O){r=o;break}}r||(r=e.ownerDocument.createElement("input"),r.setAttribute("type","hidden"),r.setAttribute("name",O),e.insertBefore(r,e.firstChild)),r.getAttribute("value")!==t&&r.setAttribute("value",t)}function Is(e,t,n,r){let o=e.firstElementChild;if(o&&o.localName==="input"&&o.getAttribute("name")===O)o.remove();else for(let s of e.children)if(s.localName==="input"&&s.getAttribute("name")===O){s.remove();break}let i=s=>(r||[]).some(a=>{let c=String(a).toLowerCase();return c===s||s==="enctype"&&c==="encoding"});t===$&&!i("method")&&e.removeAttribute("method"),n===$&&!i("enctype")&&e.removeAttribute("enctype")}function wo(e,t,n,r){let o=i=>(r||[]).some(s=>String(s).toLowerCase()===i);t===$&&!o("formmethod")&&e.removeAttribute("formmethod"),n===$&&!o("formenctype")&&e.removeAttribute("formenctype")}function Fs(e,t){let n=String(e).toLowerCase();Ke(n[0])&&(n=n.slice(1));let r=String(t||"").toLowerCase();return n==="action"?r==="form":n==="formaction"?r==="button"||r==="input":!1}function wt(e,t){if(typeof e=="function")return!0;if(!Array.isArray(e))return!1;let n=t||new Set;return n.has(e)?!1:(n.add(e),e.some(r=>wt(r,n)))}function $s(e){let t=String(e).toLowerCase();return Ke(t[0])&&(t=t.slice(1)),t==="action"||t==="formaction"}function Ds(e,t){return`[webjs] a function was interpolated into ${String(e).toLowerCase()}= on <${t||"form"}>. Stringifying a function into HTML would leak its source (a 'use server' action's body included) to every visitor, so this is refused. To run a server action from a form, write an unquoted action=\${action} on the <form> itself or a formaction=\${action} on a <button> inside a bound form. Anywhere else, pass a URL string.`}var O,so,bo,$,Ge=F(()=>{Tn();gt();O="__webjs_action",so="$$webjsAction";bo=new Set(["multipart/form-data","application/x-www-form-urlencoded"]);$=Symbol("webjs.attr.absent")});function Ro(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function ha(){if(No||(ie=Ro(),!ie))return;Ze=HTMLSlotElement.prototype.assignedNodes,zn=HTMLSlotElement.prototype.assignedElements,Lt=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(k)&&!Gn(this)?er(this,n):Ze?Ze.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(k)&&!Gn(this)?er(this,n).filter(r=>r.nodeType===1):zn?zn.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=Lt&&Lt.get?Lt.get.call(this):null;return n||xo(this)}});let e=Object.getOwnPropertyDescriptor(Text.prototype,"assignedSlot");Object.defineProperty(Text.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=e&&e.get?e.get.call(this):null;return n||xo(this)}}),Yn=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(k)&&!Gn(this)){let r=ma(this);if(r){let o=Q(r);o.manualAssign||(o.manualAssign=new Map);let i=n.filter(Boolean);for(let[s,a]of o.manualAssign){if(s===this)continue;let c=a.filter(l=>{let u=l.deref();return u!==void 0&&i.indexOf(u)===-1});c.length!==a.length&&(c.length?o.manualAssign.set(s,c):o.manualAssign.delete(s))}if(i.length?o.manualAssign.set(this,i.map(s=>new WeakRef(s))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let s of i)o.pendingRecordNodes.add(s);else o.pendingRecordNodes=new Set(i);xe(o),Z(r)}return}return Yn?Yn.apply(this,n):void 0},No=!0}function ir(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let i=!1,s=o.filter(a=>{let c=a.deref();return c===void 0?!1:(c===t&&(i=!0),!0)});if(s.length!==o.length&&(s.length?n.set(r,s):n.delete(r)),i){let a=e.host;return a&&(r===a||a.contains(r))?r:null}}return null}function ma(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[v])return X(t,e)?t:null;return null}function Gn(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.nodeType===11&&r.host)return!0;t=r}return!1}function er(e,t){if(e.getAttribute(I)!==V)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:tr(n,new Set,0)}function tr(e,t,n){if(n>=pa)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let i=o;if(t.has(i))continue;if(t.add(i),i.hasAttribute(k)){let s=er(i,{flatten:!1});if(s.length>0)for(let a of tr(s,t,n+1))r.push(a);else for(let a of tr(Array.from(i.childNodes),t,n+1))r.push(a)}else if(Ze){let s=Ze.call(i,{flatten:!0});for(let a of s)r.push(a)}else r.push(o)}else r.push(o);return r}function xo(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(k)&&t.getAttribute(I)===V?t:null}function Q(e){let t=e,n=t[v];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[v]=n),n}function sr(e){return!!e[v]}function Oo(e){let t=Q(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),_.add(n),e.removeChild(n)}xe(t)}function xe(e){let t=e.assignedByName;t.clear();for(let n of e.authored)ba(t,de(e,n),n)}function de(e,t){let n=ir(e,t);if(n)return H(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return Po(t)}function Lo(e){let t=Q(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${k}]`);for(let o of r){let i=o;if(!X(e,i)||i.getAttribute(I)!==V||Dt(t,e,i))continue;let s=H(i.getAttribute("name"));if(!n.has(s)){n.add(s);let a=Array.from(i.childNodes);for(let c of a)t.authored.push(c),Po(c)!==s&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(c,s));t.lastSnapshot.set(i,a.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if(X(e,o)){for(let i of Array.from(o.childNodes))_.add(i),t.authored.push(i);o.remove()}xe(t)}function H(e){return e==null||e===""||e==="default"?null:e}function Po(e){return e.nodeType!==1?null:H(e.getAttribute("slot"))}function ba(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function me(e,t,n){let r=Q(e),o=H(t),i=Array.isArray(n)?n.filter(Boolean):n?[n]:[],s=r.authored.findIndex(c=>de(r,c)===o),a=r.authored.filter(c=>de(r,c)===o);r.authored=r.authored.filter(c=>de(r,c)!==o),(s===-1||s>r.authored.length)&&(s=r.authored.length);for(let c of i)c.nodeType===1&&!ir(r,c)&&(o==null?c.removeAttribute("slot"):c.setAttribute("slot",o)),_.add(c);if(r.authored.splice(s,0,...i),r.applying&&r.pendingRecordNodes){for(let c of a)r.pendingRecordNodes.add(c);for(let c of i)r.pendingRecordNodes.add(c)}else r.pendingRecordNodes=new Set([...a,...i]);if(r.adoptedKey){for(let c of a)r.adoptedKey.delete(c);for(let c of i)r.adoptedKey.delete(c)}xe(r),Z(e)}function ya(){oe||!ie||(oe=Node.prototype.appendChild,Mo=Node.prototype.insertBefore,Ne=Node.prototype.removeChild,nr=Node.prototype.replaceChild,Io=Element.prototype.append,Fo=Element.prototype.prepend,$o=Element.prototype.replaceChildren,Pt=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),rr=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function Ft(e,t){let n=e[T];e[T]=!0;try{return t()}finally{e[T]=n,n||ar(e)}}function Do(e){if(!ie)return;let t=e,n=Q(e);n.backstop||(n.backstop=new MutationObserver(r=>$t(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>Bo(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function $t(e,t,n){let r=e,o=r[he],i=r[Symbol.for("webjs.instance")],s=!1,a=new Set;for(let c of n){for(let l of c.addedNodes)if(a.add(l),l!==o&&!(i&&qo(i,l))){if(t.authored.indexOf(l)!==-1){s=!0;continue}_.add(l),t.authored.push(l),s=!0}for(let l of c.removedNodes){let u=t.authored.indexOf(l);if(u===-1||e.contains(l))continue;_.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(u,1),s=!0)}}s&&Z(e)}function ar(e){let t=e,n=t[v];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&$t(e,n,r)}function Bo(e,t){let n=e[v];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let i=o.target;o.attributeName==="name"?i.tagName==="SLOT"&&i.hasAttribute(k)&&X(e,i)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(i),n.authored.indexOf(i)!==-1&&(r=!0))}r&&Z(e)}function Uo(e){let t=e[v];t&&(t.backstop&&($t(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(Bo(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function Ho(e){if(!ie)return;let t=e,n=t[v];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,i=!o&&n.adopted===!0,s=!1;for(let a of Array.from(e.childNodes))if(a!==t[he]){if(n.authored.indexOf(a)!==-1){s=!0;continue}o&&(!r||qo(r,a))||!o&&i||(_.add(a),n.authored.push(a),s=!0)}s&&Z(e)}function qo(e,t){if(!e||!e.startNode||!e.endNode)return!1;if(t===e.startNode||t===e.endNode)return!0;for(let n=e.startNode.nextSibling;n&&n!==e.endNode;n=n.nextSibling)if(n===t)return!0;return!1}function ga(e){let t=e,n=t[he];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[he]=n),Ft(e,()=>oe.call(e,n))),n}function pe(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function Jn(e,t,n){if(n&&!pe(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!pe(t))throw new TypeError("Failed to execute insertion on the host: parameter is not of type Node.");if(t&&t.nodeType===11){let r=Array.from(t.childNodes);Mt(e,r);for(let o of r)Ne.call(t,o);return r}return Mt(e,[t]),[t]}function Mt(e,t){ke(e,t);for(let n of t){if(!pe(n))throw new TypeError("Failed to execute insertion on the host: parameter is not of type Node.");let r=n.nodeType;if(r!==1&&r!==3&&r!==4&&r!==7&&r!==8&&r!==11)throw new DOMException("Failed to execute insertion on the host: the node type may not be inserted here.","HierarchyRequestError")}}function ke(e,t){for(let n of t)if(n===e||n.nodeType===1&&n.contains(e))throw new DOMException("Failed to execute insertion on the host: the new child contains the parent.","HierarchyRequestError")}function Xn(e,t,n){let r=e.authored;for(let i of t){let s=r.indexOf(i);s!==-1&&r.splice(s,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function Wo(e,t){let n=e[v];return n?Dt(n,e,t):!1}function Dt(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function Qn(e,t){if(_.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[he])return!0;let r=e[v];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(k)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&X(e,n))}function Zn(e,t){let n=[];for(let i of t)pe(i)?i.nodeType===11?n.push({frag:i}):n.push({node:i}):n.push({text:`${i}`});for(let i of n)i.frag?ke(e,Array.from(i.frag.childNodes)):i.node&&Mt(e,[i.node]);let r=e.ownerDocument.createDocumentFragment();for(let i of n)if(i.text!==void 0)oe.call(r,e.ownerDocument.createTextNode(i.text));else if(i.frag){let s=Array.from(i.frag.childNodes);Mt(e,s);for(let a of s)oe.call(r,a)}else i.node&&(ke(e,[i.node]),oe.call(r,i.node));let o=Array.from(r.childNodes);ke(e,o);for(let i of o)Ne.call(r,i);return o}function J(e,t,n){if(t.applying&&t.pendingRecordNodes)for(let r of n||[])t.pendingRecordNodes.add(r);else t.pendingRecordNodes=new Set(n||[]);if(t.adoptedKey&&n)for(let r of n)t.adoptedKey.delete(r);xe(t),Z(e)}function Vo(e){if(!ie)return;let t=e;if(t[To])return;ya(),t[To]=!0;let n=Q(e);t.appendChild=function(r){if(t[T])return oe.call(this,r);let o=Jn(e,r,!1);for(let i of o)_.add(i);return Xn(n,o,null),J(e,n,o),r},t.insertBefore=function(r,o){if(t[T])return Mo.call(this,r,o);if(!pe(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!pe(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(ke(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!Qn(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let i=Jn(e,r,!1);for(let s of i)_.add(s);return Xn(n,i,o||null),J(e,n,i),r},t.removeChild=function(r){if(t[T])return Ne.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return Ne.call(this,r);if(!Qn(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),J(e,n,[r]),r},t.replaceChild=function(r,o){if(t[T])return nr.call(this,r,o);if(n.authored.indexOf(o)===-1)return nr.call(this,r,o);if(!pe(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(ke(e,r.nodeType===11?Array.from(r.childNodes):[r]),!Qn(e,o))throw new DOMException("replaceChild: the node to be replaced is not an assigned child of this host","NotFoundError");if(r===o)return o;let s=Jn(e,r,!1);for(let c of s)_.add(c);for(let c of s){if(c===o)continue;let l=n.authored.indexOf(c);l!==-1&&n.authored.splice(l,1)}let a=n.authored.indexOf(o);return n.authored.splice(a,1,...s),J(e,n,[...s,o]),o},t.append=function(...r){if(t[T])return Io.apply(this,r);let o=Zn(e,r);for(let i of o)_.add(i);Xn(n,o,null),J(e,n,o)},t.prepend=function(...r){if(t[T])return Fo.apply(this,r);let o=Zn(e,r);for(let i of o)_.add(i);for(let i of o){let s=n.authored.indexOf(i);s!==-1&&n.authored.splice(s,1)}n.authored.unshift(...o),J(e,n,o)},t.replaceChildren=function(...r){if(t[T])return $o.apply(this,r);let o=Zn(e,r);for(let s of o)_.add(s);let i=n.authored;n.authored=o.slice(),J(e,n,[...i,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return Pt.get.call(this)},set(r){if(t[T]){Pt.set.call(this,r);return}let o=e.ownerDocument.createElement("div");Pt.set.call(o,r===null?"":`${r}`);let i=Array.from(o.childNodes);for(let a of i)_.add(a);let s=n.authored;n.authored=i,J(e,n,[...s,...i])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return rr.get.call(this)},set(r){if(t[T]){rr.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let s of o)_.add(s);let i=n.authored;n.authored=o,J(e,n,[...i,...o])}})}function Z(e){if(!ie)return;let t=e[v];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||wa;t.pendingRecordNodes=void 0,_a(e,t,n),Aa(e,t),xe(t);let r=[],o=new Set;for(let u of e.querySelectorAll(`slot[${k}]`))if(X(e,u)&&!Dt(t,e,u)){if(!u.hasAttribute(I)&&!(et in u)){o.add(H(u.getAttribute("name")));continue}r.push(u)}let i=new Map;for(let u of r){let f=H(u.getAttribute("name")),d=i.get(f);d||(d=[],i.set(f,d)),d.push(u)}let s=[];for(let[u,f]of i){let d=t.assignedByName.get(u)||[];for(let p=0;p<f.length;p++){let m=f[p],g=d.filter(y=>{let h=ir(t,y);return h?h===m:p===0}),b=g.filter(y=>y===e||y.nodeType===1&&y.contains(e));if(b.length){for(let y of b)_.delete(y);g=g.filter(y=>b.indexOf(y)===-1)}g.length>0?va(t,m,g)&&s.push(m):Ea(t,m)&&s.push(m)}}for(let u of s)ka(t,u);let a=new Set(i.keys());for(let u of o)a.add(u);let c=new Set;for(let u of t.authored)a.has(de(t,u))||c.add(u);let l=e[he];if(l)for(let u of Array.from(l.childNodes))c.has(u)||Ne.call(l,u);if(c.size){let u=ga(e);for(let f of c)f.parentNode!==u&&(_.delete(f),Ft(e,()=>oe.call(u,f)))}if(t.backstop){let u=t.backstop.takeRecords();u.length&&$t(e,t,u)}}while(t.reapply)}finally{t.applying=!1}}}function _a(e,t,n){for(let r of e.querySelectorAll(`slot[${k}][${I}="${V}"]`)){if(!X(e,r)||Dt(t,e,r))continue;let o=r,i=t.lastSnapshot.get(o);if(!i)continue;let s=Array.from(o.childNodes);if(or(s,i))continue;let a=t.authored,c=H(o.getAttribute("name")),l=s.filter(m=>!n.has(m));for(let m of l)a.indexOf(m)===-1&&de(t,m)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(m,c));for(let m of a){if(l.indexOf(m)!==-1||de(t,m)!==c)continue;let g=a.indexOf(m),b=0;for(let y=0;y<l.length;y++){let h=a.indexOf(l[y]);h!==-1&&h<g&&(b=y+1)}l.splice(b,0,m)}let u=new Set(l);for(let m of i)u.add(m);let f=-1,d=0;for(let m of a){if(u.has(m)){f===-1&&(f=d);continue}d+=1}let p=a.filter(m=>!u.has(m));(f===-1||f>p.length)&&(f=p.length),p.splice(f,0,...l),t.authored=p}}function Aa(e,t){let n=e[he];t.authored=t.authored.filter(r=>{if(_.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(k)&&(t.lastSnapshot.has(o)||e.contains(o)&&X(e,o)))})}function Ko(e){if(!ie)return!1;for(let t of e.querySelectorAll(`slot[${k}][${I}]`))if(X(e,t))return!0;return!1}function X(e,t){let n=t[It];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(da):null;if(r){let o=Sa(t,r);if(o)return o===e}for(let o=t.parentElement;o&&o!==e;o=o.parentElement)if(o.tagName.includes("-"))return!1;return!0}function Sa(e,t){let n=t.toLowerCase();for(let r=e.parentElement;r;r=r.parentElement)if(r.tagName.toLowerCase()===n)return r;return null}function va(e,t,n){for(let l of n)_.delete(l);let r=t.getAttribute(I)!==V,o=e.lastSnapshot.get(t)||[],i=r||!or(o,n);if(!r&&or(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),i;let s=t[et];if(r&&s)for(;t.firstChild;)s.appendChild(t.firstChild);let a=new Set(n);for(let l of Array.from(t.childNodes))a.has(l)||t.removeChild(l);let c=t.firstChild;for(let l of n){if(l===c){c=c.nextSibling;continue}t.insertBefore(l,c)}return t.setAttribute(I,V),e.lastSnapshot.set(t,n.slice()),i}function Ea(e,t){let n=t.getAttribute(I)===V;if(t.setAttribute(I,fa),!n)return jo(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return jo(t),!0}function jo(e){let t=e[et];!t||t.childNodes.length===0||e.appendChild(t)}function zo(e,t){if(!sr(e))return;let n=Q(e),r=H(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let i of o)i.parentNode===t&&(_.add(i),t.removeChild(i));n.lastSnapshot.delete(t)}function Ca(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function ka(e,t){e.pendingSlotChanges||(e.pendingSlotChanges=new Set),e.pendingSlotChanges.add(t),!e.slotChangeScheduled&&(e.slotChangeScheduled=!0,queueMicrotask(()=>{e.slotChangeScheduled=!1;let n=e.pendingSlotChanges||new Set;e.pendingSlotChanges=new Set;for(let r of n)Ca(r)}))}function or(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 ie,v,k,I,V,fa,et,It,da,pa,Ze,zn,Lt,Yn,No,T,To,he,_,oe,Mo,Ne,nr,Io,Fo,$o,Pt,rr,wa,Bt=F(()=>{ie=Ro(),v=Symbol("webjs.slot.state"),k="data-webjs-light",I="data-projection",V="actual",fa="fallback",et=Symbol("webjs.slot.fallbackFrag"),It=Symbol("webjs.slot.templateOwner"),da="data-wj-slot-owner",pa=64,Ze=null,zn=null,Lt=null,Yn=null,No=!1;ha();T=Symbol("webjs.slot.rendering"),To=Symbol("webjs.slot.intercepted"),he=Symbol("webjs.slot.park"),_=new WeakSet,oe=null,Mo=null,Ne=null,nr=null,Io=null,Fo=null,$o=null,Pt=null,rr=null;wa=new Set});function ci(e,t,n){rc.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function br(e){return JSON.stringify(await li(e))}function ye(e){return ui(JSON.parse(e))}async function li(e){let t=oc();return await ic(e,t),be(e,t)}function ui(e){return ae(e,lc())}function oc(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function ic(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!fc(r))continue;let o=t.refCount.get(r)||0;if(t.refCount.set(r,o+1),!(o>0)){if(typeof Blob<"u"&&r instanceof Blob){let i=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,i);continue}if(typeof FormData<"u"&&r instanceof FormData){let i=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,i);for(let[,s]of i)typeof s!="string"&&n.push(s);continue}if(Array.isArray(r))for(let i=0;i<r.length;i++)n.push(r[i]);else if(r instanceof Map)for(let[i,s]of r)n.push(i),n.push(s);else if(r instanceof Set)for(let i of r)n.push(i);else if(dc(r))for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&n.push(r[i])}}for(let[r,o]of t.refCount)o>1&&t.idOf.set(r,t.nextId++)}function be(e,t){if(e===null)return null;if(e===void 0)return{[A]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[A]:"NaN"}:e===1/0?{[A]:"Inf"}:e===-1/0?{[A]:"-Inf"}:Object.is(e,-0)?{[A]:"-0"}:e;if(n==="bigint")return{[A]:"BigInt",v:e.toString()};if(n==="symbol"){let i=Symbol.keyFor(e);if(i===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[A]:"Sym",v:i}}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{[A]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[A]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[A]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let i=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[A]:"File",v:st(i),n:e.name,t:e.type||"",m:e.lastModified}:o={[A]:"Blob",v:st(i),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let i=t.fdEntries.get(e)||[...e.entries()],s=[];for(let[a,c]of i)s.push([a,be(c,t)]);o={[A]:"FD",v:s}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=sc(e);else if(e instanceof Map){let i=[];for(let[s,a]of e)i.push([be(s,t),be(a,t)]);o={[A]:"Map",v:i}}else if(e instanceof Set){let i=[];for(let s of e)i.push(be(s,t));o={[A]:"Set",v:i}}else if(Array.isArray(e))o=e.map(i=>be(i,t));else{o={};for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let s=pc(i)?"_"+i:i;ci(o,s,be(e[i],t))}}if(r!==void 0){if(Array.isArray(o))return{[A]:"Arr",_id:r,v:o};o._id=r}return o}function sc(e){if(e instanceof ArrayBuffer)return{[A]:"buf",v:st(new Uint8Array(e))};if(e instanceof DataView)return{[A]:"dv",v:st(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=ac[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[A]:n,v:st(r)}}function lc(){return{refs:new Map}}function ae(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let i=[];for(let s=0;s<e.length;s++)i.push(ae(e[s],t));return i}let n=e[A];if(typeof n=="string")return uc(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i)||i==="_id")continue;let s=hc(i)?i.slice(1):i;ci(r,s,ae(e[i],t))}return r}function uc(e,t,n){let r=e._id,o=i=>(typeof r=="number"&&n.refs.set(r,i),i);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 o(BigInt(e.v));case"Sym":return o(Symbol.for(e.v));case"Date":return o(e.v==null?new Date(NaN):new Date(e.v));case"Error":{let i=new Error(e.v.message);return i.name=e.v.name,e.v.stack&&(i.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,i),i}case"Map":{let i=new Map;typeof r=="number"&&n.refs.set(r,i);for(let[s,a]of e.v)i.set(ae(s,n),ae(a,n));return i}case"Set":{let i=new Set;typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.add(ae(s,n));return i}case"Arr":{let i=[];typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.push(ae(s,n));return i}case"Ref":{let i=n.refs.get(e.v);if(i===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return i}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let i=it(e.v);return o(new Blob([i],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let i=it(e.v);return o(new File([i],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 i=new FormData;o(i);for(let[s,a]of e.v){let c=ae(a,n);i.append(s,c)}return i}default:{if(t==="buf"){let s=it(e.v);return o(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength))}if(t==="dv"){let s=it(e.v);return o(new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)))}let i=cc[t];if(i){let s=it(e.v),a=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);return o(new i(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function fc(e){return e!==null&&typeof e=="object"}function dc(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function pc(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function hc(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function st(e){if(fi)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 it(e){if(fi){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 A,rc,ac,cc,fi,at=F(()=>{A="_$wj",rc=new Set(["__proto__","constructor","prototype"]);ac={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},cc={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};fi=typeof Buffer<"u"&&typeof Buffer.from=="function"});var Ci={};oo(Ci,{observeLazy:()=>Ic,observeViewportOnce:()=>Dc});function Ei(e){let t=wr.get(e);return t||(t=import(e).finally(()=>wr.delete(e)),wr.set(e,t),t)}function Ic(e){for(let[t,n]of Object.entries(e))ge.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of ge.values())Ei(t);ge.clear();return}lt||(lt=new IntersectionObserver(Fc,{rootMargin:"200px"})),vi(),typeof MutationObserver<"u"&&new MutationObserver(()=>vi()).observe(document.body,{childList:!0,subtree:!0})}function vi(){if(!(!lt||!ge.size))for(let e of ge.keys())for(let t of document.querySelectorAll(e))lt.observe(t)}function Fc(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=ge.get(n);r&&(Ei(r),ge.delete(n),lt?.unobserve(t.target))}}function $c(e){for(let t of e){if(!t.isIntersecting)continue;let n=Qt.get(t.target);Qt.delete(t.target),ct?.unobserve(t.target),n&&n()}}function Dc(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(ct||(ct=new IntersectionObserver($c,{rootMargin:"200px"})),Qt.set(e,t),ct.observe(e),()=>{Qt.delete(e),ct?.unobserve(e)})}var ge,lt,wr,ct,Qt,ki=F(()=>{ge=new Map,lt=null,wr=new Map;ct=null,Qt=new WeakMap});var _r,Ar=F(()=>{_r=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(()=>(ki(),Ci)).then(({observeViewportOnce:o})=>{this._webjsLoadedSrc!==n||!this.isConnected||(this._webjsLazyTeardown=o(this,()=>{this._webjsLazyTeardown=null,this._webjsLoad(n)}))})):(this._webjsLoadedSrc=n,this._webjsLoad(n))}_webjsLoad(t){Promise.resolve().then(()=>(Zt(),Ni)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&_r&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",_r)});function Uc(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 vr(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let i=n.createElement("template");i.innerHTML=e,r=i.content}else if(e&&e.nodeType)r=e;else return;let o=r.querySelectorAll?Array.from(r.querySelectorAll("webjs-stream")):[];if(o.length)for(let i of o)n.body.append(i);else n.body.append(r)}var Bc,Sr,en=F(()=>{Bc=new Set(["append","prepend","before","after","replace","update"]);Sr=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=[],o=this.getAttribute("target");if(o){let s=n.getElementById(o);s&&(r=[s])}else{let s=this.getAttribute("targets");if(s)try{r=Array.from(n.querySelectorAll(s))}catch{r=[]}}let i=Bc.has(t)?this.querySelector("template"):null;try{for(let s of r){let a=i?i.content.cloneNode(!0):null;Uc(t,s,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&Sr&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",Sr)});var xi,Ti=F(()=>{xi=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&xi&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",xi)});function tn(e,t){let n=typeof document<"u"?document:null,r=e||n;if(!r||typeof r.querySelectorAll!="function")return;if(t&&t.frame===!0){Er(r,!0);return}Oi();let o=r===n,i=!!n&&!o&&typeof n.contains=="function"&&n.contains(r),s=!!n&&!o&&!i;s&&(Er(n,!0),ce.clear(),kr.clear()),(o||s)&&(Cr=!0);let a=j.ingested+j.replaced;Wc(Er(r),a)}function Er(e,t){let n=null;for(let r of e.querySelectorAll('script[type="application/json"]#__webjs-seeds, script[type="application/json"][data-webjs-seeds]')){let o=qc(r.getAttribute?.("data-webjs-dev"));o!==null&&(n=o),ji(t?null:r.textContent,r)}for(let r of e.querySelectorAll("[data-webjs-seed]"))ji(t?null:r.getAttribute("data-webjs-seed"),r,()=>r.removeAttribute("data-webjs-seed"));return n}function ji(e,t,n){if(e)try{let r=ye(e);if(r&&typeof r=="object")for(let o in r){ce.has(o)?j.replaced++:j.ingested++,ce.set(o,r[o]);let i=o.indexOf("/",o.indexOf("/")+1);i>0&&kr.add(o.slice(0,i))}}catch{}n?n():t.remove?.()}function qc(e){return typeof e!="string"?null:e||"ok"}function Wc(e,t){if(e===null)return;let n=++Hc;Pe={epoch:n,hits:j.hits,misses:j.misses,keyMisses:j.keyMisses,merged:t,marker:e};let r=()=>{!Pe||Pe.epoch!==n||Oi()};try{typeof requestIdleCallback=="function"?requestIdleCallback(r,{timeout:1e3}):setTimeout(r,250)}catch{Pe=null}}function Oi(){let e=Pe;if(Pe=null,!!e)try{Vc(e)}catch{}}function Vc(e){let t=j.hits-e.hits,n=j.misses-e.misses,r=j.ingested+j.replaced-e.merged,o=j.keyMisses-e.keyMisses;if(n===0)return;let i=e.marker==="streamed"?"This page streams (a Suspense or <webjs-suspense> boundary), and a streamed render emits no seeds, so every action call on it goes to the network.":e.marker==="drop"?"The page's seeds could not be serialized, so the whole block was dropped. Something an action returned is not serializer-safe; the server response reports collected above emitted.":o===0?null:"The key is the action file hash plus the function name plus the serialized arguments, so an argument the SSR render never used misses (a deliberate refetch after hydration misses too, and is expected). A miss on an action this page never seeded is NOT counted here, because a mutation or a client-only read could never have been seeded.";if(i===null)return;let a=e.marker==="streamed"||e.marker==="drop"?`${n} of ${t+n} action call(s) in the hydration window went to the network`:`${o} action call(s) in the hydration window asked for a key this page seeded under DIFFERENT arguments`;console.warn(`[webjs] SSR action seeding: ${a} (${r} seed(s) on this page, ${ce.size} still unconsumed). ${i} See https://webjs.dev/docs/data-fetching for the seeding reference.`)}function Kc(e,t,n){Cr||(Cr=!0,tn());let r=`${e}/${t}/${n}`;if(ce.has(r)){let o=ce.get(r);return ce.delete(r),j.hits++,o}return j.misses++,kr.has(`${e}/${t}`)&&j.keyMisses++,Ri}function zc(){return{...j,pending:ce.size}}var ce,Ri,Cr,j,kr,Pe,Hc,Nr=F(()=>{at();ce=new Map,Ri=Symbol("webjs.seed.miss"),Cr=!1,j={ingested:0,replaced:0,hits:0,misses:0,keyMisses:0},kr=new Set,Pe=null,Hc=0});function xr(e){if(!(!Array.isArray(e)||!e.length)){nn+=1;for(let t of e)t&&Li.set(t,nn)}}function Gc(){return nn}function Jc(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(Me.delete(e),Me.set(e,{tags:t.slice(),since:typeof n=="number"?n:nn}),Me.size>Yc)){let r=Me.keys().next().value;r!==void 0&&Me.delete(r)}}function Xc(e){let t=Me.get(e);if(!t)return!1;for(let n of t.tags)if((Li.get(n)||0)>t.since)return!0;return!1}function Tr(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var nn,Li,Me,Yc,jr=F(()=>{nn=0,Li=new Map,Me=new Map,Yc=1e3});var Ni={};oo(Ni,{_FALLBACK_MARKER_KEY:()=>cn,_FRAME_TOP:()=>Qi,_LIVE_ATTRS:()=>Fr,_activateSwappedRange:()=>Zr,_activeFrameId:()=>Xi,_addNewHeadElements:()=>Dr,_applyOptimisticLoading:()=>Jr,_applyStreamedResolve:()=>_s,_applySwap:()=>Gr,_blurOutgoingFocus:()=>sn,_buildHaveHeader:()=>yt,_buildSubmitFormData:()=>Gi,_bumpNavToken:()=>$l,_clearFormBusy:()=>hs,_clearFrameBusy:()=>ds,_collectBoundaries:()=>qe,_currentPageUrl:()=>Dl,_diffElementInPlace:()=>mn,_eligibleAnchorHref:()=>un,_encodeSubmitBody:()=>Yi,_findAnchorInPath:()=>Ji,_getSubmitAction:()=>Ki,_getSubmitEnctype:()=>zi,_getSubmitMethod:()=>Vi,_isNonHtmlPath:()=>ql,_isPreBootNavigation:()=>es,_keyOf:()=>He,_markFormBusy:()=>ps,_markFrameBusy:()=>fs,_mergeHead:()=>ys,_navToken:()=>Fl,_onPopState:()=>Hr,_onSubmit:()=>qr,_parseHTML:()=>Br,_planBoundarySwap:()=>ts,_prefetch:()=>We,_prefetchAnchor:()=>as,_prefetchCache:()=>S,_prefetchHasHoverPointer:()=>is,_prefetchInflightSize:()=>Pl,_prefetchMode:()=>fn,_prefetchPeek:()=>Ll,_prefetchSaysSaveData:()=>Kr,_prefetchSuppressed:()=>ss,_prefetchTake:()=>cs,_reactivateScripts:()=>wn,_readStreamedShell:()=>gs,_reconcileChildren:()=>vn,_regraftPermanentElements:()=>ms,_regraftPermanentInSlice:()=>Sn,_resetParseProbe:()=>Zc,_resetPrefetch:()=>Ml,_resetWarnOnce:()=>Ul,_resolveTargetFrameId:()=>Wr,_restoreOptimistic:()=>ut,_runWithTransition:()=>on,_setCurrentPageUrl:()=>Bl,_setHardNavigate:()=>Il,_shouldFullLoadDuringParse:()=>Hl,_snapshotCache:()=>R,_streamBoundariesProgressively:()=>As,_takeResolveUnit:()=>ws,_viewTransitionsEnabled:()=>Yr,collectBoundaries:()=>qe,disableClientRouter:()=>Ui,enableClientRouter:()=>Ur,loadFrame:()=>il,navigate:()=>Hi,planBoundarySwap:()=>ts,revalidate:()=>qi});function Br(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"&&Qc()?Document.parseHTMLUnsafe(e):el(e)}function Qc(){if(Ie!==null)return Ie;try{Ie=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{Ie=!1}return Ie}function Zc(){Ie=null}function el(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}function tl(){Rr||typeof MutationObserver>"u"||typeof customElements>"u"||(Rr=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 o of r.querySelectorAll("*"))o.tagName?.includes("-")&&customElements.upgrade(o)}}),Rr.observe(document.body,{childList:!0,subtree:!0}))}function Bi(){if(typeof document>"u"||!document.documentElement)return()=>{};q&&q();let e=document.documentElement,t=e.style.getPropertyValue("overflow-anchor");e.style.setProperty("overflow-anchor","none");let n=null,r=()=>{if(q===r){if(q=null,n&&(clearTimeout(n),n=null),typeof window<"u")for(let o of an)window.removeEventListener(o,r,{capture:!0});t?e.style.setProperty("overflow-anchor",t):e.style.removeProperty("overflow-anchor")}};if(q=r,n=setTimeout(r,nl),typeof window<"u")for(let o of an)window.addEventListener(o,r,{capture:!0,passive:!0});return r}function rl(e,t){if(typeof window>"u"||typeof requestAnimationFrame!="function")return;D&&D();let n=0,r=null,o=null,i=()=>{if(D===i){D=null,n&&cancelAnimationFrame(n),r&&(clearTimeout(r),r=null),o&&(o(),o=null);for(let a of an)window.removeEventListener(a,i,{capture:!0})}},s=()=>{if(D!==i)return;if(document.documentElement.scrollHeight-window.innerHeight>=e){window.scrollTo({left:t,top:e,behavior:"instant"}),o=Bi(),n&&(cancelAnimationFrame(n),n=0);return}n=requestAnimationFrame(s)};D=i;for(let a of an)window.addEventListener(a,i,{capture:!0,passive:!0});r=setTimeout(i,Di),n=requestAnimationFrame(s)}function ol(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function Ur(){te||typeof document>"u"||(te=!0,document.addEventListener("click",Wi,!1),document.addEventListener("submit",qr,!1),window.addEventListener("popstate",Hr),document.addEventListener("pointerover",Ue,!0),document.addEventListener("focusin",Ue,!0),document.addEventListener("touchstart",Ue,{capture:!0,passive:!0}),document.addEventListener("pointerout",ls,!0),document.addEventListener("webjs:navigate",Ir),tl(),Ir(),typeof history<"u"&&"scrollRestoration"in history&&(rn=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(G=location.href),cl())}function Ui(){te&&(te=!1,document.removeEventListener("click",Wi,!1),document.removeEventListener("submit",qr,!1),window.removeEventListener("popstate",Hr),document.removeEventListener("pointerover",Ue,!0),document.removeEventListener("focusin",Ue,!0),document.removeEventListener("touchstart",Ue,{capture:!0}),document.removeEventListener("pointerout",ls,!0),document.removeEventListener("webjs:navigate",Ir),An(),zr(),ue&&(ue.disconnect(),ue=null),typeof history<"u"&&rn!==null&&(history.scrollRestoration=rn,rn=null),ft+=1,q&&q(),D&&D(),G=null)}async function Hi(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){_e(e);return}await Vr(n.href,t?.replace??!1,null)}async function il(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};B&&B.abort(),B=new AbortController;let o=B.signal,i=++N;return dn(r.href,n,!1,null,"GET",null,o,i)}function qi(e){if(!e){R.clear(),S.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;R.delete(n),S.delete(n)}function Wi(e){if(!te||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Ji(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||_n.test(r.pathname))return;e.preventDefault();let o=Wr(t);Vr(n,!1,o)}function Hr(e){Vr(location.href,!0,null)}function qr(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 o=Vi(t,n);if(o==="dialog")return;let i=zi(t,n),s=o==="get"||o==="head",a=Ki(t,n),c;try{c=new URL(a,location.href)}catch{return}if(c.origin!==location.origin||_n.test(c.pathname))return;let l=Gi(t,n);if(al(t,n,o,l),!s&&i==="text/plain")return;let u=Yi(l,i);e.preventDefault();let f=Wr(n||t);dl(c.href,o,u,f,t)}function Vi(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function Ki(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function sl(e){let t=String(e||"").toLowerCase();return t==="multipart/form-data"?"multipart/form-data":t==="text/plain"?"text/plain":"application/x-www-form-urlencoded"}function zi(e,t){return sl(t&&t.getAttribute("formenctype")||e.getAttribute("enctype"))}function Yi(e,t){if(t==="multipart/form-data")return e;let n=new URLSearchParams;for(let[r,o]of e)n.append(r,typeof o=="string"?o:o.name);return n}function Gi(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 Ji(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Xi(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 Wr(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===Qi)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Ae(`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 Xi(e)}function Ae(e,t,n="warn"){if(Lr.has(e)||(Lr.add(e),typeof console>"u"))return;let r=n==="error"?console.error:console.warn;r&&r.call(console,t)}function al(e,t,n,r){if(typeof process<"u"&&process.env||!r.has(O))return;let o="";try{o=new URL(e.getAttribute("action")||location.href,location.href).pathname}catch{o=location.pathname}if(n!=="post"){Ae(`submit-nowhere:${o}:${n}`,`[webjs] this submission carries a bound server action's identity but submits as ${n.toUpperCase()}, which sends no body, so the identity rides the query string and the action never runs. A submitter's own formmethod overrides the form's, and WebJs honours it rather than refusing it, so check for a formmethod on the button that was pressed.`,"error");return}let i=t&&t.getAttribute("formenctype")||e.getAttribute("enctype")||"application/x-www-form-urlencoded";if(i.toLowerCase()==="text/plain"){Ae(`submit-nowhere:${o}:${i}`,`[webjs] this submission carries a bound server action's identity but declares enctype="${i}", which the server cannot parse. The router declines to send it so both paths behave the same way, and both are answered with a 405. Drop the enctype and let the binding supply it.`,"error");return}o&&o!==location.pathname&&Ae(`submit-elsewhere:${o}`,`[webjs] this submission carries a bound server action's identity but posts to "${o}" rather than this page, because the enclosing <form> declares its own action. A bound submitter emits no formaction, so the form's target wins, which is what native HTML does. The action runs only if "${o}" is a page route; against a route.ts or another origin the identity is ignored and nothing runs. Drop the form's action attribute to keep the submission on this page.`)}function Zi(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function es(e,t,n,r){if(e!=="navigate"||!t||r&&r===n)return!1;try{return new URL(t).origin===new URL(n).origin}catch{return!1}}function cl(){if(typeof location>"u"||Mi)return;Mi=!0;let e=null;try{e=sessionStorage.getItem(cn),sessionStorage.removeItem(cn)}catch{}let t="";try{let n=performance.getEntriesByType("navigation")[0];t=n?n.type:""}catch{}es(t,document.referrer,location.href,e)&&le("pre-boot-navigation",location.href,!1)}function le(e,t,n=!0){if(n)try{sessionStorage.setItem(cn,t)}catch{}if(typeof document<"u"&&typeof CustomEvent<"u")try{document.dispatchEvent(new CustomEvent("webjs:navigation-fallback",{detail:{cause:e,href:t,willReload:n}}))}catch{}typeof process<"u"&&process.env||Ae(`fallback:${e}`,n?`[webjs] client router fell back to a full page load (${e}) navigating to ${t}. This is correct (no DOM corruption), just not a soft nav.`:`[webjs] client router degraded a soft navigation (${e}) for ${t}, without a full page load.`)}function ll(e){typeof process<"u"&&process.env||Ae(`stream-drop:${e}`,`[webjs] dropped a streamed Suspense resolve for "${e}": no #${e} boundary in the DOM. Benign if this navigation was superseded or degraded. A stuck skeleton here means the shell swap did not place the boundary.`)}function Ii(){if(typeof process<"u"&&process.env||Pr||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;Pr=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&Ae("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 ln(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 qe(e){let t=new Map,n=[],r=!1;function o(i){if(!r){if(i.nodeType===8){let s=i.data.trim();if(s.startsWith("wj:children:")){let a=s.slice(12),c=a.lastIndexOf(":");if(c<=0||c===a.length-1){r=!0;return}let l=a.slice(0,c),u=a.slice(c+1);if(t.has(l)||n.some(f=>f.segment===l)){r=!0;return}n.push({segment:l,routeKey:u,start:i});return}if(s.startsWith("/wj:children")){let a=s.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==i.parentNode){r=!0;return}{let l=c.start.parentNode.tagName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TFOOT"||l==="TR"){r=!0;return}}t.set(c.segment,{routeKey:c.routeKey,start:c.start,end:i});return}return}if(i.hasChildNodes&&i.hasChildNodes())for(let s=i.firstChild;s&&!r;s=s.nextSibling)o(s)}}return o(e),r||n.length>0?null:t}function ts(e,t){let n=[...e.keys()].filter(s=>t.has(s)).sort((s,a)=>s.length-a.length);if(n.length===0)return null;for(let s of n)if(e.get(s).routeKey!==t.get(s).routeKey){let a=null;for(let c of n){if(c===s)break;s.startsWith(c==="/"?c:c+"/")&&(a=c)}return a?{mode:"replace",segment:a,live:e.get(a),incoming:t.get(a)}:null}let r=n[n.length-1],o=s=>{let a=null;for(let c of s.keys())(a===null||c.length>a.length)&&(a=c);return a};return{mode:o(e)===r&&o(t)===r?"morph":"replace",segment:r,live:e.get(r),incoming:t.get(r)}}function ns(e){let t=fe(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),R.has(t)&&R.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(R.set(t,n);R.size>ul;){let r=R.keys().next().value;R.delete(r)}}function fl(e){let t=fe(e),n=R.get(t);return n==null?null:(R.delete(t),R.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function fe(e){let t=new URL(e,location.href);return t.pathname+t.search}async function Vr(e,t,n){if(Zi(t,n)&&typeof location<"u"){le("readyState-loading",e),_e(e);return}B&&B.abort(),B=new AbortController;let r=B.signal,o=++N;n||(ft+=1,q&&q(),D&&D()),G&&ns(G);let i=setTimeout(()=>{ln(!0),i=null},150),s=null;t||(s=Jr());try{if(t){let a=fl(e);if(a){let c=Br(a.html);if(c){Gr(c,n,!0,null);let l=()=>{};if(typeof window<"u"){let d=()=>{window.scrollTo({left:a.scrollX,top:a.scrollY,behavior:"instant"}),window.scrollY>=a.scrollY-1?l=Bi():rl(a.scrollY,a.scrollX)};if(Yr()&&typeof document.startViewTransition=="function"){let p=ft;mt.then(()=>{p!==ft||!te||d()}).catch(()=>{})}else d()}let u=dn(e,n,!1,s,"GET",null,r,o,!0).catch(()=>{}),f=new Promise(d=>setTimeout(d,Di));Promise.all([u,f]).then(()=>ol(l));return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await dn(e,n,!t,s,"GET",null,r,o)}finally{i&&clearTimeout(i),o===N&&(ln(!1),typeof location<"u"&&(G=location.href))}}async function dl(e,t,n,r,o){B&&B.abort(),B=new AbortController;let i=B.signal,s=++N;r||(ft+=1,q&&q(),D&&D());let a=t==="get"||t==="head",c=new URL(e,location.href);if(a){c.search="";for(let[p,m]of n)c.searchParams.append(p,typeof m=="string"?m:m.name)}G&&ns(G);let l=setTimeout(()=>{ln(!0),l=null},150),u=Jr(),f=o?ps(o,s,c.href):null,d=!1;try{let p=await dn(c.href,r,!0,u,a?"GET":t.toUpperCase(),a?null:n,i,s);d=!!(p&&p.ok),!a&&s===N&&(R.clear(),S.clear())}finally{f&&hs(f,s,c.href,d),l&&clearTimeout(l),s===N&&(ln(!1),typeof location<"u"&&(G=location.href))}}function yt(){let e=qe(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}function Kr(){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 is(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function yl(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function un(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||_n.test(n.pathname)?null:t}function ss(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=yl(e);return t.includes("external")||t.includes("no-prefetch")}function fn(e){if(ss(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 is()?"intent":"viewport"}}function We(e){if(!te||typeof fetch!="function"||Kr())return;let t=fe(e);if(typeof location<"u"&&t===fe(location.href)||we.has(t)||dt.has(t))return;let n=S.get(t);if(n&&Mr()-n.at<rs)return;if(we.size>=os){for(dt.add(t),De.push(e);De.length>hl;){let i=De.shift();dt.delete(fe(i))}return}let r=yt();if(!r&&typeof document<"u"&&document.readyState==="loading")return;we.add(t);let o={"x-webjs-router":"1","x-webjs-prefetch":"1"};r&&(o["x-webjs-have"]=r),fetch(e,{method:"GET",headers:o,credentials:"same-origin",cache:"no-cache"}).then(async i=>{let s=i.headers.get("content-type")||"";if(!/^text\/html\b/i.test(s)||i.status>=400)return;let a=i.headers.get("x-webjs-build"),c=i.headers.get("x-webjs-src"),l=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,u=l?l.getAttribute("data-webjs-build"):null,f=l?l.getAttribute("data-webjs-src"):null;(a&&u&&a!==u||c&&f&&c!==f)&&(R.clear(),S.clear());let d=i.redirected&&i.url?i.url:e,p=await i.text();wl(t,{html:p,build:a,src:c,finalUrl:d,at:Mr()})}).catch(()=>{}).finally(()=>{we.delete(t),gl()})}function gl(){for(;De.length&&we.size<os;){let e=De.shift();dt.delete(fe(e)),We(e)}}function wl(e,t){for(S.has(e)&&S.delete(e),S.set(e,t);S.size>pl;){let n=S.keys().next().value;S.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function as(e){let t=/<!--wj:children:([^>]*?)-->/.exec(e||"");return t?t[1]:null}function cs(e,t){let n=fe(e),r=S.get(n);if(!r)return null;if(Mr()-r.at>=rs)return S.delete(n),null;let o=as(r.html);return o&&!new Set(String(t??(yt()||"")).split(",").filter(Boolean)).has(o)?(S.delete(n),null):(S.delete(n),r)}function Mr(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function Ue(e){if(!te)return;let t=us(e.target);if(!t)return;let n=fn(t);if(n==="none"||n==="render")return;let r=un(t);if(r){if(e.type==="touchstart"){We(r);return}n==="intent"&&(pt===t&&Be||(An(),pt=t,Be=setTimeout(()=>{Be=null,pt=null,We(r)},ml)))}}function ls(e){let t=us(e.target);t&&t===pt&&An()}function An(){Be&&(clearTimeout(Be),Be=null),pt=null}function zr(){for(let e of ht)clearTimeout(e);ht.clear(),Fe=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 o=n.closest&&n.closest("a");if(o instanceof HTMLAnchorElement)return o}let r=t.getRootNode?t.getRootNode():null;t=r&&r.host?r.host:null}return null}function Ir(){if(typeof document>"u"||Kr())return;let e=typeof IntersectionObserver<"u";e&&(ue?(ue.disconnect(),zr()):ue=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(Fe.has(r))continue;let o=setTimeout(()=>{ht.delete(o),Fe.delete(r),ue.unobserve(r);let i=un(r);i&&fn(r)==="viewport"&&We(i)},bl);Fe.set(r,o),ht.add(o)}else{let o=Fe.get(r);o&&(clearTimeout(o),ht.delete(o),Fe.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=fn(t);if(n==="render"){let r=un(t);r&&We(r)}else n==="viewport"&&e&&ue.observe(t)}}function _l(e){if(typeof document>"u"||!document.body)return!1;let t=qe(document.body);if(!t)return!1;let n,r=-1;for(let[c,l]of t)c.length>r&&(r=c.length,n=l);if(!n)return!1;let o=n.start.parentNode;if(!o||n.start.parentNode!==n.end.parentNode)return!1;let i=document.createElement("div");i.setAttribute("role","alert"),i.setAttribute("data-webjs-nav-error","");let s=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";i.textContent=s;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),o.insertBefore(i,n.end),!0}function Or(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||_l(t)||typeof location<"u"&&(le("navigation-error-unrecoverable",e),_e(e))}async function dn(e,t,n,r,o,i,s,a,c){o=o||"GET";let l=typeof a=="number"?a:N,u,f=null,d=null,p=null,m=null,g=!1,b=e,y=t?fs(t,l):null;try{try{let w=o==="GET"&&!i&&!t?cs(e,r?r.haveKeys:void 0):null;if(w)u=w.html,d=w.build,p=w.src,b=w.finalUrl,m=200,g=!0;else{let L={"x-webjs-router":"1"},Se=yt();Se&&(L["x-webjs-have"]=Se),t&&(L["x-webjs-frame"]=t),i!=null&&o!=="GET"&&o!=="HEAD"&&(L.accept=Pi+", text/html");let ve={method:o,headers:L,credentials:"same-origin",cache:"no-cache"};s&&(ve.signal=s),i!=null&&o!=="GET"&&o!=="HEAD"&&(ve.body=i);let E=await fetch(e,ve);m=E.status,g=E.ok;let Ve=Tr(E.headers.get("x-webjs-invalidate"));Ve.length&&xr(Ve);let x=E.headers.get("content-type")||"",vs=/^text\/html\b/i.test(x);if(x.toLowerCase().indexOf(Pi)===0){let Es=await E.text();return l===N&&(ut(r),vr(Es)),{ok:g,status:m,aborted:!1}}if(E.redirected&&E.url&&(b=E.url),E.status===204||E.status===205)return l===N&&n&&history.pushState(null,"",b),{ok:g,status:m,aborted:!1};if(!vs)return l===N&&(ut(r),Or(e,E.status,null)),{ok:!1,status:m,aborted:!1};d=E.headers.get("x-webjs-build"),p=E.headers.get("x-webjs-src");let Cn=await gs(E);u=Cn.shell,Cn.streaming&&(f=Cn)}}catch(w){return w&&w.name==="AbortError"?{ok:!1,status:null,aborted:!0}:l!==N?{ok:!1,status:null,aborted:!0}:(ut(r),Or(e,null,w instanceof Error?w:new Error(String(w))),{ok:!1,status:null,aborted:!1})}if(l!==N){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:!1,status:m,aborted:!0}}let h=Br(u);if(!h)return ut(r),Or(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:m,aborted:!1};if(Gr(h,t,!!c,b,d,p)==="discard"){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:g,status:m,aborted:!1}}if(n&&history.pushState(null,"",b),n){let w=new URL(b);if(w.hash){let L=document.getElementById(w.hash.slice(1));L?L.scrollIntoView():(Ii(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else Ii(),window.scrollTo({left:0,top:0,behavior:"instant"})}return f&&(f.reader||f.rest)&&mt.then(()=>As(f.reader,f.dec,f.rest,()=>l===N)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:b,frameId:t,from:"navigate"}})),{ok:g,status:m,aborted:!1}}finally{y&&ds(y,l)}}function fs(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=pn.has(n);return pn.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(pn.get(e)!==t)return;pn.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 ps(e,t,n){let r=hn.has(e);return hn.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(hn.get(e)!==t)return;hn.delete(e),e.setAttribute("aria-busy","false");let o=new CustomEvent("webjs:submit-end",{bubbles:!0,detail:{form:e,url:n,ok:!!r}});e.isConnected?e.dispatchEvent(o):typeof document<"u"?document.dispatchEvent(o):e.dispatchEvent(o)}function Fi(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+=ee(r);return n}function Yr(){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 on(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(Yr()&&typeof n=="function"){let r=n.call(document,e);return r&&r.finished&&typeof r.finished.then=="function"?r.finished.then(()=>{t&&t()}).catch(()=>{}):t&&t(),r&&r.updateCallbackDone&&typeof r.updateCallbackDone.then=="function"?r.updateCallbackDone.catch(()=>{}):Promise.resolve()}return e(),t&&t(),Promise.resolve()}function ms(e,t){if(!e||!t||typeof e.querySelectorAll!="function")return;let n=e.querySelectorAll("[data-webjs-permanent][id]");for(let r of n){let o=r.id;if(!o)continue;let i=null;try{i=t.querySelector(`#${CSS.escape(o)}`)}catch{i=null}if(!i||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let s=i.parentNode;s&&i!==r&&(s.replaceChild(r,i),bt.add(r))}}function Sn(e,t){let n=[];for(let r of e){if(r.nodeType!==1)continue;let o=r;if(o.hasAttribute&&o.hasAttribute("data-webjs-permanent")&&o.id&&n.push(o),typeof o.querySelectorAll=="function")for(let i of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(i)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let i=Al(t,o);if(!i||i===r)continue;let s=i.parentNode;if(s)s.replaceChild(r,i),bt.add(r);else{let a=t.indexOf(i);a!==-1&&(t[a]=r,bt.add(r))}}}function Al(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 o=null;try{o=r.querySelector(`#${CSS.escape(t)}`)}catch{o=null}if(o)return o}}return null}function Sl(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&$e(t)}function Gr(e,t,n,r,o,i){let s=!1,a=()=>{if(!s){s=!0;try{tn(e,{frame:!!t})}catch{}}};try{for(let p of e.querySelectorAll("[data-wj-host]"))p.setAttribute("data-wj-serialized","")}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let p=document.querySelector('script[type="importmap"]'),m=p?p.getAttribute("data-webjs-build"):null,g=!1;if(o&&m&&(g=o!==m),!g&&e.head&&e.head.children.length>0){let b=Fi(document),y=Fi(e);b!==y&&(g=!0)}if(g&&typeof location<"u"){R.clear(),S.clear();try{let b="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(b))sessionStorage.removeItem(b),le("deploy-mismatch-reload-suppressed",r,!1);else{sessionStorage&&sessionStorage.setItem(b,"1"),le("deploy-mismatch",r),_e(r);return}}catch{le("deploy-mismatch",r),_e(r);return}}else if(!g){let b=p?p.getAttribute("data-webjs-src"):null;i&&b&&i!==b&&(R.clear(),S.clear(),p&&p.setAttribute("data-webjs-src",i));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){a();let p=document.querySelector(`webjs-frame#${CSS.escape(t)}`),m=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(p&&m){Dr(e.head),mt=on(()=>{jl(p,m),wn(p),$e(p),$i(e.body),sn()},()=>$e(p));return}let g=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});(p||document).dispatchEvent(g),g.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`);return}let c=qe(document.body),l=qe(e.body),u=c&&l?ts(c,l):null;if(u){a();let{mode:p,live:m,incoming:g}=u;Dr(e.head),mt=on(()=>{p==="replace"?vl(m,g):El(m,g,e),xl(m.start,g.start),$i(e.body),sn()},()=>Sl(m));return}if(r&&!n&&typeof location<"u"){le(c?l?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),_e(r);return}if(r&&n)return le("revalidation-discarded",r,!1),"discard";a(),ys(e.head),ms(document.body,e.body);let f=[...e.body.childNodes];mt=on(()=>{document.body.replaceChildren(...f),wn(document.body),$e(document.body),sn()},()=>$e(document.body))}function sn(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function vl(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)r.push(i);let o=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)o.push(document.importNode(i,!0));Sn(r,o);for(let i of r)i.parentNode===n&&n.removeChild(i);for(let i of o)n.insertBefore(i,e.end);Zr(e)}function El(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)o.push(s);let i=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)i.push(document.importNode(s,!0));Sn(o,i),Cl(r,e.start,e.end,o,i),Zr(e)}function Cl(e,t,n,r,o){let i=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=He(c);l&&i.set(l,c)}let s=n,a=[];for(let c of o){if(c.nodeType===1){let l=He(c);if(l&&i.has(l)){let u=i.get(l);mn(u,c),a.push(u),i.delete(l);continue}}a.push(c)}for(let c of r)if(c.parentNode===e){if(c.nodeType===1&&a.includes(c))continue;e.removeChild(c)}for(let c of a)e.insertBefore(c,s)}function mn(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),!Fr.has(r.name)&&r.name!=="data-wj-serialized"&&e.getAttribute(r.name)!==r.value&&e.setAttribute(r.name,r.value);for(let r of[...e.attributes])Fr.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(kl(e)){Tl(e,t);return}vn(e,t)}function kl(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[v]!=null}function Nl(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function bn(e){let t=new Map,n=`slot[${k}][${I}="${V}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!Nl(o,e)||Wo(e,o))continue;let i=!1;for(let a=o.parentElement;a&&a!==e;a=a.parentElement)if(a.tagName==="SLOT"&&a.hasAttribute(k)&&a.getAttribute(I)===V){i=!0;break}if(i)continue;let s=H(o.getAttribute("name"));t.has(s)||t.set(s,o)}return t}function xl(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(k))return;let o=null;for(let f=r.parentElement;f;f=f.parentElement){if(f[v]){o=f;break}if(f.tagName.includes("-"))return}if(!o)return;let i=H(r.getAttribute("name"));me(o,i,[...r.childNodes]);let s=t.parentNode;if(!s||s.nodeType!==1)return;let a=s;if(a.tagName!=="SLOT")return;let c=null;for(let f=a.parentElement;f;f=f.parentElement)if(f.tagName.includes("-")){c=f;break}if(!c||c.tagName!==o.tagName)return;let l=bn(o),u=bn(c);for(let f of new Set([...l.keys(),...u.keys()])){if(f===i)continue;let d=u.get(f);d?me(o,f,[...d.childNodes].map(p=>document.importNode(p,!0))):l.get(f)&&me(o,f,null)}}function Tl(e,t){if(!e[v])return;let n=bn(e),r=bn(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let i of o){let s=n.get(i),a=r.get(i);s&&a?(vn(s,a),me(e,i,[...s.childNodes])):a?me(e,i,[...a.childNodes].map(c=>document.importNode(c,!0))):me(e,i,null)}}function vn(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));Sn(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=He(a);c&&o.set(c,a)}let i=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=He(c);if(l&&o.has(l)){let f=o.get(l);mn(f,c),i.push(f),o.delete(l);continue}let u=n[a];if(u&&u.nodeType===1&&!He(u)&&u.tagName===c.tagName){mn(u,c),i.push(u);continue}}else if(c.nodeType===3){let l=n[a];if(l&&l.nodeType===3){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),i.push(l);continue}}else if(c.nodeType===8){let l=n[a];if(l&&l.nodeType===8){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),i.push(l);continue}}i.push(c)}let s=new Set(i);for(let a of n)!s.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<i.length;a++){let c=i[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function He(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Jr(){let e=qe(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((c,l)=>l.length-c.length),n=null,r=null;for(let c of t){let l=document.getElementById(`wj-loading:${c}`);if(l instanceof HTMLTemplateElement){n=c,r=l;break}}if(n===null||r===null)return null;let o=e.get(n),i=yt(),s=[];for(let c=o.start.nextSibling;c&&c!==o.end;c=c.nextSibling)s.push(c);let a=document.createRange();return a.setStartAfter(o.start),a.setEndBefore(o.end),a.deleteContents(),o.start.parentNode.insertBefore(r.content.cloneNode(!0),o.end),{slot:o,oldChildren:s,token:N,haveKeys:i}}function ut(e){if(!e||e.token!==N)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 o of n)t.start.parentNode.insertBefore(o,t.end)}function jl(e,t){vn(e,t)}function bs(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function yn(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=bs();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Xr(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=bs();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function ee(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function gn(e){let t=e.getAttribute("name");if(t)return"name="+t;let n=e.getAttribute("property");if(n)return"property="+n;let r=e.getAttribute("http-equiv");return r?"http-equiv="+r:e.hasAttribute("charset")?"charset":null}function Rl(e){if(!e.querySelector("meta"))return;let t=o=>{let i=new Map;for(let s of o.querySelectorAll("meta")){let a=gn(s);if(!a||a===$r)continue;let c=i.get(a);c?c.push(s):i.set(a,[s])}return i},n=t(e),r=t(document.head);for(let[o,i]of n){let s=r.get(o)||[],a=i.map(ee).join(`
2
+ `),c=s.map(ee).join(`
3
+ `);if(a!==c){if(i.length===1&&s.length===1){let l=s[0];for(let u of[...l.attributes])l.removeAttribute(u.name);for(let u of i[0].attributes)l.setAttribute(u.name,u.value);continue}for(let l of s)l.remove();for(let l of i)document.head.appendChild(Xr(l))}}for(let[o,i]of r)if(!n.has(o))for(let s of i)s.remove()}function Dr(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(ee(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(r.tagName==="META"&&gn(r)||n.has(ee(r))||(r.tagName==="SCRIPT"?document.head.appendChild(yn(r)):document.head.appendChild(Xr(r))));Rl(e)}function Ol(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function ys(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let i of t.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&r.add(ee(i));let o=new Set;for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&o.add(ee(i));for(let i of[...t.children])i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(Ol(i)||i.tagName==="META"&&gn(i)===$r||o.has(ee(i))||i.remove());for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(i.tagName==="META"&&gn(i)===$r||r.has(ee(i))||(i.tagName==="SCRIPT"?t.appendChild(yn(i)):t.appendChild(Xr(i))))}function $e(e){typeof customElements>"u"||Qr(e)}function Qr(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&&Qr(n.shadowRoot))}function $i(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]")){let n=t.cloneNode(!0);document.body.appendChild(n);let r=n.getAttribute("data-webjs-resolve"),o=window.__webjsResolve;r&&typeof o=="function"&&o(r)}}async function gs(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="",o="<template data-webjs-resolve",i="<!--wj-stream-shell-->",s=/<\/html\s*>/i;for(;;){let{value:a,done:c}=await t.read();a&&(r+=n.decode(a,{stream:!0})),c&&(r+=n.decode());let l=r.indexOf(i);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+i.length)};let u=r.indexOf(o);if(u!==-1)return{shell:r.slice(0,u),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(u)};if(c)return{shell:r,streaming:!1};let f=s.exec(r);if(f){let d=f.index+f[0].length;return{shell:r.slice(0,d),streaming:!0,reader:t,dec:n,rest:r.slice(d)}}}}function ws(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,o=/<(\/?)template\b[^>]*>/gi;o.lastIndex=r;let i=1,s;for(;s=o.exec(e);)if(s[1]==="/"){if(i--,i===0)return{id:n,content:e.slice(r,s.index),rest:e.slice(s.index+s[0].length)}}else i++;return null}function _s(e,t){let n=document.getElementById(e);if(!n){ll(e);return}let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];n.replaceWith(r.content);for(let i of o)i.nodeType===1&&Qr(i)}async function As(e,t,n,r){let o=n,i=()=>{let s;for(;s=ws(o);){if(!r())return!1;_s(s.id,s.content),o=s.rest}return!0};if(!e){i();return}try{for(;;){if(!i()){try{await e.cancel()}catch{}return}let{value:s,done:a}=await e.read();if(s&&(o+=t.decode(s,{stream:!0})),a){o+=t.decode(),i();return}}}catch{}}function wn(e){if(e.tagName==="SCRIPT"){let n=yn(e);return e.replaceWith(n),n}let t=[];bt.has(e)&&t.push(e);for(let n of e.querySelectorAll("[data-webjs-permanent]"))bt.has(n)&&t.push(n);for(let n of e.querySelectorAll("script"))t.length&&t.some(r=>r!==n&&r.contains(n))||n.replaceWith(yn(n));return e}function Zr(e){let t=[];for(let n=e.start.nextSibling;n&&n!==e.end;n=n.nextSibling)n.nodeType===1&&t.push(n);for(let n of t){let r=wn(n);r.isConnected!==!1&&$e(r)}}function Ll(e){return S.get(fe(e))||null}function Pl(){return we.size}function Ml(){S.clear(),we.clear(),De.length=0,dt.clear(),An(),zr()}function Il(e){_e=e||(t=>{location.href=t})}function Fl(){return N}function $l(){return++N}function Dl(){return G}function Bl(e){G=e}function Ul(){Lr.clear(),Pr=!1}function Hl(e,t){return Zi(e,t)}function ql(e){return _n.test(e)}var Pi,Ie,te,B,N,Rr,G,rn,nl,Di,an,q,D,ft,_n,_e,Qi,Lr,cn,Mi,Pr,ul,R,pl,rs,os,hl,ml,bl,S,we,De,dt,Be,pt,ue,Fe,ht,pn,hn,bt,mt,Fr,$r,Zt=F(()=>{Ar();en();en();Ge();Ti();Nr();jr();Bt();Pi="text/vnd.webjs-stream.html";Ie=null;te=!1,B=null,N=0,Rr=null;G=null,rn=null,nl=2e3,Di=500,an=["wheel","touchmove","keydown","pointerdown"],q=null;D=null,ft=0;_n=/\.(?: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,_e=e=>{location.href=e};Qi="_top";Lr=new Set;cn="webjs:nav-fallback",Mi=!1;Pr=!1;ul=16,R=new Map;pl=8,rs=3e4,os=3,hl=24,ml=100,bl=250,S=new Map,we=new Set,De=[],dt=new Set,Be=null,pt=null,ue=null,Fe=new WeakMap,ht=new Set;pn=new WeakMap;hn=new WeakMap;bt=new WeakSet;mt=Promise.resolve();Fr=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);$r="name=csp-nonce";(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&Ur()});function ks(e,...t){return{_$webjs:"template",strings:e,values:t}}function P(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var C="wjm-";function Ns(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 kn(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function Nn(e,t){if(!(!t||!t.length))if("adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"){let n=t.map(r=>{let o=new CSSStyleSheet;return o.replaceSync(r.text),o});e.adoptedStyleSheets=n}else{let n=e,r=document.createElement("style");r.textContent=t.map(o=>o.text).join(`
4
+ `),n.appendChild(r)}}function xs(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
5
+ `)}</style>`}Tn();gt();Ge();var _o=Symbol.for("webjs.repeat");function Ao(e,t,n){return{[_o]:!0,items:[...e],keyFn:t,templateFn:n}}function _t(e){return!!e&&typeof e=="object"&&e[_o]===!0}function Bs(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function Pn(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Us(e){return{_$webjs:"live",value:e}}function At(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function Hs(e,t){return{_$webjs:"keyed",key:e,value:t}}function St(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function qs(e,t){return{_$webjs:"guard",deps:e,fn:t}}function vt(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Ws(e){return{_$webjs:"template-content",template:e}}function Mn(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function Vs(e){return{_$webjs:"ref",target:e}}function Et(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Ks(){return{value:void 0}}function zs(e){return{_$webjs:"cache",value:e}}function Ct(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function Ys(...e){return{_$webjs:"until",args:e}}function kt(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function Gs(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function In(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function Js(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Fn(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Xs(e){return{_$webjs:"watch",signal:e}}function Nt(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var U=null,re=!1,Ce=0,Ee=null,$n=0,So=(e,t)=>Object.is(e,t),Tt=()=>{},vo=()=>!1;function Eo(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)Eo(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function Je(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)Je(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function Wn(e){if(re)throw new Error("Signal read during notification phase");if(U===null)return;let t=U,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&Un(t)&&Je(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,Un(t)&&Eo(e,t)),t.producerLastReadVersions[n]=e.version}function Un(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Co(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=re;re=!0;try{for(let n of e.liveConsumers)n.dirty||Qs(n)}finally{re=t}}function Qs(e){e.dirty=!0,Co(e),e.consumerMarkedDirty.call(e.wrapper||e)}function jt(e){if(!(!e.dirty&&e.lastCleanEpoch===Ce)){if(!e.producerMustRecompute()&&!Zs(e)){e.dirty=!1,e.lastCleanEpoch=Ce;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=Ce}}function Zs(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(jt(n),r!==n.version))return!0}return!1}function Hn(e){e&&(e.nextProducerIndex=0);let t=U;return U=e,t}function qn(e,t){if(U=t,!!e){if(Un(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)Je(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var Rt=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=vo,this.producerRecomputeValue=Tt,this.consumerMarkedDirty=Tt,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||So,this.watched=n?.[Vn],this.unwatched=n?.[Kn]}get(){return Wn(this),this.__value}peek(){return this.__value}set(t){if(re)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,Ce++,Ee!==null?ko(this):Co(this))}};function ko(e){let t=re;re=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?Ee.add(n):ko(n))}finally{re=t}}var Dn=Symbol("unset"),Bn=Symbol("computing"),xt=Symbol("errored"),Xe=class{constructor(t,n){this.__fn=t,this.__value=Dn,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||So,this.watched=n?.[Vn],this.unwatched=n?.[Kn];let r=this;this.producerMustRecompute=function(){return r.__value===Dn||r.__value===Bn},this.producerRecomputeValue=function(){if(r.__value===Bn)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=Bn;let i=Hn(r),s,a=!1;try{s=r.__fn.call(r.wrapper)}catch(l){s=xt,r.__error=l,a=!0}finally{qn(r,i)}if(!a&&(o!==Dn&&o!==xt)&&r.__equal.call(r.wrapper,o,s)){r.__value=o;return}r.__value=s,r.version++},this.consumerMarkedDirty=Tt}get(){if(jt(this),Wn(this),this.__value===xt)throw this.__error;return this.__value}peek(){if(jt(this),this.__value===xt)throw this.__error;return this.__value}},Ot=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=vo,this.producerRecomputeValue=Tt,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=Hn(this);try{for(let r of t)Wn(r),r.__isComputed&&jt(r)}finally{qn(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(Je(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=Hn(this),r;try{r=t()}finally{qn(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)Je(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},Vn=Symbol("watched"),Kn=Symbol("unwatched");function ea(e){let t=U;U=null;try{return e()}finally{U=t}}function ta(e){return e.producers.slice()}function na(e){return e.liveConsumers?[...e.liveConsumers]:[]}function ra(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function oa(e){return e.producers.length>0}function ia(){return U&&U.__isComputed?U:null}function sa(e){$n++,Ee===null&&(Ee=new Set);try{e()}finally{if($n--,$n===0){let t=Ee;Ee=null;for(let n of t)n.__fire()}}}var Qe={State:Rt,Computed:Xe,subtle:{Watcher:Ot,untrack:ea,introspectSources:ta,introspectSinks:na,hasSinks:ra,hasSources:oa,currentComputed:ia,watched:Vn,unwatched:Kn}};function aa(e,t){return new Rt(e,t)}function ca(e,t){return new Xe(e,t)}function la(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function ua(e){let t=!1,n=!1,r=new Xe(e),o=new Ot(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(i){console.error(i)}o.watch()}}))});o.watch(r);try{r.get()}catch(i){console.error(i)}return()=>{n||(n=!0,o.dispose())}}Bt();function Jo(e,t){let n=e&&e[v]?e:null;return n?Ft(n,t):t()}var cr=new WeakMap,lr=new WeakMap,Ut=Symbol.for("webjs.instance"),M=null;function Wt(e){return e?e.nodeType===11&&e.host?e.host:e:null}function fr(e,t){let n=e.__commitOwner,r=M;n&&(M=n);try{t()}finally{M=r}}function Oe(e,t){let n=t,r=n[T];n[T]=!0;let o=M;M=t;try{let i=n[Ut];if(P(e)){let s=e;if(i&&i.strings===s.strings){je(i,s.values);return}i&&Go(i,t);let a=t.firstChild;a&&a.nodeType===8&&a.data==="webjs-hydrate"&&a.remove(),n[Ut]=null;let c=Oa(s,t);n[Ut]=c;return}if(i&&Go(i,t),n[Ut]=null,t.replaceChildren(),e==null||e===!1||e===!0)return;if(Array.isArray(e)){for(let s of e){let a=document.createTextNode(String(s??""));t.appendChild(a)}return}t.appendChild(document.createTextNode(String(e)))}finally{M=o,n[T]=r,r||ar(n)}}function Vt(e){let{strings:t}=e,n=cr.get(t);if(n)return n;let r=[],o="",i="text",s="",a=0,c="",l=0,u=null,f="",d="";for(let g=0;g<t.length;g++){let b=t[g];for(let y=0;y<b.length;y++){let h=b[y];switch(i){case"text":o+=h,h==="<"&&(i="tag-open");break;case"tag-open":o+=h,h==="!"?i="bang-1":h==="/"?(i="tag-name",f=""):/[a-zA-Z]/.test(h)?(i="tag-name",f=h.toLowerCase()):i="text";break;case"bang-1":o+=h,i=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=h,h==="-"?(i="comment",l=0):i="tag-name";break;case"comment":o+=h,h==="-"?l+=1:(h===">"&&l>=2&&(i="text"),l=0);break;case"tag-name":o+=h,h===">"?(i=f==="script"||f==="style"?"rawtext":"text",i==="rawtext"&&(d="")):/\s/.test(h)?i="in-tag":f+=h.toLowerCase();break;case"in-tag":o+=h,h===">"?(i=f==="script"||f==="style"?"rawtext":"text",i==="rawtext"&&(d="")):!/\s/.test(h)&&h!=="/"&&(i="attr-name",s=h,a=o.length-1);break;case"rawtext":o+=h,d=(d+h.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(i="text",d="",f="");break;case"attr-name":h==="="?(i="after-eq",o+=h):/\s/.test(h)?(i="in-tag",s="",o+=h):h===">"?(i="text",s="",o+=h):(s+=h,o+=h);break;case"after-eq":h==='"'||h==="'"?(i="attr-quoted",c=h,o+=h):/\s/.test(h)?(i="in-tag",s="",o+=h):h===">"?(i="text",s="",o+=h):(i="attr-unquoted",o+=h);break;case"attr-unquoted":/\s/.test(h)?(i="in-tag",s="",o+=h):(h===">"&&(i="text",s=""),o+=h);break;case"attr-quoted":o+=h,h===c&&(i="in-tag",s="");break;case"skip-attr":if(h===c){if(u){let W=u.firstPartIdx,w=[];for(let x=W;x<r.length;x++)(r[x].kind==="noop"||r[x].kind==="attr-mixed")&&w.push(x);let L=[],Se=t[w[0]],ve=Se.lastIndexOf(c);L.push(ve>=0?Se.slice(ve+1):Se);for(let x=1;x<w.length;x++)L.push(t[w[x]]);let E=t[w[w.length-1]+1],Ve=E.indexOf(c);L.push(Ve>=0?E.slice(0,Ve):E),r[W]={kind:"attr-mixed",path:[],name:u.name,statics:L,group:w};for(let x=1;x<w.length;x++)r[w[x]]={kind:"noop",path:[],mixedAnchor:W};u=null}i="in-tag",s=""}break}}if(g<t.length-1){let y=r.length;if(i==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(i==="rawtext"){d="",r.push({kind:"noop",path:[]});continue}if(i==="text")o+=`<!--${C}${y}-->`,r.push({kind:"child",path:[]});else if(i==="in-tag"){let h=`data-${C}${y}`;o+=`${h}=""`,r.push({kind:"element",path:[]})}else if(i==="after-eq"){let h=s[0],W=s.slice(1);if(Ke(h)){o=o.slice(0,a);let w=xn[h],L=`data-${C}${y}`;o+=`${L}=""`,r.push({kind:w,path:[],name:W})}else{o=o.slice(0,a);let w=`data-${C}${y}`;o+=`${w}=""`,r.push({kind:"attr",path:[],name:s})}i="in-tag",s=""}else if(i==="attr-quoted"||i==="attr-unquoted"){o=o.slice(0,a);let h=`data-${C}${y}`;o+=`${h}=""`,u={name:s,firstPartIdx:y},r.push({kind:"noop",path:[]}),i="skip-attr"}else i==="skip-attr"&&r.push({kind:"noop",path:[]})}}let p=document.createElement("template");p.innerHTML=o,Na(p.content,r);let m=xa(p.content,r);return n={templateEl:p,parts:r,formActions:m},cr.set(t,n),n}function Na(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(k,"");let o=t.length;r.setAttribute(`data-${C}${o}`,""),t.push({kind:"slot",path:[]})}}function xa(e,t){let n=[],r=[];function o(i){for(let s=0;s<i.childNodes.length;s++){let a=i.childNodes[s];if(n.push(s),a.nodeType===8){let c=a.data;if(c.startsWith(C)){let l=Number(c.slice(C.length));t[l]&&t[l].kind==="child"&&(t[l].path=n.slice())}}else if(a.nodeType===1){let c=a,l=[],u=[];for(let f of c.attributes)if(f.name.startsWith(`data-${C}`)){let d=Number(f.name.slice(`data-${C}`.length));t[d]&&t[d].kind!=="child"&&(t[d].path=n.slice(),u.push({idx:d,kind:t[d].kind,name:t[d].name||""})),l.push(f.name)}if(c.localName==="form"||c.localName==="button"||c.localName==="input"){let f=Ta(c,u,t);f&&r.push(f)}for(let f of l)c.removeAttribute(f);o(a)}n.pop()}}return o(e),r.length?r:null}function Ta(e,t,n){let r=e.localName==="form",o=r?"action":"formaction",i=r?"method":"formmethod",s=r?"enctype":"formenctype",a=t.filter(b=>b.kind==="attr"&&b.name.toLowerCase()===o);if(!a.length)return null;let c=[],l=[],u=[],f=r?[]:t.filter(b=>b.name.toLowerCase()==="name"&&(b.kind==="attr"||b.kind==="attr-mixed"||b.kind==="bool")).map(b=>({i:b.idx,kind:b.kind})),d=!r&&e.hasAttribute("name"),p=!r&&e.hasAttribute("form"),m=!r&&e.hasAttribute("value"),g=r?[]:t.filter(b=>b.name.toLowerCase()==="value"&&(b.kind==="attr"||b.kind==="attr-mixed"||b.kind==="bool")).map(b=>({i:b.idx,kind:b.kind}));for(let b of t){let y=String(b.name).toLowerCase();if(b.kind==="prop"){r?(y==="method"||y==="enctype"||y==="encoding")&&u.push(b.name):On(y)&&u.push(b.name);continue}if(y!==i&&y!==s||b.kind!=="attr"&&b.kind!=="attr-mixed"&&b.kind!=="bool")continue;let h=n[b.idx],W={i:b.idx,kind:b.kind};b.kind==="attr-mixed"&&(W.statics=h.statics||[],W.group=h.group||[]),(y===i?c:l).push(W)}return{isForm:r,tag:e.localName,actionIdxs:a.map(b=>b.idx),duplicateAction:a.length>1,staticAction:e.getAttribute(o)!=null,authoredName:d,authoredValue:m,authoredForm:p,propAttrs:u,nameParts:f,valueParts:g,staticMethod:e.getAttribute(i),staticEnctype:e.getAttribute(s),methodParts:c,enctypeParts:l}}function rt(e,t,n){if(e)for(let r of[!0,!1])for(let o of e){if(o.isForm!==r)continue;let i=o.actionIdxs[0],s=o.isForm?"action":"formaction";for(let l of o.actionIdxs)if(Rn(Te(n[l]),s,o.tag)){i=l;break}let a=t[i];if(!a||!a.el)continue;let c=Te(n[i]);if(o.isForm)go(a.el,c,Ht(o.methodParts,o.staticMethod,n),Ht(o.enctypeParts,o.staticEnctype,n),o);else{let l=u=>u.some(f=>f.kind==="bool"?!!Te(n[f.i]):!0);Ra(a.el,c,o,l(o.nameParts),l(o.valueParts),Ht(o.methodParts,o.staticMethod,n),Ht(o.enctypeParts,o.staticEnctype,n))}}}function ja(e){(lr.has(e)||e.getAttribute("name")===O)&&(e.getAttribute("name")===O&&e.removeAttribute("name"),e.removeAttribute("value"),lr.delete(e))}function Ra(e,t,n,r,o,i,s){let a=typeof t=="function"?jn(t):null;if(!a){typeof t=="function"&&Ln(null,e.localName),ja(e),wo(e,i,s,n.propAttrs);return}po(n.duplicateAction,e.localName),ho(n.propAttrs,e.localName),n.staticAction&&uo(e.localName),(n.authoredValue||o)&&lo(e.localName),(n.authoredName||r)&&ao(e.getAttribute("name")||O,e.localName,!1),(n.authoredForm||e.hasAttribute("form"))&&fo(e.localName),co(e.localName,e.getAttribute("type"));let c=yo(e.localName,i,s);e.removeAttribute("formaction"),e.setAttribute("name",O),e.setAttribute("value",a),ze(e,"formmethod",i,c.formMethod),ze(e,"formenctype",s,c.formEnctype),lr.set(e,a)}function Oa(e,t){let{templateEl:n,parts:r,formActions:o}=Vt(e),i=n.content.cloneNode(!0),s=document.createComment(`${C}s`),a=document.createComment(`${C}e`),c=r.map(f=>Kt(f,i)),l=[];for(let f=0;f<e.values.length;f++)z(c[f],e.values[f],void 0,e.values),l.push(e.values[f]);rt(o,c,e.values),t.replaceChildren(s,...i.childNodes,a);let u=t.nodeType===1&&t[v]?t:null;for(let f of c)f.kind==="slot"&&(u&&f.slotEl&&(f.slotEl[It]=u),z(f,void 0,void 0,[]));return{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a}}function Kt(e,t){if(e.kind==="noop")return{kind:"noop",mixedAnchor:e.mixedAnchor};let n=t;for(let o of e.path)n=n.childNodes[o];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let o={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(i){o.handler?.(i)}};return r.addEventListener(o.name,o.dispatcher),o}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}`)}var Yo=Symbol("webjs.commitFailed");function je(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(Object.is(r,e.lastValues[n]))continue;let o=e.bound[n],i=o.mixedAnchor;try{o.kind==="noop"&&i!=null?z(e.bound[i],t[i],e.lastValues[i],t):z(o,r,e.lastValues[n],t)}catch(s){throw e.lastValues[n]=Yo,o.kind==="noop"&&i!=null&&(e.lastValues[i]=Yo),s}e.lastValues[n]=r}rt(cr.get(e.strings)?.formActions??null,e.bound,t)}function Go(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 if(typeof r=="object")try{r.value=void 0}catch{}n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=tt(n.slotEl);r&&zo(r,n.slotEl)}}t.replaceChildren()}function Ht(e,t,n){for(let r of e){if(r.kind==="bool")return Te(n[r.i])?"":$;if(r.kind==="attr"){let a=Te(n[r.i]);return a==null?"":String(a)}let o=r.statics||[],i=r.group||[],s=o[0]||"";for(let a=0;a<i.length;a++)s+=String(Te(n[i[a]])??""),s+=o[a+1]||"";return s}return t??$}function Te(e){return At(e)?e.value:e}function z(e,t,n,r){if(At(t)){let o=t.value;if(e.kind==="prop"&&e.el[e.name]===o||e.kind==="attr"&&e.el.getAttribute(e.name)===String(o)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!o)return;t=o}switch(e.kind){case"child":Ma(e,t);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):Rn(t,e.name,e.el.localName)||(Ye(t,e.name,e.el.localName),e.el.setAttribute(e.name,String(t)));break}case"prop":mo(t,e.name,e.el.localName),e.el[e.name]=t;break;case"bool":Ye(t,e.name,e.el.localName),t?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":e.handler=typeof t=="function"?t:null;break;case"element":Pa(e,t);break;case"attr-mixed":{let o=e,i=o.statics[0];for(let s=0;s<o.group.length;s++){let a=r?r[o.group[s]]:t;Ye(a,e.name,e.el.localName),i+=String(a??""),i+=o.statics[s+1]||""}e.el.setAttribute(e.name,i);break}case"slot":{if(e.applied)break;let o=e.slotEl,i=()=>{let a=tt(o);if(!a){e.applied=!0;return}if(!a.contains(o)){a.isConnected?queueMicrotask(i):e.applied=!0;return}if(e.applied=!0,La(o))return;let c=document.createDocumentFragment();for(;o.firstChild;)c.appendChild(o.firstChild);o[et]=c,queueMicrotask(()=>Z(a))},s=tt(o);s&&s.contains(o)?i():queueMicrotask(i);break}case"noop":break}}function tt(e){let t=e[It];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[v])return n;n=n.parentElement}return null}function La(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.nodeType===11&&r.host)return!0;t=r}return!1}function Pa(e,t){let n=e,r=Et(t)?t.target:void 0,o=n.__refTarget,i=r!==o;if(i&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(i||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!i&&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 Ma(e,t){return Va(e,t),K(e,t)}function K(e,t){return Jo(e.marker&&e.marker.parentNode,()=>Ia(e,t))}function Ia(e,t){let n=e.marker;if(Pn(t)){se(e);let o=String(t.value??""),i=document.createElement("template");i.innerHTML=o;let s=[...i.content.childNodes],a=document.createDocumentFragment();for(let c of s)a.appendChild(c);n.parentNode?.insertBefore(a,n),e.child=s;return}if(St(t)){let o=t,i=e.__keyedKey;i!==void 0&&!Object.is(i,o.key)&&se(e),e.__keyedKey=o.key,K(e,o.value);return}if(vt(t)){let o=t,i=e.__guardDeps,s=o.deps;if(i!==void 0&&(Array.isArray(i)&&Array.isArray(s)?Wa(i,s):Object.is(i,s)))return;let a=Array.isArray(s)?s.slice():s;K(e,o.fn()),e.__guardDeps=a;return}if(Mn(t)){se(e);let o=t.template;if(o&&o.content){let i=o.content.cloneNode(!0),s=[...i.childNodes];n.parentNode?.insertBefore(i,n),e.child=s}return}if(Et(t))return;if(Ct(t))return Ka(e,t.value);if(kt(t))return za(e,t.args);if(Nt(t))return Ya(e,t.signal);if(In(t))return Ga(e,t);if(Fn(t))return Ja(e,t);if(_t(t)){if(e.child&&e.child.kind==="repeat"){Da(e,t);return}se(e);let o={kind:"repeat",map:new Map};e.child=o,$a(n,o,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){Ha(e,t);return}se(e);let o={kind:"array",items:[]};e.child=o,Ua(n,o,t);return}if(e.child){let o=e.child;if(o.kind==="repeat")Xo(o),e.child=void 0;else if(o.kind==="array")Zo(o),e.child=void 0;else if(o.kind==="async-stream")ri(o),e.child=void 0;else if("strings"in e.child){let i=e.child;if(P(t)&&i.strings===t.strings){je(i,t.values);return}Re(i.startNode,i.endNode),e.child=void 0}else{for(let i of e.child)i.parentNode&&i.parentNode.removeChild(i);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(P(t)){let o=t,{templateEl:i,parts:s,formActions:a}=Vt(o),c=i.content.cloneNode(!0),l=document.createComment(`${C}s`),u=document.createComment(`${C}e`),f=s.map(m=>Kt(m,c)),d=[];for(let m=0;m<o.values.length;m++)z(f[m],o.values[m],void 0,o.values),d.push(o.values[m]);rt(a,f,o.values);let p=[l,...c.childNodes,u];n.parentNode?.insertBefore(Fa(p),n);for(let m of f)m.kind==="slot"&&z(m,void 0,void 0,[]);e.child={strings:o.strings,bound:f,lastValues:d,startNode:l,endNode:u};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function Fa(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function Re(e,t){let n=e.parentNode;if(!n)return;let r=e;for(;r&&r!==t;){let o=r.nextSibling;r.parentNode?.removeChild(r),r=o}t.parentNode===n&&n.removeChild(t)}function dr(e){let{templateEl:t,parts:n,formActions:r}=Vt(e),o=t.content.cloneNode(!0),i=document.createComment(`${C}s`),s=document.createComment(`${C}e`),a=n.map(u=>Kt(u,o)),c=[];for(let u=0;u<e.values.length;u++)z(a[u],e.values[u],void 0,e.values),c.push(e.values[u]);rt(r,a,e.values);for(let u of a)u.kind==="slot"&&z(u,void 0,void 0,[]);let l=document.createDocumentFragment();for(l.appendChild(i);o.firstChild;)l.appendChild(o.firstChild);return l.appendChild(s),{inst:{strings:e.strings,bound:a,lastValues:c,startNode:i,endNode:s},frag:l}}function nt(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 if(typeof n=="object")try{n.value=void 0}catch{}t.lastTarget=void 0,t.__lastEl=void 0}}}function $a(e,t,n){let{items:r,keyFn:o,templateFn:i}=n,s=e.parentNode;if(!s)return;let a=document.createDocumentFragment();for(let c=0;c<r.length;c++){let l=o(r[c],c),u=i(r[c],c);if(!P(u))continue;let{inst:f,frag:d}=dr(u);t.map.set(l,f),a.appendChild(d)}s.insertBefore(a,e)}function Da(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,{items:i,keyFn:s,templateFn:a}=t,c=new Map;try{for(let l=0;l<i.length;l++){let u=s(i[l],l),f=a(i[l],l);if(!P(f))continue;let d=o.map.get(u);if(d&&d.strings===f.strings)je(d,f.values),ur(d.startNode,d.endNode,r,n),c.set(u,d),o.map.delete(u);else{d&&(o.map.delete(u),nt(d),Re(d.startNode,d.endNode));let{inst:p,frag:m}=dr(f);r.insertBefore(m,n),c.set(u,p)}}for(let[l,u]of[...o.map]){o.map.delete(l);try{nt(u)}finally{Re(u.startNode,u.endNode)}}o.map=c}catch(l){for(let[u,f]of c)o.map.set(u,f);throw l}}function Xo(e){for(let[t,n]of[...e.map]){e.map.delete(t);try{nt(n)}finally{Re(n.startNode,n.endNode)}}e.map.clear()}function Ba(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function qt(e){e.type==="tpl"?(nt(e.inst),Re(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Qo(e){if(P(e)){let{inst:t,frag:n}=dr(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 Ua(e,t,n){let r=e.parentNode;if(!r)return;let o=document.createDocumentFragment(),i=[];for(let s of n){let{item:a,frag:c}=Qo(s);c&&o.appendChild(c),i.push(a)}r.insertBefore(o,e),t.items=i}function Ha(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,i=o.items,s=[],a=0;try{for(let c=0;c<t.length;c++){let l=t[c],u=i[c];if(P(l)){let p=l;if(u&&u.type==="tpl"&&u.inst.strings===p.strings){je(u.inst,p.values),s.push(u),a=c+1;continue}}else if(l!=null&&l!==!1&&l!==!0){if(u&&u.type==="text"){let p=String(l);u.node.data!==p&&(u.node.data=p),s.push(u),a=c+1;continue}}else{u&&qt(u),s.push({type:"empty"}),a=c+1;continue}let{item:f,frag:d}=Qo(l);d&&r.insertBefore(d,qa(i,c,n)),s.push(f),u&&qt(u),a=c+1}for(let c=t.length;c<i.length;c++)qt(i[c]),a=c+1;o.items=s}catch(c){throw o.items=s.concat(i.slice(a)),c}}function qa(e,t,n){for(let r=t;r<e.length;r++){let o=Ba(e[r]);if(o&&o.parentNode)return o}return n}function Zo(e){for(let t of e.items)qt(t);e.items=[]}function ur(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),i=e;for(;i;){let s=i.nextSibling;if(o.appendChild(i),i===t)break;i=s}n.insertBefore(o,r)}function Wa(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 se(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&ei(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Xo(n);else if(n.kind==="array")Zo(n);else if(n.kind==="async-stream")ri(n);else if("strings"in n){let r=e.child;nt(r),Re(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Va(e,t){let n=e;n.__untilState&&!kt(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!vt(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!Ct(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!St(t)&&(n.__keyedKey=void 0),n.__watchSub&&!Nt(t)&&ei(n)}function Ka(e,t){let n=e.marker,r=e,o=r.__cacheMap;o||(o=new Map,r.__cacheMap=o);let i=e.child;if(i&&"strings"in i){let a=i;if(P(t)&&a.strings===t.strings){je(a,t.values);return}let c=document.createDocumentFragment();ur(a.startNode,a.endNode,c,null),o.set(a.strings,{inst:a,holder:c}),e.child=void 0}if(P(t)){let a=t,c=o.get(a.strings);if(c){o.delete(a.strings),e.child&&se(e),ur(c.inst.startNode,c.inst.endNode,n.parentNode,n),je(c.inst,a.values),e.child=c.inst;let l=new Set;for(let u=c.inst.startNode.nextSibling;u&&u!==c.inst.endNode;u=u.nextSibling){if(u.nodeType!==1)continue;let f=u;if(f.matches("slot[data-webjs-light]")){let d=tt(f);d&&l.add(d)}for(let d of f.querySelectorAll("slot[data-webjs-light]")){let p=tt(d);p&&l.add(p)}}for(let u of l)Z(u);return}}K(e,t)}function za(e,t){let n=e;M&&(n.__commitOwner=Wt(M));let r=n.__untilState,o=n.__untilArgs,i=(d,p)=>!!(Object.is(d,p)||P(d)&&P(p)&&d.strings===p.strings),a=o&&o.length===t.length&&o.every((d,p)=>i(d,t[p]))&&r?r.highestResolved:1/0;r&&(r.aborted=!0),n.__untilArgs=t.slice();let c={aborted:!1,highestResolved:a};n.__untilState=c;let l=-1,u;for(let d=0;d<t.length;d++){let p=t[d];if(!p||typeof p.then!="function"){l=d,u=p;break}}l!==-1&&l<=c.highestResolved?(K(e,u),c.highestResolved=l):l===-1&&!n.__untilEverRendered&&K(e,""),n.__untilEverRendered=!0;let f=Math.min(l===-1?t.length:l,c.highestResolved);for(let d=0;d<f;d++){let p=t[d];!p||typeof p.then!="function"||Promise.resolve(p).then(m=>{if(!c.aborted&&!(d>=c.highestResolved)){try{fr(e,()=>K(e,m))}catch(g){pr(e,g);return}c.highestResolved=d}},()=>{})}}function pr(e,t){let n;try{n=t instanceof Error?t:new Error(String(t))}catch{n=new Error("render error (unstringifiable thrown value)")}let r=e.__commitOwner;if(r&&typeof r._handleRenderError=="function"){r._handleRenderError(n);return}throw n}function Ya(e,t){let n=e;if(M&&(n.__commitOwner=Wt(M)),n.__watchSig===t&&n.__watchSub){let i;n.__watchSub.observe(()=>{i=t.get()}),K(e,i);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new Qe.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let i;try{r.observe(()=>{i=t.get()}),fr(e,()=>K(e,i))}catch(s){pr(e,s)}})});n.__watchSub=r;let o;r.observe(()=>{o=t.get()}),K(e,o)}function ei(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Ga(e,t){let n=e;M&&(n.__commitOwner=Wt(M));let r=e.child;if(r&&r.kind==="async-stream"&&r.mode==="append"&&r.iterable===t.iterable)return;se(e);let o=t.iterable[Symbol.asyncIterator](),i={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:o,nodes:[]};e.child=i,ti(i,e,t)}function Ja(e,t){let n=e;M&&(n.__commitOwner=Wt(M));let r=e.child;if(r&&r.kind==="async-stream"&&r.mode==="replace"&&r.iterable===t.iterable)return;se(e);let o=t.iterable[Symbol.asyncIterator](),i={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:o,nodes:[]};e.child=i,ti(i,e,t)}async function ti(e,t,n){let r=t.marker,o=0;for(;!e.aborted;){let i,s;try{if(i=await e.iterator.next(),e.aborted||i.done)break;s=n.mapper?n.mapper(i.value,o):i.value}catch(a){typeof console<"u"&&console.error("[webjs] asyncStream error:",a);return}try{fr(t,()=>{let a=ni(s);Jo(r.parentNode,()=>{if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let c=document.createDocumentFragment();for(let l of a)c.appendChild(l);r.parentNode?.insertBefore(c,r),e.nodes.push(...a)})})}catch(a){e.aborted=!0;try{e.iterator.return?.()?.catch?.(()=>{})}catch{}pr(t,a);return}o++}}function ni(e){if(e==null||e===!1||e===!0)return[];if(P(e)){let t=e,{templateEl:n,parts:r,formActions:o}=Vt(t),i=n.content.cloneNode(!0),s=r.map(a=>Kt(a,i));for(let a=0;a<t.values.length;a++)z(s[a],t.values[a],void 0,t.values);rt(o,s,t.values);for(let a of s)a.kind==="slot"&&z(a,void 0,void 0,[]);return[...i.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...ni(n));return t}return[document.createTextNode(String(e))]}function ri(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 oi=null;function zt(e){oi=e||null}function Xa(){return oi||void 0}Ge();var ii=Symbol.for("webjs:registry"),si=Symbol.for("webjs:classToTag"),Yt=globalThis,Y=Yt[ii]||(Yt[ii]=new Map),ai=Yt[si]||(Yt[si]=new WeakMap),Gt=typeof window<"u"&&typeof customElements<"u";function hr(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=Y.get(e);r?(r.cls=t,r.lazy=n):Y.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),ai.set(t,e)}if(Gt){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),hr(t,n)}}if(!Gt){let e=globalThis;e.customElements||(e.customElements={define(t,n){hr(t,n)},get(t){return Y.get(t)?.cls},upgrade(){},whenDefined(t){let n=Y.get(t);return Promise.resolve(n?.cls)}})}function mr(e,t){Gt?customElements.define(e,t):hr(e,t)}function Qa(e,t){if(Gt)return;let n=Y.get(e);if(n){n.moduleUrl=t;return}Y.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Za(e){return Y.get(e)?.cls}function ec(e){return Y.get(e)?.moduleUrl||null}function tc(e){return Y.get(e)?.lazy===!0}function ot(e){return ai.get(e)}function nc(){return[...Y.keys()]}at();Bt();var mi=typeof window<"u"&&typeof HTMLElement<"u";function mc(e,t){return e!==t}function bc(e){try{return String(e)}catch{return Object.prototype.toString.call(e)}}function di(e,t,n){if(typeof console>"u"||!console.warn)return;let r=ot(e.constructor)||e.tagName?.toLowerCase()||"unknown";console.warn(`[webjs] reflect:true property "${t}" on <${r}> holds a function (or an array carrying one), which has no HTML attribute representation. Removing "${n}" instead of stringifying it (a stringified function writes its source into the page, so a server action's body would ship to the browser). Pass a string, or drop reflect on this property.`)}function yc(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var Jt=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(),o=this.__ssrAttrs.has(r);return(n===void 0?!o: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 o=r.length-1;o>=0;o--)if(r[o]&&r[o].__ssrTag===n)return r[o];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,o=>"-"+o.toLowerCase());return this.__dataset=new Proxy({},{get(r,o){if(typeof o!="string")return;let i=t.getAttribute(n(o));return i===null?void 0:i},set(r,o,i){return typeof o=="string"&&t.setAttribute(n(o),i),!0},has(r,o){return typeof o=="string"&&t.hasAttribute(n(o))},deleteProperty(r,o){return typeof o=="string"&&t.removeAttribute(n(o)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(o,i)=>i.toUpperCase()))},getOwnPropertyDescriptor(r,o){if(typeof o=="string"&&t.hasAttribute(n(o)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(o))}}}),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=yc(),this.__internals}},gc=["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 gc){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(Jt.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var wc=mi?HTMLElement:Jt,bi=Symbol("webjs.factoryProps"),pi=new WeakSet,Le=class e extends wc{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){mr(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||yr(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(pi.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,bi)){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://webjs.dev/docs/components.`)}n=Object.getPrototypeOf(n)}pi.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,o]of Object.entries(n)){let i=typeof o=="object"?o:{type:o},s=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:a=>{let c=this.__propValues[r];(i.hasChanged||mc)(a,c)&&(this.__propValues[r]=a,i.reflect&&!i.state&&this._connected&&this._reflectAttribute(r,a,i),this.requestUpdate(r,c))}}),s!==void 0?this.__propValues[r]=s:i.default!==void 0&&(this.__propValues[r]=typeof i.default=="function"?i.default():i.default)}}}_reflectAttribute(t,n,r){let o=r.attribute||yr(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let i=r.converter.toAttribute(n,r.type);i==null?this.removeAttribute(o):this.setAttribute(o,i)}else typeof n=="function"?(this.removeAttribute(o),di(this,t,o)):r.type===Boolean?n?this.setAttribute(o,""):this.removeAttribute(o):n==null?this.removeAttribute(o):r.type===Object||r.type===Array?this.setAttribute(o,JSON.stringify(n)):wt(n)?(this.removeAttribute(o),di(this,t,o)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!mi)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 o=n[r].name;o.startsWith("data-webjs-prop-")&&t.push(o)}for(let r of t){let o=this.getAttribute(r);if(this.removeAttribute(r),o==null)continue;let i=hi(r.slice(16));try{this[i]=ye(o)}catch(s){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${s&&s.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,o=Array.isArray(r)?r:kn(r)?[r]:[];if(o.length){if(n){let i=this.shadowRoot.querySelector("style");i&&i.remove()}Nn(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${ot(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().`),sr(this)?Ho(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||Ko(this)?(this.removeAttribute("data-wj-serialized"),Q(this),Lo(this)):Oo(this),Vo(this),Do(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)}})}__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),Uo(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 i=this.constructor.properties||{},s,a;for(let[u,f]of Object.entries(i))if(((typeof f=="object"?f:{type:f}).attribute||yr(u))===t){s=u,a=f;break}if(a===void 0&&(s=hi(t),a=i[s]||i[t]),a===void 0)return;let c=typeof a=="object"?a:{type:a},l;if(c.converter&&c.converter.fromAttribute)l=c.converter.fromAttribute(r,c.type);else if(c.type===Number)l=r==null?null:Number(r);else if(c.type===Boolean)l=r!=null&&r!=="false";else if(c.type===Object||c.type===Array)try{l=r==null?null:JSON.parse(r)}catch{l=r}else l=r;this[s]!==l&&(this[s]=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 o of this.__controllers)o.hostUpdate&&o.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,zt(this.__renderAbort?this.__renderAbort.signal:null);try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}finally{zt(null)}if(!r){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();n=!0}}}catch(o){console.error("[webjs] lifecycle hook threw during update phase:",o)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let o=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1;let i=()=>{if(this.__pendingAsyncCommits--,o===this.__renderToken){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();this._postCommit(t)}};r.then(i,s=>{try{o===this.__renderToken&&this._handleRenderError(s instanceof Error?s:new Error(bc(s)))}finally{i()}});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 Qe.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);Oe(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&Oe(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{if(n===this.__renderToken)try{Oe(r,this._renderRoot)}catch(o){this._handleRenderError(o instanceof Error?o:new Error(String(o)))}},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==Xt.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${ot(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&Oe(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 yr(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function hi(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Xt(e){return new.target?Reflect.construct(Le,arguments,new.target):class extends Le{static properties=e;static[bi]=!0}}Object.setPrototypeOf(Xt,Le);Xt.prototype=Le.prototype;function _c(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}gt();var yi=Symbol.for("webjs.notFound"),gi=Symbol.for("webjs.redirect"),wi=Symbol.for("webjs.forbidden"),_i=Symbol.for("webjs.unauthorized");function Ac(){let e=new Error("webjs: notFound()");throw e.__webjs=yi,e}function Sc(){let e=new Error("webjs: forbidden()");throw e.__webjs=wi,e}function vc(){let e=new Error("webjs: unauthorized()");throw e.__webjs=_i,e}function Ec(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=gi,r.url=e,r.status=typeof n=="number"?n:void 0,r}function Cc(e){return!!e&&e.__webjs===yi}function kc(e){return!!e&&e.__webjs===gi}function Nc(e){return!!e&&e.__webjs===wi}function xc(e){return!!e&&e.__webjs===_i}var Ai=null;function Tc(){if(!Ai)return"";try{return Ai()||""}catch{return""}}var Si=null;function jc(e){if(typeof e!="string"||!e||!Si)return e;try{return Si(e)||e}catch{return e}}Ge();var qu=Symbol.for("webjs.suspense");function Rc(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function Oc(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function Lc(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,i=null,s=[];function a(){o||(i=new WebSocket(Pc(e),t.protocols),i.onopen=c=>{for(r=0;s.length&&i&&i.readyState===WebSocket.OPEN;)i.send(s.shift());t.onOpen?.(c)},i.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},i.onerror=c=>{t.onError?.(c)},i.onclose=c=>{if(t.onClose?.(c),!o&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(a,l)}})}return a(),{send(c){let l=typeof c=="string"||c instanceof ArrayBuffer||ArrayBuffer.isView(c)?c:JSON.stringify(c);i&&i.readyState===WebSocket.OPEN?i.send(l):s.push(l)},close(c,l){o=!0;try{i?.close(c,l)}catch{}},get socket(){return i},get readyState(){return i?.readyState??3}}}function Pc(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}`}at();var gr="application/vnd.webjs+json";async function Mc(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",gr);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 br(r),n.has("content-type")||n.set("content-type",gr));let o=await fetch(e,{...t,headers:n,body:r}),i=o.headers.get("content-type")||"",s=await o.text(),a=i.includes(gr)?s?ye(s):null:i.includes("application/json")?s?JSON.parse(s):null:s;if(!o.ok){let c=a&&a.error||`richFetch ${e} -> ${o.status}`,l=new Error(c);throw l.status=o.status,l.body=a,l}return a}at();Zt();Zt();Ar();en();var eo=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 o=()=>{let i=this.updates.findIndex(s=>s.id===r);i!==-1&&(this.updates.splice(i,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>o()).catch(()=>{}):n.then(()=>o(),()=>o())),o}};async function Wl(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(i){throw e.set(r),i}return o&&o.success===!1&&e.set(r),o}function Vl(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Wl(e,t,n):new eo(e,t)}Nr();jr();var Kl="application/vnd.webjs+stream",zl=1,Yl=2,Gl=3,Ss=new Uint8Array(0);function Jl(e,t){let n=t||Ss,r=n.length,o=new Uint8Array(5+r);return o[0]=e&255,o[1]=r>>>24&255,o[2]=r>>>16&255,o[3]=r>>>8&255,o[4]=r&255,r&&o.set(n,5),o}function Xl(){let e=Ss;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],o=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+o)break;let i=e.slice(5,5+o);n.push({type:r,payload:i}),e=e.slice(5+o)}return n}}}var Ql=Symbol.for("webjs.context");function Zl(e){return{__context__:Ql,name:e}}var En=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},to=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let i=o;if(i.context===this._context)if(o.stopPropagation(),i.subscribe){let s={callback:i.callback},a=()=>{this._subscriptions.delete(s)};this._subscriptions.add(s),i.callback(this._value,a)}else i.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()}},no=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 En(this._context,(n,r)=>{let o=this._value;this._value=n,r&&(this._unsubscribe=r),!Object.is(o,n)&&typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()},this._subscribe);this._host.dispatchEvent(t)}};function eu(){return typeof window<"u"}var ne={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},ro=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=ne.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=ne.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=ne.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=ne.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 ne.INITIAL:return t.initial?.();case ne.PENDING:return t.pending?.();case ne.COMPLETE:return t.complete?.(this._value);case ne.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!eu())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{no as ContextConsumer,to as ContextProvider,En as ContextRequestEvent,O as FORM_ACTION_FIELD,so as FORM_ACTION_ID_KEY,zl as FRAME_CHUNK,Yl as FRAME_END,Gl as FRAME_ERROR,C as MARKER,Ri as SEED_MISS,Kl as STREAM_CONTENT_TYPE,Qe as Signal,Rc as Suspense,ro as Task,ne as TaskStatus,Xt as WebComponent,_r as WebjsFrame,Sr as WebjsStream,Xa as activeActionSignal,Nn as adoptStyles,nc as allTags,jc as asset,Gs as asyncAppend,Js as asyncReplace,sa as batch,zs as cache,ca as computed,Lc as connectWS,Xc as consumeStale,Zl as createContext,Xl as createFrameDecoder,Ks as createRef,Tc as cspNonce,Ns as css,ui as deserialize,Ui as disableClientRouter,ua as effect,Ur as enableClientRouter,Jl as encodeFrame,io as escapeAttr,Ts as escapeText,Gc as fetchMark,Sc as forbidden,qs as guard,ks as html,In as isAsyncAppend,Fn as isAsyncReplace,kn as isCSS,Ct as isCache,Nc as isForbidden,vt as isGuard,St as isKeyed,tc as isLazy,At as isLive,Cc as isNotFound,kc as isRedirect,Et as isRef,_t as isRepeat,la as isSignal,Oc as isSuspense,P as isTemplate,Mn as isTemplateContent,xc as isUnauthorized,Pn as isUnsafeHTML,kt as isUntil,Nt as isWatch,Hs as keyed,Us as live,Za as lookup,ec as lookupModuleUrl,xr as markStale,Hi as navigate,Ac as notFound,Vl as optimistic,ye as parse,Tr as parseTagHeader,Qa as primeModuleUrl,_c as prop,Ec as redirect,Vs as ref,mr as register,Jc as registerKeyTags,Oe as render,vr as renderStream,Ao as repeat,qi as revalidate,Mc as richFetch,tn as scanSeeds,zc as seedStats,li as serialize,zt as setActiveActionSignal,aa as signal,br as stringify,xs as stylesToString,ot as tagOf,Kc as takeSeed,Ws as templateContent,vc as unauthorized,Bs as unsafeHTML,Ys as until,Xs as watch};
6
6
  //# sourceMappingURL=webjs-core-browser.js.map