@poe-platform/safe-bash 0.1.799 → 0.1.801
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 +48 -22
- package/dist/image-ast/index.browser.js +1503 -98
- package/dist/image-ast/index.js +1503 -98
- 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 +5 -4
- package/dist/safe-bash/chunks/{chunk-LUOFIVNI.js → chunk-3NDIFSNM.js} +3 -3
- package/dist/safe-bash/chunks/chunk-3R3AANOR.js +26 -0
- package/dist/safe-bash/chunks/{chunk-TRVGCN3U.js → chunk-45PK3NWI.js} +4 -4
- package/dist/safe-bash/chunks/{chunk-KHMGTPD6.js → chunk-46Z5E5EV.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-XB3B7KMM.js → chunk-6O77NL2S.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-T3JTVIEP.js → chunk-6PAVEFT3.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-PYVEAFJM.js → chunk-74GHTNJA.js} +3 -2
- package/dist/safe-bash/chunks/{chunk-LQHGH25W.js → chunk-7R5BDCG7.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-WUNK5NXJ.js → chunk-7VNF5BFF.js} +1140 -1660
- package/dist/safe-bash/chunks/{chunk-NHOXKQNE.js → chunk-A7XEHALN.js} +6 -6
- package/dist/safe-bash/chunks/{chunk-MHZ24KEI.js → chunk-AM5ESLPH.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-3L3T6LYV.js → chunk-AUSNDQTJ.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-YG5WAHK7.js → chunk-B7TAL7S5.js} +1 -3
- package/dist/safe-bash/chunks/{chunk-K7IQZE7D.js → chunk-C5OWC2TL.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-F3RV2F72.js → chunk-CHYGPFVM.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-M4CFCXHN.js → chunk-CS4MNM6I.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-H6JW3E4F.js → chunk-CTVWDACF.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-KTGR4U57.js → chunk-D3ANYGMC.js} +2 -3
- package/dist/safe-bash/chunks/{chunk-ENR3HB2B.js → chunk-E7OYNDGL.js} +1 -2
- package/dist/safe-bash/chunks/{chunk-SOZK5JVX.js → chunk-FBUCWVTE.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-NX2SQVON.js → chunk-FNDNHAGE.js} +46 -27
- package/dist/safe-bash/chunks/{chunk-KCVSVD65.js → chunk-I5HZ4FGE.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-KMH2DF3I.js → chunk-ICFDYV64.js} +7 -2
- package/dist/safe-bash/chunks/{chunk-T5KKDMYB.js → chunk-IVRQ4BXL.js} +7 -1
- package/dist/safe-bash/chunks/{chunk-KV7PKOHV.js → chunk-IWDICZVK.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-I4OAEOP6.js → chunk-J42RIHHJ.js} +1 -1
- package/dist/safe-bash/chunks/chunk-K6VCD7IY.js +106 -0
- package/dist/safe-bash/chunks/{chunk-63FXVDGF.js → chunk-LVOBFF4D.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-U5NUZPCC.js → chunk-MHMMRCYC.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-6HZYFL3H.js → chunk-NR3EM4LS.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-VYZTG3GV.js → chunk-NZQXYWA3.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-JSVX4VIA.js → chunk-OQRVVGR6.js} +3 -2
- package/dist/safe-bash/chunks/{chunk-B3DDEDH2.js → chunk-OV6IHKO6.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-SPYL72GN.js → chunk-PQRAK7HU.js} +1196 -5781
- package/dist/safe-bash/chunks/chunk-SZH7EJLD.js +9221 -0
- package/dist/safe-bash/chunks/{chunk-AKC46AF6.js → chunk-TFIBK2GI.js} +8 -41
- package/dist/safe-bash/chunks/{chunk-ZNAFMYIA.js → chunk-UE5KZDEK.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-QU3BVQ53.js → chunk-UTBUUFDM.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-6IBTC4YL.js → chunk-VQDD3G76.js} +93 -39
- package/dist/safe-bash/chunks/{chunk-IUTD5FH5.js → chunk-VTH3MLDU.js} +2 -7
- package/dist/safe-bash/chunks/{chunk-LLZCZ24K.js → chunk-XVOSKJE2.js} +1 -1
- package/dist/safe-bash/chunks/{csvkit-W2UEKH6P.js → csvkit-TACDU7FC.js} +3 -3
- package/dist/safe-bash/chunks/{ffmpeg-42CGASMV.js → ffmpeg-WTC3TEFI.js} +2 -2
- package/dist/safe-bash/chunks/{gh-26GYLH6D.js → gh-6WU6PXL4.js} +2 -2
- package/dist/safe-bash/chunks/{git-YREKMUVD.js → git-EFZIGJW4.js} +2 -2
- package/dist/safe-bash/chunks/{imagemagick-3YIX4XO2.js → imagemagick-EIEYGWPF.js} +2 -2
- package/dist/safe-bash/chunks/{implementation-E3YMKU3Z.js → implementation-MLFHUQ5M.js} +2 -2
- package/dist/safe-bash/chunks/mmdc-ROQJT5HQ.js +118 -0
- package/dist/safe-bash/chunks/{pdfimages-UE2UISP2.js → pdfimages-DW7LWXFI.js} +2 -2
- package/dist/safe-bash/chunks/{pdfinfo-RGARKLI5.js → pdfinfo-TIP6XLUQ.js} +4 -12
- package/dist/safe-bash/chunks/{pdftk-JY3WVCCC.js → pdftk-DMG22ITZ.js} +2 -2
- package/dist/safe-bash/chunks/{pdftoppm-GPD3BMPY.js → pdftoppm-WNDYR72T.js} +2 -2
- package/dist/safe-bash/chunks/{pdftotext-K7GQ2QJZ.js → pdftotext-5IPZ4NI7.js} +2 -2
- package/dist/safe-bash/chunks/{qpdf-F4U7WUSU.js → qpdf-TTX2DIUA.js} +2 -2
- package/dist/safe-bash/chunks/{sips-RWENS7X5.js → sips-XYS46JPJ.js} +2 -2
- package/dist/safe-bash/chunks/{soffice-IT6W2C5F.js → soffice-TU73E5KL.js} +2 -2
- package/dist/safe-bash/chunks/{wkhtmltopdf-JYNDAHIZ.js → wkhtmltopdf-FSZ2CHGE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-QBGA56UH.js → chunk-2ELYGJDD.js} +7 -7
- 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-52PCQXD2.js → chunk-2NHI5F5S.js} +2 -1
- package/dist/safe-bash/command-chunks/{chunk-HDKVO47G.js → chunk-2SQEIUGJ.js} +3 -3
- package/dist/safe-bash/command-chunks/chunk-364TMWBT.js +946 -0
- package/dist/safe-bash/command-chunks/chunk-3E2OIS2J.js +7037 -0
- package/dist/safe-bash/command-chunks/chunk-3HHCU5YU.js +380 -0
- package/dist/safe-bash/command-chunks/{chunk-TF6OA2GK.js → chunk-3NV3HYT2.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-4B7Y7S6E.js +61 -0
- package/dist/safe-bash/command-chunks/{chunk-LLCXZKZ6.js → chunk-4BB2SWJ5.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-IEXHHNOF.js → chunk-4J5CZ2DP.js} +2 -7
- package/dist/safe-bash/command-chunks/{chunk-WDHI3S6Y.js → chunk-4OOUQTQO.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-4ZHMW6F5.js +104 -0
- package/dist/safe-bash/command-chunks/{chunk-YMONDXET.js → chunk-4ZQWGOZB.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-5BSTFCXG.js +553 -0
- package/dist/safe-bash/command-chunks/{chunk-MKQVQMXO.js → chunk-5LU4UCBR.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-5PWJG2UK.js +174 -0
- package/dist/safe-bash/command-chunks/chunk-5TBUOBDE.js +346 -0
- package/dist/safe-bash/command-chunks/{chunk-JMPP4TCW.js → chunk-5UBXNSFZ.js} +3 -2
- 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-3NG75MOB.js → chunk-67GQA75T.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-67QKREJK.js +347 -0
- package/dist/safe-bash/command-chunks/{chunk-L6SU4S26.js → chunk-6B7WQIKB.js} +0 -7
- package/dist/safe-bash/command-chunks/chunk-6BNTBWIK.js +327 -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-6KJ3LPI2.js +94 -0
- package/dist/safe-bash/command-chunks/{chunk-HLDTOR7M.js → chunk-6ZVI7LUY.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-X6NJC3IC.js → chunk-75OFBY5R.js} +1 -1
- 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-MRW5HD2D.js → chunk-7O3E4LPT.js} +4 -22
- package/dist/safe-bash/command-chunks/chunk-7U7EXOXX.js +1392 -0
- package/dist/safe-bash/command-chunks/{chunk-6CYTRQ24.js → chunk-7VTKQUA5.js} +20 -17
- package/dist/safe-bash/command-chunks/{chunk-BZPAWTUL.js → chunk-AEF5BA3D.js} +1 -1
- package/dist/safe-bash/command-chunks/{pptx-GBPNWNEP-7EQEVXV5.js → chunk-AI5JAXQF.js} +34820 -18029
- package/dist/safe-bash/command-chunks/{chunk-63R3FEZJ.js → chunk-AIV5BF5W.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-AYUTO323.js → chunk-AKJG2XD3.js} +2 -18
- package/dist/safe-bash/command-chunks/{chunk-J34TZVMW.js → chunk-ALDC4XP4.js} +0 -5
- package/dist/safe-bash/command-chunks/chunk-AMO3THU4.js +105 -0
- package/dist/safe-bash/command-chunks/chunk-ARBYOQUZ.js +65 -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-44AHAB5O.js → chunk-BDSMROQZ.js} +1 -4
- package/dist/safe-bash/command-chunks/chunk-BNOU5YQS.js +182 -0
- package/dist/safe-bash/command-chunks/{chunk-4ZALPDBV.js → chunk-BPE5INLI.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-OT4LZMLB.js → chunk-BR73BIOW.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-C5YYCQHW.js +1444 -0
- package/dist/safe-bash/command-chunks/chunk-C7I25AAL.js +25 -0
- package/dist/safe-bash/command-chunks/{chunk-4ONEXMD3.js → chunk-CAP7ZJSY.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-DWFLVJC6.js → chunk-CCRHMAU5.js} +2 -1
- package/dist/safe-bash/command-chunks/chunk-CQ5YGOGB.js +150 -0
- package/dist/safe-bash/command-chunks/{chunk-JCNNOMBV.js → chunk-CQTRW45K.js} +3 -2
- package/dist/safe-bash/command-chunks/{chunk-N2F74VRO.js → chunk-CZ7EN3JG.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-DB453IE6.js +122 -0
- package/dist/safe-bash/command-chunks/{chunk-KKG4BAFZ.js → chunk-DIEPXUM4.js} +6 -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-6BETHLXZ.js → chunk-DZCY63VJ.js} +13 -11
- package/dist/safe-bash/command-chunks/{chunk-QUENU6GM.js → chunk-E55UKBIE.js} +3 -3
- 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-HLGKIZ25.js → chunk-F6OYH562.js} +2 -0
- package/dist/safe-bash/command-chunks/{chunk-MC3VWLIZ.js → chunk-FDBUV4HJ.js} +28 -19
- package/dist/safe-bash/command-chunks/{chunk-7FKUC34S.js → chunk-FPVUD6TH.js} +6 -3
- package/dist/safe-bash/command-chunks/chunk-FXELCPFX.js +195 -0
- package/dist/safe-bash/command-chunks/chunk-FXOA7RBK.js +42 -0
- package/dist/safe-bash/command-chunks/{chunk-LPORMIZS.js → chunk-FZTK4MFI.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-K543PB3I.js → chunk-G66QUHIZ.js} +6 -35
- package/dist/safe-bash/command-chunks/chunk-GFQZCKO6.js +272 -0
- 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-GOB777HR.js +97 -0
- package/dist/safe-bash/command-chunks/chunk-GRBWW4SG.js +48 -0
- package/dist/safe-bash/command-chunks/{chunk-PPNBNFAU.js → chunk-GYQ2HAKQ.js} +8 -8
- 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-43GSSUAY.js → chunk-II77KPZN.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-ZS3QPNUL.js → chunk-IR2BY7EL.js} +21 -6
- package/dist/safe-bash/command-chunks/{chunk-SG424QWS.js → chunk-JDYXY44P.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-JNZ3CVAE.js +147 -0
- package/dist/safe-bash/command-chunks/{chunk-4QJOYXVB.js → chunk-JV7LBUTP.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-IKS2YXZQ.js → chunk-K67MWWWH.js} +3 -3
- 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-KMCZ6P4O.js → chunk-KQLD3AED.js} +68 -7
- package/dist/safe-bash/command-chunks/chunk-KWESKQHR.js +25 -0
- package/dist/safe-bash/command-chunks/{chunk-YZ5SVZFD.js → chunk-KXU3IRUO.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-C7IHMJEW.js → chunk-KZC5UWFF.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-2WRTLCGK.js → chunk-LAOM65EE.js} +5 -5
- package/dist/safe-bash/command-chunks/chunk-LE5LZNHE.js +204 -0
- package/dist/safe-bash/command-chunks/{chunk-HFII3QYO.js → chunk-LWS62ISU.js} +46 -32
- package/dist/safe-bash/command-chunks/{chunk-BZDDAPSV.js → chunk-LWSBAWLT.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-MDH5T4OS.js +41 -0
- package/dist/safe-bash/command-chunks/{chunk-X7TM3AKW.js → chunk-MIXBO6U7.js} +20 -7
- 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-HLBX5IRS.js → chunk-MQFIPHIQ.js} +46 -81
- package/dist/safe-bash/command-chunks/{chunk-ZJBR5Q5I.js → chunk-MSFXC3OC.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-NI7MKJPN.js → chunk-MTQH74CF.js} +3 -55
- package/dist/safe-bash/command-chunks/chunk-MWUZZWXK.js +354 -0
- package/dist/safe-bash/command-chunks/chunk-N4PFUSRM.js +35 -0
- 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-I3K5RYU4.js → chunk-NKFYQSES.js} +73 -26
- package/dist/safe-bash/command-chunks/{chunk-KVFCSLKK.js → chunk-NXEQ3ESQ.js} +6 -0
- package/dist/safe-bash/command-chunks/{chunk-NGWB2YBL.js → chunk-O4JQSB7O.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-7L24L4UO.js → chunk-OQU6UT6X.js} +2 -20
- package/dist/safe-bash/command-chunks/{chunk-3VGGYEDH.js → chunk-ORYGZYKW.js} +4 -3
- package/dist/safe-bash/command-chunks/{chunk-ZXKW7SJ2.js → chunk-OYYV7ZAF.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-P2N33UMN.js +270 -0
- package/dist/safe-bash/command-chunks/{chunk-Q7Q5GM5S.js → chunk-P5APDEFB.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-X2YQLGKS.js → chunk-PCEFOYA3.js} +240 -148
- 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-AIRGA2SU.js → chunk-PMBFZXTK.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ZT4KSS2V.js → chunk-PTT3I223.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4Y3WVMK4.js → chunk-PV66YWHB.js} +1 -0
- package/dist/safe-bash/command-chunks/chunk-Q3EWDEUQ.js +185 -0
- package/dist/safe-bash/command-chunks/{chunk-AXK3H4PX.js → chunk-QJ33BHI4.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-QKFSRZGQ.js +1091 -0
- package/dist/safe-bash/command-chunks/{chunk-JZSNU2MY.js → chunk-QKJLP53H.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-VVI4Z73I.js → chunk-QP4R6GLA.js} +5 -1
- package/dist/safe-bash/command-chunks/chunk-RMWQAAO5.js +2488 -0
- package/dist/safe-bash/command-chunks/{chunk-QDTBMSBE.js → chunk-RO62EWX6.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-HRLIAMXC.js → chunk-RZZI24ZE.js} +7 -6
- package/dist/safe-bash/command-chunks/{chunk-PFAADCB5.js → chunk-SDNBCQ3X.js} +10 -24
- package/dist/safe-bash/command-chunks/chunk-SEM36PG5.js +11 -0
- package/dist/safe-bash/command-chunks/{chunk-36O5OT7E.js → chunk-T35Y7YQD.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ESMCX3YV.js → chunk-TGSNCQSR.js} +710 -143
- package/dist/safe-bash/command-chunks/chunk-TIOCQVUQ.js +557 -0
- package/dist/safe-bash/command-chunks/{chunk-T5H5UJQ3.js → chunk-TNOA7FCQ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-GN2TKLE7.js → chunk-TS65BJHG.js} +5 -5
- package/dist/safe-bash/command-chunks/chunk-TSCGT46G.js +363 -0
- package/dist/safe-bash/command-chunks/chunk-UG7SMZFF.js +178 -0
- package/dist/safe-bash/command-chunks/{chunk-KBEURXFF.js → chunk-UN6WS55J.js} +3 -3
- package/dist/safe-bash/command-chunks/chunk-UXSR5BZH.js +136 -0
- package/dist/safe-bash/command-chunks/{chunk-SX2X3IH4.js → chunk-V2V5OCL3.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-V6BEDRMQ.js +112 -0
- package/dist/safe-bash/command-chunks/chunk-V7A7DRTU.js +293 -0
- package/dist/safe-bash/command-chunks/{chunk-5SHGJ7NO.js → chunk-VA5ZHYYA.js} +73 -33
- package/dist/safe-bash/command-chunks/{chunk-J4PEQWSF.js → chunk-VGG2DL5Q.js} +0 -1
- package/dist/safe-bash/command-chunks/chunk-VPR5LQYX.js +1228 -0
- package/dist/safe-bash/command-chunks/{chunk-EIVW3X3N.js → chunk-VSRGNQCP.js} +11 -6
- package/dist/safe-bash/command-chunks/{chunk-TYVCKQDH.js → chunk-VXSLJH7G.js} +56 -6
- package/dist/safe-bash/command-chunks/{chunk-PXYOWWMV.js → chunk-W7RAD4EW.js} +4 -3
- package/dist/safe-bash/command-chunks/{src-UJOWAS2S.js → chunk-WD3ERGRY.js} +77 -277
- package/dist/safe-bash/command-chunks/{chunk-5ZSM4UFN.js → chunk-WECIOOQB.js} +8 -64
- 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-HHP343KT.js → chunk-WTECBRU4.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-AO6Z5EQ7.js → chunk-WVE64WM2.js} +6 -5
- package/dist/safe-bash/command-chunks/chunk-WVHONVZ4.js +594 -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-XNLFHHOC.js +63 -0
- package/dist/safe-bash/command-chunks/{chunk-XAFSZDY2.js → chunk-XS72HTMA.js} +11 -0
- package/dist/safe-bash/command-chunks/chunk-Y5INTD6S.js +220 -0
- package/dist/safe-bash/command-chunks/chunk-YIQACGEW.js +43 -0
- package/dist/safe-bash/command-chunks/chunk-YOF7R4OY.js +80 -0
- package/dist/safe-bash/command-chunks/{chunk-VZHRZMS7.js → chunk-YOFC45RK.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-2FUAW6GO.js → chunk-Z45N42QC.js} +75 -11
- package/dist/safe-bash/command-chunks/chunk-ZHUWOUWB.js +618 -0
- package/dist/safe-bash/command-chunks/{chunk-OPUJSTHS.js → chunk-ZYHTWNAE.js} +215 -67
- package/dist/safe-bash/command-chunks/chunk-ZYXH3B66.js +636 -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 +4 -2
- package/dist/safe-bash/commands/copy-preserve.d.ts +1 -0
- package/dist/safe-bash/commands/csplit/index.browser.js +2 -2
- 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/docx/index.browser.js +1 -1
- package/dist/safe-bash/commands/execution.js +19 -13
- package/dist/safe-bash/commands/factor/index.browser.js +2 -2
- package/dist/safe-bash/commands/filesystem.d.ts +1 -1
- package/dist/safe-bash/commands/filesystem.js +17 -13
- 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/getopt/index.browser.js +2 -2
- 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/hexdump/index.browser.js +2 -2
- package/dist/safe-bash/commands/htmlq/index.d.ts +1 -1
- package/dist/safe-bash/commands/iconv/index.browser.js +2 -2
- package/dist/safe-bash/commands/line-endings/index.browser.js +2 -2
- 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 +4 -2
- package/dist/safe-bash/commands/llm/providers/index.browser.js +1 -1
- package/dist/safe-bash/commands/mdq/index.browser.js +3 -3
- package/dist/safe-bash/commands/media/index.browser.js +1 -1
- 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 -695
- 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 +4 -12
- 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/platform-portable.d.ts +1 -5
- package/dist/safe-bash/commands/network/platform-portable.js +1 -26
- 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/public.d.ts +2 -2
- package/dist/safe-bash/commands/network/public.js +2 -2
- 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/transport.js +2 -2
- 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 +9 -332
- package/dist/safe-bash/commands/node/filesystem.js +3 -2
- package/dist/safe-bash/commands/node/index.browser.js +8 -9
- 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/types.js +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 +3 -3
- 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/pr/index.browser.js +2 -2
- package/dist/safe-bash/commands/predicates.js +3 -4
- package/dist/safe-bash/commands/python/host-capabilities.js +31 -14
- package/dist/safe-bash/commands/python/index.browser.js +11 -11
- 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 +2 -0
- package/dist/safe-bash/commands/python/manifest.js +13 -6
- package/dist/safe-bash/commands/python/provisioning.js +1 -1
- package/dist/safe-bash/commands/python/shell-capability.d.ts +1 -0
- package/dist/safe-bash/commands/python/shell-capability.js +3 -2
- package/dist/safe-bash/commands/python/worker.browser.js +3 -3
- package/dist/safe-bash/commands/regex-execution/matching.js +1 -2
- package/dist/safe-bash/commands/regex-execution/public.browser.js +8 -8
- package/dist/safe-bash/commands/safejs/runtime.js +16 -7
- 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/standard.d.ts +1 -0
- package/dist/safe-bash/commands/standard.js +2 -1
- package/dist/safe-bash/commands/streams.js +6 -24
- 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/text.js +268 -364
- package/dist/safe-bash/commands/tsort/index.browser.js +2 -2
- 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/xml/index.browser.js +2 -2
- package/dist/safe-bash/commands/yq/index.browser.js +8 -3
- 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 +2 -2
- package/dist/safe-bash/core.d.ts +14 -2
- package/dist/safe-bash/core.js +8 -2
- 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 +321 -286
- package/dist/safe-bash/jobs.browser.js +5 -5
- 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/dd/index.js +2 -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/opt-in/optional/commands/shuf/options.d.ts +1 -0
- package/dist/safe-bash/opt-in/optional/commands/shuf/options.js +2 -4
- package/dist/safe-bash/opt-in/optional/commands/shuf/shuf.js +2 -1
- package/dist/safe-bash/optional-host.browser.js +15 -11
- 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/composition.d.ts +1 -0
- package/dist/safe-bash/plugins/composition.js +3 -8
- package/dist/safe-bash/plugins/index.browser.js +27 -29
- package/dist/safe-bash/registry-entry.browser.js +28 -30
- package/dist/safe-bash/shell/arrays/bindings.d.ts +3 -5
- package/dist/safe-bash/shell/arrays/bindings.js +7 -3
- package/dist/safe-bash/shell/arrays/state.js +4 -0
- package/dist/safe-bash/shell/brace-expansion.js +1 -1
- package/dist/safe-bash/shell/dynamic-variables.d.ts +10 -0
- package/dist/safe-bash/shell/dynamic-variables.js +25 -0
- package/dist/safe-bash/shell/input.js +16 -14
- package/dist/safe-bash/shell/parser.js +8 -1
- package/dist/safe-bash/shell/runtime.d.ts +7 -4
- package/dist/safe-bash/shell/runtime.js +604 -802
- package/dist/safe-bash/shell/shell.js +2 -31
- 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 +25 -27
- 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/yq-browser/index.js +1 -1
- package/dist/safe-bash-base-encoding-engine/base.js +2 -2
- package/dist/safe-bash-base-encoding-engine/shared.js +1 -1
- package/dist/safe-bash-byte-input-engine/index.d.ts +3 -2
- package/dist/safe-bash-byte-input-engine/index.js +4 -1
- package/dist/safe-bash-checksum-engine/index.js +13 -6
- package/dist/safe-bash-command-apply-patch/apply.d.ts +1 -1
- package/dist/safe-bash-command-apply-patch/apply.js +4 -3
- package/dist/safe-bash-command-apply-patch/index.js +4 -4
- package/dist/safe-bash-command-apply-patch/matcher.js +1 -1
- package/dist/safe-bash-command-apply-patch/parser.js +1 -1
- 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 +6 -0
- package/dist/safe-bash-command-bc/index.js +136 -266
- package/dist/safe-bash-command-column/column.js +5 -5
- package/dist/safe-bash-command-column/display.d.ts +1 -1
- package/dist/safe-bash-command-column/display.js +1 -1
- package/dist/safe-bash-command-column/index.js +5 -5
- package/dist/safe-bash-command-column/internal.d.ts +0 -2
- package/dist/safe-bash-command-column/internal.js +1 -1
- package/dist/safe-bash-command-column/layout.js +4 -4
- package/dist/safe-bash-command-column/table.js +2 -2
- package/dist/safe-bash-command-comm/comm.js +1 -1
- package/dist/safe-bash-command-comm/index.js +1 -1
- 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-csvcut/index.d.ts +1 -0
- package/dist/safe-bash-command-csvcut/index.js +1 -0
- package/dist/safe-bash-command-csvgrep/index.d.ts +1 -0
- package/dist/safe-bash-command-csvgrep/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 +180 -12
- 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-csvkit/sync-support.js +1 -1
- 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-dd/index.js +2 -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.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-fd/index.js +9 -9
- package/dist/safe-bash-command-ffmpeg/index.js +117 -102
- package/dist/safe-bash-command-file/index.js +4 -4
- package/dist/safe-bash-command-file/shared.js +1 -1
- 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 +95 -0
- package/dist/safe-bash-command-hexdump/command.js +4 -4
- package/dist/safe-bash-command-hexdump/custom.d.ts +24 -0
- package/dist/safe-bash-command-hexdump/index.js +4 -4
- package/dist/safe-bash-command-hexdump/internal.d.ts +2 -0
- package/dist/safe-bash-command-hexdump/internal.js +1 -1
- package/dist/safe-bash-command-hexdump/io.js +2 -2
- package/dist/safe-bash-command-hexdump/options.d.ts +3 -0
- package/dist/safe-bash-command-hexdump/options.js +2 -2
- package/dist/safe-bash-command-hostname/index.js +1 -1
- package/dist/safe-bash-command-html-to-markdown/budget.js +1 -1
- package/dist/safe-bash-command-html-to-markdown/entities.js +3 -3
- package/dist/safe-bash-command-html-to-markdown/index.js +11 -11
- package/dist/safe-bash-command-html-to-markdown/input.js +5 -5
- package/dist/safe-bash-command-html-to-markdown/parser.d.ts +1 -0
- package/dist/safe-bash-command-html-to-markdown/parser.js +4 -4
- package/dist/safe-bash-command-html-to-markdown/render.js +5 -5
- package/dist/safe-bash-command-html-to-markdown/text.js +2 -2
- package/dist/safe-bash-command-htmlq/index.d.ts +1 -0
- package/dist/safe-bash-command-htmlq/index.js +39 -17
- package/dist/safe-bash-command-iconv/codec.js +1 -1
- package/dist/safe-bash-command-iconv/command.js +2 -2
- package/dist/safe-bash-command-iconv/index.js +2 -2
- package/dist/safe-bash-command-imagemagick/index.js +45 -35
- package/dist/safe-bash-command-join/index.js +1 -1
- package/dist/safe-bash-command-join/join.js +1 -1
- 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-less/index.js +43 -28
- 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.d.ts +1 -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-numfmt/index.js +0 -11
- package/dist/safe-bash-command-od/index.js +101 -68
- 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-paste/index.js +1 -1
- package/dist/safe-bash-command-paste/paste.js +1 -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-pathchk/index.js +3 -13
- package/dist/safe-bash-command-pdfimages/index.js +62 -25
- package/dist/safe-bash-command-pdfinfo/index.d.ts +0 -23
- package/dist/safe-bash-command-pdfinfo/index.js +39 -782
- package/dist/safe-bash-command-pdftk/index.js +40 -12
- package/dist/safe-bash-command-pdftoppm/index.js +76 -30
- package/dist/safe-bash-command-pdftotext/index.js +37 -15
- 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 +31 -18
- 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-shuf/options.d.ts +1 -0
- package/dist/safe-bash-command-shuf/options.js +2 -4
- package/dist/safe-bash-command-shuf/shuf.js +2 -1
- package/dist/safe-bash-command-sips/index.js +111 -35
- package/dist/safe-bash-command-soffice/index.js +21 -17
- package/dist/safe-bash-command-split/index.js +3 -3
- package/dist/safe-bash-command-split/io.js +1 -1
- package/dist/safe-bash-command-split/outputs.js +2 -2
- package/dist/safe-bash-command-split/split.js +3 -3
- package/dist/safe-bash-command-sqlite3/btree.d.ts +1 -0
- package/dist/safe-bash-command-sqlite3/engine.d.ts +7 -2
- package/dist/safe-bash-command-sqlite3/index.js +436 -537
- package/dist/safe-bash-command-ssconvert/commands.js +9 -9
- package/dist/safe-bash-command-ssconvert/core.js +8 -8
- package/dist/safe-bash-command-ssconvert/formats/csv.js +9 -9
- package/dist/safe-bash-command-ssconvert/formats/ods.js +9 -9
- package/dist/safe-bash-command-ssconvert/formats/spreadsheetml.js +2 -2
- package/dist/safe-bash-command-ssconvert/formats/xls.js +9 -9
- package/dist/safe-bash-command-ssconvert/formats/xlsx.js +9 -9
- package/dist/safe-bash-command-ssconvert/index.js +21 -21
- 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 +551 -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-tree/arguments.js +3 -3
- package/dist/safe-bash-command-tree/charset.js +1 -1
- package/dist/safe-bash-command-tree/index.js +4 -4
- package/dist/safe-bash-command-tree/io.js +1 -1
- package/dist/safe-bash-command-tree/pattern.js +2 -2
- package/dist/safe-bash-command-tree/tree.js +4 -4
- package/dist/safe-bash-command-unrtf/index.js +14 -7
- 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 +6 -3
- package/dist/safe-bash-command-xan/csv.d.ts +1 -1
- package/dist/safe-bash-command-xan/csv.js +1 -1
- package/dist/safe-bash-command-xan/index.js +18 -17
- package/dist/safe-bash-command-xan/io.js +3 -3
- package/dist/safe-bash-command-xmllint/index.js +190 -50
- package/dist/safe-bash-command-xxd/index.js +105 -91
- package/dist/safe-bash-command-xz/command.d.ts +2 -0
- package/dist/safe-bash-command-xz/index.d.ts +1 -1
- package/dist/safe-bash-command-xz/index.js +11 -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 +12 -12
- 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.d.ts +1 -0
- package/dist/safe-bash-contracts/index.js +39 -35
- package/dist/safe-bash-contracts/io.d.ts +4 -1
- package/dist/safe-bash-contracts/io.js +4 -2
- package/dist/safe-bash-contracts/managed-abort.d.ts +10 -0
- 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 +54 -0
- package/dist/safe-bash-diff-engine/shared.js +19 -0
- package/dist/safe-bash-io-engine/commands/archive/internal.js +5 -23
- 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/search/requirements.js +2 -2
- package/dist/safe-bash-io-engine/commands/text-programs/shared.js +44 -66
- package/dist/safe-bash-io-engine/internal.js +1 -1
- package/dist/safe-bash-io-engine/shell/pattern.js +8 -13
- package/dist/safe-bash-io-engine/shell/string-operations.js +1 -1
- 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 +161 -35
- package/dist/safe-bash-mcp/index.browser.js +417 -0
- package/dist/safe-bash-mcp/index.d.ts +66 -2
- package/dist/safe-bash-mcp/index.js +1838 -122
- 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 +80 -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 +42 -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 +106 -34
- package/dist/safe-bash-regex-engine/execution/bounded-provider.js +55 -67
- package/dist/safe-bash-regex-engine/execution/portable.d.ts +0 -1
- package/dist/safe-bash-regex-engine/execution/portable.js +6 -10
- package/dist/safe-bash-regex-engine/execution/protocol.d.ts +0 -5
- package/dist/safe-bash-regex-engine/execution/protocol.js +1 -3
- package/dist/safe-bash-regex-engine/index.js +6 -4
- package/dist/safe-bash-regex-engine/text/budget.d.ts +1 -0
- package/dist/safe-bash-regex-engine/text/budget.js +1 -1
- package/dist/safe-bash-regex-engine/text/regex.d.ts +15 -0
- package/dist/safe-bash-regex-engine/text/regex.js +6 -4
- package/dist/safe-bash-regex-engine/text/replacement-buffer.js +2 -2
- package/dist/safe-bash-regex-engine/text/rust-syntax.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 +191 -229
- 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-table-text-engine/table-text/internal.d.ts +7 -5
- package/dist/safe-bash-table-text-engine/table-text/internal.js +39 -21
- 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 +8 -4
- 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/codecs/odf-hyperlinks.js +8 -2
- package/dist/spreadsheet-engine/formulas/functions/captured-bessel-phase.js +2 -2
- package/dist/spreadsheet-engine/formulas/label-references.js +54 -33
- package/dist/spreadsheet-engine/formulas/parser.js +3 -1
- package/dist/spreadsheet-engine/formulas/rewriting.js +13 -3
- package/dist/spreadsheet-engine/io/publication.d.ts +1 -0
- package/dist/spreadsheet-format-xls/biff-data-tables.js +4 -6
- package/dist/spreadsheet-format-xls/biff-formulas.js +3 -0
- package/dist/spreadsheet-format-xls/biff-label-ranges.js +9 -6
- package/dist/spreadsheet-format-xls/biff.js +1 -1
- package/dist/xlsx-ast/xlsx.js +8 -5
- package/package.json +165 -15
- 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-KAGBORIC.js +0 -88
- 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/command-chunks/{chunk-FIUFIDAO.js → chunk-2JRBIDAD.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-BWNXWI33.js → chunk-2LMZVE3I.js} +0 -0
- package/dist/safe-bash/command-chunks/{chunk-B5BKA5WH.js → chunk-B5TAOCKD.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-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-3SFTBPOU.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) {
|
|
@@ -2227,7 +2230,7 @@ function* normalization(value, options, reserve, cooperate) {
|
|
|
2227
2230
|
}
|
|
2228
2231
|
if (!Object.hasOwn(frame.v, k)) fail(frame.p);
|
|
2229
2232
|
const d = Object.getOwnPropertyDescriptor(frame.v, k);
|
|
2230
|
-
if (!d || !("value" in d) || ["__proto__", "constructor", "prototype"].includes(k))
|
|
2233
|
+
if (!d || !d.enumerable || !("value" in d) || ["__proto__", "constructor", "prototype"].includes(k))
|
|
2231
2234
|
fail(`${frame.p}.${k}`);
|
|
2232
2235
|
if (k === "t" && d.value === "Table") hasTable = true;
|
|
2233
2236
|
stack.push({ kind: "node", v: d.value, p: `${frame.p}.${k}`, depth: frame.depth + 1 });
|
|
@@ -2306,8 +2309,7 @@ function* normalization(value, options, reserve, cooperate) {
|
|
|
2306
2309
|
}
|
|
2307
2310
|
stack.push({ kind: "arr", v, elemValues, idx: 0, p, depth });
|
|
2308
2311
|
} else {
|
|
2309
|
-
const keys =
|
|
2310
|
-
for (const k in v) keys.push(k);
|
|
2312
|
+
const keys = Object.getOwnPropertyNames(v);
|
|
2311
2313
|
stack.push({ kind: "obj", v, keys, idx: 0, p, depth });
|
|
2312
2314
|
}
|
|
2313
2315
|
}
|
|
@@ -2431,6 +2433,13 @@ var readCommonMark = async (input, context, selection) => {
|
|
|
2431
2433
|
return { blocks: await assemble(pending.blocks, 1), metadata: {}, resources: [] };
|
|
2432
2434
|
};
|
|
2433
2435
|
var commonmarkReader = { format: "commonmark", read: readCommonMark };
|
|
2436
|
+
function taskListState(node) {
|
|
2437
|
+
if (node.t !== "Span") return void 0;
|
|
2438
|
+
const [attr5, children2] = node.c;
|
|
2439
|
+
if (children2.length || attr5[0] || attr5[1].length !== 1 || attr5[1][0] !== "task-list-marker" || attr5[2].length !== 1 || attr5[2][0]?.[0] !== "checked") return void 0;
|
|
2440
|
+
const value = attr5[2][0][1];
|
|
2441
|
+
return value === "true" ? true : value === "false" ? false : void 0;
|
|
2442
|
+
}
|
|
2434
2443
|
var delimiters = { AlignLeft: ":---", AlignRight: "---:", AlignCenter: ":---:", AlignDefault: "---" };
|
|
2435
2444
|
var Projection = class _Projection {
|
|
2436
2445
|
constructor(context, format2, cellWriter) {
|
|
@@ -2464,8 +2473,8 @@ var Projection = class _Projection {
|
|
|
2464
2473
|
this.add(html ? { "&": "&", "<": "<", ">": ">", '"': """ }[ch] ?? ch : "\\`*_{}[]<>|!#".includes(ch) ? `\\${ch}` : ch === "\n" || ch === "\r" || ch === " " ? " " : ch);
|
|
2465
2474
|
}
|
|
2466
2475
|
}
|
|
2467
|
-
attrs(
|
|
2468
|
-
const pairs2 = [...
|
|
2476
|
+
attrs(attr5) {
|
|
2477
|
+
const pairs2 = [...attr5[0] ? [["id", attr5[0]]] : [], ...attr5[1].length ? [["class", attr5[1].join(" ")]] : [], ...attr5[2]];
|
|
2469
2478
|
for (const [key, value] of pairs2) {
|
|
2470
2479
|
if (!key || key.toLowerCase().startsWith("on") || [...key].some((ch) => !(ch >= "a" && ch <= "z") && !(ch >= "A" && ch <= "Z") && !(ch >= "0" && ch <= "9") && ch !== "-" && ch !== "_"))
|
|
2471
2480
|
throw new PandocError("E_CAPABILITY", this.context.operation ?? "write", "Unsupported HTML attribute", this.format);
|
|
@@ -2474,8 +2483,8 @@ var Projection = class _Projection {
|
|
|
2474
2483
|
this.add('"');
|
|
2475
2484
|
}
|
|
2476
2485
|
}
|
|
2477
|
-
attributeLoss(
|
|
2478
|
-
if (
|
|
2486
|
+
attributeLoss(attr5, path) {
|
|
2487
|
+
if (attr5[0] || attr5[1].length || attr5[2].length) this.loss(path, "Flattened table attributes");
|
|
2479
2488
|
}
|
|
2480
2489
|
textProjection(render, html) {
|
|
2481
2490
|
const text = new _Projection(this.context, this.format, this.cellWriter);
|
|
@@ -2874,8 +2883,8 @@ var Markdown = class {
|
|
|
2874
2883
|
if (!this.context.lossy) throw new PandocError("E_UNSUPPORTED_FEATURE", this.context.operation ?? "write", `Markdown cannot represent ${feature}`, this.selection.descriptor.name, path);
|
|
2875
2884
|
this.context.report({ code: "W_RAW_CONTENT", operation: this.context.operation ?? "write", format: this.selection.descriptor.name, location: path, message: `Projected ${feature}` });
|
|
2876
2885
|
}
|
|
2877
|
-
attrs(
|
|
2878
|
-
if (
|
|
2886
|
+
attrs(attr5, path) {
|
|
2887
|
+
if (attr5[0] || attr5[1].length || attr5[2].length) this.loss(path, "attributes");
|
|
2879
2888
|
}
|
|
2880
2889
|
escape(text, target = false) {
|
|
2881
2890
|
this.reserve(text.length * 6);
|
|
@@ -2983,15 +2992,12 @@ var Markdown = class {
|
|
|
2983
2992
|
break;
|
|
2984
2993
|
}
|
|
2985
2994
|
case "Span": {
|
|
2986
|
-
const
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
break;
|
|
2991
|
-
}
|
|
2992
|
-
parts.push(attr4[2][0][1] === "true" ? "[x] " : "[ ] ");
|
|
2995
|
+
const attr5 = node.c[0];
|
|
2996
|
+
const state = taskListState(node);
|
|
2997
|
+
if (state !== void 0) {
|
|
2998
|
+
parts.push(task && i === 0 && this.selection.extensions.task_lists ? state ? "[x] " : "[ ] " : state ? "\u2612 " : "\u2610 ");
|
|
2993
2999
|
} else {
|
|
2994
|
-
this.attrs(
|
|
3000
|
+
this.attrs(attr5, p);
|
|
2995
3001
|
parts.push(this.inline(node.c[1], `${p}.c[1]`));
|
|
2996
3002
|
}
|
|
2997
3003
|
break;
|
|
@@ -3049,9 +3055,9 @@ var Markdown = class {
|
|
|
3049
3055
|
parts.push("---");
|
|
3050
3056
|
break;
|
|
3051
3057
|
case "CodeBlock": {
|
|
3052
|
-
const
|
|
3053
|
-
if (
|
|
3054
|
-
const info =
|
|
3058
|
+
const attr5 = node.c[0];
|
|
3059
|
+
if (attr5[0] || attr5[1].length > 1 || attr5[2].length) this.loss(p, "code block attributes");
|
|
3060
|
+
const info = attr5[1][0] ?? "";
|
|
3055
3061
|
if ([...info].some((ch) => "\r\n` ".includes(ch))) this.loss(p, "code language");
|
|
3056
3062
|
this.reserve(node.c[1].length * 2);
|
|
3057
3063
|
const value = node.c[1].split("\r\n").join("\n").split("\r").join("\n");
|
|
@@ -3130,6 +3136,7 @@ async function writeMarkdown(document, context, selection) {
|
|
|
3130
3136
|
}
|
|
3131
3137
|
var commonmark_default = {
|
|
3132
3138
|
name: "commonmark",
|
|
3139
|
+
aliases: { read: ["markdown_strict"], write: ["markdown_strict"] },
|
|
3133
3140
|
operands: "join",
|
|
3134
3141
|
reader: commonmarkReader,
|
|
3135
3142
|
writer: { format: "commonmark", write: writeMarkdown },
|
|
@@ -3146,7 +3153,7 @@ var commonmark_default = {
|
|
|
3146
3153
|
};
|
|
3147
3154
|
var gfm_default = {
|
|
3148
3155
|
name: "gfm",
|
|
3149
|
-
aliases: { read: ["markdown"], write: ["markdown"] },
|
|
3156
|
+
aliases: { read: ["markdown", "md", "markdown_github", "markdown_mmd", "markdown_phpextra", "commonmark_x"], write: ["markdown", "md", "markdown_github", "markdown_mmd", "markdown_phpextra", "commonmark_x"] },
|
|
3150
3157
|
operands: "join",
|
|
3151
3158
|
reader: { format: "gfm", read: readCommonMark },
|
|
3152
3159
|
writer: { format: "gfm", write: writeMarkdown },
|
|
@@ -3236,11 +3243,11 @@ var HtmlWriter = class {
|
|
|
3236
3243
|
this.escape(value, true);
|
|
3237
3244
|
this.add('"');
|
|
3238
3245
|
}
|
|
3239
|
-
attrs(
|
|
3246
|
+
attrs(attr5, id = attr5[0]) {
|
|
3240
3247
|
if (id) this.attribute("id", id);
|
|
3241
|
-
if (
|
|
3248
|
+
if (attr5[1].length) this.attribute("class", attr5[1].join(" "));
|
|
3242
3249
|
const seen = /* @__PURE__ */ new Set(["id", "class"]);
|
|
3243
|
-
for (const [key, value] of
|
|
3250
|
+
for (const [key, value] of attr5[2]) {
|
|
3244
3251
|
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
3252
|
if (key === "dir" && !["ltr", "rtl", "auto"].includes(value)) this.fail("Invalid HTML direction");
|
|
3246
3253
|
seen.add(key);
|
|
@@ -3387,13 +3394,19 @@ var HtmlWriter = class {
|
|
|
3387
3394
|
case "RawInline":
|
|
3388
3395
|
this.raw(node.c[0], node.c[1], p);
|
|
3389
3396
|
break;
|
|
3390
|
-
case "Span":
|
|
3397
|
+
case "Span": {
|
|
3398
|
+
const taskState = taskListState(node);
|
|
3399
|
+
if (taskState !== void 0) {
|
|
3400
|
+
this.add(taskState ? '<input type="checkbox" checked="" />' : '<input type="checkbox" />');
|
|
3401
|
+
break;
|
|
3402
|
+
}
|
|
3391
3403
|
this.add("<span");
|
|
3392
3404
|
this.attrs(node.c[0]);
|
|
3393
3405
|
this.add(">");
|
|
3394
3406
|
await this.inlines(node.c[1], `${p}.c[1]`);
|
|
3395
3407
|
this.add("</span>");
|
|
3396
3408
|
break;
|
|
3409
|
+
}
|
|
3397
3410
|
case "Link":
|
|
3398
3411
|
case "Image": {
|
|
3399
3412
|
const image = node.t === "Image";
|
|
@@ -5048,12 +5061,12 @@ var LatexReader = class {
|
|
|
5048
5061
|
if ([...value].length !== 1) texError(this.context, "Accent requires one Unicode scalar");
|
|
5049
5062
|
append(out, { t: "Str", c: (value + accents[name]).normalize("NFC") + remainder });
|
|
5050
5063
|
} else if (name === "href" || name === "url" || name === "includegraphics") {
|
|
5051
|
-
const
|
|
5064
|
+
const attr5 = empty();
|
|
5052
5065
|
const option = name === "includegraphics" ? cursor.optional() : void 0;
|
|
5053
|
-
if (option)
|
|
5066
|
+
if (option) attr5[2].push(["latex-options", option.raw.slice(1, -1)]);
|
|
5054
5067
|
const url = this.literal(cursor.group().children, depth + 1);
|
|
5055
5068
|
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: [
|
|
5069
|
+
append(out, { t: name === "includegraphics" ? "Image" : "Link", c: [attr5, label, [url, ""]] });
|
|
5057
5070
|
} else if (name === "ref" || name === "eqref" || name === "pageref") {
|
|
5058
5071
|
const key = texSource(cursor.group().children);
|
|
5059
5072
|
if (name === "pageref") {
|
|
@@ -5129,10 +5142,10 @@ var LatexReader = class {
|
|
|
5129
5142
|
}
|
|
5130
5143
|
if (cells.length || content.some((t) => t.kind !== "space" && t.kind !== "comment")) row2();
|
|
5131
5144
|
if (!rows.length) texError(this.context, "Tabular has no rows");
|
|
5132
|
-
const
|
|
5133
|
-
|
|
5134
|
-
if (rules)
|
|
5135
|
-
return { t: "Table", c: [
|
|
5145
|
+
const attr5 = empty();
|
|
5146
|
+
attr5[2].push(["latex-column-spec", spec]);
|
|
5147
|
+
if (rules) attr5[2].push(["latex-hlines", String(rules)]);
|
|
5148
|
+
return { t: "Table", c: [attr5, [null, []], cols, [empty(), []], [[empty(), 0, [], rows]], [empty(), []]] };
|
|
5136
5149
|
}
|
|
5137
5150
|
blocks(tokens2, depth = 0) {
|
|
5138
5151
|
this.context.bound("depth", depth);
|
|
@@ -5154,16 +5167,16 @@ var LatexReader = class {
|
|
|
5154
5167
|
}
|
|
5155
5168
|
if (token.kind === "command" && levels[token.text]) {
|
|
5156
5169
|
flush();
|
|
5157
|
-
const
|
|
5170
|
+
const attr5 = empty();
|
|
5158
5171
|
if (tokens2[cursor.index]?.kind === "text" && tokens2[cursor.index]?.text === "*") {
|
|
5159
5172
|
cursor.index++;
|
|
5160
|
-
|
|
5173
|
+
attr5[1].push("unnumbered");
|
|
5161
5174
|
}
|
|
5162
5175
|
const short = cursor.optional();
|
|
5163
|
-
if (short)
|
|
5176
|
+
if (short) attr5[2].push(["short-title", short.raw.slice(1, -1)]);
|
|
5164
5177
|
const title = this.inlines(cursor.group().children, depth + 1);
|
|
5165
|
-
out.push({ t: "Header", c: [levels[token.text],
|
|
5166
|
-
target = { attr:
|
|
5178
|
+
out.push({ t: "Header", c: [levels[token.text], attr5, title] });
|
|
5179
|
+
target = { attr: attr5, title };
|
|
5167
5180
|
} else if (token.kind === "command" && ["title", "author", "date", "documentclass"].includes(token.text)) {
|
|
5168
5181
|
flush();
|
|
5169
5182
|
const options = token.text === "documentclass" ? cursor.optional() : void 0;
|
|
@@ -5178,11 +5191,11 @@ var LatexReader = class {
|
|
|
5178
5191
|
const name = texSource(cursor.group().children);
|
|
5179
5192
|
if (!name || this.labels.has(name)) texError(this.context, "Empty or duplicate label");
|
|
5180
5193
|
if (!target) {
|
|
5181
|
-
const
|
|
5194
|
+
const attr5 = empty();
|
|
5182
5195
|
pending.push({ kind: "group", text: "", raw: "", children: [] });
|
|
5183
5196
|
flush();
|
|
5184
|
-
out.push({ t: "Div", c: [
|
|
5185
|
-
target = { attr:
|
|
5197
|
+
out.push({ t: "Div", c: [attr5, []] });
|
|
5198
|
+
target = { attr: attr5, title: [{ t: "Str", c: name }] };
|
|
5186
5199
|
}
|
|
5187
5200
|
if (target.attr[0]) texError(this.context, "Multiple labels for one structure are unsupported", "E_CAPABILITY");
|
|
5188
5201
|
target.attr[0] = name;
|
|
@@ -5220,8 +5233,8 @@ var LatexReader = class {
|
|
|
5220
5233
|
} else if (token.text === "figure" || token.text === "table") {
|
|
5221
5234
|
const inner = new TexCursor(token.children, this.context);
|
|
5222
5235
|
const position = inner.optional();
|
|
5223
|
-
const
|
|
5224
|
-
if (position)
|
|
5236
|
+
const attr5 = empty();
|
|
5237
|
+
if (position) attr5[2].push(["latex-placement", position.raw.slice(1, -1)]);
|
|
5225
5238
|
let caption2 = [null, []];
|
|
5226
5239
|
let hasCaption = false;
|
|
5227
5240
|
const body = [];
|
|
@@ -5231,27 +5244,27 @@ var LatexReader = class {
|
|
|
5231
5244
|
if (hasCaption) texError(this.context, "Repeated float caption");
|
|
5232
5245
|
hasCaption = true;
|
|
5233
5246
|
const short = inner.optional();
|
|
5234
|
-
if (short)
|
|
5247
|
+
if (short) attr5[2].push(["short-caption", short.raw.slice(1, -1)]);
|
|
5235
5248
|
const c = this.inlines(inner.group().children, depth + 1);
|
|
5236
5249
|
caption2 = [null, [{ t: "Plain", c }]];
|
|
5237
5250
|
} else if (t.kind === "command" && t.text === "label") {
|
|
5238
5251
|
const label = texSource(inner.group().children);
|
|
5239
|
-
if (!label ||
|
|
5240
|
-
|
|
5252
|
+
if (!label || attr5[0] || this.labels.has(label)) texError(this.context, "Empty or duplicate float label");
|
|
5253
|
+
attr5[0] = label;
|
|
5241
5254
|
} else body.push(t);
|
|
5242
5255
|
}
|
|
5243
5256
|
const blocks3 = this.blocks(body, depth + 1);
|
|
5244
5257
|
const title = caption2[1][0];
|
|
5245
5258
|
const inlines2 = title?.t === "Plain" ? title.c : [];
|
|
5246
|
-
if (
|
|
5247
|
-
if (token.text === "figure") out.push({ t: "Figure", c: [
|
|
5259
|
+
if (attr5[0]) this.labels.set(attr5[0], inlines2);
|
|
5260
|
+
if (token.text === "figure") out.push({ t: "Figure", c: [attr5, caption2, blocks3] });
|
|
5248
5261
|
else {
|
|
5249
5262
|
if (blocks3.length !== 1 || blocks3[0]?.t !== "Table") texError(this.context, "Table float must contain one tabular", "E_CAPABILITY");
|
|
5250
5263
|
const table = blocks3[0];
|
|
5251
|
-
for (const pair of table.c[0][2])
|
|
5252
|
-
out.push({ t: "Table", c: [
|
|
5264
|
+
for (const pair of table.c[0][2]) attr5[2].push([pair[0], pair[1]]);
|
|
5265
|
+
out.push({ t: "Table", c: [attr5, caption2, table.c[2], table.c[3], table.c[4], table.c[5]] });
|
|
5253
5266
|
}
|
|
5254
|
-
target = { attr:
|
|
5267
|
+
target = { attr: attr5, title: inlines2 };
|
|
5255
5268
|
} else {
|
|
5256
5269
|
this.raw(token.raw);
|
|
5257
5270
|
out.push({ t: "RawBlock", c: ["latex", token.raw] });
|
|
@@ -5356,9 +5369,9 @@ var LatexWriter = class {
|
|
|
5356
5369
|
}
|
|
5357
5370
|
if (Array.isArray(value)) {
|
|
5358
5371
|
if (value.length === 3 && typeof value[0] === "string" && Array.isArray(value[1]) && Array.isArray(value[2]) && value[0]) {
|
|
5359
|
-
const
|
|
5372
|
+
const attr5 = value;
|
|
5360
5373
|
let base = "pc";
|
|
5361
|
-
for (const ch of
|
|
5374
|
+
for (const ch of attr5[0]) {
|
|
5362
5375
|
this.context.checkpoint();
|
|
5363
5376
|
base += `-${ch.codePointAt(0).toString(16)}`;
|
|
5364
5377
|
}
|
|
@@ -5367,15 +5380,15 @@ var LatexWriter = class {
|
|
|
5367
5380
|
const label = count === 1 ? base : `${base}-dup-${count}`;
|
|
5368
5381
|
this.context.charge("retainedBytes", label.length * 2);
|
|
5369
5382
|
this.context.charge("references", 1);
|
|
5370
|
-
this.labels.set(
|
|
5371
|
-
if (!this.targets.has(
|
|
5383
|
+
this.labels.set(attr5, label);
|
|
5384
|
+
if (!this.targets.has(attr5[0])) this.targets.set(attr5[0], label);
|
|
5372
5385
|
}
|
|
5373
5386
|
for (const child of value) await this.reserve(child);
|
|
5374
5387
|
} else for (const child of Object.values(value)) await this.reserve(child);
|
|
5375
5388
|
}
|
|
5376
|
-
attrs(
|
|
5377
|
-
if (
|
|
5378
|
-
const label = this.labels.get(
|
|
5389
|
+
attrs(attr5, path, languageClass = false) {
|
|
5390
|
+
if (attr5[1].length && !languageClass || attr5[2].length) this.loss("Unsupported LaTeX attributes", path);
|
|
5391
|
+
const label = this.labels.get(attr5);
|
|
5379
5392
|
if (label) this.add(`\\phantomsection\\label{${label}}`);
|
|
5380
5393
|
}
|
|
5381
5394
|
math(source, path) {
|
|
@@ -5471,12 +5484,18 @@ var LatexWriter = class {
|
|
|
5471
5484
|
case "RawInline":
|
|
5472
5485
|
this.raw(node.c[1], p);
|
|
5473
5486
|
break;
|
|
5474
|
-
case "Span":
|
|
5487
|
+
case "Span": {
|
|
5488
|
+
const taskState = taskListState(node);
|
|
5489
|
+
if (taskState !== void 0) {
|
|
5490
|
+
this.add(taskState ? "\u2612 " : "\u2610 ");
|
|
5491
|
+
break;
|
|
5492
|
+
}
|
|
5475
5493
|
this.attrs(node.c[0], p);
|
|
5476
5494
|
this.add("{");
|
|
5477
5495
|
await this.inlines(node.c[1], `${p}.c[1]`);
|
|
5478
5496
|
this.add("}");
|
|
5479
5497
|
break;
|
|
5498
|
+
}
|
|
5480
5499
|
case "Note":
|
|
5481
5500
|
this.context.charge("references", 1);
|
|
5482
5501
|
this.notes.push({ blocks: node.c, path: `${p}.c` });
|
|
@@ -6712,6 +6731,7 @@ var RstWriter = class {
|
|
|
6712
6731
|
}
|
|
6713
6732
|
context;
|
|
6714
6733
|
definitions = [];
|
|
6734
|
+
strikeout = false;
|
|
6715
6735
|
notes = [];
|
|
6716
6736
|
serial = 0;
|
|
6717
6737
|
sourceText = "";
|
|
@@ -6741,12 +6761,12 @@ var RstWriter = class {
|
|
|
6741
6761
|
}
|
|
6742
6762
|
return this.retain(out);
|
|
6743
6763
|
}
|
|
6744
|
-
attrs(
|
|
6745
|
-
if (
|
|
6746
|
-
if (!
|
|
6747
|
-
const count = (this.ids.get(
|
|
6748
|
-
this.ids.set(
|
|
6749
|
-
const base = this.id(
|
|
6764
|
+
attrs(attr5, path, language = false) {
|
|
6765
|
+
if (attr5[1].length && !language || attr5[2].length || language && attr5[1].length > 1) this.loss("Dropped unsupported RST attributes", path);
|
|
6766
|
+
if (!attr5[0]) return "";
|
|
6767
|
+
const count = (this.ids.get(attr5[0]) ?? 0) + 1;
|
|
6768
|
+
this.ids.set(attr5[0], count);
|
|
6769
|
+
const base = this.id(attr5[0]);
|
|
6750
6770
|
return `.. _${count > 1 ? this.unique(`${base}-dup-${count}`) : base}:
|
|
6751
6771
|
|
|
6752
6772
|
`;
|
|
@@ -6816,8 +6836,20 @@ var RstWriter = class {
|
|
|
6816
6836
|
markup = true;
|
|
6817
6837
|
break;
|
|
6818
6838
|
}
|
|
6839
|
+
case "Strikeout": {
|
|
6840
|
+
const content = children2(node.c);
|
|
6841
|
+
if (nested) {
|
|
6842
|
+
this.loss("Nested RST inline style projected to text", p);
|
|
6843
|
+
text = content;
|
|
6844
|
+
break;
|
|
6845
|
+
}
|
|
6846
|
+
if (!content || content.trim() !== content) this.fail("Empty or whitespace-bounded inline style", p);
|
|
6847
|
+
this.strikeout = true;
|
|
6848
|
+
text = `:strikeout:\`${content}\``;
|
|
6849
|
+
markup = true;
|
|
6850
|
+
break;
|
|
6851
|
+
}
|
|
6819
6852
|
case "Underline":
|
|
6820
|
-
case "Strikeout":
|
|
6821
6853
|
case "SmallCaps":
|
|
6822
6854
|
this.loss(`Projected unsupported ${node.t} to text`, p);
|
|
6823
6855
|
text = children2(node.c);
|
|
@@ -6825,10 +6857,16 @@ var RstWriter = class {
|
|
|
6825
6857
|
case "Quoted":
|
|
6826
6858
|
text = (node.c[0] === "SingleQuote" ? "\u2018" : "\u201C") + this.inlines(node.c[1], `${p}.c[1]`, nested, literal) + (node.c[0] === "SingleQuote" ? "\u2019" : "\u201D");
|
|
6827
6859
|
break;
|
|
6828
|
-
case "Span":
|
|
6860
|
+
case "Span": {
|
|
6861
|
+
const taskState = taskListState(node);
|
|
6862
|
+
if (taskState !== void 0) {
|
|
6863
|
+
text = taskState ? "\u2612 " : "\u2610 ";
|
|
6864
|
+
break;
|
|
6865
|
+
}
|
|
6829
6866
|
this.loss("Projected unsupported Span to text", p);
|
|
6830
6867
|
text = this.inlines(node.c[1], `${p}.c[1]`, nested, literal);
|
|
6831
6868
|
break;
|
|
6869
|
+
}
|
|
6832
6870
|
case "Cite":
|
|
6833
6871
|
this.loss("Projected citation to displayed text", p);
|
|
6834
6872
|
text = this.inlines(node.c[1], `${p}.c[1]`, nested, literal);
|
|
@@ -6910,11 +6948,11 @@ var RstWriter = class {
|
|
|
6910
6948
|
text = this.inlines(node.c, `${p}.c`);
|
|
6911
6949
|
break;
|
|
6912
6950
|
case "Header": {
|
|
6913
|
-
const [level,
|
|
6951
|
+
const [level, attr5, content] = node.c;
|
|
6914
6952
|
if (level > 9) this.loss("Heading level projected to level nine", p);
|
|
6915
6953
|
text = this.inlines(content, `${p}.c[2]`);
|
|
6916
6954
|
if (!text) this.fail("Empty heading", p);
|
|
6917
|
-
text = this.attrs(
|
|
6955
|
+
text = this.attrs(attr5, p) + text + "\n" + `=-~^"'+:#`[Math.min(level, 9) - 1].repeat(rstColumnWidth(text));
|
|
6918
6956
|
break;
|
|
6919
6957
|
}
|
|
6920
6958
|
case "CodeBlock": {
|
|
@@ -6938,10 +6976,15 @@ var RstWriter = class {
|
|
|
6938
6976
|
text = indent(body.startsWith(" ") ? "..\n\n" + body : body, 3);
|
|
6939
6977
|
break;
|
|
6940
6978
|
}
|
|
6941
|
-
case "Div":
|
|
6942
|
-
|
|
6943
|
-
|
|
6979
|
+
case "Div": {
|
|
6980
|
+
const [id, classes, attributes] = node.c[0];
|
|
6981
|
+
if (classes.some((name) => !name || [...name].some((ch) => !"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-".includes(ch)))) this.fail("Unsupported RST container class", p);
|
|
6982
|
+
const body = this.blocks(node.c[1], `${p}.c[1]`);
|
|
6983
|
+
text = this.attrs([id, [], attributes], p) + `.. container::${classes.length ? " " + classes.join(" ") : ""}
|
|
6984
|
+
|
|
6985
|
+
` + indent(body, 3);
|
|
6944
6986
|
break;
|
|
6987
|
+
}
|
|
6945
6988
|
case "Figure":
|
|
6946
6989
|
this.loss("Figure projected to content and caption", p);
|
|
6947
6990
|
text = this.blocks(node.c[2], `${p}.c[2]`) + "\n\n" + this.blocks(node.c[1][1], `${p}.c[1][1]`);
|
|
@@ -7017,8 +7060,8 @@ var RstWriter = class {
|
|
|
7017
7060
|
if ("t" in value && ["Space", "SoftBreak", "LineBreak"].includes(String(value.t))) return " ";
|
|
7018
7061
|
if ("t" in value && "c" in value && ["Header", "CodeBlock", "Div"].includes(String(value.t))) {
|
|
7019
7062
|
const block2 = value;
|
|
7020
|
-
const
|
|
7021
|
-
if (
|
|
7063
|
+
const attr5 = block2.t === "Header" ? block2.c[1] : block2.c[0];
|
|
7064
|
+
if (attr5[0]) this.targets.add(attr5[0]);
|
|
7022
7065
|
}
|
|
7023
7066
|
if ("c" in value) return reserve(value.c);
|
|
7024
7067
|
return this.retain(Object.values(value).map((child) => reserve(child)).join(""));
|
|
@@ -7033,7 +7076,7 @@ var RstWriter = class {
|
|
|
7033
7076
|
const marker = `.. [${i + 1}] `;
|
|
7034
7077
|
this.definitions.push(markedBody(marker, body));
|
|
7035
7078
|
}
|
|
7036
|
-
return { kind: "text", text: this.retain([text, ...this.definitions].filter(Boolean).join("\n\n") + (text || this.definitions.length ? "\n" : "")) };
|
|
7079
|
+
return { kind: "text", text: this.retain([...this.strikeout ? [".. role:: strikeout"] : [], text, ...this.definitions].filter(Boolean).join("\n\n") + (text || this.definitions.length ? "\n" : "")) };
|
|
7037
7080
|
}
|
|
7038
7081
|
};
|
|
7039
7082
|
async function writeRst(document, context) {
|
|
@@ -7506,13 +7549,13 @@ var RstReader = class {
|
|
|
7506
7549
|
if (name === "image" || name === "figure") {
|
|
7507
7550
|
if (!allow(["alt", "height", "width", "scale", "align", "target", "class", "name"]) || name === "image" && body.length || name === "figure" && subName) return unsupported();
|
|
7508
7551
|
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))
|
|
7552
|
+
const attr5 = rstAttr();
|
|
7553
|
+
attr5[0] = options.get("name") ?? "";
|
|
7554
|
+
attr5[1].push(...(options.get("class") ?? "").split(" ").filter(Boolean));
|
|
7555
|
+
for (const k of ["height", "width", "scale", "align"]) if (options.has(k)) attr5[2].push([k, options.get(k)]);
|
|
7513
7556
|
const target = [argument, ""];
|
|
7514
7557
|
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: [
|
|
7558
|
+
let image = { t: "Image", c: [attr5, this.inline(options.get("alt") ?? "", at), target] };
|
|
7516
7559
|
if (options.has("target")) image = { t: "Link", c: [rstAttr(), [image], [options.get("target"), ""]] };
|
|
7517
7560
|
if (subName) {
|
|
7518
7561
|
if (this.substitutions.has(subName)) rstError(this.context, at, `Duplicate substitution: ${subName}`);
|
|
@@ -7529,18 +7572,18 @@ var RstReader = class {
|
|
|
7529
7572
|
if (subName) return unsupported();
|
|
7530
7573
|
if (["code", "code-block", "sourcecode", "parsed-literal"].includes(name)) {
|
|
7531
7574
|
if (!allow(["number-lines", "class", "name"]) || name === "parsed-literal") return unsupported();
|
|
7532
|
-
const
|
|
7533
|
-
|
|
7534
|
-
if (argument)
|
|
7535
|
-
|
|
7575
|
+
const attr5 = rstAttr();
|
|
7576
|
+
attr5[0] = options.get("name") ?? "";
|
|
7577
|
+
if (argument) attr5[1].push(argument);
|
|
7578
|
+
attr5[1].push(...(options.get("class") ?? "").split(" ").filter(Boolean));
|
|
7536
7579
|
if (options.has("number-lines")) {
|
|
7537
7580
|
const number = options.get("number-lines") || "1";
|
|
7538
7581
|
if (![...number].every((c) => c >= "0" && c <= "9")) rstError(this.context, at, "Invalid number-lines value");
|
|
7539
|
-
|
|
7540
|
-
|
|
7582
|
+
attr5[1].push("numberLines");
|
|
7583
|
+
attr5[2].push(["startFrom", number]);
|
|
7541
7584
|
}
|
|
7542
7585
|
if (!body.length) rstError(this.context, at, "Code directive requires a body");
|
|
7543
|
-
return { blocks: [{ t: "CodeBlock", c: [
|
|
7586
|
+
return { blocks: [{ t: "CodeBlock", c: [attr5, body.map((l) => l.text).join("\n")] }], end };
|
|
7544
7587
|
}
|
|
7545
7588
|
if (name === "raw") {
|
|
7546
7589
|
if (options.size || !argument || argument.split(" ").length !== 1) return unsupported();
|
|
@@ -8979,9 +9022,9 @@ var RtfWriter = class {
|
|
|
8979
9022
|
else this.add(ch);
|
|
8980
9023
|
}
|
|
8981
9024
|
}
|
|
8982
|
-
attrs(
|
|
8983
|
-
if (
|
|
8984
|
-
for (const [key, value] of
|
|
9025
|
+
attrs(attr5, paragraph = false) {
|
|
9026
|
+
if (attr5[0] || attr5[1].length) this.fail("Unsupported RTF identifiers or classes");
|
|
9027
|
+
for (const [key, value] of attr5[2]) {
|
|
8985
9028
|
if (key === "font-family") {
|
|
8986
9029
|
const id = this.fonts.indexOf(value);
|
|
8987
9030
|
if (id < 0) this.fail("Font reference must be explicitly declared in rtf-fonts metadata", "E_RESOURCE");
|
|
@@ -9053,13 +9096,19 @@ var RtfWriter = class {
|
|
|
9053
9096
|
await this.inlines(node.c);
|
|
9054
9097
|
this.add("}");
|
|
9055
9098
|
break;
|
|
9056
|
-
case "Span":
|
|
9099
|
+
case "Span": {
|
|
9100
|
+
const taskState = taskListState(node);
|
|
9101
|
+
if (taskState !== void 0) {
|
|
9102
|
+
this.text(taskState ? "\u2612 " : "\u2610 ");
|
|
9103
|
+
break;
|
|
9104
|
+
}
|
|
9057
9105
|
this.add("{");
|
|
9058
9106
|
this.attrs(node.c[0]);
|
|
9059
9107
|
if (node.c[0][2].length) this.add(" ");
|
|
9060
9108
|
await this.inlines(node.c[1]);
|
|
9061
9109
|
this.add("}");
|
|
9062
9110
|
break;
|
|
9111
|
+
}
|
|
9063
9112
|
case "Code":
|
|
9064
9113
|
this.add("{");
|
|
9065
9114
|
this.attrs(node.c[0]);
|
|
@@ -9111,12 +9160,12 @@ var RtfWriter = class {
|
|
|
9111
9160
|
}
|
|
9112
9161
|
}
|
|
9113
9162
|
}
|
|
9114
|
-
async paragraph(nodes, state,
|
|
9163
|
+
async paragraph(nodes, state, attr5) {
|
|
9115
9164
|
this.add(`{\\pard\\plain\\s${state.style ?? 0}`);
|
|
9116
9165
|
if (state.style) this.add(`\\b\\fs${40 - state.style * 2}`);
|
|
9117
9166
|
this.add(`\\li${state.indent}\\fi${state.marker ? -360 : 0}\\${state.direction}par`);
|
|
9118
9167
|
if (state.cell) this.add(`\\intbl\\${alignments[state.cell]}`);
|
|
9119
|
-
if (
|
|
9168
|
+
if (attr5) this.attrs(attr5, true);
|
|
9120
9169
|
if (state.marker && state.list) this.add(`\\tx${state.indent}\\ls${state.list.id}\\ilvl${state.list.level}`);
|
|
9121
9170
|
this.add(" ");
|
|
9122
9171
|
if (state.marker) {
|
|
@@ -9194,7 +9243,7 @@ var RtfWriter = class {
|
|
|
9194
9243
|
case "Table": {
|
|
9195
9244
|
if (state.cell) this.fail("Nested RTF tables unsupported");
|
|
9196
9245
|
const t = node.c;
|
|
9197
|
-
for (const
|
|
9246
|
+
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
9247
|
if (t[1][1].length) await this.blocks(t[1][1], state);
|
|
9199
9248
|
else if (t[1][0]) await this.paragraph(t[1][0], state);
|
|
9200
9249
|
const widths = t[2].map((c) => c[1].t === "ColWidth" ? c[1].c : 1 / t[2].length);
|
|
@@ -9763,8 +9812,8 @@ var epubReader = {
|
|
|
9763
9812
|
}
|
|
9764
9813
|
if (toc.length) metadata2["epub-toc"] = { t: "MetaList", c: toc };
|
|
9765
9814
|
return { blocks: chapters.map((chapter) => {
|
|
9766
|
-
const
|
|
9767
|
-
return { t: "Div", c: [
|
|
9815
|
+
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]] : []]];
|
|
9816
|
+
return { t: "Div", c: [attr5, chapter.blocks] };
|
|
9768
9817
|
}), metadata: metadata2, resources: [...bag.values()], ...bookLanguage ? { language: xmlText(bookLanguage) } : {}, ...["ltr", "rtl"].includes(bookDirection) ? { direction: bookDirection } : {} };
|
|
9769
9818
|
}
|
|
9770
9819
|
};
|
|
@@ -9793,14 +9842,17 @@ var epubWriter = {
|
|
|
9793
9842
|
if (defaultTreeAdapter.isTextNode(node)) return node.value;
|
|
9794
9843
|
return "childNodes" in node ? node.childNodes.map(text).join("") : "";
|
|
9795
9844
|
};
|
|
9845
|
+
const inlineText = async (nodes) => {
|
|
9846
|
+
const result = await writeHtml5({ blocks: [{ t: "Plain", c: nodes }], metadata: {}, resources: [] }, htmlContext);
|
|
9847
|
+
if (result.kind !== "text") return fail3("Expected text serialization");
|
|
9848
|
+
return text(parseFragment(result.text)).trim();
|
|
9849
|
+
};
|
|
9796
9850
|
const meta2 = async (key) => {
|
|
9797
9851
|
const value = document.metadata[key];
|
|
9798
9852
|
if (value === void 0) return void 0;
|
|
9799
9853
|
if (value.t === "MetaString") return value.c;
|
|
9800
9854
|
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();
|
|
9855
|
+
return inlineText(value.c);
|
|
9804
9856
|
};
|
|
9805
9857
|
const htmlContext = new Proxy(ctx, { get(target, key) {
|
|
9806
9858
|
if (key === "standalone") return false;
|
|
@@ -9811,9 +9863,22 @@ var epubWriter = {
|
|
|
9811
9863
|
const suppliedTitle = ctx.epub?.title ?? await meta2("title");
|
|
9812
9864
|
const suppliedLang = ctx.epub?.language ?? await meta2("lang") ?? document.language;
|
|
9813
9865
|
const explicitIdentifier = ctx.epub?.identifier ?? await meta2("identifier");
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9866
|
+
const headingTitle = async (blocks3) => {
|
|
9867
|
+
for (const block2 of blocks3) {
|
|
9868
|
+
await ctx.cooperate();
|
|
9869
|
+
if (block2.t === "Header") {
|
|
9870
|
+
const title2 = await inlineText(block2.c[2]);
|
|
9871
|
+
if (title2) return title2;
|
|
9872
|
+
}
|
|
9873
|
+
if (block2.t === "Div" || block2.t === "BlockQuote") {
|
|
9874
|
+
const title2 = await headingTitle(block2.t === "Div" ? block2.c[1] : block2.c);
|
|
9875
|
+
if (title2) return title2;
|
|
9876
|
+
}
|
|
9877
|
+
}
|
|
9878
|
+
return void 0;
|
|
9879
|
+
};
|
|
9880
|
+
const title = suppliedTitle ?? await headingTitle(document.blocks) ?? "Untitled";
|
|
9881
|
+
const lang = suppliedLang ?? "en-US";
|
|
9817
9882
|
const modified = await meta2("modified") ?? "1970-01-01T00:00:00Z";
|
|
9818
9883
|
if (!title.trim() || !lang.trim() || explicitIdentifier !== void 0 && !explicitIdentifier.trim()) fail3("Publication metadata must be nonempty", "E_OPTION");
|
|
9819
9884
|
const date = new Date(modified);
|
|
@@ -10431,7 +10496,7 @@ var EncodingMode;
|
|
|
10431
10496
|
})(EncodingMode || (EncodingMode = {}));
|
|
10432
10497
|
var attr2 = ["", [], []];
|
|
10433
10498
|
async function modelContext(ctx) {
|
|
10434
|
-
const { DocumentBudget } = await import("./src-
|
|
10499
|
+
const { DocumentBudget } = await import("./src-ICMQISAA.js");
|
|
10435
10500
|
const l = ctx.limits;
|
|
10436
10501
|
const signal = ctx.signal ?? new AbortController().signal;
|
|
10437
10502
|
return { signal, budget: new DocumentBudget({
|
|
@@ -10465,7 +10530,7 @@ async function guarded(ctx, action) {
|
|
|
10465
10530
|
}
|
|
10466
10531
|
var docxReader = { format: "docx", async read(input, ctx) {
|
|
10467
10532
|
return guarded(ctx, async () => {
|
|
10468
|
-
const { Document: openDocument, Paragraph, Run } = await import("./src-
|
|
10533
|
+
const { Document: openDocument, Paragraph, Run } = await import("./src-ICMQISAA.js");
|
|
10469
10534
|
const model = await openDocument(input.bytes, await modelContext(ctx));
|
|
10470
10535
|
const paragraph = (p) => {
|
|
10471
10536
|
const inlines2 = [];
|
|
@@ -10498,21 +10563,26 @@ var docxReader = { format: "docx", async read(input, ctx) {
|
|
|
10498
10563
|
return { blocks: blocks3, metadata: {}, resources: [] };
|
|
10499
10564
|
});
|
|
10500
10565
|
} };
|
|
10501
|
-
var docxWriter = { format: "docx", async write(document, ctx) {
|
|
10566
|
+
var docxWriter = { format: "docx", imageResources: "embed", async write(document, ctx) {
|
|
10502
10567
|
return guarded(ctx, async () => {
|
|
10503
10568
|
const blocks3 = [];
|
|
10504
10569
|
const paragraphs = [];
|
|
10505
10570
|
const numbering2 = [];
|
|
10506
10571
|
const w = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
|
|
10507
10572
|
const r = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
10508
|
-
const runs = (nodes,
|
|
10573
|
+
const runs = (nodes, style = {}) => {
|
|
10509
10574
|
const result = [];
|
|
10510
10575
|
for (const node of nodes) {
|
|
10511
10576
|
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 === "
|
|
10577
|
+
if (node.t === "Strong") result.push(...runs(node.c, { ...style, bold: true }));
|
|
10578
|
+
else if (node.t === "Emph") result.push(...runs(node.c, { ...style, italic: true }));
|
|
10579
|
+
else if (node.t === "Underline") result.push(...runs(node.c, { ...style, underline: true }));
|
|
10580
|
+
else if (node.t === "Strikeout") result.push(...runs(node.c, { ...style, strike: true }));
|
|
10581
|
+
else if (node.t === "Superscript" || node.t === "Subscript") result.push(...runs(node.c, { ...style, baseline: node.t === "Superscript" ? "superscript" : "subscript" }));
|
|
10582
|
+
else if (node.t === "Span") result.push(...runs(node.c[1], style));
|
|
10583
|
+
else if (node.t === "Link") result.push(...runs(node.c[1], { ...style, link: node.c[2][0] }));
|
|
10584
|
+
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));
|
|
10585
|
+
else if (node.t === "Image") result.push({ ...style, text: "", image: node });
|
|
10516
10586
|
else {
|
|
10517
10587
|
let text;
|
|
10518
10588
|
if (node.t === "Str") text = node.c;
|
|
@@ -10520,14 +10590,14 @@ var docxWriter = { format: "docx", async write(document, ctx) {
|
|
|
10520
10590
|
else if (node.t === "LineBreak") text = "\n";
|
|
10521
10591
|
else if (node.t === "Code") text = node.c[1];
|
|
10522
10592
|
else throw new PandocError("E_UNSUPPORTED_FEATURE", "write", `Unsupported DOCX inline: ${node.t}`, "docx");
|
|
10523
|
-
result.push({
|
|
10593
|
+
result.push({ ...style, text });
|
|
10524
10594
|
}
|
|
10525
10595
|
}
|
|
10526
10596
|
return result;
|
|
10527
10597
|
};
|
|
10528
10598
|
const paragraph = (target, content, properties, level) => {
|
|
10529
10599
|
paragraphs.push({ runs: content, properties });
|
|
10530
|
-
target.push({ kind: "paragraph", ...level === void 0 ? {} : { level }, runs: content.map(({ link: _link, ...run }) => run) });
|
|
10600
|
+
target.push({ kind: "paragraph", ...level === void 0 ? {} : { level }, runs: content.map(({ link: _link, strike: _strike, baseline: _baseline, image: _image, ...run }) => run) });
|
|
10531
10601
|
};
|
|
10532
10602
|
const visit5 = async (nodes, target, indent3 = 0, list2) => {
|
|
10533
10603
|
for (const block2 of nodes) {
|
|
@@ -10575,7 +10645,7 @@ var docxWriter = { format: "docx", async write(document, ctx) {
|
|
|
10575
10645
|
}
|
|
10576
10646
|
};
|
|
10577
10647
|
await visit5(document.blocks, blocks3);
|
|
10578
|
-
const { createDocumentArchive, writeDocumentArchive, DocumentXmlEditor } = await import("./src-
|
|
10648
|
+
const { createDocumentArchive, writeDocumentArchive, DocumentXmlEditor, Image } = await import("./src-ICMQISAA.js");
|
|
10579
10649
|
const mc = await modelContext(ctx);
|
|
10580
10650
|
const archiveContext = { signal: mc.signal, budget: mc.budget };
|
|
10581
10651
|
const archive = await createDocumentArchive({ content: { version: 1, blocks: blocks3 } }, archiveContext);
|
|
@@ -10583,6 +10653,30 @@ var docxWriter = { format: "docx", async write(document, ctx) {
|
|
|
10583
10653
|
const relationships = new DocumentXmlEditor(archive.members.find((member) => member.name === "word/_rels/document.xml.rels").bytes, {}, void 0, mc.budget);
|
|
10584
10654
|
let paragraphIndex = 0, relationshipId = 2;
|
|
10585
10655
|
const linkRelationships = [];
|
|
10656
|
+
const media = /* @__PURE__ */ new Map();
|
|
10657
|
+
let drawingId = 0;
|
|
10658
|
+
const drawing = async (node) => {
|
|
10659
|
+
ctx.charge("images", 1);
|
|
10660
|
+
const source = node.c[2][0];
|
|
10661
|
+
let entry = media.get(source);
|
|
10662
|
+
if (!entry) {
|
|
10663
|
+
const bytes2 = document.resources.find((resource) => resource.id === source)?.bytes ?? await ctx.resources?.resolve(source, void 0, ctx.signal);
|
|
10664
|
+
if (!bytes2) throw new PandocError("E_RESOURCE", "write", `Missing image resource: ${source}`, "docx");
|
|
10665
|
+
ctx.charge("resourceBytes", bytes2.length);
|
|
10666
|
+
const asset = await Image.from_blob(bytes2, mc);
|
|
10667
|
+
const name = `media/image-${media.size + 1}.${asset.ext}`;
|
|
10668
|
+
entry = { name, bytes: bytes2, type: asset.content_type, id: `rId${relationshipId++}`, asset };
|
|
10669
|
+
media.set(source, entry);
|
|
10670
|
+
linkRelationships.push(`<Relationship Id="${entry.id}" Type="${r}/image" Target="${name}"/>`);
|
|
10671
|
+
}
|
|
10672
|
+
const attributes = Object.fromEntries(node.c[0][2]);
|
|
10673
|
+
let width = imageLength(attributes.width, entry.asset.width.emu, ctx, "docx"), height = imageLength(attributes.height, entry.asset.height.emu, ctx, "docx");
|
|
10674
|
+
if (attributes.width && !attributes.height) height = Math.max(1, Math.round(width * entry.asset.height.emu / entry.asset.width.emu));
|
|
10675
|
+
if (attributes.height && !attributes.width) width = Math.max(1, Math.round(height * entry.asset.width.emu / entry.asset.height.emu));
|
|
10676
|
+
const alt = encodeXML(runs(node.c[1]).map((run) => run.text).join(""));
|
|
10677
|
+
const a = "http://schemas.openxmlformats.org/drawingml/2006/main", pic = "http://schemas.openxmlformats.org/drawingml/2006/picture";
|
|
10678
|
+
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>`;
|
|
10679
|
+
};
|
|
10586
10680
|
const edit = async (node) => {
|
|
10587
10681
|
await ctx.cooperate();
|
|
10588
10682
|
if (node.namespace === w && node.localName === "p") {
|
|
@@ -10592,13 +10686,21 @@ var docxWriter = { format: "docx", async write(document, ctx) {
|
|
|
10592
10686
|
const properties = node.children.find((child) => child.localName === "pPr");
|
|
10593
10687
|
if (properties && extra.properties) replacements.set(properties, `<w:pPr>${main.sourceXml(properties, /* @__PURE__ */ new Map(), true)}${extra.properties}</w:pPr>`);
|
|
10594
10688
|
const nativeRuns = node.children.filter((child) => child.localName === "r");
|
|
10595
|
-
for (const [index, run] of extra.runs.entries())
|
|
10689
|
+
for (const [index, run] of extra.runs.entries()) {
|
|
10596
10690
|
ctx.checkpoint();
|
|
10597
10691
|
const native = nativeRuns[index];
|
|
10598
|
-
const
|
|
10599
|
-
const
|
|
10600
|
-
|
|
10601
|
-
|
|
10692
|
+
const properties2 = native.children.find((child) => child.localName === "rPr");
|
|
10693
|
+
const format2 = (run.strike ? "<w:strike/>" : "") + (run.baseline ? `<w:vertAlign w:val="${run.baseline}"/>` : "");
|
|
10694
|
+
const edits = /* @__PURE__ */ new Map();
|
|
10695
|
+
if (properties2 && format2) edits.set(properties2, `<w:rPr>${main.sourceXml(properties2, /* @__PURE__ */ new Map(), true)}${format2}</w:rPr>`);
|
|
10696
|
+
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>`;
|
|
10697
|
+
if (run.link !== void 0) {
|
|
10698
|
+
const anchor = run.link.startsWith("#");
|
|
10699
|
+
const id = `rId${relationshipId++}`;
|
|
10700
|
+
if (!anchor) linkRelationships.push(`<Relationship Id="${id}" Type="${r}/hyperlink" Target="${encodeXML(run.link)}" TargetMode="External"/>`);
|
|
10701
|
+
xml = `<w:hyperlink ${anchor ? `w:anchor="${encodeXML(run.link.slice(1))}"` : `xmlns:r="${r}" r:id="${id}"`}>${xml}</w:hyperlink>`;
|
|
10702
|
+
}
|
|
10703
|
+
if (format2 || run.image || run.link !== void 0) replacements.set(native, xml);
|
|
10602
10704
|
}
|
|
10603
10705
|
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
10706
|
} else for (const child of node.children) await edit(child);
|
|
@@ -10608,8 +10710,10 @@ var docxWriter = { format: "docx", async write(document, ctx) {
|
|
|
10608
10710
|
if (linkRelationships.length) relationships.insertChildren(relationships.root, linkRelationships.map((xml) => xml.replace("<Relationship ", '<Relationship xmlns="http://schemas.openxmlformats.org/package/2006/relationships" ')).join(""));
|
|
10609
10711
|
const types = new DocumentXmlEditor(archive.members.find((member) => member.name === "[Content_Types].xml").bytes, {}, void 0, mc.budget);
|
|
10610
10712
|
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"/>');
|
|
10713
|
+
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
10714
|
const parts = /* @__PURE__ */ new Map([["word/document.xml", main.serialize()], ["word/_rels/document.xml.rels", relationships.serialize()], ["[Content_Types].xml", types.serialize()]]);
|
|
10612
10715
|
const members = archive.members.map((member) => ({ ...member, bytes: parts.get(member.name) ?? member.bytes }));
|
|
10716
|
+
for (const entry of media.values()) members.push({ name: `word/${entry.name}`, bytes: entry.bytes, directory: false, modified: /* @__PURE__ */ new Date(0) });
|
|
10613
10717
|
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
10718
|
const chunks = [];
|
|
10615
10719
|
let size = 0;
|
|
@@ -10643,6 +10747,448 @@ var docx_default = {
|
|
|
10643
10747
|
write: ["standalone"]
|
|
10644
10748
|
}
|
|
10645
10749
|
};
|
|
10750
|
+
var import_saxes2 = __toESM(require_saxes(), 1);
|
|
10751
|
+
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`]));
|
|
10752
|
+
var odtMime = "application/vnd.oasis.opendocument.text";
|
|
10753
|
+
var fo = "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0";
|
|
10754
|
+
var xlink = "http://www.w3.org/1999/xlink";
|
|
10755
|
+
var svg = "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0";
|
|
10756
|
+
function odtAttribute(node, name, uri2) {
|
|
10757
|
+
return node.attrs.find((a) => a.name === name && a.uri === uri2)?.value ?? "";
|
|
10758
|
+
}
|
|
10759
|
+
function odtChildren(node, name, uri2) {
|
|
10760
|
+
return node.children.filter((child) => typeof child !== "string" && child.name === name && child.uri === uri2);
|
|
10761
|
+
}
|
|
10762
|
+
function odtFailure(ctx, message, code = "E_PARSE") {
|
|
10763
|
+
throw new PandocError(code, ctx.operation ?? "read", message, "odt");
|
|
10764
|
+
}
|
|
10765
|
+
async function parseOdtXml(bytes, ctx) {
|
|
10766
|
+
ctx.bound("binaryBytes", bytes.length);
|
|
10767
|
+
const text = await ctx.decodeUtf8([bytes]);
|
|
10768
|
+
const parser = new import_saxes2.SaxesParser({ xmlns: true });
|
|
10769
|
+
const stack = [];
|
|
10770
|
+
let root;
|
|
10771
|
+
parser.on("error", (error) => odtFailure(ctx, `Invalid ODT XML: ${error.message}`));
|
|
10772
|
+
parser.on("doctype", () => odtFailure(ctx, "ODT DTD and external entities are forbidden"));
|
|
10773
|
+
parser.on("opentag", (tag) => {
|
|
10774
|
+
ctx.checkpoint();
|
|
10775
|
+
ctx.bound("xmlDepth", stack.length + 1);
|
|
10776
|
+
ctx.charge("xmlNodes", 1);
|
|
10777
|
+
ctx.charge("attributes", Object.keys(tag.attributes).length);
|
|
10778
|
+
ctx.charge("retainedBytes", 128 + Object.keys(tag.attributes).length * 64);
|
|
10779
|
+
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: [] };
|
|
10780
|
+
if (stack.length) stack.at(-1).children.push(node);
|
|
10781
|
+
else root = node;
|
|
10782
|
+
stack.push(node);
|
|
10783
|
+
});
|
|
10784
|
+
parser.on("closetag", () => {
|
|
10785
|
+
stack.pop();
|
|
10786
|
+
});
|
|
10787
|
+
const append2 = (value) => {
|
|
10788
|
+
ctx.charge("retainedBytes", value.length * 2);
|
|
10789
|
+
if (stack.length) stack.at(-1).children.push(value);
|
|
10790
|
+
};
|
|
10791
|
+
parser.on("text", append2);
|
|
10792
|
+
parser.on("cdata", append2);
|
|
10793
|
+
for (let i = 0; i < text.length; i += 4096) {
|
|
10794
|
+
parser.write(text.slice(i, i + 4096));
|
|
10795
|
+
await ctx.cooperate(4096);
|
|
10796
|
+
}
|
|
10797
|
+
parser.close();
|
|
10798
|
+
return root ?? odtFailure(ctx, "Missing ODT XML root");
|
|
10799
|
+
}
|
|
10800
|
+
function odtPackage(ctx) {
|
|
10801
|
+
const signal = ctx.signal ?? new AbortController().signal;
|
|
10802
|
+
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 };
|
|
10803
|
+
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 });
|
|
10804
|
+
return {
|
|
10805
|
+
async read(bytes) {
|
|
10806
|
+
ctx.bound("compressedBytes", bytes.length);
|
|
10807
|
+
const archive = await codec.readZipArchive(bytes, { ...limits, maxArchiveBytes: ctx.limits.compressedBytes }, signal);
|
|
10808
|
+
ctx.charge("parts", archive.entries.length);
|
|
10809
|
+
const parts = /* @__PURE__ */ new Map();
|
|
10810
|
+
for (const entry of archive.entries) {
|
|
10811
|
+
if (entry.symlink || entry.name.includes("\\") || entry.name.includes(":")) odtFailure(ctx, "Unsafe ODT package member");
|
|
10812
|
+
const chunks = [];
|
|
10813
|
+
let size = 0;
|
|
10814
|
+
for await (const chunk of codec.decodeZipEntry(entry, limits, signal)) {
|
|
10815
|
+
ctx.charge("expandedBytes", chunk.length);
|
|
10816
|
+
ctx.charge("retainedBytes", chunk.length * 2);
|
|
10817
|
+
chunks.push(chunk);
|
|
10818
|
+
size += chunk.length;
|
|
10819
|
+
}
|
|
10820
|
+
if (entry.directory) continue;
|
|
10821
|
+
const data = new Uint8Array(size);
|
|
10822
|
+
let offset = 0;
|
|
10823
|
+
for (const chunk of chunks) {
|
|
10824
|
+
data.set(chunk, offset);
|
|
10825
|
+
offset += chunk.length;
|
|
10826
|
+
}
|
|
10827
|
+
parts.set(entry.name, data);
|
|
10828
|
+
}
|
|
10829
|
+
if (new TextDecoder().decode(parts.get("mimetype")) !== odtMime) odtFailure(ctx, "Invalid or missing ODT mimetype");
|
|
10830
|
+
return parts;
|
|
10831
|
+
},
|
|
10832
|
+
async write(parts) {
|
|
10833
|
+
const entries = [];
|
|
10834
|
+
for (const [name, bytes] of parts) {
|
|
10835
|
+
ctx.charge("parts", 1);
|
|
10836
|
+
ctx.charge("expandedBytes", bytes.length);
|
|
10837
|
+
ctx.charge("retainedBytes", bytes.length);
|
|
10838
|
+
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);
|
|
10839
|
+
if (name === "mimetype") {
|
|
10840
|
+
entry.localExtra = new Uint8Array();
|
|
10841
|
+
entry.centralExtra = new Uint8Array();
|
|
10842
|
+
}
|
|
10843
|
+
entries.push(entry);
|
|
10844
|
+
}
|
|
10845
|
+
return codec.writeZipArchive({ entries, comment: new Uint8Array() }, { ...limits, maxArchiveBytes: ctx.limits.outputBytes }, signal);
|
|
10846
|
+
}
|
|
10847
|
+
};
|
|
10848
|
+
}
|
|
10849
|
+
var attr3 = ["", [], []];
|
|
10850
|
+
var odtReader = { format: "odt", async read(input, ctx) {
|
|
10851
|
+
const parts = await odtPackage(ctx).read(input.bytes);
|
|
10852
|
+
const source = parts.get("content.xml") ?? odtFailure(ctx, "Missing ODT content.xml");
|
|
10853
|
+
const root = await parseOdtXml(source, ctx);
|
|
10854
|
+
if (root.uri !== odtNamespaces.office || root.name !== "document-content") odtFailure(ctx, "Invalid ODT content root");
|
|
10855
|
+
const bodies = odtChildren(root, "body", odtNamespaces.office).flatMap((body) => odtChildren(body, "text", odtNamespaces.office));
|
|
10856
|
+
if (bodies.length !== 1) odtFailure(ctx, "Expected one ODT text body");
|
|
10857
|
+
const styles = /* @__PURE__ */ new Map();
|
|
10858
|
+
const resources = /* @__PURE__ */ new Map();
|
|
10859
|
+
const collectStyles = (node) => {
|
|
10860
|
+
ctx.checkpoint();
|
|
10861
|
+
if (node.uri === odtNamespaces.style && node.name === "style" || node.uri === odtNamespaces.text && node.name === "list-style") styles.set(odtAttribute(node, "name", odtNamespaces.style), node);
|
|
10862
|
+
for (const child of node.children) if (typeof child !== "string") collectStyles(child);
|
|
10863
|
+
};
|
|
10864
|
+
if (parts.has("styles.xml")) collectStyles(await parseOdtXml(parts.get("styles.xml"), ctx));
|
|
10865
|
+
collectStyles(root);
|
|
10866
|
+
const styleChain = (name) => {
|
|
10867
|
+
const names = /* @__PURE__ */ new Set();
|
|
10868
|
+
while (name) {
|
|
10869
|
+
ctx.checkpoint();
|
|
10870
|
+
ctx.bound("depth", names.size + 1);
|
|
10871
|
+
if (names.has(name)) odtFailure(ctx, "Cyclic ODT style inheritance");
|
|
10872
|
+
names.add(name);
|
|
10873
|
+
const style = styles.get(name);
|
|
10874
|
+
name = style ? odtAttribute(style, "parent-style-name", odtNamespaces.style) : "";
|
|
10875
|
+
}
|
|
10876
|
+
return [...names];
|
|
10877
|
+
};
|
|
10878
|
+
const properties = (name) => {
|
|
10879
|
+
const result = /* @__PURE__ */ new Map();
|
|
10880
|
+
for (const parent of styleChain(name).reverse()) {
|
|
10881
|
+
const style = styles.get(parent);
|
|
10882
|
+
if (!style) continue;
|
|
10883
|
+
for (const child of odtChildren(style, "text-properties", odtNamespaces.style)) for (const prop of child.attrs) result.set(`${prop.uri}:${prop.name}`, prop.value);
|
|
10884
|
+
}
|
|
10885
|
+
return result;
|
|
10886
|
+
};
|
|
10887
|
+
const plainText = (node) => {
|
|
10888
|
+
ctx.checkpoint();
|
|
10889
|
+
return node.children.map((child) => typeof child === "string" ? child : plainText(child)).join("");
|
|
10890
|
+
};
|
|
10891
|
+
const count = (value, maximum) => {
|
|
10892
|
+
const n = value ? Number(value) : 1;
|
|
10893
|
+
if (!Number.isSafeInteger(n) || n < 1) odtFailure(ctx, "Invalid ODT repetition count");
|
|
10894
|
+
if (n > maximum) odtFailure(ctx, "ODT repetition limit exceeded", "E_LIMIT");
|
|
10895
|
+
ctx.checkpoint(n);
|
|
10896
|
+
return n;
|
|
10897
|
+
};
|
|
10898
|
+
const inlines2 = (nodes) => {
|
|
10899
|
+
const result = [];
|
|
10900
|
+
for (const node of nodes) {
|
|
10901
|
+
ctx.checkpoint();
|
|
10902
|
+
if (typeof node === "string") {
|
|
10903
|
+
if (node) result.push({ t: "Str", c: node });
|
|
10904
|
+
continue;
|
|
10905
|
+
}
|
|
10906
|
+
if (node.uri === odtNamespaces.text) {
|
|
10907
|
+
if (node.name === "s") {
|
|
10908
|
+
const n = count(odtAttribute(node, "c", odtNamespaces.text), ctx.limits.text);
|
|
10909
|
+
ctx.charge("retainedBytes", n * 2);
|
|
10910
|
+
result.push({ t: "Str", c: " ".repeat(n) });
|
|
10911
|
+
} else if (node.name === "tab") result.push({ t: "Str", c: " " });
|
|
10912
|
+
else if (node.name === "line-break") result.push({ t: "LineBreak" });
|
|
10913
|
+
else if (node.name === "a") result.push({ t: "Link", c: [attr3, inlines2(node.children), [odtAttribute(node, "href", xlink), ""]] });
|
|
10914
|
+
else if (node.name === "span") {
|
|
10915
|
+
let content2 = inlines2(node.children);
|
|
10916
|
+
const props = properties(odtAttribute(node, "style-name", odtNamespaces.text));
|
|
10917
|
+
const tags = [
|
|
10918
|
+
{ tag: "Strong", enabled: props.get(`${fo}:font-weight`) === "bold" },
|
|
10919
|
+
{ tag: "Emph", enabled: props.get(`${fo}:font-style`) === "italic" },
|
|
10920
|
+
{ tag: "Strikeout", enabled: ["solid", "double"].includes(props.get(`${odtNamespaces.style}:text-line-through-style`) ?? "") },
|
|
10921
|
+
{ tag: "Superscript", enabled: props.get(`${odtNamespaces.style}:text-position`)?.startsWith("super") ?? false },
|
|
10922
|
+
{ tag: "Subscript", enabled: props.get(`${odtNamespaces.style}:text-position`)?.startsWith("sub") ?? false },
|
|
10923
|
+
{ tag: "Underline", enabled: props.get(`${odtNamespaces.style}:text-underline-style`) === "solid" },
|
|
10924
|
+
{ tag: "SmallCaps", enabled: props.get(`${fo}:font-variant`) === "small-caps" }
|
|
10925
|
+
];
|
|
10926
|
+
for (const { tag, enabled } of tags) if (enabled) content2 = [{ t: tag, c: content2 }];
|
|
10927
|
+
result.push(...content2);
|
|
10928
|
+
} else if (["bookmark", "bookmark-start"].includes(node.name)) result.push({ t: "Span", c: [[odtAttribute(node, "name", odtNamespaces.text), [], []], []] });
|
|
10929
|
+
else if (!["bookmark-end", "soft-page-break"].includes(node.name)) odtFailure(ctx, `Unsupported ODT inline: ${node.name}`, "E_UNSUPPORTED_FEATURE");
|
|
10930
|
+
} else if (node.uri === odtNamespaces.draw && node.name === "frame") {
|
|
10931
|
+
const image = odtChildren(node, "image", odtNamespaces.draw)[0];
|
|
10932
|
+
if (!image) odtFailure(ctx, "Unsupported ODT drawing", "E_UNSUPPORTED_FEATURE");
|
|
10933
|
+
let name;
|
|
10934
|
+
try {
|
|
10935
|
+
name = decodeURIComponent(odtAttribute(image, "href", xlink));
|
|
10936
|
+
} catch {
|
|
10937
|
+
return odtFailure(ctx, "Invalid ODT image URI", "E_RESOURCE");
|
|
10938
|
+
}
|
|
10939
|
+
if (name.startsWith("./")) name = name.slice(2);
|
|
10940
|
+
if (!name || name.startsWith("/") || name.includes(":") || name.includes("\\") || name.split("/").some((part) => !part || part === "." || part === "..")) odtFailure(ctx, "Unsafe ODT image reference", "E_RESOURCE");
|
|
10941
|
+
const bytes = parts.get(name) ?? odtFailure(ctx, `Missing ODT image: ${name}`, "E_RESOURCE");
|
|
10942
|
+
if (!resources.has(name)) {
|
|
10943
|
+
ctx.charge("resourceBytes", bytes.length);
|
|
10944
|
+
resources.set(name, { id: name, bytes });
|
|
10945
|
+
}
|
|
10946
|
+
const attributes = [];
|
|
10947
|
+
for (const dimension of ["width", "height"]) {
|
|
10948
|
+
const value = odtAttribute(node, dimension, svg);
|
|
10949
|
+
if (value) attributes.push([dimension, value]);
|
|
10950
|
+
}
|
|
10951
|
+
result.push({ t: "Image", c: [["", [], attributes], [{ t: "Str", c: odtChildren(node, "desc", svg).map(plainText).join("") }], [name, odtChildren(node, "title", svg).map(plainText).join("")]] });
|
|
10952
|
+
} else odtFailure(ctx, `Unsupported ODT inline namespace: ${node.uri}`, "E_UNSUPPORTED_FEATURE");
|
|
10953
|
+
}
|
|
10954
|
+
return result;
|
|
10955
|
+
};
|
|
10956
|
+
const blocks3 = async (nodes, listLevel = 1) => {
|
|
10957
|
+
const result = [];
|
|
10958
|
+
for (const node of nodes) {
|
|
10959
|
+
await ctx.cooperate();
|
|
10960
|
+
if (typeof node === "string") {
|
|
10961
|
+
if (node.trim()) odtFailure(ctx, "Text outside ODT paragraph");
|
|
10962
|
+
continue;
|
|
10963
|
+
}
|
|
10964
|
+
if (node.uri === odtNamespaces.text && ["p", "h"].includes(node.name)) {
|
|
10965
|
+
const content2 = inlines2(node.children), names = styleChain(odtAttribute(node, "style-name", odtNamespaces.text));
|
|
10966
|
+
if (node.name === "h") result.push({ t: "Header", c: [count(odtAttribute(node, "outline-level", odtNamespaces.text), 6), attr3, content2] });
|
|
10967
|
+
else if (names.includes("Rule")) result.push({ t: "HorizontalRule" });
|
|
10968
|
+
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("")] });
|
|
10969
|
+
else if (names.some((name) => ["Quote", "Quotations"].includes(name))) result.push({ t: "BlockQuote", c: [{ t: "Para", c: content2 }] });
|
|
10970
|
+
else result.push({ t: "Para", c: content2 });
|
|
10971
|
+
} else if (node.uri === odtNamespaces.text && node.name === "section") result.push({ t: "Div", c: [[odtAttribute(node, "name", odtNamespaces.text), [], []], await blocks3(node.children, listLevel)] });
|
|
10972
|
+
else if (node.uri === odtNamespaces.text && node.name === "list") {
|
|
10973
|
+
const style = styles.get(odtAttribute(node, "style-name", odtNamespaces.text));
|
|
10974
|
+
const level = style?.children.find((child) => typeof child !== "string" && child.uri === odtNamespaces.text && Number(odtAttribute(child, "level", odtNamespaces.text)) === listLevel);
|
|
10975
|
+
const items = odtChildren(node, "list-item", odtNamespaces.text), content2 = [];
|
|
10976
|
+
for (const item of items) content2.push(await blocks3(item.children, listLevel + 1));
|
|
10977
|
+
if (level?.name === "list-level-style-number") {
|
|
10978
|
+
const start = count(items[0] && odtAttribute(items[0], "start-value", odtNamespaces.text) || odtAttribute(level, "start-value", odtNamespaces.text), Number.MAX_SAFE_INTEGER);
|
|
10979
|
+
const style2 = { "1": "Decimal", a: "LowerAlpha", A: "UpperAlpha", i: "LowerRoman", I: "UpperRoman" }[odtAttribute(level, "num-format", odtNamespaces.style)] ?? "Decimal";
|
|
10980
|
+
result.push({ t: "OrderedList", c: [[start, style2, odtAttribute(level, "num-prefix", odtNamespaces.style) === "(" ? "TwoParens" : odtAttribute(level, "num-suffix", odtNamespaces.style) === ")" ? "OneParen" : "Period"], content2] });
|
|
10981
|
+
} else result.push({ t: "BulletList", c: content2 });
|
|
10982
|
+
} else if (node.uri === odtNamespaces.table && node.name === "table") {
|
|
10983
|
+
const head2 = [], rows = [];
|
|
10984
|
+
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 }] : []);
|
|
10985
|
+
let columns = 0;
|
|
10986
|
+
for (const { row: row2, header } of rowNodes) {
|
|
10987
|
+
const cells = [];
|
|
10988
|
+
for (const cell2 of odtChildren(row2, "table-cell", odtNamespaces.table)) {
|
|
10989
|
+
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");
|
|
10990
|
+
const repeat2 = count(odtAttribute(cell2, "number-columns-repeated", odtNamespaces.table), ctx.limits.tableColumns);
|
|
10991
|
+
const content2 = await blocks3(cell2.children);
|
|
10992
|
+
for (let i = 0; i < repeat2; i++) {
|
|
10993
|
+
ctx.charge("tableCells", 1);
|
|
10994
|
+
cells.push([attr3, "AlignDefault", 1, 1, content2]);
|
|
10995
|
+
}
|
|
10996
|
+
ctx.bound("tableColumns", cells.length);
|
|
10997
|
+
}
|
|
10998
|
+
columns = Math.max(columns, cells.length);
|
|
10999
|
+
const repeat = count(odtAttribute(row2, "number-rows-repeated", odtNamespaces.table), ctx.limits.tableRows);
|
|
11000
|
+
ctx.charge("tableCells", (repeat - 1) * cells.length);
|
|
11001
|
+
for (let i = 0; i < repeat; i++) (header ? head2 : rows).push([attr3, cells]);
|
|
11002
|
+
ctx.bound("tableRows", head2.length + rows.length);
|
|
11003
|
+
}
|
|
11004
|
+
const specs = Array.from({ length: columns }, () => ["AlignDefault", { t: "ColWidthDefault" }]);
|
|
11005
|
+
result.push({ t: "Table", c: [attr3, [null, []], specs, [attr3, head2], [[attr3, 0, [], rows]], [attr3, []]] });
|
|
11006
|
+
} else if (!(node.uri === odtNamespaces.text && ["sequence-decls", "tracked-changes"].includes(node.name))) odtFailure(ctx, `Unsupported ODT block: ${node.name}`, "E_UNSUPPORTED_FEATURE");
|
|
11007
|
+
}
|
|
11008
|
+
return result;
|
|
11009
|
+
};
|
|
11010
|
+
const metadata2 = {};
|
|
11011
|
+
if (parts.has("meta.xml")) {
|
|
11012
|
+
const meta2 = await parseOdtXml(parts.get("meta.xml"), ctx);
|
|
11013
|
+
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) };
|
|
11014
|
+
}
|
|
11015
|
+
const content = await blocks3(bodies[0].children);
|
|
11016
|
+
return { blocks: content, metadata: metadata2, resources: [...resources.values()] };
|
|
11017
|
+
} };
|
|
11018
|
+
var odtWriter = { format: "odt", imageResources: "embed", async write(document, ctx) {
|
|
11019
|
+
const parts = /* @__PURE__ */ new Map([["mimetype", new TextEncoder().encode(odtMime)]]);
|
|
11020
|
+
const mediaTypes = /* @__PURE__ */ new Map();
|
|
11021
|
+
const images = /* @__PURE__ */ new Map();
|
|
11022
|
+
const styles = /* @__PURE__ */ new Map();
|
|
11023
|
+
let serial = 0;
|
|
11024
|
+
const escaped = (value) => {
|
|
11025
|
+
ctx.checkpoint(value.length);
|
|
11026
|
+
for (const ch of value) {
|
|
11027
|
+
const code = ch.codePointAt(0);
|
|
11028
|
+
if (code < 32 && ![9, 10, 13].includes(code) || code === 65534 || code === 65535) odtFailure(ctx, "Invalid XML character");
|
|
11029
|
+
}
|
|
11030
|
+
const result = encodeXML(value);
|
|
11031
|
+
ctx.charge("retainedBytes", result.length * 2);
|
|
11032
|
+
return result;
|
|
11033
|
+
};
|
|
11034
|
+
const text = (value) => escaped(value).split(" ").join("<text:s/>").split(" ").join("<text:tab/>").split("\n").join("<text:line-break/>");
|
|
11035
|
+
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"' };
|
|
11036
|
+
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>`);
|
|
11037
|
+
styles.set("Rule", '<style:style style:name="Rule" style:family="paragraph"><style:paragraph-properties fo:border-bottom="0.5pt solid #000000"/></style:style>');
|
|
11038
|
+
styles.set("Preformatted", '<style:style style:name="Preformatted" style:family="paragraph"><style:text-properties fo:font-family="monospace"/></style:style>');
|
|
11039
|
+
const inlines2 = async (nodes) => {
|
|
11040
|
+
const output = [];
|
|
11041
|
+
for (const node of nodes) {
|
|
11042
|
+
await ctx.cooperate();
|
|
11043
|
+
switch (node.t) {
|
|
11044
|
+
case "Str":
|
|
11045
|
+
output.push(text(node.c));
|
|
11046
|
+
break;
|
|
11047
|
+
case "Space":
|
|
11048
|
+
case "SoftBreak":
|
|
11049
|
+
output.push("<text:s/>");
|
|
11050
|
+
break;
|
|
11051
|
+
case "LineBreak":
|
|
11052
|
+
output.push("<text:line-break/>");
|
|
11053
|
+
break;
|
|
11054
|
+
case "Strong":
|
|
11055
|
+
case "Emph":
|
|
11056
|
+
case "Strikeout":
|
|
11057
|
+
case "Superscript":
|
|
11058
|
+
case "Subscript":
|
|
11059
|
+
case "Underline":
|
|
11060
|
+
case "SmallCaps":
|
|
11061
|
+
output.push(`<text:span text:style-name="${node.t}">${await inlines2(node.c)}</text:span>`);
|
|
11062
|
+
break;
|
|
11063
|
+
case "Code":
|
|
11064
|
+
output.push(`<text:span text:style-name="Code">${text(node.c[1])}</text:span>`);
|
|
11065
|
+
break;
|
|
11066
|
+
case "Span":
|
|
11067
|
+
output.push(await inlines2(node.c[1]));
|
|
11068
|
+
break;
|
|
11069
|
+
case "Quoted":
|
|
11070
|
+
output.push((node.c[0] === "SingleQuote" ? "\u2018" : "\u201C") + await inlines2(node.c[1]) + (node.c[0] === "SingleQuote" ? "\u2019" : "\u201D"));
|
|
11071
|
+
break;
|
|
11072
|
+
case "Link":
|
|
11073
|
+
output.push(`<text:a xlink:type="simple" xlink:href="${escaped(node.c[2][0])}">${await inlines2(node.c[1])}</text:a>`);
|
|
11074
|
+
break;
|
|
11075
|
+
case "Image": {
|
|
11076
|
+
const source = node.c[2][0];
|
|
11077
|
+
let image = images.get(source);
|
|
11078
|
+
ctx.charge("images", 1);
|
|
11079
|
+
if (!image) {
|
|
11080
|
+
const bytes = document.resources.find((r) => r.id === source)?.bytes ?? await ctx.resources?.resolve(source, void 0, ctx.signal);
|
|
11081
|
+
if (!bytes) odtFailure(ctx, `Missing image resource: ${source}`, "E_RESOURCE");
|
|
11082
|
+
ctx.charge("resourceBytes", bytes.length);
|
|
11083
|
+
const { Image, DocumentBudget } = await import("./src-ICMQISAA.js");
|
|
11084
|
+
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 }) });
|
|
11085
|
+
image = { name: `Pictures/image-${images.size + 1}.${asset.ext}`, width: asset.width.emu, height: asset.height.emu };
|
|
11086
|
+
images.set(source, image);
|
|
11087
|
+
parts.set(image.name, bytes);
|
|
11088
|
+
mediaTypes.set(image.name, asset.content_type);
|
|
11089
|
+
}
|
|
11090
|
+
const attrs = Object.fromEntries(node.c[0][2]);
|
|
11091
|
+
let width = imageLength(attrs.width, image.width, ctx, "odt"), height = imageLength(attrs.height, image.height, ctx, "odt");
|
|
11092
|
+
if (attrs.width && !attrs.height) height = width * image.height / image.width;
|
|
11093
|
+
if (attrs.height && !attrs.width) width = height * image.width / image.height;
|
|
11094
|
+
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>`);
|
|
11095
|
+
break;
|
|
11096
|
+
}
|
|
11097
|
+
default:
|
|
11098
|
+
odtFailure(ctx, `Unsupported ODT inline: ${node.t}`, "E_UNSUPPORTED_FEATURE");
|
|
11099
|
+
}
|
|
11100
|
+
}
|
|
11101
|
+
return output.join("");
|
|
11102
|
+
};
|
|
11103
|
+
const blocks3 = async (nodes, paragraphStyle = "", listLevel = 1) => {
|
|
11104
|
+
const output = [];
|
|
11105
|
+
for (const node of nodes) {
|
|
11106
|
+
await ctx.cooperate();
|
|
11107
|
+
switch (node.t) {
|
|
11108
|
+
case "Para":
|
|
11109
|
+
case "Plain":
|
|
11110
|
+
output.push(`<text:p${paragraphStyle ? ` text:style-name="${paragraphStyle}"` : ""}>${await inlines2(node.c)}</text:p>`);
|
|
11111
|
+
break;
|
|
11112
|
+
case "Header":
|
|
11113
|
+
output.push(`<text:h text:outline-level="${node.c[0]}">${await inlines2(node.c[2])}</text:h>`);
|
|
11114
|
+
break;
|
|
11115
|
+
case "CodeBlock":
|
|
11116
|
+
output.push(`<text:p text:style-name="Preformatted">${text(node.c[1])}</text:p>`);
|
|
11117
|
+
break;
|
|
11118
|
+
case "BlockQuote":
|
|
11119
|
+
output.push(await blocks3(node.c, "Quotations", listLevel));
|
|
11120
|
+
break;
|
|
11121
|
+
case "HorizontalRule":
|
|
11122
|
+
output.push('<text:p text:style-name="Rule"/>');
|
|
11123
|
+
break;
|
|
11124
|
+
case "Div":
|
|
11125
|
+
output.push(`<text:section text:name="${escaped(node.c[0][0] || `Section${++serial}`)}">${await blocks3(node.c[1], paragraphStyle, listLevel)}</text:section>`);
|
|
11126
|
+
break;
|
|
11127
|
+
case "BulletList":
|
|
11128
|
+
case "OrderedList": {
|
|
11129
|
+
const name = `List${++serial}`, ordered = node.t === "OrderedList";
|
|
11130
|
+
const format2 = ordered ? { DefaultStyle: "1", Decimal: "1", LowerAlpha: "a", UpperAlpha: "A", LowerRoman: "i", UpperRoman: "I" }[node.c[0][1]] : void 0;
|
|
11131
|
+
if (ordered && !format2) odtFailure(ctx, "Unsupported ODT list style", "E_UNSUPPORTED_FEATURE");
|
|
11132
|
+
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>`);
|
|
11133
|
+
const items = [];
|
|
11134
|
+
for (const item of ordered ? node.c[1] : node.c) items.push(`<text:list-item>${await blocks3(item, paragraphStyle, listLevel + 1)}</text:list-item>`);
|
|
11135
|
+
output.push(`<text:list text:style-name="${name}">${items.join("")}</text:list>`);
|
|
11136
|
+
break;
|
|
11137
|
+
}
|
|
11138
|
+
case "Table": {
|
|
11139
|
+
output.push(await blocks3(node.c[1][1]));
|
|
11140
|
+
if (!node.c[1][1].length && node.c[1][0]) output.push(`<text:p>${await inlines2(node.c[1][0])}</text:p>`);
|
|
11141
|
+
output.push(`<table:table table:name="Table${++serial}"><table:table-column table:number-columns-repeated="${node.c[2].length}"/>`);
|
|
11142
|
+
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]]) {
|
|
11143
|
+
if (header && rows.length) output.push("<table:table-header-rows>");
|
|
11144
|
+
for (const row2 of rows) {
|
|
11145
|
+
output.push("<table:table-row>");
|
|
11146
|
+
for (const cell2 of row2[1]) {
|
|
11147
|
+
if (cell2[2] !== 1 || cell2[3] !== 1) odtFailure(ctx, "ODT table spans are unsupported", "E_UNSUPPORTED_FEATURE");
|
|
11148
|
+
output.push(`<table:table-cell office:value-type="string">${await blocks3(cell2[4], header ? "Table_20_Heading" : "Table_20_Contents")}</table:table-cell>`);
|
|
11149
|
+
}
|
|
11150
|
+
output.push("</table:table-row>");
|
|
11151
|
+
}
|
|
11152
|
+
if (header && rows.length) output.push("</table:table-header-rows>");
|
|
11153
|
+
}
|
|
11154
|
+
output.push("</table:table>");
|
|
11155
|
+
break;
|
|
11156
|
+
}
|
|
11157
|
+
default:
|
|
11158
|
+
odtFailure(ctx, `Unsupported ODT block: ${node.t}`, "E_UNSUPPORTED_FEATURE");
|
|
11159
|
+
}
|
|
11160
|
+
}
|
|
11161
|
+
const value = output.join("");
|
|
11162
|
+
ctx.bound("outputBytes", value.length);
|
|
11163
|
+
ctx.charge("retainedBytes", value.length * 2);
|
|
11164
|
+
return value;
|
|
11165
|
+
};
|
|
11166
|
+
const content = await blocks3(document.blocks);
|
|
11167
|
+
const namespaces2 = Object.entries(odtNamespaces).map(([key, value]) => `xmlns:${key}="${value}"`).join(" ") + ` xmlns:fo="${fo}" xmlns:xlink="${xlink}" xmlns:svg="${svg}"`;
|
|
11168
|
+
const put = (name, xml) => {
|
|
11169
|
+
ctx.bound("outputBytes", xml.length);
|
|
11170
|
+
parts.set(name, new TextEncoder().encode(xml));
|
|
11171
|
+
};
|
|
11172
|
+
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>`);
|
|
11173
|
+
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>`);
|
|
11174
|
+
const title = document.metadata.title;
|
|
11175
|
+
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>`);
|
|
11176
|
+
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>`);
|
|
11177
|
+
return { kind: "binary", bytes: await odtPackage(ctx).write(parts) };
|
|
11178
|
+
} };
|
|
11179
|
+
var odt_default = {
|
|
11180
|
+
name: "odt",
|
|
11181
|
+
reader: odtReader,
|
|
11182
|
+
writer: odtWriter,
|
|
11183
|
+
read: true,
|
|
11184
|
+
write: true,
|
|
11185
|
+
media: "binary",
|
|
11186
|
+
inputEncoding: "bytes",
|
|
11187
|
+
suffixes: ["odt"],
|
|
11188
|
+
extensions: {},
|
|
11189
|
+
options: { read: [], write: ["standalone"] },
|
|
11190
|
+
inputBudget: "compressedBytes"
|
|
11191
|
+
};
|
|
10646
11192
|
var pptx_default = {
|
|
10647
11193
|
name: "pptx",
|
|
10648
11194
|
read: true,
|
|
@@ -10653,7 +11199,7 @@ var pptx_default = {
|
|
|
10653
11199
|
format: "pptx",
|
|
10654
11200
|
async read(input, context, selection) {
|
|
10655
11201
|
context.signal?.throwIfAborted();
|
|
10656
|
-
const { pptxReader } = await import("./pptx-
|
|
11202
|
+
const { pptxReader } = await import("./pptx-7G52EJ6L-4JACH5FB.js");
|
|
10657
11203
|
context.signal?.throwIfAborted();
|
|
10658
11204
|
return pptxReader.read(input, context, selection);
|
|
10659
11205
|
}
|
|
@@ -10662,7 +11208,7 @@ var pptx_default = {
|
|
|
10662
11208
|
format: "pptx",
|
|
10663
11209
|
async write(document, context, selection) {
|
|
10664
11210
|
context.signal?.throwIfAborted();
|
|
10665
|
-
const { pptxWriter } = await import("./pptx-
|
|
11211
|
+
const { pptxWriter } = await import("./pptx-7G52EJ6L-4JACH5FB.js");
|
|
10666
11212
|
context.signal?.throwIfAborted();
|
|
10667
11213
|
return pptxWriter.write(document, context, selection);
|
|
10668
11214
|
}
|
|
@@ -10674,7 +11220,7 @@ var pptx_default = {
|
|
|
10674
11220
|
write: ["standalone"]
|
|
10675
11221
|
}
|
|
10676
11222
|
};
|
|
10677
|
-
var
|
|
11223
|
+
var attr4 = ["", [], []];
|
|
10678
11224
|
var xlsxReader = { format: "xlsx", async read(input, ctx) {
|
|
10679
11225
|
const l = ctx.limits;
|
|
10680
11226
|
const context = {
|
|
@@ -10709,7 +11255,7 @@ var xlsxReader = { format: "xlsx", async read(input, ctx) {
|
|
|
10709
11255
|
ctx.bound("nodes", ++nodes);
|
|
10710
11256
|
const title = await literalInlines(sheet.name, ctx, nodes);
|
|
10711
11257
|
nodes += title.length;
|
|
10712
|
-
blocks3.push({ t: "Header", c: [1,
|
|
11258
|
+
blocks3.push({ t: "Header", c: [1, attr4, title] });
|
|
10713
11259
|
if (!sheet.cells.length) continue;
|
|
10714
11260
|
let height = 0, width = 0;
|
|
10715
11261
|
for (const cell2 of sheet.cells) {
|
|
@@ -10734,13 +11280,13 @@ var xlsxReader = { format: "xlsx", async read(input, ctx) {
|
|
|
10734
11280
|
const inlines2 = await literalInlines(text, ctx, nodes);
|
|
10735
11281
|
nodes += inlines2.length;
|
|
10736
11282
|
if (inlines2.length) ctx.bound("nodes", ++nodes);
|
|
10737
|
-
row2.push([
|
|
11283
|
+
row2.push([attr4, "AlignDefault", 1, 1, inlines2.length ? [{ t: "Plain", c: inlines2 }] : []]);
|
|
10738
11284
|
}
|
|
10739
|
-
rows.push([
|
|
11285
|
+
rows.push([attr4, row2]);
|
|
10740
11286
|
}
|
|
10741
11287
|
ctx.bound("nodes", ++nodes);
|
|
10742
11288
|
const head2 = rows.shift();
|
|
10743
|
-
blocks3.push({ t: "Table", c: [
|
|
11289
|
+
blocks3.push({ t: "Table", c: [attr4, [null, []], Array.from({ length: width }, () => ["AlignDefault", { t: "ColWidthDefault" }]), [attr4, [head2]], [[attr4, 0, [], rows]], [attr4, []]] });
|
|
10744
11290
|
}
|
|
10745
11291
|
return { blocks: blocks3, metadata: {}, resources: [] };
|
|
10746
11292
|
} catch (error) {
|
|
@@ -10779,6 +11325,7 @@ var coreFormats = [
|
|
|
10779
11325
|
epub_default,
|
|
10780
11326
|
pdf_default,
|
|
10781
11327
|
docx_default,
|
|
11328
|
+
odt_default,
|
|
10782
11329
|
pptx_default,
|
|
10783
11330
|
xlsx_default
|
|
10784
11331
|
];
|
|
@@ -10884,7 +11431,7 @@ function createFormatRegistry(descriptors = coreFormats, context = {}, operation
|
|
|
10884
11431
|
infer(path, direction) {
|
|
10885
11432
|
const dot = path.lastIndexOf(".");
|
|
10886
11433
|
if (dot <= path.lastIndexOf("/") || dot < 0) return fail3("E_FORMAT", `No suffix: ${path}`);
|
|
10887
|
-
const suffix = path.slice(dot + 1);
|
|
11434
|
+
const suffix = path.slice(dot + 1).toLowerCase();
|
|
10888
11435
|
const matches = formats.filter(
|
|
10889
11436
|
(descriptor) => descriptor[direction] && descriptor.suffixes.includes(suffix)
|
|
10890
11437
|
);
|
|
@@ -10927,6 +11474,7 @@ var defaultLimits = Object.freeze({
|
|
|
10927
11474
|
resources: Infinity,
|
|
10928
11475
|
diagnostics: Infinity,
|
|
10929
11476
|
references: Infinity,
|
|
11477
|
+
yamlAliases: Infinity,
|
|
10930
11478
|
entities: Infinity,
|
|
10931
11479
|
entityBytes: Infinity,
|
|
10932
11480
|
work: Infinity,
|
|
@@ -19706,9 +20254,28 @@ async function resolveConversionArgs(args, files, signal, context = {}) {
|
|
|
19706
20254
|
if (document.errors.length) execution.fail("E_OPTION", "Invalid YAML defaults");
|
|
19707
20255
|
let value;
|
|
19708
20256
|
try {
|
|
19709
|
-
value = document.toJS({ maxAliasCount:
|
|
19710
|
-
} catch {
|
|
19711
|
-
execution.fail("
|
|
20257
|
+
value = document.toJS({ maxAliasCount: execution.limits.yamlAliases === Infinity ? -1 : execution.limits.yamlAliases });
|
|
20258
|
+
} catch (error) {
|
|
20259
|
+
if (error instanceof ReferenceError && (execution.limits.yamlAliases === 0 || error.message.includes("alias count"))) execution.fail("E_LIMIT", "YAML defaults alias expansion limit exceeded");
|
|
20260
|
+
execution.fail("E_OPTION", "Invalid YAML defaults aliases");
|
|
20261
|
+
}
|
|
20262
|
+
const active = /* @__PURE__ */ new Set(), visited = /* @__PURE__ */ new Set();
|
|
20263
|
+
const pending = [{ value, depth: 0 }];
|
|
20264
|
+
while (pending.length) {
|
|
20265
|
+
const item = pending.pop();
|
|
20266
|
+
if (!item.value || typeof item.value !== "object") continue;
|
|
20267
|
+
if (item.leave) {
|
|
20268
|
+
active.delete(item.value);
|
|
20269
|
+
visited.add(item.value);
|
|
20270
|
+
continue;
|
|
20271
|
+
}
|
|
20272
|
+
if (visited.has(item.value)) continue;
|
|
20273
|
+
if (active.has(item.value)) execution.fail("E_OPTION", "Cyclic YAML defaults are unsupported");
|
|
20274
|
+
await execution.cooperate();
|
|
20275
|
+
execution.bound("depth", item.depth);
|
|
20276
|
+
active.add(item.value);
|
|
20277
|
+
pending.push({ ...item, leave: true });
|
|
20278
|
+
for (const child of Object.values(item.value)) pending.push({ value: child, depth: item.depth + 1 });
|
|
19712
20279
|
}
|
|
19713
20280
|
if (!value || typeof value !== "object" || Array.isArray(value)) execution.fail("E_OPTION", "Defaults must be a YAML map");
|
|
19714
20281
|
for (const [raw, entry] of Object.entries(value)) {
|