{"version":3,"sources":["../src/vitePluginVercelApi.ts","../src/createRoutesAndHandlers.ts","../src/buildEntryPoints.ts","../src/esbuildPlugins/requireToEsmPlugin.ts","../src/esbuildPlugins/fileUrlPlugin.ts","../src/utils.ts","../node_modules/chalk/source/vendor/ansi-styles/index.js","../node_modules/chalk/source/vendor/supports-color/index.js","../node_modules/chalk/source/utilities.js","../node_modules/chalk/source/index.js","../src/createRouteHandlerData.ts","../src/middlewareHelpers/addReqBodyMiddleware.ts","../src/middlewareHelpers/reqCookiesMiddleware.ts"],"sourcesContent":["import type {Connect, PluginOption} from 'vite'\nimport express from 'express'\nimport createRoutesAndHandlers from './createRoutesAndHandlers'\nimport type {RequestHandler} from 'express'\nimport addReqBodyMiddleware from './middlewareHelpers/addReqBodyMiddleware'\nimport reqCookiesMiddleware from './middlewareHelpers/reqCookiesMiddleware'\n\nexport type VitePluginVercelApiOptionsType = {\n  apiDir?: string\n}\n\n/**\n *\n * Mimics Vercel's /api functionality locally. No need to be online or run\n * `vercel dev`. You can simply run `npm run dev` to start Vite locally and use\n * the /api directory the same way Vercel parses it in production.\n *\n * This plugin provides 2 main features:\n * 1. Traverses the /api directory at the root of your project and parses files\n *    the same way Vercel does in production.\n * 2. Adds a number of middleware features found on the request and response\n *    objects in Vercel's serverless functions.\n *\n * See https://nextjs.org/docs/api-routes/dynamic-api-routes for how the logic\n * works for the /api directory, its files, and its folder structure.\n *\n * Please note that Vercel /api features do NOT have parity with Next.js\n * /pages/api. In particular, Vercel does not support [...catchAll] or\n * [[...optionaCatchAll]] routes - see https://github.com/vercel/community/discussions/947.\n *\n * See https://vercel.com/docs/runtimes#official-runtimes/node-js/node-js-request-and-response-objects\n * for what middleware Vercel exposes on the request and response objects in\n * serverless functions.\n *\n */\nexport default function vitePluginVercelApi(\n  options: VitePluginVercelApiOptionsType = {}\n): PluginOption {\n  return {\n    name: 'vite-plugin-vercel-api',\n    async configureServer(devServer) {\n      const routesAndHandlers = await createRoutesAndHandlers({\n        apiDir: options.apiDir ?? 'api',\n      })\n\n      // Do nothing if the user doesn't have back end routes to parse.\n      if (routesAndHandlers.length === 0) return\n\n      // Express will handle all our routing and most of our middleware.\n      const app = express()\n\n      /*\n        Vercel doesn't parse path params the same way Express does. Instead,\n        Vercel populates `req.query` with those values. In the case of a clash\n        between a path segment (param) and a query (i.e. /:name?name=qodesmith),\n        Vercel prioritizes the path segment value. This middleware will move\n        Express' req.params values to req.query, mimicing Vercel in production.\n      */\n      const paramsToQueryMiddleware: RequestHandler = (req, res, next) => {\n        req.query = {...req.query, ...req.params}\n        next()\n      }\n\n      // Add all the routes to our Express app.\n      routesAndHandlers.forEach(({route, handler}) => {\n        app.use(route, paramsToQueryMiddleware, handler)\n      })\n\n      // Add middleware that express doesn't give us out of the box.\n      addReqBodyMiddleware(devServer) // req.body\n      devServer.middlewares.use(\n        reqCookiesMiddleware as Connect.NextHandleFunction\n      ) // req.cookies\n\n      /*\n        Instead of trying to figure out how to directly map each handler to the\n        Vercel path syntax (i.e. /api/[first]/[second]), it's easier to convert\n        the Vercel path syntax to Express path syntax (i.e. /api/:first/:seconf)\n        and add route handlers to an Express app. Then we use the entire Express\n        app as middleware to the Vite devServer. #winWin\n      */\n      devServer.middlewares.use(app)\n\n      // TODO: rebuild `/api` files when they are added, removed, or changed.\n      // TODO: do we need an option to prevent transforming require() calls?\n    },\n  }\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\nimport type {RequestHandler} from 'express'\nimport buildEntryPoints from './buildEntryPoints'\nimport createRouteHandlerData from './createRouteHandlerData'\nimport {isValidFile} from './utils'\n\ntype RouteAndHandlerType = {\n  route: string\n  handler: RequestHandler\n}\n\nexport default async function createRoutesAndHandlers({\n  apiDir,\n}): Promise<RouteAndHandlerType[]> {\n  // Do nothing if the user doesn't have back end routes to parse.\n  const apiPath = path.join(process.cwd(), apiDir)\n  const apiDirExists = fs.existsSync(apiPath)\n  if (apiDirExists === false) return []\n\n  const entryPoints = getHandlerPaths(apiPath)\n  const buildResults = await buildEntryPoints(entryPoints)\n  const routeHandlerData = await createRouteHandlerData({\n    buildResults,\n    entryPoints,\n  })\n\n  return routeHandlerData\n}\n\nfunction getHandlerPaths(dir: string): string[] {\n  return fs.readdirSync(dir, {withFileTypes: true}).reduce((acc, dirent) => {\n    const {name} = dirent\n    if (dirent.isFile() && isValidFile(name)) {\n      acc.push(`${dir}/${name}`)\n    } else if (dirent.isDirectory()) {\n      const dirContents = getHandlerPaths(`${dir}/${name}`)\n      acc.push(...dirContents)\n    }\n\n    return acc\n  }, [] as string[])\n}\n","import esbuild from 'esbuild'\nimport requireToEsmPlugin from './esbuildPlugins/requireToEsmPlugin'\nimport fileUrlPlugin from './esbuildPlugins/fileUrlPlugin'\n\nexport default function buildEntryPoints(entryPoints: string[]) {\n  return esbuild.build({\n    // Have esbuild process many files at once.\n    entryPoints,\n\n    // Avoid bundling anything from node_modules. They're accessible in dev.\n    external: ['./node_modules/*'],\n\n    /*\n      Bundle local dependencies (node_modules is ignored above). Anything from\n      node_modules can be imported and used at runtime.\n    */\n    bundle: true,\n\n    // After all, this is for mimicing Vercel's /api functionality in Node.\n    platform: 'node',\n\n    // Stick with esm as opposed to CommonJS.\n    format: 'esm',\n\n    // Don't write the results to any file, keep it in memory for later use.\n    write: false,\n\n    // Helpful while developing and debugging. Doesn't affect the output.\n    metafile: true,\n\n    /*\n      Ensure non-native node_modules have an absolute file://... url.\n      Transform the few require()'s that we have to esm.\n      Vite + Vercel needs require() for node_modules - https://bit.ly/3EiphjJ\n    */\n    plugins: [fileUrlPlugin, requireToEsmPlugin],\n\n    // No output directory will be written to because of `write:false`.\n    outdir: '/api',\n  })\n}\n","import esbuild from 'esbuild'\nimport fs from 'node:fs'\n\nconst requireToEsmPlugin: esbuild.Plugin = {\n  name: 'requireToEsmPlugin',\n  setup(build) {\n    // require() => esm\n    build.onLoad({filter: /.*/}, async args => {\n      /*\n        https://esbuild.github.io/plugins/#on-resolve\n        Many callbacks may be running concurrently. In JavaScript, if your\n        callback does expensive work that can run on another thread such as\n        fs.existsSync(), you should make the callback async and use await\n        (in this case with fs.promises.exists()) to allow other code to run in\n        the meantime.\n      */\n      const fileContents = await fs.promises.readFile(args.path, {\n        encoding: 'utf8',\n      })\n\n      if (fileContents.includes(' = require(')) {\n        // https://ar.al/2021/01/27/commonjs-to-esm-in-node.js - require => esm\n        const regex = /const (.*?)\\s*?=\\s*?require\\(('.*?')\\)/g\n        const newContents = fileContents.replace(regex, 'import $1 from $2')\n        const results = esbuild.transformSync(newContents, {loader: 'ts'})\n\n        return {contents: results.code}\n      }\n\n      return undefined\n    })\n  },\n}\n\nexport default requireToEsmPlugin\n","import type esbuild from 'esbuild'\n\nconst fileUrlPlugin: esbuild.Plugin = {\n  name: 'fileUrlPlugin',\n  setup(build) {\n    // Use a \"match-all\" regex so we can filter on other properties later.\n    build.onResolve({filter: /.*/}, async args => {\n      const {kind, namespace, resolveDir, path: importPath} = args\n\n      /*\n        For non-native node_modules, we're interested in transforming the import\n        path to an absolute `file://...` path.\n      */\n      if (kind === 'import-statement' && namespace === 'file') {\n        /*\n          https://esbuild.github.io/plugins/#resolve\n          Use esbuild's built-in behavior to search for a package in the user's\n          node_modules directory.\n        */\n        const result = await build.resolve(importPath, {resolveDir})\n        const isNativeNodeModule = result.path === importPath\n\n        // Let esbuild continue the process undisturbed.\n        if (!result.external || isNativeNodeModule) return undefined\n\n        /*\n          Explicitly mark non-native node_modules as external and give it an\n          absolute `file://...` path for resolution. This will be used to\n          resolve the file during development.\n        */\n        return {\n          external: true,\n          path: `file://${result.path}`,\n        }\n      }\n\n      return undefined\n    })\n  },\n}\n\nexport default fileUrlPlugin\n","import path from 'node:path'\nimport chalk from 'chalk'\n\nexport function filePathToRoute(filePath: string): string {\n  const {dir, name: nameWithoutExt} = path.parse(filePath)\n  const lastSegment = (() => {\n    const routeType = getRouteType(nameWithoutExt)\n    if (nameWithoutExt === 'index') return\n    if (routeType === 'dynamic') return `:${nameWithoutExt.slice(1, -1)}`\n    if (routeType === 'catchAll' || routeType === 'optionalCatchAll') {\n      throw createRouteTypeError({segment: nameWithoutExt, itemPath: filePath})\n    }\n\n    return nameWithoutExt\n  })()\n\n  const parameterizedPath = dir\n    .slice(dir.indexOf('/api'))\n    .split('/')\n    .map(segment => {\n      const routeType = getRouteType(segment)\n\n      if (routeType === 'catchAll' || routeType === 'optionalCatchAll') {\n        const prePath = filePath.slice(0, filePath.indexOf(segment))\n        const segmentPath = `${prePath}${segment}`\n        throw createRouteTypeError({segment, itemPath: segmentPath})\n      }\n\n      if (routeType === 'dynamic') {\n        return segment.replace('[', ':').slice(0, -1)\n      }\n\n      return segment\n    })\n    .join('/')\n\n  return `${parameterizedPath}${lastSegment ? `/${lastSegment}` : ''}`\n}\n\ntype RouteType = 'explicit' | 'dynamic' | 'catchAll' | 'optionalCatchAll'\nfunction getRouteType(str: string): RouteType {\n  if (str.startsWith('[[...') && str.endsWith(']]')) return 'optionalCatchAll'\n  if (str.startsWith('[...') && str.endsWith(']')) return 'catchAll'\n  if (str.startsWith('[') && str.endsWith(']')) return 'dynamic'\n  return 'explicit'\n}\n\ntype CreateRouteTypeErrorInputType = {\n  segment: string\n  itemPath: string\n}\n\nfunction createRouteTypeError({\n  segment,\n  itemPath,\n}: CreateRouteTypeErrorInputType): Error {\n  const projectPath = itemPath.replace(process.cwd(), '')\n  const redPath = chalk.red(\n    projectPath.replace(segment, chalk.red.bold(segment))\n  )\n  const message = chalk.red('Catch all routes are not supported -')\n  const errorMessage = `${message} ${redPath}`\n\n  // Log this to the console so the user can see.\n  console.error(errorMessage)\n\n  // This error will be caught in a try catch and not stop the process.\n  return new Error(errorMessage)\n}\n\nexport function isValidFile(name: string): boolean {\n  return ['.ts', '.js', '.mjs', '.cjs'].some(ending => name.endsWith(ending))\n}\n","const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue(red, green, blue) {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue(hex) {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue(code) {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\nfunction hasFlag(flag, argv = process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif ('FORCE_COLOR' in env) {\n\t\tif (env.FORCE_COLOR === 'true') {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (env.FORCE_COLOR === 'false') {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\t// Check for Azure DevOps pipelines\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n","// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.\nexport function stringReplaceAll(string, substring, replacer) {\n\tlet index = string.indexOf(substring);\n\tif (index === -1) {\n\t\treturn string;\n\t}\n\n\tconst substringLength = substring.length;\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\treturnValue += string.slice(endIndex, index) + substring + replacer;\n\t\tendIndex = index + substringLength;\n\t\tindex = string.indexOf(substring, endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n\nexport function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\tconst gotCR = string[index - 1] === '\\r';\n\t\treturnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\\r\\n' : '\\n') + postfix;\n\t\tendIndex = index + 1;\n\t\tindex = string.indexOf('\\n', endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n","import ansiStyles from '#ansi-styles';\nimport supportsColor from '#supports-color';\nimport { // eslint-disable-line import/order\n\tstringReplaceAll,\n\tstringEncaseCRLFWithFirstIndex,\n} from './utilities.js';\n\nconst {stdout: stdoutColor, stderr: stderrColor} = supportsColor;\n\nconst GENERATOR = Symbol('GENERATOR');\nconst STYLER = Symbol('STYLER');\nconst IS_EMPTY = Symbol('IS_EMPTY');\n\n// `supportsColor.level` → `ansiStyles.color[name]` mapping\nconst levelMapping = [\n\t'ansi',\n\t'ansi',\n\t'ansi256',\n\t'ansi16m',\n];\n\nconst styles = Object.create(null);\n\nconst applyOptions = (object, options = {}) => {\n\tif (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {\n\t\tthrow new Error('The `level` option should be an integer from 0 to 3');\n\t}\n\n\t// Detect level if not set manually\n\tconst colorLevel = stdoutColor ? stdoutColor.level : 0;\n\tobject.level = options.level === undefined ? colorLevel : options.level;\n};\n\nexport class Chalk {\n\tconstructor(options) {\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn chalkFactory(options);\n\t}\n}\n\nconst chalkFactory = options => {\n\tconst chalk = (...strings) => strings.join(' ');\n\tapplyOptions(chalk, options);\n\n\tObject.setPrototypeOf(chalk, createChalk.prototype);\n\n\treturn chalk;\n};\n\nfunction createChalk(options) {\n\treturn chalkFactory(options);\n}\n\nObject.setPrototypeOf(createChalk.prototype, Function.prototype);\n\nfor (const [styleName, style] of Object.entries(ansiStyles)) {\n\tstyles[styleName] = {\n\t\tget() {\n\t\t\tconst builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);\n\t\t\tObject.defineProperty(this, styleName, {value: builder});\n\t\t\treturn builder;\n\t\t},\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\tconst builder = createBuilder(this, this[STYLER], true);\n\t\tObject.defineProperty(this, 'visible', {value: builder});\n\t\treturn builder;\n\t},\n};\n\nconst getModelAnsi = (model, level, type, ...arguments_) => {\n\tif (model === 'rgb') {\n\t\tif (level === 'ansi16m') {\n\t\t\treturn ansiStyles[type].ansi16m(...arguments_);\n\t\t}\n\n\t\tif (level === 'ansi256') {\n\t\t\treturn ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));\n\t\t}\n\n\t\treturn ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));\n\t}\n\n\tif (model === 'hex') {\n\t\treturn getModelAnsi('rgb', level, type, ...ansiStyles.hexToRgb(...arguments_));\n\t}\n\n\treturn ansiStyles[type][model](...arguments_);\n};\n\nconst usedModels = ['rgb', 'hex', 'ansi256'];\n\nfor (const model of usedModels) {\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, {\n\t...styles,\n\tlevel: {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn this[GENERATOR].level;\n\t\t},\n\t\tset(level) {\n\t\t\tthis[GENERATOR].level = level;\n\t\t},\n\t},\n});\n\nconst createStyler = (open, close, parent) => {\n\tlet openAll;\n\tlet closeAll;\n\tif (parent === undefined) {\n\t\topenAll = open;\n\t\tcloseAll = close;\n\t} else {\n\t\topenAll = parent.openAll + open;\n\t\tcloseAll = close + parent.closeAll;\n\t}\n\n\treturn {\n\t\topen,\n\t\tclose,\n\t\topenAll,\n\t\tcloseAll,\n\t\tparent,\n\t};\n};\n\nconst createBuilder = (self, _styler, _isEmpty) => {\n\t// Single argument is hot path, implicit coercion is faster than anything\n\t// eslint-disable-next-line no-implicit-coercion\n\tconst builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));\n\n\t// We alter the prototype because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tObject.setPrototypeOf(builder, proto);\n\n\tbuilder[GENERATOR] = self;\n\tbuilder[STYLER] = _styler;\n\tbuilder[IS_EMPTY] = _isEmpty;\n\n\treturn builder;\n};\n\nconst applyStyle = (self, string) => {\n\tif (self.level <= 0 || !string) {\n\t\treturn self[IS_EMPTY] ? '' : string;\n\t}\n\n\tlet styler = self[STYLER];\n\n\tif (styler === undefined) {\n\t\treturn string;\n\t}\n\n\tconst {openAll, closeAll} = styler;\n\tif (string.includes('\\u001B')) {\n\t\twhile (styler !== undefined) {\n\t\t\t// Replace any instances already present with a re-opening code\n\t\t\t// otherwise only the part of the string until said closing code\n\t\t\t// will be colored, and the rest will simply be 'plain'.\n\t\t\tstring = stringReplaceAll(string, styler.close, styler.open);\n\n\t\t\tstyler = styler.parent;\n\t\t}\n\t}\n\n\t// We can move both next actions out of loop, because remaining actions in loop won't have\n\t// any/visible effect on parts we add here. Close the styling before a linebreak and reopen\n\t// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92\n\tconst lfIndex = string.indexOf('\\n');\n\tif (lfIndex !== -1) {\n\t\tstring = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);\n\t}\n\n\treturn openAll + string + closeAll;\n};\n\nObject.defineProperties(createChalk.prototype, styles);\n\nconst chalk = createChalk();\nexport const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});\n\nexport {\n\tmodifierNames,\n\tforegroundColorNames,\n\tbackgroundColorNames,\n\tcolorNames,\n\n\t// TODO: Remove these aliases in the next major version\n\tmodifierNames as modifiers,\n\tforegroundColorNames as foregroundColors,\n\tbackgroundColorNames as backgroundColors,\n\tcolorNames as colors,\n} from './vendor/ansi-styles/index.js';\n\nexport {\n\tstdoutColor as supportsColor,\n\tstderrColor as supportsColorStderr,\n};\n\nexport default chalk;\n","import esbuild from 'esbuild'\nimport {filePathToRoute} from './utils'\n\ntype CreateRouteHandlerDataInputType = {\n  buildResults: esbuild.BuildResult\n  entryPoints: string[]\n}\nexport default async function createRouteHandlerData({\n  buildResults,\n  entryPoints,\n}: CreateRouteHandlerDataInputType) {\n  if (!buildResults.outputFiles) {\n    throw new Error('No outputFiles found from ')\n  }\n  const promises = buildResults.outputFiles.map(({text}, i) => {\n    /*\n      https://2ality.com/2019/10/eval-via-import.html\n      eval() doesn't support import and export statements, but dynamic\n      import() does, using a `data:` URI.\n    */\n    const encodedJs = encodeURIComponent(text)\n    const dataUri = `data:text/javascript;charset=utf-8,${encodedJs}`\n\n    return import(dataUri)\n      .then(mod => {\n        if (typeof mod !== 'object' || typeof mod.default !== 'function') {\n          return null\n        }\n\n        const absolutePath = entryPoints[i]\n        const route = filePathToRoute(absolutePath)\n        return {route, handler: mod.default}\n      })\n      .catch(() => null)\n  })\n  const results = await Promise.all(promises)\n\n  return results\n    .filter(<T>(item: T | null): item is T => Boolean(item))\n    .sort((a, b) => {\n      const length1 = a.route.split('/').length\n      const length2 = b.route.split('/').length\n\n      return length2 - length1\n    })\n}\n","import type {ViteDevServer} from 'vite'\nimport bodyParser from 'body-parser'\n\n/**\n *\n * This module uses the `body-parser` package from Express.js to handle (and\n * mimic) all the body-parsing middleware.\n *\n * How Vercel populates req.body - https://vercel.com/docs/runtimes#official-runtimes/node-js/node-js-request-and-response-objects/request-body\n *\n * bodyParser.json()\n * https://github.com/expressjs/body-parser#bodyparserjsonoptions\n * Header - {'Content-Type': 'application/json'}\n *\n * bodyParser.raw()\n * https://github.com/expressjs/body-parser#bodyparserrawoptions\n * Header - {'Content-Type': 'application/octet-stream'}\n *\n * bodyParser.text()\n * https://github.com/expressjs/body-parser#bodyparsertextoptions\n * Header - {'Content-Type': 'text/plain'}\n *\n * bodyParser.urlencoded({extended: false})\n * https://github.com/expressjs/body-parser#bodyparserurlencodedoptions\n * Header - {'Content-Type': 'application/x-www-form-urlencoded'}\n *\n */\nexport default function addReqBodyMiddleware(devServer: ViteDevServer) {\n  ;[\n    bodyParser.json(),\n    bodyParser.raw(),\n    bodyParser.text(),\n    bodyParser.urlencoded({extended: false}),\n  ].forEach(middleware => {\n    devServer.middlewares.use(middleware)\n  })\n}\n","import type {VercelRequest, VercelResponse} from '@vercel/node'\nimport type {Connect} from 'vite/dist/node'\nimport cookie from 'cookie'\n\nexport default function reqCookiesMiddleware(\n  req: VercelRequest,\n  res: VercelResponse,\n  next: Connect.NextFunction\n) {\n  const header = req.headers.cookie\n\n  if (!header) {\n    req.cookies = {}\n    return next()\n  }\n\n  req.cookies = cookie.parse(Array.isArray(header) ? header.join(';') : header)\n\n  next()\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAoB;;;ACDpB,IAAAA,kBAAe;AACf,IAAAC,oBAAiB;;;ACDjB,IAAAC,kBAAoB;;;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EACF;AACF;","names":["import_node_fs","import_node_path","import_esbuild","fs","esbuild","esbuild","process","os","tty","styles","chalk","styles","path","path","fs","bodyParser","cookie","express"]}