{"version":3,"sources":["../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/index.js","../../../src/session/__tests__/redis.test.ts","../../../../../node_modules/.pnpm/vitest@4.1.7_@opentelemetry+api@1.9.1_@types+node@25.9.1_vite@8.0.14_@types+node@25.9.1_35e487363f16dae071d0b2d9f17a308b/node_modules/vitest/dist/index.js","../../../../../node_modules/.pnpm/@vitest+runner@4.1.7/node_modules/@vitest/runner/dist/index.js","../../../../../node_modules/.pnpm/@vitest+runner@4.1.7/node_modules/@vitest/runner/dist/utils.js","../../../../../node_modules/.pnpm/vite@8.0.14_@types+node@25.9.1_esbuild@0.27.7_jiti@2.6.1_terser@5.48.0_yaml@2.9.0/node_modules/vite/dist/node/module-runner.js"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n    for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.expectTypeOf = void 0;\n__exportStar(require(\"./branding\"), exports); // backcompat, consider removing in next major version\n__exportStar(require(\"./messages\"), exports); // backcompat, consider removing in next major version\n__exportStar(require(\"./overloads\"), exports);\n__exportStar(require(\"./utils\"), exports); // backcompat, consider removing in next major version\nconst fn = () => true;\n/**\n * Similar to Jest's `expect`, but with type-awareness.\n * Gives you access to a number of type-matchers that let you make assertions about the\n * form of a reference or generic type parameter.\n *\n * @example\n * ```ts\n * import { foo, bar } from '../foo'\n * import { expectTypeOf } from 'expect-type'\n *\n * test('foo types', () => {\n *   // make sure `foo` has type { a: number }\n *   expectTypeOf(foo).toMatchTypeOf({ a: 1 })\n *   expectTypeOf(foo).toHaveProperty('a').toBeNumber()\n *\n *   // make sure `bar` is a function taking a string:\n *   expectTypeOf(bar).parameter(0).toBeString()\n *   expectTypeOf(bar).returns.not.toBeAny()\n * })\n * ```\n *\n * @description\n * See the [full docs](https://npmjs.com/package/expect-type#documentation) for lots more examples.\n */\nconst expectTypeOf = (_actual) => {\n    const nonFunctionProperties = [\n        'parameters',\n        'returns',\n        'resolves',\n        'not',\n        'items',\n        'constructorParameters',\n        'thisParameter',\n        'instance',\n        'guards',\n        'asserts',\n        'branded',\n    ];\n    const obj = {\n        /* eslint-disable @typescript-eslint/no-unsafe-assignment */\n        toBeAny: fn,\n        toBeUnknown: fn,\n        toBeNever: fn,\n        toBeFunction: fn,\n        toBeObject: fn,\n        toBeArray: fn,\n        toBeString: fn,\n        toBeNumber: fn,\n        toBeBoolean: fn,\n        toBeVoid: fn,\n        toBeSymbol: fn,\n        toBeNull: fn,\n        toBeUndefined: fn,\n        toBeNullable: fn,\n        toBeBigInt: fn,\n        toMatchTypeOf: fn,\n        toEqualTypeOf: fn,\n        toBeConstructibleWith: fn,\n        toMatchObjectType: fn,\n        toExtend: fn,\n        map: exports.expectTypeOf,\n        toBeCallableWith: exports.expectTypeOf,\n        extract: exports.expectTypeOf,\n        exclude: exports.expectTypeOf,\n        pick: exports.expectTypeOf,\n        omit: exports.expectTypeOf,\n        toHaveProperty: exports.expectTypeOf,\n        parameter: exports.expectTypeOf,\n    };\n    const getterProperties = nonFunctionProperties;\n    getterProperties.forEach((prop) => Object.defineProperty(obj, prop, { get: () => (0, exports.expectTypeOf)({}) }));\n    return obj;\n};\nexports.expectTypeOf = expectTypeOf;\n","import Redis from 'ioredis';\nimport { describe, expect, test } from 'vitest';\nimport { PRINCIPAL_NAME_INDEX_NAME } from '../common';\nimport { RedisIndexedSessionRepository } from '../redis';\n\n// docker run -d -p 6379:6379 --name my-redis -e REDIS_PASSWORD=123456 redis\nconst redis = new Redis('redis://default:123456@localhost:6379');\nconst repository = new RedisIndexedSessionRepository(redis, 'myapp:session');\n\ndescribe('redis session crud', () => {\n  const principalName = 'user_123456';\n\n  test('should create a session', async () => {\n    const session = repository.createSession();\n    const sessionId = session.getId();\n    session.setAttribute(PRINCIPAL_NAME_INDEX_NAME, principalName);\n    await repository.save(session);\n    const foundSession = await repository.findById(sessionId);\n    expect(foundSession?.getAttribute(PRINCIPAL_NAME_INDEX_NAME)).toBe(principalName);\n  });\n\n  test('should find a session by principal name', async () => {\n    const sessions = await repository.findByPrincipalName(principalName);\n    expect(sessions.size).toBeGreaterThan(0);\n  });\n\n  test('should delete a session by id', async () => {\n    const sessions = await repository.findByPrincipalName(principalName);\n    for (const session of sessions.values()) {\n      const sessionId = session.getId();\n      await repository.deleteById(sessionId);\n      const foundSession = await repository.findById(sessionId);\n      expect(foundSession).toBeNull();\n    }\n  });\n});\n\ndescribe('redis session attributes', () => {\n  test('should set and get attributes', async () => {\n    const session = repository.createSession();\n    session.setAttribute('test_key', 'test_value');\n    const sessionId = session.getId();\n    await repository.save(session);\n\n    const foundSession = await repository.findById(sessionId);\n    expect(foundSession).not.toBeNull();\n    expect(foundSession?.getAttribute('test_key')).toBe('test_value');\n\n    foundSession?.removeAttribute('test_key');\n    if (foundSession) await repository.save(foundSession);\n\n    const foundSession2 = await repository.findById(sessionId);\n    expect(foundSession2?.getAttribute('test_key')).toBeNull();\n  });\n\n  test('should change session id', async () => {\n    const session = repository.createSession();\n    session.setAttribute('test_key', 'test_value');\n    session.setAttribute(PRINCIPAL_NAME_INDEX_NAME, 'user_123');\n    const oldSessionId = session.getId();\n    await repository.save(session);\n\n    const oldSession = await repository.findById(oldSessionId);\n    expect(oldSession).not.toBeNull();\n    if (!oldSession) throw new Error('Not found session id');\n\n    const newSessionId = oldSession.changeSessionId();\n    await repository.save(oldSession);\n\n    const foundSession1 = await repository.findById(oldSessionId);\n    expect(foundSession1).toBeNull();\n\n    const foundSession2 = await repository.findById(newSessionId);\n    expect(foundSession2).not.toBeNull();\n  });\n});\n\ndescribe('redis session config', () => {\n  const maxInactiveInterval = 24 * 60 * 60;\n  repository.setDefaultMaxInactiveInterval(maxInactiveInterval);\n\n  test('should set default max inactive interval', () => {\n    const session = repository.createSession();\n    expect(session.isExpired()).toBe(false);\n    expect(session.getMaxInactiveInterval()).toBe(maxInactiveInterval);\n  });\n});\n","export { N as BenchmarkRunner, S as Snapshots, T as TestRunner, a as assert, c as createExpect, g as expect, i as inject, s as should, v as vi, b as vitest } from './chunks/test.DNmyFkvJ.js';\nexport { b as bench } from './chunks/benchmark.CX_oY03V.js';\nexport { V as EvaluatedModules } from './chunks/evaluatedModules.Dg1zASAC.js';\nexport { a as assertType } from './chunks/index.DdgEv5B1.js';\nexport { expectTypeOf } from 'expect-type';\nexport { afterAll, afterEach, aroundAll, aroundEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, recordArtifact, suite, test } from '@vitest/runner';\nexport { chai } from '@vitest/expect';\nimport '@vitest/utils/helpers';\nimport '@vitest/utils/timers';\nimport './chunks/utils.BX5Fg8C4.js';\nimport '@vitest/runner/utils';\nimport '@vitest/utils/error';\nimport 'pathe';\nimport '@vitest/spy';\nimport '@vitest/utils/offset';\nimport '@vitest/utils/source-map';\nimport './chunks/_commonjsHelpers.D26ty3Ew.js';\nimport './chunks/rpc.MzXet3jl.js';\nimport './chunks/index.Chj8NDwU.js';\nimport '@vitest/snapshot';\nimport 'vite/module-runner';\n","export { a as afterAll, b as afterEach, c as aroundAll, d as aroundEach, e as beforeAll, f as beforeEach, p as collectTests, g as createTaskCollector, h as describe, i as getCurrentSuite, j as getCurrentTest, k as getFn, l as getHooks, m as it, o as onTestFailed, n as onTestFinished, r as recordArtifact, s as setFn, q as setHooks, t as startTests, u as suite, v as test, w as updateTask } from './chunk-artifact.js';\nimport '@vitest/utils/error';\nimport '@vitest/utils/helpers';\nimport '@vitest/utils/timers';\nimport '@vitest/utils/display';\nimport '@vitest/utils/source-map';\nimport 'pathe';\n","export { x as calculateSuiteHash, y as createChainable, z as createFileTask, A as createTagsFilter, B as createTaskName, C as findTestFileStackTrace, D as generateFileHash, E as generateHash, F as getFullName, G as getNames, H as getSuites, I as getTasks, J as getTestName, K as getTests, L as hasFailed, M as hasTests, N as interpretTaskModes, O as isTestCase, P as limitConcurrency, Q as matchesTags, R as partitionSuiteChildren, S as someTasksAreOnly, T as validateTags } from './chunk-artifact.js';\nimport '@vitest/utils/error';\nimport '@vitest/utils/helpers';\nimport '@vitest/utils/timers';\nimport '@vitest/utils/display';\nimport '@vitest/utils/source-map';\nimport 'pathe';\n","let SOURCEMAPPING_URL = \"sourceMa\";\nSOURCEMAPPING_URL += \"ppingURL\";\n//#endregion\n//#region src/shared/utils.ts\nconst isWindows = typeof process < \"u\" && process.platform === \"win32\";\n/**\n* Undo {@link wrapId}'s `/@id/` and null byte replacements.\n*/\nfunction unwrapId(id) {\n\treturn id.startsWith(\"/@id/\") ? id.slice(5).replace(\"__x00__\", \"\\0\") : id;\n}\nconst windowsSlashRE = /\\\\/g;\nfunction slash(p) {\n\treturn p.replace(windowsSlashRE, \"/\");\n}\nconst postfixRE = /[?#].*$/;\nfunction cleanUrl(url) {\n\treturn url.replace(postfixRE, \"\");\n}\nfunction isPrimitive(value) {\n\treturn !value || typeof value != \"object\" && typeof value != \"function\";\n}\nconst AsyncFunction = async function() {}.constructor;\nlet asyncFunctionDeclarationPaddingLineCount;\nfunction getAsyncFunctionDeclarationPaddingLineCount() {\n\tif (asyncFunctionDeclarationPaddingLineCount === void 0) {\n\t\tlet body = \"/*code*/\", source = new AsyncFunction(\"a\", \"b\", body).toString();\n\t\tasyncFunctionDeclarationPaddingLineCount = source.slice(0, source.indexOf(body)).split(\"\\n\").length - 1;\n\t}\n\treturn asyncFunctionDeclarationPaddingLineCount;\n}\nfunction promiseWithResolvers() {\n\tlet resolve, reject;\n\treturn {\n\t\tpromise: new Promise((_resolve, _reject) => {\n\t\t\tresolve = _resolve, reject = _reject;\n\t\t}),\n\t\tresolve,\n\t\treject\n\t};\n}\n//#endregion\n//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs\nconst _DRIVE_LETTER_START_RE = /^[A-Za-z]:\\//;\nfunction normalizeWindowsPath(input = \"\") {\n\treturn input && input.replace(/\\\\/g, \"/\").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());\n}\nconst _IS_ABSOLUTE_RE = /^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/;\nfunction cwd() {\n\treturn typeof process < \"u\" && typeof process.cwd == \"function\" ? process.cwd().replace(/\\\\/g, \"/\") : \"/\";\n}\nconst resolve = function(...arguments_) {\n\targuments_ = arguments_.map((argument) => normalizeWindowsPath(argument));\n\tlet resolvedPath = \"\", resolvedAbsolute = !1;\n\tfor (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {\n\t\tlet path = index >= 0 ? arguments_[index] : cwd();\n\t\t!path || path.length === 0 || (resolvedPath = `${path}/${resolvedPath}`, resolvedAbsolute = isAbsolute(path));\n\t}\n\treturn resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : \".\";\n};\nfunction normalizeString(path, allowAboveRoot) {\n\tlet res = \"\", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;\n\tfor (let index = 0; index <= path.length; ++index) {\n\t\tif (index < path.length) char = path[index];\n\t\telse if (char === \"/\") break;\n\t\telse char = \"/\";\n\t\tif (char === \"/\") {\n\t\t\tif (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {\n\t\t\t\tif (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== \".\" || res[res.length - 2] !== \".\") {\n\t\t\t\t\tif (res.length > 2) {\n\t\t\t\t\t\tlet lastSlashIndex = res.lastIndexOf(\"/\");\n\t\t\t\t\t\tlastSlashIndex === -1 ? (res = \"\", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf(\"/\")), lastSlash = index, dots = 0;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if (res.length > 0) {\n\t\t\t\t\t\tres = \"\", lastSegmentLength = 0, lastSlash = index, dots = 0;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tallowAboveRoot && (res += res.length > 0 ? \"/..\" : \"..\", lastSegmentLength = 2);\n\t\t\t} else res.length > 0 ? res += `/${path.slice(lastSlash + 1, index)}` : res = path.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;\n\t\t\tlastSlash = index, dots = 0;\n\t\t} else char === \".\" && dots !== -1 ? ++dots : dots = -1;\n\t}\n\treturn res;\n}\nconst isAbsolute = function(p) {\n\treturn _IS_ABSOLUTE_RE.test(p);\n}, dirname = function(p) {\n\tlet segments = normalizeWindowsPath(p).replace(/\\/$/, \"\").split(\"/\").slice(0, -1);\n\treturn segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += \"/\"), segments.join(\"/\") || (isAbsolute(p) ? \"/\" : \".\");\n}, textDecoder = new TextDecoder(), decodeBase64 = typeof Buffer == \"function\" && typeof Buffer.from == \"function\" ? (base64) => Buffer.from(base64, \"base64\").toString(\"utf-8\") : (base64) => textDecoder.decode(Uint8Array.from(atob(base64), (c) => c.charCodeAt(0))), percentRegEx = /%/g, backslashRegEx = /\\\\/g, newlineRegEx = /\\n/g, carriageReturnRegEx = /\\r/g, tabRegEx = /\\t/g, questionRegex = /\\?/g, hashRegex = /#/g;\nfunction encodePathChars(filepath) {\n\treturn filepath.includes(\"%\") && (filepath = filepath.replace(percentRegEx, \"%25\")), !isWindows && filepath.includes(\"\\\\\") && (filepath = filepath.replace(backslashRegEx, \"%5C\")), filepath.includes(\"\\n\") && (filepath = filepath.replace(newlineRegEx, \"%0A\")), filepath.includes(\"\\r\") && (filepath = filepath.replace(carriageReturnRegEx, \"%0D\")), filepath.includes(\"\t\") && (filepath = filepath.replace(tabRegEx, \"%09\")), filepath;\n}\nconst posixDirname = dirname, posixResolve = resolve;\nfunction posixPathToFileHref(posixPath) {\n\tlet resolved = posixResolve(posixPath), filePathLast = posixPath.charCodeAt(posixPath.length - 1);\n\treturn (filePathLast === 47 || isWindows && filePathLast === 92) && resolved[resolved.length - 1] !== \"/\" && (resolved += \"/\"), resolved = encodePathChars(resolved), resolved.includes(\"?\") && (resolved = resolved.replace(questionRegex, \"%3F\")), resolved.includes(\"#\") && (resolved = resolved.replace(hashRegex, \"%23\")), new URL(`file://${resolved}`).href;\n}\nfunction toWindowsPath(path) {\n\treturn path.replace(/\\//g, \"\\\\\");\n}\n//#endregion\n//#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs\nvar comma = 44, chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\", intToChar = new Uint8Array(64), charToInt = new Uint8Array(128);\nfor (let i = 0; i < chars.length; i++) {\n\tlet c = chars.charCodeAt(i);\n\tintToChar[i] = c, charToInt[c] = i;\n}\nfunction decodeInteger(reader, relative) {\n\tlet value = 0, shift = 0, integer = 0;\n\tdo\n\t\tinteger = charToInt[reader.next()], value |= (integer & 31) << shift, shift += 5;\n\twhile (integer & 32);\n\tlet shouldNegate = value & 1;\n\treturn value >>>= 1, shouldNegate && (value = -2147483648 | -value), relative + value;\n}\nfunction hasMoreVlq(reader, max) {\n\treturn reader.pos >= max ? !1 : reader.peek() !== comma;\n}\nvar StringReader = class {\n\tconstructor(buffer) {\n\t\tthis.pos = 0, this.buffer = buffer;\n\t}\n\tnext() {\n\t\treturn this.buffer.charCodeAt(this.pos++);\n\t}\n\tpeek() {\n\t\treturn this.buffer.charCodeAt(this.pos);\n\t}\n\tindexOf(char) {\n\t\tlet { buffer, pos } = this, idx = buffer.indexOf(char, pos);\n\t\treturn idx === -1 ? buffer.length : idx;\n\t}\n};\nfunction decode(mappings) {\n\tlet { length } = mappings, reader = new StringReader(mappings), decoded = [], genColumn = 0, sourcesIndex = 0, sourceLine = 0, sourceColumn = 0, namesIndex = 0;\n\tdo {\n\t\tlet semi = reader.indexOf(\";\"), line = [], sorted = !0, lastCol = 0;\n\t\tfor (genColumn = 0; reader.pos < semi;) {\n\t\t\tlet seg;\n\t\t\tgenColumn = decodeInteger(reader, genColumn), genColumn < lastCol && (sorted = !1), lastCol = genColumn, hasMoreVlq(reader, semi) ? (sourcesIndex = decodeInteger(reader, sourcesIndex), sourceLine = decodeInteger(reader, sourceLine), sourceColumn = decodeInteger(reader, sourceColumn), hasMoreVlq(reader, semi) ? (namesIndex = decodeInteger(reader, namesIndex), seg = [\n\t\t\t\tgenColumn,\n\t\t\t\tsourcesIndex,\n\t\t\t\tsourceLine,\n\t\t\t\tsourceColumn,\n\t\t\t\tnamesIndex\n\t\t\t]) : seg = [\n\t\t\t\tgenColumn,\n\t\t\t\tsourcesIndex,\n\t\t\t\tsourceLine,\n\t\t\t\tsourceColumn\n\t\t\t]) : seg = [genColumn], line.push(seg), reader.pos++;\n\t\t}\n\t\tsorted || sort(line), decoded.push(line), reader.pos = semi + 1;\n\t} while (reader.pos <= length);\n\treturn decoded;\n}\nfunction sort(line) {\n\tline.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n\treturn a[0] - b[0];\n}\n//#endregion\n//#region ../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs\nvar COLUMN = 0, SOURCES_INDEX = 1, SOURCE_LINE = 2, SOURCE_COLUMN = 3, NAMES_INDEX = 4, found = !1;\nfunction binarySearch(haystack, needle, low, high) {\n\tfor (; low <= high;) {\n\t\tlet mid = low + (high - low >> 1), cmp = haystack[mid][COLUMN] - needle;\n\t\tif (cmp === 0) return found = !0, mid;\n\t\tcmp < 0 ? low = mid + 1 : high = mid - 1;\n\t}\n\treturn found = !1, low - 1;\n}\nfunction upperBound(haystack, needle, index) {\n\tfor (let i = index + 1; i < haystack.length && haystack[i][COLUMN] === needle; index = i++);\n\treturn index;\n}\nfunction lowerBound(haystack, needle, index) {\n\tfor (let i = index - 1; i >= 0 && haystack[i][COLUMN] === needle; index = i--);\n\treturn index;\n}\nfunction memoizedBinarySearch(haystack, needle, state, key) {\n\tlet { lastKey, lastNeedle, lastIndex } = state, low = 0, high = haystack.length - 1;\n\tif (key === lastKey) {\n\t\tif (needle === lastNeedle) return found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle, lastIndex;\n\t\tneedle >= lastNeedle ? low = lastIndex === -1 ? 0 : lastIndex : high = lastIndex;\n\t}\n\treturn state.lastKey = key, state.lastNeedle = needle, state.lastIndex = binarySearch(haystack, needle, low, high);\n}\nvar LINE_GTR_ZERO = \"`line` must be greater than 0 (lines start at line 1)\", COL_GTR_EQ_ZERO = \"`column` must be greater than or equal to 0 (columns start at column 0)\";\nfunction cast(map) {\n\treturn map;\n}\nfunction decodedMappings(map) {\n\tvar _a;\n\treturn (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded));\n}\nfunction originalPositionFor(map, needle) {\n\tlet { line, column, bias } = needle;\n\tif (line--, line < 0) throw Error(LINE_GTR_ZERO);\n\tif (column < 0) throw Error(COL_GTR_EQ_ZERO);\n\tlet decoded = decodedMappings(map);\n\tif (line >= decoded.length) return OMapping(null, null, null, null);\n\tlet segments = decoded[line], index = traceSegmentInternal(segments, cast(map)._decodedMemo, line, column, bias || 1);\n\tif (index === -1) return OMapping(null, null, null, null);\n\tlet segment = segments[index];\n\tif (segment.length === 1) return OMapping(null, null, null, null);\n\tlet { names, resolvedSources } = map;\n\treturn OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null);\n}\nfunction OMapping(source, line, column, name) {\n\treturn {\n\t\tsource,\n\t\tline,\n\t\tcolumn,\n\t\tname\n\t};\n}\nfunction traceSegmentInternal(segments, memo, line, column, bias) {\n\tlet index = memoizedBinarySearch(segments, column, memo, line);\n\treturn found ? index = (bias === -1 ? upperBound : lowerBound)(segments, column, index) : bias === -1 && index++, index === -1 || index === segments.length ? -1 : index;\n}\n//#endregion\n//#region src/module-runner/sourcemap/decoder.ts\nvar DecodedMap = class {\n\tmap;\n\t_encoded;\n\t_decoded;\n\t_decodedMemo;\n\turl;\n\tfile;\n\tversion;\n\tnames = [];\n\tresolvedSources;\n\tconstructor(map, from) {\n\t\tthis.map = map;\n\t\tlet { mappings, names, sources } = map;\n\t\tthis.version = map.version, this.names = names || [], this._encoded = mappings || \"\", this._decodedMemo = memoizedState(), this.url = from, this.file = from;\n\t\tlet originDir = posixDirname(from);\n\t\tthis.resolvedSources = (sources || []).map((s) => posixResolve(originDir, s || \"\"));\n\t}\n};\nfunction memoizedState() {\n\treturn {\n\t\tlastKey: -1,\n\t\tlastNeedle: -1,\n\t\tlastIndex: -1\n\t};\n}\nfunction getOriginalPosition(map, needle) {\n\tlet result = originalPositionFor(map, needle);\n\treturn result.column == null ? null : result;\n}\n//#endregion\n//#region src/module-runner/evaluatedModules.ts\nconst MODULE_RUNNER_SOURCEMAPPING_REGEXP = RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`);\nvar EvaluatedModuleNode = class {\n\tid;\n\turl;\n\timporters = /* @__PURE__ */ new Set();\n\timports = /* @__PURE__ */ new Set();\n\tevaluated = !1;\n\tmeta;\n\tpromise;\n\texports;\n\tfile;\n\tmap;\n\tconstructor(id, url) {\n\t\tthis.id = id, this.url = url, this.file = cleanUrl(id);\n\t}\n}, EvaluatedModules = class {\n\tidToModuleMap = /* @__PURE__ */ new Map();\n\tfileToModulesMap = /* @__PURE__ */ new Map();\n\turlToIdModuleMap = /* @__PURE__ */ new Map();\n\t/**\n\t* Returns the module node by the resolved module ID. Usually, module ID is\n\t* the file system path with query and/or hash. It can also be a virtual module.\n\t*\n\t* Module runner graph will have 1 to 1 mapping with the server module graph.\n\t* @param id Resolved module ID\n\t*/\n\tgetModuleById(id) {\n\t\treturn this.idToModuleMap.get(id);\n\t}\n\t/**\n\t* Returns all modules related to the file system path. Different modules\n\t* might have different query parameters or hash, so it's possible to have\n\t* multiple modules for the same file.\n\t* @param file The file system path of the module\n\t*/\n\tgetModulesByFile(file) {\n\t\treturn this.fileToModulesMap.get(file);\n\t}\n\t/**\n\t* Returns the module node by the URL that was used in the import statement.\n\t* Unlike module graph on the server, the URL is not resolved and is used as is.\n\t* @param url Server URL that was used in the import statement\n\t*/\n\tgetModuleByUrl(url) {\n\t\treturn this.urlToIdModuleMap.get(unwrapId(url));\n\t}\n\t/**\n\t* Ensure that module is in the graph. If the module is already in the graph,\n\t* it will return the existing module node. Otherwise, it will create a new\n\t* module node and add it to the graph.\n\t* @param id Resolved module ID\n\t* @param url URL that was used in the import statement\n\t*/\n\tensureModule(id, url) {\n\t\tif (id = normalizeModuleId(id), this.idToModuleMap.has(id)) {\n\t\t\tlet moduleNode = this.idToModuleMap.get(id);\n\t\t\treturn this.urlToIdModuleMap.set(url, moduleNode), moduleNode;\n\t\t}\n\t\tlet moduleNode = new EvaluatedModuleNode(id, url);\n\t\tthis.idToModuleMap.set(id, moduleNode), this.urlToIdModuleMap.set(url, moduleNode);\n\t\tlet fileModules = this.fileToModulesMap.get(moduleNode.file) || /* @__PURE__ */ new Set();\n\t\treturn fileModules.add(moduleNode), this.fileToModulesMap.set(moduleNode.file, fileModules), moduleNode;\n\t}\n\tinvalidateModule(node) {\n\t\tnode.evaluated = !1, node.meta = void 0, node.map = void 0, node.promise = void 0, node.exports = void 0, node.imports.clear();\n\t}\n\t/**\n\t* Extracts the inlined source map from the module code and returns the decoded\n\t* source map. If the source map is not inlined, it will return null.\n\t* @param id Resolved module ID\n\t*/\n\tgetModuleSourceMapById(id) {\n\t\tlet mod = this.getModuleById(id);\n\t\tif (!mod) return null;\n\t\tif (mod.map) return mod.map;\n\t\tif (!mod.meta || !(\"code\" in mod.meta)) return null;\n\t\tlet pattern = `//# ${SOURCEMAPPING_URL}=data:application/json;base64,`, lastIndex = mod.meta.code.lastIndexOf(pattern);\n\t\tif (lastIndex === -1) return null;\n\t\tlet mapString = MODULE_RUNNER_SOURCEMAPPING_REGEXP.exec(mod.meta.code.slice(lastIndex))?.[1];\n\t\treturn mapString ? (mod.map = new DecodedMap(JSON.parse(decodeBase64(mapString)), mod.file), mod.map) : null;\n\t}\n\tclear() {\n\t\tthis.idToModuleMap.clear(), this.fileToModulesMap.clear(), this.urlToIdModuleMap.clear();\n\t}\n};\nconst prefixedBuiltins = new Set([\n\t\"node:sea\",\n\t\"node:sqlite\",\n\t\"node:test\",\n\t\"node:test/reporters\"\n]);\nfunction normalizeModuleId(file) {\n\treturn prefixedBuiltins.has(file) ? file : slash(file).replace(/^\\/@fs\\//, isWindows ? \"\" : \"/\").replace(/^node:/, \"\").replace(/^\\/+/, \"/\").replace(/^file:\\/+/, isWindows ? \"\" : \"/\");\n}\n//#endregion\n//#region src/shared/hmr.ts\nvar HMRContext = class {\n\thmrClient;\n\townerPath;\n\tnewListeners;\n\tconstructor(hmrClient, ownerPath) {\n\t\tthis.hmrClient = hmrClient, this.ownerPath = ownerPath, hmrClient.dataMap.has(ownerPath) || hmrClient.dataMap.set(ownerPath, {});\n\t\tlet mod = hmrClient.hotModulesMap.get(ownerPath);\n\t\tmod && (mod.callbacks = []);\n\t\tlet staleListeners = hmrClient.ctxToListenersMap.get(ownerPath);\n\t\tif (staleListeners) for (let [event, staleFns] of staleListeners) {\n\t\t\tlet listeners = hmrClient.customListenersMap.get(event);\n\t\t\tlisteners && hmrClient.customListenersMap.set(event, listeners.filter((l) => !staleFns.includes(l)));\n\t\t}\n\t\tthis.newListeners = /* @__PURE__ */ new Map(), hmrClient.ctxToListenersMap.set(ownerPath, this.newListeners);\n\t}\n\tget data() {\n\t\treturn this.hmrClient.dataMap.get(this.ownerPath);\n\t}\n\taccept(deps, callback) {\n\t\tif (typeof deps == \"function\" || !deps) this.acceptDeps([this.ownerPath], ([mod]) => deps?.(mod));\n\t\telse if (typeof deps == \"string\") this.acceptDeps([deps], ([mod]) => callback?.(mod));\n\t\telse if (Array.isArray(deps)) this.acceptDeps(deps, callback);\n\t\telse throw Error(\"invalid hot.accept() usage.\");\n\t}\n\tacceptExports(_, callback) {\n\t\tthis.acceptDeps([this.ownerPath], ([mod]) => callback?.(mod));\n\t}\n\tdispose(cb) {\n\t\tthis.hmrClient.disposeMap.set(this.ownerPath, cb);\n\t}\n\tprune(cb) {\n\t\tthis.hmrClient.pruneMap.set(this.ownerPath, cb);\n\t}\n\tdecline() {}\n\tinvalidate(message) {\n\t\tlet firstInvalidatedBy = this.hmrClient.currentFirstInvalidatedBy ?? this.ownerPath;\n\t\tthis.hmrClient.notifyListeners(\"vite:invalidate\", {\n\t\t\tpath: this.ownerPath,\n\t\t\tmessage,\n\t\t\tfirstInvalidatedBy\n\t\t}), this.send(\"vite:invalidate\", {\n\t\t\tpath: this.ownerPath,\n\t\t\tmessage,\n\t\t\tfirstInvalidatedBy\n\t\t}), this.hmrClient.logger.debug(`invalidate ${this.ownerPath}${message ? `: ${message}` : \"\"}`);\n\t}\n\ton(event, cb) {\n\t\tlet addToMap = (map) => {\n\t\t\tlet existing = map.get(event) || [];\n\t\t\texisting.push(cb), map.set(event, existing);\n\t\t};\n\t\taddToMap(this.hmrClient.customListenersMap), addToMap(this.newListeners);\n\t}\n\toff(event, cb) {\n\t\tlet removeFromMap = (map) => {\n\t\t\tlet existing = map.get(event);\n\t\t\tif (existing === void 0) return;\n\t\t\tlet pruned = existing.filter((l) => l !== cb);\n\t\t\tif (pruned.length === 0) {\n\t\t\t\tmap.delete(event);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmap.set(event, pruned);\n\t\t};\n\t\tremoveFromMap(this.hmrClient.customListenersMap), removeFromMap(this.newListeners);\n\t}\n\tsend(event, data) {\n\t\tthis.hmrClient.send({\n\t\t\ttype: \"custom\",\n\t\t\tevent,\n\t\t\tdata\n\t\t});\n\t}\n\tacceptDeps(deps, callback = () => {}) {\n\t\tlet mod = this.hmrClient.hotModulesMap.get(this.ownerPath) || {\n\t\t\tid: this.ownerPath,\n\t\t\tcallbacks: []\n\t\t};\n\t\tmod.callbacks.push({\n\t\t\tdeps,\n\t\t\tfn: callback\n\t\t}), this.hmrClient.hotModulesMap.set(this.ownerPath, mod);\n\t}\n}, HMRClient = class {\n\tlogger;\n\ttransport;\n\timportUpdatedModule;\n\thotModulesMap = /* @__PURE__ */ new Map();\n\tdisposeMap = /* @__PURE__ */ new Map();\n\tpruneMap = /* @__PURE__ */ new Map();\n\tdataMap = /* @__PURE__ */ new Map();\n\tcustomListenersMap = /* @__PURE__ */ new Map();\n\tctxToListenersMap = /* @__PURE__ */ new Map();\n\tcurrentFirstInvalidatedBy;\n\tconstructor(logger, transport, importUpdatedModule) {\n\t\tthis.logger = logger, this.transport = transport, this.importUpdatedModule = importUpdatedModule;\n\t}\n\tasync notifyListeners(event, data) {\n\t\tlet cbs = this.customListenersMap.get(event);\n\t\tcbs && await Promise.allSettled(cbs.map((cb) => cb(data)));\n\t}\n\tsend(payload) {\n\t\tthis.transport.send(payload).catch((err) => {\n\t\t\tthis.logger.error(err);\n\t\t});\n\t}\n\tclear() {\n\t\tthis.hotModulesMap.clear(), this.disposeMap.clear(), this.pruneMap.clear(), this.dataMap.clear(), this.customListenersMap.clear(), this.ctxToListenersMap.clear();\n\t}\n\tasync prunePaths(paths) {\n\t\tawait Promise.all(paths.map((path) => {\n\t\t\tlet disposer = this.disposeMap.get(path);\n\t\t\tif (disposer) return disposer(this.dataMap.get(path));\n\t\t})), await Promise.all(paths.map((path) => {\n\t\t\tlet fn = this.pruneMap.get(path);\n\t\t\tif (fn) return fn(this.dataMap.get(path));\n\t\t}));\n\t}\n\twarnFailedUpdate(err, path) {\n\t\t(!(err instanceof Error) || !err.message.includes(\"fetch\")) && this.logger.error(err), this.logger.error(`Failed to reload ${path}. This could be due to syntax errors or importing non-existent modules. (see errors above)`);\n\t}\n\tupdateQueue = [];\n\tpendingUpdateQueue = !1;\n\t/**\n\t* buffer multiple hot updates triggered by the same src change\n\t* so that they are invoked in the same order they were sent.\n\t* (otherwise the order may be inconsistent because of the http request round trip)\n\t*/\n\tasync queueUpdate(payload) {\n\t\tif (this.updateQueue.push(this.fetchUpdate(payload)), !this.pendingUpdateQueue) {\n\t\t\tthis.pendingUpdateQueue = !0, await Promise.resolve(), this.pendingUpdateQueue = !1;\n\t\t\tlet loading = [...this.updateQueue];\n\t\t\tthis.updateQueue = [], (await Promise.all(loading)).forEach((fn) => fn && fn());\n\t\t}\n\t}\n\tasync fetchUpdate(update) {\n\t\tlet { path, acceptedPath, firstInvalidatedBy } = update, mod = this.hotModulesMap.get(path);\n\t\tif (!mod) return;\n\t\tlet fetchedModule, isSelfUpdate = path === acceptedPath, qualifiedCallbacks = mod.callbacks.filter(({ deps }) => deps.includes(acceptedPath));\n\t\tif (isSelfUpdate || qualifiedCallbacks.length > 0) {\n\t\t\tlet disposer = this.disposeMap.get(acceptedPath);\n\t\t\tdisposer && await disposer(this.dataMap.get(acceptedPath));\n\t\t\ttry {\n\t\t\t\tfetchedModule = await this.importUpdatedModule(update);\n\t\t\t} catch (e) {\n\t\t\t\tthis.warnFailedUpdate(e, acceptedPath);\n\t\t\t}\n\t\t}\n\t\treturn () => {\n\t\t\ttry {\n\t\t\t\tthis.currentFirstInvalidatedBy = firstInvalidatedBy;\n\t\t\t\tfor (let { deps, fn } of qualifiedCallbacks) fn(deps.map((dep) => dep === acceptedPath ? fetchedModule : void 0));\n\t\t\t\tlet loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;\n\t\t\t\tthis.logger.debug(`hot updated: ${loggedPath}`);\n\t\t\t} finally {\n\t\t\t\tthis.currentFirstInvalidatedBy = void 0;\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/shared/ssrTransform.ts\n/**\n* Vite converts `import { } from 'foo'` to `const _ = __vite_ssr_import__('foo')`.\n* Top-level imports and dynamic imports work slightly differently in Node.js.\n* This function normalizes the differences so it matches prod behaviour.\n*/\nfunction analyzeImportedModDifference(mod, rawId, moduleType, metadata) {\n\tif (!metadata?.isDynamicImport && metadata?.importedNames?.length) {\n\t\tlet missingBindings = metadata.importedNames.filter((s) => !(s in mod));\n\t\tif (missingBindings.length) {\n\t\t\tlet lastBinding = missingBindings[missingBindings.length - 1];\n\t\t\tthrow SyntaxError(moduleType === \"module\" ? `[vite] The requested module '${rawId}' does not provide an export named '${lastBinding}'` : `\\\n[vite] Named export '${lastBinding}' not found. The requested module '${rawId}' is a CommonJS module, which may not support all module.exports as named exports.\nCommonJS modules can always be imported via the default export, for example using:\n\nimport pkg from '${rawId}';\nconst {${missingBindings.join(\", \")}} = pkg;\n`);\n\t\t}\n\t}\n}\n//#endregion\n//#region ../../node_modules/.pnpm/nanoid@5.1.11/node_modules/nanoid/non-secure/index.js\nlet nanoid = (size = 21) => {\n\tlet id = \"\", i = size | 0;\n\tfor (; i--;) id += \"useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict\"[Math.random() * 64 | 0];\n\treturn id;\n};\n//#endregion\n//#region src/shared/moduleRunnerTransport.ts\nfunction reviveInvokeError(e) {\n\tlet error = Error(e.message || \"Unknown invoke error\");\n\treturn Object.assign(error, e, { runnerError: /* @__PURE__ */ Error(\"RunnerError\") }), error;\n}\nconst createInvokeableTransport = (transport) => {\n\tif (transport.invoke) return {\n\t\t...transport,\n\t\tasync invoke(name, data) {\n\t\t\tlet result = await transport.invoke({\n\t\t\t\ttype: \"custom\",\n\t\t\t\tevent: \"vite:invoke\",\n\t\t\t\tdata: {\n\t\t\t\t\tid: \"send\",\n\t\t\t\t\tname,\n\t\t\t\t\tdata\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (\"error\" in result) throw reviveInvokeError(result.error);\n\t\t\treturn result.result;\n\t\t}\n\t};\n\tif (!transport.send || !transport.connect) throw Error(\"transport must implement send and connect when invoke is not implemented\");\n\tlet rpcPromises = /* @__PURE__ */ new Map();\n\treturn {\n\t\t...transport,\n\t\tconnect({ onMessage, onDisconnection }) {\n\t\t\treturn transport.connect({\n\t\t\t\tonMessage(payload) {\n\t\t\t\t\tif (payload.type === \"custom\" && payload.event === \"vite:invoke\") {\n\t\t\t\t\t\tlet data = payload.data;\n\t\t\t\t\t\tif (data.id.startsWith(\"response:\")) {\n\t\t\t\t\t\t\tlet invokeId = data.id.slice(9), promise = rpcPromises.get(invokeId);\n\t\t\t\t\t\t\tif (!promise) return;\n\t\t\t\t\t\t\tpromise.timeoutId && clearTimeout(promise.timeoutId), rpcPromises.delete(invokeId);\n\t\t\t\t\t\t\tlet { error, result } = data.data;\n\t\t\t\t\t\t\terror ? promise.reject(error) : promise.resolve(result);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tonMessage(payload);\n\t\t\t\t},\n\t\t\t\tonDisconnection\n\t\t\t});\n\t\t},\n\t\tdisconnect() {\n\t\t\treturn rpcPromises.forEach((promise) => {\n\t\t\t\tpromise.reject(/* @__PURE__ */ Error(`transport was disconnected, cannot call ${JSON.stringify(promise.name)}`));\n\t\t\t}), rpcPromises.clear(), transport.disconnect?.();\n\t\t},\n\t\tsend(data) {\n\t\t\treturn transport.send(data);\n\t\t},\n\t\tasync invoke(name, data) {\n\t\t\tlet promiseId = nanoid(), wrappedData = {\n\t\t\t\ttype: \"custom\",\n\t\t\t\tevent: \"vite:invoke\",\n\t\t\t\tdata: {\n\t\t\t\t\tname,\n\t\t\t\t\tid: `send:${promiseId}`,\n\t\t\t\t\tdata\n\t\t\t\t}\n\t\t\t}, sendPromise = transport.send(wrappedData), { promise, resolve, reject } = promiseWithResolvers(), timeout = transport.timeout ?? 6e4, timeoutId;\n\t\t\ttimeout > 0 && (timeoutId = setTimeout(() => {\n\t\t\t\trpcPromises.delete(promiseId), reject(/* @__PURE__ */ Error(`transport invoke timed out after ${timeout}ms (data: ${JSON.stringify(wrappedData)})`));\n\t\t\t}, timeout), timeoutId?.unref?.()), rpcPromises.set(promiseId, {\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t\tname,\n\t\t\t\ttimeoutId\n\t\t\t}), sendPromise && sendPromise.catch((err) => {\n\t\t\t\tclearTimeout(timeoutId), rpcPromises.delete(promiseId), reject(err);\n\t\t\t});\n\t\t\ttry {\n\t\t\t\treturn await promise;\n\t\t\t} catch (err) {\n\t\t\t\tthrow reviveInvokeError(err);\n\t\t\t}\n\t\t}\n\t};\n}, normalizeModuleRunnerTransport = (transport) => {\n\tlet invokeableTransport = createInvokeableTransport(transport), isConnected = !invokeableTransport.connect, connectingPromise;\n\treturn {\n\t\t...transport,\n\t\t...invokeableTransport.connect ? { async connect(onMessage) {\n\t\t\tif (isConnected) return;\n\t\t\tif (connectingPromise) {\n\t\t\t\tawait connectingPromise;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet maybePromise = invokeableTransport.connect({\n\t\t\t\tonMessage: onMessage ?? (() => {}),\n\t\t\t\tonDisconnection() {\n\t\t\t\t\tisConnected = !1;\n\t\t\t\t}\n\t\t\t});\n\t\t\tmaybePromise && (connectingPromise = maybePromise, await connectingPromise, connectingPromise = void 0), isConnected = !0;\n\t\t} } : {},\n\t\t...invokeableTransport.disconnect ? { async disconnect() {\n\t\t\tisConnected && (connectingPromise && await connectingPromise, isConnected = !1, await invokeableTransport.disconnect());\n\t\t} } : {},\n\t\tasync send(data) {\n\t\t\tif (invokeableTransport.send) {\n\t\t\t\tif (!isConnected) if (connectingPromise) await connectingPromise;\n\t\t\t\telse throw new SendBeforeConnectError(\"send was called before connect\");\n\t\t\t\tawait invokeableTransport.send(data);\n\t\t\t}\n\t\t},\n\t\tasync invoke(name, data) {\n\t\t\tif (!isConnected) if (connectingPromise) await connectingPromise;\n\t\t\telse throw new SendBeforeConnectError(\"invoke was called before connect\");\n\t\t\treturn invokeableTransport.invoke(name, data);\n\t\t}\n\t};\n};\nvar SendBeforeConnectError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message), this.name = \"SendBeforeConnectError\";\n\t}\n};\nconst createWebSocketModuleRunnerTransport = (options) => {\n\tlet pingInterval = options.pingInterval ?? 3e4, ws, pingIntervalId;\n\treturn {\n\t\tasync connect({ onMessage, onDisconnection }) {\n\t\t\tlet socket = options.createConnection();\n\t\t\tsocket.addEventListener(\"message\", ({ data }) => {\n\t\t\t\tonMessage(JSON.parse(data));\n\t\t\t});\n\t\t\tlet isOpened = socket.readyState === socket.OPEN;\n\t\t\tisOpened || await new Promise((resolve, reject) => {\n\t\t\t\tsocket.addEventListener(\"open\", () => {\n\t\t\t\t\tisOpened = !0, resolve();\n\t\t\t\t}, { once: !0 }), socket.addEventListener(\"close\", () => {\n\t\t\t\t\tif (!isOpened) {\n\t\t\t\t\t\treject(/* @__PURE__ */ Error(\"WebSocket closed without opened.\"));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonMessage({\n\t\t\t\t\t\ttype: \"custom\",\n\t\t\t\t\t\tevent: \"vite:ws:disconnect\",\n\t\t\t\t\t\tdata: { webSocket: socket }\n\t\t\t\t\t}), onDisconnection();\n\t\t\t\t});\n\t\t\t}), onMessage({\n\t\t\t\ttype: \"custom\",\n\t\t\t\tevent: \"vite:ws:connect\",\n\t\t\t\tdata: { webSocket: socket }\n\t\t\t}), ws = socket, pingIntervalId = setInterval(() => {\n\t\t\t\tsocket.readyState === socket.OPEN && socket.send(JSON.stringify({ type: \"ping\" }));\n\t\t\t}, pingInterval);\n\t\t},\n\t\tdisconnect() {\n\t\t\tclearInterval(pingIntervalId), ws?.close();\n\t\t},\n\t\tsend(data) {\n\t\t\tws.send(JSON.stringify(data));\n\t\t}\n\t};\n};\n//#endregion\n//#region src/shared/builtin.ts\nfunction createIsBuiltin(builtins) {\n\tlet plainBuiltinsSet = new Set(builtins.filter((builtin) => typeof builtin == \"string\")), regexBuiltins = builtins.filter((builtin) => typeof builtin != \"string\");\n\treturn (id) => plainBuiltinsSet.has(id) || regexBuiltins.some((regexp) => regexp.test(id));\n}\n//#endregion\n//#region src/module-runner/constants.ts\nconst ssrModuleExportsKey = \"__vite_ssr_exports__\", ssrImportKey = \"__vite_ssr_import__\", ssrDynamicImportKey = \"__vite_ssr_dynamic_import__\", ssrExportAllKey = \"__vite_ssr_exportAll__\", ssrExportNameKey = \"__vite_ssr_exportName__\", ssrImportMetaKey = \"__vite_ssr_import_meta__\", noop = () => {}, silentConsole = {\n\tdebug: noop,\n\terror: noop\n}, hmrLogger = {\n\tdebug: (...msg) => console.log(\"[vite]\", ...msg),\n\terror: (error) => console.log(\"[vite]\", error)\n};\n//#endregion\n//#region src/shared/hmrHandler.ts\nfunction createHMRHandler(handler) {\n\tlet queue = new Queue();\n\treturn (payload) => queue.enqueue(() => handler(payload));\n}\nvar Queue = class {\n\tqueue = [];\n\tpending = !1;\n\tenqueue(promise) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.queue.push({\n\t\t\t\tpromise,\n\t\t\t\tresolve,\n\t\t\t\treject\n\t\t\t}), this.dequeue();\n\t\t});\n\t}\n\tdequeue() {\n\t\tif (this.pending) return !1;\n\t\tlet item = this.queue.shift();\n\t\treturn item ? (this.pending = !0, item.promise().then(item.resolve).catch(item.reject).finally(() => {\n\t\t\tthis.pending = !1, this.dequeue();\n\t\t}), !0) : !1;\n\t}\n};\n//#endregion\n//#region src/module-runner/hmrHandler.ts\nfunction createHMRHandlerForRunner(runner) {\n\treturn createHMRHandler(async (payload) => {\n\t\tlet hmrClient = runner.hmrClient;\n\t\tif (!(!hmrClient || runner.isClosed())) switch (payload.type) {\n\t\t\tcase \"connected\":\n\t\t\t\thmrClient.logger.debug(\"connected.\");\n\t\t\t\tbreak;\n\t\t\tcase \"update\":\n\t\t\t\tawait hmrClient.notifyListeners(\"vite:beforeUpdate\", payload), await Promise.all(payload.updates.map(async (update) => {\n\t\t\t\t\tif (update.type === \"js-update\") return update.acceptedPath = unwrapId(update.acceptedPath), update.path = unwrapId(update.path), hmrClient.queueUpdate(update);\n\t\t\t\t\thmrClient.logger.error(\"css hmr is not supported in runner mode.\");\n\t\t\t\t})), await hmrClient.notifyListeners(\"vite:afterUpdate\", payload);\n\t\t\t\tbreak;\n\t\t\tcase \"custom\":\n\t\t\t\tawait hmrClient.notifyListeners(payload.event, payload.data);\n\t\t\t\tbreak;\n\t\t\tcase \"full-reload\": {\n\t\t\t\tlet { triggeredBy } = payload, clearEntrypointUrls = triggeredBy ? getModulesEntrypoints(runner, getModulesByFile(runner, slash(triggeredBy))) : findAllEntrypoints(runner);\n\t\t\t\tif (!clearEntrypointUrls.size) break;\n\t\t\t\thmrClient.logger.debug(\"program reload\"), await hmrClient.notifyListeners(\"vite:beforeFullReload\", payload), runner.evaluatedModules.clear();\n\t\t\t\tfor (let url of clearEntrypointUrls) {\n\t\t\t\t\tif (runner.isClosed()) break;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait runner.import(url);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tif (runner.isClosed()) break;\n\t\t\t\t\t\terr.code !== \"ERR_OUTDATED_OPTIMIZED_DEP\" && hmrClient.logger.error(`An error happened during full reload\\n${err.message}\\n${err.stack}`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"prune\":\n\t\t\t\tawait hmrClient.notifyListeners(\"vite:beforePrune\", payload), await hmrClient.prunePaths(payload.paths);\n\t\t\t\tbreak;\n\t\t\tcase \"error\": {\n\t\t\t\tawait hmrClient.notifyListeners(\"vite:error\", payload);\n\t\t\t\tlet err = payload.err;\n\t\t\t\thmrClient.logger.error(`Internal Server Error\\n${err.message}\\n${err.stack}`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"ping\": break;\n\t\t\tdefault: return payload;\n\t\t}\n\t});\n}\nfunction getModulesByFile(runner, file) {\n\tlet nodes = runner.evaluatedModules.getModulesByFile(file);\n\treturn nodes ? [...nodes].map((node) => node.id) : [];\n}\nfunction getModulesEntrypoints(runner, modules, visited = /* @__PURE__ */ new Set(), entrypoints = /* @__PURE__ */ new Set()) {\n\tfor (let moduleId of modules) {\n\t\tif (visited.has(moduleId)) continue;\n\t\tvisited.add(moduleId);\n\t\tlet module = runner.evaluatedModules.getModuleById(moduleId);\n\t\tif (module) {\n\t\t\tif (!module.importers.size) {\n\t\t\t\tentrypoints.add(module.url);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor (let importer of module.importers) getModulesEntrypoints(runner, [importer], visited, entrypoints);\n\t\t}\n\t}\n\treturn entrypoints;\n}\nfunction findAllEntrypoints(runner, entrypoints = /* @__PURE__ */ new Set()) {\n\tfor (let mod of runner.evaluatedModules.idToModuleMap.values()) mod.importers.size || entrypoints.add(mod.url);\n\treturn entrypoints;\n}\n//#endregion\n//#region src/module-runner/sourcemap/interceptor.ts\nconst sourceMapCache = {}, fileContentsCache = {}, evaluatedModulesCache = /* @__PURE__ */ new Set(), retrieveFileHandlers = /* @__PURE__ */ new Set(), retrieveSourceMapHandlers = /* @__PURE__ */ new Set(), createExecHandlers = (handlers) => ((...args) => {\n\tfor (let handler of handlers) {\n\t\tlet result = handler(...args);\n\t\tif (result) return result;\n\t}\n\treturn null;\n}), retrieveFileFromHandlers = createExecHandlers(retrieveFileHandlers), retrieveSourceMapFromHandlers = createExecHandlers(retrieveSourceMapHandlers);\nlet overridden = !1;\nconst originalPrepare = Error.prepareStackTrace;\nfunction resetInterceptor(runner, options) {\n\tevaluatedModulesCache.delete(runner.evaluatedModules), options.retrieveFile && retrieveFileHandlers.delete(options.retrieveFile), options.retrieveSourceMap && retrieveSourceMapHandlers.delete(options.retrieveSourceMap), evaluatedModulesCache.size === 0 && (Error.prepareStackTrace = originalPrepare, overridden = !1);\n}\nfunction interceptStackTrace(runner, options = {}) {\n\treturn overridden ||= (Error.prepareStackTrace = prepareStackTrace, !0), evaluatedModulesCache.add(runner.evaluatedModules), options.retrieveFile && retrieveFileHandlers.add(options.retrieveFile), options.retrieveSourceMap && retrieveSourceMapHandlers.add(options.retrieveSourceMap), () => resetInterceptor(runner, options);\n}\nfunction supportRelativeURL(file, url) {\n\tif (!file) return url;\n\tlet dir = posixDirname(slash(file)), match = /^\\w+:\\/\\/[^/]*/.exec(dir), protocol = match ? match[0] : \"\", startPath = dir.slice(protocol.length);\n\treturn protocol && /^\\/\\w:/.test(startPath) ? (protocol += \"/\", protocol + slash(posixResolve(startPath, url))) : protocol + posixResolve(startPath, url);\n}\nfunction getRunnerSourceMap(position) {\n\tfor (let moduleGraph of evaluatedModulesCache) {\n\t\tlet sourceMap = moduleGraph.getModuleSourceMapById(position.source);\n\t\tif (sourceMap) return {\n\t\t\turl: position.source,\n\t\t\tmap: sourceMap,\n\t\t\tvite: !0\n\t\t};\n\t}\n\treturn null;\n}\nfunction retrieveFile(path) {\n\tif (path in fileContentsCache) return fileContentsCache[path];\n\tlet content = retrieveFileFromHandlers(path);\n\treturn typeof content == \"string\" ? (fileContentsCache[path] = content, content) : null;\n}\nfunction retrieveSourceMapURL(source) {\n\tlet fileData = retrieveFile(source);\n\tif (!fileData) return null;\n\tlet re = /\\/\\/[@#]\\s*sourceMappingURL=([^\\s'\"]+)\\s*$|\\/\\*[@#]\\s*sourceMappingURL=[^\\s*'\"]+\\s*\\*\\/\\s*$/gm, lastMatch, match;\n\tfor (; match = re.exec(fileData);) lastMatch = match;\n\treturn lastMatch ? lastMatch[1] : null;\n}\nconst reSourceMap = /^data:application\\/json[^,]+base64,/;\nfunction retrieveSourceMap(source) {\n\tlet urlAndMap = retrieveSourceMapFromHandlers(source);\n\tif (urlAndMap) return urlAndMap;\n\tlet sourceMappingURL = retrieveSourceMapURL(source);\n\tif (!sourceMappingURL) return null;\n\tlet sourceMapData;\n\tif (reSourceMap.test(sourceMappingURL)) {\n\t\tlet rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(\",\") + 1);\n\t\tsourceMapData = Buffer.from(rawData, \"base64\").toString(), sourceMappingURL = source;\n\t} else sourceMappingURL = supportRelativeURL(source, sourceMappingURL), sourceMapData = retrieveFile(sourceMappingURL);\n\treturn sourceMapData ? {\n\t\turl: sourceMappingURL,\n\t\tmap: sourceMapData\n\t} : null;\n}\nfunction mapSourcePosition(position) {\n\tif (!position.source) return position;\n\tlet sourceMap = getRunnerSourceMap(position);\n\tif (sourceMap ||= sourceMapCache[position.source], !sourceMap) {\n\t\tlet urlAndMap = retrieveSourceMap(position.source);\n\t\tif (urlAndMap && urlAndMap.map) {\n\t\t\tlet url = urlAndMap.url;\n\t\t\tsourceMap = sourceMapCache[position.source] = {\n\t\t\t\turl,\n\t\t\t\tmap: new DecodedMap(typeof urlAndMap.map == \"string\" ? JSON.parse(urlAndMap.map) : urlAndMap.map, url)\n\t\t\t};\n\t\t\tlet contents = sourceMap.map?.map.sourcesContent;\n\t\t\tsourceMap.map && contents && sourceMap.map.resolvedSources.forEach((source, i) => {\n\t\t\t\tlet content = contents[i];\n\t\t\t\tif (content && source && url) {\n\t\t\t\t\tlet contentUrl = supportRelativeURL(url, source);\n\t\t\t\t\tfileContentsCache[contentUrl] = content;\n\t\t\t\t}\n\t\t\t});\n\t\t} else sourceMap = sourceMapCache[position.source] = {\n\t\t\turl: null,\n\t\t\tmap: null\n\t\t};\n\t}\n\tif (sourceMap.map && sourceMap.url) {\n\t\tlet originalPosition = getOriginalPosition(sourceMap.map, position);\n\t\tif (originalPosition && originalPosition.source != null) return originalPosition.source = supportRelativeURL(sourceMap.url, originalPosition.source), sourceMap.vite && (originalPosition._vite = !0), originalPosition;\n\t}\n\treturn position;\n}\nfunction mapEvalOrigin(origin) {\n\tlet match = /^eval at ([^(]+) \\((.+):(\\d+):(\\d+)\\)$/.exec(origin);\n\tif (match) {\n\t\tlet position = mapSourcePosition({\n\t\t\tname: null,\n\t\t\tsource: match[2],\n\t\t\tline: +match[3],\n\t\t\tcolumn: match[4] - 1\n\t\t});\n\t\treturn `eval at ${match[1]} (${position.source}:${position.line}:${position.column + 1})`;\n\t}\n\treturn match = /^eval at ([^(]+) \\((.+)\\)$/.exec(origin), match ? `eval at ${match[1]} (${mapEvalOrigin(match[2])})` : origin;\n}\nfunction CallSiteToString() {\n\tlet fileName, fileLocation = \"\";\n\tif (this.isNative()) fileLocation = \"native\";\n\telse {\n\t\tfileName = this.getScriptNameOrSourceURL(), !fileName && this.isEval() && (fileLocation = this.getEvalOrigin(), fileLocation += \", \"), fileName ? fileLocation += fileName : fileLocation += \"<anonymous>\";\n\t\tlet lineNumber = this.getLineNumber();\n\t\tif (lineNumber != null) {\n\t\t\tfileLocation += `:${lineNumber}`;\n\t\t\tlet columnNumber = this.getColumnNumber();\n\t\t\tcolumnNumber && (fileLocation += `:${columnNumber}`);\n\t\t}\n\t}\n\tlet line = \"\", functionName = this.getFunctionName(), addSuffix = !0, isConstructor = this.isConstructor();\n\tif (this.isToplevel() || isConstructor) isConstructor ? line += `new ${functionName || \"<anonymous>\"}` : functionName ? line += functionName : (line += fileLocation, addSuffix = !1);\n\telse {\n\t\tlet typeName = this.getTypeName();\n\t\ttypeName === \"[object Object]\" && (typeName = \"null\");\n\t\tlet methodName = this.getMethodName();\n\t\tfunctionName ? (typeName && functionName.indexOf(typeName) !== 0 && (line += `${typeName}.`), line += functionName, methodName && functionName.indexOf(`.${methodName}`) !== functionName.length - methodName.length - 1 && (line += ` [as ${methodName}]`)) : line += `${typeName}.${methodName || \"<anonymous>\"}`;\n\t}\n\treturn addSuffix && (line += ` (${fileLocation})`), line;\n}\nfunction cloneCallSite(frame) {\n\tlet object = {};\n\treturn Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach((name) => {\n\t\tlet key = name;\n\t\tobject[key] = /^(?:is|get)/.test(name) ? function() {\n\t\t\treturn frame[key].call(frame);\n\t\t} : frame[key];\n\t}), object.toString = CallSiteToString, object;\n}\nfunction wrapCallSite(frame, state) {\n\tif (state === void 0 && (state = {\n\t\tnextPosition: null,\n\t\tcurPosition: null\n\t}), frame.isNative()) return state.curPosition = null, frame;\n\tlet source = frame.getFileName() || frame.getScriptNameOrSourceURL();\n\tif (source) {\n\t\tlet position = mapSourcePosition({\n\t\t\tname: null,\n\t\t\tsource,\n\t\t\tline: frame.getLineNumber() ?? 0,\n\t\t\tcolumn: (frame.getColumnNumber() ?? 1) - 1\n\t\t});\n\t\tstate.curPosition = position, frame = cloneCallSite(frame);\n\t\tlet originalFunctionName = frame.getFunctionName;\n\t\treturn frame.getFunctionName = function() {\n\t\t\tlet name = state.nextPosition == null ? originalFunctionName() : state.nextPosition.name || originalFunctionName();\n\t\t\treturn name === \"eval\" && \"_vite\" in position ? null : name;\n\t\t}, frame.getFileName = function() {\n\t\t\treturn position.source ?? null;\n\t\t}, frame.getLineNumber = function() {\n\t\t\treturn position.line;\n\t\t}, frame.getColumnNumber = function() {\n\t\t\treturn position.column + 1;\n\t\t}, frame.getScriptNameOrSourceURL = function() {\n\t\t\treturn position.source;\n\t\t}, frame;\n\t}\n\tlet origin = frame.isEval() && frame.getEvalOrigin();\n\treturn origin ? (origin = mapEvalOrigin(origin), frame = cloneCallSite(frame), frame.getEvalOrigin = function() {\n\t\treturn origin || void 0;\n\t}, frame) : frame;\n}\nfunction prepareStackTrace(error, stack) {\n\tlet errorString = `${error.name || \"Error\"}: ${error.message || \"\"}`, state = {\n\t\tnextPosition: null,\n\t\tcurPosition: null\n\t}, processedStack = [];\n\tfor (let i = stack.length - 1; i >= 0; i--) processedStack.push(`\\n    at ${wrapCallSite(stack[i], state)}`), state.nextPosition = state.curPosition;\n\treturn state.curPosition = state.nextPosition = null, errorString + processedStack.reverse().join(\"\");\n}\n//#endregion\n//#region src/module-runner/sourcemap/index.ts\nfunction enableSourceMapSupport(runner) {\n\tif (runner.options.sourcemapInterceptor === \"node\") {\n\t\tif (typeof process > \"u\") throw TypeError(\"Cannot use \\\"sourcemapInterceptor: 'node'\\\" because global \\\"process\\\" variable is not available.\");\n\t\tif (typeof process.setSourceMapsEnabled != \"function\") throw TypeError(\"Cannot use \\\"sourcemapInterceptor: 'node'\\\" because \\\"process.setSourceMapsEnabled\\\" function is not available. Please use Node >= 16.6.0.\");\n\t\tlet isEnabledAlready = process.sourceMapsEnabled ?? !1;\n\t\treturn process.setSourceMapsEnabled(!0), () => !isEnabledAlready && process.setSourceMapsEnabled(!1);\n\t}\n\treturn interceptStackTrace(runner, typeof runner.options.sourcemapInterceptor == \"object\" ? runner.options.sourcemapInterceptor : void 0);\n}\n//#endregion\n//#region src/module-runner/esmEvaluator.ts\nvar ESModulesEvaluator = class {\n\tstartOffset = getAsyncFunctionDeclarationPaddingLineCount();\n\tasync runInlinedModule(context, code) {\n\t\tawait new AsyncFunction(ssrModuleExportsKey, ssrImportMetaKey, ssrImportKey, ssrDynamicImportKey, ssrExportAllKey, ssrExportNameKey, \"\\\"use strict\\\";\" + code)(context[ssrModuleExportsKey], context[ssrImportMetaKey], context[ssrImportKey], context[ssrDynamicImportKey], context[ssrExportAllKey], context[ssrExportNameKey]), Object.seal(context[ssrModuleExportsKey]);\n\t}\n\trunExternalModule(filepath) {\n\t\treturn import(filepath);\n\t}\n};\n//#endregion\n//#region src/module-runner/importMetaResolver.ts\nconst customizationHookNamespace = \"vite-module-runner:import-meta-resolve/v1/\", customizationHooksModule = `\n\nexport async function resolve(specifier, context, nextResolve) {\n  if (specifier.startsWith(${JSON.stringify(customizationHookNamespace)})) {\n    const data = specifier.slice(${JSON.stringify(customizationHookNamespace)}.length)\n    const [parsedSpecifier, parsedImporter] = JSON.parse(data)\n    specifier = parsedSpecifier\n    context.parentURL = parsedImporter\n  }\n  return nextResolve(specifier, context)\n}\n\n`;\nfunction customizationHookResolve(specifier, context, nextResolve) {\n\tif (specifier.startsWith(customizationHookNamespace)) {\n\t\tlet data = specifier.slice(42), [parsedSpecifier, parsedImporter] = JSON.parse(data);\n\t\tspecifier = parsedSpecifier, context.parentURL = parsedImporter;\n\t}\n\treturn nextResolve(specifier, context);\n}\nlet isHookRegistered = !1;\nfunction createImportMetaResolver() {\n\tif (isHookRegistered) return importMetaResolveWithCustomHook;\n\tlet module;\n\ttry {\n\t\tmodule = typeof process < \"u\" ? process.getBuiltinModule(\"node:module\").Module : void 0;\n\t} catch {\n\t\treturn;\n\t}\n\tif (module) {\n\t\tif (module.registerHooks) return module.registerHooks({ resolve: customizationHookResolve }), isHookRegistered = !0, importMetaResolveWithCustomHook;\n\t\tif (module.register) {\n\t\t\ttry {\n\t\t\t\tlet hookModuleContent = `data:text/javascript,${encodeURI(customizationHooksModule)}`;\n\t\t\t\tmodule.register(hookModuleContent);\n\t\t\t} catch (e) {\n\t\t\t\tif (\"code\" in e && e.code === \"ERR_NETWORK_IMPORT_DISALLOWED\") return;\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t\treturn isHookRegistered = !0, importMetaResolveWithCustomHook;\n\t\t}\n\t}\n}\nfunction importMetaResolveWithCustomHook(specifier, importer) {\n\treturn import.meta.resolve(`${customizationHookNamespace}${JSON.stringify([specifier, importer])}`);\n}\n//#endregion\n//#region src/module-runner/createImportMeta.ts\nconst envProxy = new Proxy({}, { get(_, p) {\n\tthrow Error(`[module runner] Dynamic access of \"import.meta.env\" is not supported. Please, use \"import.meta.env.${String(p)}\" instead.`);\n} });\nfunction createDefaultImportMeta(modulePath) {\n\tlet href = posixPathToFileHref(modulePath), filename = modulePath, dirname = posixDirname(modulePath);\n\treturn {\n\t\tfilename: isWindows ? toWindowsPath(filename) : filename,\n\t\tdirname: isWindows ? toWindowsPath(dirname) : dirname,\n\t\turl: href,\n\t\tenv: envProxy,\n\t\tresolve(_id, _parent) {\n\t\t\tthrow Error(\"[module runner] \\\"import.meta.resolve\\\" is not supported.\");\n\t\t},\n\t\tglob() {\n\t\t\tthrow Error(\"[module runner] \\\"import.meta.glob\\\" is statically replaced during file transformation. Make sure to reference it by the full name.\");\n\t\t}\n\t};\n}\n/**\n* Create import.meta object for Node.js.\n*/\nfunction createNodeImportMeta(modulePath) {\n\tlet defaultMeta = createDefaultImportMeta(modulePath), href = defaultMeta.url, importMetaResolver = createImportMetaResolver();\n\treturn {\n\t\t...defaultMeta,\n\t\tmain: !1,\n\t\tresolve(id, parent) {\n\t\t\treturn (importMetaResolver ?? defaultMeta.resolve)(id, parent ?? href);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/module-runner/runner.ts\nvar ModuleRunner = class {\n\toptions;\n\tevaluator;\n\tdebug;\n\tevaluatedModules;\n\thmrClient;\n\ttransport;\n\tresetSourceMapSupport;\n\tconcurrentModuleNodePromises = /* @__PURE__ */ new Map();\n\tisBuiltin;\n\tbuiltinsPromise;\n\tclosed = !1;\n\tconstructor(options, evaluator = new ESModulesEvaluator(), debug) {\n\t\tif (this.options = options, this.evaluator = evaluator, this.debug = debug, this.evaluatedModules = options.evaluatedModules ?? new EvaluatedModules(), this.transport = normalizeModuleRunnerTransport(options.transport), options.hmr !== !1) {\n\t\t\tlet optionsHmr = options.hmr ?? !0, resolvedHmrLogger = optionsHmr === !0 || optionsHmr.logger === void 0 ? hmrLogger : optionsHmr.logger === !1 ? silentConsole : optionsHmr.logger;\n\t\t\tif (this.hmrClient = new HMRClient(resolvedHmrLogger, this.transport, ({ acceptedPath }) => this.import(acceptedPath)), !this.transport.connect) throw Error(\"HMR is not supported by this runner transport, but `hmr` option was set to true\");\n\t\t\tthis.transport.connect(createHMRHandlerForRunner(this));\n\t\t} else this.transport.connect?.();\n\t\toptions.sourcemapInterceptor !== !1 && (this.resetSourceMapSupport = enableSourceMapSupport(this));\n\t}\n\t/**\n\t* URL to execute. Accepts file path, server path or id relative to the root.\n\t*/\n\tasync import(url) {\n\t\tlet fetchedModule = await this.cachedModule(url);\n\t\treturn await this.cachedRequest(url, fetchedModule);\n\t}\n\t/**\n\t* Clear all caches including HMR listeners.\n\t*/\n\tclearCache() {\n\t\tthis.evaluatedModules.clear(), this.hmrClient?.clear();\n\t}\n\t/**\n\t* Clears all caches, removes all HMR listeners, and resets source map support.\n\t* This method doesn't stop the HMR connection.\n\t*/\n\tasync close() {\n\t\tthis.resetSourceMapSupport?.(), this.clearCache(), this.hmrClient = void 0, this.closed = !0, await this.transport.disconnect?.();\n\t}\n\t/**\n\t* Returns `true` if the runtime has been closed by calling `close()` method.\n\t*/\n\tisClosed() {\n\t\treturn this.closed;\n\t}\n\tprocessImport(exports, fetchResult, metadata) {\n\t\tif (!(\"externalize\" in fetchResult)) return exports;\n\t\tlet { url, type } = fetchResult;\n\t\treturn type !== \"module\" && type !== \"commonjs\" || analyzeImportedModDifference(exports, url, type, metadata), exports;\n\t}\n\tisCircularRequest(mod, callstack, visited = /* @__PURE__ */ new Set()) {\n\t\tif (visited.has(mod.id)) return !1;\n\t\tvisited.add(mod.id);\n\t\tfor (let importedModuleId of mod.imports) {\n\t\t\tif (callstack.includes(importedModuleId)) return !0;\n\t\t\tlet importedModule = this.evaluatedModules.getModuleById(importedModuleId);\n\t\t\tif (importedModule?.promise && !importedModule.evaluated && this.isCircularRequest(importedModule, callstack, visited)) return !0;\n\t\t}\n\t\treturn !1;\n\t}\n\tasync cachedRequest(url, mod, callstack = [], metadata) {\n\t\tlet meta = mod.meta, moduleId = meta.id, importee = callstack[callstack.length - 1];\n\t\tif (importee && mod.importers.add(importee), mod.evaluated && mod.promise) return this.processImport(await mod.promise, meta, metadata);\n\t\tif (mod.promise) return mod.exports && (callstack.includes(moduleId) || this.isCircularRequest(mod, callstack)) ? this.processImport(mod.exports, meta, metadata) : this.processImport(await mod.promise, meta, metadata);\n\t\tlet debugTimer;\n\t\tthis.debug && (debugTimer = setTimeout(() => {\n\t\t\tthis.debug(`[module runner] module ${moduleId} takes over 2s to load.\\n${`stack:\\n${[...callstack, moduleId].reverse().map((p) => `  - ${p}`).join(\"\\n\")}`}`);\n\t\t}, 2e3));\n\t\ttry {\n\t\t\tlet promise = this.directRequest(url, mod, callstack);\n\t\t\treturn mod.promise = promise, mod.evaluated = !1, this.processImport(await promise, meta, metadata);\n\t\t} finally {\n\t\t\tmod.evaluated = !0, debugTimer && clearTimeout(debugTimer);\n\t\t}\n\t}\n\tasync cachedModule(url, importer) {\n\t\tlet cached = this.concurrentModuleNodePromises.get(url);\n\t\tif (cached) this.debug?.(\"[module runner] using cached module info for\", url);\n\t\telse {\n\t\t\tlet cachedModule = this.evaluatedModules.getModuleByUrl(url);\n\t\t\tcached = this.getModuleInformation(url, importer, cachedModule).finally(() => {\n\t\t\t\tthis.concurrentModuleNodePromises.delete(url);\n\t\t\t}), this.concurrentModuleNodePromises.set(url, cached);\n\t\t}\n\t\treturn cached;\n\t}\n\tensureBuiltins() {\n\t\tif (!this.isBuiltin) return this.builtinsPromise ??= (async () => {\n\t\t\ttry {\n\t\t\t\tthis.debug?.(\"[module runner] fetching builtins from server\");\n\t\t\t\tlet builtins = (await this.transport.invoke(\"getBuiltins\", [])).map((builtin) => typeof builtin == \"object\" && builtin && \"type\" in builtin ? builtin.type === \"string\" ? builtin.value : new RegExp(builtin.source, builtin.flags) : builtin);\n\t\t\t\tthis.isBuiltin = createIsBuiltin(builtins), this.debug?.(\"[module runner] builtins loaded:\", builtins);\n\t\t\t} finally {\n\t\t\t\tthis.builtinsPromise = void 0;\n\t\t\t}\n\t\t})(), this.builtinsPromise;\n\t}\n\tasync getModuleInformation(url, importer, cachedModule) {\n\t\tif (this.closed) throw Error(\"Vite module runner has been closed.\");\n\t\tawait this.ensureBuiltins(), this.debug?.(\"[module runner] fetching\", url);\n\t\tlet isCached = !!(typeof cachedModule == \"object\" && cachedModule.meta), fetchedModule = url.startsWith(\"data:\") || this.isBuiltin?.(url) ? {\n\t\t\texternalize: url,\n\t\t\ttype: \"builtin\"\n\t\t} : await this.transport.invoke(\"fetchModule\", [\n\t\t\turl,\n\t\t\timporter,\n\t\t\t{\n\t\t\t\tcached: isCached,\n\t\t\t\tstartOffset: this.evaluator.startOffset\n\t\t\t}\n\t\t]);\n\t\tif (\"cache\" in fetchedModule) {\n\t\t\tif (!cachedModule || !cachedModule.meta) throw Error(`Module \"${url}\" was mistakenly invalidated during fetch phase.`);\n\t\t\treturn cachedModule;\n\t\t}\n\t\tlet moduleId = \"externalize\" in fetchedModule ? fetchedModule.externalize : fetchedModule.id, moduleUrl = \"url\" in fetchedModule ? fetchedModule.url : url, module = this.evaluatedModules.ensureModule(moduleId, moduleUrl);\n\t\treturn \"invalidate\" in fetchedModule && fetchedModule.invalidate && this.evaluatedModules.invalidateModule(module), fetchedModule.url = moduleUrl, fetchedModule.id = moduleId, module.meta = fetchedModule, module;\n\t}\n\tasync directRequest(url, mod, _callstack) {\n\t\tlet fetchResult = mod.meta, moduleId = fetchResult.id, callstack = [..._callstack, moduleId], request = async (dep, metadata) => {\n\t\t\tlet importer = \"file\" in fetchResult && fetchResult.file || moduleId, depMod = await this.cachedModule(dep, importer);\n\t\t\treturn depMod.importers.add(moduleId), mod.imports.add(depMod.id), this.cachedRequest(dep, depMod, callstack, metadata);\n\t\t}, dynamicRequest = async (dep) => (dep = String(dep), dep[0] === \".\" && (dep = posixResolve(posixDirname(url), dep)), request(dep, { isDynamicImport: !0 }));\n\t\tif (\"externalize\" in fetchResult) {\n\t\t\tlet { externalize } = fetchResult;\n\t\t\tthis.debug?.(\"[module runner] externalizing\", externalize);\n\t\t\tlet exports = await this.evaluator.runExternalModule(externalize);\n\t\t\treturn mod.exports = exports, exports;\n\t\t}\n\t\tlet { code, file } = fetchResult;\n\t\tif (code == null) {\n\t\t\tlet importer = callstack[callstack.length - 2];\n\t\t\tthrow Error(`[module runner] Failed to load \"${url}\"${importer ? ` imported from ${importer}` : \"\"}`);\n\t\t}\n\t\tlet createImportMeta = this.options.createImportMeta ?? createDefaultImportMeta, modulePath = cleanUrl(file || moduleId), href = posixPathToFileHref(modulePath), meta = await createImportMeta(modulePath), exports = Object.create(null);\n\t\tObject.defineProperty(exports, Symbol.toStringTag, {\n\t\t\tvalue: \"Module\",\n\t\t\tenumerable: !1,\n\t\t\tconfigurable: !1\n\t\t}), mod.exports = exports;\n\t\tlet hotContext;\n\t\tthis.hmrClient && Object.defineProperty(meta, \"hot\", {\n\t\t\tenumerable: !0,\n\t\t\tget: () => {\n\t\t\t\tif (!this.hmrClient) throw Error(\"[module runner] HMR client was closed.\");\n\t\t\t\treturn this.debug?.(\"[module runner] creating hmr context for\", mod.url), hotContext ||= new HMRContext(this.hmrClient, mod.url), hotContext;\n\t\t\t},\n\t\t\tset: (value) => {\n\t\t\t\thotContext = value;\n\t\t\t}\n\t\t});\n\t\tlet context = {\n\t\t\t[ssrImportKey]: request,\n\t\t\t[ssrDynamicImportKey]: dynamicRequest,\n\t\t\t[ssrModuleExportsKey]: exports,\n\t\t\t[ssrExportAllKey]: (obj) => exportAll(exports, obj),\n\t\t\t[ssrExportNameKey]: (name, getter) => Object.defineProperty(exports, name, {\n\t\t\t\tenumerable: !0,\n\t\t\t\tconfigurable: !0,\n\t\t\t\tget: getter\n\t\t\t}),\n\t\t\t[ssrImportMetaKey]: meta\n\t\t};\n\t\treturn this.debug?.(\"[module runner] executing\", href), await this.evaluator.runInlinedModule(context, code, mod), exports;\n\t}\n};\nfunction exportAll(exports, sourceModule) {\n\tif (exports !== sourceModule && !(isPrimitive(sourceModule) || Array.isArray(sourceModule) || sourceModule instanceof Promise)) {\n\t\tfor (let key in sourceModule) if (key !== \"default\" && key !== \"__esModule\" && !(key in exports)) try {\n\t\t\tObject.defineProperty(exports, key, {\n\t\t\t\tenumerable: !0,\n\t\t\t\tconfigurable: !0,\n\t\t\t\tget: () => sourceModule[key]\n\t\t\t});\n\t\t} catch {}\n\t}\n}\n//#endregion\nexport { ESModulesEvaluator, EvaluatedModules, ModuleRunner, createDefaultImportMeta, createNodeImportMeta, createWebSocketModuleRunnerTransport, normalizeModuleId, ssrDynamicImportKey, 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