react-router 7.18.4 → 7.18.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/development/{browser-eq4RgLsD.d.ts → browser-7x6a6gQP.d.ts} +1 -1
- package/dist/development/{browser-BR5QG7ZC.d.mts → browser-CiGxXXOl.d.mts} +1 -1
- package/dist/development/{chunk-LVPI3KDG.js → chunk-3QTLHDUO.js} +7 -7
- package/dist/{production/chunk-G2MPF4YY.mjs → development/chunk-E2PF4K4Z.mjs} +25 -7
- package/dist/development/{chunk-HQO5H5CC.js → chunk-QM7ETCUK.js} +109 -104
- package/dist/development/{chunk-GR4NQCSD.js → chunk-S47XUPN5.js} +133 -66
- package/dist/development/{chunk-OB3PAWPO.mjs → chunk-YDNE64FV.mjs} +135 -64
- package/dist/{production/context-nqAapj74.d.mts → development/context-BlYKn1tE.d.mts} +2 -0
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +2 -2
- package/dist/development/dom-export.js +37 -35
- package/dist/development/dom-export.mjs +6 -4
- package/dist/development/{index-react-server-client-BjY-eKuf.d.ts → index-react-server-client-BaaZU3sM.d.ts} +1 -1
- package/dist/development/{index-react-server-client-K63fpMH4.d.mts → index-react-server-client-KK-TR-t7.d.mts} +1 -1
- package/dist/development/index-react-server-client.d.mts +2 -2
- package/dist/development/index-react-server-client.d.ts +2 -2
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +2 -0
- package/dist/development/index-react-server.d.ts +2 -0
- package/dist/development/index-react-server.js +109 -17
- package/dist/development/index-react-server.mjs +109 -17
- package/dist/development/index.d.mts +7 -7
- package/dist/development/index.d.ts +7 -7
- package/dist/development/index.js +121 -103
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-B7w3_Eo9.d.ts → development/instrumentation-CPkMwccd.d.ts} +2 -0
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/production/{browser-eq4RgLsD.d.ts → browser-7x6a6gQP.d.ts} +1 -1
- package/dist/production/{browser-BR5QG7ZC.d.mts → browser-CiGxXXOl.d.mts} +1 -1
- package/dist/production/{chunk-AOOKMWND.js → chunk-2WUBOUFU.js} +109 -104
- package/dist/production/{chunk-QURBR4FZ.js → chunk-3IBQ4CTZ.js} +7 -7
- package/dist/production/{chunk-YNGRUB6F.js → chunk-AC65NKOP.js} +133 -66
- package/dist/production/{chunk-Q34X6AWR.mjs → chunk-HEAXLYUI.mjs} +135 -64
- package/dist/{development/chunk-H4DAEOV7.mjs → production/chunk-JRCXCPLA.mjs} +25 -7
- package/dist/{development/context-nqAapj74.d.mts → production/context-BlYKn1tE.d.mts} +2 -0
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +2 -2
- package/dist/production/dom-export.js +37 -35
- package/dist/production/dom-export.mjs +6 -4
- package/dist/production/{index-react-server-client-BjY-eKuf.d.ts → index-react-server-client-BaaZU3sM.d.ts} +1 -1
- package/dist/production/{index-react-server-client-K63fpMH4.d.mts → index-react-server-client-KK-TR-t7.d.mts} +1 -1
- package/dist/production/index-react-server-client.d.mts +2 -2
- package/dist/production/index-react-server-client.d.ts +2 -2
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +2 -0
- package/dist/production/index-react-server.d.ts +2 -0
- package/dist/production/index-react-server.js +109 -17
- package/dist/production/index-react-server.mjs +109 -17
- package/dist/production/index.d.mts +7 -7
- package/dist/production/index.d.ts +7 -7
- package/dist/production/index.js +121 -103
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-B7w3_Eo9.d.ts → production/instrumentation-CPkMwccd.d.ts} +2 -0
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/package.json +1 -1
package/dist/production/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
2
|
-
* react-router v7.18.
|
|
2
|
+
* react-router v7.18.6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk3IBQ4CTZjs = require('./chunk-3IBQ4CTZ.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -40,7 +40,7 @@ var _chunkQURBR4FZjs = require('./chunk-QURBR4FZ.js');
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunk2WUBOUFUjs = require('./chunk-2WUBOUFU.js');
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
@@ -155,7 +155,10 @@ var _chunkAOOKMWNDjs = require('./chunk-AOOKMWND.js');
|
|
|
155
155
|
|
|
156
156
|
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
var _chunkAC65NKOPjs = require('./chunk-AC65NKOP.js');
|
|
159
162
|
|
|
160
163
|
// lib/dom/ssr/server.tsx
|
|
161
164
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react);
|
|
@@ -168,7 +171,7 @@ function ServerRouter({
|
|
|
168
171
|
url = new URL(url);
|
|
169
172
|
}
|
|
170
173
|
let { manifest, routeModules, criticalCss, serverHandoffString } = context;
|
|
171
|
-
let routes =
|
|
174
|
+
let routes = _chunkAC65NKOPjs.createServerRoutes.call(void 0,
|
|
172
175
|
manifest.routes,
|
|
173
176
|
routeModules,
|
|
174
177
|
context.future,
|
|
@@ -181,7 +184,7 @@ function ServerRouter({
|
|
|
181
184
|
let routeId = match.route.id;
|
|
182
185
|
let route = routeModules[routeId];
|
|
183
186
|
let manifestRoute = context.manifest.routes[routeId];
|
|
184
|
-
if (route && manifestRoute &&
|
|
187
|
+
if (route && manifestRoute && _chunkAC65NKOPjs.shouldHydrateRouteLoader.call(void 0,
|
|
185
188
|
routeId,
|
|
186
189
|
route.clientLoader,
|
|
187
190
|
manifestRoute.hasLoader,
|
|
@@ -190,11 +193,11 @@ function ServerRouter({
|
|
|
190
193
|
delete context.staticHandlerContext.loaderData[routeId];
|
|
191
194
|
}
|
|
192
195
|
}
|
|
193
|
-
let router =
|
|
196
|
+
let router = _chunk2WUBOUFUjs.createStaticRouter.call(void 0, routes, context.staticHandlerContext, {
|
|
194
197
|
branches: context.branches
|
|
195
198
|
});
|
|
196
199
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
197
|
-
|
|
200
|
+
_chunkAC65NKOPjs.FrameworkContext.Provider,
|
|
198
201
|
{
|
|
199
202
|
value: {
|
|
200
203
|
manifest,
|
|
@@ -210,8 +213,8 @@ function ServerRouter({
|
|
|
210
213
|
renderMeta: context.renderMeta
|
|
211
214
|
}
|
|
212
215
|
},
|
|
213
|
-
/* @__PURE__ */ React.createElement(
|
|
214
|
-
|
|
216
|
+
/* @__PURE__ */ React.createElement(_chunkAC65NKOPjs.RemixErrorBoundary, { location: router.state.location }, /* @__PURE__ */ React.createElement(
|
|
217
|
+
_chunk2WUBOUFUjs.StaticRouterProvider,
|
|
215
218
|
{
|
|
216
219
|
router,
|
|
217
220
|
context: context.staticHandlerContext,
|
|
@@ -219,7 +222,7 @@ function ServerRouter({
|
|
|
219
222
|
}
|
|
220
223
|
))
|
|
221
224
|
), context.serverHandoffStream ? /* @__PURE__ */ React.createElement(React.Suspense, null, /* @__PURE__ */ React.createElement(
|
|
222
|
-
|
|
225
|
+
_chunkAC65NKOPjs.StreamTransfer,
|
|
223
226
|
{
|
|
224
227
|
context,
|
|
225
228
|
identifier: 0,
|
|
@@ -262,18 +265,18 @@ function createRoutesStub(routes, _context) {
|
|
|
262
265
|
let patched = processRoutes(
|
|
263
266
|
// @ts-expect-error `StubRouteObject` is stricter about `loader`/`action`
|
|
264
267
|
// types compared to `RouteObject`
|
|
265
|
-
|
|
266
|
-
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _5 => _5.v8_middleware]) ? new (0,
|
|
268
|
+
_chunkAC65NKOPjs.convertRoutesToDataRoutes.call(void 0, routes, (r) => r),
|
|
269
|
+
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _5 => _5.v8_middleware]) ? new (0, _chunkAC65NKOPjs.RouterContextProvider)() : {},
|
|
267
270
|
frameworkContextRef.current.manifest,
|
|
268
271
|
frameworkContextRef.current.routeModules
|
|
269
272
|
);
|
|
270
|
-
routerRef.current =
|
|
273
|
+
routerRef.current = _chunkAC65NKOPjs.createMemoryRouter.call(void 0, patched, {
|
|
271
274
|
initialEntries,
|
|
272
275
|
initialIndex,
|
|
273
276
|
hydrationData
|
|
274
277
|
});
|
|
275
278
|
}
|
|
276
|
-
return /* @__PURE__ */ React2.createElement(
|
|
279
|
+
return /* @__PURE__ */ React2.createElement(_chunkAC65NKOPjs.FrameworkContext.Provider, { value: frameworkContextRef.current }, /* @__PURE__ */ React2.createElement(_chunkAC65NKOPjs.RouterProvider, { router: routerRef.current }));
|
|
277
280
|
};
|
|
278
281
|
}
|
|
279
282
|
function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
@@ -287,9 +290,9 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
287
290
|
id: route.id,
|
|
288
291
|
path: route.path,
|
|
289
292
|
index: route.index,
|
|
290
|
-
Component: route.Component ?
|
|
291
|
-
HydrateFallback: route.HydrateFallback ?
|
|
292
|
-
ErrorBoundary: route.ErrorBoundary ?
|
|
293
|
+
Component: route.Component ? _chunkAC65NKOPjs.withComponentProps.call(void 0, route.Component) : void 0,
|
|
294
|
+
HydrateFallback: route.HydrateFallback ? _chunkAC65NKOPjs.withHydrateFallbackProps.call(void 0, route.HydrateFallback) : void 0,
|
|
295
|
+
ErrorBoundary: route.ErrorBoundary ? _chunkAC65NKOPjs.withErrorBoundaryProps.call(void 0, route.ErrorBoundary) : void 0,
|
|
293
296
|
action: route.action ? (args) => route.action({ ...args, context }) : void 0,
|
|
294
297
|
loader: route.loader ? (args) => route.loader({ ...args, context }) : void 0,
|
|
295
298
|
middleware: route.middleware ? route.middleware.map(
|
|
@@ -324,7 +327,7 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
324
327
|
};
|
|
325
328
|
manifest.routes[newRoute.id] = entryRoute;
|
|
326
329
|
routeModules[route.id] = {
|
|
327
|
-
default: newRoute.Component ||
|
|
330
|
+
default: newRoute.Component || _chunkAC65NKOPjs.Outlet,
|
|
328
331
|
ErrorBoundary: newRoute.ErrorBoundary || void 0,
|
|
329
332
|
handle: route.handle,
|
|
330
333
|
links: route.links,
|
|
@@ -519,7 +522,7 @@ function myUnescape(value) {
|
|
|
519
522
|
return result;
|
|
520
523
|
}
|
|
521
524
|
function warnOnceAboutExpiresCookie(name, expires) {
|
|
522
|
-
|
|
525
|
+
_chunkAC65NKOPjs.warnOnce.call(void 0,
|
|
523
526
|
!expires,
|
|
524
527
|
`The "${name}" cookie has an "expires" property set. This will cause the expires value to not be updated when the session is committed. Instead, you should set the expires value when serializing the cookie. You can use \`commitSession(session, { expires })\` if using a session storage object, or \`cookie.serialize("value", { expires })\` if you're using the cookie directly.`
|
|
525
528
|
);
|
|
@@ -581,7 +584,7 @@ function invariant2(value, message) {
|
|
|
581
584
|
|
|
582
585
|
// lib/server-runtime/routeMatching.ts
|
|
583
586
|
function matchServerRoutes(manifest, dataRoutes, branches, pathname, basename) {
|
|
584
|
-
let matches =
|
|
587
|
+
let matches = _chunkAC65NKOPjs.matchRoutesImpl.call(void 0,
|
|
585
588
|
dataRoutes,
|
|
586
589
|
pathname,
|
|
587
590
|
_nullishCoalesce(basename, () => ( "/")),
|
|
@@ -612,7 +615,7 @@ async function callRouteHandler(handler, args, future) {
|
|
|
612
615
|
context: args.context,
|
|
613
616
|
pattern: args.pattern
|
|
614
617
|
});
|
|
615
|
-
if (
|
|
618
|
+
if (_chunkAC65NKOPjs.isDataWithResponseInit.call(void 0, result) && result.init && result.init.status && _chunkAC65NKOPjs.isRedirectStatusCode.call(void 0, result.init.status)) {
|
|
616
619
|
throw new Response(null, result.init);
|
|
617
620
|
}
|
|
618
621
|
return result;
|
|
@@ -715,17 +718,17 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
715
718
|
controller.close();
|
|
716
719
|
}
|
|
717
720
|
});
|
|
718
|
-
let decoded = await
|
|
721
|
+
let decoded = await _chunkAC65NKOPjs.decodeViaTurboStream.call(void 0, stream, global);
|
|
719
722
|
let data2 = decoded.value;
|
|
720
|
-
if (data2 &&
|
|
721
|
-
let result = data2[
|
|
723
|
+
if (data2 && _chunkAC65NKOPjs.SingleFetchRedirectSymbol in data2) {
|
|
724
|
+
let result = data2[_chunkAC65NKOPjs.SingleFetchRedirectSymbol];
|
|
722
725
|
let init = { status: result.status };
|
|
723
726
|
if (result.reload) {
|
|
724
|
-
throw
|
|
727
|
+
throw _chunkAC65NKOPjs.redirectDocument.call(void 0, result.redirect, init);
|
|
725
728
|
} else if (result.replace) {
|
|
726
|
-
throw
|
|
729
|
+
throw _chunkAC65NKOPjs.replace.call(void 0, result.redirect, init);
|
|
727
730
|
} else {
|
|
728
|
-
throw
|
|
731
|
+
throw _chunkAC65NKOPjs.redirect.call(void 0, result.redirect, init);
|
|
729
732
|
}
|
|
730
733
|
} else {
|
|
731
734
|
invariant2(
|
|
@@ -768,7 +771,7 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
768
771
|
|
|
769
772
|
// lib/server-runtime/serverHandoff.ts
|
|
770
773
|
function createServerHandoffString(serverHandoff) {
|
|
771
|
-
return
|
|
774
|
+
return _chunkAC65NKOPjs.escapeHtml.call(void 0, JSON.stringify(serverHandoff));
|
|
772
775
|
}
|
|
773
776
|
|
|
774
777
|
// lib/server-runtime/headers.ts
|
|
@@ -927,12 +930,12 @@ function getNormalizedPath(request, basename, future) {
|
|
|
927
930
|
pathname = pathname.replace(/\.data$/, "");
|
|
928
931
|
}
|
|
929
932
|
} else {
|
|
930
|
-
if (
|
|
933
|
+
if (_chunkAC65NKOPjs.stripBasename.call(void 0, pathname, basename) === "/_root.data") {
|
|
931
934
|
pathname = basename;
|
|
932
935
|
} else if (pathname.endsWith(".data")) {
|
|
933
936
|
pathname = pathname.replace(/\.data$/, "");
|
|
934
937
|
}
|
|
935
|
-
if (
|
|
938
|
+
if (_chunkAC65NKOPjs.stripBasename.call(void 0, pathname, basename) !== "/" && pathname.endsWith("/")) {
|
|
936
939
|
pathname = pathname.slice(0, -1);
|
|
937
940
|
}
|
|
938
941
|
}
|
|
@@ -952,7 +955,7 @@ function getNormalizedPath(request, basename, future) {
|
|
|
952
955
|
|
|
953
956
|
// lib/server-runtime/single-fetch.ts
|
|
954
957
|
var SERVER_NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([
|
|
955
|
-
...
|
|
958
|
+
..._chunkAC65NKOPjs.NO_BODY_STATUS_CODES,
|
|
956
959
|
304
|
|
957
960
|
]);
|
|
958
961
|
async function singleFetchAction(build, serverMode, staticHandler, request, handlerUrl, loadContext, handleError) {
|
|
@@ -984,14 +987,16 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
984
987
|
return handleQueryError(error);
|
|
985
988
|
}
|
|
986
989
|
} : void 0,
|
|
987
|
-
|
|
990
|
+
// Normalize the original request because handlerRequest may already have
|
|
991
|
+
// its .data suffix removed when v8_passThroughRequests is disabled.
|
|
992
|
+
normalizePath: () => getNormalizedPath(request, build.basename, build.future)
|
|
988
993
|
});
|
|
989
994
|
return handleQueryResult(result);
|
|
990
995
|
} catch (error) {
|
|
991
996
|
return handleQueryError(error);
|
|
992
997
|
}
|
|
993
998
|
function handleQueryResult(result) {
|
|
994
|
-
return
|
|
999
|
+
return _chunkAC65NKOPjs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
995
1000
|
}
|
|
996
1001
|
function handleQueryError(error, status = 500) {
|
|
997
1002
|
handleError(error);
|
|
@@ -1003,12 +1008,12 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
1003
1008
|
}
|
|
1004
1009
|
function staticContextToResponse(context) {
|
|
1005
1010
|
let headers = getDocumentHeaders(context, build);
|
|
1006
|
-
if (
|
|
1011
|
+
if (_chunkAC65NKOPjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
1007
1012
|
return new Response(null, { status: context.statusCode, headers });
|
|
1008
1013
|
}
|
|
1009
1014
|
if (context.errors) {
|
|
1010
1015
|
Object.values(context.errors).forEach((err) => {
|
|
1011
|
-
if (!
|
|
1016
|
+
if (!_chunkAC65NKOPjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1012
1017
|
handleError(err);
|
|
1013
1018
|
}
|
|
1014
1019
|
});
|
|
@@ -1049,14 +1054,16 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
1049
1054
|
return handleQueryError(error);
|
|
1050
1055
|
}
|
|
1051
1056
|
} : void 0,
|
|
1052
|
-
|
|
1057
|
+
// Normalize the original request because handlerRequest may already have
|
|
1058
|
+
// its .data suffix removed when v8_passThroughRequests is disabled.
|
|
1059
|
+
normalizePath: () => getNormalizedPath(request, build.basename, build.future)
|
|
1053
1060
|
});
|
|
1054
1061
|
return handleQueryResult(result);
|
|
1055
1062
|
} catch (error) {
|
|
1056
1063
|
return handleQueryError(error);
|
|
1057
1064
|
}
|
|
1058
1065
|
function handleQueryResult(result) {
|
|
1059
|
-
return
|
|
1066
|
+
return _chunkAC65NKOPjs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
1060
1067
|
}
|
|
1061
1068
|
function handleQueryError(error) {
|
|
1062
1069
|
handleError(error);
|
|
@@ -1068,12 +1075,12 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
1068
1075
|
}
|
|
1069
1076
|
function staticContextToResponse(context) {
|
|
1070
1077
|
let headers = getDocumentHeaders(context, build);
|
|
1071
|
-
if (
|
|
1078
|
+
if (_chunkAC65NKOPjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
1072
1079
|
return new Response(null, { status: context.statusCode, headers });
|
|
1073
1080
|
}
|
|
1074
1081
|
if (context.errors) {
|
|
1075
1082
|
Object.values(context.errors).forEach((err) => {
|
|
1076
|
-
if (!
|
|
1083
|
+
if (!_chunkAC65NKOPjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1077
1084
|
handleError(err);
|
|
1078
1085
|
}
|
|
1079
1086
|
});
|
|
@@ -1137,15 +1144,15 @@ function generateSingleFetchRedirectResponse(redirectResponse, request, build, s
|
|
|
1137
1144
|
headers.delete("Location");
|
|
1138
1145
|
headers.set("Content-Type", "text/x-script");
|
|
1139
1146
|
return generateSingleFetchResponse(request, build, serverMode, {
|
|
1140
|
-
result: request.method === "GET" ? { [
|
|
1147
|
+
result: request.method === "GET" ? { [_chunkAC65NKOPjs.SingleFetchRedirectSymbol]: redirect2 } : redirect2,
|
|
1141
1148
|
headers,
|
|
1142
|
-
status:
|
|
1149
|
+
status: _chunkAC65NKOPjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
1143
1150
|
});
|
|
1144
1151
|
}
|
|
1145
1152
|
function getSingleFetchRedirect(status, headers, basename) {
|
|
1146
1153
|
let redirect2 = headers.get("Location");
|
|
1147
1154
|
if (basename) {
|
|
1148
|
-
redirect2 =
|
|
1155
|
+
redirect2 = _chunkAC65NKOPjs.stripBasename.call(void 0, redirect2, basename) || redirect2;
|
|
1149
1156
|
}
|
|
1150
1157
|
return {
|
|
1151
1158
|
redirect: redirect2,
|
|
@@ -1182,7 +1189,7 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1182
1189
|
clearTimeout(timeoutId);
|
|
1183
1190
|
requestSignal.removeEventListener("abort", abortControllerOnRequestAbort);
|
|
1184
1191
|
};
|
|
1185
|
-
return
|
|
1192
|
+
return _chunkAC65NKOPjs.encode.call(void 0, data2, {
|
|
1186
1193
|
signal: controller.signal,
|
|
1187
1194
|
onComplete: cleanupCallbacks,
|
|
1188
1195
|
plugins: [
|
|
@@ -1191,12 +1198,12 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1191
1198
|
let { name, message, stack } = serverMode === "production" /* Production */ ? sanitizeError(value, serverMode) : value;
|
|
1192
1199
|
return ["SanitizedError", name, message, stack];
|
|
1193
1200
|
}
|
|
1194
|
-
if (value instanceof
|
|
1201
|
+
if (value instanceof _chunkAC65NKOPjs.ErrorResponseImpl) {
|
|
1195
1202
|
let { data: data3, status, statusText } = value;
|
|
1196
1203
|
return ["ErrorResponse", data3, status, statusText];
|
|
1197
1204
|
}
|
|
1198
|
-
if (value && typeof value === "object" &&
|
|
1199
|
-
return ["SingleFetchRedirect", value[
|
|
1205
|
+
if (value && typeof value === "object" && _chunkAC65NKOPjs.SingleFetchRedirectSymbol in value) {
|
|
1206
|
+
return ["SingleFetchRedirect", value[_chunkAC65NKOPjs.SingleFetchRedirectSymbol]];
|
|
1200
1207
|
}
|
|
1201
1208
|
}
|
|
1202
1209
|
],
|
|
@@ -1218,7 +1225,7 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1218
1225
|
function derive(build, mode) {
|
|
1219
1226
|
let dataRoutes = createStaticHandlerDataRoutes(build.routes, build.future);
|
|
1220
1227
|
let serverMode = isServerMode(mode) ? mode : "production" /* Production */;
|
|
1221
|
-
let staticHandler =
|
|
1228
|
+
let staticHandler = _chunkAC65NKOPjs.createStaticHandler.call(void 0, dataRoutes, {
|
|
1222
1229
|
basename: build.basename,
|
|
1223
1230
|
instrumentations: build.entry.module.instrumentations,
|
|
1224
1231
|
future: build.future
|
|
@@ -1227,7 +1234,7 @@ function derive(build, mode) {
|
|
|
1227
1234
|
if (serverMode !== "test" /* Test */ && !request.signal.aborted) {
|
|
1228
1235
|
console.error(
|
|
1229
1236
|
// @ts-expect-error This is "private" from users but intended for internal use
|
|
1230
|
-
|
|
1237
|
+
_chunkAC65NKOPjs.isRouteErrorResponse.call(void 0, error) && error.error ? error.error : error
|
|
1231
1238
|
);
|
|
1232
1239
|
}
|
|
1233
1240
|
});
|
|
@@ -1245,14 +1252,14 @@ function derive(build, mode) {
|
|
|
1245
1252
|
});
|
|
1246
1253
|
};
|
|
1247
1254
|
if (build.future.v8_middleware) {
|
|
1248
|
-
if (initialContext && !(initialContext instanceof
|
|
1255
|
+
if (initialContext && !(initialContext instanceof _chunkAC65NKOPjs.RouterContextProvider)) {
|
|
1249
1256
|
let error = new Error(
|
|
1250
1257
|
"Invalid `context` value provided to `handleRequest`. When middleware is enabled you must return an instance of `RouterContextProvider` from your `getLoadContext` function."
|
|
1251
1258
|
);
|
|
1252
1259
|
handleError(error);
|
|
1253
1260
|
return returnLastResortErrorResponse(error, serverMode);
|
|
1254
1261
|
}
|
|
1255
|
-
loadContext = initialContext || new (0,
|
|
1262
|
+
loadContext = initialContext || new (0, _chunkAC65NKOPjs.RouterContextProvider)();
|
|
1256
1263
|
} else {
|
|
1257
1264
|
loadContext = initialContext || {};
|
|
1258
1265
|
}
|
|
@@ -1266,10 +1273,10 @@ function derive(build, mode) {
|
|
|
1266
1273
|
if (!build.ssr) {
|
|
1267
1274
|
let decodedPath = decodeURI(normalizedPathname);
|
|
1268
1275
|
if (build.basename && build.basename !== "/") {
|
|
1269
|
-
let strippedPath =
|
|
1276
|
+
let strippedPath = _chunkAC65NKOPjs.stripBasename.call(void 0, decodedPath, build.basename);
|
|
1270
1277
|
if (strippedPath == null) {
|
|
1271
1278
|
errorHandler(
|
|
1272
|
-
new (0,
|
|
1279
|
+
new (0, _chunkAC65NKOPjs.ErrorResponseImpl)(
|
|
1273
1280
|
404,
|
|
1274
1281
|
"Not Found",
|
|
1275
1282
|
`Refusing to prerender the \`${decodedPath}\` path because it does not start with the basename \`${build.basename}\``
|
|
@@ -1292,7 +1299,7 @@ function derive(build, mode) {
|
|
|
1292
1299
|
} else if (!build.prerender.includes(decodedPath.replace(/\/$/, "")) && !build.prerender.includes(decodedPath.replace(/[^/]$/, "/"))) {
|
|
1293
1300
|
if (requestUrl.pathname.endsWith(".data")) {
|
|
1294
1301
|
errorHandler(
|
|
1295
|
-
new (0,
|
|
1302
|
+
new (0, _chunkAC65NKOPjs.ErrorResponseImpl)(
|
|
1296
1303
|
404,
|
|
1297
1304
|
"Not Found",
|
|
1298
1305
|
`Refusing to SSR the path \`${decodedPath}\` because \`ssr:false\` is set and the path is not included in the \`prerender\` config, so in production the path will be a 404.`
|
|
@@ -1312,7 +1319,7 @@ function derive(build, mode) {
|
|
|
1312
1319
|
}
|
|
1313
1320
|
}
|
|
1314
1321
|
}
|
|
1315
|
-
let manifestUrl =
|
|
1322
|
+
let manifestUrl = _chunkAC65NKOPjs.getManifestPath.call(void 0,
|
|
1316
1323
|
build.routeDiscovery.manifestPath,
|
|
1317
1324
|
build.basename
|
|
1318
1325
|
);
|
|
@@ -1351,7 +1358,7 @@ function derive(build, mode) {
|
|
|
1351
1358
|
loadContext,
|
|
1352
1359
|
handleError
|
|
1353
1360
|
);
|
|
1354
|
-
if (
|
|
1361
|
+
if (_chunkAC65NKOPjs.isRedirectResponse.call(void 0, response)) {
|
|
1355
1362
|
response = generateSingleFetchRedirectResponse(
|
|
1356
1363
|
response,
|
|
1357
1364
|
request,
|
|
@@ -1365,7 +1372,7 @@ function derive(build, mode) {
|
|
|
1365
1372
|
params: matches ? matches[0].params : {},
|
|
1366
1373
|
request
|
|
1367
1374
|
});
|
|
1368
|
-
if (
|
|
1375
|
+
if (_chunkAC65NKOPjs.isRedirectResponse.call(void 0, response)) {
|
|
1369
1376
|
response = generateSingleFetchRedirectResponse(
|
|
1370
1377
|
response,
|
|
1371
1378
|
request,
|
|
@@ -1404,6 +1411,8 @@ function derive(build, mode) {
|
|
|
1404
1411
|
);
|
|
1405
1412
|
}
|
|
1406
1413
|
if (request.method === "HEAD") {
|
|
1414
|
+
_optionalChain([response, 'access', _15 => _15.body, 'optionalAccess', _16 => _16.cancel, 'call', _17 => _17(), 'access', _18 => _18.catch, 'call', _19 => _19(() => {
|
|
1415
|
+
})]);
|
|
1407
1416
|
return new Response(null, {
|
|
1408
1417
|
headers: response.headers,
|
|
1409
1418
|
status: response.status,
|
|
@@ -1413,7 +1422,7 @@ function derive(build, mode) {
|
|
|
1413
1422
|
return response;
|
|
1414
1423
|
};
|
|
1415
1424
|
if (build.entry.module.instrumentations) {
|
|
1416
|
-
requestHandler =
|
|
1425
|
+
requestHandler = _chunkAC65NKOPjs.instrumentHandler.call(void 0,
|
|
1417
1426
|
requestHandler,
|
|
1418
1427
|
build.entry.module.instrumentations.map((i) => i.handler).filter(Boolean)
|
|
1419
1428
|
);
|
|
@@ -1450,7 +1459,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1450
1459
|
};
|
|
1451
1460
|
};
|
|
1452
1461
|
async function handleManifestRequest(build, dataRoutes, branches, url) {
|
|
1453
|
-
if (url.toString().length >
|
|
1462
|
+
if (url.toString().length > _chunkAC65NKOPjs.URL_LIMIT) {
|
|
1454
1463
|
return new Response(null, {
|
|
1455
1464
|
statusText: "Bad Request",
|
|
1456
1465
|
status: 400
|
|
@@ -1500,7 +1509,7 @@ async function handleManifestRequest(build, dataRoutes, branches, url) {
|
|
|
1500
1509
|
async function handleSingleFetchRequest(serverMode, build, staticHandler, request, normalizedPath, loadContext, handleError) {
|
|
1501
1510
|
let handlerUrl = new URL(request.url);
|
|
1502
1511
|
handlerUrl.pathname = normalizedPath;
|
|
1503
|
-
let response =
|
|
1512
|
+
let response = _chunkAC65NKOPjs.isMutationMethod.call(void 0, request.method) ? await singleFetchAction(
|
|
1504
1513
|
build,
|
|
1505
1514
|
serverMode,
|
|
1506
1515
|
staticHandler,
|
|
@@ -1521,7 +1530,7 @@ async function handleSingleFetchRequest(serverMode, build, staticHandler, reques
|
|
|
1521
1530
|
}
|
|
1522
1531
|
async function handleDocumentRequest(serverMode, build, staticHandler, request, loadContext, handleError, isSpaMode, criticalCss) {
|
|
1523
1532
|
try {
|
|
1524
|
-
if (
|
|
1533
|
+
if (_chunkAC65NKOPjs.isMutationMethod.call(void 0, request.method)) {
|
|
1525
1534
|
try {
|
|
1526
1535
|
throwIfPotentialCSRFAttack(
|
|
1527
1536
|
request,
|
|
@@ -1537,7 +1546,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1537
1546
|
generateMiddlewareResponse: build.future.v8_middleware ? async (query) => {
|
|
1538
1547
|
try {
|
|
1539
1548
|
let innerResult = await query(request);
|
|
1540
|
-
if (!
|
|
1549
|
+
if (!_chunkAC65NKOPjs.isResponse.call(void 0, innerResult)) {
|
|
1541
1550
|
innerResult = await renderHtml(innerResult, isSpaMode);
|
|
1542
1551
|
}
|
|
1543
1552
|
return innerResult;
|
|
@@ -1548,7 +1557,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1548
1557
|
} : void 0,
|
|
1549
1558
|
normalizePath: (r) => getNormalizedPath(r, build.basename, build.future)
|
|
1550
1559
|
});
|
|
1551
|
-
if (!
|
|
1560
|
+
if (!_chunkAC65NKOPjs.isResponse.call(void 0, result)) {
|
|
1552
1561
|
result = await renderHtml(result, isSpaMode);
|
|
1553
1562
|
}
|
|
1554
1563
|
return result;
|
|
@@ -1563,7 +1572,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1563
1572
|
}
|
|
1564
1573
|
if (context.errors) {
|
|
1565
1574
|
Object.values(context.errors).forEach((err) => {
|
|
1566
|
-
if (!
|
|
1575
|
+
if (!_chunkAC65NKOPjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1567
1576
|
handleError(err);
|
|
1568
1577
|
}
|
|
1569
1578
|
});
|
|
@@ -1574,10 +1583,17 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1574
1583
|
actionData: context.actionData,
|
|
1575
1584
|
errors: context.errors
|
|
1576
1585
|
};
|
|
1586
|
+
let routeDiscovery = build.routeDiscovery;
|
|
1587
|
+
if (_chunkAC65NKOPjs.isFogOfWarEnabled.call(void 0, routeDiscovery, build.ssr) && _chunkAC65NKOPjs.shouldUseInitialRouteDiscovery.call(void 0,
|
|
1588
|
+
context.location.pathname,
|
|
1589
|
+
staticHandler._matchCost
|
|
1590
|
+
)) {
|
|
1591
|
+
routeDiscovery = { ...routeDiscovery, mode: "initial" };
|
|
1592
|
+
}
|
|
1577
1593
|
let baseServerHandoff = {
|
|
1578
1594
|
basename: build.basename,
|
|
1579
1595
|
future: build.future,
|
|
1580
|
-
routeDiscovery
|
|
1596
|
+
routeDiscovery,
|
|
1581
1597
|
ssr: build.ssr,
|
|
1582
1598
|
isSpaMode: isSpaMode2
|
|
1583
1599
|
};
|
|
@@ -1600,7 +1616,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1600
1616
|
renderMeta: {},
|
|
1601
1617
|
future: build.future,
|
|
1602
1618
|
ssr: build.ssr,
|
|
1603
|
-
routeDiscovery
|
|
1619
|
+
routeDiscovery,
|
|
1604
1620
|
isSpaMode: isSpaMode2,
|
|
1605
1621
|
serializeError: (err) => serializeError(err, serverMode)
|
|
1606
1622
|
};
|
|
@@ -1616,10 +1632,10 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1616
1632
|
} catch (error) {
|
|
1617
1633
|
handleError(error);
|
|
1618
1634
|
let errorForSecondRender = error;
|
|
1619
|
-
if (
|
|
1635
|
+
if (_chunkAC65NKOPjs.isResponse.call(void 0, error)) {
|
|
1620
1636
|
try {
|
|
1621
1637
|
let data2 = await unwrapResponse(error);
|
|
1622
|
-
errorForSecondRender = new (0,
|
|
1638
|
+
errorForSecondRender = new (0, _chunkAC65NKOPjs.ErrorResponseImpl)(
|
|
1623
1639
|
error.status,
|
|
1624
1640
|
error.statusText,
|
|
1625
1641
|
data2
|
|
@@ -1627,7 +1643,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1627
1643
|
} catch (e) {
|
|
1628
1644
|
}
|
|
1629
1645
|
}
|
|
1630
|
-
context =
|
|
1646
|
+
context = _chunkAC65NKOPjs.getStaticContextFromError.call(void 0,
|
|
1631
1647
|
staticHandler.dataRoutes,
|
|
1632
1648
|
context,
|
|
1633
1649
|
errorForSecondRender
|
|
@@ -1687,7 +1703,7 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1687
1703
|
return handleQueryRouteError(error);
|
|
1688
1704
|
}
|
|
1689
1705
|
function handleQueryRouteResult(result) {
|
|
1690
|
-
if (
|
|
1706
|
+
if (_chunkAC65NKOPjs.isResponse.call(void 0, result)) {
|
|
1691
1707
|
return result;
|
|
1692
1708
|
}
|
|
1693
1709
|
if (typeof result === "string") {
|
|
@@ -1696,10 +1712,10 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1696
1712
|
return Response.json(result);
|
|
1697
1713
|
}
|
|
1698
1714
|
function handleQueryRouteError(error) {
|
|
1699
|
-
if (
|
|
1715
|
+
if (_chunkAC65NKOPjs.isResponse.call(void 0, error)) {
|
|
1700
1716
|
return error;
|
|
1701
1717
|
}
|
|
1702
|
-
if (
|
|
1718
|
+
if (_chunkAC65NKOPjs.isRouteErrorResponse.call(void 0, error)) {
|
|
1703
1719
|
handleError(error);
|
|
1704
1720
|
return errorResponseToJson(error, serverMode);
|
|
1705
1721
|
}
|
|
@@ -1793,7 +1809,7 @@ function createSessionStorage({
|
|
|
1793
1809
|
updateData,
|
|
1794
1810
|
deleteData
|
|
1795
1811
|
}) {
|
|
1796
|
-
let cookie = isCookie(cookieArg) ? cookieArg : createCookie(_optionalChain([cookieArg, 'optionalAccess',
|
|
1812
|
+
let cookie = isCookie(cookieArg) ? cookieArg : createCookie(_optionalChain([cookieArg, 'optionalAccess', _20 => _20.name]) || "__session", cookieArg);
|
|
1797
1813
|
warnOnceAboutSigningSessionCookie(cookie);
|
|
1798
1814
|
return {
|
|
1799
1815
|
async getSession(cookieHeader, options) {
|
|
@@ -1803,7 +1819,7 @@ function createSessionStorage({
|
|
|
1803
1819
|
},
|
|
1804
1820
|
async commitSession(session, options) {
|
|
1805
1821
|
let { id, data: data2 } = session;
|
|
1806
|
-
let expires = _optionalChain([options, 'optionalAccess',
|
|
1822
|
+
let expires = _optionalChain([options, 'optionalAccess', _21 => _21.maxAge]) != null ? new Date(Date.now() + options.maxAge * 1e3) : _optionalChain([options, 'optionalAccess', _22 => _22.expires]) != null ? options.expires : cookie.expires;
|
|
1807
1823
|
if (id) {
|
|
1808
1824
|
await updateData(id, data2, expires);
|
|
1809
1825
|
} else {
|
|
@@ -1822,7 +1838,7 @@ function createSessionStorage({
|
|
|
1822
1838
|
};
|
|
1823
1839
|
}
|
|
1824
1840
|
function warnOnceAboutSigningSessionCookie(cookie) {
|
|
1825
|
-
|
|
1841
|
+
_chunkAC65NKOPjs.warnOnce.call(void 0,
|
|
1826
1842
|
cookie.isSigned,
|
|
1827
1843
|
`The "${cookie.name}" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies for more information.`
|
|
1828
1844
|
);
|
|
@@ -1830,7 +1846,7 @@ function warnOnceAboutSigningSessionCookie(cookie) {
|
|
|
1830
1846
|
|
|
1831
1847
|
// lib/server-runtime/sessions/cookieStorage.ts
|
|
1832
1848
|
function createCookieSessionStorage({ cookie: cookieArg } = {}) {
|
|
1833
|
-
let cookie = isCookie(cookieArg) ? cookieArg : createCookie(_optionalChain([cookieArg, 'optionalAccess',
|
|
1849
|
+
let cookie = isCookie(cookieArg) ? cookieArg : createCookie(_optionalChain([cookieArg, 'optionalAccess', _23 => _23.name]) || "__session", cookieArg);
|
|
1834
1850
|
warnOnceAboutSigningSessionCookie(cookie);
|
|
1835
1851
|
return {
|
|
1836
1852
|
async getSession(cookieHeader, options) {
|
|
@@ -1894,7 +1910,7 @@ function href(path, ...args) {
|
|
|
1894
1910
|
// same regex as in .\router\utils.ts: compilePath().
|
|
1895
1911
|
(_, param, questionMark) => {
|
|
1896
1912
|
const isRequired = questionMark === void 0;
|
|
1897
|
-
const value = _optionalChain([params, 'optionalAccess',
|
|
1913
|
+
const value = _optionalChain([params, 'optionalAccess', _24 => _24[param]]);
|
|
1898
1914
|
if (isRequired && value === void 0) {
|
|
1899
1915
|
throw new Error(
|
|
1900
1916
|
`Path '${path}' requires param '${param}' but it was not provided`
|
|
@@ -1904,12 +1920,14 @@ function href(path, ...args) {
|
|
|
1904
1920
|
}
|
|
1905
1921
|
);
|
|
1906
1922
|
if (path.endsWith("*")) {
|
|
1907
|
-
const value = _optionalChain([params, 'optionalAccess',
|
|
1923
|
+
const value = _optionalChain([params, 'optionalAccess', _25 => _25["*"]]);
|
|
1908
1924
|
if (value !== void 0) {
|
|
1909
1925
|
result += "/" + value;
|
|
1910
1926
|
}
|
|
1911
1927
|
}
|
|
1912
|
-
|
|
1928
|
+
result = result.replace(/^[\\/]{2,}/, "/") || "/";
|
|
1929
|
+
_chunkAC65NKOPjs.validateDocumentNavigationTarget.call(void 0, result);
|
|
1930
|
+
return result;
|
|
1913
1931
|
}
|
|
1914
1932
|
function trimTrailingSplat(path) {
|
|
1915
1933
|
let i = path.length - 1;
|
|
@@ -2103,8 +2121,8 @@ async function routeRSCServerRequest({
|
|
|
2103
2121
|
const payload = await createFromReadableStream(
|
|
2104
2122
|
detectRedirectResponse.body
|
|
2105
2123
|
);
|
|
2106
|
-
if (serverResponse.status ===
|
|
2107
|
-
if (
|
|
2124
|
+
if (serverResponse.status === _chunkAC65NKOPjs.SINGLE_FETCH_REDIRECT_STATUS && payload.type === "redirect") {
|
|
2125
|
+
if (_chunkAC65NKOPjs.hasInvalidProtocol.call(void 0, payload.location)) {
|
|
2108
2126
|
throw new Error("Invalid redirect location");
|
|
2109
2127
|
}
|
|
2110
2128
|
const headers2 = new Headers(serverResponse.headers);
|
|
@@ -2113,7 +2131,7 @@ async function routeRSCServerRequest({
|
|
|
2113
2131
|
headers2.delete("Content-Type");
|
|
2114
2132
|
headers2.delete("X-Remix-Response");
|
|
2115
2133
|
headers2.set("Location", payload.location);
|
|
2116
|
-
return new Response(_optionalChain([serverResponseB, 'optionalAccess',
|
|
2134
|
+
return new Response(_optionalChain([serverResponseB, 'optionalAccess', _26 => _26.body]) || "", {
|
|
2117
2135
|
headers: headers2,
|
|
2118
2136
|
status: payload.status,
|
|
2119
2137
|
statusText: serverResponse.statusText
|
|
@@ -2125,11 +2143,11 @@ async function routeRSCServerRequest({
|
|
|
2125
2143
|
let html = await renderHTML(getPayload, {
|
|
2126
2144
|
onError(error) {
|
|
2127
2145
|
if (typeof error === "object" && error && "digest" in error && typeof error.digest === "string") {
|
|
2128
|
-
renderRedirect =
|
|
2146
|
+
renderRedirect = _chunkAC65NKOPjs.decodeRedirectErrorDigest.call(void 0, error.digest);
|
|
2129
2147
|
if (renderRedirect) {
|
|
2130
2148
|
return error.digest;
|
|
2131
2149
|
}
|
|
2132
|
-
let routeErrorResponse =
|
|
2150
|
+
let routeErrorResponse = _chunkAC65NKOPjs.decodeRouteErrorResponseDigest.call(void 0, error.digest);
|
|
2133
2151
|
if (routeErrorResponse) {
|
|
2134
2152
|
renderError = routeErrorResponse;
|
|
2135
2153
|
status = routeErrorResponse.status;
|
|
@@ -2150,7 +2168,7 @@ async function routeRSCServerRequest({
|
|
|
2150
2168
|
}
|
|
2151
2169
|
headers.set("Content-Type", "text/html; charset=utf-8");
|
|
2152
2170
|
if (renderRedirect) {
|
|
2153
|
-
if (
|
|
2171
|
+
if (_chunkAC65NKOPjs.hasInvalidProtocol.call(void 0, renderRedirect.location)) {
|
|
2154
2172
|
throw new Error("Invalid redirect location");
|
|
2155
2173
|
}
|
|
2156
2174
|
headers.set("Location", renderRedirect.location);
|
|
@@ -2162,12 +2180,12 @@ async function routeRSCServerRequest({
|
|
|
2162
2180
|
const redirectTransform = new TransformStream({
|
|
2163
2181
|
flush(controller) {
|
|
2164
2182
|
if (renderRedirect) {
|
|
2165
|
-
if (
|
|
2183
|
+
if (_chunkAC65NKOPjs.hasInvalidProtocol.call(void 0, renderRedirect.location)) {
|
|
2166
2184
|
return;
|
|
2167
2185
|
}
|
|
2168
2186
|
controller.enqueue(
|
|
2169
2187
|
new TextEncoder().encode(
|
|
2170
|
-
`<meta http-equiv="refresh" content="0;url=${
|
|
2188
|
+
`<meta http-equiv="refresh" content="0;url=${_chunkAC65NKOPjs.escapeAttribute.call(void 0, renderRedirect.location)}"/>`
|
|
2171
2189
|
)
|
|
2172
2190
|
);
|
|
2173
2191
|
}
|
|
@@ -2180,7 +2198,7 @@ async function routeRSCServerRequest({
|
|
|
2180
2198
|
headers
|
|
2181
2199
|
});
|
|
2182
2200
|
}
|
|
2183
|
-
if (!_optionalChain([serverResponseB, 'optionalAccess',
|
|
2201
|
+
if (!_optionalChain([serverResponseB, 'optionalAccess', _27 => _27.body])) {
|
|
2184
2202
|
throw new Error("Failed to clone server response");
|
|
2185
2203
|
}
|
|
2186
2204
|
const body2 = html.pipeThrough(injectRSCPayload(serverResponseB.body)).pipeThrough(redirectTransform);
|
|
@@ -2194,7 +2212,7 @@ async function routeRSCServerRequest({
|
|
|
2194
2212
|
return error;
|
|
2195
2213
|
}
|
|
2196
2214
|
if (renderRedirect) {
|
|
2197
|
-
if (
|
|
2215
|
+
if (_chunkAC65NKOPjs.hasInvalidProtocol.call(void 0, renderRedirect.location)) {
|
|
2198
2216
|
throw new Error("Invalid redirect location");
|
|
2199
2217
|
}
|
|
2200
2218
|
return new Response(`Redirect: ${renderRedirect.location}`, {
|
|
@@ -2206,7 +2224,7 @@ async function routeRSCServerRequest({
|
|
|
2206
2224
|
}
|
|
2207
2225
|
try {
|
|
2208
2226
|
let normalizedError = _nullishCoalesce(renderError, () => ( error));
|
|
2209
|
-
let [status, statusText] =
|
|
2227
|
+
let [status, statusText] = _chunkAC65NKOPjs.isRouteErrorResponse.call(void 0, normalizedError) ? [normalizedError.status, normalizedError.statusText] : [500, ""];
|
|
2210
2228
|
let retryRedirect;
|
|
2211
2229
|
let reactHeaders = new Headers();
|
|
2212
2230
|
const html = await renderHTML(
|
|
@@ -2243,11 +2261,11 @@ async function routeRSCServerRequest({
|
|
|
2243
2261
|
{
|
|
2244
2262
|
onError(error2) {
|
|
2245
2263
|
if (typeof error2 === "object" && error2 && "digest" in error2 && typeof error2.digest === "string") {
|
|
2246
|
-
retryRedirect =
|
|
2264
|
+
retryRedirect = _chunkAC65NKOPjs.decodeRedirectErrorDigest.call(void 0, error2.digest);
|
|
2247
2265
|
if (retryRedirect) {
|
|
2248
2266
|
return error2.digest;
|
|
2249
2267
|
}
|
|
2250
|
-
let routeErrorResponse =
|
|
2268
|
+
let routeErrorResponse = _chunkAC65NKOPjs.decodeRouteErrorResponseDigest.call(void 0,
|
|
2251
2269
|
error2.digest
|
|
2252
2270
|
);
|
|
2253
2271
|
if (routeErrorResponse) {
|
|
@@ -2270,7 +2288,7 @@ async function routeRSCServerRequest({
|
|
|
2270
2288
|
}
|
|
2271
2289
|
headers.set("Content-Type", "text/html; charset=utf-8");
|
|
2272
2290
|
if (retryRedirect) {
|
|
2273
|
-
if (
|
|
2291
|
+
if (_chunkAC65NKOPjs.hasInvalidProtocol.call(void 0, retryRedirect.location)) {
|
|
2274
2292
|
throw new Error("Invalid redirect location");
|
|
2275
2293
|
}
|
|
2276
2294
|
headers.set("Location", retryRedirect.location);
|
|
@@ -2282,12 +2300,12 @@ async function routeRSCServerRequest({
|
|
|
2282
2300
|
const retryRedirectTransform = new TransformStream({
|
|
2283
2301
|
flush(controller) {
|
|
2284
2302
|
if (retryRedirect) {
|
|
2285
|
-
if (
|
|
2303
|
+
if (_chunkAC65NKOPjs.hasInvalidProtocol.call(void 0, retryRedirect.location)) {
|
|
2286
2304
|
return;
|
|
2287
2305
|
}
|
|
2288
2306
|
controller.enqueue(
|
|
2289
2307
|
new TextEncoder().encode(
|
|
2290
|
-
`<meta http-equiv="refresh" content="0;url=${
|
|
2308
|
+
`<meta http-equiv="refresh" content="0;url=${_chunkAC65NKOPjs.escapeAttribute.call(void 0, retryRedirect.location)}"/>`
|
|
2291
2309
|
)
|
|
2292
2310
|
);
|
|
2293
2311
|
}
|
|
@@ -2300,7 +2318,7 @@ async function routeRSCServerRequest({
|
|
|
2300
2318
|
headers
|
|
2301
2319
|
});
|
|
2302
2320
|
}
|
|
2303
|
-
if (!_optionalChain([serverResponseB, 'optionalAccess',
|
|
2321
|
+
if (!_optionalChain([serverResponseB, 'optionalAccess', _28 => _28.body])) {
|
|
2304
2322
|
throw new Error("Failed to clone server response");
|
|
2305
2323
|
}
|
|
2306
2324
|
const body2 = html.pipeThrough(injectRSCPayload(serverResponseB.body)).pipeThrough(retryRedirectTransform);
|
|
@@ -2318,7 +2336,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2318
2336
|
const decoded = getPayload();
|
|
2319
2337
|
const payload = useSafe(decoded);
|
|
2320
2338
|
if (payload.type === "redirect") {
|
|
2321
|
-
if (
|
|
2339
|
+
if (_chunkAC65NKOPjs.hasInvalidProtocol.call(void 0, payload.location)) {
|
|
2322
2340
|
throw new Error("Invalid redirect location");
|
|
2323
2341
|
}
|
|
2324
2342
|
throw new Response(null, {
|
|
@@ -2331,7 +2349,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2331
2349
|
if (payload.type !== "render") return null;
|
|
2332
2350
|
let patchedLoaderData = { ...payload.loaderData };
|
|
2333
2351
|
for (const match of payload.matches) {
|
|
2334
|
-
if (
|
|
2352
|
+
if (_chunkAC65NKOPjs.shouldHydrateRouteLoader.call(void 0,
|
|
2335
2353
|
match.id,
|
|
2336
2354
|
match.clientLoader,
|
|
2337
2355
|
match.hasLoader,
|
|
@@ -2371,7 +2389,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2371
2389
|
}
|
|
2372
2390
|
}))
|
|
2373
2391
|
};
|
|
2374
|
-
const router =
|
|
2392
|
+
const router = _chunk2WUBOUFUjs.createStaticRouter.call(void 0,
|
|
2375
2393
|
payload.matches.reduceRight((previous, match) => {
|
|
2376
2394
|
const route = {
|
|
2377
2395
|
id: match.id,
|
|
@@ -2419,10 +2437,10 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2419
2437
|
mode: "lazy",
|
|
2420
2438
|
manifestPath: payload.routeDiscovery.manifestPath || defaultManifestPath
|
|
2421
2439
|
},
|
|
2422
|
-
routeModules:
|
|
2440
|
+
routeModules: _chunk3IBQ4CTZjs.createRSCRouteModules.call(void 0, payload)
|
|
2423
2441
|
};
|
|
2424
|
-
return /* @__PURE__ */ React3.createElement(
|
|
2425
|
-
|
|
2442
|
+
return /* @__PURE__ */ React3.createElement(_chunkAC65NKOPjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunk3IBQ4CTZjs.RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React3.createElement(_chunkAC65NKOPjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
|
|
2443
|
+
_chunk2WUBOUFUjs.StaticRouterProvider,
|
|
2426
2444
|
{
|
|
2427
2445
|
context,
|
|
2428
2446
|
router,
|
|
@@ -2567,4 +2585,4 @@ function isManifestRequest(url) {
|
|
|
2567
2585
|
|
|
2568
2586
|
|
|
2569
2587
|
|
|
2570
|
-
exports.Await =
|
|
2588
|
+
exports.Await = _chunkAC65NKOPjs.Await; exports.BrowserRouter = _chunk2WUBOUFUjs.BrowserRouter; exports.Form = _chunk2WUBOUFUjs.Form; exports.HashRouter = _chunk2WUBOUFUjs.HashRouter; exports.IDLE_BLOCKER = _chunkAC65NKOPjs.IDLE_BLOCKER; exports.IDLE_FETCHER = _chunkAC65NKOPjs.IDLE_FETCHER; exports.IDLE_NAVIGATION = _chunkAC65NKOPjs.IDLE_NAVIGATION; exports.Link = _chunk2WUBOUFUjs.Link; exports.Links = _chunkAC65NKOPjs.Links; exports.MemoryRouter = _chunkAC65NKOPjs.MemoryRouter; exports.Meta = _chunkAC65NKOPjs.Meta; exports.NavLink = _chunk2WUBOUFUjs.NavLink; exports.Navigate = _chunkAC65NKOPjs.Navigate; exports.NavigationType = _chunkAC65NKOPjs.Action; exports.Outlet = _chunkAC65NKOPjs.Outlet; exports.PrefetchPageLinks = _chunkAC65NKOPjs.PrefetchPageLinks; exports.Route = _chunkAC65NKOPjs.Route; exports.Router = _chunkAC65NKOPjs.Router; exports.RouterContextProvider = _chunkAC65NKOPjs.RouterContextProvider; exports.RouterProvider = _chunkAC65NKOPjs.RouterProvider; exports.Routes = _chunkAC65NKOPjs.Routes; exports.Scripts = _chunkAC65NKOPjs.Scripts; exports.ScrollRestoration = _chunk2WUBOUFUjs.ScrollRestoration; exports.ServerRouter = ServerRouter; exports.StaticRouter = _chunk2WUBOUFUjs.StaticRouter; exports.StaticRouterProvider = _chunk2WUBOUFUjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunkAC65NKOPjs.AwaitContextProvider; exports.UNSAFE_DataRouterContext = _chunkAC65NKOPjs.DataRouterContext; exports.UNSAFE_DataRouterStateContext = _chunkAC65NKOPjs.DataRouterStateContext; exports.UNSAFE_ErrorResponseImpl = _chunkAC65NKOPjs.ErrorResponseImpl; exports.UNSAFE_FetchersContext = _chunkAC65NKOPjs.FetchersContext; exports.UNSAFE_FrameworkContext = _chunkAC65NKOPjs.FrameworkContext; exports.UNSAFE_LocationContext = _chunkAC65NKOPjs.LocationContext; exports.UNSAFE_NavigationContext = _chunkAC65NKOPjs.NavigationContext; exports.UNSAFE_RSCDefaultRootErrorBoundary = _chunk3IBQ4CTZjs.RSCDefaultRootErrorBoundary; exports.UNSAFE_RemixErrorBoundary = _chunkAC65NKOPjs.RemixErrorBoundary; exports.UNSAFE_RouteContext = _chunkAC65NKOPjs.RouteContext; exports.UNSAFE_ServerMode = ServerMode; exports.UNSAFE_SingleFetchRedirectSymbol = _chunkAC65NKOPjs.SingleFetchRedirectSymbol; exports.UNSAFE_ViewTransitionContext = _chunkAC65NKOPjs.ViewTransitionContext; exports.UNSAFE_WithComponentProps = _chunkAC65NKOPjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkAC65NKOPjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkAC65NKOPjs.WithHydrateFallbackProps; exports.UNSAFE_createBrowserHistory = _chunkAC65NKOPjs.createBrowserHistory; exports.UNSAFE_createClientRoutes = _chunkAC65NKOPjs.createClientRoutes; exports.UNSAFE_createClientRoutesWithHMRRevalidationOptOut = _chunkAC65NKOPjs.createClientRoutesWithHMRRevalidationOptOut; exports.UNSAFE_createHashHistory = _chunkAC65NKOPjs.createHashHistory; exports.UNSAFE_createMemoryHistory = _chunkAC65NKOPjs.createMemoryHistory; exports.UNSAFE_createRouter = _chunkAC65NKOPjs.createRouter; exports.UNSAFE_decodeViaTurboStream = _chunkAC65NKOPjs.decodeViaTurboStream; exports.UNSAFE_getHydrationData = _chunk3IBQ4CTZjs.getHydrationData; exports.UNSAFE_getPatchRoutesOnNavigationFunction = _chunkAC65NKOPjs.getPatchRoutesOnNavigationFunction; exports.UNSAFE_getTurboStreamSingleFetchDataStrategy = _chunkAC65NKOPjs.getTurboStreamSingleFetchDataStrategy; exports.UNSAFE_hydrationRouteProperties = _chunkAC65NKOPjs.hydrationRouteProperties; exports.UNSAFE_invariant = _chunkAC65NKOPjs.invariant; exports.UNSAFE_mapRouteProperties = _chunkAC65NKOPjs.mapRouteProperties; exports.UNSAFE_shouldHydrateRouteLoader = _chunkAC65NKOPjs.shouldHydrateRouteLoader; exports.UNSAFE_useFogOFWarDiscovery = _chunkAC65NKOPjs.useFogOFWarDiscovery; exports.UNSAFE_useScrollRestoration = _chunk2WUBOUFUjs.useScrollRestoration; exports.UNSAFE_withComponentProps = _chunkAC65NKOPjs.withComponentProps; exports.UNSAFE_withErrorBoundaryProps = _chunkAC65NKOPjs.withErrorBoundaryProps; exports.UNSAFE_withHydrateFallbackProps = _chunkAC65NKOPjs.withHydrateFallbackProps; exports.createBrowserRouter = _chunk2WUBOUFUjs.createBrowserRouter; exports.createContext = _chunkAC65NKOPjs.createContext; exports.createCookie = createCookie; exports.createCookieSessionStorage = createCookieSessionStorage; exports.createHashRouter = _chunk2WUBOUFUjs.createHashRouter; exports.createMemoryRouter = _chunkAC65NKOPjs.createMemoryRouter; exports.createMemorySessionStorage = createMemorySessionStorage; exports.createPath = _chunkAC65NKOPjs.createPath; exports.createRequestHandler = createRequestHandler; exports.createRoutesFromChildren = _chunkAC65NKOPjs.createRoutesFromChildren; exports.createRoutesFromElements = _chunkAC65NKOPjs.createRoutesFromElements; exports.createRoutesStub = createRoutesStub; exports.createSearchParams = _chunk2WUBOUFUjs.createSearchParams; exports.createSession = createSession; exports.createSessionStorage = createSessionStorage; exports.createStaticHandler = _chunk2WUBOUFUjs.createStaticHandler; exports.createStaticRouter = _chunk2WUBOUFUjs.createStaticRouter; exports.data = _chunkAC65NKOPjs.data; exports.generatePath = _chunkAC65NKOPjs.generatePath; exports.href = href; exports.isCookie = isCookie; exports.isRouteErrorResponse = _chunkAC65NKOPjs.isRouteErrorResponse; exports.isSession = isSession; exports.matchPath = _chunkAC65NKOPjs.matchPath; exports.matchRoutes = _chunkAC65NKOPjs.matchRoutes; exports.parsePath = _chunkAC65NKOPjs.parsePath; exports.redirect = _chunkAC65NKOPjs.redirect; exports.redirectDocument = _chunkAC65NKOPjs.redirectDocument; exports.renderMatches = _chunkAC65NKOPjs.renderMatches; exports.replace = _chunkAC65NKOPjs.replace; exports.resolvePath = _chunkAC65NKOPjs.resolvePath; exports.unstable_HistoryRouter = _chunk2WUBOUFUjs.HistoryRouter; exports.unstable_RSCStaticRouter = RSCStaticRouter; exports.unstable_routeRSCServerRequest = routeRSCServerRequest; exports.unstable_setDevServerHooks = setDevServerHooks; exports.unstable_usePrompt = _chunk2WUBOUFUjs.usePrompt; exports.unstable_useRoute = _chunkAC65NKOPjs.useRoute; exports.unstable_useRouterState = _chunkAC65NKOPjs.useRouterState; exports.useActionData = _chunkAC65NKOPjs.useActionData; exports.useAsyncError = _chunkAC65NKOPjs.useAsyncError; exports.useAsyncValue = _chunkAC65NKOPjs.useAsyncValue; exports.useBeforeUnload = _chunk2WUBOUFUjs.useBeforeUnload; exports.useBlocker = _chunkAC65NKOPjs.useBlocker; exports.useFetcher = _chunk2WUBOUFUjs.useFetcher; exports.useFetchers = _chunk2WUBOUFUjs.useFetchers; exports.useFormAction = _chunk2WUBOUFUjs.useFormAction; exports.useHref = _chunkAC65NKOPjs.useHref; exports.useInRouterContext = _chunkAC65NKOPjs.useInRouterContext; exports.useLinkClickHandler = _chunk2WUBOUFUjs.useLinkClickHandler; exports.useLoaderData = _chunkAC65NKOPjs.useLoaderData; exports.useLocation = _chunkAC65NKOPjs.useLocation; exports.useMatch = _chunkAC65NKOPjs.useMatch; exports.useMatches = _chunkAC65NKOPjs.useMatches; exports.useNavigate = _chunkAC65NKOPjs.useNavigate; exports.useNavigation = _chunkAC65NKOPjs.useNavigation; exports.useNavigationType = _chunkAC65NKOPjs.useNavigationType; exports.useOutlet = _chunkAC65NKOPjs.useOutlet; exports.useOutletContext = _chunkAC65NKOPjs.useOutletContext; exports.useParams = _chunkAC65NKOPjs.useParams; exports.useResolvedPath = _chunkAC65NKOPjs.useResolvedPath; exports.useRevalidator = _chunkAC65NKOPjs.useRevalidator; exports.useRouteError = _chunkAC65NKOPjs.useRouteError; exports.useRouteLoaderData = _chunkAC65NKOPjs.useRouteLoaderData; exports.useRoutes = _chunkAC65NKOPjs.useRoutes; exports.useSearchParams = _chunk2WUBOUFUjs.useSearchParams; exports.useSubmit = _chunk2WUBOUFUjs.useSubmit; exports.useViewTransitionState = _chunk2WUBOUFUjs.useViewTransitionState;
|