@omnitron-dev/prism 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/blocks/index.js +49 -9
  2. package/dist/blocks/index.js.map +1 -1
  3. package/dist/chunk-2FYNRDXR.js +192 -0
  4. package/dist/chunk-2FYNRDXR.js.map +1 -0
  5. package/dist/chunk-A2Z7NVGL.js +11496 -0
  6. package/dist/chunk-A2Z7NVGL.js.map +1 -0
  7. package/dist/{chunk-E3XANPTO.js → chunk-IZOIO7PA.js} +5 -191
  8. package/dist/{chunk-E3XANPTO.js.map → chunk-IZOIO7PA.js.map} +1 -1
  9. package/dist/{chunk-LAEY5USO.js → chunk-KTCWPGON.js} +55 -25
  10. package/dist/chunk-KTCWPGON.js.map +1 -0
  11. package/dist/{chunk-DXXZ3ITR.js → chunk-MEFT6XPH.js} +721 -455
  12. package/dist/chunk-MEFT6XPH.js.map +1 -0
  13. package/dist/{chunk-BTIT7WYH.js → chunk-SNKGGHBT.js} +2 -2
  14. package/dist/chunk-SNKGGHBT.js.map +1 -0
  15. package/dist/{chunk-UR6X3W5I.js → chunk-VAAIHNWQ.js} +3 -3
  16. package/dist/{chunk-UR6X3W5I.js.map → chunk-VAAIHNWQ.js.map} +1 -1
  17. package/dist/{chunk-GYDT5EKX.js → chunk-XQXGE2PW.js} +760 -472
  18. package/dist/chunk-XQXGE2PW.js.map +1 -0
  19. package/dist/{chunk-WC2WM2JD.js → chunk-XXP3ZGU6.js} +18 -8
  20. package/dist/chunk-XXP3ZGU6.js.map +1 -0
  21. package/dist/chunk-YJMAQL3S.js +1887 -0
  22. package/dist/chunk-YJMAQL3S.js.map +1 -0
  23. package/dist/cli/index.js +4 -4
  24. package/dist/cli/index.js.map +1 -1
  25. package/dist/components/editor/index.d.ts +107 -0
  26. package/dist/components/editor/index.js +4 -0
  27. package/dist/components/editor/index.js.map +1 -0
  28. package/dist/components/index.css +131 -0
  29. package/dist/components/index.css.map +1 -0
  30. package/dist/components/index.d.ts +7073 -0
  31. package/dist/components/index.js +13 -0
  32. package/dist/components/index.js.map +1 -0
  33. package/dist/components-BCGZ-Rwt.d.ts +142 -0
  34. package/dist/{config-BA6IeTq9.d.ts → config-Pct0n_Kq.d.ts} +2 -2
  35. package/dist/core/index.d.ts +20 -5
  36. package/dist/core/index.js +2 -2
  37. package/dist/hooks/index.d.ts +3 -2
  38. package/dist/hooks/index.js +4 -3
  39. package/dist/{index-odhPSv9I.d.ts → index-nmJ8Muwg.d.ts} +4 -127
  40. package/dist/index.d.ts +265 -6615
  41. package/dist/index.js +119 -11662
  42. package/dist/index.js.map +1 -1
  43. package/dist/layouts/index.js +1 -1
  44. package/dist/popover-Dmw7SJLR.d.ts +127 -0
  45. package/dist/registry/index.d.ts +2 -2
  46. package/dist/{registry-BrDNftd5.d.ts → registry-DQcIzW2s.d.ts} +2 -2
  47. package/dist/{settings-plpR26Xk.d.ts → settings-CAC0qFjS.d.ts} +2 -2
  48. package/dist/state/index.d.ts +2 -2
  49. package/dist/state/index.js +1 -1
  50. package/dist/text-transform-D6MzzF7V.d.ts +165 -0
  51. package/dist/theme/index.d.ts +2 -2
  52. package/dist/theme/index.js +2 -2
  53. package/dist/{theme-CrXLfP1c.d.ts → theme-B4Q3Bg5o.d.ts} +1 -1
  54. package/dist/types/index.d.ts +6 -145
  55. package/package.json +46 -40
  56. package/dist/chunk-BTIT7WYH.js.map +0 -1
  57. package/dist/chunk-DXXZ3ITR.js.map +0 -1
  58. package/dist/chunk-GYDT5EKX.js.map +0 -1
  59. package/dist/chunk-LAEY5USO.js.map +0 -1
  60. package/dist/chunk-WC2WM2JD.js.map +0 -1
@@ -41,7 +41,7 @@ function createMemoryHistory(options = {}) {
41
41
  entry,
42
42
  typeof entry === "string" ? null : entry.state,
43
43
  index2 === 0 ? "default" : void 0,
44
- typeof entry === "string" ? void 0 : entry.unstable_mask
44
+ typeof entry === "string" ? void 0 : entry.mask
45
45
  )
46
46
  );
47
47
  let index = clampIndex(
@@ -55,13 +55,13 @@ function createMemoryHistory(options = {}) {
55
55
  function getCurrentLocation() {
56
56
  return entries[index];
57
57
  }
58
- function createMemoryLocation(to, state = null, key, unstable_mask) {
58
+ function createMemoryLocation(to, state = null, key, mask) {
59
59
  let location2 = createLocation(
60
60
  entries ? getCurrentLocation().pathname : "/",
61
61
  to,
62
62
  state,
63
63
  key,
64
- unstable_mask
64
+ mask
65
65
  );
66
66
  warning(
67
67
  location2.pathname.charAt(0) === "/",
@@ -223,14 +223,14 @@ function getHistoryState(location2, index) {
223
223
  usr: location2.state,
224
224
  key: location2.key,
225
225
  idx: index,
226
- masked: location2.unstable_mask ? {
226
+ masked: location2.mask ? {
227
227
  pathname: location2.pathname,
228
228
  search: location2.search,
229
229
  hash: location2.hash
230
230
  } : void 0
231
231
  };
232
232
  }
233
- function createLocation(current, to, state = null, key, unstable_mask) {
233
+ function createLocation(current, to, state = null, key, mask) {
234
234
  let location2 = {
235
235
  pathname: typeof current === "string" ? current : current.pathname,
236
236
  search: "",
@@ -242,7 +242,7 @@ function createLocation(current, to, state = null, key, unstable_mask) {
242
242
  // But that's a pretty big refactor to the current test suite so going to
243
243
  // keep as is for the time being and just let any incoming keys take precedence
244
244
  key: to && to.key || key || createKey(),
245
- unstable_mask
245
+ mask
246
246
  };
247
247
  return location2;
248
248
  }
@@ -305,7 +305,7 @@ function getUrlBasedHistory(getLocation, createHref2, validateLocation, options
305
305
  if (validateLocation) validateLocation(location2, to);
306
306
  index = getIndex() + 1;
307
307
  let historyState = getHistoryState(location2, index);
308
- let url = history.createHref(location2.unstable_mask || location2);
308
+ let url = history.createHref(location2.mask || location2);
309
309
  try {
310
310
  globalHistory.pushState(historyState, "", url);
311
311
  } catch (error) {
@@ -324,7 +324,7 @@ function getUrlBasedHistory(getLocation, createHref2, validateLocation, options
324
324
  if (validateLocation) validateLocation(location2, to);
325
325
  index = getIndex();
326
326
  let historyState = getHistoryState(location2, index);
327
- let url = history.createHref(location2.unstable_mask || location2);
327
+ let url = history.createHref(location2.mask || location2);
328
328
  globalHistory.replaceState(historyState, "", url);
329
329
  if (v5Compat && listener) {
330
330
  listener({ action, location: history.location, delta: 0 });
@@ -459,17 +459,16 @@ function mergeRouteUpdates(route, updates) {
459
459
  function matchRoutes(routes, locationArg, basename = "/") {
460
460
  return matchRoutesImpl(routes, locationArg, basename, false);
461
461
  }
462
- function matchRoutesImpl(routes, locationArg, basename, allowPartial) {
462
+ function matchRoutesImpl(routes, locationArg, basename, allowPartial, precomputedBranches) {
463
463
  let location2 = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
464
464
  let pathname = stripBasename(location2.pathname || "/", basename);
465
465
  if (pathname == null) {
466
466
  return null;
467
467
  }
468
- let branches = flattenRoutes(routes);
469
- rankRouteBranches(branches);
468
+ let branches = precomputedBranches ?? flattenAndRankRoutes(routes);
470
469
  let matches = null;
470
+ let decoded = decodePath(pathname);
471
471
  for (let i = 0; matches == null && i < branches.length; ++i) {
472
- let decoded = decodePath(pathname);
473
472
  matches = matchRouteBranch(
474
473
  branches[i],
475
474
  decoded,
@@ -489,6 +488,11 @@ function convertRouteMatchToUiMatch(match, loaderData) {
489
488
  handle: route.handle
490
489
  };
491
490
  }
491
+ function flattenAndRankRoutes(routes) {
492
+ let branches = flattenRoutes(routes);
493
+ rankRouteBranches(branches);
494
+ return branches;
495
+ }
492
496
  function flattenRoutes(routes, branches = [], parentsMeta = [], parentPath = "", _hasParentOptionalSegments = false) {
493
497
  let flattenRoute = (route, index, hasParentOptionalSegments = _hasParentOptionalSegments, relativePath) => {
494
498
  let meta = {
@@ -660,8 +664,7 @@ function generatePath(originalPath, params = {}) {
660
664
  const segments = path.split(/\/+/).map((segment, index, array) => {
661
665
  const isLastSegment = index === array.length - 1;
662
666
  if (isLastSegment && segment === "*") {
663
- const star = "*";
664
- return stringify2(params[star]);
667
+ return stringify2(params["*"]);
665
668
  }
666
669
  const keyMatch = segment.match(/^:([\w-]+)(\??)(.*)/);
667
670
  if (keyMatch) {
@@ -779,7 +782,7 @@ function resolvePath(to, fromPathname = "/") {
779
782
  } = typeof to === "string" ? parsePath(to) : to;
780
783
  let pathname;
781
784
  if (toPathname) {
782
- toPathname = toPathname.replace(/\/\/+/g, "/");
785
+ toPathname = removeDoubleSlashes(toPathname);
783
786
  if (toPathname.startsWith("/")) {
784
787
  pathname = resolvePathname(toPathname.substring(1), "/");
785
788
  } else {
@@ -795,7 +798,7 @@ function resolvePath(to, fromPathname = "/") {
795
798
  };
796
799
  }
797
800
  function resolvePathname(relativePath, fromPathname) {
798
- let segments = fromPathname.replace(/\/+$/, "").split("/");
801
+ let segments = removeTrailingSlash(fromPathname).split("/");
799
802
  let relativeSegments = relativePath.split("/");
800
803
  relativeSegments.forEach((segment) => {
801
804
  if (segment === "..") {
@@ -876,7 +879,8 @@ function isRouteErrorResponse(error) {
876
879
  return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error;
877
880
  }
878
881
  function getRoutePattern(matches) {
879
- return matches.map((m) => m.route.path).filter(Boolean).join("/").replace(/\/\/*/g, "/") || "/";
882
+ let parts = matches.map((m) => m.route.path).filter(Boolean);
883
+ return joinPaths(parts) || "/";
880
884
  }
881
885
  function parseToInfo(_to, basename) {
882
886
  let to = _to;
@@ -1135,11 +1139,11 @@ async function recurseRight(impls, info, handler, index) {
1135
1139
  };
1136
1140
  }
1137
1141
  function getHandlerInfo(args) {
1138
- let { request, context, params, unstable_pattern } = args;
1142
+ let { request, context, params, pattern } = args;
1139
1143
  return {
1140
1144
  request: getReadonlyRequest(request),
1141
1145
  params: { ...params },
1142
- unstable_pattern,
1146
+ pattern,
1143
1147
  context: getReadonlyContext(context)
1144
1148
  };
1145
1149
  }
@@ -1189,8 +1193,8 @@ function createRouter(init) {
1189
1193
  let hydrationRouteProperties2 = init.hydrationRouteProperties || [];
1190
1194
  let _mapRouteProperties = init.mapRouteProperties || defaultMapRouteProperties;
1191
1195
  let mapRouteProperties2 = _mapRouteProperties;
1192
- if (init.unstable_instrumentations) {
1193
- let instrumentations = init.unstable_instrumentations;
1196
+ if (init.instrumentations) {
1197
+ let instrumentations = init.instrumentations;
1194
1198
  mapRouteProperties2 = (route) => {
1195
1199
  return {
1196
1200
  ..._mapRouteProperties(route),
@@ -1202,29 +1206,36 @@ function createRouter(init) {
1202
1206
  };
1203
1207
  }
1204
1208
  let manifest = {};
1205
- let dataRoutes = convertRoutesToDataRoutes(
1206
- init.routes,
1207
- mapRouteProperties2,
1208
- void 0,
1209
- manifest
1209
+ let dataRoutes = new DataRoutes(
1210
+ convertRoutesToDataRoutes(
1211
+ init.routes,
1212
+ mapRouteProperties2,
1213
+ void 0,
1214
+ manifest
1215
+ )
1210
1216
  );
1211
- let inFlightDataRoutes;
1212
1217
  let basename = init.basename || "/";
1213
1218
  if (!basename.startsWith("/")) {
1214
1219
  basename = `/${basename}`;
1215
1220
  }
1216
1221
  let dataStrategyImpl = init.dataStrategy || defaultDataStrategyWithMiddleware;
1217
1222
  let future = {
1218
- unstable_passThroughRequests: false,
1219
1223
  ...init.future
1220
1224
  };
1221
1225
  let unlistenHistory = null;
1222
1226
  let subscribers = /* @__PURE__ */ new Set();
1227
+ let bufferedInitialStateUpdate = null;
1223
1228
  let savedScrollPositions2 = null;
1224
1229
  let getScrollRestorationKey2 = null;
1225
1230
  let getScrollPosition = null;
1226
1231
  let initialScrollRestored = init.hydrationData != null;
1227
- let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);
1232
+ let initialMatches = matchRoutesImpl(
1233
+ dataRoutes.activeRoutes,
1234
+ init.history.location,
1235
+ basename,
1236
+ false,
1237
+ dataRoutes.branches
1238
+ );
1228
1239
  let initialMatchesIsFOW = false;
1229
1240
  let initialErrors = null;
1230
1241
  let initialized;
@@ -1233,7 +1244,7 @@ function createRouter(init) {
1233
1244
  let error = getInternalRouterError(404, {
1234
1245
  pathname: init.history.location.pathname
1235
1246
  });
1236
- let { matches, route } = getShortCircuitMatches(dataRoutes);
1247
+ let { matches, route } = getShortCircuitMatches(dataRoutes.activeRoutes);
1237
1248
  initialized = true;
1238
1249
  renderFallback = !initialized;
1239
1250
  initialMatches = matches;
@@ -1242,7 +1253,7 @@ function createRouter(init) {
1242
1253
  if (initialMatches && !init.hydrationData) {
1243
1254
  let fogOfWar = checkFogOfWar(
1244
1255
  initialMatches,
1245
- dataRoutes,
1256
+ dataRoutes.activeRoutes,
1246
1257
  init.history.location.pathname
1247
1258
  );
1248
1259
  if (fogOfWar.active) {
@@ -1255,7 +1266,7 @@ function createRouter(init) {
1255
1266
  initialMatches = [];
1256
1267
  let fogOfWar = checkFogOfWar(
1257
1268
  null,
1258
- dataRoutes,
1269
+ dataRoutes.activeRoutes,
1259
1270
  init.history.location.pathname
1260
1271
  );
1261
1272
  if (fogOfWar.active && fogOfWar.matches) {
@@ -1395,11 +1406,21 @@ function createRouter(init) {
1395
1406
  }
1396
1407
  subscribers.clear();
1397
1408
  pendingNavigationController && pendingNavigationController.abort();
1398
- state.fetchers.forEach((_, key) => deleteFetcher(key));
1409
+ state.fetchers.forEach((_, key) => deleteFetcher(state.fetchers, key));
1399
1410
  state.blockers.forEach((_, key) => deleteBlocker(key));
1400
1411
  }
1401
1412
  function subscribe(fn) {
1402
1413
  subscribers.add(fn);
1414
+ if (bufferedInitialStateUpdate) {
1415
+ let { newErrors } = bufferedInitialStateUpdate;
1416
+ bufferedInitialStateUpdate = null;
1417
+ fn(state, {
1418
+ deletedFetchers: [],
1419
+ newErrors,
1420
+ viewTransitionOpts: void 0,
1421
+ flushSync: false
1422
+ });
1423
+ }
1403
1424
  return () => subscribers.delete(fn);
1404
1425
  }
1405
1426
  function updateState(newState, opts = {}) {
@@ -1436,6 +1457,9 @@ function createRouter(init) {
1436
1457
  unmountedFetchers.push(key);
1437
1458
  }
1438
1459
  });
1460
+ if (subscribers.size === 0) {
1461
+ bufferedInitialStateUpdate = { newErrors: newState.errors ?? null };
1462
+ }
1439
1463
  [...subscribers].forEach(
1440
1464
  (subscriber) => subscriber(state, {
1441
1465
  deletedFetchers: unmountedFetchers,
@@ -1444,7 +1468,7 @@ function createRouter(init) {
1444
1468
  flushSync: opts.flushSync === true
1445
1469
  })
1446
1470
  );
1447
- unmountedFetchers.forEach((key) => deleteFetcher(key));
1471
+ unmountedFetchers.forEach((key) => deleteFetcher(state.fetchers, key));
1448
1472
  mountedFetchers.forEach((key) => state.fetchers.delete(key));
1449
1473
  }
1450
1474
  function completeNavigation(location2, newState, { flushSync: flushSync3 } = {}) {
@@ -1474,10 +1498,7 @@ function createRouter(init) {
1474
1498
  }
1475
1499
  let restoreScrollPosition = isUninterruptedRevalidation ? false : getSavedScrollPosition(location2, newState.matches || state.matches);
1476
1500
  let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && location2.state?._isRedirect !== true;
1477
- if (inFlightDataRoutes) {
1478
- dataRoutes = inFlightDataRoutes;
1479
- inFlightDataRoutes = void 0;
1480
- }
1501
+ dataRoutes.commitHmrRoutes();
1481
1502
  if (isUninterruptedRevalidation) ; else if (pendingAction === "POP") ; else if (pendingAction === "PUSH") {
1482
1503
  init.history.push(location2, location2.state);
1483
1504
  } else if (pendingAction === "REPLACE") {
@@ -1566,10 +1587,10 @@ function createRouter(init) {
1566
1587
  opts
1567
1588
  );
1568
1589
  let maskPath;
1569
- if (opts?.unstable_mask) {
1570
- let partialPath = typeof opts.unstable_mask === "string" ? parsePath(opts.unstable_mask) : {
1571
- ...state.location.unstable_mask,
1572
- ...opts.unstable_mask
1590
+ if (opts?.mask) {
1591
+ let partialPath = typeof opts.mask === "string" ? parsePath(opts.mask) : {
1592
+ ...state.location.mask,
1593
+ ...opts.mask
1573
1594
  };
1574
1595
  maskPath = {
1575
1596
  pathname: "",
@@ -1634,7 +1655,7 @@ function createRouter(init) {
1634
1655
  replace: opts && opts.replace,
1635
1656
  enableViewTransition: opts && opts.viewTransition,
1636
1657
  flushSync: flushSync3,
1637
- callSiteDefaultShouldRevalidate: opts && opts.unstable_defaultShouldRevalidate
1658
+ callSiteDefaultShouldRevalidate: opts && opts.defaultShouldRevalidate
1638
1659
  });
1639
1660
  }
1640
1661
  function revalidate() {
@@ -1672,12 +1693,17 @@ function createRouter(init) {
1672
1693
  saveScrollPosition(state.location, state.matches);
1673
1694
  pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;
1674
1695
  pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true;
1675
- let routesToUse = inFlightDataRoutes || dataRoutes;
1676
- let loadingNavigation = opts && opts.overrideNavigation;
1696
+ let routesToUse = dataRoutes.activeRoutes;
1677
1697
  let matches = opts?.initialHydration && state.matches && state.matches.length > 0 && !initialMatchesIsFOW ? (
1678
1698
  // `matchRoutes()` has already been called if we're in here via `router.initialize()`
1679
1699
  state.matches
1680
- ) : matchRoutes(routesToUse, location2, basename);
1700
+ ) : matchRoutesImpl(
1701
+ routesToUse,
1702
+ location2,
1703
+ basename,
1704
+ false,
1705
+ dataRoutes.branches
1706
+ );
1681
1707
  let flushSync3 = (opts && opts.flushSync) === true;
1682
1708
  if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location2) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1683
1709
  completeNavigation(location2, { matches }, { flushSync: flushSync3 });
@@ -1704,6 +1730,11 @@ function createRouter(init) {
1704
1730
  );
1705
1731
  return;
1706
1732
  }
1733
+ let loadingNavigation = opts && opts.overrideNavigation ? {
1734
+ ...opts.overrideNavigation,
1735
+ matches,
1736
+ historyAction
1737
+ } : void 0;
1707
1738
  pendingNavigationController = new AbortController();
1708
1739
  let request = createClientSideRequest(
1709
1740
  init.history,
@@ -1724,6 +1755,7 @@ function createRouter(init) {
1724
1755
  location2,
1725
1756
  opts.submission,
1726
1757
  matches,
1758
+ historyAction,
1727
1759
  scopedContext,
1728
1760
  fogOfWar.active,
1729
1761
  opts && opts.initialHydration === true,
@@ -1748,7 +1780,12 @@ function createRouter(init) {
1748
1780
  }
1749
1781
  matches = actionResult.matches || matches;
1750
1782
  pendingActionResult = actionResult.pendingActionResult;
1751
- loadingNavigation = getLoadingNavigation(location2, opts.submission);
1783
+ loadingNavigation = getLoadingNavigation(
1784
+ location2,
1785
+ matches,
1786
+ historyAction,
1787
+ opts.submission
1788
+ );
1752
1789
  flushSync3 = false;
1753
1790
  fogOfWar.active = false;
1754
1791
  request = createClientSideRequest(
@@ -1761,11 +1798,13 @@ function createRouter(init) {
1761
1798
  shortCircuited,
1762
1799
  matches: updatedMatches,
1763
1800
  loaderData,
1764
- errors
1801
+ errors,
1802
+ workingFetchers
1765
1803
  } = await handleLoaders(
1766
1804
  request,
1767
1805
  location2,
1768
1806
  matches,
1807
+ historyAction,
1769
1808
  scopedContext,
1770
1809
  fogOfWar.active,
1771
1810
  loadingNavigation,
@@ -1785,12 +1824,18 @@ function createRouter(init) {
1785
1824
  matches: updatedMatches || matches,
1786
1825
  ...getActionDataForCommit(pendingActionResult),
1787
1826
  loaderData,
1788
- errors
1827
+ errors,
1828
+ ...workingFetchers ? { fetchers: workingFetchers } : {}
1789
1829
  });
1790
1830
  }
1791
- async function handleAction(request, location2, submission, matches, scopedContext, isFogOfWar, initialHydration, opts = {}) {
1831
+ async function handleAction(request, location2, submission, matches, historyAction, scopedContext, isFogOfWar, initialHydration, opts = {}) {
1792
1832
  interruptActiveLoads();
1793
- let navigation = getSubmittingNavigation(location2, submission);
1833
+ let navigation = getSubmittingNavigation(
1834
+ location2,
1835
+ matches,
1836
+ historyAction,
1837
+ submission
1838
+ );
1794
1839
  updateState({ navigation }, { flushSync: opts.flushSync === true });
1795
1840
  if (isFogOfWar) {
1796
1841
  let discoverResult = await discoverRoutes(
@@ -1802,7 +1847,9 @@ function createRouter(init) {
1802
1847
  return { shortCircuited: true };
1803
1848
  } else if (discoverResult.type === "error") {
1804
1849
  if (discoverResult.partialMatches.length === 0) {
1805
- let { matches: matches2, route } = getShortCircuitMatches(dataRoutes);
1850
+ let { matches: matches2, route } = getShortCircuitMatches(
1851
+ dataRoutes.activeRoutes
1852
+ );
1806
1853
  return {
1807
1854
  matches: matches2,
1808
1855
  pendingActionResult: [
@@ -1923,8 +1970,8 @@ function createRouter(init) {
1923
1970
  pendingActionResult: [actionMatch.route.id, result]
1924
1971
  };
1925
1972
  }
1926
- async function handleLoaders(request, location2, matches, scopedContext, isFogOfWar, overrideNavigation, submission, fetcherSubmission, replace2, initialHydration, flushSync3, pendingActionResult, callSiteDefaultShouldRevalidate) {
1927
- let loadingNavigation = overrideNavigation || getLoadingNavigation(location2, submission);
1973
+ async function handleLoaders(request, location2, matches, historyAction, scopedContext, isFogOfWar, overrideNavigation, submission, fetcherSubmission, replace2, initialHydration, flushSync3, pendingActionResult, callSiteDefaultShouldRevalidate) {
1974
+ let loadingNavigation = overrideNavigation || getLoadingNavigation(location2, matches, historyAction, submission);
1928
1975
  let activeSubmission = submission || fetcherSubmission || getSubmissionFromNavigation(loadingNavigation);
1929
1976
  let shouldUpdateNavigationState = !isUninterruptedRevalidation && !initialHydration;
1930
1977
  if (isFogOfWar) {
@@ -1949,7 +1996,9 @@ function createRouter(init) {
1949
1996
  return { shortCircuited: true };
1950
1997
  } else if (discoverResult.type === "error") {
1951
1998
  if (discoverResult.partialMatches.length === 0) {
1952
- let { matches: matches2, route } = getShortCircuitMatches(dataRoutes);
1999
+ let { matches: matches2, route } = getShortCircuitMatches(
2000
+ dataRoutes.activeRoutes
2001
+ );
1953
2002
  return {
1954
2003
  matches: matches2,
1955
2004
  loaderData: {},
@@ -1981,7 +2030,7 @@ function createRouter(init) {
1981
2030
  matches = discoverResult.matches;
1982
2031
  }
1983
2032
  }
1984
- let routesToUse = inFlightDataRoutes || dataRoutes;
2033
+ let routesToUse = dataRoutes.activeRoutes;
1985
2034
  let { dsMatches, revalidatingFetchers } = getMatchesToLoad(
1986
2035
  request,
1987
2036
  scopedContext,
@@ -2002,6 +2051,7 @@ function createRouter(init) {
2002
2051
  routesToUse,
2003
2052
  basename,
2004
2053
  init.patchRoutesOnNavigation != null,
2054
+ dataRoutes.branches,
2005
2055
  pendingActionResult,
2006
2056
  callSiteDefaultShouldRevalidate
2007
2057
  );
@@ -2009,7 +2059,8 @@ function createRouter(init) {
2009
2059
  if (!init.dataStrategy && !dsMatches.some((m) => m.shouldLoad) && !dsMatches.some(
2010
2060
  (m) => m.route.middleware && m.route.middleware.length > 0
2011
2061
  ) && revalidatingFetchers.length === 0) {
2012
- let updatedFetchers2 = markFetchRedirectsDone();
2062
+ let workingFetchers2 = new Map(state.fetchers);
2063
+ let didUpdateFetcherRedirects2 = markFetchRedirectsDone(workingFetchers2);
2013
2064
  completeNavigation(
2014
2065
  location2,
2015
2066
  {
@@ -2018,7 +2069,7 @@ function createRouter(init) {
2018
2069
  // Commit pending error if we're short circuiting
2019
2070
  errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? { [pendingActionResult[0]]: pendingActionResult[1].error } : null,
2020
2071
  ...getActionDataForCommit(pendingActionResult),
2021
- ...updatedFetchers2 ? { fetchers: new Map(state.fetchers) } : {}
2072
+ ...didUpdateFetcherRedirects2 ? { fetchers: workingFetchers2 } : {}
2022
2073
  },
2023
2074
  { flushSync: flushSync3 }
2024
2075
  );
@@ -2083,25 +2134,30 @@ function createRouter(init) {
2083
2134
  });
2084
2135
  return { shortCircuited: true };
2085
2136
  }
2137
+ let workingFetchers = new Map(state.fetchers);
2086
2138
  let { loaderData, errors } = processLoaderData(
2087
2139
  state,
2088
2140
  matches,
2089
2141
  loaderResults,
2090
2142
  pendingActionResult,
2091
2143
  revalidatingFetchers,
2092
- fetcherResults
2144
+ fetcherResults,
2145
+ workingFetchers
2093
2146
  );
2094
2147
  if (initialHydration && state.errors) {
2095
2148
  errors = { ...state.errors, ...errors };
2096
2149
  }
2097
- let updatedFetchers = markFetchRedirectsDone();
2098
- let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);
2099
- let shouldUpdateFetchers = updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0;
2150
+ let didUpdateFetcherRedirects = markFetchRedirectsDone(workingFetchers);
2151
+ let didAbortFetchLoads = abortStaleFetchLoads(
2152
+ pendingNavigationLoadId,
2153
+ workingFetchers
2154
+ );
2155
+ let shouldUpdateFetchers = didUpdateFetcherRedirects || didAbortFetchLoads || revalidatingFetchers.length > 0;
2100
2156
  return {
2101
2157
  matches,
2102
2158
  loaderData,
2103
2159
  errors,
2104
- ...shouldUpdateFetchers ? { fetchers: new Map(state.fetchers) } : {}
2160
+ ...shouldUpdateFetchers ? { workingFetchers } : {}
2105
2161
  };
2106
2162
  }
2107
2163
  function getUpdatedActionData(pendingActionResult) {
@@ -2118,20 +2174,21 @@ function createRouter(init) {
2118
2174
  }
2119
2175
  }
2120
2176
  function getUpdatedRevalidatingFetchers(revalidatingFetchers) {
2177
+ let workingFetchers = new Map(state.fetchers);
2121
2178
  revalidatingFetchers.forEach((rf) => {
2122
- let fetcher = state.fetchers.get(rf.key);
2179
+ let fetcher = workingFetchers.get(rf.key);
2123
2180
  let revalidatingFetcher = getLoadingFetcher(
2124
2181
  void 0,
2125
2182
  fetcher ? fetcher.data : void 0
2126
2183
  );
2127
- state.fetchers.set(rf.key, revalidatingFetcher);
2184
+ workingFetchers.set(rf.key, revalidatingFetcher);
2128
2185
  });
2129
- return new Map(state.fetchers);
2186
+ return workingFetchers;
2130
2187
  }
2131
2188
  async function fetch2(key, routeId, href2, opts) {
2132
2189
  abortFetcher(key);
2133
2190
  let flushSync3 = (opts && opts.flushSync) === true;
2134
- let routesToUse = inFlightDataRoutes || dataRoutes;
2191
+ let routesToUse = dataRoutes.activeRoutes;
2135
2192
  let normalizedPath = normalizeTo(
2136
2193
  state.location,
2137
2194
  state.matches,
@@ -2140,7 +2197,13 @@ function createRouter(init) {
2140
2197
  routeId,
2141
2198
  opts?.relative
2142
2199
  );
2143
- let matches = matchRoutes(routesToUse, normalizedPath, basename);
2200
+ let matches = matchRoutesImpl(
2201
+ routesToUse,
2202
+ normalizedPath,
2203
+ basename,
2204
+ false,
2205
+ dataRoutes.branches
2206
+ );
2144
2207
  let fogOfWar = checkFogOfWar(matches, routesToUse, normalizedPath);
2145
2208
  if (fogOfWar.active && fogOfWar.matches) {
2146
2209
  matches = fogOfWar.matches;
@@ -2176,7 +2239,7 @@ function createRouter(init) {
2176
2239
  flushSync3,
2177
2240
  preventScrollReset,
2178
2241
  submission,
2179
- opts && opts.unstable_defaultShouldRevalidate
2242
+ opts && opts.defaultShouldRevalidate
2180
2243
  );
2181
2244
  return;
2182
2245
  }
@@ -2306,13 +2369,17 @@ function createRouter(init) {
2306
2369
  nextLocation,
2307
2370
  abortController.signal
2308
2371
  );
2309
- let routesToUse = inFlightDataRoutes || dataRoutes;
2310
- let matches = state.navigation.state !== "idle" ? matchRoutes(routesToUse, state.navigation.location, basename) : state.matches;
2372
+ let routesToUse = dataRoutes.activeRoutes;
2373
+ let matches = state.navigation.state !== "idle" ? matchRoutesImpl(
2374
+ routesToUse,
2375
+ state.navigation.location,
2376
+ basename,
2377
+ false,
2378
+ dataRoutes.branches
2379
+ ) : state.matches;
2311
2380
  invariant(matches, "Didn't find any matches after fetcher action");
2312
2381
  let loadId = ++incrementingLoadId;
2313
2382
  fetchReloadIds.set(key, loadId);
2314
- let loadFetcher = getLoadingFetcher(submission, actionResult.data);
2315
- state.fetchers.set(key, loadFetcher);
2316
2383
  let { dsMatches, revalidatingFetchers } = getMatchesToLoad(
2317
2384
  revalidationRequest,
2318
2385
  scopedContext,
@@ -2333,23 +2400,27 @@ function createRouter(init) {
2333
2400
  routesToUse,
2334
2401
  basename,
2335
2402
  init.patchRoutesOnNavigation != null,
2403
+ dataRoutes.branches,
2336
2404
  [match.route.id, actionResult],
2337
2405
  callSiteDefaultShouldRevalidate
2338
2406
  );
2407
+ let loadFetcher = getLoadingFetcher(submission, actionResult.data);
2408
+ let workingFetchers = new Map(state.fetchers);
2409
+ workingFetchers.set(key, loadFetcher);
2339
2410
  revalidatingFetchers.filter((rf) => rf.key !== key).forEach((rf) => {
2340
2411
  let staleKey = rf.key;
2341
- let existingFetcher2 = state.fetchers.get(staleKey);
2412
+ let existingFetcher2 = workingFetchers.get(staleKey);
2342
2413
  let revalidatingFetcher = getLoadingFetcher(
2343
2414
  void 0,
2344
2415
  existingFetcher2 ? existingFetcher2.data : void 0
2345
2416
  );
2346
- state.fetchers.set(staleKey, revalidatingFetcher);
2417
+ workingFetchers.set(staleKey, revalidatingFetcher);
2347
2418
  abortFetcher(staleKey);
2348
2419
  if (rf.controller) {
2349
2420
  fetchControllers.set(staleKey, rf.controller);
2350
2421
  }
2351
2422
  });
2352
- updateState({ fetchers: new Map(state.fetchers) });
2423
+ updateState({ fetchers: workingFetchers });
2353
2424
  let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach((rf) => abortFetcher(rf.key));
2354
2425
  abortController.signal.addEventListener(
2355
2426
  "abort",
@@ -2372,12 +2443,16 @@ function createRouter(init) {
2372
2443
  fetchReloadIds.delete(key);
2373
2444
  fetchControllers.delete(key);
2374
2445
  revalidatingFetchers.forEach((r) => fetchControllers.delete(r.key));
2375
- if (state.fetchers.has(key)) {
2376
- let doneFetcher = getDoneFetcher(actionResult.data);
2377
- state.fetchers.set(key, doneFetcher);
2378
- }
2446
+ let fetcherIsMounted = state.fetchers.has(key);
2447
+ let getRedirectStateWithDoneFetcher = (s) => {
2448
+ if (!fetcherIsMounted) return s;
2449
+ let workingFetchers2 = new Map(s.fetchers);
2450
+ workingFetchers2.set(key, getDoneFetcher(actionResult.data));
2451
+ return { ...s, fetchers: workingFetchers2 };
2452
+ };
2379
2453
  let redirect2 = findRedirect(loaderResults);
2380
2454
  if (redirect2) {
2455
+ state = getRedirectStateWithDoneFetcher(state);
2381
2456
  return startRedirectNavigation(
2382
2457
  revalidationRequest,
2383
2458
  redirect2.result,
@@ -2388,6 +2463,7 @@ function createRouter(init) {
2388
2463
  redirect2 = findRedirect(fetcherResults);
2389
2464
  if (redirect2) {
2390
2465
  fetchRedirectIds.add(redirect2.key);
2466
+ state = getRedirectStateWithDoneFetcher(state);
2391
2467
  return startRedirectNavigation(
2392
2468
  revalidationRequest,
2393
2469
  redirect2.result,
@@ -2395,15 +2471,20 @@ function createRouter(init) {
2395
2471
  { preventScrollReset }
2396
2472
  );
2397
2473
  }
2474
+ let finalFetchers = new Map(state.fetchers);
2475
+ if (fetcherIsMounted) {
2476
+ finalFetchers.set(key, getDoneFetcher(actionResult.data));
2477
+ }
2398
2478
  let { loaderData, errors } = processLoaderData(
2399
2479
  state,
2400
2480
  matches,
2401
2481
  loaderResults,
2402
2482
  void 0,
2403
2483
  revalidatingFetchers,
2404
- fetcherResults
2484
+ fetcherResults,
2485
+ finalFetchers
2405
2486
  );
2406
- abortStaleFetchLoads(loadId);
2487
+ abortStaleFetchLoads(loadId, finalFetchers);
2407
2488
  if (state.navigation.state === "loading" && loadId > pendingNavigationLoadId) {
2408
2489
  invariant(pendingAction, "Expected pending action");
2409
2490
  pendingNavigationController && pendingNavigationController.abort();
@@ -2411,7 +2492,7 @@ function createRouter(init) {
2411
2492
  matches,
2412
2493
  loaderData,
2413
2494
  errors,
2414
- fetchers: new Map(state.fetchers)
2495
+ fetchers: finalFetchers
2415
2496
  });
2416
2497
  } else {
2417
2498
  updateState({
@@ -2422,7 +2503,7 @@ function createRouter(init) {
2422
2503
  matches,
2423
2504
  errors
2424
2505
  ),
2425
- fetchers: new Map(state.fetchers)
2506
+ fetchers: finalFetchers
2426
2507
  });
2427
2508
  isRevalidationRequired = false;
2428
2509
  }
@@ -2488,6 +2569,14 @@ function createRouter(init) {
2488
2569
  key
2489
2570
  );
2490
2571
  let result = results[match.route.id];
2572
+ if (!result) {
2573
+ for (let match2 of matches) {
2574
+ if (results[match2.route.id]) {
2575
+ result = results[match2.route.id];
2576
+ break;
2577
+ }
2578
+ }
2579
+ }
2491
2580
  if (fetchControllers.get(key) === abortController) {
2492
2581
  fetchControllers.delete(key);
2493
2582
  }
@@ -2579,6 +2668,8 @@ function createRouter(init) {
2579
2668
  } else {
2580
2669
  let overrideNavigation = getLoadingNavigation(
2581
2670
  redirectLocation,
2671
+ [],
2672
+ redirectNavigationType,
2582
2673
  submission
2583
2674
  );
2584
2675
  await startNavigation(redirectNavigationType, redirectLocation, {
@@ -2702,21 +2793,23 @@ function createRouter(init) {
2702
2793
  });
2703
2794
  }
2704
2795
  function updateFetcherState(key, fetcher, opts = {}) {
2705
- state.fetchers.set(key, fetcher);
2796
+ let workingFetchers = new Map(state.fetchers);
2797
+ workingFetchers.set(key, fetcher);
2706
2798
  updateState(
2707
- { fetchers: new Map(state.fetchers) },
2799
+ { fetchers: workingFetchers },
2708
2800
  { flushSync: (opts && opts.flushSync) === true }
2709
2801
  );
2710
2802
  }
2711
2803
  function setFetcherError(key, routeId, error, opts = {}) {
2712
2804
  let boundaryMatch = findNearestBoundary(state.matches, routeId);
2713
- deleteFetcher(key);
2805
+ let workingFetchers = new Map(state.fetchers);
2806
+ deleteFetcher(workingFetchers, key);
2714
2807
  updateState(
2715
2808
  {
2716
2809
  errors: {
2717
2810
  [boundaryMatch.route.id]: error
2718
2811
  },
2719
- fetchers: new Map(state.fetchers)
2812
+ fetchers: workingFetchers
2720
2813
  },
2721
2814
  { flushSync: (opts && opts.flushSync) === true }
2722
2815
  );
@@ -2732,7 +2825,7 @@ function createRouter(init) {
2732
2825
  abortFetcher(key, opts?.reason);
2733
2826
  updateFetcherState(key, getDoneFetcher(null));
2734
2827
  }
2735
- function deleteFetcher(key) {
2828
+ function deleteFetcher(fetchers, key) {
2736
2829
  let fetcher = state.fetchers.get(key);
2737
2830
  if (fetchControllers.has(key) && !(fetcher && fetcher.state === "loading" && fetchReloadIds.has(key))) {
2738
2831
  abortFetcher(key);
@@ -2742,7 +2835,7 @@ function createRouter(init) {
2742
2835
  fetchRedirectIds.delete(key);
2743
2836
  fetchersQueuedForDeletion.delete(key);
2744
2837
  cancelledFetcherLoads.delete(key);
2745
- state.fetchers.delete(key);
2838
+ fetchers.delete(key);
2746
2839
  }
2747
2840
  function queueFetcherForDeletion(key) {
2748
2841
  let count = (activeFetchers.get(key) || 0) - 1;
@@ -2761,33 +2854,34 @@ function createRouter(init) {
2761
2854
  fetchControllers.delete(key);
2762
2855
  }
2763
2856
  }
2764
- function markFetchersDone(keys) {
2857
+ function markFetchersDone(keys, fetchers) {
2765
2858
  for (let key of keys) {
2766
- let fetcher = getFetcher(key);
2859
+ let fetcher = fetchers.get(key);
2860
+ invariant(fetcher, `Expected fetcher: ${key}`);
2767
2861
  let doneFetcher = getDoneFetcher(fetcher.data);
2768
- state.fetchers.set(key, doneFetcher);
2862
+ fetchers.set(key, doneFetcher);
2769
2863
  }
2770
2864
  }
2771
- function markFetchRedirectsDone() {
2865
+ function markFetchRedirectsDone(fetchers) {
2772
2866
  let doneKeys = [];
2773
- let updatedFetchers = false;
2867
+ let didUpdateFetchers = false;
2774
2868
  for (let key of fetchRedirectIds) {
2775
- let fetcher = state.fetchers.get(key);
2869
+ let fetcher = fetchers.get(key);
2776
2870
  invariant(fetcher, `Expected fetcher: ${key}`);
2777
2871
  if (fetcher.state === "loading") {
2778
2872
  fetchRedirectIds.delete(key);
2779
2873
  doneKeys.push(key);
2780
- updatedFetchers = true;
2874
+ didUpdateFetchers = true;
2781
2875
  }
2782
2876
  }
2783
- markFetchersDone(doneKeys);
2784
- return updatedFetchers;
2877
+ markFetchersDone(doneKeys, fetchers);
2878
+ return didUpdateFetchers;
2785
2879
  }
2786
- function abortStaleFetchLoads(landedId) {
2880
+ function abortStaleFetchLoads(landedId, fetchers) {
2787
2881
  let yeetedKeys = [];
2788
2882
  for (let [key, id] of fetchReloadIds) {
2789
2883
  if (id < landedId) {
2790
- let fetcher = state.fetchers.get(key);
2884
+ let fetcher = fetchers.get(key);
2791
2885
  invariant(fetcher, `Expected fetcher: ${key}`);
2792
2886
  if (fetcher.state === "loading") {
2793
2887
  abortFetcher(key);
@@ -2796,7 +2890,7 @@ function createRouter(init) {
2796
2890
  }
2797
2891
  }
2798
2892
  }
2799
- markFetchersDone(yeetedKeys);
2893
+ markFetchersDone(yeetedKeys, fetchers);
2800
2894
  return yeetedKeys.length > 0;
2801
2895
  }
2802
2896
  function getBlocker(key, fn) {
@@ -2843,7 +2937,7 @@ function createRouter(init) {
2843
2937
  }
2844
2938
  function handleNavigational404(pathname) {
2845
2939
  let error = getInternalRouterError(404, { pathname });
2846
- let routesToUse = inFlightDataRoutes || dataRoutes;
2940
+ let routesToUse = dataRoutes.activeRoutes;
2847
2941
  let { matches, route } = getShortCircuitMatches(routesToUse);
2848
2942
  return { notFoundMatches: matches, route, error };
2849
2943
  }
@@ -2892,12 +2986,14 @@ function createRouter(init) {
2892
2986
  }
2893
2987
  function checkFogOfWar(matches, routesToUse, pathname) {
2894
2988
  if (init.patchRoutesOnNavigation) {
2989
+ let activeBranches = dataRoutes.branches;
2895
2990
  if (!matches) {
2896
2991
  let fogMatches = matchRoutesImpl(
2897
2992
  routesToUse,
2898
2993
  pathname,
2899
2994
  basename,
2900
- true
2995
+ true,
2996
+ activeBranches
2901
2997
  );
2902
2998
  return { active: true, matches: fogMatches || [] };
2903
2999
  } else {
@@ -2906,7 +3002,8 @@ function createRouter(init) {
2906
3002
  routesToUse,
2907
3003
  pathname,
2908
3004
  basename,
2909
- true
3005
+ true,
3006
+ activeBranches
2910
3007
  );
2911
3008
  return { active: true, matches: partialMatches };
2912
3009
  }
@@ -2920,8 +3017,6 @@ function createRouter(init) {
2920
3017
  }
2921
3018
  let partialMatches = matches;
2922
3019
  while (true) {
2923
- let isNonHMR = inFlightDataRoutes == null;
2924
- let routesToUse = inFlightDataRoutes || dataRoutes;
2925
3020
  let localManifest = manifest;
2926
3021
  try {
2927
3022
  await init.patchRoutesOnNavigation({
@@ -2934,7 +3029,7 @@ function createRouter(init) {
2934
3029
  patchRoutesImpl(
2935
3030
  routeId,
2936
3031
  children,
2937
- routesToUse,
3032
+ dataRoutes,
2938
3033
  localManifest,
2939
3034
  mapRouteProperties2,
2940
3035
  false
@@ -2943,25 +3038,29 @@ function createRouter(init) {
2943
3038
  });
2944
3039
  } catch (e) {
2945
3040
  return { type: "error", error: e, partialMatches };
2946
- } finally {
2947
- if (isNonHMR && !signal.aborted) {
2948
- dataRoutes = [...dataRoutes];
2949
- }
2950
3041
  }
2951
3042
  if (signal.aborted) {
2952
3043
  return { type: "aborted" };
2953
3044
  }
2954
- let newMatches = matchRoutes(routesToUse, pathname, basename);
3045
+ let activeBranches = dataRoutes.branches;
3046
+ let newMatches = matchRoutesImpl(
3047
+ dataRoutes.activeRoutes,
3048
+ pathname,
3049
+ basename,
3050
+ false,
3051
+ activeBranches
3052
+ );
2955
3053
  let newPartialMatches = null;
2956
3054
  if (newMatches) {
2957
3055
  if (Object.keys(newMatches[0].params).length === 0) {
2958
3056
  return { type: "success", matches: newMatches };
2959
3057
  } else {
2960
3058
  newPartialMatches = matchRoutesImpl(
2961
- routesToUse,
3059
+ dataRoutes.activeRoutes,
2962
3060
  pathname,
2963
3061
  basename,
2964
- true
3062
+ true,
3063
+ activeBranches
2965
3064
  );
2966
3065
  let matchedDeeper = newPartialMatches && partialMatches.length < newPartialMatches.length && compareMatches(
2967
3066
  partialMatches,
@@ -2974,10 +3073,11 @@ function createRouter(init) {
2974
3073
  }
2975
3074
  if (!newPartialMatches) {
2976
3075
  newPartialMatches = matchRoutesImpl(
2977
- routesToUse,
3076
+ dataRoutes.activeRoutes,
2978
3077
  pathname,
2979
3078
  basename,
2980
- true
3079
+ true,
3080
+ activeBranches
2981
3081
  );
2982
3082
  }
2983
3083
  if (!newPartialMatches || compareMatches(partialMatches, newPartialMatches)) {
@@ -2991,26 +3091,25 @@ function createRouter(init) {
2991
3091
  }
2992
3092
  function _internalSetRoutes(newRoutes) {
2993
3093
  manifest = {};
2994
- inFlightDataRoutes = convertRoutesToDataRoutes(
2995
- newRoutes,
2996
- mapRouteProperties2,
2997
- void 0,
2998
- manifest
3094
+ dataRoutes.setHmrRoutes(
3095
+ convertRoutesToDataRoutes(
3096
+ newRoutes,
3097
+ mapRouteProperties2,
3098
+ void 0,
3099
+ manifest
3100
+ )
2999
3101
  );
3000
3102
  }
3001
3103
  function patchRoutes(routeId, children, unstable_allowElementMutations = false) {
3002
- let isNonHMR = inFlightDataRoutes == null;
3003
- let routesToUse = inFlightDataRoutes || dataRoutes;
3004
3104
  patchRoutesImpl(
3005
3105
  routeId,
3006
3106
  children,
3007
- routesToUse,
3107
+ dataRoutes,
3008
3108
  manifest,
3009
3109
  mapRouteProperties2,
3010
3110
  unstable_allowElementMutations
3011
3111
  );
3012
- if (isNonHMR) {
3013
- dataRoutes = [...dataRoutes];
3112
+ if (!dataRoutes.hasHMRRoutes) {
3014
3113
  updateState({});
3015
3114
  }
3016
3115
  }
@@ -3025,7 +3124,13 @@ function createRouter(init) {
3025
3124
  return state;
3026
3125
  },
3027
3126
  get routes() {
3028
- return dataRoutes;
3127
+ return dataRoutes.stableRoutes;
3128
+ },
3129
+ get branches() {
3130
+ return dataRoutes.branches;
3131
+ },
3132
+ get manifest() {
3133
+ return manifest;
3029
3134
  },
3030
3135
  get window() {
3031
3136
  return routerWindow;
@@ -3055,10 +3160,10 @@ function createRouter(init) {
3055
3160
  updateState(newState);
3056
3161
  }
3057
3162
  };
3058
- if (init.unstable_instrumentations) {
3163
+ if (init.instrumentations) {
3059
3164
  router2 = instrumentClientSideRouter(
3060
3165
  router2,
3061
- init.unstable_instrumentations.map((i) => i.router).filter(Boolean)
3166
+ init.instrumentations.map((i) => i.router).filter(Boolean)
3062
3167
  );
3063
3168
  }
3064
3169
  return router2;
@@ -3073,11 +3178,10 @@ function createStaticHandler(routes, opts) {
3073
3178
  let _mapRouteProperties = opts?.mapRouteProperties || defaultMapRouteProperties;
3074
3179
  let mapRouteProperties2 = _mapRouteProperties;
3075
3180
  ({
3076
- // unused in static handler
3077
3181
  ...opts?.future
3078
3182
  });
3079
- if (opts?.unstable_instrumentations) {
3080
- let instrumentations = opts.unstable_instrumentations;
3183
+ if (opts?.instrumentations) {
3184
+ let instrumentations = opts.instrumentations;
3081
3185
  mapRouteProperties2 = (route) => {
3082
3186
  return {
3083
3187
  ..._mapRouteProperties(route),
@@ -3094,6 +3198,7 @@ function createStaticHandler(routes, opts) {
3094
3198
  void 0,
3095
3199
  manifest
3096
3200
  );
3201
+ let routeBranches = flattenAndRankRoutes(dataRoutes);
3097
3202
  async function query(request, {
3098
3203
  requestContext,
3099
3204
  filterMatchesToLoad,
@@ -3101,12 +3206,23 @@ function createStaticHandler(routes, opts) {
3101
3206
  skipRevalidation,
3102
3207
  dataStrategy,
3103
3208
  generateMiddlewareResponse,
3104
- unstable_normalizePath
3209
+ normalizePath
3105
3210
  } = {}) {
3106
- let normalizePath = unstable_normalizePath || defaultNormalizePath;
3211
+ let normalizePathImpl = normalizePath || defaultNormalizePath;
3107
3212
  let method = request.method;
3108
- let location2 = createLocation("", normalizePath(request), null, "default");
3109
- let matches = matchRoutes(dataRoutes, location2, basename);
3213
+ let location2 = createLocation(
3214
+ "",
3215
+ normalizePathImpl(request),
3216
+ null,
3217
+ "default"
3218
+ );
3219
+ let matches = matchRoutesImpl(
3220
+ dataRoutes,
3221
+ location2,
3222
+ basename,
3223
+ false,
3224
+ routeBranches
3225
+ );
3110
3226
  requestContext = requestContext != null ? requestContext : new RouterContextProvider();
3111
3227
  if (!isValidMethod(method) && method !== "HEAD") {
3112
3228
  let error = getInternalRouterError(405, { method });
@@ -3158,8 +3274,8 @@ function createStaticHandler(routes, opts) {
3158
3274
  let response = await runServerMiddlewarePipeline(
3159
3275
  {
3160
3276
  request,
3161
- unstable_url: createDataFunctionUrl(request, location2),
3162
- unstable_pattern: getRoutePattern(matches),
3277
+ url: createDataFunctionUrl(request, location2),
3278
+ pattern: getRoutePattern(matches),
3163
3279
  matches,
3164
3280
  params: matches[0].params,
3165
3281
  // If we're calling middleware then it must be enabled so we can cast
@@ -3276,12 +3392,23 @@ function createStaticHandler(routes, opts) {
3276
3392
  requestContext,
3277
3393
  dataStrategy,
3278
3394
  generateMiddlewareResponse,
3279
- unstable_normalizePath
3395
+ normalizePath
3280
3396
  } = {}) {
3281
- let normalizePath = unstable_normalizePath || defaultNormalizePath;
3397
+ let normalizePathImpl = normalizePath || defaultNormalizePath;
3282
3398
  let method = request.method;
3283
- let location2 = createLocation("", normalizePath(request), null, "default");
3284
- let matches = matchRoutes(dataRoutes, location2, basename);
3399
+ let location2 = createLocation(
3400
+ "",
3401
+ normalizePathImpl(request),
3402
+ null,
3403
+ "default"
3404
+ );
3405
+ let matches = matchRoutesImpl(
3406
+ dataRoutes,
3407
+ location2,
3408
+ basename,
3409
+ false,
3410
+ routeBranches
3411
+ );
3285
3412
  requestContext = requestContext != null ? requestContext : new RouterContextProvider();
3286
3413
  if (!isValidMethod(method) && method !== "HEAD" && method !== "OPTIONS") {
3287
3414
  throw getInternalRouterError(405, { method });
@@ -3306,8 +3433,8 @@ function createStaticHandler(routes, opts) {
3306
3433
  let response = await runServerMiddlewarePipeline(
3307
3434
  {
3308
3435
  request,
3309
- unstable_url: createDataFunctionUrl(request, location2),
3310
- unstable_pattern: getRoutePattern(matches),
3436
+ url: createDataFunctionUrl(request, location2),
3437
+ pattern: getRoutePattern(matches),
3311
3438
  matches,
3312
3439
  params: matches[0].params,
3313
3440
  // If we're calling middleware then it must be enabled so we can cast
@@ -3693,6 +3820,7 @@ function createStaticHandler(routes, opts) {
3693
3820
  }
3694
3821
  return {
3695
3822
  dataRoutes,
3823
+ _internalRouteBranches: routeBranches,
3696
3824
  query,
3697
3825
  queryRoute
3698
3826
  };
@@ -3878,7 +4006,7 @@ function normalizeNavigateOptions(isFetcher, path, opts) {
3878
4006
  parsedPath.search = `?${searchParams}`;
3879
4007
  return { path: createPath(parsedPath), submission };
3880
4008
  }
3881
- function getMatchesToLoad(request, scopedContext, mapRouteProperties2, manifest, history, state, matches, submission, location2, lazyRoutePropertiesToSkip, initialHydration, isRevalidationRequired, cancelledFetcherLoads, fetchersQueuedForDeletion, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, hasPatchRoutesOnNavigation, pendingActionResult, callSiteDefaultShouldRevalidate) {
4009
+ function getMatchesToLoad(request, scopedContext, mapRouteProperties2, manifest, history, state, matches, submission, location2, lazyRoutePropertiesToSkip, initialHydration, isRevalidationRequired, cancelledFetcherLoads, fetchersQueuedForDeletion, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, hasPatchRoutesOnNavigation, branches, pendingActionResult, callSiteDefaultShouldRevalidate) {
3882
4010
  let actionResult = pendingActionResult ? isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : pendingActionResult[1].data : void 0;
3883
4011
  let currentUrl = history.createURL(state.location);
3884
4012
  let nextUrl = history.createURL(location2);
@@ -3974,7 +4102,13 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties2, manifest,
3974
4102
  }
3975
4103
  let fetcher = state.fetchers.get(key);
3976
4104
  let isMidInitialLoad = fetcher && fetcher.state !== "idle" && fetcher.data === void 0;
3977
- let fetcherMatches = matchRoutes(routesToUse, f.path, basename);
4105
+ let fetcherMatches = matchRoutesImpl(
4106
+ routesToUse,
4107
+ f.path,
4108
+ basename ?? "/",
4109
+ false,
4110
+ branches
4111
+ );
3978
4112
  if (!fetcherMatches) {
3979
4113
  if (hasPatchRoutesOnNavigation && isMidInitialLoad) {
3980
4114
  return;
@@ -4115,7 +4249,7 @@ function shouldRevalidateLoader(loaderMatch, arg) {
4115
4249
  }
4116
4250
  return arg.defaultShouldRevalidate;
4117
4251
  }
4118
- function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties2, allowElementMutations) {
4252
+ function patchRoutesImpl(routeId, children, dataRoutes, manifest, mapRouteProperties2, allowElementMutations) {
4119
4253
  let childrenToPatch;
4120
4254
  if (routeId) {
4121
4255
  let route = manifest[routeId];
@@ -4128,7 +4262,7 @@ function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRoutePrope
4128
4262
  }
4129
4263
  childrenToPatch = route.children;
4130
4264
  } else {
4131
- childrenToPatch = routesToUse;
4265
+ childrenToPatch = dataRoutes.activeRoutes;
4132
4266
  }
4133
4267
  let uniqueChildren = [];
4134
4268
  let existingChildren = [];
@@ -4171,6 +4305,9 @@ function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRoutePrope
4171
4305
  });
4172
4306
  }
4173
4307
  }
4308
+ if (!dataRoutes.hasHMRRoutes) {
4309
+ dataRoutes.setRoutes([...dataRoutes.activeRoutes]);
4310
+ }
4174
4311
  }
4175
4312
  function isSameRoute(newRoute, existingRoute) {
4176
4313
  if ("id" in newRoute && "id" in existingRoute && newRoute.id === existingRoute.id) {
@@ -4454,7 +4591,7 @@ function getDataStrategyMatchLazyPromises(mapRouteProperties2, manifest, request
4454
4591
  handler: lazyRoutePromises.lazyHandlerPromise
4455
4592
  };
4456
4593
  }
4457
- function getDataStrategyMatch(mapRouteProperties2, manifest, request, path, unstable_pattern, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, shouldRevalidateArgs = null, callSiteDefaultShouldRevalidate) {
4594
+ function getDataStrategyMatch(mapRouteProperties2, manifest, request, path, pattern, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, shouldRevalidateArgs = null, callSiteDefaultShouldRevalidate) {
4458
4595
  let isUsingNewApi = false;
4459
4596
  let _lazyPromises = getDataStrategyMatchLazyPromises(
4460
4597
  mapRouteProperties2,
@@ -4495,7 +4632,7 @@ function getDataStrategyMatch(mapRouteProperties2, manifest, request, path, unst
4495
4632
  return callLoaderOrAction({
4496
4633
  request,
4497
4634
  path,
4498
- unstable_pattern,
4635
+ pattern,
4499
4636
  match,
4500
4637
  lazyHandlerPromise: _lazyPromises?.handler,
4501
4638
  lazyRoutePromise: _lazyPromises?.route,
@@ -4545,8 +4682,8 @@ async function callDataStrategyImpl(dataStrategyImpl, request, path, matches, fe
4545
4682
  }
4546
4683
  let dataStrategyArgs = {
4547
4684
  request,
4548
- unstable_url: createDataFunctionUrl(request, path),
4549
- unstable_pattern: getRoutePattern(matches),
4685
+ url: createDataFunctionUrl(request, path),
4686
+ pattern: getRoutePattern(matches),
4550
4687
  params: matches[0].params,
4551
4688
  context: scopedContext,
4552
4689
  matches
@@ -4588,7 +4725,7 @@ async function callDataStrategyImpl(dataStrategyImpl, request, path, matches, fe
4588
4725
  async function callLoaderOrAction({
4589
4726
  request,
4590
4727
  path,
4591
- unstable_pattern,
4728
+ pattern,
4592
4729
  match,
4593
4730
  lazyHandlerPromise,
4594
4731
  lazyRoutePromise,
@@ -4615,8 +4752,8 @@ async function callLoaderOrAction({
4615
4752
  return handler(
4616
4753
  {
4617
4754
  request,
4618
- unstable_url: createDataFunctionUrl(request, path),
4619
- unstable_pattern,
4755
+ url: createDataFunctionUrl(request, path),
4756
+ pattern,
4620
4757
  params: match.params,
4621
4758
  context: scopedContext
4622
4759
  },
@@ -4782,7 +4919,7 @@ function normalizeRedirectLocation(location2, currentUrl, basename, historyInsta
4782
4919
  }
4783
4920
  let isSameBasename = stripBasename(url.pathname, basename) != null;
4784
4921
  if (url.origin === currentUrl.origin && isSameBasename) {
4785
- return url.pathname + url.search + url.hash;
4922
+ return removeDoubleSlashes(url.pathname) + url.search + url.hash;
4786
4923
  }
4787
4924
  }
4788
4925
  try {
@@ -4910,7 +5047,7 @@ function processRouteLoaderData(matches, results, pendingActionResult, isStaticH
4910
5047
  loaderHeaders
4911
5048
  };
4912
5049
  }
4913
- function processLoaderData(state, matches, results, pendingActionResult, revalidatingFetchers, fetcherResults) {
5050
+ function processLoaderData(state, matches, results, pendingActionResult, revalidatingFetchers, fetcherResults, workingFetchers) {
4914
5051
  let { loaderData, errors } = processRouteLoaderData(
4915
5052
  matches,
4916
5053
  results,
@@ -4931,12 +5068,12 @@ function processLoaderData(state, matches, results, pendingActionResult, revalid
4931
5068
  [boundaryMatch.route.id]: result.error
4932
5069
  };
4933
5070
  }
4934
- state.fetchers.delete(key);
5071
+ workingFetchers.delete(key);
4935
5072
  } else if (isRedirectResult(result)) {
4936
5073
  invariant(false, "Unhandled fetcher revalidation redirect");
4937
5074
  } else {
4938
5075
  let doneFetcher = getDoneFetcher(result.data);
4939
- state.fetchers.set(key, doneFetcher);
5076
+ workingFetchers.set(key, doneFetcher);
4940
5077
  }
4941
5078
  });
4942
5079
  return { loaderData, errors };
@@ -5143,11 +5280,13 @@ function getSubmissionFromNavigation(navigation) {
5143
5280
  };
5144
5281
  }
5145
5282
  }
5146
- function getLoadingNavigation(location2, submission) {
5283
+ function getLoadingNavigation(location2, matches, historyAction, submission) {
5147
5284
  if (submission) {
5148
5285
  let navigation = {
5149
5286
  state: "loading",
5150
5287
  location: location2,
5288
+ matches,
5289
+ historyAction,
5151
5290
  formMethod: submission.formMethod,
5152
5291
  formAction: submission.formAction,
5153
5292
  formEncType: submission.formEncType,
@@ -5160,6 +5299,8 @@ function getLoadingNavigation(location2, submission) {
5160
5299
  let navigation = {
5161
5300
  state: "loading",
5162
5301
  location: location2,
5302
+ matches,
5303
+ historyAction,
5163
5304
  formMethod: void 0,
5164
5305
  formAction: void 0,
5165
5306
  formEncType: void 0,
@@ -5170,10 +5311,12 @@ function getLoadingNavigation(location2, submission) {
5170
5311
  return navigation;
5171
5312
  }
5172
5313
  }
5173
- function getSubmittingNavigation(location2, submission) {
5314
+ function getSubmittingNavigation(location2, matches, historyAction, submission) {
5174
5315
  let navigation = {
5175
5316
  state: "submitting",
5176
5317
  location: location2,
5318
+ matches,
5319
+ historyAction,
5177
5320
  formMethod: submission.formMethod,
5178
5321
  formAction: submission.formAction,
5179
5322
  formEncType: submission.formEncType,
@@ -5444,7 +5587,7 @@ function useOutlet(context) {
5444
5587
  function useParams() {
5445
5588
  let { matches } = React10.useContext(RouteContext);
5446
5589
  let routeMatch = matches[matches.length - 1];
5447
- return routeMatch ? routeMatch.params : {};
5590
+ return routeMatch?.params ?? {};
5448
5591
  }
5449
5592
  function useResolvedPath(to, { relative } = {}) {
5450
5593
  let { matches } = React10.useContext(RouteContext);
@@ -5506,7 +5649,15 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
5506
5649
  let segments = pathname.replace(/^\//, "").split("/");
5507
5650
  remainingPathname = "/" + segments.slice(parentSegments.length).join("/");
5508
5651
  }
5509
- let matches = matchRoutes(routes, { pathname: remainingPathname });
5652
+ let matches = dataRouterOpts && dataRouterOpts.state.matches.length ? (
5653
+ // If we're in a data router, use the matches we've already identified but ensure
5654
+ // we have the latest route instances from the manifest in case elements have changed
5655
+ dataRouterOpts.state.matches.map(
5656
+ (m) => Object.assign(m, {
5657
+ route: dataRouterOpts.manifest[m.route.id] || m.route
5658
+ })
5659
+ )
5660
+ ) : matchRoutes(routes, { pathname: remainingPathname });
5510
5661
  if (ENABLE_DEV_WARNINGS) {
5511
5662
  warning(
5512
5663
  parentRoute || matches != null,
@@ -5557,7 +5708,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
5557
5708
  hash: "",
5558
5709
  state: null,
5559
5710
  key: "default",
5560
- unstable_mask: void 0,
5711
+ mask: void 0,
5561
5712
  ...location2
5562
5713
  },
5563
5714
  navigationType: "POP"
@@ -5690,7 +5841,7 @@ function _renderMatches(matches, parentMatches = [], dataRouterOpts) {
5690
5841
  onErrorHandler(error, {
5691
5842
  location: dataRouterState.location,
5692
5843
  params: dataRouterState.matches?.[0]?.params ?? {},
5693
- unstable_pattern: getRoutePattern(dataRouterState.matches),
5844
+ pattern: getRoutePattern(dataRouterState.matches),
5694
5845
  errorInfo
5695
5846
  });
5696
5847
  } : void 0;
@@ -5799,7 +5950,10 @@ function useNavigation() {
5799
5950
  "useNavigation"
5800
5951
  /* UseNavigation */
5801
5952
  );
5802
- return state.navigation;
5953
+ return React10.useMemo(() => {
5954
+ let { matches, historyAction, ...rest } = state.navigation;
5955
+ return rest;
5956
+ }, [state.navigation]);
5803
5957
  }
5804
5958
  function useRevalidator() {
5805
5959
  let dataRouterContext = useDataRouterContext(
@@ -5976,6 +6130,68 @@ function useRoute(...args) {
5976
6130
  actionData: state.actionData?.[id]
5977
6131
  };
5978
6132
  }
6133
+ function toRouterStateMatch(match) {
6134
+ return {
6135
+ id: match.route.id,
6136
+ pathname: match.pathname,
6137
+ params: match.params,
6138
+ handle: match.route.handle
6139
+ };
6140
+ }
6141
+ function useRouterState() {
6142
+ let {
6143
+ location: location2,
6144
+ historyAction: type,
6145
+ matches,
6146
+ navigation
6147
+ } = useDataRouterState(
6148
+ "unstable_useRouterState"
6149
+ /* UseRouterState */
6150
+ );
6151
+ let active = React10.useMemo(
6152
+ () => ({
6153
+ type,
6154
+ location: location2,
6155
+ searchParams: new URLSearchParams(location2.search),
6156
+ params: matches[matches.length - 1]?.params ?? {},
6157
+ matches: matches.map((m) => toRouterStateMatch(m))
6158
+ }),
6159
+ [location2, matches, type]
6160
+ );
6161
+ let pending = React10.useMemo(() => {
6162
+ if (navigation.state === "idle") return null;
6163
+ let shared = {
6164
+ type: navigation.historyAction,
6165
+ location: navigation.location,
6166
+ searchParams: new URLSearchParams(navigation.location.search),
6167
+ params: navigation.matches[navigation.matches.length - 1]?.params ?? {},
6168
+ matches: navigation.matches.map((m) => toRouterStateMatch(m))
6169
+ };
6170
+ return navigation.state === "loading" ? {
6171
+ ...shared,
6172
+ state: "loading",
6173
+ formMethod: navigation.formMethod,
6174
+ formAction: navigation.formAction,
6175
+ formEncType: navigation.formEncType,
6176
+ formData: navigation.formData,
6177
+ json: navigation.json,
6178
+ text: navigation.text
6179
+ } : {
6180
+ ...shared,
6181
+ state: "submitting",
6182
+ formMethod: navigation.formMethod,
6183
+ formAction: navigation.formAction,
6184
+ formEncType: navigation.formEncType,
6185
+ formData: navigation.formData,
6186
+ json: navigation.json,
6187
+ text: navigation.text
6188
+ };
6189
+ }, [navigation]);
6190
+ return React10.useMemo(
6191
+ () => ({ active, pending }),
6192
+ [active, pending]
6193
+ );
6194
+ }
5979
6195
  function warnOnce(condition, message) {
5980
6196
  if (!condition && !alreadyWarned2[message]) {
5981
6197
  alreadyWarned2[message] = true;
@@ -6054,17 +6270,17 @@ function createMemoryRouter(routes, opts) {
6054
6270
  mapRouteProperties,
6055
6271
  dataStrategy: opts?.dataStrategy,
6056
6272
  patchRoutesOnNavigation: opts?.patchRoutesOnNavigation,
6057
- unstable_instrumentations: opts?.unstable_instrumentations
6273
+ instrumentations: opts?.instrumentations
6058
6274
  }).initialize();
6059
6275
  }
6060
6276
  function RouterProvider2({
6061
6277
  router: router2,
6062
6278
  flushSync: reactDomFlushSyncImpl,
6063
6279
  onError,
6064
- unstable_useTransitions
6280
+ useTransitions
6065
6281
  }) {
6066
6282
  let unstable_rsc = useIsRSCRouterContext();
6067
- unstable_useTransitions = unstable_rsc || unstable_useTransitions;
6283
+ useTransitions = unstable_rsc || useTransitions;
6068
6284
  let [_state, setStateImpl] = React10.useState(router2.state);
6069
6285
  let [state, setOptimisticState] = useOptimisticSafe(_state);
6070
6286
  let [pendingState, setPendingState] = React10.useState();
@@ -6082,7 +6298,7 @@ function RouterProvider2({
6082
6298
  (error) => onError(error, {
6083
6299
  location: newState.location,
6084
6300
  params: newState.matches[0]?.params ?? {},
6085
- unstable_pattern: getRoutePattern(newState.matches)
6301
+ pattern: getRoutePattern(newState.matches)
6086
6302
  })
6087
6303
  );
6088
6304
  }
@@ -6104,11 +6320,11 @@ function RouterProvider2({
6104
6320
  if (!viewTransitionOpts || !isViewTransitionAvailable) {
6105
6321
  if (reactDomFlushSyncImpl && flushSync3) {
6106
6322
  reactDomFlushSyncImpl(() => setStateImpl(newState));
6107
- } else if (unstable_useTransitions === false) {
6323
+ } else if (useTransitions === false) {
6108
6324
  setStateImpl(newState);
6109
6325
  } else {
6110
6326
  React10.startTransition(() => {
6111
- if (unstable_useTransitions === true) {
6327
+ if (useTransitions === true) {
6112
6328
  setOptimisticState((s) => getOptimisticRouterState(s, newState));
6113
6329
  }
6114
6330
  setStateImpl(newState);
@@ -6166,7 +6382,7 @@ function RouterProvider2({
6166
6382
  reactDomFlushSyncImpl,
6167
6383
  transition,
6168
6384
  renderDfd,
6169
- unstable_useTransitions,
6385
+ useTransitions,
6170
6386
  setOptimisticState,
6171
6387
  onError
6172
6388
  ]
@@ -6182,11 +6398,11 @@ function RouterProvider2({
6182
6398
  let newState = pendingState;
6183
6399
  let renderPromise = renderDfd.promise;
6184
6400
  let transition2 = router2.window.document.startViewTransition(async () => {
6185
- if (unstable_useTransitions === false) {
6401
+ if (useTransitions === false) {
6186
6402
  setStateImpl(newState);
6187
6403
  } else {
6188
6404
  React10.startTransition(() => {
6189
- if (unstable_useTransitions === true) {
6405
+ if (useTransitions === true) {
6190
6406
  setOptimisticState((s) => getOptimisticRouterState(s, newState));
6191
6407
  }
6192
6408
  setStateImpl(newState);
@@ -6206,7 +6422,7 @@ function RouterProvider2({
6206
6422
  pendingState,
6207
6423
  renderDfd,
6208
6424
  router2.window,
6209
- unstable_useTransitions,
6425
+ useTransitions,
6210
6426
  setOptimisticState
6211
6427
  ]);
6212
6428
  React10.useEffect(() => {
@@ -6260,12 +6476,13 @@ function RouterProvider2({
6260
6476
  location: state.location,
6261
6477
  navigationType: state.historyAction,
6262
6478
  navigator,
6263
- unstable_useTransitions
6479
+ useTransitions
6264
6480
  },
6265
6481
  /* @__PURE__ */ React10.createElement(
6266
6482
  MemoizedDataRoutes,
6267
6483
  {
6268
6484
  routes: router2.routes,
6485
+ manifest: router2.manifest,
6269
6486
  future: router2.future,
6270
6487
  state,
6271
6488
  isStatic: false,
@@ -6288,21 +6505,26 @@ function getOptimisticRouterState(currentState, newState) {
6288
6505
  fetchers: newState.fetchers
6289
6506
  };
6290
6507
  }
6291
- function DataRoutes({
6508
+ function DataRoutes2({
6292
6509
  routes,
6510
+ manifest,
6293
6511
  future,
6294
6512
  state,
6295
6513
  isStatic,
6296
6514
  onError
6297
6515
  }) {
6298
- return useRoutesImpl(routes, void 0, { state, isStatic, onError});
6516
+ return useRoutesImpl(routes, void 0, {
6517
+ manifest,
6518
+ state,
6519
+ isStatic,
6520
+ onError});
6299
6521
  }
6300
6522
  function MemoryRouter({
6301
6523
  basename,
6302
6524
  children,
6303
6525
  initialEntries,
6304
6526
  initialIndex,
6305
- unstable_useTransitions
6527
+ useTransitions
6306
6528
  }) {
6307
6529
  let historyRef = React10.useRef();
6308
6530
  if (historyRef.current == null) {
@@ -6319,13 +6541,13 @@ function MemoryRouter({
6319
6541
  });
6320
6542
  let setState = React10.useCallback(
6321
6543
  (newState) => {
6322
- if (unstable_useTransitions === false) {
6544
+ if (useTransitions === false) {
6323
6545
  setStateImpl(newState);
6324
6546
  } else {
6325
6547
  React10.startTransition(() => setStateImpl(newState));
6326
6548
  }
6327
6549
  },
6328
- [unstable_useTransitions]
6550
+ [useTransitions]
6329
6551
  );
6330
6552
  React10.useLayoutEffect(() => history.listen(setState), [history, setState]);
6331
6553
  return /* @__PURE__ */ React10.createElement(
@@ -6336,7 +6558,7 @@ function MemoryRouter({
6336
6558
  location: state.location,
6337
6559
  navigationType: state.action,
6338
6560
  navigator: history,
6339
- unstable_useTransitions
6561
+ useTransitions
6340
6562
  }
6341
6563
  );
6342
6564
  }
@@ -6388,7 +6610,7 @@ function Router({
6388
6610
  navigationType = "POP",
6389
6611
  navigator,
6390
6612
  static: staticProp = false,
6391
- unstable_useTransitions
6613
+ useTransitions
6392
6614
  }) {
6393
6615
  invariant(
6394
6616
  !useInRouterContext(),
@@ -6400,10 +6622,10 @@ function Router({
6400
6622
  basename,
6401
6623
  navigator,
6402
6624
  static: staticProp,
6403
- unstable_useTransitions,
6625
+ useTransitions,
6404
6626
  future: {}
6405
6627
  }),
6406
- [basename, navigator, staticProp, unstable_useTransitions]
6628
+ [basename, navigator, staticProp, useTransitions]
6407
6629
  );
6408
6630
  if (typeof locationProp === "string") {
6409
6631
  locationProp = parsePath(locationProp);
@@ -6414,7 +6636,7 @@ function Router({
6414
6636
  hash = "",
6415
6637
  state = null,
6416
6638
  key = "default",
6417
- unstable_mask
6639
+ mask
6418
6640
  } = locationProp;
6419
6641
  let locationContext = React10.useMemo(() => {
6420
6642
  let trailingPathname = stripBasename(pathname, basename);
@@ -6428,20 +6650,11 @@ function Router({
6428
6650
  hash,
6429
6651
  state,
6430
6652
  key,
6431
- unstable_mask
6653
+ mask
6432
6654
  },
6433
6655
  navigationType
6434
6656
  };
6435
- }, [
6436
- basename,
6437
- pathname,
6438
- search,
6439
- hash,
6440
- state,
6441
- key,
6442
- navigationType,
6443
- unstable_mask
6444
- ]);
6657
+ }, [basename, pathname, search, hash, state, key, navigationType, mask]);
6445
6658
  warning(
6446
6659
  locationContext != null,
6447
6660
  `<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.`
@@ -6470,7 +6683,7 @@ function Await({
6470
6683
  dataRouterContext.onError(error, {
6471
6684
  location: dataRouterStateContext.location,
6472
6685
  params: dataRouterStateContext.matches[0]?.params || {},
6473
- unstable_pattern: getRoutePattern(dataRouterStateContext.matches),
6686
+ pattern: getRoutePattern(dataRouterStateContext.matches),
6474
6687
  errorInfo
6475
6688
  });
6476
6689
  }
@@ -7069,7 +7282,7 @@ function hydrate(index) {
7069
7282
  continue;
7070
7283
  case TYPE_ERROR:
7071
7284
  const [, message, errorType] = value;
7072
- let error = errorType && globalObj && globalObj[errorType] ? new globalObj[errorType](message) : new Error(message);
7285
+ let error = errorType && globalObj && SUPPORTED_ERROR_TYPES.includes(errorType) && errorType in globalObj && typeof globalObj[errorType] === "function" ? new globalObj[errorType](message) : new Error(message);
7073
7286
  hydrated[index2] = error;
7074
7287
  set(error);
7075
7288
  continue;
@@ -7481,11 +7694,9 @@ function getTurboStreamSingleFetchDataStrategy(getRouter, manifest, routeModules
7481
7694
  (match) => {
7482
7695
  let manifestRoute = manifest.routes[match.route.id];
7483
7696
  invariant2(manifestRoute, "Route not found in manifest");
7484
- let routeModule = routeModules[match.route.id];
7485
7697
  return {
7486
7698
  hasLoader: manifestRoute.hasLoader,
7487
- hasClientLoader: manifestRoute.hasClientLoader,
7488
- hasShouldRevalidate: Boolean(routeModule?.shouldRevalidate)
7699
+ hasClientLoader: manifestRoute.hasClientLoader
7489
7700
  };
7490
7701
  },
7491
7702
  fetchAndDecodeViaTurboStream,
@@ -7605,13 +7816,12 @@ async function singleFetchLoaderNavigationStrategy(args, router2, getRouteInfo,
7605
7816
  async (m, i) => m.resolve(async (handler) => {
7606
7817
  routeDfds[i].resolve();
7607
7818
  let routeId = m.route.id;
7608
- let { hasLoader, hasClientLoader, hasShouldRevalidate } = getRouteInfo(m);
7819
+ let { hasLoader, hasClientLoader } = getRouteInfo(m);
7609
7820
  let defaultShouldRevalidate = !m.shouldRevalidateArgs || m.shouldRevalidateArgs.actionStatus == null || m.shouldRevalidateArgs.actionStatus < 400;
7610
7821
  let shouldCall = m.shouldCallHandler(defaultShouldRevalidate);
7611
7822
  if (!shouldCall) {
7612
7823
  foundOptOutRoute || (foundOptOutRoute = m.shouldRevalidateArgs != null && // This is a revalidation,
7613
- hasLoader && // for a route with a server loader,
7614
- hasShouldRevalidate === true);
7824
+ hasLoader);
7615
7825
  return;
7616
7826
  }
7617
7827
  if (shouldAllowOptOut(m) && hasClientLoader) {
@@ -7752,9 +7962,9 @@ function singleFetchUrl(reqUrl, basename, trailingSlashAware, extension) {
7752
7962
  if (url.pathname === "/") {
7753
7963
  url.pathname = `_root.${extension}`;
7754
7964
  } else if (basename && stripBasename(url.pathname, basename) === "/") {
7755
- url.pathname = `${basename.replace(/\/$/, "")}/_root.${extension}`;
7965
+ url.pathname = `${removeTrailingSlash(basename)}/_root.${extension}`;
7756
7966
  } else {
7757
- url.pathname = `${url.pathname.replace(/\/$/, "")}.${extension}`;
7967
+ url.pathname = `${removeTrailingSlash(url.pathname)}.${extension}`;
7758
7968
  }
7759
7969
  }
7760
7970
  return url;
@@ -7829,7 +8039,8 @@ function decodeViaTurboStream(body, global2) {
7829
8039
  if (type === "SanitizedError") {
7830
8040
  let [name, message, stack] = rest;
7831
8041
  let Constructor = Error;
7832
- if (name && name in global2 && typeof global2[name] === "function") {
8042
+ if (name && SUPPORTED_ERROR_TYPES.includes(name) && name in global2 && // @ts-expect-error
8043
+ typeof global2[name] === "function") {
7833
8044
  Constructor = global2[name];
7834
8045
  }
7835
8046
  let error = new Constructor(message);
@@ -8325,46 +8536,38 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
8325
8536
  let hasInitialError = initialState && initialState.errors && route.id in initialState.errors;
8326
8537
  let initialError = hasInitialError ? initialState?.errors?.[route.id] : void 0;
8327
8538
  let isHydrationRequest = needsRevalidation == null && (routeModule.clientLoader?.hydrate === true || !route.hasLoader);
8328
- dataRoute.loader = async ({
8329
- request,
8330
- params,
8331
- context,
8332
- unstable_pattern,
8333
- unstable_url
8334
- }, singleFetch) => {
8335
- try {
8336
- let result = await prefetchStylesAndCallHandler(async () => {
8337
- invariant2(
8338
- routeModule,
8339
- "No `routeModule` available for critical-route loader"
8340
- );
8341
- if (!routeModule.clientLoader) {
8342
- return fetchServerLoader(singleFetch);
8343
- }
8344
- return routeModule.clientLoader({
8345
- request,
8346
- params,
8347
- context,
8348
- unstable_pattern,
8349
- unstable_url,
8350
- async serverLoader() {
8351
- preventInvalidServerHandlerCall("loader", route);
8352
- if (isHydrationRequest) {
8353
- if (hasInitialData) {
8354
- return initialData;
8355
- }
8356
- if (hasInitialError) {
8357
- throw initialError;
8358
- }
8539
+ dataRoute.loader = async ({ request, params, context, pattern, url }, singleFetch) => {
8540
+ let _isHydrationRequest = isHydrationRequest;
8541
+ isHydrationRequest = false;
8542
+ let result = await prefetchStylesAndCallHandler(async () => {
8543
+ invariant2(
8544
+ routeModule,
8545
+ "No `routeModule` available for critical-route loader"
8546
+ );
8547
+ if (!routeModule.clientLoader) {
8548
+ return fetchServerLoader(singleFetch);
8549
+ }
8550
+ return routeModule.clientLoader({
8551
+ request,
8552
+ params,
8553
+ context,
8554
+ pattern,
8555
+ url,
8556
+ async serverLoader() {
8557
+ preventInvalidServerHandlerCall("loader", route);
8558
+ if (_isHydrationRequest) {
8559
+ if (hasInitialData) {
8560
+ return initialData;
8561
+ }
8562
+ if (hasInitialError) {
8563
+ throw initialError;
8359
8564
  }
8360
- return fetchServerLoader(singleFetch);
8361
8565
  }
8362
- });
8566
+ return fetchServerLoader(singleFetch);
8567
+ }
8363
8568
  });
8364
- return result;
8365
- } finally {
8366
- isHydrationRequest = false;
8367
- }
8569
+ });
8570
+ return result;
8368
8571
  };
8369
8572
  dataRoute.loader.hydrate = shouldHydrateRouteLoader(
8370
8573
  route.id,
@@ -8372,13 +8575,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
8372
8575
  route.hasLoader,
8373
8576
  isSpaMode
8374
8577
  );
8375
- dataRoute.action = ({
8376
- request,
8377
- params,
8378
- context,
8379
- unstable_pattern,
8380
- unstable_url
8381
- }, singleFetch) => {
8578
+ dataRoute.action = ({ request, params, context, pattern, url }, singleFetch) => {
8382
8579
  return prefetchStylesAndCallHandler(async () => {
8383
8580
  invariant2(
8384
8581
  routeModule,
@@ -8394,8 +8591,8 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
8394
8591
  request,
8395
8592
  params,
8396
8593
  context,
8397
- unstable_pattern,
8398
- unstable_url,
8594
+ pattern,
8595
+ url,
8399
8596
  async serverAction() {
8400
8597
  preventInvalidServerHandlerCall("action", route);
8401
8598
  return fetchServerAction(singleFetch);
@@ -8584,7 +8781,13 @@ function getPartialManifest({ sri, ...manifest }, router2) {
8584
8781
  segments.pop();
8585
8782
  }
8586
8783
  paths.forEach((path) => {
8587
- let matches = matchRoutes(router2.routes, path, router2.basename);
8784
+ let matches = matchRoutesImpl(
8785
+ router2.routes,
8786
+ path,
8787
+ router2.basename || "/",
8788
+ false,
8789
+ router2.branches
8790
+ );
8588
8791
  if (matches) {
8589
8792
  matches.forEach((m) => routeIds.add(m.route.id));
8590
8793
  }
@@ -8682,10 +8885,7 @@ function useFogOFWarDiscovery(router2, manifest, routeModules, ssr, routeDiscove
8682
8885
  }
8683
8886
  function getManifestPath(_manifestPath, basename) {
8684
8887
  let manifestPath = _manifestPath || "/__manifest";
8685
- if (basename == null) {
8686
- return manifestPath;
8687
- }
8688
- return `${basename}${manifestPath}`.replace(/\/+/g, "/");
8888
+ return basename == null ? manifestPath : joinPaths([basename, manifestPath]);
8689
8889
  }
8690
8890
  async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, routeModules, ssr, isSpaMode, basename, manifestPath, patchRoutes, signal) {
8691
8891
  const searchParams = new URLSearchParams();
@@ -9180,7 +9380,7 @@ function Meta() {
9180
9380
  dangerouslySetInnerHTML: { __html: escapeHtml(json) }
9181
9381
  }
9182
9382
  );
9183
- } catch (err) {
9383
+ } catch (e) {
9184
9384
  return null;
9185
9385
  }
9186
9386
  }
@@ -9295,13 +9495,16 @@ import(${JSON.stringify(manifest.entry.module)});`;
9295
9495
  }
9296
9496
  ));
9297
9497
  }, []);
9298
- let preloads = isHydrated || isRSCRouterContext ? [] : dedupe(
9299
- manifest.entry.imports.concat(
9300
- getModuleLinkHrefs(matches, manifest, {
9301
- includeHydrateFallback: true
9302
- })
9498
+ let preloads = isHydrated || isRSCRouterContext ? [] : [
9499
+ // Dedupe through a Set
9500
+ ...new Set(
9501
+ manifest.entry.imports.concat(
9502
+ getModuleLinkHrefs(matches, manifest, {
9503
+ includeHydrateFallback: true
9504
+ })
9505
+ )
9303
9506
  )
9304
- );
9507
+ ];
9305
9508
  let sri = typeof manifest.sri === "object" ? manifest.sri : {};
9306
9509
  warnOnce(
9307
9510
  !isRSCRouterContext,
@@ -9327,6 +9530,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
9327
9530
  href: manifest.url,
9328
9531
  crossOrigin: scriptProps.crossOrigin,
9329
9532
  integrity: sri[manifest.url],
9533
+ nonce: scriptProps.nonce,
9330
9534
  suppressHydrationWarning: true
9331
9535
  }
9332
9536
  ) : null, /* @__PURE__ */ React10.createElement(
@@ -9336,6 +9540,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
9336
9540
  href: manifest.entry.module,
9337
9541
  crossOrigin: scriptProps.crossOrigin,
9338
9542
  integrity: sri[manifest.entry.module],
9543
+ nonce: scriptProps.nonce,
9339
9544
  suppressHydrationWarning: true
9340
9545
  }
9341
9546
  ), preloads.map((path) => /* @__PURE__ */ React10.createElement(
@@ -9346,13 +9551,11 @@ import(${JSON.stringify(manifest.entry.module)});`;
9346
9551
  href: path,
9347
9552
  crossOrigin: scriptProps.crossOrigin,
9348
9553
  integrity: sri[path],
9554
+ nonce: scriptProps.nonce,
9349
9555
  suppressHydrationWarning: true
9350
9556
  }
9351
9557
  )), initialScripts);
9352
9558
  }
9353
- function dedupe(array) {
9354
- return [...new Set(array)];
9355
- }
9356
9559
  function mergeRefs(...refs) {
9357
9560
  return (value) => {
9358
9561
  refs.forEach((ref) => {
@@ -9444,7 +9647,7 @@ function createBrowserRouter(routes, opts) {
9444
9647
  dataStrategy: opts?.dataStrategy,
9445
9648
  patchRoutesOnNavigation: opts?.patchRoutesOnNavigation,
9446
9649
  window: opts?.window,
9447
- unstable_instrumentations: opts?.unstable_instrumentations
9650
+ instrumentations: opts?.instrumentations
9448
9651
  }).initialize();
9449
9652
  }
9450
9653
  function createHashRouter(routes, opts) {
@@ -9460,7 +9663,7 @@ function createHashRouter(routes, opts) {
9460
9663
  dataStrategy: opts?.dataStrategy,
9461
9664
  patchRoutesOnNavigation: opts?.patchRoutesOnNavigation,
9462
9665
  window: opts?.window,
9463
- unstable_instrumentations: opts?.unstable_instrumentations
9666
+ instrumentations: opts?.instrumentations
9464
9667
  }).initialize();
9465
9668
  }
9466
9669
  function parseHydrationData() {
@@ -9511,7 +9714,7 @@ function deserializeErrors(errors) {
9511
9714
  function BrowserRouter({
9512
9715
  basename,
9513
9716
  children,
9514
- unstable_useTransitions,
9717
+ useTransitions,
9515
9718
  window: window2
9516
9719
  }) {
9517
9720
  let historyRef = React10.useRef();
@@ -9525,13 +9728,13 @@ function BrowserRouter({
9525
9728
  });
9526
9729
  let setState = React10.useCallback(
9527
9730
  (newState) => {
9528
- if (unstable_useTransitions === false) {
9731
+ if (useTransitions === false) {
9529
9732
  setStateImpl(newState);
9530
9733
  } else {
9531
9734
  React10.startTransition(() => setStateImpl(newState));
9532
9735
  }
9533
9736
  },
9534
- [unstable_useTransitions]
9737
+ [useTransitions]
9535
9738
  );
9536
9739
  React10.useLayoutEffect(() => history.listen(setState), [history, setState]);
9537
9740
  return /* @__PURE__ */ React10.createElement(
@@ -9542,14 +9745,14 @@ function BrowserRouter({
9542
9745
  location: state.location,
9543
9746
  navigationType: state.action,
9544
9747
  navigator: history,
9545
- unstable_useTransitions
9748
+ useTransitions
9546
9749
  }
9547
9750
  );
9548
9751
  }
9549
9752
  function HashRouter({
9550
9753
  basename,
9551
9754
  children,
9552
- unstable_useTransitions,
9755
+ useTransitions,
9553
9756
  window: window2
9554
9757
  }) {
9555
9758
  let historyRef = React10.useRef();
@@ -9563,13 +9766,13 @@ function HashRouter({
9563
9766
  });
9564
9767
  let setState = React10.useCallback(
9565
9768
  (newState) => {
9566
- if (unstable_useTransitions === false) {
9769
+ if (useTransitions === false) {
9567
9770
  setStateImpl(newState);
9568
9771
  } else {
9569
9772
  React10.startTransition(() => setStateImpl(newState));
9570
9773
  }
9571
9774
  },
9572
- [unstable_useTransitions]
9775
+ [useTransitions]
9573
9776
  );
9574
9777
  React10.useLayoutEffect(() => history.listen(setState), [history, setState]);
9575
9778
  return /* @__PURE__ */ React10.createElement(
@@ -9580,7 +9783,7 @@ function HashRouter({
9580
9783
  location: state.location,
9581
9784
  navigationType: state.action,
9582
9785
  navigator: history,
9583
- unstable_useTransitions
9786
+ useTransitions
9584
9787
  }
9585
9788
  );
9586
9789
  }
@@ -9588,7 +9791,7 @@ function HistoryRouter({
9588
9791
  basename,
9589
9792
  children,
9590
9793
  history,
9591
- unstable_useTransitions
9794
+ useTransitions
9592
9795
  }) {
9593
9796
  let [state, setStateImpl] = React10.useState({
9594
9797
  action: history.action,
@@ -9596,13 +9799,13 @@ function HistoryRouter({
9596
9799
  });
9597
9800
  let setState = React10.useCallback(
9598
9801
  (newState) => {
9599
- if (unstable_useTransitions === false) {
9802
+ if (useTransitions === false) {
9600
9803
  setStateImpl(newState);
9601
9804
  } else {
9602
9805
  React10.startTransition(() => setStateImpl(newState));
9603
9806
  }
9604
9807
  },
9605
- [unstable_useTransitions]
9808
+ [useTransitions]
9606
9809
  );
9607
9810
  React10.useLayoutEffect(() => history.listen(setState), [history, setState]);
9608
9811
  return /* @__PURE__ */ React10.createElement(
@@ -9613,7 +9816,7 @@ function HistoryRouter({
9613
9816
  location: state.location,
9614
9817
  navigationType: state.action,
9615
9818
  navigator: history,
9616
- unstable_useTransitions
9819
+ useTransitions
9617
9820
  }
9618
9821
  );
9619
9822
  }
@@ -9690,13 +9893,13 @@ function useDataRouterState2(hookName) {
9690
9893
  function useLinkClickHandler(to, {
9691
9894
  target,
9692
9895
  replace: replaceProp,
9693
- unstable_mask,
9896
+ mask,
9694
9897
  state,
9695
9898
  preventScrollReset,
9696
9899
  relative,
9697
9900
  viewTransition,
9698
- unstable_defaultShouldRevalidate,
9699
- unstable_useTransitions
9901
+ defaultShouldRevalidate,
9902
+ useTransitions
9700
9903
  } = {}) {
9701
9904
  let navigate = useNavigate();
9702
9905
  let location2 = useLocation();
@@ -9708,14 +9911,14 @@ function useLinkClickHandler(to, {
9708
9911
  let replace2 = replaceProp !== void 0 ? replaceProp : createPath(location2) === createPath(path);
9709
9912
  let doNavigate = () => navigate(to, {
9710
9913
  replace: replace2,
9711
- unstable_mask,
9914
+ mask,
9712
9915
  state,
9713
9916
  preventScrollReset,
9714
9917
  relative,
9715
9918
  viewTransition,
9716
- unstable_defaultShouldRevalidate
9919
+ defaultShouldRevalidate
9717
9920
  });
9718
- if (unstable_useTransitions) {
9921
+ if (useTransitions) {
9719
9922
  React10.startTransition(() => doNavigate());
9720
9923
  } else {
9721
9924
  doNavigate();
@@ -9727,15 +9930,15 @@ function useLinkClickHandler(to, {
9727
9930
  navigate,
9728
9931
  path,
9729
9932
  replaceProp,
9730
- unstable_mask,
9933
+ mask,
9731
9934
  state,
9732
9935
  target,
9733
9936
  to,
9734
9937
  preventScrollReset,
9735
9938
  relative,
9736
9939
  viewTransition,
9737
- unstable_defaultShouldRevalidate,
9738
- unstable_useTransitions
9940
+ defaultShouldRevalidate,
9941
+ useTransitions
9739
9942
  ]
9740
9943
  );
9741
9944
  }
@@ -9790,7 +9993,7 @@ function useSubmit() {
9790
9993
  if (options.navigate === false) {
9791
9994
  let key = options.fetcherKey || getUniqueFetcherId();
9792
9995
  await routerFetch(key, currentRouteId, options.action || action, {
9793
- unstable_defaultShouldRevalidate: options.unstable_defaultShouldRevalidate,
9996
+ defaultShouldRevalidate: options.defaultShouldRevalidate,
9794
9997
  preventScrollReset: options.preventScrollReset,
9795
9998
  formData,
9796
9999
  body,
@@ -9800,7 +10003,7 @@ function useSubmit() {
9800
10003
  });
9801
10004
  } else {
9802
10005
  await routerNavigate(options.action || action, {
9803
- unstable_defaultShouldRevalidate: options.unstable_defaultShouldRevalidate,
10006
+ defaultShouldRevalidate: options.defaultShouldRevalidate,
9804
10007
  preventScrollReset: options.preventScrollReset,
9805
10008
  formData,
9806
10009
  body,
@@ -9925,10 +10128,13 @@ function useFetchers() {
9925
10128
  "useFetchers"
9926
10129
  /* UseFetchers */
9927
10130
  );
9928
- return Array.from(state.fetchers.entries()).map(([key, fetcher]) => ({
9929
- ...fetcher,
9930
- key
9931
- }));
10131
+ return React10.useMemo(
10132
+ () => Array.from(state.fetchers.entries()).map(([key, fetcher]) => ({
10133
+ ...fetcher,
10134
+ key
10135
+ })),
10136
+ [state.fetchers]
10137
+ );
9932
10138
  }
9933
10139
  function getScrollRestorationKey(location2, matches, basename, getKey) {
9934
10140
  let key = null;
@@ -10119,7 +10325,7 @@ function StaticRouter({
10119
10325
  hash: locationProp.hash || "",
10120
10326
  state: locationProp.state != null ? locationProp.state : null,
10121
10327
  key: locationProp.key || "default",
10122
- unstable_mask: void 0
10328
+ mask: void 0
10123
10329
  };
10124
10330
  let staticNavigator = getStatelessNavigator();
10125
10331
  return /* @__PURE__ */ React10.createElement(
@@ -10131,7 +10337,7 @@ function StaticRouter({
10131
10337
  navigationType: action,
10132
10338
  navigator: staticNavigator,
10133
10339
  static: true,
10134
- unstable_useTransitions: false
10340
+ useTransitions: false
10135
10341
  }
10136
10342
  );
10137
10343
  }
@@ -10172,11 +10378,12 @@ function StaticRouterProvider({
10172
10378
  navigationType: state.historyAction,
10173
10379
  navigator: dataRouterContext.navigator,
10174
10380
  static: dataRouterContext.static,
10175
- unstable_useTransitions: false
10381
+ useTransitions: false
10176
10382
  },
10177
10383
  /* @__PURE__ */ React10.createElement(
10178
- DataRoutes,
10384
+ DataRoutes2,
10179
10385
  {
10386
+ manifest: router2.manifest,
10180
10387
  routes: router2.routes,
10181
10388
  future: router2.future,
10182
10389
  state,
@@ -10275,7 +10482,7 @@ function createStaticRouter(routes, context, opts = {}) {
10275
10482
  get future() {
10276
10483
  return {
10277
10484
  v8_middleware: false,
10278
- unstable_passThroughRequests: false,
10485
+ v8_passThroughRequests: false,
10279
10486
  ...opts?.future
10280
10487
  };
10281
10488
  },
@@ -10300,6 +10507,12 @@ function createStaticRouter(routes, context, opts = {}) {
10300
10507
  get routes() {
10301
10508
  return dataRoutes;
10302
10509
  },
10510
+ get branches() {
10511
+ return opts.branches;
10512
+ },
10513
+ get manifest() {
10514
+ return manifest;
10515
+ },
10303
10516
  get window() {
10304
10517
  return void 0;
10305
10518
  },
@@ -10366,15 +10579,16 @@ function encodeLocation(to) {
10366
10579
  hash: encoded.hash
10367
10580
  };
10368
10581
  }
10369
- var __typeError, __accessCheck, __privateGet, __privateAdd, Action, PopStateEventType, _map, RouterContextProvider, unsupportedLazyRouteObjectKeys, unsupportedLazyRouteFunctionKeys, paramRe, dynamicSegmentValue, indexRouteValue, emptySegmentValue, staticSegmentValue, splatPenalty, isSplat, ABSOLUTE_URL_REGEX, isAbsoluteUrl, joinPaths, normalizePathname, normalizeSearch, normalizeHash, DataWithResponseInit, redirect, redirectDocument, replace, ErrorResponseImpl, isBrowser, UninstrumentedSymbol, objectProtoNames, validMutationMethodsArr, validMutationMethods, validRequestMethodsArr, validRequestMethods, redirectStatusCodes, redirectPreserveMethodStatusCodes, IDLE_NAVIGATION, IDLE_FETCHER, IDLE_BLOCKER, defaultMapRouteProperties, TRANSITIONS_STORAGE_KEY, ResetLoaderDataSymbol, lazyRoutePropertyCache, loadLazyRouteProperty, lazyRouteFunctionCache, invalidProtocols, DataRouterContext, DataRouterStateContext, RSCRouterContext, ViewTransitionContext, FetchersContext, AwaitContext, AwaitContextProvider, NavigationContext, LocationContext, RouteContext, RouteErrorContext, ENABLE_DEV_WARNINGS, ERROR_DIGEST_BASE, ERROR_DIGEST_REDIRECT, ERROR_DIGEST_ROUTE_ERROR_RESPONSE, navigateEffectWarning, OutletContext, defaultErrorElement, RenderErrorBoundary, errorRedirectHandledMap, blockerId, alreadyWarned, alreadyWarned2, USE_OPTIMISTIC, useOptimisticImpl, stableUseOptimisticSetter, hydrationRouteProperties, Deferred, MemoizedDataRoutes, AwaitErrorBoundary, createRoutesFromElements, defaultMethod, defaultEncType, _formDataSupportsSubmitter, supportedFormEncTypes, HOLE, NAN, NEGATIVE_INFINITY, NEGATIVE_ZERO, NULL, POSITIVE_INFINITY, UNDEFINED, TYPE_BIGINT, TYPE_DATE, TYPE_ERROR, TYPE_MAP, TYPE_NULL_OBJECT, TYPE_PROMISE, TYPE_REGEXP, TYPE_SET, TYPE_SYMBOL, TYPE_URL, TYPE_PREVIOUS_RESOLVED, Deferred2, TIME_LIMIT_MS, getNow, yieldToMain, objectProtoNames2, globalObj, ESCAPE_LOOKUP, ESCAPE_REGEX, SingleFetchRedirectSymbol, SingleFetchNoResultError, SINGLE_FETCH_REDIRECT_STATUS, NO_BODY_STATUS_CODES, _isPreloadSupported, nextPaths, discoveredPathsMaxSize, discoveredPaths, URL_LIMIT, MANIFEST_VERSION_STORAGE_KEY, FrameworkContext, CRITICAL_CSS_DATA_ATTRIBUTE, isHydrated, RemixErrorBoundary, isBrowser2, ABSOLUTE_URL_REGEX2, Link, NavLink, Form, fetcherId, getUniqueFetcherId, SCROLL_RESTORATION_STORAGE_KEY, savedScrollPositions, ABSOLUTE_URL_REGEX3;
10370
- var init_chunk_QFMPRPBF = __esm({
10371
- "../../node_modules/.pnpm/react-router@7.14.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/development/chunk-QFMPRPBF.mjs"() {
10582
+ var __typeError, __accessCheck, __privateGet, __privateAdd, __privateSet, Action, PopStateEventType, _map, RouterContextProvider, unsupportedLazyRouteObjectKeys, unsupportedLazyRouteFunctionKeys, paramRe, dynamicSegmentValue, indexRouteValue, emptySegmentValue, staticSegmentValue, splatPenalty, isSplat, ABSOLUTE_URL_REGEX, isAbsoluteUrl, removeDoubleSlashes, joinPaths, removeTrailingSlash, normalizePathname, normalizeSearch, normalizeHash, DataWithResponseInit, redirect, redirectDocument, replace, ErrorResponseImpl, isBrowser, UninstrumentedSymbol, objectProtoNames, validMutationMethodsArr, validMutationMethods, validRequestMethodsArr, validRequestMethods, redirectStatusCodes, redirectPreserveMethodStatusCodes, IDLE_NAVIGATION, IDLE_FETCHER, IDLE_BLOCKER, defaultMapRouteProperties, TRANSITIONS_STORAGE_KEY, ResetLoaderDataSymbol, _routes, _branches, _hmrRoutes, _hmrBranches, DataRoutes, lazyRoutePropertyCache, loadLazyRouteProperty, lazyRouteFunctionCache, invalidProtocols, DataRouterContext, DataRouterStateContext, RSCRouterContext, ViewTransitionContext, FetchersContext, AwaitContext, AwaitContextProvider, NavigationContext, LocationContext, RouteContext, RouteErrorContext, ENABLE_DEV_WARNINGS, ERROR_DIGEST_BASE, ERROR_DIGEST_REDIRECT, ERROR_DIGEST_ROUTE_ERROR_RESPONSE, navigateEffectWarning, OutletContext, defaultErrorElement, RenderErrorBoundary, errorRedirectHandledMap, blockerId, alreadyWarned, alreadyWarned2, USE_OPTIMISTIC, useOptimisticImpl, stableUseOptimisticSetter, hydrationRouteProperties, Deferred, MemoizedDataRoutes, AwaitErrorBoundary, createRoutesFromElements, defaultMethod, defaultEncType, _formDataSupportsSubmitter, supportedFormEncTypes, HOLE, NAN, NEGATIVE_INFINITY, NEGATIVE_ZERO, NULL, POSITIVE_INFINITY, UNDEFINED, TYPE_BIGINT, TYPE_DATE, TYPE_ERROR, TYPE_MAP, TYPE_NULL_OBJECT, TYPE_PROMISE, TYPE_REGEXP, TYPE_SET, TYPE_SYMBOL, TYPE_URL, TYPE_PREVIOUS_RESOLVED, SUPPORTED_ERROR_TYPES, Deferred2, TIME_LIMIT_MS, getNow, yieldToMain, objectProtoNames2, globalObj, ESCAPE_LOOKUP, ESCAPE_REGEX, SingleFetchRedirectSymbol, SingleFetchNoResultError, SINGLE_FETCH_REDIRECT_STATUS, NO_BODY_STATUS_CODES, _isPreloadSupported, nextPaths, discoveredPathsMaxSize, discoveredPaths, URL_LIMIT, MANIFEST_VERSION_STORAGE_KEY, FrameworkContext, CRITICAL_CSS_DATA_ATTRIBUTE, isHydrated, RemixErrorBoundary, isBrowser2, ABSOLUTE_URL_REGEX2, Link, NavLink, Form, fetcherId, getUniqueFetcherId, SCROLL_RESTORATION_STORAGE_KEY, savedScrollPositions, ABSOLUTE_URL_REGEX3;
10583
+ var init_chunk_4N6VE7H7 = __esm({
10584
+ "../../node_modules/.pnpm/react-router@7.15.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-router/dist/development/chunk-4N6VE7H7.mjs"() {
10372
10585
  __typeError = (msg) => {
10373
10586
  throw TypeError(msg);
10374
10587
  };
10375
10588
  __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
10376
10589
  __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
10377
10590
  __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10591
+ __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
10378
10592
  Action = /* @__PURE__ */ ((Action2) => {
10379
10593
  Action2["Pop"] = "POP";
10380
10594
  Action2["Push"] = "PUSH";
@@ -10451,8 +10665,10 @@ var init_chunk_QFMPRPBF = __esm({
10451
10665
  isSplat = (s) => s === "*";
10452
10666
  ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
10453
10667
  isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
10454
- joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/");
10455
- normalizePathname = (pathname) => pathname.replace(/\/+$/, "").replace(/^\/*/, "/");
10668
+ removeDoubleSlashes = (path) => path.replace(/\/\/+/g, "/");
10669
+ joinPaths = (paths) => removeDoubleSlashes(paths.join("/"));
10670
+ removeTrailingSlash = (path) => path.replace(/\/+$/, "");
10671
+ normalizePathname = (pathname) => removeTrailingSlash(pathname).replace(/^\/*/, "/");
10456
10672
  normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
10457
10673
  normalizeHash = (hash) => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash;
10458
10674
  DataWithResponseInit = class {
@@ -10518,6 +10734,8 @@ var init_chunk_QFMPRPBF = __esm({
10518
10734
  IDLE_NAVIGATION = {
10519
10735
  state: "idle",
10520
10736
  location: void 0,
10737
+ matches: void 0,
10738
+ historyAction: void 0,
10521
10739
  formMethod: void 0,
10522
10740
  formAction: void 0,
10523
10741
  formEncType: void 0,
@@ -10546,6 +10764,54 @@ var init_chunk_QFMPRPBF = __esm({
10546
10764
  });
10547
10765
  TRANSITIONS_STORAGE_KEY = "remix-router-transitions";
10548
10766
  ResetLoaderDataSymbol = /* @__PURE__ */ Symbol("ResetLoaderData");
10767
+ DataRoutes = class {
10768
+ constructor(routes) {
10769
+ __privateAdd(this, _routes);
10770
+ __privateAdd(this, _branches);
10771
+ __privateAdd(this, _hmrRoutes);
10772
+ __privateAdd(this, _hmrBranches);
10773
+ __privateSet(this, _routes, routes);
10774
+ __privateSet(this, _branches, flattenAndRankRoutes(routes));
10775
+ }
10776
+ /** The stable route tree */
10777
+ get stableRoutes() {
10778
+ return __privateGet(this, _routes);
10779
+ }
10780
+ /** The in-flight route tree if one is active, otherwise the stable tree */
10781
+ get activeRoutes() {
10782
+ return __privateGet(this, _hmrRoutes) ?? __privateGet(this, _routes);
10783
+ }
10784
+ /** Pre-computed branches */
10785
+ get branches() {
10786
+ return __privateGet(this, _hmrBranches) ?? __privateGet(this, _branches);
10787
+ }
10788
+ get hasHMRRoutes() {
10789
+ return __privateGet(this, _hmrRoutes) != null;
10790
+ }
10791
+ /** Replace the stable route tree and recompute its branches */
10792
+ setRoutes(routes) {
10793
+ __privateSet(this, _routes, routes);
10794
+ __privateSet(this, _branches, flattenAndRankRoutes(routes));
10795
+ }
10796
+ /** Set a new in-flight route tree and recompute its branches */
10797
+ setHmrRoutes(routes) {
10798
+ __privateSet(this, _hmrRoutes, routes);
10799
+ __privateSet(this, _hmrBranches, flattenAndRankRoutes(routes));
10800
+ }
10801
+ /** Commit in-flight routes/branches to the stable slot and clear in-flight */
10802
+ commitHmrRoutes() {
10803
+ if (__privateGet(this, _hmrRoutes)) {
10804
+ __privateSet(this, _routes, __privateGet(this, _hmrRoutes));
10805
+ __privateSet(this, _branches, __privateGet(this, _hmrBranches));
10806
+ __privateSet(this, _hmrRoutes, void 0);
10807
+ __privateSet(this, _hmrBranches, void 0);
10808
+ }
10809
+ }
10810
+ };
10811
+ _routes = /* @__PURE__ */ new WeakMap();
10812
+ _branches = /* @__PURE__ */ new WeakMap();
10813
+ _hmrRoutes = /* @__PURE__ */ new WeakMap();
10814
+ _hmrBranches = /* @__PURE__ */ new WeakMap();
10549
10815
  lazyRoutePropertyCache = /* @__PURE__ */ new WeakMap();
10550
10816
  loadLazyRouteProperty = ({
10551
10817
  key,
@@ -10742,7 +11008,7 @@ var init_chunk_QFMPRPBF = __esm({
10742
11008
  });
10743
11009
  }
10744
11010
  };
10745
- MemoizedDataRoutes = React10.memo(DataRoutes);
11011
+ MemoizedDataRoutes = React10.memo(DataRoutes2);
10746
11012
  AwaitErrorBoundary = class extends React10.Component {
10747
11013
  constructor(props) {
10748
11014
  super(props);
@@ -10831,6 +11097,14 @@ var init_chunk_QFMPRPBF = __esm({
10831
11097
  TYPE_SYMBOL = "Y";
10832
11098
  TYPE_URL = "U";
10833
11099
  TYPE_PREVIOUS_RESOLVED = "Z";
11100
+ SUPPORTED_ERROR_TYPES = [
11101
+ "EvalError",
11102
+ "RangeError",
11103
+ "ReferenceError",
11104
+ "SyntaxError",
11105
+ "TypeError",
11106
+ "URIError"
11107
+ ];
10834
11108
  Deferred2 = class {
10835
11109
  constructor() {
10836
11110
  this.promise = new Promise((resolve, reject) => {
@@ -10898,7 +11172,7 @@ var init_chunk_QFMPRPBF = __esm({
10898
11172
  try {
10899
11173
  if (isBrowser2) {
10900
11174
  window.__reactRouterVersion = // @ts-expect-error
10901
- "7.14.0";
11175
+ "7.15.1";
10902
11176
  }
10903
11177
  } catch (e) {
10904
11178
  }
@@ -10912,27 +11186,27 @@ var init_chunk_QFMPRPBF = __esm({
10912
11186
  relative,
10913
11187
  reloadDocument,
10914
11188
  replace: replace2,
10915
- unstable_mask,
11189
+ mask,
10916
11190
  state,
10917
11191
  target,
10918
11192
  to,
10919
11193
  preventScrollReset,
10920
11194
  viewTransition,
10921
- unstable_defaultShouldRevalidate,
11195
+ defaultShouldRevalidate,
10922
11196
  ...rest
10923
11197
  }, forwardedRef) {
10924
- let { basename, navigator, unstable_useTransitions } = React10.useContext(NavigationContext);
11198
+ let { basename, navigator, useTransitions } = React10.useContext(NavigationContext);
10925
11199
  let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX2.test(to);
10926
11200
  let parsed = parseToInfo(to, basename);
10927
11201
  to = parsed.to;
10928
11202
  let href2 = useHref(to, { relative });
10929
11203
  let location2 = useLocation();
10930
11204
  let maskedHref = null;
10931
- if (unstable_mask) {
11205
+ if (mask) {
10932
11206
  let resolved = resolveTo(
10933
- unstable_mask,
11207
+ mask,
10934
11208
  [],
10935
- location2.unstable_mask ? location2.unstable_mask.pathname : "/",
11209
+ location2.mask ? location2.mask.pathname : "/",
10936
11210
  true
10937
11211
  );
10938
11212
  if (basename !== "/") {
@@ -10946,14 +11220,14 @@ var init_chunk_QFMPRPBF = __esm({
10946
11220
  );
10947
11221
  let internalOnClick = useLinkClickHandler(to, {
10948
11222
  replace: replace2,
10949
- unstable_mask,
11223
+ mask,
10950
11224
  state,
10951
11225
  target,
10952
11226
  preventScrollReset,
10953
11227
  relative,
10954
11228
  viewTransition,
10955
- unstable_defaultShouldRevalidate,
10956
- unstable_useTransitions
11229
+ defaultShouldRevalidate,
11230
+ useTransitions
10957
11231
  });
10958
11232
  function handleClick(event) {
10959
11233
  if (onClick) onClick(event);
@@ -11062,10 +11336,10 @@ var init_chunk_QFMPRPBF = __esm({
11062
11336
  relative,
11063
11337
  preventScrollReset,
11064
11338
  viewTransition,
11065
- unstable_defaultShouldRevalidate,
11339
+ defaultShouldRevalidate,
11066
11340
  ...props
11067
11341
  }, forwardedRef) => {
11068
- let { unstable_useTransitions } = React10.useContext(NavigationContext);
11342
+ let { useTransitions } = React10.useContext(NavigationContext);
11069
11343
  let submit = useSubmit();
11070
11344
  let formAction = useFormAction(action, { relative });
11071
11345
  let formMethod = method.toLowerCase() === "get" ? "get" : "post";
@@ -11085,9 +11359,9 @@ var init_chunk_QFMPRPBF = __esm({
11085
11359
  relative,
11086
11360
  preventScrollReset,
11087
11361
  viewTransition,
11088
- unstable_defaultShouldRevalidate
11362
+ defaultShouldRevalidate
11089
11363
  });
11090
- if (unstable_useTransitions && navigate !== false) {
11364
+ if (useTransitions && navigate !== false) {
11091
11365
  React10.startTransition(() => doSubmit());
11092
11366
  } else {
11093
11367
  doSubmit();
@@ -11118,16 +11392,16 @@ var init_chunk_QFMPRPBF = __esm({
11118
11392
 
11119
11393
  // ../../node_modules/.pnpm/cookie@1.1.1/node_modules/cookie/dist/index.js
11120
11394
  var require_dist = __commonJS({
11121
- "../../node_modules/.pnpm/cookie@1.1.1/node_modules/cookie/dist/index.js"(exports$1) {
11122
- Object.defineProperty(exports$1, "__esModule", { value: true });
11123
- exports$1.parseCookie = parseCookie;
11124
- exports$1.parse = parseCookie;
11125
- exports$1.stringifyCookie = stringifyCookie;
11126
- exports$1.stringifySetCookie = stringifySetCookie;
11127
- exports$1.serialize = stringifySetCookie;
11128
- exports$1.parseSetCookie = parseSetCookie;
11129
- exports$1.stringifySetCookie = stringifySetCookie;
11130
- exports$1.serialize = stringifySetCookie;
11395
+ "../../node_modules/.pnpm/cookie@1.1.1/node_modules/cookie/dist/index.js"(exports) {
11396
+ Object.defineProperty(exports, "__esModule", { value: true });
11397
+ exports.parseCookie = parseCookie;
11398
+ exports.parse = parseCookie;
11399
+ exports.stringifyCookie = stringifyCookie;
11400
+ exports.stringifySetCookie = stringifySetCookie;
11401
+ exports.serialize = stringifySetCookie;
11402
+ exports.parseSetCookie = parseSetCookie;
11403
+ exports.stringifySetCookie = stringifySetCookie;
11404
+ exports.serialize = stringifySetCookie;
11131
11405
  var cookieNameRegExp = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/;
11132
11406
  var cookieValueRegExp = /^[\u0021-\u003A\u003C-\u007E]*$/;
11133
11407
  var domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
@@ -11366,7 +11640,7 @@ var require_dist = __commonJS({
11366
11640
 
11367
11641
  // ../../node_modules/.pnpm/set-cookie-parser@2.7.2/node_modules/set-cookie-parser/lib/set-cookie.js
11368
11642
  var require_set_cookie = __commonJS({
11369
- "../../node_modules/.pnpm/set-cookie-parser@2.7.2/node_modules/set-cookie-parser/lib/set-cookie.js"(exports$1, module) {
11643
+ "../../node_modules/.pnpm/set-cookie-parser@2.7.2/node_modules/set-cookie-parser/lib/set-cookie.js"(exports, module) {
11370
11644
  var defaultParseOptions = {
11371
11645
  decodeValues: true,
11372
11646
  map: false,
@@ -11576,7 +11850,9 @@ function ServerRouter({
11576
11850
  delete context.staticHandlerContext.loaderData[routeId];
11577
11851
  }
11578
11852
  }
11579
- let router2 = createStaticRouter(routes, context.staticHandlerContext);
11853
+ let router2 = createStaticRouter(routes, context.staticHandlerContext, {
11854
+ branches: context.branches
11855
+ });
11580
11856
  return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(
11581
11857
  FrameworkContext.Provider,
11582
11858
  {
@@ -11624,8 +11900,7 @@ function createRoutesStub(routes, _context) {
11624
11900
  if (routerRef.current == null) {
11625
11901
  frameworkContextRef.current = {
11626
11902
  future: {
11627
- unstable_passThroughRequests: future?.unstable_passThroughRequests === true,
11628
- unstable_subResourceIntegrity: future?.unstable_subResourceIntegrity === true,
11903
+ v8_passThroughRequests: future?.v8_passThroughRequests === true,
11629
11904
  v8_middleware: future?.v8_middleware === true,
11630
11905
  unstable_trailingSlashAwareDataRequests: future?.unstable_trailingSlashAwareDataRequests === true
11631
11906
  },
@@ -11756,7 +12031,7 @@ function encodeData(value) {
11756
12031
  function decodeData(value) {
11757
12032
  try {
11758
12033
  return JSON.parse(decodeURIComponent(myEscape(atob(value))));
11759
- } catch (error) {
12034
+ } catch (e) {
11760
12035
  return {};
11761
12036
  }
11762
12037
  }
@@ -11878,26 +12153,43 @@ function serializeErrors2(errors, serverMode) {
11878
12153
  }
11879
12154
  return serialized;
11880
12155
  }
11881
- function matchServerRoutes(routes, pathname, basename) {
11882
- let matches = matchRoutes(
11883
- routes,
12156
+ function invariant3(value, message) {
12157
+ if (value === false || value === null || typeof value === "undefined") {
12158
+ console.error(
12159
+ "The following error is a bug in React Router; please open an issue! https://github.com/remix-run/react-router/issues/new/choose"
12160
+ );
12161
+ throw new Error(message);
12162
+ }
12163
+ }
12164
+ function matchServerRoutes(manifest, dataRoutes, branches, pathname, basename) {
12165
+ let matches = matchRoutesImpl(
12166
+ dataRoutes,
11884
12167
  pathname,
11885
- basename
12168
+ basename ?? "/",
12169
+ false,
12170
+ branches
11886
12171
  );
11887
12172
  if (!matches) return null;
11888
- return matches.map((match) => ({
11889
- params: match.params,
11890
- pathname: match.pathname,
11891
- route: match.route
11892
- }));
12173
+ return matches.map((match) => {
12174
+ let route = manifest[match.route.id];
12175
+ invariant3(
12176
+ route,
12177
+ `Route with id "${match.route.id}" not found in manifest.`
12178
+ );
12179
+ return {
12180
+ params: match.params,
12181
+ pathname: match.pathname,
12182
+ route
12183
+ };
12184
+ });
11893
12185
  }
11894
12186
  async function callRouteHandler(handler, args, future) {
11895
12187
  let result = await handler({
11896
- request: future.unstable_passThroughRequests ? args.request : stripRoutesParam(stripIndexParam2(args.request)),
11897
- unstable_url: args.unstable_url,
12188
+ request: future.v8_passThroughRequests ? args.request : stripRoutesParam(stripIndexParam2(args.request)),
12189
+ url: args.url,
11898
12190
  params: args.params,
11899
12191
  context: args.context,
11900
- unstable_pattern: args.unstable_pattern
12192
+ pattern: args.pattern
11901
12193
  });
11902
12194
  if (isDataWithResponseInit(result) && result.init && result.init.status && isRedirectStatusCode(result.init.status)) {
11903
12195
  throw new Response(null, result.init);
@@ -11942,14 +12234,6 @@ function stripRoutesParam(request) {
11942
12234
  }
11943
12235
  return new Request(url.href, init);
11944
12236
  }
11945
- function invariant3(value, message) {
11946
- if (value === false || value === null || typeof value === "undefined") {
11947
- console.error(
11948
- "The following error is a bug in React Router; please open an issue! https://github.com/remix-run/react-router/issues/new/choose"
11949
- );
11950
- throw new Error(message);
11951
- }
11952
- }
11953
12237
  function setDevServerHooks(devServerHooks) {
11954
12238
  globalThis[globalDevServerHooksKey] = devServerHooks;
11955
12239
  }
@@ -11959,7 +12243,7 @@ function getDevServerHooks() {
11959
12243
  function getBuildTimeHeader(request, headerName) {
11960
12244
  if (typeof process !== "undefined") {
11961
12245
  try {
11962
- if (process.env?.IS_RR_BUILD_REQUEST === "yes") {
12246
+ if (process.env.hasOwnProperty("IS_RR_BUILD_REQUEST") && process.env.IS_RR_BUILD_REQUEST === "yes") {
11963
12247
  return request.headers.get(headerName);
11964
12248
  }
11965
12249
  } catch (e) {
@@ -11980,12 +12264,6 @@ function groupRoutesByParentId2(manifest) {
11980
12264
  });
11981
12265
  return routes;
11982
12266
  }
11983
- function createRoutes(manifest, parentId = "", routesByParentId = groupRoutesByParentId2(manifest)) {
11984
- return (routesByParentId[parentId] || []).map((route) => ({
11985
- ...route,
11986
- children: createRoutes(manifest, route.id, routesByParentId)
11987
- }));
11988
- }
11989
12267
  function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesByParentId = groupRoutesByParentId2(manifest)) {
11990
12268
  return (routesByParentId[parentId] || []).map((route) => {
11991
12269
  let commonRoute = {
@@ -12257,7 +12535,7 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
12257
12535
  } catch (e) {
12258
12536
  return handleQueryError(new Error("Bad Request"), 400);
12259
12537
  }
12260
- let handlerRequest = build.future.unstable_passThroughRequests ? request : new Request(handlerUrl, {
12538
+ let handlerRequest = build.future.v8_passThroughRequests ? request : new Request(handlerUrl, {
12261
12539
  method: request.method,
12262
12540
  body: request.body,
12263
12541
  headers: request.headers,
@@ -12276,7 +12554,7 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
12276
12554
  return handleQueryError(error);
12277
12555
  }
12278
12556
  } : void 0,
12279
- unstable_normalizePath: (r) => getNormalizedPath(r, build.basename, build.future)
12557
+ normalizePath: (r) => getNormalizedPath(r, build.basename, build.future)
12280
12558
  });
12281
12559
  return handleQueryResult(result);
12282
12560
  } catch (error) {
@@ -12325,7 +12603,7 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
12325
12603
  let routesParam = new URL(request.url).searchParams.get("_routes");
12326
12604
  let loadRouteIds = routesParam ? new Set(routesParam.split(",")) : null;
12327
12605
  try {
12328
- let handlerRequest = build.future.unstable_passThroughRequests ? request : new Request(handlerUrl, {
12606
+ let handlerRequest = build.future.v8_passThroughRequests ? request : new Request(handlerUrl, {
12329
12607
  headers: request.headers,
12330
12608
  signal: request.signal
12331
12609
  });
@@ -12341,7 +12619,7 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
12341
12619
  return handleQueryError(error);
12342
12620
  }
12343
12621
  } : void 0,
12344
- unstable_normalizePath: (r) => getNormalizedPath(r, build.basename, build.future)
12622
+ normalizePath: (r) => getNormalizedPath(r, build.basename, build.future)
12345
12623
  });
12346
12624
  return handleQueryResult(result);
12347
12625
  } catch (error) {
@@ -12506,12 +12784,12 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
12506
12784
  });
12507
12785
  }
12508
12786
  function derive(build, mode) {
12509
- let routes = createRoutes(build.routes);
12510
12787
  let dataRoutes = createStaticHandlerDataRoutes(build.routes, build.future);
12511
12788
  let serverMode = isServerMode(mode) ? mode : "production";
12512
12789
  let staticHandler = createStaticHandler(dataRoutes, {
12513
12790
  basename: build.basename,
12514
- unstable_instrumentations: build.entry.module.unstable_instrumentations
12791
+ instrumentations: build.entry.module.instrumentations,
12792
+ future: build.future
12515
12793
  });
12516
12794
  let errorHandler = build.entry.module.handleError || ((error, { request }) => {
12517
12795
  if (serverMode !== "test" && !request.signal.aborted) {
@@ -12608,24 +12886,30 @@ function derive(build, mode) {
12608
12886
  );
12609
12887
  if (requestUrl.pathname === manifestUrl) {
12610
12888
  try {
12611
- let res = await handleManifestRequest(build, routes, requestUrl);
12889
+ let res = await handleManifestRequest(
12890
+ build,
12891
+ staticHandler.dataRoutes,
12892
+ staticHandler._internalRouteBranches,
12893
+ requestUrl
12894
+ );
12612
12895
  return res;
12613
12896
  } catch (e) {
12614
12897
  handleError(e);
12615
12898
  return new Response("Unknown Server Error", { status: 500 });
12616
12899
  }
12617
12900
  }
12618
- let matches = matchServerRoutes(routes, normalizedPathname, build.basename);
12901
+ let matches = matchServerRoutes(
12902
+ build.routes,
12903
+ staticHandler.dataRoutes,
12904
+ staticHandler._internalRouteBranches,
12905
+ normalizedPathname,
12906
+ build.basename
12907
+ );
12619
12908
  if (matches && matches.length > 0) {
12620
12909
  Object.assign(params, matches[0].params);
12621
12910
  }
12622
12911
  let response;
12623
12912
  if (requestUrl.pathname.endsWith(".data")) {
12624
- let singleFetchMatches = matchServerRoutes(
12625
- routes,
12626
- normalizedPathname,
12627
- build.basename
12628
- );
12629
12913
  response = await handleSingleFetchRequest(
12630
12914
  serverMode,
12631
12915
  build,
@@ -12646,7 +12930,7 @@ function derive(build, mode) {
12646
12930
  if (build.entry.module.handleDataRequest) {
12647
12931
  response = await build.entry.module.handleDataRequest(response, {
12648
12932
  context: loadContext,
12649
- params: singleFetchMatches ? singleFetchMatches[0].params : {},
12933
+ params: matches ? matches[0].params : {},
12650
12934
  request
12651
12935
  });
12652
12936
  if (isRedirectResponse(response)) {
@@ -12696,22 +12980,20 @@ function derive(build, mode) {
12696
12980
  }
12697
12981
  return response;
12698
12982
  };
12699
- if (build.entry.module.unstable_instrumentations) {
12983
+ if (build.entry.module.instrumentations) {
12700
12984
  requestHandler = instrumentHandler(
12701
12985
  requestHandler,
12702
- build.entry.module.unstable_instrumentations.map((i) => i.handler).filter(Boolean)
12986
+ build.entry.module.instrumentations.map((i) => i.handler).filter(Boolean)
12703
12987
  );
12704
12988
  }
12705
12989
  return {
12706
- routes,
12707
- dataRoutes,
12708
12990
  serverMode,
12709
12991
  staticHandler,
12710
12992
  errorHandler,
12711
12993
  requestHandler
12712
12994
  };
12713
12995
  }
12714
- async function handleManifestRequest(build, routes, url) {
12996
+ async function handleManifestRequest(build, dataRoutes, branches, url) {
12715
12997
  if (build.assets.version !== url.searchParams.get("version")) {
12716
12998
  return new Response(null, {
12717
12999
  status: 204,
@@ -12720,6 +13002,12 @@ async function handleManifestRequest(build, routes, url) {
12720
13002
  }
12721
13003
  });
12722
13004
  }
13005
+ if (url.toString().length > URL_LIMIT) {
13006
+ return new Response(null, {
13007
+ statusText: "Bad Request",
13008
+ status: 400
13009
+ });
13010
+ }
12723
13011
  let patches = {};
12724
13012
  if (url.searchParams.has("paths")) {
12725
13013
  let paths = /* @__PURE__ */ new Set();
@@ -12736,7 +13024,13 @@ async function handleManifestRequest(build, routes, url) {
12736
13024
  });
12737
13025
  });
12738
13026
  for (let path of paths) {
12739
- let matches = matchServerRoutes(routes, path, build.basename);
13027
+ let matches = matchServerRoutes(
13028
+ build.routes,
13029
+ dataRoutes,
13030
+ branches,
13031
+ path,
13032
+ build.basename
13033
+ );
12740
13034
  if (matches) {
12741
13035
  for (let match of matches) {
12742
13036
  let routeId = match.route.id;
@@ -12758,7 +13052,7 @@ async function handleManifestRequest(build, routes, url) {
12758
13052
  async function handleSingleFetchRequest(serverMode, build, staticHandler, request, normalizedPath, loadContext, handleError) {
12759
13053
  let handlerUrl = new URL(request.url);
12760
13054
  handlerUrl.pathname = normalizedPath;
12761
- let response = request.method !== "GET" ? await singleFetchAction(
13055
+ let response = isMutationMethod(request.method) ? await singleFetchAction(
12762
13056
  build,
12763
13057
  serverMode,
12764
13058
  staticHandler,
@@ -12779,7 +13073,7 @@ async function handleSingleFetchRequest(serverMode, build, staticHandler, reques
12779
13073
  }
12780
13074
  async function handleDocumentRequest(serverMode, build, staticHandler, request, loadContext, handleError, isSpaMode, criticalCss) {
12781
13075
  try {
12782
- if (request.method === "POST") {
13076
+ if (isMutationMethod(request.method)) {
12783
13077
  try {
12784
13078
  throwIfPotentialCSRFAttack(
12785
13079
  request.headers,
@@ -12804,7 +13098,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
12804
13098
  return new Response(null, { status: 500 });
12805
13099
  }
12806
13100
  } : void 0,
12807
- unstable_normalizePath: (r) => getNormalizedPath(r, build.basename, build.future)
13101
+ normalizePath: (r) => getNormalizedPath(r, build.basename, build.future)
12808
13102
  });
12809
13103
  if (!isResponse(result)) {
12810
13104
  result = await renderHtml(result, isSpaMode);
@@ -12841,6 +13135,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
12841
13135
  };
12842
13136
  let entryContext = {
12843
13137
  manifest: build.assets,
13138
+ branches: staticHandler._internalRouteBranches,
12844
13139
  routeModules: createEntryRouteModules(build.routes),
12845
13140
  staticHandlerContext: context,
12846
13141
  criticalCss,
@@ -12937,7 +13232,7 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
12937
13232
  return handleQueryRouteError(error);
12938
13233
  }
12939
13234
  } : void 0,
12940
- unstable_normalizePath: (r) => getNormalizedPath(r, build.basename, build.future)
13235
+ normalizePath: (r) => getNormalizedPath(r, build.basename, build.future)
12941
13236
  });
12942
13237
  return handleQueryRouteResult(result);
12943
13238
  } catch (error) {
@@ -13190,7 +13485,7 @@ async function writeRSCStream(rscStream, controller) {
13190
13485
  JSON.stringify(decoder.decode(chunk, { stream: true })),
13191
13486
  controller
13192
13487
  );
13193
- } catch (err) {
13488
+ } catch (e) {
13194
13489
  let base64 = JSON.stringify(btoa(String.fromCodePoint(...chunk)));
13195
13490
  writeChunk(
13196
13491
  `Uint8Array.from(atob(${base64}), m => m.codePointAt(0))`,
@@ -13477,9 +13772,9 @@ async function routeRSCServerRequest({
13477
13772
  statusText,
13478
13773
  headers
13479
13774
  });
13480
- } catch (reason) {
13481
- if (reason instanceof Response) {
13482
- return reason;
13775
+ } catch (error) {
13776
+ if (error instanceof Response) {
13777
+ return error;
13483
13778
  }
13484
13779
  if (renderRedirect) {
13485
13780
  return new Response(`Redirect: ${renderRedirect.location}`, {
@@ -13490,8 +13785,8 @@ async function routeRSCServerRequest({
13490
13785
  });
13491
13786
  }
13492
13787
  try {
13493
- reason = renderError ?? reason;
13494
- let [status, statusText] = isRouteErrorResponse(reason) ? [reason.status, reason.statusText] : [500, ""];
13788
+ let normalizedError = renderError ?? error;
13789
+ let [status, statusText] = isRouteErrorResponse(normalizedError) ? [normalizedError.status, normalizedError.statusText] : [500, ""];
13495
13790
  let retryRedirect;
13496
13791
  let reactHeaders = new Headers();
13497
13792
  const html = await renderHTML(
@@ -13503,7 +13798,7 @@ async function routeRSCServerRequest({
13503
13798
  (payload) => Object.assign(payload, {
13504
13799
  status,
13505
13800
  errors: deepestRenderedBoundaryId ? {
13506
- [deepestRenderedBoundaryId]: reason
13801
+ [deepestRenderedBoundaryId]: normalizedError
13507
13802
  } : {}
13508
13803
  })
13509
13804
  );
@@ -13526,19 +13821,19 @@ async function routeRSCServerRequest({
13526
13821
  });
13527
13822
  },
13528
13823
  {
13529
- onError(error) {
13530
- if (typeof error === "object" && error && "digest" in error && typeof error.digest === "string") {
13531
- retryRedirect = decodeRedirectErrorDigest(error.digest);
13824
+ onError(error2) {
13825
+ if (typeof error2 === "object" && error2 && "digest" in error2 && typeof error2.digest === "string") {
13826
+ retryRedirect = decodeRedirectErrorDigest(error2.digest);
13532
13827
  if (retryRedirect) {
13533
- return error.digest;
13828
+ return error2.digest;
13534
13829
  }
13535
13830
  let routeErrorResponse = decodeRouteErrorResponseDigest(
13536
- error.digest
13831
+ error2.digest
13537
13832
  );
13538
13833
  if (routeErrorResponse) {
13539
13834
  status = routeErrorResponse.status;
13540
13835
  statusText = routeErrorResponse.statusText;
13541
- return error.digest;
13836
+ return error2.digest;
13542
13837
  }
13543
13838
  }
13544
13839
  },
@@ -13588,9 +13883,9 @@ async function routeRSCServerRequest({
13588
13883
  statusText,
13589
13884
  headers
13590
13885
  });
13591
- } catch {
13886
+ } catch (error2) {
13592
13887
  }
13593
- throw reason;
13888
+ throw error;
13594
13889
  }
13595
13890
  }
13596
13891
  function RSCStaticRouter({ getPayload }) {
@@ -13674,10 +13969,9 @@ function RSCStaticRouter({ getPayload }) {
13674
13969
  // These flags have no runtime impact so can always be false. If we add
13675
13970
  // flags that drive runtime behavior they'll need to be proxied through.
13676
13971
  v8_middleware: false,
13677
- unstable_subResourceIntegrity: false,
13678
13972
  unstable_trailingSlashAwareDataRequests: true,
13679
13973
  // always on for RSC
13680
- unstable_passThroughRequests: true
13974
+ v8_passThroughRequests: true
13681
13975
  // always on for RSC
13682
13976
  },
13683
13977
  isSpaMode: false,
@@ -13781,9 +14075,9 @@ function getHydrationData({
13781
14075
  return hydrationData;
13782
14076
  }
13783
14077
  var import_cookie, import_set_cookie_parser, encoder, sign, unsign, createKey2, createCookie, isCookie, ServerMode, globalDevServerHooksKey, SERVER_NO_BODY_STATUS_CODES, createRequestHandler, createSession, isSession, encoder2, trailer, RSCRouterGlobalErrorBoundary, noopComponent, defaultManifestPath, REACT_USE, useImpl;
13784
- var init_chunk_2UH5WJXA = __esm({
13785
- "../../node_modules/.pnpm/react-router@7.14.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/development/chunk-2UH5WJXA.mjs"() {
13786
- init_chunk_QFMPRPBF();
14078
+ var init_chunk_RJYABSBD = __esm({
14079
+ "../../node_modules/.pnpm/react-router@7.15.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-router/dist/development/chunk-RJYABSBD.mjs"() {
14080
+ init_chunk_4N6VE7H7();
13787
14081
  import_cookie = __toESM(require_dist(), 1);
13788
14082
  import_set_cookie_parser = __toESM(require_set_cookie(), 1);
13789
14083
  encoder = /* @__PURE__ */ new TextEncoder();
@@ -13807,7 +14101,7 @@ var init_chunk_2UH5WJXA = __esm({
13807
14101
  let signature = byteStringToUint8Array(atob(hash));
13808
14102
  let valid = await crypto.subtle.verify("HMAC", key, signature, data2);
13809
14103
  return valid ? value : false;
13810
- } catch (error) {
14104
+ } catch (e) {
13811
14105
  return false;
13812
14106
  }
13813
14107
  };
@@ -13878,7 +14172,6 @@ var init_chunk_2UH5WJXA = __esm({
13878
14172
  ]);
13879
14173
  createRequestHandler = (build, mode) => {
13880
14174
  let _build;
13881
- let routes;
13882
14175
  let serverMode;
13883
14176
  let staticHandler;
13884
14177
  let errorHandler;
@@ -13887,14 +14180,12 @@ var init_chunk_2UH5WJXA = __esm({
13887
14180
  _build = typeof build === "function" ? await build() : build;
13888
14181
  if (typeof build === "function") {
13889
14182
  let derived = derive(_build, mode);
13890
- routes = derived.routes;
13891
14183
  serverMode = derived.serverMode;
13892
14184
  staticHandler = derived.staticHandler;
13893
14185
  errorHandler = derived.errorHandler;
13894
14186
  _requestHandler = derived.requestHandler;
13895
- } else if (!routes || !serverMode || !staticHandler || !errorHandler || !_requestHandler) {
14187
+ } else if (!serverMode || !staticHandler || !errorHandler || !_requestHandler) {
13896
14188
  let derived = derive(_build, mode);
13897
- routes = derived.routes;
13898
14189
  serverMode = derived.serverMode;
13899
14190
  staticHandler = derived.staticHandler;
13900
14191
  errorHandler = derived.errorHandler;
@@ -13976,7 +14267,7 @@ var init_chunk_2UH5WJXA = __esm({
13976
14267
  }
13977
14268
  });
13978
14269
 
13979
- // ../../node_modules/.pnpm/react-router@7.14.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/development/dom-export.mjs
14270
+ // ../../node_modules/.pnpm/react-router@7.15.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-router/dist/development/dom-export.mjs
13980
14271
  var dom_export_exports = {};
13981
14272
  __export(dom_export_exports, {
13982
14273
  HydratedRouter: () => HydratedRouter2,
@@ -14014,7 +14305,7 @@ function initSsrInfo() {
14014
14305
  }
14015
14306
  function createHydratedRouter({
14016
14307
  getContext,
14017
- unstable_instrumentations
14308
+ instrumentations
14018
14309
  }) {
14019
14310
  initSsrInfo();
14020
14311
  if (!ssrInfo) {
@@ -14087,10 +14378,10 @@ function createHydratedRouter({
14087
14378
  getContext,
14088
14379
  hydrationData,
14089
14380
  hydrationRouteProperties,
14090
- unstable_instrumentations,
14381
+ instrumentations,
14091
14382
  mapRouteProperties,
14092
14383
  future: {
14093
- unstable_passThroughRequests: ssrInfo.context.future.unstable_passThroughRequests
14384
+ v8_passThroughRequests: ssrInfo.context.future.v8_passThroughRequests
14094
14385
  },
14095
14386
  dataStrategy: getTurboStreamSingleFetchDataStrategy(
14096
14387
  () => router2,
@@ -14124,7 +14415,7 @@ function HydratedRouter2(props) {
14124
14415
  if (!router) {
14125
14416
  router = createHydratedRouter({
14126
14417
  getContext: props.getContext,
14127
- unstable_instrumentations: props.unstable_instrumentations
14418
+ instrumentations: props.instrumentations
14128
14419
  });
14129
14420
  }
14130
14421
  let [criticalCss, setCriticalCss] = React10.useState(
@@ -14185,7 +14476,7 @@ function HydratedRouter2(props) {
14185
14476
  RouterProvider22,
14186
14477
  {
14187
14478
  router,
14188
- unstable_useTransitions: props.unstable_useTransitions,
14479
+ useTransitions: props.useTransitions,
14189
14480
  onError: props.onError
14190
14481
  }
14191
14482
  ))
@@ -14464,8 +14755,7 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
14464
14755
  hasClientLoader: M.route.hasClientLoader,
14465
14756
  hasComponent: M.route.hasComponent,
14466
14757
  hasAction: M.route.hasAction,
14467
- hasClientAction: M.route.hasClientAction,
14468
- hasShouldRevalidate: M.route.hasShouldRevalidate
14758
+ hasClientAction: M.route.hasClientAction
14469
14759
  };
14470
14760
  },
14471
14761
  // pass map into fetchAndDecode so it can add payloads
@@ -14668,10 +14958,9 @@ function RSCHydratedRouter({
14668
14958
  // These flags have no runtime impact so can always be false. If we add
14669
14959
  // flags that drive runtime behavior they'll need to be proxied through.
14670
14960
  v8_middleware: false,
14671
- unstable_subResourceIntegrity: false,
14672
14961
  unstable_trailingSlashAwareDataRequests: true,
14673
14962
  // always on for RSC
14674
- unstable_passThroughRequests: true
14963
+ v8_passThroughRequests: true
14675
14964
  // always on for RSC
14676
14965
  },
14677
14966
  isSpaMode: false,
@@ -14720,30 +15009,28 @@ function createRouteFromServerManifest(match, payload) {
14720
15009
  hydrateFallbackElement: match.hydrateFallbackElement,
14721
15010
  index: match.index,
14722
15011
  loader: match.clientLoader ? async (args, singleFetch) => {
14723
- try {
14724
- let result = await match.clientLoader({
14725
- ...args,
14726
- serverLoader: () => {
14727
- preventInvalidServerHandlerCall2(
14728
- "loader",
14729
- match.id,
14730
- match.hasLoader
14731
- );
14732
- if (isHydrationRequest) {
14733
- if (hasInitialData) {
14734
- return initialData;
14735
- }
14736
- if (hasInitialError) {
14737
- throw initialError;
14738
- }
15012
+ let _isHydrationRequest = isHydrationRequest;
15013
+ isHydrationRequest = false;
15014
+ let result = await match.clientLoader({
15015
+ ...args,
15016
+ serverLoader: () => {
15017
+ preventInvalidServerHandlerCall2(
15018
+ "loader",
15019
+ match.id,
15020
+ match.hasLoader
15021
+ );
15022
+ if (_isHydrationRequest) {
15023
+ if (hasInitialData) {
15024
+ return initialData;
15025
+ }
15026
+ if (hasInitialError) {
15027
+ throw initialError;
14739
15028
  }
14740
- return callSingleFetch(singleFetch);
14741
15029
  }
14742
- });
14743
- return result;
14744
- } finally {
14745
- isHydrationRequest = false;
14746
- }
15030
+ return callSingleFetch(singleFetch);
15031
+ }
15032
+ });
15033
+ return result;
14747
15034
  } : (
14748
15035
  // We always make the call in this RSC world since even if we don't
14749
15036
  // have a `loader` we may need to get the `element` implementation
@@ -14769,8 +15056,7 @@ function createRouteFromServerManifest(match, payload) {
14769
15056
  hasLoader: true,
14770
15057
  hasClientLoader: match.clientLoader != null,
14771
15058
  hasAction: match.hasAction,
14772
- hasClientAction: match.clientAction != null,
14773
- hasShouldRevalidate: match.shouldRevalidate != null
15059
+ hasClientAction: match.clientAction != null
14774
15060
  };
14775
15061
  if (typeof dataRoute.loader === "function") {
14776
15062
  dataRoute.loader.hydrate = shouldHydrateRouteLoader(
@@ -14815,7 +15101,7 @@ async function fetchAndApplyManifestPatches2(paths, createFromReadableStream, fe
14815
15101
  if (url == null) {
14816
15102
  return;
14817
15103
  }
14818
- if (url.toString().length > URL_LIMIT2) {
15104
+ if (url.toString().length > URL_LIMIT) {
14819
15105
  nextPaths2.clear();
14820
15106
  return;
14821
15107
  }
@@ -14924,12 +15210,12 @@ function getRSCStream() {
14924
15210
  }
14925
15211
  return rscStream;
14926
15212
  }
14927
- var ssrInfo, router, defaultManifestPath2, renderedRoutesContext, nextPaths2, discoveredPathsMaxSize2, discoveredPaths2, URL_LIMIT2;
15213
+ var ssrInfo, router, defaultManifestPath2, renderedRoutesContext, nextPaths2, discoveredPathsMaxSize2, discoveredPaths2;
14928
15214
  var init_dom_export = __esm({
14929
- "../../node_modules/.pnpm/react-router@7.14.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/development/dom-export.mjs"() {
15215
+ "../../node_modules/.pnpm/react-router@7.15.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-router/dist/development/dom-export.mjs"() {
14930
15216
  "use client";
14931
- init_chunk_2UH5WJXA();
14932
- init_chunk_QFMPRPBF();
15217
+ init_chunk_RJYABSBD();
15218
+ init_chunk_4N6VE7H7();
14933
15219
  ssrInfo = null;
14934
15220
  router = null;
14935
15221
  defaultManifestPath2 = "/__manifest";
@@ -14937,11 +15223,10 @@ var init_dom_export = __esm({
14937
15223
  nextPaths2 = /* @__PURE__ */ new Set();
14938
15224
  discoveredPathsMaxSize2 = 1e3;
14939
15225
  discoveredPaths2 = /* @__PURE__ */ new Set();
14940
- URL_LIMIT2 = 7680;
14941
15226
  }
14942
15227
  });
14943
15228
 
14944
- // ../../node_modules/.pnpm/react-router@7.14.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/development/index.mjs
15229
+ // ../../node_modules/.pnpm/react-router@7.15.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-router/dist/development/index.mjs
14945
15230
  var development_exports = {};
14946
15231
  __export(development_exports, {
14947
15232
  Await: () => Await,
@@ -15044,6 +15329,7 @@ __export(development_exports, {
15044
15329
  unstable_setDevServerHooks: () => setDevServerHooks,
15045
15330
  unstable_usePrompt: () => usePrompt,
15046
15331
  unstable_useRoute: () => useRoute,
15332
+ unstable_useRouterState: () => useRouterState,
15047
15333
  useActionData: () => useActionData,
15048
15334
  useAsyncError: () => useAsyncError,
15049
15335
  useAsyncValue: () => useAsyncValue,
@@ -15075,16 +15361,16 @@ __export(development_exports, {
15075
15361
  useViewTransitionState: () => useViewTransitionState
15076
15362
  });
15077
15363
  var init_development = __esm({
15078
- "../../node_modules/.pnpm/react-router@7.14.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/development/index.mjs"() {
15364
+ "../../node_modules/.pnpm/react-router@7.15.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-router/dist/development/index.mjs"() {
15079
15365
  "use client";
15080
- init_chunk_2UH5WJXA();
15081
- init_chunk_QFMPRPBF();
15366
+ init_chunk_RJYABSBD();
15367
+ init_chunk_4N6VE7H7();
15082
15368
  }
15083
15369
  });
15084
15370
 
15085
- // ../../node_modules/.pnpm/react-router-dom@7.14.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router-dom/dist/index.js
15371
+ // ../../node_modules/.pnpm/react-router-dom@7.15.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-router-dom/dist/index.js
15086
15372
  var require_dist2 = __commonJS({
15087
- "../../node_modules/.pnpm/react-router-dom@7.14.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router-dom/dist/index.js"(exports$1, module) {
15373
+ "../../node_modules/.pnpm/react-router-dom@7.15.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-router-dom/dist/index.js"(exports, module) {
15088
15374
  var __defProp = Object.defineProperty;
15089
15375
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15090
15376
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -15925,10 +16211,12 @@ function DefaultNavItem({ item, showText, depth, active }) {
15925
16211
  ListItemText2,
15926
16212
  {
15927
16213
  primary: item.title,
15928
- primaryTypographyProps: {
15929
- variant: "body2",
15930
- fontWeight: active ? 600 : 500,
15931
- noWrap: true
16214
+ slotProps: {
16215
+ primary: {
16216
+ variant: "body2",
16217
+ noWrap: true,
16218
+ sx: { fontWeight: active ? 600 : 500 }
16219
+ }
15932
16220
  }
15933
16221
  }
15934
16222
  ),
@@ -16472,12 +16760,12 @@ function SimpleCompactContent({ children, sx }) {
16472
16760
  }
16473
16761
  /*! Bundled license information:
16474
16762
 
16475
- react-router/dist/development/chunk-QFMPRPBF.mjs:
16476
- react-router/dist/development/chunk-2UH5WJXA.mjs:
16763
+ react-router/dist/development/chunk-4N6VE7H7.mjs:
16764
+ react-router/dist/development/chunk-RJYABSBD.mjs:
16477
16765
  react-router/dist/development/dom-export.mjs:
16478
16766
  react-router/dist/development/index.mjs:
16479
16767
  (**
16480
- * react-router v7.14.0
16768
+ * react-router v7.15.1
16481
16769
  *
16482
16770
  * Copyright (c) Remix Software Inc.
16483
16771
  *
@@ -16489,7 +16777,7 @@ react-router/dist/development/index.mjs:
16489
16777
 
16490
16778
  react-router-dom/dist/index.js:
16491
16779
  (**
16492
- * react-router-dom v7.14.0
16780
+ * react-router-dom v7.15.1
16493
16781
  *
16494
16782
  * Copyright (c) Remix Software Inc.
16495
16783
  *
@@ -16501,5 +16789,5 @@ react-router-dom/dist/index.js:
16501
16789
  */
16502
16790
 
16503
16791
  export { AuthCenteredContent, AuthCenteredLayout, AuthSimpleLayout, AuthSplitContent, AuthSplitIllustration, AuthSplitLayout, DEFAULT_LAYOUT_CSS_VARS, DRAWER_WIDTHS, DashboardContent, DashboardLayout, HEADER_HEIGHTS, HeaderSection, HeaderToolbar, LAYOUT_CSS_VARS, LayoutContext, LayoutGlobalStyles, LayoutProvider, LayoutSection, MainSection, MobileSidenav, Sidenav, SimpleCompactContent, defaultLayoutConfig, getBaseLayoutCssVars, getNavColorCssVars, mergeLayoutCssVars, useLayoutConfig, useLayoutContext, useNavActive, useSidenavVisible, useTopnavVisible };
16504
- //# sourceMappingURL=chunk-GYDT5EKX.js.map
16505
- //# sourceMappingURL=chunk-GYDT5EKX.js.map
16792
+ //# sourceMappingURL=chunk-XQXGE2PW.js.map
16793
+ //# sourceMappingURL=chunk-XQXGE2PW.js.map