@rollup/wasm-node 4.52.5 → 4.53.1

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 v4.52.5
4
- Sat, 18 Oct 2025 06:53:02 GMT - commit 55a8fd5a70820f274921edf394efbbaa620f0962
3
+ Rollup.js v4.53.1
4
+ Fri, 07 Nov 2025 21:55:39 GMT - commit e3bdcdfe5633a6835dc4c61f8cf93a682406d965
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -27,7 +27,7 @@ function _mergeNamespaces(n, m) {
27
27
  return Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' });
28
28
  }
29
29
 
30
- var version = "4.52.5";
30
+ var version = "4.53.1";
31
31
 
32
32
  // src/vlq.ts
33
33
  var comma = ",".charCodeAt(0);
@@ -2500,6 +2500,7 @@ const RESERVED_NAMES = new Set([
2500
2500
  'enum',
2501
2501
  'eval',
2502
2502
  'export',
2503
+ 'exports',
2503
2504
  'extends',
2504
2505
  'false',
2505
2506
  'finally',
@@ -2612,6 +2613,7 @@ class ExternalModule {
2612
2613
  isIncluded: null,
2613
2614
  meta,
2614
2615
  moduleSideEffects,
2616
+ safeVariableNames: null,
2615
2617
  syntheticNamedExports: false
2616
2618
  };
2617
2619
  }
@@ -5588,13 +5590,10 @@ class ChildScope extends Scope {
5588
5590
  this.parent.addReturnExpression(expression);
5589
5591
  }
5590
5592
  }
5591
- addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope) {
5593
+ addUsedOutsideNames(usedNames, accessedGlobalsByScope) {
5592
5594
  for (const variable of this.accessedOutsideVariables.values()) {
5593
5595
  if (variable.included) {
5594
5596
  usedNames.add(variable.getBaseVariableName());
5595
- if (format === 'system' && exportNamesByVariable.has(variable)) {
5596
- usedNames.add('exports');
5597
- }
5598
5597
  }
5599
5598
  }
5600
5599
  const accessedGlobals = accessedGlobalsByScope.get(this);
@@ -5609,7 +5608,7 @@ class ChildScope extends Scope {
5609
5608
  }
5610
5609
  deconflict(format, exportNamesByVariable, accessedGlobalsByScope) {
5611
5610
  const usedNames = new Set();
5612
- this.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope);
5611
+ this.addUsedOutsideNames(usedNames, accessedGlobalsByScope);
5613
5612
  if (this.accessedDynamicImports) {
5614
5613
  for (const importExpression of this.accessedDynamicImports) {
5615
5614
  if (importExpression.inlineNamespace) {
@@ -6900,6 +6899,13 @@ function getFunctionIdInsertPosition(code, start) {
6900
6899
  return declarationEnd + generatorStarPos + 1;
6901
6900
  }
6902
6901
  class ExportDefaultDeclaration extends NodeBase {
6902
+ bind() {
6903
+ super.bind();
6904
+ const name = this.declarationName || this.scope.context.getModuleName();
6905
+ // Check if there's already a variable with the same name in the scope. This
6906
+ // can cause inconsistencies when using the cache.
6907
+ this.variable.name = this.scope.variables.get(name) ? `${name}_default` : name;
6908
+ }
6903
6909
  include(context, includeChildrenRecursively) {
6904
6910
  this.included = true;
6905
6911
  this.declaration.include(context, includeChildrenRecursively);
@@ -6916,7 +6922,7 @@ class ExportDefaultDeclaration extends NodeBase {
6916
6922
  const declaration = this.declaration;
6917
6923
  this.declarationName =
6918
6924
  (declaration.id && declaration.id.name) || this.declaration.name;
6919
- this.variable = this.scope.addExportDefaultDeclaration(this.declarationName || this.scope.context.getModuleName(), this, this.scope.context);
6925
+ this.variable = this.scope.addExportDefaultDeclaration(this, this.scope.context);
6920
6926
  this.scope.context.addExport(this);
6921
6927
  }
6922
6928
  removeAnnotations(code) {
@@ -7845,8 +7851,8 @@ class UndefinedVariable extends Variable {
7845
7851
  }
7846
7852
 
7847
7853
  class ExportDefaultVariable extends LocalVariable {
7848
- constructor(name, exportDefaultDeclaration, context) {
7849
- super(name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, EMPTY_PATH, context, 'other');
7854
+ constructor(exportDefaultDeclaration, context) {
7855
+ super('default', exportDefaultDeclaration, exportDefaultDeclaration.declaration, EMPTY_PATH, context, 'other');
7850
7856
  this.hasId = false;
7851
7857
  this.originalId = null;
7852
7858
  this.originalVariable = null;
@@ -8154,10 +8160,10 @@ function getCompleteAmdId(options, chunkId) {
8154
8160
  return options.id ?? '';
8155
8161
  }
8156
8162
 
8157
- function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal, mechanism = 'return ') {
8163
+ function getExportBlock$1(exports$1, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal, mechanism = 'return ') {
8158
8164
  const { _, getDirectReturnFunction, getFunctionIntro, getPropertyAccess, n, s } = snippets;
8159
8165
  if (!namedExportsMode) {
8160
- return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess)};`;
8166
+ return `${n}${n}${mechanism}${getSingleDefaultExport(exports$1, dependencies, interop, externalLiveBindings, getPropertyAccess)};`;
8161
8167
  }
8162
8168
  let exportBlock = '';
8163
8169
  if (namedExportsMode) {
@@ -8194,7 +8200,7 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
8194
8200
  }
8195
8201
  }
8196
8202
  }
8197
- for (const { exported, local } of exports) {
8203
+ for (const { exported, local } of exports$1) {
8198
8204
  const lhs = `exports${getPropertyAccess(exported)}`;
8199
8205
  const rhs = local;
8200
8206
  if (lhs !== rhs) {
@@ -8241,9 +8247,9 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
8241
8247
  }
8242
8248
  return '';
8243
8249
  }
8244
- function getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess) {
8245
- if (exports.length > 0) {
8246
- return exports[0].local;
8250
+ function getSingleDefaultExport(exports$1, dependencies, interop, externalLiveBindings, getPropertyAccess) {
8251
+ if (exports$1.length > 0) {
8252
+ return exports$1[0].local;
8247
8253
  }
8248
8254
  else {
8249
8255
  for (const { defaultVariableName, importPath, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) {
@@ -8504,12 +8510,12 @@ function warnOnBuiltins(log, dependencies) {
8504
8510
  log(LOGLEVEL_WARN, logMissingNodeBuiltins(externalBuiltins));
8505
8511
  }
8506
8512
 
8507
- function amd(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, id, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, log, outro, snippets }, { amd, esModule, externalLiveBindings, freeze, generatedCode: { symbols }, interop, reexportProtoFromExternal, strict }) {
8513
+ function amd(magicString, { accessedGlobals, dependencies, exports: exports$1, hasDefaultExport, hasExports, id, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, log, outro, snippets }, { amd, esModule, externalLiveBindings, freeze, generatedCode: { symbols }, interop, reexportProtoFromExternal, strict }) {
8508
8514
  warnOnBuiltins(log, dependencies);
8509
8515
  const deps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.importPath, amd.forceJsExtensionForImports)}'`);
8510
8516
  const parameters = dependencies.map(m => m.name);
8511
8517
  const { n, getNonArrowFunctionIntro, _ } = snippets;
8512
- if (hasExports && (namedExportsMode || exports[0]?.local === 'exports.default')) {
8518
+ if (hasExports && (namedExportsMode || exports$1[0]?.local === 'exports.default')) {
8513
8519
  parameters.unshift(`exports`);
8514
8520
  deps.unshift(`'exports'`);
8515
8521
  }
@@ -8526,7 +8532,7 @@ function amd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
8526
8532
  (deps.length > 0 ? `[${deps.join(`,${_}`)}],${_}` : ``);
8527
8533
  const useStrict = strict ? `${_}'use strict';` : '';
8528
8534
  magicString.prepend(`${intro}${getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets)}`);
8529
- const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
8535
+ const exportBlock = getExportBlock$1(exports$1, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
8530
8536
  let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), isModuleFacade && symbols, snippets);
8531
8537
  if (namespaceMarkers) {
8532
8538
  namespaceMarkers = n + n + namespaceMarkers;
@@ -8543,7 +8549,7 @@ function amd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
8543
8549
  .append(`${n}${n}}));`);
8544
8550
  }
8545
8551
 
8546
- function cjs(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, snippets }, { compact, esModule, externalLiveBindings, freeze, interop, generatedCode: { symbols }, reexportProtoFromExternal, strict }) {
8552
+ function cjs(magicString, { accessedGlobals, dependencies, exports: exports$1, hasDefaultExport, hasExports, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, snippets }, { compact, esModule, externalLiveBindings, freeze, interop, generatedCode: { symbols }, reexportProtoFromExternal, strict }) {
8547
8553
  const { _, n } = snippets;
8548
8554
  const useStrict = strict ? `'use strict';${n}${n}` : '';
8549
8555
  let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), isModuleFacade && symbols, snippets);
@@ -8553,7 +8559,7 @@ function cjs(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
8553
8559
  const importBlock = getImportBlock$1(dependencies, snippets, compact);
8554
8560
  const interopBlock = getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets);
8555
8561
  magicString.prepend(`${useStrict}${intro}${namespaceMarkers}${importBlock}${interopBlock}`);
8556
- const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal, `module.exports${_}=${_}`);
8562
+ const exportBlock = getExportBlock$1(exports$1, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal, `module.exports${_}=${_}`);
8557
8563
  magicString.append(`${exportBlock}${outro}`);
8558
8564
  }
8559
8565
  function getImportBlock$1(dependencies, { _, cnst, n }, compact) {
@@ -8579,7 +8585,7 @@ function getImportBlock$1(dependencies, { _, cnst, n }, compact) {
8579
8585
  return '';
8580
8586
  }
8581
8587
 
8582
- function es(magicString, { accessedGlobals, indent: t, intro, outro, dependencies, exports, snippets }, { externalLiveBindings, freeze, generatedCode: { symbols }, importAttributesKey }) {
8588
+ function es(magicString, { accessedGlobals, indent: t, intro, outro, dependencies, exports: exports$1, snippets }, { externalLiveBindings, freeze, generatedCode: { symbols }, importAttributesKey }) {
8583
8589
  const { n } = snippets;
8584
8590
  const importBlock = getImportBlock(dependencies, importAttributesKey, snippets);
8585
8591
  if (importBlock.length > 0)
@@ -8587,7 +8593,7 @@ function es(magicString, { accessedGlobals, indent: t, intro, outro, dependencie
8587
8593
  intro += getHelpersBlock(null, accessedGlobals, t, snippets, externalLiveBindings, freeze, symbols);
8588
8594
  if (intro)
8589
8595
  magicString.prepend(intro);
8590
- const exportBlock = getExportBlock(exports, snippets);
8596
+ const exportBlock = getExportBlock(exports$1, snippets);
8591
8597
  if (exportBlock.length > 0)
8592
8598
  magicString.append(n + n + exportBlock.join(n).trim());
8593
8599
  if (outro)
@@ -8672,11 +8678,11 @@ function getImportBlock(dependencies, importAttributesKey, { _ }) {
8672
8678
  }
8673
8679
  return importBlock;
8674
8680
  }
8675
- function getExportBlock(exports, { _, cnst }) {
8681
+ function getExportBlock(exports$1, { _, cnst }) {
8676
8682
  const exportBlock = [];
8677
- const exportDeclaration = new Array(exports.length);
8683
+ const exportDeclaration = new Array(exports$1.length);
8678
8684
  let index = 0;
8679
- for (const specifier of exports) {
8685
+ for (const specifier of exports$1) {
8680
8686
  if (specifier.expression) {
8681
8687
  exportBlock.push(`${cnst} ${specifier.local}${_}=${_}${specifier.expression};`);
8682
8688
  }
@@ -8754,7 +8760,7 @@ function trimEmptyImports(dependencies) {
8754
8760
  return [];
8755
8761
  }
8756
8762
 
8757
- function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, indent: t, intro, namedExportsMode, log, outro, snippets }, { compact, esModule, extend, freeze, externalLiveBindings, reexportProtoFromExternal, globals, interop, name, generatedCode: { symbols }, strict }) {
8763
+ function iife(magicString, { accessedGlobals, dependencies, exports: exports$1, hasDefaultExport, hasExports, indent: t, intro, namedExportsMode, log, outro, snippets }, { compact, esModule, extend, freeze, externalLiveBindings, reexportProtoFromExternal, globals, interop, name, generatedCode: { symbols }, strict }) {
8758
8764
  const { _, getNonArrowFunctionIntro, getPropertyAccess, n } = snippets;
8759
8765
  const isNamespaced = name && name.includes('.');
8760
8766
  const useVariableAssignment = !extend && !isNamespaced;
@@ -8768,7 +8774,7 @@ function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultE
8768
8774
  if (hasExports && !name) {
8769
8775
  log(LOGLEVEL_WARN, logMissingNameOptionForIifeExport());
8770
8776
  }
8771
- if (hasExports && (namedExportsMode || exports[0]?.local === 'exports.default')) {
8777
+ if (hasExports && (namedExportsMode || exports$1[0]?.local === 'exports.default')) {
8772
8778
  if (extend) {
8773
8779
  deps.unshift(`this${keypath(name, getPropertyAccess)}${_}=${_}this${keypath(name, getPropertyAccess)}${_}||${_}{}`);
8774
8780
  parameters.unshift('exports');
@@ -8799,7 +8805,7 @@ function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultE
8799
8805
  if (hasExports && !extend && namedExportsMode) {
8800
8806
  wrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`;
8801
8807
  }
8802
- const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
8808
+ const exportBlock = getExportBlock$1(exports$1, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
8803
8809
  let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), symbols, snippets);
8804
8810
  if (namespaceMarkers) {
8805
8811
  namespaceMarkers = n + n + namespaceMarkers;
@@ -8813,9 +8819,9 @@ function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultE
8813
8819
 
8814
8820
  const MISSING_EXPORT_SHIM_VARIABLE = '_missingExportShim';
8815
8821
 
8816
- function system(magicString, { accessedGlobals, dependencies, exports, hasExports, indent: t, intro, snippets, outro, usesTopLevelAwait }, { externalLiveBindings, freeze, name, generatedCode: { symbols }, strict, systemNullSetters }) {
8822
+ function system(magicString, { accessedGlobals, dependencies, exports: exports$1, hasExports, indent: t, intro, snippets, outro, usesTopLevelAwait }, { externalLiveBindings, freeze, name, generatedCode: { symbols }, strict, systemNullSetters }) {
8817
8823
  const { _, getFunctionIntro, getNonArrowFunctionIntro, n, s } = snippets;
8818
- const { importBindings, setters, starExcludes } = analyzeDependencies(dependencies, exports, t, snippets);
8824
+ const { importBindings, setters, starExcludes } = analyzeDependencies(dependencies, exports$1, t, snippets);
8819
8825
  const registeredName = name ? `'${name}',${_}` : '';
8820
8826
  const wrapperParameters = accessedGlobals.has('module')
8821
8827
  ? ['exports', 'module']
@@ -8852,15 +8858,15 @@ function system(magicString, { accessedGlobals, dependencies, exports, hasExport
8852
8858
  magicString
8853
8859
  .prepend(intro +
8854
8860
  getHelpersBlock(null, accessedGlobals, t, snippets, externalLiveBindings, freeze, symbols) +
8855
- getHoistedExportsBlock(exports, t, snippets))
8861
+ getHoistedExportsBlock(exports$1, t, snippets))
8856
8862
  .append(`${outro}${n}${n}` +
8857
- getSyntheticExportsBlock(exports, t, snippets) +
8858
- getMissingExportsBlock(exports, t, snippets))
8863
+ getSyntheticExportsBlock(exports$1, t, snippets) +
8864
+ getMissingExportsBlock(exports$1, t, snippets))
8859
8865
  .indent(`${t}${t}${t}`)
8860
8866
  .append(wrapperEnd)
8861
8867
  .prepend(wrapperStart);
8862
8868
  }
8863
- function analyzeDependencies(dependencies, exports, t, { _, cnst, getObject, getPropertyAccess, n }) {
8869
+ function analyzeDependencies(dependencies, exports$1, t, { _, cnst, getObject, getPropertyAccess, n }) {
8864
8870
  const importBindings = [];
8865
8871
  const setters = [];
8866
8872
  let starExcludes = null;
@@ -8894,7 +8900,7 @@ function analyzeDependencies(dependencies, exports, t, { _, cnst, getObject, get
8894
8900
  if (reexportedNames.length > 1 || hasStarReexport) {
8895
8901
  if (hasStarReexport) {
8896
8902
  if (!starExcludes) {
8897
- starExcludes = getStarExcludes({ dependencies, exports });
8903
+ starExcludes = getStarExcludes({ dependencies, exports: exports$1 });
8898
8904
  }
8899
8905
  reexportedNames.unshift([null, `__proto__:${_}null`]);
8900
8906
  const exportMapping = getObject(reexportedNames, { lineBreakIndent: null });
@@ -8914,8 +8920,8 @@ function analyzeDependencies(dependencies, exports, t, { _, cnst, getObject, get
8914
8920
  }
8915
8921
  return { importBindings, setters, starExcludes };
8916
8922
  }
8917
- const getStarExcludes = ({ dependencies, exports }) => {
8918
- const starExcludes = new Set(exports.map(expt => expt.exported));
8923
+ const getStarExcludes = ({ dependencies, exports: exports$1 }) => {
8924
+ const starExcludes = new Set(exports$1.map(expt => expt.exported));
8919
8925
  starExcludes.add('default');
8920
8926
  for (const { reexports } of dependencies) {
8921
8927
  if (reexports) {
@@ -8941,24 +8947,24 @@ const getStarExcludesBlock = (starExcludes, t, { _, cnst, getObject, n }) => {
8941
8947
  return '';
8942
8948
  };
8943
8949
  const getImportBindingsBlock = (importBindings, t, { _, n }) => (importBindings.length > 0 ? `${n}${t}var ${importBindings.join(`,${_}`)};` : '');
8944
- const getHoistedExportsBlock = (exports, t, snippets) => getExportsBlock(exports.filter(expt => expt.hoisted).map(expt => ({ name: expt.exported, value: expt.local })), t, snippets);
8945
- function getExportsBlock(exports, t, { _, n }) {
8946
- if (exports.length === 0) {
8950
+ const getHoistedExportsBlock = (exports$1, t, snippets) => getExportsBlock(exports$1.filter(expt => expt.hoisted).map(expt => ({ name: expt.exported, value: expt.local })), t, snippets);
8951
+ function getExportsBlock(exports$1, t, { _, n }) {
8952
+ if (exports$1.length === 0) {
8947
8953
  return '';
8948
8954
  }
8949
- if (exports.length === 1) {
8950
- return `exports(${JSON.stringify(exports[0].name)},${_}${exports[0].value});${n}${n}`;
8955
+ if (exports$1.length === 1) {
8956
+ return `exports(${JSON.stringify(exports$1[0].name)},${_}${exports$1[0].value});${n}${n}`;
8951
8957
  }
8952
8958
  return (`exports({${n}` +
8953
- exports
8959
+ exports$1
8954
8960
  .map(({ name, value }) => `${t}${stringifyObjectKeyIfNeeded(name)}:${_}${value}`)
8955
8961
  .join(`,${n}`) +
8956
8962
  `${n}});${n}${n}`);
8957
8963
  }
8958
- const getSyntheticExportsBlock = (exports, t, snippets) => getExportsBlock(exports
8964
+ const getSyntheticExportsBlock = (exports$1, t, snippets) => getExportsBlock(exports$1
8959
8965
  .filter(expt => expt.expression)
8960
8966
  .map(expt => ({ name: expt.exported, value: expt.local })), t, snippets);
8961
- const getMissingExportsBlock = (exports, t, snippets) => getExportsBlock(exports
8967
+ const getMissingExportsBlock = (exports$1, t, snippets) => getExportsBlock(exports$1
8962
8968
  .filter(expt => expt.local === MISSING_EXPORT_SHIM_VARIABLE)
8963
8969
  .map(expt => ({ name: expt.exported, value: MISSING_EXPORT_SHIM_VARIABLE })), t, snippets);
8964
8970
 
@@ -8974,7 +8980,7 @@ function safeAccess(name, globalVariable, { _, getPropertyAccess }) {
8974
8980
  .map(part => (propertyPath += getPropertyAccess(part)))
8975
8981
  .join(`${_}&&${_}`);
8976
8982
  }
8977
- function umd(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, id, indent: t, intro, namedExportsMode, log, outro, snippets }, { amd, compact, esModule, extend, externalLiveBindings, freeze, interop, name, generatedCode: { symbols }, globals, noConflict, reexportProtoFromExternal, strict }) {
8983
+ function umd(magicString, { accessedGlobals, dependencies, exports: exports$1, hasDefaultExport, hasExports, id, indent: t, intro, namedExportsMode, log, outro, snippets }, { amd, compact, esModule, extend, externalLiveBindings, freeze, interop, name, generatedCode: { symbols }, globals, noConflict, reexportProtoFromExternal, strict }) {
8978
8984
  const { _, cnst, getFunctionIntro, getNonArrowFunctionIntro, getPropertyAccess, n, s } = snippets;
8979
8985
  const factoryVariable = compact ? 'f' : 'factory';
8980
8986
  const globalVariable = compact ? 'g' : 'global';
@@ -8988,7 +8994,7 @@ function umd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
8988
8994
  const globalDeps = trimmedImports.map(module => globalProperty(module.globalName, globalVariable, getPropertyAccess));
8989
8995
  const factoryParameters = trimmedImports.map(m => m.name);
8990
8996
  if ((hasExports || noConflict) &&
8991
- (namedExportsMode || (hasExports && exports[0]?.local === 'exports.default'))) {
8997
+ (namedExportsMode || (hasExports && exports$1[0]?.local === 'exports.default'))) {
8992
8998
  amdDeps.unshift(`'exports'`);
8993
8999
  cjsDeps.unshift(`exports`);
8994
9000
  globalDeps.unshift(assignToDeepVariable(name, globalVariable, globals, `${extend ? `${globalProperty(name, globalVariable, getPropertyAccess)}${_}||${_}` : ''}{}`, snippets, log));
@@ -9056,7 +9062,7 @@ function umd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
9056
9062
  })}{${useStrict}${n}`;
9057
9063
  const wrapperOutro = n + n + '}));';
9058
9064
  magicString.prepend(`${intro}${getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets)}`);
9059
- const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
9065
+ const exportBlock = getExportBlock$1(exports$1, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
9060
9066
  let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), symbols, snippets);
9061
9067
  if (namespaceMarkers) {
9062
9068
  namespaceMarkers = n + n + namespaceMarkers;
@@ -9301,7 +9307,7 @@ var hasRequiredUtils;
9301
9307
  function requireUtils () {
9302
9308
  if (hasRequiredUtils) return utils;
9303
9309
  hasRequiredUtils = 1;
9304
- (function (exports) {
9310
+ (function (exports$1) {
9305
9311
 
9306
9312
  const {
9307
9313
  REGEX_BACKSLASH,
@@ -9310,13 +9316,13 @@ function requireUtils () {
9310
9316
  REGEX_SPECIAL_CHARS_GLOBAL
9311
9317
  } = /*@__PURE__*/ requireConstants();
9312
9318
 
9313
- exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
9314
- exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
9315
- exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
9316
- exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
9317
- exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
9319
+ exports$1.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
9320
+ exports$1.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
9321
+ exports$1.isRegexChar = str => str.length === 1 && exports$1.hasRegexChars(str);
9322
+ exports$1.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
9323
+ exports$1.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
9318
9324
 
9319
- exports.isWindows = () => {
9325
+ exports$1.isWindows = () => {
9320
9326
  if (typeof navigator !== 'undefined' && navigator.platform) {
9321
9327
  const platform = navigator.platform.toLowerCase();
9322
9328
  return platform === 'win32' || platform === 'windows';
@@ -9329,20 +9335,20 @@ function requireUtils () {
9329
9335
  return false;
9330
9336
  };
9331
9337
 
9332
- exports.removeBackslashes = str => {
9338
+ exports$1.removeBackslashes = str => {
9333
9339
  return str.replace(REGEX_REMOVE_BACKSLASH, match => {
9334
9340
  return match === '\\' ? '' : match;
9335
9341
  });
9336
9342
  };
9337
9343
 
9338
- exports.escapeLast = (input, char, lastIdx) => {
9344
+ exports$1.escapeLast = (input, char, lastIdx) => {
9339
9345
  const idx = input.lastIndexOf(char, lastIdx);
9340
9346
  if (idx === -1) return input;
9341
- if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
9347
+ if (input[idx - 1] === '\\') return exports$1.escapeLast(input, char, idx - 1);
9342
9348
  return `${input.slice(0, idx)}\\${input.slice(idx)}`;
9343
9349
  };
9344
9350
 
9345
- exports.removePrefix = (input, state = {}) => {
9351
+ exports$1.removePrefix = (input, state = {}) => {
9346
9352
  let output = input;
9347
9353
  if (output.startsWith('./')) {
9348
9354
  output = output.slice(2);
@@ -9351,7 +9357,7 @@ function requireUtils () {
9351
9357
  return output;
9352
9358
  };
9353
9359
 
9354
- exports.wrapOutput = (input, state = {}, options = {}) => {
9360
+ exports$1.wrapOutput = (input, state = {}, options = {}) => {
9355
9361
  const prepend = options.contains ? '' : '^';
9356
9362
  const append = options.contains ? '' : '$';
9357
9363
 
@@ -9362,7 +9368,7 @@ function requireUtils () {
9362
9368
  return output;
9363
9369
  };
9364
9370
 
9365
- exports.basename = (path, { windows } = {}) => {
9371
+ exports$1.basename = (path, { windows } = {}) => {
9366
9372
  const segs = path.split(windows ? /[\\/]/ : '/');
9367
9373
  const last = segs[segs.length - 1];
9368
9374
 
@@ -15039,8 +15045,8 @@ class ModuleScope extends ChildScope {
15039
15045
  }
15040
15046
  return super.addDeclaration(identifier, context, init, destructuredInitPath, kind);
15041
15047
  }
15042
- addExportDefaultDeclaration(name, exportDefaultDeclaration, context) {
15043
- const variable = new ExportDefaultVariable(name, exportDefaultDeclaration, context);
15048
+ addExportDefaultDeclaration(exportDefaultDeclaration, context) {
15049
+ const variable = new ExportDefaultVariable(exportDefaultDeclaration, context);
15044
15050
  this.variables.set('default', variable);
15045
15051
  return variable;
15046
15052
  }
@@ -16836,7 +16842,7 @@ class Module {
16836
16842
  this.preserveSignature = this.options.preserveEntrySignatures;
16837
16843
  // eslint-disable-next-line @typescript-eslint/no-this-alias
16838
16844
  const module = this;
16839
- const { dynamicImports, dynamicImporters, exportAllSources, exports, implicitlyLoadedAfter, implicitlyLoadedBefore, importers, reexportDescriptions, sourcesWithAttributes } = this;
16845
+ const { dynamicImports, dynamicImporters, exportAllSources, exports: exports$1, implicitlyLoadedAfter, implicitlyLoadedBefore, importers, reexportDescriptions, sourcesWithAttributes } = this;
16840
16846
  this.info = {
16841
16847
  ast: null,
16842
16848
  attributes,
@@ -16855,7 +16861,7 @@ class Module {
16855
16861
  return dynamicImporters.sort();
16856
16862
  },
16857
16863
  get exportedBindings() {
16858
- const exportBindings = { '.': [...exports.keys()] };
16864
+ const exportBindings = { '.': [...exports$1.keys()] };
16859
16865
  for (const [name, { source }] of reexportDescriptions) {
16860
16866
  (exportBindings[source] ??= []).push(name);
16861
16867
  }
@@ -16866,7 +16872,7 @@ class Module {
16866
16872
  },
16867
16873
  get exports() {
16868
16874
  return [
16869
- ...exports.keys(),
16875
+ ...exports$1.keys(),
16870
16876
  ...reexportDescriptions.keys(),
16871
16877
  ...[...exportAllSources].map(() => '*')
16872
16878
  ];
@@ -16906,6 +16912,7 @@ class Module {
16906
16912
  },
16907
16913
  meta: { ...meta },
16908
16914
  moduleSideEffects,
16915
+ safeVariableNames: null,
16909
16916
  syntheticNamedExports
16910
16917
  };
16911
16918
  }
@@ -17256,13 +17263,14 @@ class Module {
17256
17263
  }
17257
17264
  return { source, usesTopLevelAwait };
17258
17265
  }
17259
- async setSource({ ast, code, customTransformCache, originalCode, originalSourcemap, resolvedIds, sourcemapChain, transformDependencies, transformFiles, ...moduleOptions }) {
17266
+ async setSource({ ast, code, customTransformCache, originalCode, originalSourcemap, resolvedIds, sourcemapChain, transformDependencies, transformFiles, safeVariableNames, ...moduleOptions }) {
17260
17267
  timeStart('generate ast', 3);
17261
17268
  if (code.startsWith('#!')) {
17262
17269
  const shebangEndPosition = code.indexOf('\n');
17263
17270
  this.shebang = code.slice(2, shebangEndPosition);
17264
17271
  }
17265
17272
  this.info.code = code;
17273
+ this.info.safeVariableNames = safeVariableNames;
17266
17274
  this.originalCode = originalCode;
17267
17275
  // We need to call decodedSourcemap on the input in case they were hydrated from json in the cache and don't
17268
17276
  // have the lazy evaluation cache configured. Right now this isn't enforced by the type system because the
@@ -17369,6 +17377,7 @@ class Module {
17369
17377
  originalCode: this.originalCode,
17370
17378
  originalSourcemap: this.originalSourcemap,
17371
17379
  resolvedIds: this.resolvedIds,
17380
+ safeVariableNames: this.info.safeVariableNames,
17372
17381
  sourcemapChain: this.sourcemapChain,
17373
17382
  syntheticNamedExports: this.info.syntheticNamedExports,
17374
17383
  transformDependencies: this.transformDependencies,
@@ -17787,7 +17796,7 @@ const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = {
17787
17796
  function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) {
17788
17797
  const reversedModules = [...modules].reverse();
17789
17798
  for (const module of reversedModules) {
17790
- module.scope.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope);
17799
+ module.scope.addUsedOutsideNames(usedNames, accessedGlobalsByScope);
17791
17800
  }
17792
17801
  deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces);
17793
17802
  DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports);
@@ -17880,12 +17889,22 @@ function deconflictImportsOther(usedNames, imports, { deconflictedDefault, decon
17880
17889
  }
17881
17890
  function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) {
17882
17891
  for (const module of modules) {
17892
+ module.info.safeVariableNames ||= {};
17883
17893
  for (const variable of module.scope.variables.values()) {
17884
17894
  if (variable.included &&
17885
17895
  // this will only happen for exports in some formats
17886
17896
  !(variable.renderBaseName ||
17887
17897
  (variable instanceof ExportDefaultVariable && variable.getOriginalVariable() !== variable))) {
17898
+ // We need to make sure that variables that corresponding to object
17899
+ // prototype methods are not accidentally matched.
17900
+ const cachedSafeVariableName = Object.getOwnPropertyDescriptor(module.info.safeVariableNames, variable.name)?.value;
17901
+ if (cachedSafeVariableName && !usedNames.has(cachedSafeVariableName)) {
17902
+ usedNames.add(cachedSafeVariableName);
17903
+ variable.setRenderNames(null, cachedSafeVariableName);
17904
+ continue;
17905
+ }
17888
17906
  variable.setRenderNames(null, getSafeName(variable.name, usedNames, variable.forbiddenNames));
17907
+ module.info.safeVariableNames[variable.name] = variable.renderName;
17889
17908
  }
17890
17909
  }
17891
17910
  if (includedNamespaces.has(module)) {
@@ -17895,9 +17914,9 @@ function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) {
17895
17914
  }
17896
17915
  }
17897
17916
 
17898
- function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariable) {
17917
+ function assignExportsToMangledNames(exports$1, exportsByName, exportNamesByVariable) {
17899
17918
  let nameIndex = 0;
17900
- for (const variable of exports) {
17919
+ for (const variable of exports$1) {
17901
17920
  let [exportName] = variable.name;
17902
17921
  if (exportsByName.has(exportName)) {
17903
17922
  do {
@@ -17913,8 +17932,8 @@ function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariab
17913
17932
  exportNamesByVariable.set(variable, [exportName]);
17914
17933
  }
17915
17934
  }
17916
- function assignExportsToNames(exports, exportsByName, exportNamesByVariable) {
17917
- for (const variable of exports) {
17935
+ function assignExportsToNames(exports$1, exportsByName, exportNamesByVariable) {
17936
+ for (const variable of exports$1) {
17918
17937
  let nameIndex = 0;
17919
17938
  let exportName = variable.name;
17920
17939
  while (exportsByName.has(exportName)) {
@@ -18130,6 +18149,16 @@ function makeUnique(name, { [lowercaseBundleKeys]: reservedLowercaseBundleKeys }
18130
18149
  return uniqueName;
18131
18150
  }
18132
18151
 
18152
+ const RESERVED_USED_NAMES = [
18153
+ 'Object',
18154
+ 'Promise',
18155
+ 'module',
18156
+ 'exports',
18157
+ 'require',
18158
+ '__filename',
18159
+ '__dirname',
18160
+ ...HELPER_NAMES
18161
+ ];
18133
18162
  const NON_ASSET_EXTENSIONS = new Set([
18134
18163
  '.js',
18135
18164
  '.jsx',
@@ -18682,7 +18711,7 @@ class Chunk {
18682
18711
  return 'chunk';
18683
18712
  }
18684
18713
  getChunkExportDeclarations(format) {
18685
- const exports = [];
18714
+ const exports$1 = [];
18686
18715
  for (const exportName of this.getExportNames()) {
18687
18716
  if (exportName[0] === '*')
18688
18717
  continue;
@@ -18727,14 +18756,14 @@ class Chunk {
18727
18756
  local = variable.renderName;
18728
18757
  }
18729
18758
  }
18730
- exports.push({
18759
+ exports$1.push({
18731
18760
  exported: exportName,
18732
18761
  expression,
18733
18762
  hoisted,
18734
18763
  local
18735
18764
  });
18736
18765
  }
18737
- return exports;
18766
+ return exports$1;
18738
18767
  }
18739
18768
  getDependenciesToBeDeconflicted(addNonNamespacesAndInteropHelpers, addDependenciesWithoutBindings, interop) {
18740
18769
  const dependencies = new Set();
@@ -19151,32 +19180,13 @@ class Chunk {
19151
19180
  break;
19152
19181
  }
19153
19182
  }
19154
- const usedNames = new Set(['Object', 'Promise']);
19183
+ const usedNames = new Set(RESERVED_USED_NAMES);
19155
19184
  if (this.needsExportsShim) {
19156
19185
  usedNames.add(MISSING_EXPORT_SHIM_VARIABLE);
19157
19186
  }
19158
19187
  if (symbols) {
19159
19188
  usedNames.add('Symbol');
19160
19189
  }
19161
- switch (format) {
19162
- case 'system': {
19163
- usedNames.add('module').add('exports');
19164
- break;
19165
- }
19166
- case 'es': {
19167
- break;
19168
- }
19169
- case 'cjs': {
19170
- usedNames.add('module').add('require').add('__filename').add('__dirname');
19171
- }
19172
- // fallthrough
19173
- default: {
19174
- usedNames.add('exports');
19175
- for (const helper of HELPER_NAMES) {
19176
- usedNames.add(helper);
19177
- }
19178
- }
19179
- }
19180
19190
  deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(format !== 'es' && format !== 'system', format === 'amd' || format === 'umd' || format === 'iife', interop), this.imports, usedNames, format, interop, preserveModules, externalLiveBindings, this.chunkByModule, this.externalChunkByModule, syntheticExports, this.exportNamesByVariable, this.accessedGlobalsByScope, this.includedNamespaces);
19181
19191
  }
19182
19192
  setImportMetaResolutions(fileName) {
@@ -21197,6 +21207,7 @@ async function transform(source, module, pluginDriver, log) {
21197
21207
  customTransformCache,
21198
21208
  originalCode,
21199
21209
  originalSourcemap,
21210
+ safeVariableNames: null,
21200
21211
  sourcemapChain,
21201
21212
  transformDependencies
21202
21213
  };
@@ -23339,7 +23350,9 @@ async function rollupInternal(rawInputOptions, watcher) {
23339
23350
  });
23340
23351
  timeEnd('BUILD', 1);
23341
23352
  const result = {
23342
- cache: useCache ? graph.getCache() : undefined,
23353
+ get cache() {
23354
+ return useCache ? graph.getCache() : undefined;
23355
+ },
23343
23356
  async close() {
23344
23357
  if (result.closed)
23345
23358
  return;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.52.5
4
- Sat, 18 Oct 2025 06:53:02 GMT - commit 55a8fd5a70820f274921edf394efbbaa620f0962
3
+ Rollup.js v4.53.1
4
+ Fri, 07 Nov 2025 21:55:39 GMT - commit e3bdcdfe5633a6835dc4c61f8cf93a682406d965
5
5
 
6
6
  https://github.com/rollup/rollup
7
7