rollup 2.38.4 → 2.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.38.4
4
- Tue, 02 Feb 2021 05:54:38 GMT - commit 991bb98fad1f3f76226bfe6243fd6cc45a19a39b
3
+ Rollup.js v2.40.0
4
+ Fri, 26 Feb 2021 14:39:44 GMT - commit 0a0958ff926554abe9916178f56762ba71301ddd
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -13,12 +13,12 @@ import { createHash as createHash$1 } from 'crypto';
13
13
  import { writeFile as writeFile$1, readdirSync, mkdirSync, readFile as readFile$1, lstatSync, realpathSync } from 'fs';
14
14
  import { EventEmitter } from 'events';
15
15
 
16
- var version = "2.38.4";
16
+ var version$1 = "2.40.0";
17
17
 
18
18
  var charToInteger = {};
19
- var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
20
- for (var i = 0; i < chars.length; i++) {
21
- charToInteger[chars.charCodeAt(i)] = i;
19
+ var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
20
+ for (var i = 0; i < chars$1.length; i++) {
21
+ charToInteger[chars$1.charCodeAt(i)] = i;
22
22
  }
23
23
  function decode(mappings) {
24
24
  var decoded = [];
@@ -132,7 +132,7 @@ function encodeInteger(num) {
132
132
  if (num > 0) {
133
133
  clamped |= 32;
134
134
  }
135
- result += chars[clamped];
135
+ result += chars$1[clamped];
136
136
  } while (num > 0);
137
137
  return result;
138
138
  }
@@ -149,7 +149,7 @@ BitSet.prototype.has = function has (n) {
149
149
  return !!(this.bits[n >> 5] & (1 << (n & 31)));
150
150
  };
151
151
 
152
- var Chunk = function Chunk(start, end, content) {
152
+ var Chunk$1 = function Chunk(start, end, content) {
153
153
  this.start = start;
154
154
  this.end = end;
155
155
  this.original = content;
@@ -168,16 +168,16 @@ var Chunk = function Chunk(start, end, content) {
168
168
  });
169
169
  };
170
170
 
171
- Chunk.prototype.appendLeft = function appendLeft (content) {
171
+ Chunk$1.prototype.appendLeft = function appendLeft (content) {
172
172
  this.outro += content;
173
173
  };
174
174
 
175
- Chunk.prototype.appendRight = function appendRight (content) {
175
+ Chunk$1.prototype.appendRight = function appendRight (content) {
176
176
  this.intro = this.intro + content;
177
177
  };
178
178
 
179
- Chunk.prototype.clone = function clone () {
180
- var chunk = new Chunk(this.start, this.end, this.original);
179
+ Chunk$1.prototype.clone = function clone () {
180
+ var chunk = new Chunk$1(this.start, this.end, this.original);
181
181
 
182
182
  chunk.intro = this.intro;
183
183
  chunk.outro = this.outro;
@@ -188,11 +188,11 @@ Chunk.prototype.clone = function clone () {
188
188
  return chunk;
189
189
  };
190
190
 
191
- Chunk.prototype.contains = function contains (index) {
191
+ Chunk$1.prototype.contains = function contains (index) {
192
192
  return this.start < index && index < this.end;
193
193
  };
194
194
 
195
- Chunk.prototype.eachNext = function eachNext (fn) {
195
+ Chunk$1.prototype.eachNext = function eachNext (fn) {
196
196
  var chunk = this;
197
197
  while (chunk) {
198
198
  fn(chunk);
@@ -200,7 +200,7 @@ Chunk.prototype.eachNext = function eachNext (fn) {
200
200
  }
201
201
  };
202
202
 
203
- Chunk.prototype.eachPrevious = function eachPrevious (fn) {
203
+ Chunk$1.prototype.eachPrevious = function eachPrevious (fn) {
204
204
  var chunk = this;
205
205
  while (chunk) {
206
206
  fn(chunk);
@@ -208,7 +208,7 @@ Chunk.prototype.eachPrevious = function eachPrevious (fn) {
208
208
  }
209
209
  };
210
210
 
211
- Chunk.prototype.edit = function edit (content, storeName, contentOnly) {
211
+ Chunk$1.prototype.edit = function edit (content, storeName, contentOnly) {
212
212
  this.content = content;
213
213
  if (!contentOnly) {
214
214
  this.intro = '';
@@ -221,15 +221,15 @@ Chunk.prototype.edit = function edit (content, storeName, contentOnly) {
221
221
  return this;
222
222
  };
223
223
 
224
- Chunk.prototype.prependLeft = function prependLeft (content) {
224
+ Chunk$1.prototype.prependLeft = function prependLeft (content) {
225
225
  this.outro = content + this.outro;
226
226
  };
227
227
 
228
- Chunk.prototype.prependRight = function prependRight (content) {
228
+ Chunk$1.prototype.prependRight = function prependRight (content) {
229
229
  this.intro = content + this.intro;
230
230
  };
231
231
 
232
- Chunk.prototype.split = function split (index) {
232
+ Chunk$1.prototype.split = function split (index) {
233
233
  var sliceIndex = index - this.start;
234
234
 
235
235
  var originalBefore = this.original.slice(0, sliceIndex);
@@ -237,7 +237,7 @@ Chunk.prototype.split = function split (index) {
237
237
 
238
238
  this.original = originalBefore;
239
239
 
240
- var newChunk = new Chunk(index, this.end, originalAfter);
240
+ var newChunk = new Chunk$1(index, this.end, originalAfter);
241
241
  newChunk.outro = this.outro;
242
242
  this.outro = '';
243
243
 
@@ -259,11 +259,11 @@ Chunk.prototype.split = function split (index) {
259
259
  return newChunk;
260
260
  };
261
261
 
262
- Chunk.prototype.toString = function toString () {
262
+ Chunk$1.prototype.toString = function toString () {
263
263
  return this.intro + this.content + this.outro;
264
264
  };
265
265
 
266
- Chunk.prototype.trimEnd = function trimEnd (rx) {
266
+ Chunk$1.prototype.trimEnd = function trimEnd (rx) {
267
267
  this.outro = this.outro.replace(rx, '');
268
268
  if (this.outro.length) { return true; }
269
269
 
@@ -283,7 +283,7 @@ Chunk.prototype.trimEnd = function trimEnd (rx) {
283
283
  }
284
284
  };
285
285
 
286
- Chunk.prototype.trimStart = function trimStart (rx) {
286
+ Chunk$1.prototype.trimStart = function trimStart (rx) {
287
287
  this.intro = this.intro.replace(rx, '');
288
288
  if (this.intro.length) { return true; }
289
289
 
@@ -375,13 +375,13 @@ function getRelativePath(from, to) {
375
375
  return fromParts.concat(toParts).join('/');
376
376
  }
377
377
 
378
- var toString = Object.prototype.toString;
378
+ var toString$1 = Object.prototype.toString;
379
379
 
380
380
  function isObject(thing) {
381
- return toString.call(thing) === '[object Object]';
381
+ return toString$1.call(thing) === '[object Object]';
382
382
  }
383
383
 
384
- function getLocator(source) {
384
+ function getLocator$1(source) {
385
385
  var originalLines = source.split('\n');
386
386
  var lineOffsets = [];
387
387
 
@@ -486,7 +486,7 @@ var warned = {
486
486
  var MagicString = function MagicString(string, options) {
487
487
  if ( options === void 0 ) options = {};
488
488
 
489
- var chunk = new Chunk(0, string.length, string);
489
+ var chunk = new Chunk$1(0, string.length, string);
490
490
 
491
491
  Object.defineProperties(this, {
492
492
  original: { writable: true, value: string },
@@ -595,7 +595,7 @@ MagicString.prototype.generateDecodedMap = function generateDecodedMap (options)
595
595
  var names = Object.keys(this.storedNames);
596
596
  var mappings = new Mappings(options.hires);
597
597
 
598
- var locate = getLocator(this.original);
598
+ var locate = getLocator$1(this.original);
599
599
 
600
600
  if (this.intro) {
601
601
  mappings.advance(this.intro);
@@ -831,7 +831,7 @@ MagicString.prototype.overwrite = function overwrite (start, end, content, optio
831
831
  }
832
832
  } else {
833
833
  // must be inserting at the end
834
- var newChunk = new Chunk(start, end, '').edit(content, storeName);
834
+ var newChunk = new Chunk$1(start, end, '').edit(content, storeName);
835
835
 
836
836
  // TODO last chunk in the array may not be the last chunk, if it's moved...
837
837
  last.next = newChunk;
@@ -1029,7 +1029,7 @@ MagicString.prototype._split = function _split (index) {
1029
1029
  MagicString.prototype._splitChunk = function _splitChunk (chunk, index) {
1030
1030
  if (chunk.edited && chunk.content.length) {
1031
1031
  // zero-length edited chunks are a special case (overlapping replacements)
1032
- var loc = getLocator(this.original)(index);
1032
+ var loc = getLocator$1(this.original)(index);
1033
1033
  throw new Error(
1034
1034
  ("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " – \"" + (chunk.original) + "\")")
1035
1035
  );
@@ -1156,7 +1156,7 @@ MagicString.prototype.trimStart = function trimStart (charType) {
1156
1156
 
1157
1157
  var hasOwnProp = Object.prototype.hasOwnProperty;
1158
1158
 
1159
- var Bundle = function Bundle(options) {
1159
+ var Bundle$1 = function Bundle(options) {
1160
1160
  if ( options === void 0 ) options = {};
1161
1161
 
1162
1162
  this.intro = options.intro || '';
@@ -1166,7 +1166,7 @@ var Bundle = function Bundle(options) {
1166
1166
  this.uniqueSourceIndexByFilename = {};
1167
1167
  };
1168
1168
 
1169
- Bundle.prototype.addSource = function addSource (source) {
1169
+ Bundle$1.prototype.addSource = function addSource (source) {
1170
1170
  if (source instanceof MagicString) {
1171
1171
  return this.addSource({
1172
1172
  content: source,
@@ -1204,7 +1204,7 @@ Bundle.prototype.addSource = function addSource (source) {
1204
1204
  return this;
1205
1205
  };
1206
1206
 
1207
- Bundle.prototype.append = function append (str, options) {
1207
+ Bundle$1.prototype.append = function append (str, options) {
1208
1208
  this.addSource({
1209
1209
  content: new MagicString(str),
1210
1210
  separator: (options && options.separator) || ''
@@ -1213,8 +1213,8 @@ Bundle.prototype.append = function append (str, options) {
1213
1213
  return this;
1214
1214
  };
1215
1215
 
1216
- Bundle.prototype.clone = function clone () {
1217
- var bundle = new Bundle({
1216
+ Bundle$1.prototype.clone = function clone () {
1217
+ var bundle = new Bundle$1({
1218
1218
  intro: this.intro,
1219
1219
  separator: this.separator
1220
1220
  });
@@ -1230,7 +1230,7 @@ Bundle.prototype.clone = function clone () {
1230
1230
  return bundle;
1231
1231
  };
1232
1232
 
1233
- Bundle.prototype.generateDecodedMap = function generateDecodedMap (options) {
1233
+ Bundle$1.prototype.generateDecodedMap = function generateDecodedMap (options) {
1234
1234
  var this$1 = this;
1235
1235
  if ( options === void 0 ) options = {};
1236
1236
 
@@ -1254,7 +1254,7 @@ Bundle.prototype.generateDecodedMap = function generateDecodedMap (options) {
1254
1254
 
1255
1255
  var sourceIndex = source.filename ? this$1.uniqueSourceIndexByFilename[source.filename] : -1;
1256
1256
  var magicString = source.content;
1257
- var locate = getLocator(magicString.original);
1257
+ var locate = getLocator$1(magicString.original);
1258
1258
 
1259
1259
  if (magicString.intro) {
1260
1260
  mappings.advance(magicString.intro);
@@ -1307,11 +1307,11 @@ Bundle.prototype.generateDecodedMap = function generateDecodedMap (options) {
1307
1307
  };
1308
1308
  };
1309
1309
 
1310
- Bundle.prototype.generateMap = function generateMap (options) {
1310
+ Bundle$1.prototype.generateMap = function generateMap (options) {
1311
1311
  return new SourceMap(this.generateDecodedMap(options));
1312
1312
  };
1313
1313
 
1314
- Bundle.prototype.getIndentString = function getIndentString () {
1314
+ Bundle$1.prototype.getIndentString = function getIndentString () {
1315
1315
  var indentStringCounts = {};
1316
1316
 
1317
1317
  this.sources.forEach(function (source) {
@@ -1330,7 +1330,7 @@ Bundle.prototype.getIndentString = function getIndentString () {
1330
1330
  );
1331
1331
  };
1332
1332
 
1333
- Bundle.prototype.indent = function indent (indentStr) {
1333
+ Bundle$1.prototype.indent = function indent (indentStr) {
1334
1334
  var this$1 = this;
1335
1335
 
1336
1336
  if (!arguments.length) {
@@ -1364,12 +1364,12 @@ Bundle.prototype.indent = function indent (indentStr) {
1364
1364
  return this;
1365
1365
  };
1366
1366
 
1367
- Bundle.prototype.prepend = function prepend (str) {
1367
+ Bundle$1.prototype.prepend = function prepend (str) {
1368
1368
  this.intro = str + this.intro;
1369
1369
  return this;
1370
1370
  };
1371
1371
 
1372
- Bundle.prototype.toString = function toString () {
1372
+ Bundle$1.prototype.toString = function toString () {
1373
1373
  var this$1 = this;
1374
1374
 
1375
1375
  var body = this.sources
@@ -1384,7 +1384,7 @@ Bundle.prototype.toString = function toString () {
1384
1384
  return this.intro + body;
1385
1385
  };
1386
1386
 
1387
- Bundle.prototype.isEmpty = function isEmpty () {
1387
+ Bundle$1.prototype.isEmpty = function isEmpty () {
1388
1388
  if (this.intro.length && this.intro.trim())
1389
1389
  { return false; }
1390
1390
  if (this.sources.some(function (source) { return !source.content.isEmpty(); }))
@@ -1392,19 +1392,19 @@ Bundle.prototype.isEmpty = function isEmpty () {
1392
1392
  return true;
1393
1393
  };
1394
1394
 
1395
- Bundle.prototype.length = function length () {
1395
+ Bundle$1.prototype.length = function length () {
1396
1396
  return this.sources.reduce(function (length, source) { return length + source.content.length(); }, this.intro.length);
1397
1397
  };
1398
1398
 
1399
- Bundle.prototype.trimLines = function trimLines () {
1399
+ Bundle$1.prototype.trimLines = function trimLines () {
1400
1400
  return this.trim('[\\r\\n]');
1401
1401
  };
1402
1402
 
1403
- Bundle.prototype.trim = function trim (charType) {
1403
+ Bundle$1.prototype.trim = function trim (charType) {
1404
1404
  return this.trimStart(charType).trimEnd(charType);
1405
1405
  };
1406
1406
 
1407
- Bundle.prototype.trimStart = function trimStart (charType) {
1407
+ Bundle$1.prototype.trimStart = function trimStart (charType) {
1408
1408
  var rx = new RegExp('^' + (charType || '\\s') + '+');
1409
1409
  this.intro = this.intro.replace(rx, '');
1410
1410
 
@@ -1423,7 +1423,7 @@ Bundle.prototype.trimStart = function trimStart (charType) {
1423
1423
  return this;
1424
1424
  };
1425
1425
 
1426
- Bundle.prototype.trimEnd = function trimEnd (charType) {
1426
+ Bundle$1.prototype.trimEnd = function trimEnd (charType) {
1427
1427
  var rx = new RegExp((charType || '\\s') + '+$');
1428
1428
 
1429
1429
  var source;
@@ -1461,17 +1461,17 @@ function relative(from, to) {
1461
1461
  return toParts.join('/');
1462
1462
  }
1463
1463
 
1464
- const ArrowFunctionExpression = 'ArrowFunctionExpression';
1465
- const BlockStatement = 'BlockStatement';
1466
- const CallExpression = 'CallExpression';
1467
- const ExpressionStatement = 'ExpressionStatement';
1468
- const FunctionExpression = 'FunctionExpression';
1469
- const Identifier = 'Identifier';
1470
- const ImportDefaultSpecifier = 'ImportDefaultSpecifier';
1471
- const ImportNamespaceSpecifier = 'ImportNamespaceSpecifier';
1472
- const Program = 'Program';
1473
- const Property = 'Property';
1474
- const ReturnStatement = 'ReturnStatement';
1464
+ const ArrowFunctionExpression$1 = 'ArrowFunctionExpression';
1465
+ const BlockStatement$1 = 'BlockStatement';
1466
+ const CallExpression$1 = 'CallExpression';
1467
+ const ExpressionStatement$1 = 'ExpressionStatement';
1468
+ const Identifier$1 = 'Identifier';
1469
+ const ImportDefaultSpecifier$1 = 'ImportDefaultSpecifier';
1470
+ const ImportNamespaceSpecifier$1 = 'ImportNamespaceSpecifier';
1471
+ const NewExpression$1 = 'NewExpression';
1472
+ const Program$1 = 'Program';
1473
+ const Property$1 = 'Property';
1474
+ const ReturnStatement$1 = 'ReturnStatement';
1475
1475
 
1476
1476
  function treeshakeNode(node, code, start, end) {
1477
1477
  code.remove(start, end);
@@ -1487,7 +1487,7 @@ function treeshakeNode(node, code, start, end) {
1487
1487
  }
1488
1488
  }
1489
1489
  function removeAnnotations(node, code) {
1490
- if (!node.annotations && node.parent.type === ExpressionStatement) {
1490
+ if (!node.annotations && node.parent.type === ExpressionStatement$1) {
1491
1491
  node = node.parent;
1492
1492
  }
1493
1493
  if (node.annotations) {
@@ -1661,14 +1661,14 @@ function getSystemExportFunctionLeft(exportedVariables, setFromExpression, optio
1661
1661
  .join(`,${_}`)}${_}}),${_}v${s}${_}}(`;
1662
1662
  }
1663
1663
 
1664
- const chars$1 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
1665
- const base = 64;
1664
+ const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
1665
+ const base$1 = 64;
1666
1666
  function toBase64(num) {
1667
1667
  let outStr = '';
1668
1668
  do {
1669
- const curDigit = num % base;
1670
- num = Math.floor(num / base);
1671
- outStr = chars$1[curDigit] + outStr;
1669
+ const curDigit = num % base$1;
1670
+ num = Math.floor(num / base$1);
1671
+ outStr = chars[curDigit] + outStr;
1672
1672
  } while (num !== 0);
1673
1673
  return outStr;
1674
1674
  }
@@ -2403,7 +2403,7 @@ class LocalVariable extends Variable {
2403
2403
  // We do not want to properly include parents in case they are part of a dead branch
2404
2404
  // in which case .include() might pull in more dead code
2405
2405
  node.included = true;
2406
- if (node.type === Program)
2406
+ if (node.type === Program$1)
2407
2407
  break;
2408
2408
  node = node.parent;
2409
2409
  }
@@ -2427,7 +2427,7 @@ class LocalVariable extends Variable {
2427
2427
  }
2428
2428
  }
2429
2429
 
2430
- class Scope {
2430
+ class Scope$1 {
2431
2431
  constructor() {
2432
2432
  this.children = [];
2433
2433
  this.variables = new Map();
@@ -2452,7 +2452,7 @@ class Scope {
2452
2452
  }
2453
2453
  }
2454
2454
 
2455
- class ChildScope extends Scope {
2455
+ class ChildScope extends Scope$1 {
2456
2456
  constructor(parent) {
2457
2457
  super();
2458
2458
  this.accessedOutsideVariables = new Map();
@@ -2534,7 +2534,7 @@ class ChildScope extends Scope {
2534
2534
  }
2535
2535
  }
2536
2536
 
2537
- function getLocator$1(source, options) {
2537
+ function getLocator(source, options) {
2538
2538
  if (options === void 0) { options = {}; }
2539
2539
  var offsetLine = options.offsetLine || 0;
2540
2540
  var offsetColumn = options.offsetColumn || 0;
@@ -2572,7 +2572,7 @@ function locate(source, search, options) {
2572
2572
  if (typeof options === 'number') {
2573
2573
  throw new Error('locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument');
2574
2574
  }
2575
- return getLocator$1(source, options)(search, options && options.startIndex);
2575
+ return getLocator(source, options)(search, options && options.startIndex);
2576
2576
  }
2577
2577
 
2578
2578
  const keys = {
@@ -2952,34 +2952,55 @@ class FunctionScope extends ReturnValueScope {
2952
2952
  }
2953
2953
  }
2954
2954
 
2955
- function isReference(node, parent) {
2956
- if (node.type === 'MemberExpression') {
2957
- return !node.computed && isReference(node.object, node);
2958
- }
2959
- if (node.type === 'Identifier') {
2960
- if (!parent)
2961
- return true;
2962
- switch (parent.type) {
2963
- // disregard `bar` in `foo.bar`
2964
- case 'MemberExpression': return parent.computed || node === parent.object;
2965
- // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}`
2966
- case 'MethodDefinition': return parent.computed;
2967
- // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}`
2968
- case 'FieldDefinition': return parent.computed || node === parent.value;
2969
- // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
2970
- case 'Property': return parent.computed || node === parent.value;
2971
- // disregard the `bar` in `export { foo as bar }` or
2972
- // the foo in `import { foo as bar }`
2973
- case 'ExportSpecifier':
2974
- case 'ImportSpecifier': return node === parent.local;
2975
- // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}`
2976
- case 'LabeledStatement':
2977
- case 'BreakStatement':
2978
- case 'ContinueStatement': return false;
2979
- default: return true;
2980
- }
2981
- }
2982
- return false;
2955
+ //@ts-check
2956
+ /** @typedef { import('estree').Node} Node */
2957
+ /** @typedef {Node | {
2958
+ * type: 'PropertyDefinition';
2959
+ * computed: boolean;
2960
+ * value: Node
2961
+ * }} NodeWithPropertyDefinition */
2962
+
2963
+ /**
2964
+ *
2965
+ * @param {NodeWithPropertyDefinition} node
2966
+ * @param {NodeWithPropertyDefinition} parent
2967
+ * @returns boolean
2968
+ */
2969
+ function is_reference (node, parent) {
2970
+ if (node.type === 'MemberExpression') {
2971
+ return !node.computed && is_reference(node.object, node);
2972
+ }
2973
+
2974
+ if (node.type === 'Identifier') {
2975
+ if (!parent) return true;
2976
+
2977
+ switch (parent.type) {
2978
+ // disregard `bar` in `foo.bar`
2979
+ case 'MemberExpression': return parent.computed || node === parent.object;
2980
+
2981
+ // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}`
2982
+ case 'MethodDefinition': return parent.computed;
2983
+
2984
+ // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}`
2985
+ case 'PropertyDefinition': return parent.computed || node === parent.value;
2986
+
2987
+ // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
2988
+ case 'Property': return parent.computed || node === parent.value;
2989
+
2990
+ // disregard the `bar` in `export { foo as bar }` or
2991
+ // the foo in `import { foo as bar }`
2992
+ case 'ExportSpecifier':
2993
+ case 'ImportSpecifier': return node === parent.local;
2994
+
2995
+ // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}`
2996
+ case 'LabeledStatement':
2997
+ case 'BreakStatement':
2998
+ case 'ContinueStatement': return false;
2999
+ default: return true;
3000
+ }
3001
+ }
3002
+
3003
+ return false;
2983
3004
  }
2984
3005
 
2985
3006
  const BLANK = Object.freeze(Object.create(null));
@@ -3867,7 +3888,7 @@ class GlobalVariable extends Variable {
3867
3888
  }
3868
3889
  }
3869
3890
 
3870
- class Identifier$1 extends NodeBase {
3891
+ class Identifier extends NodeBase {
3871
3892
  constructor() {
3872
3893
  super(...arguments);
3873
3894
  this.variable = null;
@@ -3882,7 +3903,7 @@ class Identifier$1 extends NodeBase {
3882
3903
  if (this.bound)
3883
3904
  return;
3884
3905
  this.bound = true;
3885
- if (this.variable === null && isReference(this, this.parent)) {
3906
+ if (this.variable === null && is_reference(this, this.parent)) {
3886
3907
  this.variable = this.scope.findVariable(this.name);
3887
3908
  this.variable.addReference(this);
3888
3909
  }
@@ -3974,7 +3995,7 @@ class Identifier$1 extends NodeBase {
3974
3995
  }
3975
3996
  // In strict mode, any variable named "eval" must be the actual "eval" function
3976
3997
  if (name === 'eval' &&
3977
- renderedParentType === CallExpression &&
3998
+ renderedParentType === CallExpression$1 &&
3978
3999
  isCalleeOfRenderedParent) {
3979
4000
  code.appendRight(this.start, '0, ');
3980
4001
  }
@@ -4086,7 +4107,7 @@ class FunctionNode extends NodeBase {
4086
4107
  this.id.include();
4087
4108
  const hasArguments = this.scope.argumentsVariable.included;
4088
4109
  for (const param of this.params) {
4089
- if (!(param instanceof Identifier$1) || hasArguments) {
4110
+ if (!(param instanceof Identifier) || hasArguments) {
4090
4111
  param.include(context, includeChildrenRecursively);
4091
4112
  }
4092
4113
  }
@@ -4176,7 +4197,7 @@ class ExportDefaultDeclaration extends NodeBase {
4176
4197
  code.remove(this.start, declarationStart);
4177
4198
  this.declaration.render(code, options, {
4178
4199
  isCalleeOfRenderedParent: false,
4179
- renderedParentType: ExpressionStatement
4200
+ renderedParentType: ExpressionStatement$1
4180
4201
  });
4181
4202
  if (code.original[this.end - 1] !== ';') {
4182
4203
  code.appendLeft(this.end, ';');
@@ -4236,7 +4257,7 @@ class ExportDefaultVariable extends LocalVariable {
4236
4257
  this.hasId = true;
4237
4258
  this.originalId = declaration.id;
4238
4259
  }
4239
- else if (declaration instanceof Identifier$1) {
4260
+ else if (declaration instanceof Identifier) {
4240
4261
  this.originalId = declaration;
4241
4262
  }
4242
4263
  }
@@ -4470,9 +4491,9 @@ class ExternalVariable extends Variable {
4470
4491
  }
4471
4492
  }
4472
4493
 
4473
- const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'.split(' ');
4474
- const builtins = 'Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'.split(' ');
4475
- const blacklisted = new Set(reservedWords.concat(builtins));
4494
+ const reservedWords$1 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'.split(' ');
4495
+ const builtins$1 = 'Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'.split(' ');
4496
+ const blacklisted = new Set(reservedWords$1.concat(builtins$1));
4476
4497
  const illegalCharacters = /[^$_a-zA-Z0-9]/g;
4477
4498
  const startsWithDigit = (str) => /\d/.test(str[0]);
4478
4499
  function isLegal(str) {
@@ -4705,38 +4726,13 @@ function getFrozen(fragment, freeze) {
4705
4726
  }
4706
4727
  const HELPER_NAMES = Object.keys(HELPER_GENERATORS);
4707
4728
 
4708
- function getExportBlock(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings, mechanism = 'return ') {
4729
+ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings, mechanism = 'return ') {
4709
4730
  const _ = compact ? '' : ' ';
4710
4731
  const n = compact ? '' : '\n';
4711
4732
  if (!namedExportsMode) {
4712
4733
  return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings)};`;
4713
4734
  }
4714
4735
  let exportBlock = '';
4715
- // star exports must always output first for precedence
4716
- for (const { name, reexports } of dependencies) {
4717
- if (reexports && namedExportsMode) {
4718
- for (const specifier of reexports) {
4719
- if (specifier.reexported === '*') {
4720
- if (exportBlock)
4721
- exportBlock += n;
4722
- if (specifier.needsLiveBinding) {
4723
- exportBlock +=
4724
- `Object.keys(${name}).forEach(function${_}(k)${_}{${n}` +
4725
- `${t}if${_}(k${_}!==${_}'default')${_}Object.defineProperty(exports,${_}k,${_}{${n}` +
4726
- `${t}${t}enumerable:${_}true,${n}` +
4727
- `${t}${t}get:${_}function${_}()${_}{${n}` +
4728
- `${t}${t}${t}return ${name}[k];${n}` +
4729
- `${t}${t}}${n}${t}});${n}});`;
4730
- }
4731
- else {
4732
- exportBlock +=
4733
- `Object.keys(${name}).forEach(function${_}(k)${_}{${n}` +
4734
- `${t}if${_}(k${_}!==${_}'default')${_}exports[k]${_}=${_}${name}[k];${n}});`;
4735
- }
4736
- }
4737
- }
4738
- }
4739
- }
4740
4736
  for (const { defaultVariableName, id, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) {
4741
4737
  if (reexports && namedExportsMode) {
4742
4738
  for (const specifier of reexports) {
@@ -4764,6 +4760,30 @@ function getExportBlock(exports, dependencies, namedExportsMode, interop, compac
4764
4760
  exportBlock += `${lhs}${_}=${_}${rhs};`;
4765
4761
  }
4766
4762
  }
4763
+ for (const { name, reexports } of dependencies) {
4764
+ if (reexports && namedExportsMode) {
4765
+ for (const specifier of reexports) {
4766
+ if (specifier.reexported === '*') {
4767
+ if (exportBlock)
4768
+ exportBlock += n;
4769
+ if (specifier.needsLiveBinding) {
4770
+ exportBlock +=
4771
+ `Object.keys(${name}).forEach(function${_}(k)${_}{${n}` +
4772
+ `${t}if${_}(k${_}!==${_}'default'${_}&&${_}!exports.hasOwnProperty(k))${_}Object.defineProperty(exports,${_}k,${_}{${n}` +
4773
+ `${t}${t}enumerable:${_}true,${n}` +
4774
+ `${t}${t}get:${_}function${_}()${_}{${n}` +
4775
+ `${t}${t}${t}return ${name}[k];${n}` +
4776
+ `${t}${t}}${n}${t}});${n}});`;
4777
+ }
4778
+ else {
4779
+ exportBlock +=
4780
+ `Object.keys(${name}).forEach(function${_}(k)${_}{${n}` +
4781
+ `${t}if${_}(k${_}!==${_}'default'${_}&&${_}!exports.hasOwnProperty(k))${_}exports[k]${_}=${_}${name}[k];${n}});`;
4782
+ }
4783
+ }
4784
+ }
4785
+ }
4786
+ }
4767
4787
  if (exportBlock) {
4768
4788
  return `${n}${n}${exportBlock}`;
4769
4789
  }
@@ -4888,7 +4908,7 @@ function removeExtensionFromRelativeAmdId(id) {
4888
4908
  return id[0] === '.' ? removeJsExtension(id) : id;
4889
4909
  }
4890
4910
 
4891
- const builtins$1 = {
4911
+ const builtins = {
4892
4912
  assert: true,
4893
4913
  buffer: true,
4894
4914
  console: true,
@@ -4912,7 +4932,7 @@ const builtins$1 = {
4912
4932
  zlib: true
4913
4933
  };
4914
4934
  function warnOnBuiltins(warn, dependencies) {
4915
- const externalBuiltins = dependencies.map(({ id }) => id).filter(id => id in builtins$1);
4935
+ const externalBuiltins = dependencies.map(({ id }) => id).filter(id => id in builtins);
4916
4936
  if (!externalBuiltins.length)
4917
4937
  return;
4918
4938
  const detail = externalBuiltins.length === 1
@@ -4952,7 +4972,7 @@ function amd(magicString, { accessedGlobals, dependencies, exports, hasExports,
4952
4972
  (deps.length ? `[${deps.join(`,${_}`)}],${_}` : ``);
4953
4973
  const useStrict = strict ? `${_}'use strict';` : '';
4954
4974
  magicString.prepend(`${intro}${getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t)}`);
4955
- const exportBlock = getExportBlock(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
4975
+ const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
4956
4976
  let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && esModule, isModuleFacade && namespaceToStringTag, _, n);
4957
4977
  if (namespaceMarkers) {
4958
4978
  namespaceMarkers = n + n + namespaceMarkers;
@@ -4973,13 +4993,13 @@ function cjs(magicString, { accessedGlobals, dependencies, exports, hasExports,
4973
4993
  if (namespaceMarkers) {
4974
4994
  namespaceMarkers += n + n;
4975
4995
  }
4976
- const importBlock = getImportBlock(dependencies, compact, varOrConst, n, _);
4996
+ const importBlock = getImportBlock$1(dependencies, compact, varOrConst, n, _);
4977
4997
  const interopBlock = getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t);
4978
4998
  magicString.prepend(`${useStrict}${intro}${namespaceMarkers}${importBlock}${interopBlock}`);
4979
- const exportBlock = getExportBlock(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings, `module.exports${_}=${_}`);
4999
+ const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings, `module.exports${_}=${_}`);
4980
5000
  return magicString.append(`${exportBlock}${outro}`);
4981
5001
  }
4982
- function getImportBlock(dependencies, compact, varOrConst, n, _) {
5002
+ function getImportBlock$1(dependencies, compact, varOrConst, n, _) {
4983
5003
  let importBlock = '';
4984
5004
  let definingVariable = false;
4985
5005
  for (const { id, name, reexports, imports } of dependencies) {
@@ -5006,19 +5026,19 @@ function getImportBlock(dependencies, compact, varOrConst, n, _) {
5006
5026
  function es(magicString, { intro, outro, dependencies, exports, varOrConst }, { compact }) {
5007
5027
  const _ = compact ? '' : ' ';
5008
5028
  const n = compact ? '' : '\n';
5009
- const importBlock = getImportBlock$1(dependencies, _);
5029
+ const importBlock = getImportBlock(dependencies, _);
5010
5030
  if (importBlock.length > 0)
5011
5031
  intro += importBlock.join(n) + n + n;
5012
5032
  if (intro)
5013
5033
  magicString.prepend(intro);
5014
- const exportBlock = getExportBlock$1(exports, _, varOrConst);
5034
+ const exportBlock = getExportBlock(exports, _, varOrConst);
5015
5035
  if (exportBlock.length)
5016
5036
  magicString.append(n + n + exportBlock.join(n).trim());
5017
5037
  if (outro)
5018
5038
  magicString.append(outro);
5019
5039
  return magicString.trim();
5020
5040
  }
5021
- function getImportBlock$1(dependencies, _) {
5041
+ function getImportBlock(dependencies, _) {
5022
5042
  const importBlock = [];
5023
5043
  for (const { id, reexports, imports, name } of dependencies) {
5024
5044
  if (!reexports && !imports) {
@@ -5102,7 +5122,7 @@ function getImportBlock$1(dependencies, _) {
5102
5122
  }
5103
5123
  return importBlock;
5104
5124
  }
5105
- function getExportBlock$1(exports, _, varOrConst) {
5125
+ function getExportBlock(exports, _, varOrConst) {
5106
5126
  const exportBlock = [];
5107
5127
  const exportDeclaration = [];
5108
5128
  for (const specifier of exports) {
@@ -5159,7 +5179,11 @@ function getCodeFrame(source, line, column) {
5159
5179
  }
5160
5180
 
5161
5181
  function sanitizeFileName(name) {
5162
- return name.replace(/[\0?*]/g, '_');
5182
+ const match = /^[a-z]:/i.exec(name);
5183
+ const driveLetter = match ? match[0] : "";
5184
+ // A `:` is only allowed as part of a windows drive letter (ex: C:\foo)
5185
+ // Otherwise, avoid them because they can refer to NTFS alternate data streams.
5186
+ return driveLetter + name.substr(driveLetter.length).replace(/[\0?*:]/g, '_');
5163
5187
  }
5164
5188
 
5165
5189
  function getAliasName(id) {
@@ -5209,6 +5233,7 @@ var Errors;
5209
5233
  Errors["BAD_LOADER"] = "BAD_LOADER";
5210
5234
  Errors["CANNOT_EMIT_FROM_OPTIONS_HOOK"] = "CANNOT_EMIT_FROM_OPTIONS_HOOK";
5211
5235
  Errors["CHUNK_NOT_GENERATED"] = "CHUNK_NOT_GENERATED";
5236
+ Errors["CHUNK_INVALID"] = "CHUNK_INVALID";
5212
5237
  Errors["CIRCULAR_REEXPORT"] = "CIRCULAR_REEXPORT";
5213
5238
  Errors["CYCLIC_CROSS_CHUNK_REEXPORT"] = "CYCLIC_CROSS_CHUNK_REEXPORT";
5214
5239
  Errors["DEPRECATED_FEATURE"] = "DEPRECATED_FEATURE";
@@ -5253,6 +5278,14 @@ function errChunkNotGeneratedForFileName(name) {
5253
5278
  message: `Plugin error - Unable to get file name for chunk "${name}". Ensure that generate is called first.`
5254
5279
  };
5255
5280
  }
5281
+ function errChunkInvalid({ fileName, code }, exception) {
5282
+ const errorProps = {
5283
+ code: Errors.CHUNK_INVALID,
5284
+ message: `Chunk "${fileName}" is not valid JavaScript: ${exception.message}.`
5285
+ };
5286
+ augmentCodeLocation(errorProps, exception.loc, code, fileName);
5287
+ return errorProps;
5288
+ }
5256
5289
  function errCircularReexport(exportName, importedModule) {
5257
5290
  return {
5258
5291
  code: Errors.CIRCULAR_REEXPORT,
@@ -5609,7 +5642,7 @@ function iife(magicString, { accessedGlobals, dependencies, exports, hasExports,
5609
5642
  if (hasExports && !extend && namedExportsMode) {
5610
5643
  wrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`;
5611
5644
  }
5612
- const exportBlock = getExportBlock(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
5645
+ const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
5613
5646
  let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule, namespaceToStringTag, _, n);
5614
5647
  if (namespaceMarkers) {
5615
5648
  namespaceMarkers = n + n + namespaceMarkers;
@@ -5850,7 +5883,7 @@ function umd(magicString, { accessedGlobals, dependencies, exports, hasExports,
5850
5883
  `}(${globalArg}(function${_}(${factoryArgs.join(', ')})${_}{${useStrict}${n}`;
5851
5884
  const wrapperOutro = n + n + '})));';
5852
5885
  magicString.prepend(`${intro}${getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t)}`);
5853
- const exportBlock = getExportBlock(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
5886
+ const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
5854
5887
  let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule, namespaceToStringTag, _, n);
5855
5888
  if (namespaceMarkers) {
5856
5889
  namespaceMarkers = n + n + namespaceMarkers;
@@ -5980,11 +6013,11 @@ class BlockScope extends ChildScope {
5980
6013
  }
5981
6014
  }
5982
6015
 
5983
- class ExpressionStatement$1 extends NodeBase {
6016
+ class ExpressionStatement extends NodeBase {
5984
6017
  initialise() {
5985
6018
  if (this.directive &&
5986
6019
  this.directive !== 'use strict' &&
5987
- this.parent.type === Program) {
6020
+ this.parent.type === Program$1) {
5988
6021
  this.context.warn(
5989
6022
  // This is necessary, because either way (deleting or not) can lead to errors.
5990
6023
  {
@@ -6000,19 +6033,19 @@ class ExpressionStatement$1 extends NodeBase {
6000
6033
  }
6001
6034
  shouldBeIncluded(context) {
6002
6035
  if (this.directive && this.directive !== 'use strict')
6003
- return this.parent.type !== Program;
6036
+ return this.parent.type !== Program$1;
6004
6037
  return super.shouldBeIncluded(context);
6005
6038
  }
6006
6039
  }
6007
6040
 
6008
- class BlockStatement$1 extends NodeBase {
6041
+ class BlockStatement extends NodeBase {
6009
6042
  constructor() {
6010
6043
  super(...arguments);
6011
6044
  this.directlyIncluded = false;
6012
6045
  }
6013
6046
  addImplicitReturnExpressionToScope() {
6014
6047
  const lastStatement = this.body[this.body.length - 1];
6015
- if (!lastStatement || lastStatement.type !== ReturnStatement) {
6048
+ if (!lastStatement || lastStatement.type !== ReturnStatement$1) {
6016
6049
  this.scope.addReturnExpression(UNKNOWN_EXPRESSION);
6017
6050
  }
6018
6051
  }
@@ -6047,7 +6080,7 @@ class BlockStatement$1 extends NodeBase {
6047
6080
  initialise() {
6048
6081
  const firstBodyStatement = this.body[0];
6049
6082
  this.deoptimizeBody =
6050
- firstBodyStatement instanceof ExpressionStatement$1 &&
6083
+ firstBodyStatement instanceof ExpressionStatement &&
6051
6084
  firstBodyStatement.directive === 'use asm';
6052
6085
  }
6053
6086
  render(code, options) {
@@ -6060,7 +6093,7 @@ class BlockStatement$1 extends NodeBase {
6060
6093
  }
6061
6094
  }
6062
6095
 
6063
- class ArrowFunctionExpression$1 extends NodeBase {
6096
+ class ArrowFunctionExpression extends NodeBase {
6064
6097
  createScope(parentScope) {
6065
6098
  this.scope = new ReturnValueScope(parentScope, this.context);
6066
6099
  }
@@ -6106,7 +6139,7 @@ class ArrowFunctionExpression$1 extends NodeBase {
6106
6139
  include(context, includeChildrenRecursively) {
6107
6140
  this.included = true;
6108
6141
  for (const param of this.params) {
6109
- if (!(param instanceof Identifier$1)) {
6142
+ if (!(param instanceof Identifier)) {
6110
6143
  param.include(context, includeChildrenRecursively);
6111
6144
  }
6112
6145
  }
@@ -6120,7 +6153,7 @@ class ArrowFunctionExpression$1 extends NodeBase {
6120
6153
  }
6121
6154
  initialise() {
6122
6155
  this.scope.addParameterVariables(this.params.map(param => param.declare('parameter', UNKNOWN_EXPRESSION)), this.params[this.params.length - 1] instanceof RestElement);
6123
- if (this.body instanceof BlockStatement$1) {
6156
+ if (this.body instanceof BlockStatement) {
6124
6157
  this.body.addImplicitReturnExpressionToScope();
6125
6158
  }
6126
6159
  else {
@@ -6128,13 +6161,13 @@ class ArrowFunctionExpression$1 extends NodeBase {
6128
6161
  }
6129
6162
  }
6130
6163
  parseNode(esTreeNode) {
6131
- if (esTreeNode.body.type === BlockStatement) {
6164
+ if (esTreeNode.body.type === BlockStatement$1) {
6132
6165
  this.body = new this.context.nodeConstructors.BlockStatement(esTreeNode.body, this, this.scope.hoistedBodyVarScope);
6133
6166
  }
6134
6167
  super.parseNode(esTreeNode);
6135
6168
  }
6136
6169
  }
6137
- ArrowFunctionExpression$1.prototype.preventChildBlockScope = true;
6170
+ ArrowFunctionExpression.prototype.preventChildBlockScope = true;
6138
6171
 
6139
6172
  class AssignmentExpression extends NodeBase {
6140
6173
  constructor() {
@@ -6166,17 +6199,20 @@ class AssignmentExpression extends NodeBase {
6166
6199
  }
6167
6200
  this.right.include(context, includeChildrenRecursively);
6168
6201
  }
6169
- render(code, options, { renderedParentType } = BLANK) {
6202
+ render(code, options, { preventASI, renderedParentType } = BLANK) {
6170
6203
  if (this.left.included) {
6171
6204
  this.left.render(code, options);
6172
6205
  this.right.render(code, options);
6173
6206
  }
6174
6207
  else {
6208
+ const inclusionStart = findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, '=', this.left.end) + 1);
6209
+ code.remove(this.start, inclusionStart);
6210
+ if (preventASI) {
6211
+ removeLineBreaks(code, inclusionStart, this.right.start);
6212
+ }
6175
6213
  this.right.render(code, options, {
6176
6214
  renderedParentType: renderedParentType || this.parent.type
6177
6215
  });
6178
- const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', this.left.end);
6179
- code.remove(this.start, findNonWhiteSpace(code.original, operatorPos + 1));
6180
6216
  }
6181
6217
  if (options.format === 'system') {
6182
6218
  const exportNames = this.left.variable && options.exportNamesByVariable.get(this.left.variable);
@@ -6193,8 +6229,8 @@ class AssignmentExpression extends NodeBase {
6193
6229
  const systemPatternExports = [];
6194
6230
  this.left.addExportedVariables(systemPatternExports, options.exportNamesByVariable);
6195
6231
  if (systemPatternExports.length > 0) {
6196
- code.prependRight(this.start, getSystemExportFunctionLeft(systemPatternExports, true, options));
6197
- code.appendLeft(this.end, ')');
6232
+ code.prependRight(this.start, `(${getSystemExportFunctionLeft(systemPatternExports, true, options)}`);
6233
+ code.appendLeft(this.end, '))');
6198
6234
  }
6199
6235
  }
6200
6236
  }
@@ -6240,7 +6276,7 @@ class AwaitExpression extends NodeBase {
6240
6276
  checkTopLevelAwait: if (!this.context.usesTopLevelAwait) {
6241
6277
  let parent = this.parent;
6242
6278
  do {
6243
- if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression$1)
6279
+ if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)
6244
6280
  break checkTopLevelAwait;
6245
6281
  } while ((parent = parent.parent));
6246
6282
  this.context.usesTopLevelAwait = true;
@@ -6294,7 +6330,7 @@ class BinaryExpression extends NodeBase {
6294
6330
  hasEffects(context) {
6295
6331
  // support some implicit type coercion runtime errors
6296
6332
  if (this.operator === '+' &&
6297
- this.parent instanceof ExpressionStatement$1 &&
6333
+ this.parent instanceof ExpressionStatement &&
6298
6334
  this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) === '')
6299
6335
  return true;
6300
6336
  return super.hasEffects(context);
@@ -6391,7 +6427,7 @@ function getPathIfNotComputed(memberExpression) {
6391
6427
  const nextPathKey = memberExpression.propertyKey;
6392
6428
  const object = memberExpression.object;
6393
6429
  if (typeof nextPathKey === 'string') {
6394
- if (object instanceof Identifier$1) {
6430
+ if (object instanceof Identifier) {
6395
6431
  return [
6396
6432
  { key: object.name, pos: object.start },
6397
6433
  { key: nextPathKey, pos: memberExpression.property.start }
@@ -6543,8 +6579,8 @@ class MemberExpression extends NodeBase {
6543
6579
  initialise() {
6544
6580
  this.propertyKey = getResolvablePropertyKey(this);
6545
6581
  }
6546
- render(code, options, { renderedParentType, isCalleeOfRenderedParent } = BLANK) {
6547
- const isCalleeOfDifferentParent = renderedParentType === CallExpression && isCalleeOfRenderedParent;
6582
+ render(code, options, { renderedParentType, isCalleeOfRenderedParent, renderedSurroundingElement } = BLANK) {
6583
+ const isCalleeOfDifferentParent = renderedParentType === CallExpression$1 && isCalleeOfRenderedParent;
6548
6584
  if (this.variable || this.replacement) {
6549
6585
  let replacement = this.variable ? this.variable.getName() : this.replacement;
6550
6586
  if (isCalleeOfDifferentParent)
@@ -6558,11 +6594,13 @@ class MemberExpression extends NodeBase {
6558
6594
  if (isCalleeOfDifferentParent) {
6559
6595
  code.appendRight(this.start, '0, ');
6560
6596
  }
6561
- super.render(code, options);
6597
+ const surroundingElement = renderedParentType || renderedSurroundingElement;
6598
+ this.object.render(code, options, surroundingElement ? { renderedSurroundingElement: surroundingElement } : BLANK);
6599
+ this.property.render(code, options);
6562
6600
  }
6563
6601
  }
6564
6602
  disallowNamespaceReassignment() {
6565
- if (this.object instanceof Identifier$1) {
6603
+ if (this.object instanceof Identifier) {
6566
6604
  const variable = this.scope.findVariable(this.object.name);
6567
6605
  if (variable.isNamespace) {
6568
6606
  if (this.variable) {
@@ -6610,7 +6648,7 @@ class MemberExpression extends NodeBase {
6610
6648
  }
6611
6649
  }
6612
6650
 
6613
- class CallExpression$1 extends NodeBase {
6651
+ class CallExpression extends NodeBase {
6614
6652
  constructor() {
6615
6653
  super(...arguments);
6616
6654
  this.expressionsToBeDeoptimized = [];
@@ -6619,7 +6657,7 @@ class CallExpression$1 extends NodeBase {
6619
6657
  }
6620
6658
  bind() {
6621
6659
  super.bind();
6622
- if (this.callee instanceof Identifier$1) {
6660
+ if (this.callee instanceof Identifier) {
6623
6661
  const variable = this.scope.findVariable(this.callee.name);
6624
6662
  if (variable.isNamespace) {
6625
6663
  this.context.warn({
@@ -6750,7 +6788,7 @@ class CallExpression$1 extends NodeBase {
6750
6788
  if (includeChildrenRecursively) {
6751
6789
  super.include(context, includeChildrenRecursively);
6752
6790
  if (includeChildrenRecursively === INCLUDE_PARAMETERS &&
6753
- this.callee instanceof Identifier$1 &&
6791
+ this.callee instanceof Identifier &&
6754
6792
  this.callee.variable) {
6755
6793
  this.callee.variable.markCalledFromTryStatement();
6756
6794
  }
@@ -6770,8 +6808,9 @@ class CallExpression$1 extends NodeBase {
6770
6808
  withNew: false
6771
6809
  };
6772
6810
  }
6773
- render(code, options, { renderedParentType } = BLANK) {
6774
- this.callee.render(code, options);
6811
+ render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
6812
+ const surroundingELement = renderedParentType || renderedSurroundingElement;
6813
+ this.callee.render(code, options, surroundingELement ? { renderedSurroundingElement: surroundingELement } : BLANK);
6775
6814
  if (this.arguments.length > 0) {
6776
6815
  if (this.arguments[this.arguments.length - 1].included) {
6777
6816
  for (const arg of this.arguments) {
@@ -6794,11 +6833,6 @@ class CallExpression$1 extends NodeBase {
6794
6833
  }
6795
6834
  }
6796
6835
  }
6797
- if (renderedParentType === ExpressionStatement &&
6798
- this.callee.type === FunctionExpression) {
6799
- code.appendRight(this.start, '(');
6800
- code.prependLeft(this.end, ')');
6801
- }
6802
6836
  }
6803
6837
  getReturnExpression(recursionTracker) {
6804
6838
  if (this.returnExpression === null) {
@@ -6876,6 +6910,14 @@ class ClassBody extends NodeBase {
6876
6910
  }
6877
6911
 
6878
6912
  class ClassExpression extends ClassNode {
6913
+ render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
6914
+ super.render(code, options);
6915
+ const surroundingElement = renderedParentType || renderedSurroundingElement;
6916
+ if (surroundingElement === ExpressionStatement$1) {
6917
+ code.appendRight(this.start, '(');
6918
+ code.prependLeft(this.end, ')');
6919
+ }
6920
+ }
6879
6921
  }
6880
6922
 
6881
6923
  class MultiExpression {
@@ -7042,9 +7084,9 @@ class ConditionalExpression extends NodeBase {
7042
7084
  render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) {
7043
7085
  if (!this.test.included) {
7044
7086
  const colonPos = findFirstOccurrenceOutsideComment(code.original, ':', this.consequent.end);
7045
- const inclusionStart = (this.consequent.included
7087
+ const inclusionStart = findNonWhiteSpace(code.original, (this.consequent.included
7046
7088
  ? findFirstOccurrenceOutsideComment(code.original, '?', this.test.end)
7047
- : colonPos) + 1;
7089
+ : colonPos) + 1);
7048
7090
  if (preventASI) {
7049
7091
  removeLineBreaks(code, inclusionStart, this.usedBranch.start);
7050
7092
  }
@@ -7159,13 +7201,6 @@ ExportNamedDeclaration.prototype.needsBoundaries = true;
7159
7201
  class ExportSpecifier extends NodeBase {
7160
7202
  }
7161
7203
 
7162
- class FieldDefinition extends NodeBase {
7163
- hasEffects(context) {
7164
- return (this.key.hasEffects(context) ||
7165
- (this.static && this.value !== null && this.value.hasEffects(context)));
7166
- }
7167
- }
7168
-
7169
7204
  class ForInStatement extends NodeBase {
7170
7205
  bind() {
7171
7206
  this.left.bind();
@@ -7288,7 +7323,15 @@ class ForStatement extends NodeBase {
7288
7323
  }
7289
7324
  }
7290
7325
 
7291
- class FunctionExpression$1 extends FunctionNode {
7326
+ class FunctionExpression extends FunctionNode {
7327
+ render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
7328
+ super.render(code, options);
7329
+ const surroundingElement = renderedParentType || renderedSurroundingElement;
7330
+ if (surroundingElement === ExpressionStatement$1) {
7331
+ code.appendRight(this.start, '(');
7332
+ code.prependLeft(this.end, ')');
7333
+ }
7334
+ }
7292
7335
  }
7293
7336
 
7294
7337
  class TrackingScope extends BlockScope {
@@ -7454,7 +7497,7 @@ class IfStatement extends NodeBase {
7454
7497
  .join(', ');
7455
7498
  if (hoistedVars) {
7456
7499
  const parentType = this.parent.type;
7457
- const needsBraces = parentType !== Program && parentType !== BlockStatement;
7500
+ const needsBraces = parentType !== Program$1 && parentType !== BlockStatement$1;
7458
7501
  code.prependRight(this.start, `${needsBraces ? '{ ' : ''}var ${hoistedVars}; `);
7459
7502
  if (needsBraces) {
7460
7503
  code.appendLeft(this.end, ` }`);
@@ -7467,7 +7510,7 @@ class IfStatement extends NodeBase {
7467
7510
  if (currentParent instanceof IfStatement && currentParent.alternate) {
7468
7511
  return true;
7469
7512
  }
7470
- if (currentParent instanceof BlockStatement$1) {
7513
+ if (currentParent instanceof BlockStatement) {
7471
7514
  return false;
7472
7515
  }
7473
7516
  currentParent = currentParent.parent;
@@ -7490,7 +7533,7 @@ class ImportDeclaration extends NodeBase {
7490
7533
  }
7491
7534
  ImportDeclaration.prototype.needsBoundaries = true;
7492
7535
 
7493
- class ImportDefaultSpecifier$1 extends NodeBase {
7536
+ class ImportDefaultSpecifier extends NodeBase {
7494
7537
  }
7495
7538
 
7496
7539
  class ImportExpression extends NodeBase {
@@ -7632,7 +7675,7 @@ const accessedImportGlobals = {
7632
7675
  system: ['module']
7633
7676
  };
7634
7677
 
7635
- class ImportNamespaceSpecifier$1 extends NodeBase {
7678
+ class ImportNamespaceSpecifier extends NodeBase {
7636
7679
  }
7637
7680
 
7638
7681
  class ImportSpecifier extends NodeBase {
@@ -7666,7 +7709,7 @@ class LabeledStatement extends NodeBase {
7666
7709
  this.label.render(code, options);
7667
7710
  }
7668
7711
  else {
7669
- code.remove(this.start, findFirstOccurrenceOutsideComment(code.original, ':', this.label.end) + 1);
7712
+ code.remove(this.start, findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, ':', this.label.end) + 1));
7670
7713
  }
7671
7714
  this.body.render(code, options);
7672
7715
  }
@@ -7778,9 +7821,10 @@ class LogicalExpression extends NodeBase {
7778
7821
  if (!this.left.included || !this.right.included) {
7779
7822
  const operatorPos = findFirstOccurrenceOutsideComment(code.original, this.operator, this.left.end);
7780
7823
  if (this.right.included) {
7781
- code.remove(this.start, operatorPos + 2);
7824
+ const removePos = findNonWhiteSpace(code.original, operatorPos + 2);
7825
+ code.remove(this.start, removePos);
7782
7826
  if (preventASI) {
7783
- removeLineBreaks(code, operatorPos + 2, this.right.start);
7827
+ removeLineBreaks(code, removePos, this.right.start);
7784
7828
  }
7785
7829
  }
7786
7830
  else {
@@ -8180,10 +8224,11 @@ class ObjectExpression extends NodeBase {
8180
8224
  return hasMemberEffectWhenCalled(objectMembers, key, this.included, callOptions, context);
8181
8225
  return false;
8182
8226
  }
8183
- render(code, options, { renderedParentType } = BLANK) {
8227
+ render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
8184
8228
  super.render(code, options);
8185
- if (renderedParentType === ExpressionStatement ||
8186
- renderedParentType === ArrowFunctionExpression) {
8229
+ const surroundingElement = renderedParentType || renderedSurroundingElement;
8230
+ if (surroundingElement === ExpressionStatement$1 ||
8231
+ surroundingElement === ArrowFunctionExpression$1) {
8187
8232
  code.appendRight(this.start, '(');
8188
8233
  code.prependLeft(this.end, ')');
8189
8234
  }
@@ -8226,7 +8271,7 @@ class ObjectExpression extends NodeBase {
8226
8271
  }
8227
8272
  key = String(keyValue);
8228
8273
  }
8229
- else if (property.key instanceof Identifier$1) {
8274
+ else if (property.key instanceof Identifier) {
8230
8275
  key = property.key.name;
8231
8276
  }
8232
8277
  else {
@@ -8258,7 +8303,7 @@ class ObjectExpression extends NodeBase {
8258
8303
  class ObjectPattern extends NodeBase {
8259
8304
  addExportedVariables(variables, exportNamesByVariable) {
8260
8305
  for (const property of this.properties) {
8261
- if (property.type === Property) {
8306
+ if (property.type === Property$1) {
8262
8307
  property.value.addExportedVariables(variables, exportNamesByVariable);
8263
8308
  }
8264
8309
  else {
@@ -8291,10 +8336,10 @@ class ObjectPattern extends NodeBase {
8291
8336
  }
8292
8337
  }
8293
8338
 
8294
- class PrivateName extends NodeBase {
8339
+ class PrivateIdentifier extends NodeBase {
8295
8340
  }
8296
8341
 
8297
- class Program$1 extends NodeBase {
8342
+ class Program extends NodeBase {
8298
8343
  constructor() {
8299
8344
  super(...arguments);
8300
8345
  this.hasCachedEffect = false;
@@ -8328,7 +8373,7 @@ class Program$1 extends NodeBase {
8328
8373
  }
8329
8374
  }
8330
8375
 
8331
- class Property$1 extends NodeBase {
8376
+ class Property extends NodeBase {
8332
8377
  constructor() {
8333
8378
  super(...arguments);
8334
8379
  this.declarationInit = null;
@@ -8435,7 +8480,14 @@ class Property$1 extends NodeBase {
8435
8480
  }
8436
8481
  }
8437
8482
 
8438
- class ReturnStatement$1 extends NodeBase {
8483
+ class PropertyDefinition extends NodeBase {
8484
+ hasEffects(context) {
8485
+ return (this.key.hasEffects(context) ||
8486
+ (this.static && this.value !== null && this.value.hasEffects(context)));
8487
+ }
8488
+ }
8489
+
8490
+ class ReturnStatement extends NodeBase {
8439
8491
  hasEffects(context) {
8440
8492
  if (!context.ignore.returnAwaitYield ||
8441
8493
  (this.argument !== null && this.argument.hasEffects(context)))
@@ -8638,7 +8690,7 @@ class SwitchStatement extends NodeBase {
8638
8690
  class TaggedTemplateExpression extends NodeBase {
8639
8691
  bind() {
8640
8692
  super.bind();
8641
- if (this.tag.type === Identifier) {
8693
+ if (this.tag.type === Identifier$1) {
8642
8694
  const name = this.tag.name;
8643
8695
  const variable = this.scope.findVariable(name);
8644
8696
  if (variable.isNamespace) {
@@ -8843,7 +8895,7 @@ class UnaryExpression extends NodeBase {
8843
8895
  return unaryOperators[this.operator](argumentValue);
8844
8896
  }
8845
8897
  hasEffects(context) {
8846
- if (this.operator === 'typeof' && this.argument instanceof Identifier$1)
8898
+ if (this.operator === 'typeof' && this.argument instanceof Identifier)
8847
8899
  return false;
8848
8900
  return (this.argument.hasEffects(context) ||
8849
8901
  (this.operator === 'delete' &&
@@ -8870,7 +8922,7 @@ class UpdateExpression extends NodeBase {
8870
8922
  bind() {
8871
8923
  super.bind();
8872
8924
  this.argument.deoptimizePath(EMPTY_PATH);
8873
- if (this.argument instanceof Identifier$1) {
8925
+ if (this.argument instanceof Identifier) {
8874
8926
  const variable = this.scope.findVariable(this.argument.name);
8875
8927
  variable.isReassigned = true;
8876
8928
  }
@@ -8899,7 +8951,7 @@ class UpdateExpression extends NodeBase {
8899
8951
  }
8900
8952
  }
8901
8953
  else if (exportNames.length > 1) {
8902
- code.overwrite(this.start, this.end, `${getSystemExportFunctionLeft([variable], false, options)}${this.operator}${name})`);
8954
+ code.overwrite(this.start, this.end, `(${getSystemExportFunctionLeft([variable], false, options)}${this.operator}${name}))`);
8903
8955
  }
8904
8956
  else {
8905
8957
  let op;
@@ -8921,11 +8973,12 @@ class UpdateExpression extends NodeBase {
8921
8973
  function isReassignedExportsMember(variable, exportNamesByVariable) {
8922
8974
  return (variable.renderBaseName !== null && exportNamesByVariable.has(variable) && variable.isReassigned);
8923
8975
  }
8976
+
8924
8977
  function areAllDeclarationsIncludedAndNotExported(declarations, exportNamesByVariable) {
8925
8978
  for (const declarator of declarations) {
8926
8979
  if (!declarator.id.included)
8927
8980
  return false;
8928
- if (declarator.id.type === Identifier) {
8981
+ if (declarator.id.type === Identifier$1) {
8929
8982
  if (exportNamesByVariable.has(declarator.id.variable))
8930
8983
  return false;
8931
8984
  }
@@ -9013,7 +9066,7 @@ class VariableDeclaration extends NodeBase {
9013
9066
  code.appendLeft(renderedContentEnd, ` ${getSystemExportStatement(systemPatternExports, options)};`);
9014
9067
  }
9015
9068
  }
9016
- renderReplacedDeclarations(code, options, { start = this.start, end = this.end, isNoStatement }) {
9069
+ renderReplacedDeclarations(code, options, { isNoStatement }) {
9017
9070
  const separatedNodes = getCommaSeparatedNodesWithBoundaries(this.declarations, code, this.start + this.kind.length, this.end - (code.original.charCodeAt(this.end - 1) === 59 /*";"*/ ? 1 : 0));
9018
9071
  let actualContentEnd, renderedContentEnd;
9019
9072
  renderedContentEnd = findNonWhiteSpace(code.original, this.start + this.kind.length);
@@ -9024,17 +9077,14 @@ class VariableDeclaration extends NodeBase {
9024
9077
  let separatorString = '', leadingString, nextSeparatorString;
9025
9078
  const systemPatternExports = [];
9026
9079
  for (const { node, start, separator, contentEnd, end } of separatedNodes) {
9027
- if (!node.included ||
9028
- (node.id instanceof Identifier$1 &&
9029
- isReassignedExportsMember(node.id.variable, options.exportNamesByVariable) &&
9030
- node.init === null)) {
9080
+ if (!node.included) {
9031
9081
  code.remove(start, end);
9032
9082
  continue;
9033
9083
  }
9034
9084
  leadingString = '';
9035
9085
  nextSeparatorString = '';
9036
9086
  if (!node.id.included ||
9037
- (node.id instanceof Identifier$1 &&
9087
+ (node.id instanceof Identifier &&
9038
9088
  isReassignedExportsMember(node.id.variable, options.exportNamesByVariable))) {
9039
9089
  if (hasRenderedContent) {
9040
9090
  separatorString += ';';
@@ -9043,7 +9093,7 @@ class VariableDeclaration extends NodeBase {
9043
9093
  }
9044
9094
  else {
9045
9095
  if (options.format === 'system' && node.init !== null) {
9046
- if (node.id.type !== Identifier) {
9096
+ if (node.id.type !== Identifier$1) {
9047
9097
  node.id.addExportedVariables(systemPatternExports, options.exportNamesByVariable);
9048
9098
  }
9049
9099
  else {
@@ -9083,12 +9133,7 @@ class VariableDeclaration extends NodeBase {
9083
9133
  lastSeparatorPos = separator;
9084
9134
  separatorString = nextSeparatorString;
9085
9135
  }
9086
- if (hasRenderedContent) {
9087
- this.renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, systemPatternExports, options, isNoStatement);
9088
- }
9089
- else {
9090
- code.remove(start, end);
9091
- }
9136
+ this.renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, systemPatternExports, options, isNoStatement);
9092
9137
  }
9093
9138
  }
9094
9139
 
@@ -9121,7 +9166,12 @@ class VariableDeclarator extends NodeBase {
9121
9166
  code.remove(this.start, findNonWhiteSpace(code.original, operatorPos + 1));
9122
9167
  }
9123
9168
  if (this.init) {
9124
- this.init.render(code, options, renderId ? BLANK : { renderedParentType: ExpressionStatement });
9169
+ this.init.render(code, options, renderId ? BLANK : { renderedParentType: ExpressionStatement$1 });
9170
+ }
9171
+ else if (this.id instanceof Identifier &&
9172
+ isReassignedExportsMember(this.id.variable, options.exportNamesByVariable)) {
9173
+ const _ = options.compact ? '' : ' ';
9174
+ code.appendLeft(this.end, `${_}=${_}void 0`);
9125
9175
  }
9126
9176
  }
9127
9177
  }
@@ -9173,14 +9223,14 @@ class YieldExpression extends NodeBase {
9173
9223
  const nodeConstructors = {
9174
9224
  ArrayExpression,
9175
9225
  ArrayPattern,
9176
- ArrowFunctionExpression: ArrowFunctionExpression$1,
9226
+ ArrowFunctionExpression,
9177
9227
  AssignmentExpression,
9178
9228
  AssignmentPattern,
9179
9229
  AwaitExpression,
9180
9230
  BinaryExpression,
9181
- BlockStatement: BlockStatement$1,
9231
+ BlockStatement,
9182
9232
  BreakStatement,
9183
- CallExpression: CallExpression$1,
9233
+ CallExpression,
9184
9234
  CatchClause,
9185
9235
  ChainExpression,
9186
9236
  ClassBody,
@@ -9194,19 +9244,18 @@ const nodeConstructors = {
9194
9244
  ExportDefaultDeclaration,
9195
9245
  ExportNamedDeclaration,
9196
9246
  ExportSpecifier,
9197
- ExpressionStatement: ExpressionStatement$1,
9198
- FieldDefinition,
9247
+ ExpressionStatement,
9199
9248
  ForInStatement,
9200
9249
  ForOfStatement,
9201
9250
  ForStatement,
9202
9251
  FunctionDeclaration,
9203
- FunctionExpression: FunctionExpression$1,
9204
- Identifier: Identifier$1,
9252
+ FunctionExpression,
9253
+ Identifier,
9205
9254
  IfStatement,
9206
9255
  ImportDeclaration,
9207
- ImportDefaultSpecifier: ImportDefaultSpecifier$1,
9256
+ ImportDefaultSpecifier,
9208
9257
  ImportExpression,
9209
- ImportNamespaceSpecifier: ImportNamespaceSpecifier$1,
9258
+ ImportNamespaceSpecifier,
9210
9259
  ImportSpecifier,
9211
9260
  LabeledStatement,
9212
9261
  Literal,
@@ -9217,11 +9266,12 @@ const nodeConstructors = {
9217
9266
  NewExpression,
9218
9267
  ObjectExpression,
9219
9268
  ObjectPattern,
9220
- PrivateName,
9221
- Program: Program$1,
9222
- Property: Property$1,
9269
+ PrivateIdentifier,
9270
+ Program,
9271
+ Property,
9272
+ PropertyDefinition,
9223
9273
  RestElement,
9224
- ReturnStatement: ReturnStatement$1,
9274
+ ReturnStatement,
9225
9275
  SequenceExpression,
9226
9276
  SpreadElement,
9227
9277
  Super,
@@ -9283,9 +9333,9 @@ function ignore(_node, _st, _c) {}
9283
9333
 
9284
9334
  // Node walkers.
9285
9335
 
9286
- var base$1 = {};
9336
+ var base = {};
9287
9337
 
9288
- base$1.Program = base$1.BlockStatement = function (node, st, c) {
9338
+ base.Program = base.BlockStatement = function (node, st, c) {
9289
9339
  for (var i = 0, list = node.body; i < list.length; i += 1)
9290
9340
  {
9291
9341
  var stmt = list[i];
@@ -9293,22 +9343,22 @@ base$1.Program = base$1.BlockStatement = function (node, st, c) {
9293
9343
  c(stmt, st, "Statement");
9294
9344
  }
9295
9345
  };
9296
- base$1.Statement = skipThrough;
9297
- base$1.EmptyStatement = ignore;
9298
- base$1.ExpressionStatement = base$1.ParenthesizedExpression = base$1.ChainExpression =
9346
+ base.Statement = skipThrough;
9347
+ base.EmptyStatement = ignore;
9348
+ base.ExpressionStatement = base.ParenthesizedExpression = base.ChainExpression =
9299
9349
  function (node, st, c) { return c(node.expression, st, "Expression"); };
9300
- base$1.IfStatement = function (node, st, c) {
9350
+ base.IfStatement = function (node, st, c) {
9301
9351
  c(node.test, st, "Expression");
9302
9352
  c(node.consequent, st, "Statement");
9303
9353
  if (node.alternate) { c(node.alternate, st, "Statement"); }
9304
9354
  };
9305
- base$1.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); };
9306
- base$1.BreakStatement = base$1.ContinueStatement = ignore;
9307
- base$1.WithStatement = function (node, st, c) {
9355
+ base.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); };
9356
+ base.BreakStatement = base.ContinueStatement = ignore;
9357
+ base.WithStatement = function (node, st, c) {
9308
9358
  c(node.object, st, "Expression");
9309
9359
  c(node.body, st, "Statement");
9310
9360
  };
9311
- base$1.SwitchStatement = function (node, st, c) {
9361
+ base.SwitchStatement = function (node, st, c) {
9312
9362
  c(node.discriminant, st, "Expression");
9313
9363
  for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) {
9314
9364
  var cs = list$1[i$1];
@@ -9322,7 +9372,7 @@ base$1.SwitchStatement = function (node, st, c) {
9322
9372
  }
9323
9373
  }
9324
9374
  };
9325
- base$1.SwitchCase = function (node, st, c) {
9375
+ base.SwitchCase = function (node, st, c) {
9326
9376
  if (node.test) { c(node.test, st, "Expression"); }
9327
9377
  for (var i = 0, list = node.consequent; i < list.length; i += 1)
9328
9378
  {
@@ -9331,43 +9381,43 @@ base$1.SwitchCase = function (node, st, c) {
9331
9381
  c(cons, st, "Statement");
9332
9382
  }
9333
9383
  };
9334
- base$1.ReturnStatement = base$1.YieldExpression = base$1.AwaitExpression = function (node, st, c) {
9384
+ base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function (node, st, c) {
9335
9385
  if (node.argument) { c(node.argument, st, "Expression"); }
9336
9386
  };
9337
- base$1.ThrowStatement = base$1.SpreadElement =
9387
+ base.ThrowStatement = base.SpreadElement =
9338
9388
  function (node, st, c) { return c(node.argument, st, "Expression"); };
9339
- base$1.TryStatement = function (node, st, c) {
9389
+ base.TryStatement = function (node, st, c) {
9340
9390
  c(node.block, st, "Statement");
9341
9391
  if (node.handler) { c(node.handler, st); }
9342
9392
  if (node.finalizer) { c(node.finalizer, st, "Statement"); }
9343
9393
  };
9344
- base$1.CatchClause = function (node, st, c) {
9394
+ base.CatchClause = function (node, st, c) {
9345
9395
  if (node.param) { c(node.param, st, "Pattern"); }
9346
9396
  c(node.body, st, "Statement");
9347
9397
  };
9348
- base$1.WhileStatement = base$1.DoWhileStatement = function (node, st, c) {
9398
+ base.WhileStatement = base.DoWhileStatement = function (node, st, c) {
9349
9399
  c(node.test, st, "Expression");
9350
9400
  c(node.body, st, "Statement");
9351
9401
  };
9352
- base$1.ForStatement = function (node, st, c) {
9402
+ base.ForStatement = function (node, st, c) {
9353
9403
  if (node.init) { c(node.init, st, "ForInit"); }
9354
9404
  if (node.test) { c(node.test, st, "Expression"); }
9355
9405
  if (node.update) { c(node.update, st, "Expression"); }
9356
9406
  c(node.body, st, "Statement");
9357
9407
  };
9358
- base$1.ForInStatement = base$1.ForOfStatement = function (node, st, c) {
9408
+ base.ForInStatement = base.ForOfStatement = function (node, st, c) {
9359
9409
  c(node.left, st, "ForInit");
9360
9410
  c(node.right, st, "Expression");
9361
9411
  c(node.body, st, "Statement");
9362
9412
  };
9363
- base$1.ForInit = function (node, st, c) {
9413
+ base.ForInit = function (node, st, c) {
9364
9414
  if (node.type === "VariableDeclaration") { c(node, st); }
9365
9415
  else { c(node, st, "Expression"); }
9366
9416
  };
9367
- base$1.DebuggerStatement = ignore;
9417
+ base.DebuggerStatement = ignore;
9368
9418
 
9369
- base$1.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); };
9370
- base$1.VariableDeclaration = function (node, st, c) {
9419
+ base.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); };
9420
+ base.VariableDeclaration = function (node, st, c) {
9371
9421
  for (var i = 0, list = node.declarations; i < list.length; i += 1)
9372
9422
  {
9373
9423
  var decl = list[i];
@@ -9375,12 +9425,12 @@ base$1.VariableDeclaration = function (node, st, c) {
9375
9425
  c(decl, st);
9376
9426
  }
9377
9427
  };
9378
- base$1.VariableDeclarator = function (node, st, c) {
9428
+ base.VariableDeclarator = function (node, st, c) {
9379
9429
  c(node.id, st, "Pattern");
9380
9430
  if (node.init) { c(node.init, st, "Expression"); }
9381
9431
  };
9382
9432
 
9383
- base$1.Function = function (node, st, c) {
9433
+ base.Function = function (node, st, c) {
9384
9434
  if (node.id) { c(node.id, st, "Pattern"); }
9385
9435
  for (var i = 0, list = node.params; i < list.length; i += 1)
9386
9436
  {
@@ -9391,7 +9441,7 @@ base$1.Function = function (node, st, c) {
9391
9441
  c(node.body, st, node.expression ? "Expression" : "Statement");
9392
9442
  };
9393
9443
 
9394
- base$1.Pattern = function (node, st, c) {
9444
+ base.Pattern = function (node, st, c) {
9395
9445
  if (node.type === "Identifier")
9396
9446
  { c(node, st, "VariablePattern"); }
9397
9447
  else if (node.type === "MemberExpression")
@@ -9399,17 +9449,17 @@ base$1.Pattern = function (node, st, c) {
9399
9449
  else
9400
9450
  { c(node, st); }
9401
9451
  };
9402
- base$1.VariablePattern = ignore;
9403
- base$1.MemberPattern = skipThrough;
9404
- base$1.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); };
9405
- base$1.ArrayPattern = function (node, st, c) {
9452
+ base.VariablePattern = ignore;
9453
+ base.MemberPattern = skipThrough;
9454
+ base.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); };
9455
+ base.ArrayPattern = function (node, st, c) {
9406
9456
  for (var i = 0, list = node.elements; i < list.length; i += 1) {
9407
9457
  var elt = list[i];
9408
9458
 
9409
9459
  if (elt) { c(elt, st, "Pattern"); }
9410
9460
  }
9411
9461
  };
9412
- base$1.ObjectPattern = function (node, st, c) {
9462
+ base.ObjectPattern = function (node, st, c) {
9413
9463
  for (var i = 0, list = node.properties; i < list.length; i += 1) {
9414
9464
  var prop = list[i];
9415
9465
 
@@ -9422,16 +9472,16 @@ base$1.ObjectPattern = function (node, st, c) {
9422
9472
  }
9423
9473
  };
9424
9474
 
9425
- base$1.Expression = skipThrough;
9426
- base$1.ThisExpression = base$1.Super = base$1.MetaProperty = ignore;
9427
- base$1.ArrayExpression = function (node, st, c) {
9475
+ base.Expression = skipThrough;
9476
+ base.ThisExpression = base.Super = base.MetaProperty = ignore;
9477
+ base.ArrayExpression = function (node, st, c) {
9428
9478
  for (var i = 0, list = node.elements; i < list.length; i += 1) {
9429
9479
  var elt = list[i];
9430
9480
 
9431
9481
  if (elt) { c(elt, st, "Expression"); }
9432
9482
  }
9433
9483
  };
9434
- base$1.ObjectExpression = function (node, st, c) {
9484
+ base.ObjectExpression = function (node, st, c) {
9435
9485
  for (var i = 0, list = node.properties; i < list.length; i += 1)
9436
9486
  {
9437
9487
  var prop = list[i];
@@ -9439,8 +9489,8 @@ base$1.ObjectExpression = function (node, st, c) {
9439
9489
  c(prop, st);
9440
9490
  }
9441
9491
  };
9442
- base$1.FunctionExpression = base$1.ArrowFunctionExpression = base$1.FunctionDeclaration;
9443
- base$1.SequenceExpression = function (node, st, c) {
9492
+ base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;
9493
+ base.SequenceExpression = function (node, st, c) {
9444
9494
  for (var i = 0, list = node.expressions; i < list.length; i += 1)
9445
9495
  {
9446
9496
  var expr = list[i];
@@ -9448,7 +9498,7 @@ base$1.SequenceExpression = function (node, st, c) {
9448
9498
  c(expr, st, "Expression");
9449
9499
  }
9450
9500
  };
9451
- base$1.TemplateLiteral = function (node, st, c) {
9501
+ base.TemplateLiteral = function (node, st, c) {
9452
9502
  for (var i = 0, list = node.quasis; i < list.length; i += 1)
9453
9503
  {
9454
9504
  var quasi = list[i];
@@ -9463,24 +9513,24 @@ base$1.TemplateLiteral = function (node, st, c) {
9463
9513
  c(expr, st, "Expression");
9464
9514
  }
9465
9515
  };
9466
- base$1.TemplateElement = ignore;
9467
- base$1.UnaryExpression = base$1.UpdateExpression = function (node, st, c) {
9516
+ base.TemplateElement = ignore;
9517
+ base.UnaryExpression = base.UpdateExpression = function (node, st, c) {
9468
9518
  c(node.argument, st, "Expression");
9469
9519
  };
9470
- base$1.BinaryExpression = base$1.LogicalExpression = function (node, st, c) {
9520
+ base.BinaryExpression = base.LogicalExpression = function (node, st, c) {
9471
9521
  c(node.left, st, "Expression");
9472
9522
  c(node.right, st, "Expression");
9473
9523
  };
9474
- base$1.AssignmentExpression = base$1.AssignmentPattern = function (node, st, c) {
9524
+ base.AssignmentExpression = base.AssignmentPattern = function (node, st, c) {
9475
9525
  c(node.left, st, "Pattern");
9476
9526
  c(node.right, st, "Expression");
9477
9527
  };
9478
- base$1.ConditionalExpression = function (node, st, c) {
9528
+ base.ConditionalExpression = function (node, st, c) {
9479
9529
  c(node.test, st, "Expression");
9480
9530
  c(node.consequent, st, "Expression");
9481
9531
  c(node.alternate, st, "Expression");
9482
9532
  };
9483
- base$1.NewExpression = base$1.CallExpression = function (node, st, c) {
9533
+ base.NewExpression = base.CallExpression = function (node, st, c) {
9484
9534
  c(node.callee, st, "Expression");
9485
9535
  if (node.arguments)
9486
9536
  { for (var i = 0, list = node.arguments; i < list.length; i += 1)
@@ -9490,21 +9540,21 @@ base$1.NewExpression = base$1.CallExpression = function (node, st, c) {
9490
9540
  c(arg, st, "Expression");
9491
9541
  } }
9492
9542
  };
9493
- base$1.MemberExpression = function (node, st, c) {
9543
+ base.MemberExpression = function (node, st, c) {
9494
9544
  c(node.object, st, "Expression");
9495
9545
  if (node.computed) { c(node.property, st, "Expression"); }
9496
9546
  };
9497
- base$1.ExportNamedDeclaration = base$1.ExportDefaultDeclaration = function (node, st, c) {
9547
+ base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) {
9498
9548
  if (node.declaration)
9499
9549
  { c(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); }
9500
9550
  if (node.source) { c(node.source, st, "Expression"); }
9501
9551
  };
9502
- base$1.ExportAllDeclaration = function (node, st, c) {
9552
+ base.ExportAllDeclaration = function (node, st, c) {
9503
9553
  if (node.exported)
9504
9554
  { c(node.exported, st); }
9505
9555
  c(node.source, st, "Expression");
9506
9556
  };
9507
- base$1.ImportDeclaration = function (node, st, c) {
9557
+ base.ImportDeclaration = function (node, st, c) {
9508
9558
  for (var i = 0, list = node.specifiers; i < list.length; i += 1)
9509
9559
  {
9510
9560
  var spec = list[i];
@@ -9513,22 +9563,22 @@ base$1.ImportDeclaration = function (node, st, c) {
9513
9563
  }
9514
9564
  c(node.source, st, "Expression");
9515
9565
  };
9516
- base$1.ImportExpression = function (node, st, c) {
9566
+ base.ImportExpression = function (node, st, c) {
9517
9567
  c(node.source, st, "Expression");
9518
9568
  };
9519
- base$1.ImportSpecifier = base$1.ImportDefaultSpecifier = base$1.ImportNamespaceSpecifier = base$1.Identifier = base$1.Literal = ignore;
9569
+ base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.Literal = ignore;
9520
9570
 
9521
- base$1.TaggedTemplateExpression = function (node, st, c) {
9571
+ base.TaggedTemplateExpression = function (node, st, c) {
9522
9572
  c(node.tag, st, "Expression");
9523
9573
  c(node.quasi, st, "Expression");
9524
9574
  };
9525
- base$1.ClassDeclaration = base$1.ClassExpression = function (node, st, c) { return c(node, st, "Class"); };
9526
- base$1.Class = function (node, st, c) {
9575
+ base.ClassDeclaration = base.ClassExpression = function (node, st, c) { return c(node, st, "Class"); };
9576
+ base.Class = function (node, st, c) {
9527
9577
  if (node.id) { c(node.id, st, "Pattern"); }
9528
9578
  if (node.superClass) { c(node.superClass, st, "Expression"); }
9529
9579
  c(node.body, st);
9530
9580
  };
9531
- base$1.ClassBody = function (node, st, c) {
9581
+ base.ClassBody = function (node, st, c) {
9532
9582
  for (var i = 0, list = node.body; i < list.length; i += 1)
9533
9583
  {
9534
9584
  var elt = list[i];
@@ -9536,14 +9586,13 @@ base$1.ClassBody = function (node, st, c) {
9536
9586
  c(elt, st);
9537
9587
  }
9538
9588
  };
9539
- base$1.MethodDefinition = base$1.Property = function (node, st, c) {
9589
+ base.MethodDefinition = base.Property = function (node, st, c) {
9540
9590
  if (node.computed) { c(node.key, st, "Expression"); }
9541
9591
  c(node.value, st, "Expression");
9542
9592
  };
9543
9593
 
9544
- // @ts-ignore
9545
9594
  // patch up acorn-walk until class-fields are officially supported
9546
- base$1.FieldDefinition = function (node, st, c) {
9595
+ base.PropertyDefinition = function (node, st, c) {
9547
9596
  if (node.computed) {
9548
9597
  c(node.key, st, 'Expression');
9549
9598
  }
@@ -9558,7 +9607,7 @@ function handlePureAnnotationsOfNode(node, state, type = node.type) {
9558
9607
  commentNode = state.commentNodes[++state.commentIndex];
9559
9608
  }
9560
9609
  if (commentNode && commentNode.end <= node.end) {
9561
- base$1[type](node, state, handlePureAnnotationsOfNode);
9610
+ base[type](node, state, handlePureAnnotationsOfNode);
9562
9611
  }
9563
9612
  }
9564
9613
  function markPureNode(node, comment) {
@@ -9568,10 +9617,10 @@ function markPureNode(node, comment) {
9568
9617
  else {
9569
9618
  node.annotations = [comment];
9570
9619
  }
9571
- if (node.type === 'ExpressionStatement') {
9620
+ if (node.type === ExpressionStatement$1) {
9572
9621
  node = node.expression;
9573
9622
  }
9574
- if (node.type === 'CallExpression' || node.type === 'NewExpression') {
9623
+ if (node.type === CallExpression$1 || node.type === NewExpression$1) {
9575
9624
  node.annotatedPure = true;
9576
9625
  }
9577
9626
  }
@@ -10230,7 +10279,7 @@ class Module {
10230
10279
  };
10231
10280
  this.scope = new ModuleScope(this.graph.scope, this.astContext);
10232
10281
  this.namespace = new NamespaceVariable(this.astContext, this.info.syntheticNamedExports);
10233
- this.ast = new Program$1(ast, { type: 'Module', context: this.astContext }, this.scope);
10282
+ this.ast = new Program(ast, { type: 'Module', context: this.astContext }, this.scope);
10234
10283
  this.info.ast = ast;
10235
10284
  timeEnd('analyse ast', 3);
10236
10285
  }
@@ -10369,8 +10418,8 @@ class Module {
10369
10418
  const source = node.source.value;
10370
10419
  this.sources.add(source);
10371
10420
  for (const specifier of node.specifiers) {
10372
- const isDefault = specifier.type === ImportDefaultSpecifier;
10373
- const isNamespace = specifier.type === ImportNamespaceSpecifier;
10421
+ const isDefault = specifier.type === ImportDefaultSpecifier$1;
10422
+ const isNamespace = specifier.type === ImportNamespaceSpecifier$1;
10374
10423
  const name = isDefault
10375
10424
  ? 'default'
10376
10425
  : isNamespace
@@ -10691,12 +10740,13 @@ const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = {
10691
10740
  umd: deconflictImportsOther
10692
10741
  };
10693
10742
  function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) {
10694
- for (const module of modules) {
10743
+ const reversedModules = modules.slice().reverse();
10744
+ for (const module of reversedModules) {
10695
10745
  module.scope.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope);
10696
10746
  }
10697
- deconflictTopLevelVariables(usedNames, modules, includedNamespaces);
10747
+ deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces);
10698
10748
  DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports);
10699
- for (const module of modules) {
10749
+ for (const module of reversedModules) {
10700
10750
  module.scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);
10701
10751
  }
10702
10752
  }
@@ -11021,7 +11071,7 @@ function getGlobalName(module, globals, hasExports, warn) {
11021
11071
  return module.variableName;
11022
11072
  }
11023
11073
  }
11024
- class Chunk$1 {
11074
+ class Chunk {
11025
11075
  constructor(orderedModules, inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, manualChunkAlias) {
11026
11076
  this.orderedModules = orderedModules;
11027
11077
  this.inputOptions = inputOptions;
@@ -11092,7 +11142,7 @@ class Chunk$1 {
11092
11142
  this.suggestedVariableName = makeLegal(this.generateVariableName());
11093
11143
  }
11094
11144
  static generateFacade(inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, facadedModule, facadeName) {
11095
- const chunk = new Chunk$1([], inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, null);
11145
+ const chunk = new Chunk([], inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, null);
11096
11146
  chunk.assignFacadeName(facadeName, facadedModule);
11097
11147
  if (!facadeChunkByModule.has(facadedModule)) {
11098
11148
  facadeChunkByModule.set(facadedModule, chunk);
@@ -11197,7 +11247,7 @@ class Chunk$1 {
11197
11247
  }
11198
11248
  }
11199
11249
  for (const facadeName of requiredFacades) {
11200
- facades.push(Chunk$1.generateFacade(this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.modulesById, this.chunkByModule, this.facadeChunkByModule, this.includedNamespaces, module, facadeName));
11250
+ facades.push(Chunk.generateFacade(this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.modulesById, this.chunkByModule, this.facadeChunkByModule, this.includedNamespaces, module, facadeName));
11201
11251
  }
11202
11252
  }
11203
11253
  for (const module of this.dynamicEntryModules) {
@@ -11338,7 +11388,7 @@ class Chunk$1 {
11338
11388
  }
11339
11389
  // prerender allows chunk hashes and names to be generated before finalizing
11340
11390
  preRender(options, inputBase) {
11341
- const magicString = new Bundle({ separator: options.compact ? '' : '\n\n' });
11391
+ const magicString = new Bundle$1({ separator: options.compact ? '' : '\n\n' });
11342
11392
  this.usedModules = [];
11343
11393
  this.indentString = getIndentString(this.orderedModules, options);
11344
11394
  const n = options.compact ? '' : '\n';
@@ -11359,7 +11409,7 @@ class Chunk$1 {
11359
11409
  !this.outputOptions.preserveModules &&
11360
11410
  this.facadeModule !== null) {
11361
11411
  for (const dep of this.dependencies) {
11362
- if (dep instanceof Chunk$1)
11412
+ if (dep instanceof Chunk)
11363
11413
  this.inlineChunkDependencies(dep);
11364
11414
  }
11365
11415
  }
@@ -11671,7 +11721,7 @@ class Chunk$1 {
11671
11721
  getGlobalName(dep, options.globals, (imports || reexports) !== null, this.inputOptions.onwarn)),
11672
11722
  id: undefined,
11673
11723
  imports,
11674
- isChunk: dep instanceof Chunk$1,
11724
+ isChunk: dep instanceof Chunk,
11675
11725
  name: dep.variableName,
11676
11726
  namedExportsMode,
11677
11727
  namespaceVariableName: dep.namespaceVariableName,
@@ -11893,7 +11943,7 @@ class Chunk$1 {
11893
11943
  if (this.dependencies.has(dep))
11894
11944
  continue;
11895
11945
  this.dependencies.add(dep);
11896
- if (dep instanceof Chunk$1) {
11946
+ if (dep instanceof Chunk) {
11897
11947
  this.inlineChunkDependencies(dep);
11898
11948
  }
11899
11949
  }
@@ -11930,7 +11980,7 @@ class Chunk$1 {
11930
11980
  }
11931
11981
  }
11932
11982
  }
11933
- setIdentifierRenderResolutions({ format, interop }) {
11983
+ setIdentifierRenderResolutions({ format, interop, namespaceToStringTag }) {
11934
11984
  const syntheticExports = new Set();
11935
11985
  for (const exportName of this.getExportNames()) {
11936
11986
  const exportVariable = this.exportsByName[exportName];
@@ -11950,10 +12000,13 @@ class Chunk$1 {
11950
12000
  exportVariable.setRenderNames(null, null);
11951
12001
  }
11952
12002
  }
11953
- const usedNames = new Set();
12003
+ const usedNames = new Set(['Object', 'Promise']);
11954
12004
  if (this.needsExportsShim) {
11955
12005
  usedNames.add(MISSING_EXPORT_SHIM_VARIABLE);
11956
12006
  }
12007
+ if (namespaceToStringTag) {
12008
+ usedNames.add('Symbol');
12009
+ }
11957
12010
  switch (format) {
11958
12011
  case 'system':
11959
12012
  usedNames.add('module').add('exports');
@@ -12510,7 +12563,7 @@ function areSourcesEqual(sourceA, sourceB) {
12510
12563
  return true;
12511
12564
  }
12512
12565
 
12513
- class Bundle$1 {
12566
+ class Bundle {
12514
12567
  constructor(outputOptions, unsetOptions, inputOptions, pluginDriver, graph) {
12515
12568
  this.outputOptions = outputOptions;
12516
12569
  this.unsetOptions = unsetOptions;
@@ -12623,6 +12676,17 @@ class Bundle$1 {
12623
12676
  warnDeprecation('A plugin is directly adding properties to the bundle object in the "generateBundle" hook. This is deprecated and will be removed in a future Rollup version, please use "this.emitFile" instead.', true, this.inputOptions);
12624
12677
  file.type = 'asset';
12625
12678
  }
12679
+ if (this.outputOptions.validate && typeof file.code == 'string') {
12680
+ try {
12681
+ this.graph.contextParse(file.code, {
12682
+ allowHashBang: true,
12683
+ ecmaVersion: 'latest'
12684
+ });
12685
+ }
12686
+ catch (exception) {
12687
+ this.inputOptions.onwarn(errChunkInvalid(file, exception));
12688
+ }
12689
+ }
12626
12690
  }
12627
12691
  this.pluginDriver.finaliseAssets();
12628
12692
  }
@@ -12642,7 +12706,7 @@ class Bundle$1 {
12642
12706
  }))
12643
12707
  : getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry)) {
12644
12708
  sortByExecutionOrder(modules);
12645
- const chunk = new Chunk$1(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias);
12709
+ const chunk = new Chunk(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias);
12646
12710
  chunks.push(chunk);
12647
12711
  for (const module of modules) {
12648
12712
  chunkByModule.set(module, chunk);
@@ -12714,7 +12778,7 @@ function addModuleToManualChunk(alias, module, manualChunkAliasByEntry) {
12714
12778
 
12715
12779
  // Reserved word lists for various dialects of the language
12716
12780
 
12717
- var reservedWords$1 = {
12781
+ var reservedWords = {
12718
12782
  3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
12719
12783
  5: "class enum extends super const export import",
12720
12784
  6: "enum",
@@ -12969,7 +13033,7 @@ var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
12969
13033
 
12970
13034
  var ref = Object.prototype;
12971
13035
  var hasOwnProperty = ref.hasOwnProperty;
12972
- var toString$1 = ref.toString;
13036
+ var toString = ref.toString;
12973
13037
 
12974
13038
  // Checks if an object has a property.
12975
13039
 
@@ -12978,7 +13042,7 @@ function has(obj, propName) {
12978
13042
  }
12979
13043
 
12980
13044
  var isArray = Array.isArray || (function (obj) { return (
12981
- toString$1.call(obj) === "[object Array]"
13045
+ toString.call(obj) === "[object Array]"
12982
13046
  ); });
12983
13047
 
12984
13048
  function wordsRegexp(words) {
@@ -13192,13 +13256,13 @@ var Parser = function Parser(options, input, startPos) {
13192
13256
  this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
13193
13257
  var reserved = "";
13194
13258
  if (options.allowReserved !== true) {
13195
- reserved = reservedWords$1[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];
13259
+ reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];
13196
13260
  if (options.sourceType === "module") { reserved += " await"; }
13197
13261
  }
13198
13262
  this.reservedWords = wordsRegexp(reserved);
13199
- var reservedStrict = (reserved ? reserved + " " : "") + reservedWords$1.strict;
13263
+ var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict;
13200
13264
  this.reservedWordsStrict = wordsRegexp(reservedStrict);
13201
- this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords$1.strictBind);
13265
+ this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
13202
13266
  this.input = String(input);
13203
13267
 
13204
13268
  // Used to signal to callers of `readWord1` whether the word
@@ -13251,7 +13315,7 @@ var Parser = function Parser(options, input, startPos) {
13251
13315
  // Labels in scope.
13252
13316
  this.labels = [];
13253
13317
  // Thus-far undefined exports.
13254
- this.undefinedExports = {};
13318
+ this.undefinedExports = Object.create(null);
13255
13319
 
13256
13320
  // If enabled, skip leading hashbang line.
13257
13321
  if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!")
@@ -13465,7 +13529,7 @@ var pp$1 = Parser.prototype;
13465
13529
  // to its body instead of creating a new node.
13466
13530
 
13467
13531
  pp$1.parseTopLevel = function(node) {
13468
- var exports = {};
13532
+ var exports = Object.create(null);
13469
13533
  if (!node.body) { node.body = []; }
13470
13534
  while (this.type !== types.eof) {
13471
13535
  var stmt = this.parseStatement(null, true, exports);
@@ -15591,7 +15655,7 @@ pp$3.isSimpleParamList = function(params) {
15591
15655
  // or "arguments" and duplicate parameters.
15592
15656
 
15593
15657
  pp$3.checkParams = function(node, allowDuplicates) {
15594
- var nameHash = {};
15658
+ var nameHash = Object.create(null);
15595
15659
  for (var i = 0, list = node.params; i < list.length; i += 1)
15596
15660
  {
15597
15661
  var param = list[i];
@@ -15734,7 +15798,7 @@ pp$4.curPosition = function() {
15734
15798
 
15735
15799
  var pp$5 = Parser.prototype;
15736
15800
 
15737
- var Scope$1 = function Scope(flags) {
15801
+ var Scope = function Scope(flags) {
15738
15802
  this.flags = flags;
15739
15803
  // A list of var-declared names in the current lexical scope
15740
15804
  this.var = [];
@@ -15747,7 +15811,7 @@ var Scope$1 = function Scope(flags) {
15747
15811
  // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.
15748
15812
 
15749
15813
  pp$5.enterScope = function(flags) {
15750
- this.scopeStack.push(new Scope$1(flags));
15814
+ this.scopeStack.push(new Scope(flags));
15751
15815
  };
15752
15816
 
15753
15817
  pp$5.exitScope = function() {
@@ -17921,11 +17985,11 @@ pp$9.readWord = function() {
17921
17985
 
17922
17986
  // Acorn is a tiny, fast JavaScript parser written in JavaScript.
17923
17987
 
17924
- var version$1 = "8.0.4";
17988
+ var version = "8.0.5";
17925
17989
 
17926
17990
  Parser.acorn = {
17927
17991
  Parser: Parser,
17928
- version: version$1,
17992
+ version: version,
17929
17993
  defaultOptions: defaultOptions,
17930
17994
  Position: Position,
17931
17995
  SourceLocation: SourceLocation,
@@ -17994,10 +18058,10 @@ var acorn = {
17994
18058
  tokContexts: types$1,
17995
18059
  tokTypes: types,
17996
18060
  tokenizer: tokenizer,
17997
- version: version$1
18061
+ version: version
17998
18062
  };
17999
18063
 
18000
- class GlobalScope extends Scope {
18064
+ class GlobalScope extends Scope$1 {
18001
18065
  constructor() {
18002
18066
  super();
18003
18067
  this.variables.set('undefined', new UndefinedVariable());
@@ -18719,7 +18783,7 @@ function getPluginContexts(pluginCache, graph, options, fileEmitter) {
18719
18783
  getWatchFiles: () => Object.keys(graph.watchFiles),
18720
18784
  isExternal: getDeprecatedContextHandler((id, parentId, isResolved = false) => options.external(id, parentId, isResolved), 'isExternal', 'resolve', plugin.name, true, options),
18721
18785
  meta: {
18722
- rollupVersion: version,
18786
+ rollupVersion: version$1,
18723
18787
  watchMode: graph.watchMode
18724
18788
  },
18725
18789
  get moduleIds() {
@@ -19165,19 +19229,14 @@ function getAugmentedNamespace(n) {
19165
19229
  return a;
19166
19230
  }
19167
19231
 
19168
- function createCommonjsModule(fn) {
19169
- var module = { exports: {} };
19170
- return fn(module, module.exports), module.exports;
19171
- }
19172
-
19173
- var require$$0 = /*@__PURE__*/getAugmentedNamespace(acorn);
19232
+ var require$$1 = /*@__PURE__*/getAugmentedNamespace(acorn);
19174
19233
 
19175
19234
  const getPrototype = Object.getPrototypeOf || (o => o.__proto__);
19176
19235
 
19177
- const getAcorn = Parser => {
19236
+ const getAcorn$1 = Parser => {
19178
19237
  if (Parser.acorn) return Parser.acorn
19179
19238
 
19180
- const acorn = require$$0;
19239
+ const acorn = require$$1;
19181
19240
 
19182
19241
  if (acorn.version.indexOf("6.") != 0 && acorn.version.indexOf("6.0.") == 0 && acorn.version.indexOf("7.") != 0) {
19183
19242
  throw new Error(`acorn-private-class-elements requires acorn@^6.1.0 or acorn@7.0.0, not ${acorn.version}`)
@@ -19199,7 +19258,7 @@ var acornPrivateClassElements = function(Parser) {
19199
19258
  return Parser
19200
19259
  }
19201
19260
 
19202
- const acorn = getAcorn(Parser);
19261
+ const acorn = getAcorn$1(Parser);
19203
19262
 
19204
19263
  Parser = class extends Parser {
19205
19264
  _branch() {
@@ -19230,7 +19289,7 @@ var acornPrivateClassElements = function(Parser) {
19230
19289
  const node = this.startNode();
19231
19290
  node.name = this.value;
19232
19291
  this.next();
19233
- this.finishNode(node, "PrivateName");
19292
+ this.finishNode(node, "PrivateIdentifier");
19234
19293
  if (this.options.allowReserved == "never") this.checkUnreserved(node);
19235
19294
  return node
19236
19295
  }
@@ -19240,7 +19299,7 @@ var acornPrivateClassElements = function(Parser) {
19240
19299
  if (code === 35) {
19241
19300
  ++this.pos;
19242
19301
  const word = this.readWord1();
19243
- return this.finishToken(this.privateNameToken, word)
19302
+ return this.finishToken(this.privateIdentifierToken, word)
19244
19303
  }
19245
19304
  return super.getTokenFromCode(code)
19246
19305
  }
@@ -19289,7 +19348,7 @@ var acornPrivateClassElements = function(Parser) {
19289
19348
  const branch = this._branch();
19290
19349
  if (!(
19291
19350
  (branch.eat(acorn.tokTypes.dot) || (optionalSupported && branch.eat(acorn.tokTypes.questionDot))) &&
19292
- branch.type == this.privateNameToken
19351
+ branch.type == this.privateIdentifierToken
19293
19352
  )) {
19294
19353
  return super.parseSubscript.apply(this, arguments)
19295
19354
  }
@@ -19304,7 +19363,7 @@ var acornPrivateClassElements = function(Parser) {
19304
19363
  if (optionalSupported) {
19305
19364
  node.optional = optional;
19306
19365
  }
19307
- if (this.type == this.privateNameToken) {
19366
+ if (this.type == this.privateIdentifierToken) {
19308
19367
  if (base.type == "Super") {
19309
19368
  this.raise(this.start, "Cannot access private element on super");
19310
19369
  }
@@ -19325,22 +19384,24 @@ var acornPrivateClassElements = function(Parser) {
19325
19384
  parseMaybeUnary(refDestructuringErrors, sawUnary) {
19326
19385
  const _return = super.parseMaybeUnary(refDestructuringErrors, sawUnary);
19327
19386
  if (_return.operator == "delete") {
19328
- if (_return.argument.type == "MemberExpression" && _return.argument.property.type == "PrivateName") {
19387
+ if (_return.argument.type == "MemberExpression" && _return.argument.property.type == "PrivateIdentifier") {
19329
19388
  this.raise(_return.start, "Private elements may not be deleted");
19330
19389
  }
19331
19390
  }
19332
19391
  return _return
19333
19392
  }
19334
19393
  };
19335
- Parser.prototype.privateNameToken = new acorn.TokenType("privateName");
19394
+ Parser.prototype.privateIdentifierToken = new acorn.TokenType("privateIdentifier");
19336
19395
  return Parser
19337
19396
  };
19338
19397
 
19398
+ const privateClassElements$1 = acornPrivateClassElements;
19399
+
19339
19400
  var acornClassFields = function(Parser) {
19340
- const acorn = Parser.acorn || require$$0;
19401
+ const acorn = Parser.acorn || require$$1;
19341
19402
  const tt = acorn.tokTypes;
19342
19403
 
19343
- Parser = acornPrivateClassElements(Parser);
19404
+ Parser = privateClassElements$1(Parser);
19344
19405
  return class extends Parser {
19345
19406
  _maybeParseFieldValue(field) {
19346
19407
  if (this.eat(tt.eq)) {
@@ -19355,7 +19416,7 @@ var acornClassFields = function(Parser) {
19355
19416
 
19356
19417
  // Parse fields
19357
19418
  parseClassElement(_constructorAllowsSuper) {
19358
- if (this.options.ecmaVersion >= 8 && (this.type == tt.name || this.type.keyword || this.type == this.privateNameToken || this.type == tt.bracketL || this.type == tt.string || this.type == tt.num)) {
19419
+ if (this.options.ecmaVersion >= 8 && (this.type == tt.name || this.type.keyword || this.type == this.privateIdentifierToken || this.type == tt.bracketL || this.type == tt.string || this.type == tt.num)) {
19359
19420
  const branch = this._branch();
19360
19421
  if (branch.type == tt.bracketL) {
19361
19422
  let count = 0;
@@ -19371,7 +19432,7 @@ var acornClassFields = function(Parser) {
19371
19432
  }
19372
19433
  if (isField) {
19373
19434
  const node = this.startNode();
19374
- if (this.type == this.privateNameToken) {
19435
+ if (this.type == this.privateIdentifierToken) {
19375
19436
  this.parsePrivateClassElementName(node);
19376
19437
  } else {
19377
19438
  this.parsePropertyName(node);
@@ -19383,7 +19444,7 @@ var acornClassFields = function(Parser) {
19383
19444
  this.enterScope(64 | 2 | 1); // See acorn's scopeflags.js
19384
19445
  this._maybeParseFieldValue(node);
19385
19446
  this.exitScope();
19386
- this.finishNode(node, "FieldDefinition");
19447
+ this.finishNode(node, "PropertyDefinition");
19387
19448
  this.semicolon();
19388
19449
  return node
19389
19450
  }
@@ -19401,10 +19462,12 @@ var acornClassFields = function(Parser) {
19401
19462
  }
19402
19463
  };
19403
19464
 
19465
+ const privateClassElements = acornPrivateClassElements;
19466
+
19404
19467
  var acornStaticClassFeatures = function(Parser) {
19405
- const ExtendedParser = acornPrivateClassElements(Parser);
19468
+ const ExtendedParser = privateClassElements(Parser);
19406
19469
 
19407
- const acorn = Parser.acorn || require$$0;
19470
+ const acorn = Parser.acorn || require$$1;
19408
19471
  const tt = acorn.tokTypes;
19409
19472
 
19410
19473
  return class extends ExtendedParser {
@@ -19425,7 +19488,7 @@ var acornStaticClassFeatures = function(Parser) {
19425
19488
 
19426
19489
  const branch = this._branch();
19427
19490
  branch.next();
19428
- if ([tt.name, tt.bracketL, tt.string, tt.num, this.privateNameToken].indexOf(branch.type) == -1 && !branch.type.keyword) {
19491
+ if ([tt.name, tt.bracketL, tt.string, tt.num, this.privateIdentifierToken].indexOf(branch.type) == -1 && !branch.type.keyword) {
19429
19492
  return super.parseClassElement.apply(this, arguments)
19430
19493
  }
19431
19494
  if (branch.type == tt.bracketL) {
@@ -19442,7 +19505,7 @@ var acornStaticClassFeatures = function(Parser) {
19442
19505
 
19443
19506
  const node = this.startNode();
19444
19507
  node.static = this.eatContextual("static");
19445
- if (this.type == this.privateNameToken) {
19508
+ if (this.type == this.privateIdentifierToken) {
19446
19509
  this.parsePrivateClassElementName(node);
19447
19510
  } else {
19448
19511
  this.parsePropertyName(node);
@@ -19458,14 +19521,14 @@ var acornStaticClassFeatures = function(Parser) {
19458
19521
  this.enterScope(64 | 2 | 1); // See acorn's scopeflags.js
19459
19522
  this._maybeParseFieldValue(node);
19460
19523
  this.exitScope();
19461
- this.finishNode(node, "FieldDefinition");
19524
+ this.finishNode(node, "PropertyDefinition");
19462
19525
  this.semicolon();
19463
19526
  return node
19464
19527
  }
19465
19528
 
19466
19529
  // Parse private static methods
19467
19530
  parsePropertyName(prop) {
19468
- if (prop.static && this.type == this.privateNameToken) {
19531
+ if (prop.static && this.type == this.privateIdentifierToken) {
19469
19532
  this.parsePrivateClassElementName(prop);
19470
19533
  } else {
19471
19534
  super.parsePropertyName(prop);
@@ -19508,21 +19571,21 @@ function normalizeInputOptions(config) {
19508
19571
  const onwarn = getOnwarn(config);
19509
19572
  const strictDeprecations = config.strictDeprecations || false;
19510
19573
  const options = {
19511
- acorn: getAcorn$1(config),
19574
+ acorn: getAcorn(config),
19512
19575
  acornInjectPlugins: getAcornInjectPlugins(config),
19513
19576
  cache: getCache(config),
19514
19577
  context,
19515
19578
  experimentalCacheExpiry: (_b = config.experimentalCacheExpiry) !== null && _b !== void 0 ? _b : 10,
19516
19579
  external: getIdMatcher(config.external),
19517
- inlineDynamicImports: getInlineDynamicImports(config, onwarn, strictDeprecations),
19580
+ inlineDynamicImports: getInlineDynamicImports$1(config, onwarn, strictDeprecations),
19518
19581
  input: getInput(config),
19519
- manualChunks: getManualChunks(config, onwarn, strictDeprecations),
19582
+ manualChunks: getManualChunks$1(config, onwarn, strictDeprecations),
19520
19583
  moduleContext: getModuleContext(config, context),
19521
19584
  onwarn,
19522
19585
  perf: config.perf || false,
19523
19586
  plugins: ensureArray(config.plugins),
19524
19587
  preserveEntrySignatures: getPreserveEntrySignatures(config, unsetOptions),
19525
- preserveModules: getPreserveModules(config, onwarn, strictDeprecations),
19588
+ preserveModules: getPreserveModules$1(config, onwarn, strictDeprecations),
19526
19589
  preserveSymlinks: config.preserveSymlinks || false,
19527
19590
  shimMissingExports: config.shimMissingExports || false,
19528
19591
  strictDeprecations,
@@ -19547,7 +19610,7 @@ const getOnwarn = (config) => {
19547
19610
  }
19548
19611
  : defaultOnWarn;
19549
19612
  };
19550
- const getAcorn$1 = (config) => ({
19613
+ const getAcorn = (config) => ({
19551
19614
  allowAwaitOutsideFunction: true,
19552
19615
  ecmaVersion: 'latest',
19553
19616
  preserveParens: false,
@@ -19585,7 +19648,7 @@ const getIdMatcher = (option) => {
19585
19648
  }
19586
19649
  return () => false;
19587
19650
  };
19588
- const getInlineDynamicImports = (config, warn, strictDeprecations) => {
19651
+ const getInlineDynamicImports$1 = (config, warn, strictDeprecations) => {
19589
19652
  const configInlineDynamicImports = config.inlineDynamicImports;
19590
19653
  if (configInlineDynamicImports) {
19591
19654
  warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', false, warn, strictDeprecations);
@@ -19596,7 +19659,7 @@ const getInput = (config) => {
19596
19659
  const configInput = config.input;
19597
19660
  return configInput == null ? [] : typeof configInput === 'string' ? [configInput] : configInput;
19598
19661
  };
19599
- const getManualChunks = (config, warn, strictDeprecations) => {
19662
+ const getManualChunks$1 = (config, warn, strictDeprecations) => {
19600
19663
  const configManualChunks = config.manualChunks;
19601
19664
  if (configManualChunks) {
19602
19665
  warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', false, warn, strictDeprecations);
@@ -19624,7 +19687,7 @@ const getPreserveEntrySignatures = (config, unsetOptions) => {
19624
19687
  }
19625
19688
  return configPreserveEntrySignatures !== null && configPreserveEntrySignatures !== void 0 ? configPreserveEntrySignatures : 'strict';
19626
19689
  };
19627
- const getPreserveModules = (config, warn, strictDeprecations) => {
19690
+ const getPreserveModules$1 = (config, warn, strictDeprecations) => {
19628
19691
  const configPreserveModules = config.preserveModules;
19629
19692
  if (configPreserveModules) {
19630
19693
  warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', false, warn, strictDeprecations);
@@ -19684,8 +19747,8 @@ function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
19684
19747
  const unsetOptions = new Set(unsetInputOptions);
19685
19748
  const compact = config.compact || false;
19686
19749
  const format = getFormat(config);
19687
- const inlineDynamicImports = getInlineDynamicImports$1(config, inputOptions);
19688
- const preserveModules = getPreserveModules$1(config, inlineDynamicImports, inputOptions);
19750
+ const inlineDynamicImports = getInlineDynamicImports(config, inputOptions);
19751
+ const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions);
19689
19752
  const file = getFile(config, preserveModules, inputOptions);
19690
19753
  const outputOptions = {
19691
19754
  amd: getAmd(config),
@@ -19710,7 +19773,7 @@ function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
19710
19773
  inlineDynamicImports,
19711
19774
  interop: getInterop(config, inputOptions),
19712
19775
  intro: getAddon(config, 'intro'),
19713
- manualChunks: getManualChunks$1(config, inlineDynamicImports, preserveModules, inputOptions),
19776
+ manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules, inputOptions),
19714
19777
  minifyInternalExports: getMinifyInternalExports(config, format, compact),
19715
19778
  name: config.name,
19716
19779
  namespaceToStringTag: config.namespaceToStringTag || false,
@@ -19726,7 +19789,8 @@ function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
19726
19789
  sourcemapFile: config.sourcemapFile,
19727
19790
  sourcemapPathTransform: config.sourcemapPathTransform,
19728
19791
  strict: (_g = config.strict) !== null && _g !== void 0 ? _g : true,
19729
- systemNullSetters: config.systemNullSetters || false
19792
+ systemNullSetters: config.systemNullSetters || false,
19793
+ validate: config.validate || false
19730
19794
  };
19731
19795
  warnUnknownOptions(config, Object.keys(outputOptions), 'output options', inputOptions.onwarn);
19732
19796
  return { options: outputOptions, unsetOptions };
@@ -19773,7 +19837,7 @@ const getFormat = (config) => {
19773
19837
  });
19774
19838
  }
19775
19839
  };
19776
- const getInlineDynamicImports$1 = (config, inputOptions) => {
19840
+ const getInlineDynamicImports = (config, inputOptions) => {
19777
19841
  var _a;
19778
19842
  const inlineDynamicImports = ((_a = config.inlineDynamicImports) !== null && _a !== void 0 ? _a : inputOptions.inlineDynamicImports) ||
19779
19843
  false;
@@ -19786,7 +19850,7 @@ const getInlineDynamicImports$1 = (config, inputOptions) => {
19786
19850
  }
19787
19851
  return inlineDynamicImports;
19788
19852
  };
19789
- const getPreserveModules$1 = (config, inlineDynamicImports, inputOptions) => {
19853
+ const getPreserveModules = (config, inlineDynamicImports, inputOptions) => {
19790
19854
  var _a;
19791
19855
  const preserveModules = ((_a = config.preserveModules) !== null && _a !== void 0 ? _a : inputOptions.preserveModules) || false;
19792
19856
  if (preserveModules) {
@@ -19930,7 +19994,7 @@ const getInterop = (config, inputOptions) => {
19930
19994
  }
19931
19995
  return configInterop === undefined ? () => true : () => validateInterop(configInterop);
19932
19996
  };
19933
- const getManualChunks$1 = (config, inlineDynamicImports, preserveModules, inputOptions) => {
19997
+ const getManualChunks = (config, inlineDynamicImports, preserveModules, inputOptions) => {
19934
19998
  const configManualChunks = config.manualChunks || inputOptions.manualChunks;
19935
19999
  if (configManualChunks) {
19936
20000
  if (inlineDynamicImports) {
@@ -20014,7 +20078,7 @@ async function getInputOptions(rawInputOptions, watchMode) {
20014
20078
  function applyOptionHook(watchMode) {
20015
20079
  return async (inputOptions, plugin) => {
20016
20080
  if (plugin.options)
20017
- return (plugin.options.call({ meta: { rollupVersion: version, watchMode } }, await inputOptions) || inputOptions);
20081
+ return (plugin.options.call({ meta: { rollupVersion: version$1, watchMode } }, await inputOptions) || inputOptions);
20018
20082
  return inputOptions;
20019
20083
  };
20020
20084
  }
@@ -20028,7 +20092,7 @@ function normalizePlugins(plugins, anonymousPrefix) {
20028
20092
  }
20029
20093
  async function handleGenerateWrite(isWrite, inputOptions, unsetInputOptions, rawOutputOptions, graph) {
20030
20094
  const { options: outputOptions, outputPluginDriver, unsetOptions } = getOutputOptionsAndPluginDriver(rawOutputOptions, graph.pluginDriver, inputOptions, unsetInputOptions);
20031
- const bundle = new Bundle$1(outputOptions, unsetOptions, inputOptions, outputPluginDriver, graph);
20095
+ const bundle = new Bundle(outputOptions, unsetOptions, inputOptions, outputPluginDriver, graph);
20032
20096
  const generated = await bundle.generate(isWrite);
20033
20097
  if (isWrite) {
20034
20098
  if (!outputOptions.dir && !outputOptions.file) {
@@ -20164,4 +20228,4 @@ function watch(configs) {
20164
20228
  return emitter;
20165
20229
  }
20166
20230
 
20167
- export { createCommonjsModule, defaultOnWarn, ensureArray, fseventsImporter, getAugmentedNamespace, rollup, rollupInternal, version, warnUnknownOptions, watch };
20231
+ export { defaultOnWarn, ensureArray, fseventsImporter, getAugmentedNamespace, rollup, rollupInternal, version$1 as version, warnUnknownOptions, watch };