@unsetsoft/ryunixjs 1.2.4 → 1.2.5-canary.1

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,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Ryunix={})}(this,function(e){"use strict";let t={containerRoot:null,nextUnitOfWork:null,currentRoot:null,wipRoot:null,deletions:[],wipFiber:null,hookIndex:0,effects:[]};const o=()=>t,r=/[A-Z]/g,n=Object.freeze({TEXT_ELEMENT:Symbol.for("ryunix.text.element"),RYUNIX_ELEMENT:Symbol.for("ryunix.element"),RYUNIX_EFFECT:Symbol.for("ryunix.effect"),RYUNIX_MEMO:Symbol.for("ryunix.memo"),RYUNIX_URL_QUERY:Symbol.for("ryunix.urlQuery"),RYUNIX_REF:Symbol.for("ryunix.ref"),RYUNIX_STORE:Symbol.for("ryunix.store"),RYUNIX_REDUCE:Symbol.for("ryunix.reduce"),RYUNIX_FRAGMENT:Symbol.for("ryunix.fragment"),RYUNIX_CONTEXT:Symbol.for("ryunix.context")}),s=Object.freeze({OBJECT:"object",FUNCTION:"function",STYLE:"ryunix-style",CLASS_NAME:"ryunix-class",CHILDREN:"children",BOOLEAN:"boolean",STRING:"string",UNDEFINED:"undefined"}),i=Object.freeze({STYLE:"style",CLASS_NAME:"className"}),c=Object.freeze({PLACEMENT:Symbol.for("ryunix.reconciler.status.placement"),UPDATE:Symbol.for("ryunix.reconciler.status.update"),DELETION:Symbol.for("ryunix.reconciler.status.deletion"),NO_EFFECT:Symbol.for("ryunix.reconciler.status.no_effect")}),a=e=>null!==e&&typeof e===s.OBJECT,l=e=>typeof e===s.FUNCTION,u=e=>typeof e===s.STRING,d=e=>null===e,p=(e,t,...o)=>({type:e,props:{...t||{},children:o.flat().map(e=>{return typeof e===s.OBJECT?e:(t=e,{type:n.TEXT_ELEMENT,props:{nodeValue:t,children:[]}});var t})}}),f=e=>{const t=Array.isArray(e.children)?e.children:[e.children];return p(n.RYUNIX_FRAGMENT,{},...t)},h=e=>e.startsWith("on"),m=e=>e!==s.CHILDREN&&!h(e),E=(e,t)=>o=>!Object.is(e[o],t[o]),y=e=>t=>!(t in e),N=e=>{e&&(e.hooks?.length>0&&e.hooks.filter(e=>e.type===n.RYUNIX_EFFECT&&l(e.cancel)).forEach(e=>{try{e.cancel(),e.cancel=null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in deep effect cleanup:",e)}}),e.child&&N(e.child),e.sibling&&N(e.sibling))},b=e=>{if(e?.hooks?.length)for(let t=0;t<e.hooks.length;t++){const o=e.hooks[t];if(o.type===n.RYUNIX_EFFECT&&l(o.effect)){if(l(o.cancel))try{o.cancel()}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in effect cleanup:",e)}try{const e=o.effect();l(e)?o.cancel=e:o.cancel=null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in effect:",e),o.cancel=null}o.effect=null}}},g=(e,t)=>{if(a(t)&&!d(t))try{const o=Object.entries(t).filter(([e,t])=>null!=t).map(([e,t])=>`${e.replace(r,e=>`-${e.toLowerCase()}`)}: ${t}`).join("; ");e.style.cssText=o}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error applying styles:",e)}else e.style.cssText=""},w=(e,t,o)=>{if(!o||""===o.trim()){if(t){const o=t.split(/\s+/).filter(Boolean);e.classList.remove(...o)}return}if(t){const o=t.split(/\s+/).filter(Boolean);e.classList.remove(...o)}const r=o.split(/\s+/).filter(Boolean);r.length>0&&e.classList.add(...r)},x=(e,t={},o={})=>{Object.keys(t).filter(h).filter(e=>y(o)(e)||E(t,o)(e)).forEach(o=>{const r=o.toLowerCase().substring(2);try{e.removeEventListener(r,t[o])}catch(e){"production"!==process.env.NODE_ENV&&console.warn("Error removing event listener:",e)}}),Object.keys(t).filter(m).filter(y(o)).forEach(t=>{[s.STYLE,i.STYLE,s.CLASS_NAME,i.CLASS_NAME].includes(t)||(e[t]="")}),Object.keys(o).filter(m).filter(E(t,o)).forEach(r=>{try{if(r===s.STYLE||r===i.STYLE){const t=o[r];g(e,t)}else r===s.CLASS_NAME?w(e,t[s.CLASS_NAME],o[s.CLASS_NAME]):r===i.CLASS_NAME?w(e,t[i.CLASS_NAME],o[i.CLASS_NAME]):"value"===r||"checked"===r?e[r]!==o[r]&&(e[r]=o[r]):e[r]=o[r]}catch(e){"production"!==process.env.NODE_ENV&&console.warn(`Error setting property ${r}:`,e)}}),Object.keys(o).filter(h).filter(E(t,o)).forEach(t=>{const r=t.toLowerCase().substring(2);try{e.addEventListener(r,o[t])}catch(e){"production"!==process.env.NODE_ENV&&console.warn("Error adding event listener:",e)}})},v=e=>{if(!e)return;let t=e.parent;for(;!t.dom;)t=t.parent;const o=t.dom;if(e.effectTag===c.PLACEMENT)null!=e.dom&&o.appendChild(e.dom),b(e);else if(e.effectTag===c.UPDATE)(e=>{e?.hooks?.length&&e.hooks.filter(e=>e.type===n.RYUNIX_EFFECT&&l(e.cancel)).forEach(e=>{try{e.cancel(),e.cancel=null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in effect cleanup:",e)}})})(e),null!=e.dom&&x(e.dom,e.alternate.props,e.props),b(e);else if(e.effectTag===c.DELETION)return N(e),void R(e,o);v(e.child),v(e.sibling)},R=(e,t)=>{if(e.dom)t.removeChild(e.dom);else{let o=e.child;for(;o;)R(o,t),o=o.sibling}},_=(e,t)=>{const r=o();let n,s=0;const i=new Map;let a=e.alternate?.child,l=0;for(;a;){const e=a.key??`__index_${l}__`;i.set(e,a),a=a.sibling,l++}for(;s<t.length;){const o=t[s];if(!o){s++;continue}const a=o.key??`__index_${s}__`,l=i.get(a);let u;l&&o.type===l.type?(u={type:l.type,props:o.props,dom:l.dom,parent:e,alternate:l,effectTag:c.UPDATE,hooks:l.hooks,key:o.key},i.delete(a)):(u={type:o.type,props:o.props,dom:null,parent:e,alternate:null,effectTag:c.PLACEMENT,key:o.key},l&&(l.effectTag=c.DELETION,r.deletions.push(l),i.delete(a))),0===s?e.child=u:u&&(n.sibling=u),n=u,s++}i.forEach(e=>{e.effectTag=c.DELETION,r.deletions.push(e)})},T={IMMEDIATE:1,USER_BLOCKING:2,NORMAL:3,LOW:4,IDLE:5},k=()=>{const e=o();if(!e.wipFiber)throw new Error("Hooks can only be called inside the body of a function component.");Array.isArray(e.wipFiber.hooks)||(e.wipFiber.hooks=[])},I=(e,t)=>!e||!t||(e.length!==t.length||e.some((e,o)=>!Object.is(e,t[o]))),S=e=>O((e,t)=>l(t)?t(e):t,e),O=(e,t,r)=>{k();const s=o(),{wipFiber:i,hookIndex:c}=s,a=i.alternate?.hooks?.[c],l={hookID:c,type:n.RYUNIX_STORE,state:a?a.state:r?r(t):t,queue:[]};a?.queue&&a.queue.forEach(t=>{try{l.state=e(l.state,t)}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in reducer:",e)}});return i.hooks[c]=l,s.hookIndex++,[l.state,e=>{if(void 0===e)return void("production"!==process.env.NODE_ENV&&console.warn("dispatch called with undefined action"));l.queue.push(e);const t=o();t.wipRoot={dom:t.currentRoot.dom,props:t.currentRoot.props,alternate:t.currentRoot},t.deletions=[],t.hookIndex=0,se(t.wipRoot)}]},C=(e,t)=>{if(k(),!l(e))throw new Error("useEffect callback must be a function");if(void 0!==t&&!Array.isArray(t))throw new Error("useEffect dependencies must be an array or undefined");const r=o(),{wipFiber:s,hookIndex:i}=r,c=s.alternate?.hooks?.[i],a=I(c?.deps,t),u={hookID:i,type:n.RYUNIX_EFFECT,deps:t,effect:a?e:null,cancel:c?.cancel};s.hooks[i]=u,r.hookIndex++},M=e=>{k();const t=o(),{wipFiber:r,hookIndex:s}=t,i=r.alternate?.hooks?.[s],c={hookID:s,type:n.RYUNIX_REF,value:i?i.value:{current:e}};return r.hooks[s]=c,t.hookIndex++,c.value},L=(e,t)=>{if(k(),!l(e))throw new Error("useMemo callback must be a function");if(!Array.isArray(t))throw new Error("useMemo requires a dependencies array");const r=o(),{wipFiber:s,hookIndex:i}=r,c=s.alternate?.hooks?.[i];let a;if(c&&!I(c.deps,t))a=c.value;else try{a=e()}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in useMemo computation:",e),a=void 0}const u={hookID:i,type:n.RYUNIX_MEMO,value:a,deps:t};return s.hooks[i]=u,r.hookIndex++,a},A=(e,t)=>{if(!l(e))throw new Error("useCallback requires a function as first argument");return L(()=>e,t)},D=(e=n.RYUNIX_CONTEXT,t={})=>{const r=({children:t,value:o})=>{const r=f({children:t});return r._contextId=e,r._contextValue=o,r};r._contextId=e;return{Provider:r,useContext:(r=e)=>{k();let n=o().wipFiber;for(;n;){if(n._contextId===r&&void 0!==n._contextValue)return n._contextValue;if(n.type?._contextId===r&&void 0!==n.props?.value)return n.props.value;n=n.parent}return t}}},U=()=>{if("undefined"==typeof window)return{};const e=new URLSearchParams(window.location.search),t={};for(const[o,r]of e.entries())t[o]=r;return t},F=()=>{if("undefined"==typeof window)return"";const[e,t]=S(window.location.hash);return C(()=>{const e=()=>t(window.location.hash);return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]),e},X=(e={},t={})=>{C(()=>{if("undefined"==typeof document)return;let o="Ryunix App";const r=t.title?.template,n=t.title?.prefix||"Ryunix App",s=e.pageTitle||e.title;if(o=u(s)&&s.trim()?r?.includes("%s")?r.replace("%s",s):s:n,document.title=o,e.canonical){let t=document.querySelector('link[rel="canonical"]');t||(t=document.createElement("link"),t.setAttribute("rel","canonical"),document.head.appendChild(t)),t.setAttribute("href",e.canonical)}Object.entries(e).forEach(([e,t])=>{if(["title","pageTitle","canonical"].includes(e))return;const o=e.startsWith("og:")||e.startsWith("twitter:"),r=`meta[${o?"property":"name"}='${e}']`;let n=document.head.querySelector(r);n||(n=document.createElement("meta"),n.setAttribute(o?"property":"name",e),document.head.appendChild(n)),n.setAttribute("content",t)})},[JSON.stringify(e),JSON.stringify(t)])},Y=D("ryunix.navigation",{location:"/",params:{},query:{},navigate:e=>{},route:null}),P=(e,t)=>{const o=t.split("?")[0].split("#")[0],r=e.find(e=>e.NotFound),n=r?{route:{component:r.NotFound},params:{}}:{route:{component:null},params:{}};for(const r of e){if(r.subRoutes){const e=P(r.subRoutes,t);if(e)return e}if("*"===r.path)return n;if(!r.path||"string"!=typeof r.path)continue;const e=[],s=new RegExp(`^${r.path.replace(/:\w+/g,t=>(e.push(t.substring(1)),"([^/]+)"))}$`),i=o.match(s);if(i){return{route:r,params:e.reduce((e,t,o)=>(e[t]=i[o+1],e),{})}}}return n},V=({routes:e,children:t})=>{const[o,r]=S(window.location.pathname);C(()=>{const e=()=>r(window.location.pathname);return window.addEventListener("popstate",e),window.addEventListener("hashchange",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)}},[o]);const n=P(e,o)||{},s=U(),i={location:o,params:n.params||{},query:s,navigate:e=>{window.history.pushState({},"",e),r(e)},route:n.route};return p(Y.Provider,{value:i},f({children:t}))},j=()=>Y.useContext("ryunix.navigation"),q=()=>{const{route:e,params:t,query:o,location:r}=j();if(!e||!e.component)return null;const n=F();return C(()=>{if(n){const e=n.slice(1),t=document.getElementById(e);t&&t.scrollIntoView({block:"start",behavior:"smooth"})}},[n]),p(e.component,{key:r,params:t,query:o,hash:n})},$=({to:e,exact:t=!1,...o})=>{const{location:r,navigate:n}=j(),s=t?r===e:r.startsWith(e),i=o["ryunix-class"]?"ryunix-class":"className",c="function"==typeof(a=o["ryunix-class"]||o.className)?a({isActive:s}):a||"";var a;const{"ryunix-class":l,className:u,...d}=o;return p("a",{href:e,onClick:t=>{t.preventDefault(),n(e)},[i]:c,...d},o.children)},W=e=>{const[t,o]=O((e,t)=>"function"==typeof t?t.value(e):t.value,e);return[t,(e,t=T.NORMAL)=>{o({value:e,priority:t})}]},B=()=>{const[e,t]=W(!1);return[e,e=>{t(!0,T.IMMEDIATE),setTimeout(()=>{e(),t(!1,T.IMMEDIATE)},0)}]},z=e=>{const[t,o]=W(e);return C(()=>{const t=setTimeout(()=>{o(e,T.LOW)},100);return()=>clearTimeout(t)},[e]),t};var H=Object.freeze({__proto__:null,Children:q,NavLink:$,RouterProvider:V,createContext:D,useCallback:A,useDeferredValue:z,useEffect:C,useHash:F,useMemo:L,useMetadata:X,useQuery:U,useReducer:O,useRef:M,useRouter:j,useStore:S,useStorePriority:W,useTransition:B});const G=e=>{e.dom||(e.dom=(e=>{if(e.type===n.RYUNIX_FRAGMENT)return null;let t;try{if(e.type===n.TEXT_ELEMENT)t=document.createTextNode("");else{if(!u(e.type))return"production"!==process.env.NODE_ENV&&console.warn("Attempted to create DOM for non-host component:",e.type),null;t=document.createElement(e.type)}return x(t,{},e.props),t}catch(t){return"production"!==process.env.NODE_ENV&&console.error("Error creating DOM element:",t,e),null}})(e));const t=e.props?.children||[];_(e,t)},{Provider:J,useContext:Q}=D("ryunix.mdx",{}),K=e=>({...Q(),...e}),Z={h1:e=>p("h1",{...e}),h2:e=>p("h2",{...e}),h3:e=>p("h3",{...e}),h4:e=>p("h4",{...e}),h5:e=>p("h5",{...e}),h6:e=>p("h6",{...e}),p:e=>p("p",{...e}),a:e=>p("a",{...e}),strong:e=>p("strong",{...e}),em:e=>p("em",{...e}),code:e=>p("code",{...e}),ul:e=>p("ul",{...e}),ol:e=>p("ol",{...e}),li:e=>p("li",{...e}),blockquote:e=>p("blockquote",{...e}),pre:e=>p("pre",{...e}),hr:e=>p("hr",{...e}),table:e=>p("table",{...e}),thead:e=>p("thead",{...e}),tbody:e=>p("tbody",{...e}),tr:e=>p("tr",{...e}),th:e=>p("th",{...e}),td:e=>p("td",{...e}),img:e=>p("img",{...e})};const ee=new class{constructor(){this.enabled="production"!==process.env.NODE_ENV,this.measures=new Map,this.renderTimes=[],this.maxSamples=100}startMeasure(e){this.enabled&&this.measures.set(e,performance.now())}endMeasure(e){if(!this.enabled)return;const t=this.measures.get(e);if(!t)return;const o=performance.now()-t;return this.measures.delete(e),o}recordRender(e,t){this.enabled&&(this.renderTimes.push({component:e,duration:t,timestamp:Date.now()}),this.renderTimes.length>this.maxSamples&&this.renderTimes.shift())}getStats(){if(!this.enabled)return null;const e=this.renderTimes.reduce((e,t)=>e+t.duration,0);return{total:e,avg:e/this.renderTimes.length,max:Math.max(...this.renderTimes.map(e=>e.duration)),min:Math.min(...this.renderTimes.map(e=>e.duration)),count:this.renderTimes.length}}getSlowestComponents(e=10){if(!this.enabled)return[];const t=new Map;return this.renderTimes.forEach(({component:e,duration:o})=>{t.has(e)||t.set(e,{total:0,count:0,max:0});const r=t.get(e);r.total+=o,r.count++,r.max=Math.max(r.max,o)}),Array.from(t.entries()).map(([e,t])=>({name:e,avg:t.total/t.count,max:t.max,count:t.count})).sort((e,t)=>t.avg-e.avg).slice(0,e)}logStats(){if(!this.enabled)return;const e=this.getStats();if(!e)return;console.group("šŸ” Ryunix Performance Stats"),console.log(`Total renders: ${e.count}`),console.log(`Avg render time: ${e.avg.toFixed(2)}ms`),console.log(`Min: ${e.min.toFixed(2)}ms | Max: ${e.max.toFixed(2)}ms`);const t=this.getSlowestComponents(5);t.length>0&&(console.log("\nāš ļø Slowest components:"),t.forEach((e,t)=>{console.log(`${t+1}. ${e.name}: ${e.avg.toFixed(2)}ms avg (${e.count} renders)`)})),console.groupEnd()}clear(){this.renderTimes=[],this.measures.clear()}enable(){this.enabled=!0}disable(){this.enabled=!1}},te=e=>{const t=performance.now();return()=>{const o=performance.now()-t;ee.recordRender(e,o)}},oe=(e,t)=>o=>{ee.startMeasure(t);const r=e(o),n=ee.endMeasure(t);return n&&ee.recordRender(t,n),r},re=e=>{const t=o();let r=!1;for(;t.nextUnitOfWork&&!r;)t.nextUnitOfWork=ne(t.nextUnitOfWork),r=e.timeRemaining()<1;!t.nextUnitOfWork&&t.wipRoot&&(()=>{const e=o();e.deletions.forEach(v),v(e.wipRoot.child),e.currentRoot=e.wipRoot,e.wipRoot=null})(),requestIdleCallback(re)};requestIdleCallback(re);const ne=e=>{const t=e.type?.name||e.type?.displayName||"Unknown";ee.startMeasure(t);e.type instanceof Function?(e=>{const t=o();t.wipFiber=e,t.hookIndex=0,t.wipFiber.hooks=[];const r=[e.type(e.props)];e.type._contextId&&void 0!==e.props.value&&(e._contextId=e.type._contextId,e._contextValue=e.props.value),_(e,r)})(e):G(e);const r=ee.endMeasure(t);if(r&&ee.recordRender(t,r),e.child)return e.child;let n=e;for(;n;){if(n.sibling)return n.sibling;n=n.parent}},se=(e,t=T.NORMAL)=>{const r=o();r.nextUnitOfWork=e,r.wipRoot=e,r.deletions=[],r.hookIndex=0,r.effects=[],t<=T.USER_BLOCKING?requestIdleCallback(re):setTimeout(()=>requestIdleCallback(re),0)},ie=(e,t)=>{const r=o();return r.wipRoot={dom:t,props:{children:[e]},alternate:r.currentRoot},r.nextUnitOfWork=r.wipRoot,r.deletions=[],se(r.wipRoot),r.wipRoot},ce=(e,t="__ryunix")=>{const r=o();r.containerRoot=document.getElementById(t);return ie(e,r.containerRoot)},ae=(e,t,o)=>{try{return e(t)}catch(e){return"production"!==process.env.NODE_ENV&&console.error("Component error:",e),o&&o(e),null}},le=(e,t)=>t=>L(()=>e(t),[...Object.values(t)]),ue=e=>{let t=null,o=null,r=null;return n=>{const[,s]=S(0);if(C(()=>{t||r||o||(o=e().then(e=>{t=e.default||e,s(e=>e+1)}).catch(e=>{r=e,s(e=>e+1)}))},[]),r)throw r;return t?p(t,n):null}},de=({fallback:e,children:t})=>{const[o,r]=S(!0);return C(()=>{r(!1)},[]),o&&e?e:t};let pe=!1,fe=[];const he=e=>{const t=pe;pe=!0;try{e()}finally{pe=t,!pe&&fe.length>0&&me()}},me=()=>{if(0===fe.length)return;const e=fe;fe=[],e.forEach(e=>e())};var Ee=Object.freeze({__proto__:null,Children:q,Fragment:f,Hooks:H,NavLink:$,Priority:T,RouterProvider:V,Suspense:de,batchUpdates:he,createContext:D,createElement:p,init:ce,lazy:ue,memo:le,profiler:ee,render:ie,safeRender:ae,useCallback:A,useDeferredValue:z,useEffect:C,useHash:F,useMemo:L,useMetadata:X,useProfiler:te,useQuery:U,useReducer:O,useRef:M,useRouter:j,useStore:S,useStorePriority:W,useTransition:B,withProfiler:oe});window.Ryunix=Ee,e.Children=q,e.Fragment=f,e.Hooks=H,e.Image=({src:e,...t})=>p("img",{...t,src:e}),e.MDXContent=({children:e,components:t={}})=>{const o=K(t);return p(J,{value:o},p("div",null,e))},e.MDXProvider=J,e.NavLink=$,e.Priority=T,e.RouterProvider=V,e.Suspense=de,e.batchUpdates=he,e.createContext=D,e.createElement=p,e.default=Ee,e.defaultComponents=Z,e.getMDXComponents=K,e.init=ce,e.lazy=ue,e.memo=le,e.profiler=ee,e.render=ie,e.safeRender=ae,e.useCallback=A,e.useDeferredValue=z,e.useEffect=C,e.useHash=F,e.useMDXComponents=Q,e.useMemo=L,e.useMetadata=X,e.useProfiler=te,e.useQuery=U,e.useReducer=O,e.useRef=M,e.useRouter=j,e.useStore=S,e.useStorePriority=W,e.useTransition=B,e.withProfiler=oe,Object.defineProperty(e,"__esModule",{value:!0})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Ryunix={})}(this,function(e){"use strict";const t="undefined"!=typeof requestIdleCallback?requestIdleCallback:e=>setTimeout(()=>e({timeRemaining:()=>1}),1);let r={containerRoot:null,nextUnitOfWork:null,currentRoot:null,wipRoot:null,deletions:[],wipFiber:null,hookIndex:0,effects:[]};const n=()=>r,o=/[A-Z]/g,s=Object.freeze({TEXT_ELEMENT:Symbol.for("ryunix.text.element"),RYUNIX_ELEMENT:Symbol.for("ryunix.element"),RYUNIX_EFFECT:Symbol.for("ryunix.effect"),RYUNIX_MEMO:Symbol.for("ryunix.memo"),RYUNIX_URL_QUERY:Symbol.for("ryunix.urlQuery"),RYUNIX_REF:Symbol.for("ryunix.ref"),RYUNIX_STORE:Symbol.for("ryunix.store"),RYUNIX_REDUCE:Symbol.for("ryunix.reduce"),RYUNIX_FRAGMENT:Symbol.for("ryunix.fragment"),RYUNIX_CONTEXT:Symbol.for("ryunix.context"),RYUNIX_SUSPENSE:Symbol.for("ryunix.suspense")}),i=Object.freeze({OBJECT:"object",FUNCTION:"function",STYLE:"ryunix-style",CLASS_NAME:"ryunix-class",CHILDREN:"children",BOOLEAN:"boolean",STRING:"string",UNDEFINED:"undefined"}),a=Object.freeze({STYLE:"style",CLASS_NAME:"className"}),l=Object.freeze({PLACEMENT:Symbol.for("ryunix.reconciler.status.placement"),UPDATE:Symbol.for("ryunix.reconciler.status.update"),DELETION:Symbol.for("ryunix.reconciler.status.deletion"),NO_EFFECT:Symbol.for("ryunix.reconciler.status.no_effect"),HYDRATE:Symbol.for("ryunix.reconciler.status.hydrate")}),c=(e,t=1)=>Array.isArray(e)?t<1?e.slice():e.reduce((e,r)=>(Array.isArray(r)&&t>0?e.push(...c(r,t-1)):e.push(r),e),[]):[e],u=e=>null!==e&&typeof e===i.OBJECT,d=e=>typeof e===i.FUNCTION,p=e=>typeof e===i.STRING,f=e=>null===e,y=e=>{let t=e;for(;t&&(3===t.nodeType&&!t.nodeValue.trim()||8===t.nodeType||1===t.nodeType&&t.hasAttribute("data-ryunix-ssr"));)t=t.nextSibling;return t},h=e=>({type:s.TEXT_ELEMENT,props:{nodeValue:e,children:[]}}),m=(e,t,...r)=>{const n=t||{};let o=r;0===r.length&&void 0!==n.children&&(o=Array.isArray(n.children)?n.children:[n.children]),o=o.flat().filter(e=>null!=e&&!1!==e&&!0!==e);const s=[];let a="";for(const e of o)typeof e!==i.OBJECT?a+=String(e):(""!==a&&(s.push(h(a)),a=""),s.push(e));return""!==a&&s.push(h(a)),{type:e,props:{...n,children:s}}},g=e=>{const t=Array.isArray(e.children)?e.children:[e.children];return m(s.RYUNIX_FRAGMENT,{},...t)},E=(e,t={},...r)=>{if(!e||!u(e))throw new Error("cloneElement requires a valid element");const n=r.length>0?r:e.props.children;return m(e.type,{...e.props,...t},...Array.isArray(n)?n:[n])},x=e=>u(e)&&void 0!==e.type&&void 0!==e.props,N=e=>e.startsWith("on"),b=e=>e!==i.CHILDREN&&!N(e),v=(e,t)=>r=>!Object.is(e[r],t[r]),R=e=>t=>!(t in e),_=e=>{e?.hooks?.length&&e.hooks.filter(e=>e.type===s.RYUNIX_EFFECT&&d(e.cancel)).forEach(e=>{try{e.cancel(),e.cancel=null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in effect cleanup:",e)}})},w=e=>{e&&(e.hooks?.length>0&&e.hooks.filter(e=>e.type===s.RYUNIX_EFFECT&&d(e.cancel)).forEach(e=>{try{e.cancel(),e.cancel=null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in deep effect cleanup:",e)}}),e.child&&w(e.child),e.sibling&&w(e.sibling))},S={strokeWidth:"stroke-width",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",fillRule:"fill-rule",fillOpacity:"fill-opacity",clipRule:"clip-rule",clipPath:"clip-path",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",textAnchor:"text-anchor",textDecoration:"text-decoration",dominantBaseline:"dominant-baseline",alignmentBaseline:"alignment-baseline",baselineShift:"baseline-shift",stopColor:"stop-color",stopOpacity:"stop-opacity",floodColor:"flood-color",floodOpacity:"flood-opacity",lightingColor:"lighting-color",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",pointerEvents:"pointer-events",shapeRendering:"shape-rendering",imageRendering:"image-rendering",markerStart:"marker-start",markerMid:"marker-mid",markerEnd:"marker-end"},k=e=>S[e]||e,T={IMMEDIATE:1,USER_BLOCKING:2,NORMAL:3,LOW:4,IDLE:5};let C=T.NORMAL,I=[],O=!1;const A=e=>{for(I.sort((e,t)=>e.priority-t.priority);I.length>0&&e.timeRemaining()>1;){const e=I.shift();C=e.priority,e.callback()}I.length>0?t(A):(O=!1,C=T.NORMAL)},D=(e,t)=>{const r=C;C=e;try{return t()}finally{C=r}},L=()=>C,M=e=>e.replace(o,e=>`-${e.toLowerCase()}`),U=(e,t,r)=>{if(!r||""===r.trim()){if(t){const r=t.split(/\s+/).filter(Boolean);e.classList.remove(...r)}return}if(t){const r=t.split(/\s+/).filter(Boolean);e.classList.remove(...r)}const n=r.split(/\s+/).filter(Boolean);n.length>0&&e.classList.add(...n)},$=e=>{if(e.type===s.RYUNIX_FRAGMENT||e.type===s.RYUNIX_CONTEXT||e.type===Symbol.for("ryunix.portal"))return null;let t;try{if(e.type===s.TEXT_ELEMENT)t=document.createTextNode("");else{if(!p(e.type))return"production"!==process.env.NODE_ENV&&console.warn("Attempted to create DOM for non-host component:",e.type),null;t=["svg","path","g","circle","polygon","rect","line","polyline","ellipse","text","tspan","defs","use","symbol","mask","clipPath","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","feBlend","feColorMatrix","feComposite","foreignObject","image","marker","pattern","textPath"].includes(e.type)?document.createElementNS("http://www.w3.org/2000/svg",e.type):document.createElement(e.type)}return Y(t,{},e.props),t}catch(t){return"production"!==process.env.NODE_ENV&&console.error("Error creating DOM element:",t,e),null}},F=(e,t)=>{if("string"!=typeof t)return t;const r=e.toLowerCase();if("href"!==r&&"src"!==r&&"action"!==r&&"formaction"!==r)return t;const n=t.replace(/\s+/g,"").toLowerCase();return n.startsWith("javascript:")||n.startsWith("vbscript:")||n.startsWith("data:")?("production"!==process.env.NODE_ENV&&console.warn(`[Ryunix Security] Blocked dangerous ${e} URI: ${t}`),"javascript:void(0)"):t},Y=(e,t={},r={})=>{3!==e.nodeType?(Object.keys(t).filter(N).filter(e=>R(r)(e)||v(t,r)(e)).forEach(r=>{const n=r.toLowerCase().substring(2);try{const o=t[r],s=e._ryunixHandlers?.get(o)||o;e.removeEventListener(n,s),e._ryunixHandlers&&e._ryunixHandlers.delete(o)}catch(e){"production"!==process.env.NODE_ENV&&console.warn("Error removing event listener:",e)}}),Object.keys(t).filter(b).filter(R(r)).forEach(t=>{if(![i.STYLE,a.STYLE,i.CLASS_NAME,a.CLASS_NAME].includes(t))if(e instanceof SVGElement){const r=k(t);e.removeAttribute(r)}else e[t]="",e.removeAttribute(t)}),Object.keys(r).filter(b).filter(v(t,r)).forEach(n=>{try{if(n===i.STYLE||n===a.STYLE){const t=r[n];((e,t)=>{if(u(t)&&!f(t))try{const r=Object.entries(t).filter(([e,t])=>null!=t).map(([e,t])=>`${M(e)}: ${t}`).join("; ");e.style.cssText=r}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error applying styles:",e)}else e.style.cssText=""})(e,t)}else if(n===i.CLASS_NAME)U(e,t[i.CLASS_NAME],r[i.CLASS_NAME]);else if(n===a.CLASS_NAME)U(e,t[a.CLASS_NAME],r[a.CLASS_NAME]);else if("value"===n||"checked"===n)e[n]!==r[n]&&(e[n]=r[n]);else{if(e instanceof SVGElement){const t=k(n),o=F(t,r[n]);e.setAttribute(t,o)}else{const t=F(n,r[n]);e[n]=t,"object"!=typeof r[n]&&"function"!=typeof r[n]&&e.setAttribute(n,t)}}}catch(e){"production"!==process.env.NODE_ENV&&console.warn(`Error setting property ${n}:`,e)}}),Object.keys(r).filter(N).filter(v(t,r)).forEach(t=>{const n=t.toLowerCase().substring(2);try{const o=e=>{D(T.IMMEDIATE,()=>r[t](e))};e._ryunixHandlers||(e._ryunixHandlers=new Map),e._ryunixHandlers.set(r[t],o),e.addEventListener(n,o)}catch(e){"production"!==process.env.NODE_ENV&&console.warn("Error adding event listener:",e)}})):t.nodeValue!==r.nodeValue&&(e.nodeValue=r.nodeValue)},X=Symbol.for("ryunix.portal"),j=(e,t)=>t?{type:X,props:{children:Array.isArray(e)?e:[e]},containerInfo:t,_isPortal:!0}:("production"!==process.env.NODE_ENV&&console.error("createPortal: target container is not a DOM element."),null),P=e=>{if(e?.hooks?.length)for(let t=0;t<e.hooks.length;t++){const r=e.hooks[t];if(r.type===s.RYUNIX_EFFECT&&r.isLayout&&d(r.effect)){if(d(r.cancel))try{r.cancel()}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in layout effect cleanup:",e)}try{const e=r.effect();r.cancel=d(e)?e:null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in layout effect:",e),r.cancel=null}r.effect=null}}},V=e=>{if(e?.hooks?.length)for(let t=0;t<e.hooks.length;t++){const r=e.hooks[t];if(r.type===s.RYUNIX_EFFECT&&!r.isLayout&&d(r.effect)){if(d(r.cancel))try{r.cancel()}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in effect cleanup:",e)}try{const e=r.effect();r.cancel=d(e)?e:null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in effect:",e),r.cancel=null}r.effect=null}}};function B(e){if(!e)return;if(e.type===X||e._isPortal){const t=e.containerInfo;if(t){const r=e.child;r&&H(r,t)}return void B(e.sibling)}let t=e.parent;for(;t&&!t.dom;)t=t.parent;if(!t)return;const r=t.dom;if(e.effectTag===l.PLACEMENT)null!=e.dom&&("production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log("[Ryunix Debug] Appending PLACEMENT:",e.type),r.appendChild(e.dom)),P(e),V(e);else if(e.effectTag===l.UPDATE)_(e),null!=e.dom&&Y(e.dom,e.alternate.props,e.props),P(e),V(e);else if(e.effectTag===l.HYDRATE){n().hydrationFailed?("production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log("[Ryunix Debug] Hydration fallback PLACEMENT:",e.type),null!=e.dom&&r.appendChild(e.dom),P(e),V(e)):("production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log("[Ryunix Debug] Hydrating node:",e.type),null!=e.dom&&Y(e.dom,{},e.props),P(e),V(e))}else if(e.effectTag===l.DELETION)return w(e),void W(e);B(e.child),B(e.sibling)}const H=(e,t)=>{if(e){if(e.effectTag===l.PLACEMENT)null!=e.dom&&t.appendChild(e.dom),P(e),V(e);else if(e.effectTag===l.UPDATE)_(e),null!=e.dom&&Y(e.dom,e.alternate.props,e.props),P(e),V(e);else if(e.effectTag===l.DELETION)return w(e),void W(e);H(e.child,t),H(e.sibling,t)}},W=(e,t)=>{if(e.dom)e.dom.parentNode&&e.dom.parentNode.removeChild(e.dom);else{let t=e.child;for(;t;)W(t),t=t.sibling}},q=(e,t)=>{const r=n();let o,s=0,i=!0;const a=new Map;let c=e.alternate?.child,u=0;for(;c;){const e=c.key??`__index_${c.index??u}__`;a.set(e,c),c=c.sibling,u++}for(;s<t.length;){const n=t[s];if(!n){s++;continue}const c=n.key??`__index_${s}__`,u=a.get(c);let d;u&&n.type===u.type?(d={type:u.type,props:n.props,dom:u.dom,parent:e,alternate:u,effectTag:l.UPDATE,hooks:u.hooks,stateError:u.stateError,key:n.key,index:s},a.delete(c)):(d={type:n.type,props:n.props,dom:null,parent:e,alternate:null,effectTag:r.isHydrating?l.HYDRATE:l.PLACEMENT,key:n.key,index:s},u&&(u.effectTag=l.DELETION,r.deletions.push(u),a.delete(c))),i?(e.child=d,i=!1):d&&(o.sibling=d),o=d,s++}a.forEach(e=>{e.effectTag=l.DELETION,r.deletions.push(e)})};let G=null;let z=!1,K=[];const J=e=>{const t=z;z=!0;try{e()}finally{z=t,!z&&K.length>0&&Q()}},Q=()=>{if(0===K.length)return;const e=K;K=[],e.forEach(e=>e())};process.env.NODE_ENV;const Z=(e="A hook")=>{const t=n();if(!t.wipFiber)throw new Error(`${e} can only be called inside function components. Make sure you are calling hooks at the top level of your component.`);Array.isArray(t.wipFiber.hooks)||(t.wipFiber.hooks=[])},ee=(e,t)=>!e||!t||(e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))),te=(e,t=L())=>{if("undefined"==typeof window)return[d(e)?e():e,()=>{}];if(n().isServerRendering)return[d(e)?e():e,()=>{}];return re((e,t)=>d(t)?t(e):t,e,void 0,t)},re=(e,t,r,o=L())=>{if("undefined"==typeof window)return[r?r(t):t,()=>{}];const i=n();if(i.isServerRendering)return[r?r(t):t,()=>{}];Z();const{wipFiber:a,hookIndex:l}=i,c=a.alternate?.hooks?.[l],u={hookID:l,type:s.RYUNIX_STORE,state:c?c.state:r?r(t):t,queue:[]};c?.queue&&c.queue.forEach(t=>{try{u.state=e(u.state,t)}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in reducer:",e)}});return a.hooks[l]=u,i.hookIndex++,[u.state,(e,t=o)=>{if(void 0===e)return void("production"!==process.env.NODE_ENV&&console.warn("dispatch called with undefined action"));u.queue.push(e);const r=n(),s=r.currentRoot||r.wipRoot;var i;s&&(r.wipRoot={dom:s.dom,props:s.props,alternate:r.currentRoot||null},r.deletions=[],r.hookIndex=0,i=()=>((e,t)=>{if(G)return G(e,t);"production"!==process.env.NODE_ENV&&console.warn("[Ryunix] scheduleWork called before being initialized.")})(r.wipRoot,t),K.push(i),z||Q())}]},ne=(e,t)=>{if("undefined"==typeof window)return;const r=n();if(r.isServerRendering)return;if(Z(),!d(e))throw new Error("useEffect callback must be a function");if(void 0!==t&&!Array.isArray(t))throw new Error("useEffect dependencies must be an array or undefined");const{wipFiber:o,hookIndex:i}=r,a=o.alternate?.hooks?.[i],l=ee(a?.deps,t),c={hookID:i,type:s.RYUNIX_EFFECT,deps:t,effect:l?e:null,cancel:a?.cancel};o.hooks[i]=c,r.hookIndex++},oe=e=>{if("undefined"==typeof window)return{current:e};const t=n();if(t.isServerRendering)return{current:e};Z();const{wipFiber:r,hookIndex:o}=t,i=r.alternate?.hooks?.[o],a={hookID:o,type:s.RYUNIX_REF,value:i?i.value:{current:e}};return r.hooks[o]=a,t.hookIndex++,a.value},se=(e,t)=>{if("undefined"==typeof window)return e();const r=n();if(r.isServerRendering)return e();if(Z(),!d(e))throw new Error("useMemo callback must be a function");if(!Array.isArray(t))throw new Error("useMemo requires a dependencies array");const{wipFiber:o,hookIndex:i}=r,a=o.alternate?.hooks?.[i];let l;if(a&&!ee(a.deps,t))l=a.value;else try{l=e()}catch(e){throw"production"!==process.env.NODE_ENV&&console.error("Error in useMemo computation:",e),e}const c={hookID:i,type:s.RYUNIX_MEMO,value:l,deps:t};return o.hooks[i]=c,r.hookIndex++,l},ie=(e,t)=>{if(!d(e))throw new Error("useCallback requires a function as first argument");return se(()=>e,t)},ae=(e=s.RYUNIX_CONTEXT,t={})=>{const r=({value:t,children:r})=>m(s.RYUNIX_CONTEXT,{value:t,children:r,_contextId:e},...c([r]));r._contextId=e;return{Provider:r,useContext:(r=e)=>{const o=n();if(o.isServerRendering)return o.ssrContexts&&void 0!==o.ssrContexts[r]?o.ssrContexts[r]:t;Z();let s=o.wipFiber;for(;s;){if(s._contextId===r&&void 0!==s._contextValue)return s._contextValue;if(s.type?._contextId===r&&void 0!==s.props?.value)return s.props.value;s=s.parent}return t}}},le=()=>{if("undefined"==typeof window)return{};const e=new URLSearchParams(window.location.search),t={};for(const[r,n]of e.entries())t[r]=n;return t},ce=()=>{if("undefined"==typeof window)return"";const[e,t]=te(window.location.hash);return ne(()=>{const e=()=>t(window.location.hash);return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]),e},ue=(e={},t={})=>{const r=n();r.isServerRendering?r.ssrMetadata={...r.ssrMetadata,...e}:ne(()=>{if("undefined"==typeof document)return;let r="Ryunix App";const n=t.title?.template,o=t.title?.prefix||"Ryunix App",s=e.pageTitle||e.title;if(r=p(s)&&s.trim()?n?.includes("%s")?n.replace("%s",s):s:o,document.title=r,e.canonical){let t=document.querySelector('link[rel="canonical"]');t||(t=document.createElement("link"),t.setAttribute("rel","canonical"),document.head.appendChild(t)),t.setAttribute("href",e.canonical)}Object.entries(e).forEach(([e,t])=>{if(["title","pageTitle","canonical"].includes(e))return;const r=e.startsWith("og:")||e.startsWith("twitter:"),n=`meta[${r?"property":"name"}='${e}']`;let o=document.head.querySelector(n);o||(o=document.createElement("meta"),o.setAttribute(r?"property":"name",e),document.head.appendChild(o)),o.setAttribute("content",t)})},[JSON.stringify(e),JSON.stringify(t)])},de=ae("ryunix.navigation",{location:"/",params:{},query:{},navigate:e=>{},route:null}),pe=(e,t)=>{const r=t.split("?")[0].split("#")[0],n=e.find(e=>e.NotFound),o=n?{route:{component:n.NotFound},params:{}}:{route:{component:null},params:{}};for(const n of e){if(n.subRoutes){const e=pe(n.subRoutes,t);if(e)return e}if("*"===n.path)return o;if(!n.path||"string"!=typeof n.path)continue;const e=[],s=new RegExp(`^${n.path.replace(/:(\.\.\.)?(\w+)/g,(t,r,n)=>(e.push({key:n,isCatchAll:!!r}),r?"(.+)":"([^/]+)"))}$`),i=r.match(s);if(i){return{route:n,params:e.reduce((e,t,r)=>{const n=i[r+1];return e[t.key]=t.isCatchAll&&n?n.split("/"):n,e},{})}}}return o},fe=({routes:e,children:t})=>{if("undefined"==typeof window){const r="/",n=pe(e,r)||{},o={location:r,params:n.params||{},query:{},navigate:()=>{},route:n.route};return m(de.Provider,{value:o},g({children:t}))}const[r,n]=te(window.location.pathname);ne(()=>{const e=()=>n(window.location.pathname);return window.addEventListener("popstate",e),window.addEventListener("hashchange",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)}},[]);const o=pe(e,r)||{},s=le(),i={location:r,params:o.params||{},query:s,navigate:e=>{"undefined"!=typeof window&&window.__RYUNIX_MPA__?window.location.assign(e):(window.history.pushState({},"",e),n(e))},route:o.route};return m(de.Provider,{value:i},g({children:t}))},ye=()=>de.useContext("ryunix.navigation"),he=()=>{const{route:e,params:t,query:r,location:n}=ye();if(!e||!e.component)return null;const o=ce();return ne(()=>{if(o){const e=o.slice(1),t=document.getElementById(e);t&&t.scrollIntoView({block:"start",behavior:"smooth"})}},[o]),m(e.component,{key:n,params:t,query:r,hash:o,location:n})},me=()=>{const{location:e}=ye();return e.split("?")[0].split("#")[0]},ge=()=>{const{query:e}=ye();return new URLSearchParams(e)},Ee=({to:e,prefetch:t=!0,...r})=>{const{navigate:n}=ye(),{className:o,...s}=r;return m("a",{href:e,onClick:t=>{0!==t.button||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),n(e))},onMouseEnter:()=>{},className:r.className||r["ryunix-class"],...s},r.children)},xe=({to:e,exact:t=!1,...r})=>{const{location:n,navigate:o}=ye(),s=t?n===e:n.startsWith(e),i=r["ryunix-class"]?"ryunix-class":"className",a="function"==typeof(l=r["ryunix-class"]||r.className)?l({isActive:s}):l||"";var l;const{"ryunix-class":c,className:u,...d}=r;return m("a",{href:e,onClick:t=>{0!==t.button||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),o(e))},[i]:a,...d},r.children)},Ne=e=>{const[r,n]=re((e,t)=>"function"==typeof t?t.value(e):t.value,e);return[r,(e,r=T.NORMAL)=>{const o={value:e,priority:r};((e,r=T.NORMAL)=>{I.push({callback:e,priority:r,timestamp:Date.now()}),O||(O=!0,t(A))})(()=>n(o,r),r)}]},be=()=>{const[e,t]=Ne(!1);return[e,e=>{t(!0,T.IMMEDIATE),setTimeout(()=>{D(T.LOW,()=>{e(),t(!1,T.LOW)})},0)}]},ve=e=>{const[t,r]=Ne(e);return ne(()=>{const t=setTimeout(()=>{r(e,T.LOW)},100);return()=>clearTimeout(t)},[e]),t},Re=(e,t="")=>{const[r,n]=te(()=>{try{const r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch(e){return t}});return[r,t=>{try{n(t),window.localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}}]},_e=(e=!1)=>{const[t,r]=te(e);return[t,()=>{r(e=>!e)}]},we=(e,t)=>{if("undefined"==typeof window)return;const r=n();if(r.isServerRendering)return;if(Z(),!d(e))throw new Error("useLayoutEffect callback must be a function");if(void 0!==t&&!Array.isArray(t))throw new Error("useLayoutEffect dependencies must be an array or undefined");const{wipFiber:o,hookIndex:i}=r,a=o.alternate?.hooks?.[i],l=ee(a?.deps,t),c={hookID:i,type:s.RYUNIX_EFFECT,deps:t,effect:l?e:null,cancel:a?.cancel,isLayout:!0};o.hooks[i]=c,r.hookIndex++};let Se=0;const ke=()=>{Se=0},Te=()=>{const e=n();if(e.isServerRendering)return`:r${Se++}:`;Z();const{wipFiber:t,hookIndex:r}=e,o=t.alternate?.hooks?.[r],i={hookID:r,type:s.RYUNIX_REF,value:o?o.value:`:r${Se++}:`};return t.hooks[r]=i,e.hookIndex++,i.value},Ce=(e,t=300)=>{const[r,n]=te(e);return ne(()=>{const r=setTimeout(()=>{n(e)},t);return()=>clearTimeout(r)},[e,t]),r},Ie=(e,t=300)=>{const[r,n]=te(e),o=oe(Date.now());return ne(()=>{const r=Date.now(),s=r-o.current;if(!(s>=t)){const r=setTimeout(()=>{o.current=Date.now(),n(e)},t-s);return()=>clearTimeout(r)}o.current=r,n(e)},[e,t]),r};var Oe=Object.freeze({__proto__:null,Children:he,Link:Ee,NavLink:xe,RouterProvider:fe,createContext:ae,resetIdCounter:ke,useCallback:ie,useDebounce:Ce,useDeferredValue:ve,useEffect:ne,useHash:ce,useId:Te,useLayoutEffect:we,useMemo:se,useMetadata:ue,usePathname:me,usePersistentStore:Re,usePersitentStore:Re,useQuery:le,useReducer:re,useRef:oe,useRouter:ye,useSearchParams:ge,useStore:te,useStorePriority:Ne,useSwitch:_e,useThrottle:Ie,useTransition:be});const Ae=e=>"symbol"==typeof e?e.description||e.toString():"function"==typeof e?e.name||"anonymous":String(e),{Provider:De,useContext:Le}=ae("ryunix.mdx",{}),Me=e=>({...Le(),...e}),Ue={h1:e=>m("h1",{...e}),h2:e=>m("h2",{...e}),h3:e=>m("h3",{...e}),h4:e=>m("h4",{...e}),h5:e=>m("h5",{...e}),h6:e=>m("h6",{...e}),p:e=>m("p",{...e}),a:e=>m("a",{...e}),strong:e=>m("strong",{...e}),em:e=>m("em",{...e}),code:e=>m("code",{...e}),ul:e=>m("ul",{...e}),ol:e=>m("ol",{...e}),li:e=>m("li",{...e}),blockquote:e=>m("blockquote",{...e}),pre:e=>m("pre",{...e}),hr:e=>m("hr",{...e}),table:e=>m("table",{...e}),thead:e=>m("thead",{...e}),tbody:e=>m("tbody",{...e}),tr:e=>m("tr",{...e}),th:e=>m("th",{...e}),td:e=>m("td",{...e}),img:e=>m("img",{...e})},$e=()=>"undefined"!=typeof performance?performance.now():Date.now();const Fe=new class{constructor(){this.enabled="production"!==process.env.NODE_ENV,this.measures=new Map,this.renderTimes=[],this.maxSamples=100}startMeasure(e){this.enabled&&this.measures.set(e,$e())}endMeasure(e){if(!this.enabled)return;const t=this.measures.get(e);if(!t)return;const r=$e()-t;return this.measures.delete(e),r}recordRender(e,t){this.enabled&&(this.renderTimes.push({component:e,duration:t,timestamp:Date.now()}),this.renderTimes.length>this.maxSamples&&this.renderTimes.shift())}getStats(){if(!this.enabled)return null;const e=this.renderTimes.reduce((e,t)=>e+t.duration,0);return{total:e,avg:e/this.renderTimes.length,max:Math.max(...this.renderTimes.map(e=>e.duration)),min:Math.min(...this.renderTimes.map(e=>e.duration)),count:this.renderTimes.length}}getSlowestComponents(e=10){if(!this.enabled)return[];const t=new Map;return this.renderTimes.forEach(({component:e,duration:r})=>{t.has(e)||t.set(e,{total:0,count:0,max:0});const n=t.get(e);n.total+=r,n.count++,n.max=Math.max(n.max,r)}),Array.from(t.entries()).map(([e,t])=>({name:e,avg:t.total/t.count,max:t.max,count:t.count})).sort((e,t)=>t.avg-e.avg).slice(0,e)}logStats(){if(!this.enabled)return;const e=this.getStats();if(!e)return;console.group("šŸ” Ryunix Performance Stats"),console.log(`Total renders: ${e.count}`),console.log(`Avg render time: ${e.avg.toFixed(2)}ms`),console.log(`Min: ${e.min.toFixed(2)}ms | Max: ${e.max.toFixed(2)}ms`);const t=this.getSlowestComponents(5);t.length>0&&(console.log("\nāš ļø Slowest components:"),t.forEach((e,t)=>{console.log(`${t+1}. ${e.name}: ${e.avg.toFixed(2)}ms avg (${e.count} renders)`)})),console.groupEnd()}clear(){this.renderTimes=[],this.measures.clear()}enable(){this.enabled=!0}disable(){this.enabled=!1}},Ye=e=>{const t=$e();return()=>{const r=$e()-t;Fe.recordRender(e,r)}},Xe=(e,t)=>r=>{Fe.startMeasure(t);const n=e(r),o=Fe.endMeasure(t);return o&&Fe.recordRender(t,o),n};let je=[],Pe=!1;function Ve(e){const t=n(),r=e.type instanceof Function||"function"==typeof e.type;try{r?(e=>{const t=n();t.wipFiber=e,t.hookIndex=0,t.wipFiber.hooks=[],t.isHydrating&&(e.effectTag=l.HYDRATE);let r=[e.type(e.props)];e.type._contextId&&void 0!==e.props.value&&(e._contextId=e.type._contextId,e._contextValue=e.props.value),q(e,r)})(e):(e=>{const t=n();e.type===s.RYUNIX_CONTEXT&&(e._contextId=e.props?._contextId,e._contextValue=e.props?.value);const r=e.type===s.RYUNIX_FRAGMENT||e.type===s.RYUNIX_CONTEXT||e.type===Symbol.for("ryunix.portal");if(t.isHydrating&&r)e.effectTag=l.HYDRATE;else if(!e.dom)if(t.isHydrating&&t.hydrateCursor){const r=t.hydrateCursor,n=e.type===s.TEXT_ELEMENT&&3===r.nodeType,o="string"==typeof e.type&&1===r.nodeType&&r.tagName.toLowerCase()===e.type.toLowerCase();n||o?(e.dom=r,e.effectTag=l.HYDRATE,t.hydrateCursor=y(r.firstChild)):("production"!==process.env.NODE_ENV&&console.warn(`[Hydration] Mismatch at ${Ae(e.type)}. Expected ${1===r.nodeType?r.tagName:"text"} but got ${e.type}. Falling back to CSR.`),t.isHydrating=!1,t.hydrationFailed=!0,t.hydrateCursor=null,e.dom=$(e),e.effectTag=l.PLACEMENT)}else e.dom=$(e);const o=e.props?.children||[];q(e,o)})(e)}catch(r){if("production"!==process.env.NODE_ENV){console.error("[Ryunix ErrorBoundary] Caught error during render:",r);try{const t=e.props&&e.props.__source;t&&r&&"object"==typeof r&&(r.__ryunix_source=t);let n=e;for(;!r.__ryunix_source&&n;)n.props&&n.props.__source&&(r.__ryunix_source=n.props.__source),n=n.parent}catch(e){}}let n=e.parent,o=!1;for(;n;){if(n.type&&"RYUNIX_ERROR_BOUNDARY"===n.type.ryunix_type){o=!0;break}n=n.parent}return o?("production"!==process.env.NODE_ENV&&console.warn("[Ryunix ErrorBoundary] Recovering tree at nearest boundary."),n.stateError=r,e.child=null,n):(console.error("[Ryunix] Fatal Uncaught Error. No ErrorBoundary was found in the tree to handle this exception:\n",r),t.nextUnitOfWork=null,null)}if(e.child)return e.child;let o=e;for(;o;){if(t.isHydrating&&o.dom&&(t.hydrateCursor=y(o.dom.nextSibling)),o.sibling)return o.sibling;o=o.parent}}const Be=e=>{const r=n();let o=!1;for(;(r.nextUnitOfWork||je.length>0)&&!o;){if(!r.nextUnitOfWork&&je.length>0){const e=je.shift();r.wipRoot=e,r.nextUnitOfWork=e,r.deletions=[],void 0!==e.isHydrating&&(r.isHydrating=e.isHydrating,r.hydrateCursor=e.hydrateCursor)}r.nextUnitOfWork&&(r.nextUnitOfWork=Ve(r.nextUnitOfWork)),o=e.timeRemaining()<1}!r.nextUnitOfWork&&r.wipRoot&&function(){const e=n();e.deletions.forEach(B);const t=e.wipRoot;if(e.currentRoot=t,e.isHydrating||e.hydrationFailed){if("production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log(`[Ryunix Debug] commitRoot - isHydrating: ${e.isHydrating}, hydrationFailed: ${e.hydrationFailed}`),e.hydrationFailed){"production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log("[Ryunix Debug] Hydration failed. Clearing container.");const r=e.containerRoot||t.dom;r&&(r.textContent="")}else{let t=e.hydrateCursor;for(t&&"production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log("[Ryunix Debug] Removing unmatched root siblings.");t;){const e=t.nextSibling;t.parentNode&&t.parentNode.removeChild(t),t=e}}e.isHydrating=!1,e.hydrationFailed=!1,e.hydrateCursor=null}B(t.child),e.wipRoot===t&&(e.wipRoot=null)}(),r.nextUnitOfWork||je.length>0?t(Be):Pe=!1},He=(e,r=L())=>{const o=n();o.wipRoot?je.push(e):(o.nextUnitOfWork=e,o.wipRoot=e,o.deletions=[],void 0!==e.isHydrating&&(o.isHydrating=e.isHydrating,o.hydrateCursor=e.hydrateCursor)),o.hookIndex=0,o.effects=[],Pe||(Pe=!0,r<=T.USER_BLOCKING?Promise.resolve().then(()=>{Be({timeRemaining:()=>10,didTimeout:!0})}):t(Be))};G=He;const We=(e,t)=>{const r=n();(e=>{if(e)for(;e.firstChild;)e.removeChild(e.firstChild)})(t);const o={dom:t,props:{children:[e]},alternate:r.currentRoot,isHydrating:!1,hydrateCursor:null};return He(o),o},qe=e=>{let t=e;for(;t&&(3===t.nodeType&&!t.nodeValue.trim()||8===t.nodeType||1===t.nodeType&&t.hasAttribute("data-ryunix-ssr"));)t=t.nextSibling;return t},Ge=(e,t)=>{const r=n();r.containerRoot=t;const o={dom:t,props:{children:[e]},alternate:r.currentRoot,isHydrating:!0,hydrateCursor:qe(t.firstChild)};return He(o),o},ze=(e,t="__ryunix",r={})=>{const o=n();o.containerRoot=document.getElementById(t),o.isHydrating=!1,o.hydrationFailed=!1;const s=o.containerRoot&&o.containerRoot.hasChildNodes();"production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log(`[Ryunix Debug] init: hasChildNodes=${s}, has SSR content detected.`);const i="false"!==process.env.RYUNIX_SSR;if(s&&i){"production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log(`[Ryunix Debug] init: SSR content detected. Starting hydration on #${t}`);return Ge(e,o.containerRoot)}"production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log(`[Ryunix Debug] init: No SSR content or SSR disabled. Starting normal render on #${t}`);return We(e,o.containerRoot)},Ke=(e,t,r)=>{try{return e(t)}catch(e){return"production"!==process.env.NODE_ENV&&console.error("Component error:",e),r&&r(e),null}},Je=e=>"string"!=typeof e?String(e):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"),Qe=e=>!u(e)||f(e)?"":Object.entries(e).filter(([e,t])=>null!=t).map(([e,t])=>`${M(e)}:${t}`).join(";"),Ze=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),et=e=>{if(null==e||"boolean"==typeof e)return"";if("string"==typeof e||"number"==typeof e)return Je(e);if(Array.isArray(e))return e.map(e=>et(e)).join("");if(e.type===s.TEXT_ELEMENT)return Je(e.props.nodeValue);if(e.type===s.RYUNIX_FRAGMENT){return(e.props?.children||[]).map(e=>et(e)).join("")}if(e.type===s.RYUNIX_CONTEXT){const t=n();t.ssrContexts=t.ssrContexts||{};const r=e.props?._contextId,o=t.ssrContexts[r];r&&(t.ssrContexts[r]=e.props?.value);const s=e.props?.children||[];let i="";return i=Array.isArray(s)?s.map(e=>et(e)).join(""):et(s),r&&(t.ssrContexts[r]=o),i}if("function"==typeof e.type){const t=(0,e.type)(e.props||{});return et(t)}const t=e.type,r=e.props||{};let o="",l="",c=null;if(Object.entries(r).forEach(([e,t])=>{if("children"===e)l=Array.isArray(t)?t.map(e=>et(e)).join(""):et(t);else if("dangerouslySetInnerHTML"===e&&t?.__html)c=t.__html;else if(e===i.STYLE||e===a.STYLE){const e=Qe(t);e&&(o+=` style="${Je(e)}"`)}else if(e===i.CLASS_NAME||e===a.CLASS_NAME)t&&(o+=` class="${Je(t)}"`);else if(!e.startsWith("on")&&"__source"!==e&&"__self"!==e)if("boolean"==typeof t)t&&(o+=` ${e}=""`);else if(null!=t){let r=k(e),n=F(r,t);o+=` ${r}="${Je(n)}"`}}),Ze.has(t))return`<${t}${o} />`;return`<${t}${o}>${null!==c?c:l}</${t}>`},tt="\nfunction $RC(id, templateId) {\n var b = document.getElementById(id);\n var t = document.getElementById(templateId);\n if (b && t) {\n b.innerHTML = t.innerHTML;\n t.remove();\n }\n}\n".replace(/\s+/g," ").trim(),rt=async(e,t,r=[])=>{if(null==e||"boolean"==typeof e)return;if(e instanceof Promise&&(null==(e=await e)||"boolean"==typeof e))return;if("string"==typeof e||"number"==typeof e)return void t(Je(e));if(Array.isArray(e)){for(const n of e)await rt(n,t,r);return}if(e.type===s.TEXT_ELEMENT)return void t(Je(e.props.nodeValue));if(e.type===s.RYUNIX_FRAGMENT){const n=e.props?.children||[];for(const e of n)await rt(e,t,r);return}if(e.type===s.RYUNIX_CONTEXT){const o=n();o.ssrContexts=o.ssrContexts||{};const s=e.props?._contextId,i=o.ssrContexts[s];s&&(o.ssrContexts[s]=e.props?.value);const a=e.props?.children||[];if(Array.isArray(a))for(const e of a)await rt(e,t,r);else await rt(a,t,r);return void(s&&(o.ssrContexts[s]=i))}if(e.type===s.RYUNIX_SUSPENSE||e.type?.type===s.RYUNIX_SUSPENSE){const{fallback:o,children:s}=e.props,i=`s-${Math.random().toString(36).slice(2,9)}`;t(`\x3c!--$?--\x3e<template id="B:${i}"></template><div id="S:${i}">`);const a=(async()=>{const e=n(),t=e.isSuspenseBackground;e.isSuspenseBackground=!0;let o="";const a=e=>o+=e;try{return await rt(s,a,r),{id:i,content:o,success:!0}}catch(e){return{id:i,content:"",success:!1,error:e}}finally{e.isSuspenseBackground=t}})();return r.push(a),await rt(o,t,r),void t("</div>\x3c!--$/--\x3e")}let o=e.type,l=e.props||{};if("function"==typeof o){process.env.RYUNIX_DEBUG&&console.log("[SSR Debug] Rendering function:",o.name||"anonymous");const e=await o(l);return void await rt(e,t,r)}let c="",u=null,d=l.children||[];if(Object.entries(l).forEach(([e,t])=>{if("children"===e);else if("dangerouslySetInnerHTML"===e&&t?.__html)u=t.__html;else if(e===i.STYLE||e===a.STYLE){const e=Qe(t);e&&(c+=` style="${Je(e)}"`)}else if(e===i.CLASS_NAME||e===a.CLASS_NAME)t&&(c+=` class="${Je(t)}"`);else if(!e.startsWith("on")&&"__source"!==e&&"__self"!==e)if("boolean"==typeof t)t&&(c+=` ${e}=""`);else if(null!=t){const r=k(e),n=F(r,t);c+=` ${r}="${Je(n)}"`}}),t(`<${o}${c}>`),null!==u)t(u);else if(Array.isArray(d))for(const e of d)await rt(e,t,r);else await rt(d,t,r);Ze.has(o)||t(`</${o}>`)},nt=(e,t={})=>{const r=n(),o=new TextEncoder;return ke(),new ReadableStream({async start(n){const s=r.isServerRendering;r.isServerRendering=!0,r.ssrMetadata={};const i=e=>n.enqueue(o.encode(e)),a=[];try{const r=t.nonce?` nonce="${t.nonce}"`:"";for(i(`<script${r} data-ryunix-ssr>${tt}<\/script>`),await rt(e,i,a);a.length>0;){const e=a.shift(),t=await e;t.success&&(i(`<template id="P:${t.id}" data-ryunix-ssr>${t.content}</template>`),i(`<script${r} data-ryunix-ssr>$RC("S:${t.id}", "P:${t.id}")<\/script>`))}n.close()}catch(e){n.error(e)}finally{r.isServerRendering=s}}})},ot=(e,t={})=>{const r=n(),o=r.isServerRendering;r.isServerRendering=!0,r.ssrMetadata={},ke();try{return et(e)}finally{r.isServerRendering=o}},st=async(e,t={})=>{const r=nt(e,t).getReader(),n=new TextDecoder;let o="";for(;;){const{done:e,value:t}=await r.read();if(e)break;o+=n.decode(t,{stream:!0})}return o+=n.decode(),o},it=(e,t=at)=>{let r=null,n=null;const o=o=>(r&&t(r,o)||(r=o,n=e(o)),n);return o.displayName=`Memo(${e.displayName||e.name||"Component"})`,o},at=(e,t)=>{const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(r=>Object.is(e[r],t[r]))},lt=(e,t)=>{if(e===t)return!0;if(null==e||null==t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(r=>lt(e[r],t[r]))},ct="pending",ut="resolved",dt="rejected",pt=e=>{let t=ct,r=null,n=null,o=null;const s=s=>{if(t===ut&&r)return m(r,s);if(t===dt&&n)throw n;o||(o=e().then(e=>{r=e.default||e,t=ut}).catch(e=>{n=e,t=dt}));const[,i]=te(0);return ne(()=>{if(t===ct&&o){let e=!0;return o.then(()=>{e&&i(e=>e+1)}).catch(()=>{e&&i(e=>e+1)}),()=>{e=!1}}},[]),null};return s._isLazy=!0,s._getStatus=()=>t,s},ft=({fallback:e,children:t})=>{const[r,o]=te(!1),s=Array.isArray(t)?t:[t];let i=!1;for(const e of s)if(e&&e.type&&e.type._isLazy){e.type._getStatus()===ct&&(i=!0)}return ne(()=>{i||r||o(!0)},[i]),i&&!n().isSuspenseBackground?e||null:m(g,{children:t})};ft.type=s.RYUNIX_SUSPENSE;const yt=e=>e(),ht=e=>{if("function"!=typeof e)throw new Error("forwardRef requires a render function");const t=t=>{const{ref:r,...n}=t||{};return e(n,r||null)};return t.displayName=`ForwardRef(${e.displayName||e.name||"Component"})`,t._isForwardRef=!0,t._render=e,t};function mt({children:e,id:t}){return m("div",{"data-ryunix-server":t,style:{display:"contents"}},e)}function gt({children:e,fallback:t}){const r=n();return r.wipFiber&&r.wipFiber.stateError?"function"==typeof t?t(r.wipFiber.stateError):t:m("ryunix-error-boundary-wrapper",{style:{display:"contents"}},e)}function Et(e){return async function(...t){const r=await fetch("/_ryunix/action",{method:"POST",headers:{"Content-Type":"application/json","X-Ryunix-Action":"true"},body:JSON.stringify({actionId:e,args:t})});if(!r.ok){const e=await r.json().catch(()=>({}));throw new Error(e.error||"Server Action failed")}return r.json()}}function xt(e){const t=e&&e.nativeEvent?e.error:e;let r=t instanceof Error||t&&t.message?t:t?.error||t;const n=JSON.stringify(e,Object.getOwnPropertyNames(e||{})),[o,s]=te(null),[i,a]=te(1),[l,c]=te(""),[u,d]=te(0);let p=[];r&&r.stack&&(p="string"==typeof r.stack?r.stack.split("\n").filter(e=>{const t=e.trim();if(!t)return!1;if(t.includes("node_modules"))return!1;return!["components.js","workers.js","reconciler.js","commits.js","hooks.js","errorBoundary.js","serverBoundary.js","app-router.js","app-router-server.js","render.js","createElement.js","index.js"].some(e=>t.includes(e))}):r.stack);const f=r&&r.name?r.name:"Unknown Error Type",y=r&&r.message?r.message:`Raw unhandled error. Debug: ${n}`;ne(()=>{let e=null,t=null;if(r&&r.__ryunix_source&&r.__ryunix_source.fileName&&(e=r.__ryunix_source.fileName,t=r.__ryunix_source.lineNumber),!e||!t)for(let r=0;r<p.length;r++){const n=p[r];if(!n.includes(":"))continue;let o=null,s=null;const i=n.indexOf("("),a=n.lastIndexOf(")");if(-1!==i&&a>i){const e=n.slice(i+1,a),t=e.lastIndexOf(":"),r=t>0?e.lastIndexOf(":",t-1):-1;if(r>0){const n=e.slice(t+1),i=e.slice(r+1,t);/^\d+$/.test(i)&&/^\d+$/.test(n)&&(o=e.slice(0,r),s=parseInt(i,10))}}if(!o){const e=n.trim();if(e.startsWith("at ")){const t=e.slice(3).trim(),r=t.lastIndexOf(":"),n=r>0?t.lastIndexOf(":",r-1):-1;if(n>0){const e=t.slice(r+1),i=t.slice(n+1,r);/^\d+$/.test(i)&&/^\d+$/.test(e)&&(o=t.slice(0,n),s=parseInt(i,10))}}}if(!o){const e=[".ryx",".jsx",".js",".ts",".tsx"],t=n.lastIndexOf(":");if(t>0){const r=n.slice(t+1).trim(),i=n.slice(0,t).trim();/^\d+$/.test(r)&&e.some(e=>i.endsWith(e))&&(o=i,s=parseInt(r,10))}}if(o&&s){e=o,t=s;break}}e&&t&&(c(e),d(t),fetch(`/_ryunix/source?file=${encodeURIComponent(e)}&line=${t}`).then(e=>e.json()).then(e=>{e.snippet&&(s(e.snippet),a(e.startLine))}).catch(e=>console.error("Failed to fetch source snippet",e)))},[r]);const h={backgroundColor:"#000",borderRadius:"8px",border:"1px solid #333",padding:"16px",fontFamily:"ui-monospace, monospace",fontSize:"14px",overflowX:"auto",color:"#d1d5db",marginBottom:"32px",whiteSpace:"pre-wrap",maxHeight:"150px",height:"auto"},g=e=>({display:"flex",backgroundColor:e?"rgba(239, 68, 68, 0.15)":"transparent",padding:"2px 8px",borderRadius:"4px",borderLeft:e?"3px solid #ef4444":"3px solid transparent"}),E=o?o.split("\n"):[];let x="UNHANDLED RUNTIME ERROR";return f&&"Error"!==f&&"Unknown Error Type"!==f&&(x=f.replace(/([a-z])([A-Z])/g,"$1 $2").toUpperCase()),m("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:2147483647,backgroundColor:"rgba(0, 0, 0, 0.85)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",fontFamily:"system-ui, -apple-system, sans-serif"}},m("div",{style:{backgroundColor:"#0c0c0c",width:"100%",maxWidth:"1000px",maxHeight:"90vh",borderRadius:"12px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.8)",display:"flex",flexDirection:"column",overflow:"hidden",border:"1px solid #333"}},m("div",{style:{backgroundColor:"#161616",padding:"16px 24px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between",alignItems:"center"}},m("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},m("span",{style:{backgroundColor:"rgba(239, 68, 68, 0.2)",color:"#ef4444",padding:"4px 8px",borderRadius:"4px",fontSize:"13px",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"0.05em"}},x),m("span",{style:{color:"#9ca3af",fontSize:"14px"}},"Ryunix Development")),m("button",{onClick:()=>window.location.reload(),style:{background:"none",border:"none",color:"#9ca3af",cursor:"pointer",outline:"none"},title:"Reload page"},m("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},m("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),m("path",{d:"M3 3v5h5"})))),m("div",{style:{padding:"32px",overflowY:"auto",flex:1,color:"#fff"}},m("h1",{style:{fontSize:"24px",fontWeight:"bold",marginBottom:"24px",fontFamily:"ui-monospace, monospace",wordBreak:"break-word",lineHeight:1.4}},m("span",{style:{color:"#f87171"}},f),": ",y),l&&m("div",{style:{marginBottom:"16px",color:"#9ca3af",fontSize:"14px",display:"flex",alignItems:"center",gap:"8px"}},m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},m("path",{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}),m("polyline",{points:"13 2 13 9 20 9"})),l,":",u),o&&m("div",{style:h},m("div",{style:{display:"flex",flexDirection:"column"}},...E.map((e,t)=>{const r=i+t,n=r===u;return m("div",{key:t,style:g(n)},m("span",{style:{color:"#6b7280",width:"40px",userSelect:"none",textAlign:"right",marginRight:"16px",display:"inline-block"}},r),m("span",{style:{color:n?"#f87171":"#e5e7eb",whiteSpace:"pre"}},e||" "))}))),m("div",{style:{marginBottom:"16px"}},m("p",{style:{color:"#9ca3af",fontSize:"14px",marginBottom:"8px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"}},"Call Stack"),m("div",{style:h},p.length>0?m("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"12px"}},...p.map((e,t)=>{if(0===t&&(e.startsWith("Error:")||e.startsWith("TypeError:")))return null;const r=e.trim();let n="<anonymous>",o=e;if(r.startsWith("at ")){const e=r.slice(3),t=e.indexOf("("),s=e.lastIndexOf(")");-1!==t&&s>t?(n=e.slice(0,t).trim()||"<anonymous>",o=e.slice(t+1,s)):(n=e.includes(":")?"<anonymous>":e,o=e)}else if(r.includes("@")){const e=r.indexOf("@");n=r.slice(0,e)||"<anonymous>",o=r.slice(e+1)}else{const e=[".ryx",".jsx",".js",".ts",".tsx"],t=r.split(/\s+/);if(t.length>=2){const r=t[t.length-1],s=r.indexOf(":"),i=s>0?r.slice(0,s):r;e.some(e=>i.endsWith(e))?(n=t.slice(0,-1).join(" "),o=r):(n=t[0],o=t.slice(1).join(" "))}}return m("li",{key:t},m("span",{style:{color:"#60a5fa",fontWeight:600}},n),m("div",{style:{color:"#6b7280",marginTop:"4px",paddingLeft:"16px",display:"flex",alignItems:"center",gap:"8px"}},m("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},m("path",{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}),m("polyline",{points:"13 2 13 9 20 9"})),o))})):m("div",{style:{color:"#6b7280",fontStyle:"italic"}},"No stack trace available."))))))}mt.ryunix_type="RYUNIX_SERVER_BOUNDARY",gt.ryunix_type="RYUNIX_ERROR_BOUNDARY";var Nt=Object.freeze({__proto__:null,Children:he,ErrorBoundary:gt,Fragment:g,Hooks:Oe,Link:Ee,NavLink:xe,Priority:T,RouterProvider:fe,RyunixDevOverlay:xt,ServerBoundary:mt,Suspense:ft,batchUpdates:J,cloneElement:E,createActionProxy:Et,createContext:ae,createElement:m,createPortal:j,deepEqual:lt,escapeHtml:Je,forwardRef:ht,getState:n,hydrate:Ge,init:ze,isValidElement:x,lazy:pt,memo:it,preload:yt,profiler:Fe,render:We,renderToReadableStream:nt,renderToString:ot,renderToStringAsync:st,resetIdCounter:ke,safeRender:Ke,shallowEqual:at,useCallback:ie,useDebounce:Ce,useDeferredValue:ve,useEffect:ne,useHash:ce,useId:Te,useLayoutEffect:we,useMemo:se,useMetadata:ue,usePathname:me,usePersistentStore:Re,usePersitentStore:Re,useProfiler:Ye,useQuery:le,useReducer:re,useRef:oe,useRouter:ye,useSearchParams:ge,useStore:te,useStorePriority:Ne,useSwitch:_e,useThrottle:Ie,useTransition:be,withProfiler:Xe});"undefined"!=typeof window&&(window.Ryunix=Nt),e.Children=he,e.ErrorBoundary=gt,e.Fragment=g,e.Hooks=Oe,e.Image=({src:e,...t})=>m("img",{...t,src:e}),e.Link=Ee,e.MDXContent=({children:e,components:t={}})=>{const r=Me(t);return m(De,{value:r},m("div",null,e))},e.MDXProvider=De,e.NavLink=xe,e.Priority=T,e.RouterProvider=fe,e.RyunixDevOverlay=xt,e.ServerBoundary=mt,e.Suspense=ft,e.batchUpdates=J,e.cloneElement=E,e.createActionProxy=Et,e.createContext=ae,e.createElement=m,e.createPortal=j,e.deepEqual=lt,e.default=Nt,e.defaultComponents=Ue,e.escapeHtml=Je,e.forwardRef=ht,e.getMDXComponents=Me,e.getState=n,e.hydrate=Ge,e.init=ze,e.isValidElement=x,e.lazy=pt,e.memo=it,e.preload=yt,e.profiler=Fe,e.render=We,e.renderToReadableStream=nt,e.renderToString=ot,e.renderToStringAsync=st,e.resetIdCounter=ke,e.safeRender=Ke,e.shallowEqual=at,e.useCallback=ie,e.useDebounce=Ce,e.useDeferredValue=ve,e.useEffect=ne,e.useHash=ce,e.useId=Te,e.useLayoutEffect=we,e.useMDXComponents=Le,e.useMemo=se,e.useMetadata=ue,e.usePathname=me,e.usePersistentStore=Re,e.usePersitentStore=Re,e.useProfiler=Ye,e.useQuery=le,e.useReducer=re,e.useRef=oe,e.useRouter=ye,e.useSearchParams=ge,e.useStore=te,e.useStorePriority=Ne,e.useSwitch=_e,e.useThrottle=Ie,e.useTransition=be,e.withProfiler=Xe,Object.defineProperty(e,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=Ryunix.umd.min.js.map