2024-01-25 19:29:12 +08:00
import { version , unref , inject , hasInjectionContext , getCurrentInstance , ref , computed , createApp , effectScope , reactive , useSSRContext , defineAsyncComponent , provide , onErrorCaptured , onServerPrefetch , createVNode , resolveDynamicComponent , toRef , shallowRef , shallowReactive , isReadonly , isRef , isShallow , isReactive , toRaw , resolveComponent , mergeProps , nextTick } from 'vue' ;
2024-01-26 11:09:20 +08:00
import http from 'node:http' ;
import https from 'node:https' ;
import { l as destr , d as useRuntimeConfig$1 } from '../nitro/node-server.mjs' ;
2024-01-25 19:29:12 +08:00
import { getActiveHead } from 'unhead' ;
import { defineHeadPlugin } from '@unhead/shared' ;
import { createMemoryHistory , createRouter , START _LOCATION } from 'vue-router' ;
import { ssrRenderSuspense , ssrRenderComponent , ssrRenderVNode } from 'vue/server-renderer' ;
2024-01-26 11:09:20 +08:00
const s = globalThis . Headers , i = globalThis . AbortController , l = globalThis . fetch || ( ( ) => { throw new Error ( "[node-fetch-native] Failed to fetch: `globalThis.fetch` is not available!" ) } ) ;
const HASH _RE = /#/g ;
const AMPERSAND _RE = /&/g ;
const EQUAL _RE = /=/g ;
const PLUS _RE = /\+/g ;
const ENC _CARET _RE = /%5e/gi ;
const ENC _BACKTICK _RE = /%60/gi ;
const ENC _PIPE _RE = /%7c/gi ;
const ENC _SPACE _RE = /%20/gi ;
function encode ( text ) {
return encodeURI ( "" + text ) . replace ( ENC _PIPE _RE , "|" ) ;
}
function encodeQueryValue ( input ) {
return encode ( typeof input === "string" ? input : JSON . stringify ( input ) ) . replace ( PLUS _RE , "%2B" ) . replace ( ENC _SPACE _RE , "+" ) . replace ( HASH _RE , "%23" ) . replace ( AMPERSAND _RE , "%26" ) . replace ( ENC _BACKTICK _RE , "`" ) . replace ( ENC _CARET _RE , "^" ) ;
}
function encodeQueryKey ( text ) {
return encodeQueryValue ( text ) . replace ( EQUAL _RE , "%3D" ) ;
}
function decode ( text = "" ) {
try {
return decodeURIComponent ( "" + text ) ;
} catch {
return "" + text ;
}
}
function decodeQueryKey ( text ) {
return decode ( text . replace ( PLUS _RE , " " ) ) ;
}
function decodeQueryValue ( text ) {
return decode ( text . replace ( PLUS _RE , " " ) ) ;
}
function parseQuery ( parametersString = "" ) {
const object = { } ;
if ( parametersString [ 0 ] === "?" ) {
parametersString = parametersString . slice ( 1 ) ;
}
for ( const parameter of parametersString . split ( "&" ) ) {
const s = parameter . match ( /([^=]+)=?(.*)/ ) || [ ] ;
if ( s . length < 2 ) {
continue ;
}
const key = decodeQueryKey ( s [ 1 ] ) ;
if ( key === "__proto__" || key === "constructor" ) {
continue ;
}
const value = decodeQueryValue ( s [ 2 ] || "" ) ;
if ( object [ key ] === void 0 ) {
object [ key ] = value ;
} else if ( Array . isArray ( object [ key ] ) ) {
object [ key ] . push ( value ) ;
} else {
object [ key ] = [ object [ key ] , value ] ;
}
}
return object ;
}
function encodeQueryItem ( key , value ) {
if ( typeof value === "number" || typeof value === "boolean" ) {
value = String ( value ) ;
}
if ( ! value ) {
return encodeQueryKey ( key ) ;
}
if ( Array . isArray ( value ) ) {
return value . map ( ( _value ) => ` ${ encodeQueryKey ( key ) } = ${ encodeQueryValue ( _value ) } ` ) . join ( "&" ) ;
}
return ` ${ encodeQueryKey ( key ) } = ${ encodeQueryValue ( value ) } ` ;
}
function stringifyQuery ( query ) {
return Object . keys ( query ) . filter ( ( k ) => query [ k ] !== void 0 ) . map ( ( k ) => encodeQueryItem ( k , query [ k ] ) ) . filter ( Boolean ) . join ( "&" ) ;
}
const PROTOCOL _STRICT _REGEX = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/ ;
const PROTOCOL _REGEX = /^[\s\w\0+.-]{2,}:([/\\]{2})?/ ;
const PROTOCOL _RELATIVE _REGEX = /^([/\\]\s*){2,}[^/\\]/ ;
function hasProtocol ( inputString , opts = { } ) {
if ( typeof opts === "boolean" ) {
opts = { acceptRelative : opts } ;
}
if ( opts . strict ) {
return PROTOCOL _STRICT _REGEX . test ( inputString ) ;
}
return PROTOCOL _REGEX . test ( inputString ) || ( opts . acceptRelative ? PROTOCOL _RELATIVE _REGEX . test ( inputString ) : false ) ;
}
const PROTOCOL _SCRIPT _RE = /^[\s\0]*(blob|data|javascript|vbscript):$/i ;
function isScriptProtocol ( protocol ) {
return ! ! protocol && PROTOCOL _SCRIPT _RE . test ( protocol ) ;
}
const TRAILING _SLASH _RE = /\/$|\/\?|\/#/ ;
function hasTrailingSlash ( input = "" , respectQueryAndFragment ) {
if ( ! respectQueryAndFragment ) {
return input . endsWith ( "/" ) ;
}
return TRAILING _SLASH _RE . test ( input ) ;
}
function withoutTrailingSlash ( input = "" , respectQueryAndFragment ) {
if ( ! respectQueryAndFragment ) {
return ( hasTrailingSlash ( input ) ? input . slice ( 0 , - 1 ) : input ) || "/" ;
}
if ( ! hasTrailingSlash ( input , true ) ) {
return input || "/" ;
}
let path = input ;
let fragment = "" ;
const fragmentIndex = input . indexOf ( "#" ) ;
if ( fragmentIndex >= 0 ) {
path = input . slice ( 0 , fragmentIndex ) ;
fragment = input . slice ( fragmentIndex ) ;
}
const [ s0 , ... s ] = path . split ( "?" ) ;
return ( s0 . slice ( 0 , - 1 ) || "/" ) + ( s . length > 0 ? ` ? ${ s . join ( "?" ) } ` : "" ) + fragment ;
}
function withTrailingSlash ( input = "" , respectQueryAndFragment ) {
if ( ! respectQueryAndFragment ) {
return input . endsWith ( "/" ) ? input : input + "/" ;
}
if ( hasTrailingSlash ( input , true ) ) {
return input || "/" ;
}
let path = input ;
let fragment = "" ;
const fragmentIndex = input . indexOf ( "#" ) ;
if ( fragmentIndex >= 0 ) {
path = input . slice ( 0 , fragmentIndex ) ;
fragment = input . slice ( fragmentIndex ) ;
if ( ! path ) {
return fragment ;
}
}
const [ s0 , ... s ] = path . split ( "?" ) ;
return s0 + "/" + ( s . length > 0 ? ` ? ${ s . join ( "?" ) } ` : "" ) + fragment ;
}
function withBase ( input , base ) {
if ( isEmptyURL ( base ) || hasProtocol ( input ) ) {
return input ;
}
const _base = withoutTrailingSlash ( base ) ;
if ( input . startsWith ( _base ) ) {
return input ;
}
return joinURL ( _base , input ) ;
}
function withQuery ( input , query ) {
const parsed = parseURL ( input ) ;
const mergedQuery = { ... parseQuery ( parsed . search ) , ... query } ;
parsed . search = stringifyQuery ( mergedQuery ) ;
return stringifyParsedURL ( parsed ) ;
}
function isEmptyURL ( url ) {
return ! url || url === "/" ;
}
function isNonEmptyURL ( url ) {
return url && url !== "/" ;
}
const JOIN _LEADING _SLASH _RE = /^\.?\// ;
function joinURL ( base , ... input ) {
let url = base || "" ;
for ( const segment of input . filter ( ( url2 ) => isNonEmptyURL ( url2 ) ) ) {
if ( url ) {
const _segment = segment . replace ( JOIN _LEADING _SLASH _RE , "" ) ;
url = withTrailingSlash ( url ) + _segment ;
} else {
url = segment ;
}
}
return url ;
}
function parseURL ( input = "" , defaultProto ) {
const _specialProtoMatch = input . match (
/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i
) ;
if ( _specialProtoMatch ) {
const [ , _proto , _pathname = "" ] = _specialProtoMatch ;
return {
protocol : _proto . toLowerCase ( ) ,
pathname : _pathname ,
href : _proto + _pathname ,
auth : "" ,
host : "" ,
search : "" ,
hash : ""
} ;
}
if ( ! hasProtocol ( input , { acceptRelative : true } ) ) {
return defaultProto ? parseURL ( defaultProto + input ) : parsePath ( input ) ;
}
const [ , protocol = "" , auth , hostAndPath = "" ] = input . replace ( /\\/g , "/" ) . match ( /^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/ ) || [ ] ;
const [ , host = "" , path = "" ] = hostAndPath . match ( /([^#/?]*)(.*)?/ ) || [ ] ;
const { pathname , search , hash } = parsePath (
path . replace ( /\/(?=[A-Za-z]:)/ , "" )
) ;
return {
protocol : protocol . toLowerCase ( ) ,
auth : auth ? auth . slice ( 0 , Math . max ( 0 , auth . length - 1 ) ) : "" ,
host ,
pathname ,
search ,
hash
} ;
}
function parsePath ( input = "" ) {
const [ pathname = "" , search = "" , hash = "" ] = ( input . match ( /([^#?]*)(\?[^#]*)?(#.*)?/ ) || [ ] ) . splice ( 1 ) ;
return {
pathname ,
search ,
hash
} ;
}
function stringifyParsedURL ( parsed ) {
const pathname = parsed . pathname || "" ;
const search = parsed . search ? ( parsed . search . startsWith ( "?" ) ? "" : "?" ) + parsed . search : "" ;
const hash = parsed . hash || "" ;
const auth = parsed . auth ? parsed . auth + "@" : "" ;
const host = parsed . host || "" ;
const proto = parsed . protocol ? parsed . protocol + "//" : "" ;
return proto + auth + host + pathname + search + hash ;
}
class FetchError extends Error {
constructor ( message , opts ) {
super ( message , opts ) ;
this . name = "FetchError" ;
if ( opts ? . cause && ! this . cause ) {
this . cause = opts . cause ;
}
}
}
function createFetchError ( ctx ) {
const errorMessage = ctx . error ? . message || ctx . error ? . toString ( ) || "" ;
const method = ctx . request ? . method || ctx . options ? . method || "GET" ;
const url = ctx . request ? . url || String ( ctx . request ) || "/" ;
const requestStr = ` [ ${ method } ] ${ JSON . stringify ( url ) } ` ;
const statusStr = ctx . response ? ` ${ ctx . response . status } ${ ctx . response . statusText } ` : "<no response>" ;
const message = ` ${ requestStr } : ${ statusStr } ${ errorMessage ? ` ${ errorMessage } ` : "" } ` ;
const fetchError = new FetchError (
message ,
ctx . error ? { cause : ctx . error } : void 0
) ;
for ( const key of [ "request" , "options" , "response" ] ) {
Object . defineProperty ( fetchError , key , {
get ( ) {
return ctx [ key ] ;
}
} ) ;
}
for ( const [ key , refKey ] of [
[ "data" , "_data" ] ,
[ "status" , "status" ] ,
[ "statusCode" , "status" ] ,
[ "statusText" , "statusText" ] ,
[ "statusMessage" , "statusText" ]
] ) {
Object . defineProperty ( fetchError , key , {
get ( ) {
return ctx . response && ctx . response [ refKey ] ;
}
} ) ;
}
return fetchError ;
}
const payloadMethods = new Set (
Object . freeze ( [ "PATCH" , "POST" , "PUT" , "DELETE" ] )
) ;
function isPayloadMethod ( method = "GET" ) {
return payloadMethods . has ( method . toUpperCase ( ) ) ;
}
function isJSONSerializable ( value ) {
if ( value === void 0 ) {
return false ;
}
const t = typeof value ;
if ( t === "string" || t === "number" || t === "boolean" || t === null ) {
return true ;
}
if ( t !== "object" ) {
return false ;
}
if ( Array . isArray ( value ) ) {
return true ;
}
if ( value . buffer ) {
return false ;
}
return value . constructor && value . constructor . name === "Object" || typeof value . toJSON === "function" ;
}
const textTypes = /* @__PURE__ */ new Set ( [
"image/svg" ,
"application/xml" ,
"application/xhtml" ,
"application/html"
] ) ;
const JSON _RE = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i ;
function detectResponseType ( _contentType = "" ) {
if ( ! _contentType ) {
return "json" ;
}
const contentType = _contentType . split ( ";" ) . shift ( ) || "" ;
if ( JSON _RE . test ( contentType ) ) {
return "json" ;
}
if ( textTypes . has ( contentType ) || contentType . startsWith ( "text/" ) ) {
return "text" ;
}
return "blob" ;
}
function mergeFetchOptions ( input , defaults , Headers = globalThis . Headers ) {
const merged = {
... defaults ,
... input
} ;
if ( defaults ? . params && input ? . params ) {
merged . params = {
... defaults ? . params ,
... input ? . params
} ;
}
if ( defaults ? . query && input ? . query ) {
merged . query = {
... defaults ? . query ,
... input ? . query
} ;
}
if ( defaults ? . headers && input ? . headers ) {
merged . headers = new Headers ( defaults ? . headers || { } ) ;
for ( const [ key , value ] of new Headers ( input ? . headers || { } ) ) {
merged . headers . set ( key , value ) ;
}
}
return merged ;
}
const retryStatusCodes = /* @__PURE__ */ new Set ( [
408 ,
// Request Timeout
409 ,
// Conflict
425 ,
// Too Early
429 ,
// Too Many Requests
500 ,
// Internal Server Error
502 ,
// Bad Gateway
503 ,
// Service Unavailable
504
// Gateway Timeout
] ) ;
const nullBodyResponses = /* @__PURE__ */ new Set ( [ 101 , 204 , 205 , 304 ] ) ;
function createFetch ( globalOptions = { } ) {
const {
fetch = globalThis . fetch ,
Headers = globalThis . Headers ,
AbortController = globalThis . AbortController
} = globalOptions ;
async function onError ( context ) {
const isAbort = context . error && context . error . name === "AbortError" && ! context . options . timeout || false ;
if ( context . options . retry !== false && ! isAbort ) {
let retries ;
if ( typeof context . options . retry === "number" ) {
retries = context . options . retry ;
} else {
retries = isPayloadMethod ( context . options . method ) ? 0 : 1 ;
}
const responseCode = context . response && context . response . status || 500 ;
if ( retries > 0 && ( Array . isArray ( context . options . retryStatusCodes ) ? context . options . retryStatusCodes . includes ( responseCode ) : retryStatusCodes . has ( responseCode ) ) ) {
const retryDelay = context . options . retryDelay || 0 ;
if ( retryDelay > 0 ) {
await new Promise ( ( resolve ) => setTimeout ( resolve , retryDelay ) ) ;
}
return $fetchRaw ( context . request , {
... context . options ,
retry : retries - 1 ,
timeout : context . options . timeout
} ) ;
}
}
const error = createFetchError ( context ) ;
if ( Error . captureStackTrace ) {
Error . captureStackTrace ( error , $fetchRaw ) ;
}
throw error ;
}
const $fetchRaw = async function $fetchRaw2 ( _request , _options = { } ) {
const context = {
request : _request ,
options : mergeFetchOptions ( _options , globalOptions . defaults , Headers ) ,
response : void 0 ,
error : void 0
} ;
context . options . method = context . options . method ? . toUpperCase ( ) ;
if ( context . options . onRequest ) {
await context . options . onRequest ( context ) ;
}
if ( typeof context . request === "string" ) {
if ( context . options . baseURL ) {
context . request = withBase ( context . request , context . options . baseURL ) ;
}
if ( context . options . query || context . options . params ) {
context . request = withQuery ( context . request , {
... context . options . params ,
... context . options . query
} ) ;
}
}
if ( context . options . body && isPayloadMethod ( context . options . method ) ) {
if ( isJSONSerializable ( context . options . body ) ) {
context . options . body = typeof context . options . body === "string" ? context . options . body : JSON . stringify ( context . options . body ) ;
context . options . headers = new Headers ( context . options . headers || { } ) ;
if ( ! context . options . headers . has ( "content-type" ) ) {
context . options . headers . set ( "content-type" , "application/json" ) ;
}
if ( ! context . options . headers . has ( "accept" ) ) {
context . options . headers . set ( "accept" , "application/json" ) ;
}
} else if (
// ReadableStream Body
"pipeTo" in context . options . body && typeof context . options . body . pipeTo === "function" || // Node.js Stream Body
typeof context . options . body . pipe === "function"
) {
if ( ! ( "duplex" in context . options ) ) {
context . options . duplex = "half" ;
}
}
}
if ( ! context . options . signal && context . options . timeout ) {
const controller = new AbortController ( ) ;
setTimeout ( ( ) => controller . abort ( ) , context . options . timeout ) ;
context . options . signal = controller . signal ;
}
try {
context . response = await fetch (
context . request ,
context . options
) ;
} catch ( error ) {
context . error = error ;
if ( context . options . onRequestError ) {
await context . options . onRequestError ( context ) ;
}
return await onError ( context ) ;
}
const hasBody = context . response . body && ! nullBodyResponses . has ( context . response . status ) && context . options . method !== "HEAD" ;
if ( hasBody ) {
const responseType = ( context . options . parseResponse ? "json" : context . options . responseType ) || detectResponseType ( context . response . headers . get ( "content-type" ) || "" ) ;
switch ( responseType ) {
case "json" : {
const data = await context . response . text ( ) ;
const parseFunction = context . options . parseResponse || destr ;
context . response . _data = parseFunction ( data ) ;
break ;
}
case "stream" : {
context . response . _data = context . response . body ;
break ;
}
default : {
context . response . _data = await context . response [ responseType ] ( ) ;
}
}
}
if ( context . options . onResponse ) {
await context . options . onResponse ( context ) ;
}
if ( ! context . options . ignoreResponseError && context . response . status >= 400 && context . response . status < 600 ) {
if ( context . options . onResponseError ) {
await context . options . onResponseError ( context ) ;
}
return await onError ( context ) ;
}
return context . response ;
} ;
const $fetch = async function $fetch2 ( request , options ) {
const r = await $fetchRaw ( request , options ) ;
return r . _data ;
} ;
$fetch . raw = $fetchRaw ;
$fetch . native = ( ... args ) => fetch ( ... args ) ;
$fetch . create = ( defaultOptions = { } ) => createFetch ( {
... globalOptions ,
defaults : {
... globalOptions . defaults ,
... defaultOptions
}
} ) ;
return $fetch ;
}
function createNodeFetch ( ) {
const useKeepAlive = JSON . parse ( process . env . FETCH _KEEP _ALIVE || "false" ) ;
if ( ! useKeepAlive ) {
return l ;
}
const agentOptions = { keepAlive : true } ;
const httpAgent = new http . Agent ( agentOptions ) ;
const httpsAgent = new https . Agent ( agentOptions ) ;
const nodeFetchOptions = {
agent ( parsedURL ) {
return parsedURL . protocol === "http:" ? httpAgent : httpsAgent ;
}
} ;
return function nodeFetchWithKeepAlive ( input , init ) {
return l ( input , { ... nodeFetchOptions , ... init } ) ;
} ;
}
const fetch = globalThis . fetch || createNodeFetch ( ) ;
const Headers$1 = globalThis . Headers || s ;
const AbortController = globalThis . AbortController || i ;
const ofetch = createFetch ( { fetch , Headers : Headers$1 , AbortController } ) ;
const $fetch = ofetch ;
function flatHooks ( configHooks , hooks = { } , parentName ) {
for ( const key in configHooks ) {
const subHook = configHooks [ key ] ;
const name = parentName ? ` ${ parentName } : ${ key } ` : key ;
if ( typeof subHook === "object" && subHook !== null ) {
flatHooks ( subHook , hooks , name ) ;
} else if ( typeof subHook === "function" ) {
hooks [ name ] = subHook ;
}
}
return hooks ;
}
const defaultTask = { run : ( function _ ) => function _ ( ) } ;
const _createTask = ( ) => defaultTask ;
const createTask = typeof console . createTask !== "undefined" ? console . createTask : _createTask ;
function serialTaskCaller ( hooks , args ) {
const name = args . shift ( ) ;
const task = createTask ( name ) ;
return hooks . reduce (
( promise , hookFunction ) => promise . then ( ( ) => task . run ( ( ) => hookFunction ( ... args ) ) ) ,
Promise . resolve ( )
) ;
}
function parallelTaskCaller ( hooks , args ) {
const name = args . shift ( ) ;
const task = createTask ( name ) ;
return Promise . all ( hooks . map ( ( hook ) => task . run ( ( ) => hook ( ... args ) ) ) ) ;
}
function callEachWith ( callbacks , arg0 ) {
for ( const callback of [ ... callbacks ] ) {
callback ( arg0 ) ;
}
}
class Hookable {
constructor ( ) {
this . _hooks = { } ;
this . _before = void 0 ;
this . _after = void 0 ;
this . _deprecatedMessages = void 0 ;
this . _deprecatedHooks = { } ;
this . hook = this . hook . bind ( this ) ;
this . callHook = this . callHook . bind ( this ) ;
this . callHookWith = this . callHookWith . bind ( this ) ;
}
hook ( name , function _ , options = { } ) {
if ( ! name || typeof function _ !== "function" ) {
return ( ) => {
} ;
}
const originalName = name ;
let dep ;
while ( this . _deprecatedHooks [ name ] ) {
dep = this . _deprecatedHooks [ name ] ;
name = dep . to ;
}
if ( dep && ! options . allowDeprecated ) {
let message = dep . message ;
if ( ! message ) {
message = ` ${ originalName } hook has been deprecated ` + ( dep . to ? ` , please use ${ dep . to } ` : "" ) ;
}
if ( ! this . _deprecatedMessages ) {
this . _deprecatedMessages = /* @__PURE__ */ new Set ( ) ;
}
if ( ! this . _deprecatedMessages . has ( message ) ) {
console . warn ( message ) ;
this . _deprecatedMessages . add ( message ) ;
}
}
if ( ! function _ . name ) {
try {
Object . defineProperty ( function _ , "name" , {
get : ( ) => "_" + name . replace ( /\W+/g , "_" ) + "_hook_cb" ,
configurable : true
} ) ;
} catch {
}
}
this . _hooks [ name ] = this . _hooks [ name ] || [ ] ;
this . _hooks [ name ] . push ( function _ ) ;
return ( ) => {
if ( function _ ) {
this . removeHook ( name , function _ ) ;
function _ = void 0 ;
}
} ;
}
hookOnce ( name , function _ ) {
let _unreg ;
let _function = ( ... arguments _ ) => {
if ( typeof _unreg === "function" ) {
_unreg ( ) ;
}
_unreg = void 0 ;
_function = void 0 ;
return function _ ( ... arguments _ ) ;
} ;
_unreg = this . hook ( name , _function ) ;
return _unreg ;
}
removeHook ( name , function _ ) {
if ( this . _hooks [ name ] ) {
const index = this . _hooks [ name ] . indexOf ( function _ ) ;
if ( index !== - 1 ) {
this . _hooks [ name ] . splice ( index , 1 ) ;
}
if ( this . _hooks [ name ] . length === 0 ) {
delete this . _hooks [ name ] ;
}
}
}
deprecateHook ( name , deprecated ) {
this . _deprecatedHooks [ name ] = typeof deprecated === "string" ? { to : deprecated } : deprecated ;
const _hooks = this . _hooks [ name ] || [ ] ;
delete this . _hooks [ name ] ;
for ( const hook of _hooks ) {
this . hook ( name , hook ) ;
}
}
deprecateHooks ( deprecatedHooks ) {
Object . assign ( this . _deprecatedHooks , deprecatedHooks ) ;
for ( const name in deprecatedHooks ) {
this . deprecateHook ( name , deprecatedHooks [ name ] ) ;
}
}
addHooks ( configHooks ) {
const hooks = flatHooks ( configHooks ) ;
const removeFns = Object . keys ( hooks ) . map (
( key ) => this . hook ( key , hooks [ key ] )
) ;
return ( ) => {
for ( const unreg of removeFns . splice ( 0 , removeFns . length ) ) {
unreg ( ) ;
}
} ;
}
removeHooks ( configHooks ) {
const hooks = flatHooks ( configHooks ) ;
for ( const key in hooks ) {
this . removeHook ( key , hooks [ key ] ) ;
}
}
removeAllHooks ( ) {
for ( const key in this . _hooks ) {
delete this . _hooks [ key ] ;
}
}
callHook ( name , ... arguments _ ) {
arguments _ . unshift ( name ) ;
return this . callHookWith ( serialTaskCaller , name , ... arguments _ ) ;
}
callHookParallel ( name , ... arguments _ ) {
arguments _ . unshift ( name ) ;
return this . callHookWith ( parallelTaskCaller , name , ... arguments _ ) ;
}
callHookWith ( caller , name , ... arguments _ ) {
const event = this . _before || this . _after ? { name , args : arguments _ , context : { } } : void 0 ;
if ( this . _before ) {
callEachWith ( this . _before , event ) ;
}
const result = caller (
name in this . _hooks ? [ ... this . _hooks [ name ] ] : [ ] ,
arguments _
) ;
if ( result instanceof Promise ) {
return result . finally ( ( ) => {
if ( this . _after && event ) {
callEachWith ( this . _after , event ) ;
}
} ) ;
}
if ( this . _after && event ) {
callEachWith ( this . _after , event ) ;
}
return result ;
}
beforeEach ( function _ ) {
this . _before = this . _before || [ ] ;
this . _before . push ( function _ ) ;
return ( ) => {
if ( this . _before !== void 0 ) {
const index = this . _before . indexOf ( function _ ) ;
if ( index !== - 1 ) {
this . _before . splice ( index , 1 ) ;
}
}
} ;
}
afterEach ( function _ ) {
this . _after = this . _after || [ ] ;
this . _after . push ( function _ ) ;
return ( ) => {
if ( this . _after !== void 0 ) {
const index = this . _after . indexOf ( function _ ) ;
if ( index !== - 1 ) {
this . _after . splice ( index , 1 ) ;
}
}
} ;
}
}
function createHooks ( ) {
return new Hookable ( ) ;
}
2024-01-25 19:29:12 +08:00
function createContext$1 ( opts = { } ) {
let currentInstance ;
let isSingleton = false ;
const checkConflict = ( instance ) => {
if ( currentInstance && currentInstance !== instance ) {
throw new Error ( "Context conflict" ) ;
}
} ;
let als ;
if ( opts . asyncContext ) {
const _AsyncLocalStorage = opts . AsyncLocalStorage || globalThis . AsyncLocalStorage ;
if ( _AsyncLocalStorage ) {
als = new _AsyncLocalStorage ( ) ;
} else {
console . warn ( "[unctx] `AsyncLocalStorage` is not provided." ) ;
}
}
const _getCurrentInstance = ( ) => {
if ( als && currentInstance === void 0 ) {
const instance = als . getStore ( ) ;
if ( instance !== void 0 ) {
return instance ;
}
}
return currentInstance ;
} ;
return {
use : ( ) => {
const _instance = _getCurrentInstance ( ) ;
if ( _instance === void 0 ) {
throw new Error ( "Context is not available" ) ;
}
return _instance ;
} ,
tryUse : ( ) => {
return _getCurrentInstance ( ) ;
} ,
set : ( instance , replace ) => {
if ( ! replace ) {
checkConflict ( instance ) ;
}
currentInstance = instance ;
isSingleton = true ;
} ,
unset : ( ) => {
currentInstance = void 0 ;
isSingleton = false ;
} ,
call : ( instance , callback ) => {
checkConflict ( instance ) ;
currentInstance = instance ;
try {
return als ? als . run ( instance , callback ) : callback ( ) ;
} finally {
if ( ! isSingleton ) {
currentInstance = void 0 ;
}
}
} ,
async callAsync ( instance , callback ) {
currentInstance = instance ;
const onRestore = ( ) => {
currentInstance = instance ;
} ;
const onLeave = ( ) => currentInstance === instance ? onRestore : void 0 ;
asyncHandlers$1 . add ( onLeave ) ;
try {
const r = als ? als . run ( instance , callback ) : callback ( ) ;
if ( ! isSingleton ) {
currentInstance = void 0 ;
}
return await r ;
} finally {
asyncHandlers$1 . delete ( onLeave ) ;
}
}
} ;
}
function createNamespace$1 ( defaultOpts = { } ) {
const contexts = { } ;
return {
get ( key , opts = { } ) {
if ( ! contexts [ key ] ) {
contexts [ key ] = createContext$1 ( { ... defaultOpts , ... opts } ) ;
}
contexts [ key ] ;
return contexts [ key ] ;
}
} ;
}
const _globalThis$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : { } ;
const globalKey$2 = "__unctx__" ;
const defaultNamespace$1 = _globalThis$1 [ globalKey$2 ] || ( _globalThis$1 [ globalKey$2 ] = createNamespace$1 ( ) ) ;
const getContext = ( key , opts = { } ) => defaultNamespace$1 . get ( key , opts ) ;
const asyncHandlersKey$1 = "__unctx_async_handlers__" ;
const asyncHandlers$1 = _globalThis$1 [ asyncHandlersKey$1 ] || ( _globalThis$1 [ asyncHandlersKey$1 ] = /* @__PURE__ */ new Set ( ) ) ;
2024-01-26 11:09:20 +08:00
function hasProp ( obj , prop ) {
try {
return prop in obj ;
} catch {
return false ;
}
}
var _ _defProp$1 = Object . defineProperty ;
var _ _defNormalProp$1 = ( obj , key , value ) => key in obj ? _ _defProp$1 ( obj , key , { enumerable : true , configurable : true , writable : true , value } ) : obj [ key ] = value ;
var _ _publicField$1 = ( obj , key , value ) => {
_ _defNormalProp$1 ( obj , typeof key !== "symbol" ? key + "" : key , value ) ;
return value ;
} ;
class H3Error extends Error {
constructor ( message , opts = { } ) {
super ( message , opts ) ;
_ _publicField$1 ( this , "statusCode" , 500 ) ;
_ _publicField$1 ( this , "fatal" , false ) ;
_ _publicField$1 ( this , "unhandled" , false ) ;
_ _publicField$1 ( this , "statusMessage" ) ;
_ _publicField$1 ( this , "data" ) ;
_ _publicField$1 ( this , "cause" ) ;
if ( opts . cause && ! this . cause ) {
this . cause = opts . cause ;
}
}
toJSON ( ) {
const obj = {
message : this . message ,
statusCode : sanitizeStatusCode ( this . statusCode , 500 )
} ;
if ( this . statusMessage ) {
obj . statusMessage = sanitizeStatusMessage ( this . statusMessage ) ;
}
if ( this . data !== void 0 ) {
obj . data = this . data ;
}
return obj ;
}
}
_ _publicField$1 ( H3Error , "__h3_error__" , true ) ;
function createError$1 ( input ) {
if ( typeof input === "string" ) {
return new H3Error ( input ) ;
}
if ( isError ( input ) ) {
return input ;
}
const err = new H3Error ( input . message ? ? input . statusMessage ? ? "" , {
cause : input . cause || input
} ) ;
if ( hasProp ( input , "stack" ) ) {
try {
Object . defineProperty ( err , "stack" , {
get ( ) {
return input . stack ;
}
} ) ;
} catch {
try {
err . stack = input . stack ;
} catch {
}
}
}
if ( input . data ) {
err . data = input . data ;
}
if ( input . statusCode ) {
err . statusCode = sanitizeStatusCode ( input . statusCode , err . statusCode ) ;
} else if ( input . status ) {
err . statusCode = sanitizeStatusCode ( input . status , err . statusCode ) ;
}
if ( input . statusMessage ) {
err . statusMessage = input . statusMessage ;
} else if ( input . statusText ) {
err . statusMessage = input . statusText ;
}
if ( err . statusMessage ) {
const originalMessage = err . statusMessage ;
const sanitizedMessage = sanitizeStatusMessage ( err . statusMessage ) ;
if ( sanitizedMessage !== originalMessage ) {
console . warn (
"[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default."
) ;
}
}
if ( input . fatal !== void 0 ) {
err . fatal = input . fatal ;
}
if ( input . unhandled !== void 0 ) {
err . unhandled = input . unhandled ;
}
return err ;
}
function isError ( input ) {
return input ? . constructor ? . _ _h3 _error _ _ === true ;
}
const DISALLOWED _STATUS _CHARS = /[^\u0009\u0020-\u007E]/g ;
function sanitizeStatusMessage ( statusMessage = "" ) {
return statusMessage . replace ( DISALLOWED _STATUS _CHARS , "" ) ;
}
function sanitizeStatusCode ( statusCode , defaultStatusCode = 200 ) {
if ( ! statusCode ) {
return defaultStatusCode ;
}
if ( typeof statusCode === "string" ) {
statusCode = Number . parseInt ( statusCode , 10 ) ;
}
if ( statusCode < 100 || statusCode > 999 ) {
return defaultStatusCode ;
}
return statusCode ;
}
typeof setImmediate === "undefined" ? ( fn ) => fn ( ) : setImmediate ;
2024-01-25 19:29:12 +08:00
const appConfig = useRuntimeConfig$1 ( ) . app ;
const baseURL = ( ) => appConfig . baseURL ;
if ( ! globalThis . $fetch ) {
globalThis . $fetch = $fetch . create ( {
baseURL : baseURL ( )
} ) ;
}
const nuxtAppCtx = /* @__PURE__ */ getContext ( "nuxt-app" , {
asyncContext : false
} ) ;
const NuxtPluginIndicator = "__nuxt_plugin" ;
function createNuxtApp ( options ) {
let hydratingCount = 0 ;
const nuxtApp = {
_scope : effectScope ( ) ,
provide : void 0 ,
globalName : "nuxt" ,
versions : {
get nuxt ( ) {
2024-01-26 11:09:20 +08:00
return "3.9.3" ;
2024-01-25 19:29:12 +08:00
} ,
get vue ( ) {
return nuxtApp . vueApp . version ;
}
} ,
payload : reactive ( {
data : { } ,
state : { } ,
once : /* @__PURE__ */ new Set ( ) ,
_errors : { } ,
... { serverRendered : true }
} ) ,
static : {
data : { }
} ,
runWithContext : ( fn ) => nuxtApp . _scope . run ( ( ) => 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 : { } ,
_payloadRevivers : { } ,
... options
} ;
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 ) ;
{
if ( nuxtApp . ssrContext ) {
nuxtApp . ssrContext . nuxt = nuxtApp ;
nuxtApp . ssrContext . _payloadReducers = { } ;
nuxtApp . payload . path = nuxtApp . ssrContext . url ;
}
nuxtApp . ssrContext = nuxtApp . ssrContext || { } ;
if ( nuxtApp . ssrContext . payload ) {
Object . assign ( nuxtApp . payload , nuxtApp . ssrContext . payload ) ;
}
nuxtApp . ssrContext . payload = nuxtApp . payload ;
nuxtApp . ssrContext . config = {
public : options . ssrContext . runtimeConfig . public ,
app : options . ssrContext . runtimeConfig . app
} ;
}
const runtimeConfig = options . ssrContext . runtimeConfig ;
nuxtApp . provide ( "config" , runtimeConfig ) ;
return nuxtApp ;
}
async function applyPlugin ( nuxtApp , plugin2 ) {
if ( plugin2 . hooks ) {
nuxtApp . hooks . addHooks ( plugin2 . hooks ) ;
}
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 ) {
var _a , _b ;
const resolvedPlugins = [ ] ;
const unresolvedPlugins = [ ] ;
const parallels = [ ] ;
const errors = [ ] ;
let promiseDepth = 0 ;
async function executePlugin ( plugin2 ) {
if ( plugin2 . dependsOn && ! plugin2 . dependsOn . every ( ( name ) => resolvedPlugins . includes ( name ) ) ) {
unresolvedPlugins . push ( [ new Set ( plugin2 . dependsOn ) , plugin2 ] ) ;
} else {
const promise = applyPlugin ( nuxtApp , plugin2 ) . then ( async ( ) => {
if ( plugin2 . _name ) {
resolvedPlugins . push ( 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 ) ;
}
}
} ) ) ;
}
} ) ;
if ( plugin2 . parallel ) {
parallels . push ( promise . catch ( ( e ) => errors . push ( e ) ) ) ;
} else {
await promise ;
}
}
}
for ( const plugin2 of plugins2 ) {
if ( ( ( _a = nuxtApp . ssrContext ) == null ? void 0 : _a . islandContext ) && ( ( _b = plugin2 . env ) == null ? void 0 : _b . islands ) === false ) {
continue ;
}
await executePlugin ( plugin2 ) ;
}
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 ( 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 } ) ;
}
function callWithNuxt ( nuxt , setup , args ) {
const fn = ( ) => args ? setup ( ... args ) : setup ( ) ;
{
return nuxt . vueApp . runWithContext ( ( ) => nuxtAppCtx . callAsync ( nuxt , fn ) ) ;
}
}
// @__NO_SIDE_EFFECTS__
function useNuxtApp ( ) {
var _a ;
let nuxtAppInstance ;
if ( hasInjectionContext ( ) ) {
nuxtAppInstance = ( _a = getCurrentInstance ( ) ) == null ? void 0 : _a . appContext . app . $nuxt ;
}
nuxtAppInstance = nuxtAppInstance || nuxtAppCtx . tryUse ( ) ;
if ( ! nuxtAppInstance ) {
{
throw new Error ( "[nuxt] instance unavailable" ) ;
}
}
return nuxtAppInstance ;
}
// @__NO_SIDE_EFFECTS__
function useRuntimeConfig ( ) {
return ( /* @__PURE__ */ useNuxtApp ( ) ) . $config ;
}
function defineGetter ( obj , key , val ) {
Object . defineProperty ( obj , key , { get : ( ) => val } ) ;
}
version . startsWith ( "3" ) ;
function resolveUnref ( r ) {
return typeof r === "function" ? r ( ) : unref ( r ) ;
}
function resolveUnrefHeadInput ( ref2 , lastKey = "" ) {
if ( ref2 instanceof Promise )
return ref2 ;
const root = resolveUnref ( ref2 ) ;
if ( ! ref2 || ! root )
return root ;
if ( Array . isArray ( root ) )
return root . map ( ( r ) => resolveUnrefHeadInput ( r , lastKey ) ) ;
if ( typeof root === "object" ) {
return Object . fromEntries (
Object . entries ( root ) . map ( ( [ k , v ] ) => {
if ( k === "titleTemplate" || k . startsWith ( "on" ) )
return [ k , unref ( v ) ] ;
return [ k , resolveUnrefHeadInput ( v , k ) ] ;
} )
) ;
}
return root ;
}
defineHeadPlugin ( {
hooks : {
"entries:resolve" : function ( ctx ) {
for ( const entry2 of ctx . entries )
entry2 . resolvedInput = resolveUnrefHeadInput ( entry2 . input ) ;
}
}
} ) ;
const headSymbol = "usehead" ;
const _global = typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : { } ;
const globalKey$1 = "__unhead_injection_handler__" ;
function setHeadInjectionHandler ( handler ) {
_global [ globalKey$1 ] = handler ;
}
function injectHead ( ) {
if ( globalKey$1 in _global ) {
return _global [ globalKey$1 ] ( ) ;
}
const head = inject ( headSymbol ) ;
if ( ! head && "production" !== "production" )
console . warn ( "Unhead is missing Vue context, falling back to shared context. This may have unexpected results." ) ;
return head || getActiveHead ( ) ;
}
2024-01-26 11:09:20 +08:00
const unhead _JC77S3HdgF = /* @__PURE__ */ defineNuxtPlugin ( {
2024-01-25 19:29:12 +08:00
name : "nuxt:head" ,
enforce : "pre" ,
setup ( nuxtApp ) {
const head = nuxtApp . ssrContext . head ;
setHeadInjectionHandler (
// need a fresh instance of the nuxt app to avoid parallel requests interfering with each other
( ) => ( /* @__PURE__ */ useNuxtApp ( ) ) . vueApp . _context . provides . usehead
) ;
nuxtApp . vueApp . use ( head ) ;
}
} ) ;
function createContext ( opts = { } ) {
let currentInstance ;
let isSingleton = false ;
const checkConflict = ( instance ) => {
if ( currentInstance && currentInstance !== instance ) {
throw new Error ( "Context conflict" ) ;
}
} ;
let als ;
if ( opts . asyncContext ) {
const _AsyncLocalStorage = opts . AsyncLocalStorage || globalThis . AsyncLocalStorage ;
if ( _AsyncLocalStorage ) {
als = new _AsyncLocalStorage ( ) ;
} else {
console . warn ( "[unctx] `AsyncLocalStorage` is not provided." ) ;
}
}
const _getCurrentInstance = ( ) => {
if ( als && currentInstance === void 0 ) {
const instance = als . getStore ( ) ;
if ( instance !== void 0 ) {
return instance ;
}
}
return currentInstance ;
} ;
return {
use : ( ) => {
const _instance = _getCurrentInstance ( ) ;
if ( _instance === void 0 ) {
throw new Error ( "Context is not available" ) ;
}
return _instance ;
} ,
tryUse : ( ) => {
return _getCurrentInstance ( ) ;
} ,
set : ( instance , replace ) => {
if ( ! replace ) {
checkConflict ( instance ) ;
}
currentInstance = instance ;
isSingleton = true ;
} ,
unset : ( ) => {
currentInstance = void 0 ;
isSingleton = false ;
} ,
call : ( instance , callback ) => {
checkConflict ( instance ) ;
currentInstance = instance ;
try {
return als ? als . run ( instance , callback ) : callback ( ) ;
} finally {
if ( ! isSingleton ) {
currentInstance = void 0 ;
}
}
} ,
async callAsync ( instance , callback ) {
currentInstance = instance ;
const onRestore = ( ) => {
currentInstance = instance ;
} ;
const onLeave = ( ) => currentInstance === instance ? onRestore : void 0 ;
asyncHandlers . add ( onLeave ) ;
try {
const r = als ? als . run ( instance , callback ) : callback ( ) ;
if ( ! isSingleton ) {
currentInstance = void 0 ;
}
return await r ;
} finally {
asyncHandlers . delete ( onLeave ) ;
}
}
} ;
}
function createNamespace ( defaultOpts = { } ) {
const contexts = { } ;
return {
get ( key , opts = { } ) {
if ( ! contexts [ key ] ) {
contexts [ key ] = createContext ( { ... defaultOpts , ... opts } ) ;
}
contexts [ key ] ;
return contexts [ key ] ;
}
} ;
}
const _globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : { } ;
const globalKey = "__unctx__" ;
_globalThis [ globalKey ] || ( _globalThis [ globalKey ] = createNamespace ( ) ) ;
const asyncHandlersKey = "__unctx_async_handlers__" ;
const asyncHandlers = _globalThis [ asyncHandlersKey ] || ( _globalThis [ asyncHandlersKey ] = /* @__PURE__ */ new Set ( ) ) ;
function executeAsync ( function _ ) {
const restores = [ ] ;
for ( const leaveHandler of asyncHandlers ) {
const restore2 = leaveHandler ( ) ;
if ( restore2 ) {
restores . push ( restore2 ) ;
}
}
const restore = ( ) => {
for ( const restore2 of restores ) {
restore2 ( ) ;
}
} ;
let awaitable = function _ ( ) ;
if ( awaitable && typeof awaitable === "object" && "catch" in awaitable ) {
awaitable = awaitable . catch ( ( error ) => {
restore ( ) ;
throw error ;
} ) ;
}
return [ awaitable , restore ] ;
}
function toArray ( value ) {
return Array . isArray ( value ) ? value : [ value ] ;
}
const PageRouteSymbol = Symbol ( "route" ) ;
const useRouter = ( ) => {
var _a ;
return ( _a = /* @__PURE__ */ useNuxtApp ( ) ) == null ? void 0 : _a . $router ;
} ;
const useRoute = ( ) => {
if ( hasInjectionContext ( ) ) {
return inject ( PageRouteSymbol , ( /* @__PURE__ */ useNuxtApp ( ) ) . _route ) ;
}
return ( /* @__PURE__ */ useNuxtApp ( ) ) . _route ;
} ;
// @__NO_SIDE_EFFECTS__
function defineNuxtRouteMiddleware ( middleware ) {
return middleware ;
}
const isProcessingMiddleware = ( ) => {
try {
if ( ( /* @__PURE__ */ useNuxtApp ( ) ) . _processingMiddleware ) {
return true ;
}
} catch {
return true ;
}
return false ;
} ;
const navigateTo = ( to , options ) => {
if ( ! to ) {
to = "/" ;
}
const toPath = typeof to === "string" ? to : withQuery ( to . path || "/" , to . query || { } ) + ( to . hash || "" ) ;
if ( options == null ? void 0 : options . open ) {
return Promise . resolve ( ) ;
}
const isExternal = ( options == null ? void 0 : options . external ) || hasProtocol ( toPath , { acceptRelative : true } ) ;
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 = parseURL ( toPath ) . protocol ;
if ( protocol && isScriptProtocol ( protocol ) ) {
throw new Error ( ` Cannot navigate to a URL with ' ${ protocol } ' protocol. ` ) ;
}
}
const inMiddleware = isProcessingMiddleware ( ) ;
const router = useRouter ( ) ;
const nuxtApp = /* @__PURE__ */ 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 encodedLoc = location2 . replace ( /"/g , "%22" ) ;
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 : location2 }
} ;
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 ) ;
} ;
const NUXT _ERROR _SIGNATURE = "__nuxt_error" ;
const useError = ( ) => toRef ( ( /* @__PURE__ */ useNuxtApp ( ) ) . payload , "error" ) ;
const showError = ( error ) => {
const nuxtError = createError ( error ) ;
try {
const nuxtApp = /* @__PURE__ */ 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 _routes = [
{
name : "details-id" ,
path : "/details/:id()" ,
meta : { } ,
alias : [ ] ,
redirect : void 0 ,
2024-01-26 11:09:20 +08:00
component : ( ) => import ( './_nuxt/_id_-jwzT-v7D.mjs' ) . then ( ( m ) => m . default || m )
2024-01-25 19:29:12 +08:00
} ,
{
name : "index.html" ,
path : "/index.html" ,
meta : { } ,
alias : [ ] ,
redirect : void 0 ,
2024-01-26 11:09:20 +08:00
component : ( ) => import ( './_nuxt/index-l-eoi1sO.mjs' ) . then ( ( m ) => m . default || m )
2024-01-25 19:29:12 +08:00
} ,
{
name : "index" ,
path : "/" ,
meta : { } ,
alias : [ ] ,
redirect : void 0 ,
2024-01-26 11:09:20 +08:00
component : ( ) => import ( './_nuxt/index-OxdLOzQ1.mjs' ) . then ( ( m ) => m . default || m )
2024-01-25 19:29:12 +08:00
} ,
{
name : "publish" ,
path : "/publish" ,
meta : { } ,
alias : [ ] ,
redirect : void 0 ,
2024-01-26 11:09:20 +08:00
component : ( ) => import ( './_nuxt/index-KWoBhoAf.mjs' ) . then ( ( m ) => m . default || m )
2024-01-25 19:29:12 +08:00
}
] ;
function generateRouteKey ( route ) {
const source = ( route == null ? void 0 : route . meta . key ) ? ? route . path . replace ( /(:\w+)\([^)]+\)/g , "$1" ) . replace ( /(:\w+)[?+*]/g , "$1" ) . replace ( /:\w+/g , ( 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 ) {
2024-01-26 11:09:20 +08:00
if ( to === from || from === START _LOCATION ) {
2024-01-25 19:29:12 +08:00
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 appPageTransition = false ;
const nuxtLinkDefaults = { "componentName" : "NuxtLink" } ;
const routerOptions0 = {
scrollBehavior ( to , from , savedPosition ) {
var _a ;
const nuxtApp = /* @__PURE__ */ 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 } ;
}
}
const hasTransition = ( route ) => ! ! ( route . meta . pageTransition ? ? appPageTransition ) ;
const hookToWait = hasTransition ( from ) && hasTransition ( to ) ? "page:transition:finish" : "page:finish" ;
return new Promise ( ( resolve ) => {
nuxtApp . hooks . hookOnce ( hookToWait , async ( ) => {
await nextTick ( ) ;
if ( to . hash ) {
position = { el : to . hash , top : _getHashElementScrollMarginTop ( to . hash ) , behavior } ;
}
resolve ( position ) ;
} ) ;
} ) ;
}
} ;
function _getHashElementScrollMarginTop ( selector ) {
try {
const elem = ( void 0 ) . querySelector ( selector ) ;
if ( elem ) {
return parseFloat ( getComputedStyle ( elem ) . scrollMarginTop ) ;
}
} catch {
}
return 0 ;
}
const configRouterOptions = {
hashMode : false ,
scrollBehaviorType : "auto"
} ;
const routerOptions = {
... configRouterOptions ,
... routerOptions0
} ;
const validate = /* @__PURE__ */ defineNuxtRouteMiddleware ( async ( to ) => {
var _a ;
let _ _temp , _ _restore ;
if ( ! ( ( _a = to . meta ) == null ? void 0 : _a . validate ) ) {
return ;
}
useRouter ( ) ;
const result = ( [ _ _temp , _ _restore ] = executeAsync ( ( ) => Promise . resolve ( to . meta . validate ( to ) ) ) , _ _temp = await _ _temp , _ _restore ( ) , _ _temp ) ;
if ( result === true ) {
return ;
}
{
return result ;
}
} ) ;
const manifest _45route _45rule = /* @__PURE__ */ defineNuxtRouteMiddleware ( async ( to ) => {
{
return ;
}
} ) ;
const globalMiddleware = [
validate ,
manifest _45route _45rule
] ;
const namedMiddleware = { } ;
const plugin = /* @__PURE__ */ defineNuxtPlugin ( {
name : "nuxt:router" ,
enforce : "pre" ,
async setup ( nuxtApp ) {
var _a , _b , _c ;
let _ _temp , _ _restore ;
let routerBase = ( /* @__PURE__ */ useRuntimeConfig ( ) ) . app . baseURL ;
if ( routerOptions . hashMode && ! routerBase . includes ( "#" ) ) {
routerBase += "#" ;
}
const history = ( ( _a = routerOptions . history ) == null ? void 0 : _a . call ( routerOptions , routerBase ) ) ? ? createMemoryHistory ( routerBase ) ;
const routes = ( ( _b = routerOptions . routes ) == null ? void 0 : _b . call ( routerOptions , _routes ) ) ? ? _routes ;
let startPosition ;
const initialURL = nuxtApp . ssrContext . url ;
const router = createRouter ( {
... routerOptions ,
scrollBehavior : ( to , from , savedPosition ) => {
var _a2 ;
if ( from === START _LOCATION ) {
startPosition = savedPosition ;
return ;
}
router . options . scrollBehavior = routerOptions . scrollBehavior ;
return ( _a2 = routerOptions . scrollBehavior ) == null ? void 0 : _a2 . call ( routerOptions , 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 _route = shallowRef ( router . resolve ( initialURL ) ) ;
const syncCurrentRoute = ( ) => {
_route . value = router . currentRoute . value ;
} ;
nuxtApp . hook ( "page:finish" , syncCurrentRoute ) ;
router . afterEach ( ( to , from ) => {
var _a2 , _b2 , _c2 , _d ;
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 ) ) {
syncCurrentRoute ( ) ;
}
} ) ;
const route = { } ;
for ( const key in _route . value ) {
Object . defineProperty ( route , key , {
get : ( ) => _route . value [ key ]
} ) ;
}
nuxtApp . _route = shallowReactive ( route ) ;
nuxtApp . _middleware = nuxtApp . _middleware || {
global : [ ] ,
named : { }
} ;
useError ( ) ;
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 ( ) ;
}
if ( ( _c = nuxtApp . ssrContext ) == null ? void 0 : _c . islandContext ) {
return { provide : { router } } ;
}
const initialLayout = nuxtApp . payload . state . _layout ;
router . beforeEach ( async ( to , from ) => {
var _a2 , _b2 ;
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 entry2 of toArray ( componentMiddleware ) ) {
middlewareEntries . add ( entry2 ) ;
}
}
for ( const entry2 of middlewareEntries ) {
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 ;
if ( ! middleware ) {
throw new Error ( ` Unknown route middleware: ' ${ entry2 } '. ` ) ;
}
const result = await nuxtApp . runWithContext ( ( ) => middleware ( to , from ) ) ;
{
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 || result === false ) {
return result ;
}
}
}
} ) ;
router . onError ( async ( ) => {
delete nuxtApp . _processingMiddleware ;
await nuxtApp . callHook ( "page:loading:end" ) ;
} ) ;
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 . matched . length === 0 ) {
await nuxtApp . runWithContext ( ( ) => showError ( createError$1 ( {
statusCode : 404 ,
fatal : false ,
statusMessage : ` Page not found: ${ to . fullPath } ` ,
data : {
path : to . fullPath
}
} ) ) ) ;
} else if ( to . redirectedFrom && to . fullPath !== initialURL ) {
await nuxtApp . runWithContext ( ( ) => navigateTo ( to . fullPath || "/" ) ) ;
}
} ) ;
nuxtApp . hooks . hookOnce ( "app:created" , async ( ) => {
try {
await router . replace ( {
... router . resolve ( initialURL ) ,
name : void 0 ,
// #4920, #4982
force : true
} ) ;
router . options . scrollBehavior = routerOptions . scrollBehavior ;
} catch ( error2 ) {
await nuxtApp . runWithContext ( ( ) => showError ( error2 ) ) ;
}
} ) ;
return { provide : { router } } ;
}
} ) ;
function definePayloadReducer ( name , reduce ) {
{
( /* @__PURE__ */ 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 )
} ;
2024-01-26 11:09:20 +08:00
const revive _payload _server _ncE5z6iePW = /* @__PURE__ */ defineNuxtPlugin ( {
2024-01-25 19:29:12 +08:00
name : "nuxt:revive-payload:server" ,
setup ( ) {
for ( const reducer in reducers ) {
definePayloadReducer ( reducer , reducers [ reducer ] ) ;
}
}
} ) ;
const components _plugin _KR1HBZs4kY = /* @__PURE__ */ defineNuxtPlugin ( {
name : "nuxt:global-components"
} ) ;
const element _plus _teleports _plugin _h4Dmekbj62 = /* @__PURE__ */ defineNuxtPlugin ( ( nuxtApp ) => {
nuxtApp . hook ( "app:rendered" , ( ctx ) => {
var _a ;
if ( ( _a = ctx . ssrContext ) == null ? void 0 : _a . teleports ) {
ctx . ssrContext . teleports = renderTeleports ( ctx . ssrContext . teleports ) ;
}
} ) ;
} ) ;
function renderTeleports ( teleports ) {
const body = Object . entries ( teleports ) . reduce ( ( all , [ key , value ] ) => {
if ( key . startsWith ( "#el-popper-container-" ) || [ ] . includes ( key ) ) {
return ` ${ all } <div id=" ${ key . slice ( 1 ) } "> ${ value } </div> ` ;
}
return all ;
} , teleports . body || "" ) ;
return { ... teleports , body } ;
}
class ElementPlusError extends Error {
constructor ( m ) {
super ( m ) ;
this . name = "ElementPlusError" ;
}
}
function throwError ( scope , m ) {
throw new ElementPlusError ( ` [ ${ scope } ] ${ m } ` ) ;
}
function debugWarn ( scope , message ) {
}
const defaultNamespace = "el" ;
const statePrefix = "is-" ;
const _bem = ( namespace , block , blockSuffix , element , modifier ) => {
let cls = ` ${ namespace } - ${ block } ` ;
if ( blockSuffix ) {
cls += ` - ${ blockSuffix } ` ;
}
if ( element ) {
cls += ` __ ${ element } ` ;
}
if ( modifier ) {
cls += ` -- ${ modifier } ` ;
}
return cls ;
} ;
const namespaceContextKey = Symbol ( "namespaceContextKey" ) ;
const useGetDerivedNamespace = ( namespaceOverrides ) => {
const derivedNamespace = namespaceOverrides || ( getCurrentInstance ( ) ? inject ( namespaceContextKey , ref ( defaultNamespace ) ) : ref ( defaultNamespace ) ) ;
const namespace = computed ( ( ) => {
return unref ( derivedNamespace ) || defaultNamespace ;
} ) ;
return namespace ;
} ;
const useNamespace = ( block , namespaceOverrides ) => {
const namespace = useGetDerivedNamespace ( namespaceOverrides ) ;
const b = ( blockSuffix = "" ) => _bem ( namespace . value , block , blockSuffix , "" , "" ) ;
const e = ( element ) => element ? _bem ( namespace . value , block , "" , element , "" ) : "" ;
const m = ( modifier ) => modifier ? _bem ( namespace . value , block , "" , "" , modifier ) : "" ;
const be = ( blockSuffix , element ) => blockSuffix && element ? _bem ( namespace . value , block , blockSuffix , element , "" ) : "" ;
const em = ( element , modifier ) => element && modifier ? _bem ( namespace . value , block , "" , element , modifier ) : "" ;
const bm = ( blockSuffix , modifier ) => blockSuffix && modifier ? _bem ( namespace . value , block , blockSuffix , "" , modifier ) : "" ;
const bem = ( blockSuffix , element , modifier ) => blockSuffix && element && modifier ? _bem ( namespace . value , block , blockSuffix , element , modifier ) : "" ;
const is = ( name , ... args ) => {
const state = args . length >= 1 ? args [ 0 ] : true ;
return name && state ? ` ${ statePrefix } ${ name } ` : "" ;
} ;
const cssVar = ( object ) => {
const styles = { } ;
for ( const key in object ) {
if ( object [ key ] ) {
styles [ ` -- ${ namespace . value } - ${ key } ` ] = object [ key ] ;
}
}
return styles ;
} ;
const cssVarBlock = ( object ) => {
const styles = { } ;
for ( const key in object ) {
if ( object [ key ] ) {
styles [ ` -- ${ namespace . value } - ${ block } - ${ key } ` ] = object [ key ] ;
}
}
return styles ;
} ;
const cssVarName = ( name ) => ` -- ${ namespace . value } - ${ name } ` ;
const cssVarBlockName = ( name ) => ` -- ${ namespace . value } - ${ block } - ${ name } ` ;
return {
namespace ,
b ,
e ,
m ,
be ,
em ,
bm ,
bem ,
is ,
cssVar ,
cssVarName ,
cssVarBlock ,
cssVarBlockName
} ;
} ;
const defaultIdInjection = {
prefix : Math . floor ( Math . random ( ) * 1e4 ) ,
current : 0
} ;
const ID _INJECTION _KEY = Symbol ( "elIdInjection" ) ;
const useIdInjection = ( ) => {
return getCurrentInstance ( ) ? inject ( ID _INJECTION _KEY , defaultIdInjection ) : defaultIdInjection ;
} ;
const useId = ( deterministicId ) => {
const idInjection = useIdInjection ( ) ;
const namespace = useGetDerivedNamespace ( ) ;
const idRef = computed ( ( ) => unref ( deterministicId ) || ` ${ namespace . value } -id- ${ idInjection . prefix } - ${ idInjection . current ++ } ` ) ;
return idRef ;
} ;
const element _plus _injection _plugin _1RNPi6ogby = /* @__PURE__ */ defineNuxtPlugin ( ( nuxtApp ) => {
nuxtApp . vueApp . provide ( ID _INJECTION _KEY , { "prefix" : 1024 , "current" : 0 } ) ;
} ) ;
const plugins = [
2024-01-26 11:09:20 +08:00
unhead _JC77S3HdgF ,
2024-01-25 19:29:12 +08:00
plugin ,
2024-01-26 11:09:20 +08:00
revive _payload _server _ncE5z6iePW ,
2024-01-25 19:29:12 +08:00
components _plugin _KR1HBZs4kY ,
element _plus _teleports _plugin _h4Dmekbj62 ,
element _plus _injection _plugin _1RNPi6ogby
] ;
const _sfc _main$2 = {
_ _name : "app" ,
_ _ssrInlineRender : true ,
setup ( _ _props ) {
useRoute ( ) ;
let isNeedLogin = ref ( true ) ;
let userInfoWin = ref ( { } ) ;
provide ( "userInfoWin" , userInfoWin ) ;
const goLogin = ( ) => {
return ;
} ;
provide ( "isNeedLogin" , isNeedLogin ) ;
provide ( "goLogin" , goLogin ) ;
return ( _ctx , _push , _parent , _attrs ) => {
const _component _RouterView = resolveComponent ( "RouterView" ) ;
_push ( ` <!--[--><div id="append_parent"></div><div id="ajaxwaitid"></div> ` ) ;
_push ( ssrRenderComponent ( _component _RouterView , null , null , _parent ) ) ;
_push ( ` <!--]--> ` ) ;
} ;
}
} ;
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 = _sfc _main$2 ;
const _sfc _main$1 = {
_ _name : "nuxt-error-page" ,
_ _ssrInlineRender : true ,
props : {
error : Object
} ,
setup ( _ _props ) {
const props = _ _props ;
const _error = props . error ;
( _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 ;
2024-01-26 11:09:20 +08:00
const _Error404 = defineAsyncComponent ( ( ) => import ( './_nuxt/error-404-wT7oLhg8.mjs' ) . then ( ( r ) => r . default || r ) ) ;
const _Error = defineAsyncComponent ( ( ) => import ( './_nuxt/error-500-28f6AWAD.mjs' ) . then ( ( r ) => r . default || r ) ) ;
2024-01-25 19:29:12 +08:00
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 ( ) ;
2024-01-26 11:09:20 +08:00
( ssrContext . modules || ( ssrContext . modules = /* @__PURE__ */ new Set ( ) ) ) . add ( "node_modules/.pnpm/nuxt@3.9.3_less@4.2.0_vite@5.0.12/node_modules/nuxt/dist/app/components/nuxt-error-page.vue" ) ;
2024-01-25 19:29:12 +08:00
return _sfc _setup$1 ? _sfc _setup$1 ( props , ctx ) : void 0 ;
} ;
const ErrorComponent = _sfc _main$1 ;
const _sfc _main = {
_ _name : "nuxt-root" ,
_ _ssrInlineRender : true ,
setup ( _ _props ) {
2024-01-26 11:09:20 +08:00
const IslandRenderer = defineAsyncComponent ( ( ) => import ( './_nuxt/island-renderer-B3KP16KS.mjs' ) . then ( ( r ) => r . default || r ) ) ;
2024-01-25 19:29:12 +08:00
const nuxtApp = /* @__PURE__ */ 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 ( ) ;
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 ( error ) ) {
_push ( ssrRenderComponent ( unref ( ErrorComponent ) , { 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 ( ) ;
2024-01-26 11:09:20 +08:00
( ssrContext . modules || ( ssrContext . modules = /* @__PURE__ */ new Set ( ) ) ) . add ( "node_modules/.pnpm/nuxt@3.9.3_less@4.2.0_vite@5.0.12/node_modules/nuxt/dist/app/components/nuxt-root.vue" ) ;
2024-01-25 19:29:12 +08:00
return _sfc _setup ? _sfc _setup ( props , ctx ) : void 0 ;
} ;
const RootComponent = _sfc _main ;
let entry ;
{
entry = async function createNuxtAppServer ( ssrContext ) {
const vueApp = createApp ( RootComponent ) ;
const nuxt = createNuxtApp ( { vueApp , ssrContext } ) ;
try {
await applyPlugins ( nuxt , plugins ) ;
await nuxt . hooks . callHook ( "app:created" , vueApp ) ;
} catch ( err ) {
await nuxt . hooks . callHook ( "app:error" , err ) ;
nuxt . payload . error = nuxt . payload . error || err ;
}
if ( ssrContext == null ? void 0 : ssrContext . _renderResponse ) {
throw new Error ( "skipping render" ) ;
}
return vueApp ;
} ;
}
const entry$1 = ( ssrContext ) => entry ( ssrContext ) ;
2024-01-26 11:09:20 +08:00
const server = /*#__PURE__*/ Object . freeze ( {
_ _proto _ _ : null ,
a : useRuntimeConfig ,
b : navigateTo ,
c : createError ,
d : useNamespace ,
default : entry$1 ,
e : useId ,
f : defaultNamespace ,
g : debugWarn ,
h : useRoute ,
i : useGetDerivedNamespace ,
j : useIdInjection ,
k : injectHead ,
l : namespaceContextKey ,
n : nuxtLinkDefaults ,
r : resolveUnrefHeadInput ,
t : throwError ,
u : useRouter
} ) ;
export { useRouter as a , useId as b , useRoute as c , defaultNamespace as d , debugWarn as e , useGetDerivedNamespace as f , useIdInjection as g , hasProtocol as h , parseQuery as i , joinURL as j , nuxtLinkDefaults as k , useRuntimeConfig as l , navigateTo as m , namespaceContextKey as n , withoutTrailingSlash as o , parseURL as p , injectHead as q , resolveUnrefHeadInput as r , createError as s , throwError as t , useNamespace as u , server as v , withTrailingSlash as w } ;
2024-01-25 19:29:12 +08:00
//# sourceMappingURL=server.mjs.map