1178 lines
38 KiB
JavaScript
Raw Normal View History

2025-04-22 15:57:06 +08:00
import { shallowReactive, reactive, effectScope, getCurrentScope, hasInjectionContext, getCurrentInstance, toRef, inject, shallowRef, isReadonly, isRef, isShallow, isReactive, toRaw, defineAsyncComponent, defineComponent, computed, unref, ref, h, Suspense, nextTick, mergeProps, provide, Fragment, useSSRContext, withCtx, createVNode, onErrorCaptured, onServerPrefetch, resolveDynamicComponent, createApp } from 'file://D:/doc/workspace/web3/node_modules/vue/index.mjs';
import { createHooks } from 'file://D:/doc/workspace/web3/node_modules/hookable/dist/index.mjs';
import { getContext, executeAsync } from 'file://D:/doc/workspace/web3/node_modules/unctx/dist/index.mjs';
import { createError as createError$1, sanitizeStatusCode, appendHeader } from 'file://D:/doc/workspace/web3/node_modules/h3/dist/index.mjs';
import { START_LOCATION, createMemoryHistory, createRouter as createRouter$1, useRoute as useRoute$1, RouterView } from 'file://D:/doc/workspace/web3/node_modules/vue-router/dist/vue-router.node.mjs';
import { toRouteMatcher, createRouter } from 'file://D:/doc/workspace/web3/node_modules/radix3/dist/index.mjs';
import { defu } from 'file://D:/doc/workspace/web3/node_modules/defu/dist/defu.mjs';
import { hasProtocol, joinURL, withQuery, isScriptProtocol } from 'file://D:/doc/workspace/web3/node_modules/ufo/dist/index.mjs';
import { ssrRenderComponent, ssrRenderSuspense, ssrRenderVNode } from 'file://D:/doc/workspace/web3/node_modules/vue/server-renderer/index.mjs';
const appLayoutTransition = false;
const appPageTransition = false;
const nuxtLinkDefaults = { "componentName": "NuxtLink" };
const appId = "nuxt-app";
function getNuxtAppCtx(id = appId) {
return getContext(id, {
asyncContext: false
});
}
const NuxtPluginIndicator = "__nuxt_plugin";
function createNuxtApp(options) {
var _a;
let hydratingCount = 0;
const nuxtApp = {
_id: options.id || appId || "nuxt-app",
_scope: effectScope(),
provide: void 0,
globalName: "nuxt",
versions: {
get nuxt() {
return "3.16.2";
},
get vue() {
return nuxtApp.vueApp.version;
}
},
payload: shallowReactive({
...((_a = options.ssrContext) == null ? void 0 : _a.payload) || {},
data: shallowReactive({}),
state: reactive({}),
once: /* @__PURE__ */ new Set(),
_errors: shallowReactive({})
}),
static: {
data: {}
},
runWithContext(fn) {
if (nuxtApp._scope.active && !getCurrentScope()) {
return nuxtApp._scope.run(() => callWithNuxt(nuxtApp, fn));
}
return callWithNuxt(nuxtApp, fn);
},
isHydrating: false,
deferHydration() {
if (!nuxtApp.isHydrating) {
return () => {
};
}
hydratingCount++;
let called = false;
return () => {
if (called) {
return;
}
called = true;
hydratingCount--;
if (hydratingCount === 0) {
nuxtApp.isHydrating = false;
return nuxtApp.callHook("app:suspense:resolve");
}
};
},
_asyncDataPromises: {},
_asyncData: shallowReactive({}),
_payloadRevivers: {},
...options
};
{
nuxtApp.payload.serverRendered = true;
}
if (nuxtApp.ssrContext) {
nuxtApp.payload.path = nuxtApp.ssrContext.url;
nuxtApp.ssrContext.nuxt = nuxtApp;
nuxtApp.ssrContext.payload = nuxtApp.payload;
nuxtApp.ssrContext.config = {
public: nuxtApp.ssrContext.runtimeConfig.public,
app: nuxtApp.ssrContext.runtimeConfig.app
};
}
nuxtApp.hooks = createHooks();
nuxtApp.hook = nuxtApp.hooks.hook;
{
const contextCaller = async function(hooks, args) {
for (const hook of hooks) {
await nuxtApp.runWithContext(() => hook(...args));
}
};
nuxtApp.hooks.callHook = (name, ...args) => nuxtApp.hooks.callHookWith(contextCaller, name, ...args);
}
nuxtApp.callHook = nuxtApp.hooks.callHook;
nuxtApp.provide = (name, value) => {
const $name = "$" + name;
defineGetter(nuxtApp, $name, value);
defineGetter(nuxtApp.vueApp.config.globalProperties, $name, value);
};
defineGetter(nuxtApp.vueApp, "$nuxt", nuxtApp);
defineGetter(nuxtApp.vueApp.config.globalProperties, "$nuxt", nuxtApp);
const runtimeConfig = options.ssrContext.runtimeConfig;
nuxtApp.provide("config", runtimeConfig);
return nuxtApp;
}
function registerPluginHooks(nuxtApp, plugin) {
if (plugin.hooks) {
nuxtApp.hooks.addHooks(plugin.hooks);
}
}
async function applyPlugin(nuxtApp, plugin) {
if (typeof plugin === "function") {
const { provide } = await nuxtApp.runWithContext(() => plugin(nuxtApp)) || {};
if (provide && typeof provide === "object") {
for (const key in provide) {
nuxtApp.provide(key, provide[key]);
}
}
}
}
async function applyPlugins(nuxtApp, plugins) {
var _a, _b, _c, _d;
const resolvedPlugins = [];
const unresolvedPlugins = [];
const parallels = [];
const errors = [];
let promiseDepth = 0;
async function executePlugin(plugin) {
var _a2;
const unresolvedPluginsForThisPlugin = ((_a2 = plugin.dependsOn) == null ? void 0 : _a2.filter((name) => plugins.some((p) => p._name === name) && !resolvedPlugins.includes(name))) ?? [];
if (unresolvedPluginsForThisPlugin.length > 0) {
unresolvedPlugins.push([new Set(unresolvedPluginsForThisPlugin), plugin]);
} else {
const promise = applyPlugin(nuxtApp, plugin).then(async () => {
if (plugin._name) {
resolvedPlugins.push(plugin._name);
await Promise.all(unresolvedPlugins.map(async ([dependsOn, unexecutedPlugin]) => {
if (dependsOn.has(plugin._name)) {
dependsOn.delete(plugin._name);
if (dependsOn.size === 0) {
promiseDepth++;
await executePlugin(unexecutedPlugin);
}
}
}));
}
});
if (plugin.parallel) {
parallels.push(promise.catch((e) => errors.push(e)));
} else {
await promise;
}
}
}
for (const plugin of plugins) {
if (((_a = nuxtApp.ssrContext) == null ? void 0 : _a.islandContext) && ((_b = plugin.env) == null ? void 0 : _b.islands) === false) {
continue;
}
registerPluginHooks(nuxtApp, plugin);
}
for (const plugin of plugins) {
if (((_c = nuxtApp.ssrContext) == null ? void 0 : _c.islandContext) && ((_d = plugin.env) == null ? void 0 : _d.islands) === false) {
continue;
}
await executePlugin(plugin);
}
await Promise.all(parallels);
if (promiseDepth) {
for (let i = 0; i < promiseDepth; i++) {
await Promise.all(parallels);
}
}
if (errors.length) {
throw errors[0];
}
}
// @__NO_SIDE_EFFECTS__
function defineNuxtPlugin(plugin) {
if (typeof plugin === "function") {
return plugin;
}
const _name = plugin._name || plugin.name;
delete plugin.name;
return Object.assign(plugin.setup || (() => {
}), plugin, { [NuxtPluginIndicator]: true, _name });
}
function callWithNuxt(nuxt, setup, args) {
const fn = () => setup();
const nuxtAppCtx = getNuxtAppCtx(nuxt._id);
{
return nuxt.vueApp.runWithContext(() => nuxtAppCtx.callAsync(nuxt, fn));
}
}
function tryUseNuxtApp(id) {
var _a;
let nuxtAppInstance;
if (hasInjectionContext()) {
nuxtAppInstance = (_a = getCurrentInstance()) == null ? void 0 : _a.appContext.app.$nuxt;
}
nuxtAppInstance || (nuxtAppInstance = getNuxtAppCtx(id).tryUse());
return nuxtAppInstance || null;
}
function useNuxtApp(id) {
const nuxtAppInstance = tryUseNuxtApp(id);
if (!nuxtAppInstance) {
{
throw new Error("[nuxt] instance unavailable");
}
}
return nuxtAppInstance;
}
// @__NO_SIDE_EFFECTS__
function useRuntimeConfig(_event) {
return useNuxtApp().$config;
}
function defineGetter(obj, key, val) {
Object.defineProperty(obj, key, { get: () => val });
}
const NUXT_ERROR_SIGNATURE = "__nuxt_error";
const useError = () => toRef(useNuxtApp().payload, "error");
const showError = (error) => {
const nuxtError = createError(error);
try {
const nuxtApp = useNuxtApp();
const error2 = useError();
if (false) ;
error2.value || (error2.value = nuxtError);
} catch {
throw nuxtError;
}
return nuxtError;
};
const isNuxtError = (error) => !!error && typeof error === "object" && NUXT_ERROR_SIGNATURE in error;
const createError = (error) => {
const nuxtError = createError$1(error);
Object.defineProperty(nuxtError, NUXT_ERROR_SIGNATURE, {
value: true,
configurable: false,
writable: false
});
return nuxtError;
};
const unhead_k2P3m_ZDyjlr2mMYnoDPwavjsDN8hBlk9cFai0bbopU = defineNuxtPlugin({
name: "nuxt:head",
enforce: "pre",
setup(nuxtApp) {
const head = nuxtApp.ssrContext.head;
nuxtApp.vueApp.use(head);
}
});
function toArray$1(value) {
return Array.isArray(value) ? value : [value];
}
async function getRouteRules(arg) {
const path = typeof arg === "string" ? arg : arg.path;
{
useNuxtApp().ssrContext._preloadManifest = true;
const _routeRulesMatcher = toRouteMatcher(
createRouter({ routes: useRuntimeConfig().nitro.routeRules })
);
return defu({}, ..._routeRulesMatcher.matchAll(path).reverse());
}
}
const LayoutMetaSymbol = Symbol("layout-meta");
const PageRouteSymbol = Symbol("route");
const useRouter = () => {
var _a;
return (_a = useNuxtApp()) == null ? void 0 : _a.$router;
};
const useRoute = () => {
if (hasInjectionContext()) {
return inject(PageRouteSymbol, useNuxtApp()._route);
}
return useNuxtApp()._route;
};
// @__NO_SIDE_EFFECTS__
function defineNuxtRouteMiddleware(middleware) {
return middleware;
}
const isProcessingMiddleware = () => {
try {
if (useNuxtApp()._processingMiddleware) {
return true;
}
} catch {
return false;
}
return false;
};
const URL_QUOTE_RE = /"/g;
const navigateTo = (to, options) => {
to || (to = "/");
const toPath = typeof to === "string" ? to : "path" in to ? resolveRouteObject(to) : useRouter().resolve(to).href;
const isExternalHost = hasProtocol(toPath, { acceptRelative: true });
const isExternal = (options == null ? void 0 : options.external) || isExternalHost;
if (isExternal) {
if (!(options == null ? void 0 : options.external)) {
throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");
}
const { protocol } = new URL(toPath, "http://localhost");
if (protocol && isScriptProtocol(protocol)) {
throw new Error(`Cannot navigate to a URL with '${protocol}' protocol.`);
}
}
const inMiddleware = isProcessingMiddleware();
const router = useRouter();
const nuxtApp = useNuxtApp();
{
if (nuxtApp.ssrContext) {
const fullPath = typeof to === "string" || isExternal ? toPath : router.resolve(to).fullPath || "/";
const location2 = isExternal ? toPath : joinURL(useRuntimeConfig().app.baseURL, fullPath);
const redirect = async function(response) {
await nuxtApp.callHook("app:redirected");
const encodedLoc = location2.replace(URL_QUOTE_RE, "%22");
const encodedHeader = encodeURL(location2, isExternalHost);
nuxtApp.ssrContext._renderResponse = {
statusCode: sanitizeStatusCode((options == null ? void 0 : options.redirectCode) || 302, 302),
body: `<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${encodedLoc}"></head></html>`,
headers: { location: encodedHeader }
};
return response;
};
if (!isExternal && inMiddleware) {
router.afterEach((final) => final.fullPath === fullPath ? redirect(false) : void 0);
return to;
}
return redirect(!inMiddleware ? void 0 : (
/* abort route navigation */
false
));
}
}
if (isExternal) {
nuxtApp._scope.stop();
if (options == null ? void 0 : options.replace) {
(void 0).replace(toPath);
} else {
(void 0).href = toPath;
}
if (inMiddleware) {
if (!nuxtApp.isHydrating) {
return false;
}
return new Promise(() => {
});
}
return Promise.resolve();
}
return (options == null ? void 0 : options.replace) ? router.replace(to) : router.push(to);
};
function resolveRouteObject(to) {
return withQuery(to.path || "", to.query || {}) + (to.hash || "");
}
function encodeURL(location2, isExternalHost = false) {
const url = new URL(location2, "http://localhost");
if (!isExternalHost) {
return url.pathname + url.search + url.hash;
}
if (location2.startsWith("//")) {
return url.toString().replace(url.protocol, "");
}
return url.toString();
}
function handleHotUpdate(_router, _generateRoutes) {
}
const _routes = [
{
name: "about",
path: "/about",
component: () => import('./about.vue.mjs')
},
{
name: "cases",
path: "/cases",
component: () => import('./cases.vue.mjs')
},
{
name: "index",
path: "/",
component: () => import('./index.vue.mjs')
},
{
name: "contact",
path: "/contact",
component: () => import('./contact.vue.mjs')
},
{
name: "products",
path: "/products",
component: () => import('./products.vue.mjs')
},
{
name: "solutions",
path: "/solutions",
component: () => import('./solutions.vue.mjs')
}
];
const _wrapInTransition = (props, children) => {
return { default: () => {
var _a;
return (_a = children.default) == null ? void 0 : _a.call(children);
} };
};
const ROUTE_KEY_PARENTHESES_RE = /(:\w+)\([^)]+\)/g;
const ROUTE_KEY_SYMBOLS_RE = /(:\w+)[?+*]/g;
const ROUTE_KEY_NORMAL_RE = /:\w+/g;
function generateRouteKey(route) {
const source = (route == null ? void 0 : route.meta.key) ?? route.path.replace(ROUTE_KEY_PARENTHESES_RE, "$1").replace(ROUTE_KEY_SYMBOLS_RE, "$1").replace(ROUTE_KEY_NORMAL_RE, (r) => {
var _a;
return ((_a = route.params[r.slice(1)]) == null ? void 0 : _a.toString()) || "";
});
return typeof source === "function" ? source(route) : source;
}
function isChangingPage(to, from) {
if (to === from || from === START_LOCATION) {
return false;
}
if (generateRouteKey(to) !== generateRouteKey(from)) {
return true;
}
const areComponentsSame = to.matched.every(
(comp, index) => {
var _a, _b;
return comp.components && comp.components.default === ((_b = (_a = from.matched[index]) == null ? void 0 : _a.components) == null ? void 0 : _b.default);
}
);
if (areComponentsSame) {
return false;
}
return true;
}
const routerOptions0 = {
scrollBehavior(to, from, savedPosition) {
var _a;
const nuxtApp = useNuxtApp();
const behavior = ((_a = useRouter().options) == null ? void 0 : _a.scrollBehaviorType) ?? "auto";
let position = savedPosition || void 0;
const routeAllowsScrollToTop = typeof to.meta.scrollToTop === "function" ? to.meta.scrollToTop(to, from) : to.meta.scrollToTop;
if (!position && from && to && routeAllowsScrollToTop !== false && isChangingPage(to, from)) {
position = { left: 0, top: 0 };
}
if (to.path === from.path) {
if (from.hash && !to.hash) {
return { left: 0, top: 0 };
}
if (to.hash) {
return { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior };
}
return false;
}
const hasTransition = (route) => !!(route.meta.pageTransition ?? appPageTransition);
const hookToWait = hasTransition(from) && hasTransition(to) ? "page:transition:finish" : "page:loading:end";
return new Promise((resolve) => {
nuxtApp.hooks.hookOnce(hookToWait, () => {
requestAnimationFrame(() => resolve(_calculatePosition(to, "instant", position)));
});
});
}
};
function _getHashElementScrollMarginTop(selector) {
try {
const elem = (void 0).querySelector(selector);
if (elem) {
return (Number.parseFloat(getComputedStyle(elem).scrollMarginTop) || 0) + (Number.parseFloat(getComputedStyle((void 0).documentElement).scrollPaddingTop) || 0);
}
} catch {
}
return 0;
}
function _calculatePosition(to, scrollBehaviorType, position) {
if (position) {
return position;
}
if (to.hash) {
return {
el: to.hash,
top: _getHashElementScrollMarginTop(to.hash),
behavior: scrollBehaviorType
};
}
return { left: 0, top: 0, behavior: scrollBehaviorType };
}
const configRouterOptions = {
hashMode: false,
scrollBehaviorType: "auto"
};
const routerOptions = {
...configRouterOptions,
...routerOptions0
};
const validate = defineNuxtRouteMiddleware(async (to) => {
var _a;
let __temp, __restore;
if (!((_a = to.meta) == null ? void 0 : _a.validate)) {
return;
}
const nuxtApp = useNuxtApp();
const router = useRouter();
const result = ([__temp, __restore] = executeAsync(() => Promise.resolve(to.meta.validate(to))), __temp = await __temp, __restore(), __temp);
if (result === true) {
return;
}
const error = createError({
statusCode: result && result.statusCode || 404,
statusMessage: result && result.statusMessage || `Page Not Found: ${to.fullPath}`,
data: {
path: to.fullPath
}
});
const unsub = router.beforeResolve((final) => {
unsub();
if (final === to) {
const unsub2 = router.afterEach(async () => {
unsub2();
await nuxtApp.runWithContext(() => showError(error));
});
return false;
}
});
});
const manifest_45route_45rule = defineNuxtRouteMiddleware(async (to) => {
{
return;
}
});
const globalMiddleware = [
validate,
manifest_45route_45rule
];
const namedMiddleware = {};
const plugin = defineNuxtPlugin({
name: "nuxt:router",
enforce: "pre",
async setup(nuxtApp) {
var _a, _b, _c, _d;
let __temp, __restore;
let routerBase = useRuntimeConfig().app.baseURL;
const history = ((_b = (_a = routerOptions).history) == null ? void 0 : _b.call(_a, routerBase)) ?? createMemoryHistory(routerBase);
const routes = routerOptions.routes ? ([__temp, __restore] = executeAsync(() => routerOptions.routes(_routes)), __temp = await __temp, __restore(), __temp) ?? _routes : _routes;
let startPosition;
const router = createRouter$1({
...routerOptions,
scrollBehavior: (to, from, savedPosition) => {
if (from === START_LOCATION) {
startPosition = savedPosition;
return;
}
if (routerOptions.scrollBehavior) {
router.options.scrollBehavior = routerOptions.scrollBehavior;
if ("scrollRestoration" in (void 0).history) {
const unsub = router.beforeEach(() => {
unsub();
(void 0).history.scrollRestoration = "manual";
});
}
return routerOptions.scrollBehavior(to, START_LOCATION, startPosition || savedPosition);
}
},
history,
routes
});
handleHotUpdate(router, routerOptions.routes ? routerOptions.routes : (routes2) => routes2);
nuxtApp.vueApp.use(router);
const previousRoute = shallowRef(router.currentRoute.value);
router.afterEach((_to, from) => {
previousRoute.value = from;
});
Object.defineProperty(nuxtApp.vueApp.config.globalProperties, "previousRoute", {
get: () => previousRoute.value
});
const initialURL = nuxtApp.ssrContext.url;
const _route = shallowRef(router.currentRoute.value);
const syncCurrentRoute = () => {
_route.value = router.currentRoute.value;
};
nuxtApp.hook("page:finish", syncCurrentRoute);
router.afterEach((to, from) => {
var _a2, _b2, _c2, _d2;
if (((_b2 = (_a2 = to.matched[0]) == null ? void 0 : _a2.components) == null ? void 0 : _b2.default) === ((_d2 = (_c2 = from.matched[0]) == null ? void 0 : _c2.components) == null ? void 0 : _d2.default)) {
syncCurrentRoute();
}
});
const route = {};
for (const key in _route.value) {
Object.defineProperty(route, key, {
get: () => _route.value[key],
enumerable: true
});
}
nuxtApp._route = shallowReactive(route);
nuxtApp._middleware || (nuxtApp._middleware = {
global: [],
named: {}
});
useError();
if (!((_c = nuxtApp.ssrContext) == null ? void 0 : _c.islandContext)) {
router.afterEach(async (to, _from, failure) => {
delete nuxtApp._processingMiddleware;
if (failure) {
await nuxtApp.callHook("page:loading:end");
}
if ((failure == null ? void 0 : failure.type) === 4) {
return;
}
if (to.redirectedFrom && to.fullPath !== initialURL) {
await nuxtApp.runWithContext(() => navigateTo(to.fullPath || "/"));
}
});
}
try {
if (true) {
;
[__temp, __restore] = executeAsync(() => router.push(initialURL)), await __temp, __restore();
;
}
;
[__temp, __restore] = executeAsync(() => router.isReady()), await __temp, __restore();
;
} catch (error2) {
[__temp, __restore] = executeAsync(() => nuxtApp.runWithContext(() => showError(error2))), await __temp, __restore();
}
const resolvedInitialRoute = router.currentRoute.value;
syncCurrentRoute();
if ((_d = nuxtApp.ssrContext) == null ? void 0 : _d.islandContext) {
return { provide: { router } };
}
const initialLayout = nuxtApp.payload.state._layout;
router.beforeEach(async (to, from) => {
var _a2, _b2, _c2;
await nuxtApp.callHook("page:loading:start");
to.meta = reactive(to.meta);
if (nuxtApp.isHydrating && initialLayout && !isReadonly(to.meta.layout)) {
to.meta.layout = initialLayout;
}
nuxtApp._processingMiddleware = true;
if (!((_a2 = nuxtApp.ssrContext) == null ? void 0 : _a2.islandContext)) {
const middlewareEntries = /* @__PURE__ */ new Set([...globalMiddleware, ...nuxtApp._middleware.global]);
for (const component of to.matched) {
const componentMiddleware = component.meta.middleware;
if (!componentMiddleware) {
continue;
}
for (const entry of toArray$1(componentMiddleware)) {
middlewareEntries.add(entry);
}
}
{
const routeRules = await nuxtApp.runWithContext(() => getRouteRules({ path: to.path }));
if (routeRules.appMiddleware) {
for (const key in routeRules.appMiddleware) {
if (routeRules.appMiddleware[key]) {
middlewareEntries.add(key);
} else {
middlewareEntries.delete(key);
}
}
}
}
for (const entry of middlewareEntries) {
const middleware = typeof entry === "string" ? nuxtApp._middleware.named[entry] || await ((_c2 = (_b2 = namedMiddleware)[entry]) == null ? void 0 : _c2.call(_b2).then((r) => r.default || r)) : entry;
if (!middleware) {
throw new Error(`Unknown route middleware: '${entry}'.`);
}
try {
const result = await nuxtApp.runWithContext(() => middleware(to, from));
if (true) {
if (result === false || result instanceof Error) {
const error2 = result || createError$1({
statusCode: 404,
statusMessage: `Page Not Found: ${initialURL}`
});
await nuxtApp.runWithContext(() => showError(error2));
return false;
}
}
if (result === true) {
continue;
}
if (result === false) {
return result;
}
if (result) {
if (isNuxtError(result) && result.fatal) {
await nuxtApp.runWithContext(() => showError(result));
}
return result;
}
} catch (err) {
const error2 = createError$1(err);
if (error2.fatal) {
await nuxtApp.runWithContext(() => showError(error2));
}
return error2;
}
}
}
});
router.onError(async () => {
delete nuxtApp._processingMiddleware;
await nuxtApp.callHook("page:loading:end");
});
router.afterEach(async (to, _from) => {
if (to.matched.length === 0) {
await nuxtApp.runWithContext(() => showError(createError$1({
statusCode: 404,
fatal: false,
statusMessage: `Page not found: ${to.fullPath}`,
data: {
path: to.fullPath
}
})));
}
});
nuxtApp.hooks.hookOnce("app:created", async () => {
try {
if ("name" in resolvedInitialRoute) {
resolvedInitialRoute.name = void 0;
}
await router.replace({
...resolvedInitialRoute,
force: true
});
router.options.scrollBehavior = routerOptions.scrollBehavior;
} catch (error2) {
await nuxtApp.runWithContext(() => showError(error2));
}
});
return { provide: { router } };
}
});
function definePayloadReducer(name, reduce) {
{
useNuxtApp().ssrContext._payloadReducers[name] = reduce;
}
}
const reducers = [
["NuxtError", (data) => isNuxtError(data) && data.toJSON()],
["EmptyShallowRef", (data) => isRef(data) && isShallow(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
["EmptyRef", (data) => isRef(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
["ShallowRef", (data) => isRef(data) && isShallow(data) && data.value],
["ShallowReactive", (data) => isReactive(data) && isShallow(data) && toRaw(data)],
["Ref", (data) => isRef(data) && data.value],
["Reactive", (data) => isReactive(data) && toRaw(data)]
];
const revive_payload_server_MVtmlZaQpj6ApFmshWfUWl5PehCebzaBf2NuRMiIbms = defineNuxtPlugin({
name: "nuxt:revive-payload:server",
setup() {
for (const [reducer, fn] of reducers) {
definePayloadReducer(reducer, fn);
}
}
});
const components_plugin_z4hgvsiddfKkfXTP6M8M4zG5Cb7sGnDhcryKVM45Di4 = defineNuxtPlugin({
name: "nuxt:global-components"
});
function toArray(value) {
return Array.isArray(value) ? value : [value];
}
function useRequestEvent(nuxtApp) {
var _a;
nuxtApp || (nuxtApp = useNuxtApp());
return (_a = nuxtApp.ssrContext) == null ? void 0 : _a.event;
}
function prerenderRoutes(path) {
const paths = toArray(path);
appendHeader(useRequestEvent(), "x-nitro-prerender", paths.map((p) => encodeURIComponent(p)).join(", "));
}
let routes;
const prerender_server_sqIxOBipVr4FbVMA9kqWL0wT8FPop6sKAXLVfifsJzk = defineNuxtPlugin(async () => {
let __temp, __restore;
if (routes && !routes.length) {
return;
}
useRuntimeConfig().nitro.routeRules;
routes || (routes = Array.from(processRoutes(([__temp, __restore] = executeAsync(() => {
var _a, _b;
return (_b = (_a = routerOptions).routes) == null ? void 0 : _b.call(_a, _routes);
}), __temp = await __temp, __restore(), __temp) ?? _routes)));
const batch = routes.splice(0, 10);
prerenderRoutes(batch);
});
const OPTIONAL_PARAM_RE = /^\/?:.*(?:\?|\(\.\*\)\*)$/;
function shouldPrerender(path) {
return true;
}
function processRoutes(routes2, currentPath = "/", routesToPrerender = /* @__PURE__ */ new Set()) {
var _a;
for (const route of routes2) {
if (OPTIONAL_PARAM_RE.test(route.path) && !((_a = route.children) == null ? void 0 : _a.length) && shouldPrerender()) {
routesToPrerender.add(currentPath);
}
if (route.path.includes(":")) {
continue;
}
const fullPath = joinURL(currentPath, route.path);
{
routesToPrerender.add(fullPath);
}
if (route.children) {
processRoutes(route.children, fullPath, routesToPrerender);
}
}
return routesToPrerender;
}
const plugins = [
unhead_k2P3m_ZDyjlr2mMYnoDPwavjsDN8hBlk9cFai0bbopU,
plugin,
revive_payload_server_MVtmlZaQpj6ApFmshWfUWl5PehCebzaBf2NuRMiIbms,
components_plugin_z4hgvsiddfKkfXTP6M8M4zG5Cb7sGnDhcryKVM45Di4,
prerender_server_sqIxOBipVr4FbVMA9kqWL0wT8FPop6sKAXLVfifsJzk
];
const layouts = {
default: defineAsyncComponent(() => import('./default.vue.mjs').then((m) => m.default || m))
};
const LayoutLoader = defineComponent({
name: "LayoutLoader",
inheritAttrs: false,
props: {
name: String,
layoutProps: Object
},
setup(props, context) {
return () => h(layouts[props.name], props.layoutProps, context.slots);
}
});
const nuxtLayoutProps = {
name: {
type: [String, Boolean, Object],
default: null
},
fallback: {
type: [String, Object],
default: null
}
};
const __nuxt_component_0 = defineComponent({
name: "NuxtLayout",
inheritAttrs: false,
props: nuxtLayoutProps,
setup(props, context) {
const nuxtApp = useNuxtApp();
const injectedRoute = inject(PageRouteSymbol);
const route = injectedRoute === useRoute() ? useRoute$1() : injectedRoute;
const layout = computed(() => {
let layout2 = unref(props.name) ?? route.meta.layout ?? "default";
if (layout2 && !(layout2 in layouts)) {
if (props.fallback) {
layout2 = unref(props.fallback);
}
}
return layout2;
});
const layoutRef = ref();
context.expose({ layoutRef });
const done = nuxtApp.deferHydration();
return () => {
const hasLayout = layout.value && layout.value in layouts;
const transitionProps = route.meta.layoutTransition ?? appLayoutTransition;
return _wrapInTransition(hasLayout && transitionProps, {
default: () => h(Suspense, { suspensible: true, onResolve: () => {
nextTick(done);
} }, {
default: () => h(
LayoutProvider,
{
layoutProps: mergeProps(context.attrs, { ref: layoutRef }),
key: layout.value || void 0,
name: layout.value,
shouldProvide: !props.name,
hasTransition: !!transitionProps
},
context.slots
)
})
}).default();
};
}
});
const LayoutProvider = defineComponent({
name: "NuxtLayoutProvider",
inheritAttrs: false,
props: {
name: {
type: [String, Boolean]
},
layoutProps: {
type: Object
},
hasTransition: {
type: Boolean
},
shouldProvide: {
type: Boolean
}
},
setup(props, context) {
const name = props.name;
if (props.shouldProvide) {
provide(LayoutMetaSymbol, {
isCurrent: (route) => name === (route.meta.layout ?? "default")
});
}
return () => {
var _a, _b;
if (!name || typeof name === "string" && !(name in layouts)) {
return (_b = (_a = context.slots).default) == null ? void 0 : _b.call(_a);
}
return h(
LayoutLoader,
{ key: name, layoutProps: props.layoutProps, name },
context.slots
);
};
}
});
const defineRouteProvider = (name = "RouteProvider") => defineComponent({
name,
props: {
vnode: {
type: Object,
required: true
},
route: {
type: Object,
required: true
},
vnodeRef: Object,
renderKey: String,
trackRootNodes: Boolean
},
setup(props) {
const previousKey = props.renderKey;
const previousRoute = props.route;
const route = {};
for (const key in props.route) {
Object.defineProperty(route, key, {
get: () => previousKey === props.renderKey ? props.route[key] : previousRoute[key],
enumerable: true
});
}
provide(PageRouteSymbol, shallowReactive(route));
return () => {
return h(props.vnode, { ref: props.vnodeRef });
};
}
});
const RouteProvider = defineRouteProvider();
const __nuxt_component_1 = defineComponent({
name: "NuxtPage",
inheritAttrs: false,
props: {
name: {
type: String
},
transition: {
type: [Boolean, Object],
default: void 0
},
keepalive: {
type: [Boolean, Object],
default: void 0
},
route: {
type: Object
},
pageKey: {
type: [Function, String],
default: null
}
},
setup(props, { attrs, slots, expose }) {
const nuxtApp = useNuxtApp();
const pageRef = ref();
inject(PageRouteSymbol, null);
expose({ pageRef });
inject(LayoutMetaSymbol, null);
nuxtApp.deferHydration();
return () => {
return h(RouterView, { name: props.name, route: props.route, ...attrs }, {
default: (routeProps) => {
return h(Suspense, { suspensible: true }, {
default() {
return h(RouteProvider, {
vnode: slots.default ? normalizeSlot(slots.default, routeProps) : routeProps.Component,
route: routeProps.route,
vnodeRef: pageRef
});
}
});
}
});
};
}
});
function normalizeSlot(slot, data) {
const slotContent = slot(data);
return slotContent.length === 1 ? h(slotContent[0]) : h(Fragment, void 0, slotContent);
}
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
const _sfc_main$2 = {};
function _sfc_ssrRender(_ctx, _push, _parent, _attrs) {
const _component_NuxtLayout = __nuxt_component_0;
const _component_NuxtPage = __nuxt_component_1;
_push(ssrRenderComponent(_component_NuxtLayout, _attrs, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_NuxtPage, null, null, _parent2, _scopeId));
} else {
return [
createVNode(_component_NuxtPage)
];
}
}),
_: 1
}, _parent));
}
const _sfc_setup$2 = _sfc_main$2.setup;
_sfc_main$2.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("app.vue");
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
};
const AppComponent = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender]]);
const _sfc_main$1 = {
__name: "nuxt-error-page",
__ssrInlineRender: true,
props: {
error: Object
},
setup(__props) {
const props = __props;
const _error = props.error;
_error.stack ? _error.stack.split("\n").splice(1).map((line) => {
const text = line.replace("webpack:/", "").replace(".vue", ".js").trim();
return {
text,
internal: line.includes("node_modules") && !line.includes(".cache") || line.includes("internal") || line.includes("new Promise")
};
}).map((i) => `<span class="stack${i.internal ? " internal" : ""}">${i.text}</span>`).join("\n") : "";
const statusCode = Number(_error.statusCode || 500);
const is404 = statusCode === 404;
const statusMessage = _error.statusMessage ?? (is404 ? "Page Not Found" : "Internal Server Error");
const description = _error.message || _error.toString();
const stack = void 0;
const _Error404 = defineAsyncComponent(() => import('./error-404.vue.mjs'));
const _Error = defineAsyncComponent(() => import('./error-500.vue.mjs'));
const ErrorTemplate = is404 ? _Error404 : _Error;
return (_ctx, _push, _parent, _attrs) => {
_push(ssrRenderComponent(unref(ErrorTemplate), mergeProps({ statusCode: unref(statusCode), statusMessage: unref(statusMessage), description: unref(description), stack: unref(stack) }, _attrs), null, _parent));
};
}
};
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/nuxt/dist/app/components/nuxt-error-page.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = {
__name: "nuxt-root",
__ssrInlineRender: true,
setup(__props) {
const IslandRenderer = () => null;
const nuxtApp = useNuxtApp();
nuxtApp.deferHydration();
nuxtApp.ssrContext.url;
const SingleRenderer = false;
provide(PageRouteSymbol, useRoute());
nuxtApp.hooks.callHookWith((hooks) => hooks.map((hook) => hook()), "vue:setup");
const error = useError();
const abortRender = error.value && !nuxtApp.ssrContext.error;
onErrorCaptured((err, target, info) => {
nuxtApp.hooks.callHook("vue:error", err, target, info).catch((hookError) => console.error("[nuxt] Error in `vue:error` hook", hookError));
{
const p = nuxtApp.runWithContext(() => showError(err));
onServerPrefetch(() => p);
return false;
}
});
const islandContext = nuxtApp.ssrContext.islandContext;
return (_ctx, _push, _parent, _attrs) => {
ssrRenderSuspense(_push, {
default: () => {
if (unref(abortRender)) {
_push(`<div></div>`);
} else if (unref(error)) {
_push(ssrRenderComponent(unref(_sfc_main$1), { error: unref(error) }, null, _parent));
} else if (unref(islandContext)) {
_push(ssrRenderComponent(unref(IslandRenderer), { context: unref(islandContext) }, null, _parent));
} else if (unref(SingleRenderer)) {
ssrRenderVNode(_push, createVNode(resolveDynamicComponent(unref(SingleRenderer)), null, null), _parent);
} else {
_push(ssrRenderComponent(unref(AppComponent), null, null, _parent));
}
},
_: 1
});
};
}
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/nuxt/dist/app/components/nuxt-root.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
let entry;
{
entry = async function createNuxtAppServer(ssrContext) {
var _a;
const vueApp = createApp(_sfc_main);
const nuxt = createNuxtApp({ vueApp, ssrContext });
try {
await applyPlugins(nuxt, plugins);
await nuxt.hooks.callHook("app:created", vueApp);
} catch (error) {
await nuxt.hooks.callHook("app:error", error);
(_a = nuxt.payload).error || (_a.error = createError(error));
}
if (ssrContext == null ? void 0 : ssrContext._renderResponse) {
throw new Error("skipping render");
}
return vueApp;
};
}
const entry$1 = (ssrContext) => entry(ssrContext);
const server = /*#__PURE__*/Object.freeze({
__proto__: null,
default: entry$1
});
export { _export_sfc as _, useNuxtApp as a, useRuntimeConfig as b, nuxtLinkDefaults as c, navigateTo as n, resolveRouteObject as r, server as s, tryUseNuxtApp as t, useRouter as u };
//# sourceMappingURL=server.mjs.map