react-router 7.9.6-pre.1 → 7.10.0-pre.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +69 -4
  2. package/dist/development/{browser-C07r42Tt.d.mts → browser-BHySFrZ2.d.mts} +1 -1
  3. package/dist/development/{browser-BbBXFHbO.d.ts → browser-eL-tAN4R.d.ts} +1 -1
  4. package/dist/development/{chunk-HSVNPM3C.js → chunk-2VILFZWG.js} +167 -123
  5. package/dist/development/{chunk-DKSAHU2I.mjs → chunk-4BTFPFZR.mjs} +208 -221
  6. package/dist/development/{chunk-RGKEVI2W.mjs → chunk-CECIHG5K.mjs} +15 -5
  7. package/dist/development/{chunk-CYHICRRW.js → chunk-M4WLV5HP.js} +201 -258
  8. package/dist/development/{chunk-OLIKX45O.js → chunk-Z4R76DXJ.js} +7 -7
  9. package/dist/development/dom-export.d.mts +21 -2
  10. package/dist/development/dom-export.d.ts +21 -2
  11. package/dist/development/dom-export.js +158 -103
  12. package/dist/development/dom-export.mjs +133 -79
  13. package/dist/development/{index-react-server-client-Da3kmxNd.d.ts → index-react-server-client-CNrKUHDv.d.ts} +59 -7
  14. package/dist/{production/index-react-server-client-rcoGPJhU.d.mts → development/index-react-server-client-DYtvZPLT.d.mts} +59 -7
  15. package/dist/development/index-react-server-client.d.mts +2 -2
  16. package/dist/development/index-react-server-client.d.ts +2 -2
  17. package/dist/development/index-react-server-client.js +4 -4
  18. package/dist/development/index-react-server-client.mjs +2 -2
  19. package/dist/development/index-react-server.d.mts +19 -4
  20. package/dist/development/index-react-server.d.ts +19 -4
  21. package/dist/development/index-react-server.js +30 -24
  22. package/dist/development/index-react-server.mjs +30 -24
  23. package/dist/development/index.d.mts +19 -15
  24. package/dist/development/index.d.ts +19 -15
  25. package/dist/development/index.js +92 -82
  26. package/dist/development/index.mjs +3 -3
  27. package/dist/{production/instrumentation-Unc20tLk.d.ts → development/instrumentation-Dwf-sTWa.d.ts} +66 -8
  28. package/dist/development/lib/types/internal.d.mts +2 -2
  29. package/dist/development/lib/types/internal.d.ts +2 -2
  30. package/dist/development/lib/types/internal.js +1 -1
  31. package/dist/development/lib/types/internal.mjs +1 -1
  32. package/dist/development/{register-BpU9rFBJ.d.ts → register-BnQsYkwj.d.ts} +1 -1
  33. package/dist/development/{register-QkB3HGjm.d.mts → register-C97Jz2jB.d.mts} +1 -1
  34. package/dist/development/{router-CAvh_Drx.d.mts → router-Dgz_Mh9m.d.mts} +66 -8
  35. package/dist/production/{browser-C07r42Tt.d.mts → browser-BHySFrZ2.d.mts} +1 -1
  36. package/dist/production/{browser-BbBXFHbO.d.ts → browser-eL-tAN4R.d.ts} +1 -1
  37. package/dist/production/{chunk-2DNJUQK6.js → chunk-55FFLVQP.js} +201 -258
  38. package/dist/production/{chunk-EDK3MRM6.js → chunk-5DTJHKF7.js} +167 -123
  39. package/dist/production/{chunk-LESYMMDQ.mjs → chunk-KJ5676BZ.mjs} +208 -221
  40. package/dist/production/{chunk-LC2OWLJG.mjs → chunk-QKAGOFED.mjs} +15 -5
  41. package/dist/production/{chunk-JLDESRHY.js → chunk-SGCRBGEM.js} +7 -7
  42. package/dist/production/dom-export.d.mts +21 -2
  43. package/dist/production/dom-export.d.ts +21 -2
  44. package/dist/production/dom-export.js +158 -103
  45. package/dist/production/dom-export.mjs +133 -79
  46. package/dist/production/{index-react-server-client-Da3kmxNd.d.ts → index-react-server-client-CNrKUHDv.d.ts} +59 -7
  47. package/dist/{development/index-react-server-client-rcoGPJhU.d.mts → production/index-react-server-client-DYtvZPLT.d.mts} +59 -7
  48. package/dist/production/index-react-server-client.d.mts +2 -2
  49. package/dist/production/index-react-server-client.d.ts +2 -2
  50. package/dist/production/index-react-server-client.js +4 -4
  51. package/dist/production/index-react-server-client.mjs +2 -2
  52. package/dist/production/index-react-server.d.mts +19 -4
  53. package/dist/production/index-react-server.d.ts +19 -4
  54. package/dist/production/index-react-server.js +30 -24
  55. package/dist/production/index-react-server.mjs +30 -24
  56. package/dist/production/index.d.mts +19 -15
  57. package/dist/production/index.d.ts +19 -15
  58. package/dist/production/index.js +92 -82
  59. package/dist/production/index.mjs +3 -3
  60. package/dist/{development/instrumentation-Unc20tLk.d.ts → production/instrumentation-Dwf-sTWa.d.ts} +66 -8
  61. package/dist/production/lib/types/internal.d.mts +2 -2
  62. package/dist/production/lib/types/internal.d.ts +2 -2
  63. package/dist/production/lib/types/internal.js +1 -1
  64. package/dist/production/lib/types/internal.mjs +1 -1
  65. package/dist/production/{register-BpU9rFBJ.d.ts → register-BnQsYkwj.d.ts} +1 -1
  66. package/dist/production/{register-QkB3HGjm.d.mts → register-C97Jz2jB.d.mts} +1 -1
  67. package/dist/production/{router-CAvh_Drx.d.mts → router-Dgz_Mh9m.d.mts} +66 -8
  68. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.9.6-pre.1
2
+ * react-router v7.10.0-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -32,7 +32,7 @@ import {
32
32
  WithComponentProps,
33
33
  WithErrorBoundaryProps,
34
34
  WithHydrateFallbackProps
35
- } from "./chunk-DKSAHU2I.mjs";
35
+ } from "./chunk-4BTFPFZR.mjs";
36
36
  export {
37
37
  BrowserRouter,
38
38
  Form,
@@ -497,6 +497,8 @@ interface DataStrategyMatch extends AgnosticRouteMatch<string, AgnosticDataRoute
497
497
  route: Promise<void> | undefined;
498
498
  };
499
499
  /**
500
+ * @deprecated Deprecated in favor of `shouldCallHandler`
501
+ *
500
502
  * A boolean value indicating whether this route handler should be called in
501
503
  * this pass.
502
504
  *
@@ -522,8 +524,20 @@ interface DataStrategyMatch extends AgnosticRouteMatch<string, AgnosticDataRoute
522
524
  * custom `shouldRevalidate` implementations)
523
525
  */
524
526
  shouldLoad: boolean;
525
- unstable_shouldRevalidateArgs: ShouldRevalidateFunctionArgs | null;
526
- unstable_shouldCallHandler(defaultShouldRevalidate?: boolean): boolean;
527
+ /**
528
+ * Arguments passed to the `shouldRevalidate` function for this `loader` execution.
529
+ * Will be `null` if this is not a revalidating loader {@link DataStrategyMatch}.
530
+ */
531
+ shouldRevalidateArgs: ShouldRevalidateFunctionArgs | null;
532
+ /**
533
+ * Determine if this route's handler should be called during this `dataStrategy`
534
+ * execution. Calling it with no arguments will leverage the default revalidation
535
+ * behavior. You can pass your own `defaultShouldRevalidate` value if you wish
536
+ * to change the default revalidation behavior with your `dataStrategy`.
537
+ *
538
+ * @param defaultShouldRevalidate `defaultShouldRevalidate` override value (optional)
539
+ */
540
+ shouldCallHandler(defaultShouldRevalidate?: boolean): boolean;
527
541
  /**
528
542
  * An async function that will resolve any `route.lazy` implementations and
529
543
  * execute the route's handler (if necessary), returning a {@link DataStrategyResult}
@@ -862,7 +876,8 @@ type ErrorResponse = {
862
876
  /**
863
877
  * Check if the given error is an {@link ErrorResponse} generated from a 4xx/5xx
864
878
  * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
865
- * thrown from an [`action`](../../start/framework/route-module#action)/[`loader`](../../start/framework/route-module#loader)
879
+ * thrown from an [`action`](../../start/framework/route-module#action) or
880
+ * [`loader`](../../start/framework/route-module#loader) function.
866
881
  *
867
882
  * @example
868
883
  * import { isRouteErrorResponse } from "react-router";
@@ -888,7 +903,6 @@ type ErrorResponse = {
888
903
  * @mode data
889
904
  * @param error The error to check.
890
905
  * @returns `true` if the error is an {@link ErrorResponse}, `false` otherwise.
891
- *
892
906
  */
893
907
  declare function isRouteErrorResponse(error: any): error is ErrorResponse;
894
908
 
@@ -1324,6 +1338,7 @@ type ViewTransitionOpts = {
1324
1338
  interface RouterSubscriber {
1325
1339
  (state: RouterState, opts: {
1326
1340
  deletedFetchers: string[];
1341
+ newErrors: RouteData | null;
1327
1342
  viewTransitionOpts?: ViewTransitionOpts;
1328
1343
  flushSync: boolean;
1329
1344
  }): void;
@@ -497,6 +497,8 @@ interface DataStrategyMatch extends AgnosticRouteMatch<string, AgnosticDataRoute
497
497
  route: Promise<void> | undefined;
498
498
  };
499
499
  /**
500
+ * @deprecated Deprecated in favor of `shouldCallHandler`
501
+ *
500
502
  * A boolean value indicating whether this route handler should be called in
501
503
  * this pass.
502
504
  *
@@ -522,8 +524,20 @@ interface DataStrategyMatch extends AgnosticRouteMatch<string, AgnosticDataRoute
522
524
  * custom `shouldRevalidate` implementations)
523
525
  */
524
526
  shouldLoad: boolean;
525
- unstable_shouldRevalidateArgs: ShouldRevalidateFunctionArgs | null;
526
- unstable_shouldCallHandler(defaultShouldRevalidate?: boolean): boolean;
527
+ /**
528
+ * Arguments passed to the `shouldRevalidate` function for this `loader` execution.
529
+ * Will be `null` if this is not a revalidating loader {@link DataStrategyMatch}.
530
+ */
531
+ shouldRevalidateArgs: ShouldRevalidateFunctionArgs | null;
532
+ /**
533
+ * Determine if this route's handler should be called during this `dataStrategy`
534
+ * execution. Calling it with no arguments will leverage the default revalidation
535
+ * behavior. You can pass your own `defaultShouldRevalidate` value if you wish
536
+ * to change the default revalidation behavior with your `dataStrategy`.
537
+ *
538
+ * @param defaultShouldRevalidate `defaultShouldRevalidate` override value (optional)
539
+ */
540
+ shouldCallHandler(defaultShouldRevalidate?: boolean): boolean;
527
541
  /**
528
542
  * An async function that will resolve any `route.lazy` implementations and
529
543
  * execute the route's handler (if necessary), returning a {@link DataStrategyResult}
@@ -862,7 +876,8 @@ type ErrorResponse = {
862
876
  /**
863
877
  * Check if the given error is an {@link ErrorResponse} generated from a 4xx/5xx
864
878
  * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
865
- * thrown from an [`action`](../../start/framework/route-module#action)/[`loader`](../../start/framework/route-module#loader)
879
+ * thrown from an [`action`](../../start/framework/route-module#action) or
880
+ * [`loader`](../../start/framework/route-module#loader) function.
866
881
  *
867
882
  * @example
868
883
  * import { isRouteErrorResponse } from "react-router";
@@ -888,7 +903,6 @@ type ErrorResponse = {
888
903
  * @mode data
889
904
  * @param error The error to check.
890
905
  * @returns `true` if the error is an {@link ErrorResponse}, `false` otherwise.
891
- *
892
906
  */
893
907
  declare function isRouteErrorResponse(error: any): error is ErrorResponse;
894
908
 
@@ -1324,6 +1338,7 @@ type ViewTransitionOpts = {
1324
1338
  interface RouterSubscriber {
1325
1339
  (state: RouterState, opts: {
1326
1340
  deletedFetchers: string[];
1341
+ newErrors: RouteData | null;
1327
1342
  viewTransitionOpts?: ViewTransitionOpts;
1328
1343
  flushSync: boolean;
1329
1344
  }): void;
@@ -27,7 +27,7 @@ function _interopNamespace(e) {
27
27
  var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
28
28
 
29
29
  /**
30
- * react-router v7.9.6-pre.1
30
+ * react-router v7.10.0-pre.0
31
31
  *
32
32
  * Copyright (c) Remix Software Inc.
33
33
  *
@@ -869,8 +869,8 @@ var ErrorResponseImpl = class {
869
869
  function isRouteErrorResponse(error) {
870
870
  return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error;
871
871
  }
872
- function getRoutePattern(paths) {
873
- return paths.filter(Boolean).join("/").replace(/\/\/*/g, "/") || "/";
872
+ function getRoutePattern(matches) {
873
+ return matches.map((m) => m.route.path).filter(Boolean).join("/").replace(/\/\/*/g, "/") || "/";
874
874
  }
875
875
 
876
876
  // lib/router/router.ts
@@ -983,7 +983,7 @@ function createStaticHandler(routes, opts) {
983
983
  let response = await runServerMiddlewarePipeline(
984
984
  {
985
985
  request,
986
- unstable_pattern: getRoutePattern(matches.map((m) => m.route.path)),
986
+ unstable_pattern: getRoutePattern(matches),
987
987
  matches,
988
988
  params: matches[0].params,
989
989
  // If we're calling middleware then it must be enabled so we can cast
@@ -1129,7 +1129,7 @@ function createStaticHandler(routes, opts) {
1129
1129
  let response = await runServerMiddlewarePipeline(
1130
1130
  {
1131
1131
  request,
1132
- unstable_pattern: getRoutePattern(matches.map((m) => m.route.path)),
1132
+ unstable_pattern: getRoutePattern(matches),
1133
1133
  matches,
1134
1134
  params: matches[0].params,
1135
1135
  // If we're calling middleware then it must be enabled so we can cast
@@ -1405,7 +1405,7 @@ function createStaticHandler(routes, opts) {
1405
1405
  // Up to but not including the boundary
1406
1406
  matches.findIndex((m) => m.route.id === pendingActionResult[0]) - 1
1407
1407
  ) : void 0;
1408
- let pattern = getRoutePattern(matches.map((m) => m.route.path));
1408
+ let pattern = getRoutePattern(matches);
1409
1409
  dsMatches = matches.map((match, index) => {
1410
1410
  if (maxIdx != null && index > maxIdx) {
1411
1411
  return getDataStrategyMatch(
@@ -1850,7 +1850,7 @@ function getDataStrategyMatchLazyPromises(mapRouteProperties, manifest, request,
1850
1850
  handler: lazyRoutePromises.lazyHandlerPromise
1851
1851
  };
1852
1852
  }
1853
- function getDataStrategyMatch(mapRouteProperties, manifest, request, unstable_pattern, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, unstable_shouldRevalidateArgs = null) {
1853
+ function getDataStrategyMatch(mapRouteProperties, manifest, request, unstable_pattern, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, shouldRevalidateArgs = null) {
1854
1854
  let isUsingNewApi = false;
1855
1855
  let _lazyPromises = getDataStrategyMatchLazyPromises(
1856
1856
  mapRouteProperties,
@@ -1863,19 +1863,19 @@ function getDataStrategyMatch(mapRouteProperties, manifest, request, unstable_pa
1863
1863
  ...match,
1864
1864
  _lazyPromises,
1865
1865
  shouldLoad,
1866
- unstable_shouldRevalidateArgs,
1867
- unstable_shouldCallHandler(defaultShouldRevalidate) {
1866
+ shouldRevalidateArgs,
1867
+ shouldCallHandler(defaultShouldRevalidate) {
1868
1868
  isUsingNewApi = true;
1869
- if (!unstable_shouldRevalidateArgs) {
1869
+ if (!shouldRevalidateArgs) {
1870
1870
  return shouldLoad;
1871
1871
  }
1872
1872
  if (typeof defaultShouldRevalidate === "boolean") {
1873
1873
  return shouldRevalidateLoader(match, {
1874
- ...unstable_shouldRevalidateArgs,
1874
+ ...shouldRevalidateArgs,
1875
1875
  defaultShouldRevalidate
1876
1876
  });
1877
1877
  }
1878
- return shouldRevalidateLoader(match, unstable_shouldRevalidateArgs);
1878
+ return shouldRevalidateLoader(match, shouldRevalidateArgs);
1879
1879
  },
1880
1880
  resolve(handlerOverride) {
1881
1881
  let { lazy, loader, middleware } = match.route;
@@ -1902,8 +1902,8 @@ function getTargetedDataStrategyMatches(mapRouteProperties, manifest, request, m
1902
1902
  return {
1903
1903
  ...match,
1904
1904
  shouldLoad: false,
1905
- unstable_shouldRevalidateArgs: shouldRevalidateArgs,
1906
- unstable_shouldCallHandler: () => false,
1905
+ shouldRevalidateArgs,
1906
+ shouldCallHandler: () => false,
1907
1907
  _lazyPromises: getDataStrategyMatchLazyPromises(
1908
1908
  mapRouteProperties,
1909
1909
  manifest,
@@ -1918,7 +1918,7 @@ function getTargetedDataStrategyMatches(mapRouteProperties, manifest, request, m
1918
1918
  mapRouteProperties,
1919
1919
  manifest,
1920
1920
  request,
1921
- getRoutePattern(matches.map((m) => m.route.path)),
1921
+ getRoutePattern(matches),
1922
1922
  match,
1923
1923
  lazyRoutePropertiesToSkip,
1924
1924
  scopedContext,
@@ -1933,7 +1933,7 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
1933
1933
  }
1934
1934
  let dataStrategyArgs = {
1935
1935
  request,
1936
- unstable_pattern: getRoutePattern(matches.map((m) => m.route.path)),
1936
+ unstable_pattern: getRoutePattern(matches),
1937
1937
  params: matches[0].params,
1938
1938
  context: scopedContext,
1939
1939
  matches
@@ -2103,11 +2103,7 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
2103
2103
  }
2104
2104
  return {
2105
2105
  type: "error" /* error */,
2106
- error: new ErrorResponseImpl(
2107
- result.init?.status || 500,
2108
- void 0,
2109
- result.data
2110
- ),
2106
+ error: dataWithResponseInitToErrorResponse(result),
2111
2107
  statusCode: isRouteErrorResponse(result) ? result.status : void 0,
2112
2108
  headers: result.init?.headers ? new Headers(result.init.headers) : void 0
2113
2109
  };
@@ -3135,12 +3131,12 @@ function canDecodeWithFormData(contentType) {
3135
3131
  // lib/href.ts
3136
3132
  function href(path, ...args) {
3137
3133
  let params = args[0];
3138
- let result = path.replace(/\/*\*?$/, "").replace(
3134
+ let result = trimTrailingSplat(path).replace(
3139
3135
  /\/:([\w-]+)(\?)?/g,
3140
3136
  // same regex as in .\router\utils.ts: compilePath().
3141
3137
  (_, param, questionMark) => {
3142
3138
  const isRequired = questionMark === void 0;
3143
- const value = params ? params[param] : void 0;
3139
+ const value = params?.[param];
3144
3140
  if (isRequired && value === void 0) {
3145
3141
  throw new Error(
3146
3142
  `Path '${path}' requires param '${param}' but it was not provided`
@@ -3150,13 +3146,23 @@ function href(path, ...args) {
3150
3146
  }
3151
3147
  );
3152
3148
  if (path.endsWith("*")) {
3153
- const value = params ? params["*"] : void 0;
3149
+ const value = params?.["*"];
3154
3150
  if (value !== void 0) {
3155
3151
  result += "/" + value;
3156
3152
  }
3157
3153
  }
3158
3154
  return result || "/";
3159
3155
  }
3156
+ function trimTrailingSplat(path) {
3157
+ let i = path.length - 1;
3158
+ let char = path[i];
3159
+ if (char !== "*" && char !== "/") return path;
3160
+ i--;
3161
+ for (; i >= 0; i--) {
3162
+ if (path[i] !== "/") break;
3163
+ }
3164
+ return path.slice(0, i + 1);
3165
+ }
3160
3166
 
3161
3167
  // lib/server-runtime/crypto.ts
3162
3168
  var encoder = /* @__PURE__ */ new TextEncoder();
@@ -6,7 +6,7 @@ export { BrowserRouter, Form, HashRouter, Link, Links, MemoryRouter, Meta, NavLi
6
6
  import { serialize, parse } from 'cookie';
7
7
 
8
8
  /**
9
- * react-router v7.9.6-pre.1
9
+ * react-router v7.10.0-pre.0
10
10
  *
11
11
  * Copyright (c) Remix Software Inc.
12
12
  *
@@ -848,8 +848,8 @@ var ErrorResponseImpl = class {
848
848
  function isRouteErrorResponse(error) {
849
849
  return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error;
850
850
  }
851
- function getRoutePattern(paths) {
852
- return paths.filter(Boolean).join("/").replace(/\/\/*/g, "/") || "/";
851
+ function getRoutePattern(matches) {
852
+ return matches.map((m) => m.route.path).filter(Boolean).join("/").replace(/\/\/*/g, "/") || "/";
853
853
  }
854
854
 
855
855
  // lib/router/router.ts
@@ -962,7 +962,7 @@ function createStaticHandler(routes, opts) {
962
962
  let response = await runServerMiddlewarePipeline(
963
963
  {
964
964
  request,
965
- unstable_pattern: getRoutePattern(matches.map((m) => m.route.path)),
965
+ unstable_pattern: getRoutePattern(matches),
966
966
  matches,
967
967
  params: matches[0].params,
968
968
  // If we're calling middleware then it must be enabled so we can cast
@@ -1108,7 +1108,7 @@ function createStaticHandler(routes, opts) {
1108
1108
  let response = await runServerMiddlewarePipeline(
1109
1109
  {
1110
1110
  request,
1111
- unstable_pattern: getRoutePattern(matches.map((m) => m.route.path)),
1111
+ unstable_pattern: getRoutePattern(matches),
1112
1112
  matches,
1113
1113
  params: matches[0].params,
1114
1114
  // If we're calling middleware then it must be enabled so we can cast
@@ -1384,7 +1384,7 @@ function createStaticHandler(routes, opts) {
1384
1384
  // Up to but not including the boundary
1385
1385
  matches.findIndex((m) => m.route.id === pendingActionResult[0]) - 1
1386
1386
  ) : void 0;
1387
- let pattern = getRoutePattern(matches.map((m) => m.route.path));
1387
+ let pattern = getRoutePattern(matches);
1388
1388
  dsMatches = matches.map((match, index) => {
1389
1389
  if (maxIdx != null && index > maxIdx) {
1390
1390
  return getDataStrategyMatch(
@@ -1829,7 +1829,7 @@ function getDataStrategyMatchLazyPromises(mapRouteProperties, manifest, request,
1829
1829
  handler: lazyRoutePromises.lazyHandlerPromise
1830
1830
  };
1831
1831
  }
1832
- function getDataStrategyMatch(mapRouteProperties, manifest, request, unstable_pattern, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, unstable_shouldRevalidateArgs = null) {
1832
+ function getDataStrategyMatch(mapRouteProperties, manifest, request, unstable_pattern, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, shouldRevalidateArgs = null) {
1833
1833
  let isUsingNewApi = false;
1834
1834
  let _lazyPromises = getDataStrategyMatchLazyPromises(
1835
1835
  mapRouteProperties,
@@ -1842,19 +1842,19 @@ function getDataStrategyMatch(mapRouteProperties, manifest, request, unstable_pa
1842
1842
  ...match,
1843
1843
  _lazyPromises,
1844
1844
  shouldLoad,
1845
- unstable_shouldRevalidateArgs,
1846
- unstable_shouldCallHandler(defaultShouldRevalidate) {
1845
+ shouldRevalidateArgs,
1846
+ shouldCallHandler(defaultShouldRevalidate) {
1847
1847
  isUsingNewApi = true;
1848
- if (!unstable_shouldRevalidateArgs) {
1848
+ if (!shouldRevalidateArgs) {
1849
1849
  return shouldLoad;
1850
1850
  }
1851
1851
  if (typeof defaultShouldRevalidate === "boolean") {
1852
1852
  return shouldRevalidateLoader(match, {
1853
- ...unstable_shouldRevalidateArgs,
1853
+ ...shouldRevalidateArgs,
1854
1854
  defaultShouldRevalidate
1855
1855
  });
1856
1856
  }
1857
- return shouldRevalidateLoader(match, unstable_shouldRevalidateArgs);
1857
+ return shouldRevalidateLoader(match, shouldRevalidateArgs);
1858
1858
  },
1859
1859
  resolve(handlerOverride) {
1860
1860
  let { lazy, loader, middleware } = match.route;
@@ -1881,8 +1881,8 @@ function getTargetedDataStrategyMatches(mapRouteProperties, manifest, request, m
1881
1881
  return {
1882
1882
  ...match,
1883
1883
  shouldLoad: false,
1884
- unstable_shouldRevalidateArgs: shouldRevalidateArgs,
1885
- unstable_shouldCallHandler: () => false,
1884
+ shouldRevalidateArgs,
1885
+ shouldCallHandler: () => false,
1886
1886
  _lazyPromises: getDataStrategyMatchLazyPromises(
1887
1887
  mapRouteProperties,
1888
1888
  manifest,
@@ -1897,7 +1897,7 @@ function getTargetedDataStrategyMatches(mapRouteProperties, manifest, request, m
1897
1897
  mapRouteProperties,
1898
1898
  manifest,
1899
1899
  request,
1900
- getRoutePattern(matches.map((m) => m.route.path)),
1900
+ getRoutePattern(matches),
1901
1901
  match,
1902
1902
  lazyRoutePropertiesToSkip,
1903
1903
  scopedContext,
@@ -1912,7 +1912,7 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
1912
1912
  }
1913
1913
  let dataStrategyArgs = {
1914
1914
  request,
1915
- unstable_pattern: getRoutePattern(matches.map((m) => m.route.path)),
1915
+ unstable_pattern: getRoutePattern(matches),
1916
1916
  params: matches[0].params,
1917
1917
  context: scopedContext,
1918
1918
  matches
@@ -2082,11 +2082,7 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
2082
2082
  }
2083
2083
  return {
2084
2084
  type: "error" /* error */,
2085
- error: new ErrorResponseImpl(
2086
- result.init?.status || 500,
2087
- void 0,
2088
- result.data
2089
- ),
2085
+ error: dataWithResponseInitToErrorResponse(result),
2090
2086
  statusCode: isRouteErrorResponse(result) ? result.status : void 0,
2091
2087
  headers: result.init?.headers ? new Headers(result.init.headers) : void 0
2092
2088
  };
@@ -3114,12 +3110,12 @@ function canDecodeWithFormData(contentType) {
3114
3110
  // lib/href.ts
3115
3111
  function href(path, ...args) {
3116
3112
  let params = args[0];
3117
- let result = path.replace(/\/*\*?$/, "").replace(
3113
+ let result = trimTrailingSplat(path).replace(
3118
3114
  /\/:([\w-]+)(\?)?/g,
3119
3115
  // same regex as in .\router\utils.ts: compilePath().
3120
3116
  (_, param, questionMark) => {
3121
3117
  const isRequired = questionMark === void 0;
3122
- const value = params ? params[param] : void 0;
3118
+ const value = params?.[param];
3123
3119
  if (isRequired && value === void 0) {
3124
3120
  throw new Error(
3125
3121
  `Path '${path}' requires param '${param}' but it was not provided`
@@ -3129,13 +3125,23 @@ function href(path, ...args) {
3129
3125
  }
3130
3126
  );
3131
3127
  if (path.endsWith("*")) {
3132
- const value = params ? params["*"] : void 0;
3128
+ const value = params?.["*"];
3133
3129
  if (value !== void 0) {
3134
3130
  result += "/" + value;
3135
3131
  }
3136
3132
  }
3137
3133
  return result || "/";
3138
3134
  }
3135
+ function trimTrailingSplat(path) {
3136
+ let i = path.length - 1;
3137
+ let char = path[i];
3138
+ if (char !== "*" && char !== "/") return path;
3139
+ i--;
3140
+ for (; i >= 0; i--) {
3141
+ if (path[i] !== "/") break;
3142
+ }
3143
+ return path.slice(0, i + 1);
3144
+ }
3139
3145
 
3140
3146
  // lib/server-runtime/crypto.ts
3141
3147
  var encoder = /* @__PURE__ */ new TextEncoder();
@@ -1,15 +1,15 @@
1
- import { p as Router, q as RouteModules, r as DataStrategyFunction, s as MiddlewareEnabled, c as RouterContextProvider, t as AppLoadContext, T as To, v as NavigateOptions, B as BlockerFunction, w as Blocker, x as SerializeFrom, y as RelativeRoutingType, L as Location, z as ParamParseKey, E as Path, I as PathPattern, J as PathMatch, U as UIMatch, K as Navigation, O as Action, P as Params, Q as RouteObject, G as GetLoaderData, o as GetActionData, V as InitialEntry, W as HydrationState, X as IndexRouteObject, Y as RouteComponentType, Z as HydrateFallbackType, _ as ErrorBoundaryType, d as LoaderFunction, A as ActionFunction, M as MetaFunction, b as LinksFunction, $ as NonIndexRouteObject, a0 as Equal, a1 as RouterState, a2 as PatchRoutesOnNavigationFunction, a3 as DataRouteObject, a as ClientLoaderFunction } from './router-CAvh_Drx.mjs';
2
- export { ae as ActionFunctionArgs, b1 as Await, aS as AwaitProps, C as ClientActionFunction, bd as ClientActionFunctionArgs, be as ClientLoaderFunctionArgs, aN as DataRouteMatch, af as DataStrategyFunctionArgs, ag as DataStrategyMatch, D as DataStrategyResult, ai as ErrorResponse, a8 as Fetcher, aj as FormEncType, ak as FormMethod, bj as Future, a5 as GetScrollPositionFunction, a6 as GetScrollRestorationKeyFunction, al as HTMLFormMethod, bf as HeadersArgs, H as HeadersFunction, bi as HtmlLinkDescriptor, aD as IDLE_BLOCKER, aC as IDLE_FETCHER, aB as IDLE_NAVIGATION, aT as IndexRouteProps, aU as LayoutRouteProps, am as LazyRouteFunction, h as LinkDescriptor, an as LoaderFunctionArgs, b2 as MemoryRouter, aV as MemoryRouterOpts, aW as MemoryRouterProps, bg as MetaArgs, j as MetaDescriptor, ao as MiddlewareFunction, b3 as Navigate, aX as NavigateProps, a9 as NavigationStates, aO as Navigator, b4 as Outlet, aY as OutletProps, bh as PageLinkDescriptor, aP as PatchRoutesOnNavigationFunctionArgs, ap as PathParam, aZ as PathRouteProps, aq as RedirectFunction, ad as RevalidationState, b5 as Route, aQ as RouteMatch, a_ as RouteProps, b6 as Router, ar as RouterContext, ac as RouterFetchOptions, e as RouterInit, ab as RouterNavigateOptions, a$ as RouterProps, b7 as RouterProvider, f as RouterProviderProps, aa as RouterSubscriber, b8 as Routes, b0 as RoutesProps, S as ShouldRevalidateFunction, as as ShouldRevalidateFunctionArgs, a4 as StaticHandler, a7 as StaticHandlerContext, aR as UNSAFE_AwaitContextProvider, bp as UNSAFE_DataRouterContext, bq as UNSAFE_DataRouterStateContext, ah as UNSAFE_DataWithResponseInit, bo as UNSAFE_ErrorResponseImpl, br as UNSAFE_FetchersContext, bs as UNSAFE_LocationContext, bt as UNSAFE_NavigationContext, bu as UNSAFE_RouteContext, bv as UNSAFE_ViewTransitionContext, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps, bl as UNSAFE_createBrowserHistory, bn as UNSAFE_createRouter, bw as UNSAFE_hydrationRouteProperties, bm as UNSAFE_invariant, bx as UNSAFE_mapRouteProperties, bz as UNSAFE_withComponentProps, bD as UNSAFE_withErrorBoundaryProps, bB as UNSAFE_withHydrateFallbackProps, at as createContext, b9 as createMemoryRouter, au as createPath, ba as createRoutesFromChildren, bb as createRoutesFromElements, aE as data, aF as generatePath, aG as isRouteErrorResponse, aH as matchPath, aI as matchRoutes, av as parsePath, aJ as redirect, aK as redirectDocument, bc as renderMatches, aL as replace, aM as resolvePath, u as unstable_ClientInstrumentation, g as unstable_ClientOnErrorFunction, ax as unstable_InstrumentRequestHandlerFunction, az as unstable_InstrumentRouteFunction, ay as unstable_InstrumentRouterFunction, aA as unstable_InstrumentationHandlerResult, bk as unstable_SerializesTo, aw as unstable_ServerInstrumentation } from './router-CAvh_Drx.mjs';
1
+ import { p as Router, q as RouteModules, r as DataStrategyFunction, s as MiddlewareEnabled, c as RouterContextProvider, t as AppLoadContext, T as To, v as NavigateOptions, B as BlockerFunction, w as Blocker, x as SerializeFrom, y as RelativeRoutingType, L as Location, z as ParamParseKey, E as Path, I as PathPattern, J as PathMatch, U as UIMatch, K as Navigation, O as Action, P as Params, Q as RouteObject, G as GetLoaderData, o as GetActionData, V as InitialEntry, W as HydrationState, X as IndexRouteObject, Y as RouteComponentType, Z as HydrateFallbackType, _ as ErrorBoundaryType, d as LoaderFunction, A as ActionFunction, M as MetaFunction, b as LinksFunction, $ as NonIndexRouteObject, a0 as Equal, a1 as RouterState, a2 as PatchRoutesOnNavigationFunction, a3 as DataRouteObject, a as ClientLoaderFunction } from './router-Dgz_Mh9m.mjs';
2
+ export { ae as ActionFunctionArgs, b1 as Await, aS as AwaitProps, C as ClientActionFunction, bd as ClientActionFunctionArgs, be as ClientLoaderFunctionArgs, aN as DataRouteMatch, af as DataStrategyFunctionArgs, ag as DataStrategyMatch, D as DataStrategyResult, ai as ErrorResponse, a8 as Fetcher, aj as FormEncType, ak as FormMethod, bj as Future, a5 as GetScrollPositionFunction, a6 as GetScrollRestorationKeyFunction, al as HTMLFormMethod, bf as HeadersArgs, H as HeadersFunction, bi as HtmlLinkDescriptor, aD as IDLE_BLOCKER, aC as IDLE_FETCHER, aB as IDLE_NAVIGATION, aT as IndexRouteProps, aU as LayoutRouteProps, am as LazyRouteFunction, h as LinkDescriptor, an as LoaderFunctionArgs, b2 as MemoryRouter, aV as MemoryRouterOpts, aW as MemoryRouterProps, bg as MetaArgs, j as MetaDescriptor, ao as MiddlewareFunction, b3 as Navigate, aX as NavigateProps, a9 as NavigationStates, aO as Navigator, b4 as Outlet, aY as OutletProps, bh as PageLinkDescriptor, aP as PatchRoutesOnNavigationFunctionArgs, ap as PathParam, aZ as PathRouteProps, aq as RedirectFunction, ad as RevalidationState, b5 as Route, aQ as RouteMatch, a_ as RouteProps, b6 as Router, ar as RouterContext, ac as RouterFetchOptions, e as RouterInit, ab as RouterNavigateOptions, a$ as RouterProps, b7 as RouterProvider, f as RouterProviderProps, aa as RouterSubscriber, b8 as Routes, b0 as RoutesProps, S as ShouldRevalidateFunction, as as ShouldRevalidateFunctionArgs, a4 as StaticHandler, a7 as StaticHandlerContext, aR as UNSAFE_AwaitContextProvider, bp as UNSAFE_DataRouterContext, bq as UNSAFE_DataRouterStateContext, ah as UNSAFE_DataWithResponseInit, bo as UNSAFE_ErrorResponseImpl, br as UNSAFE_FetchersContext, bs as UNSAFE_LocationContext, bt as UNSAFE_NavigationContext, bu as UNSAFE_RouteContext, bv as UNSAFE_ViewTransitionContext, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps, bl as UNSAFE_createBrowserHistory, bn as UNSAFE_createRouter, bw as UNSAFE_hydrationRouteProperties, bm as UNSAFE_invariant, bx as UNSAFE_mapRouteProperties, bz as UNSAFE_withComponentProps, bD as UNSAFE_withErrorBoundaryProps, bB as UNSAFE_withHydrateFallbackProps, at as createContext, b9 as createMemoryRouter, au as createPath, ba as createRoutesFromChildren, bb as createRoutesFromElements, aE as data, aF as generatePath, aG as isRouteErrorResponse, aH as matchPath, aI as matchRoutes, av as parsePath, aJ as redirect, aK as redirectDocument, bc as renderMatches, aL as replace, aM as resolvePath, u as unstable_ClientInstrumentation, g as unstable_ClientOnErrorFunction, ax as unstable_InstrumentRequestHandlerFunction, az as unstable_InstrumentRouteFunction, ay as unstable_InstrumentRouterFunction, aA as unstable_InstrumentationHandlerResult, bk as unstable_SerializesTo, aw as unstable_ServerInstrumentation } from './router-Dgz_Mh9m.mjs';
3
3
  import * as React from 'react';
4
4
  import React__default, { ReactElement } from 'react';
5
- import { a as RouteModules$1, P as Pages } from './register-QkB3HGjm.mjs';
6
- export { b as Register } from './register-QkB3HGjm.mjs';
7
- import { A as AssetsManifest, S as ServerBuild, E as EntryContext, F as FutureConfig } from './index-react-server-client-rcoGPJhU.mjs';
8
- export { l as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, a1 as DiscoverBehavior, c as FetcherFormProps, h as FetcherSubmitFunction, G as FetcherSubmitOptions, i as FetcherWithComponents, q as Form, d as FormProps, a2 as HandleDataRequestFunction, a3 as HandleDocumentRequestFunction, a4 as HandleErrorFunction, m as HashRouter, H as HashRouterProps, a as HistoryRouterProps, n as Link, L as LinkProps, X as Links, _ as LinksProps, W as Meta, p as NavLink, N as NavLinkProps, b as NavLinkRenderProps, P as ParamKeyValuePair, a0 as PrefetchBehavior, Z as PrefetchPageLinks, Y as Scripts, $ as ScriptsProps, r as ScrollRestoration, e as ScrollRestorationProps, a5 as ServerEntryModule, f as SetURLSearchParams, T as StaticRouter, M as StaticRouterProps, V as StaticRouterProvider, O as StaticRouterProviderProps, g as SubmitFunction, I as SubmitOptions, J as SubmitTarget, a6 as UNSAFE_FrameworkContext, a7 as UNSAFE_createClientRoutes, a8 as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, a9 as UNSAFE_shouldHydrateRouteLoader, aa as UNSAFE_useScrollRestoration, U as URLSearchParamsInit, j as createBrowserRouter, k as createHashRouter, K as createSearchParams, Q as createStaticHandler, R as createStaticRouter, o as unstable_HistoryRouter, z as unstable_usePrompt, y as useBeforeUnload, w as useFetcher, x as useFetchers, v as useFormAction, u as useLinkClickHandler, s as useSearchParams, t as useSubmit, C as useViewTransitionState } from './index-react-server-client-rcoGPJhU.mjs';
5
+ import { a as RouteModules$1, P as Pages } from './register-C97Jz2jB.mjs';
6
+ export { b as Register } from './register-C97Jz2jB.mjs';
7
+ import { A as AssetsManifest, S as ServerBuild, E as EntryContext, F as FutureConfig } from './index-react-server-client-DYtvZPLT.mjs';
8
+ export { l as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, a1 as DiscoverBehavior, c as FetcherFormProps, h as FetcherSubmitFunction, G as FetcherSubmitOptions, i as FetcherWithComponents, q as Form, d as FormProps, a2 as HandleDataRequestFunction, a3 as HandleDocumentRequestFunction, a4 as HandleErrorFunction, m as HashRouter, H as HashRouterProps, a as HistoryRouterProps, n as Link, L as LinkProps, X as Links, _ as LinksProps, W as Meta, p as NavLink, N as NavLinkProps, b as NavLinkRenderProps, P as ParamKeyValuePair, a0 as PrefetchBehavior, Z as PrefetchPageLinks, Y as Scripts, $ as ScriptsProps, r as ScrollRestoration, e as ScrollRestorationProps, a5 as ServerEntryModule, f as SetURLSearchParams, T as StaticRouter, M as StaticRouterProps, V as StaticRouterProvider, O as StaticRouterProviderProps, g as SubmitFunction, I as SubmitOptions, J as SubmitTarget, a6 as UNSAFE_FrameworkContext, a7 as UNSAFE_createClientRoutes, a8 as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, a9 as UNSAFE_shouldHydrateRouteLoader, aa as UNSAFE_useScrollRestoration, U as URLSearchParamsInit, j as createBrowserRouter, k as createHashRouter, K as createSearchParams, Q as createStaticHandler, R as createStaticRouter, o as unstable_HistoryRouter, z as unstable_usePrompt, y as useBeforeUnload, w as useFetcher, x as useFetchers, v as useFormAction, u as useLinkClickHandler, s as useSearchParams, t as useSubmit, C as useViewTransitionState } from './index-react-server-client-DYtvZPLT.mjs';
9
9
  import { ParseOptions, SerializeOptions } from 'cookie';
10
10
  export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerializeOptions } from 'cookie';
11
- import { e as RSCPayload, m as matchRSCServerRequest } from './browser-C07r42Tt.mjs';
12
- export { B as unstable_BrowserCreateFromReadableStreamFunction, D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, E as unstable_EncodeReplyFunction, L as unstable_LoadServerActionFunction, g as unstable_RSCHydratedRouterProps, d as unstable_RSCManifestPayload, h as unstable_RSCMatch, f as unstable_RSCRenderPayload, l as unstable_RSCRouteConfig, k as unstable_RSCRouteConfigEntry, i as unstable_RSCRouteManifest, j as unstable_RSCRouteMatch } from './browser-C07r42Tt.mjs';
11
+ import { e as RSCPayload, m as matchRSCServerRequest } from './browser-BHySFrZ2.mjs';
12
+ export { B as unstable_BrowserCreateFromReadableStreamFunction, D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, E as unstable_EncodeReplyFunction, L as unstable_LoadServerActionFunction, g as unstable_RSCHydratedRouterProps, d as unstable_RSCManifestPayload, h as unstable_RSCMatch, f as unstable_RSCRenderPayload, l as unstable_RSCRouteConfig, k as unstable_RSCRouteConfigEntry, i as unstable_RSCRouteManifest, j as unstable_RSCRouteMatch } from './browser-BHySFrZ2.mjs';
13
13
 
14
14
  declare const SingleFetchRedirectSymbol: unique symbol;
15
15
  declare function getTurboStreamSingleFetchDataStrategy(getRouter: () => Router, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, basename: string | undefined): DataStrategyFunction;
@@ -130,12 +130,14 @@ interface NavigateFunction {
130
130
  *
131
131
  * * `to` can be a string path, a {@link To} object, or a number (delta)
132
132
  * * `options` contains options for modifying the navigation
133
- * * `flushSync`: Wrap the DOM updates in [`ReactDom.flushSync`](https://react.dev/reference/react-dom/flushSync)
134
- * * `preventScrollReset`: Do not scroll back to the top of the page after navigation
135
- * * `relative`: `"route"` or `"path"` to control relative routing logic
136
- * * `replace`: Replace the current entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) stack
137
- * * `state`: Optional [`history.state`](https://developer.mozilla.org/en-US/docs/Web/API/History/state) to include with the new {@link Location}
138
- * * `viewTransition`: Enable [`document.startViewTransition`](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) for this navigation
133
+ * * These options work in all modes (Framework, Data, and Declarative):
134
+ * * `relative`: `"route"` or `"path"` to control relative routing logic
135
+ * * `replace`: Replace the current entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) stack
136
+ * * `state`: Optional [`history.state`](https://developer.mozilla.org/en-US/docs/Web/API/History/state) to include with the new {@link Location}
137
+ * * These options only work in Framework and Data modes:
138
+ * * `flushSync`: Wrap the DOM updates in [`ReactDom.flushSync`](https://react.dev/reference/react-dom/flushSync)
139
+ * * `preventScrollReset`: Do not scroll back to the top of the page after navigation
140
+ * * `viewTransition`: Enable [`document.startViewTransition`](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) for this navigation
139
141
  *
140
142
  * @example
141
143
  * import { useNavigate } from "react-router";
@@ -867,7 +869,9 @@ declare function useBlocker(shouldBlock: boolean | BlockerFunction): Blocker;
867
869
  type UseRouteArgs = [] | [routeId: keyof RouteModules$1];
868
870
  type UseRouteResult<Args extends UseRouteArgs> = Args extends [] ? UseRoute<unknown> : Args extends ["root"] ? UseRoute<"root"> : Args extends [infer RouteId extends keyof RouteModules$1] ? UseRoute<RouteId> | undefined : never;
869
871
  type UseRoute<RouteId extends keyof RouteModules$1 | unknown> = {
870
- handle: RouteId extends keyof RouteModules$1 ? RouteModules$1[RouteId]["handle"] : unknown;
872
+ handle: RouteId extends keyof RouteModules$1 ? RouteModules$1[RouteId] extends {
873
+ handle: infer handle;
874
+ } ? handle : unknown : unknown;
871
875
  loaderData: RouteId extends keyof RouteModules$1 ? GetLoaderData<RouteModules$1[RouteId]> | undefined : unknown;
872
876
  actionData: RouteId extends keyof RouteModules$1 ? GetActionData<RouteModules$1[RouteId]> | undefined : unknown;
873
877
  };
@@ -1,15 +1,15 @@
1
- import { n as Router, o as RouteModules, p as DataStrategyFunction, q as MiddlewareEnabled, c as RouterContextProvider, r as AppLoadContext, T as To, s as NavigateOptions, B as BlockerFunction, t as Blocker, v as SerializeFrom, w as RelativeRoutingType, L as Location, x as ParamParseKey, y as Path, z as PathPattern, E as PathMatch, U as UIMatch, I as Navigation, J as Action, P as Params, K as RouteObject, G as GetLoaderData, m as GetActionData, O as InitialEntry, Q as HydrationState, V as IndexRouteObject, W as RouteComponentType, X as HydrateFallbackType, Y as ErrorBoundaryType, d as LoaderFunction, A as ActionFunction, M as MetaFunction, b as LinksFunction, Z as NonIndexRouteObject, _ as Equal, $ as RouterState, a0 as PatchRoutesOnNavigationFunction, a1 as DataRouteObject, a as ClientLoaderFunction } from './instrumentation-Unc20tLk.js';
2
- export { ac as ActionFunctionArgs, b1 as Await, aQ as AwaitProps, C as ClientActionFunction, bd as ClientActionFunctionArgs, be as ClientLoaderFunctionArgs, aL as DataRouteMatch, ad as DataStrategyFunctionArgs, ae as DataStrategyMatch, D as DataStrategyResult, ag as ErrorResponse, a6 as Fetcher, ah as FormEncType, ai as FormMethod, bj as Future, a3 as GetScrollPositionFunction, a4 as GetScrollRestorationKeyFunction, aj as HTMLFormMethod, bf as HeadersArgs, H as HeadersFunction, bi as HtmlLinkDescriptor, aB as IDLE_BLOCKER, aA as IDLE_FETCHER, az as IDLE_NAVIGATION, aR as IndexRouteProps, aT as LayoutRouteProps, ak as LazyRouteFunction, f as LinkDescriptor, al as LoaderFunctionArgs, b2 as MemoryRouter, aU as MemoryRouterOpts, aV as MemoryRouterProps, bg as MetaArgs, h as MetaDescriptor, am as MiddlewareFunction, b3 as Navigate, aW as NavigateProps, a7 as NavigationStates, aM as Navigator, b4 as Outlet, aX as OutletProps, bh as PageLinkDescriptor, aN as PatchRoutesOnNavigationFunctionArgs, an as PathParam, aY as PathRouteProps, ao as RedirectFunction, ab as RevalidationState, b5 as Route, aO as RouteMatch, aZ as RouteProps, b6 as Router, ap as RouterContext, aa as RouterFetchOptions, e as RouterInit, a9 as RouterNavigateOptions, a_ as RouterProps, b7 as RouterProvider, a$ as RouterProviderProps, a8 as RouterSubscriber, b8 as Routes, b0 as RoutesProps, S as ShouldRevalidateFunction, aq as ShouldRevalidateFunctionArgs, a2 as StaticHandler, a5 as StaticHandlerContext, aP as UNSAFE_AwaitContextProvider, bp as UNSAFE_DataRouterContext, bq as UNSAFE_DataRouterStateContext, af as UNSAFE_DataWithResponseInit, bo as UNSAFE_ErrorResponseImpl, br as UNSAFE_FetchersContext, bs as UNSAFE_LocationContext, bt as UNSAFE_NavigationContext, bu as UNSAFE_RouteContext, bv as UNSAFE_ViewTransitionContext, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps, bl as UNSAFE_createBrowserHistory, bn as UNSAFE_createRouter, bw as UNSAFE_hydrationRouteProperties, bm as UNSAFE_invariant, bx as UNSAFE_mapRouteProperties, bz as UNSAFE_withComponentProps, bD as UNSAFE_withErrorBoundaryProps, bB as UNSAFE_withHydrateFallbackProps, ar as createContext, b9 as createMemoryRouter, as as createPath, ba as createRoutesFromChildren, bb as createRoutesFromElements, aC as data, aD as generatePath, aE as isRouteErrorResponse, aF as matchPath, aG as matchRoutes, at as parsePath, aH as redirect, aI as redirectDocument, bc as renderMatches, aJ as replace, aK as resolvePath, u as unstable_ClientInstrumentation, aS as unstable_ClientOnErrorFunction, av as unstable_InstrumentRequestHandlerFunction, ax as unstable_InstrumentRouteFunction, aw as unstable_InstrumentRouterFunction, ay as unstable_InstrumentationHandlerResult, bk as unstable_SerializesTo, au as unstable_ServerInstrumentation } from './instrumentation-Unc20tLk.js';
1
+ import { n as Router, o as RouteModules, p as DataStrategyFunction, q as MiddlewareEnabled, c as RouterContextProvider, r as AppLoadContext, T as To, s as NavigateOptions, B as BlockerFunction, t as Blocker, v as SerializeFrom, w as RelativeRoutingType, L as Location, x as ParamParseKey, y as Path, z as PathPattern, E as PathMatch, U as UIMatch, I as Navigation, J as Action, P as Params, K as RouteObject, G as GetLoaderData, m as GetActionData, O as InitialEntry, Q as HydrationState, V as IndexRouteObject, W as RouteComponentType, X as HydrateFallbackType, Y as ErrorBoundaryType, d as LoaderFunction, A as ActionFunction, M as MetaFunction, b as LinksFunction, Z as NonIndexRouteObject, _ as Equal, $ as RouterState, a0 as PatchRoutesOnNavigationFunction, a1 as DataRouteObject, a as ClientLoaderFunction } from './instrumentation-Dwf-sTWa.js';
2
+ export { ac as ActionFunctionArgs, b1 as Await, aQ as AwaitProps, C as ClientActionFunction, bd as ClientActionFunctionArgs, be as ClientLoaderFunctionArgs, aL as DataRouteMatch, ad as DataStrategyFunctionArgs, ae as DataStrategyMatch, D as DataStrategyResult, ag as ErrorResponse, a6 as Fetcher, ah as FormEncType, ai as FormMethod, bj as Future, a3 as GetScrollPositionFunction, a4 as GetScrollRestorationKeyFunction, aj as HTMLFormMethod, bf as HeadersArgs, H as HeadersFunction, bi as HtmlLinkDescriptor, aB as IDLE_BLOCKER, aA as IDLE_FETCHER, az as IDLE_NAVIGATION, aR as IndexRouteProps, aT as LayoutRouteProps, ak as LazyRouteFunction, f as LinkDescriptor, al as LoaderFunctionArgs, b2 as MemoryRouter, aU as MemoryRouterOpts, aV as MemoryRouterProps, bg as MetaArgs, h as MetaDescriptor, am as MiddlewareFunction, b3 as Navigate, aW as NavigateProps, a7 as NavigationStates, aM as Navigator, b4 as Outlet, aX as OutletProps, bh as PageLinkDescriptor, aN as PatchRoutesOnNavigationFunctionArgs, an as PathParam, aY as PathRouteProps, ao as RedirectFunction, ab as RevalidationState, b5 as Route, aO as RouteMatch, aZ as RouteProps, b6 as Router, ap as RouterContext, aa as RouterFetchOptions, e as RouterInit, a9 as RouterNavigateOptions, a_ as RouterProps, b7 as RouterProvider, a$ as RouterProviderProps, a8 as RouterSubscriber, b8 as Routes, b0 as RoutesProps, S as ShouldRevalidateFunction, aq as ShouldRevalidateFunctionArgs, a2 as StaticHandler, a5 as StaticHandlerContext, aP as UNSAFE_AwaitContextProvider, bp as UNSAFE_DataRouterContext, bq as UNSAFE_DataRouterStateContext, af as UNSAFE_DataWithResponseInit, bo as UNSAFE_ErrorResponseImpl, br as UNSAFE_FetchersContext, bs as UNSAFE_LocationContext, bt as UNSAFE_NavigationContext, bu as UNSAFE_RouteContext, bv as UNSAFE_ViewTransitionContext, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps, bl as UNSAFE_createBrowserHistory, bn as UNSAFE_createRouter, bw as UNSAFE_hydrationRouteProperties, bm as UNSAFE_invariant, bx as UNSAFE_mapRouteProperties, bz as UNSAFE_withComponentProps, bD as UNSAFE_withErrorBoundaryProps, bB as UNSAFE_withHydrateFallbackProps, ar as createContext, b9 as createMemoryRouter, as as createPath, ba as createRoutesFromChildren, bb as createRoutesFromElements, aC as data, aD as generatePath, aE as isRouteErrorResponse, aF as matchPath, aG as matchRoutes, at as parsePath, aH as redirect, aI as redirectDocument, bc as renderMatches, aJ as replace, aK as resolvePath, u as unstable_ClientInstrumentation, aS as unstable_ClientOnErrorFunction, av as unstable_InstrumentRequestHandlerFunction, ax as unstable_InstrumentRouteFunction, aw as unstable_InstrumentRouterFunction, ay as unstable_InstrumentationHandlerResult, bk as unstable_SerializesTo, au as unstable_ServerInstrumentation } from './instrumentation-Dwf-sTWa.js';
3
3
  import * as React from 'react';
4
4
  import React__default, { ReactElement } from 'react';
5
- import { a as RouteModules$1, P as Pages } from './register-BpU9rFBJ.js';
6
- export { b as Register } from './register-BpU9rFBJ.js';
7
- import { A as AssetsManifest, S as ServerBuild, E as EntryContext, F as FutureConfig } from './index-react-server-client-Da3kmxNd.js';
8
- export { l as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, a1 as DiscoverBehavior, c as FetcherFormProps, h as FetcherSubmitFunction, G as FetcherSubmitOptions, i as FetcherWithComponents, q as Form, d as FormProps, a2 as HandleDataRequestFunction, a3 as HandleDocumentRequestFunction, a4 as HandleErrorFunction, m as HashRouter, H as HashRouterProps, a as HistoryRouterProps, n as Link, L as LinkProps, X as Links, _ as LinksProps, W as Meta, p as NavLink, N as NavLinkProps, b as NavLinkRenderProps, P as ParamKeyValuePair, a0 as PrefetchBehavior, Z as PrefetchPageLinks, Y as Scripts, $ as ScriptsProps, r as ScrollRestoration, e as ScrollRestorationProps, a5 as ServerEntryModule, f as SetURLSearchParams, T as StaticRouter, M as StaticRouterProps, V as StaticRouterProvider, O as StaticRouterProviderProps, g as SubmitFunction, I as SubmitOptions, J as SubmitTarget, a6 as UNSAFE_FrameworkContext, a7 as UNSAFE_createClientRoutes, a8 as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, a9 as UNSAFE_shouldHydrateRouteLoader, aa as UNSAFE_useScrollRestoration, U as URLSearchParamsInit, j as createBrowserRouter, k as createHashRouter, K as createSearchParams, Q as createStaticHandler, R as createStaticRouter, o as unstable_HistoryRouter, z as unstable_usePrompt, y as useBeforeUnload, w as useFetcher, x as useFetchers, v as useFormAction, u as useLinkClickHandler, s as useSearchParams, t as useSubmit, C as useViewTransitionState } from './index-react-server-client-Da3kmxNd.js';
5
+ import { a as RouteModules$1, P as Pages } from './register-BnQsYkwj.js';
6
+ export { b as Register } from './register-BnQsYkwj.js';
7
+ import { A as AssetsManifest, S as ServerBuild, E as EntryContext, F as FutureConfig } from './index-react-server-client-CNrKUHDv.js';
8
+ export { l as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, a1 as DiscoverBehavior, c as FetcherFormProps, h as FetcherSubmitFunction, G as FetcherSubmitOptions, i as FetcherWithComponents, q as Form, d as FormProps, a2 as HandleDataRequestFunction, a3 as HandleDocumentRequestFunction, a4 as HandleErrorFunction, m as HashRouter, H as HashRouterProps, a as HistoryRouterProps, n as Link, L as LinkProps, X as Links, _ as LinksProps, W as Meta, p as NavLink, N as NavLinkProps, b as NavLinkRenderProps, P as ParamKeyValuePair, a0 as PrefetchBehavior, Z as PrefetchPageLinks, Y as Scripts, $ as ScriptsProps, r as ScrollRestoration, e as ScrollRestorationProps, a5 as ServerEntryModule, f as SetURLSearchParams, T as StaticRouter, M as StaticRouterProps, V as StaticRouterProvider, O as StaticRouterProviderProps, g as SubmitFunction, I as SubmitOptions, J as SubmitTarget, a6 as UNSAFE_FrameworkContext, a7 as UNSAFE_createClientRoutes, a8 as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, a9 as UNSAFE_shouldHydrateRouteLoader, aa as UNSAFE_useScrollRestoration, U as URLSearchParamsInit, j as createBrowserRouter, k as createHashRouter, K as createSearchParams, Q as createStaticHandler, R as createStaticRouter, o as unstable_HistoryRouter, z as unstable_usePrompt, y as useBeforeUnload, w as useFetcher, x as useFetchers, v as useFormAction, u as useLinkClickHandler, s as useSearchParams, t as useSubmit, C as useViewTransitionState } from './index-react-server-client-CNrKUHDv.js';
9
9
  import { ParseOptions, SerializeOptions } from 'cookie';
10
10
  export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerializeOptions } from 'cookie';
11
- import { e as RSCPayload, m as matchRSCServerRequest } from './browser-BbBXFHbO.js';
12
- export { B as unstable_BrowserCreateFromReadableStreamFunction, D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, E as unstable_EncodeReplyFunction, L as unstable_LoadServerActionFunction, g as unstable_RSCHydratedRouterProps, d as unstable_RSCManifestPayload, h as unstable_RSCMatch, f as unstable_RSCRenderPayload, l as unstable_RSCRouteConfig, k as unstable_RSCRouteConfigEntry, i as unstable_RSCRouteManifest, j as unstable_RSCRouteMatch } from './browser-BbBXFHbO.js';
11
+ import { e as RSCPayload, m as matchRSCServerRequest } from './browser-eL-tAN4R.js';
12
+ export { B as unstable_BrowserCreateFromReadableStreamFunction, D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, E as unstable_EncodeReplyFunction, L as unstable_LoadServerActionFunction, g as unstable_RSCHydratedRouterProps, d as unstable_RSCManifestPayload, h as unstable_RSCMatch, f as unstable_RSCRenderPayload, l as unstable_RSCRouteConfig, k as unstable_RSCRouteConfigEntry, i as unstable_RSCRouteManifest, j as unstable_RSCRouteMatch } from './browser-eL-tAN4R.js';
13
13
 
14
14
  declare const SingleFetchRedirectSymbol: unique symbol;
15
15
  declare function getTurboStreamSingleFetchDataStrategy(getRouter: () => Router, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, basename: string | undefined): DataStrategyFunction;
@@ -130,12 +130,14 @@ interface NavigateFunction {
130
130
  *
131
131
  * * `to` can be a string path, a {@link To} object, or a number (delta)
132
132
  * * `options` contains options for modifying the navigation
133
- * * `flushSync`: Wrap the DOM updates in [`ReactDom.flushSync`](https://react.dev/reference/react-dom/flushSync)
134
- * * `preventScrollReset`: Do not scroll back to the top of the page after navigation
135
- * * `relative`: `"route"` or `"path"` to control relative routing logic
136
- * * `replace`: Replace the current entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) stack
137
- * * `state`: Optional [`history.state`](https://developer.mozilla.org/en-US/docs/Web/API/History/state) to include with the new {@link Location}
138
- * * `viewTransition`: Enable [`document.startViewTransition`](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) for this navigation
133
+ * * These options work in all modes (Framework, Data, and Declarative):
134
+ * * `relative`: `"route"` or `"path"` to control relative routing logic
135
+ * * `replace`: Replace the current entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) stack
136
+ * * `state`: Optional [`history.state`](https://developer.mozilla.org/en-US/docs/Web/API/History/state) to include with the new {@link Location}
137
+ * * These options only work in Framework and Data modes:
138
+ * * `flushSync`: Wrap the DOM updates in [`ReactDom.flushSync`](https://react.dev/reference/react-dom/flushSync)
139
+ * * `preventScrollReset`: Do not scroll back to the top of the page after navigation
140
+ * * `viewTransition`: Enable [`document.startViewTransition`](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) for this navigation
139
141
  *
140
142
  * @example
141
143
  * import { useNavigate } from "react-router";
@@ -867,7 +869,9 @@ declare function useBlocker(shouldBlock: boolean | BlockerFunction): Blocker;
867
869
  type UseRouteArgs = [] | [routeId: keyof RouteModules$1];
868
870
  type UseRouteResult<Args extends UseRouteArgs> = Args extends [] ? UseRoute<unknown> : Args extends ["root"] ? UseRoute<"root"> : Args extends [infer RouteId extends keyof RouteModules$1] ? UseRoute<RouteId> | undefined : never;
869
871
  type UseRoute<RouteId extends keyof RouteModules$1 | unknown> = {
870
- handle: RouteId extends keyof RouteModules$1 ? RouteModules$1[RouteId]["handle"] : unknown;
872
+ handle: RouteId extends keyof RouteModules$1 ? RouteModules$1[RouteId] extends {
873
+ handle: infer handle;
874
+ } ? handle : unknown : unknown;
871
875
  loaderData: RouteId extends keyof RouteModules$1 ? GetLoaderData<RouteModules$1[RouteId]> | undefined : unknown;
872
876
  actionData: RouteId extends keyof RouteModules$1 ? GetActionData<RouteModules$1[RouteId]> | undefined : unknown;
873
877
  };