Files
service-finder/frontend_admin/.nuxt/dist/server/server.mjs
2026-06-24 11:29:45 +00:00

1299 lines
42 KiB
JavaScript

import { shallowReactive, reactive, effectScope, getCurrentScope, hasInjectionContext, getCurrentInstance, inject, toRef, shallowRef, isReadonly, isRef, isShallow, isReactive, toRaw, defineComponent, createElementBlock, provide, cloneVNode, h, defineAsyncComponent, computed, unref, Suspense, nextTick, mergeProps, ref, Fragment, withCtx, createVNode, useSSRContext, onErrorCaptured, onServerPrefetch, resolveDynamicComponent, createApp } from "vue";
import { $fetch as $fetch$1 } from "/app/node_modules/ofetch/dist/node.mjs";
import { baseURL } from "#internal/nuxt/paths";
import { createHooks } from "/app/node_modules/hookable/dist/index.mjs";
import { getContext, executeAsync } from "/app/node_modules/unctx/dist/index.mjs";
import { sanitizeStatusCode, createError as createError$1 } from "/app/node_modules/h3/dist/index.mjs";
import { shouldHydrate, setActivePinia, createPinia } from "pinia";
import { defu } from "/app/node_modules/defu/dist/defu.mjs";
import { START_LOCATION, createMemoryHistory, createRouter, useRoute as useRoute$1, RouterView } from "vue-router";
import { hasProtocol, joinURL, parseURL, encodePath, decodePath, withQuery, isScriptProtocol } from "/app/node_modules/ufo/dist/index.mjs";
import "/app/node_modules/klona/dist/index.mjs";
import { ssrRenderComponent, ssrRenderSuspense, ssrRenderVNode } from "vue/server-renderer";
if (!globalThis.$fetch) {
globalThis.$fetch = $fetch$1.create({
baseURL: baseURL()
});
}
if (!("global" in globalThis)) {
globalThis.global = globalThis;
}
const appLayoutTransition = 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) {
let hydratingCount = 0;
const nuxtApp = {
_id: options.id || appId || "nuxt-app",
_scope: effectScope(),
provide: void 0,
globalName: "nuxt",
versions: {
get nuxt() {
return "3.21.8";
},
get vue() {
return nuxtApp.vueApp.version;
}
},
payload: shallowReactive({
...options.ssrContext?.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, plugin2) {
if (plugin2.hooks) {
nuxtApp.hooks.addHooks(plugin2.hooks);
}
}
async function applyPlugin(nuxtApp, plugin2) {
if (typeof plugin2 === "function") {
const { provide: provide2 } = await nuxtApp.runWithContext(() => plugin2(nuxtApp)) || {};
if (provide2 && typeof provide2 === "object") {
for (const key in provide2) {
nuxtApp.provide(key, provide2[key]);
}
}
}
}
async function applyPlugins(nuxtApp, plugins2) {
const resolvedPlugins = /* @__PURE__ */ new Set();
const unresolvedPlugins = [];
const parallels = [];
let error = void 0;
let promiseDepth = 0;
async function executePlugin(plugin2) {
const unresolvedPluginsForThisPlugin = plugin2.dependsOn?.filter((name) => plugins2.some((p) => p._name === name) && !resolvedPlugins.has(name)) ?? [];
if (unresolvedPluginsForThisPlugin.length > 0) {
unresolvedPlugins.push([new Set(unresolvedPluginsForThisPlugin), plugin2]);
} else {
const promise = applyPlugin(nuxtApp, plugin2).then(async () => {
if (plugin2._name) {
resolvedPlugins.add(plugin2._name);
await Promise.all(unresolvedPlugins.map(async ([dependsOn, unexecutedPlugin]) => {
if (dependsOn.has(plugin2._name)) {
dependsOn.delete(plugin2._name);
if (dependsOn.size === 0) {
promiseDepth++;
await executePlugin(unexecutedPlugin);
}
}
}));
}
}).catch((e) => {
if (!plugin2.parallel && !nuxtApp.payload.error) {
throw e;
}
error ||= e;
});
if (plugin2.parallel) {
parallels.push(promise);
} else {
await promise;
}
}
}
for (const plugin2 of plugins2) {
if (nuxtApp.ssrContext?.islandContext && plugin2.env?.islands === false) {
continue;
}
registerPluginHooks(nuxtApp, plugin2);
}
for (const plugin2 of plugins2) {
if (nuxtApp.ssrContext?.islandContext && plugin2.env?.islands === false) {
continue;
}
await executePlugin(plugin2);
}
await Promise.all(parallels);
if (promiseDepth) {
for (let i = 0; i < promiseDepth; i++) {
await Promise.all(parallels);
}
}
if (error) {
throw nuxtApp.payload.error || error;
}
}
// @__NO_SIDE_EFFECTS__
function defineNuxtPlugin(plugin2) {
if (typeof plugin2 === "function") {
return plugin2;
}
const _name = plugin2._name || plugin2.name;
delete plugin2.name;
return Object.assign(plugin2.setup || (() => {
}), plugin2, { [NuxtPluginIndicator]: true, _name });
}
const definePayloadPlugin = defineNuxtPlugin;
function callWithNuxt(nuxt, setup, args) {
const fn = () => setup();
const nuxtAppCtx = getNuxtAppCtx(nuxt._id);
{
return nuxt.vueApp.runWithContext(() => nuxtAppCtx.callAsync(nuxt, fn));
}
}
function tryUseNuxtApp(id) {
let nuxtAppInstance;
if (hasInjectionContext()) {
nuxtAppInstance = getCurrentInstance()?.appContext.app.$nuxt;
}
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 LayoutMetaSymbol = /* @__PURE__ */ Symbol("layout-meta");
const PageRouteSymbol = /* @__PURE__ */ Symbol("route");
import.meta.url.replace(/\/app\/.*$/, "/");
const useRouter = () => {
return useNuxtApp()?.$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 HTML_ATTR_UNSAFE_RE = /[&"'<>]/g;
const HTML_ATTR_ENCODE_MAP = {
"&": "%26",
'"': "%22",
"'": "%27",
"<": "%3C",
">": "%3E"
};
function encodeForHtmlAttr(value) {
return value.replace(HTML_ATTR_UNSAFE_RE, (c) => HTML_ATTR_ENCODE_MAP[c]);
}
const navigateTo = (to, options) => {
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?.external || isExternalHost;
if (isExternal) {
if (!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((/* @__PURE__ */ useRuntimeConfig()).app.baseURL, fullPath);
const redirect = async function(response) {
await nuxtApp.callHook("app:redirected");
const encodedHeader = encodeURL(location2, isExternalHost);
const encodedLoc = encodeForHtmlAttr(encodedHeader);
nuxtApp.ssrContext["~renderResponse"] = {
statusCode: sanitizeStatusCode(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?.replace) {
(void 0).replace(toPath);
} else {
(void 0).href = toPath;
}
if (inMiddleware) {
if (!nuxtApp.isHydrating) {
return false;
}
return new Promise(() => {
});
}
return Promise.resolve();
}
const encodedTo = typeof to === "string" ? encodeRoutePath(to) : to;
return options?.replace ? router.replace(encodedTo) : router.push(encodedTo);
};
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) {
const pathname = url.pathname.replace(/^\/{2,}/, "/");
return pathname + url.search + url.hash;
}
if (location2.startsWith("//")) {
return url.toString().replace(url.protocol, "");
}
return url.toString();
}
function encodeRoutePath(url) {
const parsed = parseURL(url);
return encodePath(decodePath(parsed.pathname)) + parsed.search + parsed.hash;
}
const NUXT_ERROR_SIGNATURE = "__nuxt_error";
const useError = /* @__NO_SIDE_EFFECTS__ */ () => toRef(useNuxtApp().payload, "error");
const showError = (error) => {
const nuxtError = createError(error);
try {
const error2 = /* @__PURE__ */ useError();
if (false) ;
error2.value ||= nuxtError;
} catch {
throw nuxtError;
}
return nuxtError;
};
const isNuxtError = (error) => !!error && typeof error === "object" && NUXT_ERROR_SIGNATURE in error;
const createError = (error) => {
if (typeof error !== "string" && error.statusText) {
error.message ??= error.statusText;
}
const nuxtError = createError$1(error);
Object.defineProperty(nuxtError, NUXT_ERROR_SIGNATURE, {
value: true,
configurable: false,
writable: false
});
Object.defineProperty(nuxtError, "status", {
// eslint-disable-next-line @typescript-eslint/no-deprecated
get: () => nuxtError.statusCode,
configurable: true
});
Object.defineProperty(nuxtError, "statusText", {
// eslint-disable-next-line @typescript-eslint/no-deprecated
get: () => nuxtError.statusMessage,
configurable: true
});
return nuxtError;
};
const matcher = (m, p) => {
return [];
};
const _routeRulesMatcher = (path) => defu({}, ...matcher("", typeof path === "string" ? path.toLowerCase() : path).map((r) => r.data).reverse());
const routeRulesMatcher$1 = _routeRulesMatcher;
function getRouteRules(arg) {
const path = typeof arg === "string" ? arg : arg.path;
try {
return routeRulesMatcher$1(path.toLowerCase());
} catch (e) {
console.error("[nuxt] Error matching route rules.", e);
return {};
}
}
function definePayloadReducer(name, reduce) {
{
useNuxtApp().ssrContext["~payloadReducers"][name] = reduce;
}
}
const payloadPlugin = definePayloadPlugin(() => {
definePayloadReducer(
"skipHydrate",
// We need to return something truthy to be treated as a match
(data) => !shouldHydrate(data) && 1
);
});
function freezeHead(head) {
const realPush = head.push;
head.push = () => ({ dispose: () => {
}, patch: () => {
}, _poll: () => {
} });
return () => {
head.push = realPush;
};
}
const unhead_k2P3m_ZDyjlr2mMYnoDPwavjsDN8hBlk9cFai0bbopU = /* @__PURE__ */ defineNuxtPlugin({
name: "nuxt:head",
enforce: "pre",
setup(nuxtApp) {
const head = nuxtApp.ssrContext.head;
if (nuxtApp.ssrContext.islandContext) {
const unfreeze = freezeHead(head);
nuxtApp.hooks.hookOnce("app:created", unfreeze);
}
nuxtApp.vueApp.use(head);
}
});
function toArray$1(value) {
return Array.isArray(value) ? value : [value];
}
const _routes = [
{
name: "index",
path: "/",
meta: { "middleware": "auth" },
component: () => import("./_nuxt/index-92TOgIUU.js")
},
{
name: "login",
path: "/login",
component: () => import("./_nuxt/login-CLIOTi6c.js")
},
{
name: "permissions",
path: "/permissions",
meta: { "middleware": "auth" },
component: () => import("./_nuxt/index-nGH29Vk2.js")
}
];
const _wrapInTransition = (props, children) => {
return { default: () => children.default?.() };
};
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?.meta.key ?? route.path.replace(ROUTE_KEY_PARENTHESES_RE, "$1").replace(ROUTE_KEY_SYMBOLS_RE, "$1").replace(ROUTE_KEY_NORMAL_RE, (r) => route.params[r.slice(1)]?.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) => comp.components && comp.components.default === from.matched[index]?.components?.default
);
if (areComponentsSame) {
return false;
}
return true;
}
function toArray(value) {
return Array.isArray(value) ? value : [value];
}
function _mergeTransitionProps(routeProps) {
const _props = [];
for (const prop of routeProps) {
if (!prop) {
continue;
}
_props.push({
...prop,
onAfterLeave: prop.onAfterLeave ? toArray(prop.onAfterLeave) : void 0,
onBeforeLeave: prop.onBeforeLeave ? toArray(prop.onBeforeLeave) : void 0
});
}
return defu(..._props);
}
const routerOptions0 = {
scrollBehavior(to, from, savedPosition) {
const nuxtApp = useNuxtApp();
const hashScrollBehaviour = useRouter().options?.scrollBehaviorType ?? "auto";
if (to.path.replace(/\/$/, "") === from.path.replace(/\/$/, "")) {
if (from.hash && !to.hash) {
return { left: 0, top: 0 };
}
if (to.hash) {
return { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior: hashScrollBehaviour };
}
return false;
}
const routeAllowsScrollToTop = typeof to.meta.scrollToTop === "function" ? to.meta.scrollToTop(to, from) : to.meta.scrollToTop;
if (routeAllowsScrollToTop === false) {
return false;
}
if (from === START_LOCATION) {
return _calculatePosition(to, from, savedPosition, hashScrollBehaviour);
}
return new Promise((resolve) => {
const doScroll = () => {
requestAnimationFrame(() => resolve(_calculatePosition(to, from, savedPosition, hashScrollBehaviour)));
};
nuxtApp.hooks.hookOnce("page:loading:end", () => {
const transitionPromise = nuxtApp["~transitionPromise"];
if (transitionPromise) {
transitionPromise.then(doScroll);
} else {
doScroll();
}
});
});
}
};
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, from, savedPosition, defaultHashScrollBehaviour) {
if (savedPosition) {
return savedPosition;
}
if (to.hash) {
return {
el: to.hash,
top: _getHashElementScrollMarginTop(to.hash),
behavior: isChangingPage(to, from) ? defaultHashScrollBehaviour : "instant"
};
}
return {
left: 0,
top: 0
};
}
const configRouterOptions = {
hashMode: false,
scrollBehaviorType: "auto"
};
const routerOptions = {
...configRouterOptions,
...routerOptions0
};
const validate = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to, from) => {
let __temp, __restore;
if (!to.meta?.validate) {
return;
}
const result = ([__temp, __restore] = executeAsync(() => Promise.resolve(to.meta.validate(to))), __temp = await __temp, __restore(), __temp);
if (result === true) {
return;
}
const error = createError({
fatal: false,
// eslint-disable-next-line @typescript-eslint/no-deprecated
status: result && (result.status || result.statusCode) || 404,
// eslint-disable-next-line @typescript-eslint/no-deprecated
statusText: result && (result.statusText || result.statusMessage) || `Page Not Found: ${to.fullPath}`,
data: {
path: to.fullPath
}
});
return error;
});
const manifest_45route_45rule = /* @__PURE__ */ defineNuxtRouteMiddleware((to) => {
{
return;
}
});
const globalMiddleware = [
validate,
manifest_45route_45rule
];
const namedMiddleware = {
auth: () => import("./_nuxt/auth-D_CY0lMs.js")
};
Object.assign(/* @__PURE__ */ Object.create(null), {});
const pageIslandRoutes = Object.assign(/* @__PURE__ */ Object.create(null), {});
const plugin$1 = /* @__PURE__ */ defineNuxtPlugin({
name: "nuxt:router",
enforce: "pre",
async setup(nuxtApp) {
let __temp, __restore;
let routerBase = (/* @__PURE__ */ useRuntimeConfig()).app.baseURL;
const history = routerOptions.history?.(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({
...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
});
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;
};
router.afterEach((to, from) => {
const lastTo = to.matched.at(-1)?.components?.default;
const lastFrom = from.matched.at(-1)?.components?.default;
if (lastTo === lastFrom) {
syncCurrentRoute();
return;
}
if (to.matched.length < from.matched.length && to.matched.every((m, i) => m.components?.default === from.matched[i]?.components?.default)) {
syncCurrentRoute();
}
});
const route = { sync: syncCurrentRoute };
for (const key in _route.value) {
Object.defineProperty(route, key, {
get: () => _route.value[key],
enumerable: true
});
}
nuxtApp._route = shallowReactive(route);
nuxtApp._middleware ||= {
global: [],
named: {}
};
const error = /* @__PURE__ */ useError();
const isServerPage = nuxtApp.ssrContext?.islandContext?.name?.startsWith("page_");
if (!nuxtApp.ssrContext?.islandContext || isServerPage) {
router.afterEach(async (to, _from, failure) => {
delete nuxtApp._processingMiddleware;
if (failure) {
await nuxtApp.callHook("page:loading:end");
}
if (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;
const hasDeferredRoute = false;
syncCurrentRoute();
if (nuxtApp.ssrContext?.islandContext && !isServerPage) {
return { provide: { router } };
}
const initialLayout = nuxtApp.payload.state._layout;
router.beforeEach(async (to, from) => {
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 (!nuxtApp.ssrContext?.islandContext || isServerPage) {
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 entry2 of toArray$1(componentMiddleware)) {
middlewareEntries.add(entry2);
}
}
const routeRules = 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 entry2 of middlewareEntries) {
const middleware = typeof entry2 === "string" ? nuxtApp._middleware.named[entry2] || await namedMiddleware[entry2]?.().then((r) => r.default || r) : entry2;
if (!middleware) {
throw new Error(`Unknown route middleware: '${entry2}'.`);
}
try {
if (false) ;
const result = await nuxtApp.runWithContext(() => middleware(to, from));
if (true) {
if (result === false || result instanceof Error) {
const error2 = result || createError({
status: 404,
statusText: `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(err);
if (error2.fatal) {
await nuxtApp.runWithContext(() => showError(error2));
}
return error2;
}
}
}
});
if (isServerPage) {
router.beforeResolve((to) => {
const expected = pageIslandRoutes[nuxtApp.ssrContext.islandContext.name];
const actual = to.matched.find((m) => m.components?.default?.__nuxt_island)?.components?.default;
if (!expected || expected !== actual?.__nuxt_island) {
nuxtApp.ssrContext["~renderResponse"] = {
statusCode: 400,
statusMessage: "Invalid island request path"
};
return false;
}
});
}
router.onError(async () => {
delete nuxtApp._processingMiddleware;
await nuxtApp.callHook("page:loading:end");
});
router.afterEach((to) => {
if (to.matched.length === 0 && !error.value) {
return nuxtApp.runWithContext(() => showError(createError({
status: 404,
fatal: false,
statusText: `Page not found: ${to.fullPath}`,
data: {
path: to.fullPath
}
})));
}
});
nuxtApp.hooks.hookOnce("app:created", async () => {
try {
if ("name" in resolvedInitialRoute) {
resolvedInitialRoute.name = void 0;
}
if (hasDeferredRoute) ;
else {
await router.replace({
...resolvedInitialRoute,
force: true
});
}
router.options.scrollBehavior = routerOptions.scrollBehavior;
} catch (error2) {
await nuxtApp.runWithContext(() => showError(error2));
}
});
return { provide: { router } };
}
});
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 = /* @__PURE__ */ defineNuxtPlugin({
name: "nuxt:revive-payload:server",
setup() {
for (const [reducer, fn] of reducers) {
definePayloadReducer(reducer, fn);
}
}
});
defineComponent({
name: "ServerPlaceholder",
render() {
return createElementBlock("div");
}
});
const clientOnlySymbol = /* @__PURE__ */ Symbol.for("nuxt:client-only");
defineComponent({
name: "ClientOnly",
inheritAttrs: false,
props: ["fallback", "placeholder", "placeholderTag", "fallbackTag"],
...false,
setup(props, { slots, attrs }) {
const mounted = shallowRef(false);
const vm = getCurrentInstance();
if (vm) {
vm._nuxtClientOnly = true;
}
provide(clientOnlySymbol, true);
return () => {
if (mounted.value) {
const vnodes = slots.default?.();
if (vnodes && vnodes.length === 1) {
return [cloneVNode(vnodes[0], attrs)];
}
return vnodes;
}
const slot = slots.fallback || slots.placeholder;
if (slot) {
return h(slot);
}
const fallbackStr = props.fallback || props.placeholder || "";
const fallbackTag = props.fallbackTag || props.placeholderTag || "span";
return createElementBlock(fallbackTag, attrs, fallbackStr);
};
}
});
const plugin = /* @__PURE__ */ defineNuxtPlugin({
name: "pinia",
setup(nuxtApp) {
const pinia = createPinia();
nuxtApp.vueApp.use(pinia);
setActivePinia(pinia);
if (nuxtApp.payload && nuxtApp.payload.pinia) {
pinia.state.value = nuxtApp.payload.pinia;
}
return {
provide: {
pinia
}
};
},
hooks: {
"app:rendered"() {
const nuxtApp = useNuxtApp();
nuxtApp.payload.pinia = toRaw(nuxtApp.$pinia).state.value;
setActivePinia(void 0);
}
}
});
const components_plugin_z4hgvsiddfKkfXTP6M8M4zG5Cb7sGnDhcryKVM45Di4 = /* @__PURE__ */ defineNuxtPlugin({
name: "nuxt:global-components"
});
const plugins = [
payloadPlugin,
unhead_k2P3m_ZDyjlr2mMYnoDPwavjsDN8hBlk9cFai0bbopU,
plugin$1,
revive_payload_server_MVtmlZaQpj6ApFmshWfUWl5PehCebzaBf2NuRMiIbms,
plugin,
components_plugin_z4hgvsiddfKkfXTP6M8M4zG5Cb7sGnDhcryKVM45Di4
];
const layouts = {
default: defineAsyncComponent(() => import("./_nuxt/default-DbJQlxCD.js").then((m) => m.default || m))
};
const routeRulesMatcher = _routeRulesMatcher;
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 shouldUseEagerRoute = !injectedRoute || injectedRoute === useRoute();
const route = shouldUseEagerRoute ? useRoute$1() : injectedRoute;
const layout = computed(() => {
let layout2 = unref(props.name) ?? route?.meta.layout ?? routeRulesMatcher(route?.path).appLayout ?? "default";
if (layout2 && !(layout2 in layouts)) {
if (props.fallback) {
layout2 = unref(props.fallback);
}
}
return layout2;
});
const layoutRef = shallowRef();
context.expose({ layoutRef });
const done = nuxtApp.deferHydration();
let lastLayout;
return () => {
const hasLayout = !!layout.value && layout.value in layouts;
const hasTransition = hasLayout && !!(route?.meta.layoutTransition ?? appLayoutTransition);
const transitionProps = hasTransition && _mergeTransitionProps([
route?.meta.layoutTransition,
appLayoutTransition,
{
onBeforeLeave() {
nuxtApp["~transitionPromise"] = new Promise((resolve) => {
nuxtApp["~transitionFinish"] = resolve;
});
},
onAfterLeave() {
nuxtApp["~transitionFinish"]?.();
delete nuxtApp["~transitionFinish"];
delete nuxtApp["~transitionPromise"];
}
}
]);
const previouslyRenderedLayout = lastLayout;
lastLayout = layout.value;
return _wrapInTransition(transitionProps, {
default: () => h(
Suspense,
{
suspensible: true,
onResolve: async () => {
await nextTick(done);
}
},
{
default: () => h(
LayoutProvider,
{
layoutProps: mergeProps(context.attrs, route.meta.layoutProps ?? {}, { ref: layoutRef }),
key: layout.value || void 0,
name: layout.value,
shouldProvide: !props.name,
isRenderingNewLayout: (name) => {
return name !== previouslyRenderedLayout && name === layout.value;
},
hasTransition
},
context.slots
)
}
)
}).default();
};
}
});
const LayoutProvider = defineComponent({
name: "NuxtLayoutProvider",
inheritAttrs: false,
props: {
name: {
type: [String, Boolean]
},
layoutProps: {
type: Object
},
hasTransition: {
type: Boolean
},
shouldProvide: {
type: Boolean
},
isRenderingNewLayout: {
type: Function,
required: true
}
},
setup(props, context) {
const name = props.name;
if (props.shouldProvide) {
provide(LayoutMetaSymbol, {
// When name=false, always return true so NuxtPage doesn't skip rendering
isCurrent: (route) => name === false || name === (route.meta.layout ?? routeRulesMatcher(route.path).appLayout ?? "default")
});
}
const injectedRoute = inject(PageRouteSymbol);
const isNotWithinNuxtPage = injectedRoute && injectedRoute === useRoute();
if (isNotWithinNuxtPage) {
const vueRouterRoute = useRoute$1();
const reactiveChildRoute = {};
for (const _key in vueRouterRoute) {
const key = _key;
Object.defineProperty(reactiveChildRoute, key, {
enumerable: true,
get: () => {
return props.isRenderingNewLayout(props.name) ? vueRouterRoute[key] : injectedRoute[key];
}
});
}
provide(PageRouteSymbol, shallowReactive(reactiveChildRoute));
}
return () => {
if (!name || typeof name === "string" && !(name in layouts)) {
return context.slots.default?.();
}
return h(
LayoutLoader,
{ key: name, layoutProps: props.layoutProps, name },
context.slots
);
};
}
});
const defineRouteProvider = (name = "RouteProvider") => defineComponent({
name,
props: {
route: {
type: Object,
required: true
},
vnode: Object,
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 () => {
if (!props.vnode) {
return props.vnode;
}
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;
const status = Number(_error.statusCode || 500);
const is404 = status === 404;
const statusText = _error.statusMessage ?? (is404 ? "Page Not Found" : "Internal Server Error");
const description = _error.message || _error.toString();
const stack = void 0;
const _Error404 = defineAsyncComponent(() => import("./_nuxt/error-404-BDmq62MM.js"));
const _Error = defineAsyncComponent(() => import("./_nuxt/error-500-gzzPk_-U.js"));
const ErrorTemplate = is404 ? _Error404 : _Error;
return (_ctx, _push, _parent, _attrs) => {
_push(ssrRenderComponent(unref(ErrorTemplate), mergeProps({ status: unref(status), statusText: unref(statusText), statusCode: unref(status), statusMessage: unref(statusText), 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 = /* @__PURE__ */ useError();
const abortRender = error.value && !nuxtApp.ssrContext.error;
function invokeAppErrorHandler(err, target, info) {
const errorHandler = nuxtApp.vueApp.config.errorHandler;
if (errorHandler && !errorHandler.__nuxt_default) {
try {
errorHandler(err, target, info);
} catch (handlerError) {
console.error("[nuxt] Error in `app.config.errorHandler`", handlerError);
}
}
}
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);
invokeAppErrorHandler(err, target, info);
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) {
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);
nuxt.payload.error ||= createError(error);
}
if (ssrContext && (ssrContext["~renderResponse"] || ssrContext._renderResponse)) {
throw new Error("skipping render");
}
return vueApp;
};
}
const entry_default = ((ssrContext) => entry(ssrContext));
export {
_export_sfc as _,
useNuxtApp as a,
useRuntimeConfig as b,
nuxtLinkDefaults as c,
defineNuxtRouteMiddleware as d,
entry_default as default,
encodeRoutePath as e,
navigateTo as n,
resolveRouteObject as r,
tryUseNuxtApp as t,
useRouter as u
};
//# sourceMappingURL=server.mjs.map