@poe-platform/safe-bash 0.1.802 → 0.1.804
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 +60 -33
- package/dist/image-ast/ast.d.ts +1 -0
- package/dist/image-ast/browser/ast.d.ts +1 -0
- package/dist/image-ast/browser/codecs/jpeg.d.ts +2 -2
- package/dist/image-ast/codecs/jpeg.d.ts +2 -2
- package/dist/image-ast/index.browser.js +692 -8355
- package/dist/image-ast/index.js +692 -8355
- package/dist/mp4-ast/codecs.d.ts +7 -2
- package/dist/safe-bash/chunks/{chunk-CHYGPFVM.js → chunk-22SX3F2R.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-FBUCWVTE.js → chunk-2IVBJTBD.js} +1 -1
- package/dist/safe-bash/chunks/chunk-2POETUMB.js +190 -0
- package/dist/safe-bash/chunks/{chunk-XVOSKJE2.js → chunk-47D7WBJK.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-VKNVHEX3.js → chunk-4ESI236Y.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-74GHTNJA.js → chunk-4KTMKD5W.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-55YJASTN.js → chunk-4T53AERN.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-DQP3VHSB.js → chunk-5XIFJVOO.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-NZQXYWA3.js → chunk-62BOHHJT.js} +1 -2
- package/dist/safe-bash/chunks/{chunk-HZAMGT5I.js → chunk-67WIFM3N.js} +17 -6
- package/dist/safe-bash/chunks/{chunk-4D4N7IU2.js → chunk-6LNFRPW5.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-6O77NL2S.js → chunk-6SMICPI3.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-4BSJLKNM.js → chunk-7O76UFQD.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-44ALJ4QG.js → chunk-AW5KIT6V.js} +3549 -84
- package/dist/safe-bash/chunks/{chunk-RSTHLAF3.js → chunk-B2Z73HTZ.js} +52 -28
- package/dist/safe-bash/chunks/chunk-B3ZMOJVM.js +319 -0
- package/dist/safe-bash/chunks/{chunk-7ZBU7KYV.js → chunk-CFAWS3O4.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-I5HZ4FGE.js → chunk-CL2FCTTO.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-KDNSPLII.js → chunk-CTXNARJH.js} +2 -1
- package/dist/safe-bash/chunks/{chunk-TFIBK2GI.js → chunk-D5Q7NFWI.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-OQRVVGR6.js → chunk-DSOOVZ6Q.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-VTH3MLDU.js → chunk-DUTAG6ZD.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-XAQMU6OY.js → chunk-EE5YGFIZ.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-FZE4HW6G.js → chunk-EJOYT2ME.js} +1 -1
- package/dist/safe-bash/chunks/chunk-FAAIR6EJ.js +887 -0
- package/dist/safe-bash/chunks/{chunk-OV6IHKO6.js → chunk-FOB2FZR4.js} +2 -2
- package/dist/safe-bash/chunks/chunk-G6V4RRSQ.js +14 -0
- package/dist/safe-bash/chunks/{chunk-UTBUUFDM.js → chunk-GGQAGQXQ.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-K6VCD7IY.js → chunk-HIIYIJ5G.js} +2 -4
- package/dist/safe-bash/chunks/chunk-IOHH2GTI.js +56 -0
- package/dist/safe-bash/chunks/{chunk-CTVWDACF.js → chunk-IQW34XQT.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-HZ7BWKQ3.js → chunk-IS572AAT.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-AUSNDQTJ.js → chunk-JPSUHHOA.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-ZVD5IS4V.js → chunk-KBZ4UB2O.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-AM5ESLPH.js → chunk-KU5CVWKA.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-NQCM3TYR.js → chunk-LPOVNKNB.js} +225 -176
- package/dist/safe-bash/chunks/{chunk-46Z5E5EV.js → chunk-MBOC3LZ4.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-6PAVEFT3.js → chunk-N4BQFD3P.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-CS4MNM6I.js → chunk-NGKCVNWS.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-7R5BDCG7.js → chunk-OHML2BEU.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-C5OWC2TL.js → chunk-OQ3AGYCZ.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-B7TAL7S5.js → chunk-PTAEWLSE.js} +0 -2
- package/dist/safe-bash/chunks/{chunk-LVOBFF4D.js → chunk-Q4FNLOTI.js} +1 -1
- package/dist/safe-bash/chunks/chunk-Q5XO3NAS.js +1036 -0
- package/dist/safe-bash/chunks/{chunk-GEG3BWGE.js → chunk-RHFRJIWQ.js} +1 -1
- package/dist/safe-bash/chunks/chunk-RUR6J33T.js +11 -0
- package/dist/safe-bash/chunks/{chunk-WDLGKIHD.js → chunk-S4RFUUXO.js} +841 -26
- package/dist/safe-bash/chunks/{chunk-RRR7AQ24.js → chunk-SD2ISU5L.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-3NDIFSNM.js → chunk-SUJ3NTMH.js} +3 -3
- package/dist/safe-bash/chunks/{chunk-R3NAKOED.js → chunk-SZRUU5HS.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-PH63PLPZ.js → chunk-TC3F4UFF.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-3R3AANOR.js → chunk-TCKYOLUE.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-D3ANYGMC.js → chunk-UV4X32QU.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-E7OYNDGL.js → chunk-V7QT2RWC.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-SHEMU2Z7.js → chunk-W2IYOVHK.js} +839 -1211
- package/dist/safe-bash/chunks/{chunk-3HQU4OJO.js → chunk-XNGVOSGI.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-J42RIHHJ.js → chunk-XQWCQSRN.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-BJA5XNP6.js → chunk-Y7FW6GLT.js} +6 -6
- package/dist/safe-bash/chunks/{chunk-QGUV42T5.js → chunk-YL3GBUG4.js} +1 -1
- package/dist/safe-bash/chunks/chunk-YOXUCJER.js +389 -0
- package/dist/safe-bash/chunks/{chunk-HBCN24ZA.js → chunk-Z2AAYYJN.js} +2 -2
- package/dist/safe-bash/chunks/chunk-ZKYKJCZZ.js +30 -0
- package/dist/safe-bash/chunks/core-IE3AFIDX.js +85806 -0
- package/dist/safe-bash/chunks/{ffmpeg-WTC3TEFI.js → ffmpeg-YANDK6HU.js} +2 -2
- package/dist/safe-bash/chunks/{gh-6WU6PXL4.js → gh-4MBJ2S5V.js} +2 -2
- package/dist/safe-bash/chunks/{git-EFZIGJW4.js → git-2QONJNRQ.js} +2 -2
- package/dist/safe-bash/chunks/{imagemagick-EIEYGWPF.js → imagemagick-JLEHGYSN.js} +2 -2
- package/dist/safe-bash/chunks/{mmdc-ROQJT5HQ.js → mmdc-6LD7A6ND.js} +2 -2
- package/dist/safe-bash/chunks/{pdfimages-DW7LWXFI.js → pdfimages-RSHL7LOP.js} +2 -2
- package/dist/safe-bash/chunks/{pdfinfo-TIP6XLUQ.js → pdfinfo-L3SGWPNG.js} +2 -2
- package/dist/safe-bash/chunks/{pdftk-DMG22ITZ.js → pdftk-LFBJNU5A.js} +2 -2
- package/dist/safe-bash/chunks/{pdftoppm-WNDYR72T.js → pdftoppm-NXXFUIHG.js} +2 -2
- package/dist/safe-bash/chunks/{pdftotext-5IPZ4NI7.js → pdftotext-4IHNWT6F.js} +2 -2
- package/dist/safe-bash/chunks/{qpdf-TTX2DIUA.js → qpdf-ZEIREV63.js} +2 -2
- package/dist/safe-bash/chunks/read-builtin-A4QKAT45.js +9 -0
- package/dist/safe-bash/chunks/{sips-XYS46JPJ.js → sips-D5YBG2V3.js} +2 -2
- package/dist/safe-bash/chunks/{soffice-TU73E5KL.js → soffice-RAJU3JUT.js} +2 -2
- package/dist/safe-bash/chunks/source-files-3XWRRHFA.js +7 -0
- package/dist/safe-bash/chunks/{wkhtmltopdf-FSZ2CHGE.js → wkhtmltopdf-7UE4FORZ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-7KWZXKY6.js → chunk-26RTBV2I.js} +1 -0
- package/dist/safe-bash/command-chunks/{chunk-AQJ2ROJO.js → chunk-2WYNMZR2.js} +10 -8
- package/dist/safe-bash/command-chunks/{chunk-BDSMROQZ.js → chunk-36GFRF2N.js} +2 -1
- package/dist/safe-bash/command-chunks/{chunk-GC5TJZOF.js → chunk-3VIA2IA7.js} +114 -31
- package/dist/safe-bash/command-chunks/{chunk-NKFYQSES.js → chunk-4CTI3ZTX.js} +1 -0
- package/dist/safe-bash/command-chunks/{chunk-WH627NJL.js → chunk-4MYP2FX4.js} +2 -1
- package/dist/safe-bash/command-chunks/chunk-4R5ADJM5.js +178 -0
- package/dist/safe-bash/command-chunks/{chunk-P2N33UMN.js → chunk-5MIKM54M.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-DB453IE6.js → chunk-6FZQUOSJ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WPYIOKE3.js → chunk-6GKYHPJG.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-7K6JYKPJ.js → chunk-6M2ELGEN.js} +17 -15
- package/dist/safe-bash/command-chunks/{chunk-PXEIT2O4.js → chunk-6UR7V3ET.js} +8 -1
- package/dist/safe-bash/command-chunks/{chunk-6KJ3LPI2.js → chunk-6XBS5B46.js} +26 -3
- package/dist/safe-bash/command-chunks/{chunk-5PWJG2UK.js → chunk-6YXLZX7L.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-EK6YNAXT.js → chunk-753YOR54.js} +31 -5
- package/dist/safe-bash/command-chunks/{chunk-RMWQAAO5.js → chunk-7IR4NRNE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-FZTK4MFI.js → chunk-7NM73SVK.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-NXEQ3ESQ.js → chunk-7QD5YY4F.js} +6 -11
- package/dist/safe-bash/command-chunks/{chunk-EMPU65ZK.js → chunk-A5LBSJGH.js} +1 -0
- package/dist/safe-bash/command-chunks/chunk-A7MU7762.js +200 -0
- package/dist/safe-bash/command-chunks/{chunk-ORYGZYKW.js → chunk-ARZMP2L2.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-OQKC5ZU2.js → chunk-BAKFZ477.js} +62 -20
- package/dist/safe-bash/command-chunks/{chunk-QRRYN2KO.js → chunk-BC7BK6R6.js} +0 -2424
- package/dist/safe-bash/command-chunks/{chunk-F4TEEZTL.js → chunk-BOEOJS2Q.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-XS72HTMA.js → chunk-BWGGLYEB.js} +5 -22
- package/dist/safe-bash/command-chunks/{chunk-PMBFZXTK.js → chunk-C5ZZKP7V.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-LHIOAFWW.js → chunk-C7SEB6WU.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-XPT2UGBF.js → chunk-CHJKFRT7.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-TIOCQVUQ.js → chunk-CON26Q2O.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-E55UKBIE.js → chunk-DBAT3IK2.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-Z45N42QC.js → chunk-DPAYAVMS.js} +15 -1
- package/dist/safe-bash/command-chunks/chunk-DS3NXVUM.js +368 -0
- package/dist/safe-bash/command-chunks/{chunk-5ZMZ573Q.js → chunk-DSJ3VRL3.js} +16 -4
- package/dist/safe-bash/command-chunks/{chunk-K2GDEMEU.js → chunk-EFRCFWVR.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-DZCY63VJ.js → chunk-EV6HIJ5H.js} +6 -5
- package/dist/safe-bash/command-chunks/{chunk-JDYXY44P.js → chunk-FJURV46Y.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-TZZ4WUKH.js → chunk-FZAWGKSE.js} +6 -4
- package/dist/safe-bash/command-chunks/{chunk-YHFXOX6U.js → chunk-GOCFQ6XV.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-YOFC45RK.js → chunk-HH5O7DJI.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-3HHCU5YU.js → chunk-HK7F5SDC.js} +13 -0
- package/dist/safe-bash/command-chunks/{chunk-JNZ3CVAE.js → chunk-HQBXIZC7.js} +8 -3
- package/dist/safe-bash/command-chunks/{chunk-2JRBIDAD.js → chunk-I63DBZXZ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-WNE7FPVR.js → chunk-I64TLTIW.js} +24 -16
- package/dist/safe-bash/command-chunks/{chunk-QKFSRZGQ.js → chunk-ICANWOXH.js} +7 -31
- package/dist/safe-bash/command-chunks/{chunk-SQRQW3CT.js → chunk-IJ6LGLXM.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-5E4WAO4O.js → chunk-JD5QNRNO.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-KJIMDLBB.js → chunk-JNANXVJV.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-TGSNCQSR.js → chunk-JT4RYCA6.js} +1771 -1663
- package/dist/safe-bash/command-chunks/{chunk-II77KPZN.js → chunk-JWW6FYBN.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ZYXH3B66.js → chunk-LCJWKTCJ.js} +250 -203
- package/dist/safe-bash/command-chunks/{chunk-I237SNW5.js → chunk-LFJJQQND.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-LU4HBPP2.js +97 -0
- package/dist/safe-bash/command-chunks/{chunk-XJXU3VVH.js → chunk-LWOE65OE.js} +20 -5
- package/dist/safe-bash/command-chunks/{chunk-GMIHJYDG.js → chunk-M32HFSX7.js} +22 -6
- package/dist/safe-bash/command-chunks/{chunk-YG4EPFWC.js → chunk-M3NINRDU.js} +2880 -172
- package/dist/safe-bash/command-chunks/chunk-MQREDAL6.js +164 -0
- package/dist/safe-bash/command-chunks/{chunk-LWS62ISU.js → chunk-N6DIASO2.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-NGL7YK7O.js +188 -0
- package/dist/safe-bash/command-chunks/{chunk-PEF7K3UQ.js → chunk-NJYHWKIL.js} +40 -10
- package/dist/safe-bash/command-chunks/{chunk-VXSLJH7G.js → chunk-OJQRSCBP.js} +27 -7
- package/dist/safe-bash/command-chunks/{chunk-OQU6UT6X.js → chunk-OV3XREFN.js} +11 -0
- package/dist/safe-bash/command-chunks/{chunk-MIXBO6U7.js → chunk-PTZLF456.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ALDC4XP4.js → chunk-QILLRNES.js} +34 -10
- package/dist/safe-bash/command-chunks/{chunk-L22T3H7L.js → chunk-QR25JLKO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-7U7EXOXX.js → chunk-R7C4MGZ5.js} +17 -223
- package/dist/safe-bash/command-chunks/{chunk-LCF3OB7P.js → chunk-RBME3JEH.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-2KG2QLJE.js → chunk-RFWGYT7G.js} +3 -0
- package/dist/safe-bash/command-chunks/{chunk-5TBUOBDE.js → chunk-RZMVRT26.js} +27 -13
- package/dist/safe-bash/command-chunks/chunk-TFR6B3WB.js +44 -0
- package/dist/safe-bash/command-chunks/chunk-TOH3OF3O.js +179 -0
- package/dist/safe-bash/command-chunks/{chunk-VGG2DL5Q.js → chunk-TRR4MYWF.js} +4 -0
- package/dist/safe-bash/command-chunks/chunk-TT4DAFBT.js +13621 -0
- package/dist/safe-bash/command-chunks/{chunk-LWSBAWLT.js → chunk-TXI64OAG.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-TZRI7BJZ.js +496 -0
- package/dist/safe-bash/command-chunks/{chunk-QOKBZFFD.js → chunk-U3MMODA5.js} +2 -7
- package/dist/safe-bash/command-chunks/{chunk-ZYHTWNAE.js → chunk-UAW423ZL.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-C5YYCQHW.js → chunk-UXEEUGOV.js} +222 -12
- package/dist/safe-bash/command-chunks/{chunk-GY3BWK7K.js → chunk-VOZPMJRX.js} +87 -80
- package/dist/safe-bash/command-chunks/{chunk-MQFIPHIQ.js → chunk-WPANOB4A.js} +38 -35
- package/dist/safe-bash/command-chunks/{chunk-Y2WBSJG6.js → chunk-X4QZQI5Q.js} +65 -64
- package/dist/safe-bash/command-chunks/{chunk-FPVUD6TH.js → chunk-XGI57GCN.js} +10 -8
- package/dist/safe-bash/command-chunks/{chunk-5UBXNSFZ.js → chunk-XUCU7QQT.js} +1281 -1278
- package/dist/safe-bash/command-chunks/chunk-Y22VXJBD.js +296 -0
- package/dist/safe-bash/command-chunks/{chunk-WVHONVZ4.js → chunk-YMFUUPDX.js} +5 -3
- package/dist/safe-bash/command-chunks/{chunk-IR2BY7EL.js → chunk-YYGIBXFZ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-MSFXC3OC.js → chunk-Z4FO6OHE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-6GWJUQAV.js → chunk-Z5ZZVDUD.js} +181 -133
- package/dist/safe-bash/command-chunks/{chunk-W5DNF4JH.js → chunk-ZHN3QDCI.js} +1 -1
- package/dist/safe-bash/commands/alias/index.d.ts +2 -0
- package/dist/safe-bash/commands/alias/index.js +2 -0
- package/dist/safe-bash/commands/apply-patch/index.browser.js +2 -3
- package/dist/safe-bash/commands/apply-patch/index.d.ts +0 -1
- package/dist/safe-bash/commands/apply-patch/index.js +0 -1
- package/dist/safe-bash/commands/archive/index.browser.js +2 -3
- package/dist/safe-bash/commands/archive/index.d.ts +0 -1
- package/dist/safe-bash/commands/archive/index.js +0 -1
- package/dist/safe-bash/commands/bytes/compression/index.js +54 -51
- package/dist/safe-bash/commands/bytes/index.js +2 -1
- package/dist/safe-bash/commands/chmod/index.browser.js +14 -0
- package/dist/safe-bash/commands/chmod/index.d.ts +2 -0
- package/dist/safe-bash/commands/chmod/index.js +2 -0
- package/dist/safe-bash/commands/column/index.browser.js +2 -3
- package/dist/safe-bash/commands/column/index.d.ts +0 -1
- package/dist/safe-bash/commands/column/index.js +0 -1
- package/dist/safe-bash/commands/copy-source.js +1 -0
- package/dist/safe-bash/commands/csplit/index.browser.js +2 -2
- package/dist/safe-bash/commands/csvkit/index.browser.js +72 -0
- package/dist/safe-bash/commands/csvkit/index.d.ts +0 -5
- package/dist/safe-bash/commands/csvkit/index.js +0 -50
- package/dist/safe-bash/commands/docx/index.browser.js +5 -7
- package/dist/safe-bash/commands/du/index.browser.js +2 -3
- package/dist/safe-bash/commands/du/index.d.ts +0 -1
- package/dist/safe-bash/commands/du/index.js +0 -1
- package/dist/safe-bash/commands/expr/index.browser.js +2 -3
- package/dist/safe-bash/commands/expr/index.d.ts +0 -1
- package/dist/safe-bash/commands/expr/index.js +0 -1
- package/dist/safe-bash/commands/factor/index.browser.js +2 -2
- package/dist/safe-bash/commands/file/index.browser.js +2 -3
- package/dist/safe-bash/commands/file/index.d.ts +0 -1
- package/dist/safe-bash/commands/file/index.js +0 -1
- package/dist/safe-bash/commands/filesystem.js +1 -1
- package/dist/safe-bash/commands/getopt/index.browser.js +2 -2
- package/dist/safe-bash/commands/grep-aliases/index.browser.js +3 -3
- package/dist/safe-bash/commands/hexdump/index.browser.js +2 -2
- package/dist/safe-bash/commands/html-to-markdown/index.browser.js +2 -3
- package/dist/safe-bash/commands/html-to-markdown/index.d.ts +0 -1
- package/dist/safe-bash/commands/html-to-markdown/index.js +0 -1
- package/dist/safe-bash/commands/htmlq/index.d.ts +1 -5
- package/dist/safe-bash/commands/htmlq/index.js +1 -143
- 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/llm/index.browser.js +2 -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 +4 -16314
- package/dist/safe-bash/commands/media/index.d.ts +1 -5
- package/dist/safe-bash/commands/media/index.js +1 -3
- package/dist/safe-bash/commands/media/plugin.d.ts +1 -18
- package/dist/safe-bash/commands/media/plugin.js +1 -90
- package/dist/safe-bash/commands/media/remote.d.ts +1 -63
- package/dist/safe-bash/commands/media/remote.js +1 -405
- package/dist/safe-bash/commands/media/settings.d.ts +1 -4
- package/dist/safe-bash/commands/media/settings.js +1 -26
- package/dist/safe-bash/commands/metadata/chmod.d.ts +1 -7
- package/dist/safe-bash/commands/metadata/chmod.js +1 -204
- package/dist/safe-bash/commands/metadata/index.browser.js +3 -8
- package/dist/safe-bash/commands/metadata/index.d.ts +0 -1
- package/dist/safe-bash/commands/metadata/index.js +2 -2
- package/dist/safe-bash/commands/metadata/internal.d.ts +1 -30
- package/dist/safe-bash/commands/metadata/internal.js +1 -76
- package/dist/safe-bash/commands/metadata/mktemp.d.ts +1 -3
- package/dist/safe-bash/commands/metadata/mktemp.js +1 -202
- package/dist/safe-bash/commands/metadata/stat.d.ts +1 -7
- package/dist/safe-bash/commands/metadata/stat.js +1 -530
- package/dist/safe-bash/commands/mktemp/index.browser.js +13 -0
- package/dist/safe-bash/commands/mktemp/index.d.ts +2 -0
- package/dist/safe-bash/commands/mktemp/index.js +2 -0
- package/dist/safe-bash/commands/network/curl.js +1 -3
- package/dist/safe-bash/commands/network/index.browser.js +3 -4
- package/dist/safe-bash/commands/network/public.d.ts +0 -1
- package/dist/safe-bash/commands/network/public.js +0 -1
- package/dist/safe-bash/commands/network/transport.js +2 -1
- package/dist/safe-bash/commands/network/wget.js +1 -3
- package/dist/safe-bash/commands/node/browser.d.ts +0 -1
- package/dist/safe-bash/commands/node/browser.js +0 -1
- package/dist/safe-bash/commands/node/default-runtime.d.ts +3 -0
- package/dist/safe-bash/commands/node/default-runtime.js +15 -0
- package/dist/safe-bash/commands/node/index.browser.js +7 -8
- package/dist/safe-bash/commands/node/index.js +3 -3
- package/dist/safe-bash/commands/node/path.js +1 -1
- package/dist/safe-bash/commands/node/preload.d.ts +1 -1
- package/dist/safe-bash/commands/node/preload.js +4 -1
- package/dist/safe-bash/commands/node/quickjs.d.ts +2 -0
- package/dist/safe-bash/commands/node/quickjs.js +2 -0
- package/dist/safe-bash/commands/node/safejs.js +26 -12
- package/dist/safe-bash/commands/op/index.browser.js +2 -3
- package/dist/safe-bash/commands/op/index.d.ts +0 -11
- package/dist/safe-bash/commands/op/index.js +0 -84
- package/dist/safe-bash/commands/pandoc/index.browser.js +44 -0
- package/dist/safe-bash/commands/pandoc/index.d.ts +0 -1
- package/dist/safe-bash/commands/pandoc/index.js +0 -1
- package/dist/safe-bash/commands/portable-random.d.ts +1 -1
- package/dist/safe-bash/commands/portable-random.js +1 -12
- package/dist/safe-bash/commands/pr/index.browser.js +2 -2
- package/dist/safe-bash/commands/python/docker-runner.js +4 -3
- package/dist/safe-bash/commands/python/docker.d.ts +1 -0
- package/dist/safe-bash/commands/python/docker.js +5 -2
- package/dist/safe-bash/commands/python/index.browser.js +17 -13
- package/dist/safe-bash/commands/python/index.d.ts +2 -1
- package/dist/safe-bash/commands/python/index.js +10 -8
- package/dist/safe-bash/commands/python/llm-capability.js +65 -2
- package/dist/safe-bash/commands/python/llm-dependencies.d.ts +27 -0
- package/dist/safe-bash/commands/python/llm-dependencies.js +66 -0
- package/dist/safe-bash/commands/python/llm-module.js +6 -4
- package/dist/safe-bash/commands/python/llm-reference-module.d.ts +3 -0
- package/dist/safe-bash/commands/python/llm-reference-module.js +690 -0
- package/dist/safe-bash/commands/python/worker.browser.js +2 -3
- package/dist/safe-bash/commands/python/worker.d.ts +0 -1
- package/dist/safe-bash/commands/python/worker.js +0 -1
- package/dist/safe-bash/commands/regex-execution/ere/transport/wire-engine.d.ts +1 -1
- package/dist/safe-bash/commands/regex-execution/ere/transport/wire-engine.js +3 -3
- package/dist/safe-bash/commands/regex-execution/public.browser.js +7 -7
- package/dist/safe-bash/commands/safejs/options.js +5 -1
- package/dist/safe-bash/commands/safejs/runtime.d.ts +1 -0
- package/dist/safe-bash/commands/safejs/runtime.js +1 -1
- package/dist/safe-bash/commands/split/index.browser.js +2 -3
- package/dist/safe-bash/commands/split/index.d.ts +0 -1
- package/dist/safe-bash/commands/split/index.js +0 -1
- package/dist/safe-bash/commands/ssconvert/index.browser.js +98 -0
- package/dist/safe-bash/commands/stat/index.browser.js +13 -0
- package/dist/safe-bash/commands/stat/index.d.ts +2 -0
- package/dist/safe-bash/commands/stat/index.js +2 -0
- package/dist/safe-bash/commands/stream-format/index.browser.js +3 -4
- package/dist/safe-bash/commands/stream-format/index.d.ts +0 -1
- package/dist/safe-bash/commands/stream-format/index.js +0 -1
- package/dist/safe-bash/commands/stream-inspection/index.browser.js +3 -4
- package/dist/safe-bash/commands/stream-inspection/index.d.ts +0 -1
- package/dist/safe-bash/commands/stream-inspection/index.js +0 -1
- package/dist/safe-bash/commands/streams.js +2 -1
- package/dist/safe-bash/commands/table-text/index.browser.js +3 -4
- package/dist/safe-bash/commands/table-text/index.d.ts +0 -1
- package/dist/safe-bash/commands/table-text/index.js +0 -1
- package/dist/safe-bash/commands/text.js +74 -34
- package/dist/safe-bash/commands/time-env/index.browser.js +3 -4
- package/dist/safe-bash/commands/time-env/index.d.ts +0 -1
- package/dist/safe-bash/commands/time-env/index.js +0 -1
- package/dist/safe-bash/commands/tree/index.browser.js +2 -3
- package/dist/safe-bash/commands/tree/index.d.ts +0 -1
- package/dist/safe-bash/commands/tree/index.js +0 -1
- package/dist/safe-bash/commands/tsort/index.browser.js +2 -2
- package/dist/safe-bash/commands/unalias/index.d.ts +2 -0
- package/dist/safe-bash/commands/unalias/index.js +2 -0
- package/dist/safe-bash/commands/xml/index.browser.js +2 -2
- package/dist/safe-bash/commands/yq/index.browser.js +2 -2
- package/dist/safe-bash/core.browser.js +2 -2
- package/dist/safe-bash/core.d.ts +7 -1
- package/dist/safe-bash/core.js +7 -1
- package/dist/safe-bash/execution-runtime.js +2 -1
- package/dist/safe-bash/fs/s3/http/index.d.ts +2 -2
- package/dist/safe-bash/fs/s3/http/index.js +1 -1
- package/dist/safe-bash/full-core.browser.js +254 -916
- package/dist/safe-bash/internal/op/types.d.ts +1 -0
- package/dist/safe-bash/jobs.browser.js +5 -5
- package/dist/safe-bash/lazy-optional.d.ts +3 -3
- package/dist/safe-bash/lazy-optional.js +1 -1
- package/dist/safe-bash/opt-in/commands/cmp/index.js +7 -6
- package/dist/safe-bash/opt-in/commands/dd/index.js +1 -1
- package/dist/safe-bash/opt-in/commands/dd/io.js +51 -5
- package/dist/safe-bash/opt-in/commands/truncate/index.js +2 -2
- package/dist/safe-bash/opt-in/commands/yq/native-work.js +3 -0
- package/dist/safe-bash/opt-in/optional/commands/shuf/input.js +2 -1
- package/dist/safe-bash/opt-in/optional/commands/shuf/shuf.js +4 -2
- package/dist/safe-bash/opt-in/optional.d.ts +1 -1
- package/dist/safe-bash/opt-in/optional.js +1 -1
- package/dist/safe-bash/opt-in/shell/extensions/read/index.js +2 -344
- package/dist/safe-bash/optional-host.browser.js +19 -14
- package/dist/safe-bash/optional-host.d.ts +1 -0
- package/dist/safe-bash/optional-host.js +1 -0
- package/dist/safe-bash/playwright/controller.js +41 -3
- package/dist/safe-bash/playwright/native-storage-targets.js +4 -2
- package/dist/safe-bash/plugins/base.d.ts +1 -1
- package/dist/safe-bash/plugins/base.js +3 -3
- package/dist/safe-bash/plugins/composition.d.ts +5 -2
- package/dist/safe-bash/plugins/composition.js +10 -7
- package/dist/safe-bash/plugins/index.browser.js +44 -41
- package/dist/safe-bash/plugins/index.js +3 -2
- package/dist/safe-bash/plugins/portable-commands.d.ts +3 -0
- package/dist/safe-bash/plugins/portable-commands.js +31 -0
- package/dist/safe-bash/registry-entry.browser.js +41 -42
- package/dist/safe-bash/search.browser.js +32 -33
- package/dist/safe-bash/shell/arithmetic.js +19 -6
- package/dist/safe-bash/shell/arrays/state.js +1 -1
- package/dist/safe-bash/shell/arrays/syntax.js +4 -3
- package/dist/safe-bash/shell/index.d.ts +0 -1
- package/dist/safe-bash/shell/index.js +0 -1
- package/dist/safe-bash/shell/parser.d.ts +2 -2
- package/dist/safe-bash/shell/parser.js +268 -64
- package/dist/safe-bash/shell/read-builtin.d.ts +3 -0
- package/dist/safe-bash/shell/read-builtin.js +344 -0
- package/dist/safe-bash/shell/runtime.d.ts +24 -4
- package/dist/safe-bash/shell/runtime.js +392 -414
- package/dist/safe-bash/shell/session-state.js +25 -0
- package/dist/safe-bash/shell/shell.js +76 -154
- package/dist/safe-bash/shell/tilde-expansion.d.ts +1 -1
- package/dist/safe-bash/shell/tilde-expansion.js +2 -2
- package/dist/safe-bash/shell/types.d.ts +7 -0
- package/dist/safe-bash/shell/value-state.js +1 -1
- package/dist/safe-bash/shell/worker-limits.js +1 -0
- package/dist/safe-bash/shell-entry.browser.js +32 -33
- package/dist/safe-bash/trap.browser.js +4 -4
- package/dist/safe-bash/worker/host.js +1 -1
- package/dist/safe-bash/yq-browser/index.js +1 -1
- package/dist/safe-bash-calendar-engine/time-env/calendar.d.ts +1 -1
- package/dist/safe-bash-calendar-engine/time-env/calendar.js +1 -1
- package/dist/safe-bash-calendar-engine/time-env/format.js +1 -1
- package/dist/safe-bash-command-alias/index.d.ts +13 -0
- package/dist/safe-bash-command-alias/index.js +88 -0
- package/dist/safe-bash-command-apply-patch/apply.js +3 -3
- package/dist/safe-bash-command-apply-patch/index.js +3 -3
- 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/awk-pipes.js +2 -2
- package/dist/safe-bash-command-awk/awk-reader.js +1 -1
- package/dist/safe-bash-command-awk/awk-runtime.js +3 -3
- package/dist/safe-bash-command-awk/awk.js +5 -5
- package/dist/safe-bash-command-awk/index.js +5 -5
- package/dist/safe-bash-command-bc/index.js +218 -65
- package/dist/safe-bash-command-bzip2/index.js +4 -3
- package/dist/safe-bash-command-chmod/LICENSE +21 -0
- package/dist/safe-bash-command-chmod/command.d.ts +7 -0
- package/dist/safe-bash-command-chmod/command.js +11 -0
- package/dist/safe-bash-command-chmod/index.d.ts +6 -0
- package/dist/safe-bash-command-chmod/index.js +27 -0
- package/dist/safe-bash-command-cmp/index.js +7 -6
- package/dist/safe-bash-command-column/column.js +3 -3
- package/dist/safe-bash-command-column/index.js +3 -3
- package/dist/safe-bash-command-column/layout.js +2 -2
- package/dist/safe-bash-command-csvkit/index.d.ts +1 -0
- package/dist/safe-bash-command-csvkit/index.js +1505 -7
- package/dist/safe-bash-command-csvkit/sync-support.js +2 -7
- package/dist/safe-bash-command-curl/curl.js +1 -1
- package/dist/safe-bash-command-curl/index.js +1 -1
- package/dist/safe-bash-command-date/date.js +1 -1
- package/dist/safe-bash-command-date/index.js +1 -1
- package/dist/safe-bash-command-dd/index.js +1 -1
- package/dist/safe-bash-command-dd/io.js +51 -5
- package/dist/safe-bash-command-diff/diff.js +1 -1
- package/dist/safe-bash-command-diff/index.js +1 -1
- package/dist/safe-bash-command-diff3/index.js +10 -13
- package/dist/safe-bash-command-exiftool/index.js +283 -55
- package/dist/safe-bash-command-exiftool/registry.d.ts +4 -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/arguments.d.ts +2 -0
- package/dist/safe-bash-command-fd/index.js +42 -12
- package/dist/safe-bash-command-ffmpeg/index.js +356 -66
- package/dist/safe-bash-command-find/find-format.d.ts +3 -0
- package/dist/safe-bash-command-find/find-format.js +1 -1
- package/dist/safe-bash-command-find/find.js +2 -2
- package/dist/safe-bash-command-find/index.js +2 -2
- package/dist/safe-bash-command-fmt/index.js +10 -6
- package/dist/safe-bash-command-fold/engine.d.ts +1 -1
- package/dist/safe-bash-command-fold/family.js +2 -2
- package/dist/safe-bash-command-fold/index.js +1 -1
- package/dist/safe-bash-command-gzip/index.js +45 -42
- package/dist/safe-bash-command-hexdump/command.js +2 -2
- package/dist/safe-bash-command-hexdump/index.js +2 -2
- package/dist/safe-bash-command-html-to-markdown/entities.js +1 -1
- package/dist/safe-bash-command-html-to-markdown/index.js +4 -4
- package/dist/safe-bash-command-html-to-markdown/input.js +3 -3
- package/dist/safe-bash-command-html-to-markdown/parser.js +2 -2
- package/dist/safe-bash-command-html-to-markdown/render.js +3 -3
- package/dist/safe-bash-command-htmlq/contracts.d.ts +5 -2
- package/dist/safe-bash-command-htmlq/index.d.ts +2 -1
- package/dist/safe-bash-command-htmlq/index.js +175 -49
- package/dist/safe-bash-command-htmlq/sync.d.ts +1 -0
- package/dist/safe-bash-command-imagemagick/index.js +59 -7
- package/dist/safe-bash-command-install/arguments.d.ts +27 -0
- package/dist/safe-bash-command-install/arguments.js +224 -0
- package/dist/safe-bash-command-install/index.d.ts +7 -0
- package/dist/safe-bash-command-install/index.js +942 -0
- package/dist/safe-bash-command-install/mode.d.ts +6 -0
- package/dist/safe-bash-command-install/mode.js +71 -0
- package/dist/safe-bash-command-install/options.d.ts +40 -0
- package/dist/safe-bash-command-install/options.js +27 -0
- 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 +42 -57
- package/dist/safe-bash-command-llm/command.js +1 -1
- package/dist/safe-bash-command-llm/elevenlabs.js +2 -2
- package/dist/safe-bash-command-llm/index.js +4 -4
- package/dist/safe-bash-command-llm/openai.js +2 -2
- package/dist/safe-bash-command-llm/providers/elevenlabs.js +2 -2
- package/dist/safe-bash-command-llm/providers/index.js +3 -3
- package/dist/safe-bash-command-llm/providers/openai.js +2 -2
- package/dist/safe-bash-command-llm/providers/shared.js +1 -1
- package/dist/{safe-bash-mcp → safe-bash-command-mcp}/index.browser.d.ts +463 -46
- package/dist/safe-bash-command-mcp/index.browser.js +19308 -0
- package/dist/{safe-bash-mcp → safe-bash-command-mcp}/index.d.ts +15 -6
- package/dist/{safe-bash-mcp → safe-bash-command-mcp}/index.js +2835 -2783
- package/dist/safe-bash-command-media/LICENSE +21 -0
- package/dist/safe-bash-command-media/index.d.ts +6 -0
- package/dist/safe-bash-command-media/index.js +30 -0
- package/dist/safe-bash-command-media/plugin.d.ts +18 -0
- package/dist/safe-bash-command-media/plugin.js +11 -0
- package/dist/safe-bash-command-media/remote.d.ts +63 -0
- package/dist/safe-bash-command-media/remote.js +11 -0
- package/dist/safe-bash-command-media/settings.d.ts +4 -0
- package/dist/safe-bash-command-media/settings.js +41 -0
- package/dist/safe-bash-command-mktemp/LICENSE +21 -0
- package/dist/safe-bash-command-mktemp/command.d.ts +3 -0
- package/dist/safe-bash-command-mktemp/command.js +9 -0
- package/dist/safe-bash-command-mktemp/index.d.ts +6 -0
- package/dist/safe-bash-command-mktemp/index.js +25 -0
- package/dist/safe-bash-command-mmdc/arguments.d.ts +1 -0
- package/dist/safe-bash-command-mmdc/command.d.ts +2 -0
- package/dist/safe-bash-command-mmdc/contracts.d.ts +8 -1
- package/dist/safe-bash-command-mmdc/index.js +359 -7
- package/dist/safe-bash-command-nl/index.js +1 -1
- package/dist/safe-bash-command-nl/nl.js +1 -1
- package/dist/safe-bash-command-node/LICENSE +21 -0
- package/dist/safe-bash-command-node/index.d.ts +17 -0
- package/dist/safe-bash-command-node/index.js +328 -0
- package/dist/safe-bash-command-numfmt/index.js +1 -0
- package/dist/safe-bash-command-od/index.js +16 -8
- package/dist/safe-bash-command-op/index.js +62 -36
- package/dist/safe-bash-command-op/types.d.ts +1 -0
- package/dist/safe-bash-command-pandoc/command.js +3 -3
- package/dist/safe-bash-command-pandoc/index.d.ts +1 -0
- package/dist/safe-bash-command-pandoc/index.js +5 -3
- package/dist/safe-bash-command-pandoc/sync.d.ts +1 -0
- package/dist/safe-bash-command-patch/index.js +4 -4
- package/dist/safe-bash-command-patch/patch.js +4 -4
- package/dist/safe-bash-command-pdfimages/index.js +1 -1
- package/dist/safe-bash-command-pdfinfo/index.js +30 -5
- package/dist/safe-bash-command-pdftk/index.js +21 -23
- package/dist/safe-bash-command-pdftoppm/index.js +17 -4
- package/dist/safe-bash-command-pdftotext/index.js +11 -14
- package/dist/safe-bash-command-qpdf/index.d.ts +1 -0
- package/dist/safe-bash-command-qpdf/index.js +9 -6
- package/dist/safe-bash-command-rg/index.js +1 -1
- package/dist/safe-bash-command-rg/rg-command.js +1 -1
- package/dist/safe-bash-command-sed/index.js +1 -1
- package/dist/safe-bash-command-sed/sed.js +1 -1
- package/dist/safe-bash-command-shuf/input.d.ts +2 -2
- package/dist/safe-bash-command-shuf/input.js +2 -1
- package/dist/safe-bash-command-shuf/shuf.js +4 -2
- package/dist/safe-bash-command-sips/index.js +15 -7
- package/dist/safe-bash-command-soffice/index.js +97 -12
- package/dist/safe-bash-command-sponge/index.js +13 -3
- package/dist/safe-bash-command-sqlite3/engine.d.ts +1 -0
- package/dist/safe-bash-command-sqlite3/index.js +510 -70
- package/dist/safe-bash-command-ssconvert/formats/xlsx.js +2 -2
- package/dist/safe-bash-command-ssconvert/index.js +44 -22
- package/dist/safe-bash-command-stat/LICENSE +21 -0
- package/dist/safe-bash-command-stat/command.d.ts +7 -0
- package/dist/safe-bash-command-stat/command.js +9 -0
- package/dist/safe-bash-command-stat/index.d.ts +6 -0
- package/dist/safe-bash-command-stat/index.js +25 -0
- package/dist/safe-bash-command-tar/create.d.ts +1 -0
- package/dist/safe-bash-command-tar/create.js +2 -2
- package/dist/safe-bash-command-tar/extract.js +2 -2
- package/dist/safe-bash-command-tar/index.js +4 -4
- package/dist/safe-bash-command-tar/modes.js +4 -4
- package/dist/safe-bash-command-tar/options.js +1 -1
- package/dist/safe-bash-command-truncate/index.js +2 -2
- package/dist/safe-bash-command-tsort/command.js +2 -2
- package/dist/safe-bash-command-tsort/index.js +2 -2
- package/dist/safe-bash-command-unalias/index.d.ts +12 -0
- package/dist/safe-bash-command-unalias/index.js +67 -0
- package/dist/safe-bash-command-unrtf/index.js +37 -5
- package/dist/safe-bash-command-xan/argv.d.ts +1 -1
- package/dist/safe-bash-command-xan/argv.js +2 -2
- package/dist/safe-bash-command-xan/budget.d.ts +0 -1
- package/dist/safe-bash-command-xan/budget.js +1 -1
- package/dist/safe-bash-command-xan/commands.js +6 -6
- package/dist/safe-bash-command-xan/csv.js +2 -2
- package/dist/safe-bash-command-xan/index.js +8 -9
- package/dist/safe-bash-command-xan/io.js +4 -4
- package/dist/safe-bash-command-xan/options.js +1 -1
- package/dist/safe-bash-command-xan/selector.js +2 -2
- package/dist/safe-bash-command-xmllint/index.js +45 -23
- package/dist/safe-bash-command-xxd/index.js +47 -12
- package/dist/safe-bash-command-xz/command.d.ts +1 -1
- package/dist/safe-bash-command-xz/index.js +3 -2
- package/dist/safe-bash-command-yq/accounting.js +1 -1
- package/dist/safe-bash-command-yq/index.js +4 -2
- package/dist/safe-bash-command-yq/native-work.js +3 -0
- package/dist/safe-bash-command-yq/parser.js +2 -2
- package/dist/safe-bash-command-yq/query.js +8 -5
- package/dist/safe-bash-command-yq/toml.js +2 -2
- package/dist/safe-bash-command-zip/index.js +3 -3
- package/dist/safe-bash-compression-engine/bounded-codec.js +3 -3
- package/dist/safe-bash-compression-engine/codec-loader.js +2 -2
- package/dist/safe-bash-compression-engine/files.js +6 -6
- package/dist/safe-bash-compression-engine/index.js +5 -5
- package/dist/safe-bash-compression-engine/operand.js +6 -6
- package/dist/safe-bash-compression-engine/options.js +1 -1
- package/dist/safe-bash-compression-engine/stream.js +5 -5
- package/dist/safe-bash-compression-engine/zstd-decode.js +4 -4
- package/dist/safe-bash-contracts/command.js +3 -3
- package/dist/safe-bash-contracts/default-executor.js +2 -2
- package/dist/safe-bash-contracts/diagnostics.js +3 -3
- package/dist/safe-bash-contracts/escaping.js +6 -6
- package/dist/safe-bash-contracts/filesystem-descriptor.js +3 -3
- package/dist/safe-bash-contracts/filesystem-output.js +5 -5
- package/dist/safe-bash-contracts/http.d.ts +7 -0
- package/dist/safe-bash-contracts/index.js +8 -8
- package/dist/safe-bash-contracts/io.d.ts +2 -0
- package/dist/safe-bash-contracts/io.js +2 -2
- package/dist/safe-bash-contracts/output.js +3 -3
- package/dist/safe-bash-contracts/runtime-control.d.ts +2 -2
- package/dist/safe-bash-contracts/runtime-control.js +4 -2
- package/dist/safe-bash-contracts/signals.d.ts +2 -0
- package/dist/safe-bash-contracts/signals.js +3 -1
- package/dist/safe-bash-contracts/yield.js +1 -1
- package/dist/safe-bash-csv-engine/index.d.ts +2 -1
- package/dist/safe-bash-csv-engine/index.js +21 -15
- package/dist/safe-bash-io-engine/commands/search/requirements.js +2 -2
- package/dist/safe-bash-io-engine/commands/text-programs/shared.js +6 -6
- package/dist/safe-bash-io-engine/internal.js +1 -1
- package/dist/safe-bash-io-engine/shell/pattern.js +38 -18
- package/dist/safe-bash-line-ending-engine/convert.js +9 -204
- package/dist/safe-bash-line-ending-engine/encoding.js +9 -42
- package/dist/safe-bash-line-ending-engine/index.js +48 -0
- package/dist/safe-bash-line-ending-engine/info.js +9 -90
- package/dist/safe-bash-line-ending-engine/internal.js +15 -160
- package/dist/safe-bash-line-ending-engine/io.js +12 -289
- package/dist/safe-bash-line-ending-engine/stage.js +10 -160
- package/dist/safe-bash-markdown-engine/index.js +3 -3
- package/dist/safe-bash-metadata-engine/LICENSE +21 -0
- package/dist/safe-bash-metadata-engine/index.d.ts +30 -0
- package/dist/safe-bash-metadata-engine/index.js +82 -0
- package/dist/safe-bash-metadata-engine/random.d.ts +1 -0
- package/dist/safe-bash-metadata-engine/random.js +21 -0
- package/dist/safe-bash-network-engine/args.d.ts +6 -0
- package/dist/safe-bash-network-engine/args.js +4 -2
- package/dist/safe-bash-network-engine/body.js +1 -1
- package/dist/safe-bash-network-engine/fetch-transport.js +3 -1
- package/dist/safe-bash-network-engine/index.js +3 -1
- package/dist/safe-bash-network-engine/input.js +2 -2
- package/dist/safe-bash-network-engine/platform-portable.js +3 -1
- package/dist/safe-bash-query-engine/dates.d.ts +1 -1
- package/dist/safe-bash-query-engine/dates.js +1 -1
- package/dist/safe-bash-query-engine/index.js +6 -6
- package/dist/safe-bash-query-engine/interpreter.js +4 -4
- package/dist/safe-bash-query-engine/parser.js +1 -1
- package/dist/safe-bash-query-engine/query-core.js +6 -6
- package/dist/safe-bash-regex-engine/execution/bounded-provider.js +10 -0
- package/dist/safe-bash-regex-engine/index.js +1 -1
- package/dist/safe-bash-regex-engine/text/regex.d.ts +1 -1
- package/dist/safe-bash-regex-engine/text/regex.js +1 -1
- package/dist/safe-bash-search-engine/ergonomic-regex.d.ts +1 -0
- 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 +17 -10
- package/dist/safe-bash-search-engine/matcher.d.ts +2 -2
- package/dist/safe-bash-search-engine/matcher.js +13 -9
- package/dist/safe-bash-search-engine/options.d.ts +2 -0
- package/dist/safe-bash-search-engine/options.js +1 -1
- package/dist/safe-bash-search-engine/output.js +1 -1
- package/dist/safe-bash-search-engine/shared.js +2 -2
- package/dist/safe-bash-search-engine/walk.js +15 -3
- package/dist/safe-bash-text-stream-engine/stream-format/shared.d.ts +1 -1
- package/dist/safe-bash-text-stream-engine/stream-format/shared.js +2 -1
- package/dist/safe-bash-xml-engine/document.js +3 -3
- package/dist/safe-bash-xml-engine/evaluate.js +2 -2
- package/dist/safe-bash-xml-engine/index.js +4 -4
- package/dist/safe-bash-xml-engine/io.js +7 -2
- package/dist/safe-bash-xml-engine/limits.d.ts +0 -2
- package/dist/safe-bash-xml-engine/limits.js +1 -1
- package/dist/safe-bash-xml-engine/query.js +3 -3
- package/dist/safe-bash-zip-engine/index.js +3 -3
- package/dist/safe-bash-zip-engine/zip/repair.js +3 -3
- package/dist/safe-bash-zip-engine/zip/safety.js +1 -1
- package/dist/safe-bash-zip-engine/zip/sfx.js +3 -3
- package/dist/safe-bash-zip-engine/zip/volumes.js +1 -1
- package/dist/safe-bash-zip-engine/zip-format.js +3 -3
- package/dist/safe-playwright-cloudflare/browser-snapshot-json.js +2 -2
- package/dist/safe-playwright-cloudflare/browser-snapshot-references.js +1 -1
- package/dist/safe-playwright-cloudflare/browser-socket-closure.js +18 -3
- package/dist/safe-playwright-cloudflare/shell-browser-resource.js +1 -1
- package/dist/xlsx-ast/xlsx.js +6 -5
- package/package.json +112 -98
- package/dist/media-cli/bytes.d.ts +0 -8
- package/dist/media-cli/bytes.js +0 -40
- package/dist/media-cli/concat.d.ts +0 -30
- package/dist/media-cli/concat.js +0 -197
- package/dist/media-cli/content.js +0 -66
- package/dist/media-cli/dependency-grammars.d.ts +0 -12
- package/dist/media-cli/dependency-grammars.js +0 -557
- package/dist/media-cli/discover.js +0 -286
- package/dist/media-cli/engine.js +0 -190
- package/dist/media-cli/filename-expression.js +0 -147
- package/dist/media-cli/filesystem.js +0 -35
- package/dist/media-cli/frontend-contract.js +0 -8
- package/dist/media-cli/frontend-issues.d.ts +0 -6
- package/dist/media-cli/frontend-issues.js +0 -9
- package/dist/media-cli/imagemagick-operand.d.ts +0 -42
- package/dist/media-cli/imagemagick-operand.js +0 -229
- package/dist/media-cli/imagemagick-references.d.ts +0 -7
- package/dist/media-cli/imagemagick-references.js +0 -42
- package/dist/media-cli/imagemagick.generated.js +0 -3254
- package/dist/media-cli/imagemagick.js +0 -615
- package/dist/media-cli/index.js +0 -12
- package/dist/media-cli/mvg.d.ts +0 -10
- package/dist/media-cli/mvg.js +0 -102
- package/dist/media-cli/network.js +0 -78
- package/dist/media-cli/options.generated.js +0 -3312
- package/dist/media-cli/preset.d.ts +0 -11
- package/dist/media-cli/preset.js +0 -57
- package/dist/media-cli/resolution-path.d.ts +0 -23
- package/dist/media-cli/resolution-path.js +0 -217
- package/dist/media-cli/resolver.js +0 -494
- package/dist/media-cli/resources.d.ts +0 -16
- package/dist/media-cli/resources.js +0 -187
- package/dist/media-cli/shim.js +0 -52
- package/dist/media-cli/tee.d.ts +0 -6
- package/dist/media-cli/tee.js +0 -38
- package/dist/office-package/zip-sync.js +0 -111
- package/dist/remote-execution/binary.js +0 -178
- package/dist/remote-execution/callback-result.js +0 -26
- package/dist/remote-execution/canonical-capabilities.d.ts +0 -5
- package/dist/remote-execution/canonical-capabilities.js +0 -45
- package/dist/remote-execution/canonical-metadata.d.ts +0 -4
- package/dist/remote-execution/canonical-metadata.js +0 -32
- package/dist/remote-execution/client.js +0 -824
- package/dist/remote-execution/deployment.js +0 -131
- package/dist/remote-execution/descriptors.js +0 -267
- package/dist/remote-execution/effects.js +0 -357
- package/dist/remote-execution/endpoint.js +0 -224
- package/dist/remote-execution/files.js +0 -291
- package/dist/remote-execution/hosting-operation.js +0 -26
- package/dist/remote-execution/hosting-request.d.ts +0 -4
- package/dist/remote-execution/hosting-request.js +0 -12
- package/dist/remote-execution/hosting-stream.d.ts +0 -8
- package/dist/remote-execution/hosting-stream.js +0 -64
- package/dist/remote-execution/index.js +0 -18
- package/dist/remote-execution/invocation-admission.d.ts +0 -3
- package/dist/remote-execution/invocation-admission.js +0 -17
- package/dist/remote-execution/job-binding.js +0 -1269
- package/dist/remote-execution/materializations.js +0 -284
- package/dist/remote-execution/modal-driver.js +0 -90
- package/dist/remote-execution/native-result.d.ts +0 -3
- package/dist/remote-execution/native-result.js +0 -16
- package/dist/remote-execution/output-freshness.d.ts +0 -4
- package/dist/remote-execution/output-freshness.js +0 -19
- package/dist/remote-execution/output-retrieval.js +0 -474
- package/dist/remote-execution/process-http.js +0 -607
- package/dist/remote-execution/process.js +0 -577
- package/dist/remote-execution/protocol.js +0 -208
- package/dist/remote-execution/relay.js +0 -91
- package/dist/remote-execution/rest-driver.js +0 -93
- package/dist/remote-execution/upload-descriptor.js +0 -201
- package/dist/remote-execution/upload-protocol.js +0 -62
- package/dist/remote-execution/uploads.js +0 -324
- package/dist/remote-execution/wire-json.d.ts +0 -4
- package/dist/remote-execution/wire-json.js +0 -44
- package/dist/remote-execution/wire-validation.js +0 -131
- package/dist/remote-execution/wire.generated.js +0 -4224
- package/dist/safe-bash/chunks/chunk-GETUOD5D.js +0 -161
- package/dist/safe-bash/chunks/chunk-IWDICZVK.js +0 -20
- package/dist/safe-bash/chunks/chunk-MHMMRCYC.js +0 -3464
- package/dist/safe-bash/chunks/chunk-UE5KZDEK.js +0 -77
- package/dist/safe-bash/chunks/chunk-VSAJ4OTM.js +0 -962
- package/dist/safe-bash/chunks/csvkit-TACDU7FC.js +0 -1618
- package/dist/safe-bash/chunks/implementation-MLFHUQ5M.js +0 -133
- package/dist/safe-bash/commands/csvkit/sync.js +0 -1639
- package/dist/safe-bash/commands/node/unconfigured.d.ts +0 -3
- package/dist/safe-bash/commands/node/unconfigured.js +0 -10
- package/dist/safe-bash/commands/pandoc/implementation.d.ts +0 -8
- package/dist/safe-bash/commands/pandoc/implementation.js +0 -94
- package/dist/safe-bash-mcp/index.browser.js +0 -9157
- package/dist/safe-bash/command-chunks/{chunk-ZRRBXU3M.js → chunk-GIN5GUDP.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-LAOM65EE.js → chunk-IEO4XVN6.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-364TMWBT.js → chunk-MWREVL44.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-464RVBGB.js → chunk-Q5TDKFHK.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-AJR3AQYA.js → chunk-UKX3LZHR.js} +0 -0
- package/dist/safe-bash/command-chunks/{chunk-XIIBTGC5.js → chunk-XPXEQKRW.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-FDBUV4HJ.js → chunk-Y4HGTG3E.js} +3 -3
- /package/dist/{safe-bash/commands/csvkit → safe-bash-command-csvkit}/sync.d.ts +0 -0
|
@@ -1,40 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
PublicDiagnostic,
|
|
3
|
+
escapeText,
|
|
4
|
+
quoteShellOperand,
|
|
5
|
+
writeDiagnostic
|
|
6
|
+
} from "./chunk-TC3F4UFF.js";
|
|
5
7
|
import {
|
|
6
8
|
compareCopyIdentity,
|
|
7
9
|
compareObservedEntries,
|
|
8
10
|
predicateRequirements,
|
|
9
11
|
pwdRequirements,
|
|
10
12
|
resolveInputLimit
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import {
|
|
13
|
-
PublicDiagnostic,
|
|
14
|
-
escapeText,
|
|
15
|
-
quoteShellOperand,
|
|
16
|
-
writeDiagnostic
|
|
17
|
-
} from "./chunk-PH63PLPZ.js";
|
|
18
|
-
import {
|
|
19
|
-
shellValueByteLength,
|
|
20
|
-
shellValueBytes
|
|
21
|
-
} from "./chunk-J42RIHHJ.js";
|
|
22
|
-
import {
|
|
23
|
-
getCommandArguments
|
|
24
|
-
} from "./chunk-7R5BDCG7.js";
|
|
25
|
-
import {
|
|
26
|
-
creationUmask,
|
|
27
|
-
getRuntimeBackingFileSystem,
|
|
28
|
-
modeChange
|
|
29
|
-
} from "./chunk-VSAJ4OTM.js";
|
|
13
|
+
} from "./chunk-47D7WBJK.js";
|
|
30
14
|
import {
|
|
31
15
|
byteLength,
|
|
32
16
|
compareUtf8,
|
|
33
17
|
equalBytes
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import {
|
|
36
|
-
FsError
|
|
37
|
-
} from "./chunk-VTH3MLDU.js";
|
|
18
|
+
} from "./chunk-UV4X32QU.js";
|
|
38
19
|
import {
|
|
39
20
|
basename,
|
|
40
21
|
dirname,
|
|
@@ -44,12 +25,25 @@ import {
|
|
|
44
25
|
relativePath,
|
|
45
26
|
resolvePath,
|
|
46
27
|
yieldTurn
|
|
47
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-62BOHHJT.js";
|
|
29
|
+
import {
|
|
30
|
+
FsError
|
|
31
|
+
} from "./chunk-DUTAG6ZD.js";
|
|
48
32
|
import {
|
|
49
33
|
collectBytes,
|
|
50
34
|
readBytes,
|
|
51
35
|
writeBytes
|
|
52
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-4KTMKD5W.js";
|
|
37
|
+
import {
|
|
38
|
+
shellValueByteLength,
|
|
39
|
+
shellValueBytes
|
|
40
|
+
} from "./chunk-XQWCQSRN.js";
|
|
41
|
+
import {
|
|
42
|
+
getCommandArguments
|
|
43
|
+
} from "./chunk-OHML2BEU.js";
|
|
44
|
+
import {
|
|
45
|
+
modeChange
|
|
46
|
+
} from "./chunk-IOHH2GTI.js";
|
|
53
47
|
import {
|
|
54
48
|
RESOLVED_EXIT_ZERO,
|
|
55
49
|
UsageError,
|
|
@@ -73,10 +67,10 @@ import {
|
|
|
73
67
|
requireOperands,
|
|
74
68
|
syncCommandEvaluators,
|
|
75
69
|
value
|
|
76
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-V7QT2RWC.js";
|
|
77
71
|
import {
|
|
78
72
|
init_platform
|
|
79
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-PTAEWLSE.js";
|
|
80
74
|
|
|
81
75
|
// packages/safe-bash/src/commands/cal/index.ts
|
|
82
76
|
init_platform();
|
|
@@ -353,13 +347,17 @@ function fdCommands(options2 = {}) {
|
|
|
353
347
|
};
|
|
354
348
|
}
|
|
355
349
|
|
|
350
|
+
// packages/safe-bash/src/contracts/command-requirements.ts
|
|
351
|
+
init_platform();
|
|
352
|
+
import { assertCommandRequirements, evaluateCommandSupport } from "../../safe-bash-contracts/command-requirements.js";
|
|
353
|
+
|
|
356
354
|
// packages/safe-bash/src/commands/search/rg-command.ts
|
|
357
355
|
init_platform();
|
|
358
356
|
import { clearRgFastRunnerPool, createRgCommand } from "../../safe-bash-command-rg/rg-command.js";
|
|
359
357
|
|
|
360
|
-
// packages/safe-bash/src/
|
|
358
|
+
// packages/safe-bash/src/fs/creation-mask.ts
|
|
361
359
|
init_platform();
|
|
362
|
-
import {
|
|
360
|
+
import { abortManagedController, addAbortSignalWaiter, builtInDirectContextExecutors as builtInDirectContextExecutors2, chargeRuntimeFileSystemOperation, combineManagedSignals, createManagedControlController, creationUmask, getRuntimeBackingFileSystem, interruptible, isManagedAbortSignal, isManagedControlSignal, isSyncResolved, notifyAbortSignalWaiters, registerManagedAbortSignal, registerRuntimeBackingFileSystem, releaseCombinedSignal, removeAbortSignalWaiter, syncCommandEvaluators as syncCommandEvaluators2, toNativeAbortSignal } from "../../safe-bash-contracts/runtime-control.js";
|
|
363
361
|
|
|
364
362
|
// packages/safe-bash/src/commands/bytes/checksums/index.ts
|
|
365
363
|
init_platform();
|
|
@@ -388,6 +386,3457 @@ function createChecksumCommands(options2 = {}) {
|
|
|
388
386
|
init_platform();
|
|
389
387
|
import { withInputByteBudget } from "../../safe-bash-contracts/index.js";
|
|
390
388
|
import { createGzipCommands } from "../../safe-bash-command-gzip/index.js";
|
|
389
|
+
|
|
390
|
+
// node_modules/pako/dist/pako.mjs
|
|
391
|
+
init_platform();
|
|
392
|
+
var Z_FIXED = 4;
|
|
393
|
+
var Z_BINARY = 0;
|
|
394
|
+
var Z_TEXT = 1;
|
|
395
|
+
var Z_UNKNOWN = 2;
|
|
396
|
+
function zero$1(buf) {
|
|
397
|
+
let len = buf.length;
|
|
398
|
+
while (--len >= 0) buf[len] = 0;
|
|
399
|
+
}
|
|
400
|
+
var STORED_BLOCK = 0;
|
|
401
|
+
var STATIC_TREES = 1;
|
|
402
|
+
var DYN_TREES = 2;
|
|
403
|
+
var LENGTH_CODES = 29;
|
|
404
|
+
var LITERALS = 256;
|
|
405
|
+
var L_CODES = 286;
|
|
406
|
+
var D_CODES = 30;
|
|
407
|
+
var BL_CODES = 19;
|
|
408
|
+
var HEAP_SIZE$1 = 573;
|
|
409
|
+
var MAX_BITS = 15;
|
|
410
|
+
var Buf_size = 16;
|
|
411
|
+
var MAX_BL_BITS = 7;
|
|
412
|
+
var END_BLOCK = 256;
|
|
413
|
+
var REP_3_6 = 16;
|
|
414
|
+
var REPZ_3_10 = 17;
|
|
415
|
+
var REPZ_11_138 = 18;
|
|
416
|
+
var extra_lbits = new Uint8Array([
|
|
417
|
+
0,
|
|
418
|
+
0,
|
|
419
|
+
0,
|
|
420
|
+
0,
|
|
421
|
+
0,
|
|
422
|
+
0,
|
|
423
|
+
0,
|
|
424
|
+
0,
|
|
425
|
+
1,
|
|
426
|
+
1,
|
|
427
|
+
1,
|
|
428
|
+
1,
|
|
429
|
+
2,
|
|
430
|
+
2,
|
|
431
|
+
2,
|
|
432
|
+
2,
|
|
433
|
+
3,
|
|
434
|
+
3,
|
|
435
|
+
3,
|
|
436
|
+
3,
|
|
437
|
+
4,
|
|
438
|
+
4,
|
|
439
|
+
4,
|
|
440
|
+
4,
|
|
441
|
+
5,
|
|
442
|
+
5,
|
|
443
|
+
5,
|
|
444
|
+
5,
|
|
445
|
+
0
|
|
446
|
+
]);
|
|
447
|
+
var extra_dbits = new Uint8Array([
|
|
448
|
+
0,
|
|
449
|
+
0,
|
|
450
|
+
0,
|
|
451
|
+
0,
|
|
452
|
+
1,
|
|
453
|
+
1,
|
|
454
|
+
2,
|
|
455
|
+
2,
|
|
456
|
+
3,
|
|
457
|
+
3,
|
|
458
|
+
4,
|
|
459
|
+
4,
|
|
460
|
+
5,
|
|
461
|
+
5,
|
|
462
|
+
6,
|
|
463
|
+
6,
|
|
464
|
+
7,
|
|
465
|
+
7,
|
|
466
|
+
8,
|
|
467
|
+
8,
|
|
468
|
+
9,
|
|
469
|
+
9,
|
|
470
|
+
10,
|
|
471
|
+
10,
|
|
472
|
+
11,
|
|
473
|
+
11,
|
|
474
|
+
12,
|
|
475
|
+
12,
|
|
476
|
+
13,
|
|
477
|
+
13
|
|
478
|
+
]);
|
|
479
|
+
var extra_blbits = new Uint8Array([
|
|
480
|
+
0,
|
|
481
|
+
0,
|
|
482
|
+
0,
|
|
483
|
+
0,
|
|
484
|
+
0,
|
|
485
|
+
0,
|
|
486
|
+
0,
|
|
487
|
+
0,
|
|
488
|
+
0,
|
|
489
|
+
0,
|
|
490
|
+
0,
|
|
491
|
+
0,
|
|
492
|
+
0,
|
|
493
|
+
0,
|
|
494
|
+
0,
|
|
495
|
+
0,
|
|
496
|
+
2,
|
|
497
|
+
3,
|
|
498
|
+
7
|
|
499
|
+
]);
|
|
500
|
+
var bl_order = new Uint8Array([
|
|
501
|
+
16,
|
|
502
|
+
17,
|
|
503
|
+
18,
|
|
504
|
+
0,
|
|
505
|
+
8,
|
|
506
|
+
7,
|
|
507
|
+
9,
|
|
508
|
+
6,
|
|
509
|
+
10,
|
|
510
|
+
5,
|
|
511
|
+
11,
|
|
512
|
+
4,
|
|
513
|
+
12,
|
|
514
|
+
3,
|
|
515
|
+
13,
|
|
516
|
+
2,
|
|
517
|
+
14,
|
|
518
|
+
1,
|
|
519
|
+
15
|
|
520
|
+
]);
|
|
521
|
+
var DIST_CODE_LEN = 512;
|
|
522
|
+
var static_ltree = new Array(288 * 2);
|
|
523
|
+
zero$1(static_ltree);
|
|
524
|
+
var static_dtree = new Array(D_CODES * 2);
|
|
525
|
+
zero$1(static_dtree);
|
|
526
|
+
var _dist_code = new Array(DIST_CODE_LEN);
|
|
527
|
+
zero$1(_dist_code);
|
|
528
|
+
var _length_code = new Array(256);
|
|
529
|
+
zero$1(_length_code);
|
|
530
|
+
var base_length = new Array(LENGTH_CODES);
|
|
531
|
+
zero$1(base_length);
|
|
532
|
+
var base_dist = new Array(D_CODES);
|
|
533
|
+
zero$1(base_dist);
|
|
534
|
+
var StaticTreeDesc = class {
|
|
535
|
+
constructor(static_tree, extra_bits, extra_base, elems, max_length) {
|
|
536
|
+
this.static_tree = static_tree;
|
|
537
|
+
this.extra_bits = extra_bits;
|
|
538
|
+
this.extra_base = extra_base;
|
|
539
|
+
this.elems = elems;
|
|
540
|
+
this.max_length = max_length;
|
|
541
|
+
this.has_stree = static_tree && static_tree.length;
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
var static_l_desc;
|
|
545
|
+
var static_d_desc;
|
|
546
|
+
var static_bl_desc;
|
|
547
|
+
var TreeDesc = class {
|
|
548
|
+
constructor(dyn_tree, stat_desc) {
|
|
549
|
+
this.dyn_tree = dyn_tree;
|
|
550
|
+
this.max_code = 0;
|
|
551
|
+
this.stat_desc = stat_desc;
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
var d_code = (dist) => {
|
|
555
|
+
return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
|
|
556
|
+
};
|
|
557
|
+
var put_short = (s, w) => {
|
|
558
|
+
s.pending_buf[s.pending++] = w & 255;
|
|
559
|
+
s.pending_buf[s.pending++] = w >>> 8 & 255;
|
|
560
|
+
};
|
|
561
|
+
var send_bits = (s, value2, length) => {
|
|
562
|
+
if (s.bi_valid > Buf_size - length) {
|
|
563
|
+
s.bi_buf |= value2 << s.bi_valid & 65535;
|
|
564
|
+
put_short(s, s.bi_buf);
|
|
565
|
+
s.bi_buf = value2 >> Buf_size - s.bi_valid;
|
|
566
|
+
s.bi_valid += length - Buf_size;
|
|
567
|
+
} else {
|
|
568
|
+
s.bi_buf |= value2 << s.bi_valid & 65535;
|
|
569
|
+
s.bi_valid += length;
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
var send_code = (s, c, tree) => {
|
|
573
|
+
send_bits(s, tree[c * 2], tree[c * 2 + 1]);
|
|
574
|
+
};
|
|
575
|
+
var bi_reverse = (code, len) => {
|
|
576
|
+
let res = 0;
|
|
577
|
+
do {
|
|
578
|
+
res |= code & 1;
|
|
579
|
+
code >>>= 1;
|
|
580
|
+
res <<= 1;
|
|
581
|
+
} while (--len > 0);
|
|
582
|
+
return res >>> 1;
|
|
583
|
+
};
|
|
584
|
+
var bi_flush = (s) => {
|
|
585
|
+
if (s.bi_valid === 16) {
|
|
586
|
+
put_short(s, s.bi_buf);
|
|
587
|
+
s.bi_buf = 0;
|
|
588
|
+
s.bi_valid = 0;
|
|
589
|
+
} else if (s.bi_valid >= 8) {
|
|
590
|
+
s.pending_buf[s.pending++] = s.bi_buf & 255;
|
|
591
|
+
s.bi_buf >>= 8;
|
|
592
|
+
s.bi_valid -= 8;
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
var gen_bitlen = (s, desc) => {
|
|
596
|
+
const tree = desc.dyn_tree;
|
|
597
|
+
const max_code = desc.max_code;
|
|
598
|
+
const stree = desc.stat_desc.static_tree;
|
|
599
|
+
const has_stree = desc.stat_desc.has_stree;
|
|
600
|
+
const extra = desc.stat_desc.extra_bits;
|
|
601
|
+
const base = desc.stat_desc.extra_base;
|
|
602
|
+
const max_length = desc.stat_desc.max_length;
|
|
603
|
+
let h;
|
|
604
|
+
let n, m;
|
|
605
|
+
let bits;
|
|
606
|
+
let xbits;
|
|
607
|
+
let f;
|
|
608
|
+
let overflow = 0;
|
|
609
|
+
for (bits = 0; bits <= MAX_BITS; bits++) s.bl_count[bits] = 0;
|
|
610
|
+
tree[s.heap[s.heap_max] * 2 + 1] = 0;
|
|
611
|
+
for (h = s.heap_max + 1; h < HEAP_SIZE$1; h++) {
|
|
612
|
+
n = s.heap[h];
|
|
613
|
+
bits = tree[tree[n * 2 + 1] * 2 + 1] + 1;
|
|
614
|
+
if (bits > max_length) {
|
|
615
|
+
bits = max_length;
|
|
616
|
+
overflow++;
|
|
617
|
+
}
|
|
618
|
+
tree[n * 2 + 1] = bits;
|
|
619
|
+
if (n > max_code) continue;
|
|
620
|
+
s.bl_count[bits]++;
|
|
621
|
+
xbits = 0;
|
|
622
|
+
if (n >= base) xbits = extra[n - base];
|
|
623
|
+
f = tree[n * 2];
|
|
624
|
+
s.opt_len += f * (bits + xbits);
|
|
625
|
+
if (has_stree) s.static_len += f * (stree[n * 2 + 1] + xbits);
|
|
626
|
+
}
|
|
627
|
+
if (overflow === 0) return;
|
|
628
|
+
do {
|
|
629
|
+
bits = max_length - 1;
|
|
630
|
+
while (s.bl_count[bits] === 0) bits--;
|
|
631
|
+
s.bl_count[bits]--;
|
|
632
|
+
s.bl_count[bits + 1] += 2;
|
|
633
|
+
s.bl_count[max_length]--;
|
|
634
|
+
overflow -= 2;
|
|
635
|
+
} while (overflow > 0);
|
|
636
|
+
for (bits = max_length; bits !== 0; bits--) {
|
|
637
|
+
n = s.bl_count[bits];
|
|
638
|
+
while (n !== 0) {
|
|
639
|
+
m = s.heap[--h];
|
|
640
|
+
if (m > max_code) continue;
|
|
641
|
+
if (tree[m * 2 + 1] !== bits) {
|
|
642
|
+
s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2];
|
|
643
|
+
tree[m * 2 + 1] = bits;
|
|
644
|
+
}
|
|
645
|
+
n--;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
var gen_codes = (tree, max_code, bl_count) => {
|
|
650
|
+
const next_code = new Array(16);
|
|
651
|
+
let code = 0;
|
|
652
|
+
let bits;
|
|
653
|
+
let n;
|
|
654
|
+
for (bits = 1; bits <= MAX_BITS; bits++) {
|
|
655
|
+
code = code + bl_count[bits - 1] << 1;
|
|
656
|
+
next_code[bits] = code;
|
|
657
|
+
}
|
|
658
|
+
for (n = 0; n <= max_code; n++) {
|
|
659
|
+
let len = tree[n * 2 + 1];
|
|
660
|
+
if (len === 0) continue;
|
|
661
|
+
tree[n * 2] = bi_reverse(next_code[len]++, len);
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
var tr_static_init = () => {
|
|
665
|
+
let n;
|
|
666
|
+
let bits;
|
|
667
|
+
let length;
|
|
668
|
+
let code;
|
|
669
|
+
let dist;
|
|
670
|
+
const bl_count = new Array(16);
|
|
671
|
+
length = 0;
|
|
672
|
+
for (code = 0; code < LENGTH_CODES - 1; code++) {
|
|
673
|
+
base_length[code] = length;
|
|
674
|
+
for (n = 0; n < 1 << extra_lbits[code]; n++) _length_code[length++] = code;
|
|
675
|
+
}
|
|
676
|
+
_length_code[length - 1] = code;
|
|
677
|
+
dist = 0;
|
|
678
|
+
for (code = 0; code < 16; code++) {
|
|
679
|
+
base_dist[code] = dist;
|
|
680
|
+
for (n = 0; n < 1 << extra_dbits[code]; n++) _dist_code[dist++] = code;
|
|
681
|
+
}
|
|
682
|
+
dist >>= 7;
|
|
683
|
+
for (; code < D_CODES; code++) {
|
|
684
|
+
base_dist[code] = dist << 7;
|
|
685
|
+
for (n = 0; n < 1 << extra_dbits[code] - 7; n++) _dist_code[256 + dist++] = code;
|
|
686
|
+
}
|
|
687
|
+
for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
|
|
688
|
+
n = 0;
|
|
689
|
+
while (n <= 143) {
|
|
690
|
+
static_ltree[n * 2 + 1] = 8;
|
|
691
|
+
n++;
|
|
692
|
+
bl_count[8]++;
|
|
693
|
+
}
|
|
694
|
+
while (n <= 255) {
|
|
695
|
+
static_ltree[n * 2 + 1] = 9;
|
|
696
|
+
n++;
|
|
697
|
+
bl_count[9]++;
|
|
698
|
+
}
|
|
699
|
+
while (n <= 279) {
|
|
700
|
+
static_ltree[n * 2 + 1] = 7;
|
|
701
|
+
n++;
|
|
702
|
+
bl_count[7]++;
|
|
703
|
+
}
|
|
704
|
+
while (n <= 287) {
|
|
705
|
+
static_ltree[n * 2 + 1] = 8;
|
|
706
|
+
n++;
|
|
707
|
+
bl_count[8]++;
|
|
708
|
+
}
|
|
709
|
+
gen_codes(static_ltree, 287, bl_count);
|
|
710
|
+
for (n = 0; n < D_CODES; n++) {
|
|
711
|
+
static_dtree[n * 2 + 1] = 5;
|
|
712
|
+
static_dtree[n * 2] = bi_reverse(n, 5);
|
|
713
|
+
}
|
|
714
|
+
static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, 257, L_CODES, MAX_BITS);
|
|
715
|
+
static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
|
|
716
|
+
static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
|
|
717
|
+
};
|
|
718
|
+
var init_block = (s) => {
|
|
719
|
+
let n;
|
|
720
|
+
for (n = 0; n < L_CODES; n++) s.dyn_ltree[n * 2] = 0;
|
|
721
|
+
for (n = 0; n < D_CODES; n++) s.dyn_dtree[n * 2] = 0;
|
|
722
|
+
for (n = 0; n < BL_CODES; n++) s.bl_tree[n * 2] = 0;
|
|
723
|
+
s.dyn_ltree[END_BLOCK * 2] = 1;
|
|
724
|
+
s.opt_len = s.static_len = 0;
|
|
725
|
+
s.sym_next = s.matches = 0;
|
|
726
|
+
};
|
|
727
|
+
var bi_windup = (s) => {
|
|
728
|
+
if (s.bi_valid > 8) put_short(s, s.bi_buf);
|
|
729
|
+
else if (s.bi_valid > 0) s.pending_buf[s.pending++] = s.bi_buf;
|
|
730
|
+
s.bi_buf = 0;
|
|
731
|
+
s.bi_valid = 0;
|
|
732
|
+
};
|
|
733
|
+
var smaller = (tree, n, m, depth) => {
|
|
734
|
+
const _n2 = n * 2;
|
|
735
|
+
const _m2 = m * 2;
|
|
736
|
+
return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];
|
|
737
|
+
};
|
|
738
|
+
var pqdownheap = (s, tree, k) => {
|
|
739
|
+
const v = s.heap[k];
|
|
740
|
+
let j = k << 1;
|
|
741
|
+
while (j <= s.heap_len) {
|
|
742
|
+
if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) j++;
|
|
743
|
+
if (smaller(tree, v, s.heap[j], s.depth)) break;
|
|
744
|
+
s.heap[k] = s.heap[j];
|
|
745
|
+
k = j;
|
|
746
|
+
j <<= 1;
|
|
747
|
+
}
|
|
748
|
+
s.heap[k] = v;
|
|
749
|
+
};
|
|
750
|
+
var compress_block = (s, ltree, dtree) => {
|
|
751
|
+
let dist;
|
|
752
|
+
let lc;
|
|
753
|
+
let sx = 0;
|
|
754
|
+
let code;
|
|
755
|
+
let extra;
|
|
756
|
+
if (s.sym_next !== 0) do {
|
|
757
|
+
dist = s.pending_buf[s.sym_buf + sx++] & 255;
|
|
758
|
+
dist += (s.pending_buf[s.sym_buf + sx++] & 255) << 8;
|
|
759
|
+
lc = s.pending_buf[s.sym_buf + sx++];
|
|
760
|
+
if (dist === 0) send_code(s, lc, ltree);
|
|
761
|
+
else {
|
|
762
|
+
code = _length_code[lc];
|
|
763
|
+
send_code(s, code + LITERALS + 1, ltree);
|
|
764
|
+
extra = extra_lbits[code];
|
|
765
|
+
if (extra !== 0) {
|
|
766
|
+
lc -= base_length[code];
|
|
767
|
+
send_bits(s, lc, extra);
|
|
768
|
+
}
|
|
769
|
+
dist--;
|
|
770
|
+
code = d_code(dist);
|
|
771
|
+
send_code(s, code, dtree);
|
|
772
|
+
extra = extra_dbits[code];
|
|
773
|
+
if (extra !== 0) {
|
|
774
|
+
dist -= base_dist[code];
|
|
775
|
+
send_bits(s, dist, extra);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
} while (sx < s.sym_next);
|
|
779
|
+
send_code(s, END_BLOCK, ltree);
|
|
780
|
+
};
|
|
781
|
+
var build_tree = (s, desc) => {
|
|
782
|
+
const tree = desc.dyn_tree;
|
|
783
|
+
const stree = desc.stat_desc.static_tree;
|
|
784
|
+
const has_stree = desc.stat_desc.has_stree;
|
|
785
|
+
const elems = desc.stat_desc.elems;
|
|
786
|
+
let n, m;
|
|
787
|
+
let max_code = -1;
|
|
788
|
+
let node;
|
|
789
|
+
s.heap_len = 0;
|
|
790
|
+
s.heap_max = HEAP_SIZE$1;
|
|
791
|
+
for (n = 0; n < elems; n++) if (tree[n * 2] !== 0) {
|
|
792
|
+
s.heap[++s.heap_len] = max_code = n;
|
|
793
|
+
s.depth[n] = 0;
|
|
794
|
+
} else tree[n * 2 + 1] = 0;
|
|
795
|
+
while (s.heap_len < 2) {
|
|
796
|
+
node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;
|
|
797
|
+
tree[node * 2] = 1;
|
|
798
|
+
s.depth[node] = 0;
|
|
799
|
+
s.opt_len--;
|
|
800
|
+
if (has_stree) s.static_len -= stree[node * 2 + 1];
|
|
801
|
+
}
|
|
802
|
+
desc.max_code = max_code;
|
|
803
|
+
for (n = s.heap_len >> 1; n >= 1; n--) pqdownheap(s, tree, n);
|
|
804
|
+
node = elems;
|
|
805
|
+
do {
|
|
806
|
+
n = s.heap[1];
|
|
807
|
+
s.heap[1] = s.heap[s.heap_len--];
|
|
808
|
+
pqdownheap(s, tree, 1);
|
|
809
|
+
m = s.heap[1];
|
|
810
|
+
s.heap[--s.heap_max] = n;
|
|
811
|
+
s.heap[--s.heap_max] = m;
|
|
812
|
+
tree[node * 2] = tree[n * 2] + tree[m * 2];
|
|
813
|
+
s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
|
|
814
|
+
tree[n * 2 + 1] = tree[m * 2 + 1] = node;
|
|
815
|
+
s.heap[1] = node++;
|
|
816
|
+
pqdownheap(s, tree, 1);
|
|
817
|
+
} while (s.heap_len >= 2);
|
|
818
|
+
s.heap[--s.heap_max] = s.heap[1];
|
|
819
|
+
gen_bitlen(s, desc);
|
|
820
|
+
gen_codes(tree, max_code, s.bl_count);
|
|
821
|
+
};
|
|
822
|
+
var scan_tree = (s, tree, max_code) => {
|
|
823
|
+
let n;
|
|
824
|
+
let prevlen = -1;
|
|
825
|
+
let curlen;
|
|
826
|
+
let nextlen = tree[1];
|
|
827
|
+
let count = 0;
|
|
828
|
+
let max_count = 7;
|
|
829
|
+
let min_count = 4;
|
|
830
|
+
if (nextlen === 0) {
|
|
831
|
+
max_count = 138;
|
|
832
|
+
min_count = 3;
|
|
833
|
+
}
|
|
834
|
+
tree[(max_code + 1) * 2 + 1] = 65535;
|
|
835
|
+
for (n = 0; n <= max_code; n++) {
|
|
836
|
+
curlen = nextlen;
|
|
837
|
+
nextlen = tree[(n + 1) * 2 + 1];
|
|
838
|
+
if (++count < max_count && curlen === nextlen) continue;
|
|
839
|
+
else if (count < min_count) s.bl_tree[curlen * 2] += count;
|
|
840
|
+
else if (curlen !== 0) {
|
|
841
|
+
if (curlen !== prevlen) s.bl_tree[curlen * 2]++;
|
|
842
|
+
s.bl_tree[REP_3_6 * 2]++;
|
|
843
|
+
} else if (count <= 10) s.bl_tree[REPZ_3_10 * 2]++;
|
|
844
|
+
else s.bl_tree[REPZ_11_138 * 2]++;
|
|
845
|
+
count = 0;
|
|
846
|
+
prevlen = curlen;
|
|
847
|
+
if (nextlen === 0) {
|
|
848
|
+
max_count = 138;
|
|
849
|
+
min_count = 3;
|
|
850
|
+
} else if (curlen === nextlen) {
|
|
851
|
+
max_count = 6;
|
|
852
|
+
min_count = 3;
|
|
853
|
+
} else {
|
|
854
|
+
max_count = 7;
|
|
855
|
+
min_count = 4;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
};
|
|
859
|
+
var send_tree = (s, tree, max_code) => {
|
|
860
|
+
let n;
|
|
861
|
+
let prevlen = -1;
|
|
862
|
+
let curlen;
|
|
863
|
+
let nextlen = tree[1];
|
|
864
|
+
let count = 0;
|
|
865
|
+
let max_count = 7;
|
|
866
|
+
let min_count = 4;
|
|
867
|
+
if (nextlen === 0) {
|
|
868
|
+
max_count = 138;
|
|
869
|
+
min_count = 3;
|
|
870
|
+
}
|
|
871
|
+
for (n = 0; n <= max_code; n++) {
|
|
872
|
+
curlen = nextlen;
|
|
873
|
+
nextlen = tree[(n + 1) * 2 + 1];
|
|
874
|
+
if (++count < max_count && curlen === nextlen) continue;
|
|
875
|
+
else if (count < min_count) do
|
|
876
|
+
send_code(s, curlen, s.bl_tree);
|
|
877
|
+
while (--count !== 0);
|
|
878
|
+
else if (curlen !== 0) {
|
|
879
|
+
if (curlen !== prevlen) {
|
|
880
|
+
send_code(s, curlen, s.bl_tree);
|
|
881
|
+
count--;
|
|
882
|
+
}
|
|
883
|
+
send_code(s, REP_3_6, s.bl_tree);
|
|
884
|
+
send_bits(s, count - 3, 2);
|
|
885
|
+
} else if (count <= 10) {
|
|
886
|
+
send_code(s, REPZ_3_10, s.bl_tree);
|
|
887
|
+
send_bits(s, count - 3, 3);
|
|
888
|
+
} else {
|
|
889
|
+
send_code(s, REPZ_11_138, s.bl_tree);
|
|
890
|
+
send_bits(s, count - 11, 7);
|
|
891
|
+
}
|
|
892
|
+
count = 0;
|
|
893
|
+
prevlen = curlen;
|
|
894
|
+
if (nextlen === 0) {
|
|
895
|
+
max_count = 138;
|
|
896
|
+
min_count = 3;
|
|
897
|
+
} else if (curlen === nextlen) {
|
|
898
|
+
max_count = 6;
|
|
899
|
+
min_count = 3;
|
|
900
|
+
} else {
|
|
901
|
+
max_count = 7;
|
|
902
|
+
min_count = 4;
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
};
|
|
906
|
+
var build_bl_tree = (s) => {
|
|
907
|
+
let max_blindex;
|
|
908
|
+
scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
|
|
909
|
+
scan_tree(s, s.dyn_dtree, s.d_desc.max_code);
|
|
910
|
+
build_tree(s, s.bl_desc);
|
|
911
|
+
for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0) break;
|
|
912
|
+
s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
|
|
913
|
+
return max_blindex;
|
|
914
|
+
};
|
|
915
|
+
var send_all_trees = (s, lcodes, dcodes, blcodes) => {
|
|
916
|
+
let rank2;
|
|
917
|
+
send_bits(s, lcodes - 257, 5);
|
|
918
|
+
send_bits(s, dcodes - 1, 5);
|
|
919
|
+
send_bits(s, blcodes - 4, 4);
|
|
920
|
+
for (rank2 = 0; rank2 < blcodes; rank2++) send_bits(s, s.bl_tree[bl_order[rank2] * 2 + 1], 3);
|
|
921
|
+
send_tree(s, s.dyn_ltree, lcodes - 1);
|
|
922
|
+
send_tree(s, s.dyn_dtree, dcodes - 1);
|
|
923
|
+
};
|
|
924
|
+
var detect_data_type = (s) => {
|
|
925
|
+
let block_mask = 4093624447;
|
|
926
|
+
let n;
|
|
927
|
+
for (n = 0; n <= 31; n++, block_mask >>>= 1) if (block_mask & 1 && s.dyn_ltree[n * 2] !== 0) return Z_BINARY;
|
|
928
|
+
if (s.dyn_ltree[18] !== 0 || s.dyn_ltree[20] !== 0 || s.dyn_ltree[26] !== 0) return Z_TEXT;
|
|
929
|
+
for (n = 32; n < LITERALS; n++) if (s.dyn_ltree[n * 2] !== 0) return Z_TEXT;
|
|
930
|
+
return Z_BINARY;
|
|
931
|
+
};
|
|
932
|
+
var static_init_done = false;
|
|
933
|
+
var _tr_init = (s) => {
|
|
934
|
+
if (!static_init_done) {
|
|
935
|
+
tr_static_init();
|
|
936
|
+
static_init_done = true;
|
|
937
|
+
}
|
|
938
|
+
s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
|
|
939
|
+
s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
|
|
940
|
+
s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);
|
|
941
|
+
s.bi_buf = 0;
|
|
942
|
+
s.bi_valid = 0;
|
|
943
|
+
init_block(s);
|
|
944
|
+
};
|
|
945
|
+
var _tr_stored_block = (s, buf, stored_len, last) => {
|
|
946
|
+
send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);
|
|
947
|
+
bi_windup(s);
|
|
948
|
+
put_short(s, stored_len);
|
|
949
|
+
put_short(s, ~stored_len);
|
|
950
|
+
if (stored_len) s.pending_buf.set(s.window.subarray(buf, buf + stored_len), s.pending);
|
|
951
|
+
s.pending += stored_len;
|
|
952
|
+
};
|
|
953
|
+
var _tr_align = (s) => {
|
|
954
|
+
send_bits(s, STATIC_TREES << 1, 3);
|
|
955
|
+
send_code(s, END_BLOCK, static_ltree);
|
|
956
|
+
bi_flush(s);
|
|
957
|
+
};
|
|
958
|
+
var _tr_flush_block = (s, buf, stored_len, last) => {
|
|
959
|
+
let opt_lenb, static_lenb;
|
|
960
|
+
let max_blindex = 0;
|
|
961
|
+
if (s.level > 0) {
|
|
962
|
+
if (s.strm.data_type === Z_UNKNOWN) s.strm.data_type = detect_data_type(s);
|
|
963
|
+
build_tree(s, s.l_desc);
|
|
964
|
+
build_tree(s, s.d_desc);
|
|
965
|
+
max_blindex = build_bl_tree(s);
|
|
966
|
+
opt_lenb = s.opt_len + 3 + 7 >>> 3;
|
|
967
|
+
static_lenb = s.static_len + 3 + 7 >>> 3;
|
|
968
|
+
if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
|
|
969
|
+
} else opt_lenb = static_lenb = stored_len + 5;
|
|
970
|
+
if (stored_len + 4 <= opt_lenb && buf !== -1) _tr_stored_block(s, buf, stored_len, last);
|
|
971
|
+
else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
|
|
972
|
+
send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
|
|
973
|
+
compress_block(s, static_ltree, static_dtree);
|
|
974
|
+
} else {
|
|
975
|
+
send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);
|
|
976
|
+
send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
|
|
977
|
+
compress_block(s, s.dyn_ltree, s.dyn_dtree);
|
|
978
|
+
}
|
|
979
|
+
init_block(s);
|
|
980
|
+
if (last) bi_windup(s);
|
|
981
|
+
};
|
|
982
|
+
var _tr_tally = (s, dist, lc) => {
|
|
983
|
+
s.pending_buf[s.sym_buf + s.sym_next++] = dist;
|
|
984
|
+
s.pending_buf[s.sym_buf + s.sym_next++] = dist >> 8;
|
|
985
|
+
s.pending_buf[s.sym_buf + s.sym_next++] = lc;
|
|
986
|
+
if (dist === 0) s.dyn_ltree[lc * 2]++;
|
|
987
|
+
else {
|
|
988
|
+
s.matches++;
|
|
989
|
+
dist--;
|
|
990
|
+
s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++;
|
|
991
|
+
s.dyn_dtree[d_code(dist) * 2]++;
|
|
992
|
+
}
|
|
993
|
+
return s.sym_next === s.sym_end;
|
|
994
|
+
};
|
|
995
|
+
var adler32 = (adler, buf, len, pos) => {
|
|
996
|
+
let s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;
|
|
997
|
+
while (len !== 0) {
|
|
998
|
+
n = len > 2e3 ? 2e3 : len;
|
|
999
|
+
len -= n;
|
|
1000
|
+
do {
|
|
1001
|
+
s1 = s1 + buf[pos++] | 0;
|
|
1002
|
+
s2 = s2 + s1 | 0;
|
|
1003
|
+
} while (--n);
|
|
1004
|
+
s1 %= 65521;
|
|
1005
|
+
s2 %= 65521;
|
|
1006
|
+
}
|
|
1007
|
+
return s1 | s2 << 16 | 0;
|
|
1008
|
+
};
|
|
1009
|
+
var makeTable = () => {
|
|
1010
|
+
let c, table = [];
|
|
1011
|
+
for (var n = 0; n < 256; n++) {
|
|
1012
|
+
c = n;
|
|
1013
|
+
for (var k = 0; k < 8; k++) c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
1014
|
+
table[n] = c;
|
|
1015
|
+
}
|
|
1016
|
+
return table;
|
|
1017
|
+
};
|
|
1018
|
+
var crcTable = new Uint32Array(makeTable());
|
|
1019
|
+
var crc32 = (crc, buf, len, pos) => {
|
|
1020
|
+
const t = crcTable;
|
|
1021
|
+
const end = pos + len;
|
|
1022
|
+
crc ^= -1;
|
|
1023
|
+
for (let i = pos; i < end; i++) crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];
|
|
1024
|
+
return crc ^ -1;
|
|
1025
|
+
};
|
|
1026
|
+
var messages_default = {
|
|
1027
|
+
2: "need dictionary",
|
|
1028
|
+
1: "stream end",
|
|
1029
|
+
0: "",
|
|
1030
|
+
"-1": "file error",
|
|
1031
|
+
"-2": "stream error",
|
|
1032
|
+
"-3": "data error",
|
|
1033
|
+
"-4": "insufficient memory",
|
|
1034
|
+
"-5": "buffer error",
|
|
1035
|
+
"-6": "incompatible version"
|
|
1036
|
+
};
|
|
1037
|
+
var MAX_MEM_LEVEL = 9;
|
|
1038
|
+
var HEAP_SIZE = 573;
|
|
1039
|
+
var MIN_MATCH = 3;
|
|
1040
|
+
var MAX_MATCH = 258;
|
|
1041
|
+
var MIN_LOOKAHEAD = 262;
|
|
1042
|
+
var PRESET_DICT = 32;
|
|
1043
|
+
var INIT_STATE = 42;
|
|
1044
|
+
var GZIP_STATE = 57;
|
|
1045
|
+
var EXTRA_STATE = 69;
|
|
1046
|
+
var NAME_STATE = 73;
|
|
1047
|
+
var COMMENT_STATE = 91;
|
|
1048
|
+
var HCRC_STATE = 103;
|
|
1049
|
+
var BUSY_STATE = 113;
|
|
1050
|
+
var FINISH_STATE = 666;
|
|
1051
|
+
var BS_NEED_MORE = 1;
|
|
1052
|
+
var BS_BLOCK_DONE = 2;
|
|
1053
|
+
var BS_FINISH_STARTED = 3;
|
|
1054
|
+
var BS_FINISH_DONE = 4;
|
|
1055
|
+
var OS_CODE = 3;
|
|
1056
|
+
var err = (strm, errorCode) => {
|
|
1057
|
+
strm.msg = messages_default[errorCode];
|
|
1058
|
+
return errorCode;
|
|
1059
|
+
};
|
|
1060
|
+
var rank = (f) => {
|
|
1061
|
+
return f * 2 - (f > 4 ? 9 : 0);
|
|
1062
|
+
};
|
|
1063
|
+
var zero = (buf) => {
|
|
1064
|
+
let len = buf.length;
|
|
1065
|
+
while (--len >= 0) buf[len] = 0;
|
|
1066
|
+
};
|
|
1067
|
+
var slide_hash = (s) => {
|
|
1068
|
+
let n, m;
|
|
1069
|
+
let p;
|
|
1070
|
+
let wsize = s.w_size;
|
|
1071
|
+
n = s.hash_size;
|
|
1072
|
+
p = n;
|
|
1073
|
+
do {
|
|
1074
|
+
m = s.head[--p];
|
|
1075
|
+
s.head[p] = m >= wsize ? m - wsize : 0;
|
|
1076
|
+
} while (--n);
|
|
1077
|
+
n = wsize;
|
|
1078
|
+
p = n;
|
|
1079
|
+
do {
|
|
1080
|
+
m = s.prev[--p];
|
|
1081
|
+
s.prev[p] = m >= wsize ? m - wsize : 0;
|
|
1082
|
+
} while (--n);
|
|
1083
|
+
};
|
|
1084
|
+
var HASH = (s, prev, data) => (prev << s.hash_shift ^ data) & s.hash_mask;
|
|
1085
|
+
var INSERT_STRING = (s, str) => {
|
|
1086
|
+
let h;
|
|
1087
|
+
if (s.legacy_hash) h = s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);
|
|
1088
|
+
else {
|
|
1089
|
+
const w = s.window;
|
|
1090
|
+
const value2 = w[str] | w[str + 1] << 8 | w[str + 2] << 16 | w[str + 3] << 24;
|
|
1091
|
+
h = s.ins_h = Math.imul(value2, 66521) + 66521 >>> 16 & s.hash_mask;
|
|
1092
|
+
}
|
|
1093
|
+
const hash_head = s.prev[str & s.w_mask] = s.head[h];
|
|
1094
|
+
s.head[h] = str;
|
|
1095
|
+
return hash_head;
|
|
1096
|
+
};
|
|
1097
|
+
var flush_pending = (strm) => {
|
|
1098
|
+
const s = strm.state;
|
|
1099
|
+
let len = s.pending;
|
|
1100
|
+
if (len > strm.avail_out) len = strm.avail_out;
|
|
1101
|
+
if (len === 0) return;
|
|
1102
|
+
strm.output.set(s.pending_buf.subarray(s.pending_out, s.pending_out + len), strm.next_out);
|
|
1103
|
+
strm.next_out += len;
|
|
1104
|
+
s.pending_out += len;
|
|
1105
|
+
strm.total_out += len;
|
|
1106
|
+
strm.avail_out -= len;
|
|
1107
|
+
s.pending -= len;
|
|
1108
|
+
if (s.pending === 0) s.pending_out = 0;
|
|
1109
|
+
};
|
|
1110
|
+
var flush_block_only = (s, last) => {
|
|
1111
|
+
_tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last);
|
|
1112
|
+
s.block_start = s.strstart;
|
|
1113
|
+
flush_pending(s.strm);
|
|
1114
|
+
};
|
|
1115
|
+
var put_byte = (s, b) => {
|
|
1116
|
+
s.pending_buf[s.pending++] = b;
|
|
1117
|
+
};
|
|
1118
|
+
var putShortMSB = (s, b) => {
|
|
1119
|
+
s.pending_buf[s.pending++] = b >>> 8 & 255;
|
|
1120
|
+
s.pending_buf[s.pending++] = b & 255;
|
|
1121
|
+
};
|
|
1122
|
+
var read_buf = (strm, buf, start, size) => {
|
|
1123
|
+
let len = strm.avail_in;
|
|
1124
|
+
if (len > size) len = size;
|
|
1125
|
+
if (len === 0) return 0;
|
|
1126
|
+
strm.avail_in -= len;
|
|
1127
|
+
buf.set(strm.input.subarray(strm.next_in, strm.next_in + len), start);
|
|
1128
|
+
if (strm.state.wrap === 1) strm.adler = adler32(strm.adler, buf, len, start);
|
|
1129
|
+
else if (strm.state.wrap === 2) strm.adler = crc32(strm.adler, buf, len, start);
|
|
1130
|
+
strm.next_in += len;
|
|
1131
|
+
strm.total_in += len;
|
|
1132
|
+
return len;
|
|
1133
|
+
};
|
|
1134
|
+
var longest_match = (s, cur_match) => {
|
|
1135
|
+
let chain_length = s.max_chain_length;
|
|
1136
|
+
let scan = s.strstart;
|
|
1137
|
+
let match;
|
|
1138
|
+
let len;
|
|
1139
|
+
let best_len = s.prev_length;
|
|
1140
|
+
let nice_match = s.nice_match;
|
|
1141
|
+
const limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0;
|
|
1142
|
+
const _win = s.window;
|
|
1143
|
+
const wmask = s.w_mask;
|
|
1144
|
+
const prev = s.prev;
|
|
1145
|
+
const strend = s.strstart + MAX_MATCH;
|
|
1146
|
+
let scan_end1 = _win[scan + best_len - 1];
|
|
1147
|
+
let scan_end = _win[scan + best_len];
|
|
1148
|
+
if (s.prev_length >= s.good_match) chain_length >>= 2;
|
|
1149
|
+
if (nice_match > s.lookahead) nice_match = s.lookahead;
|
|
1150
|
+
do {
|
|
1151
|
+
match = cur_match;
|
|
1152
|
+
if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) continue;
|
|
1153
|
+
scan += 2;
|
|
1154
|
+
match++;
|
|
1155
|
+
do
|
|
1156
|
+
;
|
|
1157
|
+
while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);
|
|
1158
|
+
len = MAX_MATCH - (strend - scan);
|
|
1159
|
+
scan = strend - MAX_MATCH;
|
|
1160
|
+
if (len > best_len) {
|
|
1161
|
+
s.match_start = cur_match;
|
|
1162
|
+
best_len = len;
|
|
1163
|
+
if (len >= nice_match) break;
|
|
1164
|
+
scan_end1 = _win[scan + best_len - 1];
|
|
1165
|
+
scan_end = _win[scan + best_len];
|
|
1166
|
+
}
|
|
1167
|
+
} while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);
|
|
1168
|
+
if (best_len <= s.lookahead) return best_len;
|
|
1169
|
+
return s.lookahead;
|
|
1170
|
+
};
|
|
1171
|
+
var fill_window = (s) => {
|
|
1172
|
+
const _w_size = s.w_size;
|
|
1173
|
+
let n, more, str;
|
|
1174
|
+
do {
|
|
1175
|
+
more = s.window_size - s.lookahead - s.strstart;
|
|
1176
|
+
if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
|
|
1177
|
+
s.window.set(s.window.subarray(_w_size, _w_size + _w_size - more), 0);
|
|
1178
|
+
s.match_start -= _w_size;
|
|
1179
|
+
s.strstart -= _w_size;
|
|
1180
|
+
s.block_start -= _w_size;
|
|
1181
|
+
if (s.insert > s.strstart) s.insert = s.strstart;
|
|
1182
|
+
slide_hash(s);
|
|
1183
|
+
more += _w_size;
|
|
1184
|
+
}
|
|
1185
|
+
if (s.strm.avail_in === 0) break;
|
|
1186
|
+
n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
|
|
1187
|
+
s.lookahead += n;
|
|
1188
|
+
if (!s.legacy_hash) {
|
|
1189
|
+
if (s.lookahead + s.insert > MIN_MATCH) {
|
|
1190
|
+
str = s.strstart - s.insert;
|
|
1191
|
+
while (s.insert) {
|
|
1192
|
+
INSERT_STRING(s, str);
|
|
1193
|
+
str++;
|
|
1194
|
+
s.insert--;
|
|
1195
|
+
if (s.lookahead + s.insert <= MIN_MATCH) break;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
} else if (s.lookahead + s.insert >= MIN_MATCH) {
|
|
1199
|
+
str = s.strstart - s.insert;
|
|
1200
|
+
s.ins_h = s.window[str];
|
|
1201
|
+
s.ins_h = HASH(s, s.ins_h, s.window[str + 1]);
|
|
1202
|
+
while (s.insert) {
|
|
1203
|
+
INSERT_STRING(s, str);
|
|
1204
|
+
str++;
|
|
1205
|
+
s.insert--;
|
|
1206
|
+
if (s.lookahead + s.insert < MIN_MATCH) break;
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
} while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);
|
|
1210
|
+
};
|
|
1211
|
+
var deflate_stored = (s, flush) => {
|
|
1212
|
+
let min_block = s.pending_buf_size - 5 > s.w_size ? s.w_size : s.pending_buf_size - 5;
|
|
1213
|
+
let len, left, have, last = 0;
|
|
1214
|
+
let used = s.strm.avail_in;
|
|
1215
|
+
do {
|
|
1216
|
+
len = 65535;
|
|
1217
|
+
have = s.bi_valid + 42 >> 3;
|
|
1218
|
+
if (s.strm.avail_out < have) break;
|
|
1219
|
+
have = s.strm.avail_out - have;
|
|
1220
|
+
left = s.strstart - s.block_start;
|
|
1221
|
+
if (len > left + s.strm.avail_in) len = left + s.strm.avail_in;
|
|
1222
|
+
if (len > have) len = have;
|
|
1223
|
+
if (len < min_block && (len === 0 && flush !== 4 || flush === 0 || len !== left + s.strm.avail_in)) break;
|
|
1224
|
+
last = flush === 4 && len === left + s.strm.avail_in ? 1 : 0;
|
|
1225
|
+
_tr_stored_block(s, 0, 0, last);
|
|
1226
|
+
s.pending_buf[s.pending - 4] = len;
|
|
1227
|
+
s.pending_buf[s.pending - 3] = len >> 8;
|
|
1228
|
+
s.pending_buf[s.pending - 2] = ~len;
|
|
1229
|
+
s.pending_buf[s.pending - 1] = ~len >> 8;
|
|
1230
|
+
flush_pending(s.strm);
|
|
1231
|
+
if (left) {
|
|
1232
|
+
if (left > len) left = len;
|
|
1233
|
+
s.strm.output.set(s.window.subarray(s.block_start, s.block_start + left), s.strm.next_out);
|
|
1234
|
+
s.strm.next_out += left;
|
|
1235
|
+
s.strm.avail_out -= left;
|
|
1236
|
+
s.strm.total_out += left;
|
|
1237
|
+
s.block_start += left;
|
|
1238
|
+
len -= left;
|
|
1239
|
+
}
|
|
1240
|
+
if (len) {
|
|
1241
|
+
read_buf(s.strm, s.strm.output, s.strm.next_out, len);
|
|
1242
|
+
s.strm.next_out += len;
|
|
1243
|
+
s.strm.avail_out -= len;
|
|
1244
|
+
s.strm.total_out += len;
|
|
1245
|
+
}
|
|
1246
|
+
} while (last === 0);
|
|
1247
|
+
used -= s.strm.avail_in;
|
|
1248
|
+
if (used) {
|
|
1249
|
+
if (used >= s.w_size) {
|
|
1250
|
+
s.matches = 2;
|
|
1251
|
+
s.window.set(s.strm.input.subarray(s.strm.next_in - s.w_size, s.strm.next_in), 0);
|
|
1252
|
+
s.strstart = s.w_size;
|
|
1253
|
+
s.insert = s.strstart;
|
|
1254
|
+
} else {
|
|
1255
|
+
if (s.window_size - s.strstart <= used) {
|
|
1256
|
+
s.strstart -= s.w_size;
|
|
1257
|
+
s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);
|
|
1258
|
+
if (s.matches < 2) s.matches++;
|
|
1259
|
+
if (s.insert > s.strstart) s.insert = s.strstart;
|
|
1260
|
+
}
|
|
1261
|
+
s.window.set(s.strm.input.subarray(s.strm.next_in - used, s.strm.next_in), s.strstart);
|
|
1262
|
+
s.strstart += used;
|
|
1263
|
+
s.insert += used > s.w_size - s.insert ? s.w_size - s.insert : used;
|
|
1264
|
+
}
|
|
1265
|
+
s.block_start = s.strstart;
|
|
1266
|
+
}
|
|
1267
|
+
if (s.high_water < s.strstart) s.high_water = s.strstart;
|
|
1268
|
+
if (last) return BS_FINISH_DONE;
|
|
1269
|
+
if (flush !== 0 && flush !== 4 && s.strm.avail_in === 0 && s.strstart === s.block_start) return BS_BLOCK_DONE;
|
|
1270
|
+
have = s.window_size - s.strstart;
|
|
1271
|
+
if (s.strm.avail_in > have && s.block_start >= s.w_size) {
|
|
1272
|
+
s.block_start -= s.w_size;
|
|
1273
|
+
s.strstart -= s.w_size;
|
|
1274
|
+
s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);
|
|
1275
|
+
if (s.matches < 2) s.matches++;
|
|
1276
|
+
have += s.w_size;
|
|
1277
|
+
if (s.insert > s.strstart) s.insert = s.strstart;
|
|
1278
|
+
}
|
|
1279
|
+
if (have > s.strm.avail_in) have = s.strm.avail_in;
|
|
1280
|
+
if (have) {
|
|
1281
|
+
read_buf(s.strm, s.window, s.strstart, have);
|
|
1282
|
+
s.strstart += have;
|
|
1283
|
+
s.insert += have > s.w_size - s.insert ? s.w_size - s.insert : have;
|
|
1284
|
+
}
|
|
1285
|
+
if (s.high_water < s.strstart) s.high_water = s.strstart;
|
|
1286
|
+
have = s.bi_valid + 42 >> 3;
|
|
1287
|
+
have = s.pending_buf_size - have > 65535 ? 65535 : s.pending_buf_size - have;
|
|
1288
|
+
min_block = have > s.w_size ? s.w_size : have;
|
|
1289
|
+
left = s.strstart - s.block_start;
|
|
1290
|
+
if (left >= min_block || (left || flush === 4) && flush !== 0 && s.strm.avail_in === 0 && left <= have) {
|
|
1291
|
+
len = left > have ? have : left;
|
|
1292
|
+
last = flush === 4 && s.strm.avail_in === 0 && len === left ? 1 : 0;
|
|
1293
|
+
_tr_stored_block(s, s.block_start, len, last);
|
|
1294
|
+
s.block_start += len;
|
|
1295
|
+
flush_pending(s.strm);
|
|
1296
|
+
}
|
|
1297
|
+
return last ? BS_FINISH_STARTED : BS_NEED_MORE;
|
|
1298
|
+
};
|
|
1299
|
+
var deflate_fast = (s, flush) => {
|
|
1300
|
+
let hash_head;
|
|
1301
|
+
let bflush;
|
|
1302
|
+
for (; ; ) {
|
|
1303
|
+
if (s.lookahead < MIN_LOOKAHEAD) {
|
|
1304
|
+
fill_window(s);
|
|
1305
|
+
if (s.lookahead < MIN_LOOKAHEAD && flush === 0) return BS_NEED_MORE;
|
|
1306
|
+
if (s.lookahead === 0) break;
|
|
1307
|
+
}
|
|
1308
|
+
hash_head = 0;
|
|
1309
|
+
if (s.lookahead >= MIN_MATCH) hash_head = INSERT_STRING(s, s.strstart);
|
|
1310
|
+
if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) s.match_length = longest_match(s, hash_head);
|
|
1311
|
+
if (s.match_length >= MIN_MATCH) {
|
|
1312
|
+
bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
|
|
1313
|
+
s.lookahead -= s.match_length;
|
|
1314
|
+
if (s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {
|
|
1315
|
+
s.match_length--;
|
|
1316
|
+
do {
|
|
1317
|
+
s.strstart++;
|
|
1318
|
+
hash_head = INSERT_STRING(s, s.strstart);
|
|
1319
|
+
} while (--s.match_length !== 0);
|
|
1320
|
+
s.strstart++;
|
|
1321
|
+
} else {
|
|
1322
|
+
s.strstart += s.match_length;
|
|
1323
|
+
s.match_length = 0;
|
|
1324
|
+
if (s.legacy_hash) {
|
|
1325
|
+
s.ins_h = s.window[s.strstart];
|
|
1326
|
+
s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + 1]);
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
} else {
|
|
1330
|
+
bflush = _tr_tally(s, 0, s.window[s.strstart]);
|
|
1331
|
+
s.lookahead--;
|
|
1332
|
+
s.strstart++;
|
|
1333
|
+
}
|
|
1334
|
+
if (bflush) {
|
|
1335
|
+
flush_block_only(s, false);
|
|
1336
|
+
if (s.strm.avail_out === 0) return BS_NEED_MORE;
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
|
|
1340
|
+
if (flush === 4) {
|
|
1341
|
+
flush_block_only(s, true);
|
|
1342
|
+
if (s.strm.avail_out === 0) return BS_FINISH_STARTED;
|
|
1343
|
+
return BS_FINISH_DONE;
|
|
1344
|
+
}
|
|
1345
|
+
if (s.sym_next) {
|
|
1346
|
+
flush_block_only(s, false);
|
|
1347
|
+
if (s.strm.avail_out === 0) return BS_NEED_MORE;
|
|
1348
|
+
}
|
|
1349
|
+
return BS_BLOCK_DONE;
|
|
1350
|
+
};
|
|
1351
|
+
var deflate_slow = (s, flush) => {
|
|
1352
|
+
let hash_head;
|
|
1353
|
+
let bflush;
|
|
1354
|
+
let max_insert;
|
|
1355
|
+
for (; ; ) {
|
|
1356
|
+
if (s.lookahead < MIN_LOOKAHEAD) {
|
|
1357
|
+
fill_window(s);
|
|
1358
|
+
if (s.lookahead < MIN_LOOKAHEAD && flush === 0) return BS_NEED_MORE;
|
|
1359
|
+
if (s.lookahead === 0) break;
|
|
1360
|
+
}
|
|
1361
|
+
hash_head = 0;
|
|
1362
|
+
if (s.lookahead >= MIN_MATCH) hash_head = INSERT_STRING(s, s.strstart);
|
|
1363
|
+
s.prev_length = s.match_length;
|
|
1364
|
+
s.prev_match = s.match_start;
|
|
1365
|
+
s.match_length = MIN_MATCH - 1;
|
|
1366
|
+
if (hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {
|
|
1367
|
+
s.match_length = longest_match(s, hash_head);
|
|
1368
|
+
if (s.match_length <= 5 && (s.strategy === 1 || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096)) s.match_length = MIN_MATCH - 1;
|
|
1369
|
+
}
|
|
1370
|
+
if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
|
|
1371
|
+
max_insert = s.strstart + s.lookahead - MIN_MATCH;
|
|
1372
|
+
bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
|
|
1373
|
+
s.lookahead -= s.prev_length - 1;
|
|
1374
|
+
s.prev_length -= 2;
|
|
1375
|
+
do
|
|
1376
|
+
if (++s.strstart <= max_insert) hash_head = INSERT_STRING(s, s.strstart);
|
|
1377
|
+
while (--s.prev_length !== 0);
|
|
1378
|
+
s.match_available = 0;
|
|
1379
|
+
s.match_length = MIN_MATCH - 1;
|
|
1380
|
+
s.strstart++;
|
|
1381
|
+
if (bflush) {
|
|
1382
|
+
flush_block_only(s, false);
|
|
1383
|
+
if (s.strm.avail_out === 0) return BS_NEED_MORE;
|
|
1384
|
+
}
|
|
1385
|
+
} else if (s.match_available) {
|
|
1386
|
+
bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);
|
|
1387
|
+
if (bflush)
|
|
1388
|
+
flush_block_only(s, false);
|
|
1389
|
+
s.strstart++;
|
|
1390
|
+
s.lookahead--;
|
|
1391
|
+
if (s.strm.avail_out === 0) return BS_NEED_MORE;
|
|
1392
|
+
} else {
|
|
1393
|
+
s.match_available = 1;
|
|
1394
|
+
s.strstart++;
|
|
1395
|
+
s.lookahead--;
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
if (s.match_available) {
|
|
1399
|
+
bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);
|
|
1400
|
+
s.match_available = 0;
|
|
1401
|
+
}
|
|
1402
|
+
s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
|
|
1403
|
+
if (flush === 4) {
|
|
1404
|
+
flush_block_only(s, true);
|
|
1405
|
+
if (s.strm.avail_out === 0) return BS_FINISH_STARTED;
|
|
1406
|
+
return BS_FINISH_DONE;
|
|
1407
|
+
}
|
|
1408
|
+
if (s.sym_next) {
|
|
1409
|
+
flush_block_only(s, false);
|
|
1410
|
+
if (s.strm.avail_out === 0) return BS_NEED_MORE;
|
|
1411
|
+
}
|
|
1412
|
+
return BS_BLOCK_DONE;
|
|
1413
|
+
};
|
|
1414
|
+
var deflate_rle = (s, flush) => {
|
|
1415
|
+
let bflush;
|
|
1416
|
+
let prev;
|
|
1417
|
+
let scan, strend;
|
|
1418
|
+
const _win = s.window;
|
|
1419
|
+
for (; ; ) {
|
|
1420
|
+
if (s.lookahead <= MAX_MATCH) {
|
|
1421
|
+
fill_window(s);
|
|
1422
|
+
if (s.lookahead <= MAX_MATCH && flush === 0) return BS_NEED_MORE;
|
|
1423
|
+
if (s.lookahead === 0) break;
|
|
1424
|
+
}
|
|
1425
|
+
s.match_length = 0;
|
|
1426
|
+
if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
|
|
1427
|
+
scan = s.strstart - 1;
|
|
1428
|
+
prev = _win[scan];
|
|
1429
|
+
if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
|
|
1430
|
+
strend = s.strstart + MAX_MATCH;
|
|
1431
|
+
do
|
|
1432
|
+
;
|
|
1433
|
+
while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);
|
|
1434
|
+
s.match_length = MAX_MATCH - (strend - scan);
|
|
1435
|
+
if (s.match_length > s.lookahead) s.match_length = s.lookahead;
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
if (s.match_length >= MIN_MATCH) {
|
|
1439
|
+
bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH);
|
|
1440
|
+
s.lookahead -= s.match_length;
|
|
1441
|
+
s.strstart += s.match_length;
|
|
1442
|
+
s.match_length = 0;
|
|
1443
|
+
} else {
|
|
1444
|
+
bflush = _tr_tally(s, 0, s.window[s.strstart]);
|
|
1445
|
+
s.lookahead--;
|
|
1446
|
+
s.strstart++;
|
|
1447
|
+
}
|
|
1448
|
+
if (bflush) {
|
|
1449
|
+
flush_block_only(s, false);
|
|
1450
|
+
if (s.strm.avail_out === 0) return BS_NEED_MORE;
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
s.insert = 0;
|
|
1454
|
+
if (flush === 4) {
|
|
1455
|
+
flush_block_only(s, true);
|
|
1456
|
+
if (s.strm.avail_out === 0) return BS_FINISH_STARTED;
|
|
1457
|
+
return BS_FINISH_DONE;
|
|
1458
|
+
}
|
|
1459
|
+
if (s.sym_next) {
|
|
1460
|
+
flush_block_only(s, false);
|
|
1461
|
+
if (s.strm.avail_out === 0) return BS_NEED_MORE;
|
|
1462
|
+
}
|
|
1463
|
+
return BS_BLOCK_DONE;
|
|
1464
|
+
};
|
|
1465
|
+
var deflate_huff = (s, flush) => {
|
|
1466
|
+
let bflush;
|
|
1467
|
+
for (; ; ) {
|
|
1468
|
+
if (s.lookahead === 0) {
|
|
1469
|
+
fill_window(s);
|
|
1470
|
+
if (s.lookahead === 0) {
|
|
1471
|
+
if (flush === 0) return BS_NEED_MORE;
|
|
1472
|
+
break;
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
s.match_length = 0;
|
|
1476
|
+
bflush = _tr_tally(s, 0, s.window[s.strstart]);
|
|
1477
|
+
s.lookahead--;
|
|
1478
|
+
s.strstart++;
|
|
1479
|
+
if (bflush) {
|
|
1480
|
+
flush_block_only(s, false);
|
|
1481
|
+
if (s.strm.avail_out === 0) return BS_NEED_MORE;
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
s.insert = 0;
|
|
1485
|
+
if (flush === 4) {
|
|
1486
|
+
flush_block_only(s, true);
|
|
1487
|
+
if (s.strm.avail_out === 0) return BS_FINISH_STARTED;
|
|
1488
|
+
return BS_FINISH_DONE;
|
|
1489
|
+
}
|
|
1490
|
+
if (s.sym_next) {
|
|
1491
|
+
flush_block_only(s, false);
|
|
1492
|
+
if (s.strm.avail_out === 0) return BS_NEED_MORE;
|
|
1493
|
+
}
|
|
1494
|
+
return BS_BLOCK_DONE;
|
|
1495
|
+
};
|
|
1496
|
+
var Config = class {
|
|
1497
|
+
constructor(good_length, max_lazy, nice_length, max_chain, func) {
|
|
1498
|
+
this.good_length = good_length;
|
|
1499
|
+
this.max_lazy = max_lazy;
|
|
1500
|
+
this.nice_length = nice_length;
|
|
1501
|
+
this.max_chain = max_chain;
|
|
1502
|
+
this.func = func;
|
|
1503
|
+
}
|
|
1504
|
+
};
|
|
1505
|
+
var configuration_table = [
|
|
1506
|
+
new Config(0, 0, 0, 0, deflate_stored),
|
|
1507
|
+
new Config(4, 4, 8, 4, deflate_fast),
|
|
1508
|
+
new Config(4, 5, 16, 8, deflate_fast),
|
|
1509
|
+
new Config(4, 6, 32, 32, deflate_fast),
|
|
1510
|
+
new Config(4, 4, 16, 16, deflate_slow),
|
|
1511
|
+
new Config(8, 16, 32, 32, deflate_slow),
|
|
1512
|
+
new Config(8, 16, 128, 128, deflate_slow),
|
|
1513
|
+
new Config(8, 32, 128, 256, deflate_slow),
|
|
1514
|
+
new Config(32, 128, 258, 1024, deflate_slow),
|
|
1515
|
+
new Config(32, 258, 258, 4096, deflate_slow)
|
|
1516
|
+
];
|
|
1517
|
+
var lm_init = (s) => {
|
|
1518
|
+
s.window_size = 2 * s.w_size;
|
|
1519
|
+
zero(s.head);
|
|
1520
|
+
s.max_lazy_match = configuration_table[s.level].max_lazy;
|
|
1521
|
+
s.good_match = configuration_table[s.level].good_length;
|
|
1522
|
+
s.nice_match = configuration_table[s.level].nice_length;
|
|
1523
|
+
s.max_chain_length = configuration_table[s.level].max_chain;
|
|
1524
|
+
s.strstart = 0;
|
|
1525
|
+
s.block_start = 0;
|
|
1526
|
+
s.lookahead = 0;
|
|
1527
|
+
s.insert = 0;
|
|
1528
|
+
s.match_length = s.prev_length = MIN_MATCH - 1;
|
|
1529
|
+
s.match_available = 0;
|
|
1530
|
+
s.ins_h = 0;
|
|
1531
|
+
};
|
|
1532
|
+
var DeflateState = class {
|
|
1533
|
+
constructor() {
|
|
1534
|
+
this.strm = null;
|
|
1535
|
+
this.status = 0;
|
|
1536
|
+
this.pending_buf = null;
|
|
1537
|
+
this.pending_buf_size = 0;
|
|
1538
|
+
this.pending_out = 0;
|
|
1539
|
+
this.pending = 0;
|
|
1540
|
+
this.wrap = 0;
|
|
1541
|
+
this.gzhead = null;
|
|
1542
|
+
this.gzindex = 0;
|
|
1543
|
+
this.method = 8;
|
|
1544
|
+
this.last_flush = -1;
|
|
1545
|
+
this.w_size = 0;
|
|
1546
|
+
this.w_bits = 0;
|
|
1547
|
+
this.w_mask = 0;
|
|
1548
|
+
this.window = null;
|
|
1549
|
+
this.window_size = 0;
|
|
1550
|
+
this.prev = null;
|
|
1551
|
+
this.head = null;
|
|
1552
|
+
this.ins_h = 0;
|
|
1553
|
+
this.legacy_hash = 0;
|
|
1554
|
+
this.hash_size = 0;
|
|
1555
|
+
this.hash_bits = 0;
|
|
1556
|
+
this.hash_mask = 0;
|
|
1557
|
+
this.hash_shift = 0;
|
|
1558
|
+
this.block_start = 0;
|
|
1559
|
+
this.match_length = 0;
|
|
1560
|
+
this.prev_match = 0;
|
|
1561
|
+
this.match_available = 0;
|
|
1562
|
+
this.strstart = 0;
|
|
1563
|
+
this.match_start = 0;
|
|
1564
|
+
this.lookahead = 0;
|
|
1565
|
+
this.prev_length = 0;
|
|
1566
|
+
this.max_chain_length = 0;
|
|
1567
|
+
this.max_lazy_match = 0;
|
|
1568
|
+
this.level = 0;
|
|
1569
|
+
this.strategy = 0;
|
|
1570
|
+
this.good_match = 0;
|
|
1571
|
+
this.nice_match = 0;
|
|
1572
|
+
this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2);
|
|
1573
|
+
this.dyn_dtree = /* @__PURE__ */ new Uint16Array(122);
|
|
1574
|
+
this.bl_tree = /* @__PURE__ */ new Uint16Array(78);
|
|
1575
|
+
zero(this.dyn_ltree);
|
|
1576
|
+
zero(this.dyn_dtree);
|
|
1577
|
+
zero(this.bl_tree);
|
|
1578
|
+
this.l_desc = null;
|
|
1579
|
+
this.d_desc = null;
|
|
1580
|
+
this.bl_desc = null;
|
|
1581
|
+
this.bl_count = /* @__PURE__ */ new Uint16Array(16);
|
|
1582
|
+
this.heap = /* @__PURE__ */ new Uint16Array(573);
|
|
1583
|
+
zero(this.heap);
|
|
1584
|
+
this.heap_len = 0;
|
|
1585
|
+
this.heap_max = 0;
|
|
1586
|
+
this.depth = /* @__PURE__ */ new Uint16Array(573);
|
|
1587
|
+
zero(this.depth);
|
|
1588
|
+
this.sym_buf = 0;
|
|
1589
|
+
this.lit_bufsize = 0;
|
|
1590
|
+
this.sym_next = 0;
|
|
1591
|
+
this.sym_end = 0;
|
|
1592
|
+
this.opt_len = 0;
|
|
1593
|
+
this.static_len = 0;
|
|
1594
|
+
this.matches = 0;
|
|
1595
|
+
this.insert = 0;
|
|
1596
|
+
this.bi_buf = 0;
|
|
1597
|
+
this.bi_valid = 0;
|
|
1598
|
+
}
|
|
1599
|
+
};
|
|
1600
|
+
var deflateStateCheck = (strm) => {
|
|
1601
|
+
if (!strm) return 1;
|
|
1602
|
+
const s = strm.state;
|
|
1603
|
+
if (!s || s.strm !== strm || s.status !== INIT_STATE && s.status !== GZIP_STATE && s.status !== EXTRA_STATE && s.status !== NAME_STATE && s.status !== COMMENT_STATE && s.status !== HCRC_STATE && s.status !== BUSY_STATE && s.status !== FINISH_STATE) return 1;
|
|
1604
|
+
return 0;
|
|
1605
|
+
};
|
|
1606
|
+
var deflateResetKeep = (strm) => {
|
|
1607
|
+
if (deflateStateCheck(strm)) return err(strm, -2);
|
|
1608
|
+
strm.total_in = strm.total_out = 0;
|
|
1609
|
+
strm.data_type = 2;
|
|
1610
|
+
const s = strm.state;
|
|
1611
|
+
s.pending = 0;
|
|
1612
|
+
s.pending_out = 0;
|
|
1613
|
+
if (s.wrap < 0) s.wrap = -s.wrap;
|
|
1614
|
+
s.status = s.wrap === 2 ? GZIP_STATE : s.wrap ? INIT_STATE : BUSY_STATE;
|
|
1615
|
+
strm.adler = s.wrap === 2 ? 0 : 1;
|
|
1616
|
+
s.last_flush = -2;
|
|
1617
|
+
_tr_init(s);
|
|
1618
|
+
return 0;
|
|
1619
|
+
};
|
|
1620
|
+
var deflateReset = (strm) => {
|
|
1621
|
+
const ret = deflateResetKeep(strm);
|
|
1622
|
+
if (ret === 0) lm_init(strm.state);
|
|
1623
|
+
return ret;
|
|
1624
|
+
};
|
|
1625
|
+
var deflateInit2 = (strm, level, method, windowBits, memLevel, strategy, legacyHash) => {
|
|
1626
|
+
if (!strm) return -2;
|
|
1627
|
+
let wrap = 1;
|
|
1628
|
+
if (level === -1) level = 6;
|
|
1629
|
+
if (windowBits < 0) {
|
|
1630
|
+
wrap = 0;
|
|
1631
|
+
windowBits = -windowBits;
|
|
1632
|
+
} else if (windowBits > 15) {
|
|
1633
|
+
wrap = 2;
|
|
1634
|
+
windowBits -= 16;
|
|
1635
|
+
}
|
|
1636
|
+
if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== 8 || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > 4 || windowBits === 8 && wrap !== 1) return err(strm, -2);
|
|
1637
|
+
if (windowBits === 8) windowBits = 9;
|
|
1638
|
+
const s = new DeflateState();
|
|
1639
|
+
strm.state = s;
|
|
1640
|
+
s.strm = strm;
|
|
1641
|
+
s.status = INIT_STATE;
|
|
1642
|
+
s.wrap = wrap;
|
|
1643
|
+
s.gzhead = null;
|
|
1644
|
+
s.w_bits = windowBits;
|
|
1645
|
+
s.w_size = 1 << s.w_bits;
|
|
1646
|
+
s.w_mask = s.w_size - 1;
|
|
1647
|
+
s.legacy_hash = legacyHash ? 1 : 0;
|
|
1648
|
+
s.hash_bits = memLevel + 7;
|
|
1649
|
+
if (!s.legacy_hash && s.hash_bits < 15) s.hash_bits = 15;
|
|
1650
|
+
s.hash_size = 1 << s.hash_bits;
|
|
1651
|
+
s.hash_mask = s.hash_size - 1;
|
|
1652
|
+
s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);
|
|
1653
|
+
s.window = new Uint8Array(s.w_size * 2);
|
|
1654
|
+
s.head = new Uint16Array(s.hash_size);
|
|
1655
|
+
s.prev = new Uint16Array(s.w_size);
|
|
1656
|
+
s.lit_bufsize = 1 << memLevel + 6;
|
|
1657
|
+
s.pending_buf_size = s.lit_bufsize * 4;
|
|
1658
|
+
s.pending_buf = new Uint8Array(s.pending_buf_size);
|
|
1659
|
+
s.sym_buf = s.lit_bufsize;
|
|
1660
|
+
s.sym_end = (s.lit_bufsize - 1) * 3;
|
|
1661
|
+
s.level = level;
|
|
1662
|
+
s.strategy = strategy;
|
|
1663
|
+
s.method = method;
|
|
1664
|
+
return deflateReset(strm);
|
|
1665
|
+
};
|
|
1666
|
+
var deflate$1 = (strm, flush) => {
|
|
1667
|
+
if (deflateStateCheck(strm) || flush > 5 || flush < 0) return strm ? err(strm, -2) : -2;
|
|
1668
|
+
const s = strm.state;
|
|
1669
|
+
if (!strm.output || strm.avail_in !== 0 && !strm.input || s.status === FINISH_STATE && flush !== 4) return err(strm, strm.avail_out === 0 ? -5 : -2);
|
|
1670
|
+
const old_flush = s.last_flush;
|
|
1671
|
+
s.last_flush = flush;
|
|
1672
|
+
if (s.pending !== 0) {
|
|
1673
|
+
flush_pending(strm);
|
|
1674
|
+
if (strm.avail_out === 0) {
|
|
1675
|
+
s.last_flush = -1;
|
|
1676
|
+
return 0;
|
|
1677
|
+
}
|
|
1678
|
+
} else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== 4) return err(strm, -5);
|
|
1679
|
+
if (s.status === FINISH_STATE && strm.avail_in !== 0) return err(strm, -5);
|
|
1680
|
+
if (s.status === INIT_STATE && s.wrap === 0) s.status = BUSY_STATE;
|
|
1681
|
+
if (s.status === INIT_STATE) {
|
|
1682
|
+
let header = 8 + (s.w_bits - 8 << 4) << 8;
|
|
1683
|
+
let level_flags = -1;
|
|
1684
|
+
if (s.strategy >= 2 || s.level < 2) level_flags = 0;
|
|
1685
|
+
else if (s.level < 6) level_flags = 1;
|
|
1686
|
+
else if (s.level === 6) level_flags = 2;
|
|
1687
|
+
else level_flags = 3;
|
|
1688
|
+
header |= level_flags << 6;
|
|
1689
|
+
if (s.strstart !== 0) header |= PRESET_DICT;
|
|
1690
|
+
header += 31 - header % 31;
|
|
1691
|
+
putShortMSB(s, header);
|
|
1692
|
+
if (s.strstart !== 0) {
|
|
1693
|
+
putShortMSB(s, strm.adler >>> 16);
|
|
1694
|
+
putShortMSB(s, strm.adler & 65535);
|
|
1695
|
+
}
|
|
1696
|
+
strm.adler = 1;
|
|
1697
|
+
s.status = BUSY_STATE;
|
|
1698
|
+
flush_pending(strm);
|
|
1699
|
+
if (s.pending !== 0) {
|
|
1700
|
+
s.last_flush = -1;
|
|
1701
|
+
return 0;
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
if (s.status === GZIP_STATE) {
|
|
1705
|
+
strm.adler = 0;
|
|
1706
|
+
put_byte(s, 31);
|
|
1707
|
+
put_byte(s, 139);
|
|
1708
|
+
put_byte(s, 8);
|
|
1709
|
+
if (!s.gzhead) {
|
|
1710
|
+
put_byte(s, 0);
|
|
1711
|
+
put_byte(s, 0);
|
|
1712
|
+
put_byte(s, 0);
|
|
1713
|
+
put_byte(s, 0);
|
|
1714
|
+
put_byte(s, 0);
|
|
1715
|
+
put_byte(s, s.level === 9 ? 2 : s.strategy >= 2 || s.level < 2 ? 4 : 0);
|
|
1716
|
+
put_byte(s, OS_CODE);
|
|
1717
|
+
s.status = BUSY_STATE;
|
|
1718
|
+
flush_pending(strm);
|
|
1719
|
+
if (s.pending !== 0) {
|
|
1720
|
+
s.last_flush = -1;
|
|
1721
|
+
return 0;
|
|
1722
|
+
}
|
|
1723
|
+
} else {
|
|
1724
|
+
put_byte(s, (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16));
|
|
1725
|
+
put_byte(s, s.gzhead.time & 255);
|
|
1726
|
+
put_byte(s, s.gzhead.time >> 8 & 255);
|
|
1727
|
+
put_byte(s, s.gzhead.time >> 16 & 255);
|
|
1728
|
+
put_byte(s, s.gzhead.time >> 24 & 255);
|
|
1729
|
+
put_byte(s, s.level === 9 ? 2 : s.strategy >= 2 || s.level < 2 ? 4 : 0);
|
|
1730
|
+
put_byte(s, s.gzhead.os & 255);
|
|
1731
|
+
if (s.gzhead.extra && s.gzhead.extra.length) {
|
|
1732
|
+
put_byte(s, s.gzhead.extra.length & 255);
|
|
1733
|
+
put_byte(s, s.gzhead.extra.length >> 8 & 255);
|
|
1734
|
+
}
|
|
1735
|
+
if (s.gzhead.hcrc) strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
|
|
1736
|
+
s.gzindex = 0;
|
|
1737
|
+
s.status = EXTRA_STATE;
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
if (s.status === EXTRA_STATE) {
|
|
1741
|
+
if (s.gzhead.extra) {
|
|
1742
|
+
let beg = s.pending;
|
|
1743
|
+
let left = (s.gzhead.extra.length & 65535) - s.gzindex;
|
|
1744
|
+
while (s.pending + left > s.pending_buf_size) {
|
|
1745
|
+
let copy2 = s.pending_buf_size - s.pending;
|
|
1746
|
+
s.pending_buf.set(s.gzhead.extra.subarray(s.gzindex, s.gzindex + copy2), s.pending);
|
|
1747
|
+
s.pending = s.pending_buf_size;
|
|
1748
|
+
if (s.gzhead.hcrc && s.pending > beg) strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
1749
|
+
s.gzindex += copy2;
|
|
1750
|
+
flush_pending(strm);
|
|
1751
|
+
if (s.pending !== 0) {
|
|
1752
|
+
s.last_flush = -1;
|
|
1753
|
+
return 0;
|
|
1754
|
+
}
|
|
1755
|
+
beg = 0;
|
|
1756
|
+
left -= copy2;
|
|
1757
|
+
}
|
|
1758
|
+
let gzhead_extra = new Uint8Array(s.gzhead.extra);
|
|
1759
|
+
s.pending_buf.set(gzhead_extra.subarray(s.gzindex, s.gzindex + left), s.pending);
|
|
1760
|
+
s.pending += left;
|
|
1761
|
+
if (s.gzhead.hcrc && s.pending > beg) strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
1762
|
+
s.gzindex = 0;
|
|
1763
|
+
}
|
|
1764
|
+
s.status = NAME_STATE;
|
|
1765
|
+
}
|
|
1766
|
+
if (s.status === NAME_STATE) {
|
|
1767
|
+
if (s.gzhead.name) {
|
|
1768
|
+
let beg = s.pending;
|
|
1769
|
+
let val;
|
|
1770
|
+
do {
|
|
1771
|
+
if (s.pending === s.pending_buf_size) {
|
|
1772
|
+
if (s.gzhead.hcrc && s.pending > beg) strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
1773
|
+
flush_pending(strm);
|
|
1774
|
+
if (s.pending !== 0) {
|
|
1775
|
+
s.last_flush = -1;
|
|
1776
|
+
return 0;
|
|
1777
|
+
}
|
|
1778
|
+
beg = 0;
|
|
1779
|
+
}
|
|
1780
|
+
if (s.gzindex < s.gzhead.name.length) val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;
|
|
1781
|
+
else val = 0;
|
|
1782
|
+
put_byte(s, val);
|
|
1783
|
+
} while (val !== 0);
|
|
1784
|
+
if (s.gzhead.hcrc && s.pending > beg) strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
1785
|
+
s.gzindex = 0;
|
|
1786
|
+
}
|
|
1787
|
+
s.status = COMMENT_STATE;
|
|
1788
|
+
}
|
|
1789
|
+
if (s.status === COMMENT_STATE) {
|
|
1790
|
+
if (s.gzhead.comment) {
|
|
1791
|
+
let beg = s.pending;
|
|
1792
|
+
let val;
|
|
1793
|
+
do {
|
|
1794
|
+
if (s.pending === s.pending_buf_size) {
|
|
1795
|
+
if (s.gzhead.hcrc && s.pending > beg) strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
1796
|
+
flush_pending(strm);
|
|
1797
|
+
if (s.pending !== 0) {
|
|
1798
|
+
s.last_flush = -1;
|
|
1799
|
+
return 0;
|
|
1800
|
+
}
|
|
1801
|
+
beg = 0;
|
|
1802
|
+
}
|
|
1803
|
+
if (s.gzindex < s.gzhead.comment.length) val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;
|
|
1804
|
+
else val = 0;
|
|
1805
|
+
put_byte(s, val);
|
|
1806
|
+
} while (val !== 0);
|
|
1807
|
+
if (s.gzhead.hcrc && s.pending > beg) strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
|
1808
|
+
}
|
|
1809
|
+
s.status = HCRC_STATE;
|
|
1810
|
+
}
|
|
1811
|
+
if (s.status === HCRC_STATE) {
|
|
1812
|
+
if (s.gzhead.hcrc) {
|
|
1813
|
+
if (s.pending + 2 > s.pending_buf_size) {
|
|
1814
|
+
flush_pending(strm);
|
|
1815
|
+
if (s.pending !== 0) {
|
|
1816
|
+
s.last_flush = -1;
|
|
1817
|
+
return 0;
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
put_byte(s, strm.adler & 255);
|
|
1821
|
+
put_byte(s, strm.adler >> 8 & 255);
|
|
1822
|
+
strm.adler = 0;
|
|
1823
|
+
}
|
|
1824
|
+
s.status = BUSY_STATE;
|
|
1825
|
+
flush_pending(strm);
|
|
1826
|
+
if (s.pending !== 0) {
|
|
1827
|
+
s.last_flush = -1;
|
|
1828
|
+
return 0;
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== 0 && s.status !== FINISH_STATE) {
|
|
1832
|
+
let bstate = s.level === 0 ? deflate_stored(s, flush) : s.strategy === 2 ? deflate_huff(s, flush) : s.strategy === 3 ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);
|
|
1833
|
+
if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) s.status = FINISH_STATE;
|
|
1834
|
+
if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
|
|
1835
|
+
if (strm.avail_out === 0) s.last_flush = -1;
|
|
1836
|
+
return 0;
|
|
1837
|
+
}
|
|
1838
|
+
if (bstate === BS_BLOCK_DONE) {
|
|
1839
|
+
if (flush === 1) _tr_align(s);
|
|
1840
|
+
else if (flush !== 5) {
|
|
1841
|
+
_tr_stored_block(s, 0, 0, false);
|
|
1842
|
+
if (flush === 3) {
|
|
1843
|
+
zero(s.head);
|
|
1844
|
+
if (s.lookahead === 0) {
|
|
1845
|
+
s.strstart = 0;
|
|
1846
|
+
s.block_start = 0;
|
|
1847
|
+
s.insert = 0;
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
flush_pending(strm);
|
|
1852
|
+
if (strm.avail_out === 0) {
|
|
1853
|
+
s.last_flush = -1;
|
|
1854
|
+
return 0;
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
if (flush !== 4) return 0;
|
|
1859
|
+
if (s.wrap <= 0) return 1;
|
|
1860
|
+
if (s.wrap === 2) {
|
|
1861
|
+
put_byte(s, strm.adler & 255);
|
|
1862
|
+
put_byte(s, strm.adler >> 8 & 255);
|
|
1863
|
+
put_byte(s, strm.adler >> 16 & 255);
|
|
1864
|
+
put_byte(s, strm.adler >> 24 & 255);
|
|
1865
|
+
put_byte(s, strm.total_in & 255);
|
|
1866
|
+
put_byte(s, strm.total_in >> 8 & 255);
|
|
1867
|
+
put_byte(s, strm.total_in >> 16 & 255);
|
|
1868
|
+
put_byte(s, strm.total_in >> 24 & 255);
|
|
1869
|
+
} else {
|
|
1870
|
+
putShortMSB(s, strm.adler >>> 16);
|
|
1871
|
+
putShortMSB(s, strm.adler & 65535);
|
|
1872
|
+
}
|
|
1873
|
+
flush_pending(strm);
|
|
1874
|
+
if (s.wrap > 0) s.wrap = -s.wrap;
|
|
1875
|
+
return s.pending !== 0 ? 0 : 1;
|
|
1876
|
+
};
|
|
1877
|
+
var deflateEnd = (strm) => {
|
|
1878
|
+
if (deflateStateCheck(strm)) return -2;
|
|
1879
|
+
const status = strm.state.status;
|
|
1880
|
+
strm.state = null;
|
|
1881
|
+
return status === BUSY_STATE ? err(strm, -3) : 0;
|
|
1882
|
+
};
|
|
1883
|
+
var deflateSetDictionary = (strm, dictionary) => {
|
|
1884
|
+
let dictLength = dictionary.length;
|
|
1885
|
+
if (deflateStateCheck(strm)) return -2;
|
|
1886
|
+
const s = strm.state;
|
|
1887
|
+
const wrap = s.wrap;
|
|
1888
|
+
if (wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead) return -2;
|
|
1889
|
+
if (wrap === 1) strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
|
|
1890
|
+
s.wrap = 0;
|
|
1891
|
+
if (dictLength >= s.w_size) {
|
|
1892
|
+
if (wrap === 0) {
|
|
1893
|
+
zero(s.head);
|
|
1894
|
+
s.strstart = 0;
|
|
1895
|
+
s.block_start = 0;
|
|
1896
|
+
s.insert = 0;
|
|
1897
|
+
}
|
|
1898
|
+
let tmpDict = new Uint8Array(s.w_size);
|
|
1899
|
+
tmpDict.set(dictionary.subarray(dictLength - s.w_size, dictLength), 0);
|
|
1900
|
+
dictionary = tmpDict;
|
|
1901
|
+
dictLength = s.w_size;
|
|
1902
|
+
}
|
|
1903
|
+
const avail = strm.avail_in;
|
|
1904
|
+
const next = strm.next_in;
|
|
1905
|
+
const input2 = strm.input;
|
|
1906
|
+
strm.avail_in = dictLength;
|
|
1907
|
+
strm.next_in = 0;
|
|
1908
|
+
strm.input = dictionary;
|
|
1909
|
+
fill_window(s);
|
|
1910
|
+
while (s.lookahead >= MIN_MATCH) {
|
|
1911
|
+
let str = s.strstart;
|
|
1912
|
+
let n = s.lookahead - (MIN_MATCH - 1);
|
|
1913
|
+
do {
|
|
1914
|
+
INSERT_STRING(s, str);
|
|
1915
|
+
str++;
|
|
1916
|
+
} while (--n);
|
|
1917
|
+
s.strstart = str;
|
|
1918
|
+
s.lookahead = MIN_MATCH - 1;
|
|
1919
|
+
fill_window(s);
|
|
1920
|
+
}
|
|
1921
|
+
s.strstart += s.lookahead;
|
|
1922
|
+
s.block_start = s.strstart;
|
|
1923
|
+
s.insert = s.lookahead;
|
|
1924
|
+
s.lookahead = 0;
|
|
1925
|
+
s.match_length = s.prev_length = MIN_MATCH - 1;
|
|
1926
|
+
s.match_available = 0;
|
|
1927
|
+
strm.next_in = next;
|
|
1928
|
+
strm.input = input2;
|
|
1929
|
+
strm.avail_in = avail;
|
|
1930
|
+
s.wrap = wrap;
|
|
1931
|
+
return 0;
|
|
1932
|
+
};
|
|
1933
|
+
var BAD$1 = 16209;
|
|
1934
|
+
var TYPE$1 = 16191;
|
|
1935
|
+
function inflate_fast(strm, start) {
|
|
1936
|
+
let _in;
|
|
1937
|
+
let last;
|
|
1938
|
+
let _out;
|
|
1939
|
+
let beg;
|
|
1940
|
+
let end;
|
|
1941
|
+
let dmax;
|
|
1942
|
+
let wsize;
|
|
1943
|
+
let whave;
|
|
1944
|
+
let wnext;
|
|
1945
|
+
let s_window;
|
|
1946
|
+
let hold;
|
|
1947
|
+
let bits;
|
|
1948
|
+
let lcode;
|
|
1949
|
+
let dcode;
|
|
1950
|
+
let lmask;
|
|
1951
|
+
let dmask;
|
|
1952
|
+
let here;
|
|
1953
|
+
let op;
|
|
1954
|
+
let len;
|
|
1955
|
+
let dist;
|
|
1956
|
+
let from;
|
|
1957
|
+
let from_source;
|
|
1958
|
+
let input2, output2;
|
|
1959
|
+
const state = strm.state;
|
|
1960
|
+
_in = strm.next_in;
|
|
1961
|
+
input2 = strm.input;
|
|
1962
|
+
last = _in + (strm.avail_in - 5);
|
|
1963
|
+
_out = strm.next_out;
|
|
1964
|
+
output2 = strm.output;
|
|
1965
|
+
beg = _out - (start - strm.avail_out);
|
|
1966
|
+
end = _out + (strm.avail_out - 257);
|
|
1967
|
+
dmax = state.dmax;
|
|
1968
|
+
wsize = state.wsize;
|
|
1969
|
+
whave = state.whave;
|
|
1970
|
+
wnext = state.wnext;
|
|
1971
|
+
s_window = state.window;
|
|
1972
|
+
hold = state.hold;
|
|
1973
|
+
bits = state.bits;
|
|
1974
|
+
lcode = state.lencode;
|
|
1975
|
+
dcode = state.distcode;
|
|
1976
|
+
lmask = (1 << state.lenbits) - 1;
|
|
1977
|
+
dmask = (1 << state.distbits) - 1;
|
|
1978
|
+
top: do {
|
|
1979
|
+
if (bits < 15) {
|
|
1980
|
+
hold += input2[_in++] << bits;
|
|
1981
|
+
bits += 8;
|
|
1982
|
+
hold += input2[_in++] << bits;
|
|
1983
|
+
bits += 8;
|
|
1984
|
+
}
|
|
1985
|
+
here = lcode[hold & lmask];
|
|
1986
|
+
dolen: for (; ; ) {
|
|
1987
|
+
op = here >>> 24;
|
|
1988
|
+
hold >>>= op;
|
|
1989
|
+
bits -= op;
|
|
1990
|
+
op = here >>> 16 & 255;
|
|
1991
|
+
if (op === 0) output2[_out++] = here & 65535;
|
|
1992
|
+
else if (op & 16) {
|
|
1993
|
+
len = here & 65535;
|
|
1994
|
+
op &= 15;
|
|
1995
|
+
if (op) {
|
|
1996
|
+
if (bits < op) {
|
|
1997
|
+
hold += input2[_in++] << bits;
|
|
1998
|
+
bits += 8;
|
|
1999
|
+
}
|
|
2000
|
+
len += hold & (1 << op) - 1;
|
|
2001
|
+
hold >>>= op;
|
|
2002
|
+
bits -= op;
|
|
2003
|
+
}
|
|
2004
|
+
if (bits < 15) {
|
|
2005
|
+
hold += input2[_in++] << bits;
|
|
2006
|
+
bits += 8;
|
|
2007
|
+
hold += input2[_in++] << bits;
|
|
2008
|
+
bits += 8;
|
|
2009
|
+
}
|
|
2010
|
+
here = dcode[hold & dmask];
|
|
2011
|
+
dodist: for (; ; ) {
|
|
2012
|
+
op = here >>> 24;
|
|
2013
|
+
hold >>>= op;
|
|
2014
|
+
bits -= op;
|
|
2015
|
+
op = here >>> 16 & 255;
|
|
2016
|
+
if (op & 16) {
|
|
2017
|
+
dist = here & 65535;
|
|
2018
|
+
op &= 15;
|
|
2019
|
+
if (bits < op) {
|
|
2020
|
+
hold += input2[_in++] << bits;
|
|
2021
|
+
bits += 8;
|
|
2022
|
+
if (bits < op) {
|
|
2023
|
+
hold += input2[_in++] << bits;
|
|
2024
|
+
bits += 8;
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
dist += hold & (1 << op) - 1;
|
|
2028
|
+
if (dist > dmax) {
|
|
2029
|
+
strm.msg = "invalid distance too far back";
|
|
2030
|
+
state.mode = BAD$1;
|
|
2031
|
+
break top;
|
|
2032
|
+
}
|
|
2033
|
+
hold >>>= op;
|
|
2034
|
+
bits -= op;
|
|
2035
|
+
op = _out - beg;
|
|
2036
|
+
if (dist > op) {
|
|
2037
|
+
op = dist - op;
|
|
2038
|
+
if (op > whave) {
|
|
2039
|
+
if (state.sane) {
|
|
2040
|
+
strm.msg = "invalid distance too far back";
|
|
2041
|
+
state.mode = BAD$1;
|
|
2042
|
+
break top;
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2045
|
+
from = 0;
|
|
2046
|
+
from_source = s_window;
|
|
2047
|
+
if (wnext === 0) {
|
|
2048
|
+
from += wsize - op;
|
|
2049
|
+
if (op < len) {
|
|
2050
|
+
len -= op;
|
|
2051
|
+
do
|
|
2052
|
+
output2[_out++] = s_window[from++];
|
|
2053
|
+
while (--op);
|
|
2054
|
+
from = _out - dist;
|
|
2055
|
+
from_source = output2;
|
|
2056
|
+
}
|
|
2057
|
+
} else if (wnext < op) {
|
|
2058
|
+
from += wsize + wnext - op;
|
|
2059
|
+
op -= wnext;
|
|
2060
|
+
if (op < len) {
|
|
2061
|
+
len -= op;
|
|
2062
|
+
do
|
|
2063
|
+
output2[_out++] = s_window[from++];
|
|
2064
|
+
while (--op);
|
|
2065
|
+
from = 0;
|
|
2066
|
+
if (wnext < len) {
|
|
2067
|
+
op = wnext;
|
|
2068
|
+
len -= op;
|
|
2069
|
+
do
|
|
2070
|
+
output2[_out++] = s_window[from++];
|
|
2071
|
+
while (--op);
|
|
2072
|
+
from = _out - dist;
|
|
2073
|
+
from_source = output2;
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
} else {
|
|
2077
|
+
from += wnext - op;
|
|
2078
|
+
if (op < len) {
|
|
2079
|
+
len -= op;
|
|
2080
|
+
do
|
|
2081
|
+
output2[_out++] = s_window[from++];
|
|
2082
|
+
while (--op);
|
|
2083
|
+
from = _out - dist;
|
|
2084
|
+
from_source = output2;
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
while (len > 2) {
|
|
2088
|
+
output2[_out++] = from_source[from++];
|
|
2089
|
+
output2[_out++] = from_source[from++];
|
|
2090
|
+
output2[_out++] = from_source[from++];
|
|
2091
|
+
len -= 3;
|
|
2092
|
+
}
|
|
2093
|
+
if (len) {
|
|
2094
|
+
output2[_out++] = from_source[from++];
|
|
2095
|
+
if (len > 1) output2[_out++] = from_source[from++];
|
|
2096
|
+
}
|
|
2097
|
+
} else {
|
|
2098
|
+
from = _out - dist;
|
|
2099
|
+
do {
|
|
2100
|
+
output2[_out++] = output2[from++];
|
|
2101
|
+
output2[_out++] = output2[from++];
|
|
2102
|
+
output2[_out++] = output2[from++];
|
|
2103
|
+
len -= 3;
|
|
2104
|
+
} while (len > 2);
|
|
2105
|
+
if (len) {
|
|
2106
|
+
output2[_out++] = output2[from++];
|
|
2107
|
+
if (len > 1) output2[_out++] = output2[from++];
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
} else if ((op & 64) === 0) {
|
|
2111
|
+
here = dcode[(here & 65535) + (hold & (1 << op) - 1)];
|
|
2112
|
+
continue dodist;
|
|
2113
|
+
} else {
|
|
2114
|
+
strm.msg = "invalid distance code";
|
|
2115
|
+
state.mode = BAD$1;
|
|
2116
|
+
break top;
|
|
2117
|
+
}
|
|
2118
|
+
break;
|
|
2119
|
+
}
|
|
2120
|
+
} else if ((op & 64) === 0) {
|
|
2121
|
+
here = lcode[(here & 65535) + (hold & (1 << op) - 1)];
|
|
2122
|
+
continue dolen;
|
|
2123
|
+
} else if (op & 32) {
|
|
2124
|
+
state.mode = TYPE$1;
|
|
2125
|
+
break top;
|
|
2126
|
+
} else {
|
|
2127
|
+
strm.msg = "invalid literal/length code";
|
|
2128
|
+
state.mode = BAD$1;
|
|
2129
|
+
break top;
|
|
2130
|
+
}
|
|
2131
|
+
break;
|
|
2132
|
+
}
|
|
2133
|
+
} while (_in < last && _out < end);
|
|
2134
|
+
len = bits >> 3;
|
|
2135
|
+
_in -= len;
|
|
2136
|
+
bits -= len << 3;
|
|
2137
|
+
hold &= (1 << bits) - 1;
|
|
2138
|
+
strm.next_in = _in;
|
|
2139
|
+
strm.next_out = _out;
|
|
2140
|
+
strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last);
|
|
2141
|
+
strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end);
|
|
2142
|
+
state.hold = hold;
|
|
2143
|
+
state.bits = bits;
|
|
2144
|
+
}
|
|
2145
|
+
var MAXBITS = 15;
|
|
2146
|
+
var ENOUGH_LENS$1 = 852;
|
|
2147
|
+
var ENOUGH_DISTS$1 = 592;
|
|
2148
|
+
var CODES$1 = 0;
|
|
2149
|
+
var LENS$1 = 1;
|
|
2150
|
+
var DISTS$1 = 2;
|
|
2151
|
+
var lbase = new Uint16Array([
|
|
2152
|
+
3,
|
|
2153
|
+
4,
|
|
2154
|
+
5,
|
|
2155
|
+
6,
|
|
2156
|
+
7,
|
|
2157
|
+
8,
|
|
2158
|
+
9,
|
|
2159
|
+
10,
|
|
2160
|
+
11,
|
|
2161
|
+
13,
|
|
2162
|
+
15,
|
|
2163
|
+
17,
|
|
2164
|
+
19,
|
|
2165
|
+
23,
|
|
2166
|
+
27,
|
|
2167
|
+
31,
|
|
2168
|
+
35,
|
|
2169
|
+
43,
|
|
2170
|
+
51,
|
|
2171
|
+
59,
|
|
2172
|
+
67,
|
|
2173
|
+
83,
|
|
2174
|
+
99,
|
|
2175
|
+
115,
|
|
2176
|
+
131,
|
|
2177
|
+
163,
|
|
2178
|
+
195,
|
|
2179
|
+
227,
|
|
2180
|
+
258,
|
|
2181
|
+
0,
|
|
2182
|
+
0
|
|
2183
|
+
]);
|
|
2184
|
+
var lext = new Uint8Array([
|
|
2185
|
+
16,
|
|
2186
|
+
16,
|
|
2187
|
+
16,
|
|
2188
|
+
16,
|
|
2189
|
+
16,
|
|
2190
|
+
16,
|
|
2191
|
+
16,
|
|
2192
|
+
16,
|
|
2193
|
+
17,
|
|
2194
|
+
17,
|
|
2195
|
+
17,
|
|
2196
|
+
17,
|
|
2197
|
+
18,
|
|
2198
|
+
18,
|
|
2199
|
+
18,
|
|
2200
|
+
18,
|
|
2201
|
+
19,
|
|
2202
|
+
19,
|
|
2203
|
+
19,
|
|
2204
|
+
19,
|
|
2205
|
+
20,
|
|
2206
|
+
20,
|
|
2207
|
+
20,
|
|
2208
|
+
20,
|
|
2209
|
+
21,
|
|
2210
|
+
21,
|
|
2211
|
+
21,
|
|
2212
|
+
21,
|
|
2213
|
+
16,
|
|
2214
|
+
199,
|
|
2215
|
+
75
|
|
2216
|
+
]);
|
|
2217
|
+
var dbase = new Uint16Array([
|
|
2218
|
+
1,
|
|
2219
|
+
2,
|
|
2220
|
+
3,
|
|
2221
|
+
4,
|
|
2222
|
+
5,
|
|
2223
|
+
7,
|
|
2224
|
+
9,
|
|
2225
|
+
13,
|
|
2226
|
+
17,
|
|
2227
|
+
25,
|
|
2228
|
+
33,
|
|
2229
|
+
49,
|
|
2230
|
+
65,
|
|
2231
|
+
97,
|
|
2232
|
+
129,
|
|
2233
|
+
193,
|
|
2234
|
+
257,
|
|
2235
|
+
385,
|
|
2236
|
+
513,
|
|
2237
|
+
769,
|
|
2238
|
+
1025,
|
|
2239
|
+
1537,
|
|
2240
|
+
2049,
|
|
2241
|
+
3073,
|
|
2242
|
+
4097,
|
|
2243
|
+
6145,
|
|
2244
|
+
8193,
|
|
2245
|
+
12289,
|
|
2246
|
+
16385,
|
|
2247
|
+
24577,
|
|
2248
|
+
0,
|
|
2249
|
+
0
|
|
2250
|
+
]);
|
|
2251
|
+
var dext = new Uint8Array([
|
|
2252
|
+
16,
|
|
2253
|
+
16,
|
|
2254
|
+
16,
|
|
2255
|
+
16,
|
|
2256
|
+
17,
|
|
2257
|
+
17,
|
|
2258
|
+
18,
|
|
2259
|
+
18,
|
|
2260
|
+
19,
|
|
2261
|
+
19,
|
|
2262
|
+
20,
|
|
2263
|
+
20,
|
|
2264
|
+
21,
|
|
2265
|
+
21,
|
|
2266
|
+
22,
|
|
2267
|
+
22,
|
|
2268
|
+
23,
|
|
2269
|
+
23,
|
|
2270
|
+
24,
|
|
2271
|
+
24,
|
|
2272
|
+
25,
|
|
2273
|
+
25,
|
|
2274
|
+
26,
|
|
2275
|
+
26,
|
|
2276
|
+
27,
|
|
2277
|
+
27,
|
|
2278
|
+
28,
|
|
2279
|
+
28,
|
|
2280
|
+
29,
|
|
2281
|
+
29,
|
|
2282
|
+
64,
|
|
2283
|
+
64
|
|
2284
|
+
]);
|
|
2285
|
+
var inflate_table = (type, lens, lens_index, codes, table, table_index, work, opts) => {
|
|
2286
|
+
const bits = opts.bits;
|
|
2287
|
+
let len = 0;
|
|
2288
|
+
let sym = 0;
|
|
2289
|
+
let min = 0, max = 0;
|
|
2290
|
+
let root = 0;
|
|
2291
|
+
let curr = 0;
|
|
2292
|
+
let drop = 0;
|
|
2293
|
+
let left = 0;
|
|
2294
|
+
let used = 0;
|
|
2295
|
+
let huff = 0;
|
|
2296
|
+
let incr;
|
|
2297
|
+
let fill;
|
|
2298
|
+
let low;
|
|
2299
|
+
let mask;
|
|
2300
|
+
let next;
|
|
2301
|
+
let base = null;
|
|
2302
|
+
let match;
|
|
2303
|
+
const count = /* @__PURE__ */ new Uint16Array(16);
|
|
2304
|
+
const offs = /* @__PURE__ */ new Uint16Array(16);
|
|
2305
|
+
let extra = null;
|
|
2306
|
+
let here_bits, here_op, here_val;
|
|
2307
|
+
for (len = 0; len <= MAXBITS; len++) count[len] = 0;
|
|
2308
|
+
for (sym = 0; sym < codes; sym++) count[lens[lens_index + sym]]++;
|
|
2309
|
+
root = bits;
|
|
2310
|
+
for (max = MAXBITS; max >= 1; max--) if (count[max] !== 0) break;
|
|
2311
|
+
if (root > max) root = max;
|
|
2312
|
+
if (max === 0) {
|
|
2313
|
+
table[table_index++] = 20971520;
|
|
2314
|
+
table[table_index++] = 20971520;
|
|
2315
|
+
opts.bits = 1;
|
|
2316
|
+
return 0;
|
|
2317
|
+
}
|
|
2318
|
+
for (min = 1; min < max; min++) if (count[min] !== 0) break;
|
|
2319
|
+
if (root < min) root = min;
|
|
2320
|
+
left = 1;
|
|
2321
|
+
for (len = 1; len <= MAXBITS; len++) {
|
|
2322
|
+
left <<= 1;
|
|
2323
|
+
left -= count[len];
|
|
2324
|
+
if (left < 0) return -1;
|
|
2325
|
+
}
|
|
2326
|
+
if (left > 0 && (type === CODES$1 || max !== 1)) return -1;
|
|
2327
|
+
offs[1] = 0;
|
|
2328
|
+
for (len = 1; len < MAXBITS; len++) offs[len + 1] = offs[len] + count[len];
|
|
2329
|
+
for (sym = 0; sym < codes; sym++) if (lens[lens_index + sym] !== 0) work[offs[lens[lens_index + sym]]++] = sym;
|
|
2330
|
+
if (type === CODES$1) {
|
|
2331
|
+
base = extra = work;
|
|
2332
|
+
match = 20;
|
|
2333
|
+
} else if (type === LENS$1) {
|
|
2334
|
+
base = lbase;
|
|
2335
|
+
extra = lext;
|
|
2336
|
+
match = 257;
|
|
2337
|
+
} else {
|
|
2338
|
+
base = dbase;
|
|
2339
|
+
extra = dext;
|
|
2340
|
+
match = 0;
|
|
2341
|
+
}
|
|
2342
|
+
huff = 0;
|
|
2343
|
+
sym = 0;
|
|
2344
|
+
len = min;
|
|
2345
|
+
next = table_index;
|
|
2346
|
+
curr = root;
|
|
2347
|
+
drop = 0;
|
|
2348
|
+
low = -1;
|
|
2349
|
+
used = 1 << root;
|
|
2350
|
+
mask = used - 1;
|
|
2351
|
+
if (type === LENS$1 && used > ENOUGH_LENS$1 || type === DISTS$1 && used > ENOUGH_DISTS$1) return 1;
|
|
2352
|
+
for (; ; ) {
|
|
2353
|
+
here_bits = len - drop;
|
|
2354
|
+
if (work[sym] + 1 < match) {
|
|
2355
|
+
here_op = 0;
|
|
2356
|
+
here_val = work[sym];
|
|
2357
|
+
} else if (work[sym] >= match) {
|
|
2358
|
+
here_op = extra[work[sym] - match];
|
|
2359
|
+
here_val = base[work[sym] - match];
|
|
2360
|
+
} else {
|
|
2361
|
+
here_op = 96;
|
|
2362
|
+
here_val = 0;
|
|
2363
|
+
}
|
|
2364
|
+
incr = 1 << len - drop;
|
|
2365
|
+
fill = 1 << curr;
|
|
2366
|
+
min = fill;
|
|
2367
|
+
do {
|
|
2368
|
+
fill -= incr;
|
|
2369
|
+
table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;
|
|
2370
|
+
} while (fill !== 0);
|
|
2371
|
+
incr = 1 << len - 1;
|
|
2372
|
+
while (huff & incr) incr >>= 1;
|
|
2373
|
+
if (incr !== 0) {
|
|
2374
|
+
huff &= incr - 1;
|
|
2375
|
+
huff += incr;
|
|
2376
|
+
} else huff = 0;
|
|
2377
|
+
sym++;
|
|
2378
|
+
if (--count[len] === 0) {
|
|
2379
|
+
if (len === max) break;
|
|
2380
|
+
len = lens[lens_index + work[sym]];
|
|
2381
|
+
}
|
|
2382
|
+
if (len > root && (huff & mask) !== low) {
|
|
2383
|
+
if (drop === 0) drop = root;
|
|
2384
|
+
next += min;
|
|
2385
|
+
curr = len - drop;
|
|
2386
|
+
left = 1 << curr;
|
|
2387
|
+
while (curr + drop < max) {
|
|
2388
|
+
left -= count[curr + drop];
|
|
2389
|
+
if (left <= 0) break;
|
|
2390
|
+
curr++;
|
|
2391
|
+
left <<= 1;
|
|
2392
|
+
}
|
|
2393
|
+
used += 1 << curr;
|
|
2394
|
+
if (type === LENS$1 && used > ENOUGH_LENS$1 || type === DISTS$1 && used > ENOUGH_DISTS$1) return 1;
|
|
2395
|
+
low = huff & mask;
|
|
2396
|
+
table[low] = root << 24 | curr << 16 | next - table_index | 0;
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
if (huff !== 0) table[next + huff] = len - drop << 24 | 4194304;
|
|
2400
|
+
opts.bits = root;
|
|
2401
|
+
return 0;
|
|
2402
|
+
};
|
|
2403
|
+
var CODES = 0;
|
|
2404
|
+
var LENS = 1;
|
|
2405
|
+
var DISTS = 2;
|
|
2406
|
+
var HEAD = 16180;
|
|
2407
|
+
var FLAGS = 16181;
|
|
2408
|
+
var TIME = 16182;
|
|
2409
|
+
var OS = 16183;
|
|
2410
|
+
var EXLEN = 16184;
|
|
2411
|
+
var EXTRA = 16185;
|
|
2412
|
+
var NAME = 16186;
|
|
2413
|
+
var COMMENT = 16187;
|
|
2414
|
+
var HCRC = 16188;
|
|
2415
|
+
var DICTID = 16189;
|
|
2416
|
+
var DICT = 16190;
|
|
2417
|
+
var TYPE = 16191;
|
|
2418
|
+
var TYPEDO = 16192;
|
|
2419
|
+
var STORED = 16193;
|
|
2420
|
+
var COPY_ = 16194;
|
|
2421
|
+
var COPY = 16195;
|
|
2422
|
+
var TABLE = 16196;
|
|
2423
|
+
var LENLENS = 16197;
|
|
2424
|
+
var CODELENS = 16198;
|
|
2425
|
+
var LEN_ = 16199;
|
|
2426
|
+
var LEN = 16200;
|
|
2427
|
+
var LENEXT = 16201;
|
|
2428
|
+
var DIST = 16202;
|
|
2429
|
+
var DISTEXT = 16203;
|
|
2430
|
+
var MATCH = 16204;
|
|
2431
|
+
var LIT = 16205;
|
|
2432
|
+
var CHECK = 16206;
|
|
2433
|
+
var LENGTH = 16207;
|
|
2434
|
+
var DONE = 16208;
|
|
2435
|
+
var BAD = 16209;
|
|
2436
|
+
var MEM = 16210;
|
|
2437
|
+
var SYNC = 16211;
|
|
2438
|
+
var ENOUGH_LENS = 852;
|
|
2439
|
+
var ENOUGH_DISTS = 592;
|
|
2440
|
+
var zswap32 = (q) => {
|
|
2441
|
+
return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);
|
|
2442
|
+
};
|
|
2443
|
+
var InflateState = class {
|
|
2444
|
+
constructor() {
|
|
2445
|
+
this.strm = null;
|
|
2446
|
+
this.mode = 0;
|
|
2447
|
+
this.last = false;
|
|
2448
|
+
this.wrap = 0;
|
|
2449
|
+
this.havedict = false;
|
|
2450
|
+
this.flags = 0;
|
|
2451
|
+
this.dmax = 0;
|
|
2452
|
+
this.check = 0;
|
|
2453
|
+
this.total = 0;
|
|
2454
|
+
this.head = null;
|
|
2455
|
+
this.wbits = 0;
|
|
2456
|
+
this.wsize = 0;
|
|
2457
|
+
this.whave = 0;
|
|
2458
|
+
this.wnext = 0;
|
|
2459
|
+
this.window = null;
|
|
2460
|
+
this.hold = 0;
|
|
2461
|
+
this.bits = 0;
|
|
2462
|
+
this.length = 0;
|
|
2463
|
+
this.offset = 0;
|
|
2464
|
+
this.extra = 0;
|
|
2465
|
+
this.lencode = null;
|
|
2466
|
+
this.distcode = null;
|
|
2467
|
+
this.lenbits = 0;
|
|
2468
|
+
this.distbits = 0;
|
|
2469
|
+
this.ncode = 0;
|
|
2470
|
+
this.nlen = 0;
|
|
2471
|
+
this.ndist = 0;
|
|
2472
|
+
this.have = 0;
|
|
2473
|
+
this.next = null;
|
|
2474
|
+
this.lens = /* @__PURE__ */ new Uint16Array(320);
|
|
2475
|
+
this.work = /* @__PURE__ */ new Uint16Array(288);
|
|
2476
|
+
this.lendyn = null;
|
|
2477
|
+
this.distdyn = null;
|
|
2478
|
+
this.sane = 0;
|
|
2479
|
+
this.back = 0;
|
|
2480
|
+
this.was = 0;
|
|
2481
|
+
}
|
|
2482
|
+
};
|
|
2483
|
+
var inflateStateCheck = (strm) => {
|
|
2484
|
+
if (!strm) return 1;
|
|
2485
|
+
const state = strm.state;
|
|
2486
|
+
if (!state || state.strm !== strm || state.mode < HEAD || state.mode > SYNC) return 1;
|
|
2487
|
+
return 0;
|
|
2488
|
+
};
|
|
2489
|
+
var inflateResetKeep = (strm) => {
|
|
2490
|
+
if (inflateStateCheck(strm)) return -2;
|
|
2491
|
+
const state = strm.state;
|
|
2492
|
+
strm.total_in = strm.total_out = state.total = 0;
|
|
2493
|
+
strm.msg = "";
|
|
2494
|
+
if (state.wrap) strm.adler = state.wrap & 1;
|
|
2495
|
+
state.mode = HEAD;
|
|
2496
|
+
state.last = 0;
|
|
2497
|
+
state.havedict = 0;
|
|
2498
|
+
state.flags = -1;
|
|
2499
|
+
state.dmax = 32768;
|
|
2500
|
+
state.head = null;
|
|
2501
|
+
state.hold = 0;
|
|
2502
|
+
state.bits = 0;
|
|
2503
|
+
state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS);
|
|
2504
|
+
state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS);
|
|
2505
|
+
state.sane = 1;
|
|
2506
|
+
state.back = -1;
|
|
2507
|
+
return 0;
|
|
2508
|
+
};
|
|
2509
|
+
var inflateReset = (strm) => {
|
|
2510
|
+
if (inflateStateCheck(strm)) return -2;
|
|
2511
|
+
const state = strm.state;
|
|
2512
|
+
state.wsize = 0;
|
|
2513
|
+
state.whave = 0;
|
|
2514
|
+
state.wnext = 0;
|
|
2515
|
+
return inflateResetKeep(strm);
|
|
2516
|
+
};
|
|
2517
|
+
var inflateReset2 = (strm, windowBits) => {
|
|
2518
|
+
let wrap;
|
|
2519
|
+
if (inflateStateCheck(strm)) return -2;
|
|
2520
|
+
const state = strm.state;
|
|
2521
|
+
if (windowBits < 0) {
|
|
2522
|
+
wrap = 0;
|
|
2523
|
+
windowBits = -windowBits;
|
|
2524
|
+
} else {
|
|
2525
|
+
wrap = (windowBits >> 4) + 5;
|
|
2526
|
+
if (windowBits < 48) windowBits &= 15;
|
|
2527
|
+
}
|
|
2528
|
+
if (windowBits && (windowBits < 8 || windowBits > 15)) return -2;
|
|
2529
|
+
if (state.window !== null && state.wbits !== windowBits) state.window = null;
|
|
2530
|
+
state.wrap = wrap;
|
|
2531
|
+
state.wbits = windowBits;
|
|
2532
|
+
return inflateReset(strm);
|
|
2533
|
+
};
|
|
2534
|
+
var inflateInit2 = (strm, windowBits) => {
|
|
2535
|
+
if (!strm) return -2;
|
|
2536
|
+
const state = new InflateState();
|
|
2537
|
+
strm.state = state;
|
|
2538
|
+
state.strm = strm;
|
|
2539
|
+
state.window = null;
|
|
2540
|
+
state.mode = HEAD;
|
|
2541
|
+
const ret = inflateReset2(strm, windowBits);
|
|
2542
|
+
if (ret !== 0) strm.state = null;
|
|
2543
|
+
return ret;
|
|
2544
|
+
};
|
|
2545
|
+
var virgin = true;
|
|
2546
|
+
var lenfix;
|
|
2547
|
+
var distfix;
|
|
2548
|
+
var fixedtables = (state) => {
|
|
2549
|
+
if (virgin) {
|
|
2550
|
+
lenfix = /* @__PURE__ */ new Int32Array(512);
|
|
2551
|
+
distfix = /* @__PURE__ */ new Int32Array(32);
|
|
2552
|
+
let sym = 0;
|
|
2553
|
+
while (sym < 144) state.lens[sym++] = 8;
|
|
2554
|
+
while (sym < 256) state.lens[sym++] = 9;
|
|
2555
|
+
while (sym < 280) state.lens[sym++] = 7;
|
|
2556
|
+
while (sym < 288) state.lens[sym++] = 8;
|
|
2557
|
+
inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
|
|
2558
|
+
sym = 0;
|
|
2559
|
+
while (sym < 32) state.lens[sym++] = 5;
|
|
2560
|
+
inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
|
|
2561
|
+
virgin = false;
|
|
2562
|
+
}
|
|
2563
|
+
state.lencode = lenfix;
|
|
2564
|
+
state.lenbits = 9;
|
|
2565
|
+
state.distcode = distfix;
|
|
2566
|
+
state.distbits = 5;
|
|
2567
|
+
};
|
|
2568
|
+
var updatewindow = (strm, src, end, copy2) => {
|
|
2569
|
+
let dist;
|
|
2570
|
+
const state = strm.state;
|
|
2571
|
+
if (state.window === null) state.window = new Uint8Array(1 << state.wbits);
|
|
2572
|
+
if (state.wsize === 0) {
|
|
2573
|
+
state.wsize = 1 << state.wbits;
|
|
2574
|
+
state.wnext = 0;
|
|
2575
|
+
state.whave = 0;
|
|
2576
|
+
}
|
|
2577
|
+
if (copy2 >= state.wsize) {
|
|
2578
|
+
state.window.set(src.subarray(end - state.wsize, end), 0);
|
|
2579
|
+
state.wnext = 0;
|
|
2580
|
+
state.whave = state.wsize;
|
|
2581
|
+
} else {
|
|
2582
|
+
dist = state.wsize - state.wnext;
|
|
2583
|
+
if (dist > copy2) dist = copy2;
|
|
2584
|
+
state.window.set(src.subarray(end - copy2, end - copy2 + dist), state.wnext);
|
|
2585
|
+
copy2 -= dist;
|
|
2586
|
+
if (copy2) {
|
|
2587
|
+
state.window.set(src.subarray(end - copy2, end), 0);
|
|
2588
|
+
state.wnext = copy2;
|
|
2589
|
+
state.whave = state.wsize;
|
|
2590
|
+
} else {
|
|
2591
|
+
state.wnext += dist;
|
|
2592
|
+
if (state.wnext === state.wsize) state.wnext = 0;
|
|
2593
|
+
if (state.whave < state.wsize) state.whave += dist;
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
return 0;
|
|
2597
|
+
};
|
|
2598
|
+
var inflate$1 = (strm, flush) => {
|
|
2599
|
+
let state;
|
|
2600
|
+
let input2, output2;
|
|
2601
|
+
let next;
|
|
2602
|
+
let put;
|
|
2603
|
+
let have, left;
|
|
2604
|
+
let hold;
|
|
2605
|
+
let bits;
|
|
2606
|
+
let _in, _out;
|
|
2607
|
+
let copy2;
|
|
2608
|
+
let from;
|
|
2609
|
+
let from_source;
|
|
2610
|
+
let here = 0;
|
|
2611
|
+
let here_bits, here_op, here_val;
|
|
2612
|
+
let last_bits, last_op, last_val;
|
|
2613
|
+
let len;
|
|
2614
|
+
let ret;
|
|
2615
|
+
const hbuf = /* @__PURE__ */ new Uint8Array(4);
|
|
2616
|
+
let opts;
|
|
2617
|
+
let n;
|
|
2618
|
+
const order = new Uint8Array([
|
|
2619
|
+
16,
|
|
2620
|
+
17,
|
|
2621
|
+
18,
|
|
2622
|
+
0,
|
|
2623
|
+
8,
|
|
2624
|
+
7,
|
|
2625
|
+
9,
|
|
2626
|
+
6,
|
|
2627
|
+
10,
|
|
2628
|
+
5,
|
|
2629
|
+
11,
|
|
2630
|
+
4,
|
|
2631
|
+
12,
|
|
2632
|
+
3,
|
|
2633
|
+
13,
|
|
2634
|
+
2,
|
|
2635
|
+
14,
|
|
2636
|
+
1,
|
|
2637
|
+
15
|
|
2638
|
+
]);
|
|
2639
|
+
if (inflateStateCheck(strm) || !strm.output || !strm.input && strm.avail_in !== 0) return -2;
|
|
2640
|
+
state = strm.state;
|
|
2641
|
+
if (state.mode === TYPE) state.mode = TYPEDO;
|
|
2642
|
+
put = strm.next_out;
|
|
2643
|
+
output2 = strm.output;
|
|
2644
|
+
left = strm.avail_out;
|
|
2645
|
+
next = strm.next_in;
|
|
2646
|
+
input2 = strm.input;
|
|
2647
|
+
have = strm.avail_in;
|
|
2648
|
+
hold = state.hold;
|
|
2649
|
+
bits = state.bits;
|
|
2650
|
+
_in = have;
|
|
2651
|
+
_out = left;
|
|
2652
|
+
ret = 0;
|
|
2653
|
+
inf_leave: for (; ; ) switch (state.mode) {
|
|
2654
|
+
case HEAD:
|
|
2655
|
+
if (state.wrap === 0) {
|
|
2656
|
+
state.mode = TYPEDO;
|
|
2657
|
+
break;
|
|
2658
|
+
}
|
|
2659
|
+
while (bits < 16) {
|
|
2660
|
+
if (have === 0) break inf_leave;
|
|
2661
|
+
have--;
|
|
2662
|
+
hold += input2[next++] << bits;
|
|
2663
|
+
bits += 8;
|
|
2664
|
+
}
|
|
2665
|
+
if (state.wrap & 2 && hold === 35615) {
|
|
2666
|
+
if (state.wbits === 0) state.wbits = 15;
|
|
2667
|
+
state.check = 0;
|
|
2668
|
+
hbuf[0] = hold & 255;
|
|
2669
|
+
hbuf[1] = hold >>> 8 & 255;
|
|
2670
|
+
state.check = crc32(state.check, hbuf, 2, 0);
|
|
2671
|
+
hold = 0;
|
|
2672
|
+
bits = 0;
|
|
2673
|
+
state.mode = FLAGS;
|
|
2674
|
+
break;
|
|
2675
|
+
}
|
|
2676
|
+
if (state.head) state.head.done = false;
|
|
2677
|
+
if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {
|
|
2678
|
+
strm.msg = "incorrect header check";
|
|
2679
|
+
state.mode = BAD;
|
|
2680
|
+
break;
|
|
2681
|
+
}
|
|
2682
|
+
if ((hold & 15) !== 8) {
|
|
2683
|
+
strm.msg = "unknown compression method";
|
|
2684
|
+
state.mode = BAD;
|
|
2685
|
+
break;
|
|
2686
|
+
}
|
|
2687
|
+
hold >>>= 4;
|
|
2688
|
+
bits -= 4;
|
|
2689
|
+
len = (hold & 15) + 8;
|
|
2690
|
+
if (state.wbits === 0) state.wbits = len;
|
|
2691
|
+
if (len > 15 || len > state.wbits) {
|
|
2692
|
+
strm.msg = "invalid window size";
|
|
2693
|
+
state.mode = BAD;
|
|
2694
|
+
break;
|
|
2695
|
+
}
|
|
2696
|
+
state.dmax = 1 << state.wbits;
|
|
2697
|
+
state.flags = 0;
|
|
2698
|
+
strm.adler = state.check = 1;
|
|
2699
|
+
state.mode = hold & 512 ? DICTID : TYPE;
|
|
2700
|
+
hold = 0;
|
|
2701
|
+
bits = 0;
|
|
2702
|
+
break;
|
|
2703
|
+
case FLAGS:
|
|
2704
|
+
while (bits < 16) {
|
|
2705
|
+
if (have === 0) break inf_leave;
|
|
2706
|
+
have--;
|
|
2707
|
+
hold += input2[next++] << bits;
|
|
2708
|
+
bits += 8;
|
|
2709
|
+
}
|
|
2710
|
+
state.flags = hold;
|
|
2711
|
+
if ((state.flags & 255) !== 8) {
|
|
2712
|
+
strm.msg = "unknown compression method";
|
|
2713
|
+
state.mode = BAD;
|
|
2714
|
+
break;
|
|
2715
|
+
}
|
|
2716
|
+
if (state.flags & 57344) {
|
|
2717
|
+
strm.msg = "unknown header flags set";
|
|
2718
|
+
state.mode = BAD;
|
|
2719
|
+
break;
|
|
2720
|
+
}
|
|
2721
|
+
if (state.head) state.head.text = hold >> 8 & 1;
|
|
2722
|
+
if (state.flags & 512 && state.wrap & 4) {
|
|
2723
|
+
hbuf[0] = hold & 255;
|
|
2724
|
+
hbuf[1] = hold >>> 8 & 255;
|
|
2725
|
+
state.check = crc32(state.check, hbuf, 2, 0);
|
|
2726
|
+
}
|
|
2727
|
+
hold = 0;
|
|
2728
|
+
bits = 0;
|
|
2729
|
+
state.mode = TIME;
|
|
2730
|
+
case TIME:
|
|
2731
|
+
while (bits < 32) {
|
|
2732
|
+
if (have === 0) break inf_leave;
|
|
2733
|
+
have--;
|
|
2734
|
+
hold += input2[next++] << bits;
|
|
2735
|
+
bits += 8;
|
|
2736
|
+
}
|
|
2737
|
+
if (state.head) state.head.time = hold;
|
|
2738
|
+
if (state.flags & 512 && state.wrap & 4) {
|
|
2739
|
+
hbuf[0] = hold & 255;
|
|
2740
|
+
hbuf[1] = hold >>> 8 & 255;
|
|
2741
|
+
hbuf[2] = hold >>> 16 & 255;
|
|
2742
|
+
hbuf[3] = hold >>> 24 & 255;
|
|
2743
|
+
state.check = crc32(state.check, hbuf, 4, 0);
|
|
2744
|
+
}
|
|
2745
|
+
hold = 0;
|
|
2746
|
+
bits = 0;
|
|
2747
|
+
state.mode = OS;
|
|
2748
|
+
case OS:
|
|
2749
|
+
while (bits < 16) {
|
|
2750
|
+
if (have === 0) break inf_leave;
|
|
2751
|
+
have--;
|
|
2752
|
+
hold += input2[next++] << bits;
|
|
2753
|
+
bits += 8;
|
|
2754
|
+
}
|
|
2755
|
+
if (state.head) {
|
|
2756
|
+
state.head.xflags = hold & 255;
|
|
2757
|
+
state.head.os = hold >> 8;
|
|
2758
|
+
}
|
|
2759
|
+
if (state.flags & 512 && state.wrap & 4) {
|
|
2760
|
+
hbuf[0] = hold & 255;
|
|
2761
|
+
hbuf[1] = hold >>> 8 & 255;
|
|
2762
|
+
state.check = crc32(state.check, hbuf, 2, 0);
|
|
2763
|
+
}
|
|
2764
|
+
hold = 0;
|
|
2765
|
+
bits = 0;
|
|
2766
|
+
state.mode = EXLEN;
|
|
2767
|
+
case EXLEN:
|
|
2768
|
+
if (state.flags & 1024) {
|
|
2769
|
+
while (bits < 16) {
|
|
2770
|
+
if (have === 0) break inf_leave;
|
|
2771
|
+
have--;
|
|
2772
|
+
hold += input2[next++] << bits;
|
|
2773
|
+
bits += 8;
|
|
2774
|
+
}
|
|
2775
|
+
state.length = hold;
|
|
2776
|
+
if (state.head) state.head.extra_len = hold;
|
|
2777
|
+
if (state.flags & 512 && state.wrap & 4) {
|
|
2778
|
+
hbuf[0] = hold & 255;
|
|
2779
|
+
hbuf[1] = hold >>> 8 & 255;
|
|
2780
|
+
state.check = crc32(state.check, hbuf, 2, 0);
|
|
2781
|
+
}
|
|
2782
|
+
hold = 0;
|
|
2783
|
+
bits = 0;
|
|
2784
|
+
} else if (state.head) state.head.extra = null;
|
|
2785
|
+
state.mode = EXTRA;
|
|
2786
|
+
case EXTRA:
|
|
2787
|
+
if (state.flags & 1024) {
|
|
2788
|
+
copy2 = state.length;
|
|
2789
|
+
if (copy2 > have) copy2 = have;
|
|
2790
|
+
if (copy2) {
|
|
2791
|
+
if (state.head) {
|
|
2792
|
+
len = state.head.extra_len - state.length;
|
|
2793
|
+
if (!state.head.extra) state.head.extra = new Uint8Array(state.head.extra_len);
|
|
2794
|
+
state.head.extra.set(input2.subarray(next, next + copy2), len);
|
|
2795
|
+
}
|
|
2796
|
+
if (state.flags & 512 && state.wrap & 4) state.check = crc32(state.check, input2, copy2, next);
|
|
2797
|
+
have -= copy2;
|
|
2798
|
+
next += copy2;
|
|
2799
|
+
state.length -= copy2;
|
|
2800
|
+
}
|
|
2801
|
+
if (state.length) break inf_leave;
|
|
2802
|
+
}
|
|
2803
|
+
state.length = 0;
|
|
2804
|
+
state.mode = NAME;
|
|
2805
|
+
case NAME:
|
|
2806
|
+
if (state.flags & 2048) {
|
|
2807
|
+
if (have === 0) break inf_leave;
|
|
2808
|
+
copy2 = 0;
|
|
2809
|
+
do {
|
|
2810
|
+
len = input2[next + copy2++];
|
|
2811
|
+
if (state.head && len && state.length < 65536) state.head.name += String.fromCharCode(len);
|
|
2812
|
+
} while (len && copy2 < have);
|
|
2813
|
+
if (state.flags & 512 && state.wrap & 4) state.check = crc32(state.check, input2, copy2, next);
|
|
2814
|
+
have -= copy2;
|
|
2815
|
+
next += copy2;
|
|
2816
|
+
if (len) break inf_leave;
|
|
2817
|
+
} else if (state.head) state.head.name = null;
|
|
2818
|
+
state.length = 0;
|
|
2819
|
+
state.mode = COMMENT;
|
|
2820
|
+
case COMMENT:
|
|
2821
|
+
if (state.flags & 4096) {
|
|
2822
|
+
if (have === 0) break inf_leave;
|
|
2823
|
+
copy2 = 0;
|
|
2824
|
+
do {
|
|
2825
|
+
len = input2[next + copy2++];
|
|
2826
|
+
if (state.head && len && state.length < 65536) state.head.comment += String.fromCharCode(len);
|
|
2827
|
+
} while (len && copy2 < have);
|
|
2828
|
+
if (state.flags & 512 && state.wrap & 4) state.check = crc32(state.check, input2, copy2, next);
|
|
2829
|
+
have -= copy2;
|
|
2830
|
+
next += copy2;
|
|
2831
|
+
if (len) break inf_leave;
|
|
2832
|
+
} else if (state.head) state.head.comment = null;
|
|
2833
|
+
state.mode = HCRC;
|
|
2834
|
+
case HCRC:
|
|
2835
|
+
if (state.flags & 512) {
|
|
2836
|
+
while (bits < 16) {
|
|
2837
|
+
if (have === 0) break inf_leave;
|
|
2838
|
+
have--;
|
|
2839
|
+
hold += input2[next++] << bits;
|
|
2840
|
+
bits += 8;
|
|
2841
|
+
}
|
|
2842
|
+
if (state.wrap & 4 && hold !== (state.check & 65535)) {
|
|
2843
|
+
strm.msg = "header crc mismatch";
|
|
2844
|
+
state.mode = BAD;
|
|
2845
|
+
break;
|
|
2846
|
+
}
|
|
2847
|
+
hold = 0;
|
|
2848
|
+
bits = 0;
|
|
2849
|
+
}
|
|
2850
|
+
if (state.head) {
|
|
2851
|
+
state.head.hcrc = state.flags >> 9 & 1;
|
|
2852
|
+
state.head.done = true;
|
|
2853
|
+
}
|
|
2854
|
+
strm.adler = state.check = 0;
|
|
2855
|
+
state.mode = TYPE;
|
|
2856
|
+
break;
|
|
2857
|
+
case DICTID:
|
|
2858
|
+
while (bits < 32) {
|
|
2859
|
+
if (have === 0) break inf_leave;
|
|
2860
|
+
have--;
|
|
2861
|
+
hold += input2[next++] << bits;
|
|
2862
|
+
bits += 8;
|
|
2863
|
+
}
|
|
2864
|
+
strm.adler = state.check = zswap32(hold);
|
|
2865
|
+
hold = 0;
|
|
2866
|
+
bits = 0;
|
|
2867
|
+
state.mode = DICT;
|
|
2868
|
+
case DICT:
|
|
2869
|
+
if (state.havedict === 0) {
|
|
2870
|
+
strm.next_out = put;
|
|
2871
|
+
strm.avail_out = left;
|
|
2872
|
+
strm.next_in = next;
|
|
2873
|
+
strm.avail_in = have;
|
|
2874
|
+
state.hold = hold;
|
|
2875
|
+
state.bits = bits;
|
|
2876
|
+
return 2;
|
|
2877
|
+
}
|
|
2878
|
+
strm.adler = state.check = 1;
|
|
2879
|
+
state.mode = TYPE;
|
|
2880
|
+
case TYPE:
|
|
2881
|
+
if (flush === 5 || flush === 6) break inf_leave;
|
|
2882
|
+
case TYPEDO:
|
|
2883
|
+
if (state.last) {
|
|
2884
|
+
hold >>>= bits & 7;
|
|
2885
|
+
bits -= bits & 7;
|
|
2886
|
+
state.mode = CHECK;
|
|
2887
|
+
break;
|
|
2888
|
+
}
|
|
2889
|
+
while (bits < 3) {
|
|
2890
|
+
if (have === 0) break inf_leave;
|
|
2891
|
+
have--;
|
|
2892
|
+
hold += input2[next++] << bits;
|
|
2893
|
+
bits += 8;
|
|
2894
|
+
}
|
|
2895
|
+
state.last = hold & 1;
|
|
2896
|
+
hold >>>= 1;
|
|
2897
|
+
bits -= 1;
|
|
2898
|
+
switch (hold & 3) {
|
|
2899
|
+
case 0:
|
|
2900
|
+
state.mode = STORED;
|
|
2901
|
+
break;
|
|
2902
|
+
case 1:
|
|
2903
|
+
fixedtables(state);
|
|
2904
|
+
state.mode = LEN_;
|
|
2905
|
+
if (flush === 6) {
|
|
2906
|
+
hold >>>= 2;
|
|
2907
|
+
bits -= 2;
|
|
2908
|
+
break inf_leave;
|
|
2909
|
+
}
|
|
2910
|
+
break;
|
|
2911
|
+
case 2:
|
|
2912
|
+
state.mode = TABLE;
|
|
2913
|
+
break;
|
|
2914
|
+
case 3:
|
|
2915
|
+
strm.msg = "invalid block type";
|
|
2916
|
+
state.mode = BAD;
|
|
2917
|
+
}
|
|
2918
|
+
hold >>>= 2;
|
|
2919
|
+
bits -= 2;
|
|
2920
|
+
break;
|
|
2921
|
+
case STORED:
|
|
2922
|
+
hold >>>= bits & 7;
|
|
2923
|
+
bits -= bits & 7;
|
|
2924
|
+
while (bits < 32) {
|
|
2925
|
+
if (have === 0) break inf_leave;
|
|
2926
|
+
have--;
|
|
2927
|
+
hold += input2[next++] << bits;
|
|
2928
|
+
bits += 8;
|
|
2929
|
+
}
|
|
2930
|
+
if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {
|
|
2931
|
+
strm.msg = "invalid stored block lengths";
|
|
2932
|
+
state.mode = BAD;
|
|
2933
|
+
break;
|
|
2934
|
+
}
|
|
2935
|
+
state.length = hold & 65535;
|
|
2936
|
+
hold = 0;
|
|
2937
|
+
bits = 0;
|
|
2938
|
+
state.mode = COPY_;
|
|
2939
|
+
if (flush === 6) break inf_leave;
|
|
2940
|
+
case COPY_:
|
|
2941
|
+
state.mode = COPY;
|
|
2942
|
+
case COPY:
|
|
2943
|
+
copy2 = state.length;
|
|
2944
|
+
if (copy2) {
|
|
2945
|
+
if (copy2 > have) copy2 = have;
|
|
2946
|
+
if (copy2 > left) copy2 = left;
|
|
2947
|
+
if (copy2 === 0) break inf_leave;
|
|
2948
|
+
output2.set(input2.subarray(next, next + copy2), put);
|
|
2949
|
+
have -= copy2;
|
|
2950
|
+
next += copy2;
|
|
2951
|
+
left -= copy2;
|
|
2952
|
+
put += copy2;
|
|
2953
|
+
state.length -= copy2;
|
|
2954
|
+
break;
|
|
2955
|
+
}
|
|
2956
|
+
state.mode = TYPE;
|
|
2957
|
+
break;
|
|
2958
|
+
case TABLE:
|
|
2959
|
+
while (bits < 14) {
|
|
2960
|
+
if (have === 0) break inf_leave;
|
|
2961
|
+
have--;
|
|
2962
|
+
hold += input2[next++] << bits;
|
|
2963
|
+
bits += 8;
|
|
2964
|
+
}
|
|
2965
|
+
state.nlen = (hold & 31) + 257;
|
|
2966
|
+
hold >>>= 5;
|
|
2967
|
+
bits -= 5;
|
|
2968
|
+
state.ndist = (hold & 31) + 1;
|
|
2969
|
+
hold >>>= 5;
|
|
2970
|
+
bits -= 5;
|
|
2971
|
+
state.ncode = (hold & 15) + 4;
|
|
2972
|
+
hold >>>= 4;
|
|
2973
|
+
bits -= 4;
|
|
2974
|
+
if (state.nlen > 286 || state.ndist > 30) {
|
|
2975
|
+
strm.msg = "too many length or distance symbols";
|
|
2976
|
+
state.mode = BAD;
|
|
2977
|
+
break;
|
|
2978
|
+
}
|
|
2979
|
+
state.have = 0;
|
|
2980
|
+
state.mode = LENLENS;
|
|
2981
|
+
case LENLENS:
|
|
2982
|
+
while (state.have < state.ncode) {
|
|
2983
|
+
while (bits < 3) {
|
|
2984
|
+
if (have === 0) break inf_leave;
|
|
2985
|
+
have--;
|
|
2986
|
+
hold += input2[next++] << bits;
|
|
2987
|
+
bits += 8;
|
|
2988
|
+
}
|
|
2989
|
+
state.lens[order[state.have++]] = hold & 7;
|
|
2990
|
+
hold >>>= 3;
|
|
2991
|
+
bits -= 3;
|
|
2992
|
+
}
|
|
2993
|
+
while (state.have < 19) state.lens[order[state.have++]] = 0;
|
|
2994
|
+
state.lencode = state.lendyn;
|
|
2995
|
+
state.lenbits = 7;
|
|
2996
|
+
opts = { bits: state.lenbits };
|
|
2997
|
+
ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
|
|
2998
|
+
state.lenbits = opts.bits;
|
|
2999
|
+
if (ret) {
|
|
3000
|
+
strm.msg = "invalid code lengths set";
|
|
3001
|
+
state.mode = BAD;
|
|
3002
|
+
break;
|
|
3003
|
+
}
|
|
3004
|
+
state.have = 0;
|
|
3005
|
+
state.mode = CODELENS;
|
|
3006
|
+
case CODELENS:
|
|
3007
|
+
while (state.have < state.nlen + state.ndist) {
|
|
3008
|
+
for (; ; ) {
|
|
3009
|
+
here = state.lencode[hold & (1 << state.lenbits) - 1];
|
|
3010
|
+
here_bits = here >>> 24;
|
|
3011
|
+
here_op = here >>> 16 & 255;
|
|
3012
|
+
here_val = here & 65535;
|
|
3013
|
+
if (here_bits <= bits) break;
|
|
3014
|
+
if (have === 0) break inf_leave;
|
|
3015
|
+
have--;
|
|
3016
|
+
hold += input2[next++] << bits;
|
|
3017
|
+
bits += 8;
|
|
3018
|
+
}
|
|
3019
|
+
if (here_val < 16) {
|
|
3020
|
+
hold >>>= here_bits;
|
|
3021
|
+
bits -= here_bits;
|
|
3022
|
+
state.lens[state.have++] = here_val;
|
|
3023
|
+
} else {
|
|
3024
|
+
if (here_val === 16) {
|
|
3025
|
+
n = here_bits + 2;
|
|
3026
|
+
while (bits < n) {
|
|
3027
|
+
if (have === 0) break inf_leave;
|
|
3028
|
+
have--;
|
|
3029
|
+
hold += input2[next++] << bits;
|
|
3030
|
+
bits += 8;
|
|
3031
|
+
}
|
|
3032
|
+
hold >>>= here_bits;
|
|
3033
|
+
bits -= here_bits;
|
|
3034
|
+
if (state.have === 0) {
|
|
3035
|
+
strm.msg = "invalid bit length repeat";
|
|
3036
|
+
state.mode = BAD;
|
|
3037
|
+
break;
|
|
3038
|
+
}
|
|
3039
|
+
len = state.lens[state.have - 1];
|
|
3040
|
+
copy2 = 3 + (hold & 3);
|
|
3041
|
+
hold >>>= 2;
|
|
3042
|
+
bits -= 2;
|
|
3043
|
+
} else if (here_val === 17) {
|
|
3044
|
+
n = here_bits + 3;
|
|
3045
|
+
while (bits < n) {
|
|
3046
|
+
if (have === 0) break inf_leave;
|
|
3047
|
+
have--;
|
|
3048
|
+
hold += input2[next++] << bits;
|
|
3049
|
+
bits += 8;
|
|
3050
|
+
}
|
|
3051
|
+
hold >>>= here_bits;
|
|
3052
|
+
bits -= here_bits;
|
|
3053
|
+
len = 0;
|
|
3054
|
+
copy2 = 3 + (hold & 7);
|
|
3055
|
+
hold >>>= 3;
|
|
3056
|
+
bits -= 3;
|
|
3057
|
+
} else {
|
|
3058
|
+
n = here_bits + 7;
|
|
3059
|
+
while (bits < n) {
|
|
3060
|
+
if (have === 0) break inf_leave;
|
|
3061
|
+
have--;
|
|
3062
|
+
hold += input2[next++] << bits;
|
|
3063
|
+
bits += 8;
|
|
3064
|
+
}
|
|
3065
|
+
hold >>>= here_bits;
|
|
3066
|
+
bits -= here_bits;
|
|
3067
|
+
len = 0;
|
|
3068
|
+
copy2 = 11 + (hold & 127);
|
|
3069
|
+
hold >>>= 7;
|
|
3070
|
+
bits -= 7;
|
|
3071
|
+
}
|
|
3072
|
+
if (state.have + copy2 > state.nlen + state.ndist) {
|
|
3073
|
+
strm.msg = "invalid bit length repeat";
|
|
3074
|
+
state.mode = BAD;
|
|
3075
|
+
break;
|
|
3076
|
+
}
|
|
3077
|
+
while (copy2--) state.lens[state.have++] = len;
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
if (state.mode === BAD) break;
|
|
3081
|
+
if (state.lens[256] === 0) {
|
|
3082
|
+
strm.msg = "invalid code -- missing end-of-block";
|
|
3083
|
+
state.mode = BAD;
|
|
3084
|
+
break;
|
|
3085
|
+
}
|
|
3086
|
+
state.lenbits = 9;
|
|
3087
|
+
opts = { bits: state.lenbits };
|
|
3088
|
+
ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
|
|
3089
|
+
state.lenbits = opts.bits;
|
|
3090
|
+
if (ret) {
|
|
3091
|
+
strm.msg = "invalid literal/lengths set";
|
|
3092
|
+
state.mode = BAD;
|
|
3093
|
+
break;
|
|
3094
|
+
}
|
|
3095
|
+
state.distbits = 6;
|
|
3096
|
+
state.distcode = state.distdyn;
|
|
3097
|
+
opts = { bits: state.distbits };
|
|
3098
|
+
ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
|
|
3099
|
+
state.distbits = opts.bits;
|
|
3100
|
+
if (ret) {
|
|
3101
|
+
strm.msg = "invalid distances set";
|
|
3102
|
+
state.mode = BAD;
|
|
3103
|
+
break;
|
|
3104
|
+
}
|
|
3105
|
+
state.mode = LEN_;
|
|
3106
|
+
if (flush === 6) break inf_leave;
|
|
3107
|
+
case LEN_:
|
|
3108
|
+
state.mode = LEN;
|
|
3109
|
+
case LEN:
|
|
3110
|
+
if (have >= 6 && left >= 258) {
|
|
3111
|
+
strm.next_out = put;
|
|
3112
|
+
strm.avail_out = left;
|
|
3113
|
+
strm.next_in = next;
|
|
3114
|
+
strm.avail_in = have;
|
|
3115
|
+
state.hold = hold;
|
|
3116
|
+
state.bits = bits;
|
|
3117
|
+
inflate_fast(strm, _out);
|
|
3118
|
+
put = strm.next_out;
|
|
3119
|
+
output2 = strm.output;
|
|
3120
|
+
left = strm.avail_out;
|
|
3121
|
+
next = strm.next_in;
|
|
3122
|
+
input2 = strm.input;
|
|
3123
|
+
have = strm.avail_in;
|
|
3124
|
+
hold = state.hold;
|
|
3125
|
+
bits = state.bits;
|
|
3126
|
+
if (state.mode === TYPE) state.back = -1;
|
|
3127
|
+
break;
|
|
3128
|
+
}
|
|
3129
|
+
state.back = 0;
|
|
3130
|
+
for (; ; ) {
|
|
3131
|
+
here = state.lencode[hold & (1 << state.lenbits) - 1];
|
|
3132
|
+
here_bits = here >>> 24;
|
|
3133
|
+
here_op = here >>> 16 & 255;
|
|
3134
|
+
here_val = here & 65535;
|
|
3135
|
+
if (here_bits <= bits) break;
|
|
3136
|
+
if (have === 0) break inf_leave;
|
|
3137
|
+
have--;
|
|
3138
|
+
hold += input2[next++] << bits;
|
|
3139
|
+
bits += 8;
|
|
3140
|
+
}
|
|
3141
|
+
if (here_op && (here_op & 240) === 0) {
|
|
3142
|
+
last_bits = here_bits;
|
|
3143
|
+
last_op = here_op;
|
|
3144
|
+
last_val = here_val;
|
|
3145
|
+
for (; ; ) {
|
|
3146
|
+
here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)];
|
|
3147
|
+
here_bits = here >>> 24;
|
|
3148
|
+
here_op = here >>> 16 & 255;
|
|
3149
|
+
here_val = here & 65535;
|
|
3150
|
+
if (last_bits + here_bits <= bits) break;
|
|
3151
|
+
if (have === 0) break inf_leave;
|
|
3152
|
+
have--;
|
|
3153
|
+
hold += input2[next++] << bits;
|
|
3154
|
+
bits += 8;
|
|
3155
|
+
}
|
|
3156
|
+
hold >>>= last_bits;
|
|
3157
|
+
bits -= last_bits;
|
|
3158
|
+
state.back += last_bits;
|
|
3159
|
+
}
|
|
3160
|
+
hold >>>= here_bits;
|
|
3161
|
+
bits -= here_bits;
|
|
3162
|
+
state.back += here_bits;
|
|
3163
|
+
state.length = here_val;
|
|
3164
|
+
if (here_op === 0) {
|
|
3165
|
+
state.mode = LIT;
|
|
3166
|
+
break;
|
|
3167
|
+
}
|
|
3168
|
+
if (here_op & 32) {
|
|
3169
|
+
state.back = -1;
|
|
3170
|
+
state.mode = TYPE;
|
|
3171
|
+
break;
|
|
3172
|
+
}
|
|
3173
|
+
if (here_op & 64) {
|
|
3174
|
+
strm.msg = "invalid literal/length code";
|
|
3175
|
+
state.mode = BAD;
|
|
3176
|
+
break;
|
|
3177
|
+
}
|
|
3178
|
+
state.extra = here_op & 15;
|
|
3179
|
+
state.mode = LENEXT;
|
|
3180
|
+
case LENEXT:
|
|
3181
|
+
if (state.extra) {
|
|
3182
|
+
n = state.extra;
|
|
3183
|
+
while (bits < n) {
|
|
3184
|
+
if (have === 0) break inf_leave;
|
|
3185
|
+
have--;
|
|
3186
|
+
hold += input2[next++] << bits;
|
|
3187
|
+
bits += 8;
|
|
3188
|
+
}
|
|
3189
|
+
state.length += hold & (1 << state.extra) - 1;
|
|
3190
|
+
hold >>>= state.extra;
|
|
3191
|
+
bits -= state.extra;
|
|
3192
|
+
state.back += state.extra;
|
|
3193
|
+
}
|
|
3194
|
+
state.was = state.length;
|
|
3195
|
+
state.mode = DIST;
|
|
3196
|
+
case DIST:
|
|
3197
|
+
for (; ; ) {
|
|
3198
|
+
here = state.distcode[hold & (1 << state.distbits) - 1];
|
|
3199
|
+
here_bits = here >>> 24;
|
|
3200
|
+
here_op = here >>> 16 & 255;
|
|
3201
|
+
here_val = here & 65535;
|
|
3202
|
+
if (here_bits <= bits) break;
|
|
3203
|
+
if (have === 0) break inf_leave;
|
|
3204
|
+
have--;
|
|
3205
|
+
hold += input2[next++] << bits;
|
|
3206
|
+
bits += 8;
|
|
3207
|
+
}
|
|
3208
|
+
if ((here_op & 240) === 0) {
|
|
3209
|
+
last_bits = here_bits;
|
|
3210
|
+
last_op = here_op;
|
|
3211
|
+
last_val = here_val;
|
|
3212
|
+
for (; ; ) {
|
|
3213
|
+
here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)];
|
|
3214
|
+
here_bits = here >>> 24;
|
|
3215
|
+
here_op = here >>> 16 & 255;
|
|
3216
|
+
here_val = here & 65535;
|
|
3217
|
+
if (last_bits + here_bits <= bits) break;
|
|
3218
|
+
if (have === 0) break inf_leave;
|
|
3219
|
+
have--;
|
|
3220
|
+
hold += input2[next++] << bits;
|
|
3221
|
+
bits += 8;
|
|
3222
|
+
}
|
|
3223
|
+
hold >>>= last_bits;
|
|
3224
|
+
bits -= last_bits;
|
|
3225
|
+
state.back += last_bits;
|
|
3226
|
+
}
|
|
3227
|
+
hold >>>= here_bits;
|
|
3228
|
+
bits -= here_bits;
|
|
3229
|
+
state.back += here_bits;
|
|
3230
|
+
if (here_op & 64) {
|
|
3231
|
+
strm.msg = "invalid distance code";
|
|
3232
|
+
state.mode = BAD;
|
|
3233
|
+
break;
|
|
3234
|
+
}
|
|
3235
|
+
state.offset = here_val;
|
|
3236
|
+
state.extra = here_op & 15;
|
|
3237
|
+
state.mode = DISTEXT;
|
|
3238
|
+
case DISTEXT:
|
|
3239
|
+
if (state.extra) {
|
|
3240
|
+
n = state.extra;
|
|
3241
|
+
while (bits < n) {
|
|
3242
|
+
if (have === 0) break inf_leave;
|
|
3243
|
+
have--;
|
|
3244
|
+
hold += input2[next++] << bits;
|
|
3245
|
+
bits += 8;
|
|
3246
|
+
}
|
|
3247
|
+
state.offset += hold & (1 << state.extra) - 1;
|
|
3248
|
+
hold >>>= state.extra;
|
|
3249
|
+
bits -= state.extra;
|
|
3250
|
+
state.back += state.extra;
|
|
3251
|
+
}
|
|
3252
|
+
if (state.offset > state.dmax) {
|
|
3253
|
+
strm.msg = "invalid distance too far back";
|
|
3254
|
+
state.mode = BAD;
|
|
3255
|
+
break;
|
|
3256
|
+
}
|
|
3257
|
+
state.mode = MATCH;
|
|
3258
|
+
case MATCH:
|
|
3259
|
+
if (left === 0) break inf_leave;
|
|
3260
|
+
copy2 = _out - left;
|
|
3261
|
+
if (state.offset > copy2) {
|
|
3262
|
+
copy2 = state.offset - copy2;
|
|
3263
|
+
if (copy2 > state.whave) {
|
|
3264
|
+
if (state.sane) {
|
|
3265
|
+
strm.msg = "invalid distance too far back";
|
|
3266
|
+
state.mode = BAD;
|
|
3267
|
+
break;
|
|
3268
|
+
}
|
|
3269
|
+
}
|
|
3270
|
+
if (copy2 > state.wnext) {
|
|
3271
|
+
copy2 -= state.wnext;
|
|
3272
|
+
from = state.wsize - copy2;
|
|
3273
|
+
} else from = state.wnext - copy2;
|
|
3274
|
+
if (copy2 > state.length) copy2 = state.length;
|
|
3275
|
+
from_source = state.window;
|
|
3276
|
+
} else {
|
|
3277
|
+
from_source = output2;
|
|
3278
|
+
from = put - state.offset;
|
|
3279
|
+
copy2 = state.length;
|
|
3280
|
+
}
|
|
3281
|
+
if (copy2 > left) copy2 = left;
|
|
3282
|
+
left -= copy2;
|
|
3283
|
+
state.length -= copy2;
|
|
3284
|
+
do
|
|
3285
|
+
output2[put++] = from_source[from++];
|
|
3286
|
+
while (--copy2);
|
|
3287
|
+
if (state.length === 0) state.mode = LEN;
|
|
3288
|
+
break;
|
|
3289
|
+
case LIT:
|
|
3290
|
+
if (left === 0) break inf_leave;
|
|
3291
|
+
output2[put++] = state.length;
|
|
3292
|
+
left--;
|
|
3293
|
+
state.mode = LEN;
|
|
3294
|
+
break;
|
|
3295
|
+
case CHECK:
|
|
3296
|
+
if (state.wrap) {
|
|
3297
|
+
while (bits < 32) {
|
|
3298
|
+
if (have === 0) break inf_leave;
|
|
3299
|
+
have--;
|
|
3300
|
+
hold |= input2[next++] << bits;
|
|
3301
|
+
bits += 8;
|
|
3302
|
+
}
|
|
3303
|
+
_out -= left;
|
|
3304
|
+
strm.total_out += _out;
|
|
3305
|
+
state.total += _out;
|
|
3306
|
+
if (state.wrap & 4 && _out) strm.adler = state.check = state.flags ? crc32(state.check, output2, _out, put - _out) : adler32(state.check, output2, _out, put - _out);
|
|
3307
|
+
_out = left;
|
|
3308
|
+
if (state.wrap & 4 && (state.flags ? hold : zswap32(hold)) !== state.check) {
|
|
3309
|
+
strm.msg = "incorrect data check";
|
|
3310
|
+
state.mode = BAD;
|
|
3311
|
+
break;
|
|
3312
|
+
}
|
|
3313
|
+
hold = 0;
|
|
3314
|
+
bits = 0;
|
|
3315
|
+
}
|
|
3316
|
+
state.mode = LENGTH;
|
|
3317
|
+
case LENGTH:
|
|
3318
|
+
if (state.wrap && state.flags) {
|
|
3319
|
+
while (bits < 32) {
|
|
3320
|
+
if (have === 0) break inf_leave;
|
|
3321
|
+
have--;
|
|
3322
|
+
hold += input2[next++] << bits;
|
|
3323
|
+
bits += 8;
|
|
3324
|
+
}
|
|
3325
|
+
if (state.wrap & 4 && hold !== (state.total & 4294967295)) {
|
|
3326
|
+
strm.msg = "incorrect length check";
|
|
3327
|
+
state.mode = BAD;
|
|
3328
|
+
break;
|
|
3329
|
+
}
|
|
3330
|
+
hold = 0;
|
|
3331
|
+
bits = 0;
|
|
3332
|
+
}
|
|
3333
|
+
state.mode = DONE;
|
|
3334
|
+
case DONE:
|
|
3335
|
+
ret = 1;
|
|
3336
|
+
break inf_leave;
|
|
3337
|
+
case BAD:
|
|
3338
|
+
ret = -3;
|
|
3339
|
+
break inf_leave;
|
|
3340
|
+
case MEM:
|
|
3341
|
+
return -4;
|
|
3342
|
+
case SYNC:
|
|
3343
|
+
default:
|
|
3344
|
+
return -2;
|
|
3345
|
+
}
|
|
3346
|
+
strm.next_out = put;
|
|
3347
|
+
strm.avail_out = left;
|
|
3348
|
+
strm.next_in = next;
|
|
3349
|
+
strm.avail_in = have;
|
|
3350
|
+
state.hold = hold;
|
|
3351
|
+
state.bits = bits;
|
|
3352
|
+
if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== 4)) {
|
|
3353
|
+
if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
|
|
3354
|
+
state.mode = MEM;
|
|
3355
|
+
return -4;
|
|
3356
|
+
}
|
|
3357
|
+
}
|
|
3358
|
+
_in -= strm.avail_in;
|
|
3359
|
+
_out -= strm.avail_out;
|
|
3360
|
+
strm.total_in += _in;
|
|
3361
|
+
strm.total_out += _out;
|
|
3362
|
+
state.total += _out;
|
|
3363
|
+
if (state.wrap & 4 && _out) strm.adler = state.check = state.flags ? crc32(state.check, output2, _out, strm.next_out - _out) : adler32(state.check, output2, _out, strm.next_out - _out);
|
|
3364
|
+
strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
|
|
3365
|
+
if ((_in === 0 && _out === 0 || flush === 4) && ret === 0) ret = -5;
|
|
3366
|
+
return ret;
|
|
3367
|
+
};
|
|
3368
|
+
var inflateEnd = (strm) => {
|
|
3369
|
+
if (inflateStateCheck(strm)) return -2;
|
|
3370
|
+
let state = strm.state;
|
|
3371
|
+
if (state.window) state.window = null;
|
|
3372
|
+
strm.state = null;
|
|
3373
|
+
return 0;
|
|
3374
|
+
};
|
|
3375
|
+
var inflateSetDictionary = (strm, dictionary) => {
|
|
3376
|
+
const dictLength = dictionary.length;
|
|
3377
|
+
let state;
|
|
3378
|
+
let dictid;
|
|
3379
|
+
let ret;
|
|
3380
|
+
if (inflateStateCheck(strm)) return -2;
|
|
3381
|
+
state = strm.state;
|
|
3382
|
+
if (state.wrap !== 0 && state.mode !== DICT) return -2;
|
|
3383
|
+
if (state.mode === DICT) {
|
|
3384
|
+
dictid = 1;
|
|
3385
|
+
dictid = adler32(dictid, dictionary, dictLength, 0);
|
|
3386
|
+
if (dictid !== state.check) return -3;
|
|
3387
|
+
}
|
|
3388
|
+
ret = updatewindow(strm, dictionary, dictLength, dictLength);
|
|
3389
|
+
if (ret) {
|
|
3390
|
+
state.mode = MEM;
|
|
3391
|
+
return -4;
|
|
3392
|
+
}
|
|
3393
|
+
state.havedict = 1;
|
|
3394
|
+
return 0;
|
|
3395
|
+
};
|
|
3396
|
+
var ZStream = class {
|
|
3397
|
+
constructor() {
|
|
3398
|
+
this.input = null;
|
|
3399
|
+
this.next_in = 0;
|
|
3400
|
+
this.avail_in = 0;
|
|
3401
|
+
this.total_in = 0;
|
|
3402
|
+
this.output = null;
|
|
3403
|
+
this.next_out = 0;
|
|
3404
|
+
this.avail_out = 0;
|
|
3405
|
+
this.total_out = 0;
|
|
3406
|
+
this.msg = "";
|
|
3407
|
+
this.state = null;
|
|
3408
|
+
this.data_type = 2;
|
|
3409
|
+
this.adler = 0;
|
|
3410
|
+
}
|
|
3411
|
+
};
|
|
3412
|
+
var flattenChunks = (chunks) => {
|
|
3413
|
+
const result = new Uint8Array(chunks.reduce((len, chunk) => len + chunk.length, 0));
|
|
3414
|
+
let pos = 0;
|
|
3415
|
+
for (const chunk of chunks) {
|
|
3416
|
+
result.set(chunk, pos);
|
|
3417
|
+
pos += chunk.length;
|
|
3418
|
+
}
|
|
3419
|
+
return result;
|
|
3420
|
+
};
|
|
3421
|
+
var toString$1 = Object.prototype.toString;
|
|
3422
|
+
var defaultOptions$1 = {
|
|
3423
|
+
level: -1,
|
|
3424
|
+
chunkSize: 16384,
|
|
3425
|
+
windowBits: 15,
|
|
3426
|
+
memLevel: 8,
|
|
3427
|
+
strategy: 0,
|
|
3428
|
+
raw: false,
|
|
3429
|
+
gzip: false,
|
|
3430
|
+
legacyHash: false,
|
|
3431
|
+
dictionary: /* @__PURE__ */ new Uint8Array(0)
|
|
3432
|
+
};
|
|
3433
|
+
var Deflate = class {
|
|
3434
|
+
options;
|
|
3435
|
+
/**
|
|
3436
|
+
* Error code after deflate finishes. {@link Z_OK} on success.
|
|
3437
|
+
* You will not need it in real life, because deflate errors
|
|
3438
|
+
* are possible only on wrong options or bad custom `onData` / `onEnd`
|
|
3439
|
+
* handlers.
|
|
3440
|
+
*/
|
|
3441
|
+
err;
|
|
3442
|
+
/** Error message, if {@link Deflate.err} is not {@link Z_OK}. */
|
|
3443
|
+
msg;
|
|
3444
|
+
ended;
|
|
3445
|
+
started;
|
|
3446
|
+
/**
|
|
3447
|
+
* Chunks of output data, if {@link Deflate.onData} not overridden.
|
|
3448
|
+
* @internal
|
|
3449
|
+
*/
|
|
3450
|
+
chunks;
|
|
3451
|
+
strm;
|
|
3452
|
+
/**
|
|
3453
|
+
* Compressed result, generated by default {@link Deflate.onData}
|
|
3454
|
+
* and {@link Deflate.onEnd} handlers. Filled after you push last chunk
|
|
3455
|
+
* (call {@link Deflate.push} with {@link Z_FINISH} / `true` param).
|
|
3456
|
+
*/
|
|
3457
|
+
result;
|
|
3458
|
+
/**
|
|
3459
|
+
* Creates a new deflator instance with the specified params. Throws an
|
|
3460
|
+
* exception on bad params. See {@link DeflateOptions} for the list of
|
|
3461
|
+
* supported options.
|
|
3462
|
+
*
|
|
3463
|
+
* @example
|
|
3464
|
+
* ```javascript
|
|
3465
|
+
* import { Deflate } from 'pako'
|
|
3466
|
+
*
|
|
3467
|
+
* const chunk1 = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9])
|
|
3468
|
+
* const chunk2 = new Uint8Array([10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
|
|
3469
|
+
*
|
|
3470
|
+
* const deflate = new Deflate({ level: 3 })
|
|
3471
|
+
*
|
|
3472
|
+
* deflate.push(chunk1, false)
|
|
3473
|
+
* deflate.push(chunk2, true) // true -> last chunk
|
|
3474
|
+
*
|
|
3475
|
+
* if (deflate.err) throw new Error(deflate.err)
|
|
3476
|
+
*
|
|
3477
|
+
* console.log(deflate.result)
|
|
3478
|
+
* ```
|
|
3479
|
+
*/
|
|
3480
|
+
constructor(options2 = {}) {
|
|
3481
|
+
this.options = Object.assign({}, defaultOptions$1, options2);
|
|
3482
|
+
const opt = this.options;
|
|
3483
|
+
if (opt.raw && opt.windowBits > 0) opt.windowBits = -opt.windowBits;
|
|
3484
|
+
else if (opt.gzip && opt.windowBits > 0 && opt.windowBits < 16) opt.windowBits += 16;
|
|
3485
|
+
this.err = 0;
|
|
3486
|
+
this.msg = "";
|
|
3487
|
+
this.ended = false;
|
|
3488
|
+
this.started = false;
|
|
3489
|
+
this.chunks = [];
|
|
3490
|
+
this.result = /* @__PURE__ */ new Uint8Array(0);
|
|
3491
|
+
this.strm = new ZStream();
|
|
3492
|
+
this.strm.avail_out = 0;
|
|
3493
|
+
let status = deflateInit2(this.strm, opt.level, 8, opt.windowBits, opt.memLevel, opt.strategy, opt.legacyHash);
|
|
3494
|
+
if (status !== 0) throw new Error(messages_default[status]);
|
|
3495
|
+
if (toString$1.call(opt.dictionary) === "[object ArrayBuffer]") opt.dictionary = new Uint8Array(opt.dictionary);
|
|
3496
|
+
const dictionary = opt.dictionary;
|
|
3497
|
+
if (dictionary.length) {
|
|
3498
|
+
if (opt.gzip) throw new Error("dictionary is not supported with gzip");
|
|
3499
|
+
status = deflateSetDictionary(this.strm, dictionary);
|
|
3500
|
+
if (status !== 0) throw new Error(messages_default[status]);
|
|
3501
|
+
}
|
|
3502
|
+
}
|
|
3503
|
+
/**
|
|
3504
|
+
* Sends input data to the deflate pipe, generating {@link Deflate.onData} calls
|
|
3505
|
+
* with new compressed chunks. Returns `true` on success. The last data block must
|
|
3506
|
+
* have `flush_mode` {@link Z_FINISH} (or `true`). That will flush the internal
|
|
3507
|
+
* pending buffers and call {@link Deflate.onEnd}.
|
|
3508
|
+
*
|
|
3509
|
+
* On failure, calls {@link Deflate.onEnd} with the error code and returns false.
|
|
3510
|
+
*
|
|
3511
|
+
* @param data input data. Strings will be converted to utf8 byte sequence.
|
|
3512
|
+
* @param flush_mode 0..6 for corresponding {@link Z_NO_FLUSH}..{@link Z_TREES} modes.
|
|
3513
|
+
* See constants. Skipped or `false` means {@link Z_NO_FLUSH}, `true` means {@link Z_FINISH}.
|
|
3514
|
+
*
|
|
3515
|
+
* @example
|
|
3516
|
+
* ```javascript
|
|
3517
|
+
* push(chunk, false) // push one of data chunks
|
|
3518
|
+
* ...
|
|
3519
|
+
* push(chunk, true) // push last chunk
|
|
3520
|
+
* ```
|
|
3521
|
+
*/
|
|
3522
|
+
push(data, flush_mode = false) {
|
|
3523
|
+
const strm = this.strm;
|
|
3524
|
+
const chunkSize = this.options.chunkSize;
|
|
3525
|
+
let status;
|
|
3526
|
+
let _flush_mode;
|
|
3527
|
+
if (this.ended) return false;
|
|
3528
|
+
if (typeof flush_mode === "number") _flush_mode = flush_mode;
|
|
3529
|
+
else _flush_mode = flush_mode === true ? 4 : 0;
|
|
3530
|
+
if (typeof data === "string") strm.input = new TextEncoder().encode(data);
|
|
3531
|
+
else if (toString$1.call(data) === "[object ArrayBuffer]") strm.input = new Uint8Array(data);
|
|
3532
|
+
else strm.input = data;
|
|
3533
|
+
strm.next_in = 0;
|
|
3534
|
+
strm.avail_in = strm.input.length;
|
|
3535
|
+
if (!this.started) {
|
|
3536
|
+
this.started = true;
|
|
3537
|
+
this.onStart(strm);
|
|
3538
|
+
}
|
|
3539
|
+
for (; ; ) {
|
|
3540
|
+
if (strm.avail_out === 0) {
|
|
3541
|
+
strm.output = new Uint8Array(chunkSize);
|
|
3542
|
+
strm.next_out = 0;
|
|
3543
|
+
strm.avail_out = chunkSize;
|
|
3544
|
+
}
|
|
3545
|
+
if ((_flush_mode === 2 || _flush_mode === 3) && strm.avail_out <= 6) {
|
|
3546
|
+
this.onData(strm.output.subarray(0, strm.next_out));
|
|
3547
|
+
strm.avail_out = 0;
|
|
3548
|
+
continue;
|
|
3549
|
+
}
|
|
3550
|
+
status = deflate$1(strm, _flush_mode);
|
|
3551
|
+
if (status === -2) break;
|
|
3552
|
+
if (status === 1) {
|
|
3553
|
+
if (strm.next_out > 0) this.onData(strm.output.subarray(0, strm.next_out));
|
|
3554
|
+
status = deflateEnd(this.strm);
|
|
3555
|
+
break;
|
|
3556
|
+
}
|
|
3557
|
+
if (strm.avail_out === 0) {
|
|
3558
|
+
this.onData(strm.output);
|
|
3559
|
+
continue;
|
|
3560
|
+
}
|
|
3561
|
+
if (_flush_mode > 0 && strm.next_out > 0) {
|
|
3562
|
+
this.onData(strm.output.subarray(0, strm.next_out));
|
|
3563
|
+
strm.avail_out = 0;
|
|
3564
|
+
continue;
|
|
3565
|
+
}
|
|
3566
|
+
if (strm.avail_in === 0) return true;
|
|
3567
|
+
}
|
|
3568
|
+
this.err = status;
|
|
3569
|
+
this.msg = strm.msg || messages_default[status];
|
|
3570
|
+
this.ended = true;
|
|
3571
|
+
this.onEnd(status);
|
|
3572
|
+
return status === 0;
|
|
3573
|
+
}
|
|
3574
|
+
/**
|
|
3575
|
+
* Called once before the first low-level deflate call.
|
|
3576
|
+
*/
|
|
3577
|
+
onStart(strm) {
|
|
3578
|
+
}
|
|
3579
|
+
/**
|
|
3580
|
+
* By default, stores data blocks in the {@link Deflate.chunks} property and glues
|
|
3581
|
+
* them in {@link Deflate.onEnd}. Override this handler if you need another behaviour.
|
|
3582
|
+
*/
|
|
3583
|
+
onData(chunk) {
|
|
3584
|
+
this.chunks.push(chunk);
|
|
3585
|
+
}
|
|
3586
|
+
/**
|
|
3587
|
+
* Called once after you tell deflate that the input stream is
|
|
3588
|
+
* complete ({@link Z_FINISH}). By default, joins the collected {@link Deflate.chunks}
|
|
3589
|
+
* into the {@link Deflate.result} property.
|
|
3590
|
+
*
|
|
3591
|
+
* @param status deflate status. {@link Z_OK} on success, other if not.
|
|
3592
|
+
*/
|
|
3593
|
+
onEnd(status) {
|
|
3594
|
+
if (status === 0) this.result = flattenChunks(this.chunks);
|
|
3595
|
+
this.chunks = [];
|
|
3596
|
+
}
|
|
3597
|
+
};
|
|
3598
|
+
function deflate(input2, options2 = {}) {
|
|
3599
|
+
const deflator = new Deflate(options2);
|
|
3600
|
+
deflator.push(input2, true);
|
|
3601
|
+
if (deflator.err) throw new Error(deflator.msg);
|
|
3602
|
+
return deflator.result;
|
|
3603
|
+
}
|
|
3604
|
+
function gzip(input2, options2 = {}) {
|
|
3605
|
+
return deflate(input2, Object.assign({}, options2, { gzip: true }));
|
|
3606
|
+
}
|
|
3607
|
+
var toString = Object.prototype.toString;
|
|
3608
|
+
var defaultOptions = {
|
|
3609
|
+
chunkSize: 1024 * 64,
|
|
3610
|
+
windowBits: 15,
|
|
3611
|
+
raw: false,
|
|
3612
|
+
dictionary: /* @__PURE__ */ new Uint8Array(0)
|
|
3613
|
+
};
|
|
3614
|
+
var Inflate = class {
|
|
3615
|
+
options;
|
|
3616
|
+
/**
|
|
3617
|
+
* Error code after inflate finishes. {@link Z_OK} on success.
|
|
3618
|
+
* Should be checked when broken data is possible.
|
|
3619
|
+
*/
|
|
3620
|
+
err;
|
|
3621
|
+
/** Error message, if {@link Inflate.err} is not {@link Z_OK}. */
|
|
3622
|
+
msg;
|
|
3623
|
+
/**
|
|
3624
|
+
* `true` once the compressed stream has ended. A stream may end before the
|
|
3625
|
+
* caller's data does (trailing bytes), so check this to know when to stop
|
|
3626
|
+
* pushing - further {@link Inflate.push} calls are no-ops.
|
|
3627
|
+
*/
|
|
3628
|
+
ended;
|
|
3629
|
+
started;
|
|
3630
|
+
/**
|
|
3631
|
+
* Chunks of output data, if {@link Inflate.onData} not overridden.
|
|
3632
|
+
* @internal
|
|
3633
|
+
*/
|
|
3634
|
+
chunks;
|
|
3635
|
+
strm;
|
|
3636
|
+
/**
|
|
3637
|
+
* Uncompressed result, generated by default {@link Inflate.onData}
|
|
3638
|
+
* and {@link Inflate.onEnd} handlers. Filled after you push last chunk
|
|
3639
|
+
* (call {@link Inflate.push} with {@link Z_FINISH} / `true` param).
|
|
3640
|
+
*/
|
|
3641
|
+
result;
|
|
3642
|
+
/**
|
|
3643
|
+
* Creates a new inflator instance with the specified params. Throws an
|
|
3644
|
+
* exception on bad params. See {@link InflateOptions} for the list of
|
|
3645
|
+
* supported options.
|
|
3646
|
+
*
|
|
3647
|
+
* By default, when no options are set, the deflate/gzip data format is
|
|
3648
|
+
* autodetected via the wrapper header.
|
|
3649
|
+
*
|
|
3650
|
+
* @example
|
|
3651
|
+
* ```javascript
|
|
3652
|
+
* import { Inflate } from 'pako'
|
|
3653
|
+
*
|
|
3654
|
+
* const chunk1 = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9])
|
|
3655
|
+
* const chunk2 = new Uint8Array([10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
|
|
3656
|
+
*
|
|
3657
|
+
* const inflate = new Inflate({ level: 3 })
|
|
3658
|
+
*
|
|
3659
|
+
* inflate.push(chunk1, false)
|
|
3660
|
+
* inflate.push(chunk2, true) // true -> last chunk
|
|
3661
|
+
*
|
|
3662
|
+
* if (inflate.err) throw new Error(inflate.err)
|
|
3663
|
+
*
|
|
3664
|
+
* console.log(inflate.result)
|
|
3665
|
+
* ```
|
|
3666
|
+
*/
|
|
3667
|
+
constructor(options2 = {}) {
|
|
3668
|
+
this.options = Object.assign({}, defaultOptions, options2);
|
|
3669
|
+
const opt = this.options;
|
|
3670
|
+
if (opt.raw && opt.windowBits >= 0 && opt.windowBits < 16) {
|
|
3671
|
+
opt.windowBits = -opt.windowBits;
|
|
3672
|
+
if (opt.windowBits === 0) opt.windowBits = -15;
|
|
3673
|
+
}
|
|
3674
|
+
if (opt.windowBits >= 0 && opt.windowBits < 16 && !options2.windowBits) opt.windowBits += 32;
|
|
3675
|
+
if (opt.windowBits > 15 && opt.windowBits < 48) {
|
|
3676
|
+
if ((opt.windowBits & 15) === 0) opt.windowBits |= 15;
|
|
3677
|
+
}
|
|
3678
|
+
this.err = 0;
|
|
3679
|
+
this.msg = "";
|
|
3680
|
+
this.ended = false;
|
|
3681
|
+
this.started = false;
|
|
3682
|
+
this.chunks = [];
|
|
3683
|
+
this.result = /* @__PURE__ */ new Uint8Array(0);
|
|
3684
|
+
this.strm = new ZStream();
|
|
3685
|
+
this.strm.avail_out = 0;
|
|
3686
|
+
let status = inflateInit2(this.strm, opt.windowBits);
|
|
3687
|
+
if (status !== 0) throw new Error(messages_default[status]);
|
|
3688
|
+
if (toString.call(opt.dictionary) === "[object ArrayBuffer]") opt.dictionary = new Uint8Array(opt.dictionary);
|
|
3689
|
+
const dictionary = opt.dictionary;
|
|
3690
|
+
if (opt.raw && dictionary.length) {
|
|
3691
|
+
status = inflateSetDictionary(this.strm, dictionary);
|
|
3692
|
+
if (status !== 0) throw new Error(messages_default[status]);
|
|
3693
|
+
}
|
|
3694
|
+
}
|
|
3695
|
+
/**
|
|
3696
|
+
* Sends input data to the inflate pipe, generating {@link Inflate.onData} calls
|
|
3697
|
+
* with new output chunks. Returns `true` on success. If end of stream is
|
|
3698
|
+
* detected, {@link Inflate.onEnd} will be called.
|
|
3699
|
+
*
|
|
3700
|
+
* `flush_mode` is not needed for normal operation, because end of stream
|
|
3701
|
+
* is detected automatically. Pass {@link Z_SYNC_FLUSH} to force the decoder
|
|
3702
|
+
* to emit all currently available output — handy when you need to decode
|
|
3703
|
+
* data frame-by-frame from a long-running stream.
|
|
3704
|
+
*
|
|
3705
|
+
* On failure, calls {@link Inflate.onEnd} with the error code and returns false.
|
|
3706
|
+
*
|
|
3707
|
+
* Once the stream has ended (a compressed stream may end before your data
|
|
3708
|
+
* does), further `push` calls are no-ops and return whether the decode
|
|
3709
|
+
* finished successfully. The final outcome is in {@link Inflate.result},
|
|
3710
|
+
* {@link Inflate.err} and {@link Inflate.msg}.
|
|
3711
|
+
*
|
|
3712
|
+
* @param flush_mode 0..6 for corresponding {@link Z_NO_FLUSH}..{@link Z_TREES}
|
|
3713
|
+
* flush modes. See constants. Skipped or `false` means {@link Z_NO_FLUSH},
|
|
3714
|
+
* `true` means {@link Z_FINISH}.
|
|
3715
|
+
*
|
|
3716
|
+
* @example
|
|
3717
|
+
* ```javascript
|
|
3718
|
+
* push(chunk, false) // push one of data chunks
|
|
3719
|
+
* ...
|
|
3720
|
+
* push(chunk, true) // push last chunk
|
|
3721
|
+
* ```
|
|
3722
|
+
*/
|
|
3723
|
+
push(data, flush_mode = false) {
|
|
3724
|
+
const strm = this.strm;
|
|
3725
|
+
const chunkSize = this.options.chunkSize;
|
|
3726
|
+
let status;
|
|
3727
|
+
let _flush_mode;
|
|
3728
|
+
let last_avail_out;
|
|
3729
|
+
if (this.ended) return this.err === 0;
|
|
3730
|
+
if (typeof flush_mode === "number") _flush_mode = flush_mode;
|
|
3731
|
+
else _flush_mode = flush_mode === true ? 4 : 0;
|
|
3732
|
+
if (toString.call(data) === "[object ArrayBuffer]") strm.input = new Uint8Array(data);
|
|
3733
|
+
else strm.input = data;
|
|
3734
|
+
strm.next_in = 0;
|
|
3735
|
+
strm.avail_in = strm.input.length;
|
|
3736
|
+
if (!this.started) {
|
|
3737
|
+
this.started = true;
|
|
3738
|
+
this.onStart(strm);
|
|
3739
|
+
}
|
|
3740
|
+
for (; ; ) {
|
|
3741
|
+
if (strm.avail_out === 0) {
|
|
3742
|
+
strm.output = new Uint8Array(chunkSize);
|
|
3743
|
+
strm.next_out = 0;
|
|
3744
|
+
strm.avail_out = chunkSize;
|
|
3745
|
+
}
|
|
3746
|
+
status = inflate$1(strm, _flush_mode);
|
|
3747
|
+
if (status === 2) {
|
|
3748
|
+
const dictionary = this.options.dictionary;
|
|
3749
|
+
if (dictionary.length) {
|
|
3750
|
+
status = inflateSetDictionary(strm, dictionary);
|
|
3751
|
+
if (status === 0) status = inflate$1(strm, _flush_mode);
|
|
3752
|
+
else if (status === -3) status = 2;
|
|
3753
|
+
}
|
|
3754
|
+
}
|
|
3755
|
+
while (strm.avail_in > 0 && status === 1 && strm.state.wrap & 2 && strm.state.flags !== 0 && strm.input[strm.next_in] !== 0) {
|
|
3756
|
+
inflateReset(strm);
|
|
3757
|
+
status = inflate$1(strm, _flush_mode);
|
|
3758
|
+
}
|
|
3759
|
+
if (status === -2 || status === -3 || status === 2 || status === -4) break;
|
|
3760
|
+
last_avail_out = strm.avail_out;
|
|
3761
|
+
if (strm.next_out) {
|
|
3762
|
+
if (strm.avail_out === 0 || status === 1 || _flush_mode > 0) {
|
|
3763
|
+
this.onData(strm.output.length === strm.next_out ? strm.output : strm.output.subarray(0, strm.next_out));
|
|
3764
|
+
strm.avail_out = 0;
|
|
3765
|
+
strm.next_out = 0;
|
|
3766
|
+
}
|
|
3767
|
+
}
|
|
3768
|
+
if ((status === 0 || status === -5) && last_avail_out === 0) continue;
|
|
3769
|
+
if (status === 1) {
|
|
3770
|
+
status = inflateEnd(this.strm);
|
|
3771
|
+
break;
|
|
3772
|
+
}
|
|
3773
|
+
if (strm.avail_in === 0) {
|
|
3774
|
+
if (_flush_mode === 4) {
|
|
3775
|
+
status = inflateEnd(this.strm);
|
|
3776
|
+
if (status === 0) status = -5;
|
|
3777
|
+
break;
|
|
3778
|
+
}
|
|
3779
|
+
return true;
|
|
3780
|
+
}
|
|
3781
|
+
}
|
|
3782
|
+
this.err = status;
|
|
3783
|
+
this.msg = strm.msg || messages_default[status];
|
|
3784
|
+
this.ended = true;
|
|
3785
|
+
this.onEnd(status);
|
|
3786
|
+
return status === 0;
|
|
3787
|
+
}
|
|
3788
|
+
/**
|
|
3789
|
+
* Called once before the first low-level inflate call.
|
|
3790
|
+
*
|
|
3791
|
+
* Override this handler to attach low-level inflate state, for example to read
|
|
3792
|
+
* gzip header metadata:
|
|
3793
|
+
*
|
|
3794
|
+
* ```javascript
|
|
3795
|
+
* import { Inflate, GZheader, zlibInflateGetHeader } from 'pako'
|
|
3796
|
+
*
|
|
3797
|
+
* const inflator = new Inflate()
|
|
3798
|
+
*
|
|
3799
|
+
* inflator.onStart = function (strm) {
|
|
3800
|
+
* this.header = new GZheader()
|
|
3801
|
+
* zlibInflateGetHeader(strm, this.header)
|
|
3802
|
+
* }
|
|
3803
|
+
*
|
|
3804
|
+
* inflator.push(data, true)
|
|
3805
|
+
* console.log(inflator.header.name)
|
|
3806
|
+
* ```
|
|
3807
|
+
*/
|
|
3808
|
+
onStart(strm) {
|
|
3809
|
+
}
|
|
3810
|
+
/**
|
|
3811
|
+
* By default, stores data blocks in the {@link Inflate.chunks} property and glues
|
|
3812
|
+
* them in {@link Inflate.onEnd}. Override this handler if you need another behaviour.
|
|
3813
|
+
*
|
|
3814
|
+
* @param chunk output data.
|
|
3815
|
+
*/
|
|
3816
|
+
onData(chunk) {
|
|
3817
|
+
this.chunks.push(chunk);
|
|
3818
|
+
}
|
|
3819
|
+
/**
|
|
3820
|
+
* Called after you tell inflate that the input stream is
|
|
3821
|
+
* complete ({@link Z_FINISH}). By default, joins the collected {@link Inflate.chunks},
|
|
3822
|
+
* frees memory and fills the {@link Inflate.result} property.
|
|
3823
|
+
*
|
|
3824
|
+
* @param status inflate status. {@link Z_OK} on success, other if not.
|
|
3825
|
+
*/
|
|
3826
|
+
onEnd(status) {
|
|
3827
|
+
if (status === 0) this.result = flattenChunks(this.chunks);
|
|
3828
|
+
this.chunks = [];
|
|
3829
|
+
}
|
|
3830
|
+
};
|
|
3831
|
+
function inflate(input2, options2 = {}) {
|
|
3832
|
+
const inflator = new Inflate(options2);
|
|
3833
|
+
inflator.push(input2, true);
|
|
3834
|
+
if (inflator.err) throw new Error(inflator.msg);
|
|
3835
|
+
const result = inflator.result;
|
|
3836
|
+
return options2.toText ? new TextDecoder().decode(result) : result;
|
|
3837
|
+
}
|
|
3838
|
+
|
|
3839
|
+
// packages/safe-bash/src/commands/bytes/compression/index.ts
|
|
391
3840
|
import bz2Factory from "../../safe-bash-compression-engine/native/bz2.js";
|
|
392
3841
|
import xzFactory from "../../safe-bash-compression-engine/native/xz.js";
|
|
393
3842
|
import zstdFactory from "../../safe-bash-compression-engine/native/zstd.js";
|
|
@@ -417,10 +3866,11 @@ function createCompressionCommands(config = {}) {
|
|
|
417
3866
|
if (maxDecodedBytes !== void 0 && maxDecodedBytes !== Infinity && (!Number.isSafeInteger(maxDecodedBytes) || maxDecodedBytes < 0)) {
|
|
418
3867
|
throw new RangeError("maxDecodedBytes must be a nonnegative safe integer or Infinity");
|
|
419
3868
|
}
|
|
420
|
-
const commands = profiles.flatMap((profile) => profile.format === "gzip" ? createGzipCommands(config) : profile.format === "bzip2" ? createBzip2Commands(config) : profile.names.map((name) =>
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
|
|
3869
|
+
const commands = profiles.flatMap((profile) => profile.format === "gzip" ? createGzipCommands(config) : profile.format === "bzip2" ? createBzip2Commands(config) : profile.names.map((name) => {
|
|
3870
|
+
const command2 = define(name, async (context) => {
|
|
3871
|
+
const options2 = parseOptions(name, context.args);
|
|
3872
|
+
if (options2.help) {
|
|
3873
|
+
await output(context, `Usage: ${name} [OPTION]... [FILE]...
|
|
424
3874
|
-c, --stdout, --to-stdout
|
|
425
3875
|
-d, --decompress, --uncompress
|
|
426
3876
|
-k, --keep
|
|
@@ -430,48 +3880,50 @@ ${options2.format === "zstd" ? "-1..-9, --best\nHigher levels and --fast[=NUM] a
|
|
|
430
3880
|
`}-h, --help
|
|
431
3881
|
No FILE or FILE '-' uses stdin; file output uses private VFS staging.
|
|
432
3882
|
`);
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
try {
|
|
438
|
-
if (options2.operands.length > 1) {
|
|
439
|
-
plans = [];
|
|
440
|
-
for (const name2 of options2.operands) {
|
|
441
|
-
try {
|
|
442
|
-
plans.push(...await planOperands(context, { ...options2, operands: [name2] }));
|
|
443
|
-
} catch (error) {
|
|
444
|
-
context.signal.throwIfAborted();
|
|
445
|
-
if (codeOf(error) === "EROFS") throw error;
|
|
446
|
-
planningFailed = true;
|
|
447
|
-
if (options2.quiet < 2) await diagnostic(context, error);
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
if (plans.length > 1) await verifyOperandDestinations(context, plans);
|
|
451
|
-
} else plans = await planOperands(context, options2);
|
|
452
|
-
} catch (error) {
|
|
453
|
-
context.signal.throwIfAborted();
|
|
454
|
-
if (options2.quiet < 2) throw error;
|
|
455
|
-
return { exitCode: 1 };
|
|
456
|
-
}
|
|
457
|
-
const decodedBudget = new DecodedBudget(maxDecodedBytes);
|
|
458
|
-
let exitCode = planningFailed ? 1 : 0;
|
|
459
|
-
for (const plan of plans) {
|
|
3883
|
+
return { exitCode: 0 };
|
|
3884
|
+
}
|
|
3885
|
+
let plans;
|
|
3886
|
+
let planningFailed = false;
|
|
460
3887
|
try {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
3888
|
+
if (options2.operands.length > 1) {
|
|
3889
|
+
plans = [];
|
|
3890
|
+
for (const name2 of options2.operands) {
|
|
3891
|
+
try {
|
|
3892
|
+
plans.push(...await planOperands(context, { ...options2, operands: [name2] }));
|
|
3893
|
+
} catch (error) {
|
|
3894
|
+
context.signal.throwIfAborted();
|
|
3895
|
+
if (codeOf(error) === "EROFS") throw error;
|
|
3896
|
+
planningFailed = true;
|
|
3897
|
+
if (options2.quiet < 2) await diagnostic(context, error);
|
|
3898
|
+
}
|
|
3899
|
+
}
|
|
3900
|
+
if (plans.length > 1) await verifyOperandDestinations(context, plans);
|
|
3901
|
+
} else plans = await planOperands(context, options2);
|
|
466
3902
|
} catch (error) {
|
|
467
3903
|
context.signal.throwIfAborted();
|
|
468
|
-
if (options2.quiet < 2)
|
|
469
|
-
exitCode
|
|
470
|
-
if (decodedBudget.exceeded) break;
|
|
3904
|
+
if (options2.quiet < 2) throw error;
|
|
3905
|
+
return { exitCode: 1 };
|
|
471
3906
|
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
3907
|
+
const decodedBudget = new DecodedBudget(maxDecodedBytes);
|
|
3908
|
+
let exitCode = planningFailed ? 1 : 0;
|
|
3909
|
+
for (const plan of plans) {
|
|
3910
|
+
try {
|
|
3911
|
+
const warned = await runOperand(context, plan, options2, decodedBudget);
|
|
3912
|
+
if (warned) {
|
|
3913
|
+
if (!options2.quiet) await diagnostic(context, new PublicDiagnostic(`${plan.source}: decompression OK, trailing garbage ignored`));
|
|
3914
|
+
if (exitCode === 0) exitCode = 2;
|
|
3915
|
+
}
|
|
3916
|
+
} catch (error) {
|
|
3917
|
+
context.signal.throwIfAborted();
|
|
3918
|
+
if (options2.quiet < 2) await diagnostic(context, error);
|
|
3919
|
+
exitCode = 1;
|
|
3920
|
+
if (decodedBudget.exceeded) break;
|
|
3921
|
+
}
|
|
3922
|
+
}
|
|
3923
|
+
return { exitCode };
|
|
3924
|
+
});
|
|
3925
|
+
return { ...command2, execute: withInputByteBudget(async (context) => command2.execute(context)) };
|
|
3926
|
+
}));
|
|
475
3927
|
const xzCmds = createXzCommands(config);
|
|
476
3928
|
if (maxDecodedBytes === void 0 || maxDecodedBytes === Infinity) {
|
|
477
3929
|
for (const c of [...commands, ...xzCmds]) builtInDirectContextExecutors.add(c.execute);
|
|
@@ -5169,6 +8621,7 @@ async function copyCheckedSource(context, source, target, expected, exclusive) {
|
|
|
5169
8621
|
return;
|
|
5170
8622
|
}
|
|
5171
8623
|
position += chunk.length;
|
|
8624
|
+
context.inputBudget?.check(position);
|
|
5172
8625
|
yield chunk;
|
|
5173
8626
|
}
|
|
5174
8627
|
};
|
|
@@ -6287,7 +9740,7 @@ function filesystemCommands(maxDirectoryEntries, maxRecursiveDirectoryDepth = In
|
|
|
6287
9740
|
}
|
|
6288
9741
|
operandCount++;
|
|
6289
9742
|
}
|
|
6290
|
-
if (fastOk && operandCount
|
|
9743
|
+
if (fastOk && operandCount === 1) {
|
|
6291
9744
|
let admitted = false;
|
|
6292
9745
|
try {
|
|
6293
9746
|
assertCommandRequirements(context, filesystemCommandRequirements.mkdir, recursive ? MKDIR_PARENTS_MODES : MKDIR_DIR_MODES, backingMem.capabilities);
|
|
@@ -7317,7 +10770,7 @@ function resolveCanonicalSync(cwd, inputPath, mode, inspectStat) {
|
|
|
7317
10770
|
function evalSyncReadlink(args, cwd, inspectStat) {
|
|
7318
10771
|
let mode = "link";
|
|
7319
10772
|
let noNewline = false;
|
|
7320
|
-
let
|
|
10773
|
+
let zero2 = false;
|
|
7321
10774
|
let quiet = false;
|
|
7322
10775
|
const operands = [];
|
|
7323
10776
|
let endOpts = false;
|
|
@@ -7332,7 +10785,7 @@ function evalSyncReadlink(args, cwd, inspectStat) {
|
|
|
7332
10785
|
else if (a === "--canonicalize-existing") mode = "e";
|
|
7333
10786
|
else if (a === "--canonicalize-missing") mode = "m";
|
|
7334
10787
|
else if (a === "--no-newline") noNewline = true;
|
|
7335
|
-
else if (a === "--zero")
|
|
10788
|
+
else if (a === "--zero") zero2 = true;
|
|
7336
10789
|
else if (a === "--quiet" || a === "--silent") quiet = true;
|
|
7337
10790
|
else if (a === "--verbose") quiet = false;
|
|
7338
10791
|
else return void 0;
|
|
@@ -7345,7 +10798,7 @@ function evalSyncReadlink(args, cwd, inspectStat) {
|
|
|
7345
10798
|
else if (ch === "e") mode = "e";
|
|
7346
10799
|
else if (ch === "m") mode = "m";
|
|
7347
10800
|
else if (ch === "n") noNewline = true;
|
|
7348
|
-
else if (ch === "z")
|
|
10801
|
+
else if (ch === "z") zero2 = true;
|
|
7349
10802
|
else if (ch === "q" || ch === "s") quiet = true;
|
|
7350
10803
|
else if (ch === "v") quiet = false;
|
|
7351
10804
|
else return void 0;
|
|
@@ -7362,14 +10815,14 @@ function evalSyncReadlink(args, cwd, inspectStat) {
|
|
|
7362
10815
|
if (res === void 0) return void 0;
|
|
7363
10816
|
out.push(res);
|
|
7364
10817
|
}
|
|
7365
|
-
const sep =
|
|
10818
|
+
const sep = zero2 ? "\0" : "\n";
|
|
7366
10819
|
return noNewline && operands.length === 1 ? out[0] : out.map((x) => x + sep).join("");
|
|
7367
10820
|
}
|
|
7368
10821
|
function evalSyncRealpath(args, cwd, inspectStat) {
|
|
7369
10822
|
let mode = "f";
|
|
7370
10823
|
let strip = false;
|
|
7371
10824
|
let logical = false;
|
|
7372
|
-
let
|
|
10825
|
+
let zero2 = false;
|
|
7373
10826
|
let relTo;
|
|
7374
10827
|
let relBase;
|
|
7375
10828
|
const operands = [];
|
|
@@ -7399,7 +10852,7 @@ function evalSyncRealpath(args, cwd, inspectStat) {
|
|
|
7399
10852
|
else if (a === "--physical") {
|
|
7400
10853
|
logical = false;
|
|
7401
10854
|
strip = false;
|
|
7402
|
-
} else if (a === "--zero")
|
|
10855
|
+
} else if (a === "--zero") zero2 = true;
|
|
7403
10856
|
else if (a === "--quiet") {
|
|
7404
10857
|
} else return void 0;
|
|
7405
10858
|
continue;
|
|
@@ -7415,7 +10868,7 @@ function evalSyncRealpath(args, cwd, inspectStat) {
|
|
|
7415
10868
|
else if (ch === "P") {
|
|
7416
10869
|
logical = false;
|
|
7417
10870
|
strip = false;
|
|
7418
|
-
} else if (ch === "z")
|
|
10871
|
+
} else if (ch === "z") zero2 = true;
|
|
7419
10872
|
else if (ch === "q") {
|
|
7420
10873
|
} else return void 0;
|
|
7421
10874
|
}
|
|
@@ -7442,7 +10895,7 @@ function evalSyncRealpath(args, cwd, inspectStat) {
|
|
|
7442
10895
|
const display = toCanon !== void 0 && (baseCanon === void 0 || isPathWithin(baseCanon, toCanon) && isPathWithin(baseCanon, resolved)) ? relativePath(toCanon, resolved) || "." : resolved;
|
|
7443
10896
|
out.push(display);
|
|
7444
10897
|
}
|
|
7445
|
-
const sep =
|
|
10898
|
+
const sep = zero2 ? "\0" : "\n";
|
|
7446
10899
|
return out.map((x) => x + sep).join("");
|
|
7447
10900
|
}
|
|
7448
10901
|
function evalSyncLs(args, cwd, inspectStat) {
|
|
@@ -8105,13 +11558,25 @@ function predicateCommands(identity = {}) {
|
|
|
8105
11558
|
}
|
|
8106
11559
|
|
|
8107
11560
|
export {
|
|
11561
|
+
assertCommandRequirements,
|
|
8108
11562
|
clearRgFastRunnerPool,
|
|
8109
11563
|
createRgCommand,
|
|
8110
|
-
assertCommandRequirements,
|
|
8111
11564
|
evaluateFilePredicate,
|
|
11565
|
+
abortManagedController,
|
|
11566
|
+
addAbortSignalWaiter,
|
|
11567
|
+
combineManagedSignals,
|
|
11568
|
+
createManagedControlController,
|
|
11569
|
+
creationUmask,
|
|
11570
|
+
getRuntimeBackingFileSystem,
|
|
11571
|
+
interruptible,
|
|
11572
|
+
isManagedAbortSignal,
|
|
11573
|
+
isSyncResolved,
|
|
11574
|
+
registerManagedAbortSignal,
|
|
11575
|
+
removeAbortSignalWaiter,
|
|
8112
11576
|
wcDisplayWidth,
|
|
8113
11577
|
bindFileOutputBudget,
|
|
8114
11578
|
openFileOutput,
|
|
11579
|
+
writeFileOutput,
|
|
8115
11580
|
directExecutor,
|
|
8116
11581
|
executionCommands,
|
|
8117
11582
|
evalSyncEnv,
|