@eternalheart/react-file-preview 1.3.9 → 1.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/README.zh-CN.md +10 -0
- package/lib/FilePreviewContent.d.ts.map +1 -1
- package/lib/chunks/{index-B-H9HQiI.mjs → index-B0JUZ5rS.mjs} +10 -10
- package/lib/chunks/{index-B-H9HQiI.mjs.map → index-B0JUZ5rS.mjs.map} +1 -1
- package/lib/chunks/{index-r3q2xCCI.mjs → index-BAYc4aBz.mjs} +2 -2
- package/lib/chunks/{index-r3q2xCCI.mjs.map → index-BAYc4aBz.mjs.map} +1 -1
- package/lib/chunks/{index-BNUiNUWa.mjs → index-BOQJNL71.mjs} +2 -2
- package/lib/chunks/{index-BNUiNUWa.mjs.map → index-BOQJNL71.mjs.map} +1 -1
- package/lib/chunks/{index-BdYkTSTt.mjs → index-BkU8rK-0.mjs} +3 -3
- package/lib/chunks/{index-BdYkTSTt.mjs.map → index-BkU8rK-0.mjs.map} +1 -1
- package/lib/chunks/{index-CgV8T0G5.mjs → index-BnDoXBnH.mjs} +2 -2
- package/lib/chunks/{index-CgV8T0G5.mjs.map → index-BnDoXBnH.mjs.map} +1 -1
- package/lib/chunks/index-C5YHI0Zs.mjs +160 -0
- package/lib/chunks/index-C5YHI0Zs.mjs.map +1 -0
- package/lib/chunks/{index-Bv93wiEK.mjs → index-CGNWXFy3.mjs} +716 -666
- package/lib/chunks/index-CGNWXFy3.mjs.map +1 -0
- package/lib/chunks/{index-DdOEWhrk.mjs → index-CwmZQ-JO.mjs} +16 -16
- package/lib/chunks/{index-DdOEWhrk.mjs.map → index-CwmZQ-JO.mjs.map} +1 -1
- package/lib/chunks/{index-CKirCT35.mjs → index-CzflrElZ.mjs} +5 -5
- package/lib/chunks/{index-CKirCT35.mjs.map → index-CzflrElZ.mjs.map} +1 -1
- package/lib/chunks/{index-D8GtNeDn.mjs → index-CztCCF7q.mjs} +2 -2
- package/lib/chunks/{index-D8GtNeDn.mjs.map → index-CztCCF7q.mjs.map} +1 -1
- package/lib/chunks/{index-BGeyzo6u.mjs → index-DKEcGewg.mjs} +2 -2
- package/lib/chunks/{index-BGeyzo6u.mjs.map → index-DKEcGewg.mjs.map} +1 -1
- package/lib/chunks/{index-DV5Jd7Qe.mjs → index-DN8BQIqo.mjs} +2 -2
- package/lib/chunks/{index-DV5Jd7Qe.mjs.map → index-DN8BQIqo.mjs.map} +1 -1
- package/lib/chunks/{index-zEVVgWCH.mjs → index-DPpUj8Yy.mjs} +2 -2
- package/lib/chunks/{index-zEVVgWCH.mjs.map → index-DPpUj8Yy.mjs.map} +1 -1
- package/lib/chunks/{index-BSD3w5eG.mjs → index-DSAXdrgU.mjs} +2 -2
- package/lib/chunks/{index-BSD3w5eG.mjs.map → index-DSAXdrgU.mjs.map} +1 -1
- package/lib/chunks/{index-DGuiWJr7.mjs → index-DveR0rOk.mjs} +15 -15
- package/lib/chunks/{index-DGuiWJr7.mjs.map → index-DveR0rOk.mjs.map} +1 -1
- package/lib/chunks/{index-BqEuP_8r.mjs → index-QfO-sASN.mjs} +2 -2
- package/lib/chunks/{index-BqEuP_8r.mjs.map → index-QfO-sASN.mjs.map} +1 -1
- package/lib/chunks/{index-BcBe6KW7.mjs → index-h9bO9wmq.mjs} +4 -4
- package/lib/chunks/{index-BcBe6KW7.mjs.map → index-h9bO9wmq.mjs.map} +1 -1
- package/lib/chunks/index-mvSVNKlQ.mjs +228 -0
- package/lib/chunks/index-mvSVNKlQ.mjs.map +1 -0
- package/lib/chunks/{index-U3w45GW8.mjs → index-tecGXW2S.mjs} +43 -43
- package/lib/chunks/{index-U3w45GW8.mjs.map → index-tecGXW2S.mjs.map} +1 -1
- package/lib/chunks/{useShikiHighlight-DzEAK0S7.mjs → useShikiHighlight-DHFYu0BU.mjs} +3 -3
- package/lib/chunks/{useShikiHighlight-DzEAK0S7.mjs.map → useShikiHighlight-DHFYu0BU.mjs.map} +1 -1
- package/lib/index.cjs +22 -18
- package/lib/index.cjs.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.mjs +13 -12
- package/lib/renderers/Font/index.d.ts +6 -0
- package/lib/renderers/Font/index.d.ts.map +1 -0
- package/lib/renderers/Pdf/index.d.ts +0 -1
- package/lib/renderers/Pdf/index.d.ts.map +1 -1
- package/lib/renderers/lazy.d.ts +2 -0
- package/lib/renderers/lazy.d.ts.map +1 -1
- package/lib/utils/pdfConfig.d.ts +2 -2
- package/lib/utils/pdfConfig.d.ts.map +1 -1
- package/package.json +3 -2
- package/lib/chunks/index-Bv93wiEK.mjs.map +0 -1
- package/lib/chunks/index-DmepcY31.mjs +0 -96
- package/lib/chunks/index-DmepcY31.mjs.map +0 -1
|
@@ -1,13 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { motion as
|
|
5
|
-
import { ZoomOut as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const Ae = "1.3.
|
|
1
|
+
import { jsx as s, jsxs as z, Fragment as Me } from "react/jsx-runtime";
|
|
2
|
+
import Te, { createContext as lt, useContext as X, useMemo as B, useState as y, useRef as H, useEffect as S, lazy as R, useCallback as P, Suspense as Pe } from "react";
|
|
3
|
+
import { createPortal as ze } from "react-dom";
|
|
4
|
+
import { motion as tt, AnimatePresence as je } from "framer-motion";
|
|
5
|
+
import { ZoomOut as Zt, ZoomIn as At, Scan as Ee, RotateCcw as Le, RotateCw as Se, RefreshCw as Ut, List as It, ChevronLeft as pt, ChevronRight as ft, Minimize2 as Vt, Maximize2 as Ht, WrapText as We, Code as Bt, Eye as qt, FileQuestion as $e, Download as Gt, X as De } from "lucide-react";
|
|
6
|
+
import Oe from "jszip";
|
|
7
|
+
import * as Ze from "pdfjs-dist/build/pdf.mjs";
|
|
8
|
+
const Ae = "1.3.10", Ue = {
|
|
9
9
|
version: Ae
|
|
10
|
-
}
|
|
10
|
+
}, fo = [
|
|
11
|
+
"image",
|
|
12
|
+
"pdf",
|
|
13
|
+
"docx",
|
|
14
|
+
"xlsx",
|
|
15
|
+
"pptx",
|
|
16
|
+
"msg",
|
|
17
|
+
"epub",
|
|
18
|
+
"mobi",
|
|
19
|
+
"video",
|
|
20
|
+
"audio",
|
|
21
|
+
"markdown",
|
|
22
|
+
"json",
|
|
23
|
+
"csv",
|
|
24
|
+
"xml",
|
|
25
|
+
"subtitle",
|
|
26
|
+
"zip",
|
|
27
|
+
"text",
|
|
28
|
+
"font"
|
|
29
|
+
];
|
|
11
30
|
function Ie(t) {
|
|
12
31
|
try {
|
|
13
32
|
const e = new URL(t).pathname.split("/").pop() || "file";
|
|
@@ -17,7 +36,7 @@ function Ie(t) {
|
|
|
17
36
|
return decodeURIComponent(e);
|
|
18
37
|
}
|
|
19
38
|
}
|
|
20
|
-
function
|
|
39
|
+
function nt(t) {
|
|
21
40
|
var e;
|
|
22
41
|
const r = ((e = t.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "";
|
|
23
42
|
return {
|
|
@@ -94,13 +113,13 @@ function at(t) {
|
|
|
94
113
|
zip: "application/zip"
|
|
95
114
|
}[r] || "application/octet-stream";
|
|
96
115
|
}
|
|
97
|
-
function
|
|
116
|
+
function Ve(t, e = 0) {
|
|
98
117
|
if (t instanceof File)
|
|
99
118
|
return {
|
|
100
119
|
id: `file-${Date.now()}-${e}`,
|
|
101
120
|
name: t.name,
|
|
102
121
|
url: URL.createObjectURL(t),
|
|
103
|
-
type: t.type ||
|
|
122
|
+
type: t.type || nt(t.name),
|
|
104
123
|
size: t.size
|
|
105
124
|
};
|
|
106
125
|
if (typeof t == "string") {
|
|
@@ -109,54 +128,56 @@ function He(t, e = 0) {
|
|
|
109
128
|
id: `url-${Date.now()}-${e}`,
|
|
110
129
|
name: r,
|
|
111
130
|
url: t,
|
|
112
|
-
type:
|
|
131
|
+
type: nt(r)
|
|
113
132
|
};
|
|
114
133
|
}
|
|
115
134
|
return {
|
|
116
135
|
id: t.id || `link-${Date.now()}-${e}`,
|
|
117
136
|
name: t.name,
|
|
118
137
|
url: t.url,
|
|
119
|
-
type: t.type ||
|
|
138
|
+
type: t.type || nt(t.name),
|
|
120
139
|
size: t.size
|
|
121
140
|
};
|
|
122
141
|
}
|
|
123
|
-
function
|
|
124
|
-
return t.map((e, r) =>
|
|
142
|
+
function He(t) {
|
|
143
|
+
return t.map((e, r) => Ve(e, r));
|
|
125
144
|
}
|
|
126
145
|
function Be(t) {
|
|
127
146
|
var e;
|
|
128
|
-
const r = ((e = t.name.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "",
|
|
129
|
-
if (
|
|
147
|
+
const r = ((e = t.name.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "", o = t.type.toLowerCase();
|
|
148
|
+
if (o.startsWith("image/") || ["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(r))
|
|
130
149
|
return "image";
|
|
131
|
-
if (
|
|
150
|
+
if (o.includes("pdf") || r === "pdf")
|
|
132
151
|
return "pdf";
|
|
133
|
-
if (
|
|
152
|
+
if (o.includes("wordprocessingml") || r === "docx")
|
|
134
153
|
return "docx";
|
|
135
|
-
if (
|
|
154
|
+
if (o.includes("spreadsheetml") || r === "xlsx")
|
|
136
155
|
return "xlsx";
|
|
137
|
-
if (
|
|
156
|
+
if (o.includes("presentationml") || r === "pptx" || r === "ppt")
|
|
138
157
|
return "pptx";
|
|
139
|
-
if (
|
|
158
|
+
if (o.includes("ms-outlook") || r === "msg")
|
|
140
159
|
return "msg";
|
|
141
|
-
if (
|
|
160
|
+
if (o.includes("epub") || r === "epub")
|
|
142
161
|
return "epub";
|
|
143
|
-
if (["mobi", "azw", "azw3", "kf8"].includes(r) ||
|
|
162
|
+
if (["mobi", "azw", "azw3", "kf8"].includes(r) || o === "application/x-mobipocket-ebook" || o === "application/vnd.amazon.ebook")
|
|
144
163
|
return "mobi";
|
|
145
|
-
if (["csv", "tsv"].includes(r) ||
|
|
164
|
+
if (["csv", "tsv"].includes(r) || o === "text/csv" || o === "text/tab-separated-values")
|
|
146
165
|
return "csv";
|
|
147
|
-
if (r === "xml" ||
|
|
166
|
+
if (r === "xml" || o === "application/xml" || o === "text/xml")
|
|
148
167
|
return "xml";
|
|
149
|
-
if (["srt", "vtt", "lrc", "elrc", "ass", "ssa", "ttml", "dfxp"].includes(r) ||
|
|
168
|
+
if (["srt", "vtt", "lrc", "elrc", "ass", "ssa", "ttml", "dfxp"].includes(r) || o === "text/vtt" || o === "application/x-subrip" || o === "application/ttml+xml")
|
|
150
169
|
return "subtitle";
|
|
151
|
-
if (r === "zip" ||
|
|
170
|
+
if (r === "zip" || o === "application/zip" || o === "application/x-zip-compressed")
|
|
152
171
|
return "zip";
|
|
153
|
-
if (
|
|
172
|
+
if (["ttf", "otf", "woff", "woff2"].includes(r) || o.startsWith("font/") || o === "application/font-woff" || o === "application/font-woff2" || o === "application/x-font-ttf" || o === "application/x-font-otf" || o === "application/font-sfnt")
|
|
173
|
+
return "font";
|
|
174
|
+
if (o.startsWith("video/") || ["mp4", "webm", "ogg", "ogv", "mov", "avi", "mkv", "m4v", "3gp", "flv"].includes(r))
|
|
154
175
|
return "video";
|
|
155
|
-
if (
|
|
176
|
+
if (o.startsWith("audio/") || ["mp3", "wav", "ogg", "m4a", "flac", "aac"].includes(r))
|
|
156
177
|
return "audio";
|
|
157
178
|
if (r === "md" || r === "markdown")
|
|
158
179
|
return "markdown";
|
|
159
|
-
if (
|
|
180
|
+
if (o === "application/json" || r === "json")
|
|
160
181
|
return "json";
|
|
161
182
|
const a = [
|
|
162
183
|
"txt",
|
|
@@ -199,7 +220,7 @@ function Be(t) {
|
|
|
199
220
|
"zsh",
|
|
200
221
|
"sql"
|
|
201
222
|
];
|
|
202
|
-
return
|
|
223
|
+
return o.startsWith("text/") || a.includes(r) ? "text" : "unsupported";
|
|
203
224
|
}
|
|
204
225
|
function co(t) {
|
|
205
226
|
var e;
|
|
@@ -251,66 +272,66 @@ function co(t) {
|
|
|
251
272
|
function qe(t) {
|
|
252
273
|
return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
|
|
253
274
|
}
|
|
254
|
-
function
|
|
275
|
+
function uo(t) {
|
|
255
276
|
var e;
|
|
256
277
|
return (((e = t.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "") === "tsv" ? " " : ",";
|
|
257
278
|
}
|
|
258
|
-
function
|
|
259
|
-
const r = e.delimiter ?? ",",
|
|
260
|
-
let
|
|
261
|
-
const
|
|
262
|
-
for (; p <
|
|
279
|
+
function mo(t, e = {}) {
|
|
280
|
+
const r = e.delimiter ?? ",", o = e.firstRowAsHeader ?? !0, a = [];
|
|
281
|
+
let n = [], i = "", l = !1, p = 0;
|
|
282
|
+
const f = t.length;
|
|
283
|
+
for (; p < f; ) {
|
|
263
284
|
const u = t[p];
|
|
264
|
-
if (
|
|
285
|
+
if (l) {
|
|
265
286
|
if (u === '"') {
|
|
266
287
|
if (t[p + 1] === '"') {
|
|
267
288
|
i += '"', p += 2;
|
|
268
289
|
continue;
|
|
269
290
|
}
|
|
270
|
-
|
|
291
|
+
l = !1, p += 1;
|
|
271
292
|
continue;
|
|
272
293
|
}
|
|
273
294
|
i += u, p += 1;
|
|
274
295
|
continue;
|
|
275
296
|
}
|
|
276
297
|
if (u === '"') {
|
|
277
|
-
|
|
298
|
+
l = !0, p += 1;
|
|
278
299
|
continue;
|
|
279
300
|
}
|
|
280
301
|
if (u === r) {
|
|
281
|
-
|
|
302
|
+
n.push(i), i = "", p += 1;
|
|
282
303
|
continue;
|
|
283
304
|
}
|
|
284
305
|
if (u === "\r") {
|
|
285
306
|
t[p + 1] === `
|
|
286
|
-
` && (p += 1),
|
|
307
|
+
` && (p += 1), n.push(i), a.push(n), n = [], i = "", p += 1;
|
|
287
308
|
continue;
|
|
288
309
|
}
|
|
289
310
|
if (u === `
|
|
290
311
|
`) {
|
|
291
|
-
|
|
312
|
+
n.push(i), a.push(n), n = [], i = "", p += 1;
|
|
292
313
|
continue;
|
|
293
314
|
}
|
|
294
315
|
i += u, p += 1;
|
|
295
316
|
}
|
|
296
|
-
for ((i.length > 0 ||
|
|
317
|
+
for ((i.length > 0 || n.length > 0) && (n.push(i), a.push(n)); a.length > 0; ) {
|
|
297
318
|
const u = a[a.length - 1];
|
|
298
319
|
if (u.length === 1 && u[0] === "")
|
|
299
320
|
a.pop();
|
|
300
321
|
else
|
|
301
322
|
break;
|
|
302
323
|
}
|
|
303
|
-
let
|
|
304
|
-
|
|
324
|
+
let c = [], d = a;
|
|
325
|
+
o && a.length > 0 && (c = a[0], d = a.slice(1));
|
|
305
326
|
const h = Math.max(
|
|
306
|
-
|
|
327
|
+
c.length,
|
|
307
328
|
...d.map((u) => u.length),
|
|
308
329
|
0
|
|
309
330
|
);
|
|
310
331
|
for (const u of d)
|
|
311
332
|
for (; u.length < h; ) u.push("");
|
|
312
333
|
return {
|
|
313
|
-
header:
|
|
334
|
+
header: c,
|
|
314
335
|
rows: d,
|
|
315
336
|
columnCount: h,
|
|
316
337
|
delimiter: r
|
|
@@ -334,10 +355,10 @@ function Ge(t) {
|
|
|
334
355
|
}
|
|
335
356
|
return new TextDecoder("utf-8", { fatal: !1 }).decode(e);
|
|
336
357
|
}
|
|
337
|
-
async function
|
|
338
|
-
const r = !!e && ("fetcher" in e || "init" in e),
|
|
339
|
-
if (!
|
|
340
|
-
const i = await
|
|
358
|
+
async function ho(t, e) {
|
|
359
|
+
const r = !!e && ("fetcher" in e || "init" in e), o = r ? e.fetcher ?? fetch : fetch, a = r ? e.init : e, n = await o(t, a);
|
|
360
|
+
if (!n.ok) throw new Error(`请求失败: ${n.status}`);
|
|
361
|
+
const i = await n.arrayBuffer();
|
|
341
362
|
return Ge(i);
|
|
342
363
|
}
|
|
343
364
|
async function Xe(t, e) {
|
|
@@ -349,8 +370,8 @@ function Je(t, e) {
|
|
|
349
370
|
if (!t) return e;
|
|
350
371
|
if (!e) return t;
|
|
351
372
|
const r = new Headers(t.headers || {});
|
|
352
|
-
return e.headers && new Headers(e.headers).forEach((
|
|
353
|
-
r.set(a,
|
|
373
|
+
return e.headers && new Headers(e.headers).forEach((o, a) => {
|
|
374
|
+
r.set(a, o);
|
|
354
375
|
}), {
|
|
355
376
|
...t,
|
|
356
377
|
...e,
|
|
@@ -358,221 +379,221 @@ function Je(t, e) {
|
|
|
358
379
|
};
|
|
359
380
|
}
|
|
360
381
|
function Ke(t) {
|
|
361
|
-
const e = (t == null ? void 0 : t.requestHandler) ?? ((
|
|
362
|
-
return async (
|
|
363
|
-
const
|
|
364
|
-
return e(
|
|
382
|
+
const e = (t == null ? void 0 : t.requestHandler) ?? ((o, a) => fetch(o, a)), r = t == null ? void 0 : t.requestInit;
|
|
383
|
+
return async (o, a) => {
|
|
384
|
+
const n = await Xe(r, o), i = Je(n, a);
|
|
385
|
+
return e(o, i);
|
|
365
386
|
};
|
|
366
387
|
}
|
|
367
388
|
async function Ye(t, e = fetch, r) {
|
|
368
|
-
const
|
|
369
|
-
if (!
|
|
370
|
-
const a = await
|
|
389
|
+
const o = await e(t, r);
|
|
390
|
+
if (!o.ok) throw new Error(`请求失败: ${o.status}`);
|
|
391
|
+
const a = await o.blob();
|
|
371
392
|
return URL.createObjectURL(a);
|
|
372
393
|
}
|
|
373
|
-
async function Qe(t, e, r = fetch,
|
|
374
|
-
const a = await r(t,
|
|
394
|
+
async function Qe(t, e, r = fetch, o) {
|
|
395
|
+
const a = await r(t, o);
|
|
375
396
|
if (!a.ok) throw new Error(`请求失败: ${a.status}`);
|
|
376
|
-
const
|
|
397
|
+
const n = await a.blob(), i = URL.createObjectURL(n);
|
|
377
398
|
try {
|
|
378
|
-
const
|
|
379
|
-
|
|
399
|
+
const l = document.createElement("a");
|
|
400
|
+
l.href = i, l.download = e, l.style.display = "none", document.body.appendChild(l), l.click(), document.body.removeChild(l);
|
|
380
401
|
} finally {
|
|
381
402
|
setTimeout(() => URL.revokeObjectURL(i), 1e3);
|
|
382
403
|
}
|
|
383
404
|
}
|
|
384
|
-
function
|
|
385
|
-
const e = t.trim().replace(",", "."), r = e.split(":").map((
|
|
405
|
+
function Et(t) {
|
|
406
|
+
const e = t.trim().replace(",", "."), r = e.split(":").map((o) => o.trim());
|
|
386
407
|
if (r.length === 3) {
|
|
387
|
-
const [
|
|
388
|
-
return Number(
|
|
408
|
+
const [o, a, n] = r;
|
|
409
|
+
return Number(o) * 3600 + Number(a) * 60 + Number(n);
|
|
389
410
|
}
|
|
390
411
|
if (r.length === 2) {
|
|
391
|
-
const [
|
|
392
|
-
return Number(
|
|
412
|
+
const [o, a] = r;
|
|
413
|
+
return Number(o) * 60 + Number(a);
|
|
393
414
|
}
|
|
394
415
|
return Number(e) || 0;
|
|
395
416
|
}
|
|
396
|
-
function
|
|
417
|
+
function bo(t) {
|
|
397
418
|
if (!isFinite(t) || t < 0) return "00:00:00.000";
|
|
398
|
-
const e = Math.floor(t * 1e3), r = e % 1e3,
|
|
399
|
-
return `${i(
|
|
419
|
+
const e = Math.floor(t * 1e3), r = e % 1e3, o = Math.floor(e / 1e3) % 60, a = Math.floor(e / 6e4) % 60, n = Math.floor(e / 36e5), i = (l, p = 2) => l.toString().padStart(p, "0");
|
|
420
|
+
return `${i(n)}:${i(a)}:${i(o)}.${i(r, 3)}`;
|
|
400
421
|
}
|
|
401
422
|
const Lt = /(\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}/, tr = /^\s*\[\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?\]/;
|
|
402
423
|
function er(t) {
|
|
403
424
|
const e = t.replace(/^\uFEFF/, "").trimStart();
|
|
404
425
|
return /^WEBVTT/.test(e) ? "vtt" : /^<\?xml/i.test(e) || /<tt\b[^>]*>/i.test(e) ? "ttml" : /^\[Script Info\]/im.test(e) || /^Dialogue:/m.test(e) ? /ScriptType:\s*v4\.00\s*$/im.test(e) ? "ssa" : "ass" : tr.test(e) || /^\[(ti|ar|al|au|by|length|offset|re|ve):/im.test(e) ? /<\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?>/.test(e) ? "elrc" : "lrc" : "srt";
|
|
405
426
|
}
|
|
406
|
-
function
|
|
427
|
+
function St(t, e) {
|
|
407
428
|
const r = t.replace(/\r\n?/g, `
|
|
408
429
|
`).replace(/^\uFEFF/, "").split(`
|
|
409
|
-
`),
|
|
410
|
-
let a,
|
|
430
|
+
`), o = [];
|
|
431
|
+
let a, n = 0;
|
|
411
432
|
if (e === "vtt") {
|
|
412
433
|
const i = [];
|
|
413
|
-
for (;
|
|
414
|
-
i.push(r[
|
|
434
|
+
for (; n < r.length && r[n].trim() !== ""; )
|
|
435
|
+
i.push(r[n]), n++;
|
|
415
436
|
for (a = i.join(`
|
|
416
|
-
`);
|
|
437
|
+
`); n < r.length && r[n].trim() === ""; ) n++;
|
|
417
438
|
}
|
|
418
|
-
for (;
|
|
419
|
-
for (;
|
|
420
|
-
if (
|
|
421
|
-
let i,
|
|
422
|
-
if (Lt.test(r[
|
|
423
|
-
|
|
424
|
-
else if (i = r[
|
|
425
|
-
|
|
439
|
+
for (; n < r.length; ) {
|
|
440
|
+
for (; n < r.length && r[n].trim() === ""; ) n++;
|
|
441
|
+
if (n >= r.length) break;
|
|
442
|
+
let i, l = null;
|
|
443
|
+
if (Lt.test(r[n]))
|
|
444
|
+
l = r[n], n++;
|
|
445
|
+
else if (i = r[n].trim() || void 0, n++, n < r.length && Lt.test(r[n]))
|
|
446
|
+
l = r[n], n++;
|
|
426
447
|
else
|
|
427
448
|
continue;
|
|
428
|
-
if (!
|
|
429
|
-
const p =
|
|
449
|
+
if (!l) continue;
|
|
450
|
+
const p = l.match(/([\d:.,]+)\s*-->\s*([\d:.,]+)/);
|
|
430
451
|
if (!p) continue;
|
|
431
|
-
const
|
|
432
|
-
for (;
|
|
433
|
-
d.push(r[
|
|
434
|
-
|
|
452
|
+
const f = Et(p[1]), c = Et(p[2]), d = [];
|
|
453
|
+
for (; n < r.length && r[n].trim() !== ""; )
|
|
454
|
+
d.push(r[n]), n++;
|
|
455
|
+
o.push({ id: i, start: f, end: c, text: d.join(`
|
|
435
456
|
`) });
|
|
436
457
|
}
|
|
437
|
-
return { format: e, cues:
|
|
458
|
+
return { format: e, cues: o, header: a };
|
|
438
459
|
}
|
|
439
|
-
function
|
|
440
|
-
const
|
|
441
|
-
let
|
|
460
|
+
function st(t, e, r) {
|
|
461
|
+
const o = Number(t), a = Number(e);
|
|
462
|
+
let n = 0;
|
|
442
463
|
if (r) {
|
|
443
464
|
const i = (r + "000").slice(0, 3);
|
|
444
|
-
|
|
465
|
+
n = Number(i);
|
|
445
466
|
}
|
|
446
|
-
return
|
|
467
|
+
return o * 60 + a + n / 1e3;
|
|
447
468
|
}
|
|
448
|
-
function
|
|
469
|
+
function Xt(t, e) {
|
|
449
470
|
const r = /^\[(ti|ar|al|au|by|length|offset|re|ve):(.*)\]$/i.exec(t.trim());
|
|
450
471
|
if (!r) return !1;
|
|
451
|
-
const
|
|
452
|
-
if (e.metadata[
|
|
453
|
-
const
|
|
454
|
-
isNaN(
|
|
472
|
+
const o = r[1].toLowerCase(), a = r[2].trim();
|
|
473
|
+
if (e.metadata[o] = a, o === "offset") {
|
|
474
|
+
const n = Number(a);
|
|
475
|
+
isNaN(n) || (e.offsetMs = n);
|
|
455
476
|
}
|
|
456
477
|
return !0;
|
|
457
478
|
}
|
|
458
479
|
function rr(t) {
|
|
459
480
|
const e = t.replace(/\r\n?/g, `
|
|
460
481
|
`).replace(/^\uFEFF/, "").split(`
|
|
461
|
-
`), r = { metadata: {}, offsetMs: 0 },
|
|
482
|
+
`), r = { metadata: {}, offsetMs: 0 }, o = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, a = [];
|
|
462
483
|
for (const i of e) {
|
|
463
|
-
const
|
|
464
|
-
if (!
|
|
484
|
+
const l = i.trim();
|
|
485
|
+
if (!l || Xt(l, r)) continue;
|
|
465
486
|
const p = [];
|
|
466
|
-
let
|
|
467
|
-
|
|
468
|
-
let
|
|
469
|
-
for (; (
|
|
470
|
-
p.push(
|
|
487
|
+
let f = 0;
|
|
488
|
+
o.lastIndex = 0;
|
|
489
|
+
let c;
|
|
490
|
+
for (; (c = o.exec(l)) !== null && c.index === f; )
|
|
491
|
+
p.push(st(c[1], c[2], c[3])), f = c.index + c[0].length;
|
|
471
492
|
if (p.length === 0) continue;
|
|
472
|
-
const d =
|
|
493
|
+
const d = l.slice(f).trim();
|
|
473
494
|
for (const h of p)
|
|
474
495
|
a.push({ start: h, text: d });
|
|
475
496
|
}
|
|
476
|
-
a.sort((i,
|
|
477
|
-
const
|
|
478
|
-
return { format: "lrc", cues: a.map((i,
|
|
479
|
-
const p = Math.max(0, i.start -
|
|
480
|
-
return { start: p, end:
|
|
497
|
+
a.sort((i, l) => i.start - l.start);
|
|
498
|
+
const n = r.offsetMs / 1e3;
|
|
499
|
+
return { format: "lrc", cues: a.map((i, l) => {
|
|
500
|
+
const p = Math.max(0, i.start - n), f = a[l + 1], c = f ? Math.max(p, f.start - n) : p + 5;
|
|
501
|
+
return { start: p, end: c, text: i.text };
|
|
481
502
|
}), metadata: r.metadata };
|
|
482
503
|
}
|
|
483
504
|
function or(t) {
|
|
484
505
|
const e = t.replace(/\r\n?/g, `
|
|
485
506
|
`).replace(/^\uFEFF/, "").split(`
|
|
486
|
-
`), r = { metadata: {}, offsetMs: 0 },
|
|
487
|
-
for (const
|
|
488
|
-
const p =
|
|
489
|
-
if (!p ||
|
|
490
|
-
const
|
|
491
|
-
let
|
|
492
|
-
|
|
507
|
+
`), r = { metadata: {}, offsetMs: 0 }, o = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, a = /<(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?>/g, n = [];
|
|
508
|
+
for (const l of e) {
|
|
509
|
+
const p = l.trim();
|
|
510
|
+
if (!p || Xt(p, r)) continue;
|
|
511
|
+
const f = [];
|
|
512
|
+
let c = 0;
|
|
513
|
+
o.lastIndex = 0;
|
|
493
514
|
let d;
|
|
494
|
-
for (; (d =
|
|
495
|
-
|
|
496
|
-
if (
|
|
497
|
-
const h = p.slice(
|
|
498
|
-
for (const u of
|
|
499
|
-
|
|
515
|
+
for (; (d = o.exec(p)) !== null && d.index === c; )
|
|
516
|
+
f.push(st(d[1], d[2], d[3])), c = d.index + d[0].length;
|
|
517
|
+
if (f.length === 0) continue;
|
|
518
|
+
const h = p.slice(c);
|
|
519
|
+
for (const u of f)
|
|
520
|
+
n.push({ start: u, raw: h });
|
|
500
521
|
}
|
|
501
|
-
|
|
522
|
+
n.sort((l, p) => l.start - p.start);
|
|
502
523
|
const i = r.offsetMs / 1e3;
|
|
503
|
-
return { format: "elrc", cues:
|
|
504
|
-
const
|
|
505
|
-
let
|
|
524
|
+
return { format: "elrc", cues: n.map((l, p) => {
|
|
525
|
+
const f = [];
|
|
526
|
+
let c = "", d = 0, h = null;
|
|
506
527
|
a.lastIndex = 0;
|
|
507
528
|
let u;
|
|
508
|
-
for (; (u = a.exec(
|
|
509
|
-
const T =
|
|
510
|
-
h !== null && T &&
|
|
529
|
+
for (; (u = a.exec(l.raw)) !== null; ) {
|
|
530
|
+
const T = l.raw.slice(d, u.index);
|
|
531
|
+
h !== null && T && f.push({ start: Math.max(0, h - i), text: T }), c += T, h = st(u[1], u[2], u[3]), d = u.index + u[0].length;
|
|
511
532
|
}
|
|
512
|
-
const _ =
|
|
513
|
-
h !== null && _ &&
|
|
514
|
-
const M = Math.max(0,
|
|
533
|
+
const _ = l.raw.slice(d);
|
|
534
|
+
h !== null && _ && f.push({ start: Math.max(0, h - i), text: _ }), c += _;
|
|
535
|
+
const M = Math.max(0, l.start - i), x = n[p + 1], F = x ? Math.max(M, x.start - i) : M + 5;
|
|
515
536
|
return {
|
|
516
537
|
start: M,
|
|
517
538
|
end: F,
|
|
518
|
-
text:
|
|
519
|
-
words:
|
|
539
|
+
text: c.trim(),
|
|
540
|
+
words: f.length ? f : void 0
|
|
520
541
|
};
|
|
521
542
|
}), metadata: r.metadata };
|
|
522
543
|
}
|
|
523
|
-
function
|
|
544
|
+
function Wt(t) {
|
|
524
545
|
const e = t.trim().split(":");
|
|
525
546
|
return e.length !== 3 ? 0 : Number(e[0]) * 3600 + Number(e[1]) * 60 + Number(e[2].replace(",", "."));
|
|
526
547
|
}
|
|
527
|
-
function
|
|
548
|
+
function $t(t, e) {
|
|
528
549
|
const r = t.replace(/\r\n?/g, `
|
|
529
550
|
`).replace(/^\uFEFF/, "").split(`
|
|
530
551
|
`);
|
|
531
|
-
let
|
|
532
|
-
const
|
|
533
|
-
for (const
|
|
534
|
-
const p =
|
|
535
|
-
if (
|
|
536
|
-
|
|
552
|
+
let o = "", a = [];
|
|
553
|
+
const n = [], i = [];
|
|
554
|
+
for (const l of r) {
|
|
555
|
+
const p = l.replace(/\s+$/, ""), f = p.trim(), c = /^\[([^\]]+)\]\s*$/.exec(f);
|
|
556
|
+
if (c) {
|
|
557
|
+
o = c[1].toLowerCase(), i.push(p);
|
|
537
558
|
continue;
|
|
538
559
|
}
|
|
539
|
-
if (
|
|
560
|
+
if (o !== "events") {
|
|
540
561
|
i.push(p);
|
|
541
562
|
continue;
|
|
542
563
|
}
|
|
543
|
-
const d = /^Format:\s*(.+)$/i.exec(
|
|
564
|
+
const d = /^Format:\s*(.+)$/i.exec(f);
|
|
544
565
|
if (d) {
|
|
545
|
-
a = d[1].split(",").map((
|
|
566
|
+
a = d[1].split(",").map((v) => v.trim());
|
|
546
567
|
continue;
|
|
547
568
|
}
|
|
548
|
-
const h = /^(Dialogue|Comment):\s*(.+)$/i.exec(
|
|
569
|
+
const h = /^(Dialogue|Comment):\s*(.+)$/i.exec(f);
|
|
549
570
|
if (!h || h[1].toLowerCase() === "comment" || a.length === 0) continue;
|
|
550
|
-
const u = a.length, _ = h[2].split(","), M = _.slice(0, u - 1),
|
|
551
|
-
a.forEach((
|
|
552
|
-
F[
|
|
571
|
+
const u = a.length, _ = h[2].split(","), M = _.slice(0, u - 1), x = _.slice(u - 1).join(","), F = {};
|
|
572
|
+
a.forEach((v, L) => {
|
|
573
|
+
F[v] = L === u - 1 ? x : M[L] ?? "";
|
|
553
574
|
});
|
|
554
|
-
const T =
|
|
575
|
+
const T = Wt(F.Start || ""), k = Wt(F.End || ""), N = (F.Text || "").replace(/\\N/g, `
|
|
555
576
|
`).replace(/\\n/g, `
|
|
556
577
|
`).replace(/\\h/g, " ").replace(/\{[^}]*\}/g, "");
|
|
557
|
-
|
|
578
|
+
n.push({ start: T, end: k, text: N, style: F.Style });
|
|
558
579
|
}
|
|
559
|
-
return
|
|
580
|
+
return n.sort((l, p) => l.start - p.start), {
|
|
560
581
|
format: e,
|
|
561
|
-
cues:
|
|
582
|
+
cues: n,
|
|
562
583
|
header: i.join(`
|
|
563
584
|
`).trim() || void 0
|
|
564
585
|
};
|
|
565
586
|
}
|
|
566
|
-
function
|
|
587
|
+
function at(t) {
|
|
567
588
|
const e = t.trim();
|
|
568
589
|
if (!e) return 0;
|
|
569
590
|
const r = /^(\d+(?:\.\d+)?)(h|m|s|ms|f|t)$/i.exec(e);
|
|
570
591
|
if (r) {
|
|
571
|
-
const a = Number(r[1]),
|
|
572
|
-
return
|
|
592
|
+
const a = Number(r[1]), n = r[2].toLowerCase();
|
|
593
|
+
return n === "h" ? a * 3600 : n === "m" ? a * 60 : n === "ms" ? a / 1e3 : a;
|
|
573
594
|
}
|
|
574
|
-
const
|
|
575
|
-
return
|
|
595
|
+
const o = e.split(":");
|
|
596
|
+
return o.length === 3 ? Number(o[0]) * 3600 + Number(o[1]) * 60 + Number(o[2]) : o.length === 2 ? Number(o[0]) * 60 + Number(o[1]) : Number(e) || 0;
|
|
576
597
|
}
|
|
577
598
|
function nr(t) {
|
|
578
599
|
if (typeof DOMParser > "u")
|
|
@@ -580,13 +601,13 @@ function nr(t) {
|
|
|
580
601
|
const e = new DOMParser().parseFromString(t, "application/xml");
|
|
581
602
|
if (e.getElementsByTagName("parsererror").length > 0)
|
|
582
603
|
throw new Error("TTML XML parse error");
|
|
583
|
-
const r = e.getElementsByTagName("p"),
|
|
604
|
+
const r = e.getElementsByTagName("p"), o = [];
|
|
584
605
|
for (let a = 0; a < r.length; a++) {
|
|
585
|
-
const
|
|
586
|
-
let
|
|
587
|
-
|
|
606
|
+
const n = r[a], i = n.getAttribute("begin") || "", l = n.getAttribute("end") || "", p = n.getAttribute("dur") || "", f = at(i);
|
|
607
|
+
let c;
|
|
608
|
+
l ? c = at(l) : p ? c = f + at(p) : c = f + 5;
|
|
588
609
|
let d = "";
|
|
589
|
-
|
|
610
|
+
n.childNodes.forEach((u) => {
|
|
590
611
|
if (u.nodeType === 3)
|
|
591
612
|
d += u.nodeValue || "";
|
|
592
613
|
else if (u.nodeType === 1) {
|
|
@@ -597,85 +618,85 @@ function nr(t) {
|
|
|
597
618
|
});
|
|
598
619
|
const h = d.replace(/[ \t]+/g, " ").replace(/\n /g, `
|
|
599
620
|
`).trim();
|
|
600
|
-
(h ||
|
|
621
|
+
(h || f || c) && o.push({ start: f, end: c, text: h });
|
|
601
622
|
}
|
|
602
|
-
return
|
|
623
|
+
return o.sort((a, n) => a.start - n.start), { format: "ttml", cues: o };
|
|
603
624
|
}
|
|
604
|
-
function
|
|
625
|
+
function go(t, e) {
|
|
605
626
|
switch (e ?? er(t)) {
|
|
606
627
|
case "lrc":
|
|
607
628
|
return rr(t);
|
|
608
629
|
case "elrc":
|
|
609
630
|
return or(t);
|
|
610
631
|
case "ass":
|
|
611
|
-
return
|
|
632
|
+
return $t(t, "ass");
|
|
612
633
|
case "ssa":
|
|
613
|
-
return
|
|
634
|
+
return $t(t, "ssa");
|
|
614
635
|
case "ttml":
|
|
615
636
|
return nr(t);
|
|
616
637
|
case "vtt":
|
|
617
|
-
return
|
|
638
|
+
return St(t, "vtt");
|
|
618
639
|
case "srt":
|
|
619
640
|
default:
|
|
620
|
-
return
|
|
641
|
+
return St(t, "srt");
|
|
621
642
|
}
|
|
622
643
|
}
|
|
623
|
-
async function
|
|
624
|
-
return
|
|
644
|
+
async function wo(t) {
|
|
645
|
+
return Oe.loadAsync(t);
|
|
625
646
|
}
|
|
626
|
-
function
|
|
647
|
+
function xo(t) {
|
|
627
648
|
const e = [];
|
|
628
|
-
return t.forEach((r,
|
|
649
|
+
return t.forEach((r, o) => {
|
|
629
650
|
var a;
|
|
630
|
-
const
|
|
651
|
+
const n = o.dir, i = n && !r.endsWith("/") ? r + "/" : r, l = n ? i.replace(/\/$/, "") : i, p = l.lastIndexOf("/"), f = p >= 0 ? l.slice(p + 1) : l, c = p >= 0 ? l.slice(0, p) : "", d = n ? 0 : ((a = o._data) == null ? void 0 : a.uncompressedSize) ?? 0;
|
|
631
652
|
e.push({
|
|
632
653
|
path: i,
|
|
633
|
-
name:
|
|
634
|
-
dir:
|
|
635
|
-
isDir:
|
|
654
|
+
name: f,
|
|
655
|
+
dir: c,
|
|
656
|
+
isDir: n,
|
|
636
657
|
size: d,
|
|
637
|
-
date:
|
|
658
|
+
date: o.date
|
|
638
659
|
});
|
|
639
660
|
}), e;
|
|
640
661
|
}
|
|
641
662
|
function vo(t) {
|
|
642
663
|
const e = { name: "", path: "", isDir: !0, children: [], size: 0 }, r = /* @__PURE__ */ new Map();
|
|
643
664
|
r.set("", e);
|
|
644
|
-
const
|
|
645
|
-
if (r.has(
|
|
646
|
-
const i =
|
|
647
|
-
let
|
|
648
|
-
for (const
|
|
649
|
-
p = p ? `${p}/${
|
|
650
|
-
let
|
|
651
|
-
|
|
665
|
+
const o = (n) => {
|
|
666
|
+
if (r.has(n)) return r.get(n);
|
|
667
|
+
const i = n.split("/").filter(Boolean);
|
|
668
|
+
let l = e, p = "";
|
|
669
|
+
for (const f of i) {
|
|
670
|
+
p = p ? `${p}/${f}` : f;
|
|
671
|
+
let c = r.get(p);
|
|
672
|
+
c || (c = { name: f, path: p + "/", isDir: !0, children: [], size: 0 }, l.children.push(c), r.set(p, c)), l = c;
|
|
652
673
|
}
|
|
653
|
-
return
|
|
674
|
+
return l;
|
|
654
675
|
};
|
|
655
|
-
for (const
|
|
656
|
-
if (
|
|
657
|
-
n
|
|
676
|
+
for (const n of t) {
|
|
677
|
+
if (n.isDir) {
|
|
678
|
+
o(n.path.replace(/\/$/, ""));
|
|
658
679
|
continue;
|
|
659
680
|
}
|
|
660
|
-
n
|
|
661
|
-
name:
|
|
662
|
-
path:
|
|
681
|
+
o(n.dir).children.push({
|
|
682
|
+
name: n.name,
|
|
683
|
+
path: n.path,
|
|
663
684
|
isDir: !1,
|
|
664
|
-
size:
|
|
685
|
+
size: n.size
|
|
665
686
|
});
|
|
666
687
|
}
|
|
667
|
-
const a = (
|
|
668
|
-
if (
|
|
669
|
-
|
|
670
|
-
for (const i of
|
|
688
|
+
const a = (n) => {
|
|
689
|
+
if (n.children) {
|
|
690
|
+
n.children.sort((i, l) => i.isDir !== l.isDir ? i.isDir ? -1 : 1 : i.name.localeCompare(l.name));
|
|
691
|
+
for (const i of n.children) a(i);
|
|
671
692
|
}
|
|
672
693
|
};
|
|
673
694
|
return a(e), e;
|
|
674
695
|
}
|
|
675
|
-
async function
|
|
676
|
-
const
|
|
677
|
-
if (!
|
|
678
|
-
const a = await
|
|
696
|
+
async function yo(t, e, r) {
|
|
697
|
+
const o = t.file(e);
|
|
698
|
+
if (!o) throw new Error(`ZIP entry not found: ${e}`);
|
|
699
|
+
const a = await o.async("arraybuffer");
|
|
679
700
|
return new Blob([a], r ? { type: r } : void 0);
|
|
680
701
|
}
|
|
681
702
|
function ar(t) {
|
|
@@ -759,17 +780,17 @@ const ir = [
|
|
|
759
780
|
"333333"
|
|
760
781
|
];
|
|
761
782
|
function lr(t, e) {
|
|
762
|
-
const r = parseInt(t.substring(0, 2), 16),
|
|
763
|
-
return i.toString(16).padStart(2, "0") +
|
|
783
|
+
const r = parseInt(t.substring(0, 2), 16), o = parseInt(t.substring(2, 4), 16), a = parseInt(t.substring(4, 6), 16), n = (f) => e < 0 ? Math.round(f * (1 + e)) : Math.round(f + (255 - f) * e), i = Math.min(255, Math.max(0, n(r))), l = Math.min(255, Math.max(0, n(o))), p = Math.min(255, Math.max(0, n(a)));
|
|
784
|
+
return i.toString(16).padStart(2, "0") + l.toString(16).padStart(2, "0") + p.toString(16).padStart(2, "0");
|
|
764
785
|
}
|
|
765
786
|
function pr(t) {
|
|
766
787
|
if (t && t.type === "pattern" && t.pattern === "solid") {
|
|
767
788
|
const e = t.fgColor;
|
|
768
789
|
if (e)
|
|
769
|
-
return
|
|
790
|
+
return ct(e);
|
|
770
791
|
}
|
|
771
792
|
}
|
|
772
|
-
function
|
|
793
|
+
function ct(t) {
|
|
773
794
|
if (t) {
|
|
774
795
|
if ("argb" in t && typeof t.argb == "string" && t.argb)
|
|
775
796
|
return ar(t.argb);
|
|
@@ -783,36 +804,36 @@ function dt(t) {
|
|
|
783
804
|
}
|
|
784
805
|
}
|
|
785
806
|
}
|
|
786
|
-
function
|
|
807
|
+
function fr(t) {
|
|
787
808
|
if (!t || !t.style) return;
|
|
788
|
-
const e =
|
|
809
|
+
const e = ct(t.color) || "#000000";
|
|
789
810
|
return [t.style, e];
|
|
790
811
|
}
|
|
791
|
-
function
|
|
812
|
+
function cr(t) {
|
|
792
813
|
const e = {};
|
|
793
814
|
let r = !1;
|
|
794
815
|
if (t.font) {
|
|
795
816
|
const a = t.font;
|
|
796
817
|
if ((a.name || a.size || a.bold || a.italic) && (r = !0, e.font = {}, a.name && (e.font.name = a.name), a.size && (e.font.size = a.size), a.bold && (e.font.bold = !0), a.italic && (e.font.italic = !0)), a.color) {
|
|
797
|
-
const
|
|
798
|
-
|
|
818
|
+
const n = ct(a.color);
|
|
819
|
+
n && (r = !0, e.color = n);
|
|
799
820
|
}
|
|
800
821
|
a.underline && (r = !0, e.underline = !0), a.strike && (r = !0, e.strike = !0);
|
|
801
822
|
}
|
|
802
|
-
const
|
|
803
|
-
if (
|
|
823
|
+
const o = pr(t.fill);
|
|
824
|
+
if (o && (r = !0, e.bgcolor = o), t.alignment) {
|
|
804
825
|
const a = t.alignment;
|
|
805
826
|
a.horizontal && (r = !0, e.align = a.horizontal), a.vertical && (r = !0, e.valign = a.vertical), a.wrapText && (r = !0, e.textwrap = !0);
|
|
806
827
|
}
|
|
807
828
|
if (t.border) {
|
|
808
829
|
const a = {};
|
|
809
|
-
let
|
|
830
|
+
let n = !1;
|
|
810
831
|
const i = ["top", "bottom", "left", "right"];
|
|
811
|
-
for (const
|
|
812
|
-
const p =
|
|
813
|
-
p && (a[
|
|
832
|
+
for (const l of i) {
|
|
833
|
+
const p = fr(t.border[l]);
|
|
834
|
+
p && (a[l] = p, n = !0);
|
|
814
835
|
}
|
|
815
|
-
|
|
836
|
+
n && (r = !0, e.border = a);
|
|
816
837
|
}
|
|
817
838
|
return r ? e : null;
|
|
818
839
|
}
|
|
@@ -820,12 +841,12 @@ function dr(t) {
|
|
|
820
841
|
return JSON.stringify(t);
|
|
821
842
|
}
|
|
822
843
|
function ur(t, e, r) {
|
|
823
|
-
const
|
|
824
|
-
if (!
|
|
825
|
-
const a = dr(
|
|
826
|
-
if (
|
|
844
|
+
const o = cr(t);
|
|
845
|
+
if (!o) return -1;
|
|
846
|
+
const a = dr(o), n = r.get(a);
|
|
847
|
+
if (n !== void 0) return n;
|
|
827
848
|
const i = e.length;
|
|
828
|
-
return e.push(
|
|
849
|
+
return e.push(o), r.set(a, i), i;
|
|
829
850
|
}
|
|
830
851
|
function mr(t) {
|
|
831
852
|
const e = t.value;
|
|
@@ -842,76 +863,86 @@ function mr(t) {
|
|
|
842
863
|
return typeof e == "object" && "richText" in e ? e.richText.map((r) => r.text).join("") : typeof e == "object" && "hyperlink" in e ? e.text || "" : typeof e == "object" && "error" in e ? String(e.error) : String(e);
|
|
843
864
|
}
|
|
844
865
|
function hr(t) {
|
|
845
|
-
const e = t.split(":"), r =
|
|
866
|
+
const e = t.split(":"), r = Dt(e[0]), o = e[1] ? Dt(e[1]) : r;
|
|
846
867
|
return {
|
|
847
868
|
top: r.row,
|
|
848
869
|
left: r.col,
|
|
849
|
-
bottom:
|
|
850
|
-
right:
|
|
870
|
+
bottom: o.row,
|
|
871
|
+
right: o.col
|
|
851
872
|
};
|
|
852
873
|
}
|
|
853
|
-
function
|
|
874
|
+
function Dt(t) {
|
|
854
875
|
const e = t.match(/^([A-Z]+)(\d+)$/);
|
|
855
876
|
if (!e) return { row: 1, col: 1 };
|
|
856
|
-
const r = e[1],
|
|
877
|
+
const r = e[1], o = parseInt(e[2], 10);
|
|
857
878
|
let a = 0;
|
|
858
|
-
for (let
|
|
859
|
-
a = a * 26 + (r.charCodeAt(
|
|
860
|
-
return { row:
|
|
879
|
+
for (let n = 0; n < r.length; n++)
|
|
880
|
+
a = a * 26 + (r.charCodeAt(n) - 64);
|
|
881
|
+
return { row: o, col: a };
|
|
861
882
|
}
|
|
862
|
-
function
|
|
883
|
+
function Fo(t) {
|
|
863
884
|
const e = [];
|
|
864
885
|
return t.eachSheet((r) => {
|
|
865
|
-
const
|
|
886
|
+
const o = [], a = /* @__PURE__ */ new Map(), n = [], i = {}, l = {}, p = r.columnCount;
|
|
866
887
|
for (let h = 1; h <= p; h++) {
|
|
867
888
|
const u = r.getColumn(h);
|
|
868
|
-
u.width && (
|
|
889
|
+
u.width && (l[String(h - 1)] = { width: Math.round(u.width * 7.5) });
|
|
869
890
|
}
|
|
870
|
-
|
|
871
|
-
const
|
|
891
|
+
l.len = Math.max(p, 26);
|
|
892
|
+
const f = /* @__PURE__ */ new Map(), c = r.model, d = (c == null ? void 0 : c.merges) || [];
|
|
872
893
|
for (const h of d) {
|
|
873
|
-
|
|
874
|
-
const { top: u, left: _, bottom: M, right:
|
|
875
|
-
|
|
894
|
+
n.push(h);
|
|
895
|
+
const { top: u, left: _, bottom: M, right: x } = hr(h), F = M - u, T = x - _;
|
|
896
|
+
f.set(`${u - 1},${_ - 1}`, [F, T]);
|
|
876
897
|
}
|
|
877
898
|
r.eachRow({ includeEmpty: !0 }, (h, u) => {
|
|
878
899
|
const _ = u - 1, M = {};
|
|
879
900
|
h.eachCell({ includeEmpty: !1 }, (F, T) => {
|
|
880
901
|
const k = T - 1;
|
|
881
902
|
if (F.isMerged && F.master !== F) return;
|
|
882
|
-
const
|
|
883
|
-
|
|
903
|
+
const N = mr(F), v = ur(F, o, a), L = { text: N };
|
|
904
|
+
v !== -1 && (L.style = v);
|
|
884
905
|
const W = `${_},${k}`;
|
|
885
|
-
|
|
906
|
+
f.has(W) && (L.merge = f.get(W)), M[String(k)] = L;
|
|
886
907
|
});
|
|
887
|
-
const
|
|
888
|
-
h.height && (
|
|
908
|
+
const x = { cells: M };
|
|
909
|
+
h.height && (x.height = Math.round(h.height * 1.333)), i[String(_)] = x;
|
|
889
910
|
}), e.push({
|
|
890
911
|
name: r.name,
|
|
891
|
-
styles:
|
|
892
|
-
merges:
|
|
912
|
+
styles: o,
|
|
913
|
+
merges: n,
|
|
893
914
|
rows: i,
|
|
894
|
-
cols:
|
|
915
|
+
cols: l
|
|
895
916
|
});
|
|
896
917
|
}), e;
|
|
897
918
|
}
|
|
898
|
-
function
|
|
899
|
-
const
|
|
900
|
-
if (
|
|
901
|
-
const
|
|
902
|
-
t.forEach((p,
|
|
903
|
-
|
|
904
|
-
}),
|
|
919
|
+
function _o(t, e, r = "Sheet1") {
|
|
920
|
+
const o = t.length > 0, a = o ? [{ font: { bold: !0 } }] : [], n = {};
|
|
921
|
+
if (o) {
|
|
922
|
+
const l = {};
|
|
923
|
+
t.forEach((p, f) => {
|
|
924
|
+
l[String(f)] = { text: p, style: 0 };
|
|
925
|
+
}), n[0] = { cells: l };
|
|
905
926
|
}
|
|
906
|
-
const i =
|
|
907
|
-
return e.forEach((
|
|
908
|
-
const
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
}),
|
|
912
|
-
}), [{ name: r, styles: a, rows:
|
|
927
|
+
const i = o ? 1 : 0;
|
|
928
|
+
return e.forEach((l, p) => {
|
|
929
|
+
const f = {};
|
|
930
|
+
l.forEach((c, d) => {
|
|
931
|
+
c !== void 0 && c !== "" && (f[String(d)] = { text: c });
|
|
932
|
+
}), n[String(p + i)] = { cells: f };
|
|
933
|
+
}), [{ name: r, styles: a, rows: n }];
|
|
913
934
|
}
|
|
914
|
-
|
|
935
|
+
function br(t, e) {
|
|
936
|
+
var r;
|
|
937
|
+
if (typeof window > "u") return;
|
|
938
|
+
const o = (t == null ? void 0 : t.version) || ((r = t == null ? void 0 : t.GlobalWorkerOptions) == null ? void 0 : r.version) || "", {
|
|
939
|
+
workerSrc: a = `https://unpkg.com/pdfjs-dist@${o}/build/pdf.worker.min.mjs`,
|
|
940
|
+
cMapUrl: n = `https://unpkg.com/pdfjs-dist@${o}/cmaps/`,
|
|
941
|
+
cMapPacked: i = !0
|
|
942
|
+
} = e || {};
|
|
943
|
+
t.GlobalWorkerOptions && (t.GlobalWorkerOptions.workerSrc = a, t.GlobalWorkerOptions.cMapUrl = n, t.GlobalWorkerOptions.cMapPacked = i);
|
|
944
|
+
}
|
|
945
|
+
const gr = {
|
|
915
946
|
// ─────── common ───────
|
|
916
947
|
"common.download": "下载",
|
|
917
948
|
"common.close": "关闭",
|
|
@@ -1009,8 +1040,19 @@ const br = {
|
|
|
1009
1040
|
"zip.load_failed": "ZIP 文件加载失败",
|
|
1010
1041
|
"zip.parse_failed": "ZIP 解析失败",
|
|
1011
1042
|
// ─────── text ───────
|
|
1012
|
-
"text.load_failed": "文本文件加载失败"
|
|
1013
|
-
|
|
1043
|
+
"text.load_failed": "文本文件加载失败",
|
|
1044
|
+
// ─────── font ───────
|
|
1045
|
+
"font.loading": "加载字体中...",
|
|
1046
|
+
"font.load_failed": "字体文件加载失败",
|
|
1047
|
+
"font.parse_failed": "字体解析失败",
|
|
1048
|
+
"font.meta.family": "字体家族",
|
|
1049
|
+
"font.meta.subfamily": "子系列",
|
|
1050
|
+
"font.meta.version": "版本",
|
|
1051
|
+
"font.meta.designer": "设计师",
|
|
1052
|
+
"font.meta.glyphs": "字形数量",
|
|
1053
|
+
"font.meta.format": "格式",
|
|
1054
|
+
"font.sample_text_placeholder": "输入自定义文本..."
|
|
1055
|
+
}, wr = {
|
|
1014
1056
|
// ─────── common ───────
|
|
1015
1057
|
"common.download": "Download",
|
|
1016
1058
|
"common.close": "Close",
|
|
@@ -1108,53 +1150,64 @@ const br = {
|
|
|
1108
1150
|
"zip.load_failed": "Failed to load ZIP",
|
|
1109
1151
|
"zip.parse_failed": "Failed to parse ZIP",
|
|
1110
1152
|
// ─────── text ───────
|
|
1111
|
-
"text.load_failed": "Failed to load text file"
|
|
1112
|
-
|
|
1113
|
-
"
|
|
1114
|
-
"
|
|
1115
|
-
|
|
1153
|
+
"text.load_failed": "Failed to load text file",
|
|
1154
|
+
// ─────── font ───────
|
|
1155
|
+
"font.loading": "Loading font...",
|
|
1156
|
+
"font.load_failed": "Failed to load font",
|
|
1157
|
+
"font.parse_failed": "Failed to parse font",
|
|
1158
|
+
"font.meta.family": "Family",
|
|
1159
|
+
"font.meta.subfamily": "Subfamily",
|
|
1160
|
+
"font.meta.version": "Version",
|
|
1161
|
+
"font.meta.designer": "Designer",
|
|
1162
|
+
"font.meta.glyphs": "Glyphs",
|
|
1163
|
+
"font.meta.format": "Format",
|
|
1164
|
+
"font.sample_text_placeholder": "Type custom text..."
|
|
1165
|
+
}, Q = {
|
|
1166
|
+
"zh-CN": gr,
|
|
1167
|
+
"en-US": wr
|
|
1168
|
+
}, xr = /\{(\w+)\}/g;
|
|
1116
1169
|
function vr(t, e) {
|
|
1117
|
-
return e ? t.replace(
|
|
1118
|
-
const a = e[
|
|
1119
|
-
return a === void 0 ? `{${
|
|
1170
|
+
return e ? t.replace(xr, (r, o) => {
|
|
1171
|
+
const a = e[o];
|
|
1172
|
+
return a === void 0 ? `{${o}}` : String(a);
|
|
1120
1173
|
}) : t;
|
|
1121
1174
|
}
|
|
1122
|
-
function
|
|
1175
|
+
function dt(t) {
|
|
1123
1176
|
var e;
|
|
1124
|
-
const r = t.fallbackLocale ?? "zh-CN",
|
|
1125
|
-
return (
|
|
1126
|
-
const
|
|
1127
|
-
return vr(
|
|
1177
|
+
const r = t.fallbackLocale ?? "zh-CN", o = Q[t.locale] ?? Q[r] ?? Q["zh-CN"], a = (e = t.messages) == null ? void 0 : e[t.locale], n = a ? { ...o, ...a } : o, i = Q["zh-CN"];
|
|
1178
|
+
return (l, p) => {
|
|
1179
|
+
const f = n[l] ?? i[l] ?? l;
|
|
1180
|
+
return vr(f, p);
|
|
1128
1181
|
};
|
|
1129
1182
|
}
|
|
1130
|
-
const
|
|
1183
|
+
const ut = lt(null), yr = ({
|
|
1131
1184
|
locale: t = "zh-CN",
|
|
1132
1185
|
messages: e,
|
|
1133
1186
|
children: r
|
|
1134
1187
|
}) => {
|
|
1135
|
-
const
|
|
1136
|
-
const a =
|
|
1188
|
+
const o = B(() => {
|
|
1189
|
+
const a = dt({ locale: t, messages: e });
|
|
1137
1190
|
return { locale: t, t: a };
|
|
1138
1191
|
}, [t, e]);
|
|
1139
|
-
return /* @__PURE__ */
|
|
1192
|
+
return /* @__PURE__ */ s(ut.Provider, { value: o, children: r });
|
|
1140
1193
|
};
|
|
1141
|
-
let
|
|
1142
|
-
function
|
|
1143
|
-
return
|
|
1194
|
+
let it = null;
|
|
1195
|
+
function Fr() {
|
|
1196
|
+
return it || (it = dt({ locale: "zh-CN" })), it;
|
|
1144
1197
|
}
|
|
1145
|
-
function
|
|
1146
|
-
const t =
|
|
1147
|
-
return (t == null ? void 0 : t.t) ??
|
|
1198
|
+
function Jt() {
|
|
1199
|
+
const t = X(ut);
|
|
1200
|
+
return (t == null ? void 0 : t.t) ?? Fr();
|
|
1148
1201
|
}
|
|
1149
|
-
function
|
|
1150
|
-
const t =
|
|
1202
|
+
function ko() {
|
|
1203
|
+
const t = X(ut);
|
|
1151
1204
|
return (t == null ? void 0 : t.locale) ?? "zh-CN";
|
|
1152
1205
|
}
|
|
1153
|
-
const
|
|
1154
|
-
function
|
|
1155
|
-
return
|
|
1206
|
+
const Kt = lt(null), _r = ({ theme: t, children: e }) => /* @__PURE__ */ s(Kt.Provider, { value: t, children: e });
|
|
1207
|
+
function Co() {
|
|
1208
|
+
return X(Kt) ?? "dark";
|
|
1156
1209
|
}
|
|
1157
|
-
const
|
|
1210
|
+
const kr = ({ className: t }) => /* @__PURE__ */ s(
|
|
1158
1211
|
"svg",
|
|
1159
1212
|
{
|
|
1160
1213
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1165,49 +1218,49 @@ const _r = ({ className: t }) => /* @__PURE__ */ l(
|
|
|
1165
1218
|
strokeLinecap: "round",
|
|
1166
1219
|
strokeLinejoin: "round",
|
|
1167
1220
|
className: t,
|
|
1168
|
-
children: /* @__PURE__ */
|
|
1221
|
+
children: /* @__PURE__ */ s("text", { x: "12", y: "17.5", textAnchor: "middle", fontSize: "20", fontWeight: "bold", fill: "currentColor", stroke: "none", children: "1:1" })
|
|
1169
1222
|
}
|
|
1170
1223
|
);
|
|
1171
|
-
function
|
|
1224
|
+
function Cr(t) {
|
|
1172
1225
|
return [
|
|
1173
1226
|
{
|
|
1174
1227
|
items: [
|
|
1175
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1228
|
+
{ type: "button", icon: /* @__PURE__ */ s(Zt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_out"), action: t.onZoomOut, disabled: t.zoom <= 0.01 },
|
|
1176
1229
|
{ type: "text", content: `${Math.round(t.zoom * 100)}%`, minWidth: "3rem" },
|
|
1177
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1230
|
+
{ type: "button", icon: /* @__PURE__ */ s(At, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_in"), action: t.onZoomIn, disabled: t.zoom >= 10 }
|
|
1178
1231
|
]
|
|
1179
1232
|
},
|
|
1180
1233
|
{
|
|
1181
1234
|
items: [
|
|
1182
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1183
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1235
|
+
{ type: "button", icon: /* @__PURE__ */ s(Ee, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.fit_to_window"), action: t.onFitToWidth },
|
|
1236
|
+
{ type: "button", icon: /* @__PURE__ */ s(kr, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.original_size"), action: t.onOriginalSize }
|
|
1184
1237
|
]
|
|
1185
1238
|
},
|
|
1186
1239
|
{
|
|
1187
1240
|
items: [
|
|
1188
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1189
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1241
|
+
{ type: "button", icon: /* @__PURE__ */ s(Le, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.rotate_left"), action: t.onRotateLeft },
|
|
1242
|
+
{ type: "button", icon: /* @__PURE__ */ s(Se, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.rotate_right"), action: t.onRotateRight }
|
|
1190
1243
|
]
|
|
1191
1244
|
},
|
|
1192
1245
|
{
|
|
1193
1246
|
items: [
|
|
1194
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1247
|
+
{ type: "button", icon: /* @__PURE__ */ s(Ut, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.reset"), action: t.onReset }
|
|
1195
1248
|
]
|
|
1196
1249
|
}
|
|
1197
1250
|
];
|
|
1198
1251
|
}
|
|
1199
|
-
function
|
|
1252
|
+
function Rr(t) {
|
|
1200
1253
|
return [
|
|
1201
1254
|
{
|
|
1202
1255
|
items: [
|
|
1203
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1256
|
+
{ type: "button", icon: /* @__PURE__ */ s(Zt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_out"), action: t.onZoomOut, disabled: t.zoom <= 0.01 },
|
|
1204
1257
|
{ type: "text", content: `${Math.round(t.zoom * 100)}%`, minWidth: "3rem" },
|
|
1205
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1258
|
+
{ type: "button", icon: /* @__PURE__ */ s(At, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_in"), action: t.onZoomIn, disabled: t.zoom >= 10 }
|
|
1206
1259
|
]
|
|
1207
1260
|
},
|
|
1208
1261
|
{
|
|
1209
1262
|
items: [
|
|
1210
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1263
|
+
{ type: "button", icon: /* @__PURE__ */ s(Ut, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.reset"), action: t.onReset }
|
|
1211
1264
|
]
|
|
1212
1265
|
}
|
|
1213
1266
|
];
|
|
@@ -1216,7 +1269,7 @@ function Nr(t) {
|
|
|
1216
1269
|
return [
|
|
1217
1270
|
{
|
|
1218
1271
|
items: [
|
|
1219
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1272
|
+
{ type: "button", icon: /* @__PURE__ */ s(It, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.toc"), action: () => {
|
|
1220
1273
|
var e;
|
|
1221
1274
|
return (e = t.epubRef.current) == null ? void 0 : e.toggleToc();
|
|
1222
1275
|
} }
|
|
@@ -1224,12 +1277,12 @@ function Nr(t) {
|
|
|
1224
1277
|
},
|
|
1225
1278
|
{
|
|
1226
1279
|
items: [
|
|
1227
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1280
|
+
{ type: "button", icon: /* @__PURE__ */ s(pt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.prev_page"), action: () => {
|
|
1228
1281
|
var e;
|
|
1229
1282
|
return (e = t.epubRef.current) == null ? void 0 : e.prevPage();
|
|
1230
1283
|
} },
|
|
1231
1284
|
{ type: "text", content: `${t.current} / ${t.total}`, minWidth: "4rem" },
|
|
1232
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1285
|
+
{ type: "button", icon: /* @__PURE__ */ s(ft, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.next_page"), action: () => {
|
|
1233
1286
|
var e;
|
|
1234
1287
|
return (e = t.epubRef.current) == null ? void 0 : e.nextPage();
|
|
1235
1288
|
} }
|
|
@@ -1239,7 +1292,7 @@ function Nr(t) {
|
|
|
1239
1292
|
items: [
|
|
1240
1293
|
{
|
|
1241
1294
|
type: "button",
|
|
1242
|
-
icon: t.fullWidth ? /* @__PURE__ */
|
|
1295
|
+
icon: t.fullWidth ? /* @__PURE__ */ s(Vt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ s(Ht, { className: "rfp-w-4 rfp-h-4" }),
|
|
1243
1296
|
tooltip: t.fullWidth ? t.t("toolbar.normal_width") : t.t("toolbar.full_width"),
|
|
1244
1297
|
action: () => {
|
|
1245
1298
|
var e;
|
|
@@ -1250,13 +1303,13 @@ function Nr(t) {
|
|
|
1250
1303
|
}
|
|
1251
1304
|
];
|
|
1252
1305
|
}
|
|
1253
|
-
function
|
|
1306
|
+
function Mr(t) {
|
|
1254
1307
|
return [
|
|
1255
1308
|
{
|
|
1256
1309
|
items: [
|
|
1257
1310
|
{
|
|
1258
1311
|
type: "button",
|
|
1259
|
-
icon: /* @__PURE__ */
|
|
1312
|
+
icon: /* @__PURE__ */ s(It, { className: "rfp-w-4 rfp-h-4" }),
|
|
1260
1313
|
tooltip: t.t("toolbar.toc"),
|
|
1261
1314
|
action: () => {
|
|
1262
1315
|
var e;
|
|
@@ -1269,7 +1322,7 @@ function Rr(t) {
|
|
|
1269
1322
|
items: [
|
|
1270
1323
|
{
|
|
1271
1324
|
type: "button",
|
|
1272
|
-
icon: /* @__PURE__ */
|
|
1325
|
+
icon: /* @__PURE__ */ s(pt, { className: "rfp-w-4 rfp-h-4" }),
|
|
1273
1326
|
tooltip: t.t("toolbar.prev_page"),
|
|
1274
1327
|
action: () => {
|
|
1275
1328
|
var e;
|
|
@@ -1283,7 +1336,7 @@ function Rr(t) {
|
|
|
1283
1336
|
},
|
|
1284
1337
|
{
|
|
1285
1338
|
type: "button",
|
|
1286
|
-
icon: /* @__PURE__ */
|
|
1339
|
+
icon: /* @__PURE__ */ s(ft, { className: "rfp-w-4 rfp-h-4" }),
|
|
1287
1340
|
tooltip: t.t("toolbar.next_page"),
|
|
1288
1341
|
action: () => {
|
|
1289
1342
|
var e;
|
|
@@ -1296,7 +1349,7 @@ function Rr(t) {
|
|
|
1296
1349
|
items: [
|
|
1297
1350
|
{
|
|
1298
1351
|
type: "button",
|
|
1299
|
-
icon: t.fullWidth ? /* @__PURE__ */
|
|
1352
|
+
icon: t.fullWidth ? /* @__PURE__ */ s(Vt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ s(Ht, { className: "rfp-w-4 rfp-h-4" }),
|
|
1300
1353
|
tooltip: t.fullWidth ? t.t("toolbar.normal_width") : t.t("toolbar.full_width"),
|
|
1301
1354
|
action: () => {
|
|
1302
1355
|
var e;
|
|
@@ -1307,7 +1360,7 @@ function Rr(t) {
|
|
|
1307
1360
|
}
|
|
1308
1361
|
];
|
|
1309
1362
|
}
|
|
1310
|
-
function
|
|
1363
|
+
function Tr({ stats: t }) {
|
|
1311
1364
|
return t ? [
|
|
1312
1365
|
{
|
|
1313
1366
|
items: [
|
|
@@ -1320,13 +1373,13 @@ function Mr({ stats: t }) {
|
|
|
1320
1373
|
}
|
|
1321
1374
|
] : [];
|
|
1322
1375
|
}
|
|
1323
|
-
function
|
|
1376
|
+
function Pr(t) {
|
|
1324
1377
|
const e = [
|
|
1325
1378
|
{
|
|
1326
1379
|
items: [
|
|
1327
1380
|
{
|
|
1328
1381
|
type: "button",
|
|
1329
|
-
icon: /* @__PURE__ */
|
|
1382
|
+
icon: /* @__PURE__ */ s(We, { className: "rfp-w-4 rfp-h-4" }),
|
|
1330
1383
|
tooltip: t.wordWrap ? t.t("toolbar.wrap_off") : t.t("toolbar.wrap_on"),
|
|
1331
1384
|
action: t.onToggleWrap
|
|
1332
1385
|
}
|
|
@@ -1337,20 +1390,20 @@ function Tr(t) {
|
|
|
1337
1390
|
items: [
|
|
1338
1391
|
{
|
|
1339
1392
|
type: "button",
|
|
1340
|
-
icon: t.htmlPreview ? /* @__PURE__ */
|
|
1393
|
+
icon: t.htmlPreview ? /* @__PURE__ */ s(Bt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ s(qt, { className: "rfp-w-4 rfp-h-4" }),
|
|
1341
1394
|
tooltip: t.htmlPreview ? t.t("toolbar.source") : t.t("toolbar.preview"),
|
|
1342
1395
|
action: t.onToggleHtmlPreview
|
|
1343
1396
|
}
|
|
1344
1397
|
]
|
|
1345
1398
|
}), e;
|
|
1346
1399
|
}
|
|
1347
|
-
function
|
|
1400
|
+
function zr(t) {
|
|
1348
1401
|
return [
|
|
1349
1402
|
{
|
|
1350
1403
|
items: [
|
|
1351
1404
|
{
|
|
1352
1405
|
type: "button",
|
|
1353
|
-
icon: t.viewMode === "preview" ? /* @__PURE__ */
|
|
1406
|
+
icon: t.viewMode === "preview" ? /* @__PURE__ */ s(Bt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ s(qt, { className: "rfp-w-4 rfp-h-4" }),
|
|
1354
1407
|
tooltip: t.viewMode === "preview" ? t.t("toolbar.source") : t.t("toolbar.preview"),
|
|
1355
1408
|
action: t.onToggleViewMode
|
|
1356
1409
|
}
|
|
@@ -1358,13 +1411,13 @@ function Pr(t) {
|
|
|
1358
1411
|
}
|
|
1359
1412
|
];
|
|
1360
1413
|
}
|
|
1361
|
-
const
|
|
1414
|
+
const jr = {
|
|
1362
1415
|
fetcher: (t, e) => fetch(t, e)
|
|
1363
|
-
},
|
|
1416
|
+
}, mt = lt(jr), Er = ({
|
|
1364
1417
|
requestInit: t,
|
|
1365
1418
|
requestHandler: e,
|
|
1366
1419
|
shouldFetchAsBlob: r,
|
|
1367
|
-
children:
|
|
1420
|
+
children: o
|
|
1368
1421
|
}) => {
|
|
1369
1422
|
const a = B(
|
|
1370
1423
|
() => ({
|
|
@@ -1373,85 +1426,87 @@ const zr = {
|
|
|
1373
1426
|
}),
|
|
1374
1427
|
[t, e, r]
|
|
1375
1428
|
);
|
|
1376
|
-
return /* @__PURE__ */
|
|
1429
|
+
return /* @__PURE__ */ s(mt.Provider, { value: a, children: o });
|
|
1377
1430
|
};
|
|
1378
|
-
function
|
|
1379
|
-
return
|
|
1431
|
+
function Lr() {
|
|
1432
|
+
return X(mt).fetcher;
|
|
1380
1433
|
}
|
|
1381
1434
|
function Sr(t) {
|
|
1382
|
-
const { fetcher: e, shouldFetchAsBlob: r } =
|
|
1383
|
-
() => t ?
|
|
1384
|
-
), i =
|
|
1385
|
-
return
|
|
1435
|
+
const { fetcher: e, shouldFetchAsBlob: r } = X(mt), o = !!(t && (r != null && r(t))), [a, n] = y(
|
|
1436
|
+
() => t ? o ? "" : t.url : ""
|
|
1437
|
+
), i = H(null);
|
|
1438
|
+
return S(() => {
|
|
1386
1439
|
if (!t) {
|
|
1387
|
-
|
|
1440
|
+
n("");
|
|
1388
1441
|
return;
|
|
1389
1442
|
}
|
|
1390
|
-
if (!
|
|
1391
|
-
|
|
1443
|
+
if (!o) {
|
|
1444
|
+
n(t.url);
|
|
1392
1445
|
return;
|
|
1393
1446
|
}
|
|
1394
|
-
let
|
|
1395
|
-
return
|
|
1396
|
-
if (
|
|
1447
|
+
let l = !1;
|
|
1448
|
+
return n(""), Ye(t.url, e).then((p) => {
|
|
1449
|
+
if (l) {
|
|
1397
1450
|
URL.revokeObjectURL(p);
|
|
1398
1451
|
return;
|
|
1399
1452
|
}
|
|
1400
|
-
i.current && URL.revokeObjectURL(i.current), i.current = p,
|
|
1453
|
+
i.current && URL.revokeObjectURL(i.current), i.current = p, n(p);
|
|
1401
1454
|
}).catch((p) => {
|
|
1402
|
-
|
|
1455
|
+
l || (console.error("[file-preview] resolve blob url failed:", p), n(t.url));
|
|
1403
1456
|
}), () => {
|
|
1404
|
-
|
|
1457
|
+
l = !0;
|
|
1405
1458
|
};
|
|
1406
|
-
}, [t == null ? void 0 : t.id, t == null ? void 0 : t.url,
|
|
1459
|
+
}, [t == null ? void 0 : t.id, t == null ? void 0 : t.url, o, e]), S(() => () => {
|
|
1407
1460
|
i.current && (URL.revokeObjectURL(i.current), i.current = null);
|
|
1408
1461
|
}, []), a;
|
|
1409
1462
|
}
|
|
1410
|
-
const
|
|
1411
|
-
() => import("./index-
|
|
1412
|
-
),
|
|
1413
|
-
() => import("./index-
|
|
1414
|
-
),
|
|
1415
|
-
() => import("./index-
|
|
1416
|
-
),
|
|
1417
|
-
() => import("./index-
|
|
1418
|
-
),
|
|
1419
|
-
() => import("./index-
|
|
1420
|
-
),
|
|
1421
|
-
() => import("./index-
|
|
1422
|
-
),
|
|
1423
|
-
() => import("./index-
|
|
1424
|
-
),
|
|
1425
|
-
() => import("./index-
|
|
1426
|
-
),
|
|
1427
|
-
() => import("./index-
|
|
1428
|
-
), Hr =
|
|
1429
|
-
() => import("./index-
|
|
1430
|
-
),
|
|
1431
|
-
() => import("./index-
|
|
1432
|
-
),
|
|
1433
|
-
() => import("./index-
|
|
1434
|
-
),
|
|
1435
|
-
() => import("./index-
|
|
1436
|
-
),
|
|
1437
|
-
() => import("./index-
|
|
1438
|
-
),
|
|
1439
|
-
() => import("./index-
|
|
1440
|
-
),
|
|
1441
|
-
() => import("./index-
|
|
1442
|
-
),
|
|
1443
|
-
() => import("./index-
|
|
1444
|
-
),
|
|
1463
|
+
const Wr = R(
|
|
1464
|
+
() => import("./index-CztCCF7q.mjs").then((t) => ({ default: t.ImageRenderer }))
|
|
1465
|
+
), $r = R(
|
|
1466
|
+
() => import("./index-C5YHI0Zs.mjs").then((t) => ({ default: t.PdfRenderer }))
|
|
1467
|
+
), Dr = R(
|
|
1468
|
+
() => import("./index-BOQJNL71.mjs").then((t) => ({ default: t.DocxRenderer }))
|
|
1469
|
+
), Or = R(
|
|
1470
|
+
() => import("./index-BAYc4aBz.mjs").then((t) => ({ default: t.XlsxRenderer }))
|
|
1471
|
+
), Zr = R(
|
|
1472
|
+
() => import("./index-QfO-sASN.mjs").then((t) => ({ default: t.PptxRenderer }))
|
|
1473
|
+
), Ar = R(
|
|
1474
|
+
() => import("./index-BnDoXBnH.mjs").then((t) => ({ default: t.MsgRenderer }))
|
|
1475
|
+
), Ur = R(
|
|
1476
|
+
() => import("./index-DSAXdrgU.mjs").then((t) => ({ default: t.EpubRenderer }))
|
|
1477
|
+
), Ir = R(
|
|
1478
|
+
() => import("./index-DN8BQIqo.mjs").then((t) => ({ default: t.MobiRenderer }))
|
|
1479
|
+
), Vr = R(
|
|
1480
|
+
() => import("./index-DKEcGewg.mjs").then((t) => ({ default: t.VideoRenderer }))
|
|
1481
|
+
), Hr = R(
|
|
1482
|
+
() => import("./index-DPpUj8Yy.mjs").then((t) => ({ default: t.AudioRenderer }))
|
|
1483
|
+
), Br = R(
|
|
1484
|
+
() => import("./index-CwmZQ-JO.mjs").then((t) => ({ default: t.MarkdownRenderer }))
|
|
1485
|
+
), qr = R(
|
|
1486
|
+
() => import("./index-B0JUZ5rS.mjs").then((t) => ({ default: t.JsonRenderer }))
|
|
1487
|
+
), Gr = R(
|
|
1488
|
+
() => import("./index-h9bO9wmq.mjs").then((t) => ({ default: t.CsvRenderer }))
|
|
1489
|
+
), Xr = R(
|
|
1490
|
+
() => import("./index-BkU8rK-0.mjs").then((t) => ({ default: t.XmlRenderer }))
|
|
1491
|
+
), Jr = R(
|
|
1492
|
+
() => import("./index-DveR0rOk.mjs").then((t) => ({ default: t.SubtitleRenderer }))
|
|
1493
|
+
), Kr = R(
|
|
1494
|
+
() => import("./index-tecGXW2S.mjs").then((t) => ({ default: t.ZipRenderer }))
|
|
1495
|
+
), Yr = R(
|
|
1496
|
+
() => import("./index-CzflrElZ.mjs").then((t) => ({ default: t.TextRenderer }))
|
|
1497
|
+
), Qr = R(
|
|
1498
|
+
() => import("./index-mvSVNKlQ.mjs").then((t) => ({ default: t.FontRenderer }))
|
|
1499
|
+
), Ot = ({
|
|
1445
1500
|
fileName: t,
|
|
1446
1501
|
fileType: e,
|
|
1447
1502
|
onDownload: r
|
|
1448
1503
|
}) => {
|
|
1449
|
-
const
|
|
1504
|
+
const o = Jt();
|
|
1450
1505
|
return /* @__PURE__ */ z("div", { className: "rfp-flex rfp-flex-col rfp-items-center rfp-justify-center rfp-w-full rfp-h-full rfp-p-8 rfp-gap-6", children: [
|
|
1451
|
-
/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ s("div", { className: "rfp-w-32 rfp-h-32 rfp-rounded-full rfp-bg-surface-2 rfp-flex rfp-items-center rfp-justify-center", children: /* @__PURE__ */ s($e, { className: "rfp-w-16 rfp-h-16 rfp-text-fg-secondary" }) }),
|
|
1452
1507
|
/* @__PURE__ */ z("div", { className: "rfp-text-fg-primary rfp-text-center", children: [
|
|
1453
|
-
/* @__PURE__ */
|
|
1454
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ s("p", { className: "rfp-text-xl rfp-font-medium rfp-mb-2", children: t }),
|
|
1509
|
+
/* @__PURE__ */ s("p", { className: "rfp-text-fg-secondary", children: o("common.unsupported_preview", { type: e }) })
|
|
1455
1510
|
] }),
|
|
1456
1511
|
/* @__PURE__ */ z(
|
|
1457
1512
|
"button",
|
|
@@ -1459,41 +1514,41 @@ const Lr = N(
|
|
|
1459
1514
|
onClick: r,
|
|
1460
1515
|
className: "rfp-flex rfp-items-center rfp-gap-2 rfp-px-6 rfp-py-3 rfp-bg-surface-2 hover:rfp-bg-surface-3 rfp-backdrop-blur-sm rfp-rounded-lg rfp-text-fg-primary rfp-font-medium rfp-transition-all",
|
|
1461
1516
|
children: [
|
|
1462
|
-
/* @__PURE__ */
|
|
1463
|
-
|
|
1517
|
+
/* @__PURE__ */ s(Gt, { className: "rfp-w-5 rfp-h-5" }),
|
|
1518
|
+
o("common.download")
|
|
1464
1519
|
]
|
|
1465
1520
|
}
|
|
1466
1521
|
)
|
|
1467
1522
|
] });
|
|
1468
|
-
},
|
|
1469
|
-
const t =
|
|
1470
|
-
return /* @__PURE__ */
|
|
1471
|
-
/* @__PURE__ */
|
|
1472
|
-
/* @__PURE__ */
|
|
1523
|
+
}, to = () => {
|
|
1524
|
+
const t = Jt();
|
|
1525
|
+
return /* @__PURE__ */ s("div", { className: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp-h-full rfp-text-fg-muted", children: /* @__PURE__ */ z("div", { className: "rfp-flex rfp-flex-col rfp-items-center rfp-gap-3", children: [
|
|
1526
|
+
/* @__PURE__ */ s("div", { className: "rfp-w-8 rfp-h-8 rfp-rounded-full rfp-border-2 rfp-border-fg-muted rfp-border-t-transparent rfp-animate-spin" }),
|
|
1527
|
+
/* @__PURE__ */ s("span", { className: "rfp-text-sm", children: t("common.loading") ?? "Loading..." })
|
|
1473
1528
|
] }) });
|
|
1474
|
-
},
|
|
1475
|
-
const { requestInit: e, requestHandler: r, shouldFetchAsBlob:
|
|
1476
|
-
return /* @__PURE__ */
|
|
1529
|
+
}, eo = 3, ht = (t) => {
|
|
1530
|
+
const { requestInit: e, requestHandler: r, shouldFetchAsBlob: o } = t;
|
|
1531
|
+
return /* @__PURE__ */ s(
|
|
1477
1532
|
Er,
|
|
1478
1533
|
{
|
|
1479
1534
|
requestInit: e,
|
|
1480
1535
|
requestHandler: r,
|
|
1481
|
-
shouldFetchAsBlob:
|
|
1482
|
-
children: /* @__PURE__ */
|
|
1536
|
+
shouldFetchAsBlob: o,
|
|
1537
|
+
children: /* @__PURE__ */ s(ro, { ...t })
|
|
1483
1538
|
}
|
|
1484
1539
|
);
|
|
1485
|
-
},
|
|
1540
|
+
}, ro = ({
|
|
1486
1541
|
files: t,
|
|
1487
1542
|
currentIndex: e,
|
|
1488
1543
|
onNavigate: r,
|
|
1489
|
-
customRenderers:
|
|
1544
|
+
customRenderers: o = [],
|
|
1490
1545
|
mode: a = "modal",
|
|
1491
|
-
onClose:
|
|
1546
|
+
onClose: n,
|
|
1492
1547
|
zipNestingDepth: i = 0,
|
|
1493
|
-
locale:
|
|
1548
|
+
locale: l = "zh-CN",
|
|
1494
1549
|
messages: p,
|
|
1495
|
-
headless:
|
|
1496
|
-
theme:
|
|
1550
|
+
headless: f = !1,
|
|
1551
|
+
theme: c = "dark",
|
|
1497
1552
|
onCustomEvent: d,
|
|
1498
1553
|
onDownload: h,
|
|
1499
1554
|
// 以下三项已由外层 RequestProvider 消费,Inner 内不再直接使用
|
|
@@ -1501,49 +1556,49 @@ const Lr = N(
|
|
|
1501
1556
|
requestHandler: _,
|
|
1502
1557
|
shouldFetchAsBlob: M
|
|
1503
1558
|
}) => {
|
|
1504
|
-
const
|
|
1505
|
-
() =>
|
|
1506
|
-
[
|
|
1559
|
+
const x = B(
|
|
1560
|
+
() => dt({ locale: l, messages: p }),
|
|
1561
|
+
[l, p]
|
|
1507
1562
|
), [F, T] = y(
|
|
1508
1563
|
() => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
1509
1564
|
);
|
|
1510
|
-
|
|
1511
|
-
if (
|
|
1512
|
-
const m = window.matchMedia("(prefers-color-scheme: dark)"), w = (
|
|
1565
|
+
S(() => {
|
|
1566
|
+
if (c !== "auto") return;
|
|
1567
|
+
const m = window.matchMedia("(prefers-color-scheme: dark)"), w = (j) => T(j.matches);
|
|
1513
1568
|
return m.addEventListener("change", w), () => m.removeEventListener("change", w);
|
|
1514
|
-
}, [
|
|
1515
|
-
const k =
|
|
1569
|
+
}, [c]);
|
|
1570
|
+
const k = c === "auto" ? F ? "dark" : "light" : c, [N, v] = y(1), [L, W] = y(0), [Yt, bt] = y(1), [, gt] = y(1), [A, et] = y(0), [U, wt] = y(0), [Qt, rt] = y(0), D = H(null), xt = H(null), vt = H(null), [te, ee] = y(0), [re, oe] = y(0), [ne, ae] = y(!1), yt = H(null), [ie, se] = y(0), [le, pe] = y(0), [fe, ce] = y(!1), [de, ue] = y(null), [Ft, me] = y(!0), [_t, he] = y(!1), [kt, be] = y("preview"), [I, q] = y(!0), O = H(null), ge = 2e3, J = P(() => {
|
|
1516
1571
|
q(!0), O.current && clearTimeout(O.current), O.current = window.setTimeout(() => {
|
|
1517
1572
|
q(!1);
|
|
1518
|
-
},
|
|
1519
|
-
}, []),
|
|
1520
|
-
|
|
1521
|
-
}, [
|
|
1573
|
+
}, ge);
|
|
1574
|
+
}, []), we = P(() => {
|
|
1575
|
+
J();
|
|
1576
|
+
}, [J]), $ = B(() => He(t), [t]), b = $[e], C = Sr(b), V = B(() => b ? o.find((m) => m.test(b)) : null, [b, o]), g = b ? Be(b) : "unsupported", Ct = P(
|
|
1522
1577
|
(m, w) => {
|
|
1523
1578
|
b && (d == null || d({ name: m, payload: w, file: b }));
|
|
1524
1579
|
},
|
|
1525
1580
|
[b, d]
|
|
1526
1581
|
), Rt = B(
|
|
1527
1582
|
() => ({
|
|
1528
|
-
emit:
|
|
1529
|
-
t:
|
|
1583
|
+
emit: Ct,
|
|
1584
|
+
t: x,
|
|
1530
1585
|
theme: k,
|
|
1531
|
-
locale:
|
|
1586
|
+
locale: l
|
|
1532
1587
|
}),
|
|
1533
|
-
[
|
|
1588
|
+
[Ct, x, k, l]
|
|
1534
1589
|
);
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
}, [e]),
|
|
1590
|
+
S(() => {
|
|
1591
|
+
v(1), W(0), bt(1), gt(1), et(0), wt(0), q(!0), O.current && clearTimeout(O.current);
|
|
1592
|
+
}, [e]), S(() => {
|
|
1538
1593
|
if (g === "image" && A > 0 && U > 0 && D.current) {
|
|
1539
|
-
const m = D.current.clientWidth, w = D.current.clientHeight,
|
|
1540
|
-
|
|
1594
|
+
const m = D.current.clientWidth, w = D.current.clientHeight, j = m / A, E = w / U, G = Math.min(j, E);
|
|
1595
|
+
v(Math.max(0.01, Math.min(10, G)));
|
|
1541
1596
|
}
|
|
1542
|
-
}, [g, A, U]),
|
|
1597
|
+
}, [g, A, U]), S(() => ($.length > 1 && J(), () => {
|
|
1543
1598
|
O.current && clearTimeout(O.current);
|
|
1544
|
-
}), [$.length,
|
|
1599
|
+
}), [$.length, J]), S(() => {
|
|
1545
1600
|
const m = (w) => {
|
|
1546
|
-
w.key === "Escape" && a === "modal" ?
|
|
1601
|
+
w.key === "Escape" && a === "modal" ? n == null || n() : w.key === "ArrowLeft" && e > 0 ? r == null || r(e - 1) : w.key === "ArrowRight" && e < $.length - 1 && (r == null || r(e + 1));
|
|
1547
1602
|
};
|
|
1548
1603
|
if (a === "modal")
|
|
1549
1604
|
return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
|
|
@@ -1551,141 +1606,141 @@ const Lr = N(
|
|
|
1551
1606
|
const w = xt.current;
|
|
1552
1607
|
return w ? (w.addEventListener("keydown", m), () => w.removeEventListener("keydown", m)) : void 0;
|
|
1553
1608
|
}
|
|
1554
|
-
}, [a, e, $.length,
|
|
1555
|
-
const
|
|
1556
|
-
|
|
1557
|
-
}, []),
|
|
1558
|
-
|
|
1609
|
+
}, [a, e, $.length, n, r]);
|
|
1610
|
+
const Nt = P(() => {
|
|
1611
|
+
v((m) => Math.min(m + 0.1, 10));
|
|
1612
|
+
}, []), Mt = P(() => {
|
|
1613
|
+
v((m) => Math.max(m - 0.1, 0.01));
|
|
1559
1614
|
}, []), xe = P(() => {
|
|
1560
1615
|
W((m) => m + 90);
|
|
1561
|
-
}, []),
|
|
1616
|
+
}, []), ve = P(() => {
|
|
1562
1617
|
W((m) => m - 90);
|
|
1563
|
-
}, []),
|
|
1618
|
+
}, []), ye = P(() => {
|
|
1564
1619
|
if (D.current && A > 0 && U > 0) {
|
|
1565
|
-
const m = D.current.clientWidth, w = D.current.clientHeight,
|
|
1566
|
-
|
|
1620
|
+
const m = D.current.clientWidth, w = D.current.clientHeight, j = m / A, E = w / U, G = Math.min(j, E);
|
|
1621
|
+
v(Math.max(0.01, Math.min(10, G)));
|
|
1567
1622
|
} else
|
|
1568
|
-
|
|
1569
|
-
W(0),
|
|
1570
|
-
}, [A, U]),
|
|
1571
|
-
|
|
1572
|
-
}, []),
|
|
1573
|
-
|
|
1574
|
-
}, []),
|
|
1575
|
-
|
|
1576
|
-
}, []),
|
|
1623
|
+
v(1);
|
|
1624
|
+
W(0), rt((m) => m + 1);
|
|
1625
|
+
}, [A, U]), Fe = P(() => {
|
|
1626
|
+
v(1), W(0), rt((m) => m + 1);
|
|
1627
|
+
}, []), _e = P((m) => {
|
|
1628
|
+
v(m);
|
|
1629
|
+
}, []), Tt = P(() => {
|
|
1630
|
+
v(1), W(0), rt((m) => m + 1);
|
|
1631
|
+
}, []), Pt = Lr(), ot = P(async () => {
|
|
1577
1632
|
if (b) {
|
|
1578
1633
|
if (h) {
|
|
1579
1634
|
await h(b);
|
|
1580
1635
|
return;
|
|
1581
1636
|
}
|
|
1582
1637
|
try {
|
|
1583
|
-
await Qe(b.url, b.name,
|
|
1638
|
+
await Qe(b.url, b.name, Pt);
|
|
1584
1639
|
} catch (m) {
|
|
1585
1640
|
console.error("[file-preview] download failed:", m);
|
|
1586
1641
|
}
|
|
1587
1642
|
}
|
|
1588
|
-
}, [b, h,
|
|
1589
|
-
|
|
1590
|
-
}, []),
|
|
1591
|
-
|
|
1643
|
+
}, [b, h, Pt]), ke = P((m, w) => {
|
|
1644
|
+
ee(m), oe(w);
|
|
1645
|
+
}, []), Ce = P((m, w) => {
|
|
1646
|
+
se(m), pe(w);
|
|
1592
1647
|
}, []), Re = P((m) => {
|
|
1593
|
-
|
|
1648
|
+
ue(m);
|
|
1594
1649
|
}, []);
|
|
1595
1650
|
if (!b) return null;
|
|
1596
|
-
const
|
|
1651
|
+
const Ne = a === "modal" && !!n, K = (() => {
|
|
1597
1652
|
var m, w;
|
|
1598
|
-
if (
|
|
1599
|
-
return ((m =
|
|
1653
|
+
if (V)
|
|
1654
|
+
return ((m = V.getToolbarGroups) == null ? void 0 : m.call(V, b, Rt)) ?? [];
|
|
1600
1655
|
if (g === "image")
|
|
1601
|
-
return
|
|
1602
|
-
zoom:
|
|
1603
|
-
onZoomIn:
|
|
1604
|
-
onZoomOut:
|
|
1605
|
-
onFitToWidth:
|
|
1606
|
-
onOriginalSize:
|
|
1607
|
-
onRotateLeft:
|
|
1656
|
+
return Cr({
|
|
1657
|
+
zoom: N,
|
|
1658
|
+
onZoomIn: Nt,
|
|
1659
|
+
onZoomOut: Mt,
|
|
1660
|
+
onFitToWidth: ye,
|
|
1661
|
+
onOriginalSize: Fe,
|
|
1662
|
+
onRotateLeft: ve,
|
|
1608
1663
|
onRotateRight: xe,
|
|
1609
|
-
onReset:
|
|
1610
|
-
t:
|
|
1664
|
+
onReset: Tt,
|
|
1665
|
+
t: x
|
|
1611
1666
|
});
|
|
1612
1667
|
if (g === "pdf")
|
|
1613
|
-
return
|
|
1614
|
-
zoom:
|
|
1615
|
-
onZoomIn:
|
|
1616
|
-
onZoomOut:
|
|
1617
|
-
onReset:
|
|
1618
|
-
t:
|
|
1668
|
+
return Rr({
|
|
1669
|
+
zoom: N,
|
|
1670
|
+
onZoomIn: Nt,
|
|
1671
|
+
onZoomOut: Mt,
|
|
1672
|
+
onReset: Tt,
|
|
1673
|
+
t: x
|
|
1619
1674
|
});
|
|
1620
1675
|
if (g === "epub")
|
|
1621
1676
|
return Nr({
|
|
1622
|
-
epubRef:
|
|
1623
|
-
current:
|
|
1624
|
-
total:
|
|
1625
|
-
fullWidth:
|
|
1626
|
-
t:
|
|
1677
|
+
epubRef: vt,
|
|
1678
|
+
current: te,
|
|
1679
|
+
total: re,
|
|
1680
|
+
fullWidth: ne,
|
|
1681
|
+
t: x
|
|
1627
1682
|
});
|
|
1628
1683
|
if (g === "mobi")
|
|
1629
|
-
return
|
|
1630
|
-
mobiRef:
|
|
1631
|
-
current:
|
|
1632
|
-
total:
|
|
1684
|
+
return Mr({
|
|
1685
|
+
mobiRef: yt,
|
|
1686
|
+
current: ie,
|
|
1687
|
+
total: le,
|
|
1633
1688
|
fullWidth: fe,
|
|
1634
|
-
t:
|
|
1689
|
+
t: x
|
|
1635
1690
|
});
|
|
1636
1691
|
if (g === "zip")
|
|
1637
|
-
return
|
|
1692
|
+
return Tr({ stats: de });
|
|
1638
1693
|
if (g === "text") {
|
|
1639
|
-
const
|
|
1640
|
-
return
|
|
1641
|
-
wordWrap:
|
|
1642
|
-
onToggleWrap: () =>
|
|
1643
|
-
isHtml:
|
|
1644
|
-
htmlPreview:
|
|
1645
|
-
onToggleHtmlPreview: () =>
|
|
1646
|
-
t:
|
|
1694
|
+
const j = ((w = b.name.split(".").pop()) == null ? void 0 : w.toLowerCase()) || "";
|
|
1695
|
+
return Pr({
|
|
1696
|
+
wordWrap: Ft,
|
|
1697
|
+
onToggleWrap: () => me((E) => !E),
|
|
1698
|
+
isHtml: j === "html" || j === "htm",
|
|
1699
|
+
htmlPreview: _t,
|
|
1700
|
+
onToggleHtmlPreview: () => he((E) => !E),
|
|
1701
|
+
t: x
|
|
1647
1702
|
});
|
|
1648
1703
|
}
|
|
1649
|
-
return g === "markdown" ?
|
|
1650
|
-
viewMode:
|
|
1651
|
-
onToggleViewMode: () =>
|
|
1652
|
-
t:
|
|
1704
|
+
return g === "markdown" ? zr({
|
|
1705
|
+
viewMode: kt,
|
|
1706
|
+
onToggleViewMode: () => be((j) => j === "preview" ? "source" : "preview"),
|
|
1707
|
+
t: x
|
|
1653
1708
|
}) : [];
|
|
1654
|
-
})(),
|
|
1709
|
+
})(), zt = [
|
|
1655
1710
|
{
|
|
1656
1711
|
items: [
|
|
1657
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1712
|
+
{ type: "button", icon: /* @__PURE__ */ s(Gt, { className: "rfp-w-4 rfp-h-4" }), tooltip: x("common.download"), action: ot }
|
|
1658
1713
|
]
|
|
1659
1714
|
},
|
|
1660
|
-
...
|
|
1715
|
+
...Ne ? [{
|
|
1661
1716
|
items: [
|
|
1662
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
1717
|
+
{ type: "button", icon: /* @__PURE__ */ s(De, { className: "rfp-w-4 rfp-h-4" }), tooltip: x("common.close"), action: n }
|
|
1663
1718
|
]
|
|
1664
1719
|
}] : []
|
|
1665
|
-
],
|
|
1666
|
-
|
|
1667
|
-
(Z, jt) => Z.type === "button" ? /* @__PURE__ */
|
|
1668
|
-
|
|
1720
|
+
], Y = (m, w) => m.map((j, E, G) => /* @__PURE__ */ z(Te.Fragment, { children: [
|
|
1721
|
+
j.items.map(
|
|
1722
|
+
(Z, jt) => Z.type === "button" ? /* @__PURE__ */ s(
|
|
1723
|
+
oo,
|
|
1669
1724
|
{
|
|
1670
1725
|
icon: Z.icon,
|
|
1671
1726
|
label: Z.tooltip,
|
|
1672
1727
|
onClick: Z.action,
|
|
1673
1728
|
disabled: Z.disabled
|
|
1674
1729
|
},
|
|
1675
|
-
`${
|
|
1676
|
-
) : /* @__PURE__ */
|
|
1730
|
+
`${E}-${jt}`
|
|
1731
|
+
) : /* @__PURE__ */ s(
|
|
1677
1732
|
"span",
|
|
1678
1733
|
{
|
|
1679
1734
|
className: "rfp-text-xs rfp-text-center rfp-font-medium rfp-tabular-nums rfp-text-fg-tertiary",
|
|
1680
1735
|
style: { minWidth: Z.minWidth || "auto" },
|
|
1681
1736
|
children: Z.content
|
|
1682
1737
|
},
|
|
1683
|
-
`${
|
|
1738
|
+
`${E}-${jt}`
|
|
1684
1739
|
)
|
|
1685
1740
|
),
|
|
1686
|
-
|
|
1687
|
-
] },
|
|
1688
|
-
return /* @__PURE__ */
|
|
1741
|
+
E < G.length - 1 && /* @__PURE__ */ s("div", { className: `rfp-w-px rfp-h-4 rfp-bg-divide ${w}` })
|
|
1742
|
+
] }, E));
|
|
1743
|
+
return /* @__PURE__ */ s(yr, { locale: l, messages: p, children: /* @__PURE__ */ s(_r, { theme: k, children: /* @__PURE__ */ z(
|
|
1689
1744
|
"div",
|
|
1690
1745
|
{
|
|
1691
1746
|
ref: xt,
|
|
@@ -1693,8 +1748,8 @@ const Lr = N(
|
|
|
1693
1748
|
"data-theme": k,
|
|
1694
1749
|
className: "rfp-relative rfp-w-full rfp-h-full rfp-flex rfp-flex-col rfp-overflow-hidden rfp-outline-none",
|
|
1695
1750
|
children: [
|
|
1696
|
-
!
|
|
1697
|
-
|
|
1751
|
+
!f && /* @__PURE__ */ z(
|
|
1752
|
+
tt.div,
|
|
1698
1753
|
{
|
|
1699
1754
|
initial: { opacity: 0 },
|
|
1700
1755
|
animate: { opacity: 1 },
|
|
@@ -1704,115 +1759,116 @@ const Lr = N(
|
|
|
1704
1759
|
children: [
|
|
1705
1760
|
/* @__PURE__ */ z("div", { className: "rfp-flex rfp-items-center rfp-justify-between rfp-px-3 md:rfp-px-5 rfp-py-1.5 md:rfp-py-2.5", children: [
|
|
1706
1761
|
/* @__PURE__ */ z("div", { className: "rfp-flex rfp-items-center rfp-flex-1 rfp-min-w-0 rfp-mr-2 md:rfp-mr-3", children: [
|
|
1707
|
-
/* @__PURE__ */
|
|
1762
|
+
/* @__PURE__ */ s("h2", { className: "rfp-font-medium rfp-text-xs md:rfp-text-sm rfp-truncate rfp-text-fg-primary", children: b.name }),
|
|
1708
1763
|
/* @__PURE__ */ z("span", { className: "rfp-text-xs rfp-ml-2 rfp-flex-shrink-0 rfp-text-fg-muted", children: [
|
|
1709
1764
|
e + 1,
|
|
1710
1765
|
"/",
|
|
1711
1766
|
$.length
|
|
1712
1767
|
] })
|
|
1713
1768
|
] }),
|
|
1714
|
-
/* @__PURE__ */
|
|
1769
|
+
/* @__PURE__ */ s("div", { className: "rfp-flex rfp-items-center rfp-gap-1 md:rfp-hidden rfp-flex-shrink-0", children: Y(zt, "rfp-mx-0.5") }),
|
|
1715
1770
|
/* @__PURE__ */ z("div", { className: "rfp-hidden md:rfp-flex rfp-items-center rfp-gap-1 rfp-flex-shrink-0", children: [
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1771
|
+
Y(K, "rfp-mx-1"),
|
|
1772
|
+
K.length > 0 && /* @__PURE__ */ s("div", { className: "rfp-w-px rfp-h-4 rfp-mx-1 rfp-bg-divide" }),
|
|
1773
|
+
Y(zt, "rfp-mx-1")
|
|
1719
1774
|
] })
|
|
1720
1775
|
] }),
|
|
1721
|
-
|
|
1776
|
+
K.length > 0 && /* @__PURE__ */ s("div", { className: "rfp-flex rfp-items-center rfp-gap-1 rfp-px-3 rfp-pb-1.5 rfp-overflow-x-auto scrollbar-hide md:rfp-hidden", children: Y(K, "rfp-mx-0.5") })
|
|
1722
1777
|
]
|
|
1723
1778
|
}
|
|
1724
1779
|
),
|
|
1725
|
-
/* @__PURE__ */
|
|
1780
|
+
/* @__PURE__ */ s(
|
|
1726
1781
|
"div",
|
|
1727
1782
|
{
|
|
1728
1783
|
ref: D,
|
|
1729
1784
|
className: "rfp-flex-1 rfp-flex rfp-items-center rfp-justify-center rfp-overflow-auto",
|
|
1730
|
-
onMouseMove:
|
|
1731
|
-
children:
|
|
1732
|
-
g === "image" && /* @__PURE__ */
|
|
1733
|
-
|
|
1785
|
+
onMouseMove: we,
|
|
1786
|
+
children: V ? V.render(b, Rt) : /* @__PURE__ */ z(Pe, { fallback: /* @__PURE__ */ s(to, {}), children: [
|
|
1787
|
+
g === "image" && /* @__PURE__ */ s(
|
|
1788
|
+
Wr,
|
|
1734
1789
|
{
|
|
1735
1790
|
url: C,
|
|
1736
|
-
zoom:
|
|
1737
|
-
rotation:
|
|
1738
|
-
resetKey:
|
|
1791
|
+
zoom: N,
|
|
1792
|
+
rotation: L,
|
|
1793
|
+
resetKey: Qt,
|
|
1739
1794
|
fileSize: b.size,
|
|
1740
|
-
onZoomChange:
|
|
1741
|
-
onNaturalWidthChange:
|
|
1742
|
-
onNaturalHeightChange:
|
|
1795
|
+
onZoomChange: _e,
|
|
1796
|
+
onNaturalWidthChange: et,
|
|
1797
|
+
onNaturalHeightChange: wt
|
|
1743
1798
|
}
|
|
1744
1799
|
),
|
|
1745
|
-
g === "pdf" && /* @__PURE__ */
|
|
1746
|
-
|
|
1800
|
+
g === "pdf" && /* @__PURE__ */ s(
|
|
1801
|
+
$r,
|
|
1747
1802
|
{
|
|
1748
1803
|
url: C,
|
|
1749
|
-
zoom:
|
|
1750
|
-
currentPage:
|
|
1751
|
-
onPageChange:
|
|
1752
|
-
onTotalPagesChange:
|
|
1753
|
-
onPageWidthChange:
|
|
1804
|
+
zoom: N,
|
|
1805
|
+
currentPage: Yt,
|
|
1806
|
+
onPageChange: bt,
|
|
1807
|
+
onTotalPagesChange: gt,
|
|
1808
|
+
onPageWidthChange: et
|
|
1754
1809
|
}
|
|
1755
1810
|
),
|
|
1756
|
-
g === "docx" && /* @__PURE__ */
|
|
1757
|
-
g === "xlsx" && /* @__PURE__ */
|
|
1758
|
-
g === "pptx" && /* @__PURE__ */
|
|
1759
|
-
g === "msg" && /* @__PURE__ */
|
|
1760
|
-
g === "epub" && /* @__PURE__ */
|
|
1761
|
-
|
|
1811
|
+
g === "docx" && /* @__PURE__ */ s(Dr, { url: C }),
|
|
1812
|
+
g === "xlsx" && /* @__PURE__ */ s(Or, { url: C }),
|
|
1813
|
+
g === "pptx" && /* @__PURE__ */ s(Zr, { url: C }),
|
|
1814
|
+
g === "msg" && /* @__PURE__ */ s(Ar, { url: C }),
|
|
1815
|
+
g === "epub" && /* @__PURE__ */ s(
|
|
1816
|
+
Ur,
|
|
1762
1817
|
{
|
|
1763
|
-
ref:
|
|
1818
|
+
ref: vt,
|
|
1764
1819
|
url: C,
|
|
1765
|
-
onChapterChange:
|
|
1766
|
-
onFullWidthChange:
|
|
1820
|
+
onChapterChange: ke,
|
|
1821
|
+
onFullWidthChange: ae
|
|
1767
1822
|
}
|
|
1768
1823
|
),
|
|
1769
|
-
g === "mobi" && /* @__PURE__ */
|
|
1770
|
-
|
|
1824
|
+
g === "mobi" && /* @__PURE__ */ s(
|
|
1825
|
+
Ir,
|
|
1771
1826
|
{
|
|
1772
|
-
ref:
|
|
1827
|
+
ref: yt,
|
|
1773
1828
|
url: C,
|
|
1774
|
-
onChapterChange:
|
|
1775
|
-
onFullWidthChange:
|
|
1829
|
+
onChapterChange: Ce,
|
|
1830
|
+
onFullWidthChange: ce
|
|
1776
1831
|
}
|
|
1777
1832
|
),
|
|
1778
|
-
g === "video" && /* @__PURE__ */
|
|
1779
|
-
g === "audio" && /* @__PURE__ */
|
|
1780
|
-
g === "markdown" && /* @__PURE__ */
|
|
1781
|
-
g === "json" && /* @__PURE__ */
|
|
1782
|
-
g === "csv" && /* @__PURE__ */
|
|
1783
|
-
g === "xml" && /* @__PURE__ */
|
|
1784
|
-
g === "subtitle" && /* @__PURE__ */
|
|
1785
|
-
g === "zip" && (i >=
|
|
1786
|
-
|
|
1833
|
+
g === "video" && /* @__PURE__ */ s(Vr, { url: C }),
|
|
1834
|
+
g === "audio" && /* @__PURE__ */ s(Hr, { url: C, fileName: b.name }),
|
|
1835
|
+
g === "markdown" && /* @__PURE__ */ s(Br, { url: C, viewMode: kt }),
|
|
1836
|
+
g === "json" && /* @__PURE__ */ s(qr, { url: C, fileName: b.name }),
|
|
1837
|
+
g === "csv" && /* @__PURE__ */ s(Gr, { url: C, fileName: b.name }),
|
|
1838
|
+
g === "xml" && /* @__PURE__ */ s(Xr, { url: C, fileName: b.name }),
|
|
1839
|
+
g === "subtitle" && /* @__PURE__ */ s(Jr, { url: C, fileName: b.name }),
|
|
1840
|
+
g === "zip" && (i >= eo ? /* @__PURE__ */ s(
|
|
1841
|
+
Ot,
|
|
1787
1842
|
{
|
|
1788
1843
|
fileName: b.name,
|
|
1789
1844
|
fileType: b.type,
|
|
1790
|
-
onDownload:
|
|
1845
|
+
onDownload: ot
|
|
1791
1846
|
}
|
|
1792
|
-
) : /* @__PURE__ */
|
|
1793
|
-
g === "text" && /* @__PURE__ */
|
|
1794
|
-
|
|
1847
|
+
) : /* @__PURE__ */ s(Kr, { url: C, onStatsChange: Re, nestingDepth: i })),
|
|
1848
|
+
g === "text" && /* @__PURE__ */ s(
|
|
1849
|
+
Yr,
|
|
1795
1850
|
{
|
|
1796
1851
|
url: C,
|
|
1797
1852
|
fileName: b.name,
|
|
1798
|
-
wordWrap:
|
|
1799
|
-
htmlPreview:
|
|
1853
|
+
wordWrap: Ft,
|
|
1854
|
+
htmlPreview: _t
|
|
1800
1855
|
}
|
|
1801
1856
|
),
|
|
1802
|
-
g === "
|
|
1803
|
-
|
|
1857
|
+
g === "font" && /* @__PURE__ */ s(Qr, { url: C }),
|
|
1858
|
+
g === "unsupported" && /* @__PURE__ */ s(
|
|
1859
|
+
Ot,
|
|
1804
1860
|
{
|
|
1805
1861
|
fileName: b.name,
|
|
1806
1862
|
fileType: b.type,
|
|
1807
|
-
onDownload:
|
|
1863
|
+
onDownload: ot
|
|
1808
1864
|
}
|
|
1809
1865
|
)
|
|
1810
1866
|
] })
|
|
1811
1867
|
}
|
|
1812
1868
|
),
|
|
1813
|
-
!
|
|
1814
|
-
e > 0 && /* @__PURE__ */
|
|
1815
|
-
|
|
1869
|
+
!f && $.length > 1 && /* @__PURE__ */ z(Me, { children: [
|
|
1870
|
+
e > 0 && /* @__PURE__ */ s(
|
|
1871
|
+
tt.button,
|
|
1816
1872
|
{
|
|
1817
1873
|
initial: { opacity: 0 },
|
|
1818
1874
|
animate: { opacity: I ? 1 : 0, x: I ? 0 : -20 },
|
|
@@ -1821,11 +1877,11 @@ const Lr = N(
|
|
|
1821
1877
|
onMouseEnter: () => q(!0),
|
|
1822
1878
|
style: { pointerEvents: I ? "auto" : "none" },
|
|
1823
1879
|
className: "rfp-absolute rfp-z-20 rfp-left-2 md:rfp-left-4 rfp-top-1/2 -rfp-translate-y-1/2 rfp-w-10 rfp-h-10 md:rfp-w-12 md:rfp-h-12 rfp-rounded-full rfp-backdrop-blur-xl rfp-border rfp-flex rfp-items-center rfp-justify-center rfp-transition-colors rfp-shadow-2xl rfp-bg-surface-nav rfp-border-line hover:rfp-bg-surface-nav-hover rfp-text-fg-primary",
|
|
1824
|
-
children: /* @__PURE__ */
|
|
1880
|
+
children: /* @__PURE__ */ s(pt, { className: "rfp-w-5 rfp-h-5 md:rfp-w-6 md:rfp-h-6" })
|
|
1825
1881
|
}
|
|
1826
1882
|
),
|
|
1827
|
-
e < $.length - 1 && /* @__PURE__ */
|
|
1828
|
-
|
|
1883
|
+
e < $.length - 1 && /* @__PURE__ */ s(
|
|
1884
|
+
tt.button,
|
|
1829
1885
|
{
|
|
1830
1886
|
initial: { opacity: 0 },
|
|
1831
1887
|
animate: { opacity: I ? 1 : 0, x: I ? 0 : 20 },
|
|
@@ -1834,92 +1890,92 @@ const Lr = N(
|
|
|
1834
1890
|
onMouseEnter: () => q(!0),
|
|
1835
1891
|
style: { pointerEvents: I ? "auto" : "none" },
|
|
1836
1892
|
className: "rfp-absolute rfp-z-20 rfp-right-2 md:rfp-right-4 rfp-top-1/2 -rfp-translate-y-1/2 rfp-w-10 rfp-h-10 md:rfp-w-12 md:rfp-h-12 rfp-rounded-full rfp-backdrop-blur-xl rfp-border rfp-flex rfp-items-center rfp-justify-center rfp-transition-colors rfp-shadow-2xl rfp-bg-surface-nav rfp-border-line hover:rfp-bg-surface-nav-hover rfp-text-fg-primary",
|
|
1837
|
-
children: /* @__PURE__ */
|
|
1893
|
+
children: /* @__PURE__ */ s(ft, { className: "rfp-w-5 rfp-h-5 md:rfp-w-6 md:rfp-h-6" })
|
|
1838
1894
|
}
|
|
1839
1895
|
)
|
|
1840
1896
|
] })
|
|
1841
1897
|
]
|
|
1842
1898
|
}
|
|
1843
1899
|
) }) });
|
|
1844
|
-
},
|
|
1900
|
+
}, oo = ({ icon: t, label: e, onClick: r, disabled: o }) => /* @__PURE__ */ z(
|
|
1845
1901
|
"button",
|
|
1846
1902
|
{
|
|
1847
1903
|
onClick: r,
|
|
1848
|
-
disabled:
|
|
1849
|
-
className: `rfp-relative rfp-group rfp-p-2 md:rfp-p-1.5 rfp-rounded-md rfp-transition-all rfp-select-none ${
|
|
1904
|
+
disabled: o,
|
|
1905
|
+
className: `rfp-relative rfp-group rfp-p-2 md:rfp-p-1.5 rfp-rounded-md rfp-transition-all rfp-select-none ${o ? "rfp-text-fg-disabled rfp-cursor-not-allowed" : "rfp-text-fg-primary hover:rfp-bg-surface-2 active:rfp-bg-surface-3"}`,
|
|
1850
1906
|
children: [
|
|
1851
1907
|
t,
|
|
1852
1908
|
/* @__PURE__ */ z("span", { className: "rfp-absolute rfp-left-1/2 -rfp-translate-x-1/2 rfp-top-full rfp-mt-1.5 rfp-px-2 rfp-py-1 rfp-text-xs rfp-rounded rfp-whitespace-nowrap rfp-pointer-events-none rfp-opacity-0 rfp-invisible group-hover:rfp-opacity-100 group-hover:rfp-visible rfp-transition-opacity rfp-duration-200 rfp-z-50 rfp-bg-fg-primary rfp-text-fg-inverse", children: [
|
|
1853
|
-
/* @__PURE__ */
|
|
1854
|
-
/* @__PURE__ */
|
|
1909
|
+
/* @__PURE__ */ s("span", { className: "rfp-absolute rfp-left-1/2 -rfp-translate-x-1/2 -rfp-top-1 rfp-w-2 rfp-h-2 rfp-rotate-45 rfp-bg-fg-primary" }),
|
|
1910
|
+
/* @__PURE__ */ s("span", { className: "rfp-relative", children: e })
|
|
1855
1911
|
] })
|
|
1856
1912
|
]
|
|
1857
1913
|
}
|
|
1858
|
-
),
|
|
1914
|
+
), Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1859
1915
|
__proto__: null,
|
|
1860
|
-
FilePreviewContent:
|
|
1916
|
+
FilePreviewContent: ht
|
|
1861
1917
|
}, Symbol.toStringTag, { value: "Module" })), No = ({
|
|
1862
1918
|
files: t,
|
|
1863
1919
|
currentIndex: e,
|
|
1864
1920
|
isOpen: r,
|
|
1865
|
-
onClose:
|
|
1921
|
+
onClose: o,
|
|
1866
1922
|
onNavigate: a,
|
|
1867
|
-
customRenderers:
|
|
1923
|
+
customRenderers: n = [],
|
|
1868
1924
|
locale: i,
|
|
1869
|
-
messages:
|
|
1925
|
+
messages: l,
|
|
1870
1926
|
headless: p,
|
|
1871
|
-
theme:
|
|
1872
|
-
onCustomEvent:
|
|
1927
|
+
theme: f = "dark",
|
|
1928
|
+
onCustomEvent: c,
|
|
1873
1929
|
requestInit: d,
|
|
1874
1930
|
requestHandler: h,
|
|
1875
1931
|
shouldFetchAsBlob: u,
|
|
1876
1932
|
onDownload: _
|
|
1877
1933
|
}) => {
|
|
1878
|
-
const [M,
|
|
1934
|
+
const [M, x] = y(
|
|
1879
1935
|
() => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
1880
1936
|
);
|
|
1881
|
-
|
|
1882
|
-
if (
|
|
1883
|
-
const k = window.matchMedia("(prefers-color-scheme: dark)"),
|
|
1884
|
-
return k.addEventListener("change",
|
|
1885
|
-
}, [
|
|
1886
|
-
const F =
|
|
1887
|
-
if (
|
|
1937
|
+
S(() => {
|
|
1938
|
+
if (f !== "auto") return;
|
|
1939
|
+
const k = window.matchMedia("(prefers-color-scheme: dark)"), N = (v) => x(v.matches);
|
|
1940
|
+
return k.addEventListener("change", N), () => k.removeEventListener("change", N);
|
|
1941
|
+
}, [f]);
|
|
1942
|
+
const F = f === "auto" ? M ? "dark" : "light" : f;
|
|
1943
|
+
if (S(() => {
|
|
1888
1944
|
if (r) {
|
|
1889
|
-
const k = document.body.style.overflow,
|
|
1890
|
-
return document.body.style.overflow = "hidden",
|
|
1891
|
-
document.body.style.overflow = k, document.body.style.paddingRight =
|
|
1945
|
+
const k = document.body.style.overflow, N = document.body.style.paddingRight, v = window.innerWidth - document.documentElement.clientWidth;
|
|
1946
|
+
return document.body.style.overflow = "hidden", v > 0 && (document.body.style.paddingRight = `${v}px`), () => {
|
|
1947
|
+
document.body.style.overflow = k, document.body.style.paddingRight = N;
|
|
1892
1948
|
};
|
|
1893
1949
|
}
|
|
1894
1950
|
}, [r]), !r) return null;
|
|
1895
|
-
const T = /* @__PURE__ */
|
|
1896
|
-
|
|
1951
|
+
const T = /* @__PURE__ */ s("div", { className: "rfp-root", "data-theme": F, children: /* @__PURE__ */ s(je, { children: r && /* @__PURE__ */ s(
|
|
1952
|
+
tt.div,
|
|
1897
1953
|
{
|
|
1898
1954
|
initial: { opacity: 0 },
|
|
1899
1955
|
animate: { opacity: 1 },
|
|
1900
1956
|
exit: { opacity: 0 },
|
|
1901
1957
|
className: "rfp-fixed rfp-inset-0 rfp-z-[9999] rfp-flex rfp-items-center rfp-justify-center rfp-backdrop-blur-md rfp-overflow-hidden rfp-bg-surface-overlay",
|
|
1902
|
-
onClick:
|
|
1958
|
+
onClick: o,
|
|
1903
1959
|
onWheel: (k) => k.stopPropagation(),
|
|
1904
|
-
children: /* @__PURE__ */
|
|
1960
|
+
children: /* @__PURE__ */ s(
|
|
1905
1961
|
"div",
|
|
1906
1962
|
{
|
|
1907
1963
|
className: "rfp-relative rfp-w-full rfp-h-full",
|
|
1908
1964
|
onClick: (k) => k.stopPropagation(),
|
|
1909
|
-
children: /* @__PURE__ */
|
|
1910
|
-
|
|
1965
|
+
children: /* @__PURE__ */ s(
|
|
1966
|
+
ht,
|
|
1911
1967
|
{
|
|
1912
1968
|
mode: "modal",
|
|
1913
1969
|
files: t,
|
|
1914
1970
|
currentIndex: e,
|
|
1915
|
-
onClose:
|
|
1971
|
+
onClose: o,
|
|
1916
1972
|
onNavigate: a,
|
|
1917
|
-
customRenderers:
|
|
1973
|
+
customRenderers: n,
|
|
1918
1974
|
locale: i,
|
|
1919
|
-
messages:
|
|
1975
|
+
messages: l,
|
|
1920
1976
|
headless: p,
|
|
1921
|
-
theme:
|
|
1922
|
-
onCustomEvent:
|
|
1977
|
+
theme: f,
|
|
1978
|
+
onCustomEvent: c,
|
|
1923
1979
|
requestInit: d,
|
|
1924
1980
|
requestHandler: h,
|
|
1925
1981
|
shouldFetchAsBlob: u,
|
|
@@ -1930,102 +1986,96 @@ const Lr = N(
|
|
|
1930
1986
|
)
|
|
1931
1987
|
}
|
|
1932
1988
|
) }) });
|
|
1933
|
-
return
|
|
1934
|
-
},
|
|
1989
|
+
return ze(T, document.body);
|
|
1990
|
+
}, Mo = ({
|
|
1935
1991
|
files: t,
|
|
1936
1992
|
currentIndex: e = 0,
|
|
1937
1993
|
onNavigate: r,
|
|
1938
|
-
customRenderers:
|
|
1994
|
+
customRenderers: o = [],
|
|
1939
1995
|
width: a = "100%",
|
|
1940
|
-
height:
|
|
1996
|
+
height: n = "100%",
|
|
1941
1997
|
className: i,
|
|
1942
|
-
style:
|
|
1998
|
+
style: l,
|
|
1943
1999
|
locale: p,
|
|
1944
|
-
messages:
|
|
1945
|
-
headless:
|
|
2000
|
+
messages: f,
|
|
2001
|
+
headless: c,
|
|
1946
2002
|
theme: d = "dark",
|
|
1947
2003
|
onCustomEvent: h,
|
|
1948
2004
|
requestInit: u,
|
|
1949
2005
|
requestHandler: _,
|
|
1950
2006
|
shouldFetchAsBlob: M,
|
|
1951
|
-
onDownload:
|
|
2007
|
+
onDownload: x
|
|
1952
2008
|
}) => {
|
|
1953
2009
|
const [F, T] = y(
|
|
1954
2010
|
() => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
1955
2011
|
);
|
|
1956
|
-
|
|
2012
|
+
S(() => {
|
|
1957
2013
|
if (d !== "auto") return;
|
|
1958
|
-
const
|
|
1959
|
-
return
|
|
2014
|
+
const N = window.matchMedia("(prefers-color-scheme: dark)"), v = (L) => T(L.matches);
|
|
2015
|
+
return N.addEventListener("change", v), () => N.removeEventListener("change", v);
|
|
1960
2016
|
}, [d]);
|
|
1961
2017
|
const k = d === "auto" ? F ? "dark" : "light" : d;
|
|
1962
|
-
return /* @__PURE__ */
|
|
2018
|
+
return /* @__PURE__ */ s(
|
|
1963
2019
|
"div",
|
|
1964
2020
|
{
|
|
1965
2021
|
className: `rfp-root ${i ?? ""}`,
|
|
1966
|
-
style: { width: a, height:
|
|
2022
|
+
style: { width: a, height: n, ...l },
|
|
1967
2023
|
"data-theme": k,
|
|
1968
|
-
children: /* @__PURE__ */
|
|
1969
|
-
|
|
2024
|
+
children: /* @__PURE__ */ s("div", { className: "rfp-relative rfp-w-full rfp-h-full rfp-overflow-hidden rfp-bg-surface-overlay", children: /* @__PURE__ */ s(
|
|
2025
|
+
ht,
|
|
1970
2026
|
{
|
|
1971
2027
|
mode: "embed",
|
|
1972
2028
|
files: t,
|
|
1973
2029
|
currentIndex: e,
|
|
1974
2030
|
onNavigate: r,
|
|
1975
|
-
customRenderers:
|
|
2031
|
+
customRenderers: o,
|
|
1976
2032
|
locale: p,
|
|
1977
|
-
messages:
|
|
1978
|
-
headless:
|
|
2033
|
+
messages: f,
|
|
2034
|
+
headless: c,
|
|
1979
2035
|
theme: d,
|
|
1980
2036
|
onCustomEvent: h,
|
|
1981
2037
|
requestInit: u,
|
|
1982
2038
|
requestHandler: _,
|
|
1983
2039
|
shouldFetchAsBlob: M,
|
|
1984
|
-
onDownload:
|
|
2040
|
+
onDownload: x
|
|
1985
2041
|
}
|
|
1986
2042
|
) })
|
|
1987
2043
|
}
|
|
1988
2044
|
);
|
|
1989
2045
|
};
|
|
1990
|
-
function
|
|
1991
|
-
|
|
1992
|
-
const {
|
|
1993
|
-
workerSrc: e = `https://unpkg.com/pdfjs-dist@${X.version}/build/pdf.worker.min.mjs`,
|
|
1994
|
-
cMapUrl: r = `https://unpkg.com/pdfjs-dist@${X.version}/cmaps/`,
|
|
1995
|
-
cMapPacked: n = !0
|
|
1996
|
-
} = t || {};
|
|
1997
|
-
X.GlobalWorkerOptions.workerSrc = e, X.GlobalWorkerOptions.cMapUrl = r, X.GlobalWorkerOptions.cMapPacked = n;
|
|
2046
|
+
function To(t) {
|
|
2047
|
+
br(Ze, t);
|
|
1998
2048
|
}
|
|
1999
|
-
|
|
2000
|
-
const Mo = Ue.version;
|
|
2049
|
+
const Po = Ue.version;
|
|
2001
2050
|
export {
|
|
2051
|
+
Ve as A,
|
|
2002
2052
|
go as C,
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
xo as
|
|
2007
|
-
vo as
|
|
2008
|
-
|
|
2009
|
-
Mo as V,
|
|
2053
|
+
yo as E,
|
|
2054
|
+
ho as F,
|
|
2055
|
+
_o as L,
|
|
2056
|
+
xo as S,
|
|
2057
|
+
vo as T,
|
|
2058
|
+
Po as V,
|
|
2010
2059
|
bo as _,
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2060
|
+
Lr as a,
|
|
2061
|
+
Co as b,
|
|
2062
|
+
mo as c,
|
|
2014
2063
|
wo as d,
|
|
2015
2064
|
Be as e,
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2065
|
+
ht as f,
|
|
2066
|
+
Mo as g,
|
|
2067
|
+
qe as h,
|
|
2019
2068
|
No as i,
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2069
|
+
yr as j,
|
|
2070
|
+
nt as k,
|
|
2071
|
+
fo as l,
|
|
2072
|
+
To as m,
|
|
2073
|
+
He as n,
|
|
2074
|
+
ko as o,
|
|
2075
|
+
co as p,
|
|
2076
|
+
Ro as q,
|
|
2077
|
+
Jt as u,
|
|
2027
2078
|
uo as x,
|
|
2028
|
-
|
|
2029
|
-
yo as z
|
|
2079
|
+
Fo as z
|
|
2030
2080
|
};
|
|
2031
|
-
//# sourceMappingURL=index-
|
|
2081
|
+
//# sourceMappingURL=index-CGNWXFy3.mjs.map
|