@sawport/react-sdk 0.1.0-alpha.41 → 0.1.0-alpha.42

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.js CHANGED
@@ -1344,14 +1344,14 @@ function baseToString$2(value2) {
1344
1344
  var result = value2 + "";
1345
1345
  return result == "0" && 1 / value2 == -INFINITY$2 ? "-0" : result;
1346
1346
  }
1347
- function toString$h(value2) {
1347
+ function toString$g(value2) {
1348
1348
  return value2 == null ? "" : baseToString$2(value2);
1349
1349
  }
1350
1350
  function toPath(value2) {
1351
1351
  if (isArray$l(value2)) {
1352
1352
  return arrayMap$2(value2, toKey$5);
1353
1353
  }
1354
- return isSymbol$a(value2) ? [value2] : copyArray(stringToPath$4(toString$h(value2)));
1354
+ return isSymbol$a(value2) ? [value2] : copyArray(stringToPath$4(toString$g(value2)));
1355
1355
  }
1356
1356
  var isProduction = true;
1357
1357
  function warning$1(condition, message) {
@@ -2690,7 +2690,7 @@ function baseClone(src2, circulars, clones) {
2690
2690
  function clone$2(src2) {
2691
2691
  return baseClone(src2, [], []);
2692
2692
  }
2693
- const toString$g = Object.prototype.toString;
2693
+ const toString$f = Object.prototype.toString;
2694
2694
  const errorToString = Error.prototype.toString;
2695
2695
  const regExpToString = RegExp.prototype.toString;
2696
2696
  const symbolToString$1 = typeof Symbol !== "undefined" ? Symbol.prototype.toString : () => "";
@@ -2713,7 +2713,7 @@ function printSimpleValue(val, quoteStrings = false) {
2713
2713
  return "[Function " + (val.name || "anonymous") + "]";
2714
2714
  if (typeOf === "symbol")
2715
2715
  return symbolToString$1.call(val).replace(SYMBOL_REGEXP, "Symbol($1)");
2716
- const tag = toString$g.call(val).slice(8, -1);
2716
+ const tag = toString$f.call(val).slice(8, -1);
2717
2717
  if (tag === "Date")
2718
2718
  return isNaN(val.getTime()) ? "" + val : val.toISOString(val);
2719
2719
  if (tag === "Error" || val instanceof Error)
@@ -3221,16 +3221,16 @@ function baseToString$1(value2) {
3221
3221
  }
3222
3222
  var _baseToString = baseToString$1;
3223
3223
  var baseToString = _baseToString;
3224
- function toString$f(value2) {
3224
+ function toString$e(value2) {
3225
3225
  return value2 == null ? "" : baseToString(value2);
3226
3226
  }
3227
- var toString_1 = toString$f;
3228
- var isArray$g = isArray_1, isKey$2 = _isKey, stringToPath$1 = _stringToPath, toString$e = toString_1;
3227
+ var toString_1 = toString$e;
3228
+ var isArray$g = isArray_1, isKey$2 = _isKey, stringToPath$1 = _stringToPath, toString$d = toString_1;
3229
3229
  function castPath$2(value2, object2) {
3230
3230
  if (isArray$g(value2)) {
3231
3231
  return value2;
3232
3232
  }
3233
- return isKey$2(value2, object2) ? [value2] : stringToPath$1(toString$e(value2));
3233
+ return isKey$2(value2, object2) ? [value2] : stringToPath$1(toString$d(value2));
3234
3234
  }
3235
3235
  var _castPath = castPath$2;
3236
3236
  var baseGetTag$2 = _baseGetTag, isObjectLike$3 = isObjectLike_1;
@@ -5532,13 +5532,13 @@ var deburredLetters = {
5532
5532
  };
5533
5533
  var deburrLetter$1 = basePropertyOf(deburredLetters);
5534
5534
  var _deburrLetter = deburrLetter$1;
5535
- var deburrLetter = _deburrLetter, toString$d = toString_1;
5535
+ var deburrLetter = _deburrLetter, toString$c = toString_1;
5536
5536
  var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
5537
5537
  var rsComboMarksRange$3 = "\\u0300-\\u036f", reComboHalfMarksRange$3 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$3 = "\\u20d0-\\u20ff", rsComboRange$3 = rsComboMarksRange$3 + reComboHalfMarksRange$3 + rsComboSymbolsRange$3;
5538
5538
  var rsCombo$2 = "[" + rsComboRange$3 + "]";
5539
5539
  var reComboMark = RegExp(rsCombo$2, "g");
5540
5540
  function deburr$1(string2) {
5541
- string2 = toString$d(string2);
5541
+ string2 = toString$c(string2);
5542
5542
  return string2 && string2.replace(reLatin, deburrLetter).replace(reComboMark, "");
5543
5543
  }
5544
5544
  var deburr_1 = deburr$1;
@@ -5569,9 +5569,9 @@ function unicodeWords$1(string2) {
5569
5569
  return string2.match(reUnicodeWord) || [];
5570
5570
  }
5571
5571
  var _unicodeWords = unicodeWords$1;
5572
- var asciiWords = _asciiWords, hasUnicodeWord = _hasUnicodeWord, toString$c = toString_1, unicodeWords = _unicodeWords;
5572
+ var asciiWords = _asciiWords, hasUnicodeWord = _hasUnicodeWord, toString$b = toString_1, unicodeWords = _unicodeWords;
5573
5573
  function words$1(string2, pattern, guard) {
5574
- string2 = toString$c(string2);
5574
+ string2 = toString$b(string2);
5575
5575
  pattern = guard ? void 0 : pattern;
5576
5576
  if (pattern === void 0) {
5577
5577
  return hasUnicodeWord(string2) ? unicodeWords(string2) : asciiWords(string2);
@@ -5642,10 +5642,10 @@ function stringToArray$1(string2) {
5642
5642
  return hasUnicode$1(string2) ? unicodeToArray(string2) : asciiToArray(string2);
5643
5643
  }
5644
5644
  var _stringToArray = stringToArray$1;
5645
- var castSlice = _castSlice, hasUnicode = _hasUnicode, stringToArray = _stringToArray, toString$b = toString_1;
5645
+ var castSlice = _castSlice, hasUnicode = _hasUnicode, stringToArray = _stringToArray, toString$a = toString_1;
5646
5646
  function createCaseFirst$1(methodName) {
5647
5647
  return function(string2) {
5648
- string2 = toString$b(string2);
5648
+ string2 = toString$a(string2);
5649
5649
  var strSymbols = hasUnicode(string2) ? stringToArray(string2) : void 0;
5650
5650
  var chr = strSymbols ? strSymbols[0] : string2.charAt(0);
5651
5651
  var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string2.slice(1);
@@ -5656,9 +5656,9 @@ var _createCaseFirst = createCaseFirst$1;
5656
5656
  var createCaseFirst = _createCaseFirst;
5657
5657
  var upperFirst$1 = createCaseFirst("toUpperCase");
5658
5658
  var upperFirst_1 = upperFirst$1;
5659
- var toString$a = toString_1, upperFirst = upperFirst_1;
5659
+ var toString$9 = toString_1, upperFirst = upperFirst_1;
5660
5660
  function capitalize$1(string2) {
5661
- return upperFirst(toString$a(string2).toLowerCase());
5661
+ return upperFirst(toString$9(string2).toLowerCase());
5662
5662
  }
5663
5663
  var capitalize_1 = capitalize$1;
5664
5664
  var capitalize = capitalize_1, createCompounder = _createCompounder;
@@ -19007,10 +19007,10 @@ var bind$7 = function bind2(fn, thisArg) {
19007
19007
  };
19008
19008
  };
19009
19009
  var bind$6 = bind$7;
19010
- var toString$9 = Object.prototype.toString;
19010
+ var toString$8 = Object.prototype.toString;
19011
19011
  var kindOf = function(cache) {
19012
19012
  return function(thing) {
19013
- var str = toString$9.call(thing);
19013
+ var str = toString$8.call(thing);
19014
19014
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
19015
19015
  };
19016
19016
  }(/* @__PURE__ */ Object.create(null));
@@ -19060,14 +19060,14 @@ var isFile = kindOfTest("File");
19060
19060
  var isBlob = kindOfTest("Blob");
19061
19061
  var isFileList = kindOfTest("FileList");
19062
19062
  function isFunction$1(val) {
19063
- return toString$9.call(val) === "[object Function]";
19063
+ return toString$8.call(val) === "[object Function]";
19064
19064
  }
19065
19065
  function isStream(val) {
19066
19066
  return isObject$d(val) && isFunction$1(val.pipe);
19067
19067
  }
19068
19068
  function isFormData(thing) {
19069
19069
  var pattern = "[object FormData]";
19070
- return thing && (typeof FormData === "function" && thing instanceof FormData || toString$9.call(thing) === pattern || isFunction$1(thing.toString) && thing.toString() === pattern);
19070
+ return thing && (typeof FormData === "function" && thing instanceof FormData || toString$8.call(thing) === pattern || isFunction$1(thing.toString) && thing.toString() === pattern);
19071
19071
  }
19072
19072
  var isURLSearchParams = kindOfTest("URLSearchParams");
19073
19073
  function trim$1(str) {
@@ -24320,7 +24320,7 @@ function monthDiff(a2, b2) {
24320
24320
  }
24321
24321
  hooks.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ";
24322
24322
  hooks.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
24323
- function toString$8() {
24323
+ function toString$7() {
24324
24324
  return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
24325
24325
  }
24326
24326
  function toISOString(keepOffset) {
@@ -25031,7 +25031,7 @@ if (typeof Symbol !== "undefined" && Symbol.for != null) {
25031
25031
  };
25032
25032
  }
25033
25033
  proto.toJSON = toJSON2;
25034
- proto.toString = toString$8;
25034
+ proto.toString = toString$7;
25035
25035
  proto.unix = unix;
25036
25036
  proto.valueOf = valueOf;
25037
25037
  proto.creationData = creationData;
@@ -37995,19 +37995,19 @@ const ERROR_PACKET = { type: "error", data: "parser error" };
37995
37995
  commons.ERROR_PACKET = ERROR_PACKET;
37996
37996
  Object.defineProperty(encodePacket_browser, "__esModule", { value: true });
37997
37997
  const commons_js_1$1 = commons;
37998
- const withNativeBlob$1 = typeof Blob === "function" || typeof Blob !== "undefined" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]";
37999
- const withNativeArrayBuffer$2 = typeof ArrayBuffer === "function";
38000
- const isView$1 = (obj) => {
37998
+ const withNativeBlob = typeof Blob === "function" || typeof Blob !== "undefined" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]";
37999
+ const withNativeArrayBuffer$1 = typeof ArrayBuffer === "function";
38000
+ const isView = (obj) => {
38001
38001
  return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj && obj.buffer instanceof ArrayBuffer;
38002
38002
  };
38003
38003
  const encodePacket = ({ type, data: data2 }, supportsBinary, callback) => {
38004
- if (withNativeBlob$1 && data2 instanceof Blob) {
38004
+ if (withNativeBlob && data2 instanceof Blob) {
38005
38005
  if (supportsBinary) {
38006
38006
  return callback(data2);
38007
38007
  } else {
38008
38008
  return encodeBlobAsBase64(data2, callback);
38009
38009
  }
38010
- } else if (withNativeArrayBuffer$2 && (data2 instanceof ArrayBuffer || isView$1(data2))) {
38010
+ } else if (withNativeArrayBuffer$1 && (data2 instanceof ArrayBuffer || isView(data2))) {
38011
38011
  if (supportsBinary) {
38012
38012
  return callback(data2);
38013
38013
  } else {
@@ -38074,7 +38074,7 @@ base64Arraybuffer.decode = decode$2;
38074
38074
  Object.defineProperty(decodePacket_browser, "__esModule", { value: true });
38075
38075
  const commons_js_1 = commons;
38076
38076
  const base64_arraybuffer_js_1 = base64Arraybuffer;
38077
- const withNativeArrayBuffer$1 = typeof ArrayBuffer === "function";
38077
+ const withNativeArrayBuffer = typeof ArrayBuffer === "function";
38078
38078
  const decodePacket = (encodedPacket, binaryType) => {
38079
38079
  if (typeof encodedPacket !== "string") {
38080
38080
  return {
@@ -38101,7 +38101,7 @@ const decodePacket = (encodedPacket, binaryType) => {
38101
38101
  };
38102
38102
  };
38103
38103
  const decodeBase64Packet = (data2, binaryType) => {
38104
- if (withNativeArrayBuffer$1) {
38104
+ if (withNativeArrayBuffer) {
38105
38105
  const decoded = (0, base64_arraybuffer_js_1.decode)(data2);
38106
38106
  return mapBinary(decoded, binaryType);
38107
38107
  } else {
@@ -39874,311 +39874,332 @@ var manager = {};
39874
39874
  var socket = {};
39875
39875
  var cjs = {};
39876
39876
  var binary = {};
39877
- var isBinary$1 = {};
39878
- Object.defineProperty(isBinary$1, "__esModule", { value: true });
39879
- isBinary$1.hasBinary = isBinary$1.isBinary = void 0;
39880
- const withNativeArrayBuffer = typeof ArrayBuffer === "function";
39881
- const isView = (obj) => {
39882
- return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj.buffer instanceof ArrayBuffer;
39883
- };
39884
- const toString$7 = Object.prototype.toString;
39885
- const withNativeBlob = typeof Blob === "function" || typeof Blob !== "undefined" && toString$7.call(Blob) === "[object BlobConstructor]";
39886
- const withNativeFile = typeof File === "function" || typeof File !== "undefined" && toString$7.call(File) === "[object FileConstructor]";
39887
- function isBinary(obj) {
39888
- return withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)) || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File;
39889
- }
39890
- isBinary$1.isBinary = isBinary;
39891
- function hasBinary(obj, toJSON3) {
39892
- if (!obj || typeof obj !== "object") {
39893
- return false;
39894
- }
39895
- if (Array.isArray(obj)) {
39896
- for (let i2 = 0, l2 = obj.length; i2 < l2; i2++) {
39897
- if (hasBinary(obj[i2])) {
39898
- return true;
39877
+ var isBinary = {};
39878
+ var hasRequiredIsBinary;
39879
+ function requireIsBinary() {
39880
+ if (hasRequiredIsBinary)
39881
+ return isBinary;
39882
+ hasRequiredIsBinary = 1;
39883
+ Object.defineProperty(isBinary, "__esModule", { value: true });
39884
+ isBinary.hasBinary = isBinary.isBinary = void 0;
39885
+ const withNativeArrayBuffer2 = typeof ArrayBuffer === "function";
39886
+ const isView2 = (obj) => {
39887
+ return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj.buffer instanceof ArrayBuffer;
39888
+ };
39889
+ const toString3 = Object.prototype.toString;
39890
+ const withNativeBlob2 = typeof Blob === "function" || typeof Blob !== "undefined" && toString3.call(Blob) === "[object BlobConstructor]";
39891
+ const withNativeFile = typeof File === "function" || typeof File !== "undefined" && toString3.call(File) === "[object FileConstructor]";
39892
+ function isBinary$1(obj) {
39893
+ return withNativeArrayBuffer2 && (obj instanceof ArrayBuffer || isView2(obj)) || withNativeBlob2 && obj instanceof Blob || withNativeFile && obj instanceof File;
39894
+ }
39895
+ isBinary.isBinary = isBinary$1;
39896
+ function hasBinary(obj, toJSON3) {
39897
+ if (!obj || typeof obj !== "object") {
39898
+ return false;
39899
+ }
39900
+ if (Array.isArray(obj)) {
39901
+ for (let i2 = 0, l2 = obj.length; i2 < l2; i2++) {
39902
+ if (hasBinary(obj[i2])) {
39903
+ return true;
39904
+ }
39899
39905
  }
39906
+ return false;
39900
39907
  }
39901
- return false;
39902
- }
39903
- if (isBinary(obj)) {
39904
- return true;
39905
- }
39906
- if (obj.toJSON && typeof obj.toJSON === "function" && arguments.length === 1) {
39907
- return hasBinary(obj.toJSON(), true);
39908
- }
39909
- for (const key2 in obj) {
39910
- if (Object.prototype.hasOwnProperty.call(obj, key2) && hasBinary(obj[key2])) {
39908
+ if (isBinary$1(obj)) {
39911
39909
  return true;
39912
39910
  }
39913
- }
39914
- return false;
39915
- }
39916
- isBinary$1.hasBinary = hasBinary;
39917
- Object.defineProperty(binary, "__esModule", { value: true });
39918
- binary.reconstructPacket = binary.deconstructPacket = void 0;
39919
- const is_binary_js_1 = isBinary$1;
39920
- function deconstructPacket(packet) {
39921
- const buffers = [];
39922
- const packetData = packet.data;
39923
- const pack = packet;
39924
- pack.data = _deconstructPacket(packetData, buffers);
39925
- pack.attachments = buffers.length;
39926
- return { packet: pack, buffers };
39927
- }
39928
- binary.deconstructPacket = deconstructPacket;
39929
- function _deconstructPacket(data2, buffers) {
39930
- if (!data2)
39931
- return data2;
39932
- if (is_binary_js_1.isBinary(data2)) {
39933
- const placeholder = { _placeholder: true, num: buffers.length };
39934
- buffers.push(data2);
39935
- return placeholder;
39936
- } else if (Array.isArray(data2)) {
39937
- const newData = new Array(data2.length);
39938
- for (let i2 = 0; i2 < data2.length; i2++) {
39939
- newData[i2] = _deconstructPacket(data2[i2], buffers);
39911
+ if (obj.toJSON && typeof obj.toJSON === "function" && arguments.length === 1) {
39912
+ return hasBinary(obj.toJSON(), true);
39940
39913
  }
39941
- return newData;
39942
- } else if (typeof data2 === "object" && !(data2 instanceof Date)) {
39943
- const newData = {};
39944
- for (const key2 in data2) {
39945
- if (Object.prototype.hasOwnProperty.call(data2, key2)) {
39946
- newData[key2] = _deconstructPacket(data2[key2], buffers);
39914
+ for (const key2 in obj) {
39915
+ if (Object.prototype.hasOwnProperty.call(obj, key2) && hasBinary(obj[key2])) {
39916
+ return true;
39947
39917
  }
39948
39918
  }
39949
- return newData;
39919
+ return false;
39950
39920
  }
39951
- return data2;
39952
- }
39953
- function reconstructPacket(packet, buffers) {
39954
- packet.data = _reconstructPacket(packet.data, buffers);
39955
- packet.attachments = void 0;
39956
- return packet;
39957
- }
39958
- binary.reconstructPacket = reconstructPacket;
39959
- function _reconstructPacket(data2, buffers) {
39960
- if (!data2)
39961
- return data2;
39962
- if (data2 && data2._placeholder === true) {
39963
- const isIndexValid = typeof data2.num === "number" && data2.num >= 0 && data2.num < buffers.length;
39964
- if (isIndexValid) {
39965
- return buffers[data2.num];
39966
- } else {
39967
- throw new Error("illegal attachments");
39968
- }
39969
- } else if (Array.isArray(data2)) {
39970
- for (let i2 = 0; i2 < data2.length; i2++) {
39971
- data2[i2] = _reconstructPacket(data2[i2], buffers);
39972
- }
39973
- } else if (typeof data2 === "object") {
39974
- for (const key2 in data2) {
39975
- if (Object.prototype.hasOwnProperty.call(data2, key2)) {
39976
- data2[key2] = _reconstructPacket(data2[key2], buffers);
39921
+ isBinary.hasBinary = hasBinary;
39922
+ return isBinary;
39923
+ }
39924
+ var hasRequiredBinary;
39925
+ function requireBinary() {
39926
+ if (hasRequiredBinary)
39927
+ return binary;
39928
+ hasRequiredBinary = 1;
39929
+ Object.defineProperty(binary, "__esModule", { value: true });
39930
+ binary.reconstructPacket = binary.deconstructPacket = void 0;
39931
+ const is_binary_js_1 = requireIsBinary();
39932
+ function deconstructPacket(packet) {
39933
+ const buffers = [];
39934
+ const packetData = packet.data;
39935
+ const pack = packet;
39936
+ pack.data = _deconstructPacket(packetData, buffers);
39937
+ pack.attachments = buffers.length;
39938
+ return { packet: pack, buffers };
39939
+ }
39940
+ binary.deconstructPacket = deconstructPacket;
39941
+ function _deconstructPacket(data2, buffers) {
39942
+ if (!data2)
39943
+ return data2;
39944
+ if (is_binary_js_1.isBinary(data2)) {
39945
+ const placeholder = { _placeholder: true, num: buffers.length };
39946
+ buffers.push(data2);
39947
+ return placeholder;
39948
+ } else if (Array.isArray(data2)) {
39949
+ const newData = new Array(data2.length);
39950
+ for (let i2 = 0; i2 < data2.length; i2++) {
39951
+ newData[i2] = _deconstructPacket(data2[i2], buffers);
39977
39952
  }
39953
+ return newData;
39954
+ } else if (typeof data2 === "object" && !(data2 instanceof Date)) {
39955
+ const newData = {};
39956
+ for (const key2 in data2) {
39957
+ if (Object.prototype.hasOwnProperty.call(data2, key2)) {
39958
+ newData[key2] = _deconstructPacket(data2[key2], buffers);
39959
+ }
39960
+ }
39961
+ return newData;
39978
39962
  }
39963
+ return data2;
39979
39964
  }
39980
- return data2;
39981
- }
39982
- (function(exports2) {
39983
- Object.defineProperty(exports2, "__esModule", { value: true });
39984
- exports2.Decoder = exports2.Encoder = exports2.PacketType = exports2.protocol = void 0;
39985
- const component_emitter_12 = require$$5;
39986
- const binary_js_1 = binary;
39987
- const is_binary_js_12 = isBinary$1;
39988
- const debug_12 = browser.exports;
39989
- const debug2 = debug_12.default("socket.io-parser");
39990
- exports2.protocol = 5;
39991
- var PacketType;
39992
- (function(PacketType2) {
39993
- PacketType2[PacketType2["CONNECT"] = 0] = "CONNECT";
39994
- PacketType2[PacketType2["DISCONNECT"] = 1] = "DISCONNECT";
39995
- PacketType2[PacketType2["EVENT"] = 2] = "EVENT";
39996
- PacketType2[PacketType2["ACK"] = 3] = "ACK";
39997
- PacketType2[PacketType2["CONNECT_ERROR"] = 4] = "CONNECT_ERROR";
39998
- PacketType2[PacketType2["BINARY_EVENT"] = 5] = "BINARY_EVENT";
39999
- PacketType2[PacketType2["BINARY_ACK"] = 6] = "BINARY_ACK";
40000
- })(PacketType = exports2.PacketType || (exports2.PacketType = {}));
40001
- class Encoder {
40002
- constructor(replacer) {
40003
- this.replacer = replacer;
40004
- }
40005
- encode(obj) {
40006
- debug2("encoding packet %j", obj);
40007
- if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {
40008
- if (is_binary_js_12.hasBinary(obj)) {
40009
- obj.type = obj.type === PacketType.EVENT ? PacketType.BINARY_EVENT : PacketType.BINARY_ACK;
40010
- return this.encodeAsBinary(obj);
40011
- }
40012
- }
40013
- return [this.encodeAsString(obj)];
40014
- }
40015
- encodeAsString(obj) {
40016
- let str = "" + obj.type;
40017
- if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) {
40018
- str += obj.attachments + "-";
40019
- }
40020
- if (obj.nsp && "/" !== obj.nsp) {
40021
- str += obj.nsp + ",";
40022
- }
40023
- if (null != obj.id) {
40024
- str += obj.id;
40025
- }
40026
- if (null != obj.data) {
40027
- str += JSON.stringify(obj.data, this.replacer);
40028
- }
40029
- debug2("encoded %j as %s", obj, str);
40030
- return str;
40031
- }
40032
- encodeAsBinary(obj) {
40033
- const deconstruction = binary_js_1.deconstructPacket(obj);
40034
- const pack = this.encodeAsString(deconstruction.packet);
40035
- const buffers = deconstruction.buffers;
40036
- buffers.unshift(pack);
40037
- return buffers;
40038
- }
40039
- }
40040
- exports2.Encoder = Encoder;
40041
- class Decoder extends component_emitter_12.Emitter {
40042
- constructor(reviver) {
40043
- super();
40044
- this.reviver = reviver;
40045
- }
40046
- add(obj) {
40047
- let packet;
40048
- if (typeof obj === "string") {
40049
- if (this.reconstructor) {
40050
- throw new Error("got plaintext data when reconstructing a packet");
39965
+ function reconstructPacket(packet, buffers) {
39966
+ packet.data = _reconstructPacket(packet.data, buffers);
39967
+ packet.attachments = void 0;
39968
+ return packet;
39969
+ }
39970
+ binary.reconstructPacket = reconstructPacket;
39971
+ function _reconstructPacket(data2, buffers) {
39972
+ if (!data2)
39973
+ return data2;
39974
+ if (data2 && data2._placeholder === true) {
39975
+ const isIndexValid = typeof data2.num === "number" && data2.num >= 0 && data2.num < buffers.length;
39976
+ if (isIndexValid) {
39977
+ return buffers[data2.num];
39978
+ } else {
39979
+ throw new Error("illegal attachments");
39980
+ }
39981
+ } else if (Array.isArray(data2)) {
39982
+ for (let i2 = 0; i2 < data2.length; i2++) {
39983
+ data2[i2] = _reconstructPacket(data2[i2], buffers);
39984
+ }
39985
+ } else if (typeof data2 === "object") {
39986
+ for (const key2 in data2) {
39987
+ if (Object.prototype.hasOwnProperty.call(data2, key2)) {
39988
+ data2[key2] = _reconstructPacket(data2[key2], buffers);
40051
39989
  }
40052
- packet = this.decodeString(obj);
40053
- if (packet.type === PacketType.BINARY_EVENT || packet.type === PacketType.BINARY_ACK) {
40054
- this.reconstructor = new BinaryReconstructor(packet);
40055
- if (packet.attachments === 0) {
39990
+ }
39991
+ }
39992
+ return data2;
39993
+ }
39994
+ return binary;
39995
+ }
39996
+ var hasRequiredCjs$1;
39997
+ function requireCjs$1() {
39998
+ if (hasRequiredCjs$1)
39999
+ return cjs;
40000
+ hasRequiredCjs$1 = 1;
40001
+ (function(exports2) {
40002
+ Object.defineProperty(exports2, "__esModule", { value: true });
40003
+ exports2.Decoder = exports2.Encoder = exports2.PacketType = exports2.protocol = void 0;
40004
+ const component_emitter_12 = require$$5;
40005
+ const binary_js_1 = requireBinary();
40006
+ const is_binary_js_1 = requireIsBinary();
40007
+ const debug_12 = browser.exports;
40008
+ const debug2 = debug_12.default("socket.io-parser");
40009
+ exports2.protocol = 5;
40010
+ var PacketType;
40011
+ (function(PacketType2) {
40012
+ PacketType2[PacketType2["CONNECT"] = 0] = "CONNECT";
40013
+ PacketType2[PacketType2["DISCONNECT"] = 1] = "DISCONNECT";
40014
+ PacketType2[PacketType2["EVENT"] = 2] = "EVENT";
40015
+ PacketType2[PacketType2["ACK"] = 3] = "ACK";
40016
+ PacketType2[PacketType2["CONNECT_ERROR"] = 4] = "CONNECT_ERROR";
40017
+ PacketType2[PacketType2["BINARY_EVENT"] = 5] = "BINARY_EVENT";
40018
+ PacketType2[PacketType2["BINARY_ACK"] = 6] = "BINARY_ACK";
40019
+ })(PacketType = exports2.PacketType || (exports2.PacketType = {}));
40020
+ class Encoder {
40021
+ constructor(replacer) {
40022
+ this.replacer = replacer;
40023
+ }
40024
+ encode(obj) {
40025
+ debug2("encoding packet %j", obj);
40026
+ if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {
40027
+ if (is_binary_js_1.hasBinary(obj)) {
40028
+ obj.type = obj.type === PacketType.EVENT ? PacketType.BINARY_EVENT : PacketType.BINARY_ACK;
40029
+ return this.encodeAsBinary(obj);
40030
+ }
40031
+ }
40032
+ return [this.encodeAsString(obj)];
40033
+ }
40034
+ encodeAsString(obj) {
40035
+ let str = "" + obj.type;
40036
+ if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) {
40037
+ str += obj.attachments + "-";
40038
+ }
40039
+ if (obj.nsp && "/" !== obj.nsp) {
40040
+ str += obj.nsp + ",";
40041
+ }
40042
+ if (null != obj.id) {
40043
+ str += obj.id;
40044
+ }
40045
+ if (null != obj.data) {
40046
+ str += JSON.stringify(obj.data, this.replacer);
40047
+ }
40048
+ debug2("encoded %j as %s", obj, str);
40049
+ return str;
40050
+ }
40051
+ encodeAsBinary(obj) {
40052
+ const deconstruction = binary_js_1.deconstructPacket(obj);
40053
+ const pack = this.encodeAsString(deconstruction.packet);
40054
+ const buffers = deconstruction.buffers;
40055
+ buffers.unshift(pack);
40056
+ return buffers;
40057
+ }
40058
+ }
40059
+ exports2.Encoder = Encoder;
40060
+ class Decoder extends component_emitter_12.Emitter {
40061
+ constructor(reviver) {
40062
+ super();
40063
+ this.reviver = reviver;
40064
+ }
40065
+ add(obj) {
40066
+ let packet;
40067
+ if (typeof obj === "string") {
40068
+ if (this.reconstructor) {
40069
+ throw new Error("got plaintext data when reconstructing a packet");
40070
+ }
40071
+ packet = this.decodeString(obj);
40072
+ if (packet.type === PacketType.BINARY_EVENT || packet.type === PacketType.BINARY_ACK) {
40073
+ this.reconstructor = new BinaryReconstructor(packet);
40074
+ if (packet.attachments === 0) {
40075
+ super.emitReserved("decoded", packet);
40076
+ }
40077
+ } else {
40056
40078
  super.emitReserved("decoded", packet);
40057
40079
  }
40058
- } else {
40059
- super.emitReserved("decoded", packet);
40060
- }
40061
- } else if (is_binary_js_12.isBinary(obj) || obj.base64) {
40062
- if (!this.reconstructor) {
40063
- throw new Error("got binary data when not reconstructing a packet");
40064
- } else {
40065
- packet = this.reconstructor.takeBinaryData(obj);
40066
- if (packet) {
40067
- this.reconstructor = null;
40068
- super.emitReserved("decoded", packet);
40080
+ } else if (is_binary_js_1.isBinary(obj) || obj.base64) {
40081
+ if (!this.reconstructor) {
40082
+ throw new Error("got binary data when not reconstructing a packet");
40083
+ } else {
40084
+ packet = this.reconstructor.takeBinaryData(obj);
40085
+ if (packet) {
40086
+ this.reconstructor = null;
40087
+ super.emitReserved("decoded", packet);
40088
+ }
40069
40089
  }
40090
+ } else {
40091
+ throw new Error("Unknown type: " + obj);
40070
40092
  }
40071
- } else {
40072
- throw new Error("Unknown type: " + obj);
40073
- }
40074
- }
40075
- decodeString(str) {
40076
- let i2 = 0;
40077
- const p2 = {
40078
- type: Number(str.charAt(0))
40079
- };
40080
- if (PacketType[p2.type] === void 0) {
40081
- throw new Error("unknown packet type " + p2.type);
40082
40093
  }
40083
- if (p2.type === PacketType.BINARY_EVENT || p2.type === PacketType.BINARY_ACK) {
40084
- const start = i2 + 1;
40085
- while (str.charAt(++i2) !== "-" && i2 != str.length) {
40094
+ decodeString(str) {
40095
+ let i2 = 0;
40096
+ const p2 = {
40097
+ type: Number(str.charAt(0))
40098
+ };
40099
+ if (PacketType[p2.type] === void 0) {
40100
+ throw new Error("unknown packet type " + p2.type);
40086
40101
  }
40087
- const buf = str.substring(start, i2);
40088
- if (buf != Number(buf) || str.charAt(i2) !== "-") {
40089
- throw new Error("Illegal attachments");
40102
+ if (p2.type === PacketType.BINARY_EVENT || p2.type === PacketType.BINARY_ACK) {
40103
+ const start = i2 + 1;
40104
+ while (str.charAt(++i2) !== "-" && i2 != str.length) {
40105
+ }
40106
+ const buf = str.substring(start, i2);
40107
+ if (buf != Number(buf) || str.charAt(i2) !== "-") {
40108
+ throw new Error("Illegal attachments");
40109
+ }
40110
+ p2.attachments = Number(buf);
40090
40111
  }
40091
- p2.attachments = Number(buf);
40092
- }
40093
- if ("/" === str.charAt(i2 + 1)) {
40094
- const start = i2 + 1;
40095
- while (++i2) {
40096
- const c2 = str.charAt(i2);
40097
- if ("," === c2)
40098
- break;
40099
- if (i2 === str.length)
40100
- break;
40112
+ if ("/" === str.charAt(i2 + 1)) {
40113
+ const start = i2 + 1;
40114
+ while (++i2) {
40115
+ const c2 = str.charAt(i2);
40116
+ if ("," === c2)
40117
+ break;
40118
+ if (i2 === str.length)
40119
+ break;
40120
+ }
40121
+ p2.nsp = str.substring(start, i2);
40122
+ } else {
40123
+ p2.nsp = "/";
40124
+ }
40125
+ const next = str.charAt(i2 + 1);
40126
+ if ("" !== next && Number(next) == next) {
40127
+ const start = i2 + 1;
40128
+ while (++i2) {
40129
+ const c2 = str.charAt(i2);
40130
+ if (null == c2 || Number(c2) != c2) {
40131
+ --i2;
40132
+ break;
40133
+ }
40134
+ if (i2 === str.length)
40135
+ break;
40136
+ }
40137
+ p2.id = Number(str.substring(start, i2 + 1));
40101
40138
  }
40102
- p2.nsp = str.substring(start, i2);
40103
- } else {
40104
- p2.nsp = "/";
40105
- }
40106
- const next = str.charAt(i2 + 1);
40107
- if ("" !== next && Number(next) == next) {
40108
- const start = i2 + 1;
40109
- while (++i2) {
40110
- const c2 = str.charAt(i2);
40111
- if (null == c2 || Number(c2) != c2) {
40112
- --i2;
40113
- break;
40139
+ if (str.charAt(++i2)) {
40140
+ const payload = this.tryParse(str.substr(i2));
40141
+ if (Decoder.isPayloadValid(p2.type, payload)) {
40142
+ p2.data = payload;
40143
+ } else {
40144
+ throw new Error("invalid payload");
40114
40145
  }
40115
- if (i2 === str.length)
40116
- break;
40117
40146
  }
40118
- p2.id = Number(str.substring(start, i2 + 1));
40147
+ debug2("decoded %s as %j", str, p2);
40148
+ return p2;
40119
40149
  }
40120
- if (str.charAt(++i2)) {
40121
- const payload = this.tryParse(str.substr(i2));
40122
- if (Decoder.isPayloadValid(p2.type, payload)) {
40123
- p2.data = payload;
40124
- } else {
40125
- throw new Error("invalid payload");
40150
+ tryParse(str) {
40151
+ try {
40152
+ return JSON.parse(str, this.reviver);
40153
+ } catch (e2) {
40154
+ return false;
40126
40155
  }
40127
40156
  }
40128
- debug2("decoded %s as %j", str, p2);
40129
- return p2;
40130
- }
40131
- tryParse(str) {
40132
- try {
40133
- return JSON.parse(str, this.reviver);
40134
- } catch (e2) {
40135
- return false;
40157
+ static isPayloadValid(type, payload) {
40158
+ switch (type) {
40159
+ case PacketType.CONNECT:
40160
+ return typeof payload === "object";
40161
+ case PacketType.DISCONNECT:
40162
+ return payload === void 0;
40163
+ case PacketType.CONNECT_ERROR:
40164
+ return typeof payload === "string" || typeof payload === "object";
40165
+ case PacketType.EVENT:
40166
+ case PacketType.BINARY_EVENT:
40167
+ return Array.isArray(payload) && payload.length > 0;
40168
+ case PacketType.ACK:
40169
+ case PacketType.BINARY_ACK:
40170
+ return Array.isArray(payload);
40171
+ }
40136
40172
  }
40137
- }
40138
- static isPayloadValid(type, payload) {
40139
- switch (type) {
40140
- case PacketType.CONNECT:
40141
- return typeof payload === "object";
40142
- case PacketType.DISCONNECT:
40143
- return payload === void 0;
40144
- case PacketType.CONNECT_ERROR:
40145
- return typeof payload === "string" || typeof payload === "object";
40146
- case PacketType.EVENT:
40147
- case PacketType.BINARY_EVENT:
40148
- return Array.isArray(payload) && payload.length > 0;
40149
- case PacketType.ACK:
40150
- case PacketType.BINARY_ACK:
40151
- return Array.isArray(payload);
40173
+ destroy() {
40174
+ if (this.reconstructor) {
40175
+ this.reconstructor.finishedReconstruction();
40176
+ }
40152
40177
  }
40153
40178
  }
40154
- destroy() {
40155
- if (this.reconstructor) {
40156
- this.reconstructor.finishedReconstruction();
40179
+ exports2.Decoder = Decoder;
40180
+ class BinaryReconstructor {
40181
+ constructor(packet) {
40182
+ this.packet = packet;
40183
+ this.buffers = [];
40184
+ this.reconPack = packet;
40157
40185
  }
40158
- }
40159
- }
40160
- exports2.Decoder = Decoder;
40161
- class BinaryReconstructor {
40162
- constructor(packet) {
40163
- this.packet = packet;
40164
- this.buffers = [];
40165
- this.reconPack = packet;
40166
- }
40167
- takeBinaryData(binData) {
40168
- this.buffers.push(binData);
40169
- if (this.buffers.length === this.reconPack.attachments) {
40170
- const packet = binary_js_1.reconstructPacket(this.reconPack, this.buffers);
40171
- this.finishedReconstruction();
40172
- return packet;
40186
+ takeBinaryData(binData) {
40187
+ this.buffers.push(binData);
40188
+ if (this.buffers.length === this.reconPack.attachments) {
40189
+ const packet = binary_js_1.reconstructPacket(this.reconPack, this.buffers);
40190
+ this.finishedReconstruction();
40191
+ return packet;
40192
+ }
40193
+ return null;
40194
+ }
40195
+ finishedReconstruction() {
40196
+ this.reconPack = null;
40197
+ this.buffers = [];
40173
40198
  }
40174
- return null;
40175
- }
40176
- finishedReconstruction() {
40177
- this.reconPack = null;
40178
- this.buffers = [];
40179
40199
  }
40180
- }
40181
- })(cjs);
40200
+ })(cjs);
40201
+ return cjs;
40202
+ }
40182
40203
  var on$1 = {};
40183
40204
  Object.defineProperty(on$1, "__esModule", { value: true });
40184
40205
  on$1.on = void 0;
@@ -40194,7 +40215,7 @@ var __importDefault$5 = commonjsGlobal$1 && commonjsGlobal$1.__importDefault ||
40194
40215
  };
40195
40216
  Object.defineProperty(socket, "__esModule", { value: true });
40196
40217
  socket.Socket = void 0;
40197
- const socket_io_parser_1 = cjs;
40218
+ const socket_io_parser_1 = requireCjs$1();
40198
40219
  const on_js_1$1 = on$1;
40199
40220
  const component_emitter_1$1 = require$$5;
40200
40221
  const debug_1$1 = __importDefault$5(browser.exports);
@@ -40608,7 +40629,7 @@ Object.defineProperty(manager, "__esModule", { value: true });
40608
40629
  manager.Manager = void 0;
40609
40630
  const engine_io_client_1 = cjs$2;
40610
40631
  const socket_js_1 = socket;
40611
- const parser = __importStar$2(cjs);
40632
+ const parser = __importStar$2(requireCjs$1());
40612
40633
  const on_js_1 = on$1;
40613
40634
  const backo2_js_1 = backo2;
40614
40635
  const component_emitter_1 = require$$5;
@@ -40923,7 +40944,7 @@ manager.Manager = Manager;
40923
40944
  io: lookup2,
40924
40945
  connect: lookup2
40925
40946
  });
40926
- var socket_io_parser_12 = cjs;
40947
+ var socket_io_parser_12 = requireCjs$1();
40927
40948
  Object.defineProperty(exports2, "protocol", { enumerable: true, get: function() {
40928
40949
  return socket_io_parser_12.protocol;
40929
40950
  } });
@@ -42638,7 +42659,7 @@ const Schedules = react.exports.memo(function({
42638
42659
  customer: customer == null ? void 0 : customer.id,
42639
42660
  isFuture: true,
42640
42661
  order: {
42641
- scheduledAt: "ASC"
42662
+ "calendar.scheduledAt": "ASC"
42642
42663
  }
42643
42664
  }]
42644
42665
  });
@@ -42748,12 +42769,28 @@ const Schedule = react.exports.memo(function({
42748
42769
  children: [/* @__PURE__ */ jsx(Text, {
42749
42770
  className: styles$1.reason,
42750
42771
  children: reason2 == null ? void 0 : reason2.truncate(30)
42751
- }), /* @__PURE__ */ jsxs(Text, {
42772
+ }), /* @__PURE__ */ jsx(Text, {
42752
42773
  className: styles$1.schTime,
42753
- children: [hooks(scheduledAt).calendar(null, {
42754
- sameElse: "hh:mm A",
42755
- nextWeek: "dddd HH:mm"
42756
- }), " ", "- ", hooks(scheduledAt).add(1, "hour").format("h:mm A")]
42774
+ children: hooks(scheduledAt).calendar(null, {
42775
+ lastDay: function() {
42776
+ return `[Yesterday at] HH:mm - ${hooks(this).add(1, "hour").format("HH:mm")}`;
42777
+ },
42778
+ sameDay: function() {
42779
+ return `[Today at] HH:mm - ${hooks(this).add(1, "hour").format("HH:mm")}`;
42780
+ },
42781
+ nextDay: function() {
42782
+ return `[Tomorrow at] HH:mm - ${hooks(this).add(1, "hour").format("HH:mm")}`;
42783
+ },
42784
+ lastWeek: function() {
42785
+ return `[last] dddd [at] HH:mm - ${hooks(this).add(1, "hour").format("HH:mm")}`;
42786
+ },
42787
+ nextWeek: function() {
42788
+ return `dddd [at] HH:mm - ${hooks(this).add(1, "hour").format("HH:mm")}`;
42789
+ },
42790
+ sameElse: function() {
42791
+ return `HH:mm - ${hooks(this).add(1, "hour").format("HH:mm")}`;
42792
+ }
42793
+ })
42757
42794
  })]
42758
42795
  })]
42759
42796
  }), /* @__PURE__ */ jsxs(Row$1, {
@@ -43107,7 +43144,7 @@ function WidgetInitForm({
43107
43144
  country_code: country_code2,
43108
43145
  timezone: timezone2
43109
43146
  } = data2.data;
43110
- const timezoneStringSplit = timezone2.split("/");
43147
+ const continent2 = timezone2.split("/")[0];
43111
43148
  setState({
43112
43149
  ipAddress: ip,
43113
43150
  country: country_name,
@@ -43115,18 +43152,18 @@ function WidgetInitForm({
43115
43152
  latitude: latitude2,
43116
43153
  location: region,
43117
43154
  country_code: country_code2,
43118
- continent: timezoneStringSplit[0]
43155
+ continent: continent2
43119
43156
  });
43120
- const requestObject = {
43157
+ createVisitor({
43121
43158
  ip_address: ip,
43122
- location: location2,
43123
- country,
43159
+ location: region,
43160
+ country: country_name,
43124
43161
  longitude: longitude2,
43125
43162
  latitude: latitude2,
43126
43163
  company: company_id,
43127
- source_url
43128
- };
43129
- createVisitor(requestObject);
43164
+ source_url,
43165
+ customer: companyUser == null ? void 0 : companyUser.id
43166
+ });
43130
43167
  }).catch((error) => toast.error("Error occured, try again", {
43131
43168
  autoClose: 2e3
43132
43169
  }));
@@ -43169,7 +43206,6 @@ function WidgetInitForm({
43169
43206
  ...data2
43170
43207
  }) => {
43171
43208
  if (status) {
43172
- console.log("customer", data2);
43173
43209
  dataRef.current = data2;
43174
43210
  setParentState({
43175
43211
  chatInit: true