@poe-platform/safe-bash 0.1.799 → 0.1.800
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -17
- package/dist/image-ast/index.browser.js +1384 -23
- package/dist/image-ast/index.js +1384 -23
- package/dist/mp4-ast/types.d.ts +1 -0
- package/dist/office-package/zip.d.ts +2 -0
- package/dist/office-package/zip.js +1 -1
- package/dist/pdf-ast/index.js +1 -1
- package/dist/safe-bash/chunks/{chunk-IUTD5FH5.js → chunk-46UISJCK.js} +1 -6
- package/dist/safe-bash/chunks/chunk-4SEW2Q6H.js +26 -0
- package/dist/safe-bash/chunks/{chunk-AKC46AF6.js → chunk-7YSRXFEG.js} +7 -40
- package/dist/safe-bash/chunks/{chunk-KTGR4U57.js → chunk-BHJE5LPZ.js} +1 -2
- package/dist/safe-bash/chunks/{chunk-TRVGCN3U.js → chunk-HHW7MGS2.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-ZNAFMYIA.js → chunk-I7L3G3NX.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-KMH2DF3I.js → chunk-JJSTTIEZ.js} +6 -1
- package/dist/safe-bash/chunks/{chunk-6IBTC4YL.js → chunk-JTLSUJ7V.js} +57 -20
- package/dist/safe-bash/chunks/chunk-K2VCOJ2B.js +111 -0
- package/dist/safe-bash/chunks/chunk-K4YMYFRJ.js +9802 -0
- package/dist/safe-bash/chunks/{chunk-SPYL72GN.js → chunk-KW24TAIU.js} +446 -5519
- package/dist/safe-bash/chunks/{chunk-ENR3HB2B.js → chunk-NLAW7KDI.js} +0 -1
- package/dist/safe-bash/chunks/{chunk-B3DDEDH2.js → chunk-PPYM75Z3.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-NX2SQVON.js → chunk-RKKRJ54E.js} +19 -7
- package/dist/safe-bash/chunks/{chunk-WUNK5NXJ.js → chunk-RMWLWH7Q.js} +870 -953
- package/dist/safe-bash/chunks/{chunk-JSVX4VIA.js → chunk-TFGRKY43.js} +2 -1
- package/dist/safe-bash/chunks/{chunk-T5KKDMYB.js → chunk-TYD7EVUJ.js} +6 -0
- package/dist/safe-bash/chunks/{csvkit-W2UEKH6P.js → csvkit-QGP3GAOB.js} +1 -1
- package/dist/safe-bash/chunks/{ffmpeg-42CGASMV.js → ffmpeg-JTVH26MK.js} +1 -1
- package/dist/safe-bash/chunks/{gh-26GYLH6D.js → gh-I7QX7N5C.js} +1 -1
- package/dist/safe-bash/chunks/{git-YREKMUVD.js → git-MA7NKYVP.js} +1 -1
- package/dist/safe-bash/chunks/{imagemagick-3YIX4XO2.js → imagemagick-Y4NPWX2Q.js} +1 -1
- package/dist/safe-bash/chunks/{implementation-E3YMKU3Z.js → implementation-BWDKOVQJ.js} +1 -1
- package/dist/safe-bash/chunks/mmdc-44PELHDG.js +118 -0
- package/dist/safe-bash/chunks/{pdfimages-UE2UISP2.js → pdfimages-635TRW4Q.js} +1 -1
- package/dist/safe-bash/chunks/{pdfinfo-RGARKLI5.js → pdfinfo-FSDAA2KY.js} +3 -11
- package/dist/safe-bash/chunks/{pdftk-JY3WVCCC.js → pdftk-GQ5UH3VG.js} +1 -1
- package/dist/safe-bash/chunks/{pdftoppm-GPD3BMPY.js → pdftoppm-YTXQCAYT.js} +1 -1
- package/dist/safe-bash/chunks/{pdftotext-K7GQ2QJZ.js → pdftotext-CVA2G7FY.js} +1 -1
- package/dist/safe-bash/chunks/{qpdf-F4U7WUSU.js → qpdf-HZMIFG4A.js} +1 -1
- package/dist/safe-bash/chunks/{sips-RWENS7X5.js → sips-E7UBDP33.js} +1 -1
- package/dist/safe-bash/chunks/{soffice-IT6W2C5F.js → soffice-ELASUWUK.js} +1 -1
- package/dist/safe-bash/chunks/{wkhtmltopdf-JYNDAHIZ.js → wkhtmltopdf-EPO6YCMG.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-2FGJYFWZ.js +44 -0
- package/dist/safe-bash/command-chunks/chunk-2H4JTFIL.js +53 -0
- package/dist/safe-bash/command-chunks/{chunk-LLCXZKZ6.js → chunk-2QHG43WJ.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-364TMWBT.js +946 -0
- package/dist/safe-bash/command-chunks/{chunk-EIVW3X3N.js → chunk-3DT2YOGW.js} +11 -6
- package/dist/safe-bash/command-chunks/chunk-3E2OIS2J.js +7037 -0
- package/dist/safe-bash/command-chunks/{chunk-AIRGA2SU.js → chunk-3HXDA5PT.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-3LSOYLNV.js +1091 -0
- package/dist/safe-bash/command-chunks/chunk-4B7Y7S6E.js +61 -0
- package/dist/safe-bash/command-chunks/{chunk-HRLIAMXC.js → chunk-4C6QI5BQ.js} +3 -2
- package/dist/safe-bash/command-chunks/chunk-4ZHMW6F5.js +104 -0
- package/dist/safe-bash/command-chunks/{chunk-4ZALPDBV.js → chunk-53P53XFM.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-5LSGEIZY.js +379 -0
- package/dist/safe-bash/command-chunks/{chunk-MKQVQMXO.js → chunk-5LU4UCBR.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-5T7CRJHW.js +560 -0
- package/dist/safe-bash/command-chunks/chunk-5TBUOBDE.js +346 -0
- package/dist/safe-bash/command-chunks/chunk-5XY4DTNG.js +34 -0
- package/dist/safe-bash/command-chunks/chunk-5ZMZ573Q.js +140 -0
- package/dist/safe-bash/command-chunks/{chunk-OPUJSTHS.js → chunk-67IQF5GC.js} +200 -66
- package/dist/safe-bash/command-chunks/chunk-67QKREJK.js +347 -0
- package/dist/safe-bash/command-chunks/chunk-6EPHJGGF.js +23 -0
- package/dist/safe-bash/command-chunks/chunk-6F4XCVON.js +266 -0
- package/dist/safe-bash/command-chunks/{chunk-ESMCX3YV.js → chunk-6HMX4CQS.js} +669 -130
- package/dist/safe-bash/command-chunks/chunk-7K6JYKPJ.js +422 -0
- package/dist/safe-bash/command-chunks/chunk-7N2LI2KO.js +206 -0
- package/dist/safe-bash/command-chunks/chunk-7RGB363W.js +362 -0
- package/dist/safe-bash/command-chunks/{pptx-GBPNWNEP-7EQEVXV5.js → chunk-AI5JAXQF.js} +34820 -18029
- package/dist/safe-bash/command-chunks/chunk-AMO3THU4.js +105 -0
- package/dist/safe-bash/command-chunks/chunk-BAGCY35S.js +231 -0
- package/dist/safe-bash/command-chunks/chunk-BAXU7B5Z.js +101 -0
- package/dist/safe-bash/command-chunks/{chunk-KMCZ6P4O.js → chunk-BKCNF5U3.js} +68 -7
- package/dist/safe-bash/command-chunks/chunk-BNOU5YQS.js +182 -0
- package/dist/safe-bash/command-chunks/chunk-C7I25AAL.js +25 -0
- package/dist/safe-bash/command-chunks/chunk-CKXV2CLD.js +65 -0
- package/dist/safe-bash/command-chunks/chunk-CQ5YGOGB.js +150 -0
- package/dist/safe-bash/command-chunks/{chunk-I3K5RYU4.js → chunk-D4OP2BR3.js} +72 -24
- package/dist/safe-bash/command-chunks/chunk-DB453IE6.js +122 -0
- package/dist/safe-bash/command-chunks/chunk-DOKKNRRM.js +87 -0
- package/dist/safe-bash/command-chunks/{chunk-2PX5B7T5.js → chunk-DQAVUDDX.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-DT7BCTWY.js +249 -0
- package/dist/safe-bash/command-chunks/chunk-E2LB7FRT.js +42 -0
- package/dist/safe-bash/command-chunks/chunk-EK6YNAXT.js +343 -0
- package/dist/safe-bash/command-chunks/chunk-EQ4HV54N.js +22 -0
- package/dist/safe-bash/command-chunks/chunk-ERYJLO6G.js +293 -0
- package/dist/safe-bash/command-chunks/{chunk-4ONEXMD3.js → chunk-EUSPTFAX.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-FKKB5X5V.js +97 -0
- package/dist/safe-bash/command-chunks/chunk-FXELCPFX.js +195 -0
- package/dist/safe-bash/command-chunks/{chunk-JCNNOMBV.js → chunk-GI4CJED2.js} +3 -2
- package/dist/safe-bash/command-chunks/{chunk-CU5RLO62.js → chunk-GLOZX57Y.js} +92 -18
- package/dist/safe-bash/command-chunks/chunk-GMIHJYDG.js +331 -0
- package/dist/safe-bash/command-chunks/chunk-H622NS6Z.js +11 -0
- package/dist/safe-bash/command-chunks/{chunk-UI32HWGS.js → chunk-HMOZ6XVJ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-AVSPNLWV.js → chunk-I237SNW5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ZS3QPNUL.js → chunk-IR2BY7EL.js} +21 -6
- package/dist/safe-bash/command-chunks/chunk-IYPAQ7PH.js +42 -0
- package/dist/safe-bash/command-chunks/chunk-JN7WIP6S.js +94 -0
- package/dist/safe-bash/command-chunks/chunk-JNZ3CVAE.js +147 -0
- package/dist/safe-bash/command-chunks/{chunk-HLBX5IRS.js → chunk-JQ74HC37.js} +24 -32
- package/dist/safe-bash/command-chunks/chunk-KFVV7ZJO.js +216 -0
- package/dist/safe-bash/command-chunks/{chunk-G4PNVO6Z.js → chunk-KP7AO66M.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-KWESKQHR.js +25 -0
- package/dist/safe-bash/command-chunks/chunk-KYSPGS33.js +41 -0
- package/dist/safe-bash/command-chunks/{chunk-C7IHMJEW.js → chunk-KZC5UWFF.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-L6DVEBW3.js +553 -0
- package/dist/safe-bash/command-chunks/chunk-LC2MFKT4.js +2489 -0
- package/dist/safe-bash/command-chunks/chunk-LE5LZNHE.js +204 -0
- package/dist/safe-bash/command-chunks/chunk-MDH5T4OS.js +41 -0
- package/dist/safe-bash/command-chunks/chunk-MM6HU6CX.js +20 -0
- package/dist/safe-bash/command-chunks/{chunk-MYJAZ3U2.js → chunk-MPL2466A.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-VZHRZMS7.js → chunk-NAY27PXB.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-NCD7PEWH.js +298 -0
- package/dist/safe-bash/command-chunks/chunk-NFGI5IGF.js +266 -0
- package/dist/safe-bash/command-chunks/{chunk-KVFCSLKK.js → chunk-NXEQ3ESQ.js} +6 -0
- package/dist/safe-bash/command-chunks/{chunk-3VGGYEDH.js → chunk-ORYGZYKW.js} +4 -3
- package/dist/safe-bash/command-chunks/{chunk-OLQG7ZCN.js → chunk-PEF7K3UQ.js} +136 -75
- package/dist/safe-bash/command-chunks/chunk-PII4YEZW.js +123 -0
- package/dist/safe-bash/command-chunks/{chunk-43GSSUAY.js → chunk-PJJUYO3R.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-ZT4KSS2V.js → chunk-PTT3I223.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-Q3DII3Q7.js +174 -0
- package/dist/safe-bash/command-chunks/chunk-Q3EWDEUQ.js +185 -0
- package/dist/safe-bash/command-chunks/{chunk-2FUAW6GO.js → chunk-QI7LGHJJ.js} +58 -9
- package/dist/safe-bash/command-chunks/{chunk-6BETHLXZ.js → chunk-QJAFJP2G.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-QNIMV57G.js +63 -0
- package/dist/safe-bash/command-chunks/{chunk-VVI4Z73I.js → chunk-QP4R6GLA.js} +5 -1
- package/dist/safe-bash/command-chunks/{chunk-LPORMIZS.js → chunk-QWIDNAAK.js} +8 -8
- package/dist/safe-bash/command-chunks/chunk-RVLO4DYT.js +35 -0
- package/dist/safe-bash/command-chunks/{chunk-X2YQLGKS.js → chunk-SAMH7SQE.js} +4 -4
- package/dist/safe-bash/command-chunks/chunk-SEM36PG5.js +11 -0
- package/dist/safe-bash/command-chunks/chunk-STC3LEWJ.js +634 -0
- package/dist/safe-bash/command-chunks/chunk-SVULUDOP.js +331 -0
- package/dist/safe-bash/command-chunks/chunk-TEVJJPTC.js +1392 -0
- package/dist/safe-bash/command-chunks/{chunk-ZXKW7SJ2.js → chunk-TYCGMRLM.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-UG7SMZFF.js +178 -0
- package/dist/safe-bash/command-chunks/{chunk-YZ5SVZFD.js → chunk-UMDIOL3O.js} +3 -3
- package/dist/safe-bash/command-chunks/chunk-UXSR5BZH.js +136 -0
- package/dist/safe-bash/command-chunks/chunk-V6BEDRMQ.js +112 -0
- package/dist/safe-bash/command-chunks/chunk-V6MSPQLA.js +362 -0
- package/dist/safe-bash/command-chunks/{chunk-J4PEQWSF.js → chunk-VGG2DL5Q.js} +0 -1
- package/dist/safe-bash/command-chunks/{chunk-SG424QWS.js → chunk-VL67NWNS.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-WB5SVIG7.js +1034 -0
- package/dist/safe-bash/command-chunks/{src-UJOWAS2S.js → chunk-WD3ERGRY.js} +77 -277
- package/dist/safe-bash/command-chunks/{chunk-YFSDDFGV.js → chunk-WH627NJL.js} +446 -53
- package/dist/safe-bash/command-chunks/chunk-WNE7FPVR.js +236 -0
- package/dist/safe-bash/command-chunks/{chunk-UKS2XJZI.js → chunk-WPYIOKE3.js} +4 -4
- package/dist/safe-bash/command-chunks/chunk-XETLEHZP.js +1227 -0
- package/dist/safe-bash/command-chunks/chunk-XIIBTGC5.js +580 -0
- package/dist/safe-bash/command-chunks/chunk-XJXU3VVH.js +737 -0
- package/dist/safe-bash/command-chunks/chunk-Y5INTD6S.js +220 -0
- package/dist/safe-bash/command-chunks/{chunk-5ZSM4UFN.js → chunk-YGC6OS5O.js} +3 -56
- package/dist/safe-bash/command-chunks/chunk-YJDV76GL.js +262 -0
- package/dist/safe-bash/command-chunks/chunk-YOF7R4OY.js +80 -0
- package/dist/safe-bash/command-chunks/chunk-Z7RVSD5K.js +594 -0
- package/dist/safe-bash/command-chunks/chunk-ZHUWOUWB.js +618 -0
- package/dist/safe-bash/command-chunks/{model-store-L35QTZMJ.js → model-store-WPKMRPV4.js} +2 -2
- package/dist/safe-bash/command-chunks/pptx-7G52EJ6L-4JACH5FB.js +625 -0
- package/dist/safe-bash/command-chunks/python-worker-source-TYOFJMCW.js +4 -0
- package/dist/safe-bash/command-chunks/src-ICMQISAA.js +501 -0
- package/dist/safe-bash/commands/archive/create.d.ts +1 -17
- package/dist/safe-bash/commands/archive/create.js +1 -252
- package/dist/safe-bash/commands/archive/extract.d.ts +1 -11
- package/dist/safe-bash/commands/archive/extract.js +1 -640
- package/dist/safe-bash/commands/archive/format.d.ts +1 -32
- package/dist/safe-bash/commands/archive/format.js +1 -225
- package/dist/safe-bash/commands/archive/index.d.ts +5 -10
- package/dist/safe-bash/commands/archive/index.js +6 -931
- package/dist/safe-bash/commands/archive/listing.d.ts +1 -2
- package/dist/safe-bash/commands/archive/listing.js +1 -21
- package/dist/safe-bash/commands/archive/modes.d.ts +1 -5
- package/dist/safe-bash/commands/archive/modes.js +1 -182
- package/dist/safe-bash/commands/archive/options.d.ts +1 -53
- package/dist/safe-bash/commands/archive/options.js +1 -462
- package/dist/safe-bash/commands/archive/stream.d.ts +1 -22
- package/dist/safe-bash/commands/archive/stream.js +1 -188
- package/dist/safe-bash/commands/archive/transform.d.ts +1 -16
- package/dist/safe-bash/commands/archive/transform.js +1 -85
- package/dist/safe-bash/commands/archive/unzip/arguments.d.ts +1 -53
- package/dist/safe-bash/commands/archive/unzip/arguments.js +1 -322
- package/dist/safe-bash/commands/archive/unzip/safety.d.ts +1 -32
- package/dist/safe-bash/commands/archive/unzip/safety.js +1 -295
- package/dist/safe-bash/commands/archive/unzip.d.ts +1 -3
- package/dist/safe-bash/commands/archive/unzip.js +1 -398
- package/dist/safe-bash/commands/archive/zip/aes.d.ts +1 -17
- package/dist/safe-bash/commands/archive/zip/aes.js +1 -156
- package/dist/safe-bash/commands/archive/zip/comments.d.ts +1 -17
- package/dist/safe-bash/commands/archive/zip/comments.js +1 -83
- package/dist/safe-bash/commands/archive/zip/crc.d.ts +1 -1
- package/dist/safe-bash/commands/archive/zip/crc.js +1 -1
- package/dist/safe-bash/commands/archive/zip/crypto.d.ts +1 -19
- package/dist/safe-bash/commands/archive/zip/crypto.js +1 -118
- package/dist/safe-bash/commands/archive/zip/dates.d.ts +1 -4
- package/dist/safe-bash/commands/archive/zip/dates.js +1 -66
- package/dist/safe-bash/commands/archive/zip/environment.d.ts +1 -2
- package/dist/safe-bash/commands/archive/zip/environment.js +1 -62
- package/dist/safe-bash/commands/archive/zip/grow.d.ts +1 -3
- package/dist/safe-bash/commands/archive/zip/grow.js +1 -2
- package/dist/safe-bash/commands/archive/zip/help.d.ts +1 -4
- package/dist/safe-bash/commands/archive/zip/help.js +1 -182
- package/dist/safe-bash/commands/archive/zip/line-endings.d.ts +1 -2
- package/dist/safe-bash/commands/archive/zip/line-endings.js +1 -194
- package/dist/safe-bash/commands/archive/zip/log.d.ts +1 -22
- package/dist/safe-bash/commands/archive/zip/log.js +1 -159
- package/dist/safe-bash/commands/archive/zip/lzma.d.ts +1 -9
- package/dist/safe-bash/commands/archive/zip/lzma.js +1 -40
- package/dist/safe-bash/commands/archive/zip/move.d.ts +1 -11
- package/dist/safe-bash/commands/archive/zip/move.js +1 -59
- package/dist/safe-bash/commands/archive/zip/names.d.ts +1 -2
- package/dist/safe-bash/commands/archive/zip/names.js +1 -33
- package/dist/safe-bash/commands/archive/zip/options.d.ts +1 -13
- package/dist/safe-bash/commands/archive/zip/options.js +1 -124
- package/dist/safe-bash/commands/archive/zip/repair.d.ts +1 -10
- package/dist/safe-bash/commands/archive/zip/repair.js +1 -392
- package/dist/safe-bash/commands/archive/zip/safety.d.ts +1 -54
- package/dist/safe-bash/commands/archive/zip/safety.js +1 -360
- package/dist/safe-bash/commands/archive/zip/sfx.d.ts +1 -4
- package/dist/safe-bash/commands/archive/zip/sfx.js +1 -52
- package/dist/safe-bash/commands/archive/zip/test-command.d.ts +1 -5
- package/dist/safe-bash/commands/archive/zip/test-command.js +1 -101
- package/dist/safe-bash/commands/archive/zip/volumes.d.ts +1 -21
- package/dist/safe-bash/commands/archive/zip/volumes.js +1 -281
- package/dist/safe-bash/commands/archive/zip/zip64.d.ts +1 -30
- package/dist/safe-bash/commands/archive/zip/zip64.js +1 -227
- package/dist/safe-bash/commands/archive/zip-format.d.ts +1 -68
- package/dist/safe-bash/commands/archive/zip-format.js +1 -1075
- package/dist/safe-bash/commands/archive/zip.d.ts +1 -3
- package/dist/safe-bash/commands/archive/zip.js +1 -1523
- package/dist/safe-bash/commands/awk/index.d.ts +2 -0
- package/dist/safe-bash/commands/awk/index.js +2 -0
- package/dist/safe-bash/commands/bytes/compression/index.js +2 -1
- package/dist/safe-bash/commands/curl/index.d.ts +2 -0
- package/dist/safe-bash/commands/curl/index.js +2 -0
- package/dist/safe-bash/commands/diff/index.d.ts +2 -0
- package/dist/safe-bash/commands/diff/index.js +2 -0
- package/dist/safe-bash/commands/diff-patch/diff-format.d.ts +1 -10
- package/dist/safe-bash/commands/diff-patch/diff-format.js +1 -237
- package/dist/safe-bash/commands/diff-patch/diff-options.d.ts +1 -38
- package/dist/safe-bash/commands/diff-patch/diff-options.js +1 -261
- package/dist/safe-bash/commands/diff-patch/diff-output.d.ts +1 -20
- package/dist/safe-bash/commands/diff-patch/diff-output.js +1 -290
- package/dist/safe-bash/commands/diff-patch/diff.d.ts +1 -2
- package/dist/safe-bash/commands/diff-patch/diff.js +1 -656
- package/dist/safe-bash/commands/diff-patch/index.d.ts +4 -5
- package/dist/safe-bash/commands/diff-patch/index.js +8 -333
- package/dist/safe-bash/commands/diff-patch/patch-envelope.d.ts +1 -2
- package/dist/safe-bash/commands/diff-patch/patch-envelope.js +1 -63
- package/dist/safe-bash/commands/diff-patch/patch-formats.d.ts +1 -7
- package/dist/safe-bash/commands/diff-patch/patch-formats.js +1 -264
- package/dist/safe-bash/commands/diff-patch/patch-gnu-paths.d.ts +1 -41
- package/dist/safe-bash/commands/diff-patch/patch-gnu-paths.js +1 -263
- package/dist/safe-bash/commands/diff-patch/patch-gnu-reject.d.ts +1 -3
- package/dist/safe-bash/commands/diff-patch/patch-gnu-reject.js +1 -100
- package/dist/safe-bash/commands/diff-patch/patch-path.d.ts +1 -3
- package/dist/safe-bash/commands/diff-patch/patch-path.js +1 -91
- package/dist/safe-bash/commands/diff-patch/patch-publication.d.ts +1 -13
- package/dist/safe-bash/commands/diff-patch/patch-publication.js +1 -107
- package/dist/safe-bash/commands/diff-patch/patch.d.ts +1 -2
- package/dist/safe-bash/commands/diff-patch/patch.js +1 -653
- package/dist/safe-bash/commands/diff-patch/shared.d.ts +1 -53
- package/dist/safe-bash/commands/diff-patch/shared.js +1 -267
- package/dist/safe-bash/commands/diff-patch/unified.d.ts +1 -52
- package/dist/safe-bash/commands/diff-patch/unified.js +1 -385
- package/dist/safe-bash/commands/directory-admission.d.ts +1 -3
- package/dist/safe-bash/commands/directory-admission.js +1 -26
- package/dist/safe-bash/commands/find/index.d.ts +2 -0
- package/dist/safe-bash/commands/find/index.js +2 -0
- package/dist/safe-bash/commands/find-format.d.ts +1 -20
- package/dist/safe-bash/commands/find-format.js +1 -161
- package/dist/safe-bash/commands/find.d.ts +2 -18
- package/dist/safe-bash/commands/find.js +2 -1236
- package/dist/safe-bash/commands/gzip/index.d.ts +2 -0
- package/dist/safe-bash/commands/gzip/index.js +2 -0
- package/dist/safe-bash/commands/line-endings/index.browser.js +1 -1
- package/dist/safe-bash/commands/line-endings/index.d.ts +1 -1
- package/dist/safe-bash/commands/line-endings/index.js +1 -262
- package/dist/safe-bash/commands/llm/index.browser.js +3 -1
- package/dist/safe-bash/commands/mdq/index.browser.js +2 -2
- package/dist/safe-bash/commands/metadata/chmod.d.ts +1 -4
- package/dist/safe-bash/commands/metadata/chmod.js +2 -63
- package/dist/safe-bash/commands/network/aggregate.d.ts +1 -4
- package/dist/safe-bash/commands/network/aggregate.js +1 -23
- package/dist/safe-bash/commands/network/args.d.ts +1 -68
- package/dist/safe-bash/commands/network/args.js +1 -321
- package/dist/safe-bash/commands/network/authorizer.d.ts +1 -6
- package/dist/safe-bash/commands/network/authorizer.js +1 -33
- package/dist/safe-bash/commands/network/body.d.ts +1 -9
- package/dist/safe-bash/commands/network/body.js +1 -393
- package/dist/safe-bash/commands/network/curl.d.ts +3 -13
- package/dist/safe-bash/commands/network/curl.js +6 -693
- package/dist/safe-bash/commands/network/deadline.d.ts +1 -2
- package/dist/safe-bash/commands/network/deadline.js +1 -14
- package/dist/safe-bash/commands/network/decode.d.ts +1 -2
- package/dist/safe-bash/commands/network/decode.js +1 -79
- package/dist/safe-bash/commands/network/fetch-transport.d.ts +1 -7
- package/dist/safe-bash/commands/network/fetch-transport.js +1 -94
- package/dist/safe-bash/commands/network/form-content-type.d.ts +1 -5
- package/dist/safe-bash/commands/network/form-content-type.js +1 -63
- package/dist/safe-bash/commands/network/form-headers.d.ts +1 -2
- package/dist/safe-bash/commands/network/form-headers.js +1 -35
- package/dist/safe-bash/commands/network/glob.d.ts +1 -7
- package/dist/safe-bash/commands/network/glob.js +1 -134
- package/dist/safe-bash/commands/network/index.browser.js +2 -10
- package/dist/safe-bash/commands/network/input.d.ts +1 -5
- package/dist/safe-bash/commands/network/input.js +1 -276
- package/dist/safe-bash/commands/network/output.d.ts +1 -6
- package/dist/safe-bash/commands/network/output.js +1 -131
- package/dist/safe-bash/commands/network/private-address.d.ts +1 -1
- package/dist/safe-bash/commands/network/private-address.js +1 -44
- package/dist/safe-bash/commands/network/shared.d.ts +1 -14
- package/dist/safe-bash/commands/network/shared.js +1 -71
- package/dist/safe-bash/commands/network/types.d.ts +1 -37
- package/dist/safe-bash/commands/network/types.js +1 -31
- package/dist/safe-bash/commands/network/url.d.ts +1 -2
- package/dist/safe-bash/commands/network/url.js +1 -30
- package/dist/safe-bash/commands/network/wget.d.ts +3 -3
- package/dist/safe-bash/commands/network/wget.js +10 -331
- package/dist/safe-bash/commands/node/index.browser.js +4 -5
- package/dist/safe-bash/commands/node/index.d.ts +3 -3
- package/dist/safe-bash/commands/node/index.js +5 -0
- package/dist/safe-bash/commands/node/safejs.d.ts +3 -3
- package/dist/safe-bash/commands/node/safejs.js +6 -1
- package/dist/safe-bash/commands/node/types.d.ts +1 -1
- package/dist/safe-bash/commands/node/unconfigured.d.ts +3 -0
- package/dist/safe-bash/commands/node/unconfigured.js +10 -0
- package/dist/safe-bash/commands/op/index.browser.js +2 -2
- package/dist/safe-bash/commands/patch/index.d.ts +2 -0
- package/dist/safe-bash/commands/patch/index.js +2 -0
- package/dist/safe-bash/commands/pdfinfo/index.js +2 -1
- package/dist/safe-bash/commands/predicates.js +3 -4
- package/dist/safe-bash/commands/python/index.browser.js +5 -5
- package/dist/safe-bash/commands/python/llm-capability.d.ts +1 -0
- package/dist/safe-bash/commands/python/llm-capability.js +27 -7
- package/dist/safe-bash/commands/python/llm-module.js +11 -0
- package/dist/safe-bash/commands/python/manifest.d.ts +1 -0
- package/dist/safe-bash/commands/python/manifest.js +9 -5
- package/dist/safe-bash/commands/python/provisioning.js +1 -1
- package/dist/safe-bash/commands/regex-execution/matching.js +1 -2
- package/dist/safe-bash/commands/regex-execution/public.browser.js +5 -5
- package/dist/safe-bash/commands/search/index.d.ts +1 -1
- package/dist/safe-bash/commands/search/index.js +1 -347
- package/dist/safe-bash/commands/search/portable.d.ts +2 -2
- package/dist/safe-bash/commands/search/portable.js +3 -2
- package/dist/safe-bash/commands/sed/index.d.ts +2 -0
- package/dist/safe-bash/commands/sed/index.js +2 -0
- package/dist/safe-bash/commands/tar/index.d.ts +2 -0
- package/dist/safe-bash/commands/tar/index.js +2 -0
- package/dist/safe-bash/commands/text-programs/awk-inspection.d.ts +1 -19
- package/dist/safe-bash/commands/text-programs/awk-inspection.js +1 -50
- package/dist/safe-bash/commands/text-programs/awk-pipes.d.ts +2 -0
- package/dist/safe-bash/commands/text-programs/awk-pipes.js +2 -0
- package/dist/safe-bash/commands/text-programs/awk-pretty.d.ts +1 -3
- package/dist/safe-bash/commands/text-programs/awk-pretty.js +1 -197
- package/dist/safe-bash/commands/text-programs/awk-quote.d.ts +1 -2
- package/dist/safe-bash/commands/text-programs/awk-quote.js +1 -15
- package/dist/safe-bash/commands/text-programs/awk-reader.d.ts +1 -42
- package/dist/safe-bash/commands/text-programs/awk-reader.js +1 -449
- package/dist/safe-bash/commands/text-programs/awk-retention.d.ts +1 -13
- package/dist/safe-bash/commands/text-programs/awk-retention.js +1 -51
- package/dist/safe-bash/commands/text-programs/awk-runtime.d.ts +1 -150
- package/dist/safe-bash/commands/text-programs/awk-runtime.js +1 -2627
- package/dist/safe-bash/commands/text-programs/awk-syntax.d.ts +1 -142
- package/dist/safe-bash/commands/text-programs/awk-syntax.js +1 -509
- package/dist/safe-bash/commands/text-programs/awk-values.d.ts +1 -32
- package/dist/safe-bash/commands/text-programs/awk-values.js +1 -386
- package/dist/safe-bash/commands/text-programs/awk.d.ts +1 -3
- package/dist/safe-bash/commands/text-programs/awk.js +1 -361
- package/dist/safe-bash/commands/text-programs/inplace.d.ts +1 -16
- package/dist/safe-bash/commands/text-programs/inplace.js +1 -155
- package/dist/safe-bash/commands/text-programs/sed.d.ts +1 -3
- package/dist/safe-bash/commands/text-programs/sed.js +1 -1647
- package/dist/safe-bash/commands/unzip/index.d.ts +2 -0
- package/dist/safe-bash/commands/unzip/index.js +2 -0
- package/dist/safe-bash/commands/wget/index.d.ts +2 -0
- package/dist/safe-bash/commands/wget/index.js +2 -0
- package/dist/safe-bash/commands/yq/index.browser.js +7 -2
- package/dist/safe-bash/commands/yq/index.d.ts +1 -6
- package/dist/safe-bash/commands/yq/index.js +1 -36
- package/dist/safe-bash/commands/zip/index.d.ts +2 -0
- package/dist/safe-bash/commands/zip/index.js +2 -0
- package/dist/safe-bash/core.browser.js +1 -1
- package/dist/safe-bash/core.d.ts +8 -1
- package/dist/safe-bash/core.js +7 -1
- package/dist/safe-bash/fs/s3/index.d.ts +2 -2
- package/dist/safe-bash/fs/s3/index.js +1 -1
- package/dist/safe-bash/full-core.browser.js +254 -223
- package/dist/safe-bash/jobs.browser.js +2 -2
- package/dist/safe-bash/lazy-mmdc.d.ts +6 -0
- package/dist/safe-bash/lazy-mmdc.js +23 -0
- package/dist/safe-bash/opt-in/commands/yq/mike.js +6 -13
- package/dist/safe-bash/opt-in/commands/yq/native-work.d.ts +1 -0
- package/dist/safe-bash/opt-in/commands/yq/native-work.js +17 -0
- package/dist/safe-bash/optional-host.browser.js +8 -4
- package/dist/safe-bash/optional-host.d.ts +1 -1
- package/dist/safe-bash/optional-host.js +1 -1
- package/dist/safe-bash/playwright/ability-execution.js +3 -2
- package/dist/safe-bash/playwright/adapter.js +1 -1
- package/dist/safe-bash/playwright/controller.js +9 -8
- package/dist/safe-bash/playwright/modal-capabilities.js +2 -1
- package/dist/safe-bash/playwright/native-json-snapshot.js +4 -3
- package/dist/safe-bash/playwright/native-snapshot.js +5 -4
- package/dist/safe-bash/playwright/open-options.js +3 -3
- package/dist/safe-bash/playwright/resource-limit.d.ts +2 -0
- package/dist/safe-bash/playwright/resource-limit.js +4 -0
- package/dist/safe-bash/playwright/session-configuration.js +8 -3
- package/dist/safe-bash/playwright/snapshot.js +8 -7
- package/dist/safe-bash/playwright/standard-capabilities.js +5 -4
- package/dist/safe-bash/plugins/index.browser.js +14 -16
- package/dist/safe-bash/registry-entry.browser.js +14 -16
- package/dist/safe-bash/shell/arrays/bindings.d.ts +3 -5
- package/dist/safe-bash/shell/arrays/bindings.js +6 -2
- package/dist/safe-bash/shell/input.js +16 -14
- package/dist/safe-bash/shell/runtime.d.ts +3 -0
- package/dist/safe-bash/shell/runtime.js +316 -64
- package/dist/safe-bash/shell/types.d.ts +2 -0
- package/dist/safe-bash/shell/value-state.js +17 -2
- package/dist/safe-bash/shell/worker-limits.js +1 -0
- package/dist/safe-bash/shell-entry.browser.js +13 -15
- package/dist/safe-bash/trap.browser.d.ts +3 -0
- package/dist/safe-bash/trap.browser.js +14 -0
- package/dist/safe-bash/worker/host.js +1 -1
- package/dist/safe-bash-command-apply-patch/apply.js +2 -2
- package/dist/safe-bash-command-apply-patch/index.js +3 -3
- package/dist/safe-bash-command-awk/LICENSE +21 -0
- package/dist/safe-bash-command-awk/awk-inspection.d.ts +19 -0
- package/dist/safe-bash-command-awk/awk-inspection.js +9 -0
- package/dist/safe-bash-command-awk/awk-pipes.d.ts +19 -0
- package/dist/safe-bash-command-awk/awk-pipes.js +8 -0
- package/dist/safe-bash-command-awk/awk-pretty.d.ts +3 -0
- package/dist/safe-bash-command-awk/awk-pretty.js +8 -0
- package/dist/safe-bash-command-awk/awk-quote.d.ts +2 -0
- package/dist/safe-bash-command-awk/awk-quote.js +7 -0
- package/dist/safe-bash-command-awk/awk-reader.d.ts +42 -0
- package/dist/safe-bash-command-awk/awk-reader.js +9 -0
- package/dist/safe-bash-command-awk/awk-retention.d.ts +13 -0
- package/dist/safe-bash-command-awk/awk-retention.js +7 -0
- package/dist/safe-bash-command-awk/awk-runtime.d.ts +151 -0
- package/dist/safe-bash-command-awk/awk-runtime.js +11 -0
- package/dist/safe-bash-command-awk/awk-syntax.d.ts +144 -0
- package/dist/safe-bash-command-awk/awk-syntax.js +14 -0
- package/dist/safe-bash-command-awk/awk-values.d.ts +32 -0
- package/dist/safe-bash-command-awk/awk-values.js +35 -0
- package/dist/safe-bash-command-awk/awk.d.ts +3 -0
- package/dist/safe-bash-command-awk/awk.js +16 -0
- package/dist/safe-bash-command-awk/index.d.ts +7 -0
- package/dist/safe-bash-command-awk/index.js +36 -0
- package/dist/safe-bash-command-bc/index.d.ts +4 -0
- package/dist/safe-bash-command-bc/index.js +15 -176
- package/dist/safe-bash-command-column/column.js +3 -3
- package/dist/safe-bash-command-column/index.js +3 -3
- package/dist/safe-bash-command-column/layout.js +2 -2
- package/dist/safe-bash-command-csplit/command.js +2 -2
- package/dist/safe-bash-command-csplit/index.js +2 -2
- package/dist/safe-bash-command-csvkit/contracts.d.ts +1 -0
- package/dist/safe-bash-command-csvkit/csvpy-interpreter.d.ts +2 -1
- package/dist/safe-bash-command-csvkit/default-csvpy.d.ts +11 -0
- package/dist/safe-bash-command-csvkit/errors.js +22 -0
- package/dist/safe-bash-command-csvkit/index.d.ts +1 -0
- package/dist/safe-bash-command-csvkit/index.js +172 -4
- package/dist/safe-bash-command-csvkit/python-worker-browser.d.ts +3 -0
- package/dist/safe-bash-command-csvkit/python-worker-browser.js +16 -0
- package/dist/safe-bash-command-csvkit/python-worker-contract.d.ts +20 -0
- package/dist/safe-bash-command-csvkit/python-worker-node.d.ts +3 -0
- package/dist/safe-bash-command-csvkit/python-worker-node.js +9 -0
- package/dist/safe-bash-command-csvkit/runtime.d.ts +1 -0
- package/dist/safe-bash-command-curl/LICENSE +21 -0
- package/dist/safe-bash-command-curl/curl.d.ts +13 -0
- package/dist/safe-bash-command-curl/curl.js +9 -0
- package/dist/safe-bash-command-curl/index.d.ts +6 -0
- package/dist/safe-bash-command-curl/index.js +26 -0
- package/dist/safe-bash-command-diff/LICENSE +21 -0
- package/dist/safe-bash-command-diff/diff-format.d.ts +10 -0
- package/dist/safe-bash-command-diff/diff-format.js +10 -0
- package/dist/safe-bash-command-diff/diff-options.d.ts +38 -0
- package/dist/safe-bash-command-diff/diff-options.js +7 -0
- package/dist/safe-bash-command-diff/diff-output.d.ts +20 -0
- package/dist/safe-bash-command-diff/diff-output.js +19 -0
- package/dist/safe-bash-command-diff/diff.d.ts +2 -0
- package/dist/safe-bash-command-diff/diff.js +10 -0
- package/dist/safe-bash-command-diff/index.d.ts +8 -0
- package/dist/safe-bash-command-diff/index.js +34 -0
- package/dist/safe-bash-command-diff/sync.d.ts +2 -0
- package/dist/safe-bash-command-diff/sync.js +9 -0
- package/dist/safe-bash-command-diff3/index.js +5 -5
- package/dist/safe-bash-command-docx/index.d.ts +4 -4
- package/dist/safe-bash-command-docx/index.js +12 -5
- package/dist/safe-bash-command-dos2unix/index.d.ts +1 -0
- package/dist/safe-bash-command-dos2unix/index.js +225 -1
- package/dist/safe-bash-command-dos2unix/sync.d.ts +1 -0
- package/dist/safe-bash-command-exiftool/index.js +2 -2
- package/dist/safe-bash-command-factor/command.js +2 -2
- package/dist/safe-bash-command-factor/index.js +2 -2
- package/dist/safe-bash-command-ffmpeg/index.js +86 -94
- package/dist/safe-bash-command-file/index.js +3 -3
- package/dist/safe-bash-command-find/LICENSE +21 -0
- package/dist/safe-bash-command-find/find-format.d.ts +20 -0
- package/dist/safe-bash-command-find/find-format.js +9 -0
- package/dist/safe-bash-command-find/find.d.ts +18 -0
- package/dist/safe-bash-command-find/find.js +10 -0
- package/dist/safe-bash-command-find/index.d.ts +13 -0
- package/dist/safe-bash-command-find/index.js +45 -0
- package/dist/safe-bash-command-fmt/index.js +7 -4
- package/dist/safe-bash-command-git/git_rust.wasm +0 -0
- package/dist/safe-bash-command-git/index.js +5 -7
- package/dist/safe-bash-command-git/wasm.generated.js +1 -1
- package/dist/safe-bash-command-gzip/LICENSE +21 -0
- package/dist/safe-bash-command-gzip/index.d.ts +11 -0
- package/dist/safe-bash-command-gzip/index.js +94 -0
- package/dist/safe-bash-command-html-to-markdown/index.js +5 -5
- package/dist/safe-bash-command-htmlq/index.js +12 -8
- package/dist/safe-bash-command-imagemagick/index.js +22 -30
- package/dist/safe-bash-command-jq/index.js +1 -1
- package/dist/safe-bash-command-jq/jq.js +1 -1
- package/dist/safe-bash-command-llm/command.js +1 -1
- package/dist/safe-bash-command-llm/index.d.ts +1 -0
- package/dist/safe-bash-command-llm/index.js +16 -14
- package/dist/safe-bash-command-llm/openai.js +3 -3
- package/dist/safe-bash-command-llm/providers/index.js +3 -3
- package/dist/safe-bash-command-llm/providers/openai.js +3 -3
- package/dist/safe-bash-command-llm/stored-schema.d.ts +10 -0
- package/dist/safe-bash-command-mmdc/index.js +13 -604
- package/dist/safe-bash-command-mmdc/settings.d.ts +2 -0
- package/dist/safe-bash-command-mmdc/settings.js +7 -0
- package/dist/safe-bash-command-pandoc/command.js +4 -3
- package/dist/safe-bash-command-pandoc/defaults.d.ts +1 -0
- package/dist/safe-bash-command-pandoc/index.js +4 -3
- package/dist/safe-bash-command-pandoc/lua-filters.js +1 -1
- package/dist/safe-bash-command-pandoc/types.d.ts +3 -1
- package/dist/safe-bash-command-patch/LICENSE +21 -0
- package/dist/safe-bash-command-patch/index.d.ts +8 -0
- package/dist/safe-bash-command-patch/index.js +38 -0
- package/dist/safe-bash-command-patch/patch-envelope.d.ts +2 -0
- package/dist/safe-bash-command-patch/patch-envelope.js +7 -0
- package/dist/safe-bash-command-patch/patch-formats.d.ts +7 -0
- package/dist/safe-bash-command-patch/patch-formats.js +9 -0
- package/dist/safe-bash-command-patch/patch-gnu-paths.d.ts +41 -0
- package/dist/safe-bash-command-patch/patch-gnu-paths.js +26 -0
- package/dist/safe-bash-command-patch/patch-gnu-reject.d.ts +3 -0
- package/dist/safe-bash-command-patch/patch-gnu-reject.js +7 -0
- package/dist/safe-bash-command-patch/patch-path.d.ts +3 -0
- package/dist/safe-bash-command-patch/patch-path.js +11 -0
- package/dist/safe-bash-command-patch/patch-publication.d.ts +13 -0
- package/dist/safe-bash-command-patch/patch-publication.js +7 -0
- package/dist/safe-bash-command-patch/patch.d.ts +2 -0
- package/dist/safe-bash-command-patch/patch.js +14 -0
- package/dist/safe-bash-command-patch/sync.d.ts +2 -0
- package/dist/safe-bash-command-patch/sync.js +7 -0
- package/dist/safe-bash-command-patch/unified.d.ts +52 -0
- package/dist/safe-bash-command-patch/unified.js +16 -0
- package/dist/safe-bash-command-pdfimages/index.js +37 -16
- package/dist/safe-bash-command-pdfinfo/index.d.ts +0 -23
- package/dist/safe-bash-command-pdfinfo/index.js +20 -772
- package/dist/safe-bash-command-pdftk/index.js +37 -9
- package/dist/safe-bash-command-pdftoppm/index.js +50 -20
- package/dist/safe-bash-command-pdftotext/index.js +10 -2
- package/dist/safe-bash-command-pptx/index.d.ts +4 -4
- package/dist/safe-bash-command-pptx/index.js +11 -5
- package/dist/safe-bash-command-pr/command.js +2 -2
- package/dist/safe-bash-command-pr/index.js +4 -4
- package/dist/safe-bash-command-qpdf/index.js +26 -13
- package/dist/safe-bash-command-rg/index.d.ts +1 -0
- package/dist/safe-bash-command-rg/index.js +222 -1
- package/dist/safe-bash-command-rg/rg-command.js +1 -1
- package/dist/safe-bash-command-rg/sync.d.ts +1 -0
- package/dist/safe-bash-command-sed/LICENSE +21 -0
- package/dist/safe-bash-command-sed/index.d.ts +7 -0
- package/dist/safe-bash-command-sed/index.js +28 -0
- package/dist/safe-bash-command-sed/inplace.d.ts +16 -0
- package/dist/safe-bash-command-sed/inplace.js +9 -0
- package/dist/safe-bash-command-sed/sed.d.ts +3 -0
- package/dist/safe-bash-command-sed/sed.js +8 -0
- package/dist/safe-bash-command-sips/index.js +111 -35
- package/dist/safe-bash-command-soffice/index.js +4 -4
- package/dist/safe-bash-command-sqlite3/engine.d.ts +1 -2
- package/dist/safe-bash-command-sqlite3/index.js +152 -452
- package/dist/safe-bash-command-ssconvert/commands.js +1 -1
- package/dist/safe-bash-command-ssconvert/formats/ods.js +2 -2
- package/dist/safe-bash-command-ssconvert/formats/xlsx.js +3 -3
- package/dist/safe-bash-command-ssconvert/index.js +5 -5
- package/dist/safe-bash-command-tar/LICENSE +21 -0
- package/dist/safe-bash-command-tar/create.d.ts +17 -0
- package/dist/safe-bash-command-tar/create.js +14 -0
- package/dist/safe-bash-command-tar/extract.d.ts +11 -0
- package/dist/safe-bash-command-tar/extract.js +14 -0
- package/dist/safe-bash-command-tar/format.d.ts +32 -0
- package/dist/safe-bash-command-tar/format.js +19 -0
- package/dist/safe-bash-command-tar/index.d.ts +8 -0
- package/dist/safe-bash-command-tar/index.js +550 -0
- package/dist/safe-bash-command-tar/listing.d.ts +2 -0
- package/dist/safe-bash-command-tar/listing.js +7 -0
- package/dist/safe-bash-command-tar/modes.d.ts +5 -0
- package/dist/safe-bash-command-tar/modes.js +16 -0
- package/dist/safe-bash-command-tar/options.d.ts +53 -0
- package/dist/safe-bash-command-tar/options.js +10 -0
- package/dist/safe-bash-command-tar/stream.d.ts +22 -0
- package/dist/safe-bash-command-tar/stream.js +15 -0
- package/dist/safe-bash-command-tar/transform.d.ts +16 -0
- package/dist/safe-bash-command-tar/transform.js +9 -0
- package/dist/safe-bash-command-unzip/LICENSE +21 -0
- package/dist/safe-bash-command-unzip/index.d.ts +7 -0
- package/dist/safe-bash-command-unzip/index.js +39 -0
- package/dist/safe-bash-command-unzip/sync.d.ts +3 -0
- package/dist/safe-bash-command-unzip/sync.js +9 -0
- package/dist/safe-bash-command-unzip/unzip/safety.d.ts +32 -0
- package/dist/safe-bash-command-unzip/unzip/safety.js +7 -0
- package/dist/safe-bash-command-unzip/unzip.d.ts +3 -0
- package/dist/safe-bash-command-unzip/unzip.js +8 -0
- package/dist/safe-bash-command-wget/LICENSE +21 -0
- package/dist/safe-bash-command-wget/index.d.ts +6 -0
- package/dist/safe-bash-command-wget/index.js +26 -0
- package/dist/safe-bash-command-wget/wget.d.ts +3 -0
- package/dist/safe-bash-command-wget/wget.js +7 -0
- package/dist/safe-bash-command-xan/argv.d.ts +4 -1
- package/dist/safe-bash-command-xan/argv.js +1 -1
- package/dist/safe-bash-command-xan/commands.js +4 -3
- package/dist/safe-bash-command-xan/index.js +15 -14
- package/dist/safe-bash-command-xan/io.js +2 -2
- package/dist/safe-bash-command-xmllint/index.js +189 -49
- package/dist/safe-bash-command-xz/index.js +3 -2
- package/dist/safe-bash-command-xz/options.d.ts +9 -1
- package/dist/safe-bash-command-xz/options.js +3 -1
- package/dist/safe-bash-command-yq/index.d.ts +4 -11
- package/dist/safe-bash-command-yq/index.js +3367 -670
- package/dist/safe-bash-command-yq/mike.js +6 -13
- package/dist/safe-bash-command-yq/native-work.d.ts +1 -0
- package/dist/safe-bash-command-yq/native-work.js +17 -0
- package/dist/safe-bash-command-yq/query.d.ts +11 -0
- package/dist/safe-bash-command-yq/query.js +735 -0
- package/dist/safe-bash-command-zip/LICENSE +21 -0
- package/dist/safe-bash-command-zip/index.d.ts +7 -0
- package/dist/safe-bash-command-zip/index.js +38 -0
- package/dist/safe-bash-command-zip/sync.d.ts +3 -0
- package/dist/safe-bash-command-zip/sync.js +9 -0
- package/dist/safe-bash-command-zip/zip.d.ts +3 -0
- package/dist/safe-bash-command-zip/zip.js +7 -0
- package/dist/safe-bash-compression-engine/files.js +4 -4
- package/dist/safe-bash-compression-engine/index.js +2 -2
- package/dist/safe-bash-compression-engine/operand.js +6 -6
- package/dist/safe-bash-compression-engine/stream.js +2 -2
- package/dist/safe-bash-compression-engine/zstd-decode.js +1 -1
- package/dist/safe-bash-contracts/command.js +1 -1
- package/dist/safe-bash-contracts/diagnostics.js +4 -4
- package/dist/safe-bash-contracts/escaping.js +11 -11
- package/dist/safe-bash-contracts/filesystem-descriptor.js +1 -1
- package/dist/safe-bash-contracts/filesystem-output.js +8 -8
- package/dist/safe-bash-contracts/index.js +34 -34
- package/dist/safe-bash-contracts/io.js +2 -2
- package/dist/safe-bash-contracts/output.js +3 -3
- package/dist/safe-bash-diff-engine/LICENSE +21 -0
- package/dist/safe-bash-diff-engine/index.d.ts +1 -0
- package/dist/safe-bash-diff-engine/index.js +24 -0
- package/dist/safe-bash-diff-engine/shared.d.ts +53 -0
- package/dist/safe-bash-diff-engine/shared.js +19 -0
- package/dist/safe-bash-io-engine/commands/directory-admission.d.ts +3 -0
- package/dist/safe-bash-io-engine/commands/directory-admission.js +34 -0
- package/dist/safe-bash-io-engine/commands/mode-change.d.ts +4 -0
- package/dist/safe-bash-io-engine/commands/mode-change.js +60 -0
- package/dist/safe-bash-io-engine/commands/text-programs/shared.js +20 -31
- package/dist/safe-bash-io-engine/shell/pattern.js +7 -12
- package/dist/safe-bash-markdown-engine/commonmark-blocks.js +4 -4
- package/dist/safe-bash-markdown-engine/commonmark-inlines.js +4 -4
- package/dist/safe-bash-markdown-engine/commonmark-syntax.js +2 -2
- package/dist/safe-bash-markdown-engine/gfm-syntax.js +3 -3
- package/dist/safe-bash-markdown-engine/index.js +7 -7
- package/dist/safe-bash-mcp/index.browser.d.ts +6 -0
- package/dist/safe-bash-mcp/index.browser.js +1 -0
- package/dist/safe-bash-mcp/index.d.ts +12 -0
- package/dist/safe-bash-mcp/index.js +1558 -36
- package/dist/safe-bash-network-engine/LICENSE +21 -0
- package/dist/safe-bash-network-engine/aggregate.d.ts +4 -0
- package/dist/safe-bash-network-engine/aggregate.js +37 -0
- package/dist/safe-bash-network-engine/args.d.ts +68 -0
- package/dist/safe-bash-network-engine/args.js +19 -0
- package/dist/safe-bash-network-engine/authorizer.d.ts +6 -0
- package/dist/safe-bash-network-engine/authorizer.js +8 -0
- package/dist/safe-bash-network-engine/body.d.ts +9 -0
- package/dist/safe-bash-network-engine/body.js +374 -0
- package/dist/safe-bash-network-engine/deadline.d.ts +2 -0
- package/dist/safe-bash-network-engine/deadline.js +7 -0
- package/dist/safe-bash-network-engine/decode.d.ts +2 -0
- package/dist/safe-bash-network-engine/decode.js +81 -0
- package/dist/safe-bash-network-engine/fetch-transport.d.ts +7 -0
- package/dist/safe-bash-network-engine/fetch-transport.js +9 -0
- package/dist/safe-bash-network-engine/form-content-type.d.ts +5 -0
- package/dist/safe-bash-network-engine/form-content-type.js +8 -0
- package/dist/safe-bash-network-engine/form-headers.d.ts +2 -0
- package/dist/safe-bash-network-engine/form-headers.js +10 -0
- package/dist/safe-bash-network-engine/glob.d.ts +7 -0
- package/dist/safe-bash-network-engine/glob.js +124 -0
- package/dist/safe-bash-network-engine/index.d.ts +3 -0
- package/dist/safe-bash-network-engine/index.js +26 -0
- package/dist/safe-bash-network-engine/input.d.ts +5 -0
- package/dist/safe-bash-network-engine/input.js +255 -0
- package/dist/safe-bash-network-engine/output.d.ts +6 -0
- package/dist/safe-bash-network-engine/output.js +132 -0
- package/dist/safe-bash-network-engine/platform-portable.d.ts +5 -0
- package/dist/safe-bash-network-engine/platform-portable.js +19 -0
- package/dist/safe-bash-network-engine/private-address.d.ts +1 -0
- package/dist/safe-bash-network-engine/private-address.js +7 -0
- package/dist/safe-bash-network-engine/shared.d.ts +14 -0
- package/dist/safe-bash-network-engine/shared.js +23 -0
- package/dist/safe-bash-network-engine/types.d.ts +37 -0
- package/dist/safe-bash-network-engine/types.js +11 -0
- package/dist/safe-bash-network-engine/url.d.ts +2 -0
- package/dist/safe-bash-network-engine/url.js +8 -0
- package/dist/safe-bash-query-engine/capture.d.ts +1 -0
- package/dist/safe-bash-query-engine/capture.js +9 -7
- package/dist/safe-bash-query-engine/dates.d.ts +5 -1
- package/dist/safe-bash-query-engine/dates.js +10 -2
- package/dist/safe-bash-query-engine/delpaths.js +5 -5
- package/dist/safe-bash-query-engine/formats.js +3 -3
- package/dist/safe-bash-query-engine/index.js +15 -15
- package/dist/safe-bash-query-engine/indices.js +5 -5
- package/dist/safe-bash-query-engine/input.d.ts +1 -2
- package/dist/safe-bash-query-engine/input.js +2 -4
- package/dist/safe-bash-query-engine/interpreter.d.ts +5 -0
- package/dist/safe-bash-query-engine/interpreter.js +13 -13
- package/dist/safe-bash-query-engine/limits.js +1 -1
- package/dist/safe-bash-query-engine/parser.d.ts +8 -1
- package/dist/safe-bash-query-engine/parser.js +2 -2
- package/dist/safe-bash-query-engine/query-core.js +15 -15
- package/dist/safe-bash-query-engine/recurse.js +2 -2
- package/dist/safe-bash-query-engine/regex.d.ts +4 -2
- package/dist/safe-bash-query-engine/regex.js +10 -5
- package/dist/safe-bash-query-engine/split.js +2 -2
- package/dist/safe-bash-query-engine/splits.d.ts +1 -1
- package/dist/safe-bash-query-engine/splits.js +7 -6
- package/dist/safe-bash-query-engine/values.js +4 -4
- package/dist/safe-bash-regex-engine/ere/matcher.js +4 -4
- package/dist/safe-bash-regex-engine/index.js +2 -2
- package/dist/safe-bash-regex-engine/text/regex.d.ts +1 -0
- package/dist/safe-bash-regex-engine/text/regex.js +2 -2
- package/dist/safe-bash-search-engine/ergonomic-regex.d.ts +12 -2
- package/dist/safe-bash-search-engine/ergonomic-regex.js +2 -2
- package/dist/safe-bash-search-engine/glob.js +2 -2
- package/dist/safe-bash-search-engine/grep.js +2 -2
- package/dist/safe-bash-search-engine/matcher.d.ts +6 -2
- package/dist/safe-bash-search-engine/matcher.js +30 -8
- package/dist/safe-bash-search-engine/options.js +1 -1
- package/dist/safe-bash-search-engine/output.d.ts +3 -2
- package/dist/safe-bash-search-engine/output.js +111 -30
- package/dist/safe-bash-search-engine/shared.d.ts +2 -0
- package/dist/safe-bash-search-engine/shared.js +2 -2
- package/dist/safe-bash-search-engine/walk.js +11 -10
- package/dist/safe-bash-xml-engine/document.d.ts +1 -1
- package/dist/safe-bash-xml-engine/document.js +3 -3
- package/dist/safe-bash-xml-engine/evaluate.d.ts +1 -0
- package/dist/safe-bash-xml-engine/evaluate.js +4 -1
- package/dist/safe-bash-xml-engine/index.js +8 -6
- package/dist/safe-bash-xml-engine/io.js +1 -1
- package/dist/safe-bash-xml-engine/limits.d.ts +2 -0
- package/dist/safe-bash-xml-engine/limits.js +1 -1
- package/dist/safe-bash-xml-engine/predicate.d.ts +57 -0
- package/dist/safe-bash-xml-engine/query.d.ts +3 -15
- package/dist/safe-bash-xml-engine/query.js +3 -2
- package/dist/safe-bash-zip-engine/LICENSE +21 -0
- package/dist/safe-bash-zip-engine/index.d.ts +1 -0
- package/dist/safe-bash-zip-engine/index.js +32 -0
- package/dist/safe-bash-zip-engine/unzip/arguments.d.ts +53 -0
- package/dist/safe-bash-zip-engine/unzip/arguments.js +270 -0
- package/dist/safe-bash-zip-engine/zip/aes.d.ts +17 -0
- package/dist/safe-bash-zip-engine/zip/aes.js +15 -0
- package/dist/safe-bash-zip-engine/zip/comments.d.ts +17 -0
- package/dist/safe-bash-zip-engine/zip/comments.js +77 -0
- package/dist/safe-bash-zip-engine/zip/crc.d.ts +1 -0
- package/dist/safe-bash-zip-engine/zip/crc.js +7 -0
- package/dist/safe-bash-zip-engine/zip/crypto.d.ts +19 -0
- package/dist/safe-bash-zip-engine/zip/crypto.js +16 -0
- package/dist/safe-bash-zip-engine/zip/dates.d.ts +4 -0
- package/dist/safe-bash-zip-engine/zip/dates.js +68 -0
- package/dist/safe-bash-zip-engine/zip/environment.d.ts +2 -0
- package/dist/safe-bash-zip-engine/zip/environment.js +60 -0
- package/dist/safe-bash-zip-engine/zip/grow.d.ts +3 -0
- package/dist/safe-bash-zip-engine/zip/grow.js +7 -0
- package/dist/safe-bash-zip-engine/zip/help.d.ts +4 -0
- package/dist/safe-bash-zip-engine/zip/help.js +194 -0
- package/dist/safe-bash-zip-engine/zip/line-endings.d.ts +2 -0
- package/dist/safe-bash-zip-engine/zip/line-endings.js +165 -0
- package/dist/safe-bash-zip-engine/zip/log.d.ts +22 -0
- package/dist/safe-bash-zip-engine/zip/log.js +153 -0
- package/dist/safe-bash-zip-engine/zip/lzma.d.ts +9 -0
- package/dist/safe-bash-zip-engine/zip/lzma.js +7 -0
- package/dist/safe-bash-zip-engine/zip/move.d.ts +11 -0
- package/dist/safe-bash-zip-engine/zip/move.js +57 -0
- package/dist/safe-bash-zip-engine/zip/names.d.ts +2 -0
- package/dist/safe-bash-zip-engine/zip/names.js +37 -0
- package/dist/safe-bash-zip-engine/zip/options.d.ts +13 -0
- package/dist/safe-bash-zip-engine/zip/options.js +23 -0
- package/dist/safe-bash-zip-engine/zip/repair.d.ts +10 -0
- package/dist/safe-bash-zip-engine/zip/repair.js +348 -0
- package/dist/safe-bash-zip-engine/zip/safety.d.ts +54 -0
- package/dist/safe-bash-zip-engine/zip/safety.js +19 -0
- package/dist/safe-bash-zip-engine/zip/sfx.d.ts +4 -0
- package/dist/safe-bash-zip-engine/zip/sfx.js +58 -0
- package/dist/safe-bash-zip-engine/zip/test-command.d.ts +5 -0
- package/dist/safe-bash-zip-engine/zip/test-command.js +98 -0
- package/dist/safe-bash-zip-engine/zip/volumes.d.ts +21 -0
- package/dist/safe-bash-zip-engine/zip/volumes.js +255 -0
- package/dist/safe-bash-zip-engine/zip/zip64.d.ts +30 -0
- package/dist/safe-bash-zip-engine/zip/zip64.js +25 -0
- package/dist/safe-bash-zip-engine/zip-format.d.ts +68 -0
- package/dist/safe-bash-zip-engine/zip-format.js +27 -0
- package/dist/safe-playwright-cloudflare/browser-codegen.generated.d.ts +7 -7
- package/dist/safe-playwright-cloudflare/browser-codegen.generated.js +866 -8069
- package/dist/safe-playwright-cloudflare/browser-run-code-budget.d.ts +0 -1
- package/dist/safe-playwright-cloudflare/browser-run-code-budget.js +0 -2
- package/dist/safe-playwright-cloudflare/browser-trace-archive.d.ts +5 -1
- package/dist/safe-playwright-cloudflare/browser-trace-archive.js +2 -1
- package/dist/safe-playwright-cloudflare/browser-trace-budget.js +2 -2
- package/dist/safe-playwright-cloudflare/shell-browser-resource.d.ts +2 -0
- package/dist/safe-playwright-cloudflare/shell-browser-resource.js +3 -11
- package/dist/safe-playwright-cloudflare/shell-playwright.d.ts +2 -0
- package/dist/safe-playwright-cloudflare/shell-playwright.js +1 -1
- package/dist/spreadsheet-engine/io/publication.d.ts +1 -0
- package/package.json +163 -14
- package/dist/safe-bash/chunks/chunk-AZAJJVFX.js +0 -23017
- package/dist/safe-bash/chunks/chunk-O4ZUCRGN.js +0 -13
- package/dist/safe-bash/chunks/chunk-S264DZO2.js +0 -243
- package/dist/safe-bash/chunks/chunk-WVG5SHHQ.js +0 -12
- package/dist/safe-bash/chunks/chunk-ZW6K2J7P.js +0 -2652
- package/dist/safe-bash/command-chunks/chunk-5MPOQ6V3.js +0 -181
- package/dist/safe-bash/command-chunks/chunk-BIXLZ3OG.js +0 -14342
- package/dist/safe-bash/command-chunks/chunk-DUYJE2HY.js +0 -14
- package/dist/safe-bash/command-chunks/chunk-NETECMOF.js +0 -40
- package/dist/safe-bash/command-chunks/chunk-XS3PGJU2.js +0 -343
- package/dist/safe-bash/command-chunks/chunk-XTZALMLR.js +0 -488
- package/dist/safe-bash/commands/archive/zip/aes-primitives-unavailable.d.ts +0 -2
- package/dist/safe-bash/commands/archive/zip/aes-primitives-unavailable.js +0 -3
- package/dist/safe-bash/commands/archive/zip/aes-primitives.d.ts +0 -2
- package/dist/safe-bash/commands/archive/zip/aes-primitives.js +0 -3
- package/dist/safe-bash/commands/xml/document.d.ts +0 -2
- package/dist/safe-bash/commands/xml/document.js +0 -2
- package/dist/safe-bash/commands/xml/evaluate.d.ts +0 -2
- package/dist/safe-bash/commands/xml/evaluate.js +0 -2
- package/dist/safe-bash/commands/xml/json.d.ts +0 -2
- package/dist/safe-bash/commands/xml/json.js +0 -2
- package/dist/safe-bash/commands/xml/limits.d.ts +0 -2
- package/dist/safe-bash/commands/xml/limits.js +0 -2
- package/dist/safe-bash/commands/xml/query.d.ts +0 -2
- package/dist/safe-bash/commands/xml/query.js +0 -2
- package/dist/safe-bash/chunks/{chunk-NHOXKQNE.js → chunk-QVSRRNZT.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FIUFIDAO.js → chunk-2JRBIDAD.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-B5BKA5WH.js → chunk-B5TAOCKD.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-TYVCKQDH.js → chunk-J5SN3PZ3.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-2ENZ6JGA.js → chunk-KEV7C3KH.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-S62HELHU.js → chunk-PL6O4K6W.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-2WRTLCGK.js → chunk-QZF3SINC.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-X7TM3AKW.js → chunk-U6G67N23.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-DDLQ5YDB.js → chunk-YHFXOX6U.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-DQMOM72Z.js → chunk-ZRRBXU3M.js} +4 -4
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
imageLength
|
|
3
|
+
} from "./chunk-BAXU7B5Z.js";
|
|
1
4
|
import {
|
|
2
5
|
PdfError,
|
|
3
6
|
defaultPdfLimits,
|
|
@@ -6,7 +9,7 @@ import {
|
|
|
6
9
|
} from "./chunk-QRRYN2KO.js";
|
|
7
10
|
import {
|
|
8
11
|
createZipCodec
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5LU4UCBR.js";
|
|
10
13
|
import {
|
|
11
14
|
createCompressionCodec
|
|
12
15
|
} from "./chunk-RDV7UCYZ.js";
|
|
@@ -15,7 +18,7 @@ import {
|
|
|
15
18
|
} from "./chunk-YG4EPFWC.js";
|
|
16
19
|
import {
|
|
17
20
|
createLuaFilterCapability
|
|
18
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-3E2OIS2J.js";
|
|
19
22
|
import {
|
|
20
23
|
createCiteprocFilterCapability,
|
|
21
24
|
defaultTreeAdapter,
|
|
@@ -41,7 +44,7 @@ import {
|
|
|
41
44
|
init_buffer
|
|
42
45
|
} from "./chunk-HX3SHTCE.js";
|
|
43
46
|
|
|
44
|
-
// packages/safe-bash-command-pandoc/dist/chunks/chunk-
|
|
47
|
+
// packages/safe-bash-command-pandoc/dist/chunks/chunk-RTVXHUO5.js
|
|
45
48
|
init_buffer();
|
|
46
49
|
import * as gfm_syntax_star from "../../safe-bash-markdown-engine/gfm-syntax.js";
|
|
47
50
|
import * as commonmark_blocks_star from "../../safe-bash-markdown-engine/commonmark-blocks.js";
|
|
@@ -337,7 +340,7 @@ var require_saxes = __commonJS({
|
|
|
337
340
|
end: "endHandler",
|
|
338
341
|
ready: "readyHandler"
|
|
339
342
|
};
|
|
340
|
-
var
|
|
343
|
+
var SaxesParser3 = class {
|
|
341
344
|
/**
|
|
342
345
|
* @param opt The parser options.
|
|
343
346
|
*/
|
|
@@ -1700,9 +1703,9 @@ var require_saxes = __commonJS({
|
|
|
1700
1703
|
pushAttribNS(name, value) {
|
|
1701
1704
|
var _a;
|
|
1702
1705
|
const { prefix, local } = this.qname(name);
|
|
1703
|
-
const
|
|
1704
|
-
this.attribList.push(
|
|
1705
|
-
(_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this,
|
|
1706
|
+
const attr5 = { name, prefix, local, value };
|
|
1707
|
+
this.attribList.push(attr5);
|
|
1708
|
+
(_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this, attr5);
|
|
1706
1709
|
if (prefix === "xmlns") {
|
|
1707
1710
|
const trimmed = value.trim();
|
|
1708
1711
|
if (this.currentXMLVersion === "1.0" && trimmed === "") {
|
|
@@ -1718,9 +1721,9 @@ var require_saxes = __commonJS({
|
|
|
1718
1721
|
}
|
|
1719
1722
|
pushAttribPlain(name, value) {
|
|
1720
1723
|
var _a;
|
|
1721
|
-
const
|
|
1722
|
-
this.attribList.push(
|
|
1723
|
-
(_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this,
|
|
1724
|
+
const attr5 = { name, value };
|
|
1725
|
+
this.attribList.push(attr5);
|
|
1726
|
+
(_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this, attr5);
|
|
1724
1727
|
}
|
|
1725
1728
|
/**
|
|
1726
1729
|
* End parsing. This performs final well-formedness checks and resets the
|
|
@@ -1820,8 +1823,8 @@ var require_saxes = __commonJS({
|
|
|
1820
1823
|
}
|
|
1821
1824
|
const { attributes } = tag;
|
|
1822
1825
|
const seen = /* @__PURE__ */ new Set();
|
|
1823
|
-
for (const
|
|
1824
|
-
const { name, prefix, local } =
|
|
1826
|
+
for (const attr5 of attribList) {
|
|
1827
|
+
const { name, prefix, local } = attr5;
|
|
1825
1828
|
let uri2;
|
|
1826
1829
|
let eqname;
|
|
1827
1830
|
if (prefix === "") {
|
|
@@ -1839,8 +1842,8 @@ var require_saxes = __commonJS({
|
|
|
1839
1842
|
this.fail(`duplicate attribute: ${eqname}.`);
|
|
1840
1843
|
}
|
|
1841
1844
|
seen.add(eqname);
|
|
1842
|
-
|
|
1843
|
-
attributes[name] =
|
|
1845
|
+
attr5.uri = uri2;
|
|
1846
|
+
attributes[name] = attr5;
|
|
1844
1847
|
}
|
|
1845
1848
|
this.attribList = [];
|
|
1846
1849
|
}
|
|
@@ -1952,7 +1955,7 @@ var require_saxes = __commonJS({
|
|
|
1952
1955
|
return String.fromCodePoint(num);
|
|
1953
1956
|
}
|
|
1954
1957
|
};
|
|
1955
|
-
exports.SaxesParser =
|
|
1958
|
+
exports.SaxesParser = SaxesParser3;
|
|
1956
1959
|
}
|
|
1957
1960
|
});
|
|
1958
1961
|
function* placeRows(rows, columns, path, rowHeads = 0) {
|
|
@@ -2464,8 +2467,8 @@ var Projection = class _Projection {
|
|
|
2464
2467
|
this.add(html ? { "&": "&", "<": "<", ">": ">", '"': """ }[ch] ?? ch : "\\`*_{}[]<>|!#".includes(ch) ? `\\${ch}` : ch === "\n" || ch === "\r" || ch === " " ? " " : ch);
|
|
2465
2468
|
}
|
|
2466
2469
|
}
|
|
2467
|
-
attrs(
|
|
2468
|
-
const pairs2 = [...
|
|
2470
|
+
attrs(attr5) {
|
|
2471
|
+
const pairs2 = [...attr5[0] ? [["id", attr5[0]]] : [], ...attr5[1].length ? [["class", attr5[1].join(" ")]] : [], ...attr5[2]];
|
|
2469
2472
|
for (const [key, value] of pairs2) {
|
|
2470
2473
|
if (!key || key.toLowerCase().startsWith("on") || [...key].some((ch) => !(ch >= "a" && ch <= "z") && !(ch >= "A" && ch <= "Z") && !(ch >= "0" && ch <= "9") && ch !== "-" && ch !== "_"))
|
|
2471
2474
|
throw new PandocError("E_CAPABILITY", this.context.operation ?? "write", "Unsupported HTML attribute", this.format);
|
|
@@ -2474,8 +2477,8 @@ var Projection = class _Projection {
|
|
|
2474
2477
|
this.add('"');
|
|
2475
2478
|
}
|
|
2476
2479
|
}
|
|
2477
|
-
attributeLoss(
|
|
2478
|
-
if (
|
|
2480
|
+
attributeLoss(attr5, path) {
|
|
2481
|
+
if (attr5[0] || attr5[1].length || attr5[2].length) this.loss(path, "Flattened table attributes");
|
|
2479
2482
|
}
|
|
2480
2483
|
textProjection(render, html) {
|
|
2481
2484
|
const text = new _Projection(this.context, this.format, this.cellWriter);
|
|
@@ -2874,8 +2877,8 @@ var Markdown = class {
|
|
|
2874
2877
|
if (!this.context.lossy) throw new PandocError("E_UNSUPPORTED_FEATURE", this.context.operation ?? "write", `Markdown cannot represent ${feature}`, this.selection.descriptor.name, path);
|
|
2875
2878
|
this.context.report({ code: "W_RAW_CONTENT", operation: this.context.operation ?? "write", format: this.selection.descriptor.name, location: path, message: `Projected ${feature}` });
|
|
2876
2879
|
}
|
|
2877
|
-
attrs(
|
|
2878
|
-
if (
|
|
2880
|
+
attrs(attr5, path) {
|
|
2881
|
+
if (attr5[0] || attr5[1].length || attr5[2].length) this.loss(path, "attributes");
|
|
2879
2882
|
}
|
|
2880
2883
|
escape(text, target = false) {
|
|
2881
2884
|
this.reserve(text.length * 6);
|
|
@@ -2983,15 +2986,15 @@ var Markdown = class {
|
|
|
2983
2986
|
break;
|
|
2984
2987
|
}
|
|
2985
2988
|
case "Span": {
|
|
2986
|
-
const
|
|
2987
|
-
if (task && i === 0 &&
|
|
2989
|
+
const attr5 = node.c[0];
|
|
2990
|
+
if (task && i === 0 && attr5[0] === "" && attr5[1].length === 1 && attr5[1][0] === "task-list-marker" && attr5[2].length === 1 && attr5[2][0]?.[0] === "checked" && ["true", "false"].includes(attr5[2][0][1]) && node.c[1].length === 0) {
|
|
2988
2991
|
if (!this.selection.extensions.task_lists) {
|
|
2989
2992
|
this.loss(p, "task state");
|
|
2990
2993
|
break;
|
|
2991
2994
|
}
|
|
2992
|
-
parts.push(
|
|
2995
|
+
parts.push(attr5[2][0][1] === "true" ? "[x] " : "[ ] ");
|
|
2993
2996
|
} else {
|
|
2994
|
-
this.attrs(
|
|
2997
|
+
this.attrs(attr5, p);
|
|
2995
2998
|
parts.push(this.inline(node.c[1], `${p}.c[1]`));
|
|
2996
2999
|
}
|
|
2997
3000
|
break;
|
|
@@ -3049,9 +3052,9 @@ var Markdown = class {
|
|
|
3049
3052
|
parts.push("---");
|
|
3050
3053
|
break;
|
|
3051
3054
|
case "CodeBlock": {
|
|
3052
|
-
const
|
|
3053
|
-
if (
|
|
3054
|
-
const info =
|
|
3055
|
+
const attr5 = node.c[0];
|
|
3056
|
+
if (attr5[0] || attr5[1].length > 1 || attr5[2].length) this.loss(p, "code block attributes");
|
|
3057
|
+
const info = attr5[1][0] ?? "";
|
|
3055
3058
|
if ([...info].some((ch) => "\r\n` ".includes(ch))) this.loss(p, "code language");
|
|
3056
3059
|
this.reserve(node.c[1].length * 2);
|
|
3057
3060
|
const value = node.c[1].split("\r\n").join("\n").split("\r").join("\n");
|
|
@@ -3236,11 +3239,11 @@ var HtmlWriter = class {
|
|
|
3236
3239
|
this.escape(value, true);
|
|
3237
3240
|
this.add('"');
|
|
3238
3241
|
}
|
|
3239
|
-
attrs(
|
|
3242
|
+
attrs(attr5, id = attr5[0]) {
|
|
3240
3243
|
if (id) this.attribute("id", id);
|
|
3241
|
-
if (
|
|
3244
|
+
if (attr5[1].length) this.attribute("class", attr5[1].join(" "));
|
|
3242
3245
|
const seen = /* @__PURE__ */ new Set(["id", "class"]);
|
|
3243
|
-
for (const [key, value] of
|
|
3246
|
+
for (const [key, value] of attr5[2]) {
|
|
3244
3247
|
if (seen.has(key) || !(["title", "lang", "dir", "role"].includes(key) || key.startsWith("data-") || key.startsWith("aria-")) || [...key].some((ch) => !(ch >= "a" && ch <= "z") && !(ch >= "0" && ch <= "9") && ch !== "-")) this.fail("Unsupported HTML attribute");
|
|
3245
3248
|
if (key === "dir" && !["ltr", "rtl", "auto"].includes(value)) this.fail("Invalid HTML direction");
|
|
3246
3249
|
seen.add(key);
|
|
@@ -5048,12 +5051,12 @@ var LatexReader = class {
|
|
|
5048
5051
|
if ([...value].length !== 1) texError(this.context, "Accent requires one Unicode scalar");
|
|
5049
5052
|
append(out, { t: "Str", c: (value + accents[name]).normalize("NFC") + remainder });
|
|
5050
5053
|
} else if (name === "href" || name === "url" || name === "includegraphics") {
|
|
5051
|
-
const
|
|
5054
|
+
const attr5 = empty();
|
|
5052
5055
|
const option = name === "includegraphics" ? cursor.optional() : void 0;
|
|
5053
|
-
if (option)
|
|
5056
|
+
if (option) attr5[2].push(["latex-options", option.raw.slice(1, -1)]);
|
|
5054
5057
|
const url = this.literal(cursor.group().children, depth + 1);
|
|
5055
5058
|
const label = name === "href" ? this.inlines(cursor.group().children, depth + 1) : name === "url" ? [{ t: "Str", c: url }] : [];
|
|
5056
|
-
append(out, { t: name === "includegraphics" ? "Image" : "Link", c: [
|
|
5059
|
+
append(out, { t: name === "includegraphics" ? "Image" : "Link", c: [attr5, label, [url, ""]] });
|
|
5057
5060
|
} else if (name === "ref" || name === "eqref" || name === "pageref") {
|
|
5058
5061
|
const key = texSource(cursor.group().children);
|
|
5059
5062
|
if (name === "pageref") {
|
|
@@ -5129,10 +5132,10 @@ var LatexReader = class {
|
|
|
5129
5132
|
}
|
|
5130
5133
|
if (cells.length || content.some((t) => t.kind !== "space" && t.kind !== "comment")) row2();
|
|
5131
5134
|
if (!rows.length) texError(this.context, "Tabular has no rows");
|
|
5132
|
-
const
|
|
5133
|
-
|
|
5134
|
-
if (rules)
|
|
5135
|
-
return { t: "Table", c: [
|
|
5135
|
+
const attr5 = empty();
|
|
5136
|
+
attr5[2].push(["latex-column-spec", spec]);
|
|
5137
|
+
if (rules) attr5[2].push(["latex-hlines", String(rules)]);
|
|
5138
|
+
return { t: "Table", c: [attr5, [null, []], cols, [empty(), []], [[empty(), 0, [], rows]], [empty(), []]] };
|
|
5136
5139
|
}
|
|
5137
5140
|
blocks(tokens2, depth = 0) {
|
|
5138
5141
|
this.context.bound("depth", depth);
|
|
@@ -5154,16 +5157,16 @@ var LatexReader = class {
|
|
|
5154
5157
|
}
|
|
5155
5158
|
if (token.kind === "command" && levels[token.text]) {
|
|
5156
5159
|
flush();
|
|
5157
|
-
const
|
|
5160
|
+
const attr5 = empty();
|
|
5158
5161
|
if (tokens2[cursor.index]?.kind === "text" && tokens2[cursor.index]?.text === "*") {
|
|
5159
5162
|
cursor.index++;
|
|
5160
|
-
|
|
5163
|
+
attr5[1].push("unnumbered");
|
|
5161
5164
|
}
|
|
5162
5165
|
const short = cursor.optional();
|
|
5163
|
-
if (short)
|
|
5166
|
+
if (short) attr5[2].push(["short-title", short.raw.slice(1, -1)]);
|
|
5164
5167
|
const title = this.inlines(cursor.group().children, depth + 1);
|
|
5165
|
-
out.push({ t: "Header", c: [levels[token.text],
|
|
5166
|
-
target = { attr:
|
|
5168
|
+
out.push({ t: "Header", c: [levels[token.text], attr5, title] });
|
|
5169
|
+
target = { attr: attr5, title };
|
|
5167
5170
|
} else if (token.kind === "command" && ["title", "author", "date", "documentclass"].includes(token.text)) {
|
|
5168
5171
|
flush();
|
|
5169
5172
|
const options = token.text === "documentclass" ? cursor.optional() : void 0;
|
|
@@ -5178,11 +5181,11 @@ var LatexReader = class {
|
|
|
5178
5181
|
const name = texSource(cursor.group().children);
|
|
5179
5182
|
if (!name || this.labels.has(name)) texError(this.context, "Empty or duplicate label");
|
|
5180
5183
|
if (!target) {
|
|
5181
|
-
const
|
|
5184
|
+
const attr5 = empty();
|
|
5182
5185
|
pending.push({ kind: "group", text: "", raw: "", children: [] });
|
|
5183
5186
|
flush();
|
|
5184
|
-
out.push({ t: "Div", c: [
|
|
5185
|
-
target = { attr:
|
|
5187
|
+
out.push({ t: "Div", c: [attr5, []] });
|
|
5188
|
+
target = { attr: attr5, title: [{ t: "Str", c: name }] };
|
|
5186
5189
|
}
|
|
5187
5190
|
if (target.attr[0]) texError(this.context, "Multiple labels for one structure are unsupported", "E_CAPABILITY");
|
|
5188
5191
|
target.attr[0] = name;
|
|
@@ -5220,8 +5223,8 @@ var LatexReader = class {
|
|
|
5220
5223
|
} else if (token.text === "figure" || token.text === "table") {
|
|
5221
5224
|
const inner = new TexCursor(token.children, this.context);
|
|
5222
5225
|
const position = inner.optional();
|
|
5223
|
-
const
|
|
5224
|
-
if (position)
|
|
5226
|
+
const attr5 = empty();
|
|
5227
|
+
if (position) attr5[2].push(["latex-placement", position.raw.slice(1, -1)]);
|
|
5225
5228
|
let caption2 = [null, []];
|
|
5226
5229
|
let hasCaption = false;
|
|
5227
5230
|
const body = [];
|
|
@@ -5231,27 +5234,27 @@ var LatexReader = class {
|
|
|
5231
5234
|
if (hasCaption) texError(this.context, "Repeated float caption");
|
|
5232
5235
|
hasCaption = true;
|
|
5233
5236
|
const short = inner.optional();
|
|
5234
|
-
if (short)
|
|
5237
|
+
if (short) attr5[2].push(["short-caption", short.raw.slice(1, -1)]);
|
|
5235
5238
|
const c = this.inlines(inner.group().children, depth + 1);
|
|
5236
5239
|
caption2 = [null, [{ t: "Plain", c }]];
|
|
5237
5240
|
} else if (t.kind === "command" && t.text === "label") {
|
|
5238
5241
|
const label = texSource(inner.group().children);
|
|
5239
|
-
if (!label ||
|
|
5240
|
-
|
|
5242
|
+
if (!label || attr5[0] || this.labels.has(label)) texError(this.context, "Empty or duplicate float label");
|
|
5243
|
+
attr5[0] = label;
|
|
5241
5244
|
} else body.push(t);
|
|
5242
5245
|
}
|
|
5243
5246
|
const blocks3 = this.blocks(body, depth + 1);
|
|
5244
5247
|
const title = caption2[1][0];
|
|
5245
5248
|
const inlines2 = title?.t === "Plain" ? title.c : [];
|
|
5246
|
-
if (
|
|
5247
|
-
if (token.text === "figure") out.push({ t: "Figure", c: [
|
|
5249
|
+
if (attr5[0]) this.labels.set(attr5[0], inlines2);
|
|
5250
|
+
if (token.text === "figure") out.push({ t: "Figure", c: [attr5, caption2, blocks3] });
|
|
5248
5251
|
else {
|
|
5249
5252
|
if (blocks3.length !== 1 || blocks3[0]?.t !== "Table") texError(this.context, "Table float must contain one tabular", "E_CAPABILITY");
|
|
5250
5253
|
const table = blocks3[0];
|
|
5251
|
-
for (const pair of table.c[0][2])
|
|
5252
|
-
out.push({ t: "Table", c: [
|
|
5254
|
+
for (const pair of table.c[0][2]) attr5[2].push([pair[0], pair[1]]);
|
|
5255
|
+
out.push({ t: "Table", c: [attr5, caption2, table.c[2], table.c[3], table.c[4], table.c[5]] });
|
|
5253
5256
|
}
|
|
5254
|
-
target = { attr:
|
|
5257
|
+
target = { attr: attr5, title: inlines2 };
|
|
5255
5258
|
} else {
|
|
5256
5259
|
this.raw(token.raw);
|
|
5257
5260
|
out.push({ t: "RawBlock", c: ["latex", token.raw] });
|
|
@@ -5356,9 +5359,9 @@ var LatexWriter = class {
|
|
|
5356
5359
|
}
|
|
5357
5360
|
if (Array.isArray(value)) {
|
|
5358
5361
|
if (value.length === 3 && typeof value[0] === "string" && Array.isArray(value[1]) && Array.isArray(value[2]) && value[0]) {
|
|
5359
|
-
const
|
|
5362
|
+
const attr5 = value;
|
|
5360
5363
|
let base = "pc";
|
|
5361
|
-
for (const ch of
|
|
5364
|
+
for (const ch of attr5[0]) {
|
|
5362
5365
|
this.context.checkpoint();
|
|
5363
5366
|
base += `-${ch.codePointAt(0).toString(16)}`;
|
|
5364
5367
|
}
|
|
@@ -5367,15 +5370,15 @@ var LatexWriter = class {
|
|
|
5367
5370
|
const label = count === 1 ? base : `${base}-dup-${count}`;
|
|
5368
5371
|
this.context.charge("retainedBytes", label.length * 2);
|
|
5369
5372
|
this.context.charge("references", 1);
|
|
5370
|
-
this.labels.set(
|
|
5371
|
-
if (!this.targets.has(
|
|
5373
|
+
this.labels.set(attr5, label);
|
|
5374
|
+
if (!this.targets.has(attr5[0])) this.targets.set(attr5[0], label);
|
|
5372
5375
|
}
|
|
5373
5376
|
for (const child of value) await this.reserve(child);
|
|
5374
5377
|
} else for (const child of Object.values(value)) await this.reserve(child);
|
|
5375
5378
|
}
|
|
5376
|
-
attrs(
|
|
5377
|
-
if (
|
|
5378
|
-
const label = this.labels.get(
|
|
5379
|
+
attrs(attr5, path, languageClass = false) {
|
|
5380
|
+
if (attr5[1].length && !languageClass || attr5[2].length) this.loss("Unsupported LaTeX attributes", path);
|
|
5381
|
+
const label = this.labels.get(attr5);
|
|
5379
5382
|
if (label) this.add(`\\phantomsection\\label{${label}}`);
|
|
5380
5383
|
}
|
|
5381
5384
|
math(source, path) {
|
|
@@ -6712,6 +6715,7 @@ var RstWriter = class {
|
|
|
6712
6715
|
}
|
|
6713
6716
|
context;
|
|
6714
6717
|
definitions = [];
|
|
6718
|
+
strikeout = false;
|
|
6715
6719
|
notes = [];
|
|
6716
6720
|
serial = 0;
|
|
6717
6721
|
sourceText = "";
|
|
@@ -6741,12 +6745,12 @@ var RstWriter = class {
|
|
|
6741
6745
|
}
|
|
6742
6746
|
return this.retain(out);
|
|
6743
6747
|
}
|
|
6744
|
-
attrs(
|
|
6745
|
-
if (
|
|
6746
|
-
if (!
|
|
6747
|
-
const count = (this.ids.get(
|
|
6748
|
-
this.ids.set(
|
|
6749
|
-
const base = this.id(
|
|
6748
|
+
attrs(attr5, path, language = false) {
|
|
6749
|
+
if (attr5[1].length && !language || attr5[2].length || language && attr5[1].length > 1) this.loss("Dropped unsupported RST attributes", path);
|
|
6750
|
+
if (!attr5[0]) return "";
|
|
6751
|
+
const count = (this.ids.get(attr5[0]) ?? 0) + 1;
|
|
6752
|
+
this.ids.set(attr5[0], count);
|
|
6753
|
+
const base = this.id(attr5[0]);
|
|
6750
6754
|
return `.. _${count > 1 ? this.unique(`${base}-dup-${count}`) : base}:
|
|
6751
6755
|
|
|
6752
6756
|
`;
|
|
@@ -6816,8 +6820,20 @@ var RstWriter = class {
|
|
|
6816
6820
|
markup = true;
|
|
6817
6821
|
break;
|
|
6818
6822
|
}
|
|
6823
|
+
case "Strikeout": {
|
|
6824
|
+
const content = children2(node.c);
|
|
6825
|
+
if (nested) {
|
|
6826
|
+
this.loss("Nested RST inline style projected to text", p);
|
|
6827
|
+
text = content;
|
|
6828
|
+
break;
|
|
6829
|
+
}
|
|
6830
|
+
if (!content || content.trim() !== content) this.fail("Empty or whitespace-bounded inline style", p);
|
|
6831
|
+
this.strikeout = true;
|
|
6832
|
+
text = `:strikeout:\`${content}\``;
|
|
6833
|
+
markup = true;
|
|
6834
|
+
break;
|
|
6835
|
+
}
|
|
6819
6836
|
case "Underline":
|
|
6820
|
-
case "Strikeout":
|
|
6821
6837
|
case "SmallCaps":
|
|
6822
6838
|
this.loss(`Projected unsupported ${node.t} to text`, p);
|
|
6823
6839
|
text = children2(node.c);
|
|
@@ -6910,11 +6926,11 @@ var RstWriter = class {
|
|
|
6910
6926
|
text = this.inlines(node.c, `${p}.c`);
|
|
6911
6927
|
break;
|
|
6912
6928
|
case "Header": {
|
|
6913
|
-
const [level,
|
|
6929
|
+
const [level, attr5, content] = node.c;
|
|
6914
6930
|
if (level > 9) this.loss("Heading level projected to level nine", p);
|
|
6915
6931
|
text = this.inlines(content, `${p}.c[2]`);
|
|
6916
6932
|
if (!text) this.fail("Empty heading", p);
|
|
6917
|
-
text = this.attrs(
|
|
6933
|
+
text = this.attrs(attr5, p) + text + "\n" + `=-~^"'+:#`[Math.min(level, 9) - 1].repeat(rstColumnWidth(text));
|
|
6918
6934
|
break;
|
|
6919
6935
|
}
|
|
6920
6936
|
case "CodeBlock": {
|
|
@@ -6938,10 +6954,15 @@ var RstWriter = class {
|
|
|
6938
6954
|
text = indent(body.startsWith(" ") ? "..\n\n" + body : body, 3);
|
|
6939
6955
|
break;
|
|
6940
6956
|
}
|
|
6941
|
-
case "Div":
|
|
6942
|
-
|
|
6943
|
-
|
|
6957
|
+
case "Div": {
|
|
6958
|
+
const [id, classes, attributes] = node.c[0];
|
|
6959
|
+
if (classes.some((name) => !name || [...name].some((ch) => !"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-".includes(ch)))) this.fail("Unsupported RST container class", p);
|
|
6960
|
+
const body = this.blocks(node.c[1], `${p}.c[1]`);
|
|
6961
|
+
text = this.attrs([id, [], attributes], p) + `.. container::${classes.length ? " " + classes.join(" ") : ""}
|
|
6962
|
+
|
|
6963
|
+
` + indent(body, 3);
|
|
6944
6964
|
break;
|
|
6965
|
+
}
|
|
6945
6966
|
case "Figure":
|
|
6946
6967
|
this.loss("Figure projected to content and caption", p);
|
|
6947
6968
|
text = this.blocks(node.c[2], `${p}.c[2]`) + "\n\n" + this.blocks(node.c[1][1], `${p}.c[1][1]`);
|
|
@@ -7017,8 +7038,8 @@ var RstWriter = class {
|
|
|
7017
7038
|
if ("t" in value && ["Space", "SoftBreak", "LineBreak"].includes(String(value.t))) return " ";
|
|
7018
7039
|
if ("t" in value && "c" in value && ["Header", "CodeBlock", "Div"].includes(String(value.t))) {
|
|
7019
7040
|
const block2 = value;
|
|
7020
|
-
const
|
|
7021
|
-
if (
|
|
7041
|
+
const attr5 = block2.t === "Header" ? block2.c[1] : block2.c[0];
|
|
7042
|
+
if (attr5[0]) this.targets.add(attr5[0]);
|
|
7022
7043
|
}
|
|
7023
7044
|
if ("c" in value) return reserve(value.c);
|
|
7024
7045
|
return this.retain(Object.values(value).map((child) => reserve(child)).join(""));
|
|
@@ -7033,7 +7054,7 @@ var RstWriter = class {
|
|
|
7033
7054
|
const marker = `.. [${i + 1}] `;
|
|
7034
7055
|
this.definitions.push(markedBody(marker, body));
|
|
7035
7056
|
}
|
|
7036
|
-
return { kind: "text", text: this.retain([text, ...this.definitions].filter(Boolean).join("\n\n") + (text || this.definitions.length ? "\n" : "")) };
|
|
7057
|
+
return { kind: "text", text: this.retain([...this.strikeout ? [".. role:: strikeout"] : [], text, ...this.definitions].filter(Boolean).join("\n\n") + (text || this.definitions.length ? "\n" : "")) };
|
|
7037
7058
|
}
|
|
7038
7059
|
};
|
|
7039
7060
|
async function writeRst(document, context) {
|
|
@@ -7506,13 +7527,13 @@ var RstReader = class {
|
|
|
7506
7527
|
if (name === "image" || name === "figure") {
|
|
7507
7528
|
if (!allow(["alt", "height", "width", "scale", "align", "target", "class", "name"]) || name === "image" && body.length || name === "figure" && subName) return unsupported();
|
|
7508
7529
|
if (!argument) rstError(this.context, at, "Image requires a URI");
|
|
7509
|
-
const
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
for (const k of ["height", "width", "scale", "align"]) if (options.has(k))
|
|
7530
|
+
const attr5 = rstAttr();
|
|
7531
|
+
attr5[0] = options.get("name") ?? "";
|
|
7532
|
+
attr5[1].push(...(options.get("class") ?? "").split(" ").filter(Boolean));
|
|
7533
|
+
for (const k of ["height", "width", "scale", "align"]) if (options.has(k)) attr5[2].push([k, options.get(k)]);
|
|
7513
7534
|
const target = [argument, ""];
|
|
7514
7535
|
this.context.resourceTarget?.(target, at.line, at.source === void 0 ? void 0 : { ...at.base === void 0 ? {} : { base: at.base }, source: at.source });
|
|
7515
|
-
let image = { t: "Image", c: [
|
|
7536
|
+
let image = { t: "Image", c: [attr5, this.inline(options.get("alt") ?? "", at), target] };
|
|
7516
7537
|
if (options.has("target")) image = { t: "Link", c: [rstAttr(), [image], [options.get("target"), ""]] };
|
|
7517
7538
|
if (subName) {
|
|
7518
7539
|
if (this.substitutions.has(subName)) rstError(this.context, at, `Duplicate substitution: ${subName}`);
|
|
@@ -7529,18 +7550,18 @@ var RstReader = class {
|
|
|
7529
7550
|
if (subName) return unsupported();
|
|
7530
7551
|
if (["code", "code-block", "sourcecode", "parsed-literal"].includes(name)) {
|
|
7531
7552
|
if (!allow(["number-lines", "class", "name"]) || name === "parsed-literal") return unsupported();
|
|
7532
|
-
const
|
|
7533
|
-
|
|
7534
|
-
if (argument)
|
|
7535
|
-
|
|
7553
|
+
const attr5 = rstAttr();
|
|
7554
|
+
attr5[0] = options.get("name") ?? "";
|
|
7555
|
+
if (argument) attr5[1].push(argument);
|
|
7556
|
+
attr5[1].push(...(options.get("class") ?? "").split(" ").filter(Boolean));
|
|
7536
7557
|
if (options.has("number-lines")) {
|
|
7537
7558
|
const number = options.get("number-lines") || "1";
|
|
7538
7559
|
if (![...number].every((c) => c >= "0" && c <= "9")) rstError(this.context, at, "Invalid number-lines value");
|
|
7539
|
-
|
|
7540
|
-
|
|
7560
|
+
attr5[1].push("numberLines");
|
|
7561
|
+
attr5[2].push(["startFrom", number]);
|
|
7541
7562
|
}
|
|
7542
7563
|
if (!body.length) rstError(this.context, at, "Code directive requires a body");
|
|
7543
|
-
return { blocks: [{ t: "CodeBlock", c: [
|
|
7564
|
+
return { blocks: [{ t: "CodeBlock", c: [attr5, body.map((l) => l.text).join("\n")] }], end };
|
|
7544
7565
|
}
|
|
7545
7566
|
if (name === "raw") {
|
|
7546
7567
|
if (options.size || !argument || argument.split(" ").length !== 1) return unsupported();
|
|
@@ -8979,9 +9000,9 @@ var RtfWriter = class {
|
|
|
8979
9000
|
else this.add(ch);
|
|
8980
9001
|
}
|
|
8981
9002
|
}
|
|
8982
|
-
attrs(
|
|
8983
|
-
if (
|
|
8984
|
-
for (const [key, value] of
|
|
9003
|
+
attrs(attr5, paragraph = false) {
|
|
9004
|
+
if (attr5[0] || attr5[1].length) this.fail("Unsupported RTF identifiers or classes");
|
|
9005
|
+
for (const [key, value] of attr5[2]) {
|
|
8985
9006
|
if (key === "font-family") {
|
|
8986
9007
|
const id = this.fonts.indexOf(value);
|
|
8987
9008
|
if (id < 0) this.fail("Font reference must be explicitly declared in rtf-fonts metadata", "E_RESOURCE");
|
|
@@ -9111,12 +9132,12 @@ var RtfWriter = class {
|
|
|
9111
9132
|
}
|
|
9112
9133
|
}
|
|
9113
9134
|
}
|
|
9114
|
-
async paragraph(nodes, state,
|
|
9135
|
+
async paragraph(nodes, state, attr5) {
|
|
9115
9136
|
this.add(`{\\pard\\plain\\s${state.style ?? 0}`);
|
|
9116
9137
|
if (state.style) this.add(`\\b\\fs${40 - state.style * 2}`);
|
|
9117
9138
|
this.add(`\\li${state.indent}\\fi${state.marker ? -360 : 0}\\${state.direction}par`);
|
|
9118
9139
|
if (state.cell) this.add(`\\intbl\\${alignments[state.cell]}`);
|
|
9119
|
-
if (
|
|
9140
|
+
if (attr5) this.attrs(attr5, true);
|
|
9120
9141
|
if (state.marker && state.list) this.add(`\\tx${state.indent}\\ls${state.list.id}\\ilvl${state.list.level}`);
|
|
9121
9142
|
this.add(" ");
|
|
9122
9143
|
if (state.marker) {
|
|
@@ -9194,7 +9215,7 @@ var RtfWriter = class {
|
|
|
9194
9215
|
case "Table": {
|
|
9195
9216
|
if (state.cell) this.fail("Nested RTF tables unsupported");
|
|
9196
9217
|
const t = node.c;
|
|
9197
|
-
for (const
|
|
9218
|
+
for (const attr5 of [t[0], t[3][0], ...t[4].map((b) => b[0]), t[5][0]]) if (attr5[0] || attr5[1].length || attr5[2].length) this.fail("Attributed RTF table sections unsupported");
|
|
9198
9219
|
if (t[1][1].length) await this.blocks(t[1][1], state);
|
|
9199
9220
|
else if (t[1][0]) await this.paragraph(t[1][0], state);
|
|
9200
9221
|
const widths = t[2].map((c) => c[1].t === "ColWidth" ? c[1].c : 1 / t[2].length);
|
|
@@ -9763,8 +9784,8 @@ var epubReader = {
|
|
|
9763
9784
|
}
|
|
9764
9785
|
if (toc.length) metadata2["epub-toc"] = { t: "MetaList", c: toc };
|
|
9765
9786
|
return { blocks: chapters.map((chapter) => {
|
|
9766
|
-
const
|
|
9767
|
-
return { t: "Div", c: [
|
|
9787
|
+
const attr5 = [identity(chapter.item.part), ["epub-chapter"], [["data-epub-source", chapter.item.part], ["data-epub-item-id", chapter.item.id], ["data-epub-linear", chapter.linear], ...chapter.language ? [["lang", chapter.language]] : []]];
|
|
9788
|
+
return { t: "Div", c: [attr5, chapter.blocks] };
|
|
9768
9789
|
}), metadata: metadata2, resources: [...bag.values()], ...bookLanguage ? { language: xmlText(bookLanguage) } : {}, ...["ltr", "rtl"].includes(bookDirection) ? { direction: bookDirection } : {} };
|
|
9769
9790
|
}
|
|
9770
9791
|
};
|
|
@@ -9793,14 +9814,17 @@ var epubWriter = {
|
|
|
9793
9814
|
if (defaultTreeAdapter.isTextNode(node)) return node.value;
|
|
9794
9815
|
return "childNodes" in node ? node.childNodes.map(text).join("") : "";
|
|
9795
9816
|
};
|
|
9817
|
+
const inlineText = async (nodes) => {
|
|
9818
|
+
const result = await writeHtml5({ blocks: [{ t: "Plain", c: nodes }], metadata: {}, resources: [] }, htmlContext);
|
|
9819
|
+
if (result.kind !== "text") return fail3("Expected text serialization");
|
|
9820
|
+
return text(parseFragment(result.text)).trim();
|
|
9821
|
+
};
|
|
9796
9822
|
const meta2 = async (key) => {
|
|
9797
9823
|
const value = document.metadata[key];
|
|
9798
9824
|
if (value === void 0) return void 0;
|
|
9799
9825
|
if (value.t === "MetaString") return value.c;
|
|
9800
9826
|
if (value.t !== "MetaInlines") return fail3(`${key} must be text metadata`, "E_OPTION");
|
|
9801
|
-
|
|
9802
|
-
if (result.kind !== "text") return fail3("Expected text serialization");
|
|
9803
|
-
return text(parseFragment(result.text)).trim();
|
|
9827
|
+
return inlineText(value.c);
|
|
9804
9828
|
};
|
|
9805
9829
|
const htmlContext = new Proxy(ctx, { get(target, key) {
|
|
9806
9830
|
if (key === "standalone") return false;
|
|
@@ -9811,9 +9835,22 @@ var epubWriter = {
|
|
|
9811
9835
|
const suppliedTitle = ctx.epub?.title ?? await meta2("title");
|
|
9812
9836
|
const suppliedLang = ctx.epub?.language ?? await meta2("lang") ?? document.language;
|
|
9813
9837
|
const explicitIdentifier = ctx.epub?.identifier ?? await meta2("identifier");
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9838
|
+
const headingTitle = async (blocks3) => {
|
|
9839
|
+
for (const block2 of blocks3) {
|
|
9840
|
+
await ctx.cooperate();
|
|
9841
|
+
if (block2.t === "Header") {
|
|
9842
|
+
const title2 = await inlineText(block2.c[2]);
|
|
9843
|
+
if (title2) return title2;
|
|
9844
|
+
}
|
|
9845
|
+
if (block2.t === "Div" || block2.t === "BlockQuote") {
|
|
9846
|
+
const title2 = await headingTitle(block2.t === "Div" ? block2.c[1] : block2.c);
|
|
9847
|
+
if (title2) return title2;
|
|
9848
|
+
}
|
|
9849
|
+
}
|
|
9850
|
+
return void 0;
|
|
9851
|
+
};
|
|
9852
|
+
const title = suppliedTitle ?? await headingTitle(document.blocks) ?? "Untitled";
|
|
9853
|
+
const lang = suppliedLang ?? "en-US";
|
|
9817
9854
|
const modified = await meta2("modified") ?? "1970-01-01T00:00:00Z";
|
|
9818
9855
|
if (!title.trim() || !lang.trim() || explicitIdentifier !== void 0 && !explicitIdentifier.trim()) fail3("Publication metadata must be nonempty", "E_OPTION");
|
|
9819
9856
|
const date = new Date(modified);
|
|
@@ -10431,7 +10468,7 @@ var EncodingMode;
|
|
|
10431
10468
|
})(EncodingMode || (EncodingMode = {}));
|
|
10432
10469
|
var attr2 = ["", [], []];
|
|
10433
10470
|
async function modelContext(ctx) {
|
|
10434
|
-
const { DocumentBudget } = await import("./src-
|
|
10471
|
+
const { DocumentBudget } = await import("./src-ICMQISAA.js");
|
|
10435
10472
|
const l = ctx.limits;
|
|
10436
10473
|
const signal = ctx.signal ?? new AbortController().signal;
|
|
10437
10474
|
return { signal, budget: new DocumentBudget({
|
|
@@ -10465,7 +10502,7 @@ async function guarded(ctx, action) {
|
|
|
10465
10502
|
}
|
|
10466
10503
|
var docxReader = { format: "docx", async read(input, ctx) {
|
|
10467
10504
|
return guarded(ctx, async () => {
|
|
10468
|
-
const { Document: openDocument, Paragraph, Run } = await import("./src-
|
|
10505
|
+
const { Document: openDocument, Paragraph, Run } = await import("./src-ICMQISAA.js");
|
|
10469
10506
|
const model = await openDocument(input.bytes, await modelContext(ctx));
|
|
10470
10507
|
const paragraph = (p) => {
|
|
10471
10508
|
const inlines2 = [];
|
|
@@ -10498,21 +10535,26 @@ var docxReader = { format: "docx", async read(input, ctx) {
|
|
|
10498
10535
|
return { blocks: blocks3, metadata: {}, resources: [] };
|
|
10499
10536
|
});
|
|
10500
10537
|
} };
|
|
10501
|
-
var docxWriter = { format: "docx", async write(document, ctx) {
|
|
10538
|
+
var docxWriter = { format: "docx", imageResources: "embed", async write(document, ctx) {
|
|
10502
10539
|
return guarded(ctx, async () => {
|
|
10503
10540
|
const blocks3 = [];
|
|
10504
10541
|
const paragraphs = [];
|
|
10505
10542
|
const numbering2 = [];
|
|
10506
10543
|
const w = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
|
|
10507
10544
|
const r = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
10508
|
-
const runs = (nodes,
|
|
10545
|
+
const runs = (nodes, style = {}) => {
|
|
10509
10546
|
const result = [];
|
|
10510
10547
|
for (const node of nodes) {
|
|
10511
10548
|
ctx.checkpoint();
|
|
10512
|
-
if (node.t === "Strong") result.push(...runs(node.c,
|
|
10513
|
-
else if (node.t === "Emph") result.push(...runs(node.c,
|
|
10514
|
-
else if (node.t === "
|
|
10515
|
-
else if (node.t === "
|
|
10549
|
+
if (node.t === "Strong") result.push(...runs(node.c, { ...style, bold: true }));
|
|
10550
|
+
else if (node.t === "Emph") result.push(...runs(node.c, { ...style, italic: true }));
|
|
10551
|
+
else if (node.t === "Underline") result.push(...runs(node.c, { ...style, underline: true }));
|
|
10552
|
+
else if (node.t === "Strikeout") result.push(...runs(node.c, { ...style, strike: true }));
|
|
10553
|
+
else if (node.t === "Superscript" || node.t === "Subscript") result.push(...runs(node.c, { ...style, baseline: node.t === "Superscript" ? "superscript" : "subscript" }));
|
|
10554
|
+
else if (node.t === "Span") result.push(...runs(node.c[1], style));
|
|
10555
|
+
else if (node.t === "Link") result.push(...runs(node.c[1], { ...style, link: node.c[2][0] }));
|
|
10556
|
+
else if (node.t === "Quoted") result.push(...runs([{ t: "Str", c: node.c[0] === "SingleQuote" ? "\u2018" : "\u201C" }, ...node.c[1], { t: "Str", c: node.c[0] === "SingleQuote" ? "\u2019" : "\u201D" }], style));
|
|
10557
|
+
else if (node.t === "Image") result.push({ ...style, text: "", image: node });
|
|
10516
10558
|
else {
|
|
10517
10559
|
let text;
|
|
10518
10560
|
if (node.t === "Str") text = node.c;
|
|
@@ -10520,14 +10562,14 @@ var docxWriter = { format: "docx", async write(document, ctx) {
|
|
|
10520
10562
|
else if (node.t === "LineBreak") text = "\n";
|
|
10521
10563
|
else if (node.t === "Code") text = node.c[1];
|
|
10522
10564
|
else throw new PandocError("E_UNSUPPORTED_FEATURE", "write", `Unsupported DOCX inline: ${node.t}`, "docx");
|
|
10523
|
-
result.push({
|
|
10565
|
+
result.push({ ...style, text });
|
|
10524
10566
|
}
|
|
10525
10567
|
}
|
|
10526
10568
|
return result;
|
|
10527
10569
|
};
|
|
10528
10570
|
const paragraph = (target, content, properties, level) => {
|
|
10529
10571
|
paragraphs.push({ runs: content, properties });
|
|
10530
|
-
target.push({ kind: "paragraph", ...level === void 0 ? {} : { level }, runs: content.map(({ link: _link, ...run }) => run) });
|
|
10572
|
+
target.push({ kind: "paragraph", ...level === void 0 ? {} : { level }, runs: content.map(({ link: _link, strike: _strike, baseline: _baseline, image: _image, ...run }) => run) });
|
|
10531
10573
|
};
|
|
10532
10574
|
const visit5 = async (nodes, target, indent3 = 0, list2) => {
|
|
10533
10575
|
for (const block2 of nodes) {
|
|
@@ -10575,7 +10617,7 @@ var docxWriter = { format: "docx", async write(document, ctx) {
|
|
|
10575
10617
|
}
|
|
10576
10618
|
};
|
|
10577
10619
|
await visit5(document.blocks, blocks3);
|
|
10578
|
-
const { createDocumentArchive, writeDocumentArchive, DocumentXmlEditor } = await import("./src-
|
|
10620
|
+
const { createDocumentArchive, writeDocumentArchive, DocumentXmlEditor, Image } = await import("./src-ICMQISAA.js");
|
|
10579
10621
|
const mc = await modelContext(ctx);
|
|
10580
10622
|
const archiveContext = { signal: mc.signal, budget: mc.budget };
|
|
10581
10623
|
const archive = await createDocumentArchive({ content: { version: 1, blocks: blocks3 } }, archiveContext);
|
|
@@ -10583,6 +10625,30 @@ var docxWriter = { format: "docx", async write(document, ctx) {
|
|
|
10583
10625
|
const relationships = new DocumentXmlEditor(archive.members.find((member) => member.name === "word/_rels/document.xml.rels").bytes, {}, void 0, mc.budget);
|
|
10584
10626
|
let paragraphIndex = 0, relationshipId = 2;
|
|
10585
10627
|
const linkRelationships = [];
|
|
10628
|
+
const media = /* @__PURE__ */ new Map();
|
|
10629
|
+
let drawingId = 0;
|
|
10630
|
+
const drawing = async (node) => {
|
|
10631
|
+
ctx.charge("images", 1);
|
|
10632
|
+
const source = node.c[2][0];
|
|
10633
|
+
let entry = media.get(source);
|
|
10634
|
+
if (!entry) {
|
|
10635
|
+
const bytes2 = document.resources.find((resource) => resource.id === source)?.bytes ?? await ctx.resources?.resolve(source, void 0, ctx.signal);
|
|
10636
|
+
if (!bytes2) throw new PandocError("E_RESOURCE", "write", `Missing image resource: ${source}`, "docx");
|
|
10637
|
+
ctx.charge("resourceBytes", bytes2.length);
|
|
10638
|
+
const asset = await Image.from_blob(bytes2, mc);
|
|
10639
|
+
const name = `media/image-${media.size + 1}.${asset.ext}`;
|
|
10640
|
+
entry = { name, bytes: bytes2, type: asset.content_type, id: `rId${relationshipId++}`, asset };
|
|
10641
|
+
media.set(source, entry);
|
|
10642
|
+
linkRelationships.push(`<Relationship Id="${entry.id}" Type="${r}/image" Target="${name}"/>`);
|
|
10643
|
+
}
|
|
10644
|
+
const attributes = Object.fromEntries(node.c[0][2]);
|
|
10645
|
+
let width = imageLength(attributes.width, entry.asset.width.emu, ctx, "docx"), height = imageLength(attributes.height, entry.asset.height.emu, ctx, "docx");
|
|
10646
|
+
if (attributes.width && !attributes.height) height = Math.max(1, Math.round(width * entry.asset.height.emu / entry.asset.width.emu));
|
|
10647
|
+
if (attributes.height && !attributes.width) width = Math.max(1, Math.round(height * entry.asset.width.emu / entry.asset.height.emu));
|
|
10648
|
+
const alt = encodeXML(runs(node.c[1]).map((run) => run.text).join(""));
|
|
10649
|
+
const a = "http://schemas.openxmlformats.org/drawingml/2006/main", pic = "http://schemas.openxmlformats.org/drawingml/2006/picture";
|
|
10650
|
+
return `<w:drawing xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="${a}" xmlns:pic="${pic}" xmlns:r="${r}"><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${width}" cy="${height}"/><wp:docPr id="${++drawingId}" name="Image ${drawingId}" descr="${alt}" title="${encodeXML(node.c[2][1])}"/><wp:cNvGraphicFramePr><a:graphicFrameLocks noChangeAspect="1"/></wp:cNvGraphicFramePr><a:graphic><a:graphicData uri="${pic}"><pic:pic><pic:nvPicPr><pic:cNvPr id="0" name="Image ${drawingId}"/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${entry.id}"/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${width}" cy="${height}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing>`;
|
|
10651
|
+
};
|
|
10586
10652
|
const edit = async (node) => {
|
|
10587
10653
|
await ctx.cooperate();
|
|
10588
10654
|
if (node.namespace === w && node.localName === "p") {
|
|
@@ -10592,13 +10658,21 @@ var docxWriter = { format: "docx", async write(document, ctx) {
|
|
|
10592
10658
|
const properties = node.children.find((child) => child.localName === "pPr");
|
|
10593
10659
|
if (properties && extra.properties) replacements.set(properties, `<w:pPr>${main.sourceXml(properties, /* @__PURE__ */ new Map(), true)}${extra.properties}</w:pPr>`);
|
|
10594
10660
|
const nativeRuns = node.children.filter((child) => child.localName === "r");
|
|
10595
|
-
for (const [index, run] of extra.runs.entries())
|
|
10661
|
+
for (const [index, run] of extra.runs.entries()) {
|
|
10596
10662
|
ctx.checkpoint();
|
|
10597
10663
|
const native = nativeRuns[index];
|
|
10598
|
-
const
|
|
10599
|
-
const
|
|
10600
|
-
|
|
10601
|
-
|
|
10664
|
+
const properties2 = native.children.find((child) => child.localName === "rPr");
|
|
10665
|
+
const format2 = (run.strike ? "<w:strike/>" : "") + (run.baseline ? `<w:vertAlign w:val="${run.baseline}"/>` : "");
|
|
10666
|
+
const edits = /* @__PURE__ */ new Map();
|
|
10667
|
+
if (properties2 && format2) edits.set(properties2, `<w:rPr>${main.sourceXml(properties2, /* @__PURE__ */ new Map(), true)}${format2}</w:rPr>`);
|
|
10668
|
+
let xml = run.image ? `<w:r>${await drawing(run.image)}</w:r>` : `<w:r>${!properties2 && format2 ? `<w:rPr>${format2}</w:rPr>` : ""}${main.sourceXml(native, edits, true)}</w:r>`;
|
|
10669
|
+
if (run.link !== void 0) {
|
|
10670
|
+
const anchor = run.link.startsWith("#");
|
|
10671
|
+
const id = `rId${relationshipId++}`;
|
|
10672
|
+
if (!anchor) linkRelationships.push(`<Relationship Id="${id}" Type="${r}/hyperlink" Target="${encodeXML(run.link)}" TargetMode="External"/>`);
|
|
10673
|
+
xml = `<w:hyperlink ${anchor ? `w:anchor="${encodeXML(run.link.slice(1))}"` : `xmlns:r="${r}" r:id="${id}"`}>${xml}</w:hyperlink>`;
|
|
10674
|
+
}
|
|
10675
|
+
if (format2 || run.image || run.link !== void 0) replacements.set(native, xml);
|
|
10602
10676
|
}
|
|
10603
10677
|
if (extra.properties || replacements.size) main.replaceElement(node, `<w:p xmlns:w="${w}">${!properties && extra.properties ? `<w:pPr>${extra.properties}</w:pPr>` : ""}${main.sourceXml(node, replacements, true)}</w:p>`);
|
|
10604
10678
|
} else for (const child of node.children) await edit(child);
|
|
@@ -10608,8 +10682,10 @@ var docxWriter = { format: "docx", async write(document, ctx) {
|
|
|
10608
10682
|
if (linkRelationships.length) relationships.insertChildren(relationships.root, linkRelationships.map((xml) => xml.replace("<Relationship ", '<Relationship xmlns="http://schemas.openxmlformats.org/package/2006/relationships" ')).join(""));
|
|
10609
10683
|
const types = new DocumentXmlEditor(archive.members.find((member) => member.name === "[Content_Types].xml").bytes, {}, void 0, mc.budget);
|
|
10610
10684
|
if (numbering2.length) types.insertChildren(types.root, '<Override xmlns="http://schemas.openxmlformats.org/package/2006/content-types" PartName="/word/numbering.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"/>');
|
|
10685
|
+
for (const entry of media.values()) types.insertChildren(types.root, `<Override xmlns="http://schemas.openxmlformats.org/package/2006/content-types" PartName="/word/${entry.name}" ContentType="${entry.type}"/>`);
|
|
10611
10686
|
const parts = /* @__PURE__ */ new Map([["word/document.xml", main.serialize()], ["word/_rels/document.xml.rels", relationships.serialize()], ["[Content_Types].xml", types.serialize()]]);
|
|
10612
10687
|
const members = archive.members.map((member) => ({ ...member, bytes: parts.get(member.name) ?? member.bytes }));
|
|
10688
|
+
for (const entry of media.values()) members.push({ name: `word/${entry.name}`, bytes: entry.bytes, directory: false, modified: /* @__PURE__ */ new Date(0) });
|
|
10613
10689
|
if (numbering2.length) members.push({ name: "word/numbering.xml", bytes: new TextEncoder().encode(`<w:numbering xmlns:w="${w}">${numbering2.join("")}${numbering2.map((_, i) => `<w:num w:numId="${i + 1}"><w:abstractNumId w:val="${i + 1}"/></w:num>`).join("")}</w:numbering>`), directory: false, modified: /* @__PURE__ */ new Date(0) });
|
|
10614
10690
|
const chunks = [];
|
|
10615
10691
|
let size = 0;
|
|
@@ -10643,6 +10719,448 @@ var docx_default = {
|
|
|
10643
10719
|
write: ["standalone"]
|
|
10644
10720
|
}
|
|
10645
10721
|
};
|
|
10722
|
+
var import_saxes2 = __toESM(require_saxes(), 1);
|
|
10723
|
+
var odtNamespaces = Object.fromEntries(["office", "text", "style", "table", "draw", "manifest"].map((name) => [name, `urn:oasis:names:tc:opendocument:xmlns:${name === "draw" ? "drawing" : name}:1.0`]));
|
|
10724
|
+
var odtMime = "application/vnd.oasis.opendocument.text";
|
|
10725
|
+
var fo = "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0";
|
|
10726
|
+
var xlink = "http://www.w3.org/1999/xlink";
|
|
10727
|
+
var svg = "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0";
|
|
10728
|
+
function odtAttribute(node, name, uri2) {
|
|
10729
|
+
return node.attrs.find((a) => a.name === name && a.uri === uri2)?.value ?? "";
|
|
10730
|
+
}
|
|
10731
|
+
function odtChildren(node, name, uri2) {
|
|
10732
|
+
return node.children.filter((child) => typeof child !== "string" && child.name === name && child.uri === uri2);
|
|
10733
|
+
}
|
|
10734
|
+
function odtFailure(ctx, message, code = "E_PARSE") {
|
|
10735
|
+
throw new PandocError(code, ctx.operation ?? "read", message, "odt");
|
|
10736
|
+
}
|
|
10737
|
+
async function parseOdtXml(bytes, ctx) {
|
|
10738
|
+
ctx.bound("binaryBytes", bytes.length);
|
|
10739
|
+
const text = await ctx.decodeUtf8([bytes]);
|
|
10740
|
+
const parser = new import_saxes2.SaxesParser({ xmlns: true });
|
|
10741
|
+
const stack = [];
|
|
10742
|
+
let root;
|
|
10743
|
+
parser.on("error", (error) => odtFailure(ctx, `Invalid ODT XML: ${error.message}`));
|
|
10744
|
+
parser.on("doctype", () => odtFailure(ctx, "ODT DTD and external entities are forbidden"));
|
|
10745
|
+
parser.on("opentag", (tag) => {
|
|
10746
|
+
ctx.checkpoint();
|
|
10747
|
+
ctx.bound("xmlDepth", stack.length + 1);
|
|
10748
|
+
ctx.charge("xmlNodes", 1);
|
|
10749
|
+
ctx.charge("attributes", Object.keys(tag.attributes).length);
|
|
10750
|
+
ctx.charge("retainedBytes", 128 + Object.keys(tag.attributes).length * 64);
|
|
10751
|
+
const node = { name: tag.local, uri: tag.uri, attrs: Object.values(tag.attributes).map((a) => ({ name: a.local, uri: a.uri, value: a.value })), children: [] };
|
|
10752
|
+
if (stack.length) stack.at(-1).children.push(node);
|
|
10753
|
+
else root = node;
|
|
10754
|
+
stack.push(node);
|
|
10755
|
+
});
|
|
10756
|
+
parser.on("closetag", () => {
|
|
10757
|
+
stack.pop();
|
|
10758
|
+
});
|
|
10759
|
+
const append2 = (value) => {
|
|
10760
|
+
ctx.charge("retainedBytes", value.length * 2);
|
|
10761
|
+
if (stack.length) stack.at(-1).children.push(value);
|
|
10762
|
+
};
|
|
10763
|
+
parser.on("text", append2);
|
|
10764
|
+
parser.on("cdata", append2);
|
|
10765
|
+
for (let i = 0; i < text.length; i += 4096) {
|
|
10766
|
+
parser.write(text.slice(i, i + 4096));
|
|
10767
|
+
await ctx.cooperate(4096);
|
|
10768
|
+
}
|
|
10769
|
+
parser.close();
|
|
10770
|
+
return root ?? odtFailure(ctx, "Missing ODT XML root");
|
|
10771
|
+
}
|
|
10772
|
+
function odtPackage(ctx) {
|
|
10773
|
+
const signal = ctx.signal ?? new AbortController().signal;
|
|
10774
|
+
const limits = { maxArchiveBytes: Math.max(ctx.limits.compressedBytes, ctx.limits.outputBytes), maxEntryBytes: ctx.limits.expandedBytes, maxTotalBytes: ctx.limits.expandedBytes, maxMembers: ctx.limits.parts, maxPathBytes: ctx.limits.text, maxDepth: ctx.limits.depth, maxPaxBytes: ctx.limits.binaryBytes, maxTextBytes: ctx.limits.text, chunkSize: 4096 };
|
|
10775
|
+
const codec = createZipCodec({ compression: createCompressionCodec(), yieldTurn: async () => ctx.cooperate(), fail: (message) => odtFailure(ctx, message, message.includes("limit") ? "E_LIMIT" : "E_PARSE") }, { rejectDuplicateNames: true, validatePayloads: true, allowStoredCompressionFlags: true });
|
|
10776
|
+
return {
|
|
10777
|
+
async read(bytes) {
|
|
10778
|
+
ctx.bound("compressedBytes", bytes.length);
|
|
10779
|
+
const archive = await codec.readZipArchive(bytes, { ...limits, maxArchiveBytes: ctx.limits.compressedBytes }, signal);
|
|
10780
|
+
ctx.charge("parts", archive.entries.length);
|
|
10781
|
+
const parts = /* @__PURE__ */ new Map();
|
|
10782
|
+
for (const entry of archive.entries) {
|
|
10783
|
+
if (entry.symlink || entry.name.includes("\\") || entry.name.includes(":")) odtFailure(ctx, "Unsafe ODT package member");
|
|
10784
|
+
const chunks = [];
|
|
10785
|
+
let size = 0;
|
|
10786
|
+
for await (const chunk of codec.decodeZipEntry(entry, limits, signal)) {
|
|
10787
|
+
ctx.charge("expandedBytes", chunk.length);
|
|
10788
|
+
ctx.charge("retainedBytes", chunk.length * 2);
|
|
10789
|
+
chunks.push(chunk);
|
|
10790
|
+
size += chunk.length;
|
|
10791
|
+
}
|
|
10792
|
+
if (entry.directory) continue;
|
|
10793
|
+
const data = new Uint8Array(size);
|
|
10794
|
+
let offset = 0;
|
|
10795
|
+
for (const chunk of chunks) {
|
|
10796
|
+
data.set(chunk, offset);
|
|
10797
|
+
offset += chunk.length;
|
|
10798
|
+
}
|
|
10799
|
+
parts.set(entry.name, data);
|
|
10800
|
+
}
|
|
10801
|
+
if (new TextDecoder().decode(parts.get("mimetype")) !== odtMime) odtFailure(ctx, "Invalid or missing ODT mimetype");
|
|
10802
|
+
return parts;
|
|
10803
|
+
},
|
|
10804
|
+
async write(parts) {
|
|
10805
|
+
const entries = [];
|
|
10806
|
+
for (const [name, bytes] of parts) {
|
|
10807
|
+
ctx.charge("parts", 1);
|
|
10808
|
+
ctx.charge("expandedBytes", bytes.length);
|
|
10809
|
+
ctx.charge("retainedBytes", bytes.length);
|
|
10810
|
+
const entry = await codec.makeZipEntry(name, bytes, { modified: /* @__PURE__ */ new Date("1980-01-01T00:00:00Z"), mode: 33188, directory: false, symlink: false, compression: "store" }, limits, signal);
|
|
10811
|
+
if (name === "mimetype") {
|
|
10812
|
+
entry.localExtra = new Uint8Array();
|
|
10813
|
+
entry.centralExtra = new Uint8Array();
|
|
10814
|
+
}
|
|
10815
|
+
entries.push(entry);
|
|
10816
|
+
}
|
|
10817
|
+
return codec.writeZipArchive({ entries, comment: new Uint8Array() }, { ...limits, maxArchiveBytes: ctx.limits.outputBytes }, signal);
|
|
10818
|
+
}
|
|
10819
|
+
};
|
|
10820
|
+
}
|
|
10821
|
+
var attr3 = ["", [], []];
|
|
10822
|
+
var odtReader = { format: "odt", async read(input, ctx) {
|
|
10823
|
+
const parts = await odtPackage(ctx).read(input.bytes);
|
|
10824
|
+
const source = parts.get("content.xml") ?? odtFailure(ctx, "Missing ODT content.xml");
|
|
10825
|
+
const root = await parseOdtXml(source, ctx);
|
|
10826
|
+
if (root.uri !== odtNamespaces.office || root.name !== "document-content") odtFailure(ctx, "Invalid ODT content root");
|
|
10827
|
+
const bodies = odtChildren(root, "body", odtNamespaces.office).flatMap((body) => odtChildren(body, "text", odtNamespaces.office));
|
|
10828
|
+
if (bodies.length !== 1) odtFailure(ctx, "Expected one ODT text body");
|
|
10829
|
+
const styles = /* @__PURE__ */ new Map();
|
|
10830
|
+
const resources = /* @__PURE__ */ new Map();
|
|
10831
|
+
const collectStyles = (node) => {
|
|
10832
|
+
ctx.checkpoint();
|
|
10833
|
+
if (node.uri === odtNamespaces.style && node.name === "style" || node.uri === odtNamespaces.text && node.name === "list-style") styles.set(odtAttribute(node, "name", odtNamespaces.style), node);
|
|
10834
|
+
for (const child of node.children) if (typeof child !== "string") collectStyles(child);
|
|
10835
|
+
};
|
|
10836
|
+
if (parts.has("styles.xml")) collectStyles(await parseOdtXml(parts.get("styles.xml"), ctx));
|
|
10837
|
+
collectStyles(root);
|
|
10838
|
+
const styleChain = (name) => {
|
|
10839
|
+
const names = /* @__PURE__ */ new Set();
|
|
10840
|
+
while (name) {
|
|
10841
|
+
ctx.checkpoint();
|
|
10842
|
+
ctx.bound("depth", names.size + 1);
|
|
10843
|
+
if (names.has(name)) odtFailure(ctx, "Cyclic ODT style inheritance");
|
|
10844
|
+
names.add(name);
|
|
10845
|
+
const style = styles.get(name);
|
|
10846
|
+
name = style ? odtAttribute(style, "parent-style-name", odtNamespaces.style) : "";
|
|
10847
|
+
}
|
|
10848
|
+
return [...names];
|
|
10849
|
+
};
|
|
10850
|
+
const properties = (name) => {
|
|
10851
|
+
const result = /* @__PURE__ */ new Map();
|
|
10852
|
+
for (const parent of styleChain(name).reverse()) {
|
|
10853
|
+
const style = styles.get(parent);
|
|
10854
|
+
if (!style) continue;
|
|
10855
|
+
for (const child of odtChildren(style, "text-properties", odtNamespaces.style)) for (const prop of child.attrs) result.set(`${prop.uri}:${prop.name}`, prop.value);
|
|
10856
|
+
}
|
|
10857
|
+
return result;
|
|
10858
|
+
};
|
|
10859
|
+
const plainText = (node) => {
|
|
10860
|
+
ctx.checkpoint();
|
|
10861
|
+
return node.children.map((child) => typeof child === "string" ? child : plainText(child)).join("");
|
|
10862
|
+
};
|
|
10863
|
+
const count = (value, maximum) => {
|
|
10864
|
+
const n = value ? Number(value) : 1;
|
|
10865
|
+
if (!Number.isSafeInteger(n) || n < 1) odtFailure(ctx, "Invalid ODT repetition count");
|
|
10866
|
+
if (n > maximum) odtFailure(ctx, "ODT repetition limit exceeded", "E_LIMIT");
|
|
10867
|
+
ctx.checkpoint(n);
|
|
10868
|
+
return n;
|
|
10869
|
+
};
|
|
10870
|
+
const inlines2 = (nodes) => {
|
|
10871
|
+
const result = [];
|
|
10872
|
+
for (const node of nodes) {
|
|
10873
|
+
ctx.checkpoint();
|
|
10874
|
+
if (typeof node === "string") {
|
|
10875
|
+
if (node) result.push({ t: "Str", c: node });
|
|
10876
|
+
continue;
|
|
10877
|
+
}
|
|
10878
|
+
if (node.uri === odtNamespaces.text) {
|
|
10879
|
+
if (node.name === "s") {
|
|
10880
|
+
const n = count(odtAttribute(node, "c", odtNamespaces.text), ctx.limits.text);
|
|
10881
|
+
ctx.charge("retainedBytes", n * 2);
|
|
10882
|
+
result.push({ t: "Str", c: " ".repeat(n) });
|
|
10883
|
+
} else if (node.name === "tab") result.push({ t: "Str", c: " " });
|
|
10884
|
+
else if (node.name === "line-break") result.push({ t: "LineBreak" });
|
|
10885
|
+
else if (node.name === "a") result.push({ t: "Link", c: [attr3, inlines2(node.children), [odtAttribute(node, "href", xlink), ""]] });
|
|
10886
|
+
else if (node.name === "span") {
|
|
10887
|
+
let content2 = inlines2(node.children);
|
|
10888
|
+
const props = properties(odtAttribute(node, "style-name", odtNamespaces.text));
|
|
10889
|
+
const tags = [
|
|
10890
|
+
{ tag: "Strong", enabled: props.get(`${fo}:font-weight`) === "bold" },
|
|
10891
|
+
{ tag: "Emph", enabled: props.get(`${fo}:font-style`) === "italic" },
|
|
10892
|
+
{ tag: "Strikeout", enabled: ["solid", "double"].includes(props.get(`${odtNamespaces.style}:text-line-through-style`) ?? "") },
|
|
10893
|
+
{ tag: "Superscript", enabled: props.get(`${odtNamespaces.style}:text-position`)?.startsWith("super") ?? false },
|
|
10894
|
+
{ tag: "Subscript", enabled: props.get(`${odtNamespaces.style}:text-position`)?.startsWith("sub") ?? false },
|
|
10895
|
+
{ tag: "Underline", enabled: props.get(`${odtNamespaces.style}:text-underline-style`) === "solid" },
|
|
10896
|
+
{ tag: "SmallCaps", enabled: props.get(`${fo}:font-variant`) === "small-caps" }
|
|
10897
|
+
];
|
|
10898
|
+
for (const { tag, enabled } of tags) if (enabled) content2 = [{ t: tag, c: content2 }];
|
|
10899
|
+
result.push(...content2);
|
|
10900
|
+
} else if (["bookmark", "bookmark-start"].includes(node.name)) result.push({ t: "Span", c: [[odtAttribute(node, "name", odtNamespaces.text), [], []], []] });
|
|
10901
|
+
else if (!["bookmark-end", "soft-page-break"].includes(node.name)) odtFailure(ctx, `Unsupported ODT inline: ${node.name}`, "E_UNSUPPORTED_FEATURE");
|
|
10902
|
+
} else if (node.uri === odtNamespaces.draw && node.name === "frame") {
|
|
10903
|
+
const image = odtChildren(node, "image", odtNamespaces.draw)[0];
|
|
10904
|
+
if (!image) odtFailure(ctx, "Unsupported ODT drawing", "E_UNSUPPORTED_FEATURE");
|
|
10905
|
+
let name;
|
|
10906
|
+
try {
|
|
10907
|
+
name = decodeURIComponent(odtAttribute(image, "href", xlink));
|
|
10908
|
+
} catch {
|
|
10909
|
+
return odtFailure(ctx, "Invalid ODT image URI", "E_RESOURCE");
|
|
10910
|
+
}
|
|
10911
|
+
if (name.startsWith("./")) name = name.slice(2);
|
|
10912
|
+
if (!name || name.startsWith("/") || name.includes(":") || name.includes("\\") || name.split("/").some((part) => !part || part === "." || part === "..")) odtFailure(ctx, "Unsafe ODT image reference", "E_RESOURCE");
|
|
10913
|
+
const bytes = parts.get(name) ?? odtFailure(ctx, `Missing ODT image: ${name}`, "E_RESOURCE");
|
|
10914
|
+
if (!resources.has(name)) {
|
|
10915
|
+
ctx.charge("resourceBytes", bytes.length);
|
|
10916
|
+
resources.set(name, { id: name, bytes });
|
|
10917
|
+
}
|
|
10918
|
+
const attributes = [];
|
|
10919
|
+
for (const dimension of ["width", "height"]) {
|
|
10920
|
+
const value = odtAttribute(node, dimension, svg);
|
|
10921
|
+
if (value) attributes.push([dimension, value]);
|
|
10922
|
+
}
|
|
10923
|
+
result.push({ t: "Image", c: [["", [], attributes], [{ t: "Str", c: odtChildren(node, "desc", svg).map(plainText).join("") }], [name, odtChildren(node, "title", svg).map(plainText).join("")]] });
|
|
10924
|
+
} else odtFailure(ctx, `Unsupported ODT inline namespace: ${node.uri}`, "E_UNSUPPORTED_FEATURE");
|
|
10925
|
+
}
|
|
10926
|
+
return result;
|
|
10927
|
+
};
|
|
10928
|
+
const blocks3 = async (nodes, listLevel = 1) => {
|
|
10929
|
+
const result = [];
|
|
10930
|
+
for (const node of nodes) {
|
|
10931
|
+
await ctx.cooperate();
|
|
10932
|
+
if (typeof node === "string") {
|
|
10933
|
+
if (node.trim()) odtFailure(ctx, "Text outside ODT paragraph");
|
|
10934
|
+
continue;
|
|
10935
|
+
}
|
|
10936
|
+
if (node.uri === odtNamespaces.text && ["p", "h"].includes(node.name)) {
|
|
10937
|
+
const content2 = inlines2(node.children), names = styleChain(odtAttribute(node, "style-name", odtNamespaces.text));
|
|
10938
|
+
if (node.name === "h") result.push({ t: "Header", c: [count(odtAttribute(node, "outline-level", odtNamespaces.text), 6), attr3, content2] });
|
|
10939
|
+
else if (names.includes("Rule")) result.push({ t: "HorizontalRule" });
|
|
10940
|
+
else if (names.includes("Preformatted")) result.push({ t: "CodeBlock", c: [attr3, content2.map((n) => n.t === "Str" ? n.c : n.t === "LineBreak" ? "\n" : n.t === "Space" ? " " : "").join("")] });
|
|
10941
|
+
else if (names.some((name) => ["Quote", "Quotations"].includes(name))) result.push({ t: "BlockQuote", c: [{ t: "Para", c: content2 }] });
|
|
10942
|
+
else result.push({ t: "Para", c: content2 });
|
|
10943
|
+
} else if (node.uri === odtNamespaces.text && node.name === "section") result.push({ t: "Div", c: [[odtAttribute(node, "name", odtNamespaces.text), [], []], await blocks3(node.children, listLevel)] });
|
|
10944
|
+
else if (node.uri === odtNamespaces.text && node.name === "list") {
|
|
10945
|
+
const style = styles.get(odtAttribute(node, "style-name", odtNamespaces.text));
|
|
10946
|
+
const level = style?.children.find((child) => typeof child !== "string" && child.uri === odtNamespaces.text && Number(odtAttribute(child, "level", odtNamespaces.text)) === listLevel);
|
|
10947
|
+
const items = odtChildren(node, "list-item", odtNamespaces.text), content2 = [];
|
|
10948
|
+
for (const item of items) content2.push(await blocks3(item.children, listLevel + 1));
|
|
10949
|
+
if (level?.name === "list-level-style-number") {
|
|
10950
|
+
const start = count(items[0] && odtAttribute(items[0], "start-value", odtNamespaces.text) || odtAttribute(level, "start-value", odtNamespaces.text), Number.MAX_SAFE_INTEGER);
|
|
10951
|
+
const style2 = { "1": "Decimal", a: "LowerAlpha", A: "UpperAlpha", i: "LowerRoman", I: "UpperRoman" }[odtAttribute(level, "num-format", odtNamespaces.style)] ?? "Decimal";
|
|
10952
|
+
result.push({ t: "OrderedList", c: [[start, style2, odtAttribute(level, "num-prefix", odtNamespaces.style) === "(" ? "TwoParens" : odtAttribute(level, "num-suffix", odtNamespaces.style) === ")" ? "OneParen" : "Period"], content2] });
|
|
10953
|
+
} else result.push({ t: "BulletList", c: content2 });
|
|
10954
|
+
} else if (node.uri === odtNamespaces.table && node.name === "table") {
|
|
10955
|
+
const head2 = [], rows = [];
|
|
10956
|
+
const rowNodes = node.children.flatMap((child) => typeof child === "string" ? [] : child.uri === odtNamespaces.table && child.name === "table-header-rows" ? odtChildren(child, "table-row", odtNamespaces.table).map((row2) => ({ row: row2, header: true })) : child.uri === odtNamespaces.table && child.name === "table-row" ? [{ row: child, header: false }] : []);
|
|
10957
|
+
let columns = 0;
|
|
10958
|
+
for (const { row: row2, header } of rowNodes) {
|
|
10959
|
+
const cells = [];
|
|
10960
|
+
for (const cell2 of odtChildren(row2, "table-cell", odtNamespaces.table)) {
|
|
10961
|
+
if (count(odtAttribute(cell2, "number-columns-spanned", odtNamespaces.table), ctx.limits.tableColumns) !== 1 || count(odtAttribute(cell2, "number-rows-spanned", odtNamespaces.table), ctx.limits.tableRows) !== 1) odtFailure(ctx, "ODT table spans are unsupported", "E_UNSUPPORTED_FEATURE");
|
|
10962
|
+
const repeat2 = count(odtAttribute(cell2, "number-columns-repeated", odtNamespaces.table), ctx.limits.tableColumns);
|
|
10963
|
+
const content2 = await blocks3(cell2.children);
|
|
10964
|
+
for (let i = 0; i < repeat2; i++) {
|
|
10965
|
+
ctx.charge("tableCells", 1);
|
|
10966
|
+
cells.push([attr3, "AlignDefault", 1, 1, content2]);
|
|
10967
|
+
}
|
|
10968
|
+
ctx.bound("tableColumns", cells.length);
|
|
10969
|
+
}
|
|
10970
|
+
columns = Math.max(columns, cells.length);
|
|
10971
|
+
const repeat = count(odtAttribute(row2, "number-rows-repeated", odtNamespaces.table), ctx.limits.tableRows);
|
|
10972
|
+
ctx.charge("tableCells", (repeat - 1) * cells.length);
|
|
10973
|
+
for (let i = 0; i < repeat; i++) (header ? head2 : rows).push([attr3, cells]);
|
|
10974
|
+
ctx.bound("tableRows", head2.length + rows.length);
|
|
10975
|
+
}
|
|
10976
|
+
const specs = Array.from({ length: columns }, () => ["AlignDefault", { t: "ColWidthDefault" }]);
|
|
10977
|
+
result.push({ t: "Table", c: [attr3, [null, []], specs, [attr3, head2], [[attr3, 0, [], rows]], [attr3, []]] });
|
|
10978
|
+
} else if (!(node.uri === odtNamespaces.text && ["sequence-decls", "tracked-changes"].includes(node.name))) odtFailure(ctx, `Unsupported ODT block: ${node.name}`, "E_UNSUPPORTED_FEATURE");
|
|
10979
|
+
}
|
|
10980
|
+
return result;
|
|
10981
|
+
};
|
|
10982
|
+
const metadata2 = {};
|
|
10983
|
+
if (parts.has("meta.xml")) {
|
|
10984
|
+
const meta2 = await parseOdtXml(parts.get("meta.xml"), ctx);
|
|
10985
|
+
for (const container of odtChildren(meta2, "meta", odtNamespaces.office)) for (const title of odtChildren(container, "title", "http://purl.org/dc/elements/1.1/")) metadata2.title = { t: "MetaString", c: plainText(title) };
|
|
10986
|
+
}
|
|
10987
|
+
const content = await blocks3(bodies[0].children);
|
|
10988
|
+
return { blocks: content, metadata: metadata2, resources: [...resources.values()] };
|
|
10989
|
+
} };
|
|
10990
|
+
var odtWriter = { format: "odt", imageResources: "embed", async write(document, ctx) {
|
|
10991
|
+
const parts = /* @__PURE__ */ new Map([["mimetype", new TextEncoder().encode(odtMime)]]);
|
|
10992
|
+
const mediaTypes = /* @__PURE__ */ new Map();
|
|
10993
|
+
const images = /* @__PURE__ */ new Map();
|
|
10994
|
+
const styles = /* @__PURE__ */ new Map();
|
|
10995
|
+
let serial = 0;
|
|
10996
|
+
const escaped = (value) => {
|
|
10997
|
+
ctx.checkpoint(value.length);
|
|
10998
|
+
for (const ch of value) {
|
|
10999
|
+
const code = ch.codePointAt(0);
|
|
11000
|
+
if (code < 32 && ![9, 10, 13].includes(code) || code === 65534 || code === 65535) odtFailure(ctx, "Invalid XML character");
|
|
11001
|
+
}
|
|
11002
|
+
const result = encodeXML(value);
|
|
11003
|
+
ctx.charge("retainedBytes", result.length * 2);
|
|
11004
|
+
return result;
|
|
11005
|
+
};
|
|
11006
|
+
const text = (value) => escaped(value).split(" ").join("<text:s/>").split(" ").join("<text:tab/>").split("\n").join("<text:line-break/>");
|
|
11007
|
+
const textStyles = { Strong: 'fo:font-weight="bold"', Emph: 'fo:font-style="italic"', Strikeout: 'style:text-line-through-style="solid"', Superscript: 'style:text-position="super 58%"', Subscript: 'style:text-position="sub 58%"', Underline: 'style:text-underline-style="solid"', SmallCaps: 'fo:font-variant="small-caps"', Code: 'fo:font-family="monospace"' };
|
|
11008
|
+
for (const [name, properties] of Object.entries(textStyles)) styles.set(name, `<style:style style:name="${name}" style:family="text"><style:text-properties ${properties}/></style:style>`);
|
|
11009
|
+
styles.set("Rule", '<style:style style:name="Rule" style:family="paragraph"><style:paragraph-properties fo:border-bottom="0.5pt solid #000000"/></style:style>');
|
|
11010
|
+
styles.set("Preformatted", '<style:style style:name="Preformatted" style:family="paragraph"><style:text-properties fo:font-family="monospace"/></style:style>');
|
|
11011
|
+
const inlines2 = async (nodes) => {
|
|
11012
|
+
const output = [];
|
|
11013
|
+
for (const node of nodes) {
|
|
11014
|
+
await ctx.cooperate();
|
|
11015
|
+
switch (node.t) {
|
|
11016
|
+
case "Str":
|
|
11017
|
+
output.push(text(node.c));
|
|
11018
|
+
break;
|
|
11019
|
+
case "Space":
|
|
11020
|
+
case "SoftBreak":
|
|
11021
|
+
output.push("<text:s/>");
|
|
11022
|
+
break;
|
|
11023
|
+
case "LineBreak":
|
|
11024
|
+
output.push("<text:line-break/>");
|
|
11025
|
+
break;
|
|
11026
|
+
case "Strong":
|
|
11027
|
+
case "Emph":
|
|
11028
|
+
case "Strikeout":
|
|
11029
|
+
case "Superscript":
|
|
11030
|
+
case "Subscript":
|
|
11031
|
+
case "Underline":
|
|
11032
|
+
case "SmallCaps":
|
|
11033
|
+
output.push(`<text:span text:style-name="${node.t}">${await inlines2(node.c)}</text:span>`);
|
|
11034
|
+
break;
|
|
11035
|
+
case "Code":
|
|
11036
|
+
output.push(`<text:span text:style-name="Code">${text(node.c[1])}</text:span>`);
|
|
11037
|
+
break;
|
|
11038
|
+
case "Span":
|
|
11039
|
+
output.push(await inlines2(node.c[1]));
|
|
11040
|
+
break;
|
|
11041
|
+
case "Quoted":
|
|
11042
|
+
output.push((node.c[0] === "SingleQuote" ? "\u2018" : "\u201C") + await inlines2(node.c[1]) + (node.c[0] === "SingleQuote" ? "\u2019" : "\u201D"));
|
|
11043
|
+
break;
|
|
11044
|
+
case "Link":
|
|
11045
|
+
output.push(`<text:a xlink:type="simple" xlink:href="${escaped(node.c[2][0])}">${await inlines2(node.c[1])}</text:a>`);
|
|
11046
|
+
break;
|
|
11047
|
+
case "Image": {
|
|
11048
|
+
const source = node.c[2][0];
|
|
11049
|
+
let image = images.get(source);
|
|
11050
|
+
ctx.charge("images", 1);
|
|
11051
|
+
if (!image) {
|
|
11052
|
+
const bytes = document.resources.find((r) => r.id === source)?.bytes ?? await ctx.resources?.resolve(source, void 0, ctx.signal);
|
|
11053
|
+
if (!bytes) odtFailure(ctx, `Missing image resource: ${source}`, "E_RESOURCE");
|
|
11054
|
+
ctx.charge("resourceBytes", bytes.length);
|
|
11055
|
+
const { Image, DocumentBudget } = await import("./src-ICMQISAA.js");
|
|
11056
|
+
const asset = await Image.from_blob(bytes, { signal: ctx.signal ?? new AbortController().signal, budget: new DocumentBudget({ embeddedMediaBytes: ctx.limits.resourceBytes, retainedBytes: ctx.limits.retainedBytes, work: ctx.limits.work }) });
|
|
11057
|
+
image = { name: `Pictures/image-${images.size + 1}.${asset.ext}`, width: asset.width.emu, height: asset.height.emu };
|
|
11058
|
+
images.set(source, image);
|
|
11059
|
+
parts.set(image.name, bytes);
|
|
11060
|
+
mediaTypes.set(image.name, asset.content_type);
|
|
11061
|
+
}
|
|
11062
|
+
const attrs = Object.fromEntries(node.c[0][2]);
|
|
11063
|
+
let width = imageLength(attrs.width, image.width, ctx, "odt"), height = imageLength(attrs.height, image.height, ctx, "odt");
|
|
11064
|
+
if (attrs.width && !attrs.height) height = width * image.height / image.width;
|
|
11065
|
+
if (attrs.height && !attrs.width) width = height * image.width / image.height;
|
|
11066
|
+
output.push(`<draw:frame draw:name="Image${++serial}" text:anchor-type="as-char" svg:width="${width / 914400}in" svg:height="${height / 914400}in"><draw:image xlink:href="${image.name}" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/><svg:title>${escaped(node.c[2][1])}</svg:title><svg:desc>${escaped(node.c[1].map((n) => n.t === "Str" ? n.c : n.t === "Space" ? " " : "").join(""))}</svg:desc></draw:frame>`);
|
|
11067
|
+
break;
|
|
11068
|
+
}
|
|
11069
|
+
default:
|
|
11070
|
+
odtFailure(ctx, `Unsupported ODT inline: ${node.t}`, "E_UNSUPPORTED_FEATURE");
|
|
11071
|
+
}
|
|
11072
|
+
}
|
|
11073
|
+
return output.join("");
|
|
11074
|
+
};
|
|
11075
|
+
const blocks3 = async (nodes, paragraphStyle = "", listLevel = 1) => {
|
|
11076
|
+
const output = [];
|
|
11077
|
+
for (const node of nodes) {
|
|
11078
|
+
await ctx.cooperate();
|
|
11079
|
+
switch (node.t) {
|
|
11080
|
+
case "Para":
|
|
11081
|
+
case "Plain":
|
|
11082
|
+
output.push(`<text:p${paragraphStyle ? ` text:style-name="${paragraphStyle}"` : ""}>${await inlines2(node.c)}</text:p>`);
|
|
11083
|
+
break;
|
|
11084
|
+
case "Header":
|
|
11085
|
+
output.push(`<text:h text:outline-level="${node.c[0]}">${await inlines2(node.c[2])}</text:h>`);
|
|
11086
|
+
break;
|
|
11087
|
+
case "CodeBlock":
|
|
11088
|
+
output.push(`<text:p text:style-name="Preformatted">${text(node.c[1])}</text:p>`);
|
|
11089
|
+
break;
|
|
11090
|
+
case "BlockQuote":
|
|
11091
|
+
output.push(await blocks3(node.c, "Quotations", listLevel));
|
|
11092
|
+
break;
|
|
11093
|
+
case "HorizontalRule":
|
|
11094
|
+
output.push('<text:p text:style-name="Rule"/>');
|
|
11095
|
+
break;
|
|
11096
|
+
case "Div":
|
|
11097
|
+
output.push(`<text:section text:name="${escaped(node.c[0][0] || `Section${++serial}`)}">${await blocks3(node.c[1], paragraphStyle, listLevel)}</text:section>`);
|
|
11098
|
+
break;
|
|
11099
|
+
case "BulletList":
|
|
11100
|
+
case "OrderedList": {
|
|
11101
|
+
const name = `List${++serial}`, ordered = node.t === "OrderedList";
|
|
11102
|
+
const format2 = ordered ? { DefaultStyle: "1", Decimal: "1", LowerAlpha: "a", UpperAlpha: "A", LowerRoman: "i", UpperRoman: "I" }[node.c[0][1]] : void 0;
|
|
11103
|
+
if (ordered && !format2) odtFailure(ctx, "Unsupported ODT list style", "E_UNSUPPORTED_FEATURE");
|
|
11104
|
+
styles.set(name, `<text:list-style style:name="${name}">${ordered ? `<text:list-level-style-number text:level="${listLevel}" style:num-format="${format2}" text:start-value="${node.c[0][0]}" style:num-prefix="${node.c[0][2] === "TwoParens" ? "(" : ""}" style:num-suffix="${["OneParen", "TwoParens"].includes(node.c[0][2]) ? ")" : "."}"/>` : `<text:list-level-style-bullet text:level="${listLevel}" text:bullet-char="\u2022"/>`}</text:list-style>`);
|
|
11105
|
+
const items = [];
|
|
11106
|
+
for (const item of ordered ? node.c[1] : node.c) items.push(`<text:list-item>${await blocks3(item, paragraphStyle, listLevel + 1)}</text:list-item>`);
|
|
11107
|
+
output.push(`<text:list text:style-name="${name}">${items.join("")}</text:list>`);
|
|
11108
|
+
break;
|
|
11109
|
+
}
|
|
11110
|
+
case "Table": {
|
|
11111
|
+
output.push(await blocks3(node.c[1][1]));
|
|
11112
|
+
if (!node.c[1][1].length && node.c[1][0]) output.push(`<text:p>${await inlines2(node.c[1][0])}</text:p>`);
|
|
11113
|
+
output.push(`<table:table table:name="Table${++serial}"><table:table-column table:number-columns-repeated="${node.c[2].length}"/>`);
|
|
11114
|
+
for (const [rows, header] of [[node.c[3][1], true], [node.c[4].flatMap((body) => [...body[2], ...body[3]]), false], [node.c[5][1], false]]) {
|
|
11115
|
+
if (header && rows.length) output.push("<table:table-header-rows>");
|
|
11116
|
+
for (const row2 of rows) {
|
|
11117
|
+
output.push("<table:table-row>");
|
|
11118
|
+
for (const cell2 of row2[1]) {
|
|
11119
|
+
if (cell2[2] !== 1 || cell2[3] !== 1) odtFailure(ctx, "ODT table spans are unsupported", "E_UNSUPPORTED_FEATURE");
|
|
11120
|
+
output.push(`<table:table-cell office:value-type="string">${await blocks3(cell2[4], header ? "Table_20_Heading" : "Table_20_Contents")}</table:table-cell>`);
|
|
11121
|
+
}
|
|
11122
|
+
output.push("</table:table-row>");
|
|
11123
|
+
}
|
|
11124
|
+
if (header && rows.length) output.push("</table:table-header-rows>");
|
|
11125
|
+
}
|
|
11126
|
+
output.push("</table:table>");
|
|
11127
|
+
break;
|
|
11128
|
+
}
|
|
11129
|
+
default:
|
|
11130
|
+
odtFailure(ctx, `Unsupported ODT block: ${node.t}`, "E_UNSUPPORTED_FEATURE");
|
|
11131
|
+
}
|
|
11132
|
+
}
|
|
11133
|
+
const value = output.join("");
|
|
11134
|
+
ctx.bound("outputBytes", value.length);
|
|
11135
|
+
ctx.charge("retainedBytes", value.length * 2);
|
|
11136
|
+
return value;
|
|
11137
|
+
};
|
|
11138
|
+
const content = await blocks3(document.blocks);
|
|
11139
|
+
const namespaces2 = Object.entries(odtNamespaces).map(([key, value]) => `xmlns:${key}="${value}"`).join(" ") + ` xmlns:fo="${fo}" xmlns:xlink="${xlink}" xmlns:svg="${svg}"`;
|
|
11140
|
+
const put = (name, xml) => {
|
|
11141
|
+
ctx.bound("outputBytes", xml.length);
|
|
11142
|
+
parts.set(name, new TextEncoder().encode(xml));
|
|
11143
|
+
};
|
|
11144
|
+
put("content.xml", `<?xml version="1.0" encoding="UTF-8"?><office:document-content ${namespaces2} office:version="1.3"><office:automatic-styles>${[...styles.values()].join("")}</office:automatic-styles><office:body><office:text>${content}</office:text></office:body></office:document-content>`);
|
|
11145
|
+
put("styles.xml", `<?xml version="1.0"?><office:document-styles ${namespaces2} office:version="1.3"><office:styles><style:style style:name="Standard" style:family="paragraph"/><style:style style:name="Quotations" style:family="paragraph" style:parent-style-name="Standard" style:class="html"><style:paragraph-properties fo:margin-left="0.5in" fo:margin-right="0.5in"/></style:style><style:style style:name="Table_20_Contents" style:display-name="Table Contents" style:family="paragraph" style:parent-style-name="Standard"/><style:style style:name="Table_20_Heading" style:display-name="Table Heading" style:family="paragraph" style:parent-style-name="Table_20_Contents"><style:text-properties fo:font-weight="bold"/></style:style></office:styles></office:document-styles>`);
|
|
11146
|
+
const title = document.metadata.title;
|
|
11147
|
+
put("meta.xml", `<?xml version="1.0"?><office:document-meta xmlns:office="${odtNamespaces.office}" xmlns:dc="http://purl.org/dc/elements/1.1/" office:version="1.3"><office:meta>${title?.t === "MetaString" ? `<dc:title>${escaped(title.c)}</dc:title>` : ""}</office:meta></office:document-meta>`);
|
|
11148
|
+
put("META-INF/manifest.xml", `<?xml version="1.0"?><manifest:manifest xmlns:manifest="${odtNamespaces.manifest}" manifest:version="1.3"><manifest:file-entry manifest:full-path="/" manifest:media-type="${odtMime}"/>${[...parts.keys()].filter((name) => name !== "mimetype").map((name) => `<manifest:file-entry manifest:full-path="${name}" manifest:media-type="${mediaTypes.get(name) ?? "text/xml"}"/>`).join("")}</manifest:manifest>`);
|
|
11149
|
+
return { kind: "binary", bytes: await odtPackage(ctx).write(parts) };
|
|
11150
|
+
} };
|
|
11151
|
+
var odt_default = {
|
|
11152
|
+
name: "odt",
|
|
11153
|
+
reader: odtReader,
|
|
11154
|
+
writer: odtWriter,
|
|
11155
|
+
read: true,
|
|
11156
|
+
write: true,
|
|
11157
|
+
media: "binary",
|
|
11158
|
+
inputEncoding: "bytes",
|
|
11159
|
+
suffixes: ["odt"],
|
|
11160
|
+
extensions: {},
|
|
11161
|
+
options: { read: [], write: ["standalone"] },
|
|
11162
|
+
inputBudget: "compressedBytes"
|
|
11163
|
+
};
|
|
10646
11164
|
var pptx_default = {
|
|
10647
11165
|
name: "pptx",
|
|
10648
11166
|
read: true,
|
|
@@ -10653,7 +11171,7 @@ var pptx_default = {
|
|
|
10653
11171
|
format: "pptx",
|
|
10654
11172
|
async read(input, context, selection) {
|
|
10655
11173
|
context.signal?.throwIfAborted();
|
|
10656
|
-
const { pptxReader } = await import("./pptx-
|
|
11174
|
+
const { pptxReader } = await import("./pptx-7G52EJ6L-4JACH5FB.js");
|
|
10657
11175
|
context.signal?.throwIfAborted();
|
|
10658
11176
|
return pptxReader.read(input, context, selection);
|
|
10659
11177
|
}
|
|
@@ -10662,7 +11180,7 @@ var pptx_default = {
|
|
|
10662
11180
|
format: "pptx",
|
|
10663
11181
|
async write(document, context, selection) {
|
|
10664
11182
|
context.signal?.throwIfAborted();
|
|
10665
|
-
const { pptxWriter } = await import("./pptx-
|
|
11183
|
+
const { pptxWriter } = await import("./pptx-7G52EJ6L-4JACH5FB.js");
|
|
10666
11184
|
context.signal?.throwIfAborted();
|
|
10667
11185
|
return pptxWriter.write(document, context, selection);
|
|
10668
11186
|
}
|
|
@@ -10674,7 +11192,7 @@ var pptx_default = {
|
|
|
10674
11192
|
write: ["standalone"]
|
|
10675
11193
|
}
|
|
10676
11194
|
};
|
|
10677
|
-
var
|
|
11195
|
+
var attr4 = ["", [], []];
|
|
10678
11196
|
var xlsxReader = { format: "xlsx", async read(input, ctx) {
|
|
10679
11197
|
const l = ctx.limits;
|
|
10680
11198
|
const context = {
|
|
@@ -10709,7 +11227,7 @@ var xlsxReader = { format: "xlsx", async read(input, ctx) {
|
|
|
10709
11227
|
ctx.bound("nodes", ++nodes);
|
|
10710
11228
|
const title = await literalInlines(sheet.name, ctx, nodes);
|
|
10711
11229
|
nodes += title.length;
|
|
10712
|
-
blocks3.push({ t: "Header", c: [1,
|
|
11230
|
+
blocks3.push({ t: "Header", c: [1, attr4, title] });
|
|
10713
11231
|
if (!sheet.cells.length) continue;
|
|
10714
11232
|
let height = 0, width = 0;
|
|
10715
11233
|
for (const cell2 of sheet.cells) {
|
|
@@ -10734,13 +11252,13 @@ var xlsxReader = { format: "xlsx", async read(input, ctx) {
|
|
|
10734
11252
|
const inlines2 = await literalInlines(text, ctx, nodes);
|
|
10735
11253
|
nodes += inlines2.length;
|
|
10736
11254
|
if (inlines2.length) ctx.bound("nodes", ++nodes);
|
|
10737
|
-
row2.push([
|
|
11255
|
+
row2.push([attr4, "AlignDefault", 1, 1, inlines2.length ? [{ t: "Plain", c: inlines2 }] : []]);
|
|
10738
11256
|
}
|
|
10739
|
-
rows.push([
|
|
11257
|
+
rows.push([attr4, row2]);
|
|
10740
11258
|
}
|
|
10741
11259
|
ctx.bound("nodes", ++nodes);
|
|
10742
11260
|
const head2 = rows.shift();
|
|
10743
|
-
blocks3.push({ t: "Table", c: [
|
|
11261
|
+
blocks3.push({ t: "Table", c: [attr4, [null, []], Array.from({ length: width }, () => ["AlignDefault", { t: "ColWidthDefault" }]), [attr4, [head2]], [[attr4, 0, [], rows]], [attr4, []]] });
|
|
10744
11262
|
}
|
|
10745
11263
|
return { blocks: blocks3, metadata: {}, resources: [] };
|
|
10746
11264
|
} catch (error) {
|
|
@@ -10779,6 +11297,7 @@ var coreFormats = [
|
|
|
10779
11297
|
epub_default,
|
|
10780
11298
|
pdf_default,
|
|
10781
11299
|
docx_default,
|
|
11300
|
+
odt_default,
|
|
10782
11301
|
pptx_default,
|
|
10783
11302
|
xlsx_default
|
|
10784
11303
|
];
|
|
@@ -10927,6 +11446,7 @@ var defaultLimits = Object.freeze({
|
|
|
10927
11446
|
resources: Infinity,
|
|
10928
11447
|
diagnostics: Infinity,
|
|
10929
11448
|
references: Infinity,
|
|
11449
|
+
yamlAliases: Infinity,
|
|
10930
11450
|
entities: Infinity,
|
|
10931
11451
|
entityBytes: Infinity,
|
|
10932
11452
|
work: Infinity,
|
|
@@ -19706,9 +20226,28 @@ async function resolveConversionArgs(args, files, signal, context = {}) {
|
|
|
19706
20226
|
if (document.errors.length) execution.fail("E_OPTION", "Invalid YAML defaults");
|
|
19707
20227
|
let value;
|
|
19708
20228
|
try {
|
|
19709
|
-
value = document.toJS({ maxAliasCount:
|
|
19710
|
-
} catch {
|
|
19711
|
-
execution.fail("
|
|
20229
|
+
value = document.toJS({ maxAliasCount: execution.limits.yamlAliases === Infinity ? -1 : execution.limits.yamlAliases });
|
|
20230
|
+
} catch (error) {
|
|
20231
|
+
if (error instanceof ReferenceError && (execution.limits.yamlAliases === 0 || error.message.includes("alias count"))) execution.fail("E_LIMIT", "YAML defaults alias expansion limit exceeded");
|
|
20232
|
+
execution.fail("E_OPTION", "Invalid YAML defaults aliases");
|
|
20233
|
+
}
|
|
20234
|
+
const active = /* @__PURE__ */ new Set(), visited = /* @__PURE__ */ new Set();
|
|
20235
|
+
const pending = [{ value, depth: 0 }];
|
|
20236
|
+
while (pending.length) {
|
|
20237
|
+
const item = pending.pop();
|
|
20238
|
+
if (!item.value || typeof item.value !== "object") continue;
|
|
20239
|
+
if (item.leave) {
|
|
20240
|
+
active.delete(item.value);
|
|
20241
|
+
visited.add(item.value);
|
|
20242
|
+
continue;
|
|
20243
|
+
}
|
|
20244
|
+
if (visited.has(item.value)) continue;
|
|
20245
|
+
if (active.has(item.value)) execution.fail("E_OPTION", "Cyclic YAML defaults are unsupported");
|
|
20246
|
+
await execution.cooperate();
|
|
20247
|
+
execution.bound("depth", item.depth);
|
|
20248
|
+
active.add(item.value);
|
|
20249
|
+
pending.push({ ...item, leave: true });
|
|
20250
|
+
for (const child of Object.values(item.value)) pending.push({ value: child, depth: item.depth + 1 });
|
|
19712
20251
|
}
|
|
19713
20252
|
if (!value || typeof value !== "object" || Array.isArray(value)) execution.fail("E_OPTION", "Defaults must be a YAML map");
|
|
19714
20253
|
for (const [raw, entry] of Object.entries(value)) {
|