what-core 0.13.4 → 0.13.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- import{a as T}from"./chunk-O3SKPRTY.min.js";var a=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 Xe(e){a&&(d=e)}var C=null,S=null,E=null,W=!1,B=0,x=[],U=!1,V=Symbol("needs_upstream"),H=null;function A(e,t){let n=e,r=new Set,o=null,s=0;function c(f){a&&W&&console.warn("[what] Signal.set() called inside a computed function. This may cause infinite loops. Use effect() instead."+(t?` (signal: ${t})`:""));let l=typeof f=="function"?f(n):f;(n===l?n!==0||1/n===1/l:n!==n&&l!==l)||(n=l,o=null,a&&d&&d.onSignalUpdate?.(i),r.size>0&&ie(r))}function i(f){if(arguments.length===0){let l=C;return l!==null&&(l!==o||l._epoch!==s)&&(o=l,s=l._epoch,r.add(l),l.deps.push(r)),n}c(f)}return i.set=c,i.peek=()=>n,i.subscribe=f=>N(()=>f(i())),i._signal=!0,a&&(i._subs=r,r._signalOwner=i,t&&(i._debugName=t)),a&&d&&d.onSignalCreate?.(i),i}function Qe(e){let t,n=!0,r=new Set,o=null,s=0,c=X(()=>{let f=W;a&&(W=!0);try{t=e(),n=!1}finally{a&&(W=f)}},!0);c._level=1,c._computed=!0,c._computedSubs=r,r._owner=c,c._markDirty=()=>{n=!0},c._isDirty=()=>n;function i(){let f=C;return f!==null&&(f!==o||f._epoch!==s)&&(o=f,s=f._epoch,r.add(f),f.deps.push(r)),n&&ne(c),t}return c._onNotify=()=>{n=!0,o=null,r.size>0&&ie(r)},i._signal=!0,i.peek=()=>(n&&ne(c),t),i}function ne(e){if(H!==null)throw H.push(e),V;let t=[e];H=t;try{for(;t.length>0;){let n=t[t.length-1];if(!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._computed&&c._isDirty&&c._isDirty()&&(t.push(c),r=!0)}if(!r)try{let s=n.deps.length;Q(n),n.deps.length!==s&&F(n),t.pop()}catch(s){if(s===V)n._markDirty();else throw s}}}finally{H=null}}function F(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 N(e,t){let n=X(e);n._level=1;let r=C;C=n;try{let s=n.fn();typeof s=="function"&&(n._cleanup=s)}finally{C=r}if(F(n),t?.stable&&(n._stable=!0),n.deps.length===0&&n._cleanup===null)return n.disposed=!0,a&&d&&d.onEffectDispose?.(n),ve;let o=()=>oe(n);return S&&S.disposals.push(o),o}function Ze(e){B++;try{e()}finally{B--,B===0&&Z()}}function X(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 a&&d&&d.onEffectCreate?.(n),n}function Q(e){if(e.disposed)return;if(e._stable){if(e._cleanup){try{e._cleanup()}catch(o){a&&console.warn("[what] Error in effect cleanup:",o)}e._cleanup=null}let r=C;C=null;try{let o=e.fn();typeof o=="function"&&(e._cleanup=o)}catch(o){d?.onError&&d.onError?.(o,{type:"effect",effect:e}),a&&console.warn("[what] Error in stable effect:",o)}finally{C=r}a&&d?.onEffectRun&&d.onEffectRun?.(e);return}let t=e.deps.length===1?e.deps[0]:null;if(se(e),e._cleanup){try{e._cleanup()}catch(r){a&&d?.onError&&d.onError?.(r,{type:"effect-cleanup",effect:e}),a&&console.warn("[what] Error in effect cleanup:",r)}e._cleanup=null}let n=C;C=e;try{let r=e.fn();typeof r=="function"&&(e._cleanup=r)}catch(r){throw r===V||a&&d?.onError&&d.onError?.(r,{type:"effect",effect:e}),r}finally{C=n}t!==null&&e.deps.length===1&&e.deps[0]===t&&!e._cleanup&&!e._pending&&(e._stable=!0),a&&d?.onEffectRun&&d.onEffectRun?.(e)}function oe(e){if(e.disposed=!0,a&&d&&d.onEffectDispose?.(e),se(e),e._cleanup){try{e._cleanup()}catch(t){a&&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 J=0,M=null,R=0;function re(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){a&&d?.onError&&d.onError?.(n,{type:"effect",effect:e}),a&&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&&(U=!0),x.push(e)}}}function ie(e){if(J===0){J=1;try{for(let t of e)re(t);if(R>0){let t=0;for(;t<R;){let n=M[t];M[t]=null,t++;for(let r of n)re(r)}R=0}}finally{J=0}B===0&&x.length>0&&ke()}else M===null&&(M=[]),R>=M.length?M.push(e):M[R]=e,R++}var q=!1;function ke(){q||(q=!0,queueMicrotask(()=>{q=!1,Z()}))}var z=!1;function Z(){if(!z){z=!0;try{let e=0;for(;x.length>0&&e<25;){let t=x;x=[],t.length>1&&U&&t.sort((n,r)=>n._level-r._level),U=!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{Q(r)}catch(s){if(s===V)throw s;a&&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&&F(r)}}e++}if(e>=25){if(a){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 Ye(e){let t,n=new Set,r=X(()=>{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&&(U=!0),x.push(c)}}}});r._level=1,Q(r),F(r),n._owner=r,S&&S.disposals.push(()=>oe(r));function o(){return C&&(n.add(C),C.deps.push(n)),t}return o._signal=!0,o.peek=()=>t,o}function et(){if(z){a&&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){a&&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}q=!1,Z()}function Y(e){let t=C;C=null;try{return e()}finally{C=t}}function tt(){return E}function nt(e,t){let n=E,r=S;E=e,S=e;try{return t()}finally{E=n,S=r}}function rt(e){let t=S,n=E,r={disposals:[],owner:E,children:[],_disposed:!1};E&&E.children.push(r),S=r,E=r;try{return e(()=>{if(!r._disposed){r._disposed=!0;for(let s=r.children.length-1;s>=0;s--)ee(r.children[s]);r.children.length=0;for(let s=r.disposals.length-1;s>=0;s--)r.disposals[s]();if(r.disposals.length=0,r.owner){let s=r.owner.children.indexOf(r);s>=0&&r.owner.children.splice(s,1)}}})}finally{S=t,E=n}}function ee(e){if(!e._disposed){e._disposed=!0;for(let t=e.children.length-1;t>=0;t--)ee(e.children[t]);e.children.length=0;for(let t=e.disposals.length-1;t>=0;t--)e.disposals[t]();e.disposals.length=0}}function ot(e){let t=S,n=E,r={disposals:[],owner:null,children:[],_disposed:!1};S=r,E=r;try{return e(()=>{if(!r._disposed){r._disposed=!0;for(let s=r.children.length-1;s>=0;s--)ee(r.children[s]);r.children.length=0;for(let s=r.disposals.length-1;s>=0;s--)r.disposals[s]();r.disposals.length=0}})}finally{S=t,E=n}}function st(e){S&&S.disposals.push(e)}if(a&&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 it(){if(!a)return{signals:[],effects:[],components:[]};let e={signals:[],effects:[],components:[]},t=typeof K<"u"?K: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 K=null;a&&d?.__isPreinstallBuffer&&(K=d.__buffer);var O=null,I=null;function ft(e){I||(I=e)}function Ae(){return I?.getStore()??O}function ce(){return typeof document>"u"||Ae()!=null}function lt(e){let t=O;return O=e,t}function at(e,t){if(I)return I.run(e,t);let n=O;O=e;try{return t()}finally{O=n}}function mt(e,t){let n=function(o){return e(o)};return n.displayName=`Memo(${e.name||"Anonymous"})`,n}var fe=null;function le(e){fe=e}function yt(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 Ne({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}}Ne._deferChildren=!0;function ae(e,t){let n=t||fe?.();for(;n;){if(n._errorBoundary)return n._errorBoundary(e),!0;n=n._parentCtx}return!1}function gt({when:e,fallback:t=null,children:n}){return()=>(typeof e=="function"?e():e)?n:t}function Ct({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 wt({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 j=null;function bt(e){j=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 St({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"},l=o==null?[]:Array.isArray(o)?o:[o];if(ce())return T("div",{...f,"data-island-props":Me(s)},T(e,s,...l));let _=!1;function y(u){if(_)return;_=!0;let p=T(e,s,...l);u.childNodes.length>0&&j?.hydrate?j.hydrate(p,u):j?.insert&&j.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 b(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&&b(u)}})}var ue=!1;function vt(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 kt(...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 At(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 Nt(e,t){let n=0;return(...r)=>{let o=Date.now();o-n>=t&&(n=o,e(...r))}}var $=null;function pe(e){$=e}function Dt(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=$?.();return o&&(o._cleanupCallbacks=o._cleanupCallbacks||[],o._cleanupCallbacks.push(()=>t.removeEventListener("change",r))),n}function Mt(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=N(()=>{try{localStorage.setItem(e,JSON.stringify(r()))}catch(i){a&&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){a&&console.warn("[what] localStorage parse failed:",f)}},window.addEventListener("storage",s));let c=$?.();return c&&(c._cleanupCallbacks=c._cleanupCallbacks||[],c._cleanupCallbacks.push(()=>{o(),s&&window.removeEventListener("storage",s)})),r}function Tt({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 Rt(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=$?.();r&&(r._cleanupCallbacks=r._cleanupCallbacks||[],r._cleanupCallbacks.push(()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}))}function Ot(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,G=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 te(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)}a&&d?.onComponentUnmount&&d.onComponentUnmount?.(e),ye.delete(e)}}function He(e,t){!e||typeof t!="function"||(e._hydrationDisposers?e._hydrationDisposers.push(t):e._hydrationDisposers=[t])}function Ht(e,t){He(e,()=>te(t))}function D(e){if(!e)return;if(e._componentCtx&&te(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=G.get(e);n&&te(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 Wt(e,t){typeof t=="string"&&(t=document.querySelector(t)),D(t),t.textContent="";let n=L(e,t);return n&&t.appendChild(n),()=>{D(t),t.textContent=""}}function L(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-frag");return r.appendChild(o),e(r,o),r}if(typeof e=="function"&&e._lazyChildren)return L(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=N(()=>{let l=i!==null&&h[h.length-1]!==i;l&&h.push(i);try{let _=e(),y=_==null||_===!1||_===!0?[]:Array.isArray(_)?_:[_],b=o.parentNode;if(!b)return;for(let u of s)D(u),u.parentNode===b&&b.removeChild(u);s=[];for(let u of y){let p=L(u,b,t?._isSvg);if(p)if(p.nodeType===11){let m=Array.from(p.childNodes);b.insertBefore(p,o);for(let w of m)s.push(w)}else b.insertBefore(p,o),s.push(p)}}finally{l&&h.pop()}});return r._dispose=f,o._dispose=f,c}if(Array.isArray(e)){let r=document.createDocumentFragment();for(let o of e){let s=L(o,t,n);s&&r.appendChild(s)}return r}return me(e)&&typeof e.tag=="function"?Ve(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):$e(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]}le(ge);pe(ge);function qt(){return h}function zt(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 Ut(e){h[h.length-1]===e&&h.pop(),e.disposed=!0}function qe(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 ze=Symbol.for("what.navigation.signal");function Ue(e){if(e==null)return!1;let t=e[ze];return typeof t!="function"?!1:(t(e),!0)}function Ve(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},l=document.createComment("c:start"),_=document.createComment("c:end");G.set(l,f),f._startComment=l,f._endComment=_;let y=document.createDocumentFragment();y._componentCtx=f,f._wrapper=l,ye.add(f),a&&d?.onComponentMount&&d.onComponentMount?.(f);let b=s.length===0?void 0:s.length===1?s[0]:s,u;b!==void 0?u=o?Object.assign({},o,{children:b}):{children:b}:u=o?Object.assign({},o):{};let p=o&&o._$lazyChildren,m=p?qe(r,u,p):null,w=A(u);f._propsSignal=w;let v=new Proxy({_sig:w},We);h.push(f);let k;try{k=Y(()=>r(v))}catch(g){if(h.pop(),!Ue(g)&&!(g&&typeof g.then=="function"&&Fe(g,f))&&!ae(g,f))throw console.error("[what] Uncaught error in component:",r.name||"Anonymous",g),g;return y.appendChild(l),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(l);let xe=Array.isArray(k)?k:[k];try{for(let g of xe){let P=L(g,y,n);P&&y.appendChild(P)}}finally{h.pop()}return y.appendChild(_),y}function Fe(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"),l={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:h[h.length-1]||null,_errorBoundary:r,_startComment:i,_endComment:f};G.set(i,l);let _=document.createDocumentFragment();_._componentCtx=l,_.appendChild(i),_.appendChild(f);let y=N(()=>{let b=n();h.push(l);let u=i.parentNode;if(u)for(;i.nextSibling&&i.nextSibling!==f;){let m=i.nextSibling;D(m),u.removeChild(m)}let p;b?p=typeof o=="function"?[o({error:b,reset:s})]:[o]:p=c,p=Array.isArray(p)?p:[p];for(let m of p){let w=L(m,t);w&&(f.parentNode?f.parentNode.insertBefore(w,f):_.insertBefore(w,f))}h.pop()});return l.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};G.set(c,f);let l=document.createDocumentFragment();l._componentCtx=f,l.appendChild(c),l.appendChild(i);let _=0,y=N(()=>{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=L(v,t);if(m!==_){k&&D(k);break}k&&(i.parentNode?i.parentNode.insertBefore(k,i):l.insertBefore(k,i))}}finally{h.pop()}});return f.effects.push(y),l}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=L(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 $e(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&&Ge(i,o,{},c);let f=c&&r!=="foreignObject";for(let l=0;l<s.length;l++){let _=L(s[l],i,f);_&&i.appendChild(_)}return i._vnode=e,i}function Ge(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 Je(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]=N(()=>{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 l=y=>(y.nativeEvent||(y.nativeEvent=y),Y(()=>l._handler(y)));l._handler=n,l._original=n,e._events[i]=l;let _=n._eventOpts;e.addEventListener(c,l,_||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??"";a&&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??"";a&&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{a&&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)){e.setAttribute(t,typeof n=="boolean"?String(n):n);return}if(typeof n=="boolean"){n?e.setAttribute(t,""):e.removeAttribute(t);return}if(t.startsWith("data-")){e.setAttribute(t,n);return}if(r){n===!1||n==null?e.removeAttribute(t):e.setAttribute(t,n===!0?"":String(n));return}if(t==="value"&&e.tagName==="SELECT"){Je(e,n);return}t in e?e[t]=n:e.setAttribute(t,n)}export{a,d as b,Xe as c,A as d,Qe as e,N as f,Ze as g,Ye as h,et as i,Y as j,tt as k,nt as l,rt as m,ot as n,st as o,it as p,ft as q,Ae as r,ce as s,lt as t,at as u,mt as v,yt as w,Le as x,Ne as y,ae as z,gt as A,Ct as B,wt as C,De as D,bt as E,St as F,vt as G,kt as H,At as I,Lt as J,Nt as K,Dt as L,Mt as M,Tt as N,Rt as O,Ot as P,_e as Q,Be as R,Ie as S,He as T,Ht as U,D as V,Wt as W,L as X,ge as Y,qt as Z,zt as _,Ut as $,qe as aa,Ue as ba,Je as ca};