file-viewer3 1.0.1

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