import*as e from"react";import*as t from"@preact/signals-react/runtime";var r={875:function(e,t,r){r.d(t,{gz:()=>o});let n=(e,t)=>{if(null==t)return!1;let r=e.split("/"),n=t.split("/");if(r.length!==n.length)return!1;let o=e.replace(/:\w+/g,"([^/]+)");return RegExp(`^${o}$`).test(t)},o=(e,t)=>{let r;return Object.keys(e).reduce((r,o)=>(n(o,t)&&(r=e[o]),r),r)}}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var a=n[e]={exports:{}};return r[e](a,a.exports,o),a.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var a={};o.d(a,{j:()=>s});var l=o(875);let s=(0,e.memo)(({className:r,router:n,routes:o,homeUrl:a,notFoundComponent:s})=>{(0,t.useSignals)();let[u,i]=(0,e.useState)(void 0);(0,e.useEffect)(()=>{let e=n.create({config:{homeUrl:a,routeNames:Object.keys(o)},onChange:e=>{i(e.hash)}});return()=>{e(),n.destroy()}},[s,a,n,o]);let p=(u?(0,l.gz)(o,u):null)??s;return(0,e.useEffect)(()=>{let e=new AbortController;return window.addEventListener("popstate",e=>{e.stopPropagation()},{signal:e.signal}),()=>{e.abort()}},[]),e.default.createElement("div",{className:r,key:u},e.default.createElement(p,n.currentEntry.value.getParams()))});var u=a.j;export{u as ClientRouter};
//# sourceMappingURL=ClientRouter.js.map