Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More

react-router

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router - npm Package Compare versions

Comparing version 0.0.0-experimental-114cf0b7 to 0.0.0-experimental-119d5d872

# `react-router`
## 6.28.1
### Patch Changes
- Allow users to opt out of deprecation warnings by setting flags to false ([#12441](https://github.com/remix-run/react-router/pull/12441))
## 6.28.0
### Minor Changes
- Log deprecation warnings for v7 flags ([#11750](https://github.com/remix-run/react-router/pull/11750))
- Add deprecation warnings to `json`/`defer` in favor of returning raw objects
- These methods will be removed in React Router v7
### Patch Changes
- Update JSDoc URLs for new website structure (add /v6/ segment) ([#12141](https://github.com/remix-run/react-router/pull/12141))
- Updated dependencies:
- `@remix-run/router@1.21.0`
## 6.27.0
### Minor Changes
- Stabilize `unstable_patchRoutesOnNavigation` ([#11973](https://github.com/remix-run/react-router/pull/11973))
- Add new `PatchRoutesOnNavigationFunctionArgs` type for convenience ([#11967](https://github.com/remix-run/react-router/pull/11967))
- Stabilize `unstable_dataStrategy` ([#11974](https://github.com/remix-run/react-router/pull/11974))
- Stabilize the `unstable_flushSync` option for navigations and fetchers ([#11989](https://github.com/remix-run/react-router/pull/11989))
- Stabilize the `unstable_viewTransition` option for navigations and the corresponding `unstable_useViewTransitionState` hook ([#11989](https://github.com/remix-run/react-router/pull/11989))
### Patch Changes
- Fix bug when submitting to the current contextual route (parent route with an index child) when an `?index` param already exists from a prior submission ([#12003](https://github.com/remix-run/react-router/pull/12003))
- Fix `useFormAction` bug - when removing `?index` param it would not keep other non-Remix `index` params ([#12003](https://github.com/remix-run/react-router/pull/12003))
- Fix types for `RouteObject` within `PatchRoutesOnNavigationFunction`'s `patch` method so it doesn't expect agnostic route objects passed to `patch` ([#11967](https://github.com/remix-run/react-router/pull/11967))
- Updated dependencies:
- `@remix-run/router@1.20.0`
## 6.26.2
### Patch Changes
- Updated dependencies:
- `@remix-run/router@1.19.2`
## 6.26.1
### Patch Changes
- Rename `unstable_patchRoutesOnMiss` to `unstable_patchRoutesOnNavigation` to match new behavior ([#11888](https://github.com/remix-run/react-router/pull/11888))
- Updated dependencies:
- `@remix-run/router@1.19.1`
## 6.26.0
### Minor Changes
- Add a new `replace(url, init?)` alternative to `redirect(url, init?)` that performs a `history.replaceState` instead of a `history.pushState` on client-side navigation redirects ([#11811](https://github.com/remix-run/react-router/pull/11811))
### Patch Changes
- Fix initial hydration behavior when using `future.v7_partialHydration` along with `unstable_patchRoutesOnMiss` ([#11838](https://github.com/remix-run/react-router/pull/11838))
- During initial hydration, `router.state.matches` will now include any partial matches so that we can render ancestor `HydrateFallback` components
- Updated dependencies:
- `@remix-run/router@1.19.0`
## 6.25.1
No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/react-router/blob/main/CHANGELOG.md) for an overview of all changes in v6.25.1.
## 6.25.0
### Minor Changes
- Stabilize `future.unstable_skipActionErrorRevalidation` as `future.v7_skipActionErrorRevalidation` ([#11769](https://github.com/remix-run/react-router/pull/11769))
- When this flag is enabled, actions will not automatically trigger a revalidation if they return/throw a `Response` with a `4xx`/`5xx` status code
- You may still opt-into revalidation via `shouldRevalidate`
- This also changes `shouldRevalidate`'s `unstable_actionStatus` parameter to `actionStatus`
### Patch Changes
- Fix regression and properly decode paths inside `useMatch` so matches/params reflect decoded params ([#11789](https://github.com/remix-run/react-router/pull/11789))
- Updated dependencies:
- `@remix-run/router@1.18.0`
## 6.24.1
### Patch Changes
- When using `future.v7_relativeSplatPath`, properly resolve relative paths in splat routes that are children of pathless routes ([#11633](https://github.com/remix-run/react-router/pull/11633))
- Updated dependencies:
- `@remix-run/router@1.17.1`
## 6.24.0
### Minor Changes
- Add support for Lazy Route Discovery (a.k.a. Fog of War) ([#11626](https://github.com/remix-run/react-router/pull/11626))
- RFC: <https://github.com/remix-run/react-router/discussions/11113>
- `unstable_patchRoutesOnMiss` docs: <https://reactrouter.com/v6/routers/create-browser-router>
### Patch Changes
- Updated dependencies:
- `@remix-run/router@1.17.0`
## 6.23.1
### Patch Changes
- allow undefined to be resolved with `<Await>` ([#11513](https://github.com/remix-run/react-router/pull/11513))
- Updated dependencies:
- `@remix-run/router@1.16.1`
## 6.23.0
### Minor Changes
- Add a new `unstable_dataStrategy` configuration option ([#11098](https://github.com/remix-run/react-router/pull/11098))
- This option allows Data Router applications to take control over the approach for executing route loaders and actions
- The default implementation is today's behavior, to fetch all loaders in parallel, but this option allows users to implement more advanced data flows including Remix single-fetch, middleware/context APIs, automatic loader caching, and more
### Patch Changes
- Updated dependencies:
- `@remix-run/router@1.16.0`
## 6.22.3
### Patch Changes
- Updated dependencies:
- `@remix-run/router@1.15.3`
## 6.22.2
### Patch Changes
- Updated dependencies:
- `@remix-run/router@1.15.2`
## 6.22.1
### Patch Changes
- Fix encoding/decoding issues with pre-encoded dynamic parameter values ([#11199](https://github.com/remix-run/react-router/pull/11199))
- Updated dependencies:
- `@remix-run/router@1.15.1`
## 6.22.0
### Patch Changes
- Updated dependencies:
- `@remix-run/router@1.15.0`
## 6.21.3
### Patch Changes
- Remove leftover `unstable_` prefix from `Blocker`/`BlockerFunction` types ([#11187](https://github.com/remix-run/react-router/pull/11187))
## 6.21.2

@@ -186,3 +351,3 @@

- Add `unstable_flushSync` option to `useNavigate`/`useSumbit`/`fetcher.load`/`fetcher.submit` to opt-out of `React.startTransition` and into `ReactDOM.flushSync` for state updates ([#11005](https://github.com/remix-run/react-router/pull/11005))
- Remove the `unstable_` prefix from the [`useBlocker`](https://reactrouter.com/en/main/hooks/use-blocker) hook as it's been in use for enough time that we are confident in the API. We do not plan to remove the prefix from `unstable_usePrompt` due to differences in how browsers handle `window.confirm` that prevent React Router from guaranteeing consistent/correct behavior. ([#10991](https://github.com/remix-run/react-router/pull/10991))
- Remove the `unstable_` prefix from the [`useBlocker`](https://reactrouter.com/v6/hooks/use-blocker) hook as it's been in use for enough time that we are confident in the API. We do not plan to remove the prefix from `unstable_usePrompt` due to differences in how browsers handle `window.confirm` that prevent React Router from guaranteeing consistent/correct behavior. ([#10991](https://github.com/remix-run/react-router/pull/10991))

@@ -277,3 +442,3 @@ ### Patch Changes

- Move [`React.startTransition`](https://react.dev/reference/react/startTransition) usage behind a [future flag](https://reactrouter.com/en/main/guides/api-development-strategy) to avoid issues with existing incompatible `Suspense` usages. We recommend folks adopting this flag to be better compatible with React concurrent mode, but if you run into issues you can continue without the use of `startTransition` until v7. Issues usually boils down to creating net-new promises during the render cycle, so if you run into issues you should either lift your promise creation out of the render cycle or put it behind a `useMemo`. ([#10596](https://github.com/remix-run/react-router/pull/10596))
- Move [`React.startTransition`](https://react.dev/reference/react/startTransition) usage behind a [future flag](https://reactrouter.com/v6/guides/api-development-strategy) to avoid issues with existing incompatible `Suspense` usages. We recommend folks adopting this flag to be better compatible with React concurrent mode, but if you run into issues you can continue without the use of `startTransition` until v7. Issues usually boils down to creating net-new promises during the render cycle, so if you run into issues you should either lift your promise creation out of the render cycle or put it behind a `useMemo`. ([#10596](https://github.com/remix-run/react-router/pull/10596))

@@ -361,3 +526,3 @@ Existing behavior will no longer include `React.startTransition`:

- Added support for [**Future Flags**](https://reactrouter.com/en/main/guides/api-development-strategy) in React Router. The first flag being introduced is `future.v7_normalizeFormMethod` which will normalize the exposed `useNavigation()/useFetcher()` `formMethod` fields as uppercase HTTP methods to align with the `fetch()` behavior. ([#10207](https://github.com/remix-run/react-router/pull/10207))
- Added support for [**Future Flags**](https://reactrouter.com/v6/guides/api-development-strategy) in React Router. The first flag being introduced is `future.v7_normalizeFormMethod` which will normalize the exposed `useNavigation()/useFetcher()` `formMethod` fields as uppercase HTTP methods to align with the `fetch()` behavior. ([#10207](https://github.com/remix-run/react-router/pull/10207))

@@ -639,3 +804,3 @@ - When `future.v7_normalizeFormMethod === false` (default v6 behavior),

Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/start/overview) and the [tutorial](https://reactrouter.com/start/tutorial).
Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/en/6.4.0/start/overview) and the [tutorial](https://reactrouter.com/en/6.4.0/start/tutorial).

@@ -642,0 +807,0 @@ **New APIs**

@@ -1,3 +0,3 @@

import type { ActionFunction, ActionFunctionArgs, Blocker, BlockerFunction, ErrorResponse, Fetcher, HydrationState, InitialEntry, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, Navigation, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, RedirectFunction, RelativeRoutingType, Router as RemixRouter, FutureConfig as RouterFutureConfig, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch } from "@remix-run/router";
import { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, resolvePath } from "@remix-run/router";
import type { ActionFunction, ActionFunctionArgs, AgnosticPatchRoutesOnNavigationFunction, AgnosticPatchRoutesOnNavigationFunctionArgs, Blocker, BlockerFunction, DataStrategyFunction, DataStrategyFunctionArgs, DataStrategyMatch, DataStrategyResult, ErrorResponse, Fetcher, HydrationState, InitialEntry, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, Navigation, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, RedirectFunction, RelativeRoutingType, Router as RemixRouter, FutureConfig as RouterFutureConfig, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch } from "@remix-run/router";
import { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, replace, resolvePath } from "@remix-run/router";
import type { AwaitProps, FutureConfig, IndexRouteProps, LayoutRouteProps, MemoryRouterProps, NavigateProps, OutletProps, PathRouteProps, RouteProps, RouterProps, RouterProviderProps, RoutesProps } from "./lib/components";

@@ -9,7 +9,10 @@ import { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, createRoutesFromChildren, renderMatches } from "./lib/components";

import { useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteId, useRouteLoaderData, useRoutes, useRoutesImpl } from "./lib/hooks";
import { logV6DeprecationWarnings } from "./lib/deprecations";
type Hash = string;
type Pathname = string;
type Search = string;
export type { ActionFunction, ActionFunctionArgs, AwaitProps, DataRouteMatch, DataRouteObject, ErrorResponse, Fetcher, FutureConfig, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LayoutRouteProps, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, Navigator, NonIndexRouteObject, OutletProps, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, PathRouteProps, Pathname, RedirectFunction, RelativeRoutingType, RouteMatch, RouteObject, RouteProps, RouterProps, RouterProviderProps, RoutesProps, Search, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, Blocker, BlockerFunction, };
export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, RouterProvider, Routes, createPath, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, resolvePath, useBlocker, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, };
export type { ActionFunction, ActionFunctionArgs, AwaitProps, DataRouteMatch, DataRouteObject, DataStrategyFunction, DataStrategyFunctionArgs, DataStrategyMatch, DataStrategyResult, ErrorResponse, Fetcher, FutureConfig, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LayoutRouteProps, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, Navigator, NonIndexRouteObject, OutletProps, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, PathRouteProps, Pathname, RedirectFunction, RelativeRoutingType, RouteMatch, RouteObject, RouteProps, RouterProps, RouterProviderProps, RoutesProps, Search, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, Blocker, BlockerFunction, };
export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, RouterProvider, Routes, createPath, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, replace, renderMatches, resolvePath, useBlocker, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, };
export type PatchRoutesOnNavigationFunctionArgs = AgnosticPatchRoutesOnNavigationFunctionArgs<RouteObject, RouteMatch>;
export type PatchRoutesOnNavigationFunction = AgnosticPatchRoutesOnNavigationFunction<RouteObject, RouteMatch>;
declare function mapRouteProperties(route: RouteObject): Partial<RouteObject> & {

@@ -24,4 +27,6 @@ hasErrorBoundary: boolean;

initialIndex?: number;
dataStrategy?: DataStrategyFunction;
patchRoutesOnNavigation?: PatchRoutesOnNavigationFunction;
}): RemixRouter;
/** @internal */
export { DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, };
export { DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, logV6DeprecationWarnings as UNSAFE_logV6DeprecationWarnings, };
/**
* React Router v0.0.0-experimental-114cf0b7
* React Router v0.0.0-experimental-119d5d872
*

@@ -12,4 +12,4 @@ * Copyright (c) Remix Software Inc.

import * as React from 'react';
import { UNSAFE_invariant, joinPaths, matchPath, UNSAFE_getResolveToMatches, UNSAFE_warning, resolveTo, parsePath, matchRoutes, Action, UNSAFE_convertRouteMatchToUiMatch, stripBasename, IDLE_BLOCKER, isRouteErrorResponse, createMemoryHistory, AbortedDeferredError, createRouter } from '@remix-run/router';
export { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, resolvePath } from '@remix-run/router';
import { UNSAFE_invariant, joinPaths, matchPath, UNSAFE_decodePath, UNSAFE_getResolveToMatches, UNSAFE_warning, resolveTo, parsePath, matchRoutes, Action, UNSAFE_convertRouteMatchToUiMatch, stripBasename, IDLE_BLOCKER, isRouteErrorResponse, createMemoryHistory, AbortedDeferredError, createRouter } from '@remix-run/router';
export { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, replace, resolvePath } from '@remix-run/router';

@@ -81,3 +81,3 @@ function _extends() {

*
* @see https://reactrouter.com/hooks/use-href
* @see https://reactrouter.com/v6/hooks/use-href
*/

@@ -121,3 +121,3 @@ function useHref(to, _temp) {

*
* @see https://reactrouter.com/hooks/use-in-router-context
* @see https://reactrouter.com/v6/hooks/use-in-router-context
*/

@@ -136,3 +136,3 @@ function useInRouterContext() {

*
* @see https://reactrouter.com/hooks/use-location
* @see https://reactrouter.com/v6/hooks/use-location
*/

@@ -150,3 +150,3 @@ function useLocation() {

*
* @see https://reactrouter.com/hooks/use-navigation-type
* @see https://reactrouter.com/v6/hooks/use-navigation-type
*/

@@ -162,3 +162,3 @@ function useNavigationType() {

*
* @see https://reactrouter.com/hooks/use-match
* @see https://reactrouter.com/v6/hooks/use-match
*/

@@ -172,3 +172,3 @@ function useMatch(pattern) {

} = useLocation();
return React.useMemo(() => matchPath(pattern, pathname), [pathname, pattern]);
return React.useMemo(() => matchPath(pattern, UNSAFE_decodePath(pathname)), [pathname, pattern]);
}

@@ -197,3 +197,3 @@

*
* @see https://reactrouter.com/hooks/use-navigate
* @see https://reactrouter.com/v6/hooks/use-navigate
*/

@@ -262,3 +262,3 @@ function useNavigate() {

* hierarchy.
* @see https://reactrouter.com/hooks/use-outlet-context
* @see https://reactrouter.com/v6/hooks/use-outlet-context
*/

@@ -273,3 +273,3 @@ function useOutletContext() {

*
* @see https://reactrouter.com/hooks/use-outlet
* @see https://reactrouter.com/v6/hooks/use-outlet
*/

@@ -290,3 +290,3 @@ function useOutlet(context) {

*
* @see https://reactrouter.com/hooks/use-params
* @see https://reactrouter.com/v6/hooks/use-params
*/

@@ -304,3 +304,3 @@ function useParams() {

*
* @see https://reactrouter.com/hooks/use-resolved-path
* @see https://reactrouter.com/v6/hooks/use-resolved-path
*/

@@ -330,3 +330,3 @@ function useResolvedPath(to, _temp2) {

*
* @see https://reactrouter.com/hooks/use-routes
* @see https://reactrouter.com/v6/hooks/use-routes
*/

@@ -408,3 +408,3 @@ function useRoutes(routes, locationArg) {

}
let matches = matchRoutes(routes, {
let matches = dataRouterState && dataRouterState.matches && dataRouterState.matches.length > 0 ? dataRouterState.matches : matchRoutes(routes, {
pathname: remainingPathname

@@ -547,3 +547,3 @@ });

function _renderMatches(matches, parentMatches, dataRouterState, future) {
var _dataRouterState2;
var _dataRouterState;
if (parentMatches === void 0) {

@@ -559,7 +559,18 @@ parentMatches = [];

if (matches == null) {
var _dataRouterState;
if ((_dataRouterState = dataRouterState) != null && _dataRouterState.errors) {
var _future;
if (!dataRouterState) {
return null;
}
if (dataRouterState.errors) {
// Don't bail if we have data router errors so we can render them in the
// boundary. Use the pre-matched (or shimmed) matches
matches = dataRouterState.matches;
} else if ((_future = future) != null && _future.v7_partialHydration && parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) {
// Don't bail if we're initializing with partial hydration and we have
// router matches. That means we're actively running `patchRoutesOnNavigation`
// so we should render down the partial matches to the appropriate
// `HydrateFallback`. We only do this if `parentMatches` is empty so it
// only impacts the root matches for `RouterProvider` and no descendant
// `<Routes>`
matches = dataRouterState.matches;
} else {

@@ -572,5 +583,5 @@ return null;

// If we have data errors, trim matches to the highest error boundary
let errors = (_dataRouterState2 = dataRouterState) == null ? void 0 : _dataRouterState2.errors;
let errors = (_dataRouterState = dataRouterState) == null ? void 0 : _dataRouterState.errors;
if (errors != null) {
let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]));
let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]) !== undefined);
!(errorIndex >= 0) ? process.env.NODE_ENV !== "production" ? UNSAFE_invariant(false, "Could not find a matching route for errors on route IDs: " + Object.keys(errors).join(",")) : UNSAFE_invariant(false) : void 0;

@@ -699,3 +710,3 @@ renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));

function getDataRouterConsoleError(hookName) {
return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
return hookName + " must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.";
}

@@ -930,6 +941,6 @@ function useDataRouterContext(hookName) {

}
const alreadyWarned = {};
const alreadyWarned$1 = {};
function warningOnce(key, cond, message) {
if (!cond && !alreadyWarned[key]) {
alreadyWarned[key] = true;
if (!cond && !alreadyWarned$1[key]) {
alreadyWarned$1[key] = true;
process.env.NODE_ENV !== "production" ? UNSAFE_warning(false, message) : void 0;

@@ -939,2 +950,33 @@ }

const alreadyWarned = {};
function warnOnce(key, message) {
if (!alreadyWarned[message]) {
alreadyWarned[message] = true;
console.warn(message);
}
}
const logDeprecation = (flag, msg, link) => warnOnce(flag, "\u26A0\uFE0F React Router Future Flag Warning: " + msg + ". " + ("You can use the `" + flag + "` future flag to opt-in early. ") + ("For more information, see " + link + "."));
function logV6DeprecationWarnings(renderFuture, routerFuture) {
if ((renderFuture == null ? void 0 : renderFuture.v7_startTransition) === undefined) {
logDeprecation("v7_startTransition", "React Router will begin wrapping state updates in `React.startTransition` in v7", "https://reactrouter.com/v6/upgrading/future#v7_starttransition");
}
if ((renderFuture == null ? void 0 : renderFuture.v7_relativeSplatPath) === undefined && (!routerFuture || !routerFuture.v7_relativeSplatPath)) {
logDeprecation("v7_relativeSplatPath", "Relative route resolution within Splat routes is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath");
}
if (routerFuture) {
if (routerFuture.v7_fetcherPersist === undefined) {
logDeprecation("v7_fetcherPersist", "The persistence behavior of fetchers is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist");
}
if (routerFuture.v7_normalizeFormMethod === undefined) {
logDeprecation("v7_normalizeFormMethod", "Casing of `formMethod` fields is being normalized to uppercase in v7", "https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod");
}
if (routerFuture.v7_partialHydration === undefined) {
logDeprecation("v7_partialHydration", "`RouterProvider` hydration behavior is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_partialhydration");
}
if (routerFuture.v7_skipActionErrorRevalidation === undefined) {
logDeprecation("v7_skipActionErrorRevalidation", "The revalidation behavior after 4xx/5xx `action` responses is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation");
}
}
}
/**

@@ -1016,2 +1058,3 @@ Webpack + React 17 fails to compile on any of the following because webpack

}), [router, navigator, basename]);
React.useEffect(() => logV6DeprecationWarnings(future, router.future), [router, future]);

@@ -1053,3 +1096,3 @@ // The fragment and {null} here are important! We need them to keep React 18's

*
* @see https://reactrouter.com/router-components/memory-router
* @see https://reactrouter.com/v6/router-components/memory-router
*/

@@ -1084,2 +1127,3 @@ function MemoryRouter(_ref3) {

React.useLayoutEffect(() => history.listen(setState), [history, setState]);
React.useEffect(() => logV6DeprecationWarnings(future), [future]);
return /*#__PURE__*/React.createElement(Router, {

@@ -1101,3 +1145,3 @@ basename: basename,

*
* @see https://reactrouter.com/components/navigate
* @see https://reactrouter.com/v6/components/navigate
*/

@@ -1141,3 +1185,3 @@ function Navigate(_ref4) {

*
* @see https://reactrouter.com/components/outlet
* @see https://reactrouter.com/v6/components/outlet
*/

@@ -1150,3 +1194,3 @@ function Outlet(props) {

*
* @see https://reactrouter.com/components/route
* @see https://reactrouter.com/v6/components/route
*/

@@ -1163,3 +1207,3 @@ function Route(_props) {

*
* @see https://reactrouter.com/router-components/router
* @see https://reactrouter.com/v6/router-components/router
*/

@@ -1230,3 +1274,3 @@ function Router(_ref5) {

*
* @see https://reactrouter.com/components/routes
* @see https://reactrouter.com/v6/components/routes
*/

@@ -1309,3 +1353,3 @@ function Routes(_ref6) {

promise = resolve;
status = promise._error !== undefined ? AwaitRenderStatus.error : promise._data !== undefined ? AwaitRenderStatus.success : AwaitRenderStatus.pending;
status = "_error" in promise ? AwaitRenderStatus.error : "_data" in promise ? AwaitRenderStatus.success : AwaitRenderStatus.pending;
} else {

@@ -1373,3 +1417,3 @@ // Raw (untracked) promise - track it

*
* @see https://reactrouter.com/utils/create-routes-from-children
* @see https://reactrouter.com/v6/utils/create-routes-from-children
*/

@@ -1479,7 +1523,9 @@ function createRoutesFromChildren(children, parentPath) {

routes,
mapRouteProperties
mapRouteProperties,
dataStrategy: opts == null ? void 0 : opts.dataStrategy,
patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation
}).initialize();
}
export { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, createMemoryRouter, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, renderMatches, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
export { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, logV6DeprecationWarnings as UNSAFE_logV6DeprecationWarnings, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, createMemoryRouter, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, renderMatches, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
//# sourceMappingURL=index.js.map

@@ -28,3 +28,3 @@ import type { InitialEntry, LazyRouteFunction, Location, RelativeRoutingType, Router as RemixRouter, To, TrackedPromise } from "@remix-run/router";

*
* @see https://reactrouter.com/router-components/memory-router
* @see https://reactrouter.com/v6/router-components/memory-router
*/

@@ -45,3 +45,3 @@ export declare function MemoryRouter({ basename, children, initialEntries, initialIndex, future, }: MemoryRouterProps): React.ReactElement;

*
* @see https://reactrouter.com/components/navigate
* @see https://reactrouter.com/v6/components/navigate
*/

@@ -55,3 +55,3 @@ export declare function Navigate({ to, replace, state, relative, }: NavigateProps): null;

*
* @see https://reactrouter.com/components/outlet
* @see https://reactrouter.com/v6/components/outlet
*/

@@ -103,3 +103,3 @@ export declare function Outlet(props: OutletProps): React.ReactElement | null;

*
* @see https://reactrouter.com/components/route
* @see https://reactrouter.com/v6/components/route
*/

@@ -123,3 +123,3 @@ export declare function Route(_props: RouteProps): React.ReactElement | null;

*
* @see https://reactrouter.com/router-components/router
* @see https://reactrouter.com/v6/router-components/router
*/

@@ -135,3 +135,3 @@ export declare function Router({ basename: basenameProp, children, location: locationProp, navigationType, navigator, static: staticProp, future, }: RouterProps): React.ReactElement | null;

*
* @see https://reactrouter.com/components/routes
* @see https://reactrouter.com/v6/components/routes
*/

@@ -157,3 +157,3 @@ export declare function Routes({ children, location, }: RoutesProps): React.ReactElement | null;

*
* @see https://reactrouter.com/utils/create-routes-from-children
* @see https://reactrouter.com/v6/utils/create-routes-from-children
*/

@@ -160,0 +160,0 @@ export declare function createRoutesFromChildren(children: React.ReactNode, parentPath?: number[]): RouteObject[];

@@ -62,4 +62,4 @@ import * as React from "react";

relative?: RelativeRoutingType;
unstable_flushSync?: boolean;
unstable_viewTransition?: boolean;
flushSync?: boolean;
viewTransition?: boolean;
}

@@ -66,0 +66,0 @@ /**

@@ -9,3 +9,3 @@ import * as React from "react";

*
* @see https://reactrouter.com/hooks/use-href
* @see https://reactrouter.com/v6/hooks/use-href
*/

@@ -18,3 +18,3 @@ export declare function useHref(to: To, { relative }?: {

*
* @see https://reactrouter.com/hooks/use-in-router-context
* @see https://reactrouter.com/v6/hooks/use-in-router-context
*/

@@ -30,3 +30,3 @@ export declare function useInRouterContext(): boolean;

*
* @see https://reactrouter.com/hooks/use-location
* @see https://reactrouter.com/v6/hooks/use-location
*/

@@ -38,3 +38,3 @@ export declare function useLocation(): Location;

*
* @see https://reactrouter.com/hooks/use-navigation-type
* @see https://reactrouter.com/v6/hooks/use-navigation-type
*/

@@ -47,3 +47,3 @@ export declare function useNavigationType(): NavigationType;

*
* @see https://reactrouter.com/hooks/use-match
* @see https://reactrouter.com/v6/hooks/use-match
*/

@@ -62,3 +62,3 @@ export declare function useMatch<ParamKey extends ParamParseKey<Path>, Path extends string>(pattern: PathPattern<Path> | Path): PathMatch<ParamKey> | null;

*
* @see https://reactrouter.com/hooks/use-navigate
* @see https://reactrouter.com/v6/hooks/use-navigate
*/

@@ -69,3 +69,3 @@ export declare function useNavigate(): NavigateFunction;

* hierarchy.
* @see https://reactrouter.com/hooks/use-outlet-context
* @see https://reactrouter.com/v6/hooks/use-outlet-context
*/

@@ -77,3 +77,3 @@ export declare function useOutletContext<Context = unknown>(): Context;

*
* @see https://reactrouter.com/hooks/use-outlet
* @see https://reactrouter.com/v6/hooks/use-outlet
*/

@@ -85,3 +85,3 @@ export declare function useOutlet(context?: unknown): React.ReactElement | null;

*
* @see https://reactrouter.com/hooks/use-params
* @see https://reactrouter.com/v6/hooks/use-params
*/

@@ -94,3 +94,3 @@ export declare function useParams<ParamsOrKey extends string | Record<string, string | undefined> = string>(): Readonly<[

*
* @see https://reactrouter.com/hooks/use-resolved-path
* @see https://reactrouter.com/v6/hooks/use-resolved-path
*/

@@ -106,3 +106,3 @@ export declare function useResolvedPath(to: To, { relative }?: {

*
* @see https://reactrouter.com/hooks/use-routes
* @see https://reactrouter.com/v6/hooks/use-routes
*/

@@ -109,0 +109,0 @@ export declare function useRoutes(routes: RouteObject[], locationArg?: Partial<Location> | string): React.ReactElement | null;

/**
* React Router v0.0.0-experimental-114cf0b7
* React Router v0.0.0-experimental-119d5d872
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* React Router v0.0.0-experimental-114cf0b7
* React Router v0.0.0-experimental-119d5d872
*

@@ -12,4 +12,4 @@ * Copyright (c) Remix Software Inc.

import * as React from 'react';
import { UNSAFE_invariant, joinPaths, matchPath, UNSAFE_getResolveToMatches, UNSAFE_warning, resolveTo, parsePath, matchRoutes, Action, UNSAFE_convertRouteMatchToUiMatch, stripBasename, IDLE_BLOCKER, isRouteErrorResponse, createMemoryHistory, AbortedDeferredError, createRouter } from '@remix-run/router';
export { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, resolvePath } from '@remix-run/router';
import { UNSAFE_invariant, joinPaths, matchPath, UNSAFE_decodePath, UNSAFE_getResolveToMatches, UNSAFE_warning, resolveTo, parsePath, matchRoutes, Action, UNSAFE_convertRouteMatchToUiMatch, stripBasename, IDLE_BLOCKER, isRouteErrorResponse, createMemoryHistory, AbortedDeferredError, createRouter } from '@remix-run/router';
export { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, replace, resolvePath } from '@remix-run/router';

@@ -53,3 +53,3 @@ const DataRouterContext = /*#__PURE__*/React.createContext(null);

*
* @see https://reactrouter.com/hooks/use-href
* @see https://reactrouter.com/v6/hooks/use-href
*/

@@ -91,3 +91,3 @@ function useHref(to, {

*
* @see https://reactrouter.com/hooks/use-in-router-context
* @see https://reactrouter.com/v6/hooks/use-in-router-context
*/

@@ -105,3 +105,3 @@ function useInRouterContext() {

*
* @see https://reactrouter.com/hooks/use-location
* @see https://reactrouter.com/v6/hooks/use-location
*/

@@ -119,3 +119,3 @@ function useLocation() {

*
* @see https://reactrouter.com/hooks/use-navigation-type
* @see https://reactrouter.com/v6/hooks/use-navigation-type
*/

@@ -130,3 +130,3 @@ function useNavigationType() {

*
* @see https://reactrouter.com/hooks/use-match
* @see https://reactrouter.com/v6/hooks/use-match
*/

@@ -141,3 +141,3 @@ function useMatch(pattern) {

} = useLocation();
return React.useMemo(() => matchPath(pattern, pathname), [pathname, pattern]);
return React.useMemo(() => matchPath(pattern, UNSAFE_decodePath(pathname)), [pathname, pattern]);
}

@@ -159,3 +159,3 @@ const navigateEffectWarning = `You should call navigate() in a React.useEffect(), not when ` + `your component is first rendered.`;

*
* @see https://reactrouter.com/hooks/use-navigate
* @see https://reactrouter.com/v6/hooks/use-navigate
*/

@@ -219,3 +219,3 @@ function useNavigate() {

* hierarchy.
* @see https://reactrouter.com/hooks/use-outlet-context
* @see https://reactrouter.com/v6/hooks/use-outlet-context
*/

@@ -229,3 +229,3 @@ function useOutletContext() {

*
* @see https://reactrouter.com/hooks/use-outlet
* @see https://reactrouter.com/v6/hooks/use-outlet
*/

@@ -245,3 +245,3 @@ function useOutlet(context) {

*
* @see https://reactrouter.com/hooks/use-params
* @see https://reactrouter.com/v6/hooks/use-params
*/

@@ -258,3 +258,3 @@ function useParams() {

*
* @see https://reactrouter.com/hooks/use-resolved-path
* @see https://reactrouter.com/v6/hooks/use-resolved-path
*/

@@ -282,3 +282,3 @@ function useResolvedPath(to, {

*
* @see https://reactrouter.com/hooks/use-routes
* @see https://reactrouter.com/v6/hooks/use-routes
*/

@@ -359,3 +359,3 @@ function useRoutes(routes, locationArg) {

}
let matches = matchRoutes(routes, {
let matches = dataRouterState && dataRouterState.matches && dataRouterState.matches.length > 0 ? dataRouterState.matches : matchRoutes(routes, {
pathname: remainingPathname

@@ -496,6 +496,17 @@ });

if (matches == null) {
if (dataRouterState?.errors) {
if (!dataRouterState) {
return null;
}
if (dataRouterState.errors) {
// Don't bail if we have data router errors so we can render them in the
// boundary. Use the pre-matched (or shimmed) matches
matches = dataRouterState.matches;
} else if (future?.v7_partialHydration && parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) {
// Don't bail if we're initializing with partial hydration and we have
// router matches. That means we're actively running `patchRoutesOnNavigation`
// so we should render down the partial matches to the appropriate
// `HydrateFallback`. We only do this if `parentMatches` is empty so it
// only impacts the root matches for `RouterProvider` and no descendant
// `<Routes>`
matches = dataRouterState.matches;
} else {

@@ -509,3 +520,3 @@ return null;

if (errors != null) {
let errorIndex = renderedMatches.findIndex(m => m.route.id && errors?.[m.route.id]);
let errorIndex = renderedMatches.findIndex(m => m.route.id && errors?.[m.route.id] !== undefined);
!(errorIndex >= 0) ? UNSAFE_invariant(false, `Could not find a matching route for errors on route IDs: ${Object.keys(errors).join(",")}`) : void 0;

@@ -633,3 +644,3 @@ renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));

function getDataRouterConsoleError(hookName) {
return `${hookName} must be used within a data router. See https://reactrouter.com/routers/picking-a-router.`;
return `${hookName} must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.`;
}

@@ -843,6 +854,6 @@ function useDataRouterContext(hookName) {

}
const alreadyWarned = {};
const alreadyWarned$1 = {};
function warningOnce(key, cond, message) {
if (!cond && !alreadyWarned[key]) {
alreadyWarned[key] = true;
if (!cond && !alreadyWarned$1[key]) {
alreadyWarned$1[key] = true;
UNSAFE_warning(false, message) ;

@@ -852,2 +863,33 @@ }

const alreadyWarned = {};
function warnOnce(key, message) {
if (!alreadyWarned[message]) {
alreadyWarned[message] = true;
console.warn(message);
}
}
const logDeprecation = (flag, msg, link) => warnOnce(flag, `⚠️ React Router Future Flag Warning: ${msg}. ` + `You can use the \`${flag}\` future flag to opt-in early. ` + `For more information, see ${link}.`);
function logV6DeprecationWarnings(renderFuture, routerFuture) {
if (renderFuture?.v7_startTransition === undefined) {
logDeprecation("v7_startTransition", "React Router will begin wrapping state updates in `React.startTransition` in v7", "https://reactrouter.com/v6/upgrading/future#v7_starttransition");
}
if (renderFuture?.v7_relativeSplatPath === undefined && (!routerFuture || !routerFuture.v7_relativeSplatPath)) {
logDeprecation("v7_relativeSplatPath", "Relative route resolution within Splat routes is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath");
}
if (routerFuture) {
if (routerFuture.v7_fetcherPersist === undefined) {
logDeprecation("v7_fetcherPersist", "The persistence behavior of fetchers is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist");
}
if (routerFuture.v7_normalizeFormMethod === undefined) {
logDeprecation("v7_normalizeFormMethod", "Casing of `formMethod` fields is being normalized to uppercase in v7", "https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod");
}
if (routerFuture.v7_partialHydration === undefined) {
logDeprecation("v7_partialHydration", "`RouterProvider` hydration behavior is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_partialhydration");
}
if (routerFuture.v7_skipActionErrorRevalidation === undefined) {
logDeprecation("v7_skipActionErrorRevalidation", "The revalidation behavior after 4xx/5xx `action` responses is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation");
}
}
}
/**

@@ -926,2 +968,3 @@ Webpack + React 17 fails to compile on any of the following because webpack

}), [router, navigator, basename]);
React.useEffect(() => logV6DeprecationWarnings(future, router.future), [router, future]);
// The fragment and {null} here are important! We need them to keep React 18's

@@ -961,3 +1004,3 @@ // useId happy when we are server-rendering since we may have a <script> here

*
* @see https://reactrouter.com/router-components/memory-router
* @see https://reactrouter.com/v6/router-components/memory-router
*/

@@ -991,2 +1034,3 @@ function MemoryRouter({

React.useLayoutEffect(() => history.listen(setState), [history, setState]);
React.useEffect(() => logV6DeprecationWarnings(future), [future]);
return /*#__PURE__*/React.createElement(Router, {

@@ -1008,3 +1052,3 @@ basename: basename,

*
* @see https://reactrouter.com/components/navigate
* @see https://reactrouter.com/v6/components/navigate
*/

@@ -1047,3 +1091,3 @@ function Navigate({

*
* @see https://reactrouter.com/components/outlet
* @see https://reactrouter.com/v6/components/outlet
*/

@@ -1056,3 +1100,3 @@ function Outlet(props) {

*
* @see https://reactrouter.com/components/route
* @see https://reactrouter.com/v6/components/route
*/

@@ -1069,3 +1113,3 @@ function Route(_props) {

*
* @see https://reactrouter.com/router-components/router
* @see https://reactrouter.com/v6/router-components/router
*/

@@ -1135,3 +1179,3 @@ function Router({

*
* @see https://reactrouter.com/components/routes
* @see https://reactrouter.com/v6/components/routes
*/

@@ -1212,3 +1256,3 @@ function Routes({

promise = resolve;
status = promise._error !== undefined ? AwaitRenderStatus.error : promise._data !== undefined ? AwaitRenderStatus.success : AwaitRenderStatus.pending;
status = "_error" in promise ? AwaitRenderStatus.error : "_data" in promise ? AwaitRenderStatus.success : AwaitRenderStatus.pending;
} else {

@@ -1271,3 +1315,3 @@ // Raw (untracked) promise - track it

*
* @see https://reactrouter.com/utils/create-routes-from-children
* @see https://reactrouter.com/v6/utils/create-routes-from-children
*/

@@ -1374,7 +1418,9 @@ function createRoutesFromChildren(children, parentPath = []) {

routes,
mapRouteProperties
mapRouteProperties,
dataStrategy: opts?.dataStrategy,
patchRoutesOnNavigation: opts?.patchRoutesOnNavigation
}).initialize();
}
export { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, createMemoryRouter, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, renderMatches, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
export { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, logV6DeprecationWarnings as UNSAFE_logV6DeprecationWarnings, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, createMemoryRouter, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, renderMatches, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
//# sourceMappingURL=react-router.development.js.map
/**
* React Router v0.0.0-experimental-114cf0b7
* React Router v0.0.0-experimental-119d5d872
*

@@ -11,3 +11,3 @@ * Copyright (c) Remix Software Inc.

*/
import*as e from"react";import{UNSAFE_invariant as t,joinPaths as r,matchPath as n,UNSAFE_getResolveToMatches as a,resolveTo as o,parsePath as i,matchRoutes as l,Action as u,UNSAFE_convertRouteMatchToUiMatch as s,stripBasename as c,IDLE_BLOCKER as d,isRouteErrorResponse as p,createMemoryHistory as m,AbortedDeferredError as h,createRouter as f}from"@remix-run/router";export{AbortedDeferredError,Action as NavigationType,createPath,defer,generatePath,isRouteErrorResponse,json,matchPath,matchRoutes,parsePath,redirect,redirectDocument,resolvePath}from"@remix-run/router";const v=e.createContext(null),E=e.createContext(null),g=e.createContext(null),y=e.createContext(null),x=e.createContext(null),C=e.createContext({outlet:null,matches:[],isDataRoute:!1}),b=e.createContext(null);function R(n,{relative:a}={}){S()||t(!1);let{basename:o,navigator:i}=e.useContext(y),{hash:l,pathname:u,search:s}=O(n,{relative:a}),c=u;return"/"!==o&&(c="/"===u?o:r([o,u])),i.createHref({pathname:c,search:s,hash:l})}function S(){return null!=e.useContext(x)}function P(){return S()||t(!1),e.useContext(x).location}function U(){return e.useContext(x).navigationType}function k(r){S()||t(!1);let{pathname:a}=P();return e.useMemo((()=>n(r,a)),[a,r])}function _(t){e.useContext(y).static||e.useLayoutEffect(t)}function D(){let{isDataRoute:n}=e.useContext(C);return n?function(){let{router:t}=$(J.UseNavigateStable),r=W(z.UseNavigateStable),n=e.useRef(!1);return _((()=>{n.current=!0})),e.useCallback(((e,a={})=>{n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,{fromRouteId:r,...a}))}),[t,r])}():function(){S()||t(!1);let n=e.useContext(v),{basename:i,future:l,navigator:u}=e.useContext(y),{matches:s}=e.useContext(C),{pathname:c}=P(),d=JSON.stringify(a(s,l.v7_relativeSplatPath)),p=e.useRef(!1);return _((()=>{p.current=!0})),e.useCallback(((e,t={})=>{if(!p.current)return;if("number"==typeof e)return void u.go(e);let a=o(e,JSON.parse(d),c,"path"===t.relative);null==n&&"/"!==i&&(a.pathname="/"===a.pathname?i:r([i,a.pathname])),(t.replace?u.replace:u.push)(a,t.state,t)}),[i,u,d,c,n])}()}const B=e.createContext(null);function N(){return e.useContext(B)}function F(t){let r=e.useContext(C).outlet;return r?e.createElement(B.Provider,{value:t},r):r}function L(){let{matches:t}=e.useContext(C),r=t[t.length-1];return r?r.params:{}}function O(t,{relative:r}={}){let{future:n}=e.useContext(y),{matches:i}=e.useContext(C),{pathname:l}=P(),u=JSON.stringify(a(i,n.v7_relativeSplatPath));return e.useMemo((()=>o(t,JSON.parse(u),l,"path"===r)),[t,u,l,r])}function A(e,t){return j(e,t)}function j(n,a,o,s){S()||t(!1);let{navigator:c}=e.useContext(y),{matches:d}=e.useContext(C),p=d[d.length-1],m=p?p.params:{};!p||p.pathname;let h=p?p.pathnameBase:"/";p&&p.route;let f,v=P();if(a){let e="string"==typeof a?i(a):a;"/"===h||e.pathname?.startsWith(h)||t(!1),f=e}else f=v;let E=f.pathname||"/",g=E;if("/"!==h){let e=h.replace(/^\//,"").split("/");g="/"+E.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=l(n,{pathname:g}),R=w(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},m,e.params),pathname:r([h,c.encodeLocation?c.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?h:r([h,c.encodeLocation?c.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),d,o,s);return a&&R?e.createElement(x.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:u.Pop}},R):R}function I(){let t=ee(),r=p(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},r),n?e.createElement("pre",{style:a},n):null,null)}const M=e.createElement(I,null);class T extends e.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||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?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 void 0!==this.state.error?e.createElement(C.Provider,{value:this.props.routeContext},e.createElement(b.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function H({routeContext:t,match:r,children:n}){let a=e.useContext(v);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),e.createElement(C.Provider,{value:t},n)}function w(r,n=[],a=null,o=null){if(null==r){if(!a?.errors)return null;r=a.matches}let i=r,l=a?.errors;if(null!=l){let e=i.findIndex((e=>e.route.id&&l?.[e.route.id]));e>=0||t(!1),i=i.slice(0,Math.min(i.length,e+1))}let u=!1,s=-1;if(a&&o&&o.v7_partialHydration)for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:r}=a,n=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||n){u=!0,i=s>=0?i.slice(0,s+1):[i[0]];break}}}return i.reduceRight(((t,r,o)=>{let c,d=!1,p=null,m=null;var h;a&&(c=l&&r.route.id?l[r.route.id]:void 0,p=r.route.errorElement||M,u&&(s<0&&0===o?(h="route-fallback",!1||oe[h]||(oe[h]=!0),d=!0,m=null):s===o&&(d=!0,m=r.route.hydrateFallbackElement||null)));let f=n.concat(i.slice(0,o+1)),v=()=>{let n;return n=c?p:d?m:r.route.Component?e.createElement(r.route.Component,null):r.route.element?r.route.element:t,e.createElement(H,{match:r,routeContext:{outlet:t,matches:f,isDataRoute:null!=a},children:n})};return a&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?e.createElement(T,{location:a.location,revalidation:a.revalidation,component:p,error:c,children:v(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):v()}),null)}var J=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(J||{}),z=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(z||{});function $(r){let n=e.useContext(v);return n||t(!1),n}function V(r){let n=e.useContext(E);return n||t(!1),n}function W(r){let n=function(r){let n=e.useContext(C);return n||t(!1),n}(),a=n.matches[n.matches.length-1];return a.route.id||t(!1),a.route.id}function Y(){return W(z.UseRouteId)}function q(){return V(z.UseNavigation).navigation}function G(){let t=$(J.UseRevalidator),r=V(z.UseRevalidator);return e.useMemo((()=>({revalidate:t.router.revalidate,state:r.revalidation})),[t.router.revalidate,r.revalidation])}function K(){let{matches:t,loaderData:r}=V(z.UseMatches);return e.useMemo((()=>t.map((e=>s(e,r)))),[t,r])}function Q(){let e=V(z.UseLoaderData),t=W(z.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error(`You cannot \`useLoaderData\` in an errorElement (routeId: ${t})`)}function X(e){return V(z.UseRouteLoaderData).loaderData[e]}function Z(){let e=V(z.UseActionData),t=W(z.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function ee(){let t=e.useContext(b),r=V(z.UseRouteError),n=W(z.UseRouteError);return void 0!==t?t:r.errors?.[n]}function te(){return e.useContext(g)?._data}function re(){return e.useContext(g)?._error}let ne=0;function ae(t){let{router:r,basename:n}=$(J.UseBlocker),a=V(z.UseBlocker),[o,i]=e.useState(""),l=e.useCallback((e=>{if("function"!=typeof t)return!!t;if("/"===n)return t(e);let{currentLocation:r,nextLocation:a,historyAction:o}=e;return t({currentLocation:{...r,pathname:c(r.pathname,n)||r.pathname},nextLocation:{...a,pathname:c(a.pathname,n)||a.pathname},historyAction:o})}),[n,t]);return e.useEffect((()=>{let e=String(++ne);return i(e),()=>r.deleteBlocker(e)}),[r]),e.useEffect((()=>{""!==o&&r.getBlocker(o,l)}),[r,o,l]),o&&a.blockers.has(o)?a.blockers.get(o):d}const oe={};const ie=e.startTransition;function le({fallbackElement:t,router:r,future:n}){let[a,o]=e.useState(r.state),{v7_startTransition:i}=n||{},l=e.useCallback((e=>{i&&ie?ie((()=>o(e))):o(e)}),[o,i]);e.useLayoutEffect((()=>r.subscribe(l)),[r,l]),e.useEffect((()=>{}),[]);let u=e.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:n?.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:n?.preventScrollReset})})),[r]),s=r.basename||"/",c=e.useMemo((()=>({router:r,navigator:u,static:!1,basename:s})),[r,u,s]);return e.createElement(e.Fragment,null,e.createElement(v.Provider,{value:c},e.createElement(E.Provider,{value:a},e.createElement(me,{basename:s,location:a.location,navigationType:a.historyAction,navigator:u,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},a.initialized||r.future.v7_partialHydration?e.createElement(ue,{routes:r.routes,future:r.future,state:a}):t))),null)}function ue({routes:e,future:t,state:r}){return j(e,void 0,r,t)}function se({basename:t,children:r,initialEntries:n,initialIndex:a,future:o}){let i=e.useRef();null==i.current&&(i.current=m({initialEntries:n,initialIndex:a,v5Compat:!0}));let l=i.current,[u,s]=e.useState({action:l.action,location:l.location}),{v7_startTransition:c}=o||{},d=e.useCallback((e=>{c&&ie?ie((()=>s(e))):s(e)}),[s,c]);return e.useLayoutEffect((()=>l.listen(d)),[l,d]),e.createElement(me,{basename:t,children:r,location:u.location,navigationType:u.action,navigator:l,future:o})}function ce({to:r,replace:n,state:i,relative:l}){S()||t(!1);let{future:u,static:s}=e.useContext(y),{matches:c}=e.useContext(C),{pathname:d}=P(),p=D(),m=o(r,a(c,u.v7_relativeSplatPath),d,"path"===l),h=JSON.stringify(m);return e.useEffect((()=>p(JSON.parse(h),{replace:n,state:i,relative:l})),[p,h,l,n,i]),null}function de(e){return F(e.context)}function pe(e){t(!1)}function me({basename:r="/",children:n=null,location:a,navigationType:o=u.Pop,navigator:l,static:s=!1,future:d}){S()&&t(!1);let p=r.replace(/^\/*/,"/"),m=e.useMemo((()=>({basename:p,navigator:l,static:s,future:{v7_relativeSplatPath:!1,...d}})),[p,d,l,s]);"string"==typeof a&&(a=i(a));let{pathname:h="/",search:f="",hash:v="",state:E=null,key:g="default"}=a,C=e.useMemo((()=>{let e=c(h,p);return null==e?null:{location:{pathname:e,search:f,hash:v,state:E,key:g},navigationType:o}}),[p,h,f,v,E,g,o]);return null==C?null:e.createElement(y.Provider,{value:m},e.createElement(x.Provider,{children:n,value:C}))}function he({children:e,location:t}){return A(xe(e),t)}function fe({children:t,errorElement:r,resolve:n}){return e.createElement(ge,{resolve:n,errorElement:r},e.createElement(ye,null,t))}var ve=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(ve||{});const Ee=new Promise((()=>{}));class ge extends e.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:t,errorElement:r,resolve:n}=this.props,a=null,o=ve.pending;if(n instanceof Promise)if(this.state.error){o=ve.error;let e=this.state.error;a=Promise.reject().catch((()=>{})),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_error",{get:()=>e})}else n._tracked?(a=n,o=void 0!==a._error?ve.error:void 0!==a._data?ve.success:ve.pending):(o=ve.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),a=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else o=ve.success,a=Promise.resolve(),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_data",{get:()=>n});if(o===ve.error&&a._error instanceof h)throw Ee;if(o===ve.error&&!r)throw a._error;if(o===ve.error)return e.createElement(g.Provider,{value:a,children:r});if(o===ve.success)return e.createElement(g.Provider,{value:a,children:t});throw a}}function ye({children:t}){let r=te(),n="function"==typeof t?t(r):t;return e.createElement(e.Fragment,null,n)}function xe(r,n=[]){let a=[];return e.Children.forEach(r,((r,o)=>{if(!e.isValidElement(r))return;let i=[...n,o];if(r.type===e.Fragment)return void a.push.apply(a,xe(r.props.children,i));r.type!==pe&&t(!1),r.props.index&&r.props.children&&t(!1);let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:null!=r.props.ErrorBoundary||null!=r.props.errorElement,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=xe(r.props.children,i)),a.push(l)})),a}function Ce(e){return w(e)}function be(t){let r={hasErrorBoundary:null!=t.ErrorBoundary||null!=t.errorElement};return t.Component&&Object.assign(r,{element:e.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(r,{hydrateFallbackElement:e.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(r,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),r}function Re(e,t){return f({basename:t?.basename,future:{...t?.future,v7_prependBasename:!0},history:m({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,mapRouteProperties:be}).initialize()}export{fe as Await,se as MemoryRouter,ce as Navigate,de as Outlet,pe as Route,me as Router,le as RouterProvider,he as Routes,v as UNSAFE_DataRouterContext,E as UNSAFE_DataRouterStateContext,x as UNSAFE_LocationContext,y as UNSAFE_NavigationContext,C as UNSAFE_RouteContext,be as UNSAFE_mapRouteProperties,Y as UNSAFE_useRouteId,j as UNSAFE_useRoutesImpl,Re as createMemoryRouter,xe as createRoutesFromChildren,xe as createRoutesFromElements,Ce as renderMatches,Z as useActionData,re as useAsyncError,te as useAsyncValue,ae as useBlocker,R as useHref,S as useInRouterContext,Q as useLoaderData,P as useLocation,k as useMatch,K as useMatches,D as useNavigate,q as useNavigation,U as useNavigationType,F as useOutlet,N as useOutletContext,L as useParams,O as useResolvedPath,G as useRevalidator,ee as useRouteError,X as useRouteLoaderData,A as useRoutes};
import*as e from"react";import{UNSAFE_invariant as t,joinPaths as r,matchPath as a,UNSAFE_decodePath as n,UNSAFE_getResolveToMatches as o,resolveTo as i,parsePath as l,matchRoutes as u,Action as s,UNSAFE_convertRouteMatchToUiMatch as c,stripBasename as d,IDLE_BLOCKER as p,isRouteErrorResponse as h,createMemoryHistory as m,AbortedDeferredError as v,createRouter as f}from"@remix-run/router";export{AbortedDeferredError,Action as NavigationType,createPath,defer,generatePath,isRouteErrorResponse,json,matchPath,matchRoutes,parsePath,redirect,redirectDocument,replace,resolvePath}from"@remix-run/router";const g=e.createContext(null),E=e.createContext(null),y=e.createContext(null),x=e.createContext(null),C=e.createContext(null),b=e.createContext({outlet:null,matches:[],isDataRoute:!1}),R=e.createContext(null);function _(a,{relative:n}={}){S()||t(!1);let{basename:o,navigator:i}=e.useContext(x),{hash:l,pathname:u,search:s}=O(a,{relative:n}),c=u;return"/"!==o&&(c="/"===u?o:r([o,u])),i.createHref({pathname:c,search:s,hash:l})}function S(){return null!=e.useContext(C)}function P(){return S()||t(!1),e.useContext(C).location}function U(){return e.useContext(C).navigationType}function k(r){S()||t(!1);let{pathname:o}=P();return e.useMemo((()=>a(r,n(o))),[o,r])}function D(t){e.useContext(x).static||e.useLayoutEffect(t)}function F(){let{isDataRoute:a}=e.useContext(b);return a?function(){let{router:t}=W(J.UseNavigateStable),r=Y($.UseNavigateStable),a=e.useRef(!1);return D((()=>{a.current=!0})),e.useCallback(((e,n={})=>{a.current&&("number"==typeof e?t.navigate(e):t.navigate(e,{fromRouteId:r,...n}))}),[t,r])}():function(){S()||t(!1);let a=e.useContext(g),{basename:n,future:l,navigator:u}=e.useContext(x),{matches:s}=e.useContext(b),{pathname:c}=P(),d=JSON.stringify(o(s,l.v7_relativeSplatPath)),p=e.useRef(!1);return D((()=>{p.current=!0})),e.useCallback(((e,t={})=>{if(!p.current)return;if("number"==typeof e)return void u.go(e);let o=i(e,JSON.parse(d),c,"path"===t.relative);null==a&&"/"!==n&&(o.pathname="/"===o.pathname?n:r([n,o.pathname])),(t.replace?u.replace:u.push)(o,t.state,t)}),[n,u,d,c,a])}()}const N=e.createContext(null);function B(){return e.useContext(N)}function L(t){let r=e.useContext(b).outlet;return r?e.createElement(N.Provider,{value:t},r):r}function A(){let{matches:t}=e.useContext(b),r=t[t.length-1];return r?r.params:{}}function O(t,{relative:r}={}){let{future:a}=e.useContext(x),{matches:n}=e.useContext(b),{pathname:l}=P(),u=JSON.stringify(o(n,a.v7_relativeSplatPath));return e.useMemo((()=>i(t,JSON.parse(u),l,"path"===r)),[t,u,l,r])}function j(e,t){return T(e,t)}function T(a,n,o,i){S()||t(!1);let{navigator:c}=e.useContext(x),{matches:d}=e.useContext(b),p=d[d.length-1],h=p?p.params:{};!p||p.pathname;let m=p?p.pathnameBase:"/";p&&p.route;let v,f=P();if(n){let e="string"==typeof n?l(n):n;"/"===m||e.pathname?.startsWith(m)||t(!1),v=e}else v=f;let g=v.pathname||"/",E=g;if("/"!==m){let e=m.replace(/^\//,"").split("/");E="/"+g.replace(/^\//,"").split("/").slice(e.length).join("/")}let y=o&&o.matches&&o.matches.length>0?o.matches:u(a,{pathname:E}),R=z(y&&y.map((e=>Object.assign({},e,{params:Object.assign({},h,e.params),pathname:r([m,c.encodeLocation?c.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?m:r([m,c.encodeLocation?c.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),d,o,i);return n&&R?e.createElement(C.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:s.Pop}},R):R}function M(){let t=te(),r=h(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},r),a?e.createElement("pre",{style:n},a):null,null)}const I=e.createElement(M,null);class H extends e.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||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?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 void 0!==this.state.error?e.createElement(b.Provider,{value:this.props.routeContext},e.createElement(R.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function w({routeContext:t,match:r,children:a}){let n=e.useContext(g);return n&&n.static&&n.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=r.route.id),e.createElement(b.Provider,{value:t},a)}function z(r,a=[],n=null,o=null){if(null==r){if(!n)return null;if(n.errors)r=n.matches;else{if(!(o?.v7_partialHydration&&0===a.length&&!n.initialized&&n.matches.length>0))return null;r=n.matches}}let i=r,l=n?.errors;if(null!=l){let e=i.findIndex((e=>e.route.id&&void 0!==l?.[e.route.id]));e>=0||t(!1),i=i.slice(0,Math.min(i.length,e+1))}let u=!1,s=-1;if(n&&o&&o.v7_partialHydration)for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:r}=n,a=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||a){u=!0,i=s>=0?i.slice(0,s+1):[i[0]];break}}}return i.reduceRight(((t,r,o)=>{let c,d=!1,p=null,h=null;var m;n&&(c=l&&r.route.id?l[r.route.id]:void 0,p=r.route.errorElement||I,u&&(s<0&&0===o?(m="route-fallback",!1||ie[m]||(ie[m]=!0),d=!0,h=null):s===o&&(d=!0,h=r.route.hydrateFallbackElement||null)));let v=a.concat(i.slice(0,o+1)),f=()=>{let a;return a=c?p:d?h:r.route.Component?e.createElement(r.route.Component,null):r.route.element?r.route.element:t,e.createElement(w,{match:r,routeContext:{outlet:t,matches:v,isDataRoute:null!=n},children:a})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?e.createElement(H,{location:n.location,revalidation:n.revalidation,component:p,error:c,children:f(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):f()}),null)}var J=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(J||{}),$=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}($||{});function W(r){let a=e.useContext(g);return a||t(!1),a}function V(r){let a=e.useContext(E);return a||t(!1),a}function Y(r){let a=function(r){let a=e.useContext(b);return a||t(!1),a}(),n=a.matches[a.matches.length-1];return n.route.id||t(!1),n.route.id}function q(){return Y($.UseRouteId)}function G(){return V($.UseNavigation).navigation}function K(){let t=W(J.UseRevalidator),r=V($.UseRevalidator);return e.useMemo((()=>({revalidate:t.router.revalidate,state:r.revalidation})),[t.router.revalidate,r.revalidation])}function Q(){let{matches:t,loaderData:r}=V($.UseMatches);return e.useMemo((()=>t.map((e=>c(e,r)))),[t,r])}function X(){let e=V($.UseLoaderData),t=Y($.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error(`You cannot \`useLoaderData\` in an errorElement (routeId: ${t})`)}function Z(e){return V($.UseRouteLoaderData).loaderData[e]}function ee(){let e=V($.UseActionData),t=Y($.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function te(){let t=e.useContext(R),r=V($.UseRouteError),a=Y($.UseRouteError);return void 0!==t?t:r.errors?.[a]}function re(){return e.useContext(y)?._data}function ae(){return e.useContext(y)?._error}let ne=0;function oe(t){let{router:r,basename:a}=W(J.UseBlocker),n=V($.UseBlocker),[o,i]=e.useState(""),l=e.useCallback((e=>{if("function"!=typeof t)return!!t;if("/"===a)return t(e);let{currentLocation:r,nextLocation:n,historyAction:o}=e;return t({currentLocation:{...r,pathname:d(r.pathname,a)||r.pathname},nextLocation:{...n,pathname:d(n.pathname,a)||n.pathname},historyAction:o})}),[a,t]);return e.useEffect((()=>{let e=String(++ne);return i(e),()=>r.deleteBlocker(e)}),[r]),e.useEffect((()=>{""!==o&&r.getBlocker(o,l)}),[r,o,l]),o&&n.blockers.has(o)?n.blockers.get(o):p}const ie={};const le={};const ue=(e,t,r)=>{var a;le[a=`⚠️ React Router Future Flag Warning: ${t}. You can use the \`${e}\` future flag to opt-in early. For more information, see ${r}.`]||(le[a]=!0,console.warn(a))};function se(e,t){void 0===e?.v7_startTransition&&ue("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),void 0!==e?.v7_relativeSplatPath||t&&t.v7_relativeSplatPath||ue("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(void 0===t.v7_fetcherPersist&&ue("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),void 0===t.v7_normalizeFormMethod&&ue("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),void 0===t.v7_partialHydration&&ue("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),void 0===t.v7_skipActionErrorRevalidation&&ue("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}const ce=e.startTransition;function de({fallbackElement:t,router:r,future:a}){let[n,o]=e.useState(r.state),{v7_startTransition:i}=a||{},l=e.useCallback((e=>{i&&ce?ce((()=>o(e))):o(e)}),[o,i]);e.useLayoutEffect((()=>r.subscribe(l)),[r,l]),e.useEffect((()=>{}),[]);let u=e.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,a)=>r.navigate(e,{state:t,preventScrollReset:a?.preventScrollReset}),replace:(e,t,a)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:a?.preventScrollReset})})),[r]),s=r.basename||"/",c=e.useMemo((()=>({router:r,navigator:u,static:!1,basename:s})),[r,u,s]);return e.useEffect((()=>se(a,r.future)),[r,a]),e.createElement(e.Fragment,null,e.createElement(g.Provider,{value:c},e.createElement(E.Provider,{value:n},e.createElement(ge,{basename:s,location:n.location,navigationType:n.historyAction,navigator:u,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},n.initialized||r.future.v7_partialHydration?e.createElement(pe,{routes:r.routes,future:r.future,state:n}):t))),null)}function pe({routes:e,future:t,state:r}){return T(e,void 0,r,t)}function he({basename:t,children:r,initialEntries:a,initialIndex:n,future:o}){let i=e.useRef();null==i.current&&(i.current=m({initialEntries:a,initialIndex:n,v5Compat:!0}));let l=i.current,[u,s]=e.useState({action:l.action,location:l.location}),{v7_startTransition:c}=o||{},d=e.useCallback((e=>{c&&ce?ce((()=>s(e))):s(e)}),[s,c]);return e.useLayoutEffect((()=>l.listen(d)),[l,d]),e.useEffect((()=>se(o)),[o]),e.createElement(ge,{basename:t,children:r,location:u.location,navigationType:u.action,navigator:l,future:o})}function me({to:r,replace:a,state:n,relative:l}){S()||t(!1);let{future:u,static:s}=e.useContext(x),{matches:c}=e.useContext(b),{pathname:d}=P(),p=F(),h=i(r,o(c,u.v7_relativeSplatPath),d,"path"===l),m=JSON.stringify(h);return e.useEffect((()=>p(JSON.parse(m),{replace:a,state:n,relative:l})),[p,m,l,a,n]),null}function ve(e){return L(e.context)}function fe(e){t(!1)}function ge({basename:r="/",children:a=null,location:n,navigationType:o=s.Pop,navigator:i,static:u=!1,future:c}){S()&&t(!1);let p=r.replace(/^\/*/,"/"),h=e.useMemo((()=>({basename:p,navigator:i,static:u,future:{v7_relativeSplatPath:!1,...c}})),[p,c,i,u]);"string"==typeof n&&(n=l(n));let{pathname:m="/",search:v="",hash:f="",state:g=null,key:E="default"}=n,y=e.useMemo((()=>{let e=d(m,p);return null==e?null:{location:{pathname:e,search:v,hash:f,state:g,key:E},navigationType:o}}),[p,m,v,f,g,E,o]);return null==y?null:e.createElement(x.Provider,{value:h},e.createElement(C.Provider,{children:a,value:y}))}function Ee({children:e,location:t}){return j(_e(e),t)}function ye({children:t,errorElement:r,resolve:a}){return e.createElement(be,{resolve:a,errorElement:r},e.createElement(Re,null,t))}var xe=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(xe||{});const Ce=new Promise((()=>{}));class be extends e.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:t,errorElement:r,resolve:a}=this.props,n=null,o=xe.pending;if(a instanceof Promise)if(this.state.error){o=xe.error;let e=this.state.error;n=Promise.reject().catch((()=>{})),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>e})}else a._tracked?(n=a,o="_error"in n?xe.error:"_data"in n?xe.success:xe.pending):(o=xe.pending,Object.defineProperty(a,"_tracked",{get:()=>!0}),n=a.then((e=>Object.defineProperty(a,"_data",{get:()=>e})),(e=>Object.defineProperty(a,"_error",{get:()=>e}))));else o=xe.success,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>a});if(o===xe.error&&n._error instanceof v)throw Ce;if(o===xe.error&&!r)throw n._error;if(o===xe.error)return e.createElement(y.Provider,{value:n,children:r});if(o===xe.success)return e.createElement(y.Provider,{value:n,children:t});throw n}}function Re({children:t}){let r=re(),a="function"==typeof t?t(r):t;return e.createElement(e.Fragment,null,a)}function _e(r,a=[]){let n=[];return e.Children.forEach(r,((r,o)=>{if(!e.isValidElement(r))return;let i=[...a,o];if(r.type===e.Fragment)return void n.push.apply(n,_e(r.props.children,i));r.type!==fe&&t(!1),r.props.index&&r.props.children&&t(!1);let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:null!=r.props.ErrorBoundary||null!=r.props.errorElement,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=_e(r.props.children,i)),n.push(l)})),n}function Se(e){return z(e)}function Pe(t){let r={hasErrorBoundary:null!=t.ErrorBoundary||null!=t.errorElement};return t.Component&&Object.assign(r,{element:e.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(r,{hydrateFallbackElement:e.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(r,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),r}function Ue(e,t){return f({basename:t?.basename,future:{...t?.future,v7_prependBasename:!0},history:m({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,mapRouteProperties:Pe,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation}).initialize()}export{ye as Await,he as MemoryRouter,me as Navigate,ve as Outlet,fe as Route,ge as Router,de as RouterProvider,Ee as Routes,g as UNSAFE_DataRouterContext,E as UNSAFE_DataRouterStateContext,C as UNSAFE_LocationContext,x as UNSAFE_NavigationContext,b as UNSAFE_RouteContext,se as UNSAFE_logV6DeprecationWarnings,Pe as UNSAFE_mapRouteProperties,q as UNSAFE_useRouteId,T as UNSAFE_useRoutesImpl,Ue as createMemoryRouter,_e as createRoutesFromChildren,_e as createRoutesFromElements,Se as renderMatches,ee as useActionData,ae as useAsyncError,re as useAsyncValue,oe as useBlocker,_ as useHref,S as useInRouterContext,X as useLoaderData,P as useLocation,k as useMatch,Q as useMatches,F as useNavigate,G as useNavigation,U as useNavigationType,L as useOutlet,B as useOutletContext,A as useParams,O as useResolvedPath,K as useRevalidator,te as useRouteError,Z as useRouteLoaderData,j as useRoutes};
//# sourceMappingURL=react-router.production.min.js.map
/**
* React Router v0.0.0-experimental-114cf0b7
* React Router v0.0.0-experimental-119d5d872
*

@@ -11,3 +11,3 @@ * Copyright (c) Remix Software Inc.

*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@remix-run/router")):"function"==typeof define&&define.amd?define(["exports","react","@remix-run/router"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRouter={},e.React,e.RemixRouter)}(this,(function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=n(t);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(this,arguments)}const i=a.createContext(null),u=a.createContext(null),l=a.createContext(null),s=a.createContext(null),c=a.createContext(null),d=a.createContext({outlet:null,matches:[],isDataRoute:!1}),p=a.createContext(null);function f(){return null!=a.useContext(c)}function m(){return f()||r.UNSAFE_invariant(!1),a.useContext(c).location}function v(e){a.useContext(s).static||a.useLayoutEffect(e)}function h(){let{isDataRoute:e}=a.useContext(d);return e?function(){let{router:e}=O(_.UseNavigateStable),t=j(N.UseNavigateStable),r=a.useRef(!1);return v((()=>{r.current=!0})),a.useCallback((function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,o({fromRouteId:t},a)))}),[e,t])}():function(){f()||r.UNSAFE_invariant(!1);let e=a.useContext(i),{basename:t,future:n,navigator:o}=a.useContext(s),{matches:u}=a.useContext(d),{pathname:l}=m(),c=JSON.stringify(r.UNSAFE_getResolveToMatches(u,n.v7_relativeSplatPath)),p=a.useRef(!1);return v((()=>{p.current=!0})),a.useCallback((function(n,a){if(void 0===a&&(a={}),!p.current)return;if("number"==typeof n)return void o.go(n);let i=r.resolveTo(n,JSON.parse(c),l,"path"===a.relative);null==e&&"/"!==t&&(i.pathname="/"===i.pathname?t:r.joinPaths([t,i.pathname])),(a.replace?o.replace:o.push)(i,a.state,a)}),[t,o,c,l,e])}()}const E=a.createContext(null);function g(e){let t=a.useContext(d).outlet;return t?a.createElement(E.Provider,{value:e},t):t}function y(e,t){let{relative:n}=void 0===t?{}:t,{future:o}=a.useContext(s),{matches:i}=a.useContext(d),{pathname:u}=m(),l=JSON.stringify(r.UNSAFE_getResolveToMatches(i,o.v7_relativeSplatPath));return a.useMemo((()=>r.resolveTo(e,JSON.parse(l),u,"path"===n)),[e,l,u,n])}function b(e,t){return R(e,t)}function R(e,t,n,i){f()||r.UNSAFE_invariant(!1);let{navigator:u}=a.useContext(s),{matches:l}=a.useContext(d),p=l[l.length-1],v=p?p.params:{};!p||p.pathname;let h=p?p.pathnameBase:"/";p&&p.route;let E,g=m();if(t){var y;let e="string"==typeof t?r.parsePath(t):t;"/"===h||(null==(y=e.pathname)?void 0:y.startsWith(h))||r.UNSAFE_invariant(!1),E=e}else E=g;let b=E.pathname||"/",R=b;if("/"!==h){let e=h.replace(/^\//,"").split("/");R="/"+b.replace(/^\//,"").split("/").slice(e.length).join("/")}let P=r.matchRoutes(e,{pathname:R}),x=U(P&&P.map((e=>Object.assign({},e,{params:Object.assign({},v,e.params),pathname:r.joinPaths([h,u.encodeLocation?u.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?h:r.joinPaths([h,u.encodeLocation?u.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,n,i);return t&&x?a.createElement(c.Provider,{value:{location:o({pathname:"/",search:"",hash:"",state:null,key:"default"},E),navigationType:r.Action.Pop}},x):x}function P(){let e=F(),t=r.isRouteErrorResponse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),n?a.createElement("pre",{style:o},n):null,null)}const x=a.createElement(P,null);class C extends a.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||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?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 void 0!==this.state.error?a.createElement(d.Provider,{value:this.props.routeContext},a.createElement(p.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function S(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext(i);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),a.createElement(d.Provider,{value:t},n)}function U(e,t,n,o){var i;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===o&&(o=null),null==e){var u;if(null==(u=n)||!u.errors)return null;e=n.matches}let l=e,s=null==(i=n)?void 0:i.errors;if(null!=s){let e=l.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||r.UNSAFE_invariant(!1),l=l.slice(0,Math.min(l.length,e+1))}let c=!1,d=-1;if(n&&o&&o.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(d=e),t.route.id){let{loaderData:e,errors:r}=n,a=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||a){c=!0,l=d>=0?l.slice(0,d+1):[l[0]];break}}}return l.reduceRight(((e,r,o)=>{let i,u=!1,p=null,f=null;var m;n&&(i=s&&r.route.id?s[r.route.id]:void 0,p=r.route.errorElement||x,c&&(d<0&&0===o?(m="route-fallback",!1||B[m]||(B[m]=!0),u=!0,f=null):d===o&&(u=!0,f=r.route.hydrateFallbackElement||null)));let v=t.concat(l.slice(0,o+1)),h=()=>{let t;return t=i?p:u?f:r.route.Component?a.createElement(r.route.Component,null):r.route.element?r.route.element:e,a.createElement(S,{match:r,routeContext:{outlet:e,matches:v,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?a.createElement(C,{location:n.location,revalidation:n.revalidation,component:p,error:i,children:h(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):h()}),null)}var _=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(_||{}),N=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(N||{});function O(e){let t=a.useContext(i);return t||r.UNSAFE_invariant(!1),t}function A(e){let t=a.useContext(u);return t||r.UNSAFE_invariant(!1),t}function j(e){let t=function(e){let t=a.useContext(d);return t||r.UNSAFE_invariant(!1),t}(),n=t.matches[t.matches.length-1];return n.route.id||r.UNSAFE_invariant(!1),n.route.id}function F(){var e;let t=a.useContext(p),r=A(N.UseRouteError),n=j(N.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function D(){let e=a.useContext(l);return null==e?void 0:e._data}let k=0;const B={};const L=a.startTransition;function M(e){let{routes:t,future:r,state:n}=e;return R(t,void 0,n,r)}function T(e){r.UNSAFE_invariant(!1)}function I(e){let{basename:t="/",children:n=null,location:i,navigationType:u=r.Action.Pop,navigator:l,static:d=!1,future:p}=e;f()&&r.UNSAFE_invariant(!1);let m=t.replace(/^\/*/,"/"),v=a.useMemo((()=>({basename:m,navigator:l,static:d,future:o({v7_relativeSplatPath:!1},p)})),[m,p,l,d]);"string"==typeof i&&(i=r.parsePath(i));let{pathname:h="/",search:E="",hash:g="",state:y=null,key:b="default"}=i,R=a.useMemo((()=>{let e=r.stripBasename(h,m);return null==e?null:{location:{pathname:e,search:E,hash:g,state:y,key:b},navigationType:u}}),[m,h,E,g,y,b,u]);return null==R?null:a.createElement(s.Provider,{value:v},a.createElement(c.Provider,{children:n,value:R}))}var H=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(H||{});const w=new Promise((()=>{}));class J extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:n}=this.props,o=null,i=H.pending;if(n instanceof Promise)if(this.state.error){i=H.error;let e=this.state.error;o=Promise.reject().catch((()=>{})),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_error",{get:()=>e})}else n._tracked?(o=n,i=void 0!==o._error?H.error:void 0!==o._data?H.success:H.pending):(i=H.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),o=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else i=H.success,o=Promise.resolve(),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_data",{get:()=>n});if(i===H.error&&o._error instanceof r.AbortedDeferredError)throw w;if(i===H.error&&!t)throw o._error;if(i===H.error)return a.createElement(l.Provider,{value:o,children:t});if(i===H.success)return a.createElement(l.Provider,{value:o,children:e});throw o}}function z(e){let{children:t}=e,r=D(),n="function"==typeof t?t(r):t;return a.createElement(a.Fragment,null,n)}function q(e,t){void 0===t&&(t=[]);let n=[];return a.Children.forEach(e,((e,o)=>{if(!a.isValidElement(e))return;let i=[...t,o];if(e.type===a.Fragment)return void n.push.apply(n,q(e.props.children,i));e.type!==T&&r.UNSAFE_invariant(!1),e.props.index&&e.props.children&&r.UNSAFE_invariant(!1);let u={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(u.children=q(e.props.children,i)),n.push(u)})),n}function V(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:a.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}Object.defineProperty(e,"AbortedDeferredError",{enumerable:!0,get:function(){return r.AbortedDeferredError}}),Object.defineProperty(e,"NavigationType",{enumerable:!0,get:function(){return r.Action}}),Object.defineProperty(e,"createPath",{enumerable:!0,get:function(){return r.createPath}}),Object.defineProperty(e,"defer",{enumerable:!0,get:function(){return r.defer}}),Object.defineProperty(e,"generatePath",{enumerable:!0,get:function(){return r.generatePath}}),Object.defineProperty(e,"isRouteErrorResponse",{enumerable:!0,get:function(){return r.isRouteErrorResponse}}),Object.defineProperty(e,"json",{enumerable:!0,get:function(){return r.json}}),Object.defineProperty(e,"matchPath",{enumerable:!0,get:function(){return r.matchPath}}),Object.defineProperty(e,"matchRoutes",{enumerable:!0,get:function(){return r.matchRoutes}}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return r.parsePath}}),Object.defineProperty(e,"redirect",{enumerable:!0,get:function(){return r.redirect}}),Object.defineProperty(e,"redirectDocument",{enumerable:!0,get:function(){return r.redirectDocument}}),Object.defineProperty(e,"resolvePath",{enumerable:!0,get:function(){return r.resolvePath}}),e.Await=function(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement(J,{resolve:n,errorElement:r},a.createElement(z,null,t))},e.MemoryRouter=function(e){let{basename:t,children:n,initialEntries:o,initialIndex:i,future:u}=e,l=a.useRef();null==l.current&&(l.current=r.createMemoryHistory({initialEntries:o,initialIndex:i,v5Compat:!0}));let s=l.current,[c,d]=a.useState({action:s.action,location:s.location}),{v7_startTransition:p}=u||{},f=a.useCallback((e=>{p&&L?L((()=>d(e))):d(e)}),[d,p]);return a.useLayoutEffect((()=>s.listen(f)),[s,f]),a.createElement(I,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:s,future:u})},e.Navigate=function(e){let{to:t,replace:n,state:o,relative:i}=e;f()||r.UNSAFE_invariant(!1);let{future:u,static:l}=a.useContext(s),{matches:c}=a.useContext(d),{pathname:p}=m(),v=h(),E=r.resolveTo(t,r.UNSAFE_getResolveToMatches(c,u.v7_relativeSplatPath),p,"path"===i),g=JSON.stringify(E);return a.useEffect((()=>v(JSON.parse(g),{replace:n,state:o,relative:i})),[v,g,i,n,o]),null},e.Outlet=function(e){return g(e.context)},e.Route=T,e.Router=I,e.RouterProvider=function(e){let{fallbackElement:t,router:r,future:n}=e,[o,l]=a.useState(r.state),{v7_startTransition:s}=n||{},c=a.useCallback((e=>{s&&L?L((()=>l(e))):l(e)}),[l,s]);a.useLayoutEffect((()=>r.subscribe(c)),[r,c]),a.useEffect((()=>{}),[]);let d=a.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),p=r.basename||"/",f=a.useMemo((()=>({router:r,navigator:d,static:!1,basename:p})),[r,d,p]);return a.createElement(a.Fragment,null,a.createElement(i.Provider,{value:f},a.createElement(u.Provider,{value:o},a.createElement(I,{basename:p,location:o.location,navigationType:o.historyAction,navigator:d,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},o.initialized||r.future.v7_partialHydration?a.createElement(M,{routes:r.routes,future:r.future,state:o}):t))),null)},e.Routes=function(e){let{children:t,location:r}=e;return b(q(t),r)},e.UNSAFE_DataRouterContext=i,e.UNSAFE_DataRouterStateContext=u,e.UNSAFE_LocationContext=c,e.UNSAFE_NavigationContext=s,e.UNSAFE_RouteContext=d,e.UNSAFE_mapRouteProperties=V,e.UNSAFE_useRouteId=function(){return j(N.UseRouteId)},e.UNSAFE_useRoutesImpl=R,e.createMemoryRouter=function(e,t){return r.createRouter({basename:null==t?void 0:t.basename,future:o({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:r.createMemoryHistory({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:V}).initialize()},e.createRoutesFromChildren=q,e.createRoutesFromElements=q,e.renderMatches=function(e){return U(e)},e.useActionData=function(){let e=A(N.UseActionData),t=j(N.UseLoaderData);return e.actionData?e.actionData[t]:void 0},e.useAsyncError=function(){let e=a.useContext(l);return null==e?void 0:e._error},e.useAsyncValue=D,e.useBlocker=function(e){let{router:t,basename:n}=O(_.UseBlocker),i=A(N.UseBlocker),[u,l]=a.useState(""),s=a.useCallback((t=>{if("function"!=typeof e)return!!e;if("/"===n)return e(t);let{currentLocation:a,nextLocation:i,historyAction:u}=t;return e({currentLocation:o({},a,{pathname:r.stripBasename(a.pathname,n)||a.pathname}),nextLocation:o({},i,{pathname:r.stripBasename(i.pathname,n)||i.pathname}),historyAction:u})}),[n,e]);return a.useEffect((()=>{let e=String(++k);return l(e),()=>t.deleteBlocker(e)}),[t]),a.useEffect((()=>{""!==u&&t.getBlocker(u,s)}),[t,u,s]),u&&i.blockers.has(u)?i.blockers.get(u):r.IDLE_BLOCKER},e.useHref=function(e,t){let{relative:n}=void 0===t?{}:t;f()||r.UNSAFE_invariant(!1);let{basename:o,navigator:i}=a.useContext(s),{hash:u,pathname:l,search:c}=y(e,{relative:n}),d=l;return"/"!==o&&(d="/"===l?o:r.joinPaths([o,l])),i.createHref({pathname:d,search:c,hash:u})},e.useInRouterContext=f,e.useLoaderData=function(){let e=A(N.UseLoaderData),t=j(N.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")},e.useLocation=m,e.useMatch=function(e){f()||r.UNSAFE_invariant(!1);let{pathname:t}=m();return a.useMemo((()=>r.matchPath(e,t)),[t,e])},e.useMatches=function(){let{matches:e,loaderData:t}=A(N.UseMatches);return a.useMemo((()=>e.map((e=>r.UNSAFE_convertRouteMatchToUiMatch(e,t)))),[e,t])},e.useNavigate=h,e.useNavigation=function(){return A(N.UseNavigation).navigation},e.useNavigationType=function(){return a.useContext(c).navigationType},e.useOutlet=g,e.useOutletContext=function(){return a.useContext(E)},e.useParams=function(){let{matches:e}=a.useContext(d),t=e[e.length-1];return t?t.params:{}},e.useResolvedPath=y,e.useRevalidator=function(){let e=O(_.UseRevalidator),t=A(N.UseRevalidator);return a.useMemo((()=>({revalidate:e.router.revalidate,state:t.revalidation})),[e.router.revalidate,t.revalidation])},e.useRouteError=F,e.useRouteLoaderData=function(e){return A(N.UseRouteLoaderData).loaderData[e]},e.useRoutes=b,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@remix-run/router")):"function"==typeof define&&define.amd?define(["exports","react","@remix-run/router"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRouter={},e.React,e.RemixRouter)}(this,(function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=n(t);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(this,arguments)}const i=a.createContext(null),u=a.createContext(null),l=a.createContext(null),s=a.createContext(null),c=a.createContext(null),d=a.createContext({outlet:null,matches:[],isDataRoute:!1}),p=a.createContext(null);function v(){return null!=a.useContext(c)}function f(){return v()||r.UNSAFE_invariant(!1),a.useContext(c).location}function h(e){a.useContext(s).static||a.useLayoutEffect(e)}function m(){let{isDataRoute:e}=a.useContext(d);return e?function(){let{router:e}=F(U.UseNavigateStable),t=O(N.UseNavigateStable),r=a.useRef(!1);return h((()=>{r.current=!0})),a.useCallback((function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,o({fromRouteId:t},a)))}),[e,t])}():function(){v()||r.UNSAFE_invariant(!1);let e=a.useContext(i),{basename:t,future:n,navigator:o}=a.useContext(s),{matches:u}=a.useContext(d),{pathname:l}=f(),c=JSON.stringify(r.UNSAFE_getResolveToMatches(u,n.v7_relativeSplatPath)),p=a.useRef(!1);return h((()=>{p.current=!0})),a.useCallback((function(n,a){if(void 0===a&&(a={}),!p.current)return;if("number"==typeof n)return void o.go(n);let i=r.resolveTo(n,JSON.parse(c),l,"path"===a.relative);null==e&&"/"!==t&&(i.pathname="/"===i.pathname?t:r.joinPaths([t,i.pathname])),(a.replace?o.replace:o.push)(i,a.state,a)}),[t,o,c,l,e])}()}const g=a.createContext(null);function E(e){let t=a.useContext(d).outlet;return t?a.createElement(g.Provider,{value:e},t):t}function y(e,t){let{relative:n}=void 0===t?{}:t,{future:o}=a.useContext(s),{matches:i}=a.useContext(d),{pathname:u}=f(),l=JSON.stringify(r.UNSAFE_getResolveToMatches(i,o.v7_relativeSplatPath));return a.useMemo((()=>r.resolveTo(e,JSON.parse(l),u,"path"===n)),[e,l,u,n])}function b(e,t){return R(e,t)}function R(e,t,n,i){v()||r.UNSAFE_invariant(!1);let{navigator:u}=a.useContext(s),{matches:l}=a.useContext(d),p=l[l.length-1],h=p?p.params:{};!p||p.pathname;let m=p?p.pathnameBase:"/";p&&p.route;let g,E=f();if(t){var y;let e="string"==typeof t?r.parsePath(t):t;"/"===m||(null==(y=e.pathname)?void 0:y.startsWith(m))||r.UNSAFE_invariant(!1),g=e}else g=E;let b=g.pathname||"/",R=b;if("/"!==m){let e=m.replace(/^\//,"").split("/");R="/"+b.replace(/^\//,"").split("/").slice(e.length).join("/")}let _=n&&n.matches&&n.matches.length>0?n.matches:r.matchRoutes(e,{pathname:R}),P=S(_&&_.map((e=>Object.assign({},e,{params:Object.assign({},h,e.params),pathname:r.joinPaths([m,u.encodeLocation?u.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?m:r.joinPaths([m,u.encodeLocation?u.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,n,i);return t&&P?a.createElement(c.Provider,{value:{location:o({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:r.Action.Pop}},P):P}function _(){let e=j(),t=r.isRouteErrorResponse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),n?a.createElement("pre",{style:o},n):null,null)}const P=a.createElement(_,null);class x extends a.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||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?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 void 0!==this.state.error?a.createElement(d.Provider,{value:this.props.routeContext},a.createElement(p.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function C(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext(i);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),a.createElement(d.Provider,{value:t},n)}function S(e,t,n,o){var i;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===o&&(o=null),null==e){var u;if(!n)return null;if(n.errors)e=n.matches;else{if(!(null!=(u=o)&&u.v7_partialHydration&&0===t.length&&!n.initialized&&n.matches.length>0))return null;e=n.matches}}let l=e,s=null==(i=n)?void 0:i.errors;if(null!=s){let e=l.findIndex((e=>e.route.id&&void 0!==(null==s?void 0:s[e.route.id])));e>=0||r.UNSAFE_invariant(!1),l=l.slice(0,Math.min(l.length,e+1))}let c=!1,d=-1;if(n&&o&&o.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(d=e),t.route.id){let{loaderData:e,errors:r}=n,a=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||a){c=!0,l=d>=0?l.slice(0,d+1):[l[0]];break}}}return l.reduceRight(((e,r,o)=>{let i,u=!1,p=null,v=null;var f;n&&(i=s&&r.route.id?s[r.route.id]:void 0,p=r.route.errorElement||P,c&&(d<0&&0===o?(f="route-fallback",!1||B[f]||(B[f]=!0),u=!0,v=null):d===o&&(u=!0,v=r.route.hydrateFallbackElement||null)));let h=t.concat(l.slice(0,o+1)),m=()=>{let t;return t=i?p:u?v:r.route.Component?a.createElement(r.route.Component,null):r.route.element?r.route.element:e,a.createElement(C,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?a.createElement(x,{location:n.location,revalidation:n.revalidation,component:p,error:i,children:m(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):m()}),null)}var U=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(U||{}),N=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(N||{});function F(e){let t=a.useContext(i);return t||r.UNSAFE_invariant(!1),t}function A(e){let t=a.useContext(u);return t||r.UNSAFE_invariant(!1),t}function O(e){let t=function(e){let t=a.useContext(d);return t||r.UNSAFE_invariant(!1),t}(),n=t.matches[t.matches.length-1];return n.route.id||r.UNSAFE_invariant(!1),n.route.id}function j(){var e;let t=a.useContext(p),r=A(N.UseRouteError),n=O(N.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function D(){let e=a.useContext(l);return null==e?void 0:e._data}let k=0;const B={};const M={};const L=(e,t,r)=>{var n;M[n="⚠️ React Router Future Flag Warning: "+t+". You can use the `"+e+"` future flag to opt-in early. For more information, see "+r+"."]||(M[n]=!0,console.warn(n))};function T(e,t){void 0===(null==e?void 0:e.v7_startTransition)&&L("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),void 0!==(null==e?void 0:e.v7_relativeSplatPath)||t&&t.v7_relativeSplatPath||L("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(void 0===t.v7_fetcherPersist&&L("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),void 0===t.v7_normalizeFormMethod&&L("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),void 0===t.v7_partialHydration&&L("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),void 0===t.v7_skipActionErrorRevalidation&&L("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}const H=a.startTransition;function I(e){let{routes:t,future:r,state:n}=e;return R(t,void 0,n,r)}function w(e){r.UNSAFE_invariant(!1)}function z(e){let{basename:t="/",children:n=null,location:i,navigationType:u=r.Action.Pop,navigator:l,static:d=!1,future:p}=e;v()&&r.UNSAFE_invariant(!1);let f=t.replace(/^\/*/,"/"),h=a.useMemo((()=>({basename:f,navigator:l,static:d,future:o({v7_relativeSplatPath:!1},p)})),[f,p,l,d]);"string"==typeof i&&(i=r.parsePath(i));let{pathname:m="/",search:g="",hash:E="",state:y=null,key:b="default"}=i,R=a.useMemo((()=>{let e=r.stripBasename(m,f);return null==e?null:{location:{pathname:e,search:g,hash:E,state:y,key:b},navigationType:u}}),[f,m,g,E,y,b,u]);return null==R?null:a.createElement(s.Provider,{value:h},a.createElement(c.Provider,{children:n,value:R}))}var J=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(J||{});const V=new Promise((()=>{}));class W extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:n}=this.props,o=null,i=J.pending;if(n instanceof Promise)if(this.state.error){i=J.error;let e=this.state.error;o=Promise.reject().catch((()=>{})),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_error",{get:()=>e})}else n._tracked?(o=n,i="_error"in o?J.error:"_data"in o?J.success:J.pending):(i=J.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),o=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else i=J.success,o=Promise.resolve(),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_data",{get:()=>n});if(i===J.error&&o._error instanceof r.AbortedDeferredError)throw V;if(i===J.error&&!t)throw o._error;if(i===J.error)return a.createElement(l.Provider,{value:o,children:t});if(i===J.success)return a.createElement(l.Provider,{value:o,children:e});throw o}}function q(e){let{children:t}=e,r=D(),n="function"==typeof t?t(r):t;return a.createElement(a.Fragment,null,n)}function Y(e,t){void 0===t&&(t=[]);let n=[];return a.Children.forEach(e,((e,o)=>{if(!a.isValidElement(e))return;let i=[...t,o];if(e.type===a.Fragment)return void n.push.apply(n,Y(e.props.children,i));e.type!==w&&r.UNSAFE_invariant(!1),e.props.index&&e.props.children&&r.UNSAFE_invariant(!1);let u={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(u.children=Y(e.props.children,i)),n.push(u)})),n}function K(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:a.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}Object.defineProperty(e,"AbortedDeferredError",{enumerable:!0,get:function(){return r.AbortedDeferredError}}),Object.defineProperty(e,"NavigationType",{enumerable:!0,get:function(){return r.Action}}),Object.defineProperty(e,"createPath",{enumerable:!0,get:function(){return r.createPath}}),Object.defineProperty(e,"defer",{enumerable:!0,get:function(){return r.defer}}),Object.defineProperty(e,"generatePath",{enumerable:!0,get:function(){return r.generatePath}}),Object.defineProperty(e,"isRouteErrorResponse",{enumerable:!0,get:function(){return r.isRouteErrorResponse}}),Object.defineProperty(e,"json",{enumerable:!0,get:function(){return r.json}}),Object.defineProperty(e,"matchPath",{enumerable:!0,get:function(){return r.matchPath}}),Object.defineProperty(e,"matchRoutes",{enumerable:!0,get:function(){return r.matchRoutes}}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return r.parsePath}}),Object.defineProperty(e,"redirect",{enumerable:!0,get:function(){return r.redirect}}),Object.defineProperty(e,"redirectDocument",{enumerable:!0,get:function(){return r.redirectDocument}}),Object.defineProperty(e,"replace",{enumerable:!0,get:function(){return r.replace}}),Object.defineProperty(e,"resolvePath",{enumerable:!0,get:function(){return r.resolvePath}}),e.Await=function(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement(W,{resolve:n,errorElement:r},a.createElement(q,null,t))},e.MemoryRouter=function(e){let{basename:t,children:n,initialEntries:o,initialIndex:i,future:u}=e,l=a.useRef();null==l.current&&(l.current=r.createMemoryHistory({initialEntries:o,initialIndex:i,v5Compat:!0}));let s=l.current,[c,d]=a.useState({action:s.action,location:s.location}),{v7_startTransition:p}=u||{},v=a.useCallback((e=>{p&&H?H((()=>d(e))):d(e)}),[d,p]);return a.useLayoutEffect((()=>s.listen(v)),[s,v]),a.useEffect((()=>T(u)),[u]),a.createElement(z,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:s,future:u})},e.Navigate=function(e){let{to:t,replace:n,state:o,relative:i}=e;v()||r.UNSAFE_invariant(!1);let{future:u,static:l}=a.useContext(s),{matches:c}=a.useContext(d),{pathname:p}=f(),h=m(),g=r.resolveTo(t,r.UNSAFE_getResolveToMatches(c,u.v7_relativeSplatPath),p,"path"===i),E=JSON.stringify(g);return a.useEffect((()=>h(JSON.parse(E),{replace:n,state:o,relative:i})),[h,E,i,n,o]),null},e.Outlet=function(e){return E(e.context)},e.Route=w,e.Router=z,e.RouterProvider=function(e){let{fallbackElement:t,router:r,future:n}=e,[o,l]=a.useState(r.state),{v7_startTransition:s}=n||{},c=a.useCallback((e=>{s&&H?H((()=>l(e))):l(e)}),[l,s]);a.useLayoutEffect((()=>r.subscribe(c)),[r,c]),a.useEffect((()=>{}),[]);let d=a.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),p=r.basename||"/",v=a.useMemo((()=>({router:r,navigator:d,static:!1,basename:p})),[r,d,p]);return a.useEffect((()=>T(n,r.future)),[r,n]),a.createElement(a.Fragment,null,a.createElement(i.Provider,{value:v},a.createElement(u.Provider,{value:o},a.createElement(z,{basename:p,location:o.location,navigationType:o.historyAction,navigator:d,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},o.initialized||r.future.v7_partialHydration?a.createElement(I,{routes:r.routes,future:r.future,state:o}):t))),null)},e.Routes=function(e){let{children:t,location:r}=e;return b(Y(t),r)},e.UNSAFE_DataRouterContext=i,e.UNSAFE_DataRouterStateContext=u,e.UNSAFE_LocationContext=c,e.UNSAFE_NavigationContext=s,e.UNSAFE_RouteContext=d,e.UNSAFE_logV6DeprecationWarnings=T,e.UNSAFE_mapRouteProperties=K,e.UNSAFE_useRouteId=function(){return O(N.UseRouteId)},e.UNSAFE_useRoutesImpl=R,e.createMemoryRouter=function(e,t){return r.createRouter({basename:null==t?void 0:t.basename,future:o({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:r.createMemoryHistory({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:K,dataStrategy:null==t?void 0:t.dataStrategy,patchRoutesOnNavigation:null==t?void 0:t.patchRoutesOnNavigation}).initialize()},e.createRoutesFromChildren=Y,e.createRoutesFromElements=Y,e.renderMatches=function(e){return S(e)},e.useActionData=function(){let e=A(N.UseActionData),t=O(N.UseLoaderData);return e.actionData?e.actionData[t]:void 0},e.useAsyncError=function(){let e=a.useContext(l);return null==e?void 0:e._error},e.useAsyncValue=D,e.useBlocker=function(e){let{router:t,basename:n}=F(U.UseBlocker),i=A(N.UseBlocker),[u,l]=a.useState(""),s=a.useCallback((t=>{if("function"!=typeof e)return!!e;if("/"===n)return e(t);let{currentLocation:a,nextLocation:i,historyAction:u}=t;return e({currentLocation:o({},a,{pathname:r.stripBasename(a.pathname,n)||a.pathname}),nextLocation:o({},i,{pathname:r.stripBasename(i.pathname,n)||i.pathname}),historyAction:u})}),[n,e]);return a.useEffect((()=>{let e=String(++k);return l(e),()=>t.deleteBlocker(e)}),[t]),a.useEffect((()=>{""!==u&&t.getBlocker(u,s)}),[t,u,s]),u&&i.blockers.has(u)?i.blockers.get(u):r.IDLE_BLOCKER},e.useHref=function(e,t){let{relative:n}=void 0===t?{}:t;v()||r.UNSAFE_invariant(!1);let{basename:o,navigator:i}=a.useContext(s),{hash:u,pathname:l,search:c}=y(e,{relative:n}),d=l;return"/"!==o&&(d="/"===l?o:r.joinPaths([o,l])),i.createHref({pathname:d,search:c,hash:u})},e.useInRouterContext=v,e.useLoaderData=function(){let e=A(N.UseLoaderData),t=O(N.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")},e.useLocation=f,e.useMatch=function(e){v()||r.UNSAFE_invariant(!1);let{pathname:t}=f();return a.useMemo((()=>r.matchPath(e,r.UNSAFE_decodePath(t))),[t,e])},e.useMatches=function(){let{matches:e,loaderData:t}=A(N.UseMatches);return a.useMemo((()=>e.map((e=>r.UNSAFE_convertRouteMatchToUiMatch(e,t)))),[e,t])},e.useNavigate=m,e.useNavigation=function(){return A(N.UseNavigation).navigation},e.useNavigationType=function(){return a.useContext(c).navigationType},e.useOutlet=E,e.useOutletContext=function(){return a.useContext(g)},e.useParams=function(){let{matches:e}=a.useContext(d),t=e[e.length-1];return t?t.params:{}},e.useResolvedPath=y,e.useRevalidator=function(){let e=F(U.UseRevalidator),t=A(N.UseRevalidator);return a.useMemo((()=>({revalidate:e.router.revalidate,state:t.revalidation})),[e.router.revalidate,t.revalidation])},e.useRouteError=j,e.useRouteLoaderData=function(e){return A(N.UseRouteLoaderData).loaderData[e]},e.useRoutes=b,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=react-router.production.min.js.map
{
"name": "react-router",
"version": "0.0.0-experimental-114cf0b7",
"version": "0.0.0-experimental-119d5d872",
"description": "Declarative routing for React",

@@ -26,6 +26,7 @@ "keywords": [

"dependencies": {
"@remix-run/router": "0.0.0-experimental-114cf0b7"
"@remix-run/router": "0.0.0-experimental-119d5d872"
},
"devDependencies": {
"react": "^18.2.0"
"react": "^18.2.0",
"react-router-dom": "0.0.0-experimental-119d5d872"
},

@@ -44,2 +45,2 @@ "peerDependencies": {

}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet