@eternalheart/react-file-preview 1.3.12 → 1.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +27 -0
  2. package/README.zh-CN.md +27 -0
  3. package/lib/FilePreviewEmbed.d.ts +2 -0
  4. package/lib/FilePreviewEmbed.d.ts.map +1 -1
  5. package/lib/chunks/{index-BCbSb9Ob.mjs → index--lXiT1Y_.mjs} +77 -75
  6. package/lib/chunks/index--lXiT1Y_.mjs.map +1 -0
  7. package/lib/chunks/index-B05UpMZC.mjs +270 -0
  8. package/lib/chunks/index-B05UpMZC.mjs.map +1 -0
  9. package/lib/chunks/{index-DJZWizxK.mjs → index-BG3Idu38.mjs} +2 -2
  10. package/lib/chunks/{index-DJZWizxK.mjs.map → index-BG3Idu38.mjs.map} +1 -1
  11. package/lib/chunks/{index-DCTwUpKS.mjs → index-BTLV1YqJ.mjs} +2 -2
  12. package/lib/chunks/{index-DCTwUpKS.mjs.map → index-BTLV1YqJ.mjs.map} +1 -1
  13. package/lib/chunks/{index-BBvL23cc.mjs → index-B_7NPlPG.mjs} +2 -2
  14. package/lib/chunks/{index-BBvL23cc.mjs.map → index-B_7NPlPG.mjs.map} +1 -1
  15. package/lib/chunks/{index-DRCA7PhQ.mjs → index-BaU-yih3.mjs} +2 -2
  16. package/lib/chunks/{index-DRCA7PhQ.mjs.map → index-BaU-yih3.mjs.map} +1 -1
  17. package/lib/chunks/{index-qEUWJYQ5.mjs → index-BfzV7KIz.mjs} +2 -2
  18. package/lib/chunks/{index-qEUWJYQ5.mjs.map → index-BfzV7KIz.mjs.map} +1 -1
  19. package/lib/chunks/{index-D2t64h6I.mjs → index-Br8WHz8e.mjs} +2 -2
  20. package/lib/chunks/{index-D2t64h6I.mjs.map → index-Br8WHz8e.mjs.map} +1 -1
  21. package/lib/chunks/{index-DrgP7cc7.mjs → index-CaobN7Im.mjs} +3 -3
  22. package/lib/chunks/{index-DrgP7cc7.mjs.map → index-CaobN7Im.mjs.map} +1 -1
  23. package/lib/chunks/{index-CA8OvqPT.mjs → index-Ch7DqyC4.mjs} +3 -3
  24. package/lib/chunks/{index-CA8OvqPT.mjs.map → index-Ch7DqyC4.mjs.map} +1 -1
  25. package/lib/chunks/{index-BPsJtP6e.mjs → index-DCGk-moA.mjs} +2 -2
  26. package/lib/chunks/{index-BPsJtP6e.mjs.map → index-DCGk-moA.mjs.map} +1 -1
  27. package/lib/chunks/{index-Dx8aLIDX.mjs → index-DEzF8C7L.mjs} +2 -2
  28. package/lib/chunks/{index-Dx8aLIDX.mjs.map → index-DEzF8C7L.mjs.map} +1 -1
  29. package/lib/chunks/{index-vaILKWGV.mjs → index-DKwN-YU-.mjs} +3 -3
  30. package/lib/chunks/{index-vaILKWGV.mjs.map → index-DKwN-YU-.mjs.map} +1 -1
  31. package/lib/chunks/index-DMmb2rBE.mjs +357 -0
  32. package/lib/chunks/index-DMmb2rBE.mjs.map +1 -0
  33. package/lib/chunks/{index-DdkkEzw3.mjs → index-D_cBflBv.mjs} +2 -2
  34. package/lib/chunks/{index-DdkkEzw3.mjs.map → index-D_cBflBv.mjs.map} +1 -1
  35. package/lib/chunks/{index-DlptjfMf.mjs → index-Dq-90KbM.mjs} +2 -2
  36. package/lib/chunks/{index-DlptjfMf.mjs.map → index-Dq-90KbM.mjs.map} +1 -1
  37. package/lib/chunks/{index-CJGtdAy7.mjs → index-Go2oJfny.mjs} +2 -2
  38. package/lib/chunks/{index-CJGtdAy7.mjs.map → index-Go2oJfny.mjs.map} +1 -1
  39. package/lib/chunks/{index-Cxf4CLJZ.mjs → index-d8Bt4gIX.mjs} +2 -2
  40. package/lib/chunks/{index-Cxf4CLJZ.mjs.map → index-d8Bt4gIX.mjs.map} +1 -1
  41. package/lib/chunks/{index-DAo4n3Mq.mjs → index-jHf5E4be.mjs} +2 -2
  42. package/lib/chunks/{index-DAo4n3Mq.mjs.map → index-jHf5E4be.mjs.map} +1 -1
  43. package/lib/chunks/{useShikiHighlight-Cq02e63J.mjs → useShikiHighlight-DoY3TBPT.mjs} +2 -2
  44. package/lib/chunks/{useShikiHighlight-Cq02e63J.mjs.map → useShikiHighlight-DoY3TBPT.mjs.map} +1 -1
  45. package/lib/components/ResizableSplit.d.ts +12 -2
  46. package/lib/components/ResizableSplit.d.ts.map +1 -1
  47. package/lib/index.cjs +30 -30
  48. package/lib/index.cjs.map +1 -1
  49. package/lib/index.css +1 -1
  50. package/lib/index.mjs +1 -1
  51. package/lib/renderers/Image/index.d.ts.map +1 -1
  52. package/lib/renderers/Zip/index.d.ts.map +1 -1
  53. package/package.json +1 -1
  54. package/lib/chunks/index-BCbSb9Ob.mjs.map +0 -1
  55. package/lib/chunks/index-CeQf1qNC.mjs +0 -301
  56. package/lib/chunks/index-CeQf1qNC.mjs.map +0 -1
  57. package/lib/chunks/index-fhiaa9rv.mjs +0 -222
  58. package/lib/chunks/index-fhiaa9rv.mjs.map +0 -1
package/README.md CHANGED
@@ -111,6 +111,33 @@ configurePdfjs({
111
111
  });
112
112
  ```
113
113
 
114
+ ### Vite Bundler Note (AVIF Decoder)
115
+
116
+ If your project bundler is Vite and you happen to have `@jsquash/avif` installed (transitively or directly), the production build may fail with:
117
+
118
+ ```
119
+ [commonjs--resolver] Invalid value "iife" for option "worker.format"
120
+ - UMD and IIFE output formats are not supported for code-splitting builds.
121
+ file: .../@jsquash/avif/codec/enc/avif_enc_mt.js
122
+ ```
123
+
124
+ This happens because `@jsquash/avif` ships a multi-threaded worker that uses code-splitting, while Vite's default `worker.format` is `'iife'`, which does not support split chunks.
125
+
126
+ **Fix** — add this to your `vite.config.ts`:
127
+
128
+ ```ts
129
+ export default defineConfig({
130
+ // ... your existing config
131
+ worker: {
132
+ format: 'es',
133
+ },
134
+ });
135
+ ```
136
+
137
+ `'es'` produces module workers (`type: 'module'`), supported by all modern browsers and compatible with code-splitting.
138
+
139
+ > Note: `@jsquash/avif` is only used as a fallback when the browser does not natively support AVIF (Chrome 85+, Firefox 93+, Safari 16+ all support it natively). If your target browsers cover the native list, you can also remove `@jsquash/avif` from your dependencies entirely.
140
+
114
141
  ## 🚀 Quick Start
115
142
 
116
143
  📖 **New to this library?** Check out the [Quick Start Guide](./QUICK_START.md) for a 5-minute introduction!
package/README.zh-CN.md CHANGED
@@ -109,6 +109,33 @@ configurePdfjs({
109
109
  });
110
110
  ```
111
111
 
112
+ ### Vite 打包提示(AVIF 解码器)
113
+
114
+ 如果你的项目使用 Vite 打包,且项目里安装了 `@jsquash/avif`(直接安装或被其它依赖间接引入),生产构建时可能报错:
115
+
116
+ ```
117
+ [commonjs--resolver] Invalid value "iife" for option "worker.format"
118
+ - UMD and IIFE output formats are not supported for code-splitting builds.
119
+ file: .../@jsquash/avif/codec/enc/avif_enc_mt.js
120
+ ```
121
+
122
+ 原因:`@jsquash/avif` 内部包含一个使用代码分割的多线程 worker,而 Vite 默认的 `worker.format` 是 `'iife'`,不支持多 chunk 拆分。
123
+
124
+ **解决方法** —— 在你的 `vite.config.ts` 中加入:
125
+
126
+ ```ts
127
+ export default defineConfig({
128
+ // ... 原有配置
129
+ worker: {
130
+ format: 'es',
131
+ },
132
+ });
133
+ ```
134
+
135
+ `'es'` 会产生 module worker(`type: 'module'`),现代浏览器全部支持,且兼容代码分割。
136
+
137
+ > 说明:`@jsquash/avif` 仅在浏览器不原生支持 AVIF 时作为兜底使用(Chrome 85+、Firefox 93+、Safari 16+ 均已原生支持)。如果你的目标浏览器都覆盖原生支持范围,也可以直接从依赖中移除 `@jsquash/avif`。
138
+
112
139
  ## 🚀 快速开始
113
140
 
114
141
  📖 **第一次使用?** 查看 [快速开始指南](./QUICK_START.md) 获取 5 分钟入门教程!
@@ -29,6 +29,8 @@ interface FilePreviewEmbedProps {
29
29
  shouldFetchAsBlob?: ShouldFetchAsBlob;
30
30
  /** 自定义下载回调;不传时库内默认通过 fetcher 拉 Blob 触发下载 */
31
31
  onDownload?: (file: PreviewFile) => void | Promise<void>;
32
+ /** 关闭回调:传入后工具栏显示关闭按钮 */
33
+ onClose?: () => void;
32
34
  }
33
35
  export declare const FilePreviewEmbed: React.FC<FilePreviewEmbedProps>;
34
36
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"FilePreviewEmbed.d.ts","sourceRoot":"","sources":["../src/FilePreviewEmbed.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,0BAA0B,EAAE,WAAW,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAE/K,UAAU,qBAAqB;IAC7B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACtD,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,oBAAoB;IACpB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAC5D,mDAAmD;IACnD,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,4BAA4B;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,4CAA4C;IAC5C,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1D;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA6D5D,CAAC"}
1
+ {"version":3,"file":"FilePreviewEmbed.d.ts","sourceRoot":"","sources":["../src/FilePreviewEmbed.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,0BAA0B,EAAE,WAAW,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAE/K,UAAU,qBAAqB;IAC7B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACtD,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,oBAAoB;IACpB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAC5D,mDAAmD;IACnD,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,4BAA4B;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,4CAA4C;IAC5C,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,wBAAwB;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA+D5D,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import { jsx as p, jsxs as z, Fragment as _e } from "react/jsx-runtime";
2
- import ke, { useMemo as I, useContext as q, createContext as at, useState as F, useRef as V, useEffect as E, lazy as R, useCallback as j, Suspense as Ce } from "react";
2
+ import ke, { useMemo as I, useContext as q, createContext as at, useState as F, useRef as V, useEffect as W, lazy as R, useCallback as j, Suspense as Ce } from "react";
3
3
  import { createPortal as Ne } from "react-dom";
4
4
  import { motion as Y, AnimatePresence as Re } from "framer-motion";
5
5
  import { ZoomOut as qt, ZoomIn as Gt, Scan as Me, RotateCcw as Pe, RotateCw as je, RefreshCw as Xt, List as Kt, ChevronLeft as it, ChevronRight as st, Minimize2 as Jt, Maximize2 as Yt, WrapText as ze, Code as Qt, Eye as te, FileQuestion as Te, Download as ee, X as Se } from "lucide-react";
6
6
  import Ee from "jszip";
7
7
  import * as Le from "pdfjs-dist/build/pdf.mjs";
8
- const We = "1.3.12", $e = {
8
+ const We = "1.3.14", $e = {
9
9
  version: We
10
10
  }, hr = [
11
11
  "image",
@@ -555,8 +555,8 @@ function Ye(t) {
555
555
  a.lastIndex = 0;
556
556
  let u;
557
557
  for (; (u = a.exec(s.raw)) !== null; ) {
558
- const P = s.raw.slice(d, u.index);
559
- m !== null && P && f.push({ start: Math.max(0, m - i), text: P }), c += P, m = nt(u[1], u[2], u[3]), d = u.index + u[0].length;
558
+ const M = s.raw.slice(d, u.index);
559
+ m !== null && M && f.push({ start: Math.max(0, m - i), text: M }), c += M, m = nt(u[1], u[2], u[3]), d = u.index + u[0].length;
560
560
  }
561
561
  const w = s.raw.slice(d);
562
562
  m !== null && w && f.push({ start: Math.max(0, m - i), text: w }), c += w;
@@ -597,13 +597,13 @@ function Vt(t, e) {
597
597
  const m = /^(Dialogue|Comment):\s*(.+)$/i.exec(f);
598
598
  if (!m || m[1].toLowerCase() === "comment" || a.length === 0) continue;
599
599
  const u = a.length, w = m[2].split(","), C = w.slice(0, u - 1), x = w.slice(u - 1).join(","), _ = {};
600
- a.forEach((y, L) => {
601
- _[y] = L === u - 1 ? x : C[L] ?? "";
600
+ a.forEach((y, E) => {
601
+ _[y] = E === u - 1 ? x : C[E] ?? "";
602
602
  });
603
- const P = It(_.Start || ""), k = It(_.End || ""), M = (_.Text || "").replace(/\\N/g, `
603
+ const M = It(_.Start || ""), k = It(_.End || ""), P = (_.Text || "").replace(/\\N/g, `
604
604
  `).replace(/\\n/g, `
605
605
  `).replace(/\\h/g, " ").replace(/\{[^}]*\}/g, "");
606
- n.push({ start: P, end: k, text: M, style: _.Style });
606
+ n.push({ start: M, end: k, text: P, style: _.Style });
607
607
  }
608
608
  return n.sort((s, l) => s.start - l.start), {
609
609
  format: e,
@@ -945,18 +945,18 @@ function Nr(t) {
945
945
  const f = /* @__PURE__ */ new Map(), c = o.model, d = (c == null ? void 0 : c.merges) || [];
946
946
  for (const m of d) {
947
947
  n.push(m);
948
- const { top: u, left: w, bottom: C, right: x } = uo(m), _ = C - u, P = x - w;
949
- f.set(`${u - 1},${w - 1}`, [_, P]);
948
+ const { top: u, left: w, bottom: C, right: x } = uo(m), _ = C - u, M = x - w;
949
+ f.set(`${u - 1},${w - 1}`, [_, M]);
950
950
  }
951
951
  o.eachRow({ includeEmpty: !0 }, (m, u) => {
952
952
  const w = u - 1, C = {};
953
- m.eachCell({ includeEmpty: !1 }, (_, P) => {
954
- const k = P - 1;
953
+ m.eachCell({ includeEmpty: !1 }, (_, M) => {
954
+ const k = M - 1;
955
955
  if (_.isMerged && _.master !== _) return;
956
- const M = co(_), y = fo(_, r, a), L = { text: M };
957
- y !== -1 && (L.style = y);
958
- const W = `${w},${k}`;
959
- f.has(W) && (L.merge = f.get(W)), C[String(k)] = L;
956
+ const P = co(_), y = fo(_, r, a), E = { text: P };
957
+ y !== -1 && (E.style = y);
958
+ const L = `${w},${k}`;
959
+ f.has(L) && (E.merge = f.get(L)), C[String(k)] = E;
960
960
  });
961
961
  const x = { cells: C };
962
962
  m.height && (x.height = Math.round(m.height * 1.333)), i[String(w)] = x;
@@ -1654,7 +1654,7 @@ function $o() {
1654
1654
  }
1655
1655
  function Do(t) {
1656
1656
  const { fetcher: e, shouldFetchAsBlob: o } = q(ct), r = !!(t && (o != null && o(t))), [a, n] = F(""), i = V(null);
1657
- return E(() => {
1657
+ return W(() => {
1658
1658
  if (!t || !r) {
1659
1659
  i.current && (URL.revokeObjectURL(i.current), i.current = null), n("");
1660
1660
  return;
@@ -1671,46 +1671,46 @@ function Do(t) {
1671
1671
  }), () => {
1672
1672
  s = !0;
1673
1673
  };
1674
- }, [t == null ? void 0 : t.id, t == null ? void 0 : t.url, r, e]), E(() => () => {
1674
+ }, [t == null ? void 0 : t.id, t == null ? void 0 : t.url, r, e]), W(() => () => {
1675
1675
  i.current && (URL.revokeObjectURL(i.current), i.current = null);
1676
1676
  }, []), t ? r ? a : t.url : "";
1677
1677
  }
1678
1678
  const Ao = R(
1679
- () => import("./index-fhiaa9rv.mjs").then((t) => ({ default: t.ImageRenderer }))
1679
+ () => import("./index-B05UpMZC.mjs").then((t) => ({ default: t.ImageRenderer }))
1680
1680
  ), Uo = R(
1681
- () => import("./index-DAo4n3Mq.mjs").then((t) => ({ default: t.PdfRenderer }))
1681
+ () => import("./index-jHf5E4be.mjs").then((t) => ({ default: t.PdfRenderer }))
1682
1682
  ), Oo = R(
1683
- () => import("./index-BBvL23cc.mjs").then((t) => ({ default: t.DocxRenderer }))
1683
+ () => import("./index-B_7NPlPG.mjs").then((t) => ({ default: t.DocxRenderer }))
1684
1684
  ), Zo = R(
1685
- () => import("./index-Dx8aLIDX.mjs").then((t) => ({ default: t.XlsxRenderer }))
1685
+ () => import("./index-DEzF8C7L.mjs").then((t) => ({ default: t.XlsxRenderer }))
1686
1686
  ), Io = R(
1687
- () => import("./index-DJZWizxK.mjs").then((t) => ({ default: t.PptxRenderer }))
1687
+ () => import("./index-BG3Idu38.mjs").then((t) => ({ default: t.PptxRenderer }))
1688
1688
  ), Vo = R(
1689
- () => import("./index-DCTwUpKS.mjs").then((t) => ({ default: t.MsgRenderer }))
1689
+ () => import("./index-BTLV1YqJ.mjs").then((t) => ({ default: t.MsgRenderer }))
1690
1690
  ), Bo = R(
1691
- () => import("./index-DlptjfMf.mjs").then((t) => ({ default: t.EpubRenderer }))
1691
+ () => import("./index-Dq-90KbM.mjs").then((t) => ({ default: t.EpubRenderer }))
1692
1692
  ), Ho = R(
1693
- () => import("./index-DRCA7PhQ.mjs").then((t) => ({ default: t.MobiRenderer }))
1693
+ () => import("./index-BaU-yih3.mjs").then((t) => ({ default: t.MobiRenderer }))
1694
1694
  ), qo = R(
1695
- () => import("./index-CJGtdAy7.mjs").then((t) => ({ default: t.VideoRenderer }))
1695
+ () => import("./index-Go2oJfny.mjs").then((t) => ({ default: t.VideoRenderer }))
1696
1696
  ), Go = R(
1697
- () => import("./index-Cxf4CLJZ.mjs").then((t) => ({ default: t.AudioRenderer }))
1697
+ () => import("./index-d8Bt4gIX.mjs").then((t) => ({ default: t.AudioRenderer }))
1698
1698
  ), Xo = R(
1699
- () => import("./index-DrgP7cc7.mjs").then((t) => ({ default: t.MarkdownRenderer }))
1699
+ () => import("./index-CaobN7Im.mjs").then((t) => ({ default: t.MarkdownRenderer }))
1700
1700
  ), Ko = R(
1701
- () => import("./index-qEUWJYQ5.mjs").then((t) => ({ default: t.JsonRenderer }))
1701
+ () => import("./index-BfzV7KIz.mjs").then((t) => ({ default: t.JsonRenderer }))
1702
1702
  ), Jo = R(
1703
- () => import("./index-D2t64h6I.mjs").then((t) => ({ default: t.CsvRenderer }))
1703
+ () => import("./index-Br8WHz8e.mjs").then((t) => ({ default: t.CsvRenderer }))
1704
1704
  ), Yo = R(
1705
- () => import("./index-vaILKWGV.mjs").then((t) => ({ default: t.XmlRenderer }))
1705
+ () => import("./index-DKwN-YU-.mjs").then((t) => ({ default: t.XmlRenderer }))
1706
1706
  ), Qo = R(
1707
- () => import("./index-BPsJtP6e.mjs").then((t) => ({ default: t.SubtitleRenderer }))
1707
+ () => import("./index-DCGk-moA.mjs").then((t) => ({ default: t.SubtitleRenderer }))
1708
1708
  ), tr = R(
1709
- () => import("./index-CeQf1qNC.mjs").then((t) => ({ default: t.ZipRenderer }))
1709
+ () => import("./index-DMmb2rBE.mjs").then((t) => ({ default: t.ZipRenderer }))
1710
1710
  ), er = R(
1711
- () => import("./index-CA8OvqPT.mjs").then((t) => ({ default: t.TextRenderer }))
1711
+ () => import("./index-Ch7DqyC4.mjs").then((t) => ({ default: t.TextRenderer }))
1712
1712
  ), or = R(
1713
- () => import("./index-DdkkEzw3.mjs").then((t) => ({ default: t.FontRenderer }))
1713
+ () => import("./index-D_cBflBv.mjs").then((t) => ({ default: t.FontRenderer }))
1714
1714
  ), Ht = ({
1715
1715
  fileName: t,
1716
1716
  fileType: e,
@@ -1774,15 +1774,15 @@ const Ao = R(
1774
1774
  const x = I(
1775
1775
  () => pt({ locale: s, messages: l }),
1776
1776
  [s, l]
1777
- ), [_, P] = F(
1777
+ ), [_, M] = F(
1778
1778
  () => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
1779
1779
  );
1780
- E(() => {
1780
+ W(() => {
1781
1781
  if (c !== "auto") return;
1782
- const h = window.matchMedia("(prefers-color-scheme: dark)"), v = (T) => P(T.matches);
1782
+ const h = window.matchMedia("(prefers-color-scheme: dark)"), v = (T) => M(T.matches);
1783
1783
  return h.addEventListener("change", v), () => h.removeEventListener("change", v);
1784
1784
  }, [c]);
1785
- const k = c === "auto" ? _ ? "dark" : "light" : c, [M, y] = F(1), [L, W] = F(0), [ae, ut] = F(1), [, mt] = F(1), [A, Q] = F(0), [U, ht] = F(0), [ie, G] = F(0), $ = V(null), gt = V(null), bt = V(null), [se, wt] = F(0), [le, vt] = F(0), [pe, xt] = F(!1), yt = V(null), [fe, Ft] = F(0), [ce, _t] = F(0), [de, kt] = F(!1), [ue, Ct] = F(null), [Nt, Rt] = F(!0), [Mt, Pt] = F(!1), [jt, zt] = F("preview"), O = I(() => Ue(t), [t]), g = O[e], N = Do(g), Z = I(() => g ? r.find((h) => h.test(g)) : null, [g, r]), b = g ? Oe(g) : "unsupported", Tt = j(
1785
+ const k = c === "auto" ? _ ? "dark" : "light" : c, [P, y] = F(1), [E, L] = F(0), [ae, ut] = F(1), [, mt] = F(1), [A, Q] = F(0), [U, ht] = F(0), [ie, G] = F(0), $ = V(null), gt = V(null), bt = V(null), [se, wt] = F(0), [le, vt] = F(0), [pe, xt] = F(!1), yt = V(null), [fe, Ft] = F(0), [ce, _t] = F(0), [de, kt] = F(!1), [ue, Ct] = F(null), [Nt, Rt] = F(!0), [Mt, Pt] = F(!1), [jt, zt] = F("preview"), O = I(() => Ue(t), [t]), g = O[e], N = Do(g), Z = I(() => g ? r.find((h) => h.test(g)) : null, [g, r]), b = g ? Oe(g) : "unsupported", Tt = j(
1786
1786
  (h, v) => {
1787
1787
  g && (d == null || d({ name: h, payload: v, file: g }));
1788
1788
  },
@@ -1796,14 +1796,14 @@ const Ao = R(
1796
1796
  }),
1797
1797
  [Tt, x, k, s]
1798
1798
  );
1799
- E(() => {
1800
- y(1), W(0), ut(1), mt(1), Q(0), ht(0), G(0), wt(0), vt(0), xt(!1), Ft(0), _t(0), kt(!1), Ct(null), Rt(!0), Pt(!1), zt("preview");
1801
- }, [e]), E(() => {
1799
+ W(() => {
1800
+ y(1), L(0), ut(1), mt(1), Q(0), ht(0), G(0), wt(0), vt(0), xt(!1), Ft(0), _t(0), kt(!1), Ct(null), Rt(!0), Pt(!1), zt("preview");
1801
+ }, [e]), W(() => {
1802
1802
  if (b === "image" && A > 0 && U > 0 && $.current) {
1803
1803
  const h = $.current.clientWidth, v = $.current.clientHeight, T = h / A, S = v / U, H = Math.min(T, S);
1804
1804
  y(Math.max(0.01, Math.min(10, H)));
1805
1805
  }
1806
- }, [b, A, U]), E(() => {
1806
+ }, [b, A, U]), W(() => {
1807
1807
  const h = (v) => {
1808
1808
  v.key === "Escape" && a === "modal" ? n == null || n() : v.key === "ArrowLeft" && e > 0 ? o == null || o(e - 1) : v.key === "ArrowRight" && e < O.length - 1 && (o == null || o(e + 1));
1809
1809
  };
@@ -1819,22 +1819,22 @@ const Ao = R(
1819
1819
  }, []), Lt = j(() => {
1820
1820
  y((h) => Math.max(h - 0.1, 0.01));
1821
1821
  }, []), me = j(() => {
1822
- W((h) => h + 90);
1822
+ L((h) => h + 90);
1823
1823
  }, []), he = j(() => {
1824
- W((h) => h - 90);
1824
+ L((h) => h - 90);
1825
1825
  }, []), ge = j(() => {
1826
1826
  if ($.current && A > 0 && U > 0) {
1827
1827
  const h = $.current.clientWidth, v = $.current.clientHeight, T = h / A, S = v / U, H = Math.min(T, S);
1828
1828
  y(Math.max(0.01, Math.min(10, H)));
1829
1829
  } else
1830
1830
  y(1);
1831
- W(0), G((h) => h + 1);
1831
+ L(0), G((h) => h + 1);
1832
1832
  }, [A, U]), be = j(() => {
1833
- y(1), W(0), G((h) => h + 1);
1833
+ y(1), L(0), G((h) => h + 1);
1834
1834
  }, []), we = j((h) => {
1835
1835
  y(h);
1836
1836
  }, []), Wt = j(() => {
1837
- y(1), W(0), G((h) => h + 1);
1837
+ y(1), L(0), G((h) => h + 1);
1838
1838
  }, []), $t = $o(), tt = j(async () => {
1839
1839
  if (g) {
1840
1840
  if (m) {
@@ -1855,13 +1855,13 @@ const Ao = R(
1855
1855
  Ct(h);
1856
1856
  }, []);
1857
1857
  if (!g) return null;
1858
- const Fe = a === "modal" && !!n, X = (() => {
1858
+ const Fe = !!n, X = (() => {
1859
1859
  var h, v;
1860
1860
  if (Z)
1861
1861
  return ((h = Z.getToolbarGroups) == null ? void 0 : h.call(Z, g, St)) ?? [];
1862
1862
  if (b === "image")
1863
1863
  return Mo({
1864
- zoom: M,
1864
+ zoom: P,
1865
1865
  onZoomIn: Et,
1866
1866
  onZoomOut: Lt,
1867
1867
  onFitToWidth: ge,
@@ -1873,7 +1873,7 @@ const Ao = R(
1873
1873
  });
1874
1874
  if (b === "pdf")
1875
1875
  return Po({
1876
- zoom: M,
1876
+ zoom: P,
1877
1877
  onZoomIn: Et,
1878
1878
  onZoomOut: Lt,
1879
1879
  onReset: Wt,
@@ -1994,8 +1994,8 @@ const Ao = R(
1994
1994
  Ao,
1995
1995
  {
1996
1996
  url: N,
1997
- zoom: M,
1998
- rotation: L,
1997
+ zoom: P,
1998
+ rotation: E,
1999
1999
  resetKey: ie,
2000
2000
  fileSize: g.size,
2001
2001
  file: g,
@@ -2008,7 +2008,7 @@ const Ao = R(
2008
2008
  Uo,
2009
2009
  {
2010
2010
  url: N,
2011
- zoom: M,
2011
+ zoom: P,
2012
2012
  currentPage: ae,
2013
2013
  onPageChange: ut,
2014
2014
  onTotalPagesChange: mt,
@@ -2095,7 +2095,7 @@ const Ao = R(
2095
2095
  className: `rfp-relative rfp-group rfp-p-2 md:rfp-p-1.5 rfp-rounded-md rfp-transition-all rfp-select-none ${r ? "rfp-text-fg-disabled rfp-cursor-not-allowed" : "rfp-text-fg-primary hover:rfp-bg-surface-2 active:rfp-bg-surface-3"}`,
2096
2096
  children: [
2097
2097
  t,
2098
- /* @__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: [
2098
+ /* @__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 max-[1023px]:!rfp-hidden", children: [
2099
2099
  /* @__PURE__ */ p("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" }),
2100
2100
  /* @__PURE__ */ p("span", { className: "rfp-relative", children: e })
2101
2101
  ] })
@@ -2114,14 +2114,14 @@ const Ao = R(
2114
2114
  }, []), c = j(() => {
2115
2115
  s((d) => d || !0), f();
2116
2116
  }, [f]);
2117
- return E(() => {
2117
+ return W(() => {
2118
2118
  const d = t.current;
2119
2119
  if (!d) return;
2120
2120
  const m = () => c();
2121
2121
  return d.addEventListener("mousemove", m), () => {
2122
2122
  d.removeEventListener("mousemove", m);
2123
2123
  };
2124
- }, [t, c]), E(() => (s(!0), f(), () => {
2124
+ }, [t, c]), W(() => (s(!0), f(), () => {
2125
2125
  l.current && clearTimeout(l.current);
2126
2126
  }), [n, f]), /* @__PURE__ */ z(_e, { children: [
2127
2127
  e && /* @__PURE__ */ p(
@@ -2174,21 +2174,21 @@ const Ao = R(
2174
2174
  const [C, x] = F(
2175
2175
  () => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
2176
2176
  );
2177
- E(() => {
2177
+ W(() => {
2178
2178
  if (f !== "auto") return;
2179
- const k = window.matchMedia("(prefers-color-scheme: dark)"), M = (y) => x(y.matches);
2180
- return k.addEventListener("change", M), () => k.removeEventListener("change", M);
2179
+ const k = window.matchMedia("(prefers-color-scheme: dark)"), P = (y) => x(y.matches);
2180
+ return k.addEventListener("change", P), () => k.removeEventListener("change", P);
2181
2181
  }, [f]);
2182
2182
  const _ = f === "auto" ? C ? "dark" : "light" : f;
2183
- if (E(() => {
2183
+ if (W(() => {
2184
2184
  if (o) {
2185
- const k = document.body.style.overflow, M = document.body.style.paddingRight, y = window.innerWidth - document.documentElement.clientWidth;
2185
+ const k = document.body.style.overflow, P = document.body.style.paddingRight, y = window.innerWidth - document.documentElement.clientWidth;
2186
2186
  return document.body.style.overflow = "hidden", y > 0 && (document.body.style.paddingRight = `${y}px`), () => {
2187
- document.body.style.overflow = k, document.body.style.paddingRight = M;
2187
+ document.body.style.overflow = k, document.body.style.paddingRight = P;
2188
2188
  };
2189
2189
  }
2190
2190
  }, [o]), !o) return null;
2191
- const P = /* @__PURE__ */ p("div", { className: "rfp-root", "data-theme": _, children: /* @__PURE__ */ p(Re, { children: o && /* @__PURE__ */ p(
2191
+ const M = /* @__PURE__ */ p("div", { className: "rfp-root", "data-theme": _, children: /* @__PURE__ */ p(Re, { children: o && /* @__PURE__ */ p(
2192
2192
  Y.div,
2193
2193
  {
2194
2194
  initial: { opacity: 0 },
@@ -2226,7 +2226,7 @@ const Ao = R(
2226
2226
  )
2227
2227
  }
2228
2228
  ) }) });
2229
- return Ne(P, document.body);
2229
+ return Ne(M, document.body);
2230
2230
  }, Er = ({
2231
2231
  files: t,
2232
2232
  currentIndex: e = 0,
@@ -2244,23 +2244,24 @@ const Ao = R(
2244
2244
  requestInit: u,
2245
2245
  requestHandler: w,
2246
2246
  shouldFetchAsBlob: C,
2247
- onDownload: x
2247
+ onDownload: x,
2248
+ onClose: _
2248
2249
  }) => {
2249
- const [_, P] = F(
2250
+ const [M, k] = F(
2250
2251
  () => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
2251
2252
  );
2252
- E(() => {
2253
+ W(() => {
2253
2254
  if (d !== "auto") return;
2254
- const M = window.matchMedia("(prefers-color-scheme: dark)"), y = (L) => P(L.matches);
2255
- return M.addEventListener("change", y), () => M.removeEventListener("change", y);
2255
+ const y = window.matchMedia("(prefers-color-scheme: dark)"), E = (L) => k(L.matches);
2256
+ return y.addEventListener("change", E), () => y.removeEventListener("change", E);
2256
2257
  }, [d]);
2257
- const k = d === "auto" ? _ ? "dark" : "light" : d;
2258
+ const P = d === "auto" ? M ? "dark" : "light" : d;
2258
2259
  return /* @__PURE__ */ p(
2259
2260
  "div",
2260
2261
  {
2261
2262
  className: `rfp-root ${i ?? ""}`,
2262
2263
  style: { width: a, height: n, ...s },
2263
- "data-theme": k,
2264
+ "data-theme": P,
2264
2265
  children: /* @__PURE__ */ p("div", { className: "rfp-relative rfp-w-full rfp-h-full rfp-overflow-hidden rfp-bg-surface-overlay", children: /* @__PURE__ */ p(
2265
2266
  dt,
2266
2267
  {
@@ -2277,7 +2278,8 @@ const Ao = R(
2277
2278
  requestInit: u,
2278
2279
  requestHandler: w,
2279
2280
  shouldFetchAsBlob: C,
2280
- onDownload: x
2281
+ onDownload: x,
2282
+ onClose: _
2281
2283
  }
2282
2284
  ) })
2283
2285
  }
@@ -2320,4 +2322,4 @@ export {
2320
2322
  Ue as w,
2321
2323
  gr as y
2322
2324
  };
2323
- //# sourceMappingURL=index-BCbSb9Ob.mjs.map
2325
+ //# sourceMappingURL=index--lXiT1Y_.mjs.map