@sawport/react-sdk 0.1.0-alpha.5 → 0.1.0-alpha.6

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/dist/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  (function(global2, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.sawportSDK = {}));
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.sawportReactSDK = {}));
3
3
  })(this, function(exports2) {
4
4
  "use strict";
5
5
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -3160,14 +3160,14 @@
3160
3160
  var result = value2 + "";
3161
3161
  return result == "0" && 1 / value2 == -INFINITY$2 ? "-0" : result;
3162
3162
  }
3163
- function toString$h(value2) {
3163
+ function toString$g(value2) {
3164
3164
  return value2 == null ? "" : baseToString$2(value2);
3165
3165
  }
3166
3166
  function toPath(value2) {
3167
3167
  if (isArray$l(value2)) {
3168
3168
  return arrayMap$2(value2, toKey$5);
3169
3169
  }
3170
- return isSymbol$a(value2) ? [value2] : copyArray(stringToPath$4(toString$h(value2)));
3170
+ return isSymbol$a(value2) ? [value2] : copyArray(stringToPath$4(toString$g(value2)));
3171
3171
  }
3172
3172
  var isProduction = process.env.NODE_ENV === "production";
3173
3173
  function warning(condition, message) {
@@ -3452,21 +3452,14 @@
3452
3452
  }
3453
3453
  return reactIs_development;
3454
3454
  }
3455
- var hasRequiredReactIs;
3456
- function requireReactIs() {
3457
- if (hasRequiredReactIs)
3458
- return reactIs$1.exports;
3459
- hasRequiredReactIs = 1;
3460
- (function(module2) {
3461
- if (process.env.NODE_ENV === "production") {
3462
- module2.exports = requireReactIs_production_min();
3463
- } else {
3464
- module2.exports = requireReactIs_development();
3465
- }
3466
- })(reactIs$1);
3467
- return reactIs$1.exports;
3468
- }
3469
- var reactIs = requireReactIs();
3455
+ (function(module2) {
3456
+ if (process.env.NODE_ENV === "production") {
3457
+ module2.exports = requireReactIs_production_min();
3458
+ } else {
3459
+ module2.exports = requireReactIs_development();
3460
+ }
3461
+ })(reactIs$1);
3462
+ var reactIs = reactIs$1.exports;
3470
3463
  var FORWARD_REF_STATICS = {
3471
3464
  "$$typeof": true,
3472
3465
  render: true,
@@ -4717,7 +4710,7 @@
4717
4710
  function clone$2(src2) {
4718
4711
  return baseClone(src2, [], []);
4719
4712
  }
4720
- const toString$g = Object.prototype.toString;
4713
+ const toString$f = Object.prototype.toString;
4721
4714
  const errorToString = Error.prototype.toString;
4722
4715
  const regExpToString = RegExp.prototype.toString;
4723
4716
  const symbolToString$1 = typeof Symbol !== "undefined" ? Symbol.prototype.toString : () => "";
@@ -4740,7 +4733,7 @@
4740
4733
  return "[Function " + (val.name || "anonymous") + "]";
4741
4734
  if (typeOf === "symbol")
4742
4735
  return symbolToString$1.call(val).replace(SYMBOL_REGEXP, "Symbol($1)");
4743
- const tag = toString$g.call(val).slice(8, -1);
4736
+ const tag = toString$f.call(val).slice(8, -1);
4744
4737
  if (tag === "Date")
4745
4738
  return isNaN(val.getTime()) ? "" + val : val.toISOString(val);
4746
4739
  if (tag === "Error" || val instanceof Error)
@@ -5248,16 +5241,16 @@
5248
5241
  }
5249
5242
  var _baseToString = baseToString$1;
5250
5243
  var baseToString = _baseToString;
5251
- function toString$f(value2) {
5244
+ function toString$e(value2) {
5252
5245
  return value2 == null ? "" : baseToString(value2);
5253
5246
  }
5254
- var toString_1 = toString$f;
5255
- var isArray$g = isArray_1, isKey$2 = _isKey, stringToPath$1 = _stringToPath, toString$e = toString_1;
5247
+ var toString_1 = toString$e;
5248
+ var isArray$g = isArray_1, isKey$2 = _isKey, stringToPath$1 = _stringToPath, toString$d = toString_1;
5256
5249
  function castPath$2(value2, object2) {
5257
5250
  if (isArray$g(value2)) {
5258
5251
  return value2;
5259
5252
  }
5260
- return isKey$2(value2, object2) ? [value2] : stringToPath$1(toString$e(value2));
5253
+ return isKey$2(value2, object2) ? [value2] : stringToPath$1(toString$d(value2));
5261
5254
  }
5262
5255
  var _castPath = castPath$2;
5263
5256
  var baseGetTag$2 = _baseGetTag, isObjectLike$3 = isObjectLike_1;
@@ -7559,13 +7552,13 @@ attempted value: ${formattedValue}
7559
7552
  };
7560
7553
  var deburrLetter$1 = basePropertyOf(deburredLetters);
7561
7554
  var _deburrLetter = deburrLetter$1;
7562
- var deburrLetter = _deburrLetter, toString$d = toString_1;
7555
+ var deburrLetter = _deburrLetter, toString$c = toString_1;
7563
7556
  var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
7564
7557
  var rsComboMarksRange$3 = "\\u0300-\\u036f", reComboHalfMarksRange$3 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$3 = "\\u20d0-\\u20ff", rsComboRange$3 = rsComboMarksRange$3 + reComboHalfMarksRange$3 + rsComboSymbolsRange$3;
7565
7558
  var rsCombo$2 = "[" + rsComboRange$3 + "]";
7566
7559
  var reComboMark = RegExp(rsCombo$2, "g");
7567
7560
  function deburr$1(string2) {
7568
- string2 = toString$d(string2);
7561
+ string2 = toString$c(string2);
7569
7562
  return string2 && string2.replace(reLatin, deburrLetter).replace(reComboMark, "");
7570
7563
  }
7571
7564
  var deburr_1 = deburr$1;
@@ -7596,9 +7589,9 @@ attempted value: ${formattedValue}
7596
7589
  return string2.match(reUnicodeWord) || [];
7597
7590
  }
7598
7591
  var _unicodeWords = unicodeWords$1;
7599
- var asciiWords = _asciiWords, hasUnicodeWord = _hasUnicodeWord, toString$c = toString_1, unicodeWords = _unicodeWords;
7592
+ var asciiWords = _asciiWords, hasUnicodeWord = _hasUnicodeWord, toString$b = toString_1, unicodeWords = _unicodeWords;
7600
7593
  function words$1(string2, pattern, guard) {
7601
- string2 = toString$c(string2);
7594
+ string2 = toString$b(string2);
7602
7595
  pattern = guard ? void 0 : pattern;
7603
7596
  if (pattern === void 0) {
7604
7597
  return hasUnicodeWord(string2) ? unicodeWords(string2) : asciiWords(string2);
@@ -7669,10 +7662,10 @@ attempted value: ${formattedValue}
7669
7662
  return hasUnicode$1(string2) ? unicodeToArray(string2) : asciiToArray(string2);
7670
7663
  }
7671
7664
  var _stringToArray = stringToArray$1;
7672
- var castSlice = _castSlice, hasUnicode = _hasUnicode, stringToArray = _stringToArray, toString$b = toString_1;
7665
+ var castSlice = _castSlice, hasUnicode = _hasUnicode, stringToArray = _stringToArray, toString$a = toString_1;
7673
7666
  function createCaseFirst$1(methodName) {
7674
7667
  return function(string2) {
7675
- string2 = toString$b(string2);
7668
+ string2 = toString$a(string2);
7676
7669
  var strSymbols = hasUnicode(string2) ? stringToArray(string2) : void 0;
7677
7670
  var chr = strSymbols ? strSymbols[0] : string2.charAt(0);
7678
7671
  var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string2.slice(1);
@@ -7683,9 +7676,9 @@ attempted value: ${formattedValue}
7683
7676
  var createCaseFirst = _createCaseFirst;
7684
7677
  var upperFirst$1 = createCaseFirst("toUpperCase");
7685
7678
  var upperFirst_1 = upperFirst$1;
7686
- var toString$a = toString_1, upperFirst = upperFirst_1;
7679
+ var toString$9 = toString_1, upperFirst = upperFirst_1;
7687
7680
  function capitalize$1(string2) {
7688
- return upperFirst(toString$a(string2).toLowerCase());
7681
+ return upperFirst(toString$9(string2).toLowerCase());
7689
7682
  }
7690
7683
  var capitalize_1 = capitalize$1;
7691
7684
  var capitalize = capitalize_1, createCompounder = _createCompounder;
@@ -8294,7 +8287,7 @@ attempted value: ${formattedValue}
8294
8287
  if (hasRequiredFactoryWithTypeCheckers)
8295
8288
  return factoryWithTypeCheckers;
8296
8289
  hasRequiredFactoryWithTypeCheckers = 1;
8297
- var ReactIs2 = requireReactIs();
8290
+ var ReactIs2 = reactIs$1.exports;
8298
8291
  var assign2 = requireObjectAssign();
8299
8292
  var ReactPropTypesSecret = requireReactPropTypesSecret();
8300
8293
  var has2 = requireHas();
@@ -8787,7 +8780,7 @@ attempted value: ${formattedValue}
8787
8780
  return factoryWithThrowingShims;
8788
8781
  }
8789
8782
  if (process.env.NODE_ENV !== "production") {
8790
- var ReactIs = requireReactIs();
8783
+ var ReactIs = reactIs$1.exports;
8791
8784
  var throwOnDirectAccess = true;
8792
8785
  propTypes$h.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
8793
8786
  } else {
@@ -40937,10 +40930,10 @@ attempted value: ${formattedValue}
40937
40930
  };
40938
40931
  };
40939
40932
  var bind$6 = bind$7;
40940
- var toString$9 = Object.prototype.toString;
40933
+ var toString$8 = Object.prototype.toString;
40941
40934
  var kindOf = function(cache) {
40942
40935
  return function(thing) {
40943
- var str = toString$9.call(thing);
40936
+ var str = toString$8.call(thing);
40944
40937
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
40945
40938
  };
40946
40939
  }(/* @__PURE__ */ Object.create(null));
@@ -40990,14 +40983,14 @@ attempted value: ${formattedValue}
40990
40983
  var isBlob = kindOfTest("Blob");
40991
40984
  var isFileList = kindOfTest("FileList");
40992
40985
  function isFunction$1(val) {
40993
- return toString$9.call(val) === "[object Function]";
40986
+ return toString$8.call(val) === "[object Function]";
40994
40987
  }
40995
40988
  function isStream(val) {
40996
40989
  return isObject$d(val) && isFunction$1(val.pipe);
40997
40990
  }
40998
40991
  function isFormData(thing) {
40999
40992
  var pattern = "[object FormData]";
41000
- return thing && (typeof FormData === "function" && thing instanceof FormData || toString$9.call(thing) === pattern || isFunction$1(thing.toString) && thing.toString() === pattern);
40993
+ return thing && (typeof FormData === "function" && thing instanceof FormData || toString$8.call(thing) === pattern || isFunction$1(thing.toString) && thing.toString() === pattern);
41001
40994
  }
41002
40995
  var isURLSearchParams = kindOfTest("URLSearchParams");
41003
40996
  function trim$1(str) {
@@ -54557,19 +54550,19 @@ attempted value: ${formattedValue}
54557
54550
  commons.ERROR_PACKET = ERROR_PACKET;
54558
54551
  Object.defineProperty(encodePacket_browser, "__esModule", { value: true });
54559
54552
  const commons_js_1$1 = commons;
54560
- const withNativeBlob$1 = typeof Blob === "function" || typeof Blob !== "undefined" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]";
54561
- const withNativeArrayBuffer$2 = typeof ArrayBuffer === "function";
54562
- const isView$1 = (obj) => {
54553
+ const withNativeBlob = typeof Blob === "function" || typeof Blob !== "undefined" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]";
54554
+ const withNativeArrayBuffer$1 = typeof ArrayBuffer === "function";
54555
+ const isView = (obj) => {
54563
54556
  return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj && obj.buffer instanceof ArrayBuffer;
54564
54557
  };
54565
54558
  const encodePacket = ({ type, data: data2 }, supportsBinary, callback) => {
54566
- if (withNativeBlob$1 && data2 instanceof Blob) {
54559
+ if (withNativeBlob && data2 instanceof Blob) {
54567
54560
  if (supportsBinary) {
54568
54561
  return callback(data2);
54569
54562
  } else {
54570
54563
  return encodeBlobAsBase64(data2, callback);
54571
54564
  }
54572
- } else if (withNativeArrayBuffer$2 && (data2 instanceof ArrayBuffer || isView$1(data2))) {
54565
+ } else if (withNativeArrayBuffer$1 && (data2 instanceof ArrayBuffer || isView(data2))) {
54573
54566
  if (supportsBinary) {
54574
54567
  return callback(data2);
54575
54568
  } else {
@@ -54636,7 +54629,7 @@ attempted value: ${formattedValue}
54636
54629
  Object.defineProperty(decodePacket_browser, "__esModule", { value: true });
54637
54630
  const commons_js_1 = commons;
54638
54631
  const base64_arraybuffer_js_1 = base64Arraybuffer;
54639
- const withNativeArrayBuffer$1 = typeof ArrayBuffer === "function";
54632
+ const withNativeArrayBuffer = typeof ArrayBuffer === "function";
54640
54633
  const decodePacket = (encodedPacket, binaryType) => {
54641
54634
  if (typeof encodedPacket !== "string") {
54642
54635
  return {
@@ -54663,7 +54656,7 @@ attempted value: ${formattedValue}
54663
54656
  };
54664
54657
  };
54665
54658
  const decodeBase64Packet = (data2, binaryType) => {
54666
- if (withNativeArrayBuffer$1) {
54659
+ if (withNativeArrayBuffer) {
54667
54660
  const decoded = (0, base64_arraybuffer_js_1.decode)(data2);
54668
54661
  return mapBinary(decoded, binaryType);
54669
54662
  } else {
@@ -56436,311 +56429,332 @@ attempted value: ${formattedValue}
56436
56429
  var socket = {};
56437
56430
  var cjs = {};
56438
56431
  var binary = {};
56439
- var isBinary$1 = {};
56440
- Object.defineProperty(isBinary$1, "__esModule", { value: true });
56441
- isBinary$1.hasBinary = isBinary$1.isBinary = void 0;
56442
- const withNativeArrayBuffer = typeof ArrayBuffer === "function";
56443
- const isView = (obj) => {
56444
- return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj.buffer instanceof ArrayBuffer;
56445
- };
56446
- const toString$8 = Object.prototype.toString;
56447
- const withNativeBlob = typeof Blob === "function" || typeof Blob !== "undefined" && toString$8.call(Blob) === "[object BlobConstructor]";
56448
- const withNativeFile = typeof File === "function" || typeof File !== "undefined" && toString$8.call(File) === "[object FileConstructor]";
56449
- function isBinary(obj) {
56450
- return withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)) || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File;
56451
- }
56452
- isBinary$1.isBinary = isBinary;
56453
- function hasBinary(obj, toJSON2) {
56454
- if (!obj || typeof obj !== "object") {
56455
- return false;
56456
- }
56457
- if (Array.isArray(obj)) {
56458
- for (let i2 = 0, l2 = obj.length; i2 < l2; i2++) {
56459
- if (hasBinary(obj[i2])) {
56460
- return true;
56432
+ var isBinary = {};
56433
+ var hasRequiredIsBinary;
56434
+ function requireIsBinary() {
56435
+ if (hasRequiredIsBinary)
56436
+ return isBinary;
56437
+ hasRequiredIsBinary = 1;
56438
+ Object.defineProperty(isBinary, "__esModule", { value: true });
56439
+ isBinary.hasBinary = isBinary.isBinary = void 0;
56440
+ const withNativeArrayBuffer2 = typeof ArrayBuffer === "function";
56441
+ const isView2 = (obj) => {
56442
+ return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj.buffer instanceof ArrayBuffer;
56443
+ };
56444
+ const toString2 = Object.prototype.toString;
56445
+ const withNativeBlob2 = typeof Blob === "function" || typeof Blob !== "undefined" && toString2.call(Blob) === "[object BlobConstructor]";
56446
+ const withNativeFile = typeof File === "function" || typeof File !== "undefined" && toString2.call(File) === "[object FileConstructor]";
56447
+ function isBinary$1(obj) {
56448
+ return withNativeArrayBuffer2 && (obj instanceof ArrayBuffer || isView2(obj)) || withNativeBlob2 && obj instanceof Blob || withNativeFile && obj instanceof File;
56449
+ }
56450
+ isBinary.isBinary = isBinary$1;
56451
+ function hasBinary(obj, toJSON2) {
56452
+ if (!obj || typeof obj !== "object") {
56453
+ return false;
56454
+ }
56455
+ if (Array.isArray(obj)) {
56456
+ for (let i2 = 0, l2 = obj.length; i2 < l2; i2++) {
56457
+ if (hasBinary(obj[i2])) {
56458
+ return true;
56459
+ }
56461
56460
  }
56461
+ return false;
56462
56462
  }
56463
- return false;
56464
- }
56465
- if (isBinary(obj)) {
56466
- return true;
56467
- }
56468
- if (obj.toJSON && typeof obj.toJSON === "function" && arguments.length === 1) {
56469
- return hasBinary(obj.toJSON(), true);
56470
- }
56471
- for (const key in obj) {
56472
- if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {
56463
+ if (isBinary$1(obj)) {
56473
56464
  return true;
56474
56465
  }
56475
- }
56476
- return false;
56477
- }
56478
- isBinary$1.hasBinary = hasBinary;
56479
- Object.defineProperty(binary, "__esModule", { value: true });
56480
- binary.reconstructPacket = binary.deconstructPacket = void 0;
56481
- const is_binary_js_1 = isBinary$1;
56482
- function deconstructPacket(packet) {
56483
- const buffers = [];
56484
- const packetData = packet.data;
56485
- const pack = packet;
56486
- pack.data = _deconstructPacket(packetData, buffers);
56487
- pack.attachments = buffers.length;
56488
- return { packet: pack, buffers };
56489
- }
56490
- binary.deconstructPacket = deconstructPacket;
56491
- function _deconstructPacket(data2, buffers) {
56492
- if (!data2)
56493
- return data2;
56494
- if (is_binary_js_1.isBinary(data2)) {
56495
- const placeholder = { _placeholder: true, num: buffers.length };
56496
- buffers.push(data2);
56497
- return placeholder;
56498
- } else if (Array.isArray(data2)) {
56499
- const newData = new Array(data2.length);
56500
- for (let i2 = 0; i2 < data2.length; i2++) {
56501
- newData[i2] = _deconstructPacket(data2[i2], buffers);
56466
+ if (obj.toJSON && typeof obj.toJSON === "function" && arguments.length === 1) {
56467
+ return hasBinary(obj.toJSON(), true);
56502
56468
  }
56503
- return newData;
56504
- } else if (typeof data2 === "object" && !(data2 instanceof Date)) {
56505
- const newData = {};
56506
- for (const key in data2) {
56507
- if (Object.prototype.hasOwnProperty.call(data2, key)) {
56508
- newData[key] = _deconstructPacket(data2[key], buffers);
56469
+ for (const key in obj) {
56470
+ if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {
56471
+ return true;
56509
56472
  }
56510
56473
  }
56511
- return newData;
56474
+ return false;
56512
56475
  }
56513
- return data2;
56514
- }
56515
- function reconstructPacket(packet, buffers) {
56516
- packet.data = _reconstructPacket(packet.data, buffers);
56517
- packet.attachments = void 0;
56518
- return packet;
56519
- }
56520
- binary.reconstructPacket = reconstructPacket;
56521
- function _reconstructPacket(data2, buffers) {
56522
- if (!data2)
56523
- return data2;
56524
- if (data2 && data2._placeholder === true) {
56525
- const isIndexValid = typeof data2.num === "number" && data2.num >= 0 && data2.num < buffers.length;
56526
- if (isIndexValid) {
56527
- return buffers[data2.num];
56528
- } else {
56529
- throw new Error("illegal attachments");
56530
- }
56531
- } else if (Array.isArray(data2)) {
56532
- for (let i2 = 0; i2 < data2.length; i2++) {
56533
- data2[i2] = _reconstructPacket(data2[i2], buffers);
56476
+ isBinary.hasBinary = hasBinary;
56477
+ return isBinary;
56478
+ }
56479
+ var hasRequiredBinary;
56480
+ function requireBinary() {
56481
+ if (hasRequiredBinary)
56482
+ return binary;
56483
+ hasRequiredBinary = 1;
56484
+ Object.defineProperty(binary, "__esModule", { value: true });
56485
+ binary.reconstructPacket = binary.deconstructPacket = void 0;
56486
+ const is_binary_js_1 = requireIsBinary();
56487
+ function deconstructPacket(packet) {
56488
+ const buffers = [];
56489
+ const packetData = packet.data;
56490
+ const pack = packet;
56491
+ pack.data = _deconstructPacket(packetData, buffers);
56492
+ pack.attachments = buffers.length;
56493
+ return { packet: pack, buffers };
56494
+ }
56495
+ binary.deconstructPacket = deconstructPacket;
56496
+ function _deconstructPacket(data2, buffers) {
56497
+ if (!data2)
56498
+ return data2;
56499
+ if (is_binary_js_1.isBinary(data2)) {
56500
+ const placeholder = { _placeholder: true, num: buffers.length };
56501
+ buffers.push(data2);
56502
+ return placeholder;
56503
+ } else if (Array.isArray(data2)) {
56504
+ const newData = new Array(data2.length);
56505
+ for (let i2 = 0; i2 < data2.length; i2++) {
56506
+ newData[i2] = _deconstructPacket(data2[i2], buffers);
56507
+ }
56508
+ return newData;
56509
+ } else if (typeof data2 === "object" && !(data2 instanceof Date)) {
56510
+ const newData = {};
56511
+ for (const key in data2) {
56512
+ if (Object.prototype.hasOwnProperty.call(data2, key)) {
56513
+ newData[key] = _deconstructPacket(data2[key], buffers);
56514
+ }
56515
+ }
56516
+ return newData;
56534
56517
  }
56535
- } else if (typeof data2 === "object") {
56536
- for (const key in data2) {
56537
- if (Object.prototype.hasOwnProperty.call(data2, key)) {
56538
- data2[key] = _reconstructPacket(data2[key], buffers);
56518
+ return data2;
56519
+ }
56520
+ function reconstructPacket(packet, buffers) {
56521
+ packet.data = _reconstructPacket(packet.data, buffers);
56522
+ packet.attachments = void 0;
56523
+ return packet;
56524
+ }
56525
+ binary.reconstructPacket = reconstructPacket;
56526
+ function _reconstructPacket(data2, buffers) {
56527
+ if (!data2)
56528
+ return data2;
56529
+ if (data2 && data2._placeholder === true) {
56530
+ const isIndexValid = typeof data2.num === "number" && data2.num >= 0 && data2.num < buffers.length;
56531
+ if (isIndexValid) {
56532
+ return buffers[data2.num];
56533
+ } else {
56534
+ throw new Error("illegal attachments");
56535
+ }
56536
+ } else if (Array.isArray(data2)) {
56537
+ for (let i2 = 0; i2 < data2.length; i2++) {
56538
+ data2[i2] = _reconstructPacket(data2[i2], buffers);
56539
+ }
56540
+ } else if (typeof data2 === "object") {
56541
+ for (const key in data2) {
56542
+ if (Object.prototype.hasOwnProperty.call(data2, key)) {
56543
+ data2[key] = _reconstructPacket(data2[key], buffers);
56544
+ }
56539
56545
  }
56540
56546
  }
56547
+ return data2;
56541
56548
  }
56542
- return data2;
56549
+ return binary;
56543
56550
  }
56544
- (function(exports3) {
56545
- Object.defineProperty(exports3, "__esModule", { value: true });
56546
- exports3.Decoder = exports3.Encoder = exports3.PacketType = exports3.protocol = void 0;
56547
- const component_emitter_12 = require$$5;
56548
- const binary_js_1 = binary;
56549
- const is_binary_js_12 = isBinary$1;
56550
- const debug_12 = browser.exports;
56551
- const debug2 = debug_12.default("socket.io-parser");
56552
- exports3.protocol = 5;
56553
- var PacketType;
56554
- (function(PacketType2) {
56555
- PacketType2[PacketType2["CONNECT"] = 0] = "CONNECT";
56556
- PacketType2[PacketType2["DISCONNECT"] = 1] = "DISCONNECT";
56557
- PacketType2[PacketType2["EVENT"] = 2] = "EVENT";
56558
- PacketType2[PacketType2["ACK"] = 3] = "ACK";
56559
- PacketType2[PacketType2["CONNECT_ERROR"] = 4] = "CONNECT_ERROR";
56560
- PacketType2[PacketType2["BINARY_EVENT"] = 5] = "BINARY_EVENT";
56561
- PacketType2[PacketType2["BINARY_ACK"] = 6] = "BINARY_ACK";
56562
- })(PacketType = exports3.PacketType || (exports3.PacketType = {}));
56563
- class Encoder {
56564
- constructor(replacer) {
56565
- this.replacer = replacer;
56566
- }
56567
- encode(obj) {
56568
- debug2("encoding packet %j", obj);
56569
- if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {
56570
- if (is_binary_js_12.hasBinary(obj)) {
56571
- obj.type = obj.type === PacketType.EVENT ? PacketType.BINARY_EVENT : PacketType.BINARY_ACK;
56572
- return this.encodeAsBinary(obj);
56573
- }
56574
- }
56575
- return [this.encodeAsString(obj)];
56576
- }
56577
- encodeAsString(obj) {
56578
- let str = "" + obj.type;
56579
- if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) {
56580
- str += obj.attachments + "-";
56581
- }
56582
- if (obj.nsp && "/" !== obj.nsp) {
56583
- str += obj.nsp + ",";
56584
- }
56585
- if (null != obj.id) {
56586
- str += obj.id;
56587
- }
56588
- if (null != obj.data) {
56589
- str += JSON.stringify(obj.data, this.replacer);
56590
- }
56591
- debug2("encoded %j as %s", obj, str);
56592
- return str;
56593
- }
56594
- encodeAsBinary(obj) {
56595
- const deconstruction = binary_js_1.deconstructPacket(obj);
56596
- const pack = this.encodeAsString(deconstruction.packet);
56597
- const buffers = deconstruction.buffers;
56598
- buffers.unshift(pack);
56599
- return buffers;
56600
- }
56601
- }
56602
- exports3.Encoder = Encoder;
56603
- class Decoder extends component_emitter_12.Emitter {
56604
- constructor(reviver) {
56605
- super();
56606
- this.reviver = reviver;
56607
- }
56608
- add(obj) {
56609
- let packet;
56610
- if (typeof obj === "string") {
56611
- if (this.reconstructor) {
56612
- throw new Error("got plaintext data when reconstructing a packet");
56613
- }
56614
- packet = this.decodeString(obj);
56615
- if (packet.type === PacketType.BINARY_EVENT || packet.type === PacketType.BINARY_ACK) {
56616
- this.reconstructor = new BinaryReconstructor(packet);
56617
- if (packet.attachments === 0) {
56551
+ var hasRequiredCjs$1;
56552
+ function requireCjs$1() {
56553
+ if (hasRequiredCjs$1)
56554
+ return cjs;
56555
+ hasRequiredCjs$1 = 1;
56556
+ (function(exports3) {
56557
+ Object.defineProperty(exports3, "__esModule", { value: true });
56558
+ exports3.Decoder = exports3.Encoder = exports3.PacketType = exports3.protocol = void 0;
56559
+ const component_emitter_12 = require$$5;
56560
+ const binary_js_1 = requireBinary();
56561
+ const is_binary_js_1 = requireIsBinary();
56562
+ const debug_12 = browser.exports;
56563
+ const debug2 = debug_12.default("socket.io-parser");
56564
+ exports3.protocol = 5;
56565
+ var PacketType;
56566
+ (function(PacketType2) {
56567
+ PacketType2[PacketType2["CONNECT"] = 0] = "CONNECT";
56568
+ PacketType2[PacketType2["DISCONNECT"] = 1] = "DISCONNECT";
56569
+ PacketType2[PacketType2["EVENT"] = 2] = "EVENT";
56570
+ PacketType2[PacketType2["ACK"] = 3] = "ACK";
56571
+ PacketType2[PacketType2["CONNECT_ERROR"] = 4] = "CONNECT_ERROR";
56572
+ PacketType2[PacketType2["BINARY_EVENT"] = 5] = "BINARY_EVENT";
56573
+ PacketType2[PacketType2["BINARY_ACK"] = 6] = "BINARY_ACK";
56574
+ })(PacketType = exports3.PacketType || (exports3.PacketType = {}));
56575
+ class Encoder {
56576
+ constructor(replacer) {
56577
+ this.replacer = replacer;
56578
+ }
56579
+ encode(obj) {
56580
+ debug2("encoding packet %j", obj);
56581
+ if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {
56582
+ if (is_binary_js_1.hasBinary(obj)) {
56583
+ obj.type = obj.type === PacketType.EVENT ? PacketType.BINARY_EVENT : PacketType.BINARY_ACK;
56584
+ return this.encodeAsBinary(obj);
56585
+ }
56586
+ }
56587
+ return [this.encodeAsString(obj)];
56588
+ }
56589
+ encodeAsString(obj) {
56590
+ let str = "" + obj.type;
56591
+ if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) {
56592
+ str += obj.attachments + "-";
56593
+ }
56594
+ if (obj.nsp && "/" !== obj.nsp) {
56595
+ str += obj.nsp + ",";
56596
+ }
56597
+ if (null != obj.id) {
56598
+ str += obj.id;
56599
+ }
56600
+ if (null != obj.data) {
56601
+ str += JSON.stringify(obj.data, this.replacer);
56602
+ }
56603
+ debug2("encoded %j as %s", obj, str);
56604
+ return str;
56605
+ }
56606
+ encodeAsBinary(obj) {
56607
+ const deconstruction = binary_js_1.deconstructPacket(obj);
56608
+ const pack = this.encodeAsString(deconstruction.packet);
56609
+ const buffers = deconstruction.buffers;
56610
+ buffers.unshift(pack);
56611
+ return buffers;
56612
+ }
56613
+ }
56614
+ exports3.Encoder = Encoder;
56615
+ class Decoder extends component_emitter_12.Emitter {
56616
+ constructor(reviver) {
56617
+ super();
56618
+ this.reviver = reviver;
56619
+ }
56620
+ add(obj) {
56621
+ let packet;
56622
+ if (typeof obj === "string") {
56623
+ if (this.reconstructor) {
56624
+ throw new Error("got plaintext data when reconstructing a packet");
56625
+ }
56626
+ packet = this.decodeString(obj);
56627
+ if (packet.type === PacketType.BINARY_EVENT || packet.type === PacketType.BINARY_ACK) {
56628
+ this.reconstructor = new BinaryReconstructor(packet);
56629
+ if (packet.attachments === 0) {
56630
+ super.emitReserved("decoded", packet);
56631
+ }
56632
+ } else {
56618
56633
  super.emitReserved("decoded", packet);
56619
56634
  }
56620
- } else {
56621
- super.emitReserved("decoded", packet);
56622
- }
56623
- } else if (is_binary_js_12.isBinary(obj) || obj.base64) {
56624
- if (!this.reconstructor) {
56625
- throw new Error("got binary data when not reconstructing a packet");
56626
- } else {
56627
- packet = this.reconstructor.takeBinaryData(obj);
56628
- if (packet) {
56629
- this.reconstructor = null;
56630
- super.emitReserved("decoded", packet);
56635
+ } else if (is_binary_js_1.isBinary(obj) || obj.base64) {
56636
+ if (!this.reconstructor) {
56637
+ throw new Error("got binary data when not reconstructing a packet");
56638
+ } else {
56639
+ packet = this.reconstructor.takeBinaryData(obj);
56640
+ if (packet) {
56641
+ this.reconstructor = null;
56642
+ super.emitReserved("decoded", packet);
56643
+ }
56631
56644
  }
56645
+ } else {
56646
+ throw new Error("Unknown type: " + obj);
56632
56647
  }
56633
- } else {
56634
- throw new Error("Unknown type: " + obj);
56635
56648
  }
56636
- }
56637
- decodeString(str) {
56638
- let i2 = 0;
56639
- const p2 = {
56640
- type: Number(str.charAt(0))
56641
- };
56642
- if (PacketType[p2.type] === void 0) {
56643
- throw new Error("unknown packet type " + p2.type);
56644
- }
56645
- if (p2.type === PacketType.BINARY_EVENT || p2.type === PacketType.BINARY_ACK) {
56646
- const start = i2 + 1;
56647
- while (str.charAt(++i2) !== "-" && i2 != str.length) {
56649
+ decodeString(str) {
56650
+ let i2 = 0;
56651
+ const p2 = {
56652
+ type: Number(str.charAt(0))
56653
+ };
56654
+ if (PacketType[p2.type] === void 0) {
56655
+ throw new Error("unknown packet type " + p2.type);
56648
56656
  }
56649
- const buf = str.substring(start, i2);
56650
- if (buf != Number(buf) || str.charAt(i2) !== "-") {
56651
- throw new Error("Illegal attachments");
56657
+ if (p2.type === PacketType.BINARY_EVENT || p2.type === PacketType.BINARY_ACK) {
56658
+ const start = i2 + 1;
56659
+ while (str.charAt(++i2) !== "-" && i2 != str.length) {
56660
+ }
56661
+ const buf = str.substring(start, i2);
56662
+ if (buf != Number(buf) || str.charAt(i2) !== "-") {
56663
+ throw new Error("Illegal attachments");
56664
+ }
56665
+ p2.attachments = Number(buf);
56652
56666
  }
56653
- p2.attachments = Number(buf);
56654
- }
56655
- if ("/" === str.charAt(i2 + 1)) {
56656
- const start = i2 + 1;
56657
- while (++i2) {
56658
- const c2 = str.charAt(i2);
56659
- if ("," === c2)
56660
- break;
56661
- if (i2 === str.length)
56662
- break;
56667
+ if ("/" === str.charAt(i2 + 1)) {
56668
+ const start = i2 + 1;
56669
+ while (++i2) {
56670
+ const c2 = str.charAt(i2);
56671
+ if ("," === c2)
56672
+ break;
56673
+ if (i2 === str.length)
56674
+ break;
56675
+ }
56676
+ p2.nsp = str.substring(start, i2);
56677
+ } else {
56678
+ p2.nsp = "/";
56679
+ }
56680
+ const next = str.charAt(i2 + 1);
56681
+ if ("" !== next && Number(next) == next) {
56682
+ const start = i2 + 1;
56683
+ while (++i2) {
56684
+ const c2 = str.charAt(i2);
56685
+ if (null == c2 || Number(c2) != c2) {
56686
+ --i2;
56687
+ break;
56688
+ }
56689
+ if (i2 === str.length)
56690
+ break;
56691
+ }
56692
+ p2.id = Number(str.substring(start, i2 + 1));
56663
56693
  }
56664
- p2.nsp = str.substring(start, i2);
56665
- } else {
56666
- p2.nsp = "/";
56667
- }
56668
- const next = str.charAt(i2 + 1);
56669
- if ("" !== next && Number(next) == next) {
56670
- const start = i2 + 1;
56671
- while (++i2) {
56672
- const c2 = str.charAt(i2);
56673
- if (null == c2 || Number(c2) != c2) {
56674
- --i2;
56675
- break;
56694
+ if (str.charAt(++i2)) {
56695
+ const payload = this.tryParse(str.substr(i2));
56696
+ if (Decoder.isPayloadValid(p2.type, payload)) {
56697
+ p2.data = payload;
56698
+ } else {
56699
+ throw new Error("invalid payload");
56676
56700
  }
56677
- if (i2 === str.length)
56678
- break;
56679
56701
  }
56680
- p2.id = Number(str.substring(start, i2 + 1));
56702
+ debug2("decoded %s as %j", str, p2);
56703
+ return p2;
56681
56704
  }
56682
- if (str.charAt(++i2)) {
56683
- const payload = this.tryParse(str.substr(i2));
56684
- if (Decoder.isPayloadValid(p2.type, payload)) {
56685
- p2.data = payload;
56686
- } else {
56687
- throw new Error("invalid payload");
56705
+ tryParse(str) {
56706
+ try {
56707
+ return JSON.parse(str, this.reviver);
56708
+ } catch (e2) {
56709
+ return false;
56688
56710
  }
56689
56711
  }
56690
- debug2("decoded %s as %j", str, p2);
56691
- return p2;
56692
- }
56693
- tryParse(str) {
56694
- try {
56695
- return JSON.parse(str, this.reviver);
56696
- } catch (e2) {
56697
- return false;
56712
+ static isPayloadValid(type, payload) {
56713
+ switch (type) {
56714
+ case PacketType.CONNECT:
56715
+ return typeof payload === "object";
56716
+ case PacketType.DISCONNECT:
56717
+ return payload === void 0;
56718
+ case PacketType.CONNECT_ERROR:
56719
+ return typeof payload === "string" || typeof payload === "object";
56720
+ case PacketType.EVENT:
56721
+ case PacketType.BINARY_EVENT:
56722
+ return Array.isArray(payload) && payload.length > 0;
56723
+ case PacketType.ACK:
56724
+ case PacketType.BINARY_ACK:
56725
+ return Array.isArray(payload);
56726
+ }
56727
+ }
56728
+ destroy() {
56729
+ if (this.reconstructor) {
56730
+ this.reconstructor.finishedReconstruction();
56731
+ }
56698
56732
  }
56699
56733
  }
56700
- static isPayloadValid(type, payload) {
56701
- switch (type) {
56702
- case PacketType.CONNECT:
56703
- return typeof payload === "object";
56704
- case PacketType.DISCONNECT:
56705
- return payload === void 0;
56706
- case PacketType.CONNECT_ERROR:
56707
- return typeof payload === "string" || typeof payload === "object";
56708
- case PacketType.EVENT:
56709
- case PacketType.BINARY_EVENT:
56710
- return Array.isArray(payload) && payload.length > 0;
56711
- case PacketType.ACK:
56712
- case PacketType.BINARY_ACK:
56713
- return Array.isArray(payload);
56714
- }
56715
- }
56716
- destroy() {
56717
- if (this.reconstructor) {
56718
- this.reconstructor.finishedReconstruction();
56719
- }
56720
- }
56721
- }
56722
- exports3.Decoder = Decoder;
56723
- class BinaryReconstructor {
56724
- constructor(packet) {
56725
- this.packet = packet;
56726
- this.buffers = [];
56727
- this.reconPack = packet;
56728
- }
56729
- takeBinaryData(binData) {
56730
- this.buffers.push(binData);
56731
- if (this.buffers.length === this.reconPack.attachments) {
56732
- const packet = binary_js_1.reconstructPacket(this.reconPack, this.buffers);
56733
- this.finishedReconstruction();
56734
- return packet;
56734
+ exports3.Decoder = Decoder;
56735
+ class BinaryReconstructor {
56736
+ constructor(packet) {
56737
+ this.packet = packet;
56738
+ this.buffers = [];
56739
+ this.reconPack = packet;
56740
+ }
56741
+ takeBinaryData(binData) {
56742
+ this.buffers.push(binData);
56743
+ if (this.buffers.length === this.reconPack.attachments) {
56744
+ const packet = binary_js_1.reconstructPacket(this.reconPack, this.buffers);
56745
+ this.finishedReconstruction();
56746
+ return packet;
56747
+ }
56748
+ return null;
56749
+ }
56750
+ finishedReconstruction() {
56751
+ this.reconPack = null;
56752
+ this.buffers = [];
56735
56753
  }
56736
- return null;
56737
- }
56738
- finishedReconstruction() {
56739
- this.reconPack = null;
56740
- this.buffers = [];
56741
56754
  }
56742
- }
56743
- })(cjs);
56755
+ })(cjs);
56756
+ return cjs;
56757
+ }
56744
56758
  var on$1 = {};
56745
56759
  Object.defineProperty(on$1, "__esModule", { value: true });
56746
56760
  on$1.on = void 0;
@@ -56756,7 +56770,7 @@ attempted value: ${formattedValue}
56756
56770
  };
56757
56771
  Object.defineProperty(socket, "__esModule", { value: true });
56758
56772
  socket.Socket = void 0;
56759
- const socket_io_parser_1 = cjs;
56773
+ const socket_io_parser_1 = requireCjs$1();
56760
56774
  const on_js_1$1 = on$1;
56761
56775
  const component_emitter_1$1 = require$$5;
56762
56776
  const debug_1$1 = __importDefault$5(browser.exports);
@@ -57170,7 +57184,7 @@ attempted value: ${formattedValue}
57170
57184
  manager.Manager = void 0;
57171
57185
  const engine_io_client_1 = cjs$2;
57172
57186
  const socket_js_1 = socket;
57173
- const parser = __importStar$2(cjs);
57187
+ const parser = __importStar$2(requireCjs$1());
57174
57188
  const on_js_1 = on$1;
57175
57189
  const backo2_js_1 = backo2;
57176
57190
  const component_emitter_1 = require$$5;
@@ -57485,7 +57499,7 @@ attempted value: ${formattedValue}
57485
57499
  io: lookup2,
57486
57500
  connect: lookup2
57487
57501
  });
57488
- var socket_io_parser_12 = cjs;
57502
+ var socket_io_parser_12 = requireCjs$1();
57489
57503
  Object.defineProperty(exports3, "protocol", { enumerable: true, get: function() {
57490
57504
  return socket_io_parser_12.protocol;
57491
57505
  } });