next-rest-framework
Version:
Next REST Framework - Type-safe, self-documenting APIs for Next.js
1,325 lines (1,306 loc) • 279 kB
JavaScript
import {
getConfig,
getHtmlForDocs,
getPathsFromRoute,
getPathsFromRpcRoute,
logNextRestFrameworkError,
logPagesEdgeRuntimeErrorForRoute,
parseRpcOperationResponseJson,
rpcOperation,
validateSchema
} from "./chunk-W4JGICKV.mjs";
import {
DEFAULT_ERRORS,
FORM_DATA_CONTENT_TYPES_THAT_SUPPORT_VALIDATION
} from "./chunk-F4RHMFSH.mjs";
import {
__commonJS,
__toESM
} from "./chunk-SPFPWZVF.mjs";
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js
var require_detect_domain_locale = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "detectDomainLocale", {
enumerable: true,
get: function() {
return detectDomainLocale;
}
});
function detectDomainLocale(domainItems, hostname, detectedLocale) {
if (!domainItems)
return;
if (detectedLocale) {
detectedLocale = detectedLocale.toLowerCase();
}
for (const item of domainItems) {
var _item_domain, _item_locales;
const domainHostname = (_item_domain = item.domain) == null ? void 0 : _item_domain.split(":", 1)[0].toLowerCase();
if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || ((_item_locales = item.locales) == null ? void 0 : _item_locales.some((locale) => locale.toLowerCase() === detectedLocale))) {
return item;
}
}
}
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js
var require_remove_trailing_slash = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "removeTrailingSlash", {
enumerable: true,
get: function() {
return removeTrailingSlash;
}
});
function removeTrailingSlash(route2) {
return route2.replace(/\/$/, "") || "/";
}
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/parse-path.js
var require_parse_path = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/parse-path.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "parsePath", {
enumerable: true,
get: function() {
return parsePath;
}
});
function parsePath(path) {
const hashIndex = path.indexOf("#");
const queryIndex = path.indexOf("?");
const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex);
if (hasQuery || hashIndex > -1) {
return {
pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),
query: hasQuery ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : void 0) : "",
hash: hashIndex > -1 ? path.slice(hashIndex) : ""
};
}
return {
pathname: path,
query: "",
hash: ""
};
}
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js
var require_add_path_prefix = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "addPathPrefix", {
enumerable: true,
get: function() {
return addPathPrefix;
}
});
var _parsepath = require_parse_path();
function addPathPrefix(path, prefix) {
if (!path.startsWith("/") || !prefix) {
return path;
}
const { pathname, query, hash } = (0, _parsepath.parsePath)(path);
return "" + prefix + pathname + query + hash;
}
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js
var require_add_path_suffix = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "addPathSuffix", {
enumerable: true,
get: function() {
return addPathSuffix;
}
});
var _parsepath = require_parse_path();
function addPathSuffix(path, suffix) {
if (!path.startsWith("/") || !suffix) {
return path;
}
const { pathname, query, hash } = (0, _parsepath.parsePath)(path);
return "" + pathname + suffix + query + hash;
}
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js
var require_path_has_prefix = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "pathHasPrefix", {
enumerable: true,
get: function() {
return pathHasPrefix;
}
});
var _parsepath = require_parse_path();
function pathHasPrefix(path, prefix) {
if (typeof path !== "string") {
return false;
}
const { pathname } = (0, _parsepath.parsePath)(path);
return pathname === prefix || pathname.startsWith(prefix + "/");
}
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/add-locale.js
var require_add_locale = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/add-locale.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "addLocale", {
enumerable: true,
get: function() {
return addLocale;
}
});
var _addpathprefix = require_add_path_prefix();
var _pathhasprefix = require_path_has_prefix();
function addLocale(path, locale, defaultLocale, ignorePrefix) {
if (!locale || locale === defaultLocale)
return path;
const lower = path.toLowerCase();
if (!ignorePrefix) {
if ((0, _pathhasprefix.pathHasPrefix)(lower, "/api"))
return path;
if ((0, _pathhasprefix.pathHasPrefix)(lower, "/" + locale.toLowerCase()))
return path;
}
return (0, _addpathprefix.addPathPrefix)(path, "/" + locale);
}
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js
var require_format_next_pathname_info = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "formatNextPathnameInfo", {
enumerable: true,
get: function() {
return formatNextPathnameInfo;
}
});
var _removetrailingslash = require_remove_trailing_slash();
var _addpathprefix = require_add_path_prefix();
var _addpathsuffix = require_add_path_suffix();
var _addlocale = require_add_locale();
function formatNextPathnameInfo(info) {
let pathname = (0, _addlocale.addLocale)(info.pathname, info.locale, info.buildId ? void 0 : info.defaultLocale, info.ignorePrefix);
if (info.buildId || !info.trailingSlash) {
pathname = (0, _removetrailingslash.removeTrailingSlash)(pathname);
}
if (info.buildId) {
pathname = (0, _addpathsuffix.addPathSuffix)((0, _addpathprefix.addPathPrefix)(pathname, "/_next/data/" + info.buildId), info.pathname === "/" ? "index.json" : ".json");
}
pathname = (0, _addpathprefix.addPathPrefix)(pathname, info.basePath);
return !info.buildId && info.trailingSlash ? !pathname.endsWith("/") ? (0, _addpathsuffix.addPathSuffix)(pathname, "/") : pathname : (0, _removetrailingslash.removeTrailingSlash)(pathname);
}
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/get-hostname.js
var require_get_hostname = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/get-hostname.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getHostname", {
enumerable: true,
get: function() {
return getHostname;
}
});
function getHostname(parsed, headers) {
let hostname;
if ((headers == null ? void 0 : headers.host) && !Array.isArray(headers.host)) {
hostname = headers.host.toString().split(":", 1)[0];
} else if (parsed.hostname) {
hostname = parsed.hostname;
} else
return;
return hostname.toLowerCase();
}
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js
var require_normalize_locale_path = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "normalizeLocalePath", {
enumerable: true,
get: function() {
return normalizeLocalePath;
}
});
var cache = /* @__PURE__ */ new WeakMap();
function normalizeLocalePath(pathname, locales) {
if (!locales)
return {
pathname
};
let lowercasedLocales = cache.get(locales);
if (!lowercasedLocales) {
lowercasedLocales = locales.map((locale) => locale.toLowerCase());
cache.set(locales, lowercasedLocales);
}
let detectedLocale;
const segments = pathname.split("/", 2);
if (!segments[1])
return {
pathname
};
const segment = segments[1].toLowerCase();
const index = lowercasedLocales.indexOf(segment);
if (index < 0)
return {
pathname
};
detectedLocale = locales[index];
pathname = pathname.slice(detectedLocale.length + 1) || "/";
return {
pathname,
detectedLocale
};
}
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js
var require_remove_path_prefix = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "removePathPrefix", {
enumerable: true,
get: function() {
return removePathPrefix;
}
});
var _pathhasprefix = require_path_has_prefix();
function removePathPrefix(path, prefix) {
if (!(0, _pathhasprefix.pathHasPrefix)(path, prefix)) {
return path;
}
const withoutPrefix = path.slice(prefix.length);
if (withoutPrefix.startsWith("/")) {
return withoutPrefix;
}
return "/" + withoutPrefix;
}
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js
var require_get_next_pathname_info = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getNextPathnameInfo", {
enumerable: true,
get: function() {
return getNextPathnameInfo;
}
});
var _normalizelocalepath = require_normalize_locale_path();
var _removepathprefix = require_remove_path_prefix();
var _pathhasprefix = require_path_has_prefix();
function getNextPathnameInfo(pathname, options) {
var _options_nextConfig;
const { basePath, i18n, trailingSlash } = (_options_nextConfig = options.nextConfig) != null ? _options_nextConfig : {};
const info = {
pathname,
trailingSlash: pathname !== "/" ? pathname.endsWith("/") : trailingSlash
};
if (basePath && (0, _pathhasprefix.pathHasPrefix)(info.pathname, basePath)) {
info.pathname = (0, _removepathprefix.removePathPrefix)(info.pathname, basePath);
info.basePath = basePath;
}
let pathnameNoDataPrefix = info.pathname;
if (info.pathname.startsWith("/_next/data/") && info.pathname.endsWith(".json")) {
const paths = info.pathname.replace(/^\/_next\/data\//, "").replace(/\.json$/, "").split("/");
const buildId = paths[0];
info.buildId = buildId;
pathnameNoDataPrefix = paths[1] !== "index" ? "/" + paths.slice(1).join("/") : "/";
if (options.parseData === true) {
info.pathname = pathnameNoDataPrefix;
}
}
if (i18n) {
let result = options.i18nProvider ? options.i18nProvider.analyze(info.pathname) : (0, _normalizelocalepath.normalizeLocalePath)(info.pathname, i18n.locales);
info.locale = result.detectedLocale;
var _result_pathname;
info.pathname = (_result_pathname = result.pathname) != null ? _result_pathname : info.pathname;
if (!result.detectedLocale && info.buildId) {
result = options.i18nProvider ? options.i18nProvider.analyze(pathnameNoDataPrefix) : (0, _normalizelocalepath.normalizeLocalePath)(pathnameNoDataPrefix, i18n.locales);
if (result.detectedLocale) {
info.locale = result.detectedLocale;
}
}
}
return info;
}
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/server/web/next-url.js
var require_next_url = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/server/web/next-url.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "NextURL", {
enumerable: true,
get: function() {
return NextURL;
}
});
var _detectdomainlocale = require_detect_domain_locale();
var _formatnextpathnameinfo = require_format_next_pathname_info();
var _gethostname = require_get_hostname();
var _getnextpathnameinfo = require_get_next_pathname_info();
var REGEX_LOCALHOST_HOSTNAME = /(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;
function parseURL(url, base) {
return new URL(String(url).replace(REGEX_LOCALHOST_HOSTNAME, "localhost"), base && String(base).replace(REGEX_LOCALHOST_HOSTNAME, "localhost"));
}
var Internal = Symbol("NextURLInternal");
var NextURL = class _NextURL {
constructor(input, baseOrOpts, opts) {
let base;
let options;
if (typeof baseOrOpts === "object" && "pathname" in baseOrOpts || typeof baseOrOpts === "string") {
base = baseOrOpts;
options = opts || {};
} else {
options = opts || baseOrOpts || {};
}
this[Internal] = {
url: parseURL(input, base ?? options.base),
options,
basePath: ""
};
this.analyze();
}
analyze() {
var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig, _this_Internal_domainLocale, _this_Internal_options_nextConfig_i18n1, _this_Internal_options_nextConfig1;
const info = (0, _getnextpathnameinfo.getNextPathnameInfo)(this[Internal].url.pathname, {
nextConfig: this[Internal].options.nextConfig,
parseData: !process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,
i18nProvider: this[Internal].options.i18nProvider
});
const hostname = (0, _gethostname.getHostname)(this[Internal].url, this[Internal].options.headers);
this[Internal].domainLocale = this[Internal].options.i18nProvider ? this[Internal].options.i18nProvider.detectDomainLocale(hostname) : (0, _detectdomainlocale.detectDomainLocale)((_this_Internal_options_nextConfig = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n = _this_Internal_options_nextConfig.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n.domains, hostname);
const defaultLocale = ((_this_Internal_domainLocale = this[Internal].domainLocale) == null ? void 0 : _this_Internal_domainLocale.defaultLocale) || ((_this_Internal_options_nextConfig1 = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n1 = _this_Internal_options_nextConfig1.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n1.defaultLocale);
this[Internal].url.pathname = info.pathname;
this[Internal].defaultLocale = defaultLocale;
this[Internal].basePath = info.basePath ?? "";
this[Internal].buildId = info.buildId;
this[Internal].locale = info.locale ?? defaultLocale;
this[Internal].trailingSlash = info.trailingSlash;
}
formatPathname() {
return (0, _formatnextpathnameinfo.formatNextPathnameInfo)({
basePath: this[Internal].basePath,
buildId: this[Internal].buildId,
defaultLocale: !this[Internal].options.forceLocale ? this[Internal].defaultLocale : void 0,
locale: this[Internal].locale,
pathname: this[Internal].url.pathname,
trailingSlash: this[Internal].trailingSlash
});
}
formatSearch() {
return this[Internal].url.search;
}
get buildId() {
return this[Internal].buildId;
}
set buildId(buildId) {
this[Internal].buildId = buildId;
}
get locale() {
return this[Internal].locale ?? "";
}
set locale(locale) {
var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig;
if (!this[Internal].locale || !((_this_Internal_options_nextConfig = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n = _this_Internal_options_nextConfig.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n.locales.includes(locale))) {
throw Object.defineProperty(new TypeError(`The NextURL configuration includes no locale "${locale}"`), "__NEXT_ERROR_CODE", {
value: "E597",
enumerable: false,
configurable: true
});
}
this[Internal].locale = locale;
}
get defaultLocale() {
return this[Internal].defaultLocale;
}
get domainLocale() {
return this[Internal].domainLocale;
}
get searchParams() {
return this[Internal].url.searchParams;
}
get host() {
return this[Internal].url.host;
}
set host(value) {
this[Internal].url.host = value;
}
get hostname() {
return this[Internal].url.hostname;
}
set hostname(value) {
this[Internal].url.hostname = value;
}
get port() {
return this[Internal].url.port;
}
set port(value) {
this[Internal].url.port = value;
}
get protocol() {
return this[Internal].url.protocol;
}
set protocol(value) {
this[Internal].url.protocol = value;
}
get href() {
const pathname = this.formatPathname();
const search = this.formatSearch();
return `${this.protocol}//${this.host}${pathname}${search}${this.hash}`;
}
set href(url) {
this[Internal].url = parseURL(url);
this.analyze();
}
get origin() {
return this[Internal].url.origin;
}
get pathname() {
return this[Internal].url.pathname;
}
set pathname(value) {
this[Internal].url.pathname = value;
}
get hash() {
return this[Internal].url.hash;
}
set hash(value) {
this[Internal].url.hash = value;
}
get search() {
return this[Internal].url.search;
}
set search(value) {
this[Internal].url.search = value;
}
get password() {
return this[Internal].url.password;
}
set password(value) {
this[Internal].url.password = value;
}
get username() {
return this[Internal].url.username;
}
set username(value) {
this[Internal].url.username = value;
}
get basePath() {
return this[Internal].basePath;
}
set basePath(value) {
this[Internal].basePath = value.startsWith("/") ? value : `/${value}`;
}
toString() {
return this.href;
}
toJSON() {
return this.href;
}
[Symbol.for("edge-runtime.inspect.custom")]() {
return {
href: this.href,
origin: this.origin,
protocol: this.protocol,
username: this.username,
password: this.password,
host: this.host,
hostname: this.hostname,
port: this.port,
pathname: this.pathname,
search: this.search,
searchParams: this.searchParams,
hash: this.hash
};
}
clone() {
return new _NextURL(String(this), this[Internal].options);
}
};
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/lib/constants.js
var require_constants = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/lib/constants.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for (var name in all)
Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
ACTION_SUFFIX: function() {
return ACTION_SUFFIX;
},
APP_DIR_ALIAS: function() {
return APP_DIR_ALIAS;
},
CACHE_ONE_YEAR: function() {
return CACHE_ONE_YEAR;
},
DOT_NEXT_ALIAS: function() {
return DOT_NEXT_ALIAS;
},
ESLINT_DEFAULT_DIRS: function() {
return ESLINT_DEFAULT_DIRS;
},
GSP_NO_RETURNED_VALUE: function() {
return GSP_NO_RETURNED_VALUE;
},
GSSP_COMPONENT_MEMBER_ERROR: function() {
return GSSP_COMPONENT_MEMBER_ERROR;
},
GSSP_NO_RETURNED_VALUE: function() {
return GSSP_NO_RETURNED_VALUE;
},
INFINITE_CACHE: function() {
return INFINITE_CACHE;
},
INSTRUMENTATION_HOOK_FILENAME: function() {
return INSTRUMENTATION_HOOK_FILENAME;
},
MATCHED_PATH_HEADER: function() {
return MATCHED_PATH_HEADER;
},
MIDDLEWARE_FILENAME: function() {
return MIDDLEWARE_FILENAME;
},
MIDDLEWARE_LOCATION_REGEXP: function() {
return MIDDLEWARE_LOCATION_REGEXP;
},
NEXT_BODY_SUFFIX: function() {
return NEXT_BODY_SUFFIX;
},
NEXT_CACHE_IMPLICIT_TAG_ID: function() {
return NEXT_CACHE_IMPLICIT_TAG_ID;
},
NEXT_CACHE_REVALIDATED_TAGS_HEADER: function() {
return NEXT_CACHE_REVALIDATED_TAGS_HEADER;
},
NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER: function() {
return NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER;
},
NEXT_CACHE_SOFT_TAG_MAX_LENGTH: function() {
return NEXT_CACHE_SOFT_TAG_MAX_LENGTH;
},
NEXT_CACHE_TAGS_HEADER: function() {
return NEXT_CACHE_TAGS_HEADER;
},
NEXT_CACHE_TAG_MAX_ITEMS: function() {
return NEXT_CACHE_TAG_MAX_ITEMS;
},
NEXT_CACHE_TAG_MAX_LENGTH: function() {
return NEXT_CACHE_TAG_MAX_LENGTH;
},
NEXT_DATA_SUFFIX: function() {
return NEXT_DATA_SUFFIX;
},
NEXT_INTERCEPTION_MARKER_PREFIX: function() {
return NEXT_INTERCEPTION_MARKER_PREFIX;
},
NEXT_META_SUFFIX: function() {
return NEXT_META_SUFFIX;
},
NEXT_QUERY_PARAM_PREFIX: function() {
return NEXT_QUERY_PARAM_PREFIX;
},
NEXT_RESUME_HEADER: function() {
return NEXT_RESUME_HEADER;
},
NON_STANDARD_NODE_ENV: function() {
return NON_STANDARD_NODE_ENV;
},
PAGES_DIR_ALIAS: function() {
return PAGES_DIR_ALIAS;
},
PRERENDER_REVALIDATE_HEADER: function() {
return PRERENDER_REVALIDATE_HEADER;
},
PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER: function() {
return PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER;
},
PUBLIC_DIR_MIDDLEWARE_CONFLICT: function() {
return PUBLIC_DIR_MIDDLEWARE_CONFLICT;
},
ROOT_DIR_ALIAS: function() {
return ROOT_DIR_ALIAS;
},
RSC_ACTION_CLIENT_WRAPPER_ALIAS: function() {
return RSC_ACTION_CLIENT_WRAPPER_ALIAS;
},
RSC_ACTION_ENCRYPTION_ALIAS: function() {
return RSC_ACTION_ENCRYPTION_ALIAS;
},
RSC_ACTION_PROXY_ALIAS: function() {
return RSC_ACTION_PROXY_ALIAS;
},
RSC_ACTION_VALIDATE_ALIAS: function() {
return RSC_ACTION_VALIDATE_ALIAS;
},
RSC_CACHE_WRAPPER_ALIAS: function() {
return RSC_CACHE_WRAPPER_ALIAS;
},
RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS: function() {
return RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS;
},
RSC_MOD_REF_PROXY_ALIAS: function() {
return RSC_MOD_REF_PROXY_ALIAS;
},
RSC_PREFETCH_SUFFIX: function() {
return RSC_PREFETCH_SUFFIX;
},
RSC_SEGMENTS_DIR_SUFFIX: function() {
return RSC_SEGMENTS_DIR_SUFFIX;
},
RSC_SEGMENT_SUFFIX: function() {
return RSC_SEGMENT_SUFFIX;
},
RSC_SUFFIX: function() {
return RSC_SUFFIX;
},
SERVER_PROPS_EXPORT_ERROR: function() {
return SERVER_PROPS_EXPORT_ERROR;
},
SERVER_PROPS_GET_INIT_PROPS_CONFLICT: function() {
return SERVER_PROPS_GET_INIT_PROPS_CONFLICT;
},
SERVER_PROPS_SSG_CONFLICT: function() {
return SERVER_PROPS_SSG_CONFLICT;
},
SERVER_RUNTIME: function() {
return SERVER_RUNTIME;
},
SSG_FALLBACK_EXPORT_ERROR: function() {
return SSG_FALLBACK_EXPORT_ERROR;
},
SSG_GET_INITIAL_PROPS_CONFLICT: function() {
return SSG_GET_INITIAL_PROPS_CONFLICT;
},
STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR: function() {
return STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR;
},
UNSTABLE_REVALIDATE_RENAME_ERROR: function() {
return UNSTABLE_REVALIDATE_RENAME_ERROR;
},
WEBPACK_LAYERS: function() {
return WEBPACK_LAYERS;
},
WEBPACK_RESOURCE_QUERIES: function() {
return WEBPACK_RESOURCE_QUERIES;
}
});
var NEXT_QUERY_PARAM_PREFIX = "nxtP";
var NEXT_INTERCEPTION_MARKER_PREFIX = "nxtI";
var MATCHED_PATH_HEADER = "x-matched-path";
var PRERENDER_REVALIDATE_HEADER = "x-prerender-revalidate";
var PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER = "x-prerender-revalidate-if-generated";
var RSC_PREFETCH_SUFFIX = ".prefetch.rsc";
var RSC_SEGMENTS_DIR_SUFFIX = ".segments";
var RSC_SEGMENT_SUFFIX = ".segment.rsc";
var RSC_SUFFIX = ".rsc";
var ACTION_SUFFIX = ".action";
var NEXT_DATA_SUFFIX = ".json";
var NEXT_META_SUFFIX = ".meta";
var NEXT_BODY_SUFFIX = ".body";
var NEXT_CACHE_TAGS_HEADER = "x-next-cache-tags";
var NEXT_CACHE_REVALIDATED_TAGS_HEADER = "x-next-revalidated-tags";
var NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER = "x-next-revalidate-tag-token";
var NEXT_RESUME_HEADER = "next-resume";
var NEXT_CACHE_TAG_MAX_ITEMS = 128;
var NEXT_CACHE_TAG_MAX_LENGTH = 256;
var NEXT_CACHE_SOFT_TAG_MAX_LENGTH = 1024;
var NEXT_CACHE_IMPLICIT_TAG_ID = "_N_T_";
var CACHE_ONE_YEAR = 31536e3;
var INFINITE_CACHE = 4294967294;
var MIDDLEWARE_FILENAME = "middleware";
var MIDDLEWARE_LOCATION_REGEXP = `(?:src/)?${MIDDLEWARE_FILENAME}`;
var INSTRUMENTATION_HOOK_FILENAME = "instrumentation";
var PAGES_DIR_ALIAS = "private-next-pages";
var DOT_NEXT_ALIAS = "private-dot-next";
var ROOT_DIR_ALIAS = "private-next-root-dir";
var APP_DIR_ALIAS = "private-next-app-dir";
var RSC_MOD_REF_PROXY_ALIAS = "private-next-rsc-mod-ref-proxy";
var RSC_ACTION_VALIDATE_ALIAS = "private-next-rsc-action-validate";
var RSC_ACTION_PROXY_ALIAS = "private-next-rsc-server-reference";
var RSC_CACHE_WRAPPER_ALIAS = "private-next-rsc-cache-wrapper";
var RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS = "private-next-rsc-track-dynamic-import";
var RSC_ACTION_ENCRYPTION_ALIAS = "private-next-rsc-action-encryption";
var RSC_ACTION_CLIENT_WRAPPER_ALIAS = "private-next-rsc-action-client-wrapper";
var PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`;
var SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`;
var SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`;
var SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`;
var STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`;
var SERVER_PROPS_EXPORT_ERROR = `pages with \`getServerSideProps\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`;
var GSP_NO_RETURNED_VALUE = "Your `getStaticProps` function did not return an object. Did you forget to add a `return`?";
var GSSP_NO_RETURNED_VALUE = "Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?";
var UNSTABLE_REVALIDATE_RENAME_ERROR = "The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.";
var GSSP_COMPONENT_MEMBER_ERROR = `can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`;
var NON_STANDARD_NODE_ENV = `You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`;
var SSG_FALLBACK_EXPORT_ERROR = `Pages with \`fallback\` enabled in \`getStaticPaths\` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export`;
var ESLINT_DEFAULT_DIRS = [
"app",
"pages",
"components",
"lib",
"src"
];
var SERVER_RUNTIME = {
edge: "edge",
experimentalEdge: "experimental-edge",
nodejs: "nodejs"
};
var WEBPACK_LAYERS_NAMES = {
/**
* The layer for the shared code between the client and server bundles.
*/
shared: "shared",
/**
* The layer for server-only runtime and picking up `react-server` export conditions.
* Including app router RSC pages and app router custom routes and metadata routes.
*/
reactServerComponents: "rsc",
/**
* Server Side Rendering layer for app (ssr).
*/
serverSideRendering: "ssr",
/**
* The browser client bundle layer for actions.
*/
actionBrowser: "action-browser",
/**
* The Node.js bundle layer for the API routes.
*/
apiNode: "api-node",
/**
* The Edge Lite bundle layer for the API routes.
*/
apiEdge: "api-edge",
/**
* The layer for the middleware code.
*/
middleware: "middleware",
/**
* The layer for the instrumentation hooks.
*/
instrument: "instrument",
/**
* The layer for assets on the edge.
*/
edgeAsset: "edge-asset",
/**
* The browser client bundle layer for App directory.
*/
appPagesBrowser: "app-pages-browser",
/**
* The browser client bundle layer for Pages directory.
*/
pagesDirBrowser: "pages-dir-browser",
/**
* The Edge Lite bundle layer for Pages directory.
*/
pagesDirEdge: "pages-dir-edge",
/**
* The Node.js bundle layer for Pages directory.
*/
pagesDirNode: "pages-dir-node"
};
var WEBPACK_LAYERS = {
...WEBPACK_LAYERS_NAMES,
GROUP: {
builtinReact: [
WEBPACK_LAYERS_NAMES.reactServerComponents,
WEBPACK_LAYERS_NAMES.actionBrowser
],
serverOnly: [
WEBPACK_LAYERS_NAMES.reactServerComponents,
WEBPACK_LAYERS_NAMES.actionBrowser,
WEBPACK_LAYERS_NAMES.instrument,
WEBPACK_LAYERS_NAMES.middleware
],
neutralTarget: [
// pages api
WEBPACK_LAYERS_NAMES.apiNode,
WEBPACK_LAYERS_NAMES.apiEdge
],
clientOnly: [
WEBPACK_LAYERS_NAMES.serverSideRendering,
WEBPACK_LAYERS_NAMES.appPagesBrowser
],
bundled: [
WEBPACK_LAYERS_NAMES.reactServerComponents,
WEBPACK_LAYERS_NAMES.actionBrowser,
WEBPACK_LAYERS_NAMES.serverSideRendering,
WEBPACK_LAYERS_NAMES.appPagesBrowser,
WEBPACK_LAYERS_NAMES.shared,
WEBPACK_LAYERS_NAMES.instrument,
WEBPACK_LAYERS_NAMES.middleware
],
appPages: [
// app router pages and layouts
WEBPACK_LAYERS_NAMES.reactServerComponents,
WEBPACK_LAYERS_NAMES.serverSideRendering,
WEBPACK_LAYERS_NAMES.appPagesBrowser,
WEBPACK_LAYERS_NAMES.actionBrowser
]
}
};
var WEBPACK_RESOURCE_QUERIES = {
edgeSSREntry: "__next_edge_ssr_entry__",
metadata: "__next_metadata__",
metadataRoute: "__next_metadata_route__",
metadataImageMeta: "__next_metadata_image_meta__"
};
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/server/web/utils.js
var require_utils = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/server/web/utils.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for (var name in all)
Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
fromNodeOutgoingHttpHeaders: function() {
return fromNodeOutgoingHttpHeaders;
},
normalizeNextQueryParam: function() {
return normalizeNextQueryParam;
},
splitCookiesString: function() {
return splitCookiesString;
},
toNodeOutgoingHttpHeaders: function() {
return toNodeOutgoingHttpHeaders;
},
validateURL: function() {
return validateURL;
}
});
var _constants = require_constants();
function fromNodeOutgoingHttpHeaders(nodeHeaders) {
const headers = new Headers();
for (let [key, value] of Object.entries(nodeHeaders)) {
const values = Array.isArray(value) ? value : [
value
];
for (let v of values) {
if (typeof v === "undefined")
continue;
if (typeof v === "number") {
v = v.toString();
}
headers.append(key, v);
}
}
return headers;
}
function splitCookiesString(cookiesString) {
var cookiesStrings = [];
var pos = 0;
var start;
var ch;
var lastComma;
var nextStart;
var cookiesSeparatorFound;
function skipWhitespace() {
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
pos += 1;
}
return pos < cookiesString.length;
}
function notSpecialChar() {
ch = cookiesString.charAt(pos);
return ch !== "=" && ch !== ";" && ch !== ",";
}
while (pos < cookiesString.length) {
start = pos;
cookiesSeparatorFound = false;
while (skipWhitespace()) {
ch = cookiesString.charAt(pos);
if (ch === ",") {
lastComma = pos;
pos += 1;
skipWhitespace();
nextStart = pos;
while (pos < cookiesString.length && notSpecialChar()) {
pos += 1;
}
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
cookiesSeparatorFound = true;
pos = nextStart;
cookiesStrings.push(cookiesString.substring(start, lastComma));
start = pos;
} else {
pos = lastComma + 1;
}
} else {
pos += 1;
}
}
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
}
}
return cookiesStrings;
}
function toNodeOutgoingHttpHeaders(headers) {
const nodeHeaders = {};
const cookies = [];
if (headers) {
for (const [key, value] of headers.entries()) {
if (key.toLowerCase() === "set-cookie") {
cookies.push(...splitCookiesString(value));
nodeHeaders[key] = cookies.length === 1 ? cookies[0] : cookies;
} else {
nodeHeaders[key] = value;
}
}
}
return nodeHeaders;
}
function validateURL(url) {
try {
return String(new URL(String(url)));
} catch (error) {
throw Object.defineProperty(new Error(`URL is malformed "${String(url)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, {
cause: error
}), "__NEXT_ERROR_CODE", {
value: "E61",
enumerable: false,
configurable: true
});
}
}
function normalizeNextQueryParam(key) {
const prefixes = [
_constants.NEXT_QUERY_PARAM_PREFIX,
_constants.NEXT_INTERCEPTION_MARKER_PREFIX
];
for (const prefix of prefixes) {
if (key !== prefix && key.startsWith(prefix)) {
return key.substring(prefix.length);
}
}
return null;
}
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/server/web/error.js
var require_error = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/server/web/error.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for (var name in all)
Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
PageSignatureError: function() {
return PageSignatureError;
},
RemovedPageError: function() {
return RemovedPageError;
},
RemovedUAError: function() {
return RemovedUAError;
}
});
var PageSignatureError = class extends Error {
constructor({ page }) {
super(`The middleware "${page}" accepts an async API directly with the form:
export function middleware(request, event) {
return NextResponse.redirect('/new-location')
}
Read more: https://nextjs.org/docs/messages/middleware-new-signature
`);
}
};
var RemovedPageError = class extends Error {
constructor() {
super(`The request.page has been deprecated in favour of \`URLPattern\`.
Read more: https://nextjs.org/docs/messages/middleware-request-page
`);
}
};
var RemovedUAError = class extends Error {
constructor() {
super(`The request.ua has been removed in favour of \`userAgent\` function.
Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
`);
}
};
}
});
// ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js
var require_cookies = __commonJS({
"../../node_modules/.pnpm/next@15.4.8_@babel+core@7.22.11_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js"(exports, module) {
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export2 = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
RequestCookies: () => RequestCookies,
ResponseCookies: () => ResponseCookies,
parseCookie: () => parseCookie,
parseSetCookie: () => parseSetCookie,
stringifyCookie: () => stringifyCookie
});
module.exports = __toCommonJS(src_exports);
function stringifyCookie(c) {
var _a;
const attrs = [
"path" in c && c.path && `Path=${c.path}`,
"expires" in c && (c.expires || c.expires === 0) && `Expires=${(typeof c.expires === "number" ? new Date(c.expires) : c.expires).toUTCString()}`,
"maxAge" in c && typeof c.maxAge === "number" && `Max-Age=${c.maxAge}`,
"domain" in c && c.domain && `Domain=${c.domain}`,
"secure" in c && c.secure && "Secure",
"httpOnly" in c && c.httpOnly && "HttpOnly",
"sameSite" in c && c.sameSite && `SameSite=${c.sameSite}`,
"partitioned" in c && c.partitioned && "Partitioned",
"priority" in c && c.priority && `Priority=${c.priority}`
].filter(Boolean);
const stringified = `${c.name}=${encodeURIComponent((_a = c.value) != null ? _a : "")}`;
return attrs.length === 0 ? stringified : `${stringified}; ${attrs.join("; ")}`;
}
function parseCookie(cookie) {
const map = /* @__PURE__ */ new Map();
for (const pair of cookie.split(/; */)) {
if (!pair)
continue;
const splitAt = pair.indexOf("=");
if (splitAt === -1) {
map.set(pair, "true");
continue;
}
const [key, value] = [pair.slice(0, splitAt), pair.slice(splitAt + 1)];
try {
map.set(key, decodeURIComponent(value != null ? value : "true"));
} catch {
}
}
return map;
}
function parseSetCookie(setCookie) {
if (!setCookie) {
return void 0;
}
const [[name, value], ...attributes] = parseCookie(setCookie);
const {
domain,
expires,
httponly,
maxage,
path,
samesite,
secure,
partitioned,
priority
} = Object.fromEntries(
attributes.map(([key, value2]) => [
key.toLowerCase().replace(/-/g, ""),
value2
])
);
const cookie = {
name,
value: decodeURIComponent(value),
domain,
...expires && { expires: new Date(expires) },
...httponly && { httpOnly: true },
...typeof maxage === "string" && { maxAge: Number(maxage) },
path,
...samesite && { sameSite: parseSameSite(samesite) },
...secure && { secure: true },
...priority && { priority: parsePriority(priority) },
...partitioned && { partitioned: true }
};
return compact(cookie);
}
function compact(t) {
const newT = {};
for (const key in t) {
if (t[key]) {
newT[key] = t[key];
}
}
return newT;
}
var SAME_SITE = ["strict", "lax", "none"];
function parseSameSite(string) {
string = string.toLowerCase();
return SAME_SITE.includes(string) ? string : void 0;
}
var PRIORITY = ["low", "medium", "high"];
function parsePriority(string) {
string = string.toLowerCase();
return PRIORITY.includes(string) ? string : void 0;
}
function splitCookiesString(cookiesString) {
if (!cookiesString)
return [];
var cookiesStrings = [];
var pos = 0;
var start;
var ch;
var lastComma;
var nextStart;
var cookiesSeparatorFound;
function skipWhitespace() {
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
pos += 1;
}
return pos < cookiesString.length;
}
function notSpecialChar() {
ch = cookiesString.charAt(pos);
return ch !== "=" && ch !== ";" && ch !== ",";
}
while (pos < cookiesString.length) {
start = pos;
cookiesSeparatorFound = false;
while (skipWhitespace()) {
ch = cookiesString.charAt(pos);
if (ch === ",") {
lastComma = pos;
pos += 1;
skipWhitespace();
nextStart = pos;
while (pos < cookiesString.length && notSpecialChar()) {
pos += 1;
}
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
cookiesSeparatorFound = true;
pos = nextStart;
cookiesStrings.push(cookiesString.substring(start, lastComma));
start = pos;
} else {
pos = lastComma + 1;
}
} else {
pos += 1;
}
}
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
}
}
return cookiesStrings;
}
var RequestCookies = class {
constructor(requestHeaders) {
this._parsed = /* @__PURE__ */ new Map();
this._headers = requestHeaders;
const header = requestHeaders.get("cookie");
if (header) {
const parsed = parseCookie(header);
for (const [name, value] of parsed) {
this._parsed.set(name, { name, value });
}
}
}
[Symbol.iterator]() {
return this._parsed[Symbol.iterator]();
}
/**
* The amount of cookies received from the client
*/
get size() {
return this._parsed.size;
}
get(...args) {
const name = typeof args[0] === "string" ? args[0] : args[0].name;
return this._parsed.get(name);
}
getAll(...args) {
var _a;
const all = Array.from(this._parsed);
if (!args.length) {
return all.map(([_, value]) => value);
}
const name = typeof args[0] === "string" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;
return all.f