server.mjs 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253
  1. import { version, unref, inject, defineComponent, provide, shallowReactive, h, ref, watch, Suspense, nextTick, Fragment, Transition, hasInjectionContext, getCurrentInstance, useSSRContext, createApp, effectScope, reactive, getCurrentScope, onErrorCaptured, onServerPrefetch, createVNode, resolveDynamicComponent, toRef, defineAsyncComponent, mergeProps, shallowRef, isReadonly, isRef, isShallow, isReactive, toRaw } from 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/vue/index.mjs';
  2. import { $fetch } from 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/ofetch/dist/node.mjs';
  3. import { b as baseURL } from '../_/renderer.mjs';
  4. import { createHooks } from 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/hookable/dist/index.mjs';
  5. import { getContext } from 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/unctx/dist/index.mjs';
  6. import { sanitizeStatusCode, createError as createError$1, appendHeader } from 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/h3/dist/index.mjs';
  7. import { getActiveHead, CapoPlugin } from 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/unhead/dist/index.mjs';
  8. import { defineHeadPlugin } from 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/@unhead/shared/dist/index.mjs';
  9. import { RouterView, createMemoryHistory, createRouter, START_LOCATION } from 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/vue-router/dist/vue-router.node.mjs';
  10. import { toRouteMatcher, createRouter as createRouter$1 } from 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/radix3/dist/index.mjs';
  11. import { defu } from 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/defu/dist/defu.mjs';
  12. import { hasProtocol, isScriptProtocol, joinURL, withQuery } from 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/ufo/dist/index.mjs';
  13. import { ssrRenderSuspense, ssrRenderComponent, ssrRenderVNode, ssrRenderAttrs } from 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/vue/server-renderer/index.mjs';
  14. import 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/vue-bundle-renderer/dist/runtime.mjs';
  15. import 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/devalue/index.js';
  16. import 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/@unhead/ssr/dist/index.mjs';
  17. import '../routes/index.mjs';
  18. import 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/destr/dist/index.mjs';
  19. import 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/unenv/runtime/fetch/index.mjs';
  20. import 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/klona/dist/index.mjs';
  21. import 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/scule/dist/index.mjs';
  22. import 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/ohash/dist/index.mjs';
  23. import 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/unstorage/dist/index.mjs';
  24. import 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/unstorage/drivers/fs.mjs';
  25. import 'file:///D:/zwj/nuxt/sannongzixunwang_web/node_modules/nuxt/dist/core/runtime/nitro/cache-driver.js';
  26. import 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/unstorage/drivers/fs-lite.mjs';
  27. import 'node:fs';
  28. import 'node:url';
  29. import 'file://D:/zwj/nuxt/sannongzixunwang_web/node_modules/pathe/dist/index.mjs';
  30. if (!globalThis.$fetch) {
  31. globalThis.$fetch = $fetch.create({
  32. baseURL: baseURL()
  33. });
  34. }
  35. const appPageTransition = false;
  36. const appKeepalive = false;
  37. const nuxtLinkDefaults = { "componentName": "NuxtLink", "prefetch": true, "prefetchOn": { "visibility": true } };
  38. const appId = "nuxt-app";
  39. function getNuxtAppCtx(id = appId) {
  40. return getContext(id, {
  41. asyncContext: false
  42. });
  43. }
  44. const NuxtPluginIndicator = "__nuxt_plugin";
  45. function createNuxtApp(options) {
  46. var _a;
  47. let hydratingCount = 0;
  48. const nuxtApp = {
  49. _id: options.id || appId || "nuxt-app",
  50. _scope: effectScope(),
  51. provide: void 0,
  52. globalName: "nuxt",
  53. versions: {
  54. get nuxt() {
  55. return "3.13.2";
  56. },
  57. get vue() {
  58. return nuxtApp.vueApp.version;
  59. }
  60. },
  61. payload: shallowReactive({
  62. ...((_a = options.ssrContext) == null ? void 0 : _a.payload) || {},
  63. data: shallowReactive({}),
  64. state: reactive({}),
  65. once: /* @__PURE__ */ new Set(),
  66. _errors: shallowReactive({})
  67. }),
  68. static: {
  69. data: {}
  70. },
  71. runWithContext(fn) {
  72. if (nuxtApp._scope.active && !getCurrentScope()) {
  73. return nuxtApp._scope.run(() => callWithNuxt(nuxtApp, fn));
  74. }
  75. return callWithNuxt(nuxtApp, fn);
  76. },
  77. isHydrating: false,
  78. deferHydration() {
  79. if (!nuxtApp.isHydrating) {
  80. return () => {
  81. };
  82. }
  83. hydratingCount++;
  84. let called = false;
  85. return () => {
  86. if (called) {
  87. return;
  88. }
  89. called = true;
  90. hydratingCount--;
  91. if (hydratingCount === 0) {
  92. nuxtApp.isHydrating = false;
  93. return nuxtApp.callHook("app:suspense:resolve");
  94. }
  95. };
  96. },
  97. _asyncDataPromises: {},
  98. _asyncData: shallowReactive({}),
  99. _payloadRevivers: {},
  100. ...options
  101. };
  102. {
  103. nuxtApp.payload.serverRendered = true;
  104. }
  105. if (nuxtApp.ssrContext) {
  106. nuxtApp.payload.path = nuxtApp.ssrContext.url;
  107. nuxtApp.ssrContext.nuxt = nuxtApp;
  108. nuxtApp.ssrContext.payload = nuxtApp.payload;
  109. nuxtApp.ssrContext.config = {
  110. public: nuxtApp.ssrContext.runtimeConfig.public,
  111. app: nuxtApp.ssrContext.runtimeConfig.app
  112. };
  113. }
  114. nuxtApp.hooks = createHooks();
  115. nuxtApp.hook = nuxtApp.hooks.hook;
  116. {
  117. const contextCaller = async function(hooks, args) {
  118. for (const hook of hooks) {
  119. await nuxtApp.runWithContext(() => hook(...args));
  120. }
  121. };
  122. nuxtApp.hooks.callHook = (name, ...args) => nuxtApp.hooks.callHookWith(contextCaller, name, ...args);
  123. }
  124. nuxtApp.callHook = nuxtApp.hooks.callHook;
  125. nuxtApp.provide = (name, value) => {
  126. const $name = "$" + name;
  127. defineGetter(nuxtApp, $name, value);
  128. defineGetter(nuxtApp.vueApp.config.globalProperties, $name, value);
  129. };
  130. defineGetter(nuxtApp.vueApp, "$nuxt", nuxtApp);
  131. defineGetter(nuxtApp.vueApp.config.globalProperties, "$nuxt", nuxtApp);
  132. const runtimeConfig = options.ssrContext.runtimeConfig;
  133. nuxtApp.provide("config", runtimeConfig);
  134. return nuxtApp;
  135. }
  136. function registerPluginHooks(nuxtApp, plugin2) {
  137. if (plugin2.hooks) {
  138. nuxtApp.hooks.addHooks(plugin2.hooks);
  139. }
  140. }
  141. async function applyPlugin(nuxtApp, plugin2) {
  142. if (typeof plugin2 === "function") {
  143. const { provide: provide2 } = await nuxtApp.runWithContext(() => plugin2(nuxtApp)) || {};
  144. if (provide2 && typeof provide2 === "object") {
  145. for (const key in provide2) {
  146. nuxtApp.provide(key, provide2[key]);
  147. }
  148. }
  149. }
  150. }
  151. async function applyPlugins(nuxtApp, plugins2) {
  152. var _a, _b, _c, _d;
  153. const resolvedPlugins = [];
  154. const unresolvedPlugins = [];
  155. const parallels = [];
  156. const errors = [];
  157. let promiseDepth = 0;
  158. async function executePlugin(plugin2) {
  159. var _a2;
  160. const unresolvedPluginsForThisPlugin = ((_a2 = plugin2.dependsOn) == null ? void 0 : _a2.filter((name) => plugins2.some((p) => p._name === name) && !resolvedPlugins.includes(name))) ?? [];
  161. if (unresolvedPluginsForThisPlugin.length > 0) {
  162. unresolvedPlugins.push([new Set(unresolvedPluginsForThisPlugin), plugin2]);
  163. } else {
  164. const promise = applyPlugin(nuxtApp, plugin2).then(async () => {
  165. if (plugin2._name) {
  166. resolvedPlugins.push(plugin2._name);
  167. await Promise.all(unresolvedPlugins.map(async ([dependsOn, unexecutedPlugin]) => {
  168. if (dependsOn.has(plugin2._name)) {
  169. dependsOn.delete(plugin2._name);
  170. if (dependsOn.size === 0) {
  171. promiseDepth++;
  172. await executePlugin(unexecutedPlugin);
  173. }
  174. }
  175. }));
  176. }
  177. });
  178. if (plugin2.parallel) {
  179. parallels.push(promise.catch((e) => errors.push(e)));
  180. } else {
  181. await promise;
  182. }
  183. }
  184. }
  185. for (const plugin2 of plugins2) {
  186. if (((_a = nuxtApp.ssrContext) == null ? void 0 : _a.islandContext) && ((_b = plugin2.env) == null ? void 0 : _b.islands) === false) {
  187. continue;
  188. }
  189. registerPluginHooks(nuxtApp, plugin2);
  190. }
  191. for (const plugin2 of plugins2) {
  192. if (((_c = nuxtApp.ssrContext) == null ? void 0 : _c.islandContext) && ((_d = plugin2.env) == null ? void 0 : _d.islands) === false) {
  193. continue;
  194. }
  195. await executePlugin(plugin2);
  196. }
  197. await Promise.all(parallels);
  198. if (promiseDepth) {
  199. for (let i = 0; i < promiseDepth; i++) {
  200. await Promise.all(parallels);
  201. }
  202. }
  203. if (errors.length) {
  204. throw errors[0];
  205. }
  206. }
  207. // @__NO_SIDE_EFFECTS__
  208. function defineNuxtPlugin(plugin2) {
  209. if (typeof plugin2 === "function") {
  210. return plugin2;
  211. }
  212. const _name = plugin2._name || plugin2.name;
  213. delete plugin2.name;
  214. return Object.assign(plugin2.setup || (() => {
  215. }), plugin2, { [NuxtPluginIndicator]: true, _name });
  216. }
  217. function callWithNuxt(nuxt, setup, args) {
  218. const fn = () => setup();
  219. const nuxtAppCtx = getNuxtAppCtx(nuxt._id);
  220. {
  221. return nuxt.vueApp.runWithContext(() => nuxtAppCtx.callAsync(nuxt, fn));
  222. }
  223. }
  224. function tryUseNuxtApp(id) {
  225. var _a;
  226. let nuxtAppInstance;
  227. if (hasInjectionContext()) {
  228. nuxtAppInstance = (_a = getCurrentInstance()) == null ? void 0 : _a.appContext.app.$nuxt;
  229. }
  230. nuxtAppInstance = nuxtAppInstance || getNuxtAppCtx(id).tryUse();
  231. return nuxtAppInstance || null;
  232. }
  233. function useNuxtApp(id) {
  234. const nuxtAppInstance = tryUseNuxtApp(id);
  235. if (!nuxtAppInstance) {
  236. {
  237. throw new Error("[nuxt] instance unavailable");
  238. }
  239. }
  240. return nuxtAppInstance;
  241. }
  242. // @__NO_SIDE_EFFECTS__
  243. function useRuntimeConfig(_event) {
  244. return useNuxtApp().$config;
  245. }
  246. function defineGetter(obj, key, val) {
  247. Object.defineProperty(obj, key, { get: () => val });
  248. }
  249. const LayoutMetaSymbol = Symbol("layout-meta");
  250. const PageRouteSymbol = Symbol("route");
  251. const useRouter = () => {
  252. var _a;
  253. return (_a = useNuxtApp()) == null ? void 0 : _a.$router;
  254. };
  255. const useRoute = () => {
  256. if (hasInjectionContext()) {
  257. return inject(PageRouteSymbol, useNuxtApp()._route);
  258. }
  259. return useNuxtApp()._route;
  260. };
  261. // @__NO_SIDE_EFFECTS__
  262. function defineNuxtRouteMiddleware(middleware) {
  263. return middleware;
  264. }
  265. const isProcessingMiddleware = () => {
  266. try {
  267. if (useNuxtApp()._processingMiddleware) {
  268. return true;
  269. }
  270. } catch {
  271. return false;
  272. }
  273. return false;
  274. };
  275. const navigateTo = (to, options) => {
  276. if (!to) {
  277. to = "/";
  278. }
  279. const toPath = typeof to === "string" ? to : "path" in to ? resolveRouteObject(to) : useRouter().resolve(to).href;
  280. const isExternalHost = hasProtocol(toPath, { acceptRelative: true });
  281. const isExternal = (options == null ? void 0 : options.external) || isExternalHost;
  282. if (isExternal) {
  283. if (!(options == null ? void 0 : options.external)) {
  284. throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");
  285. }
  286. const { protocol } = new URL(toPath, "http://localhost");
  287. if (protocol && isScriptProtocol(protocol)) {
  288. throw new Error(`Cannot navigate to a URL with '${protocol}' protocol.`);
  289. }
  290. }
  291. const inMiddleware = isProcessingMiddleware();
  292. const router = useRouter();
  293. const nuxtApp = useNuxtApp();
  294. {
  295. if (nuxtApp.ssrContext) {
  296. const fullPath = typeof to === "string" || isExternal ? toPath : router.resolve(to).fullPath || "/";
  297. const location2 = isExternal ? toPath : joinURL((/* @__PURE__ */ useRuntimeConfig()).app.baseURL, fullPath);
  298. const redirect = async function(response) {
  299. await nuxtApp.callHook("app:redirected");
  300. const encodedLoc = location2.replace(/"/g, "%22");
  301. const encodedHeader = encodeURL(location2, isExternalHost);
  302. nuxtApp.ssrContext._renderResponse = {
  303. statusCode: sanitizeStatusCode((options == null ? void 0 : options.redirectCode) || 302, 302),
  304. body: `<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${encodedLoc}"></head></html>`,
  305. headers: { location: encodedHeader }
  306. };
  307. return response;
  308. };
  309. if (!isExternal && inMiddleware) {
  310. router.afterEach((final) => final.fullPath === fullPath ? redirect(false) : void 0);
  311. return to;
  312. }
  313. return redirect(!inMiddleware ? void 0 : (
  314. /* abort route navigation */
  315. false
  316. ));
  317. }
  318. }
  319. if (isExternal) {
  320. nuxtApp._scope.stop();
  321. if (options == null ? void 0 : options.replace) {
  322. (void 0).replace(toPath);
  323. } else {
  324. (void 0).href = toPath;
  325. }
  326. if (inMiddleware) {
  327. if (!nuxtApp.isHydrating) {
  328. return false;
  329. }
  330. return new Promise(() => {
  331. });
  332. }
  333. return Promise.resolve();
  334. }
  335. return (options == null ? void 0 : options.replace) ? router.replace(to) : router.push(to);
  336. };
  337. function resolveRouteObject(to) {
  338. return withQuery(to.path || "", to.query || {}) + (to.hash || "");
  339. }
  340. function encodeURL(location2, isExternalHost = false) {
  341. const url = new URL(location2, "http://localhost");
  342. if (!isExternalHost) {
  343. return url.pathname + url.search + url.hash;
  344. }
  345. if (location2.startsWith("//")) {
  346. return url.toString().replace(url.protocol, "");
  347. }
  348. return url.toString();
  349. }
  350. const NUXT_ERROR_SIGNATURE = "__nuxt_error";
  351. const useError = () => toRef(useNuxtApp().payload, "error");
  352. const showError = (error) => {
  353. const nuxtError = createError(error);
  354. try {
  355. const nuxtApp = useNuxtApp();
  356. const error2 = useError();
  357. if (false) ;
  358. error2.value = error2.value || nuxtError;
  359. } catch {
  360. throw nuxtError;
  361. }
  362. return nuxtError;
  363. };
  364. const isNuxtError = (error) => !!error && typeof error === "object" && NUXT_ERROR_SIGNATURE in error;
  365. const createError = (error) => {
  366. const nuxtError = createError$1(error);
  367. Object.defineProperty(nuxtError, NUXT_ERROR_SIGNATURE, {
  368. value: true,
  369. configurable: false,
  370. writable: false
  371. });
  372. return nuxtError;
  373. };
  374. version[0] === "3";
  375. function resolveUnref(r) {
  376. return typeof r === "function" ? r() : unref(r);
  377. }
  378. function resolveUnrefHeadInput(ref2) {
  379. if (ref2 instanceof Promise || ref2 instanceof Date || ref2 instanceof RegExp)
  380. return ref2;
  381. const root = resolveUnref(ref2);
  382. if (!ref2 || !root)
  383. return root;
  384. if (Array.isArray(root))
  385. return root.map((r) => resolveUnrefHeadInput(r));
  386. if (typeof root === "object") {
  387. const resolved = {};
  388. for (const k in root) {
  389. if (!Object.prototype.hasOwnProperty.call(root, k)) {
  390. continue;
  391. }
  392. if (k === "titleTemplate" || k[0] === "o" && k[1] === "n") {
  393. resolved[k] = unref(root[k]);
  394. continue;
  395. }
  396. resolved[k] = resolveUnrefHeadInput(root[k]);
  397. }
  398. return resolved;
  399. }
  400. return root;
  401. }
  402. defineHeadPlugin({
  403. hooks: {
  404. "entries:resolve": (ctx) => {
  405. for (const entry2 of ctx.entries)
  406. entry2.resolvedInput = resolveUnrefHeadInput(entry2.input);
  407. }
  408. }
  409. });
  410. const headSymbol = "usehead";
  411. const _global = typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  412. const globalKey$1 = "__unhead_injection_handler__";
  413. function setHeadInjectionHandler(handler) {
  414. _global[globalKey$1] = handler;
  415. }
  416. function injectHead() {
  417. if (globalKey$1 in _global) {
  418. return _global[globalKey$1]();
  419. }
  420. const head = inject(headSymbol);
  421. if (!head && "prerender" !== "production")
  422. console.warn("Unhead is missing Vue context, falling back to shared context. This may have unexpected results.");
  423. return head || getActiveHead();
  424. }
  425. [CapoPlugin({ track: true })];
  426. const unhead_KgADcZ0jPj = /* @__PURE__ */ defineNuxtPlugin({
  427. name: "nuxt:head",
  428. enforce: "pre",
  429. setup(nuxtApp) {
  430. const head = nuxtApp.ssrContext.head;
  431. setHeadInjectionHandler(
  432. // need a fresh instance of the nuxt app to avoid parallel requests interfering with each other
  433. () => useNuxtApp().vueApp._context.provides.usehead
  434. );
  435. nuxtApp.vueApp.use(head);
  436. }
  437. });
  438. function createContext(opts = {}) {
  439. let currentInstance;
  440. let isSingleton = false;
  441. const checkConflict = (instance) => {
  442. if (currentInstance && currentInstance !== instance) {
  443. throw new Error("Context conflict");
  444. }
  445. };
  446. let als;
  447. if (opts.asyncContext) {
  448. const _AsyncLocalStorage = opts.AsyncLocalStorage || globalThis.AsyncLocalStorage;
  449. if (_AsyncLocalStorage) {
  450. als = new _AsyncLocalStorage();
  451. } else {
  452. console.warn("[unctx] `AsyncLocalStorage` is not provided.");
  453. }
  454. }
  455. const _getCurrentInstance = () => {
  456. if (als && currentInstance === void 0) {
  457. const instance = als.getStore();
  458. if (instance !== void 0) {
  459. return instance;
  460. }
  461. }
  462. return currentInstance;
  463. };
  464. return {
  465. use: () => {
  466. const _instance = _getCurrentInstance();
  467. if (_instance === void 0) {
  468. throw new Error("Context is not available");
  469. }
  470. return _instance;
  471. },
  472. tryUse: () => {
  473. return _getCurrentInstance();
  474. },
  475. set: (instance, replace) => {
  476. if (!replace) {
  477. checkConflict(instance);
  478. }
  479. currentInstance = instance;
  480. isSingleton = true;
  481. },
  482. unset: () => {
  483. currentInstance = void 0;
  484. isSingleton = false;
  485. },
  486. call: (instance, callback) => {
  487. checkConflict(instance);
  488. currentInstance = instance;
  489. try {
  490. return als ? als.run(instance, callback) : callback();
  491. } finally {
  492. if (!isSingleton) {
  493. currentInstance = void 0;
  494. }
  495. }
  496. },
  497. async callAsync(instance, callback) {
  498. currentInstance = instance;
  499. const onRestore = () => {
  500. currentInstance = instance;
  501. };
  502. const onLeave = () => currentInstance === instance ? onRestore : void 0;
  503. asyncHandlers.add(onLeave);
  504. try {
  505. const r = als ? als.run(instance, callback) : callback();
  506. if (!isSingleton) {
  507. currentInstance = void 0;
  508. }
  509. return await r;
  510. } finally {
  511. asyncHandlers.delete(onLeave);
  512. }
  513. }
  514. };
  515. }
  516. function createNamespace(defaultOpts = {}) {
  517. const contexts = {};
  518. return {
  519. get(key, opts = {}) {
  520. if (!contexts[key]) {
  521. contexts[key] = createContext({ ...defaultOpts, ...opts });
  522. }
  523. contexts[key];
  524. return contexts[key];
  525. }
  526. };
  527. }
  528. const _globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : {};
  529. const globalKey = "__unctx__";
  530. _globalThis[globalKey] || (_globalThis[globalKey] = createNamespace());
  531. const asyncHandlersKey = "__unctx_async_handlers__";
  532. const asyncHandlers = _globalThis[asyncHandlersKey] || (_globalThis[asyncHandlersKey] = /* @__PURE__ */ new Set());
  533. function executeAsync(function_) {
  534. const restores = [];
  535. for (const leaveHandler of asyncHandlers) {
  536. const restore2 = leaveHandler();
  537. if (restore2) {
  538. restores.push(restore2);
  539. }
  540. }
  541. const restore = () => {
  542. for (const restore2 of restores) {
  543. restore2();
  544. }
  545. };
  546. let awaitable = function_();
  547. if (awaitable && typeof awaitable === "object" && "catch" in awaitable) {
  548. awaitable = awaitable.catch((error) => {
  549. restore();
  550. throw error;
  551. });
  552. }
  553. return [awaitable, restore];
  554. }
  555. const interpolatePath = (route, match) => {
  556. return match.path.replace(/(:\w+)\([^)]+\)/g, "$1").replace(/(:\w+)[?+*]/g, "$1").replace(/:\w+/g, (r) => {
  557. var _a;
  558. return ((_a = route.params[r.slice(1)]) == null ? void 0 : _a.toString()) || "";
  559. });
  560. };
  561. const generateRouteKey$1 = (routeProps, override) => {
  562. const matchedRoute = routeProps.route.matched.find((m) => {
  563. var _a;
  564. return ((_a = m.components) == null ? void 0 : _a.default) === routeProps.Component.type;
  565. });
  566. const source = override ?? (matchedRoute == null ? void 0 : matchedRoute.meta.key) ?? (matchedRoute && interpolatePath(routeProps.route, matchedRoute));
  567. return typeof source === "function" ? source(routeProps.route) : source;
  568. };
  569. const wrapInKeepAlive = (props, children) => {
  570. return { default: () => children };
  571. };
  572. function toArray$1(value) {
  573. return Array.isArray(value) ? value : [value];
  574. }
  575. async function getRouteRules(url) {
  576. {
  577. const _routeRulesMatcher = toRouteMatcher(
  578. createRouter$1({ routes: (/* @__PURE__ */ useRuntimeConfig()).nitro.routeRules })
  579. );
  580. return defu({}, ..._routeRulesMatcher.matchAll(url).reverse());
  581. }
  582. }
  583. const _routes = [
  584. {
  585. name: "index",
  586. path: "/",
  587. component: () => import('./index-DtrUFpP0.mjs')
  588. },
  589. {
  590. name: "login",
  591. path: "/login",
  592. component: () => import('./login-C0jWU6fx.mjs')
  593. },
  594. {
  595. name: "register",
  596. path: "/register",
  597. component: () => import('./register-hicBJgDn.mjs')
  598. }
  599. ];
  600. const _wrapIf = (component, props, slots) => {
  601. props = props === true ? {} : props;
  602. return { default: () => {
  603. var _a;
  604. return props ? h(component, props, slots) : (_a = slots.default) == null ? void 0 : _a.call(slots);
  605. } };
  606. };
  607. function generateRouteKey(route) {
  608. const source = (route == null ? void 0 : route.meta.key) ?? route.path.replace(/(:\w+)\([^)]+\)/g, "$1").replace(/(:\w+)[?+*]/g, "$1").replace(/:\w+/g, (r) => {
  609. var _a;
  610. return ((_a = route.params[r.slice(1)]) == null ? void 0 : _a.toString()) || "";
  611. });
  612. return typeof source === "function" ? source(route) : source;
  613. }
  614. function isChangingPage(to, from) {
  615. if (to === from || from === START_LOCATION) {
  616. return false;
  617. }
  618. if (generateRouteKey(to) !== generateRouteKey(from)) {
  619. return true;
  620. }
  621. const areComponentsSame = to.matched.every(
  622. (comp, index) => {
  623. var _a, _b;
  624. return comp.components && comp.components.default === ((_b = (_a = from.matched[index]) == null ? void 0 : _a.components) == null ? void 0 : _b.default);
  625. }
  626. );
  627. if (areComponentsSame) {
  628. return false;
  629. }
  630. return true;
  631. }
  632. const routerOptions0 = {
  633. scrollBehavior(to, from, savedPosition) {
  634. var _a;
  635. const nuxtApp = useNuxtApp();
  636. const behavior = ((_a = useRouter().options) == null ? void 0 : _a.scrollBehaviorType) ?? "auto";
  637. let position = savedPosition || void 0;
  638. const routeAllowsScrollToTop = typeof to.meta.scrollToTop === "function" ? to.meta.scrollToTop(to, from) : to.meta.scrollToTop;
  639. if (!position && from && to && routeAllowsScrollToTop !== false && isChangingPage(to, from)) {
  640. position = { left: 0, top: 0 };
  641. }
  642. if (to.path === from.path) {
  643. if (from.hash && !to.hash) {
  644. return { left: 0, top: 0 };
  645. }
  646. if (to.hash) {
  647. return { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior };
  648. }
  649. return false;
  650. }
  651. const hasTransition = (route) => !!(route.meta.pageTransition ?? appPageTransition);
  652. const hookToWait = hasTransition(from) && hasTransition(to) ? "page:transition:finish" : "page:finish";
  653. return new Promise((resolve) => {
  654. nuxtApp.hooks.hookOnce(hookToWait, async () => {
  655. await new Promise((resolve2) => setTimeout(resolve2, 0));
  656. if (to.hash) {
  657. position = { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior };
  658. }
  659. resolve(position);
  660. });
  661. });
  662. }
  663. };
  664. function _getHashElementScrollMarginTop(selector) {
  665. try {
  666. const elem = (void 0).querySelector(selector);
  667. if (elem) {
  668. return (Number.parseFloat(getComputedStyle(elem).scrollMarginTop) || 0) + (Number.parseFloat(getComputedStyle((void 0).documentElement).scrollPaddingTop) || 0);
  669. }
  670. } catch {
  671. }
  672. return 0;
  673. }
  674. const configRouterOptions = {
  675. hashMode: false,
  676. scrollBehaviorType: "auto"
  677. };
  678. const routerOptions = {
  679. ...configRouterOptions,
  680. ...routerOptions0
  681. };
  682. const validate = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to) => {
  683. var _a;
  684. let __temp, __restore;
  685. if (!((_a = to.meta) == null ? void 0 : _a.validate)) {
  686. return;
  687. }
  688. const nuxtApp = useNuxtApp();
  689. const router = useRouter();
  690. const result = ([__temp, __restore] = executeAsync(() => Promise.resolve(to.meta.validate(to))), __temp = await __temp, __restore(), __temp);
  691. if (result === true) {
  692. return;
  693. }
  694. const error = createError({
  695. statusCode: result && result.statusCode || 404,
  696. statusMessage: result && result.statusMessage || `Page Not Found: ${to.fullPath}`,
  697. data: {
  698. path: to.fullPath
  699. }
  700. });
  701. const unsub = router.beforeResolve((final) => {
  702. unsub();
  703. if (final === to) {
  704. const unsub2 = router.afterEach(async () => {
  705. unsub2();
  706. await nuxtApp.runWithContext(() => showError(error));
  707. });
  708. return false;
  709. }
  710. });
  711. });
  712. const manifest_45route_45rule = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to) => {
  713. {
  714. return;
  715. }
  716. });
  717. const globalMiddleware = [
  718. validate,
  719. manifest_45route_45rule
  720. ];
  721. const namedMiddleware = {};
  722. const plugin = /* @__PURE__ */ defineNuxtPlugin({
  723. name: "nuxt:router",
  724. enforce: "pre",
  725. async setup(nuxtApp) {
  726. var _a, _b, _c;
  727. let __temp, __restore;
  728. let routerBase = (/* @__PURE__ */ useRuntimeConfig()).app.baseURL;
  729. if (routerOptions.hashMode && !routerBase.includes("#")) {
  730. routerBase += "#";
  731. }
  732. const history = ((_a = routerOptions.history) == null ? void 0 : _a.call(routerOptions, routerBase)) ?? createMemoryHistory(routerBase);
  733. const routes2 = routerOptions.routes ? ([__temp, __restore] = executeAsync(() => routerOptions.routes(_routes)), __temp = await __temp, __restore(), __temp) ?? _routes : _routes;
  734. let startPosition;
  735. const router = createRouter({
  736. ...routerOptions,
  737. scrollBehavior: (to, from, savedPosition) => {
  738. if (from === START_LOCATION) {
  739. startPosition = savedPosition;
  740. return;
  741. }
  742. if (routerOptions.scrollBehavior) {
  743. router.options.scrollBehavior = routerOptions.scrollBehavior;
  744. if ("scrollRestoration" in (void 0).history) {
  745. const unsub = router.beforeEach(() => {
  746. unsub();
  747. (void 0).history.scrollRestoration = "manual";
  748. });
  749. }
  750. return routerOptions.scrollBehavior(to, START_LOCATION, startPosition || savedPosition);
  751. }
  752. },
  753. history,
  754. routes: routes2
  755. });
  756. nuxtApp.vueApp.use(router);
  757. const previousRoute = shallowRef(router.currentRoute.value);
  758. router.afterEach((_to, from) => {
  759. previousRoute.value = from;
  760. });
  761. Object.defineProperty(nuxtApp.vueApp.config.globalProperties, "previousRoute", {
  762. get: () => previousRoute.value
  763. });
  764. const initialURL = nuxtApp.ssrContext.url;
  765. const _route = shallowRef(router.currentRoute.value);
  766. const syncCurrentRoute = () => {
  767. _route.value = router.currentRoute.value;
  768. };
  769. nuxtApp.hook("page:finish", syncCurrentRoute);
  770. router.afterEach((to, from) => {
  771. var _a2, _b2, _c2, _d;
  772. if (((_b2 = (_a2 = to.matched[0]) == null ? void 0 : _a2.components) == null ? void 0 : _b2.default) === ((_d = (_c2 = from.matched[0]) == null ? void 0 : _c2.components) == null ? void 0 : _d.default)) {
  773. syncCurrentRoute();
  774. }
  775. });
  776. const route = {};
  777. for (const key in _route.value) {
  778. Object.defineProperty(route, key, {
  779. get: () => _route.value[key],
  780. enumerable: true
  781. });
  782. }
  783. nuxtApp._route = shallowReactive(route);
  784. nuxtApp._middleware = nuxtApp._middleware || {
  785. global: [],
  786. named: {}
  787. };
  788. useError();
  789. if (!((_b = nuxtApp.ssrContext) == null ? void 0 : _b.islandContext)) {
  790. router.afterEach(async (to, _from, failure) => {
  791. delete nuxtApp._processingMiddleware;
  792. if (failure) {
  793. await nuxtApp.callHook("page:loading:end");
  794. }
  795. if ((failure == null ? void 0 : failure.type) === 4) {
  796. return;
  797. }
  798. if (to.matched.length === 0) {
  799. await nuxtApp.runWithContext(() => showError(createError$1({
  800. statusCode: 404,
  801. fatal: false,
  802. statusMessage: `Page not found: ${to.fullPath}`,
  803. data: {
  804. path: to.fullPath
  805. }
  806. })));
  807. } else if (to.redirectedFrom && to.fullPath !== initialURL) {
  808. await nuxtApp.runWithContext(() => navigateTo(to.fullPath || "/"));
  809. }
  810. });
  811. }
  812. try {
  813. if (true) {
  814. ;
  815. [__temp, __restore] = executeAsync(() => router.push(initialURL)), await __temp, __restore();
  816. ;
  817. }
  818. ;
  819. [__temp, __restore] = executeAsync(() => router.isReady()), await __temp, __restore();
  820. ;
  821. } catch (error2) {
  822. [__temp, __restore] = executeAsync(() => nuxtApp.runWithContext(() => showError(error2))), await __temp, __restore();
  823. }
  824. const resolvedInitialRoute = router.currentRoute.value;
  825. syncCurrentRoute();
  826. if ((_c = nuxtApp.ssrContext) == null ? void 0 : _c.islandContext) {
  827. return { provide: { router } };
  828. }
  829. const initialLayout = nuxtApp.payload.state._layout;
  830. router.beforeEach(async (to, from) => {
  831. var _a2, _b2;
  832. await nuxtApp.callHook("page:loading:start");
  833. to.meta = reactive(to.meta);
  834. if (nuxtApp.isHydrating && initialLayout && !isReadonly(to.meta.layout)) {
  835. to.meta.layout = initialLayout;
  836. }
  837. nuxtApp._processingMiddleware = true;
  838. if (!((_a2 = nuxtApp.ssrContext) == null ? void 0 : _a2.islandContext)) {
  839. const middlewareEntries = /* @__PURE__ */ new Set([...globalMiddleware, ...nuxtApp._middleware.global]);
  840. for (const component of to.matched) {
  841. const componentMiddleware = component.meta.middleware;
  842. if (!componentMiddleware) {
  843. continue;
  844. }
  845. for (const entry2 of toArray$1(componentMiddleware)) {
  846. middlewareEntries.add(entry2);
  847. }
  848. }
  849. {
  850. const routeRules = await nuxtApp.runWithContext(() => getRouteRules(to.path));
  851. if (routeRules.appMiddleware) {
  852. for (const key in routeRules.appMiddleware) {
  853. if (routeRules.appMiddleware[key]) {
  854. middlewareEntries.add(key);
  855. } else {
  856. middlewareEntries.delete(key);
  857. }
  858. }
  859. }
  860. }
  861. for (const entry2 of middlewareEntries) {
  862. const middleware = typeof entry2 === "string" ? nuxtApp._middleware.named[entry2] || await ((_b2 = namedMiddleware[entry2]) == null ? void 0 : _b2.call(namedMiddleware).then((r) => r.default || r)) : entry2;
  863. if (!middleware) {
  864. throw new Error(`Unknown route middleware: '${entry2}'.`);
  865. }
  866. const result = await nuxtApp.runWithContext(() => middleware(to, from));
  867. {
  868. if (result === false || result instanceof Error) {
  869. const error2 = result || createError$1({
  870. statusCode: 404,
  871. statusMessage: `Page Not Found: ${initialURL}`
  872. });
  873. await nuxtApp.runWithContext(() => showError(error2));
  874. return false;
  875. }
  876. }
  877. if (result === true) {
  878. continue;
  879. }
  880. if (result || result === false) {
  881. return result;
  882. }
  883. }
  884. }
  885. });
  886. router.onError(async () => {
  887. delete nuxtApp._processingMiddleware;
  888. await nuxtApp.callHook("page:loading:end");
  889. });
  890. nuxtApp.hooks.hookOnce("app:created", async () => {
  891. try {
  892. if ("name" in resolvedInitialRoute) {
  893. resolvedInitialRoute.name = void 0;
  894. }
  895. await router.replace({
  896. ...resolvedInitialRoute,
  897. force: true
  898. });
  899. router.options.scrollBehavior = routerOptions.scrollBehavior;
  900. } catch (error2) {
  901. await nuxtApp.runWithContext(() => showError(error2));
  902. }
  903. });
  904. return { provide: { router } };
  905. }
  906. });
  907. function definePayloadReducer(name, reduce) {
  908. {
  909. useNuxtApp().ssrContext._payloadReducers[name] = reduce;
  910. }
  911. }
  912. const reducers = [
  913. ["NuxtError", (data) => isNuxtError(data) && data.toJSON()],
  914. ["EmptyShallowRef", (data) => isRef(data) && isShallow(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
  915. ["EmptyRef", (data) => isRef(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
  916. ["ShallowRef", (data) => isRef(data) && isShallow(data) && data.value],
  917. ["ShallowReactive", (data) => isReactive(data) && isShallow(data) && toRaw(data)],
  918. ["Ref", (data) => isRef(data) && data.value],
  919. ["Reactive", (data) => isReactive(data) && toRaw(data)]
  920. ];
  921. const revive_payload_server_eJ33V7gbc6 = /* @__PURE__ */ defineNuxtPlugin({
  922. name: "nuxt:revive-payload:server",
  923. setup() {
  924. for (const [reducer, fn] of reducers) {
  925. definePayloadReducer(reducer, fn);
  926. }
  927. }
  928. });
  929. const components_plugin_KR1HBZs4kY = /* @__PURE__ */ defineNuxtPlugin({
  930. name: "nuxt:global-components"
  931. });
  932. const element_plus_elM4AXquKi = () => {
  933. };
  934. function toArray(value) {
  935. return Array.isArray(value) ? value : [value];
  936. }
  937. function useRequestEvent(nuxtApp = useNuxtApp()) {
  938. var _a;
  939. return (_a = nuxtApp.ssrContext) == null ? void 0 : _a.event;
  940. }
  941. function prerenderRoutes(path) {
  942. const paths = toArray(path);
  943. appendHeader(useRequestEvent(), "x-nitro-prerender", paths.map((p) => encodeURIComponent(p)).join(", "));
  944. }
  945. let routes;
  946. const prerender_server_LXx1wM9sKF = /* @__PURE__ */ defineNuxtPlugin(async () => {
  947. let __temp, __restore;
  948. if (routerOptions.hashMode) {
  949. return;
  950. }
  951. if (routes && !routes.length) {
  952. return;
  953. }
  954. routes || (routes = Array.from(processRoutes(([__temp, __restore] = executeAsync(() => {
  955. var _a;
  956. return (_a = routerOptions.routes) == null ? void 0 : _a.call(routerOptions, _routes);
  957. }), __temp = await __temp, __restore(), __temp) ?? _routes)));
  958. const batch = routes.splice(0, 10);
  959. prerenderRoutes(batch);
  960. });
  961. const OPTIONAL_PARAM_RE = /^\/?:.*(?:\?|\(\.\*\)\*)$/;
  962. function processRoutes(routes2, currentPath = "/", routesToPrerender = /* @__PURE__ */ new Set()) {
  963. var _a;
  964. for (const route of routes2) {
  965. if (OPTIONAL_PARAM_RE.test(route.path) && !((_a = route.children) == null ? void 0 : _a.length)) {
  966. routesToPrerender.add(currentPath);
  967. }
  968. if (route.path.includes(":")) {
  969. continue;
  970. }
  971. const fullPath = joinURL(currentPath, route.path);
  972. routesToPrerender.add(fullPath);
  973. if (route.children) {
  974. processRoutes(route.children, fullPath, routesToPrerender);
  975. }
  976. }
  977. return routesToPrerender;
  978. }
  979. const plugins = [
  980. unhead_KgADcZ0jPj,
  981. plugin,
  982. revive_payload_server_eJ33V7gbc6,
  983. components_plugin_KR1HBZs4kY,
  984. element_plus_elM4AXquKi,
  985. prerender_server_LXx1wM9sKF
  986. ];
  987. const RouteProvider = defineComponent({
  988. props: {
  989. vnode: {
  990. type: Object,
  991. required: true
  992. },
  993. route: {
  994. type: Object,
  995. required: true
  996. },
  997. vnodeRef: Object,
  998. renderKey: String,
  999. trackRootNodes: Boolean
  1000. },
  1001. setup(props) {
  1002. const previousKey = props.renderKey;
  1003. const previousRoute = props.route;
  1004. const route = {};
  1005. for (const key in props.route) {
  1006. Object.defineProperty(route, key, {
  1007. get: () => previousKey === props.renderKey ? props.route[key] : previousRoute[key],
  1008. enumerable: true
  1009. });
  1010. }
  1011. provide(PageRouteSymbol, shallowReactive(route));
  1012. return () => {
  1013. return h(props.vnode, { ref: props.vnodeRef });
  1014. };
  1015. }
  1016. });
  1017. const __nuxt_component_0 = defineComponent({
  1018. name: "NuxtPage",
  1019. inheritAttrs: false,
  1020. props: {
  1021. name: {
  1022. type: String
  1023. },
  1024. transition: {
  1025. type: [Boolean, Object],
  1026. default: void 0
  1027. },
  1028. keepalive: {
  1029. type: [Boolean, Object],
  1030. default: void 0
  1031. },
  1032. route: {
  1033. type: Object
  1034. },
  1035. pageKey: {
  1036. type: [Function, String],
  1037. default: null
  1038. }
  1039. },
  1040. setup(props, { attrs, slots, expose }) {
  1041. const nuxtApp = useNuxtApp();
  1042. const pageRef = ref();
  1043. const forkRoute = inject(PageRouteSymbol, null);
  1044. let previousPageKey;
  1045. expose({ pageRef });
  1046. inject(LayoutMetaSymbol, null);
  1047. let vnode;
  1048. const done = nuxtApp.deferHydration();
  1049. if (props.pageKey) {
  1050. watch(() => props.pageKey, (next, prev) => {
  1051. if (next !== prev) {
  1052. nuxtApp.callHook("page:loading:start");
  1053. }
  1054. });
  1055. }
  1056. return () => {
  1057. return h(RouterView, { name: props.name, route: props.route, ...attrs }, {
  1058. default: (routeProps) => {
  1059. if (!routeProps.Component) {
  1060. done();
  1061. return;
  1062. }
  1063. const key = generateRouteKey$1(routeProps, props.pageKey);
  1064. if (!nuxtApp.isHydrating && !hasChildrenRoutes(forkRoute, routeProps.route, routeProps.Component) && previousPageKey === key) {
  1065. nuxtApp.callHook("page:loading:end");
  1066. }
  1067. previousPageKey = key;
  1068. const hasTransition = !!(props.transition ?? routeProps.route.meta.pageTransition ?? appPageTransition);
  1069. const transitionProps = hasTransition && _mergeTransitionProps([
  1070. props.transition,
  1071. routeProps.route.meta.pageTransition,
  1072. appPageTransition,
  1073. { onAfterLeave: () => {
  1074. nuxtApp.callHook("page:transition:finish", routeProps.Component);
  1075. } }
  1076. ].filter(Boolean));
  1077. const keepaliveConfig = props.keepalive ?? routeProps.route.meta.keepalive ?? appKeepalive;
  1078. vnode = _wrapIf(
  1079. Transition,
  1080. hasTransition && transitionProps,
  1081. wrapInKeepAlive(
  1082. keepaliveConfig,
  1083. h(Suspense, {
  1084. suspensible: true,
  1085. onPending: () => nuxtApp.callHook("page:start", routeProps.Component),
  1086. onResolve: () => {
  1087. nextTick(() => nuxtApp.callHook("page:finish", routeProps.Component).then(() => nuxtApp.callHook("page:loading:end")).finally(done));
  1088. }
  1089. }, {
  1090. default: () => {
  1091. const providerVNode = h(RouteProvider, {
  1092. key: key || void 0,
  1093. vnode: slots.default ? h(Fragment, void 0, slots.default(routeProps)) : routeProps.Component,
  1094. route: routeProps.route,
  1095. renderKey: key || void 0,
  1096. trackRootNodes: hasTransition,
  1097. vnodeRef: pageRef
  1098. });
  1099. return providerVNode;
  1100. }
  1101. })
  1102. )
  1103. ).default();
  1104. return vnode;
  1105. }
  1106. });
  1107. };
  1108. }
  1109. });
  1110. function _mergeTransitionProps(routeProps) {
  1111. const _props = routeProps.map((prop) => ({
  1112. ...prop,
  1113. onAfterLeave: prop.onAfterLeave ? toArray$1(prop.onAfterLeave) : void 0
  1114. }));
  1115. return defu(..._props);
  1116. }
  1117. function hasChildrenRoutes(fork, newRoute, Component) {
  1118. if (!fork) {
  1119. return false;
  1120. }
  1121. const index = newRoute.matched.findIndex((m) => {
  1122. var _a;
  1123. return ((_a = m.components) == null ? void 0 : _a.default) === (Component == null ? void 0 : Component.type);
  1124. });
  1125. return index < newRoute.matched.length - 1;
  1126. }
  1127. const _export_sfc = (sfc, props) => {
  1128. const target = sfc.__vccOpts || sfc;
  1129. for (const [key, val] of props) {
  1130. target[key] = val;
  1131. }
  1132. return target;
  1133. };
  1134. const _sfc_main$2 = {};
  1135. function _sfc_ssrRender(_ctx, _push, _parent, _attrs) {
  1136. const _component_NuxtPage = __nuxt_component_0;
  1137. _push(`<div${ssrRenderAttrs(_attrs)}>`);
  1138. _push(ssrRenderComponent(_component_NuxtPage, null, null, _parent));
  1139. _push(`</div>`);
  1140. }
  1141. const _sfc_setup$2 = _sfc_main$2.setup;
  1142. _sfc_main$2.setup = (props, ctx) => {
  1143. const ssrContext = useSSRContext();
  1144. (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("app.vue");
  1145. return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
  1146. };
  1147. const AppComponent = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender]]);
  1148. const _sfc_main$1 = {
  1149. __name: "nuxt-error-page",
  1150. __ssrInlineRender: true,
  1151. props: {
  1152. error: Object
  1153. },
  1154. setup(__props) {
  1155. const props = __props;
  1156. const _error = props.error;
  1157. _error.stack ? _error.stack.split("\n").splice(1).map((line) => {
  1158. const text = line.replace("webpack:/", "").replace(".vue", ".js").trim();
  1159. return {
  1160. text,
  1161. internal: line.includes("node_modules") && !line.includes(".cache") || line.includes("internal") || line.includes("new Promise")
  1162. };
  1163. }).map((i) => `<span class="stack${i.internal ? " internal" : ""}">${i.text}</span>`).join("\n") : "";
  1164. const statusCode = Number(_error.statusCode || 500);
  1165. const is404 = statusCode === 404;
  1166. const statusMessage = _error.statusMessage ?? (is404 ? "Page Not Found" : "Internal Server Error");
  1167. const description = _error.message || _error.toString();
  1168. const stack = void 0;
  1169. const _Error404 = defineAsyncComponent(() => import('./error-404-Dj6KT2oP.mjs'));
  1170. const _Error = defineAsyncComponent(() => import('./error-500-B0Hn6rMk.mjs'));
  1171. const ErrorTemplate = is404 ? _Error404 : _Error;
  1172. return (_ctx, _push, _parent, _attrs) => {
  1173. _push(ssrRenderComponent(unref(ErrorTemplate), mergeProps({ statusCode: unref(statusCode), statusMessage: unref(statusMessage), description: unref(description), stack: unref(stack) }, _attrs), null, _parent));
  1174. };
  1175. }
  1176. };
  1177. const _sfc_setup$1 = _sfc_main$1.setup;
  1178. _sfc_main$1.setup = (props, ctx) => {
  1179. const ssrContext = useSSRContext();
  1180. (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/nuxt/dist/app/components/nuxt-error-page.vue");
  1181. return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
  1182. };
  1183. const _sfc_main = {
  1184. __name: "nuxt-root",
  1185. __ssrInlineRender: true,
  1186. setup(__props) {
  1187. const IslandRenderer = () => null;
  1188. const nuxtApp = useNuxtApp();
  1189. nuxtApp.deferHydration();
  1190. nuxtApp.ssrContext.url;
  1191. const SingleRenderer = false;
  1192. provide(PageRouteSymbol, useRoute());
  1193. nuxtApp.hooks.callHookWith((hooks) => hooks.map((hook) => hook()), "vue:setup");
  1194. const error = useError();
  1195. const abortRender = error.value && !nuxtApp.ssrContext.error;
  1196. onErrorCaptured((err, target, info) => {
  1197. nuxtApp.hooks.callHook("vue:error", err, target, info).catch((hookError) => console.error("[nuxt] Error in `vue:error` hook", hookError));
  1198. {
  1199. const p = nuxtApp.runWithContext(() => showError(err));
  1200. onServerPrefetch(() => p);
  1201. return false;
  1202. }
  1203. });
  1204. const islandContext = nuxtApp.ssrContext.islandContext;
  1205. return (_ctx, _push, _parent, _attrs) => {
  1206. ssrRenderSuspense(_push, {
  1207. default: () => {
  1208. if (unref(abortRender)) {
  1209. _push(`<div></div>`);
  1210. } else if (unref(error)) {
  1211. _push(ssrRenderComponent(unref(_sfc_main$1), { error: unref(error) }, null, _parent));
  1212. } else if (unref(islandContext)) {
  1213. _push(ssrRenderComponent(unref(IslandRenderer), { context: unref(islandContext) }, null, _parent));
  1214. } else if (unref(SingleRenderer)) {
  1215. ssrRenderVNode(_push, createVNode(resolveDynamicComponent(unref(SingleRenderer)), null, null), _parent);
  1216. } else {
  1217. _push(ssrRenderComponent(unref(AppComponent), null, null, _parent));
  1218. }
  1219. },
  1220. _: 1
  1221. });
  1222. };
  1223. }
  1224. };
  1225. const _sfc_setup = _sfc_main.setup;
  1226. _sfc_main.setup = (props, ctx) => {
  1227. const ssrContext = useSSRContext();
  1228. (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/nuxt/dist/app/components/nuxt-root.vue");
  1229. return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
  1230. };
  1231. let entry;
  1232. {
  1233. entry = async function createNuxtAppServer(ssrContext) {
  1234. const vueApp = createApp(_sfc_main);
  1235. const nuxt = createNuxtApp({ vueApp, ssrContext });
  1236. try {
  1237. await applyPlugins(nuxt, plugins);
  1238. await nuxt.hooks.callHook("app:created", vueApp);
  1239. } catch (error) {
  1240. await nuxt.hooks.callHook("app:error", error);
  1241. nuxt.payload.error = nuxt.payload.error || createError(error);
  1242. }
  1243. if (ssrContext == null ? void 0 : ssrContext._renderResponse) {
  1244. throw new Error("skipping render");
  1245. }
  1246. return vueApp;
  1247. };
  1248. }
  1249. const entry$1 = (ssrContext) => entry(ssrContext);
  1250. export { _export_sfc as _, navigateTo as a, useNuxtApp as b, useRuntimeConfig as c, resolveUnrefHeadInput as d, entry$1 as default, injectHead as i, nuxtLinkDefaults as n, resolveRouteObject as r, useRouter as u };
  1251. //# sourceMappingURL=server.mjs.map