@webjsdev/core 0.7.45 → 0.7.47
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 +5 -5
- package/dist/webjs-core-browser.js.map +3 -3
- package/dist/webjs-core-testing.js +22 -21
- package/dist/webjs-core-testing.js.map +3 -3
- package/dist/webjs-core.js +7 -6
- package/dist/webjs-core.js.map +3 -3
- package/index-browser.js +5 -0
- package/index.d.ts +4 -0
- package/index.js +5 -0
- package/package.json +2 -2
- package/src/asset-url.d.ts +3 -0
- package/src/asset-url.js +99 -0
- package/src/component.js +137 -2
- package/src/form-action.d.ts +16 -0
- package/src/form-action.js +1257 -0
- package/src/optimistic.js +7 -2
- package/src/render-client.js +1004 -107
- package/src/render-server.js +847 -70
- package/src/router-client.js +338 -23
- package/src/webjs-config.d.ts +49 -17
package/dist/webjs-core.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
var zs=Object.defineProperty;var se=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ur=(e,t)=>{for(var n in t)zs(e,n,{get:t[n],enumerable:!0})};function to(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function _i(){if(Xr||(ce=to(),!ce))return;at=HTMLSlotElement.prototype.assignedNodes,Pn=HTMLSlotElement.prototype.assignedElements,Ot=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(M)&&!Dn(this)?Hn(this,n):at?at.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(M)&&!Dn(this)?Hn(this,n).filter(r=>r.nodeType===1):Pn?Pn.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=Ot&&Ot.get?Ot.get.call(this):null;return n||Zr(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||Zr(this)}}),$n=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(M)&&!Dn(this)){let r=Si(this);if(r){let o=ee(r);o.manualAssign||(o.manualAssign=new Map);let s=n.filter(Boolean);for(let[i,c]of o.manualAssign){if(i===this)continue;let a=c.filter(l=>{let f=l.deref();return f!==void 0&&s.indexOf(f)===-1});a.length!==c.length&&(a.length?o.manualAssign.set(i,a):o.manualAssign.delete(i))}if(s.length?o.manualAssign.set(this,s.map(i=>new WeakRef(i))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let i of s)o.pendingRecordNodes.add(i);else o.pendingRecordNodes=new Set(s);Ue(o),te(r)}return}return $n?$n.apply(this,n):void 0},Xr=!0}function Gn(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let s=!1,i=o.filter(c=>{let a=c.deref();return a===void 0?!1:(a===t&&(s=!0),!0)});if(i.length!==o.length&&(i.length?n.set(r,i):n.delete(r)),s){let c=e.host;return c&&(r===c||c.contains(r))?r:null}}return null}function Si(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[R])return Q(t,e)?t:null;return null}function Dn(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 Hn(e,t){if(e.getAttribute(q)!==K)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Wn(n,new Set,0)}function Wn(e,t,n){if(n>=wi)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let s=o;if(t.has(s))continue;if(t.add(s),s.hasAttribute(M)){let i=Hn(s,{flatten:!1});if(i.length>0)for(let c of Wn(i,t,n+1))r.push(c);else for(let c of Wn(Array.from(s.childNodes),t,n+1))r.push(c)}else if(at){let i=at.call(s,{flatten:!0});for(let c of i)r.push(c)}else r.push(o)}else r.push(o);return r}function Zr(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(M)&&t.getAttribute(q)===K?t:null}function ee(e){let t=e,n=t[R];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[R]=n),n}function Yn(e){return!!e[R]}function no(e){let t=ee(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),v.add(n),e.removeChild(n)}Ue(t)}function Ue(e){let t=e.assignedByName;t.clear();for(let n of e.authored)Ai(t,Ae(e,n),n)}function Ae(e,t){let n=Gn(e,t);if(n)return V(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return oo(t)}function ro(e){let t=ee(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${M}]`);for(let o of r){let s=o;if(!Q(e,s)||s.getAttribute(q)!==K||Dt(t,e,s))continue;let i=V(s.getAttribute("name"));if(!n.has(i)){n.add(i);let c=Array.from(s.childNodes);for(let a of c)t.authored.push(a),oo(a)!==i&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(a,i));t.lastSnapshot.set(s,c.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if(Q(e,o)){for(let s of Array.from(o.childNodes))v.add(s),t.authored.push(s);o.remove()}Ue(t)}function V(e){return e==null||e===""||e==="default"?null:e}function oo(e){return e.nodeType!==1?null:V(e.getAttribute("slot"))}function Ai(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function Ce(e,t,n){let r=ee(e),o=V(t),s=Array.isArray(n)?n.filter(Boolean):n?[n]:[],i=r.authored.findIndex(a=>Ae(r,a)===o),c=r.authored.filter(a=>Ae(r,a)===o);r.authored=r.authored.filter(a=>Ae(r,a)!==o),(i===-1||i>r.authored.length)&&(i=r.authored.length);for(let a of s)a.nodeType===1&&!Gn(r,a)&&(o==null?a.removeAttribute("slot"):a.setAttribute("slot",o)),v.add(a);if(r.authored.splice(i,0,...s),r.applying&&r.pendingRecordNodes){for(let a of c)r.pendingRecordNodes.add(a);for(let a of s)r.pendingRecordNodes.add(a)}else r.pendingRecordNodes=new Set([...c,...s]);if(r.adoptedKey){for(let a of c)r.adoptedKey.delete(a);for(let a of s)r.adoptedKey.delete(a)}Ue(r),te(e)}function Ei(){ae||!ce||(ae=Node.prototype.appendChild,so=Node.prototype.insertBefore,qe=Node.prototype.removeChild,zn=Node.prototype.replaceChild,io=Element.prototype.append,ao=Element.prototype.prepend,co=Element.prototype.replaceChildren,Lt=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),Vn=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function Pt(e,t){let n=e[D];e[D]=!0;try{return t()}finally{e[D]=n,n||Jn(e)}}function lo(e){if(!ce)return;let t=e,n=ee(e);n.backstop||(n.backstop=new MutationObserver(r=>$t(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>uo(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function $t(e,t,n){let r=e,o=r[xe],s=r[Symbol.for("webjs.instance")],i=!1,c=new Set;for(let a of n){for(let l of a.addedNodes)if(c.add(l),l!==o&&!(s&&ho(s,l))){if(t.authored.indexOf(l)!==-1){i=!0;continue}v.add(l),t.authored.push(l),i=!0}for(let l of a.removedNodes){let f=t.authored.indexOf(l);if(f===-1||e.contains(l))continue;v.has(l)&&l.parentNode==null&&!c.has(l)||(t.authored.splice(f,1),i=!0)}}i&&te(e)}function Jn(e){let t=e,n=t[R];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&$t(e,n,r)}function uo(e,t){let n=e[R];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let s=o.target;o.attributeName==="name"?s.tagName==="SLOT"&&s.hasAttribute(M)&&Q(e,s)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(s),n.authored.indexOf(s)!==-1&&(r=!0))}r&&te(e)}function fo(e){let t=e[R];t&&(t.backstop&&($t(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(uo(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function po(e){if(!ce)return;let t=e,n=t[R];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,s=!o&&n.adopted===!0,i=!1;for(let c of Array.from(e.childNodes))if(c!==t[xe]){if(n.authored.indexOf(c)!==-1){i=!0;continue}o&&(!r||ho(r,c))||!o&&s||(v.add(c),n.authored.push(c),i=!0)}i&&te(e)}function ho(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 xi(e){let t=e,n=t[xe];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[xe]=n),Pt(e,()=>ae.call(e,n))),n}function Ee(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function Fn(e,t,n){if(n&&!Ee(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!Ee(t))throw new TypeError("Failed to execute insertion on the host: parameter is not of type Node.");if(t&&t.nodeType===11){let r=Array.from(t.childNodes);Mt(e,r);for(let o of r)qe.call(t,o);return r}return Mt(e,[t]),[t]}function Mt(e,t){Be(e,t);for(let n of t){if(!Ee(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 Be(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 Bn(e,t,n){let r=e.authored;for(let s of t){let i=r.indexOf(s);i!==-1&&r.splice(i,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function mo(e,t){let n=e[R];return n?Dt(n,e,t):!1}function Dt(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function qn(e,t){if(v.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[xe])return!0;let r=e[R];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(M)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&Q(e,n))}function Un(e,t){let n=[];for(let s of t)Ee(s)?s.nodeType===11?n.push({frag:s}):n.push({node:s}):n.push({text:`${s}`});for(let s of n)s.frag?Be(e,Array.from(s.frag.childNodes)):s.node&&Mt(e,[s.node]);let r=e.ownerDocument.createDocumentFragment();for(let s of n)if(s.text!==void 0)ae.call(r,e.ownerDocument.createTextNode(s.text));else if(s.frag){let i=Array.from(s.frag.childNodes);Mt(e,i);for(let c of i)ae.call(r,c)}else s.node&&(Be(e,[s.node]),ae.call(r,s.node));let o=Array.from(r.childNodes);Be(e,o);for(let s of o)qe.call(r,s);return o}function Z(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);Ue(t),te(e)}function bo(e){if(!ce)return;let t=e;if(t[Qr])return;Ei(),t[Qr]=!0;let n=ee(e);t.appendChild=function(r){if(t[D])return ae.call(this,r);let o=Fn(e,r,!1);for(let s of o)v.add(s);return Bn(n,o,null),Z(e,n,o),r},t.insertBefore=function(r,o){if(t[D])return so.call(this,r,o);if(!Ee(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!Ee(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(Be(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!qn(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let s=Fn(e,r,!1);for(let i of s)v.add(i);return Bn(n,s,o||null),Z(e,n,s),r},t.removeChild=function(r){if(t[D])return qe.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return qe.call(this,r);if(!qn(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),Z(e,n,[r]),r},t.replaceChild=function(r,o){if(t[D])return zn.call(this,r,o);if(n.authored.indexOf(o)===-1)return zn.call(this,r,o);if(!Ee(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(Be(e,r.nodeType===11?Array.from(r.childNodes):[r]),!qn(e,o))throw new DOMException("replaceChild: the node to be replaced is not an assigned child of this host","NotFoundError");if(r===o)return o;let i=Fn(e,r,!1);for(let a of i)v.add(a);for(let a of i){if(a===o)continue;let l=n.authored.indexOf(a);l!==-1&&n.authored.splice(l,1)}let c=n.authored.indexOf(o);return n.authored.splice(c,1,...i),Z(e,n,[...i,o]),o},t.append=function(...r){if(t[D])return io.apply(this,r);let o=Un(e,r);for(let s of o)v.add(s);Bn(n,o,null),Z(e,n,o)},t.prepend=function(...r){if(t[D])return ao.apply(this,r);let o=Un(e,r);for(let s of o)v.add(s);for(let s of o){let i=n.authored.indexOf(s);i!==-1&&n.authored.splice(i,1)}n.authored.unshift(...o),Z(e,n,o)},t.replaceChildren=function(...r){if(t[D])return co.apply(this,r);let o=Un(e,r);for(let i of o)v.add(i);let s=n.authored;n.authored=o.slice(),Z(e,n,[...s,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return Lt.get.call(this)},set(r){if(t[D]){Lt.set.call(this,r);return}let o=e.ownerDocument.createElement("div");Lt.set.call(o,r===null?"":`${r}`);let s=Array.from(o.childNodes);for(let c of s)v.add(c);let i=n.authored;n.authored=s,Z(e,n,[...i,...s])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return Vn.get.call(this)},set(r){if(t[D]){Vn.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let i of o)v.add(i);let s=n.authored;n.authored=o,Z(e,n,[...s,...o])}})}function te(e){if(!ce)return;let t=e[R];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||Ci;t.pendingRecordNodes=void 0,ki(e,t,n),vi(e,t),Ue(t);let r=[],o=new Set;for(let f of e.querySelectorAll(`slot[${M}]`))if(Q(e,f)&&!Dt(t,e,f)){if(!f.hasAttribute(q)&&!(ct in f)){o.add(V(f.getAttribute("name")));continue}r.push(f)}let s=new Map;for(let f of r){let u=V(f.getAttribute("name")),d=s.get(u);d||(d=[],s.set(u,d)),d.push(f)}let i=[];for(let[f,u]of s){let d=t.assignedByName.get(f)||[];for(let p=0;p<u.length;p++){let g=u[p],b=d.filter(h=>{let y=Gn(t,h);return y?y===g:p===0}),m=b.filter(h=>h===e||h.nodeType===1&&h.contains(e));if(m.length){for(let h of m)v.delete(h);b=b.filter(h=>m.indexOf(h)===-1)}b.length>0?Ni(t,g,b)&&i.push(g):ji(t,g)&&i.push(g)}}for(let f of i)Oi(t,f);let c=new Set(s.keys());for(let f of o)c.add(f);let a=new Set;for(let f of t.authored)c.has(Ae(t,f))||a.add(f);let l=e[xe];if(l)for(let f of Array.from(l.childNodes))a.has(f)||qe.call(l,f);if(a.size){let f=xi(e);for(let u of a)u.parentNode!==f&&(v.delete(u),Pt(e,()=>ae.call(f,u)))}if(t.backstop){let f=t.backstop.takeRecords();f.length&&$t(e,t,f)}}while(t.reapply)}finally{t.applying=!1}}}function ki(e,t,n){for(let r of e.querySelectorAll(`slot[${M}][${q}="${K}"]`)){if(!Q(e,r)||Dt(t,e,r))continue;let o=r,s=t.lastSnapshot.get(o);if(!s)continue;let i=Array.from(o.childNodes);if(Kn(i,s))continue;let c=t.authored,a=V(o.getAttribute("name")),l=i.filter(g=>!n.has(g));for(let g of l)c.indexOf(g)===-1&&Ae(t,g)!==a&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(g,a));for(let g of c){if(l.indexOf(g)!==-1||Ae(t,g)!==a)continue;let b=c.indexOf(g),m=0;for(let h=0;h<l.length;h++){let y=c.indexOf(l[h]);y!==-1&&y<b&&(m=h+1)}l.splice(m,0,g)}let f=new Set(l);for(let g of s)f.add(g);let u=-1,d=0;for(let g of c){if(f.has(g)){u===-1&&(u=d);continue}d+=1}let p=c.filter(g=>!f.has(g));(u===-1||u>p.length)&&(u=p.length),p.splice(u,0,...l),t.authored=p}}function vi(e,t){let n=e[xe];t.authored=t.authored.filter(r=>{if(v.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(M)&&(t.lastSnapshot.has(o)||e.contains(o)&&Q(e,o)))})}function go(e){if(!ce)return!1;for(let t of e.querySelectorAll(`slot[${M}][${q}]`))if(Q(e,t))return!0;return!1}function Q(e,t){let n=t[It];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(yi):null;if(r){let o=Ti(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 Ti(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 Ni(e,t,n){for(let l of n)v.delete(l);let r=t.getAttribute(q)!==K,o=e.lastSnapshot.get(t)||[],s=r||!Kn(o,n);if(!r&&Kn(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),s;let i=t[ct];if(r&&i)for(;t.firstChild;)i.appendChild(t.firstChild);let c=new Set(n);for(let l of Array.from(t.childNodes))c.has(l)||t.removeChild(l);let a=t.firstChild;for(let l of n){if(l===a){a=a.nextSibling;continue}t.insertBefore(l,a)}return t.setAttribute(q,K),e.lastSnapshot.set(t,n.slice()),s}function ji(e,t){let n=t.getAttribute(q)===K;if(t.setAttribute(q,gi),!n)return eo(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return eo(t),!0}function eo(e){let t=e[ct];!t||t.childNodes.length===0||e.appendChild(t)}function yo(e,t){if(!Yn(e))return;let n=ee(e),r=V(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let s of o)s.parentNode===t&&(v.add(s),t.removeChild(s));n.lastSnapshot.delete(t)}function Ri(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function Oi(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)Ri(r)}))}function Kn(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 ce,R,M,q,K,gi,ct,It,yi,wi,at,Pn,Ot,$n,Xr,D,Qr,xe,v,ae,so,qe,zn,io,ao,co,Lt,Vn,Ci,Ft=se(()=>{ce=to(),R=Symbol("webjs.slot.state"),M="data-webjs-light",q="data-projection",K="actual",gi="fallback",ct=Symbol("webjs.slot.fallbackFrag"),It=Symbol("webjs.slot.templateOwner"),yi="data-wj-slot-owner",wi=64,at=null,Pn=null,Ot=null,$n=null,Xr=!1;_i();D=Symbol("webjs.slot.rendering"),Qr=Symbol("webjs.slot.intercepted"),xe=Symbol("webjs.slot.park"),v=new WeakSet,ae=null,so=null,qe=null,zn=null,io=null,ao=null,co=null,Lt=null,Vn=null;Ci=new Set});function Lo(e,t,n){oa.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function pt(e){return JSON.stringify(await Mo(e))}function ne(e){return Io(JSON.parse(e))}async function Mo(e){let t=sa();return await ia(e,t),ke(e,t)}function Io(e){return ue(e,ua())}function sa(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function ia(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!da(r))continue;let o=t.refCount.get(r)||0;if(t.refCount.set(r,o+1),!(o>0)){if(typeof Blob<"u"&&r instanceof Blob){let s=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,s);continue}if(typeof FormData<"u"&&r instanceof FormData){let s=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,s);for(let[,i]of s)typeof i!="string"&&n.push(i);continue}if(Array.isArray(r))for(let s=0;s<r.length;s++)n.push(r[s]);else if(r instanceof Map)for(let[s,i]of r)n.push(s),n.push(i);else if(r instanceof Set)for(let s of r)n.push(s);else if(pa(r))for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&n.push(r[s])}}for(let[r,o]of t.refCount)o>1&&t.idOf.set(r,t.nextId++)}function ke(e,t){if(e===null)return null;if(e===void 0)return{[T]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[T]:"NaN"}:e===1/0?{[T]:"Inf"}:e===-1/0?{[T]:"-Inf"}:Object.is(e,-0)?{[T]:"-0"}:e;if(n==="bigint")return{[T]:"BigInt",v:e.toString()};if(n==="symbol"){let s=Symbol.keyFor(e);if(s===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[T]:"Sym",v:s}}if(n==="function")throw new TypeError("Cannot serialize a function.");let r=t.idOf.get(e);if(r!==void 0&&t.emitted.has(r))return{[T]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[T]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[T]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let s=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[T]:"File",v:dt(s),n:e.name,t:e.type||"",m:e.lastModified}:o={[T]:"Blob",v:dt(s),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let s=t.fdEntries.get(e)||[...e.entries()],i=[];for(let[c,a]of s)i.push([c,ke(a,t)]);o={[T]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=aa(e);else if(e instanceof Map){let s=[];for(let[i,c]of e)s.push([ke(i,t),ke(c,t)]);o={[T]:"Map",v:s}}else if(e instanceof Set){let s=[];for(let i of e)s.push(ke(i,t));o={[T]:"Set",v:s}}else if(Array.isArray(e))o=e.map(s=>ke(s,t));else{o={};for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let i=ha(s)?"_"+s:s;Lo(o,i,ke(e[s],t))}}if(r!==void 0){if(Array.isArray(o))return{[T]:"Arr",_id:r,v:o};o._id=r}return o}function aa(e){if(e instanceof ArrayBuffer)return{[T]:"buf",v:dt(new Uint8Array(e))};if(e instanceof DataView)return{[T]:"dv",v:dt(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=ca[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[T]:n,v:dt(r)}}function ua(){return{refs:new Map}}function ue(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let s=[];for(let i=0;i<e.length;i++)s.push(ue(e[i],t));return s}let n=e[T];if(typeof n=="string")return fa(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s)||s==="_id")continue;let i=ma(s)?s.slice(1):s;Lo(r,i,ue(e[s],t))}return r}function fa(e,t,n){let r=e._id,o=s=>(typeof r=="number"&&n.refs.set(r,s),s);switch(t){case"undef":return;case"NaN":return NaN;case"Inf":return 1/0;case"-Inf":return-1/0;case"-0":return-0;case"BigInt":return o(BigInt(e.v));case"Sym":return o(Symbol.for(e.v));case"Date":return o(e.v==null?new Date(NaN):new Date(e.v));case"Error":{let s=new Error(e.v.message);return s.name=e.v.name,e.v.stack&&(s.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,s),s}case"Map":{let s=new Map;typeof r=="number"&&n.refs.set(r,s);for(let[i,c]of e.v)s.set(ue(i,n),ue(c,n));return s}case"Set":{let s=new Set;typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.add(ue(i,n));return s}case"Arr":{let s=[];typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.push(ue(i,n));return s}case"Ref":{let s=n.refs.get(e.v);if(s===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return s}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let s=ft(e.v);return o(new Blob([s],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let s=ft(e.v);return o(new File([s],e.n,{type:e.t||"",lastModified:e.m}))}case"FD":{if(typeof FormData>"u")throw new TypeError("FormData is not available in this environment.");let s=new FormData;o(s);for(let[i,c]of e.v){let a=ue(c,n);s.append(i,a)}return s}default:{if(t==="buf"){let i=ft(e.v);return o(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=ft(e.v);return o(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let s=la[t];if(s){let i=ft(e.v),c=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength);return o(new s(c))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function da(e){return e!==null&&typeof e=="object"}function pa(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ha(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function ma(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function dt(e){if(Po)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 ft(e){if(Po){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 T,oa,ca,la,Po,Ve=se(()=>{T="_$wj",oa=new Set(["__proto__","constructor","prototype"]);ca={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},la={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};Po=typeof Buffer<"u"&&typeof Buffer.from=="function"});var Xo={};Ur(Xo,{observeLazy:()=>tc,observeViewportOnce:()=>oc});function Jo(e){let t=cr.get(e);return t||(t=import(e).finally(()=>cr.delete(e)),cr.set(e,t),t)}function tc(e){for(let[t,n]of Object.entries(e))ve.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of ve.values())Jo(t);ve.clear();return}gt||(gt=new IntersectionObserver(nc,{rootMargin:"200px"})),Yo(),typeof MutationObserver<"u"&&new MutationObserver(()=>Yo()).observe(document.body,{childList:!0,subtree:!0})}function Yo(){if(!(!gt||!ve.size))for(let e of ve.keys())for(let t of document.querySelectorAll(e))gt.observe(t)}function nc(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=ve.get(n);r&&(Jo(r),ve.delete(n),gt?.unobserve(t.target))}}function rc(e){for(let t of e){if(!t.isIntersecting)continue;let n=Qt.get(t.target);Qt.delete(t.target),bt?.unobserve(t.target),n&&n()}}function oc(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(bt||(bt=new IntersectionObserver(rc,{rootMargin:"200px"})),Qt.set(e,t),bt.observe(e),()=>{Qt.delete(e),bt?.unobserve(e)})}var ve,gt,cr,bt,Qt,Zo=se(()=>{ve=new Map,gt=null,cr=new Map;bt=null,Qt=new WeakMap});var lr,ur=se(()=>{lr=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(()=>(Zo(),Xo)).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(()=>(fr(),Qo)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&lr&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",lr)});function ic(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 pr(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let s=n.createElement("template");s.innerHTML=e,r=s.content}else if(e&&e.nodeType)r=e;else return;let o=r.querySelectorAll?Array.from(r.querySelectorAll("webjs-stream")):[];if(o.length)for(let s of o)n.body.append(s);else n.body.append(r)}var sc,dr,en=se(()=>{sc=new Set(["append","prepend","before","after","replace","update"]);dr=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this._webjsApplied||(this._webjsApplied=!0,this._webjsApply())}_webjsApply(){let t=(this.getAttribute("action")||"").toLowerCase(),n=this.ownerDocument||document,r=[],o=this.getAttribute("target");if(o){let i=n.getElementById(o);i&&(r=[i])}else{let i=this.getAttribute("targets");if(i)try{r=Array.from(n.querySelectorAll(i))}catch{r=[]}}let s=sc.has(t)?this.querySelector("template"):null;try{for(let i of r){let c=s?s.content.cloneNode(!0):null;ic(t,i,c)}}finally{this.remove()}}}:null;typeof customElements<"u"&&dr&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",dr)});var es,ts=se(()=>{es=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&es&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",es)});function tn(e){let t=e||(typeof document<"u"?document:null);if(!(!t||typeof t.querySelectorAll!="function")){for(let n of t.querySelectorAll('script[type="application/json"]#__webjs-seeds, script[type="application/json"][data-webjs-seeds]'))rs(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))rs(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function rs(e,t,n){if(e)try{let r=ne(e);if(r&&typeof r=="object")for(let o in r)yt.has(o)||yt.set(o,r[o])}catch{}n?n():t.remove?.()}function ac(e,t,n){ns||(ns=!0,tn());let r=`${e}/${t}/${n}`;if(yt.has(r)){let o=yt.get(r);return yt.delete(r),o}return os}var yt,os,ns,hr=se(()=>{Ve();yt=new Map,os=Symbol("webjs.seed.miss"),ns=!1});var Qo={};Ur(Qo,{_FRAME_TOP:()=>ys,_LIVE_ATTRS:()=>Sr,_activeFrameId:()=>gs,_addNewHeadElements:()=>Er,_applyOptimisticLoading:()=>Lr,_applyStreamedResolve:()=>Bs,_applySwap:()=>Or,_blurOutgoingFocus:()=>sn,_buildHaveHeader:()=>xt,_buildSubmitFormData:()=>ms,_bumpNavToken:()=>qc,_clearFormBusy:()=>Ls,_clearFrameBusy:()=>Rs,_collectBoundaries:()=>et,_currentPageUrl:()=>Uc,_diffElementInPlace:()=>pn,_eligibleAnchorHref:()=>cn,_findAnchorInPath:()=>bs,_getSubmitAction:()=>hs,_getSubmitMethod:()=>ps,_isNonHtmlPath:()=>Vc,_keyOf:()=>Qe,_markFormBusy:()=>Os,_markFrameBusy:()=>js,_mergeHead:()=>$s,_navToken:()=>Bc,_onPopState:()=>kr,_onSubmit:()=>vr,_parseHTML:()=>xr,_planBoundarySwap:()=>_s,_prefetch:()=>tt,_prefetchAnchor:()=>ks,_prefetchCache:()=>N,_prefetchHasHoverPointer:()=>xs,_prefetchInflightSize:()=>Dc,_prefetchMode:()=>ln,_prefetchPeek:()=>$c,_prefetchSaysSaveData:()=>jr,_prefetchSuppressed:()=>Cs,_prefetchTake:()=>vs,_reactivateScripts:()=>Et,_readStreamedShell:()=>Ds,_reconcileChildren:()=>_n,_regraftPermanentElements:()=>Is,_regraftPermanentInSlice:()=>wn,_resetParseProbe:()=>lc,_resetPrefetch:()=>Fc,_resetWarnOnce:()=>Wc,_resolveTargetFrameId:()=>Tr,_restoreOptimistic:()=>wt,_runWithTransition:()=>rn,_setCurrentPageUrl:()=>Hc,_shouldFullLoadDuringParse:()=>zc,_snapshotCache:()=>F,_streamBoundariesProgressively:()=>qs,_takeResolveUnit:()=>Fs,_viewTransitionsEnabled:()=>Ms,collectBoundaries:()=>et,disableClientRouter:()=>ls,enableClientRouter:()=>Cr,loadFrame:()=>dc,navigate:()=>us,planBoundarySwap:()=>_s,revalidate:()=>fs});function xr(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"&&cc()?Document.parseHTMLUnsafe(e):uc(e)}function cc(){if(Ge!==null)return Ge;try{Ge=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{Ge=!1}return Ge}function lc(){Ge=null}function uc(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}function fc(){mr||typeof MutationObserver>"u"||typeof customElements>"u"||(mr=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)}}),mr.observe(document.body,{childList:!0,subtree:!0}))}function Cr(){he||typeof document>"u"||(he=!0,document.addEventListener("click",ds,!1),document.addEventListener("submit",vr,!1),window.addEventListener("popstate",kr),document.addEventListener("pointerover",Ze,!0),document.addEventListener("focusin",Ze,!0),document.addEventListener("touchstart",Ze,{capture:!0,passive:!0}),document.addEventListener("pointerout",Ts,!0),document.addEventListener("webjs:navigate",_r),fc(),_r(),typeof history<"u"&&"scrollRestoration"in history&&(nn=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(X=location.href))}function ls(){he&&(he=!1,document.removeEventListener("click",ds,!1),document.removeEventListener("submit",vr,!1),window.removeEventListener("popstate",kr),document.removeEventListener("pointerover",Ze,!0),document.removeEventListener("focusin",Ze,!0),document.removeEventListener("touchstart",Ze,{capture:!0}),document.removeEventListener("pointerout",Ts,!0),document.removeEventListener("webjs:navigate",_r),yn(),Rr(),de&&(de.disconnect(),de=null),typeof history<"u"&&nn!==null&&(history.scrollRestoration=nn,nn=null),X=null)}async function us(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){location.href=e;return}await Nr(n.href,t?.replace??!1,null)}async function dc(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1};W&&W.abort(),W=new AbortController;let o=W.signal,s=++$;return un(r.href,n,!1,null,"GET",null,o,s)}function fs(e){if(!e){F.clear(),N.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;F.delete(n),N.delete(n)}function ds(e){if(!he||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=bs(e);if(!t||t.hasAttribute("download")||t.hasAttribute("data-no-router")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin||r.pathname===location.pathname&&r.search===location.search&&r.hash||bn.test(r.pathname))return;e.preventDefault();let o=Tr(t);Nr(n,!1,o)}function kr(e){Nr(location.href,!0,null)}function vr(e){if(!he||e.defaultPrevented)return;let t=e.target;if(!t||t.nodeType!==1||t.tagName!=="FORM"||t.hasAttribute("data-no-router"))return;let n=e.submitter??null;if(n&&n.hasAttribute("data-no-router"))return;let r=n&&n.getAttribute("formtarget")||t.getAttribute("target")||"";if(r&&r!=="_self")return;let o=ps(t,n);if(o==="dialog")return;let s=hs(t,n),i;try{i=new URL(s,location.href)}catch{return}if(i.origin!==location.origin||bn.test(i.pathname))return;let c=ms(t,n);e.preventDefault();let a=Tr(n||t);bc(i.href,o,c,a,t)}function ps(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function hs(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function ms(e,t){try{return new FormData(e,t||void 0)}catch{let n=new FormData(e);return t&&t.getAttribute("name")&&n.append(t.getAttribute("name"),t.getAttribute("value")||""),n}}function bs(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function gs(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 Tr(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===ys)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(gn(`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 gs(e)}function gn(e,t){gr.has(e)||(gr.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function ws(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function Te(e,t,n=!0){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||gn(`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 pc(e){typeof process<"u"&&process.env||gn(`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 is(){if(typeof process<"u"&&process.env||yr||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;yr=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&gn("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 an(e){if(typeof document>"u")return;let t=document.documentElement;if(!(!t||!t.hasAttribute("data-webjs-nav-progress")))try{e?t.setAttribute("data-navigating",""):t.removeAttribute("data-navigating")}catch{}}function et(e){let t=new Map,n=[],r=!1;function o(s){if(!r){if(s.nodeType===8){let i=s.data.trim();if(i.startsWith("wj:children:")){let c=i.slice(12),a=c.lastIndexOf(":");if(a<=0||a===c.length-1){r=!0;return}let l=c.slice(0,a),f=c.slice(a+1);if(t.has(l)||n.some(u=>u.segment===l)){r=!0;return}n.push({segment:l,routeKey:f,start:s});return}if(i.startsWith("/wj:children")){let c=i.slice(12).replace(/^:/,""),a=n.pop();if(!a||a.segment!==c){r=!0;return}if(a.start.parentNode!==s.parentNode){r=!0;return}{let l=a.start.parentNode.tagName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TFOOT"||l==="TR"){r=!0;return}}t.set(a.segment,{routeKey:a.routeKey,start:a.start,end:s});return}return}if(s.hasChildNodes&&s.hasChildNodes())for(let i=s.firstChild;i&&!r;i=i.nextSibling)o(i)}}return o(e),r||n.length>0?null:t}function _s(e,t){let n=[...e.keys()].filter(i=>t.has(i)).sort((i,c)=>i.length-c.length);if(n.length===0)return null;for(let i of n)if(e.get(i).routeKey!==t.get(i).routeKey){let c=null;for(let a of n){if(a===i)break;i.startsWith(a==="/"?a:a+"/")&&(c=a)}return c?{mode:"replace",segment:c,live:e.get(c),incoming:t.get(c)}:null}let r=n[n.length-1],o=i=>{let c=null;for(let a of i.keys())(c===null||a.length>c.length)&&(c=a);return c};return{mode:o(e)===r&&o(t)===r?"morph":"replace",segment:r,live:e.get(r),incoming:t.get(r)}}function Ss(e){let t=pe(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),F.has(t)&&F.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(F.set(t,n);F.size>hc;){let r=F.keys().next().value;F.delete(r)}}function mc(e){let t=pe(e),n=F.get(t);return n==null?null:(F.delete(t),F.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function pe(e){let t=new URL(e,location.href);return t.pathname+t.search}async function Nr(e,t,n){if(ws(t,n)&&typeof location<"u"){Te("readyState-loading",e),location.href=e;return}W&&W.abort(),W=new AbortController;let r=W.signal,o=++$;X&&Ss(X);let s=setTimeout(()=>{an(!0),s=null},150),i=null;t||(i=Lr());try{if(t){let c=mc(e);if(c){let a=xr(c.html);if(a){Or(a,n,!0,null),typeof window<"u"&&window.scrollTo({left:c.scrollX,top:c.scrollY,behavior:"instant"}),un(e,n,!1,i,"GET",null,r,o,!0).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await un(e,n,!t,i,"GET",null,r,o)}finally{s&&clearTimeout(s),o===$&&(an(!1),typeof location<"u"&&(X=location.href))}}async function bc(e,t,n,r,o){W&&W.abort(),W=new AbortController;let s=W.signal,i=++$,c=t==="get"||t==="head",a=new URL(e,location.href);if(c){a.search="";for(let[p,g]of n)a.searchParams.append(p,typeof g=="string"?g:g.name)}X&&Ss(X);let l=setTimeout(()=>{an(!0),l=null},150),f=Lr(),u=o?Os(o,i,a.href):null,d=!1;try{let p=await un(a.href,r,!0,f,c?"GET":t.toUpperCase(),c?null:n,s,i);d=!!(p&&p.ok),!c&&i===$&&(F.clear(),N.clear())}finally{u&&Ls(u,i,a.href,d),l&&clearTimeout(l),i===$&&(an(!1),typeof location<"u"&&(X=location.href))}}function xt(){let e=et(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}function jr(){try{let e=typeof navigator<"u"?navigator.connection:null;if(e&&(e.saveData===!0||typeof e.effectiveType=="string"&&/2g$/.test(e.effectiveType))||typeof matchMedia=="function"&&matchMedia("(prefers-reduced-data: reduce)").matches)return!0}catch{}return!1}function xs(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Sc(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function cn(e){if(!e||!(e instanceof HTMLAnchorElement)||e.hasAttribute("download")||e.hasAttribute("data-no-router")||e.target&&e.target!=="_self")return null;let t=e.href;if(!t)return null;let n;try{n=new URL(t)}catch{return null}return n.origin!==location.origin||n.pathname===location.pathname&&n.search===location.search&&n.hash||bn.test(n.pathname)?null:t}function Cs(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Sc(e);return t.includes("external")||t.includes("no-prefetch")}function ln(e){if(Cs(e))return"none";switch((e.getAttribute("data-prefetch")||"").toLowerCase().trim()){case"false":case"none":return"none";case"true":case"render":return"render";case"auto":case"viewport":return"viewport";case"intent":return"intent";default:return xs()?"intent":"viewport"}}function tt(e){if(!he||typeof fetch!="function"||jr())return;let t=pe(e);if(typeof location<"u"&&t===pe(location.href)||Ne.has(t)||_t.has(t))return;let n=N.get(t);if(n&&wr()-n.at<As)return;if(Ne.size>=Es){for(_t.add(t),Je.push(e);Je.length>yc;){let s=Je.shift();_t.delete(pe(s))}return}let r=xt();if(!r&&typeof document<"u"&&document.readyState==="loading")return;Ne.add(t);let o={"x-webjs-router":"1","x-webjs-prefetch":"1"};r&&(o["x-webjs-have"]=r),fetch(e,{method:"GET",headers:o,credentials:"same-origin"}).then(async s=>{let i=s.headers.get("content-type")||"";if(!/^text\/html\b/i.test(i)||s.status>=400)return;let c=s.headers.get("x-webjs-build"),a=s.headers.get("x-webjs-src"),l=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,f=l?l.getAttribute("data-webjs-build"):null,u=l?l.getAttribute("data-webjs-src"):null;(c&&f&&c!==f||a&&u&&a!==u)&&(F.clear(),N.clear());let d=s.redirected&&s.url?s.url:e,p=await s.text();Ec(t,{html:p,build:c,src:a,finalUrl:d,at:wr()})}).catch(()=>{}).finally(()=>{Ne.delete(t),Ac()})}function Ac(){for(;Je.length&&Ne.size<Es;){let e=Je.shift();_t.delete(pe(e)),tt(e)}}function Ec(e,t){for(N.has(e)&&N.delete(e),N.set(e,t);N.size>gc;){let n=N.keys().next().value;N.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function ks(e){let t=/<!--wj:children:([^>]*?)-->/.exec(e||"");return t?t[1]:null}function vs(e,t){let n=pe(e),r=N.get(n);if(!r)return null;if(wr()-r.at>=As)return N.delete(n),null;let o=ks(r.html);return o&&!new Set(String(t??(xt()||"")).split(",").filter(Boolean)).has(o)?(N.delete(n),null):(N.delete(n),r)}function wr(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function Ze(e){if(!he)return;let t=Ns(e.target);if(!t)return;let n=ln(t);if(n==="none"||n==="render")return;let r=cn(t);if(r){if(e.type==="touchstart"){tt(r);return}n==="intent"&&(St===t&&Xe||(yn(),St=t,Xe=setTimeout(()=>{Xe=null,St=null,tt(r)},wc)))}}function Ts(e){let t=Ns(e.target);t&&t===St&&yn()}function yn(){Xe&&(clearTimeout(Xe),Xe=null),St=null}function Rr(){for(let e of At)clearTimeout(e);At.clear(),Ye=new WeakMap}function Ns(e){let t=e;for(;t;){if(t instanceof HTMLAnchorElement)return t;let n=t.nodeType===1?t:null;if(n){let o=n.closest&&n.closest("a");if(o instanceof HTMLAnchorElement)return o}let r=t.getRootNode?t.getRootNode():null;t=r&&r.host?r.host:null}return null}function _r(){if(typeof document>"u"||jr())return;let e=typeof IntersectionObserver<"u";e&&(de?(de.disconnect(),Rr()):de=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(Ye.has(r))continue;let o=setTimeout(()=>{At.delete(o),Ye.delete(r),de.unobserve(r);let s=cn(r);s&&ln(r)==="viewport"&&tt(s)},_c);Ye.set(r,o),At.add(o)}else{let o=Ye.get(r);o&&(clearTimeout(o),At.delete(o),Ye.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=ln(t);if(n==="render"){let r=cn(t);r&&tt(r)}else n==="viewport"&&e&&de.observe(t)}}function xc(e){if(typeof document>"u"||!document.body)return!1;let t=et(document.body);if(!t)return!1;let n,r=-1;for(let[a,l]of t)a.length>r&&(r=a.length,n=l);if(!n)return!1;let o=n.start.parentNode;if(!o||n.start.parentNode!==n.end.parentNode)return!1;let s=document.createElement("div");s.setAttribute("role","alert"),s.setAttribute("data-webjs-nav-error","");let i=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";s.textContent=i;let c=document.createRange();return c.setStartAfter(n.start),c.setEndBefore(n.end),c.deleteContents(),o.insertBefore(s,n.end),!0}function br(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||xc(t)||typeof location<"u"&&(Te("navigation-error-unrecoverable",e),location.href=e)}async function un(e,t,n,r,o,s,i,c,a){o=o||"GET";let l=typeof c=="number"?c:$,f,u=null,d=null,p=null,g=null,b=!1,m=e,h=t?js(t,l):null;try{try{let w=o==="GET"&&!s&&!t?vs(e,r?r.haveKeys:void 0):null;if(w)f=w.html,d=w.build,p=w.src,m=w.finalUrl,g=200,b=!0;else{let C={"x-webjs-router":"1"},x=xt();x&&(C["x-webjs-have"]=x),t&&(C["x-webjs-frame"]=t),s!=null&&o!=="GET"&&o!=="HEAD"&&(C.accept=ss+", text/html");let k={method:o,headers:C,credentials:"same-origin"};i&&(k.signal=i),s!=null&&o!=="GET"&&o!=="HEAD"&&(k.body=s);let S=await fetch(e,k);g=S.status,b=S.ok;let E=S.headers.get("content-type")||"",A=/^text\/html\b/i.test(E);if(E.toLowerCase().indexOf(ss)===0){let j=await S.text();return l===$&&(wt(r),pr(j)),{ok:b,status:g,aborted:!1}}if(S.redirected&&S.url&&(m=S.url),S.status===204||S.status===205)return l===$&&n&&history.pushState(null,"",m),{ok:b,status:g,aborted:!1};if(!A)return l===$&&(wt(r),br(e,S.status,null)),{ok:!1,status:g,aborted:!1};d=S.headers.get("x-webjs-build"),p=S.headers.get("x-webjs-src");let I=await Ds(S);f=I.shell,I.streaming&&(u=I)}}catch(w){return w&&w.name==="AbortError"?{ok:!1,status:null,aborted:!0}:l!==$?{ok:!1,status:null,aborted:!0}:(wt(r),br(e,null,w instanceof Error?w:new Error(String(w))),{ok:!1,status:null,aborted:!1})}if(l!==$){if(u&&u.reader)try{u.reader.cancel()}catch{}return{ok:!1,status:g,aborted:!0}}let y=xr(f);if(!y)return wt(r),br(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:g,aborted:!1};if(Or(y,t,!!a,m,d,p)==="discard"){if(u&&u.reader)try{u.reader.cancel()}catch{}return{ok:b,status:g,aborted:!1}}if(n&&history.pushState(null,"",m),n){let w=new URL(m);if(w.hash){let C=document.getElementById(w.hash.slice(1));C?C.scrollIntoView():(is(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else is(),window.scrollTo({left:0,top:0,behavior:"instant"})}return u&&(u.reader||u.rest)&&on.then(()=>qs(u.reader,u.dec,u.rest,()=>l===$)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:m,frameId:t,from:"navigate"}})),{ok:b,status:g,aborted:!1}}finally{h&&Rs(h,l)}}function js(e,t){if(typeof document>"u")return null;let n=null;try{n=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{n=document.getElementById(e)}if(!n)return null;let r=fn.has(n);return fn.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 Rs(e,t){if(fn.get(e)!==t)return;fn.delete(e),e.setAttribute("aria-busy","false");let n=e.id||null;e.dispatchEvent(new CustomEvent("webjs:frame-busy",{bubbles:!0,detail:{frameId:n,busy:!1}}))}function Os(e,t,n){let r=dn.has(e);return dn.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 Ls(e,t,n,r){if(dn.get(e)!==t)return;dn.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 as(e){if(!e||!e.head)return"";let t=e.head.querySelectorAll('[data-webjs-track="reload"]');if(!t.length)return"";let n="";for(let r of t)n+=re(r);return n}function Ms(){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 rn(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(Ms()&&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 Is(e,t){if(!e||!t||typeof e.querySelectorAll!="function")return;let n=e.querySelectorAll("[data-webjs-permanent][id]");for(let r of n){let o=r.id;if(!o)continue;let s=null;try{s=t.querySelector(`#${CSS.escape(o)}`)}catch{s=null}if(!s||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let i=s.parentNode;i&&s!==r&&i.replaceChild(r,s)}}function wn(e,t){let n=[];for(let r of e){if(r.nodeType!==1)continue;let o=r;if(o.hasAttribute&&o.hasAttribute("data-webjs-permanent")&&o.id&&n.push(o),typeof o.querySelectorAll=="function")for(let s of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(s)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let s=Cc(t,o);if(!s||s===r)continue;let i=s.parentNode;if(i)i.replaceChild(r,s);else{let c=t.indexOf(s);c!==-1&&(t[c]=r)}}}function Cc(e,t){for(let n of e){if(n.nodeType!==1)continue;let r=n;if(r.id===t)return r;if(typeof r.querySelector=="function"){let o=null;try{o=r.querySelector(`#${CSS.escape(t)}`)}catch{o=null}if(o)return o}}return null}function kc(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&je(t)}function Or(e,t,n,r,o,s){try{tn(e)}catch{}try{for(let u of e.querySelectorAll("[data-wj-host]"))u.setAttribute("data-wj-serialized","")}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let u=document.querySelector('script[type="importmap"]'),d=u?u.getAttribute("data-webjs-build"):null,p=!1;if(o&&d&&(p=o!==d),!p&&e.head&&e.head.children.length>0){let g=as(document),b=as(e);g!==b&&(p=!0)}if(p&&typeof location<"u"){F.clear(),N.clear();try{let g="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(g))sessionStorage.removeItem(g),Te("deploy-mismatch-reload-suppressed",r,!1);else{sessionStorage&&sessionStorage.setItem(g,"1"),Te("deploy-mismatch",r),location.href=r;return}}catch{Te("deploy-mismatch",r),location.href=r;return}}else if(!p){let g=u?u.getAttribute("data-webjs-src"):null;s&&g&&s!==g&&(F.clear(),N.clear(),u&&u.setAttribute("data-webjs-src",s));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){let u=document.querySelector(`webjs-frame#${CSS.escape(t)}`),d=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(u&&d){Er(e.head),on=rn(()=>{Mc(u,d),Et(u),je(u),cs(e.body),sn()},()=>je(u));return}let p=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});(u||document).dispatchEvent(p),p.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`);return}let i=et(document.body),c=et(e.body),a=i&&c?_s(i,c):null;if(a){let{mode:u,live:d,incoming:p}=a;Er(e.head),on=rn(()=>{u==="replace"?vc(d,p):Tc(d,p,e),Oc(d.start,p.start),cs(e.body),sn()},()=>kc(d));return}if(r&&!n&&typeof location<"u"){Te(i?c?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),location.href=r;return}if(r&&n)return Te("revalidation-discarded",r,!1),"discard";$s(e.head),Is(document.body,e.body);let l=[...e.body.childNodes];on=rn(()=>{document.body.replaceChildren(...l),Et(document.body),je(document.body),sn()},()=>je(document.body))}function sn(){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 s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)r.push(s);let o=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)o.push(document.importNode(s,!0));wn(r,o);for(let s of r)s.parentNode===n&&n.removeChild(s);for(let s of o)n.insertBefore(s,e.end);for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)s.nodeType===1&&(Et(s),je(s))}function Tc(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)o.push(i);let s=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)s.push(document.importNode(i,!0));wn(o,s),Nc(r,e.start,e.end,o,s);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(Et(i),je(i))}function Nc(e,t,n,r,o){let s=new Map;for(let a of r){if(a.nodeType!==1)continue;let l=Qe(a);l&&s.set(l,a)}let i=n,c=[];for(let a of o){if(a.nodeType===1){let l=Qe(a);if(l&&s.has(l)){let f=s.get(l);pn(f,a),c.push(f),s.delete(l);continue}}c.push(a)}for(let a of r)if(a.parentNode===e){if(a.nodeType===1&&c.includes(a))continue;e.removeChild(a)}for(let a of c)e.insertBefore(a,i)}function pn(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),!Sr.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])Sr.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(jc(e)){Lc(e,t);return}_n(e,t)}function jc(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[R]!=null}function Rc(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function hn(e){let t=new Map,n=`slot[${M}][${q}="${K}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!Rc(o,e)||mo(e,o))continue;let s=!1;for(let c=o.parentElement;c&&c!==e;c=c.parentElement)if(c.tagName==="SLOT"&&c.hasAttribute(M)&&c.getAttribute(q)===K){s=!0;break}if(s)continue;let i=V(o.getAttribute("name"));t.has(i)||t.set(i,o)}return t}function Oc(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(M))return;let o=null;for(let u=r.parentElement;u;u=u.parentElement){if(u[R]){o=u;break}if(u.tagName.includes("-"))return}if(!o)return;let s=V(r.getAttribute("name"));Ce(o,s,[...r.childNodes]);let i=t.parentNode;if(!i||i.nodeType!==1)return;let c=i;if(c.tagName!=="SLOT")return;let a=null;for(let u=c.parentElement;u;u=u.parentElement)if(u.tagName.includes("-")){a=u;break}if(!a||a.tagName!==o.tagName)return;let l=hn(o),f=hn(a);for(let u of new Set([...l.keys(),...f.keys()])){if(u===s)continue;let d=f.get(u);d?Ce(o,u,[...d.childNodes].map(p=>document.importNode(p,!0))):l.get(u)&&Ce(o,u,null)}}function Lc(e,t){if(!e[R])return;let n=hn(e),r=hn(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let s of o){let i=n.get(s),c=r.get(s);i&&c?(_n(i,c),Ce(e,s,[...i.childNodes])):c?Ce(e,s,[...c.childNodes].map(a=>document.importNode(a,!0))):Ce(e,s,null)}}function _n(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(c=>document.importNode(c,!0));wn(n,r);let o=new Map;for(let c of n){if(c.nodeType!==1)continue;let a=Qe(c);a&&o.set(a,c)}let s=[];for(let c=0;c<r.length;c++){let a=r[c];if(a.nodeType===1){let l=Qe(a);if(l&&o.has(l)){let u=o.get(l);pn(u,a),s.push(u),o.delete(l);continue}let f=n[c];if(f&&f.nodeType===1&&!Qe(f)&&f.tagName===a.tagName){pn(f,a),s.push(f);continue}}else if(a.nodeType===3){let l=n[c];if(l&&l.nodeType===3){l.nodeValue!==a.nodeValue&&(l.nodeValue=a.nodeValue),s.push(l);continue}}else if(a.nodeType===8){let l=n[c];if(l&&l.nodeType===8){l.nodeValue!==a.nodeValue&&(l.nodeValue=a.nodeValue),s.push(l);continue}}s.push(a)}let i=new Set(s);for(let c of n)!i.has(c)&&c.parentNode===e&&e.removeChild(c);for(let c=0;c<s.length;c++){let a=s[c];(a.parentNode!==e||e.childNodes[c]!==a)&&e.insertBefore(a,e.childNodes[c]||null)}}function Qe(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Lr(){let e=et(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((a,l)=>l.length-a.length),n=null,r=null;for(let a of t){let l=document.getElementById(`wj-loading:${a}`);if(l instanceof HTMLTemplateElement){n=a,r=l;break}}if(n===null||r===null)return null;let o=e.get(n),s=xt(),i=[];for(let a=o.start.nextSibling;a&&a!==o.end;a=a.nextSibling)i.push(a);let c=document.createRange();return c.setStartAfter(o.start),c.setEndBefore(o.end),c.deleteContents(),o.start.parentNode.insertBefore(r.content.cloneNode(!0),o.end),{slot:o,oldChildren:i,token:$,haveKeys:s}}function wt(e){if(!e||e.token!==$)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 Mc(e,t){_n(e,t)}function Ps(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function Mr(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=Ps();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Ir(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=Ps();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function re(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function mn(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 Ic(e){if(!e.querySelector("meta"))return;let t=o=>{let s=new Map;for(let i of o.querySelectorAll("meta")){let c=mn(i);if(!c||c===Ar)continue;let a=s.get(c);a?a.push(i):s.set(c,[i])}return s},n=t(e),r=t(document.head);for(let[o,s]of n){let i=r.get(o)||[],c=s.map(re).join(`
|
|
2
|
-
`),
|
|
3
|
-
`);if(c
|
|
4
|
-
`),n.appendChild(r)}}function
|
|
5
|
-
`)}</style>`}var Oe=Object.freeze({"@":"event",".":"prop","?":"bool"});function Hr(e){return Object.prototype.hasOwnProperty.call(Oe,e)}function kt(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function H(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}var Wr=Symbol.for("webjs.repeat");function zr(e,t,n){return{[Wr]:!0,items:[...e],keyFn:t,templateFn:n}}function me(e){return!!e&&typeof e=="object"&&e[Wr]===!0}function kn(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function Le(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Ks(e){return{_$webjs:"live",value:e}}function Me(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function Gs(e,t){return{_$webjs:"keyed",key:e,value:t}}function be(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function Ys(e,t){return{_$webjs:"guard",deps:e,fn:t}}function ge(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Js(e){return{_$webjs:"template-content",template:e}}function Ie(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function Xs(e){return{_$webjs:"ref",target:e}}function ye(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Zs(){return{value:void 0}}function Qs(e){return{_$webjs:"cache",value:e}}function we(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function ei(...e){return{_$webjs:"until",args:e}}function _e(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function ti(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function Pe(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function ni(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function $e(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function ri(e){return{_$webjs:"watch",signal:e}}function Se(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var z=null,ie=!1,Fe=0,De=null,vn=0,Vr=(e,t)=>Object.is(e,t),Tt=()=>{},Kr=()=>!1;function Gr(e,t){e.liveConsumers||(e.liveConsumers=new Set);let n=e.liveConsumers.size===0;if(e.liveConsumers.add(t),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)Gr(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function ot(e,t){if(e.liveConsumers&&(e.liveConsumers.delete(t),e.liveConsumers.size===0)){if(e.producers&&e.producers.length>0)for(let n of e.producers)ot(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function Ln(e){if(ie)throw new Error("Signal read during notification phase");if(z===null)return;let t=z,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&jn(t)&&ot(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,jn(t)&&Gr(e,t)),t.producerLastReadVersions[n]=e.version}function jn(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Yr(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=ie;ie=!0;try{for(let n of e.liveConsumers)n.dirty||oi(n)}finally{ie=t}}function oi(e){e.dirty=!0,Yr(e),e.consumerMarkedDirty.call(e.wrapper||e)}function Nt(e){if(!(!e.dirty&&e.lastCleanEpoch===Fe)){if(!e.producerMustRecompute()&&!si(e)){e.dirty=!1,e.lastCleanEpoch=Fe;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=Fe}}function si(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(Nt(n),r!==n.version))return!0}return!1}function Rn(e){e&&(e.nextProducerIndex=0);let t=z;return z=e,t}function On(e,t){if(z=t,!!e){if(jn(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)ot(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var jt=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=Fe,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=Kr,this.producerRecomputeValue=Tt,this.consumerMarkedDirty=Tt,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||Vr,this.watched=n?.[Mn],this.unwatched=n?.[In]}get(){return Ln(this),this.__value}peek(){return this.__value}set(t){if(ie)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,Fe++,De!==null?Jr(this):Yr(this))}};function Jr(e){let t=ie;ie=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?De.add(n):Jr(n))}finally{ie=t}}var Tn=Symbol("unset"),Nn=Symbol("computing"),vt=Symbol("errored"),st=class{constructor(t,n){this.__fn=t,this.__value=Tn,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||Vr,this.watched=n?.[Mn],this.unwatched=n?.[In];let r=this;this.producerMustRecompute=function(){return r.__value===Tn||r.__value===Nn},this.producerRecomputeValue=function(){if(r.__value===Nn)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=Nn;let s=Rn(r),i,c=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=vt,r.__error=l,c=!0}finally{On(r,s)}if(!c&&(o!==Tn&&o!==vt)&&r.__equal.call(r.wrapper,o,i)){r.__value=o;return}r.__value=i,r.version++},this.consumerMarkedDirty=Tt}get(){if(Nt(this),Ln(this),this.__value===vt)throw this.__error;return this.__value}peek(){if(Nt(this),this.__value===vt)throw this.__error;return this.__value}},Rt=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=Fe,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=Kr,this.producerRecomputeValue=Tt,this.wrapper=this,this.__isWatcher=!0;let n=this;this.consumerMarkedDirty=function(){n.__fire()}}__fire(){this.__notify&&this.__notify.call(this)}watch(...t){if(t.length===0){this.dirty=!1;return}let n=Rn(this);try{for(let r of t)Ln(r),r.__isComputed&&Nt(r)}finally{On(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(ot(this.producers[n],this),this.producers.splice(n,1),this.producerLastReadVersions.splice(n,1),this.nextProducerIndex=Math.min(this.nextProducerIndex,this.producers.length))}getPending(){return this.producers.filter(t=>t.__isComputed&&t.dirty)}observe(t){let n=Rn(this),r;try{r=t()}finally{On(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)ot(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},Mn=Symbol("watched"),In=Symbol("unwatched");function ii(e){let t=z;z=null;try{return e()}finally{z=t}}function ai(e){return e.producers.slice()}function ci(e){return e.liveConsumers?[...e.liveConsumers]:[]}function li(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function ui(e){return e.producers.length>0}function fi(){return z&&z.__isComputed?z:null}function di(e){vn++,De===null&&(De=new Set);try{e()}finally{if(vn--,vn===0){let t=De;De=null;for(let n of t)n.__fire()}}}var it={State:jt,Computed:st,subtle:{Watcher:Rt,untrack:ii,introspectSources:ai,introspectSinks:ci,hasSinks:li,hasSources:ui,currentComputed:fi,watched:Mn,unwatched:In}};function pi(e,t){return new jt(e,t)}function hi(e,t){return new st(e,t)}function mi(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function bi(e){let t=!1,n=!1,r=new st(e),o=new Rt(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(s){console.error(s)}o.watch()}}))});o.watch(r);try{r.get()}catch(s){console.error(s)}return()=>{n||(n=!0,o.dispose())}}Ft();function So(e,t){let n=e&&e[R]?e:null;return n?Pt(n,t):t()}var wo=new WeakMap,Bt=Symbol.for("webjs.instance");function ze(e,t){let n=t,r=n[D];n[D]=!0;try{let o=n[Bt];if(P(e)){let s=e;if(o&&o.strings===s.strings){He(o,s.values);return}o&&_o(o,t);let i=t.firstChild;i&&i.nodeType===8&&i.data==="webjs-hydrate"&&i.remove(),n[Bt]=null;let c=Ii(s,t);n[Bt]=c;return}if(o&&_o(o,t),n[Bt]=null,t.replaceChildren(),e==null||e===!1||e===!0)return;if(Array.isArray(e)){for(let s of e){let i=document.createTextNode(String(s??""));t.appendChild(i)}return}t.appendChild(document.createTextNode(String(e)))}finally{n[D]=r,r||Jn(n)}}function Ut(e){let{strings:t}=e,n=wo.get(t);if(n)return n;let r=[],o="",s="text",i="",c=0,a="",l=0,f=null,u="",d="";for(let g=0;g<t.length;g++){let b=t[g];for(let m=0;m<b.length;m++){let h=b[m];switch(s){case"text":o+=h,h==="<"&&(s="tag-open");break;case"tag-open":o+=h,h==="!"?s="bang-1":h==="/"?(s="tag-name",u=""):/[a-zA-Z]/.test(h)?(s="tag-name",u=h.toLowerCase()):s="text";break;case"bang-1":o+=h,s=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=h,h==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=h,h==="-"?l+=1:(h===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=h,h===">"?(s=u==="script"||u==="style"?"rawtext":"text",s==="rawtext"&&(d="")):/\s/.test(h)?s="in-tag":u+=h.toLowerCase();break;case"in-tag":o+=h,h===">"?(s=u==="script"||u==="style"?"rawtext":"text",s==="rawtext"&&(d="")):!/\s/.test(h)&&h!=="/"&&(s="attr-name",i=h,c=o.length-1);break;case"rawtext":o+=h,d=(d+h.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(s="text",d="",u="");break;case"attr-name":h==="="?(s="after-eq",o+=h):/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h):(i+=h,o+=h);break;case"after-eq":h==='"'||h==="'"?(s="attr-quoted",a=h,o+=h):/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h):(s="attr-unquoted",o+=h);break;case"attr-unquoted":/\s/.test(h)?(s="in-tag",i="",o+=h):(h===">"&&(s="text",i=""),o+=h);break;case"attr-quoted":o+=h,h===a&&(s="in-tag",i="");break;case"skip-attr":if(h===a){if(f){let y=f.firstPartIdx,_=[];for(let E=y;E<r.length;E++)(r[E].kind==="noop"||r[E].kind==="attr-mixed")&&_.push(E);let w=[],C=t[_[0]],x=C.lastIndexOf(a);w.push(x>=0?C.slice(x+1):C);for(let E=1;E<_.length;E++)w.push(t[_[E]]);let k=t[_[_.length-1]+1],S=k.indexOf(a);w.push(S>=0?k.slice(0,S):k),r[y]={kind:"attr-mixed",path:[],name:f.name,statics:w,group:_};for(let E=1;E<_.length;E++)r[_[E]]={kind:"noop",path:[],mixedAnchor:y};f=null}s="in-tag",i=""}break}}if(g<t.length-1){let m=r.length;if(s==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(s==="rawtext"){d="",r.push({kind:"noop",path:[]});continue}if(s==="text")o+=`<!--${L}${m}-->`,r.push({kind:"child",path:[]});else if(s==="in-tag"){let h=`data-${L}${m}`;o+=`${h}=""`,r.push({kind:"element",path:[]})}else if(s==="after-eq"){let h=i[0],y=i.slice(1);if(Hr(h)){o=o.slice(0,c);let _=Oe[h],w=`data-${L}${m}`;o+=`${w}=""`,r.push({kind:_,path:[],name:y})}else{o=o.slice(0,c);let _=`data-${L}${m}`;o+=`${_}=""`,r.push({kind:"attr",path:[],name:i})}s="in-tag",i=""}else if(s==="attr-quoted"||s==="attr-unquoted"){o=o.slice(0,c);let h=`data-${L}${m}`;o+=`${h}=""`,f={name:i,firstPartIdx:m},r.push({kind:"noop",path:[]}),s="skip-attr"}else s==="skip-attr"&&r.push({kind:"noop",path:[]})}}let p=document.createElement("template");return p.innerHTML=o,Li(p.content,r),Mi(p.content,r),n={templateEl:p,parts:r},wo.set(t,n),n}function Li(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(M,"");let o=t.length;r.setAttribute(`data-${L}${o}`,""),t.push({kind:"slot",path:[]})}}function Mi(e,t){let n=[];function r(o){for(let s=0;s<o.childNodes.length;s++){let i=o.childNodes[s];if(n.push(s),i.nodeType===8){let c=i.data;if(c.startsWith(L)){let a=Number(c.slice(L.length));t[a]&&t[a].kind==="child"&&(t[a].path=n.slice())}}else if(i.nodeType===1){let c=i,a=[];for(let l of c.attributes)if(l.name.startsWith(`data-${L}`)){let f=Number(l.name.slice(`data-${L}`.length));t[f]&&t[f].kind!=="child"&&(t[f].path=n.slice()),a.push(l.name)}for(let l of a)c.removeAttribute(l);r(i)}n.pop()}}r(e)}function Ii(e,t){let{templateEl:n,parts:r}=Ut(e),o=n.content.cloneNode(!0),s=document.createComment(`${L}s`),i=document.createComment(`${L}e`),c=r.map(f=>Ht(f,o)),a=[];for(let f=0;f<e.values.length;f++)Y(c[f],e.values[f],void 0,e.values),a.push(e.values[f]);t.replaceChildren(s,...o.childNodes,i);let l=t.nodeType===1&&t[R]?t:null;for(let f of c)f.kind==="slot"&&(l&&f.slotEl&&(f.slotEl[It]=l),Y(f,void 0,void 0,[]));return{strings:e.strings,bound:c,lastValues:a,startNode:s,endNode:i}}function Ht(e,t){if(e.kind==="noop")return{kind:"noop",mixedAnchor:e.mixedAnchor};let n=t;for(let o of e.path)n=n.childNodes[o];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let o={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(s){o.handler?.(s)}};return r.addEventListener(o.name,o.dispatcher),o}if(e.kind==="attr")return{kind:"attr",el:r,name:e.name||""};if(e.kind==="attr-mixed")return{kind:"attr-mixed",el:r,name:e.name||"",statics:e.statics||[],group:e.group||[]};if(e.kind==="prop")return{kind:"prop",el:r,name:e.name||""};if(e.kind==="bool")return{kind:"bool",el:r,name:e.name||""};if(e.kind==="element")return{kind:"element",el:r};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}function He(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(Object.is(r,e.lastValues[n]))continue;let o=e.bound[n],s=o.mixedAnchor;o.kind==="noop"&&s!=null?Y(e.bound[s],t[s],e.lastValues[s],t):Y(o,r,e.lastValues[n],t),e.lastValues[n]=r}}function _o(e,t){for(let n of e.bound){if(n.kind==="event"&&n.el.removeEventListener(n.name,n.dispatcher),n.kind==="element"){let r=n.lastTarget;if(r){if(typeof r=="function")try{r(void 0)}catch{}else typeof r=="object"&&(r.value=void 0);n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=lt(n.slotEl);r&&yo(r,n.slotEl)}}t.replaceChildren()}function Y(e,t,n,r){if(Me(t)){let o=t.value;if(e.kind==="prop"&&e.el[e.name]===o||e.kind==="attr"&&e.el.getAttribute(e.name)===String(o)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!o)return;t=o}switch(e.kind){case"child":Di(e,t);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):e.el.setAttribute(e.name,String(t));break}case"prop":e.el[e.name]=t;break;case"bool":t?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":e.handler=typeof t=="function"?t:null;break;case"element":$i(e,t);break;case"attr-mixed":{let o=e,s=o.statics[0];for(let i=0;i<o.group.length;i++)s+=String((r?r[o.group[i]]:t)??""),s+=o.statics[i+1]||"";e.el.setAttribute(e.name,s);break}case"slot":{if(e.applied)break;let o=e.slotEl,s=()=>{let c=lt(o);if(!c){e.applied=!0;return}if(!c.contains(o)){c.isConnected?queueMicrotask(s):e.applied=!0;return}if(e.applied=!0,Pi(o))return;let a=document.createDocumentFragment();for(;o.firstChild;)a.appendChild(o.firstChild);o[ct]=a,queueMicrotask(()=>te(c))},i=lt(o);i&&i.contains(o)?s():queueMicrotask(s);break}case"noop":break}}function lt(e){let t=e[It];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[R])return n;n=n.parentElement}return null}function Pi(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 $i(e,t){let n=e,r=ye(t)?t.target:void 0,o=n.__refTarget,s=r!==o;if(s&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(s||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!s&&n.__refElement!==void 0)try{r(void 0)}catch{}try{r(e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function Di(e,t){return Gi(e,t),G(e,t)}function G(e,t){return So(e.marker&&e.marker.parentNode,()=>Fi(e,t))}function Fi(e,t){let n=e.marker;if(Le(t)){le(e);let o=String(t.value??""),s=document.createElement("template");s.innerHTML=o;let i=[...s.content.childNodes],c=document.createDocumentFragment();for(let a of i)c.appendChild(a);n.parentNode?.insertBefore(c,n),e.child=i;return}if(be(t)){let o=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,o.key)&&le(e),e.__keyedKey=o.key,G(e,o.value);return}if(ge(t)){let o=t,s=e.__guardDeps,i=o.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(i)?Ki(s,i):Object.is(s,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,G(e,o.fn());return}if(Ie(t)){le(e);let o=t.template;if(o&&o.content){let s=o.content.cloneNode(!0),i=[...s.childNodes];n.parentNode?.insertBefore(s,n),e.child=i}return}if(ye(t))return;if(we(t))return Yi(e,t.value);if(_e(t))return Ji(e,t.args);if(Se(t))return Xi(e,t.signal);if(Pe(t))return Zi(e,t);if($e(t))return Qi(e,t);if(me(t)){if(e.child&&e.child.kind==="repeat"){Ui(e,t);return}le(e);let o={kind:"repeat",map:new Map};e.child=o,qi(n,o,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){zi(e,t);return}le(e);let o={kind:"array",items:[]};e.child=o,Wi(n,o,t);return}if(e.child){let o=e.child;if(o.kind==="repeat")Ao(o),e.child=void 0;else if(o.kind==="array")xo(o),e.child=void 0;else if(o.kind==="async-stream")To(o),e.child=void 0;else if("strings"in e.child){let s=e.child;if(P(t)&&s.strings===t.strings){He(s,t.values);return}We(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 o=t,{templateEl:s,parts:i}=Ut(o),c=s.content.cloneNode(!0),a=document.createComment(`${L}s`),l=document.createComment(`${L}e`),f=i.map(p=>Ht(p,c)),u=[];for(let p=0;p<o.values.length;p++)Y(f[p],o.values[p],void 0,o.values),u.push(o.values[p]);let d=[a,...c.childNodes,l];n.parentNode?.insertBefore(Bi(d),n);for(let p of f)p.kind==="slot"&&Y(p,void 0,void 0,[]);e.child={strings:o.strings,bound:f,lastValues:u,startNode:a,endNode:l};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function Bi(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function We(e,t){if(!e.parentNode)return;let n=e;for(;n&&n!==t;){let r=n.nextSibling;n.parentNode?.removeChild(n),n=r}t.parentNode===e.parentNode&&t.parentNode?.removeChild(t)}function Zn(e){let{templateEl:t,parts:n}=Ut(e),r=t.content.cloneNode(!0),o=document.createComment(`${L}s`),s=document.createComment(`${L}e`),i=n.map(l=>Ht(l,r)),c=[];for(let l=0;l<e.values.length;l++)Y(i[l],e.values[l],void 0,e.values),c.push(e.values[l]);for(let l of i)l.kind==="slot"&&Y(l,void 0,void 0,[]);let a=document.createDocumentFragment();for(a.appendChild(o);r.firstChild;)a.appendChild(r.firstChild);return a.appendChild(s),{inst:{strings:e.strings,bound:i,lastValues:c,startNode:o,endNode:s},frag:a}}function ut(e){for(let t of e.bound)if(t.kind==="event"&&t.el.removeEventListener(t.name,t.dispatcher),t.kind==="element"){let n=t.lastTarget;if(n){if(typeof n=="function")try{n(void 0)}catch{}else typeof n=="object"&&(n.value=void 0);t.lastTarget=void 0,t.__lastEl=void 0}}}function qi(e,t,n){let{items:r,keyFn:o,templateFn:s}=n,i=e.parentNode;if(!i)return;let c=document.createDocumentFragment();for(let a=0;a<r.length;a++){let l=o(r[a],a),f=s(r[a],a);if(!P(f))continue;let{inst:u,frag:d}=Zn(f);t.map.set(l,u),c.appendChild(d)}i.insertBefore(c,e)}function Ui(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,{items:s,keyFn:i,templateFn:c}=t,a=new Map;for(let l=0;l<s.length;l++){let f=i(s[l],l),u=c(s[l],l);if(!P(u))continue;let d=o.map.get(f);if(d&&d.strings===u.strings)He(d,u.values),Xn(d.startNode,d.endNode,r,n),a.set(f,d),o.map.delete(f);else{d&&(ut(d),We(d.startNode,d.endNode),o.map.delete(f));let{inst:p,frag:g}=Zn(u);r.insertBefore(g,n),a.set(f,p)}}for(let l of o.map.values())ut(l),We(l.startNode,l.endNode);o.map=a}function Ao(e){for(let t of e.map.values())ut(t),We(t.startNode,t.endNode);e.map.clear()}function Hi(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function qt(e){e.type==="tpl"?(ut(e.inst),We(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Eo(e){if(P(e)){let{inst:t,frag:n}=Zn(e);return{item:{type:"tpl",inst:t},frag:n}}if(e!=null&&e!==!1&&e!==!0){let t=document.createTextNode(String(e));return{item:{type:"text",node:t},frag:t}}return{item:{type:"empty"},frag:null}}function Wi(e,t,n){let r=e.parentNode;if(!r)return;let o=document.createDocumentFragment(),s=[];for(let i of n){let{item:c,frag:a}=Eo(i);a&&o.appendChild(a),s.push(c)}r.insertBefore(o,e),t.items=s}function zi(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,s=o.items,i=[];for(let c=0;c<t.length;c++){let a=t[c],l=s[c];if(P(a)){let d=a;if(l&&l.type==="tpl"&&l.inst.strings===d.strings){He(l.inst,d.values),i.push(l);continue}}else if(a!=null&&a!==!1&&a!==!0){if(l&&l.type==="text"){let d=String(a);l.node.data!==d&&(l.node.data=d),i.push(l);continue}}else{l&&qt(l),i.push({type:"empty"});continue}let{item:f,frag:u}=Eo(a);u&&r.insertBefore(u,Vi(s,c,n)),l&&qt(l),i.push(f)}for(let c=t.length;c<s.length;c++)qt(s[c]);o.items=i}function Vi(e,t,n){for(let r=t;r<e.length;r++){let o=Hi(e[r]);if(o&&o.parentNode)return o}return n}function xo(e){for(let t of e.items)qt(t);e.items=[]}function Xn(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),s=e;for(;s;){let i=s.nextSibling;if(o.appendChild(s),s===t)break;s=i}n.insertBefore(o,r)}function Ki(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&&Co(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Ao(n);else if(n.kind==="array")xo(n);else if(n.kind==="async-stream")To(n);else if("strings"in n){let r=e.child;ut(r),We(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Gi(e,t){let n=e;n.__untilState&&!_e(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!ge(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!we(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!be(t)&&(n.__keyedKey=void 0),n.__watchSub&&!Se(t)&&Co(n)}function Yi(e,t){let n=e.marker,r=e,o=r.__cacheMap;o||(o=new Map,r.__cacheMap=o);let s=e.child;if(s&&"strings"in s){let c=s;if(P(t)&&c.strings===t.strings){He(c,t.values);return}let a=document.createDocumentFragment();Xn(c.startNode,c.endNode,a,null),o.set(c.strings,{inst:c,holder:a}),e.child=void 0}if(P(t)){let c=t,a=o.get(c.strings);if(a){o.delete(c.strings),e.child&&le(e),Xn(a.inst.startNode,a.inst.endNode,n.parentNode,n),He(a.inst,c.values),e.child=a.inst;let l=new Set;for(let f=a.inst.startNode.nextSibling;f&&f!==a.inst.endNode;f=f.nextSibling){if(f.nodeType!==1)continue;let u=f;if(u.matches("slot[data-webjs-light]")){let d=lt(u);d&&l.add(d)}for(let d of u.querySelectorAll("slot[data-webjs-light]")){let p=lt(d);p&&l.add(p)}}for(let f of l)te(f);return}}G(e,t)}function Ji(e,t){let n=e,r=n.__untilState,o=n.__untilArgs,s=(d,p)=>!!(Object.is(d,p)||P(d)&&P(p)&&d.strings===p.strings),c=o&&o.length===t.length&&o.every((d,p)=>s(d,t[p]))&&r?r.highestResolved:1/0;r&&(r.aborted=!0),n.__untilArgs=t.slice();let a={aborted:!1,highestResolved:c};n.__untilState=a;let l=-1,f;for(let d=0;d<t.length;d++){let p=t[d];if(!p||typeof p.then!="function"){l=d,f=p;break}}l!==-1&&l<=a.highestResolved?(G(e,f),a.highestResolved=l):l===-1&&!n.__untilEverRendered&&G(e,""),n.__untilEverRendered=!0;let u=Math.min(l===-1?t.length:l,a.highestResolved);for(let d=0;d<u;d++){let p=t[d];!p||typeof p.then!="function"||Promise.resolve(p).then(g=>{a.aborted||d>=a.highestResolved||(a.highestResolved=d,G(e,g))},()=>{})}}function Xi(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let s;n.__watchSub.observe(()=>{s=t.get()}),G(e,s);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new it.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let s;r.observe(()=>{s=t.get()}),G(e,s)})});n.__watchSub=r;let o;r.observe(()=>{o=t.get()}),G(e,o)}function Co(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Zi(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;le(e);let r=t.iterable[Symbol.asyncIterator](),o={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=o,ko(o,e,t)}function Qi(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;le(e);let r=t.iterable[Symbol.asyncIterator](),o={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=o,ko(o,e,t)}async function ko(e,t,n){let r=t.marker,o=0;try{for(;!e.aborted;){let s=await e.iterator.next();if(e.aborted||s.done)break;let i=n.mapper?n.mapper(s.value,o):s.value,c=vo(i);So(r.parentNode,()=>{if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let a=document.createDocumentFragment();for(let l of c)a.appendChild(l);r.parentNode?.insertBefore(a,r),e.nodes.push(...c)}),o++}}catch(s){typeof console<"u"&&console.error("[webjs] asyncStream error:",s)}}function vo(e){if(e==null||e===!1||e===!0)return[];if(P(e)){let t=e,{templateEl:n,parts:r}=Ut(t),o=n.content.cloneNode(!0),s=r.map(i=>Ht(i,o));for(let i=0;i<t.values.length;i++)Y(s[i],t.values[i],void 0,t.values);for(let i of s)i.kind==="slot"&&Y(i,void 0,void 0,[]);return[...o.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...vo(n));return t}return[document.createTextNode(String(e))]}function To(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}var No=null;function Wt(e){No=e||null}function ea(){return No||void 0}var jo=Symbol.for("webjs:registry"),Ro=Symbol.for("webjs:classToTag"),zt=globalThis,J=zt[jo]||(zt[jo]=new Map),Oo=zt[Ro]||(zt[Ro]=new WeakMap),Vt=typeof window<"u"&&typeof customElements<"u";function Qn(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=J.get(e);r?(r.cls=t,r.lazy=n):J.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),Oo.set(t,e)}if(Vt){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),Qn(t,n)}}if(!Vt){let e=globalThis;e.customElements||(e.customElements={define(t,n){Qn(t,n)},get(t){return J.get(t)?.cls},upgrade(){},whenDefined(t){let n=J.get(t);return Promise.resolve(n?.cls)}})}function er(e,t){Vt?customElements.define(e,t):Qn(e,t)}function ta(e,t){if(Vt)return;let n=J.get(e);if(n){n.moduleUrl=t;return}J.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function tr(e){return J.get(e)?.cls}function na(e){return J.get(e)?.moduleUrl||null}function ra(e){return J.get(e)?.lazy===!0}function Kt(e){return Oo.get(e)}function nr(){return[...J.keys()]}Ve();Ft();var Fo=typeof window<"u"&&typeof HTMLElement<"u";function ba(e,t){return e!==t}function ga(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var Gt=class{constructor(){this.__ssrAttrs=new Map,this.__internals=null}get attributes(){return[...this.__ssrAttrs].map(([t,n])=>({name:t,value:n}))}getAttribute(t){let n=this.__ssrAttrs.get(String(t).toLowerCase());return n===void 0?null:n}setAttribute(t,n){this.__ssrAttrs.set(String(t).toLowerCase(),String(n))}removeAttribute(t){this.__ssrAttrs.delete(String(t).toLowerCase())}hasAttribute(t){return this.__ssrAttrs.has(String(t).toLowerCase())}toggleAttribute(t,n){let r=String(t).toLowerCase(),o=this.__ssrAttrs.has(r);return(n===void 0?!o:n)?(this.__ssrAttrs.set(r,""),!0):(this.__ssrAttrs.delete(r),!1)}getAttributeNames(){return[...this.__ssrAttrs.keys()]}closest(t){let n=String(t).trim().toLowerCase();if(!/^[a-z][a-z0-9-]*$/.test(n))return null;if(this.__ssrTag===n)return this;let r=this.__ssrAncestors;if(!Array.isArray(r))return null;for(let o=r.length-1;o>=0;o--)if(r[o]&&r[o].__ssrTag===n)return r[o];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,o=>"-"+o.toLowerCase());return this.__dataset=new Proxy({},{get(r,o){if(typeof o!="string")return;let s=t.getAttribute(n(o));return s===null?void 0:s},set(r,o,s){return typeof o=="string"&&t.setAttribute(n(o),s),!0},has(r,o){return typeof o=="string"&&t.hasAttribute(n(o))},deleteProperty(r,o){return typeof o=="string"&&t.removeAttribute(n(o)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(o,s)=>s.toUpperCase()))},getOwnPropertyDescriptor(r,o){if(typeof o=="string"&&t.hasAttribute(n(o)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(o))}}}),this.__dataset}get className(){return this.getAttribute("class")??""}set className(t){this.setAttribute("class",t)}get hidden(){return this.hasAttribute("hidden")}set hidden(t){this.toggleAttribute("hidden",!!t)}get id(){return this.getAttribute("id")??""}set id(t){this.setAttribute("id",t)}get title(){return this.getAttribute("title")??""}set title(t){this.setAttribute("title",t)}get slot(){return this.getAttribute("slot")??""}set slot(t){this.setAttribute("slot",t)}get role(){return this.getAttribute("role")}set role(t){t==null?this.removeAttribute("role"):this.setAttribute("role",t)}get tabIndex(){let t=this.getAttribute("tabindex");return t===null?-1:Number.parseInt(t,10)||0}set tabIndex(t){this.setAttribute("tabindex",String(t))}addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return this.__internals=ga(),this.__internals}},ya=["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 ya){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(Gt.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var wa=Fo?HTMLElement:Gt,Bo=Symbol("webjs.factoryProps"),$o=new WeakSet,Ke=class e extends wa{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){er(t,this)}static get observedAttributes(){let t=this.properties||{};return Object.keys(t).filter(n=>!(typeof t[n]=="object"&&t[n].state)).map(n=>typeof t[n]=="object"&&t[n].attribute||rr(n))}constructor(){super(),this._renderRoot=null,this._scheduled=!1,this._connected=!1,this.__controllers=new Set,this.__firstRendered=!1,this._changedProperties=new Map,this._updateResolve=null,this._updatePromise=Promise.resolve(!0),this._isUpdating=!1,this._assertFactoryProperties(),this._initializeProperties()}_assertFactoryProperties(){let t=this.constructor;if($o.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,Bo)){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)}$o.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,o]of Object.entries(n)){let s=typeof o=="object"?o:{type:o},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:c=>{let a=this.__propValues[r];(s.hasChanged||ba)(c,a)&&(this.__propValues[r]=c,s.reflect&&!s.state&&this._connected&&this._reflectAttribute(r,c,s),this.requestUpdate(r,a))}}),i!==void 0?this.__propValues[r]=i:s.default!==void 0&&(this.__propValues[r]=typeof s.default=="function"?s.default():s.default)}}}_reflectAttribute(t,n,r){let o=r.attribute||rr(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let s=r.converter.toAttribute(n,r.type);s==null?this.removeAttribute(o):this.setAttribute(o,s)}else r.type===Boolean?n?this.setAttribute(o,""):this.removeAttribute(o):n==null?this.removeAttribute(o):r.type===Object||r.type===Array?this.setAttribute(o,JSON.stringify(n)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!Fo)return;if(this.__webjsPropsHydrated||(this.__webjsPropsHydrated=!0,this._hydratePropAttrs()),this.constructor.hydrate==="visible"&&typeof IntersectionObserver<"u"&&!this.__hydrationActivated){this.__hydrationActivated=!1,this.__hydrationObserver=new IntersectionObserver(n=>{for(let r of n)if(r.isIntersecting){this.__hydrationObserver.unobserve(this),this.__hydrationObserver.disconnect(),this.__hydrationObserver=null,this.__hydrationActivated=!0,this._activate();return}},{rootMargin:"200px"}),this.__hydrationObserver.observe(this);return}this._activate()}_hydratePropAttrs(){let t=[],n=this.attributes;for(let r=0;r<n.length;r++){let o=n[r].name;o.startsWith("data-webjs-prop-")&&t.push(o)}for(let r of t){let o=this.getAttribute(r);if(this.removeAttribute(r),o==null)continue;let s=Do(r.slice(16));try{this[s]=ne(o)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow!==!0&&!this.hasAttribute("data-wj-host")&&this.setAttribute("data-wj-host",""),t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,o=Array.isArray(r)?r:Re(r)?[r]:[];if(o.length){if(n){let s=this.shadowRoot.querySelector("style");s&&s.remove()}Cn(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${Kt(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().`),Yn(this)?po(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||go(this)?(this.removeAttribute("data-wj-serialized"),ee(this),ro(this)):no(this),bo(this),lo(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 s=this.constructor.properties||{},i,c;for(let[f,u]of Object.entries(s))if(((typeof u=="object"?u:{type:u}).attribute||rr(f))===t){i=f,c=u;break}if(c===void 0&&(i=Do(t),c=s[i]||s[t]),c===void 0)return;let a=typeof c=="object"?c:{type:c},l;if(a.converter&&a.converter.fromAttribute)l=a.converter.fromAttribute(r,a.type);else if(a.type===Number)l=r==null?null:Number(r);else if(a.type===Boolean)l=r!=null&&r!=="false";else if(a.type===Object||a.type===Array)try{l=r==null?null:JSON.parse(r)}catch{l=r}else l=r;this[i]!==l&&(this[i]=l,this._connected&&this.requestUpdate())}requestUpdate(t,n){t!==void 0&&!this._changedProperties.has(t)&&this._changedProperties.set(t,n),this._scheduleUpdate()}_scheduleUpdate(){this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),!this._isUpdating&&(this._scheduled||!this._connected||(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(t){console.error("[webjs] lifecycle hook threw during update cycle:",t)}})))}_performRender(){if(!this._renderRoot)return;let t=this._changedProperties;this._isUpdating=!0;let n=!1,r=null;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let 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,Wt(this.__renderAbort?this.__renderAbort.signal:null);try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}finally{Wt(null)}if(!r){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();n=!0}}}catch(o){console.error("[webjs] lifecycle hook threw during update phase:",o)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let o=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1,r.then(()=>{if(this.__pendingAsyncCommits--,o===this.__renderToken){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();this._postCommit(t)}});return}n?this._postCommit(t):this.__pendingAsyncCommits||this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers)n.hostUpdate&&n.hostUpdate();this._reflectDeclaredAttributes()}finally{this._isUpdating=!1}}_reflectDeclaredAttributes(){let t=this.constructor.properties||{};for(let n of Object.keys(t)){let r=t[n];!r||!r.reflect||r.state||this._reflectAttribute(n,this[n],r)}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new it.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);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=>{n===this.__renderToken&&ze(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==Yt.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${Kt(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 rr(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Do(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Yt(e){return new.target?Reflect.construct(Ke,arguments,new.target):class extends Ke{static properties=e;static[Bo]=!0}}Object.setPrototypeOf(Yt,Ke);Yt.prototype=Ke.prototype;function _a(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var Hl=Symbol.for("webjs.suspense");function Sa(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function Jt(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}Ve();var or=null;function Aa(e){or=e}function sr(){if(!or)return"";try{return or()||""}catch{return""}}async function Ea(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;n&&n.dev===void 0&&r!==void 0&&(n.dev=r);let o=await O(e,n);return t&&t.ssr===!1?o:await fe(o,n,[],r)}async function O(e,t){if(e==null||e===!1||e===!0)return"";if(e&&typeof e.then=="function")return e=await e,O(e,t);if(Le(e))return String(e.value??"");if(Me(e))return O(e.value,t);if(Se(e))return O(e.signal.get(),t);if(be(e))return O(e.value,t);if(ge(e))return O(e.fn(),t);if(Ie(e)){let n=e.template;return String(n?.innerHTML??"")}if(ye(e))return"";if(we(e))return O(e.value,t);if(_e(e)){let n=e.args;for(let r of n)if(!r||typeof r.then!="function")return O(r,t);if(n.length>0)try{let r=await Promise.race(n.map(o=>Promise.resolve(o).catch(()=>{})));return O(r,t)}catch{return""}return""}if(Pe(e)||$e(e))return"";if(Array.isArray(e))return(await Promise.all(e.map(r=>O(r,t)))).join("");if(me(e)){let n=e;return(await Promise.all(n.items.map((o,s)=>O(n.templateFn(o,s),t)))).join("")}if(Jt(e)){let n=e,r=await O(n.fallback,t);if(t){let o=`s${t.nextId++}`;return t.pending.push({id:o,promise:Promise.resolve(n.children)}),`<webjs-boundary id="${o}">${r}</webjs-boundary>`}return r}return P(e)?xa(e,t):kt(String(e))}async function xa(e,t){let{strings:n,values:r}=e,o="",s="text",i="",c=0,a="",l=0,f="",u="";for(let d=0;d<n.length;d++){let p=n[d];for(let g=0;g<p.length;g++){let b=p[g];switch(s){case"text":o+=b,b==="<"&&(s="tag-open");break;case"tag-open":o+=b,b==="!"?s="bang-1":b==="/"?(s="tag-name",f=""):/[a-zA-Z]/.test(b)?(s="tag-name",f=b.toLowerCase()):s="text";break;case"bang-1":o+=b,s=b==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=b,b==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=b,b==="-"?l+=1:(b===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=b,b===">"?(s=Xt(f)?"rawtext":"text",s==="rawtext"&&(u="")):/\s/.test(b)?s="in-tag":f+=b.toLowerCase();break;case"in-tag":o+=b,b===">"?(s=Xt(f)?"rawtext":"text",s==="rawtext"&&(u="")):!/\s/.test(b)&&b!=="/"&&(s="attr-name",i=b,c=o.length-1);break;case"rawtext":o+=b,u=(u+b.toLowerCase()).slice(-9),(u.endsWith("<\/script>")||u.endsWith("</style>"))&&(s="text",u="",f="");break;case"attr-name":b==="="?(s="after-eq",o+=b):/\s/.test(b)?(s="in-tag",i="",o+=b):b===">"?(s="text",i="",o+=b):(i+=b,o+=b);break;case"after-eq":b==='"'||b==="'"?(s="attr-quoted",a=b,o+=b):/\s/.test(b)?(s="in-tag",i="",o+=b):b===">"?(s="text",i="",o+=b):(s="attr-unquoted",o+=b);break;case"attr-unquoted":/\s/.test(b)?(s="in-tag",i="",o+=b):(b===">"&&(s="text",i=""),o+=b);break;case"attr-quoted":o+=b,b===a&&(s="in-tag",i="");break}}if(d<r.length){let g=r[d];if(g&&typeof g.then=="function"&&(g=await g),s==="comment")o+=String(g??""),l=0;else if(s==="rawtext")o+=String(g??""),u="";else if(s==="text")o+=await O(g,t);else if(s==="after-eq"){let b=i[0],m=i.slice(1),h=Oe[b];if(h==="event")o=o.slice(0,c),s="in-tag",i="";else if(h==="prop"){if(o=o.slice(0,c),f==="webjs-suspense"&&m==="fallback"){let y=await O(g,t);o+=`data-webjs-fallback="${H(y)}"`,s="in-tag",i="";continue}if(!f.includes("-")){s="in-tag",i="";continue}if(g===void 0){s="in-tag",i="";continue}try{let y=await pt(g);o+=`data-webjs-prop-${Fa(m)}="${H(y)}"`}catch(y){console.warn(`[webjs] property binding .${m} has an unserializable value during SSR. Dropping. The browser will see the property as undefined. Detail: ${y&&y.message}`)}s="in-tag",i=""}else h==="bool"?(o=o.slice(0,c),g&&(o+=`${m}=""`),s="in-tag",i=""):(o+=`"${H(String(g??""))}"`,s="in-tag",i="")}else(s==="attr-quoted"||s==="attr-unquoted")&&(o+=H(String(g??"")))}}return o}var Ca=new Set(["document","window","localStorage","sessionStorage","navigator","matchMedia","requestAnimationFrame","getComputedStyle","IntersectionObserver","MutationObserver","ResizeObserver"]),ka=new Set(["attachShadow","querySelector","querySelectorAll","getBoundingClientRect","focus","blur","scrollIntoView"]);function va(e){let t=e&&typeof e.message=="string"?e.message:"",n=/^(\w+) is not defined\b/.exec(t);return e instanceof ReferenceError&&n&&Ca.has(n[1])?`\`${n[1]}\` is a browser-only global and is undefined during SSR.`:(n=/\.(\w+) is not a function\b/.exec(t),e instanceof TypeError&&n&&ka.has(n[1])?`\`${n[1]}\` is an HTMLElement method that does not exist on the server-side component instance during SSR.`:null)}function Ta(){return typeof process<"u"&&process.env&&!0}function Wo(e,t,n){if(!(n===void 0?!Ta():!!n))return"";let o=t&&t.message?t.message:String(t);return xn`<div data-webjs-error="${e}" style="border:1px solid #f5c2c7;background:#f8d7da;color:#842029;padding:8px 12px;border-radius:6px;font:13px/1.4 system-ui,sans-serif">
|
|
1
|
+
var Ji=Object.defineProperty;var se=(e,t)=>()=>(e&&(t=e(e=0)),t);var Po=(e,t)=>{for(var n in t)Ji(e,n,{get:t[n],enumerable:!0})};function ns(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function Oa(){if(Zo||(be=ns(),!be))return;Rt=HTMLSlotElement.prototype.assignedNodes,wr=HTMLSlotElement.prototype.assignedElements,cn=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(D)&&!Sr(this)?Cr(this,n):Rt?Rt.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(D)&&!Sr(this)?Cr(this,n).filter(r=>r.nodeType===1):wr?wr.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=cn&&cn.get?cn.get.call(this):null;return n||Qo(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||Qo(this)}}),_r=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(D)&&!Sr(this)){let r=$a(this);if(r){let o=ce(r);o.manualAssign||(o.manualAssign=new Map);let s=n.filter(Boolean);for(let[i,a]of o.manualAssign){if(i===this)continue;let c=a.filter(l=>{let f=l.deref();return f!==void 0&&s.indexOf(f)===-1});c.length!==a.length&&(c.length?o.manualAssign.set(i,c):o.manualAssign.delete(i))}if(s.length?o.manualAssign.set(this,s.map(i=>new WeakRef(i))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let i of s)o.pendingRecordNodes.add(i);else o.pendingRecordNodes=new Set(s);rt(o),le(r)}return}return _r?_r.apply(this,n):void 0},Zo=!0}function Rr(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let s=!1,i=o.filter(a=>{let c=a.deref();return c===void 0?!1:(c===t&&(s=!0),!0)});if(i.length!==o.length&&(i.length?n.set(r,i):n.delete(r)),s){let a=e.host;return a&&(r===a||a.contains(r))?r:null}}return null}function $a(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[P])return ae(t,e)?t:null;return null}function Sr(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 Cr(e,t){if(e.getAttribute(z)!==ee)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:kr(n,new Set,0)}function kr(e,t,n){if(n>=La)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let s=o;if(t.has(s))continue;if(t.add(s),s.hasAttribute(D)){let i=Cr(s,{flatten:!1});if(i.length>0)for(let a of kr(i,t,n+1))r.push(a);else for(let a of kr(Array.from(s.childNodes),t,n+1))r.push(a)}else if(Rt){let i=Rt.call(s,{flatten:!0});for(let a of i)r.push(a)}else r.push(o)}else r.push(o);return r}function Qo(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(D)&&t.getAttribute(z)===ee?t:null}function ce(e){let t=e,n=t[P];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[P]=n),n}function Lr(e){return!!e[P]}function rs(e){let t=ce(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),L.add(n),e.removeChild(n)}rt(t)}function rt(e){let t=e.assignedByName;t.clear();for(let n of e.authored)Ia(t,Le(e,n),n)}function Le(e,t){let n=Rr(e,t);if(n)return Z(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return ss(t)}function os(e){let t=ce(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${D}]`);for(let o of r){let s=o;if(!ae(e,s)||s.getAttribute(z)!==ee||hn(t,e,s))continue;let i=Z(s.getAttribute("name"));if(!n.has(i)){n.add(i);let a=Array.from(s.childNodes);for(let c of a)t.authored.push(c),ss(c)!==i&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(c,i));t.lastSnapshot.set(s,a.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if(ae(e,o)){for(let s of Array.from(o.childNodes))L.add(s),t.authored.push(s);o.remove()}rt(t)}function Z(e){return e==null||e===""||e==="default"?null:e}function ss(e){return e.nodeType!==1?null:Z(e.getAttribute("slot"))}function Ia(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function Ie(e,t,n){let r=ce(e),o=Z(t),s=Array.isArray(n)?n.filter(Boolean):n?[n]:[],i=r.authored.findIndex(c=>Le(r,c)===o),a=r.authored.filter(c=>Le(r,c)===o);r.authored=r.authored.filter(c=>Le(r,c)!==o),(i===-1||i>r.authored.length)&&(i=r.authored.length);for(let c of s)c.nodeType===1&&!Rr(r,c)&&(o==null?c.removeAttribute("slot"):c.setAttribute("slot",o)),L.add(c);if(r.authored.splice(i,0,...s),r.applying&&r.pendingRecordNodes){for(let c of a)r.pendingRecordNodes.add(c);for(let c of s)r.pendingRecordNodes.add(c)}else r.pendingRecordNodes=new Set([...a,...s]);if(r.adoptedKey){for(let c of a)r.adoptedKey.delete(c);for(let c of s)r.adoptedKey.delete(c)}rt(r),le(e)}function Pa(){me||!be||(me=Node.prototype.appendChild,is=Node.prototype.insertBefore,nt=Node.prototype.removeChild,Nr=Node.prototype.replaceChild,as=Element.prototype.append,cs=Element.prototype.prepend,ls=Element.prototype.replaceChildren,ln=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),Tr=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function dn(e,t){let n=e[U];e[U]=!0;try{return t()}finally{e[U]=n,n||Or(e)}}function us(e){if(!be)return;let t=e,n=ce(e);n.backstop||(n.backstop=new MutationObserver(r=>pn(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>fs(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function pn(e,t,n){let r=e,o=r[$e],s=r[Symbol.for("webjs.instance")],i=!1,a=new Set;for(let c of n){for(let l of c.addedNodes)if(a.add(l),l!==o&&!(s&&hs(s,l))){if(t.authored.indexOf(l)!==-1){i=!0;continue}L.add(l),t.authored.push(l),i=!0}for(let l of c.removedNodes){let f=t.authored.indexOf(l);if(f===-1||e.contains(l))continue;L.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(f,1),i=!0)}}i&&le(e)}function Or(e){let t=e,n=t[P];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&pn(e,n,r)}function fs(e,t){let n=e[P];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let s=o.target;o.attributeName==="name"?s.tagName==="SLOT"&&s.hasAttribute(D)&&ae(e,s)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(s),n.authored.indexOf(s)!==-1&&(r=!0))}r&&le(e)}function ds(e){let t=e[P];t&&(t.backstop&&(pn(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(fs(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function ps(e){if(!be)return;let t=e,n=t[P];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,s=!o&&n.adopted===!0,i=!1;for(let a of Array.from(e.childNodes))if(a!==t[$e]){if(n.authored.indexOf(a)!==-1){i=!0;continue}o&&(!r||hs(r,a))||!o&&s||(L.add(a),n.authored.push(a),i=!0)}i&&le(e)}function hs(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 Ma(e){let t=e,n=t[$e];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[$e]=n),dn(e,()=>me.call(e,n))),n}function Oe(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function Ar(e,t,n){if(n&&!Oe(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!Oe(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);un(e,r);for(let o of r)nt.call(t,o);return r}return un(e,[t]),[t]}function un(e,t){tt(e,t);for(let n of t){if(!Oe(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 tt(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 Er(e,t,n){let r=e.authored;for(let s of t){let i=r.indexOf(s);i!==-1&&r.splice(i,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function ms(e,t){let n=e[P];return n?hn(n,e,t):!1}function hn(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function vr(e,t){if(L.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[$e])return!0;let r=e[P];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(D)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&ae(e,n))}function xr(e,t){let n=[];for(let s of t)Oe(s)?s.nodeType===11?n.push({frag:s}):n.push({node:s}):n.push({text:`${s}`});for(let s of n)s.frag?tt(e,Array.from(s.frag.childNodes)):s.node&&un(e,[s.node]);let r=e.ownerDocument.createDocumentFragment();for(let s of n)if(s.text!==void 0)me.call(r,e.ownerDocument.createTextNode(s.text));else if(s.frag){let i=Array.from(s.frag.childNodes);un(e,i);for(let a of i)me.call(r,a)}else s.node&&(tt(e,[s.node]),me.call(r,s.node));let o=Array.from(r.childNodes);tt(e,o);for(let s of o)nt.call(r,s);return o}function ie(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);rt(t),le(e)}function bs(e){if(!be)return;let t=e;if(t[es])return;Pa(),t[es]=!0;let n=ce(e);t.appendChild=function(r){if(t[U])return me.call(this,r);let o=Ar(e,r,!1);for(let s of o)L.add(s);return Er(n,o,null),ie(e,n,o),r},t.insertBefore=function(r,o){if(t[U])return is.call(this,r,o);if(!Oe(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!Oe(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(tt(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!vr(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let s=Ar(e,r,!1);for(let i of s)L.add(i);return Er(n,s,o||null),ie(e,n,s),r},t.removeChild=function(r){if(t[U])return nt.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return nt.call(this,r);if(!vr(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),ie(e,n,[r]),r},t.replaceChild=function(r,o){if(t[U])return Nr.call(this,r,o);if(n.authored.indexOf(o)===-1)return Nr.call(this,r,o);if(!Oe(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(tt(e,r.nodeType===11?Array.from(r.childNodes):[r]),!vr(e,o))throw new DOMException("replaceChild: the node to be replaced is not an assigned child of this host","NotFoundError");if(r===o)return o;let i=Ar(e,r,!1);for(let c of i)L.add(c);for(let c of i){if(c===o)continue;let l=n.authored.indexOf(c);l!==-1&&n.authored.splice(l,1)}let a=n.authored.indexOf(o);return n.authored.splice(a,1,...i),ie(e,n,[...i,o]),o},t.append=function(...r){if(t[U])return as.apply(this,r);let o=xr(e,r);for(let s of o)L.add(s);Er(n,o,null),ie(e,n,o)},t.prepend=function(...r){if(t[U])return cs.apply(this,r);let o=xr(e,r);for(let s of o)L.add(s);for(let s of o){let i=n.authored.indexOf(s);i!==-1&&n.authored.splice(i,1)}n.authored.unshift(...o),ie(e,n,o)},t.replaceChildren=function(...r){if(t[U])return ls.apply(this,r);let o=xr(e,r);for(let i of o)L.add(i);let s=n.authored;n.authored=o.slice(),ie(e,n,[...s,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return ln.get.call(this)},set(r){if(t[U]){ln.set.call(this,r);return}let o=e.ownerDocument.createElement("div");ln.set.call(o,r===null?"":`${r}`);let s=Array.from(o.childNodes);for(let a of s)L.add(a);let i=n.authored;n.authored=s,ie(e,n,[...i,...s])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return Tr.get.call(this)},set(r){if(t[U]){Tr.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let i of o)L.add(i);let s=n.authored;n.authored=o,ie(e,n,[...s,...o])}})}function le(e){if(!be)return;let t=e[P];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||Fa;t.pendingRecordNodes=void 0,Da(e,t,n),Ba(e,t),rt(t);let r=[],o=new Set;for(let f of e.querySelectorAll(`slot[${D}]`))if(ae(e,f)&&!hn(t,e,f)){if(!f.hasAttribute(z)&&!(Lt in f)){o.add(Z(f.getAttribute("name")));continue}r.push(f)}let s=new Map;for(let f of r){let u=Z(f.getAttribute("name")),h=s.get(u);h||(h=[],s.set(u,h)),h.push(f)}let i=[];for(let[f,u]of s){let h=t.assignedByName.get(f)||[];for(let d=0;d<u.length;d++){let p=u[d],w=h.filter(S=>{let b=Rr(t,S);return b?b===p:d===0}),A=w.filter(S=>S===e||S.nodeType===1&&S.contains(e));if(A.length){for(let S of A)L.delete(S);w=w.filter(S=>A.indexOf(S)===-1)}w.length>0?Ha(t,p,w)&&i.push(p):Ua(t,p)&&i.push(p)}}for(let f of i)Va(t,f);let a=new Set(s.keys());for(let f of o)a.add(f);let c=new Set;for(let f of t.authored)a.has(Le(t,f))||c.add(f);let l=e[$e];if(l)for(let f of Array.from(l.childNodes))c.has(f)||nt.call(l,f);if(c.size){let f=Ma(e);for(let u of c)u.parentNode!==f&&(L.delete(u),dn(e,()=>me.call(f,u)))}if(t.backstop){let f=t.backstop.takeRecords();f.length&&pn(e,t,f)}}while(t.reapply)}finally{t.applying=!1}}}function Da(e,t,n){for(let r of e.querySelectorAll(`slot[${D}][${z}="${ee}"]`)){if(!ae(e,r)||hn(t,e,r))continue;let o=r,s=t.lastSnapshot.get(o);if(!s)continue;let i=Array.from(o.childNodes);if(jr(i,s))continue;let a=t.authored,c=Z(o.getAttribute("name")),l=i.filter(p=>!n.has(p));for(let p of l)a.indexOf(p)===-1&&Le(t,p)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(p,c));for(let p of a){if(l.indexOf(p)!==-1||Le(t,p)!==c)continue;let w=a.indexOf(p),A=0;for(let S=0;S<l.length;S++){let b=a.indexOf(l[S]);b!==-1&&b<w&&(A=S+1)}l.splice(A,0,p)}let f=new Set(l);for(let p of s)f.add(p);let u=-1,h=0;for(let p of a){if(f.has(p)){u===-1&&(u=h);continue}h+=1}let d=a.filter(p=>!f.has(p));(u===-1||u>d.length)&&(u=d.length),d.splice(u,0,...l),t.authored=d}}function Ba(e,t){let n=e[$e];t.authored=t.authored.filter(r=>{if(L.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(D)&&(t.lastSnapshot.has(o)||e.contains(o)&&ae(e,o)))})}function gs(e){if(!be)return!1;for(let t of e.querySelectorAll(`slot[${D}][${z}]`))if(ae(e,t))return!0;return!1}function ae(e,t){let n=t[fn];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(Ra):null;if(r){let o=qa(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 qa(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 Ha(e,t,n){for(let l of n)L.delete(l);let r=t.getAttribute(z)!==ee,o=e.lastSnapshot.get(t)||[],s=r||!jr(o,n);if(!r&&jr(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),s;let i=t[Lt];if(r&&i)for(;t.firstChild;)i.appendChild(t.firstChild);let a=new Set(n);for(let l of Array.from(t.childNodes))a.has(l)||t.removeChild(l);let c=t.firstChild;for(let l of n){if(l===c){c=c.nextSibling;continue}t.insertBefore(l,c)}return t.setAttribute(z,ee),e.lastSnapshot.set(t,n.slice()),s}function Ua(e,t){let n=t.getAttribute(z)===ee;if(t.setAttribute(z,ja),!n)return ts(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return ts(t),!0}function ts(e){let t=e[Lt];!t||t.childNodes.length===0||e.appendChild(t)}function ys(e,t){if(!Lr(e))return;let n=ce(e),r=Z(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let s of o)s.parentNode===t&&(L.add(s),t.removeChild(s));n.lastSnapshot.delete(t)}function Wa(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function Va(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)Wa(r)}))}function jr(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 be,P,D,z,ee,ja,Lt,fn,Ra,La,Rt,wr,cn,_r,Zo,U,es,$e,L,me,is,nt,Nr,as,cs,ls,ln,Tr,Fa,mn=se(()=>{be=ns(),P=Symbol("webjs.slot.state"),D="data-webjs-light",z="data-projection",ee="actual",ja="fallback",Lt=Symbol("webjs.slot.fallbackFrag"),fn=Symbol("webjs.slot.templateOwner"),Ra="data-wj-slot-owner",La=64,Rt=null,wr=null,cn=null,_r=null,Zo=!1;Oa();U=Symbol("webjs.slot.rendering"),es=Symbol("webjs.slot.intercepted"),$e=Symbol("webjs.slot.park"),L=new WeakSet,me=null,is=null,nt=null,Nr=null,as=null,cs=null,ls=null,ln=null,Tr=null;Fa=new Set});function $s(e,t,n){Sc.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function Dt(e){return JSON.stringify(await Is(e))}function ue(e){return Ps(JSON.parse(e))}async function Is(e){let t=Ac();return await Ec(e,t),Me(e,t)}function Ps(e){return ye(e,kc())}function Ac(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function Ec(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!Tc(r))continue;let o=t.refCount.get(r)||0;if(t.refCount.set(r,o+1),!(o>0)){if(typeof Blob<"u"&&r instanceof Blob){let s=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,s);continue}if(typeof FormData<"u"&&r instanceof FormData){let s=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,s);for(let[,i]of s)typeof i!="string"&&n.push(i);continue}if(Array.isArray(r))for(let s=0;s<r.length;s++)n.push(r[s]);else if(r instanceof Map)for(let[s,i]of r)n.push(s),n.push(i);else if(r instanceof Set)for(let s of r)n.push(s);else if(jc(r))for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&n.push(r[s])}}for(let[r,o]of t.refCount)o>1&&t.idOf.set(r,t.nextId++)}function Me(e,t){if(e===null)return null;if(e===void 0)return{[O]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[O]:"NaN"}:e===1/0?{[O]:"Inf"}:e===-1/0?{[O]:"-Inf"}:Object.is(e,-0)?{[O]:"-0"}:e;if(n==="bigint")return{[O]:"BigInt",v:e.toString()};if(n==="symbol"){let s=Symbol.keyFor(e);if(s===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[O]:"Sym",v:s}}if(n==="function")throw new TypeError("Cannot serialize a function.");let r=t.idOf.get(e);if(r!==void 0&&t.emitted.has(r))return{[O]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[O]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[O]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let s=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[O]:"File",v:Ft(s),n:e.name,t:e.type||"",m:e.lastModified}:o={[O]:"Blob",v:Ft(s),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let s=t.fdEntries.get(e)||[...e.entries()],i=[];for(let[a,c]of s)i.push([a,Me(c,t)]);o={[O]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=vc(e);else if(e instanceof Map){let s=[];for(let[i,a]of e)s.push([Me(i,t),Me(a,t)]);o={[O]:"Map",v:s}}else if(e instanceof Set){let s=[];for(let i of e)s.push(Me(i,t));o={[O]:"Set",v:s}}else if(Array.isArray(e))o=e.map(s=>Me(s,t));else{o={};for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let i=Rc(s)?"_"+s:s;$s(o,i,Me(e[s],t))}}if(r!==void 0){if(Array.isArray(o))return{[O]:"Arr",_id:r,v:o};o._id=r}return o}function vc(e){if(e instanceof ArrayBuffer)return{[O]:"buf",v:Ft(new Uint8Array(e))};if(e instanceof DataView)return{[O]:"dv",v:Ft(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=xc[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[O]:n,v:Ft(r)}}function kc(){return{refs:new Map}}function ye(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let s=[];for(let i=0;i<e.length;i++)s.push(ye(e[i],t));return s}let n=e[O];if(typeof n=="string")return Nc(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s)||s==="_id")continue;let i=Lc(s)?s.slice(1):s;$s(r,i,ye(e[s],t))}return r}function Nc(e,t,n){let r=e._id,o=s=>(typeof r=="number"&&n.refs.set(r,s),s);switch(t){case"undef":return;case"NaN":return NaN;case"Inf":return 1/0;case"-Inf":return-1/0;case"-0":return-0;case"BigInt":return o(BigInt(e.v));case"Sym":return o(Symbol.for(e.v));case"Date":return o(e.v==null?new Date(NaN):new Date(e.v));case"Error":{let s=new Error(e.v.message);return s.name=e.v.name,e.v.stack&&(s.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,s),s}case"Map":{let s=new Map;typeof r=="number"&&n.refs.set(r,s);for(let[i,a]of e.v)s.set(ye(i,n),ye(a,n));return s}case"Set":{let s=new Set;typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.add(ye(i,n));return s}case"Arr":{let s=[];typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.push(ye(i,n));return s}case"Ref":{let s=n.refs.get(e.v);if(s===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return s}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let s=Mt(e.v);return o(new Blob([s],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let s=Mt(e.v);return o(new File([s],e.n,{type:e.t||"",lastModified:e.m}))}case"FD":{if(typeof FormData>"u")throw new TypeError("FormData is not available in this environment.");let s=new FormData;o(s);for(let[i,a]of e.v){let c=ye(a,n);s.append(i,c)}return s}default:{if(t==="buf"){let i=Mt(e.v);return o(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=Mt(e.v);return o(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let s=Cc[t];if(s){let i=Mt(e.v),a=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength);return o(new s(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function Tc(e){return e!==null&&typeof e=="object"}function jc(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Rc(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function Lc(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function Ft(e){if(Ms)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 Mt(e){if(Ms){let r=Buffer.from(e,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}var O,Sc,xc,Cc,Ms,at=se(()=>{O="_$wj",Sc=new Set(["__proto__","constructor","prototype"]);xc={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},Cc={i8:Int8Array,u8:Uint8Array,u8c:Uint8ClampedArray,i16:Int16Array,u16:Uint16Array,i32:Int32Array,u32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:typeof BigInt64Array<"u"?BigInt64Array:null,bu64:typeof BigUint64Array<"u"?BigUint64Array:null};Ms=typeof Buffer<"u"&&typeof Buffer.from=="function"});var ei={};Po(ei,{observeLazy:()=>xl,observeViewportOnce:()=>Nl});function Qs(e){let t=Zr.get(e);return t||(t=import(e).finally(()=>Zr.delete(e)),Zr.set(e,t),t)}function xl(e){for(let[t,n]of Object.entries(e))Fe.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of Fe.values())Qs(t);Fe.clear();return}Ut||(Ut=new IntersectionObserver(Cl,{rootMargin:"200px"})),Zs(),typeof MutationObserver<"u"&&new MutationObserver(()=>Zs()).observe(document.body,{childList:!0,subtree:!0})}function Zs(){if(!(!Ut||!Fe.size))for(let e of Fe.keys())for(let t of document.querySelectorAll(e))Ut.observe(t)}function Cl(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=Fe.get(n);r&&(Qs(r),Fe.delete(n),Ut?.unobserve(t.target))}}function kl(e){for(let t of e){if(!t.isIntersecting)continue;let n=jn.get(t.target);jn.delete(t.target),Ht?.unobserve(t.target),n&&n()}}function Nl(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(Ht||(Ht=new IntersectionObserver(kl,{rootMargin:"200px"})),jn.set(e,t),Ht.observe(e),()=>{jn.delete(e),Ht?.unobserve(e)})}var Fe,Ut,Zr,Ht,jn,ti=se(()=>{Fe=new Map,Ut=null,Zr=new Map;Ht=null,jn=new WeakMap});var Qr,eo=se(()=>{Qr=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(()=>(ti(),ei)).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(()=>(to(),ni)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&Qr&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",Qr)});function jl(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 ro(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let s=n.createElement("template");s.innerHTML=e,r=s.content}else if(e&&e.nodeType)r=e;else return;let o=r.querySelectorAll?Array.from(r.querySelectorAll("webjs-stream")):[];if(o.length)for(let s of o)n.body.append(s);else n.body.append(r)}var Tl,no,Rn=se(()=>{Tl=new Set(["append","prepend","before","after","replace","update"]);no=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this._webjsApplied||(this._webjsApplied=!0,this._webjsApply())}_webjsApply(){let t=(this.getAttribute("action")||"").toLowerCase(),n=this.ownerDocument||document,r=[],o=this.getAttribute("target");if(o){let i=n.getElementById(o);i&&(r=[i])}else{let i=this.getAttribute("targets");if(i)try{r=Array.from(n.querySelectorAll(i))}catch{r=[]}}let s=Tl.has(t)?this.querySelector("template"):null;try{for(let i of r){let a=s?s.content.cloneNode(!0):null;jl(t,i,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&no&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",no)});var ri,oi=se(()=>{ri=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&ri&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",ri)});function Ln(e){let t=e||(typeof document<"u"?document:null);if(!(!t||typeof t.querySelectorAll!="function")){for(let n of t.querySelectorAll('script[type="application/json"]#__webjs-seeds, script[type="application/json"][data-webjs-seeds]'))ii(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))ii(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function ii(e,t,n){if(e)try{let r=ue(e);if(r&&typeof r=="object")for(let o in r)Wt.has(o)||Wt.set(o,r[o])}catch{}n?n():t.remove?.()}function Rl(e,t,n){si||(si=!0,Ln());let r=`${e}/${t}/${n}`;if(Wt.has(r)){let o=Wt.get(r);return Wt.delete(r),o}return ai}var Wt,ai,si,oo=se(()=>{at();Wt=new Map,ai=Symbol("webjs.seed.miss"),si=!1});function so(e){if(!(!Array.isArray(e)||!e.length)){On+=1;for(let t of e)t&&ci.set(t,On)}}function Ol(){return On}function $l(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(lt.delete(e),lt.set(e,{tags:t.slice(),since:typeof n=="number"?n:On}),lt.size>Ll)){let r=lt.keys().next().value;r!==void 0&<.delete(r)}}function Il(e){let t=lt.get(e);if(!t)return!1;for(let n of t.tags)if((ci.get(n)||0)>t.since)return!0;return!1}function io(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var On,ci,lt,Ll,ao=se(()=>{On=0,ci=new Map,lt=new Map,Ll=1e3});var ni={};Po(ni,{_FALLBACK_MARKER_KEY:()=>Fn,_FRAME_TOP:()=>Ei,_LIVE_ATTRS:()=>mo,_activateSwappedRange:()=>jo,_activeFrameId:()=>Ai,_addNewHeadElements:()=>go,_applyOptimisticLoading:()=>ko,_applyStreamedResolve:()=>Ki,_applySwap:()=>Co,_blurOutgoingFocus:()=>Mn,_buildHaveHeader:()=>Jt,_buildSubmitFormData:()=>_i,_bumpNavToken:()=>gu,_clearFormBusy:()=>Di,_clearFrameBusy:()=>Mi,_collectBoundaries:()=>gt,_currentPageUrl:()=>yu,_diffElementInPlace:()=>Vn,_eligibleAnchorHref:()=>Bn,_findAnchorInPath:()=>Si,_getSubmitAction:()=>wi,_getSubmitMethod:()=>yi,_isNonHtmlPath:()=>Au,_isPreBootNavigation:()=>xi,_keyOf:()=>bt,_markFormBusy:()=>Fi,_markFrameBusy:()=>Pi,_mergeHead:()=>Ui,_navToken:()=>bu,_onPopState:()=>_o,_onSubmit:()=>So,_parseHTML:()=>yo,_planBoundarySwap:()=>Ci,_prefetch:()=>yt,_prefetchAnchor:()=>Li,_prefetchCache:()=>$,_prefetchHasHoverPointer:()=>ji,_prefetchInflightSize:()=>pu,_prefetchMode:()=>qn,_prefetchPeek:()=>du,_prefetchSaysSaveData:()=>vo,_prefetchSuppressed:()=>Ri,_prefetchTake:()=>Oi,_reactivateScripts:()=>Gn,_readStreamedShell:()=>Wi,_reconcileChildren:()=>er,_regraftPermanentElements:()=>qi,_regraftPermanentInSlice:()=>Qn,_resetParseProbe:()=>Ml,_resetPrefetch:()=>hu,_resetWarnOnce:()=>_u,_resolveTargetFrameId:()=>Ao,_restoreOptimistic:()=>Vt,_runWithTransition:()=>In,_setCurrentPageUrl:()=>wu,_setHardNavigate:()=>mu,_shouldFullLoadDuringParse:()=>Su,_snapshotCache:()=>W,_streamBoundariesProgressively:()=>zi,_takeResolveUnit:()=>Vi,_viewTransitionsEnabled:()=>Bi,collectBoundaries:()=>gt,disableClientRouter:()=>hi,enableClientRouter:()=>wo,loadFrame:()=>Bl,navigate:()=>mi,planBoundarySwap:()=>Ci,revalidate:()=>bi});function yo(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"&&Pl()?Document.parseHTMLUnsafe(e):Fl(e)}function Pl(){if(ut!==null)return ut;try{ut=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{ut=!1}return ut}function Ml(){ut=null}function Fl(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}function Dl(){co||typeof MutationObserver>"u"||typeof customElements>"u"||(co=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)}}),co.observe(document.body,{childList:!0,subtree:!0}))}function wo(){Ee||typeof document>"u"||(Ee=!0,document.addEventListener("click",gi,!1),document.addEventListener("submit",So,!1),window.addEventListener("popstate",_o),document.addEventListener("pointerover",mt,!0),document.addEventListener("focusin",mt,!0),document.addEventListener("touchstart",mt,{capture:!0,passive:!0}),document.addEventListener("pointerout",$i,!0),document.addEventListener("webjs:navigate",ho),Dl(),ho(),typeof history<"u"&&"scrollRestoration"in history&&($n=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(oe=location.href),ql())}function hi(){Ee&&(Ee=!1,document.removeEventListener("click",gi,!1),document.removeEventListener("submit",So,!1),window.removeEventListener("popstate",_o),document.removeEventListener("pointerover",mt,!0),document.removeEventListener("focusin",mt,!0),document.removeEventListener("touchstart",mt,{capture:!0}),document.removeEventListener("pointerout",$i,!0),document.removeEventListener("webjs:navigate",ho),Zn(),xo(),Se&&(Se.disconnect(),Se=null),typeof history<"u"&&$n!==null&&(history.scrollRestoration=$n,$n=null),oe=null)}async function mi(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){Be(e);return}await Eo(n.href,t?.replace??!1,null)}async function Bl(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1};J&&J.abort(),J=new AbortController;let o=J.signal,s=++q;return Hn(r.href,n,!1,null,"GET",null,o,s)}function bi(e){if(!e){W.clear(),$.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;W.delete(n),$.delete(n)}function gi(e){if(!Ee||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Si(e);if(!t||t.hasAttribute("download")||t.hasAttribute("data-no-router")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin||r.pathname===location.pathname&&r.search===location.search&&r.hash||Jn.test(r.pathname))return;e.preventDefault();let o=Ao(t);Eo(n,!1,o)}function _o(e){Eo(location.href,!0,null)}function So(e){if(!Ee||e.defaultPrevented)return;let t=e.target;if(!t||t.nodeType!==1||t.tagName!=="FORM"||t.hasAttribute("data-no-router"))return;let n=e.submitter??null;if(n&&n.hasAttribute("data-no-router"))return;let r=n&&n.getAttribute("formtarget")||t.getAttribute("target")||"";if(r&&r!=="_self")return;let o=yi(t,n);if(o==="dialog")return;let s=wi(t,n),i;try{i=new URL(s,location.href)}catch{return}if(i.origin!==location.origin||Jn.test(i.pathname))return;let a=_i(t,n);e.preventDefault();let c=Ao(n||t);Vl(i.href,o,a,c,t)}function yi(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function wi(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function _i(e,t){try{return new FormData(e,t||void 0)}catch{let n=new FormData(e);return t&&t.getAttribute("name")&&n.append(t.getAttribute("name"),t.getAttribute("value")||""),n}}function Si(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Ai(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 Ao(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===Ei)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Xn(`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 Ai(e)}function Xn(e,t){uo.has(e)||(uo.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function vi(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function xi(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 ql(){if(typeof location>"u"||ui)return;ui=!0;let e=null;try{e=sessionStorage.getItem(Fn),sessionStorage.removeItem(Fn)}catch{}let t="";try{let n=performance.getEntriesByType("navigation")[0];t=n?n.type:""}catch{}xi(t,document.referrer,location.href,e)&&_e("pre-boot-navigation",location.href,!1)}function _e(e,t,n=!0){if(n)try{sessionStorage.setItem(Fn,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||Xn(`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 Hl(e){typeof process<"u"&&process.env||Xn(`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 fi(){if(typeof process<"u"&&process.env||fo||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;fo=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&Xn("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 Dn(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 gt(e){let t=new Map,n=[],r=!1;function o(s){if(!r){if(s.nodeType===8){let i=s.data.trim();if(i.startsWith("wj:children:")){let a=i.slice(12),c=a.lastIndexOf(":");if(c<=0||c===a.length-1){r=!0;return}let l=a.slice(0,c),f=a.slice(c+1);if(t.has(l)||n.some(u=>u.segment===l)){r=!0;return}n.push({segment:l,routeKey:f,start:s});return}if(i.startsWith("/wj:children")){let a=i.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==s.parentNode){r=!0;return}{let l=c.start.parentNode.tagName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TFOOT"||l==="TR"){r=!0;return}}t.set(c.segment,{routeKey:c.routeKey,start:c.start,end:s});return}return}if(s.hasChildNodes&&s.hasChildNodes())for(let i=s.firstChild;i&&!r;i=i.nextSibling)o(i)}}return o(e),r||n.length>0?null:t}function Ci(e,t){let n=[...e.keys()].filter(i=>t.has(i)).sort((i,a)=>i.length-a.length);if(n.length===0)return null;for(let i of n)if(e.get(i).routeKey!==t.get(i).routeKey){let a=null;for(let c of n){if(c===i)break;i.startsWith(c==="/"?c:c+"/")&&(a=c)}return a?{mode:"replace",segment:a,live:e.get(a),incoming:t.get(a)}:null}let r=n[n.length-1],o=i=>{let a=null;for(let c of i.keys())(a===null||c.length>a.length)&&(a=c);return a};return{mode:o(e)===r&&o(t)===r?"morph":"replace",segment:r,live:e.get(r),incoming:t.get(r)}}function ki(e){let t=Ae(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),W.has(t)&&W.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(W.set(t,n);W.size>Ul;){let r=W.keys().next().value;W.delete(r)}}function Wl(e){let t=Ae(e),n=W.get(t);return n==null?null:(W.delete(t),W.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function Ae(e){let t=new URL(e,location.href);return t.pathname+t.search}async function Eo(e,t,n){if(vi(t,n)&&typeof location<"u"){_e("readyState-loading",e),Be(e);return}J&&J.abort(),J=new AbortController;let r=J.signal,o=++q;oe&&ki(oe);let s=setTimeout(()=>{Dn(!0),s=null},150),i=null;t||(i=ko());try{if(t){let a=Wl(e);if(a){let c=yo(a.html);if(c){Co(c,n,!0,null),typeof window<"u"&&window.scrollTo({left:a.scrollX,top:a.scrollY,behavior:"instant"}),Hn(e,n,!1,i,"GET",null,r,o,!0).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await Hn(e,n,!t,i,"GET",null,r,o)}finally{s&&clearTimeout(s),o===q&&(Dn(!1),typeof location<"u"&&(oe=location.href))}}async function Vl(e,t,n,r,o){J&&J.abort(),J=new AbortController;let s=J.signal,i=++q,a=t==="get"||t==="head",c=new URL(e,location.href);if(a){c.search="";for(let[d,p]of n)c.searchParams.append(d,typeof p=="string"?p:p.name)}oe&&ki(oe);let l=setTimeout(()=>{Dn(!0),l=null},150),f=ko(),u=o?Fi(o,i,c.href):null,h=!1;try{let d=await Hn(c.href,r,!0,f,a?"GET":t.toUpperCase(),a?null:n,s,i);h=!!(d&&d.ok),!a&&i===q&&(W.clear(),$.clear())}finally{u&&Di(u,i,c.href,h),l&&clearTimeout(l),i===q&&(Dn(!1),typeof location<"u"&&(oe=location.href))}}function Jt(){let e=gt(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}function vo(){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 ji(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Jl(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function Bn(e){if(!e||!(e instanceof HTMLAnchorElement)||e.hasAttribute("download")||e.hasAttribute("data-no-router")||e.target&&e.target!=="_self")return null;let t=e.href;if(!t)return null;let n;try{n=new URL(t)}catch{return null}return n.origin!==location.origin||n.pathname===location.pathname&&n.search===location.search&&n.hash||Jn.test(n.pathname)?null:t}function Ri(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Jl(e);return t.includes("external")||t.includes("no-prefetch")}function qn(e){if(Ri(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 ji()?"intent":"viewport"}}function yt(e){if(!Ee||typeof fetch!="function"||vo())return;let t=Ae(e);if(typeof location<"u"&&t===Ae(location.href)||De.has(t)||Kt.has(t))return;let n=$.get(t);if(n&&po()-n.at<Ni)return;if(De.size>=Ti){for(Kt.add(t),pt.push(e);pt.length>zl;){let s=pt.shift();Kt.delete(Ae(s))}return}let r=Jt();if(!r&&typeof document<"u"&&document.readyState==="loading")return;De.add(t);let o={"x-webjs-router":"1","x-webjs-prefetch":"1"};r&&(o["x-webjs-have"]=r),fetch(e,{method:"GET",headers:o,credentials:"same-origin",cache:"no-cache"}).then(async s=>{let i=s.headers.get("content-type")||"";if(!/^text\/html\b/i.test(i)||s.status>=400)return;let a=s.headers.get("x-webjs-build"),c=s.headers.get("x-webjs-src"),l=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,f=l?l.getAttribute("data-webjs-build"):null,u=l?l.getAttribute("data-webjs-src"):null;(a&&f&&a!==f||c&&u&&c!==u)&&(W.clear(),$.clear());let h=s.redirected&&s.url?s.url:e,d=await s.text();Zl(t,{html:d,build:a,src:c,finalUrl:h,at:po()})}).catch(()=>{}).finally(()=>{De.delete(t),Xl()})}function Xl(){for(;pt.length&&De.size<Ti;){let e=pt.shift();Kt.delete(Ae(e)),yt(e)}}function Zl(e,t){for($.has(e)&&$.delete(e),$.set(e,t);$.size>Kl;){let n=$.keys().next().value;$.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function Li(e){let t=/<!--wj:children:([^>]*?)-->/.exec(e||"");return t?t[1]:null}function Oi(e,t){let n=Ae(e),r=$.get(n);if(!r)return null;if(po()-r.at>=Ni)return $.delete(n),null;let o=Li(r.html);return o&&!new Set(String(t??(Jt()||"")).split(",").filter(Boolean)).has(o)?($.delete(n),null):($.delete(n),r)}function po(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function mt(e){if(!Ee)return;let t=Ii(e.target);if(!t)return;let n=qn(t);if(n==="none"||n==="render")return;let r=Bn(t);if(r){if(e.type==="touchstart"){yt(r);return}n==="intent"&&(zt===t&&ht||(Zn(),zt=t,ht=setTimeout(()=>{ht=null,zt=null,yt(r)},Yl)))}}function $i(e){let t=Ii(e.target);t&&t===zt&&Zn()}function Zn(){ht&&(clearTimeout(ht),ht=null),zt=null}function xo(){for(let e of Yt)clearTimeout(e);Yt.clear(),ft=new WeakMap}function Ii(e){let t=e;for(;t;){if(t instanceof HTMLAnchorElement)return t;let n=t.nodeType===1?t:null;if(n){let o=n.closest&&n.closest("a");if(o instanceof HTMLAnchorElement)return o}let r=t.getRootNode?t.getRootNode():null;t=r&&r.host?r.host:null}return null}function ho(){if(typeof document>"u"||vo())return;let e=typeof IntersectionObserver<"u";e&&(Se?(Se.disconnect(),xo()):Se=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(ft.has(r))continue;let o=setTimeout(()=>{Yt.delete(o),ft.delete(r),Se.unobserve(r);let s=Bn(r);s&&qn(r)==="viewport"&&yt(s)},Gl);ft.set(r,o),Yt.add(o)}else{let o=ft.get(r);o&&(clearTimeout(o),Yt.delete(o),ft.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=qn(t);if(n==="render"){let r=Bn(t);r&&yt(r)}else n==="viewport"&&e&&Se.observe(t)}}function Ql(e){if(typeof document>"u"||!document.body)return!1;let t=gt(document.body);if(!t)return!1;let n,r=-1;for(let[c,l]of t)c.length>r&&(r=c.length,n=l);if(!n)return!1;let o=n.start.parentNode;if(!o||n.start.parentNode!==n.end.parentNode)return!1;let s=document.createElement("div");s.setAttribute("role","alert"),s.setAttribute("data-webjs-nav-error","");let i=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";s.textContent=i;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),o.insertBefore(s,n.end),!0}function 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||Ql(t)||typeof location<"u"&&(_e("navigation-error-unrecoverable",e),Be(e))}async function Hn(e,t,n,r,o,s,i,a,c){o=o||"GET";let l=typeof a=="number"?a:q,f,u=null,h=null,d=null,p=null,w=!1,A=e,S=t?Pi(t,l):null;try{try{let y=o==="GET"&&!s&&!t?Oi(e,r?r.haveKeys:void 0):null;if(y)f=y.html,h=y.build,d=y.src,A=y.finalUrl,p=200,w=!0;else{let E={"x-webjs-router":"1"},j=Jt();j&&(E["x-webjs-have"]=j),t&&(E["x-webjs-frame"]=t),s!=null&&o!=="GET"&&o!=="HEAD"&&(E.accept=li+", text/html");let I={method:o,headers:E,credentials:"same-origin",cache:"no-cache"};i&&(I.signal=i),s!=null&&o!=="GET"&&o!=="HEAD"&&(I.body=s);let C=await fetch(e,I);p=C.status,w=C.ok;let k=io(C.headers.get("x-webjs-invalidate"));k.length&&so(k);let v=C.headers.get("content-type")||"",_=/^text\/html\b/i.test(v);if(v.toLowerCase().indexOf(li)===0){let T=await C.text();return l===q&&(Vt(r),ro(T)),{ok:w,status:p,aborted:!1}}if(C.redirected&&C.url&&(A=C.url),C.status===204||C.status===205)return l===q&&n&&history.pushState(null,"",A),{ok:w,status:p,aborted:!1};if(!_)return l===q&&(Vt(r),lo(e,C.status,null)),{ok:!1,status:p,aborted:!1};h=C.headers.get("x-webjs-build"),d=C.headers.get("x-webjs-src");let g=await Wi(C);f=g.shell,g.streaming&&(u=g)}}catch(y){return y&&y.name==="AbortError"?{ok:!1,status:null,aborted:!0}:l!==q?{ok:!1,status:null,aborted:!0}:(Vt(r),lo(e,null,y instanceof Error?y:new Error(String(y))),{ok:!1,status:null,aborted:!1})}if(l!==q){if(u&&u.reader)try{u.reader.cancel()}catch{}return{ok:!1,status:p,aborted:!0}}let b=yo(f);if(!b)return Vt(r),lo(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:p,aborted:!1};if(Co(b,t,!!c,A,h,d)==="discard"){if(u&&u.reader)try{u.reader.cancel()}catch{}return{ok:w,status:p,aborted:!1}}if(n&&history.pushState(null,"",A),n){let y=new URL(A);if(y.hash){let E=document.getElementById(y.hash.slice(1));E?E.scrollIntoView():(fi(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else fi(),window.scrollTo({left:0,top:0,behavior:"instant"})}return u&&(u.reader||u.rest)&&Pn.then(()=>zi(u.reader,u.dec,u.rest,()=>l===q)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:A,frameId:t,from:"navigate"}})),{ok:w,status:p,aborted:!1}}finally{S&&Mi(S,l)}}function Pi(e,t){if(typeof document>"u")return null;let n=null;try{n=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{n=document.getElementById(e)}if(!n)return null;let r=Un.has(n);return Un.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 Mi(e,t){if(Un.get(e)!==t)return;Un.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 Fi(e,t,n){let r=Wn.has(e);return Wn.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 Di(e,t,n,r){if(Wn.get(e)!==t)return;Wn.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 di(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+=fe(r);return n}function Bi(){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 In(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(Bi()&&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 qi(e,t){if(!e||!t||typeof e.querySelectorAll!="function")return;let n=e.querySelectorAll("[data-webjs-permanent][id]");for(let r of n){let o=r.id;if(!o)continue;let s=null;try{s=t.querySelector(`#${CSS.escape(o)}`)}catch{s=null}if(!s||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let i=s.parentNode;i&&s!==r&&(i.replaceChild(r,s),Gt.add(r))}}function Qn(e,t){let n=[];for(let r of e){if(r.nodeType!==1)continue;let o=r;if(o.hasAttribute&&o.hasAttribute("data-webjs-permanent")&&o.id&&n.push(o),typeof o.querySelectorAll=="function")for(let s of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(s)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let s=eu(t,o);if(!s||s===r)continue;let i=s.parentNode;if(i)i.replaceChild(r,s),Gt.add(r);else{let a=t.indexOf(s);a!==-1&&(t[a]=r,Gt.add(r))}}}function eu(e,t){for(let n of e){if(n.nodeType!==1)continue;let r=n;if(r.id===t)return r;if(typeof r.querySelector=="function"){let o=null;try{o=r.querySelector(`#${CSS.escape(t)}`)}catch{o=null}if(o)return o}}return null}function tu(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&dt(t)}function Co(e,t,n,r,o,s){try{Ln(e)}catch{}try{for(let u of e.querySelectorAll("[data-wj-host]"))u.setAttribute("data-wj-serialized","")}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let u=document.querySelector('script[type="importmap"]'),h=u?u.getAttribute("data-webjs-build"):null,d=!1;if(o&&h&&(d=o!==h),!d&&e.head&&e.head.children.length>0){let p=di(document),w=di(e);p!==w&&(d=!0)}if(d&&typeof location<"u"){W.clear(),$.clear();try{let p="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(p))sessionStorage.removeItem(p),_e("deploy-mismatch-reload-suppressed",r,!1);else{sessionStorage&&sessionStorage.setItem(p,"1"),_e("deploy-mismatch",r),Be(r);return}}catch{_e("deploy-mismatch",r),Be(r);return}}else if(!d){let p=u?u.getAttribute("data-webjs-src"):null;s&&p&&s!==p&&(W.clear(),$.clear(),u&&u.setAttribute("data-webjs-src",s));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){let u=document.querySelector(`webjs-frame#${CSS.escape(t)}`),h=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(u&&h){go(e.head),Pn=In(()=>{lu(u,h),Gn(u),dt(u),pi(e.body),Mn()},()=>dt(u));return}let d=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});(u||document).dispatchEvent(d),d.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`);return}let i=gt(document.body),a=gt(e.body),c=i&&a?Ci(i,a):null;if(c){let{mode:u,live:h,incoming:d}=c;go(e.head),Pn=In(()=>{u==="replace"?nu(h,d):ru(h,d,e),au(h.start,d.start),pi(e.body),Mn()},()=>tu(h));return}if(r&&!n&&typeof location<"u"){_e(i?a?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),Be(r);return}if(r&&n)return _e("revalidation-discarded",r,!1),"discard";Ui(e.head),qi(document.body,e.body);let l=[...e.body.childNodes];Pn=In(()=>{document.body.replaceChildren(...l),Gn(document.body),dt(document.body),Mn()},()=>dt(document.body))}function Mn(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function nu(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)r.push(s);let o=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)o.push(document.importNode(s,!0));Qn(r,o);for(let s of r)s.parentNode===n&&n.removeChild(s);for(let s of o)n.insertBefore(s,e.end);jo(e)}function ru(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)o.push(i);let s=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)s.push(document.importNode(i,!0));Qn(o,s),ou(r,e.start,e.end,o,s),jo(e)}function ou(e,t,n,r,o){let s=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=bt(c);l&&s.set(l,c)}let i=n,a=[];for(let c of o){if(c.nodeType===1){let l=bt(c);if(l&&s.has(l)){let f=s.get(l);Vn(f,c),a.push(f),s.delete(l);continue}}a.push(c)}for(let c of r)if(c.parentNode===e){if(c.nodeType===1&&a.includes(c))continue;e.removeChild(c)}for(let c of a)e.insertBefore(c,i)}function Vn(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),!mo.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])mo.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(su(e)){cu(e,t);return}er(e,t)}function su(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[P]!=null}function iu(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function Kn(e){let t=new Map,n=`slot[${D}][${z}="${ee}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!iu(o,e)||ms(e,o))continue;let s=!1;for(let a=o.parentElement;a&&a!==e;a=a.parentElement)if(a.tagName==="SLOT"&&a.hasAttribute(D)&&a.getAttribute(z)===ee){s=!0;break}if(s)continue;let i=Z(o.getAttribute("name"));t.has(i)||t.set(i,o)}return t}function au(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(D))return;let o=null;for(let u=r.parentElement;u;u=u.parentElement){if(u[P]){o=u;break}if(u.tagName.includes("-"))return}if(!o)return;let s=Z(r.getAttribute("name"));Ie(o,s,[...r.childNodes]);let i=t.parentNode;if(!i||i.nodeType!==1)return;let a=i;if(a.tagName!=="SLOT")return;let c=null;for(let u=a.parentElement;u;u=u.parentElement)if(u.tagName.includes("-")){c=u;break}if(!c||c.tagName!==o.tagName)return;let l=Kn(o),f=Kn(c);for(let u of new Set([...l.keys(),...f.keys()])){if(u===s)continue;let h=f.get(u);h?Ie(o,u,[...h.childNodes].map(d=>document.importNode(d,!0))):l.get(u)&&Ie(o,u,null)}}function cu(e,t){if(!e[P])return;let n=Kn(e),r=Kn(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let s of o){let i=n.get(s),a=r.get(s);i&&a?(er(i,a),Ie(e,s,[...i.childNodes])):a?Ie(e,s,[...a.childNodes].map(c=>document.importNode(c,!0))):Ie(e,s,null)}}function er(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));Qn(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=bt(a);c&&o.set(c,a)}let s=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=bt(c);if(l&&o.has(l)){let u=o.get(l);Vn(u,c),s.push(u),o.delete(l);continue}let f=n[a];if(f&&f.nodeType===1&&!bt(f)&&f.tagName===c.tagName){Vn(f,c),s.push(f);continue}}else if(c.nodeType===3){let l=n[a];if(l&&l.nodeType===3){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),s.push(l);continue}}else if(c.nodeType===8){let l=n[a];if(l&&l.nodeType===8){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),s.push(l);continue}}s.push(c)}let i=new Set(s);for(let a of n)!i.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<s.length;a++){let c=s[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function bt(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function ko(){let e=gt(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((c,l)=>l.length-c.length),n=null,r=null;for(let c of t){let l=document.getElementById(`wj-loading:${c}`);if(l instanceof HTMLTemplateElement){n=c,r=l;break}}if(n===null||r===null)return null;let o=e.get(n),s=Jt(),i=[];for(let c=o.start.nextSibling;c&&c!==o.end;c=c.nextSibling)i.push(c);let a=document.createRange();return a.setStartAfter(o.start),a.setEndBefore(o.end),a.deleteContents(),o.start.parentNode.insertBefore(r.content.cloneNode(!0),o.end),{slot:o,oldChildren:i,token:q,haveKeys:s}}function Vt(e){if(!e||e.token!==q)return;let{slot:t,oldChildren:n}=e;if(t.start.parentNode!==t.end.parentNode)return;let r=document.createRange();r.setStartAfter(t.start),r.setEndBefore(t.end),r.deleteContents();for(let o of n)t.start.parentNode.insertBefore(o,t.end)}function lu(e,t){er(e,t)}function Hi(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function zn(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=Hi();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function No(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=Hi();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function fe(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Yn(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 uu(e){if(!e.querySelector("meta"))return;let t=o=>{let s=new Map;for(let i of o.querySelectorAll("meta")){let a=Yn(i);if(!a||a===bo)continue;let c=s.get(a);c?c.push(i):s.set(a,[i])}return s},n=t(e),r=t(document.head);for(let[o,s]of n){let i=r.get(o)||[],a=s.map(fe).join(`
|
|
2
|
+
`),c=i.map(fe).join(`
|
|
3
|
+
`);if(a!==c){if(s.length===1&&i.length===1){let l=i[0];for(let f of[...l.attributes])l.removeAttribute(f.name);for(let f of s[0].attributes)l.setAttribute(f.name,f.value);continue}for(let l of i)l.remove();for(let l of s)document.head.appendChild(No(l))}}for(let[o,s]of r)if(!n.has(o))for(let i of s)i.remove()}function go(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(fe(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(r.tagName==="META"&&Yn(r)||n.has(fe(r))||(r.tagName==="SCRIPT"?document.head.appendChild(zn(r)):document.head.appendChild(No(r))));uu(e)}function fu(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function Ui(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let s of t.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&r.add(fe(s));let o=new Set;for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&o.add(fe(s));for(let s of[...t.children])s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(fu(s)||s.tagName==="META"&&Yn(s)===bo||o.has(fe(s))||s.remove());for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(s.tagName==="META"&&Yn(s)===bo||r.has(fe(s))||(s.tagName==="SCRIPT"?t.appendChild(zn(s)):t.appendChild(No(s))))}function dt(e){typeof customElements>"u"||To(e)}function To(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&&To(n.shadowRoot))}function pi(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 Wi(e){if(!e.body||typeof e.body.getReader!="function")return{shell:await e.text(),streaming:!1};let t=e.body.getReader(),n=new TextDecoder,r="",o="<template data-webjs-resolve",s="<!--wj-stream-shell-->",i=/<\/html\s*>/i;for(;;){let{value:a,done:c}=await t.read();a&&(r+=n.decode(a,{stream:!0})),c&&(r+=n.decode());let l=r.indexOf(s);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+s.length)};let f=r.indexOf(o);if(f!==-1)return{shell:r.slice(0,f),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(f)};if(c)return{shell:r,streaming:!1};let u=i.exec(r);if(u){let h=u.index+u[0].length;return{shell:r.slice(0,h),streaming:!0,reader:t,dec:n,rest:r.slice(h)}}}}function Vi(e){let t=/<template\s+data-webjs-resolve="([^"]+)"\s*>/i.exec(e);if(!t)return null;let n=t[1],r=t.index+t[0].length,o=/<(\/?)template\b[^>]*>/gi;o.lastIndex=r;let s=1,i;for(;i=o.exec(e);)if(i[1]==="/"){if(s--,s===0)return{id:n,content:e.slice(r,i.index),rest:e.slice(i.index+i[0].length)}}else s++;return null}function Ki(e,t){let n=document.getElementById(e);if(!n){Hl(e);return}let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];n.replaceWith(r.content);for(let s of o)s.nodeType===1&&To(s)}async function zi(e,t,n,r){let o=n,s=()=>{let i;for(;i=Vi(o);){if(!r())return!1;Ki(i.id,i.content),o=i.rest}return!0};if(!e){s();return}try{for(;;){if(!s()){try{await e.cancel()}catch{}return}let{value:i,done:a}=await e.read();if(i&&(o+=t.decode(i,{stream:!0})),a){o+=t.decode(),s();return}}}catch{}}function Gn(e){if(e.tagName==="SCRIPT"){let n=zn(e);return e.replaceWith(n),n}let t=[];Gt.has(e)&&t.push(e);for(let n of e.querySelectorAll("[data-webjs-permanent]"))Gt.has(n)&&t.push(n);for(let n of e.querySelectorAll("script"))t.length&&t.some(r=>r!==n&&r.contains(n))||n.replaceWith(zn(n));return e}function jo(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=Gn(n);r.isConnected!==!1&&dt(r)}}function du(e){return $.get(Ae(e))||null}function pu(){return De.size}function hu(){$.clear(),De.clear(),pt.length=0,Kt.clear(),Zn(),xo()}function mu(e){Be=e||(t=>{location.href=t})}function bu(){return q}function gu(){return++q}function yu(){return oe}function wu(e){oe=e}function _u(){uo.clear(),fo=!1}function Su(e,t){return vi(e,t)}function Au(e){return Jn.test(e)}var li,ut,Ee,J,q,co,oe,$n,Jn,Be,Ei,uo,Fn,ui,fo,Ul,W,Kl,Ni,Ti,zl,Yl,Gl,$,De,pt,Kt,ht,zt,Se,ft,Yt,Un,Wn,Gt,Pn,mo,bo,to=se(()=>{eo();Rn();Rn();oi();oo();ao();mn();li="text/vnd.webjs-stream.html";ut=null;Ee=!1,J=null,q=0,co=null;oe=null,$n=null;Jn=/\.(?:pdf|zip|tar|gz|7z|rar|dmg|exe|msi|deb|rpm|apk|ipa|xlsx?|docx?|pptx?|csv|odt|ods|odp|rtf|epub|mobi|xml|json|rss|atom|txt|md|wasm|mp3|mp4|mov|avi|webm|ogg|flac|wav|m4a|m4v|mkv|png|jpe?g|gif|webp|avif|bmp|ico|svg|tiff?|heic)$/i,Be=e=>{location.href=e};Ei="_top";uo=new Set;Fn="webjs:nav-fallback",ui=!1;fo=!1;Ul=16,W=new Map;Kl=8,Ni=3e4,Ti=3,zl=24,Yl=100,Gl=250,$=new Map,De=new Set,pt=[],Kt=new Set,ht=null,zt=null,Se=null,ft=new WeakMap,Yt=new Set;Un=new WeakMap;Wn=new WeakMap;Gt=new WeakSet;Pn=Promise.resolve();mo=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);bo="name=csp-nonce";(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&wo()});function nr(e,...t){return{_$webjs:"template",strings:e,values:t}}function B(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var F="wjm-";function Xi(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 qe(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function rr(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 Xt(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
|
|
5
|
+
`)}</style>`}var He=Object.freeze({"@":"event",".":"prop","?":"bool"});function _t(e){return Object.prototype.hasOwnProperty.call(He,e)}function Zt(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function H(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}var R="__webjs_action",Do="$$webjsAction",or=null;function Zi(e){or=e}function St(e){if(typeof e!="function")return null;let t=e[Do];return typeof t=="string"&&t?t:null}async function At(e){let t=St(e);if(t)return t;if(typeof e!="function"||!or)return null;try{let n=await or(e);return typeof n=="string"&&n?n:null}catch{return null}}function Ue(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 We(e,t,n=!0){if(!e||e===R&&n)return;let r=e===R?'a second "name" attribute':`name="${e}"`;throw new Error(`[webjs] formaction=\${action} on <${t||"button"}> cannot be used when the element already carries a "name" attribute (found ${r}). The action identity is submitted as the button's own name/value pair, so there is no room for a second one. Move the action to the enclosing <form action=\${action}> or drop the submitter's "name".`)}function sr(e,t){let n=String(e||"").toLowerCase(),r=t==null?null:String(t).toLowerCase();if(Qt(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 Qt(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 Ve(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 ir(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 Ke(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 ze(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 Et(e,t){if(!e)throw new Error(`[webjs] formaction=\${action} on <${t||"button"}> requires the enclosing <form> to also be bound to a server action (e.g. <form action=\${formAction}>). The enclosing <form> must carry an action binding so method="post" and the enctype are set at form start, which is too late to add from the button.`)}function ar(e,t,n){let o=(e||[]).filter(s=>n?Ye(s):/^form(action|method|enctype)$/i.test(String(s)))[0];if(o)throw new Error(`[webjs] a <${t||"button"}> submitter binds .${o}=. That property is a reflected IDL attribute on a submitter, so a property binding is dropped at SSR and written to the attribute in the browser: the page would render on the server and throw on hydration. Write it as a plain attribute.`)}function Ye(e){let t=String(e).toLowerCase();return t==="name"||t==="value"||t==="formaction"||t==="formmethod"||t==="formenctype"}function en(e,t,n,r){let o=!!(r&&r.bound),s=!!(r&&r.retargeted),i=t==null?null:String(t),a=n==null?null:String(n);if(i!=null&&/^dialog$/i.test(i)){if(!o)return;throw new Error(`[webjs] formaction=\${action} on <${e}> cannot be combined with formmethod="dialog", which dismisses a <dialog> instead of submitting, so the bound action would never run. Drop one of the two.`)}if(!s){if(i!=null&&!/^post$/i.test(i))throw new Error(`[webjs] <${e} formmethod="${i}"> inside a bound <form action=\${action}> cannot work: a bound server action is submitted as a POST body, and a "${i}" submission sends none, so the action would never run. Drop the formmethod attribute, or point the button elsewhere with a plain formaction="/url".`);if(a!=null&&!Bo.has(a.toLowerCase()))throw new Error(`[webjs] <${e} formenctype="${a}"> inside a bound <form action=\${action}> cannot work: a form submission is parsed as multipart/form-data or application/x-www-form-urlencoded, and a "${a}" body is neither, so the submission would run under JS and 405 without it. Drop the formenctype attribute (WebJs emits multipart/form-data on the form).`)}}function G(e,t,n){if(tn(e)&&oa(t))throw new Error(sa(t,n))}function vt(e,t,n){ra(t,n)&&G(e,t,n)}function pe(e,t){if(e)return e;let n=t==="button"||t==="input"?"formaction=":"action=";throw new Error(`[webjs] the function in ${n} on <${t||"form"}> is not a server action. Only a function imported from a 'use server' *.server.{js,ts} module can be bound to a form or a submitter, because the identity the browser submits has to resolve back to something the server can run. Move the handler into a server action and import it, or pass a url string.`)}var Bo=new Set(["multipart/form-data","application/x-www-form-urlencoded"]);function Qi(e,t){if(e!=null&&!/^post$/i.test(e))throw new Error(`[webjs] <form method="${e}" action=\${action}> cannot work: a bound server action is submitted as a POST body, and a "${e}" form sends no body. Drop the method attribute (WebJs emits method="post") or remove the bound action.`);if(t!=null&&!Bo.has(t.toLowerCase()))throw new Error(`[webjs] <form enctype="${t}" action=\${action}> cannot work: a form submission is parsed as multipart/form-data or application/x-www-form-urlencoded, and a "${t}" body is neither, so the submission would run under JS and do nothing without it. Drop the enctype attribute (WebJs emits multipart/form-data).`)}function cr(e,t){let n=kt(e);xt({staticAction:n.has("action")});let r=qo(n.has("method")?n.get("method"):Q,n.has("enctype")?n.get("enctype"):Q),o=e.endsWith("/>")?"/>":">",s=e.slice(0,e.length-o.length),i="";return r.method!==null&&(i+=` method="${r.method}"`),r.enctype!==null&&(i+=` enctype="${r.enctype}"`),{tag:s+i+o,hidden:ea(t)}}function xt(e){if(e.duplicateAction)throw new Error("[webjs] two action=${...} holes were found on one <form>. A form can carry only one action binding. Move one to a submit button's formaction=${action} or remove the duplicate.");if(e.staticAction)throw new Error('[webjs] a bound <form action=${action}> also carries a plain action="..." attribute. A bound form posts to the page\'s own url, so the two say different things: without JS the browser would post to the written url and with JS it would not. Drop the action attribute, or drop the binding.');let t=e.propAttrs&&e.propAttrs[0];if(t)throw new Error(`[webjs] a bound <form action=\${action}> also binds .${t}=. A property binding on a native element is dropped at SSR and applied in the browser, so the form would submit one way with JS and another way without it. Write it as a plain attribute.`)}var Q=Symbol("webjs.attr.absent");function qo(e,t){let n=e!==Q&&e!=null,r=t!==Q&&t!=null;return Qi(n?e:null,r?t:null),{method:n?null:"post",enctype:r?null:"multipart/form-data"}}function ea(e){return`<input type="hidden" name="${R}" value="${H(e)}">`}function Ho(e,t,n,r,o){let s=typeof t=="function"?St(t):null;if(!s){typeof t=="function"&&pe(null,e.localName),na(e,n,r,o.propAttrs);return}xt(o);let i=qo(n,r);e.removeAttribute("action"),Mo(e,"method",n,i.method),Mo(e,"enctype",r,i.enctype),ta(e,s)}function Mo(e,t,n,r){if(r!==null){e.setAttribute(t,r);return}n!==Q&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function ta(e,t){let n=e.firstElementChild,r=n&&n.localName==="input"&&n.getAttribute("name")===R?n:null;if(!r){for(let o of e.children)if(o.localName==="input"&&o.getAttribute("name")===R){r=o;break}}r||(r=e.ownerDocument.createElement("input"),r.setAttribute("type","hidden"),r.setAttribute("name",R),e.insertBefore(r,e.firstChild)),r.getAttribute("value")!==t&&r.setAttribute("value",t)}function Ct(e,t,n){let r=!!n.bound,o=kt(e),s=o.has("type")?o.get("type"):null;if((r||Qt(t,s))&&ar(n.propAttrs,t,r),r)ze(!!n.duplicateAction,t),o.has("formaction")&&ir(t),Fo(e,"value")>1&&Ve(t),Fo(e,"name")>1&&We(o.get("name")||R,t,!1),sr(t,s),o.has("form")&&Ke(t);else if(!Qt(t,s))return;let i=o.has("formmethod")?o.get("formmethod"):null,a=o.has("formenctype")?o.get("formenctype"):null;i==null&&a==null||en(t,i,a,{bound:r,retargeted:!r&&o.has("formaction")})}function Uo(e){for(let t of e.querySelectorAll("button, input")){let n=t.localName;if(!Qt(n,t.getAttribute("type")))continue;let r=t.getAttribute("formmethod"),o=t.getAttribute("formenctype");r==null&&o==null||en(n,r,o,{bound:t.getAttribute("name")===R,retargeted:t.hasAttribute("formaction")})}}function na(e,t,n,r){let o=e.firstElementChild;if(o&&o.localName==="input"&&o.getAttribute("name")===R)o.remove();else for(let i of e.children)if(i.localName==="input"&&i.getAttribute("name")===R){i.remove();break}let s=i=>(r||[]).some(a=>{let c=String(a).toLowerCase();return c===i||i==="enctype"&&c==="encoding"});t===Q&&!s("method")&&e.removeAttribute("method"),n===Q&&!s("enctype")&&e.removeAttribute("enctype")}function kt(e){return new Map(Wo(e))}function Wo(e){let t=[],n=1;for(;n<e.length&&!/[\s/>]/.test(e[n]);)n++;for(;n<e.length;){for(;n<e.length&&/[\s/]/.test(e[n]);)n++;if(n>=e.length||e[n]===">")break;let r="";for(;n<e.length&&!/[\s/>=]/.test(e[n]);)r+=e[n++];for(;n<e.length&&/\s/.test(e[n]);)n++;if(e[n]!=="="){r&&t.push([r.toLowerCase(),""]);continue}for(n++;n<e.length&&/\s/.test(e[n]);)n++;let o="",s=e[n];if(s==='"'||s==="'"){for(n++;n<e.length&&e[n]!==s;)o+=e[n++];n++}else for(;n<e.length&&!/[\s>]/.test(e[n]);)o+=e[n++];r&&t.push([r.toLowerCase(),o])}return t}function Fo(e,t){let n=String(t).toLowerCase();return Wo(e).filter(([r])=>r===n).length}function ra(e,t){let n=String(e).toLowerCase();_t(n[0])&&(n=n.slice(1));let r=String(t||"").toLowerCase();return n==="action"?r==="form":n==="formaction"?r==="button"||r==="input":!1}function tn(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=>tn(r,n)))}function oa(e){let t=String(e).toLowerCase();return _t(t[0])&&(t=t.slice(1)),t==="action"||t==="formaction"}function sa(e,t){return`[webjs] a function was interpolated into ${String(e).toLowerCase()}= on <${t||"form"}>. Stringifying a function into HTML would leak its source (a 'use server' action's body included) to every visitor, so this is refused. To run a server action from a form, write an unquoted action=\${action} on the <form> itself or a formaction=\${action} on a <button> inside a bound form. Anywhere else, pass a URL string.`}var Vo=Symbol.for("webjs.repeat");function Ko(e,t,n){return{[Vo]:!0,items:[...e],keyFn:t,templateFn:n}}function ve(e){return!!e&&typeof e=="object"&&e[Vo]===!0}function lr(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function Ge(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function ia(e){return{_$webjs:"live",value:e}}function xe(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function aa(e,t){return{_$webjs:"keyed",key:e,value:t}}function Ce(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function ca(e,t){return{_$webjs:"guard",deps:e,fn:t}}function ke(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function la(e){return{_$webjs:"template-content",template:e}}function Je(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function ua(e){return{_$webjs:"ref",target:e}}function Ne(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function fa(){return{value:void 0}}function da(e){return{_$webjs:"cache",value:e}}function Te(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function pa(...e){return{_$webjs:"until",args:e}}function je(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function ha(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function Xe(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function ma(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Ze(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function ba(e){return{_$webjs:"watch",signal:e}}function Re(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var X=null,he=!1,et=0,Qe=null,ur=0,zo=(e,t)=>Object.is(e,t),rn=()=>{},Yo=()=>!1;function Go(e,t){e.liveConsumers||(e.liveConsumers=new Set);let n=e.liveConsumers.size===0;if(e.liveConsumers.add(t),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)Go(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function Nt(e,t){if(e.liveConsumers&&(e.liveConsumers.delete(t),e.liveConsumers.size===0)){if(e.producers&&e.producers.length>0)for(let n of e.producers)Nt(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function br(e){if(he)throw new Error("Signal read during notification phase");if(X===null)return;let t=X,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&pr(t)&&Nt(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,pr(t)&&Go(e,t)),t.producerLastReadVersions[n]=e.version}function pr(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Jo(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=he;he=!0;try{for(let n of e.liveConsumers)n.dirty||ga(n)}finally{he=t}}function ga(e){e.dirty=!0,Jo(e),e.consumerMarkedDirty.call(e.wrapper||e)}function on(e){if(!(!e.dirty&&e.lastCleanEpoch===et)){if(!e.producerMustRecompute()&&!ya(e)){e.dirty=!1,e.lastCleanEpoch=et;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=et}}function ya(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(on(n),r!==n.version))return!0}return!1}function hr(e){e&&(e.nextProducerIndex=0);let t=X;return X=e,t}function mr(e,t){if(X=t,!!e){if(pr(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)Nt(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var sn=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=et,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=Yo,this.producerRecomputeValue=rn,this.consumerMarkedDirty=rn,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||zo,this.watched=n?.[gr],this.unwatched=n?.[yr]}get(){return br(this),this.__value}peek(){return this.__value}set(t){if(he)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,et++,Qe!==null?Xo(this):Jo(this))}};function Xo(e){let t=he;he=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?Qe.add(n):Xo(n))}finally{he=t}}var fr=Symbol("unset"),dr=Symbol("computing"),nn=Symbol("errored"),Tt=class{constructor(t,n){this.__fn=t,this.__value=fr,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||zo,this.watched=n?.[gr],this.unwatched=n?.[yr];let r=this;this.producerMustRecompute=function(){return r.__value===fr||r.__value===dr},this.producerRecomputeValue=function(){if(r.__value===dr)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=dr;let s=hr(r),i,a=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=nn,r.__error=l,a=!0}finally{mr(r,s)}if(!a&&(o!==fr&&o!==nn)&&r.__equal.call(r.wrapper,o,i)){r.__value=o;return}r.__value=i,r.version++},this.consumerMarkedDirty=rn}get(){if(on(this),br(this),this.__value===nn)throw this.__error;return this.__value}peek(){if(on(this),this.__value===nn)throw this.__error;return this.__value}},an=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=et,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=Yo,this.producerRecomputeValue=rn,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=hr(this);try{for(let r of t)br(r),r.__isComputed&&on(r)}finally{mr(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(Nt(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=hr(this),r;try{r=t()}finally{mr(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)Nt(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},gr=Symbol("watched"),yr=Symbol("unwatched");function wa(e){let t=X;X=null;try{return e()}finally{X=t}}function _a(e){return e.producers.slice()}function Sa(e){return e.liveConsumers?[...e.liveConsumers]:[]}function Aa(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function Ea(e){return e.producers.length>0}function va(){return X&&X.__isComputed?X:null}function xa(e){ur++,Qe===null&&(Qe=new Set);try{e()}finally{if(ur--,ur===0){let t=Qe;Qe=null;for(let n of t)n.__fire()}}}var jt={State:sn,Computed:Tt,subtle:{Watcher:an,untrack:wa,introspectSources:_a,introspectSinks:Sa,hasSinks:Aa,hasSources:Ea,currentComputed:va,watched:gr,unwatched:yr}};function Ca(e,t){return new sn(e,t)}function ka(e,t){return new Tt(e,t)}function Na(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function Ta(e){let t=!1,n=!1,r=new Tt(e),o=new an(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(s){console.error(s)}o.watch()}}))});o.watch(r);try{r.get()}catch(s){console.error(s)}return()=>{n||(n=!0,o.dispose())}}mn();function As(e,t){let n=e&&e[P]?e:null;return n?dn(n,t):t()}var $r=new WeakMap,Ir=new WeakMap,yn=new WeakMap,bn=Symbol.for("webjs.instance"),V=null;function wn(e){return e?e.nodeType===11&&e.host?e.host:e:null}function Mr(e,t){let n=e.__commitOwner,r=V;n&&(V=n);try{t()}finally{V=r}}function it(e,t){let n=t,r=n[U];n[U]=!0;let o=V;V=t;try{let s=n[bn];if(B(e)){let i=e;if(s&&s.strings===i.strings){ot(s,i.values);return}s&&_s(s,t);let a=t.firstChild;a&&a.nodeType===8&&a.data==="webjs-hydrate"&&a.remove(),n[bn]=null;let c=Za(i,t);n[bn]=c;return}if(s&&_s(s,t),n[bn]=null,t.replaceChildren(),e==null||e===!1||e===!0)return;if(Array.isArray(e)){for(let i of e){let a=document.createTextNode(String(i??""));t.appendChild(a)}return}t.appendChild(document.createTextNode(String(e)))}finally{V=o,n[U]=r,r||Or(n)}}function _n(e){let{strings:t}=e,n=$r.get(t);if(n)return n;let r=[],o="",s="text",i="",a=0,c="",l=0,f=null,u="",h="";for(let w=0;w<t.length;w++){let A=t[w];for(let S=0;S<A.length;S++){let b=A[S];switch(s){case"text":o+=b,b==="<"&&(s="tag-open");break;case"tag-open":o+=b,b==="!"?s="bang-1":b==="/"?(s="tag-name",u=""):/[a-zA-Z]/.test(b)?(s="tag-name",u=b.toLowerCase()):s="text";break;case"bang-1":o+=b,s=b==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=b,b==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=b,b==="-"?l+=1:(b===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=b,b===">"?(s=u==="script"||u==="style"?"rawtext":"text",s==="rawtext"&&(h="")):/\s/.test(b)?s="in-tag":u+=b.toLowerCase();break;case"in-tag":o+=b,b===">"?(s=u==="script"||u==="style"?"rawtext":"text",s==="rawtext"&&(h="")):!/\s/.test(b)&&b!=="/"&&(s="attr-name",i=b,a=o.length-1);break;case"rawtext":o+=b,h=(h+b.toLowerCase()).slice(-9),(h.endsWith("<\/script>")||h.endsWith("</style>"))&&(s="text",h="",u="");break;case"attr-name":b==="="?(s="after-eq",o+=b):/\s/.test(b)?(s="in-tag",i="",o+=b):b===">"?(s="text",i="",o+=b):(i+=b,o+=b);break;case"after-eq":b==='"'||b==="'"?(s="attr-quoted",c=b,o+=b):/\s/.test(b)?(s="in-tag",i="",o+=b):b===">"?(s="text",i="",o+=b):(s="attr-unquoted",o+=b);break;case"attr-unquoted":/\s/.test(b)?(s="in-tag",i="",o+=b):(b===">"&&(s="text",i=""),o+=b);break;case"attr-quoted":o+=b,b===c&&(s="in-tag",i="");break;case"skip-attr":if(b===c){if(f){let x=f.firstPartIdx,y=[];for(let v=x;v<r.length;v++)(r[v].kind==="noop"||r[v].kind==="attr-mixed")&&y.push(v);let E=[],j=t[y[0]],I=j.lastIndexOf(c);E.push(I>=0?j.slice(I+1):j);for(let v=1;v<y.length;v++)E.push(t[y[v]]);let C=t[y[y.length-1]+1],k=C.indexOf(c);E.push(k>=0?C.slice(0,k):C),r[x]={kind:"attr-mixed",path:[],name:f.name,statics:E,group:y};for(let v=1;v<y.length;v++)r[y[v]]={kind:"noop",path:[],mixedAnchor:x};f=null}s="in-tag",i=""}break}}if(w<t.length-1){let S=r.length;if(s==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(s==="rawtext"){h="",r.push({kind:"noop",path:[]});continue}if(s==="text")o+=`<!--${F}${S}-->`,r.push({kind:"child",path:[]});else if(s==="in-tag"){let b=`data-${F}${S}`;o+=`${b}=""`,r.push({kind:"element",path:[]})}else if(s==="after-eq"){let b=i[0],x=i.slice(1);if(_t(b)){o=o.slice(0,a);let y=He[b],E=`data-${F}${S}`;o+=`${E}=""`,r.push({kind:y,path:[],name:x})}else{o=o.slice(0,a);let y=`data-${F}${S}`;o+=`${y}=""`,r.push({kind:"attr",path:[],name:i})}s="in-tag",i=""}else if(s==="attr-quoted"||s==="attr-unquoted"){o=o.slice(0,a);let b=`data-${F}${S}`;o+=`${b}=""`,f={name:i,firstPartIdx:S},r.push({kind:"noop",path:[]}),s="skip-attr"}else s==="skip-attr"&&r.push({kind:"noop",path:[]})}}let d=document.createElement("template");d.innerHTML=o,Ka(d.content,r);let p=za(d.content,r);return n={templateEl:d,parts:r,formActions:p},$r.set(t,n),n}function Ka(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(D,"");let o=t.length;r.setAttribute(`data-${F}${o}`,""),t.push({kind:"slot",path:[]})}}function za(e,t){let n=[],r=[];function o(s){for(let i=0;i<s.childNodes.length;i++){let a=s.childNodes[i];if(n.push(i),a.nodeType===8){let c=a.data;if(c.startsWith(F)){let l=Number(c.slice(F.length));t[l]&&t[l].kind==="child"&&(t[l].path=n.slice())}}else if(a.nodeType===1){let c=a,l=[],f=[];for(let u of c.attributes)if(u.name.startsWith(`data-${F}`)){let h=Number(u.name.slice(`data-${F}`.length));t[h]&&t[h].kind!=="child"&&(t[h].path=n.slice(),f.push({idx:h,kind:t[h].kind,name:t[h].name||""})),l.push(u.name)}if(c.localName==="form"||c.localName==="button"||c.localName==="input"){let u=Ya(c,f,t);u&&r.push(u)}for(let u of l)c.removeAttribute(u);o(a)}n.pop()}}return o(e),r.length?r:null}function Ya(e,t,n){let r=e.localName==="form",o=r?"action":"formaction",s=t.filter(p=>p.kind==="attr"&&p.name.toLowerCase()===o);if(!s.length)return null;let i=[],a=[],c=[],l=r?[]:t.filter(p=>p.name.toLowerCase()==="name"&&(p.kind==="attr"||p.kind==="attr-mixed"||p.kind==="bool")).map(p=>({i:p.idx,kind:p.kind})),f=!r&&e.hasAttribute("name"),u=!r&&e.hasAttribute("form"),h=!r&&e.hasAttribute("value"),d=r?[]:t.filter(p=>p.name.toLowerCase()==="value"&&(p.kind==="attr"||p.kind==="attr-mixed"||p.kind==="bool")).map(p=>({i:p.idx,kind:p.kind}));for(let p of t){let w=String(p.name).toLowerCase();if(p.kind==="prop"){r?(w==="method"||w==="enctype"||w==="encoding")&&c.push(p.name):Ye(w)&&c.push(p.name);continue}if(w!=="method"&&w!=="enctype"||p.kind!=="attr"&&p.kind!=="attr-mixed"&&p.kind!=="bool")continue;let A=n[p.idx],S={i:p.idx,kind:p.kind};p.kind==="attr-mixed"&&(S.statics=A.statics||[],S.group=A.group||[]),(w==="method"?i:a).push(S)}return{isForm:r,tag:e.localName,actionIdxs:s.map(p=>p.idx),duplicateAction:s.length>1,staticAction:e.getAttribute(o)!=null,authoredName:f,authoredValue:h,authoredForm:u,propAttrs:c,nameParts:l,valueParts:d,staticMethod:e.getAttribute("method"),staticEnctype:e.getAttribute("enctype"),methodParts:i,enctypeParts:a}}function It(e,t,n){if(!e)return;let r=[];for(let o of[!0,!1])for(let s of e){if(s.isForm!==o)continue;let i=s.actionIdxs[0],a=s.isForm?"action":"formaction";for(let f of s.actionIdxs)if(Ue(Pe(n[f]),a,s.tag)){i=f;break}let c=t[i];if(!c||!c.el)continue;let l=Pe(n[i]);if(s.isForm)Ho(c.el,l,Ss(s.methodParts,s.staticMethod,n),Ss(s.enctypeParts,s.staticEnctype,n),s),typeof l=="function"&&St(l)&&r.push(c.el);else{let f=u=>u.some(h=>h.kind==="bool"?!!Pe(n[h.i]):!0);Xa(c.el,l,s,f(s.nameParts),f(s.valueParts))}}for(let o of r)Uo(o)}function Ga(e){(yn.has(e)||e.getAttribute("name")===R)&&(e.getAttribute("name")===R&&e.removeAttribute("name"),e.removeAttribute("value"),yn.delete(e))}function Ja(e){let t=e.parentNode;for(;t;){if(t.nodeType===1&&t.localName==="form")return t;t=t.parentNode}return null}function Xa(e,t,n,r,o){let s=typeof t=="function"?St(t):null;if(!s){typeof t=="function"&&pe(null,e.localName),Ga(e);return}ze(n.duplicateAction,e.localName),ar(n.propAttrs,e.localName,!0),n.staticAction&&ir(e.localName),(n.authoredValue||o)&&Ve(e.localName),(n.authoredName||r)&&We(e.getAttribute("name")||R,e.localName,!1),(n.authoredForm||e.hasAttribute("form"))&&Ke(e.localName),sr(e.localName,e.getAttribute("type"));let i=Ja(e);if(i&&!yn.has(e)){let a=!!(i.querySelector(`input[name="${R}"]`)||Ir.has(i));Et(a,e.localName)}en(e.localName,e.getAttribute("formmethod"),e.getAttribute("formenctype"),{bound:!0}),e.removeAttribute("formaction"),e.setAttribute("name",R),e.setAttribute("value",s),yn.set(e,s)}function Za(e,t){let{templateEl:n,parts:r,formActions:o}=_n(e),s=n.content.cloneNode(!0),i=document.createComment(`${F}s`),a=document.createComment(`${F}e`),c=r.map(u=>Sn(u,s)),l=[];for(let u=0;u<e.values.length;u++)ne(c[u],e.values[u],void 0,e.values),l.push(e.values[u]);It(o,c,e.values),t.replaceChildren(i,...s.childNodes,a);let f=t.nodeType===1&&t[P]?t:null;for(let u of c)u.kind==="slot"&&(f&&u.slotEl&&(u.slotEl[fn]=f),ne(u,void 0,void 0,[]));return{strings:e.strings,bound:c,lastValues:l,startNode:i,endNode:a}}function Sn(e,t){if(e.kind==="noop")return{kind:"noop",mixedAnchor:e.mixedAnchor};let n=t;for(let o of e.path)n=n.childNodes[o];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let o={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(s){o.handler?.(s)}};return r.addEventListener(o.name,o.dispatcher),o}if(e.kind==="attr")return{kind:"attr",el:r,name:e.name||""};if(e.kind==="attr-mixed")return{kind:"attr-mixed",el:r,name:e.name||"",statics:e.statics||[],group:e.group||[]};if(e.kind==="prop")return{kind:"prop",el:r,name:e.name||""};if(e.kind==="bool")return{kind:"bool",el:r,name:e.name||""};if(e.kind==="element")return{kind:"element",el:r};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}var ws=Symbol("webjs.commitFailed");function ot(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(Object.is(r,e.lastValues[n]))continue;let o=e.bound[n],s=o.mixedAnchor;try{o.kind==="noop"&&s!=null?ne(e.bound[s],t[s],e.lastValues[s],t):ne(o,r,e.lastValues[n],t)}catch(i){throw e.lastValues[n]=ws,o.kind==="noop"&&s!=null&&(e.lastValues[s]=ws),i}e.lastValues[n]=r}It($r.get(e.strings)?.formActions??null,e.bound,t)}function _s(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=Ot(n.slotEl);r&&ys(r,n.slotEl)}}t.replaceChildren()}function Ss(e,t,n){for(let r of e){if(r.kind==="bool")return Pe(n[r.i])?"":Q;if(r.kind==="attr"){let a=Pe(n[r.i]);return a==null?"":String(a)}let o=r.statics||[],s=r.group||[],i=o[0]||"";for(let a=0;a<s.length;a++)i+=String(Pe(n[s[a]])??""),i+=o[a+1]||"";return i}return t??Q}function Pe(e){return xe(e)?e.value:e}function ne(e,t,n,r){if(xe(t)){let o=t.value;if(e.kind==="prop"&&e.el[e.name]===o||e.kind==="attr"&&e.el.getAttribute(e.name)===String(o)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!o)return;t=o}switch(e.kind){case"child":tc(e,t);break;case"attr":{if(e.el.localName==="form"&&e.name.toLowerCase()==="action"){let o=Pe(t);typeof o=="function"?Ir.set(e.el,o):Ir.delete(e.el)}t==null||t===!1?e.el.removeAttribute(e.name):Ue(t,e.name,e.el.localName)||(G(t,e.name,e.el.localName),e.el.setAttribute(e.name,String(t)));break}case"prop":vt(t,e.name,e.el.localName),e.el[e.name]=t;break;case"bool":G(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":ec(e,t);break;case"attr-mixed":{let o=e,s=o.statics[0];for(let i=0;i<o.group.length;i++){let a=r?r[o.group[i]]:t;G(a,e.name,e.el.localName),s+=String(a??""),s+=o.statics[i+1]||""}e.el.setAttribute(e.name,s);break}case"slot":{if(e.applied)break;let o=e.slotEl,s=()=>{let a=Ot(o);if(!a){e.applied=!0;return}if(!a.contains(o)){a.isConnected?queueMicrotask(s):e.applied=!0;return}if(e.applied=!0,Qa(o))return;let c=document.createDocumentFragment();for(;o.firstChild;)c.appendChild(o.firstChild);o[Lt]=c,queueMicrotask(()=>le(a))},i=Ot(o);i&&i.contains(o)?s():queueMicrotask(s);break}case"noop":break}}function Ot(e){let t=e[fn];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[P])return n;n=n.parentElement}return null}function Qa(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 ec(e,t){let n=e,r=Ne(t)?t.target:void 0,o=n.__refTarget,s=r!==o;if(s&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(s||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!s&&n.__refElement!==void 0)try{r(void 0)}catch{}try{r(e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function tc(e,t){return fc(e,t),te(e,t)}function te(e,t){return As(e.marker&&e.marker.parentNode,()=>nc(e,t))}function nc(e,t){let n=e.marker;if(Ge(t)){ge(e);let o=String(t.value??""),s=document.createElement("template");s.innerHTML=o;let i=[...s.content.childNodes],a=document.createDocumentFragment();for(let c of i)a.appendChild(c);n.parentNode?.insertBefore(a,n),e.child=i;return}if(Ce(t)){let o=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,o.key)&&ge(e),e.__keyedKey=o.key,te(e,o.value);return}if(ke(t)){let o=t,s=e.__guardDeps,i=o.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(i)?uc(s,i):Object.is(s,i)))return;let a=Array.isArray(i)?i.slice():i;te(e,o.fn()),e.__guardDeps=a;return}if(Je(t)){ge(e);let o=t.template;if(o&&o.content){let s=o.content.cloneNode(!0),i=[...s.childNodes];n.parentNode?.insertBefore(s,n),e.child=i}return}if(Ne(t))return;if(Te(t))return dc(e,t.value);if(je(t))return pc(e,t.args);if(Re(t))return hc(e,t.signal);if(Xe(t))return mc(e,t);if(Ze(t))return bc(e,t);if(ve(t)){if(e.child&&e.child.kind==="repeat"){sc(e,t);return}ge(e);let o={kind:"repeat",map:new Map};e.child=o,oc(n,o,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){cc(e,t);return}ge(e);let o={kind:"array",items:[]};e.child=o,ac(n,o,t);return}if(e.child){let o=e.child;if(o.kind==="repeat")Es(o),e.child=void 0;else if(o.kind==="array")xs(o),e.child=void 0;else if(o.kind==="async-stream")Ts(o),e.child=void 0;else if("strings"in e.child){let s=e.child;if(B(t)&&s.strings===t.strings){ot(s,t.values);return}st(s.startNode,s.endNode),e.child=void 0}else{for(let s of e.child)s.parentNode&&s.parentNode.removeChild(s);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(B(t)){let o=t,{templateEl:s,parts:i,formActions:a}=_n(o),c=s.content.cloneNode(!0),l=document.createComment(`${F}s`),f=document.createComment(`${F}e`),u=i.map(p=>Sn(p,c)),h=[];for(let p=0;p<o.values.length;p++)ne(u[p],o.values[p],void 0,o.values),h.push(o.values[p]);It(a,u,o.values);let d=[l,...c.childNodes,f];n.parentNode?.insertBefore(rc(d),n);for(let p of u)p.kind==="slot"&&ne(p,void 0,void 0,[]);e.child={strings:o.strings,bound:u,lastValues:h,startNode:l,endNode:f};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function rc(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function st(e,t){if(!e.parentNode)return;let n=e;for(;n&&n!==t;){let r=n.nextSibling;n.parentNode?.removeChild(n),n=r}t.parentNode===e.parentNode&&t.parentNode?.removeChild(t)}function Fr(e){let{templateEl:t,parts:n,formActions:r}=_n(e),o=t.content.cloneNode(!0),s=document.createComment(`${F}s`),i=document.createComment(`${F}e`),a=n.map(f=>Sn(f,o)),c=[];for(let f=0;f<e.values.length;f++)ne(a[f],e.values[f],void 0,e.values),c.push(e.values[f]);It(r,a,e.values);for(let f of a)f.kind==="slot"&&ne(f,void 0,void 0,[]);let l=document.createDocumentFragment();for(l.appendChild(s);o.firstChild;)l.appendChild(o.firstChild);return l.appendChild(i),{inst:{strings:e.strings,bound:a,lastValues:c,startNode:s,endNode:i},frag:l}}function $t(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 oc(e,t,n){let{items:r,keyFn:o,templateFn:s}=n,i=e.parentNode;if(!i)return;let a=document.createDocumentFragment();for(let c=0;c<r.length;c++){let l=o(r[c],c),f=s(r[c],c);if(!B(f))continue;let{inst:u,frag:h}=Fr(f);t.map.set(l,u),a.appendChild(h)}i.insertBefore(a,e)}function sc(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,{items:s,keyFn:i,templateFn:a}=t,c=new Map;try{for(let l=0;l<s.length;l++){let f=i(s[l],l),u=a(s[l],l);if(!B(u))continue;let h=o.map.get(f);if(h&&h.strings===u.strings)ot(h,u.values),Pr(h.startNode,h.endNode,r,n),c.set(f,h),o.map.delete(f);else{h&&(o.map.delete(f),$t(h),st(h.startNode,h.endNode));let{inst:d,frag:p}=Fr(u);r.insertBefore(p,n),c.set(f,d)}}for(let[l,f]of[...o.map]){o.map.delete(l);try{$t(f)}finally{st(f.startNode,f.endNode)}}o.map=c}catch(l){for(let[f,u]of c)o.map.set(f,u);throw l}}function Es(e){for(let[t,n]of[...e.map]){e.map.delete(t);try{$t(n)}finally{st(n.startNode,n.endNode)}}e.map.clear()}function ic(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function gn(e){e.type==="tpl"?($t(e.inst),st(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function vs(e){if(B(e)){let{inst:t,frag:n}=Fr(e);return{item:{type:"tpl",inst:t},frag:n}}if(e!=null&&e!==!1&&e!==!0){let t=document.createTextNode(String(e));return{item:{type:"text",node:t},frag:t}}return{item:{type:"empty"},frag:null}}function ac(e,t,n){let r=e.parentNode;if(!r)return;let o=document.createDocumentFragment(),s=[];for(let i of n){let{item:a,frag:c}=vs(i);c&&o.appendChild(c),s.push(a)}r.insertBefore(o,e),t.items=s}function cc(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,s=o.items,i=[],a=0;try{for(let c=0;c<t.length;c++){let l=t[c],f=s[c];if(B(l)){let d=l;if(f&&f.type==="tpl"&&f.inst.strings===d.strings){ot(f.inst,d.values),i.push(f),a=c+1;continue}}else if(l!=null&&l!==!1&&l!==!0){if(f&&f.type==="text"){let d=String(l);f.node.data!==d&&(f.node.data=d),i.push(f),a=c+1;continue}}else{f&&gn(f),i.push({type:"empty"}),a=c+1;continue}let{item:u,frag:h}=vs(l);h&&r.insertBefore(h,lc(s,c,n)),i.push(u),f&&gn(f),a=c+1}for(let c=t.length;c<s.length;c++)gn(s[c]),a=c+1;o.items=i}catch(c){throw o.items=i.concat(s.slice(a)),c}}function lc(e,t,n){for(let r=t;r<e.length;r++){let o=ic(e[r]);if(o&&o.parentNode)return o}return n}function xs(e){for(let t of e.items)gn(t);e.items=[]}function Pr(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),s=e;for(;s;){let i=s.nextSibling;if(o.appendChild(s),s===t)break;s=i}n.insertBefore(o,r)}function uc(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 ge(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Cs(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Es(n);else if(n.kind==="array")xs(n);else if(n.kind==="async-stream")Ts(n);else if("strings"in n){let r=e.child;$t(r),st(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function fc(e,t){let n=e;n.__untilState&&!je(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!ke(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!Te(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!Ce(t)&&(n.__keyedKey=void 0),n.__watchSub&&!Re(t)&&Cs(n)}function dc(e,t){let n=e.marker,r=e,o=r.__cacheMap;o||(o=new Map,r.__cacheMap=o);let s=e.child;if(s&&"strings"in s){let a=s;if(B(t)&&a.strings===t.strings){ot(a,t.values);return}let c=document.createDocumentFragment();Pr(a.startNode,a.endNode,c,null),o.set(a.strings,{inst:a,holder:c}),e.child=void 0}if(B(t)){let a=t,c=o.get(a.strings);if(c){o.delete(a.strings),e.child&&ge(e),Pr(c.inst.startNode,c.inst.endNode,n.parentNode,n),ot(c.inst,a.values),e.child=c.inst;let l=new Set;for(let f=c.inst.startNode.nextSibling;f&&f!==c.inst.endNode;f=f.nextSibling){if(f.nodeType!==1)continue;let u=f;if(u.matches("slot[data-webjs-light]")){let h=Ot(u);h&&l.add(h)}for(let h of u.querySelectorAll("slot[data-webjs-light]")){let d=Ot(h);d&&l.add(d)}}for(let f of l)le(f);return}}te(e,t)}function pc(e,t){let n=e;V&&(n.__commitOwner=wn(V));let r=n.__untilState,o=n.__untilArgs,s=(h,d)=>!!(Object.is(h,d)||B(h)&&B(d)&&h.strings===d.strings),a=o&&o.length===t.length&&o.every((h,d)=>s(h,t[d]))&&r?r.highestResolved:1/0;r&&(r.aborted=!0),n.__untilArgs=t.slice();let c={aborted:!1,highestResolved:a};n.__untilState=c;let l=-1,f;for(let h=0;h<t.length;h++){let d=t[h];if(!d||typeof d.then!="function"){l=h,f=d;break}}l!==-1&&l<=c.highestResolved?(te(e,f),c.highestResolved=l):l===-1&&!n.__untilEverRendered&&te(e,""),n.__untilEverRendered=!0;let u=Math.min(l===-1?t.length:l,c.highestResolved);for(let h=0;h<u;h++){let d=t[h];!d||typeof d.then!="function"||Promise.resolve(d).then(p=>{if(!c.aborted&&!(h>=c.highestResolved)){try{Mr(e,()=>te(e,p))}catch(w){Dr(e,w);return}c.highestResolved=h}},()=>{})}}function Dr(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 hc(e,t){let n=e;if(V&&(n.__commitOwner=wn(V)),n.__watchSig===t&&n.__watchSub){let s;n.__watchSub.observe(()=>{s=t.get()}),te(e,s);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new jt.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let s;try{r.observe(()=>{s=t.get()}),Mr(e,()=>te(e,s))}catch(i){Dr(e,i)}})});n.__watchSub=r;let o;r.observe(()=>{o=t.get()}),te(e,o)}function Cs(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function mc(e,t){let n=e;V&&(n.__commitOwner=wn(V));let r=e.child;if(r&&r.kind==="async-stream"&&r.mode==="append"&&r.iterable===t.iterable)return;ge(e);let o=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:o,nodes:[]};e.child=s,ks(s,e,t)}function bc(e,t){let n=e;V&&(n.__commitOwner=wn(V));let r=e.child;if(r&&r.kind==="async-stream"&&r.mode==="replace"&&r.iterable===t.iterable)return;ge(e);let o=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:o,nodes:[]};e.child=s,ks(s,e,t)}async function ks(e,t,n){let r=t.marker,o=0;for(;!e.aborted;){let s,i;try{if(s=await e.iterator.next(),e.aborted||s.done)break;i=n.mapper?n.mapper(s.value,o):s.value}catch(a){typeof console<"u"&&console.error("[webjs] asyncStream error:",a);return}try{Mr(t,()=>{let a=Ns(i);As(r.parentNode,()=>{if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let c=document.createDocumentFragment();for(let l of a)c.appendChild(l);r.parentNode?.insertBefore(c,r),e.nodes.push(...a)})})}catch(a){e.aborted=!0;try{e.iterator.return?.()?.catch?.(()=>{})}catch{}Dr(t,a);return}o++}}function Ns(e){if(e==null||e===!1||e===!0)return[];if(B(e)){let t=e,{templateEl:n,parts:r,formActions:o}=_n(t),s=n.content.cloneNode(!0),i=r.map(a=>Sn(a,s));for(let a=0;a<t.values.length;a++)ne(i[a],t.values[a],void 0,t.values);It(o,i,t.values);for(let a of i)a.kind==="slot"&&ne(a,void 0,void 0,[]);return[...s.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...Ns(n));return t}return[document.createTextNode(String(e))]}function Ts(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}var js=null;function An(e){js=e||null}function gc(){return js||void 0}var Rs=Symbol.for("webjs:registry"),Ls=Symbol.for("webjs:classToTag"),En=globalThis,re=En[Rs]||(En[Rs]=new Map),Os=En[Ls]||(En[Ls]=new WeakMap),vn=typeof window<"u"&&typeof customElements<"u";function Br(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=re.get(e);r?(r.cls=t,r.lazy=n):re.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),Os.set(t,e)}if(vn){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),Br(t,n)}}if(!vn){let e=globalThis;e.customElements||(e.customElements={define(t,n){Br(t,n)},get(t){return re.get(t)?.cls},upgrade(){},whenDefined(t){let n=re.get(t);return Promise.resolve(n?.cls)}})}function qr(e,t){vn?customElements.define(e,t):Br(e,t)}function yc(e,t){if(vn)return;let n=re.get(e);if(n){n.moduleUrl=t;return}re.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Hr(e){return re.get(e)?.cls}function wc(e){return re.get(e)?.moduleUrl||null}function _c(e){return re.get(e)?.lazy===!0}function Pt(e){return Os.get(e)}function Ur(){return[...re.keys()]}at();mn();var qs=typeof window<"u"&&typeof HTMLElement<"u";function Oc(e,t){return e!==t}function $c(e){try{return String(e)}catch{return Object.prototype.toString.call(e)}}function Fs(e,t,n){if(typeof console>"u"||!console.warn)return;let r=Pt(e.constructor)||e.tagName?.toLowerCase()||"unknown";console.warn(`[webjs] reflect:true property "${t}" on <${r}> holds a function (or an array carrying one), which has no HTML attribute representation. Removing "${n}" instead of stringifying it (a stringified function writes its source into the page, so a server action's body would ship to the browser). Pass a string, or drop reflect on this property.`)}function Ic(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var xn=class{constructor(){this.__ssrAttrs=new Map,this.__internals=null}get attributes(){return[...this.__ssrAttrs].map(([t,n])=>({name:t,value:n}))}getAttribute(t){let n=this.__ssrAttrs.get(String(t).toLowerCase());return n===void 0?null:n}setAttribute(t,n){this.__ssrAttrs.set(String(t).toLowerCase(),String(n))}removeAttribute(t){this.__ssrAttrs.delete(String(t).toLowerCase())}hasAttribute(t){return this.__ssrAttrs.has(String(t).toLowerCase())}toggleAttribute(t,n){let r=String(t).toLowerCase(),o=this.__ssrAttrs.has(r);return(n===void 0?!o:n)?(this.__ssrAttrs.set(r,""),!0):(this.__ssrAttrs.delete(r),!1)}getAttributeNames(){return[...this.__ssrAttrs.keys()]}closest(t){let n=String(t).trim().toLowerCase();if(!/^[a-z][a-z0-9-]*$/.test(n))return null;if(this.__ssrTag===n)return this;let r=this.__ssrAncestors;if(!Array.isArray(r))return null;for(let o=r.length-1;o>=0;o--)if(r[o]&&r[o].__ssrTag===n)return r[o];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,o=>"-"+o.toLowerCase());return this.__dataset=new Proxy({},{get(r,o){if(typeof o!="string")return;let s=t.getAttribute(n(o));return s===null?void 0:s},set(r,o,s){return typeof o=="string"&&t.setAttribute(n(o),s),!0},has(r,o){return typeof o=="string"&&t.hasAttribute(n(o))},deleteProperty(r,o){return typeof o=="string"&&t.removeAttribute(n(o)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(o,s)=>s.toUpperCase()))},getOwnPropertyDescriptor(r,o){if(typeof o=="string"&&t.hasAttribute(n(o)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(o))}}}),this.__dataset}get className(){return this.getAttribute("class")??""}set className(t){this.setAttribute("class",t)}get hidden(){return this.hasAttribute("hidden")}set hidden(t){this.toggleAttribute("hidden",!!t)}get id(){return this.getAttribute("id")??""}set id(t){this.setAttribute("id",t)}get title(){return this.getAttribute("title")??""}set title(t){this.setAttribute("title",t)}get slot(){return this.getAttribute("slot")??""}set slot(t){this.setAttribute("slot",t)}get role(){return this.getAttribute("role")}set role(t){t==null?this.removeAttribute("role"):this.setAttribute("role",t)}get tabIndex(){let t=this.getAttribute("tabindex");return t===null?-1:Number.parseInt(t,10)||0}set tabIndex(t){this.setAttribute("tabindex",String(t))}addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return this.__internals=Ic(),this.__internals}},Pc=["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 Pc){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(xn.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var Mc=qs?HTMLElement:xn,Hs=Symbol("webjs.factoryProps"),Ds=new WeakSet,ct=class e extends Mc{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){qr(t,this)}static get observedAttributes(){let t=this.properties||{};return Object.keys(t).filter(n=>!(typeof t[n]=="object"&&t[n].state)).map(n=>typeof t[n]=="object"&&t[n].attribute||Wr(n))}constructor(){super(),this._renderRoot=null,this._scheduled=!1,this._connected=!1,this.__controllers=new Set,this.__firstRendered=!1,this._changedProperties=new Map,this._updateResolve=null,this._updatePromise=Promise.resolve(!0),this._isUpdating=!1,this._assertFactoryProperties(),this._initializeProperties()}_assertFactoryProperties(){let t=this.constructor;if(Ds.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,Hs)){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)}Ds.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,o]of Object.entries(n)){let s=typeof o=="object"?o:{type:o},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:a=>{let c=this.__propValues[r];(s.hasChanged||Oc)(a,c)&&(this.__propValues[r]=a,s.reflect&&!s.state&&this._connected&&this._reflectAttribute(r,a,s),this.requestUpdate(r,c))}}),i!==void 0?this.__propValues[r]=i:s.default!==void 0&&(this.__propValues[r]=typeof s.default=="function"?s.default():s.default)}}}_reflectAttribute(t,n,r){let o=r.attribute||Wr(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let s=r.converter.toAttribute(n,r.type);s==null?this.removeAttribute(o):this.setAttribute(o,s)}else typeof n=="function"?(this.removeAttribute(o),Fs(this,t,o)):r.type===Boolean?n?this.setAttribute(o,""):this.removeAttribute(o):n==null?this.removeAttribute(o):r.type===Object||r.type===Array?this.setAttribute(o,JSON.stringify(n)):tn(n)?(this.removeAttribute(o),Fs(this,t,o)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!qs)return;if(this.__webjsPropsHydrated||(this.__webjsPropsHydrated=!0,this._hydratePropAttrs()),this.constructor.hydrate==="visible"&&typeof IntersectionObserver<"u"&&!this.__hydrationActivated){this.__hydrationActivated=!1,this.__hydrationObserver=new IntersectionObserver(n=>{for(let r of n)if(r.isIntersecting){this.__hydrationObserver.unobserve(this),this.__hydrationObserver.disconnect(),this.__hydrationObserver=null,this.__hydrationActivated=!0,this._activate();return}},{rootMargin:"200px"}),this.__hydrationObserver.observe(this);return}this._activate()}_hydratePropAttrs(){let t=[],n=this.attributes;for(let r=0;r<n.length;r++){let o=n[r].name;o.startsWith("data-webjs-prop-")&&t.push(o)}for(let r of t){let o=this.getAttribute(r);if(this.removeAttribute(r),o==null)continue;let s=Bs(r.slice(16));try{this[s]=ue(o)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow!==!0&&!this.hasAttribute("data-wj-host")&&this.setAttribute("data-wj-host",""),t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,o=Array.isArray(r)?r:qe(r)?[r]:[];if(o.length){if(n){let s=this.shadowRoot.querySelector("style");s&&s.remove()}rr(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${Pt(t)||this.tagName?.toLowerCase()}> has static shadow = false AND static styles. static styles only works with shadow DOM (adoptedStyleSheets). For light DOM, use global CSS or <style> in render().`),Lr(this)?ps(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||gs(this)?(this.removeAttribute("data-wj-serialized"),ce(this),os(this)):rs(this),bs(this),us(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),ds(this),this.__signalWatcher&&(this.__signalWatcher.dispose(),this.__signalWatcher=void 0);for(let t of this.__controllers)t.hostDisconnected&&t.hostDisconnected()}attributeChangedCallback(t,n,r){if(this.__reflectingAttribute)return;let s=this.constructor.properties||{},i,a;for(let[f,u]of Object.entries(s))if(((typeof u=="object"?u:{type:u}).attribute||Wr(f))===t){i=f,a=u;break}if(a===void 0&&(i=Bs(t),a=s[i]||s[t]),a===void 0)return;let c=typeof a=="object"?a:{type:a},l;if(c.converter&&c.converter.fromAttribute)l=c.converter.fromAttribute(r,c.type);else if(c.type===Number)l=r==null?null:Number(r);else if(c.type===Boolean)l=r!=null&&r!=="false";else if(c.type===Object||c.type===Array)try{l=r==null?null:JSON.parse(r)}catch{l=r}else l=r;this[i]!==l&&(this[i]=l,this._connected&&this.requestUpdate())}requestUpdate(t,n){t!==void 0&&!this._changedProperties.has(t)&&this._changedProperties.set(t,n),this._scheduleUpdate()}_scheduleUpdate(){this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),!this._isUpdating&&(this._scheduled||!this._connected||(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(t){console.error("[webjs] lifecycle hook threw during update cycle:",t)}})))}_performRender(){if(!this._renderRoot)return;let t=this._changedProperties;this._isUpdating=!0;let n=!1,r=null;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let o of this.__controllers)o.hostUpdate&&o.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,An(this.__renderAbort?this.__renderAbort.signal:null);try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}finally{An(null)}if(!r){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();n=!0}}}catch(o){console.error("[webjs] lifecycle hook threw during update phase:",o)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let o=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1;let s=()=>{if(this.__pendingAsyncCommits--,o===this.__renderToken){for(let i of this.__controllers)i.hostUpdated&&i.hostUpdated();this._postCommit(t)}};r.then(s,i=>{try{o===this.__renderToken&&this._handleRenderError(i instanceof Error?i:new Error($c(i)))}finally{s()}});return}n?this._postCommit(t):this.__pendingAsyncCommits||this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers)n.hostUpdate&&n.hostUpdate();this._reflectDeclaredAttributes()}finally{this._isUpdating=!1}}_reflectDeclaredAttributes(){let t=this.constructor.properties||{};for(let n of Object.keys(t)){let r=t[n];!r||!r.reflect||r.state||this._reflectAttribute(n,this[n],r)}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new jt.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);it(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&it(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{if(n===this.__renderToken)try{it(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!==Cn.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${Pt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&it(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 Wr(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Bs(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Cn(e){return new.target?Reflect.construct(ct,arguments,new.target):class extends ct{static properties=e;static[Hs]=!0}}Object.setPrototypeOf(Cn,ct);Cn.prototype=ct.prototype;function Fc(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var wf=Symbol.for("webjs.suspense");function Dc(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function kn(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}at();var Vr=null;function Bc(e){Vr=e}function Kr(){if(!Vr)return"";try{return Vr()||""}catch{return""}}async function qc(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;n&&n.dev===void 0&&r!==void 0&&(n.dev=r);let o=await M(e,n,t&&t.formScope||"none");return t&&t.ssr===!1?o:await we(o,n,[],r)}async function M(e,t,n="none"){if(e==null||e===!1||e===!0)return"";if(e&&typeof e.then=="function")return e=await e,M(e,t,n);if(Ge(e))return String(e.value??"");if(xe(e))return M(e.value,t,n);if(Re(e))return M(e.signal.get(),t,n);if(Ce(e))return M(e.value,t,n);if(ke(e))return M(e.fn(),t,n);if(Je(e)){let r=e.template;return String(r?.innerHTML??"")}if(Ne(e))return"";if(Te(e))return M(e.value,t,n);if(je(e)){let r=e.args;for(let o of r)if(!o||typeof o.then!="function")return M(o,t,n);if(r.length>0)try{let o=await Promise.race(r.map(s=>Promise.resolve(s).catch(()=>{})));return M(o,t,n)}catch{return""}return""}if(Xe(e)||Ze(e))return"";if(Array.isArray(e))return(await Promise.all(e.map(o=>M(o,t,n)))).join("");if(ve(e)){let r=e;return(await Promise.all(r.items.map((s,i)=>M(r.templateFn(s,i),t,n)))).join("")}if(kn(e)){let r=e,o=await M(r.fallback,t,n);if(t){let s=`s${t.nextId++}`;return t.pending.push({id:s,promise:Promise.resolve(r.children),formScope:n}),`<webjs-boundary id="${s}">${o}</webjs-boundary>`}return o}return B(e)?Hc(e,t,n):Zt(String(e))}async function Hc(e,t,n="none"){let{strings:r,values:o}=e,s="",i="text",a="",c=0,l="",f=0,u="",h="",d=-1,p=null,w=null,A=0,S=[],b=[],x=n,y=!1,E=()=>{let k=S,v=b,_=A>1,m=w;if(S=[],b=[],A=0,w=null,p!=null){xt({duplicateAction:_,propAttrs:k});let g=cr(s.slice(d),p);s=s.slice(0,d)+g.tag+g.hidden,p=null,x="bound"}!y&&u==="form"&&x!=="bound"&&(x="unbound"),m!=null?Ct(s.slice(d),m,{bound:!0,duplicateAction:_,propAttrs:v}):x==="bound"&&!y&&(u==="button"||u==="input")&&Ct(s.slice(d),u,{bound:!1,propAttrs:v})},j=(k,v)=>{let _=String(v).toLowerCase();if(_==="button"||_==="input"){Ye(k)&&b.push(String(k));return}if(_!=="form")return;let m=String(k).toLowerCase();m==="encoding"&&(m="enctype"),(m==="method"||m==="enctype")&&S.push(String(k))},I=(k,v)=>{let _=String(v).toLowerCase(),m=String(k).toLowerCase();(_==="form"&&m==="action"||(_==="button"||_==="input")&&m==="formaction")&&(A+=1)},C=k=>{E(),y&&u==="form"&&(x=n==="unknown"?"unknown":"none"),y=!1,i=k&&Gr(u)?"rawtext":"text",i==="rawtext"&&(h="")};for(let k=0;k<r.length;k++){let v=r[k];for(let _=0;_<v.length;_++){let m=v[_];switch(i){case"text":s+=m,m==="<"&&(i="tag-open",d=s.length-1,y=!1);break;case"tag-open":s+=m,m==="!"?i="bang-1":m==="/"?(i="tag-name",u="",y=!0):/[a-zA-Z]/.test(m)?(i="tag-name",u=m.toLowerCase()):i="text";break;case"bang-1":s+=m,i=m==="-"?"bang-dash":"tag-name";break;case"bang-dash":s+=m,m==="-"?(i="comment",f=0):i="tag-name";break;case"comment":s+=m,m==="-"?f+=1:(m===">"&&f>=2&&(i="text"),f=0);break;case"tag-name":s+=m,m===">"?C(!0):/\s/.test(m)?i="in-tag":u+=m.toLowerCase();break;case"in-tag":s+=m,m===">"?C(!0):!/\s/.test(m)&&m!=="/"&&(i="attr-name",a=m,c=s.length-1);break;case"rawtext":s+=m,h=(h+m.toLowerCase()).slice(-9),(h.endsWith("<\/script>")||h.endsWith("</style>"))&&(i="text",h="",u="");break;case"attr-name":m==="="?(i="after-eq",s+=m):/\s/.test(m)?(i="in-tag",a="",s+=m):m===">"?(i="text",a="",s+=m,C(!1)):(a+=m,s+=m);break;case"after-eq":m==='"'||m==="'"?(i="attr-quoted",l=m,s+=m):/\s/.test(m)?(i="in-tag",a="",s+=m):m===">"?(i="text",a="",s+=m,C(!1)):(i="attr-unquoted",s+=m);break;case"attr-unquoted":/\s/.test(m)?(i="in-tag",a="",s+=m):m===">"?(i="text",a="",s+=m,C(!1)):s+=m;break;case"attr-quoted":s+=m,m===l&&(i="in-tag",a="");break}}if(k<o.length){let _=o[k];if(_&&typeof _.then=="function"&&(_=await _),i==="comment")s+=String(_??""),f=0;else if(i==="rawtext")s+=String(_??""),h="";else if(i==="text")s+=await M(_,t,x);else if(i==="after-eq"){let m=a[0],g=a.slice(1),T=He[m];if(T==="event")s=s.slice(0,c),i="in-tag",a="";else if(T==="prop"){if(s=s.slice(0,c),u==="webjs-suspense"&&g==="fallback"){let N=await M(_,t,x);s+=`data-webjs-fallback="${H(N)}"`,i="in-tag",a="";continue}if(!u.includes("-")){vt(_,g,u),j(g,u),i="in-tag",a="";continue}if(_===void 0){i="in-tag",a="";continue}try{let N=await Dt(_);s+=`data-webjs-prop-${al(g)}="${H(N)}"`}catch(N){console.warn(`[webjs] property binding .${g} has an unserializable value during SSR. Dropping. The browser will see the property as undefined. Detail: ${N&&N.message}`)}i="in-tag",a=""}else if(T==="bool")G(_,g,u),s=s.slice(0,c),_&&(s+=`${g}=""`),i="in-tag",a="";else if(Ue(_,a,u)){if(I(a,u),u==="form")p=pe(await At(_),u),s=s.slice(0,c).replace(/\s+$/,"");else{ze(w!=null,u),x!=="unknown"&&Et(x==="bound",u);let N=kt(s.slice(d));N.has("name")&&We(N.get("name")||"",u,!1),N.has("value")&&Ve(u),N.has("form")&&Ke(u);let Y=pe(await At(_),u);w=u,s=s.slice(0,c)+`name="${R}" value="${H(Y)}"`}i="in-tag",a=""}else I(a,u),G(_,a,u),s+=`"${H(String(_??""))}"`,i="in-tag",a=""}else(i==="attr-quoted"||i==="attr-unquoted")&&(G(_,a,u),s+=H(String(_??"")))}}return s}var Uc=new Set(["document","window","localStorage","sessionStorage","navigator","matchMedia","requestAnimationFrame","getComputedStyle","IntersectionObserver","MutationObserver","ResizeObserver"]),Wc=new Set(["attachShadow","querySelector","querySelectorAll","getBoundingClientRect","focus","blur","scrollIntoView"]);function Vc(e){let t=e&&typeof e.message=="string"?e.message:"",n=/^(\w+) is not defined\b/.exec(t);return e instanceof ReferenceError&&n&&Uc.has(n[1])?`\`${n[1]}\` is a browser-only global and is undefined during SSR.`:(n=/\.(\w+) is not a function\b/.exec(t),e instanceof TypeError&&n&&Wc.has(n[1])?`\`${n[1]}\` is an HTMLElement method that does not exist on the server-side component instance during SSR.`:null)}function Kc(){return typeof process<"u"&&process.env&&!0}function Ks(e,t,n){if(!(n===void 0?!Kc():!!n))return"";let o=t&&t.message?t.message:String(t);return nr`<div data-webjs-error="${e}" style="border:1px solid #f5c2c7;background:#f8d7da;color:#842029;padding:8px 12px;border-radius:6px;font:13px/1.4 system-ui,sans-serif">
|
|
6
6
|
<strong><${e}> failed to render</strong>
|
|
7
7
|
<div style="margin-top:4px;white-space:pre-wrap">${o}</div>
|
|
8
|
-
</div>`}async function fe(e,t,n=[],r){e=await Ra(e,t,n,r);let o=nr();if(!o.length)return e;let s=[...o].sort((u,d)=>d.length-u.length),i=new RegExp(`<(${s.map(ht).join("|")})(?=[\\s>/])((?:"[^"]*"|'[^']*'|[^>])*?)(/?)>`,"g"),c=[];for(let u of e.matchAll(i)){let[d,p,g,b]=u,m=tr(p);if(!m)continue;t&&t.usedComponents&&t.usedComponents.add(p);let h=b?`<${p}${g}>`:d,y=null;try{let _=m.shadow===!0;y=new m,y.__ssrTag=p,y.__ssrAncestors=n;let w=Uo(g),C=Ba(w),x=new Set(Object.keys(Uo(g)).map(I=>I.toLowerCase()));Ia(y,w),$a(y,w,m);for(let[I,j]of Object.entries(C))y[I]=j;let k="",S=u.index+d.length;if(!b){let I=u.index+d.length,j=mt(e,I,p);if(j!==-1){k=e.slice(I,j);let rt=new RegExp(`</${ht(p)}\\s*>`,"i"),En=e.slice(j),qr=rt.exec(En),Ws=qr?qr[0].length:`</${p}>`.length;S=j+Ws}else k=e.slice(I),S=e.length}let E=La(k);typeof y.performServerUpdate=="function"&&y.performServerUpdate();let A=y.render?y.render():"";A&&typeof A.then=="function"&&(A=await A),h=Pa(h,y,x),_||(h=Ho(h));let U=await O(A,t);if(_){let I=await fe(U,t,[...n,y],r),j=m.styles,rt=Array.isArray(j)?j:j&&Re(j)?[j]:[],En=Ct(rt);c.push({start:u.index,end:u.index+d.length,text:`${h}<template shadowrootmode="open">${En}${I}</template>`})}else{if(U.trim()===""){c.push({start:u.index,end:u.index+d.length,text:`${h}<!--webjs-hydrate-->`});continue}let j=Ma(U,E,p),rt=await fe(j,t,[...n,y],r);c.push({start:u.index,end:S,text:`${h}<!--webjs-hydrate-->${rt}</${p}>`})}}catch(_){let w=va(_);console.error(w?`[webjs] SSR failed for <${p}>: ${w} It was touched in the component's constructor or render(), which run during SSR. Move browser-only work to connectedCallback() or a lifecycle hook (firstUpdated/updated), which SSR never calls; seed first-paint defaults in the constructor only from server-known inputs (attributes / props).`:`[webjs] SSR failed for <${p}>:`,_);let C=_ instanceof Error?_:new Error(String(_)),x="";try{let A;y&&typeof y.renderError=="function"&&(A=y.renderError(C)),A===void 0&&(A=Wo(p,C,r)),x=await O(A,t),x.trim()&&(x=await fe(x,t,y?[...n,y]:n,r))}catch(A){console.error(`[webjs] renderError() for <${p}> also threw:`,A),x=""}let k=u.index+d.length;if(!b){let A=u.index+d.length,U=mt(e,A,p);if(U!==-1){let j=new RegExp(`</${ht(p)}\\s*>`,"i").exec(e.slice(U));k=U+(j?j[0].length:`</${p}>`.length)}else k=e.length}let S=m.shadow===!0;S||(h=Ho(h));let E;if(S){let A=m.styles,U=Array.isArray(A)?A:A&&Re(A)?[A]:[],I=Ct(U);E=`${h}<template shadowrootmode="open">${I}${x}</template>`}else E=`${h}<!--webjs-hydrate-->${x}</${p}>`;c.push({start:u.index,end:k,text:E})}}if(!c.length)return e;c.sort((u,d)=>u.start-d.start);let a=[],l=-1;for(let u of c)u.start>=l&&(a.push(u),l=u.end);let f=e;for(let u=a.length-1;u>=0;u--){let{start:d,end:p,text:g}=a[u];f=f.slice(0,d)+g+f.slice(p)}return f}var Na=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function ja(e){return Na.has(e.toLowerCase())}async function Ra(e,t,n=[],r){if(e.indexOf("<webjs-suspense")===-1)return e;let o=/<webjs-suspense((?:"[^"]*"|'[^']*'|[^>])*?)>/i,s="",i=e;for(let c=0;c<1e4;c++){let a=o.exec(i);if(!a){s+=i;break}let l=a.index,f=a.index+a[0].length;s+=i.slice(0,l);let u=a[1]||"",d=/data-webjs-fallback="([^"]*)"/i.exec(u),p=d?Zt(d[1]):"",g=mt(i,f,"webjs-suspense"),b,m;if(g===-1)b=i.slice(f),m="";else{b=i.slice(f,g);let h=/<\/webjs-suspense\s*>/i.exec(i.slice(g));m=i.slice(g+(h?h[0].length:17))}if(t){let h=`s${t.nextId++}`;t.pending.push({id:h,promise:Promise.resolve(kn(b))}),s+=`<webjs-suspense id="${h}">${p}</webjs-suspense>`}else{let h=await fe(b,t,n,r);s+=`<webjs-suspense>${h}</webjs-suspense>`}i=m}return s}function mt(e,t,n){let r=ht(n),o=new RegExp(`<${r}(?:[\\s>/])`,"gi"),s=new RegExp(`</${r}\\s*>`,"gi");o.lastIndex=t,s.lastIndex=t;let i=1;for(;i>0;){let c=o.exec(e),a=s.exec(e);if(!a)return-1;if(c&&c.index<a.index)i++,s.lastIndex=c.index+1;else{if(i--,i===0)return a.index;o.lastIndex=a.index+1}}return-1}function Oa(e){let t=/\bslot\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(e);if(!t)return null;let n=t[1]??t[2]??t[3]??"";return n===""||n==="default"?null:n}function La(e){let t=new Map,n="",r=0;for(;r<e.length;){let o=e.indexOf("<",r);if(o===-1){n+=e.slice(r);break}o>r&&(n+=e.slice(r,o));let s=e.slice(o);if(s.startsWith("<!--")){let m=e.indexOf("-->",o+4);if(m===-1){n+=s,r=e.length;break}n+=e.slice(o,m+3),r=m+3;continue}if(s.startsWith("<!")||s.startsWith("</")){let m=e.indexOf(">",o);if(m===-1){n+=s,r=e.length;break}n+=e.slice(o,m+1),r=m+1;continue}let i=/^<([a-zA-Z][\w-]*)((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/.exec(s);if(!i){n+="<",r=o+1;continue}let[c,a,l,f]=i,u=a.toLowerCase(),d=!!f||ja(u),p=Oa(l),g;if(d)g=o+c.length;else{let m=o+c.length,h=mt(e,m,u);if(h===-1){let x=e.slice(o);p!==null?qo(t,p,x):n+=x,r=e.length;continue}let y=new RegExp(`</${ht(u)}\\s*>`,"i"),_=e.slice(h),w=y.exec(_),C=w?w[0].length:`</${u}>`.length;g=h+C}let b=e.slice(o,g);p!==null?qo(t,p,b):n+=b,r=g}return n.length>0&&t.set(null,n),t}function qo(e,t,n){let r=e.get(t);r!==void 0?e.set(t,r+n):e.set(t,n)}function Ma(e,t,n){let r=n?` data-wj-slot-owner="${H(n)}"`:"",o=new Set,s="",i=0,c=/<slot((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/gi,a;for(;(a=c.exec(e))!==null;){s+=e.slice(i,a.index);let[l,f,u]=a,d=!!u,p=/\bname\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(f),g=p?p[1]??p[2]??p[3]:null,b=f.replace(/\bname\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,"").trim(),m="",h;if(d)h=a.index+l.length;else{let x=a.index+l.length,k=mt(e,x,"slot");if(k===-1)m=e.slice(x),h=e.length;else{m=e.slice(x,k);let S=/<\/slot\s*>/i,E=e.slice(k),A=S.exec(E),U=A?A[0].length:7;h=k+U}}let y=g==="default"||g===""?null:g,_=t.get(y),w=g!==null?` name="${H(g)}"`:"",C=b?` ${b}`:"";_!==void 0&&!o.has(y)?(o.add(y),s+=`<slot data-webjs-light data-projection="actual"${r}${w}${C}>${_}</slot>`):s+=`<slot data-webjs-light data-projection="fallback"${r}${w}${C}>${m}</slot>`,i=h,c.lastIndex=h}return s+=e.slice(i),s}function ht(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xt(e){return e==="script"||e==="style"}function Uo(e){let t={},n=/([a-zA-Z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g,r;for(;(r=n.exec(e))!==null;)t[r[1]]=r[2]??r[3]??r[4]??"";return t}function Ia(e,t){if(!(!e||typeof e.setAttribute!="function"))for(let[n,r]of Object.entries(t))e.setAttribute(n,Zt(r))}function Ho(e){return/\sdata-wj-host(?=[\s>=])/i.test(e)?e:`${e.slice(0,-1)} data-wj-host>`}function Pa(e,t,n){if(!t||typeof t.getAttributeNames!="function")return e;let r="";for(let o of t.getAttributeNames()){let s=String(o).toLowerCase();if(n.has(s))continue;let i=t.getAttribute(o);r+=i===""?` ${s}`:` ${s}="${H(String(i))}"`}return r?`${e.slice(0,-1)}${r}>`:e}function $a(e,t,n){let r=n.properties||{};for(let[o,s]of Object.entries(t)){let i,c;for(let[l,f]of Object.entries(r))if(((typeof f=="object"?f:{type:f}).attribute||Da(l))===o){i=l,c=f;break}if(c===void 0&&(c=r[o]||r[ir(o)],i=r[o]?o:ir(o)),!c){e[i]=s;continue}let a=typeof c=="object"?c:{type:c};if(a.type===Number)e[i]=Number(s);else if(a.type===Boolean)e[i]=s!=="false";else if(a.type===Object||a.type===Array)try{e[i]=JSON.parse(Zt(s))}catch{e[i]=s}else e[i]=s}}function ir(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Da(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Fa(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Zt(e){return e.replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&")}function Ba(e){let t={};for(let n of Object.keys(e)){if(!n.startsWith("data-webjs-prop-"))continue;let r=ir(n.slice(16));try{t[r]=ne(Zt(e[n]))}catch{}delete e[n]}return t}function qa(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;return n&&n.dev===void 0&&r!==void 0&&(n.dev=r),new ReadableStream({async start(o){try{if(t&&t.ssr===!1)await B(e,n,o);else{let s=await O(e,n),i=await fe(s,n,[],r);o.enqueue(i)}n&&n.pending.length&&await Ha(n,o,r),o.close()}catch(s){o.error(s)}}})}async function B(e,t,n){if(!(e==null||e===!1||e===!0)){if(e&&typeof e.then=="function")return e=await e,B(e,t,n);if(Le(e)){n.enqueue(String(e.value??""));return}if(Me(e))return B(e.value,t,n);if(Se(e))return B(e.signal.get(),t,n);if(be(e))return B(e.value,t,n);if(ge(e))return B(e.fn(),t,n);if(Ie(e)){let r=e.template;n.enqueue(String(r?.innerHTML??""));return}if(!ye(e)){if(we(e))return B(e.value,t,n);if(_e(e)){let r=e.args;for(let o of r)if(!o||typeof o.then!="function")return B(o,t,n);if(r.length>0)try{let o=await Promise.race(r.map(s=>Promise.resolve(s).catch(()=>{})));return B(o,t,n)}catch{return}return}if(!(Pe(e)||$e(e))){if(Array.isArray(e)){for(let r of e)await B(r,t,n);return}if(me(e)){let r=e;for(let o=0;o<r.items.length;o++)await B(r.templateFn(r.items[o],o),t,n);return}if(Jt(e)){let r=e;if(t){let o=`s${t.nextId++}`;n.enqueue(`<webjs-boundary id="${o}">`),await B(r.fallback,t,n),n.enqueue("</webjs-boundary>"),t.pending.push({id:o,promise:Promise.resolve(r.children)})}else await B(r.fallback,t,n);return}if(P(e)){await Ua(e,t,n);return}n.enqueue(kt(String(e)))}}}}async function Ua(e,t,n){let{strings:r,values:o}=e,s="text",i="",c=0,a="",l=0,f="",u="",d="";for(let p=0;p<r.length;p++){let g=r[p];for(let b=0;b<g.length;b++){let m=g[b];switch(s){case"text":d+=m,m==="<"&&(s="tag-open");break;case"tag-open":d+=m,m==="!"?s="bang-1":m==="/"?(s="tag-name",f=""):/[a-zA-Z]/.test(m)?(s="tag-name",f=m.toLowerCase()):s="text";break;case"bang-1":d+=m,s=m==="-"?"bang-dash":"tag-name";break;case"bang-dash":d+=m,m==="-"?(s="comment",l=0):s="tag-name";break;case"comment":d+=m,m==="-"?l+=1:(m===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":d+=m,m===">"?(s=Xt(f)?"rawtext":"text",s==="rawtext"&&(u="")):/\s/.test(m)?s="in-tag":f+=m.toLowerCase();break;case"in-tag":d+=m,m===">"?(s=Xt(f)?"rawtext":"text",s==="rawtext"&&(u="")):!/\s/.test(m)&&m!=="/"&&(s="attr-name",i=m,c=d.length-1);break;case"rawtext":d+=m,u=(u+m.toLowerCase()).slice(-9),(u.endsWith("<\/script>")||u.endsWith("</style>"))&&(s="text",u="",f="");break;case"attr-name":m==="="?(s="after-eq",d+=m):/\s/.test(m)?(s="in-tag",i="",d+=m):m===">"?(s="text",i="",d+=m):(i+=m,d+=m);break;case"after-eq":m==='"'||m==="'"?(s="attr-quoted",a=m,d+=m):/\s/.test(m)?(s="in-tag",i="",d+=m):m===">"?(s="text",i="",d+=m):(s="attr-unquoted",d+=m);break;case"attr-unquoted":/\s/.test(m)?(s="in-tag",i="",d+=m):(m===">"&&(s="text",i=""),d+=m);break;case"attr-quoted":d+=m,m===a&&(s="in-tag",i="");break}}if(p<o.length){let b=o[p];if(b&&typeof b.then=="function"&&(b=await b),s==="comment")d+=String(b??""),l=0;else if(s==="rawtext")d+=String(b??""),u="";else if(s==="text")d&&(n.enqueue(d),d=""),await B(b,t,n);else if(s==="after-eq"){let m=i[0],h=i.slice(1),y=Oe[m];y==="event"||y==="prop"?(d=d.slice(0,c),s="in-tag",i=""):y==="bool"?(d=d.slice(0,c),b&&(d+=`${h}=""`),s="in-tag",i=""):(d+=`"${H(String(b??""))}"`,s="in-tag",i="")}else(s==="attr-quoted"||s==="attr-unquoted")&&(d+=H(String(b??"")))}}d&&n.enqueue(d)}async function Ha(e,t,n){let r=sr(),o=r?` nonce="${H(r)}"`:"";for(;e.pending.length;){let s=e.pending.splice(0);await Promise.all(s.map(async({id:i,promise:c})=>{try{let a=await c,l=await O(a,e),f=await fe(l,e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${f}</template><script${o}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(a){console.error(`[webjs] Suspense boundary "${i}" rejected:`,a);try{let l=a instanceof Error?a:new Error(String(a)),f=await fe(await O(Wo("webjs-suspense",l,n),e),e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${f}</template><script${o}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(l){console.error(`[webjs] Suspense boundary "${i}" error render also threw:`,l)}}}))}}var zo=Symbol.for("webjs.notFound"),Vo=Symbol.for("webjs.redirect"),Ko=Symbol.for("webjs.forbidden"),Go=Symbol.for("webjs.unauthorized");function Wa(){let e=new Error("webjs: notFound()");throw e.__webjs=zo,e}function za(){let e=new Error("webjs: forbidden()");throw e.__webjs=Ko,e}function Va(){let e=new Error("webjs: unauthorized()");throw e.__webjs=Go,e}function Ka(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=Vo,r.url=e,r.status=typeof n=="number"?n:void 0,r}function Ga(e){return!!e&&e.__webjs===zo}function Ya(e){return!!e&&e.__webjs===Vo}function Ja(e){return!!e&&e.__webjs===Ko}function Xa(e){return!!e&&e.__webjs===Go}function Za(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,s=null,i=[];function c(){o||(s=new WebSocket(Qa(e),t.protocols),s.onopen=a=>{for(r=0;i.length&&s&&s.readyState===WebSocket.OPEN;)s.send(i.shift());t.onOpen?.(a)},s.onmessage=a=>{let l=a.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,a)},s.onerror=a=>{t.onError?.(a)},s.onclose=a=>{if(t.onClose?.(a),!o&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(c,l)}})}return c(),{send(a){let l=typeof a=="string"||a instanceof ArrayBuffer||ArrayBuffer.isView(a)?a:JSON.stringify(a);s&&s.readyState===WebSocket.OPEN?s.send(l):i.push(l)},close(a,l){o=!0;try{s?.close(a,l)}catch{}},get socket(){return s},get readyState(){return s?.readyState??3}}}function Qa(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}`}Ve();var ar="application/vnd.webjs+json";async function ec(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",ar);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 pt(r),n.has("content-type")||n.set("content-type",ar));let o=await fetch(e,{...t,headers:n,body:r}),s=o.headers.get("content-type")||"",i=await o.text(),c=s.includes(ar)?i?ne(i):null:s.includes("application/json")?i?JSON.parse(i):null:i;if(!o.ok){let a=c&&c.error||`richFetch ${e} -> ${o.status}`,l=new Error(a);throw l.status=o.status,l.body=c,l}return c}Ve();fr();ur();en();var $r=class{constructor(t,n){this.host=t,this.options=n,this.updates=[],this._nextId=0}get value(){let t=this.options.source();if(!this.options.update)return this.updates.length>0?this.updates[this.updates.length-1].payload:t;for(let n of this.updates)t=this.options.update(t,n.payload);return t}add(t,n){let r=`opt-${++this._nextId}`;this.updates.push({id:r,payload:t}),this.host?.requestUpdate?.();let o=()=>{let s=this.updates.findIndex(i=>i.id===r);s!==-1&&(this.updates.splice(s,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>o()).catch(()=>{}):n.then(()=>o(),()=>o())),o}};async function Kc(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(s){throw e.set(r),s}return o&&o.success===!1&&e.set(r),o}function Gc(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Kc(e,t,n):new $r(e,t)}hr();var Sn=0,Us=new Map,nt=new Map,Yc=1e3;function Jc(e){if(!(!Array.isArray(e)||!e.length)){Sn+=1;for(let t of e)t&&Us.set(t,Sn)}}function Xc(){return Sn}function Zc(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(nt.delete(e),nt.set(e,{tags:t.slice(),since:typeof n=="number"?n:Sn}),nt.size>Yc)){let r=nt.keys().next().value;r!==void 0&&nt.delete(r)}}function Qc(e){let t=nt.get(e);if(!t)return!1;for(let n of t.tags)if((Us.get(n)||0)>t.since)return!0;return!1}function el(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var tl="application/vnd.webjs+stream",nl=1,rl=2,ol=3,Hs=new Uint8Array(0);function sl(e,t){let n=t||Hs,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 il(){let e=Hs;return{push(t){if(t&&t.length){let r=new Uint8Array(e.length+t.length);r.set(e,0),r.set(t,e.length),e=r}let n=[];for(;e.length>=5;){let r=e[0],o=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+o)break;let s=e.slice(5,5+o);n.push({type:r,payload:s}),e=e.slice(5+o)}return n}}}var al=Symbol.for("webjs.context");function cl(e){return{__context__:al,name:e}}var An=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},Dr=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let s=o;if(s.context===this._context)if(o.stopPropagation(),s.subscribe){let i={callback:s.callback},c=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),s.callback(this._value,c)}else s.callback(this._value)},typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}setValue(t){if(!Object.is(this._value,t)){this._value=t;for(let n of this._subscriptions){let r=()=>{this._subscriptions.delete(n)};n.callback(t,r)}}}hostConnected(){this._host.addEventListener("context-request",this._onRequest)}hostDisconnected(){this._host.removeEventListener("context-request",this._onRequest),this._subscriptions.clear()}},Fr=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 An(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 ll(){return typeof window<"u"}var oe={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},Br=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=oe.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=oe.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=oe.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=oe.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 oe.INITIAL:return t.initial?.();case oe.PENDING:return t.pending?.();case oe.COMPLETE:return t.complete?.(this._value);case oe.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!ll())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{Fr as ContextConsumer,Dr as ContextProvider,An as ContextRequestEvent,nl as FRAME_CHUNK,rl as FRAME_END,ol as FRAME_ERROR,L as MARKER,os as SEED_MISS,tl as STREAM_CONTENT_TYPE,it as Signal,Sa as Suspense,Br as Task,oe as TaskStatus,Yt as WebComponent,lr as WebjsFrame,dr as WebjsStream,ea as activeActionSignal,Cn as adoptStyles,nr as allTags,ti as asyncAppend,ni as asyncReplace,di as batch,Qs as cache,hi as computed,Za as connectWS,Qc as consumeStale,cl as createContext,il as createFrameDecoder,Zs as createRef,sr as cspNonce,Vs as css,Io as deserialize,ls as disableClientRouter,bi as effect,Cr as enableClientRouter,sl as encodeFrame,H as escapeAttr,kt as escapeText,Xc as fetchMark,za as forbidden,Ys as guard,xn as html,Pe as isAsyncAppend,$e as isAsyncReplace,Re as isCSS,we as isCache,Ja as isForbidden,ge as isGuard,be as isKeyed,ra as isLazy,Me as isLive,Ga as isNotFound,Ya as isRedirect,ye as isRef,me as isRepeat,mi as isSignal,Jt as isSuspense,P as isTemplate,Ie as isTemplateContent,Xa as isUnauthorized,Le as isUnsafeHTML,_e as isUntil,Se as isWatch,Gs as keyed,Ks as live,tr as lookup,na as lookupModuleUrl,Jc as markStale,us as navigate,Wa as notFound,Gc as optimistic,ne as parse,el as parseTagHeader,ta as primeModuleUrl,_a as prop,Ka as redirect,Xs as ref,er as register,Zc as registerKeyTags,ze as render,pr as renderStream,qa as renderToStream,Ea as renderToString,zr as repeat,fs as revalidate,ec as richFetch,tn as scanSeeds,Mo as serialize,Wt as setActiveActionSignal,Aa as setCspNonceProvider,pi as signal,pt as stringify,Ct as stylesToString,Kt as tagOf,ac as takeSeed,Js as templateContent,Va as unauthorized,kn as unsafeHTML,ei as until,ri as watch};
|
|
8
|
+
</div>`}function zs(e,t){let n=t+4;if(e[n]===">")return n+1;if(e.startsWith("->",n))return n+2;for(;n<e.length;){if(e.startsWith("-->",n))return n+3;if(e.startsWith("--!>",n))return n+4;n+=1}return-1}function zc(e,t){let n=/<!--|-->|<\/script(?=[\s/>])|<script(?=[\s/>])/gi;n.lastIndex=t;let r=!1,o=!1,s;for(;(s=n.exec(e))!==null;){let i=s[0];if(i==="<!--"){let a=s.index+4;for(;e[a]==="-";)a+=1;e[a]===">"?(r=!1,o=!1,n.lastIndex=a+1):r||(r=!0)}else if(i==="-->")r=!1,o=!1;else if(i[1]==="/")if(o)o=!1;else return s.index;else r&&(o=!0)}return-1}function Nn(e){let t=[],n=e.length,r=0;for(;r<n;){let o=e.indexOf("<",r);if(o===-1)break;if(e.startsWith("<!--",o)){let d=zs(e,o),p=d===-1?n:d;t.push([o,p]),r=p;continue}if(e.startsWith("<!",o)||e.startsWith("<?",o)){let d=e.indexOf(">",o),p=d===-1?n:d+1;t.push([o,p]),r=p;continue}let s=/^<\/?([a-zA-Z][^\s/>]*)/.exec(e.slice(o,o+64));if(!s){if(e.startsWith("</",o)){let d=e.indexOf(">",o),p=d===-1?n:d+1;t.push([o,p]),r=p;continue}r=o+1;continue}let i=o+1,a="",c=!1,l=!1,f=!1;for(;i<n;){let d=e[i],p=d===" "||d===" "||d===`
|
|
9
|
+
`||d==="\r"||d==="\f";if(a)d===a&&(a="");else if(d===">"){f=!l&&e[i-1]==="/",i+=1;break}else c?p||(d==='"'||d==="'"?a=d:l=!0,c=!1):l?p&&(l=!1):d==="="&&(c=!0);i+=1}i>o+1&&t.push([o+1,i]),r=i;let u=s[1].toLowerCase();if(!(e[o+1]==="/")&&!f&&nl(u)){let d;if(u==="plaintext")d=n;else if(u==="script"){let p=zc(e,i);d=p===-1?n:p}else{let p=new RegExp(`</${u}(?=[\\s/>])`,"i").exec(e.slice(i));d=p?i+p.index:n}d>i&&t.push([i,d]),r=d}}return t}function Yc(e,t){for(let[n,r]of e){if(n>t)return!1;if(t<r)return!0}return!1}function Yr(e){let t=0;return n=>{for(;t<e.length&&e[t][1]<=n;)t+=1;return t>=e.length?!1:n>=e[t][0]}}async function we(e,t,n=[],r){e=await Xc(e,t,n,r);let o=Ur();if(!o.length)return e;let s=[...o].sort((d,p)=>p.length-d.length),i=new RegExp(`<(${s.map(Bt).join("|")})(?=[\\s>/])((?:"[^"]*"|'[^']*'|[^>])*?)(/?)>`,"g"),a=[],c=Nn(e),l=Yr(c);for(let d of e.matchAll(i)){let[p,w,A,S]=d,b=Hr(w);if(!b||l(d.index))continue;t&&t.usedComponents&&t.usedComponents.add(w);let x=S?`<${w}${A}>`:p,y=null;try{let E=b.shadow===!0;y=new b,y.__ssrTag=w,y.__ssrAncestors=n;let j=Ws(A),I=cl(j),C=new Set(Object.keys(Ws(A)).map(T=>T.toLowerCase()));rl(y,j),sl(y,j,b);for(let[T,N]of Object.entries(I))y[T]=N;let k="",v=d.index+p.length;if(!S){let T=d.index+p.length,N=qt(e,T,w,c);if(N!==-1){k=e.slice(T,N);let Y=new RegExp(`</${Bt(w)}\\s*>`,"i"),wt=e.slice(N),Io=Y.exec(wt),Gi=Io?Io[0].length:`</${w}>`.length;v=N+Gi}else k=e.slice(T),v=e.length}let _=Qc(k);typeof y.performServerUpdate=="function"&&y.performServerUpdate();let m=y.render?y.render():"";m&&typeof m.then=="function"&&(m=await m),x=ol(x,y,C),E||(x=Vs(x));let g=await M(m,t,"unknown");if(E){let T=await we(g,t,[...n,y],r),N=b.styles,Y=Array.isArray(N)?N:N&&qe(N)?[N]:[],wt=Xt(Y);a.push({start:d.index,end:d.index+p.length,text:`${x}<template shadowrootmode="open">${wt}${T}</template>`})}else{if(g.trim()===""){a.push({start:d.index,end:d.index+p.length,text:`${x}<!--webjs-hydrate-->`});continue}let N=el(g,_,w),Y=await we(N,t,[...n,y],r);a.push({start:d.index,end:v,text:`${x}<!--webjs-hydrate-->${Y}</${w}>`})}}catch(E){let j=Vc(E);console.error(j?`[webjs] SSR failed for <${w}>: ${j} It was touched in the component's constructor or render(), which run during SSR. Move browser-only work to connectedCallback() or a lifecycle hook (firstUpdated/updated), which SSR never calls; seed first-paint defaults in the constructor only from server-known inputs (attributes / props).`:`[webjs] SSR failed for <${w}>:`,E);let I=E instanceof Error?E:new Error(String(E)),C="";try{let m;y&&typeof y.renderError=="function"&&(m=y.renderError(I)),m===void 0&&(m=Ks(w,I,r)),C=await M(m,t),C.trim()&&(C=await we(C,t,y?[...n,y]:n,r))}catch(m){console.error(`[webjs] renderError() for <${w}> also threw:`,m),C=""}let k=d.index+p.length;if(!S){let m=d.index+p.length,g=qt(e,m,w,c);if(g!==-1){let N=new RegExp(`</${Bt(w)}\\s*>`,"i").exec(e.slice(g));k=g+(N?N[0].length:`</${w}>`.length)}else k=e.length}let v=b.shadow===!0;v||(x=Vs(x));let _;if(v){let m=b.styles,g=Array.isArray(m)?m:m&&qe(m)?[m]:[],T=Xt(g);_=`${x}<template shadowrootmode="open">${T}${C}</template>`}else _=`${x}<!--webjs-hydrate-->${C}</${w}>`;a.push({start:d.index,end:k,text:_})}}if(!a.length)return e;a.sort((d,p)=>d.start-p.start);let f=[],u=-1;for(let d of a)d.start>=u&&(f.push(d),u=d.end);let h=e;for(let d=f.length-1;d>=0;d--){let{start:p,end:w,text:A}=f[d];h=h.slice(0,p)+A+h.slice(w)}return h}var Gc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Jc(e){return Gc.has(e.toLowerCase())}async function Xc(e,t,n=[],r){if(e.indexOf("<webjs-suspense")===-1)return e;let o=/<webjs-suspense((?:"[^"]*"|'[^']*'|[^>])*?)>/i,s=Nn(e),i=Yr(s),a=0,c="",l=e;for(let f=0;f<1e4;f++){let u=o.exec(l);if(!u){c+=l;break}if(i(a+u.index)){let E=u.index+u[0].length;c+=l.slice(0,E),l=l.slice(E),a+=E;continue}let h=u.index,d=u.index+u[0].length;c+=l.slice(0,h);let p=u[1]||"",w=/data-webjs-fallback="([^"]*)"/i.exec(p),A=w?Tn(w[1]):"",S=[];for(let[E,j]of s)j<=a||S.push([Math.max(0,E-a),j-a]);let b=qt(l,d,"webjs-suspense",S),x,y;if(b===-1)x=l.slice(d),y="";else{x=l.slice(d,b);let E=/<\/webjs-suspense\s*>/i.exec(l.slice(b));y=l.slice(b+(E?E[0].length:17))}if(t){let E=`s${t.nextId++}`;t.pending.push({id:E,promise:Promise.resolve(lr(x))}),c+=`<webjs-suspense id="${E}">${A}</webjs-suspense>`}else{let E=await we(x,t,n,r);c+=`<webjs-suspense>${E}</webjs-suspense>`}a+=l.length-y.length,l=y}return c}function qt(e,t,n,r){let o=Bt(n),s=new RegExp(`<${o}(?:[\\s>/])`,"gi"),i=new RegExp(`</${o}\\s*>`,"gi"),a=r===void 0?Nn(e):r,c=f=>{let u;for(;(u=f.exec(e))!==null;)if(a.length===0||!Yc(a,u.index))return u;return null};s.lastIndex=t,i.lastIndex=t;let l=1;for(;l>0;){let f=c(s),u=c(i);if(!u)return-1;if(f&&f.index<u.index)l++,i.lastIndex=f.index+1;else{if(l--,l===0)return u.index;s.lastIndex=u.index+1}}return-1}function Zc(e){let t=/\bslot\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(e);if(!t)return null;let n=t[1]??t[2]??t[3]??"";return n===""||n==="default"?null:n}function Qc(e){let t=new Map,n="",r=0;for(;r<e.length;){let o=e.indexOf("<",r);if(o===-1){n+=e.slice(r);break}o>r&&(n+=e.slice(r,o));let s=e.slice(o);if(s.startsWith("<!--")){let A=zs(e,o);if(A===-1){n+=s,r=e.length;break}n+=e.slice(o,A),r=A;continue}if(s.startsWith("<!")||s.startsWith("</")){let A=e.indexOf(">",o);if(A===-1){n+=s,r=e.length;break}n+=e.slice(o,A+1),r=A+1;continue}let i=/^<([a-zA-Z][\w-]*)((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/.exec(s);if(!i){n+="<",r=o+1;continue}let[a,c,l,f]=i,u=c.toLowerCase(),h=!!f||Jc(u),d=Zc(l),p;if(h)p=o+a.length;else{let A=o+a.length,S=qt(e,A,u);if(S===-1){let j=e.slice(o);d!==null?Us(t,d,j):n+=j,r=e.length;continue}let b=new RegExp(`</${Bt(u)}\\s*>`,"i"),x=e.slice(S),y=b.exec(x),E=y?y[0].length:`</${u}>`.length;p=S+E}let w=e.slice(o,p);d!==null?Us(t,d,w):n+=w,r=p}return n.length>0&&t.set(null,n),t}function Us(e,t,n){let r=e.get(t);r!==void 0?e.set(t,r+n):e.set(t,n)}function el(e,t,n){let r=n?` data-wj-slot-owner="${H(n)}"`:"",o=new Set,s="",i=0,a=/<slot((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/gi,c=Nn(e),l=Yr(c),f;for(;(f=a.exec(e))!==null;){if(l(f.index))continue;s+=e.slice(i,f.index);let[u,h,d]=f,p=!!d,w=/\bname\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(h),A=w?w[1]??w[2]??w[3]:null,S=h.replace(/\bname\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,"").trim(),b="",x;if(p)x=f.index+u.length;else{let C=f.index+u.length,k=qt(e,C,"slot",c);if(k===-1)b=e.slice(C),x=e.length;else{b=e.slice(C,k);let v=/<\/slot\s*>/i,_=e.slice(k),m=v.exec(_),g=m?m[0].length:7;x=k+g}}let y=A==="default"||A===""?null:A,E=t.get(y),j=A!==null?` name="${H(A)}"`:"",I=S?` ${S}`:"";E!==void 0&&!o.has(y)?(o.add(y),s+=`<slot data-webjs-light data-projection="actual"${r}${j}${I}>${E}</slot>`):s+=`<slot data-webjs-light data-projection="fallback"${r}${j}${I}>${b}</slot>`,i=x,a.lastIndex=x}return s+=e.slice(i),s}function Bt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gr(e){return e==="script"||e==="style"}function tl(e){return e==="textarea"||e==="title"}function nl(e){return Gr(e)||tl(e)||e==="iframe"||e==="xmp"||e==="noembed"||e==="noframes"||e==="plaintext"}function Ws(e){let t={},n=/([a-zA-Z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g,r;for(;(r=n.exec(e))!==null;)t[r[1]]=r[2]??r[3]??r[4]??"";return t}function rl(e,t){if(!(!e||typeof e.setAttribute!="function"))for(let[n,r]of Object.entries(t))e.setAttribute(n,Tn(r))}function Vs(e){return/\sdata-wj-host(?=[\s>=])/i.test(e)?e:`${e.slice(0,-1)} data-wj-host>`}function ol(e,t,n){if(!t||typeof t.getAttributeNames!="function")return e;let r="";for(let o of t.getAttributeNames()){let s=String(o).toLowerCase();if(n.has(s))continue;let i=t.getAttribute(o);r+=i===""?` ${s}`:` ${s}="${H(String(i))}"`}return r?`${e.slice(0,-1)}${r}>`:e}function sl(e,t,n){let r=n.properties||{};for(let[o,s]of Object.entries(t)){let i,a;for(let[l,f]of Object.entries(r))if(((typeof f=="object"?f:{type:f}).attribute||il(l))===o){i=l,a=f;break}if(a===void 0&&(a=r[o]||r[zr(o)],i=r[o]?o:zr(o)),!a){e[i]=s;continue}let c=typeof a=="object"?a:{type:a};if(c.type===Number)e[i]=Number(s);else if(c.type===Boolean)e[i]=s!=="false";else if(c.type===Object||c.type===Array)try{e[i]=JSON.parse(Tn(s))}catch{e[i]=s}else e[i]=s}}function zr(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function il(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function al(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Tn(e){return e.replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&")}function cl(e){let t={};for(let n of Object.keys(e)){if(!n.startsWith("data-webjs-prop-"))continue;let r=zr(n.slice(16));try{t[r]=ue(Tn(e[n]))}catch{}delete e[n]}return t}function ll(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;return n&&n.dev===void 0&&r!==void 0&&(n.dev=r),new ReadableStream({async start(o){try{if(t&&t.ssr===!1)await K(e,n,o,"none");else{let s=await M(e,n),i=await we(s,n,[],r);o.enqueue(i)}n&&n.pending.length&&await fl(n,o,r),o.close()}catch(s){o.error(s)}}})}async function K(e,t,n,r="none"){if(!(e==null||e===!1||e===!0)){if(e&&typeof e.then=="function")return e=await e,K(e,t,n,r);if(Ge(e)){n.enqueue(String(e.value??""));return}if(xe(e))return K(e.value,t,n,r);if(Re(e))return K(e.signal.get(),t,n,r);if(Ce(e))return K(e.value,t,n,r);if(ke(e))return K(e.fn(),t,n,r);if(Je(e)){let o=e.template;n.enqueue(String(o?.innerHTML??""));return}if(!Ne(e)){if(Te(e))return K(e.value,t,n,r);if(je(e)){let o=e.args;for(let s of o)if(!s||typeof s.then!="function")return K(s,t,n,r);if(o.length>0)try{let s=await Promise.race(o.map(i=>Promise.resolve(i).catch(()=>{})));return K(s,t,n,r)}catch{return}return}if(!(Xe(e)||Ze(e))){if(Array.isArray(e)){for(let o of e)await K(o,t,n,r);return}if(ve(e)){let o=e;for(let s=0;s<o.items.length;s++)await K(o.templateFn(o.items[s],s),t,n,r);return}if(kn(e)){let o=e;if(t){let s=`s${t.nextId++}`;n.enqueue(`<webjs-boundary id="${s}">`),await K(o.fallback,t,n,r),n.enqueue("</webjs-boundary>"),t.pending.push({id:s,promise:Promise.resolve(o.children),formScope:r})}else await K(o.fallback,t,n,r);return}if(B(e)){await ul(e,t,n,r);return}n.enqueue(Zt(String(e)))}}}}async function ul(e,t,n,r="none"){let{strings:o,values:s}=e,i="text",a="",c=0,l="",f=0,u="",h="",d="",p=-1,w=null,A=0,S=[],b=[],x=null,y=r,E=!1,j=()=>{let v=S,_=b,m=A>1,g=x;if(S=[],b=[],A=0,x=null,w!=null){xt({duplicateAction:m,propAttrs:v});let T=cr(d.slice(p),w);d=d.slice(0,p)+T.tag+T.hidden,w=null,y="bound"}!E&&u==="form"&&y!=="bound"&&(y="unbound"),g!=null?Ct(d.slice(p),g,{bound:!0,duplicateAction:m,propAttrs:_}):y==="bound"&&!E&&(u==="button"||u==="input")&&Ct(d.slice(p),u,{bound:!1,propAttrs:_})},I=(v,_)=>{let m=String(_).toLowerCase();if(m==="button"||m==="input"){Ye(v)&&b.push(String(v));return}if(m!=="form")return;let g=String(v).toLowerCase();g==="encoding"&&(g="enctype"),(g==="method"||g==="enctype")&&S.push(String(v))},C=(v,_)=>{let m=String(_).toLowerCase(),g=String(v).toLowerCase();(m==="form"&&g==="action"||(m==="button"||m==="input")&&g==="formaction")&&(A+=1)},k=v=>{j(),E&&u==="form"&&(y=r==="unknown"?"unknown":"none"),E=!1,i=v&&Gr(u)?"rawtext":"text",i==="rawtext"&&(h="")};for(let v=0;v<o.length;v++){let _=o[v];for(let m=0;m<_.length;m++){let g=_[m];switch(i){case"text":d+=g,g==="<"&&(i="tag-open",p=d.length-1,E=!1);break;case"tag-open":d+=g,g==="!"?i="bang-1":g==="/"?(i="tag-name",u="",E=!0):/[a-zA-Z]/.test(g)?(i="tag-name",u=g.toLowerCase()):i="text";break;case"bang-1":d+=g,i=g==="-"?"bang-dash":"tag-name";break;case"bang-dash":d+=g,g==="-"?(i="comment",f=0):i="tag-name";break;case"comment":d+=g,g==="-"?f+=1:(g===">"&&f>=2&&(i="text"),f=0);break;case"tag-name":d+=g,g===">"?k(!0):/\s/.test(g)?i="in-tag":u+=g.toLowerCase();break;case"in-tag":d+=g,g===">"?k(!0):!/\s/.test(g)&&g!=="/"&&(i="attr-name",a=g,c=d.length-1);break;case"rawtext":d+=g,h=(h+g.toLowerCase()).slice(-9),(h.endsWith("<\/script>")||h.endsWith("</style>"))&&(i="text",h="",u="");break;case"attr-name":g==="="?(i="after-eq",d+=g):/\s/.test(g)?(i="in-tag",a="",d+=g):g===">"?(i="text",a="",d+=g,k(!1)):(a+=g,d+=g);break;case"after-eq":g==='"'||g==="'"?(i="attr-quoted",l=g,d+=g):/\s/.test(g)?(i="in-tag",a="",d+=g):g===">"?(i="text",a="",d+=g,k(!1)):(i="attr-unquoted",d+=g);break;case"attr-unquoted":/\s/.test(g)?(i="in-tag",a="",d+=g):g===">"?(i="text",a="",d+=g,k(!1)):d+=g;break;case"attr-quoted":d+=g,g===l&&(i="in-tag",a="");break}}if(v<s.length){let m=s[v];if(m&&typeof m.then=="function"&&(m=await m),i==="comment")d+=String(m??""),f=0;else if(i==="rawtext")d+=String(m??""),h="";else if(i==="text")d&&(n.enqueue(d),d=""),await K(m,t,n,y);else if(i==="after-eq"){let g=a[0],T=a.slice(1),N=He[g];if(N==="event"||N==="prop")N==="prop"&&!u.includes("-")&&(vt(m,T,u),I(T,u)),d=d.slice(0,c),i="in-tag",a="";else if(N==="bool")G(m,T,u),d=d.slice(0,c),m&&(d+=`${T}=""`),i="in-tag",a="";else if(Ue(m,a,u)){if(C(a,u),u==="form")w=pe(await At(m),u),d=d.slice(0,c).replace(/\s+$/,"");else{ze(x!=null,u),y!=="unknown"&&Et(y==="bound",u);let Y=kt(d.slice(p));Y.has("name")&&We(Y.get("name")||"",u,!1),Y.has("value")&&Ve(u),Y.has("form")&&Ke(u);let wt=pe(await At(m),u);x=u,d=d.slice(0,c)+`name="${R}" value="${H(wt)}"`}i="in-tag",a=""}else C(a,u),G(m,a,u),d+=`"${H(String(m??""))}"`,i="in-tag",a=""}else(i==="attr-quoted"||i==="attr-unquoted")&&(G(m,a,u),d+=H(String(m??"")))}}d&&n.enqueue(d)}async function fl(e,t,n){let r=Kr(),o=r?` nonce="${H(r)}"`:"";for(;e.pending.length;){let s=e.pending.splice(0);await Promise.all(s.map(async({id:i,promise:a,formScope:c})=>{try{let l=await a,f=await M(l,e,c),u=await we(f,e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${u}</template><script${o}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(l){console.error(`[webjs] Suspense boundary "${i}" rejected:`,l);try{let f=l instanceof Error?l:new Error(String(l)),u=await we(await M(Ks("webjs-suspense",f,n),e),e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${u}</template><script${o}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(f){console.error(`[webjs] Suspense boundary "${i}" error render also threw:`,f)}}}))}}var Ys=Symbol.for("webjs.notFound"),Gs=Symbol.for("webjs.redirect"),Js=Symbol.for("webjs.forbidden"),Xs=Symbol.for("webjs.unauthorized");function dl(){let e=new Error("webjs: notFound()");throw e.__webjs=Ys,e}function pl(){let e=new Error("webjs: forbidden()");throw e.__webjs=Js,e}function hl(){let e=new Error("webjs: unauthorized()");throw e.__webjs=Xs,e}function ml(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=Gs,r.url=e,r.status=typeof n=="number"?n:void 0,r}function bl(e){return!!e&&e.__webjs===Ys}function gl(e){return!!e&&e.__webjs===Gs}function yl(e){return!!e&&e.__webjs===Js}function wl(e){return!!e&&e.__webjs===Xs}var Jr=null;function _l(e){Jr=e}function Sl(e){if(typeof e!="string"||!e||!Jr)return e;try{return Jr(e)||e}catch{return e}}function Al(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,s=null,i=[];function a(){o||(s=new WebSocket(El(e),t.protocols),s.onopen=c=>{for(r=0;i.length&&s&&s.readyState===WebSocket.OPEN;)s.send(i.shift());t.onOpen?.(c)},s.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},s.onerror=c=>{t.onError?.(c)},s.onclose=c=>{if(t.onClose?.(c),!o&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(a,l)}})}return a(),{send(c){let l=typeof c=="string"||c instanceof ArrayBuffer||ArrayBuffer.isView(c)?c:JSON.stringify(c);s&&s.readyState===WebSocket.OPEN?s.send(l):i.push(l)},close(c,l){o=!0;try{s?.close(c,l)}catch{}},get socket(){return s},get readyState(){return s?.readyState??3}}}function El(e){if(/^wss?:\/\//i.test(e))return e;let t=typeof location<"u"&&location.protocol==="https:"?"wss:":"ws:",n=typeof location<"u"?location.host:"";return`${t}//${n}${e.startsWith("/")?e:"/"+e}`}at();var Xr="application/vnd.webjs+json";async function vl(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",Xr);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 Dt(r),n.has("content-type")||n.set("content-type",Xr));let o=await fetch(e,{...t,headers:n,body:r}),s=o.headers.get("content-type")||"",i=await o.text(),a=s.includes(Xr)?i?ue(i):null:s.includes("application/json")?i?JSON.parse(i):null:i;if(!o.ok){let c=a&&a.error||`richFetch ${e} -> ${o.status}`,l=new Error(c);throw l.status=o.status,l.body=a,l}return a}at();to();eo();Rn();var Ro=class{constructor(t,n){this.host=t,this.options=n,this.updates=[],this._nextId=0}get value(){let t=this.options.source();if(!this.options.update)return this.updates.length>0?this.updates[this.updates.length-1].payload:t;for(let n of this.updates)t=this.options.update(t,n.payload);return t}add(t,n){let r=`opt-${++this._nextId}`;this.updates.push({id:r,payload:t}),this.host?.requestUpdate?.();let o=()=>{let s=this.updates.findIndex(i=>i.id===r);s!==-1&&(this.updates.splice(s,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>o()).catch(()=>{}):n.then(()=>o(),()=>o())),o}};async function Eu(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(s){throw e.set(r),s}return o&&o.success===!1&&e.set(r),o}function vu(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Eu(e,t,n):new Ro(e,t)}oo();ao();var xu="application/vnd.webjs+stream",Cu=1,ku=2,Nu=3,Yi=new Uint8Array(0);function Tu(e,t){let n=t||Yi,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 ju(){let e=Yi;return{push(t){if(t&&t.length){let r=new Uint8Array(e.length+t.length);r.set(e,0),r.set(t,e.length),e=r}let n=[];for(;e.length>=5;){let r=e[0],o=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+o)break;let s=e.slice(5,5+o);n.push({type:r,payload:s}),e=e.slice(5+o)}return n}}}var Ru=Symbol.for("webjs.context");function Lu(e){return{__context__:Ru,name:e}}var tr=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},Lo=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let s=o;if(s.context===this._context)if(o.stopPropagation(),s.subscribe){let i={callback:s.callback},a=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),s.callback(this._value,a)}else s.callback(this._value)},typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}setValue(t){if(!Object.is(this._value,t)){this._value=t;for(let n of this._subscriptions){let r=()=>{this._subscriptions.delete(n)};n.callback(t,r)}}}hostConnected(){this._host.addEventListener("context-request",this._onRequest)}hostDisconnected(){this._host.removeEventListener("context-request",this._onRequest),this._subscriptions.clear()}},Oo=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 tr(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 Ou(){return typeof window<"u"}var de={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},$o=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=de.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=de.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=de.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=de.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 de.INITIAL:return t.initial?.();case de.PENDING:return t.pending?.();case de.COMPLETE:return t.complete?.(this._value);case de.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!Ou())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{Oo as ContextConsumer,Lo as ContextProvider,tr as ContextRequestEvent,R as FORM_ACTION_FIELD,Do as FORM_ACTION_ID_KEY,Cu as FRAME_CHUNK,ku as FRAME_END,Nu as FRAME_ERROR,F as MARKER,ai as SEED_MISS,xu as STREAM_CONTENT_TYPE,jt as Signal,Dc as Suspense,$o as Task,de as TaskStatus,Cn as WebComponent,Qr as WebjsFrame,no as WebjsStream,gc as activeActionSignal,rr as adoptStyles,Ur as allTags,Sl as asset,ha as asyncAppend,ma as asyncReplace,xa as batch,da as cache,ka as computed,Al as connectWS,Il as consumeStale,Lu as createContext,ju as createFrameDecoder,fa as createRef,Kr as cspNonce,Xi as css,Ps as deserialize,hi as disableClientRouter,Ta as effect,wo as enableClientRouter,Tu as encodeFrame,H as escapeAttr,Zt as escapeText,Ol as fetchMark,pl as forbidden,ca as guard,nr as html,Xe as isAsyncAppend,Ze as isAsyncReplace,qe as isCSS,Te as isCache,yl as isForbidden,ke as isGuard,Ce as isKeyed,_c as isLazy,xe as isLive,bl as isNotFound,gl as isRedirect,Ne as isRef,ve as isRepeat,Na as isSignal,kn as isSuspense,B as isTemplate,Je as isTemplateContent,wl as isUnauthorized,Ge as isUnsafeHTML,je as isUntil,Re as isWatch,aa as keyed,ia as live,Hr as lookup,wc as lookupModuleUrl,so as markStale,mi as navigate,dl as notFound,vu as optimistic,ue as parse,io as parseTagHeader,yc as primeModuleUrl,Fc as prop,ml as redirect,ua as ref,qr as register,$l as registerKeyTags,it as render,ro as renderStream,ll as renderToStream,qc as renderToString,Ko as repeat,bi as revalidate,vl as richFetch,Ln as scanSeeds,Is as serialize,An as setActiveActionSignal,_l as setAssetUrlProvider,Bc as setCspNonceProvider,Zi as setFormActionResolver,Ca as signal,Dt as stringify,Xt as stylesToString,Pt as tagOf,Rl as takeSeed,la as templateContent,hl as unauthorized,lr as unsafeHTML,pa as until,ba as watch};
|
|
9
10
|
//# sourceMappingURL=webjs-core.js.map
|