react-router 7.9.4 → 7.9.6

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 (74) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/dist/development/browser-BbBXFHbO.d.ts +310 -0
  3. package/dist/development/browser-C07r42Tt.d.mts +310 -0
  4. package/dist/development/{chunk-OIYGIGL5.mjs → chunk-4WY6JWTD.mjs} +458 -43
  5. package/dist/development/{chunk-DI2QHYMJ.js → chunk-AMVS5XVJ.js} +1314 -138
  6. package/dist/development/{chunk-WY5IRSCW.mjs → chunk-G3INQAYP.mjs} +197 -857
  7. package/dist/development/chunk-O4JVZSOY.js +1310 -0
  8. package/dist/development/chunk-PZWDWJAY.js +188 -0
  9. package/dist/development/dom-export.d.mts +103 -6
  10. package/dist/development/dom-export.d.ts +103 -4
  11. package/dist/development/dom-export.js +708 -20
  12. package/dist/development/dom-export.mjs +692 -11
  13. package/dist/{production/index-react-server-client-BbRcBjrA.d.ts → development/index-react-server-client-Da3kmxNd.d.ts} +195 -135
  14. package/dist/{production/index-react-server-client-BIz4AUNd.d.mts → development/index-react-server-client-rcoGPJhU.d.mts} +137 -78
  15. package/dist/development/index-react-server-client.d.mts +2 -3
  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 +107 -3
  20. package/dist/development/index-react-server.d.ts +107 -3
  21. package/dist/development/index-react-server.js +259 -13
  22. package/dist/development/index-react-server.mjs +259 -13
  23. package/dist/development/index.d.mts +14 -320
  24. package/dist/development/index.d.ts +14 -362
  25. package/dist/development/index.js +146 -962
  26. package/dist/development/index.mjs +3 -9
  27. package/dist/development/{routeModules-D5iJ6JYT.d.ts → instrumentation-Unc20tLk.d.ts} +178 -25
  28. package/dist/development/lib/types/internal.d.mts +2 -3
  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/{production/register-C34pU-in.d.ts → development/register-BpU9rFBJ.d.ts} +1 -1
  33. package/dist/development/{register-CI4bTprK.d.mts → register-QkB3HGjm.d.mts} +1 -1
  34. package/dist/{production/context-DSyS5mLj.d.mts → development/router-CAvh_Drx.d.mts} +1877 -1254
  35. package/dist/production/browser-BbBXFHbO.d.ts +310 -0
  36. package/dist/production/browser-C07r42Tt.d.mts +310 -0
  37. package/dist/production/{chunk-4E5LHRQP.js → chunk-EAIF67OW.js} +1314 -138
  38. package/dist/production/{chunk-FR6HSPLK.mjs → chunk-FDUMZGKM.mjs} +197 -857
  39. package/dist/production/{chunk-3TADTUL4.mjs → chunk-FUSXQSWG.mjs} +458 -43
  40. package/dist/production/chunk-G5A35OQU.js +188 -0
  41. package/dist/production/chunk-QN64DHI4.js +1310 -0
  42. package/dist/production/dom-export.d.mts +103 -6
  43. package/dist/production/dom-export.d.ts +103 -4
  44. package/dist/production/dom-export.js +708 -20
  45. package/dist/production/dom-export.mjs +692 -11
  46. package/dist/{development/index-react-server-client-BIz4AUNd.d.mts → production/index-react-server-client-Da3kmxNd.d.ts} +137 -78
  47. package/dist/{development/index-react-server-client-BbRcBjrA.d.ts → production/index-react-server-client-rcoGPJhU.d.mts} +195 -135
  48. package/dist/production/index-react-server-client.d.mts +2 -3
  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 +107 -3
  53. package/dist/production/index-react-server.d.ts +107 -3
  54. package/dist/production/index-react-server.js +259 -13
  55. package/dist/production/index-react-server.mjs +259 -13
  56. package/dist/production/index.d.mts +14 -320
  57. package/dist/production/index.d.ts +14 -362
  58. package/dist/production/index.js +146 -962
  59. package/dist/production/index.mjs +3 -9
  60. package/dist/production/{routeModules-D5iJ6JYT.d.ts → instrumentation-Unc20tLk.d.ts} +178 -25
  61. package/dist/production/lib/types/internal.d.mts +2 -3
  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/{development/register-C34pU-in.d.ts → production/register-BpU9rFBJ.d.ts} +1 -1
  66. package/dist/production/{register-CI4bTprK.d.mts → register-QkB3HGjm.d.mts} +1 -1
  67. package/dist/{development/context-DSyS5mLj.d.mts → production/router-CAvh_Drx.d.mts} +1877 -1254
  68. package/package.json +1 -1
  69. package/dist/development/browser-z32v5KVN.d.mts +0 -46
  70. package/dist/development/chunk-72XNTZCV.js +0 -2089
  71. package/dist/development/route-data-DZQOUSqV.d.mts +0 -473
  72. package/dist/production/browser-z32v5KVN.d.mts +0 -46
  73. package/dist/production/chunk-WNLQ53P5.js +0 -2089
  74. package/dist/production/route-data-DZQOUSqV.d.mts +0 -473
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
2
- * react-router v7.9.4
2
+ * react-router v7.9.6
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -439,7 +439,7 @@ function isUnsupportedLazyRouteFunctionKey(key) {
439
439
  function isIndexRoute(route) {
440
440
  return route.index === true;
441
441
  }
442
- function convertRoutesToDataRoutes(routes, mapRouteProperties, parentPath = [], manifest = {}, allowInPlaceMutations = false) {
442
+ function convertRoutesToDataRoutes(routes, mapRouteProperties2, parentPath = [], manifest = {}, allowInPlaceMutations = false) {
443
443
  return routes.map((route, index) => {
444
444
  let treePath = [...parentPath, String(index)];
445
445
  let id = typeof route.id === "string" ? route.id : treePath.join("-");
@@ -454,23 +454,27 @@ function convertRoutesToDataRoutes(routes, mapRouteProperties, parentPath = [],
454
454
  if (isIndexRoute(route)) {
455
455
  let indexRoute = {
456
456
  ...route,
457
- ...mapRouteProperties(route),
458
457
  id
459
458
  };
460
- manifest[id] = indexRoute;
459
+ manifest[id] = mergeRouteUpdates(
460
+ indexRoute,
461
+ mapRouteProperties2(indexRoute)
462
+ );
461
463
  return indexRoute;
462
464
  } else {
463
465
  let pathOrLayoutRoute = {
464
466
  ...route,
465
- ...mapRouteProperties(route),
466
467
  id,
467
468
  children: void 0
468
469
  };
469
- manifest[id] = pathOrLayoutRoute;
470
+ manifest[id] = mergeRouteUpdates(
471
+ pathOrLayoutRoute,
472
+ mapRouteProperties2(pathOrLayoutRoute)
473
+ );
470
474
  if (route.children) {
471
475
  pathOrLayoutRoute.children = convertRoutesToDataRoutes(
472
476
  route.children,
473
- mapRouteProperties,
477
+ mapRouteProperties2,
474
478
  treePath,
475
479
  manifest,
476
480
  allowInPlaceMutations
@@ -480,6 +484,17 @@ function convertRoutesToDataRoutes(routes, mapRouteProperties, parentPath = [],
480
484
  }
481
485
  });
482
486
  }
487
+ function mergeRouteUpdates(route, updates) {
488
+ return Object.assign(route, {
489
+ ...updates,
490
+ ...typeof updates.lazy === "object" && updates.lazy != null ? {
491
+ lazy: {
492
+ ...route.lazy,
493
+ ...updates.lazy
494
+ }
495
+ } : {}
496
+ });
497
+ }
483
498
  function matchRoutes(routes, locationArg, basename = "/") {
484
499
  return matchRoutesImpl(routes, locationArg, basename, false);
485
500
  }
@@ -720,18 +735,18 @@ function matchPath(pattern, pathname) {
720
735
  let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1");
721
736
  let captureGroups = match.slice(1);
722
737
  let params = compiledParams.reduce(
723
- (memo, { paramName, isOptional }, index) => {
738
+ (memo2, { paramName, isOptional }, index) => {
724
739
  if (paramName === "*") {
725
740
  let splatValue = captureGroups[index] || "";
726
741
  pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1");
727
742
  }
728
743
  const value = captureGroups[index];
729
744
  if (isOptional && !value) {
730
- memo[paramName] = void 0;
745
+ memo2[paramName] = void 0;
731
746
  } else {
732
- memo[paramName] = (value || "").replace(/%2F/g, "/");
747
+ memo2[paramName] = (value || "").replace(/%2F/g, "/");
733
748
  }
734
- return memo;
749
+ return memo2;
735
750
  },
736
751
  {}
737
752
  );
@@ -796,13 +811,36 @@ function prependBasename({
796
811
  }) {
797
812
  return pathname === "/" ? basename : joinPaths([basename, pathname]);
798
813
  }
814
+ var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
815
+ var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
799
816
  function resolvePath(to, fromPathname = "/") {
800
817
  let {
801
818
  pathname: toPathname,
802
819
  search = "",
803
820
  hash = ""
804
821
  } = typeof to === "string" ? parsePath(to) : to;
805
- let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
822
+ let pathname;
823
+ if (toPathname) {
824
+ if (isAbsoluteUrl(toPathname)) {
825
+ pathname = toPathname;
826
+ } else {
827
+ if (toPathname.includes("//")) {
828
+ let oldPathname = toPathname;
829
+ toPathname = toPathname.replace(/\/\/+/g, "/");
830
+ warning(
831
+ false,
832
+ `Pathnames cannot have embedded double slashes - normalizing ${oldPathname} -> ${toPathname}`
833
+ );
834
+ }
835
+ if (toPathname.startsWith("/")) {
836
+ pathname = resolvePathname(toPathname.substring(1), "/");
837
+ } else {
838
+ pathname = resolvePathname(toPathname, fromPathname);
839
+ }
840
+ }
841
+ } else {
842
+ pathname = fromPathname;
843
+ }
806
844
  return {
807
845
  pathname,
808
846
  search: normalizeSearch(search),
@@ -935,6 +973,277 @@ var ErrorResponseImpl = class {
935
973
  function isRouteErrorResponse(error) {
936
974
  return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error;
937
975
  }
976
+ function getRoutePattern(paths) {
977
+ return paths.filter(Boolean).join("/").replace(/\/\/*/g, "/") || "/";
978
+ }
979
+
980
+ // lib/router/instrumentation.ts
981
+ var UninstrumentedSymbol = Symbol("Uninstrumented");
982
+ function getRouteInstrumentationUpdates(fns, route) {
983
+ let aggregated = {
984
+ lazy: [],
985
+ "lazy.loader": [],
986
+ "lazy.action": [],
987
+ "lazy.middleware": [],
988
+ middleware: [],
989
+ loader: [],
990
+ action: []
991
+ };
992
+ fns.forEach(
993
+ (fn) => fn({
994
+ id: route.id,
995
+ index: route.index,
996
+ path: route.path,
997
+ instrument(i) {
998
+ let keys = Object.keys(aggregated);
999
+ for (let key of keys) {
1000
+ if (i[key]) {
1001
+ aggregated[key].push(i[key]);
1002
+ }
1003
+ }
1004
+ }
1005
+ })
1006
+ );
1007
+ let updates = {};
1008
+ if (typeof route.lazy === "function" && aggregated.lazy.length > 0) {
1009
+ let instrumented = wrapImpl(aggregated.lazy, route.lazy, () => void 0);
1010
+ if (instrumented) {
1011
+ updates.lazy = instrumented;
1012
+ }
1013
+ }
1014
+ if (typeof route.lazy === "object") {
1015
+ let lazyObject = route.lazy;
1016
+ ["middleware", "loader", "action"].forEach((key) => {
1017
+ let lazyFn = lazyObject[key];
1018
+ let instrumentations = aggregated[`lazy.${key}`];
1019
+ if (typeof lazyFn === "function" && instrumentations.length > 0) {
1020
+ let instrumented = wrapImpl(instrumentations, lazyFn, () => void 0);
1021
+ if (instrumented) {
1022
+ updates.lazy = Object.assign(updates.lazy || {}, {
1023
+ [key]: instrumented
1024
+ });
1025
+ }
1026
+ }
1027
+ });
1028
+ }
1029
+ ["loader", "action"].forEach((key) => {
1030
+ let handler = route[key];
1031
+ if (typeof handler === "function" && aggregated[key].length > 0) {
1032
+ let original = _nullishCoalesce(handler[UninstrumentedSymbol], () => ( handler));
1033
+ let instrumented = wrapImpl(
1034
+ aggregated[key],
1035
+ original,
1036
+ (...args) => getHandlerInfo(args[0])
1037
+ );
1038
+ if (instrumented) {
1039
+ instrumented[UninstrumentedSymbol] = original;
1040
+ updates[key] = instrumented;
1041
+ }
1042
+ }
1043
+ });
1044
+ if (route.middleware && route.middleware.length > 0 && aggregated.middleware.length > 0) {
1045
+ updates.middleware = route.middleware.map((middleware) => {
1046
+ let original = _nullishCoalesce(middleware[UninstrumentedSymbol], () => ( middleware));
1047
+ let instrumented = wrapImpl(
1048
+ aggregated.middleware,
1049
+ original,
1050
+ (...args) => getHandlerInfo(args[0])
1051
+ );
1052
+ if (instrumented) {
1053
+ instrumented[UninstrumentedSymbol] = original;
1054
+ return instrumented;
1055
+ }
1056
+ return middleware;
1057
+ });
1058
+ }
1059
+ return updates;
1060
+ }
1061
+ function instrumentClientSideRouter(router, fns) {
1062
+ let aggregated = {
1063
+ navigate: [],
1064
+ fetch: []
1065
+ };
1066
+ fns.forEach(
1067
+ (fn) => fn({
1068
+ instrument(i) {
1069
+ let keys = Object.keys(i);
1070
+ for (let key of keys) {
1071
+ if (i[key]) {
1072
+ aggregated[key].push(i[key]);
1073
+ }
1074
+ }
1075
+ }
1076
+ })
1077
+ );
1078
+ if (aggregated.navigate.length > 0) {
1079
+ let navigate = _nullishCoalesce(router.navigate[UninstrumentedSymbol], () => ( router.navigate));
1080
+ let instrumentedNavigate = wrapImpl(
1081
+ aggregated.navigate,
1082
+ navigate,
1083
+ (...args) => {
1084
+ let [to, opts] = args;
1085
+ return {
1086
+ to: typeof to === "number" || typeof to === "string" ? to : to ? createPath(to) : ".",
1087
+ ...getRouterInfo(router, _nullishCoalesce(opts, () => ( {})))
1088
+ };
1089
+ }
1090
+ );
1091
+ if (instrumentedNavigate) {
1092
+ instrumentedNavigate[UninstrumentedSymbol] = navigate;
1093
+ router.navigate = instrumentedNavigate;
1094
+ }
1095
+ }
1096
+ if (aggregated.fetch.length > 0) {
1097
+ let fetch2 = _nullishCoalesce(router.fetch[UninstrumentedSymbol], () => ( router.fetch));
1098
+ let instrumentedFetch = wrapImpl(aggregated.fetch, fetch2, (...args) => {
1099
+ let [key, , href, opts] = args;
1100
+ return {
1101
+ href: _nullishCoalesce(href, () => ( ".")),
1102
+ fetcherKey: key,
1103
+ ...getRouterInfo(router, _nullishCoalesce(opts, () => ( {})))
1104
+ };
1105
+ });
1106
+ if (instrumentedFetch) {
1107
+ instrumentedFetch[UninstrumentedSymbol] = fetch2;
1108
+ router.fetch = instrumentedFetch;
1109
+ }
1110
+ }
1111
+ return router;
1112
+ }
1113
+ function instrumentHandler(handler, fns) {
1114
+ let aggregated = {
1115
+ request: []
1116
+ };
1117
+ fns.forEach(
1118
+ (fn) => fn({
1119
+ instrument(i) {
1120
+ let keys = Object.keys(i);
1121
+ for (let key of keys) {
1122
+ if (i[key]) {
1123
+ aggregated[key].push(i[key]);
1124
+ }
1125
+ }
1126
+ }
1127
+ })
1128
+ );
1129
+ let instrumentedHandler = handler;
1130
+ if (aggregated.request.length > 0) {
1131
+ instrumentedHandler = wrapImpl(aggregated.request, handler, (...args) => {
1132
+ let [request, context] = args;
1133
+ return {
1134
+ request: getReadonlyRequest(request),
1135
+ context: context != null ? getReadonlyContext(context) : context
1136
+ };
1137
+ });
1138
+ }
1139
+ return instrumentedHandler;
1140
+ }
1141
+ function wrapImpl(impls, handler, getInfo) {
1142
+ if (impls.length === 0) {
1143
+ return null;
1144
+ }
1145
+ return async (...args) => {
1146
+ let result = await recurseRight(
1147
+ impls,
1148
+ getInfo(...args),
1149
+ () => handler(...args),
1150
+ impls.length - 1
1151
+ );
1152
+ if (result.type === "error") {
1153
+ throw result.value;
1154
+ }
1155
+ return result.value;
1156
+ };
1157
+ }
1158
+ async function recurseRight(impls, info, handler, index) {
1159
+ let impl = impls[index];
1160
+ let result;
1161
+ if (!impl) {
1162
+ try {
1163
+ let value = await handler();
1164
+ result = { type: "success", value };
1165
+ } catch (e) {
1166
+ result = { type: "error", value: e };
1167
+ }
1168
+ } else {
1169
+ let handlerPromise = void 0;
1170
+ let callHandler = async () => {
1171
+ if (handlerPromise) {
1172
+ console.error("You cannot call instrumented handlers more than once");
1173
+ } else {
1174
+ handlerPromise = recurseRight(impls, info, handler, index - 1);
1175
+ }
1176
+ result = await handlerPromise;
1177
+ invariant(result, "Expected a result");
1178
+ if (result.type === "error" && result.value instanceof Error) {
1179
+ return { status: "error", error: result.value };
1180
+ }
1181
+ return { status: "success", error: void 0 };
1182
+ };
1183
+ try {
1184
+ await impl(callHandler, info);
1185
+ } catch (e) {
1186
+ console.error("An instrumentation function threw an error:", e);
1187
+ }
1188
+ if (!handlerPromise) {
1189
+ await callHandler();
1190
+ }
1191
+ await handlerPromise;
1192
+ }
1193
+ if (result) {
1194
+ return result;
1195
+ }
1196
+ return {
1197
+ type: "error",
1198
+ value: new Error("No result assigned in instrumentation chain.")
1199
+ };
1200
+ }
1201
+ function getHandlerInfo(args) {
1202
+ let { request, context, params, unstable_pattern } = args;
1203
+ return {
1204
+ request: getReadonlyRequest(request),
1205
+ params: { ...params },
1206
+ unstable_pattern,
1207
+ context: getReadonlyContext(context)
1208
+ };
1209
+ }
1210
+ function getRouterInfo(router, opts) {
1211
+ return {
1212
+ currentUrl: createPath(router.state.location),
1213
+ ..."formMethod" in opts ? { formMethod: opts.formMethod } : {},
1214
+ ..."formEncType" in opts ? { formEncType: opts.formEncType } : {},
1215
+ ..."formData" in opts ? { formData: opts.formData } : {},
1216
+ ..."body" in opts ? { body: opts.body } : {}
1217
+ };
1218
+ }
1219
+ function getReadonlyRequest(request) {
1220
+ return {
1221
+ method: request.method,
1222
+ url: request.url,
1223
+ headers: {
1224
+ get: (...args) => request.headers.get(...args)
1225
+ }
1226
+ };
1227
+ }
1228
+ function getReadonlyContext(context) {
1229
+ if (isPlainObject(context)) {
1230
+ let frozen = { ...context };
1231
+ Object.freeze(frozen);
1232
+ return frozen;
1233
+ } else {
1234
+ return {
1235
+ get: (ctx) => context.get(ctx)
1236
+ };
1237
+ }
1238
+ }
1239
+ var objectProtoNames = Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
1240
+ function isPlainObject(thing) {
1241
+ if (thing === null || typeof thing !== "object") {
1242
+ return false;
1243
+ }
1244
+ const proto = Object.getPrototypeOf(thing);
1245
+ return proto === Object.prototype || proto === null || Object.getOwnPropertyNames(proto).sort().join("\0") === objectProtoNames;
1246
+ }
938
1247
 
939
1248
  // lib/router/router.ts
940
1249
  var validMutationMethodsArr = [
@@ -979,8 +1288,6 @@ var IDLE_BLOCKER = {
979
1288
  reset: void 0,
980
1289
  location: void 0
981
1290
  };
982
- var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
983
- var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
984
1291
  var defaultMapRouteProperties = (route) => ({
985
1292
  hasErrorBoundary: Boolean(route.hasErrorBoundary)
986
1293
  });
@@ -993,12 +1300,25 @@ function createRouter(init) {
993
1300
  init.routes.length > 0,
994
1301
  "You must provide a non-empty routes array to createRouter"
995
1302
  );
996
- let hydrationRouteProperties = init.hydrationRouteProperties || [];
997
- let mapRouteProperties = init.mapRouteProperties || defaultMapRouteProperties;
1303
+ let hydrationRouteProperties2 = init.hydrationRouteProperties || [];
1304
+ let _mapRouteProperties = init.mapRouteProperties || defaultMapRouteProperties;
1305
+ let mapRouteProperties2 = _mapRouteProperties;
1306
+ if (init.unstable_instrumentations) {
1307
+ let instrumentations = init.unstable_instrumentations;
1308
+ mapRouteProperties2 = (route) => {
1309
+ return {
1310
+ ..._mapRouteProperties(route),
1311
+ ...getRouteInstrumentationUpdates(
1312
+ instrumentations.map((i) => i.route).filter(Boolean),
1313
+ route
1314
+ )
1315
+ };
1316
+ };
1317
+ }
998
1318
  let manifest = {};
999
1319
  let dataRoutes = convertRoutesToDataRoutes(
1000
1320
  init.routes,
1001
- mapRouteProperties,
1321
+ mapRouteProperties2,
1002
1322
  void 0,
1003
1323
  manifest
1004
1324
  );
@@ -1610,12 +1930,12 @@ function createRouter(init) {
1610
1930
  };
1611
1931
  } else {
1612
1932
  let dsMatches = getTargetedDataStrategyMatches(
1613
- mapRouteProperties,
1933
+ mapRouteProperties2,
1614
1934
  manifest,
1615
1935
  request,
1616
1936
  matches,
1617
1937
  actionMatch,
1618
- initialHydration ? [] : hydrationRouteProperties,
1938
+ initialHydration ? [] : hydrationRouteProperties2,
1619
1939
  scopedContext
1620
1940
  );
1621
1941
  let results = await callDataStrategy(
@@ -1736,14 +2056,14 @@ function createRouter(init) {
1736
2056
  let { dsMatches, revalidatingFetchers } = getMatchesToLoad(
1737
2057
  request,
1738
2058
  scopedContext,
1739
- mapRouteProperties,
2059
+ mapRouteProperties2,
1740
2060
  manifest,
1741
2061
  init.history,
1742
2062
  state,
1743
2063
  matches,
1744
2064
  activeSubmission,
1745
2065
  location,
1746
- initialHydration ? [] : hydrationRouteProperties,
2066
+ initialHydration ? [] : hydrationRouteProperties2,
1747
2067
  initialHydration === true,
1748
2068
  isRevalidationRequired,
1749
2069
  cancelledFetcherLoads,
@@ -1992,12 +2312,12 @@ function createRouter(init) {
1992
2312
  fetchControllers.set(key, abortController);
1993
2313
  let originatingLoadId = incrementingLoadId;
1994
2314
  let fetchMatches = getTargetedDataStrategyMatches(
1995
- mapRouteProperties,
2315
+ mapRouteProperties2,
1996
2316
  manifest,
1997
2317
  fetchRequest,
1998
2318
  requestMatches,
1999
2319
  match,
2000
- hydrationRouteProperties,
2320
+ hydrationRouteProperties2,
2001
2321
  scopedContext
2002
2322
  );
2003
2323
  let actionResults = await callDataStrategy(
@@ -2007,6 +2327,14 @@ function createRouter(init) {
2007
2327
  key
2008
2328
  );
2009
2329
  let actionResult = actionResults[match.route.id];
2330
+ if (!actionResult) {
2331
+ for (let match2 of fetchMatches) {
2332
+ if (actionResults[match2.route.id]) {
2333
+ actionResult = actionResults[match2.route.id];
2334
+ break;
2335
+ }
2336
+ }
2337
+ }
2010
2338
  if (fetchRequest.signal.aborted) {
2011
2339
  if (fetchControllers.get(key) === abortController) {
2012
2340
  fetchControllers.delete(key);
@@ -2054,14 +2382,14 @@ function createRouter(init) {
2054
2382
  let { dsMatches, revalidatingFetchers } = getMatchesToLoad(
2055
2383
  revalidationRequest,
2056
2384
  scopedContext,
2057
- mapRouteProperties,
2385
+ mapRouteProperties2,
2058
2386
  manifest,
2059
2387
  init.history,
2060
2388
  state,
2061
2389
  matches,
2062
2390
  submission,
2063
2391
  nextLocation,
2064
- hydrationRouteProperties,
2392
+ hydrationRouteProperties2,
2065
2393
  false,
2066
2394
  isRevalidationRequired,
2067
2395
  cancelledFetcherLoads,
@@ -2207,12 +2535,12 @@ function createRouter(init) {
2207
2535
  fetchControllers.set(key, abortController);
2208
2536
  let originatingLoadId = incrementingLoadId;
2209
2537
  let dsMatches = getTargetedDataStrategyMatches(
2210
- mapRouteProperties,
2538
+ mapRouteProperties2,
2211
2539
  manifest,
2212
2540
  fetchRequest,
2213
2541
  matches,
2214
2542
  match,
2215
- hydrationRouteProperties,
2543
+ hydrationRouteProperties2,
2216
2544
  scopedContext
2217
2545
  );
2218
2546
  let results = await callDataStrategy(
@@ -2647,7 +2975,7 @@ function createRouter(init) {
2647
2975
  children,
2648
2976
  routesToUse,
2649
2977
  localManifest,
2650
- mapRouteProperties,
2978
+ mapRouteProperties2,
2651
2979
  false
2652
2980
  );
2653
2981
  }
@@ -2663,28 +2991,48 @@ function createRouter(init) {
2663
2991
  return { type: "aborted" };
2664
2992
  }
2665
2993
  let newMatches = matchRoutes(routesToUse, pathname, basename);
2994
+ let newPartialMatches = null;
2666
2995
  if (newMatches) {
2667
- return { type: "success", matches: newMatches };
2996
+ if (Object.keys(newMatches[0].params).length === 0) {
2997
+ return { type: "success", matches: newMatches };
2998
+ } else {
2999
+ newPartialMatches = matchRoutesImpl(
3000
+ routesToUse,
3001
+ pathname,
3002
+ basename,
3003
+ true
3004
+ );
3005
+ let matchedDeeper = newPartialMatches && partialMatches.length < newPartialMatches.length && compareMatches(
3006
+ partialMatches,
3007
+ newPartialMatches.slice(0, partialMatches.length)
3008
+ );
3009
+ if (!matchedDeeper) {
3010
+ return { type: "success", matches: newMatches };
3011
+ }
3012
+ }
2668
3013
  }
2669
- let newPartialMatches = matchRoutesImpl(
2670
- routesToUse,
2671
- pathname,
2672
- basename,
2673
- true
2674
- );
2675
- if (!newPartialMatches || partialMatches.length === newPartialMatches.length && partialMatches.every(
2676
- (m, i) => m.route.id === newPartialMatches[i].route.id
2677
- )) {
3014
+ if (!newPartialMatches) {
3015
+ newPartialMatches = matchRoutesImpl(
3016
+ routesToUse,
3017
+ pathname,
3018
+ basename,
3019
+ true
3020
+ );
3021
+ }
3022
+ if (!newPartialMatches || compareMatches(partialMatches, newPartialMatches)) {
2678
3023
  return { type: "success", matches: null };
2679
3024
  }
2680
3025
  partialMatches = newPartialMatches;
2681
3026
  }
2682
3027
  }
3028
+ function compareMatches(a, b) {
3029
+ return a.length === b.length && a.every((m, i) => m.route.id === b[i].route.id);
3030
+ }
2683
3031
  function _internalSetRoutes(newRoutes) {
2684
3032
  manifest = {};
2685
3033
  inFlightDataRoutes = convertRoutesToDataRoutes(
2686
3034
  newRoutes,
2687
- mapRouteProperties,
3035
+ mapRouteProperties2,
2688
3036
  void 0,
2689
3037
  manifest
2690
3038
  );
@@ -2697,7 +3045,7 @@ function createRouter(init) {
2697
3045
  children,
2698
3046
  routesToUse,
2699
3047
  manifest,
2700
- mapRouteProperties,
3048
+ mapRouteProperties2,
2701
3049
  unstable_allowElementMutations
2702
3050
  );
2703
3051
  if (isNonHMR) {
@@ -2746,6 +3094,12 @@ function createRouter(init) {
2746
3094
  updateState(newState);
2747
3095
  }
2748
3096
  };
3097
+ if (init.unstable_instrumentations) {
3098
+ router = instrumentClientSideRouter(
3099
+ router,
3100
+ init.unstable_instrumentations.map((i) => i.router).filter(Boolean)
3101
+ );
3102
+ }
2749
3103
  return router;
2750
3104
  }
2751
3105
  function createStaticHandler(routes, opts) {
@@ -2755,10 +3109,23 @@ function createStaticHandler(routes, opts) {
2755
3109
  );
2756
3110
  let manifest = {};
2757
3111
  let basename = (opts ? opts.basename : null) || "/";
2758
- let mapRouteProperties = _optionalChain([opts, 'optionalAccess', _16 => _16.mapRouteProperties]) || defaultMapRouteProperties;
3112
+ let _mapRouteProperties = _optionalChain([opts, 'optionalAccess', _16 => _16.mapRouteProperties]) || defaultMapRouteProperties;
3113
+ let mapRouteProperties2 = _mapRouteProperties;
3114
+ if (_optionalChain([opts, 'optionalAccess', _17 => _17.unstable_instrumentations])) {
3115
+ let instrumentations = opts.unstable_instrumentations;
3116
+ mapRouteProperties2 = (route) => {
3117
+ return {
3118
+ ..._mapRouteProperties(route),
3119
+ ...getRouteInstrumentationUpdates(
3120
+ instrumentations.map((i) => i.route).filter(Boolean),
3121
+ route
3122
+ )
3123
+ };
3124
+ };
3125
+ }
2759
3126
  let dataRoutes = convertRoutesToDataRoutes(
2760
3127
  routes,
2761
- mapRouteProperties,
3128
+ mapRouteProperties2,
2762
3129
  void 0,
2763
3130
  manifest
2764
3131
  );
@@ -2819,12 +3186,13 @@ function createStaticHandler(routes, opts) {
2819
3186
  await loadLazyMiddlewareForMatches(
2820
3187
  matches,
2821
3188
  manifest,
2822
- mapRouteProperties
3189
+ mapRouteProperties2
2823
3190
  );
2824
3191
  let renderedStaticContext;
2825
3192
  let response = await runServerMiddlewarePipeline(
2826
3193
  {
2827
3194
  request,
3195
+ unstable_pattern: getRoutePattern(matches.map((m) => m.route.path)),
2828
3196
  matches,
2829
3197
  params: matches[0].params,
2830
3198
  // If we're calling middleware then it must be enabled so we can cast
@@ -2888,9 +3256,9 @@ function createStaticHandler(routes, opts) {
2888
3256
  } else {
2889
3257
  let boundaryRouteId = skipLoaderErrorBubbling ? routeId : findNearestBoundary(
2890
3258
  matches,
2891
- _optionalChain([matches, 'access', _17 => _17.find, 'call', _18 => _18(
3259
+ _optionalChain([matches, 'access', _18 => _18.find, 'call', _19 => _19(
2892
3260
  (m) => m.route.id === routeId || m.route.loader
2893
- ), 'optionalAccess', _19 => _19.route, 'access', _20 => _20.id]) || routeId
3261
+ ), 'optionalAccess', _20 => _20.route, 'access', _21 => _21.id]) || routeId
2894
3262
  ).route.id;
2895
3263
  let staticContext = {
2896
3264
  matches,
@@ -2966,10 +3334,11 @@ function createStaticHandler(routes, opts) {
2966
3334
  requestContext instanceof RouterContextProvider,
2967
3335
  "When using middleware in `staticHandler.queryRoute()`, any provided `requestContext` must be an instance of `RouterContextProvider`"
2968
3336
  );
2969
- await loadLazyMiddlewareForMatches(matches, manifest, mapRouteProperties);
3337
+ await loadLazyMiddlewareForMatches(matches, manifest, mapRouteProperties2);
2970
3338
  let response = await runServerMiddlewarePipeline(
2971
3339
  {
2972
3340
  request,
3341
+ unstable_pattern: getRoutePattern(matches.map((m) => m.route.path)),
2973
3342
  matches,
2974
3343
  params: matches[0].params,
2975
3344
  // If we're calling middleware then it must be enabled so we can cast
@@ -3101,7 +3470,7 @@ function createStaticHandler(routes, opts) {
3101
3470
  };
3102
3471
  } else {
3103
3472
  let dsMatches = getTargetedDataStrategyMatches(
3104
- mapRouteProperties,
3473
+ mapRouteProperties2,
3105
3474
  manifest,
3106
3475
  request,
3107
3476
  matches,
@@ -3222,17 +3591,17 @@ function createStaticHandler(routes, opts) {
3222
3591
  }
3223
3592
  async function loadRouteData(request, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch, filterMatchesToLoad, pendingActionResult) {
3224
3593
  let isRouteRequest = routeMatch != null;
3225
- if (isRouteRequest && !_optionalChain([routeMatch, 'optionalAccess', _21 => _21.route, 'access', _22 => _22.loader]) && !_optionalChain([routeMatch, 'optionalAccess', _23 => _23.route, 'access', _24 => _24.lazy])) {
3594
+ if (isRouteRequest && !_optionalChain([routeMatch, 'optionalAccess', _22 => _22.route, 'access', _23 => _23.loader]) && !_optionalChain([routeMatch, 'optionalAccess', _24 => _24.route, 'access', _25 => _25.lazy])) {
3226
3595
  throw getInternalRouterError(400, {
3227
3596
  method: request.method,
3228
3597
  pathname: new URL(request.url).pathname,
3229
- routeId: _optionalChain([routeMatch, 'optionalAccess', _25 => _25.route, 'access', _26 => _26.id])
3598
+ routeId: _optionalChain([routeMatch, 'optionalAccess', _26 => _26.route, 'access', _27 => _27.id])
3230
3599
  });
3231
3600
  }
3232
3601
  let dsMatches;
3233
3602
  if (routeMatch) {
3234
3603
  dsMatches = getTargetedDataStrategyMatches(
3235
- mapRouteProperties,
3604
+ mapRouteProperties2,
3236
3605
  manifest,
3237
3606
  request,
3238
3607
  matches,
@@ -3245,12 +3614,14 @@ function createStaticHandler(routes, opts) {
3245
3614
  // Up to but not including the boundary
3246
3615
  matches.findIndex((m) => m.route.id === pendingActionResult[0]) - 1
3247
3616
  ) : void 0;
3617
+ let pattern = getRoutePattern(matches.map((m) => m.route.path));
3248
3618
  dsMatches = matches.map((match, index) => {
3249
3619
  if (maxIdx != null && index > maxIdx) {
3250
3620
  return getDataStrategyMatch(
3251
- mapRouteProperties,
3621
+ mapRouteProperties2,
3252
3622
  manifest,
3253
3623
  request,
3624
+ pattern,
3254
3625
  match,
3255
3626
  [],
3256
3627
  requestContext,
@@ -3258,9 +3629,10 @@ function createStaticHandler(routes, opts) {
3258
3629
  );
3259
3630
  }
3260
3631
  return getDataStrategyMatch(
3261
- mapRouteProperties,
3632
+ mapRouteProperties2,
3262
3633
  manifest,
3263
3634
  request,
3635
+ pattern,
3264
3636
  match,
3265
3637
  [],
3266
3638
  requestContext,
@@ -3518,7 +3890,7 @@ function normalizeNavigateOptions(isFetcher, path, opts) {
3518
3890
  parsedPath.search = `?${searchParams}`;
3519
3891
  return { path: createPath(parsedPath), submission };
3520
3892
  }
3521
- function getMatchesToLoad(request, scopedContext, mapRouteProperties, manifest, history, state, matches, submission, location, lazyRoutePropertiesToSkip, initialHydration, isRevalidationRequired, cancelledFetcherLoads, fetchersQueuedForDeletion, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, hasPatchRoutesOnNavigation, pendingActionResult) {
3893
+ function getMatchesToLoad(request, scopedContext, mapRouteProperties2, manifest, history, state, matches, submission, location, lazyRoutePropertiesToSkip, initialHydration, isRevalidationRequired, cancelledFetcherLoads, fetchersQueuedForDeletion, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, hasPatchRoutesOnNavigation, pendingActionResult) {
3522
3894
  let actionResult = pendingActionResult ? isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : pendingActionResult[1].data : void 0;
3523
3895
  let currentUrl = history.createURL(state.location);
3524
3896
  let nextUrl = history.createURL(location);
@@ -3534,13 +3906,14 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties, manifest,
3534
3906
  let shouldSkipRevalidation = actionStatus && actionStatus >= 400;
3535
3907
  let baseShouldRevalidateArgs = {
3536
3908
  currentUrl,
3537
- currentParams: _optionalChain([state, 'access', _27 => _27.matches, 'access', _28 => _28[0], 'optionalAccess', _29 => _29.params]) || {},
3909
+ currentParams: _optionalChain([state, 'access', _28 => _28.matches, 'access', _29 => _29[0], 'optionalAccess', _30 => _30.params]) || {},
3538
3910
  nextUrl,
3539
3911
  nextParams: matches[0].params,
3540
3912
  ...submission,
3541
3913
  actionResult,
3542
3914
  actionStatus
3543
3915
  };
3916
+ let pattern = getRoutePattern(matches.map((m) => m.route.path));
3544
3917
  let dsMatches = matches.map((match, index) => {
3545
3918
  let { route } = match;
3546
3919
  let forceShouldLoad = null;
@@ -3561,9 +3934,10 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties, manifest,
3561
3934
  }
3562
3935
  if (forceShouldLoad !== null) {
3563
3936
  return getDataStrategyMatch(
3564
- mapRouteProperties,
3937
+ mapRouteProperties2,
3565
3938
  manifest,
3566
3939
  request,
3940
+ pattern,
3567
3941
  match,
3568
3942
  lazyRoutePropertiesToSkip,
3569
3943
  scopedContext,
@@ -3581,9 +3955,10 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties, manifest,
3581
3955
  };
3582
3956
  let shouldLoad = shouldRevalidateLoader(match, shouldRevalidateArgs);
3583
3957
  return getDataStrategyMatch(
3584
- mapRouteProperties,
3958
+ mapRouteProperties2,
3585
3959
  manifest,
3586
3960
  request,
3961
+ pattern,
3587
3962
  match,
3588
3963
  lazyRoutePropertiesToSkip,
3589
3964
  scopedContext,
@@ -3628,7 +4003,7 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties, manifest,
3628
4003
  if (cancelledFetcherLoads.has(key)) {
3629
4004
  cancelledFetcherLoads.delete(key);
3630
4005
  fetcherDsMatches = getTargetedDataStrategyMatches(
3631
- mapRouteProperties,
4006
+ mapRouteProperties2,
3632
4007
  manifest,
3633
4008
  fetchRequest,
3634
4009
  fetcherMatches,
@@ -3639,7 +4014,7 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties, manifest,
3639
4014
  } else if (isMidInitialLoad) {
3640
4015
  if (isRevalidationRequired) {
3641
4016
  fetcherDsMatches = getTargetedDataStrategyMatches(
3642
- mapRouteProperties,
4017
+ mapRouteProperties2,
3643
4018
  manifest,
3644
4019
  fetchRequest,
3645
4020
  fetcherMatches,
@@ -3655,7 +4030,7 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties, manifest,
3655
4030
  };
3656
4031
  if (shouldRevalidateLoader(fetcherMatch, shouldRevalidateArgs)) {
3657
4032
  fetcherDsMatches = getTargetedDataStrategyMatches(
3658
- mapRouteProperties,
4033
+ mapRouteProperties2,
3659
4034
  manifest,
3660
4035
  fetchRequest,
3661
4036
  fetcherMatches,
@@ -3727,7 +4102,7 @@ function shouldRevalidateLoader(loaderMatch, arg) {
3727
4102
  }
3728
4103
  return arg.defaultShouldRevalidate;
3729
4104
  }
3730
- function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties, allowElementMutations) {
4105
+ function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties2, allowElementMutations) {
3731
4106
  let childrenToPatch;
3732
4107
  if (routeId) {
3733
4108
  let route = manifest[routeId];
@@ -3757,8 +4132,8 @@ function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRoutePrope
3757
4132
  if (uniqueChildren.length > 0) {
3758
4133
  let newRoutes = convertRoutesToDataRoutes(
3759
4134
  uniqueChildren,
3760
- mapRouteProperties,
3761
- [routeId || "_", "patch", String(_optionalChain([childrenToPatch, 'optionalAccess', _30 => _30.length]) || "0")],
4135
+ mapRouteProperties2,
4136
+ [routeId || "_", "patch", String(_optionalChain([childrenToPatch, 'optionalAccess', _31 => _31.length]) || "0")],
3762
4137
  manifest
3763
4138
  );
3764
4139
  childrenToPatch.push(...newRoutes);
@@ -3769,7 +4144,7 @@ function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRoutePrope
3769
4144
  let existingRouteTyped = existingRoute;
3770
4145
  let [newRouteTyped] = convertRoutesToDataRoutes(
3771
4146
  [newRoute],
3772
- mapRouteProperties,
4147
+ mapRouteProperties2,
3773
4148
  [],
3774
4149
  // Doesn't matter for mutated routes since they already have an id
3775
4150
  {},
@@ -3795,7 +4170,7 @@ function isSameRoute(newRoute, existingRoute) {
3795
4170
  return true;
3796
4171
  }
3797
4172
  return newRoute.children.every(
3798
- (aChild, i) => _optionalChain([existingRoute, 'access', _31 => _31.children, 'optionalAccess', _32 => _32.some, 'call', _33 => _33((bChild) => isSameRoute(aChild, bChild))])
4173
+ (aChild, i) => _optionalChain([existingRoute, 'access', _32 => _32.children, 'optionalAccess', _33 => _33.some, 'call', _34 => _34((bChild) => isSameRoute(aChild, bChild))])
3799
4174
  );
3800
4175
  }
3801
4176
  var lazyRoutePropertyCache = /* @__PURE__ */ new WeakMap();
@@ -3803,7 +4178,7 @@ var loadLazyRouteProperty = ({
3803
4178
  key,
3804
4179
  route,
3805
4180
  manifest,
3806
- mapRouteProperties
4181
+ mapRouteProperties: mapRouteProperties2
3807
4182
  }) => {
3808
4183
  let routeToUpdate = manifest[route.id];
3809
4184
  invariant(routeToUpdate, "No route found in manifest");
@@ -3842,7 +4217,7 @@ var loadLazyRouteProperty = ({
3842
4217
  let value = await lazyFn();
3843
4218
  if (value != null) {
3844
4219
  Object.assign(routeToUpdate, { [key]: value });
3845
- Object.assign(routeToUpdate, mapRouteProperties(routeToUpdate));
4220
+ Object.assign(routeToUpdate, mapRouteProperties2(routeToUpdate));
3846
4221
  }
3847
4222
  }
3848
4223
  if (typeof routeToUpdate.lazy === "object") {
@@ -3856,7 +4231,7 @@ var loadLazyRouteProperty = ({
3856
4231
  return propertyPromise;
3857
4232
  };
3858
4233
  var lazyRouteFunctionCache = /* @__PURE__ */ new WeakMap();
3859
- function loadLazyRoute(route, type, manifest, mapRouteProperties, lazyRoutePropertiesToSkip) {
4234
+ function loadLazyRoute(route, type, manifest, mapRouteProperties2, lazyRoutePropertiesToSkip) {
3860
4235
  let routeToUpdate = manifest[route.id];
3861
4236
  invariant(routeToUpdate, "No route found in manifest");
3862
4237
  if (!route.lazy) {
@@ -3909,7 +4284,7 @@ function loadLazyRoute(route, type, manifest, mapRouteProperties, lazyRoutePrope
3909
4284
  // To keep things framework agnostic, we use the provided `mapRouteProperties`
3910
4285
  // function to set the framework-aware properties (`element`/`hasErrorBoundary`)
3911
4286
  // since the logic will differ between frameworks.
3912
- ...mapRouteProperties(routeToUpdate),
4287
+ ...mapRouteProperties2(routeToUpdate),
3913
4288
  lazy: void 0
3914
4289
  });
3915
4290
  })();
@@ -3932,7 +4307,7 @@ function loadLazyRoute(route, type, manifest, mapRouteProperties, lazyRoutePrope
3932
4307
  key,
3933
4308
  route,
3934
4309
  manifest,
3935
- mapRouteProperties
4310
+ mapRouteProperties: mapRouteProperties2
3936
4311
  });
3937
4312
  if (promise) {
3938
4313
  lazyPropertyPromises.push(promise);
@@ -3943,9 +4318,9 @@ function loadLazyRoute(route, type, manifest, mapRouteProperties, lazyRoutePrope
3943
4318
  }
3944
4319
  let lazyRoutePromise = lazyPropertyPromises.length > 0 ? Promise.all(lazyPropertyPromises).then(() => {
3945
4320
  }) : void 0;
3946
- _optionalChain([lazyRoutePromise, 'optionalAccess', _34 => _34.catch, 'call', _35 => _35(() => {
4321
+ _optionalChain([lazyRoutePromise, 'optionalAccess', _35 => _35.catch, 'call', _36 => _36(() => {
3947
4322
  })]);
3948
- _optionalChain([lazyHandlerPromise, 'optionalAccess', _36 => _36.catch, 'call', _37 => _37(() => {
4323
+ _optionalChain([lazyHandlerPromise, 'optionalAccess', _37 => _37.catch, 'call', _38 => _38(() => {
3949
4324
  })]);
3950
4325
  return {
3951
4326
  lazyRoutePromise,
@@ -3955,7 +4330,7 @@ function loadLazyRoute(route, type, manifest, mapRouteProperties, lazyRoutePrope
3955
4330
  function isNonNullable(value) {
3956
4331
  return value !== void 0;
3957
4332
  }
3958
- function loadLazyMiddlewareForMatches(matches, manifest, mapRouteProperties) {
4333
+ function loadLazyMiddlewareForMatches(matches, manifest, mapRouteProperties2) {
3959
4334
  let promises = matches.map(({ route }) => {
3960
4335
  if (typeof route.lazy !== "object" || !route.lazy.middleware) {
3961
4336
  return void 0;
@@ -3964,7 +4339,7 @@ function loadLazyMiddlewareForMatches(matches, manifest, mapRouteProperties) {
3964
4339
  key: "middleware",
3965
4340
  route,
3966
4341
  manifest,
3967
- mapRouteProperties
4342
+ mapRouteProperties: mapRouteProperties2
3968
4343
  });
3969
4344
  }).filter(isNonNullable);
3970
4345
  return promises.length > 0 ? Promise.all(promises) : void 0;
@@ -4037,12 +4412,17 @@ function runClientMiddlewarePipeline(args, handler) {
4037
4412
  }
4038
4413
  }
4039
4414
  async function runMiddlewarePipeline(args, handler, processResult, isResult, errorHandler) {
4040
- let { matches, request, params, context } = args;
4415
+ let { matches, request, params, context, unstable_pattern } = args;
4041
4416
  let tuples = matches.flatMap(
4042
4417
  (m) => m.route.middleware ? m.route.middleware.map((fn) => [m.route.id, fn]) : []
4043
4418
  );
4044
4419
  let result = await callRouteMiddleware(
4045
- { request, params, context },
4420
+ {
4421
+ request,
4422
+ params,
4423
+ context,
4424
+ unstable_pattern
4425
+ },
4046
4426
  tuples,
4047
4427
  handler,
4048
4428
  processResult,
@@ -4100,18 +4480,18 @@ async function callRouteMiddleware(args, middlewares, handler, processResult, is
4100
4480
  return response;
4101
4481
  }
4102
4482
  }
4103
- function getDataStrategyMatchLazyPromises(mapRouteProperties, manifest, request, match, lazyRoutePropertiesToSkip) {
4483
+ function getDataStrategyMatchLazyPromises(mapRouteProperties2, manifest, request, match, lazyRoutePropertiesToSkip) {
4104
4484
  let lazyMiddlewarePromise = loadLazyRouteProperty({
4105
4485
  key: "middleware",
4106
4486
  route: match.route,
4107
4487
  manifest,
4108
- mapRouteProperties
4488
+ mapRouteProperties: mapRouteProperties2
4109
4489
  });
4110
4490
  let lazyRoutePromises = loadLazyRoute(
4111
4491
  match.route,
4112
4492
  isMutationMethod(request.method) ? "action" : "loader",
4113
4493
  manifest,
4114
- mapRouteProperties,
4494
+ mapRouteProperties2,
4115
4495
  lazyRoutePropertiesToSkip
4116
4496
  );
4117
4497
  return {
@@ -4120,10 +4500,10 @@ function getDataStrategyMatchLazyPromises(mapRouteProperties, manifest, request,
4120
4500
  handler: lazyRoutePromises.lazyHandlerPromise
4121
4501
  };
4122
4502
  }
4123
- function getDataStrategyMatch(mapRouteProperties, manifest, request, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, unstable_shouldRevalidateArgs = null) {
4503
+ function getDataStrategyMatch(mapRouteProperties2, manifest, request, unstable_pattern, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, unstable_shouldRevalidateArgs = null) {
4124
4504
  let isUsingNewApi = false;
4125
4505
  let _lazyPromises = getDataStrategyMatchLazyPromises(
4126
- mapRouteProperties,
4506
+ mapRouteProperties2,
4127
4507
  manifest,
4128
4508
  request,
4129
4509
  match,
@@ -4151,12 +4531,13 @@ function getDataStrategyMatch(mapRouteProperties, manifest, request, match, lazy
4151
4531
  let { lazy, loader, middleware } = match.route;
4152
4532
  let callHandler = isUsingNewApi || shouldLoad || handlerOverride && !isMutationMethod(request.method) && (lazy || loader);
4153
4533
  let isMiddlewareOnlyRoute = middleware && middleware.length > 0 && !loader && !lazy;
4154
- if (callHandler && !isMiddlewareOnlyRoute) {
4534
+ if (callHandler && (isMutationMethod(request.method) || !isMiddlewareOnlyRoute)) {
4155
4535
  return callLoaderOrAction({
4156
4536
  request,
4537
+ unstable_pattern,
4157
4538
  match,
4158
- lazyHandlerPromise: _optionalChain([_lazyPromises, 'optionalAccess', _38 => _38.handler]),
4159
- lazyRoutePromise: _optionalChain([_lazyPromises, 'optionalAccess', _39 => _39.route]),
4539
+ lazyHandlerPromise: _optionalChain([_lazyPromises, 'optionalAccess', _39 => _39.handler]),
4540
+ lazyRoutePromise: _optionalChain([_lazyPromises, 'optionalAccess', _40 => _40.route]),
4160
4541
  handlerOverride,
4161
4542
  scopedContext
4162
4543
  });
@@ -4165,7 +4546,7 @@ function getDataStrategyMatch(mapRouteProperties, manifest, request, match, lazy
4165
4546
  }
4166
4547
  };
4167
4548
  }
4168
- function getTargetedDataStrategyMatches(mapRouteProperties, manifest, request, matches, targetMatch, lazyRoutePropertiesToSkip, scopedContext, shouldRevalidateArgs = null) {
4549
+ function getTargetedDataStrategyMatches(mapRouteProperties2, manifest, request, matches, targetMatch, lazyRoutePropertiesToSkip, scopedContext, shouldRevalidateArgs = null) {
4169
4550
  return matches.map((match) => {
4170
4551
  if (match.route.id !== targetMatch.route.id) {
4171
4552
  return {
@@ -4174,7 +4555,7 @@ function getTargetedDataStrategyMatches(mapRouteProperties, manifest, request, m
4174
4555
  unstable_shouldRevalidateArgs: shouldRevalidateArgs,
4175
4556
  unstable_shouldCallHandler: () => false,
4176
4557
  _lazyPromises: getDataStrategyMatchLazyPromises(
4177
- mapRouteProperties,
4558
+ mapRouteProperties2,
4178
4559
  manifest,
4179
4560
  request,
4180
4561
  match,
@@ -4184,9 +4565,10 @@ function getTargetedDataStrategyMatches(mapRouteProperties, manifest, request, m
4184
4565
  };
4185
4566
  }
4186
4567
  return getDataStrategyMatch(
4187
- mapRouteProperties,
4568
+ mapRouteProperties2,
4188
4569
  manifest,
4189
4570
  request,
4571
+ getRoutePattern(matches.map((m) => m.route.path)),
4190
4572
  match,
4191
4573
  lazyRoutePropertiesToSkip,
4192
4574
  scopedContext,
@@ -4196,11 +4578,12 @@ function getTargetedDataStrategyMatches(mapRouteProperties, manifest, request, m
4196
4578
  });
4197
4579
  }
4198
4580
  async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherKey, scopedContext, isStaticHandler) {
4199
- if (matches.some((m) => _optionalChain([m, 'access', _40 => _40._lazyPromises, 'optionalAccess', _41 => _41.middleware]))) {
4200
- await Promise.all(matches.map((m) => _optionalChain([m, 'access', _42 => _42._lazyPromises, 'optionalAccess', _43 => _43.middleware])));
4581
+ if (matches.some((m) => _optionalChain([m, 'access', _41 => _41._lazyPromises, 'optionalAccess', _42 => _42.middleware]))) {
4582
+ await Promise.all(matches.map((m) => _optionalChain([m, 'access', _43 => _43._lazyPromises, 'optionalAccess', _44 => _44.middleware])));
4201
4583
  }
4202
4584
  let dataStrategyArgs = {
4203
4585
  request,
4586
+ unstable_pattern: getRoutePattern(matches.map((m) => m.route.path)),
4204
4587
  params: matches[0].params,
4205
4588
  context: scopedContext,
4206
4589
  matches
@@ -4231,8 +4614,8 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
4231
4614
  try {
4232
4615
  await Promise.all(
4233
4616
  matches.flatMap((m) => [
4234
- _optionalChain([m, 'access', _44 => _44._lazyPromises, 'optionalAccess', _45 => _45.handler]),
4235
- _optionalChain([m, 'access', _46 => _46._lazyPromises, 'optionalAccess', _47 => _47.route])
4617
+ _optionalChain([m, 'access', _45 => _45._lazyPromises, 'optionalAccess', _46 => _46.handler]),
4618
+ _optionalChain([m, 'access', _47 => _47._lazyPromises, 'optionalAccess', _48 => _48.route])
4236
4619
  ])
4237
4620
  );
4238
4621
  } catch (e) {
@@ -4241,6 +4624,7 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
4241
4624
  }
4242
4625
  async function callLoaderOrAction({
4243
4626
  request,
4627
+ unstable_pattern,
4244
4628
  match,
4245
4629
  lazyHandlerPromise,
4246
4630
  lazyRoutePromise,
@@ -4267,6 +4651,7 @@ async function callLoaderOrAction({
4267
4651
  return handler(
4268
4652
  {
4269
4653
  request,
4654
+ unstable_pattern,
4270
4655
  params: match.params,
4271
4656
  context: scopedContext
4272
4657
  },
@@ -4375,19 +4760,19 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
4375
4760
  return {
4376
4761
  type: "error" /* error */,
4377
4762
  error: result.data,
4378
- statusCode: _optionalChain([result, 'access', _48 => _48.init, 'optionalAccess', _49 => _49.status]),
4379
- headers: _optionalChain([result, 'access', _50 => _50.init, 'optionalAccess', _51 => _51.headers]) ? new Headers(result.init.headers) : void 0
4763
+ statusCode: _optionalChain([result, 'access', _49 => _49.init, 'optionalAccess', _50 => _50.status]),
4764
+ headers: _optionalChain([result, 'access', _51 => _51.init, 'optionalAccess', _52 => _52.headers]) ? new Headers(result.init.headers) : void 0
4380
4765
  };
4381
4766
  }
4382
4767
  return {
4383
4768
  type: "error" /* error */,
4384
4769
  error: new ErrorResponseImpl(
4385
- _optionalChain([result, 'access', _52 => _52.init, 'optionalAccess', _53 => _53.status]) || 500,
4770
+ _optionalChain([result, 'access', _53 => _53.init, 'optionalAccess', _54 => _54.status]) || 500,
4386
4771
  void 0,
4387
4772
  result.data
4388
4773
  ),
4389
4774
  statusCode: isRouteErrorResponse(result) ? result.status : void 0,
4390
- headers: _optionalChain([result, 'access', _54 => _54.init, 'optionalAccess', _55 => _55.headers]) ? new Headers(result.init.headers) : void 0
4775
+ headers: _optionalChain([result, 'access', _55 => _55.init, 'optionalAccess', _56 => _56.headers]) ? new Headers(result.init.headers) : void 0
4391
4776
  };
4392
4777
  }
4393
4778
  return {
@@ -4400,8 +4785,8 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
4400
4785
  return {
4401
4786
  type: "data" /* data */,
4402
4787
  data: result.data,
4403
- statusCode: _optionalChain([result, 'access', _56 => _56.init, 'optionalAccess', _57 => _57.status]),
4404
- headers: _optionalChain([result, 'access', _58 => _58.init, 'optionalAccess', _59 => _59.headers]) ? new Headers(result.init.headers) : void 0
4788
+ statusCode: _optionalChain([result, 'access', _57 => _57.init, 'optionalAccess', _58 => _58.status]),
4789
+ headers: _optionalChain([result, 'access', _59 => _59.init, 'optionalAccess', _60 => _60.headers]) ? new Headers(result.init.headers) : void 0
4405
4790
  };
4406
4791
  }
4407
4792
  return { type: "data" /* data */, data: result };
@@ -4550,7 +4935,7 @@ function processLoaderData(state, matches, results, pendingActionResult, revalid
4550
4935
  let result = fetcherResults[key];
4551
4936
  invariant(result, "Did not find corresponding fetcher result");
4552
4937
  if (isErrorResult(result)) {
4553
- let boundaryMatch = findNearestBoundary(state.matches, _optionalChain([match, 'optionalAccess', _60 => _60.route, 'access', _61 => _61.id]));
4938
+ let boundaryMatch = findNearestBoundary(state.matches, _optionalChain([match, 'optionalAccess', _61 => _61.route, 'access', _62 => _62.id]));
4554
4939
  if (!(errors && errors[boundaryMatch.route.id])) {
4555
4940
  errors = {
4556
4941
  ...errors,
@@ -4684,8 +5069,8 @@ function dataWithResponseInitToResponse(data2) {
4684
5069
  }
4685
5070
  function dataWithResponseInitToErrorResponse(data2) {
4686
5071
  return new ErrorResponseImpl(
4687
- _nullishCoalesce(_optionalChain([data2, 'access', _62 => _62.init, 'optionalAccess', _63 => _63.status]), () => ( 500)),
4688
- _nullishCoalesce(_optionalChain([data2, 'access', _64 => _64.init, 'optionalAccess', _65 => _65.statusText]), () => ( "Internal Server Error")),
5072
+ _nullishCoalesce(_optionalChain([data2, 'access', _63 => _63.init, 'optionalAccess', _64 => _64.status]), () => ( 500)),
5073
+ _nullishCoalesce(_optionalChain([data2, 'access', _65 => _65.init, 'optionalAccess', _66 => _66.statusText]), () => ( "Internal Server Error")),
4689
5074
  data2.data
4690
5075
  );
4691
5076
  }
@@ -4926,7 +5311,7 @@ function createDeferred() {
4926
5311
  }
4927
5312
 
4928
5313
  // lib/dom/ssr/single-fetch.tsx
4929
- var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react); var React8 = _interopRequireWildcard(_react); var React7 = _interopRequireWildcard(_react); var React6 = _interopRequireWildcard(_react); var React5 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react);
5314
+ var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react); var React8 = _interopRequireWildcard(_react); var React7 = _interopRequireWildcard(_react); var React6 = _interopRequireWildcard(_react); var React5 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React9 = _interopRequireWildcard(_react);
4930
5315
 
4931
5316
  // vendor/turbo-stream-v2/utils.ts
4932
5317
  var HOLE = -1;
@@ -5082,7 +5467,7 @@ function stringify(input, index) {
5082
5467
  str[index2] += "]";
5083
5468
  } else if (Object.getPrototypeOf(input2) === null) {
5084
5469
  str[index2] = `["${TYPE_NULL_OBJECT}",{${partsForObj(input2)}}]`;
5085
- } else if (isPlainObject(input2)) {
5470
+ } else if (isPlainObject2(input2)) {
5086
5471
  str[index2] = `{${partsForObj(input2)}}`;
5087
5472
  } else {
5088
5473
  error = new Error("Cannot encode object with prototype");
@@ -5136,10 +5521,10 @@ function stringify(input, index) {
5136
5521
  }
5137
5522
  }
5138
5523
  }
5139
- var objectProtoNames = Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
5140
- function isPlainObject(thing) {
5524
+ var objectProtoNames2 = Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
5525
+ function isPlainObject2(thing) {
5141
5526
  const proto = Object.getPrototypeOf(thing);
5142
- return proto === Object.prototype || proto === null || Object.getOwnPropertyNames(proto).sort().join("\0") === objectProtoNames;
5527
+ return proto === Object.prototype || proto === null || Object.getOwnPropertyNames(proto).sort().join("\0") === objectProtoNames2;
5143
5528
  }
5144
5529
 
5145
5530
  // vendor/turbo-stream-v2/unflatten.ts
@@ -5717,7 +6102,7 @@ function getTurboStreamSingleFetchDataStrategy(getRouter, manifest, routeModules
5717
6102
  return {
5718
6103
  hasLoader: manifestRoute.hasLoader,
5719
6104
  hasClientLoader: manifestRoute.hasClientLoader,
5720
- hasShouldRevalidate: Boolean(_optionalChain([routeModule, 'optionalAccess', _66 => _66.shouldRevalidate]))
6105
+ hasShouldRevalidate: Boolean(_optionalChain([routeModule, 'optionalAccess', _67 => _67.shouldRevalidate]))
5721
6106
  };
5722
6107
  },
5723
6108
  fetchAndDecodeViaTurboStream,
@@ -5884,7 +6269,7 @@ async function bubbleMiddlewareErrors(singleFetchPromise, matches, routesParams,
5884
6269
  let routeResult = fetchedData.routes[match.route.id];
5885
6270
  if ("error" in routeResult) {
5886
6271
  middlewareError = routeResult.error;
5887
- if (_optionalChain([results, 'access', _67 => _67[match.route.id], 'optionalAccess', _68 => _68.result]) == null) {
6272
+ if (_optionalChain([results, 'access', _68 => _68[match.route.id], 'optionalAccess', _69 => _69.result]) == null) {
5888
6273
  results[match.route.id] = {
5889
6274
  type: "error",
5890
6275
  result: middlewareError
@@ -5997,7 +6382,7 @@ async function fetchAndDecodeViaTurboStream(args, basename, targetRoutes) {
5997
6382
  }
5998
6383
  } else {
5999
6384
  let typed = decoded.value;
6000
- let routeId = _optionalChain([targetRoutes, 'optionalAccess', _69 => _69[0]]);
6385
+ let routeId = _optionalChain([targetRoutes, 'optionalAccess', _70 => _70[0]]);
6001
6386
  invariant2(routeId, "No routeId found for single fetch call decoding");
6002
6387
  if ("redirect" in typed) {
6003
6388
  data2 = { redirect: typed };
@@ -6309,7 +6694,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
6309
6694
  if (locationArg) {
6310
6695
  let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
6311
6696
  invariant(
6312
- parentPathnameBase === "/" || _optionalChain([parsedLocationArg, 'access', _70 => _70.pathname, 'optionalAccess', _71 => _71.startsWith, 'call', _72 => _72(parentPathnameBase)]),
6697
+ parentPathnameBase === "/" || _optionalChain([parsedLocationArg, 'access', _71 => _71.pathname, 'optionalAccess', _72 => _72.startsWith, 'call', _73 => _73(parentPathnameBase)]),
6313
6698
  `When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${parentPathnameBase}" but pathname "${parsedLocationArg.pathname}" was given in the \`location\` prop.`
6314
6699
  );
6315
6700
  location = parsedLocationArg;
@@ -6431,8 +6816,8 @@ var RenderErrorBoundary = class extends React3.Component {
6431
6816
  };
6432
6817
  }
6433
6818
  componentDidCatch(error, errorInfo) {
6434
- if (this.props.unstable_onError) {
6435
- this.props.unstable_onError(error, errorInfo);
6819
+ if (this.props.onError) {
6820
+ this.props.onError(error, errorInfo);
6436
6821
  } else {
6437
6822
  console.error(
6438
6823
  "React Router caught the following error during render",
@@ -6471,10 +6856,10 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, uns
6471
6856
  }
6472
6857
  }
6473
6858
  let renderedMatches = matches;
6474
- let errors = _optionalChain([dataRouterState, 'optionalAccess', _73 => _73.errors]);
6859
+ let errors = _optionalChain([dataRouterState, 'optionalAccess', _74 => _74.errors]);
6475
6860
  if (errors != null) {
6476
6861
  let errorIndex = renderedMatches.findIndex(
6477
- (m) => m.route.id && _optionalChain([errors, 'optionalAccess', _74 => _74[m.route.id]]) !== void 0
6862
+ (m) => m.route.id && _optionalChain([errors, 'optionalAccess', _75 => _75[m.route.id]]) !== void 0
6478
6863
  );
6479
6864
  invariant(
6480
6865
  errorIndex >= 0,
@@ -6510,6 +6895,13 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, uns
6510
6895
  }
6511
6896
  }
6512
6897
  }
6898
+ let onError = dataRouterState && unstable_onError ? (error, errorInfo) => {
6899
+ unstable_onError(error, {
6900
+ location: dataRouterState.location,
6901
+ params: _nullishCoalesce(_optionalChain([dataRouterState, 'access', _76 => _76.matches, 'optionalAccess', _77 => _77[0], 'optionalAccess', _78 => _78.params]), () => ( {})),
6902
+ errorInfo
6903
+ });
6904
+ } : void 0;
6513
6905
  return renderedMatches.reduceRight(
6514
6906
  (outlet, match, index) => {
6515
6907
  let error;
@@ -6570,7 +6962,7 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, uns
6570
6962
  error,
6571
6963
  children: getChildren(),
6572
6964
  routeContext: { outlet: null, matches: matches2, isDataRoute: true },
6573
- unstable_onError
6965
+ onError
6574
6966
  }
6575
6967
  ) : getChildren();
6576
6968
  },
@@ -6652,15 +7044,15 @@ function useRouteError() {
6652
7044
  if (error !== void 0) {
6653
7045
  return error;
6654
7046
  }
6655
- return _optionalChain([state, 'access', _75 => _75.errors, 'optionalAccess', _76 => _76[routeId]]);
7047
+ return _optionalChain([state, 'access', _79 => _79.errors, 'optionalAccess', _80 => _80[routeId]]);
6656
7048
  }
6657
7049
  function useAsyncValue() {
6658
7050
  let value = React3.useContext(AwaitContext);
6659
- return _optionalChain([value, 'optionalAccess', _77 => _77._data]);
7051
+ return _optionalChain([value, 'optionalAccess', _81 => _81._data]);
6660
7052
  }
6661
7053
  function useAsyncError() {
6662
7054
  let value = React3.useContext(AwaitContext);
6663
- return _optionalChain([value, 'optionalAccess', _78 => _78._error]);
7055
+ return _optionalChain([value, 'optionalAccess', _82 => _82._error]);
6664
7056
  }
6665
7057
  var blockerId = 0;
6666
7058
  function useBlocker(shouldBlock) {
@@ -6735,12 +7127,13 @@ function useRoute(...args) {
6735
7127
  "useRoute" /* UseRoute */
6736
7128
  );
6737
7129
  const id = _nullishCoalesce(args[0], () => ( currentRouteId));
6738
- const state = useDataRouterState("useRouteLoaderData" /* UseRouteLoaderData */);
7130
+ const state = useDataRouterState("useRoute" /* UseRoute */);
6739
7131
  const route = state.matches.find(({ route: route2 }) => route2.id === id);
6740
7132
  if (route === void 0) return void 0;
6741
7133
  return {
7134
+ handle: route.route.handle,
6742
7135
  loaderData: state.loaderData[id],
6743
- actionData: _optionalChain([state, 'access', _79 => _79.actionData, 'optionalAccess', _80 => _80[id]])
7136
+ actionData: _optionalChain([state, 'access', _83 => _83.actionData, 'optionalAccess', _84 => _84[id]])
6744
7137
  };
6745
7138
  }
6746
7139
 
@@ -6785,7 +7178,7 @@ function getKeyedLinksForMatches(matches, routeModules, manifest) {
6785
7178
  let route = manifest.routes[match.route.id];
6786
7179
  return [
6787
7180
  route && route.css ? route.css.map((href) => ({ rel: "stylesheet", href })) : [],
6788
- _optionalChain([module, 'optionalAccess', _81 => _81.links, 'optionalCall', _82 => _82()]) || []
7181
+ _optionalChain([module, 'optionalAccess', _85 => _85.links, 'optionalCall', _86 => _86()]) || []
6789
7182
  ];
6790
7183
  }).flat(2);
6791
7184
  let preloads = getModuleLinkHrefs(matches, manifest);
@@ -6886,7 +7279,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
6886
7279
  // param change, /users/123 -> /users/456
6887
7280
  currentMatches[index].pathname !== match.pathname || // splat param changed, which is not present in match.path
6888
7281
  // e.g. /files/images/avatar.jpg -> files/finances.xls
6889
- _optionalChain([currentMatches, 'access', _83 => _83[index], 'access', _84 => _84.route, 'access', _85 => _85.path, 'optionalAccess', _86 => _86.endsWith, 'call', _87 => _87("*")]) && currentMatches[index].params["*"] !== match.params["*"]
7282
+ _optionalChain([currentMatches, 'access', _87 => _87[index], 'access', _88 => _88.route, 'access', _89 => _89.path, 'optionalAccess', _90 => _90.endsWith, 'call', _91 => _91("*")]) && currentMatches[index].params["*"] !== match.params["*"]
6890
7283
  );
6891
7284
  };
6892
7285
  if (mode === "assets") {
@@ -6909,7 +7302,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
6909
7302
  location.pathname + location.search + location.hash,
6910
7303
  window.origin
6911
7304
  ),
6912
- currentParams: _optionalChain([currentMatches, 'access', _88 => _88[0], 'optionalAccess', _89 => _89.params]) || {},
7305
+ currentParams: _optionalChain([currentMatches, 'access', _92 => _92[0], 'optionalAccess', _93 => _93.params]) || {},
6913
7306
  nextUrl: new URL(page, window.origin),
6914
7307
  nextParams: match.params,
6915
7308
  defaultShouldRevalidate: true
@@ -7033,14 +7426,14 @@ function groupRoutesByParentId(manifest) {
7033
7426
  return routes;
7034
7427
  }
7035
7428
  function getRouteComponents(route, routeModule, isSpaMode) {
7036
- let Component3 = getRouteModuleComponent(routeModule);
7429
+ let Component4 = getRouteModuleComponent(routeModule);
7037
7430
  let HydrateFallback = routeModule.HydrateFallback && (!isSpaMode || route.id === "root") ? routeModule.HydrateFallback : route.id === "root" ? RemixRootDefaultHydrateFallback : void 0;
7038
7431
  let ErrorBoundary = routeModule.ErrorBoundary ? routeModule.ErrorBoundary : route.id === "root" ? () => /* @__PURE__ */ React5.createElement(RemixRootDefaultErrorBoundary, { error: useRouteError() }) : void 0;
7039
7432
  if (route.id === "root" && routeModule.Layout) {
7040
7433
  return {
7041
- ...Component3 ? {
7042
- element: /* @__PURE__ */ React5.createElement(routeModule.Layout, null, /* @__PURE__ */ React5.createElement(Component3, null))
7043
- } : { Component: Component3 },
7434
+ ...Component4 ? {
7435
+ element: /* @__PURE__ */ React5.createElement(routeModule.Layout, null, /* @__PURE__ */ React5.createElement(Component4, null))
7436
+ } : { Component: Component4 },
7044
7437
  ...ErrorBoundary ? {
7045
7438
  errorElement: /* @__PURE__ */ React5.createElement(routeModule.Layout, null, /* @__PURE__ */ React5.createElement(ErrorBoundary, null))
7046
7439
  } : { ErrorBoundary },
@@ -7049,7 +7442,7 @@ function getRouteComponents(route, routeModule, isSpaMode) {
7049
7442
  } : { HydrateFallback }
7050
7443
  };
7051
7444
  }
7052
- return { Component: Component3, ErrorBoundary, HydrateFallback };
7445
+ return { Component: Component4, ErrorBoundary, HydrateFallback };
7053
7446
  }
7054
7447
  function createServerRoutes(manifest, routeModules, future, isSpaMode, parentId = "", routesByParentId = groupRoutesByParentId(manifest), spaModeLazyPromise = Promise.resolve({ Component: () => null })) {
7055
7448
  return (routesByParentId[parentId] || []).map((route) => {
@@ -7181,11 +7574,11 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
7181
7574
  )
7182
7575
  });
7183
7576
  let hasInitialData = initialState && initialState.loaderData && route.id in initialState.loaderData;
7184
- let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess', _90 => _90.loaderData, 'optionalAccess', _91 => _91[route.id]]) : void 0;
7577
+ let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess', _94 => _94.loaderData, 'optionalAccess', _95 => _95[route.id]]) : void 0;
7185
7578
  let hasInitialError = initialState && initialState.errors && route.id in initialState.errors;
7186
- let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess', _92 => _92.errors, 'optionalAccess', _93 => _93[route.id]]) : void 0;
7187
- let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access', _94 => _94.clientLoader, 'optionalAccess', _95 => _95.hydrate]) === true || !route.hasLoader);
7188
- dataRoute.loader = async ({ request, params, context }, singleFetch) => {
7579
+ let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess', _96 => _96.errors, 'optionalAccess', _97 => _97[route.id]]) : void 0;
7580
+ let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access', _98 => _98.clientLoader, 'optionalAccess', _99 => _99.hydrate]) === true || !route.hasLoader);
7581
+ dataRoute.loader = async ({ request, params, context, unstable_pattern }, singleFetch) => {
7189
7582
  try {
7190
7583
  let result = await prefetchStylesAndCallHandler(async () => {
7191
7584
  invariant2(
@@ -7199,6 +7592,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
7199
7592
  request,
7200
7593
  params,
7201
7594
  context,
7595
+ unstable_pattern,
7202
7596
  async serverLoader() {
7203
7597
  preventInvalidServerHandlerCall("loader", route);
7204
7598
  if (isHydrationRequest) {
@@ -7224,7 +7618,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
7224
7618
  route.hasLoader,
7225
7619
  isSpaMode
7226
7620
  );
7227
- dataRoute.action = ({ request, params, context }, singleFetch) => {
7621
+ dataRoute.action = ({ request, params, context, unstable_pattern }, singleFetch) => {
7228
7622
  return prefetchStylesAndCallHandler(async () => {
7229
7623
  invariant2(
7230
7624
  routeModule,
@@ -7240,6 +7634,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
7240
7634
  request,
7241
7635
  params,
7242
7636
  context,
7637
+ unstable_pattern,
7243
7638
  async serverAction() {
7244
7639
  preventInvalidServerHandlerCall("action", route);
7245
7640
  return fetchServerAction(singleFetch);
@@ -7478,7 +7873,7 @@ function getPatchRoutesOnNavigationFunction(manifest, routeModules, ssr, routeDi
7478
7873
  function useFogOFWarDiscovery(router, manifest, routeModules, ssr, routeDiscovery, isSpaMode) {
7479
7874
  React6.useEffect(() => {
7480
7875
  if (!isFogOfWarEnabled(routeDiscovery, ssr) || // @ts-expect-error - TS doesn't know about this yet
7481
- _optionalChain([window, 'access', _96 => _96.navigator, 'optionalAccess', _97 => _97.connection, 'optionalAccess', _98 => _98.saveData]) === true) {
7876
+ _optionalChain([window, 'access', _100 => _100.navigator, 'optionalAccess', _101 => _101.connection, 'optionalAccess', _102 => _102.saveData]) === true) {
7482
7877
  return;
7483
7878
  }
7484
7879
  function registerElement(el) {
@@ -7587,7 +7982,7 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
7587
7982
  }
7588
7983
  serverPatches = await res.json();
7589
7984
  } catch (e) {
7590
- if (_optionalChain([signal, 'optionalAccess', _99 => _99.aborted])) return;
7985
+ if (_optionalChain([signal, 'optionalAccess', _103 => _103.aborted])) return;
7591
7986
  throw e;
7592
7987
  }
7593
7988
  let knownRoutes = new Set(Object.keys(manifest.routes));
@@ -7828,7 +8223,7 @@ function PrefetchPageLinksImpl({
7828
8223
  if (!manifestRoute || !manifestRoute.hasLoader) {
7829
8224
  return;
7830
8225
  }
7831
- if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access', _100 => _100[m.route.id], 'optionalAccess', _101 => _101.shouldRevalidate])) {
8226
+ if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access', _104 => _104[m.route.id], 'optionalAccess', _105 => _105.shouldRevalidate])) {
7832
8227
  foundOptOutRoute = true;
7833
8228
  } else if (manifestRoute.hasClientLoader) {
7834
8229
  foundOptOutRoute = true;
@@ -7902,7 +8297,7 @@ function Meta() {
7902
8297
  error
7903
8298
  };
7904
8299
  matches[i] = match;
7905
- if (_optionalChain([routeModule, 'optionalAccess', _102 => _102.meta])) {
8300
+ if (_optionalChain([routeModule, 'optionalAccess', _106 => _106.meta])) {
7906
8301
  routeMeta = typeof routeModule.meta === "function" ? routeModule.meta({
7907
8302
  data: data2,
7908
8303
  loaderData: data2,
@@ -8001,7 +8396,7 @@ function Scripts(scriptProps) {
8001
8396
  }
8002
8397
  let streamScript = "window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());";
8003
8398
  let contextScript = staticContext ? `window.__reactRouterContext = ${serverHandoffString};${streamScript}` : " ";
8004
- let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access', _103 => _103.hmr, 'optionalAccess', _104 => _104.runtime]) ? `import ${JSON.stringify(manifest.hmr.runtime)};` : ""}${!enableFogOfWar ? `import ${JSON.stringify(manifest.url)}` : ""};
8399
+ let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access', _107 => _107.hmr, 'optionalAccess', _108 => _108.runtime]) ? `import ${JSON.stringify(manifest.hmr.runtime)};` : ""}${!enableFogOfWar ? `import ${JSON.stringify(manifest.url)}` : ""};
8005
8400
  ${matches.map((match, routeIndex) => {
8006
8401
  let routeVarName = `route${routeIndex}`;
8007
8402
  let manifestEntry = manifest.routes[match.route.id];
@@ -8231,7 +8626,7 @@ function BoundaryShell({
8231
8626
  children
8232
8627
  }) {
8233
8628
  let { routeModules } = useFrameworkContext();
8234
- if (_optionalChain([routeModules, 'access', _105 => _105.root, 'optionalAccess', _106 => _106.Layout]) && !isOutsideRemixApp) {
8629
+ if (_optionalChain([routeModules, 'access', _109 => _109.root, 'optionalAccess', _110 => _110.Layout]) && !isOutsideRemixApp) {
8235
8630
  return children;
8236
8631
  }
8237
8632
  return /* @__PURE__ */ React8.createElement("html", { lang: "en" }, /* @__PURE__ */ React8.createElement("head", null, /* @__PURE__ */ React8.createElement("meta", { charSet: "utf-8" }), /* @__PURE__ */ React8.createElement(
@@ -8243,6 +8638,787 @@ function BoundaryShell({
8243
8638
  ), /* @__PURE__ */ React8.createElement("title", null, title)), /* @__PURE__ */ React8.createElement("body", null, /* @__PURE__ */ React8.createElement("main", { style: { fontFamily: "system-ui, sans-serif", padding: "2rem" } }, children, renderScripts ? /* @__PURE__ */ React8.createElement(Scripts, null) : null)));
8244
8639
  }
8245
8640
 
8641
+ // lib/components.tsx
8642
+
8643
+ function mapRouteProperties(route) {
8644
+ let updates = {
8645
+ // Note: this check also occurs in createRoutesFromChildren so update
8646
+ // there if you change this -- please and thank you!
8647
+ hasErrorBoundary: route.hasErrorBoundary || route.ErrorBoundary != null || route.errorElement != null
8648
+ };
8649
+ if (route.Component) {
8650
+ if (ENABLE_DEV_WARNINGS) {
8651
+ if (route.element) {
8652
+ warning(
8653
+ false,
8654
+ "You should not include both `Component` and `element` on your route - `Component` will be used."
8655
+ );
8656
+ }
8657
+ }
8658
+ Object.assign(updates, {
8659
+ element: React9.createElement(route.Component),
8660
+ Component: void 0
8661
+ });
8662
+ }
8663
+ if (route.HydrateFallback) {
8664
+ if (ENABLE_DEV_WARNINGS) {
8665
+ if (route.hydrateFallbackElement) {
8666
+ warning(
8667
+ false,
8668
+ "You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."
8669
+ );
8670
+ }
8671
+ }
8672
+ Object.assign(updates, {
8673
+ hydrateFallbackElement: React9.createElement(route.HydrateFallback),
8674
+ HydrateFallback: void 0
8675
+ });
8676
+ }
8677
+ if (route.ErrorBoundary) {
8678
+ if (ENABLE_DEV_WARNINGS) {
8679
+ if (route.errorElement) {
8680
+ warning(
8681
+ false,
8682
+ "You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."
8683
+ );
8684
+ }
8685
+ }
8686
+ Object.assign(updates, {
8687
+ errorElement: React9.createElement(route.ErrorBoundary),
8688
+ ErrorBoundary: void 0
8689
+ });
8690
+ }
8691
+ return updates;
8692
+ }
8693
+ var hydrationRouteProperties = [
8694
+ "HydrateFallback",
8695
+ "hydrateFallbackElement"
8696
+ ];
8697
+ function createMemoryRouter(routes, opts) {
8698
+ return createRouter({
8699
+ basename: _optionalChain([opts, 'optionalAccess', _111 => _111.basename]),
8700
+ getContext: _optionalChain([opts, 'optionalAccess', _112 => _112.getContext]),
8701
+ future: _optionalChain([opts, 'optionalAccess', _113 => _113.future]),
8702
+ history: createMemoryHistory({
8703
+ initialEntries: _optionalChain([opts, 'optionalAccess', _114 => _114.initialEntries]),
8704
+ initialIndex: _optionalChain([opts, 'optionalAccess', _115 => _115.initialIndex])
8705
+ }),
8706
+ hydrationData: _optionalChain([opts, 'optionalAccess', _116 => _116.hydrationData]),
8707
+ routes,
8708
+ hydrationRouteProperties,
8709
+ mapRouteProperties,
8710
+ dataStrategy: _optionalChain([opts, 'optionalAccess', _117 => _117.dataStrategy]),
8711
+ patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _118 => _118.patchRoutesOnNavigation]),
8712
+ unstable_instrumentations: _optionalChain([opts, 'optionalAccess', _119 => _119.unstable_instrumentations])
8713
+ }).initialize();
8714
+ }
8715
+ var Deferred2 = class {
8716
+ constructor() {
8717
+ this.status = "pending";
8718
+ this.promise = new Promise((resolve, reject) => {
8719
+ this.resolve = (value) => {
8720
+ if (this.status === "pending") {
8721
+ this.status = "resolved";
8722
+ resolve(value);
8723
+ }
8724
+ };
8725
+ this.reject = (reason) => {
8726
+ if (this.status === "pending") {
8727
+ this.status = "rejected";
8728
+ reject(reason);
8729
+ }
8730
+ };
8731
+ });
8732
+ }
8733
+ };
8734
+ function shallowDiff(a, b) {
8735
+ if (a === b) {
8736
+ return false;
8737
+ }
8738
+ let aKeys = Object.keys(a);
8739
+ let bKeys = Object.keys(b);
8740
+ if (aKeys.length !== bKeys.length) {
8741
+ return true;
8742
+ }
8743
+ for (let key of aKeys) {
8744
+ if (a[key] !== b[key]) {
8745
+ return true;
8746
+ }
8747
+ }
8748
+ return false;
8749
+ }
8750
+ function UNSTABLE_TransitionEnabledRouterProvider({
8751
+ router,
8752
+ flushSync: reactDomFlushSyncImpl,
8753
+ unstable_onError
8754
+ }) {
8755
+ let fetcherData = React9.useRef(/* @__PURE__ */ new Map());
8756
+ let [revalidating, startRevalidation] = React9.useTransition();
8757
+ let [state, setState] = React9.useState(router.state);
8758
+ router.__setPendingRerender = (promise) => startRevalidation(
8759
+ // @ts-expect-error - need react 19 types for this to be async
8760
+ async () => {
8761
+ const rerender = await promise;
8762
+ startRevalidation(() => {
8763
+ rerender();
8764
+ });
8765
+ }
8766
+ );
8767
+ let navigator = React9.useMemo(() => {
8768
+ return {
8769
+ createHref: router.createHref,
8770
+ encodeLocation: router.encodeLocation,
8771
+ go: (n) => router.navigate(n),
8772
+ push: (to, state2, opts) => router.navigate(to, {
8773
+ state: state2,
8774
+ preventScrollReset: _optionalChain([opts, 'optionalAccess', _120 => _120.preventScrollReset])
8775
+ }),
8776
+ replace: (to, state2, opts) => router.navigate(to, {
8777
+ replace: true,
8778
+ state: state2,
8779
+ preventScrollReset: _optionalChain([opts, 'optionalAccess', _121 => _121.preventScrollReset])
8780
+ })
8781
+ };
8782
+ }, [router]);
8783
+ let basename = router.basename || "/";
8784
+ let dataRouterContext = React9.useMemo(
8785
+ () => ({
8786
+ router,
8787
+ navigator,
8788
+ static: false,
8789
+ basename,
8790
+ unstable_onError
8791
+ }),
8792
+ [router, navigator, basename, unstable_onError]
8793
+ );
8794
+ React9.useLayoutEffect(() => {
8795
+ return router.subscribe(
8796
+ (newState, { deletedFetchers, flushSync, viewTransitionOpts }) => {
8797
+ newState.fetchers.forEach((fetcher, key) => {
8798
+ if (fetcher.data !== void 0) {
8799
+ fetcherData.current.set(key, fetcher.data);
8800
+ }
8801
+ });
8802
+ deletedFetchers.forEach((key) => fetcherData.current.delete(key));
8803
+ const diff = shallowDiff(state, newState);
8804
+ if (!diff) return;
8805
+ if (flushSync) {
8806
+ if (reactDomFlushSyncImpl) {
8807
+ reactDomFlushSyncImpl(() => setState(newState));
8808
+ } else {
8809
+ setState(newState);
8810
+ }
8811
+ } else {
8812
+ React9.startTransition(() => {
8813
+ setState(newState);
8814
+ });
8815
+ }
8816
+ }
8817
+ );
8818
+ }, [router, reactDomFlushSyncImpl, state]);
8819
+ return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React9.createElement(
8820
+ DataRouterStateContext.Provider,
8821
+ {
8822
+ value: {
8823
+ ...state,
8824
+ revalidation: revalidating ? "loading" : state.revalidation
8825
+ }
8826
+ },
8827
+ /* @__PURE__ */ React9.createElement(FetchersContext.Provider, { value: fetcherData.current }, /* @__PURE__ */ React9.createElement(
8828
+ Router,
8829
+ {
8830
+ basename,
8831
+ location: state.location,
8832
+ navigationType: state.historyAction,
8833
+ navigator
8834
+ },
8835
+ /* @__PURE__ */ React9.createElement(
8836
+ MemoizedDataRoutes,
8837
+ {
8838
+ routes: router.routes,
8839
+ future: router.future,
8840
+ state,
8841
+ unstable_onError
8842
+ }
8843
+ )
8844
+ ))
8845
+ )), null);
8846
+ }
8847
+ function RouterProvider({
8848
+ router,
8849
+ flushSync: reactDomFlushSyncImpl,
8850
+ unstable_onError
8851
+ }) {
8852
+ let [state, setStateImpl] = React9.useState(router.state);
8853
+ let [pendingState, setPendingState] = React9.useState();
8854
+ let [vtContext, setVtContext] = React9.useState({
8855
+ isTransitioning: false
8856
+ });
8857
+ let [renderDfd, setRenderDfd] = React9.useState();
8858
+ let [transition, setTransition] = React9.useState();
8859
+ let [interruption, setInterruption] = React9.useState();
8860
+ let fetcherData = React9.useRef(/* @__PURE__ */ new Map());
8861
+ let logErrorsAndSetState = React9.useCallback(
8862
+ (newState) => {
8863
+ setStateImpl((prevState) => {
8864
+ if (newState.errors && unstable_onError) {
8865
+ Object.entries(newState.errors).forEach(([routeId, error]) => {
8866
+ if (_optionalChain([prevState, 'access', _122 => _122.errors, 'optionalAccess', _123 => _123[routeId]]) !== error) {
8867
+ unstable_onError(error, {
8868
+ location: newState.location,
8869
+ params: _nullishCoalesce(_optionalChain([newState, 'access', _124 => _124.matches, 'access', _125 => _125[0], 'optionalAccess', _126 => _126.params]), () => ( {}))
8870
+ });
8871
+ }
8872
+ });
8873
+ }
8874
+ return newState;
8875
+ });
8876
+ },
8877
+ [unstable_onError]
8878
+ );
8879
+ let setState = React9.useCallback(
8880
+ (newState, { deletedFetchers, flushSync, viewTransitionOpts }) => {
8881
+ newState.fetchers.forEach((fetcher, key) => {
8882
+ if (fetcher.data !== void 0) {
8883
+ fetcherData.current.set(key, fetcher.data);
8884
+ }
8885
+ });
8886
+ deletedFetchers.forEach((key) => fetcherData.current.delete(key));
8887
+ warnOnce(
8888
+ flushSync === false || reactDomFlushSyncImpl != null,
8889
+ 'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.'
8890
+ );
8891
+ let isViewTransitionAvailable = router.window != null && router.window.document != null && typeof router.window.document.startViewTransition === "function";
8892
+ warnOnce(
8893
+ viewTransitionOpts == null || isViewTransitionAvailable,
8894
+ "You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."
8895
+ );
8896
+ if (!viewTransitionOpts || !isViewTransitionAvailable) {
8897
+ if (reactDomFlushSyncImpl && flushSync) {
8898
+ reactDomFlushSyncImpl(() => logErrorsAndSetState(newState));
8899
+ } else {
8900
+ React9.startTransition(() => logErrorsAndSetState(newState));
8901
+ }
8902
+ return;
8903
+ }
8904
+ if (reactDomFlushSyncImpl && flushSync) {
8905
+ reactDomFlushSyncImpl(() => {
8906
+ if (transition) {
8907
+ renderDfd && renderDfd.resolve();
8908
+ transition.skipTransition();
8909
+ }
8910
+ setVtContext({
8911
+ isTransitioning: true,
8912
+ flushSync: true,
8913
+ currentLocation: viewTransitionOpts.currentLocation,
8914
+ nextLocation: viewTransitionOpts.nextLocation
8915
+ });
8916
+ });
8917
+ let t = router.window.document.startViewTransition(() => {
8918
+ reactDomFlushSyncImpl(() => logErrorsAndSetState(newState));
8919
+ });
8920
+ t.finished.finally(() => {
8921
+ reactDomFlushSyncImpl(() => {
8922
+ setRenderDfd(void 0);
8923
+ setTransition(void 0);
8924
+ setPendingState(void 0);
8925
+ setVtContext({ isTransitioning: false });
8926
+ });
8927
+ });
8928
+ reactDomFlushSyncImpl(() => setTransition(t));
8929
+ return;
8930
+ }
8931
+ if (transition) {
8932
+ renderDfd && renderDfd.resolve();
8933
+ transition.skipTransition();
8934
+ setInterruption({
8935
+ state: newState,
8936
+ currentLocation: viewTransitionOpts.currentLocation,
8937
+ nextLocation: viewTransitionOpts.nextLocation
8938
+ });
8939
+ } else {
8940
+ setPendingState(newState);
8941
+ setVtContext({
8942
+ isTransitioning: true,
8943
+ flushSync: false,
8944
+ currentLocation: viewTransitionOpts.currentLocation,
8945
+ nextLocation: viewTransitionOpts.nextLocation
8946
+ });
8947
+ }
8948
+ },
8949
+ [
8950
+ router.window,
8951
+ reactDomFlushSyncImpl,
8952
+ transition,
8953
+ renderDfd,
8954
+ logErrorsAndSetState
8955
+ ]
8956
+ );
8957
+ React9.useLayoutEffect(() => router.subscribe(setState), [router, setState]);
8958
+ React9.useEffect(() => {
8959
+ if (vtContext.isTransitioning && !vtContext.flushSync) {
8960
+ setRenderDfd(new Deferred2());
8961
+ }
8962
+ }, [vtContext]);
8963
+ React9.useEffect(() => {
8964
+ if (renderDfd && pendingState && router.window) {
8965
+ let newState = pendingState;
8966
+ let renderPromise = renderDfd.promise;
8967
+ let transition2 = router.window.document.startViewTransition(async () => {
8968
+ React9.startTransition(() => logErrorsAndSetState(newState));
8969
+ await renderPromise;
8970
+ });
8971
+ transition2.finished.finally(() => {
8972
+ setRenderDfd(void 0);
8973
+ setTransition(void 0);
8974
+ setPendingState(void 0);
8975
+ setVtContext({ isTransitioning: false });
8976
+ });
8977
+ setTransition(transition2);
8978
+ }
8979
+ }, [pendingState, renderDfd, router.window, logErrorsAndSetState]);
8980
+ React9.useEffect(() => {
8981
+ if (renderDfd && pendingState && state.location.key === pendingState.location.key) {
8982
+ renderDfd.resolve();
8983
+ }
8984
+ }, [renderDfd, transition, state.location, pendingState]);
8985
+ React9.useEffect(() => {
8986
+ if (!vtContext.isTransitioning && interruption) {
8987
+ setPendingState(interruption.state);
8988
+ setVtContext({
8989
+ isTransitioning: true,
8990
+ flushSync: false,
8991
+ currentLocation: interruption.currentLocation,
8992
+ nextLocation: interruption.nextLocation
8993
+ });
8994
+ setInterruption(void 0);
8995
+ }
8996
+ }, [vtContext.isTransitioning, interruption]);
8997
+ let navigator = React9.useMemo(() => {
8998
+ return {
8999
+ createHref: router.createHref,
9000
+ encodeLocation: router.encodeLocation,
9001
+ go: (n) => router.navigate(n),
9002
+ push: (to, state2, opts) => router.navigate(to, {
9003
+ state: state2,
9004
+ preventScrollReset: _optionalChain([opts, 'optionalAccess', _127 => _127.preventScrollReset])
9005
+ }),
9006
+ replace: (to, state2, opts) => router.navigate(to, {
9007
+ replace: true,
9008
+ state: state2,
9009
+ preventScrollReset: _optionalChain([opts, 'optionalAccess', _128 => _128.preventScrollReset])
9010
+ })
9011
+ };
9012
+ }, [router]);
9013
+ let basename = router.basename || "/";
9014
+ let dataRouterContext = React9.useMemo(
9015
+ () => ({
9016
+ router,
9017
+ navigator,
9018
+ static: false,
9019
+ basename,
9020
+ unstable_onError
9021
+ }),
9022
+ [router, navigator, basename, unstable_onError]
9023
+ );
9024
+ return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React9.createElement(DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React9.createElement(FetchersContext.Provider, { value: fetcherData.current }, /* @__PURE__ */ React9.createElement(ViewTransitionContext.Provider, { value: vtContext }, /* @__PURE__ */ React9.createElement(
9025
+ Router,
9026
+ {
9027
+ basename,
9028
+ location: state.location,
9029
+ navigationType: state.historyAction,
9030
+ navigator
9031
+ },
9032
+ /* @__PURE__ */ React9.createElement(
9033
+ MemoizedDataRoutes,
9034
+ {
9035
+ routes: router.routes,
9036
+ future: router.future,
9037
+ state,
9038
+ unstable_onError
9039
+ }
9040
+ )
9041
+ ))))), null);
9042
+ }
9043
+ var MemoizedDataRoutes = React9.memo(DataRoutes);
9044
+ function DataRoutes({
9045
+ routes,
9046
+ future,
9047
+ state,
9048
+ unstable_onError
9049
+ }) {
9050
+ return useRoutesImpl(routes, void 0, state, unstable_onError, future);
9051
+ }
9052
+ function MemoryRouter({
9053
+ basename,
9054
+ children,
9055
+ initialEntries,
9056
+ initialIndex
9057
+ }) {
9058
+ let historyRef = React9.useRef();
9059
+ if (historyRef.current == null) {
9060
+ historyRef.current = createMemoryHistory({
9061
+ initialEntries,
9062
+ initialIndex,
9063
+ v5Compat: true
9064
+ });
9065
+ }
9066
+ let history = historyRef.current;
9067
+ let [state, setStateImpl] = React9.useState({
9068
+ action: history.action,
9069
+ location: history.location
9070
+ });
9071
+ let setState = React9.useCallback(
9072
+ (newState) => {
9073
+ React9.startTransition(() => setStateImpl(newState));
9074
+ },
9075
+ [setStateImpl]
9076
+ );
9077
+ React9.useLayoutEffect(() => history.listen(setState), [history, setState]);
9078
+ return /* @__PURE__ */ React9.createElement(
9079
+ Router,
9080
+ {
9081
+ basename,
9082
+ children,
9083
+ location: state.location,
9084
+ navigationType: state.action,
9085
+ navigator: history
9086
+ }
9087
+ );
9088
+ }
9089
+ function Navigate({
9090
+ to,
9091
+ replace: replace2,
9092
+ state,
9093
+ relative
9094
+ }) {
9095
+ invariant(
9096
+ useInRouterContext(),
9097
+ // TODO: This error is probably because they somehow have 2 versions of
9098
+ // the router loaded. We can help them understand how to avoid that.
9099
+ `<Navigate> may be used only in the context of a <Router> component.`
9100
+ );
9101
+ let { static: isStatic } = React9.useContext(NavigationContext);
9102
+ warning(
9103
+ !isStatic,
9104
+ `<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`
9105
+ );
9106
+ let { matches } = React9.useContext(RouteContext);
9107
+ let { pathname: locationPathname } = useLocation();
9108
+ let navigate = useNavigate();
9109
+ let path = resolveTo(
9110
+ to,
9111
+ getResolveToMatches(matches),
9112
+ locationPathname,
9113
+ relative === "path"
9114
+ );
9115
+ let jsonPath = JSON.stringify(path);
9116
+ React9.useEffect(() => {
9117
+ navigate(JSON.parse(jsonPath), { replace: replace2, state, relative });
9118
+ }, [navigate, jsonPath, relative, replace2, state]);
9119
+ return null;
9120
+ }
9121
+ function Outlet(props) {
9122
+ return useOutlet(props.context);
9123
+ }
9124
+ function Route(props) {
9125
+ invariant(
9126
+ false,
9127
+ `A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`
9128
+ );
9129
+ }
9130
+ function Router({
9131
+ basename: basenameProp = "/",
9132
+ children = null,
9133
+ location: locationProp,
9134
+ navigationType = "POP" /* Pop */,
9135
+ navigator,
9136
+ static: staticProp = false
9137
+ }) {
9138
+ invariant(
9139
+ !useInRouterContext(),
9140
+ `You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`
9141
+ );
9142
+ let basename = basenameProp.replace(/^\/*/, "/");
9143
+ let navigationContext = React9.useMemo(
9144
+ () => ({
9145
+ basename,
9146
+ navigator,
9147
+ static: staticProp,
9148
+ future: {}
9149
+ }),
9150
+ [basename, navigator, staticProp]
9151
+ );
9152
+ if (typeof locationProp === "string") {
9153
+ locationProp = parsePath(locationProp);
9154
+ }
9155
+ let {
9156
+ pathname = "/",
9157
+ search = "",
9158
+ hash = "",
9159
+ state = null,
9160
+ key = "default"
9161
+ } = locationProp;
9162
+ let locationContext = React9.useMemo(() => {
9163
+ let trailingPathname = stripBasename(pathname, basename);
9164
+ if (trailingPathname == null) {
9165
+ return null;
9166
+ }
9167
+ return {
9168
+ location: {
9169
+ pathname: trailingPathname,
9170
+ search,
9171
+ hash,
9172
+ state,
9173
+ key
9174
+ },
9175
+ navigationType
9176
+ };
9177
+ }, [basename, pathname, search, hash, state, key, navigationType]);
9178
+ warning(
9179
+ locationContext != null,
9180
+ `<Router basename="${basename}"> is not able to match the URL "${pathname}${search}${hash}" because it does not start with the basename, so the <Router> won't render anything.`
9181
+ );
9182
+ if (locationContext == null) {
9183
+ return null;
9184
+ }
9185
+ return /* @__PURE__ */ React9.createElement(NavigationContext.Provider, { value: navigationContext }, /* @__PURE__ */ React9.createElement(LocationContext.Provider, { children, value: locationContext }));
9186
+ }
9187
+ function Routes({
9188
+ children,
9189
+ location
9190
+ }) {
9191
+ return useRoutes(createRoutesFromChildren(children), location);
9192
+ }
9193
+ function Await({
9194
+ children,
9195
+ errorElement,
9196
+ resolve
9197
+ }) {
9198
+ let dataRouterContext = React9.useContext(DataRouterContext);
9199
+ let dataRouterStateContext = React9.useContext(DataRouterStateContext);
9200
+ let onError = React9.useCallback(
9201
+ (error, errorInfo) => {
9202
+ if (dataRouterContext && dataRouterContext.unstable_onError && dataRouterStateContext) {
9203
+ dataRouterContext.unstable_onError(error, {
9204
+ location: dataRouterStateContext.location,
9205
+ params: _optionalChain([dataRouterStateContext, 'access', _129 => _129.matches, 'optionalAccess', _130 => _130[0], 'optionalAccess', _131 => _131.params]) || {},
9206
+ errorInfo
9207
+ });
9208
+ }
9209
+ },
9210
+ [dataRouterContext, dataRouterStateContext]
9211
+ );
9212
+ return /* @__PURE__ */ React9.createElement(
9213
+ AwaitErrorBoundary,
9214
+ {
9215
+ resolve,
9216
+ errorElement,
9217
+ onError
9218
+ },
9219
+ /* @__PURE__ */ React9.createElement(ResolveAwait, null, children)
9220
+ );
9221
+ }
9222
+ var AwaitErrorBoundary = class extends React9.Component {
9223
+ constructor(props) {
9224
+ super(props);
9225
+ this.state = { error: null };
9226
+ }
9227
+ static getDerivedStateFromError(error) {
9228
+ return { error };
9229
+ }
9230
+ componentDidCatch(error, errorInfo) {
9231
+ if (this.props.onError) {
9232
+ this.props.onError(error, errorInfo);
9233
+ } else {
9234
+ console.error(
9235
+ "<Await> caught the following error during render",
9236
+ error,
9237
+ errorInfo
9238
+ );
9239
+ }
9240
+ }
9241
+ render() {
9242
+ let { children, errorElement, resolve } = this.props;
9243
+ let promise = null;
9244
+ let status = 0 /* pending */;
9245
+ if (!(resolve instanceof Promise)) {
9246
+ status = 1 /* success */;
9247
+ promise = Promise.resolve();
9248
+ Object.defineProperty(promise, "_tracked", { get: () => true });
9249
+ Object.defineProperty(promise, "_data", { get: () => resolve });
9250
+ } else if (this.state.error) {
9251
+ status = 2 /* error */;
9252
+ let renderError = this.state.error;
9253
+ promise = Promise.reject().catch(() => {
9254
+ });
9255
+ Object.defineProperty(promise, "_tracked", { get: () => true });
9256
+ Object.defineProperty(promise, "_error", { get: () => renderError });
9257
+ } else if (resolve._tracked) {
9258
+ promise = resolve;
9259
+ status = "_error" in promise ? 2 /* error */ : "_data" in promise ? 1 /* success */ : 0 /* pending */;
9260
+ } else {
9261
+ status = 0 /* pending */;
9262
+ Object.defineProperty(resolve, "_tracked", { get: () => true });
9263
+ promise = resolve.then(
9264
+ (data2) => Object.defineProperty(resolve, "_data", { get: () => data2 }),
9265
+ (error) => {
9266
+ _optionalChain([this, 'access', _132 => _132.props, 'access', _133 => _133.onError, 'optionalCall', _134 => _134(error)]);
9267
+ Object.defineProperty(resolve, "_error", { get: () => error });
9268
+ }
9269
+ );
9270
+ }
9271
+ if (status === 2 /* error */ && !errorElement) {
9272
+ throw promise._error;
9273
+ }
9274
+ if (status === 2 /* error */) {
9275
+ return /* @__PURE__ */ React9.createElement(AwaitContext.Provider, { value: promise, children: errorElement });
9276
+ }
9277
+ if (status === 1 /* success */) {
9278
+ return /* @__PURE__ */ React9.createElement(AwaitContext.Provider, { value: promise, children });
9279
+ }
9280
+ throw promise;
9281
+ }
9282
+ };
9283
+ function ResolveAwait({
9284
+ children
9285
+ }) {
9286
+ let data2 = useAsyncValue();
9287
+ let toRender = typeof children === "function" ? children(data2) : children;
9288
+ return /* @__PURE__ */ React9.createElement(React9.Fragment, null, toRender);
9289
+ }
9290
+ function createRoutesFromChildren(children, parentPath = []) {
9291
+ let routes = [];
9292
+ React9.Children.forEach(children, (element, index) => {
9293
+ if (!React9.isValidElement(element)) {
9294
+ return;
9295
+ }
9296
+ let treePath = [...parentPath, index];
9297
+ if (element.type === React9.Fragment) {
9298
+ routes.push.apply(
9299
+ routes,
9300
+ createRoutesFromChildren(element.props.children, treePath)
9301
+ );
9302
+ return;
9303
+ }
9304
+ invariant(
9305
+ element.type === Route,
9306
+ `[${typeof element.type === "string" ? element.type : element.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`
9307
+ );
9308
+ invariant(
9309
+ !element.props.index || !element.props.children,
9310
+ "An index route cannot have child routes."
9311
+ );
9312
+ let route = {
9313
+ id: element.props.id || treePath.join("-"),
9314
+ caseSensitive: element.props.caseSensitive,
9315
+ element: element.props.element,
9316
+ Component: element.props.Component,
9317
+ index: element.props.index,
9318
+ path: element.props.path,
9319
+ middleware: element.props.middleware,
9320
+ loader: element.props.loader,
9321
+ action: element.props.action,
9322
+ hydrateFallbackElement: element.props.hydrateFallbackElement,
9323
+ HydrateFallback: element.props.HydrateFallback,
9324
+ errorElement: element.props.errorElement,
9325
+ ErrorBoundary: element.props.ErrorBoundary,
9326
+ hasErrorBoundary: element.props.hasErrorBoundary === true || element.props.ErrorBoundary != null || element.props.errorElement != null,
9327
+ shouldRevalidate: element.props.shouldRevalidate,
9328
+ handle: element.props.handle,
9329
+ lazy: element.props.lazy
9330
+ };
9331
+ if (element.props.children) {
9332
+ route.children = createRoutesFromChildren(
9333
+ element.props.children,
9334
+ treePath
9335
+ );
9336
+ }
9337
+ routes.push(route);
9338
+ });
9339
+ return routes;
9340
+ }
9341
+ var createRoutesFromElements = createRoutesFromChildren;
9342
+ function renderMatches(matches) {
9343
+ return _renderMatches(matches);
9344
+ }
9345
+ function useRouteComponentProps() {
9346
+ return {
9347
+ params: useParams(),
9348
+ loaderData: useLoaderData(),
9349
+ actionData: useActionData(),
9350
+ matches: useMatches()
9351
+ };
9352
+ }
9353
+ function WithComponentProps({
9354
+ children
9355
+ }) {
9356
+ const props = useRouteComponentProps();
9357
+ return React9.cloneElement(children, props);
9358
+ }
9359
+ function withComponentProps(Component4) {
9360
+ return function WithComponentProps2() {
9361
+ const props = useRouteComponentProps();
9362
+ return React9.createElement(Component4, props);
9363
+ };
9364
+ }
9365
+ function useHydrateFallbackProps() {
9366
+ return {
9367
+ params: useParams(),
9368
+ loaderData: useLoaderData(),
9369
+ actionData: useActionData()
9370
+ };
9371
+ }
9372
+ function WithHydrateFallbackProps({
9373
+ children
9374
+ }) {
9375
+ const props = useHydrateFallbackProps();
9376
+ return React9.cloneElement(children, props);
9377
+ }
9378
+ function withHydrateFallbackProps(HydrateFallback) {
9379
+ return function WithHydrateFallbackProps2() {
9380
+ const props = useHydrateFallbackProps();
9381
+ return React9.createElement(HydrateFallback, props);
9382
+ };
9383
+ }
9384
+ function useErrorBoundaryProps() {
9385
+ return {
9386
+ params: useParams(),
9387
+ loaderData: useLoaderData(),
9388
+ actionData: useActionData(),
9389
+ error: useRouteError()
9390
+ };
9391
+ }
9392
+ function WithErrorBoundaryProps({
9393
+ children
9394
+ }) {
9395
+ const props = useErrorBoundaryProps();
9396
+ return React9.cloneElement(children, props);
9397
+ }
9398
+ function withErrorBoundaryProps(ErrorBoundary) {
9399
+ return function WithErrorBoundaryProps2() {
9400
+ const props = useErrorBoundaryProps();
9401
+ return React9.createElement(ErrorBoundary, props);
9402
+ };
9403
+ }
9404
+
9405
+
9406
+
9407
+
9408
+
9409
+
9410
+
9411
+
9412
+
9413
+
9414
+
9415
+
9416
+
9417
+
9418
+
9419
+
9420
+
9421
+
8246
9422
 
8247
9423
 
8248
9424
 
@@ -8347,4 +9523,4 @@ function BoundaryShell({
8347
9523
 
8348
9524
 
8349
9525
 
8350
- exports.Action = Action; exports.createMemoryHistory = createMemoryHistory; exports.createBrowserHistory = createBrowserHistory; exports.createHashHistory = createHashHistory; exports.invariant = invariant; exports.warning = warning; exports.createPath = createPath; exports.parsePath = parsePath; exports.createContext = createContext; exports.RouterContextProvider = RouterContextProvider; exports.convertRoutesToDataRoutes = convertRoutesToDataRoutes; exports.matchRoutes = matchRoutes; exports.generatePath = generatePath; exports.matchPath = matchPath; exports.stripBasename = stripBasename; exports.resolvePath = resolvePath; exports.getResolveToMatches = getResolveToMatches; exports.resolveTo = resolveTo; exports.joinPaths = joinPaths; exports.data = data; exports.redirect = redirect; exports.redirectDocument = redirectDocument; exports.replace = replace; exports.ErrorResponseImpl = ErrorResponseImpl; exports.isRouteErrorResponse = isRouteErrorResponse; exports.escapeHtml = escapeHtml; exports.encode = encode; exports.IDLE_NAVIGATION = IDLE_NAVIGATION; exports.IDLE_FETCHER = IDLE_FETCHER; exports.IDLE_BLOCKER = IDLE_BLOCKER; exports.createRouter = createRouter; exports.createStaticHandler = createStaticHandler; exports.getStaticContextFromError = getStaticContextFromError; exports.isDataWithResponseInit = isDataWithResponseInit; exports.isResponse = isResponse; exports.isRedirectStatusCode = isRedirectStatusCode; exports.isRedirectResponse = isRedirectResponse; exports.isMutationMethod = isMutationMethod; exports.createRequestInit = createRequestInit; exports.SingleFetchRedirectSymbol = SingleFetchRedirectSymbol; exports.SINGLE_FETCH_REDIRECT_STATUS = SINGLE_FETCH_REDIRECT_STATUS; exports.NO_BODY_STATUS_CODES = NO_BODY_STATUS_CODES; exports.StreamTransfer = StreamTransfer; exports.getTurboStreamSingleFetchDataStrategy = getTurboStreamSingleFetchDataStrategy; exports.getSingleFetchDataStrategyImpl = getSingleFetchDataStrategyImpl; exports.stripIndexParam = stripIndexParam; exports.singleFetchUrl = singleFetchUrl; exports.decodeViaTurboStream = decodeViaTurboStream; exports.DataRouterContext = DataRouterContext; exports.DataRouterStateContext = DataRouterStateContext; exports.RSCRouterContext = RSCRouterContext; exports.ViewTransitionContext = ViewTransitionContext; exports.FetchersContext = FetchersContext; exports.AwaitContext = AwaitContext; exports.AwaitContextProvider = AwaitContextProvider; exports.NavigationContext = NavigationContext; exports.LocationContext = LocationContext; exports.RouteContext = RouteContext; exports.ENABLE_DEV_WARNINGS = ENABLE_DEV_WARNINGS; exports.warnOnce = warnOnce; exports.useHref = useHref; exports.useInRouterContext = useInRouterContext; exports.useLocation = useLocation; exports.useNavigationType = useNavigationType; exports.useMatch = useMatch; exports.useNavigate = useNavigate; exports.useOutletContext = useOutletContext; exports.useOutlet = useOutlet; exports.useParams = useParams; exports.useResolvedPath = useResolvedPath; exports.useRoutes = useRoutes; exports.useRoutesImpl = useRoutesImpl; exports._renderMatches = _renderMatches; exports.useRouteId = useRouteId; exports.useNavigation = useNavigation; exports.useRevalidator = useRevalidator; exports.useMatches = useMatches; exports.useLoaderData = useLoaderData; exports.useRouteLoaderData = useRouteLoaderData; exports.useActionData = useActionData; exports.useRouteError = useRouteError; exports.useAsyncValue = useAsyncValue; exports.useAsyncError = useAsyncError; exports.useBlocker = useBlocker; exports.useRoute = useRoute; exports.RemixErrorBoundary = RemixErrorBoundary; exports.createServerRoutes = createServerRoutes; exports.createClientRoutesWithHMRRevalidationOptOut = createClientRoutesWithHMRRevalidationOptOut; exports.noActionDefinedError = noActionDefinedError; exports.createClientRoutes = createClientRoutes; exports.shouldHydrateRouteLoader = shouldHydrateRouteLoader; exports.getPatchRoutesOnNavigationFunction = getPatchRoutesOnNavigationFunction; exports.useFogOFWarDiscovery = useFogOFWarDiscovery; exports.getManifestPath = getManifestPath; exports.FrameworkContext = FrameworkContext; exports.usePrefetchBehavior = usePrefetchBehavior; exports.CRITICAL_CSS_DATA_ATTRIBUTE = CRITICAL_CSS_DATA_ATTRIBUTE; exports.Links = Links; exports.PrefetchPageLinks = PrefetchPageLinks; exports.Meta = Meta; exports.setIsHydrated = setIsHydrated; exports.Scripts = Scripts; exports.mergeRefs = mergeRefs;
9526
+ exports.Action = Action; exports.createBrowserHistory = createBrowserHistory; exports.createHashHistory = createHashHistory; exports.invariant = invariant; exports.warning = warning; exports.createPath = createPath; exports.parsePath = parsePath; exports.createContext = createContext; exports.RouterContextProvider = RouterContextProvider; exports.convertRoutesToDataRoutes = convertRoutesToDataRoutes; exports.matchRoutes = matchRoutes; exports.generatePath = generatePath; exports.matchPath = matchPath; exports.stripBasename = stripBasename; exports.resolvePath = resolvePath; exports.joinPaths = joinPaths; exports.data = data; exports.redirect = redirect; exports.redirectDocument = redirectDocument; exports.replace = replace; exports.ErrorResponseImpl = ErrorResponseImpl; exports.isRouteErrorResponse = isRouteErrorResponse; exports.escapeHtml = escapeHtml; exports.encode = encode; exports.instrumentHandler = instrumentHandler; exports.IDLE_NAVIGATION = IDLE_NAVIGATION; exports.IDLE_FETCHER = IDLE_FETCHER; exports.IDLE_BLOCKER = IDLE_BLOCKER; exports.createRouter = createRouter; exports.createStaticHandler = createStaticHandler; exports.getStaticContextFromError = getStaticContextFromError; exports.isDataWithResponseInit = isDataWithResponseInit; exports.isResponse = isResponse; exports.isRedirectStatusCode = isRedirectStatusCode; exports.isRedirectResponse = isRedirectResponse; exports.isMutationMethod = isMutationMethod; exports.createRequestInit = createRequestInit; exports.SingleFetchRedirectSymbol = SingleFetchRedirectSymbol; exports.SINGLE_FETCH_REDIRECT_STATUS = SINGLE_FETCH_REDIRECT_STATUS; exports.NO_BODY_STATUS_CODES = NO_BODY_STATUS_CODES; exports.StreamTransfer = StreamTransfer; exports.getTurboStreamSingleFetchDataStrategy = getTurboStreamSingleFetchDataStrategy; exports.getSingleFetchDataStrategyImpl = getSingleFetchDataStrategyImpl; exports.stripIndexParam = stripIndexParam; exports.singleFetchUrl = singleFetchUrl; exports.decodeViaTurboStream = decodeViaTurboStream; exports.DataRouterContext = DataRouterContext; exports.DataRouterStateContext = DataRouterStateContext; exports.RSCRouterContext = RSCRouterContext; exports.ViewTransitionContext = ViewTransitionContext; exports.FetchersContext = FetchersContext; exports.AwaitContextProvider = AwaitContextProvider; exports.NavigationContext = NavigationContext; exports.LocationContext = LocationContext; exports.RouteContext = RouteContext; exports.ENABLE_DEV_WARNINGS = ENABLE_DEV_WARNINGS; exports.warnOnce = warnOnce; exports.useHref = useHref; exports.useInRouterContext = useInRouterContext; exports.useLocation = useLocation; exports.useNavigationType = useNavigationType; exports.useMatch = useMatch; exports.useNavigate = useNavigate; exports.useOutletContext = useOutletContext; exports.useOutlet = useOutlet; exports.useParams = useParams; exports.useResolvedPath = useResolvedPath; exports.useRoutes = useRoutes; exports.useRoutesImpl = useRoutesImpl; exports.useRouteId = useRouteId; exports.useNavigation = useNavigation; exports.useRevalidator = useRevalidator; exports.useMatches = useMatches; exports.useLoaderData = useLoaderData; exports.useRouteLoaderData = useRouteLoaderData; exports.useActionData = useActionData; exports.useRouteError = useRouteError; exports.useAsyncValue = useAsyncValue; exports.useAsyncError = useAsyncError; exports.useBlocker = useBlocker; exports.useRoute = useRoute; exports.RemixErrorBoundary = RemixErrorBoundary; exports.createServerRoutes = createServerRoutes; exports.createClientRoutesWithHMRRevalidationOptOut = createClientRoutesWithHMRRevalidationOptOut; exports.noActionDefinedError = noActionDefinedError; exports.createClientRoutes = createClientRoutes; exports.shouldHydrateRouteLoader = shouldHydrateRouteLoader; exports.getPatchRoutesOnNavigationFunction = getPatchRoutesOnNavigationFunction; exports.useFogOFWarDiscovery = useFogOFWarDiscovery; exports.getManifestPath = getManifestPath; exports.FrameworkContext = FrameworkContext; exports.usePrefetchBehavior = usePrefetchBehavior; exports.CRITICAL_CSS_DATA_ATTRIBUTE = CRITICAL_CSS_DATA_ATTRIBUTE; exports.Links = Links; exports.PrefetchPageLinks = PrefetchPageLinks; exports.Meta = Meta; exports.setIsHydrated = setIsHydrated; exports.Scripts = Scripts; exports.mergeRefs = mergeRefs; exports.mapRouteProperties = mapRouteProperties; exports.hydrationRouteProperties = hydrationRouteProperties; exports.createMemoryRouter = createMemoryRouter; exports.UNSTABLE_TransitionEnabledRouterProvider = UNSTABLE_TransitionEnabledRouterProvider; exports.RouterProvider = RouterProvider; exports.MemoryRouter = MemoryRouter; exports.Navigate = Navigate; exports.Outlet = Outlet; exports.Route = Route; exports.Router = Router; exports.Routes = Routes; exports.Await = Await; exports.createRoutesFromChildren = createRoutesFromChildren; exports.createRoutesFromElements = createRoutesFromElements; exports.renderMatches = renderMatches; exports.WithComponentProps = WithComponentProps; exports.withComponentProps = withComponentProps; exports.WithHydrateFallbackProps = WithHydrateFallbackProps; exports.withHydrateFallbackProps = withHydrateFallbackProps; exports.WithErrorBoundaryProps = WithErrorBoundaryProps; exports.withErrorBoundaryProps = withErrorBoundaryProps;