videomail-client 13.6.10 → 13.6.11

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.
@@ -6046,7 +6046,7 @@ var __webpack_modules__ = {
6046
6046
  val = options.strictNullHandling ? null : '';
6047
6047
  } else {
6048
6048
  key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
6049
- val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function(encodedVal) {
6049
+ if (null !== key) val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function(encodedVal) {
6050
6050
  return options.decoder(encodedVal, defaults.decoder, charset, 'value');
6051
6051
  });
6052
6052
  }
@@ -6054,9 +6054,11 @@ var __webpack_modules__ = {
6054
6054
  if (part.indexOf('[]=') > -1) val = isArray(val) ? [
6055
6055
  val
6056
6056
  ] : val;
6057
- var existing = has.call(obj, key);
6058
- if (existing && 'combine' === options.duplicates) obj[key] = utils.combine(obj[key], val);
6059
- else if (!existing || 'last' === options.duplicates) obj[key] = val;
6057
+ if (null !== key) {
6058
+ var existing = has.call(obj, key);
6059
+ if (existing && 'combine' === options.duplicates) obj[key] = utils.combine(obj[key], val, options.arrayLimit, options.plainObjects);
6060
+ else if (!existing || 'last' === options.duplicates) obj[key] = val;
6061
+ }
6060
6062
  }
6061
6063
  return obj;
6062
6064
  };
@@ -6070,7 +6072,7 @@ var __webpack_modules__ = {
6070
6072
  for(var i = chain.length - 1; i >= 0; --i){
6071
6073
  var obj;
6072
6074
  var root = chain[i];
6073
- if ('[]' === root && options.parseArrays) obj = options.allowEmptyArrays && ('' === leaf || options.strictNullHandling && null === leaf) ? [] : utils.combine([], leaf);
6075
+ if ('[]' === root && options.parseArrays) obj = utils.isOverflow(leaf) ? leaf : options.allowEmptyArrays && ('' === leaf || options.strictNullHandling && null === leaf) ? [] : utils.combine([], leaf, options.arrayLimit, options.plainObjects);
6074
6076
  else {
6075
6077
  obj = options.plainObjects ? {
6076
6078
  __proto__: null
@@ -6091,12 +6093,19 @@ var __webpack_modules__ = {
6091
6093
  }
6092
6094
  return leaf;
6093
6095
  };
6094
- var parseKeys = function(givenKey, val, options, valuesParsed) {
6095
- if (!givenKey) return;
6096
+ var splitKeyIntoSegments = function(givenKey, options) {
6096
6097
  var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
6098
+ if (options.depth <= 0) {
6099
+ if (!options.plainObjects && has.call(Object.prototype, key)) {
6100
+ if (!options.allowPrototypes) return;
6101
+ }
6102
+ return [
6103
+ key
6104
+ ];
6105
+ }
6097
6106
  var brackets = /(\[[^[\]]*])/;
6098
6107
  var child = /(\[[^[\]]*])/g;
6099
- var segment = options.depth > 0 && brackets.exec(key);
6108
+ var segment = brackets.exec(key);
6100
6109
  var parent = segment ? key.slice(0, segment.index) : key;
6101
6110
  var keys = [];
6102
6111
  if (parent) {
@@ -6106,9 +6115,10 @@ var __webpack_modules__ = {
6106
6115
  keys.push(parent);
6107
6116
  }
6108
6117
  var i = 0;
6109
- while(options.depth > 0 && null !== (segment = child.exec(key)) && i < options.depth){
6118
+ while(null !== (segment = child.exec(key)) && i < options.depth){
6110
6119
  i += 1;
6111
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
6120
+ var segmentContent = segment[1].slice(1, -1);
6121
+ if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
6112
6122
  if (!options.allowPrototypes) return;
6113
6123
  }
6114
6124
  keys.push(segment[1]);
@@ -6117,6 +6127,12 @@ var __webpack_modules__ = {
6117
6127
  if (true === options.strictDepth) throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
6118
6128
  keys.push('[' + key.slice(segment.index) + ']');
6119
6129
  }
6130
+ return keys;
6131
+ };
6132
+ var parseKeys = function(givenKey, val, options, valuesParsed) {
6133
+ if (!givenKey) return;
6134
+ var keys = splitKeyIntoSegments(givenKey, options);
6135
+ if (!keys) return;
6120
6136
  return parseObject(keys, val, options, valuesParsed);
6121
6137
  };
6122
6138
  var normalizeParseOptions = function(opts) {
@@ -6367,8 +6383,23 @@ var __webpack_modules__ = {
6367
6383
  "./node_modules/qs/lib/utils.js" (module, __unused_rspack_exports, __webpack_require__) {
6368
6384
  "use strict";
6369
6385
  var formats = __webpack_require__("./node_modules/qs/lib/formats.js");
6386
+ var getSideChannel = __webpack_require__("./node_modules/side-channel/index.js");
6370
6387
  var has = Object.prototype.hasOwnProperty;
6371
6388
  var isArray = Array.isArray;
6389
+ var overflowChannel = getSideChannel();
6390
+ var markOverflow = function(obj, maxIndex) {
6391
+ overflowChannel.set(obj, maxIndex);
6392
+ return obj;
6393
+ };
6394
+ var isOverflow = function(obj) {
6395
+ return overflowChannel.has(obj);
6396
+ };
6397
+ var getMaxIndex = function(obj) {
6398
+ return overflowChannel.get(obj);
6399
+ };
6400
+ var setMaxIndex = function(obj, maxIndex) {
6401
+ overflowChannel.set(obj, maxIndex);
6402
+ };
6372
6403
  var hexTable = function() {
6373
6404
  var array = [];
6374
6405
  for(var i = 0; i < 256; ++i)array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
@@ -6400,12 +6431,32 @@ var __webpack_modules__ = {
6400
6431
  target,
6401
6432
  source
6402
6433
  ];
6403
- else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) target[source] = true;
6434
+ else if (isOverflow(target)) {
6435
+ var newIndex = getMaxIndex(target) + 1;
6436
+ target[newIndex] = source;
6437
+ setMaxIndex(target, newIndex);
6438
+ } else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) target[source] = true;
6404
6439
  return target;
6405
6440
  }
6406
- if (!target || 'object' != typeof target) return [
6407
- target
6408
- ].concat(source);
6441
+ if (!target || 'object' != typeof target) {
6442
+ if (isOverflow(source)) {
6443
+ var sourceKeys = Object.keys(source);
6444
+ var result = options && options.plainObjects ? {
6445
+ __proto__: null,
6446
+ 0: target
6447
+ } : {
6448
+ 0: target
6449
+ };
6450
+ for(var m = 0; m < sourceKeys.length; m++){
6451
+ var oldKey = parseInt(sourceKeys[m], 10);
6452
+ result[oldKey + 1] = source[sourceKeys[m]];
6453
+ }
6454
+ return markOverflow(result, getMaxIndex(source) + 1);
6455
+ }
6456
+ return [
6457
+ target
6458
+ ].concat(source);
6459
+ }
6409
6460
  var mergeTarget = target;
6410
6461
  if (isArray(target) && !isArray(source)) mergeTarget = arrayToObject(target, options);
6411
6462
  if (isArray(target) && isArray(source)) {
@@ -6515,8 +6566,18 @@ var __webpack_modules__ = {
6515
6566
  if (!obj || 'object' != typeof obj) return false;
6516
6567
  return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
6517
6568
  };
6518
- var combine = function(a, b) {
6519
- return [].concat(a, b);
6569
+ var combine = function(a, b, arrayLimit, plainObjects) {
6570
+ if (isOverflow(a)) {
6571
+ var newIndex = getMaxIndex(a) + 1;
6572
+ a[newIndex] = b;
6573
+ setMaxIndex(a, newIndex);
6574
+ return a;
6575
+ }
6576
+ var result = [].concat(a, b);
6577
+ if (result.length > arrayLimit) return markOverflow(arrayToObject(result, {
6578
+ plainObjects: plainObjects
6579
+ }), result.length - 1);
6580
+ return result;
6520
6581
  };
6521
6582
  var maybeMap = function(val, fn) {
6522
6583
  if (isArray(val)) {
@@ -6534,6 +6595,7 @@ var __webpack_modules__ = {
6534
6595
  decode: decode,
6535
6596
  encode: encode,
6536
6597
  isBuffer: isBuffer,
6598
+ isOverflow: isOverflow,
6537
6599
  isRegExp: isRegExp,
6538
6600
  maybeMap: maybeMap,
6539
6601
  merge: merge
@@ -7187,7 +7249,12 @@ var __webpack_modules__ = {
7187
7249
  this.emit('request', this);
7188
7250
  xhr.send(void 0 === data ? null : data);
7189
7251
  };
7190
- request.agent = ()=>new Agent();
7252
+ const proxyAgent = new Proxy(Agent, {
7253
+ apply (target, thisArg, argumentsList) {
7254
+ return new target(...argumentsList);
7255
+ }
7256
+ });
7257
+ request.agent = proxyAgent;
7191
7258
  for (const method of [
7192
7259
  'GET',
7193
7260
  'POST',
@@ -10664,7 +10731,7 @@ var __webpack_exports__ = {};
10664
10731
  var client = __webpack_require__("./node_modules/superagent/lib/client.js");
10665
10732
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10666
10733
  var package_namespaceObject = {
10667
- rE: "13.6.10"
10734
+ rE: "13.6.11"
10668
10735
  };
10669
10736
  function isAudioEnabled(options) {
10670
10737
  return Boolean(options.audio.enabled);
@@ -16450,7 +16517,7 @@ var __webpack_exports__ = {};
16450
16517
  return dimension;
16451
16518
  }
16452
16519
  const dimensions_calculateHeight = calculateHeight;
16453
- function calculateWidth(responsive, videoHeight, options, ratio) {
16520
+ function calculateWidth(responsive, options, videoHeight, ratio) {
16454
16521
  const dimension = {
16455
16522
  unit: "px"
16456
16523
  };
@@ -16846,14 +16913,11 @@ var __webpack_exports__ = {};
16846
16913
  return videoWidth && videoWidth > 0;
16847
16914
  }
16848
16915
  getRawWidth(responsive) {
16849
- let rawWidth = this.getVideoWidth();
16916
+ let rawWidth;
16850
16917
  const widthDimension = {
16851
16918
  unit: "px"
16852
16919
  };
16853
- if (this.options.video.width || this.options.video.height) if (responsive) {
16854
- const dimension = this.recorder.calculateWidth(responsive);
16855
- rawWidth = dimension.value;
16856
- } else rawWidth = this.options.video.width;
16920
+ rawWidth = responsive ? this.getVideoWidth() : this.options.video.width ? this.options.video.width : this.getVideoWidth();
16857
16921
  if (responsive) {
16858
16922
  const widthDimension = this.recorder.limitWidth(rawWidth);
16859
16923
  rawWidth = null == widthDimension ? void 0 : widthDimension.value;
@@ -16863,32 +16927,12 @@ var __webpack_exports__ = {};
16863
16927
  }
16864
16928
  getRawHeight(responsive) {
16865
16929
  let rawHeight;
16866
- if (this.options.video.width || this.options.video.height) {
16867
- const heightDimension = this.recorder.calculateHeight(responsive);
16868
- rawHeight = heightDimension.value;
16869
- if (void 0 === rawHeight) throw error_createError({
16870
- message: "Undefined height",
16871
- explanation: "Calculated raw height cannot be undefined.",
16872
- options: this.options
16873
- });
16874
- if (0 !== rawHeight && rawHeight < 1) throw error_createError({
16875
- message: "Invalid height",
16876
- explanation: `Calculated raw height of ${rawHeight} cannot be less than 1!`,
16877
- options: this.options
16878
- });
16879
- } else {
16880
- rawHeight = this.getVideoHeight();
16881
- if (void 0 === rawHeight) throw error_createError({
16882
- message: "Bad dimensions",
16883
- explanation: "Raw video height from DOM element cannot be undefined.",
16884
- options: this.options
16885
- });
16886
- if (0 !== rawHeight && rawHeight < 1) throw error_createError({
16887
- message: "Bad dimensions",
16888
- explanation: "Raw video height from DOM element cannot be less than 1.",
16889
- options: this.options
16890
- });
16891
- }
16930
+ if (responsive) {
16931
+ rawHeight = this.options.video.height || this.getVideoHeight();
16932
+ const ratio = this.recorder.getRatio();
16933
+ const rawWidth = this.getRawWidth(responsive);
16934
+ if (void 0 !== ratio && rawWidth.value) rawHeight = rawWidth.value * ratio;
16935
+ } else rawHeight = this.options.video.height ? this.options.video.height : this.getVideoHeight();
16892
16936
  if (responsive) {
16893
16937
  const heightDimension = this.recorder.limitHeight(rawHeight);
16894
16938
  rawHeight = heightDimension.value;
@@ -17843,8 +17887,8 @@ var __webpack_exports__ = {};
17843
17887
  if (void 0 !== height && this.options.video.width) {
17844
17888
  const ratio = this.getRatio();
17845
17889
  if (void 0 !== ratio) {
17846
- const maxHeight = this.options.video.width * ratio;
17847
- height = Math.min(maxHeight, height);
17890
+ const idealHeight = this.options.video.width * ratio;
17891
+ height = Math.min(idealHeight, height);
17848
17892
  }
17849
17893
  }
17850
17894
  recorderHeight = {
@@ -17875,7 +17919,8 @@ var __webpack_exports__ = {};
17875
17919
  let videoHeight;
17876
17920
  if (this.userMedia) videoHeight = this.userMedia.getVideoHeight();
17877
17921
  else if (this.recorderElement) videoHeight = this.recorderElement.videoHeight || this.recorderElement.height;
17878
- return dimensions_calculateWidth(responsive, videoHeight, this.options, this.getRatio());
17922
+ const ratio = this.getRatio();
17923
+ return dimensions_calculateWidth(responsive, this.options, videoHeight, ratio);
17879
17924
  }
17880
17925
  calculateHeight(responsive) {
17881
17926
  let videoDimension;
@@ -17964,7 +18009,7 @@ var __webpack_exports__ = {};
17964
18009
  height = this.videomail.height;
17965
18010
  if (width) ratio = height / width;
17966
18011
  }
17967
- if (!width) width = dimensions_calculateWidth(responsive, videoHeight, this.options, ratio);
18012
+ if (!width) width = dimensions_calculateWidth(responsive, this.options, videoHeight, ratio);
17968
18013
  if (!height) {
17969
18014
  let element = this.visuals.getElement();
17970
18015
  if (!element) element = document.body;
package/dist/esm/index.js CHANGED
@@ -3563,7 +3563,7 @@ const constants = {
3563
3563
  }
3564
3564
  };
3565
3565
  var package_namespaceObject = {
3566
- rE: "13.6.10"
3566
+ rE: "13.6.11"
3567
3567
  };
3568
3568
  function isAudioEnabled(options) {
3569
3569
  return Boolean(options.audio.enabled);
@@ -5774,7 +5774,7 @@ function calculateHeight(responsive, videoWidth, options, ratio, element) {
5774
5774
  return dimension;
5775
5775
  }
5776
5776
  const dimensions_calculateHeight = calculateHeight;
5777
- function calculateWidth(responsive, videoHeight, options, ratio) {
5777
+ function calculateWidth(responsive, options, videoHeight, ratio) {
5778
5778
  const dimension = {
5779
5779
  unit: "px"
5780
5780
  };
@@ -6140,14 +6140,11 @@ class UserMedia extends util_Despot {
6140
6140
  return videoWidth && videoWidth > 0;
6141
6141
  }
6142
6142
  getRawWidth(responsive) {
6143
- let rawWidth = this.getVideoWidth();
6143
+ let rawWidth;
6144
6144
  const widthDimension = {
6145
6145
  unit: "px"
6146
6146
  };
6147
- if (this.options.video.width || this.options.video.height) if (responsive) {
6148
- const dimension = this.recorder.calculateWidth(responsive);
6149
- rawWidth = dimension.value;
6150
- } else rawWidth = this.options.video.width;
6147
+ rawWidth = responsive ? this.getVideoWidth() : this.options.video.width ? this.options.video.width : this.getVideoWidth();
6151
6148
  if (responsive) {
6152
6149
  const widthDimension = this.recorder.limitWidth(rawWidth);
6153
6150
  rawWidth = widthDimension?.value;
@@ -6157,32 +6154,12 @@ class UserMedia extends util_Despot {
6157
6154
  }
6158
6155
  getRawHeight(responsive) {
6159
6156
  let rawHeight;
6160
- if (this.options.video.width || this.options.video.height) {
6161
- const heightDimension = this.recorder.calculateHeight(responsive);
6162
- rawHeight = heightDimension.value;
6163
- if (void 0 === rawHeight) throw error_createError({
6164
- message: "Undefined height",
6165
- explanation: "Calculated raw height cannot be undefined.",
6166
- options: this.options
6167
- });
6168
- if (0 !== rawHeight && rawHeight < 1) throw error_createError({
6169
- message: "Invalid height",
6170
- explanation: `Calculated raw height of ${rawHeight} cannot be less than 1!`,
6171
- options: this.options
6172
- });
6173
- } else {
6174
- rawHeight = this.getVideoHeight();
6175
- if (void 0 === rawHeight) throw error_createError({
6176
- message: "Bad dimensions",
6177
- explanation: "Raw video height from DOM element cannot be undefined.",
6178
- options: this.options
6179
- });
6180
- if (0 !== rawHeight && rawHeight < 1) throw error_createError({
6181
- message: "Bad dimensions",
6182
- explanation: "Raw video height from DOM element cannot be less than 1.",
6183
- options: this.options
6184
- });
6185
- }
6157
+ if (responsive) {
6158
+ rawHeight = this.options.video.height || this.getVideoHeight();
6159
+ const ratio = this.recorder.getRatio();
6160
+ const rawWidth = this.getRawWidth(responsive);
6161
+ if (void 0 !== ratio && rawWidth.value) rawHeight = rawWidth.value * ratio;
6162
+ } else rawHeight = this.options.video.height ? this.options.video.height : this.getVideoHeight();
6186
6163
  if (responsive) {
6187
6164
  const heightDimension = this.recorder.limitHeight(rawHeight);
6188
6165
  rawHeight = heightDimension.value;
@@ -7139,8 +7116,8 @@ class Recorder extends util_Despot {
7139
7116
  if (void 0 !== height && this.options.video.width) {
7140
7117
  const ratio = this.getRatio();
7141
7118
  if (void 0 !== ratio) {
7142
- const maxHeight = this.options.video.width * ratio;
7143
- height = Math.min(maxHeight, height);
7119
+ const idealHeight = this.options.video.width * ratio;
7120
+ height = Math.min(idealHeight, height);
7144
7121
  }
7145
7122
  }
7146
7123
  recorderHeight = {
@@ -7171,7 +7148,8 @@ class Recorder extends util_Despot {
7171
7148
  let videoHeight;
7172
7149
  if (this.userMedia) videoHeight = this.userMedia.getVideoHeight();
7173
7150
  else if (this.recorderElement) videoHeight = this.recorderElement.videoHeight || this.recorderElement.height;
7174
- return dimensions_calculateWidth(responsive, videoHeight, this.options, this.getRatio());
7151
+ const ratio = this.getRatio();
7152
+ return dimensions_calculateWidth(responsive, this.options, videoHeight, ratio);
7175
7153
  }
7176
7154
  calculateHeight(responsive) {
7177
7155
  let videoDimension;
@@ -7251,7 +7229,7 @@ class Replay extends util_Despot {
7251
7229
  height = this.videomail.height;
7252
7230
  if (width) ratio = height / width;
7253
7231
  }
7254
- if (!width) width = dimensions_calculateWidth(responsive, videoHeight, this.options, ratio);
7232
+ if (!width) width = dimensions_calculateWidth(responsive, this.options, videoHeight, ratio);
7255
7233
  if (!height) {
7256
7234
  let element = this.visuals.getElement();
7257
7235
  if (!element) element = document.body;
@@ -1,4 +1,4 @@
1
1
  import { Dimension } from "../../../types/dimension";
2
2
  import { VideomailClientOptions } from "../../../types/options";
3
- declare function calculateWidth(responsive: boolean, videoHeight: number, options: VideomailClientOptions, ratio?: number): Dimension;
3
+ declare function calculateWidth(responsive: boolean, options: VideomailClientOptions, videoHeight?: number, ratio?: number): Dimension;
4
4
  export default calculateWidth;
@@ -42,7 +42,7 @@ declare class Container extends Despot {
42
42
  private hideMySelf;
43
43
  private submitVideomail;
44
44
  limitWidth(width?: number): import("../types/dimension").Dimension | undefined;
45
- limitHeight(height: number): import("../types/dimension").Dimension;
45
+ limitHeight(height: number | undefined): import("../types/dimension").Dimension;
46
46
  private areVisualsHidden;
47
47
  hasElement(): boolean;
48
48
  getSubmitButton(): HTMLButtonElement | undefined;
@@ -103,14 +103,14 @@ declare class Recorder extends Despot {
103
103
  isUnloaded(): boolean | undefined;
104
104
  getRecorderWidth(responsive: boolean): Dimension | undefined;
105
105
  getRecorderHeight(responsive: boolean, useBoundingClientRect?: boolean): Dimension | undefined;
106
- private getRatio;
106
+ getRatio(): number | undefined;
107
107
  calculateWidth(responsive: boolean): Dimension;
108
108
  calculateHeight(responsive: boolean): Dimension;
109
109
  getRawVisualUserMedia(): HTMLVideoElement | null | undefined;
110
110
  isConnected(): boolean;
111
111
  isConnecting(): boolean;
112
112
  limitWidth(width?: number): Dimension | undefined;
113
- limitHeight(height: number): Dimension;
113
+ limitHeight(height: number | undefined): Dimension;
114
114
  isUserMediaLoaded(): boolean | undefined;
115
115
  }
116
116
  export default Recorder;
@@ -56,7 +56,7 @@ declare class Visuals extends Despot {
56
56
  getRecorderWidth(responsive: boolean): Dimension | undefined;
57
57
  getRecorderHeight(responsive: boolean, useBoundingClientRect?: boolean): Dimension | undefined;
58
58
  limitWidth(width?: number): Dimension | undefined;
59
- limitHeight(height: number): Dimension;
59
+ limitHeight(height: number | undefined): Dimension;
60
60
  getReplay(): Replay;
61
61
  getBoundingClientRect(): DOMRect | undefined;
62
62
  checkTimer(elapsedTime: number): void;
package/dist/umd/index.js CHANGED
@@ -6052,7 +6052,7 @@
6052
6052
  val = options.strictNullHandling ? null : '';
6053
6053
  } else {
6054
6054
  key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
6055
- val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function(encodedVal) {
6055
+ if (null !== key) val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function(encodedVal) {
6056
6056
  return options.decoder(encodedVal, defaults.decoder, charset, 'value');
6057
6057
  });
6058
6058
  }
@@ -6060,9 +6060,11 @@
6060
6060
  if (part.indexOf('[]=') > -1) val = isArray(val) ? [
6061
6061
  val
6062
6062
  ] : val;
6063
- var existing = has.call(obj, key);
6064
- if (existing && 'combine' === options.duplicates) obj[key] = utils.combine(obj[key], val);
6065
- else if (!existing || 'last' === options.duplicates) obj[key] = val;
6063
+ if (null !== key) {
6064
+ var existing = has.call(obj, key);
6065
+ if (existing && 'combine' === options.duplicates) obj[key] = utils.combine(obj[key], val, options.arrayLimit, options.plainObjects);
6066
+ else if (!existing || 'last' === options.duplicates) obj[key] = val;
6067
+ }
6066
6068
  }
6067
6069
  return obj;
6068
6070
  };
@@ -6076,7 +6078,7 @@
6076
6078
  for(var i = chain.length - 1; i >= 0; --i){
6077
6079
  var obj;
6078
6080
  var root = chain[i];
6079
- if ('[]' === root && options.parseArrays) obj = options.allowEmptyArrays && ('' === leaf || options.strictNullHandling && null === leaf) ? [] : utils.combine([], leaf);
6081
+ if ('[]' === root && options.parseArrays) obj = utils.isOverflow(leaf) ? leaf : options.allowEmptyArrays && ('' === leaf || options.strictNullHandling && null === leaf) ? [] : utils.combine([], leaf, options.arrayLimit, options.plainObjects);
6080
6082
  else {
6081
6083
  obj = options.plainObjects ? {
6082
6084
  __proto__: null
@@ -6097,12 +6099,19 @@
6097
6099
  }
6098
6100
  return leaf;
6099
6101
  };
6100
- var parseKeys = function(givenKey, val, options, valuesParsed) {
6101
- if (!givenKey) return;
6102
+ var splitKeyIntoSegments = function(givenKey, options) {
6102
6103
  var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
6104
+ if (options.depth <= 0) {
6105
+ if (!options.plainObjects && has.call(Object.prototype, key)) {
6106
+ if (!options.allowPrototypes) return;
6107
+ }
6108
+ return [
6109
+ key
6110
+ ];
6111
+ }
6103
6112
  var brackets = /(\[[^[\]]*])/;
6104
6113
  var child = /(\[[^[\]]*])/g;
6105
- var segment = options.depth > 0 && brackets.exec(key);
6114
+ var segment = brackets.exec(key);
6106
6115
  var parent = segment ? key.slice(0, segment.index) : key;
6107
6116
  var keys = [];
6108
6117
  if (parent) {
@@ -6112,9 +6121,10 @@
6112
6121
  keys.push(parent);
6113
6122
  }
6114
6123
  var i = 0;
6115
- while(options.depth > 0 && null !== (segment = child.exec(key)) && i < options.depth){
6124
+ while(null !== (segment = child.exec(key)) && i < options.depth){
6116
6125
  i += 1;
6117
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
6126
+ var segmentContent = segment[1].slice(1, -1);
6127
+ if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
6118
6128
  if (!options.allowPrototypes) return;
6119
6129
  }
6120
6130
  keys.push(segment[1]);
@@ -6123,6 +6133,12 @@
6123
6133
  if (true === options.strictDepth) throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
6124
6134
  keys.push('[' + key.slice(segment.index) + ']');
6125
6135
  }
6136
+ return keys;
6137
+ };
6138
+ var parseKeys = function(givenKey, val, options, valuesParsed) {
6139
+ if (!givenKey) return;
6140
+ var keys = splitKeyIntoSegments(givenKey, options);
6141
+ if (!keys) return;
6126
6142
  return parseObject(keys, val, options, valuesParsed);
6127
6143
  };
6128
6144
  var normalizeParseOptions = function(opts) {
@@ -6373,8 +6389,23 @@
6373
6389
  "./node_modules/qs/lib/utils.js" (module1, __unused_rspack_exports, __webpack_require__) {
6374
6390
  "use strict";
6375
6391
  var formats = __webpack_require__("./node_modules/qs/lib/formats.js");
6392
+ var getSideChannel = __webpack_require__("./node_modules/side-channel/index.js");
6376
6393
  var has = Object.prototype.hasOwnProperty;
6377
6394
  var isArray = Array.isArray;
6395
+ var overflowChannel = getSideChannel();
6396
+ var markOverflow = function(obj, maxIndex) {
6397
+ overflowChannel.set(obj, maxIndex);
6398
+ return obj;
6399
+ };
6400
+ var isOverflow = function(obj) {
6401
+ return overflowChannel.has(obj);
6402
+ };
6403
+ var getMaxIndex = function(obj) {
6404
+ return overflowChannel.get(obj);
6405
+ };
6406
+ var setMaxIndex = function(obj, maxIndex) {
6407
+ overflowChannel.set(obj, maxIndex);
6408
+ };
6378
6409
  var hexTable = function() {
6379
6410
  var array = [];
6380
6411
  for(var i = 0; i < 256; ++i)array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
@@ -6406,12 +6437,32 @@
6406
6437
  target,
6407
6438
  source
6408
6439
  ];
6409
- else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) target[source] = true;
6440
+ else if (isOverflow(target)) {
6441
+ var newIndex = getMaxIndex(target) + 1;
6442
+ target[newIndex] = source;
6443
+ setMaxIndex(target, newIndex);
6444
+ } else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) target[source] = true;
6410
6445
  return target;
6411
6446
  }
6412
- if (!target || 'object' != typeof target) return [
6413
- target
6414
- ].concat(source);
6447
+ if (!target || 'object' != typeof target) {
6448
+ if (isOverflow(source)) {
6449
+ var sourceKeys = Object.keys(source);
6450
+ var result = options && options.plainObjects ? {
6451
+ __proto__: null,
6452
+ 0: target
6453
+ } : {
6454
+ 0: target
6455
+ };
6456
+ for(var m = 0; m < sourceKeys.length; m++){
6457
+ var oldKey = parseInt(sourceKeys[m], 10);
6458
+ result[oldKey + 1] = source[sourceKeys[m]];
6459
+ }
6460
+ return markOverflow(result, getMaxIndex(source) + 1);
6461
+ }
6462
+ return [
6463
+ target
6464
+ ].concat(source);
6465
+ }
6415
6466
  var mergeTarget = target;
6416
6467
  if (isArray(target) && !isArray(source)) mergeTarget = arrayToObject(target, options);
6417
6468
  if (isArray(target) && isArray(source)) {
@@ -6521,8 +6572,18 @@
6521
6572
  if (!obj || 'object' != typeof obj) return false;
6522
6573
  return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
6523
6574
  };
6524
- var combine = function(a, b) {
6525
- return [].concat(a, b);
6575
+ var combine = function(a, b, arrayLimit, plainObjects) {
6576
+ if (isOverflow(a)) {
6577
+ var newIndex = getMaxIndex(a) + 1;
6578
+ a[newIndex] = b;
6579
+ setMaxIndex(a, newIndex);
6580
+ return a;
6581
+ }
6582
+ var result = [].concat(a, b);
6583
+ if (result.length > arrayLimit) return markOverflow(arrayToObject(result, {
6584
+ plainObjects: plainObjects
6585
+ }), result.length - 1);
6586
+ return result;
6526
6587
  };
6527
6588
  var maybeMap = function(val, fn) {
6528
6589
  if (isArray(val)) {
@@ -6540,6 +6601,7 @@
6540
6601
  decode: decode,
6541
6602
  encode: encode,
6542
6603
  isBuffer: isBuffer,
6604
+ isOverflow: isOverflow,
6543
6605
  isRegExp: isRegExp,
6544
6606
  maybeMap: maybeMap,
6545
6607
  merge: merge
@@ -7193,7 +7255,12 @@
7193
7255
  this.emit('request', this);
7194
7256
  xhr.send(void 0 === data ? null : data);
7195
7257
  };
7196
- request.agent = ()=>new Agent();
7258
+ const proxyAgent = new Proxy(Agent, {
7259
+ apply (target, thisArg, argumentsList) {
7260
+ return new target(...argumentsList);
7261
+ }
7262
+ });
7263
+ request.agent = proxyAgent;
7197
7264
  for (const method of [
7198
7265
  'GET',
7199
7266
  'POST',
@@ -10670,7 +10737,7 @@
10670
10737
  var client = __webpack_require__("./node_modules/superagent/lib/client.js");
10671
10738
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10672
10739
  var package_namespaceObject = {
10673
- rE: "13.6.10"
10740
+ rE: "13.6.11"
10674
10741
  };
10675
10742
  function isAudioEnabled(options) {
10676
10743
  return Boolean(options.audio.enabled);
@@ -16216,7 +16283,7 @@
16216
16283
  return dimension;
16217
16284
  }
16218
16285
  const dimensions_calculateHeight = calculateHeight;
16219
- function calculateWidth(responsive, videoHeight, options, ratio) {
16286
+ function calculateWidth(responsive, options, videoHeight, ratio) {
16220
16287
  const dimension = {
16221
16288
  unit: "px"
16222
16289
  };
@@ -16595,14 +16662,11 @@
16595
16662
  return videoWidth && videoWidth > 0;
16596
16663
  }
16597
16664
  getRawWidth(responsive) {
16598
- let rawWidth = this.getVideoWidth();
16665
+ let rawWidth;
16599
16666
  const widthDimension = {
16600
16667
  unit: "px"
16601
16668
  };
16602
- if (this.options.video.width || this.options.video.height) if (responsive) {
16603
- const dimension = this.recorder.calculateWidth(responsive);
16604
- rawWidth = dimension.value;
16605
- } else rawWidth = this.options.video.width;
16669
+ rawWidth = responsive ? this.getVideoWidth() : this.options.video.width ? this.options.video.width : this.getVideoWidth();
16606
16670
  if (responsive) {
16607
16671
  const widthDimension = this.recorder.limitWidth(rawWidth);
16608
16672
  rawWidth = widthDimension?.value;
@@ -16612,32 +16676,12 @@
16612
16676
  }
16613
16677
  getRawHeight(responsive) {
16614
16678
  let rawHeight;
16615
- if (this.options.video.width || this.options.video.height) {
16616
- const heightDimension = this.recorder.calculateHeight(responsive);
16617
- rawHeight = heightDimension.value;
16618
- if (void 0 === rawHeight) throw error_createError({
16619
- message: "Undefined height",
16620
- explanation: "Calculated raw height cannot be undefined.",
16621
- options: this.options
16622
- });
16623
- if (0 !== rawHeight && rawHeight < 1) throw error_createError({
16624
- message: "Invalid height",
16625
- explanation: `Calculated raw height of ${rawHeight} cannot be less than 1!`,
16626
- options: this.options
16627
- });
16628
- } else {
16629
- rawHeight = this.getVideoHeight();
16630
- if (void 0 === rawHeight) throw error_createError({
16631
- message: "Bad dimensions",
16632
- explanation: "Raw video height from DOM element cannot be undefined.",
16633
- options: this.options
16634
- });
16635
- if (0 !== rawHeight && rawHeight < 1) throw error_createError({
16636
- message: "Bad dimensions",
16637
- explanation: "Raw video height from DOM element cannot be less than 1.",
16638
- options: this.options
16639
- });
16640
- }
16679
+ if (responsive) {
16680
+ rawHeight = this.options.video.height || this.getVideoHeight();
16681
+ const ratio = this.recorder.getRatio();
16682
+ const rawWidth = this.getRawWidth(responsive);
16683
+ if (void 0 !== ratio && rawWidth.value) rawHeight = rawWidth.value * ratio;
16684
+ } else rawHeight = this.options.video.height ? this.options.video.height : this.getVideoHeight();
16641
16685
  if (responsive) {
16642
16686
  const heightDimension = this.recorder.limitHeight(rawHeight);
16643
16687
  rawHeight = heightDimension.value;
@@ -17594,8 +17638,8 @@
17594
17638
  if (void 0 !== height && this.options.video.width) {
17595
17639
  const ratio = this.getRatio();
17596
17640
  if (void 0 !== ratio) {
17597
- const maxHeight = this.options.video.width * ratio;
17598
- height = Math.min(maxHeight, height);
17641
+ const idealHeight = this.options.video.width * ratio;
17642
+ height = Math.min(idealHeight, height);
17599
17643
  }
17600
17644
  }
17601
17645
  recorderHeight = {
@@ -17626,7 +17670,8 @@
17626
17670
  let videoHeight;
17627
17671
  if (this.userMedia) videoHeight = this.userMedia.getVideoHeight();
17628
17672
  else if (this.recorderElement) videoHeight = this.recorderElement.videoHeight || this.recorderElement.height;
17629
- return dimensions_calculateWidth(responsive, videoHeight, this.options, this.getRatio());
17673
+ const ratio = this.getRatio();
17674
+ return dimensions_calculateWidth(responsive, this.options, videoHeight, ratio);
17630
17675
  }
17631
17676
  calculateHeight(responsive) {
17632
17677
  let videoDimension;
@@ -17706,7 +17751,7 @@
17706
17751
  height = this.videomail.height;
17707
17752
  if (width) ratio = height / width;
17708
17753
  }
17709
- if (!width) width = dimensions_calculateWidth(responsive, videoHeight, this.options, ratio);
17754
+ if (!width) width = dimensions_calculateWidth(responsive, this.options, videoHeight, ratio);
17710
17755
  if (!height) {
17711
17756
  let element = this.visuals.getElement();
17712
17757
  if (!element) element = document.body;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "13.6.10",
3
+ "version": "13.6.11",
4
4
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
5
5
  "keywords": [
6
6
  "webcam",
@@ -69,7 +69,7 @@
69
69
  "is-power-of-two": "1.0.0",
70
70
  "nanoevents": "9.1.0",
71
71
  "serialize-error": "12.0.0",
72
- "superagent": "10.2.3",
72
+ "superagent": "10.3.0",
73
73
  "ua-parser-js": "2.0.7",
74
74
  "websocket-stream": "5.5.2"
75
75
  },
@@ -91,16 +91,16 @@
91
91
  "@types/node": "24.10.1",
92
92
  "@types/superagent": "8.1.9",
93
93
  "@types/ua-parser-js": "0.7.39",
94
- "@vitest/eslint-plugin": "1.6.5",
94
+ "@vitest/eslint-plugin": "1.6.6",
95
95
  "audit-ci": "7.1.0",
96
- "chromatic": "13.3.4",
96
+ "chromatic": "13.3.5",
97
97
  "cross-env": "10.1.0",
98
98
  "eslint": "9.39.2",
99
99
  "eslint-import-resolver-typescript": "4.4.4",
100
100
  "eslint-plugin-de-morgan": "2.0.0",
101
101
  "eslint-plugin-depend": "1.4.0",
102
102
  "eslint-plugin-import-x": "4.16.1",
103
- "eslint-plugin-package-json": "0.88.0",
103
+ "eslint-plugin-package-json": "0.88.1",
104
104
  "eslint-plugin-promise": "7.2.1",
105
105
  "eslint-plugin-regexp": "2.10.0",
106
106
  "eslint-plugin-security": "3.0.1",
@@ -114,12 +114,12 @@
114
114
  "prettier-plugin-curly": "0.4.1",
115
115
  "prettier-plugin-packagejson": "2.5.20",
116
116
  "prettier-plugin-sh": "0.18.0",
117
- "release-it": "19.2.2",
117
+ "release-it": "19.2.3",
118
118
  "storybook": "10.1.11",
119
119
  "storybook-html-rsbuild": "3.2.0",
120
120
  "type-fest": "5.3.1",
121
121
  "typescript": "5.9.3",
122
- "typescript-eslint": "8.51.0",
122
+ "typescript-eslint": "8.52.0",
123
123
  "vitest": "4.0.16"
124
124
  },
125
125
  "engines": {