joytalk 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +5 -5
- package/dist/index.es.js +261 -260
- package/dist/index.umd.js +5 -5
- package/dist/lib/index.d.ts +5 -5
- package/dist/types/request.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -32,7 +32,7 @@ const gt = he("string"), g = he("function"), nt = he("number"), Z = (e) => e !==
|
|
|
32
32
|
let t;
|
|
33
33
|
return e && (typeof FormData == "function" && e instanceof FormData || g(e.append) && ((t = de(e)) === "formdata" || // detect form-data instance
|
|
34
34
|
t === "object" && g(e.toString) && e.toString() === "[object FormData]"));
|
|
35
|
-
}, Pt = F("URLSearchParams"), [kt, Bt,
|
|
35
|
+
}, Pt = F("URLSearchParams"), [kt, Bt, jt, Ht] = ["ReadableStream", "Request", "Response", "Headers"].map(F), vt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
36
36
|
function ee(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
37
37
|
if (e === null || typeof e > "u")
|
|
38
38
|
return;
|
|
@@ -60,7 +60,7 @@ function rt(e, t) {
|
|
|
60
60
|
return s;
|
|
61
61
|
return null;
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const M = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, st = (e) => !W(e) && e !== M;
|
|
64
64
|
function we() {
|
|
65
65
|
const { caseless: e, skipUndefined: t } = st(this) && this || {}, n = {}, r = (s, o) => {
|
|
66
66
|
const i = e && rt(n, o) || o;
|
|
@@ -70,9 +70,9 @@ function we() {
|
|
|
70
70
|
arguments[s] && ee(arguments[s], r);
|
|
71
71
|
return n;
|
|
72
72
|
}
|
|
73
|
-
const
|
|
73
|
+
const qt = (e, t, n, { allOwnKeys: r } = {}) => (ee(t, (s, o) => {
|
|
74
74
|
n && g(s) ? e[o] = Ze(s, n) : e[o] = s;
|
|
75
|
-
}, { allOwnKeys: r }), e),
|
|
75
|
+
}, { allOwnKeys: r }), e), Mt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), $t = (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);
|
|
@@ -169,14 +169,14 @@ const sn = (e) => {
|
|
|
169
169
|
return r;
|
|
170
170
|
};
|
|
171
171
|
return n(e, 0);
|
|
172
|
-
}, on = F("AsyncFunction"), an = (e) => e && (Z(e) || g(e)) && g(e.then) && g(e.catch), it = ((e, t) => e ? setImmediate : t ? ((n, r) => (
|
|
173
|
-
s ===
|
|
172
|
+
}, on = F("AsyncFunction"), an = (e) => e && (Z(e) || g(e)) && g(e.then) && g(e.catch), it = ((e, t) => e ? setImmediate : t ? ((n, r) => (M.addEventListener("message", ({ source: s, data: o }) => {
|
|
173
|
+
s === M && o === n && r.length && r.shift()();
|
|
174
174
|
}, !1), (s) => {
|
|
175
|
-
r.push(s),
|
|
175
|
+
r.push(s), M.postMessage(n, "*");
|
|
176
176
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
177
177
|
typeof setImmediate == "function",
|
|
178
|
-
g(
|
|
179
|
-
), cn = typeof queueMicrotask < "u" ? queueMicrotask.bind(
|
|
178
|
+
g(M.postMessage)
|
|
179
|
+
), cn = typeof queueMicrotask < "u" ? queueMicrotask.bind(M) : typeof process < "u" && process.nextTick || it, ln = (e) => e != null && g(e[fe]), a = {
|
|
180
180
|
isArray: V,
|
|
181
181
|
isArrayBuffer: tt,
|
|
182
182
|
isBuffer: Y,
|
|
@@ -190,8 +190,8 @@ const sn = (e) => {
|
|
|
190
190
|
isEmptyObject: Ut,
|
|
191
191
|
isReadableStream: kt,
|
|
192
192
|
isRequest: Bt,
|
|
193
|
-
isResponse:
|
|
194
|
-
isHeaders:
|
|
193
|
+
isResponse: jt,
|
|
194
|
+
isHeaders: Ht,
|
|
195
195
|
isUndefined: W,
|
|
196
196
|
isDate: _t,
|
|
197
197
|
isFile: Dt,
|
|
@@ -204,9 +204,9 @@ const sn = (e) => {
|
|
|
204
204
|
isFileList: Ft,
|
|
205
205
|
forEach: ee,
|
|
206
206
|
merge: we,
|
|
207
|
-
extend:
|
|
207
|
+
extend: qt,
|
|
208
208
|
trim: vt,
|
|
209
|
-
stripBOM:
|
|
209
|
+
stripBOM: Mt,
|
|
210
210
|
inherits: $t,
|
|
211
211
|
toFlatObject: Jt,
|
|
212
212
|
kindOf: de,
|
|
@@ -226,7 +226,7 @@ const sn = (e) => {
|
|
|
226
226
|
noop: tn,
|
|
227
227
|
toFiniteNumber: nn,
|
|
228
228
|
findKey: rt,
|
|
229
|
-
global:
|
|
229
|
+
global: M,
|
|
230
230
|
isContextDefined: st,
|
|
231
231
|
isSpecCompliantForm: rn,
|
|
232
232
|
toJSONObject: sn,
|
|
@@ -234,7 +234,7 @@ const sn = (e) => {
|
|
|
234
234
|
isThenable: an,
|
|
235
235
|
setImmediate: it,
|
|
236
236
|
asap: cn,
|
|
237
|
-
isIterable:
|
|
237
|
+
isIterable: ln
|
|
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);
|
|
@@ -282,26 +282,26 @@ Object.defineProperties(E, ct);
|
|
|
282
282
|
Object.defineProperty(at, "isAxiosError", { value: !0 });
|
|
283
283
|
E.from = (e, t, n, r, s, o) => {
|
|
284
284
|
const i = Object.create(at);
|
|
285
|
-
a.toFlatObject(e, i, function(
|
|
286
|
-
return
|
|
287
|
-
}, (
|
|
285
|
+
a.toFlatObject(e, i, function(l) {
|
|
286
|
+
return l !== Error.prototype;
|
|
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 un = null;
|
|
292
|
+
function be(e) {
|
|
293
293
|
return a.isPlainObject(e) || a.isArray(e);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function lt(e) {
|
|
296
296
|
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function je(e, t, n) {
|
|
299
299
|
return e ? e.concat(t).map(function(s, o) {
|
|
300
|
-
return s =
|
|
300
|
+
return s = lt(s), !n && o ? "[" + s + "]" : s;
|
|
301
301
|
}).join(n ? "." : "") : t;
|
|
302
302
|
}
|
|
303
303
|
function fn(e) {
|
|
304
|
-
return a.isArray(e) && !e.some(
|
|
304
|
+
return a.isArray(e) && !e.some(be);
|
|
305
305
|
}
|
|
306
306
|
const dn = a.toFlatObject(a, {}, null, function(t) {
|
|
307
307
|
return /^is[A-Z]/.test(t);
|
|
@@ -316,10 +316,10 @@ function pe(e, t, n) {
|
|
|
316
316
|
}, !1, function(m, h) {
|
|
317
317
|
return !a.isUndefined(h[m]);
|
|
318
318
|
});
|
|
319
|
-
const r = n.metaTokens, s = n.visitor ||
|
|
319
|
+
const r = n.metaTokens, s = n.visitor || l, o = n.dots, i = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
|
|
320
320
|
if (!a.isFunction(s))
|
|
321
321
|
throw new TypeError("visitor must be a function");
|
|
322
|
-
function
|
|
322
|
+
function u(f) {
|
|
323
323
|
if (f === null) return "";
|
|
324
324
|
if (a.isDate(f))
|
|
325
325
|
return f.toISOString();
|
|
@@ -329,39 +329,39 @@ function pe(e, t, n) {
|
|
|
329
329
|
throw new E("Blob is not supported. Use a Buffer instead.");
|
|
330
330
|
return a.isArrayBuffer(f) || a.isTypedArray(f) ? d && typeof Blob == "function" ? new Blob([f]) : Buffer.from(f) : f;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function l(f, m, h) {
|
|
333
333
|
let T = f;
|
|
334
334
|
if (f && !h && typeof f == "object") {
|
|
335
335
|
if (a.endsWith(m, "{}"))
|
|
336
336
|
m = r ? m : m.slice(0, -2), f = JSON.stringify(f);
|
|
337
337
|
else if (a.isArray(f) && fn(f) || (a.isFileList(f) || a.endsWith(m, "[]")) && (T = a.toArray(f)))
|
|
338
|
-
return m =
|
|
339
|
-
!(a.isUndefined(
|
|
338
|
+
return m = lt(m), T.forEach(function(y, A) {
|
|
339
|
+
!(a.isUndefined(y) || y === null) && t.append(
|
|
340
340
|
// eslint-disable-next-line no-nested-ternary
|
|
341
|
-
i === !0 ?
|
|
342
|
-
|
|
341
|
+
i === !0 ? je([m], A, o) : i === null ? m : m + "[]",
|
|
342
|
+
u(y)
|
|
343
343
|
);
|
|
344
344
|
}), !1;
|
|
345
345
|
}
|
|
346
|
-
return
|
|
346
|
+
return be(f) ? !0 : (t.append(je(h, m, o), u(f)), !1);
|
|
347
347
|
}
|
|
348
348
|
const p = [], S = Object.assign(dn, {
|
|
349
|
-
defaultVisitor:
|
|
350
|
-
convertValue:
|
|
351
|
-
isVisitable:
|
|
349
|
+
defaultVisitor: l,
|
|
350
|
+
convertValue: u,
|
|
351
|
+
isVisitable: be
|
|
352
352
|
});
|
|
353
353
|
function w(f, m) {
|
|
354
354
|
if (!a.isUndefined(f)) {
|
|
355
355
|
if (p.indexOf(f) !== -1)
|
|
356
356
|
throw Error("Circular reference detected in " + m.join("."));
|
|
357
|
-
p.push(f), a.forEach(f, function(T,
|
|
357
|
+
p.push(f), a.forEach(f, function(T, U) {
|
|
358
358
|
(!(a.isUndefined(T) || T === null) && s.call(
|
|
359
359
|
t,
|
|
360
360
|
T,
|
|
361
|
-
a.isString(
|
|
361
|
+
a.isString(U) ? U.trim() : U,
|
|
362
362
|
m,
|
|
363
363
|
S
|
|
364
|
-
)) === !0 && w(T, m ? m.concat(
|
|
364
|
+
)) === !0 && w(T, m ? m.concat(U) : [U]);
|
|
365
365
|
}), p.pop();
|
|
366
366
|
}
|
|
367
367
|
}
|
|
@@ -369,7 +369,7 @@ function pe(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 He(e) {
|
|
373
373
|
const t = {
|
|
374
374
|
"!": "%21",
|
|
375
375
|
"'": "%27",
|
|
@@ -386,14 +386,14 @@ function je(e) {
|
|
|
386
386
|
function Ue(e, t) {
|
|
387
387
|
this._pairs = [], e && pe(e, this, t);
|
|
388
388
|
}
|
|
389
|
-
const
|
|
390
|
-
|
|
389
|
+
const ut = Ue.prototype;
|
|
390
|
+
ut.append = function(t, n) {
|
|
391
391
|
this._pairs.push([t, n]);
|
|
392
392
|
};
|
|
393
|
-
|
|
393
|
+
ut.toString = function(t) {
|
|
394
394
|
const n = t ? function(r) {
|
|
395
|
-
return t.call(this, r,
|
|
396
|
-
} :
|
|
395
|
+
return t.call(this, r, He);
|
|
396
|
+
} : He;
|
|
397
397
|
return this._pairs.map(function(s) {
|
|
398
398
|
return n(s[0]) + "=" + n(s[1]);
|
|
399
399
|
}, "").join("&");
|
|
@@ -483,21 +483,21 @@ const dt = {
|
|
|
483
483
|
},
|
|
484
484
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
485
485
|
}, _e = typeof window < "u" && typeof document < "u", Oe = typeof navigator == "object" && navigator || void 0, Rn = _e && (!Oe || ["ReactNative", "NativeScript", "NS"].indexOf(Oe.product) < 0), Tn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
486
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function",
|
|
486
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", yn = _e && window.location.href || "http://localhost", wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
487
487
|
__proto__: null,
|
|
488
488
|
hasBrowserEnv: _e,
|
|
489
489
|
hasStandardBrowserEnv: Rn,
|
|
490
490
|
hasStandardBrowserWebWorkerEnv: Tn,
|
|
491
491
|
navigator: Oe,
|
|
492
|
-
origin:
|
|
493
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
492
|
+
origin: yn
|
|
493
|
+
}, Symbol.toStringTag, { value: "Module" })), b = {
|
|
494
494
|
...wn,
|
|
495
495
|
...Sn
|
|
496
496
|
};
|
|
497
|
-
function
|
|
498
|
-
return pe(e, new
|
|
497
|
+
function bn(e, t) {
|
|
498
|
+
return pe(e, new b.classes.URLSearchParams(), {
|
|
499
499
|
visitor: function(n, r, s, o) {
|
|
500
|
-
return
|
|
500
|
+
return b.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
501
501
|
},
|
|
502
502
|
...t
|
|
503
503
|
});
|
|
@@ -555,7 +555,7 @@ const te = {
|
|
|
555
555
|
let c;
|
|
556
556
|
if (o) {
|
|
557
557
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
558
|
-
return
|
|
558
|
+
return bn(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
561
|
return pe(
|
|
@@ -592,8 +592,8 @@ const te = {
|
|
|
592
592
|
maxContentLength: -1,
|
|
593
593
|
maxBodyLength: -1,
|
|
594
594
|
env: {
|
|
595
|
-
FormData:
|
|
596
|
-
Blob:
|
|
595
|
+
FormData: b.classes.FormData,
|
|
596
|
+
Blob: b.classes.Blob
|
|
597
597
|
},
|
|
598
598
|
validateStatus: function(t) {
|
|
599
599
|
return t >= 200 && t < 300;
|
|
@@ -633,7 +633,7 @@ const gn = a.toObjectSet([
|
|
|
633
633
|
`).forEach(function(i) {
|
|
634
634
|
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && gn[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
|
-
},
|
|
636
|
+
}, qe = Symbol("internals");
|
|
637
637
|
function Q(e) {
|
|
638
638
|
return e && String(e).trim().toLowerCase();
|
|
639
639
|
}
|
|
@@ -678,24 +678,24 @@ let C = class {
|
|
|
678
678
|
}
|
|
679
679
|
set(t, n, r) {
|
|
680
680
|
const s = this;
|
|
681
|
-
function o(c, d,
|
|
682
|
-
const
|
|
683
|
-
if (!
|
|
681
|
+
function o(c, d, u) {
|
|
682
|
+
const l = Q(d);
|
|
683
|
+
if (!l)
|
|
684
684
|
throw new Error("header name must be a non-empty string");
|
|
685
|
-
const p = a.findKey(s,
|
|
686
|
-
(!p || s[p] === void 0 ||
|
|
685
|
+
const p = a.findKey(s, l);
|
|
686
|
+
(!p || s[p] === void 0 || u === !0 || u === void 0 && s[p] !== !1) && (s[p || d] = ae(c));
|
|
687
687
|
}
|
|
688
|
-
const i = (c, d) => a.forEach(c, (
|
|
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
691
|
else if (a.isString(t) && (t = t.trim()) && !_n(t))
|
|
692
692
|
i(Cn(t), n);
|
|
693
693
|
else if (a.isObject(t) && a.isIterable(t)) {
|
|
694
|
-
let c = {}, d,
|
|
695
|
-
for (const
|
|
696
|
-
if (!a.isArray(
|
|
694
|
+
let c = {}, d, u;
|
|
695
|
+
for (const l of t) {
|
|
696
|
+
if (!a.isArray(l))
|
|
697
697
|
throw TypeError("Object iterator must return a key-value pair");
|
|
698
|
-
c[
|
|
698
|
+
c[u = l[0]] = (d = c[u]) ? a.isArray(d) ? [...d, l[1]] : [d, l[1]] : l[1];
|
|
699
699
|
}
|
|
700
700
|
i(c, n);
|
|
701
701
|
} else
|
|
@@ -788,7 +788,7 @@ let C = 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[qe] = this[qe] = {
|
|
792
792
|
accessors: {}
|
|
793
793
|
}).accessors, s = this.prototype;
|
|
794
794
|
function o(i) {
|
|
@@ -844,59 +844,59 @@ function Ln(e, t) {
|
|
|
844
844
|
const n = new Array(e), r = new Array(e);
|
|
845
845
|
let s = 0, o = 0, i;
|
|
846
846
|
return t = t !== void 0 ? t : 1e3, function(d) {
|
|
847
|
-
const
|
|
848
|
-
i || (i =
|
|
847
|
+
const u = Date.now(), l = r[o];
|
|
848
|
+
i || (i = u), n[s] = d, r[s] = u;
|
|
849
849
|
let p = o, S = 0;
|
|
850
850
|
for (; p !== s; )
|
|
851
851
|
S += n[p++], p = p % e;
|
|
852
|
-
if (s = (s + 1) % e, s === o && (o = (o + 1) % e),
|
|
852
|
+
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), u - i < t)
|
|
853
853
|
return;
|
|
854
|
-
const w =
|
|
854
|
+
const w = l && u - l;
|
|
855
855
|
return w ? Math.round(S * 1e3 / w) : void 0;
|
|
856
856
|
};
|
|
857
857
|
}
|
|
858
858
|
function xn(e, t) {
|
|
859
859
|
let n = 0, r = 1e3 / t, s, o;
|
|
860
|
-
const i = (
|
|
861
|
-
n =
|
|
860
|
+
const i = (u, l = Date.now()) => {
|
|
861
|
+
n = l, s = null, o && (clearTimeout(o), o = null), e(...u);
|
|
862
862
|
};
|
|
863
|
-
return [(...
|
|
864
|
-
const
|
|
865
|
-
p >= r ? i(
|
|
863
|
+
return [(...u) => {
|
|
864
|
+
const l = Date.now(), p = l - n;
|
|
865
|
+
p >= r ? i(u, l) : (s = u, o || (o = setTimeout(() => {
|
|
866
866
|
o = null, i(s);
|
|
867
867
|
}, r - p)));
|
|
868
868
|
}, () => s && i(s)];
|
|
869
869
|
}
|
|
870
|
-
const
|
|
870
|
+
const ue = (e, t, n = 3) => {
|
|
871
871
|
let r = 0;
|
|
872
872
|
const s = Ln(50, 250);
|
|
873
873
|
return xn((o) => {
|
|
874
|
-
const i = o.loaded, c = o.lengthComputable ? o.total : void 0, d = i - r,
|
|
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 p = {
|
|
877
877
|
loaded: i,
|
|
878
878
|
total: c,
|
|
879
879
|
progress: c ? i / c : void 0,
|
|
880
880
|
bytes: d,
|
|
881
|
-
rate:
|
|
882
|
-
estimated:
|
|
881
|
+
rate: u || void 0,
|
|
882
|
+
estimated: u && c && l ? (c - i) / u : void 0,
|
|
883
883
|
event: o,
|
|
884
884
|
lengthComputable: c != null,
|
|
885
885
|
[t ? "download" : "upload"]: !0
|
|
886
886
|
};
|
|
887
887
|
e(p);
|
|
888
888
|
}, n);
|
|
889
|
-
},
|
|
889
|
+
}, Me = (e, t) => {
|
|
890
890
|
const n = e != null;
|
|
891
891
|
return [(r) => t[0]({
|
|
892
892
|
lengthComputable: n,
|
|
893
893
|
total: e,
|
|
894
894
|
loaded: r
|
|
895
895
|
}), t[1]];
|
|
896
|
-
}, $e = (e) => (...t) => a.asap(() => e(...t)), Pn =
|
|
897
|
-
new URL(
|
|
898
|
-
|
|
899
|
-
) : () => !0, kn =
|
|
896
|
+
}, $e = (e) => (...t) => a.asap(() => e(...t)), Pn = b.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, b.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
897
|
+
new URL(b.origin),
|
|
898
|
+
b.navigator && /(msie|trident)/i.test(b.navigator.userAgent)
|
|
899
|
+
) : () => !0, kn = b.hasStandardBrowserEnv ? (
|
|
900
900
|
// Standard browser envs support document.cookie
|
|
901
901
|
{
|
|
902
902
|
write(e, t, n, r, s, o, i) {
|
|
@@ -928,41 +928,41 @@ const le = (e, t, n = 3) => {
|
|
|
928
928
|
function Bn(e) {
|
|
929
929
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function jn(e, t) {
|
|
932
932
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
933
933
|
}
|
|
934
934
|
function Et(e, t, n) {
|
|
935
935
|
let r = !Bn(t);
|
|
936
|
-
return e && (r || n == !1) ?
|
|
936
|
+
return e && (r || n == !1) ? jn(e, t) : t;
|
|
937
937
|
}
|
|
938
938
|
const Je = (e) => e instanceof C ? { ...e } : e;
|
|
939
939
|
function J(e, t) {
|
|
940
940
|
t = t || {};
|
|
941
941
|
const n = {};
|
|
942
|
-
function r(
|
|
943
|
-
return a.isPlainObject(
|
|
942
|
+
function r(u, l, p, S) {
|
|
943
|
+
return a.isPlainObject(u) && a.isPlainObject(l) ? a.merge.call({ caseless: S }, u, l) : a.isPlainObject(l) ? a.merge({}, l) : a.isArray(l) ? l.slice() : l;
|
|
944
944
|
}
|
|
945
|
-
function s(
|
|
946
|
-
if (a.isUndefined(
|
|
947
|
-
if (!a.isUndefined(
|
|
948
|
-
return r(void 0,
|
|
949
|
-
} else return r(
|
|
945
|
+
function s(u, l, p, S) {
|
|
946
|
+
if (a.isUndefined(l)) {
|
|
947
|
+
if (!a.isUndefined(u))
|
|
948
|
+
return r(void 0, u, p, S);
|
|
949
|
+
} else return r(u, l, p, S);
|
|
950
950
|
}
|
|
951
|
-
function o(
|
|
952
|
-
if (!a.isUndefined(
|
|
953
|
-
return r(void 0,
|
|
951
|
+
function o(u, l) {
|
|
952
|
+
if (!a.isUndefined(l))
|
|
953
|
+
return r(void 0, l);
|
|
954
954
|
}
|
|
955
|
-
function i(
|
|
956
|
-
if (a.isUndefined(
|
|
957
|
-
if (!a.isUndefined(
|
|
958
|
-
return r(void 0,
|
|
959
|
-
} else return r(void 0,
|
|
955
|
+
function i(u, l) {
|
|
956
|
+
if (a.isUndefined(l)) {
|
|
957
|
+
if (!a.isUndefined(u))
|
|
958
|
+
return r(void 0, u);
|
|
959
|
+
} else return r(void 0, l);
|
|
960
960
|
}
|
|
961
|
-
function c(
|
|
961
|
+
function c(u, l, p) {
|
|
962
962
|
if (p in t)
|
|
963
|
-
return r(
|
|
963
|
+
return r(u, l);
|
|
964
964
|
if (p in e)
|
|
965
|
-
return r(void 0,
|
|
965
|
+
return r(void 0, u);
|
|
966
966
|
}
|
|
967
967
|
const d = {
|
|
968
968
|
url: o,
|
|
@@ -993,11 +993,11 @@ function J(e, t) {
|
|
|
993
993
|
socketPath: i,
|
|
994
994
|
responseEncoding: i,
|
|
995
995
|
validateStatus: c,
|
|
996
|
-
headers: (
|
|
996
|
+
headers: (u, l, p) => s(Je(u), Je(l), p, !0)
|
|
997
997
|
};
|
|
998
|
-
return a.forEach(Object.keys({ ...e, ...t }), function(
|
|
999
|
-
const p = d[
|
|
1000
|
-
a.isUndefined(S) && p !== c || (n[
|
|
998
|
+
return a.forEach(Object.keys({ ...e, ...t }), function(l) {
|
|
999
|
+
const p = d[l] || s, S = p(e[l], t[l], l);
|
|
1000
|
+
a.isUndefined(S) && p !== c || (n[l] = S);
|
|
1001
1001
|
}), n;
|
|
1002
1002
|
}
|
|
1003
1003
|
const St = (e) => {
|
|
@@ -1007,48 +1007,48 @@ const St = (e) => {
|
|
|
1007
1007
|
"Authorization",
|
|
1008
1008
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1009
1009
|
), a.isFormData(n)) {
|
|
1010
|
-
if (
|
|
1010
|
+
if (b.hasStandardBrowserEnv || b.hasStandardBrowserWebWorkerEnv)
|
|
1011
1011
|
i.setContentType(void 0);
|
|
1012
1012
|
else if (a.isFunction(n.getHeaders)) {
|
|
1013
|
-
const d = n.getHeaders(),
|
|
1014
|
-
Object.entries(d).forEach(([
|
|
1015
|
-
|
|
1013
|
+
const d = n.getHeaders(), u = ["content-type", "content-length"];
|
|
1014
|
+
Object.entries(d).forEach(([l, p]) => {
|
|
1015
|
+
u.includes(l.toLowerCase()) && i.set(l, p);
|
|
1016
1016
|
});
|
|
1017
1017
|
}
|
|
1018
1018
|
}
|
|
1019
|
-
if (
|
|
1019
|
+
if (b.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && Pn(t.url))) {
|
|
1020
1020
|
const d = s && o && kn.read(o);
|
|
1021
1021
|
d && i.set(s, d);
|
|
1022
1022
|
}
|
|
1023
1023
|
return t;
|
|
1024
|
-
},
|
|
1024
|
+
}, Hn = typeof XMLHttpRequest < "u", vn = Hn && function(e) {
|
|
1025
1025
|
return new Promise(function(n, r) {
|
|
1026
1026
|
const s = St(e);
|
|
1027
1027
|
let o = s.data;
|
|
1028
1028
|
const i = C.from(s.headers).normalize();
|
|
1029
|
-
let { responseType: c, onUploadProgress: d, onDownloadProgress:
|
|
1029
|
+
let { responseType: c, onUploadProgress: d, onDownloadProgress: u } = s, l, p, S, w, f;
|
|
1030
1030
|
function m() {
|
|
1031
|
-
w && w(), f && f(), s.cancelToken && s.cancelToken.unsubscribe(
|
|
1031
|
+
w && w(), f && f(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
|
|
1032
1032
|
}
|
|
1033
1033
|
let h = new XMLHttpRequest();
|
|
1034
1034
|
h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
|
|
1035
1035
|
function T() {
|
|
1036
1036
|
if (!h)
|
|
1037
1037
|
return;
|
|
1038
|
-
const
|
|
1038
|
+
const y = C.from(
|
|
1039
1039
|
"getAllResponseHeaders" in h && h.getAllResponseHeaders()
|
|
1040
1040
|
), I = {
|
|
1041
1041
|
data: !c || c === "text" || c === "json" ? h.responseText : h.response,
|
|
1042
1042
|
status: h.status,
|
|
1043
1043
|
statusText: h.statusText,
|
|
1044
|
-
headers:
|
|
1044
|
+
headers: y,
|
|
1045
1045
|
config: e,
|
|
1046
1046
|
request: h
|
|
1047
1047
|
};
|
|
1048
|
-
mt(function(
|
|
1049
|
-
n(
|
|
1050
|
-
}, function(
|
|
1051
|
-
r(
|
|
1048
|
+
mt(function(_) {
|
|
1049
|
+
n(_), m();
|
|
1050
|
+
}, function(_) {
|
|
1051
|
+
r(_), m();
|
|
1052
1052
|
}, I), h = null;
|
|
1053
1053
|
}
|
|
1054
1054
|
"onloadend" in h ? h.onloadend = T : h.onreadystatechange = function() {
|
|
@@ -1056,8 +1056,8 @@ const St = (e) => {
|
|
|
1056
1056
|
}, h.onabort = function() {
|
|
1057
1057
|
h && (r(new E("Request aborted", E.ECONNABORTED, e, h)), h = null);
|
|
1058
1058
|
}, h.onerror = function(A) {
|
|
1059
|
-
const I = A && A.message ? A.message : "Network Error",
|
|
1060
|
-
|
|
1059
|
+
const I = A && A.message ? A.message : "Network Error", H = new E(I, E.ERR_NETWORK, e, h);
|
|
1060
|
+
H.event = A || null, r(H), h = null;
|
|
1061
1061
|
}, h.ontimeout = function() {
|
|
1062
1062
|
let A = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1063
1063
|
const I = s.transitional || dt;
|
|
@@ -1069,40 +1069,40 @@ const St = (e) => {
|
|
|
1069
1069
|
)), h = null;
|
|
1070
1070
|
}, o === void 0 && i.setContentType(null), "setRequestHeader" in h && a.forEach(i.toJSON(), function(A, I) {
|
|
1071
1071
|
h.setRequestHeader(I, A);
|
|
1072
|
-
}), a.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), c && c !== "json" && (h.responseType = s.responseType),
|
|
1073
|
-
h && (r(!
|
|
1074
|
-
}, s.cancelToken && s.cancelToken.subscribe(
|
|
1075
|
-
const
|
|
1076
|
-
if (
|
|
1077
|
-
r(new E("Unsupported protocol " +
|
|
1072
|
+
}), a.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), c && c !== "json" && (h.responseType = s.responseType), u && ([S, f] = ue(u, !0), h.addEventListener("progress", S)), d && h.upload && ([p, w] = ue(d), h.upload.addEventListener("progress", p), h.upload.addEventListener("loadend", w)), (s.cancelToken || s.signal) && (l = (y) => {
|
|
1073
|
+
h && (r(!y || y.type ? new K(null, e, h) : y), h.abort(), h = null);
|
|
1074
|
+
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
|
|
1075
|
+
const U = Fn(s.url);
|
|
1076
|
+
if (U && b.protocols.indexOf(U) === -1) {
|
|
1077
|
+
r(new E("Unsupported protocol " + U + ":", E.ERR_BAD_REQUEST, e));
|
|
1078
1078
|
return;
|
|
1079
1079
|
}
|
|
1080
1080
|
h.send(o || null);
|
|
1081
1081
|
});
|
|
1082
|
-
},
|
|
1082
|
+
}, qn = (e, t) => {
|
|
1083
1083
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1084
1084
|
if (t || n) {
|
|
1085
1085
|
let r = new AbortController(), s;
|
|
1086
|
-
const o = function(
|
|
1086
|
+
const o = function(u) {
|
|
1087
1087
|
if (!s) {
|
|
1088
1088
|
s = !0, c();
|
|
1089
|
-
const
|
|
1090
|
-
r.abort(
|
|
1089
|
+
const l = u instanceof Error ? u : this.reason;
|
|
1090
|
+
r.abort(l instanceof E ? l : new K(l instanceof Error ? l.message : l));
|
|
1091
1091
|
}
|
|
1092
1092
|
};
|
|
1093
1093
|
let i = t && setTimeout(() => {
|
|
1094
1094
|
i = null, o(new E(`timeout ${t} of ms exceeded`, E.ETIMEDOUT));
|
|
1095
1095
|
}, t);
|
|
1096
1096
|
const c = () => {
|
|
1097
|
-
e && (i && clearTimeout(i), i = null, e.forEach((
|
|
1098
|
-
|
|
1097
|
+
e && (i && clearTimeout(i), i = null, e.forEach((u) => {
|
|
1098
|
+
u.unsubscribe ? u.unsubscribe(o) : u.removeEventListener("abort", o);
|
|
1099
1099
|
}), e = null);
|
|
1100
1100
|
};
|
|
1101
|
-
e.forEach((
|
|
1101
|
+
e.forEach((u) => u.addEventListener("abort", o));
|
|
1102
1102
|
const { signal: d } = r;
|
|
1103
1103
|
return d.unsubscribe = () => a.asap(c), d;
|
|
1104
1104
|
}
|
|
1105
|
-
},
|
|
1105
|
+
}, Mn = function* (e, t) {
|
|
1106
1106
|
let n = e.byteLength;
|
|
1107
1107
|
if (n < t) {
|
|
1108
1108
|
yield e;
|
|
@@ -1113,7 +1113,7 @@ const St = (e) => {
|
|
|
1113
1113
|
s = r + t, yield e.slice(r, s), r = s;
|
|
1114
1114
|
}, $n = async function* (e, t) {
|
|
1115
1115
|
for await (const n of Jn(e))
|
|
1116
|
-
yield*
|
|
1116
|
+
yield* Mn(n, t);
|
|
1117
1117
|
}, Jn = async function* (e) {
|
|
1118
1118
|
if (e[Symbol.asyncIterator]) {
|
|
1119
1119
|
yield* e;
|
|
@@ -1138,19 +1138,19 @@ const St = (e) => {
|
|
|
1138
1138
|
return new ReadableStream({
|
|
1139
1139
|
async pull(d) {
|
|
1140
1140
|
try {
|
|
1141
|
-
const { done:
|
|
1142
|
-
if (
|
|
1141
|
+
const { done: u, value: l } = await s.next();
|
|
1142
|
+
if (u) {
|
|
1143
1143
|
c(), d.close();
|
|
1144
1144
|
return;
|
|
1145
1145
|
}
|
|
1146
|
-
let p =
|
|
1146
|
+
let p = l.byteLength;
|
|
1147
1147
|
if (n) {
|
|
1148
1148
|
let S = o += p;
|
|
1149
1149
|
n(S);
|
|
1150
1150
|
}
|
|
1151
|
-
d.enqueue(new Uint8Array(
|
|
1152
|
-
} catch (
|
|
1153
|
-
throw c(
|
|
1151
|
+
d.enqueue(new Uint8Array(l));
|
|
1152
|
+
} catch (u) {
|
|
1153
|
+
throw c(u), u;
|
|
1154
1154
|
}
|
|
1155
1155
|
},
|
|
1156
1156
|
cancel(d) {
|
|
@@ -1178,9 +1178,9 @@ const St = (e) => {
|
|
|
1178
1178
|
const { fetch: t, Request: n, Response: r } = e, s = t ? oe(t) : typeof fetch == "function", o = oe(n), i = oe(r);
|
|
1179
1179
|
if (!s)
|
|
1180
1180
|
return !1;
|
|
1181
|
-
const c = s && oe(We), d = s && (typeof Ve == "function" ? /* @__PURE__ */ ((f) => (m) => f.encode(m))(new Ve()) : async (f) => new Uint8Array(await new n(f).arrayBuffer())),
|
|
1181
|
+
const c = s && oe(We), d = s && (typeof Ve == "function" ? /* @__PURE__ */ ((f) => (m) => f.encode(m))(new Ve()) : async (f) => new Uint8Array(await new n(f).arrayBuffer())), u = o && c && Ke(() => {
|
|
1182
1182
|
let f = !1;
|
|
1183
|
-
const m = new n(
|
|
1183
|
+
const m = new n(b.origin, {
|
|
1184
1184
|
body: new We(),
|
|
1185
1185
|
method: "POST",
|
|
1186
1186
|
get duplex() {
|
|
@@ -1188,8 +1188,8 @@ const St = (e) => {
|
|
|
1188
1188
|
}
|
|
1189
1189
|
}).headers.has("Content-Type");
|
|
1190
1190
|
return f && !m;
|
|
1191
|
-
}),
|
|
1192
|
-
stream:
|
|
1191
|
+
}), l = i && c && Ke(() => a.isReadableStream(new r("").body)), p = {
|
|
1192
|
+
stream: l && ((f) => f.body)
|
|
1193
1193
|
};
|
|
1194
1194
|
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((f) => {
|
|
1195
1195
|
!p[f] && (p[f] = (m, h) => {
|
|
@@ -1205,7 +1205,7 @@ const St = (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(b.origin, {
|
|
1209
1209
|
method: "POST",
|
|
1210
1210
|
body: f
|
|
1211
1211
|
}).arrayBuffer()).byteLength;
|
|
@@ -1222,33 +1222,33 @@ const St = (e) => {
|
|
|
1222
1222
|
url: m,
|
|
1223
1223
|
method: h,
|
|
1224
1224
|
data: T,
|
|
1225
|
-
signal:
|
|
1226
|
-
cancelToken:
|
|
1225
|
+
signal: U,
|
|
1226
|
+
cancelToken: y,
|
|
1227
1227
|
timeout: A,
|
|
1228
1228
|
onDownloadProgress: I,
|
|
1229
|
-
onUploadProgress:
|
|
1230
|
-
responseType:
|
|
1229
|
+
onUploadProgress: H,
|
|
1230
|
+
responseType: _,
|
|
1231
1231
|
headers: Ee,
|
|
1232
1232
|
withCredentials: ne = "same-origin",
|
|
1233
1233
|
fetchOptions: Ie
|
|
1234
1234
|
} = St(f), Fe = t || fetch;
|
|
1235
|
-
|
|
1236
|
-
let re =
|
|
1235
|
+
_ = _ ? (_ + "").toLowerCase() : "text";
|
|
1236
|
+
let re = qn([U, y && y.toAbortSignal()], A), X = null;
|
|
1237
1237
|
const v = re && re.unsubscribe && (() => {
|
|
1238
1238
|
re.unsubscribe();
|
|
1239
1239
|
});
|
|
1240
1240
|
let Le;
|
|
1241
1241
|
try {
|
|
1242
|
-
if (
|
|
1242
|
+
if (H && u && h !== "get" && h !== "head" && (Le = await w(Ee, T)) !== 0) {
|
|
1243
1243
|
let k = new n(m, {
|
|
1244
1244
|
method: "POST",
|
|
1245
1245
|
body: T,
|
|
1246
1246
|
duplex: "half"
|
|
1247
1247
|
}), G;
|
|
1248
1248
|
if (a.isFormData(T) && (G = k.headers.get("content-type")) && Ee.setContentType(G), k.body) {
|
|
1249
|
-
const [Se, se] =
|
|
1249
|
+
const [Se, se] = Me(
|
|
1250
1250
|
Le,
|
|
1251
|
-
|
|
1251
|
+
ue($e(H))
|
|
1252
1252
|
);
|
|
1253
1253
|
T = ze(k.body, Ge, Se, se);
|
|
1254
1254
|
}
|
|
@@ -1265,15 +1265,15 @@ const St = (e) => {
|
|
|
1265
1265
|
};
|
|
1266
1266
|
X = o && new n(m, xe);
|
|
1267
1267
|
let P = await (o ? Fe(X, Ie) : Fe(m, xe));
|
|
1268
|
-
const Pe =
|
|
1269
|
-
if (
|
|
1268
|
+
const Pe = l && (_ === "stream" || _ === "response");
|
|
1269
|
+
if (l && (I || Pe && v)) {
|
|
1270
1270
|
const k = {};
|
|
1271
1271
|
["status", "statusText", "headers"].forEach((ke) => {
|
|
1272
1272
|
k[ke] = P[ke];
|
|
1273
1273
|
});
|
|
1274
|
-
const G = a.toFiniteNumber(P.headers.get("content-length")), [Se, se] = I &&
|
|
1274
|
+
const G = a.toFiniteNumber(P.headers.get("content-length")), [Se, se] = I && Me(
|
|
1275
1275
|
G,
|
|
1276
|
-
|
|
1276
|
+
ue($e(I), !0)
|
|
1277
1277
|
) || [];
|
|
1278
1278
|
P = new r(
|
|
1279
1279
|
ze(P.body, Ge, Se, () => {
|
|
@@ -1282,8 +1282,8 @@ const St = (e) => {
|
|
|
1282
1282
|
k
|
|
1283
1283
|
);
|
|
1284
1284
|
}
|
|
1285
|
-
|
|
1286
|
-
let Ot = await p[a.findKey(p,
|
|
1285
|
+
_ = _ || "text";
|
|
1286
|
+
let Ot = await p[a.findKey(p, _) || "text"](P, f);
|
|
1287
1287
|
return !Pe && v && v(), await new Promise((k, G) => {
|
|
1288
1288
|
mt(k, G, {
|
|
1289
1289
|
data: Ot,
|
|
@@ -1310,14 +1310,14 @@ const St = (e) => {
|
|
|
1310
1310
|
s,
|
|
1311
1311
|
n
|
|
1312
1312
|
];
|
|
1313
|
-
let i = o.length, c = i, d,
|
|
1313
|
+
let i = o.length, c = i, d, u, l = Wn;
|
|
1314
1314
|
for (; c--; )
|
|
1315
|
-
d = o[c],
|
|
1316
|
-
return
|
|
1315
|
+
d = o[c], u = l.get(d), u === void 0 && l.set(d, u = c ? /* @__PURE__ */ new Map() : Gn(t)), l = u;
|
|
1316
|
+
return u;
|
|
1317
1317
|
};
|
|
1318
1318
|
Rt();
|
|
1319
1319
|
const De = {
|
|
1320
|
-
http:
|
|
1320
|
+
http: un,
|
|
1321
1321
|
xhr: vn,
|
|
1322
1322
|
fetch: {
|
|
1323
1323
|
get: Rt
|
|
@@ -1349,7 +1349,7 @@ function Kn(e, t) {
|
|
|
1349
1349
|
}
|
|
1350
1350
|
if (!s) {
|
|
1351
1351
|
const i = Object.entries(o).map(
|
|
1352
|
-
([d,
|
|
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
1355
|
` + i.map(Xe).join(`
|
|
@@ -1373,29 +1373,29 @@ const Tt = {
|
|
|
1373
1373
|
*/
|
|
1374
1374
|
adapters: De
|
|
1375
1375
|
};
|
|
1376
|
-
function
|
|
1376
|
+
function ye(e) {
|
|
1377
1377
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1378
1378
|
throw new K(null, e);
|
|
1379
1379
|
}
|
|
1380
1380
|
function Qe(e) {
|
|
1381
|
-
return
|
|
1381
|
+
return ye(e), e.headers = C.from(e.headers), e.data = Te.call(
|
|
1382
1382
|
e,
|
|
1383
1383
|
e.transformRequest
|
|
1384
1384
|
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Tt.getAdapter(e.adapter || te.adapter, e)(e).then(function(r) {
|
|
1385
|
-
return
|
|
1385
|
+
return ye(e), r.data = Te.call(
|
|
1386
1386
|
e,
|
|
1387
1387
|
e.transformResponse,
|
|
1388
1388
|
r
|
|
1389
1389
|
), r.headers = C.from(r.headers), r;
|
|
1390
1390
|
}, function(r) {
|
|
1391
|
-
return pt(r) || (
|
|
1391
|
+
return pt(r) || (ye(e), r && r.response && (r.response.data = Te.call(
|
|
1392
1392
|
e,
|
|
1393
1393
|
e.transformResponse,
|
|
1394
1394
|
r.response
|
|
1395
1395
|
), r.response.headers = C.from(r.response.headers))), Promise.reject(r);
|
|
1396
1396
|
});
|
|
1397
1397
|
}
|
|
1398
|
-
const
|
|
1398
|
+
const yt = "1.13.2", me = {};
|
|
1399
1399
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1400
1400
|
me[e] = function(r) {
|
|
1401
1401
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
@@ -1404,7 +1404,7 @@ const bt = "1.13.2", me = {};
|
|
|
1404
1404
|
const Ye = {};
|
|
1405
1405
|
me.transitional = function(t, n, r) {
|
|
1406
1406
|
function s(o, i) {
|
|
1407
|
-
return "[Axios v" +
|
|
1407
|
+
return "[Axios v" + yt + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
|
|
1408
1408
|
}
|
|
1409
1409
|
return (o, i, c) => {
|
|
1410
1410
|
if (t === !1)
|
|
@@ -1507,16 +1507,16 @@ let $ = class {
|
|
|
1507
1507
|
this.interceptors.request.forEach(function(m) {
|
|
1508
1508
|
typeof m.runWhen == "function" && m.runWhen(n) === !1 || (d = d && m.synchronous, c.unshift(m.fulfilled, m.rejected));
|
|
1509
1509
|
});
|
|
1510
|
-
const
|
|
1510
|
+
const u = [];
|
|
1511
1511
|
this.interceptors.response.forEach(function(m) {
|
|
1512
|
-
|
|
1512
|
+
u.push(m.fulfilled, m.rejected);
|
|
1513
1513
|
});
|
|
1514
|
-
let
|
|
1514
|
+
let l, p = 0, S;
|
|
1515
1515
|
if (!d) {
|
|
1516
1516
|
const f = [Qe.bind(this), void 0];
|
|
1517
|
-
for (f.unshift(...c), f.push(...
|
|
1518
|
-
|
|
1519
|
-
return
|
|
1517
|
+
for (f.unshift(...c), f.push(...u), S = f.length, l = Promise.resolve(n); p < S; )
|
|
1518
|
+
l = l.then(f[p++], f[p++]);
|
|
1519
|
+
return l;
|
|
1520
1520
|
}
|
|
1521
1521
|
S = c.length;
|
|
1522
1522
|
let w = n;
|
|
@@ -1530,13 +1530,13 @@ let $ = class {
|
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
1532
1532
|
try {
|
|
1533
|
-
|
|
1533
|
+
l = Qe.call(this, w);
|
|
1534
1534
|
} catch (f) {
|
|
1535
1535
|
return Promise.reject(f);
|
|
1536
1536
|
}
|
|
1537
|
-
for (p = 0, S =
|
|
1538
|
-
|
|
1539
|
-
return
|
|
1537
|
+
for (p = 0, S = u.length; p < S; )
|
|
1538
|
+
l = l.then(u[p++], u[p++]);
|
|
1539
|
+
return l;
|
|
1540
1540
|
}
|
|
1541
1541
|
getUri(t) {
|
|
1542
1542
|
t = J(this.defaults, t);
|
|
@@ -1723,18 +1723,18 @@ const Ae = {
|
|
|
1723
1723
|
Object.entries(Ae).forEach(([e, t]) => {
|
|
1724
1724
|
Ae[t] = e;
|
|
1725
1725
|
});
|
|
1726
|
-
function
|
|
1726
|
+
function bt(e) {
|
|
1727
1727
|
const t = new $(e), n = Ze($.prototype.request, t);
|
|
1728
1728
|
return a.extend(n, $.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1729
|
-
return
|
|
1729
|
+
return bt(J(e, s));
|
|
1730
1730
|
}, n;
|
|
1731
1731
|
}
|
|
1732
|
-
const R =
|
|
1732
|
+
const R = bt(te);
|
|
1733
1733
|
R.Axios = $;
|
|
1734
1734
|
R.CanceledError = K;
|
|
1735
1735
|
R.CancelToken = Qn;
|
|
1736
1736
|
R.isCancel = pt;
|
|
1737
|
-
R.VERSION =
|
|
1737
|
+
R.VERSION = yt;
|
|
1738
1738
|
R.toFormData = pe;
|
|
1739
1739
|
R.AxiosError = E;
|
|
1740
1740
|
R.Cancel = R.CanceledError;
|
|
@@ -1759,16 +1759,16 @@ const {
|
|
|
1759
1759
|
all: Sr,
|
|
1760
1760
|
Cancel: Rr,
|
|
1761
1761
|
isAxiosError: Tr,
|
|
1762
|
-
spread:
|
|
1762
|
+
spread: yr,
|
|
1763
1763
|
toFormData: wr,
|
|
1764
|
-
AxiosHeaders:
|
|
1764
|
+
AxiosHeaders: br,
|
|
1765
1765
|
HttpStatusCode: Or,
|
|
1766
1766
|
formToJSON: Ar,
|
|
1767
1767
|
getAdapter: Nr,
|
|
1768
1768
|
mergeConfig: gr
|
|
1769
1769
|
} = R, Ne = "JOYTALK_TOKEN";
|
|
1770
|
-
var
|
|
1771
|
-
const
|
|
1770
|
+
var q = /* @__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))(q || {}), B = /* @__PURE__ */ ((e) => (e.TEXT = "1", e.IMAGE = "2", e.VIDEO = "3", e.FILE = "4", e.FAQ = "5", e))(B || {}), j = /* @__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))(j || {}), ge = /* @__PURE__ */ ((e) => (e.CUSTOMER = "1", e.USER = "2", e.ANONYMOUS = "3", e))(ge || {}), N = /* @__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))(N || {}), O = /* @__PURE__ */ ((e) => (e.DISCONNECTED = "disconnected", e.CONNECTING = "connecting", e.CONNECTED = "connected", e.RECONNECTING = "reconnecting", e.ERROR = "error", e))(O || {});
|
|
1771
|
+
const D = {
|
|
1772
1772
|
/** 未初始化 */
|
|
1773
1773
|
UNINITIALIZED: {
|
|
1774
1774
|
code: 10001,
|
|
@@ -1833,7 +1833,7 @@ z.interceptors.request.use(
|
|
|
1833
1833
|
if (!e.noAuth) {
|
|
1834
1834
|
const t = localStorage.getItem(Ne);
|
|
1835
1835
|
if (!t)
|
|
1836
|
-
return Promise.reject(
|
|
1836
|
+
return Promise.reject(D.UNINITIALIZED);
|
|
1837
1837
|
e.headers.Authorization = `Bearer ${t}`;
|
|
1838
1838
|
}
|
|
1839
1839
|
return delete e.noAuth, e;
|
|
@@ -1914,7 +1914,7 @@ function ar(e) {
|
|
|
1914
1914
|
return `ws://dev-joytalk-api.halaladmin.vip/api/ws?Authorization=${e}`;
|
|
1915
1915
|
}
|
|
1916
1916
|
const cr = "https://joytalk-fat.obs.ap-southeast-1.myhuaweicloud.com/";
|
|
1917
|
-
class
|
|
1917
|
+
class le extends ir {
|
|
1918
1918
|
config = {
|
|
1919
1919
|
token: "",
|
|
1920
1920
|
autoReconnect: !0,
|
|
@@ -1930,21 +1930,21 @@ class ue extends ir {
|
|
|
1930
1930
|
heartbeatTimeoutTimer = null;
|
|
1931
1931
|
/** 最后一次心跳时间 */
|
|
1932
1932
|
lastHeartbeatTime = 0;
|
|
1933
|
-
/**
|
|
1934
|
-
|
|
1933
|
+
/** 咨询类型ID */
|
|
1934
|
+
consultationTypeId = "";
|
|
1935
1935
|
/** obs 地址 */
|
|
1936
1936
|
OBS_URL = cr;
|
|
1937
1937
|
sessionData = null;
|
|
1938
1938
|
userInfo = null;
|
|
1939
1939
|
static instance = null;
|
|
1940
1940
|
constructor() {
|
|
1941
|
-
if (super(),
|
|
1942
|
-
return
|
|
1943
|
-
|
|
1941
|
+
if (super(), le.instance)
|
|
1942
|
+
return le.instance;
|
|
1943
|
+
le.instance = this;
|
|
1944
1944
|
}
|
|
1945
1945
|
async init(t) {
|
|
1946
1946
|
if (!t.token)
|
|
1947
|
-
return localStorage.removeItem(Ne), Promise.reject(
|
|
1947
|
+
return localStorage.removeItem(Ne), Promise.reject(D.PARAMETER_ERROR);
|
|
1948
1948
|
this.config = Object.assign(this.config, t), localStorage.setItem(Ne, this.config.token);
|
|
1949
1949
|
}
|
|
1950
1950
|
/**
|
|
@@ -1952,9 +1952,9 @@ class ue extends ir {
|
|
|
1952
1952
|
* @returns Promise<void>
|
|
1953
1953
|
*/
|
|
1954
1954
|
connect(t) {
|
|
1955
|
-
return this.
|
|
1955
|
+
return this.consultationTypeId = t, new Promise((n, r) => {
|
|
1956
1956
|
if (!this.config.token)
|
|
1957
|
-
return r(
|
|
1957
|
+
return r(D.UNINITIALIZED);
|
|
1958
1958
|
if (this.status === O.CONNECTED)
|
|
1959
1959
|
return n();
|
|
1960
1960
|
if (this.status !== O.CONNECTING) {
|
|
@@ -1992,49 +1992,50 @@ class ue extends ir {
|
|
|
1992
1992
|
* @param data - 消息内容
|
|
1993
1993
|
* @param chatType - 聊天类型
|
|
1994
1994
|
* @param msgType - 消息类型
|
|
1995
|
-
* @returns
|
|
1995
|
+
* @returns Promise<string>
|
|
1996
1996
|
*/
|
|
1997
|
-
sendMessage(t, n, r =
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
if (this.status === O.DISCONNECTED
|
|
2014
|
-
console.log("
|
|
2015
|
-
if (this.ws)
|
|
2016
|
-
return console.log("连接成功,重新发送消息"), this.sendMessage(t, n, r);
|
|
2017
|
-
console.error(U.DISCONNECTED), o(U.DISCONNECTED);
|
|
2018
|
-
}).catch((c) => {
|
|
2019
|
-
o(c);
|
|
2020
|
-
});
|
|
2021
|
-
else if (this.status !== O.CONNECTED || !this.ws)
|
|
2022
|
-
console.log("连接断开,重新连接"), console.error(U.DISCONNECTED), o(U.DISCONNECTED);
|
|
2023
|
-
else
|
|
1997
|
+
async sendMessage(t, n, r = q.SEND) {
|
|
1998
|
+
console.log("发送消息", {
|
|
1999
|
+
data: t,
|
|
2000
|
+
chatType: n,
|
|
2001
|
+
msgType: r,
|
|
2002
|
+
status: this.status,
|
|
2003
|
+
ws: this.ws
|
|
2004
|
+
});
|
|
2005
|
+
const s = {
|
|
2006
|
+
msgType: r,
|
|
2007
|
+
data: t,
|
|
2008
|
+
toUid: this.sessionData?.cid,
|
|
2009
|
+
chatType: n,
|
|
2010
|
+
editId: void 0
|
|
2011
|
+
};
|
|
2012
|
+
if (this.status !== O.CONNECTED || !this.ws)
|
|
2013
|
+
if (this.ws && this.status === O.DISCONNECTED) {
|
|
2014
|
+
console.log("连接断开,尝试重新连接");
|
|
2024
2015
|
try {
|
|
2025
|
-
this.
|
|
2026
|
-
} catch {
|
|
2027
|
-
console.error(
|
|
2016
|
+
await this.connect(this.consultationTypeId);
|
|
2017
|
+
} catch (o) {
|
|
2018
|
+
throw console.error("重连失败:", o), D.DISCONNECTED;
|
|
2028
2019
|
}
|
|
2029
|
-
|
|
2020
|
+
} else
|
|
2021
|
+
throw console.error(D.DISCONNECTED), D.DISCONNECTED;
|
|
2022
|
+
try {
|
|
2023
|
+
if (!this.ws)
|
|
2024
|
+
throw D.DISCONNECTED;
|
|
2025
|
+
return this.ws.send(JSON.stringify(s)), t;
|
|
2026
|
+
} catch (o) {
|
|
2027
|
+
throw console.error("发送消息失败:", o), D.MESSAGE_SEND_FAIL;
|
|
2028
|
+
}
|
|
2030
2029
|
}
|
|
2031
2030
|
/**
|
|
2032
2031
|
* 发送文本消息
|
|
2033
2032
|
* @param content - 消息内容
|
|
2034
|
-
* @returns
|
|
2033
|
+
* @returns Promise<string>
|
|
2035
2034
|
*/
|
|
2036
|
-
sendText(t) {
|
|
2037
|
-
|
|
2035
|
+
async sendText(t) {
|
|
2036
|
+
if (!this.sessionData)
|
|
2037
|
+
throw console.error(D.NO_CUSTOMER_SERVICE), D.NO_CUSTOMER_SERVICE;
|
|
2038
|
+
return this.sendMessage(t, B.TEXT);
|
|
2038
2039
|
}
|
|
2039
2040
|
/**
|
|
2040
2041
|
* 发送文件消息
|
|
@@ -2049,7 +2050,7 @@ class ue extends ir {
|
|
|
2049
2050
|
}) {
|
|
2050
2051
|
try {
|
|
2051
2052
|
if (!this.sessionData)
|
|
2052
|
-
|
|
2053
|
+
throw console.error(D.NO_CUSTOMER_SERVICE), D.NO_CUSTOMER_SERVICE;
|
|
2053
2054
|
const [s, o] = await Promise.all([
|
|
2054
2055
|
this.handleUploadFile(t),
|
|
2055
2056
|
n ? this.handleUploadFile(n) : Promise.resolve(void 0)
|
|
@@ -2092,18 +2093,18 @@ class ue extends ir {
|
|
|
2092
2093
|
try {
|
|
2093
2094
|
switch (t.code) {
|
|
2094
2095
|
// 连接成功
|
|
2095
|
-
case
|
|
2096
|
+
case j.CONNECT_SUCCESS:
|
|
2096
2097
|
if (this.sessionData)
|
|
2097
2098
|
return;
|
|
2098
2099
|
this.sendMessage(
|
|
2099
|
-
this.
|
|
2100
|
+
this.consultationTypeId,
|
|
2100
2101
|
void 0,
|
|
2101
|
-
|
|
2102
|
+
q.INBOUND
|
|
2102
2103
|
);
|
|
2103
2104
|
break;
|
|
2104
2105
|
// 匹配成功
|
|
2105
|
-
case
|
|
2106
|
-
case
|
|
2106
|
+
case j.MATCH_INFO:
|
|
2107
|
+
case j.MATCH_SUCCESS:
|
|
2107
2108
|
if (this.sessionData)
|
|
2108
2109
|
return;
|
|
2109
2110
|
const n = JSON.parse(
|
|
@@ -2111,7 +2112,7 @@ class ue extends ir {
|
|
|
2111
2112
|
);
|
|
2112
2113
|
this.sessionData = n, t.data = n, this.getFaqList(), this.emit(N.MESSAGE, t);
|
|
2113
2114
|
break;
|
|
2114
|
-
case
|
|
2115
|
+
case j.TRANSFER_USER_SUCCESS:
|
|
2115
2116
|
const r = JSON.parse(
|
|
2116
2117
|
typeof t.data == "string" ? t.data : JSON.stringify(t.data)
|
|
2117
2118
|
);
|
|
@@ -2126,7 +2127,7 @@ class ue extends ir {
|
|
|
2126
2127
|
uid: r.uid
|
|
2127
2128
|
}, t.data = this.sessionData, this.emit(N.MESSAGE, t);
|
|
2128
2129
|
break;
|
|
2129
|
-
case
|
|
2130
|
+
case j.SEND_SUCCESS:
|
|
2130
2131
|
const s = JSON.parse(
|
|
2131
2132
|
typeof t.data == "string" ? t.data : JSON.stringify(t.data)
|
|
2132
2133
|
);
|
|
@@ -2166,7 +2167,7 @@ class ue extends ir {
|
|
|
2166
2167
|
*/
|
|
2167
2168
|
scheduleReconnect() {
|
|
2168
2169
|
this.clearReconnectTimer(), this.reconnectAttempts++, this.setStatus(O.RECONNECTING), this.reconnectTimer = setTimeout(() => {
|
|
2169
|
-
this.connect(this.
|
|
2170
|
+
this.connect(this.consultationTypeId).catch((t) => {
|
|
2170
2171
|
console.error("重连失败:", t);
|
|
2171
2172
|
});
|
|
2172
2173
|
}, this.config.reconnectInterval);
|
|
@@ -2226,8 +2227,8 @@ class ue extends ir {
|
|
|
2226
2227
|
}
|
|
2227
2228
|
handleUploadFile(t) {
|
|
2228
2229
|
return new Promise(async (n, r) => {
|
|
2229
|
-
const s = t.name.split(".").pop(), o = await er({ ext: s || "" }), { accessKeyId: i, signature: c, policy: d, key:
|
|
2230
|
-
|
|
2230
|
+
const s = t.name.split(".").pop(), o = await er({ ext: s || "" }), { accessKeyId: i, signature: c, policy: d, key: u } = o.data, l = new FormData();
|
|
2231
|
+
l.append("key", u), l.append("AccessKeyId", i), l.append("signature", c), l.append("policy", d), l.append("file", t), (await tr(l)).status === 204 ? n(this.OBS_URL + u) : r(new Error("上传文件失败"));
|
|
2231
2232
|
});
|
|
2232
2233
|
}
|
|
2233
2234
|
/**
|
|
@@ -2252,11 +2253,11 @@ class ue extends ir {
|
|
|
2252
2253
|
r(new Error("无法生成缩略图"));
|
|
2253
2254
|
return;
|
|
2254
2255
|
}
|
|
2255
|
-
const
|
|
2256
|
+
const u = t.name.replace(/\.[^/.]+$/, "") + "_thumb.jpg", l = new File([d], u, {
|
|
2256
2257
|
type: "image/jpeg",
|
|
2257
2258
|
lastModified: Date.now()
|
|
2258
2259
|
});
|
|
2259
|
-
n(
|
|
2260
|
+
n(l);
|
|
2260
2261
|
},
|
|
2261
2262
|
"image/jpeg",
|
|
2262
2263
|
0.6
|
|
@@ -2282,7 +2283,7 @@ class ue extends ir {
|
|
|
2282
2283
|
};
|
|
2283
2284
|
setTimeout(() => {
|
|
2284
2285
|
const r = {
|
|
2285
|
-
code:
|
|
2286
|
+
code: j.SEND_SUCCESS,
|
|
2286
2287
|
data: {
|
|
2287
2288
|
content: n,
|
|
2288
2289
|
contentType: B.FAQ,
|
|
@@ -2290,9 +2291,9 @@ class ue extends ir {
|
|
|
2290
2291
|
customerServiceAvatar: this.sessionData?.customerAvatar,
|
|
2291
2292
|
customerServiceName: this.sessionData?.customerName,
|
|
2292
2293
|
createTime: Date.now(),
|
|
2293
|
-
msgType:
|
|
2294
|
+
msgType: q.SEND
|
|
2294
2295
|
},
|
|
2295
|
-
msgType:
|
|
2296
|
+
msgType: q.SEND,
|
|
2296
2297
|
chatType: B.FAQ,
|
|
2297
2298
|
toUid: this.sessionData?.uid
|
|
2298
2299
|
};
|
|
@@ -2301,17 +2302,17 @@ class ue extends ir {
|
|
|
2301
2302
|
}
|
|
2302
2303
|
sendFaq(t) {
|
|
2303
2304
|
const n = {
|
|
2304
|
-
code:
|
|
2305
|
+
code: j.SEND_SUCCESS,
|
|
2305
2306
|
data: {
|
|
2306
2307
|
sendUserType: ge.CUSTOMER,
|
|
2307
2308
|
customerServiceAvatar: this.sessionData?.customerAvatar,
|
|
2308
2309
|
customerServiceName: this.sessionData?.customerName,
|
|
2309
2310
|
createTime: Date.now(),
|
|
2310
|
-
msgType:
|
|
2311
|
+
msgType: q.SEND,
|
|
2311
2312
|
contentType: B.FAQ,
|
|
2312
2313
|
content: {}
|
|
2313
2314
|
},
|
|
2314
|
-
msgType:
|
|
2315
|
+
msgType: q.SEND,
|
|
2315
2316
|
chatType: B.FAQ,
|
|
2316
2317
|
toUid: this.sessionData?.uid
|
|
2317
2318
|
};
|
|
@@ -2337,9 +2338,9 @@ export {
|
|
|
2337
2338
|
B as ChatType,
|
|
2338
2339
|
O as ConnectionStatus,
|
|
2339
2340
|
N as EventType,
|
|
2340
|
-
|
|
2341
|
-
|
|
2341
|
+
j as MessageCode,
|
|
2342
|
+
q as MessageType,
|
|
2342
2343
|
ge as SendUserType,
|
|
2343
2344
|
Ne as TOKEN_KEY,
|
|
2344
|
-
|
|
2345
|
+
le as default
|
|
2345
2346
|
};
|