kucservice 1.2.0 → 1.2.1

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.
@@ -922,6 +922,56 @@ module.exports = function (it) {
922
922
  };
923
923
 
924
924
 
925
+ /***/ }),
926
+
927
+ /***/ "1da1":
928
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
929
+
930
+ "use strict";
931
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; });
932
+ /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("d3b7");
933
+ /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_0__);
934
+ /* harmony import */ var core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("e6cf");
935
+ /* harmony import */ var core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_1__);
936
+
937
+
938
+
939
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
940
+ try {
941
+ var info = gen[key](arg);
942
+ var value = info.value;
943
+ } catch (error) {
944
+ reject(error);
945
+ return;
946
+ }
947
+
948
+ if (info.done) {
949
+ resolve(value);
950
+ } else {
951
+ Promise.resolve(value).then(_next, _throw);
952
+ }
953
+ }
954
+
955
+ function _asyncToGenerator(fn) {
956
+ return function () {
957
+ var self = this,
958
+ args = arguments;
959
+ return new Promise(function (resolve, reject) {
960
+ var gen = fn.apply(self, args);
961
+
962
+ function _next(value) {
963
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
964
+ }
965
+
966
+ function _throw(err) {
967
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
968
+ }
969
+
970
+ _next(undefined);
971
+ });
972
+ };
973
+ }
974
+
925
975
  /***/ }),
926
976
 
927
977
  /***/ "1dde":
@@ -1556,6 +1606,18 @@ defineIterator(String, 'String', function (iterated) {
1556
1606
  module.exports = {};
1557
1607
 
1558
1608
 
1609
+ /***/ }),
1610
+
1611
+ /***/ "408a":
1612
+ /***/ (function(module, exports, __webpack_require__) {
1613
+
1614
+ var uncurryThis = __webpack_require__("e330");
1615
+
1616
+ // `thisNumberValue` abstract operation
1617
+ // https://tc39.es/ecma262/#sec-thisnumbervalue
1618
+ module.exports = uncurryThis(1.0.valueOf);
1619
+
1620
+
1559
1621
  /***/ }),
1560
1622
 
1561
1623
  /***/ "40d5":
@@ -1695,48 +1757,16 @@ function _isNativeReflectConstruct() {
1695
1757
  return false;
1696
1758
  }
1697
1759
  }
1698
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
1699
- var es_symbol = __webpack_require__("a4d3");
1700
-
1701
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
1702
- var es_symbol_description = __webpack_require__("e01a");
1703
-
1704
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.iterator.js
1705
- var es_symbol_iterator = __webpack_require__("d28b");
1706
-
1707
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.iterator.js
1708
- var es_array_iterator = __webpack_require__("e260");
1709
-
1710
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js
1711
- var es_string_iterator = __webpack_require__("3ca3");
1712
-
1713
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
1714
- var web_dom_collections_iterator = __webpack_require__("ddb0");
1715
-
1716
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
1717
-
1718
-
1760
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
1761
+ var esm_typeof = __webpack_require__("53ca");
1719
1762
 
1720
-
1721
-
1722
-
1723
-
1724
- function _typeof(obj) {
1725
- "@babel/helpers - typeof";
1726
-
1727
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1728
- return typeof obj;
1729
- } : function (obj) {
1730
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1731
- }, _typeof(obj);
1732
- }
1733
1763
  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
1734
1764
 
1735
1765
 
1736
1766
 
1737
1767
 
1738
1768
  function _possibleConstructorReturn(self, call) {
1739
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
1769
+ if (call && (Object(esm_typeof["a" /* default */])(call) === "object" || typeof call === "function")) {
1740
1770
  return call;
1741
1771
  } else if (call !== void 0) {
1742
1772
  throw new TypeError("Derived constructors may only return object or undefined");
@@ -1767,9 +1797,18 @@ function _createSuper(Derived) {
1767
1797
  return _possibleConstructorReturn(this, result);
1768
1798
  };
1769
1799
  }
1800
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.iterator.js
1801
+ var es_array_iterator = __webpack_require__("e260");
1802
+
1770
1803
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.map.js
1771
1804
  var es_map = __webpack_require__("4ec9");
1772
1805
 
1806
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js
1807
+ var es_string_iterator = __webpack_require__("3ca3");
1808
+
1809
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
1810
+ var web_dom_collections_iterator = __webpack_require__("ddb0");
1811
+
1773
1812
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.index-of.js
1774
1813
  var es_array_index_of = __webpack_require__("c975");
1775
1814
 
@@ -1936,13 +1975,13 @@ var DEFAULT_CHECK_DATA = {
1936
1975
  var CLOSE_ABNORMAL = 1000; // WebSocket正常关闭code码
1937
1976
 
1938
1977
  function deepClone(source) {
1939
- if (!source && _typeof(source) !== 'object') {
1978
+ if (!source && Object(esm_typeof["a" /* default */])(source) !== 'object') {
1940
1979
  throw new Error('error arguments', 'deepClone');
1941
1980
  }
1942
1981
 
1943
1982
  var targetObj = source.constructor === Array ? [] : {};
1944
1983
  Object.keys(source).forEach(function (keys) {
1945
- if (source[keys] && _typeof(source[keys]) === 'object') {
1984
+ if (source[keys] && Object(esm_typeof["a" /* default */])(source[keys]) === 'object') {
1946
1985
  targetObj[keys] = deepClone(source[keys]);
1947
1986
  } else {
1948
1987
  targetObj[keys] = source[keys];
@@ -2005,7 +2044,7 @@ var websocket_Socket = /*#__PURE__*/function (_WebSocket) {
2005
2044
  checkData = options.checkData;
2006
2045
 
2007
2046
  var _queryParams = Object.keys(query).reduce(function (str, key) {
2008
- if (_typeof(query[key]) !== 'object' && typeof query[key] !== 'function') {
2047
+ if (Object(esm_typeof["a" /* default */])(query[key]) !== 'object' && typeof query[key] !== 'function') {
2009
2048
  return str += str.length > 0 ? "&".concat(key, "=").concat(query[key]) : "".concat(key, "=").concat(query[key]);
2010
2049
  } else {
2011
2050
  return str;
@@ -2149,7 +2188,7 @@ var websocket_Socket = /*#__PURE__*/function (_WebSocket) {
2149
2188
 
2150
2189
  this.heartCheckInterval = setInterval(function () {
2151
2190
  if (_this4.readyState === _this4.OPEN) {
2152
- var transformJSON = _typeof(_this4.heartCheckData) === 'object';
2191
+ var transformJSON = Object(esm_typeof["a" /* default */])(_this4.heartCheckData) === 'object';
2153
2192
 
2154
2193
  _this4.sendMessage(_this4.heartCheckData, {
2155
2194
  transformJSON: transformJSON
@@ -2701,6 +2740,44 @@ webpackContext.id = "5180";
2701
2740
 
2702
2741
  /***/ }),
2703
2742
 
2743
+ /***/ "53ca":
2744
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2745
+
2746
+ "use strict";
2747
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
2748
+ /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a4d3");
2749
+ /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__);
2750
+ /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("e01a");
2751
+ /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__);
2752
+ /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("d3b7");
2753
+ /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__);
2754
+ /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("d28b");
2755
+ /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3__);
2756
+ /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("e260");
2757
+ /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__);
2758
+ /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("3ca3");
2759
+ /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__);
2760
+ /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("ddb0");
2761
+ /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__);
2762
+
2763
+
2764
+
2765
+
2766
+
2767
+
2768
+
2769
+ function _typeof(obj) {
2770
+ "@babel/helpers - typeof";
2771
+
2772
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
2773
+ return typeof obj;
2774
+ } : function (obj) {
2775
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2776
+ }, _typeof(obj);
2777
+ }
2778
+
2779
+ /***/ }),
2780
+
2704
2781
  /***/ "5692":
2705
2782
  /***/ (function(module, exports, __webpack_require__) {
2706
2783
 
@@ -2755,6 +2832,54 @@ module.exports = function (argument) {
2755
2832
  };
2756
2833
 
2757
2834
 
2835
+ /***/ }),
2836
+
2837
+ /***/ "5899":
2838
+ /***/ (function(module, exports) {
2839
+
2840
+ // a string of all valid unicode whitespaces
2841
+ module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
2842
+ '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
2843
+
2844
+
2845
+ /***/ }),
2846
+
2847
+ /***/ "58a8":
2848
+ /***/ (function(module, exports, __webpack_require__) {
2849
+
2850
+ var uncurryThis = __webpack_require__("e330");
2851
+ var requireObjectCoercible = __webpack_require__("1d80");
2852
+ var toString = __webpack_require__("577e");
2853
+ var whitespaces = __webpack_require__("5899");
2854
+
2855
+ var replace = uncurryThis(''.replace);
2856
+ var whitespace = '[' + whitespaces + ']';
2857
+ var ltrim = RegExp('^' + whitespace + whitespace + '*');
2858
+ var rtrim = RegExp(whitespace + whitespace + '*$');
2859
+
2860
+ // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
2861
+ var createMethod = function (TYPE) {
2862
+ return function ($this) {
2863
+ var string = toString(requireObjectCoercible($this));
2864
+ if (TYPE & 1) string = replace(string, ltrim, '');
2865
+ if (TYPE & 2) string = replace(string, rtrim, '');
2866
+ return string;
2867
+ };
2868
+ };
2869
+
2870
+ module.exports = {
2871
+ // `String.prototype.{ trimLeft, trimStart }` methods
2872
+ // https://tc39.es/ecma262/#sec-string.prototype.trimstart
2873
+ start: createMethod(1),
2874
+ // `String.prototype.{ trimRight, trimEnd }` methods
2875
+ // https://tc39.es/ecma262/#sec-string.prototype.trimend
2876
+ end: createMethod(2),
2877
+ // `String.prototype.trim` method
2878
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
2879
+ trim: createMethod(3)
2880
+ };
2881
+
2882
+
2758
2883
  /***/ }),
2759
2884
 
2760
2885
  /***/ "5926":
@@ -3822,51 +3947,9 @@ __webpack_require__.r(__webpack_exports__);
3822
3947
  // EXPORTS
3823
3948
  __webpack_require__.d(__webpack_exports__, "useHttp", function() { return /* binding */ useHttp; });
3824
3949
 
3825
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
3826
- var es_object_to_string = __webpack_require__("d3b7");
3827
-
3828
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.js
3829
- var es_promise = __webpack_require__("e6cf");
3830
-
3831
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
3832
-
3833
-
3834
-
3835
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
3836
- try {
3837
- var info = gen[key](arg);
3838
- var value = info.value;
3839
- } catch (error) {
3840
- reject(error);
3841
- return;
3842
- }
3843
-
3844
- if (info.done) {
3845
- resolve(value);
3846
- } else {
3847
- Promise.resolve(value).then(_next, _throw);
3848
- }
3849
- }
3850
-
3851
- function _asyncToGenerator(fn) {
3852
- return function () {
3853
- var self = this,
3854
- args = arguments;
3855
- return new Promise(function (resolve, reject) {
3856
- var gen = fn.apply(self, args);
3857
-
3858
- function _next(value) {
3859
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
3860
- }
3861
-
3862
- function _throw(err) {
3863
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
3864
- }
3950
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
3951
+ var asyncToGenerator = __webpack_require__("1da1");
3865
3952
 
3866
- _next(undefined);
3867
- });
3868
- };
3869
- }
3870
3953
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.is-array.js
3871
3954
  var es_array_is_array = __webpack_require__("277d");
3872
3955
 
@@ -3892,6 +3975,9 @@ var es_symbol = __webpack_require__("a4d3");
3892
3975
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
3893
3976
  var es_symbol_description = __webpack_require__("e01a");
3894
3977
 
3978
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
3979
+ var es_object_to_string = __webpack_require__("d3b7");
3980
+
3895
3981
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.iterator.js
3896
3982
  var es_symbol_iterator = __webpack_require__("d28b");
3897
3983
 
@@ -4051,6 +4137,9 @@ var es_array_index_of = __webpack_require__("c975");
4051
4137
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
4052
4138
  var es_array_concat = __webpack_require__("99af");
4053
4139
 
4140
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.js
4141
+ var es_promise = __webpack_require__("e6cf");
4142
+
4054
4143
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.weak-map.js
4055
4144
  var es_weak_map = __webpack_require__("10d1");
4056
4145
 
@@ -4139,7 +4228,7 @@ var http_httpWay = /*#__PURE__*/function () {
4139
4228
  Object(createClass["a" /* default */])(httpWay, [{
4140
4229
  key: "initAsync",
4141
4230
  value: function () {
4142
- var _initAsync = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(params, success, fail) {
4231
+ var _initAsync = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee(params, success, fail) {
4143
4232
  var response, text;
4144
4233
  return regeneratorRuntime.wrap(function _callee$(_context) {
4145
4234
  while (1) {
@@ -5957,6 +6046,102 @@ module.exports = function (METHOD_NAME, argument) {
5957
6046
  };
5958
6047
 
5959
6048
 
6049
+ /***/ }),
6050
+
6051
+ /***/ "a9e3":
6052
+ /***/ (function(module, exports, __webpack_require__) {
6053
+
6054
+ "use strict";
6055
+
6056
+ var DESCRIPTORS = __webpack_require__("83ab");
6057
+ var global = __webpack_require__("da84");
6058
+ var uncurryThis = __webpack_require__("e330");
6059
+ var isForced = __webpack_require__("94ca");
6060
+ var redefine = __webpack_require__("6eeb");
6061
+ var hasOwn = __webpack_require__("1a2d");
6062
+ var inheritIfRequired = __webpack_require__("7156");
6063
+ var isPrototypeOf = __webpack_require__("3a9b");
6064
+ var isSymbol = __webpack_require__("d9b5");
6065
+ var toPrimitive = __webpack_require__("c04e");
6066
+ var fails = __webpack_require__("d039");
6067
+ var getOwnPropertyNames = __webpack_require__("241c").f;
6068
+ var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
6069
+ var defineProperty = __webpack_require__("9bf2").f;
6070
+ var thisNumberValue = __webpack_require__("408a");
6071
+ var trim = __webpack_require__("58a8").trim;
6072
+
6073
+ var NUMBER = 'Number';
6074
+ var NativeNumber = global[NUMBER];
6075
+ var NumberPrototype = NativeNumber.prototype;
6076
+ var TypeError = global.TypeError;
6077
+ var arraySlice = uncurryThis(''.slice);
6078
+ var charCodeAt = uncurryThis(''.charCodeAt);
6079
+
6080
+ // `ToNumeric` abstract operation
6081
+ // https://tc39.es/ecma262/#sec-tonumeric
6082
+ var toNumeric = function (value) {
6083
+ var primValue = toPrimitive(value, 'number');
6084
+ return typeof primValue == 'bigint' ? primValue : toNumber(primValue);
6085
+ };
6086
+
6087
+ // `ToNumber` abstract operation
6088
+ // https://tc39.es/ecma262/#sec-tonumber
6089
+ var toNumber = function (argument) {
6090
+ var it = toPrimitive(argument, 'number');
6091
+ var first, third, radix, maxCode, digits, length, index, code;
6092
+ if (isSymbol(it)) throw TypeError('Cannot convert a Symbol value to a number');
6093
+ if (typeof it == 'string' && it.length > 2) {
6094
+ it = trim(it);
6095
+ first = charCodeAt(it, 0);
6096
+ if (first === 43 || first === 45) {
6097
+ third = charCodeAt(it, 2);
6098
+ if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
6099
+ } else if (first === 48) {
6100
+ switch (charCodeAt(it, 1)) {
6101
+ case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
6102
+ case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
6103
+ default: return +it;
6104
+ }
6105
+ digits = arraySlice(it, 2);
6106
+ length = digits.length;
6107
+ for (index = 0; index < length; index++) {
6108
+ code = charCodeAt(digits, index);
6109
+ // parseInt parses a string to a first unavailable symbol
6110
+ // but ToNumber should return NaN if a string contains unavailable symbols
6111
+ if (code < 48 || code > maxCode) return NaN;
6112
+ } return parseInt(digits, radix);
6113
+ }
6114
+ } return +it;
6115
+ };
6116
+
6117
+ // `Number` constructor
6118
+ // https://tc39.es/ecma262/#sec-number-constructor
6119
+ if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
6120
+ var NumberWrapper = function Number(value) {
6121
+ var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
6122
+ var dummy = this;
6123
+ // check on 1..constructor(foo) case
6124
+ return isPrototypeOf(NumberPrototype, dummy) && fails(function () { thisNumberValue(dummy); })
6125
+ ? inheritIfRequired(Object(n), dummy, NumberWrapper) : n;
6126
+ };
6127
+ for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
6128
+ // ES3:
6129
+ 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
6130
+ // ES2015 (in case, if modules with ES2015 Number statics required before):
6131
+ 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' +
6132
+ // ESNext
6133
+ 'fromString,range'
6134
+ ).split(','), j = 0, key; keys.length > j; j++) {
6135
+ if (hasOwn(NativeNumber, key = keys[j]) && !hasOwn(NumberWrapper, key)) {
6136
+ defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
6137
+ }
6138
+ }
6139
+ NumberWrapper.prototype = NumberPrototype;
6140
+ NumberPrototype.constructor = NumberWrapper;
6141
+ redefine(global, NUMBER, NumberWrapper);
6142
+ }
6143
+
6144
+
5960
6145
  /***/ }),
5961
6146
 
5962
6147
  /***/ "aa1f":
@@ -8754,17 +8939,37 @@ var modulesFiles = mf.keys().reduce(function (pre, cur) {
8754
8939
  console.log("=====modulesFiles========");
8755
8940
  console.log(modulesFiles);
8756
8941
  /* harmony default export */ var webApi = (modulesFiles);
8757
- // CONCATENATED MODULE: ./src/common-request.js
8942
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
8943
+ var asyncToGenerator = __webpack_require__("1da1");
8758
8944
 
8945
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
8946
+ var esm_typeof = __webpack_require__("53ca");
8759
8947
 
8948
+ // EXTERNAL MODULE: ./node_modules/regenerator-runtime/runtime.js
8949
+ var runtime = __webpack_require__("96cf");
8760
8950
 
8951
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.define-property.js
8952
+ var es_object_define_property = __webpack_require__("7a82");
8761
8953
 
8954
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.js
8955
+ var es_promise = __webpack_require__("e6cf");
8762
8956
 
8957
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
8958
+ var es_number_constructor = __webpack_require__("a9e3");
8763
8959
 
8960
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/web.timers.js
8961
+ var web_timers = __webpack_require__("4795");
8764
8962
 
8963
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.index-of.js
8964
+ var es_array_index_of = __webpack_require__("c975");
8765
8965
 
8966
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.test.js
8967
+ var es_regexp_test = __webpack_require__("00b4");
8766
8968
 
8969
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.is-array.js
8970
+ var es_array_is_array = __webpack_require__("277d");
8767
8971
 
8972
+ // CONCATENATED MODULE: ./src/lib/phoneClient/index.mjs
8768
8973
 
8769
8974
 
8770
8975
 
@@ -8773,29 +8978,1100 @@ console.log(modulesFiles);
8773
8978
 
8774
8979
 
8775
8980
 
8776
- /**
8777
- * 接口请求通用方法
8778
- * @param {*} url
8779
- * @param {*} param
8780
- * @param {*} backSuccfn
8781
- * @param {*} async
8782
- * @param {*} method
8783
- */
8784
8981
 
8785
- var common_request_useRequest = function useRequest(type) {
8786
- console.log(webApi);
8787
- var requestObj = webApi[type];
8788
- console.log(requestObj);
8789
- if (!requestObj) throw new Error('未找到对应的请求方法!');
8790
- return function () {
8791
- return requestObj.apply(void 0, arguments);
8792
- };
8793
- };
8794
8982
 
8795
- var initWsBaseTheme = function initWsBaseTheme(socket, _ref) {
8796
- var onOpen = _ref.onOpen,
8797
- onClose = _ref.onClose,
8798
- onMessage = _ref.onMessage,
8983
+
8984
+
8985
+
8986
+
8987
+
8988
+
8989
+
8990
+
8991
+
8992
+
8993
+ var T = Object.defineProperty;
8994
+
8995
+ var w = function w(d, e, t) {
8996
+ return e in d ? T(d, e, {
8997
+ enumerable: !0,
8998
+ configurable: !0,
8999
+ writable: !0,
9000
+ value: t
9001
+ }) : d[e] = t;
9002
+ };
9003
+
9004
+ var phoneClient_b = function b(d, e, t) {
9005
+ return w(d, Object(esm_typeof["a" /* default */])(e) != "symbol" ? e + "" : e, t), t;
9006
+ };
9007
+
9008
+ var phoneClient_j = /*#__PURE__*/function () {
9009
+ function j(e) {
9010
+ var _this = this;
9011
+
9012
+ Object(classCallCheck["a" /* default */])(this, j);
9013
+
9014
+ phoneClient_b(this, "socket", null);
9015
+ phoneClient_b(this, "RTC", null);
9016
+ phoneClient_b(this, "bindLocalPicture", function (e) {
9017
+ var t = document.querySelector("#" + _this.localId);
9018
+ t.srcObject = e, t.onloadedmetadata = function () {
9019
+ t.play();
9020
+ };
9021
+ });
9022
+ this.wsUrl = e, this.Offer = null, this.localId = "", this.remoteId = "", this.remoteAudioId = "", this.videoStream = null, this.timeOutKL = null, this.reloadObj = {
9023
+ num: 0,
9024
+ maxNum: 10,
9025
+ timeOut: null,
9026
+ reloadTime: 5e3,
9027
+ href: ""
9028
+ }, this.mediaSet = {
9029
+ video: !0,
9030
+ audio: !0
9031
+ }, this.callData = {}, this.socketCode = -1, this.compatible(), this.createRTC(), this.newSocket();
9032
+ }
9033
+
9034
+ Object(createClass["a" /* default */])(j, [{
9035
+ key: "compatible",
9036
+ value: function compatible() {
9037
+ window.RTCPeerConnection = window.RTCPeerConnection || window.webkitRTCPeerConnection || window.mozRTCPeerConnection || window.msRTCPeerConnection, navigator.mediaDevices.getUserMedia === void 0 && (navigator.mediaDevices.getUserMedia = function (e) {
9038
+ var t = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;
9039
+ return t ? new Promise(function (o, i) {
9040
+ t.call(navigator, e, o, i);
9041
+ }) : Promise.reject(new Error("getUserMedia is not implemented in this browser"));
9042
+ }());
9043
+ }
9044
+ }, {
9045
+ key: "newSocket",
9046
+ value: function newSocket() {
9047
+ if (this.socket && (console.log(this.socket), this.socket = null), !this.online()) {
9048
+ console.log("当前网络差,无法连接");
9049
+ return;
9050
+ }
9051
+
9052
+ if (this.wsUrl) this.socket = new WebSocket(this.wsUrl), this.initSocekt();else throw new Error("前端提示:WebSocket缺少baseURL!");
9053
+ }
9054
+ }, {
9055
+ key: "initSocekt",
9056
+ value: function initSocekt() {
9057
+ this.open(), this.message(), this.error(), this.close(), this.disconnect();
9058
+ }
9059
+ }, {
9060
+ key: "online",
9061
+ value: function online() {
9062
+ var e = !0;
9063
+ return navigator.onLine ? e = !0 : e = !1, e;
9064
+ }
9065
+ }, {
9066
+ key: "onbeforeunload",
9067
+ value: function onbeforeunload() {
9068
+ console.log("页面关闭");
9069
+ }
9070
+ }, {
9071
+ key: "onunload",
9072
+ value: function onunload() {
9073
+ console.log("页面刷新");
9074
+ }
9075
+ }, {
9076
+ key: "checkReadyState",
9077
+ value: function checkReadyState() {
9078
+ return Number(this.socket.readyState);
9079
+ }
9080
+ }, {
9081
+ key: "open",
9082
+ value: function open() {
9083
+ var _this2 = this;
9084
+
9085
+ var e = this;
9086
+
9087
+ this.socket.onopen = function (t) {
9088
+ console.log("onopen--->", t);
9089
+
9090
+ var o = _this2.checkReadyState();
9091
+
9092
+ e.socketCode = o;
9093
+ var i = "";
9094
+
9095
+ switch (Number(o)) {
9096
+ case 1:
9097
+ console.log("连接成功"), i = "socket连接成功_" + t.type, e.num = 0, e.keepLive();
9098
+ break;
9099
+
9100
+ case 2:
9101
+ console.log("连接正在关闭"), i = "socket连接正在关闭_" + t.type;
9102
+ break;
9103
+
9104
+ case 3:
9105
+ console.log("连接已经关闭,或失败"), i = "socket连接失败_" + t.type, e.reloadObj.num = e.reloadObj.num + 1, e.reloadObj.num >= e.reloadObj.maxNum ? (i = "大于最大连接次数,停止连接,返回首页", console.log("大于最大连接次数,停止连接,返回首页"), e.reloadObj.href && (window.location.href = e.reloadObj.href), e.reloadObj.timeOut && clearTimeout(e.reloadObj.timeOut), e.reloadObj.timeOut = setTimeout(function () {
9106
+ e.close();
9107
+ }, e.reloadObj.reloadTime)) : console.log("继续连接");
9108
+ break;
9109
+ }
9110
+
9111
+ e.messageBack && (o == 1 ? e.messageBack.call(null, {
9112
+ type: t.type,
9113
+ code: 200,
9114
+ message: i
9115
+ }) : e.messageBack.call(null, {
9116
+ type: t.type,
9117
+ code: -1,
9118
+ err: i
9119
+ }));
9120
+ };
9121
+ }
9122
+ }, {
9123
+ key: "keepLive",
9124
+ value: function keepLive() {
9125
+ var e = this;
9126
+ this.timeOutKL && clearTimeout(this.timeOutKL), this.timeOutKL = setTimeout(function () {
9127
+ e.send({
9128
+ type: "keepAlive"
9129
+ });
9130
+ }, (e.keepLiveTime ? e.keepLiveTime : 30) * 1e3);
9131
+ }
9132
+ }, {
9133
+ key: "message",
9134
+ value: function message() {
9135
+ var _this3 = this;
9136
+
9137
+ var e = this;
9138
+
9139
+ this.socket.onmessage = function (t) {
9140
+ var o = t.data,
9141
+ i = {};
9142
+
9143
+ if (o) {
9144
+ var s = JSON.parse(o),
9145
+ l = "";
9146
+
9147
+ switch (s.type) {
9148
+ case "login":
9149
+ l = "登录成功";
9150
+ break;
9151
+
9152
+ case "on_answer":
9153
+ l = "已接听", e.setRemote(s.sdp);
9154
+ break;
9155
+
9156
+ case "on_new_call":
9157
+ l = "有来电呼叫", i = {
9158
+ isvideo: s.isvideo,
9159
+ fromtel: s.from || ""
9160
+ };
9161
+ break;
9162
+
9163
+ case "on_ack":
9164
+ l = "来电接听成功", e.setRemote(s.sdp);
9165
+ break;
9166
+
9167
+ case "on_hangup":
9168
+ l = "已挂断", _this3.RTC.close(), _this3.RTC = null;
9169
+ var a = document.querySelector("#" + e.remoteId);
9170
+ a.srcObject = null, e.messageBack.call(null, s), e.getVideoTacks(), _this3.createRTC();
9171
+ break;
9172
+
9173
+ case "keepAlive":
9174
+ _this3.keepLive();
9175
+
9176
+ break;
9177
+ }
9178
+
9179
+ s.result ? (console.log("dataObj-->", s), e.messageBack.call(null, {
9180
+ code: 200,
9181
+ type: s.type,
9182
+ message: l,
9183
+ data: i
9184
+ })) : e.messageBack.call(null, {
9185
+ code: -1,
9186
+ type: s.type,
9187
+ err: "失败_" + s.reason || false
9188
+ });
9189
+ } else console.log("服务器无返回数据--");
9190
+ };
9191
+ } // 用于指定报错时的回调函数。
9192
+
9193
+ }, {
9194
+ key: "reloadSockte",
9195
+ value: function reloadSockte() {
9196
+ var e = this;
9197
+ this.reloadObj.num = this.reloadObj.num + 1, e.reloadObj.timeOut && clearTimeout(e.reloadObj.timeOut), this.reloadObj.num >= this.reloadObj.maxNum ? (e.reloadObj.href && (window.location.href = e.reloadObj.href), e.messageBack.call(null, {
9198
+ code: -1,
9199
+ type: "error",
9200
+ err: "重连已达到" + this.reloadObj.maxNum + "次,请刷新后重试"
9201
+ })) : e.reloadObj.timeOut = setTimeout(function () {
9202
+ e.newSocket();
9203
+ }, e.reloadObj.reloadTime);
9204
+ }
9205
+ }, {
9206
+ key: "error",
9207
+ value: function error() {
9208
+ var e = this;
9209
+
9210
+ this.socket.onerror = function (t) {
9211
+ var o = {
9212
+ type: t.type,
9213
+ code: -4,
9214
+ err: "socket连接错误_" + t.type // message:'连接_'+event.type,
9215
+
9216
+ };
9217
+ e.messageBack.call(null, o);
9218
+ };
9219
+ }
9220
+ }, {
9221
+ key: "close",
9222
+ value: function close() {
9223
+ var _this4 = this;
9224
+
9225
+ var e = this;
9226
+
9227
+ this.socket.onclose = function (t) {
9228
+ console.log("close--->", t);
9229
+ var o = {
9230
+ type: t.type,
9231
+ code: -1,
9232
+ err: "socket连接已关闭_" + t.type // message:'连接已关闭',
9233
+
9234
+ };
9235
+ clearTimeout(_this4.reloadObj.timeOut), e.messageBack.call(null, o);
9236
+ };
9237
+ }
9238
+ }, {
9239
+ key: "setSocketReloadConfig",
9240
+ value: function setSocketReloadConfig(e) {
9241
+ this.reloadObj = Object.assign(this.reloadObj, e || {});
9242
+ } //socket连接断开
9243
+
9244
+ }, {
9245
+ key: "disconnect",
9246
+ value: function disconnect() {
9247
+ var e = this;
9248
+
9249
+ this.socket.disconnect = function (t) {
9250
+ console.log("disconnect", t), e.socketCode = 5;
9251
+ var o = {
9252
+ type: t.type,
9253
+ code: -1,
9254
+ err: "连接已断开_" + t.type
9255
+ };
9256
+ e.messageBack.call(null, o);
9257
+ };
9258
+ }
9259
+ }, {
9260
+ key: "onclose",
9261
+ value: function onclose() {
9262
+ this.socket.close();
9263
+ } //发送消息
9264
+
9265
+ }, {
9266
+ key: "send",
9267
+ value: function send(e) {
9268
+ var t = e;
9269
+
9270
+ if (!this.online()) {
9271
+ this.messageBack.call(null, {
9272
+ code: -2,
9273
+ type: "internet",
9274
+ err: "当前网络差,请检查网络后重试"
9275
+ });
9276
+ return;
9277
+ }
9278
+
9279
+ console.log("checkReadyState--->", this.checkReadyState());
9280
+ var o = this.checkReadyState();
9281
+ o == 1 ? this.socket.send(JSON.stringify(t)) : this.messageBack.call(null, {
9282
+ code: -3,
9283
+ type: "error",
9284
+ err: "连接异常_" + o
9285
+ });
9286
+ }
9287
+ }, {
9288
+ key: "createRTC",
9289
+ value: function createRTC(e) {
9290
+ var t = this,
9291
+ o = {// iceServers: [
9292
+ // {
9293
+ // urls: ['turn:115.28.186.199:3478'],
9294
+ // username: "user1",
9295
+ // credential: "wex12345"
9296
+ // },
9297
+ // {
9298
+ // urls: ['stun:115.28.186.199:3478'],
9299
+ // username: "user1",
9300
+ // credential: "wex12345"
9301
+ // }
9302
+ // ],
9303
+ };
9304
+ this.RTC && (this.RTC = null), this.RTC = new RTCPeerConnection(e || o), this.RTC.onicecandidate = function (i) {
9305
+ console.log("onicecandidate--->", i);
9306
+ }, this.RTC.ontrack = function (i) {
9307
+ var s = document.querySelector("#" + t.remoteId),
9308
+ l = document.querySelector("#" + t.remoteAudioId),
9309
+ a = i.track;
9310
+
9311
+ if (a.kind == "video") {
9312
+ var c = new MediaStream();
9313
+ c.addTrack(a), s.srcObject = c, s.onloadedmetadata = function () {
9314
+ console.log("remoteVideo-onloadedmetadata->"), s.play();
9315
+ };
9316
+ } else {
9317
+ var _c = new MediaStream();
9318
+
9319
+ _c.addTrack(i.track), l.srcObject = _c, l.onloadedmetadata = function () {
9320
+ console.log("remoteAudio-onloadedmetadata->"), l.play();
9321
+ };
9322
+ }
9323
+ }, this.RTC.onnegotiationneeded = function (i) {
9324
+ console.log("onnegotiationneeded--->", i);
9325
+ }, this.RTC.iceconnectionstatechange = function (i) {};
9326
+ }
9327
+ }, {
9328
+ key: "addTracks",
9329
+ value: function addTracks(e) {
9330
+ var t = this,
9331
+ o = e.getTracks();
9332
+
9333
+ if (!o || o.length < 1) {
9334
+ console.log("无法获取视频或麦克风任一轨道数据,请查看是否开启成功");
9335
+ return;
9336
+ }
9337
+
9338
+ o.forEach(function (i) {
9339
+ console.log("track-->", i), t.RTC.addTrack(i, e);
9340
+ });
9341
+ }
9342
+ }, {
9343
+ key: "createOffer",
9344
+ value: function () {
9345
+ var _createOffer = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
9346
+ var e;
9347
+ return regeneratorRuntime.wrap(function _callee$(_context) {
9348
+ while (1) {
9349
+ switch (_context.prev = _context.next) {
9350
+ case 0:
9351
+ _context.next = 2;
9352
+ return this.RTC.createOffer();
9353
+
9354
+ case 2:
9355
+ e = _context.sent;
9356
+ this.Offer = e;
9357
+ _context.next = 6;
9358
+ return this.RTC.setLocalDescription(e);
9359
+
9360
+ case 6:
9361
+ case "end":
9362
+ return _context.stop();
9363
+ }
9364
+ }
9365
+ }, _callee, this);
9366
+ }));
9367
+
9368
+ function createOffer() {
9369
+ return _createOffer.apply(this, arguments);
9370
+ }
9371
+
9372
+ return createOffer;
9373
+ }()
9374
+ }, {
9375
+ key: "setRemote",
9376
+ value: function () {
9377
+ var _setRemote = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(e) {
9378
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
9379
+ while (1) {
9380
+ switch (_context2.prev = _context2.next) {
9381
+ case 0:
9382
+ this.RTC.setRemoteDescription(new RTCSessionDescription({
9383
+ type: "answer",
9384
+ sdp: e
9385
+ }), function (t) {
9386
+ console.log("setsuccess--->", t);
9387
+ }, function (t) {
9388
+ console.log("seterr--->", t);
9389
+ });
9390
+
9391
+ case 1:
9392
+ case "end":
9393
+ return _context2.stop();
9394
+ }
9395
+ }
9396
+ }, _callee2, this);
9397
+ }));
9398
+
9399
+ function setRemote(_x) {
9400
+ return _setRemote.apply(this, arguments);
9401
+ }
9402
+
9403
+ return setRemote;
9404
+ }()
9405
+ }, {
9406
+ key: "getDeviceList",
9407
+ value: function () {
9408
+ var _getDeviceList = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(e) {
9409
+ var t, o;
9410
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
9411
+ while (1) {
9412
+ switch (_context3.prev = _context3.next) {
9413
+ case 0:
9414
+ _context3.next = 2;
9415
+ return navigator.mediaDevices.enumerateDevices();
9416
+
9417
+ case 2:
9418
+ t = _context3.sent;
9419
+
9420
+ if (e) {
9421
+ _context3.next = 5;
9422
+ break;
9423
+ }
9424
+
9425
+ return _context3.abrupt("return", t);
9426
+
9427
+ case 5:
9428
+ o = [];
9429
+ return _context3.abrupt("return", (t && t.length > 0 && t.forEach(function (i) {
9430
+ i.kind.indexOf(e) > -1 && o.push(i);
9431
+ }), o));
9432
+
9433
+ case 7:
9434
+ case "end":
9435
+ return _context3.stop();
9436
+ }
9437
+ }
9438
+ }, _callee3);
9439
+ }));
9440
+
9441
+ function getDeviceList(_x2) {
9442
+ return _getDeviceList.apply(this, arguments);
9443
+ }
9444
+
9445
+ return getDeviceList;
9446
+ }()
9447
+ }, {
9448
+ key: "getUserMedia",
9449
+ value: function () {
9450
+ var _getUserMedia = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(e) {
9451
+ var t, o;
9452
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
9453
+ while (1) {
9454
+ switch (_context4.prev = _context4.next) {
9455
+ case 0:
9456
+ t = {
9457
+ video: !0,
9458
+ //videoConstraints,
9459
+ audio: {
9460
+ noiseSuppression: !0,
9461
+ echoCancellation: !0
9462
+ }
9463
+ };
9464
+ _context4.next = 3;
9465
+ return navigator.mediaDevices.getUserMedia(e || t);
9466
+
9467
+ case 3:
9468
+ o = _context4.sent;
9469
+ this.videoStream = o;
9470
+ _context4.next = 7;
9471
+ return this.addTracks(o);
9472
+
9473
+ case 7:
9474
+ return _context4.abrupt("return", o);
9475
+
9476
+ case 8:
9477
+ case "end":
9478
+ return _context4.stop();
9479
+ }
9480
+ }
9481
+ }, _callee4, this);
9482
+ }));
9483
+
9484
+ function getUserMedia(_x3) {
9485
+ return _getUserMedia.apply(this, arguments);
9486
+ }
9487
+
9488
+ return getUserMedia;
9489
+ }()
9490
+ }, {
9491
+ key: "getVideoTacks",
9492
+ value: function () {
9493
+ var _getVideoTacks = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
9494
+ var t;
9495
+ return regeneratorRuntime.wrap(function _callee5$(_context5) {
9496
+ while (1) {
9497
+ switch (_context5.prev = _context5.next) {
9498
+ case 0:
9499
+ if (this.videoStream) {
9500
+ this.videoStream.getTracks().forEach(function (o) {
9501
+ o.stop();
9502
+ });
9503
+ t = document.querySelector("#" + this.localId);
9504
+ t.srcObject = null;
9505
+ }
9506
+
9507
+ case 1:
9508
+ case "end":
9509
+ return _context5.stop();
9510
+ }
9511
+ }
9512
+ }, _callee5, this);
9513
+ }));
9514
+
9515
+ function getVideoTacks() {
9516
+ return _getVideoTacks.apply(this, arguments);
9517
+ }
9518
+
9519
+ return getVideoTacks;
9520
+ }()
9521
+ /**
9522
+ * 初始化 dome 配置和方法
9523
+ * video 开启视频
9524
+ * audio 开启音频
9525
+ * callback 贯穿整个线的消息回调
9526
+ * @param {*} data
9527
+ */
9528
+
9529
+ }, {
9530
+ key: "initDom",
9531
+ value: function () {
9532
+ var _initDom = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
9533
+ var e,
9534
+ t,
9535
+ o,
9536
+ i,
9537
+ s,
9538
+ _args6 = arguments;
9539
+ return regeneratorRuntime.wrap(function _callee6$(_context6) {
9540
+ while (1) {
9541
+ switch (_context6.prev = _context6.next) {
9542
+ case 0:
9543
+ e = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {
9544
+ video: !0,
9545
+ audio: !0,
9546
+ parentId: "",
9547
+ isDrag: !0,
9548
+ showLocal: !0,
9549
+ callback: new Function()
9550
+ };
9551
+
9552
+ if (this.online()) {
9553
+ _context6.next = 4;
9554
+ break;
9555
+ }
9556
+
9557
+ e.callback({
9558
+ code: -2,
9559
+ type: "internet",
9560
+ err: "当前网络差,请检查网络后重试"
9561
+ });
9562
+ return _context6.abrupt("return");
9563
+
9564
+ case 4:
9565
+ if (e.parentId) {
9566
+ _context6.next = 7;
9567
+ break;
9568
+ }
9569
+
9570
+ console.log("请添加视频容器");
9571
+ return _context6.abrupt("return");
9572
+
9573
+ case 7:
9574
+ if (e.callback) {
9575
+ _context6.next = 10;
9576
+ break;
9577
+ }
9578
+
9579
+ console.log("请注册消息回调函数");
9580
+ return _context6.abrupt("return");
9581
+
9582
+ case 10:
9583
+ this.mediaSet.video = e.video, this.mediaSet.audio = e.audio, this.messageBack = e.callback;
9584
+ t = document.querySelector("#" + e.parentId);
9585
+
9586
+ if (t) {
9587
+ _context6.next = 15;
9588
+ break;
9589
+ }
9590
+
9591
+ console.log("无法查找到父级容器"), e.callback({
9592
+ code: -2,
9593
+ type: "error",
9594
+ err: "无法查找到父级容器,请查看"
9595
+ });
9596
+ return _context6.abrupt("return");
9597
+
9598
+ case 15:
9599
+ if (!t.innerHTML) {
9600
+ _context6.next = 18;
9601
+ break;
9602
+ }
9603
+
9604
+ console.log("已成功创建video标签");
9605
+ return _context6.abrupt("return");
9606
+
9607
+ case 18:
9608
+ o = document.createElement("video"), i = document.createElement("video"), s = document.createElement("audio");
9609
+ o.id = "local_video", o.autoplay = !0, o.playsInline = "playsInline", o.muted = !0, i.id = "remote_video", s.id = "remote_audio", i.autoplay = !0, i.playsInline = "playsInline", i.muted = !0, o.className = "local_video_class", i.className = "remote_video_class", s.style.display = "none", s.controls = !0, t.appendChild(i), t.appendChild(o), t.appendChild(s), console.log("showLocal--->", e.showLocal), e.showLocal || (o.style.display = "none"), this.localId = "local_video", this.remoteId = "remote_video", this.remoteAudioId = "remote_audio", e.isDrag && this.pcDrag("remote_video", "local_video");
9610
+
9611
+ case 20:
9612
+ case "end":
9613
+ return _context6.stop();
9614
+ }
9615
+ }
9616
+ }, _callee6, this);
9617
+ }));
9618
+
9619
+ function initDom() {
9620
+ return _initDom.apply(this, arguments);
9621
+ }
9622
+
9623
+ return initDom;
9624
+ }()
9625
+ }, {
9626
+ key: "changeShowLocal",
9627
+ value: function changeShowLocal(e) {
9628
+ var t = document.querySelector("#" + this.localId);
9629
+ t.style.display = e ? "block" : "none";
9630
+ }
9631
+ }, {
9632
+ key: "os",
9633
+ value: function os() {
9634
+ var e = navigator.userAgent,
9635
+ t = /(?:Windows Phone)/.test(e),
9636
+ o = /(?:SymbianOS)/.test(e) || t,
9637
+ i = /(?:Android)/.test(e),
9638
+ s = /(?:Firefox)/.test(e),
9639
+ l = /(?:iPad|PlayBook)/.test(e) || i && !/(?:Mobile)/.test(e) || s && /(?:Tablet)/.test(e),
9640
+ a = /(?:iPhone)/.test(e) && !l,
9641
+ c = !a && !i && !o;
9642
+ return {
9643
+ isTablet: l,
9644
+ isPhone: a,
9645
+ isAndroid: i,
9646
+ isPc: c
9647
+ };
9648
+ }
9649
+ }, {
9650
+ key: "pcDrag",
9651
+ value: function pcDrag(e, t) {
9652
+ var o = document.querySelector("#" + e),
9653
+ i = document.querySelector("#" + t),
9654
+ s = o.offsetWidth,
9655
+ l = o.offsetHeight,
9656
+ a = i.offsetWidth,
9657
+ c = i.offsetHeight,
9658
+ g = o.offsetLeft,
9659
+ f = o.offsetTop,
9660
+ O = this.os().isPc,
9661
+ v = this.os().isPhone;
9662
+ O ? i.addEventListener("mousedown", function (h) {
9663
+ var p = h.pageX - g - i.offsetLeft,
9664
+ y = h.pageY - f - i.offsetTop;
9665
+
9666
+ function k(u) {
9667
+ var r = u.pageX - g - p,
9668
+ n = u.pageY - f - y;
9669
+ r < 20 && (r = 20), r > s - a && (r = s - a), n < 20 && (n = 20), n > l - c && (n = l - c), i.style.left = r + "px", i.style.top = n + "px";
9670
+ }
9671
+
9672
+ document.addEventListener("mousemove", k), document.addEventListener("mouseup", function (u) {
9673
+ document.removeEventListener("mousemove", k);
9674
+ });
9675
+ }) : v && i.addEventListener("touchstart", function (h) {
9676
+ var p = document.body;
9677
+ p.style.overflow = "hidden";
9678
+ var y = h.pageX - g - i.offsetLeft,
9679
+ k = h.pageY - f - i.offsetTop;
9680
+
9681
+ function u(r) {
9682
+ var n = r.pageX - g - y,
9683
+ m = r.pageY - f - k;
9684
+ n < 20 && (n = 20), n > s - a && (n = s - a), m < 20 && (m = 20), m > l - c && (m = l - c), i.style.left = n + "px", i.style.top = m + "px";
9685
+ }
9686
+
9687
+ document.addEventListener("touchmove", u), document.addEventListener("touchend", function (r) {
9688
+ p.style.overflow = "auto", document.removeEventListener("touchmove", u);
9689
+ });
9690
+ });
9691
+ }
9692
+ }, {
9693
+ key: "login",
9694
+ value: function login(e) {
9695
+ var t = Object.assign({
9696
+ type: "login"
9697
+ }, e);
9698
+ this.send(t);
9699
+ }
9700
+ }, {
9701
+ key: "call",
9702
+ value: function () {
9703
+ var _call = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(e) {
9704
+ var t, o;
9705
+ return regeneratorRuntime.wrap(function _callee7$(_context7) {
9706
+ while (1) {
9707
+ switch (_context7.prev = _context7.next) {
9708
+ case 0:
9709
+ t = Object.assign({
9710
+ sdp: "",
9711
+ type: "make_call"
9712
+ }, e);
9713
+ _context7.next = 3;
9714
+ return this.getUserMedia();
9715
+
9716
+ case 3:
9717
+ o = _context7.sent;
9718
+ this.videoStream = o;
9719
+ this.bindLocalPicture(o);
9720
+ _context7.next = 8;
9721
+ return this.createOffer();
9722
+
9723
+ case 8:
9724
+ console.log("call---->", t);
9725
+ t.sdp = this.Offer.sdp;
9726
+ this.send(t);
9727
+
9728
+ case 11:
9729
+ case "end":
9730
+ return _context7.stop();
9731
+ }
9732
+ }
9733
+ }, _callee7, this);
9734
+ }));
9735
+
9736
+ function call(_x4) {
9737
+ return _call.apply(this, arguments);
9738
+ }
9739
+
9740
+ return call;
9741
+ }()
9742
+ }, {
9743
+ key: "audioCall",
9744
+ value: function () {
9745
+ var _audioCall = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(e) {
9746
+ var t;
9747
+ return regeneratorRuntime.wrap(function _callee8$(_context8) {
9748
+ while (1) {
9749
+ switch (_context8.prev = _context8.next) {
9750
+ case 0:
9751
+ t = Object.assign({
9752
+ sdp: "",
9753
+ type: "make_call"
9754
+ }, e);
9755
+ this.getVideoTacks();
9756
+ _context8.next = 4;
9757
+ return this.getUserMedia({
9758
+ audio: {
9759
+ noiseSuppression: !0,
9760
+ echoCancellation: !0
9761
+ }
9762
+ });
9763
+
9764
+ case 4:
9765
+ _context8.next = 6;
9766
+ return this.createOffer();
9767
+
9768
+ case 6:
9769
+ console.log("call---->", t);
9770
+ t.sdp = this.Offer.sdp;
9771
+ this.send(t);
9772
+
9773
+ case 9:
9774
+ case "end":
9775
+ return _context8.stop();
9776
+ }
9777
+ }
9778
+ }, _callee8, this);
9779
+ }));
9780
+
9781
+ function audioCall(_x5) {
9782
+ return _audioCall.apply(this, arguments);
9783
+ }
9784
+
9785
+ return audioCall;
9786
+ }()
9787
+ }, {
9788
+ key: "answer",
9789
+ value: function () {
9790
+ var _answer = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee9(e) {
9791
+ var t, o;
9792
+ return regeneratorRuntime.wrap(function _callee9$(_context9) {
9793
+ while (1) {
9794
+ switch (_context9.prev = _context9.next) {
9795
+ case 0:
9796
+ t = Object.assign({
9797
+ sdp: "",
9798
+ type: "answer"
9799
+ }, e);
9800
+ this.callData = e;
9801
+ _context9.next = 4;
9802
+ return this.getUserMedia();
9803
+
9804
+ case 4:
9805
+ o = _context9.sent;
9806
+ this.videoStream ? this.bindLocalPicture(this.videoStream) : this.bindLocalPicture(o);
9807
+ _context9.next = 8;
9808
+ return this.createOffer();
9809
+
9810
+ case 8:
9811
+ t.sdp = this.Offer.sdp;
9812
+ this.send(t);
9813
+
9814
+ case 10:
9815
+ case "end":
9816
+ return _context9.stop();
9817
+ }
9818
+ }
9819
+ }, _callee9, this);
9820
+ }));
9821
+
9822
+ function answer(_x6) {
9823
+ return _answer.apply(this, arguments);
9824
+ }
9825
+
9826
+ return answer;
9827
+ }()
9828
+ }, {
9829
+ key: "hangup",
9830
+ value: function () {
9831
+ var _hangup = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee10(e) {
9832
+ var t;
9833
+ return regeneratorRuntime.wrap(function _callee10$(_context10) {
9834
+ while (1) {
9835
+ switch (_context10.prev = _context10.next) {
9836
+ case 0:
9837
+ t = Object.assign({
9838
+ type: "hangup"
9839
+ }, e);
9840
+ console.log("hangup---->", t), this.send(t);
9841
+
9842
+ case 2:
9843
+ case "end":
9844
+ return _context10.stop();
9845
+ }
9846
+ }
9847
+ }, _callee10, this);
9848
+ }));
9849
+
9850
+ function hangup(_x7) {
9851
+ return _hangup.apply(this, arguments);
9852
+ }
9853
+
9854
+ return hangup;
9855
+ }()
9856
+ }, {
9857
+ key: "stopStack",
9858
+ value: function () {
9859
+ var _stopStack = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
9860
+ var e, t;
9861
+ return regeneratorRuntime.wrap(function _callee11$(_context11) {
9862
+ while (1) {
9863
+ switch (_context11.prev = _context11.next) {
9864
+ case 0:
9865
+ e = document.querySelector("#" + this.localId);
9866
+
9867
+ if (e.srcObject) {
9868
+ t = e.srcObject.getTracks();
9869
+ Array.isArray(t) ? t.forEach(function (o) {
9870
+ o.stop();
9871
+ }) : t.stop(), e.srcObject = null;
9872
+ }
9873
+
9874
+ case 2:
9875
+ case "end":
9876
+ return _context11.stop();
9877
+ }
9878
+ }
9879
+ }, _callee11, this);
9880
+ }));
9881
+
9882
+ function stopStack() {
9883
+ return _stopStack.apply(this, arguments);
9884
+ }
9885
+
9886
+ return stopStack;
9887
+ }()
9888
+ }, {
9889
+ key: "cameraUser",
9890
+ value: function () {
9891
+ var _cameraUser = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() {
9892
+ var e, t, o, i, s;
9893
+ return regeneratorRuntime.wrap(function _callee12$(_context12) {
9894
+ while (1) {
9895
+ switch (_context12.prev = _context12.next) {
9896
+ case 0:
9897
+ console.log("前置"), this.stopStack();
9898
+ e = document.documentElement.clientHeight;
9899
+ t = document.documentElement.clientWidth;
9900
+ _context12.next = 5;
9901
+ return navigator.mediaDevices.getUserMedia({
9902
+ audio: !0,
9903
+ video: {
9904
+ width: {
9905
+ ideal: t
9906
+ },
9907
+ height: {
9908
+ ideal: e
9909
+ },
9910
+ facingMode: "user"
9911
+ }
9912
+ })["catch"](function (a) {
9913
+ console.log("user--err--", a);
9914
+ });
9915
+
9916
+ case 5:
9917
+ o = _context12.sent;
9918
+ this.bindLocalPicture(o);
9919
+ i = o.getVideoTracks(), s = o.getAudioTracks();
9920
+ this.RTC.getSenders().forEach(function (a) {
9921
+ a.track.kind == "video" ? a.replaceTrack(i[0]) : a.track.kind == "audio" && a.replaceTrack(s[0]);
9922
+ });
9923
+
9924
+ case 9:
9925
+ case "end":
9926
+ return _context12.stop();
9927
+ }
9928
+ }
9929
+ }, _callee12, this);
9930
+ }));
9931
+
9932
+ function cameraUser() {
9933
+ return _cameraUser.apply(this, arguments);
9934
+ }
9935
+
9936
+ return cameraUser;
9937
+ }()
9938
+ }, {
9939
+ key: "cameraRear",
9940
+ value: function () {
9941
+ var _cameraRear = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
9942
+ var e, t, o, i, s;
9943
+ return regeneratorRuntime.wrap(function _callee13$(_context13) {
9944
+ while (1) {
9945
+ switch (_context13.prev = _context13.next) {
9946
+ case 0:
9947
+ console.log("后置"), this.stopStack();
9948
+ e = document.documentElement.clientHeight;
9949
+ t = document.documentElement.clientWidth;
9950
+ _context13.next = 5;
9951
+ return navigator.mediaDevices.getUserMedia({
9952
+ audio: !0,
9953
+ video: {
9954
+ width: {
9955
+ ideal: t
9956
+ },
9957
+ height: {
9958
+ ideal: e
9959
+ },
9960
+ facingMode: "environment"
9961
+ }
9962
+ })["catch"](function (a) {
9963
+ console.log("environment--err--", a);
9964
+ });
9965
+
9966
+ case 5:
9967
+ o = _context13.sent;
9968
+ this.bindLocalPicture(o);
9969
+ i = o.getVideoTracks(), s = o.getAudioTracks();
9970
+ this.RTC.getSenders().forEach(function (a) {
9971
+ a.track.kind == "video" ? a.replaceTrack(i[0]) : a.track.kind == "audio" && a.replaceTrack(s[0]);
9972
+ });
9973
+
9974
+ case 9:
9975
+ case "end":
9976
+ return _context13.stop();
9977
+ }
9978
+ }
9979
+ }, _callee13, this);
9980
+ }));
9981
+
9982
+ function cameraRear() {
9983
+ return _cameraRear.apply(this, arguments);
9984
+ }
9985
+
9986
+ return cameraRear;
9987
+ }()
9988
+ }, {
9989
+ key: "microphoneChange",
9990
+ value: function microphoneChange(e) {
9991
+ var t = document.querySelector("#" + this.localId);
9992
+
9993
+ if (t.srcObject) {
9994
+ var o = t.srcObject.getAudioTracks();
9995
+ o[0].enabled = e;
9996
+ }
9997
+ }
9998
+ }, {
9999
+ key: "mutedChange",
10000
+ value: function mutedChange(e) {
10001
+ var t = document.querySelector("#audio_remote");
10002
+
10003
+ if (t.srcObject) {
10004
+ var o = t.srcObject.getAudioTracks();
10005
+ o[0].enabled = e;
10006
+ }
10007
+ }
10008
+ }, {
10009
+ key: "loginOut",
10010
+ value: function loginOut(e) {
10011
+ var t = Object.assign({
10012
+ type: "login_out"
10013
+ }, e);
10014
+ console.log("loginOut-->", t), this.send(t);
10015
+ }
10016
+ }, {
10017
+ key: "changePicture",
10018
+ value: function changePicture() {
10019
+ console.log("changePicture--->");
10020
+ var e = document.querySelector("#" + this.localId),
10021
+ t = document.querySelector("#" + this.remoteId),
10022
+ o = e.srcObject,
10023
+ i = t.srcObject;
10024
+ console.log(o, i), o && i && (e.srcObject = i, t.srcObject = o);
10025
+ }
10026
+ }]);
10027
+
10028
+ return j;
10029
+ }();
10030
+
10031
+
10032
+ // CONCATENATED MODULE: ./src/common-request.js
10033
+
10034
+
10035
+
10036
+
10037
+
10038
+
10039
+
10040
+
10041
+
10042
+
10043
+
10044
+
10045
+
10046
+
10047
+
10048
+
10049
+
10050
+
10051
+
10052
+ /**
10053
+ * 接口请求通用方法
10054
+ * @param {*} url
10055
+ * @param {*} param
10056
+ * @param {*} backSuccfn
10057
+ * @param {*} async
10058
+ * @param {*} method
10059
+ */
10060
+
10061
+ var common_request_useRequest = function useRequest(type) {
10062
+ console.log(webApi);
10063
+ var requestObj = webApi[type];
10064
+ console.log(requestObj);
10065
+ if (!requestObj) throw new Error('未找到对应的请求方法!');
10066
+ return function () {
10067
+ return requestObj.apply(void 0, arguments);
10068
+ };
10069
+ };
10070
+
10071
+ var initWsBaseTheme = function initWsBaseTheme(socket, _ref) {
10072
+ var onOpen = _ref.onOpen,
10073
+ onClose = _ref.onClose,
10074
+ onMessage = _ref.onMessage,
8799
10075
  onError = _ref.onError,
8800
10076
  onReconnect = _ref.onReconnect;
8801
10077
  socket.subscribe('open', function () {
@@ -8839,6 +10115,11 @@ var getH265PlayerObj = function getH265PlayerObj(rtcServe, doceProUrl, videoConf
8839
10115
  videoConfig: videoConfig || videoConfigdefault
8840
10116
  });
8841
10117
  return h265Play;
10118
+ };
10119
+
10120
+ var common_request_initPhoneClientWs = function initPhoneClientWs(ws) {
10121
+ var phoneClientObj = phoneClient_j(ws);
10122
+ return phoneClientObj;
8842
10123
  }; // 组合发送ws信息
8843
10124
 
8844
10125
 
@@ -8856,6 +10137,8 @@ var GetSendModel = function GetSendModel(action, data, params) {
8856
10137
 
8857
10138
  var _player = /*#__PURE__*/new WeakMap();
8858
10139
 
10140
+ var _phoneClientObj = /*#__PURE__*/new WeakMap();
10141
+
8859
10142
  var common_request_wsClass = /*#__PURE__*/function () {
8860
10143
  function wsClass(config, _ref2) {
8861
10144
  var _this = this;
@@ -8872,6 +10155,11 @@ var common_request_wsClass = /*#__PURE__*/function () {
8872
10155
  value: null
8873
10156
  });
8874
10157
 
10158
+ Object(classPrivateFieldInitSpec["a" /* default */])(this, _phoneClientObj, {
10159
+ writable: true,
10160
+ value: null
10161
+ });
10162
+
8875
10163
  this.config = config;
8876
10164
  Object.assign(this.config, {
8877
10165
  checkData: JSON.stringify(GetSendModel('keeplive', this.config))
@@ -8922,6 +10210,19 @@ var common_request_wsClass = /*#__PURE__*/function () {
8922
10210
 
8923
10211
  return _classPrivateFieldGet(this, _player);
8924
10212
  }
10213
+ }, {
10214
+ key: "getPhoneClientObj",
10215
+ value: function getPhoneClientObj(ws, config) {
10216
+ if (_classPrivateFieldGet(this, _phoneClientObj)) return _classPrivateFieldGet(this, _phoneClientObj);
10217
+
10218
+ _classPrivateFieldSet(this, _phoneClientObj, common_request_initPhoneClientWs(ws));
10219
+
10220
+ if (config) {
10221
+ _classPrivateFieldGet(this, _phoneClientObj).initDom(config);
10222
+ }
10223
+
10224
+ return _classPrivateFieldGet(this, _phoneClientObj);
10225
+ }
8925
10226
  }, {
8926
10227
  key: "destroy",
8927
10228
  value: function destroy() {
@@ -8936,6 +10237,7 @@ var common_request_wsClass = /*#__PURE__*/function () {
8936
10237
  _classPrivateFieldSet(this, _player, null);
8937
10238
 
8938
10239
  this.socket.closeSocket();
10240
+ if (_classPrivateFieldGet(this, _phoneClientObj)) _classPrivateFieldGet(this, _phoneClientObj).onclose();
8939
10241
  }
8940
10242
  }]);
8941
10243