@eternalheart/vue-file-preview 1.3.13 → 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 (49) hide show
  1. package/lib/FilePreviewContent.vue.d.ts +3 -0
  2. package/lib/FilePreviewContent.vue.d.ts.map +1 -1
  3. package/lib/FilePreviewEmbed.vue.d.ts +5 -0
  4. package/lib/FilePreviewEmbed.vue.d.ts.map +1 -1
  5. package/lib/FilePreviewModal.vue.d.ts.map +1 -1
  6. package/lib/chunks/{index-BHi1WRQZ.mjs → index-5hGtGeD4.mjs} +2 -2
  7. package/lib/chunks/{index-BHi1WRQZ.mjs.map → index-5hGtGeD4.mjs.map} +1 -1
  8. package/lib/chunks/{index-DBw8tvyb.mjs → index-B-f41wjl.mjs} +2 -2
  9. package/lib/chunks/{index-DBw8tvyb.mjs.map → index-B-f41wjl.mjs.map} +1 -1
  10. package/lib/chunks/{index-CYt6tpQC.mjs → index-BI32fnT-.mjs} +2 -2
  11. package/lib/chunks/{index-CYt6tpQC.mjs.map → index-BI32fnT-.mjs.map} +1 -1
  12. package/lib/chunks/{index-DTtHrdBl.mjs → index-BgdBpGYv.mjs} +2 -2
  13. package/lib/chunks/{index-DTtHrdBl.mjs.map → index-BgdBpGYv.mjs.map} +1 -1
  14. package/lib/chunks/{index-DT9dPz8I.mjs → index-BkMYaea2.mjs} +2 -2
  15. package/lib/chunks/{index-DT9dPz8I.mjs.map → index-BkMYaea2.mjs.map} +1 -1
  16. package/lib/chunks/{index-BTW1xwB9.mjs → index-BlD2p_KC.mjs} +2 -2
  17. package/lib/chunks/{index-BTW1xwB9.mjs.map → index-BlD2p_KC.mjs.map} +1 -1
  18. package/lib/chunks/{index-B2lqsdp7.mjs → index-Bz9nKaz5.mjs} +2 -2
  19. package/lib/chunks/{index-B2lqsdp7.mjs.map → index-Bz9nKaz5.mjs.map} +1 -1
  20. package/lib/chunks/{index-GGGDPwxX.mjs → index-C0OWrmU8.mjs} +2 -2
  21. package/lib/chunks/{index-GGGDPwxX.mjs.map → index-C0OWrmU8.mjs.map} +1 -1
  22. package/lib/chunks/{index-Oxwizt6-.mjs → index-CFaWV6cC.mjs} +87 -82
  23. package/lib/chunks/index-CFaWV6cC.mjs.map +1 -0
  24. package/lib/chunks/{index-BvegaxQF.mjs → index-CJ86PaaF.mjs} +2 -2
  25. package/lib/chunks/{index-BvegaxQF.mjs.map → index-CJ86PaaF.mjs.map} +1 -1
  26. package/lib/chunks/{index-DIe0vHlt.mjs → index-CMKtCKpo.mjs} +2 -2
  27. package/lib/chunks/{index-DIe0vHlt.mjs.map → index-CMKtCKpo.mjs.map} +1 -1
  28. package/lib/chunks/{index-Cjnw238n.mjs → index-CUA_z4GJ.mjs} +2 -2
  29. package/lib/chunks/{index-Cjnw238n.mjs.map → index-CUA_z4GJ.mjs.map} +1 -1
  30. package/lib/chunks/{index-CyrFxdIJ.mjs → index-Cr0Z36a0.mjs} +3 -3
  31. package/lib/chunks/{index-CyrFxdIJ.mjs.map → index-Cr0Z36a0.mjs.map} +1 -1
  32. package/lib/chunks/{index-Ctd0JQ6K.mjs → index-DVJfd09T.mjs} +2 -2
  33. package/lib/chunks/{index-Ctd0JQ6K.mjs.map → index-DVJfd09T.mjs.map} +1 -1
  34. package/lib/chunks/{index-DyipSoKh.mjs → index-DYrRDrZL.mjs} +2 -2
  35. package/lib/chunks/{index-DyipSoKh.mjs.map → index-DYrRDrZL.mjs.map} +1 -1
  36. package/lib/chunks/{index-Zwl5J-Uw.mjs → index-GcvjVFMf.mjs} +2 -2
  37. package/lib/chunks/{index-Zwl5J-Uw.mjs.map → index-GcvjVFMf.mjs.map} +1 -1
  38. package/lib/chunks/{index-DX_NBPzS.mjs → index-P8naV3DU.mjs} +2 -2
  39. package/lib/chunks/{index-DX_NBPzS.mjs.map → index-P8naV3DU.mjs.map} +1 -1
  40. package/lib/chunks/{index-Dw1U4YqT.mjs → index-VTsO_yR7.mjs} +2 -2
  41. package/lib/chunks/{index-Dw1U4YqT.mjs.map → index-VTsO_yR7.mjs.map} +1 -1
  42. package/lib/chunks/{index-DEoR7aDN.mjs → index-dG-p4BPD.mjs} +2 -2
  43. package/lib/chunks/{index-DEoR7aDN.mjs.map → index-dG-p4BPD.mjs.map} +1 -1
  44. package/lib/index.cjs +20 -20
  45. package/lib/index.cjs.map +1 -1
  46. package/lib/index.css +1 -1
  47. package/lib/index.mjs +1 -1
  48. package/package.json +1 -1
  49. package/lib/chunks/index-Oxwizt6-.mjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as k, ref as p, onMounted as T, watch as D, onBeforeUnmount as M, openBlock as v, createElementBlock as h, createElementVNode as m, toDisplayString as S, unref as z, createCommentVNode as w, createBlock as C, normalizeStyle as N } from "vue";
2
2
  import B from "x-data-spreadsheet";
3
3
  /* empty css */
4
- import { u as E, a as H, E as R, S as W, M as U, U as V } from "./index-Oxwizt6-.mjs";
4
+ import { u as E, a as H, E as R, S as W, M as U, U as V } from "./index-CFaWV6cC.mjs";
5
5
  import { _ as F } from "./RendererError.vue_vue_type_script_setup_true_lang-CbgZBSDr.mjs";
6
6
  const L = { class: "vfp-relative vfp-flex vfp-flex-col vfp-items-center vfp-w-full vfp-h-full" }, O = {
7
7
  key: 0,
@@ -101,4 +101,4 @@ const L = { class: "vfp-relative vfp-flex vfp-flex-col vfp-items-center vfp-w-fu
101
101
  export {
102
102
  K as default
103
103
  };
104
- //# sourceMappingURL=index-GGGDPwxX.mjs.map
104
+ //# sourceMappingURL=index-C0OWrmU8.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-GGGDPwxX.mjs","sources":["../../src/renderers/Csv/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, watch, onMounted, onBeforeUnmount } from 'vue';\nimport Spreadsheet from 'x-data-spreadsheet';\nimport 'x-data-spreadsheet/dist/xspreadsheet.css';\nimport {\n parseCsv,\n guessCsvDelimiter,\n fetchTextUtf8,\n convertCsvToSpreadsheetData,\n} from '@eternalheart/file-preview-core';\nimport { useTranslator } from '../../composables/useTranslator';\nimport { useFetcher } from '../../composables/useRequest';\nimport RendererError from '../RendererError.vue';\n\nconst props = defineProps<{\n url: string;\n fileName: string;\n}>();\n\nconst { t } = useTranslator();\nconst fetcher = useFetcher();\n\nconst loading = ref(true);\nconst error = ref<string | null>(null);\nconst containerRef = ref<HTMLDivElement | null>(null);\nlet sheetData: Record<string, unknown>[] | null = null;\nlet resizeObserver: ResizeObserver | null = null;\nlet resizeTimeout: number | null = null;\nlet lastDimensions = { width: 0, height: 0 };\n\nconst calculateDimensions = () => {\n if (!containerRef.value) return { width: 800, height: 600 };\n const rawWidth = containerRef.value.clientWidth;\n const rawHeight = containerRef.value.clientHeight;\n const width = rawWidth > 100 ? rawWidth : 800;\n const height = rawHeight > 100 ? rawHeight : 600;\n return { width, height };\n};\n\nconst mountSpreadsheet = () => {\n if (!containerRef.value || !sheetData) return;\n\n containerRef.value.innerHTML = '';\n\n const { width, height } = calculateDimensions();\n const isMobile = width < 640;\n\n const s = new Spreadsheet(containerRef.value, {\n mode: 'read',\n showToolbar: false,\n showContextmenu: false,\n showGrid: true,\n row: {\n len: 100,\n height: 25,\n },\n col: {\n len: 26,\n width: isMobile ? 80 : 100,\n indexWidth: isMobile ? 40 : 60,\n minWidth: isMobile ? 40 : 60,\n },\n view: {\n height: () => height,\n width: () => width,\n },\n });\n\n s.loadData(sheetData as unknown as Record<string, unknown>);\n};\n\nconst loadCsv = async () => {\n if (!containerRef.value) return;\n\n loading.value = true;\n error.value = null;\n\n try {\n const text = await fetchTextUtf8(props.url, { fetcher: fetcher.value });\n const parsed = parseCsv(text, { delimiter: guessCsvDelimiter(props.fileName) });\n const data = convertCsvToSpreadsheetData(parsed.header, parsed.rows, props.fileName);\n\n sheetData = data as unknown as Record<string, unknown>[];\n mountSpreadsheet();\n loading.value = false;\n } catch (err) {\n console.error('CSV 解析错误:', err);\n error.value = t.value('csv.load_failed');\n loading.value = false;\n }\n};\n\nonMounted(() => {\n if (!containerRef.value) return;\n\n let isInitialRender = true;\n\n resizeObserver = new ResizeObserver(() => {\n if (isInitialRender) {\n isInitialRender = false;\n lastDimensions = calculateDimensions();\n return;\n }\n\n const newDimensions = calculateDimensions();\n const widthDiff = Math.abs(lastDimensions.width - newDimensions.width);\n const heightDiff = Math.abs(lastDimensions.height - newDimensions.height);\n\n if (widthDiff < 10 && heightDiff < 10) return;\n\n lastDimensions = newDimensions;\n\n if (resizeTimeout !== null) clearTimeout(resizeTimeout);\n\n resizeTimeout = window.setTimeout(() => {\n if (sheetData) mountSpreadsheet();\n }, 500);\n });\n\n resizeObserver.observe(containerRef.value);\n\n setTimeout(() => {\n requestAnimationFrame(() => loadCsv());\n }, 100);\n});\n\nwatch(\n () => props.url,\n () => {\n loadCsv();\n }\n);\n\nonBeforeUnmount(() => {\n if (resizeObserver) resizeObserver.disconnect();\n if (resizeTimeout !== null) clearTimeout(resizeTimeout);\n sheetData = null;\n if (containerRef.value) containerRef.value.innerHTML = '';\n});\n</script>\n\n<template>\n <div class=\"vfp-relative vfp-flex vfp-flex-col vfp-items-center vfp-w-full vfp-h-full\">\n <div\n v-if=\"loading\"\n class=\"vfp-absolute vfp-inset-0 vfp-flex vfp-items-center vfp-justify-center vfp-bg-surface-toolbar vfp-backdrop-blur-sm vfp-z-10\"\n >\n <div class=\"vfp-text-center\">\n <div\n class=\"vfp-w-10 vfp-h-10 md:vfp-w-12 md:vfp-h-12 vfp-mx-auto vfp-mb-3 vfp-border-4 vfp-border-line-strong vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin\"\n />\n <p class=\"vfp-text-xs md:vfp-text-sm vfp-text-fg-secondary vfp-font-medium\">{{ t('csv.loading') }}</p>\n </div>\n </div>\n\n <RendererError\n v-if=\"error && !loading\"\n :message=\"error\"\n class=\"vfp-absolute vfp-inset-0 vfp-bg-surface-toolbar vfp-backdrop-blur-sm vfp-z-10\"\n />\n\n <div\n v-if=\"!error\"\n ref=\"containerRef\"\n class=\"xlsx-spreadsheet-container vfp-w-full vfp-h-full\"\n :style=\"{ opacity: loading ? 0 : 1 }\"\n />\n </div>\n</template>\n"],"names":["props","__props","t","useTranslator","fetcher","useFetcher","loading","ref","error","containerRef","sheetData","resizeObserver","resizeTimeout","lastDimensions","calculateDimensions","rawWidth","rawHeight","width","height","mountSpreadsheet","isMobile","Spreadsheet","loadCsv","text","fetchTextUtf8","parsed","parseCsv","guessCsvDelimiter","convertCsvToSpreadsheetData","err","onMounted","isInitialRender","newDimensions","widthDiff","heightDiff","watch","onBeforeUnmount","_openBlock","_createElementBlock","_hoisted_1","_hoisted_2","_createElementVNode","_hoisted_3","_hoisted_4","_toDisplayString","_unref","_createBlock","RendererError"],"mappings":";;;;;;;;;;;;;;;AAcA,UAAMA,IAAQC,GAKR,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAUC,EAAA,GAEVC,IAAUC,EAAI,EAAI,GAClBC,IAAQD,EAAmB,IAAI,GAC/BE,IAAeF,EAA2B,IAAI;AACpD,QAAIG,IAA8C,MAC9CC,IAAwC,MACxCC,IAA+B,MAC/BC,IAAiB,EAAE,OAAO,GAAG,QAAQ,EAAA;AAEzC,UAAMC,IAAsB,MAAM;AAChC,UAAI,CAACL,EAAa,MAAO,QAAO,EAAE,OAAO,KAAK,QAAQ,IAAA;AACtD,YAAMM,IAAWN,EAAa,MAAM,aAC9BO,IAAYP,EAAa,MAAM,cAC/BQ,IAAQF,IAAW,MAAMA,IAAW,KACpCG,IAASF,IAAY,MAAMA,IAAY;AAC7C,aAAO,EAAE,OAAAC,GAAO,QAAAC,EAAA;AAAA,IAClB,GAEMC,IAAmB,MAAM;AAC7B,UAAI,CAACV,EAAa,SAAS,CAACC,EAAW;AAEvC,MAAAD,EAAa,MAAM,YAAY;AAE/B,YAAM,EAAE,OAAAQ,GAAO,QAAAC,EAAA,IAAWJ,EAAA,GACpBM,IAAWH,IAAQ;AAuBzB,MArBU,IAAII,EAAYZ,EAAa,OAAO;A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Mounted, onBeforeUnmount } from 'vue';\nimport Spreadsheet from 'x-data-spreadsheet';\nimport 'x-data-spreadsheet/dist/xspreadsheet.css';\nimport {\n parseCsv,\n guessCsvDelimiter,\n fetchTextUtf8,\n convertCsvToSpreadsheetData,\n} from '@eternalheart/file-preview-core';\nimport { useTranslator } from '../../composables/useTranslator';\nimport { useFetcher } from '../../composables/useRequest';\nimport RendererError from '../RendererError.vue';\n\nconst props = defineProps<{\n url: string;\n fileName: string;\n}>();\n\nconst { t } = useTranslator();\nconst fetcher = useFetcher();\n\nconst loading = ref(true);\nconst error = ref<string | null>(null);\nconst containerRef = ref<HTMLDivElement | null>(null);\nlet sheetData: Record<string, unknown>[] | null = null;\nlet resizeObserver: ResizeObserver | null = null;\nlet resizeTimeout: number | null = null;\nlet lastDimensions = { width: 0, height: 0 };\n\nconst calculateDimensions = () => {\n if (!containerRef.value) return { width: 800, height: 600 };\n const rawWidth = containerRef.value.clientWidth;\n const rawHeight = containerRef.value.clientHeight;\n const width = rawWidth > 100 ? rawWidth : 800;\n const height = rawHeight > 100 ? rawHeight : 600;\n return { width, height };\n};\n\nconst mountSpreadsheet = () => {\n if (!containerRef.value || !sheetData) return;\n\n containerRef.value.innerHTML = '';\n\n const { width, height } = calculateDimensions();\n const isMobile = width < 640;\n\n const s = new Spreadsheet(containerRef.value, {\n mode: 'read',\n showToolbar: false,\n showContextmenu: false,\n showGrid: true,\n row: {\n len: 100,\n height: 25,\n },\n col: {\n len: 26,\n width: isMobile ? 80 : 100,\n indexWidth: isMobile ? 40 : 60,\n minWidth: isMobile ? 40 : 60,\n },\n view: {\n height: () => height,\n width: () => width,\n },\n });\n\n s.loadData(sheetData as unknown as Record<string, unknown>);\n};\n\nconst loadCsv = async () => {\n if (!containerRef.value) return;\n\n loading.value = true;\n error.value = null;\n\n try {\n const text = await fetchTextUtf8(props.url, { fetcher: fetcher.value });\n const parsed = parseCsv(text, { delimiter: guessCsvDelimiter(props.fileName) });\n const data = convertCsvToSpreadsheetData(parsed.header, parsed.rows, props.fileName);\n\n sheetData = data as unknown as Record<string, unknown>[];\n mountSpreadsheet();\n loading.value = false;\n } catch (err) {\n console.error('CSV 解析错误:', err);\n error.value = t.value('csv.load_failed');\n loading.value = false;\n }\n};\n\nonMounted(() => {\n if (!containerRef.value) return;\n\n let isInitialRender = true;\n\n resizeObserver = new ResizeObserver(() => {\n if (isInitialRender) {\n isInitialRender = false;\n lastDimensions = calculateDimensions();\n return;\n }\n\n const newDimensions = calculateDimensions();\n const widthDiff = Math.abs(lastDimensions.width - newDimensions.width);\n const heightDiff = Math.abs(lastDimensions.height - newDimensions.height);\n\n if (widthDiff < 10 && heightDiff < 10) return;\n\n lastDimensions = newDimensions;\n\n if (resizeTimeout !== null) clearTimeout(resizeTimeout);\n\n resizeTimeout = window.setTimeout(() => {\n if (sheetData) mountSpreadsheet();\n }, 500);\n });\n\n resizeObserver.observe(containerRef.value);\n\n setTimeout(() => {\n requestAnimationFrame(() => loadCsv());\n }, 100);\n});\n\nwatch(\n () => props.url,\n () => {\n loadCsv();\n }\n);\n\nonBeforeUnmount(() => {\n if (resizeObserver) resizeObserver.disconnect();\n if (resizeTimeout !== null) clearTimeout(resizeTimeout);\n sheetData = null;\n if (containerRef.value) containerRef.value.innerHTML = '';\n});\n</script>\n\n<template>\n <div class=\"vfp-relative vfp-flex vfp-flex-col vfp-items-center vfp-w-full vfp-h-full\">\n <div\n v-if=\"loading\"\n class=\"vfp-absolute vfp-inset-0 vfp-flex vfp-items-center vfp-justify-center vfp-bg-surface-toolbar vfp-backdrop-blur-sm vfp-z-10\"\n >\n <div class=\"vfp-text-center\">\n <div\n class=\"vfp-w-10 vfp-h-10 md:vfp-w-12 md:vfp-h-12 vfp-mx-auto vfp-mb-3 vfp-border-4 vfp-border-line-strong vfp-border-t-spinner-head vfp-rounded-full vfp-animate-spin\"\n />\n <p class=\"vfp-text-xs md:vfp-text-sm vfp-text-fg-secondary vfp-font-medium\">{{ t('csv.loading') }}</p>\n </div>\n </div>\n\n <RendererError\n v-if=\"error && !loading\"\n :message=\"error\"\n class=\"vfp-absolute vfp-inset-0 vfp-bg-surface-toolbar vfp-backdrop-blur-sm vfp-z-10\"\n />\n\n <div\n v-if=\"!error\"\n ref=\"containerRef\"\n class=\"xlsx-spreadsheet-container vfp-w-full vfp-h-full\"\n :style=\"{ opacity: loading ? 0 : 1 }\"\n />\n </div>\n</template>\n"],"names":["props","__props","t","useTranslator","fetcher","useFetcher","loading","ref","error","containerRef","sheetData","resizeObserver","resizeTimeout","lastDimensions","calculateDimensions","rawWidth","rawHeight","width","height","mountSpreadsheet","isMobile","Spreadsheet","loadCsv","text","fetchTextUtf8","parsed","parseCsv","guessCsvDelimiter","convertCsvToSpreadsheetData","err","onMounted","isInitialRender","newDimensions","widthDiff","heightDiff","watch","onBeforeUnmount","_openBlock","_createElementBlock","_hoisted_1","_hoisted_2","_createElementVNode","_hoisted_3","_hoisted_4","_toDisplayString","_unref","_createBlock","RendererError"],"mappings":";;;;;;;;;;;;;;;AAcA,UAAMA,IAAQC,GAKR,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAUC,EAAA,GAEVC,IAAUC,EAAI,EAAI,GAClBC,IAAQD,EAAmB,IAAI,GAC/BE,IAAeF,EAA2B,IAAI;AACpD,QAAIG,IAA8C,MAC9CC,IAAwC,MACxCC,IAA+B,MAC/BC,IAAiB,EAAE,OAAO,GAAG,QAAQ,EAAA;AAEzC,UAAMC,IAAsB,MAAM;AAChC,UAAI,CAACL,EAAa,MAAO,QAAO,EAAE,OAAO,KAAK,QAAQ,IAAA;AACtD,YAAMM,IAAWN,EAAa,MAAM,aAC9BO,IAAYP,EAAa,MAAM,cAC/BQ,IAAQF,IAAW,MAAMA,IAAW,KACpCG,IAASF,IAAY,MAAMA,IAAY;AAC7C,aAAO,EAAE,OAAAC,GAAO,QAAAC,EAAA;AAAA,IAClB,GAEMC,IAAmB,MAAM;AAC7B,UAAI,CAACV,EAAa,SAAS,CAACC,EAAW;AA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oBAAkBH,EAAA,QAAO,IAAA,GAAA;AAAA,MAAA;;;;"}
@@ -1,7 +1,7 @@
1
- import { computed as M, unref as v, provide as ie, inject as xe, ref as C, watch as A, onBeforeUnmount as G, h as O, defineComponent as X, openBlock as f, createElementBlock as b, createElementVNode as T, toDisplayString as D, defineAsyncComponent as ft, createVNode as H, createTextVNode as pt, onMounted as we, Fragment as P, normalizeStyle as ae, createCommentVNode as L, toRef as Ee, renderList as q, createBlock as F, resolveDynamicComponent as Q, onUnmounted as mt, Teleport as vt, Transition as ht, withCtx as gt } from "vue";
2
- import { ZoomOut as Ae, ZoomIn as Be, Scan as bt, RotateCcw as xt, RotateCw as wt, RefreshCw as qe, List as Oe, ChevronLeft as ye, ChevronRight as ke, Minimize2 as Ue, Maximize2 as He, WrapText as yt, Code as Ve, Eye as Ze, FileQuestion as kt, Download as Ge, X as Ft } from "lucide-vue-next";
1
+ import { computed as M, unref as v, provide as ie, inject as xe, ref as C, watch as A, onBeforeUnmount as G, h as O, defineComponent as X, openBlock as f, createElementBlock as b, createElementVNode as T, toDisplayString as D, defineAsyncComponent as ft, createVNode as H, createTextVNode as pt, onMounted as we, Fragment as P, normalizeStyle as ae, createCommentVNode as L, toRef as Ee, renderList as q, createBlock as k, resolveDynamicComponent as Q, onUnmounted as mt, Teleport as vt, Transition as ht, withCtx as gt } from "vue";
2
+ import { ZoomOut as Ae, ZoomIn as Be, Scan as bt, RotateCcw as xt, RotateCw as wt, RefreshCw as qe, List as Oe, ChevronLeft as ye, ChevronRight as Fe, Minimize2 as Ue, Maximize2 as He, WrapText as yt, Code as Ve, Eye as Ze, FileQuestion as Ft, Download as Ge, X as kt } from "lucide-vue-next";
3
3
  import Ct from "jszip";
4
- const _t = "1.3.13", Rt = {
4
+ const _t = "1.3.14", Rt = {
5
5
  version: _t
6
6
  }, zn = [
7
7
  "image",
@@ -857,10 +857,10 @@ function Xt(e) {
857
857
  if (e && e.type === "pattern" && e.pattern === "solid") {
858
858
  const t = e.fgColor;
859
859
  if (t)
860
- return Fe(t);
860
+ return ke(t);
861
861
  }
862
862
  }
863
- function Fe(e) {
863
+ function ke(e) {
864
864
  if (e) {
865
865
  if ("argb" in e && typeof e.argb == "string" && e.argb)
866
866
  return Ht(e.argb);
@@ -876,7 +876,7 @@ function Fe(e) {
876
876
  }
877
877
  function Kt(e) {
878
878
  if (!e || !e.style) return;
879
- const t = Fe(e.color) || "#000000";
879
+ const t = ke(e.color) || "#000000";
880
880
  return [e.style, t];
881
881
  }
882
882
  function Yt(e) {
@@ -885,7 +885,7 @@ function Yt(e) {
885
885
  if (e.font) {
886
886
  const i = e.font;
887
887
  if ((i.name || i.size || i.bold || i.italic) && (o = !0, t.font = {}, i.name && (t.font.name = i.name), i.size && (t.font.size = i.size), i.bold && (t.font.bold = !0), i.italic && (t.font.italic = !0)), i.color) {
888
- const a = Fe(i.color);
888
+ const a = ke(i.color);
889
889
  a && (o = !0, t.color = a);
890
890
  }
891
891
  i.underline && (o = !0, t.underline = !0), i.strike && (o = !0, t.strike = !0);
@@ -1572,7 +1572,7 @@ function yo(e) {
1572
1572
  }
1573
1573
  ];
1574
1574
  }
1575
- function ko(e) {
1575
+ function Fo(e) {
1576
1576
  return [
1577
1577
  {
1578
1578
  items: [
@@ -1589,7 +1589,7 @@ function ko(e) {
1589
1589
  return (t = e.epubRef) == null ? void 0 : t.prevPage();
1590
1590
  } },
1591
1591
  { type: "text", content: `${e.current} / ${e.total}`, minWidth: "4rem" },
1592
- { type: "button", icon: ke, tooltip: e.t("toolbar.next_page"), action: () => {
1592
+ { type: "button", icon: Fe, tooltip: e.t("toolbar.next_page"), action: () => {
1593
1593
  var t;
1594
1594
  return (t = e.epubRef) == null ? void 0 : t.nextPage();
1595
1595
  } }
@@ -1610,7 +1610,7 @@ function ko(e) {
1610
1610
  }
1611
1611
  ];
1612
1612
  }
1613
- function Fo(e) {
1613
+ function ko(e) {
1614
1614
  return [
1615
1615
  {
1616
1616
  items: [
@@ -1627,7 +1627,7 @@ function Fo(e) {
1627
1627
  return (t = e.mobiRef) == null ? void 0 : t.prevPage();
1628
1628
  } },
1629
1629
  { type: "text", content: `${e.current} / ${e.total}`, minWidth: "4rem" },
1630
- { type: "button", icon: ke, tooltip: e.t("toolbar.next_page"), action: () => {
1630
+ { type: "button", icon: Fe, tooltip: e.t("toolbar.next_page"), action: () => {
1631
1631
  var t;
1632
1632
  return (t = e.mobiRef) == null ? void 0 : t.nextPage();
1633
1633
  } }
@@ -1714,7 +1714,7 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
1714
1714
  loader: e,
1715
1715
  loadingComponent: { render: () => O(Po) },
1716
1716
  delay: 0
1717
- }), To = E(() => import("./index-DT9dPz8I.mjs")), Eo = E(() => import("./index-Zwl5J-Uw.mjs")), So = E(() => import("./index-DyipSoKh.mjs")), No = E(() => import("./index-DEoR7aDN.mjs")), $o = E(() => import("./index-Cjnw238n.mjs")), Lo = E(() => import("./index-B2lqsdp7.mjs")), Wo = E(() => import("./index-DX_NBPzS.mjs")), Io = E(() => import("./index-BHi1WRQZ.mjs")), Do = E(() => import("./index-Ctd0JQ6K.mjs")), Ao = E(() => import("./index-BvegaxQF.mjs")), Bo = E(() => import("./index-Dw1U4YqT.mjs")), qo = E(() => import("./index-DBw8tvyb.mjs")), Oo = E(() => import("./index-GGGDPwxX.mjs")), Uo = E(() => import("./index-DIe0vHlt.mjs")), Ho = E(() => import("./index-CYt6tpQC.mjs")), Vo = E(() => import("./index-CyrFxdIJ.mjs")), Zo = E(() => import("./index-DTtHrdBl.mjs")), Go = E(() => import("./index-BTW1xwB9.mjs")), Xo = { class: "vfp-flex vfp-flex-col vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-p-8 vfp-gap-6" }, Ko = { class: "vfp-w-32 vfp-h-32 vfp-rounded-full vfp-bg-surface-2 vfp-flex vfp-items-center vfp-justify-center" }, Yo = { class: "vfp-text-fg-primary vfp-text-center" }, Jo = { class: "vfp-text-xl vfp-font-medium vfp-mb-2" }, Qo = { class: "vfp-text-fg-secondary" }, De = /* @__PURE__ */ X({
1717
+ }), To = E(() => import("./index-BkMYaea2.mjs")), Eo = E(() => import("./index-GcvjVFMf.mjs")), So = E(() => import("./index-DYrRDrZL.mjs")), No = E(() => import("./index-dG-p4BPD.mjs")), $o = E(() => import("./index-CUA_z4GJ.mjs")), Lo = E(() => import("./index-Bz9nKaz5.mjs")), Wo = E(() => import("./index-P8naV3DU.mjs")), Io = E(() => import("./index-5hGtGeD4.mjs")), Do = E(() => import("./index-DVJfd09T.mjs")), Ao = E(() => import("./index-CJ86PaaF.mjs")), Bo = E(() => import("./index-VTsO_yR7.mjs")), qo = E(() => import("./index-B-f41wjl.mjs")), Oo = E(() => import("./index-C0OWrmU8.mjs")), Uo = E(() => import("./index-CMKtCKpo.mjs")), Ho = E(() => import("./index-BI32fnT-.mjs")), Vo = E(() => import("./index-Cr0Z36a0.mjs")), Zo = E(() => import("./index-BgdBpGYv.mjs")), Go = E(() => import("./index-BlD2p_KC.mjs")), Xo = { class: "vfp-flex vfp-flex-col vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-p-8 vfp-gap-6" }, Ko = { class: "vfp-w-32 vfp-h-32 vfp-rounded-full vfp-bg-surface-2 vfp-flex vfp-items-center vfp-justify-center" }, Yo = { class: "vfp-text-fg-primary vfp-text-center" }, Jo = { class: "vfp-text-xl vfp-font-medium vfp-mb-2" }, Qo = { class: "vfp-text-fg-secondary" }, De = /* @__PURE__ */ X({
1718
1718
  __name: "index",
1719
1719
  props: {
1720
1720
  fileName: {},
@@ -1725,7 +1725,7 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
1725
1725
  const { t: o } = Ce(), n = t;
1726
1726
  return (i, a) => (f(), b("div", Xo, [
1727
1727
  T("div", Ko, [
1728
- H(v(kt), { class: "vfp-w-16 vfp-h-16 vfp-text-fg-secondary" })
1728
+ H(v(Ft), { class: "vfp-w-16 vfp-h-16 vfp-text-fg-secondary" })
1729
1729
  ]),
1730
1730
  T("div", Yo, [
1731
1731
  T("p", Jo, D(e.fileName), 1),
@@ -1798,7 +1798,7 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
1798
1798
  onClick: p[1] || (p[1] = (c) => n("next")),
1799
1799
  onMouseenter: s
1800
1800
  }, [
1801
- H(v(ke), { class: "vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6" })
1801
+ H(v(Fe), { class: "vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6" })
1802
1802
  ], 36)) : L("", !0)
1803
1803
  ], 64));
1804
1804
  }
@@ -1827,7 +1827,8 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
1827
1827
  requestInit: { type: Function, default: void 0 },
1828
1828
  requestHandler: { type: Function, default: void 0 },
1829
1829
  shouldFetchAsBlob: { type: Function, default: void 0 },
1830
- onDownload: { type: Function, default: void 0 }
1830
+ onDownload: { type: Function, default: void 0 },
1831
+ onClose: { type: Function, default: void 0 }
1831
1832
  },
1832
1833
  emits: ["navigate", "close", "custom-event"],
1833
1834
  setup(e, { emit: t }) {
@@ -1926,7 +1927,7 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
1926
1927
  console.error("[file-preview] download failed:", y);
1927
1928
  }
1928
1929
  }
1929
- }, rt = M(() => o.mode === "modal"), je = C(null), re = C(0), se = C(0), ue = C(!1), Pe = C(null), de = C(0), ce = C(0), fe = C(!1), st = (y, g) => {
1930
+ }, rt = M(() => !!o.onClose), je = C(null), re = C(0), se = C(0), ue = C(!1), Pe = C(null), de = C(0), ce = C(0), fe = C(!1), st = (y, g) => {
1930
1931
  re.value = y, se.value = g;
1931
1932
  }, ut = (y, g) => {
1932
1933
  de.value = y, ce.value = g;
@@ -1957,7 +1958,7 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
1957
1958
  t: i.value
1958
1959
  });
1959
1960
  if (x.value === "epub")
1960
- return ko({
1961
+ return Fo({
1961
1962
  epubRef: je.value,
1962
1963
  current: re.value,
1963
1964
  total: se.value,
@@ -1965,7 +1966,7 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
1965
1966
  t: i.value
1966
1967
  });
1967
1968
  if (x.value === "mobi")
1968
- return Fo({
1969
+ return ko({
1969
1970
  mobiRef: Pe.value,
1970
1971
  current: de.value,
1971
1972
  total: ce.value,
@@ -2006,7 +2007,7 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
2006
2007
  ];
2007
2008
  return rt.value && y.push({
2008
2009
  items: [
2009
- { type: "button", icon: Ft, tooltip: i.value("common.close"), action: () => n("close") }
2010
+ { type: "button", icon: kt, tooltip: i.value("common.close"), action: () => n("close") }
2010
2011
  ]
2011
2012
  }), y;
2012
2013
  }), ct = M(() => me.value.length > 0);
@@ -2029,17 +2030,17 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
2029
2030
  (f(!0), b(P, null, q(Te.value, (z, $) => (f(), b(P, {
2030
2031
  key: "m-action-" + $
2031
2032
  }, [
2032
- (f(!0), b(P, null, q(z.items, (k, U) => (f(), b(P, {
2033
+ (f(!0), b(P, null, q(z.items, (F, U) => (f(), b(P, {
2033
2034
  key: "m-action-" + $ + "-" + U
2034
2035
  }, [
2035
- k.type === "button" ? (f(), b("button", {
2036
+ F.type === "button" ? (f(), b("button", {
2036
2037
  key: 0,
2037
2038
  class: "toolbar-btn",
2038
- "data-tooltip": k.tooltip,
2039
- disabled: k.disabled,
2040
- onClick: k.action
2039
+ "data-tooltip": F.tooltip,
2040
+ disabled: F.disabled,
2041
+ onClick: F.action
2041
2042
  }, [
2042
- (f(), F(Q(k.icon), { class: "vfp-w-4 vfp-h-4" }))
2043
+ (f(), k(Q(F.icon), { class: "vfp-w-4 vfp-h-4" }))
2043
2044
  ], 8, dn)) : L("", !0)
2044
2045
  ], 64))), 128))
2045
2046
  ], 64))), 128))
@@ -2048,39 +2049,39 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
2048
2049
  (f(!0), b(P, null, q(me.value, (z, $) => (f(), b(P, {
2049
2050
  key: "d-tool-" + $
2050
2051
  }, [
2051
- (f(!0), b(P, null, q(z.items, (k, U) => (f(), b(P, {
2052
+ (f(!0), b(P, null, q(z.items, (F, U) => (f(), b(P, {
2052
2053
  key: "d-tool-" + $ + "-" + U
2053
2054
  }, [
2054
- k.type === "button" ? (f(), b("button", {
2055
+ F.type === "button" ? (f(), b("button", {
2055
2056
  key: 0,
2056
2057
  class: "toolbar-btn",
2057
- "data-tooltip": k.tooltip,
2058
- disabled: k.disabled,
2059
- onClick: k.action
2058
+ "data-tooltip": F.tooltip,
2059
+ disabled: F.disabled,
2060
+ onClick: F.action
2060
2061
  }, [
2061
- (f(), F(Q(k.icon), { class: "vfp-w-4 vfp-h-4" }))
2062
- ], 8, fn)) : k.type === "text" ? (f(), b("span", {
2062
+ (f(), k(Q(F.icon), { class: "vfp-w-4 vfp-h-4" }))
2063
+ ], 8, fn)) : F.type === "text" ? (f(), b("span", {
2063
2064
  key: 1,
2064
2065
  class: "vfp-text-xs vfp-text-center vfp-font-medium vfp-tabular-nums vfp-text-fg-tertiary",
2065
- style: ae({ minWidth: k.minWidth || "auto" })
2066
- }, D(k.content), 5)) : L("", !0)
2066
+ style: ae({ minWidth: F.minWidth || "auto" })
2067
+ }, D(F.content), 5)) : L("", !0)
2067
2068
  ], 64))), 128)),
2068
2069
  g[9] || (g[9] = T("div", { class: "vfp-w-px vfp-h-4 vfp-mx-1 vfp-bg-divide" }, null, -1))
2069
2070
  ], 64))), 128)),
2070
2071
  (f(!0), b(P, null, q(Te.value, (z, $) => (f(), b(P, {
2071
2072
  key: "d-action-" + $
2072
2073
  }, [
2073
- (f(!0), b(P, null, q(z.items, (k, U) => (f(), b(P, {
2074
+ (f(!0), b(P, null, q(z.items, (F, U) => (f(), b(P, {
2074
2075
  key: "d-action-" + $ + "-" + U
2075
2076
  }, [
2076
- k.type === "button" ? (f(), b("button", {
2077
+ F.type === "button" ? (f(), b("button", {
2077
2078
  key: 0,
2078
2079
  class: "toolbar-btn",
2079
- "data-tooltip": k.tooltip,
2080
- disabled: k.disabled,
2081
- onClick: k.action
2080
+ "data-tooltip": F.tooltip,
2081
+ disabled: F.disabled,
2082
+ onClick: F.action
2082
2083
  }, [
2083
- (f(), F(Q(k.icon), { class: "vfp-w-4 vfp-h-4" }))
2084
+ (f(), k(Q(F.icon), { class: "vfp-w-4 vfp-h-4" }))
2084
2085
  ], 8, pn)) : L("", !0)
2085
2086
  ], 64))), 128))
2086
2087
  ], 64))), 128))
@@ -2091,22 +2092,22 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
2091
2092
  key: "m-tool-" + $
2092
2093
  }, [
2093
2094
  $ > 0 ? (f(), b("div", vn)) : L("", !0),
2094
- (f(!0), b(P, null, q(z.items, (k, U) => (f(), b(P, {
2095
+ (f(!0), b(P, null, q(z.items, (F, U) => (f(), b(P, {
2095
2096
  key: "m-tool-" + $ + "-" + U
2096
2097
  }, [
2097
- k.type === "button" ? (f(), b("button", {
2098
+ F.type === "button" ? (f(), b("button", {
2098
2099
  key: 0,
2099
2100
  class: "toolbar-btn",
2100
- "data-tooltip": k.tooltip,
2101
- disabled: k.disabled,
2102
- onClick: k.action
2101
+ "data-tooltip": F.tooltip,
2102
+ disabled: F.disabled,
2103
+ onClick: F.action
2103
2104
  }, [
2104
- (f(), F(Q(k.icon), { class: "vfp-w-4 vfp-h-4" }))
2105
- ], 8, hn)) : k.type === "text" ? (f(), b("span", {
2105
+ (f(), k(Q(F.icon), { class: "vfp-w-4 vfp-h-4" }))
2106
+ ], 8, hn)) : F.type === "text" ? (f(), b("span", {
2106
2107
  key: 1,
2107
2108
  class: "vfp-text-xs vfp-text-center vfp-font-medium vfp-tabular-nums vfp-text-fg-tertiary",
2108
- style: ae({ minWidth: k.minWidth || "auto" })
2109
- }, D(k.content), 5)) : L("", !0)
2109
+ style: ae({ minWidth: F.minWidth || "auto" })
2110
+ }, D(F.content), 5)) : L("", !0)
2110
2111
  ], 64))), 128))
2111
2112
  ], 64))), 128))
2112
2113
  ])) : L("", !0)
@@ -2118,12 +2119,12 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
2118
2119
  key: (W = h.value) == null ? void 0 : W.url
2119
2120
  }, [
2120
2121
  h.value ? (f(), b(P, { key: 0 }, [
2121
- I.value ? (f(), F(Q(I.value), {
2122
+ I.value ? (f(), k(Q(I.value), {
2122
2123
  key: 0,
2123
2124
  file: h.value,
2124
2125
  ctx: te.value
2125
2126
  }, null, 8, ["file", "ctx"])) : (f(), b(P, { key: 1 }, [
2126
- x.value === "image" ? (f(), F(v(To), {
2127
+ x.value === "image" ? (f(), k(v(To), {
2127
2128
  key: 0,
2128
2129
  url: v(R),
2129
2130
  zoom: r.value,
@@ -2134,7 +2135,7 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
2134
2135
  onZoomChange: it,
2135
2136
  onNaturalWidthChange: g[0] || (g[0] = (z) => p.value = z),
2136
2137
  onNaturalHeightChange: g[1] || (g[1] = (z) => c.value = z)
2137
- }, null, 8, ["url", "zoom", "rotation", "reset-key", "file-size", "file"])) : x.value === "pdf" ? (f(), F(v(Eo), {
2138
+ }, null, 8, ["url", "zoom", "rotation", "reset-key", "file-size", "file"])) : x.value === "pdf" ? (f(), k(v(Eo), {
2138
2139
  key: 1,
2139
2140
  url: v(R),
2140
2141
  zoom: r.value,
@@ -2142,80 +2143,80 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
2142
2143
  onPageChange: g[2] || (g[2] = (z) => d.value = z),
2143
2144
  onTotalPagesChange: g[3] || (g[3] = (z) => m.value = z),
2144
2145
  onPageWidthChange: g[4] || (g[4] = (z) => p.value = z)
2145
- }, null, 8, ["url", "zoom", "current-page"])) : x.value === "docx" ? (f(), F(v(So), {
2146
+ }, null, 8, ["url", "zoom", "current-page"])) : x.value === "docx" ? (f(), k(v(So), {
2146
2147
  key: 2,
2147
2148
  url: v(R)
2148
- }, null, 8, ["url"])) : x.value === "xlsx" ? (f(), F(v(No), {
2149
+ }, null, 8, ["url"])) : x.value === "xlsx" ? (f(), k(v(No), {
2149
2150
  key: 3,
2150
2151
  url: v(R)
2151
- }, null, 8, ["url"])) : x.value === "pptx" ? (f(), F(v($o), {
2152
+ }, null, 8, ["url"])) : x.value === "pptx" ? (f(), k(v($o), {
2152
2153
  key: 4,
2153
2154
  url: v(R)
2154
- }, null, 8, ["url"])) : x.value === "msg" ? (f(), F(v(Lo), {
2155
+ }, null, 8, ["url"])) : x.value === "msg" ? (f(), k(v(Lo), {
2155
2156
  key: 5,
2156
2157
  url: v(R)
2157
- }, null, 8, ["url"])) : x.value === "epub" ? (f(), F(v(Wo), {
2158
+ }, null, 8, ["url"])) : x.value === "epub" ? (f(), k(v(Wo), {
2158
2159
  key: 6,
2159
2160
  ref_key: "epubRef",
2160
2161
  ref: je,
2161
2162
  url: v(R),
2162
2163
  onChapterChange: st,
2163
2164
  onFullWidthChange: g[5] || (g[5] = (z) => ue.value = z)
2164
- }, null, 8, ["url"])) : x.value === "mobi" ? (f(), F(v(Io), {
2165
+ }, null, 8, ["url"])) : x.value === "mobi" ? (f(), k(v(Io), {
2165
2166
  key: 7,
2166
2167
  ref_key: "mobiRef",
2167
2168
  ref: Pe,
2168
2169
  url: v(R),
2169
2170
  onChapterChange: ut,
2170
2171
  onFullWidthChange: g[6] || (g[6] = (z) => fe.value = z)
2171
- }, null, 8, ["url"])) : x.value === "video" ? (f(), F(v(Do), {
2172
+ }, null, 8, ["url"])) : x.value === "video" ? (f(), k(v(Do), {
2172
2173
  key: 8,
2173
2174
  url: v(R),
2174
2175
  "file-name": (V = h.value) == null ? void 0 : V.name
2175
- }, null, 8, ["url", "file-name"])) : x.value === "audio" ? (f(), F(v(Ao), {
2176
+ }, null, 8, ["url", "file-name"])) : x.value === "audio" ? (f(), k(v(Ao), {
2176
2177
  key: 9,
2177
2178
  url: v(R),
2178
2179
  "file-name": h.value.name
2179
- }, null, 8, ["url", "file-name"])) : x.value === "markdown" ? (f(), F(v(Bo), {
2180
+ }, null, 8, ["url", "file-name"])) : x.value === "markdown" ? (f(), k(v(Bo), {
2180
2181
  key: 10,
2181
2182
  url: v(R),
2182
2183
  "view-mode": J.value
2183
- }, null, 8, ["url", "view-mode"])) : x.value === "json" ? (f(), F(v(qo), {
2184
+ }, null, 8, ["url", "view-mode"])) : x.value === "json" ? (f(), k(v(qo), {
2184
2185
  key: 11,
2185
2186
  url: v(R),
2186
2187
  "file-name": h.value.name
2187
- }, null, 8, ["url", "file-name"])) : x.value === "csv" ? (f(), F(v(Oo), {
2188
+ }, null, 8, ["url", "file-name"])) : x.value === "csv" ? (f(), k(v(Oo), {
2188
2189
  key: 12,
2189
2190
  url: v(R),
2190
2191
  "file-name": h.value.name
2191
- }, null, 8, ["url", "file-name"])) : x.value === "xml" ? (f(), F(v(Uo), {
2192
+ }, null, 8, ["url", "file-name"])) : x.value === "xml" ? (f(), k(v(Uo), {
2192
2193
  key: 13,
2193
2194
  url: v(R),
2194
2195
  "file-name": h.value.name
2195
- }, null, 8, ["url", "file-name"])) : x.value === "subtitle" ? (f(), F(v(Ho), {
2196
+ }, null, 8, ["url", "file-name"])) : x.value === "subtitle" ? (f(), k(v(Ho), {
2196
2197
  key: 14,
2197
2198
  url: v(R),
2198
2199
  "file-name": h.value.name
2199
- }, null, 8, ["url", "file-name"])) : x.value === "zip" && o.zipNestingDepth >= gn ? (f(), F(De, {
2200
+ }, null, 8, ["url", "file-name"])) : x.value === "zip" && o.zipNestingDepth >= gn ? (f(), k(De, {
2200
2201
  key: 15,
2201
2202
  "file-name": h.value.name,
2202
2203
  "file-type": h.value.type,
2203
2204
  onDownload: le
2204
- }, null, 8, ["file-name", "file-type"])) : x.value === "zip" ? (f(), F(v(Vo), {
2205
+ }, null, 8, ["file-name", "file-type"])) : x.value === "zip" ? (f(), k(v(Vo), {
2205
2206
  key: 16,
2206
2207
  url: v(R),
2207
2208
  "nesting-depth": o.zipNestingDepth,
2208
2209
  onStatsChange: dt
2209
- }, null, 8, ["url", "nesting-depth"])) : x.value === "text" ? (f(), F(v(Zo), {
2210
+ }, null, 8, ["url", "nesting-depth"])) : x.value === "text" ? (f(), k(v(Zo), {
2210
2211
  key: 17,
2211
2212
  url: v(R),
2212
2213
  "file-name": h.value.name,
2213
2214
  "word-wrap": K.value,
2214
2215
  "html-preview": Y.value
2215
- }, null, 8, ["url", "file-name", "word-wrap", "html-preview"])) : x.value === "font" ? (f(), F(v(Go), {
2216
+ }, null, 8, ["url", "file-name", "word-wrap", "html-preview"])) : x.value === "font" ? (f(), k(v(Go), {
2216
2217
  key: 18,
2217
2218
  url: v(R)
2218
- }, null, 8, ["url"])) : (f(), F(De, {
2219
+ }, null, 8, ["url"])) : (f(), k(De, {
2219
2220
  key: 19,
2220
2221
  "file-name": h.value.name,
2221
2222
  "file-type": h.value.type,
@@ -2224,7 +2225,7 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
2224
2225
  ], 64))
2225
2226
  ], 64)) : L("", !0)
2226
2227
  ])),
2227
- !e.headless && j.value.length > 1 ? (f(), F(tn, {
2228
+ !e.headless && j.value.length > 1 ? (f(), k(tn, {
2228
2229
  key: 1,
2229
2230
  "container-ref": _.value,
2230
2231
  "has-prev": e.currentIndex > 0,
@@ -2241,7 +2242,7 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
2241
2242
  for (const [n, i] of t)
2242
2243
  o[n] = i;
2243
2244
  return o;
2244
- }, _e = /* @__PURE__ */ xn(bn, [["__scopeId", "data-v-ae1697ec"]]), Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2245
+ }, _e = /* @__PURE__ */ xn(bn, [["__scopeId", "data-v-25be0487"]]), Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2245
2246
  __proto__: null,
2246
2247
  default: _e
2247
2248
  }, Symbol.toStringTag, { value: "Module" }));
@@ -2307,7 +2308,7 @@ const yn = ["data-theme"], Zn = /* @__PURE__ */ X({
2307
2308
  const r = M(
2308
2309
  () => o.theme === "auto" ? l.value ? "dark" : "light" : o.theme
2309
2310
  ), u = () => n("close"), d = (p) => p.stopPropagation(), m = (p) => p.stopPropagation();
2310
- return (p, c) => (f(), F(vt, { to: "body" }, [
2311
+ return (p, c) => (f(), k(vt, { to: "body" }, [
2311
2312
  H(ht, { name: "vfp-fade" }, {
2312
2313
  default: gt(() => [
2313
2314
  e.isOpen ? (f(), b("div", {
@@ -2337,10 +2338,11 @@ const yn = ["data-theme"], Zn = /* @__PURE__ */ X({
2337
2338
  "request-handler": e.requestHandler,
2338
2339
  "should-fetch-as-blob": e.shouldFetchAsBlob,
2339
2340
  "on-download": e.onDownload,
2341
+ "on-close": () => n("close"),
2340
2342
  onClose: c[0] || (c[0] = (w) => n("close")),
2341
2343
  onNavigate: c[1] || (c[1] = (w) => n("navigate", w)),
2342
2344
  onCustomEvent: c[2] || (c[2] = (w) => n("custom-event", w))
2343
- }, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download"])
2345
+ }, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download", "on-close"])
2344
2346
  ])
2345
2347
  ], 32)
2346
2348
  ], 8, yn)) : L("", !0)
@@ -2349,7 +2351,7 @@ const yn = ["data-theme"], Zn = /* @__PURE__ */ X({
2349
2351
  })
2350
2352
  ]));
2351
2353
  }
2352
- }), kn = ["data-theme"], Fn = { class: "vfp-relative vfp-w-full vfp-h-full vfp-overflow-hidden vfp-bg-surface-overlay" }, Gn = /* @__PURE__ */ X({
2354
+ }), Fn = ["data-theme"], kn = { class: "vfp-relative vfp-w-full vfp-h-full vfp-overflow-hidden vfp-bg-surface-overlay" }, Gn = /* @__PURE__ */ X({
2353
2355
  __name: "FilePreviewEmbed",
2354
2356
  props: {
2355
2357
  files: {},
@@ -2364,9 +2366,10 @@ const yn = ["data-theme"], Zn = /* @__PURE__ */ X({
2364
2366
  requestInit: { type: Function, default: void 0 },
2365
2367
  requestHandler: { type: Function, default: void 0 },
2366
2368
  shouldFetchAsBlob: { type: Function, default: void 0 },
2367
- onDownload: { type: Function, default: void 0 }
2369
+ onDownload: { type: Function, default: void 0 },
2370
+ onClose: { type: Function, default: void 0 }
2368
2371
  },
2369
- emits: ["navigate", "custom-event"],
2372
+ emits: ["navigate", "custom-event", "close"],
2370
2373
  setup(e, { emit: t }) {
2371
2374
  const o = e, n = t, i = C(
2372
2375
  typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
@@ -2397,7 +2400,7 @@ const yn = ["data-theme"], Zn = /* @__PURE__ */ X({
2397
2400
  style: s,
2398
2401
  "data-theme": l.value
2399
2402
  }, [
2400
- T("div", Fn, [
2403
+ T("div", kn, [
2401
2404
  H(_e, {
2402
2405
  mode: "embed",
2403
2406
  files: e.files,
@@ -2411,11 +2414,13 @@ const yn = ["data-theme"], Zn = /* @__PURE__ */ X({
2411
2414
  "request-handler": e.requestHandler,
2412
2415
  "should-fetch-as-blob": e.shouldFetchAsBlob,
2413
2416
  "on-download": e.onDownload,
2417
+ "on-close": e.onClose,
2414
2418
  onNavigate: u[0] || (u[0] = (d) => n("navigate", d)),
2415
- onCustomEvent: u[1] || (u[1] = (d) => n("custom-event", d))
2416
- }, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download"])
2419
+ onCustomEvent: u[1] || (u[1] = (d) => n("custom-event", d)),
2420
+ onClose: u[2] || (u[2] = () => n("close"))
2421
+ }, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download", "on-close"])
2417
2422
  ])
2418
- ], 8, kn));
2423
+ ], 8, Fn));
2419
2424
  }
2420
2425
  }), Xn = Rt.version;
2421
2426
  export {
@@ -2455,4 +2460,4 @@ export {
2455
2460
  jt as w,
2456
2461
  Mn as y
2457
2462
  };
2458
- //# sourceMappingURL=index-Oxwizt6-.mjs.map
2463
+ //# sourceMappingURL=index-CFaWV6cC.mjs.map