@bigbinary/neeto-playwright-commons 1.8.36 → 1.8.38

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.
package/index.js CHANGED
@@ -199,9 +199,13 @@ function getDefaultExportFromCjs (x) {
199
199
  }
200
200
 
201
201
  function getAugmentedNamespace(n) {
202
+ if (n.__esModule) return n;
202
203
  var f = n.default;
203
204
  if (typeof f == "function") {
204
- var a = function () {
205
+ var a = function a () {
206
+ if (this instanceof a) {
207
+ return Reflect.construct(f, arguments, this.constructor);
208
+ }
205
209
  return f.apply(this, arguments);
206
210
  };
207
211
  a.prototype = f.prototype;
@@ -882,6 +886,8 @@ var setFunctionLength = function setFunctionLength(fn, length) {
882
886
  return fn;
883
887
  };
884
888
 
889
+ callBind$1.exports;
890
+
885
891
  (function (module) {
886
892
 
887
893
  var bind = functionBind;
@@ -925,12 +931,14 @@ var setFunctionLength = function setFunctionLength(fn, length) {
925
931
  $defineProperty(module.exports, 'apply', { value: applyBind });
926
932
  } else {
927
933
  module.exports.apply = applyBind;
928
- }
934
+ }
929
935
  } (callBind$1));
930
936
 
937
+ var callBindExports = callBind$1.exports;
938
+
931
939
  var GetIntrinsic$1 = getIntrinsic;
932
940
 
933
- var callBind = callBind$1.exports;
941
+ var callBind = callBindExports;
934
942
 
935
943
  var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
936
944
 
@@ -2457,6 +2465,8 @@ var lib$7 = {
2457
2465
  stringify: stringify$5
2458
2466
  };
2459
2467
 
2468
+ var qs$1 = /*@__PURE__*/getDefaultExportFromCjs(lib$7);
2469
+
2460
2470
  class CustomCommands {
2461
2471
  constructor(page, request, baseURL = process.env.BASE_URL) {
2462
2472
  this.interceptMultipleResponses = ({ responseUrl = "", responseStatus = 200, times = 1, baseUrl, customPageContext, timeout = 35000, } = {}) => {
@@ -2507,6 +2517,18 @@ class CustomCommands {
2507
2517
  await pageContext.reload();
2508
2518
  await reloadRequests;
2509
2519
  };
2520
+ this.waitForPageLoad = async ({ visiblityTimeout = 35000, customPageContext, }) => {
2521
+ const pageContext = customPageContext !== null && customPageContext !== void 0 ? customPageContext : this.page;
2522
+ await pageContext.waitForLoadState("load");
2523
+ await Promise.all([
2524
+ expect(pageContext.getByTestId(COMMON_SELECTORS.pageLoader)).toBeHidden({
2525
+ timeout: visiblityTimeout,
2526
+ }),
2527
+ expect(pageContext.getByTestId(COMMON_SELECTORS.spinner)).toBeHidden({
2528
+ timeout: visiblityTimeout,
2529
+ }),
2530
+ ]);
2531
+ };
2510
2532
  this.apiRequest = async ({ url, failOnStatusCode = true, headers: additionalHeaders, body: data, method = "get", params = {}, ...otherOptions }) => {
2511
2533
  const csrfToken = await this.page
2512
2534
  .locator("[name='csrf-token']")
@@ -2523,7 +2545,7 @@ class CustomCommands {
2523
2545
  };
2524
2546
  const formattedUrl = isEmpty$1(params)
2525
2547
  ? url
2526
- : `${url}?${lib$7.stringify(params, {
2548
+ : `${url}?${qs$1.stringify(params, {
2527
2549
  arrayFormat: "brackets",
2528
2550
  })}`;
2529
2551
  return await this.request[method](formattedUrl, requestOptions);
@@ -2558,12 +2580,18 @@ class CustomCommands {
2558
2580
 
2559
2581
  class MailosaurUtils {
2560
2582
  constructor(mailosaur) {
2583
+ this.getEmailContent = ({ email, subjectSubstring = "", timeout = 2 * 60 * 1000, receivedAfter = new Date(), }) => this.mailosaur.messages.get(this.serverId, { sentTo: email, subject: subjectSubstring }, { timeout, receivedAfter });
2561
2584
  this.fetchOtpFromEmail = async ({ email, subjectSubstring = OTP_EMAIL_PATTERN, timeout = 2 * 60 * 1000, receivedAfter = new Date(), }) => {
2562
2585
  var _a, _b, _c;
2563
- const receivedEmail = await this.mailosaur.messages.get(this.serverId, { sentTo: email, subject: subjectSubstring }, { timeout, receivedAfter });
2586
+ const receivedEmail = await this.getEmailContent({
2587
+ email,
2588
+ subjectSubstring,
2589
+ timeout,
2590
+ receivedAfter,
2591
+ });
2564
2592
  const otp = (_c = (_b = (_a = receivedEmail === null || receivedEmail === void 0 ? void 0 : receivedEmail.text) === null || _a === void 0 ? void 0 : _a.codes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.value;
2565
2593
  if (isNil(otp)) {
2566
- throw new Error(`No codes found in the email with subject: ${receivedEmail.subject}. Please re-evaluate the filtering parameters.`);
2594
+ throw new Error(`No codes found in the email with subject: ${receivedEmail === null || receivedEmail === void 0 ? void 0 : receivedEmail.subject}. Please re-evaluate the filtering parameters.`);
2567
2595
  }
2568
2596
  return otp;
2569
2597
  };
@@ -3086,6 +3114,7 @@ function requireCommon$1 () {
3086
3114
  }
3087
3115
 
3088
3116
  /* eslint-env browser */
3117
+ browser$1.exports;
3089
3118
 
3090
3119
  var hasRequiredBrowser;
3091
3120
 
@@ -3359,8 +3388,8 @@ function requireBrowser () {
3359
3388
  } catch (error) {
3360
3389
  return '[UnexpectedJSONParseError]: ' + error.message;
3361
3390
  }
3362
- };
3363
- } (browser$1, browser$1.exports));
3391
+ };
3392
+ } (browser$1, browser$1.exports));
3364
3393
  return browser$1.exports;
3365
3394
  }
3366
3395
 
@@ -3528,6 +3557,7 @@ function requireSupportsColor () {
3528
3557
  /**
3529
3558
  * Module dependencies.
3530
3559
  */
3560
+ node.exports;
3531
3561
 
3532
3562
  var hasRequiredNode;
3533
3563
 
@@ -3793,8 +3823,8 @@ function requireNode () {
3793
3823
  formatters.O = function (v) {
3794
3824
  this.inspectOpts.colors = this.useColors;
3795
3825
  return util.inspect(v, this.inspectOpts);
3796
- };
3797
- } (node, node.exports));
3826
+ };
3827
+ } (node, node.exports));
3798
3828
  return node.exports;
3799
3829
  }
3800
3830
 
@@ -3803,15 +3833,14 @@ function requireNode () {
3803
3833
  * treat as a browser.
3804
3834
  */
3805
3835
 
3806
- (function (module) {
3807
- if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
3808
- module.exports = requireBrowser();
3809
- } else {
3810
- module.exports = requireNode();
3811
- }
3812
- } (src$1));
3836
+ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
3837
+ src$1.exports = requireBrowser();
3838
+ } else {
3839
+ src$1.exports = requireNode();
3840
+ }
3813
3841
 
3814
- var debug$3 = /*@__PURE__*/getDefaultExportFromCjs(src$1.exports);
3842
+ var srcExports = src$1.exports;
3843
+ var debug$3 = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
3815
3844
 
3816
3845
  /*!
3817
3846
  * playwright-extra v4.3.5 by berstend
@@ -5406,10 +5435,16 @@ class StealthPlugin extends PuppeteerExtraPlugin {
5406
5435
  const defaultExport = opts => new StealthPlugin(opts);
5407
5436
  var puppeteerExtraPluginStealth = defaultExport;
5408
5437
 
5438
+ // const moduleExport = defaultExport
5439
+ // moduleExport.StealthPlugin = StealthPlugin
5440
+ // module.exports = moduleExport
5441
+
5442
+ var stealth$1 = /*@__PURE__*/getDefaultExportFromCjs(puppeteerExtraPluginStealth);
5443
+
5409
5444
  var stealth = test$2.extend({
5410
5445
  browser: async ({ browser }, use) => {
5411
5446
  await browser.close();
5412
- chromium.use(puppeteerExtraPluginStealth());
5447
+ chromium.use(stealth$1());
5413
5448
  const stealthBrowser = await chromium.launch();
5414
5449
  await use(stealthBrowser);
5415
5450
  await stealthBrowser.close();
@@ -5928,7 +5963,7 @@ var utils$k = {};
5928
5963
  };
5929
5964
  flat(args);
5930
5965
  return result;
5931
- };
5966
+ };
5932
5967
  } (utils$k));
5933
5968
 
5934
5969
  const utils$j = utils$k;
@@ -7235,8 +7270,6 @@ braces$1.create = (input, options = {}) => {
7235
7270
 
7236
7271
  var braces_1 = braces$1;
7237
7272
 
7238
- var picomatch$2 = {exports: {}};
7239
-
7240
7273
  var utils$g = {};
7241
7274
 
7242
7275
  const path$8 = Path;
@@ -7480,7 +7513,7 @@ var constants$b = {
7480
7513
  output = `(?:^(?!${output}).*$)`;
7481
7514
  }
7482
7515
  return output;
7483
- };
7516
+ };
7484
7517
  } (utils$g));
7485
7518
 
7486
7519
  const utils$f = utils$g;
@@ -8992,9 +9025,9 @@ const isObject$1 = val => val && typeof val === 'object' && !Array.isArray(val);
8992
9025
  * @api public
8993
9026
  */
8994
9027
 
8995
- const picomatch$1 = (glob, options, returnState = false) => {
9028
+ const picomatch$2 = (glob, options, returnState = false) => {
8996
9029
  if (Array.isArray(glob)) {
8997
- const fns = glob.map(input => picomatch$1(input, options, returnState));
9030
+ const fns = glob.map(input => picomatch$2(input, options, returnState));
8998
9031
  const arrayMatcher = str => {
8999
9032
  for (const isMatch of fns) {
9000
9033
  const state = isMatch(str);
@@ -9014,8 +9047,8 @@ const picomatch$1 = (glob, options, returnState = false) => {
9014
9047
  const opts = options || {};
9015
9048
  const posix = utils$d.isWindows(options);
9016
9049
  const regex = isState
9017
- ? picomatch$1.compileRe(glob, options)
9018
- : picomatch$1.makeRe(glob, options, false, true);
9050
+ ? picomatch$2.compileRe(glob, options)
9051
+ : picomatch$2.makeRe(glob, options, false, true);
9019
9052
 
9020
9053
  const state = regex.state;
9021
9054
  delete regex.state;
@@ -9023,11 +9056,11 @@ const picomatch$1 = (glob, options, returnState = false) => {
9023
9056
  let isIgnored = () => false;
9024
9057
  if (opts.ignore) {
9025
9058
  const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
9026
- isIgnored = picomatch$1(opts.ignore, ignoreOpts, returnState);
9059
+ isIgnored = picomatch$2(opts.ignore, ignoreOpts, returnState);
9027
9060
  }
9028
9061
 
9029
9062
  const matcher = (input, returnObject = false) => {
9030
- const { isMatch, match, output } = picomatch$1.test(input, regex, options, { glob, posix });
9063
+ const { isMatch, match, output } = picomatch$2.test(input, regex, options, { glob, posix });
9031
9064
  const result = { glob, state, regex, posix, input, output, match, isMatch };
9032
9065
 
9033
9066
  if (typeof opts.onResult === 'function') {
@@ -9077,7 +9110,7 @@ const picomatch$1 = (glob, options, returnState = false) => {
9077
9110
  * @api public
9078
9111
  */
9079
9112
 
9080
- picomatch$1.test = (input, regex, options, { glob, posix } = {}) => {
9113
+ picomatch$2.test = (input, regex, options, { glob, posix } = {}) => {
9081
9114
  if (typeof input !== 'string') {
9082
9115
  throw new TypeError('Expected input to be a string');
9083
9116
  }
@@ -9098,7 +9131,7 @@ picomatch$1.test = (input, regex, options, { glob, posix } = {}) => {
9098
9131
 
9099
9132
  if (match === false || opts.capture === true) {
9100
9133
  if (opts.matchBase === true || opts.basename === true) {
9101
- match = picomatch$1.matchBase(input, regex, options, posix);
9134
+ match = picomatch$2.matchBase(input, regex, options, posix);
9102
9135
  } else {
9103
9136
  match = regex.exec(output);
9104
9137
  }
@@ -9121,8 +9154,8 @@ picomatch$1.test = (input, regex, options, { glob, posix } = {}) => {
9121
9154
  * @api public
9122
9155
  */
9123
9156
 
9124
- picomatch$1.matchBase = (input, glob, options, posix = utils$d.isWindows(options)) => {
9125
- const regex = glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options);
9157
+ picomatch$2.matchBase = (input, glob, options, posix = utils$d.isWindows(options)) => {
9158
+ const regex = glob instanceof RegExp ? glob : picomatch$2.makeRe(glob, options);
9126
9159
  return regex.test(path$7.basename(input));
9127
9160
  };
9128
9161
 
@@ -9143,7 +9176,7 @@ picomatch$1.matchBase = (input, glob, options, posix = utils$d.isWindows(options
9143
9176
  * @api public
9144
9177
  */
9145
9178
 
9146
- picomatch$1.isMatch = (str, patterns, options) => picomatch$1(patterns, options)(str);
9179
+ picomatch$2.isMatch = (str, patterns, options) => picomatch$2(patterns, options)(str);
9147
9180
 
9148
9181
  /**
9149
9182
  * Parse a glob pattern to create the source string for a regular
@@ -9159,8 +9192,8 @@ picomatch$1.isMatch = (str, patterns, options) => picomatch$1(patterns, options)
9159
9192
  * @api public
9160
9193
  */
9161
9194
 
9162
- picomatch$1.parse = (pattern, options) => {
9163
- if (Array.isArray(pattern)) return pattern.map(p => picomatch$1.parse(p, options));
9195
+ picomatch$2.parse = (pattern, options) => {
9196
+ if (Array.isArray(pattern)) return pattern.map(p => picomatch$2.parse(p, options));
9164
9197
  return parse$2(pattern, { ...options, fastpaths: false });
9165
9198
  };
9166
9199
 
@@ -9191,7 +9224,7 @@ picomatch$1.parse = (pattern, options) => {
9191
9224
  * @api public
9192
9225
  */
9193
9226
 
9194
- picomatch$1.scan = (input, options) => scan$1(input, options);
9227
+ picomatch$2.scan = (input, options) => scan$1(input, options);
9195
9228
 
9196
9229
  /**
9197
9230
  * Compile a regular expression from the `state` object returned by the
@@ -9205,7 +9238,7 @@ picomatch$1.scan = (input, options) => scan$1(input, options);
9205
9238
  * @api public
9206
9239
  */
9207
9240
 
9208
- picomatch$1.compileRe = (state, options, returnOutput = false, returnState = false) => {
9241
+ picomatch$2.compileRe = (state, options, returnOutput = false, returnState = false) => {
9209
9242
  if (returnOutput === true) {
9210
9243
  return state.output;
9211
9244
  }
@@ -9219,7 +9252,7 @@ picomatch$1.compileRe = (state, options, returnOutput = false, returnState = fal
9219
9252
  source = `^(?!${source}).*$`;
9220
9253
  }
9221
9254
 
9222
- const regex = picomatch$1.toRegex(source, options);
9255
+ const regex = picomatch$2.toRegex(source, options);
9223
9256
  if (returnState === true) {
9224
9257
  regex.state = state;
9225
9258
  }
@@ -9246,7 +9279,7 @@ picomatch$1.compileRe = (state, options, returnOutput = false, returnState = fal
9246
9279
  * @api public
9247
9280
  */
9248
9281
 
9249
- picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
9282
+ picomatch$2.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
9250
9283
  if (!input || typeof input !== 'string') {
9251
9284
  throw new TypeError('Expected a non-empty string');
9252
9285
  }
@@ -9261,7 +9294,7 @@ picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = f
9261
9294
  parsed = parse$2(input, options);
9262
9295
  }
9263
9296
 
9264
- return picomatch$1.compileRe(parsed, options, returnOutput, returnState);
9297
+ return picomatch$2.compileRe(parsed, options, returnOutput, returnState);
9265
9298
  };
9266
9299
 
9267
9300
  /**
@@ -9281,7 +9314,7 @@ picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = f
9281
9314
  * @api public
9282
9315
  */
9283
9316
 
9284
- picomatch$1.toRegex = (source, options) => {
9317
+ picomatch$2.toRegex = (source, options) => {
9285
9318
  try {
9286
9319
  const opts = options || {};
9287
9320
  return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
@@ -9296,22 +9329,19 @@ picomatch$1.toRegex = (source, options) => {
9296
9329
  * @return {Object}
9297
9330
  */
9298
9331
 
9299
- picomatch$1.constants = constants$9;
9332
+ picomatch$2.constants = constants$9;
9300
9333
 
9301
9334
  /**
9302
9335
  * Expose "picomatch"
9303
9336
  */
9304
9337
 
9305
- var picomatch_1 = picomatch$1;
9338
+ var picomatch_1 = picomatch$2;
9306
9339
 
9307
- (function (module) {
9308
-
9309
- module.exports = picomatch_1;
9310
- } (picomatch$2));
9340
+ var picomatch$1 = picomatch_1;
9311
9341
 
9312
9342
  const util$7 = require$$0$2;
9313
9343
  const braces = braces_1;
9314
- const picomatch = picomatch$2.exports;
9344
+ const picomatch = picomatch$1;
9315
9345
  const utils$c = utils$g;
9316
9346
  const isEmptyString = val => val === '' || val === './';
9317
9347
 
@@ -10365,7 +10395,7 @@ var fs$a = {};
10365
10395
  }
10366
10396
  return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
10367
10397
  }
10368
- exports.createFileSystemAdapter = createFileSystemAdapter;
10398
+ exports.createFileSystemAdapter = createFileSystemAdapter;
10369
10399
  } (fs$a));
10370
10400
 
10371
10401
  Object.defineProperty(settings$3, "__esModule", { value: true });
@@ -10718,7 +10748,7 @@ var fs$6 = {};
10718
10748
  }
10719
10749
  return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
10720
10750
  }
10721
- exports.createFileSystemAdapter = createFileSystemAdapter;
10751
+ exports.createFileSystemAdapter = createFileSystemAdapter;
10722
10752
  } (fs$6));
10723
10753
 
10724
10754
  Object.defineProperty(settings$2, "__esModule", { value: true });
@@ -11094,6 +11124,8 @@ function queueAsPromised (context, worker, concurrency) {
11094
11124
  queue.exports = fastqueue;
11095
11125
  queue.exports.promise = queueAsPromised;
11096
11126
 
11127
+ var queueExports = queue.exports;
11128
+
11097
11129
  var common$4 = {};
11098
11130
 
11099
11131
  Object.defineProperty(common$4, "__esModule", { value: true });
@@ -11143,7 +11175,7 @@ reader$1.default = Reader$1;
11143
11175
  Object.defineProperty(async$4, "__esModule", { value: true });
11144
11176
  const events_1 = require$$0$4;
11145
11177
  const fsScandir$2 = out$2;
11146
- const fastq = queue.exports;
11178
+ const fastq = queueExports;
11147
11179
  const common$2 = common$4;
11148
11180
  const reader_1$4 = reader$1;
11149
11181
  class AsyncReader extends reader_1$4.default {
@@ -12066,7 +12098,7 @@ var settings = {};
12066
12098
  return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
12067
12099
  }
12068
12100
  }
12069
- exports.default = Settings;
12101
+ exports.default = Settings;
12070
12102
  } (settings));
12071
12103
 
12072
12104
  const taskManager = tasks;
@@ -13660,6 +13692,8 @@ anyBase.HEX = '0123456789abcdef';
13660
13692
 
13661
13693
  var anyBase_1 = anyBase;
13662
13694
 
13695
+ var anyBase$1 = /*@__PURE__*/getDefaultExportFromCjs(anyBase_1);
13696
+
13663
13697
  var pixelmatch_1 = pixelmatch;
13664
13698
 
13665
13699
  function pixelmatch(img1, img2, output, width, height, options) {
@@ -13817,6 +13851,8 @@ function grayPixel(img, i) {
13817
13851
  return rgb2y(r, g, b);
13818
13852
  }
13819
13853
 
13854
+ var pixelMatch = /*@__PURE__*/getDefaultExportFromCjs(pixelmatch_1);
13855
+
13820
13856
  // This file is autogenerated. It's used to publish ESM to npm.
13821
13857
  function _typeof$1(obj) {
13822
13858
  "@babel/helpers - typeof";
@@ -15113,13 +15149,23 @@ ImagePHash.prototype.getHash = function (img) {
15113
15149
 
15114
15150
  // DCT function stolen from http://stackoverflow.com/questions/4240490/problems-with-dct-and-idct-algorithm-in-java
15115
15151
 
15152
+ /**
15153
+ Convert a 32-bit integer color value to an RGBA object.
15154
+ */
15116
15155
  function intToRGBA(i) {
15117
- const rgba = {};
15118
- rgba.r = Math.floor(i / Math.pow(256, 3));
15119
- rgba.g = Math.floor((i - rgba.r * Math.pow(256, 3)) / Math.pow(256, 2));
15120
- rgba.b = Math.floor((i - rgba.r * Math.pow(256, 3) - rgba.g * Math.pow(256, 2)) / Math.pow(256, 1));
15121
- rgba.a = Math.floor((i - rgba.r * Math.pow(256, 3) - rgba.g * Math.pow(256, 2) - rgba.b * Math.pow(256, 1)) / Math.pow(256, 0));
15122
- return rgba;
15156
+ const a = i & 0xff;
15157
+ i >>>= 8;
15158
+ const b = i & 0xff;
15159
+ i >>>= 8;
15160
+ const g = i & 0xff;
15161
+ i >>>= 8;
15162
+ const r = i & 0xff;
15163
+ return {
15164
+ r,
15165
+ g,
15166
+ b,
15167
+ a
15168
+ };
15123
15169
  }
15124
15170
  const c$1 = [];
15125
15171
  function initCoefficients(size) {
@@ -15343,6 +15389,8 @@ conversions["RegExp"] = function (V, opts) {
15343
15389
 
15344
15390
  var utils = {exports: {}};
15345
15391
 
15392
+ utils.exports;
15393
+
15346
15394
  (function (module) {
15347
15395
 
15348
15396
  module.exports.mixin = function mixin(target, source) {
@@ -15361,9 +15409,11 @@ var utils = {exports: {}};
15361
15409
 
15362
15410
  module.exports.implForWrapper = function (wrapper) {
15363
15411
  return wrapper[module.exports.implSymbol];
15364
- };
15412
+ };
15365
15413
  } (utils));
15366
15414
 
15415
+ var utilsExports = utils.exports;
15416
+
15367
15417
  var URLImpl = {};
15368
15418
 
15369
15419
  var urlStateMachine = {exports: {}};
@@ -93213,6 +93263,8 @@ tr46.toUnicode = function(domain_name, useSTD3) {
93213
93263
 
93214
93264
  tr46.PROCESSING_OPTIONS = PROCESSING_OPTIONS;
93215
93265
 
93266
+ urlStateMachine.exports;
93267
+
93216
93268
  (function (module) {
93217
93269
  const punycode = require$$0$5;
93218
93270
  const tr46$1 = tr46;
@@ -94508,10 +94560,12 @@ tr46.PROCESSING_OPTIONS = PROCESSING_OPTIONS;
94508
94560
 
94509
94561
  // We don't handle blobs, so this just delegates:
94510
94562
  return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });
94511
- };
94563
+ };
94512
94564
  } (urlStateMachine));
94513
94565
 
94514
- const usm = urlStateMachine.exports;
94566
+ var urlStateMachineExports = urlStateMachine.exports;
94567
+
94568
+ const usm = urlStateMachineExports;
94515
94569
 
94516
94570
  URLImpl.implementation = class URLImpl {
94517
94571
  constructor(constructorArgs) {
@@ -94711,13 +94765,15 @@ URLImpl.implementation = class URLImpl {
94711
94765
  }
94712
94766
  };
94713
94767
 
94768
+ URL$2.exports;
94769
+
94714
94770
  (function (module) {
94715
94771
 
94716
94772
  const conversions = lib$6;
94717
- const utils$1 = utils.exports;
94773
+ const utils = utilsExports;
94718
94774
  const Impl = URLImpl;
94719
94775
 
94720
- const impl = utils$1.implSymbol;
94776
+ const impl = utils.implSymbol;
94721
94777
 
94722
94778
  function URL(url) {
94723
94779
  if (!this || this[impl] || !(this instanceof URL)) {
@@ -94898,25 +94954,27 @@ URLImpl.implementation = class URLImpl {
94898
94954
  privateData.wrapper = obj;
94899
94955
 
94900
94956
  obj[impl] = new Impl.implementation(constructorArgs, privateData);
94901
- obj[impl][utils$1.wrapperSymbol] = obj;
94957
+ obj[impl][utils.wrapperSymbol] = obj;
94902
94958
  },
94903
94959
  interface: URL,
94904
94960
  expose: {
94905
94961
  Window: { URL: URL },
94906
94962
  Worker: { URL: URL }
94907
94963
  }
94908
- };
94964
+ };
94909
94965
  } (URL$2));
94910
94966
 
94911
- publicApi.URL = URL$2.exports.interface;
94912
- publicApi.serializeURL = urlStateMachine.exports.serializeURL;
94913
- publicApi.serializeURLOrigin = urlStateMachine.exports.serializeURLOrigin;
94914
- publicApi.basicURLParse = urlStateMachine.exports.basicURLParse;
94915
- publicApi.setTheUsername = urlStateMachine.exports.setTheUsername;
94916
- publicApi.setThePassword = urlStateMachine.exports.setThePassword;
94917
- publicApi.serializeHost = urlStateMachine.exports.serializeHost;
94918
- publicApi.serializeInteger = urlStateMachine.exports.serializeInteger;
94919
- publicApi.parseURL = urlStateMachine.exports.parseURL;
94967
+ var URLExports = URL$2.exports;
94968
+
94969
+ publicApi.URL = URLExports.interface;
94970
+ publicApi.serializeURL = urlStateMachineExports.serializeURL;
94971
+ publicApi.serializeURLOrigin = urlStateMachineExports.serializeURLOrigin;
94972
+ publicApi.basicURLParse = urlStateMachineExports.basicURLParse;
94973
+ publicApi.setTheUsername = urlStateMachineExports.setTheUsername;
94974
+ publicApi.setThePassword = urlStateMachineExports.setThePassword;
94975
+ publicApi.serializeHost = urlStateMachineExports.serializeHost;
94976
+ publicApi.serializeInteger = urlStateMachineExports.serializeInteger;
94977
+ publicApi.parseURL = urlStateMachineExports.parseURL;
94920
94978
 
94921
94979
  // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
94922
94980
 
@@ -96696,6 +96754,8 @@ var lib$5 = /*#__PURE__*/Object.freeze({
96696
96754
 
96697
96755
  var require$$0 = /*@__PURE__*/getAugmentedNamespace(lib$5);
96698
96756
 
96757
+ fetchNpmNode.exports;
96758
+
96699
96759
  (function (module) {
96700
96760
 
96701
96761
  var realFetch = require$$0;
@@ -96711,9 +96771,11 @@ var require$$0 = /*@__PURE__*/getAugmentedNamespace(lib$5);
96711
96771
  commonjsGlobal.Response = realFetch.Response;
96712
96772
  commonjsGlobal.Headers = realFetch.Headers;
96713
96773
  commonjsGlobal.Request = realFetch.Request;
96714
- }
96774
+ }
96715
96775
  } (fetchNpmNode));
96716
96776
 
96777
+ fetchNpmNode.exports;
96778
+
96717
96779
  var request$1 = ((_ref, cb) => {
96718
96780
  let {
96719
96781
  url,
@@ -97227,7 +97289,7 @@ var EndOfFileStream = {};
97227
97289
  super(exports.defaultMessages);
97228
97290
  }
97229
97291
  }
97230
- exports.EndOfStreamError = EndOfStreamError;
97292
+ exports.EndOfStreamError = EndOfStreamError;
97231
97293
  } (EndOfFileStream));
97232
97294
 
97233
97295
  var StreamReader = {};
@@ -97381,7 +97443,7 @@ Deferred$1.Deferred = Deferred;
97381
97443
  }
97382
97444
  }
97383
97445
  }
97384
- exports.StreamReader = StreamReader;
97446
+ exports.StreamReader = StreamReader;
97385
97447
  } (StreamReader));
97386
97448
 
97387
97449
  (function (exports) {
@@ -97390,7 +97452,7 @@ Deferred$1.Deferred = Deferred;
97390
97452
  var EndOfFileStream_1 = EndOfFileStream;
97391
97453
  Object.defineProperty(exports, "EndOfStreamError", { enumerable: true, get: function () { return EndOfFileStream_1.EndOfStreamError; } });
97392
97454
  var StreamReader_1 = StreamReader;
97393
- Object.defineProperty(exports, "StreamReader", { enumerable: true, get: function () { return StreamReader_1.StreamReader; } });
97455
+ Object.defineProperty(exports, "StreamReader", { enumerable: true, get: function () { return StreamReader_1.StreamReader; } });
97394
97456
  } (lib$3));
97395
97457
 
97396
97458
  Object.defineProperty(AbstractTokenizer$1, "__esModule", { value: true });
@@ -97680,7 +97742,7 @@ BufferTokenizer$1.BufferTokenizer = BufferTokenizer;
97680
97742
  function fromBuffer(uint8Array, fileInfo) {
97681
97743
  return new BufferTokenizer_1.BufferTokenizer(uint8Array, fileInfo);
97682
97744
  }
97683
- exports.fromBuffer = fromBuffer;
97745
+ exports.fromBuffer = fromBuffer;
97684
97746
  } (core$2));
97685
97747
 
97686
97748
  var FileTokenizer$1 = {};
@@ -97766,7 +97828,7 @@ FileTokenizer$1.fromFile = fromFile$1;
97766
97828
  }
97767
97829
  return core.fromStream(stream, fileInfo);
97768
97830
  }
97769
- exports.fromStream = fromStream;
97831
+ exports.fromStream = fromStream;
97770
97832
  } (lib$4));
97771
97833
 
97772
97834
  var lib$2 = {};
@@ -98314,7 +98376,7 @@ ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) {
98314
98376
  201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
98315
98377
  217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232,
98316
98378
  233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247,
98317
- 248, 249, 250, 251, 252, 253, 254, 255];
98379
+ 248, 249, 250, 251, 252, 253, 254, 255];
98318
98380
  } (lib$2));
98319
98381
 
98320
98382
  var util$6 = {};
@@ -100133,6 +100195,8 @@ Object.defineProperty(fileType, 'mimeTypes', {
100133
100195
 
100134
100196
  var fileType_1 = fileType;
100135
100197
 
100198
+ var FileType = /*@__PURE__*/getDefaultExportFromCjs(fileType_1);
100199
+
100136
100200
  /*jslint browser: true, devel: true, bitwise: false, debug: true, eqeq: false, es5: true, evil: false, forin: false, newcap: false, nomen: true, plusplus: true, regexp: false, unparam: false, sloppy: true, stupid: false, sub: false, todo: true, vars: true, white: true */
100137
100201
 
100138
100202
  var jpeg$2 = {
@@ -101434,8 +101498,10 @@ var exifParser = {
101434
101498
  }
101435
101499
  };
101436
101500
 
101501
+ var EXIFParser = /*@__PURE__*/getDefaultExportFromCjs(exifParser);
101502
+
101437
101503
  async function getMIMEFromBuffer(buffer, path) {
101438
- const fileTypeFromBuffer = await fileType_1.fromBuffer(buffer);
101504
+ const fileTypeFromBuffer = await FileType.fromBuffer(buffer);
101439
101505
  if (fileTypeFromBuffer) {
101440
101506
  // If fileType returns something for buffer, then return the mime given
101441
101507
  return fileTypeFromBuffer.mime;
@@ -101581,7 +101647,7 @@ async function parseBitmap(data, path, cb) {
101581
101647
  return cb.call(this, error, this);
101582
101648
  }
101583
101649
  try {
101584
- this._exif = exifParser.create(data).parse();
101650
+ this._exif = EXIFParser.create(data).parse();
101585
101651
  exifRotate(this); // EXIF data
101586
101652
  } catch (error) {
101587
101653
  /* meh */
@@ -101647,7 +101713,7 @@ const alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
101647
101713
  // 0 and 1 do not exist as possible hash lengths
101648
101714
  const maxHashLength = [NaN, NaN];
101649
101715
  for (let i = 2; i < 65; i++) {
101650
- const maxHash = anyBase_1(anyBase_1.BIN, alphabet.slice(0, i))(new Array(64 + 1).join("1"));
101716
+ const maxHash = anyBase$1(anyBase$1.BIN, alphabet.slice(0, i))(new Array(64 + 1).join("1"));
101651
101717
  maxHashLength.push(maxHash.length);
101652
101718
  }
101653
101719
 
@@ -102120,7 +102186,7 @@ class Jimp$1 extends require$$0$4 {
102120
102186
  return throwError.call(this, "base must be a number between 2 and 64", cb);
102121
102187
  }
102122
102188
  let hash = this.pHash();
102123
- hash = anyBase_1(anyBase_1.BIN, alphabet.slice(0, base))(hash);
102189
+ hash = anyBase$1(anyBase$1.BIN, alphabet.slice(0, base))(hash);
102124
102190
  while (hash.length < maxHashLength[base]) {
102125
102191
  hash = "0" + hash; // pad out with leading zeros
102126
102192
  }
@@ -102229,10 +102295,6 @@ class Jimp$1 extends require$$0$4 {
102229
102295
  */
102230
102296
  getPixelColor(x, y, cb) {
102231
102297
  if (typeof x !== "number" || typeof y !== "number") return throwError.call(this, "x and y must be numbers", cb);
102232
-
102233
- // round input
102234
- x = Math.round(x);
102235
- y = Math.round(y);
102236
102298
  const idx = this.getPixelIndex(x, y);
102237
102299
  const hex = this.bitmap.data.readUInt32BE(idx);
102238
102300
  if (isNodePattern(cb)) {
@@ -102250,10 +102312,6 @@ class Jimp$1 extends require$$0$4 {
102250
102312
  */
102251
102313
  setPixelColor(hex, x, y, cb) {
102252
102314
  if (typeof hex !== "number" || typeof x !== "number" || typeof y !== "number") return throwError.call(this, "hex, x and y must be numbers", cb);
102253
-
102254
- // round input
102255
- x = Math.round(x);
102256
- y = Math.round(y);
102257
102315
  const idx = this.getPixelIndex(x, y);
102258
102316
  this.bitmap.data.writeUInt32BE(hex, idx);
102259
102317
  if (isNodePattern(cb)) {
@@ -102266,13 +102324,15 @@ class Jimp$1 extends require$$0$4 {
102266
102324
  * @return {boolean} hasAlpha whether the image contains opaque pixels
102267
102325
  */
102268
102326
  hasAlpha() {
102269
- for (let yIndex = 0; yIndex < this.bitmap.height; yIndex++) {
102270
- for (let xIndex = 0; xIndex < this.bitmap.width; xIndex++) {
102271
- const idx = this.bitmap.width * yIndex + xIndex << 2;
102272
- const alpha = this.bitmap.data[idx + 3];
102273
- if (alpha !== 0xff) {
102274
- return true;
102275
- }
102327
+ const {
102328
+ width,
102329
+ height,
102330
+ data
102331
+ } = this.bitmap;
102332
+ const byteLen = width * height << 2;
102333
+ for (let idx = 3; idx < byteLen; idx += 4) {
102334
+ if (data[idx] !== 0xff) {
102335
+ return true;
102276
102336
  }
102277
102337
  }
102278
102338
  return false;
@@ -102372,11 +102432,16 @@ Jimp$1.rgbaToInt = function (r, g, b, a, cb) {
102372
102432
  if (a < 0 || a > 255) {
102373
102433
  return throwError.call(this, "a must be between 0 and 255", cb);
102374
102434
  }
102375
- r = Math.round(r);
102376
- b = Math.round(b);
102377
- g = Math.round(g);
102378
- a = Math.round(a);
102379
- const i = r * Math.pow(256, 3) + g * Math.pow(256, 2) + b * Math.pow(256, 1) + a * Math.pow(256, 0);
102435
+ let i = r & 0xff;
102436
+ i <<= 8;
102437
+ i |= g & 0xff;
102438
+ i <<= 8;
102439
+ i |= b & 0xff;
102440
+ i <<= 8;
102441
+ i |= a & 0xff;
102442
+
102443
+ // Ensure sign is correct
102444
+ i >>>= 0;
102380
102445
  if (isNodePattern(cb)) {
102381
102446
  cb.call(this, null, i);
102382
102447
  }
@@ -102452,7 +102517,7 @@ Jimp$1.diff = function (img1, img2) {
102452
102517
  return throwError.call(this, "threshold must be a number between 0 and 1");
102453
102518
  }
102454
102519
  const diff = new Jimp$1(bmp1.width, bmp1.height, 0xffffffff);
102455
- const numDiffPixels = pixelmatch_1(bmp1.data, bmp2.data, diff.bitmap.data, diff.bitmap.width, diff.bitmap.height, {
102520
+ const numDiffPixels = pixelMatch(bmp1.data, bmp2.data, diff.bitmap.data, diff.bitmap.width, diff.bitmap.height, {
102456
102521
  threshold
102457
102522
  });
102458
102523
  return {
@@ -103414,6 +103479,7 @@ var encoder$1 = {exports: {}};
103414
103479
  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
103415
103480
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
103416
103481
  */
103482
+ encoder$1.exports;
103417
103483
 
103418
103484
  (function (module) {
103419
103485
 
@@ -104159,10 +104225,13 @@ var encoder$1 = {exports: {}};
104159
104225
  }
104160
104226
  } (encoder$1));
104161
104227
 
104228
+ var encoderExports = encoder$1.exports;
104229
+
104162
104230
  var decoder$1 = {exports: {}};
104163
104231
 
104164
104232
  /* -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
104165
104233
  /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
104234
+ decoder$1.exports;
104166
104235
 
104167
104236
  (function (module) {
104168
104237
  /*
@@ -105307,17 +105376,21 @@ var decoder$1 = {exports: {}};
105307
105376
  decoder.copyToImageData(image, opts.formatAsRGBA);
105308
105377
 
105309
105378
  return image;
105310
- }
105379
+ }
105311
105380
  } (decoder$1));
105312
105381
 
105313
- var encode$2 = encoder$1.exports,
105314
- decode$2 = decoder$1.exports;
105382
+ var decoderExports = decoder$1.exports;
105383
+
105384
+ var encode$2 = encoderExports,
105385
+ decode$2 = decoderExports;
105315
105386
 
105316
105387
  var jpegJs = {
105317
105388
  encode: encode$2,
105318
105389
  decode: decode$2
105319
105390
  };
105320
105391
 
105392
+ var JPEG = /*@__PURE__*/getDefaultExportFromCjs(jpegJs);
105393
+
105321
105394
  const MIME_TYPE$4 = "image/jpeg";
105322
105395
  var jpeg = (() => ({
105323
105396
  mime: {
@@ -105327,10 +105400,10 @@ var jpeg = (() => ({
105327
105400
  MIME_JPEG: MIME_TYPE$4
105328
105401
  },
105329
105402
  decoders: {
105330
- [MIME_TYPE$4]: jpegJs.decode
105403
+ [MIME_TYPE$4]: JPEG.decode
105331
105404
  },
105332
105405
  encoders: {
105333
- [MIME_TYPE$4]: image => jpegJs.encode(image.bitmap, image._quality).data
105406
+ [MIME_TYPE$4]: image => JPEG.encode(image.bitmap, image._quality).data
105334
105407
  },
105335
105408
  class: {
105336
105409
  // The quality to be used when saving JPEG images
@@ -105549,6 +105622,8 @@ ChunkStream$2.prototype._process = function () {
105549
105622
  }
105550
105623
  };
105551
105624
 
105625
+ var chunkstreamExports = chunkstream.exports;
105626
+
105552
105627
  var filterParseAsync = {exports: {}};
105553
105628
 
105554
105629
  var filterParse = {exports: {}};
@@ -105840,9 +105915,11 @@ Filter$2.prototype._reverseFilterLine = function (rawData) {
105840
105915
  }
105841
105916
  };
105842
105917
 
105918
+ var filterParseExports = filterParse.exports;
105919
+
105843
105920
  let util$4 = require$$0$2;
105844
- let ChunkStream$1 = chunkstream.exports;
105845
- let Filter$1 = filterParse.exports;
105921
+ let ChunkStream$1 = chunkstreamExports;
105922
+ let Filter$1 = filterParseExports;
105846
105923
 
105847
105924
  let FilterAsync$1 = (filterParseAsync.exports = function (bitmapInfo) {
105848
105925
  ChunkStream$1.call(this);
@@ -105863,6 +105940,8 @@ let FilterAsync$1 = (filterParseAsync.exports = function (bitmapInfo) {
105863
105940
  });
105864
105941
  util$4.inherits(FilterAsync$1, ChunkStream$1);
105865
105942
 
105943
+ var filterParseAsyncExports = filterParseAsync.exports;
105944
+
105866
105945
  var parser$1 = {exports: {}};
105867
105946
 
105868
105947
  var constants$6 = {
@@ -105937,8 +106016,10 @@ CrcCalculator$1.crc32 = function (buf) {
105937
106016
  return crc ^ -1;
105938
106017
  };
105939
106018
 
106019
+ var crcExports = crc.exports;
106020
+
105940
106021
  let constants$5 = constants$6;
105941
- let CrcCalculator = crc.exports;
106022
+ let CrcCalculator = crcExports;
105942
106023
 
105943
106024
  let Parser$3 = (parser$1.exports = function (options, dependencies) {
105944
106025
  this._options = options;
@@ -106226,6 +106307,8 @@ Parser$3.prototype._parseIEND = function (data) {
106226
106307
  }
106227
106308
  };
106228
106309
 
106310
+ var parserExports = parser$1.exports;
106311
+
106229
106312
  var bitmapper$2 = {};
106230
106313
 
106231
106314
  let interlaceUtils = interlace;
@@ -106588,9 +106671,9 @@ var formatNormaliser$2 = function (indata, imageData, skipRescale = false) {
106588
106671
 
106589
106672
  let util$3 = require$$0$2;
106590
106673
  let zlib$4 = zlib$5;
106591
- let ChunkStream = chunkstream.exports;
106592
- let FilterAsync = filterParseAsync.exports;
106593
- let Parser$2 = parser$1.exports;
106674
+ let ChunkStream = chunkstreamExports;
106675
+ let FilterAsync = filterParseAsyncExports;
106676
+ let Parser$2 = parserExports;
106594
106677
  let bitmapper$1 = bitmapper$2;
106595
106678
  let formatNormaliser$1 = formatNormaliser$2;
106596
106679
 
@@ -106754,6 +106837,8 @@ ParserAsync.prototype._complete = function (filteredData) {
106754
106837
  this.emit("parsed", normalisedBitmapData);
106755
106838
  };
106756
106839
 
106840
+ var parserAsyncExports = parserAsync.exports;
106841
+
106757
106842
  var packerAsync = {exports: {}};
106758
106843
 
106759
106844
  var packer = {exports: {}};
@@ -107086,7 +107171,7 @@ var filterPack = function (pxData, width, height, options, bpp) {
107086
107171
  };
107087
107172
 
107088
107173
  let constants$3 = constants$6;
107089
- let CrcStream = crc.exports;
107174
+ let CrcStream = crcExports;
107090
107175
  let bitPacker = bitpacker;
107091
107176
  let filter = filterPack;
107092
107177
  let zlib$3 = zlib$5;
@@ -107213,10 +107298,12 @@ Packer$3.prototype.packIEND = function () {
107213
107298
  return this._packChunk(constants$3.TYPE_IEND, null);
107214
107299
  };
107215
107300
 
107301
+ var packerExports = packer.exports;
107302
+
107216
107303
  let util$2 = require$$0$2;
107217
107304
  let Stream$1 = Stream$4;
107218
107305
  let constants$2 = constants$6;
107219
- let Packer$2 = packer.exports;
107306
+ let Packer$2 = packerExports;
107220
107307
 
107221
107308
  let PackerAsync = (packerAsync.exports = function (opt) {
107222
107309
  Stream$1.call(this);
@@ -107262,10 +107349,14 @@ PackerAsync.prototype.pack = function (data, width, height, gamma) {
107262
107349
  this._deflate.end(filteredData);
107263
107350
  };
107264
107351
 
107352
+ var packerAsyncExports = packerAsync.exports;
107353
+
107265
107354
  var pngSync = {};
107266
107355
 
107267
107356
  var syncInflate = {exports: {}};
107268
107357
 
107358
+ syncInflate.exports;
107359
+
107269
107360
  (function (module, exports) {
107270
107361
 
107271
107362
  let assert = require$$0$6.ok;
@@ -107433,9 +107524,11 @@ var syncInflate = {exports: {}};
107433
107524
  module.exports = exports = inflateSync;
107434
107525
  exports.Inflate = Inflate;
107435
107526
  exports.createInflate = createInflate;
107436
- exports.inflateSync = inflateSync;
107527
+ exports.inflateSync = inflateSync;
107437
107528
  } (syncInflate, syncInflate.exports));
107438
107529
 
107530
+ var syncInflateExports = syncInflate.exports;
107531
+
107439
107532
  var syncReader = {exports: {}};
107440
107533
 
107441
107534
  let SyncReader$2 = (syncReader.exports = function (buffer) {
@@ -107482,10 +107575,12 @@ SyncReader$2.prototype.process = function () {
107482
107575
  }
107483
107576
  };
107484
107577
 
107578
+ var syncReaderExports = syncReader.exports;
107579
+
107485
107580
  var filterParseSync = {};
107486
107581
 
107487
- let SyncReader$1 = syncReader.exports;
107488
- let Filter = filterParse.exports;
107582
+ let SyncReader$1 = syncReaderExports;
107583
+ let Filter = filterParseExports;
107489
107584
 
107490
107585
  filterParseSync.process = function (inBuffer, bitmapInfo) {
107491
107586
  let outBuffers = [];
@@ -107506,13 +107601,13 @@ filterParseSync.process = function (inBuffer, bitmapInfo) {
107506
107601
 
107507
107602
  let hasSyncZlib$1 = true;
107508
107603
  let zlib$2 = zlib$5;
107509
- let inflateSync = syncInflate.exports;
107604
+ let inflateSync = syncInflateExports;
107510
107605
  if (!zlib$2.deflateSync) {
107511
107606
  hasSyncZlib$1 = false;
107512
107607
  }
107513
- let SyncReader = syncReader.exports;
107608
+ let SyncReader = syncReaderExports;
107514
107609
  let FilterSync = filterParseSync;
107515
- let Parser$1 = parser$1.exports;
107610
+ let Parser$1 = parserExports;
107516
107611
  let bitmapper = bitmapper$2;
107517
107612
  let formatNormaliser = formatNormaliser$2;
107518
107613
 
@@ -107621,7 +107716,7 @@ if (!zlib$1.deflateSync) {
107621
107716
  hasSyncZlib = false;
107622
107717
  }
107623
107718
  let constants$1 = constants$6;
107624
- let Packer$1 = packer.exports;
107719
+ let Packer$1 = packerExports;
107625
107720
 
107626
107721
  var packerSync = function (metaData, opt) {
107627
107722
  if (!hasSyncZlib) {
@@ -107685,8 +107780,8 @@ var PNG_1;
107685
107780
 
107686
107781
  let util$1 = require$$0$2;
107687
107782
  let Stream = Stream$4;
107688
- let Parser = parserAsync.exports;
107689
- let Packer = packerAsync.exports;
107783
+ let Parser = parserAsyncExports;
107784
+ let Packer = packerAsyncExports;
107690
107785
  let PNGSync = pngSync;
107691
107786
 
107692
107787
  let PNG = (PNG_1 = function (options) {
@@ -108587,6 +108682,8 @@ var bmpJs = {
108587
108682
  decode: decode$1
108588
108683
  };
108589
108684
 
108685
+ var BMP = /*@__PURE__*/getDefaultExportFromCjs(bmpJs);
108686
+
108590
108687
  const MIME_TYPE$2 = "image/bmp";
108591
108688
  const MIME_TYPE_SECOND = "image/x-ms-bmp";
108592
108689
  function toAGBR(image) {
@@ -108615,8 +108712,8 @@ function fromAGBR(bitmap) {
108615
108712
  this.bitmap.data[index + 3] = bitmap.is_with_alpha ? alpha : 0xff;
108616
108713
  }).bitmap;
108617
108714
  }
108618
- const decode = data => fromAGBR(bmpJs.decode(data));
108619
- const encode = image => bmpJs.encode(toAGBR(image)).data;
108715
+ const decode = data => fromAGBR(BMP.decode(data));
108716
+ const encode = image => BMP.encode(toAGBR(image)).data;
108620
108717
  var bmp = (() => ({
108621
108718
  mime: {
108622
108719
  [MIME_TYPE$2]: ["bmp"]
@@ -108752,8 +108849,8 @@ function requireCommon () {
108752
108849
  }
108753
108850
  };
108754
108851
 
108755
- exports.setTyped(TYPED_OK);
108756
- } (common));
108852
+ exports.setTyped(TYPED_OK);
108853
+ } (common));
108757
108854
  return common;
108758
108855
  }
108759
108856
 
@@ -115557,6 +115654,8 @@ function requirePako () {
115557
115654
  return pako_1;
115558
115655
  }
115559
115656
 
115657
+ UTIF.exports;
115658
+
115560
115659
  (function (module) {
115561
115660
  (function(){
115562
115661
  var UTIF = {};
@@ -117193,10 +117292,11 @@ function requirePako () {
117193
117292
 
117194
117293
 
117195
117294
  })(UTIF, pako);
117196
- })();
117295
+ })();
117197
117296
  } (UTIF));
117198
117297
 
117199
- var utif = UTIF.exports;
117298
+ var UTIFExports = UTIF.exports;
117299
+ var utif = /*@__PURE__*/getDefaultExportFromCjs(UTIFExports);
117200
117300
 
117201
117301
  const MIME_TYPE$1 = "image/tiff";
117202
117302
  var tiff = (() => ({
@@ -121570,8 +121670,8 @@ function requireGifutil () {
121570
121670
  return resolve();
121571
121671
  });
121572
121672
  });
121573
- }
121574
- } (gifutil));
121673
+ }
121674
+ } (gifutil));
121575
121675
  return gifutil;
121576
121676
  }
121577
121677
 
@@ -129733,8 +129833,8 @@ function requireSax () {
129733
129833
  }
129734
129834
  }());
129735
129835
  }
129736
- })(exports);
129737
- } (sax));
129836
+ })(exports);
129837
+ } (sax));
129738
129838
  return sax;
129739
129839
  }
129740
129840
 
@@ -130191,8 +130291,8 @@ function requireParser () {
130191
130291
  return parser.parseStringPromise(str);
130192
130292
  };
130193
130293
 
130194
- }).call(commonjsGlobal);
130195
- } (parser));
130294
+ }).call(commonjsGlobal);
130295
+ } (parser));
130196
130296
  return parser;
130197
130297
  }
130198
130298
 
@@ -133421,6 +133521,8 @@ var loadBmfont = function loadFont(opt, cb) {
133421
133521
  }
133422
133522
  };
133423
133523
 
133524
+ var bMFont = /*@__PURE__*/getDefaultExportFromCjs(loadBmfont);
133525
+
133424
133526
  function measureText(font, text) {
133425
133527
  let x = 0;
133426
133528
  for (let i = 0; i < text.length; i++) {
@@ -133432,21 +133534,21 @@ function measureText(font, text) {
133432
133534
  return x;
133433
133535
  }
133434
133536
  function splitLines(font, text, maxWidth) {
133435
- const words = text.split(" ");
133537
+ const words = text.replace(/[\r\n]+/g, " \n").split(" ");
133436
133538
  const lines = [];
133437
133539
  let currentLine = [];
133438
133540
  let longestLine = 0;
133439
133541
  words.forEach(word => {
133440
133542
  const line = [...currentLine, word].join(" ");
133441
133543
  const length = measureText(font, line);
133442
- if (length <= maxWidth) {
133544
+ if (length <= maxWidth && !word.includes("\n")) {
133443
133545
  if (length > longestLine) {
133444
133546
  longestLine = length;
133445
133547
  }
133446
133548
  currentLine.push(word);
133447
133549
  } else {
133448
133550
  lines.push(currentLine);
133449
- currentLine = [word];
133551
+ currentLine = [word.replace("\n", "")];
133450
133552
  }
133451
133553
  });
133452
133554
  lines.push(currentLine);
@@ -133531,7 +133633,7 @@ var print = (() => ({
133531
133633
  cb = cb || function (err, font) {
133532
133634
  if (err) reject(err);else resolve(font);
133533
133635
  };
133534
- loadBmfont(file, (err, font) => {
133636
+ bMFont(file, (err, font) => {
133535
133637
  const chars = {};
133536
133638
  const kernings = {};
133537
133639
  if (err) {
@@ -134672,6 +134774,8 @@ var Jimp = configure({
134672
134774
 
134673
134775
  var jsQR$1 = {exports: {}};
134674
134776
 
134777
+ jsQR$1.exports;
134778
+
134675
134779
  (function (module, exports) {
134676
134780
  (function webpackUniversalModuleDefinition(root, factory) {
134677
134781
  module.exports = factory();
@@ -144741,10 +144845,11 @@ var jsQR$1 = {exports: {}};
144741
144845
 
144742
144846
  /***/ })
144743
144847
  /******/ ])["default"];
144744
- });
144745
- } (jsQR$1));
144848
+ });
144849
+ } (jsQR$1, jsQR$1.exports));
144746
144850
 
144747
- var jsQR = /*@__PURE__*/getDefaultExportFromCjs(jsQR$1.exports);
144851
+ var jsQRExports = jsQR$1.exports;
144852
+ var jsQR = /*@__PURE__*/getDefaultExportFromCjs(jsQRExports);
144748
144853
 
144749
144854
  const decodeQRCodeFromFile = async (filePath) => {
144750
144855
  let decodedString;
@@ -146303,7 +146408,7 @@ const executeWithThrottledResources = async ({ code: emulatedCode, kind = "both"
146303
146408
  var main$2 = {exports: {}};
146304
146409
 
146305
146410
  var name = "dotenv";
146306
- var version$1 = "16.3.1";
146411
+ var version$1 = "16.4.5";
146307
146412
  var description = "Loads environment variables from .env file";
146308
146413
  var main$1 = "lib/main.js";
146309
146414
  var types = "lib/main.d.ts";
@@ -146327,6 +146432,7 @@ var scripts = {
146327
146432
  "lint-readme": "standard-markdown",
146328
146433
  pretest: "npm run lint && npm run dts-check",
146329
146434
  test: "tap tests/*.js --100 -Rspec",
146435
+ "test:coverage": "tap --coverage-report=lcov",
146330
146436
  prerelease: "npm test",
146331
146437
  release: "standard-version"
146332
146438
  };
@@ -146334,7 +146440,7 @@ var repository = {
146334
146440
  type: "git",
146335
146441
  url: "git://github.com/motdotla/dotenv.git"
146336
146442
  };
146337
- var funding = "https://github.com/motdotla/dotenv?sponsor=1";
146443
+ var funding = "https://dotenvx.com";
146338
146444
  var keywords = [
146339
146445
  "dotenv",
146340
146446
  "env",
@@ -146437,11 +146543,13 @@ function _parseVault (options) {
146437
146543
  // Parse .env.vault
146438
146544
  const result = DotenvModule.configDotenv({ path: vaultPath });
146439
146545
  if (!result.parsed) {
146440
- throw new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`)
146546
+ const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
146547
+ err.code = 'MISSING_DATA';
146548
+ throw err
146441
146549
  }
146442
146550
 
146443
146551
  // handle scenario for comma separated keys - for use with key rotation
146444
- // example: DOTENV_KEY="dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenv.org/vault/.env.vault?environment=prod"
146552
+ // example: DOTENV_KEY="dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod"
146445
146553
  const keys = _dotenvKey(options).split(',');
146446
146554
  const length = keys.length;
146447
146555
 
@@ -146505,7 +146613,9 @@ function _instructions (result, dotenvKey) {
146505
146613
  uri = new URL(dotenvKey);
146506
146614
  } catch (error) {
146507
146615
  if (error.code === 'ERR_INVALID_URL') {
146508
- throw new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development')
146616
+ const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development');
146617
+ err.code = 'INVALID_DOTENV_KEY';
146618
+ throw err
146509
146619
  }
146510
146620
 
146511
146621
  throw error
@@ -146514,34 +146624,53 @@ function _instructions (result, dotenvKey) {
146514
146624
  // Get decrypt key
146515
146625
  const key = uri.password;
146516
146626
  if (!key) {
146517
- throw new Error('INVALID_DOTENV_KEY: Missing key part')
146627
+ const err = new Error('INVALID_DOTENV_KEY: Missing key part');
146628
+ err.code = 'INVALID_DOTENV_KEY';
146629
+ throw err
146518
146630
  }
146519
146631
 
146520
146632
  // Get environment
146521
146633
  const environment = uri.searchParams.get('environment');
146522
146634
  if (!environment) {
146523
- throw new Error('INVALID_DOTENV_KEY: Missing environment part')
146635
+ const err = new Error('INVALID_DOTENV_KEY: Missing environment part');
146636
+ err.code = 'INVALID_DOTENV_KEY';
146637
+ throw err
146524
146638
  }
146525
146639
 
146526
146640
  // Get ciphertext payload
146527
146641
  const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
146528
146642
  const ciphertext = result.parsed[environmentKey]; // DOTENV_VAULT_PRODUCTION
146529
146643
  if (!ciphertext) {
146530
- throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`)
146644
+ const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
146645
+ err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT';
146646
+ throw err
146531
146647
  }
146532
146648
 
146533
146649
  return { ciphertext, key }
146534
146650
  }
146535
146651
 
146536
146652
  function _vaultPath (options) {
146537
- let dotenvPath = path.resolve(process.cwd(), '.env');
146653
+ let possibleVaultPath = null;
146538
146654
 
146539
146655
  if (options && options.path && options.path.length > 0) {
146540
- dotenvPath = options.path;
146656
+ if (Array.isArray(options.path)) {
146657
+ for (const filepath of options.path) {
146658
+ if (fs.existsSync(filepath)) {
146659
+ possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`;
146660
+ }
146661
+ }
146662
+ } else {
146663
+ possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`;
146664
+ }
146665
+ } else {
146666
+ possibleVaultPath = path.resolve(process.cwd(), '.env.vault');
146667
+ }
146668
+
146669
+ if (fs.existsSync(possibleVaultPath)) {
146670
+ return possibleVaultPath
146541
146671
  }
146542
146672
 
146543
- // Locate .env.vault
146544
- return dotenvPath.endsWith('.vault') ? dotenvPath : `${dotenvPath}.vault`
146673
+ return null
146545
146674
  }
146546
146675
 
146547
146676
  function _resolveHome (envPath) {
@@ -146564,51 +146693,73 @@ function _configVault (options) {
146564
146693
  }
146565
146694
 
146566
146695
  function configDotenv (options) {
146567
- let dotenvPath = path.resolve(process.cwd(), '.env');
146696
+ const dotenvPath = path.resolve(process.cwd(), '.env');
146568
146697
  let encoding = 'utf8';
146569
146698
  const debug = Boolean(options && options.debug);
146570
146699
 
146571
- if (options) {
146572
- if (options.path != null) {
146573
- dotenvPath = _resolveHome(options.path);
146700
+ if (options && options.encoding) {
146701
+ encoding = options.encoding;
146702
+ } else {
146703
+ if (debug) {
146704
+ _debug('No encoding is specified. UTF-8 is used by default');
146574
146705
  }
146575
- if (options.encoding != null) {
146576
- encoding = options.encoding;
146706
+ }
146707
+
146708
+ let optionPaths = [dotenvPath]; // default, look for .env
146709
+ if (options && options.path) {
146710
+ if (!Array.isArray(options.path)) {
146711
+ optionPaths = [_resolveHome(options.path)];
146712
+ } else {
146713
+ optionPaths = []; // reset default
146714
+ for (const filepath of options.path) {
146715
+ optionPaths.push(_resolveHome(filepath));
146716
+ }
146577
146717
  }
146578
146718
  }
146579
146719
 
146580
- try {
146581
- // Specifying an encoding returns a string instead of a buffer
146582
- const parsed = DotenvModule.parse(fs.readFileSync(dotenvPath, { encoding }));
146720
+ // Build the parsed data in a temporary object (because we need to return it). Once we have the final
146721
+ // parsed data, we will combine it with process.env (or options.processEnv if provided).
146722
+ let lastError;
146723
+ const parsedAll = {};
146724
+ for (const path of optionPaths) {
146725
+ try {
146726
+ // Specifying an encoding returns a string instead of a buffer
146727
+ const parsed = DotenvModule.parse(fs.readFileSync(path, { encoding }));
146583
146728
 
146584
- let processEnv = process.env;
146585
- if (options && options.processEnv != null) {
146586
- processEnv = options.processEnv;
146729
+ DotenvModule.populate(parsedAll, parsed, options);
146730
+ } catch (e) {
146731
+ if (debug) {
146732
+ _debug(`Failed to load ${path} ${e.message}`);
146733
+ }
146734
+ lastError = e;
146587
146735
  }
146736
+ }
146588
146737
 
146589
- DotenvModule.populate(processEnv, parsed, options);
146738
+ let processEnv = process.env;
146739
+ if (options && options.processEnv != null) {
146740
+ processEnv = options.processEnv;
146741
+ }
146590
146742
 
146591
- return { parsed }
146592
- } catch (e) {
146593
- if (debug) {
146594
- _debug(`Failed to load ${dotenvPath} ${e.message}`);
146595
- }
146743
+ DotenvModule.populate(processEnv, parsedAll, options);
146596
146744
 
146597
- return { error: e }
146745
+ if (lastError) {
146746
+ return { parsed: parsedAll, error: lastError }
146747
+ } else {
146748
+ return { parsed: parsedAll }
146598
146749
  }
146599
146750
  }
146600
146751
 
146601
146752
  // Populates process.env from .env file
146602
146753
  function config (options) {
146603
- const vaultPath = _vaultPath(options);
146604
-
146605
146754
  // fallback to original dotenv if DOTENV_KEY is not set
146606
146755
  if (_dotenvKey(options).length === 0) {
146607
146756
  return DotenvModule.configDotenv(options)
146608
146757
  }
146609
146758
 
146759
+ const vaultPath = _vaultPath(options);
146760
+
146610
146761
  // dotenvKey exists but .env.vault file does not exist
146611
- if (!fs.existsSync(vaultPath)) {
146762
+ if (!vaultPath) {
146612
146763
  _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
146613
146764
 
146614
146765
  return DotenvModule.configDotenv(options)
@@ -146621,9 +146772,9 @@ function decrypt (encrypted, keyStr) {
146621
146772
  const key = Buffer.from(keyStr.slice(-64), 'hex');
146622
146773
  let ciphertext = Buffer.from(encrypted, 'base64');
146623
146774
 
146624
- const nonce = ciphertext.slice(0, 12);
146625
- const authTag = ciphertext.slice(-16);
146626
- ciphertext = ciphertext.slice(12, -16);
146775
+ const nonce = ciphertext.subarray(0, 12);
146776
+ const authTag = ciphertext.subarray(-16);
146777
+ ciphertext = ciphertext.subarray(12, -16);
146627
146778
 
146628
146779
  try {
146629
146780
  const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce);
@@ -146635,14 +146786,14 @@ function decrypt (encrypted, keyStr) {
146635
146786
  const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data';
146636
146787
 
146637
146788
  if (isRange || invalidKeyLength) {
146638
- const msg = 'INVALID_DOTENV_KEY: It must be 64 characters long (or more)';
146639
- throw new Error(msg)
146789
+ const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)');
146790
+ err.code = 'INVALID_DOTENV_KEY';
146791
+ throw err
146640
146792
  } else if (decryptionFailed) {
146641
- const msg = 'DECRYPTION_FAILED: Please check your DOTENV_KEY';
146642
- throw new Error(msg)
146793
+ const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY');
146794
+ err.code = 'DECRYPTION_FAILED';
146795
+ throw err
146643
146796
  } else {
146644
- console.error('Error: ', error.code);
146645
- console.error('Error: ', error.message);
146646
146797
  throw error
146647
146798
  }
146648
146799
  }
@@ -146654,7 +146805,9 @@ function populate (processEnv, parsed, options = {}) {
146654
146805
  const override = Boolean(options && options.override);
146655
146806
 
146656
146807
  if (typeof parsed !== 'object') {
146657
- throw new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate')
146808
+ const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate');
146809
+ err.code = 'OBJECT_REQUIRED';
146810
+ throw err
146658
146811
  }
146659
146812
 
146660
146813
  // Set process.env
@@ -146697,82 +146850,94 @@ main$2.exports.populate = DotenvModule.populate;
146697
146850
 
146698
146851
  main$2.exports = DotenvModule;
146699
146852
 
146853
+ var mainExports = main$2.exports;
146854
+ var dotenv = /*@__PURE__*/getDefaultExportFromCjs(mainExports);
146855
+
146700
146856
  var main = {};
146701
146857
 
146702
- // like String.prototype.search but returns the last index
146703
- function _searchLast (str, rgx) {
146704
- const matches = Array.from(str.matchAll(rgx));
146705
- return matches.length > 0 ? matches.slice(-1)[0].index : -1
146706
- }
146858
+ // * /
146859
+ // * (\\)? # is it escaped with a backslash?
146860
+ // * (\$) # literal $
146861
+ // * (?!\() # shouldnt be followed by parenthesis
146862
+ // * (\{?) # first brace wrap opening
146863
+ // * ([\w.]+) # key
146864
+ // * (?::-((?:\$\{(?:\$\{(?:\$\{[^}]*\}|[^}])*}|[^}])*}|[^}])+))? # optional default nested 3 times
146865
+ // * (\}?) # last brace warp closing
146866
+ // * /xi
146707
146867
 
146708
- function _interpolate (envValue, environment, config) {
146709
- // find the last unescaped dollar sign in the
146710
- // value so that we can evaluate it
146711
- const lastUnescapedDollarSignIndex = _searchLast(envValue, /(?!(?<=\\))\$/g);
146868
+ const DOTENV_SUBSTITUTION_REGEX = /(\\)?(\$)(?!\()(\{?)([\w.]+)(?::?-((?:\$\{(?:\$\{(?:\$\{[^}]*\}|[^}])*}|[^}])*}|[^}])+))?(\}?)/gi;
146712
146869
 
146713
- // If we couldn't match any unescaped dollar sign
146714
- // let's return the string as is
146715
- if (lastUnescapedDollarSignIndex === -1) return envValue
146870
+ function _resolveEscapeSequences (value) {
146871
+ return value.replace(/\\\$/g, '$')
146872
+ }
146716
146873
 
146717
- // This is the right-most group of variables in the string
146718
- const rightMostGroup = envValue.slice(lastUnescapedDollarSignIndex);
146874
+ function interpolate (value, processEnv, parsed) {
146875
+ return value.replace(DOTENV_SUBSTITUTION_REGEX, (match, escaped, dollarSign, openBrace, key, defaultValue, closeBrace) => {
146876
+ if (escaped === '\\') {
146877
+ return match.slice(1)
146878
+ } else {
146879
+ if (processEnv[key]) {
146880
+ if (processEnv[key] === parsed[key]) {
146881
+ return processEnv[key]
146882
+ } else {
146883
+ // scenario: PASSWORD_EXPAND_NESTED=${PASSWORD_EXPAND}
146884
+ return interpolate(processEnv[key], processEnv, parsed)
146885
+ }
146886
+ }
146719
146887
 
146720
- /**
146721
- * This finds the inner most variable/group divided
146722
- * by variable name and default value (if present)
146723
- * (
146724
- * (?!(?<=\\))\$ // only match dollar signs that are not escaped
146725
- * {? // optional opening curly brace
146726
- * ([\w]+) // match the variable name
146727
- * (?::-([^}\\]*))? // match an optional default value
146728
- * }? // optional closing curly brace
146729
- * )
146730
- */
146731
- const matchGroup = /((?!(?<=\\))\${?([\w]+)(?::-([^}\\]*))?}?)/;
146732
- const match = rightMostGroup.match(matchGroup);
146733
-
146734
- if (match != null) {
146735
- const [, group, variableName, defaultValue] = match;
146736
-
146737
- return _interpolate(
146738
- envValue.replace(
146739
- group,
146740
- environment[variableName] ||
146741
- defaultValue ||
146742
- config.parsed[variableName] ||
146743
- ''
146744
- ),
146745
- environment,
146746
- config
146747
- )
146748
- }
146888
+ if (parsed[key]) {
146889
+ // avoid recursion from EXPAND_SELF=$EXPAND_SELF
146890
+ if (parsed[key] === value) {
146891
+ return parsed[key]
146892
+ } else {
146893
+ return interpolate(parsed[key], processEnv, parsed)
146894
+ }
146895
+ }
146749
146896
 
146750
- return envValue
146751
- }
146897
+ if (defaultValue) {
146898
+ if (defaultValue.startsWith('$')) {
146899
+ return interpolate(defaultValue, processEnv, parsed)
146900
+ } else {
146901
+ return defaultValue
146902
+ }
146903
+ }
146752
146904
 
146753
- function _resolveEscapeSequences (value) {
146754
- return value.replace(/\\\$/g, '$')
146905
+ return ''
146906
+ }
146907
+ })
146755
146908
  }
146756
146909
 
146757
- function expand (config) {
146758
- // if ignoring process.env, use a blank object
146759
- const environment = config.ignoreProcessEnv ? {} : process.env;
146910
+ function expand (options) {
146911
+ let processEnv = process.env;
146912
+ if (options && options.processEnv != null) {
146913
+ processEnv = options.processEnv;
146914
+ }
146760
146915
 
146761
- for (const configKey in config.parsed) {
146762
- const value = Object.prototype.hasOwnProperty.call(environment, configKey)
146763
- ? environment[configKey]
146764
- : config.parsed[configKey];
146916
+ for (const key in options.parsed) {
146917
+ let value = options.parsed[key];
146765
146918
 
146766
- config.parsed[configKey] = _resolveEscapeSequences(
146767
- _interpolate(value, environment, config)
146768
- );
146919
+ const inProcessEnv = Object.prototype.hasOwnProperty.call(processEnv, key);
146920
+ if (inProcessEnv) {
146921
+ if (processEnv[key] === options.parsed[key]) {
146922
+ // assume was set to processEnv from the .env file if the values match and therefore interpolate
146923
+ value = interpolate(value, processEnv, options.parsed);
146924
+ } else {
146925
+ // do not interpolate - assume processEnv had the intended value even if containing a $.
146926
+ value = processEnv[key];
146927
+ }
146928
+ } else {
146929
+ // not inProcessEnv so assume interpolation for this .env key
146930
+ value = interpolate(value, processEnv, options.parsed);
146931
+ }
146932
+
146933
+ options.parsed[key] = _resolveEscapeSequences(value);
146769
146934
  }
146770
146935
 
146771
- for (const processKey in config.parsed) {
146772
- environment[processKey] = config.parsed[processKey];
146936
+ for (const processKey in options.parsed) {
146937
+ processEnv[processKey] = options.parsed[processKey];
146773
146938
  }
146774
146939
 
146775
- return config
146940
+ return options
146776
146941
  }
146777
146942
 
146778
146943
  main.expand = expand;
@@ -146780,12 +146945,12 @@ main.expand = expand;
146780
146945
  // @ts-check
146781
146946
  var _a, _b;
146782
146947
  process.env.TEST_ENV = (_a = process.env.TEST_ENV) !== null && _a !== void 0 ? _a : ENVIRONMENT.development;
146783
- const env = main$2.exports.config({
146948
+ const env = dotenv.config({
146784
146949
  path: `./e2e/config/.env.${process.env.TEST_ENV}`,
146785
146950
  });
146786
146951
  main.expand(env);
146787
146952
  if (fs$d.existsSync("./e2e/config/.env.local")) {
146788
- const localEnv = main$2.exports.config({
146953
+ const localEnv = dotenv.config({
146789
146954
  path: "./e2e/config/.env.local",
146790
146955
  });
146791
146956
  main.expand(localEnv);