@poe-platform/safe-bash 0.1.813 → 0.1.815
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/dist/image-ast/index.js +1 -1
- package/dist/mp4-ast/index.d.ts +3 -0
- package/dist/mp4-ast/mp4-fragment-source.d.ts +35 -0
- package/dist/mp4-ast/mp4-sample-source.d.ts +55 -0
- package/dist/mp4-ast/mp4-source.d.ts +32 -0
- package/dist/mp4-ast/types.d.ts +11 -0
- package/dist/office-xml/retained-xml-document.d.ts +6 -0
- package/dist/pdf-ast/content/evaluator.d.ts +4 -0
- package/dist/pdf-ast/cos/object-reader.d.ts +8 -0
- package/dist/pdf-ast/cos/value-parser.d.ts +1 -0
- package/dist/pdf-ast/edit/forms.d.ts +1 -0
- package/dist/pdf-ast/edit/retained-form-appearances.d.ts +10 -0
- package/dist/pdf-ast/edit/retained-form-data.d.ts +9 -0
- package/dist/pdf-ast/edit/retained-graph.d.ts +6 -0
- package/dist/pdf-ast/edit/retained-info-updates.d.ts +33 -0
- package/dist/pdf-ast/index.d.ts +2 -1
- package/dist/pdf-ast/index.js +895 -139
- package/dist/pdf-ast/retained-document.d.ts +5 -0
- package/dist/safe-bash/command-chunks/biff-A7XPBWAK-DCLG5QKF.js +5417 -0
- package/dist/safe-bash/command-chunks/{chunk-34G2SQX2.js → chunk-2BLTUQNK.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-LLU2IQEJ.js → chunk-2BNGPR6Z.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-XIDGHIGB.js → chunk-2PKBXGXD.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-6SRHWVEB.js → chunk-2VVJRVYM.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-G5QVZQCO.js → chunk-3EASXF5D.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-U3SBHEKH.js → chunk-3EB2FSAN.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-VB2TUPO2.js → chunk-3EW7GYHM.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-GVWVRPG6.js → chunk-3GRMU7TM.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-6L4IYQAT.js → chunk-3MG5EAMX.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-RASQPOSV.js → chunk-3SPLP2DB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-K5COUQAQ.js → chunk-3VGQTLO6.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-K7CV55K5.js → chunk-3YEQI5B7.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-KCE5D4Z4.js → chunk-3ZRCL756.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-SOFM3GPG.js → chunk-42MEXZBJ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-PKLJRB7W.js → chunk-44F5TOHZ.js} +219 -90
- package/dist/safe-bash/command-chunks/{chunk-GQ2ZSPZ3.js → chunk-46AMTJPE.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-MTWZEPAR.js → chunk-47IAU25U.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-6GI3NTCW.js → chunk-4B2ZUGLT.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-X64XGIXZ.js → chunk-4EHY6J2Z.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-QQVACHZA.js → chunk-4EZJV4FZ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-SSKMPDN4.js → chunk-4GQKCUS5.js} +15 -15
- package/dist/safe-bash/command-chunks/{chunk-UOBW5K3M.js → chunk-4RRYWHED.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-PINR7QET.js → chunk-4UPKVQWH.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-I4GMCWAT.js → chunk-4YLACJHE.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-P3WU3PSL.js → chunk-5L4YGRQU.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-WPVBUVFK.js → chunk-5LFGXN3D.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-YXD6VGVG.js → chunk-5OM3UIK3.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-RLCQ7BN3.js → chunk-6CDDKNNA.js} +4 -3
- package/dist/safe-bash/command-chunks/{chunk-TQEB4DH4.js → chunk-6EINUY5G.js} +149 -165
- package/dist/safe-bash/command-chunks/{chunk-C5QDEB3I.js → chunk-6LPSKLLD.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-XLYIVBAR.js → chunk-6QYSF7I2.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-6IWE7PTK.js → chunk-6VBDJC6V.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-6N5GHM72.js → chunk-6WNVGCXD.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-PSCOXGCA.js → chunk-6XES7Z4G.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-AFROLW6S.js → chunk-6XGDWFNQ.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-WTE23QXN.js → chunk-6ZGCKUAM.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-RIV6XN7K.js → chunk-7DOLY7IV.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ET2VPDUA.js → chunk-7KZ5LWV2.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-NGR5KOPQ.js → chunk-A347DLRB.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-ZM2Y4Z3C.js → chunk-A45UG4KT.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-2Z3WRRFT.js → chunk-ADHFF2IM.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-ATI464W3.js → chunk-AG2SNMP5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-HCKYUQ3L.js → chunk-AM5LANIE.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-RBTC7OFT.js → chunk-AVOGFREX.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-G3RUXKVY.js → chunk-AWPI4DZR.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FYMNHG7R.js → chunk-AXXZNB7U.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-2E2H7MBH.js → chunk-AY3KQ4EN.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-DMCI6T6N.js → chunk-BLGGAHQW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-CU4DLVME.js → chunk-BLIFGBIO.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-2V6FOLXV.js → chunk-BS3ZEQGT.js} +14 -14
- package/dist/safe-bash/command-chunks/{chunk-WFVSUXJL.js → chunk-BS5JEUEW.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-X53AEG36.js → chunk-BZMNC7Q5.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-5KGEZ3RW.js → chunk-CCMAHM3I.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-PK36TVXB.js → chunk-CFMJXJS5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-3LJAXFH5.js → chunk-CIRDVCAZ.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-UZL7G57V.js → chunk-CKEMZUE3.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-S2N2V5U4.js → chunk-CQBACD2V.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-G7NENPYV.js → chunk-CSE4VQKG.js} +12 -1
- package/dist/safe-bash/command-chunks/{chunk-X6RHJ6YN.js → chunk-CXME4YHU.js} +23 -0
- package/dist/safe-bash/command-chunks/{chunk-FTLDRH47.js → chunk-CZ5K2YPU.js} +16 -16
- package/dist/safe-bash/command-chunks/{chunk-7PRL6RJ6.js → chunk-DBLQUZGN.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-5VQVZPP3.js → chunk-DBNJEXHK.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-ZO5WBWLL.js → chunk-DN6MSXY7.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-GXLXWZWH.js → chunk-DZH54L3F.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-6CY5BHBS.js → chunk-EBHOZIBS.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-3Y5EME26.js → chunk-ENEIE44W.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-TKRLZIFI.js → chunk-EQWFKNHJ.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-YV72XQKL.js → chunk-ETXPMVR6.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-4Z6W5EOC.js → chunk-EV5G535P.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-PZMU3Z4L.js → chunk-EVYKV3QI.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-D6UMSC45.js → chunk-F4YFTO2K.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-QM2HZJSJ.js → chunk-F762XDNG.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-SGPCXAG7.js → chunk-FOONI6BD.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-DYLNU57U.js → chunk-FSVJ67G5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-CLKOGAR3.js → chunk-FSYMSWJU.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-FWPVQGYK.js → chunk-FUQMEUAT.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-KXPCSVAT.js → chunk-FXCSPPYE.js} +20 -20
- package/dist/safe-bash/command-chunks/{chunk-7QZ2HP2F.js → chunk-FYYFV6PW.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-3OETVNJA.js → chunk-G2COZLXX.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-MKX4JAZ6.js → chunk-GCHB7VNX.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-4Y6O2K35.js → chunk-GLAF45M7.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-GPGLTWNR.js +271 -0
- package/dist/safe-bash/command-chunks/{chunk-PI6MOMHA.js → chunk-GXMPXMDP.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-57DDYKE5.js → chunk-GYM5ICK4.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-5MFDRSGG.js → chunk-H33D4R26.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-3ZDANXIC.js → chunk-HELAVGZH.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-S4QH5BXZ.js → chunk-HGIMFVI2.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-35IPOBWL.js → chunk-HI6ZYH3W.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-RGOQKIG6.js → chunk-HK6MSB7Z.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-IHSOOSNC.js → chunk-HQ2UN2L2.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-7ZE3VIAN.js → chunk-IB5QP4LF.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-UCR5YDV3.js → chunk-IBYMPAUW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-LABOWPFB.js → chunk-IHXZMAMY.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-PVGZMLC6.js → chunk-IWHNRYER.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-PPO7YUZF.js → chunk-JGKSWDGP.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-GKILM4HZ.js → chunk-JR3Q6QNL.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-D55REQA3.js → chunk-JUHOL5KB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-3O2YEI47.js → chunk-JVKE7YZN.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-6NATRKUJ.js → chunk-JW6WVNTM.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-IK6K2HCG.js → chunk-JWORWL72.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-N32GSM3J.js → chunk-K2WOMJOQ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-73NYFNAS.js → chunk-KASXIRKD.js} +12 -9
- package/dist/safe-bash/command-chunks/{chunk-HKOMXGJS.js → chunk-KBAQHE5Y.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-T3E5RV3U.js → chunk-KCLJGRU7.js} +12 -12
- package/dist/safe-bash/command-chunks/chunk-KHUT7BB5.js +65 -0
- package/dist/safe-bash/command-chunks/{chunk-TUDFMNPP.js → chunk-KINIV2SV.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-43TRBJ2N.js → chunk-KPHLESD4.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-C5KLFZGT.js → chunk-KSBNZTAZ.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-4Y34ZG4T.js → chunk-KUOCGGEU.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-ML5R5JML.js → chunk-KY4LCHUF.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-KBUBSMCQ.js → chunk-LDW3RF7Y.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-U27XPNLP.js → chunk-LEO4VRIN.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-GZ3VIWNN.js → chunk-LKGTH2Q7.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-TODWFDYB.js → chunk-LNTEV56A.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-DVGXLBUW.js → chunk-LZ2JFMKT.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-6D2BMAF4.js → chunk-MEM2ZPMI.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-GNXTMSYN.js → chunk-MGMTRGKM.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-B3NLITWP.js → chunk-MKK6FM5H.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-BK7ISUJL.js → chunk-MKOIPOXX.js} +3 -3
- package/dist/safe-bash/command-chunks/chunk-MLOYUXUV.js +244 -0
- package/dist/safe-bash/command-chunks/{chunk-CBNKHBLD.js → chunk-MNK3DDH6.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-JVGUVHWI.js → chunk-MPXMRTMY.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-EJTNVXWF.js → chunk-MVLVIMJ6.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-TY4WDAHM.js → chunk-MYZ46FQL.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-TBAIMDGL.js → chunk-N4MUBJCT.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-NPLVFAD6.js → chunk-N6G3345Q.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-4PBNMKAT.js → chunk-NEMUPUUB.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-MUUWBZIC.js → chunk-NEVQWOU6.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-7NXTEWPR.js → chunk-NEYITAAO.js} +208 -254
- package/dist/safe-bash/command-chunks/{chunk-KZ5ODST6.js → chunk-NFGCBQN3.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-LD7BONZY.js → chunk-NFII726L.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-JQPNA77Y.js → chunk-NHNZYWPW.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ZYLGNIGA.js → chunk-NQINS4XY.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-UAF4IX5H.js → chunk-NRFTYZ2R.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-THMZLJQD.js → chunk-NYFYTL5G.js} +18 -18
- package/dist/safe-bash/command-chunks/{chunk-SMSGLRIH.js → chunk-OTF2AJ5M.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-NPFHUS4X.js → chunk-OVQP6KH5.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-QFF5KBOM.js → chunk-P2LT6TGR.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-BEHUSUOY.js → chunk-PLMF35XK.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-PXWS3Q7L.js → chunk-PLR5IULU.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-DBLHCJJU.js → chunk-PS5GDFIP.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-P7EL2FWW.js → chunk-Q5PWYPQV.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-AJI55RS7.js → chunk-Q7TVCBU2.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-EHTOHOTR.js → chunk-QB72X7FF.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-GOBUDKZ3.js → chunk-QDVDBN2N.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-F3GP3EXE.js → chunk-RGDOYWOD.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-MNHBQBF6.js → chunk-RHDERFMR.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-3KMOXEGH.js → chunk-RHU44OMN.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-XG6UWQV5.js → chunk-RIVKF77R.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-UOR6PXZZ.js → chunk-ROL5AEX6.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-3TYDSGAH.js → chunk-RQYPFLZJ.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-3Y4XZB24.js → chunk-RTNI47C5.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-W5LLKV5H.js → chunk-RV5AGXOV.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-JUJHYPYL.js → chunk-RXQ2G2YK.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-EVU7FLDA.js → chunk-S2QNBAN6.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-YE6OAKK7.js → chunk-S43QRKDC.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-774GLJAO.js → chunk-S7HIOT7Z.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-3D24WDND.js → chunk-SEPUP6TZ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-JPMYPOYZ.js → chunk-SUTHGUD3.js} +28 -28
- package/dist/safe-bash/command-chunks/{chunk-D6WJY6QO.js → chunk-SWAKALDJ.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-WGH3RLJY.js → chunk-T5S4SJGO.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-7JEIWA3A.js → chunk-TID5TSQW.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-EZ4NQIPL.js → chunk-TJLXSENN.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-HVW53ARH.js → chunk-TKCUGMRZ.js} +24 -20
- package/dist/safe-bash/command-chunks/{chunk-5P6I2T63.js → chunk-TXPDKEGY.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-CTDC4LJT.js → chunk-U3C6IT2C.js} +55 -36
- package/dist/safe-bash/command-chunks/{chunk-MPKY37QR.js → chunk-UJERQEJB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-V37D6AHO.js → chunk-USGZN2KE.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-JAHJWVGF.js → chunk-UYGQEQIP.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-MPORWUTU.js → chunk-V5XC43BX.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-AIMSZBWP.js → chunk-V7E3PZOK.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-CNHRVUHA.js → chunk-VDTFVRYX.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-M3Z5PU2M.js → chunk-VT2PHQ63.js} +15 -15
- package/dist/safe-bash/command-chunks/{chunk-QDVI2YB6.js → chunk-VUWXLH3E.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-O675URF4.js → chunk-W3ZSWK76.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-T6C5QP7T.js → chunk-WAT2562G.js} +6039 -5958
- package/dist/safe-bash/command-chunks/{chunk-JPA2PUYI.js → chunk-WBKB7HBZ.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-6244HYJY.js → chunk-WJ2ERUCQ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-U5TWQFZY.js → chunk-WTVJLHMG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-SLQWQKXP.js → chunk-WWHMI4S3.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-2UBZALAK.js → chunk-WYZG3DRR.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-T5ERNELL.js → chunk-WZRFS5OY.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-2DGJOOXM.js → chunk-X6OHFKBL.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-S6ZTBXYO.js → chunk-XKAUKLF7.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-NKTULXVD.js → chunk-XM5QJCPD.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-BBAB7LC4.js → chunk-XMTR7QGL.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-5IFRAI7Y.js → chunk-XNGM3W5R.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-Z5BIM5B7.js → chunk-XTEIT5CI.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4DLIUTQV.js → chunk-XU6S3XUZ.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-EXOQGXEU.js → chunk-XUJAQA3S.js} +30 -30
- package/dist/safe-bash/command-chunks/{chunk-VVWXY6IA.js → chunk-Y42KSX63.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-R2BMZAHG.js → chunk-Y54L4P4J.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-6WQD7LRA.js → chunk-YAD7EV4N.js} +14 -14
- package/dist/safe-bash/command-chunks/{chunk-YUXTK3XA.js → chunk-YRPXBGRX.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-JORIVUPM.js → chunk-YW2VYN4V.js} +34 -15
- package/dist/safe-bash/command-chunks/{chunk-NMPED6L5.js → chunk-Z2WNYEPD.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-7PZHWMK6.js → chunk-Z7QOSXQC.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-7UC2Q6Z6.js → chunk-ZIGENXGC.js} +248 -6
- package/dist/safe-bash/command-chunks/{chunk-VQOINPVF.js → chunk-ZQM37BGE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-W3HV45CI.js → chunk-ZSQZHFWS.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-IDJQP3A6.js → chunk-ZTMZO4IT.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-V6XBEYPC.js → chunk-ZU2KJMXO.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-YXKNJ6EM.js → chunk-ZXELXF2H.js} +5 -5
- package/dist/safe-bash/command-chunks/{clipboard-BBDK33GP-VB22F7GI.js → clipboard-BBDK33GP-QZ4ERNQX.js} +2 -2
- package/dist/safe-bash/command-chunks/{command-engine-X3OLN7N6.js → command-engine-M7S4QIXV.js} +942 -683
- package/dist/safe-bash/command-chunks/{engine-XUCIFZ7V-LJFGZM6O.js → engine-YUYZJIB4-NZUDFEHL.js} +1 -1
- package/dist/safe-bash/command-chunks/{gnumeric-UJPXWBVR-YPXTNEDZ.js → gnumeric-UJPXWBVR-7VOHQAPM.js} +2 -2
- package/dist/safe-bash/command-chunks/{model-store-E7BHBFJC.js → model-store-UB5DWMAP.js} +24 -24
- package/dist/safe-bash-command-awk/awk-runtime.js +3 -3
- package/dist/safe-bash-command-awk/awk.js +4 -4
- package/dist/safe-bash-command-awk/index.js +4 -4
- package/dist/safe-bash-command-diff/diff.js +2 -2
- package/dist/safe-bash-command-diff/index.js +3 -3
- package/dist/safe-bash-command-diff/sync.js +2 -2
- package/dist/safe-bash-command-du/du.js +2 -2
- package/dist/safe-bash-command-du/index.js +2 -2
- package/dist/safe-bash-command-ffmpeg/index.js +1 -1
- package/dist/safe-bash-command-ffprobe/index.js +2 -2
- package/dist/safe-bash-command-ffprobe/media.d.ts +8 -2
- package/dist/safe-bash-command-ffprobe/media.js +4 -2
- package/dist/safe-bash-command-html-to-markdown/index.js +3 -234
- package/dist/safe-bash-command-html-to-markdown/stored-text.d.ts +50 -0
- package/dist/safe-bash-command-html-to-markdown/stored-text.js +12 -0
- package/dist/safe-bash-command-htmlq/contracts.d.ts +5 -0
- package/dist/safe-bash-command-htmlq/index.js +1715 -292
- package/dist/safe-bash-command-htmlq/selectors.d.ts +38 -1
- package/dist/safe-bash-command-htmlq/serializer.d.ts +1 -0
- package/dist/safe-bash-command-htmlq/tree.d.ts +1 -0
- package/dist/safe-bash-command-iconv/command.js +2 -2
- package/dist/safe-bash-command-iconv/index.js +2 -2
- package/dist/safe-bash-command-llm/command.js +3 -3
- package/dist/safe-bash-command-llm/index.js +9 -9
- package/dist/safe-bash-command-llm/openai.js +2 -2
- package/dist/safe-bash-command-llm/providers/index.js +2 -2
- package/dist/safe-bash-command-llm/providers/openai.js +2 -2
- package/dist/safe-bash-command-node/commands/node/browser.js +2 -2
- package/dist/safe-bash-command-node/commands/node/default-runtime.js +2 -2
- package/dist/safe-bash-command-node/commands/node/safejs.js +2 -2
- package/dist/safe-bash-command-pandoc/command.js +4 -4
- package/dist/safe-bash-command-pandoc/index.js +40 -40
- package/dist/safe-bash-command-patch/index.js +7 -6
- package/dist/safe-bash-command-patch/patch-formats.d.ts +7 -1
- package/dist/safe-bash-command-patch/patch-formats.js +7 -4
- package/dist/safe-bash-command-patch/patch-gnu-paths.d.ts +7 -7
- package/dist/safe-bash-command-patch/patch-gnu-reject.d.ts +2 -2
- package/dist/safe-bash-command-patch/patch-gnu-reject.js +3 -2
- package/dist/safe-bash-command-patch/patch-publication.js +3 -2
- package/dist/safe-bash-command-patch/patch-text.d.ts +13 -0
- package/dist/safe-bash-command-patch/patch.js +7 -6
- package/dist/safe-bash-command-patch/stored-patch.d.ts +51 -0
- package/dist/safe-bash-command-patch/stored-target.d.ts +41 -0
- package/dist/safe-bash-command-patch/unified.d.ts +28 -9
- package/dist/safe-bash-command-patch/unified.js +4 -1
- package/dist/safe-bash-command-pdftk/index.js +758 -433
- package/dist/safe-bash-command-playwright-cli/index.js +26 -26
- package/dist/safe-bash-command-playwright-cli/playwright/abilities.js +10 -10
- package/dist/safe-bash-command-playwright-cli/playwright/controller.js +14 -14
- package/dist/safe-bash-command-playwright-cli/playwright/index.js +23 -23
- package/dist/safe-bash-command-playwright-cli/playwright/snapshot.js +2 -2
- package/dist/safe-bash-command-playwright-cli/playwright/standard-capabilities.js +6 -6
- package/dist/safe-bash-command-playwright-cli/playwright/storage-capabilities.js +4 -4
- package/dist/safe-bash-command-pptx/command-engine.d.ts +2 -1
- package/dist/safe-bash-command-pptx/engine.js +1 -1
- package/dist/safe-bash-command-pptx/index.d.ts +1 -1
- package/dist/safe-bash-command-pptx/index.js +163 -17
- package/dist/safe-bash-command-pptx/streaming-inputs.d.ts +7 -2
- package/dist/safe-bash-command-python/executor.js +5 -5
- package/dist/safe-bash-command-python/index.js +5 -5
- package/dist/safe-bash-command-python/jspi.js +2 -2
- package/dist/safe-bash-command-soffice/index.js +1 -1
- package/dist/safe-bash-command-sort/index.js +3 -3
- package/dist/safe-bash-command-ssconvert/index.js +2 -2
- 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 +8 -8
- package/dist/safe-bash-command-tar/modes.js +4 -4
- package/dist/safe-bash-command-timeout/index.js +3 -3
- package/dist/safe-bash-command-tree/index.js +2 -2
- package/dist/safe-bash-command-tree/tree.js +2 -2
- package/dist/safe-bash-command-xz/index.js +5 -5
- package/dist/safe-bash-compression-engine/files.js +2 -2
- package/dist/safe-bash-compression-engine/operand.js +4 -4
- package/dist/safe-bash-contracts/diagnostics.js +3 -3
- package/dist/safe-bash-contracts/escaping.js +10 -10
- package/dist/safe-bash-contracts/filesystem-descriptor.js +1 -1
- package/dist/safe-bash-contracts/filesystem-output.js +6 -6
- package/dist/safe-bash-contracts/index.js +33 -33
- package/dist/safe-bash-contracts/io.js +2 -2
- package/dist/safe-bash-contracts/output.js +3 -3
- package/dist/safe-bash-docx-engine/ancillary-resources.js +5 -5
- package/dist/safe-bash-docx-engine/batch-operations.js +63 -63
- package/dist/safe-bash-docx-engine/batch-result-schema.js +74 -74
- package/dist/safe-bash-docx-engine/batch.js +74 -74
- package/dist/safe-bash-docx-engine/bookmarks.js +13 -13
- package/dist/safe-bash-docx-engine/charts.js +6 -6
- package/dist/safe-bash-docx-engine/command-option-rules.js +3 -3
- package/dist/safe-bash-docx-engine/comments.js +21 -21
- package/dist/safe-bash-docx-engine/control-bindings.js +16 -16
- package/dist/safe-bash-docx-engine/control-repeat.js +16 -16
- package/dist/safe-bash-docx-engine/controls.js +14 -14
- package/dist/safe-bash-docx-engine/create.js +8 -8
- package/dist/safe-bash-docx-engine/diagrams.js +6 -6
- package/dist/safe-bash-docx-engine/diff.js +8 -8
- package/dist/safe-bash-docx-engine/document-properties.js +12 -12
- package/dist/safe-bash-docx-engine/equations.js +12 -12
- package/dist/safe-bash-docx-engine/extract.js +9 -9
- package/dist/safe-bash-docx-engine/fields.js +18 -18
- package/dist/safe-bash-docx-engine/font-inventory.js +13 -13
- package/dist/safe-bash-docx-engine/font-resources.js +3 -3
- package/dist/safe-bash-docx-engine/image-batch-operations.js +11 -11
- package/dist/safe-bash-docx-engine/image-insertion.js +17 -17
- package/dist/safe-bash-docx-engine/image-layout.js +14 -14
- package/dist/safe-bash-docx-engine/image-replacement.js +19 -19
- package/dist/safe-bash-docx-engine/images.js +14 -14
- package/dist/safe-bash-docx-engine/index.js +102 -102
- package/dist/safe-bash-docx-engine/inspection.js +15 -15
- package/dist/safe-bash-docx-engine/invocation.js +4 -4
- package/dist/safe-bash-docx-engine/io.js +6 -6
- package/dist/safe-bash-docx-engine/links.js +17 -17
- package/dist/safe-bash-docx-engine/lists.js +16 -16
- package/dist/safe-bash-docx-engine/locations.js +10 -10
- package/dist/safe-bash-docx-engine/notes.js +18 -18
- package/dist/safe-bash-docx-engine/objects.js +14 -14
- package/dist/safe-bash-docx-engine/pack.js +9 -9
- package/dist/safe-bash-docx-engine/package-view-batch-operations.js +19 -19
- package/dist/safe-bash-docx-engine/pandoc-adapter.js +25 -25
- package/dist/safe-bash-docx-engine/paragraph-edit.js +21 -21
- package/dist/safe-bash-docx-engine/publication.js +6 -6
- package/dist/safe-bash-docx-engine/removal.js +16 -16
- package/dist/safe-bash-docx-engine/revision-decisions.js +16 -16
- package/dist/safe-bash-docx-engine/revision-edit.js +15 -15
- package/dist/safe-bash-docx-engine/revisions.js +12 -12
- package/dist/safe-bash-docx-engine/run-format.js +15 -15
- package/dist/safe-bash-docx-engine/sanitize.js +29 -29
- package/dist/safe-bash-docx-engine/sections.js +15 -15
- package/dist/safe-bash-docx-engine/settings.js +6 -6
- package/dist/safe-bash-docx-engine/shape-edit.js +16 -16
- package/dist/safe-bash-docx-engine/signatures.js +11 -11
- package/dist/safe-bash-docx-engine/stories.js +18 -18
- package/dist/safe-bash-docx-engine/structure-model-batch-operations.js +34 -34
- package/dist/safe-bash-docx-engine/style-model-batch-operations.js +24 -24
- package/dist/safe-bash-docx-engine/style-model-result-schema.js +39 -39
- package/dist/safe-bash-docx-engine/styles.js +14 -14
- package/dist/safe-bash-docx-engine/table-edit.js +23 -23
- package/dist/safe-bash-docx-engine/table-read.js +11 -11
- package/dist/safe-bash-docx-engine/template.js +17 -17
- package/dist/safe-bash-docx-engine/text-replace.js +15 -15
- package/dist/safe-bash-docx-engine/text-resource-read.js +11 -11
- package/dist/safe-bash-docx-engine/text.js +11 -11
- package/dist/safe-bash-docx-engine/validation.js +4 -4
- package/dist/safe-bash-docx-engine/xml-parts.js +17 -17
- package/dist/safe-bash-io-engine/commands/text-programs/shared.js +4 -4
- package/dist/safe-bash-line-ending-engine/command.js +3 -3
- package/dist/safe-bash-line-ending-engine/convert.js +2 -2
- package/dist/safe-bash-line-ending-engine/index.js +6 -6
- package/dist/safe-bash-line-ending-engine/info.js +2 -2
- package/dist/safe-bash-markdown-engine/commonmark-blocks.js +4 -4
- package/dist/safe-bash-markdown-engine/commonmark-inlines.js +4 -4
- package/dist/safe-bash-markdown-engine/commonmark-syntax.js +2 -2
- package/dist/safe-bash-markdown-engine/gfm-syntax.js +3 -3
- package/dist/safe-bash-markdown-engine/index.js +5 -5
- package/dist/safe-bash-network-engine/transfer.js +3 -3
- package/dist/safe-bash-presentation-engine/accessibility.js +30 -30
- package/dist/safe-bash-presentation-engine/animation-editing.js +15 -15
- package/dist/safe-bash-presentation-engine/animations.js +15 -15
- package/dist/safe-bash-presentation-engine/backgrounds.js +16 -16
- package/dist/safe-bash-presentation-engine/bytes.js +3 -3
- package/dist/safe-bash-presentation-engine/chart-editing.js +33 -33
- package/dist/safe-bash-presentation-engine/chart-object-operations.js +24 -24
- package/dist/safe-bash-presentation-engine/charts.js +30 -30
- package/dist/safe-bash-presentation-engine/command-placeholder.js +58 -58
- package/dist/safe-bash-presentation-engine/comments.js +16 -16
- package/dist/safe-bash-presentation-engine/connector-operations.js +31 -31
- package/dist/safe-bash-presentation-engine/connectors.js +28 -28
- package/dist/safe-bash-presentation-engine/content-types.js +4 -4
- package/dist/safe-bash-presentation-engine/creation.js +6 -6
- package/dist/safe-bash-presentation-engine/diff.js +31 -31
- package/dist/safe-bash-presentation-engine/drawing-format.js +19 -19
- package/dist/safe-bash-presentation-engine/drawing-operations.js +30 -30
- package/dist/safe-bash-presentation-engine/drawing-schema.js +20 -20
- package/dist/safe-bash-presentation-engine/equations.js +16 -16
- package/dist/safe-bash-presentation-engine/errors.js +2 -2
- package/dist/safe-bash-presentation-engine/fields.js +16 -16
- package/dist/safe-bash-presentation-engine/font-metrics.js +3 -3
- package/dist/safe-bash-presentation-engine/image-extraction.js +19 -19
- package/dist/safe-bash-presentation-engine/image-formatting.js +31 -31
- package/dist/safe-bash-presentation-engine/image-insertion.js +17 -17
- package/dist/safe-bash-presentation-engine/image-replacement.js +20 -20
- package/dist/safe-bash-presentation-engine/image-value.js +4 -4
- package/dist/safe-bash-presentation-engine/images.js +18 -18
- package/dist/safe-bash-presentation-engine/index.js +114 -114
- package/dist/safe-bash-presentation-engine/layouts.js +15 -15
- package/dist/safe-bash-presentation-engine/length.js +3 -3
- package/dist/safe-bash-presentation-engine/links.js +15 -15
- package/dist/safe-bash-presentation-engine/masters.js +14 -14
- package/dist/safe-bash-presentation-engine/media-editing.js +23 -23
- package/dist/safe-bash-presentation-engine/media-extraction.js +16 -16
- package/dist/safe-bash-presentation-engine/media.js +15 -15
- package/dist/safe-bash-presentation-engine/memberships.js +14 -14
- package/dist/safe-bash-presentation-engine/notes.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/notes.js +21 -15
- package/dist/safe-bash-presentation-engine/ole-enum.js +4 -4
- package/dist/safe-bash-presentation-engine/ole-insertion.js +19 -19
- package/dist/safe-bash-presentation-engine/opaque-objects.js +9 -9
- package/dist/safe-bash-presentation-engine/package-reader.js +5 -5
- package/dist/safe-bash-presentation-engine/package-tools.js +18 -18
- package/dist/safe-bash-presentation-engine/package-uri.js +3 -3
- package/dist/safe-bash-presentation-engine/package-writer.js +4 -4
- package/dist/safe-bash-presentation-engine/presentation-model.js +57 -57
- package/dist/safe-bash-presentation-engine/presentation-settings.js +13 -13
- package/dist/safe-bash-presentation-engine/properties.js +15 -15
- package/dist/safe-bash-presentation-engine/relationships.js +4 -4
- package/dist/safe-bash-presentation-engine/resource-limits.js +1 -1
- package/dist/safe-bash-presentation-engine/retained-frame-formatting.d.ts +14 -0
- package/dist/safe-bash-presentation-engine/retained-inspection.js +13 -13
- package/dist/safe-bash-presentation-engine/retained-notes.d.ts +27 -0
- package/dist/safe-bash-presentation-engine/retained-package.js +5 -5
- package/dist/safe-bash-presentation-engine/retained-text.d.ts +9 -2
- package/dist/safe-bash-presentation-engine/retained-text.js +130 -31
- package/dist/safe-bash-presentation-engine/retained-xml-document.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/sanitize.js +16 -16
- package/dist/safe-bash-presentation-engine/selectors.js +10 -10
- package/dist/safe-bash-presentation-engine/shape-groups.js +30 -30
- package/dist/safe-bash-presentation-engine/shape-operations.js +29 -29
- package/dist/safe-bash-presentation-engine/shape-path-operations.js +31 -31
- package/dist/safe-bash-presentation-engine/shape-paths.js +15 -15
- package/dist/safe-bash-presentation-engine/shape-presets.js +3 -3
- package/dist/safe-bash-presentation-engine/shape-selection.js +30 -30
- package/dist/safe-bash-presentation-engine/shape-transforms.js +17 -17
- package/dist/safe-bash-presentation-engine/shapes.js +26 -26
- package/dist/safe-bash-presentation-engine/slide-copy.js +16 -16
- package/dist/safe-bash-presentation-engine/slide-import.js +17 -17
- package/dist/safe-bash-presentation-engine/slide-merge-split.js +19 -19
- package/dist/safe-bash-presentation-engine/slide-model.js +42 -42
- package/dist/safe-bash-presentation-engine/slide-removal.js +17 -17
- package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +9 -9
- package/dist/safe-bash-presentation-engine/slides.js +18 -18
- package/dist/safe-bash-presentation-engine/table-operations.js +32 -32
- package/dist/safe-bash-presentation-engine/table-spans.js +31 -31
- package/dist/safe-bash-presentation-engine/tables.js +30 -30
- package/dist/safe-bash-presentation-engine/tags.js +15 -15
- package/dist/safe-bash-presentation-engine/template-bindings.js +32 -32
- package/dist/safe-bash-presentation-engine/template-repeat.js +39 -39
- package/dist/safe-bash-presentation-engine/text-fitting.js +26 -26
- package/dist/safe-bash-presentation-engine/text-frames.d.ts +13 -0
- package/dist/safe-bash-presentation-engine/text-frames.js +28 -26
- package/dist/safe-bash-presentation-engine/text-paragraphs.js +26 -26
- package/dist/safe-bash-presentation-engine/text-reading.js +11 -11
- package/dist/safe-bash-presentation-engine/text-replacement.js +16 -16
- package/dist/safe-bash-presentation-engine/text-runs.js +19 -19
- package/dist/safe-bash-presentation-engine/themes.js +15 -15
- package/dist/safe-bash-presentation-engine/transitions.js +15 -15
- package/dist/safe-bash-presentation-engine/validation.js +9 -9
- package/dist/safe-bash-presentation-engine/xml-parts.js +18 -18
- package/dist/safe-bash-presentation-engine/xml-view.js +3 -3
- package/dist/safe-bash-presentation-engine/xml.js +3 -3
- package/dist/safe-bash-query-engine/index.js +4 -4
- package/dist/safe-bash-query-engine/interpreter.js +2 -2
- package/dist/safe-bash-query-engine/query-core.js +4 -4
- package/dist/safe-bash-xml-engine/document.js +3 -3
- package/dist/safe-bash-xml-engine/evaluate.js +1 -1
- package/dist/safe-bash-xml-engine/index.js +6 -6
- package/dist/safe-bash-xml-engine/query.js +2 -2
- package/dist/safe-bash-xml-engine/stored-document.d.ts +2 -2
- package/dist/safe-bash-xml-engine/stored-document.js +1 -1
- package/dist/safe-bash-xml-engine/stored-evaluate.js +1 -1
- package/dist/safe-bash-zip-engine/zip/repair.js +3 -3
- package/dist/safe-bash-zip-engine/zip/volumes.js +3 -3
- package/dist/spreadsheet-engine/datasource.js +16 -2
- package/dist/spreadsheet-engine/formulas/diagnostics.d.ts +2 -1
- package/dist/spreadsheet-engine/formulas/diagnostics.js +2 -2
- package/dist/spreadsheet-engine/formulas/evaluator.d.ts +1 -1
- package/dist/spreadsheet-engine/formulas/evaluator.js +2 -1
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.js +7 -6
- package/dist/spreadsheet-format-xls/biff-properties-merge.js +41 -22
- package/dist/spreadsheet-format-xls/biff-properties.js +94 -109
- package/dist/spreadsheet-format-xls/biff-property-dictionary.d.ts +5 -0
- package/dist/spreadsheet-format-xls/biff-property-dictionary.js +75 -0
- package/dist/spreadsheet-format-xls/biff-property-range.d.ts +17 -3
- package/dist/spreadsheet-format-xls/biff-property-range.js +178 -37
- package/dist/spreadsheet-format-xls/biff-property-values.d.ts +31 -0
- package/dist/spreadsheet-format-xls/biff-property-values.js +158 -0
- package/package.json +5 -2
- package/dist/safe-bash/command-chunks/biff-4ALVARRF-7SRX6R6N.js +0 -5192
- package/dist/safe-bash/command-chunks/chunk-63EMPQ7Z.js +0 -115
- package/dist/safe-bash/command-chunks/{chunk-X2HVVMTW.js → chunk-AW4Q3GZW.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-JC2EV66U.js → chunk-BJXADHRT.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-XI2LETBJ.js → chunk-BXU5Y7I5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-PVLPWVRH.js → chunk-D3HW7R2N.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-OLK3DCJD.js → chunk-DYERIXPU.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-WYBCSJFG.js → chunk-FWCUEZ3K.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FF2SQ2GP.js → chunk-GGH376XQ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-D66Q7QJ3.js → chunk-JRSZ5IGD.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-3JST2Q7G.js → chunk-KRRG4MGH.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-Z3YB4EVE.js → chunk-KSM5CCHT.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-NJ4NTTCR.js → chunk-LNLACEAN.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-NBTG6NF6.js → chunk-LTJRUMK6.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-XCYTG7CR.js → chunk-NJGL5JQ6.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-SZ66JC25.js → chunk-Q7J2NTH2.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-MDV7W5AS.js → chunk-SKNI2XQA.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-7ZWACKCG.js → chunk-T6OXG7QQ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-ECDEPKKW.js → chunk-W25EIKDJ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-4YSBUQPV.js → chunk-W2FKFEVY.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-2CIDPOUV.js → chunk-WSNHJZQ5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-4H3TYOVC.js → chunk-Y7AXMCFV.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-U6IEK2CI.js → chunk-YPG55QTP.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-252L5YC5.js → chunk-Z37OM247.js} +6 -6
- package/dist/safe-bash/command-chunks/{pln-DFS7VLVS-JATX6FS7.js → pln-DFS7VLVS-OVOBS4QX.js} +3 -3
- package/dist/safe-bash/command-chunks/{psion-YBI6JEQI-6OMC2PGC.js → psion-YBI6JEQI-GY4S6ZLC.js} +3 -3
|
@@ -26,6 +26,13 @@ var HtmlError = class extends Error {
|
|
|
26
26
|
offset;
|
|
27
27
|
resource;
|
|
28
28
|
};
|
|
29
|
+
var HtmlCancellationError = class extends HtmlError {
|
|
30
|
+
constructor(signal) {
|
|
31
|
+
super("E_CANCELLED", "HTML invocation cancelled");
|
|
32
|
+
this.signal = signal;
|
|
33
|
+
}
|
|
34
|
+
signal;
|
|
35
|
+
};
|
|
29
36
|
var htmlqBaseline = Object.freeze({
|
|
30
37
|
commit: "bfcb1d1d11a80fdd92c0dace1e7e559fbdb225cb",
|
|
31
38
|
version: "0.5.0",
|
|
@@ -80,7 +87,7 @@ var HtmlBudget = class {
|
|
|
80
87
|
ledger;
|
|
81
88
|
check() {
|
|
82
89
|
if (this.options.signal.aborted)
|
|
83
|
-
throw new
|
|
90
|
+
throw new HtmlCancellationError(this.options.signal);
|
|
84
91
|
}
|
|
85
92
|
bound(resource, amount) {
|
|
86
93
|
this.check();
|
|
@@ -575,180 +582,7 @@ function asciiLetter(c) {
|
|
|
575
582
|
return c >= "A" && c <= "Z" || c >= "a" && c <= "z";
|
|
576
583
|
}
|
|
577
584
|
|
|
578
|
-
// packages/safe-bash-command-htmlq/src/tree.ts
|
|
579
|
-
function allSpace(data) {
|
|
580
|
-
for (const c of data) if (!(0, entities_exports.htmlSpace)(c)) return false;
|
|
581
|
-
return true;
|
|
582
|
-
}
|
|
583
|
-
var kNode = /* @__PURE__ */ Symbol("node");
|
|
584
|
-
var kOwner = /* @__PURE__ */ Symbol("owner");
|
|
585
|
-
var owners = {
|
|
586
|
-
get(node) {
|
|
587
|
-
return node[kOwner] ?? node._owner;
|
|
588
|
-
},
|
|
589
|
-
set(node, owner) {
|
|
590
|
-
node._owner = owner;
|
|
591
|
-
}
|
|
592
|
-
};
|
|
593
|
-
var internals = {
|
|
594
|
-
has(node) {
|
|
595
|
-
return Boolean(node[kNode]);
|
|
596
|
-
},
|
|
597
|
-
get(node) {
|
|
598
|
-
return node[kNode];
|
|
599
|
-
}
|
|
600
|
-
};
|
|
601
|
-
function getInternalHtmlNode(node) {
|
|
602
|
-
if (!node || typeof node !== "object") throw new HtmlError("E_OWNERSHIP", "Unowned HTML node");
|
|
603
|
-
return internals.get(node);
|
|
604
|
-
}
|
|
605
|
-
function getPublicHtmlView(node) {
|
|
606
|
-
let view = node._view;
|
|
607
|
-
if (!view) {
|
|
608
|
-
const v = Object.create(publicViewProto);
|
|
609
|
-
v[kNode] = node;
|
|
610
|
-
v[kOwner] = node._owner;
|
|
611
|
-
Object.freeze(v);
|
|
612
|
-
view = v;
|
|
613
|
-
node._view = view;
|
|
614
|
-
}
|
|
615
|
-
return view;
|
|
616
|
-
}
|
|
617
|
-
var views = {
|
|
618
|
-
get(node) {
|
|
619
|
-
return getPublicHtmlView(node);
|
|
620
|
-
}
|
|
621
|
-
};
|
|
622
|
-
var childViews = {
|
|
623
|
-
get(node) {
|
|
624
|
-
return node._childViews;
|
|
625
|
-
},
|
|
626
|
-
set(node, cv) {
|
|
627
|
-
node._childViews = cv;
|
|
628
|
-
}
|
|
629
|
-
};
|
|
630
|
-
var publicViewProto = {};
|
|
631
|
-
for (const key of ["kind", "name", "data", "namespace"]) {
|
|
632
|
-
Object.defineProperty(publicViewProto, key, {
|
|
633
|
-
enumerable: true,
|
|
634
|
-
get() {
|
|
635
|
-
return this[kNode][key];
|
|
636
|
-
}
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
|
-
Object.defineProperty(publicViewProto, "attributes", {
|
|
640
|
-
enumerable: true,
|
|
641
|
-
get() {
|
|
642
|
-
const n = this[kNode];
|
|
643
|
-
if (!n._attrsFrozen) {
|
|
644
|
-
for (const attribute2 of n.attributes) Object.freeze(attribute2);
|
|
645
|
-
Object.freeze(n.attributes);
|
|
646
|
-
n._attrsFrozen = true;
|
|
647
|
-
}
|
|
648
|
-
return n.attributes;
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
Object.defineProperty(publicViewProto, "children", {
|
|
652
|
-
enumerable: true,
|
|
653
|
-
get() {
|
|
654
|
-
const n = this[kNode];
|
|
655
|
-
let cv = n._childViews;
|
|
656
|
-
if (!cv) {
|
|
657
|
-
cv = Object.freeze(n.children.map((child) => getPublicHtmlView(child)));
|
|
658
|
-
n._childViews = cv;
|
|
659
|
-
}
|
|
660
|
-
return cv;
|
|
661
|
-
}
|
|
662
|
-
});
|
|
663
|
-
for (const key of ["parent", "previousSibling", "nextSibling", "templateContents"]) {
|
|
664
|
-
Object.defineProperty(publicViewProto, key, {
|
|
665
|
-
enumerable: true,
|
|
666
|
-
get() {
|
|
667
|
-
const n = this[kNode][key];
|
|
668
|
-
return n ? getPublicHtmlView(n) : n;
|
|
669
|
-
}
|
|
670
|
-
});
|
|
671
|
-
}
|
|
672
|
-
Object.freeze(publicViewProto);
|
|
673
|
-
function expose(document, budget) {
|
|
674
|
-
const pending = [{ node: document, depth: 0 }];
|
|
675
|
-
const docOwner = owners.get(document);
|
|
676
|
-
while (pending.length) {
|
|
677
|
-
const { node, depth } = pending.pop();
|
|
678
|
-
budget.bound("depth", depth);
|
|
679
|
-
budget.charge("work", 1);
|
|
680
|
-
budget.charge("retainedBytes", 128 + node.children.length * 8);
|
|
681
|
-
node._owner = docOwner;
|
|
682
|
-
for (const child of node.children) pending.push({ node: child, depth: depth + 1 });
|
|
683
|
-
if (node.templateContents) pending.push({ node: node.templateContents, depth: depth + 1 });
|
|
684
|
-
}
|
|
685
|
-
return getPublicHtmlView(document);
|
|
686
|
-
}
|
|
687
|
-
function ownsHtmlNode(node) {
|
|
688
|
-
return internals.has(node);
|
|
689
|
-
}
|
|
690
|
-
function originalSource(node) {
|
|
691
|
-
const owner = owners.get(node);
|
|
692
|
-
if (!owner) throw new HtmlError("E_OWNERSHIP", "Node is not owned by this HTML engine");
|
|
693
|
-
if (node.kind !== "document")
|
|
694
|
-
throw new HtmlError(
|
|
695
|
-
"E_UNSUPPORTED",
|
|
696
|
-
"Original serialization is defined only for a complete document"
|
|
697
|
-
);
|
|
698
|
-
if (owner.mutated)
|
|
699
|
-
throw new HtmlError("E_MUTATED", "Original source does not represent the mutated tree");
|
|
700
|
-
if (owner.source === void 0) throw new HtmlError("E_UNSUPPORTED", "Original source was not retained");
|
|
701
|
-
return owner.source;
|
|
702
|
-
}
|
|
703
|
-
function unlink(node) {
|
|
704
|
-
const parent = node.parent;
|
|
705
|
-
if (!parent) return;
|
|
706
|
-
const index = parent.children.indexOf(node);
|
|
707
|
-
if (index < 0) throw new HtmlError("E_OWNERSHIP", "Inconsistent parent link");
|
|
708
|
-
if (node.previousSibling) node.previousSibling.nextSibling = node.nextSibling;
|
|
709
|
-
if (node.nextSibling) node.nextSibling.previousSibling = node.previousSibling;
|
|
710
|
-
parent.children.splice(index, 1);
|
|
711
|
-
node.parent = null;
|
|
712
|
-
node.previousSibling = null;
|
|
713
|
-
node.nextSibling = null;
|
|
714
|
-
}
|
|
715
|
-
function detachHtmlNode(node, options) {
|
|
716
|
-
const budget = new HtmlBudget(options);
|
|
717
|
-
const owner = owners.get(node);
|
|
718
|
-
if (!owner) throw new HtmlError("E_OWNERSHIP", "Unowned node");
|
|
719
|
-
const internal = internals.get(node);
|
|
720
|
-
if (!internal) throw new HtmlError("E_OWNERSHIP", "Unowned node");
|
|
721
|
-
const parent = internal.parent;
|
|
722
|
-
budget.charge("work", parent?.children.length ?? 1);
|
|
723
|
-
budget.charge("retainedBytes", (parent?.children.length ?? 0) * 8);
|
|
724
|
-
unlink(internal);
|
|
725
|
-
if (parent)
|
|
726
|
-
childViews.set(parent, Object.freeze(parent.children.map((child) => views.get(child))));
|
|
727
|
-
owner.mutated = true;
|
|
728
|
-
}
|
|
729
|
-
function replaceHtmlAttribute(node, name, value, options) {
|
|
730
|
-
const budget = new HtmlBudget(options);
|
|
731
|
-
const internal = internals.get(node), owner = owners.get(node);
|
|
732
|
-
if (!internal || !owner) throw new HtmlError("E_OWNERSHIP", "Unowned node");
|
|
733
|
-
budget.charge("work", internal.attributes.length + value.length);
|
|
734
|
-
budget.charge("retainedBytes", internal.attributes.length * 64 + value.length * 2);
|
|
735
|
-
if (!internal.attributes.some((a) => a.namespace === "none" && a.name === name)) return;
|
|
736
|
-
internal.attributes = Object.freeze(internal.attributes.map((a) => a.namespace === "none" && a.name === name ? Object.freeze({ ...a, value }) : a));
|
|
737
|
-
owner.mutated = true;
|
|
738
|
-
}
|
|
739
|
-
function attach(parent, node, before) {
|
|
740
|
-
unlink(node);
|
|
741
|
-
const index = before ? parent.children.indexOf(before) : parent.children.length;
|
|
742
|
-
if (index < 0) throw new HtmlError("E_OWNERSHIP", "Insertion reference has another parent");
|
|
743
|
-
const previous2 = parent.children[index - 1] ?? null;
|
|
744
|
-
const next = parent.children[index] ?? null;
|
|
745
|
-
node.parent = parent;
|
|
746
|
-
node.previousSibling = previous2;
|
|
747
|
-
node.nextSibling = next;
|
|
748
|
-
if (previous2) previous2.nextSibling = node;
|
|
749
|
-
if (next) next.previousSibling = node;
|
|
750
|
-
parent.children.splice(index, 0, node);
|
|
751
|
-
}
|
|
585
|
+
// packages/safe-bash-command-htmlq/src/tree-rules.ts
|
|
752
586
|
var formatting = /* @__PURE__ */ new Set([
|
|
753
587
|
"a",
|
|
754
588
|
"b",
|
|
@@ -935,54 +769,229 @@ var svgAttributes = Object.fromEntries(
|
|
|
935
769
|
"zoomAndPan"
|
|
936
770
|
].map((name) => [name.toLowerCase(), name])
|
|
937
771
|
);
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
first = false;
|
|
953
|
-
if (character === "\uFEFF") continue;
|
|
954
|
-
}
|
|
955
|
-
if (carriage && character === "\n") {
|
|
956
|
-
carriage = false;
|
|
957
|
-
continue;
|
|
958
|
-
}
|
|
959
|
-
carriage = character === "\r";
|
|
960
|
-
text += carriage ? "\n" : character;
|
|
961
|
-
}
|
|
962
|
-
yield text;
|
|
963
|
-
}
|
|
772
|
+
|
|
773
|
+
// packages/safe-bash-command-htmlq/src/tree.ts
|
|
774
|
+
function allSpace(data) {
|
|
775
|
+
for (const c of data) if (!(0, entities_exports.htmlSpace)(c)) return false;
|
|
776
|
+
return true;
|
|
777
|
+
}
|
|
778
|
+
var kNode = /* @__PURE__ */ Symbol("node");
|
|
779
|
+
var kOwner = /* @__PURE__ */ Symbol("owner");
|
|
780
|
+
var owners = {
|
|
781
|
+
get(node) {
|
|
782
|
+
return node[kOwner] ?? node._owner;
|
|
783
|
+
},
|
|
784
|
+
set(node, owner) {
|
|
785
|
+
node._owner = owner;
|
|
964
786
|
}
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
failure = { error };
|
|
787
|
+
};
|
|
788
|
+
var internals = {
|
|
789
|
+
has(node) {
|
|
790
|
+
return Boolean(node[kNode]);
|
|
791
|
+
},
|
|
792
|
+
get(node) {
|
|
793
|
+
return node[kNode];
|
|
973
794
|
}
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
795
|
+
};
|
|
796
|
+
function getInternalHtmlNode(node) {
|
|
797
|
+
if (!node || typeof node !== "object") throw new HtmlError("E_OWNERSHIP", "Unowned HTML node");
|
|
798
|
+
return internals.get(node);
|
|
799
|
+
}
|
|
800
|
+
function getPublicHtmlView(node) {
|
|
801
|
+
let view = node._view;
|
|
802
|
+
if (!view) {
|
|
803
|
+
const v = Object.create(publicViewProto);
|
|
804
|
+
v[kNode] = node;
|
|
805
|
+
v[kOwner] = node._owner;
|
|
806
|
+
Object.freeze(v);
|
|
807
|
+
view = v;
|
|
808
|
+
node._view = view;
|
|
979
809
|
}
|
|
980
|
-
|
|
981
|
-
return step.value;
|
|
810
|
+
return view;
|
|
982
811
|
}
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
812
|
+
var views = {
|
|
813
|
+
get(node) {
|
|
814
|
+
return getPublicHtmlView(node);
|
|
815
|
+
}
|
|
816
|
+
};
|
|
817
|
+
var childViews = {
|
|
818
|
+
get(node) {
|
|
819
|
+
return node._childViews;
|
|
820
|
+
},
|
|
821
|
+
set(node, cv) {
|
|
822
|
+
node._childViews = cv;
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
var publicViewProto = {};
|
|
826
|
+
for (const key of ["kind", "name", "data", "namespace"]) {
|
|
827
|
+
Object.defineProperty(publicViewProto, key, {
|
|
828
|
+
enumerable: true,
|
|
829
|
+
get() {
|
|
830
|
+
return this[kNode][key];
|
|
831
|
+
}
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
Object.defineProperty(publicViewProto, "attributes", {
|
|
835
|
+
enumerable: true,
|
|
836
|
+
get() {
|
|
837
|
+
const n = this[kNode];
|
|
838
|
+
if (!n._attrsFrozen) {
|
|
839
|
+
for (const attribute2 of n.attributes) Object.freeze(attribute2);
|
|
840
|
+
Object.freeze(n.attributes);
|
|
841
|
+
n._attrsFrozen = true;
|
|
842
|
+
}
|
|
843
|
+
return n.attributes;
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
Object.defineProperty(publicViewProto, "children", {
|
|
847
|
+
enumerable: true,
|
|
848
|
+
get() {
|
|
849
|
+
const n = this[kNode];
|
|
850
|
+
let cv = n._childViews;
|
|
851
|
+
if (!cv) {
|
|
852
|
+
cv = Object.freeze(n.children.map((child) => getPublicHtmlView(child)));
|
|
853
|
+
n._childViews = cv;
|
|
854
|
+
}
|
|
855
|
+
return cv;
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
for (const key of ["parent", "previousSibling", "nextSibling", "templateContents"]) {
|
|
859
|
+
Object.defineProperty(publicViewProto, key, {
|
|
860
|
+
enumerable: true,
|
|
861
|
+
get() {
|
|
862
|
+
const n = this[kNode][key];
|
|
863
|
+
return n ? getPublicHtmlView(n) : n;
|
|
864
|
+
}
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
Object.freeze(publicViewProto);
|
|
868
|
+
function expose(document, budget) {
|
|
869
|
+
const pending = [{ node: document, depth: 0 }];
|
|
870
|
+
const docOwner = owners.get(document);
|
|
871
|
+
while (pending.length) {
|
|
872
|
+
const { node, depth } = pending.pop();
|
|
873
|
+
budget.bound("depth", depth);
|
|
874
|
+
budget.charge("work", 1);
|
|
875
|
+
budget.charge("retainedBytes", 128 + node.children.length * 8);
|
|
876
|
+
node._owner = docOwner;
|
|
877
|
+
for (const child of node.children) pending.push({ node: child, depth: depth + 1 });
|
|
878
|
+
if (node.templateContents) pending.push({ node: node.templateContents, depth: depth + 1 });
|
|
879
|
+
}
|
|
880
|
+
return getPublicHtmlView(document);
|
|
881
|
+
}
|
|
882
|
+
function ownsHtmlNode(node) {
|
|
883
|
+
return internals.has(node);
|
|
884
|
+
}
|
|
885
|
+
function originalSource(node) {
|
|
886
|
+
const owner = owners.get(node);
|
|
887
|
+
if (!owner) throw new HtmlError("E_OWNERSHIP", "Node is not owned by this HTML engine");
|
|
888
|
+
if (node.kind !== "document")
|
|
889
|
+
throw new HtmlError(
|
|
890
|
+
"E_UNSUPPORTED",
|
|
891
|
+
"Original serialization is defined only for a complete document"
|
|
892
|
+
);
|
|
893
|
+
if (owner.mutated)
|
|
894
|
+
throw new HtmlError("E_MUTATED", "Original source does not represent the mutated tree");
|
|
895
|
+
if (owner.source === void 0) throw new HtmlError("E_UNSUPPORTED", "Original source was not retained");
|
|
896
|
+
return owner.source;
|
|
897
|
+
}
|
|
898
|
+
function unlink(node) {
|
|
899
|
+
const parent = node.parent;
|
|
900
|
+
if (!parent) return;
|
|
901
|
+
const index = parent.children.indexOf(node);
|
|
902
|
+
if (index < 0) throw new HtmlError("E_OWNERSHIP", "Inconsistent parent link");
|
|
903
|
+
if (node.previousSibling) node.previousSibling.nextSibling = node.nextSibling;
|
|
904
|
+
if (node.nextSibling) node.nextSibling.previousSibling = node.previousSibling;
|
|
905
|
+
parent.children.splice(index, 1);
|
|
906
|
+
node.parent = null;
|
|
907
|
+
node.previousSibling = null;
|
|
908
|
+
node.nextSibling = null;
|
|
909
|
+
}
|
|
910
|
+
function detachHtmlNode(node, options) {
|
|
911
|
+
const budget = new HtmlBudget(options);
|
|
912
|
+
const owner = owners.get(node);
|
|
913
|
+
if (!owner) throw new HtmlError("E_OWNERSHIP", "Unowned node");
|
|
914
|
+
const internal = internals.get(node);
|
|
915
|
+
if (!internal) throw new HtmlError("E_OWNERSHIP", "Unowned node");
|
|
916
|
+
const parent = internal.parent;
|
|
917
|
+
budget.charge("work", parent?.children.length ?? 1);
|
|
918
|
+
budget.charge("retainedBytes", (parent?.children.length ?? 0) * 8);
|
|
919
|
+
unlink(internal);
|
|
920
|
+
if (parent)
|
|
921
|
+
childViews.set(parent, Object.freeze(parent.children.map((child) => views.get(child))));
|
|
922
|
+
owner.mutated = true;
|
|
923
|
+
}
|
|
924
|
+
function replaceHtmlAttribute(node, name, value, options) {
|
|
925
|
+
const budget = new HtmlBudget(options);
|
|
926
|
+
const internal = internals.get(node), owner = owners.get(node);
|
|
927
|
+
if (!internal || !owner) throw new HtmlError("E_OWNERSHIP", "Unowned node");
|
|
928
|
+
budget.charge("work", internal.attributes.length + value.length);
|
|
929
|
+
budget.charge("retainedBytes", internal.attributes.length * 64 + value.length * 2);
|
|
930
|
+
if (!internal.attributes.some((a) => a.namespace === "none" && a.name === name)) return;
|
|
931
|
+
internal.attributes = Object.freeze(internal.attributes.map((a) => a.namespace === "none" && a.name === name ? Object.freeze({ ...a, value }) : a));
|
|
932
|
+
owner.mutated = true;
|
|
933
|
+
}
|
|
934
|
+
function attach(parent, node, before) {
|
|
935
|
+
unlink(node);
|
|
936
|
+
const index = before ? parent.children.indexOf(before) : parent.children.length;
|
|
937
|
+
if (index < 0) throw new HtmlError("E_OWNERSHIP", "Insertion reference has another parent");
|
|
938
|
+
const previous2 = parent.children[index - 1] ?? null;
|
|
939
|
+
const next = parent.children[index] ?? null;
|
|
940
|
+
node.parent = parent;
|
|
941
|
+
node.previousSibling = previous2;
|
|
942
|
+
node.nextSibling = next;
|
|
943
|
+
if (previous2) previous2.nextSibling = node;
|
|
944
|
+
if (next) next.previousSibling = node;
|
|
945
|
+
parent.children.splice(index, 0, node);
|
|
946
|
+
}
|
|
947
|
+
async function parseHtml(source, options, originalSource2 = "retain") {
|
|
948
|
+
const budget = new HtmlBudget(options);
|
|
949
|
+
const owner = { source: originalSource2 === "retain" ? "" : void 0, mutated: false };
|
|
950
|
+
async function* normalized() {
|
|
951
|
+
let first = true, carriage = false;
|
|
952
|
+
for await (const original of decodedHtml(source, options)) {
|
|
953
|
+
if (owner.source !== void 0) {
|
|
954
|
+
budget.charge("retainedBytes", original.length * 2);
|
|
955
|
+
owner.source += original;
|
|
956
|
+
}
|
|
957
|
+
let text = "";
|
|
958
|
+
for (const character of original) {
|
|
959
|
+
budget.charge("work", 1);
|
|
960
|
+
if (first) {
|
|
961
|
+
first = false;
|
|
962
|
+
if (character === "\uFEFF") continue;
|
|
963
|
+
}
|
|
964
|
+
if (carriage && character === "\n") {
|
|
965
|
+
carriage = false;
|
|
966
|
+
continue;
|
|
967
|
+
}
|
|
968
|
+
carriage = character === "\r";
|
|
969
|
+
text += carriage ? "\n" : character;
|
|
970
|
+
}
|
|
971
|
+
yield text;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
const tokenizer = new StreamingHtmlTokenizer(normalized(), budget);
|
|
975
|
+
const tree = buildTree(owner, budget);
|
|
976
|
+
let step = tree.next();
|
|
977
|
+
let failure;
|
|
978
|
+
try {
|
|
979
|
+
while (!step.done) step = tree.next(await tokenizer.next(step.value.raw, step.value.foreign));
|
|
980
|
+
} catch (error) {
|
|
981
|
+
failure = { error };
|
|
982
|
+
}
|
|
983
|
+
try {
|
|
984
|
+
await tokenizer.close();
|
|
985
|
+
} catch (error) {
|
|
986
|
+
if (failure) throw new AggregateError([failure.error, error], "HTML input and cleanup failed");
|
|
987
|
+
throw error;
|
|
988
|
+
}
|
|
989
|
+
if (failure) throw failure.error;
|
|
990
|
+
return step.value;
|
|
991
|
+
}
|
|
992
|
+
async function* decodedHtml(source, options) {
|
|
993
|
+
const budget = new HtmlBudget(options);
|
|
994
|
+
const decoder = new TextDecoder("utf-8", { fatal: false, ignoreBOM: true });
|
|
986
995
|
const iterator = source[Symbol.asyncIterator]();
|
|
987
996
|
let complete = false, sinceYield = 0;
|
|
988
997
|
let failed = false;
|
|
@@ -998,7 +1007,7 @@ async function* decodedHtml(source, options) {
|
|
|
998
1007
|
}
|
|
999
1008
|
};
|
|
1000
1009
|
const abort = () => {
|
|
1001
|
-
throw new
|
|
1010
|
+
throw new HtmlCancellationError(options.signal);
|
|
1002
1011
|
};
|
|
1003
1012
|
try {
|
|
1004
1013
|
while (true) {
|
|
@@ -1011,7 +1020,7 @@ async function* decodedHtml(source, options) {
|
|
|
1011
1020
|
let listener = () => {
|
|
1012
1021
|
};
|
|
1013
1022
|
const cancellation = new Promise((_, reject) => {
|
|
1014
|
-
listener = () => reject(new
|
|
1023
|
+
listener = () => reject(new HtmlCancellationError(options.signal));
|
|
1015
1024
|
options.signal.addEventListener("abort", listener, { once: true });
|
|
1016
1025
|
});
|
|
1017
1026
|
let result;
|
|
@@ -1813,7 +1822,7 @@ function asciiLower3(s) {
|
|
|
1813
1822
|
}
|
|
1814
1823
|
return changed ? out : s;
|
|
1815
1824
|
}
|
|
1816
|
-
var
|
|
1825
|
+
var SelectorParser = class {
|
|
1817
1826
|
constructor(source, budget) {
|
|
1818
1827
|
this.source = source;
|
|
1819
1828
|
this.budget = budget;
|
|
@@ -1863,8 +1872,8 @@ var Parser = class {
|
|
|
1863
1872
|
} else {
|
|
1864
1873
|
if (!this.peek() || this.peek() === "\n" || this.peek() === "\r" || this.peek() === "\f")
|
|
1865
1874
|
this.fail();
|
|
1866
|
-
const
|
|
1867
|
-
out +=
|
|
1875
|
+
const escaped3 = this.take();
|
|
1876
|
+
out += escaped3 === "\0" ? "\uFFFD" : escaped3;
|
|
1868
1877
|
}
|
|
1869
1878
|
} else if (c === "-" || c === "_" || c === "\0" || c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c.charCodeAt(0) >= 128)
|
|
1870
1879
|
out += this.take() === "\0" ? "\uFFFD" : c;
|
|
@@ -1892,8 +1901,8 @@ var Parser = class {
|
|
|
1892
1901
|
} else if (this.peek() === "\n" || this.peek() === "\r" || this.peek() === "\f")
|
|
1893
1902
|
this.escapeWhitespace();
|
|
1894
1903
|
else if (this.peek()) {
|
|
1895
|
-
const
|
|
1896
|
-
out +=
|
|
1904
|
+
const escaped3 = this.take();
|
|
1905
|
+
out += escaped3 === "\0" ? "\uFFFD" : escaped3;
|
|
1897
1906
|
} else this.fail();
|
|
1898
1907
|
} else {
|
|
1899
1908
|
if (this.peek() === "\n" || this.peek() === "\r" || this.peek() === "\f") this.fail();
|
|
@@ -2201,7 +2210,7 @@ function matchesProgram(node, program, budget) {
|
|
|
2201
2210
|
}
|
|
2202
2211
|
function selectHtml(root, selector, options) {
|
|
2203
2212
|
const budget = new HtmlBudget(options);
|
|
2204
|
-
const program = new
|
|
2213
|
+
const program = new SelectorParser(selector, budget).list();
|
|
2205
2214
|
const internalRoot = getInternalHtmlNode(root);
|
|
2206
2215
|
if (!internalRoot) throw new HtmlError("E_OWNERSHIP", "Unowned HTML node");
|
|
2207
2216
|
return (function* () {
|
|
@@ -2691,77 +2700,1481 @@ import { FsError } from "../safe-bash-contracts/errors.js";
|
|
|
2691
2700
|
import { writeBytes } from "../safe-bash-contracts/io.js";
|
|
2692
2701
|
import { createOutputOperation } from "../safe-bash-contracts/output.js";
|
|
2693
2702
|
import { shellValueByteLength } from "../safe-bash-contracts/value.js";
|
|
2703
|
+
import { PagedStorage } from "@poe-platform/safe-fs/storage";
|
|
2694
2704
|
|
|
2695
|
-
// packages/safe-bash-command-htmlq/src/
|
|
2696
|
-
import {
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
);
|
|
2717
|
-
if (
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2705
|
+
// packages/safe-bash-command-htmlq/src/stored-project.ts
|
|
2706
|
+
import { TextStore } from "../safe-bash-command-html-to-markdown/stored-text.js";
|
|
2707
|
+
import { yieldTurn as yieldTurn3 } from "../safe-bash-contracts/yield.js";
|
|
2708
|
+
|
|
2709
|
+
// packages/safe-bash-command-htmlq/src/document-store.ts
|
|
2710
|
+
var kinds = ["document", "fragment", "element", "text", "comment", "doctype"];
|
|
2711
|
+
var namespaces = ["html", "svg", "mathml"];
|
|
2712
|
+
var attributeNamespaces = ["none", "xml", "xmlns", "xlink"];
|
|
2713
|
+
var fields = ["name", "data", "parent", "first", "last", "previous", "next", "templateContents", "firstAttribute", "lastAttribute", "childCount", "attributeCount"];
|
|
2714
|
+
var DocumentStore = class {
|
|
2715
|
+
constructor(storage, cooperate) {
|
|
2716
|
+
this.storage = storage;
|
|
2717
|
+
this.cooperate = cooperate;
|
|
2718
|
+
}
|
|
2719
|
+
storage;
|
|
2720
|
+
cooperate;
|
|
2721
|
+
nodes = /* @__PURE__ */ new Map();
|
|
2722
|
+
get residentNodes() {
|
|
2723
|
+
return this.nodes.size;
|
|
2724
|
+
}
|
|
2725
|
+
retain(node) {
|
|
2726
|
+
this.nodes.delete(node.id);
|
|
2727
|
+
if (this.nodes.size === 512) this.nodes.delete(this.nodes.keys().next().value);
|
|
2728
|
+
this.nodes.set(node.id, node);
|
|
2729
|
+
}
|
|
2730
|
+
async create(kind, values = {}) {
|
|
2731
|
+
const bytes = new Uint8Array(112), view = new DataView(bytes.buffer);
|
|
2732
|
+
view.setFloat64(0, kinds.indexOf(kind), true);
|
|
2733
|
+
view.setFloat64(8, namespaces.indexOf(values.namespace ?? "html"), true);
|
|
2734
|
+
for (const [index, field] of fields.entries()) view.setFloat64(16 + index * 8, values[field] ?? 0, true);
|
|
2735
|
+
return this.storage.append(bytes);
|
|
2736
|
+
}
|
|
2737
|
+
async read(id) {
|
|
2738
|
+
const checkpoint = this.cooperate?.();
|
|
2739
|
+
if (checkpoint) await checkpoint;
|
|
2740
|
+
if (!id) throw new HtmlError("E_OWNERSHIP", "Absent stored HTML node");
|
|
2741
|
+
const cached = this.nodes.get(id);
|
|
2742
|
+
if (cached) {
|
|
2743
|
+
this.retain(cached);
|
|
2744
|
+
return { ...cached };
|
|
2725
2745
|
}
|
|
2726
|
-
const
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2746
|
+
const bytes = await this.storage.read(id, 112), view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
2747
|
+
const node = { id, kind: kinds[view.getFloat64(0, true)], namespace: namespaces[view.getFloat64(8, true)] };
|
|
2748
|
+
for (const [index, field] of fields.entries()) node[field] = view.getFloat64(16 + index * 8, true);
|
|
2749
|
+
this.retain(node);
|
|
2750
|
+
return { ...node };
|
|
2751
|
+
}
|
|
2752
|
+
async patch(id, values) {
|
|
2753
|
+
const node = { ...await this.read(id), ...values };
|
|
2754
|
+
const bytes = new Uint8Array(112), view = new DataView(bytes.buffer);
|
|
2755
|
+
view.setFloat64(0, kinds.indexOf(node.kind), true);
|
|
2756
|
+
view.setFloat64(8, namespaces.indexOf(node.namespace), true);
|
|
2757
|
+
for (const [index, field] of fields.entries()) view.setFloat64(16 + index * 8, node[field], true);
|
|
2758
|
+
this.nodes.delete(id);
|
|
2759
|
+
await this.storage.write(id, bytes);
|
|
2760
|
+
this.retain(node);
|
|
2761
|
+
}
|
|
2762
|
+
async detach(id) {
|
|
2763
|
+
const node = await this.read(id);
|
|
2764
|
+
if (!node.parent) return;
|
|
2765
|
+
const parent = await this.read(node.parent);
|
|
2766
|
+
if (node.previous) await this.patch(node.previous, { next: node.next });
|
|
2767
|
+
if (node.next) await this.patch(node.next, { previous: node.previous });
|
|
2768
|
+
await this.patch(parent.id, {
|
|
2769
|
+
first: parent.first === id ? node.next : parent.first,
|
|
2770
|
+
last: parent.last === id ? node.previous : parent.last,
|
|
2771
|
+
childCount: parent.childCount - 1
|
|
2736
2772
|
});
|
|
2737
|
-
|
|
2738
|
-
failure = { error };
|
|
2773
|
+
await this.patch(id, { parent: 0, previous: 0, next: 0 });
|
|
2739
2774
|
}
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2775
|
+
async attach(parentId, id, before = 0) {
|
|
2776
|
+
if (before === id) return;
|
|
2777
|
+
if (before && (await this.read(before)).parent !== parentId)
|
|
2778
|
+
throw new HtmlError("E_OWNERSHIP", "Stored insertion reference has a different parent");
|
|
2779
|
+
await this.detach(id);
|
|
2780
|
+
const parent = await this.read(parentId);
|
|
2781
|
+
const previous2 = before ? (await this.read(before)).previous : parent.last;
|
|
2782
|
+
await this.patch(id, { parent: parentId, previous: previous2, next: before });
|
|
2783
|
+
if (previous2) await this.patch(previous2, { next: id });
|
|
2784
|
+
if (before) await this.patch(before, { previous: id });
|
|
2785
|
+
await this.patch(parentId, {
|
|
2786
|
+
first: previous2 ? parent.first : id,
|
|
2787
|
+
last: before ? parent.last : id,
|
|
2788
|
+
childCount: parent.childCount + 1
|
|
2789
|
+
});
|
|
2790
|
+
}
|
|
2791
|
+
async *children(parent) {
|
|
2792
|
+
let id = (await this.read(parent)).first;
|
|
2793
|
+
while (id) {
|
|
2794
|
+
const next = (await this.read(id)).next;
|
|
2795
|
+
yield id;
|
|
2796
|
+
id = next;
|
|
2746
2797
|
}
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2798
|
+
}
|
|
2799
|
+
async attribute(nodeId, name, value, namespace) {
|
|
2800
|
+
const node = await this.read(nodeId), bytes = new Uint8Array(32), view = new DataView(bytes.buffer);
|
|
2801
|
+
view.setFloat64(8, name, true);
|
|
2802
|
+
view.setFloat64(16, value, true);
|
|
2803
|
+
view.setFloat64(24, attributeNamespaces.indexOf(namespace), true);
|
|
2804
|
+
const id = await this.storage.append(bytes);
|
|
2805
|
+
if (node.lastAttribute) {
|
|
2806
|
+
view.setFloat64(0, id, true);
|
|
2807
|
+
await this.storage.write(node.lastAttribute, bytes.subarray(0, 8));
|
|
2751
2808
|
}
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2809
|
+
await this.patch(nodeId, { firstAttribute: node.firstAttribute || id, lastAttribute: id, attributeCount: node.attributeCount + 1 });
|
|
2810
|
+
return id;
|
|
2811
|
+
}
|
|
2812
|
+
async *attributes(node) {
|
|
2813
|
+
let id = (await this.read(node)).firstAttribute;
|
|
2814
|
+
while (id) {
|
|
2815
|
+
const bytes = await this.storage.read(id, 32), view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
2816
|
+
const next = view.getFloat64(0, true);
|
|
2817
|
+
yield { id, next, name: view.getFloat64(8, true), value: view.getFloat64(16, true), namespace: attributeNamespaces[view.getFloat64(24, true)] };
|
|
2818
|
+
id = next;
|
|
2757
2819
|
}
|
|
2758
2820
|
}
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2821
|
+
async replaceAttribute(id, value) {
|
|
2822
|
+
const bytes = new Uint8Array(8);
|
|
2823
|
+
new DataView(bytes.buffer).setFloat64(0, value, true);
|
|
2824
|
+
await this.storage.write(id + 16, bytes);
|
|
2762
2825
|
}
|
|
2763
|
-
|
|
2764
|
-
|
|
2826
|
+
async clone(id) {
|
|
2827
|
+
const node = await this.read(id);
|
|
2828
|
+
const clone = await this.create(node.kind, { name: node.name, namespace: node.namespace });
|
|
2829
|
+
for await (const attribute2 of this.attributes(id))
|
|
2830
|
+
await this.attribute(clone, attribute2.name, attribute2.value, attribute2.namespace);
|
|
2831
|
+
return clone;
|
|
2832
|
+
}
|
|
2833
|
+
};
|
|
2834
|
+
var StoredSequence = class {
|
|
2835
|
+
constructor(storage) {
|
|
2836
|
+
this.storage = storage;
|
|
2837
|
+
}
|
|
2838
|
+
storage;
|
|
2839
|
+
start = 0;
|
|
2840
|
+
capacity = 0;
|
|
2841
|
+
count = 0;
|
|
2842
|
+
window;
|
|
2843
|
+
get residentBytes() {
|
|
2844
|
+
return this.window?.bytes.byteLength ?? 0;
|
|
2845
|
+
}
|
|
2846
|
+
get length() {
|
|
2847
|
+
return this.count;
|
|
2848
|
+
}
|
|
2849
|
+
async reserve(count) {
|
|
2850
|
+
if (count <= this.capacity) return;
|
|
2851
|
+
const capacity = Math.max(256, this.capacity * 2, count);
|
|
2852
|
+
const start = this.storage.allocate(capacity * 8);
|
|
2853
|
+
for (let offset = 0; offset < this.count * 8; offset += 16384)
|
|
2854
|
+
await this.storage.write(start + offset, await this.storage.read(this.start + offset, Math.min(16384, this.count * 8 - offset)));
|
|
2855
|
+
this.start = start;
|
|
2856
|
+
this.capacity = capacity;
|
|
2857
|
+
this.window = void 0;
|
|
2858
|
+
}
|
|
2859
|
+
async get(index) {
|
|
2860
|
+
if (!Number.isSafeInteger(index) || index < 0 || index >= this.count) return void 0;
|
|
2861
|
+
const offset = Math.floor(index / 2048) * 16384;
|
|
2862
|
+
if (this.window?.offset !== offset) this.window = { offset, bytes: await this.storage.read(this.start + offset, Math.min(16384, this.capacity * 8 - offset)) };
|
|
2863
|
+
const { bytes } = this.window;
|
|
2864
|
+
return new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getFloat64(index * 8 - offset, true);
|
|
2865
|
+
}
|
|
2866
|
+
async set(index, value) {
|
|
2867
|
+
if (!Number.isSafeInteger(index) || index < 0 || index >= this.count) throw new RangeError("Invalid stored sequence index");
|
|
2868
|
+
const bytes = new Uint8Array(8);
|
|
2869
|
+
new DataView(bytes.buffer).setFloat64(0, value, true);
|
|
2870
|
+
await this.storage.write(this.start + index * 8, bytes);
|
|
2871
|
+
if (this.window && index * 8 >= this.window.offset && index * 8 < this.window.offset + this.window.bytes.length)
|
|
2872
|
+
this.window.bytes.set(bytes, index * 8 - this.window.offset);
|
|
2873
|
+
}
|
|
2874
|
+
async push(value) {
|
|
2875
|
+
await this.reserve(this.count + 1);
|
|
2876
|
+
this.count++;
|
|
2877
|
+
await this.set(this.count - 1, value);
|
|
2878
|
+
}
|
|
2879
|
+
async pop() {
|
|
2880
|
+
if (!this.count) return void 0;
|
|
2881
|
+
const value = await this.get(this.count - 1);
|
|
2882
|
+
this.count--;
|
|
2883
|
+
return value;
|
|
2884
|
+
}
|
|
2885
|
+
async truncate(length) {
|
|
2886
|
+
if (!Number.isSafeInteger(length) || length < 0 || length > this.count) throw new RangeError("Invalid stored sequence length");
|
|
2887
|
+
this.count = length;
|
|
2888
|
+
}
|
|
2889
|
+
async indexOf(value, reverse = false) {
|
|
2890
|
+
for (let index = reverse ? this.count - 1 : 0; index >= 0 && index < this.count; index += reverse ? -1 : 1)
|
|
2891
|
+
if (await this.get(index) === value) return index;
|
|
2892
|
+
return -1;
|
|
2893
|
+
}
|
|
2894
|
+
async splice(index, remove, insert) {
|
|
2895
|
+
if (!Number.isSafeInteger(index) || !Number.isSafeInteger(remove) || index < 0 || index > this.count || remove < 0)
|
|
2896
|
+
throw new RangeError("Invalid stored sequence splice");
|
|
2897
|
+
remove = Math.min(remove, this.count - index);
|
|
2898
|
+
const added = insert === void 0 ? 0 : 1;
|
|
2899
|
+
const count = this.count - remove + added;
|
|
2900
|
+
await this.reserve(count);
|
|
2901
|
+
this.window = void 0;
|
|
2902
|
+
const source = (index + remove) * 8, destination = (index + added) * 8;
|
|
2903
|
+
const length = (this.count - index - remove) * 8;
|
|
2904
|
+
if (destination > source) {
|
|
2905
|
+
for (let remaining = length; remaining > 0; ) {
|
|
2906
|
+
const size = Math.min(16384, remaining);
|
|
2907
|
+
remaining -= size;
|
|
2908
|
+
await this.storage.write(this.start + destination + remaining, await this.storage.read(this.start + source + remaining, size));
|
|
2909
|
+
}
|
|
2910
|
+
} else if (destination < source) {
|
|
2911
|
+
for (let offset = 0; offset < length; offset += 16384)
|
|
2912
|
+
await this.storage.write(this.start + destination + offset, await this.storage.read(this.start + source + offset, Math.min(16384, length - offset)));
|
|
2913
|
+
}
|
|
2914
|
+
this.count = count;
|
|
2915
|
+
if (insert !== void 0) await this.set(index, insert);
|
|
2916
|
+
}
|
|
2917
|
+
};
|
|
2918
|
+
|
|
2919
|
+
// packages/safe-bash-command-htmlq/src/stored-parser.ts
|
|
2920
|
+
function allSpace2(value) {
|
|
2921
|
+
for (const c of value)
|
|
2922
|
+
if (!(0, entities_exports.htmlSpace)(c))
|
|
2923
|
+
return false;
|
|
2924
|
+
return true;
|
|
2925
|
+
}
|
|
2926
|
+
async function parseStoredHtml(source, tree, strings, storage, options) {
|
|
2927
|
+
const budget = new HtmlBudget(options);
|
|
2928
|
+
async function* normalized() {
|
|
2929
|
+
let first = true, carriage = false;
|
|
2930
|
+
for await (const original of decodedHtml(source, options)) {
|
|
2931
|
+
let result2 = "";
|
|
2932
|
+
for (const c of original) {
|
|
2933
|
+
budget.charge("work", 1);
|
|
2934
|
+
if (first) {
|
|
2935
|
+
first = false;
|
|
2936
|
+
if (c === "\uFEFF")
|
|
2937
|
+
continue;
|
|
2938
|
+
}
|
|
2939
|
+
if (carriage && c === "\n") {
|
|
2940
|
+
carriage = false;
|
|
2941
|
+
continue;
|
|
2942
|
+
}
|
|
2943
|
+
carriage = c === "\r";
|
|
2944
|
+
result2 += carriage ? "\n" : c;
|
|
2945
|
+
}
|
|
2946
|
+
yield result2;
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
const tokenizer = new StreamingHtmlTokenizer(normalized(), budget);
|
|
2950
|
+
let result = 0, failure;
|
|
2951
|
+
try {
|
|
2952
|
+
result = await buildStoredTree(tree, strings, storage, tokenizer, budget);
|
|
2953
|
+
} catch (error) {
|
|
2954
|
+
failure = { error };
|
|
2955
|
+
}
|
|
2956
|
+
try {
|
|
2957
|
+
await tokenizer.close();
|
|
2958
|
+
} catch (error) {
|
|
2959
|
+
if (failure)
|
|
2960
|
+
throw new AggregateError([failure.error, error], "HTML parsing and input cleanup failed");
|
|
2961
|
+
throw error;
|
|
2962
|
+
}
|
|
2963
|
+
if (failure)
|
|
2964
|
+
throw failure.error;
|
|
2965
|
+
return result;
|
|
2966
|
+
}
|
|
2967
|
+
async function buildStoredTree(tree, strings, storage, tokenizer, budget) {
|
|
2968
|
+
const labels = /* @__PURE__ */ new Map();
|
|
2969
|
+
const names = /* @__PURE__ */ new Map();
|
|
2970
|
+
const value = async (id) => {
|
|
2971
|
+
const cached = labels.get(id);
|
|
2972
|
+
if (cached !== void 0) return cached;
|
|
2973
|
+
let value2 = "";
|
|
2974
|
+
for await (const chunk of strings.chunks(id)) value2 += chunk;
|
|
2975
|
+
if (value2.length <= 64) {
|
|
2976
|
+
if (labels.size === 256) labels.delete(labels.keys().next().value);
|
|
2977
|
+
labels.set(id, value2);
|
|
2978
|
+
}
|
|
2979
|
+
return value2;
|
|
2980
|
+
};
|
|
2981
|
+
const nameRef = async (name) => {
|
|
2982
|
+
const cached = names.get(name);
|
|
2983
|
+
if (cached !== void 0) return cached;
|
|
2984
|
+
const id = await strings.from(name);
|
|
2985
|
+
if (name.length <= 64) {
|
|
2986
|
+
if (names.size === 256) names.delete(names.keys().next().value);
|
|
2987
|
+
names.set(name, id);
|
|
2988
|
+
if (labels.size === 256) labels.delete(labels.keys().next().value);
|
|
2989
|
+
labels.set(id, name);
|
|
2990
|
+
}
|
|
2991
|
+
return id;
|
|
2992
|
+
};
|
|
2993
|
+
const meta = async (id) => {
|
|
2994
|
+
const node = await tree.read(id);
|
|
2995
|
+
return { ...node, name: await value(node.name) };
|
|
2996
|
+
};
|
|
2997
|
+
const make = async (kind, name = "", data = "", namespace = "html") => {
|
|
2998
|
+
budget.charge("nodes", 1);
|
|
2999
|
+
budget.charge("retainedBytes", 128 + (name.length + data.length) * 2);
|
|
3000
|
+
return tree.create(kind, { name: await nameRef(name), data: await strings.from(data), namespace });
|
|
3001
|
+
};
|
|
3002
|
+
const append = async (parent, node, before = 0) => {
|
|
3003
|
+
const previous2 = (await tree.read(node)).parent;
|
|
3004
|
+
budget.charge("work", (previous2 ? (await tree.read(previous2)).childCount : 0) + (before ? (await tree.read(parent)).childCount : 1));
|
|
3005
|
+
await tree.attach(parent, node, before);
|
|
3006
|
+
};
|
|
3007
|
+
const document = await make("document"), html = await make("element", "html"), head = await make("element", "head"), body = await make("element", "body");
|
|
3008
|
+
await append(document, html);
|
|
3009
|
+
await append(html, head);
|
|
3010
|
+
await append(html, body);
|
|
3011
|
+
const stack = new StoredSequence(storage), active = new StoredSequence(storage);
|
|
3012
|
+
await stack.push(html);
|
|
3013
|
+
let form = 0;
|
|
3014
|
+
let mode = "beforeHead";
|
|
3015
|
+
const current = async () => await stack.get(stack.length - 1);
|
|
3016
|
+
const target = async (node) => {
|
|
3017
|
+
node ??= await current();
|
|
3018
|
+
return (await tree.read(node)).templateContents || node;
|
|
3019
|
+
};
|
|
3020
|
+
const push = async (node) => {
|
|
3021
|
+
budget.bound("depth", stack.length + 1);
|
|
3022
|
+
await stack.push(node);
|
|
3023
|
+
};
|
|
3024
|
+
const find = async (name) => {
|
|
3025
|
+
for (let i = stack.length - 1; i >= 0; i--) {
|
|
3026
|
+
budget.charge("work", 1);
|
|
3027
|
+
if ((await meta(await stack.get(i))).name.toLowerCase() === name)
|
|
3028
|
+
return i;
|
|
3029
|
+
}
|
|
3030
|
+
return -1;
|
|
3031
|
+
};
|
|
3032
|
+
const pop = async (name) => {
|
|
3033
|
+
const i = await find(name);
|
|
3034
|
+
if (i > 0)
|
|
3035
|
+
await stack.truncate(i);
|
|
3036
|
+
};
|
|
3037
|
+
const inScope = async (names2, extra = []) => {
|
|
3038
|
+
for (let i = stack.length - 1; i >= 0; i--) {
|
|
3039
|
+
budget.charge("work", 1);
|
|
3040
|
+
const node = await meta(await stack.get(i));
|
|
3041
|
+
if (node.namespace === "html" && names2.includes(node.name))
|
|
3042
|
+
return i;
|
|
3043
|
+
if (node.namespace === "html" && (htmlScopeBarriers.has(node.name) || extra.includes(node.name)) || node.namespace === "mathml" && mathmlScopeBarriers.has(node.name) || node.namespace === "svg" && svgScopeBarriers.has(node.name))
|
|
3044
|
+
return -1;
|
|
3045
|
+
}
|
|
3046
|
+
return -1;
|
|
3047
|
+
};
|
|
3048
|
+
const headings = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
3049
|
+
const clearFormatting = async () => {
|
|
3050
|
+
while (active.length) {
|
|
3051
|
+
budget.charge("work", 1);
|
|
3052
|
+
if (await active.pop() === 0)
|
|
3053
|
+
break;
|
|
3054
|
+
}
|
|
3055
|
+
};
|
|
3056
|
+
const closeCell = async () => {
|
|
3057
|
+
const index = await inScope(["td", "th"]);
|
|
3058
|
+
if (index > 0) {
|
|
3059
|
+
await stack.truncate(index);
|
|
3060
|
+
await clearFormatting();
|
|
3061
|
+
}
|
|
3062
|
+
};
|
|
3063
|
+
const setAttributes = async (node, attributes) => {
|
|
3064
|
+
for (const a of attributes)
|
|
3065
|
+
await tree.attribute(node, await strings.from(a.name), await strings.from(a.value), a.namespace);
|
|
3066
|
+
};
|
|
3067
|
+
const mergeAttributes = async (node, attributes) => {
|
|
3068
|
+
budget.charge("work", (await tree.read(node)).attributeCount + attributes.length);
|
|
3069
|
+
for (const a of attributes) {
|
|
3070
|
+
let exists = false;
|
|
3071
|
+
for await (const old of tree.attributes(node))
|
|
3072
|
+
if (await value(old.name) === a.name) {
|
|
3073
|
+
exists = true;
|
|
3074
|
+
break;
|
|
3075
|
+
}
|
|
3076
|
+
if (!exists) {
|
|
3077
|
+
budget.charge("retainedBytes", 64 + (a.name.length + a.value.length) * 2);
|
|
3078
|
+
await setAttributes(node, [a]);
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
3081
|
+
};
|
|
3082
|
+
const clone = async (node) => {
|
|
3083
|
+
const original = await tree.read(node);
|
|
3084
|
+
budget.charge("nodes", 1);
|
|
3085
|
+
budget.charge("retainedBytes", 128 + (await strings.info(original.name)).length * 2);
|
|
3086
|
+
budget.charge("attributes", original.attributeCount);
|
|
3087
|
+
for await (const a of tree.attributes(node))
|
|
3088
|
+
budget.charge("retainedBytes", 64 + ((await strings.info(a.name)).length + (await strings.info(a.value)).length) * 2);
|
|
3089
|
+
return tree.clone(node);
|
|
3090
|
+
};
|
|
3091
|
+
const reconstruct = async () => {
|
|
3092
|
+
for (let i = await active.indexOf(0, true) + 1; i < active.length; i++) {
|
|
3093
|
+
budget.charge("work", stack.length + 1);
|
|
3094
|
+
const a = await active.get(i);
|
|
3095
|
+
if (await stack.indexOf(a) < 0) {
|
|
3096
|
+
const n = await clone(a);
|
|
3097
|
+
await append(await target(), n);
|
|
3098
|
+
await push(n);
|
|
3099
|
+
await active.set(i, n);
|
|
3100
|
+
}
|
|
3101
|
+
}
|
|
3102
|
+
};
|
|
3103
|
+
const location = async () => {
|
|
3104
|
+
const name = (await meta(await current())).name;
|
|
3105
|
+
if (["table", "tbody", "thead", "tfoot", "tr"].includes(name)) {
|
|
3106
|
+
const table = await stack.get(await find("table"));
|
|
3107
|
+
if (table) {
|
|
3108
|
+
const parent = (await tree.read(table)).parent;
|
|
3109
|
+
if (parent)
|
|
3110
|
+
return [parent, table];
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
3113
|
+
return [await target()];
|
|
3114
|
+
};
|
|
3115
|
+
const special = async (id) => {
|
|
3116
|
+
const node = await meta(id);
|
|
3117
|
+
return node.namespace !== "html" || blocks.has(node.name) || specialHtmlElements.has(node.name);
|
|
3118
|
+
};
|
|
3119
|
+
const adopt = async (name) => {
|
|
3120
|
+
for (let outer = 0; outer < 8; outer++) {
|
|
3121
|
+
budget.charge("work", stack.length + active.length);
|
|
3122
|
+
let at = -1;
|
|
3123
|
+
for (let i = active.length - 1; i >= 0; i--) {
|
|
3124
|
+
const node = await active.get(i);
|
|
3125
|
+
if (!node)
|
|
3126
|
+
break;
|
|
3127
|
+
if ((await meta(node)).name === name) {
|
|
3128
|
+
at = i;
|
|
3129
|
+
break;
|
|
3130
|
+
}
|
|
3131
|
+
}
|
|
3132
|
+
if (at < 0) {
|
|
3133
|
+
await pop(name);
|
|
3134
|
+
return;
|
|
3135
|
+
}
|
|
3136
|
+
const fmt = await active.get(at), index = await stack.indexOf(fmt);
|
|
3137
|
+
if (index < 0) {
|
|
3138
|
+
await active.splice(at, 1);
|
|
3139
|
+
return;
|
|
3140
|
+
}
|
|
3141
|
+
let blockIndex = -1;
|
|
3142
|
+
for (let i = index + 1; i < stack.length; i++)
|
|
3143
|
+
if (await special(await stack.get(i))) {
|
|
3144
|
+
blockIndex = i;
|
|
3145
|
+
break;
|
|
3146
|
+
}
|
|
3147
|
+
if (blockIndex < 0) {
|
|
3148
|
+
await stack.truncate(index);
|
|
3149
|
+
await active.splice(at, 1);
|
|
3150
|
+
return;
|
|
3151
|
+
}
|
|
3152
|
+
const block = await stack.get(blockIndex), ancestor = await stack.get(index - 1);
|
|
3153
|
+
let bookmark = at, last = block, cursor = blockIndex;
|
|
3154
|
+
for (let inner = 1; cursor > index; inner++) {
|
|
3155
|
+
budget.charge("work", stack.length + active.length);
|
|
3156
|
+
cursor--;
|
|
3157
|
+
const node = await stack.get(cursor);
|
|
3158
|
+
if (node === fmt)
|
|
3159
|
+
break;
|
|
3160
|
+
let activeIndex = await active.indexOf(node);
|
|
3161
|
+
if (inner > 3 && activeIndex >= 0) {
|
|
3162
|
+
await active.splice(activeIndex, 1);
|
|
3163
|
+
if (activeIndex < bookmark)
|
|
3164
|
+
bookmark--;
|
|
3165
|
+
activeIndex = -1;
|
|
3166
|
+
}
|
|
3167
|
+
if (activeIndex < 0) {
|
|
3168
|
+
await stack.splice(cursor, 1);
|
|
3169
|
+
continue;
|
|
3170
|
+
}
|
|
3171
|
+
const replacement2 = await clone(node);
|
|
3172
|
+
await stack.set(cursor, replacement2);
|
|
3173
|
+
await active.set(activeIndex, replacement2);
|
|
3174
|
+
if (last === block)
|
|
3175
|
+
bookmark = activeIndex + 1;
|
|
3176
|
+
await append(replacement2, last);
|
|
3177
|
+
last = replacement2;
|
|
3178
|
+
}
|
|
3179
|
+
if (["table", "tbody", "tfoot", "thead", "tr"].includes((await meta(ancestor)).name)) {
|
|
3180
|
+
const table = await stack.get(await find("table")), parent = table ? (await tree.read(table)).parent : 0;
|
|
3181
|
+
if (table && parent)
|
|
3182
|
+
await append(parent, last, table);
|
|
3183
|
+
else
|
|
3184
|
+
await append(await target(ancestor), last);
|
|
3185
|
+
} else
|
|
3186
|
+
await append(await target(ancestor), last);
|
|
3187
|
+
const replacement = await clone(fmt);
|
|
3188
|
+
while ((await tree.read(block)).first)
|
|
3189
|
+
await append(replacement, (await tree.read(block)).first);
|
|
3190
|
+
await append(block, replacement);
|
|
3191
|
+
const old = await active.indexOf(fmt);
|
|
3192
|
+
await active.splice(old, 1);
|
|
3193
|
+
if (old < bookmark)
|
|
3194
|
+
bookmark--;
|
|
3195
|
+
await active.splice(bookmark, 0, replacement);
|
|
3196
|
+
await stack.splice(await stack.indexOf(fmt), 1);
|
|
3197
|
+
await stack.splice(await stack.indexOf(block) + 1, 0, replacement);
|
|
3198
|
+
}
|
|
3199
|
+
};
|
|
3200
|
+
const text = async (data) => {
|
|
3201
|
+
if (!data)
|
|
3202
|
+
return;
|
|
3203
|
+
await reconstruct();
|
|
3204
|
+
const [parent, before] = allSpace2(data) ? [await target(), void 0] : await location();
|
|
3205
|
+
const last = before ? (await tree.read(before)).previous : (await tree.read(parent)).last;
|
|
3206
|
+
if (last && (await tree.read(last)).kind === "text") {
|
|
3207
|
+
budget.charge("retainedBytes", data.length * 2);
|
|
3208
|
+
await tree.patch(last, { data: await strings.concat((await tree.read(last)).data, await strings.from(data)) });
|
|
3209
|
+
} else
|
|
3210
|
+
await append(parent, await make("text", "", data), before);
|
|
3211
|
+
};
|
|
3212
|
+
const integration = async (node) => {
|
|
3213
|
+
for await (const a of tree.attributes(node))
|
|
3214
|
+
if (await value(a.name) === "encoding" && ["text/html", "application/xhtml+xml"].includes((await value(a.value)).toLowerCase()))
|
|
3215
|
+
return true;
|
|
3216
|
+
return false;
|
|
3217
|
+
};
|
|
3218
|
+
const activeAnchor = async () => {
|
|
3219
|
+
for (let i = await active.indexOf(0, true) + 1; i < active.length; i++)
|
|
3220
|
+
if ((await meta(await active.get(i))).name === "a")
|
|
3221
|
+
return true;
|
|
3222
|
+
return false;
|
|
3223
|
+
};
|
|
3224
|
+
for (; ; ) {
|
|
3225
|
+
const top = await meta(await current());
|
|
3226
|
+
const raw = top.namespace === "html" && (rawElements.has(top.name) || top.name === "title" || top.name === "textarea") ? top.name : void 0;
|
|
3227
|
+
const token = await tokenizer.next(raw, top.namespace !== "html");
|
|
3228
|
+
if (!token)
|
|
3229
|
+
break;
|
|
3230
|
+
budget.charge("work", stack.length + active.length + 1);
|
|
3231
|
+
if (token.kind === "doctype") {
|
|
3232
|
+
if (mode === "beforeHead")
|
|
3233
|
+
await append(document, await make("doctype", "", token.data), html);
|
|
3234
|
+
continue;
|
|
3235
|
+
}
|
|
3236
|
+
if (token.kind === "comment") {
|
|
3237
|
+
await append(mode === "beforeHead" ? document : await target(), await make("comment", "", token.data), mode === "beforeHead" ? html : void 0);
|
|
3238
|
+
continue;
|
|
3239
|
+
}
|
|
3240
|
+
if (token.kind === "text") {
|
|
3241
|
+
if (mode === "beforeHead") {
|
|
3242
|
+
if (allSpace2(token.data))
|
|
3243
|
+
continue;
|
|
3244
|
+
mode = "body";
|
|
3245
|
+
await stack.push(body);
|
|
3246
|
+
}
|
|
3247
|
+
if (mode === "head" && await current() === head && !allSpace2(token.data)) {
|
|
3248
|
+
mode = "body";
|
|
3249
|
+
await stack.truncate(1);
|
|
3250
|
+
await stack.push(body);
|
|
3251
|
+
}
|
|
3252
|
+
let data = token.data;
|
|
3253
|
+
if ((await meta(await current())).name === "colgroup" && !allSpace2(data)) {
|
|
3254
|
+
let prefix = 0;
|
|
3255
|
+
while ((0, entities_exports.htmlSpace)(data[prefix] ?? "")) {
|
|
3256
|
+
budget.charge("work", 1);
|
|
3257
|
+
prefix++;
|
|
3258
|
+
}
|
|
3259
|
+
if (prefix)
|
|
3260
|
+
await text(data.slice(0, prefix));
|
|
3261
|
+
data = data.slice(prefix);
|
|
3262
|
+
await stack.pop();
|
|
3263
|
+
}
|
|
3264
|
+
if (((await meta(await current())).name === "pre" || (await meta(await current())).name === "textarea" || (await meta(await current())).name === "listing") && (await tree.read(await current())).childCount === 0 && data.startsWith("\n"))
|
|
3265
|
+
data = data.slice(1);
|
|
3266
|
+
if ((await meta(await current())).namespace === "html" && !rawElements.has((await meta(await current())).name))
|
|
3267
|
+
data = data.includes("\0") ? data.replaceAll("\0", "") : data;
|
|
3268
|
+
await text(data);
|
|
3269
|
+
continue;
|
|
3270
|
+
}
|
|
3271
|
+
let t = token;
|
|
3272
|
+
const name = t.name;
|
|
3273
|
+
if ((await meta(await current())).namespace === "html" && (await meta(await current())).name === "colgroup" && name !== "col" && name !== "template" && name !== "colgroup")
|
|
3274
|
+
await stack.pop();
|
|
3275
|
+
if (t.kind === "start" && captionBreakingElements.has(name)) {
|
|
3276
|
+
const caption = await inScope(["caption"]);
|
|
3277
|
+
if (caption > 0) {
|
|
3278
|
+
await stack.truncate(caption);
|
|
3279
|
+
await clearFormatting();
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
3282
|
+
if (await find("select") >= 0 && !["option", "optgroup", "select", "script", "template"].includes(name)) {
|
|
3283
|
+
if (["input", "keygen", "textarea"].includes(name) && t.kind === "start")
|
|
3284
|
+
await pop("select");
|
|
3285
|
+
else
|
|
3286
|
+
continue;
|
|
3287
|
+
}
|
|
3288
|
+
if (t.kind === "start" && name === "select" && await find("select") >= 0) {
|
|
3289
|
+
await pop("select");
|
|
3290
|
+
continue;
|
|
3291
|
+
}
|
|
3292
|
+
if (t.kind === "start" && name === "html") {
|
|
3293
|
+
await mergeAttributes(html, t.attributes);
|
|
3294
|
+
continue;
|
|
3295
|
+
}
|
|
3296
|
+
if (t.kind === "start" && name === "head" && mode === "beforeHead") {
|
|
3297
|
+
mode = "head";
|
|
3298
|
+
await stack.push(head);
|
|
3299
|
+
await setAttributes(head, t.attributes);
|
|
3300
|
+
continue;
|
|
3301
|
+
}
|
|
3302
|
+
if (name === "head" && mode !== "beforeHead" && !(t.kind === "end" && mode === "head"))
|
|
3303
|
+
continue;
|
|
3304
|
+
if (t.kind === "end" && name === "head") {
|
|
3305
|
+
await stack.truncate(1);
|
|
3306
|
+
mode = "body";
|
|
3307
|
+
await stack.push(body);
|
|
3308
|
+
continue;
|
|
3309
|
+
}
|
|
3310
|
+
if (mode === "beforeHead") {
|
|
3311
|
+
if (t.kind === "start" && headElements.has(name)) {
|
|
3312
|
+
mode = "head";
|
|
3313
|
+
await stack.push(head);
|
|
3314
|
+
} else {
|
|
3315
|
+
mode = "body";
|
|
3316
|
+
await stack.push(body);
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
if (mode === "head" && await current() === head && t.kind === "start" && !headElements.has(name)) {
|
|
3320
|
+
await stack.truncate(1);
|
|
3321
|
+
await stack.push(body);
|
|
3322
|
+
mode = "body";
|
|
3323
|
+
}
|
|
3324
|
+
if (t.kind === "start" && name === "body") {
|
|
3325
|
+
await mergeAttributes(body, t.attributes);
|
|
3326
|
+
continue;
|
|
3327
|
+
}
|
|
3328
|
+
if (t.kind === "end" && name === "br" && (await meta(await current())).namespace === "html")
|
|
3329
|
+
t = { ...t, kind: "start" };
|
|
3330
|
+
if (t.kind === "end") {
|
|
3331
|
+
if (name === "body" || name === "html")
|
|
3332
|
+
continue;
|
|
3333
|
+
if (tableCloseElements.has(name)) {
|
|
3334
|
+
if (await find(name) >= 0) {
|
|
3335
|
+
await closeCell();
|
|
3336
|
+
if (name !== "td" && name !== "th")
|
|
3337
|
+
await pop(name);
|
|
3338
|
+
}
|
|
3339
|
+
continue;
|
|
3340
|
+
}
|
|
3341
|
+
if (name === "form" && await find("template") < 0) {
|
|
3342
|
+
const node2 = form;
|
|
3343
|
+
form = 0;
|
|
3344
|
+
const index = node2 ? await inScope(["form"]) : -1;
|
|
3345
|
+
if (index > 0 && await stack.get(index) === node2)
|
|
3346
|
+
await stack.splice(index, 1);
|
|
3347
|
+
continue;
|
|
3348
|
+
}
|
|
3349
|
+
if (name === "caption") {
|
|
3350
|
+
const index = await inScope(["caption"]);
|
|
3351
|
+
if (index > 0) {
|
|
3352
|
+
await stack.truncate(index);
|
|
3353
|
+
await clearFormatting();
|
|
3354
|
+
}
|
|
3355
|
+
continue;
|
|
3356
|
+
}
|
|
3357
|
+
if (formatting.has(name)) {
|
|
3358
|
+
await adopt(name);
|
|
3359
|
+
continue;
|
|
3360
|
+
}
|
|
3361
|
+
if (name === "template") {
|
|
3362
|
+
await pop(name);
|
|
3363
|
+
await clearFormatting();
|
|
3364
|
+
continue;
|
|
3365
|
+
}
|
|
3366
|
+
if (name === "p" && await inScope(["p"], ["button"]) < 0) {
|
|
3367
|
+
const p = await make("element", "p");
|
|
3368
|
+
await append(await target(), p);
|
|
3369
|
+
continue;
|
|
3370
|
+
}
|
|
3371
|
+
if (headingElements.has(name)) {
|
|
3372
|
+
const index = await inScope(headings);
|
|
3373
|
+
if (index > 0)
|
|
3374
|
+
await stack.truncate(index);
|
|
3375
|
+
continue;
|
|
3376
|
+
}
|
|
3377
|
+
if (blocks.has(name) || endScopeExtraElements.has(name)) {
|
|
3378
|
+
const index = await inScope([name], name === "li" ? ["ol", "ul"] : name === "p" ? ["button"] : []);
|
|
3379
|
+
if (index > 0)
|
|
3380
|
+
await stack.truncate(index);
|
|
3381
|
+
} else {
|
|
3382
|
+
for (let i = stack.length - 1; i > 0; i--) {
|
|
3383
|
+
budget.charge("work", 1);
|
|
3384
|
+
if ((await meta(await stack.get(i))).name.toLowerCase() === name) {
|
|
3385
|
+
await stack.truncate(i);
|
|
3386
|
+
break;
|
|
3387
|
+
}
|
|
3388
|
+
if (await special(await stack.get(i)))
|
|
3389
|
+
break;
|
|
3390
|
+
}
|
|
3391
|
+
}
|
|
3392
|
+
continue;
|
|
3393
|
+
}
|
|
3394
|
+
let ns = (await meta(await current())).namespace;
|
|
3395
|
+
if (ns === "svg" && ["foreignObject", "desc", "title"].includes((await meta(await current())).name) || ns === "mathml" && ["mi", "mo", "mn", "ms", "mtext"].includes((await meta(await current())).name) && name !== "mglyph" && name !== "malignmark" || ns === "mathml" && (await meta(await current())).name === "annotation-xml" && await integration(await current()))
|
|
3396
|
+
ns = "html";
|
|
3397
|
+
if (ns !== "html" && [
|
|
3398
|
+
"b",
|
|
3399
|
+
"big",
|
|
3400
|
+
"blockquote",
|
|
3401
|
+
"body",
|
|
3402
|
+
"br",
|
|
3403
|
+
"center",
|
|
3404
|
+
"code",
|
|
3405
|
+
"dd",
|
|
3406
|
+
"div",
|
|
3407
|
+
"dl",
|
|
3408
|
+
"dt",
|
|
3409
|
+
"em",
|
|
3410
|
+
"embed",
|
|
3411
|
+
"h1",
|
|
3412
|
+
"h2",
|
|
3413
|
+
"h3",
|
|
3414
|
+
"h4",
|
|
3415
|
+
"h5",
|
|
3416
|
+
"h6",
|
|
3417
|
+
"head",
|
|
3418
|
+
"hr",
|
|
3419
|
+
"i",
|
|
3420
|
+
"img",
|
|
3421
|
+
"li",
|
|
3422
|
+
"listing",
|
|
3423
|
+
"menu",
|
|
3424
|
+
"meta",
|
|
3425
|
+
"nobr",
|
|
3426
|
+
"ol",
|
|
3427
|
+
"p",
|
|
3428
|
+
"pre",
|
|
3429
|
+
"ruby",
|
|
3430
|
+
"s",
|
|
3431
|
+
"small",
|
|
3432
|
+
"span",
|
|
3433
|
+
"strong",
|
|
3434
|
+
"strike",
|
|
3435
|
+
"sub",
|
|
3436
|
+
"sup",
|
|
3437
|
+
"table",
|
|
3438
|
+
"tt",
|
|
3439
|
+
"u",
|
|
3440
|
+
"ul",
|
|
3441
|
+
"var"
|
|
3442
|
+
].includes(name)) {
|
|
3443
|
+
while ((await meta(await current())).namespace !== "html")
|
|
3444
|
+
await stack.pop();
|
|
3445
|
+
ns = "html";
|
|
3446
|
+
}
|
|
3447
|
+
if (name === "svg")
|
|
3448
|
+
ns = "svg";
|
|
3449
|
+
if (name === "math")
|
|
3450
|
+
ns = "mathml";
|
|
3451
|
+
if (ns === "html") {
|
|
3452
|
+
if (["caption", "col", "colgroup", "tbody", "td", "tfoot", "th", "thead", "tr"].includes(name) && await find("table") < 0 && await find("template") < 0)
|
|
3453
|
+
continue;
|
|
3454
|
+
if (name === "form" && form && await find("template") < 0)
|
|
3455
|
+
continue;
|
|
3456
|
+
if (blocks.has(name) || name === "table" || name === "hr") {
|
|
3457
|
+
const index = await inScope(["p"], ["button"]);
|
|
3458
|
+
if (index > 0)
|
|
3459
|
+
await stack.truncate(index);
|
|
3460
|
+
}
|
|
3461
|
+
if (name === "li") {
|
|
3462
|
+
const index = await inScope(["li"], ["ol", "ul"]);
|
|
3463
|
+
if (index > 0)
|
|
3464
|
+
await stack.truncate(index);
|
|
3465
|
+
}
|
|
3466
|
+
if (headingElements.has(name) && headingElements.has((await meta(await current())).name))
|
|
3467
|
+
await stack.pop();
|
|
3468
|
+
if (name === "button") {
|
|
3469
|
+
const index = await inScope(["button"]);
|
|
3470
|
+
if (index > 0)
|
|
3471
|
+
await stack.truncate(index);
|
|
3472
|
+
await reconstruct();
|
|
3473
|
+
}
|
|
3474
|
+
if (name === "dt" || name === "dd") {
|
|
3475
|
+
await pop("dt");
|
|
3476
|
+
await pop("dd");
|
|
3477
|
+
}
|
|
3478
|
+
if (name === "option")
|
|
3479
|
+
await pop("option");
|
|
3480
|
+
if (name === "optgroup") {
|
|
3481
|
+
if ((await meta(await current())).name === "option")
|
|
3482
|
+
await stack.pop();
|
|
3483
|
+
if ((await meta(await current())).name === "optgroup")
|
|
3484
|
+
await stack.pop();
|
|
3485
|
+
}
|
|
3486
|
+
if (name === "tr") {
|
|
3487
|
+
await closeCell();
|
|
3488
|
+
await pop("tr");
|
|
3489
|
+
if ((await meta(await current())).name === "table") {
|
|
3490
|
+
const section = await make("element", "tbody");
|
|
3491
|
+
await append(await target(), section);
|
|
3492
|
+
await push(section);
|
|
3493
|
+
}
|
|
3494
|
+
}
|
|
3495
|
+
if (name === "td" || name === "th") {
|
|
3496
|
+
await closeCell();
|
|
3497
|
+
if ((await meta(await current())).name === "table") {
|
|
3498
|
+
const section = await make("element", "tbody");
|
|
3499
|
+
await append(await target(), section);
|
|
3500
|
+
await push(section);
|
|
3501
|
+
}
|
|
3502
|
+
if (["tbody", "thead", "tfoot"].includes((await meta(await current())).name)) {
|
|
3503
|
+
const row = await make("element", "tr");
|
|
3504
|
+
await append(await target(), row);
|
|
3505
|
+
await push(row);
|
|
3506
|
+
}
|
|
3507
|
+
}
|
|
3508
|
+
if (name === "tbody" || name === "thead" || name === "tfoot") {
|
|
3509
|
+
await closeCell();
|
|
3510
|
+
await pop("tr");
|
|
3511
|
+
if (["tbody", "thead", "tfoot"].includes((await meta(await current())).name))
|
|
3512
|
+
await stack.pop();
|
|
3513
|
+
}
|
|
3514
|
+
if (name === "col" && (await meta(await current())).name === "table") {
|
|
3515
|
+
const group = await make("element", "colgroup");
|
|
3516
|
+
await append(await target(), group);
|
|
3517
|
+
await push(group);
|
|
3518
|
+
}
|
|
3519
|
+
if (name === "a" && await activeAnchor())
|
|
3520
|
+
await adopt("a");
|
|
3521
|
+
if (formatting.has(name))
|
|
3522
|
+
await reconstruct();
|
|
3523
|
+
}
|
|
3524
|
+
const node = await make("element", ns === "svg" ? svgNames[name] ?? name : name, "", ns);
|
|
3525
|
+
const attributes = t.attributes;
|
|
3526
|
+
budget.charge("retainedBytes", attributes.reduce((sum, a) => sum + 64 + (a.name.length + a.value.length) * 2, 0));
|
|
3527
|
+
if (ns !== "html")
|
|
3528
|
+
for (const a of attributes) {
|
|
3529
|
+
if (ns === "svg")
|
|
3530
|
+
a.name = svgAttributes[a.name] ?? a.name;
|
|
3531
|
+
if (ns === "mathml" && a.name === "definitionurl")
|
|
3532
|
+
a.name = "definitionURL";
|
|
3533
|
+
const colon = a.name.indexOf(":");
|
|
3534
|
+
const prefix = a.name.slice(0, colon);
|
|
3535
|
+
if (colon > 0 && ["xml", "xmlns", "xlink"].includes(prefix))
|
|
3536
|
+
a.namespace = prefix;
|
|
3537
|
+
else if (a.name === "xmlns")
|
|
3538
|
+
a.namespace = "xmlns";
|
|
3539
|
+
}
|
|
3540
|
+
await setAttributes(node, attributes);
|
|
3541
|
+
const [parent, before] = ns === "html" && !tableAllowedElements.has(name) ? await location() : [await target(), void 0];
|
|
3542
|
+
await append(parent, node, before);
|
|
3543
|
+
if (name === "form" && ns === "html" && await find("template") < 0)
|
|
3544
|
+
form = node;
|
|
3545
|
+
if (["caption", "td", "th"].includes(name) && ns === "html")
|
|
3546
|
+
await active.push(0);
|
|
3547
|
+
if (name === "template" && ns === "html") {
|
|
3548
|
+
await tree.patch(node, { templateContents: await make("fragment") });
|
|
3549
|
+
await active.push(0);
|
|
3550
|
+
}
|
|
3551
|
+
if (ns === "html" && voidElements.has(name) || ns !== "html" && t.selfClosing)
|
|
3552
|
+
continue;
|
|
3553
|
+
await push(node);
|
|
3554
|
+
if (ns === "html" && formatting.has(name))
|
|
3555
|
+
await active.push(node);
|
|
3556
|
+
}
|
|
3557
|
+
return document;
|
|
3558
|
+
}
|
|
3559
|
+
|
|
3560
|
+
// packages/safe-bash-command-htmlq/src/stored-selectors.ts
|
|
3561
|
+
function lower(value) {
|
|
3562
|
+
let result = "";
|
|
3563
|
+
for (const c of value) result += c >= "A" && c <= "Z" ? String.fromCharCode(c.charCodeAt(0) + 32) : c;
|
|
3564
|
+
return result;
|
|
3565
|
+
}
|
|
3566
|
+
var StoredQueries = class {
|
|
3567
|
+
constructor(tree, text, storage, budget) {
|
|
3568
|
+
this.tree = tree;
|
|
3569
|
+
this.text = text;
|
|
3570
|
+
this.budget = budget;
|
|
3571
|
+
this.pending = new StoredSequence(storage);
|
|
3572
|
+
}
|
|
3573
|
+
tree;
|
|
3574
|
+
text;
|
|
3575
|
+
budget;
|
|
3576
|
+
pending;
|
|
3577
|
+
async literal(root, expected, insensitive = false, prefix = false) {
|
|
3578
|
+
const length = (await this.text.info(root)).length;
|
|
3579
|
+
this.budget.charge("work", length + expected.length);
|
|
3580
|
+
if (prefix ? length < expected.length : length !== expected.length) return false;
|
|
3581
|
+
let at = 0;
|
|
3582
|
+
if (insensitive) expected = lower(expected);
|
|
3583
|
+
for await (const original of this.text.chunks(root)) {
|
|
3584
|
+
const chunk = insensitive ? lower(original) : original;
|
|
3585
|
+
for (let i = 0; i < chunk.length && at < expected.length; i++, at++) if (chunk[i] !== expected[at]) return false;
|
|
3586
|
+
if (at === expected.length) return true;
|
|
3587
|
+
}
|
|
3588
|
+
return at === expected.length;
|
|
3589
|
+
}
|
|
3590
|
+
async equal(left, right) {
|
|
3591
|
+
if (left === right) return true;
|
|
3592
|
+
if ((await this.text.info(left)).length !== (await this.text.info(right)).length) return false;
|
|
3593
|
+
const a = this.text.chunks(left), b = this.text.chunks(right);
|
|
3594
|
+
let x = "", y = "", ax = 0, by = 0;
|
|
3595
|
+
try {
|
|
3596
|
+
for (; ; ) {
|
|
3597
|
+
if (ax === x.length) {
|
|
3598
|
+
x = (await a.next()).value ?? "";
|
|
3599
|
+
ax = 0;
|
|
3600
|
+
}
|
|
3601
|
+
if (by === y.length) {
|
|
3602
|
+
y = (await b.next()).value ?? "";
|
|
3603
|
+
by = 0;
|
|
3604
|
+
}
|
|
3605
|
+
if (!x || !y) return x === y;
|
|
3606
|
+
const length = Math.min(x.length - ax, y.length - by);
|
|
3607
|
+
this.budget.charge("work", length);
|
|
3608
|
+
if (x.slice(ax, ax + length) !== y.slice(by, by + length)) return false;
|
|
3609
|
+
ax += length;
|
|
3610
|
+
by += length;
|
|
3611
|
+
}
|
|
3612
|
+
} finally {
|
|
3613
|
+
await a.return(void 0);
|
|
3614
|
+
await b.return(void 0);
|
|
3615
|
+
}
|
|
3616
|
+
}
|
|
3617
|
+
async attribute(node, name) {
|
|
3618
|
+
this.budget.charge("work", name.length);
|
|
3619
|
+
this.budget.charge("retainedBytes", name.length * 2);
|
|
3620
|
+
const expected = node.namespace === "html" ? lower(name) : name;
|
|
3621
|
+
for await (const a of this.tree.attributes(node.id)) {
|
|
3622
|
+
this.budget.charge("work", 1);
|
|
3623
|
+
if (a.namespace === "none" && await this.literal(a.name, expected)) return a.value;
|
|
3624
|
+
}
|
|
3625
|
+
return void 0;
|
|
3626
|
+
}
|
|
3627
|
+
async word(root, expected, insensitive = false) {
|
|
3628
|
+
if (!expected) return false;
|
|
3629
|
+
for (const c of expected) if (cssSpace(c)) return false;
|
|
3630
|
+
if (insensitive) expected = lower(expected);
|
|
3631
|
+
let at = 0, matching = true;
|
|
3632
|
+
for await (const original of this.text.chunks(root)) {
|
|
3633
|
+
const chunk = insensitive ? lower(original) : original;
|
|
3634
|
+
this.budget.charge("work", chunk.length);
|
|
3635
|
+
for (let i = 0; i < chunk.length; i++) {
|
|
3636
|
+
const c = chunk[i];
|
|
3637
|
+
if (cssSpace(c)) {
|
|
3638
|
+
if (matching && at === expected.length) return true;
|
|
3639
|
+
at = 0;
|
|
3640
|
+
matching = true;
|
|
3641
|
+
} else {
|
|
3642
|
+
if (c !== expected[at]) matching = false;
|
|
3643
|
+
at++;
|
|
3644
|
+
}
|
|
3645
|
+
}
|
|
3646
|
+
}
|
|
3647
|
+
return matching && at === expected.length;
|
|
3648
|
+
}
|
|
3649
|
+
async contains(root, expected, insensitive) {
|
|
3650
|
+
if (!expected) return false;
|
|
3651
|
+
if (insensitive) expected = lower(expected);
|
|
3652
|
+
let tail = "";
|
|
3653
|
+
for await (const original of this.text.chunks(root)) {
|
|
3654
|
+
const chunk = tail + (insensitive ? lower(original) : original);
|
|
3655
|
+
this.budget.charge("work", chunk.length);
|
|
3656
|
+
if (chunk.includes(expected)) return true;
|
|
3657
|
+
tail = expected.length === 1 ? "" : chunk.slice(-(expected.length - 1));
|
|
3658
|
+
}
|
|
3659
|
+
return false;
|
|
3660
|
+
}
|
|
3661
|
+
async previous(id) {
|
|
3662
|
+
let n = (await this.tree.read(id)).previous;
|
|
3663
|
+
while (n) {
|
|
3664
|
+
const node = await this.tree.read(n);
|
|
3665
|
+
if (node.kind === "element") return n;
|
|
3666
|
+
this.budget.charge("work", 1);
|
|
3667
|
+
n = node.previous;
|
|
3668
|
+
}
|
|
3669
|
+
return 0;
|
|
3670
|
+
}
|
|
3671
|
+
async test(node, test) {
|
|
3672
|
+
const budget = this.budget;
|
|
3673
|
+
budget.charge("work", 1);
|
|
3674
|
+
if (test.kind === "type") {
|
|
3675
|
+
budget.charge("retainedBytes", test.value.length * 2);
|
|
3676
|
+
return test.namespace !== "none" && (test.value === "*" || await this.literal(node.name, node.namespace === "html" ? lower(test.value) : test.value));
|
|
3677
|
+
}
|
|
3678
|
+
if (test.kind === "id") {
|
|
3679
|
+
const value = await this.attribute(node, "id");
|
|
3680
|
+
return value !== void 0 && this.literal(value, test.value);
|
|
3681
|
+
}
|
|
3682
|
+
if (test.kind === "class") return this.word(await this.attribute(node, "class") ?? 0, test.value);
|
|
3683
|
+
if (test.kind === "attribute") {
|
|
3684
|
+
const value = await this.attribute(node, test.value), expected = test.expected;
|
|
3685
|
+
if (value === void 0) return false;
|
|
3686
|
+
switch (test.operator) {
|
|
3687
|
+
case "":
|
|
3688
|
+
return true;
|
|
3689
|
+
case "=":
|
|
3690
|
+
return this.literal(value, expected, test.insensitive);
|
|
3691
|
+
case "^=":
|
|
3692
|
+
return !!expected && this.literal(value, expected, test.insensitive, true);
|
|
3693
|
+
case "$=": {
|
|
3694
|
+
const length = (await this.text.info(value)).length;
|
|
3695
|
+
return !!expected && length >= expected.length && this.literal(await this.text.slice(value, length - expected.length), expected, test.insensitive);
|
|
3696
|
+
}
|
|
3697
|
+
case "*=":
|
|
3698
|
+
return this.contains(value, expected, test.insensitive);
|
|
3699
|
+
case "|=":
|
|
3700
|
+
return await this.literal(value, expected, test.insensitive) || this.literal(value, expected + "-", test.insensitive, true);
|
|
3701
|
+
case "~=":
|
|
3702
|
+
return this.word(value, expected, test.insensitive);
|
|
3703
|
+
default:
|
|
3704
|
+
return false;
|
|
3705
|
+
}
|
|
3706
|
+
}
|
|
3707
|
+
if (test.kind !== "pseudo") return false;
|
|
3708
|
+
const p = test.value;
|
|
3709
|
+
if (p === "not") return !await this.matches(node.id, test.negated);
|
|
3710
|
+
if (p === "root" || p === "scope") return !!node.parent && (await this.tree.read(node.parent)).kind === "document";
|
|
3711
|
+
if (p === "any-link" || p === "link") return node.namespace === "html" && (await this.literal(node.name, "a") || await this.literal(node.name, "area") || await this.literal(node.name, "link")) && await this.attribute(node, "href") !== void 0;
|
|
3712
|
+
if (p === "empty") {
|
|
3713
|
+
for await (const child of this.tree.children(node.id)) {
|
|
3714
|
+
budget.charge("work", 1);
|
|
3715
|
+
const n = await this.tree.read(child);
|
|
3716
|
+
if (n.kind === "element" || n.kind === "text" && (await this.text.info(n.data)).length > 0) return false;
|
|
3717
|
+
}
|
|
3718
|
+
return true;
|
|
3719
|
+
}
|
|
3720
|
+
if (["visited", "active", "focus", "hover", "enabled", "disabled", "checked", "indeterminate"].includes(p)) return false;
|
|
3721
|
+
let index = 0, count = 0;
|
|
3722
|
+
if (node.parent) for await (const child of this.tree.children(node.parent)) {
|
|
3723
|
+
budget.charge("work", 1);
|
|
3724
|
+
const n = await this.tree.read(child);
|
|
3725
|
+
if (n.kind !== "element" || p.includes("of-type") && (n.namespace !== node.namespace || !await this.equal(n.name, node.name))) continue;
|
|
3726
|
+
count++;
|
|
3727
|
+
if (child === node.id) index = count;
|
|
3728
|
+
}
|
|
3729
|
+
if (!index) return false;
|
|
3730
|
+
if (p.startsWith("first-")) return index === 1;
|
|
3731
|
+
if (p.startsWith("last-")) return index === count;
|
|
3732
|
+
if (p.startsWith("only-")) return count === 1;
|
|
3733
|
+
if (p.includes("last")) index = count - index + 1;
|
|
3734
|
+
const delta = index - test.b;
|
|
3735
|
+
return test.a === 0 ? delta === 0 : delta / test.a >= 0 && delta % test.a === 0;
|
|
3736
|
+
}
|
|
3737
|
+
async matches(id, program) {
|
|
3738
|
+
const marker = this.pending.length;
|
|
3739
|
+
const push = async (node, at, depth, axis) => {
|
|
3740
|
+
await this.pending.push(node);
|
|
3741
|
+
await this.pending.push(at);
|
|
3742
|
+
await this.pending.push(depth);
|
|
3743
|
+
await this.pending.push(axis);
|
|
3744
|
+
};
|
|
3745
|
+
try {
|
|
3746
|
+
for (const parts of program) {
|
|
3747
|
+
await push(id, parts.length - 1, 0, 0);
|
|
3748
|
+
while (this.pending.length > marker) {
|
|
3749
|
+
const axis = await this.pending.pop(), depth = await this.pending.pop(), at = await this.pending.pop();
|
|
3750
|
+
const node = await this.tree.read(await this.pending.pop());
|
|
3751
|
+
if (axis < 0) {
|
|
3752
|
+
const next2 = axis === -2 ? await this.previous(node.id) : node.parent;
|
|
3753
|
+
if (next2) await push(next2, at, depth, -axis);
|
|
3754
|
+
continue;
|
|
3755
|
+
}
|
|
3756
|
+
if (axis > 0) await push(node.id, at, depth, -axis);
|
|
3757
|
+
if (axis === 1) this.budget.charge("work", 1);
|
|
3758
|
+
this.budget.bound("depth", depth);
|
|
3759
|
+
this.budget.charge("work", 1);
|
|
3760
|
+
if (node.kind !== "element") continue;
|
|
3761
|
+
let matches = true;
|
|
3762
|
+
for (const test of parts[at].tests) if (!await this.test(node, test)) {
|
|
3763
|
+
matches = false;
|
|
3764
|
+
break;
|
|
3765
|
+
}
|
|
3766
|
+
if (!matches) continue;
|
|
3767
|
+
if (!at) return true;
|
|
3768
|
+
const relation = parts[at].relation;
|
|
3769
|
+
const next = relation === "+" || relation === "~" ? await this.previous(node.id) : node.parent;
|
|
3770
|
+
if (next) await push(next, at - 1, depth + 1, relation === "~" ? 2 : relation === ">" || relation === "+" ? 0 : 1);
|
|
3771
|
+
}
|
|
3772
|
+
}
|
|
3773
|
+
return false;
|
|
3774
|
+
} finally {
|
|
3775
|
+
await this.pending.truncate(marker);
|
|
3776
|
+
}
|
|
3777
|
+
}
|
|
3778
|
+
};
|
|
3779
|
+
function selectStoredHtml(root, selector, tree, text, storage, options) {
|
|
3780
|
+
const budget = new HtmlBudget(options), program = new SelectorParser(selector, budget).list();
|
|
3781
|
+
const query = new StoredQueries(tree, text, storage, budget);
|
|
3782
|
+
return (async function* () {
|
|
3783
|
+
let id = root, start = true, depth = 0;
|
|
3784
|
+
while (id) {
|
|
3785
|
+
budget.charge("work", 1);
|
|
3786
|
+
budget.bound("depth", depth);
|
|
3787
|
+
const node = await tree.read(id), entering = start;
|
|
3788
|
+
if (start) {
|
|
3789
|
+
if (node.first) {
|
|
3790
|
+
id = node.first;
|
|
3791
|
+
depth++;
|
|
3792
|
+
} else start = false;
|
|
3793
|
+
} else {
|
|
3794
|
+
if (id === root) return;
|
|
3795
|
+
if (node.next) {
|
|
3796
|
+
id = node.next;
|
|
3797
|
+
start = true;
|
|
3798
|
+
} else {
|
|
3799
|
+
id = node.parent;
|
|
3800
|
+
depth = Math.max(0, depth - 1);
|
|
3801
|
+
}
|
|
3802
|
+
}
|
|
3803
|
+
if (entering) {
|
|
3804
|
+
budget.charge("work", 1);
|
|
3805
|
+
if (node.kind === "element" && await query.matches(node.id, program)) yield node.id;
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3808
|
+
})();
|
|
3809
|
+
}
|
|
3810
|
+
|
|
3811
|
+
// packages/safe-bash-command-htmlq/src/stored-serializer.ts
|
|
3812
|
+
async function knownName(text, name) {
|
|
3813
|
+
if ((await text.info(name)).length > 32) return "";
|
|
3814
|
+
let value = "";
|
|
3815
|
+
for await (const chunk of text.chunks(name)) value += chunk;
|
|
3816
|
+
return value;
|
|
3817
|
+
}
|
|
3818
|
+
async function storedWhitespace(text, root) {
|
|
3819
|
+
for await (const chunk of text.chunks(root)) if (!rustWhitespaceOnly(chunk)) return false;
|
|
3820
|
+
return true;
|
|
3821
|
+
}
|
|
3822
|
+
async function* escaped2(text, root, attribute2) {
|
|
3823
|
+
for await (const chunk of text.chunks(root)) {
|
|
3824
|
+
let result = "";
|
|
3825
|
+
for (const c of chunk) result += c === "&" ? "&" : c === "\xA0" ? " " : attribute2 && c === '"' ? """ : !attribute2 && c === "<" ? "<" : !attribute2 && c === ">" ? ">" : c;
|
|
3826
|
+
yield result;
|
|
3827
|
+
}
|
|
3828
|
+
}
|
|
3829
|
+
async function* serializeStoredHtml(root, tree, text, options, mode = "normalized") {
|
|
3830
|
+
const budget = new HtmlBudget(options);
|
|
3831
|
+
let id = root, entering = true, depth = 0, indent = 0, previousWasBlock = false;
|
|
3832
|
+
function* newline() {
|
|
3833
|
+
yield "\n";
|
|
3834
|
+
for (let remaining = indent; remaining > 0; remaining -= 2048) yield " ".repeat(Math.min(2048, remaining));
|
|
3835
|
+
}
|
|
3836
|
+
while (id) {
|
|
3837
|
+
budget.charge("work", 1);
|
|
3838
|
+
budget.bound("depth", depth);
|
|
3839
|
+
budget.bound("retainedBytes", (depth + 1) * 32);
|
|
3840
|
+
const node = await tree.read(id), name = await knownName(text, node.name);
|
|
3841
|
+
let close = node.kind === "element";
|
|
3842
|
+
if (entering) {
|
|
3843
|
+
if (node.kind === "text") {
|
|
3844
|
+
let emit = true;
|
|
3845
|
+
if (mode === "pretty") {
|
|
3846
|
+
budget.charge("work", (await text.info(node.data)).length);
|
|
3847
|
+
emit = !await storedWhitespace(text, node.data);
|
|
3848
|
+
if (emit) {
|
|
3849
|
+
if (previousWasBlock) yield* newline();
|
|
3850
|
+
previousWasBlock = false;
|
|
3851
|
+
}
|
|
3852
|
+
}
|
|
3853
|
+
if (emit) {
|
|
3854
|
+
const parent = node.parent ? await tree.read(node.parent) : void 0;
|
|
3855
|
+
if (parent?.namespace === "html" && rawElements.has(await knownName(text, parent.name))) yield* text.chunks(node.data);
|
|
3856
|
+
else yield* escaped2(text, node.data, false);
|
|
3857
|
+
}
|
|
3858
|
+
} else if (node.kind === "comment") {
|
|
3859
|
+
yield "<!--";
|
|
3860
|
+
yield* text.chunks(node.data);
|
|
3861
|
+
yield "-->";
|
|
3862
|
+
} else if (node.kind === "doctype") {
|
|
3863
|
+
yield "<!DOCTYPE ";
|
|
3864
|
+
yield* text.chunks(node.data);
|
|
3865
|
+
yield ">";
|
|
3866
|
+
} else {
|
|
3867
|
+
if (node.kind === "element") {
|
|
3868
|
+
if (mode === "pretty") {
|
|
3869
|
+
if (!inlineElements.has(name) || previousWasBlock) yield* newline();
|
|
3870
|
+
indent += 2;
|
|
3871
|
+
}
|
|
3872
|
+
yield "<";
|
|
3873
|
+
yield* text.chunks(node.name);
|
|
3874
|
+
for await (const a of tree.attributes(id)) {
|
|
3875
|
+
yield " ";
|
|
3876
|
+
yield* text.chunks(a.name);
|
|
3877
|
+
yield '="';
|
|
3878
|
+
yield* escaped2(text, a.value, true);
|
|
3879
|
+
yield '"';
|
|
3880
|
+
}
|
|
3881
|
+
yield ">";
|
|
3882
|
+
if (node.namespace === "html" && voidElements.has(name)) {
|
|
3883
|
+
close = false;
|
|
3884
|
+
if (mode === "pretty") {
|
|
3885
|
+
indent -= 2;
|
|
3886
|
+
previousWasBlock = !inlineElements.has(name);
|
|
3887
|
+
if (previousWasBlock) yield* newline();
|
|
3888
|
+
}
|
|
3889
|
+
}
|
|
3890
|
+
}
|
|
3891
|
+
if ((close || node.kind !== "element") && node.first) {
|
|
3892
|
+
id = node.first;
|
|
3893
|
+
depth++;
|
|
3894
|
+
entering = true;
|
|
3895
|
+
continue;
|
|
3896
|
+
}
|
|
3897
|
+
}
|
|
3898
|
+
}
|
|
3899
|
+
if (close) {
|
|
3900
|
+
if (mode === "pretty") {
|
|
3901
|
+
indent -= 2;
|
|
3902
|
+
previousWasBlock = !inlineElements.has(name);
|
|
3903
|
+
if (previousWasBlock) yield* newline();
|
|
3904
|
+
}
|
|
3905
|
+
yield "</";
|
|
3906
|
+
yield* text.chunks(node.name);
|
|
3907
|
+
yield ">";
|
|
3908
|
+
}
|
|
3909
|
+
if (id === root) return;
|
|
3910
|
+
if (node.next) {
|
|
3911
|
+
id = node.next;
|
|
3912
|
+
entering = true;
|
|
3913
|
+
} else {
|
|
3914
|
+
id = node.parent;
|
|
3915
|
+
depth--;
|
|
3916
|
+
entering = false;
|
|
3917
|
+
}
|
|
3918
|
+
}
|
|
3919
|
+
}
|
|
3920
|
+
|
|
3921
|
+
// packages/safe-bash-command-htmlq/src/stored-project.ts
|
|
3922
|
+
function baseUrl2(value) {
|
|
3923
|
+
try {
|
|
3924
|
+
return new URL(value);
|
|
3925
|
+
} catch {
|
|
3926
|
+
return void 0;
|
|
3927
|
+
}
|
|
3928
|
+
}
|
|
3929
|
+
async function* projectStoredHtmlq(source, args, options, storage) {
|
|
3930
|
+
const budget = new HtmlBudget(options);
|
|
3931
|
+
let operations = 0, characters = 0;
|
|
3932
|
+
const tree = new DocumentStore(storage, () => {
|
|
3933
|
+
budget.check();
|
|
3934
|
+
if (++operations % 2048 === 0) return yieldTurn3(options.signal);
|
|
3935
|
+
});
|
|
3936
|
+
const text = new TextStore(storage, async (count) => {
|
|
3937
|
+
characters += count;
|
|
3938
|
+
if (characters >= 4096) {
|
|
3939
|
+
characters = 0;
|
|
3940
|
+
await yieldTurn3(options.signal);
|
|
3941
|
+
}
|
|
3942
|
+
budget.check();
|
|
3943
|
+
});
|
|
3944
|
+
const document = await parseStoredHtml(source, tree, text, storage, options);
|
|
3945
|
+
const query = new StoredQueries(tree, text, storage, budget);
|
|
3946
|
+
const string = async (id) => {
|
|
3947
|
+
let result = "";
|
|
3948
|
+
for await (const chunk of text.chunks(id)) result += chunk;
|
|
3949
|
+
return result;
|
|
3950
|
+
};
|
|
3951
|
+
let base = baseUrl2(args.base);
|
|
3952
|
+
if (args.detectBase) {
|
|
3953
|
+
for await (const first of selectStoredHtml(document, "base", tree, text, storage, options)) {
|
|
3954
|
+
base = baseUrl2(await string(await query.attribute(await tree.read(first), "href") ?? 0)) ?? base;
|
|
3955
|
+
break;
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3958
|
+
const selected = selectStoredHtml(document, args.selector, tree, text, storage, options);
|
|
3959
|
+
let removal = "";
|
|
3960
|
+
if (args.removeNodes.length) {
|
|
3961
|
+
removal = args.removeNodes.join(",");
|
|
3962
|
+
budget.charge("retainedBytes", removal.length * 2);
|
|
3963
|
+
try {
|
|
3964
|
+
selectStoredHtml(document, removal, tree, text, storage, options);
|
|
3965
|
+
} catch (error) {
|
|
3966
|
+
if (!(error instanceof HtmlError) || error.code !== "E_SELECTOR") throw error;
|
|
3967
|
+
removal = "";
|
|
3968
|
+
}
|
|
3969
|
+
}
|
|
3970
|
+
const snapshot = new StoredSequence(storage), matches = new StoredSequence(storage);
|
|
3971
|
+
if (removal) for await (const node of selected) {
|
|
3972
|
+
budget.charge("retainedBytes", 8);
|
|
3973
|
+
await snapshot.push(node);
|
|
3974
|
+
}
|
|
3975
|
+
async function* nodes() {
|
|
3976
|
+
if (!removal) {
|
|
3977
|
+
yield* selected;
|
|
3978
|
+
return;
|
|
3979
|
+
}
|
|
3980
|
+
for (let i = 0; i < snapshot.length; i++) yield await snapshot.get(i);
|
|
3981
|
+
}
|
|
3982
|
+
async function* descendants(root) {
|
|
3983
|
+
let id = root, depth = 0;
|
|
3984
|
+
while (id) {
|
|
3985
|
+
const node = await tree.read(id);
|
|
3986
|
+
budget.charge("work", 1);
|
|
3987
|
+
budget.bound("depth", depth);
|
|
3988
|
+
yield id;
|
|
3989
|
+
if (node.first) {
|
|
3990
|
+
id = node.first;
|
|
3991
|
+
depth++;
|
|
3992
|
+
continue;
|
|
3993
|
+
}
|
|
3994
|
+
while (id !== root && !(await tree.read(id)).next) {
|
|
3995
|
+
id = (await tree.read(id)).parent;
|
|
3996
|
+
depth--;
|
|
3997
|
+
}
|
|
3998
|
+
if (id === root) return;
|
|
3999
|
+
id = (await tree.read(id)).next;
|
|
4000
|
+
}
|
|
4001
|
+
}
|
|
4002
|
+
const encoder = new TextEncoder();
|
|
4003
|
+
async function* output(value) {
|
|
4004
|
+
let pending = "";
|
|
4005
|
+
for (const c of value) {
|
|
4006
|
+
budget.charge("work", 1);
|
|
4007
|
+
if (pending.length + c.length > 2048) {
|
|
4008
|
+
budget.charge("retainedBytes", pending.length * 3);
|
|
4009
|
+
const bytes = encoder.encode(pending);
|
|
4010
|
+
budget.charge("outputBytes", bytes.length);
|
|
4011
|
+
yield bytes;
|
|
4012
|
+
budget.check();
|
|
4013
|
+
pending = "";
|
|
4014
|
+
}
|
|
4015
|
+
budget.charge("retainedBytes", c.length * 2);
|
|
4016
|
+
pending += c;
|
|
4017
|
+
}
|
|
4018
|
+
if (pending) {
|
|
4019
|
+
budget.charge("retainedBytes", pending.length * 3);
|
|
4020
|
+
const bytes = encoder.encode(pending);
|
|
4021
|
+
budget.charge("outputBytes", bytes.length);
|
|
4022
|
+
yield bytes;
|
|
4023
|
+
budget.check();
|
|
4024
|
+
}
|
|
4025
|
+
}
|
|
4026
|
+
let index = 0;
|
|
4027
|
+
for await (const id of nodes()) {
|
|
4028
|
+
if (index++ % 64 === 0) {
|
|
4029
|
+
await yieldTurn3(options.signal);
|
|
4030
|
+
budget.check();
|
|
4031
|
+
}
|
|
4032
|
+
if (removal) {
|
|
4033
|
+
let ancestor = id;
|
|
4034
|
+
for (; ; ) {
|
|
4035
|
+
const parent = (await tree.read(ancestor)).parent;
|
|
4036
|
+
if (!parent) break;
|
|
4037
|
+
budget.charge("work", 1);
|
|
4038
|
+
ancestor = parent;
|
|
4039
|
+
}
|
|
4040
|
+
if (ancestor !== document) continue;
|
|
4041
|
+
await matches.truncate(0);
|
|
4042
|
+
let removedRoot = false;
|
|
4043
|
+
for await (const match of selectStoredHtml(id, removal, tree, text, storage, options)) {
|
|
4044
|
+
budget.charge("retainedBytes", 8);
|
|
4045
|
+
await matches.push(match);
|
|
4046
|
+
if (match === id) removedRoot = true;
|
|
4047
|
+
}
|
|
4048
|
+
for (let i = 0; i < matches.length; i++) {
|
|
4049
|
+
const match = await matches.get(i), parent = (await tree.read(match)).parent;
|
|
4050
|
+
const count = parent ? (await tree.read(parent)).childCount : 0;
|
|
4051
|
+
budget.charge("work", parent ? count : 1);
|
|
4052
|
+
budget.charge("retainedBytes", count * 8);
|
|
4053
|
+
await tree.detach(match);
|
|
4054
|
+
}
|
|
4055
|
+
if (removedRoot) continue;
|
|
4056
|
+
}
|
|
4057
|
+
const node = await tree.read(id);
|
|
4058
|
+
if (base && node.namespace === "html" && ["a", "area", "link"].includes(await knownName(text, node.name))) {
|
|
4059
|
+
for await (const a of tree.attributes(id)) {
|
|
4060
|
+
if (a.namespace !== "none" || !await query.literal(a.name, "href")) continue;
|
|
4061
|
+
const href = await string(a.value);
|
|
4062
|
+
budget.charge("work", href.length + base.href.length);
|
|
4063
|
+
let value;
|
|
4064
|
+
if (href.startsWith("////")) {
|
|
4065
|
+
let i = 0;
|
|
4066
|
+
while (href[i] === "/") i++;
|
|
4067
|
+
value = href.slice(i);
|
|
4068
|
+
} else {
|
|
4069
|
+
try {
|
|
4070
|
+
value = new URL(href, base).href;
|
|
4071
|
+
} catch {
|
|
4072
|
+
value = base.href;
|
|
4073
|
+
}
|
|
4074
|
+
}
|
|
4075
|
+
budget.charge("work", node.attributeCount + value.length);
|
|
4076
|
+
budget.charge("retainedBytes", node.attributeCount * 64 + value.length * 2);
|
|
4077
|
+
await tree.replaceAttribute(a.id, await text.from(value));
|
|
4078
|
+
break;
|
|
4079
|
+
}
|
|
4080
|
+
}
|
|
4081
|
+
if (args.attributes.length) {
|
|
4082
|
+
for (const name of args.attributes) {
|
|
4083
|
+
budget.charge("work", node.attributeCount + name.length);
|
|
4084
|
+
for await (const a of tree.attributes(id)) {
|
|
4085
|
+
if (a.namespace !== "none" || !await query.literal(a.name, name)) continue;
|
|
4086
|
+
for await (const chunk of text.chunks(a.value)) yield* output(chunk);
|
|
4087
|
+
yield* output("\n");
|
|
4088
|
+
break;
|
|
4089
|
+
}
|
|
4090
|
+
}
|
|
4091
|
+
} else if (args.text) {
|
|
4092
|
+
for await (const descendant of descendants(id)) {
|
|
4093
|
+
const n = await tree.read(descendant);
|
|
4094
|
+
if (n.kind !== "text") continue;
|
|
4095
|
+
budget.charge("work", (await text.info(n.data)).length);
|
|
4096
|
+
if (args.ignoreWhitespace && await storedWhitespace(text, n.data)) continue;
|
|
4097
|
+
for await (const chunk of text.chunks(n.data)) yield* output(chunk);
|
|
4098
|
+
if (args.ignoreWhitespace) yield* output("\n");
|
|
4099
|
+
}
|
|
4100
|
+
yield* output("\n");
|
|
4101
|
+
} else {
|
|
4102
|
+
for await (const piece of serializeStoredHtml(id, tree, text, options, args.pretty ? "pretty" : "normalized")) yield* output(piece);
|
|
4103
|
+
yield* output("\n");
|
|
4104
|
+
}
|
|
4105
|
+
}
|
|
4106
|
+
}
|
|
4107
|
+
|
|
4108
|
+
// packages/safe-bash-command-htmlq/src/staged-output.ts
|
|
4109
|
+
import { normalizePath } from "@poe-platform/safe-fs/core";
|
|
4110
|
+
async function publishStagedHtmlq(fs, path, source, signal) {
|
|
4111
|
+
const target = await fs.prepareStagingResolution(normalizePath(path), { signal });
|
|
4112
|
+
target.validate();
|
|
4113
|
+
if (target.destination && target.destination.type !== "file")
|
|
4114
|
+
throw new HtmlError("E_UNSUPPORTED", "Output must be a regular VFS file");
|
|
4115
|
+
let stage;
|
|
4116
|
+
let failure;
|
|
4117
|
+
try {
|
|
4118
|
+
const parentPath = target.path.slice(0, target.path.lastIndexOf("/"));
|
|
4119
|
+
stage = await fs.createStagedFile(
|
|
4120
|
+
`${parentPath}/.htmlq-${crypto.randomUUID()}`,
|
|
4121
|
+
"output",
|
|
4122
|
+
{ type: "file", data: new Uint8Array() },
|
|
4123
|
+
{
|
|
4124
|
+
parent: target.parent,
|
|
4125
|
+
retainCleanup: true,
|
|
4126
|
+
signal,
|
|
4127
|
+
mode: target.destination ? target.destination.mode & 4095 : 438
|
|
4128
|
+
}
|
|
4129
|
+
);
|
|
4130
|
+
if (!stage.writer || !stage.cleanup)
|
|
4131
|
+
throw new HtmlError("E_UNSUPPORTED", "Output requires retained staging handles");
|
|
4132
|
+
signal.throwIfAborted();
|
|
4133
|
+
for await (const bytes of source) {
|
|
4134
|
+
for (let offset = 0; offset < bytes.length; offset += 16384) {
|
|
4135
|
+
signal.throwIfAborted();
|
|
4136
|
+
await stage.writer.write(bytes.slice(offset, offset + 16384), { signal });
|
|
4137
|
+
}
|
|
4138
|
+
}
|
|
4139
|
+
const stat = await stage.writer.finish({ signal });
|
|
4140
|
+
signal.throwIfAborted();
|
|
4141
|
+
target.validate();
|
|
4142
|
+
await fs.publishStagedFile({ ...stage, file: { ...stage.file, stat } }, target.path, {
|
|
4143
|
+
parent: target.parent,
|
|
4144
|
+
destination: target.destination,
|
|
4145
|
+
ancestors: target.ancestors,
|
|
4146
|
+
commitGuard: target.validate,
|
|
4147
|
+
preserveIdentity: target.destination !== null,
|
|
4148
|
+
signal
|
|
4149
|
+
});
|
|
4150
|
+
} catch (error) {
|
|
4151
|
+
failure = { error };
|
|
4152
|
+
}
|
|
4153
|
+
const cleanupErrors = [];
|
|
4154
|
+
if (stage?.cleanup) {
|
|
4155
|
+
try {
|
|
4156
|
+
await stage.cleanup.remove();
|
|
4157
|
+
} catch (error) {
|
|
4158
|
+
cleanupErrors.push(error);
|
|
4159
|
+
}
|
|
4160
|
+
try {
|
|
4161
|
+
await stage.cleanup.close();
|
|
4162
|
+
} catch (error) {
|
|
4163
|
+
cleanupErrors.push(error);
|
|
4164
|
+
}
|
|
4165
|
+
} else if (stage) {
|
|
4166
|
+
try {
|
|
4167
|
+
await fs.removeStagedFile(stage);
|
|
4168
|
+
} catch (error) {
|
|
4169
|
+
cleanupErrors.push(error);
|
|
4170
|
+
}
|
|
4171
|
+
}
|
|
4172
|
+
if (cleanupErrors.length) {
|
|
4173
|
+
if (failure) cleanupErrors.unshift(failure.error);
|
|
4174
|
+
throw new AggregateError(cleanupErrors, "htmlq staged output cleanup failed");
|
|
4175
|
+
}
|
|
4176
|
+
if (failure) throw failure.error;
|
|
4177
|
+
}
|
|
2765
4178
|
|
|
2766
4179
|
// packages/safe-bash-command-htmlq/src/command.ts
|
|
2767
4180
|
function admittedLimits(overrides = {}) {
|
|
@@ -2774,6 +4187,14 @@ function admittedLimits(overrides = {}) {
|
|
|
2774
4187
|
}
|
|
2775
4188
|
return Object.freeze(limits);
|
|
2776
4189
|
}
|
|
4190
|
+
function cancellationReason(error, signal, seen = /* @__PURE__ */ new Set()) {
|
|
4191
|
+
if (error instanceof HtmlCancellationError && error.signal === signal) return signal.reason;
|
|
4192
|
+
if (!(error instanceof AggregateError) || seen.has(error)) return error;
|
|
4193
|
+
seen.add(error);
|
|
4194
|
+
const errors = error.errors.map((failure) => cancellationReason(failure, signal, seen));
|
|
4195
|
+
seen.delete(error);
|
|
4196
|
+
return errors.some((failure, index) => !Object.is(failure, error.errors[index])) ? new AggregateError(errors, error.message, { cause: error }) : error;
|
|
4197
|
+
}
|
|
2777
4198
|
async function htmlq(context, configuration = {}) {
|
|
2778
4199
|
const sdkArgv = configuration.argv;
|
|
2779
4200
|
const controller = new AbortController();
|
|
@@ -2785,6 +4206,7 @@ async function htmlq(context, configuration = {}) {
|
|
|
2785
4206
|
});
|
|
2786
4207
|
const budget = new HtmlBudget(options);
|
|
2787
4208
|
let stdout, stderr;
|
|
4209
|
+
let storage;
|
|
2788
4210
|
let task = Promise.resolve(void 0), closing;
|
|
2789
4211
|
let accepting = true;
|
|
2790
4212
|
const cleanup = () => {
|
|
@@ -2794,7 +4216,7 @@ async function htmlq(context, configuration = {}) {
|
|
|
2794
4216
|
await Promise.allSettled([task]);
|
|
2795
4217
|
context.signal.removeEventListener("abort", abort);
|
|
2796
4218
|
stdout?.signal.removeEventListener("abort", consumerAbort);
|
|
2797
|
-
const results = await Promise.allSettled([stdout?.close(), stderr?.close()]);
|
|
4219
|
+
const results = await Promise.allSettled([stdout?.close(), stderr?.close(), storage?.close()]);
|
|
2798
4220
|
const failures = results.filter((r) => r.status === "rejected").map((r) => r.reason);
|
|
2799
4221
|
if (failures.length) throw new AggregateError(failures, "htmlq output cleanup failed");
|
|
2800
4222
|
});
|
|
@@ -2940,7 +4362,8 @@ async function htmlq(context, configuration = {}) {
|
|
|
2940
4362
|
};
|
|
2941
4363
|
}
|
|
2942
4364
|
};
|
|
2943
|
-
|
|
4365
|
+
storage = new PagedStorage({ ...context, signal: options.signal }, 16);
|
|
4366
|
+
const rendered = projectStoredHtmlq(admittedInput, args, options, storage);
|
|
2944
4367
|
if (args.output === "-") {
|
|
2945
4368
|
if (options.limits.outputBytes === Infinity && options.limits.retainedBytes === Infinity) {
|
|
2946
4369
|
const batch = new Uint8Array(16384);
|
|
@@ -3056,7 +4479,7 @@ async function htmlq(context, configuration = {}) {
|
|
|
3056
4479
|
try {
|
|
3057
4480
|
result = await task;
|
|
3058
4481
|
} catch (error) {
|
|
3059
|
-
failure = { error };
|
|
4482
|
+
failure = { error: cancellationReason(error, options.signal) };
|
|
3060
4483
|
}
|
|
3061
4484
|
try {
|
|
3062
4485
|
await cleanup();
|