@flyfish-group/file-viewer 1.0.0
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 +111 -0
- package/dist/components/ImageViewer.js +1679 -0
- package/dist/components/MarkdownViewer.js +1459 -0
- package/dist/components/PdfView.js +22460 -0
- package/dist/components/PptxRender.js +21744 -0
- package/dist/components/XlsxTable.js +49412 -0
- package/dist/components/_commonjs-dynamic-modules.js +6 -0
- package/dist/components/_commonjsHelpers.js +30 -0
- package/dist/components/docx-preview.min.js +5354 -0
- package/dist/components/index.js +1787 -0
- package/dist/components/utils.d.ts +3 -0
- package/dist/components/worker-ref.js +21 -0
- package/dist/index.mjs +6 -0
- package/dist/index.umd.js +325 -0
- package/dist/main.d.ts +0 -0
- package/dist/package/common/type.d.ts +30 -0
- package/dist/package/common/util.d.ts +5 -0
- package/dist/package/common/worker-ref.d.ts +12 -0
- package/dist/package/components/FileViewer/FileViewer.vue.d.ts +18 -0
- package/dist/package/components/FileViewer/index.d.ts +2 -0
- package/dist/package/components/FileViewer/util.d.ts +2 -0
- package/dist/package/index.d.ts +11 -0
- package/dist/package/use/index.d.ts +1 -0
- package/dist/package/use/worker.d.ts +24 -0
- package/dist/package/vendors/docx/index.d.ts +4 -0
- package/dist/package/vendors/image/ImageViewer.vue.d.ts +15 -0
- package/dist/package/vendors/image/index.d.ts +5 -0
- package/dist/package/vendors/md/MarkdownViewer.vue.d.ts +15 -0
- package/dist/package/vendors/md/index.d.ts +5 -0
- package/dist/package/vendors/mp4/index.d.ts +4 -0
- package/dist/package/vendors/pdf/PdfView.vue.d.ts +15 -0
- package/dist/package/vendors/pdf/index.d.ts +2 -0
- package/dist/package/vendors/pdf/worker/index.d.ts +4 -0
- package/dist/package/vendors/pptx/PptxRender.vue.d.ts +87 -0
- package/dist/package/vendors/pptx/index.d.ts +7 -0
- package/dist/package/vendors/pptx/options.d.ts +39 -0
- package/dist/package/vendors/pptx/support/chart.d.ts +4 -0
- package/dist/package/vendors/pptx/worker/index.d.ts +4 -0
- package/dist/package/vendors/renders.d.ts +3 -0
- package/dist/package/vendors/text/CodeViewer.vue.d.ts +15 -0
- package/dist/package/vendors/text/index.d.ts +7 -0
- package/dist/package/vendors/xlsx/XlsxTable.vue.d.ts +17 -0
- package/dist/package/vendors/xlsx/index.d.ts +5 -0
- package/dist/package/vendors/xlsx/render.d.ts +6 -0
- package/dist/package/vendors/xlsx/util.d.ts +8 -0
- package/dist/package/vendors/xlsx/worker/index.d.ts +6 -0
- package/dist/package/vendors/xlsx/worker/xls/SheetJsModel.d.ts +36 -0
- package/dist/package/vendors/xlsx/worker/xls/index.d.ts +4 -0
- package/dist/package/vendors/xlsx/worker/xls/sheet.worker.d.ts +1 -0
- package/dist/package/vendors/xlsx/worker/xlsx/ExcelJsModel.d.ts +39 -0
- package/dist/package/vendors/xlsx/worker/xlsx/color.d.ts +2 -0
- package/dist/package/vendors/xlsx/worker/xlsx/context.d.ts +7 -0
- package/dist/package/vendors/xlsx/worker/xlsx/index.d.ts +4 -0
- package/dist/package/vendors/xlsx/worker/xlsx/util.d.ts +10 -0
- package/dist/package/vendors/xlsx/worker/xlsx/xlsx.worker.d.ts +2 -0
- package/dist/style.css +57 -0
- package/dist/vite.svg +1 -0
- package/dist/worker/pdf.worker.js +58 -0
- package/dist/worker/pptx.worker.js +21 -0
- package/dist/worker/sheet.worker.js +38 -0
- package/dist/worker/xlsx.worker.js +62 -0
- package/package.json +76 -0
|
@@ -0,0 +1,1787 @@
|
|
|
1
|
+
var Xe = Object.defineProperty;
|
|
2
|
+
var Ge = (e, t, n) => t in e ? Xe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var ce = (e, t, n) => (Ge(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
import P, { defineAsyncComponent as U, defineComponent as ge, ref as F, onMounted as Qe, watch as le } from "vue";
|
|
5
|
+
const Ze = (() => {
|
|
6
|
+
const e = {
|
|
7
|
+
module: null,
|
|
8
|
+
async load() {
|
|
9
|
+
return this.module || (this.module = import("./docx-preview.min.js").then((t) => t.d)), this.module;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
return async () => await e.load();
|
|
13
|
+
})();
|
|
14
|
+
async function Ye(e, t) {
|
|
15
|
+
const { defaultOptions: n, renderAsync: r } = await Ze(), s = Object.assign(n, {
|
|
16
|
+
debug: !0,
|
|
17
|
+
experimental: !0
|
|
18
|
+
});
|
|
19
|
+
await r(e, t, void 0, s);
|
|
20
|
+
}
|
|
21
|
+
const et = U(() => import("./PptxRender.js"));
|
|
22
|
+
async function tt(e, t) {
|
|
23
|
+
return new P({
|
|
24
|
+
render: (n) => n(et, {
|
|
25
|
+
props: {
|
|
26
|
+
data: e
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
}).$mount(t);
|
|
30
|
+
}
|
|
31
|
+
const nt = U(() => import("./XlsxTable.js"));
|
|
32
|
+
async function ue(e, t, n) {
|
|
33
|
+
return new P({
|
|
34
|
+
render: (r) => r(nt, {
|
|
35
|
+
props: {
|
|
36
|
+
data: e,
|
|
37
|
+
type: n
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
}).$mount(t);
|
|
41
|
+
}
|
|
42
|
+
const rt = U(() => import("./PdfView.js"));
|
|
43
|
+
async function st(e, t) {
|
|
44
|
+
return new P({
|
|
45
|
+
render: (n) => n(rt, {
|
|
46
|
+
props: {
|
|
47
|
+
data: e
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
}).$mount(t);
|
|
51
|
+
}
|
|
52
|
+
async function ot(e) {
|
|
53
|
+
return new Promise((t, n) => {
|
|
54
|
+
const r = new FileReader();
|
|
55
|
+
r.onload = (s) => {
|
|
56
|
+
var o;
|
|
57
|
+
return t((o = s.target) == null ? void 0 : o.result);
|
|
58
|
+
}, r.onerror = (s) => n(s), r.readAsArrayBuffer(e);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
async function it(e) {
|
|
62
|
+
return new Promise((t, n) => {
|
|
63
|
+
const r = new FileReader();
|
|
64
|
+
r.onload = (s) => {
|
|
65
|
+
var i;
|
|
66
|
+
const o = (i = s.target) == null ? void 0 : i.result;
|
|
67
|
+
typeof o == "string" && t(o);
|
|
68
|
+
}, r.onerror = (s) => n(s), r.readAsDataURL(new Blob([e]));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
async function Oe(e) {
|
|
72
|
+
return new Promise((t, n) => {
|
|
73
|
+
const r = new FileReader();
|
|
74
|
+
r.onload = (s) => {
|
|
75
|
+
var i;
|
|
76
|
+
const o = (i = s.target) == null ? void 0 : i.result;
|
|
77
|
+
typeof o == "string" && t(o);
|
|
78
|
+
}, r.onerror = (s) => n(s), r.readAsText(new Blob([e]), "utf-8");
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const at = U(() => import("./ImageViewer.js"));
|
|
82
|
+
async function ct(e, t) {
|
|
83
|
+
const n = await it(e);
|
|
84
|
+
return new P({
|
|
85
|
+
render: (r) => r(at, {
|
|
86
|
+
props: {
|
|
87
|
+
image: n
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
}).$mount(t);
|
|
91
|
+
}
|
|
92
|
+
const lt = U(() => import("./MarkdownViewer.js"));
|
|
93
|
+
async function ut(e, t) {
|
|
94
|
+
const n = await Oe(e);
|
|
95
|
+
return new P({
|
|
96
|
+
render: (r) => r(lt, {
|
|
97
|
+
props: {
|
|
98
|
+
data: n
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
}).$mount(t);
|
|
102
|
+
}
|
|
103
|
+
const ft = /* @__PURE__ */ ge({
|
|
104
|
+
__name: "CodeViewer",
|
|
105
|
+
props: {
|
|
106
|
+
value: null
|
|
107
|
+
},
|
|
108
|
+
setup(e) {
|
|
109
|
+
return { __sfc: !0 };
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
function Ae(e, t, n, r, s, o, i, l) {
|
|
113
|
+
var f = typeof e == "function" ? e.options : e;
|
|
114
|
+
t && (f.render = t, f.staticRenderFns = n, f._compiled = !0), r && (f.functional = !0), o && (f._scopeId = "data-v-" + o);
|
|
115
|
+
var d;
|
|
116
|
+
if (i ? (d = function(m) {
|
|
117
|
+
m = m || // cached call
|
|
118
|
+
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
119
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !m && typeof __VUE_SSR_CONTEXT__ < "u" && (m = __VUE_SSR_CONTEXT__), s && s.call(this, m), m && m._registeredComponents && m._registeredComponents.add(i);
|
|
120
|
+
}, f._ssrRegister = d) : s && (d = l ? function() {
|
|
121
|
+
s.call(
|
|
122
|
+
this,
|
|
123
|
+
(f.functional ? this.parent : this).$root.$options.shadowRoot
|
|
124
|
+
);
|
|
125
|
+
} : s), d)
|
|
126
|
+
if (f.functional) {
|
|
127
|
+
f._injectStyles = d;
|
|
128
|
+
var u = f.render;
|
|
129
|
+
f.render = function(E, p) {
|
|
130
|
+
return d.call(p), u(E, p);
|
|
131
|
+
};
|
|
132
|
+
} else {
|
|
133
|
+
var c = f.beforeCreate;
|
|
134
|
+
f.beforeCreate = c ? [].concat(c, d) : [d];
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
exports: e,
|
|
138
|
+
options: f
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
var dt = function() {
|
|
142
|
+
var t = this, n = t._self._c;
|
|
143
|
+
return t._self._setupProxy, n("pre", { staticClass: "code-area" }, [t._v(" " + t._s(t.value) + `
|
|
144
|
+
`)]);
|
|
145
|
+
}, pt = [], ht = /* @__PURE__ */ Ae(
|
|
146
|
+
ft,
|
|
147
|
+
dt,
|
|
148
|
+
pt,
|
|
149
|
+
!1,
|
|
150
|
+
null,
|
|
151
|
+
"3be501eb",
|
|
152
|
+
null,
|
|
153
|
+
null
|
|
154
|
+
);
|
|
155
|
+
const mt = ht.exports;
|
|
156
|
+
async function yt(e, t) {
|
|
157
|
+
const n = await Oe(e);
|
|
158
|
+
return new P({
|
|
159
|
+
render: (r) => r(mt, {
|
|
160
|
+
props: {
|
|
161
|
+
value: n
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
}).$mount(t);
|
|
165
|
+
}
|
|
166
|
+
function wt(e, t) {
|
|
167
|
+
const n = document.createElement("video");
|
|
168
|
+
n.width = 840, n.height = 480, n.controls = !0;
|
|
169
|
+
const r = document.createElement("source");
|
|
170
|
+
r.src = URL.createObjectURL(new Blob([e])), n.appendChild(r), t.appendChild(n);
|
|
171
|
+
}
|
|
172
|
+
const j = (e) => ({
|
|
173
|
+
$el: e,
|
|
174
|
+
$destroy() {
|
|
175
|
+
}
|
|
176
|
+
}), bt = [
|
|
177
|
+
// 使用docxjs支持,目前效果最好的渲染器
|
|
178
|
+
{
|
|
179
|
+
accepts: ["docx"],
|
|
180
|
+
handler: async (e, t) => (await Ye(e, t), window.dispatchEvent(new Event("resize")), j(t))
|
|
181
|
+
},
|
|
182
|
+
// 使用pptx2html,已通过默认值更替
|
|
183
|
+
{
|
|
184
|
+
accepts: ["pptx"],
|
|
185
|
+
handler: async (e, t) => (await tt(e, t), window.dispatchEvent(new Event("resize")), j(t))
|
|
186
|
+
},
|
|
187
|
+
// 使用exceljs + handsontable,全部样式
|
|
188
|
+
{
|
|
189
|
+
accepts: ["xlsx"],
|
|
190
|
+
handler: async (e, t) => ue(e, t, "xml")
|
|
191
|
+
},
|
|
192
|
+
// 使用js-xlsx + handsontable,无样式
|
|
193
|
+
{
|
|
194
|
+
accepts: ["xlsm", "xlsb", "xls", "csv", "ods", "fods", "numbers"],
|
|
195
|
+
handler: async (e, t) => ue(e, t, "binary")
|
|
196
|
+
},
|
|
197
|
+
// 使用pdfjs,渲染pdf,效果最好
|
|
198
|
+
{
|
|
199
|
+
accepts: ["pdf"],
|
|
200
|
+
handler: async (e, t) => st(e, t)
|
|
201
|
+
},
|
|
202
|
+
// 图片过滤器
|
|
203
|
+
{
|
|
204
|
+
accepts: ["gif", "jpg", "jpeg", "bmp", "tiff", "tif", "png", "svg"],
|
|
205
|
+
handler: async (e, t) => ct(e, t)
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
accepts: ["md", "markdown"],
|
|
209
|
+
handler: async (e, t) => ut(e, t)
|
|
210
|
+
},
|
|
211
|
+
// 纯文本预览
|
|
212
|
+
{
|
|
213
|
+
accepts: ["txt", "json", "js", "css", "java", "py", "html", "jsx", "ts", "tsx", "xml", "log"],
|
|
214
|
+
handler: async (e, t) => yt(e, t)
|
|
215
|
+
},
|
|
216
|
+
// 视频预览,仅支持MP4
|
|
217
|
+
{
|
|
218
|
+
accepts: ["mp4"],
|
|
219
|
+
handler: async (e, t) => (wt(e, t), j(t))
|
|
220
|
+
},
|
|
221
|
+
// 错误处理
|
|
222
|
+
{
|
|
223
|
+
accepts: ["error"],
|
|
224
|
+
handler: async (e, t, n) => (t.innerHTML = `<div style='text-align: center; margin-top: 80px'>不支持.${n}格式的在线预览,请下载后预览或转换为支持的格式</div>
|
|
225
|
+
<div style='text-align: center'>支持docx, xlsx, pptx, pdf, 以及纯文本格式和各种图片格式的在线预览</div>`, j(t))
|
|
226
|
+
}
|
|
227
|
+
], xe = bt.reduce((e, { accepts: t, handler: n }) => (t.forEach((r) => e.set(r, n)), e), /* @__PURE__ */ new Map()), fe = xe.get("error");
|
|
228
|
+
function Et(e) {
|
|
229
|
+
const t = e.lastIndexOf(".");
|
|
230
|
+
return e.substring(t + 1);
|
|
231
|
+
}
|
|
232
|
+
async function Rt(e, t, n) {
|
|
233
|
+
const r = xe.get(t.toLowerCase());
|
|
234
|
+
if (r)
|
|
235
|
+
return r(e, n);
|
|
236
|
+
if (fe)
|
|
237
|
+
return fe(e, n, t);
|
|
238
|
+
}
|
|
239
|
+
function Te(e, t) {
|
|
240
|
+
return function() {
|
|
241
|
+
return e.apply(t, arguments);
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
const { toString: _t } = Object.prototype, { getPrototypeOf: ne } = Object, M = ((e) => (t) => {
|
|
245
|
+
const n = _t.call(t);
|
|
246
|
+
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
247
|
+
})(/* @__PURE__ */ Object.create(null)), O = (e) => (e = e.toLowerCase(), (t) => M(t) === e), q = (e) => (t) => typeof t === e, { isArray: N } = Array, B = q("undefined");
|
|
248
|
+
function St(e) {
|
|
249
|
+
return e !== null && !B(e) && e.constructor !== null && !B(e.constructor) && _(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
250
|
+
}
|
|
251
|
+
const Ce = O("ArrayBuffer");
|
|
252
|
+
function gt(e) {
|
|
253
|
+
let t;
|
|
254
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Ce(e.buffer), t;
|
|
255
|
+
}
|
|
256
|
+
const Ot = q("string"), _ = q("function"), Pe = q("number"), z = (e) => e !== null && typeof e == "object", At = (e) => e === !0 || e === !1, k = (e) => {
|
|
257
|
+
if (M(e) !== "object")
|
|
258
|
+
return !1;
|
|
259
|
+
const t = ne(e);
|
|
260
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
|
|
261
|
+
}, xt = O("Date"), Tt = O("File"), Ct = O("Blob"), Pt = O("FileList"), Nt = (e) => z(e) && _(e.pipe), Ft = (e) => {
|
|
262
|
+
let t;
|
|
263
|
+
return e && (typeof FormData == "function" && e instanceof FormData || _(e.append) && ((t = M(e)) === "formdata" || // detect form-data instance
|
|
264
|
+
t === "object" && _(e.toString) && e.toString() === "[object FormData]"));
|
|
265
|
+
}, Lt = O("URLSearchParams"), Bt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
266
|
+
function v(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
267
|
+
if (e === null || typeof e > "u")
|
|
268
|
+
return;
|
|
269
|
+
let r, s;
|
|
270
|
+
if (typeof e != "object" && (e = [e]), N(e))
|
|
271
|
+
for (r = 0, s = e.length; r < s; r++)
|
|
272
|
+
t.call(null, e[r], r, e);
|
|
273
|
+
else {
|
|
274
|
+
const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
|
|
275
|
+
let l;
|
|
276
|
+
for (r = 0; r < i; r++)
|
|
277
|
+
l = o[r], t.call(null, e[l], l, e);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
function Ne(e, t) {
|
|
281
|
+
t = t.toLowerCase();
|
|
282
|
+
const n = Object.keys(e);
|
|
283
|
+
let r = n.length, s;
|
|
284
|
+
for (; r-- > 0; )
|
|
285
|
+
if (s = n[r], t === s.toLowerCase())
|
|
286
|
+
return s;
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
289
|
+
const Fe = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Le = (e) => !B(e) && e !== Fe;
|
|
290
|
+
function Q() {
|
|
291
|
+
const { caseless: e } = Le(this) && this || {}, t = {}, n = (r, s) => {
|
|
292
|
+
const o = e && Ne(t, s) || s;
|
|
293
|
+
k(t[o]) && k(r) ? t[o] = Q(t[o], r) : k(r) ? t[o] = Q({}, r) : N(r) ? t[o] = r.slice() : t[o] = r;
|
|
294
|
+
};
|
|
295
|
+
for (let r = 0, s = arguments.length; r < s; r++)
|
|
296
|
+
arguments[r] && v(arguments[r], n);
|
|
297
|
+
return t;
|
|
298
|
+
}
|
|
299
|
+
const Ut = (e, t, n, { allOwnKeys: r } = {}) => (v(t, (s, o) => {
|
|
300
|
+
n && _(s) ? e[o] = Te(s, n) : e[o] = s;
|
|
301
|
+
}, { allOwnKeys: r }), e), vt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Dt = (e, t, n, r) => {
|
|
302
|
+
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
303
|
+
value: t.prototype
|
|
304
|
+
}), n && Object.assign(e.prototype, n);
|
|
305
|
+
}, jt = (e, t, n, r) => {
|
|
306
|
+
let s, o, i;
|
|
307
|
+
const l = {};
|
|
308
|
+
if (t = t || {}, e == null)
|
|
309
|
+
return t;
|
|
310
|
+
do {
|
|
311
|
+
for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
|
|
312
|
+
i = s[o], (!r || r(i, e, t)) && !l[i] && (t[i] = e[i], l[i] = !0);
|
|
313
|
+
e = n !== !1 && ne(e);
|
|
314
|
+
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
315
|
+
return t;
|
|
316
|
+
}, kt = (e, t, n) => {
|
|
317
|
+
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
318
|
+
const r = e.indexOf(t, n);
|
|
319
|
+
return r !== -1 && r === n;
|
|
320
|
+
}, It = (e) => {
|
|
321
|
+
if (!e)
|
|
322
|
+
return null;
|
|
323
|
+
if (N(e))
|
|
324
|
+
return e;
|
|
325
|
+
let t = e.length;
|
|
326
|
+
if (!Pe(t))
|
|
327
|
+
return null;
|
|
328
|
+
const n = new Array(t);
|
|
329
|
+
for (; t-- > 0; )
|
|
330
|
+
n[t] = e[t];
|
|
331
|
+
return n;
|
|
332
|
+
}, Ht = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ne(Uint8Array)), $t = (e, t) => {
|
|
333
|
+
const r = (e && e[Symbol.iterator]).call(e);
|
|
334
|
+
let s;
|
|
335
|
+
for (; (s = r.next()) && !s.done; ) {
|
|
336
|
+
const o = s.value;
|
|
337
|
+
t.call(e, o[0], o[1]);
|
|
338
|
+
}
|
|
339
|
+
}, Mt = (e, t) => {
|
|
340
|
+
let n;
|
|
341
|
+
const r = [];
|
|
342
|
+
for (; (n = e.exec(t)) !== null; )
|
|
343
|
+
r.push(n);
|
|
344
|
+
return r;
|
|
345
|
+
}, qt = O("HTMLFormElement"), zt = (e) => e.toLowerCase().replace(
|
|
346
|
+
/[-_\s]([a-z\d])(\w*)/g,
|
|
347
|
+
function(n, r, s) {
|
|
348
|
+
return r.toUpperCase() + s;
|
|
349
|
+
}
|
|
350
|
+
), de = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Vt = O("RegExp"), Be = (e, t) => {
|
|
351
|
+
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
352
|
+
v(n, (s, o) => {
|
|
353
|
+
let i;
|
|
354
|
+
(i = t(s, o, e)) !== !1 && (r[o] = i || s);
|
|
355
|
+
}), Object.defineProperties(e, r);
|
|
356
|
+
}, Jt = (e) => {
|
|
357
|
+
Be(e, (t, n) => {
|
|
358
|
+
if (_(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
359
|
+
return !1;
|
|
360
|
+
const r = e[n];
|
|
361
|
+
if (_(r)) {
|
|
362
|
+
if (t.enumerable = !1, "writable" in t) {
|
|
363
|
+
t.writable = !1;
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
t.set || (t.set = () => {
|
|
367
|
+
throw Error("Can not rewrite read-only method '" + n + "'");
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
}, Wt = (e, t) => {
|
|
372
|
+
const n = {}, r = (s) => {
|
|
373
|
+
s.forEach((o) => {
|
|
374
|
+
n[o] = !0;
|
|
375
|
+
});
|
|
376
|
+
};
|
|
377
|
+
return N(e) ? r(e) : r(String(e).split(t)), n;
|
|
378
|
+
}, Kt = () => {
|
|
379
|
+
}, Xt = (e, t) => (e = +e, Number.isFinite(e) ? e : t), W = "abcdefghijklmnopqrstuvwxyz", pe = "0123456789", Ue = {
|
|
380
|
+
DIGIT: pe,
|
|
381
|
+
ALPHA: W,
|
|
382
|
+
ALPHA_DIGIT: W + W.toUpperCase() + pe
|
|
383
|
+
}, Gt = (e = 16, t = Ue.ALPHA_DIGIT) => {
|
|
384
|
+
let n = "";
|
|
385
|
+
const { length: r } = t;
|
|
386
|
+
for (; e--; )
|
|
387
|
+
n += t[Math.random() * r | 0];
|
|
388
|
+
return n;
|
|
389
|
+
};
|
|
390
|
+
function Qt(e) {
|
|
391
|
+
return !!(e && _(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
|
|
392
|
+
}
|
|
393
|
+
const Zt = (e) => {
|
|
394
|
+
const t = new Array(10), n = (r, s) => {
|
|
395
|
+
if (z(r)) {
|
|
396
|
+
if (t.indexOf(r) >= 0)
|
|
397
|
+
return;
|
|
398
|
+
if (!("toJSON" in r)) {
|
|
399
|
+
t[s] = r;
|
|
400
|
+
const o = N(r) ? [] : {};
|
|
401
|
+
return v(r, (i, l) => {
|
|
402
|
+
const f = n(i, s + 1);
|
|
403
|
+
!B(f) && (o[l] = f);
|
|
404
|
+
}), t[s] = void 0, o;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return r;
|
|
408
|
+
};
|
|
409
|
+
return n(e, 0);
|
|
410
|
+
}, Yt = O("AsyncFunction"), en = (e) => e && (z(e) || _(e)) && _(e.then) && _(e.catch), a = {
|
|
411
|
+
isArray: N,
|
|
412
|
+
isArrayBuffer: Ce,
|
|
413
|
+
isBuffer: St,
|
|
414
|
+
isFormData: Ft,
|
|
415
|
+
isArrayBufferView: gt,
|
|
416
|
+
isString: Ot,
|
|
417
|
+
isNumber: Pe,
|
|
418
|
+
isBoolean: At,
|
|
419
|
+
isObject: z,
|
|
420
|
+
isPlainObject: k,
|
|
421
|
+
isUndefined: B,
|
|
422
|
+
isDate: xt,
|
|
423
|
+
isFile: Tt,
|
|
424
|
+
isBlob: Ct,
|
|
425
|
+
isRegExp: Vt,
|
|
426
|
+
isFunction: _,
|
|
427
|
+
isStream: Nt,
|
|
428
|
+
isURLSearchParams: Lt,
|
|
429
|
+
isTypedArray: Ht,
|
|
430
|
+
isFileList: Pt,
|
|
431
|
+
forEach: v,
|
|
432
|
+
merge: Q,
|
|
433
|
+
extend: Ut,
|
|
434
|
+
trim: Bt,
|
|
435
|
+
stripBOM: vt,
|
|
436
|
+
inherits: Dt,
|
|
437
|
+
toFlatObject: jt,
|
|
438
|
+
kindOf: M,
|
|
439
|
+
kindOfTest: O,
|
|
440
|
+
endsWith: kt,
|
|
441
|
+
toArray: It,
|
|
442
|
+
forEachEntry: $t,
|
|
443
|
+
matchAll: Mt,
|
|
444
|
+
isHTMLForm: qt,
|
|
445
|
+
hasOwnProperty: de,
|
|
446
|
+
hasOwnProp: de,
|
|
447
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
448
|
+
reduceDescriptors: Be,
|
|
449
|
+
freezeMethods: Jt,
|
|
450
|
+
toObjectSet: Wt,
|
|
451
|
+
toCamelCase: zt,
|
|
452
|
+
noop: Kt,
|
|
453
|
+
toFiniteNumber: Xt,
|
|
454
|
+
findKey: Ne,
|
|
455
|
+
global: Fe,
|
|
456
|
+
isContextDefined: Le,
|
|
457
|
+
ALPHABET: Ue,
|
|
458
|
+
generateString: Gt,
|
|
459
|
+
isSpecCompliantForm: Qt,
|
|
460
|
+
toJSONObject: Zt,
|
|
461
|
+
isAsyncFn: Yt,
|
|
462
|
+
isThenable: en
|
|
463
|
+
};
|
|
464
|
+
function y(e, t, n, r, s) {
|
|
465
|
+
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);
|
|
466
|
+
}
|
|
467
|
+
a.inherits(y, Error, {
|
|
468
|
+
toJSON: function() {
|
|
469
|
+
return {
|
|
470
|
+
// Standard
|
|
471
|
+
message: this.message,
|
|
472
|
+
name: this.name,
|
|
473
|
+
// Microsoft
|
|
474
|
+
description: this.description,
|
|
475
|
+
number: this.number,
|
|
476
|
+
// Mozilla
|
|
477
|
+
fileName: this.fileName,
|
|
478
|
+
lineNumber: this.lineNumber,
|
|
479
|
+
columnNumber: this.columnNumber,
|
|
480
|
+
stack: this.stack,
|
|
481
|
+
// Axios
|
|
482
|
+
config: a.toJSONObject(this.config),
|
|
483
|
+
code: this.code,
|
|
484
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
const ve = y.prototype, De = {};
|
|
489
|
+
[
|
|
490
|
+
"ERR_BAD_OPTION_VALUE",
|
|
491
|
+
"ERR_BAD_OPTION",
|
|
492
|
+
"ECONNABORTED",
|
|
493
|
+
"ETIMEDOUT",
|
|
494
|
+
"ERR_NETWORK",
|
|
495
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
496
|
+
"ERR_DEPRECATED",
|
|
497
|
+
"ERR_BAD_RESPONSE",
|
|
498
|
+
"ERR_BAD_REQUEST",
|
|
499
|
+
"ERR_CANCELED",
|
|
500
|
+
"ERR_NOT_SUPPORT",
|
|
501
|
+
"ERR_INVALID_URL"
|
|
502
|
+
// eslint-disable-next-line func-names
|
|
503
|
+
].forEach((e) => {
|
|
504
|
+
De[e] = { value: e };
|
|
505
|
+
});
|
|
506
|
+
Object.defineProperties(y, De);
|
|
507
|
+
Object.defineProperty(ve, "isAxiosError", { value: !0 });
|
|
508
|
+
y.from = (e, t, n, r, s, o) => {
|
|
509
|
+
const i = Object.create(ve);
|
|
510
|
+
return a.toFlatObject(e, i, function(f) {
|
|
511
|
+
return f !== Error.prototype;
|
|
512
|
+
}, (l) => l !== "isAxiosError"), y.call(i, e.message, t, n, r, s), i.cause = e, i.name = e.name, o && Object.assign(i, o), i;
|
|
513
|
+
};
|
|
514
|
+
const tn = null;
|
|
515
|
+
function Z(e) {
|
|
516
|
+
return a.isPlainObject(e) || a.isArray(e);
|
|
517
|
+
}
|
|
518
|
+
function je(e) {
|
|
519
|
+
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
520
|
+
}
|
|
521
|
+
function he(e, t, n) {
|
|
522
|
+
return e ? e.concat(t).map(function(s, o) {
|
|
523
|
+
return s = je(s), !n && o ? "[" + s + "]" : s;
|
|
524
|
+
}).join(n ? "." : "") : t;
|
|
525
|
+
}
|
|
526
|
+
function nn(e) {
|
|
527
|
+
return a.isArray(e) && !e.some(Z);
|
|
528
|
+
}
|
|
529
|
+
const rn = a.toFlatObject(a, {}, null, function(t) {
|
|
530
|
+
return /^is[A-Z]/.test(t);
|
|
531
|
+
});
|
|
532
|
+
function V(e, t, n) {
|
|
533
|
+
if (!a.isObject(e))
|
|
534
|
+
throw new TypeError("target must be an object");
|
|
535
|
+
t = t || new FormData(), n = a.toFlatObject(n, {
|
|
536
|
+
metaTokens: !0,
|
|
537
|
+
dots: !1,
|
|
538
|
+
indexes: !1
|
|
539
|
+
}, !1, function(h, b) {
|
|
540
|
+
return !a.isUndefined(b[h]);
|
|
541
|
+
});
|
|
542
|
+
const r = n.metaTokens, s = n.visitor || u, o = n.dots, i = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
|
|
543
|
+
if (!a.isFunction(s))
|
|
544
|
+
throw new TypeError("visitor must be a function");
|
|
545
|
+
function d(p) {
|
|
546
|
+
if (p === null)
|
|
547
|
+
return "";
|
|
548
|
+
if (a.isDate(p))
|
|
549
|
+
return p.toISOString();
|
|
550
|
+
if (!f && a.isBlob(p))
|
|
551
|
+
throw new y("Blob is not supported. Use a Buffer instead.");
|
|
552
|
+
return a.isArrayBuffer(p) || a.isTypedArray(p) ? f && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
|
|
553
|
+
}
|
|
554
|
+
function u(p, h, b) {
|
|
555
|
+
let R = p;
|
|
556
|
+
if (p && !b && typeof p == "object") {
|
|
557
|
+
if (a.endsWith(h, "{}"))
|
|
558
|
+
h = r ? h : h.slice(0, -2), p = JSON.stringify(p);
|
|
559
|
+
else if (a.isArray(p) && nn(p) || (a.isFileList(p) || a.endsWith(h, "[]")) && (R = a.toArray(p)))
|
|
560
|
+
return h = je(h), R.forEach(function(x, Ke) {
|
|
561
|
+
!(a.isUndefined(x) || x === null) && t.append(
|
|
562
|
+
// eslint-disable-next-line no-nested-ternary
|
|
563
|
+
i === !0 ? he([h], Ke, o) : i === null ? h : h + "[]",
|
|
564
|
+
d(x)
|
|
565
|
+
);
|
|
566
|
+
}), !1;
|
|
567
|
+
}
|
|
568
|
+
return Z(p) ? !0 : (t.append(he(b, h, o), d(p)), !1);
|
|
569
|
+
}
|
|
570
|
+
const c = [], m = Object.assign(rn, {
|
|
571
|
+
defaultVisitor: u,
|
|
572
|
+
convertValue: d,
|
|
573
|
+
isVisitable: Z
|
|
574
|
+
});
|
|
575
|
+
function E(p, h) {
|
|
576
|
+
if (!a.isUndefined(p)) {
|
|
577
|
+
if (c.indexOf(p) !== -1)
|
|
578
|
+
throw Error("Circular reference detected in " + h.join("."));
|
|
579
|
+
c.push(p), a.forEach(p, function(R, S) {
|
|
580
|
+
(!(a.isUndefined(R) || R === null) && s.call(
|
|
581
|
+
t,
|
|
582
|
+
R,
|
|
583
|
+
a.isString(S) ? S.trim() : S,
|
|
584
|
+
h,
|
|
585
|
+
m
|
|
586
|
+
)) === !0 && E(R, h ? h.concat(S) : [S]);
|
|
587
|
+
}), c.pop();
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
if (!a.isObject(e))
|
|
591
|
+
throw new TypeError("data must be an object");
|
|
592
|
+
return E(e), t;
|
|
593
|
+
}
|
|
594
|
+
function me(e) {
|
|
595
|
+
const t = {
|
|
596
|
+
"!": "%21",
|
|
597
|
+
"'": "%27",
|
|
598
|
+
"(": "%28",
|
|
599
|
+
")": "%29",
|
|
600
|
+
"~": "%7E",
|
|
601
|
+
"%20": "+",
|
|
602
|
+
"%00": "\0"
|
|
603
|
+
};
|
|
604
|
+
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
|
|
605
|
+
return t[r];
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
function re(e, t) {
|
|
609
|
+
this._pairs = [], e && V(e, this, t);
|
|
610
|
+
}
|
|
611
|
+
const ke = re.prototype;
|
|
612
|
+
ke.append = function(t, n) {
|
|
613
|
+
this._pairs.push([t, n]);
|
|
614
|
+
};
|
|
615
|
+
ke.toString = function(t) {
|
|
616
|
+
const n = t ? function(r) {
|
|
617
|
+
return t.call(this, r, me);
|
|
618
|
+
} : me;
|
|
619
|
+
return this._pairs.map(function(s) {
|
|
620
|
+
return n(s[0]) + "=" + n(s[1]);
|
|
621
|
+
}, "").join("&");
|
|
622
|
+
};
|
|
623
|
+
function sn(e) {
|
|
624
|
+
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
625
|
+
}
|
|
626
|
+
function Ie(e, t, n) {
|
|
627
|
+
if (!t)
|
|
628
|
+
return e;
|
|
629
|
+
const r = n && n.encode || sn, s = n && n.serialize;
|
|
630
|
+
let o;
|
|
631
|
+
if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new re(t, n).toString(r), o) {
|
|
632
|
+
const i = e.indexOf("#");
|
|
633
|
+
i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
|
|
634
|
+
}
|
|
635
|
+
return e;
|
|
636
|
+
}
|
|
637
|
+
class on {
|
|
638
|
+
constructor() {
|
|
639
|
+
this.handlers = [];
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Add a new interceptor to the stack
|
|
643
|
+
*
|
|
644
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
645
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
646
|
+
*
|
|
647
|
+
* @return {Number} An ID used to remove interceptor later
|
|
648
|
+
*/
|
|
649
|
+
use(t, n, r) {
|
|
650
|
+
return this.handlers.push({
|
|
651
|
+
fulfilled: t,
|
|
652
|
+
rejected: n,
|
|
653
|
+
synchronous: r ? r.synchronous : !1,
|
|
654
|
+
runWhen: r ? r.runWhen : null
|
|
655
|
+
}), this.handlers.length - 1;
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* Remove an interceptor from the stack
|
|
659
|
+
*
|
|
660
|
+
* @param {Number} id The ID that was returned by `use`
|
|
661
|
+
*
|
|
662
|
+
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
|
|
663
|
+
*/
|
|
664
|
+
eject(t) {
|
|
665
|
+
this.handlers[t] && (this.handlers[t] = null);
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Clear all interceptors from the stack
|
|
669
|
+
*
|
|
670
|
+
* @returns {void}
|
|
671
|
+
*/
|
|
672
|
+
clear() {
|
|
673
|
+
this.handlers && (this.handlers = []);
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Iterate over all the registered interceptors
|
|
677
|
+
*
|
|
678
|
+
* This method is particularly useful for skipping over any
|
|
679
|
+
* interceptors that may have become `null` calling `eject`.
|
|
680
|
+
*
|
|
681
|
+
* @param {Function} fn The function to call for each interceptor
|
|
682
|
+
*
|
|
683
|
+
* @returns {void}
|
|
684
|
+
*/
|
|
685
|
+
forEach(t) {
|
|
686
|
+
a.forEach(this.handlers, function(r) {
|
|
687
|
+
r !== null && t(r);
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
const ye = on, He = {
|
|
692
|
+
silentJSONParsing: !0,
|
|
693
|
+
forcedJSONParsing: !0,
|
|
694
|
+
clarifyTimeoutError: !1
|
|
695
|
+
}, an = typeof URLSearchParams < "u" ? URLSearchParams : re, cn = typeof FormData < "u" ? FormData : null, ln = typeof Blob < "u" ? Blob : null, un = {
|
|
696
|
+
isBrowser: !0,
|
|
697
|
+
classes: {
|
|
698
|
+
URLSearchParams: an,
|
|
699
|
+
FormData: cn,
|
|
700
|
+
Blob: ln
|
|
701
|
+
},
|
|
702
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
703
|
+
}, $e = typeof window < "u" && typeof document < "u", fn = ((e) => $e && ["ReactNative", "NativeScript", "NS"].indexOf(e) < 0)(typeof navigator < "u" && navigator.product), dn = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
704
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
705
|
+
__proto__: null,
|
|
706
|
+
hasBrowserEnv: $e,
|
|
707
|
+
hasStandardBrowserEnv: fn,
|
|
708
|
+
hasStandardBrowserWebWorkerEnv: dn
|
|
709
|
+
}, Symbol.toStringTag, { value: "Module" })), g = {
|
|
710
|
+
...pn,
|
|
711
|
+
...un
|
|
712
|
+
};
|
|
713
|
+
function hn(e, t) {
|
|
714
|
+
return V(e, new g.classes.URLSearchParams(), Object.assign({
|
|
715
|
+
visitor: function(n, r, s, o) {
|
|
716
|
+
return g.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
717
|
+
}
|
|
718
|
+
}, t));
|
|
719
|
+
}
|
|
720
|
+
function mn(e) {
|
|
721
|
+
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
722
|
+
}
|
|
723
|
+
function yn(e) {
|
|
724
|
+
const t = {}, n = Object.keys(e);
|
|
725
|
+
let r;
|
|
726
|
+
const s = n.length;
|
|
727
|
+
let o;
|
|
728
|
+
for (r = 0; r < s; r++)
|
|
729
|
+
o = n[r], t[o] = e[o];
|
|
730
|
+
return t;
|
|
731
|
+
}
|
|
732
|
+
function Me(e) {
|
|
733
|
+
function t(n, r, s, o) {
|
|
734
|
+
let i = n[o++];
|
|
735
|
+
const l = Number.isFinite(+i), f = o >= n.length;
|
|
736
|
+
return i = !i && a.isArray(s) ? s.length : i, f ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !l) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = yn(s[i])), !l);
|
|
737
|
+
}
|
|
738
|
+
if (a.isFormData(e) && a.isFunction(e.entries)) {
|
|
739
|
+
const n = {};
|
|
740
|
+
return a.forEachEntry(e, (r, s) => {
|
|
741
|
+
t(mn(r), s, n, 0);
|
|
742
|
+
}), n;
|
|
743
|
+
}
|
|
744
|
+
return null;
|
|
745
|
+
}
|
|
746
|
+
function wn(e, t, n) {
|
|
747
|
+
if (a.isString(e))
|
|
748
|
+
try {
|
|
749
|
+
return (t || JSON.parse)(e), a.trim(e);
|
|
750
|
+
} catch (r) {
|
|
751
|
+
if (r.name !== "SyntaxError")
|
|
752
|
+
throw r;
|
|
753
|
+
}
|
|
754
|
+
return (n || JSON.stringify)(e);
|
|
755
|
+
}
|
|
756
|
+
const se = {
|
|
757
|
+
transitional: He,
|
|
758
|
+
adapter: ["xhr", "http"],
|
|
759
|
+
transformRequest: [function(t, n) {
|
|
760
|
+
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = a.isObject(t);
|
|
761
|
+
if (o && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
|
|
762
|
+
return s && s ? JSON.stringify(Me(t)) : t;
|
|
763
|
+
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t))
|
|
764
|
+
return t;
|
|
765
|
+
if (a.isArrayBufferView(t))
|
|
766
|
+
return t.buffer;
|
|
767
|
+
if (a.isURLSearchParams(t))
|
|
768
|
+
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
769
|
+
let l;
|
|
770
|
+
if (o) {
|
|
771
|
+
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
772
|
+
return hn(t, this.formSerializer).toString();
|
|
773
|
+
if ((l = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
774
|
+
const f = this.env && this.env.FormData;
|
|
775
|
+
return V(
|
|
776
|
+
l ? { "files[]": t } : t,
|
|
777
|
+
f && new f(),
|
|
778
|
+
this.formSerializer
|
|
779
|
+
);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
return o || s ? (n.setContentType("application/json", !1), wn(t)) : t;
|
|
783
|
+
}],
|
|
784
|
+
transformResponse: [function(t) {
|
|
785
|
+
const n = this.transitional || se.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
|
|
786
|
+
if (t && a.isString(t) && (r && !this.responseType || s)) {
|
|
787
|
+
const i = !(n && n.silentJSONParsing) && s;
|
|
788
|
+
try {
|
|
789
|
+
return JSON.parse(t);
|
|
790
|
+
} catch (l) {
|
|
791
|
+
if (i)
|
|
792
|
+
throw l.name === "SyntaxError" ? y.from(l, y.ERR_BAD_RESPONSE, this, null, this.response) : l;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
return t;
|
|
796
|
+
}],
|
|
797
|
+
/**
|
|
798
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
799
|
+
* timeout is not created.
|
|
800
|
+
*/
|
|
801
|
+
timeout: 0,
|
|
802
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
803
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
804
|
+
maxContentLength: -1,
|
|
805
|
+
maxBodyLength: -1,
|
|
806
|
+
env: {
|
|
807
|
+
FormData: g.classes.FormData,
|
|
808
|
+
Blob: g.classes.Blob
|
|
809
|
+
},
|
|
810
|
+
validateStatus: function(t) {
|
|
811
|
+
return t >= 200 && t < 300;
|
|
812
|
+
},
|
|
813
|
+
headers: {
|
|
814
|
+
common: {
|
|
815
|
+
Accept: "application/json, text/plain, */*",
|
|
816
|
+
"Content-Type": void 0
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
};
|
|
820
|
+
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
821
|
+
se.headers[e] = {};
|
|
822
|
+
});
|
|
823
|
+
const oe = se, bn = a.toObjectSet([
|
|
824
|
+
"age",
|
|
825
|
+
"authorization",
|
|
826
|
+
"content-length",
|
|
827
|
+
"content-type",
|
|
828
|
+
"etag",
|
|
829
|
+
"expires",
|
|
830
|
+
"from",
|
|
831
|
+
"host",
|
|
832
|
+
"if-modified-since",
|
|
833
|
+
"if-unmodified-since",
|
|
834
|
+
"last-modified",
|
|
835
|
+
"location",
|
|
836
|
+
"max-forwards",
|
|
837
|
+
"proxy-authorization",
|
|
838
|
+
"referer",
|
|
839
|
+
"retry-after",
|
|
840
|
+
"user-agent"
|
|
841
|
+
]), En = (e) => {
|
|
842
|
+
const t = {};
|
|
843
|
+
let n, r, s;
|
|
844
|
+
return e && e.split(`
|
|
845
|
+
`).forEach(function(i) {
|
|
846
|
+
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && bn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
847
|
+
}), t;
|
|
848
|
+
}, we = Symbol("internals");
|
|
849
|
+
function L(e) {
|
|
850
|
+
return e && String(e).trim().toLowerCase();
|
|
851
|
+
}
|
|
852
|
+
function I(e) {
|
|
853
|
+
return e === !1 || e == null ? e : a.isArray(e) ? e.map(I) : String(e);
|
|
854
|
+
}
|
|
855
|
+
function Rn(e) {
|
|
856
|
+
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
857
|
+
let r;
|
|
858
|
+
for (; r = n.exec(e); )
|
|
859
|
+
t[r[1]] = r[2];
|
|
860
|
+
return t;
|
|
861
|
+
}
|
|
862
|
+
const _n = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
863
|
+
function K(e, t, n, r, s) {
|
|
864
|
+
if (a.isFunction(r))
|
|
865
|
+
return r.call(this, t, n);
|
|
866
|
+
if (s && (t = n), !!a.isString(t)) {
|
|
867
|
+
if (a.isString(r))
|
|
868
|
+
return t.indexOf(r) !== -1;
|
|
869
|
+
if (a.isRegExp(r))
|
|
870
|
+
return r.test(t);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
function Sn(e) {
|
|
874
|
+
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
|
|
875
|
+
}
|
|
876
|
+
function gn(e, t) {
|
|
877
|
+
const n = a.toCamelCase(" " + t);
|
|
878
|
+
["get", "set", "has"].forEach((r) => {
|
|
879
|
+
Object.defineProperty(e, r + n, {
|
|
880
|
+
value: function(s, o, i) {
|
|
881
|
+
return this[r].call(this, t, s, o, i);
|
|
882
|
+
},
|
|
883
|
+
configurable: !0
|
|
884
|
+
});
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
class J {
|
|
888
|
+
constructor(t) {
|
|
889
|
+
t && this.set(t);
|
|
890
|
+
}
|
|
891
|
+
set(t, n, r) {
|
|
892
|
+
const s = this;
|
|
893
|
+
function o(l, f, d) {
|
|
894
|
+
const u = L(f);
|
|
895
|
+
if (!u)
|
|
896
|
+
throw new Error("header name must be a non-empty string");
|
|
897
|
+
const c = a.findKey(s, u);
|
|
898
|
+
(!c || s[c] === void 0 || d === !0 || d === void 0 && s[c] !== !1) && (s[c || f] = I(l));
|
|
899
|
+
}
|
|
900
|
+
const i = (l, f) => a.forEach(l, (d, u) => o(d, u, f));
|
|
901
|
+
return a.isPlainObject(t) || t instanceof this.constructor ? i(t, n) : a.isString(t) && (t = t.trim()) && !_n(t) ? i(En(t), n) : t != null && o(n, t, r), this;
|
|
902
|
+
}
|
|
903
|
+
get(t, n) {
|
|
904
|
+
if (t = L(t), t) {
|
|
905
|
+
const r = a.findKey(this, t);
|
|
906
|
+
if (r) {
|
|
907
|
+
const s = this[r];
|
|
908
|
+
if (!n)
|
|
909
|
+
return s;
|
|
910
|
+
if (n === !0)
|
|
911
|
+
return Rn(s);
|
|
912
|
+
if (a.isFunction(n))
|
|
913
|
+
return n.call(this, s, r);
|
|
914
|
+
if (a.isRegExp(n))
|
|
915
|
+
return n.exec(s);
|
|
916
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
has(t, n) {
|
|
921
|
+
if (t = L(t), t) {
|
|
922
|
+
const r = a.findKey(this, t);
|
|
923
|
+
return !!(r && this[r] !== void 0 && (!n || K(this, this[r], r, n)));
|
|
924
|
+
}
|
|
925
|
+
return !1;
|
|
926
|
+
}
|
|
927
|
+
delete(t, n) {
|
|
928
|
+
const r = this;
|
|
929
|
+
let s = !1;
|
|
930
|
+
function o(i) {
|
|
931
|
+
if (i = L(i), i) {
|
|
932
|
+
const l = a.findKey(r, i);
|
|
933
|
+
l && (!n || K(r, r[l], l, n)) && (delete r[l], s = !0);
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
return a.isArray(t) ? t.forEach(o) : o(t), s;
|
|
937
|
+
}
|
|
938
|
+
clear(t) {
|
|
939
|
+
const n = Object.keys(this);
|
|
940
|
+
let r = n.length, s = !1;
|
|
941
|
+
for (; r--; ) {
|
|
942
|
+
const o = n[r];
|
|
943
|
+
(!t || K(this, this[o], o, t, !0)) && (delete this[o], s = !0);
|
|
944
|
+
}
|
|
945
|
+
return s;
|
|
946
|
+
}
|
|
947
|
+
normalize(t) {
|
|
948
|
+
const n = this, r = {};
|
|
949
|
+
return a.forEach(this, (s, o) => {
|
|
950
|
+
const i = a.findKey(r, o);
|
|
951
|
+
if (i) {
|
|
952
|
+
n[i] = I(s), delete n[o];
|
|
953
|
+
return;
|
|
954
|
+
}
|
|
955
|
+
const l = t ? Sn(o) : String(o).trim();
|
|
956
|
+
l !== o && delete n[o], n[l] = I(s), r[l] = !0;
|
|
957
|
+
}), this;
|
|
958
|
+
}
|
|
959
|
+
concat(...t) {
|
|
960
|
+
return this.constructor.concat(this, ...t);
|
|
961
|
+
}
|
|
962
|
+
toJSON(t) {
|
|
963
|
+
const n = /* @__PURE__ */ Object.create(null);
|
|
964
|
+
return a.forEach(this, (r, s) => {
|
|
965
|
+
r != null && r !== !1 && (n[s] = t && a.isArray(r) ? r.join(", ") : r);
|
|
966
|
+
}), n;
|
|
967
|
+
}
|
|
968
|
+
[Symbol.iterator]() {
|
|
969
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
970
|
+
}
|
|
971
|
+
toString() {
|
|
972
|
+
return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
|
|
973
|
+
`);
|
|
974
|
+
}
|
|
975
|
+
get [Symbol.toStringTag]() {
|
|
976
|
+
return "AxiosHeaders";
|
|
977
|
+
}
|
|
978
|
+
static from(t) {
|
|
979
|
+
return t instanceof this ? t : new this(t);
|
|
980
|
+
}
|
|
981
|
+
static concat(t, ...n) {
|
|
982
|
+
const r = new this(t);
|
|
983
|
+
return n.forEach((s) => r.set(s)), r;
|
|
984
|
+
}
|
|
985
|
+
static accessor(t) {
|
|
986
|
+
const r = (this[we] = this[we] = {
|
|
987
|
+
accessors: {}
|
|
988
|
+
}).accessors, s = this.prototype;
|
|
989
|
+
function o(i) {
|
|
990
|
+
const l = L(i);
|
|
991
|
+
r[l] || (gn(s, i), r[l] = !0);
|
|
992
|
+
}
|
|
993
|
+
return a.isArray(t) ? t.forEach(o) : o(t), this;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
J.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
997
|
+
a.reduceDescriptors(J.prototype, ({ value: e }, t) => {
|
|
998
|
+
let n = t[0].toUpperCase() + t.slice(1);
|
|
999
|
+
return {
|
|
1000
|
+
get: () => e,
|
|
1001
|
+
set(r) {
|
|
1002
|
+
this[n] = r;
|
|
1003
|
+
}
|
|
1004
|
+
};
|
|
1005
|
+
});
|
|
1006
|
+
a.freezeMethods(J);
|
|
1007
|
+
const A = J;
|
|
1008
|
+
function X(e, t) {
|
|
1009
|
+
const n = this || oe, r = t || n, s = A.from(r.headers);
|
|
1010
|
+
let o = r.data;
|
|
1011
|
+
return a.forEach(e, function(l) {
|
|
1012
|
+
o = l.call(n, o, s.normalize(), t ? t.status : void 0);
|
|
1013
|
+
}), s.normalize(), o;
|
|
1014
|
+
}
|
|
1015
|
+
function qe(e) {
|
|
1016
|
+
return !!(e && e.__CANCEL__);
|
|
1017
|
+
}
|
|
1018
|
+
function D(e, t, n) {
|
|
1019
|
+
y.call(this, e ?? "canceled", y.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
1020
|
+
}
|
|
1021
|
+
a.inherits(D, y, {
|
|
1022
|
+
__CANCEL__: !0
|
|
1023
|
+
});
|
|
1024
|
+
function On(e, t, n) {
|
|
1025
|
+
const r = n.config.validateStatus;
|
|
1026
|
+
!n.status || !r || r(n.status) ? e(n) : t(new y(
|
|
1027
|
+
"Request failed with status code " + n.status,
|
|
1028
|
+
[y.ERR_BAD_REQUEST, y.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
|
|
1029
|
+
n.config,
|
|
1030
|
+
n.request,
|
|
1031
|
+
n
|
|
1032
|
+
));
|
|
1033
|
+
}
|
|
1034
|
+
const An = g.hasStandardBrowserEnv ? (
|
|
1035
|
+
// Standard browser envs support document.cookie
|
|
1036
|
+
{
|
|
1037
|
+
write(e, t, n, r, s, o) {
|
|
1038
|
+
const i = [e + "=" + encodeURIComponent(t)];
|
|
1039
|
+
a.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), a.isString(r) && i.push("path=" + r), a.isString(s) && i.push("domain=" + s), o === !0 && i.push("secure"), document.cookie = i.join("; ");
|
|
1040
|
+
},
|
|
1041
|
+
read(e) {
|
|
1042
|
+
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
1043
|
+
return t ? decodeURIComponent(t[3]) : null;
|
|
1044
|
+
},
|
|
1045
|
+
remove(e) {
|
|
1046
|
+
this.write(e, "", Date.now() - 864e5);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
) : (
|
|
1050
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
1051
|
+
{
|
|
1052
|
+
write() {
|
|
1053
|
+
},
|
|
1054
|
+
read() {
|
|
1055
|
+
return null;
|
|
1056
|
+
},
|
|
1057
|
+
remove() {
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
);
|
|
1061
|
+
function xn(e) {
|
|
1062
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
1063
|
+
}
|
|
1064
|
+
function Tn(e, t) {
|
|
1065
|
+
return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1066
|
+
}
|
|
1067
|
+
function ze(e, t) {
|
|
1068
|
+
return e && !xn(t) ? Tn(e, t) : t;
|
|
1069
|
+
}
|
|
1070
|
+
const Cn = g.hasStandardBrowserEnv ? (
|
|
1071
|
+
// Standard browser envs have full support of the APIs needed to test
|
|
1072
|
+
// whether the request URL is of the same origin as current location.
|
|
1073
|
+
function() {
|
|
1074
|
+
const t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");
|
|
1075
|
+
let r;
|
|
1076
|
+
function s(o) {
|
|
1077
|
+
let i = o;
|
|
1078
|
+
return t && (n.setAttribute("href", i), i = n.href), n.setAttribute("href", i), {
|
|
1079
|
+
href: n.href,
|
|
1080
|
+
protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
|
|
1081
|
+
host: n.host,
|
|
1082
|
+
search: n.search ? n.search.replace(/^\?/, "") : "",
|
|
1083
|
+
hash: n.hash ? n.hash.replace(/^#/, "") : "",
|
|
1084
|
+
hostname: n.hostname,
|
|
1085
|
+
port: n.port,
|
|
1086
|
+
pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
return r = s(window.location.href), function(i) {
|
|
1090
|
+
const l = a.isString(i) ? s(i) : i;
|
|
1091
|
+
return l.protocol === r.protocol && l.host === r.host;
|
|
1092
|
+
};
|
|
1093
|
+
}()
|
|
1094
|
+
) : (
|
|
1095
|
+
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
1096
|
+
function() {
|
|
1097
|
+
return function() {
|
|
1098
|
+
return !0;
|
|
1099
|
+
};
|
|
1100
|
+
}()
|
|
1101
|
+
);
|
|
1102
|
+
function Pn(e) {
|
|
1103
|
+
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
1104
|
+
return t && t[1] || "";
|
|
1105
|
+
}
|
|
1106
|
+
function Nn(e, t) {
|
|
1107
|
+
e = e || 10;
|
|
1108
|
+
const n = new Array(e), r = new Array(e);
|
|
1109
|
+
let s = 0, o = 0, i;
|
|
1110
|
+
return t = t !== void 0 ? t : 1e3, function(f) {
|
|
1111
|
+
const d = Date.now(), u = r[o];
|
|
1112
|
+
i || (i = d), n[s] = f, r[s] = d;
|
|
1113
|
+
let c = o, m = 0;
|
|
1114
|
+
for (; c !== s; )
|
|
1115
|
+
m += n[c++], c = c % e;
|
|
1116
|
+
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), d - i < t)
|
|
1117
|
+
return;
|
|
1118
|
+
const E = u && d - u;
|
|
1119
|
+
return E ? Math.round(m * 1e3 / E) : void 0;
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
function be(e, t) {
|
|
1123
|
+
let n = 0;
|
|
1124
|
+
const r = Nn(50, 250);
|
|
1125
|
+
return (s) => {
|
|
1126
|
+
const o = s.loaded, i = s.lengthComputable ? s.total : void 0, l = o - n, f = r(l), d = o <= i;
|
|
1127
|
+
n = o;
|
|
1128
|
+
const u = {
|
|
1129
|
+
loaded: o,
|
|
1130
|
+
total: i,
|
|
1131
|
+
progress: i ? o / i : void 0,
|
|
1132
|
+
bytes: l,
|
|
1133
|
+
rate: f || void 0,
|
|
1134
|
+
estimated: f && i && d ? (i - o) / f : void 0,
|
|
1135
|
+
event: s
|
|
1136
|
+
};
|
|
1137
|
+
u[t ? "download" : "upload"] = !0, e(u);
|
|
1138
|
+
};
|
|
1139
|
+
}
|
|
1140
|
+
const Fn = typeof XMLHttpRequest < "u", Ln = Fn && function(e) {
|
|
1141
|
+
return new Promise(function(n, r) {
|
|
1142
|
+
let s = e.data;
|
|
1143
|
+
const o = A.from(e.headers).normalize();
|
|
1144
|
+
let { responseType: i, withXSRFToken: l } = e, f;
|
|
1145
|
+
function d() {
|
|
1146
|
+
e.cancelToken && e.cancelToken.unsubscribe(f), e.signal && e.signal.removeEventListener("abort", f);
|
|
1147
|
+
}
|
|
1148
|
+
let u;
|
|
1149
|
+
if (a.isFormData(s)) {
|
|
1150
|
+
if (g.hasStandardBrowserEnv || g.hasStandardBrowserWebWorkerEnv)
|
|
1151
|
+
o.setContentType(!1);
|
|
1152
|
+
else if ((u = o.getContentType()) !== !1) {
|
|
1153
|
+
const [h, ...b] = u ? u.split(";").map((R) => R.trim()).filter(Boolean) : [];
|
|
1154
|
+
o.setContentType([h || "multipart/form-data", ...b].join("; "));
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
let c = new XMLHttpRequest();
|
|
1158
|
+
if (e.auth) {
|
|
1159
|
+
const h = e.auth.username || "", b = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
|
|
1160
|
+
o.set("Authorization", "Basic " + btoa(h + ":" + b));
|
|
1161
|
+
}
|
|
1162
|
+
const m = ze(e.baseURL, e.url);
|
|
1163
|
+
c.open(e.method.toUpperCase(), Ie(m, e.params, e.paramsSerializer), !0), c.timeout = e.timeout;
|
|
1164
|
+
function E() {
|
|
1165
|
+
if (!c)
|
|
1166
|
+
return;
|
|
1167
|
+
const h = A.from(
|
|
1168
|
+
"getAllResponseHeaders" in c && c.getAllResponseHeaders()
|
|
1169
|
+
), R = {
|
|
1170
|
+
data: !i || i === "text" || i === "json" ? c.responseText : c.response,
|
|
1171
|
+
status: c.status,
|
|
1172
|
+
statusText: c.statusText,
|
|
1173
|
+
headers: h,
|
|
1174
|
+
config: e,
|
|
1175
|
+
request: c
|
|
1176
|
+
};
|
|
1177
|
+
On(function(x) {
|
|
1178
|
+
n(x), d();
|
|
1179
|
+
}, function(x) {
|
|
1180
|
+
r(x), d();
|
|
1181
|
+
}, R), c = null;
|
|
1182
|
+
}
|
|
1183
|
+
if ("onloadend" in c ? c.onloadend = E : c.onreadystatechange = function() {
|
|
1184
|
+
!c || c.readyState !== 4 || c.status === 0 && !(c.responseURL && c.responseURL.indexOf("file:") === 0) || setTimeout(E);
|
|
1185
|
+
}, c.onabort = function() {
|
|
1186
|
+
c && (r(new y("Request aborted", y.ECONNABORTED, e, c)), c = null);
|
|
1187
|
+
}, c.onerror = function() {
|
|
1188
|
+
r(new y("Network Error", y.ERR_NETWORK, e, c)), c = null;
|
|
1189
|
+
}, c.ontimeout = function() {
|
|
1190
|
+
let b = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded";
|
|
1191
|
+
const R = e.transitional || He;
|
|
1192
|
+
e.timeoutErrorMessage && (b = e.timeoutErrorMessage), r(new y(
|
|
1193
|
+
b,
|
|
1194
|
+
R.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
|
|
1195
|
+
e,
|
|
1196
|
+
c
|
|
1197
|
+
)), c = null;
|
|
1198
|
+
}, g.hasStandardBrowserEnv && (l && a.isFunction(l) && (l = l(e)), l || l !== !1 && Cn(m))) {
|
|
1199
|
+
const h = e.xsrfHeaderName && e.xsrfCookieName && An.read(e.xsrfCookieName);
|
|
1200
|
+
h && o.set(e.xsrfHeaderName, h);
|
|
1201
|
+
}
|
|
1202
|
+
s === void 0 && o.setContentType(null), "setRequestHeader" in c && a.forEach(o.toJSON(), function(b, R) {
|
|
1203
|
+
c.setRequestHeader(R, b);
|
|
1204
|
+
}), a.isUndefined(e.withCredentials) || (c.withCredentials = !!e.withCredentials), i && i !== "json" && (c.responseType = e.responseType), typeof e.onDownloadProgress == "function" && c.addEventListener("progress", be(e.onDownloadProgress, !0)), typeof e.onUploadProgress == "function" && c.upload && c.upload.addEventListener("progress", be(e.onUploadProgress)), (e.cancelToken || e.signal) && (f = (h) => {
|
|
1205
|
+
c && (r(!h || h.type ? new D(null, e, c) : h), c.abort(), c = null);
|
|
1206
|
+
}, e.cancelToken && e.cancelToken.subscribe(f), e.signal && (e.signal.aborted ? f() : e.signal.addEventListener("abort", f)));
|
|
1207
|
+
const p = Pn(m);
|
|
1208
|
+
if (p && g.protocols.indexOf(p) === -1) {
|
|
1209
|
+
r(new y("Unsupported protocol " + p + ":", y.ERR_BAD_REQUEST, e));
|
|
1210
|
+
return;
|
|
1211
|
+
}
|
|
1212
|
+
c.send(s || null);
|
|
1213
|
+
});
|
|
1214
|
+
}, Y = {
|
|
1215
|
+
http: tn,
|
|
1216
|
+
xhr: Ln
|
|
1217
|
+
};
|
|
1218
|
+
a.forEach(Y, (e, t) => {
|
|
1219
|
+
if (e) {
|
|
1220
|
+
try {
|
|
1221
|
+
Object.defineProperty(e, "name", { value: t });
|
|
1222
|
+
} catch {
|
|
1223
|
+
}
|
|
1224
|
+
Object.defineProperty(e, "adapterName", { value: t });
|
|
1225
|
+
}
|
|
1226
|
+
});
|
|
1227
|
+
const Ee = (e) => `- ${e}`, Bn = (e) => a.isFunction(e) || e === null || e === !1, Ve = {
|
|
1228
|
+
getAdapter: (e) => {
|
|
1229
|
+
e = a.isArray(e) ? e : [e];
|
|
1230
|
+
const { length: t } = e;
|
|
1231
|
+
let n, r;
|
|
1232
|
+
const s = {};
|
|
1233
|
+
for (let o = 0; o < t; o++) {
|
|
1234
|
+
n = e[o];
|
|
1235
|
+
let i;
|
|
1236
|
+
if (r = n, !Bn(n) && (r = Y[(i = String(n)).toLowerCase()], r === void 0))
|
|
1237
|
+
throw new y(`Unknown adapter '${i}'`);
|
|
1238
|
+
if (r)
|
|
1239
|
+
break;
|
|
1240
|
+
s[i || "#" + o] = r;
|
|
1241
|
+
}
|
|
1242
|
+
if (!r) {
|
|
1243
|
+
const o = Object.entries(s).map(
|
|
1244
|
+
([l, f]) => `adapter ${l} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1245
|
+
);
|
|
1246
|
+
let i = t ? o.length > 1 ? `since :
|
|
1247
|
+
` + o.map(Ee).join(`
|
|
1248
|
+
`) : " " + Ee(o[0]) : "as no adapter specified";
|
|
1249
|
+
throw new y(
|
|
1250
|
+
"There is no suitable adapter to dispatch the request " + i,
|
|
1251
|
+
"ERR_NOT_SUPPORT"
|
|
1252
|
+
);
|
|
1253
|
+
}
|
|
1254
|
+
return r;
|
|
1255
|
+
},
|
|
1256
|
+
adapters: Y
|
|
1257
|
+
};
|
|
1258
|
+
function G(e) {
|
|
1259
|
+
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1260
|
+
throw new D(null, e);
|
|
1261
|
+
}
|
|
1262
|
+
function Re(e) {
|
|
1263
|
+
return G(e), e.headers = A.from(e.headers), e.data = X.call(
|
|
1264
|
+
e,
|
|
1265
|
+
e.transformRequest
|
|
1266
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Ve.getAdapter(e.adapter || oe.adapter)(e).then(function(r) {
|
|
1267
|
+
return G(e), r.data = X.call(
|
|
1268
|
+
e,
|
|
1269
|
+
e.transformResponse,
|
|
1270
|
+
r
|
|
1271
|
+
), r.headers = A.from(r.headers), r;
|
|
1272
|
+
}, function(r) {
|
|
1273
|
+
return qe(r) || (G(e), r && r.response && (r.response.data = X.call(
|
|
1274
|
+
e,
|
|
1275
|
+
e.transformResponse,
|
|
1276
|
+
r.response
|
|
1277
|
+
), r.response.headers = A.from(r.response.headers))), Promise.reject(r);
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
const _e = (e) => e instanceof A ? e.toJSON() : e;
|
|
1281
|
+
function C(e, t) {
|
|
1282
|
+
t = t || {};
|
|
1283
|
+
const n = {};
|
|
1284
|
+
function r(d, u, c) {
|
|
1285
|
+
return a.isPlainObject(d) && a.isPlainObject(u) ? a.merge.call({ caseless: c }, d, u) : a.isPlainObject(u) ? a.merge({}, u) : a.isArray(u) ? u.slice() : u;
|
|
1286
|
+
}
|
|
1287
|
+
function s(d, u, c) {
|
|
1288
|
+
if (a.isUndefined(u)) {
|
|
1289
|
+
if (!a.isUndefined(d))
|
|
1290
|
+
return r(void 0, d, c);
|
|
1291
|
+
} else
|
|
1292
|
+
return r(d, u, c);
|
|
1293
|
+
}
|
|
1294
|
+
function o(d, u) {
|
|
1295
|
+
if (!a.isUndefined(u))
|
|
1296
|
+
return r(void 0, u);
|
|
1297
|
+
}
|
|
1298
|
+
function i(d, u) {
|
|
1299
|
+
if (a.isUndefined(u)) {
|
|
1300
|
+
if (!a.isUndefined(d))
|
|
1301
|
+
return r(void 0, d);
|
|
1302
|
+
} else
|
|
1303
|
+
return r(void 0, u);
|
|
1304
|
+
}
|
|
1305
|
+
function l(d, u, c) {
|
|
1306
|
+
if (c in t)
|
|
1307
|
+
return r(d, u);
|
|
1308
|
+
if (c in e)
|
|
1309
|
+
return r(void 0, d);
|
|
1310
|
+
}
|
|
1311
|
+
const f = {
|
|
1312
|
+
url: o,
|
|
1313
|
+
method: o,
|
|
1314
|
+
data: o,
|
|
1315
|
+
baseURL: i,
|
|
1316
|
+
transformRequest: i,
|
|
1317
|
+
transformResponse: i,
|
|
1318
|
+
paramsSerializer: i,
|
|
1319
|
+
timeout: i,
|
|
1320
|
+
timeoutMessage: i,
|
|
1321
|
+
withCredentials: i,
|
|
1322
|
+
withXSRFToken: i,
|
|
1323
|
+
adapter: i,
|
|
1324
|
+
responseType: i,
|
|
1325
|
+
xsrfCookieName: i,
|
|
1326
|
+
xsrfHeaderName: i,
|
|
1327
|
+
onUploadProgress: i,
|
|
1328
|
+
onDownloadProgress: i,
|
|
1329
|
+
decompress: i,
|
|
1330
|
+
maxContentLength: i,
|
|
1331
|
+
maxBodyLength: i,
|
|
1332
|
+
beforeRedirect: i,
|
|
1333
|
+
transport: i,
|
|
1334
|
+
httpAgent: i,
|
|
1335
|
+
httpsAgent: i,
|
|
1336
|
+
cancelToken: i,
|
|
1337
|
+
socketPath: i,
|
|
1338
|
+
responseEncoding: i,
|
|
1339
|
+
validateStatus: l,
|
|
1340
|
+
headers: (d, u) => s(_e(d), _e(u), !0)
|
|
1341
|
+
};
|
|
1342
|
+
return a.forEach(Object.keys(Object.assign({}, e, t)), function(u) {
|
|
1343
|
+
const c = f[u] || s, m = c(e[u], t[u], u);
|
|
1344
|
+
a.isUndefined(m) && c !== l || (n[u] = m);
|
|
1345
|
+
}), n;
|
|
1346
|
+
}
|
|
1347
|
+
const Je = "1.6.2", ie = {};
|
|
1348
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1349
|
+
ie[e] = function(r) {
|
|
1350
|
+
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1351
|
+
};
|
|
1352
|
+
});
|
|
1353
|
+
const Se = {};
|
|
1354
|
+
ie.transitional = function(t, n, r) {
|
|
1355
|
+
function s(o, i) {
|
|
1356
|
+
return "[Axios v" + Je + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
|
|
1357
|
+
}
|
|
1358
|
+
return (o, i, l) => {
|
|
1359
|
+
if (t === !1)
|
|
1360
|
+
throw new y(
|
|
1361
|
+
s(i, " has been removed" + (n ? " in " + n : "")),
|
|
1362
|
+
y.ERR_DEPRECATED
|
|
1363
|
+
);
|
|
1364
|
+
return n && !Se[i] && (Se[i] = !0, console.warn(
|
|
1365
|
+
s(
|
|
1366
|
+
i,
|
|
1367
|
+
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1368
|
+
)
|
|
1369
|
+
)), t ? t(o, i, l) : !0;
|
|
1370
|
+
};
|
|
1371
|
+
};
|
|
1372
|
+
function Un(e, t, n) {
|
|
1373
|
+
if (typeof e != "object")
|
|
1374
|
+
throw new y("options must be an object", y.ERR_BAD_OPTION_VALUE);
|
|
1375
|
+
const r = Object.keys(e);
|
|
1376
|
+
let s = r.length;
|
|
1377
|
+
for (; s-- > 0; ) {
|
|
1378
|
+
const o = r[s], i = t[o];
|
|
1379
|
+
if (i) {
|
|
1380
|
+
const l = e[o], f = l === void 0 || i(l, o, e);
|
|
1381
|
+
if (f !== !0)
|
|
1382
|
+
throw new y("option " + o + " must be " + f, y.ERR_BAD_OPTION_VALUE);
|
|
1383
|
+
continue;
|
|
1384
|
+
}
|
|
1385
|
+
if (n !== !0)
|
|
1386
|
+
throw new y("Unknown option " + o, y.ERR_BAD_OPTION);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
const ee = {
|
|
1390
|
+
assertOptions: Un,
|
|
1391
|
+
validators: ie
|
|
1392
|
+
}, T = ee.validators;
|
|
1393
|
+
class $ {
|
|
1394
|
+
constructor(t) {
|
|
1395
|
+
this.defaults = t, this.interceptors = {
|
|
1396
|
+
request: new ye(),
|
|
1397
|
+
response: new ye()
|
|
1398
|
+
};
|
|
1399
|
+
}
|
|
1400
|
+
/**
|
|
1401
|
+
* Dispatch a request
|
|
1402
|
+
*
|
|
1403
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
1404
|
+
* @param {?Object} config
|
|
1405
|
+
*
|
|
1406
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
1407
|
+
*/
|
|
1408
|
+
request(t, n) {
|
|
1409
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = C(this.defaults, n);
|
|
1410
|
+
const { transitional: r, paramsSerializer: s, headers: o } = n;
|
|
1411
|
+
r !== void 0 && ee.assertOptions(r, {
|
|
1412
|
+
silentJSONParsing: T.transitional(T.boolean),
|
|
1413
|
+
forcedJSONParsing: T.transitional(T.boolean),
|
|
1414
|
+
clarifyTimeoutError: T.transitional(T.boolean)
|
|
1415
|
+
}, !1), s != null && (a.isFunction(s) ? n.paramsSerializer = {
|
|
1416
|
+
serialize: s
|
|
1417
|
+
} : ee.assertOptions(s, {
|
|
1418
|
+
encode: T.function,
|
|
1419
|
+
serialize: T.function
|
|
1420
|
+
}, !0)), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1421
|
+
let i = o && a.merge(
|
|
1422
|
+
o.common,
|
|
1423
|
+
o[n.method]
|
|
1424
|
+
);
|
|
1425
|
+
o && a.forEach(
|
|
1426
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1427
|
+
(p) => {
|
|
1428
|
+
delete o[p];
|
|
1429
|
+
}
|
|
1430
|
+
), n.headers = A.concat(i, o);
|
|
1431
|
+
const l = [];
|
|
1432
|
+
let f = !0;
|
|
1433
|
+
this.interceptors.request.forEach(function(h) {
|
|
1434
|
+
typeof h.runWhen == "function" && h.runWhen(n) === !1 || (f = f && h.synchronous, l.unshift(h.fulfilled, h.rejected));
|
|
1435
|
+
});
|
|
1436
|
+
const d = [];
|
|
1437
|
+
this.interceptors.response.forEach(function(h) {
|
|
1438
|
+
d.push(h.fulfilled, h.rejected);
|
|
1439
|
+
});
|
|
1440
|
+
let u, c = 0, m;
|
|
1441
|
+
if (!f) {
|
|
1442
|
+
const p = [Re.bind(this), void 0];
|
|
1443
|
+
for (p.unshift.apply(p, l), p.push.apply(p, d), m = p.length, u = Promise.resolve(n); c < m; )
|
|
1444
|
+
u = u.then(p[c++], p[c++]);
|
|
1445
|
+
return u;
|
|
1446
|
+
}
|
|
1447
|
+
m = l.length;
|
|
1448
|
+
let E = n;
|
|
1449
|
+
for (c = 0; c < m; ) {
|
|
1450
|
+
const p = l[c++], h = l[c++];
|
|
1451
|
+
try {
|
|
1452
|
+
E = p(E);
|
|
1453
|
+
} catch (b) {
|
|
1454
|
+
h.call(this, b);
|
|
1455
|
+
break;
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
try {
|
|
1459
|
+
u = Re.call(this, E);
|
|
1460
|
+
} catch (p) {
|
|
1461
|
+
return Promise.reject(p);
|
|
1462
|
+
}
|
|
1463
|
+
for (c = 0, m = d.length; c < m; )
|
|
1464
|
+
u = u.then(d[c++], d[c++]);
|
|
1465
|
+
return u;
|
|
1466
|
+
}
|
|
1467
|
+
getUri(t) {
|
|
1468
|
+
t = C(this.defaults, t);
|
|
1469
|
+
const n = ze(t.baseURL, t.url);
|
|
1470
|
+
return Ie(n, t.params, t.paramsSerializer);
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1474
|
+
$.prototype[t] = function(n, r) {
|
|
1475
|
+
return this.request(C(r || {}, {
|
|
1476
|
+
method: t,
|
|
1477
|
+
url: n,
|
|
1478
|
+
data: (r || {}).data
|
|
1479
|
+
}));
|
|
1480
|
+
};
|
|
1481
|
+
});
|
|
1482
|
+
a.forEach(["post", "put", "patch"], function(t) {
|
|
1483
|
+
function n(r) {
|
|
1484
|
+
return function(o, i, l) {
|
|
1485
|
+
return this.request(C(l || {}, {
|
|
1486
|
+
method: t,
|
|
1487
|
+
headers: r ? {
|
|
1488
|
+
"Content-Type": "multipart/form-data"
|
|
1489
|
+
} : {},
|
|
1490
|
+
url: o,
|
|
1491
|
+
data: i
|
|
1492
|
+
}));
|
|
1493
|
+
};
|
|
1494
|
+
}
|
|
1495
|
+
$.prototype[t] = n(), $.prototype[t + "Form"] = n(!0);
|
|
1496
|
+
});
|
|
1497
|
+
const H = $;
|
|
1498
|
+
class ae {
|
|
1499
|
+
constructor(t) {
|
|
1500
|
+
if (typeof t != "function")
|
|
1501
|
+
throw new TypeError("executor must be a function.");
|
|
1502
|
+
let n;
|
|
1503
|
+
this.promise = new Promise(function(o) {
|
|
1504
|
+
n = o;
|
|
1505
|
+
});
|
|
1506
|
+
const r = this;
|
|
1507
|
+
this.promise.then((s) => {
|
|
1508
|
+
if (!r._listeners)
|
|
1509
|
+
return;
|
|
1510
|
+
let o = r._listeners.length;
|
|
1511
|
+
for (; o-- > 0; )
|
|
1512
|
+
r._listeners[o](s);
|
|
1513
|
+
r._listeners = null;
|
|
1514
|
+
}), this.promise.then = (s) => {
|
|
1515
|
+
let o;
|
|
1516
|
+
const i = new Promise((l) => {
|
|
1517
|
+
r.subscribe(l), o = l;
|
|
1518
|
+
}).then(s);
|
|
1519
|
+
return i.cancel = function() {
|
|
1520
|
+
r.unsubscribe(o);
|
|
1521
|
+
}, i;
|
|
1522
|
+
}, t(function(o, i, l) {
|
|
1523
|
+
r.reason || (r.reason = new D(o, i, l), n(r.reason));
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
/**
|
|
1527
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
1528
|
+
*/
|
|
1529
|
+
throwIfRequested() {
|
|
1530
|
+
if (this.reason)
|
|
1531
|
+
throw this.reason;
|
|
1532
|
+
}
|
|
1533
|
+
/**
|
|
1534
|
+
* Subscribe to the cancel signal
|
|
1535
|
+
*/
|
|
1536
|
+
subscribe(t) {
|
|
1537
|
+
if (this.reason) {
|
|
1538
|
+
t(this.reason);
|
|
1539
|
+
return;
|
|
1540
|
+
}
|
|
1541
|
+
this._listeners ? this._listeners.push(t) : this._listeners = [t];
|
|
1542
|
+
}
|
|
1543
|
+
/**
|
|
1544
|
+
* Unsubscribe from the cancel signal
|
|
1545
|
+
*/
|
|
1546
|
+
unsubscribe(t) {
|
|
1547
|
+
if (!this._listeners)
|
|
1548
|
+
return;
|
|
1549
|
+
const n = this._listeners.indexOf(t);
|
|
1550
|
+
n !== -1 && this._listeners.splice(n, 1);
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
1554
|
+
* cancels the `CancelToken`.
|
|
1555
|
+
*/
|
|
1556
|
+
static source() {
|
|
1557
|
+
let t;
|
|
1558
|
+
return {
|
|
1559
|
+
token: new ae(function(s) {
|
|
1560
|
+
t = s;
|
|
1561
|
+
}),
|
|
1562
|
+
cancel: t
|
|
1563
|
+
};
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
const vn = ae;
|
|
1567
|
+
function Dn(e) {
|
|
1568
|
+
return function(n) {
|
|
1569
|
+
return e.apply(null, n);
|
|
1570
|
+
};
|
|
1571
|
+
}
|
|
1572
|
+
function jn(e) {
|
|
1573
|
+
return a.isObject(e) && e.isAxiosError === !0;
|
|
1574
|
+
}
|
|
1575
|
+
const te = {
|
|
1576
|
+
Continue: 100,
|
|
1577
|
+
SwitchingProtocols: 101,
|
|
1578
|
+
Processing: 102,
|
|
1579
|
+
EarlyHints: 103,
|
|
1580
|
+
Ok: 200,
|
|
1581
|
+
Created: 201,
|
|
1582
|
+
Accepted: 202,
|
|
1583
|
+
NonAuthoritativeInformation: 203,
|
|
1584
|
+
NoContent: 204,
|
|
1585
|
+
ResetContent: 205,
|
|
1586
|
+
PartialContent: 206,
|
|
1587
|
+
MultiStatus: 207,
|
|
1588
|
+
AlreadyReported: 208,
|
|
1589
|
+
ImUsed: 226,
|
|
1590
|
+
MultipleChoices: 300,
|
|
1591
|
+
MovedPermanently: 301,
|
|
1592
|
+
Found: 302,
|
|
1593
|
+
SeeOther: 303,
|
|
1594
|
+
NotModified: 304,
|
|
1595
|
+
UseProxy: 305,
|
|
1596
|
+
Unused: 306,
|
|
1597
|
+
TemporaryRedirect: 307,
|
|
1598
|
+
PermanentRedirect: 308,
|
|
1599
|
+
BadRequest: 400,
|
|
1600
|
+
Unauthorized: 401,
|
|
1601
|
+
PaymentRequired: 402,
|
|
1602
|
+
Forbidden: 403,
|
|
1603
|
+
NotFound: 404,
|
|
1604
|
+
MethodNotAllowed: 405,
|
|
1605
|
+
NotAcceptable: 406,
|
|
1606
|
+
ProxyAuthenticationRequired: 407,
|
|
1607
|
+
RequestTimeout: 408,
|
|
1608
|
+
Conflict: 409,
|
|
1609
|
+
Gone: 410,
|
|
1610
|
+
LengthRequired: 411,
|
|
1611
|
+
PreconditionFailed: 412,
|
|
1612
|
+
PayloadTooLarge: 413,
|
|
1613
|
+
UriTooLong: 414,
|
|
1614
|
+
UnsupportedMediaType: 415,
|
|
1615
|
+
RangeNotSatisfiable: 416,
|
|
1616
|
+
ExpectationFailed: 417,
|
|
1617
|
+
ImATeapot: 418,
|
|
1618
|
+
MisdirectedRequest: 421,
|
|
1619
|
+
UnprocessableEntity: 422,
|
|
1620
|
+
Locked: 423,
|
|
1621
|
+
FailedDependency: 424,
|
|
1622
|
+
TooEarly: 425,
|
|
1623
|
+
UpgradeRequired: 426,
|
|
1624
|
+
PreconditionRequired: 428,
|
|
1625
|
+
TooManyRequests: 429,
|
|
1626
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
1627
|
+
UnavailableForLegalReasons: 451,
|
|
1628
|
+
InternalServerError: 500,
|
|
1629
|
+
NotImplemented: 501,
|
|
1630
|
+
BadGateway: 502,
|
|
1631
|
+
ServiceUnavailable: 503,
|
|
1632
|
+
GatewayTimeout: 504,
|
|
1633
|
+
HttpVersionNotSupported: 505,
|
|
1634
|
+
VariantAlsoNegotiates: 506,
|
|
1635
|
+
InsufficientStorage: 507,
|
|
1636
|
+
LoopDetected: 508,
|
|
1637
|
+
NotExtended: 510,
|
|
1638
|
+
NetworkAuthenticationRequired: 511
|
|
1639
|
+
};
|
|
1640
|
+
Object.entries(te).forEach(([e, t]) => {
|
|
1641
|
+
te[t] = e;
|
|
1642
|
+
});
|
|
1643
|
+
const kn = te;
|
|
1644
|
+
function We(e) {
|
|
1645
|
+
const t = new H(e), n = Te(H.prototype.request, t);
|
|
1646
|
+
return a.extend(n, H.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1647
|
+
return We(C(e, s));
|
|
1648
|
+
}, n;
|
|
1649
|
+
}
|
|
1650
|
+
const w = We(oe);
|
|
1651
|
+
w.Axios = H;
|
|
1652
|
+
w.CanceledError = D;
|
|
1653
|
+
w.CancelToken = vn;
|
|
1654
|
+
w.isCancel = qe;
|
|
1655
|
+
w.VERSION = Je;
|
|
1656
|
+
w.toFormData = V;
|
|
1657
|
+
w.AxiosError = y;
|
|
1658
|
+
w.Cancel = w.CanceledError;
|
|
1659
|
+
w.all = function(t) {
|
|
1660
|
+
return Promise.all(t);
|
|
1661
|
+
};
|
|
1662
|
+
w.spread = Dn;
|
|
1663
|
+
w.isAxiosError = jn;
|
|
1664
|
+
w.mergeConfig = C;
|
|
1665
|
+
w.AxiosHeaders = A;
|
|
1666
|
+
w.formToJSON = (e) => Me(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1667
|
+
w.getAdapter = Ve.getAdapter;
|
|
1668
|
+
w.HttpStatusCode = kn;
|
|
1669
|
+
w.default = w;
|
|
1670
|
+
const In = w, Hn = /* @__PURE__ */ ge({
|
|
1671
|
+
__name: "FileViewer",
|
|
1672
|
+
props: {
|
|
1673
|
+
file: null,
|
|
1674
|
+
url: null
|
|
1675
|
+
},
|
|
1676
|
+
setup(e) {
|
|
1677
|
+
const t = e, n = F(!1), r = F(""), s = F(""), o = F(""), i = F();
|
|
1678
|
+
return (() => {
|
|
1679
|
+
const l = {
|
|
1680
|
+
loading: "正在加载中,请耐心等待...",
|
|
1681
|
+
reading: "正在努力解析文件...",
|
|
1682
|
+
errorLoading: (u) => `加载文件异常:${u}`,
|
|
1683
|
+
errorReading: (u) => `读取文件异常:${u}`
|
|
1684
|
+
};
|
|
1685
|
+
let f;
|
|
1686
|
+
const d = {
|
|
1687
|
+
// 从url加载
|
|
1688
|
+
async loadFromUrl() {
|
|
1689
|
+
const { url: u } = t;
|
|
1690
|
+
if (!u)
|
|
1691
|
+
return;
|
|
1692
|
+
this.startLoading(l.loading);
|
|
1693
|
+
const c = u.substring(u.lastIndexOf("/") + 1);
|
|
1694
|
+
try {
|
|
1695
|
+
const { data: m } = await In({ url: u, method: "get", responseType: "blob" });
|
|
1696
|
+
if (!m)
|
|
1697
|
+
return this.showError("文件下载失败");
|
|
1698
|
+
const E = this.wrap(m, c);
|
|
1699
|
+
return this.resolveFile(E);
|
|
1700
|
+
} catch (m) {
|
|
1701
|
+
this.showError(l.errorLoading(m));
|
|
1702
|
+
} finally {
|
|
1703
|
+
this.endLoading();
|
|
1704
|
+
}
|
|
1705
|
+
},
|
|
1706
|
+
// 包装file
|
|
1707
|
+
wrap(u, c) {
|
|
1708
|
+
if (u instanceof File)
|
|
1709
|
+
return u;
|
|
1710
|
+
if (u instanceof Blob && c)
|
|
1711
|
+
return new File([u], c, {});
|
|
1712
|
+
if (u instanceof ArrayBuffer)
|
|
1713
|
+
return this.wrap(new Blob([u]));
|
|
1714
|
+
throw new Error("不支持的文件类型格式!");
|
|
1715
|
+
},
|
|
1716
|
+
// 处理并解析文件
|
|
1717
|
+
async resolveFile(u) {
|
|
1718
|
+
n.value && this.endLoading();
|
|
1719
|
+
const c = this.wrap(u);
|
|
1720
|
+
this.startLoading(l.reading);
|
|
1721
|
+
try {
|
|
1722
|
+
o.value = c.name && decodeURIComponent(c.name) || "";
|
|
1723
|
+
const m = await ot(c);
|
|
1724
|
+
m instanceof ArrayBuffer && (f = await this.displayResult(m, c));
|
|
1725
|
+
} catch (m) {
|
|
1726
|
+
console.error(m), this.showError(l.errorReading(m));
|
|
1727
|
+
} finally {
|
|
1728
|
+
this.endLoading();
|
|
1729
|
+
}
|
|
1730
|
+
},
|
|
1731
|
+
// 展示渲染最终效果
|
|
1732
|
+
displayResult(u, c) {
|
|
1733
|
+
const { name: m } = c, E = Et(m), p = i.value;
|
|
1734
|
+
if (!p)
|
|
1735
|
+
return Promise.resolve();
|
|
1736
|
+
f && (p.lastChild && p.removeChild(p.lastChild), f.$destroy());
|
|
1737
|
+
const h = document.createElement("div");
|
|
1738
|
+
h.className = "file-render";
|
|
1739
|
+
const b = p.appendChild(h);
|
|
1740
|
+
return new Promise((R, S) => Rt(u, E, b).then(R).catch(S));
|
|
1741
|
+
},
|
|
1742
|
+
showError(u) {
|
|
1743
|
+
r.value = u;
|
|
1744
|
+
},
|
|
1745
|
+
startLoading(u) {
|
|
1746
|
+
n.value = !0, s.value = u, r.value = "";
|
|
1747
|
+
},
|
|
1748
|
+
endLoading() {
|
|
1749
|
+
n.value = !1, s.value = "";
|
|
1750
|
+
}
|
|
1751
|
+
};
|
|
1752
|
+
Qe(() => {
|
|
1753
|
+
t.file && d.resolveFile(t.file), d.loadFromUrl();
|
|
1754
|
+
}), le(() => t.url, () => d.loadFromUrl()), le(() => t.file, (u) => u && d.resolveFile(u));
|
|
1755
|
+
})(), { __sfc: !0, props: t, loading: n, error: r, message: s, filename: o, output: i };
|
|
1756
|
+
}
|
|
1757
|
+
});
|
|
1758
|
+
var $n = function() {
|
|
1759
|
+
var t = this, n = t._self._c, r = t._self._setupProxy;
|
|
1760
|
+
return n("div", { staticClass: "file-viewer" }, [n("div", { staticClass: "name" }, [t._v(t._s(r.filename))]), r.error ? n("div", { staticClass: "content loading" }, [t._v(t._s(r.error))]) : [n("div", { directives: [{ name: "show", rawName: "v-show", value: r.loading, expression: "loading" }], staticClass: "content loading" }, [t._v(t._s(r.message))]), n("div", { directives: [{ name: "show", rawName: "v-show", value: !r.loading, expression: "!loading" }], ref: "output", staticClass: "content" })]], 2);
|
|
1761
|
+
}, Mn = [], qn = /* @__PURE__ */ Ae(
|
|
1762
|
+
Hn,
|
|
1763
|
+
$n,
|
|
1764
|
+
Mn,
|
|
1765
|
+
!1,
|
|
1766
|
+
null,
|
|
1767
|
+
"ab17bda9",
|
|
1768
|
+
null,
|
|
1769
|
+
null
|
|
1770
|
+
);
|
|
1771
|
+
const zn = qn.exports, Vn = [
|
|
1772
|
+
["file-viewer", zn]
|
|
1773
|
+
];
|
|
1774
|
+
class Jn {
|
|
1775
|
+
constructor() {
|
|
1776
|
+
ce(this, "installed", !1);
|
|
1777
|
+
}
|
|
1778
|
+
install(t) {
|
|
1779
|
+
this.installed || (Vn.forEach(([n, r]) => t.component(n, r)), this.installed = !0);
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
const Xn = new Jn();
|
|
1783
|
+
export {
|
|
1784
|
+
zn as F,
|
|
1785
|
+
Xn as i,
|
|
1786
|
+
Ae as n
|
|
1787
|
+
};
|