anyfile-cli 0.0.0-stage → 0.2.0
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/LICENSE +177 -0
- package/README.md +56 -2
- package/SKILL.md +101 -0
- package/chunks/browser-probe-5STDX455.mjs +17 -0
- package/chunks/browser-probe-F5RX44T3.mjs +24 -0
- package/chunks/chunk-2C34VMNV.mjs +108 -0
- package/chunks/chunk-3OZ56PUH.mjs +97 -0
- package/chunks/chunk-3YRWCQGV.mjs +38 -0
- package/chunks/chunk-53MJMIN4.mjs +23 -0
- package/chunks/chunk-5LOC7IST.mjs +372 -0
- package/chunks/chunk-5OI4NQH7.mjs +2232 -0
- package/chunks/chunk-5XTYLZF3.mjs +559 -0
- package/chunks/chunk-5ZHDYRGV.mjs +64 -0
- package/chunks/chunk-6CQL4K2K.mjs +21 -0
- package/chunks/chunk-6EVJJFOH.mjs +243 -0
- package/chunks/chunk-6NWSQGYE.mjs +68 -0
- package/chunks/chunk-7O5JLQE7.mjs +1 -0
- package/chunks/chunk-A6AQI6DF.mjs +321 -0
- package/chunks/chunk-AYF63UBE.mjs +79 -0
- package/chunks/chunk-B27PR6Q4.mjs +17 -0
- package/chunks/chunk-BP7LORL4.mjs +13 -0
- package/chunks/chunk-BVCRJLCD.mjs +109 -0
- package/chunks/chunk-CLSEE3VA.mjs +28 -0
- package/chunks/chunk-CO2ZAQIK.mjs +52 -0
- package/chunks/chunk-CQWM5GMU.mjs +167 -0
- package/chunks/chunk-CZFFYCMJ.mjs +136 -0
- package/chunks/chunk-D3CS6TIK.mjs +419 -0
- package/chunks/chunk-DJLFVMDJ.mjs +807 -0
- package/chunks/chunk-DJXVCKIO.mjs +30 -0
- package/chunks/chunk-EMXODK3K.mjs +94 -0
- package/chunks/chunk-EOJ7ZCDK.mjs +227 -0
- package/chunks/chunk-H4TBN22D.mjs +100 -0
- package/chunks/chunk-HUSX3ZU3.mjs +58 -0
- package/chunks/chunk-IC3G2XE2.mjs +436 -0
- package/chunks/chunk-IZGTVZHE.mjs +90 -0
- package/chunks/chunk-J4G7LUPA.mjs +117 -0
- package/chunks/chunk-JBAJW66L.mjs +4220 -0
- package/chunks/chunk-JKQUF2MM.mjs +438 -0
- package/chunks/chunk-KAMPC5TK.mjs +131 -0
- package/chunks/chunk-KSKEMJVC.mjs +145 -0
- package/chunks/chunk-LRHHRZLE.mjs +29 -0
- package/chunks/chunk-M37ZOAUG.mjs +93 -0
- package/chunks/chunk-MG7LUDXO.mjs +187 -0
- package/chunks/chunk-NGVHHTQD.mjs +125 -0
- package/chunks/chunk-NQ7J2NH6.mjs +50 -0
- package/chunks/chunk-NUMNHVSI.mjs +60 -0
- package/chunks/chunk-ORJ3DN65.mjs +58 -0
- package/chunks/chunk-QOUEBPPL.mjs +15 -0
- package/chunks/chunk-QR3Y3UKM.mjs +194 -0
- package/chunks/chunk-RFKYE7SE.mjs +50 -0
- package/chunks/chunk-SH57XOAV.mjs +33 -0
- package/chunks/chunk-TB5ISPA4.mjs +1 -0
- package/chunks/chunk-UGAU3V4V.mjs +206 -0
- package/chunks/chunk-UUN2DVDC.mjs +1893 -0
- package/chunks/chunk-WDN6NMVU.mjs +36 -0
- package/chunks/chunk-WWTLSPEG.mjs +3999 -0
- package/chunks/chunk-XDW56XVX.mjs +69 -0
- package/chunks/chunk-XRT7TAAY.mjs +27 -0
- package/chunks/chunk-XTW4HNIJ.mjs +418 -0
- package/chunks/chunk-YPLWNGCC.mjs +17 -0
- package/chunks/chunk-ZBR7RQQE.mjs +64 -0
- package/chunks/chunk-ZUHJIGHP.mjs +300 -0
- package/chunks/deflate-IINN6MRE.mjs +19 -0
- package/chunks/jpeg-N3DSYEAQ.mjs +964 -0
- package/chunks/jxl_oxide_wasm-3UN6G3YN.mjs +589 -0
- package/chunks/lerc-5LP7Q554.mjs +2086 -0
- package/chunks/lzw-Z2ZZBEWD.mjs +137 -0
- package/chunks/packbits-3S2JASDB.mjs +34 -0
- package/chunks/pdf.worker-PUGU2NS2.mjs +67416 -0
- package/chunks/probe-22WNVZ3I.mjs +17 -0
- package/chunks/probe-2P4CTFCY.mjs +14 -0
- package/chunks/probe-2QBNDPYK.mjs +18 -0
- package/chunks/probe-34TOVXUI.mjs +11 -0
- package/chunks/probe-3W2HOWBM.mjs +20 -0
- package/chunks/probe-42OBMD35.mjs +23 -0
- package/chunks/probe-43RVHUBG.mjs +17 -0
- package/chunks/probe-4O362IEX.mjs +18 -0
- package/chunks/probe-4WF34ZXS.mjs +11 -0
- package/chunks/probe-5ZITS3T5.mjs +40 -0
- package/chunks/probe-5ZS5DHFP.mjs +21 -0
- package/chunks/probe-62RFYKCP.mjs +14 -0
- package/chunks/probe-64JTFRH4.mjs +41 -0
- package/chunks/probe-6YJQJJ3R.mjs +518 -0
- package/chunks/probe-6YMOOV53.mjs +39 -0
- package/chunks/probe-BYBD2WAK.mjs +239 -0
- package/chunks/probe-CZZNJOHV.mjs +20 -0
- package/chunks/probe-DJMPK6HU.mjs +11 -0
- package/chunks/probe-FMWIF4LX.mjs +33 -0
- package/chunks/probe-FYPH6CYY.mjs +206 -0
- package/chunks/probe-G6PPXKBE.mjs +15 -0
- package/chunks/probe-GJ5OUOQ3.mjs +32 -0
- package/chunks/probe-H6J7TUY2.mjs +95 -0
- package/chunks/probe-IGZ47OE3.mjs +68 -0
- package/chunks/probe-IL5HO3OK.mjs +46 -0
- package/chunks/probe-INYCDZHO.mjs +27 -0
- package/chunks/probe-JFH545GO.mjs +11 -0
- package/chunks/probe-JZYDRITV.mjs +18 -0
- package/chunks/probe-K3WW5O5K.mjs +26 -0
- package/chunks/probe-KB4T466L.mjs +70 -0
- package/chunks/probe-KY7SIIXD.mjs +13 -0
- package/chunks/probe-L2P263WT.mjs +16 -0
- package/chunks/probe-LEP3RQPD.mjs +11 -0
- package/chunks/probe-M2QWULOI.mjs +119 -0
- package/chunks/probe-M7AYZBD3.mjs +35 -0
- package/chunks/probe-MEN3BMBB.mjs +22 -0
- package/chunks/probe-MNIGKDWT.mjs +163 -0
- package/chunks/probe-NFVFWB4M.mjs +56 -0
- package/chunks/probe-NJGSTL6R.mjs +161 -0
- package/chunks/probe-O73EHWT3.mjs +14 -0
- package/chunks/probe-OG2XYCG2.mjs +25 -0
- package/chunks/probe-OTKJKTNS.mjs +10 -0
- package/chunks/probe-OZKO3C2V.mjs +27 -0
- package/chunks/probe-PBL4KITG.mjs +12 -0
- package/chunks/probe-PEFZNH2T.mjs +21 -0
- package/chunks/probe-R4SSEXES.mjs +27 -0
- package/chunks/probe-RCAUVV27.mjs +29 -0
- package/chunks/probe-RPGBKGPI.mjs +20 -0
- package/chunks/probe-S2I46SEO.mjs +10 -0
- package/chunks/probe-SGDD4U4Q.mjs +165 -0
- package/chunks/probe-SPQO5LHI.mjs +9 -0
- package/chunks/probe-TBR6UGRZ.mjs +19 -0
- package/chunks/probe-TNKNILAW.mjs +21 -0
- package/chunks/probe-TVRJBPXH.mjs +48 -0
- package/chunks/probe-UESMTUQ5.mjs +33 -0
- package/chunks/probe-VDXFEZ5Q.mjs +16 -0
- package/chunks/probe-VX7JCDW6.mjs +39 -0
- package/chunks/probe-W7M55OPE.mjs +64 -0
- package/chunks/probe-XUBTIWGE.mjs +13 -0
- package/chunks/probe-ZF7KIRHO.mjs +36 -0
- package/chunks/raw-JJRPYAXO.mjs +16 -0
- package/chunks/tiff-metadata-7MWLNVW2.mjs +2990 -0
- package/chunks/webimage-D6XSCCTJ.mjs +56 -0
- package/chunks/zip-reader-YUGANW4Z.mjs +92 -0
- package/chunks/zstd-AH2S24PU.mjs +121 -0
- package/cli-main.mjs +278 -0
- package/cli.mjs +3 -0
- package/extractors/apple-plist.mjs +145 -0
- package/extractors/archive-metadata-viewer.mjs +1401 -0
- package/extractors/bittorrent-metadata.mjs +369 -0
- package/extractors/calendar-contacts.mjs +328 -0
- package/extractors/camera-raw.mjs +201 -0
- package/extractors/chm-reader.mjs +1842 -0
- package/extractors/comic-book-reader.mjs +307 -0
- package/extractors/design-source.mjs +1801 -0
- package/extractors/dev-array-viewer.mjs +825 -0
- package/extractors/dev-native-binary-viewer.mjs +1661 -0
- package/extractors/dev-source-map-viewer.mjs +416 -0
- package/extractors/dev-wasm-viewer.mjs +506 -0
- package/extractors/dicom.mjs +383 -0
- package/extractors/djvu-reader.mjs +337 -0
- package/extractors/duckdb-data.mjs +49174 -0
- package/extractors/epub-reader.mjs +222 -0
- package/extractors/excel-workbook.mjs +27057 -0
- package/extractors/fictionbook-reader.mjs +362 -0
- package/extractors/font-viewer.mjs +441 -0
- package/extractors/general-raster.mjs +444 -0
- package/extractors/hdr-image.mjs +1685 -0
- package/extractors/http-archive.mjs +306 -0
- package/extractors/ifc.mjs +341 -0
- package/extractors/iwork.mjs +640 -0
- package/extractors/microsoft-project.mjs +174 -0
- package/extractors/mind-map.mjs +607 -0
- package/extractors/ml-weights.mjs +649 -0
- package/extractors/modern-raster.mjs +620 -0
- package/extractors/ofd-reader.mjs +973 -0
- package/extractors/outlook-pst.mjs +997 -0
- package/extractors/pdfjs-pdf.mjs +32056 -0
- package/extractors/photoshop-document.mjs +17448 -0
- package/extractors/safe-svg.mjs +163 -0
- package/extractors/scientific-data.mjs +2041 -0
- package/extractors/sqlite-database.mjs +333 -0
- package/extractors/statistical-data.mjs +297 -0
- package/extractors/visio.mjs +141 -0
- package/extractors/x509-certificate.mjs +588 -0
- package/extractors/xps-reader.mjs +896 -0
- package/index.mjs +83 -0
- package/licenses/dicom-parser/1.8.21/LICENSE +21 -0
- package/licenses/libraw-wasm/1.6.0/COPYRIGHT.LibRaw +27 -0
- package/licenses/libraw-wasm/1.6.0/LICENSE.Emscripten +102 -0
- package/licenses/libraw-wasm/1.6.0/LICENSE.LibRaw-CDDL-1.0 +340 -0
- package/licenses/libraw-wasm/1.6.0/LICENSE.Little-CMS-MIT +22 -0
- package/licenses/libraw-wasm/1.6.0/LICENSE.libpng +134 -0
- package/licenses/libraw-wasm/1.6.0/LICENSE.libraw-wasm-ISC +15 -0
- package/licenses/libraw-wasm/1.6.0/LICENSE.zlib +22 -0
- package/licenses/libraw-wasm/1.6.0/NOTICE.IJG-libjpeg +49 -0
- package/licenses/libraw-wasm/1.6.0/SOURCE.md +25 -0
- package/licenses/libraw-wasm/1.6.0/THIRD_PARTY_NOTICES.md +14 -0
- package/licenses/mediabunny/1.55.3/MPL-2.0.txt +373 -0
- package/licenses/mediabunny/1.55.3/SOURCE.md +16 -0
- package/licenses/openskp/1.3.0/LICENSE +21 -0
- package/package.json +33 -3
- package/renderer-host/assets/ColladaComposer-TCm9fgZa.js +1 -0
- package/renderer-host/assets/ColladaParser-BHTzbhBz.js +3 -0
- package/renderer-host/assets/FBXLoader-D1vDnL3o.js +8 -0
- package/renderer-host/assets/agent-CKvDbj87.js +1 -0
- package/renderer-host/assets/amf-CLBaywBr.js +1 -0
- package/renderer-host/assets/animation-DnPo99To.js +1 -0
- package/renderer-host/assets/archive-client-CyhEmSF7.js +1 -0
- package/renderer-host/assets/archive.worker-CcLnJ9FC.js +1 -0
- package/renderer-host/assets/audio-visualizer-CiyGNhY2.js +1 -0
- package/renderer-host/assets/basedecoder-BuG7fe0q.js +1 -0
- package/renderer-host/assets/book-source-28BQcBKR.js +1 -0
- package/renderer-host/assets/book-worker-DrtzCzPo.js +1 -0
- package/renderer-host/assets/browser-C0pGRq_c.js +1 -0
- package/renderer-host/assets/client-Dp-p4unY.js +1 -0
- package/renderer-host/assets/container-inspection-DZoaDYQR.js +1 -0
- package/renderer-host/assets/data-table-OJQe3aN5.js +1 -0
- package/renderer-host/assets/decode-D5vB6JN8.js +1 -0
- package/renderer-host/assets/decode-tiff-BuYdKp6p.js +5 -0
- package/renderer-host/assets/decoder-worker-B0sdTVlF.js +1 -0
- package/renderer-host/assets/decoder-worker-CBiHE971.js +3 -0
- package/renderer-host/assets/decoder-worker-Cr5oP97p.js +5 -0
- package/renderer-host/assets/decoder-worker-DIdLFebY.js +11 -0
- package/renderer-host/assets/decoder-worker-DLeuEYxq.js +1 -0
- package/renderer-host/assets/decoder.worker-BXAaF0Qj.js +1 -0
- package/renderer-host/assets/decoder.worker-yaM6uups.js +1 -0
- package/renderer-host/assets/deflate-DPjr4M2G.js +1 -0
- package/renderer-host/assets/deflate-S3QmZI-f.js +1 -0
- package/renderer-host/assets/dual-track-playback-lNQyU1GR.js +1 -0
- package/renderer-host/assets/ext-searchbox-BIdon51Z.js +164 -0
- package/renderer-host/assets/ffmpeg-playback-QcT_NwlK.js +1 -0
- package/renderer-host/assets/gltf-Cqq-xStc.js +1 -0
- package/renderer-host/assets/hdf5.worker-BO3TrRup.js +1 -0
- package/renderer-host/assets/heif-worker-CC9DI3ZR.js +1 -0
- package/renderer-host/assets/id3-uzaDmDwy.js +1 -0
- package/renderer-host/assets/ifc.worker-KIbgAIsy.js +1 -0
- package/renderer-host/assets/image-load-B1fNI3iO.js +1 -0
- package/renderer-host/assets/index-BCxD9rBl.js +2 -0
- package/renderer-host/assets/jpeg-AGQ46WDa.js +1 -0
- package/renderer-host/assets/jpeg-Dm0yBuYB.js +1 -0
- package/renderer-host/assets/jszip.min-DCdQ6XWv.js +2 -0
- package/renderer-host/assets/jxl_oxide_wasm-BJKDqoXP.js +1 -0
- package/renderer-host/assets/jxl_oxide_wasm_bg-C5JqlrFv.wasm +0 -0
- package/renderer-host/assets/kernel.worker-B58X9XWu.js +1 -0
- package/renderer-host/assets/kernel.worker-BcQYKb39.js +8 -0
- package/renderer-host/assets/kernel.worker-BdWmPdqg.js +1 -0
- package/renderer-host/assets/kernel.worker-C7qxomuK.js +1 -0
- package/renderer-host/assets/kernel.worker-D88TbQnz.js +1 -0
- package/renderer-host/assets/laz-Lt10LsWd.js +1 -0
- package/renderer-host/assets/lerc-BxVqCKaH.js +3 -0
- package/renderer-host/assets/lerc-CRhfhhOS.js +1 -0
- package/renderer-host/assets/lzw-D2FslT4L.js +1 -0
- package/renderer-host/assets/lzw-DODNa9l5.js +1 -0
- package/renderer-host/assets/mediabunny-viewer-BnJM6Yo0.js +16 -0
- package/renderer-host/assets/model-D2YSoRt5.js +1 -0
- package/renderer-host/assets/obj-DbUZkDna.js +9 -0
- package/renderer-host/assets/off-CzR_R_Tf.js +1 -0
- package/renderer-host/assets/ogg-probe-C2TT74FL.js +1 -0
- package/renderer-host/assets/ogg-viewer-CT31JEhG.js +9 -0
- package/renderer-host/assets/packbits-DCimUQ1T.js +1 -0
- package/renderer-host/assets/paged-CX-N_Pzy.js +319 -0
- package/renderer-host/assets/pako.esm-0UYEm1Jg.js +2 -0
- package/renderer-host/assets/pako.esm-CtVA0R7W.js +1 -0
- package/renderer-host/assets/pdf.worker.min-CHFwMXne.mjs +29 -0
- package/renderer-host/assets/ply-C-xrhUaO.js +2 -0
- package/renderer-host/assets/points.worker-CA8v75dl.js +2 -0
- package/renderer-host/assets/probe-asf-CvcaYQaR.js +14 -0
- package/renderer-host/assets/range-reader-9PeAh1Hv.js +1 -0
- package/renderer-host/assets/raw-A-vJRPpa.js +1 -0
- package/renderer-host/assets/resource-cache-CHocY8K3.js +1 -0
- package/renderer-host/assets/resources-WcZvn3-C.js +1 -0
- package/renderer-host/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
- package/renderer-host/assets/safe-content-B61Ktgzp.js +1 -0
- package/renderer-host/assets/sanitize-D56ODnaM.js +1 -0
- package/renderer-host/assets/scene-adapter-CmaaVwsM.js +1 -0
- package/renderer-host/assets/scene.worker-CJViWLYo.js +24 -0
- package/renderer-host/assets/scene.worker-D7koFZY8.js +2 -0
- package/renderer-host/assets/skp-adapter-ByI1iX8S.js +1 -0
- package/renderer-host/assets/skp.worker-D9ujTXFV.js +1 -0
- package/renderer-host/assets/src-0DTp6SF8.js +1 -0
- package/renderer-host/assets/src-0QHjkpy0.js +44 -0
- package/renderer-host/assets/src-2X3Gt6Lk.js +2 -0
- package/renderer-host/assets/src-2tfD0huT.js +16 -0
- package/renderer-host/assets/src-5ZJshveh.js +29 -0
- package/renderer-host/assets/src-9k3CCYnZ.js +1 -0
- package/renderer-host/assets/src-B0zJlB0C.js +27 -0
- package/renderer-host/assets/src-B4jorJ2U.js +100 -0
- package/renderer-host/assets/src-BB6xj1UK.js +18 -0
- package/renderer-host/assets/src-BEn15PBT.js +52 -0
- package/renderer-host/assets/src-BLndk63N.js +7 -0
- package/renderer-host/assets/src-BMrLVJyB.js +169 -0
- package/renderer-host/assets/src-BPG8SYXq.js +10 -0
- package/renderer-host/assets/src-BZrNtUNO.js +2 -0
- package/renderer-host/assets/src-B_o7QilB.js +58 -0
- package/renderer-host/assets/src-BgM1jpe4.js +5 -0
- package/renderer-host/assets/src-BgUXah8O.js +1 -0
- package/renderer-host/assets/src-Bl5Lv4-d.js +1 -0
- package/renderer-host/assets/src-Blx9jp9x.js +90 -0
- package/renderer-host/assets/src-Bu1cTJNz.js +64 -0
- package/renderer-host/assets/src-BuN3y1yE.js +24 -0
- package/renderer-host/assets/src-Bw-O8ujJ.js +2 -0
- package/renderer-host/assets/src-BwZAUudm.js +2 -0
- package/renderer-host/assets/src-BydeR01n.js +1 -0
- package/renderer-host/assets/src-C2LKqLBA.js +182 -0
- package/renderer-host/assets/src-C4t_UvT8.js +8 -0
- package/renderer-host/assets/src-C5k8Ydia.js +1 -0
- package/renderer-host/assets/src-C6w9FGSB.js +1 -0
- package/renderer-host/assets/src-C9Uz3C-q.js +432 -0
- package/renderer-host/assets/src-CAdKRH5C.js +37 -0
- package/renderer-host/assets/src-CBE5sqjl.js +7 -0
- package/renderer-host/assets/src-CBo2yHRk.js +21 -0
- package/renderer-host/assets/src-CGx0nUS5.js +24 -0
- package/renderer-host/assets/src-CHNgoDf9.js +10 -0
- package/renderer-host/assets/src-CIDWSV97.js +1 -0
- package/renderer-host/assets/src-CPUYqpHZ.js +9 -0
- package/renderer-host/assets/src-CVc67mQv.js +1 -0
- package/renderer-host/assets/src-CXRrmfb0.js +7 -0
- package/renderer-host/assets/src-C_1M1IDo.js +8 -0
- package/renderer-host/assets/src-C_HAB_bn.js +5 -0
- package/renderer-host/assets/src-CeGmxOTi.js +1 -0
- package/renderer-host/assets/src-CifsQr3m.js +222 -0
- package/renderer-host/assets/src-Ck1ekdEN.js +1 -0
- package/renderer-host/assets/src-ClIHDiJ4.js +27 -0
- package/renderer-host/assets/src-Cvb3aCDG.js +10 -0
- package/renderer-host/assets/src-Cyw_3X-L.js +989 -0
- package/renderer-host/assets/src-D3OyeoQs.js +1 -0
- package/renderer-host/assets/src-D4cv_-u0.js +1 -0
- package/renderer-host/assets/src-DPm7_lsi.js +24 -0
- package/renderer-host/assets/src-DZE9IoBl.js +88 -0
- package/renderer-host/assets/src-DmzigsPg.js +7 -0
- package/renderer-host/assets/src-DpEmkhrn.js +6 -0
- package/renderer-host/assets/src-DrYYfoQO.js +7 -0
- package/renderer-host/assets/src-DsVDi0pr.js +4126 -0
- package/renderer-host/assets/src-ORHZWeVF.js +2 -0
- package/renderer-host/assets/src-Q-oKL3Dw.js +10 -0
- package/renderer-host/assets/src-QXdjrTaw.js +4 -0
- package/renderer-host/assets/src-R4bKlaNn.js +387 -0
- package/renderer-host/assets/src-TbSq3WSr.js +115 -0
- package/renderer-host/assets/src-TuTvYAR6.js +11 -0
- package/renderer-host/assets/src-eVKtGm4Q.js +17 -0
- package/renderer-host/assets/src-efHN2oAJ.js +17 -0
- package/renderer-host/assets/src-hCrza_Lf.js +1 -0
- package/renderer-host/assets/src-j_mEQ9Os.js +9 -0
- package/renderer-host/assets/src-lYIAi6Hw.js +1 -0
- package/renderer-host/assets/src-n2gsf381.js +20 -0
- package/renderer-host/assets/src-p14e1hma.js +23 -0
- package/renderer-host/assets/src-rJN_jaC5.js +1 -0
- package/renderer-host/assets/src-vPHMg1Fp.js +1 -0
- package/renderer-host/assets/src-wrrVkfrK.js +1 -0
- package/renderer-host/assets/stl-adapter-D1eozFH9.js +1 -0
- package/renderer-host/assets/stl.worker-C-anHijM.js +1 -0
- package/renderer-host/assets/three-mf-CbcWWdM8.js +2 -0
- package/renderer-host/assets/webimage-zQMH-_zR.js +1 -0
- package/renderer-host/assets/webm-_wYh_V7u.js +1 -0
- package/renderer-host/assets/worker-QK2gViTu.js +1 -0
- package/renderer-host/assets/x6-dng-worker-CNf3zUP-.js +1 -0
- package/renderer-host/assets/xml.browser-CC8-XAyN.js +1 -0
- package/renderer-host/assets/zip-core-base-CDv8KjIR.js +1 -0
- package/renderer-host/assets/zip-core-custom-D3VVVj-J.js +1 -0
- package/renderer-host/assets/zip-source-C5dFTDt7.js +1 -0
- package/renderer-host/assets/zstd-CmwSLjHB.js +1 -0
- package/renderer-host/assets/zstd-i4Jwubnx.js +1 -0
- package/renderer-host/index.html +65 -0
- package/vendor-manifest.json +1433 -0
- package/worker.mjs +261 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { createRequire as __anyfileCreateRequire } from "node:module"; import { dirname as __anyfileDirname } from "node:path"; import { fileURLToPath as __anyfileFileURLToPath } from "node:url"; const require = __anyfileCreateRequire(import.meta.url); const __filename = __anyfileFileURLToPath(import.meta.url); const __dirname = __anyfileDirname(__filename);
|
|
2
|
+
import {
|
|
3
|
+
FB2_NAMESPACE,
|
|
4
|
+
decodeFb2,
|
|
5
|
+
singleFb2
|
|
6
|
+
} from "../chunks/chunk-XRT7TAAY.mjs";
|
|
7
|
+
import {
|
|
8
|
+
openBookZip
|
|
9
|
+
} from "../chunks/chunk-NGVHHTQD.mjs";
|
|
10
|
+
import "../chunks/chunk-ZBR7RQQE.mjs";
|
|
11
|
+
import "../chunks/chunk-KSKEMJVC.mjs";
|
|
12
|
+
import "../chunks/chunk-XDW56XVX.mjs";
|
|
13
|
+
import "../chunks/chunk-D3CS6TIK.mjs";
|
|
14
|
+
import "../chunks/chunk-WWTLSPEG.mjs";
|
|
15
|
+
import {
|
|
16
|
+
CONTENT_CSP
|
|
17
|
+
} from "../chunks/chunk-NUMNHVSI.mjs";
|
|
18
|
+
import {
|
|
19
|
+
inspectImageFile
|
|
20
|
+
} from "../chunks/chunk-A6AQI6DF.mjs";
|
|
21
|
+
import {
|
|
22
|
+
markupToMarkdown
|
|
23
|
+
} from "../chunks/chunk-M37ZOAUG.mjs";
|
|
24
|
+
import {
|
|
25
|
+
ProtectedBookError
|
|
26
|
+
} from "../chunks/chunk-BP7LORL4.mjs";
|
|
27
|
+
import {
|
|
28
|
+
parseXmlDocument
|
|
29
|
+
} from "../chunks/chunk-53MJMIN4.mjs";
|
|
30
|
+
import {
|
|
31
|
+
AgentError,
|
|
32
|
+
ViewerError,
|
|
33
|
+
abortError,
|
|
34
|
+
isViewerAbortError,
|
|
35
|
+
markdownDocumentHeader,
|
|
36
|
+
readPagedTextDocument
|
|
37
|
+
} from "../chunks/chunk-IC3G2XE2.mjs";
|
|
38
|
+
import "../chunks/chunk-ORJ3DN65.mjs";
|
|
39
|
+
|
|
40
|
+
// ../plugins/fictionbook/src/safe-content.ts
|
|
41
|
+
var TAGS = { section: "section", title: "h2", subtitle: "h3", p: "p", poem: "blockquote", stanza: "div", v: "div", cite: "blockquote", epigraph: "blockquote", "text-author": "p", date: "p", table: "table", tr: "tr", th: "th", td: "td", a: "a", image: "img", strong: "strong", emphasis: "em", strikethrough: "s", sub: "sub", sup: "sup", code: "code", "empty-line": "br", coverpage: "div" };
|
|
42
|
+
function fb2Href(node) {
|
|
43
|
+
return node.getAttributeNS("http://www.w3.org/1999/xlink", "href") ?? node.getAttribute("href") ?? "";
|
|
44
|
+
}
|
|
45
|
+
async function prepareFb2Section(book, path, signal) {
|
|
46
|
+
const target = document.implementation.createHTMLDocument("");
|
|
47
|
+
const urls = /* @__PURE__ */ new Map();
|
|
48
|
+
const links = [];
|
|
49
|
+
let missingResources = 0, bytesTotal = 0, pixels = 0, nodes = 0, textBytes = 0;
|
|
50
|
+
const dispose = () => {
|
|
51
|
+
for (const url of urls.values()) URL.revokeObjectURL(url);
|
|
52
|
+
urls.clear();
|
|
53
|
+
};
|
|
54
|
+
async function image(id) {
|
|
55
|
+
if (urls.has(id)) return urls.get(id);
|
|
56
|
+
const binary = book.binaries.get(id);
|
|
57
|
+
if (!binary) {
|
|
58
|
+
missingResources++;
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const type = binary.getAttribute("content-type") ?? "";
|
|
62
|
+
if (!/^image\/(png|jpeg|gif|webp|avif)$/.test(type)) {
|
|
63
|
+
missingResources++;
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
const encoded = (binary.textContent ?? "").replace(/\s/g, "");
|
|
67
|
+
if (encoded.length > Math.ceil(FB2_LIMITS.image / 3) * 4 || urls.size >= FB2_LIMITS.resources)
|
|
68
|
+
throw new ViewerError("resource-limit", "FB2 image limit exceeded.");
|
|
69
|
+
if (encoded.length % 4 !== 0 || /[^A-Za-z0-9+/]/.test(encoded.replace(/={1,2}$/, "")))
|
|
70
|
+
throw new ViewerError("invalid-file", "Invalid FB2 base64.");
|
|
71
|
+
bytesTotal += encoded.length / 4 * 3;
|
|
72
|
+
if (bytesTotal > FB2_LIMITS.resourceBytes) throw new ViewerError("resource-limit", "FB2 resource bytes exceeded.");
|
|
73
|
+
const bytes = Uint8Array.from(atob(encoded), (char) => char.charCodeAt(0));
|
|
74
|
+
const info = inspectImageFile(bytes);
|
|
75
|
+
if (!info?.width || !info.height) throw new ViewerError("invalid-file", "Invalid FB2 image.");
|
|
76
|
+
if (info.animated && !info.frameCount) throw new ViewerError("resource-limit", "Unbounded FB2 animation.");
|
|
77
|
+
pixels += info.width * info.height * (info.frameCount ?? 1);
|
|
78
|
+
if (pixels > FB2_LIMITS.pixels) throw new ViewerError("resource-limit", "FB2 image pixels exceeded.");
|
|
79
|
+
signal.throwIfAborted();
|
|
80
|
+
const url = URL.createObjectURL(new Blob([bytes], { type }));
|
|
81
|
+
urls.set(id, url);
|
|
82
|
+
return url;
|
|
83
|
+
}
|
|
84
|
+
async function copy(node, parent) {
|
|
85
|
+
signal.throwIfAborted();
|
|
86
|
+
if (++nodes > FB2_LIMITS.chapterNodes) throw new ViewerError("resource-limit", "FB2 chapter nodes exceeded.");
|
|
87
|
+
if (nodes % 256 === 0) {
|
|
88
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
89
|
+
signal.throwIfAborted();
|
|
90
|
+
}
|
|
91
|
+
if (node.nodeType === 3) {
|
|
92
|
+
const value = node.textContent ?? "";
|
|
93
|
+
textBytes += new TextEncoder().encode(value).length;
|
|
94
|
+
if (textBytes > FB2_LIMITS.chapter) throw new ViewerError("resource-limit", "FB2 chapter bytes exceeded.");
|
|
95
|
+
parent.appendChild(target.createTextNode(value));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (node.nodeType !== 1) return;
|
|
99
|
+
const element = node;
|
|
100
|
+
const tag = TAGS[element.localName];
|
|
101
|
+
if (!tag || element.namespaceURI !== FB2_NAMESPACE) return;
|
|
102
|
+
const result = target.createElement(tag);
|
|
103
|
+
if (element.id) result.id = element.id;
|
|
104
|
+
if (tag === "td" || tag === "th") for (const attr of ["colspan", "rowspan"]) {
|
|
105
|
+
const value = element.getAttribute(attr);
|
|
106
|
+
if (value && /^[1-9]\d?$/.test(value)) result.setAttribute(attr, value);
|
|
107
|
+
}
|
|
108
|
+
const href = fb2Href(element);
|
|
109
|
+
if (tag === "a" && href.startsWith("#")) {
|
|
110
|
+
const fragment = href.slice(1), destination = book.anchors.get(fragment);
|
|
111
|
+
if (destination) {
|
|
112
|
+
result.setAttribute("href", "#");
|
|
113
|
+
result.dataset.bookLink = String(links.length);
|
|
114
|
+
links.push({ path: destination, fragment });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (tag === "img") {
|
|
118
|
+
const url = href.startsWith("#") ? await image(href.slice(1)) : null;
|
|
119
|
+
if (url) result.setAttribute("src", url);
|
|
120
|
+
result.setAttribute("alt", element.getAttribute("alt") ?? "");
|
|
121
|
+
} else for (const child of Array.from(node.childNodes)) await copy(child, result);
|
|
122
|
+
parent.appendChild(result);
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
const section = book.sections.get(path);
|
|
126
|
+
if (!section) throw new ViewerError("missing-related-file", "Missing FB2 section.");
|
|
127
|
+
for (const node of section) await copy(node, target.body);
|
|
128
|
+
const csp = target.createElement("meta");
|
|
129
|
+
csp.httpEquiv = "Content-Security-Policy";
|
|
130
|
+
csp.content = CONTENT_CSP;
|
|
131
|
+
const style = target.createElement("style");
|
|
132
|
+
style.id = "book-reader-style";
|
|
133
|
+
target.head.append(csp, style);
|
|
134
|
+
signal.throwIfAborted();
|
|
135
|
+
const html = "<!doctype html>" + target.documentElement.outerHTML;
|
|
136
|
+
if (new TextEncoder().encode(html).length > FB2_LIMITS.chapter) throw new ViewerError("resource-limit", "FB2 mapped chapter bytes exceeded.");
|
|
137
|
+
return { html, links, missingResources, dispose };
|
|
138
|
+
} catch (error) {
|
|
139
|
+
dispose();
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// ../plugins/fictionbook/src/publication.ts
|
|
145
|
+
var FB2_LIMITS = { file: 128 * 1024 * 1024, nodes: 1e5, depth: 64, chapters: 2e3, chapter: 2 * 1024 * 1024, chapterNodes: 2e4, image: 8 * 1024 * 1024, resources: 32, resourceBytes: 16 * 1024 * 1024, pixels: 16e6 };
|
|
146
|
+
function children(node, name) {
|
|
147
|
+
return Array.from(node.children).filter((child) => child.localName === name && child.namespaceURI === FB2_NAMESPACE);
|
|
148
|
+
}
|
|
149
|
+
function parseFictionBook(bytes, signal) {
|
|
150
|
+
signal.throwIfAborted();
|
|
151
|
+
if (bytes.length > FB2_LIMITS.file) throw new ViewerError("resource-limit", "FB2 file limit exceeded.");
|
|
152
|
+
const source = decodeFb2(bytes);
|
|
153
|
+
if (/<!DOCTYPE|<!ENTITY/i.test(source)) throw new ViewerError("invalid-file", "FB2 DTD and entities are disabled.");
|
|
154
|
+
const doc = parseXmlDocument(source, "application/xml");
|
|
155
|
+
const root = doc.documentElement;
|
|
156
|
+
if (doc.querySelector("parsererror") || root.localName !== "FictionBook" || root.namespaceURI !== FB2_NAMESPACE)
|
|
157
|
+
throw new ViewerError("invalid-file", "Invalid FictionBook XML.");
|
|
158
|
+
const stack = [[root, 1]];
|
|
159
|
+
const ids = /* @__PURE__ */ new Set();
|
|
160
|
+
let count = 0;
|
|
161
|
+
while (stack.length) {
|
|
162
|
+
const [node, depth] = stack.pop();
|
|
163
|
+
count += node.childNodes.length + 1;
|
|
164
|
+
if (depth > FB2_LIMITS.depth || count > FB2_LIMITS.nodes) throw new ViewerError("resource-limit", "FB2 structure limit exceeded.");
|
|
165
|
+
const id = node.getAttribute("id");
|
|
166
|
+
if (id) {
|
|
167
|
+
if (ids.has(id)) throw new ViewerError("invalid-file", "Duplicate FictionBook ID.");
|
|
168
|
+
ids.add(id);
|
|
169
|
+
}
|
|
170
|
+
if (node.localName === "binary" && (node.textContent?.length ?? 0) > Math.ceil(FB2_LIMITS.image / 3) * 4 + 65536)
|
|
171
|
+
throw new ViewerError("resource-limit", "FB2 binary limit exceeded.");
|
|
172
|
+
for (const child of Array.from(node.children)) stack.push([child, depth + 1]);
|
|
173
|
+
}
|
|
174
|
+
let generatedId = 0;
|
|
175
|
+
for (const section of Array.from(root.querySelectorAll("*"))) {
|
|
176
|
+
if (section.namespaceURI !== FB2_NAMESPACE || section.localName !== "section" || section.id) continue;
|
|
177
|
+
let id;
|
|
178
|
+
do {
|
|
179
|
+
id = `fb2-section-${generatedId++}`;
|
|
180
|
+
} while (ids.has(id));
|
|
181
|
+
section.id = id;
|
|
182
|
+
ids.add(id);
|
|
183
|
+
}
|
|
184
|
+
const description = children(root, "description")[0];
|
|
185
|
+
const info = description && children(description, "title-info")[0];
|
|
186
|
+
const text = (name) => info ? children(info, name)[0]?.textContent?.trim() ?? "" : "";
|
|
187
|
+
const book = {
|
|
188
|
+
title: text("book-title"),
|
|
189
|
+
author: info ? children(info, "author").map((author) => Array.from(author.children).filter((node) => ["first-name", "middle-name", "last-name", "nickname"].includes(node.localName)).map((node) => node.textContent).join(" ")).join(", ") : "",
|
|
190
|
+
spine: [],
|
|
191
|
+
toc: [],
|
|
192
|
+
sections: /* @__PURE__ */ new Map(),
|
|
193
|
+
anchors: /* @__PURE__ */ new Map(),
|
|
194
|
+
binaries: /* @__PURE__ */ new Map(),
|
|
195
|
+
description,
|
|
196
|
+
loadSection: (path, sectionSignal) => prepareFb2Section(book, path, sectionSignal)
|
|
197
|
+
};
|
|
198
|
+
for (const binary of children(root, "binary")) {
|
|
199
|
+
const id = binary.getAttribute("id");
|
|
200
|
+
if (id) book.binaries.set(id, binary);
|
|
201
|
+
}
|
|
202
|
+
function add(nodes, label) {
|
|
203
|
+
if (!nodes.length) return;
|
|
204
|
+
const path = `section-${book.spine.length}`;
|
|
205
|
+
book.spine.push({ id: label || path, path });
|
|
206
|
+
book.sections.set(path, nodes);
|
|
207
|
+
book.toc.push({ path, fragment: "", label: label || path });
|
|
208
|
+
for (const node of nodes) for (const element of [node, ...Array.from(node.querySelectorAll("*"))]) {
|
|
209
|
+
const id = element.getAttribute("id");
|
|
210
|
+
if (id) book.anchors.set(id, path);
|
|
211
|
+
if (element !== node && element.localName === "section" && id) {
|
|
212
|
+
const title = children(element, "title")[0]?.textContent?.trim();
|
|
213
|
+
if (title) book.toc.push({ path, fragment: id, label: title });
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const cover = info && children(info, "coverpage")[0];
|
|
218
|
+
const bodies = children(root, "body");
|
|
219
|
+
if (!bodies.length) throw new ViewerError("invalid-file", "Missing FictionBook body.");
|
|
220
|
+
for (const body of bodies) {
|
|
221
|
+
let preamble = [];
|
|
222
|
+
for (const node of Array.from(body.children)) {
|
|
223
|
+
if (node.localName === "section") {
|
|
224
|
+
add(preamble, book.title);
|
|
225
|
+
preamble = [];
|
|
226
|
+
add([node], children(node, "title")[0]?.textContent?.trim() ?? node.id);
|
|
227
|
+
} else preamble.push(node);
|
|
228
|
+
}
|
|
229
|
+
add(preamble, body.getAttribute("name") ?? book.title);
|
|
230
|
+
}
|
|
231
|
+
if (!book.spine.length) throw new ViewerError("invalid-file", "Empty FictionBook body.");
|
|
232
|
+
if (book.spine.length > FB2_LIMITS.chapters || book.toc.length > FB2_LIMITS.chapters)
|
|
233
|
+
throw new ViewerError("resource-limit", "FB2 chapter limit exceeded.");
|
|
234
|
+
if (cover) book.sections.get(book.spine[0].path).unshift(cover);
|
|
235
|
+
signal.throwIfAborted();
|
|
236
|
+
return book;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// ../plugins/fictionbook/src/extract.ts
|
|
240
|
+
var PLUGIN_ID = "fictionbook-reader";
|
|
241
|
+
var FB2_TAGS = {
|
|
242
|
+
title: "h1",
|
|
243
|
+
subtitle: "h2",
|
|
244
|
+
poem: "blockquote",
|
|
245
|
+
cite: "blockquote",
|
|
246
|
+
epigraph: "blockquote",
|
|
247
|
+
annotation: "div",
|
|
248
|
+
stanza: "div",
|
|
249
|
+
v: "p",
|
|
250
|
+
"text-author": "p",
|
|
251
|
+
date: "p",
|
|
252
|
+
"empty-line": "br",
|
|
253
|
+
coverpage: "div",
|
|
254
|
+
image: "img"
|
|
255
|
+
};
|
|
256
|
+
function mapError(error) {
|
|
257
|
+
if (error instanceof AgentError || isViewerAbortError(error)) throw error;
|
|
258
|
+
if (error instanceof ProtectedBookError) {
|
|
259
|
+
throw new AgentError("encrypted-file", "Encrypted FictionBook archives are not supported.", { pluginId: PLUGIN_ID, cause: error });
|
|
260
|
+
}
|
|
261
|
+
if (error instanceof ViewerError && error.code === "resource-limit") {
|
|
262
|
+
throw new AgentError("resource-limit", `FictionBook: ${error.message}`, { pluginId: PLUGIN_ID, cause: error });
|
|
263
|
+
}
|
|
264
|
+
throw new AgentError("invalid-file", "The file is not a readable FictionBook document.", { pluginId: PLUGIN_ID, cause: error });
|
|
265
|
+
}
|
|
266
|
+
async function withBook(context, run) {
|
|
267
|
+
if (context.signal.aborted) throw abortError();
|
|
268
|
+
let zip;
|
|
269
|
+
try {
|
|
270
|
+
let bytes;
|
|
271
|
+
const head = await context.source.read(0, 4, context.signal);
|
|
272
|
+
const isZip = head.length >= 4 && head[0] === 80 && head[1] === 75 && head[2] === 3 && head[3] === 4;
|
|
273
|
+
if (isZip) {
|
|
274
|
+
zip = await openBookZip(context.file, context.signal);
|
|
275
|
+
const path = singleFb2(zip.entries.keys());
|
|
276
|
+
if (!path) throw new ViewerError("invalid-file", "The ZIP archive does not contain exactly one FB2 book.");
|
|
277
|
+
bytes = await zip.read(path, FB2_LIMITS.file, context.signal);
|
|
278
|
+
} else {
|
|
279
|
+
if (context.file.size > FB2_LIMITS.file) throw new ViewerError("resource-limit", "FB2 file limit exceeded.");
|
|
280
|
+
bytes = new Uint8Array(await context.file.arrayBuffer());
|
|
281
|
+
}
|
|
282
|
+
return await run(parseFictionBook(bytes, context.signal));
|
|
283
|
+
} catch (error) {
|
|
284
|
+
return mapError(error);
|
|
285
|
+
} finally {
|
|
286
|
+
await zip?.dispose();
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
var clean = (value) => value?.replace(/\s+/g, " ").trim() ?? "";
|
|
290
|
+
function personName(person) {
|
|
291
|
+
const parts = ["first-name", "middle-name", "last-name"].map((name2) => clean(children(person, name2)[0]?.textContent));
|
|
292
|
+
const name = parts.filter(Boolean).join(" ");
|
|
293
|
+
const nickname = clean(children(person, "nickname")[0]?.textContent);
|
|
294
|
+
return name || nickname;
|
|
295
|
+
}
|
|
296
|
+
var REPEATED = /* @__PURE__ */ new Set(["author", "translator", "genre", "sequence"]);
|
|
297
|
+
function infoBlock(info) {
|
|
298
|
+
const result = {};
|
|
299
|
+
for (const node of info ? Array.from(info.children) : []) {
|
|
300
|
+
const name = node.localName;
|
|
301
|
+
if (name === "coverpage" || name === "image") continue;
|
|
302
|
+
const value = name === "author" || name === "translator" ? personName(node) : name === "sequence" ? [node.getAttribute("name"), node.getAttribute("number")].filter(Boolean).join(" #") : name === "annotation" || name === "history" ? markupToMarkdown(node, { tagMap: FB2_TAGS }) : clean(node.textContent);
|
|
303
|
+
if (!value) continue;
|
|
304
|
+
if (REPEATED.has(name)) (result[`${name}s`] ??= []).push(value);
|
|
305
|
+
else result[name] ??= value;
|
|
306
|
+
}
|
|
307
|
+
return result;
|
|
308
|
+
}
|
|
309
|
+
function chapterMarkdown(book, index, signal) {
|
|
310
|
+
if (signal.aborted) throw abortError();
|
|
311
|
+
const item = book.spine[index];
|
|
312
|
+
const text = markupToMarkdown(book.sections.get(item.path) ?? [], { tagMap: FB2_TAGS, headingOffset: 2 });
|
|
313
|
+
return Promise.resolve([`## Chapter ${index + 1}: ${clean(item.id)}`, "", text || "(no text in this chapter)"].join("\n"));
|
|
314
|
+
}
|
|
315
|
+
var fictionBookExtractor = {
|
|
316
|
+
inspect(context) {
|
|
317
|
+
return withBook(context, async (book) => {
|
|
318
|
+
const block = (name) => book.description ? children(book.description, name)[0] : void 0;
|
|
319
|
+
const titleInfo = infoBlock(block("title-info"));
|
|
320
|
+
const publishInfo = infoBlock(block("publish-info"));
|
|
321
|
+
return {
|
|
322
|
+
metadata: {
|
|
323
|
+
title: book.title,
|
|
324
|
+
authors: titleInfo.authors ?? [],
|
|
325
|
+
language: titleInfo.lang ?? null,
|
|
326
|
+
publisher: publishInfo.publisher ?? null,
|
|
327
|
+
isbn: publishInfo.isbn ?? null,
|
|
328
|
+
titleInfo,
|
|
329
|
+
publishInfo,
|
|
330
|
+
documentInfo: infoBlock(block("document-info")),
|
|
331
|
+
chapterCount: book.spine.length,
|
|
332
|
+
binaryCount: book.binaries.size,
|
|
333
|
+
toc: book.toc.map((entry) => ({ label: clean(entry.label), chapter: book.spine.findIndex((item) => item.path === entry.path) + 1 })),
|
|
334
|
+
sizeBytes: context.source.size
|
|
335
|
+
},
|
|
336
|
+
targets: book.spine.map((item, index) => ({ id: `chapter:${index + 1}`, title: clean(item.id) || `Chapter ${index + 1}`, kind: "chapter" }))
|
|
337
|
+
};
|
|
338
|
+
});
|
|
339
|
+
},
|
|
340
|
+
read(context, params) {
|
|
341
|
+
return withBook(context, async (book) => {
|
|
342
|
+
const titleInfo = book.description ? children(book.description, "title-info")[0] : void 0;
|
|
343
|
+
const field = (name) => clean(titleInfo && children(titleInfo, name)[0]?.textContent);
|
|
344
|
+
const fields = {};
|
|
345
|
+
if (book.author) fields.Authors = book.author;
|
|
346
|
+
if (field("lang")) fields.Language = field("lang");
|
|
347
|
+
if (field("genre")) fields.Genre = field("genre");
|
|
348
|
+
if (field("date")) fields.Date = field("date");
|
|
349
|
+
fields.Chapters = String(book.spine.length);
|
|
350
|
+
return readPagedTextDocument({
|
|
351
|
+
pageCount: book.spine.length,
|
|
352
|
+
targetPrefix: "chapter",
|
|
353
|
+
header: () => markdownDocumentHeader(book.title || context.file.name, fields),
|
|
354
|
+
page: (index) => chapterMarkdown(book, index, context.signal)
|
|
355
|
+
}, params, PLUGIN_ID);
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
var extract_default = fictionBookExtractor;
|
|
360
|
+
export {
|
|
361
|
+
extract_default as default
|
|
362
|
+
};
|