@webjsdev/core 0.7.48 → 0.7.49

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,10 +1,10 @@
1
- var la=Object.defineProperty;var J=(e,t)=>()=>(e&&(t=e(e=0)),t);var Yo=(e,t)=>{for(var n in t)la(e,n,{get:t[n],enumerable:!0})};function kt(e){return Object.prototype.hasOwnProperty.call(Ve,e)}var Ve,on=J(()=>{Ve=Object.freeze({"@":"event",".":"prop","?":"bool"})});function sn(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function H(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var Nt=J(()=>{});function fa(e){ur=e}function an(e){if(typeof e!="function")return null;let t=e[Jo];return typeof t=="string"&&t?t:null}async function jt(e){let t=an(e);if(t)return t;if(typeof e!="function"||!ur)return null;try{let n=await ur(e);return typeof n=="string"&&n?n:null}catch{return null}}function ze(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 Ke(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 fr(e,t){let n=String(e||"").toLowerCase(),r=t==null?null:String(t).toLowerCase();if(da(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 da(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 Ye(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 dr(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 Ge(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 Je(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 pr(e,t){let r=(e||[]).filter(o=>Xe(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 Xe(e){let t=String(e).toLowerCase();return t==="name"||t==="value"||t==="formaction"||t==="formmethod"||t==="formenctype"}function pa(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&&!Xo.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 X(e,t,n){if(cn(e)&&_a(t))throw new Error(Sa(t,n))}function Rt(e,t,n){wa(t,n)&&X(e,t,n)}function be(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 ha(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&&!Xo.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 hr(e,t){let n=Ze(e);Lt({staticAction:n.has("action")});let r=Zo(n.has("method")?n.get("method"):U,n.has("enctype")?n.get("enctype"):U),o=e.endsWith("/>")?"/>":">",s=e.slice(0,e.length-o.length),i="";return r.method!==null&&(i+=` method="${r.method}"`),r.enctype!==null&&(i+=` enctype="${r.enctype}"`),{tag:s+i+o,hidden:ma(t)}}function Lt(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 Zo(e,t){let n=e!==U&&e!=null,r=t!==U&&t!=null;return ha(n?e:null,r?t:null),{method:n?null:"post",enctype:r?null:"multipart/form-data"}}function mr(e,t,n){let r=t!==U&&t!=null,o=n!==U&&n!=null;return pa(e,r?t:null,o?n:null),{formMethod:r?null:"post",formEnctype:o?null:"multipart/form-data"}}function br(e,t,n){ga(e,t,n);let r=Ze(e),o=mr(t,r.has("formmethod")?r.get("formmethod"):U,r.has("formenctype")?r.get("formenctype"):U),s=e.endsWith("/>")?"/>":">",i=e.slice(0,e.length-s.length),a="";return o.formMethod!==null&&(a+=` formmethod="${o.formMethod}"`),o.formEnctype!==null&&(a+=` formenctype="${o.formEnctype}"`),i+a+s}function ma(e){return`<input type="hidden" name="${R}" value="${H(e)}">`}function Qo(e,t,n,r,o){let s=typeof t=="function"?an(t):null;if(!s){typeof t=="function"&&be(null,e.localName),ya(e,n,r,o.propAttrs);return}Lt(o);let i=Zo(n,r);e.removeAttribute("action"),Tt(e,"method",n,i.method),Tt(e,"enctype",r,i.enctype),ba(e,s)}function Tt(e,t,n,r){if(r!==null){e.setAttribute(t,r);return}n!==U&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function ba(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 ga(e,t,n){let r=Ze(e),o=r.has("type")?r.get("type"):null;pr(n.propAttrs,t),Je(!!n.duplicateAction,t),r.has("formaction")&&dr(t),Go(e,"value")>1&&Ye(t),Go(e,"name")>1&&Ke(r.get("name")||R,t,!1),fr(t,o),r.has("form")&&Ge(t)}function ya(e,t,n,r){let o=e.firstElementChild;if(o&&o.localName==="input"&&o.getAttribute("name")===R)o.remove();else for(let i of e.children)if(i.localName==="input"&&i.getAttribute("name")===R){i.remove();break}let s=i=>(r||[]).some(a=>{let c=String(a).toLowerCase();return c===i||i==="enctype"&&c==="encoding"});t===U&&!s("method")&&e.removeAttribute("method"),n===U&&!s("enctype")&&e.removeAttribute("enctype")}function es(e,t,n,r){let o=s=>(r||[]).some(i=>String(i).toLowerCase()===s);t===U&&!o("formmethod")&&e.removeAttribute("formmethod"),n===U&&!o("formenctype")&&e.removeAttribute("formenctype")}function Ze(e){return new Map(ts(e))}function ts(e){let t=[],n=1;for(;n<e.length&&!/[\s/>]/.test(e[n]);)n++;for(;n<e.length;){for(;n<e.length&&/[\s/]/.test(e[n]);)n++;if(n>=e.length||e[n]===">")break;let r="";for(;n<e.length&&!/[\s/>=]/.test(e[n]);)r+=e[n++];for(;n<e.length&&/\s/.test(e[n]);)n++;if(e[n]!=="="){r&&t.push([r.toLowerCase(),""]);continue}for(n++;n<e.length&&/\s/.test(e[n]);)n++;let o="",s=e[n];if(s==='"'||s==="'"){for(n++;n<e.length&&e[n]!==s;)o+=e[n++];n++}else for(;n<e.length&&!/[\s>]/.test(e[n]);)o+=e[n++];r&&t.push([r.toLowerCase(),o])}return t}function Go(e,t){let n=String(t).toLowerCase();return ts(e).filter(([r])=>r===n).length}function wa(e,t){let n=String(e).toLowerCase();kt(n[0])&&(n=n.slice(1));let r=String(t||"").toLowerCase();return n==="action"?r==="form":n==="formaction"?r==="button"||r==="input":!1}function cn(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=>cn(r,n)))}function _a(e){let t=String(e).toLowerCase();return kt(t[0])&&(t=t.slice(1)),t==="action"||t==="formaction"}function Sa(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 R,Jo,ur,Xo,U,Qe=J(()=>{on();Nt();R="__webjs_action",Jo="$$webjsAction",ur=null;Xo=new Set(["multipart/form-data","application/x-www-form-urlencoded"]);U=Symbol("webjs.attr.absent")});function ps(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function Ga(){if(ls||(we=ps(),!we))return;Pt=HTMLSlotElement.prototype.assignedNodes,kr=HTMLSlotElement.prototype.assignedElements,hn=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(D)&&!Tr(this)?$r(this,n):Pt?Pt.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(D)&&!Tr(this)?$r(this,n).filter(r=>r.nodeType===1):kr?kr.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=hn&&hn.get?hn.get.call(this):null;return n||us(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||us(this)}}),Nr=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(D)&&!Tr(this)){let r=Ja(this);if(r){let o=ue(r);o.manualAssign||(o.manualAssign=new Map);let s=n.filter(Boolean);for(let[i,a]of o.manualAssign){if(i===this)continue;let c=a.filter(l=>{let u=l.deref();return u!==void 0&&s.indexOf(u)===-1});c.length!==a.length&&(c.length?o.manualAssign.set(i,c):o.manualAssign.delete(i))}if(s.length?o.manualAssign.set(this,s.map(i=>new WeakRef(i))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let i of s)o.pendingRecordNodes.add(i);else o.pendingRecordNodes=new Set(s);ct(o),fe(r)}return}return Nr?Nr.apply(this,n):void 0},ls=!0}function Dr(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let s=!1,i=o.filter(a=>{let c=a.deref();return c===void 0?!1:(c===t&&(s=!0),!0)});if(i.length!==o.length&&(i.length?n.set(r,i):n.delete(r)),s){let a=e.host;return a&&(r===a||a.contains(r))?r:null}}return null}function Ja(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[P])return le(t,e)?t:null;return null}function Tr(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 $r(e,t){if(e.getAttribute(G)!==re)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Ir(n,new Set,0)}function Ir(e,t,n){if(n>=Ya)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let s=o;if(t.has(s))continue;if(t.add(s),s.hasAttribute(D)){let i=$r(s,{flatten:!1});if(i.length>0)for(let a of Ir(i,t,n+1))r.push(a);else for(let a of Ir(Array.from(s.childNodes),t,n+1))r.push(a)}else if(Pt){let i=Pt.call(s,{flatten:!0});for(let a of i)r.push(a)}else r.push(o)}else r.push(o);return r}function us(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(D)&&t.getAttribute(G)===re?t:null}function ue(e){let t=e,n=t[P];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[P]=n),n}function Br(e){return!!e[P]}function hs(e){let t=ue(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),L.add(n),e.removeChild(n)}ct(t)}function ct(e){let t=e.assignedByName;t.clear();for(let n of e.authored)Xa(t,Ie(e,n),n)}function Ie(e,t){let n=Dr(e,t);if(n)return te(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return bs(t)}function ms(e){let t=ue(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${D}]`);for(let o of r){let s=o;if(!le(e,s)||s.getAttribute(G)!==re||_n(t,e,s))continue;let i=te(s.getAttribute("name"));if(!n.has(i)){n.add(i);let a=Array.from(s.childNodes);for(let c of a)t.authored.push(c),bs(c)!==i&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(c,i));t.lastSnapshot.set(s,a.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if(le(e,o)){for(let s of Array.from(o.childNodes))L.add(s),t.authored.push(s);o.remove()}ct(t)}function te(e){return e==null||e===""||e==="default"?null:e}function bs(e){return e.nodeType!==1?null:te(e.getAttribute("slot"))}function Xa(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function Fe(e,t,n){let r=ue(e),o=te(t),s=Array.isArray(n)?n.filter(Boolean):n?[n]:[],i=r.authored.findIndex(c=>Ie(r,c)===o),a=r.authored.filter(c=>Ie(r,c)===o);r.authored=r.authored.filter(c=>Ie(r,c)!==o),(i===-1||i>r.authored.length)&&(i=r.authored.length);for(let c of s)c.nodeType===1&&!Dr(r,c)&&(o==null?c.removeAttribute("slot"):c.setAttribute("slot",o)),L.add(c);if(r.authored.splice(i,0,...s),r.applying&&r.pendingRecordNodes){for(let c of a)r.pendingRecordNodes.add(c);for(let c of s)r.pendingRecordNodes.add(c)}else r.pendingRecordNodes=new Set([...a,...s]);if(r.adoptedKey){for(let c of a)r.adoptedKey.delete(c);for(let c of s)r.adoptedKey.delete(c)}ct(r),fe(e)}function Za(){ye||!we||(ye=Node.prototype.appendChild,gs=Node.prototype.insertBefore,at=Node.prototype.removeChild,Pr=Node.prototype.replaceChild,ys=Element.prototype.append,ws=Element.prototype.prepend,_s=Element.prototype.replaceChildren,mn=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),Mr=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function yn(e,t){let n=e[W];e[W]=!0;try{return t()}finally{e[W]=n,n||qr(e)}}function Ss(e){if(!we)return;let t=e,n=ue(e);n.backstop||(n.backstop=new MutationObserver(r=>wn(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>As(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function wn(e,t,n){let r=e,o=r[Me],s=r[Symbol.for("webjs.instance")],i=!1,a=new Set;for(let c of n){for(let l of c.addedNodes)if(a.add(l),l!==o&&!(s&&xs(s,l))){if(t.authored.indexOf(l)!==-1){i=!0;continue}L.add(l),t.authored.push(l),i=!0}for(let l of c.removedNodes){let u=t.authored.indexOf(l);if(u===-1||e.contains(l))continue;L.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(u,1),i=!0)}}i&&fe(e)}function qr(e){let t=e,n=t[P];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&wn(e,n,r)}function As(e,t){let n=e[P];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let s=o.target;o.attributeName==="name"?s.tagName==="SLOT"&&s.hasAttribute(D)&&le(e,s)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(s),n.authored.indexOf(s)!==-1&&(r=!0))}r&&fe(e)}function vs(e){let t=e[P];t&&(t.backstop&&(wn(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(As(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function Es(e){if(!we)return;let t=e,n=t[P];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,s=!o&&n.adopted===!0,i=!1;for(let a of Array.from(e.childNodes))if(a!==t[Me]){if(n.authored.indexOf(a)!==-1){i=!0;continue}o&&(!r||xs(r,a))||!o&&s||(L.add(a),n.authored.push(a),i=!0)}i&&fe(e)}function xs(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 Qa(e){let t=e,n=t[Me];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[Me]=n),yn(e,()=>ye.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 jr(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);bn(e,r);for(let o of r)at.call(t,o);return r}return bn(e,[t]),[t]}function bn(e,t){it(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 it(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 Rr(e,t,n){let r=e.authored;for(let s of t){let i=r.indexOf(s);i!==-1&&r.splice(i,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function Cs(e,t){let n=e[P];return n?_n(n,e,t):!1}function _n(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function Lr(e,t){if(L.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[Me])return!0;let r=e[P];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(D)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&le(e,n))}function Or(e,t){let n=[];for(let s of t)Pe(s)?s.nodeType===11?n.push({frag:s}):n.push({node:s}):n.push({text:`${s}`});for(let s of n)s.frag?it(e,Array.from(s.frag.childNodes)):s.node&&bn(e,[s.node]);let r=e.ownerDocument.createDocumentFragment();for(let s of n)if(s.text!==void 0)ye.call(r,e.ownerDocument.createTextNode(s.text));else if(s.frag){let i=Array.from(s.frag.childNodes);bn(e,i);for(let a of i)ye.call(r,a)}else s.node&&(it(e,[s.node]),ye.call(r,s.node));let o=Array.from(r.childNodes);it(e,o);for(let s of o)at.call(r,s);return o}function ce(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);ct(t),fe(e)}function ks(e){if(!we)return;let t=e;if(t[fs])return;Za(),t[fs]=!0;let n=ue(e);t.appendChild=function(r){if(t[W])return ye.call(this,r);let o=jr(e,r,!1);for(let s of o)L.add(s);return Rr(n,o,null),ce(e,n,o),r},t.insertBefore=function(r,o){if(t[W])return gs.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(it(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!Lr(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let s=jr(e,r,!1);for(let i of s)L.add(i);return Rr(n,s,o||null),ce(e,n,s),r},t.removeChild=function(r){if(t[W])return at.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return at.call(this,r);if(!Lr(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),ce(e,n,[r]),r},t.replaceChild=function(r,o){if(t[W])return Pr.call(this,r,o);if(n.authored.indexOf(o)===-1)return Pr.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(it(e,r.nodeType===11?Array.from(r.childNodes):[r]),!Lr(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 i=jr(e,r,!1);for(let c of i)L.add(c);for(let c of i){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,...i),ce(e,n,[...i,o]),o},t.append=function(...r){if(t[W])return ys.apply(this,r);let o=Or(e,r);for(let s of o)L.add(s);Rr(n,o,null),ce(e,n,o)},t.prepend=function(...r){if(t[W])return ws.apply(this,r);let o=Or(e,r);for(let s of o)L.add(s);for(let s of o){let i=n.authored.indexOf(s);i!==-1&&n.authored.splice(i,1)}n.authored.unshift(...o),ce(e,n,o)},t.replaceChildren=function(...r){if(t[W])return _s.apply(this,r);let o=Or(e,r);for(let i of o)L.add(i);let s=n.authored;n.authored=o.slice(),ce(e,n,[...s,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return mn.get.call(this)},set(r){if(t[W]){mn.set.call(this,r);return}let o=e.ownerDocument.createElement("div");mn.set.call(o,r===null?"":`${r}`);let s=Array.from(o.childNodes);for(let a of s)L.add(a);let i=n.authored;n.authored=s,ce(e,n,[...i,...s])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return Mr.get.call(this)},set(r){if(t[W]){Mr.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let i of o)L.add(i);let s=n.authored;n.authored=o,ce(e,n,[...s,...o])}})}function fe(e){if(!we)return;let t=e[P];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||ec;t.pendingRecordNodes=void 0,tc(e,t,n),nc(e,t),ct(t);let r=[],o=new Set;for(let u of e.querySelectorAll(`slot[${D}]`))if(le(e,u)&&!_n(t,e,u)){if(!u.hasAttribute(G)&&!(Mt in u)){o.add(te(u.getAttribute("name")));continue}r.push(u)}let s=new Map;for(let u of r){let f=te(u.getAttribute("name")),d=s.get(f);d||(d=[],s.set(f,d)),d.push(u)}let i=[];for(let[u,f]of s){let d=t.assignedByName.get(u)||[];for(let p=0;p<f.length;p++){let m=f[p],w=d.filter(A=>{let b=Dr(t,A);return b?b===m:p===0}),g=w.filter(A=>A===e||A.nodeType===1&&A.contains(e));if(g.length){for(let A of g)L.delete(A);w=w.filter(A=>g.indexOf(A)===-1)}w.length>0?oc(t,m,w)&&i.push(m):sc(t,m)&&i.push(m)}}for(let u of i)ac(t,u);let a=new Set(s.keys());for(let u of o)a.add(u);let c=new Set;for(let u of t.authored)a.has(Ie(t,u))||c.add(u);let l=e[Me];if(l)for(let u of Array.from(l.childNodes))c.has(u)||at.call(l,u);if(c.size){let u=Qa(e);for(let f of c)f.parentNode!==u&&(L.delete(f),yn(e,()=>ye.call(u,f)))}if(t.backstop){let u=t.backstop.takeRecords();u.length&&wn(e,t,u)}}while(t.reapply)}finally{t.applying=!1}}}function tc(e,t,n){for(let r of e.querySelectorAll(`slot[${D}][${G}="${re}"]`)){if(!le(e,r)||_n(t,e,r))continue;let o=r,s=t.lastSnapshot.get(o);if(!s)continue;let i=Array.from(o.childNodes);if(Fr(i,s))continue;let a=t.authored,c=te(o.getAttribute("name")),l=i.filter(m=>!n.has(m));for(let m of l)a.indexOf(m)===-1&&Ie(t,m)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(m,c));for(let m of a){if(l.indexOf(m)!==-1||Ie(t,m)!==c)continue;let w=a.indexOf(m),g=0;for(let A=0;A<l.length;A++){let b=a.indexOf(l[A]);b!==-1&&b<w&&(g=A+1)}l.splice(g,0,m)}let u=new Set(l);for(let m of s)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 nc(e,t){let n=e[Me];t.authored=t.authored.filter(r=>{if(L.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(D)&&(t.lastSnapshot.has(o)||e.contains(o)&&le(e,o)))})}function Ns(e){if(!we)return!1;for(let t of e.querySelectorAll(`slot[${D}][${G}]`))if(le(e,t))return!0;return!1}function le(e,t){let n=t[gn];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(Ka):null;if(r){let o=rc(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 rc(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 oc(e,t,n){for(let l of n)L.delete(l);let r=t.getAttribute(G)!==re,o=e.lastSnapshot.get(t)||[],s=r||!Fr(o,n);if(!r&&Fr(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),s;let i=t[Mt];if(r&&i)for(;t.firstChild;)i.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(G,re),e.lastSnapshot.set(t,n.slice()),s}function sc(e,t){let n=t.getAttribute(G)===re;if(t.setAttribute(G,za),!n)return ds(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return ds(t),!0}function ds(e){let t=e[Mt];!t||t.childNodes.length===0||e.appendChild(t)}function Ts(e,t){if(!Br(e))return;let n=ue(e),r=te(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let s of o)s.parentNode===t&&(L.add(s),t.removeChild(s));n.lastSnapshot.delete(t)}function ic(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function ac(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)ic(r)}))}function Fr(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 we,P,D,G,re,za,Mt,gn,Ka,Ya,Pt,kr,hn,Nr,ls,W,fs,Me,L,ye,gs,at,Pr,ys,ws,_s,mn,Mr,ec,Sn=J(()=>{we=ps(),P=Symbol("webjs.slot.state"),D="data-webjs-light",G="data-projection",re="actual",za="fallback",Mt=Symbol("webjs.slot.fallbackFrag"),gn=Symbol("webjs.slot.templateOwner"),Ka="data-wj-slot-owner",Ya=64,Pt=null,kr=null,hn=null,Nr=null,ls=!1;Ga();W=Symbol("webjs.slot.rendering"),fs=Symbol("webjs.slot.intercepted"),Me=Symbol("webjs.slot.park"),L=new WeakSet,ye=null,gs=null,at=null,Pr=null,ys=null,ws=null,_s=null,mn=null,Mr=null;ec=new Set});function Ws(e,t,n){Pc.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function Wt(e){return JSON.stringify(await Vs(e))}function de(e){return zs(JSON.parse(e))}async function Vs(e){let t=Mc();return await Fc(e,t),De(e,t)}function zs(e){return Se(e,Hc())}function Mc(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function Fc(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!Wc(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 s=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,s);continue}if(typeof FormData<"u"&&r instanceof FormData){let s=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,s);for(let[,i]of s)typeof i!="string"&&n.push(i);continue}if(Array.isArray(r))for(let s=0;s<r.length;s++)n.push(r[s]);else if(r instanceof Map)for(let[s,i]of r)n.push(s),n.push(i);else if(r instanceof Set)for(let s of r)n.push(s);else if(Vc(r))for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&n.push(r[s])}}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{[O]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[O]:"NaN"}:e===1/0?{[O]:"Inf"}:e===-1/0?{[O]:"-Inf"}:Object.is(e,-0)?{[O]:"-0"}:e;if(n==="bigint")return{[O]:"BigInt",v:e.toString()};if(n==="symbol"){let s=Symbol.keyFor(e);if(s===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[O]:"Sym",v:s}}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{[O]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[O]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[O]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let s=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[O]:"File",v:Ut(s),n:e.name,t:e.type||"",m:e.lastModified}:o={[O]:"Blob",v:Ut(s),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let s=t.fdEntries.get(e)||[...e.entries()],i=[];for(let[a,c]of s)i.push([a,De(c,t)]);o={[O]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=Dc(e);else if(e instanceof Map){let s=[];for(let[i,a]of e)s.push([De(i,t),De(a,t)]);o={[O]:"Map",v:s}}else if(e instanceof Set){let s=[];for(let i of e)s.push(De(i,t));o={[O]:"Set",v:s}}else if(Array.isArray(e))o=e.map(s=>De(s,t));else{o={};for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let i=zc(s)?"_"+s:s;Ws(o,i,De(e[s],t))}}if(r!==void 0){if(Array.isArray(o))return{[O]:"Arr",_id:r,v:o};o._id=r}return o}function Dc(e){if(e instanceof ArrayBuffer)return{[O]:"buf",v:Ut(new Uint8Array(e))};if(e instanceof DataView)return{[O]:"dv",v:Ut(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=Bc[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[O]:n,v:Ut(r)}}function Hc(){return{refs:new Map}}function Se(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let s=[];for(let i=0;i<e.length;i++)s.push(Se(e[i],t));return s}let n=e[O];if(typeof n=="string")return Uc(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s)||s==="_id")continue;let i=Kc(s)?s.slice(1):s;Ws(r,i,Se(e[s],t))}return r}function Uc(e,t,n){let r=e._id,o=s=>(typeof r=="number"&&n.refs.set(r,s),s);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 s=new Error(e.v.message);return s.name=e.v.name,e.v.stack&&(s.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,s),s}case"Map":{let s=new Map;typeof r=="number"&&n.refs.set(r,s);for(let[i,a]of e.v)s.set(Se(i,n),Se(a,n));return s}case"Set":{let s=new Set;typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.add(Se(i,n));return s}case"Arr":{let s=[];typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.push(Se(i,n));return s}case"Ref":{let s=n.refs.get(e.v);if(s===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return s}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let s=Ht(e.v);return o(new Blob([s],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let s=Ht(e.v);return o(new File([s],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 s=new FormData;o(s);for(let[i,a]of e.v){let c=Se(a,n);s.append(i,c)}return s}default:{if(t==="buf"){let i=Ht(e.v);return o(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=Ht(e.v);return o(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let s=qc[t];if(s){let i=Ht(e.v),a=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength);return o(new s(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function Wc(e){return e!==null&&typeof e=="object"}function Vc(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function zc(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function Kc(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function Ut(e){if(Ks)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 Ht(e){if(Ks){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 O,Pc,Bc,qc,Ks,pt=J(()=>{O="_$wj",Pc=new Set(["__proto__","constructor","prototype"]);Bc={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},qc={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};Ks=typeof Buffer<"u"&&typeof Buffer.from=="function"});var ui={};Yo(ui,{observeLazy:()=>Bl,observeViewportOnce:()=>Ul});function li(e){let t=io.get(e);return t||(t=import(e).finally(()=>io.delete(e)),io.set(e,t),t)}function Bl(e){for(let[t,n]of Object.entries(e))Be.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of Be.values())li(t);Be.clear();return}Yt||(Yt=new IntersectionObserver(ql,{rootMargin:"200px"})),ci(),typeof MutationObserver<"u"&&new MutationObserver(()=>ci()).observe(document.body,{childList:!0,subtree:!0})}function ci(){if(!(!Yt||!Be.size))for(let e of Be.keys())for(let t of document.querySelectorAll(e))Yt.observe(t)}function ql(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=Be.get(n);r&&(li(r),Be.delete(n),Yt?.unobserve(t.target))}}function Hl(e){for(let t of e){if(!t.isIntersecting)continue;let n=Pn.get(t.target);Pn.delete(t.target),Kt?.unobserve(t.target),n&&n()}}function Ul(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(Kt||(Kt=new IntersectionObserver(Hl,{rootMargin:"200px"})),Pn.set(e,t),Kt.observe(e),()=>{Pn.delete(e),Kt?.unobserve(e)})}var Be,Yt,io,Kt,Pn,fi=J(()=>{Be=new Map,Yt=null,io=new Map;Kt=null,Pn=new WeakMap});var ao,co=J(()=>{ao=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(()=>(fi(),ui)).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(()=>(lo(),di)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&ao&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",ao)});function Vl(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 fo(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let s=n.createElement("template");s.innerHTML=e,r=s.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 s of o)n.body.append(s);else n.body.append(r)}var Wl,uo,Mn=J(()=>{Wl=new Set(["append","prepend","before","after","replace","update"]);uo=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 i=n.getElementById(o);i&&(r=[i])}else{let i=this.getAttribute("targets");if(i)try{r=Array.from(n.querySelectorAll(i))}catch{r=[]}}let s=Wl.has(t)?this.querySelector("template"):null;try{for(let i of r){let a=s?s.content.cloneNode(!0):null;Vl(t,i,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&uo&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",uo)});var pi,hi=J(()=>{pi=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&pi&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",pi)});function Fn(e,t){let n=typeof document<"u"?document:null,r=e||n;if(!r||typeof r.querySelectorAll!="function")return;if(t&&t.frame===!0){po(r,!0);return}gi();let o=r===n,s=!!n&&!o&&typeof n.contains=="function"&&n.contains(r),i=!!n&&!o&&!s;i&&(po(n,!0),ve.clear(),mo.clear()),(o||i)&&(ho=!0);let a=V.ingested+V.replaced;Yl(po(r),a)}function po(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=Kl(r.getAttribute?.("data-webjs-dev"));o!==null&&(n=o),mi(t?null:r.textContent,r)}for(let r of e.querySelectorAll("[data-webjs-seed]"))mi(t?null:r.getAttribute("data-webjs-seed"),r,()=>r.removeAttribute("data-webjs-seed"));return n}function mi(e,t,n){if(e)try{let r=de(e);if(r&&typeof r=="object")for(let o in r){ve.has(o)?V.replaced++:V.ingested++,ve.set(o,r[o]);let s=o.indexOf("/",o.indexOf("/")+1);s>0&&mo.add(o.slice(0,s))}}catch{}n?n():t.remove?.()}function Kl(e){return typeof e!="string"?null:e||"ok"}function Yl(e,t){if(e===null)return;let n=++zl;mt={epoch:n,hits:V.hits,misses:V.misses,keyMisses:V.keyMisses,merged:t,marker:e};let r=()=>{!mt||mt.epoch!==n||gi()};try{typeof requestIdleCallback=="function"?requestIdleCallback(r,{timeout:1e3}):setTimeout(r,250)}catch{mt=null}}function gi(){let e=mt;if(mt=null,!!e)try{Gl(e)}catch{}}function Gl(e){let t=V.hits-e.hits,n=V.misses-e.misses,r=V.ingested+V.replaced-e.merged,o=V.keyMisses-e.keyMisses;if(n===0)return;let s=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(s===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, ${ve.size} still unconsumed). ${s} See https://webjs.dev/docs/data-fetching for the seeding reference.`)}function Jl(e,t,n){ho||(ho=!0,Fn());let r=`${e}/${t}/${n}`;if(ve.has(r)){let o=ve.get(r);return ve.delete(r),V.hits++,o}return V.misses++,mo.has(`${e}/${t}`)&&V.keyMisses++,bi}function Xl(){return{...V,pending:ve.size}}var ve,bi,ho,V,mo,mt,zl,bo=J(()=>{pt();ve=new Map,bi=Symbol("webjs.seed.miss"),ho=!1,V={ingested:0,replaced:0,hits:0,misses:0,keyMisses:0},mo=new Set,mt=null,zl=0});function go(e){if(!(!Array.isArray(e)||!e.length)){Dn+=1;for(let t of e)t&&yi.set(t,Dn)}}function Ql(){return Dn}function eu(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(bt.delete(e),bt.set(e,{tags:t.slice(),since:typeof n=="number"?n:Dn}),bt.size>Zl)){let r=bt.keys().next().value;r!==void 0&&bt.delete(r)}}function tu(e){let t=bt.get(e);if(!t)return!1;for(let n of t.tags)if((yi.get(n)||0)>t.since)return!0;return!1}function yo(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var Dn,yi,bt,Zl,wo=J(()=>{Dn=0,yi=new Map,bt=new Map,Zl=1e3});var di={};Yo(di,{_FALLBACK_MARKER_KEY:()=>Wn,_FRAME_TOP:()=>Mi,_LIVE_ATTRS:()=>Co,_activateSwappedRange:()=>Ho,_activeFrameId:()=>Pi,_addNewHeadElements:()=>No,_applyOptimisticLoading:()=>Do,_applyStreamedResolve:()=>sa,_applySwap:()=>Fo,_blurOutgoingFocus:()=>Hn,_buildHaveHeader:()=>nn,_buildSubmitFormData:()=>$i,_bumpNavToken:()=>Hu,_clearFormBusy:()=>Qi,_clearFrameBusy:()=>Xi,_collectBoundaries:()=>Et,_currentPageUrl:()=>Uu,_diffElementInPlace:()=>Xn,_eligibleAnchorHref:()=>zn,_encodeSubmitBody:()=>Oi,_findAnchorInPath:()=>Ii,_getSubmitAction:()=>Ri,_getSubmitEnctype:()=>Li,_getSubmitMethod:()=>ji,_isNonHtmlPath:()=>Ku,_isPreBootNavigation:()=>Di,_keyOf:()=>vt,_markFormBusy:()=>Zi,_markFrameBusy:()=>Ji,_mergeHead:()=>na,_navToken:()=>qu,_onPopState:()=>Ro,_onSubmit:()=>Lo,_parseHTML:()=>To,_planBoundarySwap:()=>Bi,_prefetch:()=>xt,_prefetchAnchor:()=>zi,_prefetchCache:()=>$,_prefetchHasHoverPointer:()=>Wi,_prefetchInflightSize:()=>Fu,_prefetchMode:()=>Kn,_prefetchPeek:()=>Mu,_prefetchSaysSaveData:()=>Io,_prefetchSuppressed:()=>Vi,_prefetchTake:()=>Ki,_reactivateScripts:()=>tr,_readStreamedShell:()=>ra,_reconcileChildren:()=>sr,_regraftPermanentElements:()=>ea,_regraftPermanentInSlice:()=>or,_resetParseProbe:()=>ru,_resetPrefetch:()=>Du,_resetWarnOnce:()=>Vu,_resolveTargetFrameId:()=>Oo,_restoreOptimistic:()=>Gt,_runWithTransition:()=>qn,_setCurrentPageUrl:()=>Wu,_setHardNavigate:()=>Bu,_shouldFullLoadDuringParse:()=>zu,_snapshotCache:()=>z,_streamBoundariesProgressively:()=>ia,_takeResolveUnit:()=>oa,_viewTransitionsEnabled:()=>Mo,collectBoundaries:()=>Et,disableClientRouter:()=>Ci,enableClientRouter:()=>jo,loadFrame:()=>lu,navigate:()=>ki,planBoundarySwap:()=>Bi,revalidate:()=>Ni});function To(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"&&nu()?Document.parseHTMLUnsafe(e):ou(e)}function nu(){if(gt!==null)return gt;try{gt=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{gt=!1}return gt}function ru(){gt=null}function ou(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}function su(){_o||typeof MutationObserver>"u"||typeof customElements>"u"||(_o=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)}}),_o.observe(document.body,{childList:!0,subtree:!0}))}function xi(){if(typeof document>"u"||!document.documentElement)return()=>{};ne&&ne();let e=document.documentElement,t=e.style.getPropertyValue("overflow-anchor");e.style.setProperty("overflow-anchor","none");let n=null,r=()=>{if(ne===r){if(ne=null,n&&(clearTimeout(n),n=null),typeof window<"u")for(let o of Un)window.removeEventListener(o,r,{capture:!0});t?e.style.setProperty("overflow-anchor",t):e.style.removeProperty("overflow-anchor")}};if(ne=r,n=setTimeout(r,iu),typeof window<"u")for(let o of Un)window.addEventListener(o,r,{capture:!0,passive:!0});return r}function au(e,t){if(typeof window>"u"||typeof requestAnimationFrame!="function")return;Z&&Z();let n=0,r=null,o=null,s=()=>{if(Z===s){Z=null,n&&cancelAnimationFrame(n),r&&(clearTimeout(r),r=null),o&&(o(),o=null);for(let a of Un)window.removeEventListener(a,s,{capture:!0})}},i=()=>{if(Z!==s)return;if(document.documentElement.scrollHeight-window.innerHeight>=e){window.scrollTo({left:t,top:e,behavior:"instant"}),o=xi(),n&&(cancelAnimationFrame(n),n=0);return}n=requestAnimationFrame(i)};Z=s;for(let a of Un)window.addEventListener(a,s,{capture:!0,passive:!0});r=setTimeout(s,Ei),n=requestAnimationFrame(i)}function cu(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function jo(){he||typeof document>"u"||(he=!0,document.addEventListener("click",Ti,!1),document.addEventListener("submit",Lo,!1),window.addEventListener("popstate",Ro),document.addEventListener("pointerover",At,!0),document.addEventListener("focusin",At,!0),document.addEventListener("touchstart",At,{capture:!0,passive:!0}),document.addEventListener("pointerout",Yi,!0),document.addEventListener("webjs:navigate",xo),su(),xo(),typeof history<"u"&&"scrollRestoration"in history&&(Bn=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(ae=location.href),du())}function Ci(){he&&(he=!1,document.removeEventListener("click",Ti,!1),document.removeEventListener("submit",Lo,!1),window.removeEventListener("popstate",Ro),document.removeEventListener("pointerover",At,!0),document.removeEventListener("focusin",At,!0),document.removeEventListener("touchstart",At,{capture:!0}),document.removeEventListener("pointerout",Yi,!0),document.removeEventListener("webjs:navigate",xo),rr(),Po(),xe&&(xe.disconnect(),xe=null),typeof history<"u"&&Bn!==null&&(history.scrollRestoration=Bn,Bn=null),Jt+=1,ne&&ne(),Z&&Z(),ae=null)}async function ki(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){He(e);return}await $o(n.href,t?.replace??!1,null)}async function lu(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};Q&&Q.abort(),Q=new AbortController;let o=Q.signal,s=++q;return Yn(r.href,n,!1,null,"GET",null,o,s)}function Ni(e){if(!e){z.clear(),$.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;z.delete(n),$.delete(n)}function Ti(e){if(!he||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Ii(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||nr.test(r.pathname))return;e.preventDefault();let o=Oo(t);$o(n,!1,o)}function Ro(e){$o(location.href,!0,null)}function Lo(e){if(!he||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=ji(t,n);if(o==="dialog")return;let s=Li(t,n),i=o==="get"||o==="head",a=Ri(t,n),c;try{c=new URL(a,location.href)}catch{return}if(c.origin!==location.origin||nr.test(c.pathname))return;let l=$i(t,n);if(fu(t,n,o,l),!i&&s==="text/plain")return;let u=Oi(l,s);e.preventDefault();let f=Oo(n||t);bu(c.href,o,u,f,t)}function ji(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function Ri(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function uu(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 Li(e,t){return uu(t&&t.getAttribute("formenctype")||e.getAttribute("enctype"))}function Oi(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 $i(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 Ii(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Pi(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 Oo(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===Mi)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Ue(`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 Pi(e)}function Ue(e,t,n="warn"){if(Ao.has(e)||(Ao.add(e),typeof console>"u"))return;let r=n==="error"?console.error:console.warn;r&&r.call(console,t)}function fu(e,t,n,r){if(typeof process<"u"&&process.env||!r.has(R))return;let o="";try{o=new URL(e.getAttribute("action")||location.href,location.href).pathname}catch{o=location.pathname}if(n!=="post"){Ue(`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 s=t&&t.getAttribute("formenctype")||e.getAttribute("enctype")||"application/x-www-form-urlencoded";if(s.toLowerCase()==="text/plain"){Ue(`submit-nowhere:${o}:${s}`,`[webjs] this submission carries a bound server action's identity but declares enctype="${s}", 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&&Ue(`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 Fi(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function Di(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 du(){if(typeof location>"u"||_i)return;_i=!0;let e=null;try{e=sessionStorage.getItem(Wn),sessionStorage.removeItem(Wn)}catch{}let t="";try{let n=performance.getEntriesByType("navigation")[0];t=n?n.type:""}catch{}Di(t,document.referrer,location.href,e)&&Ee("pre-boot-navigation",location.href,!1)}function Ee(e,t,n=!0){if(n)try{sessionStorage.setItem(Wn,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||Ue(`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 pu(e){typeof process<"u"&&process.env||Ue(`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 Si(){if(typeof process<"u"&&process.env||vo||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;vo=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&Ue("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 Vn(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 Et(e){let t=new Map,n=[],r=!1;function o(s){if(!r){if(s.nodeType===8){let i=s.data.trim();if(i.startsWith("wj:children:")){let a=i.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:s});return}if(i.startsWith("/wj:children")){let a=i.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==s.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:s});return}return}if(s.hasChildNodes&&s.hasChildNodes())for(let i=s.firstChild;i&&!r;i=i.nextSibling)o(i)}}return o(e),r||n.length>0?null:t}function Bi(e,t){let n=[...e.keys()].filter(i=>t.has(i)).sort((i,a)=>i.length-a.length);if(n.length===0)return null;for(let i of n)if(e.get(i).routeKey!==t.get(i).routeKey){let a=null;for(let c of n){if(c===i)break;i.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=i=>{let a=null;for(let c of i.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 qi(e){let t=Ce(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),z.has(t)&&z.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(z.set(t,n);z.size>hu;){let r=z.keys().next().value;z.delete(r)}}function mu(e){let t=Ce(e),n=z.get(t);return n==null?null:(z.delete(t),z.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function Ce(e){let t=new URL(e,location.href);return t.pathname+t.search}async function $o(e,t,n){if(Fi(t,n)&&typeof location<"u"){Ee("readyState-loading",e),He(e);return}Q&&Q.abort(),Q=new AbortController;let r=Q.signal,o=++q;n||(Jt+=1,ne&&ne(),Z&&Z()),ae&&qi(ae);let s=setTimeout(()=>{Vn(!0),s=null},150),i=null;t||(i=Do());try{if(t){let a=mu(e);if(a){let c=To(a.html);if(c){Fo(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=xi():au(a.scrollY,a.scrollX)};if(Mo()&&typeof document.startViewTransition=="function"){let p=Jt;en.then(()=>{p!==Jt||!he||d()}).catch(()=>{})}else d()}let u=Yn(e,n,!1,i,"GET",null,r,o,!0).catch(()=>{}),f=new Promise(d=>setTimeout(d,Ei));Promise.all([u,f]).then(()=>cu(l));return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await Yn(e,n,!t,i,"GET",null,r,o)}finally{s&&clearTimeout(s),o===q&&(Vn(!1),typeof location<"u"&&(ae=location.href))}}async function bu(e,t,n,r,o){Q&&Q.abort(),Q=new AbortController;let s=Q.signal,i=++q;r||(Jt+=1,ne&&ne(),Z&&Z());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)}ae&&qi(ae);let l=setTimeout(()=>{Vn(!0),l=null},150),u=Do(),f=o?Zi(o,i,c.href):null,d=!1;try{let p=await Yn(c.href,r,!0,u,a?"GET":t.toUpperCase(),a?null:n,s,i);d=!!(p&&p.ok),!a&&i===q&&(z.clear(),$.clear())}finally{f&&Qi(f,i,c.href,d),l&&clearTimeout(l),i===q&&(Vn(!1),typeof location<"u"&&(ae=location.href))}}function nn(){let e=Et(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}function Io(){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 Wi(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Su(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function zn(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||nr.test(n.pathname)?null:t}function Vi(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Su(e);return t.includes("external")||t.includes("no-prefetch")}function Kn(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 Wi()?"intent":"viewport"}}function xt(e){if(!he||typeof fetch!="function"||Io())return;let t=Ce(e);if(typeof location<"u"&&t===Ce(location.href)||qe.has(t)||Xt.has(t))return;let n=$.get(t);if(n&&Eo()-n.at<Hi)return;if(qe.size>=Ui){for(Xt.add(t),_t.push(e);_t.length>yu;){let s=_t.shift();Xt.delete(Ce(s))}return}let r=nn();if(!r&&typeof document<"u"&&document.readyState==="loading")return;qe.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 s=>{let i=s.headers.get("content-type")||"";if(!/^text\/html\b/i.test(i)||s.status>=400)return;let a=s.headers.get("x-webjs-build"),c=s.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)&&(z.clear(),$.clear());let d=s.redirected&&s.url?s.url:e,p=await s.text();vu(t,{html:p,build:a,src:c,finalUrl:d,at:Eo()})}).catch(()=>{}).finally(()=>{qe.delete(t),Au()})}function Au(){for(;_t.length&&qe.size<Ui;){let e=_t.shift();Xt.delete(Ce(e)),xt(e)}}function vu(e,t){for($.has(e)&&$.delete(e),$.set(e,t);$.size>gu;){let n=$.keys().next().value;$.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 Ki(e,t){let n=Ce(e),r=$.get(n);if(!r)return null;if(Eo()-r.at>=Hi)return $.delete(n),null;let o=zi(r.html);return o&&!new Set(String(t??(nn()||"")).split(",").filter(Boolean)).has(o)?($.delete(n),null):($.delete(n),r)}function Eo(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function At(e){if(!he)return;let t=Gi(e.target);if(!t)return;let n=Kn(t);if(n==="none"||n==="render")return;let r=zn(t);if(r){if(e.type==="touchstart"){xt(r);return}n==="intent"&&(Zt===t&&St||(rr(),Zt=t,St=setTimeout(()=>{St=null,Zt=null,xt(r)},wu)))}}function Yi(e){let t=Gi(e.target);t&&t===Zt&&rr()}function rr(){St&&(clearTimeout(St),St=null),Zt=null}function Po(){for(let e of Qt)clearTimeout(e);Qt.clear(),yt=new WeakMap}function Gi(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 xo(){if(typeof document>"u"||Io())return;let e=typeof IntersectionObserver<"u";e&&(xe?(xe.disconnect(),Po()):xe=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(yt.has(r))continue;let o=setTimeout(()=>{Qt.delete(o),yt.delete(r),xe.unobserve(r);let s=zn(r);s&&Kn(r)==="viewport"&&xt(s)},_u);yt.set(r,o),Qt.add(o)}else{let o=yt.get(r);o&&(clearTimeout(o),Qt.delete(o),yt.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=Kn(t);if(n==="render"){let r=zn(t);r&&xt(r)}else n==="viewport"&&e&&xe.observe(t)}}function Eu(e){if(typeof document>"u"||!document.body)return!1;let t=Et(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 s=document.createElement("div");s.setAttribute("role","alert"),s.setAttribute("data-webjs-nav-error","");let i=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";s.textContent=i;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),o.insertBefore(s,n.end),!0}function So(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||Eu(t)||typeof location<"u"&&(Ee("navigation-error-unrecoverable",e),He(e))}async function Yn(e,t,n,r,o,s,i,a,c){o=o||"GET";let l=typeof a=="number"?a:q,u,f=null,d=null,p=null,m=null,w=!1,g=e,A=t?Ji(t,l):null;try{try{let _=o==="GET"&&!s&&!t?Ki(e,r?r.haveKeys:void 0):null;if(_)u=_.html,d=_.build,p=_.src,g=_.finalUrl,m=200,w=!0;else{let E={"x-webjs-router":"1"},T=nn();T&&(E["x-webjs-have"]=T),t&&(E["x-webjs-frame"]=t),s!=null&&o!=="GET"&&o!=="HEAD"&&(E.accept=wi+", text/html");let C={method:o,headers:E,credentials:"same-origin",cache:"no-cache"};i&&(C.signal=i),s!=null&&o!=="GET"&&o!=="HEAD"&&(C.body=s);let v=await fetch(e,C);m=v.status,w=v.ok;let S=yo(v.headers.get("x-webjs-invalidate"));S.length&&go(S);let h=v.headers.get("content-type")||"",y=/^text\/html\b/i.test(h);if(h.toLowerCase().indexOf(wi)===0){let j=await v.text();return l===q&&(Gt(r),fo(j)),{ok:w,status:m,aborted:!1}}if(v.redirected&&v.url&&(g=v.url),v.status===204||v.status===205)return l===q&&n&&history.pushState(null,"",g),{ok:w,status:m,aborted:!1};if(!y)return l===q&&(Gt(r),So(e,v.status,null)),{ok:!1,status:m,aborted:!1};d=v.headers.get("x-webjs-build"),p=v.headers.get("x-webjs-src");let N=await ra(v);u=N.shell,N.streaming&&(f=N)}}catch(_){return _&&_.name==="AbortError"?{ok:!1,status:null,aborted:!0}:l!==q?{ok:!1,status:null,aborted:!0}:(Gt(r),So(e,null,_ instanceof Error?_:new Error(String(_))),{ok:!1,status:null,aborted:!1})}if(l!==q){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:!1,status:m,aborted:!0}}let b=To(u);if(!b)return Gt(r),So(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:m,aborted:!1};if(Fo(b,t,!!c,g,d,p)==="discard"){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:w,status:m,aborted:!1}}if(n&&history.pushState(null,"",g),n){let _=new URL(g);if(_.hash){let E=document.getElementById(_.hash.slice(1));E?E.scrollIntoView():(Si(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else Si(),window.scrollTo({left:0,top:0,behavior:"instant"})}return f&&(f.reader||f.rest)&&en.then(()=>ia(f.reader,f.dec,f.rest,()=>l===q)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:g,frameId:t,from:"navigate"}})),{ok:w,status:m,aborted:!1}}finally{A&&Xi(A,l)}}function Ji(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=Gn.has(n);return Gn.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 Xi(e,t){if(Gn.get(e)!==t)return;Gn.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=Jn.has(e);return Jn.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 Qi(e,t,n,r){if(Jn.get(e)!==t)return;Jn.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 Ai(e){if(!e||!e.head)return"";let t=e.head.querySelectorAll('[data-webjs-track="reload"]');if(!t.length)return"";let n="";for(let r of t)n+=pe(r);return n}function Mo(){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 qn(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(Mo()&&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 ea(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 s=null;try{s=t.querySelector(`#${CSS.escape(o)}`)}catch{s=null}if(!s||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let i=s.parentNode;i&&s!==r&&(i.replaceChild(r,s),tn.add(r))}}function or(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 s of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(s)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let s=xu(t,o);if(!s||s===r)continue;let i=s.parentNode;if(i)i.replaceChild(r,s),tn.add(r);else{let a=t.indexOf(s);a!==-1&&(t[a]=r,tn.add(r))}}}function xu(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 Cu(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&wt(t)}function Fo(e,t,n,r,o,s){let i=!1,a=()=>{if(!i){i=!0;try{Fn(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,w=!1;if(o&&m&&(w=o!==m),!w&&e.head&&e.head.children.length>0){let g=Ai(document),A=Ai(e);g!==A&&(w=!0)}if(w&&typeof location<"u"){z.clear(),$.clear();try{let g="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(g))sessionStorage.removeItem(g),Ee("deploy-mismatch-reload-suppressed",r,!1);else{sessionStorage&&sessionStorage.setItem(g,"1"),Ee("deploy-mismatch",r),He(r);return}}catch{Ee("deploy-mismatch",r),He(r);return}}else if(!w){let g=p?p.getAttribute("data-webjs-src"):null;s&&g&&s!==g&&(z.clear(),$.clear(),p&&p.setAttribute("data-webjs-src",s));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){No(e.head),en=qn(()=>{$u(p,m),tr(p),wt(p),vi(e.body),Hn()},()=>wt(p));return}let w=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(w),w.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=Et(document.body),l=Et(e.body),u=c&&l?Bi(c,l):null;if(u){a();let{mode:p,live:m,incoming:w}=u;No(e.head),en=qn(()=>{p==="replace"?ku(m,w):Nu(m,w,e),Lu(m.start,w.start),vi(e.body),Hn()},()=>Cu(m));return}if(r&&!n&&typeof location<"u"){Ee(c?l?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),He(r);return}if(r&&n)return Ee("revalidation-discarded",r,!1),"discard";a(),na(e.head),ea(document.body,e.body);let f=[...e.body.childNodes];en=qn(()=>{document.body.replaceChildren(...f),tr(document.body),wt(document.body),Hn()},()=>wt(document.body))}function Hn(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function ku(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)r.push(s);let o=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)o.push(document.importNode(s,!0));or(r,o);for(let s of r)s.parentNode===n&&n.removeChild(s);for(let s of o)n.insertBefore(s,e.end);Ho(e)}function Nu(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)o.push(i);let s=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)s.push(document.importNode(i,!0));or(o,s),Tu(r,e.start,e.end,o,s),Ho(e)}function Tu(e,t,n,r,o){let s=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=vt(c);l&&s.set(l,c)}let i=n,a=[];for(let c of o){if(c.nodeType===1){let l=vt(c);if(l&&s.has(l)){let u=s.get(l);Xn(u,c),a.push(u),s.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,i)}function Xn(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),!Co.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])Co.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(ju(e)){Ou(e,t);return}sr(e,t)}function ju(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[P]!=null}function Ru(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function Zn(e){let t=new Map,n=`slot[${D}][${G}="${re}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!Ru(o,e)||Cs(e,o))continue;let s=!1;for(let a=o.parentElement;a&&a!==e;a=a.parentElement)if(a.tagName==="SLOT"&&a.hasAttribute(D)&&a.getAttribute(G)===re){s=!0;break}if(s)continue;let i=te(o.getAttribute("name"));t.has(i)||t.set(i,o)}return t}function Lu(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(D))return;let o=null;for(let f=r.parentElement;f;f=f.parentElement){if(f[P]){o=f;break}if(f.tagName.includes("-"))return}if(!o)return;let s=te(r.getAttribute("name"));Fe(o,s,[...r.childNodes]);let i=t.parentNode;if(!i||i.nodeType!==1)return;let a=i;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=Zn(o),u=Zn(c);for(let f of new Set([...l.keys(),...u.keys()])){if(f===s)continue;let d=u.get(f);d?Fe(o,f,[...d.childNodes].map(p=>document.importNode(p,!0))):l.get(f)&&Fe(o,f,null)}}function Ou(e,t){if(!e[P])return;let n=Zn(e),r=Zn(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let s of o){let i=n.get(s),a=r.get(s);i&&a?(sr(i,a),Fe(e,s,[...i.childNodes])):a?Fe(e,s,[...a.childNodes].map(c=>document.importNode(c,!0))):Fe(e,s,null)}}function sr(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));or(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=vt(a);c&&o.set(c,a)}let s=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=vt(c);if(l&&o.has(l)){let f=o.get(l);Xn(f,c),s.push(f),o.delete(l);continue}let u=n[a];if(u&&u.nodeType===1&&!vt(u)&&u.tagName===c.tagName){Xn(u,c),s.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),s.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),s.push(l);continue}}s.push(c)}let i=new Set(s);for(let a of n)!i.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<s.length;a++){let c=s[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function vt(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Do(){let e=Et(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),s=nn(),i=[];for(let c=o.start.nextSibling;c&&c!==o.end;c=c.nextSibling)i.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:i,token:q,haveKeys:s}}function Gt(e){if(!e||e.token!==q)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 $u(e,t){sr(e,t)}function ta(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function Qn(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=ta();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Bo(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=ta();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function pe(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function er(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 Iu(e){if(!e.querySelector("meta"))return;let t=o=>{let s=new Map;for(let i of o.querySelectorAll("meta")){let a=er(i);if(!a||a===ko)continue;let c=s.get(a);c?c.push(i):s.set(a,[i])}return s},n=t(e),r=t(document.head);for(let[o,s]of n){let i=r.get(o)||[],a=s.map(pe).join(`
1
+ var ua=Object.defineProperty;var J=(e,t)=>()=>(e&&(t=e(e=0)),t);var Yo=(e,t)=>{for(var n in t)ua(e,n,{get:t[n],enumerable:!0})};function Nt(e){return Object.prototype.hasOwnProperty.call(Ve,e)}var Ve,on=J(()=>{Ve=Object.freeze({"@":"event",".":"prop","?":"bool"})});function sn(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function H(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var Tt=J(()=>{});function da(e){ur=e}function an(e){if(typeof e!="function")return null;let t=e[Jo];return typeof t=="string"&&t?t:null}async function Rt(e){let t=an(e);if(t)return t;if(typeof e!="function"||!ur)return null;try{let n=await ur(e);return typeof n=="string"&&n?n:null}catch{return null}}function ze(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 Ke(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 fr(e,t){let n=String(e||"").toLowerCase(),r=t==null?null:String(t).toLowerCase();if(pa(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 pa(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 Ye(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 dr(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 Ge(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 Je(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 pr(e,t){let r=(e||[]).filter(o=>Xe(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 Xe(e){let t=String(e).toLowerCase();return t==="name"||t==="value"||t==="formaction"||t==="formmethod"||t==="formenctype"}function ha(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&&!Xo.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 X(e,t,n){if(cn(e)&&Sa(t))throw new Error(Aa(t,n))}function Lt(e,t,n){_a(t,n)&&X(e,t,n)}function be(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 ma(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&&!Xo.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 hr(e,t){let n=Ze(e);Ot({staticAction:n.has("action")});let r=Zo(n.has("method")?n.get("method"):U,n.has("enctype")?n.get("enctype"):U),o=e.endsWith("/>")?"/>":">",s=e.slice(0,e.length-o.length),i="";return r.method!==null&&(i+=` method="${r.method}"`),r.enctype!==null&&(i+=` enctype="${r.enctype}"`),{tag:s+i+o,hidden:ba(t)}}function Ot(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 Zo(e,t){let n=e!==U&&e!=null,r=t!==U&&t!=null;return ma(n?e:null,r?t:null),{method:n?null:"post",enctype:r?null:"multipart/form-data"}}function mr(e,t,n){let r=t!==U&&t!=null,o=n!==U&&n!=null;return ha(e,r?t:null,o?n:null),{formMethod:r?null:"post",formEnctype:o?null:"multipart/form-data"}}function br(e,t,n){ya(e,t,n);let r=Ze(e),o=mr(t,r.has("formmethod")?r.get("formmethod"):U,r.has("formenctype")?r.get("formenctype"):U),s=e.endsWith("/>")?"/>":">",i=e.slice(0,e.length-s.length),a="";return o.formMethod!==null&&(a+=` formmethod="${o.formMethod}"`),o.formEnctype!==null&&(a+=` formenctype="${o.formEnctype}"`),i+a+s}function ba(e){return`<input type="hidden" name="${R}" value="${H(e)}">`}function Qo(e,t,n,r,o){let s=typeof t=="function"?an(t):null;if(!s){typeof t=="function"&&be(null,e.localName),wa(e,n,r,o.propAttrs);return}Ot(o);let i=Zo(n,r);e.removeAttribute("action"),jt(e,"method",n,i.method),jt(e,"enctype",r,i.enctype),ga(e,s)}function jt(e,t,n,r){if(r!==null){e.setAttribute(t,r);return}n!==U&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function ga(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 ya(e,t,n){let r=Ze(e),o=r.has("type")?r.get("type"):null;pr(n.propAttrs,t),Je(!!n.duplicateAction,t),r.has("formaction")&&dr(t),Go(e,"value")>1&&Ye(t),Go(e,"name")>1&&Ke(r.get("name")||R,t,!1),fr(t,o),r.has("form")&&Ge(t)}function wa(e,t,n,r){let o=e.firstElementChild;if(o&&o.localName==="input"&&o.getAttribute("name")===R)o.remove();else for(let i of e.children)if(i.localName==="input"&&i.getAttribute("name")===R){i.remove();break}let s=i=>(r||[]).some(a=>{let c=String(a).toLowerCase();return c===i||i==="enctype"&&c==="encoding"});t===U&&!s("method")&&e.removeAttribute("method"),n===U&&!s("enctype")&&e.removeAttribute("enctype")}function es(e,t,n,r){let o=s=>(r||[]).some(i=>String(i).toLowerCase()===s);t===U&&!o("formmethod")&&e.removeAttribute("formmethod"),n===U&&!o("formenctype")&&e.removeAttribute("formenctype")}function Ze(e){return new Map(ts(e))}function ts(e){let t=[],n=1;for(;n<e.length&&!/[\s/>]/.test(e[n]);)n++;for(;n<e.length;){for(;n<e.length&&/[\s/]/.test(e[n]);)n++;if(n>=e.length||e[n]===">")break;let r="";for(;n<e.length&&!/[\s/>=]/.test(e[n]);)r+=e[n++];for(;n<e.length&&/\s/.test(e[n]);)n++;if(e[n]!=="="){r&&t.push([r.toLowerCase(),""]);continue}for(n++;n<e.length&&/\s/.test(e[n]);)n++;let o="",s=e[n];if(s==='"'||s==="'"){for(n++;n<e.length&&e[n]!==s;)o+=e[n++];n++}else for(;n<e.length&&!/[\s>]/.test(e[n]);)o+=e[n++];r&&t.push([r.toLowerCase(),o])}return t}function Go(e,t){let n=String(t).toLowerCase();return ts(e).filter(([r])=>r===n).length}function _a(e,t){let n=String(e).toLowerCase();Nt(n[0])&&(n=n.slice(1));let r=String(t||"").toLowerCase();return n==="action"?r==="form":n==="formaction"?r==="button"||r==="input":!1}function cn(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=>cn(r,n)))}function Sa(e){let t=String(e).toLowerCase();return Nt(t[0])&&(t=t.slice(1)),t==="action"||t==="formaction"}function Aa(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 R,Jo,ur,Xo,U,Qe=J(()=>{on();Tt();R="__webjs_action",Jo="$$webjsAction",ur=null;Xo=new Set(["multipart/form-data","application/x-www-form-urlencoded"]);U=Symbol("webjs.attr.absent")});function ps(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function Ja(){if(ls||(we=ps(),!we))return;Mt=HTMLSlotElement.prototype.assignedNodes,kr=HTMLSlotElement.prototype.assignedElements,hn=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(D)&&!Tr(this)?$r(this,n):Mt?Mt.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(D)&&!Tr(this)?$r(this,n).filter(r=>r.nodeType===1):kr?kr.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=hn&&hn.get?hn.get.call(this):null;return n||us(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||us(this)}}),Nr=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(D)&&!Tr(this)){let r=Xa(this);if(r){let o=ue(r);o.manualAssign||(o.manualAssign=new Map);let s=n.filter(Boolean);for(let[i,a]of o.manualAssign){if(i===this)continue;let c=a.filter(l=>{let u=l.deref();return u!==void 0&&s.indexOf(u)===-1});c.length!==a.length&&(c.length?o.manualAssign.set(i,c):o.manualAssign.delete(i))}if(s.length?o.manualAssign.set(this,s.map(i=>new WeakRef(i))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let i of s)o.pendingRecordNodes.add(i);else o.pendingRecordNodes=new Set(s);ct(o),fe(r)}return}return Nr?Nr.apply(this,n):void 0},ls=!0}function Dr(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let s=!1,i=o.filter(a=>{let c=a.deref();return c===void 0?!1:(c===t&&(s=!0),!0)});if(i.length!==o.length&&(i.length?n.set(r,i):n.delete(r)),s){let a=e.host;return a&&(r===a||a.contains(r))?r:null}}return null}function Xa(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[P])return le(t,e)?t:null;return null}function Tr(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 $r(e,t){if(e.getAttribute(G)!==re)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Ir(n,new Set,0)}function Ir(e,t,n){if(n>=Ga)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let s=o;if(t.has(s))continue;if(t.add(s),s.hasAttribute(D)){let i=$r(s,{flatten:!1});if(i.length>0)for(let a of Ir(i,t,n+1))r.push(a);else for(let a of Ir(Array.from(s.childNodes),t,n+1))r.push(a)}else if(Mt){let i=Mt.call(s,{flatten:!0});for(let a of i)r.push(a)}else r.push(o)}else r.push(o);return r}function us(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(D)&&t.getAttribute(G)===re?t:null}function ue(e){let t=e,n=t[P];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[P]=n),n}function Br(e){return!!e[P]}function hs(e){let t=ue(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),L.add(n),e.removeChild(n)}ct(t)}function ct(e){let t=e.assignedByName;t.clear();for(let n of e.authored)Za(t,Ie(e,n),n)}function Ie(e,t){let n=Dr(e,t);if(n)return te(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return bs(t)}function ms(e){let t=ue(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${D}]`);for(let o of r){let s=o;if(!le(e,s)||s.getAttribute(G)!==re||_n(t,e,s))continue;let i=te(s.getAttribute("name"));if(!n.has(i)){n.add(i);let a=Array.from(s.childNodes);for(let c of a)t.authored.push(c),bs(c)!==i&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(c,i));t.lastSnapshot.set(s,a.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if(le(e,o)){for(let s of Array.from(o.childNodes))L.add(s),t.authored.push(s);o.remove()}ct(t)}function te(e){return e==null||e===""||e==="default"?null:e}function bs(e){return e.nodeType!==1?null:te(e.getAttribute("slot"))}function Za(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function Fe(e,t,n){let r=ue(e),o=te(t),s=Array.isArray(n)?n.filter(Boolean):n?[n]:[],i=r.authored.findIndex(c=>Ie(r,c)===o),a=r.authored.filter(c=>Ie(r,c)===o);r.authored=r.authored.filter(c=>Ie(r,c)!==o),(i===-1||i>r.authored.length)&&(i=r.authored.length);for(let c of s)c.nodeType===1&&!Dr(r,c)&&(o==null?c.removeAttribute("slot"):c.setAttribute("slot",o)),L.add(c);if(r.authored.splice(i,0,...s),r.applying&&r.pendingRecordNodes){for(let c of a)r.pendingRecordNodes.add(c);for(let c of s)r.pendingRecordNodes.add(c)}else r.pendingRecordNodes=new Set([...a,...s]);if(r.adoptedKey){for(let c of a)r.adoptedKey.delete(c);for(let c of s)r.adoptedKey.delete(c)}ct(r),fe(e)}function Qa(){ye||!we||(ye=Node.prototype.appendChild,gs=Node.prototype.insertBefore,at=Node.prototype.removeChild,Pr=Node.prototype.replaceChild,ys=Element.prototype.append,ws=Element.prototype.prepend,_s=Element.prototype.replaceChildren,mn=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),Mr=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function yn(e,t){let n=e[W];e[W]=!0;try{return t()}finally{e[W]=n,n||qr(e)}}function Ss(e){if(!we)return;let t=e,n=ue(e);n.backstop||(n.backstop=new MutationObserver(r=>wn(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>As(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function wn(e,t,n){let r=e,o=r[Me],s=r[Symbol.for("webjs.instance")],i=!1,a=new Set;for(let c of n){for(let l of c.addedNodes)if(a.add(l),l!==o&&!(s&&xs(s,l))){if(t.authored.indexOf(l)!==-1){i=!0;continue}L.add(l),t.authored.push(l),i=!0}for(let l of c.removedNodes){let u=t.authored.indexOf(l);if(u===-1||e.contains(l))continue;L.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(u,1),i=!0)}}i&&fe(e)}function qr(e){let t=e,n=t[P];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&wn(e,n,r)}function As(e,t){let n=e[P];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let s=o.target;o.attributeName==="name"?s.tagName==="SLOT"&&s.hasAttribute(D)&&le(e,s)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(s),n.authored.indexOf(s)!==-1&&(r=!0))}r&&fe(e)}function vs(e){let t=e[P];t&&(t.backstop&&(wn(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(As(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function Es(e){if(!we)return;let t=e,n=t[P];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,s=!o&&n.adopted===!0,i=!1;for(let a of Array.from(e.childNodes))if(a!==t[Me]){if(n.authored.indexOf(a)!==-1){i=!0;continue}o&&(!r||xs(r,a))||!o&&s||(L.add(a),n.authored.push(a),i=!0)}i&&fe(e)}function xs(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 ec(e){let t=e,n=t[Me];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[Me]=n),yn(e,()=>ye.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 jr(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);bn(e,r);for(let o of r)at.call(t,o);return r}return bn(e,[t]),[t]}function bn(e,t){it(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 it(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 Rr(e,t,n){let r=e.authored;for(let s of t){let i=r.indexOf(s);i!==-1&&r.splice(i,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function Cs(e,t){let n=e[P];return n?_n(n,e,t):!1}function _n(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function Lr(e,t){if(L.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[Me])return!0;let r=e[P];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(D)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&le(e,n))}function Or(e,t){let n=[];for(let s of t)Pe(s)?s.nodeType===11?n.push({frag:s}):n.push({node:s}):n.push({text:`${s}`});for(let s of n)s.frag?it(e,Array.from(s.frag.childNodes)):s.node&&bn(e,[s.node]);let r=e.ownerDocument.createDocumentFragment();for(let s of n)if(s.text!==void 0)ye.call(r,e.ownerDocument.createTextNode(s.text));else if(s.frag){let i=Array.from(s.frag.childNodes);bn(e,i);for(let a of i)ye.call(r,a)}else s.node&&(it(e,[s.node]),ye.call(r,s.node));let o=Array.from(r.childNodes);it(e,o);for(let s of o)at.call(r,s);return o}function ce(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);ct(t),fe(e)}function ks(e){if(!we)return;let t=e;if(t[fs])return;Qa(),t[fs]=!0;let n=ue(e);t.appendChild=function(r){if(t[W])return ye.call(this,r);let o=jr(e,r,!1);for(let s of o)L.add(s);return Rr(n,o,null),ce(e,n,o),r},t.insertBefore=function(r,o){if(t[W])return gs.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(it(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!Lr(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let s=jr(e,r,!1);for(let i of s)L.add(i);return Rr(n,s,o||null),ce(e,n,s),r},t.removeChild=function(r){if(t[W])return at.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return at.call(this,r);if(!Lr(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),ce(e,n,[r]),r},t.replaceChild=function(r,o){if(t[W])return Pr.call(this,r,o);if(n.authored.indexOf(o)===-1)return Pr.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(it(e,r.nodeType===11?Array.from(r.childNodes):[r]),!Lr(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 i=jr(e,r,!1);for(let c of i)L.add(c);for(let c of i){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,...i),ce(e,n,[...i,o]),o},t.append=function(...r){if(t[W])return ys.apply(this,r);let o=Or(e,r);for(let s of o)L.add(s);Rr(n,o,null),ce(e,n,o)},t.prepend=function(...r){if(t[W])return ws.apply(this,r);let o=Or(e,r);for(let s of o)L.add(s);for(let s of o){let i=n.authored.indexOf(s);i!==-1&&n.authored.splice(i,1)}n.authored.unshift(...o),ce(e,n,o)},t.replaceChildren=function(...r){if(t[W])return _s.apply(this,r);let o=Or(e,r);for(let i of o)L.add(i);let s=n.authored;n.authored=o.slice(),ce(e,n,[...s,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return mn.get.call(this)},set(r){if(t[W]){mn.set.call(this,r);return}let o=e.ownerDocument.createElement("div");mn.set.call(o,r===null?"":`${r}`);let s=Array.from(o.childNodes);for(let a of s)L.add(a);let i=n.authored;n.authored=s,ce(e,n,[...i,...s])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return Mr.get.call(this)},set(r){if(t[W]){Mr.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let i of o)L.add(i);let s=n.authored;n.authored=o,ce(e,n,[...s,...o])}})}function fe(e){if(!we)return;let t=e[P];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||tc;t.pendingRecordNodes=void 0,nc(e,t,n),rc(e,t),ct(t);let r=[],o=new Set;for(let u of e.querySelectorAll(`slot[${D}]`))if(le(e,u)&&!_n(t,e,u)){if(!u.hasAttribute(G)&&!(Ft in u)){o.add(te(u.getAttribute("name")));continue}r.push(u)}let s=new Map;for(let u of r){let f=te(u.getAttribute("name")),d=s.get(f);d||(d=[],s.set(f,d)),d.push(u)}let i=[];for(let[u,f]of s){let d=t.assignedByName.get(u)||[];for(let p=0;p<f.length;p++){let m=f[p],w=d.filter(A=>{let b=Dr(t,A);return b?b===m:p===0}),g=w.filter(A=>A===e||A.nodeType===1&&A.contains(e));if(g.length){for(let A of g)L.delete(A);w=w.filter(A=>g.indexOf(A)===-1)}w.length>0?sc(t,m,w)&&i.push(m):ic(t,m)&&i.push(m)}}for(let u of i)cc(t,u);let a=new Set(s.keys());for(let u of o)a.add(u);let c=new Set;for(let u of t.authored)a.has(Ie(t,u))||c.add(u);let l=e[Me];if(l)for(let u of Array.from(l.childNodes))c.has(u)||at.call(l,u);if(c.size){let u=ec(e);for(let f of c)f.parentNode!==u&&(L.delete(f),yn(e,()=>ye.call(u,f)))}if(t.backstop){let u=t.backstop.takeRecords();u.length&&wn(e,t,u)}}while(t.reapply)}finally{t.applying=!1}}}function nc(e,t,n){for(let r of e.querySelectorAll(`slot[${D}][${G}="${re}"]`)){if(!le(e,r)||_n(t,e,r))continue;let o=r,s=t.lastSnapshot.get(o);if(!s)continue;let i=Array.from(o.childNodes);if(Fr(i,s))continue;let a=t.authored,c=te(o.getAttribute("name")),l=i.filter(m=>!n.has(m));for(let m of l)a.indexOf(m)===-1&&Ie(t,m)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(m,c));for(let m of a){if(l.indexOf(m)!==-1||Ie(t,m)!==c)continue;let w=a.indexOf(m),g=0;for(let A=0;A<l.length;A++){let b=a.indexOf(l[A]);b!==-1&&b<w&&(g=A+1)}l.splice(g,0,m)}let u=new Set(l);for(let m of s)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 rc(e,t){let n=e[Me];t.authored=t.authored.filter(r=>{if(L.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(D)&&(t.lastSnapshot.has(o)||e.contains(o)&&le(e,o)))})}function Ns(e){if(!we)return!1;for(let t of e.querySelectorAll(`slot[${D}][${G}]`))if(le(e,t))return!0;return!1}function le(e,t){let n=t[gn];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(Ya):null;if(r){let o=oc(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 oc(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 sc(e,t,n){for(let l of n)L.delete(l);let r=t.getAttribute(G)!==re,o=e.lastSnapshot.get(t)||[],s=r||!Fr(o,n);if(!r&&Fr(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),s;let i=t[Ft];if(r&&i)for(;t.firstChild;)i.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(G,re),e.lastSnapshot.set(t,n.slice()),s}function ic(e,t){let n=t.getAttribute(G)===re;if(t.setAttribute(G,Ka),!n)return ds(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return ds(t),!0}function ds(e){let t=e[Ft];!t||t.childNodes.length===0||e.appendChild(t)}function Ts(e,t){if(!Br(e))return;let n=ue(e),r=te(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let s of o)s.parentNode===t&&(L.add(s),t.removeChild(s));n.lastSnapshot.delete(t)}function ac(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function cc(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)ac(r)}))}function Fr(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 we,P,D,G,re,Ka,Ft,gn,Ya,Ga,Mt,kr,hn,Nr,ls,W,fs,Me,L,ye,gs,at,Pr,ys,ws,_s,mn,Mr,tc,Sn=J(()=>{we=ps(),P=Symbol("webjs.slot.state"),D="data-webjs-light",G="data-projection",re="actual",Ka="fallback",Ft=Symbol("webjs.slot.fallbackFrag"),gn=Symbol("webjs.slot.templateOwner"),Ya="data-wj-slot-owner",Ga=64,Mt=null,kr=null,hn=null,Nr=null,ls=!1;Ja();W=Symbol("webjs.slot.rendering"),fs=Symbol("webjs.slot.intercepted"),Me=Symbol("webjs.slot.park"),L=new WeakSet,ye=null,gs=null,at=null,Pr=null,ys=null,ws=null,_s=null,mn=null,Mr=null;tc=new Set});function Ws(e,t,n){Mc.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function Wt(e){return JSON.stringify(await Vs(e))}function de(e){return zs(JSON.parse(e))}async function Vs(e){let t=Fc();return await Dc(e,t),De(e,t)}function zs(e){return Se(e,Uc())}function Fc(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function Dc(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!Vc(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 s=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,s);continue}if(typeof FormData<"u"&&r instanceof FormData){let s=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,s);for(let[,i]of s)typeof i!="string"&&n.push(i);continue}if(Array.isArray(r))for(let s=0;s<r.length;s++)n.push(r[s]);else if(r instanceof Map)for(let[s,i]of r)n.push(s),n.push(i);else if(r instanceof Set)for(let s of r)n.push(s);else if(zc(r))for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&n.push(r[s])}}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{[O]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[O]:"NaN"}:e===1/0?{[O]:"Inf"}:e===-1/0?{[O]:"-Inf"}:Object.is(e,-0)?{[O]:"-0"}:e;if(n==="bigint")return{[O]:"BigInt",v:e.toString()};if(n==="symbol"){let s=Symbol.keyFor(e);if(s===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[O]:"Sym",v:s}}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{[O]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[O]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[O]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let s=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[O]:"File",v:Ut(s),n:e.name,t:e.type||"",m:e.lastModified}:o={[O]:"Blob",v:Ut(s),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let s=t.fdEntries.get(e)||[...e.entries()],i=[];for(let[a,c]of s)i.push([a,De(c,t)]);o={[O]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=Bc(e);else if(e instanceof Map){let s=[];for(let[i,a]of e)s.push([De(i,t),De(a,t)]);o={[O]:"Map",v:s}}else if(e instanceof Set){let s=[];for(let i of e)s.push(De(i,t));o={[O]:"Set",v:s}}else if(Array.isArray(e))o=e.map(s=>De(s,t));else{o={};for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let i=Kc(s)?"_"+s:s;Ws(o,i,De(e[s],t))}}if(r!==void 0){if(Array.isArray(o))return{[O]:"Arr",_id:r,v:o};o._id=r}return o}function Bc(e){if(e instanceof ArrayBuffer)return{[O]:"buf",v:Ut(new Uint8Array(e))};if(e instanceof DataView)return{[O]:"dv",v:Ut(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=qc[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[O]:n,v:Ut(r)}}function Uc(){return{refs:new Map}}function Se(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let s=[];for(let i=0;i<e.length;i++)s.push(Se(e[i],t));return s}let n=e[O];if(typeof n=="string")return Wc(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s)||s==="_id")continue;let i=Yc(s)?s.slice(1):s;Ws(r,i,Se(e[s],t))}return r}function Wc(e,t,n){let r=e._id,o=s=>(typeof r=="number"&&n.refs.set(r,s),s);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 s=new Error(e.v.message);return s.name=e.v.name,e.v.stack&&(s.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,s),s}case"Map":{let s=new Map;typeof r=="number"&&n.refs.set(r,s);for(let[i,a]of e.v)s.set(Se(i,n),Se(a,n));return s}case"Set":{let s=new Set;typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.add(Se(i,n));return s}case"Arr":{let s=[];typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.push(Se(i,n));return s}case"Ref":{let s=n.refs.get(e.v);if(s===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return s}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let s=Ht(e.v);return o(new Blob([s],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let s=Ht(e.v);return o(new File([s],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 s=new FormData;o(s);for(let[i,a]of e.v){let c=Se(a,n);s.append(i,c)}return s}default:{if(t==="buf"){let i=Ht(e.v);return o(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=Ht(e.v);return o(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let s=Hc[t];if(s){let i=Ht(e.v),a=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength);return o(new s(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function Vc(e){return e!==null&&typeof e=="object"}function zc(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Kc(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function Yc(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function Ut(e){if(Ks)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 Ht(e){if(Ks){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 O,Mc,qc,Hc,Ks,ht=J(()=>{O="_$wj",Mc=new Set(["__proto__","constructor","prototype"]);qc={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},Hc={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};Ks=typeof Buffer<"u"&&typeof Buffer.from=="function"});var ui={};Yo(ui,{observeLazy:()=>Hl,observeViewportOnce:()=>Vl});function li(e){let t=io.get(e);return t||(t=import(e).finally(()=>io.delete(e)),io.set(e,t),t)}function Hl(e){for(let[t,n]of Object.entries(e))Be.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of Be.values())li(t);Be.clear();return}Yt||(Yt=new IntersectionObserver(Ul,{rootMargin:"200px"})),ci(),typeof MutationObserver<"u"&&new MutationObserver(()=>ci()).observe(document.body,{childList:!0,subtree:!0})}function ci(){if(!(!Yt||!Be.size))for(let e of Be.keys())for(let t of document.querySelectorAll(e))Yt.observe(t)}function Ul(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=Be.get(n);r&&(li(r),Be.delete(n),Yt?.unobserve(t.target))}}function Wl(e){for(let t of e){if(!t.isIntersecting)continue;let n=Pn.get(t.target);Pn.delete(t.target),Kt?.unobserve(t.target),n&&n()}}function Vl(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(Kt||(Kt=new IntersectionObserver(Wl,{rootMargin:"200px"})),Pn.set(e,t),Kt.observe(e),()=>{Pn.delete(e),Kt?.unobserve(e)})}var Be,Yt,io,Kt,Pn,fi=J(()=>{Be=new Map,Yt=null,io=new Map;Kt=null,Pn=new WeakMap});var ao,co=J(()=>{ao=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(()=>(fi(),ui)).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(()=>(lo(),di)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&ao&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",ao)});function Kl(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 fo(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let s=n.createElement("template");s.innerHTML=e,r=s.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 s of o)n.body.append(s);else n.body.append(r)}var zl,uo,Mn=J(()=>{zl=new Set(["append","prepend","before","after","replace","update"]);uo=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 i=n.getElementById(o);i&&(r=[i])}else{let i=this.getAttribute("targets");if(i)try{r=Array.from(n.querySelectorAll(i))}catch{r=[]}}let s=zl.has(t)?this.querySelector("template"):null;try{for(let i of r){let a=s?s.content.cloneNode(!0):null;Kl(t,i,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&uo&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",uo)});var pi,hi=J(()=>{pi=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&pi&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",pi)});function Fn(e,t){let n=typeof document<"u"?document:null,r=e||n;if(!r||typeof r.querySelectorAll!="function")return;if(t&&t.frame===!0){po(r,!0);return}gi();let o=r===n,s=!!n&&!o&&typeof n.contains=="function"&&n.contains(r),i=!!n&&!o&&!s;i&&(po(n,!0),ve.clear(),mo.clear()),(o||i)&&(ho=!0);let a=V.ingested+V.replaced;Jl(po(r),a)}function po(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=Gl(r.getAttribute?.("data-webjs-dev"));o!==null&&(n=o),mi(t?null:r.textContent,r)}for(let r of e.querySelectorAll("[data-webjs-seed]"))mi(t?null:r.getAttribute("data-webjs-seed"),r,()=>r.removeAttribute("data-webjs-seed"));return n}function mi(e,t,n){if(e)try{let r=de(e);if(r&&typeof r=="object")for(let o in r){ve.has(o)?V.replaced++:V.ingested++,ve.set(o,r[o]);let s=o.indexOf("/",o.indexOf("/")+1);s>0&&mo.add(o.slice(0,s))}}catch{}n?n():t.remove?.()}function Gl(e){return typeof e!="string"?null:e||"ok"}function Jl(e,t){if(e===null)return;let n=++Yl;bt={epoch:n,hits:V.hits,misses:V.misses,keyMisses:V.keyMisses,merged:t,marker:e};let r=()=>{!bt||bt.epoch!==n||gi()};try{typeof requestIdleCallback=="function"?requestIdleCallback(r,{timeout:1e3}):setTimeout(r,250)}catch{bt=null}}function gi(){let e=bt;if(bt=null,!!e)try{Xl(e)}catch{}}function Xl(e){let t=V.hits-e.hits,n=V.misses-e.misses,r=V.ingested+V.replaced-e.merged,o=V.keyMisses-e.keyMisses;if(n===0)return;let s=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(s===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, ${ve.size} still unconsumed). ${s} See https://webjs.dev/docs/data-fetching for the seeding reference.`)}function Zl(e,t,n){ho||(ho=!0,Fn());let r=`${e}/${t}/${n}`;if(ve.has(r)){let o=ve.get(r);return ve.delete(r),V.hits++,o}return V.misses++,mo.has(`${e}/${t}`)&&V.keyMisses++,bi}function Ql(){return{...V,pending:ve.size}}var ve,bi,ho,V,mo,bt,Yl,bo=J(()=>{ht();ve=new Map,bi=Symbol("webjs.seed.miss"),ho=!1,V={ingested:0,replaced:0,hits:0,misses:0,keyMisses:0},mo=new Set,bt=null,Yl=0});function go(e){if(!(!Array.isArray(e)||!e.length)){Dn+=1;for(let t of e)t&&yi.set(t,Dn)}}function tu(){return Dn}function nu(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(gt.delete(e),gt.set(e,{tags:t.slice(),since:typeof n=="number"?n:Dn}),gt.size>eu)){let r=gt.keys().next().value;r!==void 0&&gt.delete(r)}}function ru(e){let t=gt.get(e);if(!t)return!1;for(let n of t.tags)if((yi.get(n)||0)>t.since)return!0;return!1}function yo(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var Dn,yi,gt,eu,wo=J(()=>{Dn=0,yi=new Map,gt=new Map,eu=1e3});var di={};Yo(di,{_FALLBACK_MARKER_KEY:()=>Wn,_FRAME_TOP:()=>Fi,_LIVE_ATTRS:()=>Co,_activateSwappedRange:()=>Ho,_activeFrameId:()=>Mi,_addNewHeadElements:()=>No,_applyOptimisticLoading:()=>Do,_applyStreamedResolve:()=>ia,_applySwap:()=>Fo,_blurOutgoingFocus:()=>Hn,_buildHaveHeader:()=>nn,_buildSubmitFormData:()=>Ii,_bumpNavToken:()=>Uu,_clearFormBusy:()=>ea,_clearFrameBusy:()=>Zi,_collectBoundaries:()=>xt,_currentPageUrl:()=>Wu,_diffElementInPlace:()=>Xn,_eligibleAnchorHref:()=>zn,_encodeSubmitBody:()=>$i,_findAnchorInPath:()=>Pi,_getSubmitAction:()=>Li,_getSubmitEnctype:()=>Oi,_getSubmitMethod:()=>Ri,_isNonHtmlPath:()=>Yu,_isPreBootNavigation:()=>Bi,_keyOf:()=>Et,_markFormBusy:()=>Qi,_markFrameBusy:()=>Xi,_mergeHead:()=>ra,_navToken:()=>Hu,_onPopState:()=>Ro,_onSubmit:()=>Lo,_parseHTML:()=>To,_planBoundarySwap:()=>qi,_prefetch:()=>Ct,_prefetchAnchor:()=>Ki,_prefetchCache:()=>$,_prefetchHasHoverPointer:()=>Vi,_prefetchInflightSize:()=>Du,_prefetchMode:()=>Kn,_prefetchPeek:()=>Fu,_prefetchSaysSaveData:()=>Io,_prefetchSuppressed:()=>zi,_prefetchTake:()=>Yi,_reactivateScripts:()=>tr,_readStreamedShell:()=>oa,_reconcileChildren:()=>sr,_regraftPermanentElements:()=>ta,_regraftPermanentInSlice:()=>or,_resetParseProbe:()=>su,_resetPrefetch:()=>Bu,_resetWarnOnce:()=>zu,_resolveTargetFrameId:()=>Oo,_restoreOptimistic:()=>Gt,_runWithTransition:()=>qn,_setCurrentPageUrl:()=>Vu,_setHardNavigate:()=>qu,_shouldFullLoadDuringParse:()=>Ku,_snapshotCache:()=>z,_streamBoundariesProgressively:()=>aa,_takeResolveUnit:()=>sa,_viewTransitionsEnabled:()=>Mo,disableClientRouter:()=>Ci,enableClientRouter:()=>jo,loadFrame:()=>Ni,navigate:()=>ki,revalidate:()=>Ti});function To(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"&&ou()?Document.parseHTMLUnsafe(e):iu(e)}function ou(){if(yt!==null)return yt;try{yt=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{yt=!1}return yt}function su(){yt=null}function iu(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}function au(){_o||typeof MutationObserver>"u"||typeof customElements>"u"||(_o=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)}}),_o.observe(document.body,{childList:!0,subtree:!0}))}function xi(){if(typeof document>"u"||!document.documentElement)return()=>{};ne&&ne();let e=document.documentElement,t=e.style.getPropertyValue("overflow-anchor");e.style.setProperty("overflow-anchor","none");let n=null,r=()=>{if(ne===r){if(ne=null,n&&(clearTimeout(n),n=null),typeof window<"u")for(let o of Un)window.removeEventListener(o,r,{capture:!0});t?e.style.setProperty("overflow-anchor",t):e.style.removeProperty("overflow-anchor")}};if(ne=r,n=setTimeout(r,cu),typeof window<"u")for(let o of Un)window.addEventListener(o,r,{capture:!0,passive:!0});return r}function lu(e,t){if(typeof window>"u"||typeof requestAnimationFrame!="function")return;Z&&Z();let n=0,r=null,o=null,s=()=>{if(Z===s){Z=null,n&&cancelAnimationFrame(n),r&&(clearTimeout(r),r=null),o&&(o(),o=null);for(let a of Un)window.removeEventListener(a,s,{capture:!0})}},i=()=>{if(Z!==s)return;if(document.documentElement.scrollHeight-window.innerHeight>=e){window.scrollTo({left:t,top:e,behavior:"instant"}),o=xi(),n&&(cancelAnimationFrame(n),n=0);return}n=requestAnimationFrame(i)};Z=s;for(let a of Un)window.addEventListener(a,s,{capture:!0,passive:!0});r=setTimeout(s,Ei),n=requestAnimationFrame(i)}function uu(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function jo(){he||typeof document>"u"||(he=!0,document.addEventListener("click",ji,!1),document.addEventListener("submit",Lo,!1),window.addEventListener("popstate",Ro),document.addEventListener("pointerover",vt,!0),document.addEventListener("focusin",vt,!0),document.addEventListener("touchstart",vt,{capture:!0,passive:!0}),document.addEventListener("pointerout",Gi,!0),document.addEventListener("webjs:navigate",xo),au(),xo(),typeof history<"u"&&"scrollRestoration"in history&&(Bn=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(ae=location.href),pu())}function Ci(){he&&(he=!1,document.removeEventListener("click",ji,!1),document.removeEventListener("submit",Lo,!1),window.removeEventListener("popstate",Ro),document.removeEventListener("pointerover",vt,!0),document.removeEventListener("focusin",vt,!0),document.removeEventListener("touchstart",vt,{capture:!0}),document.removeEventListener("pointerout",Gi,!0),document.removeEventListener("webjs:navigate",xo),rr(),Po(),xe&&(xe.disconnect(),xe=null),typeof history<"u"&&Bn!==null&&(history.scrollRestoration=Bn,Bn=null),Jt+=1,ne&&ne(),Z&&Z(),ae=null)}async function ki(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){He(e);return}await $o(n.href,t?.replace??!1,null)}async function Ni(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};Q&&Q.abort(),Q=new AbortController;let o=Q.signal,s=++q;return Yn(r.href,n,!1,null,"GET",null,o,s)}function Ti(e){if(!e){z.clear(),$.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;z.delete(n),$.delete(n)}function ji(e){if(!he||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Pi(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||nr.test(r.pathname))return;e.preventDefault();let o=Oo(t);$o(n,!1,o)}function Ro(e){$o(location.href,!0,null)}function Lo(e){if(!he||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.hasAttribute("formtarget")?n.getAttribute("formtarget")||"":t.getAttribute("target")||"";if(r&&r!=="_self")return;let o=Ri(t,n);if(o==="dialog")return;let s=Oi(t,n),i=o==="get"||o==="head",a=Li(t,n),c;try{c=new URL(a,location.href)}catch{return}if(c.origin!==location.origin||nr.test(c.pathname))return;let l=Ii(t,n);if(du(t,n,o,l),!i&&s==="text/plain")return;let u=$i(l,s);e.preventDefault();let f=Oo(n||t);gu(c.href,o,u,f,t)}function Ri(e,t){return((t&&t.hasAttribute("formmethod")?t.getAttribute("formmethod")||"":e.getAttribute("method")||"")||"get").toLowerCase()}function Li(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function fu(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 Oi(e,t){return fu(t&&t.hasAttribute("formenctype")?t.getAttribute("formenctype"):e.getAttribute("enctype"))}function $i(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 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 Pi(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Mi(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 Oo(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===Fi)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Ue(`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 Mi(e)}function Ue(e,t,n="warn"){if(Ao.has(e)||(Ao.add(e),typeof console>"u"))return;let r=n==="error"?console.error:console.warn;r&&r.call(console,t)}function du(e,t,n,r){if(typeof process<"u"&&process.env||!r.has(R))return;let o="";try{o=new URL(e.getAttribute("action")||location.href,location.href).pathname}catch{o=location.pathname}if(n!=="post"){Ue(`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 s=t&&t.getAttribute("formenctype")||e.getAttribute("enctype")||"application/x-www-form-urlencoded";if(s.toLowerCase()==="text/plain"){Ue(`submit-nowhere:${o}:${s}`,`[webjs] this submission carries a bound server action's identity but declares enctype="${s}", 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&&Ue(`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 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 pu(){if(typeof location>"u"||_i)return;_i=!0;let e=null;try{e=sessionStorage.getItem(Wn),sessionStorage.removeItem(Wn)}catch{}let t="";try{let n=performance.getEntriesByType("navigation")[0];t=n?n.type:""}catch{}Bi(t,document.referrer,location.href,e)&&Ee("pre-boot-navigation",location.href,!1)}function Ee(e,t,n=!0){if(n)try{sessionStorage.setItem(Wn,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||Ue(`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 hu(e){typeof process<"u"&&process.env||Ue(`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 Si(){if(typeof process<"u"&&process.env||vo||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;vo=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&Ue("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 Vn(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 xt(e){let t=new Map,n=[],r=!1;function o(s){if(!r){if(s.nodeType===8){let i=s.data.trim();if(i.startsWith("wj:children:")){let a=i.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:s});return}if(i.startsWith("/wj:children")){let a=i.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==s.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:s});return}return}if(s.hasChildNodes&&s.hasChildNodes())for(let i=s.firstChild;i&&!r;i=i.nextSibling)o(i)}}return o(e),r||n.length>0?null:t}function qi(e,t){let n=[...e.keys()].filter(i=>t.has(i)).sort((i,a)=>i.length-a.length);if(n.length===0)return null;for(let i of n)if(e.get(i).routeKey!==t.get(i).routeKey){let a=null;for(let c of n){if(c===i)break;i.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=i=>{let a=null;for(let c of i.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=Ce(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),z.has(t)&&z.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(z.set(t,n);z.size>mu;){let r=z.keys().next().value;z.delete(r)}}function bu(e){let t=Ce(e),n=z.get(t);return n==null?null:(z.delete(t),z.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function Ce(e){let t=new URL(e,location.href);return t.pathname+t.search}async function $o(e,t,n){if(Di(t,n)&&typeof location<"u"){Ee("readyState-loading",e),He(e);return}Q&&Q.abort(),Q=new AbortController;let r=Q.signal,o=++q;n||(Jt+=1,ne&&ne(),Z&&Z()),ae&&Hi(ae);let s=setTimeout(()=>{Vn(!0),s=null},150),i=null;t||(i=Do());try{if(t){let a=bu(e);if(a){let c=To(a.html);if(c){Fo(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=xi():lu(a.scrollY,a.scrollX)};if(Mo()&&typeof document.startViewTransition=="function"){let p=Jt;en.then(()=>{p!==Jt||!he||d()}).catch(()=>{})}else d()}let u=Yn(e,n,!1,i,"GET",null,r,o,!0).catch(()=>{}),f=new Promise(d=>setTimeout(d,Ei));Promise.all([u,f]).then(()=>uu(l));return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await Yn(e,n,!t,i,"GET",null,r,o)}finally{s&&clearTimeout(s),o===q&&(Vn(!1),typeof location<"u"&&(ae=location.href))}}async function gu(e,t,n,r,o){Q&&Q.abort(),Q=new AbortController;let s=Q.signal,i=++q;r||(Jt+=1,ne&&ne(),Z&&Z());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)}ae&&Hi(ae);let l=setTimeout(()=>{Vn(!0),l=null},150),u=Do(),f=o?Qi(o,i,c.href):null,d=!1;try{let p=await Yn(c.href,r,!0,u,a?"GET":t.toUpperCase(),a?null:n,s,i);d=!!(p&&p.ok),!a&&i===q&&(z.clear(),$.clear())}finally{f&&ea(f,i,c.href,d),l&&clearTimeout(l),i===q&&(Vn(!1),typeof location<"u"&&(ae=location.href))}}function nn(){let e=xt(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}function Io(){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 Vi(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Au(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function zn(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||nr.test(n.pathname)?null:t}function zi(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Au(e);return t.includes("external")||t.includes("no-prefetch")}function Kn(e){if(zi(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 Vi()?"intent":"viewport"}}function Ct(e){if(!he||typeof fetch!="function"||Io())return;let t=Ce(e);if(typeof location<"u"&&t===Ce(location.href)||qe.has(t)||Xt.has(t))return;let n=$.get(t);if(n&&Eo()-n.at<Ui)return;if(qe.size>=Wi){for(Xt.add(t),St.push(e);St.length>wu;){let s=St.shift();Xt.delete(Ce(s))}return}let r=nn();if(!r&&typeof document<"u"&&document.readyState==="loading")return;qe.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 s=>{let i=s.headers.get("content-type")||"";if(!/^text\/html\b/i.test(i)||s.status>=400)return;let a=s.headers.get("x-webjs-build"),c=s.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)&&(z.clear(),$.clear());let d=s.redirected&&s.url?s.url:e,p=await s.text();Eu(t,{html:p,build:a,src:c,finalUrl:d,at:Eo()})}).catch(()=>{}).finally(()=>{qe.delete(t),vu()})}function vu(){for(;St.length&&qe.size<Wi;){let e=St.shift();Xt.delete(Ce(e)),Ct(e)}}function Eu(e,t){for($.has(e)&&$.delete(e),$.set(e,t);$.size>yu;){let n=$.keys().next().value;$.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function Ki(e){let t=/<!--wj:children:([^>]*?)-->/.exec(e||"");return t?t[1]:null}function Yi(e,t){let n=Ce(e),r=$.get(n);if(!r)return null;if(Eo()-r.at>=Ui)return $.delete(n),null;let o=Ki(r.html);return o&&!new Set(String(t??(nn()||"")).split(",").filter(Boolean)).has(o)?($.delete(n),null):($.delete(n),r)}function Eo(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function vt(e){if(!he)return;let t=Ji(e.target);if(!t)return;let n=Kn(t);if(n==="none"||n==="render")return;let r=zn(t);if(r){if(e.type==="touchstart"){Ct(r);return}n==="intent"&&(Zt===t&&At||(rr(),Zt=t,At=setTimeout(()=>{At=null,Zt=null,Ct(r)},_u)))}}function Gi(e){let t=Ji(e.target);t&&t===Zt&&rr()}function rr(){At&&(clearTimeout(At),At=null),Zt=null}function Po(){for(let e of Qt)clearTimeout(e);Qt.clear(),wt=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 xo(){if(typeof document>"u"||Io())return;let e=typeof IntersectionObserver<"u";e&&(xe?(xe.disconnect(),Po()):xe=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(wt.has(r))continue;let o=setTimeout(()=>{Qt.delete(o),wt.delete(r),xe.unobserve(r);let s=zn(r);s&&Kn(r)==="viewport"&&Ct(s)},Su);wt.set(r,o),Qt.add(o)}else{let o=wt.get(r);o&&(clearTimeout(o),Qt.delete(o),wt.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=Kn(t);if(n==="render"){let r=zn(t);r&&Ct(r)}else n==="viewport"&&e&&xe.observe(t)}}function xu(e){if(typeof document>"u"||!document.body)return!1;let t=xt(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 s=document.createElement("div");s.setAttribute("role","alert"),s.setAttribute("data-webjs-nav-error","");let i=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";s.textContent=i;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),o.insertBefore(s,n.end),!0}function So(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||xu(t)||typeof location<"u"&&(Ee("navigation-error-unrecoverable",e),He(e))}async function Yn(e,t,n,r,o,s,i,a,c){o=o||"GET";let l=typeof a=="number"?a:q,u,f=null,d=null,p=null,m=null,w=!1,g=e,A=t?Xi(t,l):null;try{try{let _=o==="GET"&&!s&&!t?Yi(e,r?r.haveKeys:void 0):null;if(_)u=_.html,d=_.build,p=_.src,g=_.finalUrl,m=200,w=!0;else{let E={"x-webjs-router":"1"},T=nn();T&&(E["x-webjs-have"]=T),t&&(E["x-webjs-frame"]=t),s!=null&&o!=="GET"&&o!=="HEAD"&&(E.accept=wi+", text/html");let C={method:o,headers:E,credentials:"same-origin",cache:"no-cache"};i&&(C.signal=i),s!=null&&o!=="GET"&&o!=="HEAD"&&(C.body=s);let v=await fetch(e,C);m=v.status,w=v.ok;let S=yo(v.headers.get("x-webjs-invalidate"));S.length&&go(S);let h=v.headers.get("content-type")||"",y=/^text\/html\b/i.test(h);if(h.toLowerCase().indexOf(wi)===0){let j=await v.text();return l===q&&(Gt(r),fo(j)),{ok:w,status:m,aborted:!1}}if(v.redirected&&v.url&&(g=v.url),v.status===204||v.status===205)return l===q&&n&&history.pushState(null,"",g),{ok:w,status:m,aborted:!1};if(!y)return l===q&&(Gt(r),So(e,v.status,null)),{ok:!1,status:m,aborted:!1};d=v.headers.get("x-webjs-build"),p=v.headers.get("x-webjs-src");let N=await oa(v);u=N.shell,N.streaming&&(f=N)}}catch(_){return _&&_.name==="AbortError"?{ok:!1,status:null,aborted:!0}:l!==q?{ok:!1,status:null,aborted:!0}:(Gt(r),So(e,null,_ instanceof Error?_:new Error(String(_))),{ok:!1,status:null,aborted:!1})}if(l!==q){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:!1,status:m,aborted:!0}}let b=To(u);if(!b)return Gt(r),So(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:m,aborted:!1};if(Fo(b,t,!!c,g,d,p)==="discard"){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:w,status:m,aborted:!1}}if(n&&history.pushState(null,"",g),n){let _=new URL(g);if(_.hash){let E=document.getElementById(_.hash.slice(1));E?E.scrollIntoView():(Si(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else Si(),window.scrollTo({left:0,top:0,behavior:"instant"})}return f&&(f.reader||f.rest)&&en.then(()=>aa(f.reader,f.dec,f.rest,()=>l===q)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:g,frameId:t,from:"navigate"}})),{ok:w,status:m,aborted:!1}}finally{A&&Zi(A,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=Gn.has(n);return Gn.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 Zi(e,t){if(Gn.get(e)!==t)return;Gn.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 Qi(e,t,n){let r=Jn.has(e);return Jn.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 ea(e,t,n,r){if(Jn.get(e)!==t)return;Jn.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 Ai(e){if(!e||!e.head)return"";let t=e.head.querySelectorAll('[data-webjs-track="reload"]');if(!t.length)return"";let n="";for(let r of t)n+=pe(r);return n}function Mo(){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 qn(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(Mo()&&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 ta(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 s=null;try{s=t.querySelector(`#${CSS.escape(o)}`)}catch{s=null}if(!s||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let i=s.parentNode;i&&s!==r&&(i.replaceChild(r,s),tn.add(r))}}function or(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 s of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(s)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let s=Cu(t,o);if(!s||s===r)continue;let i=s.parentNode;if(i)i.replaceChild(r,s),tn.add(r);else{let a=t.indexOf(s);a!==-1&&(t[a]=r,tn.add(r))}}}function Cu(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 ku(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&_t(t)}function Fo(e,t,n,r,o,s){let i=!1,a=()=>{if(!i){i=!0;try{Fn(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,w=!1;if(o&&m&&(w=o!==m),!w&&e.head&&e.head.children.length>0){let g=Ai(document),A=Ai(e);g!==A&&(w=!0)}if(w&&typeof location<"u"){z.clear(),$.clear();try{let g="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(g))sessionStorage.removeItem(g),Ee("deploy-mismatch-reload-suppressed",r,!1);else{sessionStorage&&sessionStorage.setItem(g,"1"),Ee("deploy-mismatch",r),He(r);return}}catch{Ee("deploy-mismatch",r),He(r);return}}else if(!w){let g=p?p.getAttribute("data-webjs-src"):null;s&&g&&s!==g&&(z.clear(),$.clear(),p&&p.setAttribute("data-webjs-src",s));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){No(e.head),en=qn(()=>{Iu(p,m),tr(p),_t(p),vi(e.body),Hn()},()=>_t(p));return}let w=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(w),w.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=xt(document.body),l=xt(e.body),u=c&&l?qi(c,l):null;if(u){a();let{mode:p,live:m,incoming:w}=u;No(e.head),en=qn(()=>{p==="replace"?Nu(m,w):Tu(m,w,e),Ou(m.start,w.start),vi(e.body),Hn()},()=>ku(m));return}if(r&&!n&&typeof location<"u"){Ee(c?l?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),He(r);return}if(r&&n)return Ee("revalidation-discarded",r,!1),"discard";a(),ra(e.head),ta(document.body,e.body);let f=[...e.body.childNodes];en=qn(()=>{document.body.replaceChildren(...f),tr(document.body),_t(document.body),Hn()},()=>_t(document.body))}function Hn(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function Nu(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)r.push(s);let o=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)o.push(document.importNode(s,!0));or(r,o);for(let s of r)s.parentNode===n&&n.removeChild(s);for(let s of o)n.insertBefore(s,e.end);Ho(e)}function Tu(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)o.push(i);let s=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)s.push(document.importNode(i,!0));or(o,s),ju(r,e.start,e.end,o,s),Ho(e)}function ju(e,t,n,r,o){let s=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=Et(c);l&&s.set(l,c)}let i=n,a=[];for(let c of o){if(c.nodeType===1){let l=Et(c);if(l&&s.has(l)){let u=s.get(l);Xn(u,c),a.push(u),s.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,i)}function Xn(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),!Co.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])Co.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(Ru(e)){$u(e,t);return}sr(e,t)}function Ru(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[P]!=null}function Lu(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function Zn(e){let t=new Map,n=`slot[${D}][${G}="${re}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!Lu(o,e)||Cs(e,o))continue;let s=!1;for(let a=o.parentElement;a&&a!==e;a=a.parentElement)if(a.tagName==="SLOT"&&a.hasAttribute(D)&&a.getAttribute(G)===re){s=!0;break}if(s)continue;let i=te(o.getAttribute("name"));t.has(i)||t.set(i,o)}return t}function Ou(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(D))return;let o=null;for(let f=r.parentElement;f;f=f.parentElement){if(f[P]){o=f;break}if(f.tagName.includes("-"))return}if(!o)return;let s=te(r.getAttribute("name"));Fe(o,s,[...r.childNodes]);let i=t.parentNode;if(!i||i.nodeType!==1)return;let a=i;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=Zn(o),u=Zn(c);for(let f of new Set([...l.keys(),...u.keys()])){if(f===s)continue;let d=u.get(f);d?Fe(o,f,[...d.childNodes].map(p=>document.importNode(p,!0))):l.get(f)&&Fe(o,f,null)}}function $u(e,t){if(!e[P])return;let n=Zn(e),r=Zn(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let s of o){let i=n.get(s),a=r.get(s);i&&a?(sr(i,a),Fe(e,s,[...i.childNodes])):a?Fe(e,s,[...a.childNodes].map(c=>document.importNode(c,!0))):Fe(e,s,null)}}function sr(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));or(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=Et(a);c&&o.set(c,a)}let s=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=Et(c);if(l&&o.has(l)){let f=o.get(l);Xn(f,c),s.push(f),o.delete(l);continue}let u=n[a];if(u&&u.nodeType===1&&!Et(u)&&u.tagName===c.tagName){Xn(u,c),s.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),s.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),s.push(l);continue}}s.push(c)}let i=new Set(s);for(let a of n)!i.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<s.length;a++){let c=s[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function Et(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Do(){let e=xt(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),s=nn(),i=[];for(let c=o.start.nextSibling;c&&c!==o.end;c=c.nextSibling)i.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:i,token:q,haveKeys:s}}function Gt(e){if(!e||e.token!==q)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 Iu(e,t){sr(e,t)}function na(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function Qn(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=na();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Bo(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=na();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function pe(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function er(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 Pu(e){if(!e.querySelector("meta"))return;let t=o=>{let s=new Map;for(let i of o.querySelectorAll("meta")){let a=er(i);if(!a||a===ko)continue;let c=s.get(a);c?c.push(i):s.set(a,[i])}return s},n=t(e),r=t(document.head);for(let[o,s]of n){let i=r.get(o)||[],a=s.map(pe).join(`
2
2
  `),c=i.map(pe).join(`
3
- `);if(a!==c){if(s.length===1&&i.length===1){let l=i[0];for(let u of[...l.attributes])l.removeAttribute(u.name);for(let u of s[0].attributes)l.setAttribute(u.name,u.value);continue}for(let l of i)l.remove();for(let l of s)document.head.appendChild(Bo(l))}}for(let[o,s]of r)if(!n.has(o))for(let i of s)i.remove()}function No(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(pe(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(r.tagName==="META"&&er(r)||n.has(pe(r))||(r.tagName==="SCRIPT"?document.head.appendChild(Qn(r)):document.head.appendChild(Bo(r))));Iu(e)}function Pu(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function na(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let s of t.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&r.add(pe(s));let o=new Set;for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&o.add(pe(s));for(let s of[...t.children])s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(Pu(s)||s.tagName==="META"&&er(s)===ko||o.has(pe(s))||s.remove());for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(s.tagName==="META"&&er(s)===ko||r.has(pe(s))||(s.tagName==="SCRIPT"?t.appendChild(Qn(s)):t.appendChild(Bo(s))))}function wt(e){typeof customElements>"u"||qo(e)}function qo(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&&qo(n.shadowRoot))}function vi(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 ra(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",s="<!--wj-stream-shell-->",i=/<\/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(s);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+s.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=i.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 oa(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 s=1,i;for(;i=o.exec(e);)if(i[1]==="/"){if(s--,s===0)return{id:n,content:e.slice(r,i.index),rest:e.slice(i.index+i[0].length)}}else s++;return null}function sa(e,t){let n=document.getElementById(e);if(!n){pu(e);return}let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];n.replaceWith(r.content);for(let s of o)s.nodeType===1&&qo(s)}async function ia(e,t,n,r){let o=n,s=()=>{let i;for(;i=oa(o);){if(!r())return!1;sa(i.id,i.content),o=i.rest}return!0};if(!e){s();return}try{for(;;){if(!s()){try{await e.cancel()}catch{}return}let{value:i,done:a}=await e.read();if(i&&(o+=t.decode(i,{stream:!0})),a){o+=t.decode(),s();return}}}catch{}}function tr(e){if(e.tagName==="SCRIPT"){let n=Qn(e);return e.replaceWith(n),n}let t=[];tn.has(e)&&t.push(e);for(let n of e.querySelectorAll("[data-webjs-permanent]"))tn.has(n)&&t.push(n);for(let n of e.querySelectorAll("script"))t.length&&t.some(r=>r!==n&&r.contains(n))||n.replaceWith(Qn(n));return e}function Ho(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=tr(n);r.isConnected!==!1&&wt(r)}}function Mu(e){return $.get(Ce(e))||null}function Fu(){return qe.size}function Du(){$.clear(),qe.clear(),_t.length=0,Xt.clear(),rr(),Po()}function Bu(e){He=e||(t=>{location.href=t})}function qu(){return q}function Hu(){return++q}function Uu(){return ae}function Wu(e){ae=e}function Vu(){Ao.clear(),vo=!1}function zu(e,t){return Fi(e,t)}function Ku(e){return nr.test(e)}var wi,gt,he,Q,q,_o,ae,Bn,iu,Ei,Un,ne,Z,Jt,nr,He,Mi,Ao,Wn,_i,vo,hu,z,gu,Hi,Ui,yu,wu,_u,$,qe,_t,Xt,St,Zt,xe,yt,Qt,Gn,Jn,tn,en,Co,ko,lo=J(()=>{co();Mn();Mn();Qe();hi();bo();wo();Sn();wi="text/vnd.webjs-stream.html";gt=null;he=!1,Q=null,q=0,_o=null;ae=null,Bn=null,iu=2e3,Ei=500,Un=["wheel","touchmove","keydown","pointerdown"],ne=null;Z=null,Jt=0;nr=/\.(?: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,He=e=>{location.href=e};Mi="_top";Ao=new Set;Wn="webjs:nav-fallback",_i=!1;vo=!1;hu=16,z=new Map;gu=8,Hi=3e4,Ui=3,yu=24,wu=100,_u=250,$=new Map,qe=new Set,_t=[],Xt=new Set,St=null,Zt=null,xe=null,yt=new WeakMap,Qt=new Set;Gn=new WeakMap;Jn=new WeakMap;tn=new WeakSet;en=Promise.resolve();Co=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);ko="name=csp-nonce";(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&jo()});function cr(e,...t){return{_$webjs:"template",strings:e,values:t}}function B(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var F="wjm-";function ua(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 We(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function lr(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(`
3
+ `);if(a!==c){if(s.length===1&&i.length===1){let l=i[0];for(let u of[...l.attributes])l.removeAttribute(u.name);for(let u of s[0].attributes)l.setAttribute(u.name,u.value);continue}for(let l of i)l.remove();for(let l of s)document.head.appendChild(Bo(l))}}for(let[o,s]of r)if(!n.has(o))for(let i of s)i.remove()}function No(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(pe(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(r.tagName==="META"&&er(r)||n.has(pe(r))||(r.tagName==="SCRIPT"?document.head.appendChild(Qn(r)):document.head.appendChild(Bo(r))));Pu(e)}function Mu(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function ra(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let s of t.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&r.add(pe(s));let o=new Set;for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&o.add(pe(s));for(let s of[...t.children])s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(Mu(s)||s.tagName==="META"&&er(s)===ko||o.has(pe(s))||s.remove());for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(s.tagName==="META"&&er(s)===ko||r.has(pe(s))||(s.tagName==="SCRIPT"?t.appendChild(Qn(s)):t.appendChild(Bo(s))))}function _t(e){typeof customElements>"u"||qo(e)}function qo(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&&qo(n.shadowRoot))}function vi(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 oa(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",s="<!--wj-stream-shell-->",i=/<\/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(s);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+s.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=i.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 sa(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 s=1,i;for(;i=o.exec(e);)if(i[1]==="/"){if(s--,s===0)return{id:n,content:e.slice(r,i.index),rest:e.slice(i.index+i[0].length)}}else s++;return null}function ia(e,t){let n=document.getElementById(e);if(!n){hu(e);return}let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];n.replaceWith(r.content);for(let s of o)s.nodeType===1&&qo(s)}async function aa(e,t,n,r){let o=n,s=()=>{let i;for(;i=sa(o);){if(!r())return!1;ia(i.id,i.content),o=i.rest}return!0};if(!e){s();return}try{for(;;){if(!s()){try{await e.cancel()}catch{}return}let{value:i,done:a}=await e.read();if(i&&(o+=t.decode(i,{stream:!0})),a){o+=t.decode(),s();return}}}catch{}}function tr(e){if(e.tagName==="SCRIPT"){let n=Qn(e);return e.replaceWith(n),n}let t=[];tn.has(e)&&t.push(e);for(let n of e.querySelectorAll("[data-webjs-permanent]"))tn.has(n)&&t.push(n);for(let n of e.querySelectorAll("script"))t.length&&t.some(r=>r!==n&&r.contains(n))||n.replaceWith(Qn(n));return e}function Ho(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=tr(n);r.isConnected!==!1&&_t(r)}}function Fu(e){return $.get(Ce(e))||null}function Du(){return qe.size}function Bu(){$.clear(),qe.clear(),St.length=0,Xt.clear(),rr(),Po()}function qu(e){He=e||(t=>{location.href=t})}function Hu(){return q}function Uu(){return++q}function Wu(){return ae}function Vu(e){ae=e}function zu(){Ao.clear(),vo=!1}function Ku(e,t){return Di(e,t)}function Yu(e){return nr.test(e)}var wi,yt,he,Q,q,_o,ae,Bn,cu,Ei,Un,ne,Z,Jt,nr,He,Fi,Ao,Wn,_i,vo,mu,z,yu,Ui,Wi,wu,_u,Su,$,qe,St,Xt,At,Zt,xe,wt,Qt,Gn,Jn,tn,en,Co,ko,lo=J(()=>{co();Mn();Mn();Qe();hi();bo();wo();Sn();wi="text/vnd.webjs-stream.html";yt=null;he=!1,Q=null,q=0,_o=null;ae=null,Bn=null,cu=2e3,Ei=500,Un=["wheel","touchmove","keydown","pointerdown"],ne=null;Z=null,Jt=0;nr=/\.(?: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,He=e=>{location.href=e};Fi="_top";Ao=new Set;Wn="webjs:nav-fallback",_i=!1;vo=!1;mu=16,z=new Map;yu=8,Ui=3e4,Wi=3,wu=24,_u=100,Su=250,$=new Map,qe=new Set,St=[],Xt=new Set,At=null,Zt=null,xe=null,wt=new WeakMap,Qt=new Set;Gn=new WeakMap;Jn=new WeakMap;tn=new WeakSet;en=Promise.resolve();Co=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);ko="name=csp-nonce";(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&jo()});function cr(e,...t){return{_$webjs:"template",strings:e,values:t}}function B(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var F="wjm-";function fa(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 We(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function lr(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
4
  `),n.appendChild(r)}}function rn(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
5
- `)}</style>`}on();Nt();Qe();var ns=Symbol.for("webjs.repeat");function rs(e,t,n){return{[ns]:!0,items:[...e],keyFn:t,templateFn:n}}function ke(e){return!!e&&typeof e=="object"&&e[ns]===!0}function gr(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function et(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Aa(e){return{_$webjs:"live",value:e}}function Ne(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function va(e,t){return{_$webjs:"keyed",key:e,value:t}}function Te(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function Ea(e,t){return{_$webjs:"guard",deps:e,fn:t}}function je(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function xa(e){return{_$webjs:"template-content",template:e}}function tt(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function Ca(e){return{_$webjs:"ref",target:e}}function Re(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function ka(){return{value:void 0}}function Na(e){return{_$webjs:"cache",value:e}}function Le(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function Ta(...e){return{_$webjs:"until",args:e}}function Oe(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function ja(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function nt(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function Ra(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function rt(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function La(e){return{_$webjs:"watch",signal:e}}function $e(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var ee=null,ge=!1,st=0,ot=null,yr=0,os=(e,t)=>Object.is(e,t),un=()=>{},ss=()=>!1;function is(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)is(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function Ot(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)Ot(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function Er(e){if(ge)throw new Error("Signal read during notification phase");if(ee===null)return;let t=ee,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&Sr(t)&&Ot(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,Sr(t)&&is(e,t)),t.producerLastReadVersions[n]=e.version}function Sr(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function as(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=ge;ge=!0;try{for(let n of e.liveConsumers)n.dirty||Oa(n)}finally{ge=t}}function Oa(e){e.dirty=!0,as(e),e.consumerMarkedDirty.call(e.wrapper||e)}function fn(e){if(!(!e.dirty&&e.lastCleanEpoch===st)){if(!e.producerMustRecompute()&&!$a(e)){e.dirty=!1,e.lastCleanEpoch=st;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=st}}function $a(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(fn(n),r!==n.version))return!0}return!1}function Ar(e){e&&(e.nextProducerIndex=0);let t=ee;return ee=e,t}function vr(e,t){if(ee=t,!!e){if(Sr(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)Ot(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var dn=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=st,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=ss,this.producerRecomputeValue=un,this.consumerMarkedDirty=un,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||os,this.watched=n?.[xr],this.unwatched=n?.[Cr]}get(){return Er(this),this.__value}peek(){return this.__value}set(t){if(ge)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,st++,ot!==null?cs(this):as(this))}};function cs(e){let t=ge;ge=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?ot.add(n):cs(n))}finally{ge=t}}var wr=Symbol("unset"),_r=Symbol("computing"),ln=Symbol("errored"),$t=class{constructor(t,n){this.__fn=t,this.__value=wr,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||os,this.watched=n?.[xr],this.unwatched=n?.[Cr];let r=this;this.producerMustRecompute=function(){return r.__value===wr||r.__value===_r},this.producerRecomputeValue=function(){if(r.__value===_r)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=_r;let s=Ar(r),i,a=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=ln,r.__error=l,a=!0}finally{vr(r,s)}if(!a&&(o!==wr&&o!==ln)&&r.__equal.call(r.wrapper,o,i)){r.__value=o;return}r.__value=i,r.version++},this.consumerMarkedDirty=un}get(){if(fn(this),Er(this),this.__value===ln)throw this.__error;return this.__value}peek(){if(fn(this),this.__value===ln)throw this.__error;return this.__value}},pn=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=st,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=ss,this.producerRecomputeValue=un,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=Ar(this);try{for(let r of t)Er(r),r.__isComputed&&fn(r)}finally{vr(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(Ot(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=Ar(this),r;try{r=t()}finally{vr(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)Ot(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},xr=Symbol("watched"),Cr=Symbol("unwatched");function Ia(e){let t=ee;ee=null;try{return e()}finally{ee=t}}function Pa(e){return e.producers.slice()}function Ma(e){return e.liveConsumers?[...e.liveConsumers]:[]}function Fa(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function Da(e){return e.producers.length>0}function Ba(){return ee&&ee.__isComputed?ee:null}function qa(e){yr++,ot===null&&(ot=new Set);try{e()}finally{if(yr--,yr===0){let t=ot;ot=null;for(let n of t)n.__fire()}}}var It={State:dn,Computed:$t,subtle:{Watcher:pn,untrack:Ia,introspectSources:Pa,introspectSinks:Ma,hasSinks:Fa,hasSources:Da,currentComputed:Ba,watched:xr,unwatched:Cr}};function Ha(e,t){return new dn(e,t)}function Ua(e,t){return new $t(e,t)}function Wa(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function Va(e){let t=!1,n=!1,r=new $t(e),o=new pn(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(s){console.error(s)}o.watch()}}))});o.watch(r);try{r.get()}catch(s){console.error(s)}return()=>{n||(n=!0,o.dispose())}}Sn();function Ls(e,t){let n=e&&e[P]?e:null;return n?yn(n,t):t()}var Hr=new WeakMap,Ur=new WeakMap,An=Symbol.for("webjs.instance"),K=null;function xn(e){return e?e.nodeType===11&&e.host?e.host:e:null}function Vr(e,t){let n=e.__commitOwner,r=K;n&&(K=n);try{t()}finally{K=r}}function dt(e,t){let n=t,r=n[W];n[W]=!0;let o=K;K=t;try{let s=n[An];if(B(e)){let i=e;if(s&&s.strings===i.strings){ut(s,i.values);return}s&&Rs(s,t);let a=t.firstChild;a&&a.nodeType===8&&a.data==="webjs-hydrate"&&a.remove(),n[An]=null;let c=pc(i,t);n[An]=c;return}if(s&&Rs(s,t),n[An]=null,t.replaceChildren(),e==null||e===!1||e===!0)return;if(Array.isArray(e)){for(let i of e){let a=document.createTextNode(String(i??""));t.appendChild(a)}return}t.appendChild(document.createTextNode(String(e)))}finally{K=o,n[W]=r,r||qr(n)}}function Cn(e){let{strings:t}=e,n=Hr.get(t);if(n)return n;let r=[],o="",s="text",i="",a=0,c="",l=0,u=null,f="",d="";for(let w=0;w<t.length;w++){let g=t[w];for(let A=0;A<g.length;A++){let b=g[A];switch(s){case"text":o+=b,b==="<"&&(s="tag-open");break;case"tag-open":o+=b,b==="!"?s="bang-1":b==="/"?(s="tag-name",f=""):/[a-zA-Z]/.test(b)?(s="tag-name",f=b.toLowerCase()):s="text";break;case"bang-1":o+=b,s=b==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=b,b==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=b,b==="-"?l+=1:(b===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=b,b===">"?(s=f==="script"||f==="style"?"rawtext":"text",s==="rawtext"&&(d="")):/\s/.test(b)?s="in-tag":f+=b.toLowerCase();break;case"in-tag":o+=b,b===">"?(s=f==="script"||f==="style"?"rawtext":"text",s==="rawtext"&&(d="")):!/\s/.test(b)&&b!=="/"&&(s="attr-name",i=b,a=o.length-1);break;case"rawtext":o+=b,d=(d+b.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(s="text",d="",f="");break;case"attr-name":b==="="?(s="after-eq",o+=b):/\s/.test(b)?(s="in-tag",i="",o+=b):b===">"?(s="text",i="",o+=b):(i+=b,o+=b);break;case"after-eq":b==='"'||b==="'"?(s="attr-quoted",c=b,o+=b):/\s/.test(b)?(s="in-tag",i="",o+=b):b===">"?(s="text",i="",o+=b):(s="attr-unquoted",o+=b);break;case"attr-unquoted":/\s/.test(b)?(s="in-tag",i="",o+=b):(b===">"&&(s="text",i=""),o+=b);break;case"attr-quoted":o+=b,b===c&&(s="in-tag",i="");break;case"skip-attr":if(b===c){if(u){let x=u.firstPartIdx,_=[];for(let h=x;h<r.length;h++)(r[h].kind==="noop"||r[h].kind==="attr-mixed")&&_.push(h);let E=[],T=t[_[0]],C=T.lastIndexOf(c);E.push(C>=0?T.slice(C+1):T);for(let h=1;h<_.length;h++)E.push(t[_[h]]);let v=t[_[_.length-1]+1],S=v.indexOf(c);E.push(S>=0?v.slice(0,S):v),r[x]={kind:"attr-mixed",path:[],name:u.name,statics:E,group:_};for(let h=1;h<_.length;h++)r[_[h]]={kind:"noop",path:[],mixedAnchor:x};u=null}s="in-tag",i=""}break}}if(w<t.length-1){let A=r.length;if(s==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(s==="rawtext"){d="",r.push({kind:"noop",path:[]});continue}if(s==="text")o+=`<!--${F}${A}-->`,r.push({kind:"child",path:[]});else if(s==="in-tag"){let b=`data-${F}${A}`;o+=`${b}=""`,r.push({kind:"element",path:[]})}else if(s==="after-eq"){let b=i[0],x=i.slice(1);if(kt(b)){o=o.slice(0,a);let _=Ve[b],E=`data-${F}${A}`;o+=`${E}=""`,r.push({kind:_,path:[],name:x})}else{o=o.slice(0,a);let _=`data-${F}${A}`;o+=`${_}=""`,r.push({kind:"attr",path:[],name:i})}s="in-tag",i=""}else if(s==="attr-quoted"||s==="attr-unquoted"){o=o.slice(0,a);let b=`data-${F}${A}`;o+=`${b}=""`,u={name:i,firstPartIdx:A},r.push({kind:"noop",path:[]}),s="skip-attr"}else s==="skip-attr"&&r.push({kind:"noop",path:[]})}}let p=document.createElement("template");p.innerHTML=o,cc(p.content,r);let m=lc(p.content,r);return n={templateEl:p,parts:r,formActions:m},Hr.set(t,n),n}function cc(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(D,"");let o=t.length;r.setAttribute(`data-${F}${o}`,""),t.push({kind:"slot",path:[]})}}function lc(e,t){let n=[],r=[];function o(s){for(let i=0;i<s.childNodes.length;i++){let a=s.childNodes[i];if(n.push(i),a.nodeType===8){let c=a.data;if(c.startsWith(F)){let l=Number(c.slice(F.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-${F}`)){let d=Number(f.name.slice(`data-${F}`.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=uc(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 uc(e,t,n){let r=e.localName==="form",o=r?"action":"formaction",s=r?"method":"formmethod",i=r?"enctype":"formenctype",a=t.filter(g=>g.kind==="attr"&&g.name.toLowerCase()===o);if(!a.length)return null;let c=[],l=[],u=[],f=r?[]:t.filter(g=>g.name.toLowerCase()==="name"&&(g.kind==="attr"||g.kind==="attr-mixed"||g.kind==="bool")).map(g=>({i:g.idx,kind:g.kind})),d=!r&&e.hasAttribute("name"),p=!r&&e.hasAttribute("form"),m=!r&&e.hasAttribute("value"),w=r?[]:t.filter(g=>g.name.toLowerCase()==="value"&&(g.kind==="attr"||g.kind==="attr-mixed"||g.kind==="bool")).map(g=>({i:g.idx,kind:g.kind}));for(let g of t){let A=String(g.name).toLowerCase();if(g.kind==="prop"){r?(A==="method"||A==="enctype"||A==="encoding")&&u.push(g.name):Xe(A)&&u.push(g.name);continue}if(A!==s&&A!==i||g.kind!=="attr"&&g.kind!=="attr-mixed"&&g.kind!=="bool")continue;let b=n[g.idx],x={i:g.idx,kind:g.kind};g.kind==="attr-mixed"&&(x.statics=b.statics||[],x.group=b.group||[]),(A===s?c:l).push(x)}return{isForm:r,tag:e.localName,actionIdxs:a.map(g=>g.idx),duplicateAction:a.length>1,staticAction:e.getAttribute(o)!=null,authoredName:d,authoredValue:m,authoredForm:p,propAttrs:u,nameParts:f,valueParts:w,staticMethod:e.getAttribute(s),staticEnctype:e.getAttribute(i),methodParts:c,enctypeParts:l}}function Bt(e,t,n){if(e)for(let r of[!0,!1])for(let o of e){if(o.isForm!==r)continue;let s=o.actionIdxs[0],i=o.isForm?"action":"formaction";for(let l of o.actionIdxs)if(ze(lt(n[l]),i,o.tag)){s=l;break}let a=t[s];if(!a||!a.el)continue;let c=lt(n[s]);if(o.isForm)Qo(a.el,c,vn(o.methodParts,o.staticMethod,n),vn(o.enctypeParts,o.staticEnctype,n),o);else{let l=u=>u.some(f=>f.kind==="bool"?!!lt(n[f.i]):!0);dc(a.el,c,o,l(o.nameParts),l(o.valueParts),vn(o.methodParts,o.staticMethod,n),vn(o.enctypeParts,o.staticEnctype,n))}}}function fc(e){(Ur.has(e)||e.getAttribute("name")===R)&&(e.getAttribute("name")===R&&e.removeAttribute("name"),e.removeAttribute("value"),Ur.delete(e))}function dc(e,t,n,r,o,s,i){let a=typeof t=="function"?an(t):null;if(!a){typeof t=="function"&&be(null,e.localName),fc(e),es(e,s,i,n.propAttrs);return}Je(n.duplicateAction,e.localName),pr(n.propAttrs,e.localName),n.staticAction&&dr(e.localName),(n.authoredValue||o)&&Ye(e.localName),(n.authoredName||r)&&Ke(e.getAttribute("name")||R,e.localName,!1),(n.authoredForm||e.hasAttribute("form"))&&Ge(e.localName),fr(e.localName,e.getAttribute("type"));let c=mr(e.localName,s,i);e.removeAttribute("formaction"),e.setAttribute("name",R),e.setAttribute("value",a),Tt(e,"formmethod",s,c.formMethod),Tt(e,"formenctype",i,c.formEnctype),Ur.set(e,a)}function pc(e,t){let{templateEl:n,parts:r,formActions:o}=Cn(e),s=n.content.cloneNode(!0),i=document.createComment(`${F}s`),a=document.createComment(`${F}e`),c=r.map(f=>kn(f,s)),l=[];for(let f=0;f<e.values.length;f++)se(c[f],e.values[f],void 0,e.values),l.push(e.values[f]);Bt(o,c,e.values),t.replaceChildren(i,...s.childNodes,a);let u=t.nodeType===1&&t[P]?t:null;for(let f of c)f.kind==="slot"&&(u&&f.slotEl&&(f.slotEl[gn]=u),se(f,void 0,void 0,[]));return{strings:e.strings,bound:c,lastValues:l,startNode:i,endNode:a}}function kn(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(s){o.handler?.(s)}};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 js=Symbol("webjs.commitFailed");function ut(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],s=o.mixedAnchor;try{o.kind==="noop"&&s!=null?se(e.bound[s],t[s],e.lastValues[s],t):se(o,r,e.lastValues[n],t)}catch(i){throw e.lastValues[n]=js,o.kind==="noop"&&s!=null&&(e.lastValues[s]=js),i}e.lastValues[n]=r}Bt(Hr.get(e.strings)?.formActions??null,e.bound,t)}function Rs(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=Ft(n.slotEl);r&&Ts(r,n.slotEl)}}t.replaceChildren()}function vn(e,t,n){for(let r of e){if(r.kind==="bool")return lt(n[r.i])?"":U;if(r.kind==="attr"){let a=lt(n[r.i]);return a==null?"":String(a)}let o=r.statics||[],s=r.group||[],i=o[0]||"";for(let a=0;a<s.length;a++)i+=String(lt(n[s[a]])??""),i+=o[a+1]||"";return i}return t??U}function lt(e){return Ne(e)?e.value:e}function se(e,t,n,r){if(Ne(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":bc(e,t);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):ze(t,e.name,e.el.localName)||(X(t,e.name,e.el.localName),e.el.setAttribute(e.name,String(t)));break}case"prop":Rt(t,e.name,e.el.localName),e.el[e.name]=t;break;case"bool":X(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":mc(e,t);break;case"attr-mixed":{let o=e,s=o.statics[0];for(let i=0;i<o.group.length;i++){let a=r?r[o.group[i]]:t;X(a,e.name,e.el.localName),s+=String(a??""),s+=o.statics[i+1]||""}e.el.setAttribute(e.name,s);break}case"slot":{if(e.applied)break;let o=e.slotEl,s=()=>{let a=Ft(o);if(!a){e.applied=!0;return}if(!a.contains(o)){a.isConnected?queueMicrotask(s):e.applied=!0;return}if(e.applied=!0,hc(o))return;let c=document.createDocumentFragment();for(;o.firstChild;)c.appendChild(o.firstChild);o[Mt]=c,queueMicrotask(()=>fe(a))},i=Ft(o);i&&i.contains(o)?s():queueMicrotask(s);break}case"noop":break}}function Ft(e){let t=e[gn];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[P])return n;n=n.parentElement}return null}function hc(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 mc(e,t){let n=e,r=Re(t)?t.target:void 0,o=n.__refTarget,s=r!==o;if(s&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(s||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!s&&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 bc(e,t){return Cc(e,t),oe(e,t)}function oe(e,t){return Ls(e.marker&&e.marker.parentNode,()=>gc(e,t))}function gc(e,t){let n=e.marker;if(et(t)){_e(e);let o=String(t.value??""),s=document.createElement("template");s.innerHTML=o;let i=[...s.content.childNodes],a=document.createDocumentFragment();for(let c of i)a.appendChild(c);n.parentNode?.insertBefore(a,n),e.child=i;return}if(Te(t)){let o=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,o.key)&&_e(e),e.__keyedKey=o.key,oe(e,o.value);return}if(je(t)){let o=t,s=e.__guardDeps,i=o.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(i)?xc(s,i):Object.is(s,i)))return;let a=Array.isArray(i)?i.slice():i;oe(e,o.fn()),e.__guardDeps=a;return}if(tt(t)){_e(e);let o=t.template;if(o&&o.content){let s=o.content.cloneNode(!0),i=[...s.childNodes];n.parentNode?.insertBefore(s,n),e.child=i}return}if(Re(t))return;if(Le(t))return kc(e,t.value);if(Oe(t))return Nc(e,t.args);if($e(t))return Tc(e,t.signal);if(nt(t))return jc(e,t);if(rt(t))return Rc(e,t);if(ke(t)){if(e.child&&e.child.kind==="repeat"){_c(e,t);return}_e(e);let o={kind:"repeat",map:new Map};e.child=o,wc(n,o,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){vc(e,t);return}_e(e);let o={kind:"array",items:[]};e.child=o,Ac(n,o,t);return}if(e.child){let o=e.child;if(o.kind==="repeat")Os(o),e.child=void 0;else if(o.kind==="array")Is(o),e.child=void 0;else if(o.kind==="async-stream")Ds(o),e.child=void 0;else if("strings"in e.child){let s=e.child;if(B(t)&&s.strings===t.strings){ut(s,t.values);return}ft(s.startNode,s.endNode),e.child=void 0}else{for(let s of e.child)s.parentNode&&s.parentNode.removeChild(s);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(B(t)){let o=t,{templateEl:s,parts:i,formActions:a}=Cn(o),c=s.content.cloneNode(!0),l=document.createComment(`${F}s`),u=document.createComment(`${F}e`),f=i.map(m=>kn(m,c)),d=[];for(let m=0;m<o.values.length;m++)se(f[m],o.values[m],void 0,o.values),d.push(o.values[m]);Bt(a,f,o.values);let p=[l,...c.childNodes,u];n.parentNode?.insertBefore(yc(p),n);for(let m of f)m.kind==="slot"&&se(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 yc(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function ft(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 zr(e){let{templateEl:t,parts:n,formActions:r}=Cn(e),o=t.content.cloneNode(!0),s=document.createComment(`${F}s`),i=document.createComment(`${F}e`),a=n.map(u=>kn(u,o)),c=[];for(let u=0;u<e.values.length;u++)se(a[u],e.values[u],void 0,e.values),c.push(e.values[u]);Bt(r,a,e.values);for(let u of a)u.kind==="slot"&&se(u,void 0,void 0,[]);let l=document.createDocumentFragment();for(l.appendChild(s);o.firstChild;)l.appendChild(o.firstChild);return l.appendChild(i),{inst:{strings:e.strings,bound:a,lastValues:c,startNode:s,endNode:i},frag:l}}function Dt(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 wc(e,t,n){let{items:r,keyFn:o,templateFn:s}=n,i=e.parentNode;if(!i)return;let a=document.createDocumentFragment();for(let c=0;c<r.length;c++){let l=o(r[c],c),u=s(r[c],c);if(!B(u))continue;let{inst:f,frag:d}=zr(u);t.map.set(l,f),a.appendChild(d)}i.insertBefore(a,e)}function _c(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,{items:s,keyFn:i,templateFn:a}=t,c=new Map;try{for(let l=0;l<s.length;l++){let u=i(s[l],l),f=a(s[l],l);if(!B(f))continue;let d=o.map.get(u);if(d&&d.strings===f.strings)ut(d,f.values),Wr(d.startNode,d.endNode,r,n),c.set(u,d),o.map.delete(u);else{d&&(o.map.delete(u),Dt(d),ft(d.startNode,d.endNode));let{inst:p,frag:m}=zr(f);r.insertBefore(m,n),c.set(u,p)}}for(let[l,u]of[...o.map]){o.map.delete(l);try{Dt(u)}finally{ft(u.startNode,u.endNode)}}o.map=c}catch(l){for(let[u,f]of c)o.map.set(u,f);throw l}}function Os(e){for(let[t,n]of[...e.map]){e.map.delete(t);try{Dt(n)}finally{ft(n.startNode,n.endNode)}}e.map.clear()}function Sc(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function En(e){e.type==="tpl"?(Dt(e.inst),ft(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function $s(e){if(B(e)){let{inst:t,frag:n}=zr(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 Ac(e,t,n){let r=e.parentNode;if(!r)return;let o=document.createDocumentFragment(),s=[];for(let i of n){let{item:a,frag:c}=$s(i);c&&o.appendChild(c),s.push(a)}r.insertBefore(o,e),t.items=s}function vc(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,s=o.items,i=[],a=0;try{for(let c=0;c<t.length;c++){let l=t[c],u=s[c];if(B(l)){let p=l;if(u&&u.type==="tpl"&&u.inst.strings===p.strings){ut(u.inst,p.values),i.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),i.push(u),a=c+1;continue}}else{u&&En(u),i.push({type:"empty"}),a=c+1;continue}let{item:f,frag:d}=$s(l);d&&r.insertBefore(d,Ec(s,c,n)),i.push(f),u&&En(u),a=c+1}for(let c=t.length;c<s.length;c++)En(s[c]),a=c+1;o.items=i}catch(c){throw o.items=i.concat(s.slice(a)),c}}function Ec(e,t,n){for(let r=t;r<e.length;r++){let o=Sc(e[r]);if(o&&o.parentNode)return o}return n}function Is(e){for(let t of e.items)En(t);e.items=[]}function Wr(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),s=e;for(;s;){let i=s.nextSibling;if(o.appendChild(s),s===t)break;s=i}n.insertBefore(o,r)}function xc(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 _e(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Ps(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Os(n);else if(n.kind==="array")Is(n);else if(n.kind==="async-stream")Ds(n);else if("strings"in n){let r=e.child;Dt(r),ft(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Cc(e,t){let n=e;n.__untilState&&!Oe(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!je(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!Le(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!Te(t)&&(n.__keyedKey=void 0),n.__watchSub&&!$e(t)&&Ps(n)}function kc(e,t){let n=e.marker,r=e,o=r.__cacheMap;o||(o=new Map,r.__cacheMap=o);let s=e.child;if(s&&"strings"in s){let a=s;if(B(t)&&a.strings===t.strings){ut(a,t.values);return}let c=document.createDocumentFragment();Wr(a.startNode,a.endNode,c,null),o.set(a.strings,{inst:a,holder:c}),e.child=void 0}if(B(t)){let a=t,c=o.get(a.strings);if(c){o.delete(a.strings),e.child&&_e(e),Wr(c.inst.startNode,c.inst.endNode,n.parentNode,n),ut(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=Ft(f);d&&l.add(d)}for(let d of f.querySelectorAll("slot[data-webjs-light]")){let p=Ft(d);p&&l.add(p)}}for(let u of l)fe(u);return}}oe(e,t)}function Nc(e,t){let n=e;K&&(n.__commitOwner=xn(K));let r=n.__untilState,o=n.__untilArgs,s=(d,p)=>!!(Object.is(d,p)||B(d)&&B(p)&&d.strings===p.strings),a=o&&o.length===t.length&&o.every((d,p)=>s(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?(oe(e,u),c.highestResolved=l):l===-1&&!n.__untilEverRendered&&oe(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{Vr(e,()=>oe(e,m))}catch(w){Kr(e,w);return}c.highestResolved=d}},()=>{})}}function Kr(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 Tc(e,t){let n=e;if(K&&(n.__commitOwner=xn(K)),n.__watchSig===t&&n.__watchSub){let s;n.__watchSub.observe(()=>{s=t.get()}),oe(e,s);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new It.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let s;try{r.observe(()=>{s=t.get()}),Vr(e,()=>oe(e,s))}catch(i){Kr(e,i)}})});n.__watchSub=r;let o;r.observe(()=>{o=t.get()}),oe(e,o)}function Ps(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function jc(e,t){let n=e;K&&(n.__commitOwner=xn(K));let r=e.child;if(r&&r.kind==="async-stream"&&r.mode==="append"&&r.iterable===t.iterable)return;_e(e);let o=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:o,nodes:[]};e.child=s,Ms(s,e,t)}function Rc(e,t){let n=e;K&&(n.__commitOwner=xn(K));let r=e.child;if(r&&r.kind==="async-stream"&&r.mode==="replace"&&r.iterable===t.iterable)return;_e(e);let o=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:o,nodes:[]};e.child=s,Ms(s,e,t)}async function Ms(e,t,n){let r=t.marker,o=0;for(;!e.aborted;){let s,i;try{if(s=await e.iterator.next(),e.aborted||s.done)break;i=n.mapper?n.mapper(s.value,o):s.value}catch(a){typeof console<"u"&&console.error("[webjs] asyncStream error:",a);return}try{Vr(t,()=>{let a=Fs(i);Ls(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{}Kr(t,a);return}o++}}function Fs(e){if(e==null||e===!1||e===!0)return[];if(B(e)){let t=e,{templateEl:n,parts:r,formActions:o}=Cn(t),s=n.content.cloneNode(!0),i=r.map(a=>kn(a,s));for(let a=0;a<t.values.length;a++)se(i[a],t.values[a],void 0,t.values);Bt(o,i,t.values);for(let a of i)a.kind==="slot"&&se(a,void 0,void 0,[]);return[...s.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...Fs(n));return t}return[document.createTextNode(String(e))]}function Ds(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 Bs=null;function Nn(e){Bs=e||null}function Lc(){return Bs||void 0}Qe();var qs=Symbol.for("webjs:registry"),Hs=Symbol.for("webjs:classToTag"),Tn=globalThis,ie=Tn[qs]||(Tn[qs]=new Map),Us=Tn[Hs]||(Tn[Hs]=new WeakMap),jn=typeof window<"u"&&typeof customElements<"u";function Yr(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=ie.get(e);r?(r.cls=t,r.lazy=n):ie.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),Us.set(t,e)}if(jn){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),Yr(t,n)}}if(!jn){let e=globalThis;e.customElements||(e.customElements={define(t,n){Yr(t,n)},get(t){return ie.get(t)?.cls},upgrade(){},whenDefined(t){let n=ie.get(t);return Promise.resolve(n?.cls)}})}function Gr(e,t){jn?customElements.define(e,t):Yr(e,t)}function Oc(e,t){if(jn)return;let n=ie.get(e);if(n){n.moduleUrl=t;return}ie.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Jr(e){return ie.get(e)?.cls}function $c(e){return ie.get(e)?.moduleUrl||null}function Ic(e){return ie.get(e)?.lazy===!0}function qt(e){return Us.get(e)}function Xr(){return[...ie.keys()]}pt();Sn();var Xs=typeof window<"u"&&typeof HTMLElement<"u";function Yc(e,t){return e!==t}function Gc(e){try{return String(e)}catch{return Object.prototype.toString.call(e)}}function Ys(e,t,n){if(typeof console>"u"||!console.warn)return;let r=qt(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 Jc(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var Rn=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 s=t.getAttribute(n(o));return s===null?void 0:s},set(r,o,s){return typeof o=="string"&&t.setAttribute(n(o),s),!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,s)=>s.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=Jc(),this.__internals}},Xc=["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 Xc){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(Rn.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var Zc=Xs?HTMLElement:Rn,Zs=Symbol("webjs.factoryProps"),Gs=new WeakSet,ht=class e extends Zc{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){Gr(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||Zr(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(Gs.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,Zs)){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)}Gs.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,o]of Object.entries(n)){let s=typeof o=="object"?o:{type:o},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:a=>{let c=this.__propValues[r];(s.hasChanged||Yc)(a,c)&&(this.__propValues[r]=a,s.reflect&&!s.state&&this._connected&&this._reflectAttribute(r,a,s),this.requestUpdate(r,c))}}),i!==void 0?this.__propValues[r]=i:s.default!==void 0&&(this.__propValues[r]=typeof s.default=="function"?s.default():s.default)}}}_reflectAttribute(t,n,r){let o=r.attribute||Zr(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let s=r.converter.toAttribute(n,r.type);s==null?this.removeAttribute(o):this.setAttribute(o,s)}else typeof n=="function"?(this.removeAttribute(o),Ys(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)):cn(n)?(this.removeAttribute(o),Ys(this,t,o)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!Xs)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 s=Js(r.slice(16));try{this[s]=de(o)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow!==!0&&!this.hasAttribute("data-wj-host")&&this.setAttribute("data-wj-host",""),t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,o=Array.isArray(r)?r:We(r)?[r]:[];if(o.length){if(n){let s=this.shadowRoot.querySelector("style");s&&s.remove()}lr(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${qt(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().`),Br(this)?Es(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||Ns(this)?(this.removeAttribute("data-wj-serialized"),ue(this),ms(this)):hs(this),ks(this),Ss(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),vs(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 s=this.constructor.properties||{},i,a;for(let[u,f]of Object.entries(s))if(((typeof f=="object"?f:{type:f}).attribute||Zr(u))===t){i=u,a=f;break}if(a===void 0&&(i=Js(t),a=s[i]||s[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[i]!==l&&(this[i]=l,this._connected&&this.requestUpdate())}requestUpdate(t,n){t!==void 0&&!this._changedProperties.has(t)&&this._changedProperties.set(t,n),this._scheduleUpdate()}_scheduleUpdate(){this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),!this._isUpdating&&(this._scheduled||!this._connected||(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(t){console.error("[webjs] lifecycle hook threw during update cycle:",t)}})))}_performRender(){if(!this._renderRoot)return;let t=this._changedProperties;this._isUpdating=!0;let n=!1,r=null;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let 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,Nn(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{Nn(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 s=()=>{if(this.__pendingAsyncCommits--,o===this.__renderToken){for(let i of this.__controllers)i.hostUpdated&&i.hostUpdated();this._postCommit(t)}};r.then(s,i=>{try{o===this.__renderToken&&this._handleRenderError(i instanceof Error?i:new Error(Gc(i)))}finally{s()}});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 It.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);dt(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&dt(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{if(n===this.__renderToken)try{dt(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!==Ln.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${qt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&dt(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 Zr(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Js(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Ln(e){return new.target?Reflect.construct(ht,arguments,new.target):class extends ht{static properties=e;static[Zs]=!0}}Object.setPrototypeOf(Ln,ht);Ln.prototype=ht.prototype;function Qc(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}on();Nt();Qe();var Wf=Symbol.for("webjs.suspense");function el(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function On(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}pt();var Qr=null;function tl(e){Qr=e}function eo(){if(!Qr)return"";try{return Qr()||""}catch{return""}}async function nl(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;n&&n.dev===void 0&&r!==void 0&&(n.dev=r);let o=await M(e,n);return t&&t.ssr===!1?o:await Ae(o,n,[],r)}async function M(e,t){if(e==null||e===!1||e===!0)return"";if(e&&typeof e.then=="function")return e=await e,M(e,t);if(et(e))return String(e.value??"");if(Ne(e))return M(e.value,t);if($e(e))return M(e.signal.get(),t);if(Te(e))return M(e.value,t);if(je(e))return M(e.fn(),t);if(tt(e)){let n=e.template;return String(n?.innerHTML??"")}if(Re(e))return"";if(Le(e))return M(e.value,t);if(Oe(e)){let n=e.args;for(let r of n)if(!r||typeof r.then!="function")return M(r,t);if(n.length>0)try{let r=await Promise.race(n.map(o=>Promise.resolve(o).catch(()=>{})));return M(r,t)}catch{return""}return""}if(nt(e)||rt(e))return"";if(Array.isArray(e))return(await Promise.all(e.map(r=>M(r,t)))).join("");if(ke(e)){let n=e;return(await Promise.all(n.items.map((o,s)=>M(n.templateFn(o,s),t)))).join("")}if(On(e)){let n=e,r=await M(n.fallback,t);if(t){let o=`s${t.nextId++}`;return t.pending.push({id:o,promise:Promise.resolve(n.children)}),`<webjs-boundary id="${o}">${r}</webjs-boundary>`}return r}return B(e)?rl(e,t):sn(String(e))}async function rl(e,t){let{strings:n,values:r}=e,o="",s="text",i="",a=0,c="",l=0,u="",f="",d=-1,p=null,m=null,w=0,g=[],A=[],b=!1,x=()=>{let C=g,v=A,S=w>1,h=m;if(g=[],A=[],w=0,m=null,p!=null){Lt({duplicateAction:S,propAttrs:C});let y=hr(o.slice(d),p);o=o.slice(0,d)+y.tag+y.hidden,p=null}h!=null&&(o=o.slice(0,d)+br(o.slice(d),h,{duplicateAction:S,propAttrs:v}))},_=(C,v)=>{let S=String(v).toLowerCase();if(S==="button"||S==="input"){Xe(C)&&A.push(String(C));return}if(S!=="form")return;let h=String(C).toLowerCase();h==="encoding"&&(h="enctype"),(h==="method"||h==="enctype")&&g.push(String(C))},E=(C,v)=>{let S=String(v).toLowerCase(),h=String(C).toLowerCase();(S==="form"&&h==="action"||(S==="button"||S==="input")&&h==="formaction")&&(w+=1)},T=C=>{x(),b=!1,s=C&&ro(u)?"rawtext":"text",s==="rawtext"&&(f="")};for(let C=0;C<n.length;C++){let v=n[C];for(let S=0;S<v.length;S++){let h=v[S];switch(s){case"text":o+=h,h==="<"&&(s="tag-open",d=o.length-1,b=!1);break;case"tag-open":o+=h,h==="!"?s="bang-1":h==="/"?(s="tag-name",u="",b=!0):/[a-zA-Z]/.test(h)?(s="tag-name",u=h.toLowerCase()):s="text";break;case"bang-1":o+=h,s=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=h,h==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=h,h==="-"?l+=1:(h===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=h,h===">"?T(!0):/\s/.test(h)?s="in-tag":u+=h.toLowerCase();break;case"in-tag":o+=h,h===">"?T(!0):!/\s/.test(h)&&h!=="/"&&(s="attr-name",i=h,a=o.length-1);break;case"rawtext":o+=h,f=(f+h.toLowerCase()).slice(-9),(f.endsWith("<\/script>")||f.endsWith("</style>"))&&(s="text",f="",u="");break;case"attr-name":h==="="?(s="after-eq",o+=h):/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h,T(!1)):(i+=h,o+=h);break;case"after-eq":h==='"'||h==="'"?(s="attr-quoted",c=h,o+=h):/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h,T(!1)):(s="attr-unquoted",o+=h);break;case"attr-unquoted":/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h,T(!1)):o+=h;break;case"attr-quoted":o+=h,h===c&&(s="in-tag",i="");break}}if(C<r.length){let S=r[C];if(S&&typeof S.then=="function"&&(S=await S),s==="comment")o+=String(S??""),l=0;else if(s==="rawtext")o+=String(S??""),f="";else if(s==="text")o+=await M(S,t);else if(s==="after-eq"){let h=i[0],y=i.slice(1),k=Ve[h];if(k==="event")o=o.slice(0,a),s="in-tag",i="";else if(k==="prop"){if(o=o.slice(0,a),u==="webjs-suspense"&&y==="fallback"){let N=await M(S,t);o+=`data-webjs-fallback="${H(N)}"`,s="in-tag",i="";continue}if(!u.includes("-")){Rt(S,y,u),_(y,u),s="in-tag",i="";continue}if(S===void 0){s="in-tag",i="";continue}try{let N=await Wt(S);o+=`data-webjs-prop-${Al(y)}="${H(N)}"`}catch(N){console.warn(`[webjs] property binding .${y} has an unserializable value during SSR. Dropping. The browser will see the property as undefined. Detail: ${N&&N.message}`)}s="in-tag",i=""}else if(k==="bool")X(S,y,u),o=o.slice(0,a),S&&(o+=`${y}=""`),s="in-tag",i="";else if(ze(S,i,u)){if(E(i,u),u==="form")p=be(await jt(S),u),o=o.slice(0,a).replace(/\s+$/,"");else{Je(m!=null,u);let N=Ze(o.slice(d));N.has("name")&&Ke(N.get("name")||"",u,!1),N.has("value")&&Ye(u),N.has("form")&&Ge(u);let j=be(await jt(S),u);m=u,o=o.slice(0,a)+`name="${R}" value="${H(j)}"`}s="in-tag",i=""}else E(i,u),X(S,i,u),o+=`"${H(String(S??""))}"`,s="in-tag",i=""}else(s==="attr-quoted"||s==="attr-unquoted")&&(X(S,i,u),o+=H(String(S??"")))}}return o}var ol=new Set(["document","window","localStorage","sessionStorage","navigator","matchMedia","requestAnimationFrame","getComputedStyle","IntersectionObserver","MutationObserver","ResizeObserver"]),sl=new Set(["attachShadow","querySelector","querySelectorAll","getBoundingClientRect","focus","blur","scrollIntoView"]);function il(e){let t=e&&typeof e.message=="string"?e.message:"",n=/^(\w+) is not defined\b/.exec(t);return e instanceof ReferenceError&&n&&ol.has(n[1])?`\`${n[1]}\` is a browser-only global and is undefined during SSR.`:(n=/\.(\w+) is not a function\b/.exec(t),e instanceof TypeError&&n&&sl.has(n[1])?`\`${n[1]}\` is an HTMLElement method that does not exist on the server-side component instance during SSR.`:null)}function al(){return typeof process<"u"&&process.env&&!0}function ni(e,t,n){if(!(n===void 0?!al():!!n))return"";let o=t&&t.message?t.message:String(t);return cr`<div data-webjs-error="${e}" style="border:1px solid #f5c2c7;background:#f8d7da;color:#842029;padding:8px 12px;border-radius:6px;font:13px/1.4 system-ui,sans-serif">
5
+ `)}</style>`}on();Tt();Qe();var ns=Symbol.for("webjs.repeat");function rs(e,t,n){return{[ns]:!0,items:[...e],keyFn:t,templateFn:n}}function ke(e){return!!e&&typeof e=="object"&&e[ns]===!0}function gr(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function et(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function va(e){return{_$webjs:"live",value:e}}function Ne(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function Ea(e,t){return{_$webjs:"keyed",key:e,value:t}}function Te(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function xa(e,t){return{_$webjs:"guard",deps:e,fn:t}}function je(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Ca(e){return{_$webjs:"template-content",template:e}}function tt(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function ka(e){return{_$webjs:"ref",target:e}}function Re(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Na(){return{value:void 0}}function Ta(e){return{_$webjs:"cache",value:e}}function Le(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function ja(...e){return{_$webjs:"until",args:e}}function Oe(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function Ra(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function nt(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function La(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function rt(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Oa(e){return{_$webjs:"watch",signal:e}}function $e(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var ee=null,ge=!1,st=0,ot=null,yr=0,os=(e,t)=>Object.is(e,t),un=()=>{},ss=()=>!1;function is(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)is(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function $t(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)$t(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function Er(e){if(ge)throw new Error("Signal read during notification phase");if(ee===null)return;let t=ee,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&Sr(t)&&$t(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,Sr(t)&&is(e,t)),t.producerLastReadVersions[n]=e.version}function Sr(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function as(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=ge;ge=!0;try{for(let n of e.liveConsumers)n.dirty||$a(n)}finally{ge=t}}function $a(e){e.dirty=!0,as(e),e.consumerMarkedDirty.call(e.wrapper||e)}function fn(e){if(!(!e.dirty&&e.lastCleanEpoch===st)){if(!e.producerMustRecompute()&&!Ia(e)){e.dirty=!1,e.lastCleanEpoch=st;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=st}}function Ia(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(fn(n),r!==n.version))return!0}return!1}function Ar(e){e&&(e.nextProducerIndex=0);let t=ee;return ee=e,t}function vr(e,t){if(ee=t,!!e){if(Sr(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)$t(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var dn=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=st,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=ss,this.producerRecomputeValue=un,this.consumerMarkedDirty=un,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||os,this.watched=n?.[xr],this.unwatched=n?.[Cr]}get(){return Er(this),this.__value}peek(){return this.__value}set(t){if(ge)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,st++,ot!==null?cs(this):as(this))}};function cs(e){let t=ge;ge=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?ot.add(n):cs(n))}finally{ge=t}}var wr=Symbol("unset"),_r=Symbol("computing"),ln=Symbol("errored"),It=class{constructor(t,n){this.__fn=t,this.__value=wr,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||os,this.watched=n?.[xr],this.unwatched=n?.[Cr];let r=this;this.producerMustRecompute=function(){return r.__value===wr||r.__value===_r},this.producerRecomputeValue=function(){if(r.__value===_r)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=_r;let s=Ar(r),i,a=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=ln,r.__error=l,a=!0}finally{vr(r,s)}if(!a&&(o!==wr&&o!==ln)&&r.__equal.call(r.wrapper,o,i)){r.__value=o;return}r.__value=i,r.version++},this.consumerMarkedDirty=un}get(){if(fn(this),Er(this),this.__value===ln)throw this.__error;return this.__value}peek(){if(fn(this),this.__value===ln)throw this.__error;return this.__value}},pn=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=st,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=ss,this.producerRecomputeValue=un,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=Ar(this);try{for(let r of t)Er(r),r.__isComputed&&fn(r)}finally{vr(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&($t(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=Ar(this),r;try{r=t()}finally{vr(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)$t(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},xr=Symbol("watched"),Cr=Symbol("unwatched");function Pa(e){let t=ee;ee=null;try{return e()}finally{ee=t}}function Ma(e){return e.producers.slice()}function Fa(e){return e.liveConsumers?[...e.liveConsumers]:[]}function Da(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function Ba(e){return e.producers.length>0}function qa(){return ee&&ee.__isComputed?ee:null}function Ha(e){yr++,ot===null&&(ot=new Set);try{e()}finally{if(yr--,yr===0){let t=ot;ot=null;for(let n of t)n.__fire()}}}var Pt={State:dn,Computed:It,subtle:{Watcher:pn,untrack:Pa,introspectSources:Ma,introspectSinks:Fa,hasSinks:Da,hasSources:Ba,currentComputed:qa,watched:xr,unwatched:Cr}};function Ua(e,t){return new dn(e,t)}function Wa(e,t){return new It(e,t)}function Va(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function za(e){let t=!1,n=!1,r=new It(e),o=new pn(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(s){console.error(s)}o.watch()}}))});o.watch(r);try{r.get()}catch(s){console.error(s)}return()=>{n||(n=!0,o.dispose())}}Sn();function Ls(e,t){let n=e&&e[P]?e:null;return n?yn(n,t):t()}var Hr=new WeakMap,Ur=new WeakMap,An=Symbol.for("webjs.instance"),K=null;function xn(e){return e?e.nodeType===11&&e.host?e.host:e:null}function Vr(e,t){let n=e.__commitOwner,r=K;n&&(K=n);try{t()}finally{K=r}}function dt(e,t){let n=t,r=n[W];n[W]=!0;let o=K;K=t;try{let s=n[An];if(B(e)){let i=e;if(s&&s.strings===i.strings){ut(s,i.values);return}s&&Rs(s,t);let a=t.firstChild;a&&a.nodeType===8&&a.data==="webjs-hydrate"&&a.remove(),n[An]=null;let c=hc(i,t);n[An]=c;return}if(s&&Rs(s,t),n[An]=null,t.replaceChildren(),e==null||e===!1||e===!0)return;if(Array.isArray(e)){for(let i of e){let a=document.createTextNode(String(i??""));t.appendChild(a)}return}t.appendChild(document.createTextNode(String(e)))}finally{K=o,n[W]=r,r||qr(n)}}function Cn(e){let{strings:t}=e,n=Hr.get(t);if(n)return n;let r=[],o="",s="text",i="",a=0,c="",l=0,u=null,f="",d="";for(let w=0;w<t.length;w++){let g=t[w];for(let A=0;A<g.length;A++){let b=g[A];switch(s){case"text":o+=b,b==="<"&&(s="tag-open");break;case"tag-open":o+=b,b==="!"?s="bang-1":b==="/"?(s="tag-name",f=""):/[a-zA-Z]/.test(b)?(s="tag-name",f=b.toLowerCase()):s="text";break;case"bang-1":o+=b,s=b==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=b,b==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=b,b==="-"?l+=1:(b===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=b,b===">"?(s=f==="script"||f==="style"?"rawtext":"text",s==="rawtext"&&(d="")):/\s/.test(b)?s="in-tag":f+=b.toLowerCase();break;case"in-tag":o+=b,b===">"?(s=f==="script"||f==="style"?"rawtext":"text",s==="rawtext"&&(d="")):!/\s/.test(b)&&b!=="/"&&(s="attr-name",i=b,a=o.length-1);break;case"rawtext":o+=b,d=(d+b.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(s="text",d="",f="");break;case"attr-name":b==="="?(s="after-eq",o+=b):/\s/.test(b)?(s="in-tag",i="",o+=b):b===">"?(s="text",i="",o+=b):(i+=b,o+=b);break;case"after-eq":b==='"'||b==="'"?(s="attr-quoted",c=b,o+=b):/\s/.test(b)?(s="in-tag",i="",o+=b):b===">"?(s="text",i="",o+=b):(s="attr-unquoted",o+=b);break;case"attr-unquoted":/\s/.test(b)?(s="in-tag",i="",o+=b):(b===">"&&(s="text",i=""),o+=b);break;case"attr-quoted":o+=b,b===c&&(s="in-tag",i="");break;case"skip-attr":if(b===c){if(u){let x=u.firstPartIdx,_=[];for(let h=x;h<r.length;h++)(r[h].kind==="noop"||r[h].kind==="attr-mixed")&&_.push(h);let E=[],T=t[_[0]],C=T.lastIndexOf(c);E.push(C>=0?T.slice(C+1):T);for(let h=1;h<_.length;h++)E.push(t[_[h]]);let v=t[_[_.length-1]+1],S=v.indexOf(c);E.push(S>=0?v.slice(0,S):v),r[x]={kind:"attr-mixed",path:[],name:u.name,statics:E,group:_};for(let h=1;h<_.length;h++)r[_[h]]={kind:"noop",path:[],mixedAnchor:x};u=null}s="in-tag",i=""}break}}if(w<t.length-1){let A=r.length;if(s==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(s==="rawtext"){d="",r.push({kind:"noop",path:[]});continue}if(s==="text")o+=`<!--${F}${A}-->`,r.push({kind:"child",path:[]});else if(s==="in-tag"){let b=`data-${F}${A}`;o+=`${b}=""`,r.push({kind:"element",path:[]})}else if(s==="after-eq"){let b=i[0],x=i.slice(1);if(Nt(b)){o=o.slice(0,a);let _=Ve[b],E=`data-${F}${A}`;o+=`${E}=""`,r.push({kind:_,path:[],name:x})}else{o=o.slice(0,a);let _=`data-${F}${A}`;o+=`${_}=""`,r.push({kind:"attr",path:[],name:i})}s="in-tag",i=""}else if(s==="attr-quoted"||s==="attr-unquoted"){o=o.slice(0,a);let b=`data-${F}${A}`;o+=`${b}=""`,u={name:i,firstPartIdx:A},r.push({kind:"noop",path:[]}),s="skip-attr"}else s==="skip-attr"&&r.push({kind:"noop",path:[]})}}let p=document.createElement("template");p.innerHTML=o,lc(p.content,r);let m=uc(p.content,r);return n={templateEl:p,parts:r,formActions:m},Hr.set(t,n),n}function lc(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(D,"");let o=t.length;r.setAttribute(`data-${F}${o}`,""),t.push({kind:"slot",path:[]})}}function uc(e,t){let n=[],r=[];function o(s){for(let i=0;i<s.childNodes.length;i++){let a=s.childNodes[i];if(n.push(i),a.nodeType===8){let c=a.data;if(c.startsWith(F)){let l=Number(c.slice(F.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-${F}`)){let d=Number(f.name.slice(`data-${F}`.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=fc(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 fc(e,t,n){let r=e.localName==="form",o=r?"action":"formaction",s=r?"method":"formmethod",i=r?"enctype":"formenctype",a=t.filter(g=>g.kind==="attr"&&g.name.toLowerCase()===o);if(!a.length)return null;let c=[],l=[],u=[],f=r?[]:t.filter(g=>g.name.toLowerCase()==="name"&&(g.kind==="attr"||g.kind==="attr-mixed"||g.kind==="bool")).map(g=>({i:g.idx,kind:g.kind})),d=!r&&e.hasAttribute("name"),p=!r&&e.hasAttribute("form"),m=!r&&e.hasAttribute("value"),w=r?[]:t.filter(g=>g.name.toLowerCase()==="value"&&(g.kind==="attr"||g.kind==="attr-mixed"||g.kind==="bool")).map(g=>({i:g.idx,kind:g.kind}));for(let g of t){let A=String(g.name).toLowerCase();if(g.kind==="prop"){r?(A==="method"||A==="enctype"||A==="encoding")&&u.push(g.name):Xe(A)&&u.push(g.name);continue}if(A!==s&&A!==i||g.kind!=="attr"&&g.kind!=="attr-mixed"&&g.kind!=="bool")continue;let b=n[g.idx],x={i:g.idx,kind:g.kind};g.kind==="attr-mixed"&&(x.statics=b.statics||[],x.group=b.group||[]),(A===s?c:l).push(x)}return{isForm:r,tag:e.localName,actionIdxs:a.map(g=>g.idx),duplicateAction:a.length>1,staticAction:e.getAttribute(o)!=null,authoredName:d,authoredValue:m,authoredForm:p,propAttrs:u,nameParts:f,valueParts:w,staticMethod:e.getAttribute(s),staticEnctype:e.getAttribute(i),methodParts:c,enctypeParts:l}}function qt(e,t,n){if(e)for(let r of[!0,!1])for(let o of e){if(o.isForm!==r)continue;let s=o.actionIdxs[0],i=o.isForm?"action":"formaction";for(let l of o.actionIdxs)if(ze(lt(n[l]),i,o.tag)){s=l;break}let a=t[s];if(!a||!a.el)continue;let c=lt(n[s]);if(o.isForm)Qo(a.el,c,vn(o.methodParts,o.staticMethod,n),vn(o.enctypeParts,o.staticEnctype,n),o);else{let l=u=>u.some(f=>f.kind==="bool"?!!lt(n[f.i]):!0);pc(a.el,c,o,l(o.nameParts),l(o.valueParts),vn(o.methodParts,o.staticMethod,n),vn(o.enctypeParts,o.staticEnctype,n))}}}function dc(e){(Ur.has(e)||e.getAttribute("name")===R)&&(e.getAttribute("name")===R&&e.removeAttribute("name"),e.removeAttribute("value"),Ur.delete(e))}function pc(e,t,n,r,o,s,i){let a=typeof t=="function"?an(t):null;if(!a){typeof t=="function"&&be(null,e.localName),dc(e),es(e,s,i,n.propAttrs);return}Je(n.duplicateAction,e.localName),pr(n.propAttrs,e.localName),n.staticAction&&dr(e.localName),(n.authoredValue||o)&&Ye(e.localName),(n.authoredName||r)&&Ke(e.getAttribute("name")||R,e.localName,!1),(n.authoredForm||e.hasAttribute("form"))&&Ge(e.localName),fr(e.localName,e.getAttribute("type"));let c=mr(e.localName,s,i);e.removeAttribute("formaction"),e.setAttribute("name",R),e.setAttribute("value",a),jt(e,"formmethod",s,c.formMethod),jt(e,"formenctype",i,c.formEnctype),Ur.set(e,a)}function hc(e,t){let{templateEl:n,parts:r,formActions:o}=Cn(e),s=n.content.cloneNode(!0),i=document.createComment(`${F}s`),a=document.createComment(`${F}e`),c=r.map(f=>kn(f,s)),l=[];for(let f=0;f<e.values.length;f++)se(c[f],e.values[f],void 0,e.values),l.push(e.values[f]);qt(o,c,e.values),t.replaceChildren(i,...s.childNodes,a);let u=t.nodeType===1&&t[P]?t:null;for(let f of c)f.kind==="slot"&&(u&&f.slotEl&&(f.slotEl[gn]=u),se(f,void 0,void 0,[]));return{strings:e.strings,bound:c,lastValues:l,startNode:i,endNode:a}}function kn(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(s){o.handler?.(s)}};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 js=Symbol("webjs.commitFailed");function ut(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],s=o.mixedAnchor;try{o.kind==="noop"&&s!=null?se(e.bound[s],t[s],e.lastValues[s],t):se(o,r,e.lastValues[n],t)}catch(i){throw e.lastValues[n]=js,o.kind==="noop"&&s!=null&&(e.lastValues[s]=js),i}e.lastValues[n]=r}qt(Hr.get(e.strings)?.formActions??null,e.bound,t)}function Rs(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=Dt(n.slotEl);r&&Ts(r,n.slotEl)}}t.replaceChildren()}function vn(e,t,n){for(let r of e){if(r.kind==="bool")return lt(n[r.i])?"":U;if(r.kind==="attr"){let a=lt(n[r.i]);return a==null?"":String(a)}let o=r.statics||[],s=r.group||[],i=o[0]||"";for(let a=0;a<s.length;a++)i+=String(lt(n[s[a]])??""),i+=o[a+1]||"";return i}return t??U}function lt(e){return Ne(e)?e.value:e}function se(e,t,n,r){if(Ne(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":gc(e,t);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):ze(t,e.name,e.el.localName)||(X(t,e.name,e.el.localName),e.el.setAttribute(e.name,String(t)));break}case"prop":Lt(t,e.name,e.el.localName),e.el[e.name]=t;break;case"bool":X(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":bc(e,t);break;case"attr-mixed":{let o=e,s=o.statics[0];for(let i=0;i<o.group.length;i++){let a=r?r[o.group[i]]:t;X(a,e.name,e.el.localName),s+=String(a??""),s+=o.statics[i+1]||""}e.el.setAttribute(e.name,s);break}case"slot":{if(e.applied)break;let o=e.slotEl,s=()=>{let a=Dt(o);if(!a){e.applied=!0;return}if(!a.contains(o)){a.isConnected?queueMicrotask(s):e.applied=!0;return}if(e.applied=!0,mc(o))return;let c=document.createDocumentFragment();for(;o.firstChild;)c.appendChild(o.firstChild);o[Ft]=c,queueMicrotask(()=>fe(a))},i=Dt(o);i&&i.contains(o)?s():queueMicrotask(s);break}case"noop":break}}function Dt(e){let t=e[gn];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[P])return n;n=n.parentElement}return null}function mc(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 bc(e,t){let n=e,r=Re(t)?t.target:void 0,o=n.__refTarget,s=r!==o;if(s&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(s||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!s&&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 gc(e,t){return kc(e,t),oe(e,t)}function oe(e,t){return Ls(e.marker&&e.marker.parentNode,()=>yc(e,t))}function yc(e,t){let n=e.marker;if(et(t)){_e(e);let o=String(t.value??""),s=document.createElement("template");s.innerHTML=o;let i=[...s.content.childNodes],a=document.createDocumentFragment();for(let c of i)a.appendChild(c);n.parentNode?.insertBefore(a,n),e.child=i;return}if(Te(t)){let o=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,o.key)&&_e(e),e.__keyedKey=o.key,oe(e,o.value);return}if(je(t)){let o=t,s=e.__guardDeps,i=o.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(i)?Cc(s,i):Object.is(s,i)))return;let a=Array.isArray(i)?i.slice():i;oe(e,o.fn()),e.__guardDeps=a;return}if(tt(t)){_e(e);let o=t.template;if(o&&o.content){let s=o.content.cloneNode(!0),i=[...s.childNodes];n.parentNode?.insertBefore(s,n),e.child=i}return}if(Re(t))return;if(Le(t))return Nc(e,t.value);if(Oe(t))return Tc(e,t.args);if($e(t))return jc(e,t.signal);if(nt(t))return Rc(e,t);if(rt(t))return Lc(e,t);if(ke(t)){if(e.child&&e.child.kind==="repeat"){Sc(e,t);return}_e(e);let o={kind:"repeat",map:new Map};e.child=o,_c(n,o,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){Ec(e,t);return}_e(e);let o={kind:"array",items:[]};e.child=o,vc(n,o,t);return}if(e.child){let o=e.child;if(o.kind==="repeat")Os(o),e.child=void 0;else if(o.kind==="array")Is(o),e.child=void 0;else if(o.kind==="async-stream")Ds(o),e.child=void 0;else if("strings"in e.child){let s=e.child;if(B(t)&&s.strings===t.strings){ut(s,t.values);return}ft(s.startNode,s.endNode),e.child=void 0}else{for(let s of e.child)s.parentNode&&s.parentNode.removeChild(s);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(B(t)){let o=t,{templateEl:s,parts:i,formActions:a}=Cn(o),c=s.content.cloneNode(!0),l=document.createComment(`${F}s`),u=document.createComment(`${F}e`),f=i.map(m=>kn(m,c)),d=[];for(let m=0;m<o.values.length;m++)se(f[m],o.values[m],void 0,o.values),d.push(o.values[m]);qt(a,f,o.values);let p=[l,...c.childNodes,u];n.parentNode?.insertBefore(wc(p),n);for(let m of f)m.kind==="slot"&&se(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 wc(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function ft(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 zr(e){let{templateEl:t,parts:n,formActions:r}=Cn(e),o=t.content.cloneNode(!0),s=document.createComment(`${F}s`),i=document.createComment(`${F}e`),a=n.map(u=>kn(u,o)),c=[];for(let u=0;u<e.values.length;u++)se(a[u],e.values[u],void 0,e.values),c.push(e.values[u]);qt(r,a,e.values);for(let u of a)u.kind==="slot"&&se(u,void 0,void 0,[]);let l=document.createDocumentFragment();for(l.appendChild(s);o.firstChild;)l.appendChild(o.firstChild);return l.appendChild(i),{inst:{strings:e.strings,bound:a,lastValues:c,startNode:s,endNode:i},frag:l}}function Bt(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 _c(e,t,n){let{items:r,keyFn:o,templateFn:s}=n,i=e.parentNode;if(!i)return;let a=document.createDocumentFragment();for(let c=0;c<r.length;c++){let l=o(r[c],c),u=s(r[c],c);if(!B(u))continue;let{inst:f,frag:d}=zr(u);t.map.set(l,f),a.appendChild(d)}i.insertBefore(a,e)}function Sc(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,{items:s,keyFn:i,templateFn:a}=t,c=new Map;try{for(let l=0;l<s.length;l++){let u=i(s[l],l),f=a(s[l],l);if(!B(f))continue;let d=o.map.get(u);if(d&&d.strings===f.strings)ut(d,f.values),Wr(d.startNode,d.endNode,r,n),c.set(u,d),o.map.delete(u);else{d&&(o.map.delete(u),Bt(d),ft(d.startNode,d.endNode));let{inst:p,frag:m}=zr(f);r.insertBefore(m,n),c.set(u,p)}}for(let[l,u]of[...o.map]){o.map.delete(l);try{Bt(u)}finally{ft(u.startNode,u.endNode)}}o.map=c}catch(l){for(let[u,f]of c)o.map.set(u,f);throw l}}function Os(e){for(let[t,n]of[...e.map]){e.map.delete(t);try{Bt(n)}finally{ft(n.startNode,n.endNode)}}e.map.clear()}function Ac(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function En(e){e.type==="tpl"?(Bt(e.inst),ft(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function $s(e){if(B(e)){let{inst:t,frag:n}=zr(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 vc(e,t,n){let r=e.parentNode;if(!r)return;let o=document.createDocumentFragment(),s=[];for(let i of n){let{item:a,frag:c}=$s(i);c&&o.appendChild(c),s.push(a)}r.insertBefore(o,e),t.items=s}function Ec(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,s=o.items,i=[],a=0;try{for(let c=0;c<t.length;c++){let l=t[c],u=s[c];if(B(l)){let p=l;if(u&&u.type==="tpl"&&u.inst.strings===p.strings){ut(u.inst,p.values),i.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),i.push(u),a=c+1;continue}}else{u&&En(u),i.push({type:"empty"}),a=c+1;continue}let{item:f,frag:d}=$s(l);d&&r.insertBefore(d,xc(s,c,n)),i.push(f),u&&En(u),a=c+1}for(let c=t.length;c<s.length;c++)En(s[c]),a=c+1;o.items=i}catch(c){throw o.items=i.concat(s.slice(a)),c}}function xc(e,t,n){for(let r=t;r<e.length;r++){let o=Ac(e[r]);if(o&&o.parentNode)return o}return n}function Is(e){for(let t of e.items)En(t);e.items=[]}function Wr(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),s=e;for(;s;){let i=s.nextSibling;if(o.appendChild(s),s===t)break;s=i}n.insertBefore(o,r)}function Cc(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 _e(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Ps(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Os(n);else if(n.kind==="array")Is(n);else if(n.kind==="async-stream")Ds(n);else if("strings"in n){let r=e.child;Bt(r),ft(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function kc(e,t){let n=e;n.__untilState&&!Oe(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!je(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!Le(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!Te(t)&&(n.__keyedKey=void 0),n.__watchSub&&!$e(t)&&Ps(n)}function Nc(e,t){let n=e.marker,r=e,o=r.__cacheMap;o||(o=new Map,r.__cacheMap=o);let s=e.child;if(s&&"strings"in s){let a=s;if(B(t)&&a.strings===t.strings){ut(a,t.values);return}let c=document.createDocumentFragment();Wr(a.startNode,a.endNode,c,null),o.set(a.strings,{inst:a,holder:c}),e.child=void 0}if(B(t)){let a=t,c=o.get(a.strings);if(c){o.delete(a.strings),e.child&&_e(e),Wr(c.inst.startNode,c.inst.endNode,n.parentNode,n),ut(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=Dt(f);d&&l.add(d)}for(let d of f.querySelectorAll("slot[data-webjs-light]")){let p=Dt(d);p&&l.add(p)}}for(let u of l)fe(u);return}}oe(e,t)}function Tc(e,t){let n=e;K&&(n.__commitOwner=xn(K));let r=n.__untilState,o=n.__untilArgs,s=(d,p)=>!!(Object.is(d,p)||B(d)&&B(p)&&d.strings===p.strings),a=o&&o.length===t.length&&o.every((d,p)=>s(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?(oe(e,u),c.highestResolved=l):l===-1&&!n.__untilEverRendered&&oe(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{Vr(e,()=>oe(e,m))}catch(w){Kr(e,w);return}c.highestResolved=d}},()=>{})}}function Kr(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 jc(e,t){let n=e;if(K&&(n.__commitOwner=xn(K)),n.__watchSig===t&&n.__watchSub){let s;n.__watchSub.observe(()=>{s=t.get()}),oe(e,s);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new Pt.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let s;try{r.observe(()=>{s=t.get()}),Vr(e,()=>oe(e,s))}catch(i){Kr(e,i)}})});n.__watchSub=r;let o;r.observe(()=>{o=t.get()}),oe(e,o)}function Ps(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Rc(e,t){let n=e;K&&(n.__commitOwner=xn(K));let r=e.child;if(r&&r.kind==="async-stream"&&r.mode==="append"&&r.iterable===t.iterable)return;_e(e);let o=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:o,nodes:[]};e.child=s,Ms(s,e,t)}function Lc(e,t){let n=e;K&&(n.__commitOwner=xn(K));let r=e.child;if(r&&r.kind==="async-stream"&&r.mode==="replace"&&r.iterable===t.iterable)return;_e(e);let o=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:o,nodes:[]};e.child=s,Ms(s,e,t)}async function Ms(e,t,n){let r=t.marker,o=0;for(;!e.aborted;){let s,i;try{if(s=await e.iterator.next(),e.aborted||s.done)break;i=n.mapper?n.mapper(s.value,o):s.value}catch(a){typeof console<"u"&&console.error("[webjs] asyncStream error:",a);return}try{Vr(t,()=>{let a=Fs(i);Ls(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{}Kr(t,a);return}o++}}function Fs(e){if(e==null||e===!1||e===!0)return[];if(B(e)){let t=e,{templateEl:n,parts:r,formActions:o}=Cn(t),s=n.content.cloneNode(!0),i=r.map(a=>kn(a,s));for(let a=0;a<t.values.length;a++)se(i[a],t.values[a],void 0,t.values);qt(o,i,t.values);for(let a of i)a.kind==="slot"&&se(a,void 0,void 0,[]);return[...s.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...Fs(n));return t}return[document.createTextNode(String(e))]}function Ds(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 Bs=null;function Nn(e){Bs=e||null}function Oc(){return Bs||void 0}Qe();var qs=Symbol.for("webjs:registry"),Hs=Symbol.for("webjs:classToTag"),Tn=globalThis,ie=Tn[qs]||(Tn[qs]=new Map),Us=Tn[Hs]||(Tn[Hs]=new WeakMap),jn=typeof window<"u"&&typeof customElements<"u";function Yr(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=ie.get(e);r?(r.cls=t,r.lazy=n):ie.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),Us.set(t,e)}if(jn){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),Yr(t,n)}}if(!jn){let e=globalThis;e.customElements||(e.customElements={define(t,n){Yr(t,n)},get(t){return ie.get(t)?.cls},upgrade(){},whenDefined(t){let n=ie.get(t);return Promise.resolve(n?.cls)}})}function Gr(e,t){jn?customElements.define(e,t):Yr(e,t)}function $c(e,t){if(jn)return;let n=ie.get(e);if(n){n.moduleUrl=t;return}ie.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Jr(e){return ie.get(e)?.cls}function Ic(e){return ie.get(e)?.moduleUrl||null}function Pc(e){return ie.get(e)?.lazy===!0}function pt(e){return Us.get(e)}function Xr(){return[...ie.keys()]}ht();Sn();var Xs=typeof window<"u"&&typeof HTMLElement<"u";function Gc(e,t){return e!==t}function Jc(e){try{return String(e)}catch{return Object.prototype.toString.call(e)}}function Ys(e,t,n){if(typeof console>"u"||!console.warn)return;let r=pt(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 Xc(e,t,n,r){if(typeof console>"u"||!console.warn)return;let o=pt(e.constructor)||e.tagName?.toLowerCase()||"unknown";console.warn(`[webjs] reflect:true property "${t}" on <${o}> holds a value JSON.stringify cannot serialize (a cycle, a BigInt, or a throwing toJSON), so it has no HTML attribute representation. Removing "${n}" instead. Detail: ${r}`)}function Zc(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var Rn=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 s=t.getAttribute(n(o));return s===null?void 0:s},set(r,o,s){return typeof o=="string"&&t.setAttribute(n(o),s),!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,s)=>s.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=Zc(),this.__internals}},Qc=["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 Qc){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(Rn.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var el=Xs?HTMLElement:Rn,Zs=Symbol("webjs.factoryProps"),Gs=new WeakSet,mt=class e extends el{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){Gr(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||Zr(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(Gs.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,Zs)){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)}Gs.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,o]of Object.entries(n)){let s=typeof o=="object"?o:{type:o},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:a=>{let c=this.__propValues[r];(s.hasChanged||Gc)(a,c)&&(this.__propValues[r]=a,s.reflect&&!s.state&&this._connected&&this._reflectAttribute(r,a,s),this.requestUpdate(r,c))}}),i!==void 0?this.__propValues[r]=i:s.default!==void 0&&(this.__propValues[r]=typeof s.default=="function"?s.default():s.default)}}}_reflectAttribute(t,n,r){let o=r.attribute||Zr(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let s=r.converter.toAttribute(n,r.type);s==null?this.removeAttribute(o):this.setAttribute(o,s)}else if(typeof n=="function")this.removeAttribute(o),Ys(this,t,o);else if(r.type===Boolean)n?this.setAttribute(o,""):this.removeAttribute(o);else if(n==null)this.removeAttribute(o);else if(r.type===Object||r.type===Array){let s,i=!0;try{s=JSON.stringify(n)}catch(a){i=!1,this.removeAttribute(o),Xc(this,t,o,a&&a.message)}i&&this.setAttribute(o,s)}else cn(n)?(this.removeAttribute(o),Ys(this,t,o)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!Xs)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 s=Js(r.slice(16));try{this[s]=de(o)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow!==!0&&!this.hasAttribute("data-wj-host")&&this.setAttribute("data-wj-host",""),t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,o=Array.isArray(r)?r:We(r)?[r]:[];if(o.length){if(n){let s=this.shadowRoot.querySelector("style");s&&s.remove()}lr(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${pt(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().`),Br(this)?Es(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||Ns(this)?(this.removeAttribute("data-wj-serialized"),ue(this),ms(this)):hs(this),ks(this),Ss(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),vs(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 s=this.constructor.properties||{},i,a;for(let[u,f]of Object.entries(s))if(((typeof f=="object"?f:{type:f}).attribute||Zr(u))===t){i=u,a=f;break}if(a===void 0&&(i=Js(t),a=s[i]||s[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=null}else l=r;this[i]!==l&&(this[i]=l,this._connected&&this.requestUpdate())}requestUpdate(t,n){t!==void 0&&!this._changedProperties.has(t)&&this._changedProperties.set(t,n),this._scheduleUpdate()}_scheduleUpdate(){this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),!this._isUpdating&&(this._scheduled||!this._connected||(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(t){console.error("[webjs] lifecycle hook threw during update cycle:",t)}})))}_performRender(){if(!this._renderRoot)return;let t=this._changedProperties;this._isUpdating=!0;let n=!1,r=null;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let 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,Nn(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{Nn(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 s=()=>{if(this.__pendingAsyncCommits--,o===this.__renderToken){for(let i of this.__controllers)i.hostUpdated&&i.hostUpdated();this._postCommit(t)}};r.then(s,i=>{try{o===this.__renderToken&&this._handleRenderError(i instanceof Error?i:new Error(Jc(i)))}finally{s()}});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 Pt.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);dt(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&dt(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{if(n===this.__renderToken)try{dt(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!==Ln.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${pt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&dt(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 Zr(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Js(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Ln(e){return new.target?Reflect.construct(mt,arguments,new.target):class extends mt{static properties=e;static[Zs]=!0}}Object.setPrototypeOf(Ln,mt);Ln.prototype=mt.prototype;function tl(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}on();Tt();Qe();var Vf=Symbol.for("webjs.suspense");function nl(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function On(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}ht();var Qr=null;function rl(e){Qr=e}function eo(){if(!Qr)return"";try{return Qr()||""}catch{return""}}async function ol(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;n&&n.dev===void 0&&r!==void 0&&(n.dev=r);let o=await M(e,n);return t&&t.ssr===!1?o:await Ae(o,n,[],r)}async function M(e,t){if(e==null||e===!1||e===!0)return"";if(e&&typeof e.then=="function")return e=await e,M(e,t);if(et(e))return String(e.value??"");if(Ne(e))return M(e.value,t);if($e(e))return M(e.signal.get(),t);if(Te(e))return M(e.value,t);if(je(e))return M(e.fn(),t);if(tt(e)){let n=e.template;return String(n?.innerHTML??"")}if(Re(e))return"";if(Le(e))return M(e.value,t);if(Oe(e)){let n=e.args;for(let r of n)if(!r||typeof r.then!="function")return M(r,t);if(n.length>0)try{let r=await Promise.race(n.map(o=>Promise.resolve(o).catch(()=>{})));return M(r,t)}catch{return""}return""}if(nt(e)||rt(e))return"";if(Array.isArray(e))return(await Promise.all(e.map(r=>M(r,t)))).join("");if(ke(e)){let n=e;return(await Promise.all(n.items.map((o,s)=>M(n.templateFn(o,s),t)))).join("")}if(On(e)){let n=e,r=await M(n.fallback,t);if(t){let o=`s${t.nextId++}`;return t.pending.push({id:o,promise:Promise.resolve(n.children)}),`<webjs-boundary id="${o}">${r}</webjs-boundary>`}return r}return B(e)?sl(e,t):sn(String(e))}async function sl(e,t){let{strings:n,values:r}=e,o="",s="text",i="",a=0,c="",l=0,u="",f="",d=-1,p=null,m=null,w=0,g=[],A=[],b=!1,x=()=>{let C=g,v=A,S=w>1,h=m;if(g=[],A=[],w=0,m=null,p!=null){Ot({duplicateAction:S,propAttrs:C});let y=hr(o.slice(d),p);o=o.slice(0,d)+y.tag+y.hidden,p=null}h!=null&&(o=o.slice(0,d)+br(o.slice(d),h,{duplicateAction:S,propAttrs:v}))},_=(C,v)=>{let S=String(v).toLowerCase();if(S==="button"||S==="input"){Xe(C)&&A.push(String(C));return}if(S!=="form")return;let h=String(C).toLowerCase();h==="encoding"&&(h="enctype"),(h==="method"||h==="enctype")&&g.push(String(C))},E=(C,v)=>{let S=String(v).toLowerCase(),h=String(C).toLowerCase();(S==="form"&&h==="action"||(S==="button"||S==="input")&&h==="formaction")&&(w+=1)},T=C=>{x(),b=!1,s=C&&ro(u)?"rawtext":"text",s==="rawtext"&&(f="")};for(let C=0;C<n.length;C++){let v=n[C];for(let S=0;S<v.length;S++){let h=v[S];switch(s){case"text":o+=h,h==="<"&&(s="tag-open",d=o.length-1,b=!1);break;case"tag-open":o+=h,h==="!"?s="bang-1":h==="/"?(s="tag-name",u="",b=!0):/[a-zA-Z]/.test(h)?(s="tag-name",u=h.toLowerCase()):s="text";break;case"bang-1":o+=h,s=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=h,h==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=h,h==="-"?l+=1:(h===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=h,h===">"?T(!0):/\s/.test(h)?s="in-tag":u+=h.toLowerCase();break;case"in-tag":o+=h,h===">"?T(!0):!/\s/.test(h)&&h!=="/"&&(s="attr-name",i=h,a=o.length-1);break;case"rawtext":o+=h,f=(f+h.toLowerCase()).slice(-9),(f.endsWith("<\/script>")||f.endsWith("</style>"))&&(s="text",f="",u="");break;case"attr-name":h==="="?(s="after-eq",o+=h):/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h,T(!1)):(i+=h,o+=h);break;case"after-eq":h==='"'||h==="'"?(s="attr-quoted",c=h,o+=h):/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h,T(!1)):(s="attr-unquoted",o+=h);break;case"attr-unquoted":/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h,T(!1)):o+=h;break;case"attr-quoted":o+=h,h===c&&(s="in-tag",i="");break}}if(C<r.length){let S=r[C];if(S&&typeof S.then=="function"&&(S=await S),s==="comment")o+=String(S??""),l=0;else if(s==="rawtext")o+=String(S??""),f="";else if(s==="text")o+=await M(S,t);else if(s==="after-eq"){let h=i[0],y=i.slice(1),k=Ve[h];if(k==="event")o=o.slice(0,a),s="in-tag",i="";else if(k==="prop"){if(o=o.slice(0,a),u==="webjs-suspense"&&y==="fallback"){let N=await M(S,t);o+=`data-webjs-fallback="${H(N)}"`,s="in-tag",i="";continue}if(!u.includes("-")){Lt(S,y,u),_(y,u),s="in-tag",i="";continue}if(S===void 0){s="in-tag",i="";continue}try{let N=await Wt(S);o+=`data-webjs-prop-${El(y)}="${H(N)}"`}catch(N){console.warn(`[webjs] property binding .${y} has an unserializable value during SSR. Dropping. The browser will see the property as undefined. Detail: ${N&&N.message}`)}s="in-tag",i=""}else if(k==="bool")X(S,y,u),o=o.slice(0,a),S&&(o+=`${y}=""`),s="in-tag",i="";else if(ze(S,i,u)){if(E(i,u),u==="form")p=be(await Rt(S),u),o=o.slice(0,a).replace(/\s+$/,"");else{Je(m!=null,u);let N=Ze(o.slice(d));N.has("name")&&Ke(N.get("name")||"",u,!1),N.has("value")&&Ye(u),N.has("form")&&Ge(u);let j=be(await Rt(S),u);m=u,o=o.slice(0,a)+`name="${R}" value="${H(j)}"`}s="in-tag",i=""}else E(i,u),X(S,i,u),o+=`"${H(String(S??""))}"`,s="in-tag",i=""}else(s==="attr-quoted"||s==="attr-unquoted")&&(X(S,i,u),o+=H(String(S??"")))}}return o}var il=new Set(["document","window","localStorage","sessionStorage","navigator","matchMedia","requestAnimationFrame","getComputedStyle","IntersectionObserver","MutationObserver","ResizeObserver"]),al=new Set(["attachShadow","querySelector","querySelectorAll","getBoundingClientRect","focus","blur","scrollIntoView"]);function cl(e){let t=e&&typeof e.message=="string"?e.message:"",n=/^(\w+) is not defined\b/.exec(t);return e instanceof ReferenceError&&n&&il.has(n[1])?`\`${n[1]}\` is a browser-only global and is undefined during SSR.`:(n=/\.(\w+) is not a function\b/.exec(t),e instanceof TypeError&&n&&al.has(n[1])?`\`${n[1]}\` is an HTMLElement method that does not exist on the server-side component instance during SSR.`:null)}function ll(){return typeof process<"u"&&process.env&&!0}function ni(e,t,n){if(!(n===void 0?!ll():!!n))return"";let o=t&&t.message?t.message:String(t);return cr`<div data-webjs-error="${e}" style="border:1px solid #f5c2c7;background:#f8d7da;color:#842029;padding:8px 12px;border-radius:6px;font:13px/1.4 system-ui,sans-serif">
6
6
  <strong>&lt;${e}&gt; failed to render</strong>
7
7
  <div style="margin-top:4px;white-space:pre-wrap">${o}</div>
8
- </div>`}function ri(e,t){let n=t+4;if(e[n]===">")return n+1;if(e.startsWith("->",n))return n+2;for(;n<e.length;){if(e.startsWith("-->",n))return n+3;if(e.startsWith("--!>",n))return n+4;n+=1}return-1}function cl(e,t){let n=/<!--|-->|<\/script(?=[\s/>])|<script(?=[\s/>])/gi;n.lastIndex=t;let r=!1,o=!1,s;for(;(s=n.exec(e))!==null;){let i=s[0];if(i==="<!--"){let a=s.index+4;for(;e[a]==="-";)a+=1;e[a]===">"?(r=!1,o=!1,n.lastIndex=a+1):r||(r=!0)}else if(i==="-->")r=!1,o=!1;else if(i[1]==="/")if(o)o=!1;else return s.index;else r&&(o=!0)}return-1}function $n(e){let t=[],n=e.length,r=0;for(;r<n;){let o=e.indexOf("<",r);if(o===-1)break;if(e.startsWith("<!--",o)){let p=ri(e,o),m=p===-1?n:p;t.push([o,m]),r=m;continue}if(e.startsWith("<!",o)||e.startsWith("<?",o)){let p=e.indexOf(">",o),m=p===-1?n:p+1;t.push([o,m]),r=m;continue}let s=/^<\/?([a-zA-Z][^\s/>]*)/.exec(e.slice(o,o+64));if(!s){if(e.startsWith("</",o)){let p=e.indexOf(">",o),m=p===-1?n:p+1;t.push([o,m]),r=m;continue}r=o+1;continue}let i=o+1,a="",c=!1,l=!1,u=!1;for(;i<n;){let p=e[i],m=p===" "||p===" "||p===`
9
- `||p==="\r"||p==="\f";if(a)p===a&&(a="");else if(p===">"){u=!l&&e[i-1]==="/",i+=1;break}else c?m||(p==='"'||p==="'"?a=p:l=!0,c=!1):l?m&&(l=!1):p==="="&&(c=!0);i+=1}i>o+1&&t.push([o+1,i]),r=i;let f=s[1].toLowerCase();if(!(e[o+1]==="/")&&!u&&gl(f)){let p;if(f==="plaintext")p=n;else if(f==="script"){let m=cl(e,i);p=m===-1?n:m}else{let m=new RegExp(`</${f}(?=[\\s/>])`,"i").exec(e.slice(i));p=m?i+m.index:n}p>i&&t.push([i,p]),r=p}}return t}function ll(e,t){for(let[n,r]of e){if(n>t)return!1;if(t<r)return!0}return!1}function no(e){let t=0;return n=>{for(;t<e.length&&e[t][1]<=n;)t+=1;return t>=e.length?!1:n>=e[t][0]}}async function Ae(e,t,n=[],r){e=await dl(e,t,n,r);let o=Xr();if(!o.length)return e;let s=[...o].sort((p,m)=>m.length-p.length),i=new RegExp(`<(${s.map(Vt).join("|")})(?=[\\s>/])((?:"[^"]*"|'[^']*'|[^>])*?)(/?)>`,"g"),a=[],c=$n(e),l=no(c);for(let p of e.matchAll(i)){let[m,w,g,A]=p,b=Jr(w);if(!b||l(p.index))continue;t&&t.usedComponents&&t.usedComponents.add(w);let x=A?`<${w}${g}>`:m,_=null;try{let E=b.shadow===!0;_=new b,_.__ssrTag=w,_.__ssrAncestors=n;let T=ei(g),C=vl(T),v=new Set(Object.keys(ei(g)).map(j=>j.toLowerCase()));yl(_,T),_l(_,T,b);for(let[j,I]of Object.entries(C))_[j]=I;let S="",h=p.index+m.length;if(!A){let j=p.index+m.length,I=zt(e,j,w,c);if(I!==-1){S=e.slice(j,I);let Ct=new RegExp(`</${Vt(w)}\\s*>`,"i"),ar=e.slice(I),Ko=Ct.exec(ar),ca=Ko?Ko[0].length:`</${w}>`.length;h=I+ca}else S=e.slice(j),h=e.length}let y=hl(S);typeof _.performServerUpdate=="function"&&_.performServerUpdate();let k=_.render?_.render():"";k&&typeof k.then=="function"&&(k=await k),x=wl(x,_,v),E||(x=ti(x));let N=await M(k,t,"unknown");if(E){let j=await Ae(N,t,[...n,_],r),I=b.styles,Ct=Array.isArray(I)?I:I&&We(I)?[I]:[],ar=rn(Ct);a.push({start:p.index,end:p.index+m.length,text:`${x}<template shadowrootmode="open">${ar}${j}</template>`})}else{if(N.trim()===""){a.push({start:p.index,end:p.index+m.length,text:`${x}<!--webjs-hydrate-->`});continue}let I=ml(N,y,w),Ct=await Ae(I,t,[...n,_],r);a.push({start:p.index,end:h,text:`${x}<!--webjs-hydrate-->${Ct}</${w}>`})}}catch(E){let T=il(E);console.error(T?`[webjs] SSR failed for <${w}>: ${T} It was touched in the component's constructor or render(), which run during SSR. Move browser-only work to connectedCallback() or a lifecycle hook (firstUpdated/updated), which SSR never calls; seed first-paint defaults in the constructor only from server-known inputs (attributes / props).`:`[webjs] SSR failed for <${w}>:`,E);let C=E instanceof Error?E:new Error(String(E)),v="";try{let k;_&&typeof _.renderError=="function"&&(k=_.renderError(C)),k===void 0&&(k=ni(w,C,r)),v=await M(k,t),v.trim()&&(v=await Ae(v,t,_?[...n,_]:n,r))}catch(k){console.error(`[webjs] renderError() for <${w}> also threw:`,k),v=""}let S=p.index+m.length;if(!A){let k=p.index+m.length,N=zt(e,k,w,c);if(N!==-1){let I=new RegExp(`</${Vt(w)}\\s*>`,"i").exec(e.slice(N));S=N+(I?I[0].length:`</${w}>`.length)}else S=e.length}let h=b.shadow===!0;h||(x=ti(x));let y;if(h){let k=b.styles,N=Array.isArray(k)?k:k&&We(k)?[k]:[],j=rn(N);y=`${x}<template shadowrootmode="open">${j}${v}</template>`}else y=`${x}<!--webjs-hydrate-->${v}</${w}>`;a.push({start:p.index,end:S,text:y})}}if(!a.length)return e;a.sort((p,m)=>p.start-m.start);let u=[],f=-1;for(let p of a)p.start>=f&&(u.push(p),f=p.end);let d=e;for(let p=u.length-1;p>=0;p--){let{start:m,end:w,text:g}=u[p];d=d.slice(0,m)+g+d.slice(w)}return d}var ul=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function fl(e){return ul.has(e.toLowerCase())}async function dl(e,t,n=[],r){if(e.indexOf("<webjs-suspense")===-1)return e;let o=/<webjs-suspense((?:"[^"]*"|'[^']*'|[^>])*?)>/i,s=$n(e),i=no(s),a=0,c="",l=e;for(let u=0;u<1e4;u++){let f=o.exec(l);if(!f){c+=l;break}if(i(a+f.index)){let E=f.index+f[0].length;c+=l.slice(0,E),l=l.slice(E),a+=E;continue}let d=f.index,p=f.index+f[0].length;c+=l.slice(0,d);let m=f[1]||"",w=/data-webjs-fallback="([^"]*)"/i.exec(m),g=w?In(w[1]):"",A=[];for(let[E,T]of s)T<=a||A.push([Math.max(0,E-a),T-a]);let b=zt(l,p,"webjs-suspense",A),x,_;if(b===-1)x=l.slice(p),_="";else{x=l.slice(p,b);let E=/<\/webjs-suspense\s*>/i.exec(l.slice(b));_=l.slice(b+(E?E[0].length:17))}if(t){let E=`s${t.nextId++}`;t.pending.push({id:E,promise:Promise.resolve(gr(x))}),c+=`<webjs-suspense id="${E}">${g}</webjs-suspense>`}else{let E=await Ae(x,t,n,r);c+=`<webjs-suspense>${E}</webjs-suspense>`}a+=l.length-_.length,l=_}return c}function zt(e,t,n,r){let o=Vt(n),s=new RegExp(`<${o}(?:[\\s>/])`,"gi"),i=new RegExp(`</${o}\\s*>`,"gi"),a=r===void 0?$n(e):r,c=u=>{let f;for(;(f=u.exec(e))!==null;)if(a.length===0||!ll(a,f.index))return f;return null};s.lastIndex=t,i.lastIndex=t;let l=1;for(;l>0;){let u=c(s),f=c(i);if(!f)return-1;if(u&&u.index<f.index)l++,i.lastIndex=u.index+1;else{if(l--,l===0)return f.index;s.lastIndex=f.index+1}}return-1}function pl(e){let t=/\bslot\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(e);if(!t)return null;let n=t[1]??t[2]??t[3]??"";return n===""||n==="default"?null:n}function hl(e){let t=new Map,n="",r=0;for(;r<e.length;){let o=e.indexOf("<",r);if(o===-1){n+=e.slice(r);break}o>r&&(n+=e.slice(r,o));let s=e.slice(o);if(s.startsWith("<!--")){let g=ri(e,o);if(g===-1){n+=s,r=e.length;break}n+=e.slice(o,g),r=g;continue}if(s.startsWith("<!")||s.startsWith("</")){let g=e.indexOf(">",o);if(g===-1){n+=s,r=e.length;break}n+=e.slice(o,g+1),r=g+1;continue}let i=/^<([a-zA-Z][\w-]*)((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/.exec(s);if(!i){n+="<",r=o+1;continue}let[a,c,l,u]=i,f=c.toLowerCase(),d=!!u||fl(f),p=pl(l),m;if(d)m=o+a.length;else{let g=o+a.length,A=zt(e,g,f);if(A===-1){let T=e.slice(o);p!==null?Qs(t,p,T):n+=T,r=e.length;continue}let b=new RegExp(`</${Vt(f)}\\s*>`,"i"),x=e.slice(A),_=b.exec(x),E=_?_[0].length:`</${f}>`.length;m=A+E}let w=e.slice(o,m);p!==null?Qs(t,p,w):n+=w,r=m}return n.length>0&&t.set(null,n),t}function Qs(e,t,n){let r=e.get(t);r!==void 0?e.set(t,r+n):e.set(t,n)}function ml(e,t,n){let r=n?` data-wj-slot-owner="${H(n)}"`:"",o=new Set,s="",i=0,a=/<slot((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/gi,c=$n(e),l=no(c),u;for(;(u=a.exec(e))!==null;){if(l(u.index))continue;s+=e.slice(i,u.index);let[f,d,p]=u,m=!!p,w=/\bname\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(d),g=w?w[1]??w[2]??w[3]:null,A=d.replace(/\bname\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,"").trim(),b="",x;if(m)x=u.index+f.length;else{let v=u.index+f.length,S=zt(e,v,"slot",c);if(S===-1)b=e.slice(v),x=e.length;else{b=e.slice(v,S);let h=/<\/slot\s*>/i,y=e.slice(S),k=h.exec(y),N=k?k[0].length:7;x=S+N}}let _=g==="default"||g===""?null:g,E=t.get(_),T=g!==null?` name="${H(g)}"`:"",C=A?` ${A}`:"";E!==void 0&&!o.has(_)?(o.add(_),s+=`<slot data-webjs-light data-projection="actual"${r}${T}${C}>${E}</slot>`):s+=`<slot data-webjs-light data-projection="fallback"${r}${T}${C}>${b}</slot>`,i=x,a.lastIndex=x}return s+=e.slice(i),s}function Vt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ro(e){return e==="script"||e==="style"}function bl(e){return e==="textarea"||e==="title"}function gl(e){return ro(e)||bl(e)||e==="iframe"||e==="xmp"||e==="noembed"||e==="noframes"||e==="plaintext"}function ei(e){let t={},n=/([a-zA-Z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g,r;for(;(r=n.exec(e))!==null;)t[r[1]]=r[2]??r[3]??r[4]??"";return t}function yl(e,t){if(!(!e||typeof e.setAttribute!="function"))for(let[n,r]of Object.entries(t))e.setAttribute(n,In(r))}function ti(e){return/\sdata-wj-host(?=[\s>=])/i.test(e)?e:`${e.slice(0,-1)} data-wj-host>`}function wl(e,t,n){if(!t||typeof t.getAttributeNames!="function")return e;let r="";for(let o of t.getAttributeNames()){let s=String(o).toLowerCase();if(n.has(s))continue;let i=t.getAttribute(o);r+=i===""?` ${s}`:` ${s}="${H(String(i))}"`}return r?`${e.slice(0,-1)}${r}>`:e}function _l(e,t,n){let r=n.properties||{};for(let[o,s]of Object.entries(t)){let i,a;for(let[l,u]of Object.entries(r))if(((typeof u=="object"?u:{type:u}).attribute||Sl(l))===o){i=l,a=u;break}if(a===void 0&&(a=r[o]||r[to(o)],i=r[o]?o:to(o)),!a){e[i]=s;continue}let c=typeof a=="object"?a:{type:a};if(c.type===Number)e[i]=Number(s);else if(c.type===Boolean)e[i]=s!=="false";else if(c.type===Object||c.type===Array)try{e[i]=JSON.parse(In(s))}catch{e[i]=s}else e[i]=s}}function to(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Sl(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Al(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function In(e){return e.replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function vl(e){let t={};for(let n of Object.keys(e)){if(!n.startsWith("data-webjs-prop-"))continue;let r=to(n.slice(16));try{t[r]=de(In(e[n]))}catch{}delete e[n]}return t}function El(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;return n&&n.dev===void 0&&r!==void 0&&(n.dev=r),new ReadableStream({async start(o){try{if(t&&t.ssr===!1)await Y(e,n,o,"none");else{let s=await M(e,n),i=await Ae(s,n,[],r);o.enqueue(i)}n&&n.pending.length&&await Cl(n,o,r),o.close()}catch(s){o.error(s)}}})}async function Y(e,t,n){if(!(e==null||e===!1||e===!0)){if(e&&typeof e.then=="function")return e=await e,Y(e,t,n);if(et(e)){n.enqueue(String(e.value??""));return}if(Ne(e))return Y(e.value,t,n);if($e(e))return Y(e.signal.get(),t,n);if(Te(e))return Y(e.value,t,n);if(je(e))return Y(e.fn(),t,n);if(tt(e)){let r=e.template;n.enqueue(String(r?.innerHTML??""));return}if(!Re(e)){if(Le(e))return Y(e.value,t,n);if(Oe(e)){let r=e.args;for(let o of r)if(!o||typeof o.then!="function")return Y(o,t,n);if(r.length>0)try{let o=await Promise.race(r.map(s=>Promise.resolve(s).catch(()=>{})));return Y(o,t,n)}catch{return}return}if(!(nt(e)||rt(e))){if(Array.isArray(e)){for(let r of e)await Y(r,t,n);return}if(ke(e)){let r=e;for(let o=0;o<r.items.length;o++)await Y(r.templateFn(r.items[o],o),t,n);return}if(On(e)){let r=e;if(t){let o=`s${t.nextId++}`;n.enqueue(`<webjs-boundary id="${o}">`),await Y(r.fallback,t,n),n.enqueue("</webjs-boundary>"),t.pending.push({id:o,promise:Promise.resolve(r.children)})}else await Y(r.fallback,t,n);return}if(B(e)){await xl(e,t,n);return}n.enqueue(sn(String(e)))}}}}async function xl(e,t,n){let{strings:r,values:o}=e,s="text",i="",a=0,c="",l=0,u="",f="",d="",p=-1,m=null,w=0,g=[],A=[],b=null,x=!1,_=()=>{let v=g,S=A,h=w>1,y=b;if(g=[],A=[],w=0,b=null,m!=null){Lt({duplicateAction:h,propAttrs:v});let k=hr(d.slice(p),m);d=d.slice(0,p)+k.tag+k.hidden,m=null}y!=null&&(d=d.slice(0,p)+br(d.slice(p),y,{duplicateAction:h,propAttrs:S}))},E=(v,S)=>{let h=String(S).toLowerCase();if(h==="button"||h==="input"){Xe(v)&&A.push(String(v));return}if(h!=="form")return;let y=String(v).toLowerCase();y==="encoding"&&(y="enctype"),(y==="method"||y==="enctype")&&g.push(String(v))},T=(v,S)=>{let h=String(S).toLowerCase(),y=String(v).toLowerCase();(h==="form"&&y==="action"||(h==="button"||h==="input")&&y==="formaction")&&(w+=1)},C=v=>{_(),x=!1,s=v&&ro(u)?"rawtext":"text",s==="rawtext"&&(f="")};for(let v=0;v<r.length;v++){let S=r[v];for(let h=0;h<S.length;h++){let y=S[h];switch(s){case"text":d+=y,y==="<"&&(s="tag-open",p=d.length-1,x=!1);break;case"tag-open":d+=y,y==="!"?s="bang-1":y==="/"?(s="tag-name",u="",x=!0):/[a-zA-Z]/.test(y)?(s="tag-name",u=y.toLowerCase()):s="text";break;case"bang-1":d+=y,s=y==="-"?"bang-dash":"tag-name";break;case"bang-dash":d+=y,y==="-"?(s="comment",l=0):s="tag-name";break;case"comment":d+=y,y==="-"?l+=1:(y===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":d+=y,y===">"?C(!0):/\s/.test(y)?s="in-tag":u+=y.toLowerCase();break;case"in-tag":d+=y,y===">"?C(!0):!/\s/.test(y)&&y!=="/"&&(s="attr-name",i=y,a=d.length-1);break;case"rawtext":d+=y,f=(f+y.toLowerCase()).slice(-9),(f.endsWith("<\/script>")||f.endsWith("</style>"))&&(s="text",f="",u="");break;case"attr-name":y==="="?(s="after-eq",d+=y):/\s/.test(y)?(s="in-tag",i="",d+=y):y===">"?(s="text",i="",d+=y,C(!1)):(i+=y,d+=y);break;case"after-eq":y==='"'||y==="'"?(s="attr-quoted",c=y,d+=y):/\s/.test(y)?(s="in-tag",i="",d+=y):y===">"?(s="text",i="",d+=y,C(!1)):(s="attr-unquoted",d+=y);break;case"attr-unquoted":/\s/.test(y)?(s="in-tag",i="",d+=y):y===">"?(s="text",i="",d+=y,C(!1)):d+=y;break;case"attr-quoted":d+=y,y===c&&(s="in-tag",i="");break}}if(v<o.length){let h=o[v];if(h&&typeof h.then=="function"&&(h=await h),s==="comment")d+=String(h??""),l=0;else if(s==="rawtext")d+=String(h??""),f="";else if(s==="text")d&&(n.enqueue(d),d=""),await Y(h,t,n);else if(s==="after-eq"){let y=i[0],k=i.slice(1),N=Ve[y];if(N==="event"||N==="prop")N==="prop"&&!u.includes("-")&&(Rt(h,k,u),E(k,u)),d=d.slice(0,a),s="in-tag",i="";else if(N==="bool")X(h,k,u),d=d.slice(0,a),h&&(d+=`${k}=""`),s="in-tag",i="";else if(ze(h,i,u)){if(T(i,u),u==="form")m=be(await jt(h),u),d=d.slice(0,a).replace(/\s+$/,"");else{Je(b!=null,u);let j=Ze(d.slice(p));j.has("name")&&Ke(j.get("name")||"",u,!1),j.has("value")&&Ye(u),j.has("form")&&Ge(u);let I=be(await jt(h),u);b=u,d=d.slice(0,a)+`name="${R}" value="${H(I)}"`}s="in-tag",i=""}else T(i,u),X(h,i,u),d+=`"${H(String(h??""))}"`,s="in-tag",i=""}else(s==="attr-quoted"||s==="attr-unquoted")&&(X(h,i,u),d+=H(String(h??"")))}}d&&n.enqueue(d)}async function Cl(e,t,n){let r=eo(),o=r?` nonce="${H(r)}"`:"";for(;e.pending.length;){let s=e.pending.splice(0);await Promise.all(s.map(async({id:i,promise:a})=>{try{let c=await a,l=await M(c,e),u=await Ae(l,e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${u}</template><script${o}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(c){console.error(`[webjs] Suspense boundary "${i}" rejected:`,c);try{let l=c instanceof Error?c:new Error(String(c)),u=await Ae(await M(ni("webjs-suspense",l,n),e),e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${u}</template><script${o}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(l){console.error(`[webjs] Suspense boundary "${i}" error render also threw:`,l)}}}))}}Nt();var oi=Symbol.for("webjs.notFound"),si=Symbol.for("webjs.redirect"),ii=Symbol.for("webjs.forbidden"),ai=Symbol.for("webjs.unauthorized");function kl(){let e=new Error("webjs: notFound()");throw e.__webjs=oi,e}function Nl(){let e=new Error("webjs: forbidden()");throw e.__webjs=ii,e}function Tl(){let e=new Error("webjs: unauthorized()");throw e.__webjs=ai,e}function jl(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=si,r.url=e,r.status=typeof n=="number"?n:void 0,r}function Rl(e){return!!e&&e.__webjs===oi}function Ll(e){return!!e&&e.__webjs===si}function Ol(e){return!!e&&e.__webjs===ii}function $l(e){return!!e&&e.__webjs===ai}var oo=null;function Il(e){oo=e}function Pl(e){if(typeof e!="string"||!e||!oo)return e;try{return oo(e)||e}catch{return e}}Qe();function Ml(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,s=null,i=[];function a(){o||(s=new WebSocket(Fl(e),t.protocols),s.onopen=c=>{for(r=0;i.length&&s&&s.readyState===WebSocket.OPEN;)s.send(i.shift());t.onOpen?.(c)},s.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},s.onerror=c=>{t.onError?.(c)},s.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);s&&s.readyState===WebSocket.OPEN?s.send(l):i.push(l)},close(c,l){o=!0;try{s?.close(c,l)}catch{}},get socket(){return s},get readyState(){return s?.readyState??3}}}function Fl(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}`}pt();var so="application/vnd.webjs+json";async function Dl(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",so);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 Wt(r),n.has("content-type")||n.set("content-type",so));let o=await fetch(e,{...t,headers:n,body:r}),s=o.headers.get("content-type")||"",i=await o.text(),a=s.includes(so)?i?de(i):null:s.includes("application/json")?i?JSON.parse(i):null:i;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}pt();lo();co();Mn();var Uo=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 s=this.updates.findIndex(i=>i.id===r);s!==-1&&(this.updates.splice(s,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 Yu(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(s){throw e.set(r),s}return o&&o.success===!1&&e.set(r),o}function Gu(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Yu(e,t,n):new Uo(e,t)}bo();wo();var Ju="application/vnd.webjs+stream",Xu=1,Zu=2,Qu=3,aa=new Uint8Array(0);function ef(e,t){let n=t||aa,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 tf(){let e=aa;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 s=e.slice(5,5+o);n.push({type:r,payload:s}),e=e.slice(5+o)}return n}}}var nf=Symbol.for("webjs.context");function rf(e){return{__context__:nf,name:e}}var ir=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},Wo=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let s=o;if(s.context===this._context)if(o.stopPropagation(),s.subscribe){let i={callback:s.callback},a=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),s.callback(this._value,a)}else s.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()}},Vo=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 ir(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 of(){return typeof window<"u"}var me={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},zo=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=me.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=me.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=me.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=me.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 me.INITIAL:return t.initial?.();case me.PENDING:return t.pending?.();case me.COMPLETE:return t.complete?.(this._value);case me.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!of())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{Vo as ContextConsumer,Wo as ContextProvider,ir as ContextRequestEvent,R as FORM_ACTION_FIELD,Jo as FORM_ACTION_ID_KEY,Xu as FRAME_CHUNK,Zu as FRAME_END,Qu as FRAME_ERROR,F as MARKER,bi as SEED_MISS,Ju as STREAM_CONTENT_TYPE,It as Signal,el as Suspense,zo as Task,me as TaskStatus,Ln as WebComponent,ao as WebjsFrame,uo as WebjsStream,Lc as activeActionSignal,lr as adoptStyles,Xr as allTags,Pl as asset,ja as asyncAppend,Ra as asyncReplace,qa as batch,Na as cache,Ua as computed,Ml as connectWS,tu as consumeStale,rf as createContext,tf as createFrameDecoder,ka as createRef,eo as cspNonce,ua as css,zs as deserialize,Ci as disableClientRouter,Va as effect,jo as enableClientRouter,ef as encodeFrame,H as escapeAttr,sn as escapeText,Ql as fetchMark,Nl as forbidden,Ea as guard,cr as html,nt as isAsyncAppend,rt as isAsyncReplace,We as isCSS,Le as isCache,Ol as isForbidden,je as isGuard,Te as isKeyed,Ic as isLazy,Ne as isLive,Rl as isNotFound,Ll as isRedirect,Re as isRef,ke as isRepeat,Wa as isSignal,On as isSuspense,B as isTemplate,tt as isTemplateContent,$l as isUnauthorized,et as isUnsafeHTML,Oe as isUntil,$e as isWatch,va as keyed,Aa as live,Jr as lookup,$c as lookupModuleUrl,go as markStale,ki as navigate,kl as notFound,Gu as optimistic,de as parse,yo as parseTagHeader,Oc as primeModuleUrl,Qc as prop,jl as redirect,Ca as ref,Gr as register,eu as registerKeyTags,dt as render,fo as renderStream,El as renderToStream,nl as renderToString,rs as repeat,Ni as revalidate,Dl as richFetch,Fn as scanSeeds,Xl as seedStats,Vs as serialize,Nn as setActiveActionSignal,Il as setAssetUrlProvider,tl as setCspNonceProvider,fa as setFormActionResolver,Ha as signal,Wt as stringify,rn as stylesToString,qt as tagOf,Jl as takeSeed,xa as templateContent,Tl as unauthorized,gr as unsafeHTML,Ta as until,La as watch};
8
+ </div>`}function ri(e,t){let n=t+4;if(e[n]===">")return n+1;if(e.startsWith("->",n))return n+2;for(;n<e.length;){if(e.startsWith("-->",n))return n+3;if(e.startsWith("--!>",n))return n+4;n+=1}return-1}function ul(e,t){let n=/<!--|-->|<\/script(?=[\s/>])|<script(?=[\s/>])/gi;n.lastIndex=t;let r=!1,o=!1,s;for(;(s=n.exec(e))!==null;){let i=s[0];if(i==="<!--"){let a=s.index+4;for(;e[a]==="-";)a+=1;e[a]===">"?(r=!1,o=!1,n.lastIndex=a+1):r||(r=!0)}else if(i==="-->")r=!1,o=!1;else if(i[1]==="/")if(o)o=!1;else return s.index;else r&&(o=!0)}return-1}function $n(e){let t=[],n=e.length,r=0;for(;r<n;){let o=e.indexOf("<",r);if(o===-1)break;if(e.startsWith("<!--",o)){let p=ri(e,o),m=p===-1?n:p;t.push([o,m]),r=m;continue}if(e.startsWith("<!",o)||e.startsWith("<?",o)){let p=e.indexOf(">",o),m=p===-1?n:p+1;t.push([o,m]),r=m;continue}let s=/^<\/?([a-zA-Z][^\s/>]*)/.exec(e.slice(o,o+64));if(!s){if(e.startsWith("</",o)){let p=e.indexOf(">",o),m=p===-1?n:p+1;t.push([o,m]),r=m;continue}r=o+1;continue}let i=o+1,a="",c=!1,l=!1,u=!1;for(;i<n;){let p=e[i],m=p===" "||p===" "||p===`
9
+ `||p==="\r"||p==="\f";if(a)p===a&&(a="");else if(p===">"){u=!l&&e[i-1]==="/",i+=1;break}else c?m||(p==='"'||p==="'"?a=p:l=!0,c=!1):l?m&&(l=!1):p==="="&&(c=!0);i+=1}i>o+1&&t.push([o+1,i]),r=i;let f=s[1].toLowerCase();if(!(e[o+1]==="/")&&!u&&wl(f)){let p;if(f==="plaintext")p=n;else if(f==="script"){let m=ul(e,i);p=m===-1?n:m}else{let m=new RegExp(`</${f}(?=[\\s/>])`,"i").exec(e.slice(i));p=m?i+m.index:n}p>i&&t.push([i,p]),r=p}}return t}function fl(e,t){for(let[n,r]of e){if(n>t)return!1;if(t<r)return!0}return!1}function no(e){let t=0;return n=>{for(;t<e.length&&e[t][1]<=n;)t+=1;return t>=e.length?!1:n>=e[t][0]}}async function Ae(e,t,n=[],r){e=await hl(e,t,n,r);let o=Xr();if(!o.length)return e;let s=[...o].sort((p,m)=>m.length-p.length),i=new RegExp(`<(${s.map(Vt).join("|")})(?=[\\s>/])((?:"[^"]*"|'[^']*'|[^>])*?)(/?)>`,"g"),a=[],c=$n(e),l=no(c);for(let p of e.matchAll(i)){let[m,w,g,A]=p,b=Jr(w);if(!b||l(p.index))continue;t&&t.usedComponents&&t.usedComponents.add(w);let x=A?`<${w}${g}>`:m,_=null;try{let E=b.shadow===!0;_=new b,_.__ssrTag=w,_.__ssrAncestors=n;let T=ei(g),C=xl(T),v=new Set(Object.keys(ei(g)).map(j=>j.toLowerCase()));_l(_,T),Al(_,T,b);for(let[j,I]of Object.entries(C))_[j]=I;let S="",h=p.index+m.length;if(!A){let j=p.index+m.length,I=zt(e,j,w,c);if(I!==-1){S=e.slice(j,I);let kt=new RegExp(`</${Vt(w)}\\s*>`,"i"),ar=e.slice(I),Ko=kt.exec(ar),la=Ko?Ko[0].length:`</${w}>`.length;h=I+la}else S=e.slice(j),h=e.length}let y=bl(S);typeof _.performServerUpdate=="function"&&_.performServerUpdate();let k=_.render?_.render():"";k&&typeof k.then=="function"&&(k=await k),x=Sl(x,_,v),E||(x=ti(x));let N=await M(k,t,"unknown");if(E){let j=await Ae(N,t,[...n,_],r),I=b.styles,kt=Array.isArray(I)?I:I&&We(I)?[I]:[],ar=rn(kt);a.push({start:p.index,end:p.index+m.length,text:`${x}<template shadowrootmode="open">${ar}${j}</template>`})}else{if(N.trim()===""){a.push({start:p.index,end:p.index+m.length,text:`${x}<!--webjs-hydrate-->`});continue}let I=gl(N,y,w),kt=await Ae(I,t,[...n,_],r);a.push({start:p.index,end:h,text:`${x}<!--webjs-hydrate-->${kt}</${w}>`})}}catch(E){let T=cl(E);console.error(T?`[webjs] SSR failed for <${w}>: ${T} It was touched in the component's constructor or render(), which run during SSR. Move browser-only work to connectedCallback() or a lifecycle hook (firstUpdated/updated), which SSR never calls; seed first-paint defaults in the constructor only from server-known inputs (attributes / props).`:`[webjs] SSR failed for <${w}>:`,E);let C=E instanceof Error?E:new Error(String(E)),v="";try{let k;_&&typeof _.renderError=="function"&&(k=_.renderError(C)),k===void 0&&(k=ni(w,C,r)),v=await M(k,t),v.trim()&&(v=await Ae(v,t,_?[...n,_]:n,r))}catch(k){console.error(`[webjs] renderError() for <${w}> also threw:`,k),v=""}let S=p.index+m.length;if(!A){let k=p.index+m.length,N=zt(e,k,w,c);if(N!==-1){let I=new RegExp(`</${Vt(w)}\\s*>`,"i").exec(e.slice(N));S=N+(I?I[0].length:`</${w}>`.length)}else S=e.length}let h=b.shadow===!0;h||(x=ti(x));let y;if(h){let k=b.styles,N=Array.isArray(k)?k:k&&We(k)?[k]:[],j=rn(N);y=`${x}<template shadowrootmode="open">${j}${v}</template>`}else y=`${x}<!--webjs-hydrate-->${v}</${w}>`;a.push({start:p.index,end:S,text:y})}}if(!a.length)return e;a.sort((p,m)=>p.start-m.start);let u=[],f=-1;for(let p of a)p.start>=f&&(u.push(p),f=p.end);let d=e;for(let p=u.length-1;p>=0;p--){let{start:m,end:w,text:g}=u[p];d=d.slice(0,m)+g+d.slice(w)}return d}var dl=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function pl(e){return dl.has(e.toLowerCase())}async function hl(e,t,n=[],r){if(e.indexOf("<webjs-suspense")===-1)return e;let o=/<webjs-suspense((?:"[^"]*"|'[^']*'|[^>])*?)>/i,s=$n(e),i=no(s),a=0,c="",l=e;for(let u=0;u<1e4;u++){let f=o.exec(l);if(!f){c+=l;break}if(i(a+f.index)){let E=f.index+f[0].length;c+=l.slice(0,E),l=l.slice(E),a+=E;continue}let d=f.index,p=f.index+f[0].length;c+=l.slice(0,d);let m=f[1]||"",w=/data-webjs-fallback="([^"]*)"/i.exec(m),g=w?In(w[1]):"",A=[];for(let[E,T]of s)T<=a||A.push([Math.max(0,E-a),T-a]);let b=zt(l,p,"webjs-suspense",A),x,_;if(b===-1)x=l.slice(p),_="";else{x=l.slice(p,b);let E=/<\/webjs-suspense\s*>/i.exec(l.slice(b));_=l.slice(b+(E?E[0].length:17))}if(t){let E=`s${t.nextId++}`;t.pending.push({id:E,promise:Promise.resolve(gr(x))}),c+=`<webjs-suspense id="${E}">${g}</webjs-suspense>`}else{let E=await Ae(x,t,n,r);c+=`<webjs-suspense>${E}</webjs-suspense>`}a+=l.length-_.length,l=_}return c}function zt(e,t,n,r){let o=Vt(n),s=new RegExp(`<${o}(?:[\\s>/])`,"gi"),i=new RegExp(`</${o}\\s*>`,"gi"),a=r===void 0?$n(e):r,c=u=>{let f;for(;(f=u.exec(e))!==null;)if(a.length===0||!fl(a,f.index))return f;return null};s.lastIndex=t,i.lastIndex=t;let l=1;for(;l>0;){let u=c(s),f=c(i);if(!f)return-1;if(u&&u.index<f.index)l++,i.lastIndex=u.index+1;else{if(l--,l===0)return f.index;s.lastIndex=f.index+1}}return-1}function ml(e){let t=/\bslot\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(e);if(!t)return null;let n=t[1]??t[2]??t[3]??"";return n===""||n==="default"?null:n}function bl(e){let t=new Map,n="",r=0;for(;r<e.length;){let o=e.indexOf("<",r);if(o===-1){n+=e.slice(r);break}o>r&&(n+=e.slice(r,o));let s=e.slice(o);if(s.startsWith("<!--")){let g=ri(e,o);if(g===-1){n+=s,r=e.length;break}n+=e.slice(o,g),r=g;continue}if(s.startsWith("<!")||s.startsWith("</")){let g=e.indexOf(">",o);if(g===-1){n+=s,r=e.length;break}n+=e.slice(o,g+1),r=g+1;continue}let i=/^<([a-zA-Z][\w-]*)((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/.exec(s);if(!i){n+="<",r=o+1;continue}let[a,c,l,u]=i,f=c.toLowerCase(),d=!!u||pl(f),p=ml(l),m;if(d)m=o+a.length;else{let g=o+a.length,A=zt(e,g,f);if(A===-1){let T=e.slice(o);p!==null?Qs(t,p,T):n+=T,r=e.length;continue}let b=new RegExp(`</${Vt(f)}\\s*>`,"i"),x=e.slice(A),_=b.exec(x),E=_?_[0].length:`</${f}>`.length;m=A+E}let w=e.slice(o,m);p!==null?Qs(t,p,w):n+=w,r=m}return n.length>0&&t.set(null,n),t}function Qs(e,t,n){let r=e.get(t);r!==void 0?e.set(t,r+n):e.set(t,n)}function gl(e,t,n){let r=n?` data-wj-slot-owner="${H(n)}"`:"",o=new Set,s="",i=0,a=/<slot((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/gi,c=$n(e),l=no(c),u;for(;(u=a.exec(e))!==null;){if(l(u.index))continue;s+=e.slice(i,u.index);let[f,d,p]=u,m=!!p,w=/\bname\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(d),g=w?w[1]??w[2]??w[3]:null,A=d.replace(/\bname\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,"").trim(),b="",x;if(m)x=u.index+f.length;else{let v=u.index+f.length,S=zt(e,v,"slot",c);if(S===-1)b=e.slice(v),x=e.length;else{b=e.slice(v,S);let h=/<\/slot\s*>/i,y=e.slice(S),k=h.exec(y),N=k?k[0].length:7;x=S+N}}let _=g==="default"||g===""?null:g,E=t.get(_),T=g!==null?` name="${H(g)}"`:"",C=A?` ${A}`:"";E!==void 0&&!o.has(_)?(o.add(_),s+=`<slot data-webjs-light data-projection="actual"${r}${T}${C}>${E}</slot>`):s+=`<slot data-webjs-light data-projection="fallback"${r}${T}${C}>${b}</slot>`,i=x,a.lastIndex=x}return s+=e.slice(i),s}function Vt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ro(e){return e==="script"||e==="style"}function yl(e){return e==="textarea"||e==="title"}function wl(e){return ro(e)||yl(e)||e==="iframe"||e==="xmp"||e==="noembed"||e==="noframes"||e==="plaintext"}function ei(e){let t={},n=/([a-zA-Z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g,r;for(;(r=n.exec(e))!==null;)t[r[1]]=r[2]??r[3]??r[4]??"";return t}function _l(e,t){if(!(!e||typeof e.setAttribute!="function"))for(let[n,r]of Object.entries(t))e.setAttribute(n,In(r))}function ti(e){return/\sdata-wj-host(?=[\s>=])/i.test(e)?e:`${e.slice(0,-1)} data-wj-host>`}function Sl(e,t,n){if(!t||typeof t.getAttributeNames!="function")return e;let r="";for(let o of t.getAttributeNames()){let s=String(o).toLowerCase();if(n.has(s))continue;let i=t.getAttribute(o);r+=i===""?` ${s}`:` ${s}="${H(String(i))}"`}return r?`${e.slice(0,-1)}${r}>`:e}function Al(e,t,n){let r=n.properties||{};for(let[o,s]of Object.entries(t)){let i,a;for(let[l,u]of Object.entries(r))if(((typeof u=="object"?u:{type:u}).attribute||vl(l))===o){i=l,a=u;break}if(a===void 0&&(a=r[o]||r[to(o)],i=r[o]?o:to(o)),!a){e[i]=s;continue}let c=typeof a=="object"?a:{type:a};if(c.type===Number)e[i]=Number(s);else if(c.type===Boolean)e[i]=s!=="false";else if(c.type===Object||c.type===Array)try{e[i]=JSON.parse(In(s))}catch{e[i]=null}else e[i]=s}}function to(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function vl(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function El(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function In(e){return e.replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function xl(e){let t={};for(let n of Object.keys(e)){if(!n.startsWith("data-webjs-prop-"))continue;let r=to(n.slice(16));try{t[r]=de(In(e[n]))}catch{}delete e[n]}return t}function Cl(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;return n&&n.dev===void 0&&r!==void 0&&(n.dev=r),new ReadableStream({async start(o){try{if(t&&t.ssr===!1)await Y(e,n,o,"none");else{let s=await M(e,n),i=await Ae(s,n,[],r);o.enqueue(i)}n&&n.pending.length&&await Nl(n,o,r),o.close()}catch(s){o.error(s)}}})}async function Y(e,t,n){if(!(e==null||e===!1||e===!0)){if(e&&typeof e.then=="function")return e=await e,Y(e,t,n);if(et(e)){n.enqueue(String(e.value??""));return}if(Ne(e))return Y(e.value,t,n);if($e(e))return Y(e.signal.get(),t,n);if(Te(e))return Y(e.value,t,n);if(je(e))return Y(e.fn(),t,n);if(tt(e)){let r=e.template;n.enqueue(String(r?.innerHTML??""));return}if(!Re(e)){if(Le(e))return Y(e.value,t,n);if(Oe(e)){let r=e.args;for(let o of r)if(!o||typeof o.then!="function")return Y(o,t,n);if(r.length>0)try{let o=await Promise.race(r.map(s=>Promise.resolve(s).catch(()=>{})));return Y(o,t,n)}catch{return}return}if(!(nt(e)||rt(e))){if(Array.isArray(e)){for(let r of e)await Y(r,t,n);return}if(ke(e)){let r=e;for(let o=0;o<r.items.length;o++)await Y(r.templateFn(r.items[o],o),t,n);return}if(On(e)){let r=e;if(t){let o=`s${t.nextId++}`;n.enqueue(`<webjs-boundary id="${o}">`),await Y(r.fallback,t,n),n.enqueue("</webjs-boundary>"),t.pending.push({id:o,promise:Promise.resolve(r.children)})}else await Y(r.fallback,t,n);return}if(B(e)){await kl(e,t,n);return}n.enqueue(sn(String(e)))}}}}async function kl(e,t,n){let{strings:r,values:o}=e,s="text",i="",a=0,c="",l=0,u="",f="",d="",p=-1,m=null,w=0,g=[],A=[],b=null,x=!1,_=()=>{let v=g,S=A,h=w>1,y=b;if(g=[],A=[],w=0,b=null,m!=null){Ot({duplicateAction:h,propAttrs:v});let k=hr(d.slice(p),m);d=d.slice(0,p)+k.tag+k.hidden,m=null}y!=null&&(d=d.slice(0,p)+br(d.slice(p),y,{duplicateAction:h,propAttrs:S}))},E=(v,S)=>{let h=String(S).toLowerCase();if(h==="button"||h==="input"){Xe(v)&&A.push(String(v));return}if(h!=="form")return;let y=String(v).toLowerCase();y==="encoding"&&(y="enctype"),(y==="method"||y==="enctype")&&g.push(String(v))},T=(v,S)=>{let h=String(S).toLowerCase(),y=String(v).toLowerCase();(h==="form"&&y==="action"||(h==="button"||h==="input")&&y==="formaction")&&(w+=1)},C=v=>{_(),x=!1,s=v&&ro(u)?"rawtext":"text",s==="rawtext"&&(f="")};for(let v=0;v<r.length;v++){let S=r[v];for(let h=0;h<S.length;h++){let y=S[h];switch(s){case"text":d+=y,y==="<"&&(s="tag-open",p=d.length-1,x=!1);break;case"tag-open":d+=y,y==="!"?s="bang-1":y==="/"?(s="tag-name",u="",x=!0):/[a-zA-Z]/.test(y)?(s="tag-name",u=y.toLowerCase()):s="text";break;case"bang-1":d+=y,s=y==="-"?"bang-dash":"tag-name";break;case"bang-dash":d+=y,y==="-"?(s="comment",l=0):s="tag-name";break;case"comment":d+=y,y==="-"?l+=1:(y===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":d+=y,y===">"?C(!0):/\s/.test(y)?s="in-tag":u+=y.toLowerCase();break;case"in-tag":d+=y,y===">"?C(!0):!/\s/.test(y)&&y!=="/"&&(s="attr-name",i=y,a=d.length-1);break;case"rawtext":d+=y,f=(f+y.toLowerCase()).slice(-9),(f.endsWith("<\/script>")||f.endsWith("</style>"))&&(s="text",f="",u="");break;case"attr-name":y==="="?(s="after-eq",d+=y):/\s/.test(y)?(s="in-tag",i="",d+=y):y===">"?(s="text",i="",d+=y,C(!1)):(i+=y,d+=y);break;case"after-eq":y==='"'||y==="'"?(s="attr-quoted",c=y,d+=y):/\s/.test(y)?(s="in-tag",i="",d+=y):y===">"?(s="text",i="",d+=y,C(!1)):(s="attr-unquoted",d+=y);break;case"attr-unquoted":/\s/.test(y)?(s="in-tag",i="",d+=y):y===">"?(s="text",i="",d+=y,C(!1)):d+=y;break;case"attr-quoted":d+=y,y===c&&(s="in-tag",i="");break}}if(v<o.length){let h=o[v];if(h&&typeof h.then=="function"&&(h=await h),s==="comment")d+=String(h??""),l=0;else if(s==="rawtext")d+=String(h??""),f="";else if(s==="text")d&&(n.enqueue(d),d=""),await Y(h,t,n);else if(s==="after-eq"){let y=i[0],k=i.slice(1),N=Ve[y];if(N==="event"||N==="prop")N==="prop"&&!u.includes("-")&&(Lt(h,k,u),E(k,u)),d=d.slice(0,a),s="in-tag",i="";else if(N==="bool")X(h,k,u),d=d.slice(0,a),h&&(d+=`${k}=""`),s="in-tag",i="";else if(ze(h,i,u)){if(T(i,u),u==="form")m=be(await Rt(h),u),d=d.slice(0,a).replace(/\s+$/,"");else{Je(b!=null,u);let j=Ze(d.slice(p));j.has("name")&&Ke(j.get("name")||"",u,!1),j.has("value")&&Ye(u),j.has("form")&&Ge(u);let I=be(await Rt(h),u);b=u,d=d.slice(0,a)+`name="${R}" value="${H(I)}"`}s="in-tag",i=""}else T(i,u),X(h,i,u),d+=`"${H(String(h??""))}"`,s="in-tag",i=""}else(s==="attr-quoted"||s==="attr-unquoted")&&(X(h,i,u),d+=H(String(h??"")))}}d&&n.enqueue(d)}async function Nl(e,t,n){let r=eo(),o=r?` nonce="${H(r)}"`:"";for(;e.pending.length;){let s=e.pending.splice(0);await Promise.all(s.map(async({id:i,promise:a})=>{try{let c=await a,l=await M(c,e),u=await Ae(l,e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${u}</template><script${o}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(c){console.error(`[webjs] Suspense boundary "${i}" rejected:`,c);try{let l=c instanceof Error?c:new Error(String(c)),u=await Ae(await M(ni("webjs-suspense",l,n),e),e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${u}</template><script${o}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(l){console.error(`[webjs] Suspense boundary "${i}" error render also threw:`,l)}}}))}}Tt();var oi=Symbol.for("webjs.notFound"),si=Symbol.for("webjs.redirect"),ii=Symbol.for("webjs.forbidden"),ai=Symbol.for("webjs.unauthorized");function Tl(){let e=new Error("webjs: notFound()");throw e.__webjs=oi,e}function jl(){let e=new Error("webjs: forbidden()");throw e.__webjs=ii,e}function Rl(){let e=new Error("webjs: unauthorized()");throw e.__webjs=ai,e}function Ll(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=si,r.url=e,r.status=typeof n=="number"?n:void 0,r}function Ol(e){return!!e&&e.__webjs===oi}function $l(e){return!!e&&e.__webjs===si}function Il(e){return!!e&&e.__webjs===ii}function Pl(e){return!!e&&e.__webjs===ai}var oo=null;function Ml(e){oo=e}function Fl(e){if(typeof e!="string"||!e||!oo)return e;try{return oo(e)||e}catch{return e}}Qe();function Dl(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,s=null,i=[];function a(){o||(s=new WebSocket(Bl(e),t.protocols),s.onopen=c=>{for(r=0;i.length&&s&&s.readyState===WebSocket.OPEN;)s.send(i.shift());t.onOpen?.(c)},s.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},s.onerror=c=>{t.onError?.(c)},s.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);s&&s.readyState===WebSocket.OPEN?s.send(l):i.push(l)},close(c,l){o=!0;try{s?.close(c,l)}catch{}},get socket(){return s},get readyState(){return s?.readyState??3}}}function Bl(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}`}ht();var so="application/vnd.webjs+json";async function ql(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",so);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 Wt(r),n.has("content-type")||n.set("content-type",so));let o=await fetch(e,{...t,headers:n,body:r}),s=o.headers.get("content-type")||"",i=await o.text(),a=s.includes(so)?i?de(i):null:s.includes("application/json")?i?JSON.parse(i):null:i;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}ht();lo();co();Mn();var Uo=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 s=this.updates.findIndex(i=>i.id===r);s!==-1&&(this.updates.splice(s,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 Gu(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(s){throw e.set(r),s}return o&&o.success===!1&&e.set(r),o}function Ju(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Gu(e,t,n):new Uo(e,t)}bo();wo();var Xu="application/vnd.webjs+stream",Zu=1,Qu=2,ef=3,ca=new Uint8Array(0);function tf(e,t){let n=t||ca,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 nf(){let e=ca;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 s=e.slice(5,5+o);n.push({type:r,payload:s}),e=e.slice(5+o)}return n}}}var rf=Symbol.for("webjs.context");function of(e){return{__context__:rf,name:e}}var ir=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},Wo=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let s=o;if(s.context===this._context)if(o.stopPropagation(),s.subscribe){let i={callback:s.callback},a=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),s.callback(this._value,a)}else s.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()}},Vo=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 ir(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 sf(){return typeof window<"u"}var me={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},zo=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=me.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=me.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=me.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=me.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 me.INITIAL:return t.initial?.();case me.PENDING:return t.pending?.();case me.COMPLETE:return t.complete?.(this._value);case me.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!sf())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{Vo as ContextConsumer,Wo as ContextProvider,ir as ContextRequestEvent,R as FORM_ACTION_FIELD,Jo as FORM_ACTION_ID_KEY,Zu as FRAME_CHUNK,Qu as FRAME_END,ef as FRAME_ERROR,F as MARKER,bi as SEED_MISS,Xu as STREAM_CONTENT_TYPE,Pt as Signal,nl as Suspense,zo as Task,me as TaskStatus,Ln as WebComponent,ao as WebjsFrame,uo as WebjsStream,Oc as activeActionSignal,lr as adoptStyles,Xr as allTags,Fl as asset,Ra as asyncAppend,La as asyncReplace,Ha as batch,Ta as cache,Wa as computed,Dl as connectWS,ru as consumeStale,of as createContext,nf as createFrameDecoder,Na as createRef,eo as cspNonce,fa as css,zs as deserialize,Ci as disableClientRouter,za as effect,jo as enableClientRouter,tf as encodeFrame,H as escapeAttr,sn as escapeText,tu as fetchMark,jl as forbidden,xa as guard,cr as html,nt as isAsyncAppend,rt as isAsyncReplace,We as isCSS,Le as isCache,Il as isForbidden,je as isGuard,Te as isKeyed,Pc as isLazy,Ne as isLive,Ol as isNotFound,$l as isRedirect,Re as isRef,ke as isRepeat,Va as isSignal,On as isSuspense,B as isTemplate,tt as isTemplateContent,Pl as isUnauthorized,et as isUnsafeHTML,Oe as isUntil,$e as isWatch,Ea as keyed,va as live,Ni as loadFrame,Jr as lookup,Ic as lookupModuleUrl,go as markStale,ki as navigate,Tl as notFound,Ju as optimistic,de as parse,yo as parseTagHeader,$c as primeModuleUrl,tl as prop,Ll as redirect,ka as ref,Gr as register,nu as registerKeyTags,dt as render,fo as renderStream,Cl as renderToStream,ol as renderToString,rs as repeat,Ti as revalidate,ql as richFetch,Fn as scanSeeds,Ql as seedStats,Vs as serialize,Nn as setActiveActionSignal,Ml as setAssetUrlProvider,rl as setCspNonceProvider,da as setFormActionResolver,Ua as signal,Wt as stringify,rn as stylesToString,pt as tagOf,Zl as takeSeed,Ca as templateContent,Rl as unauthorized,gr as unsafeHTML,ja as until,Oa as watch};
10
10
  //# sourceMappingURL=webjs-core.js.map