/opt/canhelp/node_modules/next/dist/client
NameSizeModeActions
app-dir/-0755rm
compat/-0755rm
components/-0755rm
dev/-0755rm
legacy/-0755rm
lib/-0755rm
portal/-0755rm
react-client-callbacks/-0755rm
request/-0755rm
tracing/-0755rm
add-base-path.d.ts790644editdlrm
add-base-path.js10100644editdlrm
add-base-path.js.map9730644editdlrm
add-locale.d.ts1210644editdlrm
add-locale.js10520644editdlrm
add-locale.js.map9000644editdlrm
app-bootstrap.d.ts2850644editdlrm
app-bootstrap.js27710644editdlrm
app-bootstrap.js.map39670644editdlrm
app-build-id.d.ts1110644editdlrm
app-build-id.js17670644editdlrm
app-build-id.js.map14610644editdlrm
app-call-server.d.ts910644editdlrm
app-call-server.js11640644editdlrm
app-call-server.js.map10170644editdlrm
app-find-source-map-url.d.ts900644editdlrm
app-find-source-map-url.js16620644editdlrm
app-find-source-map-url.js.map20920644editdlrm
app-globals.d.ts450644editdlrm
app-globals.js7080644editdlrm
app-globals.js.map5910644editdlrm
app-index.d.ts6250644editdlrm
app-index.js114290644editdlrm
app-index.js.map170630644editdlrm
app-link-gc.d.ts400644editdlrm
app-link-gc.js45430644editdlrm
app-link-gc.js.map51630644editdlrm
app-next-dev.d.ts240644editdlrm
app-next-dev.js12140644editdlrm
app-next-dev.js.map11980644editdlrm
app-next-turbopack.d.ts110644editdlrm
app-next-turbopack.js12910644editdlrm
app-next-turbopack.js.map16590644editdlrm
app-next.d.ts240644editdlrm
app-next.js12840644editdlrm
app-next.js.map12490644editdlrm
app-webpack.d.ts110644editdlrm
app-webpack.js31740644editdlrm
app-webpack.js.map32030644editdlrm
assign-location.d.ts3630644editdlrm
assign-location.js12590644editdlrm
assign-location.js.map15490644editdlrm
detect-domain-locale.d.ts1410644editdlrm
detect-domain-locale.js9220644editdlrm
detect-domain-locale.js.map7220644editdlrm
flight-data-helpers.d.ts14910644editdlrm
flight-data-helpers.js54390644editdlrm
flight-data-helpers.js.map86650644editdlrm
form-shared.d.ts28860644editdlrm
form-shared.js71320644editdlrm
form-shared.js.map107620644editdlrm
form.d.ts4890644editdlrm
form.js58160644editdlrm
form.js.map82650644editdlrm
get-domain-locale.d.ts2200644editdlrm
get-domain-locale.js15610644editdlrm
get-domain-locale.js.map24570644editdlrm
has-base-path.d.ts600644editdlrm
has-base-path.js8070644editdlrm
has-base-path.js.map6050644editdlrm
head-manager.d.ts10410644editdlrm
head-manager.js49810644editdlrm
head-manager.js.map83420644editdlrm
image-component.d.ts13370644editdlrm
image-component.js139610644editdlrm
image-component.js.map213850644editdlrm
index.d.ts7730644editdlrm
index.js334400644editdlrm
index.js.map525760644editdlrm
link.d.ts50620644editdlrm
link.js194570644editdlrm
link.js.map343670644editdlrm
next-dev-turbopack.d.ts110644editdlrm
next-dev-turbopack.js19400644editdlrm
next-dev-turbopack.js.map30020644editdlrm
next-dev.d.ts200644editdlrm
next-dev.js12230644editdlrm
next-dev.js.map11940644editdlrm
next-turbopack.d.ts480644editdlrm
next-turbopack.js14600644editdlrm
next-turbopack.js.map23300644editdlrm
next.d.ts1350644editdlrm
next.js7870644editdlrm
next.js.map8600644editdlrm
normalize-locale-path.d.ts1440644editdlrm
normalize-locale-path.js8830644editdlrm
normalize-locale-path.js.map8830644editdlrm
normalize-trailing-slash.d.ts1900644editdlrm
normalize-trailing-slash.js14500644editdlrm
normalize-trailing-slash.js.map17230644editdlrm
page-bootstrap.d.ts1230644editdlrm
page-bootstrap.js74270644editdlrm
page-bootstrap.js.map89990644editdlrm
page-loader.d.ts13700644editdlrm
page-loader.js75950644editdlrm
page-loader.js.map121060644editdlrm
remove-base-path.d.ts620644editdlrm
remove-base-path.js10800644editdlrm
remove-base-path.js.map11450644editdlrm
remove-locale.d.ts770644editdlrm
remove-locale.js11480644editdlrm
remove-locale.js.map13080644editdlrm
request-idle-callback.d.ts2650644editdlrm
request-idle-callback.js14490644editdlrm
request-idle-callback.js.map14320644editdlrm
resolve-href.d.ts3960644editdlrm
resolve-href.js55060644editdlrm
resolve-href.js.map78990644editdlrm
route-announcer.d.ts1150644editdlrm
route-announcer.js33120644editdlrm
route-announcer.js.map35530644editdlrm
route-loader.d.ts17360644editdlrm
route-loader.js139680644editdlrm
route-loader.js.map230120644editdlrm
route-params.d.ts11130644editdlrm
route-params.js82580644editdlrm
route-params.js.map108840644editdlrm
router.d.ts10780644editdlrm
router.js67160644editdlrm
router.js.map88230644editdlrm
script.d.ts9230644editdlrm
script.js140470644editdlrm
script.js.map187820644editdlrm
set-attributes-from-props.d.ts860644editdlrm
set-attributes-from-props.js23670644editdlrm
set-attributes-from-props.js.map31210644editdlrm
trusted-types.d.ts5440644editdlrm
trusted-types.js15280644editdlrm
trusted-types.js.map19570644editdlrm
use-client-disallowed.d.ts530644editdlrm
use-client-disallowed.js10060644editdlrm
use-client-disallowed.js.map7530644editdlrm
use-intersection.d.ts4120644editdlrm
use-intersection.js38450644editdlrm
use-intersection.js.map66460644editdlrm
use-merged-ref.d.ts1390644editdlrm
use-merged-ref.js24020644editdlrm
use-merged-ref.js.map34960644editdlrm
web-vitals.d.ts1560644editdlrm
web-vitals.js11090644editdlrm
web-vitals.js.map10080644editdlrm
webpack.d.ts110644editdlrm
webpack.js22820644editdlrm
webpack.js.map25350644editdlrm
with-router.d.ts5050644editdlrm
with-router.js14580644editdlrm
with-router.js.map19210644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/client/route-params.js (8258B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { doesStaticSegmentAppearInURL: null, getCacheKeyForDynamicParam: null, getParamValueFromCacheKey: null, getRenderedPathname: null, getRenderedSearch: null, parseDynamicParamFromURLPart: null, urlToUrlWithoutFlightMarker: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { doesStaticSegmentAppearInURL: function() { return doesStaticSegmentAppearInURL; }, getCacheKeyForDynamicParam: function() { return getCacheKeyForDynamicParam; }, getParamValueFromCacheKey: function() { return getParamValueFromCacheKey; }, getRenderedPathname: function() { return getRenderedPathname; }, getRenderedSearch: function() { return getRenderedSearch; }, parseDynamicParamFromURLPart: function() { return parseDynamicParamFromURLPart; }, urlToUrlWithoutFlightMarker: function() { return urlToUrlWithoutFlightMarker; } }); const _segment = require("../shared/lib/segment"); const _segmentvalueencoding = require("../shared/lib/segment-cache/segment-value-encoding"); const _approuterheaders = require("./components/app-router-headers"); function getRenderedSearch(response) { // If the server performed a rewrite, the search params used to render the // page will be different from the params in the request URL. In this case, // the response will include a header that gives the rewritten search query. const rewrittenQuery = response.headers.get(_approuterheaders.NEXT_REWRITTEN_QUERY_HEADER); if (rewrittenQuery !== null) { return rewrittenQuery === '' ? '' : '?' + rewrittenQuery; } // If the header is not present, there was no rewrite, so we use the search // query of the response URL. return urlToUrlWithoutFlightMarker(new URL(response.url)).search; } function getRenderedPathname(response) { // If the server performed a rewrite, the pathname used to render the // page will be different from the pathname in the request URL. In this case, // the response will include a header that gives the rewritten pathname. const rewrittenPath = response.headers.get(_approuterheaders.NEXT_REWRITTEN_PATH_HEADER); return rewrittenPath != null ? rewrittenPath : urlToUrlWithoutFlightMarker(new URL(response.url)).pathname; } function parseDynamicParamFromURLPart(paramType, pathnameParts, partIndex) { // This needs to match the behavior in get-dynamic-param.ts. switch(paramType){ // Catchalls case 'c': case 'ci': { // Catchalls receive all the remaining URL parts. If there are no // remaining pathname parts, return an empty array. return partIndex < pathnameParts.length ? pathnameParts.slice(partIndex).map((s)=>encodeURIComponent(s)) : []; } // Optional catchalls case 'oc': { // Optional catchalls receive all the remaining URL parts, unless this is // the end of the pathname, in which case they return null. return partIndex < pathnameParts.length ? pathnameParts.slice(partIndex).map((s)=>encodeURIComponent(s)) : null; } // Dynamic case 'd': case 'di': { if (partIndex >= pathnameParts.length) { // The route tree expected there to be more parts in the URL than there // actually are. This could happen if the x-nextjs-rewritten-path header // is incorrectly set, or potentially due to bug in Next.js. TODO: // Should this be a hard error? During a prefetch, we can just abort. // During a client navigation, we could trigger a hard refresh. But if // it happens during initial render, we don't really have any // recovery options. return ''; } return encodeURIComponent(pathnameParts[partIndex]); } default: paramType; return ''; } } function doesStaticSegmentAppearInURL(segment) { // This is not a parameterized segment; however, we need to determine // whether or not this segment appears in the URL. For example, this route // groups do not appear in the URL, so they should be skipped. Any other // special cases must be handled here. // TODO: Consider encoding this directly into the router tree instead of // inferring it on the client based on the segment type. Something like // a `doesAppearInURL` flag in FlightRouterState. if (segment === _segmentvalueencoding.ROOT_SEGMENT_REQUEST_KEY || // For some reason, the loader tree sometimes includes extra __PAGE__ // "layouts" when part of a parallel route. But it's not a leaf node. // Otherwise, we wouldn't need this special case because pages are // always leaf nodes. // TODO: Investigate why the loader produces these fake page segments. segment.startsWith(_segment.PAGE_SEGMENT_KEY) || // Route groups. segment[0] === '(' && segment.endsWith(')') || segment === _segment.DEFAULT_SEGMENT_KEY || segment === '/_not-found') { return false; } else { // All other segment types appear in the URL return true; } } function getCacheKeyForDynamicParam(paramValue, renderedSearch) { // This needs to match the logic in get-dynamic-param.ts, until we're able to // unify the various implementations so that these are always computed on // the client. if (typeof paramValue === 'string') { // TODO: Refactor or remove this helper function to accept a string rather // than the whole segment type. Also we can probably just append the // search string instead of turning it into JSON. const pageSegmentWithSearchParams = (0, _segment.addSearchParamsIfPageSegment)(paramValue, Object.fromEntries(new URLSearchParams(renderedSearch))); return pageSegmentWithSearchParams; } else if (paramValue === null) { return ''; } else { return paramValue.join('/'); } } function urlToUrlWithoutFlightMarker(url) { const urlWithoutFlightParameters = new URL(url); urlWithoutFlightParameters.searchParams.delete(_approuterheaders.NEXT_RSC_UNION_QUERY); if (process.env.NODE_ENV === 'production') { if (process.env.__NEXT_CONFIG_OUTPUT === 'export' && urlWithoutFlightParameters.pathname.endsWith('.txt')) { const { pathname } = urlWithoutFlightParameters; const length = pathname.endsWith('/index.txt') ? 10 : 4; // Slice off `/index.txt` or `.txt` from the end of the pathname urlWithoutFlightParameters.pathname = pathname.slice(0, -length); } } return urlWithoutFlightParameters; } function getParamValueFromCacheKey(paramCacheKey, paramType) { // Turn the cache key string sent by the server (as part of FlightRouterState) // into a value that can be passed to `useParams` and client components. const isCatchAll = paramType === 'c' || paramType === 'oc'; if (isCatchAll) { // Catch-all param keys are a concatenation of the path segments. // See equivalent logic in `getSelectedParams`. // TODO: We should just pass the array directly, rather than concatenate // it to a string and then split it back to an array. It needs to be an // array in some places, like when passing a key React, but we can convert // it at runtime in those places. return paramCacheKey.split('/'); } return paramCacheKey; } if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } //# sourceMappingURL=route-params.js.map