{"version":3,"file":"rollup-plugin-commonjs.cjs.js","sources":["../src/helpers.js","../src/is-cjs.js","../src/resolve-id.js","../src/ast-utils.js","../src/utils.js","../src/transform.js","../src/index.js"],"sourcesContent":["export const PROXY_SUFFIX = '?commonjs-proxy';\nexport const getProxyId = id => `\\0${id}${PROXY_SUFFIX}`;\nexport const getIdFromProxyId = proxyId => proxyId.slice(1, -PROXY_SUFFIX.length);\n\nexport const EXTERNAL_SUFFIX = '?commonjs-external';\nexport const getExternalProxyId = id => `\\0${id}${EXTERNAL_SUFFIX}`;\nexport const getIdFromExternalProxyId = proxyId => proxyId.slice(1, -EXTERNAL_SUFFIX.length);\n\nexport const HELPERS_ID = '\\0commonjsHelpers.js';\n\n// `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers.\n// Minifiers like uglify will usually transpile it back if compatibility with ES3 is not enabled.\nexport const HELPERS = `\nexport var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nexport function commonjsRequire () {\n\tthrow new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');\n}\n\nexport function unwrapExports (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nexport function createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nexport function getCjsExportFromNamespace (n) {\n\treturn n && n['default'] || n;\n}`;\n","const isCjsPromises = new Map();\n\nexport function getIsCjsPromise(id) {\n\tlet isCjsPromise = isCjsPromises.get(id);\n\tif (isCjsPromise) return isCjsPromise.promise;\n\n\tconst promise = new Promise(resolve => {\n\t\tisCjsPromise = {\n\t\t\tresolve,\n\t\t\tpromise: undefined\n\t\t};\n\t\tisCjsPromises.set(id, isCjsPromise);\n\t});\n\tisCjsPromise.promise = promise;\n\n\treturn promise;\n}\n\nexport function setIsCjsPromise(id, resolution) {\n\tconst isCjsPromise = isCjsPromises.get(id);\n\tif (isCjsPromise) {\n\t\tif (isCjsPromise.resolve) {\n\t\t\tisCjsPromise.resolve(resolution);\n\t\t\tisCjsPromise.resolve = undefined;\n\t\t}\n\t} else {\n\t\tisCjsPromises.set(id, { promise: Promise.resolve(resolution), resolve: undefined });\n\t}\n}\n","import { statSync } from 'fs';\nimport { dirname, resolve, sep } from 'path';\nimport {\n\tgetExternalProxyId,\n\tgetIdFromProxyId,\n\tgetProxyId,\n\tHELPERS_ID,\n\tPROXY_SUFFIX\n} from './helpers';\n\nfunction getCandidatesForExtension(resolved, extension) {\n\treturn [resolved + extension, resolved + `${sep}index${extension}`];\n}\n\nfunction getCandidates(resolved, extensions) {\n\treturn extensions.reduce(\n\t\t(paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),\n\t\t[resolved]\n\t);\n}\n\nexport function getResolveId(extensions) {\n\tfunction resolveExtensions(importee, importer) {\n\t\tif (importee[0] !== '.' || !importer) return; // not our problem\n\n\t\tconst resolved = resolve(dirname(importer), importee);\n\t\tconst candidates = getCandidates(resolved, extensions);\n\n\t\tfor (let i = 0; i < candidates.length; i += 1) {\n\t\t\ttry {\n\t\t\t\tconst stats = statSync(candidates[i]);\n\t\t\t\tif (stats.isFile()) return { id: candidates[i] };\n\t\t\t} catch (err) {\n\t\t\t\t/* noop */\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction resolveId(importee, importer) {\n\t\tconst isProxyModule = importee.endsWith(PROXY_SUFFIX);\n\t\tif (isProxyModule) {\n\t\t\timportee = getIdFromProxyId(importee);\n\t\t} else if (importee.startsWith('\\0')) {\n\t\t\tif (importee === HELPERS_ID) {\n\t\t\t\treturn importee;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tif (importer && importer.endsWith(PROXY_SUFFIX)) {\n\t\t\timporter = getIdFromProxyId(importer);\n\t\t}\n\n\t\treturn this.resolve(importee, importer, { skipSelf: true }).then(resolved => {\n\t\t\tif (!resolved) {\n\t\t\t\tresolved = resolveExtensions(importee, importer);\n\t\t\t}\n\t\t\tif (isProxyModule) {\n\t\t\t\tif (!resolved) {\n\t\t\t\t\treturn { id: getExternalProxyId(importee), external: false };\n\t\t\t\t}\n\t\t\t\tresolved.id = (resolved.external ? getExternalProxyId : getProxyId)(resolved.id);\n\t\t\t\tresolved.external = false;\n\t\t\t\treturn resolved;\n\t\t\t}\n\t\t\treturn resolved;\n\t\t});\n\t}\n\n\treturn resolveId;\n}\n","export { default as isReference } from 'is-reference';\n\nexport function flatten(node) {\n\tconst parts = [];\n\n\twhile (node.type === 'MemberExpression') {\n\t\tif (node.computed) return null;\n\n\t\tparts.unshift(node.property.name);\n\t\tnode = node.object;\n\t}\n\n\tif (node.type !== 'Identifier') return null;\n\n\tconst name = node.name;\n\tparts.unshift(name);\n\n\treturn { name, keypath: parts.join('.') };\n}\n\nexport function isTruthy(node) {\n\tif (node.type === 'Literal') return !!node.value;\n\tif (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);\n\tif (node.operator in operators) return operators[node.operator](node);\n}\n\nexport function isFalsy(node) {\n\treturn not(isTruthy(node));\n}\n\nfunction not(value) {\n\treturn value === undefined ? value : !value;\n}\n\nfunction equals(a, b, strict) {\n\tif (a.type !== b.type) return undefined;\n\tif (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;\n}\n\nconst operators = {\n\t'==': x => {\n\t\treturn equals(x.left, x.right, false);\n\t},\n\n\t'!=': x => not(operators['=='](x)),\n\n\t'===': x => {\n\t\treturn equals(x.left, x.right, true);\n\t},\n\n\t'!==': x => not(operators['==='](x)),\n\n\t'!': x => isFalsy(x.argument),\n\n\t'&&': x => isTruthy(x.left) && isTruthy(x.right),\n\n\t'||': x => isTruthy(x.left) || isTruthy(x.right)\n};\n","import { basename, dirname, extname, sep } from 'path';\nimport { makeLegalIdentifier } from 'rollup-pluginutils';\n\nexport function getName(id) {\n\tconst name = makeLegalIdentifier(basename(id, extname(id)));\n\tif (name !== 'index') {\n\t\treturn name;\n\t} else {\n\t\tconst segments = dirname(id).split(sep);\n\t\treturn makeLegalIdentifier(segments[segments.length - 1]);\n\t}\n}\n\n// Return the first non-falsy result from an array of\n// maybe-sync, maybe-promise-returning functions\nexport function first(candidates) {\n\treturn function(...args) {\n\t\treturn candidates.reduce((promise, candidate) => {\n\t\t\treturn promise.then(result =>\n\t\t\t\tresult != null ? result : Promise.resolve(candidate.call(this, ...args))\n\t\t\t);\n\t\t}, Promise.resolve());\n\t};\n}\n","import { walk } from 'estree-walker';\nimport MagicString from 'magic-string';\nimport { attachScopes, extractAssignedNames, makeLegalIdentifier } from 'rollup-pluginutils';\nimport { flatten, isFalsy, isReference, isTruthy } from './ast-utils.js';\nimport { getProxyId, HELPERS_ID } from './helpers';\nimport { getName } from './utils.js';\n\nconst reserved = 'process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split(\n\t' '\n);\nconst blacklist = { __esModule: true };\nreserved.forEach(word => (blacklist[word] = true));\n\nconst exportsPattern = /^(?:module\\.)?exports(?:\\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;\n\nconst firstpassGlobal = /\\b(?:require|module|exports|global)\\b/;\nconst firstpassNoGlobal = /\\b(?:require|module|exports)\\b/;\nconst importExportDeclaration = /^(?:Import|Export(?:Named|Default))Declaration/;\nconst functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;\n\nfunction deconflict(scope, globals, identifier) {\n\tlet i = 1;\n\tlet deconflicted = identifier;\n\n\twhile (scope.contains(deconflicted) || globals.has(deconflicted) || deconflicted in blacklist)\n\t\tdeconflicted = `${identifier}_${i++}`;\n\tscope.declarations[deconflicted] = true;\n\n\treturn deconflicted;\n}\n\nfunction tryParse(parse, code, id) {\n\ttry {\n\t\treturn parse(code, { allowReturnOutsideFunction: true });\n\t} catch (err) {\n\t\terr.message += ` in ${id}`;\n\t\tthrow err;\n\t}\n}\n\nexport function hasCjsKeywords(code, ignoreGlobal) {\n\tconst firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;\n\treturn firstpass.test(code);\n}\n\nexport function checkEsModule(parse, code, id) {\n\tconst ast = tryParse(parse, code, id);\n\n\tlet isEsModule = false;\n\tfor (const node of ast.body) {\n\t\tif (node.type === 'ExportDefaultDeclaration')\n\t\t\treturn { isEsModule: true, hasDefaultExport: true, ast };\n\t\tif (node.type === 'ExportNamedDeclaration') {\n\t\t\tisEsModule = true;\n\t\t\tfor (const specifier of node.specifiers) {\n\t\t\t\tif (specifier.exported.name === 'default') {\n\t\t\t\t\treturn { isEsModule: true, hasDefaultExport: true, ast };\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (importExportDeclaration.test(node.type)) isEsModule = true;\n\t}\n\n\treturn { isEsModule, hasDefaultExport: false, ast };\n}\n\nexport function transformCommonjs(\n\tparse,\n\tcode,\n\tid,\n\tisEntry,\n\tignoreGlobal,\n\tignoreRequire,\n\tcustomNamedExports,\n\tsourceMap,\n\tallowDynamicRequire,\n\tastCache\n) {\n\tconst ast = astCache || tryParse(parse, code, id);\n\n\tconst magicString = new MagicString(code);\n\n\tconst required = {};\n\t// Because objects have no guaranteed ordering, yet we need it,\n\t// we need to keep track of the order in a array\n\tconst sources = [];\n\n\tlet uid = 0;\n\n\tlet scope = attachScopes(ast, 'scope');\n\tconst uses = { module: false, exports: false, global: false, require: false };\n\n\tlet lexicalDepth = 0;\n\tlet programDepth = 0;\n\n\tconst globals = new Set();\n\n\tconst HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers'); // TODO technically wrong since globals isn't populated yet, but ¯\\_(ツ)_/¯\n\n\tconst namedExports = {};\n\n\t// TODO handle transpiled modules\n\tlet shouldWrap = /__esModule/.test(code);\n\n\tfunction isRequireStatement(node) {\n\t\tif (!node) return;\n\t\tif (node.type !== 'CallExpression') return;\n\t\tif (node.callee.name !== 'require' || scope.contains('require')) return;\n\t\tif (node.arguments.length === 0) return; // Weird case of require() without arguments\n\t\treturn true;\n\t}\n\n\tfunction hasDynamicArguments(node) {\n\t\treturn (\n\t\t\tnode.arguments.length > 1 ||\n\t\t\t(node.arguments[0].type !== 'Literal' &&\n\t\t\t\t(node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))\n\t\t);\n\t}\n\n\tfunction isStaticRequireStatement(node) {\n\t\tif (!isRequireStatement(node)) return;\n\t\tif (hasDynamicArguments(node)) return;\n\t\tif (ignoreRequire(node.arguments[0].value)) return;\n\t\treturn true;\n\t}\n\n\tfunction getRequireStringArg(node) {\n\t\treturn node.arguments[0].type === 'Literal'\n\t\t\t? node.arguments[0].value\n\t\t\t: node.arguments[0].quasis[0].value.cooked;\n\t}\n\n\tfunction getRequired(node, name) {\n\t\tconst sourceId = getRequireStringArg(node);\n\t\tconst existing = required[sourceId];\n\t\tif (existing === undefined) {\n\t\t\tif (!name) {\n\t\t\t\tdo name = `require$$${uid++}`;\n\t\t\t\twhile (scope.contains(name));\n\t\t\t}\n\n\t\t\tsources.push(sourceId);\n\t\t\trequired[sourceId] = { source: sourceId, name, importsDefault: false };\n\t\t}\n\n\t\treturn required[sourceId];\n\t}\n\n\t// do a first pass, see which names are assigned to. This is necessary to prevent\n\t// illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,\n\t// where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)\n\tconst assignedTo = new Set();\n\twalk(ast, {\n\t\tenter(node) {\n\t\t\tif (node.type !== 'AssignmentExpression') return;\n\t\t\tif (node.left.type === 'MemberExpression') return;\n\n\t\t\textractAssignedNames(node.left).forEach(name => {\n\t\t\t\tassignedTo.add(name);\n\t\t\t});\n\t\t}\n\t});\n\n\twalk(ast, {\n\t\tenter(node, parent) {\n\t\t\tif (sourceMap) {\n\t\t\t\tmagicString.addSourcemapLocation(node.start);\n\t\t\t\tmagicString.addSourcemapLocation(node.end);\n\t\t\t}\n\n\t\t\t// skip dead branches\n\t\t\tif (parent && (parent.type === 'IfStatement' || parent.type === 'ConditionalExpression')) {\n\t\t\t\tif (node === parent.consequent && isFalsy(parent.test)) return this.skip();\n\t\t\t\tif (node === parent.alternate && isTruthy(parent.test)) return this.skip();\n\t\t\t}\n\n\t\t\tif (node._skip) return this.skip();\n\n\t\t\tprogramDepth += 1;\n\n\t\t\tif (node.scope) scope = node.scope;\n\t\t\tif (functionType.test(node.type)) lexicalDepth += 1;\n\n\t\t\t// if toplevel return, we need to wrap it\n\t\t\tif (node.type === 'ReturnStatement' && lexicalDepth === 0) {\n\t\t\t\tshouldWrap = true;\n\t\t\t}\n\n\t\t\t// rewrite `this` as `commonjsHelpers.commonjsGlobal`\n\t\t\tif (node.type === 'ThisExpression' && lexicalDepth === 0) {\n\t\t\t\tuses.global = true;\n\t\t\t\tif (!ignoreGlobal)\n\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)\n\t\t\tif (node.type === 'UnaryExpression' && node.operator === 'typeof') {\n\t\t\t\tconst flattened = flatten(node.argument);\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tif (scope.contains(flattened.name)) return;\n\n\t\t\t\tif (\n\t\t\t\t\tflattened.keypath === 'module.exports' ||\n\t\t\t\t\tflattened.keypath === 'module' ||\n\t\t\t\t\tflattened.keypath === 'exports'\n\t\t\t\t) {\n\t\t\t\t\tmagicString.overwrite(node.start, node.end, `'object'`, { storeName: false });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// rewrite `require` (if not already handled) `global` and `define`, and handle free references to\n\t\t\t// `module` and `exports` as these mean we need to wrap the module in commonjsHelpers.createCommonjsModule\n\t\t\tif (node.type === 'Identifier') {\n\t\t\t\tif (isReference(node, parent) && !scope.contains(node.name)) {\n\t\t\t\t\tif (node.name in uses) {\n\t\t\t\t\t\tif (node.name === 'require') {\n\t\t\t\t\t\t\tif (allowDynamicRequire) return;\n\t\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {\n\t\t\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tuses[node.name] = true;\n\t\t\t\t\t\tif (node.name === 'global' && !ignoreGlobal) {\n\t\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n\t\t\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if module or exports are used outside the context of an assignment\n\t\t\t\t\t\t// expression, we need to wrap the module\n\t\t\t\t\t\tif (node.name === 'module' || node.name === 'exports') {\n\t\t\t\t\t\t\tshouldWrap = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (node.name === 'define') {\n\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, 'undefined', { storeName: true });\n\t\t\t\t\t}\n\n\t\t\t\t\tglobals.add(node.name);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Is this an assignment to exports or module.exports?\n\t\t\tif (node.type === 'AssignmentExpression') {\n\t\t\t\tif (node.left.type !== 'MemberExpression') return;\n\n\t\t\t\tconst flattened = flatten(node.left);\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tif (scope.contains(flattened.name)) return;\n\n\t\t\t\tconst match = exportsPattern.exec(flattened.keypath);\n\t\t\t\tif (!match || flattened.keypath === 'exports') return;\n\n\t\t\t\tuses[flattened.name] = true;\n\n\t\t\t\t// we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –\n\t\t\t\t// if this isn't top-level, we'll need to wrap the module\n\t\t\t\tif (programDepth > 3) shouldWrap = true;\n\n\t\t\t\tnode.left._skip = true;\n\n\t\t\t\tif (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {\n\t\t\t\t\treturn node.right.properties.forEach(prop => {\n\t\t\t\t\t\tif (prop.computed || prop.key.type !== 'Identifier') return;\n\t\t\t\t\t\tconst name = prop.key.name;\n\t\t\t\t\t\tif (name === makeLegalIdentifier(name)) namedExports[name] = true;\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (match[1]) namedExports[match[1]] = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if this is `var x = require('x')`, we can do `import x from 'x'`\n\t\t\tif (\n\t\t\t\tnode.type === 'VariableDeclarator' &&\n\t\t\t\tnode.id.type === 'Identifier' &&\n\t\t\t\tisStaticRequireStatement(node.init)\n\t\t\t) {\n\t\t\t\t// for now, only do this for top-level requires. maybe fix this in future\n\t\t\t\tif (scope.parent) return;\n\n\t\t\t\t// edge case — CJS allows you to assign to imports. ES doesn't\n\t\t\t\tif (assignedTo.has(node.id.name)) return;\n\n\t\t\t\tconst required = getRequired(node.init, node.id.name);\n\t\t\t\trequired.importsDefault = true;\n\n\t\t\t\tif (required.name === node.id.name) {\n\t\t\t\t\tnode._shouldRemove = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!isStaticRequireStatement(node)) return;\n\n\t\t\tconst required = getRequired(node);\n\n\t\t\tif (parent.type === 'ExpressionStatement') {\n\t\t\t\t// is a bare import, e.g. `require('foo');`\n\t\t\t\tmagicString.remove(parent.start, parent.end);\n\t\t\t} else {\n\t\t\t\trequired.importsDefault = true;\n\t\t\t\tmagicString.overwrite(node.start, node.end, required.name);\n\t\t\t}\n\n\t\t\tnode.callee._skip = true;\n\t\t},\n\n\t\tleave(node) {\n\t\t\tprogramDepth -= 1;\n\t\t\tif (node.scope) scope = scope.parent;\n\t\t\tif (functionType.test(node.type)) lexicalDepth -= 1;\n\n\t\t\tif (node.type === 'VariableDeclaration') {\n\t\t\t\tlet keepDeclaration = false;\n\t\t\t\tlet c = node.declarations[0].start;\n\n\t\t\t\tfor (let i = 0; i < node.declarations.length; i += 1) {\n\t\t\t\t\tconst declarator = node.declarations[i];\n\n\t\t\t\t\tif (declarator._shouldRemove) {\n\t\t\t\t\t\tmagicString.remove(c, declarator.end);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!keepDeclaration) {\n\t\t\t\t\t\t\tmagicString.remove(c, declarator.start);\n\t\t\t\t\t\t\tkeepDeclaration = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tc = declarator.end;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!keepDeclaration) {\n\t\t\t\t\tmagicString.remove(node.start, node.end);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tif (\n\t\t!sources.length &&\n\t\t!uses.module &&\n\t\t!uses.exports &&\n\t\t!uses.require &&\n\t\t(ignoreGlobal || !uses.global)\n\t) {\n\t\tif (Object.keys(namedExports).length) {\n\t\t\tthrow new Error(\n\t\t\t\t`Custom named exports were specified for ${id} but it does not appear to be a CommonJS module`\n\t\t\t);\n\t\t}\n\t\treturn null; // not a CommonJS module\n\t}\n\n\tconst includeHelpers = shouldWrap || uses.global || uses.require;\n\tconst importBlock =\n\t\t(includeHelpers ? [`import * as ${HELPERS_NAME} from '${HELPERS_ID}';`] : [])\n\t\t\t.concat(\n\t\t\t\tsources.map(source => {\n\t\t\t\t\t// import the actual module before the proxy, so that we know\n\t\t\t\t\t// what kind of proxy to build\n\t\t\t\t\treturn `import '${source}';`;\n\t\t\t\t}),\n\t\t\t\tsources.map(source => {\n\t\t\t\t\tconst { name, importsDefault } = required[source];\n\t\t\t\t\treturn `import ${importsDefault ? `${name} from ` : ``}'${getProxyId(source)}';`;\n\t\t\t\t})\n\t\t\t)\n\t\t\t.join('\\n') + '\\n\\n';\n\n\tconst namedExportDeclarations = [];\n\tlet wrapperStart = '';\n\tlet wrapperEnd = '';\n\n\tconst moduleName = deconflict(scope, globals, getName(id));\n\tif (!isEntry) {\n\t\tconst exportModuleExports = {\n\t\t\tstr: `export { ${moduleName} as __moduleExports };`,\n\t\t\tname: '__moduleExports'\n\t\t};\n\n\t\tnamedExportDeclarations.push(exportModuleExports);\n\t}\n\n\tconst name = getName(id);\n\n\tfunction addExport(x) {\n\t\tconst deconflicted = deconflict(scope, globals, name);\n\n\t\tconst declaration =\n\t\t\tdeconflicted === name\n\t\t\t\t? `export var ${x} = ${moduleName}.${x};`\n\t\t\t\t: `var ${deconflicted} = ${moduleName}.${x};\\nexport { ${deconflicted} as ${x} };`;\n\n\t\tnamedExportDeclarations.push({\n\t\t\tstr: declaration,\n\t\t\tname: x\n\t\t});\n\t}\n\n\tif (customNamedExports) customNamedExports.forEach(addExport);\n\n\tconst defaultExportPropertyAssignments = [];\n\tlet hasDefaultExport = false;\n\n\tif (shouldWrap) {\n\t\tconst args = `module${uses.exports ? ', exports' : ''}`;\n\n\t\twrapperStart = `var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\\n`;\n\t\twrapperEnd = `\\n});`;\n\t} else {\n\t\tconst names = [];\n\n\t\tast.body.forEach(node => {\n\t\t\tif (node.type === 'ExpressionStatement' && node.expression.type === 'AssignmentExpression') {\n\t\t\t\tconst left = node.expression.left;\n\t\t\t\tconst flattened = flatten(left);\n\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tconst match = exportsPattern.exec(flattened.keypath);\n\t\t\t\tif (!match) return;\n\n\t\t\t\tif (flattened.keypath === 'module.exports') {\n\t\t\t\t\thasDefaultExport = true;\n\t\t\t\t\tmagicString.overwrite(left.start, left.end, `var ${moduleName}`);\n\t\t\t\t} else {\n\t\t\t\t\tconst name = match[1];\n\t\t\t\t\tconst deconflicted = deconflict(scope, globals, name);\n\n\t\t\t\t\tnames.push({ name, deconflicted });\n\n\t\t\t\t\tmagicString.overwrite(node.start, left.end, `var ${deconflicted}`);\n\n\t\t\t\t\tconst declaration =\n\t\t\t\t\t\tname === deconflicted\n\t\t\t\t\t\t\t? `export { ${name} };`\n\t\t\t\t\t\t\t: `export { ${deconflicted} as ${name} };`;\n\n\t\t\t\t\tif (name !== 'default') {\n\t\t\t\t\t\tnamedExportDeclarations.push({\n\t\t\t\t\t\t\tstr: declaration,\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t});\n\t\t\t\t\t\tdelete namedExports[name];\n\t\t\t\t\t}\n\n\t\t\t\t\tdefaultExportPropertyAssignments.push(`${moduleName}.${name} = ${deconflicted};`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (!hasDefaultExport) {\n\t\t\twrapperEnd = `\\n\\nvar ${moduleName} = {\\n${names\n\t\t\t\t.map(({ name, deconflicted }) => `\\t${name}: ${deconflicted}`)\n\t\t\t\t.join(',\\n')}\\n};`;\n\t\t}\n\t}\n\tObject.keys(namedExports)\n\t\t.filter(key => !blacklist[key])\n\t\t.forEach(addExport);\n\n\tconst defaultExport = /__esModule/.test(code)\n\t\t? `export default ${HELPERS_NAME}.unwrapExports(${moduleName});`\n\t\t: `export default ${moduleName};`;\n\n\tconst named = namedExportDeclarations\n\t\t.filter(x => x.name !== 'default' || !hasDefaultExport)\n\t\t.map(x => x.str);\n\n\tconst exportBlock =\n\t\t'\\n\\n' +\n\t\t[defaultExport]\n\t\t\t.concat(named)\n\t\t\t.concat(hasDefaultExport ? defaultExportPropertyAssignments : [])\n\t\t\t.join('\\n');\n\n\tmagicString\n\t\t.trim()\n\t\t.prepend(importBlock + wrapperStart)\n\t\t.trim()\n\t\t.append(wrapperEnd + exportBlock);\n\n\tcode = magicString.toString();\n\tconst map = sourceMap ? magicString.generateMap() : null;\n\n\treturn { code, map };\n}\n","import { realpathSync, existsSync } from 'fs';\nimport { extname, resolve } from 'path';\nimport { sync as nodeResolveSync, isCore } from 'resolve';\nimport { createFilter } from 'rollup-pluginutils';\nimport { peerDependencies } from '../package.json';\nimport {\n\tEXTERNAL_SUFFIX,\n\tgetIdFromExternalProxyId,\n\tgetIdFromProxyId,\n\tHELPERS,\n\tHELPERS_ID,\n\tPROXY_SUFFIX\n} from './helpers';\nimport { getIsCjsPromise, setIsCjsPromise } from './is-cjs';\nimport { getResolveId } from './resolve-id';\nimport { checkEsModule, hasCjsKeywords, transformCommonjs } from './transform.js';\nimport { getName } from './utils.js';\n\nexport default function commonjs(options = {}) {\n\tconst extensions = options.extensions || ['.js'];\n\tconst filter = createFilter(options.include, options.exclude);\n\tconst ignoreGlobal = options.ignoreGlobal;\n\n\tconst customNamedExports = {};\n\tif (options.namedExports) {\n\t\tObject.keys(options.namedExports).forEach(id => {\n\t\t\tlet resolveId = id;\n\t\t\tlet resolvedId;\n\n\t\t\tif (isCore(id)) {\n\t\t\t\t// resolve will not find npm modules with the same name as\n\t\t\t\t// core modules without a trailing slash. Since core modules\n\t\t\t\t// must be external, we can assume any core modules defined\n\t\t\t\t// here are npm modules by that name.\n\t\t\t\tresolveId += '/';\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tresolvedId = nodeResolveSync(resolveId, { basedir: process.cwd() });\n\t\t\t} catch (err) {\n\t\t\t\tresolvedId = resolve(id);\n\t\t\t}\n\t\t\tcustomNamedExports[resolvedId] = options.namedExports[id];\n\n\t\t\tif (existsSync(resolvedId)) {\n\t\t\t\tconst realpath = realpathSync(resolvedId);\n\t\t\t\tif (realpath !== resolvedId) {\n\t\t\t\t\tcustomNamedExports[realpath] = options.namedExports[id];\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tconst esModulesWithoutDefaultExport = new Set();\n\tconst esModulesWithDefaultExport = new Set();\n\tconst allowDynamicRequire = !!options.ignore; // TODO maybe this should be configurable?\n\n\tconst ignoreRequire =\n\t\ttypeof options.ignore === 'function'\n\t\t\t? options.ignore\n\t\t\t: Array.isArray(options.ignore)\n\t\t\t\t? id => options.ignore.includes(id)\n\t\t\t\t: () => false;\n\n\tconst resolveId = getResolveId(extensions);\n\n\tconst sourceMap = options.sourceMap !== false;\n\n\tfunction transformAndCheckExports(code, id) {\n\t\t{\n\t\t\tconst { isEsModule, hasDefaultExport, ast } = checkEsModule(this.parse, code, id);\n\t\t\tif (isEsModule) {\n\t\t\t\t(hasDefaultExport ? esModulesWithDefaultExport : esModulesWithoutDefaultExport).add(id);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// it is not an ES module but it does not have CJS-specific elements.\n\t\t\tif (!hasCjsKeywords(code, ignoreGlobal)) {\n\t\t\t\tesModulesWithoutDefaultExport.add(id);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst transformed = transformCommonjs(\n\t\t\t\tthis.parse,\n\t\t\t\tcode,\n\t\t\t\tid,\n\t\t\t\tthis.getModuleInfo(id).isEntry,\n\t\t\t\tignoreGlobal,\n\t\t\t\tignoreRequire,\n\t\t\t\tcustomNamedExports[id],\n\t\t\t\tsourceMap,\n\t\t\t\tallowDynamicRequire,\n\t\t\t\tast\n\t\t\t);\n\t\t\tif (!transformed) {\n\t\t\t\tesModulesWithoutDefaultExport.add(id);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn transformed;\n\t\t}\n\t}\n\n\treturn {\n\t\tname: 'commonjs',\n\n\t\tbuildStart() {\n\t\t\tconst [major, minor] = this.meta.rollupVersion.split('.').map(Number);\n\t\t\tconst minVersion = peerDependencies.rollup.slice(2);\n\t\t\tconst [minMajor, minMinor] = minVersion.split('.').map(Number);\n\t\t\tif (major < minMajor || (major === minMajor && minor < minMinor)) {\n\t\t\t\tthis.error(\n\t\t\t\t\t`Insufficient Rollup version: \"rollup-plugin-commonjs\" requires at least rollup@${minVersion} but found rollup@${this.meta.rollupVersion}.`\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\n\t\tresolveId,\n\n\t\tload(id) {\n\t\t\tif (id === HELPERS_ID) return HELPERS;\n\n\t\t\t// generate proxy modules\n\t\t\tif (id.endsWith(EXTERNAL_SUFFIX)) {\n\t\t\t\tconst actualId = getIdFromExternalProxyId(id);\n\t\t\t\tconst name = getName(actualId);\n\n\t\t\t\treturn `import ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n\t\t\t}\n\n\t\t\tif (id.endsWith(PROXY_SUFFIX)) {\n\t\t\t\tconst actualId = getIdFromProxyId(id);\n\t\t\t\tconst name = getName(actualId);\n\n\t\t\t\treturn getIsCjsPromise(actualId).then(isCjs => {\n\t\t\t\t\tif (isCjs)\n\t\t\t\t\t\treturn `import { __moduleExports } from ${JSON.stringify(\n\t\t\t\t\t\t\tactualId\n\t\t\t\t\t\t)}; export default __moduleExports;`;\n\t\t\t\t\telse if (esModulesWithoutDefaultExport.has(actualId))\n\t\t\t\t\t\treturn `import * as ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n\t\t\t\t\telse if (esModulesWithDefaultExport.has(actualId)) {\n\t\t\t\t\t\treturn `export {default} from ${JSON.stringify(actualId)};`;\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn `import * as ${name} from ${JSON.stringify(\n\t\t\t\t\t\t\tactualId\n\t\t\t\t\t\t)}; import {getCjsExportFromNamespace} from \"${HELPERS_ID}\"; export default getCjsExportFromNamespace(${name})`;\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\ttransform(code, id) {\n\t\t\tif (!filter(id) || extensions.indexOf(extname(id)) === -1) {\n\t\t\t\tsetIsCjsPromise(id, null);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tlet transformed;\n\t\t\ttry {\n\t\t\t\ttransformed = transformAndCheckExports.call(this, code, id);\n\t\t\t} catch (err) {\n\t\t\t\ttransformed = null;\n\t\t\t\tthis.error(err, err.loc);\n\t\t\t}\n\n\t\t\tsetIsCjsPromise(id, Boolean(transformed));\n\t\t\treturn transformed;\n\t\t}\n\t};\n}\n"],"names":["PROXY_SUFFIX","getProxyId","id","getIdFromProxyId","proxyId","slice","length","EXTERNAL_SUFFIX","getExternalProxyId","getIdFromExternalProxyId","HELPERS_ID","HELPERS","isCjsPromises","Map","getIsCjsPromise","isCjsPromise","get","promise","Promise","resolve","undefined","set","setIsCjsPromise","resolution","getCandidatesForExtension","resolved","extension","sep","getCandidates","extensions","reduce","paths","concat","getResolveId","resolveExtensions","importee","importer","dirname","candidates","i","stats","statSync","isFile","err","resolveId","isProxyModule","endsWith","startsWith","skipSelf","then","external","flatten","node","parts","type","computed","unshift","property","name","object","keypath","join","isTruthy","value","expression","operator","operators","isFalsy","not","equals","a","b","strict","x","left","right","argument","getName","makeLegalIdentifier","basename","extname","segments","split","reserved","blacklist","__esModule","forEach","word","exportsPattern","firstpassGlobal","firstpassNoGlobal","importExportDeclaration","functionType","deconflict","scope","globals","identifier","deconflicted","contains","has","declarations","tryParse","parse","code","allowReturnOutsideFunction","message","hasCjsKeywords","ignoreGlobal","firstpass","test","checkEsModule","ast","isEsModule","body","hasDefaultExport","specifiers","specifier","exported","transformCommonjs","isEntry","ignoreRequire","customNamedExports","sourceMap","allowDynamicRequire","astCache","magicString","MagicString","required","sources","uid","attachScopes","uses","module","exports","global","require","lexicalDepth","programDepth","Set","HELPERS_NAME","namedExports","shouldWrap","isRequireStatement","callee","arguments","hasDynamicArguments","expressions","isStaticRequireStatement","getRequireStringArg","quasis","cooked","getRequired","sourceId","existing","push","source","importsDefault","assignedTo","walk","enter","extractAssignedNames","add","parent","addSourcemapLocation","start","end","consequent","skip","alternate","_skip","overwrite","storeName","flattened","isReference","match","exec","properties","prop","key","init","_shouldRemove","remove","leave","keepDeclaration","c","declarator","Object","keys","Error","includeHelpers","importBlock","map","namedExportDeclarations","wrapperStart","wrapperEnd","moduleName","exportModuleExports","str","addExport","declaration","defaultExportPropertyAssignments","args","names","filter","defaultExport","named","exportBlock","trim","prepend","append","toString","generateMap","commonjs","options","createFilter","include","exclude","resolvedId","isCore","nodeResolveSync","basedir","process","cwd","existsSync","realpath","realpathSync","esModulesWithoutDefaultExport","esModulesWithDefaultExport","ignore","Array","isArray","includes","transformAndCheckExports","transformed","getModuleInfo","buildStart","meta","rollupVersion","Number","major","minor","minVersion","peerDependencies","rollup","minMaj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