@webjsdev/core 0.7.63 → 0.7.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/webjs-core-browser.js +4 -4
- package/dist/webjs-core-browser.js.map +3 -3
- package/dist/webjs-core-testing.js +21 -22
- package/dist/webjs-core-testing.js.map +3 -3
- package/dist/webjs-core.js +6 -7
- package/dist/webjs-core.js.map +3 -3
- package/index-browser.js +1 -1
- package/index.d.ts +2 -2
- package/index.js +1 -1
- package/package.json +1 -1
- package/src/attribute-reader.js +20 -0
- package/src/binding-prefixes.js +20 -1
- package/src/component/lifecycle.js +90 -48
- package/src/escape.js +12 -2
- package/src/form-action.js +7 -7
- package/src/optimistic.js +3 -3
- package/src/registry.d.ts +5 -0
- package/src/registry.js +35 -4
- package/src/render-client/parts.js +2 -2
- package/src/render-server/attrs.js +5 -4
- package/src/render-server/compile.js +419 -0
- package/src/render-server/dsd.js +11 -435
- package/src/render-server/errors.js +84 -0
- package/src/render-server/expand.js +319 -0
- package/src/render-server/html-scan.js +19 -358
- package/src/render-server/stream.js +11 -13
- package/src/render-server/template-renderer.js +13 -936
- package/src/render-server/walk.js +758 -0
- package/src/router-client/dom-differ.js +25 -2
- package/src/router-client/form-state.js +190 -0
- package/src/router-client/navigator.js +12 -0
- package/src/router-client/snapshot-cache.js +2 -12
- package/src/routes.d.ts +2 -0
- package/src/slot.js +1 -1
- package/src/render-server/slots.js +0 -213
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var kc=Object.defineProperty;var w=(e,t)=>()=>(e&&(t=e(e=0)),t);var cs=(e,t)=>{for(var n in t)kc(e,n,{get:t[n],enumerable:!0})};function Kt(e){return Object.prototype.hasOwnProperty.call(go,e)}function Vt(e,t){return t==null?null:t===!1?/^aria-/i.test(e)?"false":null:String(t)}var go,zt=w(()=>{go=Object.freeze({"@":"event",".":"prop","?":"bool"})});function jc(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function ls(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}var wo=w(()=>{});function _o(e){if(typeof e!="function")return null;let t=e[us];return typeof t=="string"&&t?t:null}function tr(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 fs(e,t,n=!0){if(!e||e===I&&n)return;let r=e===I?'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 ds(e,t){let n=String(e||"").toLowerCase(),r=t==null?null:String(t).toLowerCase();if(Pc(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 Pc(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 ps(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 hs(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 ms(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 bs(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 ys(e,t){let r=(e||[]).filter(o=>So(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 So(e){let t=String(e).toLowerCase();return t==="name"||t==="value"||t==="formaction"||t==="formmethod"||t==="formenctype"}function Ic(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&&!ws.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 Yt(e,t,n){if(nr(e)&&Uc(t))throw new Error(qc(t,n))}function gs(e,t,n){Hc(t,n)&&Yt(e,t,n)}function Ao(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 Mc(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&&!ws.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 Fc(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 Bc(e,t){let n=e!==K&&e!=null,r=t!==K&&t!=null;return Mc(n?e:null,r?t:null),{method:n?null:"post",enctype:r?null:"multipart/form-data"}}function _s(e,t,n){let r=t!==K&&t!=null,o=n!==K&&n!=null;return Ic(e,r?t:null,o?n:null),{formMethod:r?null:"post",formEnctype:o?null:"multipart/form-data"}}function Ss(e,t,n,r,o){let i=typeof t=="function"?_o(t):null;if(!i){typeof t=="function"&&Ao(null,e.localName),$c(e,n,r,o.propAttrs);return}Fc(o);let s=Bc(n,r);e.removeAttribute("action"),Gt(e,"method",n,s.method),Gt(e,"enctype",r,s.enctype),Dc(e,i)}function Gt(e,t,n,r){if(r!==null){e.setAttribute(t,r);return}n!==K&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Dc(e,t){let n=e.firstElementChild,r=n&&n.localName==="input"&&n.getAttribute("name")===I?n:null;if(!r){for(let o of e.children)if(o.localName==="input"&&o.getAttribute("name")===I){r=o;break}}r||(r=e.ownerDocument.createElement("input"),r.setAttribute("type","hidden"),r.setAttribute("name",I),e.insertBefore(r,e.firstChild)),r.getAttribute("value")!==t&&r.setAttribute("value",t)}function $c(e,t,n,r){let o=e.firstElementChild;if(o&&o.localName==="input"&&o.getAttribute("name")===I)o.remove();else for(let s of e.children)if(s.localName==="input"&&s.getAttribute("name")===I){s.remove();break}let i=s=>(r||[]).some(a=>{let c=String(a).toLowerCase();return c===s||s==="enctype"&&c==="encoding"});t===K&&!i("method")&&e.removeAttribute("method"),n===K&&!i("enctype")&&e.removeAttribute("enctype")}function As(e,t,n,r){let o=i=>(r||[]).some(s=>String(s).toLowerCase()===i);t===K&&!o("formmethod")&&e.removeAttribute("formmethod"),n===K&&!o("formenctype")&&e.removeAttribute("formenctype")}function Hc(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 nr(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=>nr(r,n)))}function Uc(e){let t=String(e).toLowerCase();return Kt(t[0])&&(t=t.slice(1)),t==="action"||t==="formaction"}function qc(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 I,us,ws,K,Ee=w(()=>{zt();wo();I="__webjs_action",us="$$webjsAction";ws=new Set(["multipart/form-data","application/x-www-form-urlencoded"]);K=Symbol("webjs.attr.absent")});var _,S,O,M,No,Te,We,Co,Es,k,ko,ae,A,Ne=w(()=>{_=Symbol("webjs.slot.state"),S="data-webjs-light",O="data-projection",M="actual",No="fallback",Te=Symbol("webjs.slot.fallbackFrag"),We=Symbol("webjs.slot.templateOwner"),Co="data-wj-slot-owner",Es=64,k=Symbol("webjs.slot.rendering"),ko=Symbol("webjs.slot.intercepted"),ae=Symbol("webjs.slot.park"),A=new WeakSet});function F(e){let t=e,n=t[_];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[_]=n),n}function Jt(e){return!!e[_]}function Ro(e){let t=F(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),A.add(n),e.removeChild(n)}ce(t)}function ce(e){let t=e.assignedByName;t.clear();for(let n of e.authored)nl(t,Ce(e,n),n)}function Ce(e,t){let n=Qt(e,t);if(n)return q(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return Ts(t)}function Oo(e){let t=F(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${S}]`);for(let o of r){let i=o;if(!U(e,i)||i.getAttribute(O)!==M||gt(t,e,i))continue;let s=q(i.getAttribute("name"));if(!n.has(s)){n.add(s);let a=Array.from(i.childNodes);for(let c of a)t.authored.push(c),Ts(c)!==s&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(c,s));t.lastSnapshot.set(i,a.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if(U(e,o)){for(let i of Array.from(o.childNodes))A.add(i),t.authored.push(i);o.remove()}ce(t)}function q(e){return e==null||e===""||e==="default"?null:e}function Ts(e){return e.nodeType!==1?null:q(e.getAttribute("slot"))}function nl(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}var Ke=w(()=>{ze();Xt();Ve();Ne()});function Ns(){le||!Y||(le=Node.prototype.appendChild,Lo=Node.prototype.insertBefore,ke=Node.prototype.removeChild,ur=Node.prototype.replaceChild,jo=Element.prototype.append,Po=Element.prototype.prepend,Io=Element.prototype.replaceChildren,Zt=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),fr=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function Ge(e,t){let n=e[k];e[k]=!0;try{return t()}finally{e[k]=n,n||dr(e)}}function Mo(e){if(!Y)return;let t=e,n=F(e);n.backstop||(n.backstop=new MutationObserver(r=>en(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>Cs(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function en(e,t,n){let r=e,o=r[ae],i=r[Symbol.for("webjs.instance")],s=!1,a=new Set;for(let c of n){for(let l of c.addedNodes)if(a.add(l),l!==o&&!(i&&Do(i,l))){if(t.authored.indexOf(l)!==-1){s=!0;continue}A.add(l),t.authored.push(l),s=!0}for(let l of c.removedNodes){let u=t.authored.indexOf(l);if(u===-1||e.contains(l))continue;A.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(u,1),s=!0)}}s&&V(e)}function dr(e){let t=e,n=t[_];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&en(e,n,r)}function Cs(e,t){let n=e[_];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let i=o.target;o.attributeName==="name"?i.tagName==="SLOT"&&i.hasAttribute(S)&&U(e,i)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(i),n.authored.indexOf(i)!==-1&&(r=!0))}r&&V(e)}function Fo(e){let t=e[_];t&&(t.backstop&&(en(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(Cs(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function Bo(e){if(!Y)return;let t=e,n=t[_];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,i=!o&&n.adopted===!0,s=!1;for(let a of Array.from(e.childNodes))if(a!==t[ae]){if(n.authored.indexOf(a)!==-1){s=!0;continue}o&&(!r||Do(r,a))||!o&&i||(A.add(a),n.authored.push(a),s=!0)}s&&V(e)}var le,Lo,ke,ur,jo,Po,Io,Zt,fr,pr=w(()=>{ze();Xt();Ve();tn();Ke();Ne();le=null,Lo=null,ke=null,ur=null,jo=null,Po=null,Io=null,Zt=null,fr=null});function Do(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 ks(e){let t=e,n=t[ae];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[ae]=n),Ge(e,()=>le.call(e,n))),n}function Ye(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function $o(e,t,n){if(n&&!Ye(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!Ye(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);hr(e,r);for(let o of r)ke.call(t,o);return r}return hr(e,[t]),[t]}function hr(e,t){wt(e,t);for(let n of t){if(!Ye(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 wt(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 Ho(e,t,n){let r=e.authored;for(let i of t){let s=r.indexOf(i);s!==-1&&r.splice(s,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function Wo(e,t){let n=e[_];return n?gt(n,e,t):!1}function gt(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function Uo(e,t){if(A.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[ae])return!0;let r=e[_];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(S)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&U(e,n))}function qo(e,t){let n=[];for(let i of t)Ye(i)?i.nodeType===11?n.push({frag:i}):n.push({node:i}):n.push({text:`${i}`});for(let i of n)i.frag?wt(e,Array.from(i.frag.childNodes)):i.node&&hr(e,[i.node]);let r=e.ownerDocument.createDocumentFragment();for(let i of n)if(i.text!==void 0)le.call(r,e.ownerDocument.createTextNode(i.text));else if(i.frag){let s=Array.from(i.frag.childNodes);hr(e,s);for(let a of s)le.call(r,a)}else i.node&&(wt(e,[i.node]),le.call(r,i.node));let o=Array.from(r.childNodes);wt(e,o);for(let i of o)ke.call(r,i);return o}function ye(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);ce(t),V(e)}function Ko(e){if(!Y)return;let t=e;if(t[ko])return;Ns(),t[ko]=!0;let n=F(e);t.appendChild=function(r){if(t[k])return le.call(this,r);let o=$o(e,r,!1);for(let i of o)A.add(i);return Ho(n,o,null),ye(e,n,o),r},t.insertBefore=function(r,o){if(t[k])return Lo.call(this,r,o);if(!Ye(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!Ye(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(wt(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!Uo(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let i=$o(e,r,!1);for(let s of i)A.add(s);return Ho(n,i,o||null),ye(e,n,i),r},t.removeChild=function(r){if(t[k])return ke.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return ke.call(this,r);if(!Uo(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),ye(e,n,[r]),r},t.replaceChild=function(r,o){if(t[k])return ur.call(this,r,o);if(n.authored.indexOf(o)===-1)return ur.call(this,r,o);if(!Ye(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(wt(e,r.nodeType===11?Array.from(r.childNodes):[r]),!Uo(e,o))throw new DOMException("replaceChild: the node to be replaced is not an assigned child of this host","NotFoundError");if(r===o)return o;let s=$o(e,r,!1);for(let c of s)A.add(c);for(let c of s){if(c===o)continue;let l=n.authored.indexOf(c);l!==-1&&n.authored.splice(l,1)}let a=n.authored.indexOf(o);return n.authored.splice(a,1,...s),ye(e,n,[...s,o]),o},t.append=function(...r){if(t[k])return jo.apply(this,r);let o=qo(e,r);for(let i of o)A.add(i);Ho(n,o,null),ye(e,n,o)},t.prepend=function(...r){if(t[k])return Po.apply(this,r);let o=qo(e,r);for(let i of o)A.add(i);for(let i of o){let s=n.authored.indexOf(i);s!==-1&&n.authored.splice(s,1)}n.authored.unshift(...o),ye(e,n,o)},t.replaceChildren=function(...r){if(t[k])return Io.apply(this,r);let o=qo(e,r);for(let s of o)A.add(s);let i=n.authored;n.authored=o.slice(),ye(e,n,[...i,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return Zt.get.call(this)},set(r){if(t[k]){Zt.set.call(this,r);return}let o=e.ownerDocument.createElement("div");Zt.set.call(o,r===null?"":`${r}`);let i=Array.from(o.childNodes);for(let a of i)A.add(a);let s=n.authored;n.authored=i,ye(e,n,[...s,...i])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return fr.get.call(this)},set(r){if(t[k]){fr.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let s of o)A.add(s);let i=n.authored;n.authored=o,ye(e,n,[...i,...o])}})}var Rs,Xt=w(()=>{ze();Ve();tn();pr();Ke();Ne();Rs=new Set});function Re(e,t,n){let r=F(e),o=q(t),i=Array.isArray(n)?n.filter(Boolean):n?[n]:[],s=r.authored.findIndex(c=>Ce(r,c)===o),a=r.authored.filter(c=>Ce(r,c)===o);r.authored=r.authored.filter(c=>Ce(r,c)!==o),(s===-1||s>r.authored.length)&&(s=r.authored.length);for(let c of i)c.nodeType===1&&!Qt(r,c)&&(o==null?c.removeAttribute("slot"):c.setAttribute("slot",o)),A.add(c);if(r.authored.splice(s,0,...i),r.applying&&r.pendingRecordNodes){for(let c of a)r.pendingRecordNodes.add(c);for(let c of i)r.pendingRecordNodes.add(c)}else r.pendingRecordNodes=new Set([...a,...i]);if(r.adoptedKey){for(let c of a)r.adoptedKey.delete(c);for(let c of i)r.adoptedKey.delete(c)}ce(r),V(e)}function V(e){if(!Y)return;let t=e[_];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||Rs;t.pendingRecordNodes=void 0,rl(e,t,n),ol(e,t),ce(t);let r=[],o=new Set;for(let u of e.querySelectorAll(`slot[${S}]`))if(U(e,u)&&!gt(t,e,u)){if(!u.hasAttribute(O)&&!(Te in u)){o.add(q(u.getAttribute("name")));continue}r.push(u)}let i=new Map;for(let u of r){let f=q(u.getAttribute("name")),d=i.get(f);d||(d=[],i.set(f,d)),d.push(u)}let s=[];for(let[u,f]of i){let d=t.assignedByName.get(u)||[];for(let b=0;b<f.length;b++){let p=f[b],y=d.filter(g=>{let h=Qt(t,g);return h?h===p:b===0}),m=y.filter(g=>g===e||g.nodeType===1&&g.contains(e));if(m.length){for(let g of m)A.delete(g);y=y.filter(g=>m.indexOf(g)===-1)}y.length>0?Vo(t,p,y)&&s.push(p):zo(t,p)&&s.push(p)}}for(let u of s)Go(t,u);let a=new Set(i.keys());for(let u of o)a.add(u);let c=new Set;for(let u of t.authored)a.has(Ce(t,u))||c.add(u);let l=e[ae];if(l)for(let u of Array.from(l.childNodes))c.has(u)||ke.call(l,u);if(c.size){let u=ks(e);for(let f of c)f.parentNode!==u&&(A.delete(f),Ge(e,()=>le.call(u,f)))}if(t.backstop){let u=t.backstop.takeRecords();u.length&&en(e,t,u)}}while(t.reapply)}finally{t.applying=!1}}}function rl(e,t,n){for(let r of e.querySelectorAll(`slot[${S}][${O}="${M}"]`)){if(!U(e,r)||gt(t,e,r))continue;let o=r,i=t.lastSnapshot.get(o);if(!i)continue;let s=Array.from(o.childNodes);if(mr(s,i))continue;let a=t.authored,c=q(o.getAttribute("name")),l=s.filter(p=>!n.has(p));for(let p of l)a.indexOf(p)===-1&&Ce(t,p)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(p,c));for(let p of a){if(l.indexOf(p)!==-1||Ce(t,p)!==c)continue;let y=a.indexOf(p),m=0;for(let g=0;g<l.length;g++){let h=a.indexOf(l[g]);h!==-1&&h<y&&(m=g+1)}l.splice(m,0,p)}let u=new Set(l);for(let p of i)u.add(p);let f=-1,d=0;for(let p of a){if(u.has(p)){f===-1&&(f=d);continue}d+=1}let b=a.filter(p=>!u.has(p));(f===-1||f>b.length)&&(f=b.length),b.splice(f,0,...l),t.authored=b}}function ol(e,t){let n=e[ae];t.authored=t.authored.filter(r=>{if(A.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(S)&&(t.lastSnapshot.has(o)||e.contains(o)&&U(e,o)))})}var tn=w(()=>{ze();Xt();Ve();pr();Ke();Ne()});function js(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function Ps(){if(Os||(Y=js(),!Y))return;nn=HTMLSlotElement.prototype.assignedNodes,Yo=HTMLSlotElement.prototype.assignedElements,br=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(S)&&!Xo(this)?Qo(this,n):nn?nn.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(S)&&!Xo(this)?Qo(this,n).filter(r=>r.nodeType===1):Yo?Yo.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=br&&br.get?br.get.call(this):null;return n||Ls(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||Ls(this)}}),Jo=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(S)&&!Xo(this)){let r=il(this);if(r){let o=F(r);o.manualAssign||(o.manualAssign=new Map);let i=n.filter(Boolean);for(let[s,a]of o.manualAssign){if(s===this)continue;let c=a.filter(l=>{let u=l.deref();return u!==void 0&&i.indexOf(u)===-1});c.length!==a.length&&(c.length?o.manualAssign.set(s,c):o.manualAssign.delete(s))}if(i.length?o.manualAssign.set(this,i.map(s=>new WeakRef(s))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let s of i)o.pendingRecordNodes.add(s);else o.pendingRecordNodes=new Set(i);ce(o),V(r)}return}return Jo?Jo.apply(this,n):void 0},Os=!0}function Qt(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let i=!1,s=o.filter(a=>{let c=a.deref();return c===void 0?!1:(c===t&&(i=!0),!0)});if(s.length!==o.length&&(s.length?n.set(r,s):n.delete(r)),i){let a=e.host;return a&&(r===a||a.contains(r))?r:null}}return null}function il(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[_])return U(t,e)?t:null;return null}function Xo(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 Qo(e,t){if(e.getAttribute(O)!==M)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Zo(n,new Set,0)}function Zo(e,t,n){if(n>=Es)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let i=o;if(t.has(i))continue;if(t.add(i),i.hasAttribute(S)){let s=Qo(i,{flatten:!1});if(s.length>0)for(let a of Zo(s,t,n+1))r.push(a);else for(let a of Zo(Array.from(i.childNodes),t,n+1))r.push(a)}else if(nn){let s=nn.call(i,{flatten:!0});for(let a of s)r.push(a)}else r.push(o)}else r.push(o);return r}function Ls(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(S)&&t.getAttribute(O)===M?t:null}var Y,nn,Yo,br,Jo,Os,Ve=w(()=>{ze();tn();Ke();Ne();Y=js(),nn=null,Yo=null,br=null,Jo=null,Os=!1;Ps()});function ei(e){if(!Y)return!1;for(let t of e.querySelectorAll(`slot[${S}][${O}]`))if(U(e,t))return!0;return!1}function U(e,t){let n=t[We];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(Co):null;if(r){let o=sl(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 sl(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 Vo(e,t,n){for(let l of n)A.delete(l);let r=t.getAttribute(O)!==M,o=e.lastSnapshot.get(t)||[],i=r||!mr(o,n);if(!r&&mr(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),i;let s=t[Te];if(r&&s)for(;t.firstChild;)s.appendChild(t.firstChild);let a=new Set(n);for(let l of Array.from(t.childNodes))a.has(l)||t.removeChild(l);let c=t.firstChild;for(let l of n){if(l===c){c=c.nextSibling;continue}t.insertBefore(l,c)}return t.setAttribute(O,M),e.lastSnapshot.set(t,n.slice()),i}function zo(e,t){let n=t.getAttribute(O)===M;if(t.setAttribute(O,No),!n)return Is(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Is(t),!0}function Is(e){let t=e[Te];!t||t.childNodes.length===0||e.appendChild(t)}function ti(e,t){if(!Jt(e))return;let n=F(e),r=q(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let i of o)i.parentNode===t&&(A.add(i),t.removeChild(i));n.lastSnapshot.delete(t)}function Ms(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function Go(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)Ms(r)}))}function mr(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 ze=w(()=>{Ve();Ke();Ne()});var Je=w(()=>{ze();Xt();Ve();tn();pr();Ke();Ne()});function aa(e,t,n){Yl.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function wi(e){return JSON.stringify(await ca(e))}function nt(e){return la(JSON.parse(e))}async function ca(e){let t=Jl();return await Xl(e,t),tt(e,t)}function la(e){return je(e,tu())}function Jl(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function Xl(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!ru(r))continue;let o=t.refCount.get(r)||0;if(t.refCount.set(r,o+1),!(o>0)){if(typeof Blob<"u"&&r instanceof Blob){let i=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,i);continue}if(typeof FormData<"u"&&r instanceof FormData){let i=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,i);for(let[,s]of i)typeof s!="string"&&n.push(s);continue}if(Array.isArray(r))for(let i=0;i<r.length;i++)n.push(r[i]);else if(r instanceof Map)for(let[i,s]of r)n.push(i),n.push(s);else if(r instanceof Set)for(let i of r)n.push(i);else if(ou(r))for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&n.push(r[i])}}for(let[r,o]of t.refCount)o>1&&t.idOf.set(r,t.nextId++)}function tt(e,t){if(e===null)return null;if(e===void 0)return{[C]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[C]:"NaN"}:e===1/0?{[C]:"Inf"}:e===-1/0?{[C]:"-Inf"}:Object.is(e,-0)?{[C]:"-0"}:e;if(n==="bigint")return{[C]:"BigInt",v:e.toString()};if(n==="symbol"){let i=Symbol.keyFor(e);if(i===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[C]:"Sym",v:i}}if(n==="function")throw new TypeError("Cannot serialize a function.");let r=t.idOf.get(e);if(r!==void 0&&t.emitted.has(r))return{[C]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[C]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[C]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let i=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[C]:"File",v:fn(i),n:e.name,t:e.type||"",m:e.lastModified}:o={[C]:"Blob",v:fn(i),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let i=t.fdEntries.get(e)||[...e.entries()],s=[];for(let[a,c]of i)s.push([a,tt(c,t)]);o={[C]:"FD",v:s}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=Ql(e);else if(e instanceof Map){let i=[];for(let[s,a]of e)i.push([tt(s,t),tt(a,t)]);o={[C]:"Map",v:i}}else if(e instanceof Set){let i=[];for(let s of e)i.push(tt(s,t));o={[C]:"Set",v:i}}else if(Array.isArray(e))o=e.map(i=>tt(i,t));else{o={};for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let s=iu(i)?"_"+i:i;aa(o,s,tt(e[i],t))}}if(r!==void 0){if(Array.isArray(o))return{[C]:"Arr",_id:r,v:o};o._id=r}return o}function Ql(e){if(e instanceof ArrayBuffer)return{[C]:"buf",v:fn(new Uint8Array(e))};if(e instanceof DataView)return{[C]:"dv",v:fn(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=Zl[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[C]:n,v:fn(r)}}function tu(){return{refs:new Map}}function je(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let i=[];for(let s=0;s<e.length;s++)i.push(je(e[s],t));return i}let n=e[C];if(typeof n=="string")return nu(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i)||i==="_id")continue;let s=su(i)?i.slice(1):i;aa(r,s,je(e[i],t))}return r}function nu(e,t,n){let r=e._id,o=i=>(typeof r=="number"&&n.refs.set(r,i),i);switch(t){case"undef":return;case"NaN":return NaN;case"Inf":return 1/0;case"-Inf":return-1/0;case"-0":return-0;case"BigInt":return o(BigInt(e.v));case"Sym":return o(Symbol.for(e.v));case"Date":return o(e.v==null?new Date(NaN):new Date(e.v));case"Error":{let i=new Error(e.v.message);return i.name=e.v.name,e.v.stack&&(i.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,i),i}case"Map":{let i=new Map;typeof r=="number"&&n.refs.set(r,i);for(let[s,a]of e.v)i.set(je(s,n),je(a,n));return i}case"Set":{let i=new Set;typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.add(je(s,n));return i}case"Arr":{let i=[];typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.push(je(s,n));return i}case"Ref":{let i=n.refs.get(e.v);if(i===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return i}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let i=un(e.v);return o(new Blob([i],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let i=un(e.v);return o(new File([i],e.n,{type:e.t||"",lastModified:e.m}))}case"FD":{if(typeof FormData>"u")throw new TypeError("FormData is not available in this environment.");let i=new FormData;o(i);for(let[s,a]of e.v){let c=je(a,n);i.append(s,c)}return i}default:{if(t==="buf"){let s=un(e.v);return o(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength))}if(t==="dv"){let s=un(e.v);return o(new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)))}let i=eu[t];if(i){let s=un(e.v),a=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);return o(new i(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function ru(e){return e!==null&&typeof e=="object"}function ou(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function iu(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function su(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function fn(e){if(ua)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 un(e){if(ua){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 C,Yl,Zl,eu,ua,dn=w(()=>{C="_$wj",Yl=new Set(["__proto__","constructor","prototype"]);Zl={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},eu={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};ua=typeof Buffer<"u"&&typeof Buffer.from=="function"});var Ta={};cs(Ta,{observeLazy:()=>Nu,observeViewportOnce:()=>Ru});function Ea(e){let t=vi.get(e);return t||(t=import(e).finally(()=>vi.delete(e)),vi.set(e,t),t)}function Nu(e){for(let[t,n]of Object.entries(e))Pe.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of Pe.values())Ea(t);Pe.clear();return}bn||(bn=new IntersectionObserver(Cu,{rootMargin:"200px"})),xa(),!Ai&&typeof MutationObserver<"u"&&(Ai=new MutationObserver(()=>xa()),Ai.observe(document.body,{childList:!0,subtree:!0}))}function xa(){if(!(!bn||!Pe.size))for(let e of Pe.keys()){if(customElements.get(e)){Pe.delete(e);continue}for(let t of document.querySelectorAll(e))bn.observe(t)}}function Cu(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=Pe.get(n);r&&(Ea(r),Pe.delete(n),bn?.unobserve(t.target))}}function ku(e){for(let t of e){if(!t.isIntersecting)continue;let n=Or.get(t.target);Or.delete(t.target),mn?.unobserve(t.target),n&&n()}}function Ru(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(mn||(mn=new IntersectionObserver(ku,{rootMargin:"200px"})),Or.set(e,t),mn.observe(e),()=>{Or.delete(e),mn?.unobserve(e)})}var Pe,bn,Ai,vi,mn,Or,Na=w(()=>{Pe=new Map,bn=null,Ai=null,vi=new Map;mn=null,Or=new WeakMap});var xi,Ei=w(()=>{xi=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(()=>(Na(),Ta)).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(()=>(Lr(),Ca)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&xi&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",xi)});function Lu(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 Ni(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let i=n.createElement("template");i.innerHTML=e,r=i.content}else if(e&&e.nodeType)r=e;else return;let o=r.querySelectorAll?Array.from(r.querySelectorAll("webjs-stream")):[];if(o.length)for(let i of o)n.body.append(i);else n.body.append(r)}var Ou,Ti,yn=w(()=>{Ou=new Set(["append","prepend","before","after","replace","update"]);Ti=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this._webjsApplied||(this._webjsApplied=!0,this._webjsApply())}_webjsApply(){let t=(this.getAttribute("action")||"").toLowerCase(),n=this.ownerDocument||document,r=[],o=this.getAttribute("target");if(o){let s=n.getElementById(o);s&&(r=[s])}else{let s=this.getAttribute("targets");if(s)try{r=Array.from(n.querySelectorAll(s))}catch{r=[]}}let i=Ou.has(t)?this.querySelector("template"):null;try{for(let s of r){let a=i?i.content.cloneNode(!0):null;Lu(t,s,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&Ti&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",Ti)});var ka,Ra=w(()=>{ka=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&ka&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",ka)});function jr(e,t){let n=typeof document<"u"?document:null,r=e||n;if(!r||typeof r.querySelectorAll!="function")return;if(t&&t.frame===!0){Ci(r,!0);return}ja();let o=r===n,i=!!n&&!o&&typeof n.contains=="function"&&n.contains(r),s=!!n&&!o&&!i;s&&(Ci(n,!0),Ie.clear(),Ri.clear()),(o||s)&&(ki=!0);let a=j.ingested+j.replaced;Iu(Ci(r),a)}function Ci(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=Pu(r.getAttribute?.("data-webjs-dev"));o!==null&&(n=o),Oa(t?null:r.textContent,r)}for(let r of e.querySelectorAll("[data-webjs-seed]"))Oa(t?null:r.getAttribute("data-webjs-seed"),r,()=>r.removeAttribute("data-webjs-seed"));return n}function Oa(e,t,n){if(e)try{let r=nt(e);if(r&&typeof r=="object")for(let o in r){Ie.has(o)?j.replaced++:j.ingested++,Ie.set(o,r[o]);let i=o.indexOf("/",o.indexOf("/")+1);i>0&&Ri.add(o.slice(0,i))}}catch{}n?n():t.remove?.()}function Pu(e){return typeof e!="string"?null:e||"ok"}function Iu(e,t){if(e===null)return;let n=++ju;Tt={epoch:n,hits:j.hits,misses:j.misses,keyMisses:j.keyMisses,merged:t,marker:e};let r=()=>{!Tt||Tt.epoch!==n||ja()};try{typeof requestIdleCallback=="function"?requestIdleCallback(r,{timeout:1e3}):setTimeout(r,250)}catch{Tt=null}}function ja(){let e=Tt;if(Tt=null,!!e)try{Mu(e)}catch{}}function Mu(e){let t=j.hits-e.hits,n=j.misses-e.misses,r=j.ingested+j.replaced-e.merged,o=j.keyMisses-e.keyMisses;if(n===0)return;let i=e.marker==="streamed"?"This page streams (a Suspense or <webjs-suspense> boundary), and a streamed render emits no seeds, so every action call on it goes to the network.":e.marker==="drop"?"The page's seeds could not be serialized, so the whole block was dropped. Something an action returned is not serializer-safe; the server response reports collected above emitted.":o===0?null:"The key is the action file hash plus the function name plus the serialized arguments, so an argument the SSR render never used misses (a deliberate refetch after hydration misses too, and is expected). A miss on an action this page never seeded is NOT counted here, because a mutation or a client-only read could never have been seeded.";if(i===null)return;let a=e.marker==="streamed"||e.marker==="drop"?`${n} of ${t+n} action call(s) in the hydration window went to the network`:`${o} action call(s) in the hydration window asked for a key this page seeded under DIFFERENT arguments`;console.warn(`[webjs] SSR action seeding: ${a} (${r} seed(s) on this page, ${Ie.size} still unconsumed). ${i} See https://webjs.dev/docs/data-fetching for the seeding reference.`)}function Fu(e,t,n){ki||(ki=!0,jr());let r=`${e}/${t}/${n}`;if(Ie.has(r)){let o=Ie.get(r);return Ie.delete(r),j.hits++,o}return j.misses++,Ri.has(`${e}/${t}`)&&j.keyMisses++,La}function Bu(){return{...j,pending:Ie.size}}var Ie,La,ki,j,Ri,Tt,ju,Pr=w(()=>{dn();Ie=new Map,La=Symbol("webjs.seed.miss"),ki=!1,j={ingested:0,replaced:0,hits:0,misses:0,keyMisses:0},Ri=new Set,Tt=null,ju=0});function Oi(e){if(!(!Array.isArray(e)||!e.length)){Ir+=1;for(let t of e)t&&Pa.set(t,Ir)}}function $u(){return Ir}function Hu(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(Nt.delete(e),Nt.set(e,{tags:t.slice(),since:typeof n=="number"?n:Ir}),Nt.size>Du)){let r=Nt.keys().next().value;r!==void 0&&Nt.delete(r)}}function Uu(e){let t=Nt.get(e);if(!t)return!1;for(let n of t.tags)if((Pa.get(n)||0)>t.since)return!0;return!1}function Li(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var Ir,Pa,Nt,Du,Mr=w(()=>{Ir=0,Pa=new Map,Nt=new Map,Du=1e3});function Ia(e){return Ct.test(e)}var ji,Pi,Ct,gn,rt,ge,Fr,Ma,B=w(()=>{ji="text/vnd.webjs-stream.html",Pi=["wheel","touchmove","keydown","pointerdown"],Ct=/\.(?: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,gn="_top",rt="webjs:nav-fallback",ge=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]),Fr="name=csp-nonce";Ma=250});function Me(e,t,n="warn"){if(Ii.has(e)||(Ii.add(e),typeof console>"u"))return;let r=n==="error"?console.error:console.warn;r&&r.call(console,t)}function Ba(e,t,n,r){if(typeof process<"u"&&process.env||!r.has(I))return;let o="";try{o=new URL(e.getAttribute("action")||location.href,location.href).pathname}catch{o=location.pathname}if(n!=="post"){Me(`submit-nowhere:${o}:${n}`,`[webjs] this submission carries a bound server action's identity but submits as ${n.toUpperCase()}, which sends no body, so the identity rides the query string and the action never runs. A submitter's own formmethod overrides the form's, and WebJs honours it rather than refusing it, so check for a formmethod on the button that was pressed.`,"error");return}let i=t&&t.getAttribute("formenctype")||e.getAttribute("enctype")||"application/x-www-form-urlencoded";if(i.toLowerCase()==="text/plain"){Me(`submit-nowhere:${o}:${i}`,`[webjs] this submission carries a bound server action's identity but declares enctype="${i}", which the server cannot parse. The router declines to send it so both paths behave the same way, and both are answered with a 405. Drop the enctype and let the binding supply it.`,"error");return}o&&o!==location.pathname&&Me(`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 Br(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 Da(){if(typeof location>"u"||Fa)return;Fa=!0;let e=null;try{e=sessionStorage.getItem(rt),sessionStorage.removeItem(rt)}catch{}let t="";try{let n=performance.getEntriesByType("navigation")[0];t=n?n.type:""}catch{}Br(t,document.referrer,location.href,e)&&ne("pre-boot-navigation",location.href,!1)}function ne(e,t,n=!0){if(n)try{sessionStorage.setItem(rt,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||Me(`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 $a(e){typeof process<"u"&&process.env||Me(`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 Ha(){if(typeof process<"u"&&process.env||Mi||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;Mi=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&Me("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 wn(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 Ua(){Ii.clear(),Mi=!1}function qa(e,t){return Fi(e,t)}var Ii,Fa,Mi,re=w(()=>{Ee();B();Ii=new Set;Fa=!1;Mi=!1});function oe(e){let t=new Map,n=[],r=!1;function o(i){if(!r){if(i.nodeType===8){let s=i.data.trim();if(s.startsWith("wj:children:")){let a=s.slice(12),c=a.lastIndexOf(":");if(c<=0||c===a.length-1){r=!0;return}let l=a.slice(0,c),u=a.slice(c+1);if(t.has(l)||n.some(f=>f.segment===l)){r=!0;return}n.push({segment:l,routeKey:u,start:i});return}if(s.startsWith("/wj:children")){let a=s.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==i.parentNode){r=!0;return}{let l=c.start.parentNode.tagName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TFOOT"||l==="TR"){r=!0;return}}t.set(c.segment,{routeKey:c.routeKey,start:c.start,end:i});return}return}if(i.hasChildNodes&&i.hasChildNodes())for(let s=i.firstChild;s&&!r;s=s.nextSibling)o(s)}}return o(e),r||n.length>0?null:t}function _n(e,t){let n=[...e.keys()].filter(s=>t.has(s)).sort((s,a)=>s.length-a.length);if(n.length===0)return null;for(let s of n)if(e.get(s).routeKey!==t.get(s).routeKey){let a=null;for(let c of n){if(c===s)break;s.startsWith(c==="/"?c:c+"/")&&(a=c)}return a?{mode:"replace",segment:a,live:e.get(a),incoming:t.get(a)}:null}let r=n[n.length-1],o=s=>{let a=null;for(let c of s.keys())(a===null||c.length>a.length)&&(a=c);return a};return{mode:o(e)===r&&o(t)===r?"morph":"replace",segment:r,live:e.get(r),incoming:t.get(r)}}function de(){let e=oe(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}var Fe=w(()=>{});function Wa(e){pe=e||(t=>{location.href=t})}function Ka(){return R}function Va(){return++R}function Dr(){return++R}function Bi(e){z=e}function za(e){Sn=e}function Ga(e){let t=Sn!==null&&Sn===e;return Sn=null,t}function $r(){Sn=null}var R,pe,z,Sn,we=w(()=>{R=0,pe=e=>{location.href=e};z=!1;Sn=null});function ot(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"&&qu()?Document.parseHTMLUnsafe(e):Wu(e)}function qu(){if(kt!==null)return kt;try{kt=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{kt=!1}return kt}function Di(){kt=null}function Wu(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}var kt,An=w(()=>{kt=null});function Hr(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function $i(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}var Ur=w(()=>{});function vn(e,t){return((t&&t.hasAttribute("formmethod")?t.getAttribute("formmethod")||"":e.getAttribute("method")||"")||"get").toLowerCase()}function xn(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function Ku(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 En(e,t){return Ku(t&&t.hasAttribute("formenctype")?t.getAttribute("formenctype"):e.getAttribute("enctype"))}function Tn(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 Nn(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}}var qr=w(()=>{});function Ya(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function Cn(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=Ya();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Hi(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=Ya();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function he(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Wr(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 Vu(e){if(!e.querySelector("meta"))return;let t=o=>{let i=new Map;for(let s of o.querySelectorAll("meta")){let a=Wr(s);if(!a||a===Fr)continue;let c=i.get(a);c?c.push(s):i.set(a,[s])}return i},n=t(e),r=t(document.head);for(let[o,i]of n){let s=r.get(o)||[],a=i.map(he).join(`
|
|
1
|
+
var Uc=Object.defineProperty;var w=(e,t)=>()=>(e&&(t=e(e=0)),t);var ls=(e,t)=>{for(var n in t)Uc(e,n,{get:t[n],enumerable:!0})};function zt(e){return Object.prototype.hasOwnProperty.call(wo,e)}function Gt(e,t){return t==null?null:t===!1?/^aria-/i.test(e)?"false":null:t===!0&&Vc.has(String(e).toLowerCase())?"":String(t)}var wo,Vc,Yt=w(()=>{wo=Object.freeze({"@":"event",".":"prop","?":"bool"});Vc=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"])});function Yc(e){let t=String(e);return zc.test(t)?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):t}function us(e){let t=String(e);return Gc.test(t)?t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<"):t}var zc,Gc,_o=w(()=>{zc=/[&<>]/,Gc=/[&"<]/});function So(e){if(typeof e!="function")return null;let t=e[fs];return typeof t=="string"&&t?t:null}function rr(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 ds(e,t,n=!0){if(!e||e===I&&n)return;let r=e===I?'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 ps(e,t){let n=String(e||"").toLowerCase(),r=t==null?null:String(t).toLowerCase();if(Jc(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 Jc(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 hs(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 ms(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 bs(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 ys(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 gs(e,t){let r=(e||[]).filter(o=>Ao(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 Ao(e){let t=String(e).toLowerCase();return t==="name"||t==="value"||t==="formaction"||t==="formmethod"||t==="formenctype"}function Xc(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&&!_s.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 Xt(e,t,n){if(or(e)&&ol(t))throw new Error(il(t,n))}function ws(e,t,n){rl(t,n)&&Xt(e,t,n)}function vo(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 Qc(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&&!_s.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 Zc(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 el(e,t){let n=e!==W&&e!=null,r=t!==W&&t!=null;return Qc(n?e:null,r?t:null),{method:n?null:"post",enctype:r?null:"multipart/form-data"}}function Ss(e,t,n){let r=t!==W&&t!=null,o=n!==W&&n!=null;return Xc(e,r?t:null,o?n:null),{formMethod:r?null:"post",formEnctype:o?null:"multipart/form-data"}}function As(e,t,n,r,o){let i=typeof t=="function"?So(t):null;if(!i){typeof t=="function"&&vo(null,e.localName),nl(e,n,r,o.propAttrs);return}Zc(o);let s=el(n,r);e.removeAttribute("action"),Jt(e,"method",n,s.method),Jt(e,"enctype",r,s.enctype),tl(e,i)}function Jt(e,t,n,r){if(r!==null){e.setAttribute(t,r);return}n!==W&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function tl(e,t){let n=e.firstElementChild,r=n&&n.localName==="input"&&n.getAttribute("name")===I?n:null;if(!r){for(let o of e.children)if(o.localName==="input"&&o.getAttribute("name")===I){r=o;break}}r||(r=e.ownerDocument.createElement("input"),r.setAttribute("type","hidden"),r.setAttribute("name",I),e.insertBefore(r,e.firstChild)),r.getAttribute("value")!==t&&r.setAttribute("value",t)}function nl(e,t,n,r){let o=e.firstElementChild;if(o&&o.localName==="input"&&o.getAttribute("name")===I)o.remove();else for(let s of e.children)if(s.localName==="input"&&s.getAttribute("name")===I){s.remove();break}let i=s=>(r||[]).some(a=>{let c=String(a).toLowerCase();return c===s||s==="enctype"&&c==="encoding"});t===W&&!i("method")&&e.removeAttribute("method"),n===W&&!i("enctype")&&e.removeAttribute("enctype")}function vs(e,t,n,r){let o=i=>(r||[]).some(s=>String(s).toLowerCase()===i);t===W&&!o("formmethod")&&e.removeAttribute("formmethod"),n===W&&!o("formenctype")&&e.removeAttribute("formenctype")}function rl(e,t){let n=String(e).toLowerCase();zt(n[0])&&(n=n.slice(1));let r=String(t||"").toLowerCase();return n==="action"?r==="form":n==="formaction"?r==="button"||r==="input":!1}function or(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=>or(r,n)))}function ol(e){let t=String(e).toLowerCase();return zt(t[0])&&(t=t.slice(1)),t==="action"||t==="formaction"}function il(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 I,fs,_s,W,Ee=w(()=>{Yt();_o();I="__webjs_action",fs="$$webjsAction";_s=new Set(["multipart/form-data","application/x-www-form-urlencoded"]);W=Symbol("webjs.attr.absent")});var _,S,O,M,Co,Te,We,ko,Ts,R,Ro,ae,A,Ne=w(()=>{_=Symbol("webjs.slot.state"),S="data-webjs-light",O="data-projection",M="actual",Co="fallback",Te=Symbol("webjs.slot.fallbackFrag"),We=Symbol("webjs.slot.templateOwner"),ko="data-wj-slot-owner",Ts=64,R=Symbol("webjs.slot.rendering"),Ro=Symbol("webjs.slot.intercepted"),ae=Symbol("webjs.slot.park"),A=new WeakSet});function F(e){let t=e,n=t[_];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[_]=n),n}function Qt(e){return!!e[_]}function Oo(e){let t=F(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),A.add(n),e.removeChild(n)}ce(t)}function ce(e){let t=e.assignedByName;t.clear();for(let n of e.authored)gl(t,Ce(e,n),n)}function Ce(e,t){let n=en(e,t);if(n)return q(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return Ns(t)}function Lo(e){let t=F(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${S}]`);for(let o of r){let i=o;if(!U(e,i)||i.getAttribute(O)!==M||gt(t,e,i))continue;let s=q(i.getAttribute("name"));if(!n.has(s)){n.add(s);let a=Array.from(i.childNodes);for(let c of a)t.authored.push(c),Ns(c)!==s&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(c,s));t.lastSnapshot.set(i,a.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if(U(e,o)){for(let i of Array.from(o.childNodes))A.add(i),t.authored.push(i);o.remove()}ce(t)}function q(e){return e==null||e===""||e==="default"?null:e}function Ns(e){return e.nodeType!==1?null:q(e.getAttribute("slot"))}function gl(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}var Ve=w(()=>{Ge();Zt();ze();Ne()});function Cs(){le||!Y||(le=Node.prototype.appendChild,jo=Node.prototype.insertBefore,ke=Node.prototype.removeChild,dr=Node.prototype.replaceChild,Po=Element.prototype.append,Io=Element.prototype.prepend,Mo=Element.prototype.replaceChildren,tn=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),pr=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function Ye(e,t){let n=e[R];e[R]=!0;try{return t()}finally{e[R]=n,n||hr(e)}}function Fo(e){if(!Y)return;let t=e,n=F(e);n.backstop||(n.backstop=new MutationObserver(r=>nn(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>ks(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function nn(e,t,n){let r=e,o=r[ae],i=r[Symbol.for("webjs.instance")],s=!1,a=new Set;for(let c of n){for(let l of c.addedNodes)if(a.add(l),l!==o&&!(i&&Do(i,l))){if(t.authored.indexOf(l)!==-1){s=!0;continue}A.add(l),t.authored.push(l),s=!0}for(let l of c.removedNodes){let u=t.authored.indexOf(l);if(u===-1||e.contains(l))continue;A.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(u,1),s=!0)}}s&&V(e)}function hr(e){let t=e,n=t[_];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&nn(e,n,r)}function ks(e,t){let n=e[_];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let i=o.target;o.attributeName==="name"?i.tagName==="SLOT"&&i.hasAttribute(S)&&U(e,i)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(i),n.authored.indexOf(i)!==-1&&(r=!0))}r&&V(e)}function $o(e){let t=e[_];t&&(t.backstop&&(nn(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(ks(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function Bo(e){if(!Y)return;let t=e,n=t[_];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,i=!o&&n.adopted===!0,s=!1;for(let a of Array.from(e.childNodes))if(a!==t[ae]){if(n.authored.indexOf(a)!==-1){s=!0;continue}o&&(!r||Do(r,a))||!o&&i||(A.add(a),n.authored.push(a),s=!0)}s&&V(e)}var le,jo,ke,dr,Po,Io,Mo,tn,pr,mr=w(()=>{Ge();Zt();ze();rn();Ve();Ne();le=null,jo=null,ke=null,dr=null,Po=null,Io=null,Mo=null,tn=null,pr=null});function Do(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 Rs(e){let t=e,n=t[ae];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[ae]=n),Ye(e,()=>le.call(e,n))),n}function Je(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function Ho(e,t,n){if(n&&!Je(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!Je(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);br(e,r);for(let o of r)ke.call(t,o);return r}return br(e,[t]),[t]}function br(e,t){wt(e,t);for(let n of t){if(!Je(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 wt(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 Uo(e,t,n){let r=e.authored;for(let i of t){let s=r.indexOf(i);s!==-1&&r.splice(s,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function Wo(e,t){let n=e[_];return n?gt(n,e,t):!1}function gt(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function qo(e,t){if(A.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[ae])return!0;let r=e[_];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(S)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&U(e,n))}function Ko(e,t){let n=[];for(let i of t)Je(i)?i.nodeType===11?n.push({frag:i}):n.push({node:i}):n.push({text:`${i}`});for(let i of n)i.frag?wt(e,Array.from(i.frag.childNodes)):i.node&&br(e,[i.node]);let r=e.ownerDocument.createDocumentFragment();for(let i of n)if(i.text!==void 0)le.call(r,e.ownerDocument.createTextNode(i.text));else if(i.frag){let s=Array.from(i.frag.childNodes);br(e,s);for(let a of s)le.call(r,a)}else i.node&&(wt(e,[i.node]),le.call(r,i.node));let o=Array.from(r.childNodes);wt(e,o);for(let i of o)ke.call(r,i);return o}function ye(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);ce(t),V(e)}function Vo(e){if(!Y)return;let t=e;if(t[Ro])return;Cs(),t[Ro]=!0;let n=F(e);t.appendChild=function(r){if(t[R])return le.call(this,r);let o=Ho(e,r,!1);for(let i of o)A.add(i);return Uo(n,o,null),ye(e,n,o),r},t.insertBefore=function(r,o){if(t[R])return jo.call(this,r,o);if(!Je(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!Je(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(wt(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!qo(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let i=Ho(e,r,!1);for(let s of i)A.add(s);return Uo(n,i,o||null),ye(e,n,i),r},t.removeChild=function(r){if(t[R])return ke.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return ke.call(this,r);if(!qo(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),ye(e,n,[r]),r},t.replaceChild=function(r,o){if(t[R])return dr.call(this,r,o);if(n.authored.indexOf(o)===-1)return dr.call(this,r,o);if(!Je(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(wt(e,r.nodeType===11?Array.from(r.childNodes):[r]),!qo(e,o))throw new DOMException("replaceChild: the node to be replaced is not an assigned child of this host","NotFoundError");if(r===o)return o;let s=Ho(e,r,!1);for(let c of s)A.add(c);for(let c of s){if(c===o)continue;let l=n.authored.indexOf(c);l!==-1&&n.authored.splice(l,1)}let a=n.authored.indexOf(o);return n.authored.splice(a,1,...s),ye(e,n,[...s,o]),o},t.append=function(...r){if(t[R])return Po.apply(this,r);let o=Ko(e,r);for(let i of o)A.add(i);Uo(n,o,null),ye(e,n,o)},t.prepend=function(...r){if(t[R])return Io.apply(this,r);let o=Ko(e,r);for(let i of o)A.add(i);for(let i of o){let s=n.authored.indexOf(i);s!==-1&&n.authored.splice(s,1)}n.authored.unshift(...o),ye(e,n,o)},t.replaceChildren=function(...r){if(t[R])return Mo.apply(this,r);let o=Ko(e,r);for(let s of o)A.add(s);let i=n.authored;n.authored=o.slice(),ye(e,n,[...i,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return tn.get.call(this)},set(r){if(t[R]){tn.set.call(this,r);return}let o=e.ownerDocument.createElement("div");tn.set.call(o,r===null?"":`${r}`);let i=Array.from(o.childNodes);for(let a of i)A.add(a);let s=n.authored;n.authored=i,ye(e,n,[...s,...i])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return pr.get.call(this)},set(r){if(t[R]){pr.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let s of o)A.add(s);let i=n.authored;n.authored=o,ye(e,n,[...i,...o])}})}var Os,Zt=w(()=>{Ge();ze();rn();mr();Ve();Ne();Os=new Set});function Re(e,t,n){let r=F(e),o=q(t),i=Array.isArray(n)?n.filter(Boolean):n?[n]:[],s=r.authored.findIndex(c=>Ce(r,c)===o),a=r.authored.filter(c=>Ce(r,c)===o);r.authored=r.authored.filter(c=>Ce(r,c)!==o),(s===-1||s>r.authored.length)&&(s=r.authored.length);for(let c of i)c.nodeType===1&&!en(r,c)&&(o==null?c.removeAttribute("slot"):c.setAttribute("slot",o)),A.add(c);if(r.authored.splice(s,0,...i),r.applying&&r.pendingRecordNodes){for(let c of a)r.pendingRecordNodes.add(c);for(let c of i)r.pendingRecordNodes.add(c)}else r.pendingRecordNodes=new Set([...a,...i]);if(r.adoptedKey){for(let c of a)r.adoptedKey.delete(c);for(let c of i)r.adoptedKey.delete(c)}ce(r),V(e)}function V(e){if(!Y)return;let t=e[_];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||Os;t.pendingRecordNodes=void 0,wl(e,t,n),_l(e,t),ce(t);let r=[],o=new Set;for(let u of e.querySelectorAll(`slot[${S}]`))if(U(e,u)&&!gt(t,e,u)){if(!u.hasAttribute(O)&&!(Te in u)){o.add(q(u.getAttribute("name")));continue}r.push(u)}let i=new Map;for(let u of r){let f=q(u.getAttribute("name")),d=i.get(f);d||(d=[],i.set(f,d)),d.push(u)}let s=[];for(let[u,f]of i){let d=t.assignedByName.get(u)||[];for(let b=0;b<f.length;b++){let p=f[b],y=d.filter(g=>{let h=en(t,g);return h?h===p:b===0}),m=y.filter(g=>g===e||g.nodeType===1&&g.contains(e));if(m.length){for(let g of m)A.delete(g);y=y.filter(g=>m.indexOf(g)===-1)}y.length>0?zo(t,p,y)&&s.push(p):Go(t,p)&&s.push(p)}}for(let u of s)Yo(t,u);let a=new Set(i.keys());for(let u of o)a.add(u);let c=new Set;for(let u of t.authored)a.has(Ce(t,u))||c.add(u);let l=e[ae];if(l)for(let u of Array.from(l.childNodes))c.has(u)||ke.call(l,u);if(c.size){let u=Rs(e);for(let f of c)f.parentNode!==u&&(A.delete(f),Ye(e,()=>le.call(u,f)))}if(t.backstop){let u=t.backstop.takeRecords();u.length&&nn(e,t,u)}}while(t.reapply)}finally{t.applying=!1}}}function wl(e,t,n){for(let r of e.querySelectorAll(`slot[${S}][${O}="${M}"]`)){if(!U(e,r)||gt(t,e,r))continue;let o=r,i=t.lastSnapshot.get(o);if(!i)continue;let s=Array.from(o.childNodes);if(yr(s,i))continue;let a=t.authored,c=q(o.getAttribute("name")),l=s.filter(p=>!n.has(p));for(let p of l)a.indexOf(p)===-1&&Ce(t,p)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(p,c));for(let p of a){if(l.indexOf(p)!==-1||Ce(t,p)!==c)continue;let y=a.indexOf(p),m=0;for(let g=0;g<l.length;g++){let h=a.indexOf(l[g]);h!==-1&&h<y&&(m=g+1)}l.splice(m,0,p)}let u=new Set(l);for(let p of i)u.add(p);let f=-1,d=0;for(let p of a){if(u.has(p)){f===-1&&(f=d);continue}d+=1}let b=a.filter(p=>!u.has(p));(f===-1||f>b.length)&&(f=b.length),b.splice(f,0,...l),t.authored=b}}function _l(e,t){let n=e[ae];t.authored=t.authored.filter(r=>{if(A.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(S)&&(t.lastSnapshot.has(o)||e.contains(o)&&U(e,o)))})}var rn=w(()=>{Ge();Zt();ze();mr();Ve();Ne()});function Ps(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function Is(){if(Ls||(Y=Ps(),!Y))return;on=HTMLSlotElement.prototype.assignedNodes,Jo=HTMLSlotElement.prototype.assignedElements,gr=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(S)&&!Qo(this)?Zo(this,n):on?on.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(S)&&!Qo(this)?Zo(this,n).filter(r=>r.nodeType===1):Jo?Jo.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=gr&&gr.get?gr.get.call(this):null;return n||js(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||js(this)}}),Xo=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(S)&&!Qo(this)){let r=Sl(this);if(r){let o=F(r);o.manualAssign||(o.manualAssign=new Map);let i=n.filter(Boolean);for(let[s,a]of o.manualAssign){if(s===this)continue;let c=a.filter(l=>{let u=l.deref();return u!==void 0&&i.indexOf(u)===-1});c.length!==a.length&&(c.length?o.manualAssign.set(s,c):o.manualAssign.delete(s))}if(i.length?o.manualAssign.set(this,i.map(s=>new WeakRef(s))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let s of i)o.pendingRecordNodes.add(s);else o.pendingRecordNodes=new Set(i);ce(o),V(r)}return}return Xo?Xo.apply(this,n):void 0},Ls=!0}function en(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let i=!1,s=o.filter(a=>{let c=a.deref();return c===void 0?!1:(c===t&&(i=!0),!0)});if(s.length!==o.length&&(s.length?n.set(r,s):n.delete(r)),i){let a=e.host;return a&&(r===a||a.contains(r))?r:null}}return null}function Sl(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[_])return U(t,e)?t:null;return null}function Qo(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.nodeType===11&&r.host)return!0;t=r}return!1}function Zo(e,t){if(e.getAttribute(O)!==M)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:ei(n,new Set,0)}function ei(e,t,n){if(n>=Ts)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let i=o;if(t.has(i))continue;if(t.add(i),i.hasAttribute(S)){let s=Zo(i,{flatten:!1});if(s.length>0)for(let a of ei(s,t,n+1))r.push(a);else for(let a of ei(Array.from(i.childNodes),t,n+1))r.push(a)}else if(on){let s=on.call(i,{flatten:!0});for(let a of s)r.push(a)}else r.push(o)}else r.push(o);return r}function js(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(S)&&t.getAttribute(O)===M?t:null}var Y,on,Jo,gr,Xo,Ls,ze=w(()=>{Ge();rn();Ve();Ne();Y=Ps(),on=null,Jo=null,gr=null,Xo=null,Ls=!1;Is()});function ti(e){if(!Y)return!1;for(let t of e.querySelectorAll(`slot[${S}][${O}]`))if(U(e,t))return!0;return!1}function U(e,t){let n=t[We];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(ko):null;if(r){let o=Al(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 Al(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 zo(e,t,n){for(let l of n)A.delete(l);let r=t.getAttribute(O)!==M,o=e.lastSnapshot.get(t)||[],i=r||!yr(o,n);if(!r&&yr(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),i;let s=t[Te];if(r&&s)for(;t.firstChild;)s.appendChild(t.firstChild);let a=new Set(n);for(let l of Array.from(t.childNodes))a.has(l)||t.removeChild(l);let c=t.firstChild;for(let l of n){if(l===c){c=c.nextSibling;continue}t.insertBefore(l,c)}return t.setAttribute(O,M),e.lastSnapshot.set(t,n.slice()),i}function Go(e,t){let n=t.getAttribute(O)===M;if(t.setAttribute(O,Co),!n)return Ms(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Ms(t),!0}function Ms(e){let t=e[Te];!t||t.childNodes.length===0||e.appendChild(t)}function ni(e,t){if(!Qt(e))return;let n=F(e),r=q(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let i of o)i.parentNode===t&&(A.add(i),t.removeChild(i));n.lastSnapshot.delete(t)}function Fs(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function Yo(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)Fs(r)}))}function yr(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 Ge=w(()=>{ze();Ve();Ne()});var Xe=w(()=>{Ge();Zt();ze();rn();mr();Ve();Ne()});function pa(e,t,n){fu.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function wi(e){return JSON.stringify(await ha(e))}function rt(e){return ma(JSON.parse(e))}async function ha(e){let t=du();return await pu(e,t),nt(e,t)}function ma(e){return je(e,yu())}function du(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function pu(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!wu(r))continue;let o=t.refCount.get(r)||0;if(t.refCount.set(r,o+1),!(o>0)){if(typeof Blob<"u"&&r instanceof Blob){let i=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,i);continue}if(typeof FormData<"u"&&r instanceof FormData){let i=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,i);for(let[,s]of i)typeof s!="string"&&n.push(s);continue}if(Array.isArray(r))for(let i=0;i<r.length;i++)n.push(r[i]);else if(r instanceof Map)for(let[i,s]of r)n.push(i),n.push(s);else if(r instanceof Set)for(let i of r)n.push(i);else if(_u(r))for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&n.push(r[i])}}for(let[r,o]of t.refCount)o>1&&t.idOf.set(r,t.nextId++)}function nt(e,t){if(e===null)return null;if(e===void 0)return{[k]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[k]:"NaN"}:e===1/0?{[k]:"Inf"}:e===-1/0?{[k]:"-Inf"}:Object.is(e,-0)?{[k]:"-0"}:e;if(n==="bigint")return{[k]:"BigInt",v:e.toString()};if(n==="symbol"){let i=Symbol.keyFor(e);if(i===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[k]:"Sym",v:i}}if(n==="function")throw new TypeError("Cannot serialize a function.");let r=t.idOf.get(e);if(r!==void 0&&t.emitted.has(r))return{[k]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[k]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[k]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let i=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[k]:"File",v:pn(i),n:e.name,t:e.type||"",m:e.lastModified}:o={[k]:"Blob",v:pn(i),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let i=t.fdEntries.get(e)||[...e.entries()],s=[];for(let[a,c]of i)s.push([a,nt(c,t)]);o={[k]:"FD",v:s}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=hu(e);else if(e instanceof Map){let i=[];for(let[s,a]of e)i.push([nt(s,t),nt(a,t)]);o={[k]:"Map",v:i}}else if(e instanceof Set){let i=[];for(let s of e)i.push(nt(s,t));o={[k]:"Set",v:i}}else if(Array.isArray(e))o=e.map(i=>nt(i,t));else{o={};for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let s=Su(i)?"_"+i:i;pa(o,s,nt(e[i],t))}}if(r!==void 0){if(Array.isArray(o))return{[k]:"Arr",_id:r,v:o};o._id=r}return o}function hu(e){if(e instanceof ArrayBuffer)return{[k]:"buf",v:pn(new Uint8Array(e))};if(e instanceof DataView)return{[k]:"dv",v:pn(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=mu[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[k]:n,v:pn(r)}}function yu(){return{refs:new Map}}function je(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let i=[];for(let s=0;s<e.length;s++)i.push(je(e[s],t));return i}let n=e[k];if(typeof n=="string")return gu(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i)||i==="_id")continue;let s=Au(i)?i.slice(1):i;pa(r,s,je(e[i],t))}return r}function gu(e,t,n){let r=e._id,o=i=>(typeof r=="number"&&n.refs.set(r,i),i);switch(t){case"undef":return;case"NaN":return NaN;case"Inf":return 1/0;case"-Inf":return-1/0;case"-0":return-0;case"BigInt":return o(BigInt(e.v));case"Sym":return o(Symbol.for(e.v));case"Date":return o(e.v==null?new Date(NaN):new Date(e.v));case"Error":{let i=new Error(e.v.message);return i.name=e.v.name,e.v.stack&&(i.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,i),i}case"Map":{let i=new Map;typeof r=="number"&&n.refs.set(r,i);for(let[s,a]of e.v)i.set(je(s,n),je(a,n));return i}case"Set":{let i=new Set;typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.add(je(s,n));return i}case"Arr":{let i=[];typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.push(je(s,n));return i}case"Ref":{let i=n.refs.get(e.v);if(i===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return i}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let i=dn(e.v);return o(new Blob([i],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let i=dn(e.v);return o(new File([i],e.n,{type:e.t||"",lastModified:e.m}))}case"FD":{if(typeof FormData>"u")throw new TypeError("FormData is not available in this environment.");let i=new FormData;o(i);for(let[s,a]of e.v){let c=je(a,n);i.append(s,c)}return i}default:{if(t==="buf"){let s=dn(e.v);return o(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength))}if(t==="dv"){let s=dn(e.v);return o(new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)))}let i=bu[t];if(i){let s=dn(e.v),a=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);return o(new i(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function wu(e){return e!==null&&typeof e=="object"}function _u(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Su(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function Au(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function pn(e){if(ba)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 dn(e){if(ba){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 k,fu,mu,bu,ba,hn=w(()=>{k="_$wj",fu=new Set(["__proto__","constructor","prototype"]);mu={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},bu={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};ba=typeof Buffer<"u"&&typeof Buffer.from=="function"});var ja={};ls(ja,{observeLazy:()=>Wu,observeViewportOnce:()=>Gu});function La(e){let t=vi.get(e);return t||(t=import(e).finally(()=>vi.delete(e)),vi.set(e,t),t)}function Wu(e){for(let[t,n]of Object.entries(e))Pe.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of Pe.values())La(t);Pe.clear();return}gn||(gn=new IntersectionObserver(Vu,{rootMargin:"200px"})),Oa(),!Ai&&typeof MutationObserver<"u"&&(Ai=new MutationObserver(()=>Oa()),Ai.observe(document.body,{childList:!0,subtree:!0}))}function Oa(){if(!(!gn||!Pe.size))for(let e of Pe.keys()){if(customElements.get(e)){Pe.delete(e);continue}for(let t of document.querySelectorAll(e))gn.observe(t)}}function Vu(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=Pe.get(n);r&&(La(r),Pe.delete(n),gn?.unobserve(t.target))}}function zu(e){for(let t of e){if(!t.isIntersecting)continue;let n=Lr.get(t.target);Lr.delete(t.target),yn?.unobserve(t.target),n&&n()}}function Gu(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(yn||(yn=new IntersectionObserver(zu,{rootMargin:"200px"})),Lr.set(e,t),yn.observe(e),()=>{Lr.delete(e),yn?.unobserve(e)})}var Pe,gn,Ai,vi,yn,Lr,Pa=w(()=>{Pe=new Map,gn=null,Ai=null,vi=new Map;yn=null,Lr=new WeakMap});var xi,Ei=w(()=>{xi=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(()=>(Pa(),ja)).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(()=>(jr(),Ia)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&xi&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",xi)});function Ju(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 Ni(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let i=n.createElement("template");i.innerHTML=e,r=i.content}else if(e&&e.nodeType)r=e;else return;let o=r.querySelectorAll?Array.from(r.querySelectorAll("webjs-stream")):[];if(o.length)for(let i of o)n.body.append(i);else n.body.append(r)}var Yu,Ti,wn=w(()=>{Yu=new Set(["append","prepend","before","after","replace","update"]);Ti=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this._webjsApplied||(this._webjsApplied=!0,this._webjsApply())}_webjsApply(){let t=(this.getAttribute("action")||"").toLowerCase(),n=this.ownerDocument||document,r=[],o=this.getAttribute("target");if(o){let s=n.getElementById(o);s&&(r=[s])}else{let s=this.getAttribute("targets");if(s)try{r=Array.from(n.querySelectorAll(s))}catch{r=[]}}let i=Yu.has(t)?this.querySelector("template"):null;try{for(let s of r){let a=i?i.content.cloneNode(!0):null;Ju(t,s,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&Ti&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",Ti)});var Ma,Fa=w(()=>{Ma=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&Ma&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",Ma)});function Pr(e,t){let n=typeof document<"u"?document:null,r=e||n;if(!r||typeof r.querySelectorAll!="function")return;if(t&&t.frame===!0){Ci(r,!0);return}Da();let o=r===n,i=!!n&&!o&&typeof n.contains=="function"&&n.contains(r),s=!!n&&!o&&!i;s&&(Ci(n,!0),Ie.clear(),Ri.clear()),(o||s)&&(ki=!0);let a=j.ingested+j.replaced;Zu(Ci(r),a)}function Ci(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=Qu(r.getAttribute?.("data-webjs-dev"));o!==null&&(n=o),$a(t?null:r.textContent,r)}for(let r of e.querySelectorAll("[data-webjs-seed]"))$a(t?null:r.getAttribute("data-webjs-seed"),r,()=>r.removeAttribute("data-webjs-seed"));return n}function $a(e,t,n){if(e)try{let r=rt(e);if(r&&typeof r=="object")for(let o in r){Ie.has(o)?j.replaced++:j.ingested++,Ie.set(o,r[o]);let i=o.indexOf("/",o.indexOf("/")+1);i>0&&Ri.add(o.slice(0,i))}}catch{}n?n():t.remove?.()}function Qu(e){return typeof e!="string"?null:e||"ok"}function Zu(e,t){if(e===null)return;let n=++Xu;Ct={epoch:n,hits:j.hits,misses:j.misses,keyMisses:j.keyMisses,merged:t,marker:e};let r=()=>{!Ct||Ct.epoch!==n||Da()};try{typeof requestIdleCallback=="function"?requestIdleCallback(r,{timeout:1e3}):setTimeout(r,250)}catch{Ct=null}}function Da(){let e=Ct;if(Ct=null,!!e)try{ef(e)}catch{}}function ef(e){let t=j.hits-e.hits,n=j.misses-e.misses,r=j.ingested+j.replaced-e.merged,o=j.keyMisses-e.keyMisses;if(n===0)return;let i=e.marker==="streamed"?"This page streams (a Suspense or <webjs-suspense> boundary), and a streamed render emits no seeds, so every action call on it goes to the network.":e.marker==="drop"?"The page's seeds could not be serialized, so the whole block was dropped. Something an action returned is not serializer-safe; the server response reports collected above emitted.":o===0?null:"The key is the action file hash plus the function name plus the serialized arguments, so an argument the SSR render never used misses (a deliberate refetch after hydration misses too, and is expected). A miss on an action this page never seeded is NOT counted here, because a mutation or a client-only read could never have been seeded.";if(i===null)return;let a=e.marker==="streamed"||e.marker==="drop"?`${n} of ${t+n} action call(s) in the hydration window went to the network`:`${o} action call(s) in the hydration window asked for a key this page seeded under DIFFERENT arguments`;console.warn(`[webjs] SSR action seeding: ${a} (${r} seed(s) on this page, ${Ie.size} still unconsumed). ${i} See https://webjs.dev/docs/data-fetching for the seeding reference.`)}function tf(e,t,n){ki||(ki=!0,Pr());let r=`${e}/${t}/${n}`;if(Ie.has(r)){let o=Ie.get(r);return Ie.delete(r),j.hits++,o}return j.misses++,Ri.has(`${e}/${t}`)&&j.keyMisses++,Ba}function nf(){return{...j,pending:Ie.size}}var Ie,Ba,ki,j,Ri,Ct,Xu,Ir=w(()=>{hn();Ie=new Map,Ba=Symbol("webjs.seed.miss"),ki=!1,j={ingested:0,replaced:0,hits:0,misses:0,keyMisses:0},Ri=new Set,Ct=null,Xu=0});function Oi(e){if(!(!Array.isArray(e)||!e.length)){Mr+=1;for(let t of e)t&&Ha.set(t,Mr)}}function of(){return Mr}function sf(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(kt.delete(e),kt.set(e,{tags:t.slice(),since:typeof n=="number"?n:Mr}),kt.size>rf)){let r=kt.keys().next().value;r!==void 0&&kt.delete(r)}}function af(e){let t=kt.get(e);if(!t)return!1;for(let n of t.tags)if((Ha.get(n)||0)>t.since)return!0;return!1}function Li(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var Mr,Ha,kt,rf,Fr=w(()=>{Mr=0,Ha=new Map,kt=new Map,rf=1e3});function Ua(e){return Rt.test(e)}var ji,Pi,Rt,_n,ot,ge,$r,qa,$=w(()=>{ji="text/vnd.webjs-stream.html",Pi=["wheel","touchmove","keydown","pointerdown"],Rt=/\.(?: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,_n="_top",ot="webjs:nav-fallback",ge=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]),$r="name=csp-nonce";qa=250});function Me(e,t,n="warn"){if(Ii.has(e)||(Ii.add(e),typeof console>"u"))return;let r=n==="error"?console.error:console.warn;r&&r.call(console,t)}function Wa(e,t,n,r){if(typeof process<"u"&&process.env||!r.has(I))return;let o="";try{o=new URL(e.getAttribute("action")||location.href,location.href).pathname}catch{o=location.pathname}if(n!=="post"){Me(`submit-nowhere:${o}:${n}`,`[webjs] this submission carries a bound server action's identity but submits as ${n.toUpperCase()}, which sends no body, so the identity rides the query string and the action never runs. A submitter's own formmethod overrides the form's, and WebJs honours it rather than refusing it, so check for a formmethod on the button that was pressed.`,"error");return}let i=t&&t.getAttribute("formenctype")||e.getAttribute("enctype")||"application/x-www-form-urlencoded";if(i.toLowerCase()==="text/plain"){Me(`submit-nowhere:${o}:${i}`,`[webjs] this submission carries a bound server action's identity but declares enctype="${i}", which the server cannot parse. The router declines to send it so both paths behave the same way, and both are answered with a 405. Drop the enctype and let the binding supply it.`,"error");return}o&&o!==location.pathname&&Me(`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 Br(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 Va(){if(typeof location>"u"||Ka)return;Ka=!0;let e=null;try{e=sessionStorage.getItem(ot),sessionStorage.removeItem(ot)}catch{}let t="";try{let n=performance.getEntriesByType("navigation")[0];t=n?n.type:""}catch{}Br(t,document.referrer,location.href,e)&&ne("pre-boot-navigation",location.href,!1)}function ne(e,t,n=!0){if(n)try{sessionStorage.setItem(ot,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||Me(`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 za(e){typeof process<"u"&&process.env||Me(`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 Ga(){if(typeof process<"u"&&process.env||Mi||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;Mi=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&Me("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 Sn(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 Ya(){Ii.clear(),Mi=!1}function Ja(e,t){return Fi(e,t)}var Ii,Ka,Mi,re=w(()=>{Ee();$();Ii=new Set;Ka=!1;Mi=!1});function oe(e){let t=new Map,n=[],r=!1;function o(i){if(!r){if(i.nodeType===8){let s=i.data.trim();if(s.startsWith("wj:children:")){let a=s.slice(12),c=a.lastIndexOf(":");if(c<=0||c===a.length-1){r=!0;return}let l=a.slice(0,c),u=a.slice(c+1);if(t.has(l)||n.some(f=>f.segment===l)){r=!0;return}n.push({segment:l,routeKey:u,start:i});return}if(s.startsWith("/wj:children")){let a=s.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==i.parentNode){r=!0;return}{let l=c.start.parentNode.tagName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TFOOT"||l==="TR"){r=!0;return}}t.set(c.segment,{routeKey:c.routeKey,start:c.start,end:i});return}return}if(i.hasChildNodes&&i.hasChildNodes())for(let s=i.firstChild;s&&!r;s=s.nextSibling)o(s)}}return o(e),r||n.length>0?null:t}function An(e,t){let n=[...e.keys()].filter(s=>t.has(s)).sort((s,a)=>s.length-a.length);if(n.length===0)return null;for(let s of n)if(e.get(s).routeKey!==t.get(s).routeKey){let a=null;for(let c of n){if(c===s)break;s.startsWith(c==="/"?c:c+"/")&&(a=c)}return a?{mode:"replace",segment:a,live:e.get(a),incoming:t.get(a)}:null}let r=n[n.length-1],o=s=>{let a=null;for(let c of s.keys())(a===null||c.length>a.length)&&(a=c);return a};return{mode:o(e)===r&&o(t)===r?"morph":"replace",segment:r,live:e.get(r),incoming:t.get(r)}}function de(){let e=oe(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}var Fe=w(()=>{});function Xa(e){pe=e||(t=>{location.href=t})}function Qa(){return E}function Za(){return++E}function Dr(){return++E}function $i(e){z=e}function ec(e){vn=e}function tc(e){let t=vn!==null&&vn===e;return vn=null,t}function Hr(){vn=null}var E,pe,z,vn,we=w(()=>{E=0,pe=e=>{location.href=e};z=!1;vn=null});function it(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"&&cf()?Document.parseHTMLUnsafe(e):lf(e)}function cf(){if(Ot!==null)return Ot;try{Ot=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{Ot=!1}return Ot}function Bi(){Ot=null}function lf(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}var Ot,xn=w(()=>{Ot=null});function Ur(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Di(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}var qr=w(()=>{});function En(e,t){return((t&&t.hasAttribute("formmethod")?t.getAttribute("formmethod")||"":e.getAttribute("method")||"")||"get").toLowerCase()}function Tn(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function uf(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 Nn(e,t){return uf(t&&t.hasAttribute("formenctype")?t.getAttribute("formenctype"):e.getAttribute("enctype"))}function Cn(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 kn(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}}var Kr=w(()=>{});function nc(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function Rn(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=nc();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Hi(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=nc();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function he(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Wr(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 ff(e){if(!e.querySelector("meta"))return;let t=o=>{let i=new Map;for(let s of o.querySelectorAll("meta")){let a=Wr(s);if(!a||a===$r)continue;let c=i.get(a);c?c.push(s):i.set(a,[s])}return i},n=t(e),r=t(document.head);for(let[o,i]of n){let s=r.get(o)||[],a=i.map(he).join(`
|
|
2
2
|
`),c=s.map(he).join(`
|
|
3
|
-
`);if(a!==c){if(i.length===1&&s.length===1){let l=s[0];for(let u of[...l.attributes])l.removeAttribute(u.name);for(let u of i[0].attributes)l.setAttribute(u.name,u.value);continue}for(let l of s)l.remove();for(let l of i)document.head.appendChild(Hi(l))}}for(let[o,i]of r)if(!n.has(o))for(let s of i)s.remove()}function Rt(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(he(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(r.tagName==="META"&&Wr(r)||n.has(he(r))||(r.tagName==="SCRIPT"?document.head.appendChild(Cn(r)):document.head.appendChild(Hi(r))));Vu(e)}function zu(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function kn(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let i of t.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&r.add(he(i));let o=new Set;for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&o.add(he(i));for(let i of[...t.children])i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(zu(i)||i.tagName==="META"&&Wr(i)===Fr||o.has(he(i))||i.remove());for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(i.tagName==="META"&&Wr(i)===Fr||r.has(he(i))||(i.tagName==="SCRIPT"?t.appendChild(Cn(i)):t.appendChild(Hi(i))))}var Rn=w(()=>{B()});function zr(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 ie(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===gn)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Me(`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 zr(e)}function Ui(e){if(!e||typeof document>"u")return null;let t=null;try{t=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{t=document.getElementById(e)}return!t||!t.tagName||t.tagName.toLowerCase()!=="webjs-frame"?null:t}function On(e,t){let n=Ui(e);if(!n)return null;let r=Kr.has(n);return Kr.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 Ln(e,t){if(Kr.get(e)!==t)return;Kr.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 jn(e,t,n){let r=Vr.has(e);return Vr.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 Pn(e,t,n,r){if(Vr.get(e)!==t)return;Vr.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 qi(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+=he(r);return n}var Kr,Vr,Be=w(()=>{B();re();Rn();Kr=new WeakMap;Vr=new WeakMap});function Qa(e,t){if(typeof document>"u"||!document.documentElement)return()=>{};J&&J();let n=document.documentElement,r=n.style.getPropertyValue("overflow-anchor");n.style.setProperty("overflow-anchor","none");let o=null,i=typeof t=="number",a=i&&typeof setTimeout=="function"?setTimeout(()=>{i=!1},Ma):null,c=typeof t=="number"&&typeof window<"u"?()=>{i&&(Math.abs(window.scrollY-t)<=1&&Math.abs(window.scrollX-(e||0))<=1||window.scrollTo({left:e||0,top:t,behavior:"instant"}))}:null,l=()=>{if(J===l){if(J=null,o&&(clearTimeout(o),o=null),a&&clearTimeout(a),i=!1,typeof window<"u"){for(let u of Pi)window.removeEventListener(u,l,{capture:!0});c&&window.removeEventListener("scroll",c)}r?n.style.setProperty("overflow-anchor",r):n.style.removeProperty("overflow-anchor")}};if(J=l,o=setTimeout(l,2e3),typeof window<"u"){for(let u of Pi)window.addEventListener(u,l,{capture:!0,passive:!0});c&&window.addEventListener("scroll",c,{passive:!0})}return l}function Za(e){if(typeof document>"u"||!document.documentElement)return()=>{};if(X&&X(),!(e>0))return()=>{};let t=document.documentElement,n=t.style.getPropertyValue("min-height");t.style.setProperty("min-height",e+"px");let r=null,o=()=>{X===o&&(X=null,r&&(clearTimeout(r),r=null),n?t.style.setProperty("min-height",n):t.style.removeProperty("min-height"))};return X=o,r=setTimeout(o,2e3),o}function Yr(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function Jr(){Gr+=1}function In(e,t){let n=Ja(e)||Ja(t);return n?(n.getAttribute("data-preserve-scroll")||"").toLowerCase().trim()!=="false":!1}function Ja(e){return!e||typeof e.closest!="function"?null:e.closest("[data-preserve-scroll]")}var J,X,Gr,Xr=w(()=>{B();J=null;X=null;Gr=0});function Wi(e){if(!z||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Hr(e);if(!t||t.hasAttribute("download")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin)return;if(r.pathname===location.pathname&&r.search===location.search&&r.href.includes("#")){za(r.href);return}if(t.hasAttribute("data-no-router")||Ct.test(r.pathname))return;e.preventDefault();let o=ie(t);Mn(n,!1,o,{preserveScroll:In(t)})}function Ot(e){ec(location.href)||Mn(location.href,!0,null)}function Lt(e){if(!z||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=vn(t,n);if(o==="dialog")return;let i=En(t,n),s=o==="get"||o==="head",a=xn(t,n),c;try{c=new URL(a,location.href)}catch{return}if(c.origin!==location.origin||Ct.test(c.pathname))return;let l=Nn(t,n);if(Ba(t,n,o,l),!s&&i==="text/plain")return;let u=Tn(l,i);e.preventDefault();let f=ie(n||t),d=In(n||t,t);tc(c.href,o,u,f,t,{preserveScroll:d})}var Qr=w(()=>{Ur();B();we();re();qr();Be();Xr();Fn()});function Ki(e){let t=me(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),E.has(t)&&E.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0,scrollHeight:typeof document<"u"&&document.documentElement&&document.documentElement.scrollHeight||0};for(E.set(t,n);E.size>16;){let r=E.keys().next().value;E.delete(r)}}function nc(e){let t=me(e),n=E.get(t);return n==null?null:(E.delete(t),E.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0,scrollHeight:0}:n)}function me(e,t){let n=new URL(e,location.href),r=n.pathname+n.search;return t?`${t} ${r}`:r}var E,jt=w(()=>{B();E=new Map});function ef(e){let t=be.get(e);return t==null?!1:Un()-t>=Vi?(be.delete(e),!1):!0}function Dt(){be.clear()}function tf(e){for(be.has(e)&&be.delete(e),be.set(e,Un());be.size>Zu;)be.delete(be.keys().next().value)}function qn(){try{let e=typeof navigator<"u"?navigator.connection:null;if(e&&(e.saveData===!0||typeof e.effectiveType=="string"&&/2g$/.test(e.effectiveType))||typeof matchMedia=="function"&&matchMedia("(prefers-reduced-data: reduce)").matches)return!0}catch{}return!1}function Zr(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function nf(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function Ft(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.href.includes("#")||Ct.test(n.pathname)?null:t}function eo(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=nf(e);return t.includes("external")||t.includes("no-prefetch")}function Bt(e){if(eo(e))return"none";switch((e.getAttribute("data-prefetch")||"").toLowerCase().trim()){case"false":case"none":return"none";case"true":case"render":return"render";case"auto":case"viewport":return"viewport";case"intent":return"intent";default:return Zr()?"intent":"viewport"}}function $e(e,t){if(!z||typeof fetch!="function"||qn())return;let n=me(e,t);if(typeof location<"u"&&n===me(location.href,t)||_e.has(n)||Bn.has(n))return;let r=v.get(n);if(r&&Un()-r.at<Vi||ef(n))return;if(_e.size>=rc){for(Bn.add(n),It.push({href:e,frameId:t||null});It.length>Ju;){let s=It.shift();Bn.delete(me(s.href,s.frameId))}return}let o=de();if(!o&&typeof document<"u"&&document.readyState==="loading")return;_e.add(n);let i={"x-webjs-router":"1","x-webjs-prefetch":"1"};o&&(i["x-webjs-have"]=o),t&&(i["x-webjs-frame"]=t),fetch(e,{method:"GET",headers:i,credentials:"same-origin",cache:"no-cache"}).then(async s=>{let a=s.headers.get("content-type")||"";if(!/^text\/html\b/i.test(a)||s.status>=400)return;let c=s.headers.get("x-webjs-build"),l=s.headers.get("x-webjs-src"),u=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,f=u?u.getAttribute("data-webjs-build"):null,d=u?u.getAttribute("data-webjs-src"):null;if((c&&f&&c!==f||l&&d&&l!==d)&&(E.clear(),st(n),Dt()),(s.headers.get("x-webjs-frame")||null)!==(t||null)){tf(n);return}let p=s.redirected&&s.url?s.url:e,y=await s.text();Hn.has(n)||of(n,{html:y,build:c,src:l,finalUrl:p,frameId:t||null,at:Un()})}).catch(()=>{}).finally(()=>{_e.delete(n),Hn.delete(n),rf()})}function rf(){for(;It.length&&_e.size<rc;){let{href:e,frameId:t}=It.shift();Bn.delete(me(e,t)),$e(e,t)}}function of(e,t){for(v.has(e)&&v.delete(e),v.set(e,t);v.size>Yu;){let n=v.keys().next().value;v.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function to(e){let t=/<!--wj:children:([^>]*?)-->/.exec(e||"");return t?t[1]:null}function Wn(e,t,n){let r=me(e,n),o=v.get(r);if(!o)return null;if(Un()-o.at>=Vi)return v.delete(r),null;if(o.frameId)return v.delete(r),Ui(o.frameId)?o:null;let i=to(o.html);return i&&!new Set(String(t??(de()||"")).split(",").filter(Boolean)).has(i)?(v.delete(r),null):(v.delete(r),o)}function Un(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function it(e){if(!z)return;let t=$i(e.target);if(!t)return;let n=Bt(t);if(n==="none"||n==="render")return;let r=Ft(t);if(r){if(e.type==="touchstart"){$e(r,ie(t));return}n==="intent"&&(Dn===t&&Mt||(Kn(),Dn=t,Mt=setTimeout(()=>{Mt=null,Dn=null,$e(r,ie(t))},Xu)))}}function zi(e){let t=$i(e.target);t&&t===Dn&&Kn()}function Kn(){Mt&&(clearTimeout(Mt),Mt=null),Dn=null}function no(){for(let e of $n)clearTimeout(e);$n.clear(),Pt=new WeakMap}function ro(){if(typeof document>"u"||qn())return;let e=typeof IntersectionObserver<"u";e&&(De?(De.disconnect(),no()):De=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(Pt.has(r))continue;let o=setTimeout(()=>{$n.delete(o),Pt.delete(r),De.unobserve(r);let i=Ft(r);i&&Bt(r)==="viewport"&&$e(i,ie(r))},Qu);Pt.set(r,o),$n.add(o)}else{let o=Pt.get(r);o&&(clearTimeout(o),$n.delete(o),Pt.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=Bt(t);if(n==="render"){let r=Ft(t);r&&$e(r,ie(t))}else n==="viewport"&&e&&De.observe(t)}}function st(e){v.clear();for(let t of _e)t!==e&&Hn.add(t)}function oc(e,t){let n=me(e,t);v.delete(n),_e.has(n)&&Hn.add(n)}function ic(e,t){return v.get(me(e,t))||null}function sc(){return _e.size}function ac(){v.clear(),be.clear(),_e.clear(),Hn.clear(),It.length=0,Bn.clear(),Kn(),no()}function cc(){De&&(De.disconnect(),De=null)}var Yu,Vi,rc,Ju,Xu,Qu,v,be,Zu,_e,Hn,It,Bn,Mt,Dn,De,Pt,$n,at=w(()=>{Ur();Fe();B();Be();we();jt();Yu=8,Vi=3e4,rc=3,Ju=24,Xu=100,Qu=250,v=new Map,be=new Map,Zu=16;_e=new Set,Hn=new Set,It=[],Bn=new Set,Mt=null,Dn=null,De=null,Pt=new WeakMap,$n=new Set});function Gi(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 Vn(e){if(!e.body||typeof e.body.getReader!="function")return{shell:await e.text(),streaming:!1};let t=e.body.getReader(),n=new TextDecoder,r="",o="<template data-webjs-resolve",i="<!--wj-stream-shell-->",s=/<\/html\s*>/i;for(;;){let{value:a,done:c}=await t.read();a&&(r+=n.decode(a,{stream:!0})),c&&(r+=n.decode());let l=r.indexOf(i);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+i.length)};let u=r.indexOf(o);if(u!==-1)return{shell:r.slice(0,u),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(u)};if(c)return{shell:r,streaming:!1};let f=s.exec(r);if(f){let d=f.index+f[0].length;return{shell:r.slice(0,d),streaming:!0,reader:t,dec:n,rest:r.slice(d)}}}}function oo(e){let t=/<template\s+data-webjs-resolve="([^"]+)"\s*>/i.exec(e);if(!t)return null;let n=t[1],r=t.index+t[0].length,o=/<(\/?)template\b[^>]*>/gi;o.lastIndex=r;let i=1,s;for(;s=o.exec(e);)if(s[1]==="/"){if(i--,i===0)return{id:n,content:e.slice(r,s.index),rest:e.slice(s.index+s[0].length)}}else i++;return null}function io(e,t){let n=document.getElementById(e);if(!n){$a(e);return}let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];n.replaceWith(r.content);for(let i of o)i.nodeType===1&&so(i)}async function zn(e,t,n,r){let o=n,i=()=>{let s;for(;s=oo(o);){if(!r())return!1;io(s.id,s.content),o=s.rest}return!0};if(!e){i();return}try{for(;;){if(!i()){try{await e.cancel()}catch{}return}let{value:s,done:a}=await e.read();if(s&&(o+=t.decode(s,{stream:!0})),a){o+=t.decode(),i();return}}}catch{}}var Gn=w(()=>{re();ct()});function Ht(){if(typeof document>"u")return!1;let e=document.querySelector('meta[name="view-transition"]');return e?(e.getAttribute("content")||"").trim().toLowerCase()==="same-origin":!1}function lt(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(Ht()&&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 Yn(e,t){if(!e||!t||typeof e.querySelectorAll!="function")return;let n=e.querySelectorAll("[data-webjs-permanent][id]");for(let r of n){let o=r.id;if(!o)continue;let i=null;try{i=t.querySelector(`#${CSS.escape(o)}`)}catch{i=null}if(!i||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let s=i.parentNode;s&&i!==r&&(s.replaceChild(r,i),$t.add(r))}}function Se(e,t){let n=[];for(let r of e){if(r.nodeType!==1)continue;let o=r;if(o.hasAttribute&&o.hasAttribute("data-webjs-permanent")&&o.id&&n.push(o),typeof o.querySelectorAll=="function")for(let i of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(i)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let i=sf(t,o);if(!i||i===r)continue;let s=i.parentNode;if(s)s.replaceChild(r,i),$t.add(r);else{let a=t.indexOf(i);a!==-1&&(t[a]=r,$t.add(r))}}}function sf(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}var $t,ut=w(()=>{$t=new WeakSet});function lc(e,t){let n=[];for(let r=e.parentNode;r;r=r.parentNode)if(n.unshift(r),r===t)return n;return null}function dc(e,t,n,r){let o=lc(e.start,n),i=lc(t.start,r);if(!o||!i||o.length!==i.length)return null;for(let s=1;s<o.length;s++)if(o[s].tagName!==i[s].tagName||Yi(o[s]))return null;return{live:o,incoming:i,liveRange:e,incomingRange:t}}function uc(e,t,n){let r=[],o=[],i=r;for(let s=e.firstChild;s;s=s.nextSibling)s===t&&(i=null),i&&i.push(s),s===n&&(i=o);return{before:r,after:o}}function af(e,t){for(let n of t.attributes)ge.has(n.name)||n.name==="data-wj-serialized"||e.getAttribute(n.name)!==n.value&&e.setAttribute(n.name,n.value);for(let n of[...e.attributes])ge.has(n.name)||t.hasAttribute(n.name)||e.removeAttribute(n.name)}function cf(e,t){let n=new Map;for(let s of e){if(s.nodeType!==1)continue;let a=Q(s);a&&n.set(a,s)}let r=new Set,o=0,i=[];for(let s of t){if(s.nodeType===1){let c=Q(s),l=c?n.get(c):null;if(l&&!r.has(l)){r.add(l),Ae(l,s),i.push(l),o=Math.max(o,e.indexOf(l)+1);continue}}let a=o;for(;a<e.length;a++){let c=e[a];if(r.has(c)||c.nodeType!==s.nodeType)continue;if(c.nodeType!==1)break;let l=c;if(!Q(l)&&l.tagName===s.tagName)break}if(a<e.length&&(s.nodeType===1||s.nodeType===3||s.nodeType===8)){let c=e[a];r.add(c),c.nodeType===1?Ae(c,s):c.nodeValue!==s.nodeValue&&(c.nodeValue=s.nodeValue),i.push(c),o=a+1;continue}i.push(s)}return i}function fc(e,t,n,r,o){let i=n.map(u=>document.importNode(u,!0));Se(t,i);let s=cf(t,i),a=new Set(s),c=r;if(o){let u=-1;for(let d=0;d<t.length;d++)a.has(t[d])&&(u=d);let f=t.slice(u+1);if(f.length){for(let d of f)a.add(d);c=f[0]}}for(let u of t)!a.has(u)&&u.parentNode===e&&e.removeChild(u);for(let u=s.length-1;u>=0;u--){let f=s[u];(f.parentNode!==e||f.nextSibling!==c)&&e.insertBefore(f,c),c=f}let l=new Set(t);return s.filter(u=>!l.has(u))}function pc(e){let{live:t,incoming:n,liveRange:r,incomingRange:o}=e,i=[];for(let s=0;s<t.length;s++){let a=t[s],c=n[s];s>0&&af(a,c);let l=s===t.length-1,u=l?r.start:t[s+1],f=l?r.end:t[s+1],d=l?o.start:n[s+1],b=l?o.end:n[s+1],p=uc(a,u,f),y=uc(c,d,b),m=[...fc(a,p.before,y.before,u,!1),...fc(a,p.after,y.after,null,s===0)];for(let g of m)g.nodeType===1&&i.push(He(g));for(let g of[p.before,p.after])for(let h of g)h.nodeType===1&&h.isConnected&&i.push(h)}for(let s of i)s.isConnected&&ve(s)}var hc=w(()=>{B();ft();ct();ut()});function ht(e,t,n,r,o,i,s,a){let c=!1,l=()=>{if(!c){c=!0;try{jr(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"]'),y=p?p.getAttribute("data-webjs-build"):null,m=!1;if(o&&y&&(m=o!==y),!m&&e.head&&e.head.children.length>0){let g=qi(document),h=qi(e);g!==h&&(m=!0)}if(m&&typeof location<"u"){E.clear(),st(),Dt();try{let g="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(g))sessionStorage.removeItem(g),ne("deploy-mismatch-reload-suppressed",r,!1);else return sessionStorage&&sessionStorage.setItem(g,"1"),ne("deploy-mismatch",r),pe(r),"none"}catch{return ne("deploy-mismatch",r),pe(r),"none"}}else if(!m){let g=p?p.getAttribute("data-webjs-src"):null;i&&g&&i!==g&&(E.clear(),st(),Dt(),p&&p.setAttribute("data-webjs-src",i));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){l();let p=document.querySelector(`webjs-frame#${CSS.escape(t)}`),y=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(p&&y){a&&a(),Rt(e.head),dt=lt(()=>{wc(p,y),He(p),ve(p),Gi(e.body),pt()},()=>ve(p));return}let m=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});return(p||document).dispatchEvent(m),m.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`),"none"}if(s==="shell"){l(),a&&a(),Ji(e);return}let u=oe(document.body),f=oe(e.body),d=u&&f?_n(u,f):null,b=d&&s==="layouts"?dc(d.live,d.incoming,document.body,e.body):null;if(d&&s==="layouts"&&!b){l(),a&&a(),Ji(e);return}if(d){l(),a&&a();let{mode:p,live:y,incoming:m}=d;Rt(e.head),dt=lt(()=>{p==="replace"?bc(y,m):yc(y,m,e),gc(y.start,m.start),b&&pc(b),Gi(e.body),pt()},()=>mc(y));return}if(r&&!n&&typeof location<"u")return ne(u?f?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),pe(r),"none";if(r&&n)return ne("revalidation-discarded",r,!1),"discard";l(),a&&a(),Ji(e)}function Ji(e){kn(e.head),Yn(document.body,e.body);let t=[...e.body.childNodes];dt=lt(()=>{document.body.replaceChildren(...t),He(document.body),ve(document.body),pt()},()=>ve(document.body))}var dt,Jn=w(()=>{Pr();Fe();re();ft();Be();Rn();hc();at();jt();we();Gn();ct();ut();dt=Promise.resolve()});function _c(){Xi||typeof MutationObserver>"u"||typeof customElements>"u"||(Xi=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)}}),Xi.observe(document.body,{childList:!0,subtree:!0}))}function mc(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&ve(t)}function ve(e){typeof customElements>"u"||so(e)}function so(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&&so(n.shadowRoot))}function He(e){if(e.tagName==="SCRIPT"){let n=Cn(e);return e.replaceWith(n),n}let t=[];$t.has(e)&&t.push(e);for(let n of e.querySelectorAll("[data-webjs-permanent]"))$t.has(n)&&t.push(n);for(let n of e.querySelectorAll("script"))t.length&&t.some(r=>r!==n&&r.contains(n))||n.replaceWith(Cn(n));return e}function Xn(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=He(n);r.isConnected!==!1&&ve(r)}}var Xi,ct=w(()=>{Fe();B();re();ft();An();Qr();qr();Be();Rn();at();jt();Gn();Jn();ut();Xi=null});function pt(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function bc(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)r.push(i);let o=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)o.push(document.importNode(i,!0));Se(r,o);for(let i of r)i.parentNode===n&&n.removeChild(i);for(let i of o)n.insertBefore(i,e.end);Xn(e)}function yc(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)o.push(s);let i=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)i.push(document.importNode(s,!0));Se(o,i),lf(r,e.start,e.end,o,i),Xn(e)}function lf(e,t,n,r,o){let i=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=Q(c);l&&i.set(l,c)}let s=n,a=[];for(let c of o){if(c.nodeType===1){let l=Q(c);if(l&&i.has(l)){let u=i.get(l);Ae(u,c),a.push(u),i.delete(l);continue}}a.push(c)}for(let c of r)if(c.parentNode===e){if(c.nodeType===1&&a.includes(c))continue;e.removeChild(c)}for(let c of a)e.insertBefore(c,s)}function Ae(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),!ge.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])ge.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(Yi(e)){ff(e,t);return}Ut(e,t)}function Yi(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[_]!=null}function uf(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function ao(e){let t=new Map,n=`slot[${S}][${O}="${M}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!uf(o,e)||Wo(e,o))continue;let i=!1;for(let a=o.parentElement;a&&a!==e;a=a.parentElement)if(a.tagName==="SLOT"&&a.hasAttribute(S)&&a.getAttribute(O)===M){i=!0;break}if(i)continue;let s=q(o.getAttribute("name"));t.has(s)||t.set(s,o)}return t}function gc(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(S))return;let o=null;for(let f=r.parentElement;f;f=f.parentElement){if(f[_]){o=f;break}if(f.tagName.includes("-"))return}if(!o)return;let i=q(r.getAttribute("name"));Re(o,i,[...r.childNodes]);let s=t.parentNode;if(!s||s.nodeType!==1)return;let a=s;if(a.tagName!=="SLOT")return;let c=null;for(let f=a.parentElement;f;f=f.parentElement)if(f.tagName.includes("-")){c=f;break}if(!c||c.tagName!==o.tagName)return;let l=ao(o),u=ao(c);for(let f of new Set([...l.keys(),...u.keys()])){if(f===i)continue;let d=u.get(f);d?Re(o,f,[...d.childNodes].map(b=>document.importNode(b,!0))):l.get(f)&&Re(o,f,null)}}function ff(e,t){if(!e[_])return;let n=ao(e),r=ao(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let i of o){let s=n.get(i),a=r.get(i);s&&a?(Ut(s,a),Re(e,i,[...s.childNodes])):a?Re(e,i,[...a.childNodes].map(c=>document.importNode(c,!0))):Re(e,i,null)}}function Ut(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));Se(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=Q(a);c&&o.set(c,a)}let i=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=Q(c);if(l&&o.has(l)){let f=o.get(l);Ae(f,c),i.push(f),o.delete(l);continue}let u=n[a];if(u&&u.nodeType===1&&!Q(u)&&u.tagName===c.tagName){Ae(u,c),i.push(u);continue}}else if(c.nodeType===3){let l=n[a];if(l&&l.nodeType===3){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),i.push(l);continue}}else if(c.nodeType===8){let l=n[a];if(l&&l.nodeType===8){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),i.push(l);continue}}i.push(c)}let s=new Set(i);for(let a of n)!s.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<i.length;a++){let c=i[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function Q(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function qt(){let e=oe(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((c,l)=>l.length-c.length),n=null,r=null;for(let c of t){let l=document.getElementById(`wj-loading:${c}`);if(l instanceof HTMLTemplateElement){n=c,r=l;break}}if(n===null||r===null)return null;let o=e.get(n),i=de(),s=[];for(let c=o.start.nextSibling;c&&c!==o.end;c=c.nextSibling)s.push(c);let a=document.createRange();return a.setStartAfter(o.start),a.setEndBefore(o.end),a.deleteContents(),o.start.parentNode.insertBefore(r.content.cloneNode(!0),o.end),{slot:o,oldChildren:s,token:R,haveKeys:i}}function Ue(e){if(!e||e.token!==R)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 wc(e,t){Ut(e,t)}var ft=w(()=>{Je();Fe();B();we();ct();ut()});function df(e){if(typeof document>"u"||!document.body)return!1;let t=oe(document.body);if(!t)return!1;let n,r=-1;for(let[c,l]of t)c.length>r&&(r=c.length,n=l);if(!n)return!1;let o=n.start.parentNode;if(!o||n.start.parentNode!==n.end.parentNode)return!1;let i=document.createElement("div");i.setAttribute("role","alert"),i.setAttribute("data-webjs-nav-error","");let s=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";i.textContent=s;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),o.insertBefore(i,n.end),!0}function co(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||df(t)||typeof location<"u"&&(ne("navigation-error-unrecoverable",e),pe(e))}var Sc=w(()=>{Fe();re();we()});async function Qn(e,t,n,r,o,i,s,a,c,l){o=o||"GET";let u=l&&l.refresh||void 0,f=i!=null&&o!=="GET"&&o!=="HEAD"&&!t,d=!!(l&&l.noPrefetch),b=!!(l&&l.preserveScroll),p=typeof a=="number"?a:R,y,m=null,g=null,h=null,x=null,T=!1,D=e,mt=t?On(t,p):null;try{try{let $=o==="GET"&&!i&&!u&&!d?Wn(e,r?r.haveKeys:void 0,t):null;if($)y=$.html,g=$.build,h=$.src,D=$.finalUrl,x=200,T=!0;else{let qe={"x-webjs-router":"1"},is=u||f?"":de();is&&(qe["x-webjs-have"]=is),t&&(qe["x-webjs-frame"]=t),i!=null&&o!=="GET"&&o!=="HEAD"&&(qe.accept=ji+", text/html");let ho={method:o,headers:qe,credentials:"same-origin",cache:"no-cache"};s&&(ho.signal=s),i!=null&&o!=="GET"&&o!=="HEAD"&&(ho.body=i);let H=await fetch(e,ho);x=H.status,T=H.ok;let ss=Li(H.headers.get("x-webjs-invalidate"));ss.length&&Oi(ss);let as=H.headers.get("content-type")||"",Nc=/^text\/html\b/i.test(as);if(as.toLowerCase().indexOf(ji)===0){let Cc=await H.text(),er=p===R;return er&&(Ue(r),Ni(Cc)),{ok:er&&T,status:x,aborted:!er,applied:er}}if(H.redirected&&H.url&&(D=H.url),H.status===204||H.status===205)return p===R&&n&&history.pushState(null,"",D),{ok:T,status:x,aborted:!1,applied:!1};if(!Nc)return p===R&&(Ue(r),co(e,H.status,null)),{ok:!1,status:x,aborted:!1,applied:!1};g=H.headers.get("x-webjs-build"),h=H.headers.get("x-webjs-src");let mo=await Vn(H);y=mo.shell,mo.streaming&&(m=mo)}}catch($){return $&&$.name==="AbortError"?{ok:!1,status:null,aborted:!0,applied:!1}:p!==R?{ok:!1,status:null,aborted:!0,applied:!1}:(Ue(r),co(e,null,$ instanceof Error?$:new Error(String($))),{ok:!1,status:null,aborted:!1,applied:!1})}if(p!==R){if(m&&m.reader)try{m.reader.cancel()}catch{}return{ok:!1,status:x,aborted:!0,applied:!1}}let Wt=ot(y);if(!Wt)return Ue(r),co(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:x,aborted:!1,applied:!1};let bt=!1,yt=n?()=>{bt||(bt=!0,history.pushState(null,"",D))}:null,L=ht(Wt,t,!!c,D,g,h,u||(f?"layouts":void 0),yt),Tc=L!=="none";if(L==="discard"){if(m&&m.reader)try{m.reader.cancel()}catch{}return{ok:T,status:x,aborted:!1,applied:!1}}if(yt&&yt(),n&&!t){let $=new URL(D),qe=$.hash?document.getElementById($.hash.slice(1)):null;qe?qe.scrollIntoView():b||(Ha(),window.scrollTo({left:0,top:0,behavior:"instant"}))}return m&&(m.reader||m.rest)&&dt.then(()=>zn(m.reader,m.dec,m.rest,()=>p===R)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:D,frameId:t,from:"navigate"}})),{ok:T,status:x,aborted:!1,applied:Tc}}finally{mt&&Ln(mt,p)}}var Ac=w(()=>{Mr();yn();Fe();B();re();ft();An();Be();Sc();Fn();at();we();Gn();Jn()});function ec(e){if(!Ga(e)||!G)return!1;let t,n;try{t=new URL(G),n=new URL(e,location.href)}catch{return!1}return t.pathname!==n.pathname||t.search!==n.search?!1:(G=n.href,!0)}function Zn(){z||typeof document>"u"||(Bi(!0),globalThis.__webjsRefreshPage=fo,document.addEventListener("click",Wi,!1),document.addEventListener("submit",Lt,!1),window.addEventListener("popstate",Ot),document.addEventListener("pointerover",it,!0),document.addEventListener("focusin",it,!0),document.addEventListener("touchstart",it,{capture:!0,passive:!0}),document.addEventListener("pointerout",zi,!0),document.addEventListener("webjs:navigate",ro),_c(),ro(),typeof history<"u"&&"scrollRestoration"in history&&(lo=history.scrollRestoration,history.scrollRestoration="auto"),typeof location<"u"&&(G=location.href),Da())}function Qi(){z&&(Bi(!1),document.removeEventListener("click",Wi,!1),document.removeEventListener("submit",Lt,!1),window.removeEventListener("popstate",Ot),$r(),document.removeEventListener("pointerover",it,!0),document.removeEventListener("focusin",it,!0),document.removeEventListener("touchstart",it,{capture:!0}),document.removeEventListener("pointerout",zi,!0),document.removeEventListener("webjs:navigate",ro),Kn(),no(),cc(),typeof history<"u"&&lo!==null&&(history.scrollRestoration=lo,lo=null),Jr(),J&&J(),X&&X(),G=null,delete globalThis.__webjsRefreshPage)}async function Zi(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){pe(e);return}await Mn(n.href,t?.replace??!1,null,{preserveScroll:t?.scroll===!1})}async function es(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1,applied:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1,applied:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1,applied:!1};Z&&Z.abort(),Z=new AbortController;let o=Z.signal,i=Dr(),s=await Qn(r.href,n,!1,null,"GET",null,o,i,!1,{noPrefetch:!0});return s&&s.applied&&oc(r.href,n),s}function uo(e){if(!e){E.clear(),st();return}let t=new URL(e,location.href),n=t.pathname+t.search;E.delete(n),v.delete(n);let r=` ${n}`;for(let o of[...v.keys()])o.endsWith(r)&&v.delete(o)}async function fo(e){if(!z||typeof location>"u")return!1;uo(),Dt();try{let t=await Mn(location.href,!1,null,{refresh:e==="shell"?"shell":"page"});return!t||t.aborted?!0:t.applied}catch{return!1}}async function Mn(e,t,n,r){$r();let o=r&&r.refresh||void 0,i=!!(r&&r.preserveScroll);if(Fi(t,n)&&typeof location<"u")return ne("readyState-loading",e),pe(e),null;Z&&Z.abort(),Z=new AbortController;let s=Z.signal,a=Dr();n||(Jr(),J&&J(),X&&X()),!o&&G&&Ki(G);let c=setTimeout(()=>{wn(!0),c=null},150),l=null;!t&&!o&&(l=qt());let u=!1;try{if(t){let d=nc(e);if(d){let b=ot(d.html);if(b){let p=Za(d.scrollHeight);ht(b,n,!0,null);let y=()=>{};if(typeof window<"u"){let h=()=>{y=Qa(d.scrollX,d.scrollY)};if(Ht()&&typeof document.startViewTransition=="function"){let x=Gr;dt.then(()=>{x!==Gr||!z||h()}).catch(()=>{})}else h()}let m=Qn(e,n,!1,l,"GET",null,s,a,!0).catch(()=>{}),g=new Promise(h=>setTimeout(h,500));return Promise.all([m,g]).then(()=>Yr(()=>{y(),Yr(p)})),null}}u=!0,typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}let f=await Qn(e,n,!t&&!o,l,"GET",null,s,a,!1,{refresh:o,preserveScroll:i});return u&&f&&f.applied&&typeof window<"u"&&Yr(()=>{a!==R||!z||window.scrollTo({left:0,top:0,behavior:"instant"})}),f}finally{c&&clearTimeout(c),a===R&&(wn(!1),typeof location<"u"&&(G=location.href))}}async function tc(e,t,n,r,o,i){$r(),Z&&Z.abort(),Z=new AbortController;let s=Z.signal,a=Dr();r||(Jr(),J&&J(),X&&X());let c=t==="get"||t==="head",l=new URL(e,location.href);if(c){l.search="";for(let[p,y]of n)l.searchParams.append(p,typeof y=="string"?y:y.name)}G&&Ki(G);let u=setTimeout(()=>{wn(!0),u=null},150),f=qt(),d=o?jn(o,a,l.href):null,b=!1;try{let p=await Qn(l.href,r,!0,f,c?"GET":t.toUpperCase(),c?null:n,s,a,!1,{preserveScroll:!!(i&&i.preserveScroll)});b=!!(p&&p.ok),!c&&a===R&&(E.clear(),st())}finally{d&&Pn(d,a,l.href,b),u&&clearTimeout(u),a===R&&(wn(!1),typeof location<"u"&&(G=location.href))}}function vc(){return G}function xc(e){G=e}var Z,G,lo,Fn=w(()=>{B();re();ft();An();Qr();Ac();Be();at();Xr();jt();we();Jn();ct();ut();Z=null,G=null;lo=null});var Ca={};cs(Ca,{_FALLBACK_MARKER_KEY:()=>rt,_FRAME_TOP:()=>gn,_LIVE_ATTRS:()=>ge,_activateSwappedRange:()=>Xn,_activeFrameId:()=>zr,_addNewHeadElements:()=>Rt,_applyOptimisticLoading:()=>qt,_applyStreamedResolve:()=>io,_applySwap:()=>ht,_blurOutgoingFocus:()=>pt,_buildHaveHeader:()=>de,_buildSubmitFormData:()=>Nn,_bumpNavToken:()=>Va,_clearFormBusy:()=>Pn,_clearFrameBusy:()=>Ln,_collectBoundaries:()=>oe,_currentPageUrl:()=>vc,_diffElementInPlace:()=>Ae,_eligibleAnchorHref:()=>Ft,_encodeSubmitBody:()=>Tn,_findAnchorInPath:()=>Hr,_getSubmitAction:()=>xn,_getSubmitEnctype:()=>En,_getSubmitMethod:()=>vn,_isNonHtmlPath:()=>Ia,_isPreBootNavigation:()=>Br,_keyOf:()=>Q,_markFormBusy:()=>jn,_markFrameBusy:()=>On,_mergeHead:()=>kn,_navToken:()=>Ka,_onPopState:()=>Ot,_onSubmit:()=>Lt,_parseHTML:()=>ot,_planBoundarySwap:()=>_n,_prefetch:()=>$e,_prefetchAnchor:()=>to,_prefetchCache:()=>v,_prefetchHasHoverPointer:()=>Zr,_prefetchInflightSize:()=>sc,_prefetchMode:()=>Bt,_prefetchPeek:()=>ic,_prefetchSaysSaveData:()=>qn,_prefetchSuppressed:()=>eo,_prefetchTake:()=>Wn,_reactivateScripts:()=>He,_readStreamedShell:()=>Vn,_reconcileChildren:()=>Ut,_regraftPermanentElements:()=>Yn,_regraftPermanentInSlice:()=>Se,_resetParseProbe:()=>Di,_resetPrefetch:()=>ac,_resetWarnOnce:()=>Ua,_resolvePreserveScroll:()=>In,_resolveTargetFrameId:()=>ie,_restoreOptimistic:()=>Ue,_runWithTransition:()=>lt,_setCurrentPageUrl:()=>xc,_setHardNavigate:()=>Wa,_shouldFullLoadDuringParse:()=>qa,_snapshotCache:()=>E,_streamBoundariesProgressively:()=>zn,_takeResolveUnit:()=>oo,_viewTransitionsEnabled:()=>Ht,disableClientRouter:()=>Qi,enableClientRouter:()=>Zn,loadFrame:()=>es,navigate:()=>Zi,refreshPage:()=>fo,revalidate:()=>uo});var Lr=w(()=>{Ei();yn();yn();Ee();Ra();Pr();Mr();Je();Fn();B();re();Fn();at();we();Fe();B();re();ft();An();Ur();Qr();qr();Be();Rn();at();Xr();jt();Gn();Jn();ct();ut();(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&Zn()});function Rc(e,...t){return{_$webjs:"template",strings:e,values:t}}function P(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var N="wjm-";function Oc(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 bo(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function yo(e,t){if(!(!t||!t.length))if("adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"){let n=t.map(r=>{let o=new CSSStyleSheet;return o.replaceSync(r.text),o});e.adoptedStyleSheets=n}else{let n=e,r=document.createElement("style");r.textContent=t.map(o=>o.text).join(`
|
|
4
|
-
`),n.appendChild(r)}}function
|
|
5
|
-
`)}</style>`}Ee();var vs=Symbol.for("webjs.repeat");function xs(e,t,n){return{[vs]:!0,items:[...e],keyFn:t,templateFn:n}}function rr(e){return!!e&&typeof e=="object"&&e[vs]===!0}function Wc(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function vo(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Kc(e){return{_$webjs:"live",value:e}}function se(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function Vc(e,t){return{_$webjs:"keyed",key:e,value:t}}function or(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function zc(e,t){return{_$webjs:"guard",deps:e,fn:t}}function ir(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Gc(e){return{_$webjs:"template-content",template:e}}function xo(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function Yc(e){return{_$webjs:"ref",target:e}}function sr(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Jc(){return{value:void 0}}function Xc(e){return{_$webjs:"cache",value:e}}function ar(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function Qc(...e){return{_$webjs:"until",args:e}}function cr(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function Zc(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function Eo(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function el(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function To(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function tl(e){return{_$webjs:"watch",signal:e}}function lr(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}zt();Je();zt();Ee();Je();var yr=new WeakMap,gr=new WeakMap,rn=Symbol.for("webjs.instance");function _t(e){let{strings:t}=e,n=yr.get(t);if(n)return n;let r=[],o="",i="text",s="",a=0,c="",l=0,u=null,f="",d="";for(let y=0;y<t.length;y++){let m=t[y];for(let g=0;g<m.length;g++){let h=m[g];switch(i){case"text":o+=h,h==="<"&&(i="tag-open");break;case"tag-open":o+=h,h==="!"?i="bang-1":h==="/"?(i="tag-name",f=""):/[a-zA-Z]/.test(h)?(i="tag-name",f=h.toLowerCase()):i="text";break;case"bang-1":o+=h,i=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=h,h==="-"?(i="comment",l=0):i="tag-name";break;case"comment":o+=h,h==="-"?l+=1:(h===">"&&l>=2&&(i="text"),l=0);break;case"tag-name":o+=h,h===">"?(i=f==="script"||f==="style"?"rawtext":"text",i==="rawtext"&&(d="")):/\s/.test(h)?i="in-tag":f+=h.toLowerCase();break;case"in-tag":o+=h,h===">"?(i=f==="script"||f==="style"?"rawtext":"text",i==="rawtext"&&(d="")):!/\s/.test(h)&&h!=="/"&&(i="attr-name",s=h,a=o.length-1);break;case"rawtext":o+=h,d=(d+h.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(i="text",d="",f="");break;case"attr-name":h==="="?(i="after-eq",o+=h):/\s/.test(h)?(i="in-tag",s="",o+=h):h===">"?(i="text",s="",o+=h):(s+=h,o+=h);break;case"after-eq":h==='"'||h==="'"?(i="attr-quoted",c=h,o+=h):/\s/.test(h)?(i="in-tag",s="",o+=h):h===">"?(i="text",s="",o+=h):(i="attr-unquoted",o+=h);break;case"attr-unquoted":/\s/.test(h)?(i="in-tag",s="",o+=h):(h===">"&&(i="text",s=""),o+=h);break;case"attr-quoted":o+=h,h===c&&(i="in-tag",s="");break;case"skip-attr":if(h===c){if(u){let x=u.firstPartIdx,T=[];for(let L=x;L<r.length;L++)(r[L].kind==="noop"||r[L].kind==="attr-mixed")&&T.push(L);let D=[],mt=t[T[0]],Wt=mt.lastIndexOf(c);D.push(Wt>=0?mt.slice(Wt+1):mt);for(let L=1;L<T.length;L++)D.push(t[T[L]]);let bt=t[T[T.length-1]+1],yt=bt.indexOf(c);D.push(yt>=0?bt.slice(0,yt):bt),r[x]={kind:"attr-mixed",path:[],name:u.name,statics:D,group:T};for(let L=1;L<T.length;L++)r[T[L]]={kind:"noop",path:[],mixedAnchor:x};u=null}i="in-tag",s=""}break}}if(y<t.length-1){let g=r.length;if(i==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(i==="rawtext"){d="",r.push({kind:"noop",path:[]});continue}if(i==="text")o+=`<!--${N}${g}-->`,r.push({kind:"child",path:[]});else if(i==="in-tag"){let h=`data-${N}${g}`;o+=`${h}=""`,r.push({kind:"element",path:[]})}else if(i==="after-eq"){let h=s[0],x=s.slice(1);if(Kt(h)){o=o.slice(0,a);let T=go[h],D=`data-${N}${g}`;o+=`${D}=""`,r.push({kind:T,path:[],name:x})}else{o=o.slice(0,a);let T=`data-${N}${g}`;o+=`${T}=""`,r.push({kind:"attr",path:[],name:s})}i="in-tag",s=""}else if(i==="attr-quoted"||i==="attr-unquoted"){o=o.slice(0,a);let h=`data-${N}${g}`;o+=`${h}=""`,u={name:s,firstPartIdx:g},r.push({kind:"noop",path:[]}),i="skip-attr"}else i==="skip-attr"&&r.push({kind:"noop",path:[]})}}let b=document.createElement("template");b.innerHTML=o,al(b.content,r);let p=cl(b.content,r);return n={templateEl:b,parts:r,formActions:p},yr.set(t,n),n}function al(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(S,"");let o=t.length;r.setAttribute(`data-${N}${o}`,""),t.push({kind:"slot",path:[]})}}function cl(e,t){let n=[],r=[];function o(i){for(let s=0;s<i.childNodes.length;s++){let a=i.childNodes[s];if(n.push(s),a.nodeType===8){let c=a.data;if(c.startsWith(N)){let l=Number(c.slice(N.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-${N}`)){let d=Number(f.name.slice(`data-${N}`.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=ll(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 ll(e,t,n){let r=e.localName==="form",o=r?"action":"formaction",i=r?"method":"formmethod",s=r?"enctype":"formenctype",a=t.filter(m=>m.kind==="attr"&&m.name.toLowerCase()===o);if(!a.length)return null;let c=[],l=[],u=[],f=r?[]:t.filter(m=>m.name.toLowerCase()==="name"&&(m.kind==="attr"||m.kind==="attr-mixed"||m.kind==="bool")).map(m=>({i:m.idx,kind:m.kind})),d=!r&&e.hasAttribute("name"),b=!r&&e.hasAttribute("form"),p=!r&&e.hasAttribute("value"),y=r?[]:t.filter(m=>m.name.toLowerCase()==="value"&&(m.kind==="attr"||m.kind==="attr-mixed"||m.kind==="bool")).map(m=>({i:m.idx,kind:m.kind}));for(let m of t){let g=String(m.name).toLowerCase();if(m.kind==="prop"){r?(g==="method"||g==="enctype"||g==="encoding")&&u.push(m.name):So(g)&&u.push(m.name);continue}if(g!==i&&g!==s||m.kind!=="attr"&&m.kind!=="attr-mixed"&&m.kind!=="bool")continue;let h=n[m.idx],x={i:m.idx,kind:m.kind};m.kind==="attr-mixed"&&(x.statics=h.statics||[],x.group=h.group||[]),(g===i?c:l).push(x)}return{isForm:r,tag:e.localName,actionIdxs:a.map(m=>m.idx),duplicateAction:a.length>1,staticAction:e.getAttribute(o)!=null,authoredName:d,authoredValue:p,authoredForm:b,propAttrs:u,nameParts:f,valueParts:y,staticMethod:e.getAttribute(i),staticEnctype:e.getAttribute(s),methodParts:c,enctypeParts:l}}Ee();var ee=null,Oe=!1,At=0,St=null,ni=0,Fs=(e,t)=>Object.is(e,t),_r=()=>{},Bs=()=>!1;function Ds(e,t){e.liveConsumers||(e.liveConsumers=new Map);let n=e.liveConsumers.size===0;if(e.liveConsumers.set(t,(e.liveConsumers.get(t)||0)+1),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)Ds(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function on(e,t){if(!e.liveConsumers)return;let n=e.liveConsumers.get(t);if(n!==void 0){if(n>1){e.liveConsumers.set(t,n-1);return}if(e.liveConsumers.delete(t),e.liveConsumers.size===0){if(e.producers&&e.producers.length>0)for(let r of e.producers)on(r,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(r){console.error(r)}}}}function ci(e){if(Oe)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&&ii(t)&&on(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,ii(t)&&Ds(e,t)),t.producerLastReadVersions[n]=e.version}function ii(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function $s(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=Oe;Oe=!0;try{for(let n of e.liveConsumers.keys())n.dirty||ul(n)}finally{Oe=t}}function ul(e){e.dirty=!0,$s(e),e.consumerMarkedDirty.call(e.wrapper||e)}function Sr(e){if(!(!e.dirty&&e.lastCleanEpoch===At)){if(!e.producerMustRecompute()&&!fl(e)){e.dirty=!1,e.lastCleanEpoch=At;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=At}}function fl(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(Sr(n),r!==n.version))return!0}return!1}function si(e){e&&(e.nextProducerIndex=0);let t=ee;return ee=e,t}function ai(e,t){if(ee=t,!!e){if(ii(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)on(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var Ar=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=At,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=Bs,this.producerRecomputeValue=_r,this.consumerMarkedDirty=_r,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||Fs,this.watched=n?.[li],this.unwatched=n?.[ui]}get(){return ci(this),this.__value}peek(){return this.__value}set(t){if(Oe)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,At++,St!==null?Hs(this):$s(this))}};function Hs(e){let t=Oe;Oe=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers.keys())n.dirty||(n.dirty=!0,n.__isWatcher?St.add(n):Hs(n))}finally{Oe=t}}var ri=Symbol("unset"),oi=Symbol("computing"),wr=Symbol("errored"),sn=class{constructor(t,n){this.__fn=t,this.__value=ri,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||Fs,this.watched=n?.[li],this.unwatched=n?.[ui];let r=this;this.producerMustRecompute=function(){return r.__value===ri||r.__value===oi},this.producerRecomputeValue=function(){if(r.__value===oi)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=oi;let i=si(r),s,a=!1;try{s=r.__fn.call(r.wrapper)}catch(l){s=wr,r.__error=l,a=!0}finally{ai(r,i)}if(!a&&(o!==ri&&o!==wr)&&r.__equal.call(r.wrapper,o,s)){r.__value=o;return}r.__value=s,r.version++},this.consumerMarkedDirty=_r}get(){if(Sr(this),ci(this),this.__value===wr)throw this.__error;return this.__value}peek(){if(Sr(this),this.__value===wr)throw this.__error;return this.__value}},vr=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=At,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=Bs,this.producerRecomputeValue=_r,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=si(this);try{for(let r of t)ci(r),r.__isComputed&&Sr(r)}finally{ai(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(on(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=si(this),r;try{r=t()}finally{ai(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)on(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},li=Symbol("watched"),ui=Symbol("unwatched");function dl(e){let t=ee;ee=null;try{return e()}finally{ee=t}}function pl(e){return e.producers.slice()}function hl(e){return e.liveConsumers?[...e.liveConsumers.keys()]:[]}function ml(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function bl(e){return e.producers.length>0}function yl(){return ee&&ee.__isComputed?ee:null}function gl(e){ni++,St===null&&(St=new Set);try{e()}finally{if(ni--,ni===0){let t=St;St=null;for(let n of t)n.__fire()}}}var an={State:Ar,Computed:sn,subtle:{Watcher:vr,untrack:dl,introspectSources:pl,introspectSinks:hl,hasSinks:ml,hasSources:bl,currentComputed:yl,watched:li,unwatched:ui}};function wl(e,t){return new Ar(e,t)}function _l(e,t){return new sn(e,t)}function Sl(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function Al(e){let t=!1,n=!1,r=new sn(e),o=new vr(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(i){console.error(i)}o.watch()}}))});o.watch(r);try{r.get()}catch(i){console.error(i)}return()=>{n||(n=!0,o.dispose())}}Je();zt();var W=null;function di(e){W=e}function qs(e,t){let n=e&&e[_]?e:null;return n?Ge(n,t):t()}function Er(e){return e?e.nodeType===11&&e.host?e.host:e:null}function pi(e,t){let n=e.__commitOwner,r=W;n&&(W=n);try{t()}finally{W=r}}function ln(e,t){if(e.kind==="noop")return{kind:"noop",mixedAnchor:e.mixedAnchor};let n=t;for(let o of e.path)n=n.childNodes[o];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let o={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(i){o.handler?.(i)}};return r.addEventListener(o.name,o.dispatcher),o}if(e.kind==="attr")return{kind:"attr",el:r,name:e.name||""};if(e.kind==="attr-mixed")return{kind:"attr-mixed",el:r,name:e.name||"",statics:e.statics||[],group:e.group||[]};if(e.kind==="prop")return{kind:"prop",el:r,name:e.name||""};if(e.kind==="bool")return{kind:"bool",el:r,name:e.name||""};if(e.kind==="element")return{kind:"element",el:r};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}function te(e,t,n,r,o){if(se(t)){let i=t.value;if(e.kind==="prop"&&e.el[e.name]===i||e.kind==="attr"&&e.el.getAttribute(e.name)===String(i)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!i)return;t=i}switch(e.kind){case"child":El(e,t,o);break;case"attr":{let i=Vt(e.name,t);i===null?e.el.removeAttribute(e.name):tr(t,e.name,e.el.localName)||(Yt(t,e.name,e.el.localName),e.el.setAttribute(e.name,i));break}case"prop":gs(t,e.name,e.el.localName),e.el[e.name]=t;break;case"bool":Yt(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":xl(e,t);break;case"attr-mixed":{let i=e,s=i.statics[0];for(let a=0;a<i.group.length;a++){let c=r?r[i.group[a]]:t;se(c)&&(c=c.value),Yt(c,e.name,e.el.localName),s+=String(c??""),s+=i.statics[a+1]||""}e.el.setAttribute(e.name,s);break}case"slot":{if(e.applied)break;let i=e.slotEl,s=()=>{let c=vt(i);if(!c){e.applied=!0;return}if(!c.contains(i)){c.isConnected?queueMicrotask(s):e.applied=!0;return}if(e.applied=!0,vl(i))return;let l=document.createDocumentFragment();for(;i.firstChild;)l.appendChild(i.firstChild);i[Te]=l,queueMicrotask(()=>V(c))},a=vt(i);a&&a.contains(i)?s():queueMicrotask(s);break}case"noop":break}}function vt(e){let t=e[We];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[_])return n;n=n.parentElement}return null}function vl(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 xl(e,t){let n=e,r=sr(t)?t.target:void 0,o=n.__refTarget,i=r!==o;if(i&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(i||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!i&&n.__refElement!==void 0)try{r(void 0)}catch{}try{r(e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function El(e,t,n){return Pl(e,t),ue(e,t,n)}function ue(e,t,n){return qs(e.marker&&e.marker.parentNode,()=>Ws(e,t,n))}function Ws(e,t,n){let r=e.marker;if(se(t))return Ws(e,t.value,n);if(vo(t)){Le(e);let i=String(t.value??""),s=document.createElement("template");s.innerHTML=i;let a=[...s.content.childNodes],c=document.createDocumentFragment();for(let l of a)c.appendChild(l);r.parentNode?.insertBefore(c,r),e.child=a;return}if(or(t)){let i=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,i.key)&&Le(e),e.__keyedKey=i.key,ue(e,i.value,n);return}if(ir(t)){let i=t,s=e.__guardDeps,a=i.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(a)?jl(s,a):Object.is(s,a)))return;let c=Array.isArray(a)?a.slice():a;ue(e,i.fn(),n),e.__guardDeps=c;return}if(xo(t)){Le(e);let i=t.template;if(i&&i.content){let s=i.content.cloneNode(!0),a=[...s.childNodes];r.parentNode?.insertBefore(s,r),e.child=a}return}if(sr(t))return;if(ar(t))return Il(e,t.value,n);if(cr(t))return Ml(e,t.args,n);if(lr(t))return Fl(e,t.signal,n);if(Eo(t))return Bl(e,t,n);if(To(t))return Dl(e,t,n);if(rr(t)){if(e.child&&e.child.kind==="repeat"){Cl(e,t,n);return}Le(e);let i={kind:"repeat",map:new Map};e.child=i,Nl(r,i,t,n);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){Ol(e,t,n);return}Le(e);let i={kind:"array",items:[]};e.child=i,Rl(r,i,t,n);return}if(e.child){let i=e.child;if(i.kind==="repeat")Ks(i),e.child=void 0;else if(i.kind==="array")zs(i),e.child=void 0;else if(i.kind==="async-stream")Xs(i),e.child=void 0;else if("strings"in e.child){let s=e.child;if(P(t)&&s.strings===t.strings){Xe(s,t.values,n);return}xt(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(P(t)){let i=t,{templateEl:s,parts:a,formActions:c}=_t(i),l=s.content.cloneNode(!0),u=document.createComment(`${N}s`),f=document.createComment(`${N}e`),d=a.map(y=>ln(y,l)),b=[];for(let y=0;y<i.values.length;y++)te(d[y],i.values[y],void 0,i.values,n),b.push(i.values[y]);n&&n(c,d,i.values);let p=[u,...l.childNodes,f];r.parentNode?.insertBefore(Tl(p),r);for(let y of d)y.kind==="slot"&&te(y,void 0,void 0,[],n);e.child={strings:i.strings,bound:d,lastValues:b,startNode:u,endNode:f};return}let o=document.createTextNode(String(t));r.parentNode?.insertBefore(o,r),e.child=[o]}function Xe(e,t,n){for(let r=0;r<t.length;r++){let o=t[r];if(Object.is(o,e.lastValues[r]))continue;let i=e.bound[r],s=i.mixedAnchor;try{i.kind==="noop"&&s!=null?te(e.bound[s],t[s],e.lastValues[s],t,n):te(i,o,e.lastValues[r],t,n)}catch(a){throw e.lastValues[r]=Us,i.kind==="noop"&&s!=null&&(e.lastValues[s]=Us),a}e.lastValues[r]=o}n&&n(yr.get(e.strings)?.formActions??null,e.bound,t)}var Us=Symbol("webjs.commitFailed");function xt(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 Tl(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function hi(e,t){let{templateEl:n,parts:r,formActions:o}=_t(e),i=n.content.cloneNode(!0),s=document.createComment(`${N}s`),a=document.createComment(`${N}e`),c=r.map(f=>ln(f,i)),l=[];for(let f=0;f<e.values.length;f++)te(c[f],e.values[f],void 0,e.values,t),l.push(e.values[f]);t&&t(o,c,e.values);for(let f of c)f.kind==="slot"&&te(f,void 0,void 0,[],t);let u=document.createDocumentFragment();for(u.appendChild(s);i.firstChild;)u.appendChild(i.firstChild);return u.appendChild(a),{inst:{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a},frag:u}}function cn(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 Nl(e,t,n,r){let{items:o,keyFn:i,templateFn:s}=n,a=e.parentNode;if(!a)return;let c=document.createDocumentFragment();for(let l=0;l<o.length;l++){let u=i(o[l],l),f=s(o[l],l);if(!P(f))continue;let{inst:d,frag:b}=hi(f,r);t.map.set(u,d),c.appendChild(b)}a.insertBefore(c,e)}function Cl(e,t,n){let r=e.marker,o=r.parentNode;if(!o)return;let i=e.child,{items:s,keyFn:a,templateFn:c}=t,l=new Map;try{for(let u=0;u<s.length;u++){let f=a(s[u],u),d=c(s[u],u);if(!P(d))continue;let b=i.map.get(f);if(b&&b.strings===d.strings)Xe(b,d.values,n),fi(b.startNode,b.endNode,o,r),l.set(f,b),i.map.delete(f);else{b&&(i.map.delete(f),cn(b),xt(b.startNode,b.endNode));let{inst:p,frag:y}=hi(d,n);o.insertBefore(y,r),l.set(f,p)}}for(let[u,f]of[...i.map]){i.map.delete(u);try{cn(f)}finally{xt(f.startNode,f.endNode)}}i.map=l}catch(u){for(let[f,d]of l)i.map.set(f,d);throw u}}function Ks(e){for(let[t,n]of[...e.map]){e.map.delete(t);try{cn(n)}finally{xt(n.startNode,n.endNode)}}e.map.clear()}function kl(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function xr(e){e.type==="tpl"?(cn(e.inst),xt(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Vs(e,t){if(se(e)&&(e=e.value),P(e)){let{inst:n,frag:r}=hi(e,t);return{item:{type:"tpl",inst:n},frag:r}}if(e!=null&&e!==!1&&e!==!0){let n=document.createTextNode(String(e));return{item:{type:"text",node:n},frag:n}}return{item:{type:"empty"},frag:null}}function Rl(e,t,n,r){let o=e.parentNode;if(!o)return;let i=document.createDocumentFragment(),s=[];for(let a of n){let{item:c,frag:l}=Vs(a,r);l&&i.appendChild(l),s.push(c)}o.insertBefore(i,e),t.items=s}function Ol(e,t,n){let r=e.marker,o=r.parentNode;if(!o)return;let i=e.child,s=i.items,a=[],c=0;try{for(let l=0;l<t.length;l++){let u=t[l],f=se(u)?u.value:u,d=s[l];if(P(f)){let y=f;if(d&&d.type==="tpl"&&d.inst.strings===y.strings){Xe(d.inst,y.values,n),a.push(d),c=l+1;continue}}else if(f!=null&&f!==!1&&f!==!0){if(d&&d.type==="text"){let y=String(f);d.node.data!==y&&(d.node.data=y),a.push(d),c=l+1;continue}}else{d&&xr(d),a.push({type:"empty"}),c=l+1;continue}let{item:b,frag:p}=Vs(f,n);p&&o.insertBefore(p,Ll(s,l,r)),a.push(b),d&&xr(d),c=l+1}for(let l=t.length;l<s.length;l++)xr(s[l]),c=l+1;i.items=a}catch(l){throw i.items=a.concat(s.slice(c)),l}}function Ll(e,t,n){for(let r=t;r<e.length;r++){let o=kl(e[r]);if(o&&o.parentNode)return o}return n}function zs(e){for(let t of e.items)xr(t);e.items=[]}function fi(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),i=e;for(;i;){let s=i.nextSibling;if(o.appendChild(i),i===t)break;i=s}n.insertBefore(o,r)}function jl(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 Le(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Gs(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Ks(n);else if(n.kind==="array")zs(n);else if(n.kind==="async-stream")Xs(n);else if("strings"in n){let r=e.child;cn(r),xt(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Pl(e,t){let n=e;n.__untilState&&!cr(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!ir(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!ar(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!or(t)&&(n.__keyedKey=void 0),n.__watchSub&&!lr(t)&&Gs(n)}function Il(e,t,n){let r=e.marker,o=e,i=o.__cacheMap;i||(i=new Map,o.__cacheMap=i);let s=e.child;if(s&&"strings"in s){let c=s;if(P(t)&&c.strings===t.strings){Xe(c,t.values,n);return}let l=document.createDocumentFragment();fi(c.startNode,c.endNode,l,null),i.set(c.strings,{inst:c,holder:l}),e.child=void 0}if(P(t)){let c=t,l=i.get(c.strings);if(l){i.delete(c.strings),e.child&&Le(e),fi(l.inst.startNode,l.inst.endNode,r.parentNode,r),Xe(l.inst,c.values,n),e.child=l.inst;let u=new Set;for(let f=l.inst.startNode.nextSibling;f&&f!==l.inst.endNode;f=f.nextSibling){if(f.nodeType!==1)continue;let d=f;if(d.matches("slot[data-webjs-light]")){let b=vt(d);b&&u.add(b)}for(let b of d.querySelectorAll("slot[data-webjs-light]")){let p=vt(b);p&&u.add(p)}}for(let f of u)V(f);return}}ue(e,t,n)}function Ml(e,t,n){let r=e;W&&(r.__commitOwner=Er(W));let o=r.__untilState,i=r.__untilArgs,s=(b,p)=>!!(Object.is(b,p)||P(b)&&P(p)&&b.strings===p.strings),c=i&&i.length===t.length&&i.every((b,p)=>s(b,t[p]))&&o?o.highestResolved:1/0;o&&(o.aborted=!0),r.__untilArgs=t.slice();let l={aborted:!1,highestResolved:c};r.__untilState=l;let u=-1,f;for(let b=0;b<t.length;b++){let p=t[b];if(!p||typeof p.then!="function"){u=b,f=p;break}}u!==-1&&u<=l.highestResolved?(ue(e,f,n),l.highestResolved=u):u===-1&&!r.__untilEverRendered&&ue(e,"",n),r.__untilEverRendered=!0;let d=Math.min(u===-1?t.length:u,l.highestResolved);for(let b=0;b<d;b++){let p=t[b];!p||typeof p.then!="function"||Promise.resolve(p).then(y=>{if(!l.aborted&&!(b>=l.highestResolved)){try{pi(e,()=>ue(e,y,n))}catch(m){mi(e,m);return}l.highestResolved=b}},()=>{})}}function mi(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 Fl(e,t,n){let r=e;if(W&&(r.__commitOwner=Er(W)),r.__watchSig===t&&r.__watchSub){let s;r.__watchSub.observe(()=>{s=t.get()}),ue(e,s,n);return}r.__watchSub&&(r.__watchSub.dispose(),r.__watchSub=void 0),r.__watchSig=t;let o=new an.subtle.Watcher(()=>{queueMicrotask(()=>{if(r.__watchSub!==o)return;let s;try{o.observe(()=>{s=t.get()}),pi(e,()=>ue(e,s,n))}catch(a){mi(e,a)}})});r.__watchSub=o;let i;o.observe(()=>{i=t.get()}),ue(e,i,n)}function Gs(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Bl(e,t,n){let r=e;W&&(r.__commitOwner=Er(W));let o=e.child;if(o&&o.kind==="async-stream"&&o.mode==="append"&&o.iterable===t.iterable)return;Le(e);let i=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:i,nodes:[]};e.child=s,Ys(s,e,t,n)}function Dl(e,t,n){let r=e;W&&(r.__commitOwner=Er(W));let o=e.child;if(o&&o.kind==="async-stream"&&o.mode==="replace"&&o.iterable===t.iterable)return;Le(e);let i=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:i,nodes:[]};e.child=s,Ys(s,e,t,n)}async function Ys(e,t,n,r){let o=t.marker,i=0;for(;!e.aborted;){let s,a;try{if(s=await e.iterator.next(),e.aborted||s.done)break;a=n.mapper?n.mapper(s.value,i):s.value}catch(c){typeof console<"u"&&console.error("[webjs] asyncStream error:",c);return}try{pi(t,()=>{let c=Js(a,r);qs(o.parentNode,()=>{if(e.mode==="replace"){for(let u of e.nodes)u.parentNode&&u.parentNode.removeChild(u);e.nodes=[]}let l=document.createDocumentFragment();for(let u of c)l.appendChild(u);o.parentNode?.insertBefore(l,o),e.nodes.push(...c)})})}catch(c){e.aborted=!0;try{e.iterator.return?.()?.catch?.(()=>{})}catch{}mi(t,c);return}i++}}function Js(e,t){if(se(e)&&(e=e.value),e==null||e===!1||e===!0)return[];if(P(e)){let n=e,{templateEl:r,parts:o,formActions:i}=_t(n),s=r.content.cloneNode(!0),a=o.map(c=>ln(c,s));for(let c=0;c<n.values.length;c++)te(a[c],n.values[c],void 0,n.values,t);t&&t(i,a,n.values);for(let c of a)c.kind==="slot"&&te(c,void 0,void 0,[],t);return[...s.childNodes]}if(Array.isArray(e)){let n=[];for(let r of e)n.push(...Js(r,t));return n}return[document.createTextNode(String(e))]}function Xs(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}function Ze(e,t){let n=t,r=n[k];n[k]=!0;let o=W;di(t);try{let i=n[rn];if(P(e)){let s=e;if(i&&i.strings===s.strings){Xe(i,s.values,Nr);return}i&&Qs(i,t);let a=t.firstChild;a&&a.nodeType===8&&a.data==="webjs-hydrate"&&a.remove(),n[rn]=null;let c=Ul(s,t);n[rn]=c;return}if(i&&Qs(i,t),n[rn]=null,t.replaceChildren(),e==null||e===!1||e===!0)return;if(Array.isArray(e)){for(let s of e){let a=document.createTextNode(String(s??""));t.appendChild(a)}return}t.appendChild(document.createTextNode(String(e)))}finally{di(o),n[k]=r,r||dr(n)}}function Nr(e,t,n){if(e)for(let r of[!0,!1])for(let o of e){if(o.isForm!==r)continue;let i=o.actionIdxs[0],s=o.isForm?"action":"formaction";for(let l of o.actionIdxs)if(tr(Qe(n[l]),s,o.tag)){i=l;break}let a=t[i];if(!a||!a.el)continue;let c=Qe(n[i]);if(o.isForm)Ss(a.el,c,Tr(o.methodParts,o.staticMethod,n),Tr(o.enctypeParts,o.staticEnctype,n),o);else{let l=u=>u.some(f=>f.kind==="bool"?!!Qe(n[f.i]):f.kind==="attr"?Vt("name",Qe(n[f.i]))!==null:!0);Hl(a.el,c,o,l(o.nameParts),l(o.valueParts),Tr(o.methodParts,o.staticMethod,n),Tr(o.enctypeParts,o.staticEnctype,n))}}}function $l(e){(gr.has(e)||e.getAttribute("name")===I)&&(e.getAttribute("name")===I&&e.removeAttribute("name"),e.removeAttribute("value"),gr.delete(e))}function Hl(e,t,n,r,o,i,s){let a=typeof t=="function"?_o(t):null;if(!a){typeof t=="function"&&Ao(null,e.localName),$l(e),As(e,i,s,n.propAttrs);return}bs(n.duplicateAction,e.localName),ys(n.propAttrs,e.localName),n.staticAction&&hs(e.localName),(n.authoredValue||o)&&ps(e.localName),(n.authoredName||r)&&fs(e.getAttribute("name")||I,e.localName,!1),(n.authoredForm||e.hasAttribute("form"))&&ms(e.localName),ds(e.localName,e.getAttribute("type"));let c=_s(e.localName,i,s);e.removeAttribute("formaction"),e.setAttribute("name",I),e.setAttribute("value",a),Gt(e,"formmethod",i,c.formMethod),Gt(e,"formenctype",s,c.formEnctype),gr.set(e,a)}function Tr(e,t,n){for(let r of e){if(r.kind==="bool")return Qe(n[r.i])?"":K;if(r.kind==="attr"){let a=Vt("method",Qe(n[r.i]));return a===null?K:a}let o=r.statics||[],i=r.group||[],s=o[0]||"";for(let a=0;a<i.length;a++)s+=String(Qe(n[i[a]])??""),s+=o[a+1]||"";return s}return t??K}function Qe(e){return se(e)?e.value:e}function Ul(e,t){let{templateEl:n,parts:r,formActions:o}=_t(e),i=n.content.cloneNode(!0),s=document.createComment(`${N}s`),a=document.createComment(`${N}e`),c=r.map(f=>ln(f,i)),l=[];for(let f=0;f<e.values.length;f++)te(c[f],e.values[f],void 0,e.values,Nr),l.push(e.values[f]);Nr(o,c,e.values),t.replaceChildren(s,...i.childNodes,a);let u=t.nodeType===1&&t[_]?t:null;for(let f of c)f.kind==="slot"&&(u&&f.slotEl&&(f.slotEl[We]=u),te(f,void 0,void 0,[],Nr));return{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a}}function Qs(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=vt(n.slotEl);r&&ti(r,n.slotEl)}}t.replaceChildren()}function Zs(e,t){if(e.converter&&e.converter.fromAttribute)return e.converter.fromAttribute(t,e.type);if(e.type===Number)return t==null?null:Number(t);if(e.type===Boolean)return t!=null&&t!=="false";if(e.type===Object||e.type===Array){if(t==null)return null;try{return JSON.parse(t)}catch{return null}}return t}function ql(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function ea(e,t){let n;for(let{propName:r,def:o,primary:i,alias:s}of na(e)){if(i===t)return{propName:r,def:o};n===void 0&&s===t&&(n={propName:r,def:o})}return n}function ta(e){let t=new Set,n=na(e);for(let{primary:r}of n)t.add(r);for(let{alias:r}of n)r&&t.add(r);return[...t]}function na(e){let t=e&&e.properties||{},n=[];for(let[r,o]of Object.entries(t)){let i=typeof o=="object"&&o!==null?o:{type:o};if(i.state)continue;let s=i.attribute||ql(r),a=r.toLowerCase(),c=!i.attribute&&a!==s?a:void 0;n.push({propName:r,def:i,primary:s,alias:c})}return n}var ra=null;function Cr(e){ra=e||null}function bi(){return ra||void 0}Ee();var oa=Symbol.for("webjs:registry"),ia=Symbol.for("webjs:classToTag"),kr=globalThis,fe=kr[oa]||(kr[oa]=new Map),sa=kr[ia]||(kr[ia]=new WeakMap),Rr=typeof window<"u"&&typeof customElements<"u";function yi(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=fe.get(e);r?(r.cls=t,r.lazy=n):fe.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),sa.set(t,e)}if(Rr){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),yi(t,n)}}if(!Rr){let e=globalThis;e.customElements||(e.customElements={define(t,n){yi(t,n)},get(t){return fe.get(t)?.cls},upgrade(){},whenDefined(t){let n=fe.get(t);return Promise.resolve(n?.cls)}})}function gi(e,t){Rr?customElements.define(e,t):yi(e,t)}function Wl(e,t){if(Rr)return;let n=fe.get(e);if(n){n.moduleUrl=t;return}fe.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Kl(e){return fe.get(e)?.cls}function Vl(e){return fe.get(e)?.moduleUrl||null}function zl(e){return fe.get(e)?.lazy===!0}function et(e){return sa.get(e)}function Gl(){return[...fe.keys()]}dn();Je();function au(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var pn=class{constructor(){this.__ssrAttrs=new Map,this.__internals=null}get attributes(){return[...this.__ssrAttrs].map(([t,n])=>({name:t,value:n}))}getAttribute(t){let n=this.__ssrAttrs.get(String(t).toLowerCase());return n===void 0?null:n}setAttribute(t,n){this.__ssrAttrs.set(String(t).toLowerCase(),String(n))}removeAttribute(t){this.__ssrAttrs.delete(String(t).toLowerCase())}hasAttribute(t){return this.__ssrAttrs.has(String(t).toLowerCase())}toggleAttribute(t,n){let r=String(t).toLowerCase(),o=this.__ssrAttrs.has(r);return(n===void 0?!o:n)?(this.__ssrAttrs.set(r,""),!0):(this.__ssrAttrs.delete(r),!1)}getAttributeNames(){return[...this.__ssrAttrs.keys()]}closest(t){let n=String(t).trim().toLowerCase();if(!/^[a-z][a-z0-9-]*$/.test(n))return null;if(this.__ssrTag===n)return this;let r=this.__ssrAncestors;if(!Array.isArray(r))return null;for(let o=r.length-1;o>=0;o--)if(r[o]&&r[o].__ssrTag===n)return r[o];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,o=>"-"+o.toLowerCase());return this.__dataset=new Proxy({},{get(r,o){if(typeof o!="string")return;let i=t.getAttribute(n(o));return i===null?void 0:i},set(r,o,i){return typeof o=="string"&&t.setAttribute(n(o),i),!0},has(r,o){return typeof o=="string"&&t.hasAttribute(n(o))},deleteProperty(r,o){return typeof o=="string"&&t.removeAttribute(n(o)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(o,i)=>i.toUpperCase()))},getOwnPropertyDescriptor(r,o){if(typeof o=="string"&&t.hasAttribute(n(o)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(o))}}}),this.__dataset}get className(){return this.getAttribute("class")??""}set className(t){this.setAttribute("class",t)}get hidden(){return this.hasAttribute("hidden")}set hidden(t){this.toggleAttribute("hidden",!!t)}get id(){return this.getAttribute("id")??""}set id(t){this.setAttribute("id",t)}get title(){return this.getAttribute("title")??""}set title(t){this.setAttribute("title",t)}get slot(){return this.getAttribute("slot")??""}set slot(t){this.setAttribute("slot",t)}get role(){return this.getAttribute("role")}set role(t){t==null?this.removeAttribute("role"):this.setAttribute("role",t)}get tabIndex(){let t=this.getAttribute("tabindex");return t===null?-1:Number.parseInt(t,10)||0}set tabIndex(t){this.setAttribute("tabindex",String(t))}addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return this.__internals=au(),this.__internals}},cu=["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 cu){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(pn.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}function fa(e,t){return e!==t}function da(e){try{return String(e)}catch{return Object.prototype.toString.call(e)}}function _i(e,t,n){if(typeof console>"u"||!console.warn)return;let r=et(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 pa(e,t,n,r){if(typeof console>"u"||!console.warn)return;let o=et(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 ha(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var ba=typeof window<"u"&&typeof HTMLElement<"u",lu=ba?HTMLElement:pn,ya=Symbol("webjs.factoryProps"),ma=new WeakSet,Et=class e extends lu{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){gi(t,this)}static get observedAttributes(){return ta(this)}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(ma.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,ya)){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)}ma.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,o]of Object.entries(n)){let i=typeof o=="object"?o:{type:o},s=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:a=>{let c=this.__propValues[r];(i.hasChanged||fa)(a,c)&&(this.__propValues[r]=a,i.reflect&&!i.state&&this._connected&&this._reflectAttribute(r,a,i),this.requestUpdate(r,c))}}),s!==void 0?this.__propValues[r]=s:i.default!==void 0&&(this.__propValues[r]=typeof i.default=="function"?i.default():i.default)}}}_reflectAttribute(t,n,r){let o=r.attribute||uu(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let i=r.converter.toAttribute(n,r.type);i==null?this.removeAttribute(o):this.setAttribute(o,i)}else if(typeof n=="function")this.removeAttribute(o),_i(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 i,s=!0;try{i=JSON.stringify(n)}catch(a){s=!1,this.removeAttribute(o),pa(this,t,o,a&&a.message)}s&&this.setAttribute(o,i)}else nr(n)?(this.removeAttribute(o),_i(this,t,o)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!ba)return;if(this.__webjsPropsHydrated||(this.__webjsPropsHydrated=!0,this._hydratePropAttrs()),this.constructor.hydrate==="visible"&&typeof IntersectionObserver<"u"&&!this.__hydrationActivated){this.__hydrationActivated=!1,this.__hydrationObserver=new IntersectionObserver(n=>{for(let r of n)if(r.isIntersecting){this.__hydrationObserver.unobserve(this),this.__hydrationObserver.disconnect(),this.__hydrationObserver=null,this.__hydrationActivated=!0,this._activate();return}},{rootMargin:"200px"}),this.__hydrationObserver.observe(this);return}this._activate()}_hydratePropAttrs(){let t=[],n=this.attributes;for(let r=0;r<n.length;r++){let o=n[r].name;o.startsWith("data-webjs-prop-")&&t.push(o)}for(let r of t){let o=this.getAttribute(r);if(this.removeAttribute(r),o==null)continue;let i=fu(r.slice(16));try{this[i]=nt(o)}catch(s){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${s&&s.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow!==!0&&!this.hasAttribute("data-wj-host")&&this.setAttribute("data-wj-host",""),t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,o=Array.isArray(r)?r:bo(r)?[r]:[];if(o.length){if(n){let i=this.shadowRoot.querySelector("style");i&&i.remove()}yo(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${et(t)||this.tagName?.toLowerCase()}> has static shadow = false AND static styles. static styles only works with shadow DOM (adoptedStyleSheets). For light DOM, use global CSS or <style> in render().`),Jt(this)?Bo(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||ei(this)?(this.removeAttribute("data-wj-serialized"),F(this),Oo(this)):Ro(this),Ko(this),Mo(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),Fo(this),this.__signalWatcher&&(this.__signalWatcher.dispose(),this.__signalWatcher=void 0);for(let t of this.__controllers)t.hostDisconnected&&t.hostDisconnected()}attributeChangedCallback(t,n,r){if(this.__reflectingAttribute)return;let o=ea(this.constructor,t);if(o===void 0)return;let{propName:i,def:s}=o,a=Zs(s,r);this[i]!==a&&(this[i]=a,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;try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}if(!r){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();n=!0}}}catch(o){console.error("[webjs] lifecycle hook threw during update phase:",o)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let o=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1;let i=()=>{if(this.__pendingAsyncCommits--,o===this.__renderToken){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();this._postCommit(t)}};r.then(i,s=>{try{o===this.__renderToken&&this._handleRenderError(s instanceof Error?s:new Error(da(s)))}finally{i()}});return}n?this._postCommit(t):this.__pendingAsyncCommits||this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers)n.hostUpdate&&n.hostUpdate();this._reflectDeclaredAttributes()}finally{this._isUpdating=!1}}_reflectDeclaredAttributes(){let t=this.constructor.properties||{};for(let n of Object.keys(t)){let r=t[n];!r||!r.reflect||r.state||this._reflectAttribute(n,this[n],r)}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new an.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n,r=bi();Cr(this.__renderAbort?this.__renderAbort.signal:null);try{this.__signalWatcher.observe(()=>{n=this.render()})}finally{Cr(r||null)}if(n&&typeof n.then=="function")return this._commitAsync(n);Ze(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&Ze(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{if(n===this.__renderToken)try{Ze(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!==hn.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${et(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&Ze(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 uu(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function fu(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function hn(e){return new.target?Reflect.construct(Et,arguments,new.target):class extends Et{static properties=e;static[ya]=!0}}Object.setPrototypeOf(hn,Et);hn.prototype=Et.prototype;wo();var ga=Symbol.for("webjs.notFound"),wa=Symbol.for("webjs.redirect"),_a=Symbol.for("webjs.forbidden"),Sa=Symbol.for("webjs.unauthorized");function du(){let e=new Error("webjs: notFound()");throw e.__webjs=ga,e}function pu(){let e=new Error("webjs: forbidden()");throw e.__webjs=_a,e}function hu(){let e=new Error("webjs: unauthorized()");throw e.__webjs=Sa,e}function mu(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=wa,r.url=e,r.status=typeof n=="number"?n:void 0,r}function bu(e){return!!e&&e.__webjs===ga}function yu(e){return!!e&&e.__webjs===wa}function gu(e){return!!e&&e.__webjs===_a}function wu(e){return!!e&&e.__webjs===Sa}var Aa=null;function _u(){if(!Aa)return"";try{return Aa()||""}catch{return""}}var va=null;function Su(e){if(typeof e!="string"||!e||!va)return e;try{return va(e)||e}catch{return e}}Ee();var Ep=Symbol.for("webjs.suspense");function Au(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function vu(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function xu(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,i=null,s=[];function a(){o||(i=new WebSocket(Eu(e),t.protocols),i.onopen=c=>{for(r=0;s.length&&i&&i.readyState===WebSocket.OPEN;)i.send(s.shift());t.onOpen?.(c)},i.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},i.onerror=c=>{t.onError?.(c)},i.onclose=c=>{if(t.onClose?.(c),!o&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(a,l)}})}return a(),{send(c){let l=typeof c=="string"||c instanceof ArrayBuffer||ArrayBuffer.isView(c)?c:JSON.stringify(c);i&&i.readyState===WebSocket.OPEN?i.send(l):s.push(l)},close(c,l){o=!0;try{i?.close(c,l)}catch{}},get socket(){return i},get readyState(){return i?.readyState??3}}}function Eu(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}`}dn();var Si="application/vnd.webjs+json";async function Tu(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",Si);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 wi(r),n.has("content-type")||n.set("content-type",Si));let o=await fetch(e,{...t,headers:n,body:r}),i=o.headers.get("content-type")||"",s=await o.text(),a=i.includes(Si)?s?nt(s):null:i.includes("application/json")?s?JSON.parse(s):null:s;if(!o.ok){let c=a&&a.error||`richFetch ${e} -> ${o.status}`,l=new Error(c);throw l.status=o.status,l.body=a,l}return a}dn();Lr();Lr();Ei();yn();var ts=class{constructor(t,n){this.host=t,this.options=n,this.updates=[],this._nextId=0}get value(){let t=this.options.source();if(!this.options.update)return this.updates.length>0?this.updates[this.updates.length-1].payload:t;for(let n of this.updates)t=this.options.update(t,n.payload);return t}add(t,n){let r=`opt-${++this._nextId}`;this.updates.push({id:r,payload:t}),this.host?.requestUpdate?.();let o=()=>{let i=this.updates.findIndex(s=>s.id===r);i!==-1&&(this.updates.splice(i,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>o()).catch(()=>{}):n.then(()=>o(),()=>o())),o}};async function hf(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(i){throw e.set(r),i}return o&&o.success===!1&&e.set(r),o}function mf(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?hf(e,t,n):new ts(e,t)}Pr();Mr();var bf="application/vnd.webjs+stream",yf=1,gf=2,wf=3,Ec=new Uint8Array(0);function _f(e,t){let n=t||Ec,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 Sf(){let e=Ec;return{push(t){if(t&&t.length){let r=new Uint8Array(e.length+t.length);r.set(e,0),r.set(t,e.length),e=r}let n=[];for(;e.length>=5;){let r=e[0],o=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+o)break;let i=e.slice(5,5+o);n.push({type:r,payload:i}),e=e.slice(5+o)}return n}}}var Af=Symbol.for("webjs.context");function vf(e){return{__context__:Af,name:e}}var po=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},ns=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let i=o;if(i.context===this._context)if(o.stopPropagation(),i.subscribe){let s={callback:i.callback},a=()=>{this._subscriptions.delete(s)};this._subscriptions.add(s),i.callback(this._value,a)}else i.callback(this._value)},typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}setValue(t){if(!Object.is(this._value,t)){this._value=t;for(let n of this._subscriptions){let r=()=>{this._subscriptions.delete(n)};n.callback(t,r)}}}hostConnected(){this._host.addEventListener("context-request",this._onRequest)}hostDisconnected(){this._host.removeEventListener("context-request",this._onRequest),this._subscriptions.clear()}},rs=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 po(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 xf(){return typeof window<"u"}var xe={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},os=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=xe.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=xe.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=xe.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=xe.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 xe.INITIAL:return t.initial?.();case xe.PENDING:return t.pending?.();case xe.COMPLETE:return t.complete?.(this._value);case xe.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!xf())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{rs as ContextConsumer,ns as ContextProvider,po as ContextRequestEvent,I as FORM_ACTION_FIELD,us as FORM_ACTION_ID_KEY,yf as FRAME_CHUNK,gf as FRAME_END,wf as FRAME_ERROR,N as MARKER,La as SEED_MISS,bf as STREAM_CONTENT_TYPE,an as Signal,Au as Suspense,os as Task,xe as TaskStatus,hn as WebComponent,xi as WebjsFrame,Ti as WebjsStream,bi as activeActionSignal,yo as adoptStyles,Gl as allTags,Su as asset,Zc as asyncAppend,el as asyncReplace,gl as batch,Xc as cache,_l as computed,xu as connectWS,Uu as consumeStale,vf as createContext,Sf as createFrameDecoder,Jc as createRef,_u as cspNonce,Oc as css,la as deserialize,Qi as disableClientRouter,Al as effect,Zn as enableClientRouter,_f as encodeFrame,ls as escapeAttr,jc as escapeText,$u as fetchMark,pu as forbidden,zc as guard,Rc as html,Eo as isAsyncAppend,To as isAsyncReplace,bo as isCSS,ar as isCache,gu as isForbidden,ir as isGuard,or as isKeyed,zl as isLazy,se as isLive,bu as isNotFound,yu as isRedirect,sr as isRef,rr as isRepeat,Sl as isSignal,vu as isSuspense,P as isTemplate,xo as isTemplateContent,wu as isUnauthorized,vo as isUnsafeHTML,cr as isUntil,lr as isWatch,Vc as keyed,Kc as live,es as loadFrame,Kl as lookup,Vl as lookupModuleUrl,Oi as markStale,Zi as navigate,du as notFound,mf as optimistic,nt as parse,Li as parseTagHeader,Wl as primeModuleUrl,ha as prop,mu as redirect,Yc as ref,fo as refreshPage,gi as register,Hu as registerKeyTags,Ze as render,Ni as renderStream,xs as repeat,uo as revalidate,Tu as richFetch,jr as scanSeeds,Bu as seedStats,ca as serialize,Cr as setActiveActionSignal,wl as signal,wi as stringify,Lc as stylesToString,et as tagOf,Fu as takeSeed,Gc as templateContent,hu as unauthorized,Wc as unsafeHTML,Qc as until,tl as watch};
|
|
3
|
+
`);if(a!==c){if(i.length===1&&s.length===1){let l=s[0];for(let u of[...l.attributes])l.removeAttribute(u.name);for(let u of i[0].attributes)l.setAttribute(u.name,u.value);continue}for(let l of s)l.remove();for(let l of i)document.head.appendChild(Hi(l))}}for(let[o,i]of r)if(!n.has(o))for(let s of i)s.remove()}function Lt(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(he(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(r.tagName==="META"&&Wr(r)||n.has(he(r))||(r.tagName==="SCRIPT"?document.head.appendChild(Rn(r)):document.head.appendChild(Hi(r))));ff(e)}function df(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function On(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let i of t.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&r.add(he(i));let o=new Set;for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&o.add(he(i));for(let i of[...t.children])i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(df(i)||i.tagName==="META"&&Wr(i)===$r||o.has(he(i))||i.remove());for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(i.tagName==="META"&&Wr(i)===$r||r.has(he(i))||(i.tagName==="SCRIPT"?t.appendChild(Rn(i)):t.appendChild(Hi(i))))}var Ln=w(()=>{$()});function Gr(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 ie(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===_n)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Me(`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 Gr(e)}function Ui(e){if(!e||typeof document>"u")return null;let t=null;try{t=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{t=document.getElementById(e)}return!t||!t.tagName||t.tagName.toLowerCase()!=="webjs-frame"?null:t}function jn(e,t){let n=Ui(e);if(!n)return null;let r=Vr.has(n);return Vr.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 Pn(e,t){if(Vr.get(e)!==t)return;Vr.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 In(e,t,n){let r=zr.has(e);return zr.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 Mn(e,t,n,r){if(zr.get(e)!==t)return;zr.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 qi(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+=he(r);return n}var Vr,zr,$e=w(()=>{$();re();Ln();Vr=new WeakMap;zr=new WeakMap});function ic(e,t){if(typeof document>"u"||!document.documentElement)return()=>{};J&&J();let n=document.documentElement,r=n.style.getPropertyValue("overflow-anchor");n.style.setProperty("overflow-anchor","none");let o=null,i=typeof t=="number",a=i&&typeof setTimeout=="function"?setTimeout(()=>{i=!1},qa):null,c=typeof t=="number"&&typeof window<"u"?()=>{i&&(Math.abs(window.scrollY-t)<=1&&Math.abs(window.scrollX-(e||0))<=1||window.scrollTo({left:e||0,top:t,behavior:"instant"}))}:null,l=()=>{if(J===l){if(J=null,o&&(clearTimeout(o),o=null),a&&clearTimeout(a),i=!1,typeof window<"u"){for(let u of Pi)window.removeEventListener(u,l,{capture:!0});c&&window.removeEventListener("scroll",c)}r?n.style.setProperty("overflow-anchor",r):n.style.removeProperty("overflow-anchor")}};if(J=l,o=setTimeout(l,2e3),typeof window<"u"){for(let u of Pi)window.addEventListener(u,l,{capture:!0,passive:!0});c&&window.addEventListener("scroll",c,{passive:!0})}return l}function sc(e){if(typeof document>"u"||!document.documentElement)return()=>{};if(X&&X(),!(e>0))return()=>{};let t=document.documentElement,n=t.style.getPropertyValue("min-height");t.style.setProperty("min-height",e+"px");let r=null,o=()=>{X===o&&(X=null,r&&(clearTimeout(r),r=null),n?t.style.setProperty("min-height",n):t.style.removeProperty("min-height"))};return X=o,r=setTimeout(o,2e3),o}function Jr(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function Xr(){Yr+=1}function Fn(e,t){let n=rc(e)||rc(t);return n?(n.getAttribute("data-preserve-scroll")||"").toLowerCase().trim()!=="false":!1}function rc(e){return!e||typeof e.closest!="function"?null:e.closest("[data-preserve-scroll]")}var J,X,Yr,Qr=w(()=>{$();J=null;X=null;Yr=0});function Ki(e){if(!z||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Ur(e);if(!t||t.hasAttribute("download")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin)return;if(r.pathname===location.pathname&&r.search===location.search&&r.href.includes("#")){ec(r.href);return}if(t.hasAttribute("data-no-router")||Rt.test(r.pathname))return;e.preventDefault();let o=ie(t);$n(n,!1,o,{preserveScroll:Fn(t)})}function jt(e){ac(location.href)||$n(location.href,!0,null)}function Pt(e){if(!z||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=En(t,n);if(o==="dialog")return;let i=Nn(t,n),s=o==="get"||o==="head",a=Tn(t,n),c;try{c=new URL(a,location.href)}catch{return}if(c.origin!==location.origin||Rt.test(c.pathname))return;let l=kn(t,n);if(Wa(t,n,o,l),!s&&i==="text/plain")return;let u=Cn(l,i);e.preventDefault();let f=ie(n||t),d=Fn(n||t,t);cc(c.href,o,u,f,t,{preserveScroll:d})}var Zr=w(()=>{qr();$();we();re();Kr();$e();Qr();Bn()});function Wi(e){let t=me(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),T.has(t)&&T.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0,scrollHeight:typeof document<"u"&&document.documentElement&&document.documentElement.scrollHeight||0};for(T.set(t,n);T.size>16;){let r=T.keys().next().value;T.delete(r)}}function lc(e){let t=me(e),n=T.get(t);return n==null?null:(T.delete(t),T.set(t,n),n)}function me(e,t){let n=new URL(e,location.href),r=n.pathname+n.search;return t?`${t} ${r}`:r}var T,It=w(()=>{$();T=new Map});function wf(e){let t=be.get(e);return t==null?!1:Kn()-t>=Vi?(be.delete(e),!1):!0}function Ht(){be.clear()}function _f(e){for(be.has(e)&&be.delete(e),be.set(e,Kn());be.size>gf;)be.delete(be.keys().next().value)}function Wn(){try{let e=typeof navigator<"u"?navigator.connection:null;if(e&&(e.saveData===!0||typeof e.effectiveType=="string"&&/2g$/.test(e.effectiveType))||typeof matchMedia=="function"&&matchMedia("(prefers-reduced-data: reduce)").matches)return!0}catch{}return!1}function eo(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Sf(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function Bt(e){if(!e||!(e instanceof HTMLAnchorElement)||e.hasAttribute("download")||e.hasAttribute("data-no-router")||e.target&&e.target!=="_self")return null;let t=e.href;if(!t)return null;let n;try{n=new URL(t)}catch{return null}return n.origin!==location.origin||n.pathname===location.pathname&&n.search===location.search&&n.href.includes("#")||Rt.test(n.pathname)?null:t}function to(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Sf(e);return t.includes("external")||t.includes("no-prefetch")}function Dt(e){if(to(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 eo()?"intent":"viewport"}}function De(e,t){if(!z||typeof fetch!="function"||Wn())return;let n=me(e,t);if(typeof location<"u"&&n===me(location.href,t)||_e.has(n)||Dn.has(n))return;let r=v.get(n);if(r&&Kn()-r.at<Vi||wf(n))return;if(_e.size>=uc){for(Dn.add(n),Ft.push({href:e,frameId:t||null});Ft.length>mf;){let s=Ft.shift();Dn.delete(me(s.href,s.frameId))}return}let o=de();if(!o&&typeof document<"u"&&document.readyState==="loading")return;_e.add(n);let i={"x-webjs-router":"1","x-webjs-prefetch":"1"};o&&(i["x-webjs-have"]=o),t&&(i["x-webjs-frame"]=t),fetch(e,{method:"GET",headers:i,credentials:"same-origin",cache:"no-cache"}).then(async s=>{let a=s.headers.get("content-type")||"";if(!/^text\/html\b/i.test(a)||s.status>=400)return;let c=s.headers.get("x-webjs-build"),l=s.headers.get("x-webjs-src"),u=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,f=u?u.getAttribute("data-webjs-build"):null,d=u?u.getAttribute("data-webjs-src"):null;if((c&&f&&c!==f||l&&d&&l!==d)&&(T.clear(),at(n),Ht()),(s.headers.get("x-webjs-frame")||null)!==(t||null)){_f(n);return}let p=s.redirected&&s.url?s.url:e,y=await s.text();qn.has(n)||vf(n,{html:y,build:c,src:l,finalUrl:p,frameId:t||null,at:Kn()})}).catch(()=>{}).finally(()=>{_e.delete(n),qn.delete(n),Af()})}function Af(){for(;Ft.length&&_e.size<uc;){let{href:e,frameId:t}=Ft.shift();Dn.delete(me(e,t)),De(e,t)}}function vf(e,t){for(v.has(e)&&v.delete(e),v.set(e,t);v.size>hf;){let n=v.keys().next().value;v.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function no(e){let t=/<!--wj:children:([^>]*?)-->/.exec(e||"");return t?t[1]:null}function Vn(e,t,n){let r=me(e,n),o=v.get(r);if(!o)return null;if(Kn()-o.at>=Vi)return v.delete(r),null;if(o.frameId)return v.delete(r),Ui(o.frameId)?o:null;let i=no(o.html);return i&&!new Set(String(t??(de()||"")).split(",").filter(Boolean)).has(i)?(v.delete(r),null):(v.delete(r),o)}function Kn(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function st(e){if(!z)return;let t=Di(e.target);if(!t)return;let n=Dt(t);if(n==="none"||n==="render")return;let r=Bt(t);if(r){if(e.type==="touchstart"){De(r,ie(t));return}n==="intent"&&(Hn===t&&$t||(zn(),Hn=t,$t=setTimeout(()=>{$t=null,Hn=null,De(r,ie(t))},bf)))}}function zi(e){let t=Di(e.target);t&&t===Hn&&zn()}function zn(){$t&&(clearTimeout($t),$t=null),Hn=null}function ro(){for(let e of Un)clearTimeout(e);Un.clear(),Mt=new WeakMap}function oo(){if(typeof document>"u"||Wn())return;let e=typeof IntersectionObserver<"u";e&&(Be?(Be.disconnect(),ro()):Be=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(Mt.has(r))continue;let o=setTimeout(()=>{Un.delete(o),Mt.delete(r),Be.unobserve(r);let i=Bt(r);i&&Dt(r)==="viewport"&&De(i,ie(r))},yf);Mt.set(r,o),Un.add(o)}else{let o=Mt.get(r);o&&(clearTimeout(o),Un.delete(o),Mt.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=Dt(t);if(n==="render"){let r=Bt(t);r&&De(r,ie(t))}else n==="viewport"&&e&&Be.observe(t)}}function at(e){v.clear();for(let t of _e)t!==e&&qn.add(t)}function fc(e,t){let n=me(e,t);v.delete(n),_e.has(n)&&qn.add(n)}function dc(e,t){return v.get(me(e,t))||null}function pc(){return _e.size}function hc(){v.clear(),be.clear(),_e.clear(),qn.clear(),Ft.length=0,Dn.clear(),zn(),ro()}function mc(){Be&&(Be.disconnect(),Be=null)}var hf,Vi,uc,mf,bf,yf,v,be,gf,_e,qn,Ft,Dn,$t,Hn,Be,Mt,Un,ct=w(()=>{qr();Fe();$();$e();we();It();hf=8,Vi=3e4,uc=3,mf=24,bf=100,yf=250,v=new Map,be=new Map,gf=16;_e=new Set,qn=new Set,Ft=[],Dn=new Set,$t=null,Hn=null,Be=null,Mt=new WeakMap,Un=new Set});function Gi(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 Gn(e){if(!e.body||typeof e.body.getReader!="function")return{shell:await e.text(),streaming:!1};let t=e.body.getReader(),n=new TextDecoder,r="",o="<template data-webjs-resolve",i="<!--wj-stream-shell-->",s=/<\/html\s*>/i;for(;;){let{value:a,done:c}=await t.read();a&&(r+=n.decode(a,{stream:!0})),c&&(r+=n.decode());let l=r.indexOf(i);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+i.length)};let u=r.indexOf(o);if(u!==-1)return{shell:r.slice(0,u),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(u)};if(c)return{shell:r,streaming:!1};let f=s.exec(r);if(f){let d=f.index+f[0].length;return{shell:r.slice(0,d),streaming:!0,reader:t,dec:n,rest:r.slice(d)}}}}function io(e){let t=/<template\s+data-webjs-resolve="([^"]+)"\s*>/i.exec(e);if(!t)return null;let n=t[1],r=t.index+t[0].length,o=/<(\/?)template\b[^>]*>/gi;o.lastIndex=r;let i=1,s;for(;s=o.exec(e);)if(s[1]==="/"){if(i--,i===0)return{id:n,content:e.slice(r,s.index),rest:e.slice(s.index+s[0].length)}}else i++;return null}function so(e,t){let n=document.getElementById(e);if(!n){za(e);return}let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];n.replaceWith(r.content);for(let i of o)i.nodeType===1&&ao(i)}async function Yn(e,t,n,r){let o=n,i=()=>{let s;for(;s=io(o);){if(!r())return!1;so(s.id,s.content),o=s.rest}return!0};if(!e){i();return}try{for(;;){if(!i()){try{await e.cancel()}catch{}return}let{value:s,done:a}=await e.read();if(s&&(o+=t.decode(s,{stream:!0})),a){o+=t.decode(),i();return}}}catch{}}var Jn=w(()=>{re();lt()});function qt(){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 ut(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(qt()&&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 Xn(e,t){if(!e||!t||typeof e.querySelectorAll!="function")return;let n=e.querySelectorAll("[data-webjs-permanent][id]");for(let r of n){let o=r.id;if(!o)continue;let i=null;try{i=t.querySelector(`#${CSS.escape(o)}`)}catch{i=null}if(!i||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let s=i.parentNode;s&&i!==r&&(s.replaceChild(r,i),Ut.add(r))}}function Se(e,t){let n=[];for(let r of e){if(r.nodeType!==1)continue;let o=r;if(o.hasAttribute&&o.hasAttribute("data-webjs-permanent")&&o.id&&n.push(o),typeof o.querySelectorAll=="function")for(let i of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(i)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let i=xf(t,o);if(!i||i===r)continue;let s=i.parentNode;if(s)s.replaceChild(r,i),Ut.add(r);else{let a=t.indexOf(i);a!==-1&&(t[a]=r,Ut.add(r))}}}function xf(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}var Ut,ft=w(()=>{Ut=new WeakSet});function bc(e,t){let n=[];for(let r=e.parentNode;r;r=r.parentNode)if(n.unshift(r),r===t)return n;return null}function wc(e,t,n,r){let o=bc(e.start,n),i=bc(t.start,r);if(!o||!i||o.length!==i.length)return null;for(let s=1;s<o.length;s++)if(o[s].tagName!==i[s].tagName||Yi(o[s]))return null;return{live:o,incoming:i,liveRange:e,incomingRange:t}}function yc(e,t,n){let r=[],o=[],i=r;for(let s=e.firstChild;s;s=s.nextSibling)s===t&&(i=null),i&&i.push(s),s===n&&(i=o);return{before:r,after:o}}function Ef(e,t){for(let n of t.attributes)ge.has(n.name)||n.name==="data-wj-serialized"||e.getAttribute(n.name)!==n.value&&e.setAttribute(n.name,n.value);for(let n of[...e.attributes])ge.has(n.name)||t.hasAttribute(n.name)||e.removeAttribute(n.name)}function Tf(e,t){let n=new Map;for(let s of e){if(s.nodeType!==1)continue;let a=Q(s);a&&n.set(a,s)}let r=new Set,o=0,i=[];for(let s of t){if(s.nodeType===1){let c=Q(s),l=c?n.get(c):null;if(l&&!r.has(l)){r.add(l),Ae(l,s),i.push(l),o=Math.max(o,e.indexOf(l)+1);continue}}let a=o;for(;a<e.length;a++){let c=e[a];if(r.has(c)||c.nodeType!==s.nodeType)continue;if(c.nodeType!==1)break;let l=c;if(!Q(l)&&l.tagName===s.tagName)break}if(a<e.length&&(s.nodeType===1||s.nodeType===3||s.nodeType===8)){let c=e[a];r.add(c),c.nodeType===1?Ae(c,s):c.nodeValue!==s.nodeValue&&(c.nodeValue=s.nodeValue),i.push(c),o=a+1;continue}i.push(s)}return i}function gc(e,t,n,r,o){let i=n.map(u=>document.importNode(u,!0));Se(t,i);let s=Tf(t,i),a=new Set(s),c=r;if(o){let u=-1;for(let d=0;d<t.length;d++)a.has(t[d])&&(u=d);let f=t.slice(u+1);if(f.length){for(let d of f)a.add(d);c=f[0]}}for(let u of t)!a.has(u)&&u.parentNode===e&&e.removeChild(u);for(let u=s.length-1;u>=0;u--){let f=s[u];(f.parentNode!==e||f.nextSibling!==c)&&e.insertBefore(f,c),c=f}let l=new Set(t);return s.filter(u=>!l.has(u))}function _c(e){let{live:t,incoming:n,liveRange:r,incomingRange:o}=e,i=[];for(let s=0;s<t.length;s++){let a=t[s],c=n[s];s>0&&Ef(a,c);let l=s===t.length-1,u=l?r.start:t[s+1],f=l?r.end:t[s+1],d=l?o.start:n[s+1],b=l?o.end:n[s+1],p=yc(a,u,f),y=yc(c,d,b),m=[...gc(a,p.before,y.before,u,!1),...gc(a,p.after,y.after,null,s===0)];for(let g of m)g.nodeType===1&&i.push(He(g));for(let g of[p.before,p.after])for(let h of g)h.nodeType===1&&h.isConnected&&i.push(h)}for(let s of i)s.isConnected&&ve(s)}var Sc=w(()=>{$();dt();lt();ft()});function ht(e,t,n,r,o,i,s,a){let c=!1,l=()=>{if(!c){c=!0;try{Pr(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"]'),y=p?p.getAttribute("data-webjs-build"):null,m=!1;if(o&&y&&(m=o!==y),!m&&e.head&&e.head.children.length>0){let g=qi(document),h=qi(e);g!==h&&(m=!0)}if(m&&typeof location<"u"){T.clear(),at(),Ht();try{let g="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(g))sessionStorage.removeItem(g),ne("deploy-mismatch-reload-suppressed",r,!1);else return sessionStorage&&sessionStorage.setItem(g,"1"),ne("deploy-mismatch",r),pe(r),"none"}catch{return ne("deploy-mismatch",r),pe(r),"none"}}else if(!m){let g=p?p.getAttribute("data-webjs-src"):null;i&&g&&i!==g&&(T.clear(),at(),Ht(),p&&p.setAttribute("data-webjs-src",i));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){l();let p=document.querySelector(`webjs-frame#${CSS.escape(t)}`),y=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(p&&y){a&&a(),Lt(e.head),Ue=ut(()=>{Tc(p,y),He(p),ve(p),Gi(e.body),pt()},()=>ve(p));return}let m=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});return(p||document).dispatchEvent(m),m.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`),"none"}if(s==="shell"){l(),a&&a(),Ji(e);return}let u=oe(document.body),f=oe(e.body),d=u&&f?An(u,f):null,b=d&&s==="layouts"?wc(d.live,d.incoming,document.body,e.body):null;if(d&&s==="layouts"&&!b){l(),a&&a(),Ji(e);return}if(d){l(),a&&a();let{mode:p,live:y,incoming:m}=d;Lt(e.head),Ue=ut(()=>{p==="replace"?vc(y,m):xc(y,m,e),Ec(y.start,m.start),b&&_c(b),Gi(e.body),pt()},()=>Ac(y));return}if(r&&!n&&typeof location<"u")return ne(u?f?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),pe(r),"none";if(r&&n)return ne("revalidation-discarded",r,!1),"discard";l(),a&&a(),Ji(e)}function Ji(e){On(e.head),Xn(document.body,e.body);let t=[...e.body.childNodes];Ue=ut(()=>{document.body.replaceChildren(...t),He(document.body),ve(document.body),pt()},()=>ve(document.body))}var Ue,Qn=w(()=>{Ir();Fe();re();dt();$e();Ln();Sc();ct();It();we();Jn();lt();ft();Ue=Promise.resolve()});function Nc(){Xi||typeof MutationObserver>"u"||typeof customElements>"u"||(Xi=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)}}),Xi.observe(document.body,{childList:!0,subtree:!0}))}function Ac(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&ve(t)}function ve(e){typeof customElements>"u"||ao(e)}function ao(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&&ao(n.shadowRoot))}function He(e){if(e.tagName==="SCRIPT"){let n=Rn(e);return e.replaceWith(n),n}let t=[];Ut.has(e)&&t.push(e);for(let n of e.querySelectorAll("[data-webjs-permanent]"))Ut.has(n)&&t.push(n);for(let n of e.querySelectorAll("script"))t.length&&t.some(r=>r!==n&&r.contains(n))||n.replaceWith(Rn(n));return e}function Zn(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=He(n);r.isConnected!==!1&&ve(r)}}var Xi,lt=w(()=>{Fe();$();re();dt();xn();Zr();Kr();$e();Ln();ct();It();Jn();Qn();ft();Xi=null});function pt(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function vc(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)r.push(i);let o=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)o.push(document.importNode(i,!0));Se(r,o);for(let i of r)i.parentNode===n&&n.removeChild(i);for(let i of o)n.insertBefore(i,e.end);Zn(e)}function xc(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)o.push(s);let i=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)i.push(document.importNode(s,!0));Se(o,i),Nf(r,e.start,e.end,o,i),Zn(e)}function Nf(e,t,n,r,o){let i=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=Q(c);l&&i.set(l,c)}let s=n,a=[];for(let c of o){if(c.nodeType===1){let l=Q(c);if(l&&i.has(l)){let u=i.get(l);Ae(u,c),a.push(u),i.delete(l);continue}}a.push(c)}for(let c of r)if(c.parentNode===e){if(c.nodeType===1&&a.includes(c))continue;e.removeChild(c)}for(let c of a)e.insertBefore(c,s)}function Ae(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),!ge.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])ge.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(Yi(e)){kf(e,t);return}Kt(e,t)}function Yi(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[_]!=null}function Cf(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function co(e){let t=new Map,n=`slot[${S}][${O}="${M}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!Cf(o,e)||Wo(e,o))continue;let i=!1;for(let a=o.parentElement;a&&a!==e;a=a.parentElement)if(a.tagName==="SLOT"&&a.hasAttribute(S)&&a.getAttribute(O)===M){i=!0;break}if(i)continue;let s=q(o.getAttribute("name"));t.has(s)||t.set(s,o)}return t}function Ec(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(S))return;let o=null;for(let f=r.parentElement;f;f=f.parentElement){if(f[_]){o=f;break}if(f.tagName.includes("-"))return}if(!o)return;let i=q(r.getAttribute("name"));Re(o,i,[...r.childNodes]);let s=t.parentNode;if(!s||s.nodeType!==1)return;let a=s;if(a.tagName!=="SLOT")return;let c=null;for(let f=a.parentElement;f;f=f.parentElement)if(f.tagName.includes("-")){c=f;break}if(!c||c.tagName!==o.tagName)return;let l=co(o),u=co(c);for(let f of new Set([...l.keys(),...u.keys()])){if(f===i)continue;let d=u.get(f);d?Re(o,f,[...d.childNodes].map(b=>document.importNode(b,!0))):l.get(f)&&Re(o,f,null)}}function kf(e,t){if(!e[_])return;let n=co(e),r=co(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let i of o){let s=n.get(i),a=r.get(i);s&&a?(Kt(s,a),Re(e,i,[...s.childNodes])):a?Re(e,i,[...a.childNodes].map(c=>document.importNode(c,!0))):Re(e,i,null)}}function Kt(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));Se(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=Q(a);c&&o.set(c,a)}let i=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=Q(c);if(l&&o.has(l)){let f=o.get(l);Ae(f,c),i.push(f),o.delete(l);continue}let u=n[a];if(u&&u.nodeType===1&&!Q(u)&&u.tagName===c.tagName&&Rf(u,c)){Ae(u,c),i.push(u);continue}}else if(c.nodeType===3){let l=n[a];if(l&&l.nodeType===3){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),i.push(l);continue}}else if(c.nodeType===8){let l=n[a];if(l&&l.nodeType===8){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),i.push(l);continue}}i.push(c)}let s=new Set(i);for(let a of n)!s.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<i.length;a++){let c=i[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function Rf(e,t){let n=e.localName;return n!=="input"&&n!=="select"&&n!=="textarea"?!0:!(e.getAttribute("name")!==t.getAttribute("name")||n==="input"&&(e.getAttribute("type")||"text").toLowerCase()!==(t.getAttribute("type")||"text").toLowerCase())}function Q(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Wt(){let e=oe(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((c,l)=>l.length-c.length),n=null,r=null;for(let c of t){let l=document.getElementById(`wj-loading:${c}`);if(l instanceof HTMLTemplateElement){n=c,r=l;break}}if(n===null||r===null)return null;let o=e.get(n),i=de(),s=[];for(let c=o.start.nextSibling;c&&c!==o.end;c=c.nextSibling)s.push(c);let a=document.createRange();return a.setStartAfter(o.start),a.setEndBefore(o.end),a.deleteContents(),o.start.parentNode.insertBefore(r.content.cloneNode(!0),o.end),{slot:o,oldChildren:s,token:E,haveKeys:i}}function qe(e){if(!e||e.token!==E)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 Tc(e,t){Kt(e,t)}var dt=w(()=>{Xe();Fe();$();we();lt();ft()});function Of(e){if(typeof document>"u"||!document.body)return!1;let t=oe(document.body);if(!t)return!1;let n,r=-1;for(let[c,l]of t)c.length>r&&(r=c.length,n=l);if(!n)return!1;let o=n.start.parentNode;if(!o||n.start.parentNode!==n.end.parentNode)return!1;let i=document.createElement("div");i.setAttribute("role","alert"),i.setAttribute("data-webjs-nav-error","");let s=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";i.textContent=s;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),o.insertBefore(i,n.end),!0}function lo(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||Of(t)||typeof location<"u"&&(ne("navigation-error-unrecoverable",e),pe(e))}var Cc=w(()=>{Fe();re();we()});async function er(e,t,n,r,o,i,s,a,c,l){o=o||"GET";let u=l&&l.refresh||void 0,f=i!=null&&o!=="GET"&&o!=="HEAD"&&!t,d=!!(l&&l.noPrefetch),b=!!(l&&l.preserveScroll),p=typeof a=="number"?a:E,y,m=null,g=null,h=null,x=null,N=!1,B=e,mt=t?jn(t,p):null;try{try{let D=o==="GET"&&!i&&!u&&!d?Vn(e,r?r.haveKeys:void 0,t):null;if(D)y=D.html,g=D.build,h=D.src,B=D.finalUrl,x=200,N=!0;else{let Ke={"x-webjs-router":"1"},ss=u||f?"":de();ss&&(Ke["x-webjs-have"]=ss),t&&(Ke["x-webjs-frame"]=t),i!=null&&o!=="GET"&&o!=="HEAD"&&(Ke.accept=ji+", text/html");let mo={method:o,headers:Ke,credentials:"same-origin",cache:"no-cache"};s&&(mo.signal=s),i!=null&&o!=="GET"&&o!=="HEAD"&&(mo.body=i);let H=await fetch(e,mo);x=H.status,N=H.ok;let as=Li(H.headers.get("x-webjs-invalidate"));as.length&&Oi(as);let cs=H.headers.get("content-type")||"",Dc=/^text\/html\b/i.test(cs);if(cs.toLowerCase().indexOf(ji)===0){let Hc=await H.text(),nr=p===E;return nr&&(qe(r),Ni(Hc)),{ok:nr&&N,status:x,aborted:!nr,applied:nr}}if(H.redirected&&H.url&&(B=H.url),H.status===204||H.status===205)return p===E&&n&&history.pushState(null,"",B),{ok:N,status:x,aborted:!1,applied:!1};if(!Dc)return p===E&&(qe(r),lo(e,H.status,null)),{ok:!1,status:x,aborted:!1,applied:!1};g=H.headers.get("x-webjs-build"),h=H.headers.get("x-webjs-src");let bo=await Gn(H);y=bo.shell,bo.streaming&&(m=bo)}}catch(D){return D&&D.name==="AbortError"?{ok:!1,status:null,aborted:!0,applied:!1}:p!==E?{ok:!1,status:null,aborted:!0,applied:!1}:(qe(r),lo(e,null,D instanceof Error?D:new Error(String(D))),{ok:!1,status:null,aborted:!1,applied:!1})}if(p!==E){if(m&&m.reader)try{m.reader.cancel()}catch{}return{ok:!1,status:x,aborted:!0,applied:!1}}let Vt=it(y);if(!Vt)return qe(r),lo(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:x,aborted:!1,applied:!1};let bt=!1,yt=n?()=>{bt||(bt=!0,history.pushState(null,"",B))}:null,L=ht(Vt,t,!!c,B,g,h,u||(f?"layouts":void 0),yt),Bc=L!=="none";if(L==="discard"){if(m&&m.reader)try{m.reader.cancel()}catch{}return{ok:N,status:x,aborted:!1,applied:!1}}if(yt&&yt(),n&&!t){let D=new URL(B),Ke=D.hash?document.getElementById(D.hash.slice(1)):null;Ke?Ke.scrollIntoView():b||(Ga(),window.scrollTo({left:0,top:0,behavior:"instant"}))}return m&&(m.reader||m.rest)&&Ue.then(()=>Yn(m.reader,m.dec,m.rest,()=>p===E)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:B,frameId:t,from:"navigate"}})),{ok:N,status:x,aborted:!1,applied:Bc}}finally{mt&&Pn(mt,p)}}var kc=w(()=>{Fr();wn();Fe();$();re();dt();xn();$e();Cc();Bn();ct();we();Jn();Qn()});function Qi(e){if(e.id)return`id:${e.id}`;let t=e.querySelector(`input[name="${Rc}"]`);return t?`act:${t.getAttribute("value")||""}`:`url:${e.getAttribute("action")||""}`}function jf(e,t){let n=0;for(let r of document.querySelectorAll("form")){if(r===e)return n;Qi(r)===t&&n++}return-1}function Pf(e){let t=e.localName;if(t==="textarea")return"text";if(t==="select")return"select";if(t!=="input")return null;let n=(e.getAttribute("type")||"text").toLowerCase();return Lf.has(n)?null:n==="checkbox"||n==="radio"?"check":"text"}function Oc(e){let t=new Map,n=[],r=e.elements?[...e.elements]:[...e.querySelectorAll("input, textarea, select")];for(let o of r){let i=o.getAttribute&&o.getAttribute("name");if(!i||i===Rc)continue;let s=Pf(o);if(!s)continue;let a=s==="check"?`${i}\0${o.getAttribute("value")??"on"}`:i,c=t.get(a)||0;t.set(a,c+1),n.push({el:o,name:i,kind:s,n:c})}return n}function Lc(e,t){if(t==="check")return{def:String(!!e.defaultChecked),cur:String(!!e.checked)};if(t==="select"){let n=[...e.options];return{def:JSON.stringify(n.map(r=>r.defaultSelected)),cur:JSON.stringify(n.filter(r=>r.selected).map(r=>r.value))}}return{def:e.defaultValue??"",cur:e.value??""}}function jc(e){if(!e||e.getAttribute("data-preserve-values")==="false")return null;let t=Qi(e),n=Oc(e).map(({el:r,name:o,kind:i,n:s})=>({name:o,kind:i,n:s,...i==="check"?{value:r.getAttribute("value")??"on"}:{},...Lc(r,i)}));return n.length?{form:e,key:t,ord:jf(e,t),controls:n}:null}function If(e){if(e.form.isConnected)return e.form;let t=0;for(let n of document.querySelectorAll("form"))if(Qi(n)===e.key){if(t===e.ord)return n;t++}return null}function Pc(e){if(!e)return 0;let t=If(e);if(!t)return 0;let n=new Map;for(let o of Oc(t)){let i=o.kind==="check"?`${o.name}\0${o.el.getAttribute("value")??"on"}\0${o.n}`:`${o.name}\0${o.n}`;n.set(i,o)}let r=0;for(let o of e.controls){let i=o.kind==="check"?`${o.name}\0${o.value}\0${o.n}`:`${o.name}\0${o.n}`,s=n.get(i);if(!s||s.kind!==o.kind)continue;let a=Lc(s.el,s.kind);if(a.def===o.def&&a.cur!==o.cur){if(o.kind==="check")s.el.checked=o.cur==="true";else if(o.kind==="select"){let c=new Set(JSON.parse(o.cur));for(let l of s.el.options)l.selected=c.has(l.value)}else s.el.value=o.cur;r++}}return r}var Rc,Lf,Ic=w(()=>{Rc="__webjs_action",Lf=new Set(["password","file","hidden","submit","button","image","reset"])});function ac(e){if(!tc(e)||!G)return!1;let t,n;try{t=new URL(G),n=new URL(e,location.href)}catch{return!1}return t.pathname!==n.pathname||t.search!==n.search?!1:(G=n.href,!0)}function tr(){z||typeof document>"u"||($i(!0),globalThis.__webjsRefreshPage=po,document.addEventListener("click",Ki,!1),document.addEventListener("submit",Pt,!1),window.addEventListener("popstate",jt),document.addEventListener("pointerover",st,!0),document.addEventListener("focusin",st,!0),document.addEventListener("touchstart",st,{capture:!0,passive:!0}),document.addEventListener("pointerout",zi,!0),document.addEventListener("webjs:navigate",oo),Nc(),oo(),typeof history<"u"&&"scrollRestoration"in history&&(uo=history.scrollRestoration,history.scrollRestoration="auto"),typeof location<"u"&&(G=location.href),Va())}function Zi(){z&&($i(!1),document.removeEventListener("click",Ki,!1),document.removeEventListener("submit",Pt,!1),window.removeEventListener("popstate",jt),Hr(),document.removeEventListener("pointerover",st,!0),document.removeEventListener("focusin",st,!0),document.removeEventListener("touchstart",st,{capture:!0}),document.removeEventListener("pointerout",zi,!0),document.removeEventListener("webjs:navigate",oo),zn(),ro(),mc(),typeof history<"u"&&uo!==null&&(history.scrollRestoration=uo,uo=null),Xr(),J&&J(),X&&X(),G=null,delete globalThis.__webjsRefreshPage)}async function es(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){pe(e);return}await $n(n.href,t?.replace??!1,null,{preserveScroll:t?.scroll===!1})}async function ts(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1,applied:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1,applied:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1,applied:!1};Z&&Z.abort(),Z=new AbortController;let o=Z.signal,i=Dr(),s=await er(r.href,n,!1,null,"GET",null,o,i,!1,{noPrefetch:!0});return s&&s.applied&&fc(r.href,n),s}function fo(e){if(!e){T.clear(),at();return}let t=new URL(e,location.href),n=t.pathname+t.search;T.delete(n),v.delete(n);let r=` ${n}`;for(let o of[...v.keys()])o.endsWith(r)&&v.delete(o)}async function po(e){if(!z||typeof location>"u")return!1;fo(),Ht();try{let t=await $n(location.href,!1,null,{refresh:e==="shell"?"shell":"page"});return!t||t.aborted?!0:t.applied}catch{return!1}}async function $n(e,t,n,r){Hr();let o=r&&r.refresh||void 0,i=!!(r&&r.preserveScroll);if(Fi(t,n)&&typeof location<"u")return ne("readyState-loading",e),pe(e),null;Z&&Z.abort(),Z=new AbortController;let s=Z.signal,a=Dr();n||(Xr(),J&&J(),X&&X()),!o&&G&&Wi(G);let c=setTimeout(()=>{Sn(!0),c=null},150),l=null;!t&&!o&&(l=Wt());let u=!1;try{if(t){let d=lc(e);if(d){let b=it(d.html);if(b){let p=sc(d.scrollHeight);ht(b,n,!0,null);let y=()=>{};if(typeof window<"u"){let h=()=>{y=ic(d.scrollX,d.scrollY)};if(qt()&&typeof document.startViewTransition=="function"){let x=Yr;Ue.then(()=>{x!==Yr||!z||h()}).catch(()=>{})}else h()}let m=er(e,n,!1,l,"GET",null,s,a,!0).catch(()=>{}),g=new Promise(h=>setTimeout(h,500));return Promise.all([m,g]).then(()=>Jr(()=>{y(),Jr(p)})),null}}u=!0,typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}let f=await er(e,n,!t&&!o,l,"GET",null,s,a,!1,{refresh:o,preserveScroll:i});return u&&f&&f.applied&&typeof window<"u"&&Jr(()=>{a!==E||!z||window.scrollTo({left:0,top:0,behavior:"instant"})}),f}finally{c&&clearTimeout(c),a===E&&(Sn(!1),typeof location<"u"&&(G=location.href))}}async function cc(e,t,n,r,o,i){Hr(),Z&&Z.abort(),Z=new AbortController;let s=Z.signal,a=Dr();r||(Xr(),J&&J(),X&&X());let c=t==="get"||t==="head",l=new URL(e,location.href);if(c){l.search="";for(let[y,m]of n)l.searchParams.append(y,typeof m=="string"?m:m.name)}G&&Wi(G);let u=setTimeout(()=>{Sn(!0),u=null},150),f=Wt(),d=o?In(o,a,l.href):null,b=c?null:jc(o),p=!1;try{let y=await er(l.href,r,!0,f,c?"GET":t.toUpperCase(),c?null:n,s,a,!1,{preserveScroll:!!(i&&i.preserveScroll)});p=!!(y&&y.ok),b&&y&&y.applied&&!y.ok&&a===E&&(await Ue,a===E&&Pc(b)),!c&&a===E&&(T.clear(),at())}finally{d&&Mn(d,a,l.href,p),u&&clearTimeout(u),a===E&&(Sn(!1),typeof location<"u"&&(G=location.href))}}function Mc(){return G}function Fc(e){G=e}var Z,G,uo,Bn=w(()=>{$();re();dt();xn();Zr();kc();$e();Ic();ct();Qr();It();we();Qn();lt();ft();Z=null,G=null;uo=null});var Ia={};ls(Ia,{_FALLBACK_MARKER_KEY:()=>ot,_FRAME_TOP:()=>_n,_LIVE_ATTRS:()=>ge,_activateSwappedRange:()=>Zn,_activeFrameId:()=>Gr,_addNewHeadElements:()=>Lt,_applyOptimisticLoading:()=>Wt,_applyStreamedResolve:()=>so,_applySwap:()=>ht,_blurOutgoingFocus:()=>pt,_buildHaveHeader:()=>de,_buildSubmitFormData:()=>kn,_bumpNavToken:()=>Za,_clearFormBusy:()=>Mn,_clearFrameBusy:()=>Pn,_collectBoundaries:()=>oe,_currentPageUrl:()=>Mc,_diffElementInPlace:()=>Ae,_eligibleAnchorHref:()=>Bt,_encodeSubmitBody:()=>Cn,_findAnchorInPath:()=>Ur,_getSubmitAction:()=>Tn,_getSubmitEnctype:()=>Nn,_getSubmitMethod:()=>En,_isNonHtmlPath:()=>Ua,_isPreBootNavigation:()=>Br,_keyOf:()=>Q,_markFormBusy:()=>In,_markFrameBusy:()=>jn,_mergeHead:()=>On,_navToken:()=>Qa,_onPopState:()=>jt,_onSubmit:()=>Pt,_parseHTML:()=>it,_planBoundarySwap:()=>An,_prefetch:()=>De,_prefetchAnchor:()=>no,_prefetchCache:()=>v,_prefetchHasHoverPointer:()=>eo,_prefetchInflightSize:()=>pc,_prefetchMode:()=>Dt,_prefetchPeek:()=>dc,_prefetchSaysSaveData:()=>Wn,_prefetchSuppressed:()=>to,_prefetchTake:()=>Vn,_reactivateScripts:()=>He,_readStreamedShell:()=>Gn,_reconcileChildren:()=>Kt,_regraftPermanentElements:()=>Xn,_regraftPermanentInSlice:()=>Se,_resetParseProbe:()=>Bi,_resetPrefetch:()=>hc,_resetWarnOnce:()=>Ya,_resolvePreserveScroll:()=>Fn,_resolveTargetFrameId:()=>ie,_restoreOptimistic:()=>qe,_runWithTransition:()=>ut,_setCurrentPageUrl:()=>Fc,_setHardNavigate:()=>Xa,_shouldFullLoadDuringParse:()=>Ja,_snapshotCache:()=>T,_streamBoundariesProgressively:()=>Yn,_takeResolveUnit:()=>io,_viewTransitionsEnabled:()=>qt,disableClientRouter:()=>Zi,enableClientRouter:()=>tr,loadFrame:()=>ts,navigate:()=>es,refreshPage:()=>po,revalidate:()=>fo});var jr=w(()=>{Ei();wn();wn();Ee();Fa();Ir();Fr();Xe();Bn();$();re();Bn();ct();we();Fe();$();re();dt();xn();qr();Zr();Kr();$e();Ln();ct();Qr();It();Jn();Qn();lt();ft();(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&tr()});function qc(e,...t){return{_$webjs:"template",strings:e,values:t}}function P(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var C="wjm-";function Kc(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 yo(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function go(e,t){if(!(!t||!t.length))if("adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"){let n=t.map(r=>{let o=new CSSStyleSheet;return o.replaceSync(r.text),o});e.adoptedStyleSheets=n}else{let n=e,r=document.createElement("style");r.textContent=t.map(o=>o.text).join(`
|
|
4
|
+
`),n.appendChild(r)}}function Wc(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
|
|
5
|
+
`)}</style>`}Ee();var xs=Symbol.for("webjs.repeat");function Es(e,t,n){return{[xs]:!0,items:[...e],keyFn:t,templateFn:n}}function ir(e){return!!e&&typeof e=="object"&&e[xs]===!0}function sl(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function xo(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function al(e){return{_$webjs:"live",value:e}}function se(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function cl(e,t){return{_$webjs:"keyed",key:e,value:t}}function sr(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function ll(e,t){return{_$webjs:"guard",deps:e,fn:t}}function ar(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function ul(e){return{_$webjs:"template-content",template:e}}function Eo(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function fl(e){return{_$webjs:"ref",target:e}}function cr(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function dl(){return{value:void 0}}function pl(e){return{_$webjs:"cache",value:e}}function lr(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function hl(...e){return{_$webjs:"until",args:e}}function ur(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function ml(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function To(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function bl(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function No(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function yl(e){return{_$webjs:"watch",signal:e}}function fr(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}Yt();Xe();Yt();Ee();Xe();var wr=new WeakMap,_r=new WeakMap,sn=Symbol.for("webjs.instance");function _t(e){let{strings:t}=e,n=wr.get(t);if(n)return n;let r=[],o="",i="text",s="",a=0,c="",l=0,u=null,f="",d="";for(let y=0;y<t.length;y++){let m=t[y];for(let g=0;g<m.length;g++){let h=m[g];switch(i){case"text":o+=h,h==="<"&&(i="tag-open");break;case"tag-open":o+=h,h==="!"?i="bang-1":h==="/"?(i="tag-name",f=""):/[a-zA-Z]/.test(h)?(i="tag-name",f=h.toLowerCase()):i="text";break;case"bang-1":o+=h,i=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=h,h==="-"?(i="comment",l=0):i="tag-name";break;case"comment":o+=h,h==="-"?l+=1:(h===">"&&l>=2&&(i="text"),l=0);break;case"tag-name":o+=h,h===">"?(i=f==="script"||f==="style"?"rawtext":"text",i==="rawtext"&&(d="")):/\s/.test(h)?i="in-tag":f+=h.toLowerCase();break;case"in-tag":o+=h,h===">"?(i=f==="script"||f==="style"?"rawtext":"text",i==="rawtext"&&(d="")):!/\s/.test(h)&&h!=="/"&&(i="attr-name",s=h,a=o.length-1);break;case"rawtext":o+=h,d=(d+h.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(i="text",d="",f="");break;case"attr-name":h==="="?(i="after-eq",o+=h):/\s/.test(h)?(i="in-tag",s="",o+=h):h===">"?(i="text",s="",o+=h):(s+=h,o+=h);break;case"after-eq":h==='"'||h==="'"?(i="attr-quoted",c=h,o+=h):/\s/.test(h)?(i="in-tag",s="",o+=h):h===">"?(i="text",s="",o+=h):(i="attr-unquoted",o+=h);break;case"attr-unquoted":/\s/.test(h)?(i="in-tag",s="",o+=h):(h===">"&&(i="text",s=""),o+=h);break;case"attr-quoted":o+=h,h===c&&(i="in-tag",s="");break;case"skip-attr":if(h===c){if(u){let x=u.firstPartIdx,N=[];for(let L=x;L<r.length;L++)(r[L].kind==="noop"||r[L].kind==="attr-mixed")&&N.push(L);let B=[],mt=t[N[0]],Vt=mt.lastIndexOf(c);B.push(Vt>=0?mt.slice(Vt+1):mt);for(let L=1;L<N.length;L++)B.push(t[N[L]]);let bt=t[N[N.length-1]+1],yt=bt.indexOf(c);B.push(yt>=0?bt.slice(0,yt):bt),r[x]={kind:"attr-mixed",path:[],name:u.name,statics:B,group:N};for(let L=1;L<N.length;L++)r[N[L]]={kind:"noop",path:[],mixedAnchor:x};u=null}i="in-tag",s=""}break}}if(y<t.length-1){let g=r.length;if(i==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(i==="rawtext"){d="",r.push({kind:"noop",path:[]});continue}if(i==="text")o+=`<!--${C}${g}-->`,r.push({kind:"child",path:[]});else if(i==="in-tag"){let h=`data-${C}${g}`;o+=`${h}=""`,r.push({kind:"element",path:[]})}else if(i==="after-eq"){let h=s[0],x=s.slice(1);if(zt(h)){o=o.slice(0,a);let N=wo[h],B=`data-${C}${g}`;o+=`${B}=""`,r.push({kind:N,path:[],name:x})}else{o=o.slice(0,a);let N=`data-${C}${g}`;o+=`${N}=""`,r.push({kind:"attr",path:[],name:s})}i="in-tag",s=""}else if(i==="attr-quoted"||i==="attr-unquoted"){o=o.slice(0,a);let h=`data-${C}${g}`;o+=`${h}=""`,u={name:s,firstPartIdx:g},r.push({kind:"noop",path:[]}),i="skip-attr"}else i==="skip-attr"&&r.push({kind:"noop",path:[]})}}let b=document.createElement("template");b.innerHTML=o,vl(b.content,r);let p=xl(b.content,r);return n={templateEl:b,parts:r,formActions:p},wr.set(t,n),n}function vl(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(S,"");let o=t.length;r.setAttribute(`data-${C}${o}`,""),t.push({kind:"slot",path:[]})}}function xl(e,t){let n=[],r=[];function o(i){for(let s=0;s<i.childNodes.length;s++){let a=i.childNodes[s];if(n.push(s),a.nodeType===8){let c=a.data;if(c.startsWith(C)){let l=Number(c.slice(C.length));t[l]&&t[l].kind==="child"&&(t[l].path=n.slice())}}else if(a.nodeType===1){let c=a,l=[],u=[];for(let f of c.attributes)if(f.name.startsWith(`data-${C}`)){let d=Number(f.name.slice(`data-${C}`.length));t[d]&&t[d].kind!=="child"&&(t[d].path=n.slice(),u.push({idx:d,kind:t[d].kind,name:t[d].name||""})),l.push(f.name)}if(c.localName==="form"||c.localName==="button"||c.localName==="input"){let f=El(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 El(e,t,n){let r=e.localName==="form",o=r?"action":"formaction",i=r?"method":"formmethod",s=r?"enctype":"formenctype",a=t.filter(m=>m.kind==="attr"&&m.name.toLowerCase()===o);if(!a.length)return null;let c=[],l=[],u=[],f=r?[]:t.filter(m=>m.name.toLowerCase()==="name"&&(m.kind==="attr"||m.kind==="attr-mixed"||m.kind==="bool")).map(m=>({i:m.idx,kind:m.kind})),d=!r&&e.hasAttribute("name"),b=!r&&e.hasAttribute("form"),p=!r&&e.hasAttribute("value"),y=r?[]:t.filter(m=>m.name.toLowerCase()==="value"&&(m.kind==="attr"||m.kind==="attr-mixed"||m.kind==="bool")).map(m=>({i:m.idx,kind:m.kind}));for(let m of t){let g=String(m.name).toLowerCase();if(m.kind==="prop"){r?(g==="method"||g==="enctype"||g==="encoding")&&u.push(m.name):Ao(g)&&u.push(m.name);continue}if(g!==i&&g!==s||m.kind!=="attr"&&m.kind!=="attr-mixed"&&m.kind!=="bool")continue;let h=n[m.idx],x={i:m.idx,kind:m.kind};m.kind==="attr-mixed"&&(x.statics=h.statics||[],x.group=h.group||[]),(g===i?c:l).push(x)}return{isForm:r,tag:e.localName,actionIdxs:a.map(m=>m.idx),duplicateAction:a.length>1,staticAction:e.getAttribute(o)!=null,authoredName:d,authoredValue:p,authoredForm:b,propAttrs:u,nameParts:f,valueParts:y,staticMethod:e.getAttribute(i),staticEnctype:e.getAttribute(s),methodParts:c,enctypeParts:l}}Ee();var ee=null,Oe=!1,At=0,St=null,ri=0,$s=(e,t)=>Object.is(e,t),Ar=()=>{},Bs=()=>!1;function Ds(e,t){e.liveConsumers||(e.liveConsumers=new Map);let n=e.liveConsumers.size===0;if(e.liveConsumers.set(t,(e.liveConsumers.get(t)||0)+1),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)Ds(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function an(e,t){if(!e.liveConsumers)return;let n=e.liveConsumers.get(t);if(n!==void 0){if(n>1){e.liveConsumers.set(t,n-1);return}if(e.liveConsumers.delete(t),e.liveConsumers.size===0){if(e.producers&&e.producers.length>0)for(let r of e.producers)an(r,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(r){console.error(r)}}}}function li(e){if(Oe)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&&si(t)&&an(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,si(t)&&Ds(e,t)),t.producerLastReadVersions[n]=e.version}function si(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Hs(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=Oe;Oe=!0;try{for(let n of e.liveConsumers.keys())n.dirty||Tl(n)}finally{Oe=t}}function Tl(e){e.dirty=!0,Hs(e),e.consumerMarkedDirty.call(e.wrapper||e)}function vr(e){if(!(!e.dirty&&e.lastCleanEpoch===At)){if(!e.producerMustRecompute()&&!Nl(e)){e.dirty=!1,e.lastCleanEpoch=At;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=At}}function Nl(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(vr(n),r!==n.version))return!0}return!1}function ai(e){e&&(e.nextProducerIndex=0);let t=ee;return ee=e,t}function ci(e,t){if(ee=t,!!e){if(si(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)an(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var xr=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=At,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=Bs,this.producerRecomputeValue=Ar,this.consumerMarkedDirty=Ar,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||$s,this.watched=n?.[ui],this.unwatched=n?.[fi]}get(){return li(this),this.__value}peek(){return this.__value}set(t){if(Oe)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,At++,St!==null?Us(this):Hs(this))}};function Us(e){let t=Oe;Oe=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers.keys())n.dirty||(n.dirty=!0,n.__isWatcher?St.add(n):Us(n))}finally{Oe=t}}var oi=Symbol("unset"),ii=Symbol("computing"),Sr=Symbol("errored"),cn=class{constructor(t,n){this.__fn=t,this.__value=oi,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||$s,this.watched=n?.[ui],this.unwatched=n?.[fi];let r=this;this.producerMustRecompute=function(){return r.__value===oi||r.__value===ii},this.producerRecomputeValue=function(){if(r.__value===ii)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=ii;let i=ai(r),s,a=!1;try{s=r.__fn.call(r.wrapper)}catch(l){s=Sr,r.__error=l,a=!0}finally{ci(r,i)}if(!a&&(o!==oi&&o!==Sr)&&r.__equal.call(r.wrapper,o,s)){r.__value=o;return}r.__value=s,r.version++},this.consumerMarkedDirty=Ar}get(){if(vr(this),li(this),this.__value===Sr)throw this.__error;return this.__value}peek(){if(vr(this),this.__value===Sr)throw this.__error;return this.__value}},Er=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=At,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=Bs,this.producerRecomputeValue=Ar,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=ai(this);try{for(let r of t)li(r),r.__isComputed&&vr(r)}finally{ci(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(an(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=ai(this),r;try{r=t()}finally{ci(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)an(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},ui=Symbol("watched"),fi=Symbol("unwatched");function Cl(e){let t=ee;ee=null;try{return e()}finally{ee=t}}function kl(e){return e.producers.slice()}function Rl(e){return e.liveConsumers?[...e.liveConsumers.keys()]:[]}function Ol(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function Ll(e){return e.producers.length>0}function jl(){return ee&&ee.__isComputed?ee:null}function Pl(e){ri++,St===null&&(St=new Set);try{e()}finally{if(ri--,ri===0){let t=St;St=null;for(let n of t)n.__fire()}}}var ln={State:xr,Computed:cn,subtle:{Watcher:Er,untrack:Cl,introspectSources:kl,introspectSinks:Rl,hasSinks:Ol,hasSources:Ll,currentComputed:jl,watched:ui,unwatched:fi}};function Il(e,t){return new xr(e,t)}function Ml(e,t){return new cn(e,t)}function Fl(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function $l(e){let t=!1,n=!1,r=new cn(e),o=new Er(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(i){console.error(i)}o.watch()}}))});o.watch(r);try{r.get()}catch(i){console.error(i)}return()=>{n||(n=!0,o.dispose())}}Xe();Yt();var K=null;function pi(e){K=e}function Ks(e,t){let n=e&&e[_]?e:null;return n?Ye(n,t):t()}function Nr(e){return e?e.nodeType===11&&e.host?e.host:e:null}function hi(e,t){let n=e.__commitOwner,r=K;n&&(K=n);try{t()}finally{K=r}}function fn(e,t){if(e.kind==="noop")return{kind:"noop",mixedAnchor:e.mixedAnchor};let n=t;for(let o of e.path)n=n.childNodes[o];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let o={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(i){o.handler?.(i)}};return r.addEventListener(o.name,o.dispatcher),o}if(e.kind==="attr")return{kind:"attr",el:r,name:e.name||""};if(e.kind==="attr-mixed")return{kind:"attr-mixed",el:r,name:e.name||"",statics:e.statics||[],group:e.group||[]};if(e.kind==="prop")return{kind:"prop",el:r,name:e.name||""};if(e.kind==="bool")return{kind:"bool",el:r,name:e.name||""};if(e.kind==="element")return{kind:"element",el:r};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}function te(e,t,n,r,o){if(se(t)){let i=t.value;if(e.kind==="prop"&&e.el[e.name]===i||e.kind==="attr"&&e.el.getAttribute(e.name)===String(i)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!i)return;t=i}switch(e.kind){case"child":Hl(e,t,o);break;case"attr":{let i=Gt(e.name,t);i===null?e.el.removeAttribute(e.name):rr(t,e.name,e.el.localName)||(Xt(t,e.name,e.el.localName),e.el.setAttribute(e.name,i));break}case"prop":ws(t,e.name,e.el.localName),e.el[e.name]=t;break;case"bool":Xt(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":Dl(e,t);break;case"attr-mixed":{let i=e,s=i.statics[0];for(let a=0;a<i.group.length;a++){let c=r?r[i.group[a]]:t;se(c)&&(c=c.value),Xt(c,e.name,e.el.localName),s+=String(c??""),s+=i.statics[a+1]||""}e.el.setAttribute(e.name,s);break}case"slot":{if(e.applied)break;let i=e.slotEl,s=()=>{let c=vt(i);if(!c){e.applied=!0;return}if(!c.contains(i)){c.isConnected?queueMicrotask(s):e.applied=!0;return}if(e.applied=!0,Bl(i))return;let l=document.createDocumentFragment();for(;i.firstChild;)l.appendChild(i.firstChild);i[Te]=l,queueMicrotask(()=>V(c))},a=vt(i);a&&a.contains(i)?s():queueMicrotask(s);break}case"noop":break}}function vt(e){let t=e[We];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[_])return n;n=n.parentElement}return null}function Bl(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 Dl(e,t){let n=e,r=cr(t)?t.target:void 0,o=n.__refTarget,i=r!==o;if(i&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(i||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!i&&n.__refElement!==void 0)try{r(void 0)}catch{}try{r(e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function Hl(e,t,n){return Jl(e,t),ue(e,t,n)}function ue(e,t,n){return Ks(e.marker&&e.marker.parentNode,()=>Ws(e,t,n))}function Ws(e,t,n){let r=e.marker;if(se(t))return Ws(e,t.value,n);if(xo(t)){Le(e);let i=String(t.value??""),s=document.createElement("template");s.innerHTML=i;let a=[...s.content.childNodes],c=document.createDocumentFragment();for(let l of a)c.appendChild(l);r.parentNode?.insertBefore(c,r),e.child=a;return}if(sr(t)){let i=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,i.key)&&Le(e),e.__keyedKey=i.key,ue(e,i.value,n);return}if(ar(t)){let i=t,s=e.__guardDeps,a=i.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(a)?Yl(s,a):Object.is(s,a)))return;let c=Array.isArray(a)?a.slice():a;ue(e,i.fn(),n),e.__guardDeps=c;return}if(Eo(t)){Le(e);let i=t.template;if(i&&i.content){let s=i.content.cloneNode(!0),a=[...s.childNodes];r.parentNode?.insertBefore(s,r),e.child=a}return}if(cr(t))return;if(lr(t))return Xl(e,t.value,n);if(ur(t))return Ql(e,t.args,n);if(fr(t))return Zl(e,t.signal,n);if(To(t))return eu(e,t,n);if(No(t))return tu(e,t,n);if(ir(t)){if(e.child&&e.child.kind==="repeat"){Kl(e,t,n);return}Le(e);let i={kind:"repeat",map:new Map};e.child=i,ql(r,i,t,n);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){zl(e,t,n);return}Le(e);let i={kind:"array",items:[]};e.child=i,Vl(r,i,t,n);return}if(e.child){let i=e.child;if(i.kind==="repeat")Vs(i),e.child=void 0;else if(i.kind==="array")Gs(i),e.child=void 0;else if(i.kind==="async-stream")Qs(i),e.child=void 0;else if("strings"in e.child){let s=e.child;if(P(t)&&s.strings===t.strings){Qe(s,t.values,n);return}xt(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(P(t)){let i=t,{templateEl:s,parts:a,formActions:c}=_t(i),l=s.content.cloneNode(!0),u=document.createComment(`${C}s`),f=document.createComment(`${C}e`),d=a.map(y=>fn(y,l)),b=[];for(let y=0;y<i.values.length;y++)te(d[y],i.values[y],void 0,i.values,n),b.push(i.values[y]);n&&n(c,d,i.values);let p=[u,...l.childNodes,f];r.parentNode?.insertBefore(Ul(p),r);for(let y of d)y.kind==="slot"&&te(y,void 0,void 0,[],n);e.child={strings:i.strings,bound:d,lastValues:b,startNode:u,endNode:f};return}let o=document.createTextNode(String(t));r.parentNode?.insertBefore(o,r),e.child=[o]}function Qe(e,t,n){for(let r=0;r<t.length;r++){let o=t[r];if(Object.is(o,e.lastValues[r]))continue;let i=e.bound[r],s=i.mixedAnchor;try{i.kind==="noop"&&s!=null?te(e.bound[s],t[s],e.lastValues[s],t,n):te(i,o,e.lastValues[r],t,n)}catch(a){throw e.lastValues[r]=qs,i.kind==="noop"&&s!=null&&(e.lastValues[s]=qs),a}e.lastValues[r]=o}n&&n(wr.get(e.strings)?.formActions??null,e.bound,t)}var qs=Symbol("webjs.commitFailed");function xt(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 Ul(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function mi(e,t){let{templateEl:n,parts:r,formActions:o}=_t(e),i=n.content.cloneNode(!0),s=document.createComment(`${C}s`),a=document.createComment(`${C}e`),c=r.map(f=>fn(f,i)),l=[];for(let f=0;f<e.values.length;f++)te(c[f],e.values[f],void 0,e.values,t),l.push(e.values[f]);t&&t(o,c,e.values);for(let f of c)f.kind==="slot"&&te(f,void 0,void 0,[],t);let u=document.createDocumentFragment();for(u.appendChild(s);i.firstChild;)u.appendChild(i.firstChild);return u.appendChild(a),{inst:{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a},frag:u}}function un(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 ql(e,t,n,r){let{items:o,keyFn:i,templateFn:s}=n,a=e.parentNode;if(!a)return;let c=document.createDocumentFragment();for(let l=0;l<o.length;l++){let u=i(o[l],l),f=s(o[l],l);if(!P(f))continue;let{inst:d,frag:b}=mi(f,r);t.map.set(u,d),c.appendChild(b)}a.insertBefore(c,e)}function Kl(e,t,n){let r=e.marker,o=r.parentNode;if(!o)return;let i=e.child,{items:s,keyFn:a,templateFn:c}=t,l=new Map;try{for(let u=0;u<s.length;u++){let f=a(s[u],u),d=c(s[u],u);if(!P(d))continue;let b=i.map.get(f);if(b&&b.strings===d.strings)Qe(b,d.values,n),di(b.startNode,b.endNode,o,r),l.set(f,b),i.map.delete(f);else{b&&(i.map.delete(f),un(b),xt(b.startNode,b.endNode));let{inst:p,frag:y}=mi(d,n);o.insertBefore(y,r),l.set(f,p)}}for(let[u,f]of[...i.map]){i.map.delete(u);try{un(f)}finally{xt(f.startNode,f.endNode)}}i.map=l}catch(u){for(let[f,d]of l)i.map.set(f,d);throw u}}function Vs(e){for(let[t,n]of[...e.map]){e.map.delete(t);try{un(n)}finally{xt(n.startNode,n.endNode)}}e.map.clear()}function Wl(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function Tr(e){e.type==="tpl"?(un(e.inst),xt(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function zs(e,t){if(se(e)&&(e=e.value),P(e)){let{inst:n,frag:r}=mi(e,t);return{item:{type:"tpl",inst:n},frag:r}}if(e!=null&&e!==!1&&e!==!0){let n=document.createTextNode(String(e));return{item:{type:"text",node:n},frag:n}}return{item:{type:"empty"},frag:null}}function Vl(e,t,n,r){let o=e.parentNode;if(!o)return;let i=document.createDocumentFragment(),s=[];for(let a of n){let{item:c,frag:l}=zs(a,r);l&&i.appendChild(l),s.push(c)}o.insertBefore(i,e),t.items=s}function zl(e,t,n){let r=e.marker,o=r.parentNode;if(!o)return;let i=e.child,s=i.items,a=[],c=0;try{for(let l=0;l<t.length;l++){let u=t[l],f=se(u)?u.value:u,d=s[l];if(P(f)){let y=f;if(d&&d.type==="tpl"&&d.inst.strings===y.strings){Qe(d.inst,y.values,n),a.push(d),c=l+1;continue}}else if(f!=null&&f!==!1&&f!==!0){if(d&&d.type==="text"){let y=String(f);d.node.data!==y&&(d.node.data=y),a.push(d),c=l+1;continue}}else{d&&Tr(d),a.push({type:"empty"}),c=l+1;continue}let{item:b,frag:p}=zs(f,n);p&&o.insertBefore(p,Gl(s,l,r)),a.push(b),d&&Tr(d),c=l+1}for(let l=t.length;l<s.length;l++)Tr(s[l]),c=l+1;i.items=a}catch(l){throw i.items=a.concat(s.slice(c)),l}}function Gl(e,t,n){for(let r=t;r<e.length;r++){let o=Wl(e[r]);if(o&&o.parentNode)return o}return n}function Gs(e){for(let t of e.items)Tr(t);e.items=[]}function di(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),i=e;for(;i;){let s=i.nextSibling;if(o.appendChild(i),i===t)break;i=s}n.insertBefore(o,r)}function Yl(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 Le(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Ys(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Vs(n);else if(n.kind==="array")Gs(n);else if(n.kind==="async-stream")Qs(n);else if("strings"in n){let r=e.child;un(r),xt(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Jl(e,t){let n=e;n.__untilState&&!ur(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!ar(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!lr(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!sr(t)&&(n.__keyedKey=void 0),n.__watchSub&&!fr(t)&&Ys(n)}function Xl(e,t,n){let r=e.marker,o=e,i=o.__cacheMap;i||(i=new Map,o.__cacheMap=i);let s=e.child;if(s&&"strings"in s){let c=s;if(P(t)&&c.strings===t.strings){Qe(c,t.values,n);return}let l=document.createDocumentFragment();di(c.startNode,c.endNode,l,null),i.set(c.strings,{inst:c,holder:l}),e.child=void 0}if(P(t)){let c=t,l=i.get(c.strings);if(l){i.delete(c.strings),e.child&&Le(e),di(l.inst.startNode,l.inst.endNode,r.parentNode,r),Qe(l.inst,c.values,n),e.child=l.inst;let u=new Set;for(let f=l.inst.startNode.nextSibling;f&&f!==l.inst.endNode;f=f.nextSibling){if(f.nodeType!==1)continue;let d=f;if(d.matches("slot[data-webjs-light]")){let b=vt(d);b&&u.add(b)}for(let b of d.querySelectorAll("slot[data-webjs-light]")){let p=vt(b);p&&u.add(p)}}for(let f of u)V(f);return}}ue(e,t,n)}function Ql(e,t,n){let r=e;K&&(r.__commitOwner=Nr(K));let o=r.__untilState,i=r.__untilArgs,s=(b,p)=>!!(Object.is(b,p)||P(b)&&P(p)&&b.strings===p.strings),c=i&&i.length===t.length&&i.every((b,p)=>s(b,t[p]))&&o?o.highestResolved:1/0;o&&(o.aborted=!0),r.__untilArgs=t.slice();let l={aborted:!1,highestResolved:c};r.__untilState=l;let u=-1,f;for(let b=0;b<t.length;b++){let p=t[b];if(!p||typeof p.then!="function"){u=b,f=p;break}}u!==-1&&u<=l.highestResolved?(ue(e,f,n),l.highestResolved=u):u===-1&&!r.__untilEverRendered&&ue(e,"",n),r.__untilEverRendered=!0;let d=Math.min(u===-1?t.length:u,l.highestResolved);for(let b=0;b<d;b++){let p=t[b];!p||typeof p.then!="function"||Promise.resolve(p).then(y=>{if(!l.aborted&&!(b>=l.highestResolved)){try{hi(e,()=>ue(e,y,n))}catch(m){bi(e,m);return}l.highestResolved=b}},()=>{})}}function bi(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 Zl(e,t,n){let r=e;if(K&&(r.__commitOwner=Nr(K)),r.__watchSig===t&&r.__watchSub){let s;r.__watchSub.observe(()=>{s=t.get()}),ue(e,s,n);return}r.__watchSub&&(r.__watchSub.dispose(),r.__watchSub=void 0),r.__watchSig=t;let o=new ln.subtle.Watcher(()=>{queueMicrotask(()=>{if(r.__watchSub!==o)return;let s;try{o.observe(()=>{s=t.get()}),hi(e,()=>ue(e,s,n))}catch(a){bi(e,a)}})});r.__watchSub=o;let i;o.observe(()=>{i=t.get()}),ue(e,i,n)}function Ys(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function eu(e,t,n){let r=e;K&&(r.__commitOwner=Nr(K));let o=e.child;if(o&&o.kind==="async-stream"&&o.mode==="append"&&o.iterable===t.iterable)return;Le(e);let i=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:i,nodes:[]};e.child=s,Js(s,e,t,n)}function tu(e,t,n){let r=e;K&&(r.__commitOwner=Nr(K));let o=e.child;if(o&&o.kind==="async-stream"&&o.mode==="replace"&&o.iterable===t.iterable)return;Le(e);let i=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:i,nodes:[]};e.child=s,Js(s,e,t,n)}async function Js(e,t,n,r){let o=t.marker,i=0;for(;!e.aborted;){let s,a;try{if(s=await e.iterator.next(),e.aborted||s.done)break;a=n.mapper?n.mapper(s.value,i):s.value}catch(c){typeof console<"u"&&console.error("[webjs] asyncStream error:",c);return}try{hi(t,()=>{let c=Xs(a,r);Ks(o.parentNode,()=>{if(e.mode==="replace"){for(let u of e.nodes)u.parentNode&&u.parentNode.removeChild(u);e.nodes=[]}let l=document.createDocumentFragment();for(let u of c)l.appendChild(u);o.parentNode?.insertBefore(l,o),e.nodes.push(...c)})})}catch(c){e.aborted=!0;try{e.iterator.return?.()?.catch?.(()=>{})}catch{}bi(t,c);return}i++}}function Xs(e,t){if(se(e)&&(e=e.value),e==null||e===!1||e===!0)return[];if(P(e)){let n=e,{templateEl:r,parts:o,formActions:i}=_t(n),s=r.content.cloneNode(!0),a=o.map(c=>fn(c,s));for(let c=0;c<n.values.length;c++)te(a[c],n.values[c],void 0,n.values,t);t&&t(i,a,n.values);for(let c of a)c.kind==="slot"&&te(c,void 0,void 0,[],t);return[...s.childNodes]}if(Array.isArray(e)){let n=[];for(let r of e)n.push(...Xs(r,t));return n}return[document.createTextNode(String(e))]}function Qs(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}function et(e,t){let n=t,r=n[R];n[R]=!0;let o=K;pi(t);try{let i=n[sn];if(P(e)){let s=e;if(i&&i.strings===s.strings){Qe(i,s.values,kr);return}i&&Zs(i,t);let a=t.firstChild;a&&a.nodeType===8&&a.data==="webjs-hydrate"&&a.remove(),n[sn]=null;let c=ou(s,t);n[sn]=c;return}if(i&&Zs(i,t),n[sn]=null,t.replaceChildren(),e==null||e===!1||e===!0)return;if(Array.isArray(e)){for(let s of e){let a=document.createTextNode(String(s??""));t.appendChild(a)}return}t.appendChild(document.createTextNode(String(e)))}finally{pi(o),n[R]=r,r||hr(n)}}function kr(e,t,n){if(e)for(let r of[!0,!1])for(let o of e){if(o.isForm!==r)continue;let i=o.actionIdxs[0],s=o.isForm?"action":"formaction";for(let l of o.actionIdxs)if(rr(Ze(n[l]),s,o.tag)){i=l;break}let a=t[i];if(!a||!a.el)continue;let c=Ze(n[i]);if(o.isForm)As(a.el,c,Cr(o.methodParts,o.staticMethod,n),Cr(o.enctypeParts,o.staticEnctype,n),o);else{let l=u=>u.some(f=>f.kind==="bool"?!!Ze(n[f.i]):f.kind==="attr"?Gt("name",Ze(n[f.i]))!==null:!0);ru(a.el,c,o,l(o.nameParts),l(o.valueParts),Cr(o.methodParts,o.staticMethod,n),Cr(o.enctypeParts,o.staticEnctype,n))}}}function nu(e){(_r.has(e)||e.getAttribute("name")===I)&&(e.getAttribute("name")===I&&e.removeAttribute("name"),e.removeAttribute("value"),_r.delete(e))}function ru(e,t,n,r,o,i,s){let a=typeof t=="function"?So(t):null;if(!a){typeof t=="function"&&vo(null,e.localName),nu(e),vs(e,i,s,n.propAttrs);return}ys(n.duplicateAction,e.localName),gs(n.propAttrs,e.localName),n.staticAction&&ms(e.localName),(n.authoredValue||o)&&hs(e.localName),(n.authoredName||r)&&ds(e.getAttribute("name")||I,e.localName,!1),(n.authoredForm||e.hasAttribute("form"))&&bs(e.localName),ps(e.localName,e.getAttribute("type"));let c=Ss(e.localName,i,s);e.removeAttribute("formaction"),e.setAttribute("name",I),e.setAttribute("value",a),Jt(e,"formmethod",i,c.formMethod),Jt(e,"formenctype",s,c.formEnctype),_r.set(e,a)}function Cr(e,t,n){for(let r of e){if(r.kind==="bool")return Ze(n[r.i])?"":W;if(r.kind==="attr"){let a=Gt("method",Ze(n[r.i]));return a===null?W:a}let o=r.statics||[],i=r.group||[],s=o[0]||"";for(let a=0;a<i.length;a++)s+=String(Ze(n[i[a]])??""),s+=o[a+1]||"";return s}return t??W}function Ze(e){return se(e)?e.value:e}function ou(e,t){let{templateEl:n,parts:r,formActions:o}=_t(e),i=n.content.cloneNode(!0),s=document.createComment(`${C}s`),a=document.createComment(`${C}e`),c=r.map(f=>fn(f,i)),l=[];for(let f=0;f<e.values.length;f++)te(c[f],e.values[f],void 0,e.values,kr),l.push(e.values[f]);kr(o,c,e.values),t.replaceChildren(s,...i.childNodes,a);let u=t.nodeType===1&&t[_]?t:null;for(let f of c)f.kind==="slot"&&(u&&f.slotEl&&(f.slotEl[We]=u),te(f,void 0,void 0,[],kr));return{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a}}function Zs(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=vt(n.slotEl);r&&ni(r,n.slotEl)}}t.replaceChildren()}function na(e,t){if(e.converter&&e.converter.fromAttribute)return e.converter.fromAttribute(t,e.type);if(e.type===Number)return t==null?null:Number(t);if(e.type===Boolean)return t!=null&&t!=="false";if(e.type===Object||e.type===Array){if(t==null)return null;try{return JSON.parse(t)}catch{return null}}return t}function iu(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function ra(e,t){let n;for(let{propName:r,def:o,primary:i,alias:s}of ia(e)){if(i===t)return{propName:r,def:o};n===void 0&&s===t&&(n={propName:r,def:o})}return n}function oa(e){let t=new Set,n=ia(e);for(let{primary:r}of n)t.add(r);for(let{alias:r}of n)r&&t.add(r);return[...t]}function ia(e){if(e&&typeof e=="function"){let t=ea.get(e);if(t)return t;let n=ta(e);return ea.set(e,n),n}return ta(e)}var ea=new WeakMap;function ta(e){let t=e&&e.properties||{},n=[];for(let[r,o]of Object.entries(t)){let i=typeof o=="object"&&o!==null?o:{type:o};if(i.state)continue;let s=i.attribute||iu(r),a=r.toLowerCase(),c=!i.attribute&&a!==s?a:void 0;n.push({propName:r,def:i,primary:s,alias:c})}return n}var sa=null;function Rr(e){sa=e||null}function yi(){return sa||void 0}Ee();var aa=Symbol.for("webjs:registry"),ca=Symbol.for("webjs:classToTag"),Et=globalThis,fe=Et[aa]||(Et[aa]=new Map),ua=Et[ca]||(Et[ca]=new WeakMap),la=Symbol.for("webjs:registryVersion"),fa=Et[la]||(Et[la]={v:0}),Or=typeof window<"u"&&typeof customElements<"u";function gi(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=fe.get(e);r?(r.cls=t,r.lazy=n):(fe.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),fa.v+=1),ua.set(t,e)}if(Or){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),gi(t,n)}}if(!Or){let e=globalThis;e.customElements||(e.customElements={define(t,n){gi(t,n)},get(t){return fe.get(t)?.cls},upgrade(){},whenDefined(t){let n=fe.get(t);return Promise.resolve(n?.cls)}})}function da(e,t){Or?customElements.define(e,t):gi(e,t)}function su(e,t){if(Or)return;let n=fe.get(e);if(n){n.moduleUrl=t;return}fe.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e}),fa.v+=1}function au(e){return fe.get(e)?.cls}function cu(e){return fe.get(e)?.moduleUrl||null}function lu(e){return fe.get(e)?.lazy===!0}function tt(e){return ua.get(e)}function uu(){return[...fe.keys()]}hn();Xe();function vu(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var mn=class{constructor(){this.__ssrAttrs=new Map,this.__internals=null}get attributes(){return[...this.__ssrAttrs].map(([t,n])=>({name:t,value:n}))}getAttribute(t){let n=this.__ssrAttrs.get(String(t).toLowerCase());return n===void 0?null:n}setAttribute(t,n){this.__ssrAttrs.set(String(t).toLowerCase(),String(n))}removeAttribute(t){this.__ssrAttrs.delete(String(t).toLowerCase())}hasAttribute(t){return this.__ssrAttrs.has(String(t).toLowerCase())}toggleAttribute(t,n){let r=String(t).toLowerCase(),o=this.__ssrAttrs.has(r);return(n===void 0?!o:n)?(this.__ssrAttrs.set(r,""),!0):(this.__ssrAttrs.delete(r),!1)}getAttributeNames(){return[...this.__ssrAttrs.keys()]}closest(t){let n=String(t).trim().toLowerCase();if(!/^[a-z][a-z0-9-]*$/.test(n))return null;if(this.__ssrTag===n)return this;let r=this.__ssrAncestors;if(!Array.isArray(r))return null;for(let o=r.length-1;o>=0;o--)if(r[o]&&r[o].__ssrTag===n)return r[o];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,o=>"-"+o.toLowerCase());return this.__dataset=new Proxy({},{get(r,o){if(typeof o!="string")return;let i=t.getAttribute(n(o));return i===null?void 0:i},set(r,o,i){return typeof o=="string"&&t.setAttribute(n(o),i),!0},has(r,o){return typeof o=="string"&&t.hasAttribute(n(o))},deleteProperty(r,o){return typeof o=="string"&&t.removeAttribute(n(o)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(o,i)=>i.toUpperCase()))},getOwnPropertyDescriptor(r,o){if(typeof o=="string"&&t.hasAttribute(n(o)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(o))}}}),this.__dataset}get className(){return this.getAttribute("class")??""}set className(t){this.setAttribute("class",t)}get hidden(){return this.hasAttribute("hidden")}set hidden(t){this.toggleAttribute("hidden",!!t)}get id(){return this.getAttribute("id")??""}set id(t){this.setAttribute("id",t)}get title(){return this.getAttribute("title")??""}set title(t){this.setAttribute("title",t)}get slot(){return this.getAttribute("slot")??""}set slot(t){this.setAttribute("slot",t)}get role(){return this.getAttribute("role")}set role(t){t==null?this.removeAttribute("role"):this.setAttribute("role",t)}get tabIndex(){let t=this.getAttribute("tabindex");return t===null?-1:Number.parseInt(t,10)||0}set tabIndex(t){this.setAttribute("tabindex",String(t))}addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return this.__internals=vu(),this.__internals}},xu=["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 xu){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(mn.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}function ya(e,t){return e!==t}function ga(e){try{return String(e)}catch{return Object.prototype.toString.call(e)}}function _i(e,t,n){if(typeof console>"u"||!console.warn)return;let r=tt(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 wa(e,t,n,r){if(typeof console>"u"||!console.warn)return;let o=tt(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 _a(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var Aa=typeof window<"u"&&typeof HTMLElement<"u",Eu=Aa?HTMLElement:mn,va=Symbol("webjs.factoryProps"),Sa=new WeakSet,Tu=Promise.resolve(!0),Tt=new Set,xa=new WeakMap;function Nu(e,t){let n=[];for(let[r,o]of Object.entries(t)){let i=typeof o=="object"&&o!==null?o:{type:o};n.push({propName:r,decl:i});let s=i.hasChanged||ya;Object.defineProperty(e.prototype,r,{configurable:!0,enumerable:!0,get(){return this.__propValues[r]},set(a){let c=this.__propValues[r];s(a,c)&&(this.__propValues[r]=a,i.reflect&&!i.state&&this._connected&&this._reflectAttribute(r,a,i),this.requestUpdate(r,c))}})}return xa.set(e,n),n}var Nt=class e extends Eu{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){da(t,this)}static get observedAttributes(){return oa(this)}constructor(){super(),this._renderRoot=null,this._scheduled=!1,this._connected=!1,this.__controllers=null,this.__firstRendered=!1,this._changedProperties=new Map,this._updateResolve=null,this._updatePromise=Tu,this._isUpdating=!1,this._assertFactoryProperties(),this._initializeProperties()}_assertFactoryProperties(){let t=this.constructor;if(Sa.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,va)){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)}Sa.add(t)}_initializeProperties(){let t=this.constructor,n=t.properties;if(!n||typeof n!="object")return;this.__propValues={};let r=xa.get(t);r===void 0&&(r=Nu(t,n));for(let o=0;o<r.length;o++){let{propName:i,decl:s}=r[o],a;Object.hasOwn(this,i)&&(a=this[i],delete this[i]),a!==void 0?this.__propValues[i]=a:s.default!==void 0&&(this.__propValues[i]=typeof s.default=="function"?s.default():s.default)}}_reflectAttribute(t,n,r){let o=r.attribute||Cu(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let i=r.converter.toAttribute(n,r.type);i==null?this.removeAttribute(o):this.setAttribute(o,i)}else if(typeof n=="function")this.removeAttribute(o),_i(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 i,s=!0;try{i=JSON.stringify(n)}catch(a){s=!1,this.removeAttribute(o),wa(this,t,o,a&&a.message)}s&&this.setAttribute(o,i)}else or(n)?(this.removeAttribute(o),_i(this,t,o)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!Aa)return;if(this.__webjsPropsHydrated||(this.__webjsPropsHydrated=!0,this._hydratePropAttrs()),this.constructor.hydrate==="visible"&&typeof IntersectionObserver<"u"&&!this.__hydrationActivated){this.__hydrationActivated=!1,this.__hydrationObserver=new IntersectionObserver(n=>{for(let r of n)if(r.isIntersecting){this.__hydrationObserver.unobserve(this),this.__hydrationObserver.disconnect(),this.__hydrationObserver=null,this.__hydrationActivated=!0,this._activate();return}},{rootMargin:"200px"}),this.__hydrationObserver.observe(this);return}this._activate()}_hydratePropAttrs(){let t=[],n=this.attributes;for(let r=0;r<n.length;r++){let o=n[r].name;o.startsWith("data-webjs-prop-")&&t.push(o)}for(let r of t){let o=this.getAttribute(r);if(this.removeAttribute(r),o==null)continue;let i=ku(r.slice(16));try{this[i]=rt(o)}catch(s){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${s&&s.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow!==!0&&!this.hasAttribute("data-wj-host")&&this.setAttribute("data-wj-host",""),t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,o=Array.isArray(r)?r:yo(r)?[r]:[];if(o.length){if(n){let i=this.shadowRoot.querySelector("style");i&&i.remove()}go(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${tt(t)||this.tagName?.toLowerCase()}> has static shadow = false AND static styles. static styles only works with shadow DOM (adoptedStyleSheets). For light DOM, use global CSS or <style> in render().`),Qt(this)?Bo(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||ti(this)?(this.removeAttribute("data-wj-serialized"),F(this),Lo(this)):Oo(this),Vo(this),Fo(this);for(let n of this.__controllers||Tt)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),$o(this),this.__signalWatcher&&(this.__signalWatcher.dispose(),this.__signalWatcher=void 0);for(let t of this.__controllers||Tt)t.hostDisconnected&&t.hostDisconnected()}attributeChangedCallback(t,n,r){if(this.__reflectingAttribute)return;let o=ra(this.constructor,t);if(o===void 0)return;let{propName:i,def:s}=o,a=na(s,r);this[i]!==a&&(this[i]=a,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||Tt)o.hostUpdate&&o.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null;try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}if(!r){for(let o of this.__controllers||Tt)o.hostUpdated&&o.hostUpdated();n=!0}}}catch(o){console.error("[webjs] lifecycle hook threw during update phase:",o)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let o=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1;let i=()=>{if(this.__pendingAsyncCommits--,o===this.__renderToken){for(let s of this.__controllers||Tt)s.hostUpdated&&s.hostUpdated();this._postCommit(t)}};r.then(i,s=>{try{o===this.__renderToken&&this._handleRenderError(s instanceof Error?s:new Error(ga(s)))}finally{i()}});return}n?this._postCommit(t):this.__pendingAsyncCommits||this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers||Tt)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 ln.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n,r=yi();Rr(this.__renderAbort?this.__renderAbort.signal:null);try{this.__signalWatcher.observe(()=>{n=this.render()})}finally{Rr(r||null)}if(n&&typeof n.then=="function")return this._commitAsync(n);et(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&et(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{if(n===this.__renderToken)try{et(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!==bn.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${tt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&et(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??=new Set).add(t),this._connected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers&&this.__controllers.delete(t)}render(){return""}renderError(t){}renderFallback(){}};function Cu(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function ku(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function bn(e){return new.target?Reflect.construct(Nt,arguments,new.target):class extends Nt{static properties=e;static[va]=!0}}Object.setPrototypeOf(bn,Nt);bn.prototype=Nt.prototype;_o();var Ea=Symbol.for("webjs.notFound"),Ta=Symbol.for("webjs.redirect"),Na=Symbol.for("webjs.forbidden"),Ca=Symbol.for("webjs.unauthorized");function Ru(){let e=new Error("webjs: notFound()");throw e.__webjs=Ea,e}function Ou(){let e=new Error("webjs: forbidden()");throw e.__webjs=Na,e}function Lu(){let e=new Error("webjs: unauthorized()");throw e.__webjs=Ca,e}function ju(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=Ta,r.url=e,r.status=typeof n=="number"?n:void 0,r}function Pu(e){return!!e&&e.__webjs===Ea}function Iu(e){return!!e&&e.__webjs===Ta}function Mu(e){return!!e&&e.__webjs===Na}function Fu(e){return!!e&&e.__webjs===Ca}var ka=null;function $u(){if(!ka)return"";try{return ka()||""}catch{return""}}var Ra=null;function Bu(e){if(typeof e!="string"||!e||!Ra)return e;try{return Ra(e)||e}catch{return e}}Ee();var Gp=Symbol.for("webjs.suspense");function Du(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function Hu(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function Uu(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,i=null,s=[];function a(){o||(i=new WebSocket(qu(e),t.protocols),i.onopen=c=>{for(r=0;s.length&&i&&i.readyState===WebSocket.OPEN;)i.send(s.shift());t.onOpen?.(c)},i.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},i.onerror=c=>{t.onError?.(c)},i.onclose=c=>{if(t.onClose?.(c),!o&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(a,l)}})}return a(),{send(c){let l=typeof c=="string"||c instanceof ArrayBuffer||ArrayBuffer.isView(c)?c:JSON.stringify(c);i&&i.readyState===WebSocket.OPEN?i.send(l):s.push(l)},close(c,l){o=!0;try{i?.close(c,l)}catch{}},get socket(){return i},get readyState(){return i?.readyState??3}}}function qu(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}`}hn();var Si="application/vnd.webjs+json";async function Ku(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",Si);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 wi(r),n.has("content-type")||n.set("content-type",Si));let o=await fetch(e,{...t,headers:n,body:r}),i=o.headers.get("content-type")||"",s=await o.text(),a=i.includes(Si)?s?rt(s):null:i.includes("application/json")?s?JSON.parse(s):null:s;if(!o.ok){let c=a&&a.error||`richFetch ${e} -> ${o.status}`,l=new Error(c);throw l.status=o.status,l.body=a,l}return a}hn();jr();jr();Ei();wn();var ns=class{constructor(t,n){this.host=t,this.options=n,this.updates=[],this._nextId=0}get value(){let t=this.options.source();if(!this.options.update)return this.updates.length>0?this.updates[this.updates.length-1].payload:t;for(let n of this.updates)t=this.options.update(t,n.payload);return t}add(t,n){let r=`opt-${++this._nextId}`;this.updates.push({id:r,payload:t}),this.host?.requestUpdate?.();let o=()=>{let i=this.updates.findIndex(s=>s.id===r);i!==-1&&(this.updates.splice(i,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>o()).catch(()=>{}):n.then(()=>o(),()=>o())),o}};async function Ff(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(i){throw e.set(r),i}return o&&o.success===!1&&e.set(r),o}function $f(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Ff(e,t,n):new ns(e,t)}Ir();Fr();var Bf="application/vnd.webjs+stream",Df=1,Hf=2,Uf=3,$c=new Uint8Array(0);function qf(e,t){let n=t||$c,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 Kf(){let e=$c;return{push(t){if(t&&t.length){let r=new Uint8Array(e.length+t.length);r.set(e,0),r.set(t,e.length),e=r}let n=[];for(;e.length>=5;){let r=e[0],o=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+o)break;let i=e.slice(5,5+o);n.push({type:r,payload:i}),e=e.slice(5+o)}return n}}}var Wf=Symbol.for("webjs.context");function Vf(e){return{__context__:Wf,name:e}}var ho=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},rs=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let i=o;if(i.context===this._context)if(o.stopPropagation(),i.subscribe){let s={callback:i.callback},a=()=>{this._subscriptions.delete(s)};this._subscriptions.add(s),i.callback(this._value,a)}else i.callback(this._value)},typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}setValue(t){if(!Object.is(this._value,t)){this._value=t;for(let n of this._subscriptions){let r=()=>{this._subscriptions.delete(n)};n.callback(t,r)}}}hostConnected(){this._host.addEventListener("context-request",this._onRequest)}hostDisconnected(){this._host.removeEventListener("context-request",this._onRequest),this._subscriptions.clear()}},os=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 ho(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 zf(){return typeof window<"u"}var xe={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},is=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=xe.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=xe.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=xe.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=xe.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 xe.INITIAL:return t.initial?.();case xe.PENDING:return t.pending?.();case xe.COMPLETE:return t.complete?.(this._value);case xe.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!zf())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{os as ContextConsumer,rs as ContextProvider,ho as ContextRequestEvent,I as FORM_ACTION_FIELD,fs as FORM_ACTION_ID_KEY,Df as FRAME_CHUNK,Hf as FRAME_END,Uf as FRAME_ERROR,C as MARKER,Ba as SEED_MISS,Bf as STREAM_CONTENT_TYPE,ln as Signal,Du as Suspense,is as Task,xe as TaskStatus,bn as WebComponent,xi as WebjsFrame,Ti as WebjsStream,yi as activeActionSignal,go as adoptStyles,uu as allTags,Bu as asset,ml as asyncAppend,bl as asyncReplace,Pl as batch,pl as cache,Ml as computed,Uu as connectWS,af as consumeStale,Vf as createContext,Kf as createFrameDecoder,dl as createRef,$u as cspNonce,Kc as css,ma as deserialize,Zi as disableClientRouter,$l as effect,tr as enableClientRouter,qf as encodeFrame,us as escapeAttr,Yc as escapeText,of as fetchMark,Ou as forbidden,ll as guard,qc as html,To as isAsyncAppend,No as isAsyncReplace,yo as isCSS,lr as isCache,Mu as isForbidden,ar as isGuard,sr as isKeyed,lu as isLazy,se as isLive,Pu as isNotFound,Iu as isRedirect,cr as isRef,ir as isRepeat,Fl as isSignal,Hu as isSuspense,P as isTemplate,Eo as isTemplateContent,Fu as isUnauthorized,xo as isUnsafeHTML,ur as isUntil,fr as isWatch,cl as keyed,al as live,ts as loadFrame,au as lookup,cu as lookupModuleUrl,Oi as markStale,es as navigate,Ru as notFound,$f as optimistic,rt as parse,Li as parseTagHeader,su as primeModuleUrl,_a as prop,ju as redirect,fl as ref,po as refreshPage,sf as registerKeyTags,et as render,Ni as renderStream,Es as repeat,fo as revalidate,Ku as richFetch,Pr as scanSeeds,nf as seedStats,ha as serialize,Rr as setActiveActionSignal,Il as signal,wi as stringify,Wc as stylesToString,tt as tagOf,tf as takeSeed,ul as templateContent,Lu as unauthorized,sl as unsafeHTML,hl as until,yl as watch};
|
|
6
6
|
//# sourceMappingURL=webjs-core-browser.js.map
|