@sawport/react-sdk 0.1.0-alpha.61 → 0.1.0-alpha.63

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
@@ -1366,14 +1366,14 @@ function baseToString$2(value2) {
1366
1366
  var result = value2 + "";
1367
1367
  return result == "0" && 1 / value2 == -INFINITY$2 ? "-0" : result;
1368
1368
  }
1369
- function toString$h(value2) {
1369
+ function toString$g(value2) {
1370
1370
  return value2 == null ? "" : baseToString$2(value2);
1371
1371
  }
1372
1372
  function toPath(value2) {
1373
1373
  if (isArray$l(value2)) {
1374
1374
  return arrayMap$2(value2, toKey$5);
1375
1375
  }
1376
- return isSymbol$a(value2) ? [value2] : copyArray(stringToPath$4(toString$h(value2)));
1376
+ return isSymbol$a(value2) ? [value2] : copyArray(stringToPath$4(toString$g(value2)));
1377
1377
  }
1378
1378
  var isProduction = true;
1379
1379
  function warning$4(condition, message) {
@@ -2712,7 +2712,7 @@ function baseClone(src2, circulars, clones) {
2712
2712
  function clone$2(src2) {
2713
2713
  return baseClone(src2, [], []);
2714
2714
  }
2715
- const toString$g = Object.prototype.toString;
2715
+ const toString$f = Object.prototype.toString;
2716
2716
  const errorToString = Error.prototype.toString;
2717
2717
  const regExpToString = RegExp.prototype.toString;
2718
2718
  const symbolToString$1 = typeof Symbol !== "undefined" ? Symbol.prototype.toString : () => "";
@@ -2735,7 +2735,7 @@ function printSimpleValue(val, quoteStrings = false) {
2735
2735
  return "[Function " + (val.name || "anonymous") + "]";
2736
2736
  if (typeOf === "symbol")
2737
2737
  return symbolToString$1.call(val).replace(SYMBOL_REGEXP, "Symbol($1)");
2738
- const tag = toString$g.call(val).slice(8, -1);
2738
+ const tag = toString$f.call(val).slice(8, -1);
2739
2739
  if (tag === "Date")
2740
2740
  return isNaN(val.getTime()) ? "" + val : val.toISOString(val);
2741
2741
  if (tag === "Error" || val instanceof Error)
@@ -3243,16 +3243,16 @@ function baseToString$1(value2) {
3243
3243
  }
3244
3244
  var _baseToString = baseToString$1;
3245
3245
  var baseToString = _baseToString;
3246
- function toString$f(value2) {
3246
+ function toString$e(value2) {
3247
3247
  return value2 == null ? "" : baseToString(value2);
3248
3248
  }
3249
- var toString_1 = toString$f;
3250
- var isArray$g = isArray_1, isKey$2 = _isKey, stringToPath$1 = _stringToPath, toString$e = toString_1;
3249
+ var toString_1 = toString$e;
3250
+ var isArray$g = isArray_1, isKey$2 = _isKey, stringToPath$1 = _stringToPath, toString$d = toString_1;
3251
3251
  function castPath$2(value2, object4) {
3252
3252
  if (isArray$g(value2)) {
3253
3253
  return value2;
3254
3254
  }
3255
- return isKey$2(value2, object4) ? [value2] : stringToPath$1(toString$e(value2));
3255
+ return isKey$2(value2, object4) ? [value2] : stringToPath$1(toString$d(value2));
3256
3256
  }
3257
3257
  var _castPath = castPath$2;
3258
3258
  var baseGetTag$2 = _baseGetTag, isObjectLike$3 = isObjectLike_1;
@@ -5554,13 +5554,13 @@ var deburredLetters = {
5554
5554
  };
5555
5555
  var deburrLetter$1 = basePropertyOf(deburredLetters);
5556
5556
  var _deburrLetter = deburrLetter$1;
5557
- var deburrLetter = _deburrLetter, toString$d = toString_1;
5557
+ var deburrLetter = _deburrLetter, toString$c = toString_1;
5558
5558
  var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
5559
5559
  var rsComboMarksRange$3 = "\\u0300-\\u036f", reComboHalfMarksRange$3 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$3 = "\\u20d0-\\u20ff", rsComboRange$3 = rsComboMarksRange$3 + reComboHalfMarksRange$3 + rsComboSymbolsRange$3;
5560
5560
  var rsCombo$2 = "[" + rsComboRange$3 + "]";
5561
5561
  var reComboMark = RegExp(rsCombo$2, "g");
5562
5562
  function deburr$1(string3) {
5563
- string3 = toString$d(string3);
5563
+ string3 = toString$c(string3);
5564
5564
  return string3 && string3.replace(reLatin, deburrLetter).replace(reComboMark, "");
5565
5565
  }
5566
5566
  var deburr_1 = deburr$1;
@@ -5591,9 +5591,9 @@ function unicodeWords$1(string3) {
5591
5591
  return string3.match(reUnicodeWord) || [];
5592
5592
  }
5593
5593
  var _unicodeWords = unicodeWords$1;
5594
- var asciiWords = _asciiWords, hasUnicodeWord = _hasUnicodeWord, toString$c = toString_1, unicodeWords = _unicodeWords;
5594
+ var asciiWords = _asciiWords, hasUnicodeWord = _hasUnicodeWord, toString$b = toString_1, unicodeWords = _unicodeWords;
5595
5595
  function words$1(string3, pattern4, guard) {
5596
- string3 = toString$c(string3);
5596
+ string3 = toString$b(string3);
5597
5597
  pattern4 = guard ? void 0 : pattern4;
5598
5598
  if (pattern4 === void 0) {
5599
5599
  return hasUnicodeWord(string3) ? unicodeWords(string3) : asciiWords(string3);
@@ -5664,10 +5664,10 @@ function stringToArray$1(string3) {
5664
5664
  return hasUnicode$1(string3) ? unicodeToArray(string3) : asciiToArray(string3);
5665
5665
  }
5666
5666
  var _stringToArray = stringToArray$1;
5667
- var castSlice = _castSlice, hasUnicode = _hasUnicode, stringToArray = _stringToArray, toString$b = toString_1;
5667
+ var castSlice = _castSlice, hasUnicode = _hasUnicode, stringToArray = _stringToArray, toString$a = toString_1;
5668
5668
  function createCaseFirst$1(methodName) {
5669
5669
  return function(string3) {
5670
- string3 = toString$b(string3);
5670
+ string3 = toString$a(string3);
5671
5671
  var strSymbols = hasUnicode(string3) ? stringToArray(string3) : void 0;
5672
5672
  var chr = strSymbols ? strSymbols[0] : string3.charAt(0);
5673
5673
  var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string3.slice(1);
@@ -5678,9 +5678,9 @@ var _createCaseFirst = createCaseFirst$1;
5678
5678
  var createCaseFirst = _createCaseFirst;
5679
5679
  var upperFirst$1 = createCaseFirst("toUpperCase");
5680
5680
  var upperFirst_1 = upperFirst$1;
5681
- var toString$a = toString_1, upperFirst = upperFirst_1;
5681
+ var toString$9 = toString_1, upperFirst = upperFirst_1;
5682
5682
  function capitalize$1(string3) {
5683
- return upperFirst(toString$a(string3).toLowerCase());
5683
+ return upperFirst(toString$9(string3).toLowerCase());
5684
5684
  }
5685
5685
  var capitalize_1 = capitalize$1;
5686
5686
  var capitalize = capitalize_1, createCompounder = _createCompounder;
@@ -6107,10 +6107,10 @@ var bind$9 = function bind(fn, thisArg) {
6107
6107
  };
6108
6108
  };
6109
6109
  var bind$8 = bind$9;
6110
- var toString$9 = Object.prototype.toString;
6110
+ var toString$8 = Object.prototype.toString;
6111
6111
  var kindOf = function(cache) {
6112
6112
  return function(thing) {
6113
- var str = toString$9.call(thing);
6113
+ var str = toString$8.call(thing);
6114
6114
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
6115
6115
  };
6116
6116
  }(/* @__PURE__ */ Object.create(null));
@@ -6160,14 +6160,14 @@ var isFile = kindOfTest("File");
6160
6160
  var isBlob = kindOfTest("Blob");
6161
6161
  var isFileList = kindOfTest("FileList");
6162
6162
  function isFunction$1(val) {
6163
- return toString$9.call(val) === "[object Function]";
6163
+ return toString$8.call(val) === "[object Function]";
6164
6164
  }
6165
6165
  function isStream(val) {
6166
6166
  return isObject$e(val) && isFunction$1(val.pipe);
6167
6167
  }
6168
6168
  function isFormData(thing) {
6169
6169
  var pattern4 = "[object FormData]";
6170
- return thing && (typeof FormData === "function" && thing instanceof FormData || toString$9.call(thing) === pattern4 || isFunction$1(thing.toString) && thing.toString() === pattern4);
6170
+ return thing && (typeof FormData === "function" && thing instanceof FormData || toString$8.call(thing) === pattern4 || isFunction$1(thing.toString) && thing.toString() === pattern4);
6171
6171
  }
6172
6172
  var isURLSearchParams = kindOfTest("URLSearchParams");
6173
6173
  function trim$2(str) {
@@ -11866,7 +11866,7 @@ function monthDiff(a2, b2) {
11866
11866
  }
11867
11867
  hooks.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ";
11868
11868
  hooks.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
11869
- function toString$8() {
11869
+ function toString$7() {
11870
11870
  return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
11871
11871
  }
11872
11872
  function toISOString(keepOffset) {
@@ -12577,7 +12577,7 @@ if (typeof Symbol !== "undefined" && Symbol.for != null) {
12577
12577
  };
12578
12578
  }
12579
12579
  proto.toJSON = toJSON2;
12580
- proto.toString = toString$8;
12580
+ proto.toString = toString$7;
12581
12581
  proto.unix = unix;
12582
12582
  proto.valueOf = valueOf;
12583
12583
  proto.creationData = creationData;
@@ -32946,19 +32946,19 @@ const ERROR_PACKET = { type: "error", data: "parser error" };
32946
32946
  commons.ERROR_PACKET = ERROR_PACKET;
32947
32947
  Object.defineProperty(encodePacket_browser, "__esModule", { value: true });
32948
32948
  const commons_js_1$1 = commons;
32949
- const withNativeBlob$1 = typeof Blob === "function" || typeof Blob !== "undefined" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]";
32950
- const withNativeArrayBuffer$2 = typeof ArrayBuffer === "function";
32951
- const isView$1 = (obj) => {
32949
+ const withNativeBlob = typeof Blob === "function" || typeof Blob !== "undefined" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]";
32950
+ const withNativeArrayBuffer$1 = typeof ArrayBuffer === "function";
32951
+ const isView = (obj) => {
32952
32952
  return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj && obj.buffer instanceof ArrayBuffer;
32953
32953
  };
32954
32954
  const encodePacket = ({ type: type4, data: data2 }, supportsBinary, callback) => {
32955
- if (withNativeBlob$1 && data2 instanceof Blob) {
32955
+ if (withNativeBlob && data2 instanceof Blob) {
32956
32956
  if (supportsBinary) {
32957
32957
  return callback(data2);
32958
32958
  } else {
32959
32959
  return encodeBlobAsBase64(data2, callback);
32960
32960
  }
32961
- } else if (withNativeArrayBuffer$2 && (data2 instanceof ArrayBuffer || isView$1(data2))) {
32961
+ } else if (withNativeArrayBuffer$1 && (data2 instanceof ArrayBuffer || isView(data2))) {
32962
32962
  if (supportsBinary) {
32963
32963
  return callback(data2);
32964
32964
  } else {
@@ -33025,7 +33025,7 @@ base64Arraybuffer.decode = decode$2;
33025
33025
  Object.defineProperty(decodePacket_browser, "__esModule", { value: true });
33026
33026
  const commons_js_1 = commons;
33027
33027
  const base64_arraybuffer_js_1 = base64Arraybuffer;
33028
- const withNativeArrayBuffer$1 = typeof ArrayBuffer === "function";
33028
+ const withNativeArrayBuffer = typeof ArrayBuffer === "function";
33029
33029
  const decodePacket = (encodedPacket, binaryType) => {
33030
33030
  if (typeof encodedPacket !== "string") {
33031
33031
  return {
@@ -33052,7 +33052,7 @@ const decodePacket = (encodedPacket, binaryType) => {
33052
33052
  };
33053
33053
  };
33054
33054
  const decodeBase64Packet = (data2, binaryType) => {
33055
- if (withNativeArrayBuffer$1) {
33055
+ if (withNativeArrayBuffer) {
33056
33056
  const decoded = (0, base64_arraybuffer_js_1.decode)(data2);
33057
33057
  return mapBinary(decoded, binaryType);
33058
33058
  } else {
@@ -34825,311 +34825,332 @@ var manager = {};
34825
34825
  var socket = {};
34826
34826
  var cjs = {};
34827
34827
  var binary = {};
34828
- var isBinary$1 = {};
34829
- Object.defineProperty(isBinary$1, "__esModule", { value: true });
34830
- isBinary$1.hasBinary = isBinary$1.isBinary = void 0;
34831
- const withNativeArrayBuffer = typeof ArrayBuffer === "function";
34832
- const isView = (obj) => {
34833
- return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj.buffer instanceof ArrayBuffer;
34834
- };
34835
- const toString$7 = Object.prototype.toString;
34836
- const withNativeBlob = typeof Blob === "function" || typeof Blob !== "undefined" && toString$7.call(Blob) === "[object BlobConstructor]";
34837
- const withNativeFile = typeof File === "function" || typeof File !== "undefined" && toString$7.call(File) === "[object FileConstructor]";
34838
- function isBinary(obj) {
34839
- return withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)) || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File;
34840
- }
34841
- isBinary$1.isBinary = isBinary;
34842
- function hasBinary(obj, toJSON3) {
34843
- if (!obj || typeof obj !== "object") {
34844
- return false;
34845
- }
34846
- if (Array.isArray(obj)) {
34847
- for (let i2 = 0, l2 = obj.length; i2 < l2; i2++) {
34848
- if (hasBinary(obj[i2])) {
34849
- return true;
34828
+ var isBinary = {};
34829
+ var hasRequiredIsBinary;
34830
+ function requireIsBinary() {
34831
+ if (hasRequiredIsBinary)
34832
+ return isBinary;
34833
+ hasRequiredIsBinary = 1;
34834
+ Object.defineProperty(isBinary, "__esModule", { value: true });
34835
+ isBinary.hasBinary = isBinary.isBinary = void 0;
34836
+ const withNativeArrayBuffer2 = typeof ArrayBuffer === "function";
34837
+ const isView2 = (obj) => {
34838
+ return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj.buffer instanceof ArrayBuffer;
34839
+ };
34840
+ const toString3 = Object.prototype.toString;
34841
+ const withNativeBlob2 = typeof Blob === "function" || typeof Blob !== "undefined" && toString3.call(Blob) === "[object BlobConstructor]";
34842
+ const withNativeFile = typeof File === "function" || typeof File !== "undefined" && toString3.call(File) === "[object FileConstructor]";
34843
+ function isBinary$1(obj) {
34844
+ return withNativeArrayBuffer2 && (obj instanceof ArrayBuffer || isView2(obj)) || withNativeBlob2 && obj instanceof Blob || withNativeFile && obj instanceof File;
34845
+ }
34846
+ isBinary.isBinary = isBinary$1;
34847
+ function hasBinary(obj, toJSON3) {
34848
+ if (!obj || typeof obj !== "object") {
34849
+ return false;
34850
+ }
34851
+ if (Array.isArray(obj)) {
34852
+ for (let i2 = 0, l2 = obj.length; i2 < l2; i2++) {
34853
+ if (hasBinary(obj[i2])) {
34854
+ return true;
34855
+ }
34850
34856
  }
34857
+ return false;
34851
34858
  }
34852
- return false;
34853
- }
34854
- if (isBinary(obj)) {
34855
- return true;
34856
- }
34857
- if (obj.toJSON && typeof obj.toJSON === "function" && arguments.length === 1) {
34858
- return hasBinary(obj.toJSON(), true);
34859
- }
34860
- for (const key in obj) {
34861
- if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {
34859
+ if (isBinary$1(obj)) {
34862
34860
  return true;
34863
34861
  }
34864
- }
34865
- return false;
34866
- }
34867
- isBinary$1.hasBinary = hasBinary;
34868
- Object.defineProperty(binary, "__esModule", { value: true });
34869
- binary.reconstructPacket = binary.deconstructPacket = void 0;
34870
- const is_binary_js_1 = isBinary$1;
34871
- function deconstructPacket(packet) {
34872
- const buffers = [];
34873
- const packetData = packet.data;
34874
- const pack = packet;
34875
- pack.data = _deconstructPacket(packetData, buffers);
34876
- pack.attachments = buffers.length;
34877
- return { packet: pack, buffers };
34878
- }
34879
- binary.deconstructPacket = deconstructPacket;
34880
- function _deconstructPacket(data2, buffers) {
34881
- if (!data2)
34882
- return data2;
34883
- if (is_binary_js_1.isBinary(data2)) {
34884
- const placeholder = { _placeholder: true, num: buffers.length };
34885
- buffers.push(data2);
34886
- return placeholder;
34887
- } else if (Array.isArray(data2)) {
34888
- const newData = new Array(data2.length);
34889
- for (let i2 = 0; i2 < data2.length; i2++) {
34890
- newData[i2] = _deconstructPacket(data2[i2], buffers);
34862
+ if (obj.toJSON && typeof obj.toJSON === "function" && arguments.length === 1) {
34863
+ return hasBinary(obj.toJSON(), true);
34891
34864
  }
34892
- return newData;
34893
- } else if (typeof data2 === "object" && !(data2 instanceof Date)) {
34894
- const newData = {};
34895
- for (const key in data2) {
34896
- if (Object.prototype.hasOwnProperty.call(data2, key)) {
34897
- newData[key] = _deconstructPacket(data2[key], buffers);
34865
+ for (const key in obj) {
34866
+ if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {
34867
+ return true;
34898
34868
  }
34899
34869
  }
34900
- return newData;
34870
+ return false;
34901
34871
  }
34902
- return data2;
34903
- }
34904
- function reconstructPacket(packet, buffers) {
34905
- packet.data = _reconstructPacket(packet.data, buffers);
34906
- packet.attachments = void 0;
34907
- return packet;
34908
- }
34909
- binary.reconstructPacket = reconstructPacket;
34910
- function _reconstructPacket(data2, buffers) {
34911
- if (!data2)
34912
- return data2;
34913
- if (data2 && data2._placeholder === true) {
34914
- const isIndexValid = typeof data2.num === "number" && data2.num >= 0 && data2.num < buffers.length;
34915
- if (isIndexValid) {
34916
- return buffers[data2.num];
34917
- } else {
34918
- throw new Error("illegal attachments");
34919
- }
34920
- } else if (Array.isArray(data2)) {
34921
- for (let i2 = 0; i2 < data2.length; i2++) {
34922
- data2[i2] = _reconstructPacket(data2[i2], buffers);
34923
- }
34924
- } else if (typeof data2 === "object") {
34925
- for (const key in data2) {
34926
- if (Object.prototype.hasOwnProperty.call(data2, key)) {
34927
- data2[key] = _reconstructPacket(data2[key], buffers);
34872
+ isBinary.hasBinary = hasBinary;
34873
+ return isBinary;
34874
+ }
34875
+ var hasRequiredBinary;
34876
+ function requireBinary() {
34877
+ if (hasRequiredBinary)
34878
+ return binary;
34879
+ hasRequiredBinary = 1;
34880
+ Object.defineProperty(binary, "__esModule", { value: true });
34881
+ binary.reconstructPacket = binary.deconstructPacket = void 0;
34882
+ const is_binary_js_1 = requireIsBinary();
34883
+ function deconstructPacket(packet) {
34884
+ const buffers = [];
34885
+ const packetData = packet.data;
34886
+ const pack = packet;
34887
+ pack.data = _deconstructPacket(packetData, buffers);
34888
+ pack.attachments = buffers.length;
34889
+ return { packet: pack, buffers };
34890
+ }
34891
+ binary.deconstructPacket = deconstructPacket;
34892
+ function _deconstructPacket(data2, buffers) {
34893
+ if (!data2)
34894
+ return data2;
34895
+ if (is_binary_js_1.isBinary(data2)) {
34896
+ const placeholder = { _placeholder: true, num: buffers.length };
34897
+ buffers.push(data2);
34898
+ return placeholder;
34899
+ } else if (Array.isArray(data2)) {
34900
+ const newData = new Array(data2.length);
34901
+ for (let i2 = 0; i2 < data2.length; i2++) {
34902
+ newData[i2] = _deconstructPacket(data2[i2], buffers);
34903
+ }
34904
+ return newData;
34905
+ } else if (typeof data2 === "object" && !(data2 instanceof Date)) {
34906
+ const newData = {};
34907
+ for (const key in data2) {
34908
+ if (Object.prototype.hasOwnProperty.call(data2, key)) {
34909
+ newData[key] = _deconstructPacket(data2[key], buffers);
34910
+ }
34928
34911
  }
34912
+ return newData;
34929
34913
  }
34914
+ return data2;
34930
34915
  }
34931
- return data2;
34932
- }
34933
- (function(exports2) {
34934
- Object.defineProperty(exports2, "__esModule", { value: true });
34935
- exports2.Decoder = exports2.Encoder = exports2.PacketType = exports2.protocol = void 0;
34936
- const component_emitter_12 = require$$5;
34937
- const binary_js_1 = binary;
34938
- const is_binary_js_12 = isBinary$1;
34939
- const debug_12 = browser.exports;
34940
- const debug2 = debug_12.default("socket.io-parser");
34941
- exports2.protocol = 5;
34942
- var PacketType;
34943
- (function(PacketType2) {
34944
- PacketType2[PacketType2["CONNECT"] = 0] = "CONNECT";
34945
- PacketType2[PacketType2["DISCONNECT"] = 1] = "DISCONNECT";
34946
- PacketType2[PacketType2["EVENT"] = 2] = "EVENT";
34947
- PacketType2[PacketType2["ACK"] = 3] = "ACK";
34948
- PacketType2[PacketType2["CONNECT_ERROR"] = 4] = "CONNECT_ERROR";
34949
- PacketType2[PacketType2["BINARY_EVENT"] = 5] = "BINARY_EVENT";
34950
- PacketType2[PacketType2["BINARY_ACK"] = 6] = "BINARY_ACK";
34951
- })(PacketType = exports2.PacketType || (exports2.PacketType = {}));
34952
- class Encoder {
34953
- constructor(replacer) {
34954
- this.replacer = replacer;
34955
- }
34956
- encode(obj) {
34957
- debug2("encoding packet %j", obj);
34958
- if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {
34959
- if (is_binary_js_12.hasBinary(obj)) {
34960
- obj.type = obj.type === PacketType.EVENT ? PacketType.BINARY_EVENT : PacketType.BINARY_ACK;
34961
- return this.encodeAsBinary(obj);
34962
- }
34963
- }
34964
- return [this.encodeAsString(obj)];
34965
- }
34966
- encodeAsString(obj) {
34967
- let str = "" + obj.type;
34968
- if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) {
34969
- str += obj.attachments + "-";
34970
- }
34971
- if (obj.nsp && "/" !== obj.nsp) {
34972
- str += obj.nsp + ",";
34973
- }
34974
- if (null != obj.id) {
34975
- str += obj.id;
34976
- }
34977
- if (null != obj.data) {
34978
- str += JSON.stringify(obj.data, this.replacer);
34979
- }
34980
- debug2("encoded %j as %s", obj, str);
34981
- return str;
34982
- }
34983
- encodeAsBinary(obj) {
34984
- const deconstruction = binary_js_1.deconstructPacket(obj);
34985
- const pack = this.encodeAsString(deconstruction.packet);
34986
- const buffers = deconstruction.buffers;
34987
- buffers.unshift(pack);
34988
- return buffers;
34989
- }
34990
- }
34991
- exports2.Encoder = Encoder;
34992
- class Decoder extends component_emitter_12.Emitter {
34993
- constructor(reviver) {
34994
- super();
34995
- this.reviver = reviver;
34996
- }
34997
- add(obj) {
34998
- let packet;
34999
- if (typeof obj === "string") {
35000
- if (this.reconstructor) {
35001
- throw new Error("got plaintext data when reconstructing a packet");
34916
+ function reconstructPacket(packet, buffers) {
34917
+ packet.data = _reconstructPacket(packet.data, buffers);
34918
+ packet.attachments = void 0;
34919
+ return packet;
34920
+ }
34921
+ binary.reconstructPacket = reconstructPacket;
34922
+ function _reconstructPacket(data2, buffers) {
34923
+ if (!data2)
34924
+ return data2;
34925
+ if (data2 && data2._placeholder === true) {
34926
+ const isIndexValid = typeof data2.num === "number" && data2.num >= 0 && data2.num < buffers.length;
34927
+ if (isIndexValid) {
34928
+ return buffers[data2.num];
34929
+ } else {
34930
+ throw new Error("illegal attachments");
34931
+ }
34932
+ } else if (Array.isArray(data2)) {
34933
+ for (let i2 = 0; i2 < data2.length; i2++) {
34934
+ data2[i2] = _reconstructPacket(data2[i2], buffers);
34935
+ }
34936
+ } else if (typeof data2 === "object") {
34937
+ for (const key in data2) {
34938
+ if (Object.prototype.hasOwnProperty.call(data2, key)) {
34939
+ data2[key] = _reconstructPacket(data2[key], buffers);
35002
34940
  }
35003
- packet = this.decodeString(obj);
35004
- if (packet.type === PacketType.BINARY_EVENT || packet.type === PacketType.BINARY_ACK) {
35005
- this.reconstructor = new BinaryReconstructor(packet);
35006
- if (packet.attachments === 0) {
35007
- super.emitReserved("decoded", packet);
34941
+ }
34942
+ }
34943
+ return data2;
34944
+ }
34945
+ return binary;
34946
+ }
34947
+ var hasRequiredCjs$1;
34948
+ function requireCjs$1() {
34949
+ if (hasRequiredCjs$1)
34950
+ return cjs;
34951
+ hasRequiredCjs$1 = 1;
34952
+ (function(exports2) {
34953
+ Object.defineProperty(exports2, "__esModule", { value: true });
34954
+ exports2.Decoder = exports2.Encoder = exports2.PacketType = exports2.protocol = void 0;
34955
+ const component_emitter_12 = require$$5;
34956
+ const binary_js_1 = requireBinary();
34957
+ const is_binary_js_1 = requireIsBinary();
34958
+ const debug_12 = browser.exports;
34959
+ const debug2 = debug_12.default("socket.io-parser");
34960
+ exports2.protocol = 5;
34961
+ var PacketType;
34962
+ (function(PacketType2) {
34963
+ PacketType2[PacketType2["CONNECT"] = 0] = "CONNECT";
34964
+ PacketType2[PacketType2["DISCONNECT"] = 1] = "DISCONNECT";
34965
+ PacketType2[PacketType2["EVENT"] = 2] = "EVENT";
34966
+ PacketType2[PacketType2["ACK"] = 3] = "ACK";
34967
+ PacketType2[PacketType2["CONNECT_ERROR"] = 4] = "CONNECT_ERROR";
34968
+ PacketType2[PacketType2["BINARY_EVENT"] = 5] = "BINARY_EVENT";
34969
+ PacketType2[PacketType2["BINARY_ACK"] = 6] = "BINARY_ACK";
34970
+ })(PacketType = exports2.PacketType || (exports2.PacketType = {}));
34971
+ class Encoder {
34972
+ constructor(replacer) {
34973
+ this.replacer = replacer;
34974
+ }
34975
+ encode(obj) {
34976
+ debug2("encoding packet %j", obj);
34977
+ if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {
34978
+ if (is_binary_js_1.hasBinary(obj)) {
34979
+ obj.type = obj.type === PacketType.EVENT ? PacketType.BINARY_EVENT : PacketType.BINARY_ACK;
34980
+ return this.encodeAsBinary(obj);
35008
34981
  }
35009
- } else {
35010
- super.emitReserved("decoded", packet);
35011
34982
  }
35012
- } else if (is_binary_js_12.isBinary(obj) || obj.base64) {
35013
- if (!this.reconstructor) {
35014
- throw new Error("got binary data when not reconstructing a packet");
35015
- } else {
35016
- packet = this.reconstructor.takeBinaryData(obj);
35017
- if (packet) {
35018
- this.reconstructor = null;
35019
- super.emitReserved("decoded", packet);
35020
- }
34983
+ return [this.encodeAsString(obj)];
34984
+ }
34985
+ encodeAsString(obj) {
34986
+ let str = "" + obj.type;
34987
+ if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) {
34988
+ str += obj.attachments + "-";
35021
34989
  }
35022
- } else {
35023
- throw new Error("Unknown type: " + obj);
34990
+ if (obj.nsp && "/" !== obj.nsp) {
34991
+ str += obj.nsp + ",";
34992
+ }
34993
+ if (null != obj.id) {
34994
+ str += obj.id;
34995
+ }
34996
+ if (null != obj.data) {
34997
+ str += JSON.stringify(obj.data, this.replacer);
34998
+ }
34999
+ debug2("encoded %j as %s", obj, str);
35000
+ return str;
35001
+ }
35002
+ encodeAsBinary(obj) {
35003
+ const deconstruction = binary_js_1.deconstructPacket(obj);
35004
+ const pack = this.encodeAsString(deconstruction.packet);
35005
+ const buffers = deconstruction.buffers;
35006
+ buffers.unshift(pack);
35007
+ return buffers;
35024
35008
  }
35025
35009
  }
35026
- decodeString(str) {
35027
- let i2 = 0;
35028
- const p2 = {
35029
- type: Number(str.charAt(0))
35030
- };
35031
- if (PacketType[p2.type] === void 0) {
35032
- throw new Error("unknown packet type " + p2.type);
35010
+ exports2.Encoder = Encoder;
35011
+ class Decoder extends component_emitter_12.Emitter {
35012
+ constructor(reviver) {
35013
+ super();
35014
+ this.reviver = reviver;
35033
35015
  }
35034
- if (p2.type === PacketType.BINARY_EVENT || p2.type === PacketType.BINARY_ACK) {
35035
- const start = i2 + 1;
35036
- while (str.charAt(++i2) !== "-" && i2 != str.length) {
35037
- }
35038
- const buf = str.substring(start, i2);
35039
- if (buf != Number(buf) || str.charAt(i2) !== "-") {
35040
- throw new Error("Illegal attachments");
35016
+ add(obj) {
35017
+ let packet;
35018
+ if (typeof obj === "string") {
35019
+ if (this.reconstructor) {
35020
+ throw new Error("got plaintext data when reconstructing a packet");
35021
+ }
35022
+ packet = this.decodeString(obj);
35023
+ if (packet.type === PacketType.BINARY_EVENT || packet.type === PacketType.BINARY_ACK) {
35024
+ this.reconstructor = new BinaryReconstructor(packet);
35025
+ if (packet.attachments === 0) {
35026
+ super.emitReserved("decoded", packet);
35027
+ }
35028
+ } else {
35029
+ super.emitReserved("decoded", packet);
35030
+ }
35031
+ } else if (is_binary_js_1.isBinary(obj) || obj.base64) {
35032
+ if (!this.reconstructor) {
35033
+ throw new Error("got binary data when not reconstructing a packet");
35034
+ } else {
35035
+ packet = this.reconstructor.takeBinaryData(obj);
35036
+ if (packet) {
35037
+ this.reconstructor = null;
35038
+ super.emitReserved("decoded", packet);
35039
+ }
35040
+ }
35041
+ } else {
35042
+ throw new Error("Unknown type: " + obj);
35041
35043
  }
35042
- p2.attachments = Number(buf);
35043
35044
  }
35044
- if ("/" === str.charAt(i2 + 1)) {
35045
- const start = i2 + 1;
35046
- while (++i2) {
35047
- const c2 = str.charAt(i2);
35048
- if ("," === c2)
35049
- break;
35050
- if (i2 === str.length)
35051
- break;
35045
+ decodeString(str) {
35046
+ let i2 = 0;
35047
+ const p2 = {
35048
+ type: Number(str.charAt(0))
35049
+ };
35050
+ if (PacketType[p2.type] === void 0) {
35051
+ throw new Error("unknown packet type " + p2.type);
35052
35052
  }
35053
- p2.nsp = str.substring(start, i2);
35054
- } else {
35055
- p2.nsp = "/";
35056
- }
35057
- const next2 = str.charAt(i2 + 1);
35058
- if ("" !== next2 && Number(next2) == next2) {
35059
- const start = i2 + 1;
35060
- while (++i2) {
35061
- const c2 = str.charAt(i2);
35062
- if (null == c2 || Number(c2) != c2) {
35063
- --i2;
35064
- break;
35053
+ if (p2.type === PacketType.BINARY_EVENT || p2.type === PacketType.BINARY_ACK) {
35054
+ const start = i2 + 1;
35055
+ while (str.charAt(++i2) !== "-" && i2 != str.length) {
35065
35056
  }
35066
- if (i2 === str.length)
35067
- break;
35057
+ const buf = str.substring(start, i2);
35058
+ if (buf != Number(buf) || str.charAt(i2) !== "-") {
35059
+ throw new Error("Illegal attachments");
35060
+ }
35061
+ p2.attachments = Number(buf);
35068
35062
  }
35069
- p2.id = Number(str.substring(start, i2 + 1));
35070
- }
35071
- if (str.charAt(++i2)) {
35072
- const payload = this.tryParse(str.substr(i2));
35073
- if (Decoder.isPayloadValid(p2.type, payload)) {
35074
- p2.data = payload;
35063
+ if ("/" === str.charAt(i2 + 1)) {
35064
+ const start = i2 + 1;
35065
+ while (++i2) {
35066
+ const c2 = str.charAt(i2);
35067
+ if ("," === c2)
35068
+ break;
35069
+ if (i2 === str.length)
35070
+ break;
35071
+ }
35072
+ p2.nsp = str.substring(start, i2);
35075
35073
  } else {
35076
- throw new Error("invalid payload");
35074
+ p2.nsp = "/";
35075
+ }
35076
+ const next2 = str.charAt(i2 + 1);
35077
+ if ("" !== next2 && Number(next2) == next2) {
35078
+ const start = i2 + 1;
35079
+ while (++i2) {
35080
+ const c2 = str.charAt(i2);
35081
+ if (null == c2 || Number(c2) != c2) {
35082
+ --i2;
35083
+ break;
35084
+ }
35085
+ if (i2 === str.length)
35086
+ break;
35087
+ }
35088
+ p2.id = Number(str.substring(start, i2 + 1));
35077
35089
  }
35090
+ if (str.charAt(++i2)) {
35091
+ const payload = this.tryParse(str.substr(i2));
35092
+ if (Decoder.isPayloadValid(p2.type, payload)) {
35093
+ p2.data = payload;
35094
+ } else {
35095
+ throw new Error("invalid payload");
35096
+ }
35097
+ }
35098
+ debug2("decoded %s as %j", str, p2);
35099
+ return p2;
35078
35100
  }
35079
- debug2("decoded %s as %j", str, p2);
35080
- return p2;
35081
- }
35082
- tryParse(str) {
35083
- try {
35084
- return JSON.parse(str, this.reviver);
35085
- } catch (e2) {
35086
- return false;
35101
+ tryParse(str) {
35102
+ try {
35103
+ return JSON.parse(str, this.reviver);
35104
+ } catch (e2) {
35105
+ return false;
35106
+ }
35087
35107
  }
35088
- }
35089
- static isPayloadValid(type4, payload) {
35090
- switch (type4) {
35091
- case PacketType.CONNECT:
35092
- return typeof payload === "object";
35093
- case PacketType.DISCONNECT:
35094
- return payload === void 0;
35095
- case PacketType.CONNECT_ERROR:
35096
- return typeof payload === "string" || typeof payload === "object";
35097
- case PacketType.EVENT:
35098
- case PacketType.BINARY_EVENT:
35099
- return Array.isArray(payload) && payload.length > 0;
35100
- case PacketType.ACK:
35101
- case PacketType.BINARY_ACK:
35102
- return Array.isArray(payload);
35108
+ static isPayloadValid(type4, payload) {
35109
+ switch (type4) {
35110
+ case PacketType.CONNECT:
35111
+ return typeof payload === "object";
35112
+ case PacketType.DISCONNECT:
35113
+ return payload === void 0;
35114
+ case PacketType.CONNECT_ERROR:
35115
+ return typeof payload === "string" || typeof payload === "object";
35116
+ case PacketType.EVENT:
35117
+ case PacketType.BINARY_EVENT:
35118
+ return Array.isArray(payload) && payload.length > 0;
35119
+ case PacketType.ACK:
35120
+ case PacketType.BINARY_ACK:
35121
+ return Array.isArray(payload);
35122
+ }
35103
35123
  }
35104
- }
35105
- destroy() {
35106
- if (this.reconstructor) {
35107
- this.reconstructor.finishedReconstruction();
35124
+ destroy() {
35125
+ if (this.reconstructor) {
35126
+ this.reconstructor.finishedReconstruction();
35127
+ }
35108
35128
  }
35109
35129
  }
35110
- }
35111
- exports2.Decoder = Decoder;
35112
- class BinaryReconstructor {
35113
- constructor(packet) {
35114
- this.packet = packet;
35115
- this.buffers = [];
35116
- this.reconPack = packet;
35117
- }
35118
- takeBinaryData(binData) {
35119
- this.buffers.push(binData);
35120
- if (this.buffers.length === this.reconPack.attachments) {
35121
- const packet = binary_js_1.reconstructPacket(this.reconPack, this.buffers);
35122
- this.finishedReconstruction();
35123
- return packet;
35130
+ exports2.Decoder = Decoder;
35131
+ class BinaryReconstructor {
35132
+ constructor(packet) {
35133
+ this.packet = packet;
35134
+ this.buffers = [];
35135
+ this.reconPack = packet;
35136
+ }
35137
+ takeBinaryData(binData) {
35138
+ this.buffers.push(binData);
35139
+ if (this.buffers.length === this.reconPack.attachments) {
35140
+ const packet = binary_js_1.reconstructPacket(this.reconPack, this.buffers);
35141
+ this.finishedReconstruction();
35142
+ return packet;
35143
+ }
35144
+ return null;
35145
+ }
35146
+ finishedReconstruction() {
35147
+ this.reconPack = null;
35148
+ this.buffers = [];
35124
35149
  }
35125
- return null;
35126
- }
35127
- finishedReconstruction() {
35128
- this.reconPack = null;
35129
- this.buffers = [];
35130
35150
  }
35131
- }
35132
- })(cjs);
35151
+ })(cjs);
35152
+ return cjs;
35153
+ }
35133
35154
  var on$1 = {};
35134
35155
  Object.defineProperty(on$1, "__esModule", { value: true });
35135
35156
  on$1.on = void 0;
@@ -35145,7 +35166,7 @@ var __importDefault$5 = commonjsGlobal$1 && commonjsGlobal$1.__importDefault ||
35145
35166
  };
35146
35167
  Object.defineProperty(socket, "__esModule", { value: true });
35147
35168
  socket.Socket = void 0;
35148
- const socket_io_parser_1 = cjs;
35169
+ const socket_io_parser_1 = requireCjs$1();
35149
35170
  const on_js_1$1 = on$1;
35150
35171
  const component_emitter_1$1 = require$$5;
35151
35172
  const debug_1$1 = __importDefault$5(browser.exports);
@@ -35559,7 +35580,7 @@ Object.defineProperty(manager, "__esModule", { value: true });
35559
35580
  manager.Manager = void 0;
35560
35581
  const engine_io_client_1 = cjs$2;
35561
35582
  const socket_js_1 = socket;
35562
- const parser = __importStar$2(cjs);
35583
+ const parser = __importStar$2(requireCjs$1());
35563
35584
  const on_js_1 = on$1;
35564
35585
  const backo2_js_1 = backo2;
35565
35586
  const component_emitter_1 = require$$5;
@@ -35874,7 +35895,7 @@ manager.Manager = Manager;
35874
35895
  io: lookup2,
35875
35896
  connect: lookup2
35876
35897
  });
35877
- var socket_io_parser_12 = cjs;
35898
+ var socket_io_parser_12 = requireCjs$1();
35878
35899
  Object.defineProperty(exports2, "protocol", { enumerable: true, get: function() {
35879
35900
  return socket_io_parser_12.protocol;
35880
35901
  } });
@@ -72014,7 +72035,7 @@ function ChatWidgetScreen({
72014
72035
  if (timer)
72015
72036
  clearTimeout(timer);
72016
72037
  return;
72017
- } else if (popupTime && !agentDetails || !timeoutTriggered) {
72038
+ } else if (popupTime && !agentDetails && dataRef.current.wait.status === "waiting" || !timeoutTriggered && dataRef.current.wait.status === "waiting") {
72018
72039
  clearTimeout(timer);
72019
72040
  timer = setTimeout(() => {
72020
72041
  setPopupVisible(true);
@@ -72047,14 +72068,12 @@ function ChatWidgetScreen({
72047
72068
  children: [/* @__PURE__ */ jsxs("div", {
72048
72069
  id: "widget-chat-send",
72049
72070
  className: "widget-chat-display-container",
72050
- children: [/* @__PURE__ */ jsxs("div", {
72071
+ children: [/* @__PURE__ */ jsx("div", {
72051
72072
  className: "chat-receive-container mb-4 d-flex align-items-center",
72052
- children: [/* @__PURE__ */ jsx("p", {
72073
+ children: /* @__PURE__ */ jsx("p", {
72053
72074
  className: `widget-chat-receive mb-0`,
72054
72075
  children: welcome_message
72055
- }), /* @__PURE__ */ jsx("small", {
72056
- children: hooks().calendar()
72057
- })]
72076
+ })
72058
72077
  }), /* @__PURE__ */ jsx(Messages, {
72059
72078
  chatMessages: messages2,
72060
72079
  dataRef,
@@ -72518,8 +72537,8 @@ function WidgetOfflineHeader({
72518
72537
  }), /* @__PURE__ */ jsx(SubTitle, {
72519
72538
  from_day: company == null ? void 0 : company.from_day.substring(0, 3),
72520
72539
  to_day: company == null ? void 0 : company.to_day.substring(0, 3),
72521
- from_time: hooks("2020-04-04 " + (company == null ? void 0 : company.from_time)).format("hh:mm A"),
72522
- to_time: hooks("2020-04-04 " + (company == null ? void 0 : company.to_time)).format("hh:mm A")
72540
+ from_time: hooks.tz(company == null ? void 0 : company.from_time, "hh:mm", company.timezone).local().format("hh:mm A"),
72541
+ to_time: hooks.tz(company == null ? void 0 : company.to_time, "hh:mm", company.timezone).local().format("hh:mm A")
72523
72542
  })]
72524
72543
  });
72525
72544
  }
@@ -73929,16 +73948,13 @@ const WidgetInitOnlineHeader = ({
73929
73948
  alt: "Banner",
73930
73949
  className: "banner-image"
73931
73950
  }) : /* @__PURE__ */ jsxs("div", {
73932
- className: "position-relative",
73951
+ className: "ml-2 d-flex align-items-center",
73933
73952
  children: [company.logo && /* @__PURE__ */ jsx("img", {
73934
73953
  src: company == null ? void 0 : company.logo,
73935
73954
  alt: "logo",
73936
73955
  style: {
73937
73956
  width: "50px",
73938
- height: "50px",
73939
- position: "absolute",
73940
- left: "10px",
73941
- top: "20px"
73957
+ height: "50px"
73942
73958
  }
73943
73959
  }), /* @__PURE__ */ jsx("p", {
73944
73960
  className: "ml-3 p my-3",
@@ -74044,11 +74060,11 @@ function UnwrapWidget({
74044
74060
  const cDay = now2.day();
74045
74061
  const startDay = days[company == null ? void 0 : company.from_day];
74046
74062
  const endDay = days[company == null ? void 0 : company.to_day];
74047
- const time2 = hooks(company == null ? void 0 : company.from_time, "hh:mm:ss");
74048
- const endtime = hooks(company == null ? void 0 : company.to_time, "hh:mm:ss");
74063
+ const time2 = hooks.tz(company == null ? void 0 : company.from_time, "hh:mm:ss", company == null ? void 0 : company.timezone).local();
74064
+ const endtime = hooks.tz(company == null ? void 0 : company.to_time, "hh:mm:ss", company == null ? void 0 : company.timezone).local();
74049
74065
  return !(cDay >= startDay && cDay <= endDay && now2.isAfter(time2) && now2.isBefore(endtime));
74050
74066
  }
74051
- }, [isLoadingCompany, company == null ? void 0 : company.name]);
74067
+ }, [isLoadingCompany, company == null ? void 0 : company.name, company == null ? void 0 : company.timezone]);
74052
74068
  react.exports.useEffect(() => {
74053
74069
  if (!isLoadingCompany) {
74054
74070
  const timeout = setTimeout(() => setShowTip(true), 100);