what-core 0.13.10 → 0.14.0
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/chunk-FN6HXME3.min.js +11 -0
- package/dist/chunk-VKZY7JPN.min.js +1 -0
- package/dist/index.min.js +2 -2
- package/dist/render.min.js +1 -1
- package/dist/testing.min.js +1 -1
- package/package.json +1 -1
- package/src/agent-context.js +1 -1
- package/src/dom.js +29 -27
- package/src/reactive.js +16 -7
- package/src/render.js +4 -4
- package/dist/chunk-XRUIKSAO.min.js +0 -11
- package/dist/chunk-ZDIHSTQJ.min.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{E as Nt,Q as q,R as Bt,T as v,U as ct,V as O,W as yt,Y as W,Z as Mt,_ as F,a as z,ba as Dt,ca as Ht,d as I,da as mt,f as j,j as Tt,n as Q,r as St,z as Lt}from"./chunk-VKZY7JPN.min.js";import{a as Z}from"./chunk-6YOUZ6T4.min.js";var jt=I(null);typeof document<"u"&&document.addEventListener("focusin",t=>{jt.set(t.target)});function Me(){return{current:()=>jt(),focus:t=>t?.focus(),blur:()=>document.activeElement?.blur()}}function De(){let t={current:null};function e(r){typeof document>"u"||(t.current=r||document.activeElement||null)}function n(r){let o=t.current||r;o&&typeof o.focus=="function"&&o.focus()}return{capture:e,restore:n,previous:()=>t.current}}function te(t){let e=null;function n(){if(typeof document>"u")return;e=document.activeElement;let o=t.current||t;if(!o||typeof o.querySelectorAll!="function")return;let i=Pt(o);if(i.length===0)return;i[0].focus();function g(c){if(c.key!=="Tab")return;let p=Pt(o),l=p[0],d=p[p.length-1];c.shiftKey?document.activeElement===l&&(c.preventDefault(),d.focus()):document.activeElement===d&&(c.preventDefault(),l.focus())}return o.addEventListener("keydown",g),()=>{o.removeEventListener("keydown",g)}}function r(){e&&typeof e.focus=="function"&&e.focus()}return{activate:n,deactivate:r}}function Pt(t){let e=["button:not([disabled])","a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(t.querySelectorAll(e)).filter(n=>n.offsetParent!==null)}function He({children:t,active:e=!0}){let n={current:null},r=I(0),o=te(n),i=null,g=l=>{n.current=l,r.set(d=>d+1)},c=j(()=>{if(r(),i&&(i(),i=null,o.deactivate()),e&&n.current)return i=o.activate(),()=>{i?.(),i=null,o.deactivate()}}),p=Mt?.();return p&&(p._cleanupCallbacks=p._cleanupCallbacks||[],p._cleanupCallbacks.push(()=>{c(),i?.(),i=null,o.deactivate()})),Z("div",{ref:g},t)}var k=null,bt=0;function ee(){return typeof document>"u"?null:(k||(k=document.createElement("div"),k.id="what-announcer",k.setAttribute("aria-live","polite"),k.setAttribute("aria-atomic","true"),k.style.cssText=`
|
|
2
|
+
position: absolute;
|
|
3
|
+
width: 1px;
|
|
4
|
+
height: 1px;
|
|
5
|
+
padding: 0;
|
|
6
|
+
margin: -1px;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
clip: rect(0, 0, 0, 0);
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
border: 0;
|
|
11
|
+
`,document.body.appendChild(k)),k)}function ne(t,e={}){let{priority:n="polite",timeout:r=1e3}=e,o=ee();if(!o)return;o.setAttribute("aria-live",n);let i=++bt;o.textContent="",requestAnimationFrame(()=>{bt===i&&(o.textContent=t)}),setTimeout(()=>{bt===i&&(o.textContent="")},r)}function Pe(t){return ne(t,{priority:"assertive"})}function je({href:t="#main",children:e="Skip to content"}){return Z("a",{href:t,class:"what-skip-link",onClick:n=>{n.preventDefault();let r=document.querySelector(t);r&&(r.focus(),r.scrollIntoView())},style:{position:"absolute",top:"-40px",left:"0",padding:"8px",background:"#000",color:"#fff",textDecoration:"none",zIndex:"10000"},onFocus:n=>{n.target.style.top="0"},onBlur:n=>{n.target.style.top="-40px"}},e)}function xt(t){return t?"true":"false"}function Re(t=!1){let e=I(t);return{expanded:()=>e(),toggle:()=>e.set(!e.peek()),open:()=>e.set(!0),close:()=>e.set(!1),buttonProps:()=>({"aria-expanded":()=>xt(e()),onClick:()=>e.set(!e.peek())}),panelProps:()=>({hidden:()=>!e()})}}function $e(t=null){let e=I(t);return{selected:()=>e(),select:n=>e.set(n),isSelected:n=>e()===n,itemProps:n=>({"aria-selected":()=>xt(e()===n),onClick:()=>e.set(n)})}}function Ke(t=!1){let e=I(t);return{checked:()=>e(),toggle:()=>e.set(!e.peek()),set:n=>e.set(n),checkboxProps:()=>({role:"checkbox","aria-checked":()=>xt(e()),tabIndex:0,onClick:()=>e.set(!e.peek()),onKeyDown:n=>{(n.key===" "||n.key==="Enter")&&(n.preventDefault(),e.set(!e.peek()))}})}}function Oe(t,e={}){let n=typeof t=="function"?t:()=>t,r=I(0),o=e?.role||null,i=[],g=[],c=[];function p(h){let s=g[h];return s||(s={get current(){return i[h]||null},set current(a){i[h]=a||null;let x=c[h];typeof x=="function"?x(a):x&&typeof x=="object"&&(x.current=a)}},g[h]=s),s}function l(h){let s=i[h];return s?s.isConnected===!1?null:s:null}function d(h){let s=l(h);return!s||typeof s.focus!="function"?null:((typeof document>"u"||document.activeElement!==s)&&s.focus(),s)}function f(){if(typeof document>"u")return!1;let h=document.activeElement;if(!h)return!1;for(let s=0;s<i.length;s++){let a=i[s];if(a&&(a===h||typeof a.contains=="function"&&a.contains(h)))return!0}return!1}function m(h,s){return!(s>0)||h<0?0:h>s-1?s-1:h}function b(){return m(r(),n())}function y(h){return Number.isInteger(h)&&h>=0&&h<n()}function _(h){let s=n();if(s<=0)return;let a=m(r.peek(),s),x=a;switch(h.key){case"ArrowDown":case"ArrowRight":x=(a+1)%s;break;case"ArrowUp":case"ArrowLeft":x=(a-1+s)%s;break;case"Home":x=0;break;case"End":x=s-1;break;default:return}h.preventDefault(),r.set(x),d(x)}return{focusIndex:()=>b(),setFocusIndex:h=>{y(h)&&(r.set(h),f()&&d(h))},focusItem:h=>y(h)?(r.set(h),d(h)):null,getItemProps:(h,s)=>{let{ref:a,...x}=s||{};return c[h]=a||null,{ref:p(h),tabIndex:()=>b()===h?0:-1,onKeyDown:_,onFocus:S=>{let D=S&&(S.currentTarget||S.target);D&&(i[h]=D),r.set(h)},...x}},containerProps:h=>o?{role:o,...h}:{...h}}}function Ie({children:t,as:e="span"}){return Z(e,{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}},t)}function Ve({children:t,priority:e="polite",atomic:n=!0}){return Z("div",{"aria-live":e,"aria-atomic":n},t)}var Rt=0;function $t(){let t=St();return t?(t.idCounter=(t.idCounter||0)+1,t.idCounter):++Rt}function Kt(){Rt=0}function Ot(t="what"){let e=`${t}-${$t()}`;return()=>e}function ze(t,e="what"){let n=[];for(let r=0;r<t;r++)n.push(`${e}-${$t()}`);return n}function ke(t){let e=Ot("desc");return{descriptionId:e,descriptionProps:()=>({id:e(),style:{display:"none"}}),describedByProps:()=>({"aria-describedby":e()}),Description:()=>Z("div",{id:e(),style:{display:"none"}},t)}}function Ge(t){let e=Ot("label");return{labelId:e,labelProps:()=>({id:e()}),labelledByProps:()=>({"aria-labelledby":e()})}}var Ue={Enter:"Enter",Space:" ",Escape:"Escape",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Home:"Home",End:"End",Tab:"Tab"};function qe(t,e){return n=>{n.key===t&&e(n)}}function We(t,e){return n=>{t.includes(n.key)&&e(n)}}var nt=null;function Fe(t){nt=typeof t=="function"?t:null}function re(t,e,n){if(typeof n=="function"){let r=()=>{let o=n();return o.length===1?o[0]:o};return r._lazyChildren=!0,e=e?Object.assign({},e):{},Object.defineProperty(e,"_$lazyChildren",{value:r,configurable:!0}),{tag:t,props:e,children:[],key:null,_vnode:!0}}if(n&&n.length>0){let r=n.length===1?n[0]:n;e=e?Object.assign({},e,{children:r}):{children:r}}return{tag:t,props:e||{},children:n||[],key:null,_vnode:!0}}function tn(t,e,n){return W(re(t,e,n))}var oe={tr:{depth:2,wrap:"<table><tbody>",unwrap:"</tbody></table>"},td:{depth:3,wrap:"<table><tbody><tr>",unwrap:"</tr></tbody></table>"},th:{depth:3,wrap:"<table><tbody><tr>",unwrap:"</tr></tbody></table>"},thead:{depth:1,wrap:"<table>",unwrap:"</table>"},tbody:{depth:1,wrap:"<table>",unwrap:"</table>"},tfoot:{depth:1,wrap:"<table>",unwrap:"</table>"},colgroup:{depth:1,wrap:"<table>",unwrap:"</table>"},col:{depth:1,wrap:"<table>",unwrap:"</table>"},caption:{depth:1,wrap:"<table>",unwrap:"</table>"}},ie=new Set(["svg","path","circle","rect","line","polyline","polygon","ellipse","g","defs","use","text","tspan","foreignObject","clipPath","mask","pattern","linearGradient","radialGradient","stop","marker","symbol","image","animate","animateTransform","animateMotion","set","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feImage","feMorphology","feSpecularLighting","feTile","feTurbulence","feDistantLight","fePointLight","feSpotLight"]);function Gt(t){let e=t.match(/^<([a-zA-Z][a-zA-Z0-9]*)/);return e?e[1]:""}function ce(t){let e=t.trim(),n=Gt(e);if(ie.has(n))return fe(e);let r=oe[n];if(r){let i=document.createElement("template");i.innerHTML=r.wrap+e+r.unwrap;let g=i.content.firstChild;for(let c=0;c<r.depth;c++)g=g.firstChild;return()=>g.cloneNode(!0)}let o=document.createElement("template");if(o.innerHTML=e,z&&o.content.childNodes.length!==1){let i=[...o.content.childNodes].find((g,c)=>c>0&&g.nodeType===1);throw Object.assign(new Error(`[what] <${n}> cannot contain <${i?i.nodeName.toLowerCase():"that element"}>: the HTML parser closed the outer tag early, so the rendered tree does not match your JSX.`),{code:"ERR_INVALID_HTML_NESTING"})}return()=>o.content.firstChild.cloneNode(!0)}var It=!1;function en(t){return z&&!It&&(It=!0,console.warn("[what] template() is a compiler internal. Use JSX instead. Direct calls with user input can lead to XSS vulnerabilities.")),ce(t)}function fe(t){let e=t.trim();if(Gt(e)==="svg"){let o=document.createElement("template");return o.innerHTML=e,()=>o.content.firstChild.cloneNode(!0)}let r=document.createElement("template");return r.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg">${e}</svg>`,()=>r.content.firstChild.firstChild.cloneNode(!0)}function Ut(t,e){if(!t)return;let n=!1,r=()=>{n||(n=!0,e())},o=t._dispose;t._dispose=o?()=>{o(),r()}:r}function qt(t,e,n){if(typeof e=="function"&&e._mapArray)return e(t,n||null);if(typeof e=="function"&&e._lazyChildren)return qt(t,e(),n);if(typeof e=="function"){let r=n||null,o=null,i=null,g=!1,c=Et(),p=j(()=>Xt(c,()=>{let l=e(),d=typeof l;if(!g){g=!0,d==="string"||d==="number"?(i=document.createTextNode(String(l)),r?t.insertBefore(i,r):t.appendChild(i),nt&&nt(t,String(l)),o=i):o=st(t,l,null,r);return}if(i!==null&&(d==="string"||d==="number")){let f=String(l);i.data!==f&&(i.data=f),nt&&nt(t,f);return}i=null,o=st(t,l,o,r)}));return Ut(r||t,p),o}if(typeof e=="string"||typeof e=="number"){let r=document.createTextNode(String(e));return n?t.insertBefore(r,n):t.appendChild(r),r}return e!=null&&typeof e=="object"&&e.nodeType>0?(n?t.insertBefore(e,n):t.appendChild(e),e):st(t,e,null,n||null)}function Wt(t){return!t||typeof t!="object"?!1:typeof Node<"u"&&t instanceof Node?!0:typeof t.nodeType=="number"&&typeof t.nodeName=="string"}function se(t){return!!t&&typeof t=="object"&&(t._vnode===!0||"tag"in t)}var dt=typeof SVGElement<"u";function At(t){return dt&&t instanceof SVGElement&&t.tagName!=="foreignObject"}function Et(){let t=F();return t[t.length-1]||null}function Xt(t,e){let n=F(),r=t!==null&&n[n.length-1]!==t;r&&n.push(t);try{return e()}finally{r&&n.pop()}}function Vt(t){return t==null?[]:Array.isArray(t)?t:[t]}function Jt(t,e,n){if(t==null||typeof t=="boolean")return n;if(Array.isArray(t)){for(let r=0;r<t.length;r++)Jt(t[r],e,n);return n}if(typeof t=="function"){let r=W(t,e,At(e));if(r&&r.nodeType===11){let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}else r&&n.push(r);return n}if(typeof t=="string"||typeof t=="number")return n.push(document.createTextNode(String(t))),n;if(Wt(t)){if(t.nodeType===11&&t.childNodes.length>0){let r=Array.from(t.childNodes);for(let o=0;o<r.length;o++)n.push(r[o])}else n.push(t);return n}if(se(t)){let r=W(t,e,At(e));if(r&&r.nodeType===11)if(r.childNodes.length===0)n.push(r);else{let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}else r&&n.push(r);return n}return n.push(document.createTextNode(String(t))),n}function le(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function st(t,e,n,r){if(!t||typeof t.insertBefore!="function")return z&&console.warn("[what] reconcileInsert called with invalid parent:",t),n;let o=r||null;if(e==null||typeof e=="boolean"){let d=yt(Vt(n));for(let f=0;f<d.length;f++){let m=d[f];m.parentNode===t&&(O(m),t.removeChild(m))}return null}if((typeof e=="string"||typeof e=="number")&&n&&!Array.isArray(n)&&n.nodeType===3){let d=String(e);return n.data!==d&&(n.data=d),n}if(typeof e=="object"&&e!==null&&e.nodeType>0&&e.nodeType!==11&&!Array.isArray(e)){if(e===n)return n;if(n&&!Array.isArray(n)&&n.nodeType>0&&n.nodeType!==11)return n.parentNode===t?(O(n),t.replaceChild(e,n)):o?t.insertBefore(e,o):t.appendChild(e),e}let i=Jt(e,t,[]),g=Vt(n);if(le(g,i))return n;let c=yt(g),p=i.length;for(let d=0;d<c.length;d++){let f=c[d];if(f.parentNode!==t)continue;let m=!1;for(let b=0;b<p;b++)if(i[b]===f){m=!0;break}m||(O(f),t.removeChild(f))}let l=o;for(let d=i.length-1;d>=0;d--){let f=i[d];(f.parentNode!==t||f.nextSibling!==l)&&(l&&l.parentNode!==t&&(l=null),l?t.insertBefore(f,l):t.appendChild(f)),l=f}return i.length===0?null:i.length===1?i[0]:i}function nn(t,e,n){let r=n?.key,o=n?.raw||!1,i=(g,c)=>{let p=[],l=[],d=[],f=r&&!o?new Map:null,m=document.createComment("/list");g.insertBefore(m,c||null);let b=j(()=>{let y=t()||[],_=m.parentNode||g;r?pe(_,m,p,y,l,d,e,r,f):ue(_,m,p,y,l,d,e),p=y.length>0?y.slice():y});return Ut(m,()=>{b();for(let y=0;y<d.length;y++)d[y]?.();d.length=0}),m};return i._mapArray=!0,i._mapArraySource=t,i._mapArrayFn=e,i._mapArrayKeyed=!!r&&!o,i}function rn(t){let e=t._mapArraySource()||[],n=t._mapArrayFn,r=t._mapArrayKeyed;return e.map((o,i)=>n(r?()=>o:o,i))}function ue(t,e,n,r,o,i,g){let c=r.length,p=n.length;if(c===0){if(p>0){for(let s=0;s<p;s++)i[s]&&i[s]();for(let s=p-1;s>=0;s--){let a=o[s];a&&(O(a),a.parentNode===t&&t.removeChild(a))}o.length=0,i.length=0}return}if(p===0){let s=document.createDocumentFragment();for(let a=0;a<c;a++){let x=r[a],S=Q(D=>(i[a]=D,g(x,a)));o[a]=S,s.appendChild(S)}t.insertBefore(s,e);return}let l=0,d=Math.min(p,c);for(;l<d&&n[l]===r[l];)l++;if(l===p&&l===c)return;let f=p-1,m=c-1;for(;f>=l&&m>=l&&n[f]===r[m];)f--,m--;let b=new Array(c),y=new Array(c);for(let s=0;s<l;s++)b[s]=o[s],y[s]=i[s];for(let s=m+1;s<c;s++){let a=f+1+(s-m-1);b[s]=o[a],y[s]=i[a]}let _=m-l+1,h=f-l+1;if(_===0)for(let s=l;s<=f;s++)i[s]?.(),o[s]&&O(o[s]),o[s]?.parentNode&&o[s].parentNode.removeChild(o[s]);else if(h===0){let s=l<c&&b[m+1]?b[m+1]:e,a=document.createDocumentFragment();for(let x=l;x<=m;x++){let S=r[x],D=x;b[x]=Q(N=>(y[D]=N,g(S,D))),a.appendChild(b[x])}t.insertBefore(a,s)}else ae(t,e,n,r,o,i,g,l,f,m,b,y);o.length=c,i.length=c;for(let s=0;s<c;s++)o[s]=b[s],i[s]=y[s]}function ae(t,e,n,r,o,i,g,c,p,l,d,f){let m=new Map;for(let a=c;a<=p;a++)m.set(n[a],a);let b=l-c+1,y=new Int32Array(b);y.fill(-1);for(let a=c;a<=l;a++){let x=m.get(r[a]);x!==void 0&&(m.delete(r[a]),d[a]=o[x],f[a]=i[x],y[a-c]=x)}for(let[,a]of m)i[a]?.(),o[a]&&O(o[a]),o[a]?.parentNode&&o[a].parentNode.removeChild(o[a]);let _=b-de(y,b),h=new Uint8Array(b);if(_>1){let a=new Int32Array(_),x=new Int32Array(_),S=0;for(let N=0;N<b;N++)y[N]!==-1&&(a[S]=y[N],x[S]=N,S++);let D=Zt(a,_);for(let N=0;N<D.length;N++)h[x[D[N]]]=1}else if(_===1){for(let a=0;a<b;a++)if(y[a]!==-1){h[a]=1;break}}for(let a=c;a<=l;a++)if(!d[a]){let x=r[a],S=a;d[a]=Q(D=>(f[S]=D,g(x,S)))}let s=l+1<d.length&&d[l+1]?d[l+1]:e;for(let a=l;a>=c;a--){let x=a-c;(y[x]===-1||!h[x])&&(s&&s.parentNode!==t&&(s=e),t.insertBefore(d[a],s)),s=d[a]}}function de(t,e){let n=0;for(let r=0;r<e;r++)t[r]===-1&&n++;return n}function Zt(t,e){if(e===0)return[];if(e===1)return[0];let n=new Int32Array(e),r=new Int32Array(e),o=1;n[0]=0,r[0]=-1;for(let c=1;c<e;c++)if(t[c]>t[n[o-1]])r[c]=n[o-1],n[o++]=c;else{let p=0,l=o-1;for(;p<l;){let d=p+l>>1;t[n[d]]<t[c]?p=d+1:l=d}n[p]=c,r[c]=p>0?n[p-1]:-1}let i=new Array(o),g=n[o-1];for(let c=o-1;c>=0;c--)i[c]=g,g=r[g];return i}function he(){return document.createComment("i")}function tt(t,e,n,r){let o=e;for(;o&&o!==n;){let i=o.nextSibling;t.insertBefore(o,r),o=i}}function _t(t,e,n){let r=e;for(;r&&r!==n;){let o=r.nextSibling;O(r),t.removeChild(r),r=o}}function wt(t,e,n,r,o,i,g,c,p){let l;if(o){let m=r(e),b=p(e);l=b,o.set(m,{itemSig:b})}else l=e;let d=he();t.appendChild(d);let f=Q(m=>(c[n]=m,i(l,n)));t.appendChild(f),g[n]=d}function pe(t,e,n,r,o,i,g,c,p){let l=r.length,d=n.length;if(l===0){if(d>0){for(let u=0;u<d;u++)i[u]&&i[u]();o[0]&&_t(t,o[0],e),o.length=0,i.length=0,p&&p.clear()}return}if(d===0){let u=document.createDocumentFragment();for(let E=0;E<l;E++)wt(u,r[E],E,c,p,g,o,i,I);t.insertBefore(u,e);return}let f=0,m=Math.min(d,l);for(;f<m;){if(n[f]===r[f]){f++;continue}let u=c(n[f]),E=c(r[f]);if(u!==E)break;p&&p.get(u).itemSig.set(r[f]),f++}let b=d-1,y=l-1;for(;b>=f&&y>=f;){if(n[b]===r[y]){b--,y--;continue}let u=c(n[b]),E=c(r[y]);if(u!==E)break;p&&p.get(u).itemSig.set(r[y]),b--,y--}if(f>b&&f>y)return;let _=new Array(l),h=new Array(l);for(let u=0;u<f;u++)_[u]=o[u],h[u]=i[u];for(let u=y+1;u<l;u++){let E=b+1+(u-y-1);_[u]=o[E],h[u]=i[E]}let s=y-f+1,a=b-f+1;if(a===0){let u=y+1<l&&_[y+1]?_[y+1]:e,E=document.createDocumentFragment();for(let B=f;B<=y;B++)wt(E,r[B],B,c,p,g,_,h,I);t.insertBefore(E,u),et(o,i,_,h,l);return}if(s===0){for(let u=f;u<=b;u++){i[u]?.();let E=X(t,o[u],o,u,e);_t(t,o[u],E),p&&p.delete(c(n[u]))}et(o,i,_,h,l);return}if(s===a&&s>=2&&s<=Math.max(a,200)){let u=0,E=-1,B=-1;for(let A=0;A<s&&u<=4;A++){let C=c(n[f+A]),K=c(r[f+A]);C!==K&&(u===0?E=A:u===1&&(B=A),u++)}if(u===2){let A=f+E,C=f+B,K=c(n[A]),J=c(n[C]),gt=c(r[A]),U=c(r[C]);if(K===U&&J===gt){for(let L=0;L<f;L++)_[L]=o[L],h[L]=i[L];for(let L=f;L<=y;L++)_[L]=o[L],h[L]=i[L];for(let L=y+1;L<l;L++){let $=b+1+(L-y-1);_[L]=o[$],h[L]=i[$]}let R=_[A];_[A]=_[C],_[C]=R;let M=h[A];if(h[A]=h[C],h[C]=M,p){if(r[A]!==n[A]){let L=c(r[A]),$=p.get(L);$&&$.itemSig.set(r[A])}if(r[C]!==n[C]){let L=c(r[C]),$=p.get(L);$&&$.itemSig.set(r[C])}}let H=C===A+1||A===C+1,P=Math.min(A,C),T=Math.max(A,C);if(H){let L=X(t,o[T],o,T,e);tt(t,o[T],L,o[P])}else{let L=X(t,o[C],o,C,e),$=document.createComment("tmp");t.insertBefore($,o[C]),tt(t,o[C],L,o[A]);let Ft=X(t,o[A],o,A,e);tt(t,o[A],Ft,$),t.removeChild($)}et(o,i,_,h,l);return}}if(u>=2&&u<=s){let A=E,C=-1,K=-1,J=!1,gt=c(n[f+A]),U=-1;for(let R=A;R<s;R++)if(c(r[f+R])===gt){U=R;break}if(U>A){let R=!0;for(let M=A;M<U;M++)if(c(n[f+M+1])!==c(r[f+M])){R=!1;break}if(R){let M=!0;for(let H=U+1;H<s;H++)if(c(n[f+H])!==c(r[f+H])){M=!1;break}M&&(J=!0,C=f+A,K=f+U)}}if(!J){let R=c(r[f+A]),M=-1;for(let H=A;H<a;H++)if(c(n[f+H])===R){M=H;break}if(M>A){let H=!0;for(let P=A;P<M;P++)if(c(n[f+P])!==c(r[f+P+1])){H=!1;break}if(H){let P=!0;for(let T=M+1;T<s;T++)if(c(n[f+T])!==c(r[f+T])){P=!1;break}P&&(J=!0,C=f+M,K=f+A)}}}if(J){for(let T=f;T<=b;T++)_[T]=o[T],h[T]=i[T];let R=_[C],M=h[C];if(C<K)for(let T=C;T<K;T++)_[T]=_[T+1],h[T]=h[T+1];else for(let T=C;T>K;T--)_[T]=_[T-1],h[T]=h[T-1];if(_[K]=R,h[K]=M,p)for(let T=f;T<=y;T++){let L=c(r[T]);if(r[T]!==n[T]){let $=p.get(L);$&&$.itemSig.set(r[T])}}let H=X(t,R,o,C,e),P;K+1<l?P=_[K+1]:P=e,(K>=y+1||P&&P.parentNode!==t)&&(P=e),tt(t,R,H,P),et(o,i,_,h,l);return}}}let x=new Map;for(let u=f;u<=b;u++)x.set(c(n[u]),u);let S=new Int32Array(s);S.fill(-1);for(let u=f;u<=y;u++){let E=c(r[u]),B=x.get(E);B!==void 0&&(x.delete(E),_[u]=o[B],h[u]=i[B],S[u-f]=B,p&&r[u]!==n[B]&&p.get(E).itemSig.set(r[u]))}let D=[...x.values()].sort((u,E)=>E-u);for(let u of D){i[u]?.();let E=X(t,o[u],o,u,e);_t(t,o[u],E),p&&p.delete(c(n[u]))}for(let u=f;u<=y;u++)if(!_[u]){let E=document.createDocumentFragment();wt(E,r[u],u,c,p,g,_,h,I),_[u]._frag=E}let N=0,ot=!0,it=-1;for(let u=0;u<s;u++)S[u]!==-1&&(N++,S[u]<=it&&(ot=!1),it=S[u]);let V=new Uint8Array(s);if(ot)for(let u=0;u<s;u++)S[u]!==-1&&(V[u]=1);else if(N>1){let u=new Int32Array(N),E=new Int32Array(N),B=0;for(let C=0;C<s;C++)S[C]!==-1&&(u[B]=S[C],E[B]=C,B++);let A=Zt(u,N);for(let C=0;C<A.length;C++)V[E[A[C]]]=1}else if(N===1){for(let u=0;u<s;u++)if(S[u]!==-1){V[u]=1;break}}et(o,i,_,h,l);let pt=y+1<l&&o[y+1]?o[y+1]:e;for(let u=y;u>=f;u--){let E=u-f,B=o[u];if(S[E]===-1)B._frag&&(t.insertBefore(B._frag,pt),delete B._frag);else if(!V[E]){let A=X(t,B,o,u,e);tt(t,B,A,pt)}pt=B}}function X(t,e,n,r,o){let i=e.nextSibling;for(;i&&i!==o;){if(i.nodeType===8&&i.data==="i")return i;i=i.nextSibling}return o}function et(t,e,n,r,o){t.length=o,e.length=o;for(let i=0;i<o;i++)t[i]=n[i],e[i]=r[i]}function on(t,e){for(let n in e){let r=e[n];if(n==="ref"){typeof r=="function"?r(t):r&&typeof r=="object"&&(r.current=t);continue}if(q(n)){if(typeof r!="function")continue;let o=n.slice(2).toLowerCase();t.addEventListener(o,r);continue}if(typeof r=="function"&&!q(n)){if(t._propEffects||(t._propEffects={}),t._propEffects[n])try{t._propEffects[n]()}catch{}n==="class"||n==="className"?t._propEffects[n]=j(()=>{let o=r()||"";dt&&t instanceof SVGElement?t.setAttribute("class",o):t.className=o}):n==="style"&&typeof r()=="object"?t._propEffects[n]=j(()=>{ht(t,r())}):t._propEffects[n]=j(()=>{ut(t,n,r())})}else ut(t,n,r)}}function ut(t,e,n){if(e==="ref"){typeof n=="function"?n(t):n&&typeof n=="object"&&(n.current=t);return}if(e==="key")return;if(typeof n=="function"&&!q(e)){if(t._propEffects||(t._propEffects={}),t._propEffects[e])try{t._propEffects[e]()}catch{}t._propEffects[e]=j(()=>ut(t,e,n()));return}if(q(e))return;if(Bt(e,n)){typeof console<"u"&&console.warn(`[what] Blocked unsafe URL in "${e}" attribute:`,n);return}let r=dt&&t instanceof SVGElement;if(e==="class"||e==="className")r?t.setAttribute("class",n||""):t.className=n||"";else if(e==="dangerouslySetInnerHTML"){let o=n?.__html??"";typeof z<"u"&&z&&typeof o=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(o)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),t.innerHTML=o}else if(e==="innerHTML")if(n&&typeof n=="object"&&"__html"in n){let o=n.__html??"";typeof z<"u"&&z&&typeof o=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(o)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),t.innerHTML=o}else typeof console<"u"&&n!=null&&n!==""&&console.warn('[what] Plain string innerHTML is not allowed. Use { __html: "..." } or dangerouslySetInnerHTML={{ __html: "..." }} instead.');else if(e==="style")ht(t,n);else if(n==null){if(e in t)try{t[e]=""}catch{}t.removeAttribute(e)}else e.startsWith("data-")||e.startsWith("aria-")?t.setAttribute(e,n):typeof n=="boolean"?n?t.setAttribute(e,""):t.removeAttribute(e):r?t.setAttribute(e,n):e==="value"&&t.tagName==="SELECT"?mt(t,n):e in t?t[e]=n:t.setAttribute(e,n)}function rt(t,e,n,r){if(t._propEffects||(t._propEffects={}),t._propEffects[e])try{t._propEffects[e]()}catch{}t._propEffects[e]=j(()=>r(t,n()))}function ge(t,e){if(typeof e=="function")return rt(t,"class",e,ge);dt&&t instanceof SVGElement?t.setAttribute("class",e||""):t.className=e||""}function ht(t,e){if(typeof e=="function")return rt(t,"style",e,ht);if(typeof e=="string")t.style.cssText=e,t._lastStyleObj=null;else if(e&&typeof e=="object"){let n=t.style,r=t._lastStyleObj;if(r)for(let o in r)o in e||(n[o]="");for(let o in e)n[o]=e[o]??"";t._lastStyleObj=e}else e==null&&(t.style.cssText="",t._lastStyleObj=null)}function ye(t,e,n){if(typeof n=="function")return rt(t,e,n,(r,o)=>ye(r,e,o));n==null?t.removeAttribute(e):t.setAttribute(e,n)}function me(t,e){if(typeof e=="function")return rt(t,"value",e,me);if(t.tagName==="SELECT"){mt(t,e);return}let n=e==null?"":String(e);t.value!==n&&(t.value=n)}function be(t,e){if(typeof e=="function")return rt(t,"checked",e,be);t.checked=!!e}var zt=new Set;function cn(t){for(let e of t)zt.has(e)||(zt.add(e),document.addEventListener(e,n=>{let r=n.target,o="$$"+e;for(Object.defineProperty(n,"currentTarget",{configurable:!0,get(){return r||document}});r;){let i=r[o];if(i&&(i(n),n.cancelBubble))return;r=r.parentNode}}))}function fn(t,e,n){return t.addEventListener(e,n),()=>t.removeEventListener(e,n)}function sn(t,e){j(()=>{for(let n in e){let r=typeof e[n]=="function"?e[n]():e[n];t.classList.toggle(n,!!r)}})}var at=!1,w=null;function ln(){return at}function xe(t,e){at=!0,Ct=!1,Kt(),w={parent:e,index:0};try{let n=G(t,e);return e!==document.body&&e!==document.documentElement&&Yt(e),n}finally{at=!1,w=null}}function Yt(t){if(!(!w||w.parent!==t))for(;t.childNodes.length>w.index;){let e=t.lastChild;O(e),t.removeChild(e)}}var _e=new Set(["$","/$","[]","/[]","fn","/fn","eb:start","eb:end","sb:start","sb:end","portal","portal:empty"]);function Qt(t){return t.nodeType===8&&_e.has(t.textContent)}function ft(t){let e=t.childNodes;for(;w.index<e.length;){let n=e[w.index];if(Qt(n)){w.index++;continue}return w.index++,n}return null}function vt(t){if(!w||w.parent!==t)return null;let e=t.childNodes;for(let n=w.index;n<e.length;n++){let r=e[n];if(!Qt(r))return r}return null}function Y(t,e){let n=e.nodeType===11?e.childNodes.length:1;return w&&w.parent===t?(t.insertBefore(e,t.childNodes[w.index]||null),w.index+=n):t.appendChild(e),e}function lt(){return z}var Ct=!1;function we(){!lt()||Ct||(Ct=!0,console.warn("[what] hydrate() was given DOM that is already built, so the server's markup is being REPLACED by a client render rather than adopted. Hydration needs an unbuilt vnode tree, which is what h() returns. what-compiler emits the unbuilt form for JSX written directly inside a hydrate() call, so the remaining causes are: a tree built before the call (`const tree = <App />; hydrate(tree, el)`), a component whose own body what-compiler lowered (it returns a template clone, which is finished DOM, and cannot be rendered by renderToString either), or a DOM node passed in by hand. The page below is correct and interactive; only the reuse is lost."))}function G(t,e){if(t==null||typeof t=="boolean")return null;if(typeof t=="string"||typeof t=="number"){let n=String(t);if(n===""){let i=vt(e);return i&&i.nodeType===3?(ft(e),i.textContent="",i):Y(e,document.createTextNode(""))}let r=ft(e);if(r&&r.nodeType===3)return r.textContent!==n&&(lt()&&console.warn(`[what] Hydration mismatch: expected text "${n}", got "${r.textContent}"`),r.textContent=n),r;lt()&&console.warn(`[what] Hydration mismatch: expected text node "${n}", got ${r?r.nodeName:"nothing"}. Falling back to client render.`);let o=document.createTextNode(n);return r?e.replaceChild(o,r):Y(e,o),o}if(typeof t=="function"&&t._lazyChildren)return G(t(),e);if(typeof t=="function"&&t._mapArray){let n=!!(w&&w.parent===e),r=n&&e.childNodes[w.index]||null,o=document.createComment("list");e.insertBefore(o,r),n&&w.index++;let i=t(e,r);if(o._rangeEnd=i,n){let g=Array.prototype.indexOf.call(e.childNodes,i);g>=0&&(w.index=g+1)}return i}if(typeof t=="function"){let n=!!(w&&w.parent===e),r=document.createComment("fn"),o=document.createComment("/fn");n?(e.insertBefore(r,e.childNodes[w.index]||null),w.index++):e.appendChild(r),G(t(),e),n?(e.insertBefore(o,e.childNodes[w.index]||null),w.index++):e.appendChild(o);let i=[];for(let f=r.nextSibling;f&&f!==o;f=f.nextSibling)i.push(f);let g=i.length===0?null:i.length===1?i[0]:i,c=Et(),p=j(()=>Xt(c,()=>{let f=t();at||(g=st(o.parentNode||e,f,g,o))})),l=!1,d=()=>{l||(l=!0,p())};return r._dispose=d,o._dispose=d,v(r,d),r._rangeEnd=o,g}if(Array.isArray(t)){let n=[];for(let r of t){let o=G(r,e);o&&n.push(o)}return n.length===1?n[0]:n}if(typeof t=="object"&&t._vnode){if(typeof t.tag=="function"){let i=F(),g=t.tag,c=t.props||{},p=t.children||[],l={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:g,_parentCtx:i[i.length-1]||null,_errorBoundary:null};i.push(l);let d,f=null;try{let m={...c};c._$lazyChildren?f=Dt(g,m,c._$lazyChildren):m.children=p.length===0?c.children:p.length===1?p[0]:p,d=g(m),f&&f()}catch(m){return i.pop(),!Ht(m)&&!(m&&typeof m.then=="function"&&Ae(m,l))&&!Lt(m,l)&&console.error("[what] Error in component during hydration:",g.name||"Anonymous",m),null}l.mounted=!0,l._mountCallbacks&&queueMicrotask(()=>{if(!l.disposed)for(let m of l._mountCallbacks)try{m()}catch(b){console.error("[what] onMount error:",b)}});try{let m=G(d,e),b=typeof d=="function"||Array.isArray(d)&&d.some(h=>typeof h=="function"),y=Array.isArray(m)?m[0]:m,_=!b&&y&&y.nodeType?y:e;return ct(_,l),m}finally{i.pop()}}if(t.tag==="__errorBoundary"){let{errorState:i,fallback:g,reset:c,handleError:p}=t.props;return kt(t,e,{startText:"eb:start",endText:"eb:end",ctxExtras:{_errorBoundary:p},state:i,contentFor:l=>l?typeof g=="function"?g({error:l,reset:c}):g:t.children||[]})}if(t.tag==="__suspense"){let{boundary:i,fallback:g,loading:c}=t.props;return kt(t,e,{startText:"sb:start",endText:"sb:end",ctxExtras:{_suspenseBoundary:i},state:c,contentFor:p=>p?g:t.children||[]})}if(t.tag==="__portal"){let i=W(t,e);return i?Y(e,i):null}let n=ft(e),r=t.tag.toLowerCase();if(n&&n.nodeType===1&&n.nodeName.toLowerCase()===r){Te(n,t.props||{}),n.removeAttribute("data-hk");let i=w;if(w={parent:n,index:0},t.props?.dangerouslySetInnerHTML?.__html==null){for(let c of t.children)G(c,n);t.children.length>0&&Yt(n)}return w=i,n}lt()&&console.warn(`[what] Hydration mismatch: expected <${t.tag}>, got ${n?n.nodeName:"nothing"}. Falling back to client render.`);let o=W(t,e,At(e));return n?e.replaceChild(o,n):Y(e,o),o}if(Wt(t)){we();let n=t.nodeType===11?t.childNodes.length:1,o=!!(w&&w.parent===e)?ft(e):null;return o?(e.replaceChild(t,o),w.index+=n-1,t):Y(e,t)}return Y(e,document.createTextNode(String(t)))}function Ae(t,e){for(let n=e;n;n=n._parentCtx)if(n._suspenseBoundary)return n._suspenseBoundary.onSuspend(t),!0;return!1}function Ce(t,e){return typeof t=="string"||typeof t=="number"?e.nodeType!==3:t&&t._vnode&&typeof t.tag=="string"?e.nodeType!==1||e.nodeName.toLowerCase()!==t.tag.toLowerCase():!1}function Ee(t,e,n){if(e<0||!w||w.parent!==t||w.index!==e)return!1;let r=vt(t);if(!r)return!1;let o=n(),i=Array.isArray(o)?o:[o],g=i.find(c=>c!=null&&typeof c!="boolean");if(g===void 0)return!0;if(Ce(g,r))return!1;for(let c of i)G(c,t);return!0}function kt(t,e,{startText:n,endText:r,ctxExtras:o,state:i,contentFor:g}){let c=t.children||[],p=!!(w&&w.parent===e),l=document.createComment(n),d=document.createComment(r),f={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:Et(),_startComment:l,_endComment:d,...o};p?(e.insertBefore(l,e.childNodes[w.index]||null),w.index++):e.appendChild(l);let m=p?w.index:-1,b=F();b.push(f);try{for(let x of c)G(x,e)}finally{b.pop()}let y=Tt(i),_=!y;if(y){b.push(f);try{_=Ee(e,m,()=>g(y))}finally{b.pop()}}p?(e.insertBefore(d,e.childNodes[w.index]||null),w.index++):e.appendChild(d);let h=!0,s=0,a=j(()=>{let x=i();if(h&&(h=!1,_&&x===y))return;let S=l.parentNode;if(!S)return;let D=++s;for(;l.nextSibling&&l.nextSibling!==d;){let N=l.nextSibling;O(N),S.removeChild(N)}b.push(f);try{let N=g(x),ot=Array.isArray(N)?N:[N];for(let it of ot){let V=W(it,S);if(D!==s){V&&O(V);break}V&&(d.parentNode?d.parentNode.insertBefore(V,d):O(V))}}finally{b.pop()}});if(p&&w&&w.parent===e){let x=Array.prototype.indexOf.call(e.childNodes,d);x>=0&&(w.index=x+1)}return f.effects.push(a),ct(l,f),ct(d,f),l}function Te(t,e){for(let n in e){if(n==="children"||n==="key"||n==="dangerouslySetInnerHTML"||n==="innerHTML")continue;if(n==="ref"){let o=e.ref;typeof o=="function"?o(t):o&&typeof o=="object"&&(o.current=t);continue}let r=e[n];if(q(n)){if(typeof r!="function")continue;let o=n.slice(2).toLowerCase();t.addEventListener(o,r);continue}if(n.startsWith("$$")){t[n]=r;continue}if(typeof r=="function"&&!q(n)){n==="class"||n==="className"?v(t,j(()=>{t.className=r()||""})):n==="style"&&typeof r()=="object"?v(t,j(()=>{ht(t,r())})):v(t,j(()=>{ut(t,n,r())}));continue}}}Nt({hydrate:xe,insert:qt});export{Me as a,De as b,te as c,He as d,ne as e,Pe as f,je as g,Re as h,$e as i,Ke as j,Oe as k,Ie as l,Ve as m,Ot as n,ze as o,ke as p,Ge as q,Ue as r,qe as s,We as t,Fe as u,re as v,tn as w,ce as x,en as y,fe as z,qt as A,nn as B,rn as C,on as D,ut as E,ge as F,ht as G,ye as H,me as I,be as J,cn as K,fn as L,sn as M,ln as N,xe as O};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as T}from"./chunk-6YOUZ6T4.min.js";var l=typeof globalThis<"u"&&typeof globalThis.__WHAT_DEV__=="boolean"?globalThis.__WHAT_DEV__:import.meta&&import.meta.env?!!import.meta.env.DEV:(typeof process<"u"&&process.env,!1),u=null;function Ze(e){l&&(u=e)}var C=null,b=null,E=null,U=!1,B=0,x=[],V=!1,F=Symbol("needs_upstream"),H=null;function A(e,t){let n=e,r=new Set,o=null,s=0;function c(f){l&&U&&console.warn("[what] Signal.set() called inside a computed function. This may cause infinite loops. Use effect() instead."+(t?` (signal: ${t})`:""));let a=typeof f=="function"?f(n):f;(n===a?n!==0||1/n===1/a:n!==n&&a!==a)||(n=a,o=null,l&&u&&u.onSignalUpdate?.(i),r.size>0&&ce(r))}function i(f){if(arguments.length===0){let a=C;return a!==null&&(a!==o||a._epoch!==s)&&(o=a,s=a._epoch,r.add(a),a.deps.push(r)),n}c(f)}return i.set=c,i.peek=()=>n,i.subscribe=f=>L(()=>f(i())),i._signal=!0,l&&(i._subs=r,r._signalOwner=i,t&&(i._debugName=t)),l&&u&&u.onSignalCreate?.(i),i}function Ye(e){let t,n=!0,r=new Set,o=null,s=0,c=Q(()=>{let f=U;l&&(U=!0);try{t=e(),n=!1}finally{l&&(U=f)}},!0);c._level=1,c._computed=!0,c._computedSubs=r,r._owner=c,c._markDirty=()=>{n=!0},c._isDirty=()=>n,b&&b.disposals.push(()=>I(c));function i(){if(c.disposed)return t;let f=C;return f!==null&&(f!==o||f._epoch!==s)&&(o=f,s=f._epoch,r.add(f),f.deps.push(r)),n&&oe(c),t}return c._onNotify=()=>{n=!0,o=null,r.size>0&&ce(r)},i._signal=!0,i.peek=()=>(n&&!c.disposed&&oe(c),t),i}function oe(e){if(H!==null)throw H.push(e),F;let t=[e];H=t;try{for(;t.length>0;){let n=t[t.length-1];if(n.disposed||!n._isDirty||!n._isDirty()){t.pop();continue}let r=!1,o=n.deps;for(let s=0;s<o.length;s++){let c=o[s]._owner;c&&!c.disposed&&c._computed&&c._isDirty&&c._isDirty()&&(t.push(c),r=!0)}if(!r)try{let s=n.deps.length;Z(n),n.deps.length!==s&&$(n),t.pop()}catch(s){if(s===F)n._markDirty();else throw s}}}finally{H=null}}function $(e){let t=0,n=e.deps;for(let r=0;r<n.length;r++){let o=n[r]._owner;if(o){let s=o._level;s>t&&(t=s)}}e._level=t+1}var ke=()=>{};function L(e,t){let n=Q(e);n._level=1;let r=C;C=n;try{let s=n.fn();typeof s=="function"&&(n._cleanup=s)}catch(s){throw I(n),s}finally{C=r}if($(n),l&&u?.onEffectRun?.(n),t?.stable&&(n._stable=!0),n.deps.length===0&&n._cleanup===null)return n.disposed=!0,l&&u&&u.onEffectDispose?.(n),ke;let o=()=>I(n);return b&&b.disposals.push(o),o}function et(e){B++;try{e()}finally{B--,B===0&&ee()}}function Q(e,t){let n={fn:e,deps:[],lazy:t||!1,_onNotify:null,disposed:!1,_pending:!1,_stable:!1,_level:0,_computed:!1,_computedSubs:null,_isDirty:null,_markDirty:null,_cleanup:null,_epoch:0};return l&&u&&u.onEffectCreate?.(n),n}function Z(e){if(e.disposed)return;if(e._stable){if(e._cleanup){try{e._cleanup()}catch(r){l&&console.warn("[what] Error in effect cleanup:",r)}e._cleanup=null}let n=C;C=null;try{let r=e.fn();typeof r=="function"&&(e._cleanup=r)}catch(r){u?.onError&&u.onError?.(r,{type:"effect",effect:e}),Y(r)}finally{C=n}l&&u?.onEffectRun&&u.onEffectRun?.(e);return}if(ie(e),e._cleanup){try{e._cleanup()}catch(n){l&&u?.onError&&u.onError?.(n,{type:"effect-cleanup",effect:e}),l&&console.warn("[what] Error in effect cleanup:",n)}e._cleanup=null}let t=C;C=e;try{let n=e.fn();typeof n=="function"&&(e._cleanup=n)}catch(n){throw n===F||l&&u?.onError&&u.onError?.(n,{type:"effect",effect:e}),n}finally{C=t}l&&u?.onEffectRun&&u.onEffectRun?.(e)}function I(e){if(e.disposed=!0,l&&u&&u.onEffectDispose?.(e),ie(e),e._cleanup){try{e._cleanup()}catch(t){l&&console.warn("[what] Error in effect cleanup on dispose:",t)}e._cleanup=null}}function ie(e){let t=e.deps;for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0,e._epoch++}var K=0,M=null,R=0;function se(e){if(!e.disposed){if(e._onNotify)e._onNotify();else if(!e._pending)if(B===0&&e._stable){let t=C;C=null;try{let n=e.fn();if(typeof n=="function"){if(e._cleanup)try{e._cleanup()}catch{}e._cleanup=n}}catch(n){l&&u?.onError&&u.onError?.(n,{type:"effect",effect:e}),Y(n)}finally{C=t}l&&u?.onEffectRun?.(e)}else{e._pending=!0;let t=e._level,n=x.length;n>0&&x[n-1]._level>t&&(V=!0),x.push(e)}}}function ce(e){if(K===0){K=1;try{for(let t of e)se(t);if(R>0&&M){let t=0,n=M;for(;t<R;){let r=n[t];n[t]=null,t++;for(let o of r)se(o)}R=0}}finally{K=0}B===0&&x.length>0&&Ae()}else M===null&&(M=[]),R>=M.length?M.push(e):M[R]=e,R++}var W=!1;function Ae(){W||(W=!0,queueMicrotask(()=>{W=!1,ee()}))}var z=!1;function Y(e){try{console.error("[what] Uncaught error in effect during update:",e)}catch{}}function ee(){if(!z){z=!0;try{let e=0;for(;x.length>0&&e<25;){let t=x;x=[],t.length>1&&V&&t.sort((n,r)=>n._level-r._level),V=!1;for(let n=0;n<t.length;n++){let r=t[n];if(r._pending=!1,!r.disposed&&!r._onNotify){let o=r.deps.length;try{Z(r)}catch(s){if(s===F)throw s;l&&u?.onError&&u.onError?.(s,{type:"effect",effect:r}),Y(s);continue}!r._computed&&r.deps.length!==o&&$(r)}}e++}if(e>=25){if(l){let n=x.slice(0,3).map(r=>r.fn?.name||r.fn?.toString().slice(0,60)||"(anonymous)");console.warn(`[what] Possible infinite effect loop detected (25 iterations). Likely cause: an effect writes to a signal it also reads, creating a cycle. Use untrack() to read signals without subscribing. Looping effects: ${n.join(", ")}`)}else console.warn("[what] Possible infinite effect loop detected");for(let t=0;t<x.length;t++)x[t]._pending=!1;x.length=0}}finally{z=!1}}}function tt(e){let t,n=new Set,r=Q(()=>{let s=e();if(!Object.is(t,s)){t=s;for(let c of n)if(!c.disposed){if(c._onNotify)c._onNotify();else if(!c._pending){c._pending=!0;let i=c._level,f=x.length;f>0&&x[f-1]._level>i&&(V=!0),x.push(c)}}}});r._level=1;try{Z(r)}catch(s){throw I(r),s}$(r),n._owner=r,b&&b.disposals.push(()=>I(r));function o(){return C&&(n.add(C),C.deps.push(n)),t}return o._signal=!0,o.peek=()=>t,o}function nt(){if(z){l&&console.warn("[what] flushSync() called during an active flush (e.g., inside a component render or effect). This is a no-op to prevent infinite loops. Move flushSync() to an event handler or onMount callback.");return}if(C){l&&console.warn("[what] flushSync() called during effect execution. This is a no-op to prevent infinite loops. Move flushSync() to an event handler or onMount callback.");return}W=!1,ee()}function te(e){let t=C;C=null;try{return e()}finally{C=t}}function rt(){return E}function ot(e,t){let n=E,r=b;E=e,b=e;try{return t()}finally{E=n,b=r}}function st(e){let t=b,n=E,r={disposals:[],owner:E,children:[],_disposed:!1};E&&E.children.push(r),b=r,E=r;try{return e(()=>ne(r))}finally{b=t,E=n}}function ne(e){if(e._disposed)return;e._disposed=!0;let t=!1,n;for(;e.children.length>0;){let r=e.children.pop();try{ne(r)}catch(o){t||(t=!0,n=o)}}e.children.length=0;for(let r=e.disposals.length-1;r>=0;r--)try{e.disposals[r]()}catch(o){t||(t=!0,n=o)}if(e.disposals.length=0,e.owner){let r=e.owner.children.indexOf(e);r>=0&&e.owner.children.splice(r,1)}if(t)throw n}function it(e){let t=b,n=E,r={disposals:[],owner:null,children:[],_disposed:!1};b=r,E=r;try{return e(()=>ne(r))}finally{b=t,E=n}}function ct(e){b&&b.disposals.push(e)}if(l&&typeof WeakRef<"u"){let t={signals:new Set,effects:new Set,components:[]};u={__isPreinstallBuffer:!0,onSignalCreate(n){t.signals.size<2e3&&t.signals.add(new WeakRef(n))},onSignalUpdate(){},onEffectCreate(n){t.effects.size<2e3&&t.effects.add(new WeakRef(n))},onEffectDispose(){},onEffectRun(){},onError(){},onComponentMount(n){t.components.length<2e3&&t.components.push(n)},onComponentUnmount(){},__buffer:t}}function ft(){if(!l)return{signals:[],effects:[],components:[]};let e={signals:[],effects:[],components:[]},t=typeof X<"u"?X:null;if(!t)return e;for(let n of t.signals){let r=n.deref?.();r&&e.signals.push(r)}for(let n of t.effects){let r=n.deref?.();r&&e.effects.push(r)}for(let n of t.components)e.components.push(n);return e}var X=null;l&&u?.__isPreinstallBuffer&&(X=u.__buffer);var O=null,j=null;function lt(e){j||(j=e)}function Ne(){return j?.getStore()??O}function fe(){return typeof document>"u"||Ne()!=null}function ut(e){let t=O;return O=e,t}function pt(e,t){if(j)return j.run(e,t);let n=O;O=e;try{return t()}finally{O=n}}function gt(e,t){let n=function(o){return e(o)};return n.displayName=`Memo(${e.name||"Anonymous"})`,n}var ae=null;function le(e){ae=e}function Ct(e){let t=null,n=null,r=null,o=new Set;function s(c){if(r)throw r;if(t)return T(t,c);throw n||(n=e().then(i=>{t=i.default||i,o.forEach(f=>f()),o.clear()}).catch(i=>{r=i})),n}return s.displayName="Lazy",s._lazy=!0,s._onLoad=c=>{t?c():o.add(c)},s}function Le({fallback:e,children:t}){let n=A(!1),r=new Set,o=!1;return{tag:"__suspense",props:{boundary:{_suspense:!0,onSuspend(c){o||(n.set(!0),r.add(c),c.then(()=>{r.delete(c),r.size===0&&n.set(!1)},i=>{o=!0,r.delete(c),console.error("[what] Suspense: a suspended child rejected:",i)}))}},fallback:e,loading:n},children:Array.isArray(t)?t:[t],_vnode:!0}}Le._deferChildren=!0;function De({fallback:e,children:t,onError:n}){let r=A(null);return{tag:"__errorBoundary",props:{errorState:r,handleError:c=>{if(r.set(c),n)try{n(c)}catch(i){console.error("Error in onError handler:",i)}},fallback:e,reset:()=>r.set(null)},children:Array.isArray(t)?t:[t],_vnode:!0}}De._deferChildren=!0;function ue(e,t){let n=t||ae?.();for(;n;){if(n._errorBoundary)return n._errorBoundary(e),!0;n=n._parentCtx}return!1}function wt({when:e,fallback:t=null,children:n}){return()=>(typeof e=="function"?e():e)?n:t}function bt({each:e,fallback:t=null,children:n}){let r=Array.isArray(n)?n[0]:n;return typeof r!="function"?(console.warn("[what] For: children must be a render function, e.g. <For each={items}>{(item) => ...}</For>"),t):()=>{let o=typeof e=="function"?e():e;return!o||o.length===0?t:o.map((s,c)=>{let i=r(s,c);return i&&typeof i=="object"&&i.key==null&&(s!=null&&typeof s=="object"?s.id!=null?i.key=s.id:s.key!=null&&(i.key=s.key):(typeof s=="string"||typeof s=="number")&&(i.key=s)),i})}}function St({fallback:e=null,children:t}){let n=Array.isArray(t)?t:[t];return()=>{for(let r of n)if(r&&r.tag===Me){let o=r.props.when;if(typeof o=="function"?o():o)return r.children}return e}}function Me(e){return()=>(typeof e.when=="function"?e.when():e.when)?e.children:null}var q=null;function xt(e){q=e}function Te(e){let t={};for(let n in e){let r=e[n];typeof r=="function"||typeof r=="symbol"||r===void 0||(t[n]=r)}try{return JSON.stringify(t)}catch{return"{}"}}function Et({component:e,mode:t,mediaQuery:n,name:r,children:o,...s}){let c=r||e?.name||"Island",i=t||"idle",f={"data-island":c,"data-island-mode":i,"data-hydrate":i,"data-island-self":"1"},a=o==null?[]:Array.isArray(o)?o:[o];if(fe())return T("div",{...f,"data-island-props":Te(s)},T(e,s,...a));let _=!1;function y(p){if(_)return;_=!0;let d=T(e,s,...a);p.childNodes.length>0&&q?.hydrate?q.hydrate(d,p):q?.insert&&q.insert(p,d,null),p.removeAttribute("data-hydrate"),p.removeAttribute("data-island-self"),p.setAttribute("data-island-hydrated","");let m=p.ownerDocument?.defaultView??globalThis;typeof m.CustomEvent=="function"&&p.dispatchEvent(new m.CustomEvent("island:hydrated",{bubbles:!0,detail:{name:c,mode:i}}))}function S(p){let d=()=>y(p);switch(i){case"load":queueMicrotask(d);break;case"idle":typeof requestIdleCallback<"u"?requestIdleCallback(d):setTimeout(d,200);break;case"visible":{if(typeof IntersectionObserver>"u"){queueMicrotask(d);break}let m=new IntersectionObserver(w=>{w.some(v=>v.isIntersecting)&&(m.disconnect(),d())},{rootMargin:"200px"});m.observe(p);break}case"interaction":case"action":{let m=["click","focus","mouseenter","touchstart"],w=()=>{for(let v of m)p.removeEventListener(v,w);d()};for(let v of m)p.addEventListener(v,w,{once:!0});break}case"media":{if(!n||typeof window>"u"||!window.matchMedia){d();break}let m=window.matchMedia(n);if(m.matches){queueMicrotask(d);break}let w=()=>{m.matches&&(m.removeEventListener("change",w),d())};m.addEventListener("change",w);break}case"static":break;default:queueMicrotask(d)}}return T("div",{...f,ref:p=>{p&&S(p)}})}var pe=!1;function At(e,t,n){return pe||(pe=!0,console.warn("[what] each() is deprecated. Use the <For> component or Array.map() instead.")),!e||e.length===0?[]:e.map((r,o)=>{let s=t(r,o);return n&&s&&typeof s=="object"&&(s.key=n(r,o)),s})}function Nt(...e){let t=[];for(let n of e)if(n){if(typeof n=="string")t.push(n);else if(typeof n=="object")for(let[r,o]of Object.entries(n))o&&t.push(r)}return t.join(" ")}function Lt(e){return typeof e=="string"?e:Object.entries(e).filter(([,t])=>t!=null&&t!=="").map(([t,n])=>`${Re(t)}:${n}`).join(";")}function Re(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Dt(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}function Mt(e,t){let n=0;return(...r)=>{let o=Date.now();o-n>=t&&(n=o,e(...r))}}var G=null;function de(e){G=e}function Tt(e){if(typeof window>"u")return A(!1);let t=window.matchMedia(e),n=A(t.matches),r=s=>n.set(s.matches);t.addEventListener("change",r);let o=G?.();return o&&(o._cleanupCallbacks=o._cleanupCallbacks||[],o._cleanupCallbacks.push(()=>t.removeEventListener("change",r))),n}function Rt(e,t){let n;try{let i=localStorage.getItem(e);n=i!==null?JSON.parse(i):t}catch{n=t}let r=A(n),o=L(()=>{try{localStorage.setItem(e,JSON.stringify(r()))}catch(i){l&&console.warn("[what] localStorage write failed (quota exceeded?):",i)}}),s=null;typeof window<"u"&&(s=i=>{if(i.key===e&&i.newValue!==null)try{r.set(JSON.parse(i.newValue))}catch(f){l&&console.warn("[what] localStorage parse failed:",f)}},window.addEventListener("storage",s));let c=G?.();return c&&(c._cleanupCallbacks=c._cleanupCallbacks||[],c._cleanupCallbacks.push(()=>{o(),s&&window.removeEventListener("storage",s)})),r}function Ot({target:e,children:t}){if(typeof document>"u")return null;let n=typeof e=="string"?document.querySelector(e):e;return n?{tag:"__portal",props:{container:n},children:Array.isArray(t)?t:[t],_vnode:!0}:null}function Pt(e,t){if(typeof document>"u")return;let n=o=>{let s=e.current||e;!s||s.contains(o.target)||t(o)};document.addEventListener("mousedown",n),document.addEventListener("touchstart",n);let r=G?.();r&&(r._cleanupCallbacks=r._cleanupCallbacks||[],r._cleanupCallbacks.push(()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}))}function Bt(e,t){return{class:t?`${e}-enter ${e}-enter-active`:`${e}-leave ${e}-leave-active`}}var Oe=new Set(["svg","path","circle","rect","line","polyline","polygon","ellipse","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","foreignObject","linearGradient","radialGradient","stop","marker","animate","animateTransform","animateMotion","set","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence"]),Pe="http://www.w3.org/2000/svg",he=new Set(["href","src","action","formaction","formAction","data","ping","xlink:href","xlinkHref"]),_e=new Set(["srcdoc","srcDoc"]);function Be(e){if(e==null)return!0;let t;try{t=String(e).trim().replace(/[\s\x00-\x1f]/g,"").toLowerCase()}catch{return!1}return!(t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:"))}function me(e){if(e.length<=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return(t===111||t===79)&&(n===110||n===78)}function Ie(e,t){let n=e.toLowerCase();return _e.has(e)||_e.has(n)?!0:!he.has(e)&&!he.has(n)?!1:!Be(t)}function je(e){return e==="role"||e.startsWith("aria-")}var ge=new Set,J=new WeakMap;function qe(e){return!e||typeof e!="object"?!1:typeof Node<"u"&&e instanceof Node?!0:typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function ye(e){return!!e&&typeof e=="object"&&(e._vnode===!0||"tag"in e)}function re(e){if(!e.disposed){if(e.disposed=!0,e.cleanups)for(let t of e.cleanups)try{t()}catch(n){console.error("[what] cleanup error:",n)}if(e.effects)for(let t of e.effects)try{t()}catch{}if(e.hooks){for(let t of e.hooks)if(t&&typeof t.cleanup=="function")try{t.cleanup()}catch(n){console.error("[what] hook cleanup error:",n)}}if(e._cleanupCallbacks)for(let t of e._cleanupCallbacks)try{t()}catch(n){console.error("[what] onCleanup error:",n)}l&&u?.onComponentUnmount&&u.onComponentUnmount?.(e),ge.delete(e)}}function He(e,t){!e||typeof t!="function"||(e._hydrationDisposers?e._hydrationDisposers.push(t):e._hydrationDisposers=[t])}function Ut(e,t){He(e,()=>re(t))}function D(e){if(!e)return;if(e._componentCtx&&re(e._componentCtx),e._hydrationDisposers){let n=e._hydrationDisposers;e._hydrationDisposers=null;for(let r=0;r<n.length;r++)try{n[r]()}catch{}}if(e.nodeType===8){let n=J.get(e);n&&re(n)}if(e._dispose)try{e._dispose()}catch{}if(e._propEffects)for(let n in e._propEffects)try{e._propEffects[n]()}catch{}let t=e.childNodes;if(t&&t.length>0)for(let n=0;n<t.length;n++)D(t[n])}function Ue(e){let t=null;for(let n of e){let r=n._rangeEnd;if(!r||r.parentNode!==n.parentNode)continue;t||(t=e.slice());let o=t;for(let s=n.nextSibling;s&&(o.push(s),s!==r);s=s.nextSibling);}return t||e}function Wt(e,t){typeof t=="string"&&(t=document.querySelector(t)),D(t),t.textContent="";let n=N(e,t);return n&&t.appendChild(n),()=>{D(t),t.textContent=""}}function N(e,t,n){if(e==null||e===!1||e===!0)return document.createComment("");if(typeof e=="string"||typeof e=="number")return document.createTextNode(String(e));if(qe(e))return e;if(typeof e=="function"&&e._mapArray){let r=document.createDocumentFragment(),o=document.createComment("list");return r.appendChild(o),o._rangeEnd=e(r,null),r}if(typeof e=="function"&&e._lazyChildren)return N(e(),t,n);if(typeof e=="function"){let r=document.createComment("fn"),o=document.createComment("/fn"),s=[],c=document.createDocumentFragment();c.appendChild(r),c.appendChild(o);let i=h[h.length-1]||null,f=L(()=>{let a=i!==null&&h[h.length-1]!==i;a&&h.push(i);try{let _=e(),y=_==null||_===!1||_===!0?[]:Array.isArray(_)?_:[_],S=o.parentNode;if(!S)return;for(let p of Ue(s))D(p),p.parentNode===S&&S.removeChild(p);s=[];for(let p of y){let d=N(p,S,t?._isSvg);if(d)if(d.nodeType===11){let m=Array.from(d.childNodes);S.insertBefore(d,o);for(let w of m)s.push(w)}else S.insertBefore(d,o),s.push(d)}}finally{a&&h.pop()}});return r._dispose=f,o._dispose=f,r._rangeEnd=o,c}if(Array.isArray(e)){let r=document.createDocumentFragment();for(let o of e){let s=N(o,t,n);s&&r.appendChild(s)}return r}return ye(e)&&typeof e.tag=="function"?$e(e,t,n):ye(e)&&typeof e.tag=="string"?e.tag==="__errorBoundary"?we(e,t):e.tag==="__suspense"?be(e,t):e.tag==="__portal"?Se(e,t):Je(e,t,n):document.createTextNode(String(e))}var We={get(e,t){if(t!=="_sig"&&!(t==="__proto__"||t==="constructor"||t==="prototype"))return e._sig()[t]},has(e,t){return t==="_sig"?!1:t in e._sig()},ownKeys(e){return Reflect.ownKeys(e._sig())},getOwnPropertyDescriptor(e,t){if(t==="_sig")return;let n=e._sig();if(t in n)return{value:n[t],writable:!1,enumerable:!0,configurable:!0}},set(e,t){return!1}},h=[];function Ce(){return h[h.length-1]}le(Ce);de(Ce);function zt(){return h}function Vt(e){let t={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:e,_parentCtx:h[h.length-1]||null,_errorBoundary:null};return h.push(t),t}function Ft(e){h[h.length-1]===e&&h.pop(),e.disposed=!0}function ze(e,t,n){if(e._deferChildren)return t.children=n,null;let r,o=!1,s=!0;return Object.defineProperty(t,"children",{get(){return s?(o||(o=!0,r=n()),r):n()},enumerable:!0,configurable:!0}),()=>{s=!1,o=!1,r=void 0}}var Ve=Symbol.for("what.navigation.signal");function Fe(e){if(e==null)return!1;let t=e[Ve];return typeof t!="function"?!1:(t(e),!0)}function $e(e,t,n){let{tag:r,props:o,children:s}=e;if(typeof r=="function"&&(r.prototype?.isReactComponent||r.prototype?.render)){let g=r;r=function(ve){return new g(ve).render()},r.displayName=g.displayName||g.name||"ClassComponent"}if(r==="__errorBoundary"||e.tag==="__errorBoundary")return we(e,t);if(r==="__suspense"||e.tag==="__suspense")return be(e,t);if(r==="__portal"||e.tag==="__portal")return Se(e,t);let c=h[h.length-1]||null,i=null;if(c&&(i=c._errorBoundary||null,!i)){let g=c._parentCtx;for(;g;){if(g._errorBoundary){i=g._errorBoundary;break}g=g._parentCtx}}let f={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:r,_parentCtx:c,_errorBoundary:i},a=document.createComment("c:start"),_=document.createComment("c:end");J.set(a,f),f._startComment=a,f._endComment=_;let y=document.createDocumentFragment();y._componentCtx=f,f._wrapper=a,ge.add(f),l&&u?.onComponentMount&&u.onComponentMount?.(f);let S=s.length===0?void 0:s.length===1?s[0]:s,p;S!==void 0?p=o?Object.assign({},o,{children:S}):{children:S}:p=o?Object.assign({},o):{};let d=o&&o._$lazyChildren,m=d?ze(r,p,d):null,w=A(p);f._propsSignal=w;let v=new Proxy({_sig:w},We);h.push(f);let k;try{k=te(()=>r(v))}catch(g){if(h.pop(),!Fe(g)&&!(g&&typeof g.then=="function"&&Ge(g,f))&&!ue(g,f))throw console.error("[what] Uncaught error in component:",r.name||"Anonymous",g),g;return y.appendChild(a),y.appendChild(_),y}m&&m(),f.mounted=!0,f._mountCallbacks&&queueMicrotask(()=>{if(!f.disposed)for(let g of f._mountCallbacks)try{g()}catch(P){console.error("[what] onMount error:",P)}}),y.appendChild(a);let Ee=Array.isArray(k)?k:[k];try{for(let g of Ee){let P=N(g,y,n);P&&y.appendChild(P)}}finally{h.pop()}return y.appendChild(_),y}function Ge(e,t){let n=t;for(;n;){if(n._suspenseBoundary)return n._suspenseBoundary.onSuspend(e),!0;n=n._parentCtx}return!1}function we(e,t){let{errorState:n,handleError:r,fallback:o,reset:s}=e.props,c=e.children,i=document.createComment("eb:start"),f=document.createComment("eb:end"),a={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:h[h.length-1]||null,_errorBoundary:r,_startComment:i,_endComment:f};J.set(i,a);let _=document.createDocumentFragment();_._componentCtx=a,_.appendChild(i),_.appendChild(f);let y=L(()=>{let S=n();h.push(a);try{let p=i.parentNode;if(p)for(;i.nextSibling&&i.nextSibling!==f;){let m=i.nextSibling;D(m),p.removeChild(m)}let d;S?d=typeof o=="function"?[o({error:S,reset:s})]:[o]:d=c,d=Array.isArray(d)?d:[d];for(let m of d){let w=N(m,t);w&&(f.parentNode?f.parentNode.insertBefore(w,f):_.insertBefore(w,f))}}finally{h.pop()}});return a.effects.push(y),_}function be(e,t){let{boundary:n,fallback:r,loading:o}=e.props,s=e.children,c=document.createComment("sb:start"),i=document.createComment("sb:end"),f={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:h[h.length-1]||null,_suspenseBoundary:n,_startComment:c,_endComment:i};J.set(c,f);let a=document.createDocumentFragment();a._componentCtx=f,a.appendChild(c),a.appendChild(i);let _=0,y=L(()=>{let p=o()?[r]:s,d=Array.isArray(p)?p:[p],m=++_;h.push(f);let w=c.parentNode;if(w)for(;c.nextSibling&&c.nextSibling!==i;){let v=c.nextSibling;D(v),w.removeChild(v)}try{for(let v of d){let k=N(v,t);if(m!==_){k&&D(k);break}k&&(i.parentNode?i.parentNode.insertBefore(k,i):a.insertBefore(k,i))}}finally{h.pop()}});return f.effects.push(y),a}function Se(e,t){let{container:n}=e.props,r=e.children;if(!n)return console.warn("[what] Portal: target container not found"),document.createComment("portal:empty");let o={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:h[h.length-1]||null},s=document.createComment("portal");s._componentCtx=o;let c=[];for(let i of r){let f=N(i,n);f&&(n.appendChild(f),c.push(f))}return o._cleanupCallbacks=[()=>{for(let i of c)D(i),i.parentNode&&i.parentNode.removeChild(i)}],s}function Je(e,t,n){let{tag:r,props:o,children:s}=e,c=n||Oe.has(r),i=c?document.createElementNS(Pe,r):document.createElement(r);o&&Ke(i,o,{},c);let f=c&&r!=="foreignObject";for(let a=0;a<s.length;a++){let _=N(s[a],i,f);_&&i.appendChild(_)}return i._vnode=e,i}function Ke(e,t,n,r){if(t){for(let o in t)if(!(o==="key"||o==="children")){if(o==="ref"){let s=t.ref;typeof s=="function"?s(e):s&&(s.current=e);continue}xe(e,o,t[o],r)}}}function Xe(e,t){e.value=t,e.value!==String(t)&&queueMicrotask(()=>{e.value=t})}function xe(e,t,n,r){if(typeof n=="function"&&!me(t)&&t!=="ref"){if(e._propEffects||(e._propEffects={}),e._propEffects[t])try{e._propEffects[t]()}catch{}e._propEffects[t]=L(()=>{let o=n();xe(e,t,o,r)});return}if(me(t)){if(typeof n!="function"&&n!=null)return;let o=t.slice(2),s=!1;o.endsWith("Capture")&&(o=o.slice(0,-7),s=!0);let c=o.toLowerCase(),i=s?c+"_capture":c,f=e._events?.[i];if(f&&f._original===n||(f&&e.removeEventListener(c,f,s),n==null))return;e._events||(e._events={});let a=y=>(y.nativeEvent||(y.nativeEvent=y),te(()=>a._handler(y)));a._handler=n,a._original=n,e._events[i]=a;let _=n._eventOpts;e.addEventListener(c,a,_||s||void 0);return}if(Ie(t,n)){typeof console<"u"&&console.warn(`[what] Blocked unsafe URL in "${t}" attribute:`,n);return}if(t==="className"||t==="class"){r?e.setAttribute("class",n||""):e.className=n||"";return}if(t==="style"){if(typeof n=="string")e.style.cssText=n,e._prevStyle=null;else if(typeof n=="object"){let o=e._prevStyle||{};for(let s in o)s in n||(e.style[s]="");for(let s in n)e.style[s]=n[s]??"";e._prevStyle={...n}}return}if(t==="dangerouslySetInnerHTML"){let o=n?.__html??"";l&&typeof o=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(o)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),e.innerHTML=o;return}if(t==="innerHTML"){if(n==null)return;if(n&&typeof n=="object"&&"__html"in n){let o=n.__html??"";l&&typeof o=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(o)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),e.innerHTML=o}else{l&&console.warn("[what] innerHTML received a raw string. This is a security risk (XSS). Use innerHTML={{ __html: trustedString }} or dangerouslySetInnerHTML={{ __html: trustedString }} instead.");return}return}if(n==null){if(t in e)try{e[t]=""}catch{}e.removeAttribute(t);return}if(je(t)||t.startsWith("data-")){e.setAttribute(t,typeof n=="boolean"?String(n):n);return}if(typeof n=="boolean"){n?e.setAttribute(t,""):e.removeAttribute(t);return}if(r){n===!1||n==null?e.removeAttribute(t):e.setAttribute(t,n===!0?"":String(n));return}if(t==="value"&&e.tagName==="SELECT"){Xe(e,n);return}t in e?e[t]=n:e.setAttribute(t,n)}export{l as a,u as b,Ze as c,A as d,Ye as e,L as f,et as g,tt as h,nt as i,te as j,rt as k,ot as l,st as m,it as n,ct as o,ft as p,lt as q,Ne as r,fe as s,ut as t,pt as u,gt as v,Ct as w,Le as x,De as y,ue as z,wt as A,bt as B,St as C,Me as D,xt as E,Et as F,At as G,Nt as H,Lt as I,Dt as J,Mt as K,Tt as L,Rt as M,Ot as N,Pt as O,Bt as P,me as Q,Ie as R,je as S,He as T,Ut as U,D as V,Ue as W,Wt as X,N as Y,Ce as Z,zt as _,Vt as $,Ft as aa,ze as ba,Fe as ca,Xe as da};
|
package/dist/index.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as Mn,B as Fn,C as Pn,D as Hn,E as Gn,K as $n,L as Vn,M as jn,N as Un,O as qn,a as dn,b as fn,c as pn,d as hn,e as gn,f as mn,g as yn,h as vn,i as wn,j as xn,k as En,l as bn,m as Sn,n as _n,o as kn,p as Rn,q as Cn,r as An,s as In,t as Tn,u as Nn,w as Dn,x as On,y as Je,z as Ln}from"./chunk-XRUIKSAO.min.js";import{$ as ln,A as Bt,B as Wt,C as Yt,D as Xt,F as zt,G as Qt,H as Kt,I as Jt,J as Zt,K as en,L as tn,M as nn,N as rn,O as on,P as sn,Q as Ne,S as an,X as cn,Z as W,a as L,aa as un,c as At,d,e as P,f as $,g as O,h as It,i as Tt,j as ce,k as Nt,l as Dt,m as Ot,o as Lt,p as Mt,q as Ht,r as ge,s as Te,t as Gt,u as $t,v as Vt,w as jt,x as Ut,y as qt}from"./chunk-ZDIHSTQJ.min.js";import{a as N,b as Ft,c as Pt}from"./chunk-6YOUZ6T4.min.js";var re;function De(){if(re!==void 0)return re;if(typeof document>"u")return re=null;let e=document.getElementById("__what_data");if(!e)return re=null;try{re=JSON.parse(e.textContent)}catch{re=null}return re}function Bn(){re=void 0}function Oe(){let e=De();return e?e.loaderData:void 0}function Le(e){let t=De();return t&&t.resources?t.resources[e]:void 0}function Wn(){if(Te()){let e=ge();return e?e.loaderData:void 0}return Oe()}function Y(e){let t=W();if(!t)throw new Error(`[what] ${e||"Hook"}() can only be called inside a component function. Did you call it outside of a component or in an async callback? If you need reactive state outside a component, use signal() directly.`);return t}function oe(e){let t=e.hookIndex++;return{index:t,exists:t<e.hooks.length}}function Yn(e){let t=Y("useState"),{index:n,exists:r}=oe(t);if(!r){let s=d(typeof e=="function"?e():e);t.hooks[n]=s}let o=t.hooks[n];return[o,o.set]}function Xn(e){let t=Y("useSignal"),{index:n,exists:r}=oe(t);return r||(t.hooks[n]=d(typeof e=="function"?e():e)),t.hooks[n]}function zn(e){let t=Y("useComputed"),{index:n,exists:r}=oe(t);return r||(t.hooks[n]=P(e)),t.hooks[n]}function Qn(e,t){let n=Y("useEffect"),{index:r,exists:o}=oe(n);if(o||(n.hooks[r]={cleanup:null,dispose:null}),L&&Array.isArray(t)&&t.length>0)for(let a=0;a<t.length;a++){let c=t[a];c!=null&&typeof c!="function"&&console.warn(`[what] useEffect dep at index ${a} is not a function. Did you mean to pass a signal? Use count instead of count()`)}let s=n.hooks[r];s.dispose||(t===void 0?queueMicrotask(()=>{n.disposed||(s.dispose=$(()=>{if(s.cleanup){try{s.cleanup()}catch{}s.cleanup=null}let a=e();typeof a=="function"&&(s.cleanup=a)}),n.effects=n.effects||[],n.effects.push(s.dispose))}):t.length===0?(queueMicrotask(()=>{if(n.disposed)return;let a=e();typeof a=="function"&&(s.cleanup=a)}),s.dispose=!0):queueMicrotask(()=>{n.disposed||(s.dispose=$(()=>{for(let c=0;c<t.length;c++){let u=t[c];typeof u=="function"&&u._signal&&u()}if(s.cleanup){try{s.cleanup()}catch{}s.cleanup=null}let a=ce(()=>e());typeof a=="function"&&(s.cleanup=a)}),n.effects=n.effects||[],n.effects.push(s.dispose))}))}function Kn(e,t){let n=Y("useMemo"),{index:r,exists:o}=oe(n);return o||(n.hooks[r]={computed:P(e)}),n.hooks[r].computed}function Jn(e,t){let n=Y("useCallback"),{index:r,exists:o}=oe(n);return o||(n.hooks[r]={callback:e}),n.hooks[r].callback}function Zn(e){let t=Y("useRef"),{index:n,exists:r}=oe(t);return r||(t.hooks[n]={current:e}),t.hooks[n]}function Ze(e){let t=W();for(L&&!t&&console.warn(`[what] useContext(${e?.displayName||"Context"}) called outside of component render. useContext must be called during component rendering, not inside effects or event handlers. Store the context value in a variable during render and use that variable in your callback.`);t;){if(t._contextValues&&t._contextValues.has(e)){let n=t._contextValues.get(e);return n&&n._signal?n():n}t=t._parentCtx}return e._defaultValue}function er(e){let t={_defaultValue:e,Provider:({value:n,children:r})=>{let o=Y("Context.Provider");if(o._contextValues||(o._contextValues=new Map),o._contextSignals||(o._contextSignals=new Map),o._contextSignals.has(t))o._contextSignals.get(t).set(n);else{let s=d(n);o._contextSignals.set(t,s),o._contextValues.set(t,s)}return r},Consumer:({children:n})=>{let r=Ze(t);return typeof n=="function"?n(r):n}};return t.Provider._deferChildren=!0,t}function tr(e,t,n){let r=Y("useReducer"),{index:o,exists:s}=oe(r);if(!s){let c=n?n(t):t,u=d(c),p=i=>{u.set(h=>e(h,i))};r.hooks[o]={signal:u,dispatch:p}}let a=r.hooks[o];return[a.signal,a.dispatch]}function nr(e){let t=Y("onMount");t.mounted||(t._mountCallbacks=t._mountCallbacks||[],t._mountCallbacks.push(e))}function rr(e){let t=Y("onCleanup");t._cleanupCallbacks=t._cleanupCallbacks||[],t._cleanupCallbacks.push(e)}function or(e,t={}){if(Te()){let i=ge();if(i){let h=t.key!=null?t.key:`__r${i.resourceCounter++}`,g=i.resources.get(h);if(g&&g.status==="ready")return[()=>g.value,{loading:()=>!1,error:()=>null,refetch:()=>{},mutate:()=>{}}];if(g&&g.status==="error")return[()=>{},{loading:()=>!1,error:()=>g.error,refetch:()=>{},mutate:()=>{}}];if(!g){let b=Promise.resolve().then(()=>e(t.source??!0,{})).then(S=>{i.resources.set(h,{status:"ready",value:S})}).catch(S=>{i.resources.set(h,{status:"error",error:S})});throw i.resources.set(h,{status:"pending",promise:b}),b}throw g.promise}if(t.initialValue!=null)return[()=>t.initialValue,{loading:()=>!1,error:()=>null,refetch:()=>{},mutate:()=>{}}];throw Promise.resolve().then(()=>e(t.source??!0,{}))}let n=t.initialValue;if(n==null&&t.key!=null){let i=Le(t.key);i!==void 0&&(n=i)}let r=d(n??null),o=d(n==null),s=d(null),a=null,c=async i=>{a&&a.abort(),a=new AbortController;let{signal:h}=a;o.set(!0),s.set(null);try{let g=await e(i,{signal:h});h.aborted||O(()=>{r.set(g),o.set(!1)})}catch(g){h.aborted||O(()=>{s.set(g),o.set(!1)})}},u=i=>{r.set(typeof i=="function"?i(r()):i)},p=W?.();return p&&(p._cleanupCallbacks=p._cleanupCallbacks||[],p._cleanupCallbacks.push(()=>{a&&a.abort()})),n==null&&c(t.source),[r,{loading:o,error:s,refetch:c,mutate:u}]}function nt(e){return e._storeComputed=!0,e}var et=!1;function sr(e){return et||(et=!0,console.warn("[what] storeComputed() is deprecated. Use derived() instead.")),nt(e)}function ar(e){let t={},n={},r={};for(let[o,s]of Object.entries(e))typeof s=="function"&&s._storeComputed?(L&&s.length===0&&console.warn(`[what] derived() for "${o}" should accept the state parameter, e.g. derived(state => ...).`),n[o]=s):typeof s=="function"?r[o]=s:t[o]=d(s);for(let[o,s]of Object.entries(n)){let a=new Proxy({},{get(c,u){if(t[u])return t[u]();if(n[u])return n[u]()}});n[o]=P(()=>s(a))}for(let[o,s]of Object.entries(r))r[o]=(...a)=>{let c;return O(()=>{let u=new Proxy({},{get(p,i){if(t[i])return t[i].peek();if(n[i])return n[i].peek();if(r[i])return r[i]},set(p,i,h){return t[i]&&t[i].set(h),!0}});c=s.apply(u,a)}),c};return function(){let s={};for(let[a,c]of Object.entries(t))Object.defineProperty(s,a,{get:()=>c(),enumerable:!0});for(let[a,c]of Object.entries(n))Object.defineProperty(s,a,{get:()=>c(),enumerable:!0});for(let[a,c]of Object.entries(r))s[a]=c;return s}}var tt=!1;function ir(e){return tt||(tt=!0,console.warn("[what] atom() is deprecated. Use signal() directly instead.")),d(e)}var Me={title:null,metas:new Map,links:new Map};function cr({title:e,meta:t,link:n,children:r}){if(typeof document>"u"){let o=ge();return o&&o.head&&ur(o.head,{title:e,meta:t,link:n}),r??null}if(e&&(document.title=e,Me.title=e),t)for(let o of Array.isArray(t)?t:[t]){let s=o.name||o.property||o.httpEquiv||JSON.stringify(o);ot("meta",s,o)}if(n)for(let o of Array.isArray(n)?n:[n]){let s=o.rel+(o.href||"");ot("link",s,o)}return r||null}function lr(e){return e.name||e.property||e.httpEquiv||JSON.stringify(e)}function ur(e,{title:t,meta:n,link:r}){if(t!=null&&(e.title=t),n)for(let o of Array.isArray(n)?n:[n])e.metas.set(lr(o),o);if(r)for(let o of Array.isArray(r)?r:[r])e.links.set(o.rel+(o.href||""),o)}function dr(){return{title:null,metas:new Map,links:new Map}}function fr(e){if(!e)return"";let t="";e.title!=null&&(t+=`<title>${st(String(e.title))}</title>`);for(let n of e.metas.values())t+=rt("meta",n);for(let n of e.links.values())t+=rt("link",n);return t}var pr=/^[a-zA-Z_:][a-zA-Z0-9:._-]*$/;function Fe(e){if(!pr.test(e))return!1;let t=e.toLowerCase();return!(t.startsWith("on")&&t.length>2)}function ke(e){return e==="httpEquiv"?"http-equiv":e}function rt(e,t){let n=`<${e}`;for(let[r,o]of Object.entries(t)){if(o==null||o===!1)continue;let s=ke(r);Fe(s)&&(n+=` ${s}="${st(String(o))}"`)}return n+">"}function st(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function hr(e){let t=String(e);return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n.codePointAt(0).toString(16)} `)}function ot(e,t,n){let r=document.head.querySelector(`[data-what-head="${hr(t)}"]`);if(r){gr(r,n);return}let o=document.createElement(e);o.setAttribute("data-what-head",t);for(let[s,a]of Object.entries(n))Fe(ke(s))&&o.setAttribute(ke(s),a);document.head.appendChild(o)}function gr(e,t){for(let[n,r]of Object.entries(t)){let o=ke(n);Fe(o)&&e.getAttribute(o)!==r&&e.setAttribute(o,r)}}function mr(){let e=document.head.querySelectorAll("[data-what-head]");for(let t of e)t.remove();Me.metas.clear(),Me.links.clear()}var me=[],ye=[],Ge=!1;function Z(e){return me.push(e),$e(),()=>{let t=me.indexOf(e);t!==-1&&me.splice(t,1)}}function se(e){return ye.push(e),$e(),()=>{let t=ye.indexOf(e);t!==-1&&ye.splice(t,1)}}function at(){for(;me.length>0;){let e=me.shift();try{e()}catch(t){console.error("[what] Scheduler read error:",t)}}for(;ye.length>0;){let e=ye.shift();try{e()}catch(t){console.error("[what] Scheduler write error:",t)}}Ge=!1,(me.length>0||ye.length>0)&&$e()}function $e(){Ge||(Ge=!0,requestAnimationFrame(at))}function yr(e){return new Promise(t=>{Z(()=>{t(e())})})}function vr(e){return new Promise(t=>{se(()=>{e(),t()})})}function wr(e,t){let n=Symbol("scheduledEffect");return $(()=>{it(n,()=>{Z(()=>{let r=e();t&&se(()=>t(r))})})})}function xr(){let e,t=new Promise((n,r)=>{let o=requestAnimationFrame(n);e=()=>{cancelAnimationFrame(o),r(new Error("Cancelled"))}});return t.cancel=e,t}var we=new Map;function it(e,t){we.has(e)?we.set(e,t):(we.set(e,t),requestAnimationFrame(()=>{let n=we.get(e);we.delete(e),n&&n()}))}var Pe=new WeakMap,He=null;function Er(e,t){if(typeof ResizeObserver>"u")return t(e.getBoundingClientRect()),()=>{};He||(He=new ResizeObserver(r=>{Z(()=>{for(let o of r){let s=Pe.get(o.target);s&&s(o.contentRect)}})}));let n=He;return Pe.set(e,t),n.observe(e),()=>{Pe.delete(e),n.unobserve(e)}}function br(e,t,n={}){if(typeof IntersectionObserver>"u")return t({isIntersecting:!0,intersectionRatio:1}),()=>{};let r=new IntersectionObserver(o=>{Z(()=>{for(let s of o)t(s)})},n);return r.observe(e),()=>r.disconnect()}function Sr(e,t={}){let{duration:n=300,easing:r=o=>o*(2-o)}=t;return new Promise(o=>{let s,a,c;Z(()=>{s=window.scrollY;let p=e.getBoundingClientRect();a=s+p.top,c=performance.now(),u()});function u(){Z(()=>{let p=performance.now()-c,i=Math.min(p/n,1),h=r(i),g=s+(a-s)*h;se(()=>{window.scrollTo(0,g),i<1?requestAnimationFrame(u):o()})})}})}function ct(e){let t=W?.(),n=$(e);return t&&t.effects.push(n),n}function lt(e,t={}){let{stiffness:n=100,damping:r=10,mass:o=1,precision:s=.01}=t,a=d(e),c=d(e),u=d(0),p=d(!1),i=null,h=null;function g(k){if(h===null){h=k,i=requestAnimationFrame(g);return}let v=Math.min((k-h)/1e3,.064);h=k;let T=a.peek(),D=c.peek(),C=u.peek(),_=T-D,m=-n*_,f=-r*C,A=(m+f)/o,F=C+A*v,G=T+F*v;if(O(()=>{u.set(F),a.set(G)}),Math.abs(F)<s&&Math.abs(_)<s){O(()=>{a.set(D),u.set(0),p.set(!1)}),i=null,h=null;return}i=requestAnimationFrame(g)}function b(k){c.set(k),i===null&&(p.set(!0),h=null,i=requestAnimationFrame(g))}function S(){i&&(cancelAnimationFrame(i),i=null),p.set(!1),h=null}function I(k){S(),O(()=>{a.set(k),c.set(k),u.set(0)})}let R=W?.();return R&&(R._cleanupCallbacks=R._cleanupCallbacks||[],R._cleanupCallbacks.push(S)),{current:()=>a(),target:()=>c(),velocity:()=>u(),isAnimating:()=>p(),set:b,stop:S,snap:I,subscribe:a.subscribe}}function ut(e,t,n={}){let{duration:r=300,easing:o=b=>b*(2-b),onUpdate:s,onComplete:a}=n,c=d(0),u=d(e),p=d(!0),i=null,h=null;function g(b){i===null&&(i=b);let I=b-i,R=Math.min(I/r,1),k=o(R),v=e+(t-e)*k;O(()=>{c.set(R),u.set(v)}),s&&s(v,R),R<1?h=requestAnimationFrame(g):(p.set(!1),a&&a())}return h=requestAnimationFrame(g),{progress:()=>c(),value:()=>u(),isAnimating:()=>p(),cancel:()=>{h&&cancelAnimationFrame(h),p.set(!1)},subscribe:u.subscribe}}var dt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:-1+(4-2*e)*e,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*(2*Math.PI/3)),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*(2*Math.PI/3))+1,easeOutBounce:e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375};function _r(e={}){let{duration:t=300,easing:n=dt.easeOutQuad}=e,r=d(!1),o=d(0);async function s(a){return r.set(!0),o.set(0),new Promise(c=>{let u=performance.now();function p(i){let h=i-u,g=Math.min(h/t,1);o.set(n(g)),g<1?requestAnimationFrame(p):(r.set(!1),a&&a(),c())}requestAnimationFrame(p)})}return{isTransitioning:()=>r(),progress:()=>o(),start:s}}function kr(e,t={}){let{onDrag:n,onDragStart:r,onDragEnd:o,onPinch:s,onSwipe:a,onTap:c,onLongPress:u,preventDefault:p=!1}=t,i={isDragging:d(!1),startX:0,startY:0,currentX:d(0),currentY:d(0),deltaX:d(0),deltaY:d(0),velocity:d({x:0,y:0})},h=0,g=0,b=0,S=null;function I(_){let m=_.touches?_.touches[0]:_;i.startX=m.clientX,i.startY=m.clientY,g=m.clientX,b=m.clientY,h=performance.now(),i.isDragging.set(!0),r&&r({x:i.startX,y:i.startY}),u&&(S=setTimeout(()=>{i.isDragging.peek()&&u({x:g,y:b})},500))}function R(_){if(!i.isDragging.peek())return;let m=_.touches?_.touches[0]:_,f=m.clientX,A=m.clientY,F=performance.now(),G=F-h;O(()=>{i.currentX.set(f),i.currentY.set(A),i.deltaX.set(f-i.startX),i.deltaY.set(A-i.startY),G>0&&i.velocity.set({x:(f-g)/G*1e3,y:(A-b)/G*1e3})}),g=f,b=A,h=F,S&&Math.sqrt(i.deltaX.peek()**2+i.deltaY.peek()**2)>10&&(clearTimeout(S),S=null),n&&n({x:f,y:A,deltaX:i.deltaX.peek(),deltaY:i.deltaY.peek(),velocity:i.velocity.peek()})}function k(_){if(!i.isDragging.peek())return;S&&(clearTimeout(S),S=null);let m=i.deltaX.peek(),f=i.deltaY.peek(),A=i.velocity.peek();if(Math.sqrt(m**2+f**2)<10&&c&&c({x:i.startX,y:i.startY}),a&&(Math.abs(A.x)>500||Math.abs(A.y)>500)){let G=Math.abs(A.x)>Math.abs(A.y)?A.x>0?"right":"left":A.y>0?"down":"up";a({direction:G,velocity:A})}o&&o({deltaX:m,deltaY:f,velocity:A}),i.isDragging.set(!1)}let v=null;function T(_){if(!s||_.touches.length!==2)return;let m=_.touches[0],f=_.touches[1],A=Math.sqrt((f.clientX-m.clientX)**2+(f.clientY-m.clientY)**2);v===null&&(v=A);let F=A/v,G=(m.clientX+f.clientX)/2,w=(m.clientY+f.clientY)/2;s({scale:F,centerX:G,centerY:w})}function D(){v=null}typeof e=="function"?ct(()=>{let _=ce(e);if(_)return C(_)}):e?.current!==void 0?ct(()=>{let _=e.current;if(_)return C(_)}):e&&C(e);function C(_){return _.addEventListener("mousedown",I),_.addEventListener("touchstart",I,{passive:!p}),window.addEventListener("mousemove",R),window.addEventListener("touchmove",T),window.addEventListener("touchmove",R),window.addEventListener("mouseup",k),window.addEventListener("touchend",k),window.addEventListener("touchend",D),()=>{_.removeEventListener("mousedown",I),_.removeEventListener("touchstart",I),window.removeEventListener("mousemove",R),window.removeEventListener("touchmove",T),window.removeEventListener("touchmove",R),window.removeEventListener("mouseup",k),window.removeEventListener("touchend",k),window.removeEventListener("touchend",D)}}return i}function Rr(e){let t=d(e);return{value:()=>t(),setValue:n=>t.set(n),spring(n,r={}){let o=lt(t.peek(),r);o.set(n);let s=$(()=>{t.set(o.current())});return{stop:()=>{o.stop(),s()}}},timing(n,r={}){let o=ut(t.peek(),n,{...r,onUpdate:s=>t.set(s)});return{stop:()=>o.cancel()}},interpolate(n,r){return()=>{let o=t();for(let s=0;s<n.length-1;s++)if(o>=n[s]&&o<=n[s+1]){let a=(o-n[s])/(n[s+1]-n[s]);return r[s]+(r[s+1]-r[s])*a}return o<=n[0]?r[0]:r[r.length-1]}},subscribe:t.subscribe}}function ft(e){return{enter:`${e}-enter`,enterActive:`${e}-enter-active`,enterDone:`${e}-enter-done`,exit:`${e}-exit`,exitActive:`${e}-exit-active`,exitDone:`${e}-exit-done`}}async function Cr(e,t,n="enter",r=300){let o=ft(t);return new Promise(s=>{se(()=>{e.classList.add(o[n]),Z(()=>{e.offsetHeight,se(()=>{e.classList.add(o[`${n}Active`]),setTimeout(()=>{se(()=>{e.classList.remove(o[n],o[`${n}Active`]),e.classList.add(o[`${n}Done`]),s()})},r)})})})})}var Ar=`
|
|
1
|
+
import{A as Mn,B as Fn,C as Pn,D as Hn,E as Gn,K as $n,L as Vn,M as jn,N as Un,O as qn,a as dn,b as fn,c as pn,d as hn,e as gn,f as mn,g as yn,h as vn,i as wn,j as xn,k as En,l as bn,m as Sn,n as _n,o as kn,p as Rn,q as Cn,r as An,s as In,t as Tn,u as Nn,w as Dn,x as On,y as Je,z as Ln}from"./chunk-FN6HXME3.min.js";import{$ as ln,A as Bt,B as Wt,C as Yt,D as Xt,F as zt,G as Qt,H as Kt,I as Jt,J as Zt,K as en,L as tn,M as nn,N as rn,O as on,P as sn,Q as Ne,S as an,X as cn,Z as W,a as L,aa as un,c as At,d,e as P,f as $,g as O,h as It,i as Tt,j as ce,k as Nt,l as Dt,m as Ot,o as Lt,p as Mt,q as Ht,r as ge,s as Te,t as Gt,u as $t,v as Vt,w as jt,x as Ut,y as qt}from"./chunk-VKZY7JPN.min.js";import{a as N,b as Ft,c as Pt}from"./chunk-6YOUZ6T4.min.js";var re;function De(){if(re!==void 0)return re;if(typeof document>"u")return re=null;let e=document.getElementById("__what_data");if(!e)return re=null;try{re=JSON.parse(e.textContent)}catch{re=null}return re}function Bn(){re=void 0}function Oe(){let e=De();return e?e.loaderData:void 0}function Le(e){let t=De();return t&&t.resources?t.resources[e]:void 0}function Wn(){if(Te()){let e=ge();return e?e.loaderData:void 0}return Oe()}function Y(e){let t=W();if(!t)throw new Error(`[what] ${e||"Hook"}() can only be called inside a component function. Did you call it outside of a component or in an async callback? If you need reactive state outside a component, use signal() directly.`);return t}function oe(e){let t=e.hookIndex++;return{index:t,exists:t<e.hooks.length}}function Yn(e){let t=Y("useState"),{index:n,exists:r}=oe(t);if(!r){let s=d(typeof e=="function"?e():e);t.hooks[n]=s}let o=t.hooks[n];return[o,o.set]}function Xn(e){let t=Y("useSignal"),{index:n,exists:r}=oe(t);return r||(t.hooks[n]=d(typeof e=="function"?e():e)),t.hooks[n]}function zn(e){let t=Y("useComputed"),{index:n,exists:r}=oe(t);return r||(t.hooks[n]=P(e)),t.hooks[n]}function Qn(e,t){let n=Y("useEffect"),{index:r,exists:o}=oe(n);if(o||(n.hooks[r]={cleanup:null,dispose:null}),L&&Array.isArray(t)&&t.length>0)for(let a=0;a<t.length;a++){let c=t[a];c!=null&&typeof c!="function"&&console.warn(`[what] useEffect dep at index ${a} is not a function. Did you mean to pass a signal? Use count instead of count()`)}let s=n.hooks[r];s.dispose||(t===void 0?queueMicrotask(()=>{n.disposed||(s.dispose=$(()=>{if(s.cleanup){try{s.cleanup()}catch{}s.cleanup=null}let a=e();typeof a=="function"&&(s.cleanup=a)}),n.effects=n.effects||[],n.effects.push(s.dispose))}):t.length===0?(queueMicrotask(()=>{if(n.disposed)return;let a=e();typeof a=="function"&&(s.cleanup=a)}),s.dispose=!0):queueMicrotask(()=>{n.disposed||(s.dispose=$(()=>{for(let c=0;c<t.length;c++){let u=t[c];typeof u=="function"&&u._signal&&u()}if(s.cleanup){try{s.cleanup()}catch{}s.cleanup=null}let a=ce(()=>e());typeof a=="function"&&(s.cleanup=a)}),n.effects=n.effects||[],n.effects.push(s.dispose))}))}function Kn(e,t){let n=Y("useMemo"),{index:r,exists:o}=oe(n);return o||(n.hooks[r]={computed:P(e)}),n.hooks[r].computed}function Jn(e,t){let n=Y("useCallback"),{index:r,exists:o}=oe(n);return o||(n.hooks[r]={callback:e}),n.hooks[r].callback}function Zn(e){let t=Y("useRef"),{index:n,exists:r}=oe(t);return r||(t.hooks[n]={current:e}),t.hooks[n]}function Ze(e){let t=W();for(L&&!t&&console.warn(`[what] useContext(${e?.displayName||"Context"}) called outside of component render. useContext must be called during component rendering, not inside effects or event handlers. Store the context value in a variable during render and use that variable in your callback.`);t;){if(t._contextValues&&t._contextValues.has(e)){let n=t._contextValues.get(e);return n&&n._signal?n():n}t=t._parentCtx}return e._defaultValue}function er(e){let t={_defaultValue:e,Provider:({value:n,children:r})=>{let o=Y("Context.Provider");if(o._contextValues||(o._contextValues=new Map),o._contextSignals||(o._contextSignals=new Map),o._contextSignals.has(t))o._contextSignals.get(t).set(n);else{let s=d(n);o._contextSignals.set(t,s),o._contextValues.set(t,s)}return r},Consumer:({children:n})=>{let r=Ze(t);return typeof n=="function"?n(r):n}};return t.Provider._deferChildren=!0,t}function tr(e,t,n){let r=Y("useReducer"),{index:o,exists:s}=oe(r);if(!s){let c=n?n(t):t,u=d(c),p=i=>{u.set(h=>e(h,i))};r.hooks[o]={signal:u,dispatch:p}}let a=r.hooks[o];return[a.signal,a.dispatch]}function nr(e){let t=Y("onMount");t.mounted||(t._mountCallbacks=t._mountCallbacks||[],t._mountCallbacks.push(e))}function rr(e){let t=Y("onCleanup");t._cleanupCallbacks=t._cleanupCallbacks||[],t._cleanupCallbacks.push(e)}function or(e,t={}){if(Te()){let i=ge();if(i){let h=t.key!=null?t.key:`__r${i.resourceCounter++}`,g=i.resources.get(h);if(g&&g.status==="ready")return[()=>g.value,{loading:()=>!1,error:()=>null,refetch:()=>{},mutate:()=>{}}];if(g&&g.status==="error")return[()=>{},{loading:()=>!1,error:()=>g.error,refetch:()=>{},mutate:()=>{}}];if(!g){let b=Promise.resolve().then(()=>e(t.source??!0,{})).then(S=>{i.resources.set(h,{status:"ready",value:S})}).catch(S=>{i.resources.set(h,{status:"error",error:S})});throw i.resources.set(h,{status:"pending",promise:b}),b}throw g.promise}if(t.initialValue!=null)return[()=>t.initialValue,{loading:()=>!1,error:()=>null,refetch:()=>{},mutate:()=>{}}];throw Promise.resolve().then(()=>e(t.source??!0,{}))}let n=t.initialValue;if(n==null&&t.key!=null){let i=Le(t.key);i!==void 0&&(n=i)}let r=d(n??null),o=d(n==null),s=d(null),a=null,c=async i=>{a&&a.abort(),a=new AbortController;let{signal:h}=a;o.set(!0),s.set(null);try{let g=await e(i,{signal:h});h.aborted||O(()=>{r.set(g),o.set(!1)})}catch(g){h.aborted||O(()=>{s.set(g),o.set(!1)})}},u=i=>{r.set(typeof i=="function"?i(r()):i)},p=W?.();return p&&(p._cleanupCallbacks=p._cleanupCallbacks||[],p._cleanupCallbacks.push(()=>{a&&a.abort()})),n==null&&c(t.source),[r,{loading:o,error:s,refetch:c,mutate:u}]}function nt(e){return e._storeComputed=!0,e}var et=!1;function sr(e){return et||(et=!0,console.warn("[what] storeComputed() is deprecated. Use derived() instead.")),nt(e)}function ar(e){let t={},n={},r={};for(let[o,s]of Object.entries(e))typeof s=="function"&&s._storeComputed?(L&&s.length===0&&console.warn(`[what] derived() for "${o}" should accept the state parameter, e.g. derived(state => ...).`),n[o]=s):typeof s=="function"?r[o]=s:t[o]=d(s);for(let[o,s]of Object.entries(n)){let a=new Proxy({},{get(c,u){if(t[u])return t[u]();if(n[u])return n[u]()}});n[o]=P(()=>s(a))}for(let[o,s]of Object.entries(r))r[o]=(...a)=>{let c;return O(()=>{let u=new Proxy({},{get(p,i){if(t[i])return t[i].peek();if(n[i])return n[i].peek();if(r[i])return r[i]},set(p,i,h){return t[i]&&t[i].set(h),!0}});c=s.apply(u,a)}),c};return function(){let s={};for(let[a,c]of Object.entries(t))Object.defineProperty(s,a,{get:()=>c(),enumerable:!0});for(let[a,c]of Object.entries(n))Object.defineProperty(s,a,{get:()=>c(),enumerable:!0});for(let[a,c]of Object.entries(r))s[a]=c;return s}}var tt=!1;function ir(e){return tt||(tt=!0,console.warn("[what] atom() is deprecated. Use signal() directly instead.")),d(e)}var Me={title:null,metas:new Map,links:new Map};function cr({title:e,meta:t,link:n,children:r}){if(typeof document>"u"){let o=ge();return o&&o.head&&ur(o.head,{title:e,meta:t,link:n}),r??null}if(e&&(document.title=e,Me.title=e),t)for(let o of Array.isArray(t)?t:[t]){let s=o.name||o.property||o.httpEquiv||JSON.stringify(o);ot("meta",s,o)}if(n)for(let o of Array.isArray(n)?n:[n]){let s=o.rel+(o.href||"");ot("link",s,o)}return r||null}function lr(e){return e.name||e.property||e.httpEquiv||JSON.stringify(e)}function ur(e,{title:t,meta:n,link:r}){if(t!=null&&(e.title=t),n)for(let o of Array.isArray(n)?n:[n])e.metas.set(lr(o),o);if(r)for(let o of Array.isArray(r)?r:[r])e.links.set(o.rel+(o.href||""),o)}function dr(){return{title:null,metas:new Map,links:new Map}}function fr(e){if(!e)return"";let t="";e.title!=null&&(t+=`<title>${st(String(e.title))}</title>`);for(let n of e.metas.values())t+=rt("meta",n);for(let n of e.links.values())t+=rt("link",n);return t}var pr=/^[a-zA-Z_:][a-zA-Z0-9:._-]*$/;function Fe(e){if(!pr.test(e))return!1;let t=e.toLowerCase();return!(t.startsWith("on")&&t.length>2)}function ke(e){return e==="httpEquiv"?"http-equiv":e}function rt(e,t){let n=`<${e}`;for(let[r,o]of Object.entries(t)){if(o==null||o===!1)continue;let s=ke(r);Fe(s)&&(n+=` ${s}="${st(String(o))}"`)}return n+">"}function st(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function hr(e){let t=String(e);return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n.codePointAt(0).toString(16)} `)}function ot(e,t,n){let r=document.head.querySelector(`[data-what-head="${hr(t)}"]`);if(r){gr(r,n);return}let o=document.createElement(e);o.setAttribute("data-what-head",t);for(let[s,a]of Object.entries(n))Fe(ke(s))&&o.setAttribute(ke(s),a);document.head.appendChild(o)}function gr(e,t){for(let[n,r]of Object.entries(t)){let o=ke(n);Fe(o)&&e.getAttribute(o)!==r&&e.setAttribute(o,r)}}function mr(){let e=document.head.querySelectorAll("[data-what-head]");for(let t of e)t.remove();Me.metas.clear(),Me.links.clear()}var me=[],ye=[],Ge=!1;function Z(e){return me.push(e),$e(),()=>{let t=me.indexOf(e);t!==-1&&me.splice(t,1)}}function se(e){return ye.push(e),$e(),()=>{let t=ye.indexOf(e);t!==-1&&ye.splice(t,1)}}function at(){for(;me.length>0;){let e=me.shift();try{e()}catch(t){console.error("[what] Scheduler read error:",t)}}for(;ye.length>0;){let e=ye.shift();try{e()}catch(t){console.error("[what] Scheduler write error:",t)}}Ge=!1,(me.length>0||ye.length>0)&&$e()}function $e(){Ge||(Ge=!0,requestAnimationFrame(at))}function yr(e){return new Promise(t=>{Z(()=>{t(e())})})}function vr(e){return new Promise(t=>{se(()=>{e(),t()})})}function wr(e,t){let n=Symbol("scheduledEffect");return $(()=>{it(n,()=>{Z(()=>{let r=e();t&&se(()=>t(r))})})})}function xr(){let e,t=new Promise((n,r)=>{let o=requestAnimationFrame(n);e=()=>{cancelAnimationFrame(o),r(new Error("Cancelled"))}});return t.cancel=e,t}var we=new Map;function it(e,t){we.has(e)?we.set(e,t):(we.set(e,t),requestAnimationFrame(()=>{let n=we.get(e);we.delete(e),n&&n()}))}var Pe=new WeakMap,He=null;function Er(e,t){if(typeof ResizeObserver>"u")return t(e.getBoundingClientRect()),()=>{};He||(He=new ResizeObserver(r=>{Z(()=>{for(let o of r){let s=Pe.get(o.target);s&&s(o.contentRect)}})}));let n=He;return Pe.set(e,t),n.observe(e),()=>{Pe.delete(e),n.unobserve(e)}}function br(e,t,n={}){if(typeof IntersectionObserver>"u")return t({isIntersecting:!0,intersectionRatio:1}),()=>{};let r=new IntersectionObserver(o=>{Z(()=>{for(let s of o)t(s)})},n);return r.observe(e),()=>r.disconnect()}function Sr(e,t={}){let{duration:n=300,easing:r=o=>o*(2-o)}=t;return new Promise(o=>{let s,a,c;Z(()=>{s=window.scrollY;let p=e.getBoundingClientRect();a=s+p.top,c=performance.now(),u()});function u(){Z(()=>{let p=performance.now()-c,i=Math.min(p/n,1),h=r(i),g=s+(a-s)*h;se(()=>{window.scrollTo(0,g),i<1?requestAnimationFrame(u):o()})})}})}function ct(e){let t=W?.(),n=$(e);return t&&t.effects.push(n),n}function lt(e,t={}){let{stiffness:n=100,damping:r=10,mass:o=1,precision:s=.01}=t,a=d(e),c=d(e),u=d(0),p=d(!1),i=null,h=null;function g(k){if(h===null){h=k,i=requestAnimationFrame(g);return}let v=Math.min((k-h)/1e3,.064);h=k;let T=a.peek(),D=c.peek(),C=u.peek(),_=T-D,m=-n*_,f=-r*C,A=(m+f)/o,F=C+A*v,G=T+F*v;if(O(()=>{u.set(F),a.set(G)}),Math.abs(F)<s&&Math.abs(_)<s){O(()=>{a.set(D),u.set(0),p.set(!1)}),i=null,h=null;return}i=requestAnimationFrame(g)}function b(k){c.set(k),i===null&&(p.set(!0),h=null,i=requestAnimationFrame(g))}function S(){i&&(cancelAnimationFrame(i),i=null),p.set(!1),h=null}function I(k){S(),O(()=>{a.set(k),c.set(k),u.set(0)})}let R=W?.();return R&&(R._cleanupCallbacks=R._cleanupCallbacks||[],R._cleanupCallbacks.push(S)),{current:()=>a(),target:()=>c(),velocity:()=>u(),isAnimating:()=>p(),set:b,stop:S,snap:I,subscribe:a.subscribe}}function ut(e,t,n={}){let{duration:r=300,easing:o=b=>b*(2-b),onUpdate:s,onComplete:a}=n,c=d(0),u=d(e),p=d(!0),i=null,h=null;function g(b){i===null&&(i=b);let I=b-i,R=Math.min(I/r,1),k=o(R),v=e+(t-e)*k;O(()=>{c.set(R),u.set(v)}),s&&s(v,R),R<1?h=requestAnimationFrame(g):(p.set(!1),a&&a())}return h=requestAnimationFrame(g),{progress:()=>c(),value:()=>u(),isAnimating:()=>p(),cancel:()=>{h&&cancelAnimationFrame(h),p.set(!1)},subscribe:u.subscribe}}var dt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:-1+(4-2*e)*e,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*(2*Math.PI/3)),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*(2*Math.PI/3))+1,easeOutBounce:e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375};function _r(e={}){let{duration:t=300,easing:n=dt.easeOutQuad}=e,r=d(!1),o=d(0);async function s(a){return r.set(!0),o.set(0),new Promise(c=>{let u=performance.now();function p(i){let h=i-u,g=Math.min(h/t,1);o.set(n(g)),g<1?requestAnimationFrame(p):(r.set(!1),a&&a(),c())}requestAnimationFrame(p)})}return{isTransitioning:()=>r(),progress:()=>o(),start:s}}function kr(e,t={}){let{onDrag:n,onDragStart:r,onDragEnd:o,onPinch:s,onSwipe:a,onTap:c,onLongPress:u,preventDefault:p=!1}=t,i={isDragging:d(!1),startX:0,startY:0,currentX:d(0),currentY:d(0),deltaX:d(0),deltaY:d(0),velocity:d({x:0,y:0})},h=0,g=0,b=0,S=null;function I(_){let m=_.touches?_.touches[0]:_;i.startX=m.clientX,i.startY=m.clientY,g=m.clientX,b=m.clientY,h=performance.now(),i.isDragging.set(!0),r&&r({x:i.startX,y:i.startY}),u&&(S=setTimeout(()=>{i.isDragging.peek()&&u({x:g,y:b})},500))}function R(_){if(!i.isDragging.peek())return;let m=_.touches?_.touches[0]:_,f=m.clientX,A=m.clientY,F=performance.now(),G=F-h;O(()=>{i.currentX.set(f),i.currentY.set(A),i.deltaX.set(f-i.startX),i.deltaY.set(A-i.startY),G>0&&i.velocity.set({x:(f-g)/G*1e3,y:(A-b)/G*1e3})}),g=f,b=A,h=F,S&&Math.sqrt(i.deltaX.peek()**2+i.deltaY.peek()**2)>10&&(clearTimeout(S),S=null),n&&n({x:f,y:A,deltaX:i.deltaX.peek(),deltaY:i.deltaY.peek(),velocity:i.velocity.peek()})}function k(_){if(!i.isDragging.peek())return;S&&(clearTimeout(S),S=null);let m=i.deltaX.peek(),f=i.deltaY.peek(),A=i.velocity.peek();if(Math.sqrt(m**2+f**2)<10&&c&&c({x:i.startX,y:i.startY}),a&&(Math.abs(A.x)>500||Math.abs(A.y)>500)){let G=Math.abs(A.x)>Math.abs(A.y)?A.x>0?"right":"left":A.y>0?"down":"up";a({direction:G,velocity:A})}o&&o({deltaX:m,deltaY:f,velocity:A}),i.isDragging.set(!1)}let v=null;function T(_){if(!s||_.touches.length!==2)return;let m=_.touches[0],f=_.touches[1],A=Math.sqrt((f.clientX-m.clientX)**2+(f.clientY-m.clientY)**2);v===null&&(v=A);let F=A/v,G=(m.clientX+f.clientX)/2,w=(m.clientY+f.clientY)/2;s({scale:F,centerX:G,centerY:w})}function D(){v=null}typeof e=="function"?ct(()=>{let _=ce(e);if(_)return C(_)}):e?.current!==void 0?ct(()=>{let _=e.current;if(_)return C(_)}):e&&C(e);function C(_){return _.addEventListener("mousedown",I),_.addEventListener("touchstart",I,{passive:!p}),window.addEventListener("mousemove",R),window.addEventListener("touchmove",T),window.addEventListener("touchmove",R),window.addEventListener("mouseup",k),window.addEventListener("touchend",k),window.addEventListener("touchend",D),()=>{_.removeEventListener("mousedown",I),_.removeEventListener("touchstart",I),window.removeEventListener("mousemove",R),window.removeEventListener("touchmove",T),window.removeEventListener("touchmove",R),window.removeEventListener("mouseup",k),window.removeEventListener("touchend",k),window.removeEventListener("touchend",D)}}return i}function Rr(e){let t=d(e);return{value:()=>t(),setValue:n=>t.set(n),spring(n,r={}){let o=lt(t.peek(),r);o.set(n);let s=$(()=>{t.set(o.current())});return{stop:()=>{o.stop(),s()}}},timing(n,r={}){let o=ut(t.peek(),n,{...r,onUpdate:s=>t.set(s)});return{stop:()=>o.cancel()}},interpolate(n,r){return()=>{let o=t();for(let s=0;s<n.length-1;s++)if(o>=n[s]&&o<=n[s+1]){let a=(o-n[s])/(n[s+1]-n[s]);return r[s]+(r[s+1]-r[s])*a}return o<=n[0]?r[0]:r[r.length-1]}},subscribe:t.subscribe}}function ft(e){return{enter:`${e}-enter`,enterActive:`${e}-enter-active`,enterDone:`${e}-enter-done`,exit:`${e}-exit`,exitActive:`${e}-exit-active`,exitDone:`${e}-exit-done`}}async function Cr(e,t,n="enter",r=300){let o=ft(t);return new Promise(s=>{se(()=>{e.classList.add(o[n]),Z(()=>{e.offsetHeight,se(()=>{e.classList.add(o[`${n}Active`]),setTimeout(()=>{se(()=>{e.classList.remove(o[n],o[`${n}Active`]),e.classList.add(o[`${n}Done`]),s()})},r)})})})})}var Ar=`
|
|
2
2
|
.what-skeleton {
|
|
3
3
|
background: linear-gradient(
|
|
4
4
|
90deg,
|
|
@@ -224,4 +224,4 @@ createWhatError('MISSING_KEYS');
|
|
|
224
224
|
createWhatError('MISSING_KEY', { component: 'TodoList' });`},UNKNOWN_TOOL:{code:"ERR_UNKNOWN_TOOL",severity:"error",template:"Unknown tool: {{name}}.",suggestion:"The MCP client called a tool this server does not expose. Call tools/list to enumerate what is available; a stale client cache is the usual cause.",codeExample:`// List what the server actually exposes:
|
|
225
225
|
{ "method": "tools/list" }`}},Xe=null;function St(e){return Xe===null&&(Xe=new Map(Object.values(ze).map(t=>[t.code,t]))),Xe.get(e)}var pe=class extends Error{constructor({code:t,message:n,suggestion:r,codeExample:o,file:s,line:a,component:c,signal:u,effect:p}){super(n),this.name="WhatError",this.code=t,this.suggestion=r,this.codeExample=o,this.file=s,this.line=a,this.component=c,this.signal=u,this.effect=p}toJSON(){return{code:this.code,message:this.message,suggestion:this.suggestion,codeExample:this.codeExample,file:this.file,line:this.line,component:this.component,signal:this.signal,effect:this.effect}}};function fe(e,t={}){let n=typeof e=="string"?ze[e]:e;if(!n)return new pe({code:"ERR_UNKNOWN",message:`Unknown error: ${e}`,suggestion:"Check the error code and try again."});let r=n.template;for(let[o,s]of Object.entries(t))r=r.replace(new RegExp(`\\{\\{${o}\\}\\}`,"g"),String(s));return r=r.replace(/\{\{[^}]+\}\}/g,"(unknown)"),new pe({code:n.code,message:r,suggestion:n.suggestion,codeExample:n.codeExample,file:t.file,line:t.line,component:t.component,signal:t.signal||t.signalName,effect:t.effect||t.effectName})}var de=[],bt=200;function Ce(e){L&&(de.push({...e.toJSON(),timestamp:Date.now()}),de.length>bt&&(de=de.slice(-bt)))}function Ae(e){return e?de.filter(t=>t.timestamp>e):de.slice()}function po(){de=[]}function ho(e,t={}){let n=e?.message||String(e);if(e&&typeof e.code=="string"){let r=St(e.code);if(r)return new pe({code:r.code,message:n,suggestion:r.suggestion,codeExample:r.codeExample,file:t.file,line:t.line,component:t.component,signal:t.signal||t.signalName,effect:t.effect||t.effectName})}return n.includes("infinite effect loop")||n.includes("25 iterations")?fe("INFINITE_EFFECT",t):n.includes("hydration")||n.includes("Hydration")?fe("HYDRATION_MISMATCH",t):n.includes("Signal.set() called inside a computed")?fe("SIGNAL_WRITE_IN_RENDER",{...t,signalName:n.match(/signal: (\w+)/)?.[1]||t.signalName}):new pe({code:"ERR_RUNTIME",message:n,suggestion:"Check the stack trace and component context for more details.",...t})}var be={signalReadDetection:!0,componentNaming:!0,importValidation:!0};function go(e){Object.assign(be,e)}function mo(){return{...be}}function yo(e,t){return!L||!be.signalReadDetection||(e.toString=function(){let n=fe("MISSING_SIGNAL_READ",{signalName:t||"(unnamed)"});return console.warn(`[what] ${n.message}
|
|
226
226
|
Suggestion: ${n.suggestion}`),Ce(n),String(e())},e.valueOf=function(){let n=fe("MISSING_SIGNAL_READ",{signalName:t||"(unnamed)"});return console.warn(`[what] ${n.message}
|
|
227
|
-
Suggestion: ${n.suggestion}`),Ce(n),e()}),e}function vo(e){if(!L||!be.componentNaming||!e||/^[A-Z]/.test(e))return null;let t=`Component "${e}" should use PascalCase (e.g., "${wo(e)}"). PascalCase distinguishes components from HTML elements in JSX and is required by the What Framework compiler.`;return console.warn(`[what] ${t}`),{code:"WARN_COMPONENT_NAMING",name:e,suggestion:t}}function wo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var _t=new Set(["signal","computed","effect","signalMemo","batch","untrack","flushSync","createRoot","getOwner","runWithOwner","onRootCleanup","__setDevToolsHooks","template","_template","svgTemplate","insert","mapArray","spread","setProp","delegateEvents","on","classList","hydrate","isHydrating","_$createComponent","h","Fragment","html","mount","useState","useSignal","useComputed","useEffect","useMemo","useCallback","useRef","useContext","useReducer","createContext","onMount","onCleanup","createResource","memo","lazy","Suspense","ErrorBoundary","Show","For","Switch","Match","Island","createStore","derived","storeComputed","atom","Head","clearHead","each","cls","style","debounce","throttle","useMediaQuery","useLocalStorage","useClickOutside","Portal","transition","scheduleRead","scheduleWrite","flushScheduler","measure","mutate","useScheduledEffect","nextFrame","raf","onResize","onIntersect","smoothScrollTo","_setTextInsertHook","spring","tween","easings","useTransition","useGesture","useAnimatedValue","createTransitionClasses","cssTransition","useFocus","useFocusRestore","useFocusTrap","FocusTrap","announce","announceAssertive","SkipLink","useAriaExpanded","useAriaSelected","useAriaChecked","useRovingTabIndex","VisuallyHidden","LiveRegion","useId","useIds","useDescribedBy","useLabelledBy","Keys","onKey","onKeys","Skeleton","SkeletonText","SkeletonAvatar","SkeletonCard","SkeletonTable","IslandSkeleton","useSkeleton","Placeholder","LoadingDots","Spinner","useFetch","useSWR","useQuery","useInfiniteQuery","invalidateQueries","prefetchQuery","setQueryData","getQueryData","clearCache","__getCacheSnapshot","useForm","useField","rules","simpleResolver","zodResolver","yupResolver","Input","Textarea","Select","Checkbox","Radio","ErrorMessage"]);function xo(e){if(!L||!be.importValidation)return[];let t=[];for(let n of e)_t.has(n)||t.push({name:n,message:`"${n}" is not a valid export from what-framework.`,suggestion:`Check the API reference. Did you mean: ${Eo(n)}?`});return t}function Eo(e){let t=e.toLowerCase(),n=null,r=1/0;for(let o of _t){let s=bo(t,o.toLowerCase());s<r&&(r=s,n=o)}return r<=3?n:"(no close match found)"}function bo(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let n=[];for(let r=0;r<=t.length;r++)n[r]=[r];for(let r=0;r<=e.length;r++)n[0][r]=r;for(let r=1;r<=t.length;r++)for(let o=1;o<=e.length;o++){let s=t[r-1]===e[o-1]?0:1;n[r][o]=Math.min(n[r-1][o]+1,n[r][o-1]+1,n[r-1][o-1]+s)}return n[t.length][e.length]}var So="0.
|
|
227
|
+
Suggestion: ${n.suggestion}`),Ce(n),e()}),e}function vo(e){if(!L||!be.componentNaming||!e||/^[A-Z]/.test(e))return null;let t=`Component "${e}" should use PascalCase (e.g., "${wo(e)}"). PascalCase distinguishes components from HTML elements in JSX and is required by the What Framework compiler.`;return console.warn(`[what] ${t}`),{code:"WARN_COMPONENT_NAMING",name:e,suggestion:t}}function wo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var _t=new Set(["signal","computed","effect","signalMemo","batch","untrack","flushSync","createRoot","getOwner","runWithOwner","onRootCleanup","__setDevToolsHooks","template","_template","svgTemplate","insert","mapArray","spread","setProp","delegateEvents","on","classList","hydrate","isHydrating","_$createComponent","h","Fragment","html","mount","useState","useSignal","useComputed","useEffect","useMemo","useCallback","useRef","useContext","useReducer","createContext","onMount","onCleanup","createResource","memo","lazy","Suspense","ErrorBoundary","Show","For","Switch","Match","Island","createStore","derived","storeComputed","atom","Head","clearHead","each","cls","style","debounce","throttle","useMediaQuery","useLocalStorage","useClickOutside","Portal","transition","scheduleRead","scheduleWrite","flushScheduler","measure","mutate","useScheduledEffect","nextFrame","raf","onResize","onIntersect","smoothScrollTo","_setTextInsertHook","spring","tween","easings","useTransition","useGesture","useAnimatedValue","createTransitionClasses","cssTransition","useFocus","useFocusRestore","useFocusTrap","FocusTrap","announce","announceAssertive","SkipLink","useAriaExpanded","useAriaSelected","useAriaChecked","useRovingTabIndex","VisuallyHidden","LiveRegion","useId","useIds","useDescribedBy","useLabelledBy","Keys","onKey","onKeys","Skeleton","SkeletonText","SkeletonAvatar","SkeletonCard","SkeletonTable","IslandSkeleton","useSkeleton","Placeholder","LoadingDots","Spinner","useFetch","useSWR","useQuery","useInfiniteQuery","invalidateQueries","prefetchQuery","setQueryData","getQueryData","clearCache","__getCacheSnapshot","useForm","useField","rules","simpleResolver","zodResolver","yupResolver","Input","Textarea","Select","Checkbox","Radio","ErrorMessage"]);function xo(e){if(!L||!be.importValidation)return[];let t=[];for(let n of e)_t.has(n)||t.push({name:n,message:`"${n}" is not a valid export from what-framework.`,suggestion:`Check the API reference. Did you mean: ${Eo(n)}?`});return t}function Eo(e){let t=e.toLowerCase(),n=null,r=1/0;for(let o of _t){let s=bo(t,o.toLowerCase());s<r&&(r=s,n=o)}return r<=3?n:"(no close match found)"}function bo(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let n=[];for(let r=0;r<=t.length;r++)n[r]=[r];for(let r=0;r<=e.length;r++)n[0][r]=r;for(let r=1;r<=t.length;r++)for(let o=1;o<=e.length;o++){let s=t[r-1]===e[o-1]?0:1;n[r][o]=Math.min(n[r-1][o]+1,n[r][o-1]+1,n[r-1][o-1]+s)}return n[t.length][e.length]}var So="0.14.0",Se=[];function _o(e){L&&Se.push(e)}function ko(e){if(!L)return;let t=Se.indexOf(e);t>=0&&Se.splice(t,1)}function kt(){return Se.slice()}var ve=[];function Ro(e){L&&ve.push(e)}function Co(e){if(!L)return;let t=ve.indexOf(e);t>=0&&ve.splice(t,1)}function Rt(){return ve.slice()}function Ct(){let e=Ae(),t=e.filter(u=>Date.now()-u.timestamp<6e4),r=e.filter(u=>u.code==="ERR_INFINITE_EFFECT").length>0,o=e.filter(u=>u.code==="ERR_ORPHAN_EFFECT"),s=ve.filter(u=>!!(u._subs&&u._subs.size===0)).length,a=ve.length,c=a>1e4?"high":a>1e3?"medium":"low";return{effectCycleRisk:r,orphanEffects:o.length,signalLeaks:s,memoryPressure:c,recentErrorCount:t.length,totalSignals:a,totalComponents:Se.length}}function Ao(){L&&(typeof globalThis>"u"||(globalThis.__WHAT_AGENT__={framework:"what-framework",version:So,mode:"development",features:["signals","effects","computed","ssr","islands","router","stores","forms","animations","a11y"],components:()=>kt().map(e=>({id:e.id,name:e.name||e.displayName||e.constructor?.name})),signals:()=>Rt().map((e,t)=>({id:t,name:e._debugName||`signal_${t}`,value:typeof e=="function"?e.peek?.():void 0,subscriberCount:e._subs?e._subs.size:0})),errors:()=>Ae(),health:()=>Ct(),api:{reactive:["signal","computed","effect","batch","untrack","flushSync","createRoot","memo"],hooks:["useState","useSignal","useComputed","useEffect","useMemo","useCallback","useRef","useContext","onMount","onCleanup"],components:["Show","For","Switch","Match","Suspense","ErrorBoundary","lazy","Island"],data:["useSWR","useQuery","useFetch","useInfiniteQuery"],store:["createStore","derived","atom"]}}))}export{lo as Checkbox,ze as ERROR_CODES,qt as ErrorBoundary,fo as ErrorMessage,hn as FocusTrap,Wt as For,Ft as Fragment,cr as Head,ao as Input,zt as Island,Nr as IslandSkeleton,An as Keys,Sn as LiveRegion,Lr as LoadingDots,Xt as Match,Or as Placeholder,rn as Portal,uo as Radio,co as Select,Bt as Show,Ve as Skeleton,Ir as SkeletonAvatar,ht as SkeletonCard,Tr as SkeletonTable,je as SkeletonText,yn as SkipLink,Mr as Spinner,Ut as Suspense,Yt as Switch,io as Textarea,bn as VisuallyHidden,pe as WhatError,Dn as _$createComponent,On as _$template,Mt as __drainPreinstallBuffer,Xr as __getCacheSnapshot,Ht as __installServerContextStorage,De as __readHydrationData,Bn as __resetHydrationData,At as __setDevToolsHooks,ln as _beginComponentSSR,un as _endComponentSSR,an as _isAriaAttr,Pn as _mapArrayToArray,Nn as _setTextInsertHook,Je as _template,gn as announce,mn as announceAssertive,ir as atom,O as batch,dr as beginHeadCollection,vo as checkComponentName,jn as classList,ho as classifyError,Yr as clearCache,po as clearCollectedErrors,mr as clearHead,Kt as cls,Ce as collectError,P as computed,go as configureGuardrails,er as createContext,or as createResource,Ot as createRoot,ar as createStore,ft as createTransitionClasses,fe as createWhatError,Cr as cssTransition,Zt as debounce,$n as delegateEvents,nt as derived,Qt as each,dt as easings,$ as effect,fr as endHeadCollection,at as flushScheduler,Tt as flushSync,Rt as getActiveSignals,Ae as getCollectedErrors,St as getErrorDefinition,mo as getGuardrailConfig,Ct as getHealth,Oe as getLoaderData,kt as getMountedComponents,Nt as getOwner,Wr as getQueryData,Le as getResource,ge as getServerContext,N as h,Pt as html,qn as hydrate,Mn as insert,Ao as installAgentContext,yo as installSignalReadGuardrail,Ur as invalidateQueries,Un as isHydrating,jt as lazy,Fn as mapArray,yr as measure,Vt as memo,cn as mount,vr as mutate,xr as nextFrame,Vn as on,rr as onCleanup,br as onIntersect,In as onKey,Tn as onKeys,nr as onMount,Er as onResize,Lt as onRootCleanup,qr as prefetchQuery,it as raf,_o as registerComponent,Ro as registerSignal,oo as rules,Dt as runWithOwner,$t as runWithServerContext,Z as scheduleRead,se as scheduleWrite,Gn as setProp,Br as setQueryData,Gt as setServerContext,d as signal,It as signalMemo,ro as simpleResolver,Sr as smoothScrollTo,Hn as spread,lt as spring,sr as storeComputed,Jt as style,Ln as svgTemplate,Je as template,en as throttle,sn as transition,ut as tween,ko as unregisterComponent,Co as unregisterSignal,ce as untrack,Rr as useAnimatedValue,xn as useAriaChecked,vn as useAriaExpanded,wn as useAriaSelected,Jn as useCallback,on as useClickOutside,zn as useComputed,Ze as useContext,Rn as useDescribedBy,Qn as useEffect,Gr as useFetch,so as useField,dn as useFocus,fn as useFocusRestore,pn as useFocusTrap,Kr as useForm,kr as useGesture,_n as useId,kn as useIds,jr as useInfiniteQuery,Cn as useLabelledBy,Wn as useLoaderData,nn as useLocalStorage,tn as useMediaQuery,Kn as useMemo,Vr as useQuery,tr as useReducer,Zn as useRef,En as useRovingTabIndex,$r as useSWR,wr as useScheduledEffect,Xn as useSignal,Dr as useSkeleton,Yn as useState,_r as useTransition,xo as validateImports,no as yupResolver,eo as zodResolver};
|
package/dist/render.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as j,B as k,C as l,D as m,E as n,F as o,G as p,H as q,I as r,J as s,K as t,L as u,M as v,N as w,O as x,u as d,v as e,w as f,x as g,y as h,z as i}from"./chunk-
|
|
1
|
+
import{A as j,B as k,C as l,D as m,E as n,F as o,G as p,H as q,I as r,J as s,K as t,L as u,M as v,N as w,O as x,u as d,v as e,w as f,x as g,y as h,z as i}from"./chunk-FN6HXME3.min.js";import{f as a,h as b,j as c}from"./chunk-VKZY7JPN.min.js";import"./chunk-6YOUZ6T4.min.js";export{e as _$componentVNode,f as _$createComponent,g as _$template,l as _mapArrayToArray,d as _setTextInsertHook,h as _template,v as classList,t as delegateEvents,a as effect,x as hydrate,j as insert,w as isHydrating,k as mapArray,b as memo,u as on,q as setAttr,s as setChecked,o as setClass,n as setProp,p as setStyle,r as setValue,m as spread,i as svgTemplate,h as template,c as untrack};
|
package/dist/testing.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{X as T,a as _,b as S,c as y,d as b,f as g,i as h,m as v}from"./chunk-
|
|
1
|
+
import{X as T,a as _,b as S,c as y,d as b,f as g,i as h,m as v}from"./chunk-VKZY7JPN.min.js";import{a as x}from"./chunk-6YOUZ6T4.min.js";var f=null,m=new Set;function $(e){let t=()=>{m.has(t)&&(m.delete(t),e())};return m.add(t),t}function q(){return typeof document<"u"&&(f=document.createElement("div"),f.id="test-root",document.body.appendChild(f)),f}function M(){for(let e of[...m])try{e()}catch{}f&&(f.innerHTML="",f.parentNode&&f.parentNode.removeChild(f),f=null)}function R(e,t={}){let{container:n}=t,o=n||q();if(!o)throw new Error("No DOM container available. Are you running in Node.js without jsdom?");let s=$(T(e,o));return{container:o,unmount:s,getByText:r=>p(o,r),getByTestId:r=>o.querySelector(`[data-testid="${r}"]`),getByRole:r=>o.querySelector(`[role="${r}"]`),getAllByText:r=>D(o,r),queryByText:r=>p(o,r),queryByTestId:r=>o.querySelector(`[data-testid="${r}"]`),debug:()=>console.log(o.innerHTML),findByText:(r,u)=>N(()=>p(o,r),{timeout:u}),findByTestId:(r,u)=>N(()=>o.querySelector(`[data-testid="${r}"]`),{timeout:u})}}function F(e,t){let n=q();if(!n)throw new Error("No DOM container available. Are you running in Node.js without jsdom?");let o={},s=null,r;return v(u=>{s=u;let c=x(e,t||{});r=$(T(c,n))}),{container:n,signals:new Proxy(o,{get(u,c){if(c in u)return u[c]},set(u,c,i){return u[c]=i,!0}}),update(){h()},unmount(){r&&r(),s&&s(),M()},getByText:u=>p(n,u),getByTestId:u=>n.querySelector(`[data-testid="${u}"]`),queryByText:u=>p(n,u),debug:()=>console.log(n.innerHTML)}}function A(){h()}var B="(unnamed)";function P(e){if(!_)throw new Error('[what] trackSignals() requires a development build. Signal debug names and subscriber back-references are stripped in production, so there is nothing to report. Run your tests with NODE_ENV !== "production".');let t=[],n=[],o=(d,l)=>{d.includes(l)||d.push(l)},s=S,r={...s||{},onSignalUpdate(d){o(n,d?._debugName||B),s?.onSignalUpdate?.(d)}};delete r.__isPreinstallBuffer;let u=b(0,"__trackSignals_probe__"),c={current:null},i=null,a=(d,l)=>{for(let w of d||[]){if(l.has(w))continue;l.add(w);let E=w._signalOwner;if(E){E!==u&&o(t,E._debugName||B);continue}let k=w._owner;k?.deps&&a(k.deps,l)}};y(r);try{v(l=>{c.current=l,g(()=>{u(),e()})});let d=new Set;for(let l of u._subs)a(l.deps,d)}catch(d){i=d}finally{c.current?.(),y(s)}if(i)throw i;return{accessed:t,written:n}}function j(e,t){let n=[t],o=0,s=b(t,e),r=s.set;s.set=function(i){let a=typeof i=="function"?i(s.peek()):i;return Object.is(s.peek(),a)||(o++,n.push(a)),r(a)};let u=s,c=function(...i){if(i.length===0)return u();let a=typeof i[0]=="function"?i[0](u.peek()):i[0];return Object.is(u.peek(),a)||(o++,n.push(a)),u(a)};return c._signal=!0,c.peek=s.peek,c.set=s.set,c.subscribe=s.subscribe,s._debugName&&(c._debugName=s._debugName),s._subs&&(c._subs=s._subs),Object.defineProperty(c,"history",{get(){return n}}),Object.defineProperty(c,"setCount",{get(){return o}}),c.reset=function(i){let a=i!==void 0?i:t;n.length=0,n.push(a),o=0,u(a)},c}function p(e,t){let n=t instanceof RegExp?t:null,o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);for(;o.nextNode();){let s=o.currentNode,r=s.textContent||"";if(n?n.test(r):r.includes(t))return s.parentElement}return null}function D(e,t){let n=[],o=t instanceof RegExp?t:null,s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);for(;s.nextNode();){let r=s.currentNode,u=r.textContent||"";(o?o.test(u):u.includes(t))&&n.push(r.parentElement)}return n}var I={click(e){let t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:typeof window<"u"?window:void 0});return e.dispatchEvent(t),t},change(e,t){e.value=t;let n=new Event("input",{bubbles:!0});e.dispatchEvent(n);let o=new Event("change",{bubbles:!0});return e.dispatchEvent(o),o},input(e,t){e.value=t;let n=new Event("input",{bubbles:!0});return e.dispatchEvent(n),n},submit(e){let t=new Event("submit",{bubbles:!0,cancelable:!0});return e.dispatchEvent(t),t},focus(e){e.focus();let t=new FocusEvent("focus",{bubbles:!0});return e.dispatchEvent(t),t},blur(e){e.blur();let t=new FocusEvent("blur",{bubbles:!0});return e.dispatchEvent(t),t},keyDown(e,t,n={}){let o=new KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,key:t,...n});return e.dispatchEvent(o),o},keyUp(e,t,n={}){let o=new KeyboardEvent("keyup",{bubbles:!0,cancelable:!0,key:t,...n});return e.dispatchEvent(o),o},mouseEnter(e){let t=new MouseEvent("mouseenter",{bubbles:!0});return e.dispatchEvent(t),t},mouseLeave(e){let t=new MouseEvent("mouseleave",{bubbles:!0});return e.dispatchEvent(t),t}};async function N(e,t={}){let{timeout:n=1e3,interval:o=50}=t,s=Date.now();for(;Date.now()-s<n;){try{let r=e();if(r)return r}catch{}await new Promise(r=>setTimeout(r,o))}throw new Error(`waitFor timed out after ${n}ms`)}async function L(e,t={}){let{timeout:n=1e3,interval:o=50}=t,s=Date.now(),r=e();if(!r)throw new Error("Element not found");for(;Date.now()-s<n;){if(r=e(),!r)return;await new Promise(u=>setTimeout(u,o))}throw new Error(`Element still present after ${n}ms`)}async function V(e){let t=await e();return h(),await new Promise(n=>queueMicrotask(()=>n())),await new Promise(n=>setTimeout(()=>n(),0)),t}function U(e){let t=b(e),n=[e];return g(()=>{n.push(t())}),{signal:t,get value(){return t()},set value(o){t.set(o)},history:n,reset(){n.length=0,n.push(t())}}}function W(e="MockComponent"){let t=[];function n(o){return t.push({props:o,timestamp:Date.now()}),x("div",{"data-testid":`mock-${e}`},JSON.stringify(o,null,2))}return n.displayName=e,n.calls=t,n.lastCall=()=>t[t.length-1],n.reset=()=>{t.length=0},n}var K={toBeInTheDocument(e){if(!e||!e.parentNode)throw new Error("Expected element to be in the document")},toHaveTextContent(e,t){if(!e)throw new Error("Element not found");let n=e.textContent;if(!(t instanceof RegExp?t.test(n):n.includes(t)))throw new Error(`Expected "${n}" to contain "${t}"`)},toHaveAttribute(e,t,n){if(!e)throw new Error("Element not found");let o=e.getAttribute(t);if(n!==void 0&&o!==n)throw new Error(`Expected attribute "${t}" to be "${n}", got "${o}"`);if(n===void 0&&o===null)throw new Error(`Expected element to have attribute "${t}"`)},toHaveClass(e,t){if(!e)throw new Error("Element not found");if(!e.classList.contains(t))throw new Error(`Expected element to have class "${t}"`)},toBeVisible(e){if(!e)throw new Error("Element not found");let t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"||t.opacity==="0")throw new Error("Expected element to be visible")},toBeDisabled(e){if(!e)throw new Error("Element not found");if(!e.disabled)throw new Error("Expected element to be disabled")},toHaveValue(e,t){if(!e)throw new Error("Element not found");if(e.value!==t)throw new Error(`Expected value to be "${t}", got "${e.value}"`)}},X={getByText:e=>p(document.body,e),getByTestId:e=>document.querySelector(`[data-testid="${e}"]`),getByRole:e=>document.querySelector(`[role="${e}"]`),getAllByText:e=>D(document.body,e),queryByText:e=>p(document.body,e),queryByTestId:e=>document.querySelector(`[data-testid="${e}"]`),debug:()=>console.log(document.body.innerHTML)};export{V as act,M as cleanup,U as createTestSignal,K as expect,I as fireEvent,A as flushEffects,W as mockComponent,j as mockSignal,R as render,F as renderTest,X as screen,q as setupDOM,P as trackSignals,N as waitFor,L as waitForElementToBeRemoved};
|
package/package.json
CHANGED
package/src/agent-context.js
CHANGED
|
@@ -8,7 +8,7 @@ import { getCollectedErrors } from './errors.js';
|
|
|
8
8
|
// --- Version ---
|
|
9
9
|
// Keep in sync with packages/core/package.json (checked by
|
|
10
10
|
// core/test/guardrails.test.js so it can't silently go stale again).
|
|
11
|
-
const VERSION = '0.
|
|
11
|
+
const VERSION = '0.14.0';
|
|
12
12
|
|
|
13
13
|
// --- Component Registry ---
|
|
14
14
|
// Tracks mounted components for agent inspection.
|
package/src/dom.js
CHANGED
|
@@ -813,40 +813,42 @@ function createErrorBoundary(vnode, parent) {
|
|
|
813
813
|
const error = errorState();
|
|
814
814
|
|
|
815
815
|
componentStack.push(boundaryCtx);
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
816
|
+
try {
|
|
817
|
+
// Remove old content between comment boundaries
|
|
818
|
+
const openParent = startComment.parentNode;
|
|
819
|
+
if (openParent) {
|
|
820
|
+
while (startComment.nextSibling && startComment.nextSibling !== endComment) {
|
|
821
|
+
const old = startComment.nextSibling;
|
|
822
|
+
disposeTree(old);
|
|
823
|
+
openParent.removeChild(old);
|
|
824
|
+
}
|
|
824
825
|
}
|
|
825
|
-
}
|
|
826
826
|
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
827
|
+
let vnodes;
|
|
828
|
+
if (error) {
|
|
829
|
+
vnodes = typeof fallback === 'function' ? [fallback({ error, reset })] : [fallback];
|
|
830
|
+
} else {
|
|
831
|
+
vnodes = children;
|
|
832
|
+
}
|
|
833
833
|
|
|
834
|
-
|
|
834
|
+
vnodes = Array.isArray(vnodes) ? vnodes : [vnodes];
|
|
835
835
|
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
836
|
+
for (const v of vnodes) {
|
|
837
|
+
const node = createDOM(v, parent);
|
|
838
|
+
if (node) {
|
|
839
|
+
// Insert before endComment
|
|
840
|
+
if (endComment.parentNode) {
|
|
841
|
+
endComment.parentNode.insertBefore(node, endComment);
|
|
842
|
+
} else {
|
|
843
|
+
// Still in fragment before first mount
|
|
844
|
+
container.insertBefore(node, endComment);
|
|
845
|
+
}
|
|
845
846
|
}
|
|
846
847
|
}
|
|
848
|
+
} finally {
|
|
849
|
+
// A fallback may throw; later mounts must not inherit this boundary.
|
|
850
|
+
componentStack.pop();
|
|
847
851
|
}
|
|
848
|
-
|
|
849
|
-
componentStack.pop();
|
|
850
852
|
});
|
|
851
853
|
|
|
852
854
|
boundaryCtx.effects.push(dispose);
|
package/src/reactive.js
CHANGED
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
// - Ownership tree: createRoot children auto-dispose when parent disposes
|
|
8
8
|
// - Performance: cached levels, lazy sort, fast-path notify, minimal allocation
|
|
9
9
|
|
|
10
|
-
// Dev-mode flag —
|
|
10
|
+
// Dev-mode flag — production defaults disable hooks; the runtime override can
|
|
11
|
+
// retain development branches in consumer bundles.
|
|
11
12
|
//
|
|
12
13
|
// Resolution order (first definitive signal wins; PRODUCTION-SAFE default):
|
|
13
14
|
// 1. globalThis.__WHAT_DEV__ — explicit boolean override for browser tooling
|
|
14
15
|
// (e.g. the playground can force dev mode without a bundler env).
|
|
15
|
-
// 2. import.meta.env.DEV — Vite & modern bundlers statically replace this
|
|
16
|
-
//
|
|
16
|
+
// 2. import.meta.env.DEV — Vite & modern bundlers statically replace this
|
|
17
|
+
// fallback; the explicit runtime override above still takes precedence.
|
|
17
18
|
// 3. process.env.NODE_ENV — Node / webpack / esbuild `define`.
|
|
18
19
|
// 4. false — a raw browser bundle with NO build signal must
|
|
19
20
|
// default to PRODUCTION. (Previously defaulted to `true`, so EVERY browser
|
|
@@ -29,7 +30,7 @@ export const __DEV__ =
|
|
|
29
30
|
: false;
|
|
30
31
|
|
|
31
32
|
// DevTools hooks — set by what-devtools when installed.
|
|
32
|
-
// These are no-ops
|
|
33
|
+
// These are no-ops when development mode is disabled.
|
|
33
34
|
/** @type {WhatDevToolsHooks | null} */
|
|
34
35
|
export let __devtools = null;
|
|
35
36
|
|
|
@@ -348,6 +349,8 @@ export function effect(fn, opts) {
|
|
|
348
349
|
}
|
|
349
350
|
// Compute level after first run based on actual dependencies (cached).
|
|
350
351
|
_updateLevel(e);
|
|
352
|
+
// Registration precedes execution; publish the now-populated initial graph.
|
|
353
|
+
if (__DEV__) __devtools?.onEffectRun?.(e);
|
|
351
354
|
// Mark as stable after first run — subsequent re-runs skip cleanup/re-subscribe
|
|
352
355
|
if (opts?.stable) e._stable = true;
|
|
353
356
|
|
|
@@ -440,7 +443,7 @@ function _runEffect(e) {
|
|
|
440
443
|
if (typeof result === 'function') e._cleanup = result;
|
|
441
444
|
} catch (err) {
|
|
442
445
|
if (__devtools?.onError) __devtools.onError?.(err, { type: 'effect', effect: e });
|
|
443
|
-
|
|
446
|
+
_reportUpdateError(err);
|
|
444
447
|
} finally {
|
|
445
448
|
currentEffect = prev;
|
|
446
449
|
}
|
|
@@ -534,10 +537,11 @@ function _processSubscriber(e) {
|
|
|
534
537
|
}
|
|
535
538
|
} catch (err) {
|
|
536
539
|
if (__DEV__ && __devtools?.onError) __devtools.onError?.(err, { type: 'effect', effect: e });
|
|
537
|
-
|
|
540
|
+
_reportUpdateError(err);
|
|
538
541
|
} finally {
|
|
539
542
|
currentEffect = prev;
|
|
540
543
|
}
|
|
544
|
+
if (__DEV__) __devtools?.onEffectRun?.(e);
|
|
541
545
|
} else {
|
|
542
546
|
e._pending = true;
|
|
543
547
|
const level = e._level;
|
|
@@ -603,6 +607,11 @@ function scheduleMicrotask() {
|
|
|
603
607
|
|
|
604
608
|
let isFlushing = false;
|
|
605
609
|
|
|
610
|
+
function _reportUpdateError(err) {
|
|
611
|
+
// Reporting must not interrupt sibling updates, even with a throwing console.
|
|
612
|
+
try { console.error('[what] Uncaught error in effect during update:', err); } catch { /* no console */ }
|
|
613
|
+
}
|
|
614
|
+
|
|
606
615
|
function flush() {
|
|
607
616
|
// Re-entrancy guard: if flush() is called during an active flush (e.g., via
|
|
608
617
|
// flushSync() inside a component render or effect), skip to prevent infinite
|
|
@@ -643,7 +652,7 @@ function flush() {
|
|
|
643
652
|
// Surface in production too — an uncaught reactive-update error is a
|
|
644
653
|
// real bug; staying silent (as the old throw-out-of-flush did once it
|
|
645
654
|
// escaped) hides it. console.error never aborts the batch.
|
|
646
|
-
|
|
655
|
+
_reportUpdateError(err);
|
|
647
656
|
continue;
|
|
648
657
|
}
|
|
649
658
|
// Update level only if deps changed (graph structure change)
|
package/src/render.js
CHANGED
|
@@ -2901,15 +2901,15 @@ function hydrateElementProps(el, props) {
|
|
|
2901
2901
|
continue;
|
|
2902
2902
|
}
|
|
2903
2903
|
|
|
2904
|
-
// Reactive props
|
|
2904
|
+
// Reactive props must stop with the adopted element, like mounted props.
|
|
2905
2905
|
if (typeof value === 'function' && !_isEventProp(key)) {
|
|
2906
2906
|
if (key === 'class' || key === 'className') {
|
|
2907
|
-
effect(() => { el.className = value() || ''; });
|
|
2907
|
+
addHydrationDisposer(el, effect(() => { el.className = value() || ''; }));
|
|
2908
2908
|
} else if (key === 'style' && typeof value() === 'object') {
|
|
2909
2909
|
// Route through setStyle so stale object keys are cleared (el._lastStyleObj).
|
|
2910
|
-
effect(() => { setStyle(el, value()); });
|
|
2910
|
+
addHydrationDisposer(el, effect(() => { setStyle(el, value()); }));
|
|
2911
2911
|
} else {
|
|
2912
|
-
effect(() => { setProp(el, key, value()); });
|
|
2912
|
+
addHydrationDisposer(el, effect(() => { setProp(el, key, value()); }));
|
|
2913
2913
|
}
|
|
2914
2914
|
continue;
|
|
2915
2915
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{E as Lt,Q as q,R as Nt,T as Bt,U as it,V as O,W as gt,Y as W,Z as Mt,_ as v,a as z,ba as Dt,ca as Ht,d as I,da as yt,f as j,j as Et,n as Q,r as Tt,z as St}from"./chunk-ZDIHSTQJ.min.js";import{a as Z}from"./chunk-6YOUZ6T4.min.js";var jt=I(null);typeof document<"u"&&document.addEventListener("focusin",t=>{jt.set(t.target)});function Me(){return{current:()=>jt(),focus:t=>t?.focus(),blur:()=>document.activeElement?.blur()}}function De(){let t={current:null};function e(r){typeof document>"u"||(t.current=r||document.activeElement||null)}function n(r){let o=t.current||r;o&&typeof o.focus=="function"&&o.focus()}return{capture:e,restore:n,previous:()=>t.current}}function te(t){let e=null;function n(){if(typeof document>"u")return;e=document.activeElement;let o=t.current||t;if(!o||typeof o.querySelectorAll!="function")return;let i=Pt(o);if(i.length===0)return;i[0].focus();function g(c){if(c.key!=="Tab")return;let p=Pt(o),l=p[0],d=p[p.length-1];c.shiftKey?document.activeElement===l&&(c.preventDefault(),d.focus()):document.activeElement===d&&(c.preventDefault(),l.focus())}return o.addEventListener("keydown",g),()=>{o.removeEventListener("keydown",g)}}function r(){e&&typeof e.focus=="function"&&e.focus()}return{activate:n,deactivate:r}}function Pt(t){let e=["button:not([disabled])","a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(t.querySelectorAll(e)).filter(n=>n.offsetParent!==null)}function He({children:t,active:e=!0}){let n={current:null},r=I(0),o=te(n),i=null,g=l=>{n.current=l,r.set(d=>d+1)},c=j(()=>{if(r(),i&&(i(),i=null,o.deactivate()),e&&n.current)return i=o.activate(),()=>{i?.(),i=null,o.deactivate()}}),p=Mt?.();return p&&(p._cleanupCallbacks=p._cleanupCallbacks||[],p._cleanupCallbacks.push(()=>{c(),i?.(),i=null,o.deactivate()})),Z("div",{ref:g},t)}var k=null,mt=0;function ee(){return typeof document>"u"?null:(k||(k=document.createElement("div"),k.id="what-announcer",k.setAttribute("aria-live","polite"),k.setAttribute("aria-atomic","true"),k.style.cssText=`
|
|
2
|
-
position: absolute;
|
|
3
|
-
width: 1px;
|
|
4
|
-
height: 1px;
|
|
5
|
-
padding: 0;
|
|
6
|
-
margin: -1px;
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
clip: rect(0, 0, 0, 0);
|
|
9
|
-
white-space: nowrap;
|
|
10
|
-
border: 0;
|
|
11
|
-
`,document.body.appendChild(k)),k)}function ne(t,e={}){let{priority:n="polite",timeout:r=1e3}=e,o=ee();if(!o)return;o.setAttribute("aria-live",n);let i=++mt;o.textContent="",requestAnimationFrame(()=>{mt===i&&(o.textContent=t)}),setTimeout(()=>{mt===i&&(o.textContent="")},r)}function Pe(t){return ne(t,{priority:"assertive"})}function je({href:t="#main",children:e="Skip to content"}){return Z("a",{href:t,class:"what-skip-link",onClick:n=>{n.preventDefault();let r=document.querySelector(t);r&&(r.focus(),r.scrollIntoView())},style:{position:"absolute",top:"-40px",left:"0",padding:"8px",background:"#000",color:"#fff",textDecoration:"none",zIndex:"10000"},onFocus:n=>{n.target.style.top="0"},onBlur:n=>{n.target.style.top="-40px"}},e)}function bt(t){return t?"true":"false"}function Re(t=!1){let e=I(t);return{expanded:()=>e(),toggle:()=>e.set(!e.peek()),open:()=>e.set(!0),close:()=>e.set(!1),buttonProps:()=>({"aria-expanded":()=>bt(e()),onClick:()=>e.set(!e.peek())}),panelProps:()=>({hidden:()=>!e()})}}function $e(t=null){let e=I(t);return{selected:()=>e(),select:n=>e.set(n),isSelected:n=>e()===n,itemProps:n=>({"aria-selected":()=>bt(e()===n),onClick:()=>e.set(n)})}}function Ke(t=!1){let e=I(t);return{checked:()=>e(),toggle:()=>e.set(!e.peek()),set:n=>e.set(n),checkboxProps:()=>({role:"checkbox","aria-checked":()=>bt(e()),tabIndex:0,onClick:()=>e.set(!e.peek()),onKeyDown:n=>{(n.key===" "||n.key==="Enter")&&(n.preventDefault(),e.set(!e.peek()))}})}}function Oe(t,e={}){let n=typeof t=="function"?t:()=>t,r=I(0),o=e?.role||null,i=[],g=[],c=[];function p(h){let s=g[h];return s||(s={get current(){return i[h]||null},set current(a){i[h]=a||null;let x=c[h];typeof x=="function"?x(a):x&&typeof x=="object"&&(x.current=a)}},g[h]=s),s}function l(h){let s=i[h];return s?s.isConnected===!1?null:s:null}function d(h){let s=l(h);return!s||typeof s.focus!="function"?null:((typeof document>"u"||document.activeElement!==s)&&s.focus(),s)}function f(){if(typeof document>"u")return!1;let h=document.activeElement;if(!h)return!1;for(let s=0;s<i.length;s++){let a=i[s];if(a&&(a===h||typeof a.contains=="function"&&a.contains(h)))return!0}return!1}function m(h,s){return!(s>0)||h<0?0:h>s-1?s-1:h}function b(){return m(r(),n())}function y(h){return Number.isInteger(h)&&h>=0&&h<n()}function _(h){let s=n();if(s<=0)return;let a=m(r.peek(),s),x=a;switch(h.key){case"ArrowDown":case"ArrowRight":x=(a+1)%s;break;case"ArrowUp":case"ArrowLeft":x=(a-1+s)%s;break;case"Home":x=0;break;case"End":x=s-1;break;default:return}h.preventDefault(),r.set(x),d(x)}return{focusIndex:()=>b(),setFocusIndex:h=>{y(h)&&(r.set(h),f()&&d(h))},focusItem:h=>y(h)?(r.set(h),d(h)):null,getItemProps:(h,s)=>{let{ref:a,...x}=s||{};return c[h]=a||null,{ref:p(h),tabIndex:()=>b()===h?0:-1,onKeyDown:_,onFocus:S=>{let D=S&&(S.currentTarget||S.target);D&&(i[h]=D),r.set(h)},...x}},containerProps:h=>o?{role:o,...h}:{...h}}}function Ie({children:t,as:e="span"}){return Z(e,{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}},t)}function Ve({children:t,priority:e="polite",atomic:n=!0}){return Z("div",{"aria-live":e,"aria-atomic":n},t)}var Rt=0;function $t(){let t=Tt();return t?(t.idCounter=(t.idCounter||0)+1,t.idCounter):++Rt}function Kt(){Rt=0}function Ot(t="what"){let e=`${t}-${$t()}`;return()=>e}function ze(t,e="what"){let n=[];for(let r=0;r<t;r++)n.push(`${e}-${$t()}`);return n}function ke(t){let e=Ot("desc");return{descriptionId:e,descriptionProps:()=>({id:e(),style:{display:"none"}}),describedByProps:()=>({"aria-describedby":e()}),Description:()=>Z("div",{id:e(),style:{display:"none"}},t)}}function Ge(t){let e=Ot("label");return{labelId:e,labelProps:()=>({id:e()}),labelledByProps:()=>({"aria-labelledby":e()})}}var Ue={Enter:"Enter",Space:" ",Escape:"Escape",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Home:"Home",End:"End",Tab:"Tab"};function qe(t,e){return n=>{n.key===t&&e(n)}}function We(t,e){return n=>{t.includes(n.key)&&e(n)}}var et=null;function Fe(t){et=typeof t=="function"?t:null}function re(t,e,n){if(typeof n=="function"){let r=()=>{let o=n();return o.length===1?o[0]:o};return r._lazyChildren=!0,e=e?Object.assign({},e):{},Object.defineProperty(e,"_$lazyChildren",{value:r,configurable:!0}),{tag:t,props:e,children:[],key:null,_vnode:!0}}if(n&&n.length>0){let r=n.length===1?n[0]:n;e=e?Object.assign({},e,{children:r}):{children:r}}return{tag:t,props:e||{},children:n||[],key:null,_vnode:!0}}function tn(t,e,n){return W(re(t,e,n))}var oe={tr:{depth:2,wrap:"<table><tbody>",unwrap:"</tbody></table>"},td:{depth:3,wrap:"<table><tbody><tr>",unwrap:"</tr></tbody></table>"},th:{depth:3,wrap:"<table><tbody><tr>",unwrap:"</tr></tbody></table>"},thead:{depth:1,wrap:"<table>",unwrap:"</table>"},tbody:{depth:1,wrap:"<table>",unwrap:"</table>"},tfoot:{depth:1,wrap:"<table>",unwrap:"</table>"},colgroup:{depth:1,wrap:"<table>",unwrap:"</table>"},col:{depth:1,wrap:"<table>",unwrap:"</table>"},caption:{depth:1,wrap:"<table>",unwrap:"</table>"}},ie=new Set(["svg","path","circle","rect","line","polyline","polygon","ellipse","g","defs","use","text","tspan","foreignObject","clipPath","mask","pattern","linearGradient","radialGradient","stop","marker","symbol","image","animate","animateTransform","animateMotion","set","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feImage","feMorphology","feSpecularLighting","feTile","feTurbulence","feDistantLight","fePointLight","feSpotLight"]);function Gt(t){let e=t.match(/^<([a-zA-Z][a-zA-Z0-9]*)/);return e?e[1]:""}function ce(t){let e=t.trim(),n=Gt(e);if(ie.has(n))return fe(e);let r=oe[n];if(r){let i=document.createElement("template");i.innerHTML=r.wrap+e+r.unwrap;let g=i.content.firstChild;for(let c=0;c<r.depth;c++)g=g.firstChild;return()=>g.cloneNode(!0)}let o=document.createElement("template");if(o.innerHTML=e,z&&o.content.childNodes.length!==1){let i=[...o.content.childNodes].find((g,c)=>c>0&&g.nodeType===1);throw Object.assign(new Error(`[what] <${n}> cannot contain <${i?i.nodeName.toLowerCase():"that element"}>: the HTML parser closed the outer tag early, so the rendered tree does not match your JSX.`),{code:"ERR_INVALID_HTML_NESTING"})}return()=>o.content.firstChild.cloneNode(!0)}var It=!1;function en(t){return z&&!It&&(It=!0,console.warn("[what] template() is a compiler internal. Use JSX instead. Direct calls with user input can lead to XSS vulnerabilities.")),ce(t)}function fe(t){let e=t.trim();if(Gt(e)==="svg"){let o=document.createElement("template");return o.innerHTML=e,()=>o.content.firstChild.cloneNode(!0)}let r=document.createElement("template");return r.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg">${e}</svg>`,()=>r.content.firstChild.firstChild.cloneNode(!0)}function Ut(t,e){if(!t)return;let n=!1,r=()=>{n||(n=!0,e())},o=t._dispose;t._dispose=o?()=>{o(),r()}:r}function qt(t,e,n){if(typeof e=="function"&&e._mapArray)return e(t,n||null);if(typeof e=="function"&&e._lazyChildren)return qt(t,e(),n);if(typeof e=="function"){let r=n||null,o=null,i=null,g=!1,c=Ct(),p=j(()=>Xt(c,()=>{let l=e(),d=typeof l;if(!g){g=!0,d==="string"||d==="number"?(i=document.createTextNode(String(l)),r?t.insertBefore(i,r):t.appendChild(i),et&&et(t,String(l)),o=i):o=ft(t,l,null,r);return}if(i!==null&&(d==="string"||d==="number")){let f=String(l);i.data!==f&&(i.data=f),et&&et(t,f);return}i=null,o=ft(t,l,o,r)}));return Ut(r||t,p),o}if(typeof e=="string"||typeof e=="number"){let r=document.createTextNode(String(e));return n?t.insertBefore(r,n):t.appendChild(r),r}return e!=null&&typeof e=="object"&&e.nodeType>0?(n?t.insertBefore(e,n):t.appendChild(e),e):ft(t,e,null,n||null)}function Wt(t){return!t||typeof t!="object"?!1:typeof Node<"u"&&t instanceof Node?!0:typeof t.nodeType=="number"&&typeof t.nodeName=="string"}function se(t){return!!t&&typeof t=="object"&&(t._vnode===!0||"tag"in t)}var at=typeof SVGElement<"u";function wt(t){return at&&t instanceof SVGElement&&t.tagName!=="foreignObject"}function Ct(){let t=v();return t[t.length-1]||null}function Xt(t,e){let n=v(),r=t!==null&&n[n.length-1]!==t;r&&n.push(t);try{return e()}finally{r&&n.pop()}}function Vt(t){return t==null?[]:Array.isArray(t)?t:[t]}function Jt(t,e,n){if(t==null||typeof t=="boolean")return n;if(Array.isArray(t)){for(let r=0;r<t.length;r++)Jt(t[r],e,n);return n}if(typeof t=="function"){let r=W(t,e,wt(e));if(r&&r.nodeType===11){let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}else r&&n.push(r);return n}if(typeof t=="string"||typeof t=="number")return n.push(document.createTextNode(String(t))),n;if(Wt(t)){if(t.nodeType===11&&t.childNodes.length>0){let r=Array.from(t.childNodes);for(let o=0;o<r.length;o++)n.push(r[o])}else n.push(t);return n}if(se(t)){let r=W(t,e,wt(e));if(r&&r.nodeType===11)if(r.childNodes.length===0)n.push(r);else{let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}else r&&n.push(r);return n}return n.push(document.createTextNode(String(t))),n}function le(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function ft(t,e,n,r){if(!t||typeof t.insertBefore!="function")return z&&console.warn("[what] reconcileInsert called with invalid parent:",t),n;let o=r||null;if(e==null||typeof e=="boolean"){let d=gt(Vt(n));for(let f=0;f<d.length;f++){let m=d[f];m.parentNode===t&&(O(m),t.removeChild(m))}return null}if((typeof e=="string"||typeof e=="number")&&n&&!Array.isArray(n)&&n.nodeType===3){let d=String(e);return n.data!==d&&(n.data=d),n}if(typeof e=="object"&&e!==null&&e.nodeType>0&&e.nodeType!==11&&!Array.isArray(e)){if(e===n)return n;if(n&&!Array.isArray(n)&&n.nodeType>0&&n.nodeType!==11)return n.parentNode===t?(O(n),t.replaceChild(e,n)):o?t.insertBefore(e,o):t.appendChild(e),e}let i=Jt(e,t,[]),g=Vt(n);if(le(g,i))return n;let c=gt(g),p=i.length;for(let d=0;d<c.length;d++){let f=c[d];if(f.parentNode!==t)continue;let m=!1;for(let b=0;b<p;b++)if(i[b]===f){m=!0;break}m||(O(f),t.removeChild(f))}let l=o;for(let d=i.length-1;d>=0;d--){let f=i[d];(f.parentNode!==t||f.nextSibling!==l)&&(l&&l.parentNode!==t&&(l=null),l?t.insertBefore(f,l):t.appendChild(f)),l=f}return i.length===0?null:i.length===1?i[0]:i}function nn(t,e,n){let r=n?.key,o=n?.raw||!1,i=(g,c)=>{let p=[],l=[],d=[],f=r&&!o?new Map:null,m=document.createComment("/list");g.insertBefore(m,c||null);let b=j(()=>{let y=t()||[],_=m.parentNode||g;r?pe(_,m,p,y,l,d,e,r,f):ue(_,m,p,y,l,d,e),p=y.length>0?y.slice():y});return Ut(m,()=>{b();for(let y=0;y<d.length;y++)d[y]?.();d.length=0}),m};return i._mapArray=!0,i._mapArraySource=t,i._mapArrayFn=e,i._mapArrayKeyed=!!r&&!o,i}function rn(t){let e=t._mapArraySource()||[],n=t._mapArrayFn,r=t._mapArrayKeyed;return e.map((o,i)=>n(r?()=>o:o,i))}function ue(t,e,n,r,o,i,g){let c=r.length,p=n.length;if(c===0){if(p>0){for(let s=0;s<p;s++)i[s]&&i[s]();for(let s=p-1;s>=0;s--){let a=o[s];a&&(O(a),a.parentNode===t&&t.removeChild(a))}o.length=0,i.length=0}return}if(p===0){let s=document.createDocumentFragment();for(let a=0;a<c;a++){let x=r[a],S=Q(D=>(i[a]=D,g(x,a)));o[a]=S,s.appendChild(S)}t.insertBefore(s,e);return}let l=0,d=Math.min(p,c);for(;l<d&&n[l]===r[l];)l++;if(l===p&&l===c)return;let f=p-1,m=c-1;for(;f>=l&&m>=l&&n[f]===r[m];)f--,m--;let b=new Array(c),y=new Array(c);for(let s=0;s<l;s++)b[s]=o[s],y[s]=i[s];for(let s=m+1;s<c;s++){let a=f+1+(s-m-1);b[s]=o[a],y[s]=i[a]}let _=m-l+1,h=f-l+1;if(_===0)for(let s=l;s<=f;s++)i[s]?.(),o[s]&&O(o[s]),o[s]?.parentNode&&o[s].parentNode.removeChild(o[s]);else if(h===0){let s=l<c&&b[m+1]?b[m+1]:e,a=document.createDocumentFragment();for(let x=l;x<=m;x++){let S=r[x],D=x;b[x]=Q(N=>(y[D]=N,g(S,D))),a.appendChild(b[x])}t.insertBefore(a,s)}else ae(t,e,n,r,o,i,g,l,f,m,b,y);o.length=c,i.length=c;for(let s=0;s<c;s++)o[s]=b[s],i[s]=y[s]}function ae(t,e,n,r,o,i,g,c,p,l,d,f){let m=new Map;for(let a=c;a<=p;a++)m.set(n[a],a);let b=l-c+1,y=new Int32Array(b);y.fill(-1);for(let a=c;a<=l;a++){let x=m.get(r[a]);x!==void 0&&(m.delete(r[a]),d[a]=o[x],f[a]=i[x],y[a-c]=x)}for(let[,a]of m)i[a]?.(),o[a]&&O(o[a]),o[a]?.parentNode&&o[a].parentNode.removeChild(o[a]);let _=b-de(y,b),h=new Uint8Array(b);if(_>1){let a=new Int32Array(_),x=new Int32Array(_),S=0;for(let N=0;N<b;N++)y[N]!==-1&&(a[S]=y[N],x[S]=N,S++);let D=Zt(a,_);for(let N=0;N<D.length;N++)h[x[D[N]]]=1}else if(_===1){for(let a=0;a<b;a++)if(y[a]!==-1){h[a]=1;break}}for(let a=c;a<=l;a++)if(!d[a]){let x=r[a],S=a;d[a]=Q(D=>(f[S]=D,g(x,S)))}let s=l+1<d.length&&d[l+1]?d[l+1]:e;for(let a=l;a>=c;a--){let x=a-c;(y[x]===-1||!h[x])&&(s&&s.parentNode!==t&&(s=e),t.insertBefore(d[a],s)),s=d[a]}}function de(t,e){let n=0;for(let r=0;r<e;r++)t[r]===-1&&n++;return n}function Zt(t,e){if(e===0)return[];if(e===1)return[0];let n=new Int32Array(e),r=new Int32Array(e),o=1;n[0]=0,r[0]=-1;for(let c=1;c<e;c++)if(t[c]>t[n[o-1]])r[c]=n[o-1],n[o++]=c;else{let p=0,l=o-1;for(;p<l;){let d=p+l>>1;t[n[d]]<t[c]?p=d+1:l=d}n[p]=c,r[c]=p>0?n[p-1]:-1}let i=new Array(o),g=n[o-1];for(let c=o-1;c>=0;c--)i[c]=g,g=r[g];return i}function he(){return document.createComment("i")}function F(t,e,n,r){let o=e;for(;o&&o!==n;){let i=o.nextSibling;t.insertBefore(o,r),o=i}}function xt(t,e,n){let r=e;for(;r&&r!==n;){let o=r.nextSibling;O(r),t.removeChild(r),r=o}}function _t(t,e,n,r,o,i,g,c,p){let l;if(o){let m=r(e),b=p(e);l=b,o.set(m,{itemSig:b})}else l=e;let d=he();t.appendChild(d);let f=Q(m=>(c[n]=m,i(l,n)));t.appendChild(f),g[n]=d}function pe(t,e,n,r,o,i,g,c,p){let l=r.length,d=n.length;if(l===0){if(d>0){for(let u=0;u<d;u++)i[u]&&i[u]();o[0]&&xt(t,o[0],e),o.length=0,i.length=0,p&&p.clear()}return}if(d===0){let u=document.createDocumentFragment();for(let E=0;E<l;E++)_t(u,r[E],E,c,p,g,o,i,I);t.insertBefore(u,e);return}let f=0,m=Math.min(d,l);for(;f<m;){if(n[f]===r[f]){f++;continue}let u=c(n[f]),E=c(r[f]);if(u!==E)break;p&&p.get(u).itemSig.set(r[f]),f++}let b=d-1,y=l-1;for(;b>=f&&y>=f;){if(n[b]===r[y]){b--,y--;continue}let u=c(n[b]),E=c(r[y]);if(u!==E)break;p&&p.get(u).itemSig.set(r[y]),b--,y--}if(f>b&&f>y)return;let _=new Array(l),h=new Array(l);for(let u=0;u<f;u++)_[u]=o[u],h[u]=i[u];for(let u=y+1;u<l;u++){let E=b+1+(u-y-1);_[u]=o[E],h[u]=i[E]}let s=y-f+1,a=b-f+1;if(a===0){let u=y+1<l&&_[y+1]?_[y+1]:e,E=document.createDocumentFragment();for(let B=f;B<=y;B++)_t(E,r[B],B,c,p,g,_,h,I);t.insertBefore(E,u),tt(o,i,_,h,l);return}if(s===0){for(let u=f;u<=b;u++){i[u]?.();let E=X(t,o[u],o,u,e);xt(t,o[u],E),p&&p.delete(c(n[u]))}tt(o,i,_,h,l);return}if(s===a&&s>=2&&s<=Math.max(a,200)){let u=0,E=-1,B=-1;for(let A=0;A<s&&u<=4;A++){let C=c(n[f+A]),K=c(r[f+A]);C!==K&&(u===0?E=A:u===1&&(B=A),u++)}if(u===2){let A=f+E,C=f+B,K=c(n[A]),J=c(n[C]),pt=c(r[A]),U=c(r[C]);if(K===U&&J===pt){for(let L=0;L<f;L++)_[L]=o[L],h[L]=i[L];for(let L=f;L<=y;L++)_[L]=o[L],h[L]=i[L];for(let L=y+1;L<l;L++){let $=b+1+(L-y-1);_[L]=o[$],h[L]=i[$]}let R=_[A];_[A]=_[C],_[C]=R;let M=h[A];if(h[A]=h[C],h[C]=M,p){if(r[A]!==n[A]){let L=c(r[A]),$=p.get(L);$&&$.itemSig.set(r[A])}if(r[C]!==n[C]){let L=c(r[C]),$=p.get(L);$&&$.itemSig.set(r[C])}}let H=C===A+1||A===C+1,P=Math.min(A,C),T=Math.max(A,C);if(H){let L=X(t,o[T],o,T,e);F(t,o[T],L,o[P])}else{let L=X(t,o[C],o,C,e),$=document.createComment("tmp");t.insertBefore($,o[C]),F(t,o[C],L,o[A]);let Ft=X(t,o[A],o,A,e);F(t,o[A],Ft,$),t.removeChild($)}tt(o,i,_,h,l);return}}if(u>=2&&u<=s){let A=E,C=-1,K=-1,J=!1,pt=c(n[f+A]),U=-1;for(let R=A;R<s;R++)if(c(r[f+R])===pt){U=R;break}if(U>A){let R=!0;for(let M=A;M<U;M++)if(c(n[f+M+1])!==c(r[f+M])){R=!1;break}if(R){let M=!0;for(let H=U+1;H<s;H++)if(c(n[f+H])!==c(r[f+H])){M=!1;break}M&&(J=!0,C=f+A,K=f+U)}}if(!J){let R=c(r[f+A]),M=-1;for(let H=A;H<a;H++)if(c(n[f+H])===R){M=H;break}if(M>A){let H=!0;for(let P=A;P<M;P++)if(c(n[f+P])!==c(r[f+P+1])){H=!1;break}if(H){let P=!0;for(let T=M+1;T<s;T++)if(c(n[f+T])!==c(r[f+T])){P=!1;break}P&&(J=!0,C=f+M,K=f+A)}}}if(J){for(let T=f;T<=b;T++)_[T]=o[T],h[T]=i[T];let R=_[C],M=h[C];if(C<K)for(let T=C;T<K;T++)_[T]=_[T+1],h[T]=h[T+1];else for(let T=C;T>K;T--)_[T]=_[T-1],h[T]=h[T-1];if(_[K]=R,h[K]=M,p)for(let T=f;T<=y;T++){let L=c(r[T]);if(r[T]!==n[T]){let $=p.get(L);$&&$.itemSig.set(r[T])}}let H=X(t,R,o,C,e),P;K+1<l?P=_[K+1]:P=e,(K>=y+1||P&&P.parentNode!==t)&&(P=e),F(t,R,H,P),tt(o,i,_,h,l);return}}}let x=new Map;for(let u=f;u<=b;u++)x.set(c(n[u]),u);let S=new Int32Array(s);S.fill(-1);for(let u=f;u<=y;u++){let E=c(r[u]),B=x.get(E);B!==void 0&&(x.delete(E),_[u]=o[B],h[u]=i[B],S[u-f]=B,p&&r[u]!==n[B]&&p.get(E).itemSig.set(r[u]))}let D=[...x.values()].sort((u,E)=>E-u);for(let u of D){i[u]?.();let E=X(t,o[u],o,u,e);xt(t,o[u],E),p&&p.delete(c(n[u]))}for(let u=f;u<=y;u++)if(!_[u]){let E=document.createDocumentFragment();_t(E,r[u],u,c,p,g,_,h,I),_[u]._frag=E}let N=0,rt=!0,ot=-1;for(let u=0;u<s;u++)S[u]!==-1&&(N++,S[u]<=ot&&(rt=!1),ot=S[u]);let V=new Uint8Array(s);if(rt)for(let u=0;u<s;u++)S[u]!==-1&&(V[u]=1);else if(N>1){let u=new Int32Array(N),E=new Int32Array(N),B=0;for(let C=0;C<s;C++)S[C]!==-1&&(u[B]=S[C],E[B]=C,B++);let A=Zt(u,N);for(let C=0;C<A.length;C++)V[E[A[C]]]=1}else if(N===1){for(let u=0;u<s;u++)if(S[u]!==-1){V[u]=1;break}}tt(o,i,_,h,l);let ht=y+1<l&&o[y+1]?o[y+1]:e;for(let u=y;u>=f;u--){let E=u-f,B=o[u];if(S[E]===-1)B._frag&&(t.insertBefore(B._frag,ht),delete B._frag);else if(!V[E]){let A=X(t,B,o,u,e);F(t,B,A,ht)}ht=B}}function X(t,e,n,r,o){let i=e.nextSibling;for(;i&&i!==o;){if(i.nodeType===8&&i.data==="i")return i;i=i.nextSibling}return o}function tt(t,e,n,r,o){t.length=o,e.length=o;for(let i=0;i<o;i++)t[i]=n[i],e[i]=r[i]}function on(t,e){for(let n in e){let r=e[n];if(n==="ref"){typeof r=="function"?r(t):r&&typeof r=="object"&&(r.current=t);continue}if(q(n)){if(typeof r!="function")continue;let o=n.slice(2).toLowerCase();t.addEventListener(o,r);continue}if(typeof r=="function"&&!q(n)){if(t._propEffects||(t._propEffects={}),t._propEffects[n])try{t._propEffects[n]()}catch{}n==="class"||n==="className"?t._propEffects[n]=j(()=>{let o=r()||"";at&&t instanceof SVGElement?t.setAttribute("class",o):t.className=o}):n==="style"&&typeof r()=="object"?t._propEffects[n]=j(()=>{dt(t,r())}):t._propEffects[n]=j(()=>{lt(t,n,r())})}else lt(t,n,r)}}function lt(t,e,n){if(e==="ref"){typeof n=="function"?n(t):n&&typeof n=="object"&&(n.current=t);return}if(e==="key")return;if(typeof n=="function"&&!q(e)){if(t._propEffects||(t._propEffects={}),t._propEffects[e])try{t._propEffects[e]()}catch{}t._propEffects[e]=j(()=>lt(t,e,n()));return}if(q(e))return;if(Nt(e,n)){typeof console<"u"&&console.warn(`[what] Blocked unsafe URL in "${e}" attribute:`,n);return}let r=at&&t instanceof SVGElement;if(e==="class"||e==="className")r?t.setAttribute("class",n||""):t.className=n||"";else if(e==="dangerouslySetInnerHTML"){let o=n?.__html??"";typeof z<"u"&&z&&typeof o=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(o)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),t.innerHTML=o}else if(e==="innerHTML")if(n&&typeof n=="object"&&"__html"in n){let o=n.__html??"";typeof z<"u"&&z&&typeof o=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(o)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),t.innerHTML=o}else typeof console<"u"&&n!=null&&n!==""&&console.warn('[what] Plain string innerHTML is not allowed. Use { __html: "..." } or dangerouslySetInnerHTML={{ __html: "..." }} instead.');else if(e==="style")dt(t,n);else if(n==null){if(e in t)try{t[e]=""}catch{}t.removeAttribute(e)}else e.startsWith("data-")||e.startsWith("aria-")?t.setAttribute(e,n):typeof n=="boolean"?n?t.setAttribute(e,""):t.removeAttribute(e):r?t.setAttribute(e,n):e==="value"&&t.tagName==="SELECT"?yt(t,n):e in t?t[e]=n:t.setAttribute(e,n)}function nt(t,e,n,r){if(t._propEffects||(t._propEffects={}),t._propEffects[e])try{t._propEffects[e]()}catch{}t._propEffects[e]=j(()=>r(t,n()))}function ge(t,e){if(typeof e=="function")return nt(t,"class",e,ge);at&&t instanceof SVGElement?t.setAttribute("class",e||""):t.className=e||""}function dt(t,e){if(typeof e=="function")return nt(t,"style",e,dt);if(typeof e=="string")t.style.cssText=e,t._lastStyleObj=null;else if(e&&typeof e=="object"){let n=t.style,r=t._lastStyleObj;if(r)for(let o in r)o in e||(n[o]="");for(let o in e)n[o]=e[o]??"";t._lastStyleObj=e}else e==null&&(t.style.cssText="",t._lastStyleObj=null)}function ye(t,e,n){if(typeof n=="function")return nt(t,e,n,(r,o)=>ye(r,e,o));n==null?t.removeAttribute(e):t.setAttribute(e,n)}function me(t,e){if(typeof e=="function")return nt(t,"value",e,me);if(t.tagName==="SELECT"){yt(t,e);return}let n=e==null?"":String(e);t.value!==n&&(t.value=n)}function be(t,e){if(typeof e=="function")return nt(t,"checked",e,be);t.checked=!!e}var zt=new Set;function cn(t){for(let e of t)zt.has(e)||(zt.add(e),document.addEventListener(e,n=>{let r=n.target,o="$$"+e;for(Object.defineProperty(n,"currentTarget",{configurable:!0,get(){return r||document}});r;){let i=r[o];if(i&&(i(n),n.cancelBubble))return;r=r.parentNode}}))}function fn(t,e,n){return t.addEventListener(e,n),()=>t.removeEventListener(e,n)}function sn(t,e){j(()=>{for(let n in e){let r=typeof e[n]=="function"?e[n]():e[n];t.classList.toggle(n,!!r)}})}var ut=!1,w=null;function ln(){return ut}function xe(t,e){ut=!0,At=!1,Kt(),w={parent:e,index:0};try{let n=G(t,e);return e!==document.body&&e!==document.documentElement&&Yt(e),n}finally{ut=!1,w=null}}function Yt(t){if(!(!w||w.parent!==t))for(;t.childNodes.length>w.index;){let e=t.lastChild;O(e),t.removeChild(e)}}var _e=new Set(["$","/$","[]","/[]","fn","/fn","eb:start","eb:end","sb:start","sb:end","portal","portal:empty"]);function Qt(t){return t.nodeType===8&&_e.has(t.textContent)}function ct(t){let e=t.childNodes;for(;w.index<e.length;){let n=e[w.index];if(Qt(n)){w.index++;continue}return w.index++,n}return null}function vt(t){if(!w||w.parent!==t)return null;let e=t.childNodes;for(let n=w.index;n<e.length;n++){let r=e[n];if(!Qt(r))return r}return null}function Y(t,e){let n=e.nodeType===11?e.childNodes.length:1;return w&&w.parent===t?(t.insertBefore(e,t.childNodes[w.index]||null),w.index+=n):t.appendChild(e),e}function st(){return z}var At=!1;function we(){!st()||At||(At=!0,console.warn("[what] hydrate() was given DOM that is already built, so the server's markup is being REPLACED by a client render rather than adopted. Hydration needs an unbuilt vnode tree, which is what h() returns. what-compiler emits the unbuilt form for JSX written directly inside a hydrate() call, so the remaining causes are: a tree built before the call (`const tree = <App />; hydrate(tree, el)`), a component whose own body what-compiler lowered (it returns a template clone, which is finished DOM, and cannot be rendered by renderToString either), or a DOM node passed in by hand. The page below is correct and interactive; only the reuse is lost."))}function G(t,e){if(t==null||typeof t=="boolean")return null;if(typeof t=="string"||typeof t=="number"){let n=String(t);if(n===""){let i=vt(e);return i&&i.nodeType===3?(ct(e),i.textContent="",i):Y(e,document.createTextNode(""))}let r=ct(e);if(r&&r.nodeType===3)return r.textContent!==n&&(st()&&console.warn(`[what] Hydration mismatch: expected text "${n}", got "${r.textContent}"`),r.textContent=n),r;st()&&console.warn(`[what] Hydration mismatch: expected text node "${n}", got ${r?r.nodeName:"nothing"}. Falling back to client render.`);let o=document.createTextNode(n);return r?e.replaceChild(o,r):Y(e,o),o}if(typeof t=="function"&&t._lazyChildren)return G(t(),e);if(typeof t=="function"&&t._mapArray){let n=!!(w&&w.parent===e),r=n&&e.childNodes[w.index]||null,o=document.createComment("list");e.insertBefore(o,r),n&&w.index++;let i=t(e,r);if(o._rangeEnd=i,n){let g=Array.prototype.indexOf.call(e.childNodes,i);g>=0&&(w.index=g+1)}return i}if(typeof t=="function"){let n=!!(w&&w.parent===e),r=document.createComment("fn"),o=document.createComment("/fn");n?(e.insertBefore(r,e.childNodes[w.index]||null),w.index++):e.appendChild(r),G(t(),e),n?(e.insertBefore(o,e.childNodes[w.index]||null),w.index++):e.appendChild(o);let i=[];for(let f=r.nextSibling;f&&f!==o;f=f.nextSibling)i.push(f);let g=i.length===0?null:i.length===1?i[0]:i,c=Ct(),p=j(()=>Xt(c,()=>{let f=t();ut||(g=ft(o.parentNode||e,f,g,o))})),l=!1,d=()=>{l||(l=!0,p())};return r._dispose=d,o._dispose=d,Bt(r,d),r._rangeEnd=o,g}if(Array.isArray(t)){let n=[];for(let r of t){let o=G(r,e);o&&n.push(o)}return n.length===1?n[0]:n}if(typeof t=="object"&&t._vnode){if(typeof t.tag=="function"){let i=v(),g=t.tag,c=t.props||{},p=t.children||[],l={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:g,_parentCtx:i[i.length-1]||null,_errorBoundary:null};i.push(l);let d,f=null;try{let m={...c};c._$lazyChildren?f=Dt(g,m,c._$lazyChildren):m.children=p.length===0?c.children:p.length===1?p[0]:p,d=g(m),f&&f()}catch(m){return i.pop(),!Ht(m)&&!(m&&typeof m.then=="function"&&Ae(m,l))&&!St(m,l)&&console.error("[what] Error in component during hydration:",g.name||"Anonymous",m),null}l.mounted=!0,l._mountCallbacks&&queueMicrotask(()=>{if(!l.disposed)for(let m of l._mountCallbacks)try{m()}catch(b){console.error("[what] onMount error:",b)}});try{let m=G(d,e),b=typeof d=="function"||Array.isArray(d)&&d.some(h=>typeof h=="function"),y=Array.isArray(m)?m[0]:m,_=!b&&y&&y.nodeType?y:e;return it(_,l),m}finally{i.pop()}}if(t.tag==="__errorBoundary"){let{errorState:i,fallback:g,reset:c,handleError:p}=t.props;return kt(t,e,{startText:"eb:start",endText:"eb:end",ctxExtras:{_errorBoundary:p},state:i,contentFor:l=>l?typeof g=="function"?g({error:l,reset:c}):g:t.children||[]})}if(t.tag==="__suspense"){let{boundary:i,fallback:g,loading:c}=t.props;return kt(t,e,{startText:"sb:start",endText:"sb:end",ctxExtras:{_suspenseBoundary:i},state:c,contentFor:p=>p?g:t.children||[]})}if(t.tag==="__portal"){let i=W(t,e);return i?Y(e,i):null}let n=ct(e),r=t.tag.toLowerCase();if(n&&n.nodeType===1&&n.nodeName.toLowerCase()===r){Te(n,t.props||{}),n.removeAttribute("data-hk");let i=w;if(w={parent:n,index:0},t.props?.dangerouslySetInnerHTML?.__html==null){for(let c of t.children)G(c,n);t.children.length>0&&Yt(n)}return w=i,n}st()&&console.warn(`[what] Hydration mismatch: expected <${t.tag}>, got ${n?n.nodeName:"nothing"}. Falling back to client render.`);let o=W(t,e,wt(e));return n?e.replaceChild(o,n):Y(e,o),o}if(Wt(t)){we();let n=t.nodeType===11?t.childNodes.length:1,o=!!(w&&w.parent===e)?ct(e):null;return o?(e.replaceChild(t,o),w.index+=n-1,t):Y(e,t)}return Y(e,document.createTextNode(String(t)))}function Ae(t,e){for(let n=e;n;n=n._parentCtx)if(n._suspenseBoundary)return n._suspenseBoundary.onSuspend(t),!0;return!1}function Ce(t,e){return typeof t=="string"||typeof t=="number"?e.nodeType!==3:t&&t._vnode&&typeof t.tag=="string"?e.nodeType!==1||e.nodeName.toLowerCase()!==t.tag.toLowerCase():!1}function Ee(t,e,n){if(e<0||!w||w.parent!==t||w.index!==e)return!1;let r=vt(t);if(!r)return!1;let o=n(),i=Array.isArray(o)?o:[o],g=i.find(c=>c!=null&&typeof c!="boolean");if(g===void 0)return!0;if(Ce(g,r))return!1;for(let c of i)G(c,t);return!0}function kt(t,e,{startText:n,endText:r,ctxExtras:o,state:i,contentFor:g}){let c=t.children||[],p=!!(w&&w.parent===e),l=document.createComment(n),d=document.createComment(r),f={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:Ct(),_startComment:l,_endComment:d,...o};p?(e.insertBefore(l,e.childNodes[w.index]||null),w.index++):e.appendChild(l);let m=p?w.index:-1,b=v();b.push(f);try{for(let x of c)G(x,e)}finally{b.pop()}let y=Et(i),_=!y;if(y){b.push(f);try{_=Ee(e,m,()=>g(y))}finally{b.pop()}}p?(e.insertBefore(d,e.childNodes[w.index]||null),w.index++):e.appendChild(d);let h=!0,s=0,a=j(()=>{let x=i();if(h&&(h=!1,_&&x===y))return;let S=l.parentNode;if(!S)return;let D=++s;for(;l.nextSibling&&l.nextSibling!==d;){let N=l.nextSibling;O(N),S.removeChild(N)}b.push(f);try{let N=g(x),rt=Array.isArray(N)?N:[N];for(let ot of rt){let V=W(ot,S);if(D!==s){V&&O(V);break}V&&(d.parentNode?d.parentNode.insertBefore(V,d):O(V))}}finally{b.pop()}});if(p&&w&&w.parent===e){let x=Array.prototype.indexOf.call(e.childNodes,d);x>=0&&(w.index=x+1)}return f.effects.push(a),it(l,f),it(d,f),l}function Te(t,e){for(let n in e){if(n==="children"||n==="key"||n==="dangerouslySetInnerHTML"||n==="innerHTML")continue;if(n==="ref"){let o=e.ref;typeof o=="function"?o(t):o&&typeof o=="object"&&(o.current=t);continue}let r=e[n];if(q(n)){if(typeof r!="function")continue;let o=n.slice(2).toLowerCase();t.addEventListener(o,r);continue}if(n.startsWith("$$")){t[n]=r;continue}if(typeof r=="function"&&!q(n)){n==="class"||n==="className"?j(()=>{t.className=r()||""}):n==="style"&&typeof r()=="object"?j(()=>{dt(t,r())}):j(()=>{lt(t,n,r())});continue}}}Lt({hydrate:xe,insert:qt});export{Me as a,De as b,te as c,He as d,ne as e,Pe as f,je as g,Re as h,$e as i,Ke as j,Oe as k,Ie as l,Ve as m,Ot as n,ze as o,ke as p,Ge as q,Ue as r,qe as s,We as t,Fe as u,re as v,tn as w,ce as x,en as y,fe as z,qt as A,nn as B,rn as C,on as D,lt as E,ge as F,dt as G,ye as H,me as I,be as J,cn as K,fn as L,sn as M,ln as N,xe as O};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as T}from"./chunk-6YOUZ6T4.min.js";var l=typeof globalThis<"u"&&typeof globalThis.__WHAT_DEV__=="boolean"?globalThis.__WHAT_DEV__:import.meta&&import.meta.env?!!import.meta.env.DEV:(typeof process<"u"&&process.env,!1),d=null;function Qe(e){l&&(d=e)}var C=null,b=null,E=null,W=!1,B=0,x=[],V=!1,F=Symbol("needs_upstream"),H=null;function A(e,t){let n=e,r=new Set,o=null,s=0;function c(f){l&&W&&console.warn("[what] Signal.set() called inside a computed function. This may cause infinite loops. Use effect() instead."+(t?` (signal: ${t})`:""));let a=typeof f=="function"?f(n):f;(n===a?n!==0||1/n===1/a:n!==n&&a!==a)||(n=a,o=null,l&&d&&d.onSignalUpdate?.(i),r.size>0&&ie(r))}function i(f){if(arguments.length===0){let a=C;return a!==null&&(a!==o||a._epoch!==s)&&(o=a,s=a._epoch,r.add(a),a.deps.push(r)),n}c(f)}return i.set=c,i.peek=()=>n,i.subscribe=f=>L(()=>f(i())),i._signal=!0,l&&(i._subs=r,r._signalOwner=i,t&&(i._debugName=t)),l&&d&&d.onSignalCreate?.(i),i}function Ze(e){let t,n=!0,r=new Set,o=null,s=0,c=Q(()=>{let f=W;l&&(W=!0);try{t=e(),n=!1}finally{l&&(W=f)}},!0);c._level=1,c._computed=!0,c._computedSubs=r,r._owner=c,c._markDirty=()=>{n=!0},c._isDirty=()=>n,b&&b.disposals.push(()=>I(c));function i(){if(c.disposed)return t;let f=C;return f!==null&&(f!==o||f._epoch!==s)&&(o=f,s=f._epoch,r.add(f),f.deps.push(r)),n&&re(c),t}return c._onNotify=()=>{n=!0,o=null,r.size>0&&ie(r)},i._signal=!0,i.peek=()=>(n&&!c.disposed&&re(c),t),i}function re(e){if(H!==null)throw H.push(e),F;let t=[e];H=t;try{for(;t.length>0;){let n=t[t.length-1];if(n.disposed||!n._isDirty||!n._isDirty()){t.pop();continue}let r=!1,o=n.deps;for(let s=0;s<o.length;s++){let c=o[s]._owner;c&&!c.disposed&&c._computed&&c._isDirty&&c._isDirty()&&(t.push(c),r=!0)}if(!r)try{let s=n.deps.length;Z(n),n.deps.length!==s&&$(n),t.pop()}catch(s){if(s===F)n._markDirty();else throw s}}}finally{H=null}}function $(e){let t=0,n=e.deps;for(let r=0;r<n.length;r++){let o=n[r]._owner;if(o){let s=o._level;s>t&&(t=s)}}e._level=t+1}var ve=()=>{};function L(e,t){let n=Q(e);n._level=1;let r=C;C=n;try{let s=n.fn();typeof s=="function"&&(n._cleanup=s)}catch(s){throw I(n),s}finally{C=r}if($(n),t?.stable&&(n._stable=!0),n.deps.length===0&&n._cleanup===null)return n.disposed=!0,l&&d&&d.onEffectDispose?.(n),ve;let o=()=>I(n);return b&&b.disposals.push(o),o}function Ye(e){B++;try{e()}finally{B--,B===0&&Y()}}function Q(e,t){let n={fn:e,deps:[],lazy:t||!1,_onNotify:null,disposed:!1,_pending:!1,_stable:!1,_level:0,_computed:!1,_computedSubs:null,_isDirty:null,_markDirty:null,_cleanup:null,_epoch:0};return l&&d&&d.onEffectCreate?.(n),n}function Z(e){if(e.disposed)return;if(e._stable){if(e._cleanup){try{e._cleanup()}catch(r){l&&console.warn("[what] Error in effect cleanup:",r)}e._cleanup=null}let n=C;C=null;try{let r=e.fn();typeof r=="function"&&(e._cleanup=r)}catch(r){d?.onError&&d.onError?.(r,{type:"effect",effect:e}),l&&console.warn("[what] Error in stable effect:",r)}finally{C=n}l&&d?.onEffectRun&&d.onEffectRun?.(e);return}if(se(e),e._cleanup){try{e._cleanup()}catch(n){l&&d?.onError&&d.onError?.(n,{type:"effect-cleanup",effect:e}),l&&console.warn("[what] Error in effect cleanup:",n)}e._cleanup=null}let t=C;C=e;try{let n=e.fn();typeof n=="function"&&(e._cleanup=n)}catch(n){throw n===F||l&&d?.onError&&d.onError?.(n,{type:"effect",effect:e}),n}finally{C=t}l&&d?.onEffectRun&&d.onEffectRun?.(e)}function I(e){if(e.disposed=!0,l&&d&&d.onEffectDispose?.(e),se(e),e._cleanup){try{e._cleanup()}catch(t){l&&console.warn("[what] Error in effect cleanup on dispose:",t)}e._cleanup=null}}function se(e){let t=e.deps;for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0,e._epoch++}var K=0,M=null,R=0;function oe(e){if(!e.disposed){if(e._onNotify)e._onNotify();else if(!e._pending)if(B===0&&e._stable){let t=C;C=null;try{let n=e.fn();if(typeof n=="function"){if(e._cleanup)try{e._cleanup()}catch{}e._cleanup=n}}catch(n){l&&d?.onError&&d.onError?.(n,{type:"effect",effect:e}),l&&console.warn("[what] Error in stable effect:",n)}finally{C=t}}else{e._pending=!0;let t=e._level,n=x.length;n>0&&x[n-1]._level>t&&(V=!0),x.push(e)}}}function ie(e){if(K===0){K=1;try{for(let t of e)oe(t);if(R>0&&M){let t=0,n=M;for(;t<R;){let r=n[t];n[t]=null,t++;for(let o of r)oe(o)}R=0}}finally{K=0}B===0&&x.length>0&&ke()}else M===null&&(M=[]),R>=M.length?M.push(e):M[R]=e,R++}var z=!1;function ke(){z||(z=!0,queueMicrotask(()=>{z=!1,Y()}))}var U=!1;function Y(){if(!U){U=!0;try{let e=0;for(;x.length>0&&e<25;){let t=x;x=[],t.length>1&&V&&t.sort((n,r)=>n._level-r._level),V=!1;for(let n=0;n<t.length;n++){let r=t[n];if(r._pending=!1,!r.disposed&&!r._onNotify){let o=r.deps.length;try{Z(r)}catch(s){if(s===F)throw s;l&&d?.onError&&d.onError?.(s,{type:"effect",effect:r});try{console.error("[what] Uncaught error in effect during update:",s)}catch{}continue}!r._computed&&r.deps.length!==o&&$(r)}}e++}if(e>=25){if(l){let n=x.slice(0,3).map(r=>r.fn?.name||r.fn?.toString().slice(0,60)||"(anonymous)");console.warn(`[what] Possible infinite effect loop detected (25 iterations). Likely cause: an effect writes to a signal it also reads, creating a cycle. Use untrack() to read signals without subscribing. Looping effects: ${n.join(", ")}`)}else console.warn("[what] Possible infinite effect loop detected");for(let t=0;t<x.length;t++)x[t]._pending=!1;x.length=0}}finally{U=!1}}}function et(e){let t,n=new Set,r=Q(()=>{let s=e();if(!Object.is(t,s)){t=s;for(let c of n)if(!c.disposed){if(c._onNotify)c._onNotify();else if(!c._pending){c._pending=!0;let i=c._level,f=x.length;f>0&&x[f-1]._level>i&&(V=!0),x.push(c)}}}});r._level=1;try{Z(r)}catch(s){throw I(r),s}$(r),n._owner=r,b&&b.disposals.push(()=>I(r));function o(){return C&&(n.add(C),C.deps.push(n)),t}return o._signal=!0,o.peek=()=>t,o}function tt(){if(U){l&&console.warn("[what] flushSync() called during an active flush (e.g., inside a component render or effect). This is a no-op to prevent infinite loops. Move flushSync() to an event handler or onMount callback.");return}if(C){l&&console.warn("[what] flushSync() called during effect execution. This is a no-op to prevent infinite loops. Move flushSync() to an event handler or onMount callback.");return}z=!1,Y()}function ee(e){let t=C;C=null;try{return e()}finally{C=t}}function nt(){return E}function rt(e,t){let n=E,r=b;E=e,b=e;try{return t()}finally{E=n,b=r}}function ot(e){let t=b,n=E,r={disposals:[],owner:E,children:[],_disposed:!1};E&&E.children.push(r),b=r,E=r;try{return e(()=>te(r))}finally{b=t,E=n}}function te(e){if(e._disposed)return;e._disposed=!0;let t=!1,n;for(;e.children.length>0;){let r=e.children.pop();try{te(r)}catch(o){t||(t=!0,n=o)}}e.children.length=0;for(let r=e.disposals.length-1;r>=0;r--)try{e.disposals[r]()}catch(o){t||(t=!0,n=o)}if(e.disposals.length=0,e.owner){let r=e.owner.children.indexOf(e);r>=0&&e.owner.children.splice(r,1)}if(t)throw n}function st(e){let t=b,n=E,r={disposals:[],owner:null,children:[],_disposed:!1};b=r,E=r;try{return e(()=>te(r))}finally{b=t,E=n}}function it(e){b&&b.disposals.push(e)}if(l&&typeof WeakRef<"u"){let t={signals:new Set,effects:new Set,components:[]};d={__isPreinstallBuffer:!0,onSignalCreate(n){t.signals.size<2e3&&t.signals.add(new WeakRef(n))},onSignalUpdate(){},onEffectCreate(n){t.effects.size<2e3&&t.effects.add(new WeakRef(n))},onEffectDispose(){},onEffectRun(){},onError(){},onComponentMount(n){t.components.length<2e3&&t.components.push(n)},onComponentUnmount(){},__buffer:t}}function ct(){if(!l)return{signals:[],effects:[],components:[]};let e={signals:[],effects:[],components:[]},t=typeof X<"u"?X:null;if(!t)return e;for(let n of t.signals){let r=n.deref?.();r&&e.signals.push(r)}for(let n of t.effects){let r=n.deref?.();r&&e.effects.push(r)}for(let n of t.components)e.components.push(n);return e}var X=null;l&&d?.__isPreinstallBuffer&&(X=d.__buffer);var O=null,j=null;function at(e){j||(j=e)}function Ae(){return j?.getStore()??O}function ce(){return typeof document>"u"||Ae()!=null}function lt(e){let t=O;return O=e,t}function ut(e,t){if(j)return j.run(e,t);let n=O;O=e;try{return t()}finally{O=n}}function yt(e,t){let n=function(o){return e(o)};return n.displayName=`Memo(${e.name||"Anonymous"})`,n}var fe=null;function ae(e){fe=e}function gt(e){let t=null,n=null,r=null,o=new Set;function s(c){if(r)throw r;if(t)return T(t,c);throw n||(n=e().then(i=>{t=i.default||i,o.forEach(f=>f()),o.clear()}).catch(i=>{r=i})),n}return s.displayName="Lazy",s._lazy=!0,s._onLoad=c=>{t?c():o.add(c)},s}function Ne({fallback:e,children:t}){let n=A(!1),r=new Set,o=!1;return{tag:"__suspense",props:{boundary:{_suspense:!0,onSuspend(c){o||(n.set(!0),r.add(c),c.then(()=>{r.delete(c),r.size===0&&n.set(!1)},i=>{o=!0,r.delete(c),console.error("[what] Suspense: a suspended child rejected:",i)}))}},fallback:e,loading:n},children:Array.isArray(t)?t:[t],_vnode:!0}}Ne._deferChildren=!0;function Le({fallback:e,children:t,onError:n}){let r=A(null);return{tag:"__errorBoundary",props:{errorState:r,handleError:c=>{if(r.set(c),n)try{n(c)}catch(i){console.error("Error in onError handler:",i)}},fallback:e,reset:()=>r.set(null)},children:Array.isArray(t)?t:[t],_vnode:!0}}Le._deferChildren=!0;function le(e,t){let n=t||fe?.();for(;n;){if(n._errorBoundary)return n._errorBoundary(e),!0;n=n._parentCtx}return!1}function Ct({when:e,fallback:t=null,children:n}){return()=>(typeof e=="function"?e():e)?n:t}function wt({each:e,fallback:t=null,children:n}){let r=Array.isArray(n)?n[0]:n;return typeof r!="function"?(console.warn("[what] For: children must be a render function, e.g. <For each={items}>{(item) => ...}</For>"),t):()=>{let o=typeof e=="function"?e():e;return!o||o.length===0?t:o.map((s,c)=>{let i=r(s,c);return i&&typeof i=="object"&&i.key==null&&(s!=null&&typeof s=="object"?s.id!=null?i.key=s.id:s.key!=null&&(i.key=s.key):(typeof s=="string"||typeof s=="number")&&(i.key=s)),i})}}function bt({fallback:e=null,children:t}){let n=Array.isArray(t)?t:[t];return()=>{for(let r of n)if(r&&r.tag===De){let o=r.props.when;if(typeof o=="function"?o():o)return r.children}return e}}function De(e){return()=>(typeof e.when=="function"?e.when():e.when)?e.children:null}var q=null;function St(e){q=e}function Me(e){let t={};for(let n in e){let r=e[n];typeof r=="function"||typeof r=="symbol"||r===void 0||(t[n]=r)}try{return JSON.stringify(t)}catch{return"{}"}}function xt({component:e,mode:t,mediaQuery:n,name:r,children:o,...s}){let c=r||e?.name||"Island",i=t||"idle",f={"data-island":c,"data-island-mode":i,"data-hydrate":i,"data-island-self":"1"},a=o==null?[]:Array.isArray(o)?o:[o];if(ce())return T("div",{...f,"data-island-props":Me(s)},T(e,s,...a));let _=!1;function y(u){if(_)return;_=!0;let p=T(e,s,...a);u.childNodes.length>0&&q?.hydrate?q.hydrate(p,u):q?.insert&&q.insert(u,p,null),u.removeAttribute("data-hydrate"),u.removeAttribute("data-island-self"),u.setAttribute("data-island-hydrated","");let m=u.ownerDocument?.defaultView??globalThis;typeof m.CustomEvent=="function"&&u.dispatchEvent(new m.CustomEvent("island:hydrated",{bubbles:!0,detail:{name:c,mode:i}}))}function S(u){let p=()=>y(u);switch(i){case"load":queueMicrotask(p);break;case"idle":typeof requestIdleCallback<"u"?requestIdleCallback(p):setTimeout(p,200);break;case"visible":{if(typeof IntersectionObserver>"u"){queueMicrotask(p);break}let m=new IntersectionObserver(w=>{w.some(v=>v.isIntersecting)&&(m.disconnect(),p())},{rootMargin:"200px"});m.observe(u);break}case"interaction":case"action":{let m=["click","focus","mouseenter","touchstart"],w=()=>{for(let v of m)u.removeEventListener(v,w);p()};for(let v of m)u.addEventListener(v,w,{once:!0});break}case"media":{if(!n||typeof window>"u"||!window.matchMedia){p();break}let m=window.matchMedia(n);if(m.matches){queueMicrotask(p);break}let w=()=>{m.matches&&(m.removeEventListener("change",w),p())};m.addEventListener("change",w);break}case"static":break;default:queueMicrotask(p)}}return T("div",{...f,ref:u=>{u&&S(u)}})}var ue=!1;function kt(e,t,n){return ue||(ue=!0,console.warn("[what] each() is deprecated. Use the <For> component or Array.map() instead.")),!e||e.length===0?[]:e.map((r,o)=>{let s=t(r,o);return n&&s&&typeof s=="object"&&(s.key=n(r,o)),s})}function At(...e){let t=[];for(let n of e)if(n){if(typeof n=="string")t.push(n);else if(typeof n=="object")for(let[r,o]of Object.entries(n))o&&t.push(r)}return t.join(" ")}function Nt(e){return typeof e=="string"?e:Object.entries(e).filter(([,t])=>t!=null&&t!=="").map(([t,n])=>`${Te(t)}:${n}`).join(";")}function Te(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Lt(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}function Dt(e,t){let n=0;return(...r)=>{let o=Date.now();o-n>=t&&(n=o,e(...r))}}var G=null;function pe(e){G=e}function Mt(e){if(typeof window>"u")return A(!1);let t=window.matchMedia(e),n=A(t.matches),r=s=>n.set(s.matches);t.addEventListener("change",r);let o=G?.();return o&&(o._cleanupCallbacks=o._cleanupCallbacks||[],o._cleanupCallbacks.push(()=>t.removeEventListener("change",r))),n}function Tt(e,t){let n;try{let i=localStorage.getItem(e);n=i!==null?JSON.parse(i):t}catch{n=t}let r=A(n),o=L(()=>{try{localStorage.setItem(e,JSON.stringify(r()))}catch(i){l&&console.warn("[what] localStorage write failed (quota exceeded?):",i)}}),s=null;typeof window<"u"&&(s=i=>{if(i.key===e&&i.newValue!==null)try{r.set(JSON.parse(i.newValue))}catch(f){l&&console.warn("[what] localStorage parse failed:",f)}},window.addEventListener("storage",s));let c=G?.();return c&&(c._cleanupCallbacks=c._cleanupCallbacks||[],c._cleanupCallbacks.push(()=>{o(),s&&window.removeEventListener("storage",s)})),r}function Rt({target:e,children:t}){if(typeof document>"u")return null;let n=typeof e=="string"?document.querySelector(e):e;return n?{tag:"__portal",props:{container:n},children:Array.isArray(t)?t:[t],_vnode:!0}:null}function Ot(e,t){if(typeof document>"u")return;let n=o=>{let s=e.current||e;!s||s.contains(o.target)||t(o)};document.addEventListener("mousedown",n),document.addEventListener("touchstart",n);let r=G?.();r&&(r._cleanupCallbacks=r._cleanupCallbacks||[],r._cleanupCallbacks.push(()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}))}function Pt(e,t){return{class:t?`${e}-enter ${e}-enter-active`:`${e}-leave ${e}-leave-active`}}var Re=new Set(["svg","path","circle","rect","line","polyline","polygon","ellipse","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","foreignObject","linearGradient","radialGradient","stop","marker","animate","animateTransform","animateMotion","set","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence"]),Oe="http://www.w3.org/2000/svg",de=new Set(["href","src","action","formaction","formAction","data","ping","xlink:href","xlinkHref"]),he=new Set(["srcdoc","srcDoc"]);function Pe(e){if(e==null)return!0;let t;try{t=String(e).trim().replace(/[\s\x00-\x1f]/g,"").toLowerCase()}catch{return!1}return!(t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:"))}function _e(e){if(e.length<=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return(t===111||t===79)&&(n===110||n===78)}function Be(e,t){let n=e.toLowerCase();return he.has(e)||he.has(n)?!0:!de.has(e)&&!de.has(n)?!1:!Pe(t)}function Ie(e){return e==="role"||e.startsWith("aria-")}var ye=new Set,J=new WeakMap;function je(e){return!e||typeof e!="object"?!1:typeof Node<"u"&&e instanceof Node?!0:typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function me(e){return!!e&&typeof e=="object"&&(e._vnode===!0||"tag"in e)}function ne(e){if(!e.disposed){if(e.disposed=!0,e.cleanups)for(let t of e.cleanups)try{t()}catch(n){console.error("[what] cleanup error:",n)}if(e.effects)for(let t of e.effects)try{t()}catch{}if(e.hooks){for(let t of e.hooks)if(t&&typeof t.cleanup=="function")try{t.cleanup()}catch(n){console.error("[what] hook cleanup error:",n)}}if(e._cleanupCallbacks)for(let t of e._cleanupCallbacks)try{t()}catch(n){console.error("[what] onCleanup error:",n)}l&&d?.onComponentUnmount&&d.onComponentUnmount?.(e),ye.delete(e)}}function qe(e,t){!e||typeof t!="function"||(e._hydrationDisposers?e._hydrationDisposers.push(t):e._hydrationDisposers=[t])}function Ht(e,t){qe(e,()=>ne(t))}function D(e){if(!e)return;if(e._componentCtx&&ne(e._componentCtx),e._hydrationDisposers){let n=e._hydrationDisposers;e._hydrationDisposers=null;for(let r=0;r<n.length;r++)try{n[r]()}catch{}}if(e.nodeType===8){let n=J.get(e);n&&ne(n)}if(e._dispose)try{e._dispose()}catch{}if(e._propEffects)for(let n in e._propEffects)try{e._propEffects[n]()}catch{}let t=e.childNodes;if(t&&t.length>0)for(let n=0;n<t.length;n++)D(t[n])}function He(e){let t=null;for(let n of e){let r=n._rangeEnd;if(!r||r.parentNode!==n.parentNode)continue;t||(t=e.slice());let o=t;for(let s=n.nextSibling;s&&(o.push(s),s!==r);s=s.nextSibling);}return t||e}function Wt(e,t){typeof t=="string"&&(t=document.querySelector(t)),D(t),t.textContent="";let n=N(e,t);return n&&t.appendChild(n),()=>{D(t),t.textContent=""}}function N(e,t,n){if(e==null||e===!1||e===!0)return document.createComment("");if(typeof e=="string"||typeof e=="number")return document.createTextNode(String(e));if(je(e))return e;if(typeof e=="function"&&e._mapArray){let r=document.createDocumentFragment(),o=document.createComment("list");return r.appendChild(o),o._rangeEnd=e(r,null),r}if(typeof e=="function"&&e._lazyChildren)return N(e(),t,n);if(typeof e=="function"){let r=document.createComment("fn"),o=document.createComment("/fn"),s=[],c=document.createDocumentFragment();c.appendChild(r),c.appendChild(o);let i=h[h.length-1]||null,f=L(()=>{let a=i!==null&&h[h.length-1]!==i;a&&h.push(i);try{let _=e(),y=_==null||_===!1||_===!0?[]:Array.isArray(_)?_:[_],S=o.parentNode;if(!S)return;for(let u of He(s))D(u),u.parentNode===S&&S.removeChild(u);s=[];for(let u of y){let p=N(u,S,t?._isSvg);if(p)if(p.nodeType===11){let m=Array.from(p.childNodes);S.insertBefore(p,o);for(let w of m)s.push(w)}else S.insertBefore(p,o),s.push(p)}}finally{a&&h.pop()}});return r._dispose=f,o._dispose=f,r._rangeEnd=o,c}if(Array.isArray(e)){let r=document.createDocumentFragment();for(let o of e){let s=N(o,t,n);s&&r.appendChild(s)}return r}return me(e)&&typeof e.tag=="function"?Fe(e,t,n):me(e)&&typeof e.tag=="string"?e.tag==="__errorBoundary"?Ce(e,t):e.tag==="__suspense"?we(e,t):e.tag==="__portal"?be(e,t):Ge(e,t,n):document.createTextNode(String(e))}var We={get(e,t){if(t!=="_sig"&&!(t==="__proto__"||t==="constructor"||t==="prototype"))return e._sig()[t]},has(e,t){return t==="_sig"?!1:t in e._sig()},ownKeys(e){return Reflect.ownKeys(e._sig())},getOwnPropertyDescriptor(e,t){if(t==="_sig")return;let n=e._sig();if(t in n)return{value:n[t],writable:!1,enumerable:!0,configurable:!0}},set(e,t){return!1}},h=[];function ge(){return h[h.length-1]}ae(ge);pe(ge);function zt(){return h}function Ut(e){let t={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:e,_parentCtx:h[h.length-1]||null,_errorBoundary:null};return h.push(t),t}function Vt(e){h[h.length-1]===e&&h.pop(),e.disposed=!0}function ze(e,t,n){if(e._deferChildren)return t.children=n,null;let r,o=!1,s=!0;return Object.defineProperty(t,"children",{get(){return s?(o||(o=!0,r=n()),r):n()},enumerable:!0,configurable:!0}),()=>{s=!1,o=!1,r=void 0}}var Ue=Symbol.for("what.navigation.signal");function Ve(e){if(e==null)return!1;let t=e[Ue];return typeof t!="function"?!1:(t(e),!0)}function Fe(e,t,n){let{tag:r,props:o,children:s}=e;if(typeof r=="function"&&(r.prototype?.isReactComponent||r.prototype?.render)){let g=r;r=function(Ee){return new g(Ee).render()},r.displayName=g.displayName||g.name||"ClassComponent"}if(r==="__errorBoundary"||e.tag==="__errorBoundary")return Ce(e,t);if(r==="__suspense"||e.tag==="__suspense")return we(e,t);if(r==="__portal"||e.tag==="__portal")return be(e,t);let c=h[h.length-1]||null,i=null;if(c&&(i=c._errorBoundary||null,!i)){let g=c._parentCtx;for(;g;){if(g._errorBoundary){i=g._errorBoundary;break}g=g._parentCtx}}let f={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:r,_parentCtx:c,_errorBoundary:i},a=document.createComment("c:start"),_=document.createComment("c:end");J.set(a,f),f._startComment=a,f._endComment=_;let y=document.createDocumentFragment();y._componentCtx=f,f._wrapper=a,ye.add(f),l&&d?.onComponentMount&&d.onComponentMount?.(f);let S=s.length===0?void 0:s.length===1?s[0]:s,u;S!==void 0?u=o?Object.assign({},o,{children:S}):{children:S}:u=o?Object.assign({},o):{};let p=o&&o._$lazyChildren,m=p?ze(r,u,p):null,w=A(u);f._propsSignal=w;let v=new Proxy({_sig:w},We);h.push(f);let k;try{k=ee(()=>r(v))}catch(g){if(h.pop(),!Ve(g)&&!(g&&typeof g.then=="function"&&$e(g,f))&&!le(g,f))throw console.error("[what] Uncaught error in component:",r.name||"Anonymous",g),g;return y.appendChild(a),y.appendChild(_),y}m&&m(),f.mounted=!0,f._mountCallbacks&&queueMicrotask(()=>{if(!f.disposed)for(let g of f._mountCallbacks)try{g()}catch(P){console.error("[what] onMount error:",P)}}),y.appendChild(a);let xe=Array.isArray(k)?k:[k];try{for(let g of xe){let P=N(g,y,n);P&&y.appendChild(P)}}finally{h.pop()}return y.appendChild(_),y}function $e(e,t){let n=t;for(;n;){if(n._suspenseBoundary)return n._suspenseBoundary.onSuspend(e),!0;n=n._parentCtx}return!1}function Ce(e,t){let{errorState:n,handleError:r,fallback:o,reset:s}=e.props,c=e.children,i=document.createComment("eb:start"),f=document.createComment("eb:end"),a={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:h[h.length-1]||null,_errorBoundary:r,_startComment:i,_endComment:f};J.set(i,a);let _=document.createDocumentFragment();_._componentCtx=a,_.appendChild(i),_.appendChild(f);let y=L(()=>{let S=n();h.push(a);let u=i.parentNode;if(u)for(;i.nextSibling&&i.nextSibling!==f;){let m=i.nextSibling;D(m),u.removeChild(m)}let p;S?p=typeof o=="function"?[o({error:S,reset:s})]:[o]:p=c,p=Array.isArray(p)?p:[p];for(let m of p){let w=N(m,t);w&&(f.parentNode?f.parentNode.insertBefore(w,f):_.insertBefore(w,f))}h.pop()});return a.effects.push(y),_}function we(e,t){let{boundary:n,fallback:r,loading:o}=e.props,s=e.children,c=document.createComment("sb:start"),i=document.createComment("sb:end"),f={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:h[h.length-1]||null,_suspenseBoundary:n,_startComment:c,_endComment:i};J.set(c,f);let a=document.createDocumentFragment();a._componentCtx=f,a.appendChild(c),a.appendChild(i);let _=0,y=L(()=>{let u=o()?[r]:s,p=Array.isArray(u)?u:[u],m=++_;h.push(f);let w=c.parentNode;if(w)for(;c.nextSibling&&c.nextSibling!==i;){let v=c.nextSibling;D(v),w.removeChild(v)}try{for(let v of p){let k=N(v,t);if(m!==_){k&&D(k);break}k&&(i.parentNode?i.parentNode.insertBefore(k,i):a.insertBefore(k,i))}}finally{h.pop()}});return f.effects.push(y),a}function be(e,t){let{container:n}=e.props,r=e.children;if(!n)return console.warn("[what] Portal: target container not found"),document.createComment("portal:empty");let o={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:h[h.length-1]||null},s=document.createComment("portal");s._componentCtx=o;let c=[];for(let i of r){let f=N(i,n);f&&(n.appendChild(f),c.push(f))}return o._cleanupCallbacks=[()=>{for(let i of c)D(i),i.parentNode&&i.parentNode.removeChild(i)}],s}function Ge(e,t,n){let{tag:r,props:o,children:s}=e,c=n||Re.has(r),i=c?document.createElementNS(Oe,r):document.createElement(r);o&&Je(i,o,{},c);let f=c&&r!=="foreignObject";for(let a=0;a<s.length;a++){let _=N(s[a],i,f);_&&i.appendChild(_)}return i._vnode=e,i}function Je(e,t,n,r){if(t){for(let o in t)if(!(o==="key"||o==="children")){if(o==="ref"){let s=t.ref;typeof s=="function"?s(e):s&&(s.current=e);continue}Se(e,o,t[o],r)}}}function Ke(e,t){e.value=t,e.value!==String(t)&&queueMicrotask(()=>{e.value=t})}function Se(e,t,n,r){if(typeof n=="function"&&!_e(t)&&t!=="ref"){if(e._propEffects||(e._propEffects={}),e._propEffects[t])try{e._propEffects[t]()}catch{}e._propEffects[t]=L(()=>{let o=n();Se(e,t,o,r)});return}if(_e(t)){if(typeof n!="function"&&n!=null)return;let o=t.slice(2),s=!1;o.endsWith("Capture")&&(o=o.slice(0,-7),s=!0);let c=o.toLowerCase(),i=s?c+"_capture":c,f=e._events?.[i];if(f&&f._original===n||(f&&e.removeEventListener(c,f,s),n==null))return;e._events||(e._events={});let a=y=>(y.nativeEvent||(y.nativeEvent=y),ee(()=>a._handler(y)));a._handler=n,a._original=n,e._events[i]=a;let _=n._eventOpts;e.addEventListener(c,a,_||s||void 0);return}if(Be(t,n)){typeof console<"u"&&console.warn(`[what] Blocked unsafe URL in "${t}" attribute:`,n);return}if(t==="className"||t==="class"){r?e.setAttribute("class",n||""):e.className=n||"";return}if(t==="style"){if(typeof n=="string")e.style.cssText=n,e._prevStyle=null;else if(typeof n=="object"){let o=e._prevStyle||{};for(let s in o)s in n||(e.style[s]="");for(let s in n)e.style[s]=n[s]??"";e._prevStyle={...n}}return}if(t==="dangerouslySetInnerHTML"){let o=n?.__html??"";l&&typeof o=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(o)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),e.innerHTML=o;return}if(t==="innerHTML"){if(n==null)return;if(n&&typeof n=="object"&&"__html"in n){let o=n.__html??"";l&&typeof o=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(o)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),e.innerHTML=o}else{l&&console.warn("[what] innerHTML received a raw string. This is a security risk (XSS). Use innerHTML={{ __html: trustedString }} or dangerouslySetInnerHTML={{ __html: trustedString }} instead.");return}return}if(n==null){if(t in e)try{e[t]=""}catch{}e.removeAttribute(t);return}if(Ie(t)||t.startsWith("data-")){e.setAttribute(t,typeof n=="boolean"?String(n):n);return}if(typeof n=="boolean"){n?e.setAttribute(t,""):e.removeAttribute(t);return}if(r){n===!1||n==null?e.removeAttribute(t):e.setAttribute(t,n===!0?"":String(n));return}if(t==="value"&&e.tagName==="SELECT"){Ke(e,n);return}t in e?e[t]=n:e.setAttribute(t,n)}export{l as a,d as b,Qe as c,A as d,Ze as e,L as f,Ye as g,et as h,tt as i,ee as j,nt as k,rt as l,ot as m,st as n,it as o,ct as p,at as q,Ae as r,ce as s,lt as t,ut as u,yt as v,gt as w,Ne as x,Le as y,le as z,Ct as A,wt as B,bt as C,De as D,St as E,xt as F,kt as G,At as H,Nt as I,Lt as J,Dt as K,Mt as L,Tt as M,Rt as N,Ot as O,Pt as P,_e as Q,Be as R,Ie as S,qe as T,Ht as U,D as V,He as W,Wt as X,N as Y,ge as Z,zt as _,Ut as $,Vt as aa,ze as ba,Ve as ca,Ke as da};
|