import process from 'node:process';globalThis._importMeta_={url:import.meta.url,env:process.env};import { tmpdir } from 'node:os'; import { Server } from 'node:http'; import { resolve as resolve$1, dirname, join } from 'node:path'; import nodeCrypto from 'node:crypto'; import { parentPort, threadId } from 'node:worker_threads'; import { defineEventHandler, handleCacheHeaders, splitCookiesString, createEvent, fetchWithEvent, isEvent, eventHandler, setHeaders, sendRedirect, proxyRequest, getRequestHeader, setResponseHeaders, setResponseStatus, send, getRequestHeaders, setResponseHeader, appendResponseHeader, getRequestURL, getResponseHeader, getResponseStatus, createError, getRequestHost, getRequestProtocol, getQuery as getQuery$1, removeResponseHeader, setHeader, getCookie, getHeader, readBody, createApp, createRouter as createRouter$1, toNodeListener, lazyEventHandler, getRouterParam, getResponseStatusText } from 'file://D:/claude-project/web7-published/node_modules/h3/dist/index.mjs'; import { escapeHtml } from 'file://D:/claude-project/web7-published/node_modules/@vue/shared/dist/shared.cjs.js'; import _RemarkEmoji from 'file://D:/claude-project/web7-published/node_modules/remark-emoji/index.js'; import { createRenderer, getRequestDependencies, getPreloadLinks, getPrefetchLinks } from 'file://D:/claude-project/web7-published/node_modules/vue-bundle-renderer/dist/runtime.mjs'; import { stringify, uneval } from 'file://D:/claude-project/web7-published/node_modules/devalue/index.js'; import { createHead as createHead$1, propsToString, renderSSRHead } from 'file://D:/claude-project/web7-published/node_modules/nuxt/node_modules/unhead/dist/server.mjs'; import defu, { defuFn, defu as defu$1, createDefu } from 'file://D:/claude-project/web7-published/node_modules/defu/dist/defu.mjs'; import { toRouteMatcher, createRouter } from 'file://D:/claude-project/web7-published/node_modules/radix3/dist/index.mjs'; import consola, { consola as consola$1, createConsola } from 'file://D:/claude-project/web7-published/node_modules/consola/dist/index.mjs'; import { klona } from 'file://D:/claude-project/web7-published/node_modules/klona/dist/index.mjs'; import destr, { destr as destr$1 } from 'file://D:/claude-project/web7-published/node_modules/destr/dist/index.mjs'; import { snakeCase, kebabCase, pascalCase, camelCase } from 'file://D:/claude-project/web7-published/node_modules/scule/dist/index.mjs'; import { createHooks } from 'file://D:/claude-project/web7-published/node_modules/hookable/dist/index.mjs'; import { createFetch, Headers as Headers$1 } from 'file://D:/claude-project/web7-published/node_modules/ofetch/dist/node.mjs'; import { fetchNodeRequestHandler, callNodeRequestHandler } from 'file://D:/claude-project/web7-published/node_modules/node-mock-http/dist/index.mjs'; import { createStorage, prefixStorage } from 'file://D:/claude-project/web7-published/node_modules/unstorage/dist/index.mjs'; import unstorage_47drivers_47fs from 'file://D:/claude-project/web7-published/node_modules/unstorage/drivers/fs.mjs'; import { digest } from 'file://D:/claude-project/web7-published/node_modules/nitropack/node_modules/ohash/dist/index.mjs'; import { readFile } from 'node:fs/promises'; import { ErrorParser } from 'file://D:/claude-project/web7-published/node_modules/youch-core/build/index.js'; import { Youch } from 'file://D:/claude-project/web7-published/node_modules/nitropack/node_modules/youch/build/index.js'; import { SourceMapConsumer } from 'file://D:/claude-project/web7-published/node_modules/nitropack/node_modules/source-map/source-map.js'; import { AsyncLocalStorage } from 'node:async_hooks'; import { getContext } from 'file://D:/claude-project/web7-published/node_modules/unctx/dist/index.mjs'; import { captureRawStackTrace, parseRawStackTrace } from 'file://D:/claude-project/web7-published/node_modules/errx/dist/index.js'; import { isVNode, toValue, isRef } from 'file://D:/claude-project/web7-published/node_modules/vue/index.mjs'; import devalue from 'file://D:/claude-project/web7-published/node_modules/@nuxt/devalue/dist/devalue.mjs'; import { promises } from 'node:fs'; import { fileURLToPath } from 'node:url'; import { dirname as dirname$1, resolve as resolve$2, extname } from 'file://D:/claude-project/web7-published/node_modules/pathe/dist/index.mjs'; import { hash as hash$1 } from 'file://D:/claude-project/web7-published/node_modules/ohash/dist/index.mjs'; import { unified } from 'file://D:/claude-project/web7-published/node_modules/unified/index.js'; import { toString as toString$1 } from 'file://D:/claude-project/web7-published/node_modules/mdast-util-to-string/index.js'; import { postprocess, preprocess } from 'file://D:/claude-project/web7-published/node_modules/micromark/dev/index.js'; import { stringifyPosition } from 'file://D:/claude-project/web7-published/node_modules/unist-util-stringify-position/index.js'; import { markdownLineEnding, markdownSpace } from 'file://D:/claude-project/web7-published/node_modules/micromark-util-character/dev/index.js'; import { push, splice } from 'file://D:/claude-project/web7-published/node_modules/micromark-util-chunked/dev/index.js'; import { resolveAll } from 'file://D:/claude-project/web7-published/node_modules/micromark-util-resolve-all/index.js'; import { normalizeUri } from 'file://D:/claude-project/web7-published/node_modules/micromark-util-sanitize-uri/dev/index.js'; import slugify from 'file://D:/claude-project/web7-published/node_modules/slugify/slugify.js'; import remarkParse from 'file://D:/claude-project/web7-published/node_modules/remark-parse/index.js'; import remark2rehype from 'file://D:/claude-project/web7-published/node_modules/remark-rehype/index.js'; import remarkMDC, { parseFrontMatter } from 'file://D:/claude-project/web7-published/node_modules/remark-mdc/dist/index.mjs'; import remarkGFM from 'file://D:/claude-project/web7-published/node_modules/remark-gfm/index.js'; import rehypeExternalLinks from 'file://D:/claude-project/web7-published/node_modules/rehype-external-links/index.js'; import rehypeSortAttributeValues from 'file://D:/claude-project/web7-published/node_modules/rehype-sort-attribute-values/index.js'; import rehypeSortAttributes from 'file://D:/claude-project/web7-published/node_modules/rehype-sort-attributes/index.js'; import rehypeRaw from 'file://D:/claude-project/web7-published/node_modules/rehype-raw/index.js'; import { detab } from 'file://D:/claude-project/web7-published/node_modules/detab/index.js'; import { toString } from 'file://D:/claude-project/web7-published/node_modules/hast-util-to-string/index.js'; import Slugger from 'file://D:/claude-project/web7-published/node_modules/github-slugger/index.js'; import { DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin } from 'file://D:/claude-project/web7-published/node_modules/nuxt/node_modules/unhead/dist/plugins.mjs'; import { renderToString } from 'file://D:/claude-project/web7-published/node_modules/vue/server-renderer/index.mjs'; import { walkResolver } from 'file://D:/claude-project/web7-published/node_modules/nuxt/node_modules/unhead/dist/utils.mjs'; const HASH_RE = /#/g; const AMPERSAND_RE = /&/g; const SLASH_RE = /\//g; const EQUAL_RE = /=/g; const IM_RE = /\?/g; const PLUS_RE = /\+/g; const ENC_CARET_RE = /%5e/gi; const ENC_BACKTICK_RE = /%60/gi; const ENC_PIPE_RE = /%7c/gi; const ENC_SPACE_RE = /%20/gi; const ENC_SLASH_RE = /%2f/gi; const ENC_ENC_SLASH_RE = /%252f/gi; function encode(text) { return encodeURI("" + text).replace(ENC_PIPE_RE, "|"); } function encodeQueryValue(input) { return encode(typeof input === "string" ? input : JSON.stringify(input)).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CARET_RE, "^").replace(SLASH_RE, "%2F"); } function encodeQueryKey(text) { return encodeQueryValue(text).replace(EQUAL_RE, "%3D"); } function encodePath(text) { return encode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F").replace(ENC_ENC_SLASH_RE, "%2F").replace(AMPERSAND_RE, "%26").replace(PLUS_RE, "%2B"); } function decode(text = "") { try { return decodeURIComponent("" + text); } catch { return "" + text; } } function decodePath(text) { return decode(text.replace(ENC_SLASH_RE, "%252F")); } function decodeQueryKey(text) { return decode(text.replace(PLUS_RE, " ")); } function decodeQueryValue(text) { return decode(text.replace(PLUS_RE, " ")); } function parseQuery(parametersString = "") { const object = /* @__PURE__ */ Object.create(null); if (parametersString[0] === "?") { parametersString = parametersString.slice(1); } for (const parameter of parametersString.split("&")) { const s = parameter.match(/([^=]+)=?(.*)/) || []; if (s.length < 2) { continue; } const key = decodeQueryKey(s[1]); if (key === "__proto__" || key === "constructor") { continue; } const value = decodeQueryValue(s[2] || ""); if (object[key] === void 0) { object[key] = value; } else if (Array.isArray(object[key])) { object[key].push(value); } else { object[key] = [object[key], value]; } } return object; } function encodeQueryItem(key, value) { if (typeof value === "number" || typeof value === "boolean") { value = String(value); } if (!value) { return encodeQueryKey(key); } if (Array.isArray(value)) { return value.map( (_value) => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}` ).join("&"); } return `${encodeQueryKey(key)}=${encodeQueryValue(value)}`; } function stringifyQuery(query) { return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem(k, query[k])).filter(Boolean).join("&"); } const PROTOCOL_STRICT_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/; const PROTOCOL_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{2})?/; const PROTOCOL_RELATIVE_REGEX = /^([/\\]\s*){2,}[^/\\]/; const JOIN_LEADING_SLASH_RE = /^\.?\//; function isRelative(inputString) { return ["./", "../"].some((string_) => inputString.startsWith(string_)); } function hasProtocol(inputString, opts = {}) { if (typeof opts === "boolean") { opts = { acceptRelative: opts }; } if (opts.strict) { return PROTOCOL_STRICT_REGEX.test(inputString); } return PROTOCOL_REGEX.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(inputString) : false); } function hasTrailingSlash(input = "", respectQueryAndFragment) { { return input.endsWith("/"); } } function withoutTrailingSlash(input = "", respectQueryAndFragment) { { return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || "/"; } } function withTrailingSlash(input = "", respectQueryAndFragment) { { return input.endsWith("/") ? input : input + "/"; } } function hasLeadingSlash(input = "") { return input.startsWith("/"); } function withoutLeadingSlash(input = "") { return (hasLeadingSlash(input) ? input.slice(1) : input) || "/"; } function withLeadingSlash(input = "") { return hasLeadingSlash(input) ? input : "/" + input; } function withBase(input, base) { if (isEmptyURL(base) || hasProtocol(input)) { return input; } const _base = withoutTrailingSlash(base); if (input.startsWith(_base)) { return input; } return joinURL(_base, input); } function withoutBase(input, base) { if (isEmptyURL(base)) { return input; } const _base = withoutTrailingSlash(base); if (!input.startsWith(_base)) { return input; } const trimmed = input.slice(_base.length); return trimmed[0] === "/" ? trimmed : "/" + trimmed; } function withQuery(input, query) { const parsed = parseURL(input); const mergedQuery = { ...parseQuery(parsed.search), ...query }; parsed.search = stringifyQuery(mergedQuery); return stringifyParsedURL(parsed); } function getQuery(input) { return parseQuery(parseURL(input).search); } function isEmptyURL(url) { return !url || url === "/"; } function isNonEmptyURL(url) { return url && url !== "/"; } function joinURL(base, ...input) { let url = base || ""; for (const segment of input.filter((url2) => isNonEmptyURL(url2))) { if (url) { const _segment = segment.replace(JOIN_LEADING_SLASH_RE, ""); url = withTrailingSlash(url) + _segment; } else { url = segment; } } return url; } function joinRelativeURL(..._input) { const JOIN_SEGMENT_SPLIT_RE = /\/(?!\/)/; const input = _input.filter(Boolean); const segments = []; let segmentsDepth = 0; for (const i of input) { if (!i || i === "/") { continue; } for (const [sindex, s] of i.split(JOIN_SEGMENT_SPLIT_RE).entries()) { if (!s || s === ".") { continue; } if (s === "..") { if (segments.length === 1 && hasProtocol(segments[0])) { continue; } segments.pop(); segmentsDepth--; continue; } if (sindex === 1 && segments[segments.length - 1]?.endsWith(":/")) { segments[segments.length - 1] += "/" + s; continue; } segments.push(s); segmentsDepth++; } } let url = segments.join("/"); if (segmentsDepth >= 0) { if (input[0]?.startsWith("/") && !url.startsWith("/")) { url = "/" + url; } else if (input[0]?.startsWith("./") && !url.startsWith("./")) { url = "./" + url; } } else { url = "../".repeat(-1 * segmentsDepth) + url; } if (input[input.length - 1]?.endsWith("/") && !url.endsWith("/")) { url += "/"; } return url; } function withHttps(input) { return withProtocol(input, "https://"); } function withoutProtocol(input) { return withProtocol(input, ""); } function withProtocol(input, protocol) { let match = input.match(PROTOCOL_REGEX); if (!match) { match = input.match(/^\/{2,}/); } if (!match) { return protocol + input; } return protocol + input.slice(match[0].length); } const protocolRelative = Symbol.for("ufo:protocolRelative"); function parseURL(input = "", defaultProto) { const _specialProtoMatch = input.match( /^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i ); if (_specialProtoMatch) { const [, _proto, _pathname = ""] = _specialProtoMatch; return { protocol: _proto.toLowerCase(), pathname: _pathname, href: _proto + _pathname, auth: "", host: "", search: "", hash: "" }; } if (!hasProtocol(input, { acceptRelative: true })) { return defaultProto ? parseURL(defaultProto + input) : parsePath(input); } const [, protocol = "", auth, hostAndPath = ""] = input.replace(/\\/g, "/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/) || []; let [, host = "", path = ""] = hostAndPath.match(/([^#/?]*)(.*)?/) || []; if (protocol === "file:") { path = path.replace(/\/(?=[A-Za-z]:)/, ""); } const { pathname, search, hash } = parsePath(path); return { protocol: protocol.toLowerCase(), auth: auth ? auth.slice(0, Math.max(0, auth.length - 1)) : "", host, pathname, search, hash, [protocolRelative]: !protocol }; } function parsePath(input = "") { const [pathname = "", search = "", hash = ""] = (input.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1); return { pathname, search, hash }; } function stringifyParsedURL(parsed) { const pathname = parsed.pathname || ""; const search = parsed.search ? (parsed.search.startsWith("?") ? "" : "?") + parsed.search : ""; const hash = parsed.hash || ""; const auth = parsed.auth ? parsed.auth + "@" : ""; const host = parsed.host || ""; const proto = parsed.protocol || parsed[protocolRelative] ? (parsed.protocol || "") + "//" : ""; return proto + auth + host + pathname + search + hash; } const serverAssets = [{"baseName":"server","dir":"D:/claude-project/web7-published/server/assets"}]; const assets$1 = createStorage(); for (const asset of serverAssets) { assets$1.mount(asset.baseName, unstorage_47drivers_47fs({ base: asset.dir, ignore: (asset?.ignore || []) })); } const storage$1 = createStorage({}); storage$1.mount('/assets', assets$1); storage$1.mount('root', unstorage_47drivers_47fs({"driver":"fs","readOnly":true,"base":"D:/claude-project/web7-published","watchOptions":{"ignored":[null]}})); storage$1.mount('src', unstorage_47drivers_47fs({"driver":"fs","readOnly":true,"base":"D:/claude-project/web7-published/server","watchOptions":{"ignored":[null]}})); storage$1.mount('content:source:content', unstorage_47drivers_47fs({"name":"content:source:content","driver":"fs","base":"D:/claude-project/web7-published/content"})); storage$1.mount('cache:content', unstorage_47drivers_47fs({"driver":"fs","base":"D:/claude-project/web7-published/.nuxt/content-cache"})); storage$1.mount('build', unstorage_47drivers_47fs({"driver":"fs","readOnly":false,"base":"D:/claude-project/web7-published/.nuxt"})); storage$1.mount('cache', unstorage_47drivers_47fs({"driver":"fs","readOnly":false,"base":"D:/claude-project/web7-published/.nuxt/cache"})); storage$1.mount('data', unstorage_47drivers_47fs({"driver":"fs","base":"D:/claude-project/web7-published/.data/kv"})); function useStorage(base = "") { return base ? prefixStorage(storage$1, base) : storage$1; } const Hasher = /* @__PURE__ */ (() => { class Hasher2 { buff = ""; #context = /* @__PURE__ */ new Map(); write(str) { this.buff += str; } dispatch(value) { const type = value === null ? "null" : typeof value; return this[type](value); } object(object) { if (object && typeof object.toJSON === "function") { return this.object(object.toJSON()); } const objString = Object.prototype.toString.call(object); let objType = ""; const objectLength = objString.length; objType = objectLength < 10 ? "unknown:[" + objString + "]" : objString.slice(8, objectLength - 1); objType = objType.toLowerCase(); let objectNumber = null; if ((objectNumber = this.#context.get(object)) === void 0) { this.#context.set(object, this.#context.size); } else { return this.dispatch("[CIRCULAR:" + objectNumber + "]"); } if (typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(object)) { this.write("buffer:"); return this.write(object.toString("utf8")); } if (objType !== "object" && objType !== "function" && objType !== "asyncfunction") { if (this[objType]) { this[objType](object); } else { this.unknown(object, objType); } } else { const keys = Object.keys(object).sort(); const extraKeys = []; this.write("object:" + (keys.length + extraKeys.length) + ":"); const dispatchForKey = (key) => { this.dispatch(key); this.write(":"); this.dispatch(object[key]); this.write(","); }; for (const key of keys) { dispatchForKey(key); } for (const key of extraKeys) { dispatchForKey(key); } } } array(arr, unordered) { unordered = unordered === void 0 ? false : unordered; this.write("array:" + arr.length + ":"); if (!unordered || arr.length <= 1) { for (const entry of arr) { this.dispatch(entry); } return; } const contextAdditions = /* @__PURE__ */ new Map(); const entries = arr.map((entry) => { const hasher = new Hasher2(); hasher.dispatch(entry); for (const [key, value] of hasher.#context) { contextAdditions.set(key, value); } return hasher.toString(); }); this.#context = contextAdditions; entries.sort(); return this.array(entries, false); } date(date) { return this.write("date:" + date.toJSON()); } symbol(sym) { return this.write("symbol:" + sym.toString()); } unknown(value, type) { this.write(type); if (!value) { return; } this.write(":"); if (value && typeof value.entries === "function") { return this.array( [...value.entries()], true /* ordered */ ); } } error(err) { return this.write("error:" + err.toString()); } boolean(bool) { return this.write("bool:" + bool); } string(string) { this.write("string:" + string.length + ":"); this.write(string); } function(fn) { this.write("fn:"); if (isNativeFunction(fn)) { this.dispatch("[native]"); } else { this.dispatch(fn.toString()); } } number(number) { return this.write("number:" + number); } null() { return this.write("Null"); } undefined() { return this.write("Undefined"); } regexp(regex) { return this.write("regex:" + regex.toString()); } arraybuffer(arr) { this.write("arraybuffer:"); return this.dispatch(new Uint8Array(arr)); } url(url) { return this.write("url:" + url.toString()); } map(map) { this.write("map:"); const arr = [...map]; return this.array(arr, false); } set(set) { this.write("set:"); const arr = [...set]; return this.array(arr, false); } bigint(number) { return this.write("bigint:" + number.toString()); } } for (const type of [ "uint8array", "uint8clampedarray", "unt8array", "uint16array", "unt16array", "uint32array", "unt32array", "float32array", "float64array" ]) { Hasher2.prototype[type] = function(arr) { this.write(type + ":"); return this.array([...arr], false); }; } function isNativeFunction(f) { if (typeof f !== "function") { return false; } return Function.prototype.toString.call(f).slice( -15 /* "[native code] }".length */ ) === "[native code] }"; } return Hasher2; })(); function serialize(object) { const hasher = new Hasher(); hasher.dispatch(object); return hasher.buff; } function hash(value) { return digest(typeof value === "string" ? value : serialize(value)).replace(/[-_]/g, "").slice(0, 10); } function defaultCacheOptions() { return { name: "_", base: "/cache", swr: true, maxAge: 1 }; } function defineCachedFunction(fn, opts = {}) { opts = { ...defaultCacheOptions(), ...opts }; const pending = {}; const group = opts.group || "nitro/functions"; const name = opts.name || fn.name || "_"; const integrity = opts.integrity || hash([fn, opts]); const validate = opts.validate || ((entry) => entry.value !== void 0); async function get(key, resolver, shouldInvalidateCache, event) { const cacheKey = [opts.base, group, name, key + ".json"].filter(Boolean).join(":").replace(/:\/$/, ":index"); let entry = await useStorage().getItem(cacheKey).catch((error) => { console.error(`[cache] Cache read error.`, error); useNitroApp().captureError(error, { event, tags: ["cache"] }); }) || {}; if (typeof entry !== "object") { entry = {}; const error = new Error("Malformed data read from cache."); console.error("[cache]", error); useNitroApp().captureError(error, { event, tags: ["cache"] }); } const ttl = (opts.maxAge ?? 0) * 1e3; if (ttl) { entry.expires = Date.now() + ttl; } const expired = shouldInvalidateCache || entry.integrity !== integrity || ttl && Date.now() - (entry.mtime || 0) > ttl || validate(entry) === false; const _resolve = async () => { const isPending = pending[key]; if (!isPending) { if (entry.value !== void 0 && (opts.staleMaxAge || 0) >= 0 && opts.swr === false) { entry.value = void 0; entry.integrity = void 0; entry.mtime = void 0; entry.expires = void 0; } pending[key] = Promise.resolve(resolver()); } try { entry.value = await pending[key]; } catch (error) { if (!isPending) { delete pending[key]; } throw error; } if (!isPending) { entry.mtime = Date.now(); entry.integrity = integrity; delete pending[key]; if (validate(entry) !== false) { let setOpts; if (opts.maxAge && !opts.swr) { setOpts = { ttl: opts.maxAge }; } const promise = useStorage().setItem(cacheKey, entry, setOpts).catch((error) => { console.error(`[cache] Cache write error.`, error); useNitroApp().captureError(error, { event, tags: ["cache"] }); }); if (event?.waitUntil) { event.waitUntil(promise); } } } }; const _resolvePromise = expired ? _resolve() : Promise.resolve(); if (entry.value === void 0) { await _resolvePromise; } else if (expired && event && event.waitUntil) { event.waitUntil(_resolvePromise); } if (opts.swr && validate(entry) !== false) { _resolvePromise.catch((error) => { console.error(`[cache] SWR handler error.`, error); useNitroApp().captureError(error, { event, tags: ["cache"] }); }); return entry; } return _resolvePromise.then(() => entry); } return async (...args) => { const shouldBypassCache = await opts.shouldBypassCache?.(...args); if (shouldBypassCache) { return fn(...args); } const key = await (opts.getKey || getKey)(...args); const shouldInvalidateCache = await opts.shouldInvalidateCache?.(...args); const entry = await get( key, () => fn(...args), shouldInvalidateCache, args[0] && isEvent(args[0]) ? args[0] : void 0 ); let value = entry.value; if (opts.transform) { value = await opts.transform(entry, ...args) || value; } return value; }; } function cachedFunction(fn, opts = {}) { return defineCachedFunction(fn, opts); } function getKey(...args) { return args.length > 0 ? hash(args) : ""; } function escapeKey(key) { return String(key).replace(/\W/g, ""); } function defineCachedEventHandler(handler, opts = defaultCacheOptions()) { const variableHeaderNames = (opts.varies || []).filter(Boolean).map((h) => h.toLowerCase()).sort(); const _opts = { ...opts, getKey: async (event) => { const customKey = await opts.getKey?.(event); if (customKey) { return escapeKey(customKey); } const _path = event.node.req.originalUrl || event.node.req.url || event.path; let _pathname; try { _pathname = escapeKey(decodeURI(parseURL(_path).pathname)).slice(0, 16) || "index"; } catch { _pathname = "-"; } const _hashedPath = `${_pathname}.${hash(_path)}`; const _headers = variableHeaderNames.map((header) => [header, event.node.req.headers[header]]).map(([name, value]) => `${escapeKey(name)}.${hash(value)}`); return [_hashedPath, ..._headers].join(":"); }, validate: (entry) => { if (!entry.value) { return false; } if (entry.value.code >= 400) { return false; } if (entry.value.body === void 0) { return false; } if (entry.value.headers.etag === "undefined" || entry.value.headers["last-modified"] === "undefined") { return false; } return true; }, group: opts.group || "nitro/handlers", integrity: opts.integrity || hash([handler, opts]) }; const _cachedHandler = cachedFunction( async (incomingEvent) => { const variableHeaders = {}; for (const header of variableHeaderNames) { const value = incomingEvent.node.req.headers[header]; if (value !== void 0) { variableHeaders[header] = value; } } const reqProxy = cloneWithProxy(incomingEvent.node.req, { headers: variableHeaders }); const resHeaders = {}; let _resSendBody; const resProxy = cloneWithProxy(incomingEvent.node.res, { statusCode: 200, writableEnded: false, writableFinished: false, headersSent: false, closed: false, getHeader(name) { return resHeaders[name]; }, setHeader(name, value) { resHeaders[name] = value; return this; }, getHeaderNames() { return Object.keys(resHeaders); }, hasHeader(name) { return name in resHeaders; }, removeHeader(name) { delete resHeaders[name]; }, getHeaders() { return resHeaders; }, end(chunk, arg2, arg3) { if (typeof chunk === "string") { _resSendBody = chunk; } if (typeof arg2 === "function") { arg2(); } if (typeof arg3 === "function") { arg3(); } return this; }, write(chunk, arg2, arg3) { if (typeof chunk === "string") { _resSendBody = chunk; } if (typeof arg2 === "function") { arg2(void 0); } if (typeof arg3 === "function") { arg3(); } return true; }, writeHead(statusCode, headers2) { this.statusCode = statusCode; if (headers2) { if (Array.isArray(headers2) || typeof headers2 === "string") { throw new TypeError("Raw headers is not supported."); } for (const header in headers2) { const value = headers2[header]; if (value !== void 0) { this.setHeader( header, value ); } } } return this; } }); const event = createEvent(reqProxy, resProxy); event.fetch = (url, fetchOptions) => fetchWithEvent(event, url, fetchOptions, { fetch: useNitroApp().localFetch }); event.$fetch = (url, fetchOptions) => fetchWithEvent(event, url, fetchOptions, { fetch: globalThis.$fetch }); event.waitUntil = incomingEvent.waitUntil; event.context = incomingEvent.context; event.context.cache = { options: _opts }; const body = await handler(event) || _resSendBody; const headers = event.node.res.getHeaders(); headers.etag = String( headers.Etag || headers.etag || `W/"${hash(body)}"` ); headers["last-modified"] = String( headers["Last-Modified"] || headers["last-modified"] || (/* @__PURE__ */ new Date()).toUTCString() ); const cacheControl = []; if (opts.swr) { if (opts.maxAge) { cacheControl.push(`s-maxage=${opts.maxAge}`); } if (opts.staleMaxAge) { cacheControl.push(`stale-while-revalidate=${opts.staleMaxAge}`); } else { cacheControl.push("stale-while-revalidate"); } } else if (opts.maxAge) { cacheControl.push(`max-age=${opts.maxAge}`); } if (cacheControl.length > 0) { headers["cache-control"] = cacheControl.join(", "); } const cacheEntry = { code: event.node.res.statusCode, headers, body }; return cacheEntry; }, _opts ); return defineEventHandler(async (event) => { if (opts.headersOnly) { if (handleCacheHeaders(event, { maxAge: opts.maxAge })) { return; } return handler(event); } const response = await _cachedHandler( event ); if (event.node.res.headersSent || event.node.res.writableEnded) { return response.body; } if (handleCacheHeaders(event, { modifiedTime: new Date(response.headers["last-modified"]), etag: response.headers.etag, maxAge: opts.maxAge })) { return; } event.node.res.statusCode = response.code; for (const name in response.headers) { const value = response.headers[name]; if (name === "set-cookie") { event.node.res.appendHeader( name, splitCookiesString(value) ); } else { if (value !== void 0) { event.node.res.setHeader(name, value); } } } return response.body; }); } function cloneWithProxy(obj, overrides) { return new Proxy(obj, { get(target, property, receiver) { if (property in overrides) { return overrides[property]; } return Reflect.get(target, property, receiver); }, set(target, property, value, receiver) { if (property in overrides) { overrides[property] = value; return true; } return Reflect.set(target, property, value, receiver); } }); } const cachedEventHandler = defineCachedEventHandler; const inlineAppConfig = { "nuxt": {} }; const appConfig = defuFn(inlineAppConfig); function getEnv(key, opts) { const envKey = snakeCase(key).toUpperCase(); return destr( process.env[opts.prefix + envKey] ?? process.env[opts.altPrefix + envKey] ); } function _isObject(input) { return typeof input === "object" && !Array.isArray(input); } function applyEnv(obj, opts, parentKey = "") { for (const key in obj) { const subKey = parentKey ? `${parentKey}_${key}` : key; const envValue = getEnv(subKey, opts); if (_isObject(obj[key])) { if (_isObject(envValue)) { obj[key] = { ...obj[key], ...envValue }; applyEnv(obj[key], opts, subKey); } else if (envValue === void 0) { applyEnv(obj[key], opts, subKey); } else { obj[key] = envValue ?? obj[key]; } } else { obj[key] = envValue ?? obj[key]; } if (opts.envExpansion && typeof obj[key] === "string") { obj[key] = _expandFromEnv(obj[key]); } } return obj; } const envExpandRx = /\{\{([^{}]*)\}\}/g; function _expandFromEnv(value) { return value.replace(envExpandRx, (match, key) => { return process.env[key] || match; }); } const _inlineRuntimeConfig = { "app": { "baseURL": "/", "buildId": "dev", "buildAssetsDir": "/_nuxt/", "cdnURL": "" }, "nitro": { "envPrefix": "NUXT_", "routeRules": { "/__nuxt_error": { "cache": false }, "/sitemap.xsl": { "headers": { "Content-Type": "application/xslt+xml" } }, "/sitemap.xml": { "redirect": { "to": "/sitemap_index.xml", "statusCode": 307 } }, "/sitemap_index.xml": { "headers": { "Content-Type": "text/xml; charset=UTF-8", "Cache-Control": "public, max-age=600, must-revalidate", "X-Sitemap-Prerendered": "2025-09-11T03:36:06.648Z" } }, "/__sitemap__/index.xml": { "headers": { "Content-Type": "text/xml; charset=UTF-8", "Cache-Control": "public, max-age=600, must-revalidate", "X-Sitemap-Prerendered": "2025-09-11T03:36:06.648Z" } }, "/index-sitemap.xml": { "redirect": { "to": "/__sitemap__/index.xml", "statusCode": 307 } }, "/__sitemap__/en.xml": { "headers": { "Content-Type": "text/xml; charset=UTF-8", "Cache-Control": "public, max-age=600, must-revalidate", "X-Sitemap-Prerendered": "2025-09-11T03:36:06.648Z" } }, "/en-sitemap.xml": { "redirect": { "to": "/__sitemap__/en.xml", "statusCode": 307 } }, "/__sitemap__/zh.xml": { "headers": { "Content-Type": "text/xml; charset=UTF-8", "Cache-Control": "public, max-age=600, must-revalidate", "X-Sitemap-Prerendered": "2025-09-11T03:36:06.648Z" } }, "/zh-sitemap.xml": { "redirect": { "to": "/__sitemap__/zh.xml", "statusCode": 307 } }, "/__sitemap__/zh-hant.xml": { "headers": { "Content-Type": "text/xml; charset=UTF-8", "Cache-Control": "public, max-age=600, must-revalidate", "X-Sitemap-Prerendered": "2025-09-11T03:36:06.648Z" } }, "/zh-hant-sitemap.xml": { "redirect": { "to": "/__sitemap__/zh-hant.xml", "statusCode": 307 } }, "/_nuxt/builds/meta/**": { "headers": { "cache-control": "public, max-age=31536000, immutable" } }, "/_nuxt/builds/**": { "headers": { "cache-control": "public, max-age=1, immutable" } } } }, "public": { "i18n": { "baseUrl": "", "defaultLocale": "en", "defaultDirection": "ltr", "strategy": "prefix_except_default", "lazy": true, "rootRedirect": "", "routesNameSeparator": "___", "defaultLocaleRouteNameSuffix": "default", "skipSettingLocaleOnNavigate": false, "differentDomains": false, "trailingSlash": false, "configLocales": [ { "code": "en", "name": "English", "files": [ "D:/claude-project/web7-published/locales/en.json" ] }, { "code": "zh", "name": "简体中文", "files": [ "D:/claude-project/web7-published/locales/zh.json" ] }, { "code": "zh-hant", "name": "繁體中文", "files": [ "D:/claude-project/web7-published/locales/zh-hant.json" ] } ], "locales": { "en": { "domain": "" }, "zh": { "domain": "" }, "zh-hant": { "domain": "" } }, "detectBrowserLanguage": { "alwaysRedirect": false, "cookieCrossOrigin": false, "cookieDomain": "", "cookieKey": "i18n_redirected", "cookieSecure": false, "fallbackLocale": "", "redirectOn": "root", "useCookie": true }, "experimental": { "localeDetector": "", "switchLocalePathLinkSSR": false, "autoImportTranslationFunctions": false }, "multiDomainLocales": false }, "mdc": { "components": { "prose": true, "map": { "p": "prose-p", "a": "prose-a", "blockquote": "prose-blockquote", "code-inline": "prose-code-inline", "code": "ProseCodeInline", "em": "prose-em", "h1": "prose-h1", "h2": "prose-h2", "h3": "prose-h3", "h4": "prose-h4", "h5": "prose-h5", "h6": "prose-h6", "hr": "prose-hr", "img": "prose-img", "ul": "prose-ul", "ol": "prose-ol", "li": "prose-li", "strong": "prose-strong", "table": "prose-table", "thead": "prose-thead", "tbody": "prose-tbody", "td": "prose-td", "th": "prose-th", "tr": "prose-tr" } }, "headings": { "anchorLinks": { "h1": false, "h2": true, "h3": true, "h4": true, "h5": false, "h6": false } } }, "content": { "locales": [], "defaultLocale": "", "integrity": "", "experimental": { "stripQueryParameters": false, "advanceQuery": false, "clientDB": false }, "respectPathCase": false, "api": { "baseURL": "/api/_content" }, "navigation": { "fields": [] }, "tags": { "p": "prose-p", "a": "prose-a", "blockquote": "prose-blockquote", "code-inline": "prose-code-inline", "code": "ProseCodeInline", "em": "prose-em", "h1": "prose-h1", "h2": "prose-h2", "h3": "prose-h3", "h4": "prose-h4", "h5": "prose-h5", "h6": "prose-h6", "hr": "prose-hr", "img": "prose-img", "ul": "prose-ul", "ol": "prose-ol", "li": "prose-li", "strong": "prose-strong", "table": "prose-table", "thead": "prose-thead", "tbody": "prose-tbody", "td": "prose-td", "th": "prose-th", "tr": "prose-tr" }, "highlight": false, "wsUrl": "ws://localhost:4000/", "documentDriven": false, "host": "", "trailingSlash": false, "search": "", "contentHead": true, "anchorLinks": { "depth": 4, "exclude": [ 1 ] } } }, "content": { "cacheVersion": 2, "cacheIntegrity": "dLYeSFVwsx", "transformers": [], "base": "", "api": { "baseURL": "/api/_content" }, "watch": { "ws": { "port": { "port": 4000, "portRange": [ 4000, 4040 ] }, "hostname": "localhost", "showURL": false } }, "sources": {}, "ignores": [], "locales": [], "defaultLocale": "", "highlight": false, "markdown": { "tags": { "p": "prose-p", "a": "prose-a", "blockquote": "prose-blockquote", "code-inline": "prose-code-inline", "code": "ProseCodeInline", "em": "prose-em", "h1": "prose-h1", "h2": "prose-h2", "h3": "prose-h3", "h4": "prose-h4", "h5": "prose-h5", "h6": "prose-h6", "hr": "prose-hr", "img": "prose-img", "ul": "prose-ul", "ol": "prose-ol", "li": "prose-li", "strong": "prose-strong", "table": "prose-table", "thead": "prose-thead", "tbody": "prose-tbody", "td": "prose-td", "th": "prose-th", "tr": "prose-tr" }, "anchorLinks": { "depth": 4, "exclude": [ 1 ] }, "remarkPlugins": {}, "rehypePlugins": {} }, "yaml": {}, "csv": { "delimeter": ",", "json": true }, "navigation": { "fields": [] }, "contentHead": true, "documentDriven": false, "respectPathCase": false, "experimental": { "clientDB": false, "cacheContents": true, "stripQueryParameters": false, "advanceQuery": false, "search": "" } }, "sitemap": { "isI18nMapped": true, "sitemapName": "sitemap.xml", "isMultiSitemap": true, "excludeAppSources": [], "cacheMaxAgeSeconds": 0, "autoLastmod": false, "defaultSitemapsChunkSize": 1000, "minify": false, "sortEntries": true, "debug": false, "discoverImages": true, "discoverVideos": true, "sitemapsPathPrefix": "/__sitemap__/", "isNuxtContentDocumentDriven": false, "xsl": "/__sitemap__/style.xsl", "xslTips": true, "xslColumns": [ { "label": "URL", "width": "50%" }, { "label": "Images", "width": "25%", "select": "count(image:image)" }, { "label": "Last Updated", "width": "25%", "select": "concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)),concat(' ', substring(sitemap:lastmod,20,6)))" } ], "credits": true, "version": "6.1.5", "sitemaps": { "index": { "sitemapName": "index", "_route": "sitemap_index.xml", "sitemaps": [], "include": [], "exclude": [] }, "en": { "include": [], "exclude": [ "/_nuxt/**", "/_**" ], "includeAppSources": true, "sitemapName": "en", "_route": "/__sitemap__/en.xml", "_hasSourceChunk": false }, "zh": { "include": [], "exclude": [ "/_nuxt/**", "/_**" ], "includeAppSources": true, "sitemapName": "zh", "_route": "/__sitemap__/zh.xml", "_hasSourceChunk": false }, "zh-hant": { "include": [], "exclude": [ "/_nuxt/**", "/_**" ], "includeAppSources": true, "sitemapName": "zh-hant", "_route": "/__sitemap__/zh-hant.xml", "_hasSourceChunk": false } }, "autoI18n": { "differentDomains": false, "defaultLocale": "en", "locales": [ { "code": "en", "name": "English", "_hreflang": "en", "_sitemap": "en" }, { "code": "zh", "name": "简体中文", "_hreflang": "zh", "_sitemap": "zh" }, { "code": "zh-hant", "name": "繁體中文", "_hreflang": "zh-hant", "_sitemap": "zh-hant" } ], "strategy": "prefix_except_default" } }, "nuxt-site-config": { "stack": [ { "_context": "system", "_priority": -15, "name": "web7-published", "env": "development" }, { "_context": "package.json", "_priority": -10, "name": "cloudproxy-pro" }, { "_context": "@nuxtjs/i18n", "defaultLocale": "en" } ], "version": "2.2.21", "debug": false }, "nuxt-robots": { "version": "4.1.11", "usingNuxtContent": true, "debug": false, "credits": true, "groups": [ { "comment": [], "disallow": [], "allow": [ "/", "/zh/", "/zh-hant/" ], "userAgent": [ "*" ], "_indexable": true, "_rules": [ { "pattern": "/", "allow": true }, { "pattern": "/zh/", "allow": true }, { "pattern": "/zh-hant/", "allow": true } ] } ], "sitemap": [ "https://cloudproxy-pro.com/sitemap.xml", "/sitemap_index.xml" ], "header": true, "robotsEnabledValue": "index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1", "robotsDisabledValue": "noindex, nofollow", "cacheControl": "max-age=14400, must-revalidate" }, "nuxt-simple-robots": { "version": "4.1.11", "usingNuxtContent": true, "debug": false, "credits": true, "groups": [ { "comment": [], "disallow": [], "allow": [ "/", "/zh/", "/zh-hant/" ], "userAgent": [ "*" ], "_indexable": true, "_rules": [ { "pattern": "/", "allow": true }, { "pattern": "/zh/", "allow": true }, { "pattern": "/zh-hant/", "allow": true } ] } ], "sitemap": [ "https://cloudproxy-pro.com/sitemap.xml", "/sitemap_index.xml" ], "header": true, "robotsEnabledValue": "index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1", "robotsDisabledValue": "noindex, nofollow", "cacheControl": "max-age=14400, must-revalidate" } }; const envOptions = { prefix: "NITRO_", altPrefix: _inlineRuntimeConfig.nitro.envPrefix ?? process.env.NITRO_ENV_PREFIX ?? "_", envExpansion: _inlineRuntimeConfig.nitro.envExpansion ?? process.env.NITRO_ENV_EXPANSION ?? false }; const _sharedRuntimeConfig = _deepFreeze( applyEnv(klona(_inlineRuntimeConfig), envOptions) ); function useRuntimeConfig(event) { if (!event) { return _sharedRuntimeConfig; } if (event.context.nitro.runtimeConfig) { return event.context.nitro.runtimeConfig; } const runtimeConfig = klona(_inlineRuntimeConfig); applyEnv(runtimeConfig, envOptions); event.context.nitro.runtimeConfig = runtimeConfig; return runtimeConfig; } const _sharedAppConfig = _deepFreeze(klona(appConfig)); function useAppConfig(event) { if (!event) { return _sharedAppConfig; } if (event.context.nitro.appConfig) { return event.context.nitro.appConfig; } const appConfig$1 = klona(appConfig); event.context.nitro.appConfig = appConfig$1; return appConfig$1; } function _deepFreeze(object) { const propNames = Object.getOwnPropertyNames(object); for (const name of propNames) { const value = object[name]; if (value && typeof value === "object") { _deepFreeze(value); } } return Object.freeze(object); } new Proxy(/* @__PURE__ */ Object.create(null), { get: (_, prop) => { console.warn( "Please use `useRuntimeConfig()` instead of accessing config directly." ); const runtimeConfig = useRuntimeConfig(); if (prop in runtimeConfig) { return runtimeConfig[prop]; } return void 0; } }); const config = useRuntimeConfig(); const _routeRulesMatcher = toRouteMatcher( createRouter({ routes: config.nitro.routeRules }) ); function createRouteRulesHandler(ctx) { return eventHandler((event) => { const routeRules = getRouteRules(event); if (routeRules.headers) { setHeaders(event, routeRules.headers); } if (routeRules.redirect) { let target = routeRules.redirect.to; if (target.endsWith("/**")) { let targetPath = event.path; const strpBase = routeRules.redirect._redirectStripBase; if (strpBase) { targetPath = withoutBase(targetPath, strpBase); } target = joinURL(target.slice(0, -3), targetPath); } else if (event.path.includes("?")) { const query = getQuery(event.path); target = withQuery(target, query); } return sendRedirect(event, target, routeRules.redirect.statusCode); } if (routeRules.proxy) { let target = routeRules.proxy.to; if (target.endsWith("/**")) { let targetPath = event.path; const strpBase = routeRules.proxy._proxyStripBase; if (strpBase) { targetPath = withoutBase(targetPath, strpBase); } target = joinURL(target.slice(0, -3), targetPath); } else if (event.path.includes("?")) { const query = getQuery(event.path); target = withQuery(target, query); } return proxyRequest(event, target, { fetch: ctx.localFetch, ...routeRules.proxy }); } }); } function getRouteRules(event) { event.context._nitro = event.context._nitro || {}; if (!event.context._nitro.routeRules) { event.context._nitro.routeRules = getRouteRulesForPath( withoutBase(event.path.split("?")[0], useRuntimeConfig().app.baseURL) ); } return event.context._nitro.routeRules; } function getRouteRulesForPath(path) { return defu({}, ..._routeRulesMatcher.matchAll(path).reverse()); } function _captureError(error, type) { console.error(`[${type}]`, error); useNitroApp().captureError(error, { tags: [type] }); } function trapUnhandledNodeErrors() { process.on( "unhandledRejection", (error) => _captureError(error, "unhandledRejection") ); process.on( "uncaughtException", (error) => _captureError(error, "uncaughtException") ); } function joinHeaders(value) { return Array.isArray(value) ? value.join(", ") : String(value); } function normalizeFetchResponse(response) { if (!response.headers.has("set-cookie")) { return response; } return new Response(response.body, { status: response.status, statusText: response.statusText, headers: normalizeCookieHeaders(response.headers) }); } function normalizeCookieHeader(header = "") { return splitCookiesString(joinHeaders(header)); } function normalizeCookieHeaders(headers) { const outgoingHeaders = new Headers(); for (const [name, header] of headers) { if (name === "set-cookie") { for (const cookie of normalizeCookieHeader(header)) { outgoingHeaders.append("set-cookie", cookie); } } else { outgoingHeaders.set(name, joinHeaders(header)); } } return outgoingHeaders; } function isJsonRequest(event) { if (hasReqHeader(event, "accept", "text/html")) { return false; } return hasReqHeader(event, "accept", "application/json") || hasReqHeader(event, "user-agent", "curl/") || hasReqHeader(event, "user-agent", "httpie/") || hasReqHeader(event, "sec-fetch-mode", "cors") || event.path.startsWith("/api/") || event.path.endsWith(".json"); } function hasReqHeader(event, name, includes) { const value = getRequestHeader(event, name); return value && typeof value === "string" && value.toLowerCase().includes(includes); } const errorHandler$0 = (async function errorhandler(error, event, { defaultHandler }) { if (event.handled || isJsonRequest(event)) { return; } const defaultRes = await defaultHandler(error, event, { json: true }); const statusCode = error.statusCode || 500; if (statusCode === 404 && defaultRes.status === 302) { setResponseHeaders(event, defaultRes.headers); setResponseStatus(event, defaultRes.status, defaultRes.statusText); return send(event, JSON.stringify(defaultRes.body, null, 2)); } if (typeof defaultRes.body !== "string" && Array.isArray(defaultRes.body.stack)) { defaultRes.body.stack = defaultRes.body.stack.join("\n"); } const errorObject = defaultRes.body; const url = new URL(errorObject.url); errorObject.url = withoutBase(url.pathname, useRuntimeConfig(event).app.baseURL) + url.search + url.hash; errorObject.message ||= "Server Error"; errorObject.data ||= error.data; errorObject.statusMessage ||= error.statusMessage; delete defaultRes.headers["content-type"]; delete defaultRes.headers["content-security-policy"]; setResponseHeaders(event, defaultRes.headers); const reqHeaders = getRequestHeaders(event); const isRenderingError = event.path.startsWith("/__nuxt_error") || !!reqHeaders["x-nuxt-error"]; const res = isRenderingError ? null : await useNitroApp().localFetch( withQuery(joinURL(useRuntimeConfig(event).app.baseURL, "/__nuxt_error"), errorObject), { headers: { ...reqHeaders, "x-nuxt-error": "true" }, redirect: "manual" } ).catch(() => null); if (event.handled) { return; } if (!res) { const { template } = await Promise.resolve().then(function () { return errorDev; }) ; { errorObject.description = errorObject.message; } setResponseHeader(event, "Content-Type", "text/html;charset=UTF-8"); return send(event, template(errorObject)); } const html = await res.text(); for (const [header, value] of res.headers.entries()) { if (header === "set-cookie") { appendResponseHeader(event, header, value); continue; } setResponseHeader(event, header, value); } setResponseStatus(event, res.status && res.status !== 200 ? res.status : defaultRes.status, res.statusText || defaultRes.statusText); return send(event, html); }); function defineNitroErrorHandler(handler) { return handler; } const errorHandler$1 = defineNitroErrorHandler( async function defaultNitroErrorHandler(error, event) { const res = await defaultHandler(error, event); if (!event.node?.res.headersSent) { setResponseHeaders(event, res.headers); } setResponseStatus(event, res.status, res.statusText); return send( event, typeof res.body === "string" ? res.body : JSON.stringify(res.body, null, 2) ); } ); async function defaultHandler(error, event, opts) { const isSensitive = error.unhandled || error.fatal; const statusCode = error.statusCode || 500; const statusMessage = error.statusMessage || "Server Error"; const url = getRequestURL(event, { xForwardedHost: true, xForwardedProto: true }); if (statusCode === 404) { const baseURL = "/"; if (/^\/[^/]/.test(baseURL) && !url.pathname.startsWith(baseURL)) { const redirectTo = `${baseURL}${url.pathname.slice(1)}${url.search}`; return { status: 302, statusText: "Found", headers: { location: redirectTo }, body: `Redirecting...` }; } } await loadStackTrace(error).catch(consola.error); const youch = new Youch(); if (isSensitive && !opts?.silent) { const tags = [error.unhandled && "[unhandled]", error.fatal && "[fatal]"].filter(Boolean).join(" "); const ansiError = await (await youch.toANSI(error)).replaceAll(process.cwd(), "."); consola.error( `[request error] ${tags} [${event.method}] ${url} `, ansiError ); } const useJSON = opts?.json || !getRequestHeader(event, "accept")?.includes("text/html"); const headers = { "content-type": useJSON ? "application/json" : "text/html", // Prevent browser from guessing the MIME types of resources. "x-content-type-options": "nosniff", // Prevent error page from being embedded in an iframe "x-frame-options": "DENY", // Prevent browsers from sending the Referer header "referrer-policy": "no-referrer", // Disable the execution of any js "content-security-policy": "script-src 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self';" }; if (statusCode === 404 || !getResponseHeader(event, "cache-control")) { headers["cache-control"] = "no-cache"; } const body = useJSON ? { error: true, url, statusCode, statusMessage, message: error.message, data: error.data, stack: error.stack?.split("\n").map((line) => line.trim()) } : await youch.toHTML(error, { request: { url: url.href, method: event.method, headers: getRequestHeaders(event) } }); return { status: statusCode, statusText: statusMessage, headers, body }; } async function loadStackTrace(error) { if (!(error instanceof Error)) { return; } const parsed = await new ErrorParser().defineSourceLoader(sourceLoader).parse(error); const stack = error.message + "\n" + parsed.frames.map((frame) => fmtFrame(frame)).join("\n"); Object.defineProperty(error, "stack", { value: stack }); if (error.cause) { await loadStackTrace(error.cause).catch(consola.error); } } async function sourceLoader(frame) { if (!frame.fileName || frame.fileType !== "fs" || frame.type === "native") { return; } if (frame.type === "app") { const rawSourceMap = await readFile(`${frame.fileName}.map`, "utf8").catch(() => { }); if (rawSourceMap) { const consumer = await new SourceMapConsumer(rawSourceMap); const originalPosition = consumer.originalPositionFor({ line: frame.lineNumber, column: frame.columnNumber }); if (originalPosition.source && originalPosition.line) { frame.fileName = resolve$1(dirname(frame.fileName), originalPosition.source); frame.lineNumber = originalPosition.line; frame.columnNumber = originalPosition.column || 0; } } } const contents = await readFile(frame.fileName, "utf8").catch(() => { }); return contents ? { contents } : void 0; } function fmtFrame(frame) { if (frame.type === "native") { return frame.raw; } const src = `${frame.fileName || ""}:${frame.lineNumber}:${frame.columnNumber})`; return frame.functionName ? `at ${frame.functionName} (${src}` : `at ${src}`; } const errorHandlers = [errorHandler$0, errorHandler$1]; async function errorHandler(error, event) { for (const handler of errorHandlers) { try { await handler(error, event, { defaultHandler }); if (event.handled) { return; // Response handled } } catch(error) { // Handler itself thrown, log and continue console.error(error); } } // H3 will handle fallback } const script = ` if (!window.__NUXT_DEVTOOLS_TIME_METRIC__) { Object.defineProperty(window, '__NUXT_DEVTOOLS_TIME_METRIC__', { value: {}, enumerable: false, configurable: true, }) } window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now() `; const _Px1ClibNtxFQj_wR9GjpwPYcmv6EwgjdSGwWhS0BBxk = (function(nitro) { nitro.hooks.hook("render:html", (htmlContext) => { htmlContext.head.push(`