import{r as i}from"./index-DhY--VwN.js";function Ce(e={}){let{initialEntries:t=["/"],initialIndex:n,v5Compat:l=!1}=e,r;r=t.map((h,m)=>f(h,typeof h=="string"?null:h.state,m===0?"default":void 0));let a=o(n??r.length-1),s="POP",c=null;function o(h){return Math.min(Math.max(h,0),r.length-1)}function u(){return r[a]}function f(h,m=null,y){let w=Re(r?u().pathname:"/",h,m,y);return R(w.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),w}function d(h){return typeof h=="string"?h:V(h)}return{get index(){return a},get action(){return s},get location(){return u()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let m=typeof h=="string"?I(h):h;return{pathname:m.pathname||"",search:m.search||"",hash:m.hash||""}},push(h,m){s="PUSH";let y=f(h,m);a+=1,r.splice(a,r.length,y),l&&c&&c({action:s,location:y,delta:1})},replace(h,m){s="REPLACE";let y=f(h,m);r[a]=y,l&&c&&c({action:s,location:y,delta:0})},go(h){s="POP";let m=o(a+h),y=r[m];a=m,c&&c({action:s,location:y,delta:h})},listen(h){return c=h,()=>{c=null}}}}function C(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function R(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ee(){return Math.random().toString(36).substring(2,10)}function Re(e,t,n=null,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?I(t):t,state:n,key:t&&t.key||l||Ee()}}function V({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function I(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let l=e.indexOf("?");l>=0&&(t.search=e.substring(l),e=e.substring(0,l)),e&&(t.pathname=e)}return t}function le(e,t,n="/"){return be(e,t,n,!1)}function be(e,t,n,l){let r=typeof t=="string"?I(t):t,a=S(r.pathname||"/",n);if(a==null)return null;let s=oe(e);Pe(s);let c=null;for(let o=0;c==null&&o{let o={relativePath:c===void 0?a.path||"":c,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};o.relativePath.startsWith("/")&&(C(o.relativePath.startsWith(l),`Absolute route path "${o.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(l.length));let u=L([l,o.relativePath]),f=n.concat(o);a.children&&a.children.length>0&&(C(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),oe(a.children,t,f,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:Ie(u,a.index),routesMeta:f})};return e.forEach((a,s)=>{var c;if(a.path===""||!((c=a.path)!=null&&c.includes("?")))r(a,s);else for(let o of ie(a.path))r(a,s,o)}),t}function ie(e){let t=e.split("/");if(t.length===0)return[];let[n,...l]=t,r=n.endsWith("?"),a=n.replace(/\?$/,"");if(l.length===0)return r?[a,""]:[a];let s=ie(l.join("/")),c=[];return c.push(...s.map(o=>o===""?a:[a,o].join("/"))),r&&c.push(...s),c.map(o=>e.startsWith("/")&&o===""?"/":o)}function Pe(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Ne(t.routesMeta.map(l=>l.childrenIndex),n.routesMeta.map(l=>l.childrenIndex)))}var Le=/^:[\w-]+$/,Se=3,ke=2,$e=1,Me=10,Fe=-2,ne=e=>e==="*";function Ie(e,t){let n=e.split("/"),l=n.length;return n.some(ne)&&(l+=Fe),t&&(l+=ke),n.filter(r=>!ne(r)).reduce((r,a)=>r+(Le.test(a)?Se:a===""?$e:Me),l)}function Ne(e,t){return e.length===t.length&&e.slice(0,-1).every((l,r)=>l===t[r])?e[e.length-1]-t[t.length-1]:0}function Te(e,t,n=!1){let{routesMeta:l}=e,r={},a="/",s=[];for(let c=0;c{if(f==="*"){let m=c[p]||"";s=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const h=c[p];return d&&!h?u[f]=void 0:u[f]=(h||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:s,pattern:e}}function De(e,t=!1,n=!0){R(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let l=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,c,o)=>(l.push({paramName:c,isOptional:o!=null}),o?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(l.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),l]}function Ae(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return R(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function S(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,l=e.charAt(n);return l&&l!=="/"?null:e.slice(n)||"/"}function Oe(e,t="/"){let{pathname:n,search:l="",hash:r=""}=typeof e=="string"?I(e):e;return{pathname:n?n.startsWith("/")?n:Be(n,t):t,search:He(l),hash:_e(r)}}function Be(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function j(e,t,n,l){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Ue(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ue(e){let t=Ue(e);return t.map((n,l)=>l===t.length-1?n.pathname:n.pathnameBase)}function se(e,t,n,l=!1){let r;typeof e=="string"?r=I(e):(r={...e},C(!r.pathname||!r.pathname.includes("?"),j("?","pathname","search",r)),C(!r.pathname||!r.pathname.includes("#"),j("#","pathname","hash",r)),C(!r.search||!r.search.includes("#"),j("#","search","hash",r)));let a=e===""||r.pathname==="",s=a?"/":r.pathname,c;if(s==null)c=n;else{let d=t.length-1;if(!l&&s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),d-=1;r.pathname=p.join("/")}c=d>=0?t[d]:"/"}let o=Oe(r,c),u=s&&s!=="/"&&s.endsWith("/"),f=(a||s===".")&&n.endsWith("/");return!o.pathname.endsWith("/")&&(u||f)&&(o.pathname+="/"),o}var L=e=>e.join("/").replace(/\/\/+/g,"/"),We=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),He=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_e=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Ve(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var ce=["POST","PUT","PATCH","DELETE"];new Set(ce);var ze=["GET",...ce];new Set(ze);var N=i.createContext(null);N.displayName="DataRouter";var J=i.createContext(null);J.displayName="DataRouterState";var fe=i.createContext({isTransitioning:!1});fe.displayName="ViewTransition";var Je=i.createContext(new Map);Je.displayName="Fetchers";var Ke=i.createContext(null);Ke.displayName="Await";var P=i.createContext(null);P.displayName="Navigation";var K=i.createContext(null);K.displayName="Location";var k=i.createContext({outlet:null,matches:[],isDataRoute:!1});k.displayName="Route";var G=i.createContext(null);G.displayName="RouteError";function Ye(e,{relative:t}={}){C(A(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:l}=i.useContext(P),{hash:r,pathname:a,search:s}=O(e,{relative:t}),c=a;return n!=="/"&&(c=a==="/"?n:L([n,a])),l.createHref({pathname:c,search:s,hash:r})}function A(){return i.useContext(K)!=null}function M(){return C(A(),"useLocation() may be used only in the context of a component."),i.useContext(K).location}var he="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function de(e){i.useContext(P).static||i.useLayoutEffect(e)}function je(){let{isDataRoute:e}=i.useContext(k);return e?it():qe()}function qe(){C(A(),"useNavigate() may be used only in the context of a component.");let e=i.useContext(N),{basename:t,navigator:n}=i.useContext(P),{matches:l}=i.useContext(k),{pathname:r}=M(),a=JSON.stringify(ue(l)),s=i.useRef(!1);return de(()=>{s.current=!0}),i.useCallback((o,u={})=>{if(R(s.current,he),!s.current)return;if(typeof o=="number"){n.go(o);return}let f=se(o,JSON.parse(a),r,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:L([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,a,r,e])}i.createContext(null);function O(e,{relative:t}={}){let{matches:n}=i.useContext(k),{pathname:l}=M(),r=JSON.stringify(ue(n));return i.useMemo(()=>se(e,JSON.parse(r),l,t==="path"),[e,r,l,t])}function Ge(e,t,n,l){C(A(),"useRoutes() may be used only in the context of a component.");let{navigator:r,static:a}=i.useContext(P),{matches:s}=i.useContext(k),c=s[s.length-1],o=c?c.params:{},u=c?c.pathname:"/",f=c?c.pathnameBase:"/",d=c&&c.route;{let v=d&&d.path||"";me(u,!d||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${u}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. Please change the parent to .`)}let p=M(),h;h=p;let m=h.pathname||"/",y=m;if(f!=="/"){let v=f.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(v.length).join("/")}let w=!a&&n&&n.matches&&n.matches.length>0?n.matches:le(e,{pathname:y});return R(d||w!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),R(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),tt(w&&w.map(v=>Object.assign({},v,{params:Object.assign({},o,v.params),pathname:L([f,r.encodeLocation?r.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?f:L([f,r.encodeLocation?r.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),s,n,l)}function Xe(){let e=ot(),t=Ve(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:l},a={padding:"2px 4px",backgroundColor:l},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:a},"ErrorBoundary")," or"," ",i.createElement("code",{style:a},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),n?i.createElement("pre",{style:r},n):null,s)}var Qe=i.createElement(Xe,null),Ze=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?i.createElement(k.Provider,{value:this.props.routeContext},i.createElement(G.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function et({routeContext:e,match:t,children:n}){let l=i.useContext(N);return l&&l.static&&l.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(k.Provider,{value:e},n)}function tt(e,t=[],n=null,l=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let r=e,a=n==null?void 0:n.errors;if(a!=null){let o=r.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);C(o>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),r=r.slice(0,Math.min(r.length,o+1))}let s=!1,c=-1;if(n)for(let o=0;o=0?r=r.slice(0,c+1):r=[r[0]];break}}}return r.reduceRight((o,u,f)=>{let d,p=!1,h=null,m=null;n&&(d=a&&u.route.id?a[u.route.id]:void 0,h=u.route.errorElement||Qe,s&&(c<0&&f===0?(me("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,m=null):c===f&&(p=!0,m=u.route.hydrateFallbackElement||null)));let y=t.concat(r.slice(0,f+1)),w=()=>{let g;return d?g=h:p?g=m:u.route.Component?g=i.createElement(u.route.Component,null):u.route.element?g=u.route.element:g=o,i.createElement(et,{match:u,routeContext:{outlet:o,matches:y,isDataRoute:n!=null},children:g})};return n&&(u.route.ErrorBoundary||u.route.errorElement||f===0)?i.createElement(Ze,{location:n.location,revalidation:n.revalidation,component:h,error:d,children:w(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):w()},null)}function X(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nt(e){let t=i.useContext(N);return C(t,X(e)),t}function rt(e){let t=i.useContext(J);return C(t,X(e)),t}function at(e){let t=i.useContext(k);return C(t,X(e)),t}function Q(e){let t=at(e),n=t.matches[t.matches.length-1];return C(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function lt(){return Q("useRouteId")}function ot(){var l;let e=i.useContext(G),t=rt("useRouteError"),n=Q("useRouteError");return e!==void 0?e:(l=t.errors)==null?void 0:l[n]}function it(){let{router:e}=nt("useNavigate"),t=Q("useNavigate"),n=i.useRef(!1);return de(()=>{n.current=!0}),i.useCallback(async(r,a={})=>{R(n.current,he),n.current&&(typeof r=="number"?e.navigate(r):await e.navigate(r,{fromRouteId:t,...a}))},[e,t])}var re={};function me(e,t,n){!t&&!re[e]&&(re[e]=!0,R(!1,n))}i.memo(ut);function ut({routes:e,future:t,state:n}){return Ge(e,void 0,n,t)}function Vt({basename:e,children:t,initialEntries:n,initialIndex:l}){let r=i.useRef();r.current==null&&(r.current=Ce({initialEntries:n,initialIndex:l,v5Compat:!0}));let a=r.current,[s,c]=i.useState({action:a.action,location:a.location}),o=i.useCallback(u=>{i.startTransition(()=>c(u))},[c]);return i.useLayoutEffect(()=>a.listen(o),[a,o]),i.createElement(st,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:a})}function st({basename:e="/",children:t=null,location:n,navigationType:l="POP",navigator:r,static:a=!1}){C(!A(),"You cannot render a inside another . You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),c=i.useMemo(()=>({basename:s,navigator:r,static:a,future:{}}),[s,r,a]);typeof n=="string"&&(n=I(n));let{pathname:o="/",search:u="",hash:f="",state:d=null,key:p="default"}=n,h=i.useMemo(()=>{let m=S(o,s);return m==null?null:{location:{pathname:m,search:u,hash:f,state:d,key:p},navigationType:l}},[s,o,u,f,d,p,l]);return R(h!=null,` is not able to match the URL "${o}${u}${f}" because it does not start with the basename, so the won't render anything.`),h==null?null:i.createElement(P.Provider,{value:c},i.createElement(K.Provider,{children:t,value:h}))}var H="get",_="application/x-www-form-urlencoded";function Y(e){return e!=null&&typeof e.tagName=="string"}function ct(e){return Y(e)&&e.tagName.toLowerCase()==="button"}function ft(e){return Y(e)&&e.tagName.toLowerCase()==="form"}function ht(e){return Y(e)&&e.tagName.toLowerCase()==="input"}function dt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function mt(e,t){return e.button===0&&(!t||t==="_self")&&!dt(e)}var W=null;function pt(){if(W===null)try{new FormData(document.createElement("form"),0),W=!1}catch{W=!0}return W}var gt=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function q(e){return e!=null&&!gt.has(e)?(R(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${_}"`),null):e}function yt(e,t){let n,l,r,a,s;if(ft(e)){let c=e.getAttribute("action");l=c?S(c,t):null,n=e.getAttribute("method")||H,r=q(e.getAttribute("enctype"))||_,a=new FormData(e)}else if(ct(e)||ht(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a