hanbiro-react16-sdk 1.0.13 → 1.0.14
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/README.md +66 -42
- package/dist/components/ChatAIDraft/SettingPopper.d.ts +2 -0
- package/dist/components/ChatAIDraft/index.d.ts +4 -3
- package/dist/components/CountryFlag/flags/CNFlag.d.ts +3 -0
- package/dist/components/CountryFlag/flags/IDFlag.d.ts +3 -0
- package/dist/components/CountryFlag/flags/KRFlag.d.ts +3 -0
- package/dist/components/CountryFlag/flags/USFlag.d.ts +3 -0
- package/dist/components/CountryFlag/flags/VNFlag.d.ts +3 -0
- package/dist/components/CountryFlag/index.d.ts +7 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/constants/index.d.ts +8 -0
- package/dist/hanbiro-react16-sdk.es.js +2968 -101
- package/dist/hanbiro-react16-sdk.style.css +19 -2
- package/dist/hanbiro-react16-sdk.umd.js +3482 -185
- package/dist/utils/axiosAPI.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/ChatAIDraft/constants.d.ts +0 -10
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* hanbiro-react16-sdk v1.0.
|
|
3
|
-
* Build Date: 2026-
|
|
2
|
+
* hanbiro-react16-sdk v1.0.13
|
|
3
|
+
* Build Date: 2026-04-02
|
|
4
4
|
*/
|
|
5
|
+
function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
|
|
6
|
+
function _wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); }
|
|
7
|
+
function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }
|
|
8
|
+
function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } }
|
|
5
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
6
10
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
7
11
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
@@ -30,8 +34,8 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
|
|
|
30
34
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
31
35
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
32
36
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
33
|
-
(function (
|
|
34
|
-
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react-dom")) : typeof define === "function" && define.amd ? define(["exports", "react", "react-dom"], factory) : (
|
|
37
|
+
(function (global2, factory) {
|
|
38
|
+
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react-dom")) : typeof define === "function" && define.amd ? define(["exports", "react", "react-dom"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.HanbiroReact16SDK = {}, global2.React, global2.ReactDOM));
|
|
35
39
|
})(this, function (exports2, React, ReactDOM) {
|
|
36
40
|
"use strict";
|
|
37
41
|
|
|
@@ -42,6 +46,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
42
46
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
43
47
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
44
48
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
49
|
+
var __knownSymbol = function __knownSymbol(name, symbol) {
|
|
50
|
+
return (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
51
|
+
};
|
|
52
|
+
var __typeError = function __typeError(msg) {
|
|
53
|
+
throw TypeError(msg);
|
|
54
|
+
};
|
|
45
55
|
var __defNormalProp = function __defNormalProp(obj, key, value) {
|
|
46
56
|
return key in obj ? __defProp(obj, key, {
|
|
47
57
|
enumerable: true,
|
|
@@ -53,17 +63,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
53
63
|
var __spreadValues = function __spreadValues(a, b) {
|
|
54
64
|
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
55
65
|
if (__getOwnPropSymbols) {
|
|
56
|
-
var
|
|
66
|
+
var _iterator2 = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
|
|
57
67
|
_step;
|
|
58
68
|
try {
|
|
59
|
-
for (
|
|
69
|
+
for (_iterator2.s(); !(_step = _iterator2.n()).done;) {
|
|
60
70
|
var prop = _step.value;
|
|
61
71
|
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
62
72
|
}
|
|
63
73
|
} catch (err) {
|
|
64
|
-
|
|
74
|
+
_iterator2.e(err);
|
|
65
75
|
} finally {
|
|
66
|
-
|
|
76
|
+
_iterator2.f();
|
|
67
77
|
}
|
|
68
78
|
}
|
|
69
79
|
return a;
|
|
@@ -71,6 +81,25 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
71
81
|
var __spreadProps = function __spreadProps(a, b) {
|
|
72
82
|
return __defProps(a, __getOwnPropDescs(b));
|
|
73
83
|
};
|
|
84
|
+
var __objRest = function __objRest(source, exclude) {
|
|
85
|
+
var target = {};
|
|
86
|
+
for (var prop in source) if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
|
|
87
|
+
if (source != null && __getOwnPropSymbols) {
|
|
88
|
+
var _iterator3 = _createForOfIteratorHelper(__getOwnPropSymbols(source)),
|
|
89
|
+
_step2;
|
|
90
|
+
try {
|
|
91
|
+
for (_iterator3.s(); !(_step2 = _iterator3.n()).done;) {
|
|
92
|
+
var prop = _step2.value;
|
|
93
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop];
|
|
94
|
+
}
|
|
95
|
+
} catch (err) {
|
|
96
|
+
_iterator3.e(err);
|
|
97
|
+
} finally {
|
|
98
|
+
_iterator3.f();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return target;
|
|
102
|
+
};
|
|
74
103
|
var __publicField = function __publicField(obj, key, value) {
|
|
75
104
|
return __defNormalProp(obj, _typeof(key) !== "symbol" ? key + "" : key, value);
|
|
76
105
|
};
|
|
@@ -96,6 +125,96 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
96
125
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
97
126
|
});
|
|
98
127
|
};
|
|
128
|
+
var __await = function __await(promise, isYieldStar) {
|
|
129
|
+
this[0] = promise;
|
|
130
|
+
this[1] = isYieldStar;
|
|
131
|
+
};
|
|
132
|
+
var __asyncGenerator = function __asyncGenerator(__this, __arguments, generator) {
|
|
133
|
+
var _resume = function resume(k, v, yes, no) {
|
|
134
|
+
try {
|
|
135
|
+
var x = generator[k](v),
|
|
136
|
+
isAwait = (v = x.value) instanceof __await,
|
|
137
|
+
done = x.done;
|
|
138
|
+
Promise.resolve(isAwait ? v[0] : v).then(function (y) {
|
|
139
|
+
return isAwait ? _resume(k === "return" ? k : "next", v[1] ? {
|
|
140
|
+
done: y.done,
|
|
141
|
+
value: y.value
|
|
142
|
+
} : y, yes, no) : yes({
|
|
143
|
+
value: y,
|
|
144
|
+
done: done
|
|
145
|
+
});
|
|
146
|
+
}).catch(function (e) {
|
|
147
|
+
return _resume("throw", e, yes, no);
|
|
148
|
+
});
|
|
149
|
+
} catch (e) {
|
|
150
|
+
no(e);
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
method = function method(k) {
|
|
154
|
+
return it[k] = function (x) {
|
|
155
|
+
return new Promise(function (yes, no) {
|
|
156
|
+
return _resume(k, x, yes, no);
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
it = {};
|
|
161
|
+
return generator = generator.apply(__this, __arguments), it[__knownSymbol("asyncIterator")] = function () {
|
|
162
|
+
return it;
|
|
163
|
+
}, method("next"), method("throw"), method("return"), it;
|
|
164
|
+
};
|
|
165
|
+
var __yieldStar = function __yieldStar(value) {
|
|
166
|
+
var obj = value[__knownSymbol("asyncIterator")],
|
|
167
|
+
isAwait = false,
|
|
168
|
+
method,
|
|
169
|
+
it = {};
|
|
170
|
+
if (obj == null) {
|
|
171
|
+
obj = value[__knownSymbol("iterator")]();
|
|
172
|
+
method = function method(k) {
|
|
173
|
+
return it[k] = function (x) {
|
|
174
|
+
return obj[k](x);
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
} else {
|
|
178
|
+
obj = obj.call(value);
|
|
179
|
+
method = function method(k) {
|
|
180
|
+
return it[k] = function (v) {
|
|
181
|
+
if (isAwait) {
|
|
182
|
+
isAwait = false;
|
|
183
|
+
if (k === "throw") throw v;
|
|
184
|
+
return v;
|
|
185
|
+
}
|
|
186
|
+
isAwait = true;
|
|
187
|
+
return {
|
|
188
|
+
done: false,
|
|
189
|
+
value: new __await(new Promise(function (resolve) {
|
|
190
|
+
var x = obj[k](v);
|
|
191
|
+
if (!(x instanceof Object)) __typeError("Object expected");
|
|
192
|
+
resolve(x);
|
|
193
|
+
}), 1)
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
return it[__knownSymbol("iterator")] = function () {
|
|
199
|
+
return it;
|
|
200
|
+
}, method("next"), "throw" in obj ? method("throw") : it.throw = function (x) {
|
|
201
|
+
throw x;
|
|
202
|
+
}, "return" in obj && method("return"), it;
|
|
203
|
+
};
|
|
204
|
+
var __forAwait = function __forAwait(obj, it, method) {
|
|
205
|
+
return (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = function method(key, fn) {
|
|
206
|
+
return (fn = obj[key]) && (it[key] = function (arg) {
|
|
207
|
+
return new Promise(function (yes, no, done) {
|
|
208
|
+
return arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then(function (value) {
|
|
209
|
+
return yes({
|
|
210
|
+
value: value,
|
|
211
|
+
done: done
|
|
212
|
+
});
|
|
213
|
+
}, no);
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
}, method("next"), method("return"), it);
|
|
217
|
+
};
|
|
99
218
|
var _a;
|
|
100
219
|
function _interopNamespaceDefault(e) {
|
|
101
220
|
var n = Object.create(null, _defineProperty({}, Symbol.toStringTag, {
|
|
@@ -428,37 +547,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
428
547
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
429
548
|
};
|
|
430
549
|
Settings.displayName = "Settings";
|
|
431
|
-
var LANG_OPTIONS = [{
|
|
432
|
-
label: "Korean",
|
|
433
|
-
value: "KR",
|
|
434
|
-
extra: "ko"
|
|
435
|
-
}, {
|
|
436
|
-
label: "English",
|
|
437
|
-
value: "US",
|
|
438
|
-
extra: "en"
|
|
439
|
-
}, {
|
|
440
|
-
label: "Japanese",
|
|
441
|
-
value: "JP"
|
|
442
|
-
}, {
|
|
443
|
-
label: "Simplified Chinese",
|
|
444
|
-
value: "zh-CN",
|
|
445
|
-
extra: "zh-chs"
|
|
446
|
-
}, {
|
|
447
|
-
label: "Traditional Chinese (Taiwan)",
|
|
448
|
-
value: "zh-TW"
|
|
449
|
-
}, {
|
|
450
|
-
label: "Traditional Chinese (Hong Kong)",
|
|
451
|
-
value: "zh-HK",
|
|
452
|
-
extra: "zh-cht"
|
|
453
|
-
}, {
|
|
454
|
-
label: "Vietnamese",
|
|
455
|
-
value: "VN",
|
|
456
|
-
extra: "vi"
|
|
457
|
-
}, {
|
|
458
|
-
label: "Indonesian",
|
|
459
|
-
value: "ID",
|
|
460
|
-
extra: "id"
|
|
461
|
-
}];
|
|
462
550
|
var CustomAiIcon = function CustomAiIcon(_ref2) {
|
|
463
551
|
var _ref2$isGradient = _ref2.isGradient,
|
|
464
552
|
isGradient = _ref2$isGradient === void 0 ? false : _ref2$isGradient,
|
|
@@ -938,8 +1026,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
938
1026
|
var getEscapeReplacement = function getEscapeReplacement(ch) {
|
|
939
1027
|
return escapeReplacements[ch];
|
|
940
1028
|
};
|
|
941
|
-
function escape2(html2,
|
|
942
|
-
if (
|
|
1029
|
+
function escape2(html2, encode2) {
|
|
1030
|
+
if (encode2) {
|
|
943
1031
|
if (other.escapeTest.test(html2)) {
|
|
944
1032
|
return html2.replace(other.escapeReplace, getEscapeReplacement);
|
|
945
1033
|
}
|
|
@@ -1440,11 +1528,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1440
1528
|
if (headers.length !== aligns.length) {
|
|
1441
1529
|
return;
|
|
1442
1530
|
}
|
|
1443
|
-
var
|
|
1444
|
-
|
|
1531
|
+
var _iterator4 = _createForOfIteratorHelper(aligns),
|
|
1532
|
+
_step3;
|
|
1445
1533
|
try {
|
|
1446
|
-
for (
|
|
1447
|
-
var align =
|
|
1534
|
+
for (_iterator4.s(); !(_step3 = _iterator4.n()).done;) {
|
|
1535
|
+
var align = _step3.value;
|
|
1448
1536
|
if (this.rules.other.tableAlignRight.test(align)) {
|
|
1449
1537
|
item.align.push("right");
|
|
1450
1538
|
} else if (this.rules.other.tableAlignCenter.test(align)) {
|
|
@@ -1456,9 +1544,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1456
1544
|
}
|
|
1457
1545
|
}
|
|
1458
1546
|
} catch (err) {
|
|
1459
|
-
|
|
1547
|
+
_iterator4.e(err);
|
|
1460
1548
|
} finally {
|
|
1461
|
-
|
|
1549
|
+
_iterator4.f();
|
|
1462
1550
|
}
|
|
1463
1551
|
for (var _i6 = 0; _i6 < headers.length; _i6++) {
|
|
1464
1552
|
item.header.push({
|
|
@@ -1468,11 +1556,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1468
1556
|
align: item.align[_i6]
|
|
1469
1557
|
});
|
|
1470
1558
|
}
|
|
1471
|
-
var
|
|
1472
|
-
|
|
1559
|
+
var _iterator5 = _createForOfIteratorHelper(rows),
|
|
1560
|
+
_step4;
|
|
1473
1561
|
try {
|
|
1474
|
-
for (
|
|
1475
|
-
var row =
|
|
1562
|
+
for (_iterator5.s(); !(_step4 = _iterator5.n()).done;) {
|
|
1563
|
+
var row = _step4.value;
|
|
1476
1564
|
item.rows.push(splitCells(row, item.header.length).map(function (cell, i) {
|
|
1477
1565
|
return {
|
|
1478
1566
|
text: cell,
|
|
@@ -1483,9 +1571,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1483
1571
|
}));
|
|
1484
1572
|
}
|
|
1485
1573
|
} catch (err) {
|
|
1486
|
-
|
|
1574
|
+
_iterator5.e(err);
|
|
1487
1575
|
} finally {
|
|
1488
|
-
|
|
1576
|
+
_iterator5.f();
|
|
1489
1577
|
}
|
|
1490
1578
|
return item;
|
|
1491
1579
|
}
|
|
@@ -2813,50 +2901,50 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2813
2901
|
var _this6 = this;
|
|
2814
2902
|
var _a2, _b;
|
|
2815
2903
|
var values = [];
|
|
2816
|
-
var
|
|
2817
|
-
|
|
2904
|
+
var _iterator6 = _createForOfIteratorHelper(tokens),
|
|
2905
|
+
_step5;
|
|
2818
2906
|
try {
|
|
2819
2907
|
var _loop4 = function _loop4() {
|
|
2820
|
-
var token =
|
|
2908
|
+
var token = _step5.value;
|
|
2821
2909
|
values = values.concat(callback.call(_this6, token));
|
|
2822
2910
|
switch (token.type) {
|
|
2823
2911
|
case "table":
|
|
2824
2912
|
{
|
|
2825
2913
|
var tableToken = token;
|
|
2826
|
-
var
|
|
2827
|
-
|
|
2914
|
+
var _iterator7 = _createForOfIteratorHelper(tableToken.header),
|
|
2915
|
+
_step6;
|
|
2828
2916
|
try {
|
|
2829
|
-
for (
|
|
2830
|
-
var cell =
|
|
2917
|
+
for (_iterator7.s(); !(_step6 = _iterator7.n()).done;) {
|
|
2918
|
+
var cell = _step6.value;
|
|
2831
2919
|
values = values.concat(_this6.walkTokens(cell.tokens, callback));
|
|
2832
2920
|
}
|
|
2833
2921
|
} catch (err) {
|
|
2834
|
-
|
|
2922
|
+
_iterator7.e(err);
|
|
2835
2923
|
} finally {
|
|
2836
|
-
|
|
2924
|
+
_iterator7.f();
|
|
2837
2925
|
}
|
|
2838
|
-
var
|
|
2839
|
-
|
|
2926
|
+
var _iterator8 = _createForOfIteratorHelper(tableToken.rows),
|
|
2927
|
+
_step7;
|
|
2840
2928
|
try {
|
|
2841
|
-
for (
|
|
2842
|
-
var row =
|
|
2843
|
-
var
|
|
2844
|
-
|
|
2929
|
+
for (_iterator8.s(); !(_step7 = _iterator8.n()).done;) {
|
|
2930
|
+
var row = _step7.value;
|
|
2931
|
+
var _iterator9 = _createForOfIteratorHelper(row),
|
|
2932
|
+
_step8;
|
|
2845
2933
|
try {
|
|
2846
|
-
for (
|
|
2847
|
-
var _cell =
|
|
2934
|
+
for (_iterator9.s(); !(_step8 = _iterator9.n()).done;) {
|
|
2935
|
+
var _cell = _step8.value;
|
|
2848
2936
|
values = values.concat(_this6.walkTokens(_cell.tokens, callback));
|
|
2849
2937
|
}
|
|
2850
2938
|
} catch (err) {
|
|
2851
|
-
|
|
2939
|
+
_iterator9.e(err);
|
|
2852
2940
|
} finally {
|
|
2853
|
-
|
|
2941
|
+
_iterator9.f();
|
|
2854
2942
|
}
|
|
2855
2943
|
}
|
|
2856
2944
|
} catch (err) {
|
|
2857
|
-
|
|
2945
|
+
_iterator8.e(err);
|
|
2858
2946
|
} finally {
|
|
2859
|
-
|
|
2947
|
+
_iterator8.f();
|
|
2860
2948
|
}
|
|
2861
2949
|
break;
|
|
2862
2950
|
}
|
|
@@ -2880,13 +2968,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2880
2968
|
}
|
|
2881
2969
|
}
|
|
2882
2970
|
};
|
|
2883
|
-
for (
|
|
2971
|
+
for (_iterator6.s(); !(_step5 = _iterator6.n()).done;) {
|
|
2884
2972
|
_loop4();
|
|
2885
2973
|
}
|
|
2886
2974
|
} catch (err) {
|
|
2887
|
-
|
|
2975
|
+
_iterator6.e(err);
|
|
2888
2976
|
} finally {
|
|
2889
|
-
|
|
2977
|
+
_iterator6.f();
|
|
2890
2978
|
}
|
|
2891
2979
|
return values;
|
|
2892
2980
|
}
|
|
@@ -2898,8 +2986,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2898
2986
|
renderers: {},
|
|
2899
2987
|
childTokens: {}
|
|
2900
2988
|
};
|
|
2901
|
-
for (var _len = arguments.length, args = new Array(_len),
|
|
2902
|
-
args[
|
|
2989
|
+
for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
|
|
2990
|
+
args[_key2] = arguments[_key2];
|
|
2903
2991
|
}
|
|
2904
2992
|
args.forEach(function (pack) {
|
|
2905
2993
|
var opts = __spreadValues({}, pack);
|
|
@@ -2913,8 +3001,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2913
3001
|
var prevRenderer = extensions.renderers[ext.name];
|
|
2914
3002
|
if (prevRenderer) {
|
|
2915
3003
|
extensions.renderers[ext.name] = function () {
|
|
2916
|
-
for (var _len2 = arguments.length, args2 = new Array(_len2),
|
|
2917
|
-
args2[
|
|
3004
|
+
for (var _len2 = arguments.length, args2 = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
|
|
3005
|
+
args2[_key3] = arguments[_key3];
|
|
2918
3006
|
}
|
|
2919
3007
|
var ret = ext.renderer.apply(this, args2);
|
|
2920
3008
|
if (ret === false) {
|
|
@@ -2971,8 +3059,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2971
3059
|
var rendererFunc = pack.renderer[rendererProp];
|
|
2972
3060
|
var prevRenderer = renderer[rendererProp];
|
|
2973
3061
|
renderer[rendererProp] = function () {
|
|
2974
|
-
for (var _len3 = arguments.length, args2 = new Array(_len3),
|
|
2975
|
-
args2[
|
|
3062
|
+
for (var _len3 = arguments.length, args2 = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) {
|
|
3063
|
+
args2[_key4] = arguments[_key4];
|
|
2976
3064
|
}
|
|
2977
3065
|
var ret = rendererFunc.apply(renderer, args2);
|
|
2978
3066
|
if (ret === false) {
|
|
@@ -2999,8 +3087,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2999
3087
|
var tokenizerFunc = pack.tokenizer[tokenizerProp];
|
|
3000
3088
|
var prevTokenizer = tokenizer[tokenizerProp];
|
|
3001
3089
|
tokenizer[tokenizerProp] = function () {
|
|
3002
|
-
for (var _len4 = arguments.length, args2 = new Array(_len4),
|
|
3003
|
-
args2[
|
|
3090
|
+
for (var _len4 = arguments.length, args2 = new Array(_len4), _key5 = 0; _key5 < _len4; _key5++) {
|
|
3091
|
+
args2[_key5] = arguments[_key5];
|
|
3004
3092
|
}
|
|
3005
3093
|
var ret = tokenizerFunc.apply(tokenizer, args2);
|
|
3006
3094
|
if (ret === false) {
|
|
@@ -3038,8 +3126,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3038
3126
|
};
|
|
3039
3127
|
} else {
|
|
3040
3128
|
hooks[hooksProp] = function () {
|
|
3041
|
-
for (var _len5 = arguments.length, args2 = new Array(_len5),
|
|
3042
|
-
args2[
|
|
3129
|
+
for (var _len5 = arguments.length, args2 = new Array(_len5), _key6 = 0; _key6 < _len5; _key6++) {
|
|
3130
|
+
args2[_key6] = arguments[_key6];
|
|
3043
3131
|
}
|
|
3044
3132
|
var ret = hooksFunc.apply(hooks, args2);
|
|
3045
3133
|
if (ret === false) {
|
|
@@ -3696,7 +3784,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3696
3784
|
delay: propTypesExports.number
|
|
3697
3785
|
})
|
|
3698
3786
|
}, eventPropTypes);
|
|
3699
|
-
var isFunction = function isFunction(x) {
|
|
3787
|
+
var isFunction$2 = function isFunction$2(x) {
|
|
3700
3788
|
return typeof x === "function";
|
|
3701
3789
|
};
|
|
3702
3790
|
var isEventProp = function isEventProp(name) {
|
|
@@ -3926,8 +4014,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3926
4014
|
};
|
|
3927
4015
|
var ScriptLoader = createScriptLoader();
|
|
3928
4016
|
var getTinymce = function getTinymce(view) {
|
|
3929
|
-
var
|
|
3930
|
-
return
|
|
4017
|
+
var global2 = view;
|
|
4018
|
+
return global2 && global2.tinymce ? global2.tinymce : null;
|
|
3931
4019
|
};
|
|
3932
4020
|
var __extends = /* @__PURE__ */function () {
|
|
3933
4021
|
var _extendStatics = function extendStatics(d, b) {
|
|
@@ -4007,7 +4095,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4007
4095
|
}
|
|
4008
4096
|
if (newContent !== _this.currentContent) {
|
|
4009
4097
|
_this.currentContent = newContent;
|
|
4010
|
-
if (isFunction(_this.props.onEditorChange)) {
|
|
4098
|
+
if (isFunction$2(_this.props.onEditorChange)) {
|
|
4011
4099
|
_this.props.onEditorChange(newContent, editor);
|
|
4012
4100
|
}
|
|
4013
4101
|
}
|
|
@@ -4062,7 +4150,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4062
4150
|
});
|
|
4063
4151
|
});
|
|
4064
4152
|
}
|
|
4065
|
-
if (_this.props.init && isFunction(_this.props.init.setup)) {
|
|
4153
|
+
if (_this.props.init && isFunction$2(_this.props.init.setup)) {
|
|
4066
4154
|
_this.props.init.setup(editor);
|
|
4067
4155
|
}
|
|
4068
4156
|
},
|
|
@@ -4079,7 +4167,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4079
4167
|
}
|
|
4080
4168
|
var disabled = (_b3 = _this.props.disabled) !== null && _b3 !== void 0 ? _b3 : false;
|
|
4081
4169
|
setMode(_this.editor, disabled ? "readonly" : "design");
|
|
4082
|
-
if (_this.props.init && isFunction(_this.props.init.init_instance_callback)) {
|
|
4170
|
+
if (_this.props.init && isFunction$2(_this.props.init.init_instance_callback)) {
|
|
4083
4171
|
_this.props.init.init_instance_callback(editor);
|
|
4084
4172
|
}
|
|
4085
4173
|
}
|
|
@@ -4539,62 +4627,3062 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4539
4627
|
}
|
|
4540
4628
|
}]);
|
|
4541
4629
|
}(React.Component);
|
|
4542
|
-
|
|
4543
|
-
function
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4630
|
+
function bind(fn, thisArg) {
|
|
4631
|
+
return function wrap() {
|
|
4632
|
+
return fn.apply(thisArg, arguments);
|
|
4633
|
+
};
|
|
4634
|
+
}
|
|
4635
|
+
var toString = Object.prototype.toString;
|
|
4636
|
+
var getPrototypeOf = Object.getPrototypeOf;
|
|
4637
|
+
var iterator = Symbol.iterator,
|
|
4638
|
+
toStringTag = Symbol.toStringTag;
|
|
4639
|
+
var kindOf = /* @__PURE__ */function (cache) {
|
|
4640
|
+
return function (thing) {
|
|
4641
|
+
var str = toString.call(thing);
|
|
4642
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
4643
|
+
};
|
|
4644
|
+
}(/* @__PURE__ */Object.create(null));
|
|
4645
|
+
var kindOfTest = function kindOfTest(type) {
|
|
4646
|
+
type = type.toLowerCase();
|
|
4647
|
+
return function (thing) {
|
|
4648
|
+
return kindOf(thing) === type;
|
|
4649
|
+
};
|
|
4650
|
+
};
|
|
4651
|
+
var typeOfTest = function typeOfTest(type) {
|
|
4652
|
+
return function (thing) {
|
|
4653
|
+
return _typeof(thing) === type;
|
|
4654
|
+
};
|
|
4655
|
+
};
|
|
4656
|
+
var isArray = Array.isArray;
|
|
4657
|
+
var isUndefined = typeOfTest("undefined");
|
|
4658
|
+
function isBuffer(val) {
|
|
4659
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
4660
|
+
}
|
|
4661
|
+
var isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
4662
|
+
function isArrayBufferView(val) {
|
|
4663
|
+
var result;
|
|
4664
|
+
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
4665
|
+
result = ArrayBuffer.isView(val);
|
|
4666
|
+
} else {
|
|
4667
|
+
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
4668
|
+
}
|
|
4669
|
+
return result;
|
|
4670
|
+
}
|
|
4671
|
+
var isString = typeOfTest("string");
|
|
4672
|
+
var isFunction$1 = typeOfTest("function");
|
|
4673
|
+
var isNumber = typeOfTest("number");
|
|
4674
|
+
var isObject = function isObject(thing) {
|
|
4675
|
+
return thing !== null && _typeof(thing) === "object";
|
|
4676
|
+
};
|
|
4677
|
+
var isBoolean = function isBoolean(thing) {
|
|
4678
|
+
return thing === true || thing === false;
|
|
4679
|
+
};
|
|
4680
|
+
var isPlainObject = function isPlainObject(val) {
|
|
4681
|
+
if (kindOf(val) !== "object") {
|
|
4682
|
+
return false;
|
|
4683
|
+
}
|
|
4684
|
+
var prototype2 = getPrototypeOf(val);
|
|
4685
|
+
return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
|
|
4686
|
+
};
|
|
4687
|
+
var isEmptyObject = function isEmptyObject(val) {
|
|
4688
|
+
if (!isObject(val) || isBuffer(val)) {
|
|
4689
|
+
return false;
|
|
4690
|
+
}
|
|
4691
|
+
try {
|
|
4692
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
4693
|
+
} catch (e) {
|
|
4694
|
+
return false;
|
|
4695
|
+
}
|
|
4696
|
+
};
|
|
4697
|
+
var isDate = kindOfTest("Date");
|
|
4698
|
+
var isFile = kindOfTest("File");
|
|
4699
|
+
var isReactNativeBlob = function isReactNativeBlob(value) {
|
|
4700
|
+
return !!(value && typeof value.uri !== "undefined");
|
|
4701
|
+
};
|
|
4702
|
+
var isReactNative = function isReactNative(formData) {
|
|
4703
|
+
return formData && typeof formData.getParts !== "undefined";
|
|
4704
|
+
};
|
|
4705
|
+
var isBlob = kindOfTest("Blob");
|
|
4706
|
+
var isFileList = kindOfTest("FileList");
|
|
4707
|
+
var isStream = function isStream(val) {
|
|
4708
|
+
return isObject(val) && isFunction$1(val.pipe);
|
|
4709
|
+
};
|
|
4710
|
+
function getGlobal() {
|
|
4711
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
4712
|
+
if (typeof self !== "undefined") return self;
|
|
4713
|
+
if (typeof window !== "undefined") return window;
|
|
4714
|
+
if (typeof global !== "undefined") return global;
|
|
4715
|
+
return {};
|
|
4716
|
+
}
|
|
4717
|
+
var G = getGlobal();
|
|
4718
|
+
var FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0;
|
|
4719
|
+
var isFormData = function isFormData(thing) {
|
|
4720
|
+
var kind;
|
|
4721
|
+
return thing && (FormDataCtor && thing instanceof FormDataCtor || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" ||
|
|
4722
|
+
// detect form-data instance
|
|
4723
|
+
kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
|
|
4724
|
+
};
|
|
4725
|
+
var isURLSearchParams = kindOfTest("URLSearchParams");
|
|
4726
|
+
var _map = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest),
|
|
4727
|
+
_map2 = _slicedToArray(_map, 4),
|
|
4728
|
+
isReadableStream = _map2[0],
|
|
4729
|
+
isRequest = _map2[1],
|
|
4730
|
+
isResponse = _map2[2],
|
|
4731
|
+
isHeaders = _map2[3];
|
|
4732
|
+
var trim = function trim(str) {
|
|
4733
|
+
return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
4734
|
+
};
|
|
4735
|
+
function forEach(obj, fn) {
|
|
4736
|
+
var _ref28 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
4737
|
+
_ref28$allOwnKeys = _ref28.allOwnKeys,
|
|
4738
|
+
allOwnKeys = _ref28$allOwnKeys === void 0 ? false : _ref28$allOwnKeys;
|
|
4739
|
+
if (obj === null || typeof obj === "undefined") {
|
|
4740
|
+
return;
|
|
4741
|
+
}
|
|
4742
|
+
var i;
|
|
4743
|
+
var l;
|
|
4744
|
+
if (_typeof(obj) !== "object") {
|
|
4745
|
+
obj = [obj];
|
|
4746
|
+
}
|
|
4747
|
+
if (isArray(obj)) {
|
|
4748
|
+
for (i = 0, l = obj.length; i < l; i++) {
|
|
4749
|
+
fn.call(null, obj[i], i, obj);
|
|
4750
|
+
}
|
|
4751
|
+
} else {
|
|
4752
|
+
if (isBuffer(obj)) {
|
|
4753
|
+
return;
|
|
4754
|
+
}
|
|
4755
|
+
var keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
4756
|
+
var len = keys.length;
|
|
4757
|
+
var key;
|
|
4758
|
+
for (i = 0; i < len; i++) {
|
|
4759
|
+
key = keys[i];
|
|
4760
|
+
fn.call(null, obj[key], key, obj);
|
|
4761
|
+
}
|
|
4762
|
+
}
|
|
4763
|
+
}
|
|
4764
|
+
function findKey(obj, key) {
|
|
4765
|
+
if (isBuffer(obj)) {
|
|
4766
|
+
return null;
|
|
4767
|
+
}
|
|
4768
|
+
key = key.toLowerCase();
|
|
4769
|
+
var keys = Object.keys(obj);
|
|
4770
|
+
var i = keys.length;
|
|
4771
|
+
var _key;
|
|
4772
|
+
while (i-- > 0) {
|
|
4773
|
+
_key = keys[i];
|
|
4774
|
+
if (key === _key.toLowerCase()) {
|
|
4775
|
+
return _key;
|
|
4776
|
+
}
|
|
4777
|
+
}
|
|
4778
|
+
return null;
|
|
4779
|
+
}
|
|
4780
|
+
var _global = function () {
|
|
4781
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
4782
|
+
return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
|
|
4783
|
+
}();
|
|
4784
|
+
var isContextDefined = function isContextDefined(context) {
|
|
4785
|
+
return !isUndefined(context) && context !== _global;
|
|
4786
|
+
};
|
|
4787
|
+
function merge() {
|
|
4788
|
+
var _ref29 = isContextDefined(this) && this || {},
|
|
4789
|
+
caseless = _ref29.caseless,
|
|
4790
|
+
skipUndefined = _ref29.skipUndefined;
|
|
4791
|
+
var result = {};
|
|
4792
|
+
var assignValue = function assignValue(val, key) {
|
|
4793
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
4794
|
+
return;
|
|
4795
|
+
}
|
|
4796
|
+
var targetKey = caseless && findKey(result, key) || key;
|
|
4797
|
+
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
4798
|
+
result[targetKey] = merge(result[targetKey], val);
|
|
4799
|
+
} else if (isPlainObject(val)) {
|
|
4800
|
+
result[targetKey] = merge({}, val);
|
|
4801
|
+
} else if (isArray(val)) {
|
|
4802
|
+
result[targetKey] = val.slice();
|
|
4803
|
+
} else if (!skipUndefined || !isUndefined(val)) {
|
|
4804
|
+
result[targetKey] = val;
|
|
4805
|
+
}
|
|
4806
|
+
};
|
|
4807
|
+
for (var _i0 = 0, l = arguments.length; _i0 < l; _i0++) {
|
|
4808
|
+
arguments[_i0] && forEach(arguments[_i0], assignValue);
|
|
4809
|
+
}
|
|
4810
|
+
return result;
|
|
4811
|
+
}
|
|
4812
|
+
var extend = function extend(a, b, thisArg) {
|
|
4813
|
+
var _ref30 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
|
|
4814
|
+
allOwnKeys = _ref30.allOwnKeys;
|
|
4815
|
+
forEach(b, function (val, key) {
|
|
4816
|
+
if (thisArg && isFunction$1(val)) {
|
|
4817
|
+
Object.defineProperty(a, key, {
|
|
4818
|
+
value: bind(val, thisArg),
|
|
4819
|
+
writable: true,
|
|
4820
|
+
enumerable: true,
|
|
4821
|
+
configurable: true
|
|
4562
4822
|
});
|
|
4563
|
-
}
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4823
|
+
} else {
|
|
4824
|
+
Object.defineProperty(a, key, {
|
|
4825
|
+
value: val,
|
|
4826
|
+
writable: true,
|
|
4827
|
+
enumerable: true,
|
|
4828
|
+
configurable: true
|
|
4567
4829
|
});
|
|
4568
|
-
|
|
4830
|
+
}
|
|
4831
|
+
}, {
|
|
4832
|
+
allOwnKeys: allOwnKeys
|
|
4833
|
+
});
|
|
4834
|
+
return a;
|
|
4835
|
+
};
|
|
4836
|
+
var stripBOM = function stripBOM(content) {
|
|
4837
|
+
if (content.charCodeAt(0) === 65279) {
|
|
4838
|
+
content = content.slice(1);
|
|
4839
|
+
}
|
|
4840
|
+
return content;
|
|
4841
|
+
};
|
|
4842
|
+
var inherits = function inherits(constructor, superConstructor, props, descriptors) {
|
|
4843
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
4844
|
+
Object.defineProperty(constructor.prototype, "constructor", {
|
|
4845
|
+
value: constructor,
|
|
4846
|
+
writable: true,
|
|
4847
|
+
enumerable: false,
|
|
4848
|
+
configurable: true
|
|
4849
|
+
});
|
|
4850
|
+
Object.defineProperty(constructor, "super", {
|
|
4851
|
+
value: superConstructor.prototype
|
|
4852
|
+
});
|
|
4853
|
+
props && Object.assign(constructor.prototype, props);
|
|
4854
|
+
};
|
|
4855
|
+
var toFlatObject = function toFlatObject(sourceObj, destObj, filter, propFilter) {
|
|
4856
|
+
var props;
|
|
4857
|
+
var i;
|
|
4858
|
+
var prop;
|
|
4859
|
+
var merged = {};
|
|
4860
|
+
destObj = destObj || {};
|
|
4861
|
+
if (sourceObj == null) return destObj;
|
|
4862
|
+
do {
|
|
4863
|
+
props = Object.getOwnPropertyNames(sourceObj);
|
|
4864
|
+
i = props.length;
|
|
4865
|
+
while (i-- > 0) {
|
|
4866
|
+
prop = props[i];
|
|
4867
|
+
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
4868
|
+
destObj[prop] = sourceObj[prop];
|
|
4869
|
+
merged[prop] = true;
|
|
4870
|
+
}
|
|
4871
|
+
}
|
|
4872
|
+
sourceObj = filter !== false && getPrototypeOf(sourceObj);
|
|
4873
|
+
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
4874
|
+
return destObj;
|
|
4875
|
+
};
|
|
4876
|
+
var endsWith = function endsWith(str, searchString, position) {
|
|
4877
|
+
str = String(str);
|
|
4878
|
+
if (position === void 0 || position > str.length) {
|
|
4879
|
+
position = str.length;
|
|
4880
|
+
}
|
|
4881
|
+
position -= searchString.length;
|
|
4882
|
+
var lastIndex = str.indexOf(searchString, position);
|
|
4883
|
+
return lastIndex !== -1 && lastIndex === position;
|
|
4884
|
+
};
|
|
4885
|
+
var toArray = function toArray(thing) {
|
|
4886
|
+
if (!thing) return null;
|
|
4887
|
+
if (isArray(thing)) return thing;
|
|
4888
|
+
var i = thing.length;
|
|
4889
|
+
if (!isNumber(i)) return null;
|
|
4890
|
+
var arr = new Array(i);
|
|
4891
|
+
while (i-- > 0) {
|
|
4892
|
+
arr[i] = thing[i];
|
|
4893
|
+
}
|
|
4894
|
+
return arr;
|
|
4895
|
+
};
|
|
4896
|
+
var isTypedArray = /* @__PURE__ */function (TypedArray) {
|
|
4897
|
+
return function (thing) {
|
|
4898
|
+
return TypedArray && thing instanceof TypedArray;
|
|
4899
|
+
};
|
|
4900
|
+
}(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
4901
|
+
var forEachEntry = function forEachEntry(obj, fn) {
|
|
4902
|
+
var generator = obj && obj[iterator];
|
|
4903
|
+
var _iterator = generator.call(obj);
|
|
4904
|
+
var result;
|
|
4905
|
+
while ((result = _iterator.next()) && !result.done) {
|
|
4906
|
+
var pair = result.value;
|
|
4907
|
+
fn.call(obj, pair[0], pair[1]);
|
|
4908
|
+
}
|
|
4909
|
+
};
|
|
4910
|
+
var matchAll = function matchAll(regExp, str) {
|
|
4911
|
+
var matches;
|
|
4912
|
+
var arr = [];
|
|
4913
|
+
while ((matches = regExp.exec(str)) !== null) {
|
|
4914
|
+
arr.push(matches);
|
|
4915
|
+
}
|
|
4916
|
+
return arr;
|
|
4917
|
+
};
|
|
4918
|
+
var isHTMLForm = kindOfTest("HTMLFormElement");
|
|
4919
|
+
var toCamelCase = function toCamelCase(str) {
|
|
4920
|
+
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
|
|
4921
|
+
return p1.toUpperCase() + p2;
|
|
4922
|
+
});
|
|
4923
|
+
};
|
|
4924
|
+
var hasOwnProperty = function (_ref31) {
|
|
4925
|
+
var hasOwnProperty2 = _ref31.hasOwnProperty;
|
|
4926
|
+
return function (obj, prop) {
|
|
4927
|
+
return hasOwnProperty2.call(obj, prop);
|
|
4928
|
+
};
|
|
4929
|
+
}(Object.prototype);
|
|
4930
|
+
var isRegExp = kindOfTest("RegExp");
|
|
4931
|
+
var reduceDescriptors = function reduceDescriptors(obj, reducer) {
|
|
4932
|
+
var descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
4933
|
+
var reducedDescriptors = {};
|
|
4934
|
+
forEach(descriptors, function (descriptor, name) {
|
|
4935
|
+
var ret;
|
|
4936
|
+
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
|
4937
|
+
reducedDescriptors[name] = ret || descriptor;
|
|
4938
|
+
}
|
|
4939
|
+
});
|
|
4940
|
+
Object.defineProperties(obj, reducedDescriptors);
|
|
4941
|
+
};
|
|
4942
|
+
var freezeMethods = function freezeMethods(obj) {
|
|
4943
|
+
reduceDescriptors(obj, function (descriptor, name) {
|
|
4944
|
+
if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
|
|
4945
|
+
return false;
|
|
4946
|
+
}
|
|
4947
|
+
var value = obj[name];
|
|
4948
|
+
if (!isFunction$1(value)) return;
|
|
4949
|
+
descriptor.enumerable = false;
|
|
4950
|
+
if ("writable" in descriptor) {
|
|
4951
|
+
descriptor.writable = false;
|
|
4952
|
+
return;
|
|
4953
|
+
}
|
|
4954
|
+
if (!descriptor.set) {
|
|
4955
|
+
descriptor.set = function () {
|
|
4956
|
+
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
4957
|
+
};
|
|
4958
|
+
}
|
|
4959
|
+
});
|
|
4960
|
+
};
|
|
4961
|
+
var toObjectSet = function toObjectSet(arrayOrString, delimiter) {
|
|
4962
|
+
var obj = {};
|
|
4963
|
+
var define2 = function define2(arr) {
|
|
4964
|
+
arr.forEach(function (value) {
|
|
4965
|
+
obj[value] = true;
|
|
4569
4966
|
});
|
|
4570
|
-
|
|
4571
|
-
|
|
4967
|
+
};
|
|
4968
|
+
isArray(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter));
|
|
4969
|
+
return obj;
|
|
4970
|
+
};
|
|
4971
|
+
var noop = function noop() {};
|
|
4972
|
+
var toFiniteNumber = function toFiniteNumber(value, defaultValue) {
|
|
4973
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
4974
|
+
};
|
|
4975
|
+
function isSpecCompliantForm(thing) {
|
|
4976
|
+
return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
|
|
4977
|
+
}
|
|
4978
|
+
var toJSONObject = function toJSONObject(obj) {
|
|
4979
|
+
var stack = new Array(10);
|
|
4980
|
+
var _visit = function visit(source, i) {
|
|
4981
|
+
if (isObject(source)) {
|
|
4982
|
+
if (stack.indexOf(source) >= 0) {
|
|
4983
|
+
return;
|
|
4984
|
+
}
|
|
4985
|
+
if (isBuffer(source)) {
|
|
4986
|
+
return source;
|
|
4987
|
+
}
|
|
4988
|
+
if (!("toJSON" in source)) {
|
|
4989
|
+
stack[i] = source;
|
|
4990
|
+
var target = isArray(source) ? [] : {};
|
|
4991
|
+
forEach(source, function (value, key) {
|
|
4992
|
+
var reducedValue = _visit(value, i + 1);
|
|
4993
|
+
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
4994
|
+
});
|
|
4995
|
+
stack[i] = void 0;
|
|
4996
|
+
return target;
|
|
4997
|
+
}
|
|
4998
|
+
}
|
|
4999
|
+
return source;
|
|
5000
|
+
};
|
|
5001
|
+
return _visit(obj, 0);
|
|
5002
|
+
};
|
|
5003
|
+
var isAsyncFn = kindOfTest("AsyncFunction");
|
|
5004
|
+
var isThenable = function isThenable(thing) {
|
|
5005
|
+
return thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
|
|
5006
|
+
};
|
|
5007
|
+
var _setImmediate = function (setImmediateSupported, postMessageSupported) {
|
|
5008
|
+
if (setImmediateSupported) {
|
|
5009
|
+
return setImmediate;
|
|
5010
|
+
}
|
|
5011
|
+
return postMessageSupported ? function (token, callbacks) {
|
|
5012
|
+
_global.addEventListener("message", function (_ref32) {
|
|
5013
|
+
var source = _ref32.source,
|
|
5014
|
+
data = _ref32.data;
|
|
5015
|
+
if (source === _global && data === token) {
|
|
5016
|
+
callbacks.length && callbacks.shift()();
|
|
5017
|
+
}
|
|
5018
|
+
}, false);
|
|
5019
|
+
return function (cb) {
|
|
5020
|
+
callbacks.push(cb);
|
|
5021
|
+
_global.postMessage(token, "*");
|
|
4572
5022
|
};
|
|
4573
|
-
|
|
4574
|
-
|
|
5023
|
+
}("axios@".concat(Math.random()), []) : function (cb) {
|
|
5024
|
+
return setTimeout(cb);
|
|
5025
|
+
};
|
|
5026
|
+
}(typeof setImmediate === "function", isFunction$1(_global.postMessage));
|
|
5027
|
+
var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
5028
|
+
var isIterable = function isIterable(thing) {
|
|
5029
|
+
return thing != null && isFunction$1(thing[iterator]);
|
|
5030
|
+
};
|
|
5031
|
+
var utils$1 = {
|
|
5032
|
+
isArray: isArray,
|
|
5033
|
+
isArrayBuffer: isArrayBuffer,
|
|
5034
|
+
isBuffer: isBuffer,
|
|
5035
|
+
isFormData: isFormData,
|
|
5036
|
+
isArrayBufferView: isArrayBufferView,
|
|
5037
|
+
isString: isString,
|
|
5038
|
+
isNumber: isNumber,
|
|
5039
|
+
isBoolean: isBoolean,
|
|
5040
|
+
isObject: isObject,
|
|
5041
|
+
isPlainObject: isPlainObject,
|
|
5042
|
+
isEmptyObject: isEmptyObject,
|
|
5043
|
+
isReadableStream: isReadableStream,
|
|
5044
|
+
isRequest: isRequest,
|
|
5045
|
+
isResponse: isResponse,
|
|
5046
|
+
isHeaders: isHeaders,
|
|
5047
|
+
isUndefined: isUndefined,
|
|
5048
|
+
isDate: isDate,
|
|
5049
|
+
isFile: isFile,
|
|
5050
|
+
isReactNativeBlob: isReactNativeBlob,
|
|
5051
|
+
isReactNative: isReactNative,
|
|
5052
|
+
isBlob: isBlob,
|
|
5053
|
+
isRegExp: isRegExp,
|
|
5054
|
+
isFunction: isFunction$1,
|
|
5055
|
+
isStream: isStream,
|
|
5056
|
+
isURLSearchParams: isURLSearchParams,
|
|
5057
|
+
isTypedArray: isTypedArray,
|
|
5058
|
+
isFileList: isFileList,
|
|
5059
|
+
forEach: forEach,
|
|
5060
|
+
merge: merge,
|
|
5061
|
+
extend: extend,
|
|
5062
|
+
trim: trim,
|
|
5063
|
+
stripBOM: stripBOM,
|
|
5064
|
+
inherits: inherits,
|
|
5065
|
+
toFlatObject: toFlatObject,
|
|
5066
|
+
kindOf: kindOf,
|
|
5067
|
+
kindOfTest: kindOfTest,
|
|
5068
|
+
endsWith: endsWith,
|
|
5069
|
+
toArray: toArray,
|
|
5070
|
+
forEachEntry: forEachEntry,
|
|
5071
|
+
matchAll: matchAll,
|
|
5072
|
+
isHTMLForm: isHTMLForm,
|
|
5073
|
+
hasOwnProperty: hasOwnProperty,
|
|
5074
|
+
hasOwnProp: hasOwnProperty,
|
|
5075
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
5076
|
+
reduceDescriptors: reduceDescriptors,
|
|
5077
|
+
freezeMethods: freezeMethods,
|
|
5078
|
+
toObjectSet: toObjectSet,
|
|
5079
|
+
toCamelCase: toCamelCase,
|
|
5080
|
+
noop: noop,
|
|
5081
|
+
toFiniteNumber: toFiniteNumber,
|
|
5082
|
+
findKey: findKey,
|
|
5083
|
+
global: _global,
|
|
5084
|
+
isContextDefined: isContextDefined,
|
|
5085
|
+
isSpecCompliantForm: isSpecCompliantForm,
|
|
5086
|
+
toJSONObject: toJSONObject,
|
|
5087
|
+
isAsyncFn: isAsyncFn,
|
|
5088
|
+
isThenable: isThenable,
|
|
5089
|
+
setImmediate: _setImmediate,
|
|
5090
|
+
asap: asap,
|
|
5091
|
+
isIterable: isIterable
|
|
5092
|
+
};
|
|
5093
|
+
var AxiosError$1 = /*#__PURE__*/function (_Error) {
|
|
5094
|
+
/**
|
|
5095
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
5096
|
+
*
|
|
5097
|
+
* @param {string} message The error message.
|
|
5098
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
5099
|
+
* @param {Object} [config] The config.
|
|
5100
|
+
* @param {Object} [request] The request.
|
|
5101
|
+
* @param {Object} [response] The response.
|
|
5102
|
+
*
|
|
5103
|
+
* @returns {Error} The created error.
|
|
5104
|
+
*/
|
|
5105
|
+
function AxiosError2(message, code, config, request, response) {
|
|
5106
|
+
var _this11;
|
|
5107
|
+
_classCallCheck(this, AxiosError2);
|
|
5108
|
+
_this11 = _callSuper(this, AxiosError2, [message]);
|
|
5109
|
+
Object.defineProperty(_this11, "message", {
|
|
5110
|
+
value: message,
|
|
5111
|
+
enumerable: true,
|
|
5112
|
+
writable: true,
|
|
5113
|
+
configurable: true
|
|
5114
|
+
});
|
|
5115
|
+
_this11.name = "AxiosError";
|
|
5116
|
+
_this11.isAxiosError = true;
|
|
5117
|
+
code && (_this11.code = code);
|
|
5118
|
+
config && (_this11.config = config);
|
|
5119
|
+
request && (_this11.request = request);
|
|
5120
|
+
if (response) {
|
|
5121
|
+
_this11.response = response;
|
|
5122
|
+
_this11.status = response.status;
|
|
5123
|
+
}
|
|
4575
5124
|
return _this11;
|
|
4576
5125
|
}
|
|
4577
|
-
_inherits(
|
|
4578
|
-
return _createClass(
|
|
4579
|
-
key: "
|
|
4580
|
-
value: function
|
|
4581
|
-
|
|
5126
|
+
_inherits(AxiosError2, _Error);
|
|
5127
|
+
return _createClass(AxiosError2, [{
|
|
5128
|
+
key: "toJSON",
|
|
5129
|
+
value: function toJSON() {
|
|
5130
|
+
return {
|
|
5131
|
+
// Standard
|
|
5132
|
+
message: this.message,
|
|
5133
|
+
name: this.name,
|
|
5134
|
+
// Microsoft
|
|
5135
|
+
description: this.description,
|
|
5136
|
+
number: this.number,
|
|
5137
|
+
// Mozilla
|
|
5138
|
+
fileName: this.fileName,
|
|
5139
|
+
lineNumber: this.lineNumber,
|
|
5140
|
+
columnNumber: this.columnNumber,
|
|
5141
|
+
stack: this.stack,
|
|
5142
|
+
// Axios
|
|
5143
|
+
config: utils$1.toJSONObject(this.config),
|
|
5144
|
+
code: this.code,
|
|
5145
|
+
status: this.status
|
|
5146
|
+
};
|
|
5147
|
+
}
|
|
5148
|
+
}], [{
|
|
5149
|
+
key: "from",
|
|
5150
|
+
value: function from(error, code, config, request, response, customProps) {
|
|
5151
|
+
var axiosError = new AxiosError2(error.message, code || error.code, config, request, response);
|
|
5152
|
+
axiosError.cause = error;
|
|
5153
|
+
axiosError.name = error.name;
|
|
5154
|
+
if (error.status != null && axiosError.status == null) {
|
|
5155
|
+
axiosError.status = error.status;
|
|
5156
|
+
}
|
|
5157
|
+
customProps && Object.assign(axiosError, customProps);
|
|
5158
|
+
return axiosError;
|
|
5159
|
+
}
|
|
5160
|
+
}]);
|
|
5161
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
5162
|
+
AxiosError$1.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
5163
|
+
AxiosError$1.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
5164
|
+
AxiosError$1.ECONNABORTED = "ECONNABORTED";
|
|
5165
|
+
AxiosError$1.ETIMEDOUT = "ETIMEDOUT";
|
|
5166
|
+
AxiosError$1.ERR_NETWORK = "ERR_NETWORK";
|
|
5167
|
+
AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
5168
|
+
AxiosError$1.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
5169
|
+
AxiosError$1.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
5170
|
+
AxiosError$1.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
5171
|
+
AxiosError$1.ERR_CANCELED = "ERR_CANCELED";
|
|
5172
|
+
AxiosError$1.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
5173
|
+
AxiosError$1.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
5174
|
+
var httpAdapter = null;
|
|
5175
|
+
function isVisitable(thing) {
|
|
5176
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
5177
|
+
}
|
|
5178
|
+
function removeBrackets(key) {
|
|
5179
|
+
return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
5180
|
+
}
|
|
5181
|
+
function renderKey(path, key, dots) {
|
|
5182
|
+
if (!path) return key;
|
|
5183
|
+
return path.concat(key).map(function each(token, i) {
|
|
5184
|
+
token = removeBrackets(token);
|
|
5185
|
+
return !dots && i ? "[" + token + "]" : token;
|
|
5186
|
+
}).join(dots ? "." : "");
|
|
5187
|
+
}
|
|
5188
|
+
function isFlatArray(arr) {
|
|
5189
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
|
5190
|
+
}
|
|
5191
|
+
var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
|
|
5192
|
+
return /^is[A-Z]/.test(prop);
|
|
5193
|
+
});
|
|
5194
|
+
function toFormData$1(obj, formData, options) {
|
|
5195
|
+
if (!utils$1.isObject(obj)) {
|
|
5196
|
+
throw new TypeError("target must be an object");
|
|
5197
|
+
}
|
|
5198
|
+
formData = formData || new FormData();
|
|
5199
|
+
options = utils$1.toFlatObject(options, {
|
|
5200
|
+
metaTokens: true,
|
|
5201
|
+
dots: false,
|
|
5202
|
+
indexes: false
|
|
5203
|
+
}, false, function defined(option, source) {
|
|
5204
|
+
return !utils$1.isUndefined(source[option]);
|
|
5205
|
+
});
|
|
5206
|
+
var metaTokens = options.metaTokens;
|
|
5207
|
+
var visitor = options.visitor || defaultVisitor;
|
|
5208
|
+
var dots = options.dots;
|
|
5209
|
+
var indexes = options.indexes;
|
|
5210
|
+
var _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
5211
|
+
var useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
5212
|
+
if (!utils$1.isFunction(visitor)) {
|
|
5213
|
+
throw new TypeError("visitor must be a function");
|
|
5214
|
+
}
|
|
5215
|
+
function convertValue(value) {
|
|
5216
|
+
if (value === null) return "";
|
|
5217
|
+
if (utils$1.isDate(value)) {
|
|
5218
|
+
return value.toISOString();
|
|
5219
|
+
}
|
|
5220
|
+
if (utils$1.isBoolean(value)) {
|
|
5221
|
+
return value.toString();
|
|
5222
|
+
}
|
|
5223
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
|
5224
|
+
throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
|
|
5225
|
+
}
|
|
5226
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
5227
|
+
return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
5228
|
+
}
|
|
5229
|
+
return value;
|
|
5230
|
+
}
|
|
5231
|
+
function defaultVisitor(value, key, path) {
|
|
5232
|
+
var arr = value;
|
|
5233
|
+
if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
|
|
5234
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
5235
|
+
return false;
|
|
5236
|
+
}
|
|
5237
|
+
if (value && !path && _typeof(value) === "object") {
|
|
5238
|
+
if (utils$1.endsWith(key, "{}")) {
|
|
5239
|
+
key = metaTokens ? key : key.slice(0, -2);
|
|
5240
|
+
value = JSON.stringify(value);
|
|
5241
|
+
} else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
|
|
5242
|
+
key = removeBrackets(key);
|
|
5243
|
+
arr.forEach(function each(el, index) {
|
|
5244
|
+
!(utils$1.isUndefined(el) || el === null) && formData.append(
|
|
5245
|
+
// eslint-disable-next-line no-nested-ternary
|
|
5246
|
+
indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]", convertValue(el));
|
|
5247
|
+
});
|
|
5248
|
+
return false;
|
|
5249
|
+
}
|
|
5250
|
+
}
|
|
5251
|
+
if (isVisitable(value)) {
|
|
5252
|
+
return true;
|
|
5253
|
+
}
|
|
5254
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
5255
|
+
return false;
|
|
5256
|
+
}
|
|
5257
|
+
var stack = [];
|
|
5258
|
+
var exposedHelpers = Object.assign(predicates, {
|
|
5259
|
+
defaultVisitor: defaultVisitor,
|
|
5260
|
+
convertValue: convertValue,
|
|
5261
|
+
isVisitable: isVisitable
|
|
5262
|
+
});
|
|
5263
|
+
function build(value, path) {
|
|
5264
|
+
if (utils$1.isUndefined(value)) return;
|
|
5265
|
+
if (stack.indexOf(value) !== -1) {
|
|
5266
|
+
throw Error("Circular reference detected in " + path.join("."));
|
|
5267
|
+
}
|
|
5268
|
+
stack.push(value);
|
|
5269
|
+
utils$1.forEach(value, function each(el, key) {
|
|
5270
|
+
var result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
5271
|
+
if (result === true) {
|
|
5272
|
+
build(el, path ? path.concat(key) : [key]);
|
|
5273
|
+
}
|
|
5274
|
+
});
|
|
5275
|
+
stack.pop();
|
|
5276
|
+
}
|
|
5277
|
+
if (!utils$1.isObject(obj)) {
|
|
5278
|
+
throw new TypeError("data must be an object");
|
|
5279
|
+
}
|
|
5280
|
+
build(obj);
|
|
5281
|
+
return formData;
|
|
5282
|
+
}
|
|
5283
|
+
function encode$1(str) {
|
|
5284
|
+
var charMap = {
|
|
5285
|
+
"!": "%21",
|
|
5286
|
+
"'": "%27",
|
|
5287
|
+
"(": "%28",
|
|
5288
|
+
")": "%29",
|
|
5289
|
+
"~": "%7E",
|
|
5290
|
+
"%20": "+",
|
|
5291
|
+
"%00": "\0"
|
|
5292
|
+
};
|
|
5293
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
|
|
5294
|
+
return charMap[match];
|
|
5295
|
+
});
|
|
5296
|
+
}
|
|
5297
|
+
function AxiosURLSearchParams(params, options) {
|
|
5298
|
+
this._pairs = [];
|
|
5299
|
+
params && toFormData$1(params, this, options);
|
|
5300
|
+
}
|
|
5301
|
+
var prototype = AxiosURLSearchParams.prototype;
|
|
5302
|
+
prototype.append = function append(name, value) {
|
|
5303
|
+
this._pairs.push([name, value]);
|
|
5304
|
+
};
|
|
5305
|
+
prototype.toString = function toString2(encoder) {
|
|
5306
|
+
var _encode = encoder ? function (value) {
|
|
5307
|
+
return encoder.call(this, value, encode$1);
|
|
5308
|
+
} : encode$1;
|
|
5309
|
+
return this._pairs.map(function each(pair) {
|
|
5310
|
+
return _encode(pair[0]) + "=" + _encode(pair[1]);
|
|
5311
|
+
}, "").join("&");
|
|
5312
|
+
};
|
|
5313
|
+
function encode(val) {
|
|
5314
|
+
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
5315
|
+
}
|
|
5316
|
+
function buildURL(url, params, options) {
|
|
5317
|
+
if (!params) {
|
|
5318
|
+
return url;
|
|
5319
|
+
}
|
|
5320
|
+
var _encode = options && options.encode || encode;
|
|
5321
|
+
var _options = utils$1.isFunction(options) ? {
|
|
5322
|
+
serialize: options
|
|
5323
|
+
} : options;
|
|
5324
|
+
var serializeFn = _options && _options.serialize;
|
|
5325
|
+
var serializedParams;
|
|
5326
|
+
if (serializeFn) {
|
|
5327
|
+
serializedParams = serializeFn(params, _options);
|
|
5328
|
+
} else {
|
|
5329
|
+
serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
5330
|
+
}
|
|
5331
|
+
if (serializedParams) {
|
|
5332
|
+
var hashmarkIndex = url.indexOf("#");
|
|
5333
|
+
if (hashmarkIndex !== -1) {
|
|
5334
|
+
url = url.slice(0, hashmarkIndex);
|
|
5335
|
+
}
|
|
5336
|
+
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
5337
|
+
}
|
|
5338
|
+
return url;
|
|
5339
|
+
}
|
|
5340
|
+
var InterceptorManager = /*#__PURE__*/function () {
|
|
5341
|
+
function InterceptorManager() {
|
|
5342
|
+
_classCallCheck(this, InterceptorManager);
|
|
5343
|
+
this.handlers = [];
|
|
5344
|
+
}
|
|
5345
|
+
/**
|
|
5346
|
+
* Add a new interceptor to the stack
|
|
5347
|
+
*
|
|
5348
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
5349
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
5350
|
+
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
5351
|
+
*
|
|
5352
|
+
* @return {Number} An ID used to remove interceptor later
|
|
5353
|
+
*/
|
|
5354
|
+
return _createClass(InterceptorManager, [{
|
|
5355
|
+
key: "use",
|
|
5356
|
+
value: function use(fulfilled, rejected, options) {
|
|
5357
|
+
this.handlers.push({
|
|
5358
|
+
fulfilled: fulfilled,
|
|
5359
|
+
rejected: rejected,
|
|
5360
|
+
synchronous: options ? options.synchronous : false,
|
|
5361
|
+
runWhen: options ? options.runWhen : null
|
|
5362
|
+
});
|
|
5363
|
+
return this.handlers.length - 1;
|
|
4582
5364
|
}
|
|
5365
|
+
/**
|
|
5366
|
+
* Remove an interceptor from the stack
|
|
5367
|
+
*
|
|
5368
|
+
* @param {Number} id The ID that was returned by `use`
|
|
5369
|
+
*
|
|
5370
|
+
* @returns {void}
|
|
5371
|
+
*/
|
|
4583
5372
|
}, {
|
|
4584
|
-
key: "
|
|
4585
|
-
value: function
|
|
4586
|
-
|
|
5373
|
+
key: "eject",
|
|
5374
|
+
value: function eject(id) {
|
|
5375
|
+
if (this.handlers[id]) {
|
|
5376
|
+
this.handlers[id] = null;
|
|
5377
|
+
}
|
|
4587
5378
|
}
|
|
5379
|
+
/**
|
|
5380
|
+
* Clear all interceptors from the stack
|
|
5381
|
+
*
|
|
5382
|
+
* @returns {void}
|
|
5383
|
+
*/
|
|
4588
5384
|
}, {
|
|
4589
|
-
key: "
|
|
4590
|
-
value: function
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
5385
|
+
key: "clear",
|
|
5386
|
+
value: function clear() {
|
|
5387
|
+
if (this.handlers) {
|
|
5388
|
+
this.handlers = [];
|
|
5389
|
+
}
|
|
5390
|
+
}
|
|
5391
|
+
/**
|
|
5392
|
+
* Iterate over all the registered interceptors
|
|
5393
|
+
*
|
|
5394
|
+
* This method is particularly useful for skipping over any
|
|
5395
|
+
* interceptors that may have become `null` calling `eject`.
|
|
5396
|
+
*
|
|
5397
|
+
* @param {Function} fn The function to call for each interceptor
|
|
5398
|
+
*
|
|
5399
|
+
* @returns {void}
|
|
5400
|
+
*/
|
|
5401
|
+
}, {
|
|
5402
|
+
key: "forEach",
|
|
5403
|
+
value: function forEach(fn) {
|
|
5404
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
|
5405
|
+
if (h !== null) {
|
|
5406
|
+
fn(h);
|
|
5407
|
+
}
|
|
5408
|
+
});
|
|
5409
|
+
}
|
|
5410
|
+
}]);
|
|
5411
|
+
}();
|
|
5412
|
+
var transitionalDefaults = {
|
|
5413
|
+
silentJSONParsing: true,
|
|
5414
|
+
forcedJSONParsing: true,
|
|
5415
|
+
clarifyTimeoutError: false,
|
|
5416
|
+
legacyInterceptorReqResOrdering: true
|
|
5417
|
+
};
|
|
5418
|
+
var URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
|
|
5419
|
+
var FormData$1 = typeof FormData !== "undefined" ? FormData : null;
|
|
5420
|
+
var Blob$1 = typeof Blob !== "undefined" ? Blob : null;
|
|
5421
|
+
var platform$1 = {
|
|
5422
|
+
isBrowser: true,
|
|
5423
|
+
classes: {
|
|
5424
|
+
URLSearchParams: URLSearchParams$1,
|
|
5425
|
+
FormData: FormData$1,
|
|
5426
|
+
Blob: Blob$1
|
|
5427
|
+
},
|
|
5428
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
5429
|
+
};
|
|
5430
|
+
var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
5431
|
+
var _navigator = (typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === "object" && navigator || void 0;
|
|
5432
|
+
var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
|
|
5433
|
+
var hasStandardBrowserWebWorkerEnv = function () {
|
|
5434
|
+
return typeof WorkerGlobalScope !== "undefined" &&
|
|
5435
|
+
// eslint-disable-next-line no-undef
|
|
5436
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
5437
|
+
}();
|
|
5438
|
+
var origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
5439
|
+
var utils = /* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({
|
|
5440
|
+
__proto__: null,
|
|
5441
|
+
hasBrowserEnv: hasBrowserEnv,
|
|
5442
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
|
5443
|
+
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
5444
|
+
navigator: _navigator,
|
|
5445
|
+
origin: origin
|
|
5446
|
+
}, Symbol.toStringTag, {
|
|
5447
|
+
value: "Module"
|
|
5448
|
+
}));
|
|
5449
|
+
var platform = __spreadValues(__spreadValues({}, utils), platform$1);
|
|
5450
|
+
function toURLEncodedForm(data, options) {
|
|
5451
|
+
return toFormData$1(data, new platform.classes.URLSearchParams(), __spreadValues({
|
|
5452
|
+
visitor: function visitor(value, key, path, helpers) {
|
|
5453
|
+
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
5454
|
+
this.append(key, value.toString("base64"));
|
|
5455
|
+
return false;
|
|
5456
|
+
}
|
|
5457
|
+
return helpers.defaultVisitor.apply(this, arguments);
|
|
5458
|
+
}
|
|
5459
|
+
}, options));
|
|
5460
|
+
}
|
|
5461
|
+
function parsePropPath(name) {
|
|
5462
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(function (match) {
|
|
5463
|
+
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
5464
|
+
});
|
|
5465
|
+
}
|
|
5466
|
+
function arrayToObject(arr) {
|
|
5467
|
+
var obj = {};
|
|
5468
|
+
var keys = Object.keys(arr);
|
|
5469
|
+
var i;
|
|
5470
|
+
var len = keys.length;
|
|
5471
|
+
var key;
|
|
5472
|
+
for (i = 0; i < len; i++) {
|
|
5473
|
+
key = keys[i];
|
|
5474
|
+
obj[key] = arr[key];
|
|
5475
|
+
}
|
|
5476
|
+
return obj;
|
|
5477
|
+
}
|
|
5478
|
+
function formDataToJSON(formData) {
|
|
5479
|
+
function buildPath(path, value, target, index) {
|
|
5480
|
+
var name = path[index++];
|
|
5481
|
+
if (name === "__proto__") return true;
|
|
5482
|
+
var isNumericKey = Number.isFinite(+name);
|
|
5483
|
+
var isLast = index >= path.length;
|
|
5484
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
5485
|
+
if (isLast) {
|
|
5486
|
+
if (utils$1.hasOwnProp(target, name)) {
|
|
5487
|
+
target[name] = [target[name], value];
|
|
5488
|
+
} else {
|
|
5489
|
+
target[name] = value;
|
|
5490
|
+
}
|
|
5491
|
+
return !isNumericKey;
|
|
5492
|
+
}
|
|
5493
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
|
5494
|
+
target[name] = [];
|
|
5495
|
+
}
|
|
5496
|
+
var result = buildPath(path, value, target[name], index);
|
|
5497
|
+
if (result && utils$1.isArray(target[name])) {
|
|
5498
|
+
target[name] = arrayToObject(target[name]);
|
|
5499
|
+
}
|
|
5500
|
+
return !isNumericKey;
|
|
5501
|
+
}
|
|
5502
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
|
5503
|
+
var obj = {};
|
|
5504
|
+
utils$1.forEachEntry(formData, function (name, value) {
|
|
5505
|
+
buildPath(parsePropPath(name), value, obj, 0);
|
|
5506
|
+
});
|
|
5507
|
+
return obj;
|
|
5508
|
+
}
|
|
5509
|
+
return null;
|
|
5510
|
+
}
|
|
5511
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
5512
|
+
if (utils$1.isString(rawValue)) {
|
|
5513
|
+
try {
|
|
5514
|
+
(parser || JSON.parse)(rawValue);
|
|
5515
|
+
return utils$1.trim(rawValue);
|
|
5516
|
+
} catch (e) {
|
|
5517
|
+
if (e.name !== "SyntaxError") {
|
|
5518
|
+
throw e;
|
|
5519
|
+
}
|
|
5520
|
+
}
|
|
5521
|
+
}
|
|
5522
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
5523
|
+
}
|
|
5524
|
+
var defaults = {
|
|
5525
|
+
transitional: transitionalDefaults,
|
|
5526
|
+
adapter: ["xhr", "http", "fetch"],
|
|
5527
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
5528
|
+
var contentType = headers.getContentType() || "";
|
|
5529
|
+
var hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
5530
|
+
var isObjectPayload = utils$1.isObject(data);
|
|
5531
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
5532
|
+
data = new FormData(data);
|
|
5533
|
+
}
|
|
5534
|
+
var isFormData2 = utils$1.isFormData(data);
|
|
5535
|
+
if (isFormData2) {
|
|
5536
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
5537
|
+
}
|
|
5538
|
+
if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
|
|
5539
|
+
return data;
|
|
5540
|
+
}
|
|
5541
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
5542
|
+
return data.buffer;
|
|
5543
|
+
}
|
|
5544
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
5545
|
+
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
5546
|
+
return data.toString();
|
|
5547
|
+
}
|
|
5548
|
+
var isFileList2;
|
|
5549
|
+
if (isObjectPayload) {
|
|
5550
|
+
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
|
|
5551
|
+
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
5552
|
+
}
|
|
5553
|
+
if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
5554
|
+
var _FormData = this.env && this.env.FormData;
|
|
5555
|
+
return toFormData$1(isFileList2 ? {
|
|
5556
|
+
"files[]": data
|
|
5557
|
+
} : data, _FormData && new _FormData(), this.formSerializer);
|
|
5558
|
+
}
|
|
5559
|
+
}
|
|
5560
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
5561
|
+
headers.setContentType("application/json", false);
|
|
5562
|
+
return stringifySafely(data);
|
|
5563
|
+
}
|
|
5564
|
+
return data;
|
|
5565
|
+
}],
|
|
5566
|
+
transformResponse: [function transformResponse(data) {
|
|
5567
|
+
var transitional = this.transitional || defaults.transitional;
|
|
5568
|
+
var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
5569
|
+
var JSONRequested = this.responseType === "json";
|
|
5570
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
5571
|
+
return data;
|
|
5572
|
+
}
|
|
5573
|
+
if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
5574
|
+
var silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
5575
|
+
var strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
5576
|
+
try {
|
|
5577
|
+
return JSON.parse(data, this.parseReviver);
|
|
5578
|
+
} catch (e) {
|
|
5579
|
+
if (strictJSONParsing) {
|
|
5580
|
+
if (e.name === "SyntaxError") {
|
|
5581
|
+
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
|
|
5582
|
+
}
|
|
5583
|
+
throw e;
|
|
5584
|
+
}
|
|
5585
|
+
}
|
|
5586
|
+
}
|
|
5587
|
+
return data;
|
|
5588
|
+
}],
|
|
5589
|
+
/**
|
|
5590
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
5591
|
+
* timeout is not created.
|
|
5592
|
+
*/
|
|
5593
|
+
timeout: 0,
|
|
5594
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
5595
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
5596
|
+
maxContentLength: -1,
|
|
5597
|
+
maxBodyLength: -1,
|
|
5598
|
+
env: {
|
|
5599
|
+
FormData: platform.classes.FormData,
|
|
5600
|
+
Blob: platform.classes.Blob
|
|
5601
|
+
},
|
|
5602
|
+
validateStatus: function validateStatus(status) {
|
|
5603
|
+
return status >= 200 && status < 300;
|
|
5604
|
+
},
|
|
5605
|
+
headers: {
|
|
5606
|
+
common: {
|
|
5607
|
+
Accept: "application/json, text/plain, */*",
|
|
5608
|
+
"Content-Type": void 0
|
|
5609
|
+
}
|
|
5610
|
+
}
|
|
5611
|
+
};
|
|
5612
|
+
utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], function (method) {
|
|
5613
|
+
defaults.headers[method] = {};
|
|
5614
|
+
});
|
|
5615
|
+
var ignoreDuplicateOf = utils$1.toObjectSet(["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"]);
|
|
5616
|
+
var parseHeaders = function parseHeaders(rawHeaders) {
|
|
5617
|
+
var parsed = {};
|
|
5618
|
+
var key;
|
|
5619
|
+
var val;
|
|
5620
|
+
var i;
|
|
5621
|
+
rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
|
|
5622
|
+
i = line.indexOf(":");
|
|
5623
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
5624
|
+
val = line.substring(i + 1).trim();
|
|
5625
|
+
if (!key || parsed[key] && ignoreDuplicateOf[key]) {
|
|
5626
|
+
return;
|
|
5627
|
+
}
|
|
5628
|
+
if (key === "set-cookie") {
|
|
5629
|
+
if (parsed[key]) {
|
|
5630
|
+
parsed[key].push(val);
|
|
5631
|
+
} else {
|
|
5632
|
+
parsed[key] = [val];
|
|
5633
|
+
}
|
|
5634
|
+
} else {
|
|
5635
|
+
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
5636
|
+
}
|
|
5637
|
+
});
|
|
5638
|
+
return parsed;
|
|
5639
|
+
};
|
|
5640
|
+
var $internals = Symbol("internals");
|
|
5641
|
+
function normalizeHeader(header) {
|
|
5642
|
+
return header && String(header).trim().toLowerCase();
|
|
5643
|
+
}
|
|
5644
|
+
function normalizeValue(value) {
|
|
5645
|
+
if (value === false || value == null) {
|
|
5646
|
+
return value;
|
|
5647
|
+
}
|
|
5648
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
5649
|
+
}
|
|
5650
|
+
function parseTokens(str) {
|
|
5651
|
+
var tokens = /* @__PURE__ */Object.create(null);
|
|
5652
|
+
var tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
5653
|
+
var match;
|
|
5654
|
+
while (match = tokensRE.exec(str)) {
|
|
5655
|
+
tokens[match[1]] = match[2];
|
|
5656
|
+
}
|
|
5657
|
+
return tokens;
|
|
5658
|
+
}
|
|
5659
|
+
var isValidHeaderName = function isValidHeaderName(str) {
|
|
5660
|
+
return /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
5661
|
+
};
|
|
5662
|
+
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
5663
|
+
if (utils$1.isFunction(filter)) {
|
|
5664
|
+
return filter.call(this, value, header);
|
|
5665
|
+
}
|
|
5666
|
+
if (isHeaderNameFilter) {
|
|
5667
|
+
value = header;
|
|
5668
|
+
}
|
|
5669
|
+
if (!utils$1.isString(value)) return;
|
|
5670
|
+
if (utils$1.isString(filter)) {
|
|
5671
|
+
return value.indexOf(filter) !== -1;
|
|
5672
|
+
}
|
|
5673
|
+
if (utils$1.isRegExp(filter)) {
|
|
5674
|
+
return filter.test(value);
|
|
5675
|
+
}
|
|
5676
|
+
}
|
|
5677
|
+
function formatHeader(header) {
|
|
5678
|
+
return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, function (w, char, str) {
|
|
5679
|
+
return char.toUpperCase() + str;
|
|
5680
|
+
});
|
|
5681
|
+
}
|
|
5682
|
+
function buildAccessors(obj, header) {
|
|
5683
|
+
var accessorName = utils$1.toCamelCase(" " + header);
|
|
5684
|
+
["get", "set", "has"].forEach(function (methodName) {
|
|
5685
|
+
Object.defineProperty(obj, methodName + accessorName, {
|
|
5686
|
+
value: function value(arg1, arg2, arg3) {
|
|
5687
|
+
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
5688
|
+
},
|
|
5689
|
+
configurable: true
|
|
5690
|
+
});
|
|
5691
|
+
});
|
|
5692
|
+
}
|
|
5693
|
+
var AxiosHeaders$1 = /*#__PURE__*/function () {
|
|
5694
|
+
function AxiosHeaders(headers) {
|
|
5695
|
+
_classCallCheck(this, AxiosHeaders);
|
|
5696
|
+
headers && this.set(headers);
|
|
5697
|
+
}
|
|
5698
|
+
return _createClass(AxiosHeaders, [{
|
|
5699
|
+
key: "set",
|
|
5700
|
+
value: function set(header, valueOrRewrite, rewrite) {
|
|
5701
|
+
var self2 = this;
|
|
5702
|
+
function setHeader(_value, _header, _rewrite) {
|
|
5703
|
+
var lHeader = normalizeHeader(_header);
|
|
5704
|
+
if (!lHeader) {
|
|
5705
|
+
throw new Error("header name must be a non-empty string");
|
|
5706
|
+
}
|
|
5707
|
+
var key = utils$1.findKey(self2, lHeader);
|
|
5708
|
+
if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
|
|
5709
|
+
self2[key || _header] = normalizeValue(_value);
|
|
5710
|
+
}
|
|
5711
|
+
}
|
|
5712
|
+
var setHeaders = function setHeaders(headers, _rewrite) {
|
|
5713
|
+
return utils$1.forEach(headers, function (_value, _header) {
|
|
5714
|
+
return setHeader(_value, _header, _rewrite);
|
|
5715
|
+
});
|
|
5716
|
+
};
|
|
5717
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
5718
|
+
setHeaders(header, valueOrRewrite);
|
|
5719
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
5720
|
+
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
5721
|
+
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
5722
|
+
var obj = {},
|
|
5723
|
+
dest,
|
|
5724
|
+
key;
|
|
5725
|
+
var _iterator0 = _createForOfIteratorHelper(header),
|
|
5726
|
+
_step9;
|
|
5727
|
+
try {
|
|
5728
|
+
for (_iterator0.s(); !(_step9 = _iterator0.n()).done;) {
|
|
5729
|
+
var entry = _step9.value;
|
|
5730
|
+
if (!utils$1.isArray(entry)) {
|
|
5731
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
5732
|
+
}
|
|
5733
|
+
obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [].concat(_toConsumableArray(dest), [entry[1]]) : [dest, entry[1]] : entry[1];
|
|
5734
|
+
}
|
|
5735
|
+
} catch (err) {
|
|
5736
|
+
_iterator0.e(err);
|
|
5737
|
+
} finally {
|
|
5738
|
+
_iterator0.f();
|
|
5739
|
+
}
|
|
5740
|
+
setHeaders(obj, valueOrRewrite);
|
|
5741
|
+
} else {
|
|
5742
|
+
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
5743
|
+
}
|
|
5744
|
+
return this;
|
|
5745
|
+
}
|
|
5746
|
+
}, {
|
|
5747
|
+
key: "get",
|
|
5748
|
+
value: function get(header, parser) {
|
|
5749
|
+
header = normalizeHeader(header);
|
|
5750
|
+
if (header) {
|
|
5751
|
+
var key = utils$1.findKey(this, header);
|
|
5752
|
+
if (key) {
|
|
5753
|
+
var value = this[key];
|
|
5754
|
+
if (!parser) {
|
|
5755
|
+
return value;
|
|
5756
|
+
}
|
|
5757
|
+
if (parser === true) {
|
|
5758
|
+
return parseTokens(value);
|
|
5759
|
+
}
|
|
5760
|
+
if (utils$1.isFunction(parser)) {
|
|
5761
|
+
return parser.call(this, value, key);
|
|
5762
|
+
}
|
|
5763
|
+
if (utils$1.isRegExp(parser)) {
|
|
5764
|
+
return parser.exec(value);
|
|
5765
|
+
}
|
|
5766
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
5767
|
+
}
|
|
5768
|
+
}
|
|
5769
|
+
}
|
|
5770
|
+
}, {
|
|
5771
|
+
key: "has",
|
|
5772
|
+
value: function has(header, matcher) {
|
|
5773
|
+
header = normalizeHeader(header);
|
|
5774
|
+
if (header) {
|
|
5775
|
+
var key = utils$1.findKey(this, header);
|
|
5776
|
+
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
5777
|
+
}
|
|
5778
|
+
return false;
|
|
5779
|
+
}
|
|
5780
|
+
}, {
|
|
5781
|
+
key: "delete",
|
|
5782
|
+
value: function _delete(header, matcher) {
|
|
5783
|
+
var self2 = this;
|
|
5784
|
+
var deleted = false;
|
|
5785
|
+
function deleteHeader(_header) {
|
|
5786
|
+
_header = normalizeHeader(_header);
|
|
5787
|
+
if (_header) {
|
|
5788
|
+
var key = utils$1.findKey(self2, _header);
|
|
5789
|
+
if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
|
|
5790
|
+
delete self2[key];
|
|
5791
|
+
deleted = true;
|
|
5792
|
+
}
|
|
5793
|
+
}
|
|
5794
|
+
}
|
|
5795
|
+
if (utils$1.isArray(header)) {
|
|
5796
|
+
header.forEach(deleteHeader);
|
|
5797
|
+
} else {
|
|
5798
|
+
deleteHeader(header);
|
|
5799
|
+
}
|
|
5800
|
+
return deleted;
|
|
5801
|
+
}
|
|
5802
|
+
}, {
|
|
5803
|
+
key: "clear",
|
|
5804
|
+
value: function clear(matcher) {
|
|
5805
|
+
var keys = Object.keys(this);
|
|
5806
|
+
var i = keys.length;
|
|
5807
|
+
var deleted = false;
|
|
5808
|
+
while (i--) {
|
|
5809
|
+
var key = keys[i];
|
|
5810
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
5811
|
+
delete this[key];
|
|
5812
|
+
deleted = true;
|
|
5813
|
+
}
|
|
5814
|
+
}
|
|
5815
|
+
return deleted;
|
|
5816
|
+
}
|
|
5817
|
+
}, {
|
|
5818
|
+
key: "normalize",
|
|
5819
|
+
value: function normalize(format) {
|
|
5820
|
+
var self2 = this;
|
|
5821
|
+
var headers = {};
|
|
5822
|
+
utils$1.forEach(this, function (value, header) {
|
|
5823
|
+
var key = utils$1.findKey(headers, header);
|
|
5824
|
+
if (key) {
|
|
5825
|
+
self2[key] = normalizeValue(value);
|
|
5826
|
+
delete self2[header];
|
|
5827
|
+
return;
|
|
5828
|
+
}
|
|
5829
|
+
var normalized = format ? formatHeader(header) : String(header).trim();
|
|
5830
|
+
if (normalized !== header) {
|
|
5831
|
+
delete self2[header];
|
|
5832
|
+
}
|
|
5833
|
+
self2[normalized] = normalizeValue(value);
|
|
5834
|
+
headers[normalized] = true;
|
|
5835
|
+
});
|
|
5836
|
+
return this;
|
|
5837
|
+
}
|
|
5838
|
+
}, {
|
|
5839
|
+
key: "concat",
|
|
5840
|
+
value: function concat() {
|
|
5841
|
+
var _this$constructor;
|
|
5842
|
+
for (var _len6 = arguments.length, targets = new Array(_len6), _key7 = 0; _key7 < _len6; _key7++) {
|
|
5843
|
+
targets[_key7] = arguments[_key7];
|
|
5844
|
+
}
|
|
5845
|
+
return (_this$constructor = this.constructor).concat.apply(_this$constructor, [this].concat(targets));
|
|
5846
|
+
}
|
|
5847
|
+
}, {
|
|
5848
|
+
key: "toJSON",
|
|
5849
|
+
value: function toJSON(asStrings) {
|
|
5850
|
+
var obj = /* @__PURE__ */Object.create(null);
|
|
5851
|
+
utils$1.forEach(this, function (value, header) {
|
|
5852
|
+
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
|
|
5853
|
+
});
|
|
5854
|
+
return obj;
|
|
5855
|
+
}
|
|
5856
|
+
}, {
|
|
5857
|
+
key: Symbol.iterator,
|
|
5858
|
+
value: function value() {
|
|
5859
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
5860
|
+
}
|
|
5861
|
+
}, {
|
|
5862
|
+
key: "toString",
|
|
5863
|
+
value: function toString() {
|
|
5864
|
+
return Object.entries(this.toJSON()).map(function (_ref33) {
|
|
5865
|
+
var _ref34 = _slicedToArray(_ref33, 2),
|
|
5866
|
+
header = _ref34[0],
|
|
5867
|
+
value = _ref34[1];
|
|
5868
|
+
return header + ": " + value;
|
|
5869
|
+
}).join("\n");
|
|
5870
|
+
}
|
|
5871
|
+
}, {
|
|
5872
|
+
key: "getSetCookie",
|
|
5873
|
+
value: function getSetCookie() {
|
|
5874
|
+
return this.get("set-cookie") || [];
|
|
5875
|
+
}
|
|
5876
|
+
}, {
|
|
5877
|
+
key: Symbol.toStringTag,
|
|
5878
|
+
get: function get() {
|
|
5879
|
+
return "AxiosHeaders";
|
|
5880
|
+
}
|
|
5881
|
+
}], [{
|
|
5882
|
+
key: "from",
|
|
5883
|
+
value: function from(thing) {
|
|
5884
|
+
return thing instanceof this ? thing : new this(thing);
|
|
5885
|
+
}
|
|
5886
|
+
}, {
|
|
5887
|
+
key: "concat",
|
|
5888
|
+
value: function concat(first) {
|
|
5889
|
+
var computed = new this(first);
|
|
5890
|
+
for (var _len7 = arguments.length, targets = new Array(_len7 > 1 ? _len7 - 1 : 0), _key8 = 1; _key8 < _len7; _key8++) {
|
|
5891
|
+
targets[_key8 - 1] = arguments[_key8];
|
|
5892
|
+
}
|
|
5893
|
+
targets.forEach(function (target) {
|
|
5894
|
+
return computed.set(target);
|
|
5895
|
+
});
|
|
5896
|
+
return computed;
|
|
5897
|
+
}
|
|
5898
|
+
}, {
|
|
5899
|
+
key: "accessor",
|
|
5900
|
+
value: function accessor(header) {
|
|
5901
|
+
var internals = this[$internals] = this[$internals] = {
|
|
5902
|
+
accessors: {}
|
|
5903
|
+
};
|
|
5904
|
+
var accessors = internals.accessors;
|
|
5905
|
+
var prototype2 = this.prototype;
|
|
5906
|
+
function defineAccessor(_header) {
|
|
5907
|
+
var lHeader = normalizeHeader(_header);
|
|
5908
|
+
if (!accessors[lHeader]) {
|
|
5909
|
+
buildAccessors(prototype2, _header);
|
|
5910
|
+
accessors[lHeader] = true;
|
|
5911
|
+
}
|
|
5912
|
+
}
|
|
5913
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
5914
|
+
return this;
|
|
5915
|
+
}
|
|
5916
|
+
}]);
|
|
5917
|
+
}();
|
|
5918
|
+
AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
5919
|
+
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, function (_ref35, key) {
|
|
5920
|
+
var value = _ref35.value;
|
|
5921
|
+
var mapped = key[0].toUpperCase() + key.slice(1);
|
|
5922
|
+
return {
|
|
5923
|
+
get: function get() {
|
|
5924
|
+
return value;
|
|
5925
|
+
},
|
|
5926
|
+
set: function set(headerValue) {
|
|
5927
|
+
this[mapped] = headerValue;
|
|
5928
|
+
}
|
|
5929
|
+
};
|
|
5930
|
+
});
|
|
5931
|
+
utils$1.freezeMethods(AxiosHeaders$1);
|
|
5932
|
+
function transformData(fns, response) {
|
|
5933
|
+
var config = this || defaults;
|
|
5934
|
+
var context = response || config;
|
|
5935
|
+
var headers = AxiosHeaders$1.from(context.headers);
|
|
5936
|
+
var data = context.data;
|
|
5937
|
+
utils$1.forEach(fns, function transform(fn) {
|
|
5938
|
+
data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
|
|
5939
|
+
});
|
|
5940
|
+
headers.normalize();
|
|
5941
|
+
return data;
|
|
5942
|
+
}
|
|
5943
|
+
function isCancel$1(value) {
|
|
5944
|
+
return !!(value && value.__CANCEL__);
|
|
5945
|
+
}
|
|
5946
|
+
var CanceledError$1 = /*#__PURE__*/function (_AxiosError$) {
|
|
5947
|
+
/**
|
|
5948
|
+
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
5949
|
+
*
|
|
5950
|
+
* @param {string=} message The message.
|
|
5951
|
+
* @param {Object=} config The config.
|
|
5952
|
+
* @param {Object=} request The request.
|
|
5953
|
+
*
|
|
5954
|
+
* @returns {CanceledError} The created error.
|
|
5955
|
+
*/
|
|
5956
|
+
function CanceledError(message, config, request) {
|
|
5957
|
+
var _this12;
|
|
5958
|
+
_classCallCheck(this, CanceledError);
|
|
5959
|
+
_this12 = _callSuper(this, CanceledError, [message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request]);
|
|
5960
|
+
_this12.name = "CanceledError";
|
|
5961
|
+
_this12.__CANCEL__ = true;
|
|
5962
|
+
return _this12;
|
|
5963
|
+
}
|
|
5964
|
+
_inherits(CanceledError, _AxiosError$);
|
|
5965
|
+
return _createClass(CanceledError);
|
|
5966
|
+
}(AxiosError$1);
|
|
5967
|
+
function settle(resolve, reject, response) {
|
|
5968
|
+
var validateStatus = response.config.validateStatus;
|
|
5969
|
+
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
5970
|
+
resolve(response);
|
|
5971
|
+
} else {
|
|
5972
|
+
reject(new AxiosError$1("Request failed with status code " + response.status, [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
|
|
5973
|
+
}
|
|
5974
|
+
}
|
|
5975
|
+
function parseProtocol(url) {
|
|
5976
|
+
var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
5977
|
+
return match && match[1] || "";
|
|
5978
|
+
}
|
|
5979
|
+
function speedometer(samplesCount, min) {
|
|
5980
|
+
samplesCount = samplesCount || 10;
|
|
5981
|
+
var bytes = new Array(samplesCount);
|
|
5982
|
+
var timestamps = new Array(samplesCount);
|
|
5983
|
+
var head = 0;
|
|
5984
|
+
var tail = 0;
|
|
5985
|
+
var firstSampleTS;
|
|
5986
|
+
min = min !== void 0 ? min : 1e3;
|
|
5987
|
+
return function push(chunkLength) {
|
|
5988
|
+
var now = Date.now();
|
|
5989
|
+
var startedAt = timestamps[tail];
|
|
5990
|
+
if (!firstSampleTS) {
|
|
5991
|
+
firstSampleTS = now;
|
|
5992
|
+
}
|
|
5993
|
+
bytes[head] = chunkLength;
|
|
5994
|
+
timestamps[head] = now;
|
|
5995
|
+
var i = tail;
|
|
5996
|
+
var bytesCount = 0;
|
|
5997
|
+
while (i !== head) {
|
|
5998
|
+
bytesCount += bytes[i++];
|
|
5999
|
+
i = i % samplesCount;
|
|
6000
|
+
}
|
|
6001
|
+
head = (head + 1) % samplesCount;
|
|
6002
|
+
if (head === tail) {
|
|
6003
|
+
tail = (tail + 1) % samplesCount;
|
|
6004
|
+
}
|
|
6005
|
+
if (now - firstSampleTS < min) {
|
|
6006
|
+
return;
|
|
6007
|
+
}
|
|
6008
|
+
var passed = startedAt && now - startedAt;
|
|
6009
|
+
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
6010
|
+
};
|
|
6011
|
+
}
|
|
6012
|
+
function throttle(fn, freq) {
|
|
6013
|
+
var timestamp = 0;
|
|
6014
|
+
var threshold = 1e3 / freq;
|
|
6015
|
+
var lastArgs;
|
|
6016
|
+
var timer;
|
|
6017
|
+
var invoke = function invoke(args) {
|
|
6018
|
+
var now = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Date.now();
|
|
6019
|
+
timestamp = now;
|
|
6020
|
+
lastArgs = null;
|
|
6021
|
+
if (timer) {
|
|
6022
|
+
clearTimeout(timer);
|
|
6023
|
+
timer = null;
|
|
6024
|
+
}
|
|
6025
|
+
fn.apply(void 0, _toConsumableArray(args));
|
|
6026
|
+
};
|
|
6027
|
+
var throttled = function throttled() {
|
|
6028
|
+
var now = Date.now();
|
|
6029
|
+
var passed = now - timestamp;
|
|
6030
|
+
for (var _len8 = arguments.length, args = new Array(_len8), _key9 = 0; _key9 < _len8; _key9++) {
|
|
6031
|
+
args[_key9] = arguments[_key9];
|
|
6032
|
+
}
|
|
6033
|
+
if (passed >= threshold) {
|
|
6034
|
+
invoke(args, now);
|
|
6035
|
+
} else {
|
|
6036
|
+
lastArgs = args;
|
|
6037
|
+
if (!timer) {
|
|
6038
|
+
timer = setTimeout(function () {
|
|
6039
|
+
timer = null;
|
|
6040
|
+
invoke(lastArgs);
|
|
6041
|
+
}, threshold - passed);
|
|
6042
|
+
}
|
|
6043
|
+
}
|
|
6044
|
+
};
|
|
6045
|
+
var flush = function flush() {
|
|
6046
|
+
return lastArgs && invoke(lastArgs);
|
|
6047
|
+
};
|
|
6048
|
+
return [throttled, flush];
|
|
6049
|
+
}
|
|
6050
|
+
var progressEventReducer = function progressEventReducer(listener, isDownloadStream) {
|
|
6051
|
+
var freq = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3;
|
|
6052
|
+
var bytesNotified = 0;
|
|
6053
|
+
var _speedometer = speedometer(50, 250);
|
|
6054
|
+
return throttle(function (e) {
|
|
6055
|
+
var loaded = e.loaded;
|
|
6056
|
+
var total = e.lengthComputable ? e.total : void 0;
|
|
6057
|
+
var progressBytes = loaded - bytesNotified;
|
|
6058
|
+
var rate = _speedometer(progressBytes);
|
|
6059
|
+
var inRange = loaded <= total;
|
|
6060
|
+
bytesNotified = loaded;
|
|
6061
|
+
var data = _defineProperty({
|
|
6062
|
+
loaded: loaded,
|
|
6063
|
+
total: total,
|
|
6064
|
+
progress: total ? loaded / total : void 0,
|
|
6065
|
+
bytes: progressBytes,
|
|
6066
|
+
rate: rate ? rate : void 0,
|
|
6067
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
6068
|
+
event: e,
|
|
6069
|
+
lengthComputable: total != null
|
|
6070
|
+
}, isDownloadStream ? "download" : "upload", true);
|
|
6071
|
+
listener(data);
|
|
6072
|
+
}, freq);
|
|
6073
|
+
};
|
|
6074
|
+
var progressEventDecorator = function progressEventDecorator(total, throttled) {
|
|
6075
|
+
var lengthComputable = total != null;
|
|
6076
|
+
return [function (loaded) {
|
|
6077
|
+
return throttled[0]({
|
|
6078
|
+
lengthComputable: lengthComputable,
|
|
6079
|
+
total: total,
|
|
6080
|
+
loaded: loaded
|
|
6081
|
+
});
|
|
6082
|
+
}, throttled[1]];
|
|
6083
|
+
};
|
|
6084
|
+
var asyncDecorator = function asyncDecorator(fn) {
|
|
6085
|
+
return function () {
|
|
6086
|
+
for (var _len9 = arguments.length, args = new Array(_len9), _key0 = 0; _key0 < _len9; _key0++) {
|
|
6087
|
+
args[_key0] = arguments[_key0];
|
|
6088
|
+
}
|
|
6089
|
+
return utils$1.asap(function () {
|
|
6090
|
+
return fn.apply(void 0, args);
|
|
6091
|
+
});
|
|
6092
|
+
};
|
|
6093
|
+
};
|
|
6094
|
+
var isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */function (origin2, isMSIE) {
|
|
6095
|
+
return function (url) {
|
|
6096
|
+
url = new URL(url, platform.origin);
|
|
6097
|
+
return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
|
|
6098
|
+
};
|
|
6099
|
+
}(new URL(platform.origin), platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)) : function () {
|
|
6100
|
+
return true;
|
|
6101
|
+
};
|
|
6102
|
+
var cookies = platform.hasStandardBrowserEnv ?
|
|
6103
|
+
// Standard browser envs support document.cookie
|
|
6104
|
+
{
|
|
6105
|
+
write: function write(name, value, expires, path, domain, secure, sameSite) {
|
|
6106
|
+
if (typeof document === "undefined") return;
|
|
6107
|
+
var cookie = ["".concat(name, "=").concat(encodeURIComponent(value))];
|
|
6108
|
+
if (utils$1.isNumber(expires)) {
|
|
6109
|
+
cookie.push("expires=".concat(new Date(expires).toUTCString()));
|
|
6110
|
+
}
|
|
6111
|
+
if (utils$1.isString(path)) {
|
|
6112
|
+
cookie.push("path=".concat(path));
|
|
6113
|
+
}
|
|
6114
|
+
if (utils$1.isString(domain)) {
|
|
6115
|
+
cookie.push("domain=".concat(domain));
|
|
6116
|
+
}
|
|
6117
|
+
if (secure === true) {
|
|
6118
|
+
cookie.push("secure");
|
|
6119
|
+
}
|
|
6120
|
+
if (utils$1.isString(sameSite)) {
|
|
6121
|
+
cookie.push("SameSite=".concat(sameSite));
|
|
6122
|
+
}
|
|
6123
|
+
document.cookie = cookie.join("; ");
|
|
6124
|
+
},
|
|
6125
|
+
read: function read(name) {
|
|
6126
|
+
if (typeof document === "undefined") return null;
|
|
6127
|
+
var match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
|
|
6128
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
6129
|
+
},
|
|
6130
|
+
remove: function remove(name) {
|
|
6131
|
+
this.write(name, "", Date.now() - 864e5, "/");
|
|
6132
|
+
}
|
|
6133
|
+
} :
|
|
6134
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
6135
|
+
{
|
|
6136
|
+
write: function write() {},
|
|
6137
|
+
read: function read() {
|
|
6138
|
+
return null;
|
|
6139
|
+
},
|
|
6140
|
+
remove: function remove() {}
|
|
6141
|
+
};
|
|
6142
|
+
function isAbsoluteURL(url) {
|
|
6143
|
+
if (typeof url !== "string") {
|
|
6144
|
+
return false;
|
|
6145
|
+
}
|
|
6146
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
6147
|
+
}
|
|
6148
|
+
function combineURLs(baseURL, relativeURL) {
|
|
6149
|
+
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
6150
|
+
}
|
|
6151
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
6152
|
+
var isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
6153
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
|
6154
|
+
return combineURLs(baseURL, requestedURL);
|
|
6155
|
+
}
|
|
6156
|
+
return requestedURL;
|
|
6157
|
+
}
|
|
6158
|
+
var headersToObject = function headersToObject(thing) {
|
|
6159
|
+
return thing instanceof AxiosHeaders$1 ? __spreadValues({}, thing) : thing;
|
|
6160
|
+
};
|
|
6161
|
+
function mergeConfig$1(config1, config2) {
|
|
6162
|
+
config2 = config2 || {};
|
|
6163
|
+
var config = {};
|
|
6164
|
+
function getMergedValue(target, source, prop, caseless) {
|
|
6165
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
6166
|
+
return utils$1.merge.call({
|
|
6167
|
+
caseless: caseless
|
|
6168
|
+
}, target, source);
|
|
6169
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
6170
|
+
return utils$1.merge({}, source);
|
|
6171
|
+
} else if (utils$1.isArray(source)) {
|
|
6172
|
+
return source.slice();
|
|
6173
|
+
}
|
|
6174
|
+
return source;
|
|
6175
|
+
}
|
|
6176
|
+
function mergeDeepProperties(a, b, prop, caseless) {
|
|
6177
|
+
if (!utils$1.isUndefined(b)) {
|
|
6178
|
+
return getMergedValue(a, b, prop, caseless);
|
|
6179
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
6180
|
+
return getMergedValue(void 0, a, prop, caseless);
|
|
6181
|
+
}
|
|
6182
|
+
}
|
|
6183
|
+
function valueFromConfig2(a, b) {
|
|
6184
|
+
if (!utils$1.isUndefined(b)) {
|
|
6185
|
+
return getMergedValue(void 0, b);
|
|
6186
|
+
}
|
|
6187
|
+
}
|
|
6188
|
+
function defaultToConfig2(a, b) {
|
|
6189
|
+
if (!utils$1.isUndefined(b)) {
|
|
6190
|
+
return getMergedValue(void 0, b);
|
|
6191
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
6192
|
+
return getMergedValue(void 0, a);
|
|
6193
|
+
}
|
|
6194
|
+
}
|
|
6195
|
+
function mergeDirectKeys(a, b, prop) {
|
|
6196
|
+
if (prop in config2) {
|
|
6197
|
+
return getMergedValue(a, b);
|
|
6198
|
+
} else if (prop in config1) {
|
|
6199
|
+
return getMergedValue(void 0, a);
|
|
6200
|
+
}
|
|
6201
|
+
}
|
|
6202
|
+
var mergeMap = {
|
|
6203
|
+
url: valueFromConfig2,
|
|
6204
|
+
method: valueFromConfig2,
|
|
6205
|
+
data: valueFromConfig2,
|
|
6206
|
+
baseURL: defaultToConfig2,
|
|
6207
|
+
transformRequest: defaultToConfig2,
|
|
6208
|
+
transformResponse: defaultToConfig2,
|
|
6209
|
+
paramsSerializer: defaultToConfig2,
|
|
6210
|
+
timeout: defaultToConfig2,
|
|
6211
|
+
timeoutMessage: defaultToConfig2,
|
|
6212
|
+
withCredentials: defaultToConfig2,
|
|
6213
|
+
withXSRFToken: defaultToConfig2,
|
|
6214
|
+
adapter: defaultToConfig2,
|
|
6215
|
+
responseType: defaultToConfig2,
|
|
6216
|
+
xsrfCookieName: defaultToConfig2,
|
|
6217
|
+
xsrfHeaderName: defaultToConfig2,
|
|
6218
|
+
onUploadProgress: defaultToConfig2,
|
|
6219
|
+
onDownloadProgress: defaultToConfig2,
|
|
6220
|
+
decompress: defaultToConfig2,
|
|
6221
|
+
maxContentLength: defaultToConfig2,
|
|
6222
|
+
maxBodyLength: defaultToConfig2,
|
|
6223
|
+
beforeRedirect: defaultToConfig2,
|
|
6224
|
+
transport: defaultToConfig2,
|
|
6225
|
+
httpAgent: defaultToConfig2,
|
|
6226
|
+
httpsAgent: defaultToConfig2,
|
|
6227
|
+
cancelToken: defaultToConfig2,
|
|
6228
|
+
socketPath: defaultToConfig2,
|
|
6229
|
+
responseEncoding: defaultToConfig2,
|
|
6230
|
+
validateStatus: mergeDirectKeys,
|
|
6231
|
+
headers: function headers(a, b, prop) {
|
|
6232
|
+
return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true);
|
|
6233
|
+
}
|
|
6234
|
+
};
|
|
6235
|
+
utils$1.forEach(Object.keys(__spreadValues(__spreadValues({}, config1), config2)), function computeConfigValue(prop) {
|
|
6236
|
+
if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
|
|
6237
|
+
var merge2 = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
6238
|
+
var configValue = merge2(config1[prop], config2[prop], prop);
|
|
6239
|
+
utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
6240
|
+
});
|
|
6241
|
+
return config;
|
|
6242
|
+
}
|
|
6243
|
+
var resolveConfig = function resolveConfig(config) {
|
|
6244
|
+
var newConfig = mergeConfig$1({}, config);
|
|
6245
|
+
var data = newConfig.data,
|
|
6246
|
+
withXSRFToken = newConfig.withXSRFToken,
|
|
6247
|
+
xsrfHeaderName = newConfig.xsrfHeaderName,
|
|
6248
|
+
xsrfCookieName = newConfig.xsrfCookieName,
|
|
6249
|
+
headers = newConfig.headers,
|
|
6250
|
+
auth = newConfig.auth;
|
|
6251
|
+
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
6252
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
|
6253
|
+
if (auth) {
|
|
6254
|
+
headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")));
|
|
6255
|
+
}
|
|
6256
|
+
if (utils$1.isFormData(data)) {
|
|
6257
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
6258
|
+
headers.setContentType(void 0);
|
|
6259
|
+
} else if (utils$1.isFunction(data.getHeaders)) {
|
|
6260
|
+
var formHeaders = data.getHeaders();
|
|
6261
|
+
var allowedHeaders = ["content-type", "content-length"];
|
|
6262
|
+
Object.entries(formHeaders).forEach(function (_ref36) {
|
|
6263
|
+
var _ref37 = _slicedToArray(_ref36, 2),
|
|
6264
|
+
key = _ref37[0],
|
|
6265
|
+
val = _ref37[1];
|
|
6266
|
+
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
6267
|
+
headers.set(key, val);
|
|
6268
|
+
}
|
|
6269
|
+
});
|
|
6270
|
+
}
|
|
6271
|
+
}
|
|
6272
|
+
if (platform.hasStandardBrowserEnv) {
|
|
6273
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
6274
|
+
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
|
|
6275
|
+
var xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
6276
|
+
if (xsrfValue) {
|
|
6277
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
6278
|
+
}
|
|
6279
|
+
}
|
|
6280
|
+
}
|
|
6281
|
+
return newConfig;
|
|
6282
|
+
};
|
|
6283
|
+
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
6284
|
+
var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
6285
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
6286
|
+
var _config = resolveConfig(config);
|
|
6287
|
+
var requestData = _config.data;
|
|
6288
|
+
var requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
|
|
6289
|
+
var responseType = _config.responseType,
|
|
6290
|
+
onUploadProgress = _config.onUploadProgress,
|
|
6291
|
+
onDownloadProgress = _config.onDownloadProgress;
|
|
6292
|
+
var onCanceled;
|
|
6293
|
+
var uploadThrottled, downloadThrottled;
|
|
6294
|
+
var flushUpload, flushDownload;
|
|
6295
|
+
function done() {
|
|
6296
|
+
flushUpload && flushUpload();
|
|
6297
|
+
flushDownload && flushDownload();
|
|
6298
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
6299
|
+
_config.signal && _config.signal.removeEventListener("abort", onCanceled);
|
|
6300
|
+
}
|
|
6301
|
+
var request = new XMLHttpRequest();
|
|
6302
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
6303
|
+
request.timeout = _config.timeout;
|
|
6304
|
+
function onloadend() {
|
|
6305
|
+
if (!request) {
|
|
6306
|
+
return;
|
|
6307
|
+
}
|
|
6308
|
+
var responseHeaders = AxiosHeaders$1.from("getAllResponseHeaders" in request && request.getAllResponseHeaders());
|
|
6309
|
+
var responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
|
|
6310
|
+
var response = {
|
|
6311
|
+
data: responseData,
|
|
6312
|
+
status: request.status,
|
|
6313
|
+
statusText: request.statusText,
|
|
6314
|
+
headers: responseHeaders,
|
|
6315
|
+
config: config,
|
|
6316
|
+
request: request
|
|
6317
|
+
};
|
|
6318
|
+
settle(function _resolve(value) {
|
|
6319
|
+
resolve(value);
|
|
6320
|
+
done();
|
|
6321
|
+
}, function _reject(err) {
|
|
6322
|
+
reject(err);
|
|
6323
|
+
done();
|
|
6324
|
+
}, response);
|
|
6325
|
+
request = null;
|
|
6326
|
+
}
|
|
6327
|
+
if ("onloadend" in request) {
|
|
6328
|
+
request.onloadend = onloadend;
|
|
6329
|
+
} else {
|
|
6330
|
+
request.onreadystatechange = function handleLoad() {
|
|
6331
|
+
if (!request || request.readyState !== 4) {
|
|
6332
|
+
return;
|
|
6333
|
+
}
|
|
6334
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
|
|
6335
|
+
return;
|
|
6336
|
+
}
|
|
6337
|
+
setTimeout(onloadend);
|
|
6338
|
+
};
|
|
6339
|
+
}
|
|
6340
|
+
request.onabort = function handleAbort() {
|
|
6341
|
+
if (!request) {
|
|
6342
|
+
return;
|
|
6343
|
+
}
|
|
6344
|
+
reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request));
|
|
6345
|
+
request = null;
|
|
6346
|
+
};
|
|
6347
|
+
request.onerror = function handleError(event) {
|
|
6348
|
+
var msg = event && event.message ? event.message : "Network Error";
|
|
6349
|
+
var err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
6350
|
+
err.event = event || null;
|
|
6351
|
+
reject(err);
|
|
6352
|
+
request = null;
|
|
6353
|
+
};
|
|
6354
|
+
request.ontimeout = function handleTimeout() {
|
|
6355
|
+
var timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
|
|
6356
|
+
var transitional = _config.transitional || transitionalDefaults;
|
|
6357
|
+
if (_config.timeoutErrorMessage) {
|
|
6358
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
6359
|
+
}
|
|
6360
|
+
reject(new AxiosError$1(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, config, request));
|
|
6361
|
+
request = null;
|
|
6362
|
+
};
|
|
6363
|
+
requestData === void 0 && requestHeaders.setContentType(null);
|
|
6364
|
+
if ("setRequestHeader" in request) {
|
|
6365
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
6366
|
+
request.setRequestHeader(key, val);
|
|
6367
|
+
});
|
|
6368
|
+
}
|
|
6369
|
+
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
6370
|
+
request.withCredentials = !!_config.withCredentials;
|
|
6371
|
+
}
|
|
6372
|
+
if (responseType && responseType !== "json") {
|
|
6373
|
+
request.responseType = _config.responseType;
|
|
6374
|
+
}
|
|
6375
|
+
if (onDownloadProgress) {
|
|
6376
|
+
var _progressEventReducer = progressEventReducer(onDownloadProgress, true);
|
|
6377
|
+
var _progressEventReducer2 = _slicedToArray(_progressEventReducer, 2);
|
|
6378
|
+
downloadThrottled = _progressEventReducer2[0];
|
|
6379
|
+
flushDownload = _progressEventReducer2[1];
|
|
6380
|
+
request.addEventListener("progress", downloadThrottled);
|
|
6381
|
+
}
|
|
6382
|
+
if (onUploadProgress && request.upload) {
|
|
6383
|
+
var _progressEventReducer3 = progressEventReducer(onUploadProgress);
|
|
6384
|
+
var _progressEventReducer4 = _slicedToArray(_progressEventReducer3, 2);
|
|
6385
|
+
uploadThrottled = _progressEventReducer4[0];
|
|
6386
|
+
flushUpload = _progressEventReducer4[1];
|
|
6387
|
+
request.upload.addEventListener("progress", uploadThrottled);
|
|
6388
|
+
request.upload.addEventListener("loadend", flushUpload);
|
|
6389
|
+
}
|
|
6390
|
+
if (_config.cancelToken || _config.signal) {
|
|
6391
|
+
onCanceled = function onCanceled(cancel) {
|
|
6392
|
+
if (!request) {
|
|
6393
|
+
return;
|
|
6394
|
+
}
|
|
6395
|
+
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
6396
|
+
request.abort();
|
|
6397
|
+
request = null;
|
|
6398
|
+
};
|
|
6399
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
6400
|
+
if (_config.signal) {
|
|
6401
|
+
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
|
|
6402
|
+
}
|
|
6403
|
+
}
|
|
6404
|
+
var protocol = parseProtocol(_config.url);
|
|
6405
|
+
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
6406
|
+
reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config));
|
|
6407
|
+
return;
|
|
6408
|
+
}
|
|
6409
|
+
request.send(requestData || null);
|
|
6410
|
+
});
|
|
6411
|
+
};
|
|
6412
|
+
var composeSignals = function composeSignals(signals, timeout) {
|
|
6413
|
+
var _signals = signals = signals ? signals.filter(Boolean) : [],
|
|
6414
|
+
length = _signals.length;
|
|
6415
|
+
if (timeout || length) {
|
|
6416
|
+
var controller = new AbortController();
|
|
6417
|
+
var aborted;
|
|
6418
|
+
var onabort = function onabort(reason) {
|
|
6419
|
+
if (!aborted) {
|
|
6420
|
+
aborted = true;
|
|
6421
|
+
unsubscribe();
|
|
6422
|
+
var err = reason instanceof Error ? reason : this.reason;
|
|
6423
|
+
controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
|
|
6424
|
+
}
|
|
6425
|
+
};
|
|
6426
|
+
var timer = timeout && setTimeout(function () {
|
|
6427
|
+
timer = null;
|
|
6428
|
+
onabort(new AxiosError$1("timeout of ".concat(timeout, "ms exceeded"), AxiosError$1.ETIMEDOUT));
|
|
6429
|
+
}, timeout);
|
|
6430
|
+
var unsubscribe = function unsubscribe() {
|
|
6431
|
+
if (signals) {
|
|
6432
|
+
timer && clearTimeout(timer);
|
|
6433
|
+
timer = null;
|
|
6434
|
+
signals.forEach(function (signal2) {
|
|
6435
|
+
signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
|
|
6436
|
+
});
|
|
6437
|
+
signals = null;
|
|
6438
|
+
}
|
|
6439
|
+
};
|
|
6440
|
+
signals.forEach(function (signal2) {
|
|
6441
|
+
return signal2.addEventListener("abort", onabort);
|
|
6442
|
+
});
|
|
6443
|
+
var signal = controller.signal;
|
|
6444
|
+
signal.unsubscribe = function () {
|
|
6445
|
+
return utils$1.asap(unsubscribe);
|
|
6446
|
+
};
|
|
6447
|
+
return signal;
|
|
6448
|
+
}
|
|
6449
|
+
};
|
|
6450
|
+
var streamChunk = /*#__PURE__*/_regenerator().m(function streamChunk(chunk, chunkSize) {
|
|
6451
|
+
var len, pos, end;
|
|
6452
|
+
return _regenerator().w(function (_context3) {
|
|
6453
|
+
while (1) switch (_context3.n) {
|
|
6454
|
+
case 0:
|
|
6455
|
+
len = chunk.byteLength;
|
|
6456
|
+
if (!(len < chunkSize)) {
|
|
6457
|
+
_context3.n = 2;
|
|
6458
|
+
break;
|
|
6459
|
+
}
|
|
6460
|
+
_context3.n = 1;
|
|
6461
|
+
return chunk;
|
|
6462
|
+
case 1:
|
|
6463
|
+
return _context3.a(2);
|
|
6464
|
+
case 2:
|
|
6465
|
+
pos = 0;
|
|
6466
|
+
case 3:
|
|
6467
|
+
if (!(pos < len)) {
|
|
6468
|
+
_context3.n = 5;
|
|
6469
|
+
break;
|
|
6470
|
+
}
|
|
6471
|
+
end = pos + chunkSize;
|
|
6472
|
+
_context3.n = 4;
|
|
6473
|
+
return chunk.slice(pos, end);
|
|
6474
|
+
case 4:
|
|
6475
|
+
pos = end;
|
|
6476
|
+
_context3.n = 3;
|
|
6477
|
+
break;
|
|
6478
|
+
case 5:
|
|
6479
|
+
return _context3.a(2);
|
|
6480
|
+
}
|
|
6481
|
+
}, streamChunk);
|
|
6482
|
+
});
|
|
6483
|
+
var readBytes = function readBytes(iterable, chunkSize) {
|
|
6484
|
+
return __asyncGenerator(this, null, /*#__PURE__*/_regenerator().m(function _callee3() {
|
|
6485
|
+
var iter, more, temp, error, chunk, _t2, _t3;
|
|
6486
|
+
return _regenerator().w(function (_context4) {
|
|
6487
|
+
while (1) switch (_context4.p = _context4.n) {
|
|
6488
|
+
case 0:
|
|
6489
|
+
_context4.p = 0;
|
|
6490
|
+
iter = __forAwait(readStream(iterable));
|
|
6491
|
+
case 1:
|
|
6492
|
+
_context4.n = 2;
|
|
6493
|
+
return new __await(iter.next());
|
|
6494
|
+
case 2:
|
|
6495
|
+
if (!(more = !(temp = _context4.v).done)) {
|
|
6496
|
+
_context4.n = 4;
|
|
6497
|
+
break;
|
|
6498
|
+
}
|
|
6499
|
+
chunk = temp.value;
|
|
6500
|
+
return _context4.d(_regeneratorValues(__yieldStar(streamChunk(chunk, chunkSize))), 3);
|
|
6501
|
+
case 3:
|
|
6502
|
+
more = false;
|
|
6503
|
+
_context4.n = 1;
|
|
6504
|
+
break;
|
|
6505
|
+
case 4:
|
|
6506
|
+
_context4.n = 6;
|
|
6507
|
+
break;
|
|
6508
|
+
case 5:
|
|
6509
|
+
_context4.p = 5;
|
|
6510
|
+
_t2 = _context4.v;
|
|
6511
|
+
error = [_t2];
|
|
6512
|
+
case 6:
|
|
6513
|
+
_context4.p = 6;
|
|
6514
|
+
_context4.p = 7;
|
|
6515
|
+
_t3 = more && (temp = iter.return);
|
|
6516
|
+
if (!_t3) {
|
|
6517
|
+
_context4.n = 8;
|
|
6518
|
+
break;
|
|
6519
|
+
}
|
|
6520
|
+
_context4.n = 8;
|
|
6521
|
+
return new __await(temp.call(iter));
|
|
6522
|
+
case 8:
|
|
6523
|
+
_context4.p = 8;
|
|
6524
|
+
if (!error) {
|
|
6525
|
+
_context4.n = 9;
|
|
6526
|
+
break;
|
|
6527
|
+
}
|
|
6528
|
+
throw error[0];
|
|
6529
|
+
case 9:
|
|
6530
|
+
return _context4.f(8);
|
|
6531
|
+
case 10:
|
|
6532
|
+
return _context4.f(6);
|
|
6533
|
+
case 11:
|
|
6534
|
+
return _context4.a(2);
|
|
6535
|
+
}
|
|
6536
|
+
}, _callee3, null, [[7,, 8, 10], [0, 5, 6, 11]]);
|
|
6537
|
+
}));
|
|
6538
|
+
};
|
|
6539
|
+
var readStream = function readStream(stream) {
|
|
6540
|
+
return __asyncGenerator(this, null, /*#__PURE__*/_regenerator().m(function _callee4() {
|
|
6541
|
+
var reader, _yield$__await, done, value;
|
|
6542
|
+
return _regenerator().w(function (_context5) {
|
|
6543
|
+
while (1) switch (_context5.p = _context5.n) {
|
|
6544
|
+
case 0:
|
|
6545
|
+
if (!stream[Symbol.asyncIterator]) {
|
|
6546
|
+
_context5.n = 2;
|
|
6547
|
+
break;
|
|
6548
|
+
}
|
|
6549
|
+
return _context5.d(_regeneratorValues(__yieldStar(stream)), 1);
|
|
6550
|
+
case 1:
|
|
6551
|
+
return _context5.a(2);
|
|
6552
|
+
case 2:
|
|
6553
|
+
reader = stream.getReader();
|
|
6554
|
+
_context5.p = 3;
|
|
6555
|
+
case 4:
|
|
6556
|
+
_context5.n = 5;
|
|
6557
|
+
return new __await(reader.read());
|
|
6558
|
+
case 5:
|
|
6559
|
+
_yield$__await = _context5.v;
|
|
6560
|
+
done = _yield$__await.done;
|
|
6561
|
+
value = _yield$__await.value;
|
|
6562
|
+
if (!done) {
|
|
6563
|
+
_context5.n = 6;
|
|
6564
|
+
break;
|
|
6565
|
+
}
|
|
6566
|
+
return _context5.a(3, 8);
|
|
6567
|
+
case 6:
|
|
6568
|
+
_context5.n = 7;
|
|
6569
|
+
return value;
|
|
6570
|
+
case 7:
|
|
6571
|
+
_context5.n = 4;
|
|
6572
|
+
break;
|
|
6573
|
+
case 8:
|
|
6574
|
+
_context5.p = 8;
|
|
6575
|
+
_context5.n = 9;
|
|
6576
|
+
return new __await(reader.cancel());
|
|
6577
|
+
case 9:
|
|
6578
|
+
return _context5.f(8);
|
|
6579
|
+
case 10:
|
|
6580
|
+
return _context5.a(2);
|
|
6581
|
+
}
|
|
6582
|
+
}, _callee4, null, [[3,, 8, 10]]);
|
|
6583
|
+
}));
|
|
6584
|
+
};
|
|
6585
|
+
var trackStream = function trackStream(stream, chunkSize, onProgress, onFinish) {
|
|
6586
|
+
var iterator2 = readBytes(stream, chunkSize);
|
|
6587
|
+
var bytes = 0;
|
|
6588
|
+
var done;
|
|
6589
|
+
var _onFinish = function _onFinish(e) {
|
|
6590
|
+
if (!done) {
|
|
6591
|
+
done = true;
|
|
6592
|
+
onFinish && onFinish(e);
|
|
6593
|
+
}
|
|
6594
|
+
};
|
|
6595
|
+
return new ReadableStream({
|
|
6596
|
+
pull: function pull(controller) {
|
|
6597
|
+
return __async(this, null, /*#__PURE__*/_regenerator().m(function _callee5() {
|
|
6598
|
+
var _yield$iterator2$next, done2, value, len, loadedBytes, _t4;
|
|
6599
|
+
return _regenerator().w(function (_context6) {
|
|
6600
|
+
while (1) switch (_context6.p = _context6.n) {
|
|
6601
|
+
case 0:
|
|
6602
|
+
_context6.p = 0;
|
|
6603
|
+
_context6.n = 1;
|
|
6604
|
+
return iterator2.next();
|
|
6605
|
+
case 1:
|
|
6606
|
+
_yield$iterator2$next = _context6.v;
|
|
6607
|
+
done2 = _yield$iterator2$next.done;
|
|
6608
|
+
value = _yield$iterator2$next.value;
|
|
6609
|
+
if (!done2) {
|
|
6610
|
+
_context6.n = 2;
|
|
6611
|
+
break;
|
|
6612
|
+
}
|
|
6613
|
+
_onFinish();
|
|
6614
|
+
controller.close();
|
|
6615
|
+
return _context6.a(2);
|
|
6616
|
+
case 2:
|
|
6617
|
+
len = value.byteLength;
|
|
6618
|
+
if (onProgress) {
|
|
6619
|
+
loadedBytes = bytes += len;
|
|
6620
|
+
onProgress(loadedBytes);
|
|
6621
|
+
}
|
|
6622
|
+
controller.enqueue(new Uint8Array(value));
|
|
6623
|
+
_context6.n = 4;
|
|
6624
|
+
break;
|
|
6625
|
+
case 3:
|
|
6626
|
+
_context6.p = 3;
|
|
6627
|
+
_t4 = _context6.v;
|
|
6628
|
+
_onFinish(_t4);
|
|
6629
|
+
throw _t4;
|
|
6630
|
+
case 4:
|
|
6631
|
+
return _context6.a(2);
|
|
6632
|
+
}
|
|
6633
|
+
}, _callee5, null, [[0, 3]]);
|
|
6634
|
+
}));
|
|
6635
|
+
},
|
|
6636
|
+
cancel: function cancel(reason) {
|
|
6637
|
+
_onFinish(reason);
|
|
6638
|
+
return iterator2.return();
|
|
6639
|
+
}
|
|
6640
|
+
}, {
|
|
6641
|
+
highWaterMark: 2
|
|
6642
|
+
});
|
|
6643
|
+
};
|
|
6644
|
+
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
6645
|
+
var isFunction = utils$1.isFunction;
|
|
6646
|
+
var globalFetchAPI = function (_ref38) {
|
|
6647
|
+
var Request = _ref38.Request,
|
|
6648
|
+
Response = _ref38.Response;
|
|
6649
|
+
return {
|
|
6650
|
+
Request: Request,
|
|
6651
|
+
Response: Response
|
|
6652
|
+
};
|
|
6653
|
+
}(utils$1.global);
|
|
6654
|
+
var _utils$1$global = utils$1.global,
|
|
6655
|
+
ReadableStream$1 = _utils$1$global.ReadableStream,
|
|
6656
|
+
TextEncoder = _utils$1$global.TextEncoder;
|
|
6657
|
+
var test = function test(fn) {
|
|
6658
|
+
try {
|
|
6659
|
+
for (var _len0 = arguments.length, args = new Array(_len0 > 1 ? _len0 - 1 : 0), _key1 = 1; _key1 < _len0; _key1++) {
|
|
6660
|
+
args[_key1 - 1] = arguments[_key1];
|
|
6661
|
+
}
|
|
6662
|
+
return !!fn.apply(void 0, args);
|
|
6663
|
+
} catch (e) {
|
|
6664
|
+
return false;
|
|
6665
|
+
}
|
|
6666
|
+
};
|
|
6667
|
+
var factory = function factory(env) {
|
|
6668
|
+
env = utils$1.merge.call({
|
|
6669
|
+
skipUndefined: true
|
|
6670
|
+
}, globalFetchAPI, env);
|
|
6671
|
+
var _env = env,
|
|
6672
|
+
envFetch = _env.fetch,
|
|
6673
|
+
Request = _env.Request,
|
|
6674
|
+
Response = _env.Response;
|
|
6675
|
+
var isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function";
|
|
6676
|
+
var isRequestSupported = isFunction(Request);
|
|
6677
|
+
var isResponseSupported = isFunction(Response);
|
|
6678
|
+
if (!isFetchSupported) {
|
|
6679
|
+
return false;
|
|
6680
|
+
}
|
|
6681
|
+
var isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
6682
|
+
var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */function (encoder) {
|
|
6683
|
+
return function (str) {
|
|
6684
|
+
return encoder.encode(str);
|
|
6685
|
+
};
|
|
6686
|
+
}(new TextEncoder()) : function (str) {
|
|
6687
|
+
return __async(_this0, null, /*#__PURE__*/_regenerator().m(function _callee6() {
|
|
6688
|
+
var _t5, _t6;
|
|
6689
|
+
return _regenerator().w(function (_context7) {
|
|
6690
|
+
while (1) switch (_context7.n) {
|
|
6691
|
+
case 0:
|
|
6692
|
+
_t5 = Uint8Array;
|
|
6693
|
+
_context7.n = 1;
|
|
6694
|
+
return new Request(str).arrayBuffer();
|
|
6695
|
+
case 1:
|
|
6696
|
+
_t6 = _context7.v;
|
|
6697
|
+
return _context7.a(2, new _t5(_t6));
|
|
6698
|
+
}
|
|
6699
|
+
}, _callee6);
|
|
6700
|
+
}));
|
|
6701
|
+
});
|
|
6702
|
+
var supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(function () {
|
|
6703
|
+
var duplexAccessed = false;
|
|
6704
|
+
var hasContentType = new Request(platform.origin, {
|
|
6705
|
+
body: new ReadableStream$1(),
|
|
6706
|
+
method: "POST",
|
|
6707
|
+
get duplex() {
|
|
6708
|
+
duplexAccessed = true;
|
|
6709
|
+
return "half";
|
|
6710
|
+
}
|
|
6711
|
+
}).headers.has("Content-Type");
|
|
6712
|
+
return duplexAccessed && !hasContentType;
|
|
6713
|
+
});
|
|
6714
|
+
var supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(function () {
|
|
6715
|
+
return utils$1.isReadableStream(new Response("").body);
|
|
6716
|
+
});
|
|
6717
|
+
var resolvers = {
|
|
6718
|
+
stream: supportsResponseStream && function (res) {
|
|
6719
|
+
return res.body;
|
|
6720
|
+
}
|
|
6721
|
+
};
|
|
6722
|
+
isFetchSupported && function () {
|
|
6723
|
+
["text", "arrayBuffer", "blob", "formData", "stream"].forEach(function (type) {
|
|
6724
|
+
!resolvers[type] && (resolvers[type] = function (res, config) {
|
|
6725
|
+
var method = res && res[type];
|
|
6726
|
+
if (method) {
|
|
6727
|
+
return method.call(res);
|
|
6728
|
+
}
|
|
6729
|
+
throw new AxiosError$1("Response type '".concat(type, "' is not supported"), AxiosError$1.ERR_NOT_SUPPORT, config);
|
|
6730
|
+
});
|
|
6731
|
+
});
|
|
6732
|
+
}();
|
|
6733
|
+
var getBodyLength = function getBodyLength(body) {
|
|
6734
|
+
return __async(_this0, null, /*#__PURE__*/_regenerator().m(function _callee7() {
|
|
6735
|
+
var _request;
|
|
6736
|
+
return _regenerator().w(function (_context8) {
|
|
6737
|
+
while (1) switch (_context8.n) {
|
|
6738
|
+
case 0:
|
|
6739
|
+
if (!(body == null)) {
|
|
6740
|
+
_context8.n = 1;
|
|
6741
|
+
break;
|
|
6742
|
+
}
|
|
6743
|
+
return _context8.a(2, 0);
|
|
6744
|
+
case 1:
|
|
6745
|
+
if (!utils$1.isBlob(body)) {
|
|
6746
|
+
_context8.n = 2;
|
|
6747
|
+
break;
|
|
6748
|
+
}
|
|
6749
|
+
return _context8.a(2, body.size);
|
|
6750
|
+
case 2:
|
|
6751
|
+
if (!utils$1.isSpecCompliantForm(body)) {
|
|
6752
|
+
_context8.n = 4;
|
|
6753
|
+
break;
|
|
6754
|
+
}
|
|
6755
|
+
_request = new Request(platform.origin, {
|
|
6756
|
+
method: "POST",
|
|
6757
|
+
body: body
|
|
6758
|
+
});
|
|
6759
|
+
_context8.n = 3;
|
|
6760
|
+
return _request.arrayBuffer();
|
|
6761
|
+
case 3:
|
|
6762
|
+
return _context8.a(2, _context8.v.byteLength);
|
|
6763
|
+
case 4:
|
|
6764
|
+
if (!(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body))) {
|
|
6765
|
+
_context8.n = 5;
|
|
6766
|
+
break;
|
|
6767
|
+
}
|
|
6768
|
+
return _context8.a(2, body.byteLength);
|
|
6769
|
+
case 5:
|
|
6770
|
+
if (utils$1.isURLSearchParams(body)) {
|
|
6771
|
+
body = body + "";
|
|
6772
|
+
}
|
|
6773
|
+
if (!utils$1.isString(body)) {
|
|
6774
|
+
_context8.n = 7;
|
|
6775
|
+
break;
|
|
6776
|
+
}
|
|
6777
|
+
_context8.n = 6;
|
|
6778
|
+
return encodeText(body);
|
|
6779
|
+
case 6:
|
|
6780
|
+
return _context8.a(2, _context8.v.byteLength);
|
|
6781
|
+
case 7:
|
|
6782
|
+
return _context8.a(2);
|
|
6783
|
+
}
|
|
6784
|
+
}, _callee7);
|
|
6785
|
+
}));
|
|
6786
|
+
};
|
|
6787
|
+
var resolveBodyLength = function resolveBodyLength(headers, body) {
|
|
6788
|
+
return __async(_this0, null, /*#__PURE__*/_regenerator().m(function _callee8() {
|
|
6789
|
+
var length;
|
|
6790
|
+
return _regenerator().w(function (_context9) {
|
|
6791
|
+
while (1) switch (_context9.n) {
|
|
6792
|
+
case 0:
|
|
6793
|
+
length = utils$1.toFiniteNumber(headers.getContentLength());
|
|
6794
|
+
return _context9.a(2, length == null ? getBodyLength(body) : length);
|
|
6795
|
+
}
|
|
6796
|
+
}, _callee8);
|
|
6797
|
+
}));
|
|
6798
|
+
};
|
|
6799
|
+
return function (config) {
|
|
6800
|
+
return __async(_this0, null, /*#__PURE__*/_regenerator().m(function _callee9() {
|
|
6801
|
+
var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, _fetch, composedSignal, request, unsubscribe, requestContentLength, _request, contentTypeHeader, _progressEventDecorat, _progressEventDecorat2, onProgress, flush, isCredentialsSupported, resolvedOptions, response, isStreamResponse, options, responseContentLength, _ref39, _ref40, _onProgress, _flush, responseData, _t7, _t8, _t9;
|
|
6802
|
+
return _regenerator().w(function (_context0) {
|
|
6803
|
+
while (1) switch (_context0.p = _context0.n) {
|
|
6804
|
+
case 0:
|
|
6805
|
+
_resolveConfig = resolveConfig(config), url = _resolveConfig.url, method = _resolveConfig.method, data = _resolveConfig.data, signal = _resolveConfig.signal, cancelToken = _resolveConfig.cancelToken, timeout = _resolveConfig.timeout, onDownloadProgress = _resolveConfig.onDownloadProgress, onUploadProgress = _resolveConfig.onUploadProgress, responseType = _resolveConfig.responseType, headers = _resolveConfig.headers, _resolveConfig$withCr = _resolveConfig.withCredentials, withCredentials = _resolveConfig$withCr === void 0 ? "same-origin" : _resolveConfig$withCr, fetchOptions = _resolveConfig.fetchOptions;
|
|
6806
|
+
_fetch = envFetch || fetch;
|
|
6807
|
+
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
6808
|
+
composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
6809
|
+
request = null;
|
|
6810
|
+
unsubscribe = composedSignal && composedSignal.unsubscribe && function () {
|
|
6811
|
+
composedSignal.unsubscribe();
|
|
6812
|
+
};
|
|
6813
|
+
_context0.p = 1;
|
|
6814
|
+
_t7 = onUploadProgress && supportsRequestStream && method !== "get" && method !== "head";
|
|
6815
|
+
if (!_t7) {
|
|
6816
|
+
_context0.n = 3;
|
|
6817
|
+
break;
|
|
6818
|
+
}
|
|
6819
|
+
_context0.n = 2;
|
|
6820
|
+
return resolveBodyLength(headers, data);
|
|
6821
|
+
case 2:
|
|
6822
|
+
_t8 = requestContentLength = _context0.v;
|
|
6823
|
+
_t7 = _t8 !== 0;
|
|
6824
|
+
case 3:
|
|
6825
|
+
if (!_t7) {
|
|
6826
|
+
_context0.n = 4;
|
|
6827
|
+
break;
|
|
6828
|
+
}
|
|
6829
|
+
_request = new Request(url, {
|
|
6830
|
+
method: "POST",
|
|
6831
|
+
body: data,
|
|
6832
|
+
duplex: "half"
|
|
6833
|
+
});
|
|
6834
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
|
|
6835
|
+
headers.setContentType(contentTypeHeader);
|
|
6836
|
+
}
|
|
6837
|
+
if (_request.body) {
|
|
6838
|
+
_progressEventDecorat = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))), _progressEventDecorat2 = _slicedToArray(_progressEventDecorat, 2), onProgress = _progressEventDecorat2[0], flush = _progressEventDecorat2[1];
|
|
6839
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
6840
|
+
}
|
|
6841
|
+
case 4:
|
|
6842
|
+
if (!utils$1.isString(withCredentials)) {
|
|
6843
|
+
withCredentials = withCredentials ? "include" : "omit";
|
|
6844
|
+
}
|
|
6845
|
+
isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
|
6846
|
+
resolvedOptions = __spreadProps(__spreadValues({}, fetchOptions), {
|
|
6847
|
+
signal: composedSignal,
|
|
6848
|
+
method: method.toUpperCase(),
|
|
6849
|
+
headers: headers.normalize().toJSON(),
|
|
6850
|
+
body: data,
|
|
6851
|
+
duplex: "half",
|
|
6852
|
+
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
6853
|
+
});
|
|
6854
|
+
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
6855
|
+
_context0.n = 5;
|
|
6856
|
+
return isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions);
|
|
6857
|
+
case 5:
|
|
6858
|
+
response = _context0.v;
|
|
6859
|
+
isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
6860
|
+
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
6861
|
+
options = {};
|
|
6862
|
+
["status", "statusText", "headers"].forEach(function (prop) {
|
|
6863
|
+
options[prop] = response[prop];
|
|
6864
|
+
});
|
|
6865
|
+
responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
|
|
6866
|
+
_ref39 = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [], _ref40 = _slicedToArray(_ref39, 2), _onProgress = _ref40[0], _flush = _ref40[1];
|
|
6867
|
+
response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, _onProgress, function () {
|
|
6868
|
+
_flush && _flush();
|
|
6869
|
+
unsubscribe && unsubscribe();
|
|
6870
|
+
}), options);
|
|
6871
|
+
}
|
|
6872
|
+
responseType = responseType || "text";
|
|
6873
|
+
_context0.n = 6;
|
|
6874
|
+
return resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
|
|
6875
|
+
case 6:
|
|
6876
|
+
responseData = _context0.v;
|
|
6877
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
6878
|
+
_context0.n = 7;
|
|
6879
|
+
return new Promise(function (resolve, reject) {
|
|
6880
|
+
settle(resolve, reject, {
|
|
6881
|
+
data: responseData,
|
|
6882
|
+
headers: AxiosHeaders$1.from(response.headers),
|
|
6883
|
+
status: response.status,
|
|
6884
|
+
statusText: response.statusText,
|
|
6885
|
+
config: config,
|
|
6886
|
+
request: request
|
|
6887
|
+
});
|
|
6888
|
+
});
|
|
6889
|
+
case 7:
|
|
6890
|
+
return _context0.a(2, _context0.v);
|
|
6891
|
+
case 8:
|
|
6892
|
+
_context0.p = 8;
|
|
6893
|
+
_t9 = _context0.v;
|
|
6894
|
+
unsubscribe && unsubscribe();
|
|
6895
|
+
if (!(_t9 && _t9.name === "TypeError" && /Load failed|fetch/i.test(_t9.message))) {
|
|
6896
|
+
_context0.n = 9;
|
|
6897
|
+
break;
|
|
6898
|
+
}
|
|
6899
|
+
throw Object.assign(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request, _t9 && _t9.response), {
|
|
6900
|
+
cause: _t9.cause || _t9
|
|
6901
|
+
});
|
|
6902
|
+
case 9:
|
|
6903
|
+
throw AxiosError$1.from(_t9, _t9 && _t9.code, config, request, _t9 && _t9.response);
|
|
6904
|
+
case 10:
|
|
6905
|
+
return _context0.a(2);
|
|
6906
|
+
}
|
|
6907
|
+
}, _callee9, null, [[1, 8]]);
|
|
6908
|
+
}));
|
|
6909
|
+
};
|
|
6910
|
+
};
|
|
6911
|
+
var seedCache = /* @__PURE__ */new Map();
|
|
6912
|
+
var getFetch = function getFetch(config) {
|
|
6913
|
+
var env = config && config.env || {};
|
|
6914
|
+
var fetch2 = env.fetch,
|
|
6915
|
+
Request = env.Request,
|
|
6916
|
+
Response = env.Response;
|
|
6917
|
+
var seeds = [Request, Response, fetch2];
|
|
6918
|
+
var len = seeds.length,
|
|
6919
|
+
i = len,
|
|
6920
|
+
seed,
|
|
6921
|
+
target,
|
|
6922
|
+
map = seedCache;
|
|
6923
|
+
while (i--) {
|
|
6924
|
+
seed = seeds[i];
|
|
6925
|
+
target = map.get(seed);
|
|
6926
|
+
target === void 0 && map.set(seed, target = i ? /* @__PURE__ */new Map() : factory(env));
|
|
6927
|
+
map = target;
|
|
6928
|
+
}
|
|
6929
|
+
return target;
|
|
6930
|
+
};
|
|
6931
|
+
getFetch();
|
|
6932
|
+
var knownAdapters = {
|
|
6933
|
+
http: httpAdapter,
|
|
6934
|
+
xhr: xhrAdapter,
|
|
6935
|
+
fetch: {
|
|
6936
|
+
get: getFetch
|
|
6937
|
+
}
|
|
6938
|
+
};
|
|
6939
|
+
utils$1.forEach(knownAdapters, function (fn, value) {
|
|
6940
|
+
if (fn) {
|
|
6941
|
+
try {
|
|
6942
|
+
Object.defineProperty(fn, "name", {
|
|
6943
|
+
value: value
|
|
6944
|
+
});
|
|
6945
|
+
} catch (e) {}
|
|
6946
|
+
Object.defineProperty(fn, "adapterName", {
|
|
6947
|
+
value: value
|
|
6948
|
+
});
|
|
6949
|
+
}
|
|
6950
|
+
});
|
|
6951
|
+
var renderReason = function renderReason(reason) {
|
|
6952
|
+
return "- ".concat(reason);
|
|
6953
|
+
};
|
|
6954
|
+
var isResolvedHandle = function isResolvedHandle(adapter) {
|
|
6955
|
+
return utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
6956
|
+
};
|
|
6957
|
+
function getAdapter$1(adapters2, config) {
|
|
6958
|
+
adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
|
|
6959
|
+
var _adapters = adapters2,
|
|
6960
|
+
length = _adapters.length;
|
|
6961
|
+
var nameOrAdapter;
|
|
6962
|
+
var adapter;
|
|
6963
|
+
var rejectedReasons = {};
|
|
6964
|
+
for (var _i1 = 0; _i1 < length; _i1++) {
|
|
6965
|
+
nameOrAdapter = adapters2[_i1];
|
|
6966
|
+
var id = void 0;
|
|
6967
|
+
adapter = nameOrAdapter;
|
|
6968
|
+
if (!isResolvedHandle(nameOrAdapter)) {
|
|
6969
|
+
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
6970
|
+
if (adapter === void 0) {
|
|
6971
|
+
throw new AxiosError$1("Unknown adapter '".concat(id, "'"));
|
|
6972
|
+
}
|
|
6973
|
+
}
|
|
6974
|
+
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
6975
|
+
break;
|
|
6976
|
+
}
|
|
6977
|
+
rejectedReasons[id || "#" + _i1] = adapter;
|
|
6978
|
+
}
|
|
6979
|
+
if (!adapter) {
|
|
6980
|
+
var reasons = Object.entries(rejectedReasons).map(function (_ref41) {
|
|
6981
|
+
var _ref42 = _slicedToArray(_ref41, 2),
|
|
6982
|
+
id = _ref42[0],
|
|
6983
|
+
state = _ref42[1];
|
|
6984
|
+
return "adapter ".concat(id, " ") + (state === false ? "is not supported by the environment" : "is not available in the build");
|
|
6985
|
+
});
|
|
6986
|
+
var s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
6987
|
+
throw new AxiosError$1("There is no suitable adapter to dispatch the request " + s, "ERR_NOT_SUPPORT");
|
|
6988
|
+
}
|
|
6989
|
+
return adapter;
|
|
6990
|
+
}
|
|
6991
|
+
var adapters = {
|
|
6992
|
+
/**
|
|
6993
|
+
* Resolve an adapter from a list of adapter names or functions.
|
|
6994
|
+
* @type {Function}
|
|
6995
|
+
*/
|
|
6996
|
+
getAdapter: getAdapter$1,
|
|
6997
|
+
/**
|
|
6998
|
+
* Exposes all known adapters
|
|
6999
|
+
* @type {Object<string, Function|Object>}
|
|
7000
|
+
*/
|
|
7001
|
+
adapters: knownAdapters
|
|
7002
|
+
};
|
|
7003
|
+
function throwIfCancellationRequested(config) {
|
|
7004
|
+
if (config.cancelToken) {
|
|
7005
|
+
config.cancelToken.throwIfRequested();
|
|
7006
|
+
}
|
|
7007
|
+
if (config.signal && config.signal.aborted) {
|
|
7008
|
+
throw new CanceledError$1(null, config);
|
|
7009
|
+
}
|
|
7010
|
+
}
|
|
7011
|
+
function dispatchRequest(config) {
|
|
7012
|
+
throwIfCancellationRequested(config);
|
|
7013
|
+
config.headers = AxiosHeaders$1.from(config.headers);
|
|
7014
|
+
config.data = transformData.call(config, config.transformRequest);
|
|
7015
|
+
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
7016
|
+
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
7017
|
+
}
|
|
7018
|
+
var adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
|
7019
|
+
return adapter(config).then(function onAdapterResolution(response) {
|
|
7020
|
+
throwIfCancellationRequested(config);
|
|
7021
|
+
response.data = transformData.call(config, config.transformResponse, response);
|
|
7022
|
+
response.headers = AxiosHeaders$1.from(response.headers);
|
|
7023
|
+
return response;
|
|
7024
|
+
}, function onAdapterRejection(reason) {
|
|
7025
|
+
if (!isCancel$1(reason)) {
|
|
7026
|
+
throwIfCancellationRequested(config);
|
|
7027
|
+
if (reason && reason.response) {
|
|
7028
|
+
reason.response.data = transformData.call(config, config.transformResponse, reason.response);
|
|
7029
|
+
reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
|
|
7030
|
+
}
|
|
7031
|
+
}
|
|
7032
|
+
return Promise.reject(reason);
|
|
7033
|
+
});
|
|
7034
|
+
}
|
|
7035
|
+
var VERSION$1 = "1.13.6";
|
|
7036
|
+
var validators$1 = {};
|
|
7037
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach(function (type, i) {
|
|
7038
|
+
validators$1[type] = function validator2(thing) {
|
|
7039
|
+
return _typeof(thing) === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
7040
|
+
};
|
|
7041
|
+
});
|
|
7042
|
+
var deprecatedWarnings = {};
|
|
7043
|
+
validators$1.transitional = function transitional(validator2, version, message) {
|
|
7044
|
+
function formatMessage(opt, desc) {
|
|
7045
|
+
return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
7046
|
+
}
|
|
7047
|
+
return function (value, opt, opts) {
|
|
7048
|
+
if (validator2 === false) {
|
|
7049
|
+
throw new AxiosError$1(formatMessage(opt, " has been removed" + (version ? " in " + version : "")), AxiosError$1.ERR_DEPRECATED);
|
|
7050
|
+
}
|
|
7051
|
+
if (version && !deprecatedWarnings[opt]) {
|
|
7052
|
+
deprecatedWarnings[opt] = true;
|
|
7053
|
+
console.warn(formatMessage(opt, " has been deprecated since v" + version + " and will be removed in the near future"));
|
|
7054
|
+
}
|
|
7055
|
+
return validator2 ? validator2(value, opt, opts) : true;
|
|
7056
|
+
};
|
|
7057
|
+
};
|
|
7058
|
+
validators$1.spelling = function spelling(correctSpelling) {
|
|
7059
|
+
return function (value, opt) {
|
|
7060
|
+
console.warn("".concat(opt, " is likely a misspelling of ").concat(correctSpelling));
|
|
7061
|
+
return true;
|
|
7062
|
+
};
|
|
7063
|
+
};
|
|
7064
|
+
function assertOptions(options, schema, allowUnknown) {
|
|
7065
|
+
if (_typeof(options) !== "object") {
|
|
7066
|
+
throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
7067
|
+
}
|
|
7068
|
+
var keys = Object.keys(options);
|
|
7069
|
+
var i = keys.length;
|
|
7070
|
+
while (i-- > 0) {
|
|
7071
|
+
var opt = keys[i];
|
|
7072
|
+
var validator2 = schema[opt];
|
|
7073
|
+
if (validator2) {
|
|
7074
|
+
var value = options[opt];
|
|
7075
|
+
var result = value === void 0 || validator2(value, opt, options);
|
|
7076
|
+
if (result !== true) {
|
|
7077
|
+
throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
7078
|
+
}
|
|
7079
|
+
continue;
|
|
7080
|
+
}
|
|
7081
|
+
if (allowUnknown !== true) {
|
|
7082
|
+
throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION);
|
|
7083
|
+
}
|
|
7084
|
+
}
|
|
7085
|
+
}
|
|
7086
|
+
var validator = {
|
|
7087
|
+
assertOptions: assertOptions,
|
|
7088
|
+
validators: validators$1
|
|
7089
|
+
};
|
|
7090
|
+
var validators = validator.validators;
|
|
7091
|
+
var Axios$1 = /*#__PURE__*/function () {
|
|
7092
|
+
function Axios(instanceConfig) {
|
|
7093
|
+
_classCallCheck(this, Axios);
|
|
7094
|
+
this.defaults = instanceConfig || {};
|
|
7095
|
+
this.interceptors = {
|
|
7096
|
+
request: new InterceptorManager(),
|
|
7097
|
+
response: new InterceptorManager()
|
|
7098
|
+
};
|
|
7099
|
+
}
|
|
7100
|
+
/**
|
|
7101
|
+
* Dispatch a request
|
|
7102
|
+
*
|
|
7103
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
7104
|
+
* @param {?Object} config
|
|
7105
|
+
*
|
|
7106
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
7107
|
+
*/
|
|
7108
|
+
return _createClass(Axios, [{
|
|
7109
|
+
key: "request",
|
|
7110
|
+
value: function request(configOrUrl, config) {
|
|
7111
|
+
return __async(this, null, /*#__PURE__*/_regenerator().m(function _callee0() {
|
|
7112
|
+
var dummy, stack, _t0;
|
|
7113
|
+
return _regenerator().w(function (_context1) {
|
|
7114
|
+
while (1) switch (_context1.p = _context1.n) {
|
|
7115
|
+
case 0:
|
|
7116
|
+
_context1.p = 0;
|
|
7117
|
+
_context1.n = 1;
|
|
7118
|
+
return this._request(configOrUrl, config);
|
|
7119
|
+
case 1:
|
|
7120
|
+
return _context1.a(2, _context1.v);
|
|
7121
|
+
case 2:
|
|
7122
|
+
_context1.p = 2;
|
|
7123
|
+
_t0 = _context1.v;
|
|
7124
|
+
if (_t0 instanceof Error) {
|
|
7125
|
+
dummy = {};
|
|
7126
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
7127
|
+
stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
|
|
7128
|
+
try {
|
|
7129
|
+
if (!_t0.stack) {
|
|
7130
|
+
_t0.stack = stack;
|
|
7131
|
+
} else if (stack && !String(_t0.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
|
|
7132
|
+
_t0.stack += "\n" + stack;
|
|
7133
|
+
}
|
|
7134
|
+
} catch (e) {}
|
|
7135
|
+
}
|
|
7136
|
+
throw _t0;
|
|
7137
|
+
case 3:
|
|
7138
|
+
return _context1.a(2);
|
|
7139
|
+
}
|
|
7140
|
+
}, _callee0, this, [[0, 2]]);
|
|
7141
|
+
}));
|
|
7142
|
+
}
|
|
7143
|
+
}, {
|
|
7144
|
+
key: "_request",
|
|
7145
|
+
value: function _request(configOrUrl, config) {
|
|
7146
|
+
if (typeof configOrUrl === "string") {
|
|
7147
|
+
config = config || {};
|
|
7148
|
+
config.url = configOrUrl;
|
|
7149
|
+
} else {
|
|
7150
|
+
config = configOrUrl || {};
|
|
7151
|
+
}
|
|
7152
|
+
config = mergeConfig$1(this.defaults, config);
|
|
7153
|
+
var _config2 = config,
|
|
7154
|
+
transitional = _config2.transitional,
|
|
7155
|
+
paramsSerializer = _config2.paramsSerializer,
|
|
7156
|
+
headers = _config2.headers;
|
|
7157
|
+
if (transitional !== void 0) {
|
|
7158
|
+
validator.assertOptions(transitional, {
|
|
7159
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
7160
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
7161
|
+
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
7162
|
+
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
|
|
7163
|
+
}, false);
|
|
7164
|
+
}
|
|
7165
|
+
if (paramsSerializer != null) {
|
|
7166
|
+
if (utils$1.isFunction(paramsSerializer)) {
|
|
7167
|
+
config.paramsSerializer = {
|
|
7168
|
+
serialize: paramsSerializer
|
|
7169
|
+
};
|
|
7170
|
+
} else {
|
|
7171
|
+
validator.assertOptions(paramsSerializer, {
|
|
7172
|
+
encode: validators.function,
|
|
7173
|
+
serialize: validators.function
|
|
7174
|
+
}, true);
|
|
7175
|
+
}
|
|
7176
|
+
}
|
|
7177
|
+
if (config.allowAbsoluteUrls !== void 0) ;else if (this.defaults.allowAbsoluteUrls !== void 0) {
|
|
7178
|
+
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
|
7179
|
+
} else {
|
|
7180
|
+
config.allowAbsoluteUrls = true;
|
|
7181
|
+
}
|
|
7182
|
+
validator.assertOptions(config, {
|
|
7183
|
+
baseUrl: validators.spelling("baseURL"),
|
|
7184
|
+
withXsrfToken: validators.spelling("withXSRFToken")
|
|
7185
|
+
}, true);
|
|
7186
|
+
config.method = (config.method || this.defaults.method || "get").toLowerCase();
|
|
7187
|
+
var contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
7188
|
+
headers && utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function (method) {
|
|
7189
|
+
delete headers[method];
|
|
7190
|
+
});
|
|
7191
|
+
config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
|
|
7192
|
+
var requestInterceptorChain = [];
|
|
7193
|
+
var synchronousRequestInterceptors = true;
|
|
7194
|
+
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
7195
|
+
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
|
|
7196
|
+
return;
|
|
7197
|
+
}
|
|
7198
|
+
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
7199
|
+
var transitional2 = config.transitional || transitionalDefaults;
|
|
7200
|
+
var legacyInterceptorReqResOrdering = transitional2 && transitional2.legacyInterceptorReqResOrdering;
|
|
7201
|
+
if (legacyInterceptorReqResOrdering) {
|
|
7202
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
7203
|
+
} else {
|
|
7204
|
+
requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
7205
|
+
}
|
|
7206
|
+
});
|
|
7207
|
+
var responseInterceptorChain = [];
|
|
7208
|
+
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
7209
|
+
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
7210
|
+
});
|
|
7211
|
+
var promise;
|
|
7212
|
+
var i = 0;
|
|
7213
|
+
var len;
|
|
7214
|
+
if (!synchronousRequestInterceptors) {
|
|
7215
|
+
var chain = [dispatchRequest.bind(this), void 0];
|
|
7216
|
+
chain.unshift.apply(chain, requestInterceptorChain);
|
|
7217
|
+
chain.push.apply(chain, responseInterceptorChain);
|
|
7218
|
+
len = chain.length;
|
|
7219
|
+
promise = Promise.resolve(config);
|
|
7220
|
+
while (i < len) {
|
|
7221
|
+
promise = promise.then(chain[i++], chain[i++]);
|
|
7222
|
+
}
|
|
7223
|
+
return promise;
|
|
7224
|
+
}
|
|
7225
|
+
len = requestInterceptorChain.length;
|
|
7226
|
+
var newConfig = config;
|
|
7227
|
+
while (i < len) {
|
|
7228
|
+
var onFulfilled = requestInterceptorChain[i++];
|
|
7229
|
+
var onRejected = requestInterceptorChain[i++];
|
|
7230
|
+
try {
|
|
7231
|
+
newConfig = onFulfilled(newConfig);
|
|
7232
|
+
} catch (error) {
|
|
7233
|
+
onRejected.call(this, error);
|
|
7234
|
+
break;
|
|
7235
|
+
}
|
|
7236
|
+
}
|
|
7237
|
+
try {
|
|
7238
|
+
promise = dispatchRequest.call(this, newConfig);
|
|
7239
|
+
} catch (error) {
|
|
7240
|
+
return Promise.reject(error);
|
|
7241
|
+
}
|
|
7242
|
+
i = 0;
|
|
7243
|
+
len = responseInterceptorChain.length;
|
|
7244
|
+
while (i < len) {
|
|
7245
|
+
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
|
|
7246
|
+
}
|
|
7247
|
+
return promise;
|
|
7248
|
+
}
|
|
7249
|
+
}, {
|
|
7250
|
+
key: "getUri",
|
|
7251
|
+
value: function getUri(config) {
|
|
7252
|
+
config = mergeConfig$1(this.defaults, config);
|
|
7253
|
+
var fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
7254
|
+
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
7255
|
+
}
|
|
7256
|
+
}]);
|
|
7257
|
+
}();
|
|
7258
|
+
utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
|
|
7259
|
+
Axios$1.prototype[method] = function (url, config) {
|
|
7260
|
+
return this.request(mergeConfig$1(config || {}, {
|
|
7261
|
+
method: method,
|
|
7262
|
+
url: url,
|
|
7263
|
+
data: (config || {}).data
|
|
7264
|
+
}));
|
|
7265
|
+
};
|
|
7266
|
+
});
|
|
7267
|
+
utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
7268
|
+
function generateHTTPMethod(isForm) {
|
|
7269
|
+
return function httpMethod(url, data, config) {
|
|
7270
|
+
return this.request(mergeConfig$1(config || {}, {
|
|
7271
|
+
method: method,
|
|
7272
|
+
headers: isForm ? {
|
|
7273
|
+
"Content-Type": "multipart/form-data"
|
|
7274
|
+
} : {},
|
|
7275
|
+
url: url,
|
|
7276
|
+
data: data
|
|
7277
|
+
}));
|
|
7278
|
+
};
|
|
7279
|
+
}
|
|
7280
|
+
Axios$1.prototype[method] = generateHTTPMethod();
|
|
7281
|
+
Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
7282
|
+
});
|
|
7283
|
+
var CancelToken$1 = /*#__PURE__*/function () {
|
|
7284
|
+
function CancelToken2(executor) {
|
|
7285
|
+
_classCallCheck(this, CancelToken2);
|
|
7286
|
+
if (typeof executor !== "function") {
|
|
7287
|
+
throw new TypeError("executor must be a function.");
|
|
7288
|
+
}
|
|
7289
|
+
var resolvePromise;
|
|
7290
|
+
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
7291
|
+
resolvePromise = resolve;
|
|
7292
|
+
});
|
|
7293
|
+
var token = this;
|
|
7294
|
+
this.promise.then(function (cancel) {
|
|
7295
|
+
if (!token._listeners) return;
|
|
7296
|
+
var i = token._listeners.length;
|
|
7297
|
+
while (i-- > 0) {
|
|
7298
|
+
token._listeners[i](cancel);
|
|
7299
|
+
}
|
|
7300
|
+
token._listeners = null;
|
|
7301
|
+
});
|
|
7302
|
+
this.promise.then = function (onfulfilled) {
|
|
7303
|
+
var _resolve;
|
|
7304
|
+
var promise = new Promise(function (resolve) {
|
|
7305
|
+
token.subscribe(resolve);
|
|
7306
|
+
_resolve = resolve;
|
|
7307
|
+
}).then(onfulfilled);
|
|
7308
|
+
promise.cancel = function reject() {
|
|
7309
|
+
token.unsubscribe(_resolve);
|
|
7310
|
+
};
|
|
7311
|
+
return promise;
|
|
7312
|
+
};
|
|
7313
|
+
executor(function cancel(message, config, request) {
|
|
7314
|
+
if (token.reason) {
|
|
7315
|
+
return;
|
|
7316
|
+
}
|
|
7317
|
+
token.reason = new CanceledError$1(message, config, request);
|
|
7318
|
+
resolvePromise(token.reason);
|
|
7319
|
+
});
|
|
7320
|
+
}
|
|
7321
|
+
/**
|
|
7322
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
7323
|
+
*/
|
|
7324
|
+
return _createClass(CancelToken2, [{
|
|
7325
|
+
key: "throwIfRequested",
|
|
7326
|
+
value: function throwIfRequested() {
|
|
7327
|
+
if (this.reason) {
|
|
7328
|
+
throw this.reason;
|
|
7329
|
+
}
|
|
7330
|
+
}
|
|
7331
|
+
/**
|
|
7332
|
+
* Subscribe to the cancel signal
|
|
7333
|
+
*/
|
|
7334
|
+
}, {
|
|
7335
|
+
key: "subscribe",
|
|
7336
|
+
value: function subscribe(listener) {
|
|
7337
|
+
if (this.reason) {
|
|
7338
|
+
listener(this.reason);
|
|
7339
|
+
return;
|
|
7340
|
+
}
|
|
7341
|
+
if (this._listeners) {
|
|
7342
|
+
this._listeners.push(listener);
|
|
7343
|
+
} else {
|
|
7344
|
+
this._listeners = [listener];
|
|
7345
|
+
}
|
|
7346
|
+
}
|
|
7347
|
+
/**
|
|
7348
|
+
* Unsubscribe from the cancel signal
|
|
7349
|
+
*/
|
|
7350
|
+
}, {
|
|
7351
|
+
key: "unsubscribe",
|
|
7352
|
+
value: function unsubscribe(listener) {
|
|
7353
|
+
if (!this._listeners) {
|
|
7354
|
+
return;
|
|
7355
|
+
}
|
|
7356
|
+
var index = this._listeners.indexOf(listener);
|
|
7357
|
+
if (index !== -1) {
|
|
7358
|
+
this._listeners.splice(index, 1);
|
|
7359
|
+
}
|
|
7360
|
+
}
|
|
7361
|
+
}, {
|
|
7362
|
+
key: "toAbortSignal",
|
|
7363
|
+
value: function toAbortSignal() {
|
|
7364
|
+
var _this13 = this;
|
|
7365
|
+
var controller = new AbortController();
|
|
7366
|
+
var abort = function abort(err) {
|
|
7367
|
+
controller.abort(err);
|
|
7368
|
+
};
|
|
7369
|
+
this.subscribe(abort);
|
|
7370
|
+
controller.signal.unsubscribe = function () {
|
|
7371
|
+
return _this13.unsubscribe(abort);
|
|
7372
|
+
};
|
|
7373
|
+
return controller.signal;
|
|
7374
|
+
}
|
|
7375
|
+
/**
|
|
7376
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
7377
|
+
* cancels the `CancelToken`.
|
|
7378
|
+
*/
|
|
7379
|
+
}], [{
|
|
7380
|
+
key: "source",
|
|
7381
|
+
value: function source() {
|
|
7382
|
+
var cancel;
|
|
7383
|
+
var token = new CancelToken2(function executor(c) {
|
|
7384
|
+
cancel = c;
|
|
7385
|
+
});
|
|
7386
|
+
return {
|
|
7387
|
+
token: token,
|
|
7388
|
+
cancel: cancel
|
|
7389
|
+
};
|
|
7390
|
+
}
|
|
7391
|
+
}]);
|
|
7392
|
+
}();
|
|
7393
|
+
function spread$1(callback) {
|
|
7394
|
+
return function wrap(arr) {
|
|
7395
|
+
return callback.apply(null, arr);
|
|
7396
|
+
};
|
|
7397
|
+
}
|
|
7398
|
+
function isAxiosError$1(payload) {
|
|
7399
|
+
return utils$1.isObject(payload) && payload.isAxiosError === true;
|
|
7400
|
+
}
|
|
7401
|
+
var HttpStatusCode$1 = {
|
|
7402
|
+
Continue: 100,
|
|
7403
|
+
SwitchingProtocols: 101,
|
|
7404
|
+
Processing: 102,
|
|
7405
|
+
EarlyHints: 103,
|
|
7406
|
+
Ok: 200,
|
|
7407
|
+
Created: 201,
|
|
7408
|
+
Accepted: 202,
|
|
7409
|
+
NonAuthoritativeInformation: 203,
|
|
7410
|
+
NoContent: 204,
|
|
7411
|
+
ResetContent: 205,
|
|
7412
|
+
PartialContent: 206,
|
|
7413
|
+
MultiStatus: 207,
|
|
7414
|
+
AlreadyReported: 208,
|
|
7415
|
+
ImUsed: 226,
|
|
7416
|
+
MultipleChoices: 300,
|
|
7417
|
+
MovedPermanently: 301,
|
|
7418
|
+
Found: 302,
|
|
7419
|
+
SeeOther: 303,
|
|
7420
|
+
NotModified: 304,
|
|
7421
|
+
UseProxy: 305,
|
|
7422
|
+
Unused: 306,
|
|
7423
|
+
TemporaryRedirect: 307,
|
|
7424
|
+
PermanentRedirect: 308,
|
|
7425
|
+
BadRequest: 400,
|
|
7426
|
+
Unauthorized: 401,
|
|
7427
|
+
PaymentRequired: 402,
|
|
7428
|
+
Forbidden: 403,
|
|
7429
|
+
NotFound: 404,
|
|
7430
|
+
MethodNotAllowed: 405,
|
|
7431
|
+
NotAcceptable: 406,
|
|
7432
|
+
ProxyAuthenticationRequired: 407,
|
|
7433
|
+
RequestTimeout: 408,
|
|
7434
|
+
Conflict: 409,
|
|
7435
|
+
Gone: 410,
|
|
7436
|
+
LengthRequired: 411,
|
|
7437
|
+
PreconditionFailed: 412,
|
|
7438
|
+
PayloadTooLarge: 413,
|
|
7439
|
+
UriTooLong: 414,
|
|
7440
|
+
UnsupportedMediaType: 415,
|
|
7441
|
+
RangeNotSatisfiable: 416,
|
|
7442
|
+
ExpectationFailed: 417,
|
|
7443
|
+
ImATeapot: 418,
|
|
7444
|
+
MisdirectedRequest: 421,
|
|
7445
|
+
UnprocessableEntity: 422,
|
|
7446
|
+
Locked: 423,
|
|
7447
|
+
FailedDependency: 424,
|
|
7448
|
+
TooEarly: 425,
|
|
7449
|
+
UpgradeRequired: 426,
|
|
7450
|
+
PreconditionRequired: 428,
|
|
7451
|
+
TooManyRequests: 429,
|
|
7452
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
7453
|
+
UnavailableForLegalReasons: 451,
|
|
7454
|
+
InternalServerError: 500,
|
|
7455
|
+
NotImplemented: 501,
|
|
7456
|
+
BadGateway: 502,
|
|
7457
|
+
ServiceUnavailable: 503,
|
|
7458
|
+
GatewayTimeout: 504,
|
|
7459
|
+
HttpVersionNotSupported: 505,
|
|
7460
|
+
VariantAlsoNegotiates: 506,
|
|
7461
|
+
InsufficientStorage: 507,
|
|
7462
|
+
LoopDetected: 508,
|
|
7463
|
+
NotExtended: 510,
|
|
7464
|
+
NetworkAuthenticationRequired: 511,
|
|
7465
|
+
WebServerIsDown: 521,
|
|
7466
|
+
ConnectionTimedOut: 522,
|
|
7467
|
+
OriginIsUnreachable: 523,
|
|
7468
|
+
TimeoutOccurred: 524,
|
|
7469
|
+
SslHandshakeFailed: 525,
|
|
7470
|
+
InvalidSslCertificate: 526
|
|
7471
|
+
};
|
|
7472
|
+
Object.entries(HttpStatusCode$1).forEach(function (_ref43) {
|
|
7473
|
+
var _ref44 = _slicedToArray(_ref43, 2),
|
|
7474
|
+
key = _ref44[0],
|
|
7475
|
+
value = _ref44[1];
|
|
7476
|
+
HttpStatusCode$1[value] = key;
|
|
7477
|
+
});
|
|
7478
|
+
function createInstance(defaultConfig) {
|
|
7479
|
+
var context = new Axios$1(defaultConfig);
|
|
7480
|
+
var instance = bind(Axios$1.prototype.request, context);
|
|
7481
|
+
utils$1.extend(instance, Axios$1.prototype, context, {
|
|
7482
|
+
allOwnKeys: true
|
|
7483
|
+
});
|
|
7484
|
+
utils$1.extend(instance, context, null, {
|
|
7485
|
+
allOwnKeys: true
|
|
7486
|
+
});
|
|
7487
|
+
instance.create = function create(instanceConfig) {
|
|
7488
|
+
return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
|
|
7489
|
+
};
|
|
7490
|
+
return instance;
|
|
7491
|
+
}
|
|
7492
|
+
var axios = createInstance(defaults);
|
|
7493
|
+
axios.Axios = Axios$1;
|
|
7494
|
+
axios.CanceledError = CanceledError$1;
|
|
7495
|
+
axios.CancelToken = CancelToken$1;
|
|
7496
|
+
axios.isCancel = isCancel$1;
|
|
7497
|
+
axios.VERSION = VERSION$1;
|
|
7498
|
+
axios.toFormData = toFormData$1;
|
|
7499
|
+
axios.AxiosError = AxiosError$1;
|
|
7500
|
+
axios.Cancel = axios.CanceledError;
|
|
7501
|
+
axios.all = function all2(promises) {
|
|
7502
|
+
return Promise.all(promises);
|
|
7503
|
+
};
|
|
7504
|
+
axios.spread = spread$1;
|
|
7505
|
+
axios.isAxiosError = isAxiosError$1;
|
|
7506
|
+
axios.mergeConfig = mergeConfig$1;
|
|
7507
|
+
axios.AxiosHeaders = AxiosHeaders$1;
|
|
7508
|
+
axios.formToJSON = function (thing) {
|
|
7509
|
+
return formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
7510
|
+
};
|
|
7511
|
+
axios.getAdapter = adapters.getAdapter;
|
|
7512
|
+
axios.HttpStatusCode = HttpStatusCode$1;
|
|
7513
|
+
axios.default = axios;
|
|
7514
|
+
var Axios = axios.Axios,
|
|
7515
|
+
AxiosError = axios.AxiosError,
|
|
7516
|
+
CanceledError = axios.CanceledError,
|
|
7517
|
+
isCancel = axios.isCancel,
|
|
7518
|
+
CancelToken = axios.CancelToken,
|
|
7519
|
+
VERSION = axios.VERSION,
|
|
7520
|
+
all = axios.all,
|
|
7521
|
+
Cancel = axios.Cancel,
|
|
7522
|
+
isAxiosError = axios.isAxiosError,
|
|
7523
|
+
spread = axios.spread,
|
|
7524
|
+
toFormData = axios.toFormData,
|
|
7525
|
+
AxiosHeaders = axios.AxiosHeaders,
|
|
7526
|
+
HttpStatusCode = axios.HttpStatusCode,
|
|
7527
|
+
formToJSON = axios.formToJSON,
|
|
7528
|
+
getAdapter = axios.getAdapter,
|
|
7529
|
+
mergeConfig = axios.mergeConfig;
|
|
7530
|
+
var axiosApi = axios.create({
|
|
7531
|
+
baseURL: getBaseUrl(),
|
|
7532
|
+
withCredentials: true,
|
|
7533
|
+
headers: {
|
|
7534
|
+
Accept: "application/json, text/plain, */*",
|
|
7535
|
+
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
|
7536
|
+
"Access-Control-Allow-Origin": "*"
|
|
7537
|
+
}
|
|
7538
|
+
});
|
|
7539
|
+
axiosApi.interceptors.request.use(function (config) {
|
|
7540
|
+
return __async(_this0, null, /*#__PURE__*/_regenerator().m(function _callee1() {
|
|
7541
|
+
return _regenerator().w(function (_context10) {
|
|
7542
|
+
while (1) switch (_context10.n) {
|
|
7543
|
+
case 0:
|
|
7544
|
+
try {
|
|
7545
|
+
config.baseURL = getBaseUrl();
|
|
7546
|
+
} catch (e) {
|
|
7547
|
+
console.error("Axios request error:", e);
|
|
7548
|
+
}
|
|
7549
|
+
return _context10.a(2, config);
|
|
7550
|
+
}
|
|
7551
|
+
}, _callee1);
|
|
7552
|
+
}));
|
|
7553
|
+
});
|
|
7554
|
+
axiosApi.interceptors.response.use(function (response) {
|
|
7555
|
+
var responseData = response == null ? void 0 : response.data;
|
|
7556
|
+
var dataError = responseData == null ? void 0 : responseData.error;
|
|
7557
|
+
if (dataError && (dataError == null ? void 0 : dataError.code) && dataError.code == 808) {
|
|
7558
|
+
console.error("Password expired!");
|
|
7559
|
+
}
|
|
7560
|
+
return response == null ? void 0 : response.data;
|
|
7561
|
+
}, function (error) {
|
|
7562
|
+
var serverResponse = error == null ? void 0 : error.response;
|
|
7563
|
+
var errorStatus = serverResponse == null ? void 0 : serverResponse.status;
|
|
7564
|
+
var responseData = serverResponse == null ? void 0 : serverResponse.data;
|
|
7565
|
+
if (errorStatus === 401) {
|
|
7566
|
+
console.error("Authentication failed!");
|
|
7567
|
+
}
|
|
7568
|
+
switch (errorStatus) {
|
|
7569
|
+
case 404:
|
|
7570
|
+
if (!(responseData == null ? void 0 : responseData.success)) {
|
|
7571
|
+
var message = (responseData == null ? void 0 : responseData.msg) || "Not Found";
|
|
7572
|
+
console.error("Axios 404: ", message);
|
|
7573
|
+
}
|
|
7574
|
+
break;
|
|
7575
|
+
case 401:
|
|
7576
|
+
if (!(responseData == null ? void 0 : responseData.success)) {
|
|
7577
|
+
var _message = (responseData == null ? void 0 : responseData.detail) || (responseData == null ? void 0 : responseData.msg);
|
|
7578
|
+
console.error("Axios 401: ", _message);
|
|
7579
|
+
}
|
|
7580
|
+
break;
|
|
7581
|
+
case 505:
|
|
7582
|
+
if (!(responseData == null ? void 0 : responseData.success)) {
|
|
7583
|
+
var _message2 = (responseData == null ? void 0 : responseData.error) || "";
|
|
7584
|
+
console.error("Axios 505: ", _message2);
|
|
7585
|
+
}
|
|
7586
|
+
return responseData;
|
|
7587
|
+
case 0:
|
|
7588
|
+
console.error("Axios sever error!");
|
|
7589
|
+
break;
|
|
7590
|
+
}
|
|
7591
|
+
if (typeof errorStatus === "undefined") {
|
|
7592
|
+
console.error("Unexpected Error");
|
|
7593
|
+
}
|
|
7594
|
+
console.log(error);
|
|
7595
|
+
return Promise.reject(error);
|
|
7596
|
+
});
|
|
7597
|
+
var SettingPopper = /*#__PURE__*/function (_React__namespace$Com2) {
|
|
7598
|
+
function SettingPopper(props) {
|
|
7599
|
+
var _this14;
|
|
7600
|
+
_classCallCheck(this, SettingPopper);
|
|
7601
|
+
_this14 = _callSuper(this, SettingPopper, [props]);
|
|
7602
|
+
__publicField(_this14, "containerRef");
|
|
7603
|
+
__publicField(_this14, "popperRef");
|
|
7604
|
+
__publicField(_this14, "getLanguageOptions", function () {
|
|
7605
|
+
return __async(_this14, null, /*#__PURE__*/_regenerator().m(function _callee10() {
|
|
7606
|
+
var _a2, res, langs;
|
|
7607
|
+
return _regenerator().w(function (_context11) {
|
|
7608
|
+
while (1) switch (_context11.n) {
|
|
7609
|
+
case 0:
|
|
7610
|
+
_context11.n = 1;
|
|
7611
|
+
return axiosApi.get("/email/ai/langlist");
|
|
7612
|
+
case 1:
|
|
7613
|
+
res = _context11.v;
|
|
7614
|
+
if (res == null ? void 0 : res.list) {
|
|
7615
|
+
langs = (_a2 = Object.keys(res == null ? void 0 : res.list)) == null ? void 0 : _a2.map(function (_key, i) {
|
|
7616
|
+
var _a3;
|
|
7617
|
+
var _item = (_a3 = res == null ? void 0 : res.list) == null ? void 0 : _a3[_key];
|
|
7618
|
+
return {
|
|
7619
|
+
value: _key,
|
|
7620
|
+
label: _item == null ? void 0 : _item.name
|
|
7621
|
+
};
|
|
7622
|
+
});
|
|
7623
|
+
this.setState({
|
|
7624
|
+
languageOptions: langs
|
|
7625
|
+
});
|
|
7626
|
+
}
|
|
7627
|
+
case 2:
|
|
7628
|
+
return _context11.a(2);
|
|
7629
|
+
}
|
|
7630
|
+
}, _callee10, this);
|
|
7631
|
+
}));
|
|
7632
|
+
});
|
|
7633
|
+
__publicField(_this14, "handleClickOutside", function (event) {
|
|
7634
|
+
var target = event.target;
|
|
7635
|
+
if (_this14.containerRef.current && !_this14.containerRef.current.contains(target) && (!_this14.popperRef.current || !_this14.popperRef.current.contains(target))) {
|
|
7636
|
+
_this14.setState({
|
|
7637
|
+
open: false
|
|
7638
|
+
});
|
|
7639
|
+
}
|
|
7640
|
+
});
|
|
7641
|
+
__publicField(_this14, "togglePopper", function () {
|
|
7642
|
+
_this14.setState(function (prevState) {
|
|
7643
|
+
return {
|
|
7644
|
+
open: !prevState.open
|
|
7645
|
+
};
|
|
7646
|
+
});
|
|
7647
|
+
});
|
|
7648
|
+
__publicField(_this14, "handleLangChange", function (e) {
|
|
7649
|
+
var selected = _this14.state.languageOptions.find(function (opt) {
|
|
7650
|
+
return opt.value === e.target.value;
|
|
7651
|
+
});
|
|
7652
|
+
_this14.props.setLang(selected || null);
|
|
7653
|
+
});
|
|
7654
|
+
_this14.state = {
|
|
7655
|
+
open: false,
|
|
7656
|
+
languageOptions: []
|
|
7657
|
+
};
|
|
7658
|
+
_this14.containerRef = React__namespace.createRef();
|
|
7659
|
+
_this14.popperRef = React__namespace.createRef();
|
|
7660
|
+
_this14.getLanguageOptions();
|
|
7661
|
+
return _this14;
|
|
7662
|
+
}
|
|
7663
|
+
_inherits(SettingPopper, _React__namespace$Com2);
|
|
7664
|
+
return _createClass(SettingPopper, [{
|
|
7665
|
+
key: "componentDidMount",
|
|
7666
|
+
value: function componentDidMount() {
|
|
7667
|
+
document.addEventListener("mousedown", this.handleClickOutside);
|
|
7668
|
+
}
|
|
7669
|
+
}, {
|
|
7670
|
+
key: "componentWillUnmount",
|
|
7671
|
+
value: function componentWillUnmount() {
|
|
7672
|
+
document.removeEventListener("mousedown", this.handleClickOutside);
|
|
7673
|
+
}
|
|
7674
|
+
}, {
|
|
7675
|
+
key: "render",
|
|
7676
|
+
value: function render() {
|
|
7677
|
+
var _this$props4 = this.props,
|
|
7678
|
+
lang = _this$props4.lang,
|
|
7679
|
+
originalEmail = _this$props4.originalEmail,
|
|
4594
7680
|
setOriginalEmail = _this$props4.setOriginalEmail,
|
|
4595
7681
|
getEditorContent = _this$props4.getEditorContent,
|
|
4596
7682
|
parentRef = _this$props4.parentRef;
|
|
4597
|
-
var
|
|
7683
|
+
var _this$state2 = this.state,
|
|
7684
|
+
open = _this$state2.open,
|
|
7685
|
+
languageOptions = _this$state2.languageOptions;
|
|
4598
7686
|
var popperTop = 0;
|
|
4599
7687
|
var popperLeft = 0;
|
|
4600
7688
|
var popperWidth = 320;
|
|
@@ -4655,18 +7743,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4655
7743
|
// color: "var(--text-secondary)",
|
|
4656
7744
|
}
|
|
4657
7745
|
}, "Language"), /* @__PURE__ */React__namespace.createElement("select", {
|
|
7746
|
+
name: "language",
|
|
4658
7747
|
value: lang ? lang.value : "",
|
|
4659
|
-
onChange: this.handleLangChange
|
|
4660
|
-
style: {
|
|
4661
|
-
padding: "7px 8px",
|
|
4662
|
-
borderRadius: 4,
|
|
4663
|
-
border: "1px solid #ccc",
|
|
4664
|
-
fontSize: 14
|
|
4665
|
-
}
|
|
7748
|
+
onChange: this.handleLangChange
|
|
4666
7749
|
}, /* @__PURE__ */React__namespace.createElement("option", {
|
|
4667
7750
|
value: "",
|
|
4668
7751
|
disabled: true
|
|
4669
|
-
}, "Select Language"),
|
|
7752
|
+
}, "Select Language"), languageOptions.map(function (opt) {
|
|
4670
7753
|
return /* @__PURE__ */React__namespace.createElement("option", {
|
|
4671
7754
|
key: opt.value,
|
|
4672
7755
|
value: opt.value
|
|
@@ -4709,35 +7792,233 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4709
7792
|
}
|
|
4710
7793
|
}]);
|
|
4711
7794
|
}(React__namespace.Component);
|
|
7795
|
+
var AI_LANG_FLAGS = [{
|
|
7796
|
+
label: "English",
|
|
7797
|
+
value: "en",
|
|
7798
|
+
flagCode: "us"
|
|
7799
|
+
}, {
|
|
7800
|
+
label: "Korean",
|
|
7801
|
+
value: "ko",
|
|
7802
|
+
flagCode: "kr"
|
|
7803
|
+
}, {
|
|
7804
|
+
label: "Vietnamese",
|
|
7805
|
+
value: "vi",
|
|
7806
|
+
flagCode: "vn"
|
|
7807
|
+
}, {
|
|
7808
|
+
label: "Indonesian",
|
|
7809
|
+
value: "id",
|
|
7810
|
+
flagCode: "id"
|
|
7811
|
+
}, {
|
|
7812
|
+
label: "Chinese-Traditional",
|
|
7813
|
+
value: "zh-cht",
|
|
7814
|
+
flagCode: "cn"
|
|
7815
|
+
}, {
|
|
7816
|
+
label: "Chinese-Simplified",
|
|
7817
|
+
value: "zh-chs",
|
|
7818
|
+
flagCode: "cn"
|
|
7819
|
+
}];
|
|
7820
|
+
var CNFlag = function CNFlag(props) {
|
|
7821
|
+
return /* @__PURE__ */React__namespace.createElement("svg", __spreadValues({
|
|
7822
|
+
viewBox: "0 0 30 20"
|
|
7823
|
+
}, props), /* @__PURE__ */React__namespace.createElement("rect", {
|
|
7824
|
+
fill: "#de2110",
|
|
7825
|
+
width: "30",
|
|
7826
|
+
height: "20"
|
|
7827
|
+
}), /* @__PURE__ */React__namespace.createElement("path", {
|
|
7828
|
+
fill: "#ffde00",
|
|
7829
|
+
d: "m6 2-1 3.2h3.2l-2.6-2 1 3.2-1.6-1.2-1.6 1.2 1-3.2-2.6 2h3.2l-1-3.2zm4-1 0.4 1.3 1.3 0.1-1.1 0.8 0.4 1.3L10 3.7l-1 0.8 0.4-1.3-1.1-0.8 1.3-0.1 0.4-1.3zm2.5 2.1 0.7 1.2 1.3-0.3-0.7 1.2 0.7 1.2-1.3-0.3-0.7 1.2v-1.4l-1.3-0.3 1.3-0.3v-1.4zm0 4.1-1.3 0.3 1.3 0.3v1.4l0.7-1.2 1.3 0.3-0.7-1.2 0.7-1.2-1.3 0.3-0.7-1.2v1.4zm-2.5 1.7-0.4 1.3-1.3 0.1 1.1 0.8-0.4 1.3 1.1-0.8 1.1 0.8-0.4-1.3 1.1-0.8-1.3-0.1-0.4-1.3z"
|
|
7830
|
+
}));
|
|
7831
|
+
};
|
|
7832
|
+
var IDFlag = function IDFlag(props) {
|
|
7833
|
+
return /* @__PURE__ */React__namespace.createElement("svg", __spreadValues({
|
|
7834
|
+
viewBox: "0 0 3 2"
|
|
7835
|
+
}, props), /* @__PURE__ */React__namespace.createElement("rect", {
|
|
7836
|
+
fill: "#fff",
|
|
7837
|
+
width: "3",
|
|
7838
|
+
height: "2"
|
|
7839
|
+
}), /* @__PURE__ */React__namespace.createElement("rect", {
|
|
7840
|
+
fill: "#ce1126",
|
|
7841
|
+
width: "3",
|
|
7842
|
+
height: "1"
|
|
7843
|
+
}));
|
|
7844
|
+
};
|
|
7845
|
+
var KRFlag = function KRFlag(props) {
|
|
7846
|
+
return /* @__PURE__ */React__namespace.createElement("svg", __spreadValues({
|
|
7847
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7848
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
7849
|
+
viewBox: "-36 -24 72 48"
|
|
7850
|
+
}, props), /* @__PURE__ */React__namespace.createElement("path", {
|
|
7851
|
+
fill: "#fff",
|
|
7852
|
+
d: "M-36-24h72v48h-72z"
|
|
7853
|
+
}), /* @__PURE__ */React__namespace.createElement("g", {
|
|
7854
|
+
transform: "rotate(-56.31)"
|
|
7855
|
+
}, /* @__PURE__ */React__namespace.createElement("g", {
|
|
7856
|
+
id: "b"
|
|
7857
|
+
}, /* @__PURE__ */React__namespace.createElement("path", {
|
|
7858
|
+
id: "a",
|
|
7859
|
+
d: "M-6-25H6m-12 3H6m-12 3H6",
|
|
7860
|
+
stroke: "#000",
|
|
7861
|
+
"stroke-width": "2"
|
|
7862
|
+
}), /* @__PURE__ */React__namespace.createElement("use", {
|
|
7863
|
+
xlinkHref: "#a",
|
|
7864
|
+
y: "44"
|
|
7865
|
+
})), /* @__PURE__ */React__namespace.createElement("path", {
|
|
7866
|
+
stroke: "#fff",
|
|
7867
|
+
d: "M0 17v10"
|
|
7868
|
+
}), /* @__PURE__ */React__namespace.createElement("circle", {
|
|
7869
|
+
fill: "#cd2e3a",
|
|
7870
|
+
r: "12"
|
|
7871
|
+
}), /* @__PURE__ */React__namespace.createElement("path", {
|
|
7872
|
+
fill: "#0047a0",
|
|
7873
|
+
d: "M0-12A6 6 0 000 0a6 6 0 010 12 12 12 0 010-24z"
|
|
7874
|
+
})), /* @__PURE__ */React__namespace.createElement("g", {
|
|
7875
|
+
transform: "rotate(-123.69)"
|
|
7876
|
+
}, /* @__PURE__ */React__namespace.createElement("use", {
|
|
7877
|
+
xlinkHref: "#b"
|
|
7878
|
+
}), /* @__PURE__ */React__namespace.createElement("path", {
|
|
7879
|
+
stroke: "#fff",
|
|
7880
|
+
d: "M0-23.5v3M0 17v3.5m0 3v3"
|
|
7881
|
+
})));
|
|
7882
|
+
};
|
|
7883
|
+
var USFlag = function USFlag(props) {
|
|
7884
|
+
return /* @__PURE__ */React__namespace.createElement("svg", __spreadValues({
|
|
7885
|
+
viewBox: "0 0 7410 3900"
|
|
7886
|
+
}, props), /* @__PURE__ */React__namespace.createElement("rect", {
|
|
7887
|
+
width: "7410",
|
|
7888
|
+
height: "3900",
|
|
7889
|
+
fill: "#b22234"
|
|
7890
|
+
}), /* @__PURE__ */React__namespace.createElement("path", {
|
|
7891
|
+
d: "M0,450H7410m0,600H0m0,600H7410m0,600H0m0,600H7410m0,600H0",
|
|
7892
|
+
stroke: "#fff",
|
|
7893
|
+
strokeWidth: "300"
|
|
7894
|
+
}), /* @__PURE__ */React__namespace.createElement("rect", {
|
|
7895
|
+
width: "2964",
|
|
7896
|
+
height: "2100",
|
|
7897
|
+
fill: "#3c3b6e"
|
|
7898
|
+
}), /* @__PURE__ */React__namespace.createElement("g", {
|
|
7899
|
+
fill: "#fff"
|
|
7900
|
+
}, /* @__PURE__ */React__namespace.createElement("g", {
|
|
7901
|
+
id: "us_s18"
|
|
7902
|
+
}, /* @__PURE__ */React__namespace.createElement("g", {
|
|
7903
|
+
id: "us_s9"
|
|
7904
|
+
}, /* @__PURE__ */React__namespace.createElement("g", {
|
|
7905
|
+
id: "us_s5"
|
|
7906
|
+
}, /* @__PURE__ */React__namespace.createElement("g", {
|
|
7907
|
+
id: "us_s4"
|
|
7908
|
+
}, /* @__PURE__ */React__namespace.createElement("path", {
|
|
7909
|
+
id: "us_s",
|
|
7910
|
+
d: "M247,90 317.534230,307.082039 132.873218,172.917961H361.126782L176.465770,307.082039z"
|
|
7911
|
+
}), /* @__PURE__ */React__namespace.createElement("use", {
|
|
7912
|
+
xlinkHref: "#us_s",
|
|
7913
|
+
y: "420"
|
|
7914
|
+
}), /* @__PURE__ */React__namespace.createElement("use", {
|
|
7915
|
+
xlinkHref: "#us_s",
|
|
7916
|
+
y: "840"
|
|
7917
|
+
}), /* @__PURE__ */React__namespace.createElement("use", {
|
|
7918
|
+
xlinkHref: "#us_s",
|
|
7919
|
+
y: "1260"
|
|
7920
|
+
})), /* @__PURE__ */React__namespace.createElement("use", {
|
|
7921
|
+
xlinkHref: "#us_s",
|
|
7922
|
+
y: "1680"
|
|
7923
|
+
})), /* @__PURE__ */React__namespace.createElement("use", {
|
|
7924
|
+
xlinkHref: "#us_s4",
|
|
7925
|
+
x: "247",
|
|
7926
|
+
y: "210"
|
|
7927
|
+
})), /* @__PURE__ */React__namespace.createElement("use", {
|
|
7928
|
+
xlinkHref: "#us_s9",
|
|
7929
|
+
x: "494"
|
|
7930
|
+
})), /* @__PURE__ */React__namespace.createElement("use", {
|
|
7931
|
+
xlinkHref: "#us_s18",
|
|
7932
|
+
x: "988"
|
|
7933
|
+
}), /* @__PURE__ */React__namespace.createElement("use", {
|
|
7934
|
+
xlinkHref: "#us_s9",
|
|
7935
|
+
x: "1976"
|
|
7936
|
+
}), /* @__PURE__ */React__namespace.createElement("use", {
|
|
7937
|
+
xlinkHref: "#us_s5",
|
|
7938
|
+
x: "2470"
|
|
7939
|
+
})));
|
|
7940
|
+
};
|
|
7941
|
+
var VNFlag = function VNFlag(props) {
|
|
7942
|
+
return /* @__PURE__ */React__namespace.createElement("svg", __spreadValues({
|
|
7943
|
+
viewBox: "-15 -10 30 20"
|
|
7944
|
+
}, props), /* @__PURE__ */React__namespace.createElement("rect", {
|
|
7945
|
+
fill: "#DA251d",
|
|
7946
|
+
x: "-20",
|
|
7947
|
+
y: "-15",
|
|
7948
|
+
width: "40",
|
|
7949
|
+
height: "30"
|
|
7950
|
+
}), /* @__PURE__ */React__namespace.createElement("g", {
|
|
7951
|
+
id: "vn_g",
|
|
7952
|
+
transform: "translate(0,-6)"
|
|
7953
|
+
}, /* @__PURE__ */React__namespace.createElement("polyline", {
|
|
7954
|
+
id: "vn_g1",
|
|
7955
|
+
fill: "#FF0",
|
|
7956
|
+
points: "0,0 0,6 4,6",
|
|
7957
|
+
transform: "rotate(18)"
|
|
7958
|
+
}), /* @__PURE__ */React__namespace.createElement("use", {
|
|
7959
|
+
xlinkHref: "#vn_g1",
|
|
7960
|
+
transform: "scale(-1,1)"
|
|
7961
|
+
})), /* @__PURE__ */React__namespace.createElement("g", {
|
|
7962
|
+
id: "vn_g2",
|
|
7963
|
+
transform: "rotate(72)"
|
|
7964
|
+
}, /* @__PURE__ */React__namespace.createElement("use", {
|
|
7965
|
+
xlinkHref: "#vn_g"
|
|
7966
|
+
}), /* @__PURE__ */React__namespace.createElement("use", {
|
|
7967
|
+
xlinkHref: "#vn_g",
|
|
7968
|
+
transform: "rotate(72)"
|
|
7969
|
+
})), /* @__PURE__ */React__namespace.createElement("use", {
|
|
7970
|
+
xlinkHref: "#vn_g2",
|
|
7971
|
+
transform: "scale(-1,1)"
|
|
7972
|
+
}));
|
|
7973
|
+
};
|
|
7974
|
+
var FlagMap = {
|
|
7975
|
+
cn: CNFlag,
|
|
7976
|
+
id: IDFlag,
|
|
7977
|
+
kr: KRFlag,
|
|
7978
|
+
us: USFlag,
|
|
7979
|
+
vn: VNFlag
|
|
7980
|
+
};
|
|
7981
|
+
var CountryFlag = function CountryFlag(props) {
|
|
7982
|
+
var _a2 = props,
|
|
7983
|
+
flagCode = _a2.flagCode,
|
|
7984
|
+
style = _a2.style,
|
|
7985
|
+
rest = __objRest(_a2, ["flagCode", "style"]);
|
|
7986
|
+
if (!flagCode) return null;
|
|
7987
|
+
var FlagComponent = FlagMap[flagCode];
|
|
7988
|
+
if (!FlagComponent) return null;
|
|
7989
|
+
return /* @__PURE__ */React__namespace.createElement(FlagComponent, __spreadValues({
|
|
7990
|
+
style: style
|
|
7991
|
+
}, rest));
|
|
7992
|
+
};
|
|
4712
7993
|
var ChatAIDraft = /*#__PURE__*/function (_React__namespace$Com3) {
|
|
4713
7994
|
function ChatAIDraft(props) {
|
|
4714
|
-
var
|
|
7995
|
+
var _this15;
|
|
4715
7996
|
_classCallCheck(this, ChatAIDraft);
|
|
4716
|
-
|
|
4717
|
-
__publicField(
|
|
4718
|
-
__publicField(
|
|
4719
|
-
|
|
7997
|
+
_this15 = _callSuper(this, ChatAIDraft, [props]);
|
|
7998
|
+
__publicField(_this15, "rootRef");
|
|
7999
|
+
__publicField(_this15, "setAIContext", function (html2) {
|
|
8000
|
+
_this15.setState({
|
|
4720
8001
|
originalEmail: html2
|
|
4721
8002
|
});
|
|
4722
8003
|
});
|
|
4723
|
-
__publicField(
|
|
4724
|
-
|
|
8004
|
+
__publicField(_this15, "handleMessageChange", function (e) {
|
|
8005
|
+
_this15.setState({
|
|
4725
8006
|
message: e.target.value
|
|
4726
8007
|
});
|
|
4727
8008
|
});
|
|
4728
|
-
__publicField(
|
|
4729
|
-
return __async(
|
|
4730
|
-
var
|
|
4731
|
-
var _this$
|
|
4732
|
-
return _regenerator().w(function (
|
|
4733
|
-
while (1) switch (
|
|
8009
|
+
__publicField(_this15, "handleSubmit", function () {
|
|
8010
|
+
return __async(_this15, null, /*#__PURE__*/_regenerator().m(function _callee11() {
|
|
8011
|
+
var _this16 = this;
|
|
8012
|
+
var _this$state3, message, messages, lang, originalEmail, conversationId, newId, newMessage, currentItems, params, setContent, setIsLoading, setConversationId;
|
|
8013
|
+
return _regenerator().w(function (_context12) {
|
|
8014
|
+
while (1) switch (_context12.n) {
|
|
4734
8015
|
case 0:
|
|
4735
|
-
_this$
|
|
8016
|
+
_this$state3 = this.state, message = _this$state3.message, messages = _this$state3.messages, lang = _this$state3.lang, originalEmail = _this$state3.originalEmail, conversationId = _this$state3.conversationId;
|
|
4736
8017
|
if (message.trim()) {
|
|
4737
|
-
|
|
8018
|
+
_context12.n = 1;
|
|
4738
8019
|
break;
|
|
4739
8020
|
}
|
|
4740
|
-
return
|
|
8021
|
+
return _context12.a(2);
|
|
4741
8022
|
case 1:
|
|
4742
8023
|
newId = v4();
|
|
4743
8024
|
newMessage = {
|
|
@@ -4764,7 +8045,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4764
8045
|
params.conversation_id = conversationId;
|
|
4765
8046
|
}
|
|
4766
8047
|
setContent = function setContent(nContent) {
|
|
4767
|
-
|
|
8048
|
+
_this16.setState(function (prevState) {
|
|
4768
8049
|
var updatedMessages = prevState.messages.map(function (m) {
|
|
4769
8050
|
return m.id === newId ? __spreadProps(__spreadValues({}, m), {
|
|
4770
8051
|
subject: "Some thing not used",
|
|
@@ -4779,7 +8060,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4779
8060
|
});
|
|
4780
8061
|
};
|
|
4781
8062
|
setIsLoading = function setIsLoading(loading) {
|
|
4782
|
-
|
|
8063
|
+
_this16.setState(function (prevState) {
|
|
4783
8064
|
var updatedMessages = prevState.messages.map(function (m) {
|
|
4784
8065
|
return m.id === newId ? __spreadProps(__spreadValues({}, m), {
|
|
4785
8066
|
isLoading: loading
|
|
@@ -4791,11 +8072,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4791
8072
|
});
|
|
4792
8073
|
};
|
|
4793
8074
|
setConversationId = function setConversationId(id) {
|
|
4794
|
-
|
|
8075
|
+
_this16.setState({
|
|
4795
8076
|
conversationId: id
|
|
4796
8077
|
});
|
|
4797
8078
|
};
|
|
4798
|
-
|
|
8079
|
+
_context12.n = 2;
|
|
4799
8080
|
return callAI(params, {
|
|
4800
8081
|
setContent: setContent,
|
|
4801
8082
|
setIsLoading: setIsLoading,
|
|
@@ -4806,51 +8087,58 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4806
8087
|
isSending: false
|
|
4807
8088
|
});
|
|
4808
8089
|
case 3:
|
|
4809
|
-
return
|
|
8090
|
+
return _context12.a(2);
|
|
4810
8091
|
}
|
|
4811
|
-
},
|
|
8092
|
+
}, _callee11, this);
|
|
4812
8093
|
}));
|
|
4813
8094
|
});
|
|
4814
|
-
__publicField(
|
|
4815
|
-
if (!event.shiftKey && event.key === "Enter" && !
|
|
8095
|
+
__publicField(_this15, "handleKeyDown", function (event) {
|
|
8096
|
+
if (!event.shiftKey && event.key === "Enter" && !_this15.state.isSending) {
|
|
4816
8097
|
event.preventDefault();
|
|
4817
|
-
|
|
8098
|
+
_this15.handleSubmit();
|
|
4818
8099
|
}
|
|
4819
8100
|
});
|
|
4820
|
-
__publicField(
|
|
4821
|
-
|
|
8101
|
+
__publicField(_this15, "setLang", function (lang) {
|
|
8102
|
+
_this15.setState({
|
|
4822
8103
|
lang: lang
|
|
4823
8104
|
});
|
|
4824
8105
|
});
|
|
4825
|
-
__publicField(
|
|
4826
|
-
|
|
8106
|
+
__publicField(_this15, "setOriginalEmail", function (email) {
|
|
8107
|
+
_this15.setState({
|
|
4827
8108
|
originalEmail: email
|
|
4828
8109
|
});
|
|
4829
8110
|
});
|
|
4830
|
-
|
|
4831
|
-
|
|
8111
|
+
_this15.rootRef = React__namespace.createRef();
|
|
8112
|
+
var lang = (AI_LANG_FLAGS == null ? void 0 : AI_LANG_FLAGS.find(function (_item) {
|
|
8113
|
+
return (_item == null ? void 0 : _item.value) === (props == null ? void 0 : props.defaultLang);
|
|
8114
|
+
})) || AI_LANG_FLAGS[0];
|
|
8115
|
+
_this15.state = {
|
|
4832
8116
|
message: "",
|
|
4833
8117
|
messages: [],
|
|
4834
8118
|
isSending: false,
|
|
4835
|
-
lang:
|
|
8119
|
+
lang: lang,
|
|
4836
8120
|
conversationId: "",
|
|
4837
8121
|
originalEmail: ""
|
|
4838
8122
|
};
|
|
4839
|
-
return
|
|
8123
|
+
return _this15;
|
|
4840
8124
|
}
|
|
4841
8125
|
_inherits(ChatAIDraft, _React__namespace$Com3);
|
|
4842
8126
|
return _createClass(ChatAIDraft, [{
|
|
4843
8127
|
key: "render",
|
|
4844
8128
|
value: function render() {
|
|
8129
|
+
var _a2;
|
|
4845
8130
|
var _this$props5 = this.props,
|
|
4846
8131
|
onApply = _this$props5.onApply,
|
|
4847
8132
|
getEditorContent = _this$props5.getEditorContent;
|
|
4848
|
-
var _this$
|
|
4849
|
-
message = _this$
|
|
4850
|
-
messages = _this$
|
|
4851
|
-
isSending = _this$
|
|
4852
|
-
lang = _this$
|
|
4853
|
-
originalEmail = _this$
|
|
8133
|
+
var _this$state4 = this.state,
|
|
8134
|
+
message = _this$state4.message,
|
|
8135
|
+
messages = _this$state4.messages,
|
|
8136
|
+
isSending = _this$state4.isSending,
|
|
8137
|
+
lang = _this$state4.lang,
|
|
8138
|
+
originalEmail = _this$state4.originalEmail;
|
|
8139
|
+
var flagCode = (_a2 = AI_LANG_FLAGS == null ? void 0 : AI_LANG_FLAGS.find(function (_item) {
|
|
8140
|
+
return (_item == null ? void 0 : _item.value) === (lang == null ? void 0 : lang.value);
|
|
8141
|
+
})) == null ? void 0 : _a2.flagCode;
|
|
4854
8142
|
return /* @__PURE__ */React__namespace.createElement("div", {
|
|
4855
8143
|
ref: this.rootRef,
|
|
4856
8144
|
style: {
|
|
@@ -4919,7 +8207,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4919
8207
|
display: "flex",
|
|
4920
8208
|
flexDirection: "row",
|
|
4921
8209
|
alignItems: "center",
|
|
4922
|
-
justifyContent: "space-between",
|
|
4923
8210
|
width: "100%",
|
|
4924
8211
|
padding: "8px",
|
|
4925
8212
|
boxSizing: "border-box"
|
|
@@ -4931,16 +8218,26 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4931
8218
|
setOriginalEmail: this.setOriginalEmail,
|
|
4932
8219
|
getEditorContent: getEditorContent,
|
|
4933
8220
|
parentRef: this.rootRef
|
|
8221
|
+
}), /* @__PURE__ */React__namespace.createElement(CountryFlag, {
|
|
8222
|
+
flagCode: flagCode,
|
|
8223
|
+
style: {
|
|
8224
|
+
marginLeft: 4,
|
|
8225
|
+
height: 14
|
|
8226
|
+
}
|
|
4934
8227
|
}), /* @__PURE__ */React__namespace.createElement("button", {
|
|
4935
8228
|
disabled: !message.trim() || isSending,
|
|
4936
8229
|
onClick: this.handleSubmit,
|
|
4937
8230
|
className: "icon-button",
|
|
4938
|
-
color: "primary"
|
|
8231
|
+
color: "primary",
|
|
8232
|
+
style: {
|
|
8233
|
+
marginLeft: "auto"
|
|
8234
|
+
}
|
|
4939
8235
|
}, /* @__PURE__ */React__namespace.createElement(Send, null)))));
|
|
4940
8236
|
}
|
|
4941
8237
|
}]);
|
|
4942
8238
|
}(React__namespace.Component);
|
|
4943
8239
|
exports2.ChatAIDraft = ChatAIDraft;
|
|
8240
|
+
exports2.CountryFlag = CountryFlag;
|
|
4944
8241
|
exports2.LoadingCircular = LoadingCircular;
|
|
4945
8242
|
exports2.LoadingContainer = LoadingContainer;
|
|
4946
8243
|
exports2.Tooltip = Tooltip;
|