joytalk 0.0.38 → 0.0.40
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 +108 -78
- package/dist/index.cjs.js +6 -6
- package/dist/index.es.js +517 -504
- package/dist/index.umd.js +6 -6
- package/dist/lib/index.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
function
|
|
1
|
+
function it(e, t) {
|
|
2
2
|
return function() {
|
|
3
3
|
return e.apply(t, arguments);
|
|
4
4
|
};
|
|
5
5
|
}
|
|
6
|
-
const { toString:
|
|
7
|
-
const n =
|
|
6
|
+
const { toString: It } = Object.prototype, { getPrototypeOf: Le } = Object, { iterator: Ee, toStringTag: at } = Symbol, Se = /* @__PURE__ */ ((e) => (t) => {
|
|
7
|
+
const n = It.call(t);
|
|
8
8
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
9
|
-
})(/* @__PURE__ */ Object.create(null)), x = (e) => (e = e.toLowerCase(), (t) =>
|
|
10
|
-
function
|
|
11
|
-
return e !== null && !
|
|
9
|
+
})(/* @__PURE__ */ Object.create(null)), x = (e) => (e = e.toLowerCase(), (t) => Se(t) === e), Te = (e) => (t) => typeof t === e, { isArray: Z } = Array, Q = Te("undefined");
|
|
10
|
+
function re(e) {
|
|
11
|
+
return e !== null && !Q(e) && e.constructor !== null && !Q(e.constructor) && _(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
12
12
|
}
|
|
13
|
-
const
|
|
14
|
-
function
|
|
13
|
+
const ct = x("ArrayBuffer");
|
|
14
|
+
function Lt(e) {
|
|
15
15
|
let t;
|
|
16
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer &&
|
|
16
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && ct(e.buffer), t;
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
18
|
+
const Ft = Te("string"), _ = Te("function"), lt = Te("number"), se = (e) => e !== null && typeof e == "object", Pt = (e) => e === !0 || e === !1, fe = (e) => {
|
|
19
|
+
if (Se(e) !== "object")
|
|
20
20
|
return !1;
|
|
21
|
-
const t =
|
|
22
|
-
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(
|
|
23
|
-
},
|
|
24
|
-
if (!
|
|
21
|
+
const t = Le(e);
|
|
22
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(at in e) && !(Ee in e);
|
|
23
|
+
}, xt = (e) => {
|
|
24
|
+
if (!se(e) || re(e))
|
|
25
25
|
return !1;
|
|
26
26
|
try {
|
|
27
27
|
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
|
|
28
28
|
} catch {
|
|
29
29
|
return !1;
|
|
30
30
|
}
|
|
31
|
-
},
|
|
31
|
+
}, Bt = x("Date"), kt = x("File"), vt = x("Blob"), Ht = x("FileList"), jt = (e) => se(e) && _(e.pipe), Mt = (e) => {
|
|
32
32
|
let t;
|
|
33
|
-
return e && (typeof FormData == "function" && e instanceof FormData || _(e.append) && ((t =
|
|
33
|
+
return e && (typeof FormData == "function" && e instanceof FormData || _(e.append) && ((t = Se(e)) === "formdata" || // detect form-data instance
|
|
34
34
|
t === "object" && _(e.toString) && e.toString() === "[object FormData]"));
|
|
35
|
-
},
|
|
36
|
-
function
|
|
35
|
+
}, $t = x("URLSearchParams"), [qt, Gt, zt, Jt] = ["ReadableStream", "Request", "Response", "Headers"].map(x), Vt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
36
|
+
function oe(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
37
37
|
if (e === null || typeof e > "u")
|
|
38
38
|
return;
|
|
39
39
|
let r, s;
|
|
40
|
-
if (typeof e != "object" && (e = [e]),
|
|
40
|
+
if (typeof e != "object" && (e = [e]), Z(e))
|
|
41
41
|
for (r = 0, s = e.length; r < s; r++)
|
|
42
42
|
t.call(null, e[r], r, e);
|
|
43
43
|
else {
|
|
44
|
-
if (
|
|
44
|
+
if (re(e))
|
|
45
45
|
return;
|
|
46
46
|
const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
|
|
47
47
|
let c;
|
|
@@ -49,8 +49,8 @@ function se(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
49
49
|
c = o[r], t.call(null, e[c], c, e);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
if (
|
|
52
|
+
function ut(e, t) {
|
|
53
|
+
if (re(e))
|
|
54
54
|
return null;
|
|
55
55
|
t = t.toLowerCase();
|
|
56
56
|
const n = Object.keys(e);
|
|
@@ -60,71 +60,71 @@ function lt(e, t) {
|
|
|
60
60
|
return s;
|
|
61
61
|
return null;
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const J = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, ft = (e) => !Q(e) && e !== J;
|
|
64
64
|
function Oe() {
|
|
65
|
-
const { caseless: e, skipUndefined: t } =
|
|
66
|
-
const i = e &&
|
|
67
|
-
|
|
65
|
+
const { caseless: e, skipUndefined: t } = ft(this) && this || {}, n = {}, r = (s, o) => {
|
|
66
|
+
const i = e && ut(n, o) || o;
|
|
67
|
+
fe(n[i]) && fe(s) ? n[i] = Oe(n[i], s) : fe(s) ? n[i] = Oe({}, s) : Z(s) ? n[i] = s.slice() : (!t || !Q(s)) && (n[i] = s);
|
|
68
68
|
};
|
|
69
69
|
for (let s = 0, o = arguments.length; s < o; s++)
|
|
70
|
-
arguments[s] &&
|
|
70
|
+
arguments[s] && oe(arguments[s], r);
|
|
71
71
|
return n;
|
|
72
72
|
}
|
|
73
|
-
const Wt = (e, t, n, { allOwnKeys: r } = {}) => (
|
|
74
|
-
n && _(s) ? e[o] =
|
|
75
|
-
}, { allOwnKeys: r }), e),
|
|
73
|
+
const Wt = (e, t, n, { allOwnKeys: r } = {}) => (oe(t, (s, o) => {
|
|
74
|
+
n && _(s) ? e[o] = it(s, n) : e[o] = s;
|
|
75
|
+
}, { allOwnKeys: r }), e), Kt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Xt = (e, t, n, r) => {
|
|
76
76
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
77
77
|
value: t.prototype
|
|
78
78
|
}), n && Object.assign(e.prototype, n);
|
|
79
|
-
},
|
|
79
|
+
}, Yt = (e, t, n, r) => {
|
|
80
80
|
let s, o, i;
|
|
81
81
|
const c = {};
|
|
82
82
|
if (t = t || {}, e == null) return t;
|
|
83
83
|
do {
|
|
84
84
|
for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
|
|
85
85
|
i = s[o], (!r || r(i, e, t)) && !c[i] && (t[i] = e[i], c[i] = !0);
|
|
86
|
-
e = n !== !1 &&
|
|
86
|
+
e = n !== !1 && Le(e);
|
|
87
87
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
88
88
|
return t;
|
|
89
|
-
},
|
|
89
|
+
}, Qt = (e, t, n) => {
|
|
90
90
|
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
91
91
|
const r = e.indexOf(t, n);
|
|
92
92
|
return r !== -1 && r === n;
|
|
93
|
-
},
|
|
93
|
+
}, Zt = (e) => {
|
|
94
94
|
if (!e) return null;
|
|
95
|
-
if (
|
|
95
|
+
if (Z(e)) return e;
|
|
96
96
|
let t = e.length;
|
|
97
|
-
if (!
|
|
97
|
+
if (!lt(t)) return null;
|
|
98
98
|
const n = new Array(t);
|
|
99
99
|
for (; t-- > 0; )
|
|
100
100
|
n[t] = e[t];
|
|
101
101
|
return n;
|
|
102
|
-
},
|
|
103
|
-
const r = (e && e[
|
|
102
|
+
}, en = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Le(Uint8Array)), tn = (e, t) => {
|
|
103
|
+
const r = (e && e[Ee]).call(e);
|
|
104
104
|
let s;
|
|
105
105
|
for (; (s = r.next()) && !s.done; ) {
|
|
106
106
|
const o = s.value;
|
|
107
107
|
t.call(e, o[0], o[1]);
|
|
108
108
|
}
|
|
109
|
-
},
|
|
109
|
+
}, nn = (e, t) => {
|
|
110
110
|
let n;
|
|
111
111
|
const r = [];
|
|
112
112
|
for (; (n = e.exec(t)) !== null; )
|
|
113
113
|
r.push(n);
|
|
114
114
|
return r;
|
|
115
|
-
},
|
|
115
|
+
}, rn = x("HTMLFormElement"), sn = (e) => e.toLowerCase().replace(
|
|
116
116
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
117
117
|
function(n, r, s) {
|
|
118
118
|
return r.toUpperCase() + s;
|
|
119
119
|
}
|
|
120
|
-
),
|
|
120
|
+
), qe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), on = x("RegExp"), dt = (e, t) => {
|
|
121
121
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
122
|
-
|
|
122
|
+
oe(n, (s, o) => {
|
|
123
123
|
let i;
|
|
124
124
|
(i = t(s, o, e)) !== !1 && (r[o] = i || s);
|
|
125
125
|
}), Object.defineProperties(e, r);
|
|
126
|
-
},
|
|
127
|
-
|
|
126
|
+
}, an = (e) => {
|
|
127
|
+
dt(e, (t, n) => {
|
|
128
128
|
if (_(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
129
129
|
return !1;
|
|
130
130
|
const r = e[n];
|
|
@@ -138,103 +138,103 @@ const Wt = (e, t, n, { allOwnKeys: r } = {}) => (se(t, (s, o) => {
|
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
|
-
},
|
|
141
|
+
}, cn = (e, t) => {
|
|
142
142
|
const n = {}, r = (s) => {
|
|
143
143
|
s.forEach((o) => {
|
|
144
144
|
n[o] = !0;
|
|
145
145
|
});
|
|
146
146
|
};
|
|
147
|
-
return
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
function
|
|
151
|
-
return !!(e && _(e.append) && e[
|
|
147
|
+
return Z(e) ? r(e) : r(String(e).split(t)), n;
|
|
148
|
+
}, ln = () => {
|
|
149
|
+
}, un = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
150
|
+
function fn(e) {
|
|
151
|
+
return !!(e && _(e.append) && e[at] === "FormData" && e[Ee]);
|
|
152
152
|
}
|
|
153
|
-
const
|
|
153
|
+
const dn = (e) => {
|
|
154
154
|
const t = new Array(10), n = (r, s) => {
|
|
155
|
-
if (
|
|
155
|
+
if (se(r)) {
|
|
156
156
|
if (t.indexOf(r) >= 0)
|
|
157
157
|
return;
|
|
158
|
-
if (
|
|
158
|
+
if (re(r))
|
|
159
159
|
return r;
|
|
160
160
|
if (!("toJSON" in r)) {
|
|
161
161
|
t[s] = r;
|
|
162
|
-
const o =
|
|
163
|
-
return
|
|
162
|
+
const o = Z(r) ? [] : {};
|
|
163
|
+
return oe(r, (i, c) => {
|
|
164
164
|
const d = n(i, s + 1);
|
|
165
|
-
!
|
|
165
|
+
!Q(d) && (o[c] = d);
|
|
166
166
|
}), t[s] = void 0, o;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
return r;
|
|
170
170
|
};
|
|
171
171
|
return n(e, 0);
|
|
172
|
-
},
|
|
173
|
-
s ===
|
|
172
|
+
}, hn = x("AsyncFunction"), pn = (e) => e && (se(e) || _(e)) && _(e.then) && _(e.catch), ht = ((e, t) => e ? setImmediate : t ? ((n, r) => (J.addEventListener("message", ({ source: s, data: o }) => {
|
|
173
|
+
s === J && o === n && r.length && r.shift()();
|
|
174
174
|
}, !1), (s) => {
|
|
175
|
-
r.push(s),
|
|
175
|
+
r.push(s), J.postMessage(n, "*");
|
|
176
176
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
177
177
|
typeof setImmediate == "function",
|
|
178
|
-
_(
|
|
179
|
-
),
|
|
180
|
-
isArray:
|
|
181
|
-
isArrayBuffer:
|
|
182
|
-
isBuffer:
|
|
183
|
-
isFormData:
|
|
184
|
-
isArrayBufferView:
|
|
185
|
-
isString:
|
|
186
|
-
isNumber:
|
|
187
|
-
isBoolean:
|
|
188
|
-
isObject:
|
|
189
|
-
isPlainObject:
|
|
190
|
-
isEmptyObject:
|
|
191
|
-
isReadableStream:
|
|
192
|
-
isRequest:
|
|
193
|
-
isResponse:
|
|
194
|
-
isHeaders:
|
|
195
|
-
isUndefined:
|
|
196
|
-
isDate:
|
|
197
|
-
isFile:
|
|
198
|
-
isBlob:
|
|
199
|
-
isRegExp:
|
|
178
|
+
_(J.postMessage)
|
|
179
|
+
), mn = typeof queueMicrotask < "u" ? queueMicrotask.bind(J) : typeof process < "u" && process.nextTick || ht, En = (e) => e != null && _(e[Ee]), a = {
|
|
180
|
+
isArray: Z,
|
|
181
|
+
isArrayBuffer: ct,
|
|
182
|
+
isBuffer: re,
|
|
183
|
+
isFormData: Mt,
|
|
184
|
+
isArrayBufferView: Lt,
|
|
185
|
+
isString: Ft,
|
|
186
|
+
isNumber: lt,
|
|
187
|
+
isBoolean: Pt,
|
|
188
|
+
isObject: se,
|
|
189
|
+
isPlainObject: fe,
|
|
190
|
+
isEmptyObject: xt,
|
|
191
|
+
isReadableStream: qt,
|
|
192
|
+
isRequest: Gt,
|
|
193
|
+
isResponse: zt,
|
|
194
|
+
isHeaders: Jt,
|
|
195
|
+
isUndefined: Q,
|
|
196
|
+
isDate: Bt,
|
|
197
|
+
isFile: kt,
|
|
198
|
+
isBlob: vt,
|
|
199
|
+
isRegExp: on,
|
|
200
200
|
isFunction: _,
|
|
201
|
-
isStream:
|
|
202
|
-
isURLSearchParams:
|
|
203
|
-
isTypedArray:
|
|
201
|
+
isStream: jt,
|
|
202
|
+
isURLSearchParams: $t,
|
|
203
|
+
isTypedArray: en,
|
|
204
204
|
isFileList: Ht,
|
|
205
|
-
forEach:
|
|
205
|
+
forEach: oe,
|
|
206
206
|
merge: Oe,
|
|
207
207
|
extend: Wt,
|
|
208
|
-
trim:
|
|
209
|
-
stripBOM:
|
|
210
|
-
inherits:
|
|
211
|
-
toFlatObject:
|
|
212
|
-
kindOf:
|
|
208
|
+
trim: Vt,
|
|
209
|
+
stripBOM: Kt,
|
|
210
|
+
inherits: Xt,
|
|
211
|
+
toFlatObject: Yt,
|
|
212
|
+
kindOf: Se,
|
|
213
213
|
kindOfTest: x,
|
|
214
|
-
endsWith:
|
|
215
|
-
toArray:
|
|
216
|
-
forEachEntry:
|
|
217
|
-
matchAll:
|
|
218
|
-
isHTMLForm:
|
|
219
|
-
hasOwnProperty:
|
|
220
|
-
hasOwnProp:
|
|
214
|
+
endsWith: Qt,
|
|
215
|
+
toArray: Zt,
|
|
216
|
+
forEachEntry: tn,
|
|
217
|
+
matchAll: nn,
|
|
218
|
+
isHTMLForm: rn,
|
|
219
|
+
hasOwnProperty: qe,
|
|
220
|
+
hasOwnProp: qe,
|
|
221
221
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
222
|
-
reduceDescriptors:
|
|
223
|
-
freezeMethods:
|
|
224
|
-
toObjectSet:
|
|
225
|
-
toCamelCase:
|
|
226
|
-
noop:
|
|
227
|
-
toFiniteNumber:
|
|
228
|
-
findKey:
|
|
229
|
-
global:
|
|
230
|
-
isContextDefined:
|
|
231
|
-
isSpecCompliantForm:
|
|
232
|
-
toJSONObject:
|
|
233
|
-
isAsyncFn:
|
|
234
|
-
isThenable:
|
|
235
|
-
setImmediate:
|
|
236
|
-
asap:
|
|
237
|
-
isIterable:
|
|
222
|
+
reduceDescriptors: dt,
|
|
223
|
+
freezeMethods: an,
|
|
224
|
+
toObjectSet: cn,
|
|
225
|
+
toCamelCase: sn,
|
|
226
|
+
noop: ln,
|
|
227
|
+
toFiniteNumber: un,
|
|
228
|
+
findKey: ut,
|
|
229
|
+
global: J,
|
|
230
|
+
isContextDefined: ft,
|
|
231
|
+
isSpecCompliantForm: fn,
|
|
232
|
+
toJSONObject: dn,
|
|
233
|
+
isAsyncFn: hn,
|
|
234
|
+
isThenable: pn,
|
|
235
|
+
setImmediate: ht,
|
|
236
|
+
asap: mn,
|
|
237
|
+
isIterable: En
|
|
238
238
|
};
|
|
239
239
|
function E(e, t, n, r, s) {
|
|
240
240
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), s && (this.response = s, this.status = s.status ? s.status : null);
|
|
@@ -260,7 +260,7 @@ a.inherits(E, Error, {
|
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
262
|
});
|
|
263
|
-
const
|
|
263
|
+
const pt = E.prototype, mt = {};
|
|
264
264
|
[
|
|
265
265
|
"ERR_BAD_OPTION_VALUE",
|
|
266
266
|
"ERR_BAD_OPTION",
|
|
@@ -276,37 +276,37 @@ const ht = E.prototype, pt = {};
|
|
|
276
276
|
"ERR_INVALID_URL"
|
|
277
277
|
// eslint-disable-next-line func-names
|
|
278
278
|
].forEach((e) => {
|
|
279
|
-
|
|
279
|
+
mt[e] = { value: e };
|
|
280
280
|
});
|
|
281
|
-
Object.defineProperties(E,
|
|
282
|
-
Object.defineProperty(
|
|
281
|
+
Object.defineProperties(E, mt);
|
|
282
|
+
Object.defineProperty(pt, "isAxiosError", { value: !0 });
|
|
283
283
|
E.from = (e, t, n, r, s, o) => {
|
|
284
|
-
const i = Object.create(
|
|
284
|
+
const i = Object.create(pt);
|
|
285
285
|
a.toFlatObject(e, i, function(l) {
|
|
286
286
|
return l !== Error.prototype;
|
|
287
287
|
}, (u) => u !== "isAxiosError");
|
|
288
288
|
const c = e && e.message ? e.message : "Error", d = t == null && e ? e.code : t;
|
|
289
289
|
return E.call(i, c, d, n, r, s), e && i.cause == null && Object.defineProperty(i, "cause", { value: e, configurable: !0 }), i.name = e && e.name || "Error", o && Object.assign(i, o), i;
|
|
290
290
|
};
|
|
291
|
-
const
|
|
292
|
-
function
|
|
291
|
+
const Sn = null;
|
|
292
|
+
function Ce(e) {
|
|
293
293
|
return a.isPlainObject(e) || a.isArray(e);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function Et(e) {
|
|
296
296
|
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function Ge(e, t, n) {
|
|
299
299
|
return e ? e.concat(t).map(function(s, o) {
|
|
300
|
-
return s =
|
|
300
|
+
return s = Et(s), !n && o ? "[" + s + "]" : s;
|
|
301
301
|
}).join(n ? "." : "") : t;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
return a.isArray(e) && !e.some(
|
|
303
|
+
function Tn(e) {
|
|
304
|
+
return a.isArray(e) && !e.some(Ce);
|
|
305
305
|
}
|
|
306
|
-
const
|
|
306
|
+
const wn = a.toFlatObject(a, {}, null, function(t) {
|
|
307
307
|
return /^is[A-Z]/.test(t);
|
|
308
308
|
});
|
|
309
|
-
function
|
|
309
|
+
function we(e, t, n) {
|
|
310
310
|
if (!a.isObject(e))
|
|
311
311
|
throw new TypeError("target must be an object");
|
|
312
312
|
t = t || new FormData(), n = a.toFlatObject(n, {
|
|
@@ -334,21 +334,21 @@ function Te(e, t, n) {
|
|
|
334
334
|
if (f && !p && typeof f == "object") {
|
|
335
335
|
if (a.endsWith(m, "{}"))
|
|
336
336
|
m = r ? m : m.slice(0, -2), f = JSON.stringify(f);
|
|
337
|
-
else if (a.isArray(f) &&
|
|
338
|
-
return m =
|
|
337
|
+
else if (a.isArray(f) && Tn(f) || (a.isFileList(f) || a.endsWith(m, "[]")) && (R = a.toArray(f)))
|
|
338
|
+
return m = Et(m), R.forEach(function(y, C) {
|
|
339
339
|
!(a.isUndefined(y) || y === null) && t.append(
|
|
340
340
|
// eslint-disable-next-line no-nested-ternary
|
|
341
|
-
i === !0 ?
|
|
341
|
+
i === !0 ? Ge([m], C, o) : i === null ? m : m + "[]",
|
|
342
342
|
u(y)
|
|
343
343
|
);
|
|
344
344
|
}), !1;
|
|
345
345
|
}
|
|
346
|
-
return
|
|
346
|
+
return Ce(f) ? !0 : (t.append(Ge(p, m, o), u(f)), !1);
|
|
347
347
|
}
|
|
348
|
-
const h = [], S = Object.assign(
|
|
348
|
+
const h = [], S = Object.assign(wn, {
|
|
349
349
|
defaultVisitor: l,
|
|
350
350
|
convertValue: u,
|
|
351
|
-
isVisitable:
|
|
351
|
+
isVisitable: Ce
|
|
352
352
|
});
|
|
353
353
|
function w(f, m) {
|
|
354
354
|
if (!a.isUndefined(f)) {
|
|
@@ -369,7 +369,7 @@ function Te(e, t, n) {
|
|
|
369
369
|
throw new TypeError("data must be an object");
|
|
370
370
|
return w(e), t;
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function ze(e) {
|
|
373
373
|
const t = {
|
|
374
374
|
"!": "%21",
|
|
375
375
|
"'": "%27",
|
|
@@ -383,40 +383,40 @@ function Ge(e) {
|
|
|
383
383
|
return t[r];
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
this._pairs = [], e &&
|
|
386
|
+
function Fe(e, t) {
|
|
387
|
+
this._pairs = [], e && we(e, this, t);
|
|
388
388
|
}
|
|
389
|
-
const
|
|
390
|
-
|
|
389
|
+
const St = Fe.prototype;
|
|
390
|
+
St.append = function(t, n) {
|
|
391
391
|
this._pairs.push([t, n]);
|
|
392
392
|
};
|
|
393
|
-
|
|
393
|
+
St.toString = function(t) {
|
|
394
394
|
const n = t ? function(r) {
|
|
395
|
-
return t.call(this, r,
|
|
396
|
-
} :
|
|
395
|
+
return t.call(this, r, ze);
|
|
396
|
+
} : ze;
|
|
397
397
|
return this._pairs.map(function(s) {
|
|
398
398
|
return n(s[0]) + "=" + n(s[1]);
|
|
399
399
|
}, "").join("&");
|
|
400
400
|
};
|
|
401
|
-
function
|
|
401
|
+
function Rn(e) {
|
|
402
402
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function Tt(e, t, n) {
|
|
405
405
|
if (!t)
|
|
406
406
|
return e;
|
|
407
|
-
const r = n && n.encode ||
|
|
407
|
+
const r = n && n.encode || Rn;
|
|
408
408
|
a.isFunction(n) && (n = {
|
|
409
409
|
serialize: n
|
|
410
410
|
});
|
|
411
411
|
const s = n && n.serialize;
|
|
412
412
|
let o;
|
|
413
|
-
if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new
|
|
413
|
+
if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new Fe(t, n).toString(r), o) {
|
|
414
414
|
const i = e.indexOf("#");
|
|
415
415
|
i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
|
|
416
416
|
}
|
|
417
417
|
return e;
|
|
418
418
|
}
|
|
419
|
-
class
|
|
419
|
+
class Je {
|
|
420
420
|
constructor() {
|
|
421
421
|
this.handlers = [];
|
|
422
422
|
}
|
|
@@ -470,42 +470,42 @@ class ze {
|
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
-
const
|
|
473
|
+
const wt = {
|
|
474
474
|
silentJSONParsing: !0,
|
|
475
475
|
forcedJSONParsing: !0,
|
|
476
476
|
clarifyTimeoutError: !1
|
|
477
|
-
},
|
|
477
|
+
}, yn = typeof URLSearchParams < "u" ? URLSearchParams : Fe, An = typeof FormData < "u" ? FormData : null, bn = typeof Blob < "u" ? Blob : null, gn = {
|
|
478
478
|
isBrowser: !0,
|
|
479
479
|
classes: {
|
|
480
|
-
URLSearchParams:
|
|
481
|
-
FormData:
|
|
482
|
-
Blob:
|
|
480
|
+
URLSearchParams: yn,
|
|
481
|
+
FormData: An,
|
|
482
|
+
Blob: bn
|
|
483
483
|
},
|
|
484
484
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
485
|
-
},
|
|
486
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function",
|
|
485
|
+
}, Pe = typeof window < "u" && typeof document < "u", Ue = typeof navigator == "object" && navigator || void 0, Nn = Pe && (!Ue || ["ReactNative", "NativeScript", "NS"].indexOf(Ue.product) < 0), On = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
486
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Cn = Pe && window.location.href || "http://localhost", Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
487
487
|
__proto__: null,
|
|
488
|
-
hasBrowserEnv:
|
|
488
|
+
hasBrowserEnv: Pe,
|
|
489
489
|
hasStandardBrowserEnv: Nn,
|
|
490
490
|
hasStandardBrowserWebWorkerEnv: On,
|
|
491
|
-
navigator:
|
|
492
|
-
origin:
|
|
493
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
494
|
-
...
|
|
495
|
-
...
|
|
491
|
+
navigator: Ue,
|
|
492
|
+
origin: Cn
|
|
493
|
+
}, Symbol.toStringTag, { value: "Module" })), N = {
|
|
494
|
+
...Un,
|
|
495
|
+
...gn
|
|
496
496
|
};
|
|
497
|
-
function
|
|
498
|
-
return
|
|
497
|
+
function _n(e, t) {
|
|
498
|
+
return we(e, new N.classes.URLSearchParams(), {
|
|
499
499
|
visitor: function(n, r, s, o) {
|
|
500
|
-
return
|
|
500
|
+
return N.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
501
501
|
},
|
|
502
502
|
...t
|
|
503
503
|
});
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function Dn(e) {
|
|
506
506
|
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function In(e) {
|
|
509
509
|
const t = {}, n = Object.keys(e);
|
|
510
510
|
let r;
|
|
511
511
|
const s = n.length;
|
|
@@ -514,22 +514,22 @@ function Dn(e) {
|
|
|
514
514
|
o = n[r], t[o] = e[o];
|
|
515
515
|
return t;
|
|
516
516
|
}
|
|
517
|
-
function
|
|
517
|
+
function Rt(e) {
|
|
518
518
|
function t(n, r, s, o) {
|
|
519
519
|
let i = n[o++];
|
|
520
520
|
if (i === "__proto__") return !0;
|
|
521
521
|
const c = Number.isFinite(+i), d = o >= n.length;
|
|
522
|
-
return i = !i && a.isArray(s) ? s.length : i, d ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] =
|
|
522
|
+
return i = !i && a.isArray(s) ? s.length : i, d ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = In(s[i])), !c);
|
|
523
523
|
}
|
|
524
524
|
if (a.isFormData(e) && a.isFunction(e.entries)) {
|
|
525
525
|
const n = {};
|
|
526
526
|
return a.forEachEntry(e, (r, s) => {
|
|
527
|
-
t(
|
|
527
|
+
t(Dn(r), s, n, 0);
|
|
528
528
|
}), n;
|
|
529
529
|
}
|
|
530
530
|
return null;
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function Ln(e, t, n) {
|
|
533
533
|
if (a.isString(e))
|
|
534
534
|
try {
|
|
535
535
|
return (t || JSON.parse)(e), a.trim(e);
|
|
@@ -539,13 +539,13 @@ function In(e, t, n) {
|
|
|
539
539
|
}
|
|
540
540
|
return (n || JSON.stringify)(e);
|
|
541
541
|
}
|
|
542
|
-
const
|
|
543
|
-
transitional:
|
|
542
|
+
const ie = {
|
|
543
|
+
transitional: wt,
|
|
544
544
|
adapter: ["xhr", "http", "fetch"],
|
|
545
545
|
transformRequest: [function(t, n) {
|
|
546
546
|
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = a.isObject(t);
|
|
547
547
|
if (o && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
|
|
548
|
-
return s ? JSON.stringify(
|
|
548
|
+
return s ? JSON.stringify(Rt(t)) : t;
|
|
549
549
|
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
|
|
550
550
|
return t;
|
|
551
551
|
if (a.isArrayBufferView(t))
|
|
@@ -555,20 +555,20 @@ const oe = {
|
|
|
555
555
|
let c;
|
|
556
556
|
if (o) {
|
|
557
557
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
558
|
-
return
|
|
558
|
+
return _n(t, this.formSerializer).toString();
|
|
559
559
|
if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
560
560
|
const d = this.env && this.env.FormData;
|
|
561
|
-
return
|
|
561
|
+
return we(
|
|
562
562
|
c ? { "files[]": t } : t,
|
|
563
563
|
d && new d(),
|
|
564
564
|
this.formSerializer
|
|
565
565
|
);
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
return o || s ? (n.setContentType("application/json", !1),
|
|
568
|
+
return o || s ? (n.setContentType("application/json", !1), Ln(t)) : t;
|
|
569
569
|
}],
|
|
570
570
|
transformResponse: [function(t) {
|
|
571
|
-
const n = this.transitional ||
|
|
571
|
+
const n = this.transitional || ie.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
|
|
572
572
|
if (a.isResponse(t) || a.isReadableStream(t))
|
|
573
573
|
return t;
|
|
574
574
|
if (t && a.isString(t) && (r && !this.responseType || s)) {
|
|
@@ -592,8 +592,8 @@ const oe = {
|
|
|
592
592
|
maxContentLength: -1,
|
|
593
593
|
maxBodyLength: -1,
|
|
594
594
|
env: {
|
|
595
|
-
FormData:
|
|
596
|
-
Blob:
|
|
595
|
+
FormData: N.classes.FormData,
|
|
596
|
+
Blob: N.classes.Blob
|
|
597
597
|
},
|
|
598
598
|
validateStatus: function(t) {
|
|
599
599
|
return t >= 200 && t < 300;
|
|
@@ -606,9 +606,9 @@ const oe = {
|
|
|
606
606
|
}
|
|
607
607
|
};
|
|
608
608
|
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
609
|
-
|
|
609
|
+
ie.headers[e] = {};
|
|
610
610
|
});
|
|
611
|
-
const
|
|
611
|
+
const Fn = a.toObjectSet([
|
|
612
612
|
"age",
|
|
613
613
|
"authorization",
|
|
614
614
|
"content-length",
|
|
@@ -626,29 +626,29 @@ const Ln = a.toObjectSet([
|
|
|
626
626
|
"referer",
|
|
627
627
|
"retry-after",
|
|
628
628
|
"user-agent"
|
|
629
|
-
]),
|
|
629
|
+
]), Pn = (e) => {
|
|
630
630
|
const t = {};
|
|
631
631
|
let n, r, s;
|
|
632
632
|
return e && e.split(`
|
|
633
633
|
`).forEach(function(i) {
|
|
634
|
-
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] &&
|
|
634
|
+
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && Fn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
635
635
|
}), t;
|
|
636
|
-
},
|
|
637
|
-
function
|
|
636
|
+
}, Ve = Symbol("internals");
|
|
637
|
+
function ne(e) {
|
|
638
638
|
return e && String(e).trim().toLowerCase();
|
|
639
639
|
}
|
|
640
|
-
function
|
|
641
|
-
return e === !1 || e == null ? e : a.isArray(e) ? e.map(
|
|
640
|
+
function de(e) {
|
|
641
|
+
return e === !1 || e == null ? e : a.isArray(e) ? e.map(de) : String(e);
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function xn(e) {
|
|
644
644
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
645
645
|
let r;
|
|
646
646
|
for (; r = n.exec(e); )
|
|
647
647
|
t[r[1]] = r[2];
|
|
648
648
|
return t;
|
|
649
649
|
}
|
|
650
|
-
const
|
|
651
|
-
function
|
|
650
|
+
const Bn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
651
|
+
function be(e, t, n, r, s) {
|
|
652
652
|
if (a.isFunction(r))
|
|
653
653
|
return r.call(this, t, n);
|
|
654
654
|
if (s && (t = n), !!a.isString(t)) {
|
|
@@ -658,10 +658,10 @@ function Ae(e, t, n, r, s) {
|
|
|
658
658
|
return r.test(t);
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function kn(e) {
|
|
662
662
|
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function vn(e, t) {
|
|
665
665
|
const n = a.toCamelCase(" " + t);
|
|
666
666
|
["get", "set", "has"].forEach((r) => {
|
|
667
667
|
Object.defineProperty(e, r + n, {
|
|
@@ -679,17 +679,17 @@ let D = class {
|
|
|
679
679
|
set(t, n, r) {
|
|
680
680
|
const s = this;
|
|
681
681
|
function o(c, d, u) {
|
|
682
|
-
const l =
|
|
682
|
+
const l = ne(d);
|
|
683
683
|
if (!l)
|
|
684
684
|
throw new Error("header name must be a non-empty string");
|
|
685
685
|
const h = a.findKey(s, l);
|
|
686
|
-
(!h || s[h] === void 0 || u === !0 || u === void 0 && s[h] !== !1) && (s[h || d] =
|
|
686
|
+
(!h || s[h] === void 0 || u === !0 || u === void 0 && s[h] !== !1) && (s[h || d] = de(c));
|
|
687
687
|
}
|
|
688
688
|
const i = (c, d) => a.forEach(c, (u, l) => o(u, l, d));
|
|
689
689
|
if (a.isPlainObject(t) || t instanceof this.constructor)
|
|
690
690
|
i(t, n);
|
|
691
|
-
else if (a.isString(t) && (t = t.trim()) && !
|
|
692
|
-
i(
|
|
691
|
+
else if (a.isString(t) && (t = t.trim()) && !Bn(t))
|
|
692
|
+
i(Pn(t), n);
|
|
693
693
|
else if (a.isObject(t) && a.isIterable(t)) {
|
|
694
694
|
let c = {}, d, u;
|
|
695
695
|
for (const l of t) {
|
|
@@ -703,14 +703,14 @@ let D = class {
|
|
|
703
703
|
return this;
|
|
704
704
|
}
|
|
705
705
|
get(t, n) {
|
|
706
|
-
if (t =
|
|
706
|
+
if (t = ne(t), t) {
|
|
707
707
|
const r = a.findKey(this, t);
|
|
708
708
|
if (r) {
|
|
709
709
|
const s = this[r];
|
|
710
710
|
if (!n)
|
|
711
711
|
return s;
|
|
712
712
|
if (n === !0)
|
|
713
|
-
return
|
|
713
|
+
return xn(s);
|
|
714
714
|
if (a.isFunction(n))
|
|
715
715
|
return n.call(this, s, r);
|
|
716
716
|
if (a.isRegExp(n))
|
|
@@ -720,9 +720,9 @@ let D = class {
|
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
722
|
has(t, n) {
|
|
723
|
-
if (t =
|
|
723
|
+
if (t = ne(t), t) {
|
|
724
724
|
const r = a.findKey(this, t);
|
|
725
|
-
return !!(r && this[r] !== void 0 && (!n ||
|
|
725
|
+
return !!(r && this[r] !== void 0 && (!n || be(this, this[r], r, n)));
|
|
726
726
|
}
|
|
727
727
|
return !1;
|
|
728
728
|
}
|
|
@@ -730,9 +730,9 @@ let D = class {
|
|
|
730
730
|
const r = this;
|
|
731
731
|
let s = !1;
|
|
732
732
|
function o(i) {
|
|
733
|
-
if (i =
|
|
733
|
+
if (i = ne(i), i) {
|
|
734
734
|
const c = a.findKey(r, i);
|
|
735
|
-
c && (!n ||
|
|
735
|
+
c && (!n || be(r, r[c], c, n)) && (delete r[c], s = !0);
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
738
|
return a.isArray(t) ? t.forEach(o) : o(t), s;
|
|
@@ -742,7 +742,7 @@ let D = class {
|
|
|
742
742
|
let r = n.length, s = !1;
|
|
743
743
|
for (; r--; ) {
|
|
744
744
|
const o = n[r];
|
|
745
|
-
(!t ||
|
|
745
|
+
(!t || be(this, this[o], o, t, !0)) && (delete this[o], s = !0);
|
|
746
746
|
}
|
|
747
747
|
return s;
|
|
748
748
|
}
|
|
@@ -751,11 +751,11 @@ let D = class {
|
|
|
751
751
|
return a.forEach(this, (s, o) => {
|
|
752
752
|
const i = a.findKey(r, o);
|
|
753
753
|
if (i) {
|
|
754
|
-
n[i] =
|
|
754
|
+
n[i] = de(s), delete n[o];
|
|
755
755
|
return;
|
|
756
756
|
}
|
|
757
|
-
const c = t ?
|
|
758
|
-
c !== o && delete n[o], n[c] =
|
|
757
|
+
const c = t ? kn(o) : String(o).trim();
|
|
758
|
+
c !== o && delete n[o], n[c] = de(s), r[c] = !0;
|
|
759
759
|
}), this;
|
|
760
760
|
}
|
|
761
761
|
concat(...t) {
|
|
@@ -788,12 +788,12 @@ let D = class {
|
|
|
788
788
|
return n.forEach((s) => r.set(s)), r;
|
|
789
789
|
}
|
|
790
790
|
static accessor(t) {
|
|
791
|
-
const r = (this[
|
|
791
|
+
const r = (this[Ve] = this[Ve] = {
|
|
792
792
|
accessors: {}
|
|
793
793
|
}).accessors, s = this.prototype;
|
|
794
794
|
function o(i) {
|
|
795
|
-
const c =
|
|
796
|
-
r[c] || (
|
|
795
|
+
const c = ne(i);
|
|
796
|
+
r[c] || (vn(s, i), r[c] = !0);
|
|
797
797
|
}
|
|
798
798
|
return a.isArray(t) ? t.forEach(o) : o(t), this;
|
|
799
799
|
}
|
|
@@ -809,23 +809,23 @@ a.reduceDescriptors(D.prototype, ({ value: e }, t) => {
|
|
|
809
809
|
};
|
|
810
810
|
});
|
|
811
811
|
a.freezeMethods(D);
|
|
812
|
-
function
|
|
813
|
-
const n = this ||
|
|
812
|
+
function ge(e, t) {
|
|
813
|
+
const n = this || ie, r = t || n, s = D.from(r.headers);
|
|
814
814
|
let o = r.data;
|
|
815
815
|
return a.forEach(e, function(c) {
|
|
816
816
|
o = c.call(n, o, s.normalize(), t ? t.status : void 0);
|
|
817
817
|
}), s.normalize(), o;
|
|
818
818
|
}
|
|
819
|
-
function
|
|
819
|
+
function yt(e) {
|
|
820
820
|
return !!(e && e.__CANCEL__);
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function ee(e, t, n) {
|
|
823
823
|
E.call(this, e ?? "canceled", E.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
824
824
|
}
|
|
825
|
-
a.inherits(
|
|
825
|
+
a.inherits(ee, E, {
|
|
826
826
|
__CANCEL__: !0
|
|
827
827
|
});
|
|
828
|
-
function
|
|
828
|
+
function At(e, t, n) {
|
|
829
829
|
const r = n.config.validateStatus;
|
|
830
830
|
!n.status || !r || r(n.status) ? e(n) : t(new E(
|
|
831
831
|
"Request failed with status code " + n.status,
|
|
@@ -839,7 +839,7 @@ function Hn(e) {
|
|
|
839
839
|
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
840
840
|
return t && t[1] || "";
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function jn(e, t) {
|
|
843
843
|
e = e || 10;
|
|
844
844
|
const n = new Array(e), r = new Array(e);
|
|
845
845
|
let s = 0, o = 0, i;
|
|
@@ -855,7 +855,7 @@ function vn(e, t) {
|
|
|
855
855
|
return w ? Math.round(S * 1e3 / w) : void 0;
|
|
856
856
|
};
|
|
857
857
|
}
|
|
858
|
-
function
|
|
858
|
+
function Mn(e, t) {
|
|
859
859
|
let n = 0, r = 1e3 / t, s, o;
|
|
860
860
|
const i = (u, l = Date.now()) => {
|
|
861
861
|
n = l, s = null, o && (clearTimeout(o), o = null), e(...u);
|
|
@@ -867,10 +867,10 @@ function jn(e, t) {
|
|
|
867
867
|
}, r - h)));
|
|
868
868
|
}, () => s && i(s)];
|
|
869
869
|
}
|
|
870
|
-
const
|
|
870
|
+
const pe = (e, t, n = 3) => {
|
|
871
871
|
let r = 0;
|
|
872
|
-
const s =
|
|
873
|
-
return
|
|
872
|
+
const s = jn(50, 250);
|
|
873
|
+
return Mn((o) => {
|
|
874
874
|
const i = o.loaded, c = o.lengthComputable ? o.total : void 0, d = i - r, u = s(d), l = i <= c;
|
|
875
875
|
r = i;
|
|
876
876
|
const h = {
|
|
@@ -893,10 +893,10 @@ const he = (e, t, n = 3) => {
|
|
|
893
893
|
total: e,
|
|
894
894
|
loaded: r
|
|
895
895
|
}), t[1]];
|
|
896
|
-
},
|
|
897
|
-
new URL(
|
|
898
|
-
|
|
899
|
-
) : () => !0,
|
|
896
|
+
}, Ke = (e) => (...t) => a.asap(() => e(...t)), $n = N.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, N.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
897
|
+
new URL(N.origin),
|
|
898
|
+
N.navigator && /(msie|trident)/i.test(N.navigator.userAgent)
|
|
899
|
+
) : () => !0, qn = N.hasStandardBrowserEnv ? (
|
|
900
900
|
// Standard browser envs support document.cookie
|
|
901
901
|
{
|
|
902
902
|
write(e, t, n, r, s, o, i) {
|
|
@@ -925,17 +925,17 @@ const he = (e, t, n = 3) => {
|
|
|
925
925
|
}
|
|
926
926
|
}
|
|
927
927
|
);
|
|
928
|
-
function
|
|
928
|
+
function Gn(e) {
|
|
929
929
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function zn(e, t) {
|
|
932
932
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
933
933
|
}
|
|
934
|
-
function
|
|
935
|
-
let r = !
|
|
936
|
-
return e && (r || n == !1) ?
|
|
934
|
+
function bt(e, t, n) {
|
|
935
|
+
let r = !Gn(t);
|
|
936
|
+
return e && (r || n == !1) ? zn(e, t) : t;
|
|
937
937
|
}
|
|
938
|
-
const
|
|
938
|
+
const Xe = (e) => e instanceof D ? { ...e } : e;
|
|
939
939
|
function W(e, t) {
|
|
940
940
|
t = t || {};
|
|
941
941
|
const n = {};
|
|
@@ -993,21 +993,21 @@ function W(e, t) {
|
|
|
993
993
|
socketPath: i,
|
|
994
994
|
responseEncoding: i,
|
|
995
995
|
validateStatus: c,
|
|
996
|
-
headers: (u, l, h) => s(
|
|
996
|
+
headers: (u, l, h) => s(Xe(u), Xe(l), h, !0)
|
|
997
997
|
};
|
|
998
998
|
return a.forEach(Object.keys({ ...e, ...t }), function(l) {
|
|
999
999
|
const h = d[l] || s, S = h(e[l], t[l], l);
|
|
1000
1000
|
a.isUndefined(S) && h !== c || (n[l] = S);
|
|
1001
1001
|
}), n;
|
|
1002
1002
|
}
|
|
1003
|
-
const
|
|
1003
|
+
const gt = (e) => {
|
|
1004
1004
|
const t = W({}, e);
|
|
1005
1005
|
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = t;
|
|
1006
|
-
if (t.headers = i = D.from(i), t.url =
|
|
1006
|
+
if (t.headers = i = D.from(i), t.url = Tt(bt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && i.set(
|
|
1007
1007
|
"Authorization",
|
|
1008
1008
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1009
1009
|
), a.isFormData(n)) {
|
|
1010
|
-
if (
|
|
1010
|
+
if (N.hasStandardBrowserEnv || N.hasStandardBrowserWebWorkerEnv)
|
|
1011
1011
|
i.setContentType(void 0);
|
|
1012
1012
|
else if (a.isFunction(n.getHeaders)) {
|
|
1013
1013
|
const d = n.getHeaders(), u = ["content-type", "content-length"];
|
|
@@ -1016,14 +1016,14 @@ const bt = (e) => {
|
|
|
1016
1016
|
});
|
|
1017
1017
|
}
|
|
1018
1018
|
}
|
|
1019
|
-
if (
|
|
1020
|
-
const d = s && o &&
|
|
1019
|
+
if (N.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && $n(t.url))) {
|
|
1020
|
+
const d = s && o && qn.read(o);
|
|
1021
1021
|
d && i.set(s, d);
|
|
1022
1022
|
}
|
|
1023
1023
|
return t;
|
|
1024
|
-
},
|
|
1024
|
+
}, Jn = typeof XMLHttpRequest < "u", Vn = Jn && function(e) {
|
|
1025
1025
|
return new Promise(function(n, r) {
|
|
1026
|
-
const s =
|
|
1026
|
+
const s = gt(e);
|
|
1027
1027
|
let o = s.data;
|
|
1028
1028
|
const i = D.from(s.headers).normalize();
|
|
1029
1029
|
let { responseType: c, onUploadProgress: d, onDownloadProgress: u } = s, l, h, S, w, f;
|
|
@@ -1045,7 +1045,7 @@ const bt = (e) => {
|
|
|
1045
1045
|
config: e,
|
|
1046
1046
|
request: p
|
|
1047
1047
|
};
|
|
1048
|
-
|
|
1048
|
+
At(function(L) {
|
|
1049
1049
|
n(L), m();
|
|
1050
1050
|
}, function(L) {
|
|
1051
1051
|
r(L), m();
|
|
@@ -1056,11 +1056,11 @@ const bt = (e) => {
|
|
|
1056
1056
|
}, p.onabort = function() {
|
|
1057
1057
|
p && (r(new E("Request aborted", E.ECONNABORTED, e, p)), p = null);
|
|
1058
1058
|
}, p.onerror = function(C) {
|
|
1059
|
-
const P = C && C.message ? C.message : "Network Error",
|
|
1060
|
-
|
|
1059
|
+
const P = C && C.message ? C.message : "Network Error", G = new E(P, E.ERR_NETWORK, e, p);
|
|
1060
|
+
G.event = C || null, r(G), p = null;
|
|
1061
1061
|
}, p.ontimeout = function() {
|
|
1062
1062
|
let C = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1063
|
-
const P = s.transitional ||
|
|
1063
|
+
const P = s.transitional || wt;
|
|
1064
1064
|
s.timeoutErrorMessage && (C = s.timeoutErrorMessage), r(new E(
|
|
1065
1065
|
C,
|
|
1066
1066
|
P.clarifyTimeoutError ? E.ETIMEDOUT : E.ECONNABORTED,
|
|
@@ -1069,11 +1069,11 @@ const bt = (e) => {
|
|
|
1069
1069
|
)), p = null;
|
|
1070
1070
|
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(C, P) {
|
|
1071
1071
|
p.setRequestHeader(P, C);
|
|
1072
|
-
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([S, f] =
|
|
1073
|
-
p && (r(!y || y.type ? new
|
|
1072
|
+
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([S, f] = pe(u, !0), p.addEventListener("progress", S)), d && p.upload && ([h, w] = pe(d), p.upload.addEventListener("progress", h), p.upload.addEventListener("loadend", w)), (s.cancelToken || s.signal) && (l = (y) => {
|
|
1073
|
+
p && (r(!y || y.type ? new ee(null, e, p) : y), p.abort(), p = null);
|
|
1074
1074
|
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
|
|
1075
1075
|
const I = Hn(s.url);
|
|
1076
|
-
if (I &&
|
|
1076
|
+
if (I && N.protocols.indexOf(I) === -1) {
|
|
1077
1077
|
r(new E("Unsupported protocol " + I + ":", E.ERR_BAD_REQUEST, e));
|
|
1078
1078
|
return;
|
|
1079
1079
|
}
|
|
@@ -1087,7 +1087,7 @@ const bt = (e) => {
|
|
|
1087
1087
|
if (!s) {
|
|
1088
1088
|
s = !0, c();
|
|
1089
1089
|
const l = u instanceof Error ? u : this.reason;
|
|
1090
|
-
r.abort(l instanceof E ? l : new
|
|
1090
|
+
r.abort(l instanceof E ? l : new ee(l instanceof Error ? l.message : l));
|
|
1091
1091
|
}
|
|
1092
1092
|
};
|
|
1093
1093
|
let i = t && setTimeout(() => {
|
|
@@ -1102,7 +1102,7 @@ const bt = (e) => {
|
|
|
1102
1102
|
const { signal: d } = r;
|
|
1103
1103
|
return d.unsubscribe = () => a.asap(c), d;
|
|
1104
1104
|
}
|
|
1105
|
-
},
|
|
1105
|
+
}, Kn = function* (e, t) {
|
|
1106
1106
|
let n = e.byteLength;
|
|
1107
1107
|
if (n < t) {
|
|
1108
1108
|
yield e;
|
|
@@ -1111,10 +1111,10 @@ const bt = (e) => {
|
|
|
1111
1111
|
let r = 0, s;
|
|
1112
1112
|
for (; r < n; )
|
|
1113
1113
|
s = r + t, yield e.slice(r, s), r = s;
|
|
1114
|
-
},
|
|
1115
|
-
for await (const n of
|
|
1116
|
-
yield*
|
|
1117
|
-
},
|
|
1114
|
+
}, Xn = async function* (e, t) {
|
|
1115
|
+
for await (const n of Yn(e))
|
|
1116
|
+
yield* Kn(n, t);
|
|
1117
|
+
}, Yn = async function* (e) {
|
|
1118
1118
|
if (e[Symbol.asyncIterator]) {
|
|
1119
1119
|
yield* e;
|
|
1120
1120
|
return;
|
|
@@ -1130,8 +1130,8 @@ const bt = (e) => {
|
|
|
1130
1130
|
} finally {
|
|
1131
1131
|
await t.cancel();
|
|
1132
1132
|
}
|
|
1133
|
-
},
|
|
1134
|
-
const s =
|
|
1133
|
+
}, Ye = (e, t, n, r) => {
|
|
1134
|
+
const s = Xn(e, t);
|
|
1135
1135
|
let o = 0, i, c = (d) => {
|
|
1136
1136
|
i || (i = !0, r && r(d));
|
|
1137
1137
|
};
|
|
@@ -1159,36 +1159,36 @@ const bt = (e) => {
|
|
|
1159
1159
|
}, {
|
|
1160
1160
|
highWaterMark: 2
|
|
1161
1161
|
});
|
|
1162
|
-
},
|
|
1162
|
+
}, Qe = 64 * 1024, { isFunction: ue } = a, Qn = (({ Request: e, Response: t }) => ({
|
|
1163
1163
|
Request: e,
|
|
1164
1164
|
Response: t
|
|
1165
1165
|
}))(a.global), {
|
|
1166
|
-
ReadableStream:
|
|
1167
|
-
TextEncoder:
|
|
1168
|
-
} = a.global,
|
|
1166
|
+
ReadableStream: Ze,
|
|
1167
|
+
TextEncoder: et
|
|
1168
|
+
} = a.global, tt = (e, ...t) => {
|
|
1169
1169
|
try {
|
|
1170
1170
|
return !!e(...t);
|
|
1171
1171
|
} catch {
|
|
1172
1172
|
return !1;
|
|
1173
1173
|
}
|
|
1174
|
-
},
|
|
1174
|
+
}, Zn = (e) => {
|
|
1175
1175
|
e = a.merge.call({
|
|
1176
1176
|
skipUndefined: !0
|
|
1177
|
-
},
|
|
1178
|
-
const { fetch: t, Request: n, Response: r } = e, s = t ?
|
|
1177
|
+
}, Qn, e);
|
|
1178
|
+
const { fetch: t, Request: n, Response: r } = e, s = t ? ue(t) : typeof fetch == "function", o = ue(n), i = ue(r);
|
|
1179
1179
|
if (!s)
|
|
1180
1180
|
return !1;
|
|
1181
|
-
const c = s &&
|
|
1181
|
+
const c = s && ue(Ze), d = s && (typeof et == "function" ? /* @__PURE__ */ ((f) => (m) => f.encode(m))(new et()) : async (f) => new Uint8Array(await new n(f).arrayBuffer())), u = o && c && tt(() => {
|
|
1182
1182
|
let f = !1;
|
|
1183
|
-
const m = new n(
|
|
1184
|
-
body: new
|
|
1183
|
+
const m = new n(N.origin, {
|
|
1184
|
+
body: new Ze(),
|
|
1185
1185
|
method: "POST",
|
|
1186
1186
|
get duplex() {
|
|
1187
1187
|
return f = !0, "half";
|
|
1188
1188
|
}
|
|
1189
1189
|
}).headers.has("Content-Type");
|
|
1190
1190
|
return f && !m;
|
|
1191
|
-
}), l = i && c &&
|
|
1191
|
+
}), l = i && c && tt(() => a.isReadableStream(new r("").body)), h = {
|
|
1192
1192
|
stream: l && ((f) => f.body)
|
|
1193
1193
|
};
|
|
1194
1194
|
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((f) => {
|
|
@@ -1205,7 +1205,7 @@ const bt = (e) => {
|
|
|
1205
1205
|
if (a.isBlob(f))
|
|
1206
1206
|
return f.size;
|
|
1207
1207
|
if (a.isSpecCompliantForm(f))
|
|
1208
|
-
return (await new n(
|
|
1208
|
+
return (await new n(N.origin, {
|
|
1209
1209
|
method: "POST",
|
|
1210
1210
|
body: f
|
|
1211
1211
|
}).arrayBuffer()).byteLength;
|
|
@@ -1226,104 +1226,104 @@ const bt = (e) => {
|
|
|
1226
1226
|
cancelToken: y,
|
|
1227
1227
|
timeout: C,
|
|
1228
1228
|
onDownloadProgress: P,
|
|
1229
|
-
onUploadProgress:
|
|
1229
|
+
onUploadProgress: G,
|
|
1230
1230
|
responseType: L,
|
|
1231
|
-
headers:
|
|
1232
|
-
withCredentials:
|
|
1233
|
-
fetchOptions:
|
|
1234
|
-
} =
|
|
1231
|
+
headers: ye,
|
|
1232
|
+
withCredentials: ae = "same-origin",
|
|
1233
|
+
fetchOptions: ke
|
|
1234
|
+
} = gt(f), ve = t || fetch;
|
|
1235
1235
|
L = L ? (L + "").toLowerCase() : "text";
|
|
1236
|
-
let
|
|
1237
|
-
const
|
|
1238
|
-
|
|
1236
|
+
let ce = Wn([I, y && y.toAbortSignal()], C), te = null;
|
|
1237
|
+
const z = ce && ce.unsubscribe && (() => {
|
|
1238
|
+
ce.unsubscribe();
|
|
1239
1239
|
});
|
|
1240
1240
|
let He;
|
|
1241
1241
|
try {
|
|
1242
|
-
if (
|
|
1242
|
+
if (G && u && p !== "get" && p !== "head" && (He = await w(ye, R)) !== 0) {
|
|
1243
1243
|
let j = new n(m, {
|
|
1244
1244
|
method: "POST",
|
|
1245
1245
|
body: R,
|
|
1246
1246
|
duplex: "half"
|
|
1247
|
-
}),
|
|
1248
|
-
if (a.isFormData(R) && (
|
|
1249
|
-
const [
|
|
1247
|
+
}), K;
|
|
1248
|
+
if (a.isFormData(R) && (K = j.headers.get("content-type")) && ye.setContentType(K), j.body) {
|
|
1249
|
+
const [Ae, le] = We(
|
|
1250
1250
|
He,
|
|
1251
|
-
|
|
1251
|
+
pe(Ke(G))
|
|
1252
1252
|
);
|
|
1253
|
-
R =
|
|
1253
|
+
R = Ye(j.body, Qe, Ae, le);
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
|
-
a.isString(
|
|
1257
|
-
const B = o && "credentials" in n.prototype,
|
|
1258
|
-
...
|
|
1259
|
-
signal:
|
|
1256
|
+
a.isString(ae) || (ae = ae ? "include" : "omit");
|
|
1257
|
+
const B = o && "credentials" in n.prototype, je = {
|
|
1258
|
+
...ke,
|
|
1259
|
+
signal: ce,
|
|
1260
1260
|
method: p.toUpperCase(),
|
|
1261
|
-
headers:
|
|
1261
|
+
headers: ye.normalize().toJSON(),
|
|
1262
1262
|
body: R,
|
|
1263
1263
|
duplex: "half",
|
|
1264
|
-
credentials: B ?
|
|
1264
|
+
credentials: B ? ae : void 0
|
|
1265
1265
|
};
|
|
1266
|
-
|
|
1267
|
-
let
|
|
1268
|
-
const
|
|
1269
|
-
if (l && (P ||
|
|
1266
|
+
te = o && new n(m, je);
|
|
1267
|
+
let H = await (o ? ve(te, ke) : ve(m, je));
|
|
1268
|
+
const Me = l && (L === "stream" || L === "response");
|
|
1269
|
+
if (l && (P || Me && z)) {
|
|
1270
1270
|
const j = {};
|
|
1271
|
-
["status", "statusText", "headers"].forEach((
|
|
1272
|
-
j[
|
|
1271
|
+
["status", "statusText", "headers"].forEach(($e) => {
|
|
1272
|
+
j[$e] = H[$e];
|
|
1273
1273
|
});
|
|
1274
|
-
const
|
|
1275
|
-
|
|
1276
|
-
|
|
1274
|
+
const K = a.toFiniteNumber(H.headers.get("content-length")), [Ae, le] = P && We(
|
|
1275
|
+
K,
|
|
1276
|
+
pe(Ke(P), !0)
|
|
1277
1277
|
) || [];
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1278
|
+
H = new r(
|
|
1279
|
+
Ye(H.body, Qe, Ae, () => {
|
|
1280
|
+
le && le(), z && z();
|
|
1281
1281
|
}),
|
|
1282
1282
|
j
|
|
1283
1283
|
);
|
|
1284
1284
|
}
|
|
1285
1285
|
L = L || "text";
|
|
1286
|
-
let
|
|
1287
|
-
return !
|
|
1288
|
-
|
|
1289
|
-
data:
|
|
1290
|
-
headers: D.from(
|
|
1291
|
-
status:
|
|
1292
|
-
statusText:
|
|
1286
|
+
let Dt = await h[a.findKey(h, L) || "text"](H, f);
|
|
1287
|
+
return !Me && z && z(), await new Promise((j, K) => {
|
|
1288
|
+
At(j, K, {
|
|
1289
|
+
data: Dt,
|
|
1290
|
+
headers: D.from(H.headers),
|
|
1291
|
+
status: H.status,
|
|
1292
|
+
statusText: H.statusText,
|
|
1293
1293
|
config: f,
|
|
1294
|
-
request:
|
|
1294
|
+
request: te
|
|
1295
1295
|
});
|
|
1296
1296
|
});
|
|
1297
1297
|
} catch (B) {
|
|
1298
|
-
throw
|
|
1299
|
-
new E("Network Error", E.ERR_NETWORK, f,
|
|
1298
|
+
throw z && z(), B && B.name === "TypeError" && /Load failed|fetch/i.test(B.message) ? Object.assign(
|
|
1299
|
+
new E("Network Error", E.ERR_NETWORK, f, te),
|
|
1300
1300
|
{
|
|
1301
1301
|
cause: B.cause || B
|
|
1302
1302
|
}
|
|
1303
|
-
) : E.from(B, B && B.code, f,
|
|
1303
|
+
) : E.from(B, B && B.code, f, te);
|
|
1304
1304
|
}
|
|
1305
1305
|
};
|
|
1306
|
-
},
|
|
1306
|
+
}, er = /* @__PURE__ */ new Map(), Nt = (e) => {
|
|
1307
1307
|
let t = e && e.env || {};
|
|
1308
1308
|
const { fetch: n, Request: r, Response: s } = t, o = [
|
|
1309
1309
|
r,
|
|
1310
1310
|
s,
|
|
1311
1311
|
n
|
|
1312
1312
|
];
|
|
1313
|
-
let i = o.length, c = i, d, u, l =
|
|
1313
|
+
let i = o.length, c = i, d, u, l = er;
|
|
1314
1314
|
for (; c--; )
|
|
1315
|
-
d = o[c], u = l.get(d), u === void 0 && l.set(d, u = c ? /* @__PURE__ */ new Map() :
|
|
1315
|
+
d = o[c], u = l.get(d), u === void 0 && l.set(d, u = c ? /* @__PURE__ */ new Map() : Zn(t)), l = u;
|
|
1316
1316
|
return u;
|
|
1317
1317
|
};
|
|
1318
1318
|
Nt();
|
|
1319
|
-
const
|
|
1320
|
-
http:
|
|
1321
|
-
xhr:
|
|
1319
|
+
const xe = {
|
|
1320
|
+
http: Sn,
|
|
1321
|
+
xhr: Vn,
|
|
1322
1322
|
fetch: {
|
|
1323
1323
|
get: Nt
|
|
1324
1324
|
}
|
|
1325
1325
|
};
|
|
1326
|
-
a.forEach(
|
|
1326
|
+
a.forEach(xe, (e, t) => {
|
|
1327
1327
|
if (e) {
|
|
1328
1328
|
try {
|
|
1329
1329
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -1332,8 +1332,8 @@ a.forEach(Pe, (e, t) => {
|
|
|
1332
1332
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1333
1333
|
}
|
|
1334
1334
|
});
|
|
1335
|
-
const
|
|
1336
|
-
function
|
|
1335
|
+
const nt = (e) => `- ${e}`, tr = (e) => a.isFunction(e) || e === null || e === !1;
|
|
1336
|
+
function nr(e, t) {
|
|
1337
1337
|
e = a.isArray(e) ? e : [e];
|
|
1338
1338
|
const { length: n } = e;
|
|
1339
1339
|
let r, s;
|
|
@@ -1341,7 +1341,7 @@ function tr(e, t) {
|
|
|
1341
1341
|
for (let i = 0; i < n; i++) {
|
|
1342
1342
|
r = e[i];
|
|
1343
1343
|
let c;
|
|
1344
|
-
if (s = r, !
|
|
1344
|
+
if (s = r, !tr(r) && (s = xe[(c = String(r)).toLowerCase()], s === void 0))
|
|
1345
1345
|
throw new E(`Unknown adapter '${c}'`);
|
|
1346
1346
|
if (s && (a.isFunction(s) || (s = s.get(t))))
|
|
1347
1347
|
break;
|
|
@@ -1352,8 +1352,8 @@ function tr(e, t) {
|
|
|
1352
1352
|
([d, u]) => `adapter ${d} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1353
1353
|
);
|
|
1354
1354
|
let c = n ? i.length > 1 ? `since :
|
|
1355
|
-
` + i.map(
|
|
1356
|
-
`) : " " +
|
|
1355
|
+
` + i.map(nt).join(`
|
|
1356
|
+
`) : " " + nt(i[0]) : "as no adapter specified";
|
|
1357
1357
|
throw new E(
|
|
1358
1358
|
"There is no suitable adapter to dispatch the request " + c,
|
|
1359
1359
|
"ERR_NOT_SUPPORT"
|
|
@@ -1366,45 +1366,45 @@ const Ot = {
|
|
|
1366
1366
|
* Resolve an adapter from a list of adapter names or functions.
|
|
1367
1367
|
* @type {Function}
|
|
1368
1368
|
*/
|
|
1369
|
-
getAdapter:
|
|
1369
|
+
getAdapter: nr,
|
|
1370
1370
|
/**
|
|
1371
1371
|
* Exposes all known adapters
|
|
1372
1372
|
* @type {Object<string, Function|Object>}
|
|
1373
1373
|
*/
|
|
1374
|
-
adapters:
|
|
1374
|
+
adapters: xe
|
|
1375
1375
|
};
|
|
1376
1376
|
function Ne(e) {
|
|
1377
1377
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1378
|
-
throw new
|
|
1378
|
+
throw new ee(null, e);
|
|
1379
1379
|
}
|
|
1380
|
-
function
|
|
1381
|
-
return Ne(e), e.headers = D.from(e.headers), e.data =
|
|
1380
|
+
function rt(e) {
|
|
1381
|
+
return Ne(e), e.headers = D.from(e.headers), e.data = ge.call(
|
|
1382
1382
|
e,
|
|
1383
1383
|
e.transformRequest
|
|
1384
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Ot.getAdapter(e.adapter ||
|
|
1385
|
-
return Ne(e), r.data =
|
|
1384
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Ot.getAdapter(e.adapter || ie.adapter, e)(e).then(function(r) {
|
|
1385
|
+
return Ne(e), r.data = ge.call(
|
|
1386
1386
|
e,
|
|
1387
1387
|
e.transformResponse,
|
|
1388
1388
|
r
|
|
1389
1389
|
), r.headers = D.from(r.headers), r;
|
|
1390
1390
|
}, function(r) {
|
|
1391
|
-
return
|
|
1391
|
+
return yt(r) || (Ne(e), r && r.response && (r.response.data = ge.call(
|
|
1392
1392
|
e,
|
|
1393
1393
|
e.transformResponse,
|
|
1394
1394
|
r.response
|
|
1395
1395
|
), r.response.headers = D.from(r.response.headers))), Promise.reject(r);
|
|
1396
1396
|
});
|
|
1397
1397
|
}
|
|
1398
|
-
const
|
|
1398
|
+
const Ct = "1.13.2", Re = {};
|
|
1399
1399
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1400
|
-
|
|
1400
|
+
Re[e] = function(r) {
|
|
1401
1401
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1402
1402
|
};
|
|
1403
1403
|
});
|
|
1404
|
-
const
|
|
1405
|
-
|
|
1404
|
+
const st = {};
|
|
1405
|
+
Re.transitional = function(t, n, r) {
|
|
1406
1406
|
function s(o, i) {
|
|
1407
|
-
return "[Axios v" +
|
|
1407
|
+
return "[Axios v" + Ct + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
|
|
1408
1408
|
}
|
|
1409
1409
|
return (o, i, c) => {
|
|
1410
1410
|
if (t === !1)
|
|
@@ -1412,7 +1412,7 @@ we.transitional = function(t, n, r) {
|
|
|
1412
1412
|
s(i, " has been removed" + (n ? " in " + n : "")),
|
|
1413
1413
|
E.ERR_DEPRECATED
|
|
1414
1414
|
);
|
|
1415
|
-
return n && !
|
|
1415
|
+
return n && !st[i] && (st[i] = !0, console.warn(
|
|
1416
1416
|
s(
|
|
1417
1417
|
i,
|
|
1418
1418
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
@@ -1420,10 +1420,10 @@ we.transitional = function(t, n, r) {
|
|
|
1420
1420
|
)), t ? t(o, i, c) : !0;
|
|
1421
1421
|
};
|
|
1422
1422
|
};
|
|
1423
|
-
|
|
1423
|
+
Re.spelling = function(t) {
|
|
1424
1424
|
return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
|
|
1425
1425
|
};
|
|
1426
|
-
function
|
|
1426
|
+
function rr(e, t, n) {
|
|
1427
1427
|
if (typeof e != "object")
|
|
1428
1428
|
throw new E("options must be an object", E.ERR_BAD_OPTION_VALUE);
|
|
1429
1429
|
const r = Object.keys(e);
|
|
@@ -1440,15 +1440,15 @@ function nr(e, t, n) {
|
|
|
1440
1440
|
throw new E("Unknown option " + o, E.ERR_BAD_OPTION);
|
|
1441
1441
|
}
|
|
1442
1442
|
}
|
|
1443
|
-
const
|
|
1444
|
-
assertOptions:
|
|
1445
|
-
validators:
|
|
1446
|
-
}, k =
|
|
1447
|
-
let
|
|
1443
|
+
const he = {
|
|
1444
|
+
assertOptions: rr,
|
|
1445
|
+
validators: Re
|
|
1446
|
+
}, k = he.validators;
|
|
1447
|
+
let V = class {
|
|
1448
1448
|
constructor(t) {
|
|
1449
1449
|
this.defaults = t || {}, this.interceptors = {
|
|
1450
|
-
request: new
|
|
1451
|
-
response: new
|
|
1450
|
+
request: new Je(),
|
|
1451
|
+
response: new Je()
|
|
1452
1452
|
};
|
|
1453
1453
|
}
|
|
1454
1454
|
/**
|
|
@@ -1479,16 +1479,16 @@ let J = class {
|
|
|
1479
1479
|
_request(t, n) {
|
|
1480
1480
|
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = W(this.defaults, n);
|
|
1481
1481
|
const { transitional: r, paramsSerializer: s, headers: o } = n;
|
|
1482
|
-
r !== void 0 &&
|
|
1482
|
+
r !== void 0 && he.assertOptions(r, {
|
|
1483
1483
|
silentJSONParsing: k.transitional(k.boolean),
|
|
1484
1484
|
forcedJSONParsing: k.transitional(k.boolean),
|
|
1485
1485
|
clarifyTimeoutError: k.transitional(k.boolean)
|
|
1486
1486
|
}, !1), s != null && (a.isFunction(s) ? n.paramsSerializer = {
|
|
1487
1487
|
serialize: s
|
|
1488
|
-
} :
|
|
1488
|
+
} : he.assertOptions(s, {
|
|
1489
1489
|
encode: k.function,
|
|
1490
1490
|
serialize: k.function
|
|
1491
|
-
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0),
|
|
1491
|
+
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), he.assertOptions(n, {
|
|
1492
1492
|
baseUrl: k.spelling("baseURL"),
|
|
1493
1493
|
withXsrfToken: k.spelling("withXSRFToken")
|
|
1494
1494
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
@@ -1513,7 +1513,7 @@ let J = class {
|
|
|
1513
1513
|
});
|
|
1514
1514
|
let l, h = 0, S;
|
|
1515
1515
|
if (!d) {
|
|
1516
|
-
const f = [
|
|
1516
|
+
const f = [rt.bind(this), void 0];
|
|
1517
1517
|
for (f.unshift(...c), f.push(...u), S = f.length, l = Promise.resolve(n); h < S; )
|
|
1518
1518
|
l = l.then(f[h++], f[h++]);
|
|
1519
1519
|
return l;
|
|
@@ -1530,7 +1530,7 @@ let J = class {
|
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
1532
1532
|
try {
|
|
1533
|
-
l =
|
|
1533
|
+
l = rt.call(this, w);
|
|
1534
1534
|
} catch (f) {
|
|
1535
1535
|
return Promise.reject(f);
|
|
1536
1536
|
}
|
|
@@ -1540,12 +1540,12 @@ let J = class {
|
|
|
1540
1540
|
}
|
|
1541
1541
|
getUri(t) {
|
|
1542
1542
|
t = W(this.defaults, t);
|
|
1543
|
-
const n =
|
|
1544
|
-
return
|
|
1543
|
+
const n = bt(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
1544
|
+
return Tt(n, t.params, t.paramsSerializer);
|
|
1545
1545
|
}
|
|
1546
1546
|
};
|
|
1547
1547
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1548
|
-
|
|
1548
|
+
V.prototype[t] = function(n, r) {
|
|
1549
1549
|
return this.request(W(r || {}, {
|
|
1550
1550
|
method: t,
|
|
1551
1551
|
url: n,
|
|
@@ -1566,9 +1566,9 @@ a.forEach(["post", "put", "patch"], function(t) {
|
|
|
1566
1566
|
}));
|
|
1567
1567
|
};
|
|
1568
1568
|
}
|
|
1569
|
-
|
|
1569
|
+
V.prototype[t] = n(), V.prototype[t + "Form"] = n(!0);
|
|
1570
1570
|
});
|
|
1571
|
-
let
|
|
1571
|
+
let sr = class Ut {
|
|
1572
1572
|
constructor(t) {
|
|
1573
1573
|
if (typeof t != "function")
|
|
1574
1574
|
throw new TypeError("executor must be a function.");
|
|
@@ -1592,7 +1592,7 @@ let rr = class Ct {
|
|
|
1592
1592
|
r.unsubscribe(o);
|
|
1593
1593
|
}, i;
|
|
1594
1594
|
}, t(function(o, i, c) {
|
|
1595
|
-
r.reason || (r.reason = new
|
|
1595
|
+
r.reason || (r.reason = new ee(o, i, c), n(r.reason));
|
|
1596
1596
|
});
|
|
1597
1597
|
}
|
|
1598
1598
|
/**
|
|
@@ -1634,22 +1634,22 @@ let rr = class Ct {
|
|
|
1634
1634
|
static source() {
|
|
1635
1635
|
let t;
|
|
1636
1636
|
return {
|
|
1637
|
-
token: new
|
|
1637
|
+
token: new Ut(function(s) {
|
|
1638
1638
|
t = s;
|
|
1639
1639
|
}),
|
|
1640
1640
|
cancel: t
|
|
1641
1641
|
};
|
|
1642
1642
|
}
|
|
1643
1643
|
};
|
|
1644
|
-
function
|
|
1644
|
+
function or(e) {
|
|
1645
1645
|
return function(n) {
|
|
1646
1646
|
return e.apply(null, n);
|
|
1647
1647
|
};
|
|
1648
1648
|
}
|
|
1649
|
-
function
|
|
1649
|
+
function ir(e) {
|
|
1650
1650
|
return a.isObject(e) && e.isAxiosError === !0;
|
|
1651
1651
|
}
|
|
1652
|
-
const
|
|
1652
|
+
const _e = {
|
|
1653
1653
|
Continue: 100,
|
|
1654
1654
|
SwitchingProtocols: 101,
|
|
1655
1655
|
Processing: 102,
|
|
@@ -1720,52 +1720,52 @@ const Ue = {
|
|
|
1720
1720
|
SslHandshakeFailed: 525,
|
|
1721
1721
|
InvalidSslCertificate: 526
|
|
1722
1722
|
};
|
|
1723
|
-
Object.entries(
|
|
1724
|
-
|
|
1723
|
+
Object.entries(_e).forEach(([e, t]) => {
|
|
1724
|
+
_e[t] = e;
|
|
1725
1725
|
});
|
|
1726
|
-
function
|
|
1727
|
-
const t = new
|
|
1728
|
-
return a.extend(n,
|
|
1729
|
-
return
|
|
1726
|
+
function _t(e) {
|
|
1727
|
+
const t = new V(e), n = it(V.prototype.request, t);
|
|
1728
|
+
return a.extend(n, V.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1729
|
+
return _t(W(e, s));
|
|
1730
1730
|
}, n;
|
|
1731
1731
|
}
|
|
1732
|
-
const T =
|
|
1733
|
-
T.Axios =
|
|
1734
|
-
T.CanceledError =
|
|
1735
|
-
T.CancelToken =
|
|
1736
|
-
T.isCancel =
|
|
1737
|
-
T.VERSION =
|
|
1738
|
-
T.toFormData =
|
|
1732
|
+
const T = _t(ie);
|
|
1733
|
+
T.Axios = V;
|
|
1734
|
+
T.CanceledError = ee;
|
|
1735
|
+
T.CancelToken = sr;
|
|
1736
|
+
T.isCancel = yt;
|
|
1737
|
+
T.VERSION = Ct;
|
|
1738
|
+
T.toFormData = we;
|
|
1739
1739
|
T.AxiosError = E;
|
|
1740
1740
|
T.Cancel = T.CanceledError;
|
|
1741
1741
|
T.all = function(t) {
|
|
1742
1742
|
return Promise.all(t);
|
|
1743
1743
|
};
|
|
1744
|
-
T.spread =
|
|
1745
|
-
T.isAxiosError =
|
|
1744
|
+
T.spread = or;
|
|
1745
|
+
T.isAxiosError = ir;
|
|
1746
1746
|
T.mergeConfig = W;
|
|
1747
1747
|
T.AxiosHeaders = D;
|
|
1748
|
-
T.formToJSON = (e) =>
|
|
1748
|
+
T.formToJSON = (e) => Rt(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1749
1749
|
T.getAdapter = Ot.getAdapter;
|
|
1750
|
-
T.HttpStatusCode =
|
|
1750
|
+
T.HttpStatusCode = _e;
|
|
1751
1751
|
T.default = T;
|
|
1752
1752
|
const {
|
|
1753
|
-
Axios:
|
|
1754
|
-
AxiosError:
|
|
1755
|
-
CanceledError:
|
|
1756
|
-
isCancel:
|
|
1757
|
-
CancelToken:
|
|
1758
|
-
VERSION:
|
|
1759
|
-
all:
|
|
1760
|
-
Cancel:
|
|
1753
|
+
Axios: Ir,
|
|
1754
|
+
AxiosError: Lr,
|
|
1755
|
+
CanceledError: Fr,
|
|
1756
|
+
isCancel: Pr,
|
|
1757
|
+
CancelToken: xr,
|
|
1758
|
+
VERSION: Br,
|
|
1759
|
+
all: kr,
|
|
1760
|
+
Cancel: vr,
|
|
1761
1761
|
isAxiosError: Hr,
|
|
1762
|
-
spread:
|
|
1763
|
-
toFormData:
|
|
1764
|
-
AxiosHeaders:
|
|
1765
|
-
HttpStatusCode:
|
|
1766
|
-
formToJSON:
|
|
1767
|
-
getAdapter:
|
|
1768
|
-
mergeConfig:
|
|
1762
|
+
spread: jr,
|
|
1763
|
+
toFormData: Mr,
|
|
1764
|
+
AxiosHeaders: $r,
|
|
1765
|
+
HttpStatusCode: qr,
|
|
1766
|
+
formToJSON: Gr,
|
|
1767
|
+
getAdapter: zr,
|
|
1768
|
+
mergeConfig: Jr
|
|
1769
1769
|
} = T, A = {
|
|
1770
1770
|
/** 未初始化 */
|
|
1771
1771
|
UNINITIALIZED: {
|
|
@@ -1822,7 +1822,7 @@ const {
|
|
|
1822
1822
|
code: 10011,
|
|
1823
1823
|
msg: "数据为空"
|
|
1824
1824
|
}
|
|
1825
|
-
},
|
|
1825
|
+
}, ar = "/api/customer-service/customer/v1/CustomerService/TestLineLatency", cr = "/api/customer-service/customer/v1/CustomerService/ListLines", lr = "/pub/logo.png", De = {
|
|
1826
1826
|
development: {
|
|
1827
1827
|
BASE_API_URL: "http://dev-joytalk-api.halaladmin.vip",
|
|
1828
1828
|
OBS_URL: "http://dev-joytalk-img.halaladmin.vip"
|
|
@@ -1840,106 +1840,111 @@ const {
|
|
|
1840
1840
|
download: "",
|
|
1841
1841
|
ws: ""
|
|
1842
1842
|
};
|
|
1843
|
-
let
|
|
1844
|
-
function
|
|
1845
|
-
const t = `${e.replace(/\/$/, "")}${
|
|
1843
|
+
let X = null;
|
|
1844
|
+
function ur(e) {
|
|
1845
|
+
const t = `${e.replace(/\/$/, "")}${ar}`;
|
|
1846
1846
|
return T.get(t, {
|
|
1847
1847
|
timeout: 1e4
|
|
1848
1848
|
}).then((n) => n.data?.code !== 200 ? Promise.reject(n) : e);
|
|
1849
1849
|
}
|
|
1850
|
-
function
|
|
1851
|
-
const t = `${e.replace(/\/$/, "")}${
|
|
1850
|
+
function fr(e) {
|
|
1851
|
+
const t = `${e.replace(/\/$/, "")}${lr}`;
|
|
1852
1852
|
return T.get(t, {
|
|
1853
1853
|
timeout: 1e4
|
|
1854
1854
|
}).then(() => e).catch(() => Promise.reject(new Error("Download latency test failed")));
|
|
1855
1855
|
}
|
|
1856
|
-
function fr(e) {
|
|
1857
|
-
return e?.length ? Promise.any(e.map((t) => lr(t))) : Promise.reject(new Error("No urls to test"));
|
|
1858
|
-
}
|
|
1859
1856
|
function dr(e) {
|
|
1860
|
-
return e?.length ? Promise.any(e.map((t) => ur(t))) : Promise.reject(new Error("No
|
|
1857
|
+
return e?.length ? Promise.any(e.map((t) => ur(t))) : Promise.reject(new Error("No urls to test"));
|
|
1858
|
+
}
|
|
1859
|
+
function hr(e) {
|
|
1860
|
+
return e?.length ? Promise.any(e.map((t) => fr(t))) : Promise.reject(new Error("No download urls to test"));
|
|
1861
1861
|
}
|
|
1862
|
-
async function
|
|
1862
|
+
async function Be(e, t) {
|
|
1863
1863
|
if (F.api && F.download) return;
|
|
1864
|
-
if (
|
|
1865
|
-
const n =
|
|
1866
|
-
F.api = n, F.download = r, F.ws = n.replace(/http/g, "ws"), n || (
|
|
1867
|
-
const s = await T.get(`${n.replace(/\/$/, "")}${
|
|
1864
|
+
if (X) return X;
|
|
1865
|
+
const n = De[t].BASE_API_URL || "", r = De[t].OBS_URL || "";
|
|
1866
|
+
F.api = n, F.download = r, F.ws = n.replace(/http/g, "ws"), n || (X = Promise.reject(new Error("环境配置错误")), await X), X = (async () => {
|
|
1867
|
+
const s = await T.get(`${n.replace(/\/$/, "")}${cr}`, {
|
|
1868
1868
|
headers: { Authorization: `Bearer ${e}` },
|
|
1869
1869
|
timeout: 15e3
|
|
1870
1870
|
});
|
|
1871
1871
|
if (s.data?.code !== 200 || !s.data?.data)
|
|
1872
1872
|
return Promise.reject(s);
|
|
1873
1873
|
const o = (s.data.data.api ?? []).map((h) => h.url).filter(Boolean), i = (s.data.data.download ?? []).map((h) => h.url).filter(Boolean), c = n, d = r, [u, l] = await Promise.all([
|
|
1874
|
-
o.length ?
|
|
1875
|
-
i.length ?
|
|
1874
|
+
o.length ? dr(o).catch(() => c) : Promise.resolve(c),
|
|
1875
|
+
i.length ? hr(i).catch(() => d) : Promise.resolve(d)
|
|
1876
1876
|
]);
|
|
1877
1877
|
F.api = u, F.download = l, F.ws = u.replace(/http/g, "ws");
|
|
1878
|
-
})(), await
|
|
1878
|
+
})(), await X;
|
|
1879
1879
|
}
|
|
1880
|
-
const
|
|
1880
|
+
const q = T.create({
|
|
1881
1881
|
timeout: 6e5
|
|
1882
1882
|
});
|
|
1883
|
-
|
|
1883
|
+
q.interceptors.request.use(
|
|
1884
1884
|
async (e) => {
|
|
1885
|
-
const t = new
|
|
1886
|
-
return n ? (e.headers.Authorization = `Bearer ${n}`, await
|
|
1885
|
+
const t = new Y(), n = t.config.token;
|
|
1886
|
+
return n ? (e.headers.Authorization = `Bearer ${n}`, t.config.language && (e.headers["Accept-Language"] = t.config.language), await Be(n, t.config.env), e.baseURL = F.api, e) : Promise.reject(A.UNINITIALIZED);
|
|
1887
1887
|
},
|
|
1888
1888
|
(e) => Promise.reject(e)
|
|
1889
1889
|
);
|
|
1890
|
-
|
|
1890
|
+
q.interceptors.response.use(
|
|
1891
1891
|
(e) => e.data?.code !== 200 ? Promise.reject(e) : Promise.resolve(e.data),
|
|
1892
1892
|
(e) => Promise.reject(e)
|
|
1893
1893
|
);
|
|
1894
|
-
function
|
|
1894
|
+
function pr() {
|
|
1895
1895
|
return F.api;
|
|
1896
1896
|
}
|
|
1897
|
-
function
|
|
1897
|
+
function me() {
|
|
1898
1898
|
return F.download;
|
|
1899
1899
|
}
|
|
1900
|
-
function
|
|
1900
|
+
function mr() {
|
|
1901
1901
|
return F.ws;
|
|
1902
1902
|
}
|
|
1903
|
-
const
|
|
1903
|
+
const Er = (e) => q.post(
|
|
1904
1904
|
"/api/open-auth/obs/v1/ObsService/GetObsAuthInfo",
|
|
1905
1905
|
e
|
|
1906
|
-
),
|
|
1907
|
-
const t =
|
|
1906
|
+
), Sr = async (e) => {
|
|
1907
|
+
const t = me();
|
|
1908
1908
|
return T.post(`${t}`, e, {
|
|
1909
1909
|
headers: {
|
|
1910
1910
|
"Content-Type": "multipart/form-data"
|
|
1911
1911
|
}
|
|
1912
1912
|
});
|
|
1913
|
-
},
|
|
1913
|
+
}, Tr = async (e, t) => T.put(t, e, {
|
|
1914
1914
|
headers: {
|
|
1915
1915
|
"Content-Type": e.type
|
|
1916
1916
|
}
|
|
1917
|
-
}),
|
|
1917
|
+
}), wr = (e) => q.post(
|
|
1918
1918
|
"/api/open-auth/open_consultation/v1/OpenConsultationService/GetConsultationList",
|
|
1919
1919
|
e
|
|
1920
|
-
),
|
|
1920
|
+
), Rr = (e) => q.get(
|
|
1921
1921
|
"/api/open-auth/faq/v1/FaqService/GetFaqList",
|
|
1922
1922
|
{
|
|
1923
1923
|
params: e
|
|
1924
1924
|
}
|
|
1925
|
-
),
|
|
1925
|
+
), yr = () => q.get(
|
|
1926
1926
|
"/api/open-auth/user/v1/UserService/GetUserInfo"
|
|
1927
|
-
),
|
|
1927
|
+
), Ar = (e) => q.post(
|
|
1928
1928
|
"/api/open-auth/user/v1/UserService/GetUserHistoryMessages",
|
|
1929
1929
|
e
|
|
1930
|
-
),
|
|
1931
|
-
const
|
|
1930
|
+
), br = (e) => {
|
|
1931
|
+
const t = new Y(), n = t.config.env, r = pr() || De[n].BASE_API_URL;
|
|
1932
1932
|
return T.post(
|
|
1933
1933
|
`${r}/api/open-auth/openAuth/v1/OpenAuthService/AnonymousAuth`,
|
|
1934
|
-
e
|
|
1934
|
+
e,
|
|
1935
|
+
{
|
|
1936
|
+
headers: t.config.language ? {
|
|
1937
|
+
"Accept-Language": t.config.language
|
|
1938
|
+
} : void 0
|
|
1939
|
+
}
|
|
1935
1940
|
);
|
|
1936
|
-
},
|
|
1941
|
+
}, gr = (e) => q.get(
|
|
1937
1942
|
"/api/chat/chat/v1/Chat/GetMsg",
|
|
1938
1943
|
{
|
|
1939
1944
|
params: e
|
|
1940
1945
|
}
|
|
1941
1946
|
);
|
|
1942
|
-
var
|
|
1947
|
+
var v = /* @__PURE__ */ ((e) => (e.SEND = "1", e.WITHDRAW = "2", e.EDIT = "3", e.SYSTEM_NOTICE = "4", e.TRANSFER = "5", e.INBOUND = "6", e.REPLY = "7", e.UNBIND = "8", e))(v || {}), $ = /* @__PURE__ */ ((e) => (e.TEXT = "1", e.IMAGE = "2", e.VIDEO = "3", e.FILE = "4", e.FAQ = "5", e))($ || {}), U = /* @__PURE__ */ ((e) => (e[e.CONNECT_SUCCESS = 200] = "CONNECT_SUCCESS", e[e.CONNECT_FAILED = 40001] = "CONNECT_FAILED", e[e.TRANSFER_CUSTOMER_SUCCESS = 201] = "TRANSFER_CUSTOMER_SUCCESS", e[e.TRANSFER_TO_CUSTOMER_SUCCESS = 202] = "TRANSFER_TO_CUSTOMER_SUCCESS", e[e.TRANSFER_USER_SUCCESS = 203] = "TRANSFER_USER_SUCCESS", e[e.TRANSFER_FAIL = 50001] = "TRANSFER_FAIL", e[e.MATCH_FAIL = 50002] = "MATCH_FAIL", e[e.MATCH_INFO = 50005] = "MATCH_INFO", e[e.MATCH_SUCCESS = 50006] = "MATCH_SUCCESS", e[e.RETRACT = 204] = "RETRACT", e[e.RETRACT_FAIL = 50003] = "RETRACT_FAIL", e[e.EDIT = 205] = "EDIT", e[e.EDIT_FAIL = 50004] = "EDIT_FAIL", e[e.COMMON_FAIL = 5e4] = "COMMON_FAIL", e[e.SEND_SUCCESS = 206] = "SEND_SUCCESS", e[e.SEND_CALLBACK = 207] = "SEND_CALLBACK", e[e.CHANGE_CHAT_STATUS = 208] = "CHANGE_CHAT_STATUS", e[e.REPLY_FAIL = 50008] = "REPLY_FAIL", e[e.REPLY_SUCCESS = 209] = "REPLY_SUCCESS", e[e.UNBIND_SUCCESS = 60006] = "UNBIND_SUCCESS", e[e.BAN_CUSTOMER = 60007] = "BAN_CUSTOMER", e[e.BAN_ENTRY = 60008] = "BAN_ENTRY", e[e.REMATCH = 60001] = "REMATCH", e))(U || {}), Ie = /* @__PURE__ */ ((e) => (e.CUSTOMER = "1", e.USER = "2", e.ANONYMOUS = "3", e))(Ie || {}), b = /* @__PURE__ */ ((e) => (e.CONNECTED = "connected", e.DISCONNECTED = "disconnected", e.ERROR = "error", e.MESSAGE = "message", e.STATUS_CHANGE = "status_change", e.HEARTBEAT_TIMEOUT = "heartbeat_timeout", e))(b || {}), O = /* @__PURE__ */ ((e) => (e.DISCONNECTED = "disconnected", e.CONNECTING = "connecting", e.CONNECTED = "connected", e.RECONNECTING = "reconnecting", e.ERROR = "error", e))(O || {}), g = /* @__PURE__ */ ((e) => (e.UNMATCHED = "1", e.MATCHING = "2", e.MATCHED = "3", e.UNBIND = "4", e))(g || {});
|
|
1943
1948
|
class Nr {
|
|
1944
1949
|
events = /* @__PURE__ */ new Map();
|
|
1945
1950
|
/**
|
|
@@ -1997,31 +2002,36 @@ class Nr {
|
|
|
1997
2002
|
}
|
|
1998
2003
|
}
|
|
1999
2004
|
async function Or(e, t) {
|
|
2000
|
-
return await
|
|
2005
|
+
return await Be(e, t), `${await mr()}/api/ws?Authorization=${e}`;
|
|
2001
2006
|
}
|
|
2002
|
-
function
|
|
2007
|
+
function Cr() {
|
|
2003
2008
|
return "web" + Date.now().toString(36) + Math.random().toString(36).slice(2);
|
|
2004
2009
|
}
|
|
2005
|
-
function
|
|
2010
|
+
function Ur(e) {
|
|
2006
2011
|
return typeof e == "object" && e !== null && "data" in e && "msgType" in e && "toUid" in e && "chatType" in e && "code" in e;
|
|
2007
2012
|
}
|
|
2008
|
-
function
|
|
2009
|
-
|
|
2010
|
-
return e.contentType !== M.TEXT && (e.content = JSON.parse(e.content), e.content?.fileUrl?.startsWith("http") || (e.content.fileUrl = t + e.content.fileUrl), e.content?.thumbnailUrl?.startsWith("http") || (e.content.thumbnailUrl = t + e.content.thumbnailUrl)), e.replyType && e.replyType !== M.TEXT && typeof e.replyContent == "string" && (e.replyContent = JSON.parse(
|
|
2013
|
+
function ot(e) {
|
|
2014
|
+
return e.customerServiceAvatar = M(e.customerServiceAvatar), e.userAvatar = M(e.customerServiceAvatar), e.contentType !== $.TEXT && (e.content = JSON.parse(e.content), e.content.fileUrl = M(e.content.fileUrl), e.content.thumbnailUrl = M(e.content.thumbnailUrl)), e.replyType && e.replyType !== $.TEXT && typeof e.replyContent == "string" && (e.replyContent = JSON.parse(
|
|
2011
2015
|
e.replyContent
|
|
2012
|
-
), e.replyContent
|
|
2016
|
+
), e.replyContent.fileUrl = M(e.replyContent.fileUrl), e.replyContent.thumbnailUrl = M(
|
|
2017
|
+
e.replyContent.thumbnailUrl
|
|
2018
|
+
)), e;
|
|
2019
|
+
}
|
|
2020
|
+
function M(e = "") {
|
|
2021
|
+
return e && !e.startsWith("http") ? me() + "/" + e : e;
|
|
2013
2022
|
}
|
|
2014
|
-
class
|
|
2023
|
+
class Y extends Nr {
|
|
2015
2024
|
config = {
|
|
2016
2025
|
token: "",
|
|
2017
2026
|
autoReconnect: !0,
|
|
2018
2027
|
reconnectInterval: 3e3,
|
|
2019
2028
|
maxReconnectAttempts: 5,
|
|
2020
2029
|
responseTimeout: 15e3,
|
|
2021
|
-
env: "production"
|
|
2030
|
+
env: "production",
|
|
2031
|
+
language: "en-US"
|
|
2022
2032
|
};
|
|
2023
2033
|
ws = null;
|
|
2024
|
-
status =
|
|
2034
|
+
status = O.DISCONNECTED;
|
|
2025
2035
|
reconnectTimer = null;
|
|
2026
2036
|
reconnectAttempts = 0;
|
|
2027
2037
|
/** 心跳超时定时器 */
|
|
@@ -2034,16 +2044,16 @@ class X extends Nr {
|
|
|
2034
2044
|
userInfo = null;
|
|
2035
2045
|
static instance = null;
|
|
2036
2046
|
/** 匹配状态 */
|
|
2037
|
-
matchStatus =
|
|
2038
|
-
constructor({ env: t
|
|
2039
|
-
if (super(),
|
|
2040
|
-
return
|
|
2041
|
-
|
|
2047
|
+
matchStatus = g.UNMATCHED;
|
|
2048
|
+
constructor({ env: t } = {}) {
|
|
2049
|
+
if (super(), Y.instance)
|
|
2050
|
+
return Y.instance;
|
|
2051
|
+
Y.instance = this, this.config.env = t || "production";
|
|
2042
2052
|
}
|
|
2043
2053
|
async init(t) {
|
|
2044
2054
|
if (!t.token)
|
|
2045
2055
|
return Promise.reject(A.PARAMETER_ERROR);
|
|
2046
|
-
await
|
|
2056
|
+
await Be(t.token, this.config.env), this.config = Object.assign(this.config, t);
|
|
2047
2057
|
}
|
|
2048
2058
|
/**
|
|
2049
2059
|
* 连接到服务器
|
|
@@ -2053,17 +2063,17 @@ class X extends Nr {
|
|
|
2053
2063
|
return this.consultationTypeId = t, new Promise(async (n, r) => {
|
|
2054
2064
|
if (!this.config.token)
|
|
2055
2065
|
return r(A.UNINITIALIZED);
|
|
2056
|
-
if (this.status ===
|
|
2066
|
+
if (this.status === O.CONNECTED)
|
|
2057
2067
|
return n();
|
|
2058
|
-
if (this.status !==
|
|
2059
|
-
this.setStatus(
|
|
2068
|
+
if (this.status !== O.CONNECTING) {
|
|
2069
|
+
this.setStatus(O.CONNECTING);
|
|
2060
2070
|
try {
|
|
2061
2071
|
const s = await Or(
|
|
2062
2072
|
this.config.token,
|
|
2063
2073
|
this.config.env
|
|
2064
2074
|
);
|
|
2065
2075
|
this.ws = new WebSocket(s), this.ws.onopen = () => {
|
|
2066
|
-
this.reconnectAttempts = 0, this.setStatus(
|
|
2076
|
+
this.reconnectAttempts = 0, this.setStatus(O.CONNECTED), this.emit(b.CONNECTED), n();
|
|
2067
2077
|
}, this.ws.onmessage = (o) => {
|
|
2068
2078
|
try {
|
|
2069
2079
|
this.handleMessage(o.data);
|
|
@@ -2071,12 +2081,12 @@ class X extends Nr {
|
|
|
2071
2081
|
throw console.error("解析消息失败:", i), A.DATA_PARSING_ERROR;
|
|
2072
2082
|
}
|
|
2073
2083
|
}, this.ws.onerror = (o) => {
|
|
2074
|
-
console.error("连接错误:", o), this.setStatus(
|
|
2084
|
+
console.error("连接错误:", o), this.setStatus(O.ERROR), this.emit(b.ERROR, o), r(o);
|
|
2075
2085
|
}, this.ws.onclose = () => {
|
|
2076
|
-
this.config.env === "development" && console.warn("连接断开", (/* @__PURE__ */ new Date()).toISOString()), this.setStatus(
|
|
2086
|
+
this.config.env === "development" && console.warn("连接断开", (/* @__PURE__ */ new Date()).toISOString()), this.setStatus(O.DISCONNECTED), this.emit(b.DISCONNECTED), this.heartbeatTimeoutTimer && (clearTimeout(this.heartbeatTimeoutTimer), this.heartbeatTimeoutTimer = null), this.config.autoReconnect && this.reconnectAttempts < this.config.maxReconnectAttempts && this.scheduleReconnect();
|
|
2077
2087
|
};
|
|
2078
2088
|
} catch (s) {
|
|
2079
|
-
this.setStatus(
|
|
2089
|
+
this.setStatus(O.ERROR), this.emit(b.ERROR, s), r(s);
|
|
2080
2090
|
}
|
|
2081
2091
|
}
|
|
2082
2092
|
});
|
|
@@ -2086,7 +2096,7 @@ class X extends Nr {
|
|
|
2086
2096
|
* @returns void
|
|
2087
2097
|
*/
|
|
2088
2098
|
disconnect() {
|
|
2089
|
-
this.config.autoReconnect = !1, this.sessionData = null, this.matchStatus =
|
|
2099
|
+
this.config.autoReconnect = !1, this.sessionData = null, this.matchStatus = g.UNMATCHED, this.clearReconnectTimer(), this.heartbeatTimeoutTimer && (clearTimeout(this.heartbeatTimeoutTimer), this.heartbeatTimeoutTimer = null), this.ws && (this.ws.close(), this.ws = null), this.setStatus(O.DISCONNECTED);
|
|
2090
2100
|
}
|
|
2091
2101
|
/**
|
|
2092
2102
|
* 发送消息
|
|
@@ -2095,7 +2105,7 @@ class X extends Nr {
|
|
|
2095
2105
|
* @param msgType - 消息类型
|
|
2096
2106
|
* @returns Promise<{ messageId?: string; data?: Message }>
|
|
2097
2107
|
*/
|
|
2098
|
-
async sendMessage(t, n, r =
|
|
2108
|
+
async sendMessage(t, n, r = v.SEND) {
|
|
2099
2109
|
const s = {
|
|
2100
2110
|
msgType: r,
|
|
2101
2111
|
data: t,
|
|
@@ -2103,8 +2113,8 @@ class X extends Nr {
|
|
|
2103
2113
|
chatType: n,
|
|
2104
2114
|
editId: void 0
|
|
2105
2115
|
};
|
|
2106
|
-
if (this.status !==
|
|
2107
|
-
if (this.ws && this.status ===
|
|
2116
|
+
if (this.status !== O.CONNECTED || !this.ws)
|
|
2117
|
+
if (this.ws && this.status === O.DISCONNECTED) {
|
|
2108
2118
|
console.log("连接断开,尝试重新连接");
|
|
2109
2119
|
try {
|
|
2110
2120
|
await this.connect(this.consultationTypeId);
|
|
@@ -2116,10 +2126,10 @@ class X extends Nr {
|
|
|
2116
2126
|
try {
|
|
2117
2127
|
if (!this.ws)
|
|
2118
2128
|
throw A.DISCONNECTED;
|
|
2119
|
-
return r ===
|
|
2120
|
-
const c =
|
|
2129
|
+
return r === v.SEND ? new Promise(async (o, i) => {
|
|
2130
|
+
const c = Cr();
|
|
2121
2131
|
s.ext = c;
|
|
2122
|
-
const d = await
|
|
2132
|
+
const d = await gr({ ext: c });
|
|
2123
2133
|
d.data?.messageId ? (this.ws.send(JSON.stringify(s)), o({ messageId: d.data.messageId, data: t })) : i(A.MESSAGE_SEND_FAIL);
|
|
2124
2134
|
}) : (this.ws.send(JSON.stringify(s)), { data: t });
|
|
2125
2135
|
} catch (o) {
|
|
@@ -2131,10 +2141,10 @@ class X extends Nr {
|
|
|
2131
2141
|
* @returns Promise<void>
|
|
2132
2142
|
*/
|
|
2133
2143
|
async checkMatchStatus() {
|
|
2134
|
-
if (this.matchStatus ===
|
|
2144
|
+
if (this.matchStatus === g.UNBIND && (await this.sendMessage(
|
|
2135
2145
|
this.consultationTypeId,
|
|
2136
2146
|
void 0,
|
|
2137
|
-
|
|
2147
|
+
v.INBOUND
|
|
2138
2148
|
), await new Promise((t, n) => {
|
|
2139
2149
|
const r = setTimeout(() => {
|
|
2140
2150
|
clearTimeout(r), n(A.MESSAGE_SEND_FAIL);
|
|
@@ -2142,7 +2152,7 @@ class X extends Nr {
|
|
|
2142
2152
|
this.once(b.MESSAGE, (s) => {
|
|
2143
2153
|
s.code === U.REMATCH && (clearTimeout(r), t(!0));
|
|
2144
2154
|
});
|
|
2145
|
-
})), this.matchStatus !==
|
|
2155
|
+
})), this.matchStatus !== g.MATCHED)
|
|
2146
2156
|
throw console.error(A.NO_CUSTOMER_SERVICE), A.NO_CUSTOMER_SERVICE;
|
|
2147
2157
|
}
|
|
2148
2158
|
/**
|
|
@@ -2151,7 +2161,7 @@ class X extends Nr {
|
|
|
2151
2161
|
* @returns Promise<{ messageId?: string; data?: string }>
|
|
2152
2162
|
*/
|
|
2153
2163
|
async sendText(t) {
|
|
2154
|
-
return await this.checkMatchStatus(), this.sendMessage(t,
|
|
2164
|
+
return await this.checkMatchStatus(), this.sendMessage(t, $.TEXT);
|
|
2155
2165
|
}
|
|
2156
2166
|
/**
|
|
2157
2167
|
* 发送文件消息
|
|
@@ -2177,7 +2187,7 @@ class X extends Nr {
|
|
|
2177
2187
|
}, { messageId: c } = await this.sendMessage(
|
|
2178
2188
|
JSON.stringify(i),
|
|
2179
2189
|
r
|
|
2180
|
-
), d =
|
|
2190
|
+
), d = me();
|
|
2181
2191
|
return {
|
|
2182
2192
|
messageId: c,
|
|
2183
2193
|
content: {
|
|
@@ -2203,7 +2213,7 @@ class X extends Nr {
|
|
|
2203
2213
|
* @returns boolean
|
|
2204
2214
|
*/
|
|
2205
2215
|
isConnected() {
|
|
2206
|
-
return this.status ===
|
|
2216
|
+
return this.status === O.CONNECTED;
|
|
2207
2217
|
}
|
|
2208
2218
|
/**
|
|
2209
2219
|
* 处理收到的消息
|
|
@@ -2215,27 +2225,27 @@ class X extends Nr {
|
|
|
2215
2225
|
this.lastHeartbeatTime = Date.now(), this.heartbeatTimeoutTimer && (clearTimeout(this.heartbeatTimeoutTimer), this.heartbeatTimeoutTimer = null), this.sendHeartbeat();
|
|
2216
2226
|
return;
|
|
2217
2227
|
}
|
|
2218
|
-
if (t = JSON.parse(t), !!
|
|
2228
|
+
if (t = JSON.parse(t), !!Ur(t))
|
|
2219
2229
|
try {
|
|
2220
2230
|
const n = t.data ? JSON.parse(t.data) : t.data;
|
|
2221
2231
|
switch (t.data = n, t.code) {
|
|
2222
2232
|
// 连接成功
|
|
2223
2233
|
case U.CONNECT_SUCCESS:
|
|
2224
|
-
this.matchStatus ===
|
|
2234
|
+
this.matchStatus === g.MATCHED || this.matchStatus === g.MATCHING ? this.matchStatus = g.UNBIND : this.matchStatus = g.MATCHING, this.sendMessage(
|
|
2225
2235
|
this.consultationTypeId,
|
|
2226
2236
|
void 0,
|
|
2227
|
-
|
|
2237
|
+
v.INBOUND
|
|
2228
2238
|
);
|
|
2229
2239
|
break;
|
|
2230
2240
|
// 匹配成功
|
|
2231
2241
|
case U.MATCH_INFO:
|
|
2232
2242
|
case U.MATCH_SUCCESS:
|
|
2233
|
-
if (this.matchStatus ===
|
|
2243
|
+
if (this.matchStatus === g.MATCHED)
|
|
2234
2244
|
return;
|
|
2235
|
-
this.sessionData = t.data, this.matchStatus ===
|
|
2245
|
+
t.data.customerAvatar = M(t.data.customerAvatar), this.sessionData = t.data, this.matchStatus === g.UNBIND ? (this.matchStatus = g.MATCHED, this.emit(b.MESSAGE, {
|
|
2236
2246
|
...t,
|
|
2237
2247
|
code: U.REMATCH
|
|
2238
|
-
})) : (this.matchStatus =
|
|
2248
|
+
})) : (this.matchStatus = g.MATCHED, this.getFaqList(), this.emit(b.MESSAGE, t));
|
|
2239
2249
|
break;
|
|
2240
2250
|
// 转接用户成功
|
|
2241
2251
|
case U.TRANSFER_USER_SUCCESS:
|
|
@@ -2257,7 +2267,7 @@ class X extends Nr {
|
|
|
2257
2267
|
const s = t.data;
|
|
2258
2268
|
if (s.sessionId !== this.sessionData?.sessionId)
|
|
2259
2269
|
return;
|
|
2260
|
-
|
|
2270
|
+
ot(s), this.emit(b.MESSAGE, t);
|
|
2261
2271
|
break;
|
|
2262
2272
|
case U.SEND_CALLBACK:
|
|
2263
2273
|
const o = t.ext, c = t.data.messageId;
|
|
@@ -2266,7 +2276,7 @@ class X extends Nr {
|
|
|
2266
2276
|
case U.UNBIND_SUCCESS:
|
|
2267
2277
|
if (n.sessionId !== this.sessionData?.sessionId)
|
|
2268
2278
|
return;
|
|
2269
|
-
this.matchStatus =
|
|
2279
|
+
this.matchStatus = g.UNBIND, this.sessionData = null, this.emit(b.MESSAGE, t);
|
|
2270
2280
|
break;
|
|
2271
2281
|
default:
|
|
2272
2282
|
this.emit(b.MESSAGE, t);
|
|
@@ -2292,7 +2302,7 @@ class X extends Nr {
|
|
|
2292
2302
|
this.config.env === "development" && console.warn(
|
|
2293
2303
|
`第${this.reconnectAttempts + 1}次安排重连`,
|
|
2294
2304
|
(/* @__PURE__ */ new Date()).toISOString()
|
|
2295
|
-
), this.clearReconnectTimer(), this.reconnectAttempts++, this.setStatus(
|
|
2305
|
+
), this.clearReconnectTimer(), this.reconnectAttempts++, this.setStatus(O.RECONNECTING), this.reconnectTimer = setTimeout(() => {
|
|
2296
2306
|
this.connect(this.consultationTypeId).catch((t) => {
|
|
2297
2307
|
console.error("重连失败:", t);
|
|
2298
2308
|
});
|
|
@@ -2310,7 +2320,7 @@ class X extends Nr {
|
|
|
2310
2320
|
* @returns void
|
|
2311
2321
|
*/
|
|
2312
2322
|
sendHeartbeat() {
|
|
2313
|
-
if (!(this.status !==
|
|
2323
|
+
if (!(this.status !== O.CONNECTED || !this.ws))
|
|
2314
2324
|
try {
|
|
2315
2325
|
this.ws.send("pong"), this.lastHeartbeatTime = Date.now(), this.heartbeatTimeoutTimer = setTimeout(() => {
|
|
2316
2326
|
Date.now() - this.lastHeartbeatTime >= this.config.responseTimeout && (this.emit(b.HEARTBEAT_TIMEOUT), this.config.env === "development" && console.warn("心跳超时,尝试重连", (/* @__PURE__ */ new Date()).toISOString()), this.ws && this.ws.close());
|
|
@@ -2328,13 +2338,13 @@ class X extends Nr {
|
|
|
2328
2338
|
lastMsgId: t,
|
|
2329
2339
|
size: n = 50
|
|
2330
2340
|
}) {
|
|
2331
|
-
if (this.matchStatus !==
|
|
2341
|
+
if (this.matchStatus !== g.MATCHED)
|
|
2332
2342
|
return Promise.reject(A.NO_CUSTOMER_SERVICE);
|
|
2333
|
-
const r = await
|
|
2343
|
+
const r = await Ar({
|
|
2334
2344
|
sessionId: this.sessionData?.sessionId,
|
|
2335
2345
|
lastMsgId: t,
|
|
2336
2346
|
size: n
|
|
2337
|
-
}), s = r.data.list.map((o) =>
|
|
2347
|
+
}), s = r.data.list.map((o) => ot(o));
|
|
2338
2348
|
return {
|
|
2339
2349
|
hasMore: r.data.hasMore,
|
|
2340
2350
|
list: s
|
|
@@ -2345,20 +2355,20 @@ class X extends Nr {
|
|
|
2345
2355
|
* @returns Promise<ConsultationList>
|
|
2346
2356
|
*/
|
|
2347
2357
|
async getConsultationList(t) {
|
|
2348
|
-
return (await
|
|
2358
|
+
return (await wr({ entranceId: t })).data;
|
|
2349
2359
|
}
|
|
2350
2360
|
handleUploadFile(t) {
|
|
2351
2361
|
return new Promise(async (n, r) => {
|
|
2352
|
-
const s = t.name.split(".").pop(), o = await
|
|
2362
|
+
const s = t.name.split(".").pop(), o = await Er({ ext: s || "" }), { accessKeyId: i, signature: c, policy: d, key: u, maxLimit: l, url: h } = o.data;
|
|
2353
2363
|
if (t.size > l * 1024 * 1024)
|
|
2354
2364
|
return r(`文件大小不能超过${l}MB`);
|
|
2355
2365
|
if (h) {
|
|
2356
|
-
const S = await
|
|
2366
|
+
const S = await Tr(t, h);
|
|
2357
2367
|
S.status === 200 ? n(`${u}`) : r(S.data);
|
|
2358
2368
|
} else {
|
|
2359
2369
|
const S = new FormData();
|
|
2360
2370
|
S.append("key", u), S.append("AccessKeyId", i), S.append("signature", c), S.append("policy", d), S.append("file", t);
|
|
2361
|
-
const w = await
|
|
2371
|
+
const w = await Sr(S);
|
|
2362
2372
|
w.status === 204 ? n(`${u}`) : r(w.data);
|
|
2363
2373
|
}
|
|
2364
2374
|
});
|
|
@@ -2403,9 +2413,9 @@ class X extends Nr {
|
|
|
2403
2413
|
}), s.load();
|
|
2404
2414
|
});
|
|
2405
2415
|
async getFaqList() {
|
|
2406
|
-
if (this.matchStatus !==
|
|
2416
|
+
if (this.matchStatus !== g.MATCHED)
|
|
2407
2417
|
return Promise.reject(A.NO_CUSTOMER_SERVICE);
|
|
2408
|
-
const t = await
|
|
2418
|
+
const t = await Rr({ id: this.sessionData?.cid });
|
|
2409
2419
|
if (!t.data?.topic?.length)
|
|
2410
2420
|
return;
|
|
2411
2421
|
const n = {
|
|
@@ -2420,15 +2430,15 @@ class X extends Nr {
|
|
|
2420
2430
|
code: U.SEND_SUCCESS,
|
|
2421
2431
|
data: {
|
|
2422
2432
|
content: n,
|
|
2423
|
-
contentType:
|
|
2424
|
-
sendUserType:
|
|
2433
|
+
contentType: $.FAQ,
|
|
2434
|
+
sendUserType: Ie.CUSTOMER,
|
|
2425
2435
|
customerServiceAvatar: this.sessionData?.customerAvatar,
|
|
2426
2436
|
customerServiceName: this.sessionData?.customerName,
|
|
2427
2437
|
createTime: Date.now(),
|
|
2428
|
-
msgType:
|
|
2438
|
+
msgType: v.SEND
|
|
2429
2439
|
},
|
|
2430
|
-
msgType:
|
|
2431
|
-
chatType:
|
|
2440
|
+
msgType: v.SEND,
|
|
2441
|
+
chatType: $.FAQ
|
|
2432
2442
|
};
|
|
2433
2443
|
this.emit(b.MESSAGE, r);
|
|
2434
2444
|
}, t.data.showDelaySeconds * 1e3);
|
|
@@ -2437,23 +2447,23 @@ class X extends Nr {
|
|
|
2437
2447
|
const n = {
|
|
2438
2448
|
code: U.SEND_SUCCESS,
|
|
2439
2449
|
data: {
|
|
2440
|
-
sendUserType:
|
|
2450
|
+
sendUserType: Ie.CUSTOMER,
|
|
2441
2451
|
customerServiceAvatar: this.sessionData?.customerAvatar,
|
|
2442
2452
|
customerServiceName: this.sessionData?.customerName,
|
|
2443
2453
|
createTime: Date.now(),
|
|
2444
|
-
msgType:
|
|
2445
|
-
contentType:
|
|
2454
|
+
msgType: v.SEND,
|
|
2455
|
+
contentType: $.FAQ,
|
|
2446
2456
|
content: {}
|
|
2447
2457
|
},
|
|
2448
|
-
msgType:
|
|
2449
|
-
chatType:
|
|
2458
|
+
msgType: v.SEND,
|
|
2459
|
+
chatType: $.FAQ
|
|
2450
2460
|
};
|
|
2451
2461
|
if (t.isMulti)
|
|
2452
2462
|
n.data.content = {
|
|
2453
2463
|
list: t.item
|
|
2454
2464
|
}, this.emit(b.MESSAGE, n);
|
|
2455
2465
|
else {
|
|
2456
|
-
const r = t.item?.[0] || t, s =
|
|
2466
|
+
const r = t.item?.[0] || t, s = me();
|
|
2457
2467
|
r.imageUrl = r.imageUrl?.map((o) => o?.startsWith("http") ? o : `${s}/${o}`), n.data.content = {
|
|
2458
2468
|
answer: r
|
|
2459
2469
|
}, this.emit(b.MESSAGE, n);
|
|
@@ -2462,25 +2472,28 @@ class X extends Nr {
|
|
|
2462
2472
|
async getUserInfo() {
|
|
2463
2473
|
if (this.userInfo)
|
|
2464
2474
|
return this.userInfo;
|
|
2465
|
-
const t = await
|
|
2466
|
-
return this.userInfo = t.data, this.userInfo;
|
|
2475
|
+
const t = await yr();
|
|
2476
|
+
return t.data.avatar = M(t.data.avatar), this.userInfo = t.data, this.userInfo;
|
|
2467
2477
|
}
|
|
2468
2478
|
async anonymousLogin(t, n) {
|
|
2469
|
-
return (await
|
|
2479
|
+
return (await br({
|
|
2470
2480
|
appKey: t,
|
|
2471
2481
|
entranceId: n,
|
|
2472
2482
|
userSource: "H5"
|
|
2473
2483
|
})).data;
|
|
2474
2484
|
}
|
|
2485
|
+
setLanguage(t) {
|
|
2486
|
+
this.config.language = t || "en-US";
|
|
2487
|
+
}
|
|
2475
2488
|
}
|
|
2476
2489
|
export {
|
|
2477
|
-
|
|
2478
|
-
|
|
2490
|
+
$ as ChatType,
|
|
2491
|
+
O as ConnectionStatus,
|
|
2479
2492
|
b as EventType,
|
|
2480
|
-
|
|
2481
|
-
|
|
2493
|
+
Y as JoyTalk,
|
|
2494
|
+
g as MatchStatus,
|
|
2482
2495
|
U as MessageCode,
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2496
|
+
v as MessageType,
|
|
2497
|
+
Ie as SendUserType,
|
|
2498
|
+
Y as default
|
|
2486
2499
|
};
|