main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

1
node_modules/next/dist/client/add-base-path.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function addBasePath(path: string, required?: boolean): string;

24
node_modules/next/dist/client/add-base-path.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "addBasePath", {
enumerable: true,
get: function() {
return addBasePath;
}
});
const _addpathprefix = require("../shared/lib/router/utils/add-path-prefix");
const _normalizetrailingslash = require("./normalize-trailing-slash");
const basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
function addBasePath(path, required) {
return (0, _normalizetrailingslash.normalizePathTrailingSlash)(process.env.__NEXT_MANUAL_CLIENT_BASE_PATH && !required ? path : (0, _addpathprefix.addPathPrefix)(path, basePath));
}
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=add-base-path.js.map

1
node_modules/next/dist/client/add-base-path.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/client/add-base-path.ts"],"names":["addBasePath","basePath","process","env","__NEXT_ROUTER_BASEPATH","path","required","normalizePathTrailingSlash","__NEXT_MANUAL_CLIENT_BASE_PATH","addPathPrefix"],"mappings":";;;;+BAKgBA;;;eAAAA;;;+BALc;wCACa;AAE3C,MAAMC,WAAW,AAACC,QAAQC,GAAG,CAACC,sBAAsB,IAAe;AAE5D,SAASJ,YAAYK,IAAY,EAAEC,QAAkB;IAC1D,OAAOC,IAAAA,kDAA0B,EAC/BL,QAAQC,GAAG,CAACK,8BAA8B,IAAI,CAACF,WAC3CD,OACAI,IAAAA,4BAAa,EAACJ,MAAMJ;AAE5B"}

2
node_modules/next/dist/client/add-locale.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { addLocale as Fn } from '../shared/lib/router/utils/add-locale';
export declare const addLocale: typeof Fn;

28
node_modules/next/dist/client/add-locale.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "addLocale", {
enumerable: true,
get: function() {
return addLocale;
}
});
const _normalizetrailingslash = require("./normalize-trailing-slash");
const addLocale = function(path) {
for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
args[_key - 1] = arguments[_key];
}
if (process.env.__NEXT_I18N_SUPPORT) {
return (0, _normalizetrailingslash.normalizePathTrailingSlash)(require("../shared/lib/router/utils/add-locale").addLocale(path, ...args));
}
return path;
};
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=add-locale.js.map

1
node_modules/next/dist/client/add-locale.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/client/add-locale.ts"],"names":["addLocale","path","args","process","env","__NEXT_I18N_SUPPORT","normalizePathTrailingSlash","require"],"mappings":";;;;+BAGaA;;;eAAAA;;;wCAF8B;AAEpC,MAAMA,YAAuB,SAACC;qCAASC;QAAAA;;IAC5C,IAAIC,QAAQC,GAAG,CAACC,mBAAmB,EAAE;QACnC,OAAOC,IAAAA,kDAA0B,EAC/BC,QAAQ,yCAAyCP,SAAS,CAACC,SAASC;IAExE;IACA,OAAOD;AACT"}

7
node_modules/next/dist/client/app-bootstrap.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
/**
* Before starting the Next.js runtime and requiring any module, we need to make
* sure the following scripts are executed in the correct order:
* - Polyfills
* - next/script with `beforeInteractive` strategy
*/
export declare function appBootstrap(callback: () => void): void;

67
node_modules/next/dist/client/app-bootstrap.js generated vendored Normal file
View File

@@ -0,0 +1,67 @@
/**
* Before starting the Next.js runtime and requiring any module, we need to make
* sure the following scripts are executed in the correct order:
* - Polyfills
* - next/script with `beforeInteractive` strategy
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "appBootstrap", {
enumerable: true,
get: function() {
return appBootstrap;
}
});
const version = "13.5.1";
window.next = {
version,
appDir: true
};
function loadScriptsInSequence(scripts, hydrate) {
if (!scripts || !scripts.length) {
return hydrate();
}
return scripts.reduce((promise, param)=>{
let [src, props] = param;
return promise.then(()=>{
return new Promise((resolve, reject)=>{
const el = document.createElement("script");
if (props) {
for(const key in props){
if (key !== "children") {
el.setAttribute(key, props[key]);
}
}
}
if (src) {
el.src = src;
el.onload = ()=>resolve();
el.onerror = reject;
} else if (props) {
el.innerHTML = props.children;
setTimeout(resolve);
}
document.head.appendChild(el);
});
});
}, Promise.resolve()).catch((err)=>{
console.error(err);
// Still try to hydrate even if there's an error.
}).then(()=>{
hydrate();
});
}
function appBootstrap(callback) {
loadScriptsInSequence(self.__next_s, ()=>{
callback();
});
}
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=app-bootstrap.js.map

1
node_modules/next/dist/client/app-bootstrap.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/client/app-bootstrap.ts"],"names":["appBootstrap","version","process","env","__NEXT_VERSION","window","next","appDir","loadScriptsInSequence","scripts","hydrate","length","reduce","promise","src","props","then","Promise","resolve","reject","el","document","createElement","key","setAttribute","onload","onerror","innerHTML","children","setTimeout","head","appendChild","catch","err","console","error","callback","self","__next_s"],"mappings":"AAAA;;;;;CAKC;;;;+BAqDeA;;;eAAAA;;;AAnDhB,MAAMC,UAAUC,QAAQC,GAAG,CAACC,cAAc;AAE1CC,OAAOC,IAAI,GAAG;IACZL;IACAM,QAAQ;AACV;AAEA,SAASC,sBACPC,OAAwD,EACxDC,OAAmB;IAEnB,IAAI,CAACD,WAAW,CAACA,QAAQE,MAAM,EAAE;QAC/B,OAAOD;IACT;IAEA,OAAOD,QACJG,MAAM,CAAC,CAACC;YAAS,CAACC,KAAKC,MAAM;QAC5B,OAAOF,QAAQG,IAAI,CAAC;YAClB,OAAO,IAAIC,QAAc,CAACC,SAASC;gBACjC,MAAMC,KAAKC,SAASC,aAAa,CAAC;gBAElC,IAAIP,OAAO;oBACT,IAAK,MAAMQ,OAAOR,MAAO;wBACvB,IAAIQ,QAAQ,YAAY;4BACtBH,GAAGI,YAAY,CAACD,KAAKR,KAAK,CAACQ,IAAI;wBACjC;oBACF;gBACF;gBAEA,IAAIT,KAAK;oBACPM,GAAGN,GAAG,GAAGA;oBACTM,GAAGK,MAAM,GAAG,IAAMP;oBAClBE,GAAGM,OAAO,GAAGP;gBACf,OAAO,IAAIJ,OAAO;oBAChBK,GAAGO,SAAS,GAAGZ,MAAMa,QAAQ;oBAC7BC,WAAWX;gBACb;gBAEAG,SAASS,IAAI,CAACC,WAAW,CAACX;YAC5B;QACF;IACF,GAAGH,QAAQC,OAAO,IACjBc,KAAK,CAAC,CAACC;QACNC,QAAQC,KAAK,CAACF;IACd,iDAAiD;IACnD,GACCjB,IAAI,CAAC;QACJN;IACF;AACJ;AAEO,SAASV,aAAaoC,QAAoB;IAC/C5B,sBAAsB,AAAC6B,KAAaC,QAAQ,EAAE;QAC5CF;IACF;AACF"}

1
node_modules/next/dist/client/app-call-server.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function callServer(actionId: string, actionArgs: any[]): Promise<unknown>;

33
node_modules/next/dist/client/app-call-server.js generated vendored Normal file
View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "callServer", {
enumerable: true,
get: function() {
return callServer;
}
});
const _approuter = require("./components/app-router");
async function callServer(actionId, actionArgs) {
const actionDispatcher = (0, _approuter.getServerActionDispatcher)();
if (!actionDispatcher) {
throw new Error("Invariant: missing action dispatcher.");
}
return new Promise((resolve, reject)=>{
actionDispatcher({
actionId,
actionArgs,
resolve,
reject
});
});
}
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=app-call-server.js.map

1
node_modules/next/dist/client/app-call-server.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/client/app-call-server.ts"],"names":["callServer","actionId","actionArgs","actionDispatcher","getServerActionDispatcher","Error","Promise","resolve","reject"],"mappings":";;;;+BAEsBA;;;eAAAA;;;2BAFoB;AAEnC,eAAeA,WAAWC,QAAgB,EAAEC,UAAiB;IAClE,MAAMC,mBAAmBC,IAAAA,oCAAyB;IAElD,IAAI,CAACD,kBAAkB;QACrB,MAAM,IAAIE,MAAM;IAClB;IAEA,OAAO,IAAIC,QAAQ,CAACC,SAASC;QAC3BL,iBAAiB;YACfF;YACAC;YACAK;YACAC;QACF;IACF;AACF"}

2
node_modules/next/dist/client/app-index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import '../build/polyfills/polyfill-module';
export declare function hydrate(): void;

247
node_modules/next/dist/client/app-index.js generated vendored Normal file
View File

@@ -0,0 +1,247 @@
/* global location */ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "hydrate", {
enumerable: true,
get: function() {
return hydrate;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
require("../build/polyfills/polyfill-module");
const _client = /*#__PURE__*/ _interop_require_default._(require("react-dom/client"));
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _client1 = require("react-server-dom-webpack/client");
const _headmanagercontextsharedruntime = require("../shared/lib/head-manager-context.shared-runtime");
const _approutercontextsharedruntime = require("../shared/lib/app-router-context.shared-runtime");
const _onrecoverableerror = /*#__PURE__*/ _interop_require_default._(require("./on-recoverable-error"));
const _appcallserver = require("./app-call-server");
const _isnextroutererror = require("./components/is-next-router-error");
// Since React doesn't call onerror for errors caught in error boundaries.
const origConsoleError = window.console.error;
window.console.error = function() {
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
args[_key] = arguments[_key];
}
if ((0, _isnextroutererror.isNextRouterError)(args[0])) {
return;
}
origConsoleError.apply(window.console, args);
};
window.addEventListener("error", (ev)=>{
if ((0, _isnextroutererror.isNextRouterError)(ev.error)) {
ev.preventDefault();
return;
}
});
/// <reference types="react-dom/experimental" />
const appElement = document;
const getCacheKey = ()=>{
const { pathname, search } = location;
return pathname + search;
};
const encoder = new TextEncoder();
let initialServerDataBuffer = undefined;
let initialServerDataWriter = undefined;
let initialServerDataLoaded = false;
let initialServerDataFlushed = false;
function nextServerDataCallback(seg) {
if (seg[0] === 0) {
initialServerDataBuffer = [];
} else {
if (!initialServerDataBuffer) throw new Error("Unexpected server data: missing bootstrap script.");
if (initialServerDataWriter) {
initialServerDataWriter.enqueue(encoder.encode(seg[1]));
} else {
initialServerDataBuffer.push(seg[1]);
}
}
}
// There might be race conditions between `nextServerDataRegisterWriter` and
// `DOMContentLoaded`. The former will be called when React starts to hydrate
// the root, the latter will be called when the DOM is fully loaded.
// For streaming, the former is called first due to partial hydration.
// For non-streaming, the latter can be called first.
// Hence, we use two variables `initialServerDataLoaded` and
// `initialServerDataFlushed` to make sure the writer will be closed and
// `initialServerDataBuffer` will be cleared in the right time.
function nextServerDataRegisterWriter(ctr) {
if (initialServerDataBuffer) {
initialServerDataBuffer.forEach((val)=>{
ctr.enqueue(encoder.encode(val));
});
if (initialServerDataLoaded && !initialServerDataFlushed) {
ctr.close();
initialServerDataFlushed = true;
initialServerDataBuffer = undefined;
}
}
initialServerDataWriter = ctr;
}
// When `DOMContentLoaded`, we can close all pending writers to finish hydration.
const DOMContentLoaded = function() {
if (initialServerDataWriter && !initialServerDataFlushed) {
initialServerDataWriter.close();
initialServerDataFlushed = true;
initialServerDataBuffer = undefined;
}
initialServerDataLoaded = true;
};
// It's possible that the DOM is already loaded.
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", DOMContentLoaded, false);
} else {
DOMContentLoaded();
}
const nextServerDataLoadingGlobal = self.__next_f = self.__next_f || [];
nextServerDataLoadingGlobal.forEach(nextServerDataCallback);
nextServerDataLoadingGlobal.push = nextServerDataCallback;
function createResponseCache() {
return new Map();
}
const rscCache = createResponseCache();
function useInitialServerResponse(cacheKey) {
const response = rscCache.get(cacheKey);
if (response) return response;
const readable = new ReadableStream({
start (controller) {
nextServerDataRegisterWriter(controller);
}
});
const newResponse = (0, _client1.createFromReadableStream)(readable, {
callServer: _appcallserver.callServer
});
rscCache.set(cacheKey, newResponse);
return newResponse;
}
function ServerRoot(param) {
let { cacheKey } = param;
_react.default.useEffect(()=>{
rscCache.delete(cacheKey);
});
const response = useInitialServerResponse(cacheKey);
const root = (0, _react.use)(response);
return root;
}
const StrictModeIfEnabled = process.env.__NEXT_STRICT_MODE_APP ? _react.default.StrictMode : _react.default.Fragment;
function Root(param) {
let { children } = param;
if (process.env.__NEXT_ANALYTICS_ID) {
// eslint-disable-next-line react-hooks/rules-of-hooks
_react.default.useEffect(()=>{
require("./performance-relayer-app")();
}, []);
}
if (process.env.__NEXT_TEST_MODE) {
// eslint-disable-next-line react-hooks/rules-of-hooks
_react.default.useEffect(()=>{
window.__NEXT_HYDRATED = true;
if (window.__NEXT_HYDRATED_CB) {
window.__NEXT_HYDRATED_CB();
}
}, []);
}
return children;
}
function RSCComponent(props) {
return /*#__PURE__*/ _react.default.createElement(ServerRoot, {
...props,
cacheKey: getCacheKey()
});
}
function hydrate() {
if (process.env.NODE_ENV !== "production") {
const rootLayoutMissingTagsError = self.__next_root_layout_missing_tags_error;
const HotReload = require("./components/react-dev-overlay/hot-reloader-client").default;
// Don't try to hydrate if root layout is missing required tags, render error instead
if (rootLayoutMissingTagsError) {
const reactRootElement = document.createElement("div");
document.body.appendChild(reactRootElement);
const reactRoot = _client.default.createRoot(reactRootElement, {
onRecoverableError: _onrecoverableerror.default
});
reactRoot.render(/*#__PURE__*/ _react.default.createElement(_approutercontextsharedruntime.GlobalLayoutRouterContext.Provider, {
value: {
buildId: "development",
tree: rootLayoutMissingTagsError.tree,
changeByServerResponse: ()=>{},
focusAndScrollRef: {
apply: false,
onlyHashChange: false,
hashFragment: null,
segmentPaths: []
},
nextUrl: null
}
}, /*#__PURE__*/ _react.default.createElement(HotReload, {
assetPrefix: rootLayoutMissingTagsError.assetPrefix
})));
return;
}
}
const reactEl = /*#__PURE__*/ _react.default.createElement(StrictModeIfEnabled, null, /*#__PURE__*/ _react.default.createElement(_headmanagercontextsharedruntime.HeadManagerContext.Provider, {
value: {
appDir: true
}
}, /*#__PURE__*/ _react.default.createElement(Root, null, /*#__PURE__*/ _react.default.createElement(RSCComponent, null))));
const options = {
onRecoverableError: _onrecoverableerror.default
};
const isError = document.documentElement.id === "__next_error__";
if (process.env.NODE_ENV !== "production") {
// Patch console.error to collect information about hydration errors
const patchConsoleError = require("./components/react-dev-overlay/internal/helpers/hydration-error-info").patchConsoleError;
if (!isError) {
patchConsoleError();
}
}
if (isError) {
if (process.env.NODE_ENV !== "production") {
// if an error is thrown while rendering an RSC stream, this will catch it in dev
// and show the error overlay
const ReactDevOverlay = require("./components/react-dev-overlay/internal/ReactDevOverlay").default;
const INITIAL_OVERLAY_STATE = require("./components/react-dev-overlay/internal/error-overlay-reducer").INITIAL_OVERLAY_STATE;
const getSocketUrl = require("./components/react-dev-overlay/internal/helpers/get-socket-url").getSocketUrl;
let errorTree = /*#__PURE__*/ _react.default.createElement(ReactDevOverlay, {
state: INITIAL_OVERLAY_STATE,
onReactError: ()=>{}
}, reactEl);
const socketUrl = getSocketUrl(process.env.__NEXT_ASSET_PREFIX || "");
const socket = new window.WebSocket("" + socketUrl + "/_next/webpack-hmr");
// add minimal "hot reload" support for RSC errors
const handler = (event)=>{
let obj;
try {
obj = JSON.parse(event.data);
} catch (e) {}
if (!obj || !("action" in obj)) {
return;
}
if (obj.action === "serverComponentChanges") {
window.location.reload();
}
};
socket.addEventListener("message", handler);
_client.default.createRoot(appElement, options).render(errorTree);
} else {
_client.default.createRoot(appElement, options).render(reactEl);
}
} else {
_react.default.startTransition(()=>_client.default.hydrateRoot(appElement, reactEl, options));
}
// TODO-APP: Remove this logic when Float has GC built-in in development.
if (process.env.NODE_ENV !== "production") {
const { linkGc } = require("./app-link-gc");
linkGc();
}
}
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=app-index.js.map

1
node_modules/next/dist/client/app-index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/next/dist/client/app-link-gc.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function linkGc(): void;

77
node_modules/next/dist/client/app-link-gc.js generated vendored Normal file
View File

@@ -0,0 +1,77 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "linkGc", {
enumerable: true,
get: function() {
return linkGc;
}
});
function linkGc() {
// TODO-APP: Remove this logic when Float has GC built-in in development.
if (process.env.NODE_ENV !== "production") {
const callback = (mutationList)=>{
for (const mutation of mutationList){
if (mutation.type === "childList") {
for (const node of mutation.addedNodes){
if ("tagName" in node && node.tagName === "LINK") {
var _link_dataset_precedence;
const link = node;
if ((_link_dataset_precedence = link.dataset.precedence) == null ? void 0 : _link_dataset_precedence.startsWith("next")) {
const href = link.getAttribute("href");
if (href) {
const [resource, version] = href.split("?v=");
if (version) {
const currentOrigin = window.location.origin;
const allLinks = [
...document.querySelectorAll('link[href^="' + resource + '"]'),
// It's possible that the resource is a full URL or only pathname,
// so we need to remove the alternative href as well.
...document.querySelectorAll('link[href^="' + (resource.startsWith(currentOrigin) ? resource.slice(currentOrigin.length) : currentOrigin + resource) + '"]')
];
for (const otherLink of allLinks){
var _otherLink_dataset_precedence;
if ((_otherLink_dataset_precedence = otherLink.dataset.precedence) == null ? void 0 : _otherLink_dataset_precedence.startsWith("next")) {
const otherHref = otherLink.getAttribute("href");
if (otherHref) {
const [, otherVersion] = otherHref.split("?v=");
if (!otherVersion || +otherVersion < +version) {
// Delay the removal of the stylesheet to avoid FOUC
// caused by `@font-face` rules, as they seem to be
// a couple of ticks delayed between the old and new
// styles being swapped even if the font is cached.
setTimeout(()=>{
otherLink.remove();
}, 5);
const preloadLink = document.querySelector('link[rel="preload"][as="style"][href="' + otherHref + '"]');
if (preloadLink) {
preloadLink.remove();
}
}
}
}
}
}
}
}
}
}
}
}
};
// Create an observer instance linked to the callback function
const observer = new MutationObserver(callback);
observer.observe(document.head, {
childList: true
});
}
}
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=app-link-gc.js.map

1
node_modules/next/dist/client/app-link-gc.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/client/app-link-gc.ts"],"names":["linkGc","process","env","NODE_ENV","callback","mutationList","mutation","type","node","addedNodes","tagName","link","dataset","precedence","startsWith","href","getAttribute","resource","version","split","currentOrigin","window","location","origin","allLinks","document","querySelectorAll","slice","length","otherLink","otherHref","otherVersion","setTimeout","remove","preloadLink","querySelector","observer","MutationObserver","observe","head","childList"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA;IACd,yEAAyE;IACzE,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,MAAMC,WAAW,CAACC;YAChB,KAAK,MAAMC,YAAYD,aAAc;gBACnC,IAAIC,SAASC,IAAI,KAAK,aAAa;oBACjC,KAAK,MAAMC,QAAQF,SAASG,UAAU,CAAE;wBACtC,IACE,aAAaD,QACb,AAACA,KAAyBE,OAAO,KAAK,QACtC;gCAEIC;4BADJ,MAAMA,OAAOH;4BACb,KAAIG,2BAAAA,KAAKC,OAAO,CAACC,UAAU,qBAAvBF,yBAAyBG,UAAU,CAAC,SAAS;gCAC/C,MAAMC,OAAOJ,KAAKK,YAAY,CAAC;gCAC/B,IAAID,MAAM;oCACR,MAAM,CAACE,UAAUC,QAAQ,GAAGH,KAAKI,KAAK,CAAC;oCACvC,IAAID,SAAS;wCACX,MAAME,gBAAgBC,OAAOC,QAAQ,CAACC,MAAM;wCAC5C,MAAMC,WAAW;+CACZC,SAASC,gBAAgB,CAC1B,iBAAiBT,WAAW;4CAE9B,kEAAkE;4CAClE,qDAAqD;+CAClDQ,SAASC,gBAAgB,CAC1B,iBACGT,CAAAA,SAASH,UAAU,CAACM,iBACjBH,SAASU,KAAK,CAACP,cAAcQ,MAAM,IACnCR,gBAAgBH,QAAO,IAC3B;yCAEL;wCAED,KAAK,MAAMY,aAAaL,SAAU;gDAC5BK;4CAAJ,KAAIA,gCAAAA,UAAUjB,OAAO,CAACC,UAAU,qBAA5BgB,8BAA8Bf,UAAU,CAAC,SAAS;gDACpD,MAAMgB,YAAYD,UAAUb,YAAY,CAAC;gDACzC,IAAIc,WAAW;oDACb,MAAM,GAAGC,aAAa,GAAGD,UAAUX,KAAK,CAAC;oDACzC,IAAI,CAACY,gBAAgB,CAACA,eAAe,CAACb,SAAS;wDAC7C,oDAAoD;wDACpD,mDAAmD;wDACnD,oDAAoD;wDACpD,mDAAmD;wDACnDc,WAAW;4DACTH,UAAUI,MAAM;wDAClB,GAAG;wDACH,MAAMC,cAAcT,SAASU,aAAa,CACxC,AAAC,2CAAwCL,YAAU;wDAErD,IAAII,aAAa;4DACfA,YAAYD,MAAM;wDACpB;oDACF;gDACF;4CACF;wCACF;oCACF;gCACF;4BACF;wBACF;oBACF;gBACF;YACF;QACF;QAEA,8DAA8D;QAC9D,MAAMG,WAAW,IAAIC,iBAAiBjC;QACtCgC,SAASE,OAAO,CAACb,SAASc,IAAI,EAAE;YAC9BC,WAAW;QACb;IACF;AACF"}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,22 @@
// TODO-APP: hydration warning
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _appbootstrap = require("./app-bootstrap");
window.next.version += "-turbo";
self.__webpack_hash__ = "";
(0, _appbootstrap.appBootstrap)(()=>{
require("./app-turbopack");
const { hydrate } = require("./app-index");
hydrate();
}) // TODO-APP: build indicator
;
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=app-next-dev-turbopack.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/client/app-next-dev-turbopack.ts"],"names":["window","next","version","self","__webpack_hash__","appBootstrap","require","hydrate"],"mappings":"AAAA,8BAA8B;;;;;8BAED;AAE7BA,OAAOC,IAAI,CAACC,OAAO,IAAI;AACrBC,KAAaC,gBAAgB,GAAG;AAElCC,IAAAA,0BAAY,EAAC;IACXC,QAAQ;IACR,MAAM,EAAEC,OAAO,EAAE,GAAGD,QAAQ;IAC5BC;AACF,GAEA,4BAA4B"}

1
node_modules/next/dist/client/app-next-dev.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export {};

20
node_modules/next/dist/client/app-next-dev.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
// TODO-APP: hydration warning
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _appbootstrap = require("./app-bootstrap");
(0, _appbootstrap.appBootstrap)(()=>{
require("./app-webpack");
const { hydrate } = require("./app-index");
hydrate();
}) // TODO-APP: build indicator
;
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=app-next-dev.js.map

1
node_modules/next/dist/client/app-next-dev.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/client/app-next-dev.ts"],"names":["appBootstrap","require","hydrate"],"mappings":"AAAA,8BAA8B;;;;;8BAED;AAE7BA,IAAAA,0BAAY,EAAC;IACXC,QAAQ;IACR,MAAM,EAAEC,OAAO,EAAE,GAAGD,QAAQ;IAC5BC;AACF,GAEA,4BAA4B"}

1
node_modules/next/dist/client/app-next.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export {};

21
node_modules/next/dist/client/app-next.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _appbootstrap = require("./app-bootstrap");
(0, _appbootstrap.appBootstrap)(()=>{
// Include app-router and layout-router in the main chunk
require("next/dist/client/components/app-router");
require("next/dist/client/components/layout-router");
require("./app-webpack");
const { hydrate } = require("./app-index");
hydrate();
});
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=app-next.js.map

1
node_modules/next/dist/client/app-next.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/client/app-next.ts"],"names":["appBootstrap","require","hydrate"],"mappings":";;;;8BAA6B;AAE7BA,IAAAA,0BAAY,EAAC;IACX,yDAAyD;IACzDC,QAAQ;IACRA,QAAQ;IACRA,QAAQ;IACR,MAAM,EAAEC,OAAO,EAAE,GAAGD,QAAQ;IAC5BC;AACF"}

1
node_modules/next/dist/client/app-turbopack.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export {};

16
node_modules/next/dist/client/app-turbopack.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
// @ts-expect-error
process.env.__NEXT_NEW_LINK_BEHAVIOR = true;
self.__next_require__ = __turbopack_require__;
self.__next_chunk_load__ = __turbopack_load__;
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=app-turbopack.js.map

1
node_modules/next/dist/client/app-turbopack.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/client/app-turbopack.ts"],"names":["process","env","__NEXT_NEW_LINK_BEHAVIOR","self","__next_require__","__turbopack_require__","__next_chunk_load__","__turbopack_load__"],"mappings":";;;;AAEA,mBAAmB;AACnBA,QAAQC,GAAG,CAACC,wBAAwB,GAAG;AAGrCC,KAAaC,gBAAgB,GAAGC;AAIhCF,KAAaG,mBAAmB,GAAGC"}

1
node_modules/next/dist/client/app-webpack.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export {};

54
node_modules/next/dist/client/app-webpack.js generated vendored Normal file
View File

@@ -0,0 +1,54 @@
// Override chunk URL mapping in the webpack runtime
// https://github.com/webpack/webpack/blob/2738eebc7880835d88c727d364ad37f3ec557593/lib/RuntimeGlobals.js#L204
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const addChunkSuffix = (getOriginalChunk)=>(chunkId)=>{
return getOriginalChunk(chunkId) + ("" + (process.env.NEXT_DEPLOYMENT_ID ? "?dpl=" + process.env.NEXT_DEPLOYMENT_ID : ""));
};
// eslint-disable-next-line no-undef
const getChunkScriptFilename = __webpack_require__.u;
const chunkFilenameMap = {};
// eslint-disable-next-line no-undef
__webpack_require__.u = addChunkSuffix((chunkId)=>encodeURI(chunkFilenameMap[chunkId] || getChunkScriptFilename(chunkId)));
// eslint-disable-next-line no-undef
const getChunkCssFilename = __webpack_require__.k;
// eslint-disable-next-line no-undef
__webpack_require__.k = addChunkSuffix(getChunkCssFilename);
// eslint-disable-next-line no-undef
const getMiniCssFilename = __webpack_require__.miniCssF;
// eslint-disable-next-line no-undef
__webpack_require__.miniCssF = addChunkSuffix(getMiniCssFilename);
// Ignore the module ID transform in client.
// eslint-disable-next-line no-undef
// @ts-expect-error TODO: fix type
self.__next_require__ = process.env.NODE_ENV !== "production" ? (id)=>{
const mod = __webpack_require__(id);
if (typeof mod === "object") {
// Return a proxy to flight client to make sure it's always getting
// the latest module, instead of being cached.
return new Proxy(mod, {
get (_target, prop) {
return __webpack_require__(id)[prop];
}
});
}
return mod;
} : __webpack_require__;
self.__next_chunk_load__ = (chunk)=>{
if (!chunk) return Promise.resolve();
const [chunkId, chunkFilePath] = chunk.split(":");
chunkFilenameMap[chunkId] = chunkFilePath;
// @ts-ignore
// eslint-disable-next-line no-undef
return __webpack_chunk_load__(chunkId);
};
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=app-webpack.js.map

1
node_modules/next/dist/client/app-webpack.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/client/app-webpack.ts"],"names":["addChunkSuffix","getOriginalChunk","chunkId","process","env","NEXT_DEPLOYMENT_ID","getChunkScriptFilename","__webpack_require__","u","chunkFilenameMap","encodeURI","getChunkCssFilename","k","getMiniCssFilename","miniCssF","self","__next_require__","NODE_ENV","id","mod","Proxy","get","_target","prop","__next_chunk_load__","chunk","Promise","resolve","chunkFilePath","split","__webpack_chunk_load__"],"mappings":"AAAA,oDAAoD;AACpD,8GAA8G;;;;;AAI9G,MAAMA,iBACJ,CAACC,mBAA+C,CAACC;QAC/C,OACED,iBAAiBC,WACjB,CAAA,AAAC,KACCC,CAAAA,QAAQC,GAAG,CAACC,kBAAkB,GAC1B,AAAC,UAAOF,QAAQC,GAAG,CAACC,kBAAkB,GACtC,EAAC,CACN;IAEL;AAEF,oCAAoC;AACpC,MAAMC,yBAAyBC,oBAAoBC,CAAC;AACpD,MAAMC,mBAAwB,CAAC;AAE/B,oCAAoC;AACpCF,oBAAoBC,CAAC,GAAGR,eAAe,CAACE,UACtCQ,UAAUD,gBAAgB,CAACP,QAAQ,IAAII,uBAAuBJ;AAGhE,oCAAoC;AACpC,MAAMS,sBAAsBJ,oBAAoBK,CAAC;AACjD,oCAAoC;AACpCL,oBAAoBK,CAAC,GAAGZ,eAAeW;AAEvC,oCAAoC;AACpC,MAAME,qBAAqBN,oBAAoBO,QAAQ;AACvD,oCAAoC;AACpCP,oBAAoBO,QAAQ,GAAGd,eAAea;AAE9C,4CAA4C;AAC5C,oCAAoC;AACpC,kCAAkC;AAClCE,KAAKC,gBAAgB,GACnBb,QAAQC,GAAG,CAACa,QAAQ,KAAK,eACrB,CAACC;IACC,MAAMC,MAAMZ,oBAAoBW;IAChC,IAAI,OAAOC,QAAQ,UAAU;QAC3B,mEAAmE;QACnE,8CAA8C;QAC9C,OAAO,IAAIC,MAAMD,KAAK;YACpBE,KAAIC,OAAO,EAAEC,IAAI;gBACf,OAAOhB,oBAAoBW,GAAG,CAACK,KAAK;YACtC;QACF;IACF;IAEA,OAAOJ;AACT,IACAZ;AAGJQ,KAAaS,mBAAmB,GAAG,CAACC;IACpC,IAAI,CAACA,OAAO,OAAOC,QAAQC,OAAO;IAClC,MAAM,CAACzB,SAAS0B,cAAc,GAAGH,MAAMI,KAAK,CAAC;IAC7CpB,gBAAgB,CAACP,QAAQ,GAAG0B;IAE5B,aAAa;IACb,oCAAoC;IACpC,OAAOE,uBAAuB5B;AAChC"}

12
node_modules/next/dist/client/compat/router.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import { NextRouter } from '../router';
/**
* useRouter from `next/compat/router` is designed to assist developers
* migrating from `pages/` to `app/`. Unlike `next/router`, this hook does not
* throw when the `NextRouter` is not mounted, and instead returns `null`. The
* more concrete return type here lets developers use this hook within
* components that could be shared between both `app/` and `pages/` and handle
* to the case where the router is not mounted.
*
* @returns The `NextRouter` instance if it's available, otherwise `null`.
*/
export declare function useRouter(): NextRouter | null;

23
node_modules/next/dist/client/compat/router.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useRouter", {
enumerable: true,
get: function() {
return useRouter;
}
});
const _react = require("react");
const _routercontextsharedruntime = require("../../shared/lib/router-context.shared-runtime");
function useRouter() {
return (0, _react.useContext)(_routercontextsharedruntime.RouterContext);
}
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=router.js.map

1
node_modules/next/dist/client/compat/router.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/compat/router.ts"],"names":["useRouter","useContext","RouterContext"],"mappings":";;;;+BAcgBA;;;eAAAA;;;uBAdW;4CACG;AAavB,SAASA;IACd,OAAOC,IAAAA,iBAAU,EAACC,yCAAa;AACjC"}

View File

@@ -0,0 +1,8 @@
/// <reference types="node" />
import type { AsyncLocalStorage } from 'async_hooks';
export interface ActionStore {
readonly isAction?: boolean;
readonly isAppRoute?: boolean;
}
export type ActionAsyncStorage = AsyncLocalStorage<ActionStore>;
export declare const actionAsyncStorage: ActionAsyncStorage;

View File

@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "actionAsyncStorage", {
enumerable: true,
get: function() {
return actionAsyncStorage;
}
});
const _asynclocalstorage = require("./async-local-storage");
const actionAsyncStorage = (0, _asynclocalstorage.createAsyncLocalStorage)();
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=action-async-storage.external.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/action-async-storage.external.ts"],"names":["actionAsyncStorage","createAsyncLocalStorage"],"mappings":";;;;+BAUaA;;;eAAAA;;;mCAT2B;AASjC,MAAMA,qBAAyCC,IAAAA,0CAAuB"}

View File

@@ -0,0 +1,5 @@
/// <reference types="react" />
import type { FlightRouterState } from '../../server/app-render/types';
export declare function AppRouterAnnouncer({ tree }: {
tree: FlightRouterState;
}): import("react").ReactPortal | null;

View File

@@ -0,0 +1,80 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "AppRouterAnnouncer", {
enumerable: true,
get: function() {
return AppRouterAnnouncer;
}
});
const _react = require("react");
const _reactdom = require("react-dom");
const ANNOUNCER_TYPE = "next-route-announcer";
const ANNOUNCER_ID = "__next-route-announcer__";
function getAnnouncerNode() {
var _existingAnnouncer_shadowRoot;
const existingAnnouncer = document.getElementsByName(ANNOUNCER_TYPE)[0];
if (existingAnnouncer == null ? void 0 : (_existingAnnouncer_shadowRoot = existingAnnouncer.shadowRoot) == null ? void 0 : _existingAnnouncer_shadowRoot.childNodes[0]) {
return existingAnnouncer.shadowRoot.childNodes[0];
} else {
const container = document.createElement(ANNOUNCER_TYPE);
container.style.cssText = "position:absolute";
const announcer = document.createElement("div");
announcer.ariaLive = "assertive";
announcer.id = ANNOUNCER_ID;
announcer.role = "alert";
announcer.style.cssText = "position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal";
// Use shadow DOM here to avoid any potential CSS bleed
const shadow = container.attachShadow({
mode: "open"
});
shadow.appendChild(announcer);
document.body.appendChild(container);
return announcer;
}
}
function AppRouterAnnouncer(param) {
let { tree } = param;
const [portalNode, setPortalNode] = (0, _react.useState)(null);
(0, _react.useEffect)(()=>{
const announcer = getAnnouncerNode();
setPortalNode(announcer);
return ()=>{
const container = document.getElementsByTagName(ANNOUNCER_TYPE)[0];
if (container == null ? void 0 : container.isConnected) {
document.body.removeChild(container);
}
};
}, []);
const [routeAnnouncement, setRouteAnnouncement] = (0, _react.useState)("");
const previousTitle = (0, _react.useRef)();
(0, _react.useEffect)(()=>{
let currentTitle = "";
if (document.title) {
currentTitle = document.title;
} else {
const pageHeader = document.querySelector("h1");
if (pageHeader) {
currentTitle = pageHeader.innerText || pageHeader.textContent || "";
}
}
// Only announce the title change, but not for the first load because screen
// readers do that automatically.
if (previousTitle.current !== undefined && previousTitle.current !== currentTitle) {
setRouteAnnouncement(currentTitle);
}
previousTitle.current = currentTitle;
}, [
tree
]);
return portalNode ? /*#__PURE__*/ (0, _reactdom.createPortal)(routeAnnouncement, portalNode) : null;
}
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=app-router-announcer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/app-router-announcer.tsx"],"names":["AppRouterAnnouncer","ANNOUNCER_TYPE","ANNOUNCER_ID","getAnnouncerNode","existingAnnouncer","document","getElementsByName","shadowRoot","childNodes","container","createElement","style","cssText","announcer","ariaLive","id","role","shadow","attachShadow","mode","appendChild","body","tree","portalNode","setPortalNode","useState","useEffect","getElementsByTagName","isConnected","removeChild","routeAnnouncement","setRouteAnnouncement","previousTitle","useRef","currentTitle","title","pageHeader","querySelector","innerText","textContent","current","undefined","createPortal"],"mappings":";;;;+BA6BgBA;;;eAAAA;;;uBA7B4B;0BACf;AAG7B,MAAMC,iBAAiB;AACvB,MAAMC,eAAe;AAErB,SAASC;QAEHC;IADJ,MAAMA,oBAAoBC,SAASC,iBAAiB,CAACL,eAAe,CAAC,EAAE;IACvE,IAAIG,sCAAAA,gCAAAA,kBAAmBG,UAAU,qBAA7BH,8BAA+BI,UAAU,CAAC,EAAE,EAAE;QAChD,OAAOJ,kBAAkBG,UAAU,CAACC,UAAU,CAAC,EAAE;IACnD,OAAO;QACL,MAAMC,YAAYJ,SAASK,aAAa,CAACT;QACzCQ,UAAUE,KAAK,CAACC,OAAO,GAAG;QAC1B,MAAMC,YAAYR,SAASK,aAAa,CAAC;QACzCG,UAAUC,QAAQ,GAAG;QACrBD,UAAUE,EAAE,GAAGb;QACfW,UAAUG,IAAI,GAAG;QACjBH,UAAUF,KAAK,CAACC,OAAO,GACrB;QAEF,uDAAuD;QACvD,MAAMK,SAASR,UAAUS,YAAY,CAAC;YAAEC,MAAM;QAAO;QACrDF,OAAOG,WAAW,CAACP;QACnBR,SAASgB,IAAI,CAACD,WAAW,CAACX;QAC1B,OAAOI;IACT;AACF;AAEO,SAASb,mBAAmB,KAAqC;IAArC,IAAA,EAAEsB,IAAI,EAA+B,GAArC;IACjC,MAAM,CAACC,YAAYC,cAAc,GAAGC,IAAAA,eAAQ,EAAqB;IAEjEC,IAAAA,gBAAS,EAAC;QACR,MAAMb,YAAYV;QAClBqB,cAAcX;QACd,OAAO;YACL,MAAMJ,YAAYJ,SAASsB,oBAAoB,CAAC1B,eAAe,CAAC,EAAE;YAClE,IAAIQ,6BAAAA,UAAWmB,WAAW,EAAE;gBAC1BvB,SAASgB,IAAI,CAACQ,WAAW,CAACpB;YAC5B;QACF;IACF,GAAG,EAAE;IAEL,MAAM,CAACqB,mBAAmBC,qBAAqB,GAAGN,IAAAA,eAAQ,EAAC;IAC3D,MAAMO,gBAAgBC,IAAAA,aAAM;IAE5BP,IAAAA,gBAAS,EAAC;QACR,IAAIQ,eAAe;QACnB,IAAI7B,SAAS8B,KAAK,EAAE;YAClBD,eAAe7B,SAAS8B,KAAK;QAC/B,OAAO;YACL,MAAMC,aAAa/B,SAASgC,aAAa,CAAC;YAC1C,IAAID,YAAY;gBACdF,eAAeE,WAAWE,SAAS,IAAIF,WAAWG,WAAW,IAAI;YACnE;QACF;QAEA,4EAA4E;QAC5E,iCAAiC;QACjC,IACEP,cAAcQ,OAAO,KAAKC,aAC1BT,cAAcQ,OAAO,KAAKN,cAC1B;YACAH,qBAAqBG;QACvB;QACAF,cAAcQ,OAAO,GAAGN;IAC1B,GAAG;QAACZ;KAAK;IAET,OAAOC,2BAAamB,IAAAA,sBAAY,EAACZ,mBAAmBP,cAAc;AACpE"}

View File

@@ -0,0 +1,9 @@
export declare const RSC: "RSC";
export declare const ACTION: "Next-Action";
export declare const NEXT_ROUTER_STATE_TREE: "Next-Router-State-Tree";
export declare const NEXT_ROUTER_PREFETCH: "Next-Router-Prefetch";
export declare const NEXT_URL: "Next-Url";
export declare const RSC_CONTENT_TYPE_HEADER: "text/x-component";
export declare const RSC_VARY_HEADER: "RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Url";
export declare const FLIGHT_PARAMETERS: readonly [readonly ["RSC"], readonly ["Next-Router-State-Tree"], readonly ["Next-Router-Prefetch"]];
export declare const NEXT_RSC_UNION_QUERY: "_rsc";

View File

@@ -0,0 +1,77 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
RSC: null,
ACTION: null,
NEXT_ROUTER_STATE_TREE: null,
NEXT_ROUTER_PREFETCH: null,
NEXT_URL: null,
RSC_CONTENT_TYPE_HEADER: null,
RSC_VARY_HEADER: null,
FLIGHT_PARAMETERS: null,
NEXT_RSC_UNION_QUERY: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
RSC: function() {
return RSC;
},
ACTION: function() {
return ACTION;
},
NEXT_ROUTER_STATE_TREE: function() {
return NEXT_ROUTER_STATE_TREE;
},
NEXT_ROUTER_PREFETCH: function() {
return NEXT_ROUTER_PREFETCH;
},
NEXT_URL: function() {
return NEXT_URL;
},
RSC_CONTENT_TYPE_HEADER: function() {
return RSC_CONTENT_TYPE_HEADER;
},
RSC_VARY_HEADER: function() {
return RSC_VARY_HEADER;
},
FLIGHT_PARAMETERS: function() {
return FLIGHT_PARAMETERS;
},
NEXT_RSC_UNION_QUERY: function() {
return NEXT_RSC_UNION_QUERY;
}
});
const RSC = "RSC";
const ACTION = "Next-Action";
const NEXT_ROUTER_STATE_TREE = "Next-Router-State-Tree";
const NEXT_ROUTER_PREFETCH = "Next-Router-Prefetch";
const NEXT_URL = "Next-Url";
const RSC_CONTENT_TYPE_HEADER = "text/x-component";
const RSC_VARY_HEADER = RSC + ", " + NEXT_ROUTER_STATE_TREE + ", " + NEXT_ROUTER_PREFETCH + ", " + NEXT_URL;
const FLIGHT_PARAMETERS = [
[
RSC
],
[
NEXT_ROUTER_STATE_TREE
],
[
NEXT_ROUTER_PREFETCH
]
];
const NEXT_RSC_UNION_QUERY = "_rsc";
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=app-router-headers.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/app-router-headers.ts"],"names":["RSC","ACTION","NEXT_ROUTER_STATE_TREE","NEXT_ROUTER_PREFETCH","NEXT_URL","RSC_CONTENT_TYPE_HEADER","RSC_VARY_HEADER","FLIGHT_PARAMETERS","NEXT_RSC_UNION_QUERY"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAAaA,GAAG;eAAHA;;IACAC,MAAM;eAANA;;IAEAC,sBAAsB;eAAtBA;;IACAC,oBAAoB;eAApBA;;IACAC,QAAQ;eAARA;;IACAC,uBAAuB;eAAvBA;;IACAC,eAAe;eAAfA;;IAGAC,iBAAiB;eAAjBA;;IAMAC,oBAAoB;eAApBA;;;AAhBN,MAAMR,MAAM;AACZ,MAAMC,SAAS;AAEf,MAAMC,yBAAyB;AAC/B,MAAMC,uBAAuB;AAC7B,MAAMC,WAAW;AACjB,MAAMC,0BAA0B;AAChC,MAAMC,kBACX,AAAGN,MAAI,OAAIE,yBAAuB,OAAIC,uBAAqB,OAAIC;AAE1D,MAAMG,oBAAoB;IAC/B;QAACP;KAAI;IACL;QAACE;KAAuB;IACxB;QAACC;KAAqB;CACvB;AAEM,MAAMK,uBAAuB"}

View File

@@ -0,0 +1,16 @@
import type { ReactNode } from 'react';
import React from 'react';
import type { ErrorComponent } from './error-boundary';
import { ServerActionDispatcher } from './router-reducer/router-reducer-types';
import { InitialRouterStateParameters } from './router-reducer/create-initial-router-state';
export declare function getServerActionDispatcher(): ServerActionDispatcher | null;
export declare function urlToUrlWithoutFlightMarker(url: string): URL;
type AppRouterProps = Omit<Omit<InitialRouterStateParameters, 'isServer' | 'location'>, 'initialParallelRoutes'> & {
buildId: string;
initialHead: ReactNode;
assetPrefix: string;
};
export default function AppRouter(props: AppRouterProps & {
globalErrorComponent: ErrorComponent;
}): React.JSX.Element;
export {};

456
node_modules/next/dist/client/components/app-router.js generated vendored Normal file
View File

@@ -0,0 +1,456 @@
"use client";
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
getServerActionDispatcher: null,
urlToUrlWithoutFlightMarker: null,
default: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
getServerActionDispatcher: function() {
return getServerActionDispatcher;
},
urlToUrlWithoutFlightMarker: function() {
return urlToUrlWithoutFlightMarker;
},
default: function() {
return AppRouter;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _approutercontextsharedruntime = require("../../shared/lib/app-router-context.shared-runtime");
const _routerreducer = require("./router-reducer/router-reducer");
const _routerreducertypes = require("./router-reducer/router-reducer-types");
const _createhreffromurl = require("./router-reducer/create-href-from-url");
const _hooksclientcontextsharedruntime = require("../../shared/lib/hooks-client-context.shared-runtime");
const _usereducerwithdevtools = require("./use-reducer-with-devtools");
const _errorboundary = require("./error-boundary");
const _createinitialrouterstate = require("./router-reducer/create-initial-router-state");
const _isbot = require("../../shared/lib/router/utils/is-bot");
const _addbasepath = require("../add-base-path");
const _approuterannouncer = require("./app-router-announcer");
const _redirectboundary = require("./redirect-boundary");
const _findheadincache = require("./router-reducer/reducers/find-head-in-cache");
const _infinitepromise = require("./infinite-promise");
const _approuterheaders = require("./app-router-headers");
const _removebasepath = require("../remove-base-path");
const _hasbasepath = require("../has-base-path");
const isServer = typeof window === "undefined";
// Ensure the initialParallelRoutes are not combined because of double-rendering in the browser with Strict Mode.
let initialParallelRoutes = isServer ? null : new Map();
let globalServerActionDispatcher = null;
function getServerActionDispatcher() {
return globalServerActionDispatcher;
}
let globalMutable = {
refresh: ()=>{}
};
function urlToUrlWithoutFlightMarker(url) {
const urlWithoutFlightParameters = new URL(url, location.origin);
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 isExternalURL(url) {
return url.origin !== window.location.origin;
}
function HistoryUpdater(param) {
let { tree, pushRef, canonicalUrl, sync } = param;
(0, _react.useInsertionEffect)(()=>{
// Identifier is shortened intentionally.
// __NA is used to identify if the history entry can be handled by the app-router.
// __N is used to identify if the history entry can be handled by the old router.
const historyState = {
__NA: true,
tree
};
if (pushRef.pendingPush && (0, _createhreffromurl.createHrefFromUrl)(new URL(window.location.href)) !== canonicalUrl) {
// This intentionally mutates React state, pushRef is overwritten to ensure additional push/replace calls do not trigger an additional history entry.
pushRef.pendingPush = false;
window.history.pushState(historyState, "", canonicalUrl);
} else {
window.history.replaceState(historyState, "", canonicalUrl);
}
sync();
}, [
tree,
pushRef,
canonicalUrl,
sync
]);
return null;
}
const createEmptyCacheNode = ()=>({
status: _approutercontextsharedruntime.CacheStates.LAZY_INITIALIZED,
data: null,
subTreeData: null,
parallelRoutes: new Map()
});
function useServerActionDispatcher(dispatch) {
const serverActionDispatcher = (0, _react.useCallback)((actionPayload)=>{
(0, _react.startTransition)(()=>{
dispatch({
...actionPayload,
type: _routerreducertypes.ACTION_SERVER_ACTION,
mutable: {
globalMutable
},
cache: createEmptyCacheNode()
});
});
}, [
dispatch
]);
globalServerActionDispatcher = serverActionDispatcher;
}
/**
* Server response that only patches the cache and tree.
*/ function useChangeByServerResponse(dispatch) {
return (0, _react.useCallback)((previousTree, flightData, overrideCanonicalUrl)=>{
(0, _react.startTransition)(()=>{
dispatch({
type: _routerreducertypes.ACTION_SERVER_PATCH,
flightData,
previousTree,
overrideCanonicalUrl,
cache: createEmptyCacheNode(),
mutable: {
globalMutable
}
});
});
}, [
dispatch
]);
}
function useNavigate(dispatch) {
return (0, _react.useCallback)((href, navigateType, forceOptimisticNavigation, shouldScroll)=>{
const url = new URL((0, _addbasepath.addBasePath)(href), location.href);
globalMutable.pendingNavigatePath = href;
return dispatch({
type: _routerreducertypes.ACTION_NAVIGATE,
url,
isExternalUrl: isExternalURL(url),
locationSearch: location.search,
forceOptimisticNavigation,
shouldScroll: shouldScroll != null ? shouldScroll : true,
navigateType,
cache: createEmptyCacheNode(),
mutable: {
globalMutable
}
});
}, [
dispatch
]);
}
/**
* The global router that wraps the application components.
*/ function Router(param) {
let { buildId, initialHead, initialTree, initialCanonicalUrl, children, assetPrefix } = param;
const initialState = (0, _react.useMemo)(()=>(0, _createinitialrouterstate.createInitialRouterState)({
buildId,
children,
initialCanonicalUrl,
initialTree,
initialParallelRoutes,
isServer,
location: !isServer ? window.location : null,
initialHead
}), [
buildId,
children,
initialCanonicalUrl,
initialTree,
initialHead
]);
const [{ tree, cache, prefetchCache, pushRef, focusAndScrollRef, canonicalUrl, nextUrl }, dispatch, sync] = (0, _usereducerwithdevtools.useReducerWithReduxDevtools)(_routerreducer.reducer, initialState);
(0, _react.useEffect)(()=>{
// Ensure initialParallelRoutes is cleaned up from memory once it's used.
initialParallelRoutes = null;
}, []);
// Add memoized pathname/query for useSearchParams and usePathname.
const { searchParams, pathname } = (0, _react.useMemo)(()=>{
const url = new URL(canonicalUrl, typeof window === "undefined" ? "http://n" : window.location.href);
return {
// This is turned into a readonly class in `useSearchParams`
searchParams: url.searchParams,
pathname: (0, _hasbasepath.hasBasePath)(url.pathname) ? (0, _removebasepath.removeBasePath)(url.pathname) : url.pathname
};
}, [
canonicalUrl
]);
const changeByServerResponse = useChangeByServerResponse(dispatch);
const navigate = useNavigate(dispatch);
useServerActionDispatcher(dispatch);
/**
* The app router that is exposed through `useRouter`. It's only concerned with dispatching actions to the reducer, does not hold state.
*/ const appRouter = (0, _react.useMemo)(()=>{
const routerInstance = {
back: ()=>window.history.back(),
forward: ()=>window.history.forward(),
prefetch: (href, options)=>{
// Don't prefetch for bots as they don't navigate.
// Don't prefetch during development (improves compilation performance)
if ((0, _isbot.isBot)(window.navigator.userAgent) || process.env.NODE_ENV === "development") {
return;
}
const url = new URL((0, _addbasepath.addBasePath)(href), location.href);
// External urls can't be prefetched in the same way.
if (isExternalURL(url)) {
return;
}
(0, _react.startTransition)(()=>{
var _options_kind;
dispatch({
type: _routerreducertypes.ACTION_PREFETCH,
url,
kind: (_options_kind = options == null ? void 0 : options.kind) != null ? _options_kind : _routerreducertypes.PrefetchKind.FULL
});
});
},
replace: (href, options)=>{
if (options === void 0) options = {};
(0, _react.startTransition)(()=>{
var _options_scroll;
navigate(href, "replace", Boolean(options.forceOptimisticNavigation), (_options_scroll = options.scroll) != null ? _options_scroll : true);
});
},
push: (href, options)=>{
if (options === void 0) options = {};
(0, _react.startTransition)(()=>{
var _options_scroll;
navigate(href, "push", Boolean(options.forceOptimisticNavigation), (_options_scroll = options.scroll) != null ? _options_scroll : true);
});
},
refresh: ()=>{
(0, _react.startTransition)(()=>{
dispatch({
type: _routerreducertypes.ACTION_REFRESH,
cache: createEmptyCacheNode(),
mutable: {
globalMutable
},
origin: window.location.origin
});
});
},
// @ts-ignore we don't want to expose this method at all
fastRefresh: ()=>{
if (process.env.NODE_ENV !== "development") {
throw new Error("fastRefresh can only be used in development mode. Please use refresh instead.");
} else {
(0, _react.startTransition)(()=>{
dispatch({
type: _routerreducertypes.ACTION_FAST_REFRESH,
cache: createEmptyCacheNode(),
mutable: {
globalMutable
},
origin: window.location.origin
});
});
}
}
};
return routerInstance;
}, [
dispatch,
navigate
]);
(0, _react.useEffect)(()=>{
// Exists for debugging purposes. Don't use in application code.
if (window.next) {
window.next.router = appRouter;
}
}, [
appRouter
]);
(0, _react.useEffect)(()=>{
globalMutable.refresh = appRouter.refresh;
}, [
appRouter.refresh
]);
if (process.env.NODE_ENV !== "production") {
// This hook is in a conditional but that is ok because `process.env.NODE_ENV` never changes
// eslint-disable-next-line react-hooks/rules-of-hooks
(0, _react.useEffect)(()=>{
// Add `window.nd` for debugging purposes.
// This is not meant for use in applications as concurrent rendering will affect the cache/tree/router.
// @ts-ignore this is for debugging
window.nd = {
router: appRouter,
cache,
prefetchCache,
tree
};
}, [
appRouter,
cache,
prefetchCache,
tree
]);
}
(0, _react.useEffect)(()=>{
// If the app is restored from bfcache, it's possible that
// pushRef.mpaNavigation is true, which would mean that any re-render of this component
// would trigger the mpa navigation logic again from the lines below.
// This will restore the router to the initial state in the event that the app is restored from bfcache.
function handlePageShow(event) {
var _window_history_state;
if (!event.persisted || !((_window_history_state = window.history.state) == null ? void 0 : _window_history_state.tree)) return;
dispatch({
type: _routerreducertypes.ACTION_RESTORE,
url: new URL(window.location.href),
tree: window.history.state.tree
});
}
window.addEventListener("pageshow", handlePageShow);
return ()=>{
window.removeEventListener("pageshow", handlePageShow);
};
}, [
dispatch
]);
// When mpaNavigation flag is set do a hard navigation to the new url.
// Infinitely suspend because we don't actually want to rerender any child
// components with the new URL and any entangled state updates shouldn't
// commit either (eg: useTransition isPending should stay true until the page
// unloads).
//
// This is a side effect in render. Don't try this at home, kids. It's
// probably safe because we know this is a singleton component and it's never
// in <Offscreen>. At least I hope so. (It will run twice in dev strict mode,
// but that's... fine?)
if (pushRef.mpaNavigation) {
// if there's a re-render, we don't want to trigger another redirect if one is already in flight to the same URL
if (globalMutable.pendingMpaPath !== canonicalUrl) {
const location1 = window.location;
if (pushRef.pendingPush) {
location1.assign(canonicalUrl);
} else {
location1.replace(canonicalUrl);
}
globalMutable.pendingMpaPath = canonicalUrl;
}
// TODO-APP: Should we listen to navigateerror here to catch failed
// navigations somehow? And should we call window.stop() if a SPA navigation
// should interrupt an MPA one?
(0, _react.use)((0, _infinitepromise.createInfinitePromise)());
}
/**
* Handle popstate event, this is used to handle back/forward in the browser.
* By default dispatches ACTION_RESTORE, however if the history entry was not pushed/replaced by app-router it will reload the page.
* That case can happen when the old router injected the history entry.
*/ const onPopState = (0, _react.useCallback)((param)=>{
let { state } = param;
if (!state) {
// TODO-APP: this case only happens when pushState/replaceState was called outside of Next.js. It should probably reload the page in this case.
return;
}
// This case happens when the history entry was pushed by the `pages` router.
if (!state.__NA) {
window.location.reload();
return;
}
// @ts-ignore useTransition exists
// TODO-APP: Ideally the back button should not use startTransition as it should apply the updates synchronously
// Without startTransition works if the cache is there for this path
(0, _react.startTransition)(()=>{
dispatch({
type: _routerreducertypes.ACTION_RESTORE,
url: new URL(window.location.href),
tree: state.tree
});
});
}, [
dispatch
]);
// Register popstate event to call onPopstate.
(0, _react.useEffect)(()=>{
window.addEventListener("popstate", onPopState);
return ()=>{
window.removeEventListener("popstate", onPopState);
};
}, [
onPopState
]);
const head = (0, _react.useMemo)(()=>{
return (0, _findheadincache.findHeadInCache)(cache, tree[1]);
}, [
cache,
tree
]);
let content = /*#__PURE__*/ _react.default.createElement(_redirectboundary.RedirectBoundary, null, head, cache.subTreeData, /*#__PURE__*/ _react.default.createElement(_approuterannouncer.AppRouterAnnouncer, {
tree: tree
}));
if (process.env.NODE_ENV !== "production") {
if (typeof window !== "undefined") {
const DevRootNotFoundBoundary = require("./dev-root-not-found-boundary").DevRootNotFoundBoundary;
content = /*#__PURE__*/ _react.default.createElement(DevRootNotFoundBoundary, null, content);
}
const HotReloader = require("./react-dev-overlay/hot-reloader-client").default;
content = /*#__PURE__*/ _react.default.createElement(HotReloader, {
assetPrefix: assetPrefix
}, content);
}
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(HistoryUpdater, {
tree: tree,
pushRef: pushRef,
canonicalUrl: canonicalUrl,
sync: sync
}), /*#__PURE__*/ _react.default.createElement(_hooksclientcontextsharedruntime.PathnameContext.Provider, {
value: pathname
}, /*#__PURE__*/ _react.default.createElement(_hooksclientcontextsharedruntime.SearchParamsContext.Provider, {
value: searchParams
}, /*#__PURE__*/ _react.default.createElement(_approutercontextsharedruntime.GlobalLayoutRouterContext.Provider, {
value: {
buildId,
changeByServerResponse,
tree,
focusAndScrollRef,
nextUrl
}
}, /*#__PURE__*/ _react.default.createElement(_approutercontextsharedruntime.AppRouterContext.Provider, {
value: appRouter
}, /*#__PURE__*/ _react.default.createElement(_approutercontextsharedruntime.LayoutRouterContext.Provider, {
value: {
childNodes: cache.parallelRoutes,
tree: tree,
// Root node always has `url`
// Provided in AppTreeContext to ensure it can be overwritten in layout-router
url: canonicalUrl
}
}, content))))));
}
function AppRouter(props) {
const { globalErrorComponent, ...rest } = props;
return /*#__PURE__*/ _react.default.createElement(_errorboundary.ErrorBoundary, {
errorComponent: globalErrorComponent
}, /*#__PURE__*/ _react.default.createElement(Router, rest));
}
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=app-router.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
/// <reference types="node" />
import type { AsyncLocalStorage } from 'async_hooks';
export declare function createAsyncLocalStorage<Store extends {}>(): AsyncLocalStorage<Store>;

View File

@@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "createAsyncLocalStorage", {
enumerable: true,
get: function() {
return createAsyncLocalStorage;
}
});
const sharedAsyncLocalStorageNotAvailableError = new Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");
class FakeAsyncLocalStorage {
disable() {
throw sharedAsyncLocalStorageNotAvailableError;
}
getStore() {
// This fake implementation of AsyncLocalStorage always returns `undefined`.
return undefined;
}
run() {
throw sharedAsyncLocalStorageNotAvailableError;
}
exit() {
throw sharedAsyncLocalStorageNotAvailableError;
}
enterWith() {
throw sharedAsyncLocalStorageNotAvailableError;
}
}
const maybeGlobalAsyncLocalStorage = globalThis.AsyncLocalStorage;
function createAsyncLocalStorage() {
if (maybeGlobalAsyncLocalStorage) {
return new maybeGlobalAsyncLocalStorage();
}
return new FakeAsyncLocalStorage();
}
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=async-local-storage.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/async-local-storage.ts"],"names":["createAsyncLocalStorage","sharedAsyncLocalStorageNotAvailableError","Error","FakeAsyncLocalStorage","disable","getStore","undefined","run","exit","enterWith","maybeGlobalAsyncLocalStorage","globalThis","AsyncLocalStorage"],"mappings":";;;;+BAiCgBA;;;eAAAA;;;AA/BhB,MAAMC,2CAA2C,IAAIC,MACnD;AAGF,MAAMC;IAGJC,UAAgB;QACd,MAAMH;IACR;IAEAI,WAA8B;QAC5B,4EAA4E;QAC5E,OAAOC;IACT;IAEAC,MAAY;QACV,MAAMN;IACR;IAEAO,OAAa;QACX,MAAMP;IACR;IAEAQ,YAAkB;QAChB,MAAMR;IACR;AACF;AAEA,MAAMS,+BAA+B,AAACC,WAAmBC,iBAAiB;AAEnE,SAASZ;IAGd,IAAIU,8BAA8B;QAChC,OAAO,IAAIA;IACb;IACA,OAAO,IAAIP;AACb"}

View File

@@ -0,0 +1 @@
export declare function bailoutToClientRendering(): boolean | never;

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "bailoutToClientRendering", {
enumerable: true,
get: function() {
return bailoutToClientRendering;
}
});
const _dynamicnossr = require("../../shared/lib/lazy-dynamic/dynamic-no-ssr");
const _staticgenerationasyncstorageexternal = require("./static-generation-async-storage.external");
function bailoutToClientRendering() {
const staticGenerationStore = _staticgenerationasyncstorageexternal.staticGenerationAsyncStorage.getStore();
if (staticGenerationStore == null ? void 0 : staticGenerationStore.forceStatic) {
return true;
}
if (staticGenerationStore == null ? void 0 : staticGenerationStore.isStaticGeneration) {
(0, _dynamicnossr.suspense)();
}
return false;
}
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=bailout-to-client-rendering.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/bailout-to-client-rendering.ts"],"names":["bailoutToClientRendering","staticGenerationStore","staticGenerationAsyncStorage","getStore","forceStatic","isStaticGeneration","suspense"],"mappings":";;;;+BAGgBA;;;eAAAA;;;8BAHS;sDACoB;AAEtC,SAASA;IACd,MAAMC,wBAAwBC,kEAA4B,CAACC,QAAQ;IAEnE,IAAIF,yCAAAA,sBAAuBG,WAAW,EAAE;QACtC,OAAO;IACT;IAEA,IAAIH,yCAAAA,sBAAuBI,kBAAkB,EAAE;QAC7CC,IAAAA,sBAAQ;IACV;IAEA,OAAO;AACT"}

View File

@@ -0,0 +1 @@
export declare function clientHookInServerComponentError(hookName: string): void | never;

View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "clientHookInServerComponentError", {
enumerable: true,
get: function() {
return clientHookInServerComponentError;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
function clientHookInServerComponentError(hookName) {
if (process.env.NODE_ENV !== "production") {
// If useState is undefined we're in a server component
if (!_react.default.useState) {
throw new Error("" + hookName + ' only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/react-client-hook-in-server-component');
}
}
}
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=client-hook-in-server-component-error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/client-hook-in-server-component-error.ts"],"names":["clientHookInServerComponentError","hookName","process","env","NODE_ENV","React","useState","Error"],"mappings":";;;;+BAEgBA;;;eAAAA;;;;gEAFE;AAEX,SAASA,iCACdC,QAAgB;IAEhB,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,uDAAuD;QACvD,IAAI,CAACC,cAAK,CAACC,QAAQ,EAAE;YACnB,MAAM,IAAIC,MACR,AAAC,KAAEN,WAAS;QAEhB;IACF;AACF"}

View File

@@ -0,0 +1,4 @@
import React from 'react';
export default function DefaultLayout({ children, }: {
children: React.ReactNode;
}): React.JSX.Element;

View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return DefaultLayout;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
function DefaultLayout(param) {
let { children } = param;
return /*#__PURE__*/ _react.default.createElement("html", null, /*#__PURE__*/ _react.default.createElement("body", null, children));
}
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=default-layout.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/default-layout.tsx"],"names":["DefaultLayout","children","html","body"],"mappings":";;;;+BAEA;;;eAAwBA;;;;gEAFN;AAEH,SAASA,cAAc,KAIrC;IAJqC,IAAA,EACpCC,QAAQ,EAGT,GAJqC;IAKpC,qBACE,6BAACC,4BACC,6BAACC,cAAMF;AAGb"}

View File

@@ -0,0 +1,5 @@
import React from 'react';
export declare function bailOnNotFound(): void;
export declare function DevRootNotFoundBoundary({ children, }: {
children: React.ReactNode;
}): React.JSX.Element;

View File

@@ -0,0 +1,48 @@
"use client";
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
bailOnNotFound: null,
DevRootNotFoundBoundary: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
bailOnNotFound: function() {
return bailOnNotFound;
},
DevRootNotFoundBoundary: function() {
return DevRootNotFoundBoundary;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
const _notfoundboundary = require("./not-found-boundary");
function bailOnNotFound() {
throw new Error("notFound() is not allowed to use in root layout");
}
function NotAllowedRootNotFoundError() {
bailOnNotFound();
return null;
}
function DevRootNotFoundBoundary(param) {
let { children } = param;
return /*#__PURE__*/ _react.default.createElement(_notfoundboundary.NotFoundBoundary, {
notFound: /*#__PURE__*/ _react.default.createElement(NotAllowedRootNotFoundError, null)
}, children);
}
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=dev-root-not-found-boundary.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/dev-root-not-found-boundary.tsx"],"names":["bailOnNotFound","DevRootNotFoundBoundary","Error","NotAllowedRootNotFoundError","children","NotFoundBoundary","notFound"],"mappings":"AAAA;;;;;;;;;;;;;;;;IAKgBA,cAAc;eAAdA;;IASAC,uBAAuB;eAAvBA;;;;gEAZE;kCACe;AAE1B,SAASD;IACd,MAAM,IAAIE,MAAM;AAClB;AAEA,SAASC;IACPH;IACA,OAAO;AACT;AAEO,SAASC,wBAAwB,KAIvC;IAJuC,IAAA,EACtCG,QAAQ,EAGT,GAJuC;IAKtC,qBACE,6BAACC,kCAAgB;QAACC,wBAAU,6BAACH;OAC1BC;AAGP"}

View File

@@ -0,0 +1,7 @@
import type { DraftModeProvider } from '../../server/async-storage/draft-mode-provider';
export declare class DraftMode {
constructor(provider: DraftModeProvider);
get isEnabled(): boolean;
enable(): void;
disable(): void;
}

39
node_modules/next/dist/client/components/draft-mode.js generated vendored Normal file
View File

@@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DraftMode", {
enumerable: true,
get: function() {
return DraftMode;
}
});
const _staticgenerationbailout = require("./static-generation-bailout");
class DraftMode {
get isEnabled() {
return this._provider.isEnabled;
}
enable() {
if ((0, _staticgenerationbailout.staticGenerationBailout)("draftMode().enable()")) {
return;
}
return this._provider.enable();
}
disable() {
if ((0, _staticgenerationbailout.staticGenerationBailout)("draftMode().disable()")) {
return;
}
return this._provider.disable();
}
constructor(provider){
this._provider = provider;
}
}
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=draft-mode.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/draft-mode.ts"],"names":["DraftMode","isEnabled","_provider","enable","staticGenerationBailout","disable","constructor","provider"],"mappings":";;;;+BAIaA;;;eAAAA;;;yCAF2B;AAEjC,MAAMA;IASX,IAAIC,YAAY;QACd,OAAO,IAAI,CAACC,SAAS,CAACD,SAAS;IACjC;IACOE,SAAS;QACd,IAAIC,IAAAA,gDAAuB,EAAC,yBAAyB;YACnD;QACF;QACA,OAAO,IAAI,CAACF,SAAS,CAACC,MAAM;IAC9B;IACOE,UAAU;QACf,IAAID,IAAAA,gDAAuB,EAAC,0BAA0B;YACpD;QACF;QACA,OAAO,IAAI,CAACF,SAAS,CAACG,OAAO;IAC/B;IAjBAC,YAAYC,QAA2B,CAAE;QACvC,IAAI,CAACL,SAAS,GAAGK;IACnB;AAgBF"}

View File

@@ -0,0 +1,42 @@
/// <reference types="react/experimental" />
import React from 'react';
export type ErrorComponent = React.ComponentType<{
error: Error;
reset: () => void;
}>;
export interface ErrorBoundaryProps {
children?: React.ReactNode;
errorComponent: ErrorComponent;
errorStyles?: React.ReactNode | undefined;
}
interface ErrorBoundaryHandlerProps extends ErrorBoundaryProps {
pathname: string;
}
interface ErrorBoundaryHandlerState {
error: Error | null;
previousPathname: string;
}
export declare class ErrorBoundaryHandler extends React.Component<ErrorBoundaryHandlerProps, ErrorBoundaryHandlerState> {
constructor(props: ErrorBoundaryHandlerProps);
static getDerivedStateFromError(error: Error): {
error: Error;
};
static getDerivedStateFromProps(props: ErrorBoundaryHandlerProps, state: ErrorBoundaryHandlerState): ErrorBoundaryHandlerState | null;
reset: () => void;
render(): string | number | boolean | React.ReactFragment | React.PromiseLikeOfReactNode | React.JSX.Element | null | undefined;
}
export declare function GlobalError({ error }: {
error: any;
}): React.JSX.Element;
export default GlobalError;
/**
* Handles errors through `getDerivedStateFromError`.
* Renders the provided error component and provides a way to `reset` the error boundary state.
*/
/**
* Renders error boundary with the provided "errorComponent" property as the fallback.
* If no "errorComponent" property is provided it renders the children without an error boundary.
*/
export declare function ErrorBoundary({ errorComponent, errorStyles, children, }: ErrorBoundaryProps & {
children: React.ReactNode;
}): JSX.Element;

View File

@@ -0,0 +1,134 @@
"use client";
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
ErrorBoundaryHandler: null,
GlobalError: null,
default: null,
ErrorBoundary: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
ErrorBoundaryHandler: function() {
return ErrorBoundaryHandler;
},
GlobalError: function() {
return GlobalError;
},
// Exported so that the import signature in the loaders can be identical to user
// supplied custom global error signatures.
default: function() {
return _default;
},
ErrorBoundary: function() {
return ErrorBoundary;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
const _navigation = require("./navigation");
const styles = {
error: {
// https://github.com/sindresorhus/modern-normalize/blob/main/modern-normalize.css#L38-L52
fontFamily: 'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',
height: "100vh",
textAlign: "center",
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center"
},
text: {
fontSize: "14px",
fontWeight: 400,
lineHeight: "28px",
margin: "0 8px"
}
};
class ErrorBoundaryHandler extends _react.default.Component {
static getDerivedStateFromError(error) {
return {
error
};
}
static getDerivedStateFromProps(props, state) {
/**
* Handles reset of the error boundary when a navigation happens.
* Ensures the error boundary does not stay enabled when navigating to a new page.
* Approach of setState in render is safe as it checks the previous pathname and then overrides
* it as outlined in https://react.dev/reference/react/useState#storing-information-from-previous-renders
*/ if (props.pathname !== state.previousPathname && state.error) {
return {
error: null,
previousPathname: props.pathname
};
}
return {
error: state.error,
previousPathname: props.pathname
};
}
render() {
if (this.state.error) {
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, this.props.errorStyles, /*#__PURE__*/ _react.default.createElement(this.props.errorComponent, {
error: this.state.error,
reset: this.reset
}));
}
return this.props.children;
}
constructor(props){
super(props);
this.reset = ()=>{
this.setState({
error: null
});
};
this.state = {
error: null,
previousPathname: this.props.pathname
};
}
}
function GlobalError(param) {
let { error } = param;
const digest = error == null ? void 0 : error.digest;
return /*#__PURE__*/ _react.default.createElement("html", {
id: "__next_error__"
}, /*#__PURE__*/ _react.default.createElement("head", null), /*#__PURE__*/ _react.default.createElement("body", null, /*#__PURE__*/ _react.default.createElement("div", {
style: styles.error
}, /*#__PURE__*/ _react.default.createElement("div", null, /*#__PURE__*/ _react.default.createElement("h2", {
style: styles.text
}, "Application error: a " + (digest ? "server" : "client") + "-side exception has occurred (see the " + (digest ? "server logs" : "browser console") + " for more information)."), digest ? /*#__PURE__*/ _react.default.createElement("p", {
style: styles.text
}, "Digest: " + digest) : null))));
}
const _default = GlobalError;
function ErrorBoundary(param) {
let { errorComponent, errorStyles, children } = param;
const pathname = (0, _navigation.usePathname)();
if (errorComponent) {
return /*#__PURE__*/ _react.default.createElement(ErrorBoundaryHandler, {
pathname: pathname,
errorComponent: errorComponent,
errorStyles: errorStyles
}, children);
}
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, children);
}
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=error-boundary.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/error-boundary.tsx"],"names":["ErrorBoundaryHandler","GlobalError","ErrorBoundary","styles","error","fontFamily","height","textAlign","display","flexDirection","alignItems","justifyContent","text","fontSize","fontWeight","lineHeight","margin","React","Component","getDerivedStateFromError","getDerivedStateFromProps","props","state","pathname","previousPathname","render","errorStyles","this","errorComponent","reset","children","constructor","setState","digest","html","id","head","body","div","style","h2","p","usePathname"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;IA6CaA,oBAAoB;eAApBA;;IAwDGC,WAAW;eAAXA;;IAuBhB,gFAAgF;IAChF,2CAA2C;IAC3C,OAA0B;eAA1B;;IAWgBC,aAAa;eAAbA;;;;gEAvIE;4BACU;AAE5B,MAAMC,SAAS;IACbC,OAAO;QACL,0FAA0F;QAC1FC,YACE;QACFC,QAAQ;QACRC,WAAW;QACXC,SAAS;QACTC,eAAe;QACfC,YAAY;QACZC,gBAAgB;IAClB;IACAC,MAAM;QACJC,UAAU;QACVC,YAAY;QACZC,YAAY;QACZC,QAAQ;IACV;AACF;AAsBO,MAAMhB,6BAA6BiB,cAAK,CAACC,SAAS;IASvD,OAAOC,yBAAyBf,KAAY,EAAE;QAC5C,OAAO;YAAEA;QAAM;IACjB;IAEA,OAAOgB,yBACLC,KAAgC,EAChCC,KAAgC,EACE;QAClC;;;;;KAKC,GACD,IAAID,MAAME,QAAQ,KAAKD,MAAME,gBAAgB,IAAIF,MAAMlB,KAAK,EAAE;YAC5D,OAAO;gBACLA,OAAO;gBACPoB,kBAAkBH,MAAME,QAAQ;YAClC;QACF;QACA,OAAO;YACLnB,OAAOkB,MAAMlB,KAAK;YAClBoB,kBAAkBH,MAAME,QAAQ;QAClC;IACF;IAMAE,SAAS;QACP,IAAI,IAAI,CAACH,KAAK,CAAClB,KAAK,EAAE;YACpB,qBACE,4DACG,IAAI,CAACiB,KAAK,CAACK,WAAW,gBACvB,6BAACC,IAAI,CAACN,KAAK,CAACO,cAAc;gBACxBxB,OAAO,IAAI,CAACkB,KAAK,CAAClB,KAAK;gBACvByB,OAAO,IAAI,CAACA,KAAK;;QAIzB;QAEA,OAAO,IAAI,CAACR,KAAK,CAACS,QAAQ;IAC5B;IAjDAC,YAAYV,KAAgC,CAAE;QAC5C,KAAK,CAACA;aA8BRQ,QAAQ;YACN,IAAI,CAACG,QAAQ,CAAC;gBAAE5B,OAAO;YAAK;QAC9B;QA/BE,IAAI,CAACkB,KAAK,GAAG;YAAElB,OAAO;YAAMoB,kBAAkB,IAAI,CAACH,KAAK,CAACE,QAAQ;QAAC;IACpE;AA+CF;AAEO,SAAStB,YAAY,KAAyB;IAAzB,IAAA,EAAEG,KAAK,EAAkB,GAAzB;IAC1B,MAAM6B,SAA6B7B,yBAAAA,MAAO6B,MAAM;IAChD,qBACE,6BAACC;QAAKC,IAAG;qBACP,6BAACC,6BACD,6BAACC,4BACC,6BAACC;QAAIC,OAAOpC,OAAOC,KAAK;qBACtB,6BAACkC,2BACC,6BAACE;QAAGD,OAAOpC,OAAOS,IAAI;OACnB,AAAC,0BACAqB,CAAAA,SAAS,WAAW,QAAO,IAC5B,2CACCA,CAAAA,SAAS,gBAAgB,iBAAgB,IAC1C,4BAEFA,uBAAS,6BAACQ;QAAEF,OAAOpC,OAAOS,IAAI;OAAG,AAAC,aAAUqB,UAAgB;AAMzE;MAIA,WAAehC;AAWR,SAASC,cAAc,KAIuB;IAJvB,IAAA,EAC5B0B,cAAc,EACdF,WAAW,EACXI,QAAQ,EAC2C,GAJvB;IAK5B,MAAMP,WAAWmB,IAAAA,uBAAW;IAC5B,IAAId,gBAAgB;QAClB,qBACE,6BAAC5B;YACCuB,UAAUA;YACVK,gBAAgBA;YAChBF,aAAaA;WAEZI;IAGP;IAEA,qBAAO,4DAAGA;AACZ"}

View File

@@ -0,0 +1,2 @@
import { type RedirectError } from './redirect';
export declare function getRedirectStatusCodeFromError<U extends string>(error: RedirectError<U>): number;

View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getRedirectStatusCodeFromError", {
enumerable: true,
get: function() {
return getRedirectStatusCodeFromError;
}
});
const _redirect = require("./redirect");
function getRedirectStatusCodeFromError(error) {
if (!(0, _redirect.isRedirectError)(error)) {
throw new Error("Not a redirect error");
}
return error.digest.split(";", 4)[3] === "true" ? 308 : 307;
}
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=get-redirect-status-code-from-error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/get-redirect-status-code-from-error.ts"],"names":["getRedirectStatusCodeFromError","error","isRedirectError","Error","digest","split"],"mappings":";;;;+BAEgBA;;;eAAAA;;;0BAFoC;AAE7C,SAASA,+BACdC,KAAuB;IAEvB,IAAI,CAACC,IAAAA,yBAAe,EAACD,QAAQ;QAC3B,MAAM,IAAIE,MAAM;IAClB;IAEA,OAAOF,MAAMG,MAAM,CAACC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,SAAS,MAAM;AAC1D"}

View File

@@ -0,0 +1,5 @@
import { type ReadonlyRequestCookies } from '../../server/web/spec-extension/adapters/request-cookies';
import { DraftMode } from './draft-mode';
export declare function headers(): import("../../server/web/spec-extension/adapters/headers").ReadonlyHeaders;
export declare function cookies(): ReadonlyRequestCookies;
export declare function draftMode(): DraftMode;

78
node_modules/next/dist/client/components/headers.js generated vendored Normal file
View File

@@ -0,0 +1,78 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
headers: null,
cookies: null,
draftMode: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
headers: function() {
return headers;
},
cookies: function() {
return cookies;
},
draftMode: function() {
return draftMode;
}
});
const _requestcookies = require("../../server/web/spec-extension/adapters/request-cookies");
const _headers = require("../../server/web/spec-extension/adapters/headers");
const _cookies = require("../../server/web/spec-extension/cookies");
const _requestasyncstorageexternal = require("./request-async-storage.external");
const _actionasyncstorageexternal = require("./action-async-storage.external");
const _staticgenerationbailout = require("./static-generation-bailout");
const _draftmode = require("./draft-mode");
function headers() {
if ((0, _staticgenerationbailout.staticGenerationBailout)("headers", {
link: "https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering"
})) {
return _headers.HeadersAdapter.seal(new Headers({}));
}
const requestStore = _requestasyncstorageexternal.requestAsyncStorage.getStore();
if (!requestStore) {
throw new Error("Invariant: headers() expects to have requestAsyncStorage, none available.");
}
return requestStore.headers;
}
function cookies() {
if ((0, _staticgenerationbailout.staticGenerationBailout)("cookies", {
link: "https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering"
})) {
return _requestcookies.RequestCookiesAdapter.seal(new _cookies.RequestCookies(new Headers({})));
}
const requestStore = _requestasyncstorageexternal.requestAsyncStorage.getStore();
if (!requestStore) {
throw new Error("Invariant: cookies() expects to have requestAsyncStorage, none available.");
}
const asyncActionStore = _actionasyncstorageexternal.actionAsyncStorage.getStore();
if (asyncActionStore && (asyncActionStore.isAction || asyncActionStore.isAppRoute)) {
// We can't conditionally return different types here based on the context.
// To avoid confusion, we always return the readonly type here.
return requestStore.mutableCookies;
}
return requestStore.cookies;
}
function draftMode() {
const requestStore = _requestasyncstorageexternal.requestAsyncStorage.getStore();
if (!requestStore) {
throw new Error("Invariant: draftMode() expects to have requestAsyncStorage, none available.");
}
return new _draftmode.DraftMode(requestStore.draftMode);
}
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=headers.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/headers.ts"],"names":["headers","cookies","draftMode","staticGenerationBailout","link","HeadersAdapter","seal","Headers","requestStore","requestAsyncStorage","getStore","Error","RequestCookiesAdapter","RequestCookies","asyncActionStore","actionAsyncStorage","isAction","isAppRoute","mutableCookies","DraftMode"],"mappings":";;;;;;;;;;;;;;;;IAWgBA,OAAO;eAAPA;;IAkBAC,OAAO;eAAPA;;IA6BAC,SAAS;eAATA;;;gCAvDT;yBACwB;yBACA;6CACK;4CACD;yCACK;2BACd;AAEnB,SAASF;IACd,IACEG,IAAAA,gDAAuB,EAAC,WAAW;QACjCC,MAAM;IACR,IACA;QACA,OAAOC,uBAAc,CAACC,IAAI,CAAC,IAAIC,QAAQ,CAAC;IAC1C;IACA,MAAMC,eAAeC,gDAAmB,CAACC,QAAQ;IACjD,IAAI,CAACF,cAAc;QACjB,MAAM,IAAIG,MACP;IAEL;IAEA,OAAOH,aAAaR,OAAO;AAC7B;AAEO,SAASC;IACd,IACEE,IAAAA,gDAAuB,EAAC,WAAW;QACjCC,MAAM;IACR,IACA;QACA,OAAOQ,qCAAqB,CAACN,IAAI,CAAC,IAAIO,uBAAc,CAAC,IAAIN,QAAQ,CAAC;IACpE;IAEA,MAAMC,eAAeC,gDAAmB,CAACC,QAAQ;IACjD,IAAI,CAACF,cAAc;QACjB,MAAM,IAAIG,MACP;IAEL;IAEA,MAAMG,mBAAmBC,8CAAkB,CAACL,QAAQ;IACpD,IACEI,oBACCA,CAAAA,iBAAiBE,QAAQ,IAAIF,iBAAiBG,UAAU,AAAD,GACxD;QACA,2EAA2E;QAC3E,+DAA+D;QAC/D,OAAOT,aAAaU,cAAc;IACpC;IAEA,OAAOV,aAAaP,OAAO;AAC7B;AAEO,SAASC;IACd,MAAMM,eAAeC,gDAAmB,CAACC,QAAQ;IACjD,IAAI,CAACF,cAAc;QACjB,MAAM,IAAIG,MACP;IAEL;IACA,OAAO,IAAIQ,oBAAS,CAACX,aAAaN,SAAS;AAC7C"}

View File

@@ -0,0 +1,5 @@
export declare const DYNAMIC_ERROR_CODE = "DYNAMIC_SERVER_USAGE";
export declare class DynamicServerError extends Error {
digest: typeof DYNAMIC_ERROR_CODE;
constructor(type: string);
}

View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
DYNAMIC_ERROR_CODE: null,
DynamicServerError: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
DYNAMIC_ERROR_CODE: function() {
return DYNAMIC_ERROR_CODE;
},
DynamicServerError: function() {
return DynamicServerError;
}
});
const DYNAMIC_ERROR_CODE = "DYNAMIC_SERVER_USAGE";
class DynamicServerError extends Error {
constructor(type){
super("Dynamic server usage: " + type);
this.digest = DYNAMIC_ERROR_CODE;
}
}
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=hooks-server-context.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/hooks-server-context.ts"],"names":["DYNAMIC_ERROR_CODE","DynamicServerError","Error","constructor","type","digest"],"mappings":";;;;;;;;;;;;;;;IAAaA,kBAAkB;eAAlBA;;IAEAC,kBAAkB;eAAlBA;;;AAFN,MAAMD,qBAAqB;AAE3B,MAAMC,2BAA2BC;IAGtCC,YAAYC,IAAY,CAAE;QACxB,KAAK,CAAC,AAAC,2BAAwBA;aAHjCC,SAAoCL;IAIpC;AACF"}

View File

@@ -0,0 +1,4 @@
/**
* Create a Promise that does not resolve. This is used to suspend when data is not available yet.
*/
export declare function createInfinitePromise(): Promise<void>;

View File

@@ -0,0 +1,34 @@
/**
* Used to cache in createInfinitePromise
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "createInfinitePromise", {
enumerable: true,
get: function() {
return createInfinitePromise;
}
});
let infinitePromise;
function createInfinitePromise() {
if (!infinitePromise) {
// Only create the Promise once
infinitePromise = new Promise(()=>{
// This is used to debug when the rendering is never updated.
// setTimeout(() => {
// infinitePromise = new Error('Infinite promise')
// resolve()
// }, 5000)
});
}
return infinitePromise;
}
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=infinite-promise.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/infinite-promise.ts"],"names":["createInfinitePromise","infinitePromise","Promise"],"mappings":"AAAA;;CAEC;;;;+BAMeA;;;eAAAA;;;AALhB,IAAIC;AAKG,SAASD;IACd,IAAI,CAACC,iBAAiB;QACpB,+BAA+B;QAC/BA,kBAAkB,IAAIC,QAAQ;QAC5B,6DAA6D;QAC7D,qBAAqB;QACrB,oDAAoD;QACpD,cAAc;QACd,WAAW;QACb;IACF;IAEA,OAAOD;AACT"}

View File

@@ -0,0 +1 @@
export declare function isNextRouterError(error: any): boolean;

View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "isNextRouterError", {
enumerable: true,
get: function() {
return isNextRouterError;
}
});
const _notfound = require("./not-found");
const _redirect = require("./redirect");
function isNextRouterError(error) {
return error && error.digest && ((0, _redirect.isRedirectError)(error) || (0, _notfound.isNotFoundError)(error));
}
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=is-next-router-error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/is-next-router-error.ts"],"names":["isNextRouterError","error","digest","isRedirectError","isNotFoundError"],"mappings":";;;;+BAGgBA;;;eAAAA;;;0BAHgB;0BACA;AAEzB,SAASA,kBAAkBC,KAAU;IAC1C,OACEA,SAASA,MAAMC,MAAM,IAAKC,CAAAA,IAAAA,yBAAe,EAACF,UAAUG,IAAAA,yBAAe,EAACH,MAAK;AAE7E"}

View File

@@ -0,0 +1,22 @@
import type { FlightSegmentPath, ChildProp } from '../../server/app-render/types';
import type { ErrorComponent } from './error-boundary';
import React from 'react';
/**
* OuterLayoutRouter handles the current segment as well as <Offscreen> rendering of other segments.
* It can be rendered next to each other with a different `parallelRouterKey`, allowing for Parallel routes.
*/
export default function OuterLayoutRouter({ parallelRouterKey, segmentPath, childProp, error, errorStyles, templateStyles, loading, loadingStyles, hasLoading, template, notFound, notFoundStyles, styles, }: {
parallelRouterKey: string;
segmentPath: FlightSegmentPath;
childProp: ChildProp;
error: ErrorComponent;
errorStyles: React.ReactNode | undefined;
templateStyles: React.ReactNode | undefined;
template: React.ReactNode;
loading: React.ReactNode | undefined;
loadingStyles: React.ReactNode | undefined;
hasLoading: boolean;
notFound: React.ReactNode | undefined;
notFoundStyles: React.ReactNode | undefined;
styles?: React.ReactNode;
}): React.JSX.Element;

View File

@@ -0,0 +1,424 @@
"use client";
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, /**
* OuterLayoutRouter handles the current segment as well as <Offscreen> rendering of other segments.
* It can be rendered next to each other with a different `parallelRouterKey`, allowing for Parallel routes.
*/ "default", {
enumerable: true,
get: function() {
return OuterLayoutRouter;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactdom = /*#__PURE__*/ _interop_require_default._(require("react-dom"));
const _approutercontextsharedruntime = require("../../shared/lib/app-router-context.shared-runtime");
const _fetchserverresponse = require("./router-reducer/fetch-server-response");
const _infinitepromise = require("./infinite-promise");
const _errorboundary = require("./error-boundary");
const _matchsegments = require("./match-segments");
const _handlesmoothscroll = require("../../shared/lib/router/utils/handle-smooth-scroll");
const _redirectboundary = require("./redirect-boundary");
const _notfoundboundary = require("./not-found-boundary");
const _getsegmentvalue = require("./router-reducer/reducers/get-segment-value");
const _createroutercachekey = require("./router-reducer/create-router-cache-key");
/**
* Add refetch marker to router state at the point of the current layout segment.
* This ensures the response returned is not further down than the current layout segment.
*/ function walkAddRefetch(segmentPathToWalk, treeToRecreate) {
if (segmentPathToWalk) {
const [segment, parallelRouteKey] = segmentPathToWalk;
const isLast = segmentPathToWalk.length === 2;
if ((0, _matchsegments.matchSegment)(treeToRecreate[0], segment)) {
if (treeToRecreate[1].hasOwnProperty(parallelRouteKey)) {
if (isLast) {
const subTree = walkAddRefetch(undefined, treeToRecreate[1][parallelRouteKey]);
return [
treeToRecreate[0],
{
...treeToRecreate[1],
[parallelRouteKey]: [
subTree[0],
subTree[1],
subTree[2],
"refetch"
]
}
];
}
return [
treeToRecreate[0],
{
...treeToRecreate[1],
[parallelRouteKey]: walkAddRefetch(segmentPathToWalk.slice(2), treeToRecreate[1][parallelRouteKey])
}
];
}
}
}
return treeToRecreate;
}
// TODO-APP: Replace with new React API for finding dom nodes without a `ref` when available
/**
* Wraps ReactDOM.findDOMNode with additional logic to hide React Strict Mode warning
*/ function findDOMNode(instance) {
// Tree-shake for server bundle
if (typeof window === "undefined") return null;
// Only apply strict mode warning when not in production
if (process.env.NODE_ENV !== "production") {
const originalConsoleError = console.error;
try {
console.error = function() {
for(var _len = arguments.length, messages = new Array(_len), _key = 0; _key < _len; _key++){
messages[_key] = arguments[_key];
}
// Ignore strict mode warning for the findDomNode call below
if (!messages[0].includes("Warning: %s is deprecated in StrictMode.")) {
originalConsoleError(...messages);
}
};
return _reactdom.default.findDOMNode(instance);
} finally{
console.error = originalConsoleError;
}
}
return _reactdom.default.findDOMNode(instance);
}
const rectProperties = [
"bottom",
"height",
"left",
"right",
"top",
"width",
"x",
"y"
];
/**
* Check if a HTMLElement is hidden or fixed/sticky position
*/ function shouldSkipElement(element) {
// we ignore fixed or sticky positioned elements since they'll likely pass the "in-viewport" check
// and will result in a situation we bail on scroll because of something like a fixed nav,
// even though the actual page content is offscreen
if ([
"sticky",
"fixed"
].includes(getComputedStyle(element).position)) {
if (process.env.NODE_ENV === "development") {
console.warn("Skipping auto-scroll behavior due to `position: sticky` or `position: fixed` on element:", element);
}
return true;
}
// Uses `getBoundingClientRect` to check if the element is hidden instead of `offsetParent`
// because `offsetParent` doesn't consider document/body
const rect = element.getBoundingClientRect();
return rectProperties.every((item)=>rect[item] === 0);
}
/**
* Check if the top corner of the HTMLElement is in the viewport.
*/ function topOfElementInViewport(element, viewportHeight) {
const rect = element.getBoundingClientRect();
return rect.top >= 0 && rect.top <= viewportHeight;
}
/**
* Find the DOM node for a hash fragment.
* If `top` the page has to scroll to the top of the page. This mirrors the browser's behavior.
* If the hash fragment is an id, the page has to scroll to the element with that id.
* If the hash fragment is a name, the page has to scroll to the first element with that name.
*/ function getHashFragmentDomNode(hashFragment) {
// If the hash fragment is `top` the page has to scroll to the top of the page.
if (hashFragment === "top") {
return document.body;
}
var _document_getElementById;
// If the hash fragment is an id, the page has to scroll to the element with that id.
return (_document_getElementById = document.getElementById(hashFragment)) != null ? _document_getElementById : // If the hash fragment is a name, the page has to scroll to the first element with that name.
document.getElementsByName(hashFragment)[0];
}
class InnerScrollAndFocusHandler extends _react.default.Component {
componentDidMount() {
this.handlePotentialScroll();
}
componentDidUpdate() {
// Because this property is overwritten in handlePotentialScroll it's fine to always run it when true as it'll be set to false for subsequent renders.
if (this.props.focusAndScrollRef.apply) {
this.handlePotentialScroll();
}
}
render() {
return this.props.children;
}
constructor(...args){
super(...args);
this.handlePotentialScroll = ()=>{
// Handle scroll and focus, it's only applied once in the first useEffect that triggers that changed.
const { focusAndScrollRef, segmentPath } = this.props;
if (focusAndScrollRef.apply) {
// segmentPaths is an array of segment paths that should be scrolled to
// if the current segment path is not in the array, the scroll is not applied
// unless the array is empty, in which case the scroll is always applied
if (focusAndScrollRef.segmentPaths.length !== 0 && !focusAndScrollRef.segmentPaths.some((scrollRefSegmentPath)=>segmentPath.every((segment, index)=>(0, _matchsegments.matchSegment)(segment, scrollRefSegmentPath[index])))) {
return;
}
let domNode = null;
const hashFragment = focusAndScrollRef.hashFragment;
if (hashFragment) {
domNode = getHashFragmentDomNode(hashFragment);
}
// `findDOMNode` is tricky because it returns just the first child if the component is a fragment.
// This already caused a bug where the first child was a <link/> in head.
if (!domNode) {
domNode = findDOMNode(this);
}
// If there is no DOM node this layout-router level is skipped. It'll be handled higher-up in the tree.
if (!(domNode instanceof Element)) {
return;
}
// Verify if the element is a HTMLElement and if we want to consider it for scroll behavior.
// If the element is skipped, try to select the next sibling and try again.
while(!(domNode instanceof HTMLElement) || shouldSkipElement(domNode)){
// No siblings found that match the criteria are found, so handle scroll higher up in the tree instead.
if (domNode.nextElementSibling === null) {
return;
}
domNode = domNode.nextElementSibling;
}
// State is mutated to ensure that the focus and scroll is applied only once.
focusAndScrollRef.apply = false;
focusAndScrollRef.hashFragment = null;
focusAndScrollRef.segmentPaths = [];
(0, _handlesmoothscroll.handleSmoothScroll)(()=>{
// In case of hash scroll, we only need to scroll the element into view
if (hashFragment) {
domNode.scrollIntoView();
return;
}
// Store the current viewport height because reading `clientHeight` causes a reflow,
// and it won't change during this function.
const htmlElement = document.documentElement;
const viewportHeight = htmlElement.clientHeight;
// If the element's top edge is already in the viewport, exit early.
if (topOfElementInViewport(domNode, viewportHeight)) {
return;
}
// Otherwise, try scrolling go the top of the document to be backward compatible with pages
// scrollIntoView() called on `<html/>` element scrolls horizontally on chrome and firefox (that shouldn't happen)
// We could use it to scroll horizontally following RTL but that also seems to be broken - it will always scroll left
// scrollLeft = 0 also seems to ignore RTL and manually checking for RTL is too much hassle so we will scroll just vertically
htmlElement.scrollTop = 0;
// Scroll to domNode if domNode is not in viewport when scrolled to top of document
if (!topOfElementInViewport(domNode, viewportHeight)) {
domNode.scrollIntoView();
}
}, {
// We will force layout by querying domNode position
dontForceLayout: true,
onlyHashChange: focusAndScrollRef.onlyHashChange
});
// Mutate after scrolling so that it can be read by `handleSmoothScroll`
focusAndScrollRef.onlyHashChange = false;
// Set focus on the element
domNode.focus();
}
};
}
}
function ScrollAndFocusHandler(param) {
let { segmentPath, children } = param;
const context = (0, _react.useContext)(_approutercontextsharedruntime.GlobalLayoutRouterContext);
if (!context) {
throw new Error("invariant global layout router not mounted");
}
return /*#__PURE__*/ _react.default.createElement(InnerScrollAndFocusHandler, {
segmentPath: segmentPath,
focusAndScrollRef: context.focusAndScrollRef
}, children);
}
/**
* InnerLayoutRouter handles rendering the provided segment based on the cache.
*/ function InnerLayoutRouter(param) {
let { parallelRouterKey, url, childNodes, childProp, segmentPath, tree, // TODO-APP: implement `<Offscreen>` when available.
// isActive,
cacheKey } = param;
const context = (0, _react.useContext)(_approutercontextsharedruntime.GlobalLayoutRouterContext);
if (!context) {
throw new Error("invariant global layout router not mounted");
}
const { buildId, changeByServerResponse, tree: fullTree } = context;
// Read segment path from the parallel router cache node.
let childNode = childNodes.get(cacheKey);
// If childProp is available this means it's the Flight / SSR case.
if (childProp && // TODO-APP: verify if this can be null based on user code
childProp.current !== null) {
if (!childNode) {
// Add the segment's subTreeData to the cache.
// This writes to the cache when there is no item in the cache yet. It never *overwrites* existing cache items which is why it's safe in concurrent mode.
childNode = {
status: _approutercontextsharedruntime.CacheStates.READY,
data: null,
subTreeData: childProp.current,
parallelRoutes: new Map()
};
childNodes.set(cacheKey, childNode);
} else {
if (childNode.status === _approutercontextsharedruntime.CacheStates.LAZY_INITIALIZED) {
// @ts-expect-error we're changing it's type!
childNode.status = _approutercontextsharedruntime.CacheStates.READY;
// @ts-expect-error
childNode.subTreeData = childProp.current;
}
}
}
// When childNode is not available during rendering client-side we need to fetch it from the server.
if (!childNode || childNode.status === _approutercontextsharedruntime.CacheStates.LAZY_INITIALIZED) {
/**
* Router state with refetch marker added
*/ // TODO-APP: remove ''
const refetchTree = walkAddRefetch([
"",
...segmentPath
], fullTree);
childNode = {
status: _approutercontextsharedruntime.CacheStates.DATA_FETCH,
data: (0, _fetchserverresponse.fetchServerResponse)(new URL(url, location.origin), refetchTree, context.nextUrl, buildId),
subTreeData: null,
head: childNode && childNode.status === _approutercontextsharedruntime.CacheStates.LAZY_INITIALIZED ? childNode.head : undefined,
parallelRoutes: childNode && childNode.status === _approutercontextsharedruntime.CacheStates.LAZY_INITIALIZED ? childNode.parallelRoutes : new Map()
};
/**
* Flight data fetch kicked off during render and put into the cache.
*/ childNodes.set(cacheKey, childNode);
}
// This case should never happen so it throws an error. It indicates there's a bug in the Next.js.
if (!childNode) {
throw new Error("Child node should always exist");
}
// This case should never happen so it throws an error. It indicates there's a bug in the Next.js.
if (childNode.subTreeData && childNode.data) {
throw new Error("Child node should not have both subTreeData and data");
}
// If cache node has a data request we have to unwrap response by `use` and update the cache.
if (childNode.data) {
/**
* Flight response data
*/ // When the data has not resolved yet `use` will suspend here.
const [flightData, overrideCanonicalUrl] = (0, _react.use)(childNode.data);
// segmentPath from the server does not match the layout's segmentPath
childNode.data = null;
// setTimeout is used to start a new transition during render, this is an intentional hack around React.
setTimeout(()=>{
(0, _react.startTransition)(()=>{
changeByServerResponse(fullTree, flightData, overrideCanonicalUrl);
});
});
// Suspend infinitely as `changeByServerResponse` will cause a different part of the tree to be rendered.
(0, _react.use)((0, _infinitepromise.createInfinitePromise)());
}
// If cache node has no subTreeData and no data request we have to infinitely suspend as the data will likely flow in from another place.
// TODO-APP: double check users can't return null in a component that will kick in here.
if (!childNode.subTreeData) {
(0, _react.use)((0, _infinitepromise.createInfinitePromise)());
}
const subtree = // The layout router context narrows down tree and childNodes at each level.
/*#__PURE__*/ _react.default.createElement(_approutercontextsharedruntime.LayoutRouterContext.Provider, {
value: {
tree: tree[1][parallelRouterKey],
childNodes: childNode.parallelRoutes,
// TODO-APP: overriding of url for parallel routes
url: url
}
}, childNode.subTreeData);
// Ensure root layout is not wrapped in a div as the root layout renders `<html>`
return subtree;
}
/**
* Renders suspense boundary with the provided "loading" property as the fallback.
* If no loading property is provided it renders the children without a suspense boundary.
*/ function LoadingBoundary(param) {
let { children, loading, loadingStyles, hasLoading } = param;
if (hasLoading) {
return /*#__PURE__*/ _react.default.createElement(_react.Suspense, {
fallback: /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, loadingStyles, loading)
}, children);
}
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, children);
}
function OuterLayoutRouter(param) {
let { parallelRouterKey, segmentPath, childProp, error, errorStyles, templateStyles, loading, loadingStyles, hasLoading, template, notFound, notFoundStyles, styles } = param;
const context = (0, _react.useContext)(_approutercontextsharedruntime.LayoutRouterContext);
if (!context) {
throw new Error("invariant expected layout router to be mounted");
}
const { childNodes, tree, url } = context;
// Get the current parallelRouter cache node
let childNodesForParallelRouter = childNodes.get(parallelRouterKey);
// If the parallel router cache node does not exist yet, create it.
// This writes to the cache when there is no item in the cache yet. It never *overwrites* existing cache items which is why it's safe in concurrent mode.
if (!childNodesForParallelRouter) {
childNodesForParallelRouter = new Map();
childNodes.set(parallelRouterKey, childNodesForParallelRouter);
}
// Get the active segment in the tree
// The reason arrays are used in the data format is that these are transferred from the server to the browser so it's optimized to save bytes.
const treeSegment = tree[1][parallelRouterKey][0];
const childPropSegment = childProp.segment;
// If segment is an array it's a dynamic route and we want to read the dynamic route value as the segment to get from the cache.
const currentChildSegmentValue = (0, _getsegmentvalue.getSegmentValue)(treeSegment);
/**
* Decides which segments to keep rendering, all segments that are not active will be wrapped in `<Offscreen>`.
*/ // TODO-APP: Add handling of `<Offscreen>` when it's available.
const preservedSegments = [
treeSegment
];
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, styles, preservedSegments.map((preservedSegment)=>{
const isChildPropSegment = (0, _matchsegments.matchSegment)(preservedSegment, childPropSegment);
const preservedSegmentValue = (0, _getsegmentvalue.getSegmentValue)(preservedSegment);
const cacheKey = (0, _createroutercachekey.createRouterCacheKey)(preservedSegment);
return(/*
- Error boundary
- Only renders error boundary if error component is provided.
- Rendered for each segment to ensure they have their own error state.
- Loading boundary
- Only renders suspense boundary if loading components is provided.
- Rendered for each segment to ensure they have their own loading state.
- Passed to the router during rendering to ensure it can be immediately rendered when suspending on a Flight fetch.
*/ /*#__PURE__*/ _react.default.createElement(_approutercontextsharedruntime.TemplateContext.Provider, {
key: (0, _createroutercachekey.createRouterCacheKey)(preservedSegment, true),
value: /*#__PURE__*/ _react.default.createElement(ScrollAndFocusHandler, {
segmentPath: segmentPath
}, /*#__PURE__*/ _react.default.createElement(_errorboundary.ErrorBoundary, {
errorComponent: error,
errorStyles: errorStyles
}, /*#__PURE__*/ _react.default.createElement(LoadingBoundary, {
hasLoading: hasLoading,
loading: loading,
loadingStyles: loadingStyles
}, /*#__PURE__*/ _react.default.createElement(_notfoundboundary.NotFoundBoundary, {
notFound: notFound,
notFoundStyles: notFoundStyles
}, /*#__PURE__*/ _react.default.createElement(_redirectboundary.RedirectBoundary, null, /*#__PURE__*/ _react.default.createElement(InnerLayoutRouter, {
parallelRouterKey: parallelRouterKey,
url: url,
tree: tree,
childNodes: childNodesForParallelRouter,
childProp: isChildPropSegment ? childProp : null,
segmentPath: segmentPath,
cacheKey: cacheKey,
isActive: currentChildSegmentValue === preservedSegmentValue
}))))))
}, templateStyles, template));
}));
}
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=layout-router.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
import type { Segment } from '../../server/app-render/types';
export declare const matchSegment: (existingSegment: Segment, segment: Segment) => boolean;
export declare const canSegmentBeOverridden: (existingSegment: Segment, segment: Segment) => boolean;

View File

@@ -0,0 +1,52 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
matchSegment: null,
canSegmentBeOverridden: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
matchSegment: function() {
return matchSegment;
},
canSegmentBeOverridden: function() {
return canSegmentBeOverridden;
}
});
const _getsegmentparam = require("../../server/app-render/get-segment-param");
const matchSegment = (existingSegment, segment)=>{
// segment is either Array or string
if (typeof existingSegment === "string") {
if (typeof segment === "string") {
// Common case: segment is just a string
return existingSegment === segment;
}
return false;
}
if (typeof segment === "string") {
return false;
}
return existingSegment[0] === segment[0] && existingSegment[1] === segment[1];
};
const canSegmentBeOverridden = (existingSegment, segment)=>{
var _getSegmentParam;
if (Array.isArray(existingSegment) || !Array.isArray(segment)) {
return false;
}
return ((_getSegmentParam = (0, _getsegmentparam.getSegmentParam)(existingSegment)) == null ? void 0 : _getSegmentParam.param) === segment[0];
};
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=match-segments.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/match-segments.ts"],"names":["matchSegment","canSegmentBeOverridden","existingSegment","segment","getSegmentParam","Array","isArray","param"],"mappings":";;;;;;;;;;;;;;;IAGaA,YAAY;eAAZA;;IAsBAC,sBAAsB;eAAtBA;;;iCAzBmB;AAGzB,MAAMD,eAAe,CAC1BE,iBACAC;IAEA,oCAAoC;IACpC,IAAI,OAAOD,oBAAoB,UAAU;QACvC,IAAI,OAAOC,YAAY,UAAU;YAC/B,wCAAwC;YACxC,OAAOD,oBAAoBC;QAC7B;QACA,OAAO;IACT;IAEA,IAAI,OAAOA,YAAY,UAAU;QAC/B,OAAO;IACT;IACA,OAAOD,eAAe,CAAC,EAAE,KAAKC,OAAO,CAAC,EAAE,IAAID,eAAe,CAAC,EAAE,KAAKC,OAAO,CAAC,EAAE;AAC/E;AAKO,MAAMF,yBAAyB,CACpCC,iBACAC;QAMOC;IAJP,IAAIC,MAAMC,OAAO,CAACJ,oBAAoB,CAACG,MAAMC,OAAO,CAACH,UAAU;QAC7D,OAAO;IACT;IAEA,OAAOC,EAAAA,mBAAAA,IAAAA,gCAAe,EAACF,qCAAhBE,iBAAkCG,KAAK,MAAKJ,OAAO,CAAC,EAAE;AAC/D"}

View File

@@ -0,0 +1,51 @@
declare const INTERNAL_URLSEARCHPARAMS_INSTANCE: unique symbol;
export declare class ReadonlyURLSearchParams {
[INTERNAL_URLSEARCHPARAMS_INSTANCE]: URLSearchParams;
entries: URLSearchParams['entries'];
forEach: URLSearchParams['forEach'];
get: URLSearchParams['get'];
getAll: URLSearchParams['getAll'];
has: URLSearchParams['has'];
keys: URLSearchParams['keys'];
values: URLSearchParams['values'];
toString: URLSearchParams['toString'];
size: any | URLSearchParams['size'];
constructor(urlSearchParams: URLSearchParams);
[Symbol.iterator](): IterableIterator<[string, string]>;
append(): void;
delete(): void;
set(): void;
sort(): void;
}
/**
* Get a read-only URLSearchParams object. For example searchParams.get('foo') would return 'bar' when ?foo=bar
* Learn more about URLSearchParams here: https://developer.mozilla.org/docs/Web/API/URLSearchParams
*/
export declare function useSearchParams(): ReadonlyURLSearchParams;
/**
* Get the current pathname. For example usePathname() on /dashboard?foo=bar would return "/dashboard"
*/
export declare function usePathname(): string;
export { ServerInsertedHTMLContext, useServerInsertedHTML, } from '../../shared/lib/server-inserted-html.shared-runtime';
/**
* Get the router methods. For example router.push('/dashboard')
*/
export declare function useRouter(): import('../../shared/lib/app-router-context.shared-runtime').AppRouterInstance;
interface Params {
[key: string]: string | string[];
}
/**
* Get the current parameters. For example useParams() on /dashboard/[team]
* where pathname is /dashboard/nextjs would return { team: 'nextjs' }
*/
export declare function useParams<T extends Params = Params>(): T;
/**
* Get the canonical segment path from the current level to the leaf node.
*/
export declare function useSelectedLayoutSegments(parallelRouteKey?: string): string[];
/**
* Get the segment below the current level
*/
export declare function useSelectedLayoutSegment(parallelRouteKey?: string): string | null;
export { redirect, permanentRedirect, RedirectType } from './redirect';
export { notFound } from './not-found';

225
node_modules/next/dist/client/components/navigation.js generated vendored Normal file
View File

@@ -0,0 +1,225 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
ReadonlyURLSearchParams: null,
useSearchParams: null,
usePathname: null,
ServerInsertedHTMLContext: null,
useServerInsertedHTML: null,
useRouter: null,
useParams: null,
useSelectedLayoutSegments: null,
useSelectedLayoutSegment: null,
redirect: null,
permanentRedirect: null,
RedirectType: null,
notFound: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
ReadonlyURLSearchParams: function() {
return ReadonlyURLSearchParams;
},
useSearchParams: function() {
return useSearchParams;
},
usePathname: function() {
return usePathname;
},
ServerInsertedHTMLContext: function() {
return _serverinsertedhtmlsharedruntime.ServerInsertedHTMLContext;
},
useServerInsertedHTML: function() {
return _serverinsertedhtmlsharedruntime.useServerInsertedHTML;
},
useRouter: function() {
return useRouter;
},
useParams: function() {
return useParams;
},
useSelectedLayoutSegments: function() {
return useSelectedLayoutSegments;
},
useSelectedLayoutSegment: function() {
return useSelectedLayoutSegment;
},
redirect: function() {
return _redirect.redirect;
},
permanentRedirect: function() {
return _redirect.permanentRedirect;
},
RedirectType: function() {
return _redirect.RedirectType;
},
notFound: function() {
return _notfound.notFound;
}
});
const _react = require("react");
const _approutercontextsharedruntime = require("../../shared/lib/app-router-context.shared-runtime");
const _hooksclientcontextsharedruntime = require("../../shared/lib/hooks-client-context.shared-runtime");
const _clienthookinservercomponenterror = require("./client-hook-in-server-component-error");
const _getsegmentvalue = require("./router-reducer/reducers/get-segment-value");
const _serverinsertedhtmlsharedruntime = require("../../shared/lib/server-inserted-html.shared-runtime");
const _redirect = require("./redirect");
const _notfound = require("./not-found");
const INTERNAL_URLSEARCHPARAMS_INSTANCE = Symbol("internal for urlsearchparams readonly");
function readonlyURLSearchParamsError() {
return new Error("ReadonlyURLSearchParams cannot be modified");
}
class ReadonlyURLSearchParams {
[Symbol.iterator]() {
return this[INTERNAL_URLSEARCHPARAMS_INSTANCE][Symbol.iterator]();
}
append() {
throw readonlyURLSearchParamsError();
}
delete() {
throw readonlyURLSearchParamsError();
}
set() {
throw readonlyURLSearchParamsError();
}
sort() {
throw readonlyURLSearchParamsError();
}
constructor(urlSearchParams){
this[INTERNAL_URLSEARCHPARAMS_INSTANCE] = urlSearchParams;
this.entries = urlSearchParams.entries.bind(urlSearchParams);
this.forEach = urlSearchParams.forEach.bind(urlSearchParams);
this.get = urlSearchParams.get.bind(urlSearchParams);
this.getAll = urlSearchParams.getAll.bind(urlSearchParams);
this.has = urlSearchParams.has.bind(urlSearchParams);
this.keys = urlSearchParams.keys.bind(urlSearchParams);
this.values = urlSearchParams.values.bind(urlSearchParams);
this.toString = urlSearchParams.toString.bind(urlSearchParams);
this.size = urlSearchParams.size;
}
}
function useSearchParams() {
(0, _clienthookinservercomponenterror.clientHookInServerComponentError)("useSearchParams");
const searchParams = (0, _react.useContext)(_hooksclientcontextsharedruntime.SearchParamsContext);
// In the case where this is `null`, the compat types added in
// `next-env.d.ts` will add a new overload that changes the return type to
// include `null`.
const readonlySearchParams = (0, _react.useMemo)(()=>{
if (!searchParams) {
// When the router is not ready in pages, we won't have the search params
// available.
return null;
}
return new ReadonlyURLSearchParams(searchParams);
}, [
searchParams
]);
if (typeof window === "undefined") {
// AsyncLocalStorage should not be included in the client bundle.
const { bailoutToClientRendering } = require("./bailout-to-client-rendering");
if (bailoutToClientRendering()) {
// TODO-APP: handle dynamic = 'force-static' here and on the client
return readonlySearchParams;
}
}
return readonlySearchParams;
}
function usePathname() {
(0, _clienthookinservercomponenterror.clientHookInServerComponentError)("usePathname");
// In the case where this is `null`, the compat types added in `next-env.d.ts`
// will add a new overload that changes the return type to include `null`.
return (0, _react.useContext)(_hooksclientcontextsharedruntime.PathnameContext);
}
function useRouter() {
(0, _clienthookinservercomponenterror.clientHookInServerComponentError)("useRouter");
const router = (0, _react.useContext)(_approutercontextsharedruntime.AppRouterContext);
if (router === null) {
throw new Error("invariant expected app router to be mounted");
}
return router;
}
// this function performs a depth-first search of the tree to find the selected
// params
function getSelectedParams(tree, params) {
if (params === void 0) params = {};
const parallelRoutes = tree[1];
for (const parallelRoute of Object.values(parallelRoutes)){
const segment = parallelRoute[0];
const isDynamicParameter = Array.isArray(segment);
const segmentValue = isDynamicParameter ? segment[1] : segment;
if (!segmentValue || segmentValue.startsWith("__PAGE__")) continue;
// Ensure catchAll and optional catchall are turned into an array
const isCatchAll = isDynamicParameter && (segment[2] === "c" || segment[2] === "oc");
if (isCatchAll) {
params[segment[0]] = segment[1].split("/");
} else if (isDynamicParameter) {
params[segment[0]] = segment[1];
}
params = getSelectedParams(parallelRoute, params);
}
return params;
}
function useParams() {
(0, _clienthookinservercomponenterror.clientHookInServerComponentError)("useParams");
const globalLayoutRouter = (0, _react.useContext)(_approutercontextsharedruntime.GlobalLayoutRouterContext);
const pathParams = (0, _react.useContext)(_hooksclientcontextsharedruntime.PathParamsContext);
// When it's under app router
if (globalLayoutRouter) {
return getSelectedParams(globalLayoutRouter.tree);
}
// When it's under client side pages router
return pathParams;
}
// TODO-APP: handle parallel routes
/**
* Get the canonical parameters from the current level to the leaf node.
*/ function getSelectedLayoutSegmentPath(tree, parallelRouteKey, first, segmentPath) {
if (first === void 0) first = true;
if (segmentPath === void 0) segmentPath = [];
let node;
if (first) {
// Use the provided parallel route key on the first parallel route
node = tree[1][parallelRouteKey];
} else {
// After first parallel route prefer children, if there's no children pick the first parallel route.
const parallelRoutes = tree[1];
var _parallelRoutes_children;
node = (_parallelRoutes_children = parallelRoutes.children) != null ? _parallelRoutes_children : Object.values(parallelRoutes)[0];
}
if (!node) return segmentPath;
const segment = node[0];
const segmentValue = (0, _getsegmentvalue.getSegmentValue)(segment);
if (!segmentValue || segmentValue.startsWith("__PAGE__")) return segmentPath;
segmentPath.push(segmentValue);
return getSelectedLayoutSegmentPath(node, parallelRouteKey, false, segmentPath);
}
function useSelectedLayoutSegments(parallelRouteKey) {
if (parallelRouteKey === void 0) parallelRouteKey = "children";
(0, _clienthookinservercomponenterror.clientHookInServerComponentError)("useSelectedLayoutSegments");
const { tree } = (0, _react.useContext)(_approutercontextsharedruntime.LayoutRouterContext);
return getSelectedLayoutSegmentPath(tree, parallelRouteKey);
}
function useSelectedLayoutSegment(parallelRouteKey) {
if (parallelRouteKey === void 0) parallelRouteKey = "children";
(0, _clienthookinservercomponenterror.clientHookInServerComponentError)("useSelectedLayoutSegment");
const selectedLayoutSegments = useSelectedLayoutSegments(parallelRouteKey);
if (selectedLayoutSegments.length === 0) {
return null;
}
return selectedLayoutSegments[0];
}
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=navigation.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/navigation.ts"],"names":["ReadonlyURLSearchParams","useSearchParams","usePathname","ServerInsertedHTMLContext","useServerInsertedHTML","useRouter","useParams","useSelectedLayoutSegments","useSelectedLayoutSegment","redirect","permanentRedirect","RedirectType","notFound","INTERNAL_URLSEARCHPARAMS_INSTANCE","Symbol","readonlyURLSearchParamsError","Error","iterator","append","delete","set","sort","constructor","urlSearchParams","entries","bind","forEach","get","getAll","has","keys","values","toString","size","clientHookInServerComponentError","searchParams","useContext","SearchParamsContext","readonlySearchParams","useMemo","window","bailoutToClientRendering","require","PathnameContext","router","AppRouterContext","getSelectedParams","tree","params","parallelRoutes","parallelRoute","Object","segment","isDynamicParameter","Array","isArray","segmentValue","startsWith","isCatchAll","split","globalLayoutRouter","GlobalLayoutRouterContext","pathParams","PathParamsContext","getSelectedLayoutSegmentPath","parallelRouteKey","first","segmentPath","node","children","getSegmentValue","push","LayoutRouterContext","selectedLayoutSegments","length"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IAuBaA,uBAAuB;eAAvBA;;IAgDGC,eAAe;eAAfA;;IAiCAC,WAAW;eAAXA;;IAQdC,yBAAyB;eAAzBA,0DAAyB;;IACzBC,qBAAqB;eAArBA,sDAAqB;;IAMPC,SAAS;eAATA;;IAgDAC,SAAS;eAATA;;IAsDAC,yBAAyB;eAAzBA;;IAYAC,wBAAwB;eAAxBA;;IAYPC,QAAQ;eAARA,kBAAQ;;IAAEC,iBAAiB;eAAjBA,2BAAiB;;IAAEC,YAAY;eAAZA,sBAAY;;IACzCC,QAAQ;eAARA,kBAAQ;;;uBAtPmB;+CAM7B;iDAKA;kDAC0C;iCACjB;iDAqGzB;0BAmImD;0BACjC;AAvOzB,MAAMC,oCAAoCC,OACxC;AAGF,SAASC;IACP,OAAO,IAAIC,MAAM;AACnB;AAEO,MAAMhB;IA0BX,CAACc,OAAOG,QAAQ,CAAC,GAAG;QAClB,OAAO,IAAI,CAACJ,kCAAkC,CAACC,OAAOG,QAAQ,CAAC;IACjE;IAEAC,SAAS;QACP,MAAMH;IACR;IACAI,SAAS;QACP,MAAMJ;IACR;IACAK,MAAM;QACJ,MAAML;IACR;IACAM,OAAO;QACL,MAAMN;IACR;IA5BAO,YAAYC,eAAgC,CAAE;QAC5C,IAAI,CAACV,kCAAkC,GAAGU;QAE1C,IAAI,CAACC,OAAO,GAAGD,gBAAgBC,OAAO,CAACC,IAAI,CAACF;QAC5C,IAAI,CAACG,OAAO,GAAGH,gBAAgBG,OAAO,CAACD,IAAI,CAACF;QAC5C,IAAI,CAACI,GAAG,GAAGJ,gBAAgBI,GAAG,CAACF,IAAI,CAACF;QACpC,IAAI,CAACK,MAAM,GAAGL,gBAAgBK,MAAM,CAACH,IAAI,CAACF;QAC1C,IAAI,CAACM,GAAG,GAAGN,gBAAgBM,GAAG,CAACJ,IAAI,CAACF;QACpC,IAAI,CAACO,IAAI,GAAGP,gBAAgBO,IAAI,CAACL,IAAI,CAACF;QACtC,IAAI,CAACQ,MAAM,GAAGR,gBAAgBQ,MAAM,CAACN,IAAI,CAACF;QAC1C,IAAI,CAACS,QAAQ,GAAGT,gBAAgBS,QAAQ,CAACP,IAAI,CAACF;QAC9C,IAAI,CAACU,IAAI,GAAGV,gBAAgBU,IAAI;IAClC;AAiBF;AAMO,SAAShC;IACdiC,IAAAA,kEAAgC,EAAC;IACjC,MAAMC,eAAeC,IAAAA,iBAAU,EAACC,oDAAmB;IAEnD,8DAA8D;IAC9D,0EAA0E;IAC1E,kBAAkB;IAClB,MAAMC,uBAAuBC,IAAAA,cAAO,EAAC;QACnC,IAAI,CAACJ,cAAc;YACjB,yEAAyE;YACzE,aAAa;YACb,OAAO;QACT;QAEA,OAAO,IAAInC,wBAAwBmC;IACrC,GAAG;QAACA;KAAa;IAEjB,IAAI,OAAOK,WAAW,aAAa;QACjC,iEAAiE;QACjE,MAAM,EAAEC,wBAAwB,EAAE,GAChCC,QAAQ;QACV,IAAID,4BAA4B;YAC9B,mEAAmE;YACnE,OAAOH;QACT;IACF;IAEA,OAAOA;AACT;AAKO,SAASpC;IACdgC,IAAAA,kEAAgC,EAAC;IACjC,8EAA8E;IAC9E,0EAA0E;IAC1E,OAAOE,IAAAA,iBAAU,EAACO,gDAAe;AACnC;AAUO,SAAStC;IACd6B,IAAAA,kEAAgC,EAAC;IACjC,MAAMU,SAASR,IAAAA,iBAAU,EAACS,+CAAgB;IAC1C,IAAID,WAAW,MAAM;QACnB,MAAM,IAAI5B,MAAM;IAClB;IAEA,OAAO4B;AACT;AAMA,+EAA+E;AAC/E,SAAS;AACT,SAASE,kBACPC,IAAuB,EACvBC,MAAmB;IAAnBA,IAAAA,mBAAAA,SAAiB,CAAC;IAElB,MAAMC,iBAAiBF,IAAI,CAAC,EAAE;IAE9B,KAAK,MAAMG,iBAAiBC,OAAOpB,MAAM,CAACkB,gBAAiB;QACzD,MAAMG,UAAUF,aAAa,CAAC,EAAE;QAChC,MAAMG,qBAAqBC,MAAMC,OAAO,CAACH;QACzC,MAAMI,eAAeH,qBAAqBD,OAAO,CAAC,EAAE,GAAGA;QACvD,IAAI,CAACI,gBAAgBA,aAAaC,UAAU,CAAC,aAAa;QAE1D,iEAAiE;QACjE,MAAMC,aACJL,sBAAuBD,CAAAA,OAAO,CAAC,EAAE,KAAK,OAAOA,OAAO,CAAC,EAAE,KAAK,IAAG;QAEjE,IAAIM,YAAY;YACdV,MAAM,CAACI,OAAO,CAAC,EAAE,CAAC,GAAGA,OAAO,CAAC,EAAE,CAACO,KAAK,CAAC;QACxC,OAAO,IAAIN,oBAAoB;YAC7BL,MAAM,CAACI,OAAO,CAAC,EAAE,CAAC,GAAGA,OAAO,CAAC,EAAE;QACjC;QAEAJ,SAASF,kBAAkBI,eAAeF;IAC5C;IAEA,OAAOA;AACT;AAMO,SAAS1C;IACd4B,IAAAA,kEAAgC,EAAC;IACjC,MAAM0B,qBAAqBxB,IAAAA,iBAAU,EAACyB,wDAAyB;IAC/D,MAAMC,aAAa1B,IAAAA,iBAAU,EAAC2B,kDAAiB;IAE/C,6BAA6B;IAC7B,IAAIH,oBAAoB;QACtB,OAAOd,kBAAkBc,mBAAmBb,IAAI;IAClD;IAEA,2CAA2C;IAC3C,OAAOe;AACT;AAEA,mCAAmC;AACnC;;CAEC,GACD,SAASE,6BACPjB,IAAuB,EACvBkB,gBAAwB,EACxBC,KAAY,EACZC,WAA0B;IAD1BD,IAAAA,kBAAAA,QAAQ;IACRC,IAAAA,wBAAAA,cAAwB,EAAE;IAE1B,IAAIC;IACJ,IAAIF,OAAO;QACT,kEAAkE;QAClEE,OAAOrB,IAAI,CAAC,EAAE,CAACkB,iBAAiB;IAClC,OAAO;QACL,oGAAoG;QACpG,MAAMhB,iBAAiBF,IAAI,CAAC,EAAE;YACvBE;QAAPmB,OAAOnB,CAAAA,2BAAAA,eAAeoB,QAAQ,YAAvBpB,2BAA2BE,OAAOpB,MAAM,CAACkB,eAAe,CAAC,EAAE;IACpE;IAEA,IAAI,CAACmB,MAAM,OAAOD;IAClB,MAAMf,UAAUgB,IAAI,CAAC,EAAE;IAEvB,MAAMZ,eAAec,IAAAA,gCAAe,EAAClB;IACrC,IAAI,CAACI,gBAAgBA,aAAaC,UAAU,CAAC,aAAa,OAAOU;IAEjEA,YAAYI,IAAI,CAACf;IAEjB,OAAOQ,6BACLI,MACAH,kBACA,OACAE;AAEJ;AAMO,SAAS5D,0BACd0D,gBAAqC;IAArCA,IAAAA,6BAAAA,mBAA2B;IAE3B/B,IAAAA,kEAAgC,EAAC;IACjC,MAAM,EAAEa,IAAI,EAAE,GAAGX,IAAAA,iBAAU,EAACoC,kDAAmB;IAC/C,OAAOR,6BAA6BjB,MAAMkB;AAC5C;AAMO,SAASzD,yBACdyD,gBAAqC;IAArCA,IAAAA,6BAAAA,mBAA2B;IAE3B/B,IAAAA,kEAAgC,EAAC;IACjC,MAAMuC,yBAAyBlE,0BAA0B0D;IACzD,IAAIQ,uBAAuBC,MAAM,KAAK,GAAG;QACvC,OAAO;IACT;IAEA,OAAOD,sBAAsB,CAAC,EAAE;AAClC"}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1 @@
export default function NoopHead(): null;

21
node_modules/next/dist/client/components/noop-head.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return NoopHead;
}
});
function NoopHead() {
return null;
}
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=noop-head.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/noop-head.tsx"],"names":["NoopHead"],"mappings":";;;;+BAAA;;;eAAwBA;;;AAAT,SAASA;IACtB,OAAO;AACT"}

View File

@@ -0,0 +1,9 @@
import React from 'react';
interface NotFoundBoundaryProps {
notFound?: React.ReactNode;
notFoundStyles?: React.ReactNode;
asNotFound?: boolean;
children: React.ReactNode;
}
export declare function NotFoundBoundary({ notFound, notFoundStyles, asNotFound, children, }: NotFoundBoundaryProps): React.JSX.Element;
export {};

View File

@@ -0,0 +1,80 @@
"use client";
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "NotFoundBoundary", {
enumerable: true,
get: function() {
return NotFoundBoundary;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
const _navigation = require("./navigation");
class NotFoundErrorBoundary extends _react.default.Component {
static getDerivedStateFromError(error) {
if ((error == null ? void 0 : error.digest) === "NEXT_NOT_FOUND") {
return {
notFoundTriggered: true
};
}
// Re-throw if error is not for 404
throw error;
}
static getDerivedStateFromProps(props, state) {
/**
* Handles reset of the error boundary when a navigation happens.
* Ensures the error boundary does not stay enabled when navigating to a new page.
* Approach of setState in render is safe as it checks the previous pathname and then overrides
* it as outlined in https://react.dev/reference/react/useState#storing-information-from-previous-renders
*/ if (props.pathname !== state.previousPathname && state.notFoundTriggered) {
return {
notFoundTriggered: false,
previousPathname: props.pathname
};
}
return {
notFoundTriggered: state.notFoundTriggered,
previousPathname: props.pathname
};
}
render() {
if (this.state.notFoundTriggered) {
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement("meta", {
name: "robots",
content: "noindex"
}), process.env.NODE_ENV === "development" && /*#__PURE__*/ _react.default.createElement("meta", {
name: "next-error",
content: "not-found"
}), this.props.notFoundStyles, this.props.notFound);
}
return this.props.children;
}
constructor(props){
super(props);
this.state = {
notFoundTriggered: !!props.asNotFound,
previousPathname: props.pathname
};
}
}
function NotFoundBoundary(param) {
let { notFound, notFoundStyles, asNotFound, children } = param;
const pathname = (0, _navigation.usePathname)();
return notFound ? /*#__PURE__*/ _react.default.createElement(NotFoundErrorBoundary, {
pathname: pathname,
notFound: notFound,
notFoundStyles: notFoundStyles,
asNotFound: asNotFound
}, children) : /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, children);
}
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=not-found-boundary.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/client/components/not-found-boundary.tsx"],"names":["NotFoundBoundary","NotFoundErrorBoundary","React","Component","getDerivedStateFromError","error","digest","notFoundTriggered","getDerivedStateFromProps","props","state","pathname","previousPathname","render","meta","name","content","process","env","NODE_ENV","notFoundStyles","notFound","children","constructor","asNotFound","usePathname"],"mappings":"AAAA;;;;;+BAiFgBA;;;eAAAA;;;;gEA/EE;4BACU;AAkB5B,MAAMC,8BAA8BC,cAAK,CAACC,SAAS;IAYjD,OAAOC,yBAAyBC,KAAU,EAAE;QAC1C,IAAIA,CAAAA,yBAAAA,MAAOC,MAAM,MAAK,kBAAkB;YACtC,OAAO;gBAAEC,mBAAmB;YAAK;QACnC;QACA,mCAAmC;QACnC,MAAMF;IACR;IAEA,OAAOG,yBACLC,KAAiC,EACjCC,KAAiC,EACE;QACnC;;;;;KAKC,GACD,IAAID,MAAME,QAAQ,KAAKD,MAAME,gBAAgB,IAAIF,MAAMH,iBAAiB,EAAE;YACxE,OAAO;gBACLA,mBAAmB;gBACnBK,kBAAkBH,MAAME,QAAQ;YAClC;QACF;QACA,OAAO;YACLJ,mBAAmBG,MAAMH,iBAAiB;YAC1CK,kBAAkBH,MAAME,QAAQ;QAClC;IACF;IAEAE,SAAS;QACP,IAAI,IAAI,CAACH,KAAK,CAACH,iBAAiB,EAAE;YAChC,qBACE,0EACE,6BAACO;gBAAKC,MAAK;gBAASC,SAAQ;gBAC3BC,QAAQC,GAAG,CAACC,QAAQ,KAAK,+BACxB,6BAACL;gBAAKC,MAAK;gBAAaC,SAAQ;gBAEjC,IAAI,CAACP,KAAK,CAACW,cAAc,EACzB,IAAI,CAACX,KAAK,CAACY,QAAQ;QAG1B;QAEA,OAAO,IAAI,CAACZ,KAAK,CAACa,QAAQ;IAC5B;IArDAC,YAAYd,KAAiC,CAAE;QAC7C,KAAK,CAACA;QACN,IAAI,CAACC,KAAK,GAAG;YACXH,mBAAmB,CAAC,CAACE,MAAMe,UAAU;YACrCZ,kBAAkBH,MAAME,QAAQ;QAClC;IACF;AAgDF;AAEO,SAASX,iBAAiB,KAKT;IALS,IAAA,EAC/BqB,QAAQ,EACRD,cAAc,EACdI,UAAU,EACVF,QAAQ,EACc,GALS;IAM/B,MAAMX,WAAWc,IAAAA,uBAAW;IAC5B,OAAOJ,yBACL,6BAACpB;QACCU,UAAUA;QACVU,UAAUA;QACVD,gBAAgBA;QAChBI,YAAYA;OAEXF,0BAGH,4DAAGA;AAEP"}

Some files were not shown because too many files have changed in this diff Show More