import{r as e}from"./jsx-runtime-BnbLqBWP.js";import{j as t,D as r,k as n,A as a,l as o,d as i,n as l,o as s,p as u,q as c,L as d,F as f,h as m,N as h}from"./index-C4j0XBvN.js";import{p,k as y,D as w,i as v,f as g,r as E,E as x,m as S}from"./router-BXPf1XsM.js";import{d as _,S as b}from"./single-fetch-vTdWVr6V.js"; /** * @remix-run/react v2.15.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;t{}))}} /** * @remix-run/react v2.15.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function O(e,t,r){let n=e.map((e=>{var n;let a=t[e.route.id],o=r.routes[e.route.id];return[o.css?o.css.map((e=>({rel:"stylesheet",href:e}))):[],(null==a||null===(n=a.links)||void 0===n?void 0:n.call(a))||[]]})).flat(2),a=function(e,t){return M(e.map((e=>{let r=t.routes[e.route.id],n=[r.module];return r.imports&&(n=n.concat(r.imports)),n})).flat(1))}(e,r);return T(n,a)}async function j(e,t){var r,n;if(!e.css&&!t.links||!function(){if(void 0!==F)return F;let e=document.createElement("link");return F=e.relList.supports("preload"),e=null,F} /** * @remix-run/react v2.15.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */())return;let a=[(null===(r=e.css)||void 0===r?void 0:r.map((e=>({rel:"stylesheet",href:e}))))??[],(null===(n=t.links)||void 0===n?void 0:n.call(t))??[]].flat(1);if(0===a.length)return;let o=[];for(let l of a)C(l)||"stylesheet"!==l.rel||o.push({...l,rel:"preload",as:"style"});let i=o.filter((e=>(!e.media||window.matchMedia(e.media).matches)&&!document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`)));await Promise.all(i.map($))}async function $(e){return new Promise((t=>{let r=document.createElement("link");function n(){document.head.contains(r)&&document.head.removeChild(r)}Object.assign(r,e),r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)}))}function C(e){return null!=e&&"string"==typeof e.page}function N(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function A(e,t,r,n,a,o,i){let l=P(e),s=(e,t)=>!r[t]||e.route.id!==r[t].route.id,u=(e,t)=>{var n;return r[t].pathname!==e.pathname||(null===(n=r[t].route.path)||void 0===n?void 0:n.endsWith("*"))&&r[t].params["*"]!==e.params["*"]};return"data"!==i||!o.v3_singleFetch&&a.search===l.search?t.filter(((e,t)=>{let r=n.routes[e.route.id];return("assets"===i||r.hasLoader)&&(s(e,t)||u(e,t))})):t.filter(((t,i)=>{if(!n.routes[t.route.id].hasLoader)return!1;if(s(t,i)||u(t,i))return!0;let c=o.v3_singleFetch||a.search!==l.search;if(t.route.shouldRevalidate){var d;let n=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:(null===(d=r[0])||void 0===d?void 0:d.params)||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:c});if("boolean"==typeof n)return n}return c}))}function M(e){return[...new Set(e)]}function T(e,t){let r=new Set,n=new Set(t);return e.reduce(((e,a)=>{if(t&&!C(a)&&"script"===a.as&&a.href&&n.has(a.href))return e;let o=JSON.stringify(function(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}(a));return r.has(o)||(r.add(o),e.push({key:o,link:a})),e}),[])}function P(e){let t=p(e);return void 0===t.search&&(t.search=""),t}let F;const D={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},J=/[&><\u2028\u2029]/g;function I(e){return e.replace(J,(e=>D[e]))}function z(e){return{__html:e}} /** * @remix-run/react v2.15.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function H(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}async function U(e,t,r=0){let n=new URL(e.url);n.searchParams.set("_data",t),r>0&&await new Promise((e=>setTimeout(e,5**r*10)));let a=await X(e),o=window.__remixRevalidation,i=await fetch(n.href,a).catch((n=>{if("number"==typeof o&&o===window.__remixRevalidation&&"TypeError"===(null==n?void 0:n.name)&&r<3)return U(e,t,r+1);throw n}));if(function(e){return null!=e.headers.get("X-Remix-Error")}(i)){let e=await i.json(),t=new Error(e.message);return t.stack=e.stack,t}if(function(e){return H(e)&&e.status>=400&&null==e.headers.get("X-Remix-Error")&&null==e.headers.get("X-Remix-Catch")&&null==e.headers.get("X-Remix-Response")}(i)){let e=await i.text(),t=new Error(e);return t.stack=void 0,t}return i}async function X(e){let t={signal:e.signal};if("GET"!==e.method){t.method=e.method;let r=e.headers.get("Content-Type");r&&/\bapplication\/json\b/.test(r)?(t.headers={"Content-Type":r},t.body=JSON.stringify(await e.json())):r&&/\btext\/plain\b/.test(r)?(t.headers={"Content-Type":r},t.body=await e.text()):r&&/\bapplication\/x-www-form-urlencoded\b/.test(r)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}async function q(e){if(!e)throw new Error("parseDeferredReadableStream requires stream argument");let t,r={};try{let n=async function*(e){let t=e.getReader(),r=[],n=[],a=!1,o=new TextEncoder,i=new TextDecoder,l=async()=>{if(n.length>0)return n.shift();for(;!a&&0===n.length;){let e=await t.read();if(e.done){a=!0;break}r.push(e.value);try{let e=i.decode(B(...r)).split("\n\n");if(e.length>=2&&(n.push(...e.slice(0,-1)),r=[o.encode(e.slice(-1).join("\n\n"))]),n.length>0)break}catch{continue}}if(n.length>0)return n.shift();if(r.length>0){let e=i.decode(B(...r));n=e.split("\n\n").filter((e=>e)),r=[]}return n.shift()},s=await l();for(;s;)yield s,s=await l()}(e),a=(await n.next()).value;if(!a)throw new Error("no critical data");let o=JSON.parse(a);if("object"==typeof o&&null!==o)for(let[e,i]of Object.entries(o))"string"==typeof i&&i.startsWith("__deferred_promise:")&&(t=t||{},t[e]=new Promise(((t,n)=>{r[e]={resolve:n=>{t(n),delete r[e]},reject:t=>{n(t),delete r[e]}}})));return(async()=>{try{for await(let e of n){let[t,...n]=e.split(":"),a=n.join(":"),o=JSON.parse(a);if("data"===t)for(let[e,i]of Object.entries(o))r[e]&&r[e].resolve(i);else if("error"===t)for(let[e,i]of Object.entries(o)){let t=new Error(i.message);t.stack=i.stack,r[e]&&r[e].reject(t)}}for(let[e,t]of Object.entries(r))t.reject(new y(`Deferred ${e} will never be resolved`))}catch(e){for(let t of Object.values(r))t.reject(e)}})(),new w({...o,...t})}catch(n){for(let e of Object.values(r))e.reject(n);throw n}}function B(...e){let t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t} /** * @remix-run/react v2.15.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function K(e,t,r){return async({request:n,matches:a,fetcherKey:o})=>"GET"!==n.method?async function(e,t){let r=t.find((e=>e.shouldLoad));k(r,"No action match found");let n,a=await r.resolve((async t=>await t((async()=>{let t=G(e.url),a=await X(e),{data:o,status:i}=await Q(t,a);return n=i,ee(o,r.route.id)}))));if(H(a.result)||v(a.result))return{[r.route.id]:a};return{[r.route.id]:{type:a.type,result:g(a.result,n)}}}(n,a):o?async function(e,t){let r=t.find((e=>e.shouldLoad));k(r,"No fetcher match found");let n=await r.resolve((async t=>W(t,Y(G(e.url)),await X(e),r.route.id)));return{[r.route.id]:n}}(n,a):async function(e,t,r,n,a){let o=new Set,i=!1,l=a.map((()=>te())),s=Promise.all(l.map((e=>e.promise))),u=te(),c=Y(G(n.url)),d=await X(n),f={},m=Promise.all(a.map((async(n,a)=>n.resolve((async s=>{if(l[a].resolve(),!n.shouldLoad){var m;if(!r.state.initialized)return;if(n.route.id in r.state.loaderData&&e.routes[n.route.id].hasLoader&&null!==(m=t[n.route.id])&&void 0!==m&&m.shouldRevalidate)return void(i=!0)}if(e.routes[n.route.id].hasClientLoader){e.routes[n.route.id].hasLoader&&(i=!0);try{let e=await W(s,c,d,n.route.id);f[n.route.id]={type:"data",result:e}}catch(h){f[n.route.id]={type:"error",result:h}}}else{e.routes[n.route.id].hasLoader&&o.add(n.route.id);try{let e=await s((async()=>Z(await u.promise,n.route.id)));f[n.route.id]={type:"data",result:e}}catch(h){f[n.route.id]={type:"error",result:h}}}})))));if(await s,r.state.initialized&&0!==o.size||window.__remixHdrActive)try{i&&o.size>0&&c.searchParams.set("_routes",a.filter((e=>o.has(e.route.id))).map((e=>e.route.id)).join(","));let e=await Q(c,d);u.resolve(e.data)}catch(h){u.reject(h)}else u.resolve({});return await m,f}(e,t,r(),n,a)}function W(e,t,r,n){return e((async()=>{let e=new URL(t);e.searchParams.set("_routes",n);let{data:a}=await Q(e,r);return Z(a,n)}))}function Y(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let n of t)n&&r.push(n);for(let n of r)e.searchParams.append("index",n);return e}function G(e){let t="string"==typeof e?new URL(e,window.location.origin):e;return"/"===t.pathname?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}async function Q(e,t){let r=await fetch(e,t);if(new Set([100,101,204,205]).has(r.status))return t.method&&"GET"!==t.method?{status:r.status,data:{data:null}}:{status:r.status,data:{}};k(r.body,"No response body to decode");try{let e=await V(r.body,window);return{status:r.status,data:e.value}}catch(n){throw console.error(n),new Error(`Unable to decode turbo-stream response from URL: ${e.toString()}`)}}function V(e,t){return _(e,{plugins:[(e,...r)=>{if("SanitizedError"===e){let[e,n,a]=r,o=Error;e&&e in t&&"function"==typeof t[e]&&(o=t[e]);let i=new o(n);return i.stack=a,{value:i}}if("ErrorResponse"===e){let[e,t,n]=r;return{value:new x(t,n,e)}}if("SingleFetchRedirect"===e)return{value:{[b]:r[0]}}},(e,t)=>"SingleFetchFallback"===e?{value:void 0}:"SingleFetchClassInstance"===e?{value:t}:void 0]})}function Z(e,t){let r=e[b];return r?ee(r,t):void 0!==e[t]?ee(e[t],t):null}function ee(e,t){if("error"in e)throw e.error;if("redirect"in e){let t={};throw e.revalidate&&(t["X-Remix-Revalidate"]="yes"),e.reload&&(t["X-Remix-Reload-Document"]="yes"),e.replace&&(t["X-Remix-Replace"]="yes"),E(e.redirect,{status:e.status,headers:t})}if("data"in e)return e.data;throw new Error(`No response found for routeId "${t}"`)}function te(){let e,t,r=new Promise(((n,a)=>{e=async e=>{n(e);try{await r}catch(t){}},t=async e=>{a(e);try{await r}catch(t){}}}));return{promise:r,resolve:e,reject:t}} /** * @remix-run/react v2.15.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */class re extends e.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?e.createElement(ne,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}}function ne({error:t,isOutsideRemixApp:r}){console.error(t);let n,a=e.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://remix.run/guides/errors for more information."\n );\n '}});if(v(t))return e.createElement(ae,{title:"Unhandled Thrown Response!"},e.createElement("h1",{style:{fontSize:"24px"}},t.status," ",t.statusText),a);if(t instanceof Error)n=t;else{let e=null==t?"Unknown Error":"object"==typeof t&&"toString"in t?t.toString():JSON.stringify(t);n=new Error(e)}return e.createElement(ae,{title:"Application Error!",isOutsideRemixApp:r},e.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),e.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),a)}function ae({title:t,renderScripts:r,isOutsideRemixApp:n,children:a}){var o;let{routeModules:i}=be();return null!==(o=i.root)&&void 0!==o&&o.Layout&&!n?a:e.createElement("html",{lang:"en"},e.createElement("head",null,e.createElement("meta",{charSet:"utf-8"}),e.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),e.createElement("title",null,t)),e.createElement("body",null,e.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},a,r?e.createElement(Ie,null):null)))} /** * @remix-run/react v2.15.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function oe(){return e.createElement(ae,{title:"Loading...",renderScripts:!0},e.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "💿 Hey developer 👋. You can provide a way better UX than this " +\n "when your app is loading JS modules and/or running `clientLoader` " +\n "functions. Check out https://remix.run/route/hydrate-fallback " +\n "for more information."\n );\n '}}))} /** * @remix-run/react v2.15.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function ie(e){let t={};return Object.values(e).forEach((e=>{let r=e.parentId||"";t[r]||(t[r]=[]),t[r].push(e)})),t}function le(r,n,a){let o=me(n),i=!n.HydrateFallback||a&&"root"!==r.id?"root"===r.id?oe:void 0:n.HydrateFallback,l=n.ErrorBoundary?n.ErrorBoundary:"root"===r.id?()=>e.createElement(ne,{error:t()}):void 0;return"root"===r.id&&n.Layout?{...o?{element:e.createElement(n.Layout,null,e.createElement(o,null))}:{Component:o},...l?{errorElement:e.createElement(n.Layout,null,e.createElement(l,null))}:{ErrorBoundary:l},...i?{hydrateFallbackElement:e.createElement(n.Layout,null,e.createElement(i,null))}:{HydrateFallback:i}}:{Component:o,ErrorBoundary:l,HydrateFallback:i}}function se(e,t,r,n,a,o){return de(t,r,n,a,o,"",ie(t),e)}function ue(e,t,r){if(r){let r=`You cannot call ${"action"===e?"serverAction()":"serverLoader()"} in SPA Mode (routeId: "${t.id}")`;throw console.error(r),new x(400,"Bad Request",new Error(r),!0)}let n=`You are trying to call ${"action"===e?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;if("loader"===e&&!t.hasLoader||"action"===e&&!t.hasAction)throw console.error(n),new x(400,"Bad Request",new Error(n),!0)}function ce(e,t){let r="clientAction"===e?"a":"an",n=`Route "${t}" does not have ${r} ${e}, but you are trying to submit to it. To fix this, please add ${r} \`${e}\` function to the route`;throw console.error(n),new x(405,"Method Not Allowed",new Error(n),!0)}function de(e,t,r,n,a,o="",i=ie(e),l){return(i[o]||[]).map((o=>{let s=t[o.id];async function u(e,t,r){if("function"==typeof r){return await r()}let n=await async function(e,t){let r=await U(e,t.id);if(r instanceof Error)throw r;if(n=r,null!=n.headers.get("X-Remix-Redirect"))throw function(e){let t=parseInt(e.headers.get("X-Remix-Status"),10)||302,r=e.headers.get("X-Remix-Redirect"),n={},a=e.headers.get("X-Remix-Revalidate");a&&(n["X-Remix-Revalidate"]=a);let o=e.headers.get("X-Remix-Reload-Document");o&&(n["X-Remix-Reload-Document"]=o);let i=e.headers.get("X-Remix-Replace");i&&(n["X-Remix-Replace"]=i);return E(r,{status:t,headers:n})}(r);var n;if(function(e){return null!=e.headers.get("X-Remix-Catch")}(r))throw r;if(function(e){var t;return!(null===(t=e.headers.get("Content-Type"))||void 0===t||!t.match(/text\/remix-deferred/))}(r)&&r.body)return await q(r.body);return r}(e,o);return t?function(e){if(function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(e))return e.data;if(H(e)){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.json():e.text()}return e}(n):n}function c(e,t,r){return o.hasLoader?u(e,t,r):Promise.resolve(null)}function d(e,t,r){if(!o.hasAction)throw ce("action",o.id);return u(e,t,r)}async function f(e){let r=t[o.id],n=r?j(o,r):Promise.resolve();try{return e()}finally{await n}}let m={id:o.id,index:o.index,path:o.path};if(s){var h,p,y;Object.assign(m,{...m,...le(o,s,a),handle:s.handle,shouldRevalidate:fe(n,s,o.id,l)});let e=null==r||null===(h=r.loaderData)||void 0===h?void 0:h[o.id],t=null==r||null===(p=r.errors)||void 0===p?void 0:p[o.id],i=null==l&&(!0===(null===(y=s.clientLoader)||void 0===y?void 0:y.hydrate)||!o.hasLoader);m.loader=async({request:r,params:n},l)=>{try{return await f((async()=>(k(s,"No `routeModule` available for critical-route loader"),s.clientLoader?s.clientLoader({request:r,params:n,async serverLoader(){if(ue("loader",o,a),i){if(void 0!==e)return e;if(void 0!==t)throw t;return null}return c(r,!0,l)}}):a?null:c(r,!1,l))))}finally{i=!1}},m.loader.hydrate=he(o,s,a),m.action=({request:e,params:t},r)=>f((async()=>{if(k(s,"No `routeModule` available for critical-route action"),!s.clientAction){if(a)throw ce("clientAction",o.id);return d(e,!1,r)}return s.clientAction({request:e,params:t,serverAction:async()=>(ue("action",o,a),d(e,!0,r))})}))}else o.hasClientLoader||(m.loader=({request:e},t)=>f((()=>a?Promise.resolve(null):c(e,!1,t)))),o.hasClientAction||(m.action=({request:e},t)=>f((()=>{if(a)throw ce("clientAction",o.id);return d(e,!1,t)}))),m.lazy=async()=>{let e=await async function(e,t){let r=await L(e,t);return await j(e,r),{Component:me(r),ErrorBoundary:r.ErrorBoundary,clientAction:r.clientAction,clientLoader:r.clientLoader,handle:r.handle,links:r.links,meta:r.meta,shouldRevalidate:r.shouldRevalidate}}(o,t),r={...e};if(e.clientLoader){let t=e.clientLoader;r.loader=(e,r)=>t({...e,serverLoader:async()=>(ue("loader",o,a),c(e.request,!0,r))})}if(e.clientAction){let t=e.clientAction;r.action=(e,r)=>t({...e,serverAction:async()=>(ue("action",o,a),d(e.request,!0,r))})}return{...r.loader?{loader:r.loader}:{},...r.action?{action:r.action}:{},hasErrorBoundary:r.hasErrorBoundary,shouldRevalidate:fe(n,r,o.id,l),handle:r.handle,Component:r.Component,ErrorBoundary:r.ErrorBoundary}};let w=de(e,t,r,n,a,o.id,i,l);return w.length>0&&(m.children=w),m}))}function fe(e,t,r,n){if(n)return function(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}(r,t.shouldRevalidate,n);if(e.v3_singleFetch&&t.shouldRevalidate){let e=t.shouldRevalidate;return t=>e({...t,defaultShouldRevalidate:!0})}return t.shouldRevalidate}function me(e){if(null==e.default)return;return"object"==typeof e.default&&0===Object.keys(e.default).length?void 0:e.default}function he(e,t,r){return r&&"root"!==e.id||null!=t.clientLoader&&(!0===t.clientLoader.hydrate||!0!==e.hasLoader)} /** * @remix-run/react v2.15.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */const pe=new Set,ye=new Set;function we(e,t){return!0===e.v3_lazyRouteDiscovery&&!t}function ve(e,t,r,n,a){if(we(r,n))return async({path:o,patch:i,signal:l})=>{ye.has(o)||await Ee([o],e,t,r,n,a,i,l)}}function ge(t,r,n,a,o){e.useEffect((()=>{var e;if(!we(a,o)||!0===(null===(e=navigator.connection)||void 0===e?void 0:e.saveData))return;function i(e){let t="FORM"===e.tagName?e.getAttribute("action"):e.getAttribute("href");if(!t)return;let r=new URL(t,window.location.origin);ye.has(r.pathname)||pe.add(r.pathname)}async function l(){let e=Array.from(pe.keys()).filter((e=>!ye.has(e)||(pe.delete(e),!1)));if(0!==e.length)try{await Ee(e,r,n,a,o,t.basename,t.patchRoutes)}catch(i){console.error("Failed to fetch manifest patches",i)}}document.body.querySelectorAll("a[data-discover], form[data-discover]").forEach((e=>i(e))),l();let s=function(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout((()=>e(...n)),t)}}(l,100);let u=new MutationObserver((e=>{let t=new Set;e.forEach((e=>{[e.target,...e.addedNodes].forEach((e=>{(function(e){return e.nodeType===Node.ELEMENT_NODE})(e)&&(("A"===e.tagName&&e.getAttribute("data-discover")||"FORM"===e.tagName&&e.getAttribute("data-discover"))&&t.add(e),"A"!==e.tagName&&e.querySelectorAll("a[data-discover], form[data-discover]").forEach((e=>t.add(e))))}))})),t.forEach((e=>i(e))),s()}));return u.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>u.disconnect()}),[a,o,r,n,t])}async function Ee(e,t,r,n,a,o,i,l){let s,u=`${o??"/"}/__manifest`.replace(/\/+/g,"/"),c=new URL(u,window.location.origin);if(e.sort().forEach((e=>c.searchParams.append("p",e))),c.searchParams.set("version",t.version),c.toString().length>7680)return void pe.clear();try{let e=await fetch(c,{signal:l});if(!e.ok)throw new Error(`${e.status} ${e.statusText}`);if(e.status>=400)throw new Error(await e.text());s=await e.json()}catch(h){if(null!=l&&l.aborted)return;throw h}let d=new Set(Object.keys(t.routes)),f=Object.values(s).reduce(((e,t)=>d.has(t.id)?e:Object.assign(e,{[t.id]:t})),{});Object.assign(t.routes,f),e.forEach((e=>function(e,t){if(t.size>=1e3){let e=t.values().next().value;"string"==typeof e&&t.delete(e)}t.add(e)}(e,ye)));let m=new Set;Object.values(f).forEach((e=>{e.parentId&&f[e.parentId]||m.add(e.parentId)})),m.forEach((e=>i(e||null,de(f,r,null,n,a,e))))}function xe(){let t=e.useContext(r);return k(t,"You must render this element inside a element"),t}function Se(){let t=e.useContext(n);return k(t,"You must render this element inside a element"),t}const _e=e.createContext(void 0);function be(){let t=e.useContext(_e);return k(t,"You must render this element inside a element"),t}function Re(t,r){let[n,a]=e.useState(!1),[o,i]=e.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=r,f=e.useRef(null);e.useEffect((()=>{if("render"===t&&i(!0),"viewport"===t){let e=new IntersectionObserver((e=>{e.forEach((e=>{i(e.isIntersecting)}))}),{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}}),[t]);let m=()=>{"intent"===t&&a(!0)},h=()=>{"intent"===t&&(a(!1),i(!1))};return e.useEffect((()=>{if(n){let e=setTimeout((()=>{i(!0)}),100);return()=>{clearTimeout(e)}}}),[n]),[o,f,{onFocus:Ce(l,m),onBlur:Ce(s,h),onMouseEnter:Ce(u,m),onMouseLeave:Ce(c,h),onTouchStart:Ce(d,m)}]}_e.displayName="Remix";const ke=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Le(e,t,r){return"render"!==e||t||r?void 0:"true"}let Oe=e.forwardRef((({to:t,prefetch:r="none",discover:n="render",...a},o)=>{let i="string"==typeof t&&ke.test(t),l=c(t),[s,u,d]=Re(r,a);return e.createElement(e.Fragment,null,e.createElement(h,R({},a,d,{ref:Ke(o,u),to:t,"data-discover":Le(n,i,a.reloadDocument)})),s&&!i?e.createElement(Me,{page:l}):null)}));Oe.displayName="NavLink";let je=e.forwardRef((({to:t,prefetch:r="none",discover:n="render",...a},o)=>{let i="string"==typeof t&&ke.test(t),l=c(t),[s,u,f]=Re(r,a);return e.createElement(e.Fragment,null,e.createElement(d,R({},a,f,{ref:Ke(o,u),to:t,"data-discover":Le(n,i,a.reloadDocument)})),s&&!i?e.createElement(Me,{page:l}):null)}));je.displayName="Link";let $e=e.forwardRef((({discover:t="render",...r},n)=>{let a="string"==typeof r.action&&ke.test(r.action);return e.createElement(f,R({},r,{ref:n,"data-discover":Le(t,a,r.reloadDocument)}))}));function Ce(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Ne(e,t,r){if(r&&!Je)return[e[0]];if(t){let r=e.findIndex((e=>void 0!==t[e.route.id]));return e.slice(0,r+1)}return e}function Ae(){let{isSpaMode:t,manifest:r,routeModules:n,criticalCss:a}=be(),{errors:o,matches:i}=Se(),l=Ne(i,o,t),s=e.useMemo((()=>O(l,n,r)),[l,n,r]);return e.createElement(e.Fragment,null,a?e.createElement("style",{dangerouslySetInnerHTML:{__html:a}}):null,s.map((({key:t,link:r})=>C(r)?e.createElement(Me,R({key:t},r)):e.createElement("link",R({key:t},r)))))}function Me({page:t,...r}){let{router:n}=xe(),a=e.useMemo((()=>S(n.routes,t,n.basename)),[n.routes,t,n.basename]);return a?e.createElement(Pe,R({page:t,matches:a},r)):(console.warn(`Tried to prefetch ${t} but no routes matched.`),null)}function Te(t){let{manifest:r,routeModules:n}=be(),[a,o]=e.useState([]);return e.useEffect((()=>{let e=!1;return async function(e,t,r){return T((await Promise.all(e.map((async e=>{let n=await L(t.routes[e.route.id],r);return n.links?n.links():[]})))).flat(1).filter(N).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}(t,r,n).then((t=>{e||o(t)})),()=>{e=!0}}),[t,r,n]),a}function Pe({page:t,matches:r,...n}){let a=i(),{future:o,manifest:l,routeModules:s}=be(),{loaderData:u,matches:c}=Se(),d=e.useMemo((()=>A(t,r,c,l,a,o,"data")),[t,r,c,l,a,o]),f=e.useMemo((()=>{if(!o.v3_singleFetch)return function(e,t,r){let n=P(e);return M(t.filter((e=>r.routes[e.route.id].hasLoader&&!r.routes[e.route.id].hasClientLoader)).map((e=>{let{pathname:t,search:r}=n,a=new URLSearchParams(r);return a.set("_data",e.route.id),`${t}?${a}`})))}(t,d,l);if(t===a.pathname+a.search+a.hash)return[];let e=new Set,n=!1;if(r.forEach((t=>{var r;l.routes[t.route.id].hasLoader&&(!d.some((e=>e.route.id===t.route.id))&&t.route.id in u&&null!==(r=s[t.route.id])&&void 0!==r&&r.shouldRevalidate||l.routes[t.route.id].hasClientLoader?n=!0:e.add(t.route.id))})),0===e.size)return[];let i=G(t);return n&&e.size>0&&i.searchParams.set("_routes",r.filter((t=>e.has(t.route.id))).map((e=>e.route.id)).join(",")),[i.pathname+i.search]}),[o.v3_singleFetch,u,a,l,d,r,t,s]),m=e.useMemo((()=>A(t,r,c,l,a,o,"assets")),[t,r,c,l,a,o]),h=e.useMemo((()=>function(e,t){return M(e.map((e=>{let r=t.routes[e.route.id],n=[r.module];return r.imports&&(n=n.concat(r.imports)),n})).flat(1))}(m,l)),[m,l]),p=Te(m);return e.createElement(e.Fragment,null,f.map((t=>e.createElement("link",R({key:t,rel:"prefetch",as:"fetch",href:t},n)))),h.map((t=>e.createElement("link",R({key:t,rel:"modulepreload",href:t},n)))),p.map((({key:t,link:r})=>e.createElement("link",R({key:t},r)))))}function Fe(){let{isSpaMode:t,routeModules:r}=be(),{errors:n,matches:a,loaderData:o}=Se(),l=i(),s=Ne(a,n,t),u=null;n&&(u=n[s[s.length-1].route.id]);let c=[],d=null,f=[];for(let e=0;e{if(!t)return null;if("tagName"in t){let{tagName:r,...n}=t;if(!function(e){return"string"==typeof e&&/^(meta|link)$/.test(e)}(r))return console.warn(`A meta object uses an invalid tagName: ${r}. Expected either 'link' or 'meta'`),null;let a=r;return e.createElement(a,R({key:JSON.stringify(n)},n))}if("title"in t)return e.createElement("title",{key:"title"},String(t.title));if("charset"in t&&(t.charSet??(t.charSet=t.charset),delete t.charset),"charSet"in t&&null!=t.charSet)return"string"==typeof t.charSet?e.createElement("meta",{key:"charSet",charSet:t.charSet}):null;if("script:ld+json"in t)try{let r=JSON.stringify(t["script:ld+json"]);return e.createElement("script",{key:`script:ld+json:${r}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:r}})}catch(r){return null}return e.createElement("meta",R({key:JSON.stringify(t)},t))})))}function De(t){return e.createElement(a,t)}$e.displayName="Form";let Je=!1;function Ie(t){let{manifest:r,serverHandoffString:n,abortDelay:a,serializeError:o,isSpaMode:i,future:l,renderMeta:s}=be(),{router:u,static:c,staticContext:d}=xe(),{matches:f}=Se(),m=we(l,i);s&&(s.didRenderScripts=!0);let h=Ne(f,null,i);e.useEffect((()=>{Je=!0}),[]);let p=(e,t)=>{let r;return r=o&&t instanceof Error?o(t):t,`${JSON.stringify(e)}:__remixContext.p(!1, ${I(JSON.stringify(r))})`},y=(e,t,r)=>{let n;return n=o&&r instanceof Error?o(r):r,`__remixContext.r(${JSON.stringify(e)}, ${JSON.stringify(t)}, !1, ${I(JSON.stringify(n))})`},w=(e,t,r)=>{let n;try{n=JSON.stringify(r)}catch(a){return y(e,t,a)}return`__remixContext.r(${JSON.stringify(e)}, ${JSON.stringify(t)}, ${I(n)})`},v=[],g=e.useMemo((()=>{var o;let i=l.v3_singleFetch?"window.__remixContext.stream = new ReadableStream({start(controller){window.__remixContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());":"",s=d?`window.__remixContext = ${n};${i}`:" ",f=l.v3_singleFetch||null==d?void 0:d.activeDeferreds;s+=f?["__remixContext.p = function(v,e,p,x) {"," if (typeof e !== 'undefined') {",' x=new Error("Unexpected Server Error");\n x.stack=undefined;'," p=Promise.reject(x);"," } else {"," p=Promise.resolve(v);"," }"," return p;","};","__remixContext.n = function(i,k) {"," __remixContext.t = __remixContext.t || {};"," __remixContext.t[i] = __remixContext.t[i] || {};"," let p = new Promise((r, e) => {__remixContext.t[i][k] = {r:(v)=>{r(v);},e:(v)=>{e(v);}};});","number"==typeof a?`setTimeout(() => {if(typeof p._error !== "undefined" || typeof p._data !== "undefined"){return;} __remixContext.t[i][k].e(new Error("Server timeout."))}, ${a});`:""," return p;","};","__remixContext.r = function(i,k,v,e,p,x) {"," p = __remixContext.t[i][k];"," if (typeof e !== 'undefined') {",' x=new Error("Unexpected Server Error");\n x.stack=undefined;'," p.e(x);"," } else {"," p.r(v);"," }","};"].join("\n")+Object.entries(f).map((([r,n])=>{let a=new Set(n.pendingKeys),o=n.deferredKeys.map((o=>{if(a.has(o))return v.push(e.createElement(ze,{key:`${r} | ${o}`,deferredData:n,routeId:r,dataKey:o,scriptProps:t,serializeData:w,serializeError:y})),`${JSON.stringify(o)}:__remixContext.n(${JSON.stringify(r)}, ${JSON.stringify(o)})`;{let e=n.data[o];return void 0!==e._error?p(o,e._error):((e,t,r)=>{let n;try{n=JSON.stringify(r)}catch(a){return p(t,a)}return`${JSON.stringify(t)}:__remixContext.p(${I(n)})`})(0,o,e._data)}})).join(",\n");return`Object.assign(__remixContext.state.loaderData[${JSON.stringify(r)}], {${o}});`})).join("\n")+(v.length>0?`__remixContext.a=${v.length};`:""):"";let g=c?`${null!==(o=r.hmr)&&void 0!==o&&o.runtime?`import ${JSON.stringify(r.hmr.runtime)};`:""}${m?"":`import ${JSON.stringify(r.url)}`};\n${h.map(((e,t)=>`import * as route${t} from ${JSON.stringify(r.routes[e.route.id].module)};`)).join("\n")}\n${m?`window.__remixManifest = ${JSON.stringify(function(e,t){let r=new Set(t.state.matches.map((e=>e.route.id))),n=t.state.location.pathname.split("/").filter(Boolean),a=["/"];for(n.pop();n.length>0;)a.push(`/${n.join("/")}`),n.pop();a.forEach((e=>{let n=S(t.routes,e,t.basename);n&&n.forEach((e=>r.add(e.route.id)))}));let o=[...r].reduce(((t,r)=>Object.assign(t,{[r]:e.routes[r]})),{});return{...e,routes:o}}(r,u),null,2)};`:""}\nwindow.__remixRouteModules = {${h.map(((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`)).join(",")}};\n\nimport(${JSON.stringify(r.entry.module)});`:" ";return e.createElement(e.Fragment,null,e.createElement("script",R({},t,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:z(s),type:void 0})),e.createElement("script",R({},t,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:z(g),type:"module",async:!0})))}),[]);if(!c&&"object"==typeof __remixContext&&__remixContext.a)for(let S=0;S<__remixContext.a;S++)v.push(e.createElement(ze,{key:S,scriptProps:t,serializeData:w,serializeError:y}));let E=h.map((e=>{let t=r.routes[e.route.id];return(t.imports||[]).concat([t.module])})).flat(1),x=Je?[]:r.entry.imports.concat(E);return Je?null:e.createElement(e.Fragment,null,m?null:e.createElement("link",{rel:"modulepreload",href:r.url,crossOrigin:t.crossOrigin}),e.createElement("link",{rel:"modulepreload",href:r.entry.module,crossOrigin:t.crossOrigin}),(_=x,[...new Set(_)]).map((r=>e.createElement("link",{key:r,rel:"modulepreload",href:r,crossOrigin:t.crossOrigin}))),g,v);var _}function ze({dataKey:t,deferredData:r,routeId:n,scriptProps:a,serializeData:o,serializeError:i}){return"undefined"==typeof document&&r&&t&&n&&k(r.pendingKeys.includes(t),`Deferred data for route ${n} with key ${t} was not pending but tried to render a script for it.`),e.createElement(e.Suspense,{fallback:"undefined"==typeof document&&r&&t&&n?null:e.createElement("script",R({},a,{async:!0,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:" "}}))},"undefined"==typeof document&&r&&t&&n?e.createElement(De,{resolve:r.data[t],errorElement:e.createElement(He,{dataKey:t,routeId:n,scriptProps:a,serializeError:i}),children:r=>e.createElement("script",R({},a,{async:!0,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:o(n,t,r)}}))}):e.createElement("script",R({},a,{async:!0,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:" "}})))}function He({dataKey:t,routeId:r,scriptProps:n,serializeError:a}){let i=o();return e.createElement("script",R({},n,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:a(r,t,i)}}))}function Ue(){return m()}function Xe(){return l()}function qe(){return u()}function Be(e={}){return s(e)}function Ke(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}export{$e as F,je as L,Fe as M,Oe as N,_e as R,Ie as S,R as _,Be as a,qe as b,de as c,V as d,K as e,se as f,ve as g,ge as h,k as i,re as j,Ue as k,be as l,Ae as m,he as s,Xe as u};