@eternalheart/vue-file-preview 1.3.7 → 1.3.9
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/lib/FilePreviewContent.vue.d.ts +13 -1
- package/lib/FilePreviewContent.vue.d.ts.map +1 -1
- package/lib/FilePreviewEmbed.vue.d.ts +13 -1
- package/lib/FilePreviewEmbed.vue.d.ts.map +1 -1
- package/lib/FilePreviewModal.vue.d.ts +13 -1
- package/lib/FilePreviewModal.vue.d.ts.map +1 -1
- package/lib/chunks/{index-CcJ5NmY1.mjs → index-1khRVlUa.mjs} +25 -25
- package/lib/chunks/index-1khRVlUa.mjs.map +1 -0
- package/lib/chunks/{index-C8ZF84WX.mjs → index-B9Xz5bUB.mjs} +2 -2
- package/lib/chunks/{index-C8ZF84WX.mjs.map → index-B9Xz5bUB.mjs.map} +1 -1
- package/lib/chunks/{index-DpAxU2JM.mjs → index-BA-bP8P6.mjs} +789 -649
- package/lib/chunks/index-BA-bP8P6.mjs.map +1 -0
- package/lib/chunks/{index-DTLDLOGO.mjs → index-BP_8GjEV.mjs} +28 -28
- package/lib/chunks/index-BP_8GjEV.mjs.map +1 -0
- package/lib/chunks/{index-Doy0FvQW.mjs → index-BVdw1Cc8.mjs} +32 -32
- package/lib/chunks/index-BVdw1Cc8.mjs.map +1 -0
- package/lib/chunks/{index-yMb1JUC4.mjs → index-BqSPk90T.mjs} +30 -30
- package/lib/chunks/index-BqSPk90T.mjs.map +1 -0
- package/lib/chunks/index-BrCSk7CK.mjs +116 -0
- package/lib/chunks/index-BrCSk7CK.mjs.map +1 -0
- package/lib/chunks/{index-BI0dSTSM.mjs → index-Bu8GH1aq.mjs} +27 -27
- package/lib/chunks/index-Bu8GH1aq.mjs.map +1 -0
- package/lib/chunks/{index-ClxBxmPR.mjs → index-CYvPRxHK.mjs} +53 -53
- package/lib/chunks/index-CYvPRxHK.mjs.map +1 -0
- package/lib/chunks/{index-CbKSdAt_.mjs → index-Cfm88ItA.mjs} +2 -2
- package/lib/chunks/{index-CbKSdAt_.mjs.map → index-Cfm88ItA.mjs.map} +1 -1
- package/lib/chunks/{index-kBPb_OKm.mjs → index-CxKVonec.mjs} +52 -52
- package/lib/chunks/index-CxKVonec.mjs.map +1 -0
- package/lib/chunks/index-D6RuC1es.mjs +111 -0
- package/lib/chunks/index-D6RuC1es.mjs.map +1 -0
- package/lib/chunks/{index-CB0zCxJb.mjs → index-DEyjEp-i.mjs} +106 -106
- package/lib/chunks/index-DEyjEp-i.mjs.map +1 -0
- package/lib/chunks/{index-DsznjwsH.mjs → index-DFEd3JaR.mjs} +35 -35
- package/lib/chunks/index-DFEd3JaR.mjs.map +1 -0
- package/lib/chunks/index-DjvWRo53.mjs +281 -0
- package/lib/chunks/index-DjvWRo53.mjs.map +1 -0
- package/lib/chunks/{index-DUUsS_T4.mjs → index-H-QlBdbJ.mjs} +2 -2
- package/lib/chunks/{index-DUUsS_T4.mjs.map → index-H-QlBdbJ.mjs.map} +1 -1
- package/lib/chunks/{index-S_kGRh6H.mjs → index-_llF_WTY.mjs} +46 -46
- package/lib/chunks/index-_llF_WTY.mjs.map +1 -0
- package/lib/chunks/{index-D9lByoJw.mjs → index-oQRFKvtz.mjs} +13 -13
- package/lib/chunks/{index-D9lByoJw.mjs.map → index-oQRFKvtz.mjs.map} +1 -1
- package/lib/composables/useRequest.d.ts +24 -0
- package/lib/composables/useRequest.d.ts.map +1 -0
- package/lib/index.cjs +23 -23
- package/lib/index.cjs.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.mjs +6 -6
- package/lib/renderers/Csv/index.vue.d.ts.map +1 -1
- package/lib/renderers/Docx/index.vue.d.ts.map +1 -1
- package/lib/renderers/Epub/index.vue.d.ts.map +1 -1
- package/lib/renderers/Json/index.vue.d.ts.map +1 -1
- package/lib/renderers/Markdown/index.vue.d.ts.map +1 -1
- package/lib/renderers/Mobi/index.vue.d.ts.map +1 -1
- package/lib/renderers/Msg/index.vue.d.ts.map +1 -1
- package/lib/renderers/Pptx/index.vue.d.ts.map +1 -1
- package/lib/renderers/Subtitle/index.vue.d.ts.map +1 -1
- package/lib/renderers/Text/index.vue.d.ts.map +1 -1
- package/lib/renderers/Xlsx/index.vue.d.ts.map +1 -1
- package/lib/renderers/Xml/index.vue.d.ts.map +1 -1
- package/lib/renderers/Zip/index.vue.d.ts.map +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/lib/chunks/index-BI0dSTSM.mjs.map +0 -1
- package/lib/chunks/index-BW61ZRev.mjs +0 -111
- package/lib/chunks/index-BW61ZRev.mjs.map +0 -1
- package/lib/chunks/index-CB0zCxJb.mjs.map +0 -1
- package/lib/chunks/index-CBCQs1ZC.mjs +0 -116
- package/lib/chunks/index-CBCQs1ZC.mjs.map +0 -1
- package/lib/chunks/index-CcJ5NmY1.mjs.map +0 -1
- package/lib/chunks/index-ClxBxmPR.mjs.map +0 -1
- package/lib/chunks/index-DTLDLOGO.mjs.map +0 -1
- package/lib/chunks/index-Doy0FvQW.mjs.map +0 -1
- package/lib/chunks/index-DpAxU2JM.mjs.map +0 -1
- package/lib/chunks/index-DsznjwsH.mjs.map +0 -1
- package/lib/chunks/index-SAfVQyNJ.mjs +0 -281
- package/lib/chunks/index-SAfVQyNJ.mjs.map +0 -1
- package/lib/chunks/index-S_kGRh6H.mjs.map +0 -1
- package/lib/chunks/index-kBPb_OKm.mjs.map +0 -1
- package/lib/chunks/index-yMb1JUC4.mjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { ZoomOut as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
version:
|
|
1
|
+
import { inject as ce, computed as z, unref as v, provide as ae, ref as _, watch as q, onBeforeUnmount as G, h as B, defineComponent as X, openBlock as f, createElementBlock as b, createElementVNode as P, toDisplayString as I, defineAsyncComponent as pt, createVNode as H, createTextVNode as mt, toRef as Pe, onMounted as Ie, Fragment as E, renderList as O, createBlock as R, resolveDynamicComponent as V, createCommentVNode as W, normalizeStyle as oe, onUnmounted as vt, Teleport as ht, Transition as gt, withCtx as bt } from "vue";
|
|
2
|
+
import { ZoomOut as Oe, ZoomIn as qe, Scan as wt, RotateCcw as yt, RotateCw as xt, RefreshCw as Be, List as Ae, ChevronLeft as fe, ChevronRight as pe, Minimize2 as Ue, Maximize2 as He, WrapText as Ft, Code as Ze, Eye as Ve, FileQuestion as kt, Download as Ge, X as Ct } from "lucide-vue-next";
|
|
3
|
+
import _t from "jszip";
|
|
4
|
+
const Rt = "1.3.9", zt = {
|
|
5
|
+
version: Rt
|
|
6
6
|
};
|
|
7
|
-
function
|
|
7
|
+
function Mt(e) {
|
|
8
8
|
try {
|
|
9
9
|
const t = new URL(e).pathname.split("/").pop() || "file";
|
|
10
10
|
return decodeURIComponent(t);
|
|
@@ -13,7 +13,7 @@ function Ct(e) {
|
|
|
13
13
|
return decodeURIComponent(t);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function ie(e) {
|
|
17
17
|
var t;
|
|
18
18
|
const o = ((t = e.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "";
|
|
19
19
|
return {
|
|
@@ -90,36 +90,36 @@ function le(e) {
|
|
|
90
90
|
zip: "application/zip"
|
|
91
91
|
}[o] || "application/octet-stream";
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function Tt(e, t = 0) {
|
|
94
94
|
if (e instanceof File)
|
|
95
95
|
return {
|
|
96
96
|
id: `file-${Date.now()}-${t}`,
|
|
97
97
|
name: e.name,
|
|
98
98
|
url: URL.createObjectURL(e),
|
|
99
|
-
type: e.type ||
|
|
99
|
+
type: e.type || ie(e.name),
|
|
100
100
|
size: e.size
|
|
101
101
|
};
|
|
102
102
|
if (typeof e == "string") {
|
|
103
|
-
const o =
|
|
103
|
+
const o = Mt(e);
|
|
104
104
|
return {
|
|
105
105
|
id: `url-${Date.now()}-${t}`,
|
|
106
106
|
name: o,
|
|
107
107
|
url: e,
|
|
108
|
-
type:
|
|
108
|
+
type: ie(o)
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
return {
|
|
112
112
|
id: e.id || `link-${Date.now()}-${t}`,
|
|
113
113
|
name: e.name,
|
|
114
114
|
url: e.url,
|
|
115
|
-
type: e.type ||
|
|
115
|
+
type: e.type || ie(e.name),
|
|
116
116
|
size: e.size
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
return e.map((t, o) =>
|
|
119
|
+
function Et(e) {
|
|
120
|
+
return e.map((t, o) => Tt(t, o));
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function Pt(e) {
|
|
123
123
|
var t;
|
|
124
124
|
const o = ((t = e.name.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "", a = e.type.toLowerCase();
|
|
125
125
|
if (a.startsWith("image/") || ["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(o))
|
|
@@ -197,7 +197,7 @@ function Mt(e) {
|
|
|
197
197
|
];
|
|
198
198
|
return a.startsWith("text/") || l.includes(o) ? "text" : "unsupported";
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function wn(e) {
|
|
201
201
|
var t;
|
|
202
202
|
const o = ((t = e.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "";
|
|
203
203
|
return {
|
|
@@ -244,7 +244,7 @@ function ln(e) {
|
|
|
244
244
|
txt: "text"
|
|
245
245
|
}[o] || "text";
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function yn(e) {
|
|
248
248
|
var t;
|
|
249
249
|
const o = ((t = e.split(".").pop()) == null ? void 0 : t.toLowerCase().split("?")[0]) || "";
|
|
250
250
|
return {
|
|
@@ -260,80 +260,80 @@ function rn(e) {
|
|
|
260
260
|
flv: "video/x-flv"
|
|
261
261
|
}[o] || "video/mp4";
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function $t(e) {
|
|
264
264
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function xn(e) {
|
|
267
267
|
if (!isFinite(e) || isNaN(e) || e < 0) return "0:00";
|
|
268
268
|
const t = Math.floor(e / 60), o = Math.floor(e % 60);
|
|
269
269
|
return `${t}:${o.toString().padStart(2, "0")}`;
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Fn(e) {
|
|
272
272
|
var t;
|
|
273
273
|
return (((t = e.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "") === "tsv" ? " " : ",";
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function kn(e, t = {}) {
|
|
276
276
|
const o = t.delimiter ?? ",", a = t.firstRowAsHeader ?? !0, l = [];
|
|
277
|
-
let n = [],
|
|
277
|
+
let n = [], r = "", s = !1, i = 0;
|
|
278
278
|
const u = e.length;
|
|
279
|
-
for (;
|
|
280
|
-
const
|
|
279
|
+
for (; i < u; ) {
|
|
280
|
+
const c = e[i];
|
|
281
281
|
if (s) {
|
|
282
|
-
if (
|
|
283
|
-
if (e[
|
|
284
|
-
|
|
282
|
+
if (c === '"') {
|
|
283
|
+
if (e[i + 1] === '"') {
|
|
284
|
+
r += '"', i += 2;
|
|
285
285
|
continue;
|
|
286
286
|
}
|
|
287
|
-
s = !1,
|
|
287
|
+
s = !1, i += 1;
|
|
288
288
|
continue;
|
|
289
289
|
}
|
|
290
|
-
|
|
290
|
+
r += c, i += 1;
|
|
291
291
|
continue;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
294
|
-
s = !0,
|
|
293
|
+
if (c === '"') {
|
|
294
|
+
s = !0, i += 1;
|
|
295
295
|
continue;
|
|
296
296
|
}
|
|
297
|
-
if (
|
|
298
|
-
n.push(
|
|
297
|
+
if (c === o) {
|
|
298
|
+
n.push(r), r = "", i += 1;
|
|
299
299
|
continue;
|
|
300
300
|
}
|
|
301
|
-
if (
|
|
302
|
-
e[
|
|
303
|
-
` && (
|
|
301
|
+
if (c === "\r") {
|
|
302
|
+
e[i + 1] === `
|
|
303
|
+
` && (i += 1), n.push(r), l.push(n), n = [], r = "", i += 1;
|
|
304
304
|
continue;
|
|
305
305
|
}
|
|
306
|
-
if (
|
|
306
|
+
if (c === `
|
|
307
307
|
`) {
|
|
308
|
-
n.push(
|
|
308
|
+
n.push(r), l.push(n), n = [], r = "", i += 1;
|
|
309
309
|
continue;
|
|
310
310
|
}
|
|
311
|
-
|
|
311
|
+
r += c, i += 1;
|
|
312
312
|
}
|
|
313
|
-
for ((
|
|
314
|
-
const
|
|
315
|
-
if (
|
|
313
|
+
for ((r.length > 0 || n.length > 0) && (n.push(r), l.push(n)); l.length > 0; ) {
|
|
314
|
+
const c = l[l.length - 1];
|
|
315
|
+
if (c.length === 1 && c[0] === "")
|
|
316
316
|
l.pop();
|
|
317
317
|
else
|
|
318
318
|
break;
|
|
319
319
|
}
|
|
320
|
-
let d = [],
|
|
321
|
-
a && l.length > 0 && (d = l[0],
|
|
322
|
-
const
|
|
320
|
+
let d = [], m = l;
|
|
321
|
+
a && l.length > 0 && (d = l[0], m = l.slice(1));
|
|
322
|
+
const p = Math.max(
|
|
323
323
|
d.length,
|
|
324
|
-
...
|
|
324
|
+
...m.map((c) => c.length),
|
|
325
325
|
0
|
|
326
326
|
);
|
|
327
|
-
for (const
|
|
328
|
-
for (;
|
|
327
|
+
for (const c of m)
|
|
328
|
+
for (; c.length < p; ) c.push("");
|
|
329
329
|
return {
|
|
330
330
|
header: d,
|
|
331
|
-
rows:
|
|
332
|
-
columnCount:
|
|
331
|
+
rows: m,
|
|
332
|
+
columnCount: p,
|
|
333
333
|
delimiter: o
|
|
334
334
|
};
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function jt(e) {
|
|
337
337
|
const t = e instanceof Uint8Array ? e : new Uint8Array(e);
|
|
338
338
|
if (t.length >= 3 && t[0] === 239 && t[1] === 187 && t[2] === 191)
|
|
339
339
|
return new TextDecoder("utf-8").decode(t);
|
|
@@ -351,13 +351,54 @@ function Tt(e) {
|
|
|
351
351
|
}
|
|
352
352
|
return new TextDecoder("utf-8", { fatal: !1 }).decode(t);
|
|
353
353
|
}
|
|
354
|
-
async function
|
|
355
|
-
const o = await
|
|
356
|
-
if (!
|
|
357
|
-
const
|
|
358
|
-
return
|
|
354
|
+
async function Cn(e, t) {
|
|
355
|
+
const o = !!t && ("fetcher" in t || "init" in t), a = o ? t.fetcher ?? fetch : fetch, l = o ? t.init : t, n = await a(e, l);
|
|
356
|
+
if (!n.ok) throw new Error(`请求失败: ${n.status}`);
|
|
357
|
+
const r = await n.arrayBuffer();
|
|
358
|
+
return jt(r);
|
|
359
|
+
}
|
|
360
|
+
async function St(e, t) {
|
|
361
|
+
if (e)
|
|
362
|
+
return typeof e == "function" ? await e(t) : e;
|
|
363
|
+
}
|
|
364
|
+
function Lt(e, t) {
|
|
365
|
+
if (!e && !t) return;
|
|
366
|
+
if (!e) return t;
|
|
367
|
+
if (!t) return e;
|
|
368
|
+
const o = new Headers(e.headers || {});
|
|
369
|
+
return t.headers && new Headers(t.headers).forEach((a, l) => {
|
|
370
|
+
o.set(l, a);
|
|
371
|
+
}), {
|
|
372
|
+
...e,
|
|
373
|
+
...t,
|
|
374
|
+
headers: o
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
function Nt(e) {
|
|
378
|
+
const t = (e == null ? void 0 : e.requestHandler) ?? ((a, l) => fetch(a, l)), o = e == null ? void 0 : e.requestInit;
|
|
379
|
+
return async (a, l) => {
|
|
380
|
+
const n = await St(o, a), r = Lt(n, l);
|
|
381
|
+
return t(a, r);
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
async function Dt(e, t = fetch, o) {
|
|
385
|
+
const a = await t(e, o);
|
|
386
|
+
if (!a.ok) throw new Error(`请求失败: ${a.status}`);
|
|
387
|
+
const l = await a.blob();
|
|
388
|
+
return URL.createObjectURL(l);
|
|
389
|
+
}
|
|
390
|
+
async function Wt(e, t, o = fetch, a) {
|
|
391
|
+
const l = await o(e, a);
|
|
392
|
+
if (!l.ok) throw new Error(`请求失败: ${l.status}`);
|
|
393
|
+
const n = await l.blob(), r = URL.createObjectURL(n);
|
|
394
|
+
try {
|
|
395
|
+
const s = document.createElement("a");
|
|
396
|
+
s.href = r, s.download = t, s.style.display = "none", document.body.appendChild(s), s.click(), document.body.removeChild(s);
|
|
397
|
+
} finally {
|
|
398
|
+
setTimeout(() => URL.revokeObjectURL(r), 1e3);
|
|
399
|
+
}
|
|
359
400
|
}
|
|
360
|
-
function
|
|
401
|
+
function $e(e) {
|
|
361
402
|
const t = e.trim().replace(",", "."), o = t.split(":").map((a) => a.trim());
|
|
362
403
|
if (o.length === 3) {
|
|
363
404
|
const [a, l, n] = o;
|
|
@@ -369,55 +410,55 @@ function Ee(e) {
|
|
|
369
410
|
}
|
|
370
411
|
return Number(t) || 0;
|
|
371
412
|
}
|
|
372
|
-
function
|
|
413
|
+
function _n(e) {
|
|
373
414
|
if (!isFinite(e) || e < 0) return "00:00:00.000";
|
|
374
|
-
const t = Math.floor(e * 1e3), o = t % 1e3, a = Math.floor(t / 1e3) % 60, l = Math.floor(t / 6e4) % 60, n = Math.floor(t / 36e5),
|
|
375
|
-
return `${
|
|
415
|
+
const t = Math.floor(e * 1e3), o = t % 1e3, a = Math.floor(t / 1e3) % 60, l = Math.floor(t / 6e4) % 60, n = Math.floor(t / 36e5), r = (s, i = 2) => s.toString().padStart(i, "0");
|
|
416
|
+
return `${r(n)}:${r(l)}:${r(a)}.${r(o, 3)}`;
|
|
376
417
|
}
|
|
377
|
-
const
|
|
378
|
-
function
|
|
418
|
+
const je = /(\d{1,2}:)?\d{1,2}:\d{1,2}[.,]\d{1,3}\s*-->\s*(\d{1,2}:)?\d{1,2}:\d{1,2}[.,]\d{1,3}/, It = /^\s*\[\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?\]/;
|
|
419
|
+
function Ot(e) {
|
|
379
420
|
const t = e.replace(/^\uFEFF/, "").trimStart();
|
|
380
|
-
return /^WEBVTT/.test(t) ? "vtt" : /^<\?xml/i.test(t) || /<tt\b[^>]*>/i.test(t) ? "ttml" : /^\[Script Info\]/im.test(t) || /^Dialogue:/m.test(t) ? /ScriptType:\s*v4\.00\s*$/im.test(t) ? "ssa" : "ass" :
|
|
421
|
+
return /^WEBVTT/.test(t) ? "vtt" : /^<\?xml/i.test(t) || /<tt\b[^>]*>/i.test(t) ? "ttml" : /^\[Script Info\]/im.test(t) || /^Dialogue:/m.test(t) ? /ScriptType:\s*v4\.00\s*$/im.test(t) ? "ssa" : "ass" : It.test(t) || /^\[(ti|ar|al|au|by|length|offset|re|ve):/im.test(t) ? /<\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?>/.test(t) ? "elrc" : "lrc" : "srt";
|
|
381
422
|
}
|
|
382
|
-
function
|
|
423
|
+
function Se(e, t) {
|
|
383
424
|
const o = e.replace(/\r\n?/g, `
|
|
384
425
|
`).replace(/^\uFEFF/, "").split(`
|
|
385
426
|
`), a = [];
|
|
386
427
|
let l, n = 0;
|
|
387
428
|
if (t === "vtt") {
|
|
388
|
-
const
|
|
429
|
+
const r = [];
|
|
389
430
|
for (; n < o.length && o[n].trim() !== ""; )
|
|
390
|
-
|
|
391
|
-
for (l =
|
|
431
|
+
r.push(o[n]), n++;
|
|
432
|
+
for (l = r.join(`
|
|
392
433
|
`); n < o.length && o[n].trim() === ""; ) n++;
|
|
393
434
|
}
|
|
394
435
|
for (; n < o.length; ) {
|
|
395
436
|
for (; n < o.length && o[n].trim() === ""; ) n++;
|
|
396
437
|
if (n >= o.length) break;
|
|
397
|
-
let
|
|
398
|
-
if (
|
|
438
|
+
let r, s = null;
|
|
439
|
+
if (je.test(o[n]))
|
|
399
440
|
s = o[n], n++;
|
|
400
|
-
else if (
|
|
441
|
+
else if (r = o[n].trim() || void 0, n++, n < o.length && je.test(o[n]))
|
|
401
442
|
s = o[n], n++;
|
|
402
443
|
else
|
|
403
444
|
continue;
|
|
404
445
|
if (!s) continue;
|
|
405
|
-
const
|
|
406
|
-
if (!
|
|
407
|
-
const u =
|
|
446
|
+
const i = s.match(/([\d:.,]+)\s*-->\s*([\d:.,]+)/);
|
|
447
|
+
if (!i) continue;
|
|
448
|
+
const u = $e(i[1]), d = $e(i[2]), m = [];
|
|
408
449
|
for (; n < o.length && o[n].trim() !== ""; )
|
|
409
|
-
|
|
410
|
-
a.push({ id:
|
|
450
|
+
m.push(o[n]), n++;
|
|
451
|
+
a.push({ id: r, start: u, end: d, text: m.join(`
|
|
411
452
|
`) });
|
|
412
453
|
}
|
|
413
454
|
return { format: t, cues: a, header: l };
|
|
414
455
|
}
|
|
415
|
-
function
|
|
456
|
+
function de(e, t, o) {
|
|
416
457
|
const a = Number(e), l = Number(t);
|
|
417
458
|
let n = 0;
|
|
418
459
|
if (o) {
|
|
419
|
-
const
|
|
420
|
-
n = Number(
|
|
460
|
+
const r = (o + "000").slice(0, 3);
|
|
461
|
+
n = Number(r);
|
|
421
462
|
}
|
|
422
463
|
return a * 60 + l + n / 1e3;
|
|
423
464
|
}
|
|
@@ -431,63 +472,63 @@ function Xe(e, t) {
|
|
|
431
472
|
}
|
|
432
473
|
return !0;
|
|
433
474
|
}
|
|
434
|
-
function
|
|
475
|
+
function qt(e) {
|
|
435
476
|
const t = e.replace(/\r\n?/g, `
|
|
436
477
|
`).replace(/^\uFEFF/, "").split(`
|
|
437
478
|
`), o = { metadata: {}, offsetMs: 0 }, a = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, l = [];
|
|
438
|
-
for (const
|
|
439
|
-
const s =
|
|
479
|
+
for (const r of t) {
|
|
480
|
+
const s = r.trim();
|
|
440
481
|
if (!s || Xe(s, o)) continue;
|
|
441
|
-
const
|
|
482
|
+
const i = [];
|
|
442
483
|
let u = 0;
|
|
443
484
|
a.lastIndex = 0;
|
|
444
485
|
let d;
|
|
445
486
|
for (; (d = a.exec(s)) !== null && d.index === u; )
|
|
446
|
-
|
|
447
|
-
if (
|
|
448
|
-
const
|
|
449
|
-
for (const
|
|
450
|
-
l.push({ start:
|
|
487
|
+
i.push(de(d[1], d[2], d[3])), u = d.index + d[0].length;
|
|
488
|
+
if (i.length === 0) continue;
|
|
489
|
+
const m = s.slice(u).trim();
|
|
490
|
+
for (const p of i)
|
|
491
|
+
l.push({ start: p, text: m });
|
|
451
492
|
}
|
|
452
|
-
l.sort((
|
|
493
|
+
l.sort((r, s) => r.start - s.start);
|
|
453
494
|
const n = o.offsetMs / 1e3;
|
|
454
|
-
return { format: "lrc", cues: l.map((
|
|
455
|
-
const
|
|
456
|
-
return { start:
|
|
495
|
+
return { format: "lrc", cues: l.map((r, s) => {
|
|
496
|
+
const i = Math.max(0, r.start - n), u = l[s + 1], d = u ? Math.max(i, u.start - n) : i + 5;
|
|
497
|
+
return { start: i, end: d, text: r.text };
|
|
457
498
|
}), metadata: o.metadata };
|
|
458
499
|
}
|
|
459
|
-
function
|
|
500
|
+
function Bt(e) {
|
|
460
501
|
const t = e.replace(/\r\n?/g, `
|
|
461
502
|
`).replace(/^\uFEFF/, "").split(`
|
|
462
503
|
`), o = { metadata: {}, offsetMs: 0 }, a = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, l = /<(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?>/g, n = [];
|
|
463
504
|
for (const s of t) {
|
|
464
|
-
const
|
|
465
|
-
if (!
|
|
505
|
+
const i = s.trim();
|
|
506
|
+
if (!i || Xe(i, o)) continue;
|
|
466
507
|
const u = [];
|
|
467
508
|
let d = 0;
|
|
468
509
|
a.lastIndex = 0;
|
|
469
|
-
let
|
|
470
|
-
for (; (
|
|
471
|
-
u.push(
|
|
510
|
+
let m;
|
|
511
|
+
for (; (m = a.exec(i)) !== null && m.index === d; )
|
|
512
|
+
u.push(de(m[1], m[2], m[3])), d = m.index + m[0].length;
|
|
472
513
|
if (u.length === 0) continue;
|
|
473
|
-
const
|
|
474
|
-
for (const
|
|
475
|
-
n.push({ start:
|
|
514
|
+
const p = i.slice(d);
|
|
515
|
+
for (const c of u)
|
|
516
|
+
n.push({ start: c, raw: p });
|
|
476
517
|
}
|
|
477
|
-
n.sort((s,
|
|
478
|
-
const
|
|
479
|
-
return { format: "elrc", cues: n.map((s,
|
|
518
|
+
n.sort((s, i) => s.start - i.start);
|
|
519
|
+
const r = o.offsetMs / 1e3;
|
|
520
|
+
return { format: "elrc", cues: n.map((s, i) => {
|
|
480
521
|
const u = [];
|
|
481
|
-
let d = "",
|
|
522
|
+
let d = "", m = 0, p = null;
|
|
482
523
|
l.lastIndex = 0;
|
|
483
|
-
let
|
|
484
|
-
for (; (
|
|
485
|
-
const
|
|
486
|
-
|
|
524
|
+
let c;
|
|
525
|
+
for (; (c = l.exec(s.raw)) !== null; ) {
|
|
526
|
+
const $ = s.raw.slice(m, c.index);
|
|
527
|
+
p !== null && $ && u.push({ start: Math.max(0, p - r), text: $ }), d += $, p = de(c[1], c[2], c[3]), m = c.index + c[0].length;
|
|
487
528
|
}
|
|
488
|
-
const
|
|
489
|
-
|
|
490
|
-
const M = Math.max(0, s.start -
|
|
529
|
+
const F = s.raw.slice(m);
|
|
530
|
+
p !== null && F && u.push({ start: Math.max(0, p - r), text: F }), d += F;
|
|
531
|
+
const M = Math.max(0, s.start - r), L = n[i + 1], k = L ? Math.max(M, L.start - r) : M + 5;
|
|
491
532
|
return {
|
|
492
533
|
start: M,
|
|
493
534
|
end: k,
|
|
@@ -496,7 +537,7 @@ function St(e) {
|
|
|
496
537
|
};
|
|
497
538
|
}), metadata: o.metadata };
|
|
498
539
|
}
|
|
499
|
-
function
|
|
540
|
+
function Le(e) {
|
|
500
541
|
const t = e.trim().split(":");
|
|
501
542
|
return t.length !== 3 ? 0 : Number(t[0]) * 3600 + Number(t[1]) * 60 + Number(t[2].replace(",", "."));
|
|
502
543
|
}
|
|
@@ -505,41 +546,41 @@ function Ne(e, t) {
|
|
|
505
546
|
`).replace(/^\uFEFF/, "").split(`
|
|
506
547
|
`);
|
|
507
548
|
let a = "", l = [];
|
|
508
|
-
const n = [],
|
|
549
|
+
const n = [], r = [];
|
|
509
550
|
for (const s of o) {
|
|
510
|
-
const
|
|
551
|
+
const i = s.replace(/\s+$/, ""), u = i.trim(), d = /^\[([^\]]+)\]\s*$/.exec(u);
|
|
511
552
|
if (d) {
|
|
512
|
-
a = d[1].toLowerCase(),
|
|
553
|
+
a = d[1].toLowerCase(), r.push(i);
|
|
513
554
|
continue;
|
|
514
555
|
}
|
|
515
556
|
if (a !== "events") {
|
|
516
|
-
|
|
557
|
+
r.push(i);
|
|
517
558
|
continue;
|
|
518
559
|
}
|
|
519
|
-
const
|
|
520
|
-
if (
|
|
521
|
-
l =
|
|
560
|
+
const m = /^Format:\s*(.+)$/i.exec(u);
|
|
561
|
+
if (m) {
|
|
562
|
+
l = m[1].split(",").map((D) => D.trim());
|
|
522
563
|
continue;
|
|
523
564
|
}
|
|
524
|
-
const
|
|
525
|
-
if (!
|
|
526
|
-
const
|
|
527
|
-
l.forEach((
|
|
528
|
-
k[
|
|
565
|
+
const p = /^(Dialogue|Comment):\s*(.+)$/i.exec(u);
|
|
566
|
+
if (!p || p[1].toLowerCase() === "comment" || l.length === 0) continue;
|
|
567
|
+
const c = l.length, F = p[2].split(","), M = F.slice(0, c - 1), L = F.slice(c - 1).join(","), k = {};
|
|
568
|
+
l.forEach((D, g) => {
|
|
569
|
+
k[D] = g === c - 1 ? L : M[g] ?? "";
|
|
529
570
|
});
|
|
530
|
-
const
|
|
571
|
+
const $ = Le(k.Start || ""), A = Le(k.End || ""), Z = (k.Text || "").replace(/\\N/g, `
|
|
531
572
|
`).replace(/\\n/g, `
|
|
532
573
|
`).replace(/\\h/g, " ").replace(/\{[^}]*\}/g, "");
|
|
533
|
-
n.push({ start:
|
|
574
|
+
n.push({ start: $, end: A, text: Z, style: k.Style });
|
|
534
575
|
}
|
|
535
|
-
return n.sort((s,
|
|
576
|
+
return n.sort((s, i) => s.start - i.start), {
|
|
536
577
|
format: t,
|
|
537
578
|
cues: n,
|
|
538
|
-
header:
|
|
579
|
+
header: r.join(`
|
|
539
580
|
`).trim() || void 0
|
|
540
581
|
};
|
|
541
582
|
}
|
|
542
|
-
function
|
|
583
|
+
function se(e) {
|
|
543
584
|
const t = e.trim();
|
|
544
585
|
if (!t) return 0;
|
|
545
586
|
const o = /^(\d+(?:\.\d+)?)(h|m|s|ms|f|t)$/i.exec(t);
|
|
@@ -550,7 +591,7 @@ function re(e) {
|
|
|
550
591
|
const a = t.split(":");
|
|
551
592
|
return a.length === 3 ? Number(a[0]) * 3600 + Number(a[1]) * 60 + Number(a[2]) : a.length === 2 ? Number(a[0]) * 60 + Number(a[1]) : Number(t) || 0;
|
|
552
593
|
}
|
|
553
|
-
function
|
|
594
|
+
function At(e) {
|
|
554
595
|
if (typeof DOMParser > "u")
|
|
555
596
|
throw new Error("TTML parsing requires a DOMParser environment");
|
|
556
597
|
const t = new DOMParser().parseFromString(e, "application/xml");
|
|
@@ -558,73 +599,73 @@ function Nt(e) {
|
|
|
558
599
|
throw new Error("TTML XML parse error");
|
|
559
600
|
const o = t.getElementsByTagName("p"), a = [];
|
|
560
601
|
for (let l = 0; l < o.length; l++) {
|
|
561
|
-
const n = o[l],
|
|
602
|
+
const n = o[l], r = n.getAttribute("begin") || "", s = n.getAttribute("end") || "", i = n.getAttribute("dur") || "", u = se(r);
|
|
562
603
|
let d;
|
|
563
|
-
s ? d =
|
|
564
|
-
let
|
|
565
|
-
n.childNodes.forEach((
|
|
566
|
-
if (
|
|
567
|
-
|
|
568
|
-
else if (
|
|
569
|
-
const
|
|
570
|
-
|
|
571
|
-
` :
|
|
604
|
+
s ? d = se(s) : i ? d = u + se(i) : d = u + 5;
|
|
605
|
+
let m = "";
|
|
606
|
+
n.childNodes.forEach((c) => {
|
|
607
|
+
if (c.nodeType === 3)
|
|
608
|
+
m += c.nodeValue || "";
|
|
609
|
+
else if (c.nodeType === 1) {
|
|
610
|
+
const F = c;
|
|
611
|
+
F.tagName.toLowerCase() === "br" ? m += `
|
|
612
|
+
` : m += F.textContent || "";
|
|
572
613
|
}
|
|
573
614
|
});
|
|
574
|
-
const
|
|
615
|
+
const p = m.replace(/[ \t]+/g, " ").replace(/\n /g, `
|
|
575
616
|
`).trim();
|
|
576
|
-
(
|
|
617
|
+
(p || u || d) && a.push({ start: u, end: d, text: p });
|
|
577
618
|
}
|
|
578
619
|
return a.sort((l, n) => l.start - n.start), { format: "ttml", cues: a };
|
|
579
620
|
}
|
|
580
|
-
function
|
|
581
|
-
switch (t ??
|
|
621
|
+
function Rn(e, t) {
|
|
622
|
+
switch (t ?? Ot(e)) {
|
|
582
623
|
case "lrc":
|
|
583
|
-
return
|
|
624
|
+
return qt(e);
|
|
584
625
|
case "elrc":
|
|
585
|
-
return
|
|
626
|
+
return Bt(e);
|
|
586
627
|
case "ass":
|
|
587
628
|
return Ne(e, "ass");
|
|
588
629
|
case "ssa":
|
|
589
630
|
return Ne(e, "ssa");
|
|
590
631
|
case "ttml":
|
|
591
|
-
return
|
|
632
|
+
return At(e);
|
|
592
633
|
case "vtt":
|
|
593
|
-
return
|
|
634
|
+
return Se(e, "vtt");
|
|
594
635
|
case "srt":
|
|
595
636
|
default:
|
|
596
|
-
return
|
|
637
|
+
return Se(e, "srt");
|
|
597
638
|
}
|
|
598
639
|
}
|
|
599
|
-
async function
|
|
600
|
-
return
|
|
640
|
+
async function zn(e) {
|
|
641
|
+
return _t.loadAsync(e);
|
|
601
642
|
}
|
|
602
|
-
function
|
|
643
|
+
function Mn(e) {
|
|
603
644
|
const t = [];
|
|
604
645
|
return e.forEach((o, a) => {
|
|
605
646
|
var l;
|
|
606
|
-
const n = a.dir,
|
|
647
|
+
const n = a.dir, r = n && !o.endsWith("/") ? o + "/" : o, s = n ? r.replace(/\/$/, "") : r, i = s.lastIndexOf("/"), u = i >= 0 ? s.slice(i + 1) : s, d = i >= 0 ? s.slice(0, i) : "", m = n ? 0 : ((l = a._data) == null ? void 0 : l.uncompressedSize) ?? 0;
|
|
607
648
|
t.push({
|
|
608
|
-
path:
|
|
649
|
+
path: r,
|
|
609
650
|
name: u,
|
|
610
651
|
dir: d,
|
|
611
652
|
isDir: n,
|
|
612
|
-
size:
|
|
653
|
+
size: m,
|
|
613
654
|
date: a.date
|
|
614
655
|
});
|
|
615
656
|
}), t;
|
|
616
657
|
}
|
|
617
|
-
function
|
|
658
|
+
function Tn(e) {
|
|
618
659
|
const t = { name: "", path: "", isDir: !0, children: [], size: 0 }, o = /* @__PURE__ */ new Map();
|
|
619
660
|
o.set("", t);
|
|
620
661
|
const a = (n) => {
|
|
621
662
|
if (o.has(n)) return o.get(n);
|
|
622
|
-
const
|
|
623
|
-
let s = t,
|
|
624
|
-
for (const u of
|
|
625
|
-
|
|
626
|
-
let d = o.get(
|
|
627
|
-
d || (d = { name: u, path:
|
|
663
|
+
const r = n.split("/").filter(Boolean);
|
|
664
|
+
let s = t, i = "";
|
|
665
|
+
for (const u of r) {
|
|
666
|
+
i = i ? `${i}/${u}` : u;
|
|
667
|
+
let d = o.get(i);
|
|
668
|
+
d || (d = { name: u, path: i + "/", isDir: !0, children: [], size: 0 }, s.children.push(d), o.set(i, d)), s = d;
|
|
628
669
|
}
|
|
629
670
|
return s;
|
|
630
671
|
};
|
|
@@ -642,22 +683,22 @@ function hn(e) {
|
|
|
642
683
|
}
|
|
643
684
|
const l = (n) => {
|
|
644
685
|
if (n.children) {
|
|
645
|
-
n.children.sort((
|
|
646
|
-
for (const
|
|
686
|
+
n.children.sort((r, s) => r.isDir !== s.isDir ? r.isDir ? -1 : 1 : r.name.localeCompare(s.name));
|
|
687
|
+
for (const r of n.children) l(r);
|
|
647
688
|
}
|
|
648
689
|
};
|
|
649
690
|
return l(t), t;
|
|
650
691
|
}
|
|
651
|
-
async function
|
|
692
|
+
async function En(e, t, o) {
|
|
652
693
|
const a = e.file(t);
|
|
653
694
|
if (!a) throw new Error(`ZIP entry not found: ${t}`);
|
|
654
695
|
const l = await a.async("arraybuffer");
|
|
655
696
|
return new Blob([l], o ? { type: o } : void 0);
|
|
656
697
|
}
|
|
657
|
-
function
|
|
698
|
+
function Ut(e) {
|
|
658
699
|
return e ? e.startsWith("#") ? e : e.length === 8 ? "#" + e.substring(2) : e.length === 6 ? "#" + e : "#000000" : "#000000";
|
|
659
700
|
}
|
|
660
|
-
const
|
|
701
|
+
const Ht = [
|
|
661
702
|
"FFFFFF",
|
|
662
703
|
"000000",
|
|
663
704
|
"E7E6E6",
|
|
@@ -668,7 +709,7 @@ const Wt = [
|
|
|
668
709
|
"FFC000",
|
|
669
710
|
"5B9BD5",
|
|
670
711
|
"70AD47"
|
|
671
|
-
],
|
|
712
|
+
], Zt = [
|
|
672
713
|
"000000",
|
|
673
714
|
"FFFFFF",
|
|
674
715
|
"FF0000",
|
|
@@ -734,48 +775,48 @@ const Wt = [
|
|
|
734
775
|
"333399",
|
|
735
776
|
"333333"
|
|
736
777
|
];
|
|
737
|
-
function
|
|
738
|
-
const o = parseInt(e.substring(0, 2), 16), a = parseInt(e.substring(2, 4), 16), l = parseInt(e.substring(4, 6), 16), n = (u) => t < 0 ? Math.round(u * (1 + t)) : Math.round(u + (255 - u) * t),
|
|
739
|
-
return
|
|
778
|
+
function Vt(e, t) {
|
|
779
|
+
const o = parseInt(e.substring(0, 2), 16), a = parseInt(e.substring(2, 4), 16), l = parseInt(e.substring(4, 6), 16), n = (u) => t < 0 ? Math.round(u * (1 + t)) : Math.round(u + (255 - u) * t), r = Math.min(255, Math.max(0, n(o))), s = Math.min(255, Math.max(0, n(a))), i = Math.min(255, Math.max(0, n(l)));
|
|
780
|
+
return r.toString(16).padStart(2, "0") + s.toString(16).padStart(2, "0") + i.toString(16).padStart(2, "0");
|
|
740
781
|
}
|
|
741
|
-
function
|
|
782
|
+
function Gt(e) {
|
|
742
783
|
if (e && e.type === "pattern" && e.pattern === "solid") {
|
|
743
784
|
const t = e.fgColor;
|
|
744
785
|
if (t)
|
|
745
|
-
return
|
|
786
|
+
return me(t);
|
|
746
787
|
}
|
|
747
788
|
}
|
|
748
|
-
function
|
|
789
|
+
function me(e) {
|
|
749
790
|
if (e) {
|
|
750
791
|
if ("argb" in e && typeof e.argb == "string" && e.argb)
|
|
751
|
-
return
|
|
792
|
+
return Ut(e.argb);
|
|
752
793
|
if ("theme" in e && typeof e.theme == "number") {
|
|
753
|
-
const t =
|
|
754
|
-
return "#" + (o !== 0 ?
|
|
794
|
+
const t = Ht[e.theme] || "000000", o = "tint" in e && typeof e.tint == "number" ? e.tint : 0;
|
|
795
|
+
return "#" + (o !== 0 ? Vt(t, o) : t);
|
|
755
796
|
}
|
|
756
797
|
if ("indexed" in e && typeof e.indexed == "number") {
|
|
757
|
-
const t =
|
|
798
|
+
const t = Zt[e.indexed];
|
|
758
799
|
if (t) return "#" + t;
|
|
759
800
|
}
|
|
760
801
|
}
|
|
761
802
|
}
|
|
762
|
-
function
|
|
803
|
+
function Xt(e) {
|
|
763
804
|
if (!e || !e.style) return;
|
|
764
|
-
const t =
|
|
805
|
+
const t = me(e.color) || "#000000";
|
|
765
806
|
return [e.style, t];
|
|
766
807
|
}
|
|
767
|
-
function
|
|
808
|
+
function Yt(e) {
|
|
768
809
|
const t = {};
|
|
769
810
|
let o = !1;
|
|
770
811
|
if (e.font) {
|
|
771
812
|
const l = e.font;
|
|
772
813
|
if ((l.name || l.size || l.bold || l.italic) && (o = !0, t.font = {}, l.name && (t.font.name = l.name), l.size && (t.font.size = l.size), l.bold && (t.font.bold = !0), l.italic && (t.font.italic = !0)), l.color) {
|
|
773
|
-
const n =
|
|
814
|
+
const n = me(l.color);
|
|
774
815
|
n && (o = !0, t.color = n);
|
|
775
816
|
}
|
|
776
817
|
l.underline && (o = !0, t.underline = !0), l.strike && (o = !0, t.strike = !0);
|
|
777
818
|
}
|
|
778
|
-
const a =
|
|
819
|
+
const a = Gt(e.fill);
|
|
779
820
|
if (a && (o = !0, t.bgcolor = a), e.alignment) {
|
|
780
821
|
const l = e.alignment;
|
|
781
822
|
l.horizontal && (o = !0, t.align = l.horizontal), l.vertical && (o = !0, t.valign = l.vertical), l.wrapText && (o = !0, t.textwrap = !0);
|
|
@@ -783,27 +824,27 @@ function Zt(e) {
|
|
|
783
824
|
if (e.border) {
|
|
784
825
|
const l = {};
|
|
785
826
|
let n = !1;
|
|
786
|
-
const
|
|
787
|
-
for (const s of
|
|
788
|
-
const
|
|
789
|
-
|
|
827
|
+
const r = ["top", "bottom", "left", "right"];
|
|
828
|
+
for (const s of r) {
|
|
829
|
+
const i = Xt(e.border[s]);
|
|
830
|
+
i && (l[s] = i, n = !0);
|
|
790
831
|
}
|
|
791
832
|
n && (o = !0, t.border = l);
|
|
792
833
|
}
|
|
793
834
|
return o ? t : null;
|
|
794
835
|
}
|
|
795
|
-
function
|
|
836
|
+
function Kt(e) {
|
|
796
837
|
return JSON.stringify(e);
|
|
797
838
|
}
|
|
798
|
-
function
|
|
799
|
-
const a =
|
|
839
|
+
function Jt(e, t, o) {
|
|
840
|
+
const a = Yt(e);
|
|
800
841
|
if (!a) return -1;
|
|
801
|
-
const l =
|
|
842
|
+
const l = Kt(a), n = o.get(l);
|
|
802
843
|
if (n !== void 0) return n;
|
|
803
|
-
const
|
|
804
|
-
return t.push(a), o.set(l,
|
|
844
|
+
const r = t.length;
|
|
845
|
+
return t.push(a), o.set(l, r), r;
|
|
805
846
|
}
|
|
806
|
-
function
|
|
847
|
+
function Qt(e) {
|
|
807
848
|
const t = e.value;
|
|
808
849
|
if (t == null) return "";
|
|
809
850
|
if (typeof t == "string") return t;
|
|
@@ -817,8 +858,8 @@ function Vt(e) {
|
|
|
817
858
|
}
|
|
818
859
|
return typeof t == "object" && "richText" in t ? t.richText.map((o) => o.text).join("") : typeof t == "object" && "hyperlink" in t ? t.text || "" : typeof t == "object" && "error" in t ? String(t.error) : String(t);
|
|
819
860
|
}
|
|
820
|
-
function
|
|
821
|
-
const t = e.split(":"), o =
|
|
861
|
+
function eo(e) {
|
|
862
|
+
const t = e.split(":"), o = De(t[0]), a = t[1] ? De(t[1]) : o;
|
|
822
863
|
return {
|
|
823
864
|
top: o.row,
|
|
824
865
|
left: o.col,
|
|
@@ -826,7 +867,7 @@ function Gt(e) {
|
|
|
826
867
|
right: a.col
|
|
827
868
|
};
|
|
828
869
|
}
|
|
829
|
-
function
|
|
870
|
+
function De(e) {
|
|
830
871
|
const t = e.match(/^([A-Z]+)(\d+)$/);
|
|
831
872
|
if (!t) return { row: 1, col: 1 };
|
|
832
873
|
const o = t[1], a = parseInt(t[2], 10);
|
|
@@ -835,69 +876,69 @@ function je(e) {
|
|
|
835
876
|
l = l * 26 + (o.charCodeAt(n) - 64);
|
|
836
877
|
return { row: a, col: l };
|
|
837
878
|
}
|
|
838
|
-
function
|
|
879
|
+
function Pn(e) {
|
|
839
880
|
const t = [];
|
|
840
881
|
return e.eachSheet((o) => {
|
|
841
|
-
const a = [], l = /* @__PURE__ */ new Map(), n = [],
|
|
842
|
-
for (let
|
|
843
|
-
const
|
|
844
|
-
|
|
882
|
+
const a = [], l = /* @__PURE__ */ new Map(), n = [], r = {}, s = {}, i = o.columnCount;
|
|
883
|
+
for (let p = 1; p <= i; p++) {
|
|
884
|
+
const c = o.getColumn(p);
|
|
885
|
+
c.width && (s[String(p - 1)] = { width: Math.round(c.width * 7.5) });
|
|
845
886
|
}
|
|
846
|
-
s.len = Math.max(
|
|
847
|
-
const u = /* @__PURE__ */ new Map(), d = o.model,
|
|
848
|
-
for (const
|
|
849
|
-
n.push(
|
|
850
|
-
const { top:
|
|
851
|
-
u.set(`${
|
|
887
|
+
s.len = Math.max(i, 26);
|
|
888
|
+
const u = /* @__PURE__ */ new Map(), d = o.model, m = (d == null ? void 0 : d.merges) || [];
|
|
889
|
+
for (const p of m) {
|
|
890
|
+
n.push(p);
|
|
891
|
+
const { top: c, left: F, bottom: M, right: L } = eo(p), k = M - c, $ = L - F;
|
|
892
|
+
u.set(`${c - 1},${F - 1}`, [k, $]);
|
|
852
893
|
}
|
|
853
|
-
o.eachRow({ includeEmpty: !0 }, (
|
|
854
|
-
const
|
|
855
|
-
|
|
856
|
-
const
|
|
894
|
+
o.eachRow({ includeEmpty: !0 }, (p, c) => {
|
|
895
|
+
const F = c - 1, M = {};
|
|
896
|
+
p.eachCell({ includeEmpty: !1 }, (k, $) => {
|
|
897
|
+
const A = $ - 1;
|
|
857
898
|
if (k.isMerged && k.master !== k) return;
|
|
858
|
-
const
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
u.has(
|
|
899
|
+
const Z = Qt(k), D = Jt(k, a, l), g = { text: Z };
|
|
900
|
+
D !== -1 && (g.style = D);
|
|
901
|
+
const T = `${F},${A}`;
|
|
902
|
+
u.has(T) && (g.merge = u.get(T)), M[String(A)] = g;
|
|
862
903
|
});
|
|
863
|
-
const
|
|
864
|
-
|
|
904
|
+
const L = { cells: M };
|
|
905
|
+
p.height && (L.height = Math.round(p.height * 1.333)), r[String(F)] = L;
|
|
865
906
|
}), t.push({
|
|
866
907
|
name: o.name,
|
|
867
908
|
styles: a,
|
|
868
909
|
merges: n,
|
|
869
|
-
rows:
|
|
910
|
+
rows: r,
|
|
870
911
|
cols: s
|
|
871
912
|
});
|
|
872
913
|
}), t;
|
|
873
914
|
}
|
|
874
|
-
function
|
|
915
|
+
function $n(e, t, o = "Sheet1") {
|
|
875
916
|
const a = e.length > 0, l = a ? [{ font: { bold: !0 } }] : [], n = {};
|
|
876
917
|
if (a) {
|
|
877
918
|
const s = {};
|
|
878
|
-
e.forEach((
|
|
879
|
-
s[String(u)] = { text:
|
|
919
|
+
e.forEach((i, u) => {
|
|
920
|
+
s[String(u)] = { text: i, style: 0 };
|
|
880
921
|
}), n[0] = { cells: s };
|
|
881
922
|
}
|
|
882
|
-
const
|
|
883
|
-
return t.forEach((s,
|
|
923
|
+
const r = a ? 1 : 0;
|
|
924
|
+
return t.forEach((s, i) => {
|
|
884
925
|
const u = {};
|
|
885
|
-
s.forEach((d,
|
|
886
|
-
d !== void 0 && d !== "" && (u[String(
|
|
887
|
-
}), n[String(
|
|
926
|
+
s.forEach((d, m) => {
|
|
927
|
+
d !== void 0 && d !== "" && (u[String(m)] = { text: d });
|
|
928
|
+
}), n[String(i + r)] = { cells: u };
|
|
888
929
|
}), [{ name: o, styles: l, rows: n }];
|
|
889
930
|
}
|
|
890
|
-
function
|
|
931
|
+
function jn(e, t) {
|
|
891
932
|
var o;
|
|
892
933
|
if (typeof window > "u") return;
|
|
893
934
|
const a = (e == null ? void 0 : e.version) || ((o = e == null ? void 0 : e.GlobalWorkerOptions) == null ? void 0 : o.version) || "", {
|
|
894
935
|
workerSrc: l = `https://unpkg.com/pdfjs-dist@${a}/build/pdf.worker.min.mjs`,
|
|
895
936
|
cMapUrl: n = `https://unpkg.com/pdfjs-dist@${a}/cmaps/`,
|
|
896
|
-
cMapPacked:
|
|
937
|
+
cMapPacked: r = !0
|
|
897
938
|
} = t || {};
|
|
898
|
-
e.GlobalWorkerOptions && (e.GlobalWorkerOptions.workerSrc = l, e.GlobalWorkerOptions.cMapUrl = n, e.GlobalWorkerOptions.cMapPacked =
|
|
939
|
+
e.GlobalWorkerOptions && (e.GlobalWorkerOptions.workerSrc = l, e.GlobalWorkerOptions.cMapUrl = n, e.GlobalWorkerOptions.cMapPacked = r);
|
|
899
940
|
}
|
|
900
|
-
const
|
|
941
|
+
const to = {
|
|
901
942
|
// ─────── common ───────
|
|
902
943
|
"common.download": "下载",
|
|
903
944
|
"common.close": "关闭",
|
|
@@ -996,7 +1037,7 @@ const Ht = {
|
|
|
996
1037
|
"zip.parse_failed": "ZIP 解析失败",
|
|
997
1038
|
// ─────── text ───────
|
|
998
1039
|
"text.load_failed": "文本文件加载失败"
|
|
999
|
-
},
|
|
1040
|
+
}, oo = {
|
|
1000
1041
|
// ─────── common ───────
|
|
1001
1042
|
"common.download": "Download",
|
|
1002
1043
|
"common.close": "Close",
|
|
@@ -1095,51 +1136,115 @@ const Ht = {
|
|
|
1095
1136
|
"zip.parse_failed": "Failed to parse ZIP",
|
|
1096
1137
|
// ─────── text ───────
|
|
1097
1138
|
"text.load_failed": "Failed to load text file"
|
|
1098
|
-
},
|
|
1099
|
-
"zh-CN":
|
|
1100
|
-
"en-US":
|
|
1101
|
-
},
|
|
1102
|
-
function
|
|
1103
|
-
return t ? e.replace(
|
|
1139
|
+
}, ne = {
|
|
1140
|
+
"zh-CN": to,
|
|
1141
|
+
"en-US": oo
|
|
1142
|
+
}, no = /\{(\w+)\}/g;
|
|
1143
|
+
function ao(e, t) {
|
|
1144
|
+
return t ? e.replace(no, (o, a) => {
|
|
1104
1145
|
const l = t[a];
|
|
1105
1146
|
return l === void 0 ? `{${a}}` : String(l);
|
|
1106
1147
|
}) : e;
|
|
1107
1148
|
}
|
|
1108
|
-
function
|
|
1149
|
+
function Ye(e) {
|
|
1109
1150
|
var t;
|
|
1110
|
-
const o = e.fallbackLocale ?? "zh-CN", a =
|
|
1111
|
-
return (s,
|
|
1112
|
-
const u = n[s] ??
|
|
1113
|
-
return
|
|
1151
|
+
const o = e.fallbackLocale ?? "zh-CN", a = ne[e.locale] ?? ne[o] ?? ne["zh-CN"], l = (t = e.messages) == null ? void 0 : t[e.locale], n = l ? { ...a, ...l } : a, r = ne["zh-CN"];
|
|
1152
|
+
return (s, i) => {
|
|
1153
|
+
const u = n[s] ?? r[s] ?? s;
|
|
1154
|
+
return ao(u, i);
|
|
1114
1155
|
};
|
|
1115
1156
|
}
|
|
1116
|
-
const
|
|
1117
|
-
function
|
|
1118
|
-
const o =
|
|
1119
|
-
() =>
|
|
1157
|
+
const Ke = Symbol("file-preview-locale");
|
|
1158
|
+
function lo(e, t) {
|
|
1159
|
+
const o = z(() => v(e) ?? "zh-CN"), a = z(
|
|
1160
|
+
() => Ye({ locale: o.value, messages: v(t) })
|
|
1120
1161
|
);
|
|
1121
|
-
|
|
1162
|
+
ae(Ke, { locale: o, t: a });
|
|
1122
1163
|
}
|
|
1123
|
-
let
|
|
1124
|
-
function
|
|
1125
|
-
return
|
|
1164
|
+
let ue = null;
|
|
1165
|
+
function ro() {
|
|
1166
|
+
return ue || (ue = Ye({ locale: "zh-CN" })), ue;
|
|
1126
1167
|
}
|
|
1127
|
-
function
|
|
1128
|
-
const e =
|
|
1168
|
+
function ve() {
|
|
1169
|
+
const e = ce(Ke, null);
|
|
1129
1170
|
if (e) return e;
|
|
1130
|
-
const t =
|
|
1171
|
+
const t = z(() => "zh-CN"), o = z(() => ro());
|
|
1131
1172
|
return { locale: t, t: o };
|
|
1132
1173
|
}
|
|
1133
1174
|
const Je = Symbol("vfp-resolved-theme");
|
|
1134
|
-
function
|
|
1135
|
-
const t =
|
|
1136
|
-
|
|
1175
|
+
function io(e) {
|
|
1176
|
+
const t = z(() => v(e));
|
|
1177
|
+
ae(Je, t);
|
|
1178
|
+
}
|
|
1179
|
+
function Sn() {
|
|
1180
|
+
const e = ce(Je, null);
|
|
1181
|
+
return e || z(() => "dark");
|
|
1182
|
+
}
|
|
1183
|
+
const Qe = Symbol("file-preview:request");
|
|
1184
|
+
function so(e) {
|
|
1185
|
+
const t = z(() => {
|
|
1186
|
+
const o = typeof e == "function" ? e() : e;
|
|
1187
|
+
return {
|
|
1188
|
+
fetcher: Nt({
|
|
1189
|
+
requestInit: o.requestInit,
|
|
1190
|
+
requestHandler: o.requestHandler
|
|
1191
|
+
}),
|
|
1192
|
+
shouldFetchAsBlob: o.shouldFetchAsBlob
|
|
1193
|
+
};
|
|
1194
|
+
});
|
|
1195
|
+
return ae(Qe, t), t;
|
|
1196
|
+
}
|
|
1197
|
+
function uo() {
|
|
1198
|
+
return { fetcher: (e, t) => fetch(e, t) };
|
|
1199
|
+
}
|
|
1200
|
+
function et() {
|
|
1201
|
+
const e = ce(Qe, void 0);
|
|
1202
|
+
return e || z(() => uo());
|
|
1203
|
+
}
|
|
1204
|
+
function co() {
|
|
1205
|
+
const e = et();
|
|
1206
|
+
return z(() => e.value.fetcher);
|
|
1137
1207
|
}
|
|
1138
|
-
function
|
|
1139
|
-
const
|
|
1140
|
-
|
|
1208
|
+
function fo(e) {
|
|
1209
|
+
const t = et(), o = _("");
|
|
1210
|
+
let a = null;
|
|
1211
|
+
const l = () => {
|
|
1212
|
+
a && (URL.revokeObjectURL(a), a = null);
|
|
1213
|
+
};
|
|
1214
|
+
return q(
|
|
1215
|
+
() => {
|
|
1216
|
+
var s, i;
|
|
1217
|
+
const n = e.value, r = !!(n && ((i = (s = t.value).shouldFetchAsBlob) != null && i.call(s, n)));
|
|
1218
|
+
return { f: n, need: r, fetcher: t.value.fetcher };
|
|
1219
|
+
},
|
|
1220
|
+
async ({ f: n, need: r, fetcher: s }, i, u) => {
|
|
1221
|
+
if (!n) {
|
|
1222
|
+
l(), o.value = "";
|
|
1223
|
+
return;
|
|
1224
|
+
}
|
|
1225
|
+
if (!r) {
|
|
1226
|
+
l(), o.value = n.url;
|
|
1227
|
+
return;
|
|
1228
|
+
}
|
|
1229
|
+
let d = !1;
|
|
1230
|
+
u(() => {
|
|
1231
|
+
d = !0;
|
|
1232
|
+
}), o.value = "";
|
|
1233
|
+
try {
|
|
1234
|
+
const m = await Dt(n.url, s);
|
|
1235
|
+
if (d) {
|
|
1236
|
+
URL.revokeObjectURL(m);
|
|
1237
|
+
return;
|
|
1238
|
+
}
|
|
1239
|
+
l(), a = m, o.value = m;
|
|
1240
|
+
} catch (m) {
|
|
1241
|
+
d || (console.error("[file-preview] resolve blob url failed:", m), o.value = n.url);
|
|
1242
|
+
}
|
|
1243
|
+
},
|
|
1244
|
+
{ immediate: !0 }
|
|
1245
|
+
), G(l), o;
|
|
1141
1246
|
}
|
|
1142
|
-
const
|
|
1247
|
+
const po = (e, { attrs: t }) => B("svg", {
|
|
1143
1248
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1144
1249
|
viewBox: "0 0 24 24",
|
|
1145
1250
|
fill: "none",
|
|
@@ -1149,7 +1254,7 @@ const Qt = (e, { attrs: t }) => O("svg", {
|
|
|
1149
1254
|
"stroke-linejoin": "round",
|
|
1150
1255
|
...t
|
|
1151
1256
|
}, [
|
|
1152
|
-
|
|
1257
|
+
B("text", {
|
|
1153
1258
|
x: "12",
|
|
1154
1259
|
y: "17.5",
|
|
1155
1260
|
"text-anchor": "middle",
|
|
@@ -1159,51 +1264,51 @@ const Qt = (e, { attrs: t }) => O("svg", {
|
|
|
1159
1264
|
stroke: "none"
|
|
1160
1265
|
}, "1:1")
|
|
1161
1266
|
]);
|
|
1162
|
-
function
|
|
1267
|
+
function mo(e) {
|
|
1163
1268
|
return [
|
|
1164
1269
|
{
|
|
1165
1270
|
items: [
|
|
1166
|
-
{ type: "button", icon:
|
|
1271
|
+
{ type: "button", icon: Oe, tooltip: e.t("toolbar.zoom_out"), action: e.onZoomOut, disabled: e.zoom <= 0.01 },
|
|
1167
1272
|
{ type: "text", content: `${Math.round(e.zoom * 100)}%`, minWidth: "3rem" },
|
|
1168
|
-
{ type: "button", icon:
|
|
1273
|
+
{ type: "button", icon: qe, tooltip: e.t("toolbar.zoom_in"), action: e.onZoomIn, disabled: e.zoom >= 10 }
|
|
1169
1274
|
]
|
|
1170
1275
|
},
|
|
1171
1276
|
{
|
|
1172
1277
|
items: [
|
|
1173
|
-
{ type: "button", icon:
|
|
1174
|
-
{ type: "button", icon:
|
|
1278
|
+
{ type: "button", icon: wt, tooltip: e.t("toolbar.fit_to_window"), action: e.onFitToWidth },
|
|
1279
|
+
{ type: "button", icon: po, tooltip: e.t("toolbar.original_size"), action: e.onOriginalSize }
|
|
1175
1280
|
]
|
|
1176
1281
|
},
|
|
1177
1282
|
{
|
|
1178
1283
|
items: [
|
|
1179
|
-
{ type: "button", icon:
|
|
1180
|
-
{ type: "button", icon:
|
|
1284
|
+
{ type: "button", icon: yt, tooltip: e.t("toolbar.rotate_left"), action: e.onRotateLeft },
|
|
1285
|
+
{ type: "button", icon: xt, tooltip: e.t("toolbar.rotate_right"), action: e.onRotateRight }
|
|
1181
1286
|
]
|
|
1182
1287
|
},
|
|
1183
1288
|
{
|
|
1184
1289
|
items: [
|
|
1185
|
-
{ type: "button", icon:
|
|
1290
|
+
{ type: "button", icon: Be, tooltip: e.t("toolbar.reset"), action: e.onReset }
|
|
1186
1291
|
]
|
|
1187
1292
|
}
|
|
1188
1293
|
];
|
|
1189
1294
|
}
|
|
1190
|
-
function
|
|
1295
|
+
function vo(e) {
|
|
1191
1296
|
return [
|
|
1192
1297
|
{
|
|
1193
1298
|
items: [
|
|
1194
|
-
{ type: "button", icon:
|
|
1299
|
+
{ type: "button", icon: Oe, tooltip: e.t("toolbar.zoom_out"), action: e.onZoomOut, disabled: e.zoom <= 0.01 },
|
|
1195
1300
|
{ type: "text", content: `${Math.round(e.zoom * 100)}%`, minWidth: "3rem" },
|
|
1196
|
-
{ type: "button", icon:
|
|
1301
|
+
{ type: "button", icon: qe, tooltip: e.t("toolbar.zoom_in"), action: e.onZoomIn, disabled: e.zoom >= 10 }
|
|
1197
1302
|
]
|
|
1198
1303
|
},
|
|
1199
1304
|
{
|
|
1200
1305
|
items: [
|
|
1201
|
-
{ type: "button", icon:
|
|
1306
|
+
{ type: "button", icon: Be, tooltip: e.t("toolbar.reset"), action: e.onReset }
|
|
1202
1307
|
]
|
|
1203
1308
|
}
|
|
1204
1309
|
];
|
|
1205
1310
|
}
|
|
1206
|
-
function
|
|
1311
|
+
function ho(e) {
|
|
1207
1312
|
return [
|
|
1208
1313
|
{
|
|
1209
1314
|
items: [
|
|
@@ -1215,7 +1320,7 @@ function oo(e) {
|
|
|
1215
1320
|
},
|
|
1216
1321
|
{
|
|
1217
1322
|
items: [
|
|
1218
|
-
{ type: "button", icon:
|
|
1323
|
+
{ type: "button", icon: fe, tooltip: e.t("toolbar.prev_page"), action: () => {
|
|
1219
1324
|
var t;
|
|
1220
1325
|
return (t = e.epubRef) == null ? void 0 : t.prevPage();
|
|
1221
1326
|
} },
|
|
@@ -1230,7 +1335,7 @@ function oo(e) {
|
|
|
1230
1335
|
items: [
|
|
1231
1336
|
{
|
|
1232
1337
|
type: "button",
|
|
1233
|
-
icon: e.fullWidth ?
|
|
1338
|
+
icon: e.fullWidth ? Ue : He,
|
|
1234
1339
|
tooltip: e.fullWidth ? e.t("toolbar.normal_width") : e.t("toolbar.full_width"),
|
|
1235
1340
|
action: () => {
|
|
1236
1341
|
var t;
|
|
@@ -1241,7 +1346,7 @@ function oo(e) {
|
|
|
1241
1346
|
}
|
|
1242
1347
|
];
|
|
1243
1348
|
}
|
|
1244
|
-
function
|
|
1349
|
+
function go(e) {
|
|
1245
1350
|
return [
|
|
1246
1351
|
{
|
|
1247
1352
|
items: [
|
|
@@ -1253,7 +1358,7 @@ function no(e) {
|
|
|
1253
1358
|
},
|
|
1254
1359
|
{
|
|
1255
1360
|
items: [
|
|
1256
|
-
{ type: "button", icon:
|
|
1361
|
+
{ type: "button", icon: fe, tooltip: e.t("toolbar.prev_page"), action: () => {
|
|
1257
1362
|
var t;
|
|
1258
1363
|
return (t = e.mobiRef) == null ? void 0 : t.prevPage();
|
|
1259
1364
|
} },
|
|
@@ -1268,7 +1373,7 @@ function no(e) {
|
|
|
1268
1373
|
items: [
|
|
1269
1374
|
{
|
|
1270
1375
|
type: "button",
|
|
1271
|
-
icon: e.fullWidth ?
|
|
1376
|
+
icon: e.fullWidth ? Ue : He,
|
|
1272
1377
|
tooltip: e.fullWidth ? e.t("toolbar.normal_width") : e.t("toolbar.full_width"),
|
|
1273
1378
|
action: () => {
|
|
1274
1379
|
var t;
|
|
@@ -1279,26 +1384,26 @@ function no(e) {
|
|
|
1279
1384
|
}
|
|
1280
1385
|
];
|
|
1281
1386
|
}
|
|
1282
|
-
function
|
|
1387
|
+
function bo({ stats: e }) {
|
|
1283
1388
|
return e ? [
|
|
1284
1389
|
{
|
|
1285
1390
|
items: [
|
|
1286
1391
|
{
|
|
1287
1392
|
type: "text",
|
|
1288
|
-
content: `${e.files} files · ${e.dirs} dirs · ${
|
|
1393
|
+
content: `${e.files} files · ${e.dirs} dirs · ${$t(e.size)}`,
|
|
1289
1394
|
minWidth: "10rem"
|
|
1290
1395
|
}
|
|
1291
1396
|
]
|
|
1292
1397
|
}
|
|
1293
1398
|
] : [];
|
|
1294
1399
|
}
|
|
1295
|
-
function
|
|
1400
|
+
function wo(e) {
|
|
1296
1401
|
const t = [
|
|
1297
1402
|
{
|
|
1298
1403
|
items: [
|
|
1299
1404
|
{
|
|
1300
1405
|
type: "button",
|
|
1301
|
-
icon:
|
|
1406
|
+
icon: B(Ft, { class: "vfp-w-4 vfp-h-4" }),
|
|
1302
1407
|
tooltip: e.wordWrap ? e.t("toolbar.wrap_off") : e.t("toolbar.wrap_on"),
|
|
1303
1408
|
action: e.onToggleWrap
|
|
1304
1409
|
}
|
|
@@ -1309,20 +1414,20 @@ function lo(e) {
|
|
|
1309
1414
|
items: [
|
|
1310
1415
|
{
|
|
1311
1416
|
type: "button",
|
|
1312
|
-
icon: e.htmlPreview ?
|
|
1417
|
+
icon: e.htmlPreview ? B(Ze, { class: "vfp-w-4 vfp-h-4" }) : B(Ve, { class: "vfp-w-4 vfp-h-4" }),
|
|
1313
1418
|
tooltip: e.htmlPreview ? e.t("toolbar.source") : e.t("toolbar.preview"),
|
|
1314
1419
|
action: e.onToggleHtmlPreview
|
|
1315
1420
|
}
|
|
1316
1421
|
]
|
|
1317
1422
|
}), t;
|
|
1318
1423
|
}
|
|
1319
|
-
function
|
|
1424
|
+
function yo(e) {
|
|
1320
1425
|
return [
|
|
1321
1426
|
{
|
|
1322
1427
|
items: [
|
|
1323
1428
|
{
|
|
1324
1429
|
type: "button",
|
|
1325
|
-
icon: e.viewMode === "preview" ?
|
|
1430
|
+
icon: e.viewMode === "preview" ? B(Ze, { class: "vfp-w-4 vfp-h-4" }) : B(Ve, { class: "vfp-w-4 vfp-h-4" }),
|
|
1326
1431
|
tooltip: e.viewMode === "preview" ? e.t("toolbar.source") : e.t("toolbar.preview"),
|
|
1327
1432
|
action: e.onToggleViewMode
|
|
1328
1433
|
}
|
|
@@ -1330,22 +1435,22 @@ function ro(e) {
|
|
|
1330
1435
|
}
|
|
1331
1436
|
];
|
|
1332
1437
|
}
|
|
1333
|
-
const
|
|
1438
|
+
const xo = { class: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp-h-full rfp-text-fg-muted" }, Fo = { class: "rfp-flex rfp-flex-col rfp-items-center rfp-gap-3" }, ko = { class: "rfp-text-sm" }, Co = /* @__PURE__ */ X({
|
|
1334
1439
|
__name: "RendererLoading",
|
|
1335
1440
|
setup(e) {
|
|
1336
|
-
const { t } =
|
|
1337
|
-
return (o, a) => (
|
|
1338
|
-
|
|
1339
|
-
a[0] || (a[0] =
|
|
1340
|
-
|
|
1441
|
+
const { t } = ve();
|
|
1442
|
+
return (o, a) => (f(), b("div", xo, [
|
|
1443
|
+
P("div", Fo, [
|
|
1444
|
+
a[0] || (a[0] = P("div", { class: "rfp-w-8 rfp-h-8 rfp-rounded-full rfp-border-2 rfp-border-fg-muted rfp-border-t-transparent rfp-animate-spin" }, null, -1)),
|
|
1445
|
+
P("span", ko, I(v(t)("common.loading") || "Loading..."), 1)
|
|
1341
1446
|
])
|
|
1342
1447
|
]));
|
|
1343
1448
|
}
|
|
1344
|
-
}),
|
|
1449
|
+
}), j = (e) => pt({
|
|
1345
1450
|
loader: e,
|
|
1346
|
-
loadingComponent: { render: () =>
|
|
1451
|
+
loadingComponent: { render: () => B(Co) },
|
|
1347
1452
|
delay: 0
|
|
1348
|
-
}),
|
|
1453
|
+
}), _o = j(() => import("./index-H-QlBdbJ.mjs")), Ro = j(() => import("./index-oQRFKvtz.mjs")), zo = j(() => import("./index-DFEd3JaR.mjs")), Mo = j(() => import("./index-BP_8GjEV.mjs")), To = j(() => import("./index-1khRVlUa.mjs")), Eo = j(() => import("./index-DEyjEp-i.mjs")), Po = j(() => import("./index-CYvPRxHK.mjs")), $o = j(() => import("./index-_llF_WTY.mjs")), jo = j(() => import("./index-B9Xz5bUB.mjs")), So = j(() => import("./index-Cfm88ItA.mjs")), Lo = j(() => import("./index-BVdw1Cc8.mjs")), No = j(() => import("./index-CxKVonec.mjs")), Do = j(() => import("./index-D6RuC1es.mjs")), Wo = j(() => import("./index-BqSPk90T.mjs")), Io = j(() => import("./index-BrCSk7CK.mjs")), Oo = j(() => import("./index-DjvWRo53.mjs")), qo = j(() => import("./index-Bu8GH1aq.mjs")), Bo = { class: "vfp-flex vfp-flex-col vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-p-8 vfp-gap-6" }, Ao = { class: "vfp-w-32 vfp-h-32 vfp-rounded-full vfp-bg-surface-2 vfp-flex vfp-items-center vfp-justify-center" }, Uo = { class: "vfp-text-fg-primary vfp-text-center" }, Ho = { class: "vfp-text-xl vfp-font-medium vfp-mb-2" }, Zo = { class: "vfp-text-fg-secondary" }, We = /* @__PURE__ */ X({
|
|
1349
1454
|
__name: "index",
|
|
1350
1455
|
props: {
|
|
1351
1456
|
fileName: {},
|
|
@@ -1353,35 +1458,35 @@ const io = { class: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp
|
|
|
1353
1458
|
},
|
|
1354
1459
|
emits: ["download"],
|
|
1355
1460
|
setup(e, { emit: t }) {
|
|
1356
|
-
const { t: o } =
|
|
1357
|
-
return (l, n) => (
|
|
1358
|
-
|
|
1359
|
-
|
|
1461
|
+
const { t: o } = ve(), a = t;
|
|
1462
|
+
return (l, n) => (f(), b("div", Bo, [
|
|
1463
|
+
P("div", Ao, [
|
|
1464
|
+
H(v(kt), { class: "vfp-w-16 vfp-h-16 vfp-text-fg-secondary" })
|
|
1360
1465
|
]),
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1466
|
+
P("div", Uo, [
|
|
1467
|
+
P("p", Ho, I(e.fileName), 1),
|
|
1468
|
+
P("p", Zo, I(v(o)("common.unsupported_preview", { type: e.fileType })), 1)
|
|
1364
1469
|
]),
|
|
1365
|
-
|
|
1470
|
+
P("button", {
|
|
1366
1471
|
class: "vfp-flex vfp-items-center vfp-gap-2 vfp-px-6 vfp-py-3 vfp-bg-surface-2 hover:vfp-bg-surface-3 vfp-backdrop-blur-sm vfp-rounded-lg vfp-text-fg-primary vfp-font-medium vfp-transition-all",
|
|
1367
|
-
onClick: n[0] || (n[0] = (
|
|
1472
|
+
onClick: n[0] || (n[0] = (r) => a("download"))
|
|
1368
1473
|
}, [
|
|
1369
|
-
|
|
1370
|
-
|
|
1474
|
+
H(v(Ge), { class: "vfp-w-5 vfp-h-5" }),
|
|
1475
|
+
mt(" " + I(v(o)("common.download")), 1)
|
|
1371
1476
|
])
|
|
1372
1477
|
]));
|
|
1373
1478
|
}
|
|
1374
|
-
}),
|
|
1479
|
+
}), Vo = ["tabindex", "data-theme"], Go = {
|
|
1375
1480
|
key: 0,
|
|
1376
1481
|
class: "vfp-flex-shrink-0 vfp-z-10 vfp-backdrop-blur-md vfp-border-b vfp-bg-surface-toolbar vfp-border-line",
|
|
1377
1482
|
style: { "padding-top": "env(safe-area-inset-top, 0px)" }
|
|
1378
|
-
},
|
|
1483
|
+
}, Xo = { class: "vfp-flex vfp-items-center vfp-justify-between vfp-px-3 md:vfp-px-5 vfp-py-1.5 md:vfp-py-2.5" }, Yo = { class: "vfp-flex vfp-items-center vfp-flex-1 vfp-min-w-0 vfp-mr-2 md:vfp-mr-3" }, Ko = { class: "vfp-font-medium vfp-text-xs md:vfp-text-sm vfp-truncate vfp-text-fg-primary" }, Jo = { class: "vfp-text-xs vfp-ml-2 vfp-flex-shrink-0 vfp-text-fg-muted" }, Qo = { class: "vfp-flex vfp-items-center vfp-gap-1 md:vfp-hidden vfp-flex-shrink-0" }, en = ["data-tooltip", "disabled", "onClick"], tn = { class: "vfp-hidden md:vfp-flex vfp-items-center vfp-gap-1 vfp-flex-shrink-0" }, on = ["data-tooltip", "disabled", "onClick"], nn = ["data-tooltip", "disabled", "onClick"], an = {
|
|
1379
1484
|
key: 0,
|
|
1380
1485
|
class: "vfp-flex vfp-items-center vfp-gap-1 vfp-px-3 vfp-pb-1.5 vfp-overflow-x-auto scrollbar-hide md:vfp-hidden"
|
|
1381
|
-
},
|
|
1486
|
+
}, ln = {
|
|
1382
1487
|
key: 0,
|
|
1383
1488
|
class: "vfp-w-px vfp-h-4 vfp-mx-0.5 vfp-bg-divide"
|
|
1384
|
-
},
|
|
1489
|
+
}, rn = ["data-tooltip", "disabled", "onClick"], sn = 3, un = 2e3, dn = /* @__PURE__ */ X({
|
|
1385
1490
|
__name: "FilePreviewContent",
|
|
1386
1491
|
props: {
|
|
1387
1492
|
files: {},
|
|
@@ -1392,400 +1497,418 @@ const io = { class: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp
|
|
|
1392
1497
|
locale: { default: void 0 },
|
|
1393
1498
|
messages: { default: void 0 },
|
|
1394
1499
|
headless: { type: Boolean, default: !1 },
|
|
1395
|
-
theme: { default: "dark" }
|
|
1500
|
+
theme: { default: "dark" },
|
|
1501
|
+
requestInit: { type: Function, default: void 0 },
|
|
1502
|
+
requestHandler: { type: Function, default: void 0 },
|
|
1503
|
+
shouldFetchAsBlob: { type: Function, default: void 0 },
|
|
1504
|
+
onDownload: { type: Function, default: void 0 }
|
|
1396
1505
|
},
|
|
1397
1506
|
emits: ["navigate", "close", "custom-event"],
|
|
1398
1507
|
setup(e, { emit: t }) {
|
|
1399
|
-
const o = e
|
|
1400
|
-
|
|
1401
|
-
|
|
1508
|
+
const o = e;
|
|
1509
|
+
so(() => ({
|
|
1510
|
+
requestInit: o.requestInit,
|
|
1511
|
+
requestHandler: o.requestHandler,
|
|
1512
|
+
shouldFetchAsBlob: o.shouldFetchAsBlob
|
|
1513
|
+
}));
|
|
1514
|
+
const a = t;
|
|
1515
|
+
lo(Pe(o, "locale"), Pe(o, "messages"));
|
|
1516
|
+
const { t: l } = ve(), n = _(
|
|
1402
1517
|
typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
1403
1518
|
);
|
|
1404
|
-
let
|
|
1405
|
-
|
|
1519
|
+
let r = null;
|
|
1520
|
+
q(
|
|
1406
1521
|
() => o.theme,
|
|
1407
|
-
(
|
|
1408
|
-
if (
|
|
1409
|
-
const h = window.matchMedia("(prefers-color-scheme: dark)"),
|
|
1522
|
+
(y) => {
|
|
1523
|
+
if (r && (r(), r = null), y === "auto") {
|
|
1524
|
+
const h = window.matchMedia("(prefers-color-scheme: dark)"), N = (w) => {
|
|
1410
1525
|
n.value = w.matches;
|
|
1411
1526
|
};
|
|
1412
|
-
h.addEventListener("change",
|
|
1527
|
+
h.addEventListener("change", N), r = () => h.removeEventListener("change", N);
|
|
1413
1528
|
}
|
|
1414
1529
|
},
|
|
1415
1530
|
{ immediate: !0 }
|
|
1416
|
-
),
|
|
1417
|
-
|
|
1531
|
+
), G(() => {
|
|
1532
|
+
r && r();
|
|
1418
1533
|
});
|
|
1419
|
-
const s =
|
|
1534
|
+
const s = z(
|
|
1420
1535
|
() => o.theme === "auto" ? n.value ? "dark" : "light" : o.theme
|
|
1421
1536
|
);
|
|
1422
|
-
|
|
1423
|
-
const
|
|
1424
|
-
let
|
|
1425
|
-
const
|
|
1426
|
-
k.value = !0,
|
|
1537
|
+
io(s);
|
|
1538
|
+
const i = _(1), u = _(0), d = _(1), m = _(1), p = _(0), c = _(0), F = _(0), M = _(null), L = _(null), k = _(!0);
|
|
1539
|
+
let $ = null;
|
|
1540
|
+
const A = () => {
|
|
1541
|
+
k.value = !0, $ !== null && clearTimeout($), $ = window.setTimeout(() => {
|
|
1427
1542
|
k.value = !1;
|
|
1428
|
-
},
|
|
1429
|
-
},
|
|
1430
|
-
if (!
|
|
1431
|
-
const
|
|
1432
|
-
a("custom-event",
|
|
1433
|
-
},
|
|
1434
|
-
emit:
|
|
1543
|
+
}, un);
|
|
1544
|
+
}, Z = () => A(), D = z(() => Et(o.files)), g = z(() => D.value[o.currentIndex]), T = fo(g), Y = z(() => g.value && o.customRenderers.find((y) => y.test(g.value)) || null), ge = z(() => !Y.value || !g.value ? null : Y.value.render(g.value, K.value)), C = z(() => g.value ? Pt(g.value) : "unsupported"), tt = (y, h) => {
|
|
1545
|
+
if (!g.value) return;
|
|
1546
|
+
const N = { name: y, payload: h, file: g.value };
|
|
1547
|
+
a("custom-event", N);
|
|
1548
|
+
}, K = z(() => ({
|
|
1549
|
+
emit: tt,
|
|
1435
1550
|
t: l.value,
|
|
1436
1551
|
theme: s.value,
|
|
1437
1552
|
locale: o.locale ?? "zh-CN"
|
|
1438
1553
|
}));
|
|
1439
|
-
|
|
1554
|
+
ae("file-preview:custom-ctx", K), q(
|
|
1440
1555
|
() => o.currentIndex,
|
|
1441
1556
|
() => {
|
|
1442
|
-
|
|
1557
|
+
i.value = 1, u.value = 0, d.value = 1, m.value = 1, p.value = 0, c.value = 0, k.value = !0, $ !== null && clearTimeout($);
|
|
1443
1558
|
}
|
|
1444
|
-
),
|
|
1445
|
-
[
|
|
1559
|
+
), q(
|
|
1560
|
+
[C, p, c],
|
|
1446
1561
|
() => {
|
|
1447
|
-
if (
|
|
1448
|
-
const
|
|
1449
|
-
|
|
1562
|
+
if (C.value === "image" && p.value > 0 && c.value > 0 && M.value) {
|
|
1563
|
+
const y = M.value.clientWidth, h = M.value.clientHeight, N = y / p.value, w = h / c.value, S = Math.min(N, w);
|
|
1564
|
+
i.value = Math.max(0.01, Math.min(10, S));
|
|
1450
1565
|
}
|
|
1451
1566
|
}
|
|
1452
|
-
),
|
|
1453
|
-
() =>
|
|
1454
|
-
(
|
|
1455
|
-
|
|
1567
|
+
), q(
|
|
1568
|
+
() => D.value.length,
|
|
1569
|
+
(y) => {
|
|
1570
|
+
y > 1 && A();
|
|
1456
1571
|
},
|
|
1457
1572
|
{ immediate: !0 }
|
|
1458
1573
|
);
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1574
|
+
const J = (y) => {
|
|
1575
|
+
y.key === "Escape" && o.mode === "modal" ? a("close") : y.key === "ArrowLeft" && o.currentIndex > 0 ? a("navigate", o.currentIndex - 1) : y.key === "ArrowRight" && o.currentIndex < D.value.length - 1 && a("navigate", o.currentIndex + 1);
|
|
1461
1576
|
};
|
|
1462
|
-
|
|
1463
|
-
o.mode === "modal" ? window.addEventListener("keydown",
|
|
1464
|
-
}),
|
|
1465
|
-
|
|
1577
|
+
Ie(() => {
|
|
1578
|
+
o.mode === "modal" ? window.addEventListener("keydown", J) : L.value && L.value.addEventListener("keydown", J);
|
|
1579
|
+
}), G(() => {
|
|
1580
|
+
$ !== null && clearTimeout($), o.mode === "modal" ? window.removeEventListener("keydown", J) : L.value && L.value.removeEventListener("keydown", J);
|
|
1466
1581
|
});
|
|
1467
|
-
const
|
|
1468
|
-
|
|
1469
|
-
},
|
|
1470
|
-
|
|
1471
|
-
},
|
|
1582
|
+
const be = () => {
|
|
1583
|
+
i.value = Math.min(i.value + 0.1, 10);
|
|
1584
|
+
}, we = () => {
|
|
1585
|
+
i.value = Math.max(i.value - 0.1, 0.01);
|
|
1586
|
+
}, ot = () => {
|
|
1472
1587
|
u.value = u.value + 90;
|
|
1473
|
-
},
|
|
1588
|
+
}, nt = () => {
|
|
1474
1589
|
u.value = u.value - 90;
|
|
1475
|
-
},
|
|
1476
|
-
if (M.value &&
|
|
1477
|
-
const
|
|
1478
|
-
|
|
1590
|
+
}, at = () => {
|
|
1591
|
+
if (M.value && p.value > 0 && c.value > 0) {
|
|
1592
|
+
const y = M.value.clientWidth, h = M.value.clientHeight, N = y / p.value, w = h / c.value, S = Math.min(N, w);
|
|
1593
|
+
i.value = Math.max(0.01, Math.min(10, S));
|
|
1479
1594
|
} else
|
|
1480
|
-
|
|
1481
|
-
u.value = 0,
|
|
1482
|
-
},
|
|
1483
|
-
|
|
1484
|
-
},
|
|
1485
|
-
|
|
1486
|
-
},
|
|
1487
|
-
|
|
1488
|
-
},
|
|
1489
|
-
if (
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1595
|
+
i.value = 1;
|
|
1596
|
+
u.value = 0, F.value++;
|
|
1597
|
+
}, lt = () => {
|
|
1598
|
+
i.value = 1, u.value = 0, F.value++;
|
|
1599
|
+
}, rt = (y) => {
|
|
1600
|
+
i.value = y;
|
|
1601
|
+
}, ye = () => {
|
|
1602
|
+
i.value = 1, u.value = 0, F.value++;
|
|
1603
|
+
}, it = co(), le = async () => {
|
|
1604
|
+
if (g.value) {
|
|
1605
|
+
if (o.onDownload) {
|
|
1606
|
+
await o.onDownload(g.value);
|
|
1607
|
+
return;
|
|
1608
|
+
}
|
|
1609
|
+
try {
|
|
1610
|
+
await Wt(g.value.url, g.value.name, it.value);
|
|
1611
|
+
} catch (y) {
|
|
1612
|
+
console.error("[file-preview] download failed:", y);
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
}, st = z(() => o.mode === "modal"), xe = _(null), Fe = _(0), ke = _(0), Ce = _(!1), _e = _(null), Re = _(0), ze = _(0), Me = _(!1), ut = (y, h) => {
|
|
1616
|
+
Fe.value = y, ke.value = h;
|
|
1617
|
+
}, dt = (y, h) => {
|
|
1618
|
+
Re.value = y, ze.value = h;
|
|
1619
|
+
}, Te = _(null), ct = (y) => {
|
|
1620
|
+
Te.value = y;
|
|
1621
|
+
}, Q = _(!0), ee = _(!1), te = _("preview"), re = z(() => {
|
|
1622
|
+
var y, h, N;
|
|
1623
|
+
if (Y.value)
|
|
1624
|
+
return ((h = (y = Y.value).getToolbarGroups) == null ? void 0 : h.call(y, g.value, K.value)) ?? [];
|
|
1625
|
+
if (C.value === "image")
|
|
1626
|
+
return mo({
|
|
1627
|
+
zoom: i.value,
|
|
1628
|
+
onZoomIn: be,
|
|
1629
|
+
onZoomOut: we,
|
|
1630
|
+
onFitToWidth: at,
|
|
1631
|
+
onOriginalSize: lt,
|
|
1632
|
+
onRotateLeft: nt,
|
|
1633
|
+
onRotateRight: ot,
|
|
1634
|
+
onReset: ye,
|
|
1512
1635
|
t: l.value
|
|
1513
1636
|
});
|
|
1514
|
-
if (
|
|
1515
|
-
return
|
|
1516
|
-
zoom:
|
|
1517
|
-
onZoomIn:
|
|
1518
|
-
onZoomOut:
|
|
1519
|
-
onReset:
|
|
1637
|
+
if (C.value === "pdf")
|
|
1638
|
+
return vo({
|
|
1639
|
+
zoom: i.value,
|
|
1640
|
+
onZoomIn: be,
|
|
1641
|
+
onZoomOut: we,
|
|
1642
|
+
onReset: ye,
|
|
1520
1643
|
t: l.value
|
|
1521
1644
|
});
|
|
1522
|
-
if (
|
|
1523
|
-
return
|
|
1524
|
-
epubRef:
|
|
1525
|
-
current:
|
|
1526
|
-
total:
|
|
1527
|
-
fullWidth:
|
|
1645
|
+
if (C.value === "epub")
|
|
1646
|
+
return ho({
|
|
1647
|
+
epubRef: xe.value,
|
|
1648
|
+
current: Fe.value,
|
|
1649
|
+
total: ke.value,
|
|
1650
|
+
fullWidth: Ce.value,
|
|
1528
1651
|
t: l.value
|
|
1529
1652
|
});
|
|
1530
|
-
if (
|
|
1531
|
-
return
|
|
1532
|
-
mobiRef:
|
|
1533
|
-
current:
|
|
1534
|
-
total:
|
|
1535
|
-
fullWidth:
|
|
1653
|
+
if (C.value === "mobi")
|
|
1654
|
+
return go({
|
|
1655
|
+
mobiRef: _e.value,
|
|
1656
|
+
current: Re.value,
|
|
1657
|
+
total: ze.value,
|
|
1658
|
+
fullWidth: Me.value,
|
|
1536
1659
|
t: l.value
|
|
1537
1660
|
});
|
|
1538
|
-
if (
|
|
1539
|
-
return
|
|
1540
|
-
if (
|
|
1541
|
-
const w = ((
|
|
1542
|
-
return
|
|
1543
|
-
wordWrap:
|
|
1661
|
+
if (C.value === "zip")
|
|
1662
|
+
return bo({ stats: Te.value, t: l.value });
|
|
1663
|
+
if (C.value === "text") {
|
|
1664
|
+
const w = ((N = g.value.name.split(".").pop()) == null ? void 0 : N.toLowerCase()) || "";
|
|
1665
|
+
return wo({
|
|
1666
|
+
wordWrap: Q.value,
|
|
1544
1667
|
onToggleWrap: () => {
|
|
1545
|
-
|
|
1668
|
+
Q.value = !Q.value;
|
|
1546
1669
|
},
|
|
1547
1670
|
isHtml: w === "html" || w === "htm",
|
|
1548
|
-
htmlPreview:
|
|
1671
|
+
htmlPreview: ee.value,
|
|
1549
1672
|
onToggleHtmlPreview: () => {
|
|
1550
|
-
|
|
1673
|
+
ee.value = !ee.value;
|
|
1551
1674
|
},
|
|
1552
1675
|
t: l.value
|
|
1553
1676
|
});
|
|
1554
1677
|
}
|
|
1555
|
-
return
|
|
1556
|
-
viewMode:
|
|
1678
|
+
return C.value === "markdown" ? yo({
|
|
1679
|
+
viewMode: te.value,
|
|
1557
1680
|
onToggleViewMode: () => {
|
|
1558
|
-
|
|
1681
|
+
te.value = te.value === "preview" ? "source" : "preview";
|
|
1559
1682
|
},
|
|
1560
1683
|
t: l.value
|
|
1561
1684
|
}) : [];
|
|
1562
|
-
}),
|
|
1563
|
-
const
|
|
1685
|
+
}), Ee = z(() => {
|
|
1686
|
+
const y = [
|
|
1564
1687
|
{
|
|
1565
1688
|
items: [
|
|
1566
|
-
{ type: "button", icon:
|
|
1689
|
+
{ type: "button", icon: Ge, tooltip: l.value("common.download"), action: le }
|
|
1567
1690
|
]
|
|
1568
1691
|
}
|
|
1569
1692
|
];
|
|
1570
|
-
return
|
|
1693
|
+
return st.value && y.push({
|
|
1571
1694
|
items: [
|
|
1572
|
-
{ type: "button", icon:
|
|
1695
|
+
{ type: "button", icon: Ct, tooltip: l.value("common.close"), action: () => a("close") }
|
|
1573
1696
|
]
|
|
1574
|
-
}),
|
|
1575
|
-
}),
|
|
1576
|
-
return (
|
|
1577
|
-
var
|
|
1578
|
-
return
|
|
1697
|
+
}), y;
|
|
1698
|
+
}), ft = z(() => re.value.length > 0);
|
|
1699
|
+
return (y, h) => {
|
|
1700
|
+
var N;
|
|
1701
|
+
return f(), b("div", {
|
|
1579
1702
|
ref_key: "rootRef",
|
|
1580
|
-
ref:
|
|
1703
|
+
ref: L,
|
|
1581
1704
|
tabindex: e.mode === "embed" ? 0 : -1,
|
|
1582
1705
|
"data-theme": s.value,
|
|
1583
1706
|
class: "vfp-relative vfp-w-full vfp-h-full vfp-flex vfp-flex-col vfp-overflow-hidden vfp-outline-none"
|
|
1584
1707
|
}, [
|
|
1585
|
-
e.headless ?
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1708
|
+
e.headless ? W("", !0) : (f(), b("div", Go, [
|
|
1709
|
+
P("div", Xo, [
|
|
1710
|
+
P("div", Yo, [
|
|
1711
|
+
P("h2", Ko, I((N = g.value) == null ? void 0 : N.name), 1),
|
|
1712
|
+
P("span", Jo, I(e.currentIndex + 1) + "/" + I(D.value.length), 1)
|
|
1590
1713
|
]),
|
|
1591
|
-
|
|
1592
|
-
(
|
|
1714
|
+
P("div", Qo, [
|
|
1715
|
+
(f(!0), b(E, null, O(Ee.value, (w, S) => (f(), b(E, {
|
|
1593
1716
|
key: "m-action-" + S
|
|
1594
1717
|
}, [
|
|
1595
|
-
(
|
|
1596
|
-
key: "m-action-" + S + "-" +
|
|
1718
|
+
(f(!0), b(E, null, O(w.items, (x, U) => (f(), b(E, {
|
|
1719
|
+
key: "m-action-" + S + "-" + U
|
|
1597
1720
|
}, [
|
|
1598
|
-
x.type === "button" ? (
|
|
1721
|
+
x.type === "button" ? (f(), b("button", {
|
|
1599
1722
|
key: 0,
|
|
1600
1723
|
class: "toolbar-btn",
|
|
1601
1724
|
"data-tooltip": x.tooltip,
|
|
1602
1725
|
disabled: x.disabled,
|
|
1603
1726
|
onClick: x.action
|
|
1604
1727
|
}, [
|
|
1605
|
-
(
|
|
1606
|
-
], 8,
|
|
1728
|
+
(f(), R(V(x.icon), { class: "vfp-w-4 vfp-h-4" }))
|
|
1729
|
+
], 8, en)) : W("", !0)
|
|
1607
1730
|
], 64))), 128))
|
|
1608
1731
|
], 64))), 128))
|
|
1609
1732
|
]),
|
|
1610
|
-
|
|
1611
|
-
(
|
|
1733
|
+
P("div", tn, [
|
|
1734
|
+
(f(!0), b(E, null, O(re.value, (w, S) => (f(), b(E, {
|
|
1612
1735
|
key: "d-tool-" + S
|
|
1613
1736
|
}, [
|
|
1614
|
-
(
|
|
1615
|
-
key: "d-tool-" + S + "-" +
|
|
1737
|
+
(f(!0), b(E, null, O(w.items, (x, U) => (f(), b(E, {
|
|
1738
|
+
key: "d-tool-" + S + "-" + U
|
|
1616
1739
|
}, [
|
|
1617
|
-
x.type === "button" ? (
|
|
1740
|
+
x.type === "button" ? (f(), b("button", {
|
|
1618
1741
|
key: 0,
|
|
1619
1742
|
class: "toolbar-btn",
|
|
1620
1743
|
"data-tooltip": x.tooltip,
|
|
1621
1744
|
disabled: x.disabled,
|
|
1622
1745
|
onClick: x.action
|
|
1623
1746
|
}, [
|
|
1624
|
-
(
|
|
1625
|
-
], 8,
|
|
1747
|
+
(f(), R(V(x.icon), { class: "vfp-w-4 vfp-h-4" }))
|
|
1748
|
+
], 8, on)) : x.type === "text" ? (f(), b("span", {
|
|
1626
1749
|
key: 1,
|
|
1627
1750
|
class: "vfp-text-xs vfp-text-center vfp-font-medium vfp-tabular-nums vfp-text-fg-tertiary",
|
|
1628
|
-
style:
|
|
1629
|
-
},
|
|
1751
|
+
style: oe({ minWidth: x.minWidth || "auto" })
|
|
1752
|
+
}, I(x.content), 5)) : W("", !0)
|
|
1630
1753
|
], 64))), 128)),
|
|
1631
|
-
h[11] || (h[11] =
|
|
1754
|
+
h[11] || (h[11] = P("div", { class: "vfp-w-px vfp-h-4 vfp-mx-1 vfp-bg-divide" }, null, -1))
|
|
1632
1755
|
], 64))), 128)),
|
|
1633
|
-
(
|
|
1756
|
+
(f(!0), b(E, null, O(Ee.value, (w, S) => (f(), b(E, {
|
|
1634
1757
|
key: "d-action-" + S
|
|
1635
1758
|
}, [
|
|
1636
|
-
(
|
|
1637
|
-
key: "d-action-" + S + "-" +
|
|
1759
|
+
(f(!0), b(E, null, O(w.items, (x, U) => (f(), b(E, {
|
|
1760
|
+
key: "d-action-" + S + "-" + U
|
|
1638
1761
|
}, [
|
|
1639
|
-
x.type === "button" ? (
|
|
1762
|
+
x.type === "button" ? (f(), b("button", {
|
|
1640
1763
|
key: 0,
|
|
1641
1764
|
class: "toolbar-btn",
|
|
1642
1765
|
"data-tooltip": x.tooltip,
|
|
1643
1766
|
disabled: x.disabled,
|
|
1644
1767
|
onClick: x.action
|
|
1645
1768
|
}, [
|
|
1646
|
-
(
|
|
1647
|
-
], 8,
|
|
1769
|
+
(f(), R(V(x.icon), { class: "vfp-w-4 vfp-h-4" }))
|
|
1770
|
+
], 8, nn)) : W("", !0)
|
|
1648
1771
|
], 64))), 128))
|
|
1649
1772
|
], 64))), 128))
|
|
1650
1773
|
])
|
|
1651
1774
|
]),
|
|
1652
|
-
|
|
1653
|
-
(
|
|
1775
|
+
ft.value ? (f(), b("div", an, [
|
|
1776
|
+
(f(!0), b(E, null, O(re.value, (w, S) => (f(), b(E, {
|
|
1654
1777
|
key: "m-tool-" + S
|
|
1655
1778
|
}, [
|
|
1656
|
-
S > 0 ? (
|
|
1657
|
-
(
|
|
1658
|
-
key: "m-tool-" + S + "-" +
|
|
1779
|
+
S > 0 ? (f(), b("div", ln)) : W("", !0),
|
|
1780
|
+
(f(!0), b(E, null, O(w.items, (x, U) => (f(), b(E, {
|
|
1781
|
+
key: "m-tool-" + S + "-" + U
|
|
1659
1782
|
}, [
|
|
1660
|
-
x.type === "button" ? (
|
|
1783
|
+
x.type === "button" ? (f(), b("button", {
|
|
1661
1784
|
key: 0,
|
|
1662
1785
|
class: "toolbar-btn",
|
|
1663
1786
|
"data-tooltip": x.tooltip,
|
|
1664
1787
|
disabled: x.disabled,
|
|
1665
1788
|
onClick: x.action
|
|
1666
1789
|
}, [
|
|
1667
|
-
(
|
|
1668
|
-
], 8,
|
|
1790
|
+
(f(), R(V(x.icon), { class: "vfp-w-4 vfp-h-4" }))
|
|
1791
|
+
], 8, rn)) : x.type === "text" ? (f(), b("span", {
|
|
1669
1792
|
key: 1,
|
|
1670
1793
|
class: "vfp-text-xs vfp-text-center vfp-font-medium vfp-tabular-nums vfp-text-fg-tertiary",
|
|
1671
|
-
style:
|
|
1672
|
-
},
|
|
1794
|
+
style: oe({ minWidth: x.minWidth || "auto" })
|
|
1795
|
+
}, I(x.content), 5)) : W("", !0)
|
|
1673
1796
|
], 64))), 128))
|
|
1674
1797
|
], 64))), 128))
|
|
1675
|
-
])) :
|
|
1798
|
+
])) : W("", !0)
|
|
1676
1799
|
])),
|
|
1677
|
-
|
|
1800
|
+
P("div", {
|
|
1678
1801
|
ref_key: "contentRef",
|
|
1679
1802
|
ref: M,
|
|
1680
1803
|
class: "vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-overflow-auto",
|
|
1681
|
-
onMousemove:
|
|
1804
|
+
onMousemove: Z
|
|
1682
1805
|
}, [
|
|
1683
|
-
|
|
1684
|
-
|
|
1806
|
+
g.value ? (f(), b(E, { key: 0 }, [
|
|
1807
|
+
ge.value ? (f(), R(V(ge.value), {
|
|
1685
1808
|
key: 0,
|
|
1686
|
-
file:
|
|
1687
|
-
ctx:
|
|
1688
|
-
}, null, 8, ["file", "ctx"])) : (
|
|
1689
|
-
|
|
1809
|
+
file: g.value,
|
|
1810
|
+
ctx: K.value
|
|
1811
|
+
}, null, 8, ["file", "ctx"])) : (f(), b(E, { key: 1 }, [
|
|
1812
|
+
C.value === "image" ? (f(), R(v(_o), {
|
|
1690
1813
|
key: 0,
|
|
1691
|
-
url:
|
|
1692
|
-
zoom:
|
|
1814
|
+
url: v(T),
|
|
1815
|
+
zoom: i.value,
|
|
1693
1816
|
rotation: u.value,
|
|
1694
|
-
"reset-key":
|
|
1695
|
-
"file-size":
|
|
1696
|
-
onZoomChange:
|
|
1697
|
-
onNaturalWidthChange: h[0] || (h[0] = (w) =>
|
|
1698
|
-
onNaturalHeightChange: h[1] || (h[1] = (w) =>
|
|
1699
|
-
}, null, 8, ["url", "zoom", "rotation", "reset-key", "file-size"])) :
|
|
1817
|
+
"reset-key": F.value,
|
|
1818
|
+
"file-size": g.value.size,
|
|
1819
|
+
onZoomChange: rt,
|
|
1820
|
+
onNaturalWidthChange: h[0] || (h[0] = (w) => p.value = w),
|
|
1821
|
+
onNaturalHeightChange: h[1] || (h[1] = (w) => c.value = w)
|
|
1822
|
+
}, null, 8, ["url", "zoom", "rotation", "reset-key", "file-size"])) : C.value === "pdf" ? (f(), R(v(Ro), {
|
|
1700
1823
|
key: 1,
|
|
1701
|
-
url:
|
|
1702
|
-
zoom:
|
|
1824
|
+
url: v(T),
|
|
1825
|
+
zoom: i.value,
|
|
1703
1826
|
"current-page": d.value,
|
|
1704
1827
|
onPageChange: h[2] || (h[2] = (w) => d.value = w),
|
|
1705
|
-
onTotalPagesChange: h[3] || (h[3] = (w) =>
|
|
1706
|
-
onPageWidthChange: h[4] || (h[4] = (w) =>
|
|
1707
|
-
}, null, 8, ["url", "zoom", "current-page"])) :
|
|
1828
|
+
onTotalPagesChange: h[3] || (h[3] = (w) => m.value = w),
|
|
1829
|
+
onPageWidthChange: h[4] || (h[4] = (w) => p.value = w)
|
|
1830
|
+
}, null, 8, ["url", "zoom", "current-page"])) : C.value === "docx" ? (f(), R(v(zo), {
|
|
1708
1831
|
key: 2,
|
|
1709
|
-
url:
|
|
1710
|
-
}, null, 8, ["url"])) :
|
|
1832
|
+
url: v(T)
|
|
1833
|
+
}, null, 8, ["url"])) : C.value === "xlsx" ? (f(), R(v(Mo), {
|
|
1711
1834
|
key: 3,
|
|
1712
|
-
url:
|
|
1713
|
-
}, null, 8, ["url"])) :
|
|
1835
|
+
url: v(T)
|
|
1836
|
+
}, null, 8, ["url"])) : C.value === "pptx" ? (f(), R(v(To), {
|
|
1714
1837
|
key: 4,
|
|
1715
|
-
url:
|
|
1716
|
-
}, null, 8, ["url"])) :
|
|
1838
|
+
url: v(T)
|
|
1839
|
+
}, null, 8, ["url"])) : C.value === "msg" ? (f(), R(v(Eo), {
|
|
1717
1840
|
key: 5,
|
|
1718
|
-
url:
|
|
1719
|
-
}, null, 8, ["url"])) :
|
|
1841
|
+
url: v(T)
|
|
1842
|
+
}, null, 8, ["url"])) : C.value === "epub" ? (f(), R(v(Po), {
|
|
1720
1843
|
key: 6,
|
|
1721
1844
|
ref_key: "epubRef",
|
|
1722
|
-
ref:
|
|
1723
|
-
url:
|
|
1724
|
-
onChapterChange:
|
|
1725
|
-
onFullWidthChange: h[5] || (h[5] = (w) =>
|
|
1726
|
-
}, null, 8, ["url"])) :
|
|
1845
|
+
ref: xe,
|
|
1846
|
+
url: v(T),
|
|
1847
|
+
onChapterChange: ut,
|
|
1848
|
+
onFullWidthChange: h[5] || (h[5] = (w) => Ce.value = w)
|
|
1849
|
+
}, null, 8, ["url"])) : C.value === "mobi" ? (f(), R(v($o), {
|
|
1727
1850
|
key: 7,
|
|
1728
1851
|
ref_key: "mobiRef",
|
|
1729
|
-
ref:
|
|
1730
|
-
url:
|
|
1731
|
-
onChapterChange:
|
|
1732
|
-
onFullWidthChange: h[6] || (h[6] = (w) =>
|
|
1733
|
-
}, null, 8, ["url"])) :
|
|
1852
|
+
ref: _e,
|
|
1853
|
+
url: v(T),
|
|
1854
|
+
onChapterChange: dt,
|
|
1855
|
+
onFullWidthChange: h[6] || (h[6] = (w) => Me.value = w)
|
|
1856
|
+
}, null, 8, ["url"])) : C.value === "video" ? (f(), R(v(jo), {
|
|
1734
1857
|
key: 8,
|
|
1735
|
-
url:
|
|
1736
|
-
}, null, 8, ["url"])) :
|
|
1858
|
+
url: v(T)
|
|
1859
|
+
}, null, 8, ["url"])) : C.value === "audio" ? (f(), R(v(So), {
|
|
1737
1860
|
key: 9,
|
|
1738
|
-
url:
|
|
1739
|
-
"file-name":
|
|
1740
|
-
}, null, 8, ["url", "file-name"])) :
|
|
1861
|
+
url: v(T),
|
|
1862
|
+
"file-name": g.value.name
|
|
1863
|
+
}, null, 8, ["url", "file-name"])) : C.value === "markdown" ? (f(), R(v(Lo), {
|
|
1741
1864
|
key: 10,
|
|
1742
|
-
url:
|
|
1743
|
-
"view-mode":
|
|
1744
|
-
}, null, 8, ["url", "view-mode"])) :
|
|
1865
|
+
url: v(T),
|
|
1866
|
+
"view-mode": te.value
|
|
1867
|
+
}, null, 8, ["url", "view-mode"])) : C.value === "json" ? (f(), R(v(No), {
|
|
1745
1868
|
key: 11,
|
|
1746
|
-
url:
|
|
1747
|
-
"file-name":
|
|
1748
|
-
}, null, 8, ["url", "file-name"])) :
|
|
1869
|
+
url: v(T),
|
|
1870
|
+
"file-name": g.value.name
|
|
1871
|
+
}, null, 8, ["url", "file-name"])) : C.value === "csv" ? (f(), R(v(Do), {
|
|
1749
1872
|
key: 12,
|
|
1750
|
-
url:
|
|
1751
|
-
"file-name":
|
|
1752
|
-
}, null, 8, ["url", "file-name"])) :
|
|
1873
|
+
url: v(T),
|
|
1874
|
+
"file-name": g.value.name
|
|
1875
|
+
}, null, 8, ["url", "file-name"])) : C.value === "xml" ? (f(), R(v(Wo), {
|
|
1753
1876
|
key: 13,
|
|
1754
|
-
url:
|
|
1755
|
-
"file-name":
|
|
1756
|
-
}, null, 8, ["url", "file-name"])) :
|
|
1877
|
+
url: v(T),
|
|
1878
|
+
"file-name": g.value.name
|
|
1879
|
+
}, null, 8, ["url", "file-name"])) : C.value === "subtitle" ? (f(), R(v(Io), {
|
|
1757
1880
|
key: 14,
|
|
1758
|
-
url:
|
|
1759
|
-
"file-name":
|
|
1760
|
-
}, null, 8, ["url", "file-name"])) :
|
|
1881
|
+
url: v(T),
|
|
1882
|
+
"file-name": g.value.name
|
|
1883
|
+
}, null, 8, ["url", "file-name"])) : C.value === "zip" && o.zipNestingDepth >= sn ? (f(), R(We, {
|
|
1761
1884
|
key: 15,
|
|
1762
|
-
"file-name":
|
|
1763
|
-
"file-type":
|
|
1764
|
-
onDownload:
|
|
1765
|
-
}, null, 8, ["file-name", "file-type"])) :
|
|
1885
|
+
"file-name": g.value.name,
|
|
1886
|
+
"file-type": g.value.type,
|
|
1887
|
+
onDownload: le
|
|
1888
|
+
}, null, 8, ["file-name", "file-type"])) : C.value === "zip" ? (f(), R(v(Oo), {
|
|
1766
1889
|
key: 16,
|
|
1767
|
-
url:
|
|
1890
|
+
url: v(T),
|
|
1768
1891
|
"nesting-depth": o.zipNestingDepth,
|
|
1769
|
-
onStatsChange:
|
|
1770
|
-
}, null, 8, ["url", "nesting-depth"])) :
|
|
1892
|
+
onStatsChange: ct
|
|
1893
|
+
}, null, 8, ["url", "nesting-depth"])) : C.value === "text" ? (f(), R(v(qo), {
|
|
1771
1894
|
key: 17,
|
|
1772
|
-
url:
|
|
1773
|
-
"file-name":
|
|
1774
|
-
"word-wrap":
|
|
1775
|
-
"html-preview":
|
|
1776
|
-
}, null, 8, ["url", "file-name", "word-wrap", "html-preview"])) : (
|
|
1895
|
+
url: v(T),
|
|
1896
|
+
"file-name": g.value.name,
|
|
1897
|
+
"word-wrap": Q.value,
|
|
1898
|
+
"html-preview": ee.value
|
|
1899
|
+
}, null, 8, ["url", "file-name", "word-wrap", "html-preview"])) : (f(), R(We, {
|
|
1777
1900
|
key: 18,
|
|
1778
|
-
"file-name":
|
|
1779
|
-
"file-type":
|
|
1780
|
-
onDownload:
|
|
1901
|
+
"file-name": g.value.name,
|
|
1902
|
+
"file-type": g.value.type,
|
|
1903
|
+
onDownload: le
|
|
1781
1904
|
}, null, 8, ["file-name", "file-type"]))
|
|
1782
1905
|
], 64))
|
|
1783
|
-
], 64)) :
|
|
1906
|
+
], 64)) : W("", !0)
|
|
1784
1907
|
], 544),
|
|
1785
|
-
!e.headless &&
|
|
1786
|
-
e.currentIndex > 0 ? (
|
|
1908
|
+
!e.headless && D.value.length > 1 ? (f(), b(E, { key: 1 }, [
|
|
1909
|
+
e.currentIndex > 0 ? (f(), b("button", {
|
|
1787
1910
|
key: 0,
|
|
1788
|
-
style:
|
|
1911
|
+
style: oe({
|
|
1789
1912
|
opacity: k.value ? 1 : 0,
|
|
1790
1913
|
transform: k.value ? "translateY(-50%)" : "translateY(-50%) translateX(-20px)",
|
|
1791
1914
|
pointerEvents: k.value ? "auto" : "none",
|
|
@@ -1795,11 +1918,11 @@ const io = { class: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp
|
|
|
1795
1918
|
onClick: h[7] || (h[7] = (w) => a("navigate", e.currentIndex - 1)),
|
|
1796
1919
|
onMouseenter: h[8] || (h[8] = (w) => k.value = !0)
|
|
1797
1920
|
}, [
|
|
1798
|
-
|
|
1799
|
-
], 36)) :
|
|
1800
|
-
e.currentIndex <
|
|
1921
|
+
H(v(fe), { class: "vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6" })
|
|
1922
|
+
], 36)) : W("", !0),
|
|
1923
|
+
e.currentIndex < D.value.length - 1 ? (f(), b("button", {
|
|
1801
1924
|
key: 1,
|
|
1802
|
-
style:
|
|
1925
|
+
style: oe({
|
|
1803
1926
|
opacity: k.value ? 1 : 0,
|
|
1804
1927
|
transform: k.value ? "translateY(-50%)" : "translateY(-50%) translateX(20px)",
|
|
1805
1928
|
pointerEvents: k.value ? "auto" : "none",
|
|
@@ -1809,38 +1932,38 @@ const io = { class: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp
|
|
|
1809
1932
|
onClick: h[9] || (h[9] = (w) => a("navigate", e.currentIndex + 1)),
|
|
1810
1933
|
onMouseenter: h[10] || (h[10] = (w) => k.value = !0)
|
|
1811
1934
|
}, [
|
|
1812
|
-
|
|
1813
|
-
], 36)) :
|
|
1814
|
-
], 64)) :
|
|
1815
|
-
], 8,
|
|
1935
|
+
H(v(pe), { class: "vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6" })
|
|
1936
|
+
], 36)) : W("", !0)
|
|
1937
|
+
], 64)) : W("", !0)
|
|
1938
|
+
], 8, Vo);
|
|
1816
1939
|
};
|
|
1817
1940
|
}
|
|
1818
|
-
}),
|
|
1941
|
+
}), cn = (e, t) => {
|
|
1819
1942
|
const o = e.__vccOpts || e;
|
|
1820
1943
|
for (const [a, l] of t)
|
|
1821
1944
|
o[a] = l;
|
|
1822
1945
|
return o;
|
|
1823
|
-
},
|
|
1946
|
+
}, he = /* @__PURE__ */ cn(dn, [["__scopeId", "data-v-14963572"]]), Ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1824
1947
|
__proto__: null,
|
|
1825
|
-
default:
|
|
1948
|
+
default: he
|
|
1826
1949
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1827
|
-
function
|
|
1950
|
+
function fn(e) {
|
|
1828
1951
|
let t = "", o = "", a = !1;
|
|
1829
1952
|
const l = () => {
|
|
1830
1953
|
if (a || typeof document > "u") return;
|
|
1831
1954
|
t = document.body.style.overflow, o = document.body.style.paddingRight;
|
|
1832
|
-
const
|
|
1833
|
-
document.body.style.overflow = "hidden",
|
|
1955
|
+
const r = window.innerWidth - document.documentElement.clientWidth;
|
|
1956
|
+
document.body.style.overflow = "hidden", r > 0 && (document.body.style.paddingRight = `${r}px`), a = !0;
|
|
1834
1957
|
}, n = () => {
|
|
1835
1958
|
!a || typeof document > "u" || (document.body.style.overflow = t, document.body.style.paddingRight = o, a = !1);
|
|
1836
1959
|
};
|
|
1837
|
-
return
|
|
1960
|
+
return Ie(() => {
|
|
1838
1961
|
e() && l();
|
|
1839
|
-
}),
|
|
1962
|
+
}), vt(() => {
|
|
1840
1963
|
n();
|
|
1841
1964
|
}), { lock: l, unlock: n };
|
|
1842
1965
|
}
|
|
1843
|
-
const
|
|
1966
|
+
const pn = ["data-theme"], Nn = /* @__PURE__ */ X({
|
|
1844
1967
|
__name: "FilePreviewModal",
|
|
1845
1968
|
props: {
|
|
1846
1969
|
files: {},
|
|
@@ -1850,56 +1973,60 @@ const Qo = ["data-theme"], Fn = /* @__PURE__ */ X({
|
|
|
1850
1973
|
locale: { default: void 0 },
|
|
1851
1974
|
messages: { default: void 0 },
|
|
1852
1975
|
headless: { type: Boolean, default: !1 },
|
|
1853
|
-
theme: { default: "dark" }
|
|
1976
|
+
theme: { default: "dark" },
|
|
1977
|
+
requestInit: { type: Function, default: void 0 },
|
|
1978
|
+
requestHandler: { type: Function, default: void 0 },
|
|
1979
|
+
shouldFetchAsBlob: { type: Function, default: void 0 },
|
|
1980
|
+
onDownload: { type: Function, default: void 0 }
|
|
1854
1981
|
},
|
|
1855
1982
|
emits: ["close", "navigate", "custom-event"],
|
|
1856
1983
|
setup(e, { emit: t }) {
|
|
1857
|
-
const o = e, a = t, { lock: l, unlock: n } =
|
|
1858
|
-
|
|
1984
|
+
const o = e, a = t, { lock: l, unlock: n } = fn(() => o.isOpen);
|
|
1985
|
+
q(
|
|
1859
1986
|
() => o.isOpen,
|
|
1860
|
-
(
|
|
1861
|
-
|
|
1987
|
+
(p) => {
|
|
1988
|
+
p ? l() : n();
|
|
1862
1989
|
}
|
|
1863
1990
|
);
|
|
1864
|
-
const
|
|
1991
|
+
const r = _(
|
|
1865
1992
|
typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
1866
1993
|
);
|
|
1867
1994
|
let s = null;
|
|
1868
|
-
|
|
1995
|
+
q(
|
|
1869
1996
|
() => o.theme,
|
|
1870
|
-
(
|
|
1871
|
-
if (s && (s(), s = null),
|
|
1872
|
-
const
|
|
1873
|
-
|
|
1997
|
+
(p) => {
|
|
1998
|
+
if (s && (s(), s = null), p === "auto") {
|
|
1999
|
+
const c = window.matchMedia("(prefers-color-scheme: dark)"), F = (M) => {
|
|
2000
|
+
r.value = M.matches;
|
|
1874
2001
|
};
|
|
1875
|
-
|
|
2002
|
+
c.addEventListener("change", F), s = () => c.removeEventListener("change", F);
|
|
1876
2003
|
}
|
|
1877
2004
|
},
|
|
1878
2005
|
{ immediate: !0 }
|
|
1879
|
-
),
|
|
2006
|
+
), G(() => {
|
|
1880
2007
|
s && s();
|
|
1881
2008
|
});
|
|
1882
|
-
const
|
|
1883
|
-
() => o.theme === "auto" ?
|
|
1884
|
-
), u = () => a("close"), d = (
|
|
1885
|
-
return (
|
|
1886
|
-
|
|
1887
|
-
default:
|
|
1888
|
-
e.isOpen ? (
|
|
2009
|
+
const i = z(
|
|
2010
|
+
() => o.theme === "auto" ? r.value ? "dark" : "light" : o.theme
|
|
2011
|
+
), u = () => a("close"), d = (p) => p.stopPropagation(), m = (p) => p.stopPropagation();
|
|
2012
|
+
return (p, c) => (f(), R(ht, { to: "body" }, [
|
|
2013
|
+
H(gt, { name: "vfp-fade" }, {
|
|
2014
|
+
default: bt(() => [
|
|
2015
|
+
e.isOpen ? (f(), b("div", {
|
|
1889
2016
|
key: 0,
|
|
1890
2017
|
class: "vfp-root",
|
|
1891
|
-
"data-theme":
|
|
2018
|
+
"data-theme": i.value
|
|
1892
2019
|
}, [
|
|
1893
|
-
|
|
2020
|
+
P("div", {
|
|
1894
2021
|
class: "vfp-fixed vfp-inset-0 vfp-z-[9999] vfp-flex vfp-items-center vfp-justify-center vfp-backdrop-blur-md vfp-overflow-hidden vfp-bg-surface-overlay",
|
|
1895
2022
|
onClick: u,
|
|
1896
|
-
onWheel:
|
|
2023
|
+
onWheel: m
|
|
1897
2024
|
}, [
|
|
1898
|
-
|
|
2025
|
+
P("div", {
|
|
1899
2026
|
class: "vfp-relative vfp-w-full vfp-h-full",
|
|
1900
2027
|
onClick: d
|
|
1901
2028
|
}, [
|
|
1902
|
-
|
|
2029
|
+
H(he, {
|
|
1903
2030
|
mode: "modal",
|
|
1904
2031
|
files: e.files,
|
|
1905
2032
|
"current-index": e.currentIndex,
|
|
@@ -1908,19 +2035,23 @@ const Qo = ["data-theme"], Fn = /* @__PURE__ */ X({
|
|
|
1908
2035
|
messages: e.messages,
|
|
1909
2036
|
headless: e.headless,
|
|
1910
2037
|
theme: e.theme,
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
2038
|
+
"request-init": e.requestInit,
|
|
2039
|
+
"request-handler": e.requestHandler,
|
|
2040
|
+
"should-fetch-as-blob": e.shouldFetchAsBlob,
|
|
2041
|
+
"on-download": e.onDownload,
|
|
2042
|
+
onClose: c[0] || (c[0] = (F) => a("close")),
|
|
2043
|
+
onNavigate: c[1] || (c[1] = (F) => a("navigate", F)),
|
|
2044
|
+
onCustomEvent: c[2] || (c[2] = (F) => a("custom-event", F))
|
|
2045
|
+
}, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download"])
|
|
1915
2046
|
])
|
|
1916
2047
|
], 32)
|
|
1917
|
-
], 8,
|
|
2048
|
+
], 8, pn)) : W("", !0)
|
|
1918
2049
|
]),
|
|
1919
2050
|
_: 1
|
|
1920
2051
|
})
|
|
1921
2052
|
]));
|
|
1922
2053
|
}
|
|
1923
|
-
}),
|
|
2054
|
+
}), mn = ["data-theme"], vn = { class: "vfp-relative vfp-w-full vfp-h-full vfp-overflow-hidden vfp-bg-surface-overlay" }, Dn = /* @__PURE__ */ X({
|
|
1924
2055
|
__name: "FilePreviewEmbed",
|
|
1925
2056
|
props: {
|
|
1926
2057
|
files: {},
|
|
@@ -1931,41 +2062,45 @@ const Qo = ["data-theme"], Fn = /* @__PURE__ */ X({
|
|
|
1931
2062
|
locale: { default: void 0 },
|
|
1932
2063
|
messages: { default: void 0 },
|
|
1933
2064
|
headless: { type: Boolean, default: !1 },
|
|
1934
|
-
theme: { default: "dark" }
|
|
2065
|
+
theme: { default: "dark" },
|
|
2066
|
+
requestInit: { type: Function, default: void 0 },
|
|
2067
|
+
requestHandler: { type: Function, default: void 0 },
|
|
2068
|
+
shouldFetchAsBlob: { type: Function, default: void 0 },
|
|
2069
|
+
onDownload: { type: Function, default: void 0 }
|
|
1935
2070
|
},
|
|
1936
2071
|
emits: ["navigate", "custom-event"],
|
|
1937
2072
|
setup(e, { emit: t }) {
|
|
1938
|
-
const o = e, a = t, l =
|
|
2073
|
+
const o = e, a = t, l = _(
|
|
1939
2074
|
typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
1940
2075
|
);
|
|
1941
2076
|
let n = null;
|
|
1942
|
-
|
|
2077
|
+
q(
|
|
1943
2078
|
() => o.theme,
|
|
1944
|
-
(
|
|
1945
|
-
if (n && (n(), n = null),
|
|
1946
|
-
const u = window.matchMedia("(prefers-color-scheme: dark)"), d = (
|
|
1947
|
-
l.value =
|
|
2079
|
+
(i) => {
|
|
2080
|
+
if (n && (n(), n = null), i === "auto") {
|
|
2081
|
+
const u = window.matchMedia("(prefers-color-scheme: dark)"), d = (m) => {
|
|
2082
|
+
l.value = m.matches;
|
|
1948
2083
|
};
|
|
1949
2084
|
u.addEventListener("change", d), n = () => u.removeEventListener("change", d);
|
|
1950
2085
|
}
|
|
1951
2086
|
},
|
|
1952
2087
|
{ immediate: !0 }
|
|
1953
|
-
),
|
|
2088
|
+
), G(() => {
|
|
1954
2089
|
n && n();
|
|
1955
2090
|
});
|
|
1956
|
-
const
|
|
2091
|
+
const r = z(
|
|
1957
2092
|
() => o.theme === "auto" ? l.value ? "dark" : "light" : o.theme
|
|
1958
2093
|
), s = {
|
|
1959
2094
|
width: typeof o.width == "number" ? `${o.width}px` : o.width,
|
|
1960
2095
|
height: typeof o.height == "number" ? `${o.height}px` : o.height
|
|
1961
2096
|
};
|
|
1962
|
-
return (
|
|
2097
|
+
return (i, u) => (f(), b("div", {
|
|
1963
2098
|
class: "vfp-root",
|
|
1964
2099
|
style: s,
|
|
1965
|
-
"data-theme":
|
|
2100
|
+
"data-theme": r.value
|
|
1966
2101
|
}, [
|
|
1967
|
-
|
|
1968
|
-
|
|
2102
|
+
P("div", vn, [
|
|
2103
|
+
H(he, {
|
|
1969
2104
|
mode: "embed",
|
|
1970
2105
|
files: e.files,
|
|
1971
2106
|
"current-index": e.currentIndex,
|
|
@@ -1974,44 +2109,49 @@ const Qo = ["data-theme"], Fn = /* @__PURE__ */ X({
|
|
|
1974
2109
|
messages: e.messages,
|
|
1975
2110
|
headless: e.headless,
|
|
1976
2111
|
theme: e.theme,
|
|
2112
|
+
"request-init": e.requestInit,
|
|
2113
|
+
"request-handler": e.requestHandler,
|
|
2114
|
+
"should-fetch-as-blob": e.shouldFetchAsBlob,
|
|
2115
|
+
"on-download": e.onDownload,
|
|
1977
2116
|
onNavigate: u[0] || (u[0] = (d) => a("navigate", d)),
|
|
1978
2117
|
onCustomEvent: u[1] || (u[1] = (d) => a("custom-event", d))
|
|
1979
|
-
}, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme"])
|
|
2118
|
+
}, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download"])
|
|
1980
2119
|
])
|
|
1981
|
-
], 8,
|
|
2120
|
+
], 8, mn));
|
|
1982
2121
|
}
|
|
1983
|
-
}),
|
|
2122
|
+
}), Wn = zt.version;
|
|
1984
2123
|
export {
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2124
|
+
zn as C,
|
|
2125
|
+
$n as E,
|
|
2126
|
+
he as F,
|
|
2127
|
+
jn as L,
|
|
2128
|
+
En as M,
|
|
2129
|
+
Ye as N,
|
|
2130
|
+
Tn as S,
|
|
2131
|
+
Tt as U,
|
|
2132
|
+
Wn as V,
|
|
2133
|
+
cn as _,
|
|
2134
|
+
co as a,
|
|
2135
|
+
Sn as b,
|
|
2136
|
+
Cn as c,
|
|
2137
|
+
Ke as d,
|
|
2138
|
+
Rn as e,
|
|
2139
|
+
Pt as f,
|
|
2140
|
+
Fn as g,
|
|
2141
|
+
xn as h,
|
|
2142
|
+
Mn as i,
|
|
2143
|
+
wn as j,
|
|
2144
|
+
ie as k,
|
|
2145
|
+
Dn as l,
|
|
2146
|
+
$t as m,
|
|
2147
|
+
Nn as n,
|
|
2148
|
+
Et as o,
|
|
2149
|
+
yn as p,
|
|
2150
|
+
lo as q,
|
|
2151
|
+
Ln as r,
|
|
2152
|
+
ve as u,
|
|
2153
|
+
kn as x,
|
|
2154
|
+
_n as y,
|
|
2155
|
+
Pn as z
|
|
2016
2156
|
};
|
|
2017
|
-
//# sourceMappingURL=index-
|
|
2157
|
+
//# sourceMappingURL=index-BA-bP8P6.mjs.map
|