{"version":3,"sources":["/Users/erunion/code/readme/api/packages/httpsnippet-client-api/dist/index.cjs","../src/index.ts","../node_modules/camelcase/index.js","../../../node_modules/is-regexp/index.js","../../../node_modules/stringify-object/node_modules/is-obj/index.js","../../../node_modules/get-own-enumerable-keys/index.js","../../../node_modules/reserved-identifiers/index.js","../../../node_modules/identifier-regex/index.js","../../../node_modules/function-timeout/index.js","../../../node_modules/super-regex/index.js","../../../node_modules/is-identifier/index.js","../../../node_modules/stringify-object/index.js"],"names":["preserveConsecutiveUppercase","pad","input"],"mappings":"AAAA;ACKA,uEAA4B;ADH5B;AACA;AEHA,IAAM,UAAA,EAAY,WAAA;AAClB,IAAM,UAAA,EAAY,WAAA;AAClB,IAAM,gBAAA,EAAkB,yBAAA;AACxB,IAAM,WAAA,EAAa,wBAAA;AACnB,IAAM,WAAA,EAAa,UAAA;AAEnB,IAAM,mBAAA,EAAqB,IAAI,MAAA,CAAO,IAAA,EAAM,UAAA,CAAW,MAAM,CAAA;AAC7D,IAAM,0BAAA,EAA4B,IAAI,MAAA,CAAO,UAAA,CAAW,OAAA,EAAS,UAAA,CAAW,MAAA,EAAQ,IAAI,CAAA;AACxF,IAAM,uBAAA,EAAyB,IAAI,MAAA,CAAO,OAAA,EAAS,UAAA,CAAW,MAAA,EAAQ,IAAI,CAAA;AAE1E,IAAM,kBAAA,EAAoB,CAAC,MAAA,EAAQ,WAAA,EAAa,WAAA,EAAaA,6BAAAA,EAAAA,GAAiC;AAC7F,EAAA,IAAI,gBAAA,EAAkB,KAAA;AACtB,EAAA,IAAI,gBAAA,EAAkB,KAAA;AACtB,EAAA,IAAI,oBAAA,EAAsB,KAAA;AAC1B,EAAA,IAAI,wBAAA,EAA0B,KAAA;AAE9B,EAAA,IAAA,CAAA,IAAS,MAAA,EAAQ,CAAA,EAAG,MAAA,EAAQ,MAAA,CAAO,MAAA,EAAQ,KAAA,EAAA,EAAS;AACnD,IAAA,MAAM,UAAA,EAAY,MAAA,CAAO,KAAK,CAAA;A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AA;AACL,IAAA;AACJ,IAAA;AAEhC,IAAA;AACd,EAAA;AACF;AAEyC;AAC/B,EAAA;AACR,EAAA;AACF;AAEe;ADgOuK;AACA;AACA","file":"/Users/erunion/code/readme/api/packages/httpsnippet-client-api/dist/index.cjs","sourcesContent":[null,"import type { ReducedHelperObject } from '@readme/httpsnippet/helpers/reducer';\nimport type { Client, ClientPlugin } from '@readme/httpsnippet/targets';\nimport type { Operation } from 'oas/operation';\nimport type { HttpMethods, OASDocument } from 'oas/types';\n\nimport { CodeBuilder } from '@readme/httpsnippet/helpers/code-builder';\nimport camelCase from 'camelcase';\nimport { parse as parseContentType } from 'content-type';\nimport Oas from 'oas';\nimport { matchesMimeType } from 'oas/utils';\nimport { isReservedOrBuiltinsLC } from 'reserved2';\nimport stringifyObject from 'stringify-object';\n\n/**\n * @note This regex also exists in `api/fetcher`.\n *\n * @example @petstore/v1.0#n6kvf10vakpemvplx\n * @example @petstore#n6kvf10vakpemvplx\n */\nconst registryUUIDRegex = /^@(?<project>[a-zA-Z0-9-_]+)(\\/?(?<version>.+))?#(?<uuid>[a-z0-9]+)$/;\n\n/**\n * @note This function also exists in `api/fetcher`.\n */\nfunction getProjectPrefixFromRegistryUUID(uri: string): string | undefined {\n  const matches = uri.match(registryUUIDRegex);\n  if (!matches) {\n    return;\n  }\n\n  return matches.groups?.project;\n}\n\nfunction stringify(obj: unknown, opts = {}) {\n  return stringifyObject(obj, { indent: '  ', ...opts });\n}\n\nfunction buildAuthSnippet(sdkVariable: string, authKey: string[] | string) {\n  // Auth key will be an array for Basic auth cases.\n  if (Array.isArray(authKey)) {\n    const auth: string[] = [];\n    authKey.forEach((token, i) => {\n      // If the token part is the last part of the key and it's empty, don't add it to the snippet.\n      if (token.length === 0 && authKey.length > 1 && i === authKey.length - 1) {\n        return;\n      }\n\n      auth.push(`'${token.replace(/'/g, \"\\\\'\")}'`);\n    });\n\n    return `${sdkVariable}.auth(${auth.join(', ')});`;\n  }\n\n  return `${sdkVariable}.auth('${authKey.replace(/'/g, \"\\\\'\")}');`;\n}\n\nfunction getAuthSources(operation: Operation) {\n  const matchers: { cookie: string[]; header: Record<string, string>; query: string[] } = {\n    header: {},\n    query: [],\n    cookie: [],\n  };\n\n  if (operation.getSecurity().length === 0) {\n    return matchers;\n  }\n\n  Object.entries(operation.prepareSecurity()).forEach(([, schemes]) => {\n    schemes.forEach(scheme => {\n      if (scheme.type === 'http') {\n        if (scheme.scheme === 'basic') {\n          matchers.header.authorization = 'Basic';\n        } else if (scheme.scheme === 'bearer') {\n          matchers.header.authorization = 'Bearer';\n        }\n      } else if (scheme.type === 'oauth2') {\n        matchers.header.authorization = 'Bearer';\n      } else if (scheme.type === 'apiKey') {\n        if (scheme.in === 'query') {\n          matchers.query.push(scheme.name);\n        } else if (scheme.in === 'header') {\n          // The way that this asterisk header matcher works is that since this `apiKey` goes in a\n          // named header (`scheme.name`) because the header is the key, we're matching against the\n          // entire header -- counter to the way that the HTTP basic matcher above works where we\n          // match and extract the API key from everything after `Basic ` in the `Authorization`\n          // header.\n          matchers.header[scheme.name.toLowerCase()] = '*';\n        } else if (scheme.in === 'cookie') {\n          matchers.cookie.push(scheme.name);\n        }\n      }\n    });\n  });\n\n  return matchers;\n}\n\ninterface APIOptions {\n  api?: {\n    definition: OASDocument;\n\n    /**\n     * The string to identify this SDK as. This is used in the `import sdk from '<identifier>'`\n     * sample as well as the the variable name we attach the SDK to.\n     *\n     * @example `@api/developers`\n     */\n    identifier?: string;\n\n    /**\n     * The URI that is used to download this API definition from `npx api install`.\n     *\n     * @example `@developers/v2.0#17273l2glm9fq4l5`\n     */\n    registryURI: string;\n  };\n  escapeBrackets?: boolean;\n  indent?: string | false;\n}\n\nconst client: Client<APIOptions> = {\n  info: {\n    key: 'api',\n    title: 'API',\n    link: 'https://npm.im/api',\n    description: 'Automatic SDK generation from an OpenAPI definition.',\n    extname: '.js',\n    installation: 'npx api install \"{packageName}\"',\n  },\n  convert: ({ cookiesObj, headersObj, postData, queryObj, url, ...source }, options) => {\n    const opts = {\n      ...options,\n    };\n\n    if (!opts?.api) {\n      throw new Error('This HTTPSnippet client must have an `api` config supplied to it.');\n    } else if (!opts?.api?.definition) {\n      throw new Error('This HTTPSnippet client must have an `api.definition` option supplied to it.');\n    } else if (!opts?.api?.registryURI) {\n      throw new Error('This HTTPSnippet client must have an `api.registryURI` option supplied to it.');\n    }\n\n    const method = source.method.toLowerCase() as HttpMethods;\n    const oas = new Oas(opts.api.definition);\n    const apiDefinition = oas.getDefinition();\n    const foundOperation = oas.findOperation(url, method);\n    if (!foundOperation) {\n      throw new Error(\n        `Unable to locate a matching operation in the supplied \\`api.definition\\` for: ${source.method} ${url}`,\n      );\n    }\n\n    let sdkPackageName: string | undefined;\n    let sdkVariable: string;\n    if (opts.api.identifier) {\n      sdkPackageName = opts.api.identifier;\n\n      sdkVariable = camelCase(opts.api.identifier);\n      if (isReservedOrBuiltinsLC(sdkVariable)) {\n        // If this identifier is a reserved JS word then we should prefix it with an underscore so\n        // this snippet can be valid code.\n        sdkVariable = `_${sdkVariable}`;\n      }\n    } else {\n      sdkPackageName = getProjectPrefixFromRegistryUUID(opts.api.registryURI);\n      sdkVariable = camelCase(sdkPackageName || 'sdk');\n    }\n\n    const operationSlugs = foundOperation.url.slugs;\n    const operation = oas.operation(foundOperation.url.nonNormalizedPath, method);\n    const operationPathParameters = operation.getParameters().filter(param => param.in === 'path');\n    const path = operation.path;\n    const authData: string[] = [];\n    const authSources = getAuthSources(operation);\n\n    const { blank, push, join } = new CodeBuilder({ indent: opts.indent || '  ' });\n\n    push(`import ${sdkVariable} from '@api/${sdkPackageName}';`);\n    blank();\n\n    // If we have multiple servers configured and our source URL differs from the stock URL that we\n    // receive from our `oas` library then the URL either has server variables contained in it (that\n    // don't match the defaults), or the OAS offers alternate server URLs and we should expose that\n    // in the generated snippet.\n    const configData = [];\n    if ((apiDefinition.servers || []).length > 1) {\n      const stockUrl = oas.url();\n      const baseUrl = url.replace(path, '');\n      if (baseUrl !== stockUrl) {\n        const serverVars = oas.splitVariables(baseUrl);\n        const serverUrl = serverVars ? oas.url(serverVars.selected, serverVars.variables) : baseUrl;\n\n        configData.push(`${sdkVariable}.server('${serverUrl}');`);\n      }\n    }\n\n    let metadata: Record<string, string[] | string> = {};\n    Object.keys(queryObj).forEach(param => {\n      if (authSources.query.includes(param)) {\n        authData.push(buildAuthSnippet(sdkVariable, queryObj[param]));\n\n        // If this query param is part of an auth source then we don't want it doubled up in the\n        // snippet.\n        return;\n      }\n\n      metadata[param] = queryObj[param];\n    });\n\n    Object.keys(cookiesObj).forEach(cookie => {\n      if (authSources.cookie.includes(cookie)) {\n        authData.push(buildAuthSnippet(sdkVariable, cookiesObj[cookie]));\n\n        // If this cookie is part of an auth source then we don't want it doubled up.\n        return;\n      }\n\n      // Note that we may have the potential to overlap any cookie that also shares the name as\n      // another metadata parameter. This problem is currently inherent to `api` and not this\n      // snippet generator.\n      metadata[cookie] = cookiesObj[cookie];\n    });\n\n    // If we have path parameters present we should add them into the metadata object.\n    Array.from(Object.entries(operationSlugs)).forEach(([param, value]) => {\n      // The keys in `operationSlugs` will always be prefixed with a `:` in the `oas` library so\n      // we can safely do this substring here without asserting this context.\n      const cleanedParam = param.substring(1);\n\n      // If our incoming path slug out of `oas.findOperation()` has been sanitized and is missing\n      // a hyphen, but there is a parameter in the OpenAPI definition that matches what our\n      // hyphen-less slug is then we should use that for the snippet.\n      const unsanitizedParam = operationPathParameters.find(p => {\n        return p.name.includes('-') && p.name.replace(/-/g, '') === cleanedParam ? p.name : false;\n      });\n\n      if (unsanitizedParam) {\n        metadata[unsanitizedParam.name] = value;\n      } else {\n        metadata[cleanedParam] = value;\n      }\n    });\n\n    if (Object.keys(headersObj).length) {\n      const headers = headersObj;\n      const requestHeaders: ReducedHelperObject = {};\n\n      Object.keys(headers).forEach(header => {\n        // Headers in HTTPSnippet are case-insensitive so we need to add in some special handling to\n        // make sure we're able to match them properly.\n        const headerLower = header.toLowerCase();\n\n        if (headerLower in authSources.header) {\n          // If this header has been set up as an authentication header, let's remove it and add it\n          // into our auth data so we can build up an `.auth()` snippet for the SDK.\n          const authScheme = authSources.header[headerLower];\n          if (authScheme === '*') {\n            authData.push(buildAuthSnippet(sdkVariable, headers[header]));\n          } else {\n            // @ts-expect-error `headers[header]` is typed improperly in HTTPSnippet.\n            let authKey = headers[header].replace(`${authSources.header[headerLower]} `, '');\n            if (authScheme.toLowerCase() === 'basic') {\n              authKey = Buffer.from(authKey, 'base64').toString('ascii');\n              authKey = authKey.split(':');\n            }\n\n            authData.push(buildAuthSnippet(sdkVariable, authKey));\n          }\n\n          delete headers[header];\n          return;\n        } else if (headerLower === 'content-type') {\n          // `Content-Type` headers are automatically added within the SDK so we can filter them out\n          // if they don't have parameters attached to them.\n          // @ts-expect-error `headers[header]` is typed improperly in HTTPSnippet.\n          const parsedContentType = parseContentType(headers[header]);\n          if (!Object.keys(parsedContentType.parameters).length) {\n            delete headers[header];\n            return;\n          }\n        } else if (headerLower === 'accept') {\n          // If the `Accept` header here is JSON-like header then we can remove it from the code\n          // snippet because `api` natively supports and prioritizes JSON over any other mime type.\n          if (matchesMimeType.json(headers[header] as string)) {\n            delete headers[header];\n            return;\n          }\n        }\n\n        // If we haven't used our header anywhere else, or we've deleted it from the payload\n        // because it'll be handled internally by `api` then we should add it into our code snippet.\n        if (['accept', 'content-type'].includes(headerLower)) {\n          requestHeaders[headerLower] = headers[header];\n        } else {\n          // Non-reserved headers retain their casing because we want to generate a snippet that\n          // matches the TS types that are created during codegeneration.\n          requestHeaders[header] = headers[header];\n        }\n      });\n\n      if (Object.keys(requestHeaders).length > 0) {\n        metadata = Object.assign(metadata, requestHeaders);\n      }\n    }\n\n    let body: any;\n    switch (postData.mimeType) {\n      case 'application/x-www-form-urlencoded':\n        body = postData.paramsObj;\n        break;\n\n      case 'application/json':\n        if (postData.jsonObj) {\n          body = postData.jsonObj;\n        }\n        break;\n\n      case 'multipart/form-data':\n        if (postData.params) {\n          body = {};\n\n          // If there's a `Content-Type` header present in the metadata, but it's for the\n          // `multipart/form-data` request then dump it off the snippet. We shouldn't offload that\n          // unnecessary bloat of multipart boundaries to the user, instead letting the SDK handle it\n          // automatically.\n          if ('content-type' in metadata && metadata['content-type'].indexOf('multipart/form-data') === 0) {\n            delete metadata['content-type'];\n          }\n\n          postData.params.forEach(param => {\n            if (param.fileName) {\n              body[param.name] = param.fileName;\n            } else {\n              body[param.name] = param.value;\n            }\n          });\n        }\n        break;\n\n      default:\n        if (postData.text) {\n          body = postData.text;\n        }\n    }\n\n    const args = [];\n\n    const accessor = operation.getOperationId({ camelCase: true });\n\n    // If we're going to be rendering out body params and metadata we should cut their character\n    // limit in half because we'll be rendering them in their own lines.\n    const inlineCharacterLimit = typeof body !== 'undefined' && Object.keys(metadata).length > 0 ? 40 : 80;\n    if (typeof body !== 'undefined') {\n      args.push(stringify(body, { inlineCharacterLimit }));\n    }\n\n    if (Object.keys(metadata).length > 0) {\n      args.push(stringify(metadata, { inlineCharacterLimit }));\n    }\n\n    if (authData.length) {\n      push(authData.join('\\n'));\n    }\n\n    if (configData.length) {\n      push(configData.join('\\n'));\n    }\n\n    push(`${sdkVariable}.${accessor}(${args.join(', ')})`);\n    push('.then(({ data }) => console.log(data))', 1);\n    push('.catch(err => console.error(err));', 1);\n\n    return join();\n  },\n};\n\nconst plugin: ClientPlugin<APIOptions> = {\n  target: 'node',\n  client,\n};\n\nexport default plugin;\n","const UPPERCASE = /[\\p{Lu}]/u;\nconst LOWERCASE = /[\\p{Ll}]/u;\nconst LEADING_CAPITAL = /^[\\p{Lu}](?![\\p{Lu}])/gu;\nconst IDENTIFIER = /([\\p{Alpha}\\p{N}_]|$)/u;\nconst SEPARATORS = /[_.\\- ]+/;\n\nconst LEADING_SEPARATORS = new RegExp('^' + SEPARATORS.source);\nconst SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, 'gu');\nconst NUMBERS_AND_IDENTIFIER = new RegExp('\\\\d+' + IDENTIFIER.source, 'gu');\n\nconst preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase) => {\n\tlet isLastCharLower = false;\n\tlet isLastCharUpper = false;\n\tlet isLastLastCharUpper = false;\n\tlet isLastLastCharPreserved = false;\n\n\tfor (let index = 0; index < string.length; index++) {\n\t\tconst character = string[index];\n\t\tisLastLastCharPreserved = index > 2 ? string[index - 3] === '-' : true;\n\n\t\tif (isLastCharLower && UPPERCASE.test(character)) {\n\t\t\tstring = string.slice(0, index) + '-' + string.slice(index);\n\t\t\tisLastCharLower = false;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = true;\n\t\t\tindex++;\n\t\t} else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase)) {\n\t\t\tstring = string.slice(0, index - 1) + '-' + string.slice(index - 1);\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = false;\n\t\t\tisLastCharLower = true;\n\t\t} else {\n\t\t\tisLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;\n\t\t}\n\t}\n\n\treturn string;\n};\n\nconst preserveConsecutiveUppercase = (input, toLowerCase) => {\n\tLEADING_CAPITAL.lastIndex = 0;\n\n\treturn input.replaceAll(LEADING_CAPITAL, match => toLowerCase(match));\n};\n\nconst postProcess = (input, toUpperCase) => {\n\tSEPARATORS_AND_IDENTIFIER.lastIndex = 0;\n\tNUMBERS_AND_IDENTIFIER.lastIndex = 0;\n\n\treturn input\n\t\t.replaceAll(NUMBERS_AND_IDENTIFIER, (match, pattern, offset) => ['_', '-'].includes(input.charAt(offset + match.length)) ? match : toUpperCase(match))\n\t\t.replaceAll(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier));\n};\n\nexport default function camelCase(input, options) {\n\tif (!(typeof input === 'string' || Array.isArray(input))) {\n\t\tthrow new TypeError('Expected the input to be `string | string[]`');\n\t}\n\n\toptions = {\n\t\tpascalCase: false,\n\t\tpreserveConsecutiveUppercase: false,\n\t\t...options,\n\t};\n\n\tif (Array.isArray(input)) {\n\t\tinput = input.map(x => x.trim())\n\t\t\t.filter(x => x.length)\n\t\t\t.join('-');\n\t} else {\n\t\tinput = input.trim();\n\t}\n\n\tif (input.length === 0) {\n\t\treturn '';\n\t}\n\n\tconst toLowerCase = options.locale === false\n\t\t? string => string.toLowerCase()\n\t\t: string => string.toLocaleLowerCase(options.locale);\n\n\tconst toUpperCase = options.locale === false\n\t\t? string => string.toUpperCase()\n\t\t: string => string.toLocaleUpperCase(options.locale);\n\n\tif (input.length === 1) {\n\t\tif (SEPARATORS.test(input)) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn options.pascalCase ? toUpperCase(input) : toLowerCase(input);\n\t}\n\n\tconst hasUpperCase = input !== toLowerCase(input);\n\n\tif (hasUpperCase) {\n\t\tinput = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase);\n\t}\n\n\tinput = input.replace(LEADING_SEPARATORS, '');\n\tinput = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);\n\n\tif (options.pascalCase) {\n\t\tinput = toUpperCase(input.charAt(0)) + input.slice(1);\n\t}\n\n\treturn postProcess(input, toUpperCase);\n}\n","const {toString} = Object.prototype;\n\nexport default function isRegexp(value) {\n\treturn toString.call(value) === '[object RegExp]';\n}\n","export default function isObject(value) {\n\tconst type = typeof value;\n\treturn value !== null && (type === 'object' || type === 'function');\n}\n","const {propertyIsEnumerable} = Object.prototype;\n\nexport default function getOwnEnumerableKeys(object) {\n\treturn [\n\t\t...Object.keys(object),\n\t\t...Object.getOwnPropertySymbols(object)\n\t\t\t.filter(key => propertyIsEnumerable.call(object, key)),\n\t];\n}\n","// https://262.ecma-international.org/14.0/#sec-keywords-and-reserved-words\n// 14 is ES2023\nconst identifiers = [\n\t// Keywords\n\t'await',\n\t'break',\n\t'case',\n\t'catch',\n\t'class',\n\t'const',\n\t'continue',\n\t'debugger',\n\t'default',\n\t'delete',\n\t'do',\n\t'else',\n\t'enum',\n\t'export',\n\t'extends',\n\t'false',\n\t'finally',\n\t'for',\n\t'function',\n\t'if',\n\t'import',\n\t'in',\n\t'instanceof',\n\t'new',\n\t'null',\n\t'return',\n\t'super',\n\t'switch',\n\t'this',\n\t'throw',\n\t'true',\n\t'try',\n\t'typeof',\n\t'var',\n\t'void',\n\t'while',\n\t'with',\n\t'yield',\n\n\t// Future reserved keywords\n\t'implements',\n\t'interface',\n\t'package',\n\t'private',\n\t'protected',\n\t'public',\n\n\t// Not keywords, but still restricted\n\t'arguments',\n\t'eval',\n];\n\n// https://262.ecma-international.org/14.0/#sec-value-properties-of-the-global-object\nconst globalProperties = [\n\t'globalThis',\n\t'Infinity',\n\t'NaN',\n\t'undefined',\n];\n\nexport default function reservedIdentifiers({includeGlobalProperties = false} = {}) {\n\treturn new Set([\n\t\t...identifiers,\n\t\t...(includeGlobalProperties ? globalProperties : []),\n\t]);\n}\n","import reservedIdentifiers from 'reserved-identifiers';\n\nconst baseRegex = /[$_\\p{ID_Start}][$_\\u200C\\u200D\\p{ID_Continue}]*/u;\nconst basePattern = `(?<![@#$_\\\\p{ID_Continue}\\\\p{ID_Start}])(?!(?:${[...reservedIdentifiers({includeGlobalProperties: true})].join('|')})(?![$_\\\\p{ID_Continue}]))${baseRegex.source}`;\nconst regex = new RegExp(basePattern, 'u');\nconst regexExact = new RegExp(`^${basePattern}$`, 'u');\n\nexport default function identifierRegex({exact = true} = {}) {\n\treturn exact ? regexExact : regex;\n}\n","import vm from 'node:vm';\n\nconst script = new vm.Script('returnValue = functionToRun()');\n\n// TODO: Document the `context` option and add to types when I know it's something I want to keep.\n\n// If you use the `context` option, you do it at your own risk.\nexport default function functionTimeout(function_, {timeout, context = vm.createContext()} = {}) {\n\tconst wrappedFunction = (...arguments_) => {\n\t\tcontext.functionToRun = () => function_(...arguments_);\n\t\tscript.runInNewContext(context, {timeout});\n\t\treturn context.returnValue;\n\t};\n\n\tObject.defineProperty(wrappedFunction, 'name', {\n\t\tvalue: `functionTimeout(${function_.name || '<anonymous>'})`,\n\t\tconfigurable: true,\n\t});\n\n\treturn wrappedFunction;\n}\n\nexport function isTimeoutError(error) {\n\treturn error?.code === 'ERR_SCRIPT_EXECUTION_TIMEOUT';\n}\n","import functionTimeout, {isTimeoutError} from 'function-timeout';\nimport timeSpan from 'time-span';\n\nconst resultToMatch = result => ({\n\tmatch: result[0],\n\tindex: result.index,\n\tgroups: result.slice(1),\n\tnamedGroups: result.groups ?? {},\n\tinput: result.input,\n});\n\nconst context = {};\n\nexport function isMatch(regex, string, {timeout} = {}) {\n\ttry {\n\t\treturn functionTimeout(() => structuredClone(regex).test(string), {timeout, context})();\n\t} catch (error) {\n\t\tif (isTimeoutError(error)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n\nexport function firstMatch(regex, string, {timeout} = {}) {\n\ttry {\n\t\tconst result = functionTimeout(() => structuredClone(regex).exec(string), {timeout, context})();\n\n\t\tif (result === null) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn resultToMatch(result);\n\t} catch (error) {\n\t\tif (isTimeoutError(error)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n\nexport function matches(regex, string, {timeout = Number.POSITIVE_INFINITY, matchTimeout = Number.POSITIVE_INFINITY} = {}) {\n\tif (!regex.global) {\n\t\tthrow new Error('The regex must have the global flag, otherwise, use `firstMatch()` instead');\n\t}\n\n\treturn {\n\t\t* [Symbol.iterator]() {\n\t\t\ttry {\n\t\t\t\tconst matches = string.matchAll(regex); // The regex is only executed when iterated over.\n\n\t\t\t\twhile (true) {\n\t\t\t\t\t// `matches.next` must be called within an arrow function so that it doesn't loose its context.\n\t\t\t\t\tconst nextMatch = functionTimeout(() => matches.next(), {\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\ttimeout: (timeout !== Number.POSITIVE_INFINITY || matchTimeout !== Number.POSITIVE_INFINITY) ? Math.min(timeout, matchTimeout) : undefined,\n\t\t\t\t\t});\n\n\t\t\t\t\tconst end = timeSpan();\n\t\t\t\t\tconst {value, done} = nextMatch();\n\t\t\t\t\ttimeout -= Math.ceil(end());\n\n\t\t\t\t\tif (done) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tyield resultToMatch(value);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (!isTimeoutError(error)) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t};\n}\n","import identifierRegex from 'identifier-regex';\nimport {isMatch} from 'super-regex';\n\nconst regex = identifierRegex();\n\nexport default function isIdentifier(value) {\n\tif (typeof value !== 'string') {\n\t\tthrow new TypeError(`Expected a string, got \\`${typeof value}\\`.`);\n\t}\n\n\t// Prevent abuse.\n\tif (value.length > 100_000) {\n\t\treturn false;\n\t}\n\n\treturn isMatch(regex, value, {timeout: 1000});\n}\n","import isRegexp from 'is-regexp';\nimport isObject from 'is-obj';\nimport getOwnEnumerableKeys from 'get-own-enumerable-keys';\nimport isIdentifier from 'is-identifier';\n\nconst CHARACTER_ESCAPES = {\n\t'\\n': String.raw`\\n`,\n\t'\\r': String.raw`\\r`,\n\t'\\t': String.raw`\\t`,\n\t'\\b': String.raw`\\b`,\n\t'\\f': String.raw`\\f`,\n\t'\\v': String.raw`\\v`,\n\t'\\0': String.raw`\\0`,\n};\n\nexport default function stringifyObject(input, options, pad) {\n\tconst seen = [];\n\n\treturn (function stringify(input, options = {}, pad = '') {\n\t\tconst indent = options.indent || '\\t';\n\n\t\tlet tokens;\n\t\tif (options.inlineCharacterLimit === undefined) {\n\t\t\ttokens = {\n\t\t\t\tnewline: '\\n',\n\t\t\t\tnewlineOrSpace: '\\n',\n\t\t\t\tpad,\n\t\t\t\tindent: pad + indent,\n\t\t\t};\n\t\t} else {\n\t\t\ttokens = {\n\t\t\t\tnewline: '@@__STRINGIFY_OBJECT_NEW_LINE__@@',\n\t\t\t\tnewlineOrSpace: '@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@',\n\t\t\t\tpad: '@@__STRINGIFY_OBJECT_PAD__@@',\n\t\t\t\tindent: '@@__STRINGIFY_OBJECT_INDENT__@@',\n\t\t\t};\n\t\t}\n\n\t\tconst expandWhiteSpace = string => {\n\t\t\tif (options.inlineCharacterLimit === undefined) {\n\t\t\t\treturn string;\n\t\t\t}\n\n\t\t\tconst oneLined = string\n\t\t\t\t.replaceAll(tokens.newline, '')\n\t\t\t\t.replaceAll(tokens.newlineOrSpace, ' ')\n\t\t\t\t.replaceAll(tokens.pad, '')\n\t\t\t\t.replaceAll(tokens.indent, '');\n\n\t\t\tif (oneLined.length <= options.inlineCharacterLimit) {\n\t\t\t\treturn oneLined;\n\t\t\t}\n\n\t\t\treturn string\n\t\t\t\t.replaceAll(tokens.newline, '\\n')\n\t\t\t\t.replaceAll(tokens.newlineOrSpace, '\\n')\n\t\t\t\t.replaceAll(tokens.pad, pad)\n\t\t\t\t.replaceAll(tokens.indent, pad + indent);\n\t\t};\n\n\t\tif (seen.includes(input)) {\n\t\t\treturn '\"[Circular]\"';\n\t\t}\n\n\t\tconst type = typeof input;\n\n\t\tif (\n\t\t\tinput === null\n\t\t\t|| input === undefined\n\t\t\t|| type === 'number'\n\t\t\t|| type === 'boolean'\n\t\t\t|| type === 'function'\n\t\t\t|| isRegexp(input)\n\t\t) {\n\t\t\treturn String(input);\n\t\t}\n\n\t\tif (type === 'bigint') {\n\t\t\treturn String(input) + 'n';\n\t\t}\n\n\t\tif (type === 'symbol') {\n\t\t\tconst {description} = input;\n\n\t\t\tif (description === undefined) {\n\t\t\t\treturn 'Symbol()';\n\t\t\t}\n\n\t\t\t// Check for well-known symbols first\n\t\t\tif (description?.startsWith('Symbol.') && Symbol[description.slice(7)] === input) {\n\t\t\t\treturn description;\n\t\t\t}\n\n\t\t\t// Check if it's a global registry symbol\n\t\t\tconst globalKey = Symbol.keyFor(input);\n\t\t\tif (globalKey !== undefined) {\n\t\t\t\treturn `Symbol.for(${stringify(globalKey, options)})`;\n\t\t\t}\n\n\t\t\treturn `Symbol(${stringify(description, options)})`;\n\t\t}\n\n\t\tif (input instanceof Date) {\n\t\t\treturn Number.isNaN(input.getTime())\n\t\t\t\t? 'new Date(\\'Invalid Date\\')'\n\t\t\t\t: `new Date('${input.toISOString()}')`;\n\t\t}\n\n\t\tif (input instanceof Map || input instanceof Set) {\n\t\t\tconst isMap = input instanceof Map;\n\t\t\tconst name = isMap ? 'Map' : 'Set';\n\n\t\t\tif (input.size === 0) {\n\t\t\t\treturn `new ${name}()`;\n\t\t\t}\n\n\t\t\tseen.push(input);\n\n\t\t\tconst items = [...input].map(item => {\n\t\t\t\tif (isMap) {\n\t\t\t\t\tconst [key, value] = item;\n\t\t\t\t\treturn tokens.indent + `[${stringify(key, options, pad + indent)}, ${stringify(value, options, pad + indent)}]`;\n\t\t\t\t}\n\n\t\t\t\treturn tokens.indent + stringify(item, options, pad + indent);\n\t\t\t}).join(',' + tokens.newlineOrSpace);\n\n\t\t\tseen.pop();\n\n\t\t\treturn expandWhiteSpace(`new ${name}([${tokens.newline}${items}${tokens.newline}${tokens.pad}])`);\n\t\t}\n\n\t\tif (Array.isArray(input)) {\n\t\t\tif (input.length === 0) {\n\t\t\t\treturn '[]';\n\t\t\t}\n\n\t\t\tseen.push(input);\n\n\t\t\tconst items = input.map((element, index) => {\n\t\t\t\tlet value = stringify(element, options, pad + indent);\n\t\t\t\tif (options.transform) {\n\t\t\t\t\tvalue = options.transform(input, index, value);\n\t\t\t\t}\n\n\t\t\t\treturn tokens.indent + value;\n\t\t\t}).join(',' + tokens.newlineOrSpace);\n\n\t\t\tseen.pop();\n\n\t\t\treturn expandWhiteSpace(`[${tokens.newline}${items}${tokens.newline}${tokens.pad}]`);\n\t\t}\n\n\t\tif (isObject(input)) {\n\t\t\tlet objectKeys = getOwnEnumerableKeys(input);\n\n\t\t\tif (options.filter) {\n\t\t\t\t// eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument\n\t\t\t\tobjectKeys = objectKeys.filter(element => options.filter(input, element));\n\t\t\t}\n\n\t\t\tif (objectKeys.length === 0) {\n\t\t\t\treturn '{}';\n\t\t\t}\n\n\t\t\tseen.push(input);\n\n\t\t\tconst pairs = objectKeys.map(element => {\n\t\t\t\tconst isSymbol = typeof element === 'symbol';\n\n\t\t\t\tlet key;\n\t\t\t\tif (isSymbol) {\n\t\t\t\t\tkey = `[${stringify(element, options)}]`;\n\t\t\t\t} else if (isIdentifier(element)) {\n\t\t\t\t\tkey = element;\n\t\t\t\t} else {\n\t\t\t\t\tkey = stringify(element, options);\n\t\t\t\t}\n\n\t\t\t\tlet value = stringify(input[element], options, pad + indent);\n\t\t\t\tif (options.transform) {\n\t\t\t\t\tvalue = options.transform(input, element, value);\n\t\t\t\t}\n\n\t\t\t\treturn tokens.indent + key + ': ' + value;\n\t\t\t}).join(',' + tokens.newlineOrSpace);\n\n\t\t\tseen.pop();\n\n\t\t\treturn expandWhiteSpace(`{${tokens.newline}${pairs}${tokens.newline}${tokens.pad}}`);\n\t\t}\n\n\t\t// String escaping\n\t\tconst stringified = String(input)\n\t\t\t.replaceAll('\\\\', '\\\\\\\\')\n\t\t\t// eslint-disable-next-line no-control-regex\n\t\t\t.replaceAll(/[\\u0000-\\u001F\\u007F]/g, x =>\n\t\t\t\tCHARACTER_ESCAPES[x] ?? `\\\\u${x.codePointAt(0).toString(16).padStart(4, '0')}`);\n\n\t\tif (options.singleQuotes === false) {\n\t\t\treturn `\"${stringified.replaceAll('\"', String.raw`\\\"`)}\"`;\n\t\t}\n\n\t\treturn `'${stringified.replaceAll('\\'', String.raw`\\'`)}'`;\n\t})(input, options, pad);\n}\n"]}